ITK  4.2.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< class TComponentType = float >
35 class ITK_EXPORT SpatialObjectProperty:
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(void) 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(void) const;
60 
61  void SetGreen(TComponentType g);
62 
63  TComponentType GetGreen(void) const;
64 
65  void SetBlue(TComponentType b);
66 
67  TComponentType GetBlue(void) const;
68 
69  void SetAlpha(TComponentType a);
70 
71  TComponentType GetAlpha(void) const;
72 
74  virtual ~SpatialObjectProperty();
75 
76  void SetName(const char *name);
77 
78  StringType GetName(void) const;
79 
80  unsigned long GetMTime(void){ return m_MTime; }
81 protected:
82 
83  void PrintSelf(std::ostream & os, Indent indent) const;
84 
85  void Modified(void){ m_MTime++; }
86 private:
87  SpatialObjectProperty(const Self &); //purposely not implemented
88  void operator=(const Self &); //purposely not implemented
89 
92  unsigned long m_MTime;
93 };
94 }
95 
96 #ifndef ITK_MANUAL_INSTANTIATION
97 #include "itkSpatialObjectProperty.hxx"
98 #endif
99 
100 #endif // __SpatialObjectProperty_h
101