Slicer  4.8
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  double GetPickTolerance();
109  void SetPickTolerance(double tolerance);
110 
113  const char *GetPickedNodeID();
114 
117  double* GetPickedRAS();
118  void SetPickedRAS(double* newPickedRAS);
119 
121  vtkIdType GetPickedCellID();
122  void SetPickedCellID(vtkIdType newCellID);
123 
126  vtkIdType GetPickedPointID();
127  void SetPickedPointID(vtkIdType newPointID);
128 
131  vtkMRMLModelHierarchyLogic* GetModelHierarchyLogic();
132 
133  void SetClipPlaneFromMatrix(vtkMatrix4x4 *sliceMatrix,
134  int planeDirection,
135  vtkPlane *plane);
136 
138  bool IsModelDisplayable(vtkMRMLDisplayableNode* node)const;
140  bool IsModelDisplayable(vtkMRMLDisplayNode* node)const;
141 
145  static vtkLookupTable* CreateLookupTableCopy(vtkLookupTable* source);
146 
148  static bool IsCellScalarsActive(vtkMRMLDisplayNode* displayNode,
149  vtkMRMLModelNode* model = 0);
150 
151 protected:
152 
155 
156  virtual void AdditionalInitializeStep() VTK_OVERRIDE;
157  virtual int ActiveInteractionModes() VTK_OVERRIDE;
158 
159  virtual void UnobserveMRMLScene() VTK_OVERRIDE;
160 
161  virtual void OnMRMLSceneStartClose() VTK_OVERRIDE;
162  virtual void OnMRMLSceneEndClose() VTK_OVERRIDE;
163  virtual void UpdateFromMRMLScene() VTK_OVERRIDE;
164  virtual void OnMRMLSceneNodeAdded(vtkMRMLNode* node) VTK_OVERRIDE;
165  virtual void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) VTK_OVERRIDE;
166 
167  virtual void OnInteractorStyleEvent(int eventId) VTK_OVERRIDE;
168  virtual void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) VTK_OVERRIDE;
169 
172  bool OnMRMLDisplayableModelNodeModifiedEvent(vtkMRMLDisplayableNode * modelNode);
173 
175  virtual void UpdateFromMRML() VTK_OVERRIDE;
176 
177  virtual void RemoveMRMLObservers() VTK_OVERRIDE;
178 
179  friend class vtkThreeDViewInteractorStyle; // Access to RequestRender();
180 
181  void RemoveModelProps();
182  void RemoveModelObservers(int clearCache);
183  void RemoveDisplayable(vtkMRMLDisplayableNode* model);
184  void RemoveDisplayableNodeObservers(vtkMRMLDisplayableNode *model);
185 
186  void UpdateModelsFromMRML();
187  void UpdateModel(vtkMRMLDisplayableNode *model);
188  void UpdateModelMesh(vtkMRMLDisplayableNode *model);
189  void UpdateModifiedModel(vtkMRMLDisplayableNode *model);
190 
191  void SetModelDisplayProperty(vtkMRMLDisplayableNode *model);
192  int GetDisplayedModelsVisibility(vtkMRMLDisplayNode *model);
193 
194  const char* GetActiveScalarName(vtkMRMLDisplayNode* displayNode,
195  vtkMRMLModelNode* model = 0);
196 
198  int UpdateClipSlicesFromMRML();
199  vtkAlgorithm *CreateTransformedClipper(vtkMRMLTransformNode *tnode,
200  vtkMRMLModelNode::MeshTypeHint type);
201 
202  void AddHierarchyObservers();
203  void RemoveHierarchyObservers(int clearCache);
204 
205  void CheckModelHierarchies();
206  void UpdateModelHierarchies();
207  void UpdateModelHierarchyVisibility(vtkMRMLModelHierarchyNode* mhnode, int visibility );
208  void UpdateModelHierarchyDisplay(vtkMRMLDisplayableNode *model);
209 
210  vtkMRMLDisplayNode* GetHierarchyDisplayNode(vtkMRMLDisplayableNode *model);
211 
212  void RemoveDispalyedID(std::string &id);
213 
214  vtkMRMLSelectionNode* GetSelectionNode();
215 
216 private:
217 
219  void operator=(const vtkMRMLModelDisplayableManager&); // Not Implemented
220 
221  class vtkInternal;
222  vtkInternal* Internal;
223 };
224 
225 #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.
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:135
MRML node for storing information about the active nodes in the scene.