Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkColorProperty.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkColorProperty_h
14 #define mitkColorProperty_h
15 
16 #include "mitkBaseProperty.h"
17 #include <MitkCoreExports.h>
18 #include <itkRGBPixel.h>
19 
20 namespace mitk
21 {
22 #ifdef _MSC_VER
23 #pragma warning(push)
24 #pragma warning(disable : 4522)
25 #endif
26 
35  typedef itk::RGBPixel<float> Color;
36 
48  {
49  protected:
51 
52  ColorProperty();
53 
54  ColorProperty(const ColorProperty &other);
55 
56  ColorProperty(const float red, const float green, const float blue);
57 
58  ColorProperty(const float color[3]);
59 
60  ColorProperty(const mitk::Color &color);
61 
62  public:
64  itkFactorylessNewMacro(Self);
65  itkCloneMacro(Self) mitkNewMacro1Param(ColorProperty, const float *);
67  mitkNewMacro3Param(ColorProperty, const float, const float, const float);
68 
69  typedef mitk::Color ValueType;
70 
71  const mitk::Color &GetColor() const;
72  const mitk::Color &GetValue() const;
73  std::string GetValueAsString() const override;
74  void SetColor(const mitk::Color &color);
75  void SetValue(const mitk::Color &color);
76  void SetColor(float red, float green, float blue);
77 
78  using BaseProperty::operator=;
79 
80  private:
81  // purposely not implemented
82  ColorProperty &operator=(const ColorProperty &);
83 
84  itk::LightObject::Pointer InternalClone() const override;
85 
86  bool IsEqual(const BaseProperty &property) const override;
87  bool Assign(const BaseProperty &property) override;
88  };
89 
90 #ifdef _MSC_VER
91 #pragma warning(pop)
92 #endif
93 
94 } // namespace mitk
95 
96 #endif
mitk::BaseProperty
Abstract base class for properties.
Definition: mitkBaseProperty.h:35
mitk::ColorProperty::ValueType
mitk::Color ValueType
Definition: mitkColorProperty.h:67
mitk::ColorProperty::m_Color
mitk::Color m_Color
Definition: mitkColorProperty.h:50
mitkNewMacro1Param
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:68
mitk::Color
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
Definition: mitkColorProperty.h:35
mitkNewMacro3Param
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Definition: mitkCommon.h:94
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::ColorProperty
The ColorProperty class RGB color property.
Definition: mitkColorProperty.h:47
MitkCoreExports.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitkBaseProperty.h
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15