Box Class Reference

#include <Box.h>

Inheritance diagram for Box:

FDH6 FDH Geometry ESGObject List of all members.

Public Member Functions

 Box ()
 Box (const Interval &extentX, const Interval &extentY, const Interval &extentZ)
 Box (double minX, double maxX, double minY, double maxY, double minZ, double maxZ)
virtual bool mapToUV (const Vector3 &v, Vector2 &uv)
virtual Geometryclone (const Matrix4 *pTrMat) const
Geometryclone (void) const
virtual void setExtentX (double min, double max)
virtual void setExtentY (double min, double max)
virtual void setExtentZ (double min, double max)
virtual void rayIntersection (PointEnv *pPE, int mask, const Vector3 &origin, const Vector3 &direction, float maxD=MAXFLOAT)
virtual void randomSample (int mask, PointEnv &pe, double *pdf)
virtual bool randomDirection (const Vector3 &pov, Vector3 &dir, double *pdf)
virtual Interval extent (const Vector3 &direction) const
Interval extent (float x, float y, float z) const
virtual Vector3 centroid (void) const
virtual double radius (const Vector3 &centroid) const
virtual double radius (void) const
virtual bool separation (Geometry &geom, Vector3 *pDir)
virtual double distance (const Geometry &geom, Vector3 *pDir)
virtual void dump (const char *intent, const char *tab)
virtual bool checkVolume (void) const
virtual void __debug ()
void insideOut (bool b)
Meshmesh (int density=0) const

Public Attributes

 FDHMat
 matrix of directions
 __pad0__: FDH(DIRS

Static Public Attributes

static const unsigned DIRS = 3
 number of directions
static const unsigned SIZE = 6
 2 * DIRS
static const float FDHMat [6][3]
 matrix of directions
static const float EPS = 1e-03
 epsilon variation (tolerance) of zero

Protected Member Functions

virtual Mesh_mesh (int) const
virtual Vector3d * _get_corners (unsigned &, unsigned(*)[100], unsigned[]) const
virtual Vector3d * _get_corners (unsigned &numCorners, unsigned(*facetVert)[100], unsigned nFacetCert[]) const
int _cut_line (Vector3d &, Vector3d &) const
virtual void _duplicate_attributes (const Geometry &)
virtual void _rotateX (float)
virtual void _rotateY (float)
virtual void _rotateZ (float)
virtual void _rotate (float, const Vector3 &)
virtual void _rotate (const Matrix3 &)
virtual void _translate (float, float, float)
void _translate (const Vector3 &v)
virtual void _transform (const Matrix4 &)
virtual void _scale (float)

Protected Attributes

float * _values
 array of FDH's values (+max,-min)
const unsigned _dirs
 number of directions
const float(* _mat )[3]
 matrix of FDH
bool _insideOut

Detailed Description

Another name for 6-DOP

Definition at line 14 of file Box.h.


Constructor & Destructor Documentation

Box  )  [inline]
 

Contructor for unit box

Definition at line 19 of file Box.h.

Box const Interval extentX,
const Interval extentY,
const Interval extentZ
[inline]
 

Contructor

Parameters:
extentX min-max extent in X
extentY min-max extent in Y
extentZ min-max extent in Z

Definition at line 32 of file Box.h.

References Interval::max, and Interval::min.

Box double  minX,
double  maxX,
double  minY,
double  maxY,
double  minZ,
double  maxZ
[inline]
 

Contructor

Parameters:
extentX min-max extent in X
extentY min-max extent in Y
extentZ min-max extent in Z

Definition at line 50 of file Box.h.


Member Function Documentation

virtual void __debug void   )  [inline, virtual, inherited]
 

For debugging purposes

Reimplemented from Geometry.

Definition at line 188 of file FDH.h.

int _cut_line Vector3d &  ,
Vector3d & 
const [protected, inherited]
 

Definition at line 13 of file FDH.cc.

References FDH::_dirs, FDH::_mat, FDH::_values, Geometry::EPS, and MAXDOUBLE.

Referenced by FDH::_get_corners().

void _duplicate_attributes const Geometry  )  [protected, virtual, inherited]
 

Reimplemented from Geometry.

Reimplemented in FDH14.

Definition at line 262 of file FDH.cc.

References FDH::_dirs, Geometry::_duplicate_attributes(), and FDH::_values.

Referenced by FDH14::_duplicate_attributes(), FDH6::clone(), and FDH::clone().

Vector3d * _get_corners unsigned &  numCorners,
unsigned *  facetVert[100],
unsigned  nFacetCert[]
const [protected, virtual, inherited]
 

Definition at line 65 of file FDH.cc.

References FDH::_cut_line(), FDH::_dirs, FDH::_mat, FDH::_values, Geometry::EPS, and FDH_UPDATE_FACET.

Referenced by FDH::_mesh(), FDH::_rotate(), FDH::_rotateX(), FDH::_rotateY(), FDH::_rotateZ(), and FDH::_transform().

virtual Vector3d* _get_corners unsigned &  ,
unsigned(*)  [100],
unsigned  []
const [protected, virtual, inherited]
 

Mesh * _mesh int   )  const [protected, virtual, inherited]
 

Reimplemented from FDH.

Definition at line 70 of file FDH6.cc.

References FDH::_values, and Mesh::translate().

void _rotate const Matrix3  )  [protected, virtual, inherited]
 

Implements Geometry.

Reimplemented in FDH14.

Definition at line 391 of file FDH.cc.

References FDH::_get_corners(), FDH::_values, and MAXFLOAT.

void _rotate float  ,
const Vector3
[protected, virtual, inherited]
 

Implements Geometry.

Reimplemented in FDH14.

Definition at line 362 of file FDH.cc.

References FDH::_get_corners(), FDH::_values, and MAXFLOAT.

void _rotateX float   )  [protected, virtual, inherited]
 

Implements Geometry.

Reimplemented in FDH14.

Definition at line 270 of file FDH.cc.

References FDH::_dirs, FDH::_get_corners(), FDH::_values, and MAXFLOAT.

void _rotateY float   )  [protected, virtual, inherited]
 

Implements Geometry.

Reimplemented in FDH14.

Definition at line 297 of file FDH.cc.

References FDH::_get_corners(), FDH::_mat, FDH::_values, and MAXFLOAT.

void _rotateZ float   )  [protected, virtual, inherited]
 

Implements Geometry.

Reimplemented in FDH14.

Definition at line 335 of file FDH.cc.

References FDH::_get_corners(), FDH::_values, and MAXFLOAT.

void _scale float   )  [protected, virtual, inherited]
 

Implements Geometry.

Definition at line 468 of file FDH.cc.

References FDH::_values.

void _transform const Matrix4  )  [protected, virtual, inherited]
 

Implements Geometry.

Reimplemented in FDH14.

Definition at line 427 of file FDH.cc.

References FDH::_get_corners(), FDH::_mat, FDH::_values, and MAXFLOAT.

Referenced by FDH14::_transform(), FDH6::clone(), and FDH::clone().

void _translate const Vector3 v  )  [inline, protected, inherited]
 

Definition at line 38 of file Geometry.h.

void _translate float  ,
float  ,
float 
[protected, virtual, inherited]
 

Implements Geometry.

Definition at line 415 of file FDH.cc.

References FDH::_mat, and FDH::_values.

Vector3 centroid void   )  const [virtual, inherited]
 

Returns:
centroid (point of gravity) of the geometry

Implements Geometry.

Definition at line 724 of file FDH.cc.

References FDH::_mat, and FDH::_values.

bool checkVolume void   )  const [virtual, inherited]
 

Checks whether the volume is cor, that is wheter the lower extnts are less the their upper counterparts

Returns:
true if FDH is correct, false otherwise

Definition at line 831 of file FDH.cc.

References FDH::_values.

Geometry* clone void   )  const [inline, inherited]
 

Duplicates geometry

Returns:
duplicate (clone)

Reimplemented in _Surface, and OSGPolygon.

Definition at line 155 of file Geometry.h.

Referenced by BVH::__get_edges(), BVH::__get_meshes(), ObjsInAreaExplorer::_accept_new_transformation(), SphereTree::_enlarge_bv(), FDHTree::_enlarge_bv(), BVExplorer::_iterate(), BVDistRot::BVDistRot(), and ObjsInAreaExplorer::ObjsInAreaExplorer().

Geometry * clone const Matrix4 pTrMat  )  const [virtual, inherited]
 

Duplicates and transforms geometry

Parameters:
pTrMat transformation matrix of the clone or NULL
Returns:
duplicate (clone)

Reimplemented from FDH.

Definition at line 178 of file FDH6.cc.

References FDH::_duplicate_attributes(), and FDH::_transform().

double distance const Geometry geom,
Vector3 pDir
[virtual, inherited]
 

Computes approximate distance between this and given geometries (lower bound of distance)

Parameters:
geom geometry to check
pDir if presented then is set to normalized measured direction (vector of minimal distance)
Returns:
lower bound of distance, negative value indicates penetration, positive value indicates separation, zero indicates touch

Implements Geometry.

Definition at line 791 of file FDH.cc.

References FDH::_mat, FDH::_values, Geometry::extent(), Interval::max, MAXDOUBLE, and Interval::min.

void dump const char *  intent,
const char *  tab
[virtual, inherited]
 

Writes information about this geometry to std. out.

Parameters:
intent free space before each line
tab free space added to intent inside description of this class

Implements Geometry.

Definition at line 816 of file FDH.cc.

References FDH::_mat, and FDH::_values.

Interval extent float  x,
float  y,
float  z
const [inline, inherited]
 

Returns extent occupied by the geometry in given direction

Parameters:
x direction direction of extent - x coordinate
y direction direction of extent - y coordinate
z direction direction of extent - z coordinate
Returns:
extent of occupied space

Definition at line 124 of file Geometry.h.

Interval extent const Vector3 direction  )  const [virtual, inherited]
 

Returns extent occupied by the geometry in given direction

Parameters:
direction direction of extent
Returns:
extent of occupied space

Implements Geometry.

Reimplemented in FDH14.

Definition at line 684 of file FDH.cc.

References FDH::_mat, FDH::_values, Interval::max, and Interval::min.

void insideOut bool  b  )  [inline, inherited]
 

Inverts facet normals (turns the object inside-out)

Parameters:
b determines wehether to turn the geometry inside-out

Definition at line 56 of file Geometry.h.

bool mapToUV const Vector3 v,
Vector2 uv
[virtual, inherited]
 

Maps 3D point from surface to the UV surface representation

Parameters:
v 3D point in the world coordinates
uv UV coordinates (relative to the surface)
Returns:
true on success, false otherwise (mainly if the 3D point does not lie on the surface)

Reimplemented from FDH.

Definition at line 135 of file FDH6.cc.

References FDH::_values.

Mesh * mesh int  density = 0  )  const [inherited]
 

Returns polygonal mesh computed from this geometry

Parameters:
density mesh density
Returns:
polygonal mesh

Definition at line 24 of file Geometry.cc.

References Geometry::_insideOut, Geometry::_mesh(), and Mesh::turnInsideOut().

Referenced by BVH::__get_edges(), BVH::__get_meshes(), NurbsSurface::_mesh(), and POVRayExporter::_process_leaf().

virtual double radius void   )  const [inline, virtual, inherited]
 

Returns radius of minimal packing sphere with center in the ceontroid of the geometry

Parameters:
centroid center of packing sphere
Returns:
minimal packing radius

Reimplemented in Cylinder, NurbsSurface, Point3D, Sphere, and Surface.

Definition at line 148 of file Geometry.h.

double radius const Vector3 centroid  )  const [virtual, inherited]
 

Returns radius of minimal packing sphere having given center

Parameters:
centroid center of packing sphere
Returns:
minimal packing radius

Implements Geometry.

Definition at line 746 of file FDH.cc.

References FDH::_mat, FDH::_values, and MAXDOUBLE.

bool randomDirection const Vector3 pov,
Vector3 dir,
double *  pdf
[virtual, inherited]
 

Computes random direction towards the surface in accord to the point of view.

Parameters:
pov point of view
dir computed random direction
pdf if present then it is set to the value of the Probability Density Function of the random point

Implements Geometry.

Definition at line 678 of file FDH.cc.

void randomSample int  mask,
PointEnv pe,
double *  pdf
[virtual, inherited]
 

Computes random point on the surface

Parameters:
mask bitmask determining what to compute, see PointEnv.h
pe information about the computed random point on surface
pdf if present then it is set to the value of the Probability Density Function of the random point

Implements Geometry.

Definition at line 671 of file FDH.cc.

References ENV_HAVE_NOTHING, and PointEnv::mask.

void rayIntersection PointEnv pPE,
int  mask,
const Vector3 origin,
const Vector3 direction,
float  maxD = MAXFLOAT
[virtual, inherited]
 

Computes point of intersection of ray with this geometry

Parameters:
pPE structure in which the information about intersection point is stored; must be defined (not NULL)
mask bitmask determining what to compute, see PointEnv.h
origin ray's origin
direction normalized ray's direction
maxD maximal interesting distance; if the point of intersection can't be closer than this distance then the computation stops (object is too far away)

Implements Geometry.

Definition at line 567 of file FDH.cc.

References FDH::_mat, FDH::FDHCache::dval, ENV_HAVE_NOTHING, ENV_USE_CACHE, ENV_WANT_NORMAL, ENV_WANT_UV_COORD, FDH_CLIP_LINE_CONT, FDH_CLIP_LINE_INDEX_CONT, FDH_CLIP_LINE_INDEX_INIT, FDH_CLIP_LINE_INIT, PointEnv::mask, MAXFLOAT, FDH::FDHCache::oval, and PointEnv::pCache.

bool separation Geometry geom,
Vector3 pDir
[virtual, inherited]
 

Checks if there is separation between this and given geometries

Parameters:
geom geometry to check
pDir if presented then is set to normalized direction to found separation (gap)
Returns:
true if thre is separation (gap), false otherwise

Implements Geometry.

Definition at line 762 of file FDH.cc.

References FDH::_mat, and FDH::_values.

virtual void setExtentX double  min,
double  max
[inline, virtual, inherited]
 

Chages extent

Parameters:
min lower value of extent
max bigger value of extent

Definition at line 79 of file FDH6.h.

virtual void setExtentY double  min,
double  max
[inline, virtual, inherited]
 

Chages extent

Parameters:
min lower value of extent
max bigger value of extent

Definition at line 90 of file FDH6.h.

virtual void setExtentZ double  min,
double  max
[inline, virtual, inherited]
 

Chages extent

Parameters:
min lower value of extent
max bigger value of extent

Definition at line 101 of file FDH6.h.


Member Data Documentation

__pad0__ [inherited]
 

Constructor - makes FDH packing SG objects stored in list

Parameters:
list list of scene graph objects that are packed

Definition at line 36 of file FDH6.h.

const unsigned _dirs [protected, inherited]
 

number of directions

Definition at line 57 of file FDH.h.

Referenced by FDH::_cut_line(), FDH::_duplicate_attributes(), FDH::_get_corners(), FDH::_mesh(), FDH14::_rotate(), FDH14::_rotateX(), FDH::_rotateX(), FDH14::_rotateY(), FDH14::_rotateZ(), and FDH14::_transform().

bool _insideOut [protected, inherited]
 

Definition at line 23 of file Geometry.h.

Referenced by Geometry::_duplicate_attributes(), and Geometry::mesh().

const float(* _mat)[3] [protected, inherited]
 

matrix of FDH

Definition at line 58 of file FDH.h.

Referenced by FDH::_cut_line(), FDH::_get_corners(), FDH14::_mesh(), FDH::_mesh(), FDH::_rotateY(), FDH::_transform(), FDH::_translate(), FDH::centroid(), FDH::clone(), FDH::distance(), FDH::dump(), FDH::extent(), FDH::FDH(), FDH::radius(), FDH::rayIntersection(), and FDH::separation().

float* _values [protected, inherited]
 

array of FDH's values (+max,-min)

Definition at line 56 of file FDH.h.

Referenced by FDH::_cut_line(), FDH14DistRot::_distance(), FDH::_duplicate_attributes(), FDH::_get_corners(), FDH6::_mesh(), FDH14::_mesh(), FDH14::_rotate(), FDH::_rotate(), FDH14::_rotateX(), FDH::_rotateX(), FDH14::_rotateY(), FDH::_rotateY(), FDH14::_rotateZ(), FDH::_rotateZ(), FDH::_scale(), FDH14DistRot::_separation(), FDH14::_transform(), FDH::_transform(), FDH::_translate(), FDH::centroid(), FDH::checkVolume(), FDH::distance(), FDH::dump(), FDH14::extent(), FDH::extent(), FDH::FDH(), FDH6::mapToUV(), FDH::radius(), FDH::separation(), and FDH::~FDH().

const unsigned DIRS = 3 [static, inherited]
 

number of directions

Reimplemented from FDH.

Definition at line 18 of file FDH6.h.

const float EPS = 1e-03 [static, inherited]
 

epsilon variation (tolerance) of zero

Definition at line 20 of file Geometry.h.

Referenced by FDH::_cut_line(), Sphere::_duplicate_attributes(), FDH::_get_corners(), FDH::_mesh(), Sphere::_scale(), Polygon::_triTriCollision(), Sphere::rayIntersection(), Polygon::rayIntersection(), Point3D::rayIntersection(), Hemisphere::rayIntersection(), Sphere::setRadius(), and Sphere::Sphere().

FDHMat [inherited]
 

matrix of directions

Reimplemented from FDH.

Definition at line 36 of file FDH6.h.

const float FDHMat [static, inherited]
 

Initial value:

              
{
  {  1,  0,  0 },
  {  0,  1,  0 },
  {  0,  0,  1 },
  { -1,  0,  0 },
  {  0, -1,  0 },
  {  0,  0, -1 },
}
matrix of directions

Reimplemented from FDH.

Definition at line 20 of file FDH6.h.

const unsigned SIZE = 6 [static, inherited]
 

2 * DIRS

Reimplemented from FDH.

Definition at line 19 of file FDH6.h.


The documentation for this class was generated from the following file:
Generated on Wed Jun 28 12:24:33 2006 for esg by  doxygen 1.4.6