vtf-logo

orientation.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00013 #if !defined(__geom_kernel_orientation_h__)
00014 #define __geom_kernel_orientation_h__
00015 
00016 // If we are debugging the whole geom namespace.
00017 #if defined(DEBUG_geom) && !defined(DEBUG_geom_kernel_orientation)
00018 #define DEBUG_geom_kernel_orientation
00019 #endif
00020 
00021 #ifdef DEBUG_geom_kernel_orientation
00022 #ifndef DEBUG_FixedArray
00023 #define DEBUG_FixedArray
00024 #endif
00025 #endif
00026 
00027 #include "../defs.h"
00028 
00029 #include "../../ads/tensor/SquareMatrix.h"
00030 
00031 BEGIN_NAMESPACE_GEOM
00032 
00033 
00034 //-----------------------------------------------------------------------------
00036 // @{
00037 
00038 
00040 
00056 template<typename T>
00057 T
00058 computeOrientationDeterminant(const ads::FixedArray<2,T>& a,
00059                               const ads::FixedArray<2,T>& b,
00060                               const ads::FixedArray<2,T>& c);
00061 
00062 
00064 
00082 template<typename T>
00083 T
00084 computeInCircleDeterminant(const ads::FixedArray<2,T>& a,
00085                            const ads::FixedArray<2,T>& b,
00086                            const ads::FixedArray<2,T>& c,
00087                            const ads::FixedArray<2,T>& d);
00088 
00090 
00096 template<typename T>
00097 inline
00098 bool
00099 isInCircle(const ads::FixedArray<2,T>& a,
00100            const ads::FixedArray<2,T>& b,
00101            const ads::FixedArray<2,T>& c,
00102            const ads::FixedArray<2,T>& d) {
00103   return computeOrientationDeterminant(a, b, c) * 
00104     computeInCircleDeterminant(a, b, c, d) < 0;
00105 }
00106 
00107 
00108 // @}
00109 
00110 END_NAMESPACE_GEOM
00111 
00112 #define __geom_kernel_orientation_ipp__
00113 #include "orientation.ipp"
00114 #undef __geom_kernel_orientation_ipp__
00115 
00116 #endif

Generated on Fri Aug 24 12:55:56 2007 for Computational Geometry Package by  doxygen 1.4.7