Engauge Digitizer 2
Loading...
Searching...
No Matches
CentipedeStateBuildCartesian Class Reference

Class for period while building cartesian centipedes. More...

#include <CentipedeStateBuildCartesian.h>

Inheritance diagram for CentipedeStateBuildCartesian:
Inheritance graph
Collaboration diagram for CentipedeStateBuildCartesian:
Collaboration graph

Public Member Functions

 CentipedeStateBuildCartesian (CentipedeStateContext &context)
 Single constructor.
virtual ~CentipedeStateBuildCartesian ()
virtual void begin ()
 Method that is called at the exact moment a state is entered. Typically called just after end for the previous stat.
virtual void end ()
 Method that is called at the exact moment a state is exited. Typically called just before start of the next stat.
virtual void handleKeyPress (Qt::Key key, bool atLeastOneSelectedItem)
 Handle key press event.
virtual void handleMouseMove (QPointF posScreen)
 Handle mouse move event.
virtual void handleMousePress (QPointF posScreen)
 Handle mouse press event.
virtual void handleMouseRelease (QPointF posScreen)
 Handle mouse release event.
Public Member Functions inherited from CentipedeStateAbstractBase
 CentipedeStateAbstractBase (CentipedeStateContext &context)
 Single constructor.
virtual ~CentipedeStateAbstractBase ()
CentipedeStateContextcontext ()
 Reference to the CentipedeStateContext that contains all the CentipedeStateAbstractBase subclasses.

Additional Inherited Members

Protected Member Functions inherited from CentipedeStateAbstractBase
void enableUndoStack (bool enable)
 Method called by subclasses to send signalUndoActve.

Detailed Description

Class for period while building cartesian centipedes.

Definition at line 15 of file CentipedeStateBuildCartesian.h.

Constructor & Destructor Documentation

◆ CentipedeStateBuildCartesian()

CentipedeStateBuildCartesian::CentipedeStateBuildCartesian ( CentipedeStateContext & context)

Single constructor.

Definition at line 16 of file CentipedeStateBuildCartesian.cpp.

16 :
18 m_centipedePair (0)
19{
20}
CentipedeStateAbstractBase(CentipedeStateContext &context)
Single constructor.
CentipedeStateContext & context()
Reference to the CentipedeStateContext that contains all the CentipedeStateAbstractBase subclasses.

◆ ~CentipedeStateBuildCartesian()

CentipedeStateBuildCartesian::~CentipedeStateBuildCartesian ( )
virtual

Definition at line 22 of file CentipedeStateBuildCartesian.cpp.

23{
24 delete m_centipedePair;
25}

Member Function Documentation

◆ begin()

void CentipedeStateBuildCartesian::begin ( )
virtual

Method that is called at the exact moment a state is entered. Typically called just after end for the previous stat.

Implements CentipedeStateAbstractBase.

Definition at line 27 of file CentipedeStateBuildCartesian.cpp.

28{
29 LOG4CPP_DEBUG_S ((*mainCat)) << "CentipedeStateBuildCartesian::begin";
30
31 // Start showing CentipedePair
32 m_centipedePair = new CentipedePairCartesian (context().scene(),
33 context().transformation (),
34 context().modelGuideline (),
35 context().modelCoords (),
36 context().posClickScreen ());
37}
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20

◆ end()

void CentipedeStateBuildCartesian::end ( )
virtual

Method that is called at the exact moment a state is exited. Typically called just before start of the next stat.

Implements CentipedeStateAbstractBase.

Definition at line 39 of file CentipedeStateBuildCartesian.cpp.

40{
41 LOG4CPP_DEBUG_S ((*mainCat)) << "CentipedeStateBuildCartesian::end";
42
43 delete m_centipedePair;
44 m_centipedePair = nullptr;
45}

◆ handleKeyPress()

void CentipedeStateBuildCartesian::handleKeyPress ( Qt::Key key,
bool atLeastOneSelectedItem )
virtual

Handle key press event.

Implements CentipedeStateAbstractBase.

Definition at line 47 of file CentipedeStateBuildCartesian.cpp.

49{
50 // Stop
52}
@ CENTIPEDE_STATE_PREBUILD
void requestDelayedStateTransition(CentipedeState centipedeState)
Initiate state transition to be performed later, when CentipedeState is off the stack.

◆ handleMouseMove()

void CentipedeStateBuildCartesian::handleMouseMove ( QPointF posScreen)
virtual

Handle mouse move event.

Implements CentipedeStateAbstractBase.

Definition at line 54 of file CentipedeStateBuildCartesian.cpp.

55{
56 if (m_centipedePair-> done (posScreen)) {
57
58 // Done so make a command and exit this state
59 context().createGuidelineCommand (m_centipedePair->selectedXTFinal (),
60 m_centipedePair->valueFinal ());
62
63 } else {
64
65 m_centipedePair->move (posScreen);
66
67 }
68}
void createGuidelineCommand(bool selectedXTFinal, double valueFinal)
Create a command for creating a Guideline.

◆ handleMousePress()

void CentipedeStateBuildCartesian::handleMousePress ( QPointF posScreen)
virtual

Handle mouse press event.

Implements CentipedeStateAbstractBase.

Definition at line 70 of file CentipedeStateBuildCartesian.cpp.

71{
72 // Noop
73}

◆ handleMouseRelease()

void CentipedeStateBuildCartesian::handleMouseRelease ( QPointF posScreen)
virtual

Handle mouse release event.

Implements CentipedeStateAbstractBase.

Definition at line 75 of file CentipedeStateBuildCartesian.cpp.


The documentation for this class was generated from the following files: