ITK  4.9.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 
23 #include "itkRGBAPixel.h"
24 #include "itkLightObject.h"
25 #include "itkObjectFactory.h"
26 
27 namespace itk
28 {
34 template< typename TComponentType = float >
36  public LightObject
37 {
38 public:
39 
43  typedef std::string StringType;
44 
47 
48  itkNewMacro(Self);
49  itkTypeMacro(SpatialObjectProperty, LightObject);
50 
51  const PixelType & GetColor() const;
52 
53  void SetColor(const PixelType & color);
54 
55  void SetColor(TComponentType r, TComponentType g, TComponentType b);
56 
57  void SetRed(TComponentType r);
58 
59  TComponentType GetRed() const;
60 
61  void SetGreen(TComponentType g);
62 
63  TComponentType GetGreen() const;
64 
65  void SetBlue(TComponentType b);
66 
67  TComponentType GetBlue() const;
68 
69  void SetAlpha(TComponentType a);
70 
71  TComponentType GetAlpha() const;
72 
74  virtual ~SpatialObjectProperty();
75 
76  void SetName(const char *name);
77 
78  StringType GetName() const;
79 
80  unsigned long GetMTime(void){ return m_MTime; }
81 
82 protected:
83 
84  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
85 
86  void Modified(void){ m_MTime++; }
87 
88 private:
89  SpatialObjectProperty(const Self &) ITK_DELETE_FUNCTION;
90  void operator=(const Self &) ITK_DELETE_FUNCTION;
91 
94  unsigned long m_MTime;
95 };
96 }
97 
98 #ifndef ITK_MANUAL_INSTANTIATION
99 #include "itkSpatialObjectProperty.hxx"
100 #endif
101 
102 #endif // __SpatialObjectProperty_h
StringType GetName() const
Light weight base class for most itk classes.
void SetBlue(TComponentType b)
SpatialObjectProperty< TComponentType > Self
const PixelType & GetColor() const
TComponentType GetRed() const
TComponentType GetBlue() const
void SetColor(const PixelType &color)
void SetName(const char *name)
virtual void PrintSelf(std::ostream &os, Indent indent) const override
void SetAlpha(TComponentType a)
TComponentType GetAlpha() const
RGBAPixel< TComponentType > PixelType
TComponentType GetGreen() const
void SetRed(TComponentType r)
SmartPointer< const Self > ConstPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void SetGreen(TComponentType g)