Isis 3.0 Object Programmers' Reference
Home
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
FeatureNomenclatureTool.h
1
#ifndef FeatureNomenclatureTool_h
2
#define FeatureNomenclatureTool_h
3
4
#include "
Tool.h
"
5
6
#include <QPointer>
7
#include <QProgressDialog>
8
#include "FeatureNomenclature.h"
9
10
class
QCheckBox;
11
class
QComboBox
;
12
class
QDialog
;
13
class
QLabel;
14
class
QLineEdit;
15
class
QMenu;
16
class
QProgressBar
;
17
class
QPushButton;
18
class
QString;
19
20
template
<
typename
A,
typename
B>
class
QMap
;
21
template
<
typename
A,
typename
B>
class
QPair;
22
23
namespace
Isis {
24
class
MdiCubeViewport;
25
class
UniversalGroundMap;
26
55
class
FeatureNomenclatureTool
:
public
Tool
{
56
Q_OBJECT
57
58
public
:
59
61
enum
VectorType
{
65
None
,
82
Arrows4
,
100
Arrows8
,
109
Box
110
};
111
112
FeatureNomenclatureTool
(
QWidget
*parent);
113
~FeatureNomenclatureTool
();
114
115
void
addTo
(QMenu *menu);
116
void
paintViewport
(
MdiCubeViewport
*vp, QPainter *painter);
117
118
bool
defaultEnabled
()
const
;
119
QColor
fontColor
()
const
;
120
int
fontSize
()
const
;
121
bool
showApprovedOnly
()
const
;
122
VectorType
vectorType
()
const
;
123
124
void
setDefaultEnabled
(
bool
defaultEnabled
);
125
void
setFontColor
(QColor color);
126
void
setFontSize
(
int
newFontSize);
127
void
setShowApprovedOnly
(
bool
approvedOnly);
128
void
setVectorType
(
VectorType
show);
129
130
QString
menuName
()
const
;
131
132
protected
:
133
QWidget
*
createToolBarWidget
(QStackedWidget *parent);
134
QAction
*
toolPadAction
(
ToolPad
*pad);
135
void
mouseButtonRelease
(QPoint p, Qt::MouseButton s);
136
void
updateTool
();
137
138
private
slots:
139
void
centerOnSelectedFeature
();
140
void
configure
();
141
void
featureSelected
();
142
void
featuresIdentified
(
FeatureNomenclature
*);
143
void
findNomenclatureStateChanged
(
int
);
144
void
nomenclaturePositionsOutdated
();
145
void
onToolActivated
();
146
void
showDisclaimer
();
147
148
private
:
149
// This is an inner class defined below.
150
class
ViewportFeatureDisplay;
151
152
void
centerOnFeature
(
MdiCubeViewport
*vp,
FeatureNomenclature::Feature
);
153
void
featuresForViewportFound
(
MdiCubeViewport
*vp);
154
void
findMissingNomenclature
();
155
void
findMissingNomenclature
(
MdiCubeViewport
*vp);
156
void
rebuildFeaturesCombo
();
157
void
removeFeatureDisplay
(
MdiCubeViewport
*vp);
158
void
showFeatureDetails
(
FeatureNomenclature::Feature
);
159
void
showFeatureWebsite
(
FeatureNomenclature::Feature
);
160
void
toolStateChanged
();
161
void
viewportDone
(
MdiCubeViewport
*vp);
162
ViewportFeatureDisplay *
viewportFeatureDisplay
(
MdiCubeViewport
*vp);
163
const
ViewportFeatureDisplay *
164
viewportFeatureDisplay
(
MdiCubeViewport
*vp)
const
;
165
bool
viewportFeaturesFound
(
MdiCubeViewport
*vp)
const
;
166
QList<MdiCubeViewport *>
viewportsWithFoundNomenclature
();
167
168
void
readSettings
();
169
void
writeSettings
();
170
171
private
:
187
class
FeaturePosition
{
188
public
:
189
FeaturePosition
();
190
FeaturePosition
(
MdiCubeViewport
*,
FeatureNomenclature::Feature
,
VectorType
vectorType
);
191
FeaturePosition
(
const
FeaturePosition
&other);
192
~FeaturePosition
();
193
194
bool
isValid
()
const
;
195
196
QPair<double, double>
center
()
const
;
197
QList< QPair<double, double>
>
edges
()
const
;
198
FeatureNomenclature::Feature
&
feature
();
199
const
FeatureNomenclature::Feature
&
feature
()
const
;
200
void
applyExtentType
(
VectorType
vectorType);
201
202
void
swap
(
FeaturePosition
&other);
203
FeaturePosition
&
operator=
(
const
FeaturePosition
&rhs);
204
205
private
:
207
double
m_centerLine
;
209
double
m_centerSample
;
210
212
UniversalGroundMap
*
m_gmap
;
213
218
QList< QPair<double, double>
> *
m_featureEdgeLineSamples
;
220
FeatureNomenclature::Feature
m_feature
;
221
};
222
223
235
class
FeatureDisplayPosition
{
236
public
:
237
FeatureDisplayPosition
();
238
FeatureDisplayPosition
(QRect textRect, QRect fullDisplayRect,
239
QList<QPoint>
edgePoints
);
240
FeatureDisplayPosition
(
const
FeatureDisplayPosition
&other);
241
~FeatureDisplayPosition
();
242
243
QRect
textArea
()
const
;
244
QRect
displayArea
()
const
;
245
QList<QPoint>
edgePoints
()
const
;
246
247
void
swap
(
FeatureDisplayPosition
&other);
248
FeatureDisplayPosition
&
operator=
(
const
FeatureDisplayPosition
&rhs);
249
private
:
250
251
private
:
253
QRect *
m_textRect
;
255
QRect *
m_fullDisplayRect
;
257
QList<QPoint>
*
m_edgePoints
;
258
};
259
260
274
class
ViewportFeatureDisplay
{
275
public
:
276
ViewportFeatureDisplay
();
277
ViewportFeatureDisplay
(
FeatureNomenclatureTool
*tool,
278
MdiCubeViewport
*
sourceViewport
,
279
QList<FeatureNomenclature::Feature>
features
,
280
VectorType
vectorType
);
281
ViewportFeatureDisplay
(
const
ViewportFeatureDisplay
&other);
282
~ViewportFeatureDisplay
();
283
284
void
applyExtentType
(
VectorType
vectorType);
285
void
centerFeature
(
FeatureNomenclature::Feature
);
286
QList<FeatureNomenclature::Feature>
features
();
287
QList<FeaturePosition>
featurePositions
();
288
MdiCubeViewport
*
sourceViewport
()
const
;
289
void
paint
(QPainter *painter,
bool
showVectors,
290
VectorType
vectorType,
bool
approvedOnly)
const
;
291
292
void
handleMouseClicked
(
FeatureNomenclatureTool
*tool, QPoint p,
293
Qt::MouseButton s);
294
void
handleViewChanged
(
FeatureNomenclatureTool
*tool);
295
296
void
swap
(
ViewportFeatureDisplay
&other);
297
ViewportFeatureDisplay
&
operator=
(
298
const
ViewportFeatureDisplay
&rhs);
299
300
private
:
301
QPair<QPointF, QPointF>
viewportCubeRange
()
const
;
302
303
private
:
308
MdiCubeViewport
*
m_sourceViewport
;
310
QList<FeaturePosition>
*
m_features
;
312
QList<FeatureDisplayPosition>
*
m_featureScreenAreas
;
318
QPair<QPointF, QPointF> *
m_viewportCubeRange
;
319
};
320
321
private
:
323
QPointer<QAction>
m_action
;
324
326
QPointer<QCheckBox>
m_findNomenclatureCheckBox
;
336
QPointer<QComboBox>
m_foundFeaturesCombo
;
338
QPointer<QPushButton>
m_nomenclatureCenterBtn
;
340
QPointer<QPushButton>
m_nomenclatureOptionsBtn
;
342
QPointer<QPushButton>
m_disclaimerBtn
;
347
QPointer<QProgressBar>
m_queryingProgress
;
348
350
QList<ViewportFeatureDisplay>
*
m_foundNomenclature
;
355
QMap
<
MdiCubeViewport
*,
356
FeatureNomenclature
*> *
m_nomenclatureSearchers
;
357
363
bool
m_nomenclatureEnabled
;
364
366
QString
m_disclaimerText
;
367
369
int
m_fontSize
;
371
QColor *
m_fontColor
;
373
bool
m_defaultEnabled
;
375
bool
m_disclaimedAlready
;
377
VectorType
m_extentType
;
379
bool
m_showApprovedOnly
;
380
};
381
}
382
383
#endif