]> Creatis software - cpMesh.git/blob - lib/cpm/DataStructures/SimplexMesh.h
First commit
[cpMesh.git] / lib / cpm / DataStructures / SimplexMesh.h
1 #ifndef __CPM__DATASTRUCTURES__SIMPLEXMESH__H__
2 #define __CPM__DATASTRUCTURES__SIMPLEXMESH__H__
3
4 #include <itkVector.h>
5 #include <cpm/DataStructures/QuadEdgeMesh.h>
6
7 namespace cpm
8 {
9   namespace DataStructures
10   {
11     /**
12      */
13     template< typename P, unsigned int K, unsigned int D = 3, typename T = itk::DefaultStaticMeshTraits< P, D, D > >
14     class SimplexMesh
15       : public QuadEdgeMesh< P, D, T >
16     {
17     public:
18       typedef SimplexMesh                     Self;
19       typedef QuadEdgeMesh< P, D, T >         Superclass;
20       typedef itk::SmartPointer< Self >       Pointer;
21       typedef itk::SmartPointer< const Self > ConstPointer;
22
23       // Input templates
24       itkStaticConstMacro( Order, unsigned int, K );
25
26       /// Types from superclass
27       typedef
28       typename Superclass::BoundaryAssignmentsContainer
29       BoundaryAssignmentsContainer;
30
31       typedef
32       typename Superclass::BoundaryAssignmentsContainerPointer
33       BoundaryAssignmentsContainerPointer;
34       typedef typename Superclass::BoundingBoxType       BoundingBoxType;
35       typedef typename Superclass::CellAutoPointer       CellAutoPointer;
36       typedef typename Superclass::CellsContainer        CellsContainer;
37       typedef typename Superclass::CellDataContainer     CellDataContainer;
38       typedef typename Superclass::CellFeatureCount      CellFeatureCount;
39       typedef typename Superclass::CellFeatureIdentifier CellFeatureIdentifier;
40       typedef typename Superclass::CellIdentifier        CellIdentifier;
41       typedef typename Superclass::CellLinksContainer    CellLinksContainer;
42       typedef typename Superclass::CellMultiVisitorType  CellMultiVisitorType;
43       typedef typename Superclass::CellPixelType         CellPixelType;
44       typedef typename Superclass::CellType              CellType;
45       typedef typename Superclass::PointIdentifier       PointIdentifier;
46       typedef typename Superclass::PointsContainer       PointsContainer;
47       typedef typename Superclass::PointType             PointType;
48       typedef typename Superclass::TPrimalEdge           TPrimalEdge;
49       typedef typename Superclass::TDualEdge             TDualEdge;
50       typedef typename Superclass::VectorType            VectorType;
51       typedef typename VectorType::ValueType             ValueType;
52       typedef typename Superclass::TQuadEdgeCell         TQuadEdgeCell;
53
54       typedef itk::Vector< P, K + 1 > BarycenterVector;
55
56     public:
57       itkNewMacro( Self );
58       itkTypeMacro( SimplexMesh, QuadEdgeMesh );
59
60     public:
61       bool ComputeSimplexParameters(
62         const PointIdentifier& pId,
63         VectorType& A,
64         VectorType& B,
65         VectorType& C,
66         VectorType& N,
67         BarycenterVector& barycenter,
68         ValueType& r,
69         ValueType& d,
70         ValueType& dp,
71         ValueType& phi
72         ) const;
73
74       bool VerifySimplexOrder( ) const;
75       bool OperatorDeleteEdge(
76         const PointIdentifier& a, const PointIdentifier& b
77         );
78
79     protected:
80       SimplexMesh( );
81       virtual ~SimplexMesh( );
82
83       virtual VectorType _ComputePointNormal( const TPrimalEdge* e ) const;
84
85     private:
86       SimplexMesh( const Self& );    // Not implemented
87       void operator=( const Self& ); // Not implemented
88     };
89
90   } // ecapseman
91
92 } // ecapseman
93
94 #include <cpm/DataStructures/SimplexMesh.hxx>
95
96 #endif // __CPM__DATASTRUCTURES__SIMPLEXMESH__H__
97
98 // eof - $RCSfile$