#include <Vertex.h>
Inheritance diagram for Teddy::Models::Vertex:
Public Methods | |
Vertex () | |
Default constructor. More... | |
Vertex (Vertex *v) | |
Vertex (Vertex &v) | |
Vertex (const Vertex &v) | |
Vertex (const Vector &v) | |
Vertex - Vector Copy-constructor. More... | |
Vertex (const float x, const float y, const float z) | |
Vertex Component constructor. More... | |
virtual | ~Vertex () |
virtual double | getMaxVector () const |
virtual void | debug () |
Debugging information. More... | |
virtual void | draw (Projection *p) |
virtual void | applyColor (Projection *p) |
virtual void | applyNormal (Projection *p) |
virtual void | applyTexture (Projection *p) |
virtual void | applyVertex (Projection *p) |
void | neg () |
Flip the vertex. Notice that normal is not changed by this routine. More... | |
void | transform (const Matrix &m, const Matrix &normal_matrix) |
Transform the vertex. More... | |
void | setParent (const Vertex &vert) |
void | setVertex (const Vector &vert) |
Set vertex coordinate to this vertex. More... | |
void | setVertex (const float x, const float y, const float z) |
void | setColor (const Color &color) |
Set color to this vertex. More... | |
void | setNormal (const Vector &normal) |
Set normal to this vertex. More... | |
void | setNormal (const float x, const float y, const float z) |
void | setTexture (const Vector &texture) |
Set vertex texture coordinate. More... | |
void | setTexture (const float s, const float t, const float u=0.0f) |
void | addNormal (const Vector &add) |
Add normal to this vertex. More... | |
void | normNormal () |
Normalize normal. More... | |
void | removeNormal () |
Vertex * | getRoot () |
Return the effective ancestor of this vertex. Recursively seeks for parent. More... | |
Vertex * | getParent () |
Return the effective parent of this vertex. More... | |
Vector & | getVertex () |
Return the effective vertex position of this vertex. More... | |
Color & | getColor () |
Return the effective vertex color. More... | |
Vector & | getNormal () |
Return the effective vertex normal coordinate. More... | |
Vector & | getTexture () |
Return vertex texture coordinate. More... | |
list< Face * > & | getFaces () |
Return the share list of this vertex. More... | |
void | addFace (Face *face) |
Sharing lists are only stored in the root. More... | |
Vertex & | operator+= (Vertex &v) |
Vertex & | operator-= (Vertex &v) |
Vertex & | operator *= (float k) |
Vertex & | operator/= (float k) |
Vertex & | operator+= (const Vertex &v) |
Vertex & | operator-= (const Vertex &v) |
Vertex | operator+ (Vertex &v) |
Vertex | operator- (Vertex &v) |
Vertex | operator * (float k) |
Vertex | operator/ (float k) |
Vertex | operator+ (const Vertex &v) |
Vertex | operator- (const Vertex &v) |
void | flipX () |
void | flipY () |
void | flipZ () |
void | normalize () |
float | magnitude () |
Public Attributes | |
list< Face * > | faces |
Cross-reference. More... | |
Protected Attributes | |
Vertex * | parent |
Original shared vertex. More... | |
Vector | vert |
The actual vertex coordinates. More... | |
Vector | normal |
Normal coordinates. More... | |
Color | color |
Color. More... | |
Vector | texturecoord |
Texture coordinates. More... |
Vertex is the most basic primitive for building object models. This class attempts to provide flexible vertex by coupling possible vertex features into a single class. Additionally vertices can be arranged into hieararchy so that one vertex can inherit some (or all) features from its parent. By using feature inheritance it is possible eg. share the vertex coordinate but specify different normal, or different texture coordinate.
Definition at line 64 of file Vertex.h.
|
Default constructor.
Definition at line 37 of file Vertex.cpp. Referenced by getRoot, operator *, operator *=, operator+, operator+=, operator-, operator-=, operator/, and operator/=. |
|
Vertex - Vertex Inheritance constructor Notice that Face cross-reference -list is not copied Notice how Parent is set Definition at line 54 of file Vertex.cpp. |
|
Vertex - Vertex copy constructor Notice that Face cross-reference -list is not copied Notice how Parent is set Notice that accessor methods are not used for some members Definition at line 72 of file Vertex.cpp. |
|
|
|
Vertex - Vector Copy-constructor.
Definition at line 85 of file Vertex.cpp. References Vector. |
|
Vertex Component constructor.
Definition at line 98 of file Vertex.cpp. |
|
Definition at line 110 of file Vertex.cpp. |
|
Sharing lists are only stored in the root.
Definition at line 203 of file Vertex.cpp. References getRoot. |
|
Add normal to this vertex.
Definition at line 165 of file Vertex.cpp. References Teddy::Models::Element::add, normal, and Vector. |
|
Definition at line 299 of file Vertex.cpp. References color, Teddy::MixIn::Options::isEnabled, parent, Teddy::Models::Element::VX_HAS_COLOR, Teddy::Models::Element::VX_HAS_PARENT, Teddy::Models::Element::VX_USE_PARENT_COLOR, and Teddy::Models::Element::VX_USE_THIS_COLOR. Referenced by draw. |
|
Definition at line 311 of file Vertex.cpp. References debug, Teddy::SysSupport::dmsg, Teddy::MixIn::Options::isEnabled, Teddy::SysSupport::M_VERT, normal, parent, Teddy::Models::Element::VX_HAS_NORMAL, Teddy::Models::Element::VX_HAS_PARENT, Teddy::Models::Element::VX_USE_PARENT_NORMAL, and Teddy::Models::Element::VX_USE_THIS_NORMAL. Referenced by draw. |
|
Definition at line 324 of file Vertex.cpp. References Teddy::MixIn::Options::isEnabled, parent, texturecoord, Teddy::Models::Element::VX_HAS_PARENT, Teddy::Models::Element::VX_HAS_TEXTURE, Teddy::Models::Element::VX_USE_PARENT_TEXTURE, and Teddy::Models::Element::VX_USE_THIS_TEXTURE. Referenced by draw. |
|
Definition at line 336 of file Vertex.cpp. References Teddy::MixIn::Options::isEnabled, parent, vert, Teddy::Models::Element::VX_HAS_PARENT, Teddy::Models::Element::VX_HAS_VERTEX, Teddy::Models::Element::VX_USE_PARENT_VERTEX, and Teddy::Models::Element::VX_USE_THIS_VERTEX. Referenced by draw. |
|
|
Draw. Since any feature may or may not be inherited from parent, all settings are handled in sub-methods. Does NOT include begin(), so Vertex can be used with any OpenGL primitives, but needs begin() outside. Implements Teddy::Models::Element. Definition at line 291 of file Vertex.cpp. References applyColor, applyNormal, applyTexture, and applyVertex. |
|
Definition at line 128 of file Vertex.h. References getVertex. |
|
Definition at line 129 of file Vertex.h. References getVertex. |
|
Definition at line 130 of file Vertex.h. References getVertex. |
|
Return the effective vertex color.
Definition at line 244 of file Vertex.cpp. References color, Teddy::SysSupport::emsg, Teddy::MixIn::Options::isEnabled, Teddy::SysSupport::M_VERT, parent, Teddy::Models::Element::VX_HAS_COLOR, Teddy::Models::Element::VX_HAS_PARENT, Teddy::Models::Element::VX_USE_PARENT_COLOR, and Teddy::Models::Element::VX_USE_THIS_COLOR. |
|
Return the share list of this vertex.
Definition at line 209 of file Vertex.cpp. References getRoot. |
|
Reimplemented from Teddy::Models::Element. Definition at line 368 of file Vertex.cpp. References vert. |
|
Return the effective vertex normal coordinate.
Definition at line 257 of file Vertex.cpp. References Teddy::SysSupport::emsg, Teddy::MixIn::Options::isEnabled, Teddy::SysSupport::M_VERT, normal, parent, Vector, Teddy::Models::Element::VX_HAS_NORMAL, Teddy::Models::Element::VX_HAS_PARENT, Teddy::Models::Element::VX_USE_PARENT_NORMAL, and Teddy::Models::Element::VX_USE_THIS_NORMAL. |
|
Return the effective parent of this vertex.
Definition at line 226 of file Vertex.cpp. References parent. Referenced by getRoot. |
|
Return the effective ancestor of this vertex. Recursively seeks for parent.
Definition at line 215 of file Vertex.cpp. |
|
Return vertex texture coordinate.
Definition at line 270 of file Vertex.cpp. References Teddy::SysSupport::emsg, Teddy::MixIn::Options::isEnabled, Teddy::SysSupport::M_VERT, parent, texturecoord, Vector, Teddy::Models::Element::VX_HAS_PARENT, Teddy::Models::Element::VX_HAS_TEXTURE, Teddy::Models::Element::VX_USE_PARENT_TEXTURE, and Teddy::Models::Element::VX_USE_THIS_TEXTURE. |
|
Return the effective vertex position of this vertex.
Definition at line 232 of file Vertex.cpp. References Teddy::SysSupport::dmsg, Teddy::MixIn::Options::isEnabled, Teddy::SysSupport::M_VERT, parent, Vector, vert, Teddy::Models::Element::VX_HAS_PARENT, Teddy::Models::Element::VX_HAS_VERTEX, Teddy::Models::Element::VX_USE_PARENT_VERTEX, and Teddy::Models::Element::VX_USE_THIS_VERTEX. Referenced by flipX, flipY, flipZ, magnitude, and normalize. |
|
Definition at line 134 of file Vertex.h. References getVertex. |
|
Flip the vertex. Notice that normal is not changed by this routine.
Definition at line 115 of file Vertex.cpp. References vert. |
|
Definition at line 133 of file Vertex.h. References getVertex. |
|
Normalize normal.
Definition at line 171 of file Vertex.cpp. References Teddy::MixIn::Options::disable, Teddy::SysSupport::emsg, Teddy::MixIn::Options::enable, Teddy::MixIn::Options::isDisabled, Teddy::SysSupport::M_VERT, normal, Teddy::Models::Element::VX_HAS_NORMAL, Teddy::Models::Element::VX_USE_PARENT_NORMAL, and Teddy::Models::Element::VX_USE_THIS_NORMAL. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set color to this vertex.
Definition at line 131 of file Vertex.cpp. References color, Teddy::MixIn::Options::disable, Teddy::MixIn::Options::enable, Teddy::Models::Element::VX_HAS_COLOR, Teddy::Models::Element::VX_USE_PARENT_COLOR, and Teddy::Models::Element::VX_USE_THIS_COLOR. |
|
Reimplemented from Teddy::Models::Element. Definition at line 144 of file Vertex.cpp. References Teddy::MixIn::Options::disable, Teddy::MixIn::Options::enable, normal, Vector, Teddy::Models::Element::VX_HAS_NORMAL, Teddy::Models::Element::VX_USE_PARENT_NORMAL, and Teddy::Models::Element::VX_USE_THIS_NORMAL. |
|
Set normal to this vertex.
Reimplemented from Teddy::Models::Element. Definition at line 139 of file Vertex.cpp. References Teddy::MixIn::Options::disable, Teddy::MixIn::Options::enable, normal, Vector, Teddy::Models::Element::VX_HAS_NORMAL, Teddy::Models::Element::VX_USE_PARENT_NORMAL, and Teddy::Models::Element::VX_USE_THIS_NORMAL. |
|
|
|
Definition at line 195 of file Vertex.cpp. References Teddy::MixIn::Options::disable, Teddy::MixIn::Options::enable, texturecoord, Vector, Teddy::Models::Element::VX_HAS_TEXTURE, Teddy::Models::Element::VX_USE_PARENT_TEXTURE, and Teddy::Models::Element::VX_USE_THIS_TEXTURE. |
|
Set vertex texture coordinate.
Definition at line 190 of file Vertex.cpp. References Teddy::MixIn::Options::disable, Teddy::MixIn::Options::enable, texturecoord, Vector, Teddy::Models::Element::VX_HAS_TEXTURE, Teddy::Models::Element::VX_USE_PARENT_TEXTURE, and Teddy::Models::Element::VX_USE_THIS_TEXTURE. |
|
Definition at line 157 of file Vertex.cpp. References Teddy::MixIn::Options::disable, Teddy::MixIn::Options::enable, Vector, vert, Teddy::Models::Element::VX_HAS_VERTEX, Teddy::Models::Element::VX_USE_PARENT_VERTEX, and Teddy::Models::Element::VX_USE_THIS_VERTEX. |
|
Set vertex coordinate to this vertex.
Definition at line 152 of file Vertex.cpp. References Teddy::MixIn::Options::disable, Teddy::MixIn::Options::enable, Vector, vert, Teddy::Models::Element::VX_HAS_VERTEX, Teddy::Models::Element::VX_USE_PARENT_VERTEX, and Teddy::Models::Element::VX_USE_THIS_VERTEX. |
|
Transform the vertex.
Definition at line 123 of file Vertex.cpp. |
|
Color.
Definition at line 143 of file Vertex.h. Referenced by applyColor, getColor, and setColor. |
|
Cross-reference.
|
|
Normal coordinates.
Reimplemented from Teddy::Models::Element. Definition at line 142 of file Vertex.h. Referenced by addNormal, applyNormal, getNormal, normNormal, setNormal, and transform. |
|
Original shared vertex.
Definition at line 140 of file Vertex.h. Referenced by applyColor, applyNormal, applyTexture, applyVertex, getColor, getNormal, getParent, getTexture, and getVertex. |
|
Texture coordinates.
Definition at line 144 of file Vertex.h. Referenced by applyTexture, getTexture, and setTexture. |
|
The actual vertex coordinates.
Definition at line 141 of file Vertex.h. Referenced by applyVertex, getMaxVector, getVertex, neg, operator *, operator *=, operator+, operator+=, operator-, operator-=, operator/, operator/=, setVertex, and transform. |