Isis 3 Programmer Reference
QnetTool.h
1#ifndef QnetTool_h
2#define QnetTool_h
3
4#include "Tool.h"
5#include "ControlPoint.h"
6
7#include <QCloseEvent>
8#include <QPalette>
9#include <QPointer>
10#include <QStringList>
11
12class QAction;
13class QBoxLayout;
14class QCheckBox;
15class QComboBox;
16class QGroupBox;
17class QLabel;
18class QMainWindow;
19class QObject;
20class QPainter;
21class QPoint;
22class QPushButton;
23class QSplitter;
24class QStackedWidget;
25class QString;
26class QTableWidget;
27class QTextEdit;
28class QWidget;
29
30namespace Isis {
31 class ControlMeasure;
32 class ControlNet;
33 class ControlPointEdit;
34 class Cube;
35 class CubeViewport;
36 class MainWindow;
37 class MdiCubeViewport;
38 class QnetHoldPointDialog;
39 class SerialNumberList;
40 class Stretch;
41 class ToolPad;
42 class UniversalGroundMap;
43
259 class QnetTool : public Tool {
260 Q_OBJECT
261
262 public:
263 QnetTool (QWidget *parent);
264 virtual ~QnetTool ();
265 void paintViewport (MdiCubeViewport *cvp,QPainter *painter);
266
267 // measure column values
268 enum MeasureColumns {
269 FILENAME,
270 CUBESN,
271 SAMPLE,
272 LINE,
273 APRIORISAMPLE,
274 APRIORILINE,
275 SAMPLERESIDUAL,
276 LINERESIDUAL,
277 RESIDUALMAGNITUDE,
278 SAMPLESHIFT,
279 LINESHIFT,
280 PIXELSHIFT,
281 GOODNESSOFFIT,
282 IGNORED,
283 EDITLOCK,
284 TYPE
285 };
286 static const int NUMCOLUMNS = 16;
287
288 QString measureColumnToString(MeasureColumns column);
289
290 ControlNet *controlNet();
291 const ControlNet *controlNet() const;
292
293 SerialNumberList *serialNumberList();
294 const SerialNumberList *serialNumberList() const;
295
296 Workspace *workspace() const;
297
298 signals:
299 void qnetToolSave();
300 void qnetToolSaveAs();
301 void refreshNavList();
302 void editPointChanged(QString pointId);
303 void netChanged();
304 void ignorePointChanged();
305 void ignoreLeftChanged();
306 void ignoreRightChanged();
307 void showNavTool();
308 void newControlNetwork(ControlNet *);
309 void stretchChipViewport(Stretch *, CubeViewport *);
310 void measureChanged();
311
312 public slots:
313 void updateList();
314 void updateNet(QString cNetFileName);
315 void createPoint(double lat,double lon);
316 void createFixedPoint(double lat,double lon);
317 void modifyPoint(ControlPoint *point);
318 void deletePoint(ControlPoint *point);
319 void updatePointInfo(QString pointId);
320 void refresh();
321
322 protected:
324 bool eventFilter(QObject *o,QEvent *e);
325
326 protected slots:
327 void mouseButtonRelease(QPoint p, Qt::MouseButton s);
328 QWidget *createToolBarWidget (QStackedWidget *parent);
329
330 private slots:
331 void enterWhatsThisMode();
332 void paintAllViewports (QString pointId );
333 void saveNet();
334 void saveAsNet();
335 void addMeasure();
336 void setPointType (int pointType);
337 void setLockPoint (bool ignore);
338 void setIgnorePoint (bool ignore);
339 void setLockLeftMeasure (bool ignore);
340 void setIgnoreLeftMeasure (bool ignore);
341 void setLockRightMeasure (bool ignore);
342 void setIgnoreRightMeasure (bool ignore);
343 void showNavWindow (bool checked);
344
346
347 void nextRightMeasure();
349 void selectLeftMeasure (int index);
350 void selectRightMeasure (int index);
351 void updateLeftMeasureInfo ();
353
354 void measureSaved();
355 bool checkReference();
356 void updateGroundPosition();
357 void savePoint();
358 void colorizeSaveButton();
359
360 void openTemplateFile();
361 void viewTemplateFile();
362 void saveChips();
363
364 void openGround();
366 void openDem();
367 void openReferenceRadius();
368 void showHideTemplateEditor();
369 void saveTemplateFile();
370 void saveTemplateFileAs();
371 void setTemplateModified();
372 void writeTemplateFile(QString);
373
374 private:
375 void createActions();
376 void createMenus();
378 void createToolBars();
379 bool findPointLocation();
380 void loadPoint();
381 void loadGroundMeasure();
382 void loadMeasureTable();
383 void drawAllMeasurments (MdiCubeViewport *vp,QPainter *painter);
384 void drawGroundMeasures (MdiCubeViewport *vp,QPainter *painter);
385// void drawMeasures (MdiCubeViewport *vp,QPainter *painter,ControlPoint &point);
386 void createQnetTool(QWidget *parent);
387 QSplitter * createTopSplitter();
388 QGroupBox * createControlPointGroupBox();
389 QGroupBox * createLeftMeasureGroupBox();
390 QGroupBox * createRightMeasureGroupBox();
392 void loadTemplateFile(QString);
393 bool okToContinue();
394 void initDem(QString demFile);
395 double demRadius(double latitude, double longitude);
396 void clearGroundSource();
397 bool IsMeasureLocked(QString serialNumber);
398
399 void readSettings();
400 void writeSettings() const;
401
402 QPointer<MainWindow> m_qnetTool;
403
404 QString m_cnetFileName;
405
406 QStringList findPointFiles(double lat, double lon);
407
408 QPointer<QAction> m_createPoint;
409 QPointer<QAction> m_modifyPoint;
410 QPointer<QAction> m_deletePoint;
411
412 QPointer<QAction> m_openGround;
413 QPointer<QAction> m_openDem;
414 QPointer<QAction> m_saveNet;
415 QPointer<QToolBar> toolBar;
416 QPointer<QAction> m_saveAsNet;
417 QPointer<QAction> m_closeQnetTool;
418
419 QPointer<QAction> m_saveChips;
420 QPointer<QAction> m_showHideTemplateEditor;
421 QPointer<QAction> m_openTemplateFile;
422 QPointer<QAction> m_saveTemplateFile;
423 QPointer<QAction> m_saveTemplateFileAs;
424
425 QPointer<QAction> m_whatsThis;
426
427 QPointer<QMainWindow> m_mw;
428 QPointer<ControlPointEdit> m_pointEditor;
429
430 QPushButton *m_savePoint;
431 QPalette m_saveDefaultPalette;
432
433 QTextEdit *m_templateEditor;
434 QWidget *m_templateEditorWidget;
435 bool m_templateModified;
436
437 QPointer<QLabel> m_templateFileNameLabel;
438 QPointer<QLabel> m_groundFileNameLabel;
439 QPointer<QLabel> m_radiusFileNameLabel;
440 QPointer<QLabel> m_ptIdValue;
441 QPointer<QComboBox> m_pointType;
442 QPointer<QLabel> m_numMeasures;
443 QPointer<QLabel> m_pointAprioriLatitude;
444 QPointer<QLabel> m_pointAprioriLongitude;
445 QPointer<QLabel> m_pointAprioriRadius;
446 QPointer<QLabel> m_pointAprioriLatitudeSigma;
447 QPointer<QLabel> m_pointAprioriLongitudeSigma;
448 QPointer<QLabel> m_pointAprioriRadiusSigma;
449 QPointer<QLabel> m_pointLatitude;
450 QPointer<QLabel> m_pointLongitude;
451 QPointer<QLabel> m_pointRadius;
452
453 QPointer<QCheckBox> m_lockPoint;
454 QPointer<QCheckBox> m_ignorePoint;
455 QPointer<QLabel> m_leftReference;
456 QPointer<QLabel> m_leftMeasureType;
457 QPointer<QLabel> m_leftSampError;
458 QPointer<QLabel> m_leftLineError;
459 QPointer<QLabel> m_leftSampShift;
460 QPointer<QLabel> m_leftLineShift;
461 QPointer<QLabel> m_leftGoodness;
462 QPointer<QLabel> m_rightGoodness;
463 QPointer<QLabel> m_rightReference;
464 QPointer<QLabel> m_rightMeasureType;
465 QPointer<QLabel> m_rightSampError;
466 QPointer<QLabel> m_rightLineError;
467 QPointer<QLabel> m_rightSampShift;
468 QPointer<QLabel> m_rightLineShift;
469 QPointer<QCheckBox> m_lockLeftMeasure;
470 QPointer<QCheckBox> m_ignoreLeftMeasure;
471 QPointer<QCheckBox> m_lockRightMeasure;
472 QPointer<QCheckBox> m_ignoreRightMeasure;
473
474 QPointer<QComboBox> m_leftCombo;
475 QPointer<QComboBox> m_rightCombo;
476
477 QPointer<QMainWindow> m_measureWindow;
478 QPointer<QTableWidget> m_measureTable;
479
480 QPointer<ControlPoint> m_editPoint;
481
482 QStringList m_pointFiles;
483
484 QString m_leftFile;
485 QPointer<ControlMeasure> m_leftMeasure;
486 QPointer<ControlMeasure> m_rightMeasure;
487 QScopedPointer<Cube> m_leftCube;
488 QScopedPointer<Cube> m_rightCube;
489
490 QString m_groundFile;
491 QScopedPointer<Cube> m_groundCube;
492 QString m_groundSN;
493 QScopedPointer<UniversalGroundMap> m_groundGmap;
494 bool m_groundOpen;
495 ControlPoint::SurfacePointSource::Source m_groundSurfacePointSource;
496 ControlPoint::RadiusSource::Source m_groundRadiusSource;
497 // TODO: Combine the following m_groundSourceFile, m_radiusSourceFile
498 // with m_groundFile and m_demFile. Is it just a matter of
499 // full path vs filename only?
500 QString m_groundSourceFile;
501 QString m_radiusSourceFile;
502 QString m_demFile;
503 bool m_demOpen;
504 QScopedPointer<Cube> m_demCube;
505
506 QString m_lastUsedPointId;
507 QPointer<ControlNet> m_controlNet;
508 SerialNumberList *m_serialNumberList;
509 QPointer<Workspace> m_workspace;
510 };
511};
512
513#endif
a control measurement
a control network
Definition ControlNet.h:258
A single control point.
Widget to display Isis cubes for qt apps.
Cube display widget for certain Isis MDI applications.
Qnet tool operations.
Definition QnetTool.h:259
void openDem()
Open a DEM for ground source radii.
void updateNet(QString cNetFileName)
Updates the Control Network displayed in the Qnet Tool title bar.
QGroupBox * createLeftMeasureGroupBox()
Definition QnetTool.cpp:331
void addMeasure()
Add measure to point.
void loadTemplateFile(QString)
Updates the current template file being used.
void refresh()
Refresh all necessary widgets in QnetTool including the PointEditor and CubeViewports.
void saveTemplateFile()
save the file opened in the template editor
void updateLeftMeasureInfo()
void openReferenceRadius()
Open a radius source using the shape model of the reference measure of m_editPoint.
void updatePointInfo(QString pointId)
Update the current editPoint information in the Point Editor labels.
void setPointType(int pointType)
Set the point type.
bool checkReference()
Change which measure is the reference.
Definition QnetTool.cpp:866
void paintViewport(MdiCubeViewport *cvp, QPainter *painter)
Take care of drawing things on a viewPort.
void loadPoint()
Load point into QnetTool.
void saveTemplateFileAs()
save the contents of template editor to a file chosen by the user
void modifyPoint(ControlPoint *point)
Modify control point.
void setLockPoint(bool ignore)
Set point's "EditLock" keyword to the value of the input parameter.
void previousRightMeasure()
Selects the previous right measure when activated by key shortcut.
QnetTool(QWidget *parent)
Consructs the Qnet Tool window.
Definition QnetTool.cpp:67
void setIgnoreRightMeasure(bool ignore)
Set the "Ignore" keyword of the measure shown in the right viewport to the value of the input paramet...
QSplitter * createTopSplitter()
creates everything above the ControlPointEdit
Definition QnetTool.cpp:236
void viewTemplateFile()
Allows the user to view the template file that is currently set.
void setIgnorePoint(bool ignore)
Set point's "Ignore" keyword to the value of the input parameter.
bool findPointLocation()
Attempt to find the control point's location on the ground source.
void selectLeftMeasure(int index)
Select left measure.
void writeTemplateFile(QString)
write the contents of the template editor to the file provided.
void setIgnoreLeftMeasure(bool ignore)
Set the "Ignore" keyword of the measure shown in the left viewport to the value of the input paramete...
void colorizeSaveButton()
Turn "Save Point" button text to red.
void createQnetTool(QWidget *parent)
create the main window for editing control points
Definition QnetTool.cpp:131
void savePoint()
Save edit point to the Control Network.
bool IsMeasureLocked(QString serialNumber)
Check for implicitly locked measure in m_editPoint.
void setLockRightMeasure(bool ignore)
Set the "EditLock" keyword of the measure shown in the right viewport to the value of the input param...
void drawAllMeasurments(MdiCubeViewport *vp, QPainter *painter)
Draw all measurments which are on this viewPort.
void saveAsNet()
Signal to save the control net.
void showNavWindow(bool checked)
Emits a signal to displays the Navigation window.
void groundViewportClosed(CubeViewport *)
Slot called when the ground source cube viewport is closed.
void loadMeasureTable()
Load measure information into the measure table.
void nextRightMeasure()
Selects the next right measure when activated by key shortcut.
void createFixedPoint(double lat, double lon)
Create new Fixed control point.
void writeSettings() const
This method is called when the Main window is closed or hidden to write the size and location setting...
void createActions()
Creates the menu actions for Qnet Tool.
Definition QnetTool.cpp:507
void mouseButtonRelease(QPoint p, Qt::MouseButton s)
Handle mouse events on CubeViewport.
void openGround()
Open a ground source for selecting fixed points.
double demRadius(double latitude, double longitude)
Return a radius values from the dem using bilinear interpolation.
void setLockLeftMeasure(bool ignore)
Set the "EditLock" keyword of the measure shown in the left viewport to the value of the input parame...
void selectRightMeasure(int index)
Select right measure.
void saveChips()
Slot which calls ControlPointEditor slot to save chips.
QWidget * createToolBarWidget(QStackedWidget *parent)
This method creates the widgets for the tool bar.
void createTemplateEditorWidget()
Creates the Widget which contains the template editor and its toolbar.
Definition QnetTool.cpp:477
void deletePoint(ControlPoint *point)
Delete control point.
void paintAllViewports(QString pointId)
This method will repaint the given Point ID in each viewport Note: The pointId parameter is here even...
void createMenus()
Customize dropdown menus below title bar.
Definition QnetTool.cpp:628
void createPoint(double lat, double lon)
Create new control point.
void drawGroundMeasures(MdiCubeViewport *vp, QPainter *painter)
Draw all Fixed or Constrained points on the ground source viewport.
QGroupBox * createControlPointGroupBox()
Definition QnetTool.cpp:265
QGroupBox * createRightMeasureGroupBox()
Creates the right measure group box.
Definition QnetTool.cpp:404
void readSettings()
This method is called from the constructor so that when the Main window is created,...
bool okToContinue()
Allows user to set a new template file.
void measureSaved()
This method is connected with the measureSaved() signal from ControlPointEdit.
Definition QnetTool.cpp:726
void saveNet()
Signal to save control net.
void setTemplateModified()
called when the template file is modified by the template editor
QAction * toolPadAction(ToolPad *pad)
Adds the Tie tool action to the tool pad.
void updateSurfacePointInfo()
Update the Surface Point Information in the QnetTool window.
void updateRightMeasureInfo()
void loadGroundMeasure()
Load ground measure into right side and add to file combo boxes.
ControlMeasure * createTemporaryGroundMeasure()
Create a temporary measure to hold the ground point info for ground source.
bool eventFilter(QObject *o, QEvent *e)
Event filter for QnetTool.
void openTemplateFile()
prompt user for a registration template file to open.
Serial Number list generator.
Pixel value mapper.
Definition Stretch.h:58
Base class for the Qisis tools.
Definition Tool.h:67
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16