ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkLineCell.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 __itkLineCell_h
00019 #define __itkLineCell_h
00020 
00021 #include "itkVertexCell.h"
00022 
00023 namespace itk
00024 {
00041 template< typename TCellInterface >
00042 class ITK_EXPORT LineCell:public TCellInterface
00043 {
00044 public:
00046   itkCellCommonTypedefs(LineCell);
00047   itkCellInheritedTypedefs(TCellInterface);
00049 
00051   itkTypeMacro(LineCell, CellInterface);
00052 
00054   typedef VertexCell< TCellInterface >         VertexType;
00055   typedef typename VertexType::SelfAutoPointer VertexAutoPointer;
00056 
00058   enum { NumberOfPoints   = 2,
00059          NumberOfVertices = 2,
00060          CellDimension    = 1 };
00061 
00063   virtual CellGeometry GetType(void) const
00064   { return Superclass::LINE_CELL; }
00065   virtual void MakeCopy(CellAutoPointer &) const;
00067 
00068   virtual unsigned int GetDimension(void) const;
00069 
00070   virtual unsigned int GetNumberOfPoints(void) const;
00071 
00072   virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
00073 
00074   virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier, CellAutoPointer &);
00075   virtual void SetPointIds(PointIdConstIterator first);
00076 
00077   virtual void SetPointIds(PointIdConstIterator first,
00078                            PointIdConstIterator last);
00079 
00080   virtual void SetPointId(int localId, PointIdentifier);
00081   virtual PointIdIterator      PointIdsBegin(void);
00082 
00083   virtual PointIdConstIterator PointIdsBegin(void) const;
00084 
00085   virtual PointIdIterator      PointIdsEnd(void);
00086 
00087   virtual PointIdConstIterator PointIdsEnd(void) const;
00088 
00090   virtual CellFeatureCount GetNumberOfVertices(void) const;
00091 
00092   virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
00093 
00095   itkCellVisitMacro(Superclass::LINE_CELL);
00096 
00097   LineCell()
00098   {
00099     for ( unsigned int i = 0; i < itkGetStaticConstMacro(NumberOfPoints); i++ )
00100       {
00101       m_PointIds[i] = NumericTraits< PointIdentifier >::max();
00102       }
00103   }
00104 
00105   ~LineCell() {}
00106 protected:
00108   PointIdentifier m_PointIds[NumberOfPoints];
00109 private:
00110   LineCell(const Self &);       //purposely not implemented
00111   void operator=(const Self &); //purposely not implemented
00112 };
00113 } // end namespace itk
00115 
00116 #ifndef ITK_MANUAL_INSTANTIATION
00117 #include "itkLineCell.hxx"
00118 #endif
00119 
00120 #endif
00121