6 #ifndef __vtkMRMLVolumePropertyNode_h 7 #define __vtkMRMLVolumePropertyNode_h 10 #include "vtkSlicerVolumeRenderingModuleMRMLExport.h" 16 class vtkColorTransferFunction;
18 class vtkPiecewiseFunction;
19 class vtkVolumeProperty;
34 EffectiveRangeModified = 62300
40 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
44 vtkGetObjectMacro(VolumeProperty, vtkVolumeProperty);
49 void SetScalarOpacity(vtkPiecewiseFunction* newScalarOpacity,
int component = 0);
53 vtkPiecewiseFunction* GetScalarOpacity(
int component = 0);
58 void SetGradientOpacity(vtkPiecewiseFunction* newGradientOpacity,
int component = 0);
62 vtkPiecewiseFunction* GetGradientOpacity(
int component = 0);
67 void SetColor(vtkColorTransferFunction* newColorFunction,
int component = 0);
71 vtkColorTransferFunction* GetColor(
int component = 0);
79 static std::string GetPiecewiseFunctionString(vtkPiecewiseFunction*
function);
87 static std::string GetColorTransferFunctionString(vtkColorTransferFunction*
function);
93 static void GetPiecewiseFunctionFromString(
const std::string& str,
94 vtkPiecewiseFunction* result);
100 static void GetColorTransferFunctionFromString(
const std::string& str,
101 vtkColorTransferFunction* result);
107 static inline void GetPiecewiseFunctionFromString(
const char *str,
108 vtkPiecewiseFunction* result);
115 static inline void GetColorTransferFunctionFromString(
const char *str,
116 vtkColorTransferFunction* result);
121 static double NextHigher(
double value);
126 static double HigherAndUnique(
double value,
double & previousValue);
129 void SetEffectiveRange(
double min,
double max);
130 void SetEffectiveRange(
double range[2]);
132 vtkGetVector2Macro(EffectiveRange,
double);
136 bool CalculateEffectiveRange();
144 virtual
void ReadXMLAttributes( const
char** atts) VTK_OVERRIDE;
147 virtual
void WriteXML(ostream& of,
int indent) VTK_OVERRIDE;
157 virtual const
char* GetNodeTagName() VTK_OVERRIDE {
return "VolumeProperty";}
160 virtual void ProcessMRMLEvents ( vtkObject *caller,
unsigned long event,
void *callData) VTK_OVERRIDE;
166 virtual
bool GetModifiedSinceRead() VTK_OVERRIDE;
172 static
int NodesFromString(const
std::
string& dataString,
double* &data,
int nodeSize);
173 static
int DataFromString(const
std::
string& dataString,
double* &data);
174 static
std::
string DataToString(
double* data,
int size);
178 int GetInterpolationType();
179 void SetInterpolationType(
int);
183 void SetDiffuse(
double);
185 void SetAmbient(
double);
186 double GetSpecular();
187 void SetSpecular(
double);
188 double GetSpecularPower();
189 void SetSpecularPower(
double);
190 std::
string GetScalarOpacityAsString();
191 void SetScalarOpacityAsString(
std::
string);
192 std::
string GetGradientOpacityAsString();
193 void SetGradientOpacityAsString(
std::
string);
194 std::
string GetRGBTransferFunctionAsString();
195 void SetRGBTransferFunctionAsString(
std::
string);
199 vtkIntArray* ObservedEvents;
202 vtkVolumeProperty* VolumeProperty;
207 double EffectiveRange[2];
221 ::GetPiecewiseFunctionFromString(const
char *str,
222 vtkPiecewiseFunction* result)
225 std::string(str), result);
231 vtkColorTransferFunction* result)
234 std::string (str), result);
virtual vtkMRMLStorageNode * CreateDefaultStorageNode()
virtual void ProcessMRMLEvents(vtkObject *, unsigned long, void *) VTK_OVERRIDE
alternative method to propagate events generated in Storage nodes
virtual vtkMRMLNode * CreateNodeInstance() VTK_OVERRIDE=0
MRMLNode methods.
MRML node to represent a 3D surface model.
A superclass for other storage nodes.
static void GetPiecewiseFunctionFromString(const std::string &str, vtkPiecewiseFunction *result)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
static void GetColorTransferFunctionFromString(const std::string &str, vtkColorTransferFunction *result)
Abstract Superclass for all specific types of MRML nodes.
vtkMRMLVolumePropertyNode contains the transfer functions (scalar opacity, color and gradient opacity...