#include <cg3d.h>
Public Member Functions | |
PointSet3d () | |
Create an empty pointset. | |
int | addHalfspace (const CkHalfspace3d &h) |
Add a halfspace to our list. | |
int | getHalfpaces (void) const |
const CkHalfspace3d & | getHalfspace (int f) const |
int | addPoint (const CkVector3d &p) |
Add a point to our list. | |
int | getPoints (void) const |
const CkVector3d & | getPoint (int p) const |
bool | isInside (int p, int h) const |
Return true if point p is completely inside halfspace h. | |
bool | isInside (const CkVector3d &p, int h) const |
bool | isOutside (int p, int h) const |
Return true if point p is completely outside halfspace h. | |
bool | isOutside (const CkVector3d &p, int h) const |
void | calculateHalfspaces (void) |
Cache halfspace insideness for existing points. | |
void | pushPoints (void) |
Save the number of points (before adding temporary points). | |
void | popPoints (void) |
Restore to the last saved number of points (throwing away later points). | |
Private Types | |
enum | { maxPts = 32, firstPt = 1000000000 } |
enum | { maxHalfs = 12, firstHalf = 2000000000 } |
typedef unsigned int | halfset_t |
A "halfset" is a bitvector per point that indicates where the point belongs for each halfspace. | |
Private Member Functions | |
void | addHalf (const CkVector3d &pt, int p) |
Private Attributes | |
int | nPts |
CkVector3d | pts [maxPts] |
int | saved_nPts |
int | nHalf |
CkHalfspace3d | half [maxHalfs] |
int | setPts |
halfset_t | inHalf [maxHalfs] |
halfset_t | outHalf [maxHalfs] |
Definition at line 24 of file cg3d.h.
typedef unsigned int cg3d::PointSet3d::halfset_t [private] |
PointSet3d::PointSet3d | ( | ) |
void PointSet3d::addHalf | ( | const CkVector3d & | pt, | |
int | p | |||
) | [private] |
Definition at line 29 of file cg3d.C.
References cg3d::epsilon, h, half, inHalf, nHalf, outHalf, CkHalfspace3d::side(), and PUP::u.
Referenced by calculateHalfspaces().
int PointSet3d::addHalfspace | ( | const CkHalfspace3d & | h | ) |
int cg3d::PointSet3d::getHalfpaces | ( | void | ) | const [inline] |
const CkHalfspace3d& cg3d::PointSet3d::getHalfspace | ( | int | f | ) | const [inline] |
Definition at line 48 of file cg3d.h.
References firstHalf, half, and nHalf.
Referenced by cg3d::Planar3d::addConstraint(), cg3d::Shape3d::getHalfspace(), isInside(), and isOutside().
int PointSet3d::addPoint | ( | const CkVector3d & | p | ) |
Add a point to our list.
Definition at line 56 of file cg3d.C.
References firstPt, maxPts, nPts, pts, and r.
Referenced by cg3d::Planar3d::addConstraint(), and cg3d::Tet3d::Tet3d().
int cg3d::PointSet3d::getPoints | ( | void | ) | const [inline] |
const CkVector3d& cg3d::PointSet3d::getPoint | ( | int | p | ) | const [inline] |
Definition at line 59 of file cg3d.h.
References firstPt, nPts, and pts.
Referenced by cg3d::Shape3d::getPoint(), cg3d::Planar3d::getPoint(), isInside(), isOutside(), and test_vol_mgc().
Return true if point p is completely inside halfspace h.
Definition at line 68 of file cg3d.h.
References firstHalf, firstPt, getPoint(), inHalf, and setPts.
Referenced by cg3d::Shape3d::contains(), earlyExit(), and cg3d::intersect().
bool cg3d::PointSet3d::isInside | ( | const CkVector3d & | p, | |
int | h | |||
) | const [inline] |
Definition at line 75 of file cg3d.h.
References cg3d::epsilon, getHalfspace(), and CkHalfspace3d::side().
Return true if point p is completely outside halfspace h.
Definition at line 79 of file cg3d.h.
References firstHalf, firstPt, getPoint(), outHalf, and setPts.
Referenced by cg3d::Planar3d::addConstraint(), and cg3d::intersect().
bool cg3d::PointSet3d::isOutside | ( | const CkVector3d & | p, | |
int | h | |||
) | const [inline] |
Definition at line 86 of file cg3d.h.
References cg3d::epsilon, getHalfspace(), and CkHalfspace3d::side().
void PointSet3d::calculateHalfspaces | ( | void | ) |
Cache halfspace insideness for existing points.
Calculate halfspace insideness for old points.
Definition at line 39 of file cg3d.C.
References addHalf(), firstPt, h, inHalf, nHalf, nPts, outHalf, p, pts, and setPts.
Referenced by cg3d::intersect().
void cg3d::PointSet3d::pushPoints | ( | void | ) | [inline] |
Save the number of points (before adding temporary points).
Definition at line 93 of file cg3d.h.
References nPts, and saved_nPts.
Referenced by cg3d::intersect().
void cg3d::PointSet3d::popPoints | ( | void | ) | [inline] |
Restore to the last saved number of points (throwing away later points).
Definition at line 95 of file cg3d.h.
References nPts, and saved_nPts.
Referenced by cg3d::intersect().
int cg3d::PointSet3d::nPts [private] |
Definition at line 25 of file cg3d.h.
Referenced by addPoint(), calculateHalfspaces(), getPoint(), getPoints(), PointSet3d(), popPoints(), and pushPoints().
CkVector3d cg3d::PointSet3d::pts[maxPts] [private] |
Definition at line 26 of file cg3d.h.
Referenced by addPoint(), calculateHalfspaces(), and getPoint().
int cg3d::PointSet3d::saved_nPts [private] |
int cg3d::PointSet3d::nHalf [private] |
Definition at line 29 of file cg3d.h.
Referenced by addHalf(), addHalfspace(), calculateHalfspaces(), getHalfpaces(), getHalfspace(), and PointSet3d().
CkHalfspace3d cg3d::PointSet3d::half[maxHalfs] [private] |
int cg3d::PointSet3d::setPts [private] |
Definition at line 31 of file cg3d.h.
Referenced by calculateHalfspaces(), isInside(), isOutside(), and PointSet3d().
halfset_t cg3d::PointSet3d::inHalf[maxHalfs] [private] |
Definition at line 38 of file cg3d.h.
Referenced by addHalf(), calculateHalfspaces(), and isInside().
halfset_t cg3d::PointSet3d::outHalf[maxHalfs] [private] |
Definition at line 39 of file cg3d.h.
Referenced by addHalf(), calculateHalfspaces(), and isOutside().