Isis Developer Reference
ControlPointEditWidget.h
Go to the documentation of this file.
1 #ifndef ControlPointEditWidget_h
2 #define ControlPointEditWidget_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 
13 #include "ControlPoint.h"
14 #include "FileName.h"
15 #include "SpecialPixel.h"
16 #include "TemplateList.h"
17 
18 #include <QCloseEvent>
19 #include <QDir>
20 #include <QHideEvent>
21 #include <QPalette>
22 #include <QPointer>
23 #include <QStatusBar>
24 #include <QString>
25 #include <QStringList>
26 #include <QWidget>
27 
28 class QAction;
29 class QBoxLayout;
30 class QCheckBox;
31 class QComboBox;
32 class QGroupBox;
33 class QLabel;
34 class QMainWindow;
35 class QObject;
36 class QPainter;
37 class QPoint;
38 class QPushButton;
39 class QSplitter;
40 class QStackedWidget;
41 class QStandardItemModel;
42 class QString;
43 class QTableWidget;
44 class QTextEdit;
45 class QWidget;
46 
47 namespace Isis {
48  class Control;
49  class ControlMeasureEditWidget;
50  class ControlMeasure;
51  class ControlNet;
52  class Cube;
53  class CubeViewport;
54  class Directory;
55  class MdiCubeViewport;
56  class SerialNumberList;
57  class Stretch;
58  class ToolPad;
59  class UniversalGroundMap;
60 
122  Q_OBJECT
123 
124  public:
125  ControlPointEditWidget(Directory *directory, QWidget *parent, bool addMeasures = false);
126  virtual ~ControlPointEditWidget();
127 
128  QString editPointId();
130 
131  signals:
132  void controlPointChanged(QString pointId);
133  void controlPointAdded(QString pointId);
137  void cnetModified();
141  // temporary signal for quick & dirty autosave in Ipce
143 
144  public slots:
146  void setControl(Control *control);
147  void setControlFromActive();
148  void setEditPoint(ControlPoint *controlPoint, QString serialNumber = "");
149  void deletePoint(ControlPoint *controlPoint);
150 
151  void createControlPoint(double latitude, double longitude, Cube *cube = 0,
152  bool isGroundSource = false);
153 
154  // Changed colorizeSaveNetButton to public slot so it could be called from
155  // Directory::saveActiveControl(). This should be temporary until the modify/save functionality
156  // of active control is re-factored. Also added reset parameter, defaulting to false so button
157  // is red. This default was used so that current calls did not need to be changed.
158  void colorizeSaveNetButton(bool reset = false);
159 
160  void addTemplates(TemplateList *templateList);
161 
162  protected:
163  bool eventFilter(QObject *o,QEvent *e);
164 
165  private slots:
166 // void enterWhatsThisMode();
167  void reloadPoint();
168  void saveNet();
169 // void addMeasure();
170  void setPointType (int pointType);
171  void setLockPoint (bool ignore);
172  void setIgnorePoint (bool ignore);
173  void setLockLeftMeasure (bool ignore);
174  void setIgnoreLeftMeasure (bool ignore);
175  void setLockRightMeasure (bool ignore);
176  void setIgnoreRightMeasure (bool ignore);
177 
178  void selectLeftMeasure (int index);
179  void selectRightMeasure (int index);
180  void nextRightMeasure();
181  void previousRightMeasure();
182  void updateLeftMeasureInfo ();
183  void updateRightMeasureInfo ();
184 
185  void measureSaved();
186  void checkReference();
187 
188  void updateGroundPosition();
189  void updateSurfacePointInfo ();
190  void openReferenceRadius();
191  void groundSourceFileSelectionChanged(int index);
192 
193  void savePoint();
194 
195  void colorizeAllSaveButtons(QString color);
196  void colorizeSavePointButton();
197 
198  void openTemplateFile();
199  void viewTemplateFile();
200  void saveChips();
201  void showHideTemplateEditor();
202  void saveTemplateFile();
203  void saveTemplateFileAs();
204  void setTemplateFile(QString);
205  void setTemplateModified();
206  void writeTemplateFile(QString);
207  void resetTemplateComboBox(QString fileName);
208  void clearEditPoint();
209 
210  private:
211  void createActions();
212 
213  void loadPoint(QString serialNumber = "");
214  void loadGroundMeasure();
215  void createPointEditor(QWidget *parent, bool addMeasures);
216  QSplitter * createTopSplitter();
217  QGroupBox * createControlPointGroupBox();
218  QGroupBox * createLeftMeasureGroupBox();
219  QGroupBox * createRightMeasureGroupBox();
220  void createTemplateEditorWidget();
221  void loadTemplateFile(QString);
222  bool okToContinue();
223  bool IsMeasureLocked(QString serialNumber);
224  bool validateMeasureChange(ControlMeasure *m);
225 
226  void setShapesForPoint(double latitude=Null, double longitude=Null);
227  ControlMeasure *createTemporaryGroundMeasure();
228  bool setGroundSourceInfo();
229  FileName checkGroundFileLocation(FileName groundFile);
230  void changeGroundLocationsInNet();
231  void clearGroundSource();
232 
233  void initDem(QString demFile);
234  double demRadius(double latitude, double longitude);
235 
236  private:
237 
238  QPointer<QWidget> m_parent;
239  Directory *m_directory;
240  bool m_addMeasuresButton;
241 
242  QString m_cnetFileName;
243  QPointer<QLabel> m_cnetFileNameLabel;
244  bool m_cnetModified;
245 
246  QPointer<QAction> m_closePointEditor;
247 
248  QPointer<QAction> m_saveChips;
249  QPointer<QAction> m_showHideTemplateEditor;
251  QPointer<QAction> m_openTemplateFile;
252  QPointer<QAction> m_saveTemplateFile;
253  QPointer<QAction> m_saveTemplateFileAs;
254 
255 
257  QPointer<ControlMeasureEditWidget> m_measureEditor;
258 
259  QPointer<QPushButton> m_reloadPoint;
260  QPointer<QPushButton> m_savePoint;
261  QPalette m_saveDefaultPalette;
262 
263  QPointer<QPushButton> m_saveNet;
264 
265  QPointer<QTextEdit> m_templateEditor;
266  QPointer<QWidget> m_templateEditorWidget;
267  bool m_templateModified;
268 
269  QPointer<QComboBox> m_templateComboBox;
270  QPointer<QComboBox> m_groundSourceCombo;
271  QPointer<QComboBox> m_radiusSourceCombo;
272  QPointer<QLabel> m_ptIdValue;
273  QPointer<QComboBox> m_pointTypeCombo;
274  QPointer<QLabel> m_numMeasures;
275  QPointer<QLabel> m_aprioriLatitude;
276  QPointer<QLabel> m_aprioriLongitude;
277  QPointer<QLabel> m_aprioriRadius;
278 
279  QPointer<QCheckBox> m_lockPoint;
280  QPointer<QCheckBox> m_ignorePoint;
281  QPointer<QLabel> m_leftReference;
282  QPointer<QLabel> m_leftMeasureType;
283  QPointer<QLabel> m_rightReference;
284  QPointer<QLabel> m_rightMeasureType;
285  QPointer<QCheckBox> m_lockLeftMeasure;
286  QPointer<QCheckBox> m_ignoreLeftMeasure;
287  QPointer<QCheckBox> m_lockRightMeasure;
288  QPointer<QCheckBox> m_ignoreRightMeasure;
289 
290  QPointer<QComboBox> m_leftCombo;
291  QPointer<QComboBox> m_rightCombo;
292  QPointer<QStandardItemModel> m_model;
293 
294  QPointer<QMainWindow> m_measureWindow;
295  QPointer<QTableWidget> m_measureTable;
296 
297  QPointer<ControlPoint> m_editPoint;
298  SerialNumberList *m_serialNumberList;
299  QPointer<ControlNet> m_controlNet;
300  QPointer<Control> m_control;
301 
302  QPointer<ControlPoint> m_newPoint;
303  QString m_lastUsedPointId;
304 
305  QStringList m_pointFiles;
306 
307  QString m_leftFile;
308  QPointer<ControlMeasure> m_leftMeasure;
309  QPointer<ControlMeasure> m_rightMeasure;
310  QScopedPointer<Cube> m_leftCube;
311  QScopedPointer<Cube> m_rightCube;
312 
313  QStringList m_projectShapeNames;
314  int m_numberProjectShapesWithPoint;
315  QMap<QString, Shape *> m_nameToShapeMap;
316 
317  QString m_groundFilename;
318  QString m_groundSN;
319  ControlPoint::SurfacePointSource::Source m_groundSourceType;
320  QScopedPointer<UniversalGroundMap> m_groundGmap;
321 
322  bool m_changeAllGroundLocation;
323  bool m_changeGroundLocationInNet;
325  QString m_newGroundDir;
326 
327  // TODO: Combine the following m_groundSourceFile, m_radiusSourceFile
328  // with m_groundFile and m_demFile. Is it just a matter of
329  // full path vs filename only?
330  QString m_radiusFilename;
331  ControlPoint::RadiusSource::Source m_radiusSourceType;
332  bool m_demOpen;
333  QString m_demFile;
334  QScopedPointer<Cube> m_demCube;
335  };
336 };
337 #endif
Isis::ControlPointEditWidget::controlPointChanged
void controlPointChanged(QString pointId)
Isis::Project::shapes
static QStringList shapes(QStringList)
Isis::Angle::Degrees
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Definition: Angle.h:56
Isis::NewControlPointDialog::setGroundSource
void setGroundSource(QStringList groundFiles, int numberShapesWithPoint)
Definition: NewControlPointDialog.cpp:212
Isis::ControlPointEditWidget::cnetModified
void cnetModified()
Isis::ControlPointEditWidget::setControlFromActive
void setControlFromActive()
New active control was set from ipce.
Definition: ControlPointEditWidget.cpp:697
FileName.h
Isis::Project::templateRoot
static QString templateRoot(QString projectRoot)
Appends the root directory name 'templates' to the project .
Definition: Project.cpp:2125
Table.h
QWidget
Isis::ControlMeasure::RegisteredPixel
@ RegisteredPixel
Registered to whole pixel (e.g.,pointreg)
Definition: ControlMeasure.h:212
Isis::ControlPointEditWidget::editPointId
QString editPointId()
Definition: ControlPointEditWidget.cpp:111
Isis::Interpolator::BiLinearType
@ BiLinearType
Definition: Interpolator.h:43
Isis::ControlMeasure::RegisteredSubPixel
@ RegisteredSubPixel
Registered to sub-pixel (e.g., pointreg)
Definition: ControlMeasure.h:214
Isis::ControlPoint::PointTypeToString
static QString PointTypeToString(PointType type)
Obtain a string representation of a given PointType.
Definition: ControlPoint.cpp:1333
MdiCubeViewport.h
Isis::Directory
Definition: Directory.h:271
Isis::ControlMeasure::MeasureLocked
@ MeasureLocked
Definition: ControlMeasure.h:219
Isis::ControlPointEditWidget::~ControlPointEditWidget
virtual ~ControlPointEditWidget()
Definition: ControlPointEditWidget.cpp:106
Isis::Shape::surfacePointSource
ControlPoint::SurfacePointSource::Source surfacePointSource()
Definition: Shape.cpp:209
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
ViewportMainWindow.h
Project.h
Isis::ControlMeasure::SetCubeSerialNumber
Status SetCubeSerialNumber(QString newSerialNumber)
Set cube serial number.
Definition: ControlMeasure.cpp:187
Isis::ControlPointEditWidget::saveControlNet
void saveControlNet()
Isis::ControlPoint::SetChooserName
Status SetChooserName(QString name)
Set the point's chooser name.
Definition: ControlPoint.cpp:487
Isis::ControlPointEditWidget::ignorePointChanged
void ignorePointChanged()
Isis::SerialNumberList::size
int size() const
How many serial number / filename combos are in the list.
Definition: SerialNumberList.cpp:384
Isis::FileName::name
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
Definition: FileName.cpp:162
Isis::ControlPoint::PointLocked
@ PointLocked
This is returned when the operation requires Edit Lock to be false but it is currently true.
Definition: ControlPoint.h:408
Isis::SerialNumberList::serialNumberIndex
int serialNumberIndex(const QString &sn)
Return a list index given a serial number.
Definition: SerialNumberList.cpp:490
SpecialPixel.h
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
MainWindow.h
Isis::Camera::Sample
virtual double Sample() const
Returns the current sample number.
Definition: Camera.cpp:2690
Isis::ControlMeasure::SetAprioriSample
Status SetAprioriSample(double aprioriSample)
Definition: ControlMeasure.cpp:144
Isis::Stretch
Pixel value mapper.
Definition: Stretch.h:58
Directory.h
ControlPointEditWidget.h
Isis::Shape::radiusSource
ControlPoint::RadiusSource::Source radiusSource()
Definition: Shape.cpp:214
Isis::ControlPoint::RadiusSource::Source
Source
Definition: ControlPoint.h:451
QMainWindow
Isis::SerialNumber::Compose
static QString Compose(Pvl &label, bool def2filename=false)
Compose a SerialNumber from a PVL.
Definition: SerialNumber.cpp:38
Isis::TemplateList
Definition: TemplateList.h:35
Longitude.h
Isis::Project::shapeDataRoot
static QString shapeDataRoot(QString projectRoot)
Appends the root directory name 'shapes' to the project .
Definition: Project.cpp:2087
Isis::ControlPointEditWidget::createControlPoint
void createControlPoint(double latitude, double longitude, Cube *cube=0, bool isGroundSource=false)
Create a new control point at the given latitude, longitude.
Definition: ControlPointEditWidget.cpp:1455
Isis::ControlPointEditWidget::eventFilter
bool eventFilter(QObject *o, QEvent *e)
Event filter for ControlPointEditWidget.
Definition: ControlPointEditWidget.cpp:2735
Isis::ControlPoint::PointType
PointType
These are the valid 'types' of point.
Definition: ControlPoint.h:364
Isis::Project::activeControl
Control * activeControl()
Return the Active Control (control network)
Definition: Project.cpp:1903
Isis::Directory::project
Project * project() const
Gets the Project for this directory.
Definition: Directory.cpp:1311
Isis::Project::regTemplates
QList< TemplateList * > regTemplates()
Return registration template FileNames.
Definition: Project.cpp:2166
Isis::ControlPoint::GetId
QString GetId() const
Return the Id of the control point.
Definition: ControlPoint.cpp:1306
Isis::Control
This represents an ISIS control net in a project-based GUI interface.
Definition: Control.h:66
ToolPad.h
Isis::ControlMeasure::Candidate
@ Candidate
(e.g., autoseed, interest) AKA predicted, unmeasured, unverified
Definition: ControlMeasure.h:208
Isis::Camera
Definition: Camera.h:236
Isis::NewControlPointDialog::groundSource
QString groundSource() const
Definition: NewControlPointDialog.cpp:194
Isis::Shape::cube
Cube * cube()
Get the Cube * associated with this display property.
Definition: Shape.cpp:324
QToolBar
Isis::NewControlPointDialog::selectedFiles
QStringList selectedFiles() const
Definition: NewControlPointDialog.cpp:178
QStringList
Isis::ControlPoint::SetAprioriSurfacePointSourceFile
Status SetAprioriSurfacePointSourceFile(QString sourceFile)
This updates the filename of where the apriori surface point came from.
Definition: ControlPoint.cpp:839
NewGroundSourceLocationDialog.h
Isis::ControlMeasureEditWidget
Point Editor Widget.
Definition: ControlMeasureEditWidget.h:174
Isis::SerialNumberList
Serial Number list generator.
Definition: SerialNumberList.h:64
Shape.h
QComboBox
Isis::SerialNumberList::serialNumber
QString serialNumber(const QString &filename)
Return a serial number given a filename.
Definition: SerialNumberList.cpp:426
Isis::SerialNumberList::remove
void remove(const QString &sn)
Remove the specified serial number from the list.
Definition: SerialNumberList.cpp:88
Isis::Shape::fileName
QString fileName() const
Get the file name of the cube that this shape represents.
Definition: Shape.cpp:376
Isis::ControlPointEditWidget::newControlNetwork
void newControlNetwork(ControlNet *)
Isis::Cube::externalCubeFileName
FileName externalCubeFileName() const
If this is an external cube label file, this will give you the cube dn file that this label reference...
Definition: Cube.cpp:1535
Isis::ControlPointEditWidget::deletePoint
void deletePoint(ControlPoint *controlPoint)
Gives user options for deleting a control point from the control network.
Definition: ControlPointEditWidget.cpp:1568
Isis::ControlPoint::RadiusSource::Ellipsoid
@ Ellipsoid
Definition: ControlPoint.h:455
Isis::ControlMeasure::GetCubeSerialNumber
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
Definition: ControlMeasure.cpp:557
Isis::ControlPointEditWidget
Gui for editing ControlPoints in ipce application.
Definition: ControlPointEditWidget.h:121
ShapeList.h
Isis::ControlPoint
A single control point.
Definition: ControlPoint.h:354
Isis::Distance::Meters
@ Meters
The distance is being specified in meters.
Definition: Distance.h:43
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
ControlNet.h
Latitude.h
NewControlPointDialog.h
DeleteControlPointDialog.h
Isis::Control::controlNet
ControlNet * controlNet()
Open and return a pointer to the ControlNet for this Control.
Definition: Control.cpp:150
Pvl.h
Isis::ControlPointEditWidget::colorizeSaveNetButton
void colorizeSaveNetButton(bool reset=false)
Turn "Save Net" button text to red.
Definition: ControlPointEditWidget.cpp:3122
Isis::ControlPointEditWidget::setSerialNumberList
void setSerialNumberList(SerialNumberList *snList)
Set the serial number list.
Definition: ControlPointEditWidget.cpp:653
ControlMeasureEditWidget.h
Isis::ControlPoint::SetType
Status SetType(PointType newType)
Updates the control point's type.
Definition: ControlPoint.cpp:709
Isis::ControlPoint::RadiusSource::DEM
@ DEM
Definition: ControlPoint.h:456
Isis::ControlPoint::PointTypeCount
static const int PointTypeCount
Definition: ControlPoint.h:386
Isis::ControlPointEditWidget::setControl
void setControl(Control *control)
New control network being edited.
Definition: ControlPointEditWidget.cpp:674
Isis::ControlPoint::RadiusSource::None
@ None
Definition: ControlPoint.h:452
Isis::ControlMeasure::SetCamera
Status SetCamera(Isis::Camera *camera)
Set pointer to camera associated with a measure.
Definition: ControlMeasure.cpp:169
Isis::SerialNumberList::fileNameIndex
int fileNameIndex(const QString &filename)
Return a list index given a filename.
Definition: SerialNumberList.cpp:517
Isis::ControlMeasure::Manual
@ Manual
Hand Measured (e.g., qnet)
Definition: ControlMeasure.h:210
SerialNumberList.h
Application.h
Isis::ControlPoint::SurfacePointSource::None
@ None
Definition: ControlPoint.h:441
Isis::ControlMeasure::SetChooserName
Status SetChooserName()
Set chooser name to a user who last changed the coordinate.
Definition: ControlMeasure.cpp:196
Isis::Camera::SetUniversalGround
virtual bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
Definition: Camera.cpp:380
PvlEditDialog.h
Isis::SerialNumberList::add
void add(const QString &filename, bool def2filename=false)
Adds a new filename / serial number pair to the SerialNumberList.
Definition: SerialNumberList.cpp:121
Isis::Shape
This represents a shape in a project-based GUI interface.
Definition: Shape.h:68
Workspace.h
Isis::ControlPointEditWidget::ignoreLeftChanged
void ignoreLeftChanged()
ControlPoint.h
Isis::NewControlPointDialog::pointId
QString pointId() const
Definition: NewControlPointDialog.cpp:161
QStandardItemModel
Isis::ControlNet
a control network
Definition: ControlNet.h:257
Isis::NewControlPointDialog
Definition: NewControlPointDialog.h:49
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
Isis::ControlPointEditWidget::controlPointAdded
void controlPointAdded(QString pointId)
UniversalGroundMap.h
Isis::NewControlPointDialog::pointType
int pointType() const
Definition: NewControlPointDialog.cpp:166
Isis::ControlPoint::SurfacePointSource::Source
Source
Definition: ControlPoint.h:440
Camera.h
Isis::ControlPoint::Parent
ControlNet * Parent()
Definition: ControlPoint.h:466
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::ControlPointEditWidget::ControlPointEditWidget
ControlPointEditWidget(Directory *directory, QWidget *parent, bool addMeasures=false)
Consructs the ControlPointEditWidget widget.
Definition: ControlPointEditWidget.cpp:80
IException.h
std
Namespace for the standard library.
Isis::ControlPointEditWidget::stretchChipViewport
void stretchChipViewport(Stretch *, CubeViewport *)
Isis::TemplateList::type
QString type() const
Get the type of template in this TemplateList.
Definition: TemplateList.cpp:91
Isis::ControlPointEditWidget::addTemplates
void addTemplates(TemplateList *templateList)
Add registration TemplateList to combobox when imported to project.
Definition: ControlPointEditWidget.cpp:2971
Isis::NewControlPointDialog::setFiles
void setFiles(QStringList pointFiles)
Definition: NewControlPointDialog.cpp:252
Isis::ControlPoint::Free
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
Definition: ControlPoint.h:384
Isis::ControlPointEditWidget::editPoint
ControlPoint * editPoint()
Definition: ControlPointEditWidget.cpp:121
QMap
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:22
Control.h
QDialog
Isis::ControlMeasure::SetType
Status SetType(MeasureType type)
Set how the coordinate was obtained.
Definition: ControlMeasure.cpp:420
Isis::ControlPoint::SetAprioriSurfacePointSource
Status SetAprioriSurfacePointSource(SurfacePointSource::Source source)
This updates the source of the surface point.
Definition: ControlPoint.cpp:821
Isis::ControlPoint::Status
Status
This is a return status for many of the mutating (setter) method calls.
Definition: ControlPoint.h:393
Isis::SerialNumberList::fileName
QString fileName(const QString &sn)
Return a filename given a serial number.
Definition: SerialNumberList.cpp:399
Isis::Camera::Line
virtual double Line() const
Returns the current line number.
Definition: Camera.cpp:2710
Isis::NewControlPointDialog::setRadiusSource
void setRadiusSource(QStringList radiusFiles)
Definition: NewControlPointDialog.cpp:235
Isis::ControlPointEditWidget::ignoreRightChanged
void ignoreRightChanged()
QObject
Isis::Application::UserName
static QString UserName()
Returns the user name.
Definition: Application.cpp:816
Isis::ControlPointEditWidget::setEditPoint
void setEditPoint(ControlPoint *controlPoint, QString serialNumber="")
Slot called by Directory to set the control point for editing.
Definition: ControlPointEditWidget.cpp:1169
Isis::ControlMeasure::SetAprioriLine
Status SetAprioriLine(double aprioriLine)
Definition: ControlMeasure.cpp:134
ControlMeasureLogData.h
IsisDebug.h
SerialNumber.h
QAction
Isis::ControlPointEditWidget::measureChanged
void measureChanged()
QStandardItem
Isis::ControlPoint::Add
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
Definition: ControlPoint.cpp:223
TemplateList.h
ControlMeasure.h
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::ControlMeasure::SetCoordinate
Status SetCoordinate(double sample, double line)
Set the coordinate of the measurement.
Definition: ControlMeasure.cpp:219
Isis::ControlMeasure
a control measurement
Definition: ControlMeasure.h:175
Isis::Control::fileName
QString fileName() const
Access the name of the control network file associated with this Control.
Definition: Control.cpp:272