Slicer  4.11
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 // MRML includes
23 #include <vtkMRMLModelNode.h>
25 class vtkMRMLDisplayNode;
28 
29 // VTK includes
30 #include "vtkRenderWindow.h"
31 class vtkActor;
32 class vtkAlgorithm;
33 class vtkCellPicker;
34 class vtkLookupTable;
35 class vtkMatrix4x4;
36 class vtkPlane;
37 class vtkPointPicker;
38 class vtkProp3D;
39 class vtkPropPicker;
40 class vtkWorldPointPicker;
41 
50 class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLModelDisplayableManager
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
59  vtkMRMLClipModelsNode* GetClipModelsNode();
60  void SetClipModelsNode(vtkMRMLClipModelsNode *snode);
61 
63  vtkProp3D *GetActorByID(const char *id);
64 
66  const char *GetIDByActor(vtkProp3D *actor);
67 
69  vtkWorldPointPicker* GetWorldPointPicker();
70 
72  vtkPropPicker* GetPropPicker();
73 
75  vtkCellPicker* GetCellPicker();
76 
78  vtkPointPicker* GetPointPicker();
79 
82  int Pick(int x, int y);
83 
86  int Pick3D(double ras[3]) override;
87 
89  double GetPickTolerance();
91  void SetPickTolerance(double tolerance);
92 
94  const char* GetPickedNodeID() override;
95 
97  double* GetPickedRAS();
99  void SetPickedRAS(double* newPickedRAS);
100 
102  vtkIdType GetPickedCellID();
104  void SetPickedCellID(vtkIdType newCellID);
105 
107  vtkIdType GetPickedPointID();
109  void SetPickedPointID(vtkIdType newPointID);
110 
111  void SetClipPlaneFromMatrix(vtkMatrix4x4 *sliceMatrix,
112  int planeDirection,
113  vtkPlane *plane);
114 
116  bool IsModelDisplayable(vtkMRMLDisplayableNode* node)const;
118  bool IsModelDisplayable(vtkMRMLDisplayNode* node)const;
119 
123  static vtkLookupTable* CreateLookupTableCopy(vtkLookupTable* source);
124 
129  static bool IsCellScalarsActive(vtkMRMLDisplayNode* displayNode, vtkMRMLModelNode* model = nullptr);
130 
131 protected:
132  int ActiveInteractionModes() override;
133 
134  void UnobserveMRMLScene() override;
135 
136  void OnMRMLSceneStartClose() override;
137  void OnMRMLSceneEndClose() override;
138  void UpdateFromMRMLScene() override;
139  void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
140  void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) override;
141 
142  void OnInteractorStyleEvent(int eventId) override;
143  void ProcessMRMLNodesEvents(vtkObject *caller, unsigned long event, void *callData) override;
144 
147  bool OnMRMLDisplayableModelNodeModifiedEvent(vtkMRMLDisplayableNode* modelNode);
148 
150  void UpdateFromMRML() override;
151 
152  void RemoveMRMLObservers() override;
153 
154  void RemoveModelProps();
155  void RemoveModelObservers(int clearCache);
156  void RemoveDisplayable(vtkMRMLDisplayableNode* model);
157  void RemoveDisplayableNodeObservers(vtkMRMLDisplayableNode* model);
158 
159  void UpdateModelsFromMRML();
160  void UpdateModel(vtkMRMLDisplayableNode* model);
161  void UpdateModelMesh(vtkMRMLDisplayableNode* model);
162  void UpdateModifiedModel(vtkMRMLDisplayableNode* model);
163 
164  void SetModelDisplayProperty(vtkMRMLDisplayableNode* model);
165  int GetDisplayedModelsVisibility(vtkMRMLDisplayNode* displayNode);
166 
167  const char* GetActiveScalarName(vtkMRMLDisplayNode* displayNode,
168  vtkMRMLModelNode* model = nullptr);
169 
171  int UpdateClipSlicesFromMRML();
172  vtkAlgorithm *CreateTransformedClipper(vtkMRMLTransformNode *tnode,
174 
175  void RemoveDispalyedID(std::string &id);
176 
177 protected:
179  ~vtkMRMLModelDisplayableManager() override;
180 
181  friend class vtkMRMLThreeDViewInteractorStyle; // Access to RequestRender();
182 
183 private:
185  void operator=(const vtkMRMLModelDisplayableManager&) = delete;
186 
187  class vtkInternal;
188  vtkInternal* Internal;
189 };
190 
191 #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:139
virtual void OnInteractorStyleEvent(int eventid)