#include <Surface.h>
Inheritance diagram for Surface:
Public Types | |
enum | VertOrder { TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN, QUADS, QUAD_STRIP } |
Public Member Functions | |
Surface (const SDS &ss, AutoArray< Vertex3 > *va, unsigned nv, AutoArray< Vector3 > *na, unsigned nn, AutoArray< Vector2 > *uva, unsigned uvn, enum VertOrder vo, AutoPtr< Intersector > *it, bool fm) | |
virtual | ~Surface () |
void | normal (const Vector3 &v) |
bool | vertex (unsigned index) |
bool | vertex (unsigned vindex, unsigned nindex) |
bool | vertex (unsigned vindex, unsigned nindex, unsigned uvindex) |
bool | vertexUV (unsigned vindex, unsigned uvindex) |
bool | done (void) |
const _Surface * | firstPlane (void) |
const _Surface * | nextPlane (void) |
unsigned | numPlanes (void) const |
bool | firstVertex (void) |
bool | nextVertex (void) |
Vertex3 | actVertex (void) const |
unsigned | numVertices (void) const |
unsigned | numEdges (void) const |
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 ¢roid) const |
virtual Geometry * | clone (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 void | __debug () |
SDS * | __get_repository () |
void | insideOut (bool b) |
Interval | extent (float x, float y, float z) const |
Geometry * | clone (void) const |
Mesh * | mesh (int density=0) const |
Static Public Attributes | |
static const float | EPS = 1e-03 |
epsilon variation (tolerance) of zero | |
Protected Member Functions | |
bool | _check_vertex (void) |
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) |
Surface () | |
void | _translate (const Vector3 &v) |
Protected Attributes | |
AutoArray< Vertex3 > * | _pAutoVertices |
AutoArray< Vector3 > * | _pAutoNormals |
AutoArray< Vector2 > * | _pAutoUVCoords |
unsigned | _nVert |
unsigned | _nNorm |
unsigned | _nUVCoords |
SDS * | _pRepository |
bool | _created |
VertOrder | _vertOrder |
IteratorSDS * | _pIterator |
AutoPtr< Intersector > * | _pAutoInter |
bool | _fastMesh |
unsigned | _nSurfaces |
Vertex3 * | _vertices |
Vector3 * | _normals |
Vector2 * | _uvCoords |
Intersector * | _pIntersector |
Vector3 | _auxPlaneNormal |
bool | _havePlaneNormal |
unsigned | _primVertIndices [4] |
unsigned | _primNormIndices [4] |
unsigned | _primUVIndices [4] |
unsigned | _primVertices |
unsigned | _primActVert |
unsigned | _vertIndex |
esg::Surface::HitPoint * | _pPreviousHit |
bool | _insideOut |
Friends | |
class | NurbsSurface |
Classes | |
struct | HitPoint |
Restrictions: 1) vertex(unsigned), vertex(unsigned, unsigned), vertex(unsigned, unsigned, unsigned) and vertexUV(unsigned, unsigned) methods of vertex definition are used with accord to existance of corresponding global arrays, i.e. vertices, vertices+normals, vertices+normals+uv_coords and vertices+uv_coords. 2) The done() method must be called at the end of surface definition. 3) normal() defines normal vector for the next polygon ONLY. 4) If normal vectors of surface facets are defined then they should be properly oriented (e.g. all directed outward a solid). 5) When using TRIANGLES or QUADS method of surface creation then edge loops of all facets must be oriented in the same way (preffered loop direction is counter-clockwise because clockwise loops creates facet normals directing towards a solid). 6) The array of vertices should contain only vertices really used by any facet because some operations like extent() works directly with this array.
Protocol: Surface s(...); [s.normal(x,y,z);] s.vertex(index1, index2); s.vertex(...); ... s.done();
Definition at line 50 of file Surface.h.
|
|
|
|
|
|
Destructor Definition at line 429 of file Surface.cc. References Surface::_pAutoInter, Surface::_pAutoNormals, Surface::_pAutoUVCoords, Surface::_pAutoVertices, Surface::_pPreviousHit, and Surface::_pRepository. |
|
For debugging purposes. Reimplemented from Geometry. |
|
For debugging purposes. |
|
Definition at line 7 of file Surface.cc. References Surface::_auxPlaneNormal, Surface::_havePlaneNormal, Surface::_normals, Surface::_nSurfaces, Surface::_pRepository, Surface::_primActVert, Surface::_primNormIndices, Surface::_primUVIndices, Surface::_primVertices, Surface::_primVertIndices, Surface::_uvCoords, Surface::_vertices, Surface::_vertOrder, Surface::QUAD_STRIP, Surface::QUADS, Surface::TRIANGLE_FAN, Surface::TRIANGLE_STRIP, and Surface::TRIANGLES. Referenced by Surface::vertex(), and Surface::vertexUV(). |
|
Reimplemented from Geometry. Definition at line 108 of file Surface.cc. References Surface::_created, Surface::_fastMesh, Surface::_nNorm, Surface::_normals, Surface::_nSurfaces, Surface::_nUVCoords, Surface::_nVert, Surface::_pAutoInter, Surface::_pAutoNormals, Surface::_pAutoUVCoords, Surface::_pAutoVertices, Surface::_pIntersector, Surface::_pIterator, Surface::_pPreviousHit, Surface::_pRepository, Surface::_uvCoords, Surface::_vertices, Surface::_vertOrder, _Surface::clone(), IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), IteratorSDS::nextChild(), AutoPtr::origObject(), and AutoPtr::registerReferer(). Referenced by Surface::clone(). |
|
Implements Geometry. Definition at line 66 of file Surface.cc. References Surface::_created, Surface::_fastMesh, Surface::_nVert, Surface::_pIterator, Surface::_vertices, _Surface::_vindices, PolygonalMesh::addFacet(), IteratorSDS::firstChild(), Polygon::getFacetNormal(), _Surface::getVertNormal(), Polygon::haveFixedNormal(), _Surface::haveVertNormals(), IteratorSDS::initChildrenSearch(), IteratorSDS::nextChild(), and Polygon::numVertices(). |
|
Implements Geometry. Definition at line 270 of file Surface.cc. References Surface::_created, Surface::_nNorm, Surface::_normals, Surface::_nVert, Surface::_pIterator, _Surface::_rotate(), Surface::_vertices, IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), and IteratorSDS::nextChild(). |
|
Implements Geometry. Definition at line 247 of file Surface.cc. References Surface::_created, Surface::_nNorm, Surface::_normals, Surface::_nVert, Surface::_pIterator, _Surface::_transform(), Surface::_vertices, IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), and IteratorSDS::nextChild(). Referenced by NurbsSurface::_rotate(). |
|
Implements Geometry. Definition at line 184 of file Surface.cc. References Surface::_created, Surface::_nNorm, Surface::_normals, Surface::_nVert, Surface::_pIterator, _Surface::_rotate(), Surface::_vertices, IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), and IteratorSDS::nextChild(). Referenced by NurbsSurface::_rotateX(). |
|
Implements Geometry. Definition at line 205 of file Surface.cc. References Surface::_created, Surface::_nNorm, Surface::_normals, Surface::_nVert, Surface::_pIterator, _Surface::_rotate(), Surface::_vertices, IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), and IteratorSDS::nextChild(). Referenced by NurbsSurface::_rotateY(). |
|
Implements Geometry. Definition at line 226 of file Surface.cc. References Surface::_created, Surface::_nNorm, Surface::_normals, Surface::_nVert, Surface::_pIterator, _Surface::_rotate(), Surface::_vertices, IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), and IteratorSDS::nextChild(). Referenced by NurbsSurface::_rotateZ(). |
|
Implements Geometry. Definition at line 327 of file Surface.cc. References Surface::_created, Surface::_nVert, Surface::_pIterator, _Surface::_scale(), Surface::_vertices, IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), and IteratorSDS::nextChild(). Referenced by NurbsSurface::_scale(). |
|
Implements Geometry. Definition at line 306 of file Surface.cc. References Surface::_created, Surface::_nNorm, Surface::_normals, Surface::_nVert, Surface::_pIterator, and Surface::_vertices. Referenced by NurbsSurface::_transform(), and Surface::clone(). |
|
Definition at line 38 of file Geometry.h. |
|
Implements Geometry. Definition at line 288 of file Surface.cc. References Surface::_created, Surface::_nVert, Surface::_pIterator, and Surface::_vertices. Referenced by NurbsSurface::_translate(). |
|
Per-vertex inspection.
Definition at line 254 of file Surface.h. Referenced by SurfaceMesh::getActVert(). |
|
Implements Geometry. Definition at line 655 of file Surface.cc. References Surface::_created, Surface::_nVert, and Surface::_vertices. Referenced by NurbsSurface::centroid(). |
|
Duplicates geometry
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(). |
|
Duplicates and transforms geometry
Implements Geometry. Definition at line 644 of file Surface.cc. References Surface::_created, Surface::_duplicate_attributes(), and Surface::_transform(). |
|
Computes approximate distance between this and given geometries (lower bound of distance)
Implements Geometry. |
|
Builds the surface, must be called when all vertices of the surface are defined.
Definition at line 478 of file Surface.cc. References Surface::_created, Surface::_pRepository, and SDS::build(). |
|
Writes information about this geometry to std. out.
Implements Geometry. Definition at line 682 of file Surface.cc. References Surface::_fastMesh, Surface::_nNorm, Surface::_normals, Surface::_nSurfaces, Surface::_nUVCoords, Surface::_nVert, Surface::_pRepository, Surface::_uvCoords, Surface::_vertices, Surface::_vertOrder, SDS::dump(), Surface::QUAD_STRIP, Surface::QUADS, Surface::TRIANGLE_FAN, Surface::TRIANGLE_STRIP, and Surface::TRIANGLES. Referenced by NurbsSurface::dump(). |
|
Returns extent occupied by the geometry in given direction
Definition at line 124 of file Geometry.h. |
|
Returns extent occupied by the geometry in given direction
Implements Geometry. Definition at line 630 of file Surface.cc. References Surface::_created, Surface::_nVert, Surface::_vertices, Interval::max, and Interval::min. Referenced by NurbsSurface::extent(). |
|
Per-surface inspection.
Definition at line 484 of file Surface.cc. References Surface::_pIterator, IteratorSDS::firstChild(), and IteratorSDS::initChildrenSearch(). Referenced by SurfaceMesh::resetActPlane(), and SurfaceMesh::resetEdgeWalkInSolid(). |
|
Per-vertex inspection. Sets position to the first vertex of the surface.
Definition at line 234 of file Surface.h. Referenced by SurfaceMesh::resetVertWalkInSolid(). |
|
Inverts facet normals (turns the object inside-out)
Definition at line 56 of file Geometry.h. |
|
Maps 3D point from surface to the UV surface representation
Implements Geometry. Definition at line 600 of file Surface.cc. |
|
Returns polygonal mesh computed from this geometry
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(). |
|
Per-surface inspection.
Definition at line 491 of file Surface.cc. References Surface::_pIterator, and IteratorSDS::nextChild(). Referenced by SurfaceMesh::goToNextPlane(). |
|
Per-vertex inspection. Sets position to the next vertex of the surface.
Definition at line 245 of file Surface.h. Referenced by SurfaceMesh::stepInVertWalkInSolid(). |
|
Sets facet normal for the next polygon.
Definition at line 439 of file Surface.cc. References Surface::_auxPlaneNormal, and Surface::_havePlaneNormal. Referenced by MayaParser::_parse_triangle(). |
|
Definition at line 496 of file Surface.cc. References Surface::_pRepository, SDS::createIterator(), IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), IteratorSDS::nextChild(), and Polygon::numVertices(). Referenced by SurfaceMesh::numberOfEdges(). |
|
Per-surface inspection.
|
|
Per-vertex inspection.
Definition at line 263 of file Surface.h. Referenced by SurfaceMesh::numberOfVertices(). |
|
Returns radius of minimal packing sphere having given center
Implements Geometry. Definition at line 667 of file Surface.cc. References Surface::_created, Surface::_nVert, Surface::_vertices, and MAXDOUBLE. |
|
Returns radius of minimal packing sphere with center in the ceontroid of the geometry
Reimplemented from Geometry. Definition at line 294 of file Surface.h. Referenced by NurbsSurface::radius(). |
|
Computes random direction towards the surface in accord to the point of view.
Implements Geometry. Definition at line 619 of file Surface.cc. References Surface::_nSurfaces, Surface::_pIterator, IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), IteratorSDS::nextChild(), and Polygon::randomDirection(). Referenced by NurbsSurface::randomDirection(). |
|
Computes random point on the surface
Implements Geometry. Definition at line 606 of file Surface.cc. References Surface::_nSurfaces, Surface::_pIterator, ENV_HAVE_NOTHING, IteratorSDS::firstChild(), IteratorSDS::initChildrenSearch(), PointEnv::mask, IteratorSDS::nextChild(), and Polygon::randomSample(). Referenced by NurbsSurface::randomSample(). |
|
Computes point of intersection of ray with this geometry
Implements Geometry. Definition at line 513 of file Surface.cc. References Surface::_created, Surface::_pIntersector, Surface::_pIterator, Surface::_pPreviousHit, Intersector::adoptIntersection(), PointEnv::distance, ENV_HAVE_DISTANCE, ENV_HAVE_INTERFERENCE, ENV_HAVE_INTERSECTION, ENV_HAVE_N_DOT_D, ENV_HAVE_N_DOT_O, ENV_HAVE_NORMAL, ENV_HAVE_NOTHING, ENV_WANT_DISTANCE, ENV_WANT_INTERSECTION, ENV_WANT_NORMAL, IteratorSDS::firstChild(), Intersector::getActDistance(), Intersector::init(), IteratorSDS::initRayIntersection(), PointEnv::intersection, IteratorSDS::lastExploitedElement(), PointEnv::mask, PointEnv::nd, IteratorSDS::nextChild(), PointEnv::no, PointEnv::normal, PointEnv::normalOrientation, Surface::HitPoint::point, Intersector::processCandidate(), and Surface::HitPoint::pSDSLeaf. Referenced by NurbsSurface::rayIntersection(). |
|
Checks if there is separation between this and given geometries
Implements Geometry. |
|
Defines new vertex of the polygon.
Definition at line 461 of file Surface.cc. References Surface::_check_vertex(), Surface::_nNorm, Surface::_normals, Surface::_nUVCoords, Surface::_nVert, Surface::_primActVert, Surface::_primNormIndices, Surface::_primUVIndices, Surface::_primVertIndices, and Surface::_uvCoords. |
|
Defines new vertex and its vertex normal of the polygon.
Definition at line 453 of file Surface.cc. References Surface::_check_vertex(), Surface::_nNorm, Surface::_normals, Surface::_nVert, Surface::_primActVert, Surface::_primNormIndices, and Surface::_primVertIndices. |
|
Defines new vertex of the polygon.
Definition at line 445 of file Surface.cc. References Surface::_check_vertex(), Surface::_normals, Surface::_nVert, Surface::_primActVert, and Surface::_primVertIndices. Referenced by MayaParser::_parse_triangle(). |
|
Defines new vertex of the polygon.
Definition at line 470 of file Surface.cc. References Surface::_check_vertex(), Surface::_nUVCoords, Surface::_nVert, Surface::_primActVert, Surface::_primUVIndices, Surface::_primVertIndices, and Surface::_uvCoords. |
|
|
|
Definition at line 84 of file Surface.h. Referenced by Surface::_check_vertex(), and Surface::normal(). |
|
Definition at line 70 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::_mesh(), Surface::_rotate(), Surface::_rotateX(), Surface::_rotateY(), Surface::_rotateZ(), Surface::_scale(), Surface::_transform(), Surface::_translate(), Surface::centroid(), Surface::clone(), Surface::done(), Surface::extent(), Surface::radius(), Surface::rayIntersection(), and Surface::Surface(). |
|
Definition at line 74 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::_mesh(), Surface::dump(), and Surface::Surface(). |
|
Definition at line 85 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::normal(), and Surface::Surface(). |
|
Definition at line 23 of file Geometry.h. Referenced by Geometry::_duplicate_attributes(), and Geometry::mesh(). |
|
Definition at line 67 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::_rotate(), Surface::_rotateX(), Surface::_rotateY(), Surface::_rotateZ(), Surface::_transform(), Surface::dump(), Surface::Surface(), and Surface::vertex(). |
|
Definition at line 79 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::_duplicate_attributes(), Surface::_rotate(), Surface::_rotateX(), Surface::_rotateY(), Surface::_rotateZ(), Surface::_transform(), Surface::dump(), Surface::Surface(), and Surface::vertex(). |
|
Definition at line 75 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::_duplicate_attributes(), Surface::dump(), Surface::randomDirection(), Surface::randomSample(), and Surface::Surface(). |
|
Definition at line 68 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::dump(), Surface::Surface(), Surface::vertex(), and Surface::vertexUV(). |
|
Definition at line 66 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::_mesh(), Surface::_rotate(), Surface::_rotateX(), Surface::_rotateY(), Surface::_rotateZ(), Surface::_scale(), Surface::_transform(), Surface::_translate(), Surface::centroid(), Surface::dump(), Surface::extent(), Surface::radius(), Surface::Surface(), Surface::vertex(), and Surface::vertexUV(). |
|
Definition at line 73 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::Surface(), and Surface::~Surface(). |
|
Definition at line 64 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::Surface(), and Surface::~Surface(). |
|
Definition at line 65 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::Surface(), and Surface::~Surface(). |
|
Definition at line 63 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::Surface(), and Surface::~Surface(). |
|
Definition at line 81 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::rayIntersection(), and Surface::Surface(). |
|
Definition at line 72 of file Surface.h. Referenced by Surface::_duplicate_attributes(), Surface::_mesh(), Surface::_rotate(), Surface::_rotateX(), Surface::_rotateY(), Surface::_rotateZ(), Surface::_scale(), Surface::_transform(), Surface::_translate(), Surface::firstPlane(), Surface::nextPlane(), Surface::randomDirection(), Surface::randomSample(), Surface::rayIntersection(), and Surface::Surface(). |
|
Referenced by Surface::_duplicate_attributes(), Surface::rayIntersection(), Surface::Surface(), and Surface::~Surface(). |
|
Definition at line 69 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::_duplicate_attributes(), Surface::done(), Surface::dump(), Surface::numEdges(), Surface::Surface(), and Surface::~Surface(). |
|
Definition at line 90 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::Surface(), Surface::vertex(), and Surface::vertexUV(). |
|
Definition at line 87 of file Surface.h. Referenced by Surface::_check_vertex(), and Surface::vertex(). |
|
Definition at line 88 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::vertex(), and Surface::vertexUV(). |
|
Definition at line 89 of file Surface.h. Referenced by Surface::_check_vertex(), and Surface::Surface(). |
|
Definition at line 86 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::vertex(), and Surface::vertexUV(). |
|
Definition at line 80 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::_duplicate_attributes(), Surface::dump(), Surface::Surface(), Surface::vertex(), and Surface::vertexUV(). |
|
Definition at line 78 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::_duplicate_attributes(), Surface::_mesh(), Surface::_rotate(), Surface::_rotateX(), Surface::_rotateY(), Surface::_rotateZ(), Surface::_scale(), Surface::_transform(), Surface::_translate(), Surface::centroid(), Surface::dump(), Surface::extent(), Surface::radius(), and Surface::Surface(). |
|
|
|
Definition at line 71 of file Surface.h. Referenced by Surface::_check_vertex(), Surface::_duplicate_attributes(), Surface::dump(), and Surface::Surface(). |
|
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(). |