Files Classes Functions Hierarchy
#include <halfspaceD3indexed.h>
Public Member Functions | |
| halfspaceD3indexed (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 & | p0 |
| Start point. | |
| PT const & | p1 |
| Second point. | |
| PT const & | p2 |
| End point. | |
| 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 halfspaceD3indexed.h.
| halfspaceD3indexed< PT, PD, INDX >::halfspaceD3indexed | ( | 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 43 of file halfspaceD3indexed.h.
References halfspaceD3indexed< PT, PD, INDX >::normalcalculate().
00049 : p0(pts[i0_]), p1(pts[i1_]), p2(pts[i2_]), 00050 i0(i0_), i1(i1_), i2(i2_) 00051 { normalcalculate(); }
| PD const halfspaceD3indexed< 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 66 of file halfspaceD3indexed.h.
References halfspaceD3indexed< PT, PD, INDX >::normal, and halfspaceD3indexed< PT, PD, INDX >::p0.
00067 { 00068 PT p; 00069 p.x=normal.x*normal.x*(p0.x-w.x); 00070 p.y=normal.y*normal.y*(p0.y-w.y); 00071 p.z=normal.z*normal.z*(p0.z-w.z); 00072 return p.x*p.x+p.y*p.y+p.z*p.z; 00073 }
| boolc halfspaceD3indexed< PT, PD, INDX >::isInside | ( | PT const & | x | ) | const [inline, virtual] |
Is the point inside the half space?
Implements partitionspace< PT >.
Definition at line 57 of file halfspaceD3indexed.h.
References halfspaceD3indexed< PT, PD, INDX >::normal, and halfspaceD3indexed< PT, PD, INDX >::p0.
| boolc halfspaceD3indexed< PT, PD, INDX >::isInsideOrOnBoundary | ( | PT const & | x | ) | const [inline] |
Is the point on or inside the half space?
Definition at line 60 of file halfspaceD3indexed.h.
References halfspaceD3indexed< PT, PD, INDX >::normal, and halfspaceD3indexed< PT, PD, INDX >::p0.
| void halfspaceD3indexed< PT, PD, INDX >::normalcalculate | ( | ) | [inline] |
Calculate the normal the ordered points.
Definition at line 82 of file halfspaceD3indexed.h.
References halfspaceD3indexed< PT, PD, INDX >::normal, halfspaceD3indexed< PT, PD, INDX >::p0, halfspaceD3indexed< PT, PD, INDX >::p1, and halfspaceD3indexed< PT, PD, INDX >::p2.
Referenced by halfspaceD3indexed< PT, PD, INDX >::halfspaceD3indexed().
00083 { 00084 PT u(p2 - p1); 00085 PT v(p0 - p1); 00086 00087 normal.x=u.y*v.z-v.y*u.z; 00088 normal.y=u.z*v.x-u.x*v.z; 00089 normal.z=u.x*v.y-u.y*v.x; 00090 }
| INDX halfspaceD3indexed< PT, PD, INDX >::i0 |
| INDX halfspaceD3indexed< PT, PD, INDX >::i1 |
| INDX halfspaceD3indexed< PT, PD, INDX >::i2 |
| PT halfspaceD3indexed< PT, PD, INDX >::normal |
Normal.
Definition at line 30 of file halfspaceD3indexed.h.
Referenced by halfspaceD3indexed< PT, PD, INDX >::distancefromhalfspace(), halfspaceD3indexed< PT, PD, INDX >::isInside(), halfspaceD3indexed< PT, PD, INDX >::isInsideOrOnBoundary(), and halfspaceD3indexed< PT, PD, INDX >::normalcalculate().
| PT const& halfspaceD3indexed< PT, PD, INDX >::p0 |
Start point.
Definition at line 24 of file halfspaceD3indexed.h.
Referenced by halfspaceD3indexed< PT, PD, INDX >::distancefromhalfspace(), halfspaceD3indexed< PT, PD, INDX >::isInside(), halfspaceD3indexed< PT, PD, INDX >::isInsideOrOnBoundary(), and halfspaceD3indexed< PT, PD, INDX >::normalcalculate().
| PT const& halfspaceD3indexed< PT, PD, INDX >::p1 |
Second point.
Definition at line 26 of file halfspaceD3indexed.h.
Referenced by halfspaceD3indexed< PT, PD, INDX >::normalcalculate().
| PT const& halfspaceD3indexed< PT, PD, INDX >::p2 |
End point.
Definition at line 28 of file halfspaceD3indexed.h.
Referenced by halfspaceD3indexed< PT, PD, INDX >::normalcalculate().
1.5.8