Geometry Class Reference

#include <Geometry.h>

Inheritance diagram for Geometry:

ESGObject Cylinder FDH NurbsSurface Point3D Polygon Sphere Surface FDH14 FDH6 NurbsSphere Point2D _Surface Rectangle Triangle Hemisphere List of all members.

Public Member Functions

 Geometry ()
virtual ~Geometry ()
void insideOut (bool b)
virtual void rayIntersection (PointEnv *pPE, int mask, const Vector3 &origin, const Vector3 &direction, float maxD=MAXFLOAT)=0
virtual bool mapToUV (const Vector3 &v, Vector2 &uv)=0
virtual void randomSample (int mask, PointEnv &pe, double *pdf)=0
virtual bool randomDirection (const Vector3 &pov, Vector3 &dir, double *pdf)=0
virtual Interval extent (const Vector3 &direction) const =0
Interval extent (float x, float y, float z) const
virtual Vector3 centroid (void) const =0
virtual double radius (const Vector3 &centroid) const =0
virtual double radius (void) const
Geometryclone (void) const
virtual Geometryclone (const Matrix4 *pTrMat) const =0
virtual bool separation (Geometry &geom, Vector3 *pDir)=0
virtual double distance (const Geometry &geom, Vector3 *pDir)=0
virtual void dump (const char *intent, const char *tab)=0
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 =0
virtual void _duplicate_attributes (const Geometry &src)
virtual void _rotateX (float)=0
virtual void _rotateY (float)=0
virtual void _rotateZ (float)=0
virtual void _rotate (float, const Vector3 &)=0
virtual void _rotate (const Matrix3 &)=0
virtual void _translate (float, float, float)=0
virtual void _transform (const Matrix4 &)=0
virtual void _scale (float)=0
void _translate (const Vector3 &v)

Protected Attributes

bool _insideOut

Detailed Description

Geometry attribte of scene graph objects

Definition at line 18 of file Geometry.h.


Constructor & Destructor Documentation

Geometry  )  [inline]
 

Contructor

Definition at line 44 of file Geometry.h.

virtual ~Geometry  )  [inline, virtual]
 

Destructor

Definition at line 49 of file Geometry.h.


Member Function Documentation

virtual void __debug void   )  [inline, virtual]
 

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 src  )  [protected, virtual]
 

Reimplemented in _Surface, Cylinder, FDH, FDH14, Hemisphere, NurbsSurface, Point3D, Polygon, Rectangle, Sphere, Surface, and OSGPolygon.

Definition at line 7 of file Geometry.cc.

References Geometry::_insideOut.

Referenced by Polygon::_duplicate_attributes(), OSGPolygon::_duplicate_attributes(), NurbsSurface::_duplicate_attributes(), FDH::_duplicate_attributes(), Cylinder::_duplicate_attributes(), and _Surface::_duplicate_attributes().

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

Implemented in _Surface, Cylinder, FDH, FDH14, FDH6, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Referenced by Geometry::mesh().

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

Implemented in _Surface, Cylinder, FDH, FDH14, Hemisphere, NurbsSurface, Point3D, Polygon, Rectangle, Sphere, and Surface.

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

Implemented in _Surface, Cylinder, FDH, FDH14, Hemisphere, NurbsSurface, Point3D, Polygon, Rectangle, Sphere, and Surface.

virtual void _rotateX float   )  [protected, pure virtual]
 

Implemented in _Surface, Cylinder, FDH, FDH14, Hemisphere, NurbsSurface, Point2D, Point3D, Polygon, Rectangle, Sphere, and Surface.

virtual void _rotateY float   )  [protected, pure virtual]
 

Implemented in _Surface, Cylinder, FDH, FDH14, Hemisphere, NurbsSurface, Point2D, Point3D, Polygon, Rectangle, Sphere, and Surface.

virtual void _rotateZ float   )  [protected, pure virtual]
 

Implemented in _Surface, Cylinder, FDH, FDH14, Hemisphere, NurbsSurface, Point3D, Polygon, Rectangle, Sphere, and Surface.

virtual void _scale float   )  [protected, pure virtual]
 

Implemented in _Surface, Cylinder, FDH, NurbsSurface, Point3D, Polygon, Rectangle, Sphere, and Surface.

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

Implemented in _Surface, Cylinder, FDH, FDH14, Hemisphere, NurbsSurface, Point3D, Polygon, Rectangle, Sphere, and Surface.

void _translate const Vector3 v  )  [inline, protected]
 

Definition at line 38 of file Geometry.h.

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

Implemented in _Surface, Cylinder, FDH, NurbsSurface, Point2D, Point3D, Polygon, Rectangle, Sphere, and Surface.

virtual Vector3 centroid void   )  const [pure virtual]
 

Returns:
centroid (point of gravity) of the geometry

Implemented in Cylinder, FDH, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Referenced by SphereTree::_enlarge_bv(), POGExplorer::_process_leaf(), Sphere::distance(), Point3D::distance(), Cylinder::distance(), Sphere::separation(), Point3D::separation(), Cylinder::separation(), and Sphere::Sphere().

virtual Geometry* clone const Matrix4 pTrMat  )  const [pure virtual]
 

Duplicates and transforms geometry

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

Implemented in _Surface, Cylinder, FDH, FDH14, FDH6, Hemisphere, NurbsSurface, Point2D, Point3D, Polygon, Sphere, Surface, Triangle, and OSGPolygon.

Geometry* clone void   )  const [inline]
 

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

virtual double distance const Geometry geom,
Vector3 pDir
[pure 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

Implemented in Cylinder, FDH, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Referenced by BVDistRot::distance().

virtual void dump const char *  intent,
const char *  tab
[pure 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

Implemented in _Surface, Cylinder, FDH, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Referenced by BVH::_dump().

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

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.

virtual Interval extent const Vector3 direction  )  const [pure virtual]
 

Returns extent occupied by the geometry in given direction

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

Implemented in Cylinder, FDH, FDH14, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Referenced by FDH14DistRot::_distance(), FDHTree::_enlarge_bv(), IteratorBVH::_halfspace_search(), NExtentsExplorer::_process_leaf(), FDH14DistRot::_separation(), Point3D::distance(), FDH::distance(), Cylinder::distance(), FDH::FDH(), Point3D::separation(), and Cylinder::separation().

void insideOut bool  b  )  [inline]
 

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.

virtual bool mapToUV const Vector3 v,
Vector2 uv
[pure 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)

Implemented in Cylinder, FDH, FDH6, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Mesh * mesh int  density = 0  )  const
 

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]
 

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.

virtual double radius const Vector3 centroid  )  const [pure virtual]
 

Returns radius of minimal packing sphere having given center

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

Implemented in Cylinder, FDH, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Referenced by SphereTree::_enlarge_bv(), RadiusExplorer::_process_leaf(), Sphere::distance(), Sphere::separation(), and Sphere::Sphere().

bool randomDirection const Vector3 pov,
Vector3 dir,
double *  pdf
[pure 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

Implemented in Cylinder, FDH, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Definition at line 12 of file Geometry.cc.

References ENV_HAVE_INTERSECTION, ENV_WANT_INTERSECTION, PointEnv::intersection, PointEnv::mask, and Geometry::randomSample().

virtual void randomSample int  mask,
PointEnv pe,
double *  pdf
[pure 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

Implemented in Cylinder, FDH, Hemisphere, NurbsSurface, Point3D, Polygon, Rectangle, Sphere, Surface, and Triangle.

Referenced by LightArray::emitPhoton(), and Geometry::randomDirection().

virtual void rayIntersection PointEnv pPE,
int  mask,
const Vector3 origin,
const Vector3 direction,
float  maxD = MAXFLOAT
[pure 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)

Implemented in Cylinder, FDH, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Referenced by IteratorBVH::_first_ray_intersection(), IteratorBVH::_next_ray_intersection(), and Intersector::processCandidate().

virtual bool separation Geometry geom,
Vector3 pDir
[pure 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

Implemented in Cylinder, FDH, Hemisphere, NurbsSurface, Point3D, Polygon, Sphere, and Surface.

Referenced by IteratorBVH::_area_search(), BVH::_collision(), and BVDistRot::separation().


Member Data Documentation

bool _insideOut [protected]
 

Definition at line 23 of file Geometry.h.

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

const float EPS = 1e-03 [static]
 

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