PPL Logo

cg3d::PointSet3d Class Reference

A dynamic pointset, with each point marked with the halfspaces it contains. More...

#include <cg3d.h>

Collaboration diagram for cg3d::PointSet3d:

Collaboration graph
[legend]

Public Member Functions

 PointSet3d ()
 Create an empty pointset.
int addHalfspace (const CkHalfspace3d &h)
 Add a halfspace to our list.
int getHalfpaces (void) const
const CkHalfspace3dgetHalfspace (int f) const
int addPoint (const CkVector3d &p)
 Add a point to our list.
int getPoints (void) const
const CkVector3dgetPoint (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]

Detailed Description

A dynamic pointset, with each point marked with the halfspaces it contains.

Definition at line 24 of file cg3d.h.


Member Typedef Documentation

typedef unsigned int cg3d::PointSet3d::halfset_t [private]

A "halfset" is a bitvector per point that indicates where the point belongs for each halfspace.

Definition at line 37 of file cg3d.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
maxPts 
firstPt 

Definition at line 25 of file cg3d.h.

anonymous enum [private]

Enumerator:
maxHalfs 
firstHalf 

Definition at line 29 of file cg3d.h.


Constructor & Destructor Documentation

PointSet3d::PointSet3d (  ) 

Create an empty pointset.

Definition at line 24 of file cg3d.C.

References nHalf, nPts, and setPts.


Member Function Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

int PointSet3d::addHalfspace ( const CkHalfspace3d h  ) 

Add a halfspace to our list.

Definition at line 46 of file cg3d.C.

References firstHalf, half, maxHalfs, nHalf, and r.

Referenced by cg3d::Tet3d::Tet3d().

Here is the caller graph for this function:

int cg3d::PointSet3d::getHalfpaces ( void   )  const [inline]

Definition at line 47 of file cg3d.h.

References nHalf.

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int cg3d::PointSet3d::getPoints ( void   )  const [inline]

Definition at line 58 of file cg3d.h.

References nPts.

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().

Here is the caller graph for this function:

bool cg3d::PointSet3d::isInside ( int  p,
int  h 
) const [inline]

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

bool cg3d::PointSet3d::isOutside ( int  p,
int  h 
) const [inline]

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:


Field Documentation

CkVector3d cg3d::PointSet3d::pts[maxPts] [private]

Definition at line 26 of file cg3d.h.

Referenced by addPoint(), calculateHalfspaces(), and getPoint().

Definition at line 27 of file cg3d.h.

Referenced by popPoints(), and pushPoints().

Definition at line 30 of file cg3d.h.

Referenced by addHalf(), addHalfspace(), and getHalfspace().

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().


The documentation for this class was generated from the following files:

Generated on Mon Sep 21 08:33:30 2020 for Charm++ by  doxygen 1.5.5