00001 #ifndef SB_MATH_VEC_HELPER_H 00002 #define SB_MATH_VEC_HELPER_H 00003 00004 /*======================================================================= 00005 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00006 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00007 *** *** 00008 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00009 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00010 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00011 *** *** 00012 *** RESTRICTED RIGHTS LEGEND *** 00013 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00014 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00015 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00016 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00017 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00018 *** *** 00019 *** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, *** 00020 *** BORDEAUX, FRANCE *** 00021 *** ALL RIGHTS RESERVED *** 00022 **=======================================================================*/ 00023 /*======================================================================= 00024 ** Author : VSG (MMM YYYY) 00025 **=======================================================================*/ 00026 00027 00028 #include <Inventor/SbBase.h> 00029 #include <Inventor/SbVec.h> 00030 #include <Inventor/SbMathHelper.h> 00031 00032 00033 namespace SbMathVecHelper 00034 { 00035 00036 template< class T> 00037 class VecTraits 00038 { 00039 public: 00040 typedef float scalarType; 00041 }; 00042 00043 template< > 00044 class VecTraits< SbVec3f > 00045 { 00046 public: 00047 typedef float scalarType; 00048 }; 00049 00050 template< > 00051 class VecTraits< SbVec3d > 00052 { 00053 public: 00054 typedef double scalarType; 00055 }; 00056 00060 template< class T > 00061 inline bool isCoinc( const T& x, const T& y, typename VecTraits<SbVec3f>::scalarType tol = ( typename VecTraits<SbVec3f>::scalarType)SbMathHelper::OIV_DEF_MATH_HELPER_EPS ) 00062 { 00063 return ( SbMathHelper::isCoinc< typename VecTraits<T>::scalarType>( x[0], y[0], tol ) && 00064 SbMathHelper::isCoinc< typename VecTraits<T>::scalarType>( x[1], y[1], tol ) && 00065 SbMathHelper::isCoinc< typename VecTraits<T>::scalarType>( x[2], y[2], tol ) ); 00066 } 00067 00068 } 00069 // SB_MATH_VEC_HELPER_H 00070 #endif 00071 00072 00073