Manager responsible for viewports and tools that operate within them.
Inherits :
DAZ Script | |
---|---|
Number | getNumUserDrawStyles () |
Number | getNumViews () |
DzUserDrawStyle | getUserDrawStyle ( Number i ) |
DzView | getView ( Number i ) |
String | getViewDescription ( Number i ) |
void | accelChanged ( ViewOperation operation, ViewMouseBtnAccelerator accel ) |
void | acceleratorsChanged () |
void | acitve3DViewCurrentDimensionsChanged () |
void | activeToolDrawnDataChanged () |
void | activeToolSwitched () |
void | activeViewResized () |
void | activeViewSwitched () |
void | contextMenuAboutToShow ( DzMenu menu, Dz3DViewport view, Point pos ) |
void | drawElementsListChanged () |
void | graftDrawingChanged () |
void | invertMouseWheelChanged ( Boolean onOff ) |
void | manipFinished () |
void | manipStarted () |
void | manipulationBindingChanged ( Boolean onOff ) |
void | mouseDragScalarChanged ( Number scalar ) |
void | mouseWheelScalarChanged ( Number scalar ) |
void | nodeClickModeChanged ( Number mode ) |
void | propagateBackgroundColorChanged ( Boolean onOff ) |
void | quickDrawModeChanged ( QDMode mode ) |
void | redrawsLocked ( Boolean onOff ) |
void | regionClickModeChanged ( Number mode ) |
void | subDManipulationChanged ( Boolean onOff ) |
void | toolListChanged () |
void | viewLayoutChanged () |
void | viewportCameraListChanged () |
Responsible for the management of viewports, general options related to how viewports (or the items within them) are drawn or operated on, and the tools that operate within the context of a viewport.
There is only one instance of this manager in an application. This instance is created and owned by DzMainWindow. Request the instance via DzMainWindow::getViewportMgr().
See Also:
The possible viewport layout configurations.
—–
The possible node click modes.
—–
The possible modes to switch to in order to improve the speed of viewport drawing operations while an object in the scene is being actively manipulated.
—–
The possible region click modes.
—–
The possible accelerators (keyboard and mouse button combinations) for manipulating the view.
—–
The possible keyboard modifiers for manipulating the view with the mouse.
—–
The possible operations to perform on the active viewport.
Number : getNumUserDrawStyles()
Return Value:
Number : getNumViews()
Return Value:
DzUserDrawStyle : getUserDrawStyle( Number i )
Parameter(s):
Return Value:
Parameter(s):
Return Value:
String : getViewDescription( Number i )
Parameter(s):
Return Value:
void : activateNextTool()
Sets the next tool in the list after the currently active tool to be the currently active tool.
void : activatePrevTool()
Sets the tool in the list before the currently active tool to be the currently active tool.
void : applyStyleColors()
Causes the color of each viewport to be set to their respective values, if the color is defined in the current style.
void : clearOverrideTool()
Clears any view tool that was temporarily overriding the active view tool.
Since:
DzViewTool : findTool( String className )
Parameter(s):
Return Value:
DzUserDrawStyle : findUserDrawStyle( String description )
Parameter(s):
Return Value:
Return Value:
DzViewport : getActiveViewport()
Return Value:
DzViewport : getCustomViewport( Number i )
Return Value:
Since:
DzViewport : getDefaultViewport( Number i )
Return Value:
Since:
Array : getDrawSettingsElementList()
Return Value:
Since:
Boolean : getInvertMouseWheel()
Return Value:
true
if mouse wheel response in the viewports is currently inverted, otherwise false
.Return Value:
ViewMouseBtnAccelerator : getMouseBtnAccelerator( ViewOperation operation )
Parameter(s):
Return Value:
ViewMouseBtnAccelerator : getMouseBtnAccelerator( Qt::MouseButton button, Qt::KeyboardModifiers modifiers )
Parameter(s):
Return Value:
ViewMouseBtnAccelerator : getMouseBtnAccelerator( Number mouseBtn, Boolean ctrl, Boolean alt, Boolean shift )
Parameter(s):
0
, the left mouse button. If 1
, the middle mouse button. If 2
, the right mouse button.true
, the Ctrl key will be included.true
, the Alt key will be included.true
, the Shift key will be included.Return Value:
ViewMouseBtnAccelerator : getMouseBtnAccelerator( String str )
Parameter(s):
Return Value:
String : getMouseBtnAcceleratorString( ViewMouseBtnAccelerator accel )
Parameter(s):
Return Value:
String : getMouseBtnAcceleratorString( ViewOperation operation )
Parameter(s):
Return Value:
Return Value:
Since:
ViewMouseModifier : getMouseModifier( String str )
Parameter(s):
Return Value:
ViewMouseModifier : getMouseModifier( Qt::KeyboardModifiers modifiers )
Parameter(s):
Return Value:
ViewMouseModifier : getMouseModifier( Boolean ctrl, Boolean alt, Boolean shift )
Parameter(s):
true
, the Ctrl key will be included.true
, the Alt key will be included.true
, the Shift key will be included.Return Value:
String : getMouseModifierString( ViewMouseModifier accel )
Parameter(s):
Return Value:
Number : getMouseWheelScalar()
Return Value:
Since:
Return Value:
Number : getNumCustomViewports()
Return Value:
Since:
Number : getNumDefaultViewports()
Return Value:
Since:
Number : getNumTools()
Return Value:
Return Value:
Return Value:
Number : getNumVisibleCustomViewports()
Return Value:
Since:
Number : getNumVisibleDefaultViewports()
Return Value:
Since:
Number : getNumVisibleViewports()
Return Value:
ViewOperation : getOperation( ViewMouseBtnAccelerator accel )
Parameter(s):
Return Value:
DzViewTool : getOverrideTool()
Return Value:
Attention:
Since:
Boolean : getPropagateBackgroundColor()
Return Value:
Return Value:
Since:
Return Value:
DzViewTool : getTool( Number i )
Return Value:
Boolean : getUsePerPixelLighting()
Return Value:
true
if illumination calculations for each pixel in the viewport is enabled, otherwise false
.DzCamera : getViewCamera( DzCamera::CameraType type )
Return Value:
DzCamera : getViewCamera( Number i )
Return Value:
DzViewport : getViewport( Number i )
Return Value:
Attention:
Boolean : isManipulationBindingOn()
Return Value:
true
if manipulation binding will be used on TriAx weighted figures during manipulation, otherwise false
.Since:
Boolean : isSubDManipulationOn()
Return Value:
true
if SubDivision Manipulation is enabled, otherwise false
..Since:
void : repaintActive3DViewport()
A convenience method that forces a repaint of the currently active 3D viewport.
void : resetViewCameras()
Resets all the view cameras to their defaults.
void : setActiveTool( Number i )
Sets the currently active 3D tool.
Parameter(s):
void : setActiveTool( DzViewTool tool )
Sets the currently active 3D tool.
Parameter(s):
void : setActiveViewport( DzViewport activeView )
Set the active DzViewport. The given DzViewport must already be attached as an interface to this Scene.
Parameter(s):
void : setInvertMouseWheel( Boolean onOff )
Sets whether mouse wheel response in the viewports is inverted.
Parameter(s):
true
, the mouse wheel will be inverted in the viewports. If false
, mouse wheel response in the viewports will be standard.void : setLayout( Layout val )
Set the current layout. If we are in single pane mode, the new layout will take effect after single pane mode is switched off.
Parameter(s):
void : setManipulationBindingOn( Boolean onOff )
Sets whether or not manipulation binding will be used on TriAx weighted figures during manipulation.
Parameter(s):
true
, manipulation binding will be used on TriAx weighted figures during manipulation.Since:
void : setMouseBtnAccelerator( ViewOperation operation, ViewMouseBtnAccelerator accel )
Sets the mouse button accelerator for the given view operation.
Parameter(s):
void : setMouseDragScalar( Number val )
Sets the sensitivity of the mouse move response in the viewports.
Parameter(s):
var oMgr = MainWindow.getViewportMgr(); var nOldScalar = oMgr.getMouseDragScalar(); var nNewScalar = Math.max( nOldScalar - 0.05, 0.01 ); oMgr.setMouseDragScalar( nNewScalar ); print( "Old:", nOldScalar, "New:", nNewScalar );
Since:
void : setMouseWheelScalar( Number val )
Sets the sensitivity of the mouse wheel response in the viewports.
Parameter(s):
Since:
void : setNodeClickMode( Number mode )
Set the click mode for node selection tools.
Parameter(s):
void : setOverrideTool( DzViewTool viewTool )
Sets a temporary view tool that overrides the active view tool.
Parameter(s):
Since:
void : setPropagateBackgroundColor( Boolean onOff )
Set whether or not a background color change of a single viewport should be propagated to the other viewports.
Parameter(s):
true
, setting the background color of one veiwport sets the background color for all viewports.void : setQuickDrawMode( QDMode mode )
Sets the current quick draw mode.
Since:
void : setRegionClickMode( Number mode )
Set the click mode for region selection tools.
Parameter(s):
void : setSubDManipulationOn( Boolean onOff )
Sets whether or not SubD models are subdivided during manipulation.
Parameter(s):
true
, SubD models are subdivided during manipulation.Since:
void : setUsePerPixelLighting( Boolean onOff )
Sets whether or not to enable illumination calculations for each pixel in the viewport.
Parameter(s):
true
, per pixel lighting is enabled.void : setViewRatios( Number hSingle, Number h1, Number h2, Number vSingle, Number v1, Number v2 )
Sets the ratios that are used to layout the viewports inside the view area. Each value is a percentage of the available area that will be allocated to the given viewport(s). The values passed in are clamped to valid ranges before applying them. The values should be specified in decimal notation - i.e. 0.0 is 0%, 0.5 is 50%, and 1.0 is 100%. The minimum percentage of the area allocated to any viewport on any axis is 20% (0.2). Therefore, any values that are below this value will be increased to this value, and any values that would result in a remainder less than this value will be decreased.
For example, when the viewports are laid out one right, and on left, there is one vertical division, so the vSingle
value will be used. If the value of vSingle
is 0.6 and the width of the view area is 1000 pixels, then the left view will be (0.6 * 1000) = 600 pixels wide, and the right view will be the remainder (1000 - 600) = 400 pixels wide.
In a more complex example, the viewports are laid out three on top, and one on bottom. There is one horizontal division, so the hSingle
value is used, and two vertical divisions, so the v1
and v2
values are used. The value of hSingle
is 0.35, the value of v1
is 0.3, the value of v2
is 0.5, and the view area is 1000 x 1000 pixels. Then, the top views will be (0.35 * 1000) = 350 pixels high, and the bottom view will be (1000 - 350) = 650 pixels high. The top-left view will be (0.3 * 1000) = 300 pixels wide, the top-center view will be (0.5 * 1000) = 500 pixels wide, and the top-right view will be (1000 - 300 - 500) = 200 pixels wide.
Parameter(s):
Boolean : validateMouseBtnAccelerator( ViewMouseBtnAccelerator accel )
Parameter(s):
Return Value:
true
if accel
is not already assigned, otherwise false
.Boolean : validateMouseWheelAccelerator( ViewMouseModifier accel )
Parameter(s):
Return Value:
true
; currently no wheel events on the viewport to conflict with.void : accelChanged( ViewOperation operation, ViewMouseBtnAccelerator accel )
Signature:“accelChanged(ViewOperation,ViewMouseBtnAccelerator)”
Emitted when an accelerator (keyboard shortcut) for navigating the scene changes.
Parameter(s):
void : acceleratorsChanged()
Signature:“acceleratorsChanged()”
Emitted when an accelerator (keyboard shortcut) for navigating the scene changes.
void : acitve3DViewCurrentDimensionsChanged()
Signature:“acitve3DViewCurrentDimensionsChanged()”
Emitted when the dimensions of the active 3D viewport changes.
void : activeToolDrawnDataChanged()
Signature:“activeToolDrawnDataChanged()”
Emitted when the drawn data for the active tool changes.
void : activeToolSwitched()
Signature:“activeToolSwitched()”
Emitted when the active tool changes.
void : activeViewResized()
Signature:“activeViewResized()”
Emitted when the active view changes size.
void : activeViewSwitched()
Signature:“activeViewSwitched()”
Emitted when the active view changes.
void : contextMenuAboutToShow( DzMenu menu, Dz3DViewport view, Point pos )
Signature:“contextMenuAboutToShow(DzMenu*,Dz3DViewport*,QPoint)”
Emitted when the active 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.
Parameter(s):
void : drawElementsListChanged()
Signature:“drawElementsListChanged()”
Emitted when the list of elements that hold properties for controlling a DrawStyle changes; e.g., when the active DrawStyle changes.
void : graftDrawingChanged()
Signature:“graftDrawingChanged()”
Emitted when the state of whehter or not Geo-Grafted objects are drawn as grafted changes.
void : invertMouseWheelChanged( Boolean onOff )
Signature:“invertMouseWheelChanged(bool)”
Emitted when the state of whether or not to invert the behavior of scrolling the mouse wheel changes.
Parameter(s):
void : manipFinished()
Signature:“manipFinished()”
Emitted when a quick draw operation is finished.
void : manipStarted()
Signature:“manipStarted()”
Emitted when a quick draw operation is started.
void : manipulationBindingChanged( Boolean onOff )
Signature:“manipulationBindingChanged(bool)”
Emitted when the manipulation binding state changes.
Parameter(s):
void : mouseDragScalarChanged( Number scalar )
Signature:“mouseDragScalarChanged(float)”
Emitted when the scalar for mouse movement changes.
Parameter(s):
Since:
void : mouseWheelScalarChanged( Number scalar )
Signature:“mouseWheelScalarChanged(float)”
Emitted when the scalar for the mouse wheel changes.
Parameter(s):
Since:
void : nodeClickModeChanged( Number mode )
Signature:“nodeClickModeChanged(int)”
Emitted when the mode for what happens when a node is clicked changes.
Parameter(s):
void : propagateBackgroundColorChanged( Boolean onOff )
Signature:“propagateBackgroundColorChanged(bool)”
Emitted when whether or not to propagate background color changes has changed.
Parameter(s):
void : quickDrawModeChanged( QDMode mode )
Signature:“quickDrawModeChanged(QDMode)”
Emitted when the quick draw mode changes.
Parameter(s):
void : redrawsLocked( Boolean onOff )
Signature:“redrawsLocked(bool)”
Emitted when the redraw lock state changes.
Parameter(s):
void : regionClickModeChanged( Number mode )
Signature:“regionClickModeChanged(int)”
Emitted when the mode for what happens when a region is clicked changes.
Parameter(s):
void : subDManipulationChanged( Boolean onOff )
Signature:“subDManipulationChanged(bool)”
Emitted when the subD manipulation state changes.
Parameter(s):
void : toolListChanged()
Signature:“toolListChanged()”
Emitted when the tool list changes.
void : viewLayoutChanged()
Signature:“viewLayoutChanged()”
Emitted when the layout of the viewports changes.
void : viewportCameraListChanged()
Signature:“viewportCameraListChanged()”
Emitted when the global list of available cameras changes.