ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSpatialObjectProperty.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkSpatialObjectProperty_h
19 #define itkSpatialObjectProperty_h
20 
21 #include <string>
22 #include <map>
23 
24 #include "itkLightObject.h"
25 #include "itkRGBAPixel.h"
26 #include "itkTimeStamp.h"
27 #include "itkObjectFactory.h"
28 
29 namespace itk
30 {
37 {
38 public:
39 
41 
42  virtual ~SpatialObjectProperty() = default;
43 
45 
47 
48  void SetColor( const ColorType & color )
49  { m_Color = color; }
50 
52  { return m_Color; }
53 
54  const ColorType & GetColor() const
55  { return m_Color; }
56 
57  void SetColor(double r, double g, double b);
58 
59  void SetRed(double r);
60  double GetRed() const;
61 
62  void SetGreen(double g);
63  double GetGreen() const;
64 
65  void SetBlue(double b);
66  double GetBlue() const;
67 
68  void SetAlpha(double a);
69  double GetAlpha() const;
70 
71  void SetName( const std::string & name )
72  { m_Name = name; }
73 
74  std::string & GetName()
75  { return m_Name; }
76 
77  const std::string & GetName() const
78  { return m_Name; }
79 
80  void SetTagScalarValue( const std::string & tag, double value );
81  void SetTagStringValue( const std::string & tag, const std::string & value );
82 
83  bool GetTagScalarValue( const std::string & tag, double & value ) const;
84  bool GetTagStringValue( const std::string & tag, std::string & value ) const;
85 
86  std::map< std::string, double > & GetTagScalarDictionary();
87  const std::map< std::string, double > & GetTagScalarDictionary() const;
88  std::map< std::string, std::string > & GetTagStringDictionary();
89  const std::map< std::string, std::string > & GetTagStringDictionary() const;
90 
91  void SetTagScalarDictionary( const std::map< std::string, double > & dict );
92  void SetTagStringDictionary( const std::map< std::string,
93  std::string > & dict );
94 
95  void Print(std::ostream & os) const
96  { this->PrintSelf( os, 3 ); }
97 
98  Self & operator=(const SpatialObjectProperty & rhs );
99 
100 protected:
101 
102  void PrintSelf(std::ostream & os, Indent indent) const;
103 
104 private:
105 
107 
108  std::string m_Name;
109 
110  std::map< std::string, double > m_ScalarDictionary;
111  std::map< std::string, std::string > m_StringDictionary;
112 };
113 
114 }
115 
116 #endif // __SpatialObjectProperty_h
bool GetTagScalarValue(const std::string &tag, double &value) const
void SetName(const std::string &name)
Self & operator=(const SpatialObjectProperty &rhs)
const ColorType & GetColor() const
void SetTagScalarDictionary(const std::map< std::string, double > &dict)
void SetColor(const ColorType &color)
void SetTagStringDictionary(const std::map< std::string, std::string > &dict)
void PrintSelf(std::ostream &os, Indent indent) const
std::map< std::string, double > m_ScalarDictionary
virtual ~SpatialObjectProperty()=default
bool GetTagStringValue(const std::string &tag, std::string &value) const
double GetAlpha() const
const std::string & GetName() const
void Print(std::ostream &os) const
void SetTagScalarValue(const std::string &tag, double value)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
std::map< std::string, double > & GetTagScalarDictionary()
void SetTagStringValue(const std::string &tag, const std::string &value)
std::map< std::string, std::string > & GetTagStringDictionary()
double GetGreen() const
std::map< std::string, std::string > m_StringDictionary