Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLModelDisplayNode.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: vtkMRMLModelDisplayNode.h,v $
10 Date: $Date: 2006/03/19 17:12:28 $
11 Version: $Revision: 1.6 $
12
13=========================================================================auto=*/
14
15#ifndef __vtkMRMLModelDisplayNode_h
16#define __vtkMRMLModelDisplayNode_h
17
18// MRML includes
19#include "vtkMRMLDisplayNode.h"
20
21// VTK includes
22class vtkAlgorithm;
23class vtkAlgorithmOutput;
24class vtkAssignAttribute;
25class vtkGeometryFilter;
26class vtkThreshold;
27class vtkPassThrough;
28class vtkPointSet;
29class vtkPolyData;
30class vtkUnstructuredGrid;
31
36class VTK_MRML_EXPORT vtkMRMLModelDisplayNode : public vtkMRMLDisplayNode
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44 {
48 SliceDisplayMode_Last // placeholder after the last valid value, this must be the last in the list of modes
49 };
50
53 void ReadXMLAttributes(const char** atts) override;
54
57 void WriteXML(ostream& of, int indent) override;
58
62
64
66 const char* GetNodeTagName() override {return "ModelDisplay";}
67
71 virtual void SetInputMeshConnection(vtkAlgorithmOutput* meshConnection);
72 virtual void SetInputPolyDataConnection(vtkAlgorithmOutput* polyDataConnection);
73
77 virtual vtkAlgorithmOutput* GetInputMeshConnection();
78 virtual vtkAlgorithmOutput* GetInputPolyDataConnection();
79
82 virtual vtkPointSet* GetInputMesh();
83 virtual vtkPolyData* GetInputPolyData();
84 virtual vtkUnstructuredGrid* GetInputUnstructuredGrid();
85
93 virtual vtkPointSet* GetOutputMesh();
94 virtual vtkPolyData* GetOutputPolyData();
95 virtual vtkUnstructuredGrid* GetOutputUnstructuredGrid();
96
100 virtual vtkAlgorithmOutput* GetOutputMeshConnection();
101 virtual vtkAlgorithmOutput* GetOutputPolyDataConnection();
102
109 void SetActiveScalarName(const char *scalarName) override;
110
113 void SetActiveAttributeLocation(int location) override;
114
117 void SetThresholdEnabled(bool enabled);
118 vtkBooleanMacro(ThresholdEnabled,bool);
119
123 vtkGetMacro(ThresholdEnabled,bool);
124
127 void SetThresholdRange(double min, double max);
128 void SetThresholdRange(double range[2]);
129
132 void GetThresholdRange(double range[2]);
133 double* GetThresholdRange() VTK_SIZEHINT(2);
134 double GetThresholdMin();
135 double GetThresholdMax();
136
140 vtkGetMacro(SliceDisplayMode, int);
141 vtkSetMacro(SliceDisplayMode, int);
142 void SetSliceDisplayModeToIntersection();
143 void SetSliceDisplayModeToProjection();
144 void SetSliceDisplayModeToDistanceEncodedProjection();
145
147 static const char* GetSliceDisplayModeAsString(int id);
148 static int GetSliceDisplayModeFromString(const char* name);
149
154 virtual void SetAndObserveDistanceEncodedProjectionColorNodeID(const char *colorNodeID);
157 virtual const char* GetDistanceEncodedProjectionColorNodeID();
158 virtual vtkMRMLColorNode* GetDistanceEncodedProjectionColorNode();
159
162 virtual vtkDataSet* GetScalarDataSet() override;
164 virtual vtkDataArray* GetActiveScalarArray() override;
165
168 vtkSetVector3Macro(BackfaceColorHSVOffset, double);
169 vtkGetVector3Macro(BackfaceColorHSVOffset, double);
170
171 vtkSetMacro(ClippingCapSurface, bool);
172 vtkGetMacro(ClippingCapSurface, bool);
173 vtkBooleanMacro(ClippingCapSurface, bool);
174
175 vtkSetMacro(ClippingOutline, bool);
176 vtkGetMacro(ClippingOutline, bool);
177 vtkBooleanMacro(ClippingOutline, bool);
178
179 vtkSetMacro(ClippingCapOpacity, double);
180 vtkGetMacro(ClippingCapOpacity, double);
181
182 vtkSetVector3Macro(ClippingCapColorHSVOffset, double);
183 vtkGetVector3Macro(ClippingCapColorHSVOffset, double);
184
185protected:
189 void operator=(const vtkMRMLModelDisplayNode&);
190
191 void ProcessMRMLEvents(vtkObject *caller,
192 unsigned long event,
193 void *callData) override;
194
196 virtual void SetInputToMeshPipeline(vtkAlgorithmOutput* meshConnection);
197
200 virtual void UpdateAssignedAttribute() override;
201
206 vtkAssignAttribute* AssignAttribute;
207
211 vtkPassThrough* PassThrough;
212
217 vtkThreshold* ThresholdFilter;
218
222 vtkGeometryFilter* ConvertToPolyDataFilter;
223
228 bool ThresholdEnabled;
229
230 int SliceDisplayMode;
231
233 double ThresholdRangeTemp[2];
234
235 double BackfaceColorHSVOffset[3];
236
237 bool ClippingCapSurface{ false };
238 double ClippingCapOpacity{ 1.0 };
239 bool ClippingOutline{ false };
240 double ClippingCapColorHSVOffset[3];
241};
242
243#endif
Abstract MRML node to represent color information.
Abstract class that contains graphical display properties for displayable nodes.
MRML node to represent a display property of 3D surface model.
virtual void SetInputMeshConnection(vtkAlgorithmOutput *meshConnection)
virtual vtkPolyData * GetOutputPolyData()
virtual vtkUnstructuredGrid * GetOutputUnstructuredGrid()
void SetThresholdEnabled(bool enabled)
virtual vtkAlgorithmOutput * GetInputMeshConnection()
vtkMRMLCopyContentMacro(vtkMRMLModelDisplayNode)
virtual vtkAlgorithmOutput * GetOutputMeshConnection()
@ SliceDisplayDistanceEncodedProjection
Show full model projected on the slice, colored by distance from slice plane.
@ SliceDisplayProjection
Show full model projected on the slice (similar to MIP view of images)
@ SliceDisplayIntersection
Show model in slice view as intersection with slice.
void SetThresholdRange(double range[2])
vtkMRMLNode * CreateNodeInstance() override
Create instance of the default node. Like New only virtual.
void SetActiveAttributeLocation(int location) override
virtual vtkAlgorithmOutput * GetInputPolyDataConnection()
void SetThresholdRange(double min, double max)
virtual vtkPointSet * GetInputMesh()
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file.
virtual void SetInputPolyDataConnection(vtkAlgorithmOutput *polyDataConnection)
void PrintSelf(ostream &os, vtkIndent indent) override
void SetActiveScalarName(const char *scalarName) override
void GetThresholdRange(double range[2])
static vtkMRMLModelDisplayNode * New()
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
double * GetThresholdRange() VTK_SIZEHINT(2)
virtual vtkPolyData * GetInputPolyData()
virtual vtkUnstructuredGrid * GetInputUnstructuredGrid()
virtual vtkPointSet * GetOutputMesh()
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
virtual vtkAlgorithmOutput * GetOutputPolyDataConnection()
Abstract Superclass for all specific types of MRML nodes.