Cinder  0.9.1
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
cinder::geom::Teapot Class Reference

#include <GeomIo.h>

Inherits cinder::geom::Source.

Public Member Functions

 Teapot ()
 
Teapotsubdivisions (int sub)
 
size_t getNumVertices () const override
 
size_t getNumIndices () const override
 
Primitive getPrimitive () const override
 
uint8_t getAttribDims (Attrib attr) const override
 
AttribSet getAvailableAttribs () const override
 
void loadInto (Target *target, const AttribSet &requestedAttribs) const override
 
Teapotclone () const override
 

Protected Member Functions

void calculate (std::vector< float > *positions, std::vector< float > *normals, std::vector< float > *texCoords, std::vector< uint32_t > *indices) const
 
void updateVertexCounts ()
 
void copyIndicesNonIndexed (uint16_t *dest) const
 
void copyIndicesNonIndexed (uint32_t *dest) const
 
template<typename T >
void forceCopyIndicesTrianglesImpl (T *dest) const
 

Static Protected Member Functions

static void generatePatches (float *v, float *n, float *tc, uint32_t *el, int grid)
 
static void buildPatchReflect (int patchNum, float *B, float *dB, float *v, float *n, float *tc, unsigned int *el, int &index, int &elIndex, int &tcIndex, int grid, bool reflectX, bool reflectY)
 
static void buildPatch (vec3 patch[][4], float *B, float *dB, float *v, float *n, float *tc, unsigned int *el, int &index, int &elIndex, int &tcIndex, int grid, const mat3 reflect, bool invertNormal)
 
static void getPatch (int patchNum, vec3 patch[][4], bool reverseV)
 
static void computeBasisFunctions (float *B, float *dB, int grid)
 
static vec3 evaluate (int gridU, int gridV, const float *B, const vec3 patch[][4])
 
static vec3 evaluateNormal (int gridU, int gridV, const float *B, const float *dB, const vec3 patch[][4])
 

Protected Attributes

int mSubdivision
 
size_t mNumVertices
 
size_t mNumIndices
 

Static Protected Attributes

static const uint8_t sPatchIndices [][16]
 
static const float sCurveData [][3]
 

Constructor & Destructor Documentation

cinder::geom::Teapot::Teapot ( )

Member Function Documentation

Teapot & cinder::geom::Teapot::subdivisions ( int  sub)
size_t cinder::geom::Teapot::getNumVertices ( ) const
overridevirtual

Implements cinder::geom::Source.

size_t cinder::geom::Teapot::getNumIndices ( ) const
overridevirtual

Implements cinder::geom::Source.

Primitive cinder::geom::Teapot::getPrimitive ( ) const
overridevirtual

Implements cinder::geom::Source.

uint8_t cinder::geom::Teapot::getAttribDims ( Attrib  attr) const
overridevirtual

Implements cinder::geom::Source.

AttribSet cinder::geom::Teapot::getAvailableAttribs ( ) const
overridevirtual

Implements cinder::geom::Source.

void cinder::geom::Teapot::loadInto ( Target target,
const AttribSet requestedAttribs 
) const
overridevirtual

Implements cinder::geom::Source.

Teapot* cinder::geom::Teapot::clone ( ) const
overridevirtual

Implements cinder::geom::Source.

void cinder::geom::Teapot::calculate ( std::vector< float > *  positions,
std::vector< float > *  normals,
std::vector< float > *  texCoords,
std::vector< uint32_t > *  indices 
) const
protected
void cinder::geom::Teapot::updateVertexCounts ( )
protected
void cinder::geom::Teapot::generatePatches ( float *  v,
float *  n,
float *  tc,
uint32_t *  el,
int  grid 
)
staticprotected
void cinder::geom::Teapot::buildPatchReflect ( int  patchNum,
float *  B,
float *  dB,
float *  v,
float *  n,
float *  tc,
unsigned int *  el,
int &  index,
int &  elIndex,
int &  tcIndex,
int  grid,
bool  reflectX,
bool  reflectY 
)
staticprotected
void cinder::geom::Teapot::buildPatch ( vec3  patch[][4],
float *  B,
float *  dB,
float *  v,
float *  n,
float *  tc,
unsigned int *  el,
int &  index,
int &  elIndex,
int &  tcIndex,
int  grid,
const mat3  reflect,
bool  invertNormal 
)
staticprotected
void cinder::geom::Teapot::getPatch ( int  patchNum,
vec3  patch[][4],
bool  reverseV 
)
staticprotected
void cinder::geom::Teapot::computeBasisFunctions ( float *  B,
float *  dB,
int  grid 
)
staticprotected
vec3 cinder::geom::Teapot::evaluate ( int  gridU,
int  gridV,
const float *  B,
const vec3  patch[][4] 
)
staticprotected
vec3 cinder::geom::Teapot::evaluateNormal ( int  gridU,
int  gridV,
const float *  B,
const float *  dB,
const vec3  patch[][4] 
)
staticprotected
void cinder::geom::Source::copyIndicesNonIndexed ( uint16_t *  dest) const
protectedinherited

Builds a sequential list of vertices to simulate an indexed geometry when Source is non-indexed. Assumes dest contains storage for getNumVertices() entries.

void cinder::geom::Source::copyIndicesNonIndexed ( uint32_t *  dest) const
protectedinherited

Builds a sequential list of vertices to simulate an indexed geometry when Source is non-indexed. Assumes dest contains storage for getNumVertices() entries.

template<typename T >
void cinder::geom::Source::forceCopyIndicesTrianglesImpl ( T *  dest) const
protectedinherited

Member Data Documentation

int cinder::geom::Teapot::mSubdivision
protected
size_t cinder::geom::Teapot::mNumVertices
protected
size_t cinder::geom::Teapot::mNumIndices
protected
const uint8_t cinder::geom::Teapot::sPatchIndices
staticprotected
Initial value:
= {
{102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27}, {24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40},
{96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101, 101, 0, 1, 2, 3,}, {0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117},
{118, 118, 118, 118, 124, 122, 119, 121, 123, 126, 125, 120, 40, 39, 38, 37},
{41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56}, {53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 28, 65, 66, 67},
{68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83}, {80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95}
}
const float cinder::geom::Teapot::sCurveData
staticprotected

The documentation for this class was generated from the following files: