Public Types | |
typedef LookupTablePropertySerializer | Self |
typedef BasePropertySerializer | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
virtual const char * | GetClassName () const |
virtual TiXmlElement * | Serialize () |
Serializes given BaseProperty object. | |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
LookupTablePropertySerializer () | |
virtual | ~LookupTablePropertySerializer () |
Definition at line 30 of file mitkLookupTablePropertySerializer.cpp.
typedef itk::SmartPointer<const Self> mitk::LookupTablePropertySerializer::ConstPointer |
Reimplemented from mitk::BasePropertySerializer.
Definition at line 34 of file mitkLookupTablePropertySerializer.cpp.
typedef itk::SmartPointer<Self> mitk::LookupTablePropertySerializer::Pointer |
Reimplemented from mitk::BasePropertySerializer.
Definition at line 34 of file mitkLookupTablePropertySerializer.cpp.
Reimplemented from mitk::BasePropertySerializer.
Definition at line 34 of file mitkLookupTablePropertySerializer.cpp.
Reimplemented from mitk::BasePropertySerializer.
Definition at line 34 of file mitkLookupTablePropertySerializer.cpp.
mitk::LookupTablePropertySerializer::LookupTablePropertySerializer | ( | ) | [inline, protected] |
Definition at line 110 of file mitkLookupTablePropertySerializer.cpp.
{}
virtual mitk::LookupTablePropertySerializer::~LookupTablePropertySerializer | ( | ) | [inline, protected, virtual] |
Definition at line 111 of file mitkLookupTablePropertySerializer.cpp.
{}
virtual const char* mitk::LookupTablePropertySerializer::GetClassName | ( | ) | const [virtual] |
Reimplemented from mitk::BasePropertySerializer.
static Pointer mitk::LookupTablePropertySerializer::New | ( | ) | [static] |
virtual TiXmlElement* mitk::LookupTablePropertySerializer::Serialize | ( | ) | [inline, virtual] |
Serializes given BaseProperty object.
This should be overwritten by specific sub-classes.
Reimplemented from mitk::BasePropertySerializer.
Definition at line 37 of file mitkLookupTablePropertySerializer.cpp.
References TiXmlNode::LinkEndChild(), TiXmlElement::SetAttribute(), and TiXmlElement::SetDoubleAttribute().
{ if (const LookupTableProperty* prop = dynamic_cast<const LookupTableProperty*>(m_Property.GetPointer())) { LookupTable::Pointer mitkLut = const_cast<LookupTableProperty*>(prop)->GetLookupTable(); if (mitkLut.IsNull()) return NULL; // really? vtkLookupTable* lut = mitkLut->GetVtkLookupTable(); if (!lut) return NULL; TiXmlElement* element = new TiXmlElement("LookupTable"); #if ( (VTK_MAJOR_VERSION < 5) && (VTK_MINOR_VERSION < 4) ) float* range; float* rgba; #else double* range; double* rgba; #endif element->SetAttribute("NumberOfColors", lut->GetNumberOfTableValues()); element->SetAttribute("Scale", lut->GetScale()); element->SetAttribute("Ramp", lut->GetRamp()); range = lut->GetHueRange(); TiXmlElement* child = new TiXmlElement("HueRange"); element->LinkEndChild( child ); child->SetDoubleAttribute("min", range[0]); child->SetDoubleAttribute("max", range[1]); range = lut->GetValueRange(); child = new TiXmlElement("ValueRange"); element->LinkEndChild( child ); child->SetDoubleAttribute("min", range[0]); child->SetDoubleAttribute("max", range[1]); range = lut->GetSaturationRange(); child = new TiXmlElement("SaturationRange"); element->LinkEndChild( child ); child->SetDoubleAttribute("min", range[0]); child->SetDoubleAttribute("max", range[1]); range = lut->GetAlphaRange(); child = new TiXmlElement("AlphaRange"); element->LinkEndChild( child ); child->SetDoubleAttribute("min", range[0]); child->SetDoubleAttribute("max", range[1]); range = lut->GetTableRange(); child = new TiXmlElement("TableRange"); element->LinkEndChild( child ); child->SetDoubleAttribute("min", range[0]); child->SetDoubleAttribute("max", range[1]); child = new TiXmlElement("Table"); element->LinkEndChild( child ); for ( int index = 0; index < lut->GetNumberOfTableValues(); ++index) { TiXmlElement* grandChildNinife = new TiXmlElement("RgbaColor"); rgba = lut->GetTableValue(index); grandChildNinife->SetDoubleAttribute("R", rgba[0]); grandChildNinife->SetDoubleAttribute("G", rgba[1]); grandChildNinife->SetDoubleAttribute("B", rgba[2]); grandChildNinife->SetDoubleAttribute("A", rgba[3]); child->LinkEndChild( grandChildNinife ); } return element; } else return NULL; }