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