Point3D Class Reference

#include <Point3D.h>

Inheritance diagram for Point3D:

Geometry ESGObject Point2D List of all members.

Public Member Functions

 Point3D ()
 Point3D (const Vector3 &v)
 Point3D (float x, float y, float z)
 Point3D (double x, double y, double z)
virtual ~Point3D ()
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 (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)
void setPosition (const Vector3 &p)
void setPosition (float x, float y, float z)
Vector3 getPosition () const
void insideOut (bool b)
Interval extent (float x, float y, float z) const
Geometryclone (void) const
Meshmesh (int density=0) const
virtual void __debug ()

Static Public Attributes

static const float EPS = 1e-03
 epsilon variation (tolerance) of zero

Protected Member Functions

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)
void _translate (const Vector3 &v)

Protected Attributes

Vector3 _position
 point position in space
bool _insideOut

Detailed Description

Simple geometry for point in 3D space.

Definition at line 16 of file Point3D.h.


Constructor & Destructor Documentation

Point3D  ) 
 

Contructor for point located at (0,0,0)

Definition at line 61 of file Point3D.cc.

References Point3D::_position.

Referenced by Point3D::clone().

Point3D const Vector3 v  ) 
 

Contructor.

Parameters:
v point's location

Definition at line 66 of file Point3D.cc.

References Point3D::_position.

Point3D float  x,
float  y,
float  z
 

Contructor.

Parameters:
x x coordinate of point's location
y y coordinate of point's location
z z coordinate of point's location

Definition at line 71 of file Point3D.cc.

References Point3D::_position.

Point3D double  x,
double  y,
double  z
 

Contructor.

Parameters:
x x coordinate of point's location
y y coordinate of point's location
z z coordinate of point's location

Definition at line 76 of file Point3D.cc.

References Point3D::_position.

virtual ~Point3D  )  [inline, virtual]
 

Destructor.

Definition at line 66 of file Point3D.h.


Member Function Documentation

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

Reimplemented in _Surface, FDH, Polygon, Sphere, and Surface.

Definition at line 211 of file Geometry.h.

Referenced by BVH::__debug().

void _duplicate_attributes const Geometry  )  [protected, virtual]
 

Reimplemented from Geometry.

Definition at line 5 of file Point3D.cc.

References Point3D::_position.

Referenced by Point3D::clone(), and Point2D::clone().

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

Implements Geometry.

Definition at line 21 of file Point3D.h.

void _rotate const Matrix3  )  [protected, virtual]
 

Implements Geometry.

Definition at line 38 of file Point3D.cc.

References Point3D::_position.

void _rotate float  ,
const Vector3
[protected, virtual]
 

Implements Geometry.

Definition at line 31 of file Point3D.cc.

References Point3D::_position.

void _rotateX float   )  [protected, virtual]
 

Implements Geometry.

Reimplemented in Point2D.

Definition at line 10 of file Point3D.cc.

References Point3D::_position.

void _rotateY float   )  [protected, virtual]
 

Implements Geometry.

Reimplemented in Point2D.

Definition at line 17 of file Point3D.cc.

References Point3D::_position.

void _rotateZ float   )  [protected, virtual]
 

Implements Geometry.

Definition at line 24 of file Point3D.cc.

References Point3D::_position.

void _scale float   )  [protected, virtual]
 

Implements Geometry.

Definition at line 53 of file Point3D.cc.

References Point3D::_position.

void _transform const Matrix4  )  [protected, virtual]
 

Implements Geometry.

Definition at line 48 of file Point3D.cc.

References Point3D::_position.

Referenced by Point3D::clone(), and Point2D::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.

Reimplemented in Point2D.

Definition at line 43 of file Point3D.cc.

References Point3D::_position.

Vertex3 centroid void   )  const [virtual]
 

Returns:
centroid (point of gravity) of the geometry

Implements Geometry.

Definition at line 161 of file Point3D.cc.

References Point3D::_position.

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 Point2D.

Definition at line 153 of file Point3D.cc.

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

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 189 of file Point3D.cc.

References Point3D::_position, Geometry::centroid(), Geometry::extent(), Interval::max, 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 204 of file Point3D.cc.

References Point3D::_position.

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.

Definition at line 145 of file Point3D.cc.

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

Vector3 getPosition  )  const [inline]
 

Returns:
position in space

Definition at line 117 of file Point3D.h.

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.

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

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 171 of file Point3D.cc.

References Point3D::_position.

double radius void   )  const [virtual]
 

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 from Geometry.

Definition at line 166 of file Point3D.cc.

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 133 of file Point3D.cc.

References Point3D::_position.

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 116 of file Point3D.cc.

References Point3D::_position, ENV_HAVE_NOTHING, ENV_HAVE_SURFACE_POINT, ENV_HAVE_UV_COORD, ENV_WANT_SURFACE_POINT, ENV_WANT_UV_COORD, PointEnv::intersection, PointEnv::mask, and PointEnv::uvCoord.

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 81 of file Point3D.cc.

References Point3D::_position, PointEnv::distance, ENV_HAVE_DISTANCE, ENV_HAVE_INTERFERENCE, ENV_HAVE_INTERSECTION, ENV_HAVE_NOTHING, ENV_HAVE_UV_COORD, ENV_WANT_DISTANCE, ENV_WANT_INTERSECTION, ENV_WANT_UV_COORD, Geometry::EPS, PointEnv::intersection, PointEnv::mask, MAXFLOAT, and PointEnv::uvCoord.

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 176 of file Point3D.cc.

References Point3D::_position, Geometry::centroid(), Geometry::extent(), and Interval::max.

void setPosition float  x,
float  y,
float  z
[inline]
 

Parameters:
x new x position
y new y position
z new z position

Definition at line 110 of file Point3D.h.

void setPosition const Vector3 p  )  [inline]
 

Parameters:
p new position

Definition at line 101 of file Point3D.h.

Referenced by Point2D::setPosition().


Member Data Documentation

bool _insideOut [protected, inherited]
 

Definition at line 23 of file Geometry.h.

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

Vector3 _position [protected]
 

point position in space

Definition at line 18 of file Point3D.h.

Referenced by Point3D::_duplicate_attributes(), Point3D::_rotate(), Point3D::_rotateX(), Point3D::_rotateY(), Point3D::_rotateZ(), Point3D::_scale(), Point3D::_transform(), Point3D::_translate(), Point3D::centroid(), Point3D::distance(), Point3D::dump(), Point3D::extent(), Point3D::Point3D(), Point3D::radius(), Point3D::randomDirection(), Point3D::randomSample(), Point3D::rayIntersection(), and Point3D::separation().

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


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