55void DigitizeStateAxis::createTemporaryPoint (
CmdMediator *cmdMediator,
56 const QPointF &posScreen)
68 NULL_GEOMETRY_WINDOW);
95 const QString &pointIdentifier)
98 <<
" point=" << pointIdentifier.toLatin1 ().data ();
102 const QStringList &pointIdentifiers)
105 <<
"points=" << pointIdentifiers.join(
",").toLatin1 ().data ();
115 bool atLeastOneSelectedItem)
118 <<
" key=" << QKeySequence (key).toString ().toLatin1 ().data ();
122 atLeastOneSelectedItem);
142 if (
context().mainWindow().transformIsDefined()) {
144 QMessageBox::warning (
nullptr,
145 QObject::tr (
"Engauge Digitizer"),
146 QObject::tr (
"Three axis points have been defined, and no more are needed or allowed."));
150 createTemporaryPoint (cmdMediator,
157 context().mainWindow().modelMainWindow(),
158 context().mainWindow().transformation(),
160 int rtn = dlg->exec ();
163 QPointF posGraph = dlg->
posGraph (isXOnly);
169 if (rtn == QDialog::Accepted) {
174 QString errorMessage;
185 QMessageBox::warning (
nullptr,
186 QObject::tr (
"Engauge Digitizer"),
208 return "DigitizeStateAxis";
const QString AXIS_CURVE_NAME
DigitizeState
Set of possible states of Digitize toolbar.
log4cpp::Category * mainCat
Command for adding one axis point.
Create standard cross cursor, or custom cursor, according to settings.
QCursor generate(const DocumentModelDigitizeCurve &modelDigitizeCurve) const
Factory method to generate standard or custom cursor.
PointStyle pointStyle() const
Get method for PointStyle.
Container for one set of digitized Points.
CurveStyle curveStyle() const
Return the curve style.
virtual void handleKeyPressArrow(CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
If the key is an arrow (left, right, up, down) then move currently selected items.
DigitizeStateAbstractBase(DigitizeStateContext &context)
Single constructor.
DigitizeStateContext & context()
Reference to the DigitizeStateContext that contains all the DigitizeStateAbstractBase subclasses,...
void setCursor(CmdMediator *cmdMediator)
Update the cursor according to the current state.
virtual void handleKeyPress(CmdMediator *cmdMediator, Qt::Key key, bool atLeastOneSelectedItem)
Handle a key press that was intercepted earlier.
virtual void updateAfterPointAddition()
Update graphics attributes after possible new points. This is useful for highlight opacity.
virtual void handleContextMenuEventAxis(CmdMediator *cmdMediator, const QString &pointIdentifier)
Handle a right click, on an axis point, that was intercepted earlier.
virtual QString activeCurve() const
Name of the active Curve. This can include AXIS_CURVE_NAME.
virtual void handleMousePress(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse press that was intercepted earlier.
virtual QCursor cursor(CmdMediator *cmdMediator) const
Returns the state-specific cursor shape.
virtual void handleContextMenuEventGraph(CmdMediator *cmdMediator, const QStringList &pointIdentifiers)
Handle a right click, on a graph point, that was intercepted earlier.
DigitizeStateAxis(DigitizeStateContext &context)
Single constructor.
virtual ~DigitizeStateAxis()
virtual void begin(CmdMediator *cmdMediator, DigitizeState previousState)
Method that is called at the exact moment a state is entered.
virtual void end()
Method that is called at the exact moment a state is exited. Typically called just before begin for t...
virtual void handleMouseMove(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse move. This is part of an experiment to see if augmenting the cursor in Point Match mod...
virtual void updateModelSegments(const DocumentModelSegments &modelSegments)
Update the segments given the new settings.
virtual QString state() const
State name for debugging.
virtual bool guidelinesAreSelectable() const
Enable/disable guidelines according to state.
virtual void handleCurveChange(CmdMediator *cmdMediator)
Handle the selection of a new curve. At a minimum, DigitizeStateSegment will generate a new set of Se...
virtual bool canPaste(const Transformation &transformation, const QSize &viewSize) const
Return true if there is good data in the clipboard for pasting, and that is compatible with the curre...
virtual void updateModelDigitizeCurve(CmdMediator *cmdMediator, const DocumentModelDigitizeCurve &modelDigitizeCurve)
Update the digitize curve settings.
virtual void handleMouseRelease(CmdMediator *cmdMediator, QPointF posScreen)
Handle a mouse release that was intercepted earlier.
Container for all DigitizeStateAbstractBase subclasses. This functions as the context class in a stan...
void setDragMode(QGraphicsView::DragMode dragMode)
Set QGraphicsView drag mode (in m_view). Called from DigitizeStateAbstractBase subclasses.
void appendNewCmd(CmdMediator *cmdMediator, QUndoCommand *cmd)
Append just-created QUndoCommand to command stack. This is called from DigitizeStateAbstractBase subc...
MainWindow & mainWindow()
Reference to the MainWindow, without const.
Dialog box for editing the information of one axis point, in a graph with two axes.
QPointF posGraph(bool &isXOnly) const
Return the graph coordinates position specified by the user. Only applies if dialog was accepted.
Model for DlgSettingsDigitizeCurve and CmdSettingsDigitizeCurve.
Model for DlgSettingsSegments and CmdSettingsSegments.
Storage of one imported image and the data attached to that image.
DocumentModelGeneral modelGeneral() const
Get method for DocumentModelGeneral.
DocumentModelDigitizeCurve modelDigitizeCurve() const
Get method for DocumentModelDigitizeCurve.
int nextOrdinalForCurve(const QString &curveName) const
Default next ordinal value for specified curve.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
DocumentAxesPointsRequired documentAxesPointsRequired() const
Get method for DocumentAxesPointsRequired.
void checkAddPointAxis(const QPointF &posScreen, const QPointF &posGraph, bool &isError, QString &errorMessage, bool isXOnly)
Check before calling addPointAxis. Also returns the next available ordinal number (to prevent clashes...
Window that displays the geometry information, as a table, for the current curve.
Graphics item for drawing a circular or polygonal Point.
GraphicsPoint * createPoint(const QString &identifier, const PointStyle &pointStyle, const QPointF &posScreen, GeometryWindow *geometryWindow)
Create one QGraphicsItem-based object that represents one Point. It is NOT added to m_graphicsLinesFo...
void addTemporaryPoint(const QString &identifier, GraphicsPoint *point)
Add one temporary point to m_graphicsLinesForCurves. Non-temporary points are handled by the updateLi...
void removePoint(const QString &identifier)
Remove specified point. This aborts if the point does not exist.
void updateViewsOfSettings(const QString &activeCurve)
Update curve-specific view of settings. Private version gets active curve name from DigitizeStateCont...
void handleGuidelinesActiveChange(bool active)
Handle Guidelines active status toggle.
GraphicsScene & scene()
Scene container for the QImage and QGraphicsItems.
Details for a specific Point.
static QString temporaryPointIdentifier()
Point identifier for temporary point that is used by DigitzeStateAxis.
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)