Files Classes Functions Hierarchy
#include <halfspaceD3indexedfull.h>
Public Member Functions | |
| halfspaceD3indexedfull (PT const *pts_, INDX i0_, INDX i1_, INDX i2_) | |
| Construct the plane with anticlockwise point ordering. | |
| 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 const * | pts |
| PT | normal |
| Normal. | |
| INDX | i0 |
| Index to p0. | |
| INDX | i1 |
| Index to p1. | |
| INDX | i2 |
| Index to p2. | |
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 halfspaceD3indexedfull.h.
| halfspaceD3indexedfull< PT, PD, INDX >::halfspaceD3indexedfull | ( | PT const * | pts_, | |
| INDX | i0_, | |||
| INDX | i1_, | |||
| INDX | i2_ | |||
| ) | [inline] |
Construct the plane with anticlockwise point ordering.
The normal is outwards on the anticlockwise side of the plane.
Definition at line 39 of file halfspaceD3indexedfull.h.
References halfspaceD3indexedfull< PT, PD, INDX >::normalcalculate().
00045 : pts(pts_), 00046 i0(i0_), i1(i1_), i2(i2_) 00047 { normalcalculate(); }
| PD const halfspaceD3indexedfull< PT, PD, INDX >::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 62 of file halfspaceD3indexedfull.h.
References halfspaceD3indexedfull< PT, PD, INDX >::i0, halfspaceD3indexedfull< PT, PD, INDX >::normal, and halfspaceD3indexedfull< PT, PD, INDX >::pts.
00063 { 00064 PT p; 00065 p.x=normal.x*normal.x*(pts[i0].x-w.x); 00066 p.y=normal.y*normal.y*(pts[i0].y-w.y); 00067 p.z=normal.z*normal.z*(pts[i0].z-w.z); 00068 return p.x*p.x+p.y*p.y+p.z*p.z; 00069 }
| boolc halfspaceD3indexedfull< PT, PD, INDX >::isInside | ( | PT const & | x | ) | const [inline, virtual] |
Is the point inside the half space?
Implements partitionspace< PT >.
Definition at line 53 of file halfspaceD3indexedfull.h.
References halfspaceD3indexedfull< PT, PD, INDX >::i0, halfspaceD3indexedfull< PT, PD, INDX >::normal, and halfspaceD3indexedfull< PT, PD, INDX >::pts.
| boolc halfspaceD3indexedfull< PT, PD, INDX >::isInsideOrOnBoundary | ( | PT const & | x | ) | const [inline] |
Is the point on or inside the half space?
Definition at line 56 of file halfspaceD3indexedfull.h.
References halfspaceD3indexedfull< PT, PD, INDX >::i0, halfspaceD3indexedfull< PT, PD, INDX >::normal, and halfspaceD3indexedfull< PT, PD, INDX >::pts.
00057 { return 0 < zero<PD>::val+normal.x*(x.x-pts[i0].x)+normal.y*(x.y-pts[i0].y)+normal.z*(x.z-pts[i0].z); }
| void halfspaceD3indexedfull< PT, PD, INDX >::normalcalculate | ( | ) | [inline] |
Calculate the normal the ordered points.
Definition at line 78 of file halfspaceD3indexedfull.h.
References halfspaceD3indexedfull< PT, PD, INDX >::i0, halfspaceD3indexedfull< PT, PD, INDX >::i1, halfspaceD3indexedfull< PT, PD, INDX >::i2, halfspaceD3indexedfull< PT, PD, INDX >::normal, and halfspaceD3indexedfull< PT, PD, INDX >::pts.
Referenced by halfspaceD3indexedfull< PT, PD, INDX >::halfspaceD3indexedfull().
00079 { 00080 PT u(pts[i2] - pts[i1]); 00081 PT v(pts[i0] - pts[i1]); 00082 00083 normal.x=u.y*v.z-v.y*u.z; 00084 normal.y=u.z*v.x-u.x*v.z; 00085 normal.z=u.x*v.y-u.y*v.x; 00086 }
| INDX halfspaceD3indexedfull< PT, PD, INDX >::i0 |
Index to p0.
Definition at line 29 of file halfspaceD3indexedfull.h.
Referenced by halfspaceD3indexedfull< PT, PD, INDX >::distancefromhalfspace(), halfspaceD3indexedfull< PT, PD, INDX >::isInside(), halfspaceD3indexedfull< PT, PD, INDX >::isInsideOrOnBoundary(), and halfspaceD3indexedfull< PT, PD, INDX >::normalcalculate().
| INDX halfspaceD3indexedfull< PT, PD, INDX >::i1 |
Index to p1.
Definition at line 31 of file halfspaceD3indexedfull.h.
Referenced by halfspaceD3indexedfull< PT, PD, INDX >::normalcalculate().
| INDX halfspaceD3indexedfull< PT, PD, INDX >::i2 |
Index to p2.
Definition at line 33 of file halfspaceD3indexedfull.h.
Referenced by halfspaceD3indexedfull< PT, PD, INDX >::normalcalculate().
| PT halfspaceD3indexedfull< PT, PD, INDX >::normal |
Normal.
Definition at line 26 of file halfspaceD3indexedfull.h.
Referenced by halfspaceD3indexedfull< PT, PD, INDX >::distancefromhalfspace(), halfspaceD3indexedfull< PT, PD, INDX >::isInside(), halfspaceD3indexedfull< PT, PD, INDX >::isInsideOrOnBoundary(), and halfspaceD3indexedfull< PT, PD, INDX >::normalcalculate().
| PT const* halfspaceD3indexedfull< PT, PD, INDX >::pts |
Definition at line 23 of file halfspaceD3indexedfull.h.
Referenced by halfspaceD3indexedfull< PT, PD, INDX >::distancefromhalfspace(), halfspaceD3indexedfull< PT, PD, INDX >::isInside(), halfspaceD3indexedfull< PT, PD, INDX >::isInsideOrOnBoundary(), and halfspaceD3indexedfull< PT, PD, INDX >::normalcalculate().
1.5.8