NurbsSphere Class Reference

#include <NurbsSphere.h>

Inheritance diagram for NurbsSphere:

NurbsSurface Geometry ESGObject List of all members.

Public Member Functions

 NurbsSphere (const SDS &ss, AutoPtr< Intersector > *it, float x, float y, float z, float r)
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
Interval extent (float x, float y, float z) const
virtual Vector3 centroid (void) const
virtual double radius (void) const
virtual double radius (const Vector3 &centroid) const
virtual Geometryclone (const Matrix4 *pTrMat) const
Geometryclone (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)
void insideOut (bool b)
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

void _triangulate_surface (const ON_NurbsSurface &, const SDS &, AutoPtr< Intersector > *)
virtual Mesh_mesh (int) const
virtual void _duplicate_attributes (const Geometry &src)
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

Surface_pSurface
 triangulated surface
bool _insideOut

Detailed Description

Sphere represented by NURBS surface.

Definition at line 15 of file NurbsSphere.h.


Constructor & Destructor Documentation

NurbsSphere const SDS ss,
AutoPtr< Intersector > *  it,
float  x,
float  y,
float  z,
float  r
 

Constructor.

Parameters:
ss space subdivision structure (spatial data structure)
it ray intersector
x x coorinate of the center
y y coorinate of the center
z z coorinate of the center
r speher radius

Definition at line 5 of file NurbsSphere.cc.

References NurbsSurface::_triangulate_surface().


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

Reimplemented from Geometry.

Definition at line 135 of file NurbsSurface.cc.

References Geometry::_duplicate_attributes(), and NurbsSurface::_pSurface.

Referenced by NurbsSurface::clone().

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

Implements Geometry.

Definition at line 126 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Geometry::mesh().

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

Implements Geometry.

Definition at line 165 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::_rotate().

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

Implements Geometry.

Definition at line 160 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::_rotate().

void _rotateX float   )  [protected, virtual, inherited]
 

Implements Geometry.

Definition at line 145 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::_rotateX().

void _rotateY float   )  [protected, virtual, inherited]
 

Implements Geometry.

Definition at line 150 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::_rotateY().

void _rotateZ float   )  [protected, virtual, inherited]
 

Implements Geometry.

Definition at line 155 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::_rotateZ().

void _scale float   )  [protected, virtual, inherited]
 

Implements Geometry.

Definition at line 180 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::_scale().

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

Implements Geometry.

Definition at line 175 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::_transform().

Referenced by NurbsSurface::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 170 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::_translate().

void _triangulate_surface const ON_NurbsSurface &  ,
const SDS ,
AutoPtr< Intersector > * 
[protected, inherited]
 

Definition at line 6 of file NurbsSurface.cc.

Referenced by NurbsSphere::NurbsSphere(), and NurbsSurface::NurbsSurface().

Vector3 centroid void   )  const [virtual, inherited]
 

Returns:
centroid (point of gravity) of the geometry

Implements Geometry.

Definition at line 250 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::centroid().

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)

Implements Geometry.

Definition at line 242 of file NurbsSurface.cc.

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

virtual double distance const Geometry geom,
Vector3 pDir
[inline, 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 123 of file NurbsSurface.h.

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 268 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, and Surface::dump().

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.

Definition at line 231 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, Surface::extent(), Interval::max, MAXFLOAT, 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)

Implements Geometry.

Definition at line 225 of file NurbsSurface.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, 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 262 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, MAXDOUBLE, and Surface::radius().

double radius void   )  const [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 from Geometry.

Definition at line 256 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, MAXDOUBLE, and Surface::radius().

virtual bool randomDirection const Vector3 pov,
Vector3 dir,
double *  pdf
[inline, 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 101 of file NurbsSurface.h.

References NurbsSurface::_pSurface, and Surface::randomDirection().

virtual void randomSample int  mask,
PointEnv pe,
double *  pdf
[inline, 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 96 of file NurbsSurface.h.

References NurbsSurface::_pSurface, ENV_HAVE_NOTHING, PointEnv::mask, and Surface::randomSample().

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 213 of file NurbsSurface.cc.

References NurbsSurface::_pSurface, ENV_HAVE_NOTHING, and Surface::rayIntersection().

virtual bool separation Geometry geom,
Vector3 pDir
[inline, 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 119 of file NurbsSurface.h.


Member Data Documentation

bool _insideOut [protected, inherited]
 

Definition at line 23 of file Geometry.h.

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

Surface* _pSurface [protected, inherited]
 

triangulated surface

Definition at line 27 of file NurbsSurface.h.

Referenced by NurbsSurface::_duplicate_attributes(), NurbsSurface::_mesh(), NurbsSurface::_rotate(), NurbsSurface::_rotateX(), NurbsSurface::_rotateY(), NurbsSurface::_rotateZ(), NurbsSurface::_scale(), NurbsSurface::_transform(), NurbsSurface::_translate(), NurbsSurface::centroid(), NurbsSurface::dump(), NurbsSurface::extent(), NurbsSurface::radius(), NurbsSurface::randomDirection(), NurbsSurface::randomSample(), NurbsSurface::rayIntersection(), and NurbsSurface::~NurbsSurface().

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