Slicer 5.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
22
23// VTK includes
24class vtkAlgorithmOutput;
25class vtkAssignAttributes;
26class vtkEventForwarderCommand;
27class vtkDataArray;
28class vtkImplicitPolyDataDistance;
29class vtkPointSet;
30class vtkPolyData;
31class vtkTransformFilter;
32class vtkUnstructuredGrid;
34
43class VTK_MRML_EXPORT vtkMRMLModelNode : public vtkMRMLDisplayableNode
44{
45public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
50 //--------------------------------------------------------------------------
52 //--------------------------------------------------------------------------
53
55
57 const char* GetNodeTagName() override {return "Model";};
58
62
64 void ProcessMRMLEvents ( vtkObject * /*caller*/,
65 unsigned long /*event*/,
66 void * /*callData*/ ) override;
67
70
73 virtual void SetAndObserveMesh(vtkPointSet *Mesh);
74
77 virtual void SetAndObservePolyData(vtkPolyData *polyData);
78
81 virtual vtkPointSet* GetMesh();
82
85 virtual vtkPolyData* GetPolyData();
86
90 virtual vtkUnstructuredGrid* GetUnstructuredGrid();
91
95 virtual void SetPolyDataConnection(vtkAlgorithmOutput *inputPort);
96
100 virtual void SetUnstructuredGridConnection(vtkAlgorithmOutput *inputPort);
101
104 vtkGetObjectMacro(MeshConnection,vtkAlgorithmOutput);
105
109 virtual vtkAlgorithmOutput* GetPolyDataConnection();
110
114 virtual vtkAlgorithmOutput* GetUnstructuredGridConnection();
115
119 {
120 PolyDataMeshType = 0,
121 UnstructuredGridMeshType
122 };
123
129 vtkGetMacro(MeshType, MeshTypeHint);
130
137 enum
138 {
139 MeshModifiedEvent = 17001,
140 PolyDataModifiedEvent = 17001
141 };
142
145 void AddPointScalars(vtkDataArray *array);
146
149 void AddCellScalars(vtkDataArray *array);
150
154 void AddScalars(vtkDataArray *array, int location);
155
157 void RemoveScalars(const char *scalarName);
158
162 bool HasPointScalarName(const char* scalarName);
163
167 bool HasCellScalarName(const char* scalarName);
168
176 int SetActivePointScalars(const char *scalarName, int attributeType);
177
183 const char *GetActivePointScalarName(int type);
184
192 int SetActiveCellScalars(const char *scalarName, int attributeType);
193
198 const char *GetActiveCellScalarName(int type);
199
203 static int GetAttributeTypeFromString(const char* typeName);
204
215 int CompositeScalars(const char* backgroundName, const char* overlayName,
216 float overlayMin, float overlayMax,
217 int showOverlayPositive, int showOverlayNegative,
218 int reverseOverlay);
219
224 void GetRASBounds(double bounds[6]) override;
225
229 void GetBounds(double bounds[6]) override;
230
235 virtual void TransformBoundsToRAS(double inputBounds_Local[6], double outputBounds_RAS[6]);
236
237 bool CanApplyNonLinearTransforms()const override;
238 void ApplyTransform(vtkAbstractTransform* transform) override;
239
241
242 std::string GetDefaultStorageNodeClassName(const char* filename /* =nullptr */) override;
243
246
254 bool GetModifiedSinceRead() override;
255
262
263 vtkImplicitFunction* GetImplicitFunctionWorld() override;
264
265protected:
270
272 virtual void SetMeshConnection(vtkAlgorithmOutput *inputPort);
273
277
281
285
286
290
293 virtual void SetMeshToDisplayNode(vtkMRMLModelDisplayNode* modelDisplayNode);
294
297
299 vtkAlgorithmOutput* MeshConnection;
300 vtkEventForwarderCommand* DataEventForwarder;
302
303 vtkSmartPointer<vtkTransformFilter> PolyDataLocalToWorldTransformFilter;
304 vtkSmartPointer<vtkImplicitPolyDataDistance> ImplicitPolyDataDistanceWorld;
305};
306
307#endif
Abstract class that contains graphical display properties for displayable nodes.
MRML node to represent a display property of 3D surface model.
MRML node to represent a 3D surface model.
void UpdateImplicitDistanceFunction()
Updates the implicit function connection.
vtkSmartPointer< vtkImplicitPolyDataDistance > ImplicitPolyDataDistanceWorld
virtual void UpdateDisplayNodeMesh(vtkMRMLDisplayNode *dnode)
virtual void SetAndObservePolyData(vtkPolyData *polyData)
vtkAlgorithmOutput * MeshConnection
Data.
virtual void SetUnstructuredGridConnection(vtkAlgorithmOutput *inputPort)
virtual vtkPointSet * GetMesh()
int CompositeScalars(const char *backgroundName, const char *overlayName, float overlayMin, float overlayMax, int showOverlayPositive, int showOverlayNegative, int reverseOverlay)
void AddCellScalars(vtkDataArray *array)
virtual vtkPolyData * GetPolyData()
~vtkMRMLModelNode() override
MeshTypeHint MeshType
void CreateDefaultDisplayNodes() override
Create and observe default display node.
bool ShowDefaultScalarData()
vtkEventForwarderCommand * DataEventForwarder
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
vtkImplicitFunction * GetImplicitFunctionWorld() override
virtual void SetMeshConnection(vtkAlgorithmOutput *inputPort)
Called by SetPolyDataConnection and SetUnstructuredGridConnection.
virtual void TransformBoundsToRAS(double inputBounds_Local[6], double outputBounds_RAS[6])
virtual vtkUnstructuredGrid * GetUnstructuredGrid()
virtual void SetMeshToDisplayNode(vtkMRMLModelDisplayNode *modelDisplayNode)
virtual vtkAlgorithmOutput * GetPolyDataConnection()
bool HasPointScalarName(const char *scalarName)
void GetBounds(double bounds[6]) override
void operator=(const vtkMRMLModelNode &)
void SetMeshToDisplayNodes()
virtual void SetAndObserveMesh(vtkPointSet *Mesh)
int SetActivePointScalars(const char *scalarName, int attributeType)
vtkMRMLModelDisplayNode * GetModelDisplayNode()
Get associated model display MRML node.
bool CanApplyNonLinearTransforms() const override
void AddPointScalars(vtkDataArray *array)
Utility function that adds an array to the mesh's point data. /.
vtkMRMLCopyContentMacro(vtkMRMLModelNode)
bool HasCellScalarName(const char *scalarName)
static int GetAttributeTypeFromString(const char *typeName)
bool GetModifiedSinceRead() override
static vtkMRMLModelNode * New()
void PrintSelf(ostream &os, vtkIndent indent) override
vtkMRMLModelNode(const vtkMRMLModelNode &)
std::string GetDefaultStorageNodeClassName(const char *filename) override
vtkMRMLStorageNode * CreateDefaultStorageNode() override
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
const char * GetActiveCellScalarName(int type)
virtual vtkAlgorithmOutput * GetUnstructuredGridConnection()
void AddScalars(vtkDataArray *array, int location)
void GetRASBounds(double bounds[6]) override
virtual void SetPolyDataConnection(vtkAlgorithmOutput *inputPort)
void OnNodeReferenceAdded(vtkMRMLNodeReference *reference) override
Called when a node reference ID is added (list size increased).
vtkSmartPointer< vtkTransformFilter > PolyDataLocalToWorldTransformFilter
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Display nodes
int SetActiveCellScalars(const char *scalarName, int attributeType)
const char * GetActivePointScalarName(int type)
void RemoveScalars(const char *scalarName)
Remove an array from the mesh's point/cell data.
void OnNodeReferenceModified(vtkMRMLNodeReference *reference) override
Called when a node reference ID is modified.
void ApplyTransform(vtkAbstractTransform *transform) override
Class to hold information about a node reference.
Abstract Superclass for all specific types of MRML nodes.
A superclass for other storage nodes.