FDH Class Reference

#include <FDH.h>

Inheritance diagram for FDH:

Geometry ESGObject FDH14 FDH6 Box List of all members.

Public Member Functions

 FDH (unsigned dirs, const float(*mat)[3], SceneGraphObject &object)
 FDH (unsigned dirs, const float(*mat)[3], List< SceneGraphObject > &list)
 FDH (unsigned dirs, const float(*mat)[3], const Geometry &geom1, const Geometry &geom2)
 FDH (unsigned dirs, const float(*mat)[3], const Geometry &geom)
 FDH (unsigned dirs, const float(*mat)[3], const float values[])
virtual ~FDH ()
virtual void rayIntersection (PointEnv *pPE, int mask, const Vector3 &origin, const Vector3 &direction, float maxD=MAXFLOAT)
virtual bool mapToUV (const Vector3 &v, Vector2 &uv)
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
virtual Vector3 centroid (void) const
virtual double radius (const Vector3 &centroid) const
virtual Geometryclone (const Matrix4 *pTrMat) 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)
Interval extent (float x, float y, float z) const
virtual double radius (void) const
Geometryclone (void) const
Meshmesh (int density=0) const

Static Public Attributes

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

Protected Member Functions

int _cut_line (Vector3d &, Vector3d &) const
virtual Vector3d * _get_corners (unsigned &numCorners, unsigned(*facetVert)[100], unsigned nFacetCert[]) const
virtual Mesh_mesh (int) 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)
virtual void _transform (const Matrix4 &)
virtual void _scale (float)
 FDH (unsigned d, const float(*m)[3])
void _translate (const Vector3 &v)

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

Classes

struct  FDHCache

Detailed Description

FDH = Fixed Directions Hull, known also as k-DOP (k-dimensional Discrete Orientation Polytope)

Definition at line 18 of file FDH.h.


Constructor & Destructor Documentation

FDH unsigned  d,
const float *  m[3]
[inline, protected]
 

Definition at line 83 of file FDH.h.

Referenced by FDH::clone().

FDH unsigned  dirs,
const float *  mat[3],
SceneGraphObject object
 

Constructor - makes FDH packing SG object

Parameters:
dirs number of directions
mat matrix of directions
object scene graph object that is packed

Definition at line 476 of file FDH.cc.

References FDH::_mat, FDH::_values, Explorer::explore(), Interval::max, Interval::min, and NExtentsExplorer::result().

FDH unsigned  dirs,
const float *  mat[3],
List< SceneGraphObject > &  list
 

Constructor - makes FDH packing SG objects stored in list

Parameters:
dirs number of directions
mat matrix of directions
list list of scene graph objects that are packed

Definition at line 493 of file FDH.cc.

References FDH::_mat, FDH::_values, Explorer::explore(), List::firstItem(), Interval::max, MAXFLOAT, Interval::min, List::nextItem(), and NExtentsExplorer::result().

FDH unsigned  dirs,
const float *  mat[3],
const Geometry geom1,
const Geometry geom2
 

Constructor - makes FDH packing two geometries

Parameters:
dirs number of directions
mat matrix of directions
geom1 first geometry
geom1 second geometry

Definition at line 518 of file FDH.cc.

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

FDH unsigned  dirs,
const float *  mat[3],
const Geometry geom
 

Constructor - makes FDH packing some geometry

Parameters:
dirs number of directions
mat matrix of directions
geom geometry for packing

Definition at line 537 of file FDH.cc.

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

FDH unsigned  dirs,
const float *  mat[3],
const float  values[]
 

Constructor - makes FDH directly from values (extents)

Parameters:
dirs number of directions
mat matrix of directions
values FDH values (extents)

Definition at line 552 of file FDH.cc.

References FDH::_values.

~FDH  )  [virtual]
 

Destructor

Definition at line 562 of file FDH.cc.

References FDH::_values.


Member Function Documentation

virtual void __debug void   )  [inline, virtual]
 

For debugging purposes

Reimplemented from Geometry.

Definition at line 188 of file FDH.h.

int _cut_line Vector3d &  ,
Vector3d & 
const [protected]
 

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]
 

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]
 

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

Mesh * _mesh int   )  const [protected, virtual]
 

Implements Geometry.

Reimplemented in FDH14, and FDH6.

Definition at line 157 of file FDH.cc.

References FDH::_dirs, FDH::_get_corners(), FDH::_mat, Geometry::EPS, and MAXFLOAT.

void _rotate const Matrix3  )  [protected, virtual]
 

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]
 

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]
 

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]
 

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]
 

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]
 

Implements Geometry.

Definition at line 468 of file FDH.cc.

References FDH::_values.

void _transform const Matrix4  )  [protected, virtual]
 

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]
 

Implements Geometry.

Definition at line 415 of file FDH.cc.

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

Vector3 centroid void   )  const [virtual]
 

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]
 

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]
 

Duplicates and transforms geometry

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

Implements Geometry.

Reimplemented in FDH14, and FDH6.

Definition at line 716 of file FDH.cc.

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

double distance const Geometry geom,
Vector3 pDir
[virtual]
 

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]
 

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]
 

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]
 

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)

Implements Geometry.

Reimplemented in FDH6.

Definition at line 665 of file FDH.cc.

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]
 

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]
 

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]
 

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]
 

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]
 

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.


Member Data Documentation

const unsigned _dirs [protected]
 

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]
 

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]
 

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 [static]
 

number of directions

Reimplemented in FDH14, and FDH6.

Definition at line 20 of file FDH.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().

const float FDHMat[][3] [static]
 

matrix of directions

Reimplemented in FDH14, FDH14, FDH6, and FDH6.

Definition at line 22 of file FDH.h.

const unsigned SIZE [static]
 

2 * DIRS

Reimplemented in FDH14, and FDH6.

Definition at line 21 of file FDH.h.


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