NDEVR
API Documentation
VirtualCameraView

A Viewport for rendering 3D objects in the scene with the NDEVR Graphics Engine. More...

Collaboration diagram for VirtualCameraView:
[legend]

Public Member Functions

 VirtualCameraView (QTGraphicsWidget *widget, const DynamicPointer< Camera > &camera, QTModelManager *model_manager, QWidget *parent=nullptr)
 Constructs a camera view with a specific camera and model manager.
 VirtualCameraView (QTGraphicsWidget *widget, QWidget *parent=nullptr)
 Constructs a camera view without an initial camera.
 ~VirtualCameraView ()
 Destructor.
void addContextCustomMenu (const UUID &id, ContextMenuCallback *callback) override
 Adds a custom context menu callback for this view.
virtual void addWidget (const QPointer< QWidget > &widget) override
 Adds an overlay widget to the view.
virtual ConstPointer< Cameracamera () const override
 Returns the camera (const).
virtual DynamicPointer< Cameracamera () override
 Returns the camera.
QWidget * cameraToolbar () override
 Returns the camera toolbar widget.
void dragEnterEvent (QDragEnterEvent *event) override
 Handles drag-enter events for file drop support.
void dropEvent (QDropEvent *event) override
 Handles drop events for file import.
bool event (QEvent *e) override
 Handles events for the view.
String getCursorID () const
 Returns the current cursor identifier string.
QTGraphicsWindowgraphicsWindow () const
 Returns the underlying graphics window.
UUID id () const override
 Returns the UUID of this view.
virtual void removeWidget (const QPointer< QWidget > &widget) override
 Removes an overlay widget from the view.
void requestShowInfoDisplay (bool should_show) override
 Requests showing or hiding the info display overlay.
void resetToolRibbon () override
 Resets the tool ribbon to its default state.
QImage screenshot ()
 Captures the current view as a QImage.
void screenshotToClipboard (bool include_background)
 Copies a screenshot to the clipboard.
void screenshotToPrint (uint04 index=Constant< uint04 >::Invalid)
 Sends a screenshot to the printer.
void setCamera (const DynamicPointer< Camera > &camera)
 Sets the camera for this view.
void setModelManager (QTModelManager *manager)
 Sets the model manager.
void setSwapMode (SwapMode mode) override
 Sets the swap chain presentation mode.
void setTouchTheme (bool touch_theme) override
 Switches the UI to touch-optimized or desktop theme.
void setupRulers ()
 Sets up the edge and top rulers.
void showToolRibbon (bool visible) override
 Shows or hides the tool ribbon.
void toPDF (const File &pdf_file)
 Exports the view to a PDF file.
void updateView () override
 Updates the view state from the camera and scene.

Protected Member Functions

void editOverrideMaterial ()
 Opens the override material editor.
void init ()
 Initializes the view layout, toolbar, and signal connections.
void onMaterialDeleted (UUID material)
 Handles deletion of the override material.
void removeOverrideMaterial ()
 Removes the current override material.
void requestCameraLink (bool selected)
 Handles a camera link request from the toolbar.
void showContextMenu (const QPoint &pos)
 Shows the right-click context menu.
void updateCursor ()
 Updates the mouse cursor from the current controller state.

Protected Attributes

CameraToolbarm_camera_toolbar
 The camera control toolbar.
QTResourceListenerm_cursor_listener
 Listener for cursor changes.
Dictionary< UUID, ContextMenuCallback * > m_custom_context_callbacks
 Custom context menu callbacks.
QTGraphicsWidgetm_graphics_widget
 The graphics widget container.
QTGraphicsWindowm_graphics_window
 The underlying graphics window.
QMenu * m_menu = nullptr
 The right-click context menu.
QTModelManagerm_model_manager
 The model manager.
QTResourceListenerm_orientation_listener
 Listener for orientation changes.
QTResourceListenerm_orthograhic_listener
 Listener for orthographic mode changes.
Buttonm_ruler_button
 Button toggling ruler visibility.
CameraRulerMenum_ruler_combo
 Ruler configuration menu.
QTResourceListenerm_selection_info_listener
 Listener for selection info changes.
bool m_should_show_info = true
 Whether the info display overlay is shown.
bool m_show_edge_ruler_ortho
 Whether edge ruler is shown in orthographic mode.
bool m_show_edge_ruler_perspective
 Whether edge ruler is shown in perspective mode.
bool m_show_toolbar
 Whether the camera toolbar is visible.
bool m_show_top_ruler_ortho
 Whether top ruler is shown in orthographic mode.
bool m_show_top_ruler_perspective
 Whether top ruler is shown in perspective mode.
Rulerm_side_ruler
 Side (vertical) ruler widget.
Rulerm_top_ruler
 Top (horizontal) ruler widget.
bool m_touch_theme
 Whether touch-optimized theme is active.

Detailed Description

A Viewport for rendering 3D objects in the scene with the NDEVR Graphics Engine.


Users interact with this view via the ContextMenuCallback and MouseController. A QTGraphicsWindow renders the content.

Definition at line 65 of file VirtualCameraView.h.

Constructor & Destructor Documentation

◆ VirtualCameraView() [1/2]

VirtualCameraView::VirtualCameraView ( QTGraphicsWidget * widget,
const DynamicPointer< Camera > & camera,
QTModelManager * model_manager,
QWidget * parent = nullptr )

Constructs a camera view with a specific camera and model manager.

Parameters
[in]widgetThe graphics widget providing the render surface.
[in]cameraThe camera to render.
[in]model_managerThe model manager.
[in]parentOptional parent widget.

References camera().

◆ VirtualCameraView() [2/2]

VirtualCameraView::VirtualCameraView ( QTGraphicsWidget * widget,
QWidget * parent = nullptr )

Constructs a camera view without an initial camera.

Parameters
[in]widgetThe graphics widget.
[in]parentOptional parent widget.

Member Function Documentation

◆ addContextCustomMenu()

void VirtualCameraView::addContextCustomMenu ( const UUID & id,
ContextMenuCallback * callback )
override

Adds a custom context menu callback for this view.

Parameters
[in]idThe callback identifier.
[in]callbackThe context menu callback.

◆ addWidget()

virtual void VirtualCameraView::addWidget ( const QPointer< QWidget > & widget)
overridevirtual

Adds an overlay widget to the view.

Parameters
[in]widgetThe widget to add.

◆ camera() [1/2]

virtual ConstPointer< Camera > VirtualCameraView::camera ( ) const
overridevirtual

Returns the camera (const).

Returns
Const pointer to the camera.

Referenced by VirtualCameraView(), and setCamera().

◆ camera() [2/2]

virtual DynamicPointer< Camera > VirtualCameraView::camera ( )
overridevirtual

Returns the camera.

Returns
Pointer to the camera.

◆ cameraToolbar()

QWidget * VirtualCameraView::cameraToolbar ( )
override

Returns the camera toolbar widget.

Returns
The toolbar widget.

◆ dragEnterEvent()

void VirtualCameraView::dragEnterEvent ( QDragEnterEvent * event)
override

Handles drag-enter events for file drop support.

Parameters
[in]eventThe drag-enter event.

References event().

◆ dropEvent()

void VirtualCameraView::dropEvent ( QDropEvent * event)
override

Handles drop events for file import.

Parameters
[in]eventThe drop event.

References event().

◆ event()

bool VirtualCameraView::event ( QEvent * e)
override

Handles events for the view.

Parameters
[in]eThe event.
Returns
True if handled.

Referenced by dragEnterEvent(), and dropEvent().

◆ getCursorID()

String VirtualCameraView::getCursorID ( ) const

Returns the current cursor identifier string.

Returns
The cursor ID.

◆ graphicsWindow()

QTGraphicsWindow * VirtualCameraView::graphicsWindow ( ) const
inline

Returns the underlying graphics window.

Returns
The graphics window pointer.

Definition at line 100 of file VirtualCameraView.h.

References m_graphics_window.

◆ id()

UUID VirtualCameraView::id ( ) const
override

Returns the UUID of this view.

Returns
The view UUID.

◆ onMaterialDeleted()

void VirtualCameraView::onMaterialDeleted ( UUID material)
protected

Handles deletion of the override material.

Parameters
[in]materialThe deleted material UUID.

◆ removeWidget()

virtual void VirtualCameraView::removeWidget ( const QPointer< QWidget > & widget)
overridevirtual

Removes an overlay widget from the view.

Parameters
[in]widgetThe widget to remove.

◆ requestCameraLink()

void VirtualCameraView::requestCameraLink ( bool selected)
protected

Handles a camera link request from the toolbar.

Parameters
[in]selectedWhether the link is selected.

◆ requestShowInfoDisplay()

void VirtualCameraView::requestShowInfoDisplay ( bool should_show)
override

Requests showing or hiding the info display overlay.

Parameters
[in]should_showWhether to show the display.

◆ screenshot()

QImage VirtualCameraView::screenshot ( )

Captures the current view as a QImage.

Returns
The captured image.

◆ screenshotToClipboard()

void VirtualCameraView::screenshotToClipboard ( bool include_background)

Copies a screenshot to the clipboard.

Parameters
[in]include_backgroundWhether to include the background.

◆ screenshotToPrint()

void VirtualCameraView::screenshotToPrint ( uint04 index = Constantuint04 >::Invalid)

Sends a screenshot to the printer.

Parameters
[in]indexOptional printer index.

◆ setCamera()

void VirtualCameraView::setCamera ( const DynamicPointer< Camera > & camera)

Sets the camera for this view.

Parameters
[in]cameraThe camera pointer.

References camera().

Referenced by GLESCameraViewFactory::createView().

◆ setModelManager()

void VirtualCameraView::setModelManager ( QTModelManager * manager)

Sets the model manager.

Parameters
[in]managerThe model manager.

Referenced by GLESCameraViewFactory::createView().

◆ setSwapMode()

void VirtualCameraView::setSwapMode ( SwapMode mode)
override

Sets the swap chain presentation mode.

Parameters
[in]modeThe swap mode.

◆ setTouchTheme()

void VirtualCameraView::setTouchTheme ( bool touch_theme)
override

Switches the UI to touch-optimized or desktop theme.

Parameters
[in]touch_themeWhether to use touch theme.

◆ showContextMenu()

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

Shows the right-click context menu.

Parameters
[in]posThe screen position.

◆ showToolRibbon()

void VirtualCameraView::showToolRibbon ( bool visible)
override

Shows or hides the tool ribbon.

Parameters
[in]visibleWhether to show the ribbon.

◆ toPDF()

void VirtualCameraView::toPDF ( const File & pdf_file)

Exports the view to a PDF file.

Parameters
[in]pdf_fileThe output file path.

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