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)
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();
147 void WriteXML(ostream& of,
int indent)
override;
161 void ProcessMRMLEvents ( vtkObject *caller,
unsigned long event,
void *callData)
override;
173 static int NodesFromString(
const std::string& dataString,
double* &data,
int nodeSize);
174 static int DataFromString(
const std::string& dataString,
double* &data);
175 static std::string DataToString(
double* data,
int size);
179 int GetInterpolationType();
180 void SetInterpolationType(
int);
184 void SetDiffuse(
double);
186 void SetAmbient(
double);
187 double GetSpecular();
188 void SetSpecular(
double);
189 double GetSpecularPower();
190 void SetSpecularPower(
double);
191 std::string GetScalarOpacityAsString();
192 void SetScalarOpacityAsString(std::string);
193 std::string GetGradientOpacityAsString();
194 void SetGradientOpacityAsString(std::string);
195 std::string GetRGBTransferFunctionAsString();
196 void SetRGBTransferFunctionAsString(std::string);
203 vtkVolumeProperty* VolumeProperty{
nullptr};
208 double EffectiveRange[2]{0.0,-1.0};
211 int DisabledModify{0};
223 vtkPiecewiseFunction* result)
226 std::string(str), result);
232 vtkColorTransferFunction* result)
235 std::string (str), result);
virtual vtkMRMLStorageNode * CreateDefaultStorageNode()
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
void ReadXMLAttributes(const char **atts) override
Read node attributes from XML file
virtual bool GetModifiedSinceRead()
vtkMRMLNode * CreateNodeInstance() override=0
MRMLNode methods.
MRML node to represent a 3D surface model.
vtkIntArray * ObservedEvents
Events observed on the transfer functions.
A superclass for other storage nodes.
void ProcessMRMLEvents(vtkObject *, unsigned long, void *) override
alternative method to propagate events generated in Storage nodes
static void GetPiecewiseFunctionFromString(const std::string &str, vtkPiecewiseFunction *result)
vtkMRMLCopyContentMacro(vtkMRMLStorableNode)
static void GetColorTransferFunctionFromString(const std::string &str, vtkColorTransferFunction *result)
Abstract Superclass for all specific types of MRML nodes.
void operator=(const vtkMRMLStorableNode &)
vtkMRMLVolumePropertyNode contains the transfer functions (scalar opacity, color and gradient opacity...
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
void PrintSelf(ostream &os, vtkIndent indent) override