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

#include <GeomIo.h>

Inherits cinder::geom::Source.

Public Member Functions

 Rect ()
 
 Rect (const Rectf &r)
 
Rectrect (const Rectf &r)
 
Rectcolors (bool enable=true)
 
Rectcolors (const ColorAf &upperLeft, const ColorAf &upperRight, const ColorAf &lowerRight, const ColorAf &lowerLeft)
 
RecttexCoords (const vec2 &upperLeft, const vec2 &upperRight, const vec2 &lowerRight, const vec2 &lowerLeft)
 
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
 
Rectclone () const override
 

Protected Member Functions

void setDefaultColors ()
 
void setDefaultTexCoords ()
 
void copyIndicesNonIndexed (uint16_t *dest) const
 
void copyIndicesNonIndexed (uint32_t *dest) const
 
template<typename T >
void forceCopyIndicesTrianglesImpl (T *dest) const
 

Protected Attributes

std::array< vec2, 4 > mPositions
 
std::array< vec2, 4 > mTexCoords
 
std::array< ColorAf, 4 > mColors
 
bool mHasColors
 

Static Protected Attributes

static const float sNormals [4 *3] = {0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1 }
 
static const float sTangents [4 *3] = {0.7071067f, 0.7071067f, 0, 0.7071067f, 0.7071067f, 0, 0.7071067f, 0.7071067f, 0, 0.7071067f, 0.7071067f, 0 }
 

Constructor & Destructor Documentation

cinder::geom::Rect::Rect ( )

Equivalent to Rectf( -0.5, -0.5, 0.5, 0.5 )

cinder::geom::Rect::Rect ( const Rectf r)

Member Function Documentation

Rect & cinder::geom::Rect::rect ( const Rectf r)
Rect& cinder::geom::Rect::colors ( bool  enable = true)

Enables default colors. Disabled by default.

Rect & cinder::geom::Rect::colors ( const ColorAf upperLeft,
const ColorAf upperRight,
const ColorAf lowerRight,
const ColorAf lowerLeft 
)

Enables COLOR attrib and specifies corner values in clockwise order starting with the upper-left.

Rect & cinder::geom::Rect::texCoords ( const vec2 &  upperLeft,
const vec2 &  upperRight,
const vec2 &  lowerRight,
const vec2 &  lowerLeft 
)

Enables TEX_COORD_0 attrib and specifies corner values in clockwise order starting with the upper-left.

size_t cinder::geom::Rect::getNumVertices ( ) const
overridevirtual

Implements cinder::geom::Source.

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

Implements cinder::geom::Source.

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

Implements cinder::geom::Source.

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

Implements cinder::geom::Source.

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

Implements cinder::geom::Source.

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

Implements cinder::geom::Source.

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

Implements cinder::geom::Source.

void cinder::geom::Rect::setDefaultColors ( )
protected
void cinder::geom::Rect::setDefaultTexCoords ( )
protected
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

std::array<vec2,4> cinder::geom::Rect::mPositions
protected
std::array<vec2,4> cinder::geom::Rect::mTexCoords
protected
std::array<ColorAf,4> cinder::geom::Rect::mColors
protected
bool cinder::geom::Rect::mHasColors
protected
const float cinder::geom::Rect::sNormals = {0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1 }
staticprotected
const float cinder::geom::Rect::sTangents = {0.7071067f, 0.7071067f, 0, 0.7071067f, 0.7071067f, 0, 0.7071067f, 0.7071067f, 0, 0.7071067f, 0.7071067f, 0 }
staticprotected

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