NDEVR
API Documentation
DatasetView

A relatively lightweight Widget that can be used for an entire application that allows for easy download and display of a dataset. More...

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

Public Member Functions

 DatasetView (QTModelManager *model_manager)
 Constructs a DatasetView with the given model manager.
void addCustomDockWidget (QCustomDockWidget *widget)
 Adds a widget to be docked in the default location when a project has been loaded.
void backButtonPressedSignal ()
 Emitted when the back button is pressed.
File cacheLocation (StringView dataset) const
 Returns the local cache file location for a given dataset.
virtual ContainerWidgetBasecontainer () const override
 Returns the base container widget for layout management.
void downloadDataset (const StringView &dataset, bool force_download)
 Downloads a dataset from the specified source.
DropArea dropArea () const
 Returns the drop area configuration for this widget.
Buffer< ModelloadFile (const File &f)
 Loads a file into the scene and returns the resulting models.
void makeReadOnly (bool read_only)
 Sets the view to read-only mode, disabling editing operations.
DockWidget< MeasurementCommandsWidget > * measurementDock ()
 Returns the measurement commands dock widget.
void onDownloadedSignal (File f)
 Emitted when a dataset has been downloaded successfully.
void onSelected (const UUID &id)
 Handles selection of a design object by its UUID.
DockWidget< DownloadDatasetWidget > * progressDock ()
 Returns the download progress dock widget.
DockWidget< AutoModelFileDialog > * saveDialog ()
 Returns the save/export dialog dock widget.
DockWidget< SceneTreeWidget > * sceneTree ()
 Returns the scene tree dock widget.
void setBackButtonVisible (bool visible)
 Sets whether the back navigation button is visible.
void setMeasurementVisible (bool visible)
 Sets whether the measurement tools panel is visible.
void setSaveButtonVisible (bool visible)
 Sets whether the save/export button is visible.
void setTreeButtonVisible (bool visible)
 Sets whether the scene tree toggle button is visible.
void showMainScreen ()
 Shows the main screen layout with the 3D view and associated panels.
void showNon3DData (const File &f)
 Displays non-3D data (e.g., images or documents) from the given file.
DockWidget< CameraView > * view ()
 Returns the 3D camera view dock widget.
Public Member Functions inherited from ContainerWidget
 ContainerWidget (QWidget *parent=nullptr)
 Constructs a ContainerWidget with the given parent widget.
void clearAllSectionContent () override
 Removes all section content from this container, including floating widgets.
void setShouldAnimateAdd (bool animate) override
 Sets whether adding new section content should be animated.
void setTabLock (bool tab_lock)
 Locks or unlocks tab movement for all section widgets in this container.
Public Member Functions inherited from ContainerWidgetBase
 ContainerWidgetBase (QWidget *parent=nullptr)
 Constructs a ContainerWidgetBase with the given parent widget.
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.
Public Member Functions inherited from PopupManager
 PopupManager ()
 Constructs a PopupManager.
virtual DropArea defaultDropArea (const QCustomDockWidget *) const
 Returns the default drop area for a dock widget.
virtual SectionWidgetdefaultDropReference (const QCustomDockWidget *) const
 Returns the default drop reference section for a dock widget.
virtual RibbonArea defaultRibbonArea (const QCustomDockWidget *)
 Returns the default ribbon area for a dock widget.
virtual void hideWidget (QWidget *widget, const PopupInfo &popup_origin)
 Hides a widget that was previously shown as a popup.
void setupAsPopupHandler ()
 Registers this manager as the application's popup handler service.
virtual bool showWidget (QWidget *widget, PopupInfo popup_origin, PopupInfo popup_end)
 Shows a widget as a popup with animation from origin to destination.

Protected Member Functions

void init ()
 Initializes the UI layout, creating dock widgets and buttons.
Protected Member Functions inherited from ContainerWidgetBase
virtual FloatingWidget * addSectionContent (SectionContent *sc)
 Adds section content as a new floating widget.
virtual SectionWidget * addSectionContent (SectionContent *sc, SectionWidget *sw, DropArea area=e_drop_center)
 Adds section content to an existing section widget in the specified drop area.
void beginResetAll ()
 Begins a reset-all operation, saving current state for later restoration.
void bringFloatingWidgetsForward ()
 Brings all floating widgets owned by this container to the front of the window stack.
virtual void clearAllNonFloatingContent ()
 Removes all non-floating section content from this container.
Buffer< SectionContent * > contents () const
 Returns all section contents managed by this container.
DropOverlaydropOverlay ()
 Returns the drop overlay used for drag-and-drop visual feedback.
void endResetAll ()
 Ends a reset-all operation, restoring layout to the saved state.
bool event (QEvent *event) override
 Handles events for this widget, including custom event processing.
bool hasSectionContent (SectionContent *sc)
 Checks whether the given section content exists within this container.
bool hideSectionContent (SectionContent *sc, PopupInfo end=PopupInfo())
 Hides the given section content, optionally with popup animation.
bool isSectionContentVisible (SectionContent *sc)
 Checks whether the given section content is currently visible.
FloatingWidget * makeFloating (SectionContent *sc, bool show, PopupInfo start=PopupInfo(), PopupInfo end=PopupInfo())
 Makes the given section content into a floating widget.
FloatingWidget * makeFullScreen (SectionContent *sc, PopupInfo start=PopupInfo())
 Makes the given section content fullscreen.
QSize minimumSizeHint () const override
 Returns the minimum recommended size for this widget.
QRect outerBottomDropRect () const
 Returns the drop rectangle for the outer bottom area of this container.
QRect outerLeftDropRect () const
 Returns the drop rectangle for the outer left area of this container.
QRect outerRightDropRect () const
 Returns the drop rectangle for the outer right area of this container.
QRect outerTopDropRect () const
 Returns the drop rectangle for the outer top area of this container.
bool popWindowStack ()
 Pops the top item from the fullscreen window stack, restoring the previous state.
bool raiseSectionContent (SectionContent *sc)
 Raises the given section content to the front of its section widget.
void removeFromResetShow (UUID id)
 Removes the given section ID from the list of sections to be shown during reset restoration.
bool removeSectionContent (SectionContent *sc)
 Removes the given section content from this container.
void resizeEvent (QResizeEvent *event) override
 Handles resize events to update internal layout geometry.
void setTabLock (bool tab_lock)
 Locks or unlocks tab movement for all section widgets in this container.
bool showSectionContent (SectionContent *sc, PopupInfo start=PopupInfo(), PopupInfo end=PopupInfo())
 Shows the given section content, optionally with popup animation.
QSize sizeHint () const override
 Returns the recommended size for this widget.
void swapSectionContent (SectionContent *section_a, SectionContent *section_b)
 Swaps the positions of two section contents within the container.
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.
virtual uint04 addWidget (QWidget *w)
 Adds a widget as a new page in the stacked 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.
virtual void moveContent (uint04 from, uint04 to)
 Moves a child widget from one index to another.
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.
virtual void slideInAnimation (enum StackAnimationDirection direction=e_automatic, bool cache_in_image=false)
 Executes the slide animation between the current and next pages.
virtual void slideInAnimation (PopupInfo origin_rect, enum StackAnimationDirection direction=e_automatic, bool cache_in_image=false)
 Executes the slide animation using popup origin information.
virtual void slideInIdx (uint04 idx, enum StackAnimationDirection direction)
 Slides to the page at the given index with the specified direction.
virtual void slideInIdx (uint04 idx, int delay_time=0, enum StackAnimationDirection direction=e_automatic)
 Slides to the page at the given index with animation.
virtual void slideInIdx (uint04 idx, PopupInfo origin_rect, int delay_time=0, enum StackAnimationDirection direction=e_automatic)
 Slides to the page at the given index with animation and popup origin info.
virtual void slideInNext ()
 Slides to the next page with animation.
virtual void slideInPrev ()
 Slides to the previous page with animation.
virtual void slideInWgt (QWidget *widget, enum StackAnimationDirection direction=e_automatic, bool force_slide=false)
 Slides to a specific widget with animation.
virtual void swapIndices (uint04 a, uint04 b)
 Swaps two child widgets at the given indices.
QWidget * widget (uint04 index) const
 Returns the widget at the given index.

Protected Attributes

Buttonm_back_button = nullptr
 Button for back navigation.
DesignObjectDialogLookupm_dialog_lookup = nullptr
 Lookup for design object property dialogs.
bool m_hide_back_button = false
 Whether the back button is hidden.
bool m_hide_export_button = false
 Whether the export/save button is hidden.
bool m_hide_measurement_button = false
 Whether the measurement button is hidden.
bool m_hide_tree_button = false
 Whether the tree toggle button is hidden.
DockWidget< QTImageEditor > * m_image_editor = nullptr
 Dock widget for the image editor.
DockWidget< ImageView > * m_image_view = nullptr
 Dock widget for image viewing.
bool m_is_read_only = false
 Whether the view is in read-only mode.
Buttonm_measurement_button = nullptr
 Button to toggle measurement tools.
DockWidget< MeasurementCommandsWidget > * m_measurement_command_widget = nullptr
 Dock widget for measurement tools.
QTModelManagerm_model_manager = nullptr
 The model manager providing scene data.
DockWidget< DownloadDatasetWidget > * m_progress = nullptr
 Dock widget for download progress.
Buttonm_save_button = nullptr
 Button to open the save/export dialog.
DockWidget< AutoModelFileDialog > * m_save_dialog = nullptr
 Dock widget for save/export dialog.
DockWidget< SceneTreeWidget > * m_scene_tree_dock = nullptr
 Dock widget for the scene tree.
Buttonm_tree_button = nullptr
 Button to toggle the scene tree panel.
DockWidget< CameraView > * m_view = nullptr
 Dock widget for the 3D camera view.
Protected Attributes inherited from ContainerWidgetBase
bool m_animate_add = true
 Whether to animate the addition of new section content.
DropOverlaym_drop_overlay
 The overlay shown during drag-and-drop operations.
Buffer< std::pair< QPointer< QWidget >, Buffer< QPointer< FloatingWidget > > > > m_fullscreen_stack
 Stack of fullscreen states for navigating back.
Buffer< std::pair< QPointer< QWidget >, Buffer< QPointer< FloatingWidget > > > > m_reset_fullscreen_stack
 Saved fullscreen stack for reset restoration.
bool m_reset_is_on_home = false
 Whether the reset state corresponds to the home layout.
Buffer< UUIDm_reset_visible_sections
 UUIDs of sections that should be visible after a reset.
Dictionary< UUID, SectionContent * > m_section_content
 Maps section content UUIDs to their SectionContent pointers.
Dictionary< UUID, SectionWidget * > m_sections
 Maps section UUIDs to their SectionWidget pointers.
Buffer< SharedSectionContentArea * > m_shared_content
 All shared content area splitters in this container.
SectionWidget * m_top_section_widget = nullptr
 The top-level section widget, if any.
SharedSectionContentArea * m_top_splitter = nullptr
 The top-level splitter managing the layout of all sections.
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.
Protected Attributes inherited from PopupManager
Dictionary< QObject *, QPointer< QCustomDockWidget > > m_docks
 Mapping of objects to their associated dock widgets.
PopupWidget * m_popup_widget = nullptr
 The popup widget used for displaying popup content.

Additional Inherited Members

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...
Static Public Attributes inherited from QCustomStackedWidgetBase
static ApplicationOption< sint04default_stack_animation_speed
 Default time in milliseconds to animate a slide transition.

Detailed Description

A relatively lightweight Widget that can be used for an entire application that allows for easy download and display of a dataset.


Author: Tyler Parke

Date: 2023-01-16

Parameters
[in]widget- The widget to be docked

Definition at line 32 of file DatasetView.h.

Constructor & Destructor Documentation

◆ DatasetView()

DatasetView::DatasetView ( QTModelManager * model_manager)

Constructs a DatasetView with the given model manager.

Parameters
[in]model_managerThe model manager that provides data and scene context.

Member Function Documentation

◆ addCustomDockWidget()

void DatasetView::addCustomDockWidget ( QCustomDockWidget * widget)

Adds a widget to be docked in the default location when a project has been loaded.


If a project is loaded, dialog will be added and docked immediately

Parameters
[in]widget- The widget to be docked

References QCustomStackedWidgetBase::widget().

◆ cacheLocation()

File DatasetView::cacheLocation ( StringView dataset) const

Returns the local cache file location for a given dataset.

Parameters
[in]datasetThe identifier of the dataset.
Returns
The File path where the dataset is cached locally.

◆ container()

virtual ContainerWidgetBase * DatasetView::container ( ) const
overridevirtual

Returns the base container widget for layout management.

Returns
Pointer to the ContainerWidgetBase.

Reimplemented from PopupManager.

◆ downloadDataset()

void DatasetView::downloadDataset ( const StringView & dataset,
bool force_download )

Downloads a dataset from the specified source.

Parameters
[in]datasetThe identifier or URL of the dataset to download.
[in]force_downloadIf true, re-downloads even if the dataset is already cached.

◆ dropArea()

DropArea DatasetView::dropArea ( ) const

Returns the drop area configuration for this widget.

Returns
The DropArea describing where content can be dropped.

◆ loadFile()

Buffer< Model > DatasetView::loadFile ( const File & f)

Loads a file into the scene and returns the resulting models.

Parameters
[in]fThe file to load.
Returns
A buffer of Model objects created from the file.

◆ makeReadOnly()

void DatasetView::makeReadOnly ( bool read_only)

Sets the view to read-only mode, disabling editing operations.

Parameters
[in]read_onlyTrue to make the view read-only, false to allow editing.

◆ measurementDock()

DockWidget< MeasurementCommandsWidget > * DatasetView::measurementDock ( )

Returns the measurement commands dock widget.

Returns
Pointer to the measurement commands dock widget.

◆ onDownloadedSignal()

void DatasetView::onDownloadedSignal ( File f)

Emitted when a dataset has been downloaded successfully.

Parameters
[in]fThe file that was downloaded.

◆ onSelected()

void DatasetView::onSelected ( const UUID & id)

Handles selection of a design object by its UUID.

Parameters
[in]idThe UUID of the selected object.

◆ progressDock()

DockWidget< DownloadDatasetWidget > * DatasetView::progressDock ( )

Returns the download progress dock widget.

Returns
Pointer to the download progress dock widget.

◆ saveDialog()

DockWidget< AutoModelFileDialog > * DatasetView::saveDialog ( )

Returns the save/export dialog dock widget.

Returns
Pointer to the save dialog dock widget.

◆ sceneTree()

DockWidget< SceneTreeWidget > * DatasetView::sceneTree ( )

Returns the scene tree dock widget.

Returns
Pointer to the scene tree dock widget.

◆ setBackButtonVisible()

void DatasetView::setBackButtonVisible ( bool visible)

Sets whether the back navigation button is visible.

Parameters
[in]visibleTrue to show the button, false to hide it.

◆ setMeasurementVisible()

void DatasetView::setMeasurementVisible ( bool visible)

Sets whether the measurement tools panel is visible.

Parameters
[in]visibleTrue to show the panel, false to hide it.

◆ setSaveButtonVisible()

void DatasetView::setSaveButtonVisible ( bool visible)

Sets whether the save/export button is visible.

Parameters
[in]visibleTrue to show the button, false to hide it.

◆ setTreeButtonVisible()

void DatasetView::setTreeButtonVisible ( bool visible)

Sets whether the scene tree toggle button is visible.

Parameters
[in]visibleTrue to show the button, false to hide it.

◆ showNon3DData()

void DatasetView::showNon3DData ( const File & f)

Displays non-3D data (e.g., images or documents) from the given file.

Parameters
[in]fThe file containing non-3D data to display.

◆ view()

DockWidget< CameraView > * DatasetView::view ( )

Returns the 3D camera view dock widget.

Returns
Pointer to the camera view dock widget.

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