Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions

mitk::FloatLookupTablePropertyDeserializer Class Reference

Inheritance diagram for mitk::FloatLookupTablePropertyDeserializer:
Inheritance graph
[legend]
Collaboration diagram for mitk::FloatLookupTablePropertyDeserializer:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
FloatLookupTablePropertyDeserializer 
Self
typedef BasePropertyDeserializer Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual BaseProperty::Pointer Deserialize (TiXmlElement *element)

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 FloatLookupTablePropertyDeserializer ()
virtual ~FloatLookupTablePropertyDeserializer ()

Detailed Description

Definition at line 30 of file mitkFloatLookupTablePropertyDeserializer.cpp.


Member Typedef Documentation

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkFloatLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkFloatLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkFloatLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkFloatLookupTablePropertyDeserializer.cpp.


Constructor & Destructor Documentation

mitk::FloatLookupTablePropertyDeserializer::FloatLookupTablePropertyDeserializer (  ) [inline, protected]

Definition at line 59 of file mitkFloatLookupTablePropertyDeserializer.cpp.

{}
virtual mitk::FloatLookupTablePropertyDeserializer::~FloatLookupTablePropertyDeserializer (  ) [inline, protected, virtual]

Definition at line 60 of file mitkFloatLookupTablePropertyDeserializer.cpp.

{}

Member Function Documentation

virtual BaseProperty::Pointer mitk::FloatLookupTablePropertyDeserializer::Deserialize ( TiXmlElement element ) [inline, virtual]

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 37 of file mitkFloatLookupTablePropertyDeserializer.cpp.

References TiXmlNode::FirstChildElement(), mitk::FloatLookupTableProperty::New(), TiXmlNode::NextSiblingElement(), mitk::GenericLookupTable< T >::SetTableValue(), and TIXML_WRONG_TYPE.

    {
      if (!element) 
        return NULL;

      FloatLookupTable lut;
      for( TiXmlElement* child = element->FirstChildElement("LUTValue"); child != NULL; child = child->NextSiblingElement("LUTValue"))
      {

        int tempID;
        if (child->QueryIntAttribute("id", &tempID) == TIXML_WRONG_TYPE)
          return NULL; // TODO: can we do a better error handling?
        FloatLookupTable::IdentifierType id = static_cast<FloatLookupTable::IdentifierType>(tempID);
        float tempVal = -1.0;
        if (child->QueryFloatAttribute("value", &tempVal) == TIXML_WRONG_TYPE)
          return NULL; // TODO: can we do a better error handling?
        FloatLookupTable::ValueType val = static_cast<FloatLookupTable::ValueType>(tempVal);        
        lut.SetTableValue(id, val);
      }
      return FloatLookupTableProperty::New(lut).GetPointer();
    }
virtual const char* mitk::FloatLookupTablePropertyDeserializer::GetClassName (  ) const [virtual]

Reimplemented from mitk::BasePropertyDeserializer.

static Pointer mitk::FloatLookupTablePropertyDeserializer::New (  ) [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines