Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1
18 #define MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1
19 
20 #include "mitkBaseProperty.h"
21 #include <MitkCoreExports.h>
22 #include <itkRGBPixel.h>
23 
24 namespace mitk
25 {
26 #ifdef _MSC_VER
27 #pragma warning(push)
28 #pragma warning(disable : 4522)
29 #endif
30 
39  typedef itk::RGBPixel<float> Color;
40 
52  {
53  protected:
55 
56  ColorProperty();
57 
58  ColorProperty(const ColorProperty &other);
59 
60  ColorProperty(const float red, const float green, const float blue);
61 
62  ColorProperty(const float color[3]);
63 
64  ColorProperty(const mitk::Color &color);
65 
66  public:
68 
69  itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(ColorProperty, const float *);
70  mitkNewMacro1Param(ColorProperty, const mitk::Color &);
71  mitkNewMacro3Param(ColorProperty, const float, const float, const float);
72 
73  typedef mitk::Color ValueType;
74 
75  const mitk::Color &GetColor() const;
76  const mitk::Color &GetValue() const;
77  std::string GetValueAsString() const override;
78  void SetColor(const mitk::Color &color);
79  void SetValue(const mitk::Color &color);
80  void SetColor(float red, float green, float blue);
81 
82  using BaseProperty::operator=;
83 
84  private:
85  // purposely not implemented
86  ColorProperty &operator=(const ColorProperty &);
87 
88  virtual itk::LightObject::Pointer InternalClone() const override;
89 
90  virtual bool IsEqual(const BaseProperty &property) const override;
91  virtual bool Assign(const BaseProperty &property) override;
92  };
93 
94 #ifdef _MSC_VER
95 #pragma warning(pop)
96 #endif
97 
98 } // namespace mitk
99 
100 #endif /* MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1 */
#define MITKCORE_EXPORT
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:76
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:44
itk::RGBPixel< float > Color
Color Standard RGB color typedef (float)
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Definition: mitkCommon.h:102