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

Dialog box for editing the information of one or more points. More...

#include <DlgEditPointGraph.h>

Inheritance diagram for DlgEditPointGraph:
Inheritance graph
Collaboration diagram for DlgEditPointGraph:
Collaboration graph

Public Member Functions

 DlgEditPointGraph (MainWindow &mainWindow, const DocumentModelCoords &modelCoords, const DocumentModelGeneral &modelGeneral, const MainWindowModel &modelMainWindow, const Transformation &transformation, const double *xInitialValue=0, const double *yInitialValue=0)
 Constructor for existing point which already has graph coordinates (which may be changed using this dialog).
 ~DlgEditPointGraph ()
void posGraph (bool &isX, double &x, bool &isY, double &y) const
 Return one or both coordinates. Only applies if dialog was accepted.

Detailed Description

Dialog box for editing the information of one or more points.

Definition at line 25 of file DlgEditPointGraph.h.

Constructor & Destructor Documentation

◆ DlgEditPointGraph()

DlgEditPointGraph::DlgEditPointGraph ( MainWindow & mainWindow,
const DocumentModelCoords & modelCoords,
const DocumentModelGeneral & modelGeneral,
const MainWindowModel & modelMainWindow,
const Transformation & transformation,
const double * xInitialValue = 0,
const double * yInitialValue = 0 )

Constructor for existing point which already has graph coordinates (which may be changed using this dialog).

If initial values are unspecified then the value fields will be initially empty

Definition at line 28 of file DlgEditPointGraph.cpp.

34 :
35 QDialog (&mainWindow),
36 m_changed (false),
37 m_modelCoords (modelCoords),
38 m_modelGeneral (modelGeneral),
39 m_modelMainWindow (modelMainWindow)
40{
41 LOG4CPP_INFO_S ((*mainCat)) << "DlgEditPointGraph::DlgEditPointGraph";
42
43 QVBoxLayout *layout = new QVBoxLayout;
44 setLayout (layout);
45
46 setCursor (QCursor (Qt::ArrowCursor));
47 setModal(true);
48 setWindowTitle (tr ("Edit Curve Point(s)"));
49
50 createCoords (layout);
51 createHint (layout);
52 createOkCancel (layout);
53
54 initializeGraphCoordinates (xInitialValue,
55 yInitialValue,
56 transformation);
57
58 m_changed = false; // Initialization of coordinate vaues changed this flag so we reset it and update the controls
59 updateControls ();
60}
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ ~DlgEditPointGraph()

DlgEditPointGraph::~DlgEditPointGraph ( )

Definition at line 62 of file DlgEditPointGraph.cpp.

63{
64 LOG4CPP_INFO_S ((*mainCat)) << "DlgEditPointGraph::~DlgEditPointGraph";
65}

Member Function Documentation

◆ posGraph()

void DlgEditPointGraph::posGraph ( bool & isX,
double & x,
bool & isY,
double & y ) const

Return one or both coordinates. Only applies if dialog was accepted.

Definition at line 219 of file DlgEditPointGraph.cpp.

223{
224 FormatCoordsUnits format;
225
226 // Use zero for any empty coordinate
227 QString xTextNotEmpty = QString ("%1").arg (m_editGraphX->text().isEmpty () ? "0" : m_editGraphX->text());
228 QString yTextNotEmpty = QString ("%1").arg (m_editGraphY->text().isEmpty () ? "0" : m_editGraphY->text());
229
230 format.formattedToUnformatted (xTextNotEmpty,
231 yTextNotEmpty,
232 m_modelCoords,
233 m_modelMainWindow,
234 x,
235 y);
236
237 isX = !m_editGraphX->text().isEmpty();
238 isY = !m_editGraphY->text().isEmpty();
239}
void formattedToUnformatted(const QString &xThetaFormatted, const QString &yRadiusFormatted, const DocumentModelCoords &modelCoords, const MainWindowModel &mainWindowModel, double &xThetaUnformatted, double &yRadiusUnformatted) const
Convert formatted string to unformatted numeric value.

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