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

mitk::IntLookupTablePropertyDeserializer Class Reference

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

List of all members.

Public Types

typedef
IntLookupTablePropertyDeserializer 
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

 IntLookupTablePropertyDeserializer ()
virtual ~IntLookupTablePropertyDeserializer ()

Detailed Description

Definition at line 30 of file mitkIntLookupTablePropertyDeserializer.cpp.


Member Typedef Documentation

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkIntLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkIntLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkIntLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkIntLookupTablePropertyDeserializer.cpp.


Constructor & Destructor Documentation

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

Definition at line 58 of file mitkIntLookupTablePropertyDeserializer.cpp.

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

Definition at line 59 of file mitkIntLookupTablePropertyDeserializer.cpp.

{}

Member Function Documentation

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

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 37 of file mitkIntLookupTablePropertyDeserializer.cpp.

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

    {
      if (!element) 
        return NULL;

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

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

Reimplemented from mitk::BasePropertyDeserializer.

static Pointer mitk::IntLookupTablePropertyDeserializer::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