Stellarium  25.4
Public Slots | Public Member Functions | Static Public Attributes
scm::ScmDraw Class Reference

Public Slots

void setSearchMode (bool b)
 Is called when the search dialog is opend and closed.
 
void setMoveToAnotherStart ()
 Is called when the the user is moved to another star.
 

Public Member Functions

void drawLines (StelCore *core) const
 Draws the constellation lines that are currently being edited. More...
 
void handleMouseClicks (QMouseEvent *)
 Handle mouse clicks. More...
 
bool handleMouseMoves (int x, int y, Qt::MouseButtons b)
 Handle mouse moves. More...
 
void handleKeys (QKeyEvent *e)
 Handle key events. More...
 
std::optional< SkyPointfindNearestPoint (int x, int y, StelProjectorP prj) const
 Finds the nearest sky point to the given position. More...
 
void undoLastLine ()
 Undo the last drawn line.
 
std::vector< ConstellationLinegetConstellationLines () const
 Gets the lines of the constellation. More...
 
void loadLines (const std::vector< ConstellationLine > &lines)
 Loads constellation lines into the buffer. More...
 
void setTool (DrawTools tool)
 Set the active draw tool. More...
 
void setDrawingMode (DrawingMode mode)
 Sets the drawing mode. More...
 
void resetDrawing ()
 Resets the currently drawn lines.
 

Static Public Attributes

static const StelCore::FrameType drawFrame = StelCore::FrameJ2000
 The frame that is used for calculation and is drawn on.
 

Member Function Documentation

◆ drawLines()

void scm::ScmDraw::drawLines ( StelCore core) const

Draws the constellation lines that are currently being edited.

Parameters
coreThe core used for drawing the line.

◆ findNearestPoint()

std::optional<SkyPoint> scm::ScmDraw::findNearestPoint ( int  x,
int  y,
StelProjectorP  prj 
) const

Finds the nearest sky point to the given position.

Parameters
xThe x viewport coordinate of the mouse.
yThe y viewport coordinate of the mouse.
prjThe projector to use for the calculation.
Returns
std::optional<SkyPoint> A point in the sky or std::nullopt if no point was found.

◆ getConstellationLines()

std::vector<ConstellationLine> scm::ScmDraw::getConstellationLines ( ) const

Gets the lines of the constellation.

Returns
std::vector<ConstellationLine> The drawn constellation lines.

◆ handleKeys()

void scm::ScmDraw::handleKeys ( QKeyEvent *  e)

Handle key events.

Please note that most of the interactions will be done through the GUI module.

Parameters
ethe Key event
Returns
set the event as accepted if it was intercepted

◆ handleMouseClicks()

void scm::ScmDraw::handleMouseClicks ( QMouseEvent *  )

Handle mouse clicks.

Please note that most of the interactions will be done through the GUI module.

Returns
set the event as accepted if it was intercepted

◆ handleMouseMoves()

bool scm::ScmDraw::handleMouseMoves ( int  x,
int  y,
Qt::MouseButtons  b 
)

Handle mouse moves.

Please note that most of the interactions will be done through the GUI module.

Returns
true if the event was intercepted

◆ loadLines()

void scm::ScmDraw::loadLines ( const std::vector< ConstellationLine > &  lines)

Loads constellation lines into the buffer.

Parameters
linesThe lines to load.

◆ setDrawingMode()

void scm::ScmDraw::setDrawingMode ( DrawingMode  mode)
inline

Sets the drawing mode.

Parameters
modeThe drawing mode to use.

◆ setTool()

void scm::ScmDraw::setTool ( DrawTools  tool)

Set the active draw tool.

Parameters
toolThe tool to be used.