lux::Mesh Class Reference

#include <mesh.h>

Inheritance diagram for lux::Mesh:
[legend]
Collaboration diagram for lux::Mesh:
[legend]

List of all members.

Classes

class  BaryMesh
class  LoopMesh
class  WaldMesh

Public Types

enum  MeshTriangleType { TRI_WALD, TRI_BARY, TRI_AUTO }
enum  MeshQuadType { QUAD_QUADRILATERAL }
enum  MeshAccelType {
  ACCEL_KDTREE, ACCEL_QBVH, ACCEL_NONE, ACCEL_GRID,
  ACCEL_BRUTEFORCE, ACCEL_AUTO
}
enum  MeshSubdivType { SUBDIV_LOOP }

Public Member Functions

 Mesh (const Transform &o2w, bool ro, MeshAccelType acceltype, int nv, const Point *P, const Normal *N, const float *UV, MeshTriangleType tritype, int trisCount, const int *tris, MeshQuadType quadtype, int nquadsCount, const int *quads, MeshSubdivType subdivType, int nsubdivlevels, boost::shared_ptr< Texture< float > > displacementMap, float displacementMapScale, float displacementMapOffset, bool displacementMapNormalSmooth, bool displacementMapSharpBoundary)
virtual ~Mesh ()
virtual BBox ObjectBound () const
virtual BBox WorldBound () const
virtual bool CanIntersect () const
virtual void Refine (vector< boost::shared_ptr< Primitive > > &refined, const PrimitiveRefinementHints &refineHints, boost::shared_ptr< Primitive > thisPtr)
virtual bool CanSample () const

Static Public Member Functions

static ShapeCreateShape (const Transform &o2w, bool reverseOrientation, const ParamSet &params)

Protected Attributes

MeshAccelType accelType
int nverts
Pointp
Normaln
float * uvs
MeshTriangleType triType
int ntris
inttriVertexIndex
MeshQuadType quadType
int nquads
intquadVertexIndex
bool mustSubdivide
int nSubdivLevels
MeshSubdivType subdivType
boost::shared_ptr< Texture
< float > > 
displacementMap
float displacementMapScale
float displacementMapOffset
bool displacementMapNormalSmooth
bool displacementMapSharpBoundary

Friends

class MeshWaldTriangle
class MeshBaryTriangle
class MeshQuadrilateral

Detailed Description

Definition at line 29 of file mesh.h.


Member Enumeration Documentation

Enumerator:
ACCEL_KDTREE 
ACCEL_QBVH 
ACCEL_NONE 
ACCEL_GRID 
ACCEL_BRUTEFORCE 
ACCEL_AUTO 

Definition at line 33 of file mesh.h.

Enumerator:
QUAD_QUADRILATERAL 

Definition at line 32 of file mesh.h.

Enumerator:
SUBDIV_LOOP 

Definition at line 34 of file mesh.h.

Enumerator:
TRI_WALD 
TRI_BARY 
TRI_AUTO 

Definition at line 31 of file mesh.h.


Constructor & Destructor Documentation

Mesh::Mesh ( const Transform o2w,
bool  ro,
MeshAccelType  acceltype,
int  nv,
const Point P,
const Normal N,
const float *  UV,
MeshTriangleType  tritype,
int  trisCount,
const int tris,
MeshQuadType  quadtype,
int  nquadsCount,
const int quads,
MeshSubdivType  subdivType,
int  nsubdivlevels,
boost::shared_ptr< Texture< float > >  displacementMap,
float  displacementMapScale,
float  displacementMapOffset,
bool  displacementMapNormalSmooth,
bool  displacementMapSharpBoundary 
)
Mesh::~Mesh (  )  [virtual]

Definition at line 183 of file mesh.cpp.

References n, p, quadVertexIndex, triVertexIndex, and uvs.


Member Function Documentation

virtual bool lux::Mesh::CanIntersect (  )  const [inline, virtual]

Returns whether this primitive can be intersected.

Reimplemented from lux::Shape.

Definition at line 49 of file mesh.h.

virtual bool lux::Mesh::CanSample (  )  const [inline, virtual]

Returns whether this primitive can be sampled.

Reimplemented from lux::Shape.

Definition at line 53 of file mesh.h.

Shape * Mesh::CreateShape ( const Transform o2w,
bool  reverseOrientation,
const ParamSet params 
) [static]
BBox Mesh::ObjectBound (  )  const [virtual]

Reimplemented from lux::Shape.

Definition at line 192 of file mesh.cpp.

References nverts, p, lux::Union(), and lux::Shape::WorldToObject.

void Mesh::Refine ( vector< boost::shared_ptr< Primitive > > &  refined,
const PrimitiveRefinementHints refineHints,
boost::shared_ptr< Primitive thisPtr 
) [virtual]

Refines this primitive to a number of primitives that are intersectable and satisfy all the given hints if possible. If this primitive should not be deallocated after refinement, it must make sure that one of the refined primitives has a shared pointer to this primitive (i.e. a copy of thisPtr)

Parameters:
refined The destenation list for the result.
refineHints The hints for the refinement.
thisPtr The shared pointer to this primitive.

Reimplemented from lux::Shape.

Definition at line 219 of file mesh.cpp.

References ACCEL_AUTO, ACCEL_BRUTEFORCE, ACCEL_GRID, ACCEL_KDTREE, ACCEL_NONE, ACCEL_QBVH, accelType, displacementMap, displacementMapNormalSmooth, displacementMapOffset, displacementMapScale, displacementMapSharpBoundary, lux::PrimitiveRefinementHints::forSampling, lux::MeshQuadrilateral::isDegenerate(), lux::MeshBaryTriangle::isDegenerate(), lux::MeshWaldTriangle::isDegenerate(), LUX_CONSISTENCY, LUX_DEBUG, LUX_ERROR, LUX_NOERROR, luxError, lux::MakeAccelerator(), memcpy(), MeshBaryTriangle, MeshQuadrilateral, MeshWaldTriangle, mustSubdivide, n, lux::Normalize(), nquads, nSubdivLevels, ntris, nverts, lux::Shape::ObjectToWorld, p, QUAD_QUADRILATERAL, quadType, lux::LoopSubdiv::Refine(), lux::Shape::reverseOrientation, SUBDIV_LOOP, subdivType, cimg_library::cimg::swap(), TRI_AUTO, TRI_BARY, TRI_WALD, triType, triVertexIndex, and uvs.

BBox Mesh::WorldBound (  )  const [virtual]

Returns the world bounds of this primitive.

Reimplemented from lux::Shape.

Definition at line 200 of file mesh.cpp.

References nverts, p, and lux::Union().


Friends And Related Function Documentation

friend class MeshBaryTriangle [friend]

Definition at line 56 of file mesh.h.

Referenced by Refine().

friend class MeshQuadrilateral [friend]

Definition at line 57 of file mesh.h.

Referenced by Refine().

friend class MeshWaldTriangle [friend]

Definition at line 55 of file mesh.h.

Referenced by Refine().


Member Data Documentation

Definition at line 78 of file mesh.h.

Referenced by Mesh(), and Refine().

boost::shared_ptr<Texture<float> > lux::Mesh::displacementMap [protected]

Definition at line 101 of file mesh.h.

Referenced by Mesh(), and Refine().

Definition at line 104 of file mesh.h.

Referenced by Mesh(), and Refine().

Definition at line 103 of file mesh.h.

Referenced by Mesh(), and Refine().

Definition at line 102 of file mesh.h.

Referenced by Mesh(), and Refine().

Definition at line 104 of file mesh.h.

Referenced by Mesh(), and Refine().

bool lux::Mesh::mustSubdivide [protected]

Definition at line 97 of file mesh.h.

Referenced by Mesh(), and Refine().

Normal* lux::Mesh::n [protected]
int lux::Mesh::nquads [protected]

Definition at line 93 of file mesh.h.

Referenced by Mesh(), and Refine().

Definition at line 98 of file mesh.h.

Referenced by Mesh(), and Refine().

int lux::Mesh::ntris [protected]

Definition at line 88 of file mesh.h.

Referenced by Mesh(), and Refine().

int lux::Mesh::nverts [protected]

Definition at line 81 of file mesh.h.

Referenced by Mesh(), ObjectBound(), Refine(), and WorldBound().

Point* lux::Mesh::p [protected]

Definition at line 92 of file mesh.h.

Referenced by Mesh(), and Refine().

Definition at line 94 of file mesh.h.

Referenced by Mesh(), and ~Mesh().

Definition at line 99 of file mesh.h.

Referenced by Mesh(), and Refine().

Definition at line 87 of file mesh.h.

Referenced by Mesh(), and Refine().

Definition at line 89 of file mesh.h.

Referenced by Mesh(), Refine(), and ~Mesh().

float* lux::Mesh::uvs [protected]

The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208