#include <loopsubdiv.h>
Public Member Functions | |
LoopSubdiv (const Transform &o2w, bool ro, int nt, int nv, const int *vi, const Point *P, const float *uv, int nlevels, const boost::shared_ptr< Texture< float > > dismap, float dmscale, float dmoffset, bool dmnormalsmooth, bool dmsharpboundary) | |
~LoopSubdiv () | |
bool | CanIntersect () const |
void | Refine (vector< boost::shared_ptr< Shape > > &refined) const |
BBox | ObjectBound () const |
BBox | WorldBound () const |
Static Public Member Functions | |
static Shape * | CreateShape (const Transform &o2w, bool reverseOrientation, const ParamSet ¶ms, map< string, boost::shared_ptr< Texture< float > > > *floatTextures) |
Private Member Functions | |
float | beta (int valence) const |
void | weightOneRing (SDVertex *destVert, SDVertex *vert, float beta) const |
void | weightBoundary (SDVertex *destVert, SDVertex *vert, float beta) const |
float | gamma (int valence) const |
void | ApplyDisplacementMap (const vector< SDVertex * > verts, const Normal *norms, const float *uvs) const |
Static Private Member Functions | |
static void | GenerateNormals (const vector< SDVertex * > verts, vector< Normal > &Ns) |
Private Attributes | |
int | nLevels |
vector< SDVertex * > | vertices |
vector< SDFace * > | faces |
boost::shared_ptr< Texture < float > > | displacementMap |
float | displacementMapScale |
float | displacementMapOffset |
bool | hasUV |
bool | displacementMapNormalSmooth |
bool | displacementMapSharpBoundary |
Definition at line 123 of file loopsubdiv.h.
LoopSubdiv::LoopSubdiv | ( | const Transform & | o2w, | |
bool | ro, | |||
int | nt, | |||
int | nv, | |||
const int * | vi, | |||
const Point * | P, | |||
const float * | uv, | |||
int | nlevels, | |||
const boost::shared_ptr< Texture< float > > | dismap, | |||
float | dmscale, | |||
float | dmoffset, | |||
bool | dmnormalsmooth, | |||
bool | dmsharpboundary | |||
) |
Definition at line 31 of file loopsubdiv.cpp.
References lux::SDVertex::boundary, lux::SDFace::f, lux::SDEdge::f, lux::SDEdge::f0edgeNum, faces, hasUV, if(), NEXT, lux::SDFace::nextFace(), nLevels, lux::SDVertex::regular, lux::SDVertex::startFace, lux::SDFace::v, lux::SDVertex::valence(), and vertices.
Referenced by CreateShape().
LoopSubdiv::~LoopSubdiv | ( | ) |
void LoopSubdiv::ApplyDisplacementMap | ( | const vector< SDVertex * > | verts, | |
const Normal * | norms, | |||
const float * | uvs | |||
) | const [private] |
Definition at line 400 of file loopsubdiv.cpp.
References lux::CoordinateSystem(), displacementMap, displacementMapOffset, displacementMapScale, LUX_INFO, LUX_NOERROR, luxError, lux::Normalize(), lux::Shape::ObjectToWorld, lux::Point::x, and lux::Point::y.
Referenced by Refine().
float lux::LoopSubdiv::beta | ( | int | valence | ) | const [inline, private] |
bool LoopSubdiv::CanIntersect | ( | ) | const [virtual] |
Shape * LoopSubdiv::CreateShape | ( | const Transform & | o2w, | |
bool | reverseOrientation, | |||
const ParamSet & | params, | |||
map< string, boost::shared_ptr< Texture< float > > > * | floatTextures | |||
) | [static] |
Definition at line 532 of file loopsubdiv.cpp.
References displacementMap, displacementMapNormalSmooth, displacementMapOffset, displacementMapScale, displacementMapSharpBoundary, lux::ParamSet::FindFloat(), lux::ParamSet::FindInt(), lux::ParamSet::FindOneBool(), lux::ParamSet::FindOneFloat(), lux::ParamSet::FindOneInt(), lux::ParamSet::FindOneString(), lux::ParamSet::FindPoint(), LoopSubdiv(), LUX_SYNTAX, LUX_WARNING, and luxError.
Referenced by lux::MakeShape().
float lux::LoopSubdiv::gamma | ( | int | valence | ) | const [inline, private] |
void LoopSubdiv::GenerateNormals | ( | const vector< SDVertex * > | verts, | |
vector< Normal > & | Ns | |||
) | [static, private] |
Definition at line 353 of file loopsubdiv.cpp.
References lux::SDVertex::boundary, lux::Cross(), M_PI, lux::SDVertex::oneRing(), lux::SDVertex::P, and lux::SDVertex::valence().
Referenced by Refine().
BBox LoopSubdiv::ObjectBound | ( | ) | const [virtual] |
Implements lux::Shape.
Definition at line 119 of file loopsubdiv.cpp.
References lux::Union(), and vertices.
void LoopSubdiv::Refine | ( | vector< boost::shared_ptr< Shape > > & | refined | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 139 of file loopsubdiv.cpp.
References lux::ParamSet::AddFloat(), lux::ParamSet::AddInt(), lux::ParamSet::AddNormal(), lux::ParamSet::AddPoint(), ApplyDisplacementMap(), beta(), lux::SDVertex::boundary, lux::SDVertex::child, lux::SDFace::children, displacementMap, displacementMapNormalSmooth, lux::SDFace::f, faces, gamma(), GenerateNormals(), hasUV, LUX_INFO, LUX_NOERROR, luxError, lux::MakeShape(), NEXT, nLevels, lux::Shape::ObjectToWorld, lux::SDFace::otherVert(), lux::SDVertex::P, PREV, lux::SDVertex::regular, lux::Shape::reverseOrientation, lux::SDVertex::startFace, lux::SDVertex::u, lux::SDVertex::v, lux::SDEdge::v, lux::SDFace::v, vertices, lux::SDFace::vnum(), weightBoundary(), and weightOneRing().
void LoopSubdiv::weightBoundary | ( | SDVertex * | destVert, | |
SDVertex * | vert, | |||
float | beta | |||
) | const [private] |
Definition at line 506 of file loopsubdiv.cpp.
References displacementMapSharpBoundary, lux::SDVertex::oneRing(), lux::SDVertex::P, lux::SDVertex::u, lux::SDVertex::v, and lux::SDVertex::valence().
Referenced by Refine().
Definition at line 440 of file loopsubdiv.cpp.
References lux::SDVertex::oneRing(), lux::SDVertex::P, lux::SDVertex::u, lux::SDVertex::v, and lux::SDVertex::valence().
Referenced by Refine().
BBox LoopSubdiv::WorldBound | ( | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 127 of file loopsubdiv.cpp.
References lux::Shape::ObjectToWorld, lux::Union(), and vertices.
boost::shared_ptr<Texture<float> > lux::LoopSubdiv::displacementMap [private] |
Definition at line 166 of file loopsubdiv.h.
Referenced by ApplyDisplacementMap(), CreateShape(), and Refine().
bool lux::LoopSubdiv::displacementMapNormalSmooth [private] |
float lux::LoopSubdiv::displacementMapOffset [private] |
Definition at line 168 of file loopsubdiv.h.
Referenced by ApplyDisplacementMap(), and CreateShape().
float lux::LoopSubdiv::displacementMapScale [private] |
Definition at line 167 of file loopsubdiv.h.
Referenced by ApplyDisplacementMap(), and CreateShape().
bool lux::LoopSubdiv::displacementMapSharpBoundary [private] |
vector<SDFace *> lux::LoopSubdiv::faces [private] |
Definition at line 163 of file loopsubdiv.h.
Referenced by LoopSubdiv(), Refine(), and ~LoopSubdiv().
bool lux::LoopSubdiv::hasUV [private] |
int lux::LoopSubdiv::nLevels [private] |
vector<SDVertex *> lux::LoopSubdiv::vertices [private] |
Definition at line 162 of file loopsubdiv.h.
Referenced by LoopSubdiv(), ObjectBound(), Refine(), WorldBound(), and ~LoopSubdiv().