Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkMRMLModelDisplayableManager.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4
5 See COPYRIGHT.txt
6 or http://www.slicer.org/copyright/copyright.txt for details.
7
8==========================================================================*/
9
10#ifndef __vtkMRMLModelDisplayableManager_h
11#define __vtkMRMLModelDisplayableManager_h
12
13// MRMLDisplayableManager includes
15#include "vtkMRMLDisplayableManagerExport.h"
16
17// MRML includes
18#include <vtkMRMLModelNode.h>
19class vtkMRMLClipNode;
23
24// VTK includes
25#include "vtkRenderWindow.h"
26class vtkActor;
27class vtkAlgorithm;
28class vtkCellPicker;
29class vtkLookupTable;
30class vtkMatrix4x4;
31class vtkMapper;
32class vtkPlane;
33class vtkPointPicker;
34class vtkProp3D;
35class vtkPropPicker;
36class vtkTransform;
37class vtkWorldPointPicker;
38
47class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLModelDisplayableManager
49{
50public:
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
56 vtkProp3D* GetActorByID(const char* id);
57
59 const char* GetIDByActor(vtkProp3D* actor);
60
62 vtkWorldPointPicker* GetWorldPointPicker();
63
65 vtkPropPicker* GetPropPicker();
66
68 vtkCellPicker* GetCellPicker();
69
71 vtkPointPicker* GetPointPicker();
72
75 int Pick(int x, int y);
76
79 int Pick3D(double ras[3]) override;
80
84 void SetPickTolerance(double tolerance);
85
87 const char* GetPickedNodeID() override;
88
90 double* GetPickedRAS() VTK_SIZEHINT(3);
92 void SetPickedRAS(double* newPickedRAS);
93
95 vtkIdType GetPickedCellID();
97 void SetPickedCellID(vtkIdType newCellID);
98
100 vtkIdType GetPickedPointID();
102 void SetPickedPointID(vtkIdType newPointID);
103
108
113 static bool IsCellScalarsActive(vtkMRMLDisplayNode* displayNode, vtkMRMLModelNode* model = nullptr);
114
115protected:
117
118 void UnobserveMRMLScene() override;
119
120 void OnMRMLSceneStartClose() override;
121 void OnMRMLSceneEndClose() override;
122 void UpdateFromMRMLScene() override;
123 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
125
126 void OnInteractorStyleEvent(int eventId) override;
127 void ProcessMRMLNodesEvents(vtkObject* caller, unsigned long event, void* callData) override;
128
132
134 void UpdateFromMRML() override;
135
136 void RemoveMRMLObservers() override;
137
139 void RemoveModelObservers(int clearCache);
142
147
150
151 const char* GetActiveScalarName(vtkMRMLDisplayNode* displayNode,
152 vtkMRMLModelNode* model = nullptr);
153
155 vtkAlgorithm* GetClipper(vtkMRMLDisplayNode* dnode,
156 vtkMRMLModelNode::MeshTypeHint type,
157 vtkImplicitFunction* clipFunction,
158 int clipMethod);
159
160 void RemoveDisplayedID(const std::string& id);
162
164 vtkMapper* actor);
166 vtkActor* actor, double opacity);
168 vtkActor* capActor, double opacity);
169
170protected:
173
174private:
176 void operator=(const vtkMRMLModelDisplayableManager&) = delete;
177
178 class vtkInternal;
179 vtkInternal* Internal;
180};
181
182#endif
MRML node to represent three clipping planes.
Abstract class that contains graphical display properties for displayable nodes.
MRML node to represent a display property of 3D surface model.
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override
vtkIdType GetPickedPointID()
Get the picked point id, returns -1 if no pick.
void UpdateModelMesh(vtkMRMLDisplayableNode *model)
void OnMRMLSceneNodeRemoved(vtkMRMLNode *node) override
void UpdateModifiedModel(vtkMRMLDisplayableNode *model)
void SetPickedRAS(double *newPickedRAS)
Set the picked RAS point, returns 0,0,0 if no pick.
int Pick3D(double ras[3]) override
vtkWorldPointPicker * GetWorldPointPicker()
Get world point picker.
vtkPointPicker * GetPointPicker()
Get point picker.
void UpdateFromMRML() override
Updates Actors based on models in the scene.
const char * GetPickedNodeID() override
Get the MRML ID of the picked node, returns empty string if no pick.
static bool IsCellScalarsActive(vtkMRMLDisplayNode *displayNode, vtkMRMLModelNode *model=nullptr)
const char * GetIDByActor(vtkProp3D *actor)
Return the current node ID corresponding to a given vtkProp3D.
void UpdateMapperProperties(vtkMRMLModelNode *modelNode, vtkMRMLDisplayNode *displayNode, vtkMapper *actor)
const char * GetActiveScalarName(vtkMRMLDisplayNode *displayNode, vtkMRMLModelNode *model=nullptr)
vtkCellPicker * GetCellPicker()
Get cell picker.
void SetPickedCellID(vtkIdType newCellID)
Set the picked cell id, returns -1 if no pick.
void UnobserveMRMLScene() override
void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override
void RemoveDisplayable(vtkMRMLDisplayableNode *model)
int GetDisplayedModelsVisibility(vtkMRMLDisplayNode *displayNode)
bool OnMRMLDisplayableModelNodeModifiedEvent(vtkMRMLDisplayableNode *modelNode)
double * GetPickedRAS() VTK_SIZEHINT(3)
Get the picked RAS point, returns 0,0,0 if no pick.
void SetPickedPointID(vtkIdType newPointID)
Set the picked point id, returns -1 if no pick.
vtkProp3D * GetActorByID(const char *id)
Return the current model actor corresponding to a give MRML ID.
vtkAlgorithm * GetClipper(vtkMRMLDisplayNode *dnode, vtkMRMLModelNode::MeshTypeHint type, vtkImplicitFunction *clipFunction, int clipMethod)
Returns not null if modified.
vtkPropPicker * GetPropPicker()
Get property picker.
void SetModelDisplayProperty(vtkMRMLDisplayableNode *model)
double GetPickTolerance()
Get tolerance for Pick() method. It will call vtkCellPicker.GetTolerance()
void OnMRMLSceneStartClose() override
void SetPickTolerance(double tolerance)
Set tolerance for Pick() method. It will call vtkCellPicker.SetTolerance()
void RemoveDisplayedID(const std::string &id)
void PrintSelf(ostream &os, vtkIndent indent) override
int ActiveInteractionModes() override
void RemoveDisplayableNodeObservers(vtkMRMLDisplayableNode *model)
void OnMRMLSceneEndClose() override
bool IsModelDisplayable(vtkMRMLDisplayableNode *node) const
Return true if the node can be represented as a model.
void UpdateActorProperties(vtkMRMLModelNode *modelNode, vtkMRMLModelDisplayNode *modelDisplayNode, vtkMRMLDisplayNode *displayNode, vtkActor *actor, double opacity)
void UpdateCapActorProperties(vtkMRMLModelNode *modelNode, vtkMRMLModelDisplayNode *modelDisplayNode, vtkMRMLDisplayNode *displayNode, vtkActor *capActor, double opacity)
void UpdateModel(vtkMRMLDisplayableNode *model)
void RemoveModelObservers(int clearCache)
static vtkMRMLModelDisplayableManager * New()
void RemoveMRMLObservers() override
Remove MRML observers.
void OnInteractorStyleEvent(int eventId) override
vtkIdType GetPickedCellID()
Get the picked cell id, returns -1 if no pick.
void UpdateFromMRMLScene() override
MRML node to represent a 3D surface model.
Abstract Superclass for all specific types of MRML nodes.
MRML node for representing a transformation between this node space and a parent node space.