Open Inventor
Release 2024.2.1
Loading...
Searching...
No Matches
SbMathVecHelper.h
1
#ifndef SB_MATH_VEC_HELPER_H
2
#define SB_MATH_VEC_HELPER_H
3
4
/*=======================================================================
5
*** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
6
*** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
7
*** ***
8
*** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
9
*** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
10
*** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
11
*** ***
12
*** RESTRICTED RIGHTS LEGEND ***
13
*** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
14
*** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
15
*** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
16
*** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
17
*** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
18
*** ***
19
*** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, ***
20
*** BORDEAUX, FRANCE ***
21
*** ALL RIGHTS RESERVED ***
22
**=======================================================================*/
23
/*=======================================================================
24
** Author : VSG (MMM YYYY)
25
**=======================================================================*/
26
27
28
#include <Inventor/SbBase.h>
29
#include <Inventor/SbVec.h>
30
#include <Inventor/SbMathHelper.h>
31
32
33
namespace
SbMathVecHelper
34
{
35
36
template
<
class
T>
37
class
VecTraits
38
{
39
public
:
40
typedef
float
scalarType
;
41
};
42
43
template
< >
44
class
VecTraits
<
SbVec3f
>
45
{
46
public
:
47
typedef
float
scalarType
;
48
};
49
50
template
< >
51
class
VecTraits
<
SbVec3d
>
52
{
53
public
:
54
typedef
double
scalarType
;
55
};
56
60
template
<
class
T >
61
inline
bool
isCoinc
(
const
T& x,
const
T& y,
typename
VecTraits<SbVec3f>::scalarType
tol = (
typename
VecTraits<SbVec3f>::scalarType
)
SbMathHelper::OIV_DEF_MATH_HELPER_EPS
)
62
{
63
return
(
SbMathHelper::isCoinc
<
typename
VecTraits<T>::scalarType
>( x[0], y[0], tol ) &&
64
SbMathHelper::isCoinc
<
typename
VecTraits<T>::scalarType
>( x[1], y[1], tol ) &&
65
SbMathHelper::isCoinc
<
typename
VecTraits<T>::scalarType
>( x[2], y[2], tol ) );
66
}
67
68
}
69
// SB_MATH_VEC_HELPER_H
70
#endif
71
72
SbMathVecHelper::VecTraits< SbVec3d >::scalarType
double scalarType
Definition
SbMathVecHelper.h:54
SbMathVecHelper::VecTraits< SbVec3f >::scalarType
float scalarType
Definition
SbMathVecHelper.h:47
SbMathVecHelper::VecTraits
Definition
SbMathVecHelper.h:38
SbMathVecHelper::VecTraits::scalarType
float scalarType
Definition
SbMathVecHelper.h:40
SbVec3d
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 3D vector class ...
Definition
SbVec.h:1214
SbVec3f
3D vector class.
Definition
SbVec.h:932
SbMathHelper::OIV_DEF_MATH_HELPER_EPS
static const float OIV_DEF_MATH_HELPER_EPS
Default epsilon value for coincidence and interval checking.
Definition
SbMathHelper.h:43
SbMathHelper::isCoinc
bool isCoinc(const T &x, const T &y, T tol=(T) OIV_DEF_MATH_HELPER_EPS)
Coincidence test using given tolerance.
Definition
SbMathHelper.h:207
SbMathVecHelper
Definition
SbMathVecHelper.h:34
SbMathVecHelper::isCoinc
bool isCoinc(const T &x, const T &y, typename VecTraits< SbVec3f >::scalarType tol=(typename VecTraits< SbVec3f >::scalarType) SbMathHelper::OIV_DEF_MATH_HELPER_EPS)
Coincidence test using given tolerance.
Definition
SbMathVecHelper.h:61
Inventor
SbMathVecHelper.h
Generated by
1.9.8