ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkVertexCell.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 __itkVertexCell_h
00019 #define __itkVertexCell_h
00020 
00021 #include "itkCellInterface.h"
00022 #include "itkNumericTraits.h"
00023 
00024 namespace itk
00025 {
00038 template< typename TCellInterface >
00039 class ITK_EXPORT VertexCell:public TCellInterface
00040 {
00041 public:
00043   itkCellCommonTypedefs(VertexCell);
00044   itkCellInheritedTypedefs(TCellInterface);
00046 
00048   itkTypeMacro(VertexCell, CellInterface);
00049 
00051   itkStaticConstMacro(NumberOfPoints, unsigned int, 1);
00052   itkStaticConstMacro(CellDimension, unsigned int, 0);
00054 
00056   virtual CellGeometry GetType(void) const
00057   { return Superclass::VERTEX_CELL; }
00058   virtual void MakeCopy(CellAutoPointer &) const;
00060 
00061   virtual unsigned int GetDimension(void) const;
00062 
00063   virtual unsigned int GetNumberOfPoints(void) const;
00064 
00065   virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
00066 
00067   virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier,
00068                                   CellAutoPointer &);
00069   virtual void SetPointIds(PointIdConstIterator first);
00070 
00071   virtual void SetPointIds(PointIdConstIterator first,
00072                            PointIdConstIterator last);
00073 
00074   virtual void SetPointId(int localId, PointIdentifier);
00075   virtual PointIdIterator      PointIdsBegin(void);
00076 
00077   virtual PointIdConstIterator PointIdsBegin(void) const;
00078 
00079   virtual PointIdIterator      PointIdsEnd(void);
00080 
00081   virtual PointIdConstIterator PointIdsEnd(void) const;
00082 
00084   virtual void SetPointId(PointIdentifier);
00085   virtual PointIdentifier GetPointId(void);
00087 
00089   itkCellVisitMacro(Superclass::VERTEX_CELL);
00090 
00092   virtual bool EvaluatePosition(CoordRepType *,
00093                                 PointsContainer *,
00094                                 CoordRepType *,
00095                                 CoordRepType[],
00096                                 double *,
00097                                 InterpolationWeightType *);
00098 public:
00099   VertexCell()
00100   {
00101     for ( PointIdentifier i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++ )
00102       {
00103       m_PointIds[i] = NumericTraits< PointIdentifier >::max();
00104       }
00105   }
00107 
00108   ~VertexCell() {}
00109 protected:
00113   PointIdentifier m_PointIds[NumberOfPoints];
00114 private:
00115   VertexCell(const Self &);     //purposely not implemented
00116   void operator=(const Self &); //purposely not implemented
00117 };
00118 } // end namespace itk
00120 
00121 #ifndef ITK_MANUAL_INSTANTIATION
00122 #include "itkVertexCell.hxx"
00123 #endif
00124 
00125 #endif
00126