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

mitk::IntLookupTablePropertySerializer Class Reference

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

List of all members.

Public Types

typedef
IntLookupTablePropertySerializer 
Self
typedef BasePropertySerializer Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual TiXmlElementSerialize ()
 Serializes given BaseProperty object.

Static Public Member Functions

static Pointer New ()

Protected Member Functions

 IntLookupTablePropertySerializer ()
virtual ~IntLookupTablePropertySerializer ()

Detailed Description

Definition at line 30 of file mitkIntLookupTablePropertySerializer.cpp.


Member Typedef Documentation

Reimplemented from mitk::BasePropertySerializer.

Definition at line 34 of file mitkIntLookupTablePropertySerializer.cpp.

Reimplemented from mitk::BasePropertySerializer.

Definition at line 34 of file mitkIntLookupTablePropertySerializer.cpp.

Reimplemented from mitk::BasePropertySerializer.

Definition at line 34 of file mitkIntLookupTablePropertySerializer.cpp.

Reimplemented from mitk::BasePropertySerializer.

Definition at line 34 of file mitkIntLookupTablePropertySerializer.cpp.


Constructor & Destructor Documentation

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

Definition at line 58 of file mitkIntLookupTablePropertySerializer.cpp.

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

Definition at line 59 of file mitkIntLookupTablePropertySerializer.cpp.

{}

Member Function Documentation

virtual const char* mitk::IntLookupTablePropertySerializer::GetClassName (  ) const [virtual]

Reimplemented from mitk::BasePropertySerializer.

static Pointer mitk::IntLookupTablePropertySerializer::New (  ) [static]
virtual TiXmlElement* mitk::IntLookupTablePropertySerializer::Serialize (  ) [inline, virtual]

Serializes given BaseProperty object.

Returns:
the filename of the newly created file.

This should be overwritten by specific sub-classes.

Reimplemented from mitk::BasePropertySerializer.

Definition at line 37 of file mitkIntLookupTablePropertySerializer.cpp.

References mitk::GenericLookupTable< T >::GetLookupTable(), mitk::GenericProperty< T >::GetValue(), TiXmlNode::LinkEndChild(), and TiXmlElement::SetAttribute().

    {
      const IntLookupTableProperty* prop = dynamic_cast<const IntLookupTableProperty*>(m_Property.GetPointer());
      if (prop == NULL)
        return NULL;
      IntLookupTable lut = prop->GetValue();
      //if (lut.IsNull()) 
      //  return NULL; // really?
      const IntLookupTable::LookupTableType& map = lut.GetLookupTable();

      TiXmlElement* element = new TiXmlElement("IntLookupTableTable");
      for (IntLookupTable::LookupTableType::const_iterator it = map.begin(); it != map.end(); ++it)
        {
          TiXmlElement* tableEntry = new TiXmlElement("LUTValue");
          tableEntry->SetAttribute("id", it->first);
          tableEntry->SetAttribute("value", it->second);
          element->LinkEndChild( tableEntry );
        }
        return element;
    }

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