00001 #include "mitkPlanarFigureControlPointStyleProperty.h" 00002 00003 mitk::PlanarFigureControlPointStyleProperty::PlanarFigureControlPointStyleProperty( ) 00004 { 00005 this->AddEnumTypes(); 00006 this->SetValue( static_cast<IdType> ( Square ) ); 00007 } 00008 00009 mitk::PlanarFigureControlPointStyleProperty::PlanarFigureControlPointStyleProperty( const IdType &value ) 00010 { 00011 this->AddEnumTypes(); 00012 if ( this->IsValidEnumerationValue( value ) ) 00013 { 00014 this->SetValue( value ) ; 00015 } 00016 else 00017 { 00018 this->SetValue( static_cast<IdType> ( Square ) ); 00019 } 00020 } 00021 00022 mitk::PlanarFigureControlPointStyleProperty::PlanarFigureControlPointStyleProperty( const std::string &value ) 00023 { 00024 this->AddEnumTypes(); 00025 if ( this->IsValidEnumerationValue( value ) ) 00026 { 00027 this->SetValue( value ); 00028 } 00029 else 00030 { 00031 this->SetValue( static_cast<IdType>( Square ) ); 00032 } 00033 } 00034 00035 00036 00037 void mitk::PlanarFigureControlPointStyleProperty::AddEnumTypes() 00038 { 00039 this->AddEnum( "Square", static_cast<IdType>( Square ) ); 00040 this->AddEnum( "Circle", static_cast<IdType>( Circle ) ); 00041 } 00042 00043 00044 bool mitk::PlanarFigureControlPointStyleProperty::AddEnum( const std::string& name, const IdType& id ) 00045 { 00046 return Superclass::AddEnum( name, id ); 00047 } 00048 00049 mitk::PlanarFigureControlPointStyleProperty::Shape mitk::PlanarFigureControlPointStyleProperty::GetShape() 00050 { 00051 return static_cast<mitk::PlanarFigureControlPointStyleProperty::Shape>( this->GetValueAsId() ); 00052 } 00053 00054 00055 void mitk::PlanarFigureControlPointStyleProperty::SetShape(mitk::PlanarFigureControlPointStyleProperty::Shape shape) 00056 { 00057 this->SetValue( static_cast<IdType>( shape ) ); 00058 } 00059 00060