20 #include <QHBoxLayout>
21 #include <QPushButton>
22 #include <QStackedWidget>
23 #include <QVBoxLayout>
76 pqPushButtonAddRoute->setToolTip( tr(
"Create new (route) waypoint(s) at the pointer (path) position(s)") );
82 QVBoxLayout* __pqVBoxLayout =
new QVBoxLayout();
86 __qFontHeader.setPixelSize( 16 );
87 __qFontHeader.setBold(
true );
88 QHBoxLayout* __pqHBoxLayoutHeader =
new QHBoxLayout();
89 QLabel* __pqLabelIcon =
new QLabel();
90 __pqLabelIcon->setPixmap( QPixmap(
":icons/32x32/pointer.png" ) );
91 __pqLabelIcon->setToolTip( tr(
"Pointer") );
92 __pqHBoxLayoutHeader->addWidget( __pqLabelIcon, 0, Qt::AlignTop );
94 __poTextName->setToolTip( tr(
"Name") );
95 __poTextName->setFont( __qFontHeader );
96 __poTextName->setWordWrap(
true );
97 __pqHBoxLayoutHeader->addWidget( __poTextName, 1 );
98 __pqVBoxLayout->addLayout( __pqHBoxLayoutHeader );
102 QTabWidget* __poTabWidget =
new QTabWidget();
103 __poTabWidget->setTabPosition( QTabWidget::South );
104 __poTabWidget->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
107 __qFontData.setPixelSize( 20 );
108 QWidget* __poWidgetPosition =
new QWidget();
109 QVBoxLayout* __pqVBoxLayoutPosition =
new QVBoxLayout();
131 __poWidgetPosition->setLayout( __pqVBoxLayoutPosition );
132 __poTabWidget->addTab( __poWidgetPosition, tr(
"Position") );
135 QWidget* __poWidgetPath =
new QWidget();
136 QVBoxLayout* __pqVBoxLayoutPath =
new QVBoxLayout();
158 __poWidgetPath->setLayout( __pqVBoxLayoutPath );
159 __poTabWidget->addTab( __poWidgetPath, tr(
"Path") );
162 __pqVBoxLayout->addWidget( __poTabWidget, 1 );
165 QFrame* __pqFrameSeparator =
new QFrame();
166 __pqFrameSeparator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
167 __pqVBoxLayout->addWidget( __pqFrameSeparator );
170 QHBoxLayout* __pqHBoxLayoutButtons =
new QHBoxLayout();
176 __pqVBoxLayout->addLayout( __pqHBoxLayoutButtons );
179 QWidget::setLayout( __pqVBoxLayout );
205 if( __poPointerOverlay->
hasPath() )
273 if( __poPointerOverlay->
hasPath() )
279 if( __iCount )
return;
290 if( !__poPointerOverlay->
hasPath() )
return;
292 __pqMutexDataChange->lock();
294 delete __poPointerPoint;
300 __pqMutexDataChange->unlock();
308 if( !__poLandmarkContainer )
return;
312 if( __poPointerOverlay->
hasPath() )
314 int __iCount = __poPointerOverlay->childCount();
315 for(
int __i = 2; __i < __iCount; __i++ )
317 QString __qsName = __poLandmarkContainer->
newChildName( tr(
"Landmark"), 1,
true );
320 __poLandmarkOverlay->setCurrentItem( __poLandmarkContainer );
324 QString __qsName = __poLandmarkContainer->
newChildName( tr(
"Landmark"), 1,
true );
326 if( __poLandmarkPoint ) __poLandmarkOverlay->setCurrentItem( __poLandmarkPoint );
333 if( __poLandmarkPoint ) __poLandmarkPoint->
showEdit();
341 if( !__poRouteContainer )
return;
345 if( __poPointerOverlay->
hasPath() )
347 int __iCount = __poPointerOverlay->childCount();
348 for(
int __i = 2; __i < __iCount; __i++ )
350 QString __qsName = __poRouteContainer->
newChildName( tr(
"Waypoint"), 1,
true );
353 __poRouteOverlay->setCurrentItem( __poRouteContainer );
357 QString __qsName = __poRouteContainer->
newChildName( tr(
"Waypoint"), 1,
true );
359 if( __poRoutePoint ) __poRouteOverlay->setCurrentItem( __poRoutePoint );
366 if( __poRoutePoint ) __poRoutePoint->
showEdit();
void setScaleArea(const CDataPosition &_roGeoPosition1, const CDataPosition &_roGeoPosition2, double _fdScaleCorrection=1.0)
Sets the reference scale factor to display the given (geographical) area (defined by its opposite cor...
void updateChart()
Update the (current) chart content (on screen)
void setGeoPosition(const CDataPosition &_roGeoPosition, bool _bSkipCurrent=false)
Sets the reference chart (geographical) position.
(Geographical) Position data [long,lat,elev]
double getLongitude() const
Returns this position's longitude, in degrees.
void resetPosition()
Resets all coordinates (to an undefined position)
double getElevation() const
Returns this position's elevation, in meters.
double getLatitude() const
Returns this position's latitude, in degrees.
void setPosition(double _fdLongitude, double _fdLatitude, double _fdElevation=UNDEFINED_ELEVATION)
Sets new coordinates.
static constexpr double UNDEFINED_ELEVATION
Specific value for an undefined elevation.
[UI] Landmark overlay container
CLandmarkPoint * addPoint(const QString &_rqsName, const CDataPosition &_roDataPosition=CDataPosition::UNDEFINED)
Add a new landmark (item/point) to this container.
[UI] Landmark overlay container
CLandmarkContainer * pickContainer()
Pick (select) a container among the available ones (0 if none is selected)
[UI] Landmark overlay point (item)
virtual void showEdit()
Displays this object's edit widget/view.
[UI] Generic overlay object's detail view
COverlayObject * poOverlayObject
Overlay object being displayed.
QString newChildName(const QString &_rqsName, int _iZeroPrefix=0, bool _bForceSuffix=false) const
Returns a valid (non-duplicate) name for a new sibling of this object.
static int getPositionBox(const QTreeWidgetItem *_pqTreeWidgetItem, CDataPosition *_poDataPositionLower, CDataPosition *_poDataPositionUpper, int _iIndexMin=0, int _iIndexMax=-1)
Returns the minimal geographical positions box containing the points in the given overlay/container.
[UI] Overlay-specific text label
void setText(const QString &_rqsText)
[override] QLabel::setText( const QString& )
void resetText()
Resets (clears) the underlying QLabel's text.
void forceRedraw()
Forces this overlay's rendering (not matter its cache content)
double getPathLengthRL()
Returns the pointer path (rhumb-line) length along its segments.
bool hasPath() const
Returns whether a pointer path has been defined.
int getPathSegments() const
Returns the quantity of segments along the pointer path (0 if no path is defined)
double getPathLengthGC()
Returns the equivalent (great-circle) length between the first and last position of the pointer path.
void clearPath()
Clears the pointer path.
CPointerPoint * usePointerPoint()
Returns the pointer point corresponding to the mouse pointer.
COverlayText * poTextPathLengthGC
[UI:Label] Path (great-circle) length
void slotToggleVisible()
[UI:Slot] Slot to modify the visibility status
void slotDelete()
[UI:Slot] Slot to delete last path's point
virtual void resetContent()
Resets (clears) the content of the underlying widget.
void slotAddLandmark()
[UI:Slot] Slot to add new landmark
QPushButton * pqPushButtonAddLandmark
[UI:Button] Add new landmark
virtual void refreshContent()
Refreshes the content of the underlying widget.
QPushButton * pqPushButtonAddRoute
[UI:Button] Add new (route) waypoint
virtual void disableContent()
Disables the content (controls) of the underlying widget.
COverlayText * poTextLongitude
[UI:Label] Longitude
void constructLayout()
Constructs the layout of the user-interface.
virtual void enableContent()
Enables the content (controls) of the underlying widget.
QPushButton * pqPushButtonDelete
[UI:Button] Delete
void slotPositionCenter()
[UI:Slot] Slot to center chart (on item's position)
void slotAddRoute()
[UI:Slot] Slot to add new (route) waypoint
CPointerPointDetailView(QWidget *_pqParent=0)
COverlayText * poTextLatitude
[UI:Label] Latitude
COverlayText * poTextPathSegments
[UI:Label] Path segments count
QPushButton * pqPushButtonCenter
[UI:Button] Center (on chart)
COverlayText * poTextPathLengthRL
[UI:Label] Path (rhumb-line) length
QPushButton * pqPushButtonVisible
[UI:Button] Visibility status
COverlayText * poTextElevation
[UI:Label] Elevation
[UI] Pointer overlay point (item)
virtual COverlay * useOverlay()
Returns this object's (base) overlay.
virtual void toggleVisibility()
virtual void showDetail()
Displays this object's details (in the appropriate widget/view)
[UI] Route overlay container
CRoutePoint * addPoint(const QString &_rqsName, const CDataPosition &_roDataPosition=CDataPosition::UNDEFINED, bool _bMinimizeLength=false)
Add a new route (item/point) to this container.
[UI] Route overlay container
CRouteContainer * pickContainer()
Pick (select) a route (container) among the available ones (0 if none is selected)
[UI] Route overlay point (item) / waypoint
virtual void showEdit()
Displays this object's edit widget/view.
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static QString toString(double _fdValue, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static QString toString(double _fdValue, EType _eType, EUnit _eUnit, int _iPrecision=0)
Returns the formatted represention of the given value, using the specified format/unit and decimal pr...
static CPointerOverlay * usePointerOverlay()
static QMutex * useMutexDataChange()
static CRouteOverlay * useRouteOverlay()
static CChartTable * useChartTable()
static CLandmarkOverlay * useLandmarkOverlay()