

Public Types | |
| typedef LevelWindowPropertyDeserializer | Self |
| typedef BasePropertyDeserializer | Superclass |
| typedef itk::SmartPointer< Self > | Pointer |
| 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 () |
Definition at line 30 of file mitkLevelWindowPropertyDeserializer.cpp.
| typedef itk::SmartPointer<const Self> mitk::LevelWindowPropertyDeserializer::ConstPointer |
Reimplemented from mitk::BasePropertyDeserializer.
Definition at line 34 of file mitkLevelWindowPropertyDeserializer.cpp.
| typedef itk::SmartPointer<Self> mitk::LevelWindowPropertyDeserializer::Pointer |
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.
| 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.
{}
| 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] |
1.7.2