Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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>
20 class vtkMRMLDisplayNode;
23 
24 // VTK includes
25 #include "vtkRenderWindow.h"
26 class vtkActor;
27 class vtkAlgorithm;
28 class vtkCellPicker;
29 class vtkLookupTable;
30 class vtkMatrix4x4;
31 class vtkPlane;
32 class vtkPointPicker;
33 class vtkProp3D;
34 class vtkPropPicker;
35 class vtkWorldPointPicker;
36 
45 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLModelDisplayableManager
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54  vtkMRMLClipModelsNode* GetClipModelsNode();
55  void SetClipModelsNode(vtkMRMLClipModelsNode *snode);
56 
58  vtkProp3D *GetActorByID(const char *id);
59 
61  const char *GetIDByActor(vtkProp3D *actor);
62 
64  vtkWorldPointPicker* GetWorldPointPicker();
65 
67  vtkPropPicker* GetPropPicker();
68 
70  vtkCellPicker* GetCellPicker();
71 
73  vtkPointPicker* GetPointPicker();
74 
77  int Pick(int x, int y);
78 
81  int Pick3D(double ras[3]) override;
82 
84  double GetPickTolerance();
86  void SetPickTolerance(double tolerance);
87 
89  const char* GetPickedNodeID() override;
90 
92  double* GetPickedRAS();
94  void SetPickedRAS(double* newPickedRAS);
95 
97  vtkIdType GetPickedCellID();
99  void SetPickedCellID(vtkIdType newCellID);
100 
102  vtkIdType GetPickedPointID();
104  void SetPickedPointID(vtkIdType newPointID);
105 
106  void SetClipPlaneFromMatrix(vtkMatrix4x4 *sliceMatrix,
107  int planeDirection,
108  vtkPlane *plane);
109 
111  bool IsModelDisplayable(vtkMRMLDisplayableNode* node)const;
113  bool IsModelDisplayable(vtkMRMLDisplayNode* node)const;
114 
119  static bool IsCellScalarsActive(vtkMRMLDisplayNode* displayNode, vtkMRMLModelNode* model = nullptr);
120 
121 protected:
122  int ActiveInteractionModes() override;
123 
124  void UnobserveMRMLScene() override;
125 
126  void OnMRMLSceneStartClose() override;
127  void OnMRMLSceneEndClose() override;
128  void UpdateFromMRMLScene() override;
129  void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
130  void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) override;
131 
132  void OnInteractorStyleEvent(int eventId) override;
133  void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override;
134 
137  bool OnMRMLDisplayableModelNodeModifiedEvent(vtkMRMLDisplayableNode* modelNode);
138 
140  void UpdateFromMRML() override;
141 
142  void RemoveMRMLObservers() override;
143 
144  void RemoveModelProps();
145  void RemoveModelObservers(int clearCache);
146  void RemoveDisplayable(vtkMRMLDisplayableNode* model);
147  void RemoveDisplayableNodeObservers(vtkMRMLDisplayableNode* model);
148 
149  void UpdateModelsFromMRML();
150  void UpdateModel(vtkMRMLDisplayableNode* model);
151  void UpdateModelMesh(vtkMRMLDisplayableNode* model);
152  void UpdateModifiedModel(vtkMRMLDisplayableNode* model);
153 
154  void SetModelDisplayProperty(vtkMRMLDisplayableNode* model);
155  int GetDisplayedModelsVisibility(vtkMRMLDisplayNode* displayNode);
156 
157  const char* GetActiveScalarName(vtkMRMLDisplayNode* displayNode,
158  vtkMRMLModelNode* model = nullptr);
159 
161  int UpdateClipSlicesFromMRML();
162  vtkAlgorithm *CreateTransformedClipper(vtkMRMLTransformNode *tnode,
164 
165  void RemoveDisplayedID(std::string &id);
166 
167 protected:
169  ~vtkMRMLModelDisplayableManager() override;
170 
171  friend class vtkMRMLThreeDViewInteractorStyle; // Access to RequestRender();
172 
173 private:
175  void operator=(const vtkMRMLModelDisplayableManager&) = delete;
176 
177  class vtkInternal;
178  vtkInternal* Internal;
179 };
180 
181 #endif
virtual void OnMRMLSceneStartClose()
virtual void RemoveMRMLObservers()
Remove MRML observers.
MRML node for representing a transformation between this node space and a parent node space...
virtual void OnMRMLSceneEndClose()
MRML node to represent a 3D surface model.
MRML node to represent three clipping planes.
Manage display nodes with polydata in 3D views.
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void OnMRMLSceneNodeAdded(vtkMRMLNode *)
virtual void UnobserveMRMLScene()
static vtkMRMLAbstractThreeDViewDisplayableManager * New()
virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode *)
Interactive manipulation of the camera.
void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override
virtual const char * GetPickedNodeID()
Get the MRML ID of the picked node, returns empty string if no pick.
Abstract class that contains graphical display properties for displayable nodes.
virtual void UpdateFromMRMLScene()
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
virtual void OnInteractorStyleEvent(int eventid)