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

mitk::LevelWindowPropertyDeserializer Class Reference

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

List of all members.

Public Types

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

 LevelWindowPropertyDeserializer ()
virtual ~LevelWindowPropertyDeserializer ()

Detailed Description

Definition at line 30 of file mitkLevelWindowPropertyDeserializer.cpp.


Member Typedef Documentation

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkLevelWindowPropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkLevelWindowPropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkLevelWindowPropertyDeserializer.cpp.

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 34 of file mitkLevelWindowPropertyDeserializer.cpp.


Constructor & Destructor Documentation

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

Definition at line 76 of file mitkLevelWindowPropertyDeserializer.cpp.

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

Definition at line 77 of file mitkLevelWindowPropertyDeserializer.cpp.

{}

Member Function Documentation

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

Reimplemented from mitk::BasePropertyDeserializer.

Definition at line 37 of file mitkLevelWindowPropertyDeserializer.cpp.

References TiXmlElement::Attribute(), TiXmlNode::FirstChildElement(), mitk::LevelWindowProperty::New(), TiXmlElement::QueryFloatAttribute(), mitk::LevelWindow::SetDefaultLevelWindow(), mitk::LevelWindow::SetFixed(), mitk::LevelWindow::SetLevelWindow(), mitk::LevelWindow::SetRangeMinMax(), and TIXML_SUCCESS.

    {
      if (!element) return NULL;

      bool isFixed(false);
      if (element->Attribute("fixed"))
        isFixed = std::string(element->Attribute("fixed")) == "true";

      float level;
      float window;
      TiXmlElement* child = element->FirstChildElement("CurrentSettings");
        if ( child->QueryFloatAttribute( "level", &level ) != TIXML_SUCCESS ) return NULL;
        if ( child->QueryFloatAttribute( "window", &window ) != TIXML_SUCCESS ) return NULL;

      float defaultLevel;
      float defaultWindow;
                    child = element->FirstChildElement("DefaultSettings");
        if ( child->QueryFloatAttribute( "level", &defaultLevel ) != TIXML_SUCCESS ) return NULL;
        if ( child->QueryFloatAttribute( "window", &defaultWindow ) != TIXML_SUCCESS ) return NULL;

      float minRange;
      float maxRange;
                    child = element->FirstChildElement("CurrentRange");
        if ( child->QueryFloatAttribute( "min", &minRange ) != TIXML_SUCCESS ) return NULL;
        if ( child->QueryFloatAttribute( "max", &maxRange ) != TIXML_SUCCESS ) return NULL;


        
      LevelWindow lw;
      lw.SetRangeMinMax( minRange, maxRange );
      lw.SetDefaultLevelWindow( defaultLevel, defaultWindow );
      lw.SetLevelWindow( level, window );
      lw.SetFixed( isFixed );

      return LevelWindowProperty::New( lw ).GetPointer();
    }
virtual const char* mitk::LevelWindowPropertyDeserializer::GetClassName (  ) const [virtual]

Reimplemented from mitk::BasePropertyDeserializer.

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