Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkQuadEdgeMeshNormalFilter_h
00019 #define __itkQuadEdgeMeshNormalFilter_h
00020
00021 #include <itkQuadEdgeMeshToQuadEdgeMeshFilter.h>
00022 #include <itkQuadEdgeMeshPolygonCell.h>
00023 #include "itkTriangleHelper.h"
00024
00025 namespace itk
00026 {
00065 template< class TInputMesh, class TOutputMesh >
00066 class QuadEdgeMeshNormalFilter :
00067 public QuadEdgeMeshToQuadEdgeMeshFilter< TInputMesh, TOutputMesh >
00068 {
00069 public:
00070 typedef QuadEdgeMeshNormalFilter Self;
00071 typedef QuadEdgeMeshToQuadEdgeMeshFilter<
00072 TInputMesh, TOutputMesh > Superclass;
00073 typedef SmartPointer< Self > Pointer;
00074 typedef SmartPointer< const Self > ConstPointer;
00075
00076 itkNewMacro ( Self );
00077
00078 itkTypeMacro ( QuadEdgeMeshNormalFilter,
00079 QuadEdgeMeshToQuadEdgeMeshFilter );
00080
00081 typedef TInputMesh InputMeshType;
00082 typedef typename InputMeshType::Pointer InputMeshPointer;
00083 typedef typename InputMeshType::PointIdentifier InputPointIdentifier;
00084 typedef typename InputMeshType::PointType InputPointType;
00085 typedef typename InputMeshType::VectorType InputVectorType;
00086 typedef typename InputMeshType::QEType InputQEType;
00087
00088 typedef TOutputMesh OutputMeshType;
00089 typedef typename OutputMeshType::Pointer OutputMeshPointer;
00090 typedef typename OutputMeshType::PointType OutputPointType;
00091 typedef typename OutputPointType::VectorType OutputVectorType;
00092 typedef typename OutputMeshType::QEType OutputQEType;
00093 typedef typename OutputMeshType::PointIdentifier OutputPointIdentifier;
00094 typedef typename OutputMeshType::PointIdIterator OutputPointIdIterator;
00095 typedef typename OutputMeshType::PointsContainerPointer
00096 OutputPointsContainerPointer;
00097 typedef typename OutputMeshType::PointsContainerIterator
00098 OutputPointsContainerIterator;
00099 typedef typename OutputMeshType::CellType OutputCellType;
00100 typedef typename OutputMeshType::CellIdentifier OutputCellIdentifier;
00101 typedef typename OutputMeshType::CellAutoPointer OutputCellAutoPointer;
00102 typedef typename OutputMeshType::CellsContainerConstIterator
00103 OutputCellsContainerPointer;
00104 typedef typename OutputMeshType::CellsContainerConstIterator
00105 OutputCellsContainerConstIterator;
00106
00107 typedef TriangleHelper< OutputPointType > TriangleType;
00108
00109 typedef QuadEdgeMeshPolygonCell< OutputCellType > OutputPolygonType;
00110 typedef typename OutputPolygonType::SelfAutoPointer OutputPolygonAutoPointer;
00111
00112 typedef typename OutputMeshType::CellDataContainer OutputCellDataContainer;
00113 typedef typename OutputMeshType::PointDataContainer OutputPointDataContainer;
00114
00115 typedef typename OutputMeshType::MeshTraits OutputMeshTraits;
00116 typedef typename OutputMeshTraits::PixelType OutputVertexNormalType;
00117 typedef typename OutputVertexNormalType::ValueType OutputVertexNormalComponentType;
00118
00119 typedef typename OutputMeshTraits::CellPixelType OutputFaceNormalType;
00120 typedef typename OutputFaceNormalType::ValueType OutputFaceNormalComponentType;
00121
00122 enum WeightType
00123 {
00124 GOURAUD = 0,
00125 THURMER,
00126 AREA
00127 };
00128
00129 itkSetMacro ( Weight, WeightType );
00130 itkGetConstMacro ( Weight, WeightType );
00131
00132 protected:
00133 QuadEdgeMeshNormalFilter( );
00134 ~QuadEdgeMeshNormalFilter( );
00135
00136 WeightType m_Weight;
00137
00144 OutputFaceNormalType ComputeFaceNormal ( OutputPolygonType* iPoly );
00145
00150 void ComputeAllFaceNormals( );
00151
00156 void ComputeAllVertexNormals( );
00157
00162 OutputVertexNormalType ComputeVertexNormal (
00163 const OutputPointIdentifier& iId );
00164
00168 OutputVertexNormalComponentType Weight ( const OutputPointIdentifier& iPId,
00169 const OutputCellIdentifier& iCId );
00170
00175 void GenerateData( );
00176
00177 private:
00178 QuadEdgeMeshNormalFilter ( const Self& );
00179 void operator = ( const Self& );
00180 };
00181 }
00182
00183 #include "itkQuadEdgeMeshNormalFilter.txx"
00184 #endif
00185