6#ifndef __vtkMRMLVolumePropertyNode_h
7#define __vtkMRMLVolumePropertyNode_h
10#include "vtkSlicerVolumeRenderingModuleMRMLExport.h"
16class vtkColorTransferFunction;
18class vtkPiecewiseFunction;
20class vtkVolumeProperty;
35 EffectiveRangeModified = 62300
41 void PrintSelf(ostream& os, vtkIndent indent)
override;
45 vtkGetObjectMacro(VolumeProperty, vtkVolumeProperty);
68 void SetColor(vtkColorTransferFunction* newColorFunction,
int component = 0);
72 vtkColorTransferFunction*
GetColor(
int component = 0);
95 vtkPiecewiseFunction* result);
102 vtkColorTransferFunction* result);
108 static inline void GetPiecewiseFunctionFromString(
const char *str,
109 vtkPiecewiseFunction* result);
116 static inline void GetColorTransferFunctionFromString(
const char *str,
117 vtkColorTransferFunction* result);
133 vtkGetVector2Macro(EffectiveRange,
double);
178 static int NodesFromString(
const std::string& dataString,
double* &data,
int nodeSize);
210 bool IgnoreVolumePropertyChanges{
false};
213 vtkVolumeProperty* VolumeProperty{
nullptr};
218 double EffectiveRange[2]{0.0,-1.0};
228void vtkMRMLVolumePropertyNode
229::GetPiecewiseFunctionFromString(
const char *str,
230 vtkPiecewiseFunction* result)
233 std::string(str), result);
237void vtkMRMLVolumePropertyNode
238::GetColorTransferFunctionFromString(
const char *str,
239 vtkColorTransferFunction* result)
242 std::string (str), result);
Abstract Superclass for all specific types of MRML nodes.
MRML node to represent a 3D surface model.
A superclass for other storage nodes.
vtkMRMLVolumePropertyNode contains the transfer functions (scalar opacity, color and gradient opacity...
~vtkMRMLVolumePropertyNode() override
void SetRGBTransferFunctionAsString(std::string)
void SetGradientOpacity(vtkPiecewiseFunction *newGradientOpacity, int component=0)
static double HigherAndUnique(double value, double &previousValue)
static double NextHigher(double value)
vtkMRMLCopyContentMacro(vtkMRMLVolumePropertyNode)
vtkSmartPointer< vtkIntArray > ObservedEvents
Events observed on the transfer functions.
void SetPropertyInVolumeNode(vtkVolume *volume)
vtkMRMLStorageNode * CreateDefaultStorageNode() override
Create default storage node or nullptr if does not have one.
double GetSpecularPower()
vtkColorTransferFunction * GetColor(int component=0)
void SetInterpolationType(int)
void SetScalarOpacityAsString(std::string)
void ProcessMRMLEvents(vtkObject *caller, unsigned long event, void *callData) override
Reimplemented for internal reasons.
static std::string GetPiecewiseFunctionString(vtkPiecewiseFunction *function)
void WriteXML(ostream &of, int indent) override
Write this node's information to a MRML file in XML format.
int GetInterpolationType()
static void GetPiecewiseFunctionFromString(const std::string &str, vtkPiecewiseFunction *result)
vtkMRMLVolumePropertyNode()
static int DataFromString(const std::string &dataString, double *&data)
static std::string GetColorTransferFunctionString(vtkColorTransferFunction *function)
std::string GetRGBTransferFunctionAsString()
void SetGradientOpacityAsString(std::string)
void SetEffectiveRange(double range[2])
void SetEffectiveRange(double min, double max)
Set effective range.
static vtkMRMLVolumePropertyNode * New()
Create a new vtkMRMLVolumePropertyNode.
static int NodesFromString(const std::string &dataString, double *&data, int nodeSize)
void CopyParameterSet(vtkMRMLNode *node)
std::string GetScalarOpacityAsString()
void SetScalarOpacity(vtkPiecewiseFunction *newScalarOpacity, int component=0)
void SetColor(vtkColorTransferFunction *newColorFunction, int component=0)
std::string GetGradientOpacityAsString()
vtkPiecewiseFunction * GetGradientOpacity(int component=0)
bool CalculateEffectiveRange()
void ReadXMLAttributes(const char **atts) override
Set node attributes.
vtkPiecewiseFunction * GetScalarOpacity(int component=0)
void SetSpecularPower(double)
void PrintSelf(ostream &os, vtkIndent indent) override
static std::string DataToString(double *data, int size)
vtkMRMLNode * CreateNodeInstance() override
MRMLNode methods.
const char * GetNodeTagName() override
Get node XML tag name (like Volume, Model)
static void GetColorTransferFunctionFromString(const std::string &str, vtkColorTransferFunction *result)