]> Creatis software - cpMesh.git/blob - lib/cpm/Algorithms/QuadEdge/SquaredEdgeLengthDecimationFilter.h
First commit
[cpMesh.git] / lib / cpm / Algorithms / QuadEdge / SquaredEdgeLengthDecimationFilter.h
1 #ifndef __CPM__ALGORITHMS__QUADEDGE__SQUAREDEDGELENGTHDECIMATIONFILTER__H__
2 #define __CPM__ALGORITHMS__QUADEDGE__SQUAREDEDGELENGTHDECIMATIONFILTER__H__
3
4 #include <cpm/Algorithms/QuadEdge/EdgeDecimationFilter.h>
5
6 namespace cpm
7 {
8   namespace Algorithms
9   {
10     namespace QuadEdge
11     {
12       /**
13        */
14       template< typename I, typename O, typename C >
15       class SquaredEdgeLengthDecimationFilter
16         : public EdgeDecimationFilter< I, O, C >
17       {
18       public:
19         typedef SquaredEdgeLengthDecimationFilter Self;
20         typedef EdgeDecimationFilter< I, O, C >   Superclass;
21         typedef itk::SmartPointer< Self >         Pointer;
22         typedef itk::SmartPointer< const Self >   ConstPointer;
23
24         typedef I TInputMesh;
25         typedef O TOutputMesh;
26         typedef C TCriterion;
27
28         typedef typename Superclass::TOutPoint      TOutPoint;
29         typedef typename Superclass::TOutPrimalEdge TOutPrimalEdge;
30         typedef typename Superclass::TScalar TScalar;
31
32       public:
33         itkNewMacro( Self );
34         itkTypeMacro(
35           SquaredEdgeLengthDecimationFilter, EdgeDecimationFilter
36           );
37
38       protected:
39         SquaredEdgeLengthDecimationFilter( );
40         virtual ~SquaredEdgeLengthDecimationFilter( );
41
42   // keep the start of this documentation text on very first comment line,
43   // it prevents a Doxygen bug
44   /** Compute the measure value for iEdge.
45    *
46    * \param[in] iEdge
47    * \return measure value, here the squared edge length
48    */
49         inline TScalar MeasureEdge(TOutPrimalEdge *iEdge);
50
51   // keep the start of this documentation text on very first comment line,
52   // it prevents a Doxygen bug
53   /** Calculate the position of the remaining vertex from collapsing iEdge.
54    *
55    * \param[in] iEdge
56    * \return the optimal point location
57    */
58   TOutPoint Relocate(TOutPrimalEdge *iEdge);
59
60       private:
61         // Purposely not implemented
62         SquaredEdgeLengthDecimationFilter( const Self& );
63         void operator=( const Self& );
64       };
65
66     } // ecapseman
67
68   } // ecapseman
69
70 } // ecapseman
71
72 #include <cpm/Algorithms/QuadEdge/SquaredEdgeLengthDecimationFilter.hxx>
73
74 #endif // __CPM__ALGORITHMS__QUADEDGE__SQUAREDEDGELENGTHDECIMATIONFILTER__H__
75
76 // eof - $RCSfile$