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

mitk::ColorProperty Class Reference
[Data Management Classes]

RGB color property. More...

#include <mitkColorProperty.h>

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

List of all members.

Public Types

typedef ColorProperty Self
typedef BaseProperty Superclass
typedef itk::SmartPointer< SelfPointer
typedef itk::SmartPointer
< const Self
ConstPointer

Public Member Functions

virtual const char * GetClassName () const
virtual ~ColorProperty ()
virtual bool Assignable (const BaseProperty &other) const
virtual BasePropertyoperator= (const BaseProperty &other)
virtual bool operator== (const BaseProperty &property) const
 Subclasses must implement this operator==. Operator== which is used by PropertyList to check whether a property has been changed.
const mitk::ColorGetColor () const
const mitk::ColorGetValue () const
std::string GetValueAsString () const
void SetColor (const mitk::Color &color)
void SetColor (float red, float green, float blue)

Static Public Member Functions

static Pointer New ()
static Pointer New (const float *_arg)
static Pointer New (const mitk::Color &_arg)
static Pointer New (const float _arga, const float _argb, const float _argc)

Protected Member Functions

 ColorProperty ()
 ColorProperty (const float red, const float green, const float blue)
 ColorProperty (const float color[3])
 ColorProperty (const mitk::Color &color)

Protected Attributes

mitk::Color m_Color

Detailed Description

RGB color property.

Examples:

mitkMoveSurfaceInteractor.cpp.

Definition at line 39 of file mitkColorProperty.h.


Member Typedef Documentation

typedef itk::SmartPointer<const Self> mitk::ColorProperty::ConstPointer

Reimplemented from mitk::BaseProperty.

Definition at line 54 of file mitkColorProperty.h.

typedef itk::SmartPointer<Self> mitk::ColorProperty::Pointer

Reimplemented from mitk::BaseProperty.

Definition at line 54 of file mitkColorProperty.h.

Reimplemented from mitk::BaseProperty.

Definition at line 54 of file mitkColorProperty.h.

Reimplemented from mitk::BaseProperty.

Definition at line 54 of file mitkColorProperty.h.


Constructor & Destructor Documentation

mitk::ColorProperty::ColorProperty (  ) [protected]

Definition at line 22 of file mitkColorProperty.cpp.

: m_Color()
{

}
mitk::ColorProperty::ColorProperty ( const float  red,
const float  green,
const float  blue 
) [protected]

Definition at line 33 of file mitkColorProperty.cpp.

{
  m_Color.Set(red, green, blue);
}
mitk::ColorProperty::ColorProperty ( const float  color[3] ) [protected]

Definition at line 28 of file mitkColorProperty.cpp.

                                                     : m_Color(color)
{

}
mitk::ColorProperty::ColorProperty ( const mitk::Color color ) [protected]

Definition at line 38 of file mitkColorProperty.cpp.

                                                        : m_Color(color)
{

}
mitk::ColorProperty::~ColorProperty (  ) [virtual]

Definition at line 43 of file mitkColorProperty.cpp.

{
}

Member Function Documentation

bool mitk::ColorProperty::Assignable ( const BaseProperty  ) const [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 47 of file mitkColorProperty.cpp.

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

Reimplemented from mitk::BaseProperty.

const mitk::Color & mitk::ColorProperty::GetColor (  ) const
const mitk::Color & mitk::ColorProperty::GetValue (  ) const

Definition at line 118 of file mitkColorProperty.cpp.

{
    return GetColor();
}
std::string mitk::ColorProperty::GetValueAsString (  ) const [virtual]

Reimplemented from mitk::BaseProperty.

Definition at line 113 of file mitkColorProperty.cpp.

                                                    {
  std::stringstream myStr;
  myStr << GetValue() ;
  return myStr.str(); 
}
static Pointer mitk::ColorProperty::New (  ) [static]
Examples:
mitkMoveSurfaceInteractor.cpp, and Step6RegionGrowing.txx.

Referenced by mitk::BinaryThresholdTool::BinaryThresholdTool(), mitk::BinaryThresholdULTool::BinaryThresholdULTool(), QmitkDataManagerView::ColorChanged(), QmitkImageCropper::CreateBoundingObject(), QmitkBoundingObjectWidget::CreateBoundingObject(), QmitkThresholdComponent::CreateSegmentationNode(), mitk::Tool::CreateSegmentationNode(), mitk::DataNodeFactory::DefaultColorForOrgan(), mitk::ColorPropertyDeserializer::Deserialize(), mitk::MoveSurfaceInteractor::ExecuteAction(), mitk::AffineInteractor::ExecuteAction(), QmitkPointBasedRegistrationView::FixedSelected(), QmitkScalarBarOverlay::GetProperties(), QmitkTextOverlay::GetTextProperties(), QmitkRegionGrowingView::ItkImageProcessing(), mitkPropertySerializationTest(), QmitkPointBasedRegistrationView::MovingSelected(), QmitkIGTExampleView::OnPlayingToggle(), QmitkIGTExampleView::OnTestNavigation(), QmitkSlicesInterpolator::QmitkSlicesInterpolator(), RegionGrowing(), mitk::DataNode::SetColor(), mitk::UnstructuredGridVtkMapper3D::SetDefaultProperties(), mitk::SurfaceVtkMapper3D::SetDefaultProperties(), mitk::SurfaceGLMapper2D::SetDefaultProperties(), mitk::PointSetVtkMapper3D::SetDefaultProperties(), mitk::ImageMapperGL2D::SetDefaultProperties(), mitk::EnhancedPointSetVtkMapper3D::SetDefaultProperties(), mitk::FeedbackContourTool::SetFeedbackContourColor(), mitk::FeedbackContourTool::SetFeedbackContourColorDefault(), QmitkIGTRecorderView::SetupIGTPipeline(), and TestDataStorage().

static Pointer mitk::ColorProperty::New ( const mitk::Color _arg ) [inline, static]

Definition at line 58 of file mitkColorProperty.h.

static Pointer mitk::ColorProperty::New ( const float  _arga,
const float  _argb,
const float  _argc 
) [inline, static]

Definition at line 59 of file mitkColorProperty.h.

static Pointer mitk::ColorProperty::New ( const float *  _arg ) [inline, static]

Definition at line 57 of file mitkColorProperty.h.

mitk::BaseProperty & mitk::ColorProperty::operator= ( const BaseProperty rhs ) [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 60 of file mitkColorProperty.cpp.

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

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

  return *this;
 }
bool mitk::ColorProperty::operator== ( const BaseProperty property ) const [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 81 of file mitkColorProperty.cpp.

{
  try
  {
    const Self& other = dynamic_cast<const Self&>(property);
    return other.m_Color == m_Color;
  }
  catch (std::bad_cast&)
  {
    return false;
  }
}
void mitk::ColorProperty::SetColor ( float  red,
float  green,
float  blue 
)

Definition at line 108 of file mitkColorProperty.cpp.

{
  m_Color.Set(red, green, blue);
}
void mitk::ColorProperty::SetColor ( const mitk::Color color )

Definition at line 99 of file mitkColorProperty.cpp.

Referenced by QmitkPropertyListPopup::onColorClicked().

{
    if(m_Color!=color)
    {
        m_Color = color;
        Modified();
    }
}

Member Data Documentation

Definition at line 42 of file mitkColorProperty.h.


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