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

mitk::GenericProperty< T > Class Template Reference

#include <mitkGenericProperty.h>

Inheritance diagram for mitk::GenericProperty< T >:
Inheritance graph
[legend]
Collaboration diagram for mitk::GenericProperty< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef GenericProperty Self
typedef BaseProperty Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer
typedef T ValueType

Public Member Functions

virtual const char * GetClassName () const
virtual ~GenericProperty ()
virtual void SetValue (T _arg)
virtual T GetValue () const
virtual bool operator== (const BaseProperty &other) const
 Subclasses must implement this operator==. Operator== which is used by PropertyList to check whether a property has been changed.
virtual std::string GetValueAsString () const
virtual bool Assignable (const BaseProperty &other) const
virtual BasePropertyoperator= (const BaseProperty &other)

Static Public Member Functions

static Pointer New (T _arg)

Protected Member Functions

 GenericProperty ()
 GenericProperty (T x)

Protected Attributes

m_Value

Detailed Description

template<typename T>
class mitk::GenericProperty< T >

@ brief Template class for generating properties for int, float, bool, etc.

This class template can be instantiated for all classes/internal types that fulfills these requirements:

Note: you must use the macro mitkSpecializeGenericProperty to provide specializations for concrete types (e.g. BoolProperty). Please see mitkProperties.h for examples. If you don't use the mitkSpecializeGenericProperty Macro, GetNameOfClass() returns a wrong name.

Definition at line 46 of file mitkGenericProperty.h.


Member Typedef Documentation

template<typename T>
typedef itk::SmartPointer<const Self> mitk::GenericProperty< T >::ConstPointer
template<typename T>
typedef itk::SmartPointer<Self> mitk::GenericProperty< T >::Pointer
template<typename T>
typedef GenericProperty mitk::GenericProperty< T >::Self
template<typename T>
typedef BaseProperty mitk::GenericProperty< T >::Superclass
template<typename T>
typedef T mitk::GenericProperty< T >::ValueType

Definition at line 51 of file mitkGenericProperty.h.


Constructor & Destructor Documentation

template<typename T>
virtual mitk::GenericProperty< T >::~GenericProperty (  ) [inline, virtual]

Definition at line 55 of file mitkGenericProperty.h.

    {
    }
template<typename T>
mitk::GenericProperty< T >::GenericProperty (  ) [inline, protected]

Definition at line 119 of file mitkGenericProperty.h.

{}
template<typename T>
mitk::GenericProperty< T >::GenericProperty ( x ) [inline, protected]

Definition at line 120 of file mitkGenericProperty.h.

       : m_Value(x) {}

Member Function Documentation

template<typename T>
virtual bool mitk::GenericProperty< T >::Assignable ( const BaseProperty  ) const [inline, virtual]

Should be implemented by subclasses to indicate whether they can accept the parameter as the right-hand-side argument of an assignment. This test will most probably include some dynamic_cast.

Reimplemented from mitk::BaseProperty.

Definition at line 85 of file mitkGenericProperty.h.

    {
      try
      {
        dynamic_cast<const Self&>(other); // dear compiler, please don't optimize this away!
        return true;
      }
      catch (std::bad_cast)
      {
      }
      return false;
    }
template<typename T>
virtual const char* mitk::GenericProperty< T >::GetClassName (  ) const [virtual]
template<typename T>
virtual T mitk::GenericProperty< T >::GetValue (  ) const [virtual]

Referenced by mitk::PointSetVtkMapper3D::ApplyProperties(), mitk::EnhancedPointSetVtkMapper3D::ApplyProperties(), mitk::PointSetVtkMapper3D::CreateContour(), mitk::PointSetVtkMapper3D::CreateVTKRenderObjects(), QmitkNumberPropertyView::DisplayNumber(), QmitkNumberPropertySlider::DisplayNumber(), QmitkNumberPropertyEditor::DisplayNumber(), mitk::PointSelectorInteractor::ExecuteAction(), mitk::PointInteractor::ExecuteAction(), mitk::MoveSurfaceInteractor::ExecuteAction(), QmitkPropertyListPopup::fillPopup(), mitk::PointSetVtkMapper3D::GenerateData(), mitk::MeshVtkMapper3D::GenerateData(), mitk::ImageMapperGL2D::GenerateData(), mitk::DopplerToStrainRateFilter::GenerateData(), mitk::CylindricToCartesianFilter::GenerateData(), mitk::AngleCorrectByPointFilter::GenerateData(), mitk::CylindricToCartesianFilter::GenerateOutputInformation(), mitk::PropertyList::GetBoolProperty(), mitk::DataNode::GetBoolProperty(), mitk::PropertyList::GetFloatProperty(), mitk::DataNode::GetFloatProperty(), mitk::PropertyList::GetIntProperty(), mitk::DataNode::GetIntProperty(), mitk::DataNode::GetOpacity(), mitk::NonBlockingAlgorithm::GetParameter(), mitk::PropertyList::GetPropertyValue(), mitk::DataNode::GetPropertyValue(), mitk::PlanarCross::GetSingleLineMode(), mitk::GenericProperty< StringLookupTable >::GetValueAsString(), mitk::PlanarFigure::IsClosed(), QmitkRenderWindowMenu::OnCrossHairMenuAboutToShow(), mitk::VectorImageMapper2D::Paint(), QmitkBoolPropertyView::PropertyChanged(), mitk::StringLookupTablePropertySerializer::Serialize(), mitk::IntLookupTablePropertySerializer::Serialize(), mitk::FloatLookupTablePropertySerializer::Serialize(), mitk::BoolLookupTablePropertySerializer::Serialize(), and mitkRenderingManagerTestClass::TestPropertyList().

template<typename T>
virtual std::string mitk::GenericProperty< T >::GetValueAsString (  ) const [inline, virtual]

Reimplemented from mitk::BaseProperty.

Definition at line 78 of file mitkGenericProperty.h.

    {
      std::stringstream myStr;
      myStr << GetValue() ;
      return myStr.str(); 
    }
template<typename T>
static Pointer mitk::GenericProperty< T >::New ( _arg ) [inline, static]
template<typename T>
virtual BaseProperty& mitk::GenericProperty< T >::operator= ( const BaseProperty rhs ) [inline, virtual]

To be implemented more meaningful by subclasses. This version just accepts the assignment of BaseProperty objects to others, but the assignment has NO MEANING, values are not changed at all!

Reimplemented from mitk::BaseProperty.

Definition at line 98 of file mitkGenericProperty.h.

    {
      try
      {
        const Self& otherProp( dynamic_cast<const Self&>(other) );

        if (this->m_Value != otherProp.m_Value)
        {
          this->m_Value = otherProp.m_Value;
          this->Modified();
        }
      }
      catch (std::bad_cast)
      {
        // nothing to do then
      }

      return *this;
     }
template<typename T>
virtual bool mitk::GenericProperty< T >::operator== ( const BaseProperty property ) const [inline, virtual]

Subclasses must implement this operator==. Operator== which is used by PropertyList to check whether a property has been changed.

Implements mitk::BaseProperty.

Definition at line 62 of file mitkGenericProperty.h.

    {
      try
      {
        const Self *otherProp = dynamic_cast<const Self*>(&other);
        if(otherProp==NULL) return false;
        if (this->m_Value == otherProp->m_Value) return true;
      }
      catch (std::bad_cast)
      {
        // nothing to do now - just return false
      }

      return false;
    }
template<typename T>
virtual void mitk::GenericProperty< T >::SetValue ( _arg ) [virtual]

Member Data Documentation

template<typename T>
T mitk::GenericProperty< T >::m_Value [protected]

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