Slicer  4.10
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  Program: SlicerViewerWidget
9  Module: $HeadURL: http://svn.slicer.org/Slicer4/trunk/Base/GUI/vtkMRMLModelDisplayableManager.h $
10  Date: $Date: 2010-05-12 08:34:19 -0400 (Wed, 12 May 2010) $
11  Version: $Revision: 13332 $
12 
13 ==========================================================================*/
14 
15 #ifndef __vtkMRMLModelDisplayableManager_h
16 #define __vtkMRMLModelDisplayableManager_h
17 
18 // MRMLDisplayableManager includes
20 #include "vtkMRMLDisplayableManagerExport.h"
21 
22 // MRMLLogic includes
24 
25 // MRML includes
26 #include <vtkMRMLModelNode.h>
28 class vtkMRMLDisplayNode;
34 
35 // VTK includes
36 #include "vtkRenderWindow.h"
37 class vtkActor;
38 class vtkActorText;
39 class vtkAlgorithm;
40 class vtkBoundingBox;
41 class vtkCellArray;
42 class vtkCellPicker;
43 class vtkClipPolyData;
44 class vtkFollower;
45 class vtkImplicitBoolean;
46 class vtkLookupTable;
47 class vtkMatrix4x4;
48 class vtkPMatrix4x4;
49 class vtkPlane;
50 class vtkPlane;
51 class vtkPointPicker;
52 class vtkPolyData;
53 class vtkProp3D;
54 class vtkPropPicker;
55 class vtkWorldPointPicker;
56 
65 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLModelDisplayableManager
67 {
68 public:
71  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
72 
75  vtkMRMLClipModelsNode* GetClipModelsNode();
76  void SetClipModelsNode(vtkMRMLClipModelsNode *snode);
77 
80  vtkProp3D *GetActorByID(const char *id);
81 
84  const char *GetIDByActor(vtkProp3D *actor);
85 
88  vtkWorldPointPicker* GetWorldPointPicker();
89 
92  vtkPropPicker* GetPropPicker();
93 
96  vtkCellPicker* GetCellPicker();
97 
100  vtkPointPicker* GetPointPicker();
101 
104  int Pick(int x, int y);
105 
108  virtual int Pick3D(double ras[3]) VTK_OVERRIDE;
109 
112  double GetPickTolerance();
113  void SetPickTolerance(double tolerance);
114 
117  virtual const char* GetPickedNodeID() VTK_OVERRIDE;
118 
121  double* GetPickedRAS();
122  void SetPickedRAS(double* newPickedRAS);
123 
125  vtkIdType GetPickedCellID();
126  void SetPickedCellID(vtkIdType newCellID);
127 
130  vtkIdType GetPickedPointID();
131  void SetPickedPointID(vtkIdType newPointID);
132 
135  vtkMRMLModelHierarchyLogic* GetModelHierarchyLogic();
136 
137  void SetClipPlaneFromMatrix(vtkMatrix4x4 *sliceMatrix,
138  int planeDirection,
139  vtkPlane *plane);
140 
142  bool IsModelDisplayable(vtkMRMLDisplayableNode* node)const;
144  bool IsModelDisplayable(vtkMRMLDisplayNode* node)const;
145 
149  static vtkLookupTable* CreateLookupTableCopy(vtkLookupTable* source);
150 
155  static bool IsCellScalarsActive(vtkMRMLDisplayNode* displayNode, vtkMRMLModelNode* model = 0);
156 
157 protected:
158 
161 
162  virtual void AdditionalInitializeStep() VTK_OVERRIDE;
163  virtual int ActiveInteractionModes() VTK_OVERRIDE;
164 
165  virtual void UnobserveMRMLScene() VTK_OVERRIDE;
166 
167  virtual void OnMRMLSceneStartClose() VTK_OVERRIDE;
168  virtual void OnMRMLSceneEndClose() VTK_OVERRIDE;
169  virtual void UpdateFromMRMLScene() VTK_OVERRIDE;
170  virtual void OnMRMLSceneNodeAdded(vtkMRMLNode* node) VTK_OVERRIDE;
171  virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) VTK_OVERRIDE;
172 
173  virtual void OnInteractorStyleEvent(int eventId) VTK_OVERRIDE;
174  virtual void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE;
175 
178  bool OnMRMLDisplayableModelNodeModifiedEvent(vtkMRMLDisplayableNode * modelNode);
179 
181  virtual void UpdateFromMRML() VTK_OVERRIDE;
182 
183  virtual void RemoveMRMLObservers() VTK_OVERRIDE;
184 
185  friend class vtkThreeDViewInteractorStyle; // Access to RequestRender();
186 
187  void RemoveModelProps();
188  void RemoveModelObservers(int clearCache);
189  void RemoveDisplayable(vtkMRMLDisplayableNode* model);
190  void RemoveDisplayableNodeObservers(vtkMRMLDisplayableNode *model);
191 
192  void UpdateModelsFromMRML();
193  void UpdateModel(vtkMRMLDisplayableNode *model);
194  void UpdateModelMesh(vtkMRMLDisplayableNode *model);
195  void UpdateModifiedModel(vtkMRMLDisplayableNode *model);
196 
197  void SetModelDisplayProperty(vtkMRMLDisplayableNode *model);
198  int GetDisplayedModelsVisibility(vtkMRMLDisplayNode *model);
199 
200  const char* GetActiveScalarName(vtkMRMLDisplayNode* displayNode,
201  vtkMRMLModelNode* model = 0);
202 
204  int UpdateClipSlicesFromMRML();
205  vtkAlgorithm *CreateTransformedClipper(vtkMRMLTransformNode *tnode,
206  vtkMRMLModelNode::MeshTypeHint type);
207 
208  void AddHierarchyObservers();
209  void RemoveHierarchyObservers(int clearCache);
210 
211  void CheckModelHierarchies();
212  void UpdateModelHierarchies();
213  void UpdateModelHierarchyVisibility(vtkMRMLModelHierarchyNode* mhnode, int visibility );
214  void UpdateModelHierarchyDisplay(vtkMRMLDisplayableNode *model);
215 
216  vtkMRMLDisplayNode* GetHierarchyDisplayNode(vtkMRMLDisplayableNode *model);
217 
218  void RemoveDispalyedID(std::string &id);
219 
220 private:
221 
223  void operator=(const vtkMRMLModelDisplayableManager&); // Not Implemented
224 
225  class vtkInternal;
226  vtkInternal* Internal;
227 };
228 
229 #endif
MRML node for representing a transformation between this node space and a parent node space...
MRML node to represent a 3D surface model.
LRU Cache.
MRML node to represent three clipping planes.
Manage display nodes with polydata in 3D views.
static vtkMRMLAbstractThreeDViewDisplayableManager * New()
MRML node to represent a hierarchyu of models.
Interactive manipulation of the camera.
Slicer logic class for volumes manipulation.
virtual const char * GetPickedNodeID()
Get the MRML ID of the picked node, returns empty string if no pick.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:138
MRML node for storing information about the active nodes in the scene.