Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkMRMLModelNode.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) 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: 3D Slicer
9  Module: $RCSfile: vtkMRMLModelNode.h,v $
10  Date: $Date: 2006/03/19 17:12:28 $
11  Version: $Revision: 1.6 $
12 
13 =========================================================================auto=*/
14 
15 #ifndef __vtkMRMLModelNode_h
16 #define __vtkMRMLModelNode_h
17 
18 // MRML includes
19 #include "vtkMRMLDisplayableNode.h"
21 class vtkMRMLStorageNode;
22 
23 // VTK includes
24 class vtkAlgorithmOutput;
25 class vtkAssignAttributes;
26 class vtkEventForwarderCommand;
27 class vtkDataArray;
28 class vtkPointSet;
29 class vtkPolyData;
30 class vtkTransformFilter;
31 class vtkUnstructuredGrid;
32 class vtkMRMLDisplayNode;
33 
42 class VTK_MRML_EXPORT vtkMRMLModelNode : public vtkMRMLDisplayableNode
43 {
44 public:
45  static vtkMRMLModelNode *New();
47  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
48 
49  //--------------------------------------------------------------------------
51  //--------------------------------------------------------------------------
52 
53  virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;
54 
56  virtual const char* GetNodeTagName() VTK_OVERRIDE {return "Model";};
57 
60  virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;
61 
63  virtual void ProcessMRMLEvents ( vtkObject * /*caller*/,
64  unsigned long /*event*/,
65  void * /*callData*/ ) VTK_OVERRIDE;
66 
68  vtkMRMLModelDisplayNode* GetModelDisplayNode();
69 
73  virtual void SetAndObserveMesh(vtkPointSet *Mesh);
74  virtual void SetAndObservePolyData(vtkPolyData *polyData);
75 
78  virtual vtkPointSet* GetMesh();
79 
82  virtual vtkPolyData* GetPolyData();
83 
87  virtual vtkUnstructuredGrid* GetUnstructuredGrid();
88 
92  virtual void SetPolyDataConnection(vtkAlgorithmOutput *inputPort);
93 
97  virtual void SetUnstructuredGridConnection(vtkAlgorithmOutput *inputPort);
98 
101  vtkGetObjectMacro(MeshConnection,vtkAlgorithmOutput)
102 
103 
104  virtual vtkAlgorithmOutput* GetPolyDataConnection();
107 
111  virtual vtkAlgorithmOutput* GetUnstructuredGridConnection();
112 
115  typedef enum {
116  PolyDataMeshType = 0,
117  UnstructuredGridMeshType
118  } MeshTypeHint;
119 
125  vtkGetMacro(MeshType, MeshTypeHint);
126 
133  enum
134  {
135  MeshModifiedEvent = 17001,
136  PolyDataModifiedEvent = 17001
137  };
138 
141  void AddPointScalars(vtkDataArray *array);
142 
145  void AddCellScalars(vtkDataArray *array);
146 
150  void AddScalars(vtkDataArray *array, int location);
151 
153  void RemoveScalars(const char *scalarName);
154 
158  bool HasPointScalarName(const char* scalarName);
159 
163  bool HasCellScalarName(const char* scalarName);
164 
172  int SetActivePointScalars(const char *scalarName, int attributeType);
173 
179  const char *GetActivePointScalarName(int type);
180 
188  int SetActiveCellScalars(const char *scalarName, int attributeType);
189 
194  const char *GetActiveCellScalarName(int type);
195 
199  static int GetAttributeTypeFromString(const char* typeName);
200 
211  int CompositeScalars(const char* backgroundName, const char* overlayName,
212  float overlayMin, float overlayMax,
213  int showOverlayPositive, int showOverlayNegative,
214  int reverseOverlay);
215 
220  virtual void GetRASBounds(double bounds[6]) VTK_OVERRIDE;
221 
225  virtual void GetBounds(double bounds[6]) VTK_OVERRIDE;
226 
231  virtual void TransformBoundsToRAS(double inputBounds_Local[6], double outputBounds_RAS[6]);
232 
233  virtual bool CanApplyNonLinearTransforms()const VTK_OVERRIDE;
234  virtual void ApplyTransform(vtkAbstractTransform* transform) VTK_OVERRIDE;
235 
236  virtual vtkMRMLStorageNode* CreateDefaultStorageNode() VTK_OVERRIDE;
237 
238  virtual std::string GetDefaultStorageNodeClassName(const char* filename /* =NULL */) VTK_OVERRIDE;
239 
241  virtual void CreateDefaultDisplayNodes() VTK_OVERRIDE;
242 
250  virtual bool GetModifiedSinceRead() VTK_OVERRIDE;
251 
252 protected:
254  ~vtkMRMLModelNode();
255  vtkMRMLModelNode(const vtkMRMLModelNode&);
256  void operator=(const vtkMRMLModelNode&);
257 
259  virtual void SetMeshConnection(vtkAlgorithmOutput *inputPort);
260 
263  virtual void UpdateDisplayNodeMesh(vtkMRMLDisplayNode *dnode);
264 
267  virtual void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) VTK_OVERRIDE;
268 
271  virtual void OnNodeReferenceModified(vtkMRMLNodeReference *reference) VTK_OVERRIDE;
272 
273 
276  void SetMeshToDisplayNodes();
277 
280  virtual void SetMeshToDisplayNode(vtkMRMLModelDisplayNode* modelDisplayNode);
281 
283  vtkAlgorithmOutput* MeshConnection;
284  vtkEventForwarderCommand* DataEventForwarder;
285  MeshTypeHint MeshType;
286 };
287 
288 #endif
MRML node to represent a display property of 3D surface model.
virtual void GetBounds(double bounds[6])
MRML node to represent a 3D surface model.
LRU Cache.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
virtual void ProcessMRMLEvents(vtkObject *, unsigned long, void *) VTK_OVERRIDE
alternative method to propagate events generated in Display nodes
A supercalss for other storage nodes.
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE
Copy the node's attributes to this object.
virtual bool CanApplyNonLinearTransforms() const
Abstract class that contains graphical display properties for displayable nodes.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:135
Class to hold information about a node reference.
Definition: vtkMRMLNode.h:723
virtual vtkMRMLNode * CreateNodeInstance() VTK_OVERRIDE=0
MRMLNode methods.
virtual void GetRASBounds(double bounds[6])