Engauge Digitizer 2
Loading...
Searching...
No Matches
CentipedeStateBuildCartesian.cpp
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2020 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
10#include "DocumentModelCoords.h"
12#include "GraphicsScene.h"
13#include "Logger.h"
14#include "Transformation.h"
15
21
26
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}
38
40{
41 LOG4CPP_DEBUG_S ((*mainCat)) << "CentipedeStateBuildCartesian::end";
42
43 delete m_centipedePair;
44 m_centipedePair = nullptr;
45}
46
48 bool /* atLeastOneSelectedItem */)
49{
50 // Stop
52}
53
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}
69
71{
72 // Noop
73}
74
@ CENTIPEDE_STATE_PREBUILD
log4cpp::Category * mainCat
Definition Logger.cpp:14
Show two cartesian Centipede graphics items that the user interacts with by moving the cursor.
CentipedeStateAbstractBase(CentipedeStateContext &context)
Single constructor.
CentipedeStateContext & context()
Reference to the CentipedeStateContext that contains all the CentipedeStateAbstractBase subclasses.
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before start of th...
virtual void handleMousePress(QPointF posScreen)
Handle mouse press event.
CentipedeStateBuildCartesian(CentipedeStateContext &context)
Single constructor.
virtual void handleKeyPress(Qt::Key key, bool atLeastOneSelectedItem)
Handle key press event.
virtual void handleMouseRelease(QPointF posScreen)
Handle mouse release event.
virtual void handleMouseMove(QPointF posScreen)
Handle mouse move event.
virtual void begin()
Method that is called at the exact moment a state is entered. Typically called just after end for the...
State context class for tracking the steps involved in creating centipedes in preparation for creatin...
void requestDelayedStateTransition(CentipedeState centipedeState)
Initiate state transition to be performed later, when CentipedeState is off the stack.
void createGuidelineCommand(bool selectedXTFinal, double valueFinal)
Create a command for creating a Guideline.
#define LOG4CPP_DEBUG_S(logger)
Definition convenience.h:20