NDEVR
API Documentation
AerialImageView

A simple widget for showing an AerialImage or top down view rendered with a service like google earth A loading screen appears as images are loaded in. More...

Inheritance diagram for AerialImageView:
[legend]
Collaboration diagram for AerialImageView:
[legend]

Public Types

enum  FetchReturn {
  e_success , e_invalid_size , e_could_not_fetch , e_no_preview ,
  e_cache_change
}
 Result codes returned when fetching an aerial image. More...
Public Types inherited from QCustomStackedWidgetBase
enum  StackAnimationDirection {
  e_left_to_right , e_right_to_left , e_top_to_bottom , e_bottom_to_top ,
  e_automatic
}
 Defines the direction of slide animations between stacked pages. More...

Public Member Functions

 AerialImageView (QWidget *parent=nullptr)
 Constructs the AerialImageView widget.
AerialImageMode aerialImageMode () const
 Returns the current aerial image rendering mode.
Bounds< 2, fltp08drawBoundsWGS84 () const
 Returns the current draw bounds converted to WGS84 coordinates.
bool isLoaded () const
 Checks whether an aerial image has been successfully loaded.
void onImageLoadedSignal (FetchReturn success)
 Emitted when an aerial image load operation completes.
void onUserModifiedSignal ()
 Emitted when the user modifies the aerial image view settings.
bool previewBoundsTolerable (QSize size) const
 Checks whether the preview bounds are acceptable for the given widget size.
void resizeEvent (QResizeEvent *event) override
 Handles resize events, potentially triggering an image refresh.
void setAerialImageMode (AerialImageMode mode)
 Sets the aerial image rendering mode (e.g., satellite, hybrid, terrain).
void setCoordinateSpace (const UUID &id)
 Sets the coordinate space used for projecting geographic coordinates.
void setDrawBounds (const Bounds< 3, fltp08 > &draw_bounds)
 Sets the 3D draw bounds for the aerial image region.
void setLocalBounds (const Bounds< 3, fltp08 > &bounds)
 Sets the local bounds defining the area of interest for the aerial image.
void setToNoPreview ()
 Sets the view to display a "no preview available" placeholder.
virtual void showEvent (QShowEvent *event) override
 Handles show events, initiating an image load if needed.
void updateAerialImage ()
 Triggers a refresh of the aerial image based on current bounds and settings.
Public Member Functions inherited from QCustomStackedWidget
 QCustomStackedWidget (QWidget *parent=nullptr)
 Constructs a stacked widget.
uint04 activeIndex () const
 Returns the index of the currently active (or animating-to) widget.
QWidget * activeWidget () const
 Returns the currently active (or animating-to) widget.
virtual uint04 addWidget (QWidget *w) override
 Adds a widget as a new page in the stacked widget.
uint04 count () const
 Returns the number of pages in the stacked widget.
uint04 currentIndex () const
 Returns the index of the currently displayed page.
QWidget * currentWidget () const
 Returns the currently displayed widget.
bool hasWidget (QWidget *widget) const
 Checks whether the given widget is contained in the stacked widget.
uint04 indexOf (QWidget *widget) const
 Returns the index of the given widget.
void insertWidget (uint04 index, QWidget *w)
 Inserts a widget at a specific index.
void moveContent (uint04 from, uint04 to) override
 Moves a child widget from one index to another.
void removeWidget (QWidget *widget)
 Removes a widget from the stacked widget.
void removeWidget (QWidget *widget, QWidget *slide_in)
 Removes a widget and slides to a replacement widget if it was active.
void setCurrentIndex (uint04 idx)
 Sets the current visible page index without animation.
void slideInAnimation (enum StackAnimationDirection direction=e_automatic, bool cache_in_image=false) override
 Executes the slide animation between the current and next pages.
void slideInAnimation (PopupInfo origin_rect, enum StackAnimationDirection direction=e_automatic, bool cache_in_image=false) override
 Executes the slide animation using popup origin information.
void slideInIdx (uint04 idx, enum StackAnimationDirection direction) override
 Slides to the page at the given index with the specified direction.
void slideInIdx (uint04 idx, int delay_time=0, enum StackAnimationDirection direction=e_automatic) override
 Slides to the page at the given index with animation.
void slideInIdx (uint04 idx, PopupInfo origin_rect, int delay_time=0, enum StackAnimationDirection direction=e_automatic) override
 Slides to the page at the given index with animation and popup origin info.
virtual void slideInNext () override
 Slides to the next page with animation.
virtual void slideInPrev () override
 Slides to the previous page with animation.
void slideInWgt (QWidget *widget, enum StackAnimationDirection direction=e_automatic, bool force_slide=false) override
 Slides to a specific widget with animation.
void swapIndices (uint04 a, uint04 b) override
 Swaps two child widgets at the given indices.
QWidget * widget (uint04 idx) const
 Returns the widget at the given index.
Public Member Functions inherited from QCustomStackedWidgetBase
void animationFinished ()
 Signal emitted when a slide animation completes.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for the stacked widget.
void setAnimation (enum QEasingCurve::Type animationtype)
 Sets the easing curve type used for slide animations.
virtual void setCurrentIdx (uint04 current_index)
 Sets the current visible page index without animation.
void setCustomPixmap (QPixmap *pixmap)
 Sets a custom pixmap to render during slide transitions instead of widget captures.
void setSpeed (int speed)
 Sets the animation duration in milliseconds for slide transitions.
void setVerticalMode (bool vertical=true)
 Enables or disables vertical slide animation mode.
void setWrap (bool wrap)
 Sets whether page navigation wraps around from last to first and vice versa.
QSize sizeHint () const override
 Returns the recommended size for the stacked widget.

Protected Member Functions

void showContextMenu (const QPoint &pos)
 Displays a context menu at the specified position.
FetchReturn updatePreviewImageFromThread ()
 Fetches and updates the preview image from a background thread.
Protected Member Functions inherited from QCustomStackedWidgetBase
 QCustomStackedWidgetBase (QWidget *parent=nullptr)
 Constructs the stacked widget base.
uint04 activeIndex () const
 Returns the index of the currently active (or animating-to) widget.
QWidget * activeWidget () const
 Returns the currently active (or animating-to) widget.
void animationDoneSlot ()
 Slot called when the slide animation completes to finalize the transition.
double animationPercent () const
 Returns the current animation interpolation percent.
void childDestroyedSlot (QObject *widget)
 Slot called when a child widget is destroyed, to remove it from the page list.
uint04 count () const
 Returns the number of pages in the stacked widget.
uint04 currentIndex () const
 Returns the index of the currently displayed page.
QWidget * currentWidget () const
 Returns the currently displayed widget.
bool eventFilter (QObject *object, QEvent *event) override
 Filters events for child widgets to handle layout and visibility changes.
uint04 indexOf (QWidget *widget) const
 Returns the index of the given widget in the stacked widget.
void insertWidget (uint04 index, QWidget *w)
 Inserts a widget at a specific index in the stacked widget.
void paintEvent (QPaintEvent *) override
 Custom paint event that renders slide transition animations.
void removeWidget (QWidget *widget)
 Removes a widget from the stacked widget.
void removeWidget (QWidget *widget, QWidget *slide_to_if_active)
 Removes a widget and slides to a replacement widget if it was the active page.
void resizeEvent (QResizeEvent *event) override
 Handles resize events to update child widget geometries.
void setAnimationPercent (double animation_percent)
 Sets the current animation interpolation percent for the Q_PROPERTY system.
void showEvent (QShowEvent *event) override
 Handles show events to ensure proper layout of the active widget.
QWidget * widget (uint04 index) const
 Returns the widget at the given index.

Protected Attributes

ProgressWidgetm_download_progress
 The progress indicator shown during image downloads.
Bounds< 3, fltp08m_draw_bounds
 The 3D bounding region to render.
AerialImageMode m_image_mode
 The current aerial image rendering mode.
ImageViewm_image_view
 The image view widget displaying the aerial image.
QSize m_last_preview_size
 The size of the last successfully rendered preview.
UUID m_projection_coordinate_space
 The coordinate space used for projection.
UUID m_request_id
 The unique identifier for the current fetch request.
Protected Attributes inherited from QCustomStackedWidgetBase
double m_animation_percent
 The current animation interpolation percent (0.0 to 1.0).
enum QEasingCurve::Type m_animationtype
 The easing curve type for slide animations.
Buffer< QWidget * > m_child_widgets
 The list of child page widgets.
uint04 m_current_index
 The index of the currently displayed page.
bool m_is_animating
 Whether a slide animation is currently in progress.
uint04 m_last
 The index of the previously displayed page.
int m_last_animation_time
 The duration of the last animation in milliseconds.
QPointer< QPropertyAnimation > m_move_animation
 The property animation driving slide transitions.
uint04 m_next
 The index of the page being animated to.
uint04 m_now
 The index of the currently displayed page during animation.
QPoint m_offset
 The pixel offset used during slide animation rendering.
PopupInfo m_popup_info
 The popup info used for animation origin calculations.
int m_speed
 The animation duration in milliseconds.
bool m_vertical
 Whether slide animations are in vertical mode.
bool m_wrap = false
 Whether page navigation wraps around at boundaries.

Additional Inherited Members

Static Public Attributes inherited from QCustomStackedWidgetBase
static ApplicationOption< sint04default_stack_animation_speed
 Default time in milliseconds to animate a slide transition.

Detailed Description

A simple widget for showing an AerialImage or top down view rendered with a service like google earth A loading screen appears as images are loaded in.


Definition at line 46 of file AerialImageView.h.

Member Enumeration Documentation

◆ FetchReturn

Result codes returned when fetching an aerial image.

Enumerator
e_success 

The image was fetched successfully.

e_invalid_size 

The requested image size was invalid or zero.

e_could_not_fetch 

The image could not be retrieved from the service.

e_no_preview 

No preview is available for the current bounds.

e_cache_change 

The cache changed during the fetch, requiring a retry.

Definition at line 53 of file AerialImageView.h.

Constructor & Destructor Documentation

◆ AerialImageView()

AerialImageView::AerialImageView ( QWidget * parent = nullptr)

Constructs the AerialImageView widget.

Parameters
[in]parentThe optional parent widget.

Member Function Documentation

◆ aerialImageMode()

AerialImageMode AerialImageView::aerialImageMode ( ) const
inline

Returns the current aerial image rendering mode.

Returns
The active AerialImageMode.

Definition at line 110 of file AerialImageView.h.

References m_image_mode.

◆ drawBoundsWGS84()

Bounds< 2, fltp08 > AerialImageView::drawBoundsWGS84 ( ) const

Returns the current draw bounds converted to WGS84 coordinates.

Returns
The 2D bounding region in WGS84 geographic coordinates.

◆ isLoaded()

bool AerialImageView::isLoaded ( ) const

Checks whether an aerial image has been successfully loaded.

Returns
True if an image is currently loaded and displayed.

◆ onImageLoadedSignal()

void AerialImageView::onImageLoadedSignal ( FetchReturn success)

Emitted when an aerial image load operation completes.

Parameters
[in]successThe result code indicating whether the fetch succeeded.

◆ previewBoundsTolerable()

bool AerialImageView::previewBoundsTolerable ( QSize size) const

Checks whether the preview bounds are acceptable for the given widget size.

Parameters
[in]sizeThe widget size to evaluate against.
Returns
True if the current bounds produce a reasonable preview at the given size.

◆ resizeEvent()

void AerialImageView::resizeEvent ( QResizeEvent * event)
override

Handles resize events, potentially triggering an image refresh.

Parameters
[in]eventThe resize event.

◆ setAerialImageMode()

void AerialImageView::setAerialImageMode ( AerialImageMode mode)

Sets the aerial image rendering mode (e.g., satellite, hybrid, terrain).

Parameters
[in]modeThe desired AerialImageMode.

◆ setCoordinateSpace()

void AerialImageView::setCoordinateSpace ( const UUID & id)

Sets the coordinate space used for projecting geographic coordinates.

Parameters
[in]idThe UUID of the coordinate space to use.

◆ setDrawBounds()

void AerialImageView::setDrawBounds ( const Bounds< 3, fltp08 > & draw_bounds)
inline

Sets the 3D draw bounds for the aerial image region.

Parameters
[in]draw_boundsThe 3D bounding region to render.

Definition at line 115 of file AerialImageView.h.

References m_draw_bounds.

◆ setLocalBounds()

void AerialImageView::setLocalBounds ( const Bounds< 3, fltp08 > & bounds)

Sets the local bounds defining the area of interest for the aerial image.

Parameters
[in]boundsThe 3D bounding region in local coordinates.

◆ showContextMenu()

void AerialImageView::showContextMenu ( const QPoint & pos)
protected

Displays a context menu at the specified position.

Parameters
[in]posThe position in widget coordinates where the menu should appear.

◆ showEvent()

virtual void AerialImageView::showEvent ( QShowEvent * event)
overridevirtual

Handles show events, initiating an image load if needed.

Parameters
[in]eventThe show event.

◆ updatePreviewImageFromThread()

FetchReturn AerialImageView::updatePreviewImageFromThread ( )
protected

Fetches and updates the preview image from a background thread.

Returns
The result code indicating the outcome of the fetch.

The documentation for this class was generated from the following file: