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

mitk::StringLookupTablePropertyDeserializer Class Reference

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

List of all members.

Public Types

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

 StringLookupTablePropertyDeserializer ()
virtual ~StringLookupTablePropertyDeserializer ()

Detailed Description

Definition at line 30 of file mitkStringLookupTablePropertyDeserializer.cpp.


Member Typedef Documentation

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkStringLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkStringLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkStringLookupTablePropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkStringLookupTablePropertyDeserializer.cpp.


Constructor & Destructor Documentation

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

Definition at line 59 of file mitkStringLookupTablePropertyDeserializer.cpp.

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

Definition at line 60 of file mitkStringLookupTablePropertyDeserializer.cpp.

{}

Member Function Documentation

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

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 37 of file mitkStringLookupTablePropertyDeserializer.cpp.

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

    {
      if (!element) 
        return NULL;

      StringLookupTable 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?
        StringLookupTable::IdentifierType id = static_cast<StringLookupTable::IdentifierType>(temp);
        
        if (child->Attribute("value") == NULL)
          return NULL; // TODO: can we do a better error handling?
        StringLookupTable::ValueType val = child->Attribute("value");
        lut.SetTableValue(id, val);
      }
      return StringLookupTableProperty::New(lut).GetPointer();
    }
virtual const char* mitk::StringLookupTablePropertyDeserializer::GetClassName (  ) const [virtual]

Reimplemented from mitk::BasePropertyDeserializer.

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