Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "mitkAnnotationProperty.h"
00020
00021 mitk::AnnotationProperty::AnnotationProperty()
00022 {
00023 }
00024
00025
00026 mitk::AnnotationProperty::AnnotationProperty(
00027 const char *label, const Point3D &position )
00028 : m_Label( "" ),
00029 m_Position( position )
00030 {
00031 if ( label != NULL )
00032 {
00033 m_Label = label;
00034 }
00035 }
00036
00037
00038 mitk::AnnotationProperty::AnnotationProperty(
00039 const std::string &label, const Point3D &position )
00040 : m_Label( label ),
00041 m_Position( position )
00042 {
00043 }
00044
00045
00046 mitk::AnnotationProperty::AnnotationProperty(
00047 const char *label, ScalarType x, ScalarType y, ScalarType z )
00048 : m_Label( "" )
00049 {
00050 if ( label != NULL )
00051 {
00052 m_Label = label;
00053 }
00054
00055 m_Position[0] = x;
00056 m_Position[1] = y;
00057 m_Position[2] = z;
00058 }
00059
00060
00061 mitk::AnnotationProperty::AnnotationProperty(
00062 const std::string &label, ScalarType x, ScalarType y, ScalarType z )
00063 : m_Label( label )
00064 {
00065 m_Position[0] = x;
00066 m_Position[1] = y;
00067 m_Position[2] = z;
00068 }
00069
00070
00071 const mitk::Point3D &mitk::AnnotationProperty::GetPosition() const
00072 {
00073 return m_Position;
00074 }
00075
00076
00077 void mitk::AnnotationProperty::SetPosition( const mitk::Point3D &position )
00078 {
00079 m_Position = position;
00080 }
00081
00082
00083 bool mitk::AnnotationProperty::operator==( const BaseProperty &property ) const
00084 {
00085 const Self *other = dynamic_cast< const Self * >( &property );
00086
00087 if ( other == NULL ) return false;
00088
00089 return ( (other->m_Label == m_Label )
00090 && (other->m_Position == m_Position ) );
00091 }
00092
00093
00094 std::string mitk::AnnotationProperty::GetValueAsString() const
00095 {
00096 std::stringstream myStr;
00097
00098 myStr << this->GetLabel() << this->GetPosition();
00099 return myStr.str();
00100 }