00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkSpatialObjectProperty.h,v $ 00005 Language: C++ 00006 Date: $Date: 2007-01-28 19:24:57 $ 00007 Version: $Revision: 1.12 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef __itkSpatialObjectProperty_h 00019 #define __itkSpatialObjectProperty_h 00020 00021 #include <string> 00022 00023 #include "itkIndent.h" 00024 #include "itkRGBAPixel.h" 00025 #include "itkLightObject.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 void SetColor(const PixelType & color ); 00053 void SetColor( TComponentType r, TComponentType g ,TComponentType b); 00054 00055 void SetRed( TComponentType r ); 00056 TComponentType GetRed( void ) const; 00057 00058 void SetGreen( TComponentType g ); 00059 TComponentType GetGreen( void ) const; 00060 00061 void SetBlue( TComponentType b ); 00062 TComponentType GetBlue( void ) const; 00063 00064 void SetAlpha( TComponentType a); 00065 TComponentType GetAlpha( void ) const; 00066 00067 SpatialObjectProperty(); 00068 virtual ~SpatialObjectProperty(); 00069 00070 void SetName( const char * name ); 00071 StringType GetName( void ) const; 00072 00073 unsigned long GetMTime(void){return m_MTime;} 00074 00075 protected: 00076 00077 void PrintSelf(std::ostream &os, Indent indent) const; 00078 void Modified(void){m_MTime++;} 00079 00080 private: 00081 SpatialObjectProperty(const Self&); //purposely not implemented 00082 void operator=(const Self&); //purposely not implemented 00083 00084 PixelType m_Color; 00085 StringType m_Name; 00086 unsigned long m_MTime; 00087 00088 }; 00089 00090 } 00091 00092 #ifndef ITK_MANUAL_INSTANTIATION 00093 #include "itkSpatialObjectProperty.txx" 00094 #endif 00095 00096 #endif // __SpatialObjectProperty_h 00097