Isis 3.0 Programmer Reference
Back | Home
ControlPointEditWidget.h
1 #ifndef ControlPointEditWidget_h
2 #define ControlPointEditWidget_h
3 
4 
5 #include "ControlPoint.h"
6 
7 #include <QCloseEvent>
8 #include <QHideEvent>
9 #include <QPalette>
10 #include <QPointer>
11 #include <QStatusBar>
12 #include <QString>
13 #include <QStringList>
14 #include <QWidget>
15 
16 class QAction;
17 class QBoxLayout;
18 class QCheckBox;
19 class QComboBox;
20 class QGroupBox;
21 class QLabel;
22 class QMainWindow;
23 class QObject;
24 class QPainter;
25 class QPoint;
26 class QPushButton;
27 class QSplitter;
28 class QStackedWidget;
29 class QStandardItemModel;
30 class QString;
31 class QTableWidget;
32 class QTextEdit;
33 class QWidget;
34 
35 namespace Isis {
36  class Control;
37  class ControlMeasureEditWidget;
38  class ControlMeasure;
39  class ControlNet;
40  class Cube;
41  class CubeViewport;
42  class Directory;
43  class MdiCubeViewport;
44  class SerialNumberList;
45  class Stretch;
46  class ToolPad;
47  class UniversalGroundMap;
48 
62  Q_OBJECT
63 
64  public:
65  ControlPointEditWidget(Directory *directory, QWidget *parent, bool addMeasures = false);
66  virtual ~ControlPointEditWidget();
67 
70  FILENAME,
71  CUBESN,
72  SAMPLE,
73  LINE,
74  APRIORISAMPLE,
75  APRIORILINE,
76  SAMPLERESIDUAL,
77  LINERESIDUAL,
78  RESIDUALMAGNITUDE,
79  SAMPLESHIFT,
80  LINESHIFT,
81  PIXELSHIFT,
82  GOODNESSOFFIT,
83  IGNORED,
84  EDITLOCK,
85  TYPE
86  };
88  static const int NUMCOLUMNS = 16;
89 
90  QString measureColumnToString(MeasureColumns column);
91 
92 
93  signals:
94  void controlPointChanged(QString pointId);
95  void controlPointAdded(QString pointId);
96  void ignorePointChanged();
97  void ignoreLeftChanged();
98  void ignoreRightChanged();
99  void netChanged();
100  void newControlNetwork(ControlNet *);
101  void stretchChipViewport(Stretch *, CubeViewport *);
102  void measureChanged();
103  void saveControlNet();
104 
105  public slots:
107  void setControl(Control *control);
108  void setEditPoint(ControlPoint *controlPoint);
109  void deletePoint(ControlPoint *controlPoint);
110 
111  void createControlPoint(double latitude, double longitude, Cube *cube = 0,
112  bool isGroundSource = false);
113 
114  void updatePointInfo(ControlPoint &updatedPoint);
115 // void refresh();
116 
117  protected:
118  bool eventFilter(QObject *o,QEvent *e);
119 
120  private slots:
121 // void enterWhatsThisMode();
122  void saveNet();
123 // void saveAsNet();
124 // void addMeasure();
125 // void setPointType (int pointType);
126  void setLockPoint (bool ignore);
127  void setIgnorePoint (bool ignore);
128  void setLockLeftMeasure (bool ignore);
129  void setIgnoreLeftMeasure (bool ignore);
130  void setLockRightMeasure (bool ignore);
131  void setIgnoreRightMeasure (bool ignore);
132 
133  void selectLeftMeasure (int index);
134  void selectRightMeasure (int index);
135  void nextRightMeasure();
136  void previousRightMeasure();
137  void updateLeftMeasureInfo ();
138  void updateRightMeasureInfo ();
139 
140  void measureSaved();
141  void checkReference();
142  void savePoint();
144 
145  void openTemplateFile();
146  void viewTemplateFile();
147  void saveChips();
148  void showHideTemplateEditor();
149  void saveTemplateFile();
150  void saveTemplateFileAs();
151  void setTemplateModified();
152  void writeTemplateFile(QString);
153  void clearEditPoint();
154 
155  void colorizeSaveNetButton();
156 
157  private:
158  void createActions();
159 
160  void loadPoint();
161  void loadMeasureTable();
162  void createPointEditor(QWidget *parent, bool addMeasures);
163  QSplitter * createTopSplitter();
164  QGroupBox * createControlPointGroupBox();
165  QGroupBox * createLeftMeasureGroupBox();
166  QGroupBox * createRightMeasureGroupBox();
168  void loadTemplateFile(QString);
169  bool okToContinue();
170  bool IsMeasureLocked(QString serialNumber);
172 
174 
175 
176  private:
177 
178  QPointer<QWidget> m_parent;
179  Directory *m_directory;
181 
182  QString m_cnetFileName;
183  QPointer<QLabel> m_cnetFileNameLabel;
185 
186  QPointer<QAction> m_closePointEditor;
187 
188  QPointer<QAction> m_saveChips;
189  QPointer<QAction> m_showHideTemplateEditor;
191  QPointer<QAction> m_openTemplateFile;
192  QPointer<QAction> m_saveTemplateFile;
193  QPointer<QAction> m_saveTemplateFileAs;
194 
195 
197  QPointer<ControlMeasureEditWidget> m_measureEditor;
198 
199  QPointer<QPushButton> m_savePoint;
201 
202  QPointer<QPushButton> m_saveNet;
203 
204  QPointer<QTextEdit> m_templateEditor;
205  QPointer<QWidget> m_templateEditorWidget;
207 
208  QPointer<QLabel> m_templateFileNameLabel;
209  QPointer<QLabel> m_ptIdValue;
210  QPointer<QComboBox> m_pointType;
211  QPointer<QLabel> m_numMeasures;
212 
213  QPointer<QCheckBox> m_lockPoint;
214  QPointer<QCheckBox> m_ignorePoint;
215  QPointer<QLabel> m_leftReference;
216  QPointer<QLabel> m_leftMeasureType;
217  QPointer<QLabel> m_rightReference;
218  QPointer<QLabel> m_rightMeasureType;
219  QPointer<QCheckBox> m_lockLeftMeasure;
220  QPointer<QCheckBox> m_ignoreLeftMeasure;
221  QPointer<QCheckBox> m_lockRightMeasure;
222  QPointer<QCheckBox> m_ignoreRightMeasure;
223 
224  QPointer<QComboBox> m_leftCombo;
225  QPointer<QComboBox> m_rightCombo;
226  QPointer<QStandardItemModel> m_model;
227 
228  QPointer<QMainWindow> m_measureWindow;
229  QPointer<QTableWidget> m_measureTable;
230 
231  QPointer<ControlPoint> m_editPoint;
233  QPointer<ControlNet> m_controlNet;
234 
235  QPointer<ControlPoint> m_newPoint;
237 
239 
240  QString m_leftFile;
241  QPointer<ControlMeasure> m_leftMeasure;
242  QPointer<ControlMeasure> m_rightMeasure;
243  QScopedPointer<Cube> m_leftCube;
244  QScopedPointer<Cube> m_rightCube;
245 
246  QList<Cube *> m_pointCubes;
247  };
248 };
249 #endif
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:57
static const int NUMCOLUMNS
Number of entries (columns) in the measure table.
void createActions()
Creates the actions for the widget.
void clearEditPoint()
This method is called from the constructor so that when the Main window is created, it know&#39;s it&#39;s size and location.
void updateLeftMeasureInfo()
Update the left measure information.
bool m_addMeasuresButton
Indicates whether or not to add &quot;Add Measures(s) to Point&quot;.
void setEditPoint(ControlPoint *controlPoint)
Slot called by Directory to set the control point for editing.
void setLockRightMeasure(bool ignore)
Set the &quot;EditLock&quot; keyword of the measure shown in the right viewport to the value of the input param...
void writeTemplateFile(QString)
Write the contents of the template editor to the file provided.
QPointer< QCheckBox > m_ignorePoint
Checkbox to ignore the current point.
QPointer< QLabel > m_leftMeasureType
Label for the left measure&#39;s adjustment type.
void updatePointInfo(ControlPoint &updatedPoint)
Update the current editPoint information in the Point Editor labels.
QString m_cnetFileName
Filename of the control network that is being modified.
bool validateMeasureChange(ControlMeasure *m)
Validates a change to a control measure.
void checkReference()
Change which measure is the reference.
bool eventFilter(QObject *o, QEvent *e)
Event filter for ControlPointEditWidget.
bool m_netChanged
Indicates if the control network has been modified.
void loadMeasureTable()
Load measure information into the measure table.
void setIgnorePoint(bool ignore)
Set point&#39;s &quot;Ignore&quot; keyword to the value of the input parameter.
QPointer< QPushButton > m_savePoint
Button to save current point being edited.
void selectLeftMeasure(int index)
Select left measure.
QPointer< QComboBox > m_pointType
Combobox to change the type of the current point.
QPointer< ControlPoint > m_newPoint
New control point.
QPointer< QCheckBox > m_ignoreRightMeasure
Checkbox to ignore the right measure.
QPalette m_saveDefaultPalette
Default color pallet of the &quot;Save Point&quot; button.
QPointer< ControlPoint > m_editPoint
The control point being edited.
QPointer< ControlMeasure > m_leftMeasure
Left control measure.
void viewTemplateFile()
Allows the user to view the template file that is currently set.
void loadTemplateFile(QString)
Updates the current template file being used.
void saveChips()
Slot which calls ControlPointEditWidget slot to save chips.
ControlMeasure * createTemporaryGroundMeasure()
Create a temporary measure to hold the ground point info for ground source.
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:121
QPointer< QCheckBox > m_lockLeftMeasure
Checkbox to edit lock/unlock the left measure.
void nextRightMeasure()
Selects the next right measure when activated by key shortcut.
Gui for editing ControlPoint.
QPointer< QComboBox > m_rightCombo
Combobox to load right measure into right chip viewport.
QString measureColumnToString(MeasureColumns column)
Gets a string representation of a measure column.
QPointer< QCheckBox > m_ignoreLeftMeasure
Checkbox to ignore the left measure.
MeasureColumns
Measure column values for the measure table.
void createPointEditor(QWidget *parent, bool addMeasures)
Create the widget for editing control points.
void showHideTemplateEditor()
Toggles the visibility of the template editor widget.
QPointer< QAction > m_closePointEditor
Action to close the point editor.
bool okToContinue()
Checks the state of the template registration file and determines if it is safe to continue opening a...
QPointer< QWidget > m_templateEditorWidget
Template editor widget.
void saveTemplateFileAs()
Save the contents of template editor to a file chosen by the user.
QPointer< ControlNet > m_controlNet
Current control net.
void saveTemplateFile()
Save the file opened in the template editor.
void updateRightMeasureInfo()
Update the right measure information.
QPointer< QMainWindow > m_measureWindow
Main window for the the measure table widget.
a control network
Definition: ControlNet.h:207
void setLockLeftMeasure(bool ignore)
Set the &quot;EditLock&quot; keyword of the measure shown in the left viewport to the value of the input parame...
QPointer< QAction > m_openTemplateFile
Action to open a registration template file to disk.
bool m_templateModified
Indicates if the registration template was edited.
void previousRightMeasure()
Selects the previous right measure when activated by key shortcut.
Pixel value mapper.
Definition: Stretch.h:72
QSplitter * createTopSplitter()
Creates everything above the ControlPointEdit.
QPointer< QTextEdit > m_templateEditor
Text editor for editing the registration template.
QPointer< QAction > m_saveTemplateFileAs
Action to save a new registration template.
void colorizeSaveNetButton()
Turn &quot;Save Net&quot; button text to red.
bool IsMeasureLocked(QString serialNumber)
Check for implicitly locked measure in m_editPoint.
void selectRightMeasure(int index)
Select right measure.
void loadPoint()
Load point into ControlPointEditWidget.
void setControl(Control *control)
New control network being edited.
A single control point.
Definition: ControlPoint.h:339
QGroupBox * createControlPointGroupBox()
Creates the &quot;Control Point&quot; groupbox.
QPointer< QPushButton > m_saveNet
Button to save the current control network.
void setTemplateModified()
Called when the template file is modified by the template editor.
QString m_lastUsedPointId
Point id of the last used control point.
void setSerialNumberList(SerialNumberList *snList)
Set the serial number list.
QString m_leftFile
Filename of left measure.
QPointer< QLabel > m_cnetFileNameLabel
Label with name of the control network file.
QPointer< QAction > m_saveTemplateFile
Action to save a registration template file to disk.
QScopedPointer< Cube > m_rightCube
Right cube.
void savePoint()
Save edit point to the Control Network.
QPointer< QWidget > m_parent
Parent widget.
ControlPointEditWidget(Directory *directory, QWidget *parent, bool addMeasures=false)
Consructs the ControlPointEditWidget widget.
QPointer< QLabel > m_rightMeasureType
Label for the right measure&#39;s adjustment type.
QPointer< QLabel > m_ptIdValue
Label for the point id of the current point.
a control measurement
QGroupBox * createRightMeasureGroupBox()
Create the &quot;Right Measure&quot; groupbox.
QStringList m_pointFiles
Associated files for current control point.
QGroupBox * createLeftMeasureGroupBox()
Creates the &quot;Left Measure&quot; groupbox.
void setIgnoreLeftMeasure(bool ignore)
Set the &quot;Ignore&quot; keyword of the measure shown in the left viewport to the value of the input paramete...
QPointer< QLabel > m_templateFileNameLabel
Label for the template filename.
QPointer< QCheckBox > m_lockRightMeasure
Checkbox to edit lock/unlock the right measure.
QPointer< QLabel > m_leftReference
Label indicating if left measure is the reference.
Serial Number list generator.
void measureSaved()
This method is connected with the measureSaved() signal from ControlMeasureEditWidget.
void createTemplateEditorWidget()
Creates the Widget which contains the template editor and its toolbar.
void setIgnoreRightMeasure(bool ignore)
Set the &quot;Ignore&quot; keyword of the measure shown in the right viewport to the value of the input paramet...
QPointer< QLabel > m_rightReference
Label indicating if right measure is the reference.
void setLockPoint(bool ignore)
Set the point type.
void colorizeSavePointButton()
Refresh all necessary widgets in ControlPointEditWidget including the PointEditor and CubeViewports...
QPointer< ControlMeasureEditWidget > m_measureEditor
Pointer to control measure editor widget.
void openTemplateFile()
Prompt user for a registration template file to open.
void saveNet()
This slot is needed because we cannot directly emit a signal with a ControlNet argument after the &quot;Sa...
SerialNumberList * m_serialNumberList
Serial number list for the loaded cubes.
QPointer< QTableWidget > m_measureTable
Table widget for the measures.
QPointer< ControlMeasure > m_rightMeasure
Right control measure.
QScopedPointer< Cube > m_leftCube
Left cube.
QPointer< QCheckBox > m_lockPoint
Checkbox that locks/unlocks the current point.
QPointer< QAction > m_saveChips
Action to save the registration chips Action to toggle visibility of the regis...
IO Handler for Isis Cubes.
Definition: Cube.h:158
QPointer< QComboBox > m_leftCombo
Combobox to load left measure into left chip viewport.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:16:44