A widget for displaying and interacting with three dimensional objects.
Inherits :
DAZ Script | |
---|---|
FloorStyle | { NoFloor, WireFloor, SolidFloor } |
ShadeStyle | { WireBox, SolidBox, Wireframe, LitWireframe, HiddenLine, WireShaded, SmoothShaded, WireTextured, Textured } |
ToolBarMode | { DockedToolBar, CameraCubeHUD } |
void | activeCameraChanged ( DzCamera cam ) |
void | activeCameraProjectionChanged () |
void | activeCameraTransformChanged () |
void | aspectOnChanged ( Boolean onOff ) |
void | axesOnChanged ( Boolean onOff ) |
void | backgroundColorChanged ( Color color ) |
void | contextMenuAboutToShow ( DzMenu menu, Point pos ) |
void | currentDimensionsChanged () |
void | dimensionsChanged () |
void | drawStyleChanged ( DzDrawStyle style ) |
void | floorStyleChanged ( FloorStyle style ) |
void | thirdsGuideOnChanged ( Boolean onOff ) |
void | toolBarDocked ( Boolean onOff ) |
void | toolModeChanged ( ToolBarMode mode ) |
void | viewChanged () |
A Dz3DViewport is a widget for displaying three dimensional objects using OpenGL and interacting with those objects using DzViewTool subclasses.
See Also:
The styles of the floor that is drawn in the viewport.
—–
A list of shading styles for rendering scene objects in OpenGL. These coincide with the ShadeStyle types in DzDrawStyle, and are provided here for script-ability.
—–
The different toolbar modes for the interface.
Holds whether or not the aspect frame is drawn in the viewport.
Holds whether or not the origin axes are drawn in the viewport.
Holds the background color of the viewport
Holds the style of the floor that is drawn in the viewport.
Holds the shading style of the viewport.
Holds whether or not the Pose Tool is shown.
Holds whether or not the thirds guide is drawn in the viewport.
Since:
Holds the mode for the viewport display of toolbars/camera cube
void : aimCamera()
Aim the viewport's active camera at the selected nodes in the scene. If the scene does not have any select nodes, all nodes in the scene are aimed. Note that the viewport's active camera is excluded, as are any nodes that are parented to the viewport's active camera.
See Also:
void : aimCameraAtBox( DzBox3 box )
Aim the viewport's active camera at the given box. If the box is invalid, this function does nothing.
Parameter(s):
See Also:
void : aimCameraAtPrimaryNode()
Aim the viewport's active camera at the selected nodes in the scene. If the scene does not have any select nodes, all nodes in the scene are aimed. Note that the viewport's active camera is excluded, as are any nodes that are parented to the viewport's active camera.
Image : captureImage()
Captures the current contents from the OpenGL frame buffer as an image.
Return Value:
Example:
// If there is a main window if( MainWindow ){ // Get the active viewport var oViewportMgr = MainWindow.getViewportMgr(); var oViewport = oViewportMgr.getActiveViewport().get3DViewport(); // Capture the contents of the active viewport var oImg = oViewport.captureImage(); // Get the image manager var oImgMgr = App.getImageMgr(); // Save the image to a file oImgMgr.saveImage( String( "%1/viewport.png" ).arg( App.getDocumentsPath()) , oImg ); }
Return Value:
Since:
void : endNavigation()
Stops any camera operations that are currently active.
Since:
void : frameCamera()
Frame the viewport's active camera at the selected nodes in the scene. If the scene does not have any select nodes, all nodes in the scene are framed. Note that the viewport's active camera is excluded, as are any nodes that are parented to the viewport's active camera.
See Also:
void : frameCameraOnBox( DzBox3 box )
Frame the viewport's active camera at the given box. If the box is invalid this function does nothing.
Parameter(s):
See Also:
void : frameCameraOnSelectedNodes()
Frame the viewport's active camera at the selected nodes in the scene. If the scene does not have any select nodes, all nodes in the scene are framed. Note that the viewport's active camera is excluded, as are any nodes that are parented to the viewport's active camera.
Return Value:
Return Value:
Example:
// Get the active viewport var oViewportMgr = MainWindow.getViewportMgr(); var oViewport = oViewportMgr.getActiveViewport().get3DViewport(); // Get the active camera var oCamera = oViewport.getCamera(); // Reset the camera oCamera.reset();
See Also:
cameracube_dz : getCameraCube()
Return Value:
Since:
Return Value:
Since:
Return Value:
Since:
Return Value:
Boolean : hardwareRender( DzRenderHandler handler )
Performs a hardware assisted OpenGL render in this viewport with the given settings.
Parameter(s):
Return Value:
true
if the scene was rendered successfully, otherwise false
.Boolean : hardwareRenderWithOptions( DzRenderHandler handler, DzRenderOptions options, DzCamera camera=null, DzDrawStyle style=null )
Performs a hardware assisted OpenGL render in this viewport with the given settings.
Parameter(s):
Return Value:
true
if the scene was rendered successfully, otherwise false
.Since:
Boolean : isHardwareRenderable()
Return Value:
true
if this viewport supports rendering via OpenGL, otherwise false
.Boolean : isNavigating()
Return Value:
true
if a mouse operation is active, otherwise false
.Since:
Number : pickOnFacet( Point pnt )
Performs a facet picking operation on the scene through this viewport.
Parameter(s):
Return Value:
Number : pickOnGizmo( Point pnt )
Performs a gizmo picking operation through this viewport. View tools (see DzViewTool) can draw a 'gizmo' in the viewport for the user to interact with. The tool can assign different parts of the gizmo to specific indices, so as to tell what part of the gizmo was clicked by the user.
Parameter(s):
Return Value:
DzMaterial : pickOnMaterial( Point pnt )
Performs a material picking operation on the scene through this viewport. This example shows the mousePress() implementation from a view tool (see DzViewTool) that sets the color of any material that the user clicks in the viewport.
Parameter(s):
Return Value:
DzNode : pickOnNode( Point pnt )
Performs a node picking operation on the scene through this viewport.
Parameter(s):
Return Value:
DzNode : pickOnNode( Point pnt, Boolean useSelectionMaps )
Performs a node picking operation on the scene through this viewport.
Parameter(s):
true
, selection maps are used to perform the picking operation.Return Value:
Boolean : renderThumbnail( DzRenderHandler handler )
Performs a quick render of the scene suitable for a thumbnail image.
Parameter(s):
Return Value:
true
if the scene was successfully rendered, otherwise false
.void : resetCamera()
Resets the viewport's active camera to its default state.
See Also:
void : setCamera( String cam )
Set the camera for the view. If a matching camera is not found, this function does nothing.
Parameter(s):
void : setCamera( DzCamera cam )
Set the camera for the view. The camera passed in must be a camera in the scene, or one of the view cameras from DzViewportMgr.
Parameter(s):
Example:
// Get the active viewport var oViewportMgr = MainWindow.getViewportMgr(); var oViewport = oViewportMgr.getActiveViewport().get3DViewport(); // Create a new camera var oCam = new DzBasicCamera( oCam.GENERAL_CAMERA ); oCam.setName( "Test Camera" ); // Add the camera to the scene Scene.addNode( oCam ); // Set the active viewport to view through the new camera oViewport.setCamera( oCam );
See Also:
void : setDrawStyle( DzDrawStyle style )
Set the draw style for the viewport. DzDrawStyle objects are ref counted, so the viewport refs the style when it is set, and unrefs it when it is no longer using the style. The draw style will then delete itself when its ref count reaches zero.
Parameter(s):
See Also:
Boolean : setUserDrawStyle( String description )
Attempts to set the DrawStyle for the viewport.
Parameter(s):
Return Value:
Since:
Boolean : mouseIsDown()
Deprecated
Exists only to keep old code working. Do not use in new code. Use isNavigating() instead.
Since:
void : activeCameraChanged( DzCamera cam )
Signature:“activeCameraChanged(DzCamera*)”
Emitted when a new active camera has been changed for this viewport.
Parameter(s):
void : activeCameraProjectionChanged()
Signature:“activeCameraProjectionChanged()”
Emitted when the projection of the active camera of this viewport has changed.
void : activeCameraTransformChanged()
Signature:“activeCameraTransformChanged()”
Emitted when the transform of the active camera of this viewport has changed.
void : aspectOnChanged( Boolean onOff )
Signature:“aspectOnChanged(bool)”
Emitted when the draw state for the aspect frame changes.
Parameter(s):
true
if the aspect frame is displayed, otherwise false
.void : axesOnChanged( Boolean onOff )
Signature:“axesOnChanged(bool)”
Emitted when the draw state for the origin axes changes.
Parameter(s):
true
if the origin axis is displayed, otherwise false
.void : backgroundColorChanged( Color color )
Signature:“backgroundColorChanged(const QColor&)”
Emitted when the background color of the viewport changes.
Parameter(s):
void : contextMenuAboutToShow( DzMenu menu, Point pos )
Signature:“contextMenuAboutToShow(DzMenu*,QPoint)”
Emitted when the viewport is about to display a context menu. Other objects can connect to this signal to add custom items to the menu that is displayed to the user. Only connect to this signal if you only want to affect this particular viewport - otherwise connect to DzViewportMgr::contextMenuAboutToShow().
Parameter(s):
void : currentDimensionsChanged()
Signature:“currentDimensionsChanged()”
Emitted when the current dimensions of this viewport has changed.
void : dimensionsChanged()
Signature:“dimensionsChanged()”
Emitted when the dimensions of this viewport has changed.
void : drawStyleChanged( DzDrawStyle style )
Signature:“drawStyleChanged(DzDrawStyle*)”
Emitted when the draw style of the viewport has changed.
Parameter(s):
void : floorStyleChanged( FloorStyle style )
Signature:“floorStyleChanged(FloorStyle)”
Emitted when the floor style of the viewport changes.
Parameter(s):
void : thirdsGuideOnChanged( Boolean onOff )
Signature:“thirdsGuideOnChanged(bool)”
Emitted when the draw state for the thirds guide changes.
Parameter(s):
true
if the thirds guide is displayed, otherwise false
.void : toolBarDocked( Boolean onOff )
Signature:“toolBarDocked(bool)”
Emitted when the view tool bar is docked or undocked.
Parameter(s):
true
if the view tool bar is docked, otherwise false
.void : toolModeChanged( ToolBarMode mode )
Signature:“toolModeChanged(ToolBarMode)”
Emitted when the toolbar mode has been changed for this viewport.
Parameter(s):
void : viewChanged()
Signature:“viewChanged()”
Emitted when the area this viewport displays has changed.