|
Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
Class for rendering interaction handles. More...
#include <Libs/MRML/DisplayableManager/vtkMRMLInteractionWidgetRepresentation.h>


Classes | |
| struct | HandleInfo |
| class | InteractionPipeline |
| struct | RenderState |
Public Types | |
| enum | { InteractionNone , InteractionTranslationHandle , InteractionRotationHandle , InteractionScaleHandle , Interaction_Last } |
| enum | { GlyphArrow , GlyphCircle , GlyphRing , GlyphCrosshair , GlyphArrowOutline , GlyphCircleOutline , GlyphRingOutline , GlyphCrosshairOutline } |
Public Types inherited from vtkMRMLAbstractWidgetRepresentation | |
| typedef vtkProp | Superclass |
| Standard methods for instances of this class. | |
Public Member Functions | |
| virtual void | CanInteract (vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2) |
| virtual int | GetActiveComponentIndex ()=0 |
| virtual int | GetActiveComponentType ()=0 |
| void | GetActors (vtkPropCollection *) override |
| Methods to make this class behave as a vtkProp. | |
| virtual bool | GetApplyScaleToPosition (int type, int index) |
| Get if the view scaling should be applied to the position of the handle. | |
| virtual void | GetHandleColor (int type, int index, double color[4]) |
| virtual int | GetHandleGlyphType (int type, int index) |
| Get the type of glyph (Arrow, Circle, Ring, etc.) of the specified handle. | |
| virtual double | GetHandleOpacity (int type, int index) |
| Get the opacity of the specified handle. | |
| virtual vtkTransform * | GetHandleToWorldTransform () |
| virtual bool | GetHandleVisibility (int type, int index) |
| Get the visibility of the specified handle. | |
| virtual bool | GetInteracting () |
| vtkProp * | GetInteractionActor () |
| virtual void | GetInteractionHandleAxisLocal (int type, int index, double axis[3]) |
| Get the axis for the handle specified by the index in local coordinates. | |
| virtual void | GetInteractionHandleAxisWorld (int type, int index, double axis[3]) |
| Get the axis for the handle specified by the index. | |
| virtual double | GetInteractionHandleOpacity () |
| Get the overall opacity multiplier applied to all interaction handles. Default is 1.0. | |
| virtual void | GetInteractionHandleOriginWorld (double origin[3]) |
| Get the origin of the interaction handle widget. | |
| virtual void | GetInteractionHandlePositionLocal (int type, int index, double position[3]) |
| virtual void | GetInteractionHandlePositionWorld (int type, int index, double position[3]) |
| virtual double | GetMaximumHandlePickingDistance2 () |
| virtual int | GetNumberOfHandles () |
| virtual int | GetNumberOfHandles (int type) |
| virtual vtkPointPlacer * | GetPointPlacer () |
| virtual vtkMRMLSliceNode * | GetSliceNode () |
| virtual void | GetSliceToWorldCoordinates (const double slicePos[2], double worldPos[3]) |
| virtual bool | GetTransformationReferencePoint (double referencePointWorld[3]) |
| Translation, rotation, scaling will happen around this position. | |
| virtual double | GetTranslationScaleFactor () |
| vtkTypeBool | HasTranslucentPolygonalGeometry () override |
| virtual void | InteractingOff () |
| virtual void | InteractingOn () |
| virtual bool | IsDisplayable ()=0 |
| void | ReleaseGraphicsResources (vtkWindow *) override |
| int | RenderOpaqueGeometry (vtkViewport *viewport) override |
| int | RenderOverlay (vtkViewport *viewport) override |
| int | RenderTranslucentPolygonalGeometry (vtkViewport *viewport) override |
| virtual void | SetActiveComponentIndex (int index)=0 |
| virtual void | SetActiveComponentType (int type)=0 |
| virtual void | SetInteracting (bool) |
| void | SetRenderer (vtkRenderer *renderer) override |
| void | UpdateFromMRML (vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override |
| Update the representation from display node. | |
| virtual void | UpdateInteractionPipeline () |
| Update the interaction pipeline. | |
| virtual void | UpdateSlicePlaneFromSliceNode () |
| virtual void | UpdateHandleToWorldTransform () |
| virtual void | UpdateHandleToWorldTransform (vtkTransform *handleToWorldTransform)=0 |
Public Member Functions inherited from vtkMRMLAbstractWidgetRepresentation | |
| virtual void | AlwaysOnTopOff () |
| virtual void | AlwaysOnTopOn () |
| void | GetActors (vtkPropCollection *) override |
| void | GetActors2D (vtkPropCollection *) override |
| virtual bool | GetAlwaysOnTop () |
| virtual double | GetAlwaysOnTopRelativeOffsetFactor () |
| virtual double | GetAlwaysOnTopRelativeOffsetUnits () |
| virtual vtkMRMLApplicationLogic * | GetApplicationLogic () |
| double * | GetBounds () VTK_SIZEHINT(6) override |
| virtual bool | GetNeedToRender () |
| virtual double | GetPickingTolerance () |
| virtual vtkRenderer * | GetRenderer () |
| double | GetScreenScaleFactor () |
| Convenience method for getting screen scale factor from the associated view node. | |
| virtual vtkMRMLAbstractViewNode * | GetViewNode () |
| void | GetVolumes (vtkPropCollection *) override |
| vtkTypeBool | HasTranslucentPolygonalGeometry () override |
| virtual void | NeedToRenderOff () |
| virtual void | NeedToRenderOn () |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| void | ReleaseGraphicsResources (vtkWindow *) override |
| int | RenderOpaqueGeometry (vtkViewport *vtkNotUsed(viewport)) override |
| int | RenderOverlay (vtkViewport *vtkNotUsed(viewport)) override |
| int | RenderTranslucentPolygonalGeometry (vtkViewport *vtkNotUsed(viewport)) override |
| int | RenderVolumetricGeometry (vtkViewport *vtkNotUsed(viewport)) override |
| virtual void | SetAlwaysOnTop (bool) |
| virtual void | SetAlwaysOnTopRelativeOffsetFactor (double) |
| virtual void | SetAlwaysOnTopRelativeOffsetUnits (double) |
| virtual void | SetApplicationLogic (vtkMRMLApplicationLogic *appLogic) |
| virtual void | SetNeedToRender (bool) |
| virtual void | SetPickingTolerance (double) |
| virtual void | SetViewNode (vtkMRMLAbstractViewNode *viewNode) |
Protected Types | |
| typedef std::vector< HandleInfo > | HandleInfoList |
| Get the list of info for all interaction handles. | |
Protected Member Functions | |
| virtual void | CanInteractWithArrowHandle (vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2, HandleInfo &handleInfo) |
| virtual void | CanInteractWithCircleHandle (vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2, HandleInfo &handleInfo) |
| virtual void | CanInteractWithRingHandle (vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2, HandleInfo &handleInfo) |
| virtual void | CreateRotationHandles () |
| virtual void | CreateScaleHandles () |
| virtual void | CreateTranslationHandles () |
| RenderState | GetCurrentRenderState () |
| Get the state that the handle instance arrays would be built for if they were rebuilt now. | |
| virtual HandleInfo | GetHandleInfo (int type, int index) |
| virtual HandleInfoList | GetHandleInfoList () |
| virtual vtkPolyData * | GetHandlePolydata (int type) |
| virtual void | GetHandleToCameraVectorWorld (double handlePosition_World[3], double normal_World[3]) |
| virtual double | GetInteractionScalePercent () |
| virtual bool | GetInteractionSizeAbsolute () |
| virtual double | GetInteractionSizeMm () |
| virtual void | InitializePipeline () |
| virtual void | OrthoganalizeTransform (vtkTransform *transform) |
| Orthogonalize the transform axes. The Z-axis will not be changed. | |
| virtual void | SetupInteractionPipeline () |
| virtual void | SetWidgetScale (double scale) |
| Set the scale of the interaction handles in world coordinates. | |
| virtual void | UpdateActorTransform () |
| virtual void | UpdateCameraState () |
| Cache camera state (direction, position, view up) for use by per-handle computations. | |
| virtual void | UpdateHandleSize () |
| virtual void | UpdateInstanceArrays () |
| bool | UpdatePipelineIfNeeded () |
| virtual void | UpdateViewScaleFactor () |
| Calculate view size and scale factor. | |
| vtkMRMLInteractionWidgetRepresentation () | |
| ~vtkMRMLInteractionWidgetRepresentation () override | |
Protected Member Functions inherited from vtkMRMLAbstractWidgetRepresentation | |
| void | AddActorsBounds (vtkBoundingBox &bounds, const std::vector< vtkProp * > &actors, double *additionalBounds=nullptr) |
| void | GetRendererComputedDisplayPositionFromWorldPosition (const double worldPos[3], double displayPos[2]) |
| virtual void | UpdateRelativeCoincidentTopologyOffsets (vtkMapper *mapper) |
| vtkMRMLAbstractWidgetRepresentation () | |
| ~vtkMRMLAbstractWidgetRepresentation () override | |
Protected Attributes | |
| double | CachedCameraDirection [3] { 0.0, 0.0, 1.0 } |
| double | CachedCameraPosition [3] { 0.0, 0.0, 0.0 } |
| bool | CachedParallelProjection { true } |
| double | CachedViewUp_World [3] { 0.0, 1.0, 0.0 } |
| double | EndFadeAngleDegrees { 8.0 } |
| The angle between the camera and the interaction axis at which point the interaction handle is completely faded out. | |
| bool | HasVisibleHandles { false } |
| bool | Interacting { false } |
| double | InteractionSize { 1.0 } |
| RenderState | LastRenderState |
| InteractionPipeline * | Pipeline |
| vtkSmartPointer< vtkPointPlacer > | PointPlacer |
| double | ScreenSizePixel |
| vtkSmartPointer< vtkPlane > | SlicePlane |
| double | StartFadeAngleDegrees { 10.0 } |
| The angle between the camera and the interaction axis at which point the interaction handle starts to fade out. | |
| double | ViewScaleFactorMmPerPixel |
| double | WidgetScale { 1.0 } |
Protected Attributes inherited from vtkMRMLAbstractWidgetRepresentation | |
| bool | AlwaysOnTop |
| double | AlwaysOnTopRelativeOffsetFactor { 0.0 } |
| Relative offset used for rendering occluded actors. | |
| double | AlwaysOnTopRelativeOffsetUnits { -66000.0 } |
| vtkWeakPointer< vtkMRMLApplicationLogic > | ApplicationLogic |
| double | Bounds [6] |
| Temporary variable to store GetBounds() result. | |
| bool | NeedToRender |
| double | PickingTolerance |
| vtkWeakPointer< vtkRenderer > | Renderer |
| The renderer in which this widget is placed. | |
| vtkWeakPointer< vtkMRMLAbstractViewNode > | ViewNode |
| typedef vtkMRMLAbstractWidgetRepresentation | Superclass |
| virtual const char * | GetClassName () |
| virtual int | IsA (const char *type) |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| static int | IsTypeOf (const char *type) |
| static vtkMRMLInteractionWidgetRepresentation * | SafeDownCast (vtkObject *o) |
| static std::map< vtkRenderer *, std::unique_ptr< SharedHandleRenderer > > | SharedHandleRenderers |
| void | RegisterWithSharedHandleRenderer () |
| void | UnregisterFromSharedHandleRenderer () |
| bool | IsSharedRenderingRepresentation (SharedHandleRenderer *shared) const |
| static SharedHandleRenderer * | GetSharedHandleRenderer (vtkRenderer *renderer, bool create=false) |
| static void | OnSharedRendererStartEvent (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
| static void | OnSharedRendererDelete (vtkObject *caller, unsigned long eid, void *clientData, void *callData) |
| static void | ConfigureHandleInstancePipeline (vtkSmartPointer< vtkPolyData > &instancePolyData, vtkSmartPointer< vtkFloatArray > &orientationArray, vtkSmartPointer< vtkFloatArray > &scaleArray, vtkSmartPointer< vtkIntArray > &sourceIndexArray, vtkSmartPointer< vtkUnsignedCharArray > &colorArray, vtkSmartPointer< vtkGlyph3DMapper > &mapper, vtkSmartPointer< vtkProperty > &property, vtkSmartPointer< vtkActor > &actor) |
| static unsigned char | ColorComponentToUChar (double c) |
Additional Inherited Members | |
Static Public Member Functions inherited from vtkMRMLAbstractWidgetRepresentation | |
| static int | IsTypeOf (const char *type) |
| static vtkMRMLAbstractWidgetRepresentation * | SafeDownCast (vtkObject *o) |
Class for rendering interaction handles.
This class can display interaction handles in the scene. It plays a similar role to vtkWidgetRepresentation, but it is simplified and specialized for optimal use in Slicer. It state is stored in the associated MRML display node to avoid extra synchronization mechanisms. The representation only observes MRML node changes, it does not directly process any interaction events directly (interaction events are processed by vtkMRMLAbstractWidget, which then modifies MRML nodes).
This class (and subclasses) are a type of vtkProp; meaning that they can be associated with a vtkRenderer and embedded in a scene like any other vtkActor.
Definition at line 75 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Get the list of info for all interaction handles.
Definition at line 281 of file vtkMRMLInteractionWidgetRepresentation.h.
Standard VTK class macros.
Definition at line 80 of file vtkMRMLInteractionWidgetRepresentation.h.
| anonymous enum |
| Enumerator | |
|---|---|
| InteractionNone | |
| InteractionTranslationHandle | |
| InteractionRotationHandle | |
| InteractionScaleHandle | |
| Interaction_Last | |
Definition at line 137 of file vtkMRMLInteractionWidgetRepresentation.h.
| anonymous enum |
| Enumerator | |
|---|---|
| GlyphArrow | |
| GlyphCircle | |
| GlyphRing | |
| GlyphCrosshair | |
| GlyphArrowOutline | |
| GlyphCircleOutline | |
| GlyphRingOutline | |
| GlyphCrosshairOutline | |
Definition at line 146 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
|
overrideprotected |
|
virtual |
Return found component type (as vtkMRMLInteractionDisplayNode::ComponentType). closestDistance2 is the squared distance in display coordinates from the closest position where interaction is possible. componentIndex returns index of the found component (e.g., if control point is found then control point index is returned).
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
staticprotected |
|
staticprotected |
|
protectedvirtual |
|
protectedvirtual |
Reimplemented in vtkSlicerMarkupsInteractionWidgetRepresentation.
|
protectedvirtual |
|
pure virtual |
|
pure virtual |
|
override |
Methods to make this class behave as a vtkProp.
|
virtual |
Get if the view scaling should be applied to the position of the handle.
Reimplemented in vtkSlicerMarkupsInteractionWidgetRepresentation.
|
virtual |
Reimplemented from vtkMRMLAbstractWidgetRepresentation.
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
protected |
Get the state that the handle instance arrays would be built for if they were rebuilt now.
|
virtual |
Get the color of the specified handle Type is specified using InteractionType enum
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
virtual |
Get the type of glyph (Arrow, Circle, Ring, etc.) of the specified handle.
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation.
|
protectedvirtual |
|
protectedvirtual |
|
virtual |
Get the opacity of the specified handle.
|
protectedvirtual |
|
protectedvirtual |
Get the vector from the interaction handle to the camera in world coordinates. In slice views and in 3D with parallel projection this is the same as the camera view direction. Uses cached camera state from UpdateCameraState().
|
virtual |
|
virtual |
Get the visibility of the specified handle.
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
virtual |
| vtkProp * vtkMRMLInteractionWidgetRepresentation::GetInteractionActor | ( | ) |
Returns the per-representation actor for the interaction widget. In slice views this is the actor that renders the handles. In 3D views the handles are drawn by a shared per-renderer actor and only this actor's visibility is honored; property, mapper, or transform changes on the returned actor have no effect on the rendered handles.
|
virtual |
Get the axis for the handle specified by the index in local coordinates.
Reimplemented in vtkSlicerMarkupsInteractionWidgetRepresentation.
|
virtual |
Get the axis for the handle specified by the index.
|
virtual |
Get the overall opacity multiplier applied to all interaction handles. Default is 1.0.
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
virtual |
Get the origin of the interaction handle widget.
|
virtual |
Get the position of the interaction handle in local coordinates Type is specified using vtkMRMLInteractionDisplayNode::ComponentType
|
virtual |
Get the position of the interaction handle in world coordinates Type is specified using vtkMRMLInteractionDisplayNode::ComponentType
Reimplemented in vtkSlicerMarkupsInteractionWidgetRepresentation.
|
protectedvirtual |
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
protectedvirtual |
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
protectedvirtual |
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
staticprotected |
|
virtual |
|
virtual |
|
virtual |
Translation, rotation, scaling will happen around this position.
|
virtual |
Get the factor that the translation vector is scaled by during an interactive translate operation. Default is 1.0 (no scaling).
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation.
|
override |
|
protectedvirtual |
|
virtual |
|
virtual |
|
virtual |
Reimplemented from vtkMRMLAbstractWidgetRepresentation.
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
pure virtual |
Returns true if the representation is displayable in the current view. It takes into account current view node's display node and parent folder's visibility.
Implemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
protected |
|
static |
|
staticprotected |
|
staticprotected |
|
protectedvirtual |
Orthogonalize the transform axes. The Z-axis will not be changed.
|
override |
|
protected |
|
override |
|
override |
|
override |
|
override |
|
static |
|
pure virtual |
|
pure virtual |
|
virtual |
|
overridevirtual |
Set the renderer that the representation is displayed in. Unregisters the representation from the renderer that it was previously displayed in, so that its interaction handles are no longer rendered there.
Reimplemented from vtkMRMLAbstractWidgetRepresentation.
|
protectedvirtual |
|
protectedvirtual |
Set the scale of the interaction handles in world coordinates.
|
protected |
|
protectedvirtual |
|
protectedvirtual |
Cache camera state (direction, position, view up) for use by per-handle computations.
|
overridevirtual |
Update the representation from display node.
Reimplemented from vtkMRMLAbstractWidgetRepresentation.
|
protectedvirtual |
|
virtual |
Update HandleToWorldTransform. This controls the position and orientation of the interaction handles.
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
pure virtual |
|
protectedvirtual |
|
virtual |
Update the interaction pipeline.
Reimplemented in vtkMRMLTransformHandleWidgetRepresentation, and vtkSlicerMarkupsInteractionWidgetRepresentation.
|
protected |
Rebuild the handle instance arrays if the state that they were built for has changed. Returns true if the arrays have been rebuilt.
|
virtual |
|
protectedvirtual |
Calculate view size and scale factor.
|
protected |
Definition at line 351 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 350 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 349 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 352 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
The angle between the camera and the interaction axis at which point the interaction handle is completely faded out.
Definition at line 334 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 388 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 390 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Handle size, specified in renderer world coordinate system. For slice views, renderer world coordinate system is the display coordinate system, so it is measured in pixels. For 3D views, renderer world coordinate system is the Slicer world coordinate system, so it is measured in the scene length unit (typically millimeters).
Definition at line 345 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 387 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 395 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 392 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 337 of file vtkMRMLInteractionWidgetRepresentation.h.
|
staticprotected |
Shared handle renderer: in 3D views, all interaction handle instances are rendered by a single shared actor per vtkRenderer (one instanced draw per glyph source instead of one actor per handle). The map is keyed by renderer pointer; entries are created on first use and removed when the last representation unregisters or when the renderer fires DeleteEvent.
Definition at line 402 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 339 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
The angle between the camera and the interaction axis at which point the interaction handle starts to fade out.
Definition at line 332 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 336 of file vtkMRMLInteractionWidgetRepresentation.h.
|
protected |
Definition at line 347 of file vtkMRMLInteractionWidgetRepresentation.h.