Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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_HEADER_INCLUDED_C17953D1
14 #define MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1
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 
65  itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(ColorProperty, const float *);
66  mitkNewMacro1Param(ColorProperty, const mitk::Color &);
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 /* MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1 */
#define MITKCORE_EXPORT
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:72
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
The ColorProperty class RGB color property.
Abstract base class for properties.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Definition: mitkCommon.h:98