ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkSpatialObjectPoint.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 __itkSpatialObjectPoint_h
00019 #define __itkSpatialObjectPoint_h
00020 
00021 #include "itkPoint.h"
00022 #include "vnl/vnl_vector_fixed.h"
00023 #include "itkRGBAPixel.h"
00024 
00025 namespace itk
00026 {
00036 template< unsigned int TPointDimension = 3 >
00037 class ITK_EXPORT SpatialObjectPoint
00038 {
00039 public:
00040 
00043   SpatialObjectPoint(void);
00044 
00046   virtual ~SpatialObjectPoint(void);
00047 
00048   typedef SpatialObjectPoint               Self;
00049   typedef Point< double, TPointDimension > PointType;
00050   typedef vnl_vector< double >             VectorType;
00051   typedef RGBAPixel< float >               PixelType;
00052   typedef PixelType                        ColorType;
00053 
00055   int GetID(void) const;
00056 
00058   void SetID(const int newID);
00059 
00061   const PointType & GetPosition(void) const;
00062 
00064   void SetPosition(const PointType & newX);
00065 
00066   void SetPosition(const double x0, const double x1);
00067 
00068   void SetPosition(const double x0, const double x1, const double x2);
00069 
00071   Self & operator=(const SpatialObjectPoint & rhs);
00072 
00074   const PixelType & GetColor(void) const;
00075 
00076   void SetColor(const PixelType & color);
00077 
00078   void SetColor(float r, float g, float b, float a = 1);
00079 
00081   void SetRed(float r);
00082 
00083   float GetRed(void) const;
00084 
00086   void SetGreen(float g);
00087 
00088   float GetGreen(void) const;
00089 
00091   void SetBlue(float b);
00092 
00093   float GetBlue(void) const;
00094 
00096   void SetAlpha(float a);
00097 
00098   float GetAlpha(void) const;
00099 
00101   void Print(std::ostream & os) const;
00102 
00103 protected:
00104 
00106   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00107 
00109   int m_ID;
00110 
00112   PointType m_X;
00113 
00115   PixelType m_Color;
00116 };
00117 } // end of namespace itk
00118 
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkSpatialObjectPoint.hxx"
00121 #endif
00122 
00123 #endif // __itkSpatialObjectPoint_h
00124