Medical Imaging Interaction Toolkit  2023.12.99-7a59bd54
Medical Imaging Interaction Toolkit
mitk::ColorProperty Class Reference

The ColorProperty class RGB color property. More...

#include <mitkColorProperty.h>

Inheritance diagram for mitk::ColorProperty:
Collaboration diagram for mitk::ColorProperty:

Public Types

typedef ColorProperty Self
 
typedef BaseProperty Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::Color ValueType
 
- Public Types inherited from mitk::BaseProperty
typedef BaseProperty Self
 
typedef itk::Object Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
const mitk::ColorGetColor () const
 
const mitk::ColorGetValue () const
 
std::string GetValueAsString () const override
 
void SetColor (const mitk::Color &color)
 
void SetValue (const mitk::Color &color)
 
void SetColor (float red, float green, float blue)
 
bool ToJSON (nlohmann::json &j) const override
 Serialize property value(s) to JSON. More...
 
bool FromJSON (const nlohmann::json &j) override
 Deserialize property value(s) from JSON. More...
 
BasePropertyoperator= (const BaseProperty &property)
 Assigns property to this BaseProperty instance. More...
 
- Public Member Functions inherited from mitk::BaseProperty
Pointer Clone () const
 
bool operator== (const BaseProperty &property) const
 Subclasses must implement IsEqual(const BaseProperty&) to support comparison. More...
 
BasePropertyoperator= (const BaseProperty &property)
 Assigns property to this BaseProperty instance. More...
 
bool AssignProperty (const BaseProperty &property)
 Assigns property to this BaseProperty instance. More...
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
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)
 
- Static Public Member Functions inherited from mitk::BaseProperty
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 ColorProperty ()
 
 ColorProperty (const ColorProperty &other)
 
 ColorProperty (const float red, const float green, const float blue)
 
 ColorProperty (const float color[3])
 
 ColorProperty (const mitk::Color &color)
 
- Protected Member Functions inherited from mitk::BaseProperty
 BaseProperty ()
 
 BaseProperty (const BaseProperty &other)
 
 ~BaseProperty () override
 

Protected Attributes

mitk::Color m_Color
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::BaseProperty
static const std::string VALUE_CANNOT_BE_CONVERTED_TO_STRING
 Default return value if a property which can not be returned as string. More...
 

Detailed Description

The ColorProperty class RGB color property.

Note
If you want to apply the mitk::ColorProperty to an mitk::Image make sure to set the mitk::RenderingModeProperty to a mode which supports color (e.g. LEVELWINDOW_COLOR). For an example how to use the mitk::ColorProperty see mitkImageVtkMapper2DColorTest.cpp in Core/Code/Rendering.

Definition at line 50 of file mitkColorProperty.h.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ Self

Definition at line 66 of file mitkColorProperty.h.

◆ Superclass

◆ ValueType

Constructor & Destructor Documentation

◆ ColorProperty() [1/5]

mitk::ColorProperty::ColorProperty ( )
protected

◆ ColorProperty() [2/5]

mitk::ColorProperty::ColorProperty ( const ColorProperty other)
protected

◆ ColorProperty() [3/5]

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

◆ ColorProperty() [4/5]

mitk::ColorProperty::ColorProperty ( const float  color[3])
protected

◆ ColorProperty() [5/5]

mitk::ColorProperty::ColorProperty ( const mitk::Color color)
protected

Member Function Documentation

◆ Clone()

Pointer mitk::ColorProperty::Clone ( ) const

◆ FromJSON()

bool mitk::ColorProperty::FromJSON ( const nlohmann::json j)
overridevirtual

Deserialize property value(s) from JSON.

Rely on exceptions for error handling when implementing deserialization.

Returns
False if not deserializable by design, true otherwise.

Implements mitk::BaseProperty.

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::ColorProperty::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::BaseProperty.

Definition at line 66 of file mitkColorProperty.h.

◆ GetClassName()

virtual const char* mitk::ColorProperty::GetClassName ( ) const
virtual

Reimplemented from mitk::BaseProperty.

◆ GetColor()

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

◆ GetStaticNameOfClass()

static const char* mitk::ColorProperty::GetStaticNameOfClass ( )
inlinestatic

Definition at line 66 of file mitkColorProperty.h.

◆ GetValue()

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

◆ GetValueAsString()

std::string mitk::ColorProperty::GetValueAsString ( ) const
overridevirtual

Reimplemented from mitk::BaseProperty.

◆ New() [1/4]

static Pointer mitk::ColorProperty::New ( )
static

◆ New() [2/4]

static Pointer mitk::ColorProperty::New ( const float *  _arg)
inlinestatic

Definition at line 68 of file mitkColorProperty.h.

◆ New() [3/4]

static Pointer mitk::ColorProperty::New ( const float  _arga,
const float  _argb,
const float  _argc 
)
inlinestatic

Definition at line 70 of file mitkColorProperty.h.

◆ New() [4/4]

static Pointer mitk::ColorProperty::New ( const mitk::Color _arg)
inlinestatic

Definition at line 69 of file mitkColorProperty.h.

◆ operator=()

BaseProperty& mitk::BaseProperty::operator=

Assigns property to this BaseProperty instance.

Subclasses must implement Assign(const BaseProperty&) and call the superclass Assign method for proper handling of polymorphic assignments. The assignment operator of the subclass should be disabled and the baseclass operator should be made visible using "using" statements.

◆ SetColor() [1/2]

void mitk::ColorProperty::SetColor ( const mitk::Color color)

◆ SetColor() [2/2]

void mitk::ColorProperty::SetColor ( float  red,
float  green,
float  blue 
)

◆ SetValue()

void mitk::ColorProperty::SetValue ( const mitk::Color color)

◆ ToJSON()

bool mitk::ColorProperty::ToJSON ( nlohmann::json j) const
overridevirtual

Serialize property value(s) to JSON.

Rely on exceptions for error handling when implementing serialization.

Returns
False if not serializable by design, true otherwise.

Implements mitk::BaseProperty.

Member Data Documentation

◆ m_Color

mitk::Color mitk::ColorProperty::m_Color
protected

Definition at line 53 of file mitkColorProperty.h.


The documentation for this class was generated from the following file: