ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkSpatialObjectProperty.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkSpatialObjectProperty_h
00019 #define __itkSpatialObjectProperty_h
00020 
00021 #include <string>
00022 
00023 #include "itkRGBAPixel.h"
00024 #include "itkLightObject.h"
00025 #include "itkObjectFactory.h"
00026 
00027 namespace itk
00028 {
00034 template< class TComponentType = float >
00035 class ITK_EXPORT SpatialObjectProperty:
00036   public LightObject
00037 {
00038 public:
00039 
00040   typedef SpatialObjectProperty< TComponentType > Self;
00041   typedef LightObject                             Superclass;
00042   typedef RGBAPixel< TComponentType >             PixelType;
00043   typedef std::string                             StringType;
00044 
00045   typedef SmartPointer< Self >       Pointer;
00046   typedef SmartPointer< const Self > ConstPointer;
00047 
00048   itkNewMacro(Self);
00049   itkTypeMacro(SpatialObjectProperty, LightObject);
00050 
00051   const PixelType & GetColor(void) const;
00052 
00053   void SetColor(const PixelType & color);
00054 
00055   void SetColor(TComponentType r, TComponentType g, TComponentType b);
00056 
00057   void SetRed(TComponentType r);
00058 
00059   TComponentType GetRed(void) const;
00060 
00061   void SetGreen(TComponentType g);
00062 
00063   TComponentType GetGreen(void) const;
00064 
00065   void SetBlue(TComponentType b);
00066 
00067   TComponentType GetBlue(void) const;
00068 
00069   void SetAlpha(TComponentType a);
00070 
00071   TComponentType GetAlpha(void) const;
00072 
00073   SpatialObjectProperty();
00074   virtual ~SpatialObjectProperty();
00075 
00076   void SetName(const char *name);
00077 
00078   StringType GetName(void) const;
00079 
00080   unsigned long GetMTime(void){ return m_MTime; }
00081 protected:
00082 
00083   void PrintSelf(std::ostream & os, Indent indent) const;
00084 
00085   void Modified(void){ m_MTime++; }
00086 private:
00087   SpatialObjectProperty(const Self &); //purposely not implemented
00088   void operator=(const Self &);        //purposely not implemented
00089 
00090   PixelType     m_Color;
00091   StringType    m_Name;
00092   unsigned long m_MTime;
00093 };
00094 }
00095 
00096 #ifndef ITK_MANUAL_INSTANTIATION
00097 #include "itkSpatialObjectProperty.hxx"
00098 #endif
00099 
00100 #endif // __SpatialObjectProperty_h
00101