00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkTriangleHelper_h
00018 #define __itkTriangleHelper_h
00019
00020 #include "itkCrossHelper.h"
00021
00022 namespace itk
00023 {
00028 template< typename TPoint >
00029 class TriangleHelper
00030 {
00031 public:
00032 typedef TriangleHelper Self;
00033 typedef TPoint PointType;
00034 typedef typename PointType::CoordRepType CoordRepType;
00035 typedef typename PointType::VectorType VectorType;
00036 typedef CrossHelper< VectorType > CrossVectorType;
00037
00038 itkStaticConstMacro( PointDimension, unsigned int, PointType::PointDimension );
00039
00041 static bool IsObtuse( const PointType& iA, const PointType& iB, const PointType& iC );
00042
00044 static VectorType ComputeNormal ( const PointType& iA,
00045 const PointType& iB,
00046 const PointType& iC );
00047
00049 static CoordRepType Cotangent ( const PointType& iA,
00050 const PointType& iB,
00051 const PointType& iC );
00052
00054 static PointType ComputeBarycenter (
00055 const CoordRepType& iA1, const PointType& iP1,
00056 const CoordRepType& iA2, const PointType& iP2,
00057 const CoordRepType& iA3, const PointType& iP3 );
00058
00060 static CoordRepType ComputeAngle( const PointType& iP1, const PointType& iP2,
00061 const PointType& iP3 );
00062
00064 static PointType ComputeGravityCenter (
00065 const PointType& iP1,
00066 const PointType& iP2,
00067 const PointType& iP3 );
00068
00070 static PointType ComputeCircumCenter (
00071 const PointType& iP1,
00072 const PointType& iP2,
00073 const PointType& iP3 );
00074
00076 static PointType ComputeConstrainedCircumCenter ( const PointType& iP1,
00077 const PointType& iP2, const PointType& iP3 );
00078
00080 static CoordRepType ComputeArea ( const PointType& iP1, const PointType& iP2, const PointType& iP3 );
00081
00082 protected:
00083 TriangleHelper( );
00084 virtual ~TriangleHelper( );
00085
00086 void PrintSelf ( std::ostream& os, Indent indent ) const;
00087
00088
00089 private:
00090 TriangleHelper( const Self& );
00091 void operator = ( const Self& );
00092 };
00093 }
00094
00095 #include "itkTriangleHelper.txx"
00096 #endif
00097