Files Classes Functions Hierarchy
#include <halfspaceD3.h>
Public Member Functions | |
| halfspaceD3 () | |
| Construct in uninitialized state. | |
| template<typename INDX > | |
| halfspaceD3 (PT const *pts, INDX i0, INDX i1, INDX i2) | |
| halfspaceD3 (PT const &p0_, PT const &p1_, PT const &p2_) | |
| Construct the plane with anticlockwise point ordering. | |
| void | set (PT const &p0_, PT const &p1_, PT const &p2_) |
| Construct a half space from the ordered points. | |
| void | normalcalculate () |
| Calculate the normal the ordered points. | |
| boolc | isInside (PT const &x) const |
| Is the point inside the half space? | |
| boolc | isInsideOrOnBoundary (PT const &x) const |
| Is the point on or inside the half space? | |
| PD const | distancefromhalfspace (PT const &w) const |
| A measure of the distance from the plane to the point w without a square root. | |
Public Attributes | |
| PT | p0 |
| Start point. | |
| PT | p1 |
| Second point. | |
| PT | p2 |
| End point. | |
| PT | normal |
| Normal. | |
The inside of the half space is on the anti clockwise side of the plane with the three points.
Definition at line 19 of file halfspaceD3.h.
| halfspaceD3< PT, PD >::halfspaceD3 | ( | ) | [inline] |
| halfspaceD3< PT, PD >::halfspaceD3 | ( | PT const * | pts, | |
| INDX | i0, | |||
| INDX | i1, | |||
| INDX | i2 | |||
| ) | [inline] |
| halfspaceD3< PT, PD >::halfspaceD3 | ( | PT const & | p0_, | |
| PT const & | p1_, | |||
| PT const & | p2_ | |||
| ) | [inline] |
Construct the plane with anticlockwise point ordering.
The normal is outwards on the anticlockwise side of the plane.
Definition at line 137 of file halfspaceD3.h.
00142 : p0(p0_), p1(p1_), p2(p2_) 00143 { 00144 normalcalculate(); 00145 }
| PD const halfspaceD3< PT, PD >::distancefromhalfspace | ( | PT const & | w | ) | const [inline] |
A measure of the distance from the plane to the point w without a square root.
ie N^2*d^2 where d is the vanilla distance function.
Definition at line 91 of file halfspaceD3.h.
Referenced by halfspaceD3test::test02().
00092 { 00093 PT p; 00094 p.x=normal.x*normal.x*(p0.x-w.x); 00095 p.y=normal.y*normal.y*(p0.y-w.y); 00096 p.z=normal.z*normal.z*(p0.z-w.z); 00097 return p.x*p.x+p.y*p.y+p.z*p.z; 00098 /* 00099 return normal.x*normal.x*(p0.x-w.x)+ 00100 normal.y*normal.y*(p0.y-w.y)+ 00101 normal.z*normal.z*(p0.z-w.z); 00102 */ 00103 }
| boolc halfspaceD3< PT, PD >::isInside | ( | PT const & | x | ) | const [inline, virtual] |
Is the point inside the half space?
Implements partitionspace< PT >.
Definition at line 67 of file halfspaceD3.h.
Referenced by d4tess::initialize(), d4tess::surfaceviewable(), halfspaceD3test::test01(), and tetrahedron< PT, PD >::trianglei().
| boolc halfspaceD3< PT, PD >::isInsideOrOnBoundary | ( | PT const & | x | ) | const [inline] |
Is the point on or inside the half space?
Definition at line 70 of file halfspaceD3.h.
Referenced by halfspaceD3test::test01().
| void halfspaceD3< PT, PD >::normalcalculate | ( | ) | [inline] |
Calculate the normal the ordered points.
Definition at line 125 of file halfspaceD3.h.
References halfspaceD3< PT, PD >::normal, halfspaceD3< PT, PD >::p0, halfspaceD3< PT, PD >::p1, and halfspaceD3< PT, PD >::p2.
Referenced by halfspaceD3< T, D >::halfspaceD3().
00126 { 00127 PT u(p2 - p1); 00128 PT v(p0 - p1); 00129 00130 normal.x=u.y*v.z-v.y*u.z; 00131 normal.y=u.z*v.x-u.x*v.z; 00132 normal.z=u.x*v.y-u.y*v.x; 00133 }
| void halfspaceD3< PT, PD >::set | ( | PT const & | p0_, | |
| PT const & | p1_, | |||
| PT const & | p2_ | |||
| ) | [inline] |
Construct a half space from the ordered points.
Definition at line 149 of file halfspaceD3.h.
00154 { 00155 p0=p0_; 00156 p1=p1_; 00157 p2=p2_; 00158 00159 normalcalculate(); 00160 }
| PT halfspaceD3< PT, PD >::normal |
Normal.
Definition at line 30 of file halfspaceD3.h.
Referenced by halfspaceD3< T, D >::distancefromhalfspace(), halfspaceD3< T, D >::isInside(), halfspaceD3< T, D >::isInsideOrOnBoundary(), halfspaceD3< PT, PD >::normalcalculate(), halfspaceD3test::test01(), and halfspaceD3test::test02().
| PT halfspaceD3< PT, PD >::p0 |
Start point.
Definition at line 24 of file halfspaceD3.h.
Referenced by halfspaceD3< T, D >::distancefromhalfspace(), halfspaceD3< T, D >::isInside(), halfspaceD3< T, D >::isInsideOrOnBoundary(), and halfspaceD3< PT, PD >::normalcalculate().
| PT halfspaceD3< PT, PD >::p1 |
Second point.
Definition at line 26 of file halfspaceD3.h.
Referenced by halfspaceD3< PT, PD >::normalcalculate().
| PT halfspaceD3< PT, PD >::p2 |
End point.
Definition at line 28 of file halfspaceD3.h.
Referenced by halfspaceD3< PT, PD >::normalcalculate().
1.5.8