Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLTransformHandleWidgetRepresentation Class Reference

Abstract representation for the transform handle widgets. More...

#include <Modules/Loadable/Transforms/MRMLDM/vtkMRMLTransformHandleWidgetRepresentation.h>

Inheritance diagram for vtkMRMLTransformHandleWidgetRepresentation:
Collaboration diagram for vtkMRMLTransformHandleWidgetRepresentation:

Public Types

enum  { HandleIndexX , HandleIndexY , HandleIndexZ , HandleIndexViewPlane }
 
- Public Types inherited from vtkMRMLInteractionWidgetRepresentation
enum  {
  InteractionNone , InteractionTranslationHandle , InteractionRotationHandle , InteractionScaleHandle ,
  Interaction_Last
}
 
enum  { GlyphArrow , GlyphCircle , GlyphRing , GlyphCrosshair }
 
typedef vtkMRMLAbstractWidgetRepresentation Superclass
 
- Public Types inherited from vtkMRMLAbstractWidgetRepresentation
typedef vtkProp Superclass
 Standard methods for instances of this class.
 

Public Member Functions

void CanInteract (vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override
 
virtual int GetActiveComponentIndex () override
 
virtual int GetActiveComponentType () override
 
virtual vtkMRMLTransformDisplayNodeGetDisplayNode ()
 
void GetHandleColor (int type, int index, double color[4]) override
 
int GetHandleGlyphType (int type, int index) override
 
bool GetHandleVisibility (int type, int index) override
 Get the visibility of the specified handle.
 
double GetInteractionHandleOpacity () override
 Get the overall opacity multiplier applied to all interaction handles. Default is 1.0.
 
double GetInteractionScalePercent () override
 Size relative to screen.
 
bool GetInteractionSizeAbsolute () override
 True -> size in mm; false -> relative to screen.
 
double GetInteractionSizeMm () override
 Size in mm.
 
virtual bool GetLastInteractionWasWideHit ()
 
virtual double GetLastSliceWideHitDistance2 ()
 
virtual vtkMRMLTransformNodeGetTransformNode ()
 
double GetTranslationScaleFactor () override
 
bool IsDisplayable () override
 
virtual void SetActiveComponentIndex (int type) override
 
virtual void SetActiveComponentType (int type) override
 
virtual void SetDisplayNode (vtkMRMLTransformDisplayNode *displayNode)
 
virtual void UpdateHandleToWorldTransform ()
 
void UpdateHandleToWorldTransform (vtkTransform *handleToWorldTransform) override
 
void UpdateInteractionPipeline () override
 Update the interaction pipeline.
 
- Public Member Functions inherited from vtkMRMLInteractionWidgetRepresentation
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 double GetHandleOpacity (int type, int index)
 Get the opacity of the specified handle.
 
virtual vtkTransform * GetHandleToWorldTransform ()
 
virtual bool GetInteracting ()
 
vtkProp * GetInteractionActor ()
 Returns the actor for the interaction widget.
 
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 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 vtkMRMLSliceNodeGetSliceNode ()
 
virtual void GetSliceToWorldCoordinates (const double slicePos[2], double worldPos[3])
 
virtual bool GetTransformationReferencePoint (double referencePointWorld[3])
 Translation, rotation, scaling will happen around this position.
 
vtkTypeBool HasTranslucentPolygonalGeometry () override
 
virtual void InteractingOff ()
 
virtual void InteractingOn ()
 
void ReleaseGraphicsResources (vtkWindow *) override
 
int RenderOpaqueGeometry (vtkViewport *viewport) override
 
int RenderOverlay (vtkViewport *viewport) override
 
int RenderTranslucentPolygonalGeometry (vtkViewport *viewport) override
 
virtual void SetInteracting (bool)
 
void UpdateFromMRML (vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
 Update the representation from display node.
 
virtual void UpdateHandlePolyData ()
 
virtual void UpdateSlicePlaneFromSliceNode ()
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
- 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 vtkMRMLApplicationLogicGetApplicationLogic ()
 
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 vtkMRMLAbstractViewNodeGetViewNode ()
 
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 SetRenderer (vtkRenderer *ren)
 
virtual void SetViewNode (vtkMRMLAbstractViewNode *viewNode)
 

Static Public Member Functions

static vtkMRMLTransformHandleWidgetRepresentationNew ()
 Instantiate this class.
 
static int IsTypeOf (const char *type)
 
static vtkMRMLInteractionWidgetRepresentationSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkMRMLAbstractWidgetRepresentation
static int IsTypeOf (const char *type)
 
static vtkMRMLAbstractWidgetRepresentationSafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkMRMLTransformHandleWidgetRepresentation ()
 
 ~vtkMRMLTransformHandleWidgetRepresentation () override
 
- Protected Member Functions inherited from vtkMRMLInteractionWidgetRepresentation
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 ()
 
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 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 UpdateHandleColors ()
 
virtual int UpdateHandleColors (int type, int startIndex)
 
virtual void UpdateHandleOrientation ()
 
virtual void UpdateHandleSize ()
 
virtual void UpdateRotationHandleOrientation ()
 
virtual void UpdateScaleHandleOrientation ()
 
virtual void UpdateTranslationHandleOrientation ()
 
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

vtkSmartPointer< vtkMRMLTransformDisplayNodeDisplayNode
 
bool LastInteractionWasWideHit { false }
 
double LastSliceWideHitDistance2 { 0.0 }
 
- Protected Attributes inherited from vtkMRMLInteractionWidgetRepresentation
double EndFadeAngleDegrees { 8.0 }
 The angle between the camera and the interaction axis at which point the interaction handle is completely faded out.
 
bool Interacting { false }
 
double InteractionSize { 1.0 }
 
InteractionPipelinePipeline
 
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< vtkMRMLApplicationLogicApplicationLogic
 
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< vtkMRMLAbstractViewNodeViewNode
 
typedef vtkMRMLInteractionWidgetRepresentation Superclass
 
static int IsTypeOf (const char *type)
 
static vtkMRMLTransformHandleWidgetRepresentationSafeDownCast (vtkObject *o)
 
virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 

Additional Inherited Members

- Protected Types inherited from vtkMRMLInteractionWidgetRepresentation
typedef std::vector< HandleInfoHandleInfoList
 Get the list of info for all interaction handles.
 

Detailed Description

Abstract representation for the transform handle widgets.

See also
vtkMRMLInteractionWidgetRepresentation

Definition at line 43 of file vtkMRMLTransformHandleWidgetRepresentation.h.

Member Typedef Documentation

◆ Superclass

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Indices used for handle axes within a handle group (rotation, scale, translation). X, Y, Z are the per-axis handles; ViewPlane is the free-movement handle (e.g. used for grabbing the transform anywhere in the slice view, when wide translation is enabled).

Enumerator
HandleIndexX 
HandleIndexY 
HandleIndexZ 
HandleIndexViewPlane 

Definition at line 58 of file vtkMRMLTransformHandleWidgetRepresentation.h.

Constructor & Destructor Documentation

◆ vtkMRMLTransformHandleWidgetRepresentation()

vtkMRMLTransformHandleWidgetRepresentation::vtkMRMLTransformHandleWidgetRepresentation ( )
protected

◆ ~vtkMRMLTransformHandleWidgetRepresentation()

vtkMRMLTransformHandleWidgetRepresentation::~vtkMRMLTransformHandleWidgetRepresentation ( )
overrideprotected

Member Function Documentation

◆ CanInteract()

void vtkMRMLTransformHandleWidgetRepresentation::CanInteract ( vtkMRMLInteractionEventData * interactionEventData,
int & foundComponentType,
int & foundComponentIndex,
double & closestDistance2 )
overridevirtual

In addition to the default handle hit-testing performed by the superclass, when vtkMRMLTransformDisplayNode::GetEditorTranslationSliceAnywhereEnabled() is true, clicking anywhere in a slice view is treated as grabbing the view plane translation handle, so the transform can be dragged from anywhere in the slice view, not just from the small handle at the center of the transform.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ GetActiveComponentIndex()

virtual int vtkMRMLTransformHandleWidgetRepresentation::GetActiveComponentIndex ( )
overridevirtual

◆ GetActiveComponentType()

virtual int vtkMRMLTransformHandleWidgetRepresentation::GetActiveComponentType ( )
overridevirtual

◆ GetClassName()

virtual const char * vtkMRMLTransformHandleWidgetRepresentation::GetClassName ( )
virtual

◆ GetDisplayNode()

virtual vtkMRMLTransformDisplayNode * vtkMRMLTransformHandleWidgetRepresentation::GetDisplayNode ( )
virtual

◆ GetHandleColor()

void vtkMRMLTransformHandleWidgetRepresentation::GetHandleColor ( int type,
int index,
double color[4] )
overridevirtual

Renders the view plane translation handle (whether shown as a circle or as a crosshair, see GetHandleGlyphType()) and the in-plane (view plane) rotation handle in cyan, instead of their default color, so that these "free"/view-plane handles are easy to recognize and tell apart from the axis-constrained (red/green/blue) handles.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ GetHandleGlyphType()

int vtkMRMLTransformHandleWidgetRepresentation::GetHandleGlyphType ( int type,
int index )
overridevirtual

Renders the view plane translation handle as a crosshair (instead of the default filled circle) when vtkMRMLTransformDisplayNode::GetEditorTranslationSliceAnywhereEnabled() is true in a slice view, so that the transform center underneath the handle is not occluded.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ GetHandleVisibility()

bool vtkMRMLTransformHandleWidgetRepresentation::GetHandleVisibility ( int type,
int index )
overridevirtual

Get the visibility of the specified handle.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ GetInteractionHandleOpacity()

double vtkMRMLTransformHandleWidgetRepresentation::GetInteractionHandleOpacity ( )
overridevirtual

Get the overall opacity multiplier applied to all interaction handles. Default is 1.0.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ GetInteractionScalePercent()

double vtkMRMLTransformHandleWidgetRepresentation::GetInteractionScalePercent ( )
overridevirtual

Size relative to screen.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ GetInteractionSizeAbsolute()

bool vtkMRMLTransformHandleWidgetRepresentation::GetInteractionSizeAbsolute ( )
overridevirtual

True -> size in mm; false -> relative to screen.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ GetInteractionSizeMm()

double vtkMRMLTransformHandleWidgetRepresentation::GetInteractionSizeMm ( )
overridevirtual

Size in mm.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ GetLastInteractionWasWideHit()

virtual bool vtkMRMLTransformHandleWidgetRepresentation::GetLastInteractionWasWideHit ( )
virtual

True if the component found by the most recent call to CanInteract() was found using the "wide" hit-test area (clicking anywhere in the slice view) rather than a precise handle grab. Used by vtkMRMLTransformHandleWidget to give the wide hit-test a lower interaction priority.

◆ GetLastSliceWideHitDistance2()

virtual double vtkMRMLTransformHandleWidgetRepresentation::GetLastSliceWideHitDistance2 ( )
virtual

Squared display-coordinate distance between the event position and the transform center, computed by the most recent "wide" hit-test performed by CanInteract(). Used by vtkMRMLTransformHandleWidget so that, when multiple transforms can be dragged from anywhere in the same slice view, the one whose center is closest to the cursor is the one that is picked.

◆ GetTransformNode()

virtual vtkMRMLTransformNode * vtkMRMLTransformHandleWidgetRepresentation::GetTransformNode ( )
virtual

◆ GetTranslationScaleFactor()

double vtkMRMLTransformHandleWidgetRepresentation::GetTranslationScaleFactor ( )
overridevirtual

Scales the translation vector by vtkMRMLTransformDisplayNode::GetEditorTranslationSliceAnywhereSensitivity() when the most recent translate interaction was started from a "wide" hit (see LastInteractionWasWideHit). Otherwise (e.g. dragging the small translation handle itself) no scaling is applied.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ IsA()

virtual int vtkMRMLTransformHandleWidgetRepresentation::IsA ( const char * type)
virtual

◆ IsDisplayable()

bool vtkMRMLTransformHandleWidgetRepresentation::IsDisplayable ( )
overridevirtual

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.

Implements vtkMRMLInteractionWidgetRepresentation.

◆ IsTypeOf()

static int vtkMRMLTransformHandleWidgetRepresentation::IsTypeOf ( const char * type)
static

◆ New()

static vtkMRMLTransformHandleWidgetRepresentation * vtkMRMLTransformHandleWidgetRepresentation::New ( )
static

Instantiate this class.

◆ PrintSelf()

void vtkMRMLTransformHandleWidgetRepresentation::PrintSelf ( ostream & os,
vtkIndent indent )
override

◆ SafeDownCast()

static vtkMRMLTransformHandleWidgetRepresentation * vtkMRMLTransformHandleWidgetRepresentation::SafeDownCast ( vtkObject * o)
static

◆ SetActiveComponentIndex()

virtual void vtkMRMLTransformHandleWidgetRepresentation::SetActiveComponentIndex ( int type)
overridevirtual

◆ SetActiveComponentType()

virtual void vtkMRMLTransformHandleWidgetRepresentation::SetActiveComponentType ( int type)
overridevirtual

◆ SetDisplayNode()

virtual void vtkMRMLTransformHandleWidgetRepresentation::SetDisplayNode ( vtkMRMLTransformDisplayNode * displayNode)
virtual

◆ UpdateHandleToWorldTransform() [1/2]

virtual void vtkMRMLInteractionWidgetRepresentation::UpdateHandleToWorldTransform ( )
virtual

Update HandleToWorldTransform. This controls the position and orientation of the interaction handles.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

◆ UpdateHandleToWorldTransform() [2/2]

void vtkMRMLTransformHandleWidgetRepresentation::UpdateHandleToWorldTransform ( vtkTransform * handleToWorldTransform)
overridevirtual

◆ UpdateInteractionPipeline()

void vtkMRMLTransformHandleWidgetRepresentation::UpdateInteractionPipeline ( )
overridevirtual

Update the interaction pipeline.

Reimplemented from vtkMRMLInteractionWidgetRepresentation.

Member Data Documentation

◆ DisplayNode

vtkSmartPointer<vtkMRMLTransformDisplayNode> vtkMRMLTransformHandleWidgetRepresentation::DisplayNode
protected

◆ LastInteractionWasWideHit

bool vtkMRMLTransformHandleWidgetRepresentation::LastInteractionWasWideHit { false }
protected

◆ LastSliceWideHitDistance2

double vtkMRMLTransformHandleWidgetRepresentation::LastSliceWideHitDistance2 { 0.0 }
protected

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