#include <Geometry.h>
Inheritance diagram for Teddy::Models::Geometry:
Public Methods | |
Geometry () | |
Constructor. More... | |
virtual | ~Geometry () |
Destructor. More... | |
void | insert (Element *e) |
Insert Element to Model Insert Element to Model. More... | |
virtual void | beginElements (Projection *p) |
Code to be executed before visiting elements in the Model for drawing. More... | |
virtual void | drawElements (Projection *p) |
Code to visit elements in the Geometry for drawing. More... | |
virtual void | endElements (Projection *p) |
Code to be executed after visiting elements in the Geometry for drawing. More... | |
virtual void | transformVertices (const Matrix &m, const Matrix &normal_matrix, const bool reverse) |
void | clearTraversal () |
double | getMaxVector () |
void | smooth (float max_smoothing_angle) |
Average shared normals for vertices. More... | |
void | makePlanarTextureCoordinates (Vector center, Vector size, int axis) |
Calculate planar texture coordinates for Geometry. More... | |
void | makeCylindricalTextureCoordinates (Vector center, Vector size, int axis) |
Calculate cylindrical texture coordinates for Geometry. More... | |
void | makeSphericalTextureCoordinates (Vector center, Vector size, int axis) |
Calculate spherical texture coordinates for Geometry. More... | |
void | makeCubicTextureCoordinates (Vector center, Vector size) |
Calculate cubic texture coordinates for Geometry. More... | |
void | setTextureCoordinate (Element *e, list< Vertex * >::iterator v_it, float u, float v) |
Set texture coordinate for Geometry vertex Set texture coordinate for Geometry vertex. More... | |
void | draw (Projection *p) |
void | beginUpdate (Projection *p) |
void | endUpdate (Projection *p) |
Public Attributes | |
list< Element * > | elements |
Static Public Attributes | |
int | draw_count = 0 |
Protected Attributes | |
unsigned int | gl_list_id |
bool | dirty |
Definition at line 62 of file Geometry.h.
|
Constructor.
Definition at line 41 of file Geometry.cpp. References dirty, and gl_list_id. |
|
Destructor.
Definition at line 112 of file Geometry.cpp. References gl_list_id. |
|
Code to be executed before visiting elements in the Model for drawing.
Reimplemented in Teddy::Models::LineGeometry. Definition at line 132 of file Geometry.cpp. Referenced by drawElements. |
|
Definition at line 48 of file Geometry.cpp. References gl_list_id. Referenced by draw. |
|
Definition at line 74 of file Geometry.cpp. References elements. |
|
Definition at line 61 of file Geometry.cpp. References beginUpdate, dirty, drawElements, endUpdate, and gl_list_id. |
|
Code to visit elements in the Geometry for drawing.
Definition at line 140 of file Geometry.cpp. References beginElements, elements, and endElements. Referenced by draw. |
|
Code to be executed after visiting elements in the Geometry for drawing.
Reimplemented in Teddy::Models::LineGeometry. Definition at line 157 of file Geometry.cpp. Referenced by drawElements. |
|
Definition at line 54 of file Geometry.cpp. References dirty. Referenced by draw. |
|
Definition at line 94 of file Geometry.cpp. References elements. |
|
Insert Element to Model Insert Element to Model.
Definition at line 123 of file Geometry.cpp. References elements. |
|
Calculate cubic texture coordinates for Geometry. Calculate cubic texture coordinates for Geometry
For each Element, we calculate a new texture coordinate for each Vertex of the Element. If the Vertex in the Element does not yet have a texture coordinate set, we will set the new texture coordinate to the existing Vertex. If the Vertex in the Element does have the same texture coordinate as we just calculated, we do nothing to it. If the Vertex in the Element has a different texture coordinate, then we replace the old Vertex pointer in Face's Vertex list with a new Vertex that inherits the old Vertex but has the new texture coordinate. The old Vertex is not changed, and other Face's Vertex lists still point to it. This routine is not recursive; sub-Geometryes are not processed. Definition at line 549 of file GeometryTextureCoordinates.cpp. References Teddy::SysSupport::dmsg, elements, Teddy::SysSupport::M_TMAP, setTextureCoordinate, TC_EPSILON, TEXTURE_AXIS_X, TEXTURE_AXIS_Y, TEXTURE_AXIS_Z, and Vector. |
|
Calculate cylindrical texture coordinates for Geometry. Calculate cylindrical texture coordinates for Geometry
For each Element, we calculate a new texture coordinate for each Vertex of the Element. If the Vertex in the Element does not yet have a texture coordinate set, we will set the new texture coordinate to the existing Vertex. If the Vertex in the Element does have the same texture coordinate as we just calculated, we do nothing to it. If the Vertex in the Element has a different texture coordinate, then we replace the old Vertex pointer in Face's Vertex list with a new Vertex that inherits the old Vertex but has the new texture coordinate. The old Vertex is not changed, and other Face's Vertex lists still point to it. This routine is not recursive; sub-Geometryes are not processed. Definition at line 332 of file GeometryTextureCoordinates.cpp. References Teddy::SysSupport::dmsg, elements, Teddy::Models::fract, M_2_PI, Teddy::SysSupport::M_TMAP, setTextureCoordinate, TEXTURE_AXIS_X, TEXTURE_AXIS_Y, TEXTURE_AXIS_Z, Vector, and Teddy::Models::xyz_to_h. |
|
Calculate planar texture coordinates for Geometry. Calculate planar texture coordinates for Geometry
For each Element, we calculate a new texture coordinate for each Vertex of the Element. If the Vertex in the Element does not yet have a texture coordinate set, we will set the new texture coordinate to the existing Vertex. If the Vertex in the Element does have the same texture coordinate as we just calculated, we do nothing to it. If the Vertex in the Element has a different texture coordinate, then we replace the old Vertex pointer in Face's Vertex list with a new Vertex that inherits the old Vertex but has the new texture coordinate. The old Vertex is not changed, and other Face's Vertex lists still point to it. This routine is not recursive; sub-Geometryes are not processed. Here are some simplified code fragments showing how LightWave computes UV coordinates from X, Y, and Z. If the resulting UV coordinates are not in the range from 0 to 1, the appropriate integer should be added to them to bring them into that range (the fract function should have accomplished this by subtracting the floor of each number from itself). Then they can be multiplied by the width and height (in pixels) of an image map to determine which pixel to look up. The texture size, center, and tiling parameters are taken right off the texture control panel. Definition at line 205 of file GeometryTextureCoordinates.cpp. References Teddy::SysSupport::dmsg, elements, Teddy::SysSupport::M_TMAP, setTextureCoordinate, TC_EPSILON, TEXTURE_AXIS_X, TEXTURE_AXIS_Y, TEXTURE_AXIS_Z, and Vector. |
|
Calculate spherical texture coordinates for Geometry. Calculate spherical texture coordinates for Geometry
For each Element, we calculate a new texture coordinate for each Vertex of the Element. If the Vertex in the Element does not yet have a texture coordinate set, we will set the new texture coordinate to the existing Vertex. If the Vertex in the Element does have the same texture coordinate as we just calculated, we do nothing to it. If the Vertex in the Element has a different texture coordinate, then we replace the old Vertex pointer in Face's Vertex list with a new Vertex that inherits the old Vertex but has the new texture coordinate. The old Vertex is not changed, and other Face's Vertex lists still point to it. This routine is not recursive; sub-Geometryes are not processed. Definition at line 444 of file GeometryTextureCoordinates.cpp. References Teddy::SysSupport::dmsg, elements, Teddy::Models::fract, M_2_PI, M_PI, Teddy::SysSupport::M_TMAP, setTextureCoordinate, TEXTURE_AXIS_X, TEXTURE_AXIS_Y, TEXTURE_AXIS_Z, Vector, and Teddy::Models::xyz_to_hp. |
|
Set texture coordinate for Geometry vertex Set texture coordinate for Geometry vertex.
Definition at line 105 of file GeometryTextureCoordinates.cpp. References Teddy::SysSupport::dmsg, Teddy::SysSupport::M_TMAP, TC_EPSILON, and Vector. Referenced by makeCubicTextureCoordinates, makeCylindricalTextureCoordinates, makePlanarTextureCoordinates, and makeSphericalTextureCoordinates. |
|
Average shared normals for vertices.
Definition at line 167 of file Geometry.cpp. References Teddy::SysSupport::dmsg, elements, and Teddy::SysSupport::M_TMAP. |
|
Definition at line 83 of file Geometry.cpp. |
|
Definition at line 98 of file Geometry.h. Referenced by draw, endUpdate, Geometry, and transformVertices. |
|
Definition at line 37 of file Geometry.cpp. |
|
Definition at line 88 of file Geometry.h. Referenced by clearTraversal, drawElements, getMaxVector, insert, makeCubicTextureCoordinates, makeCylindricalTextureCoordinates, makePlanarTextureCoordinates, makeSphericalTextureCoordinates, smooth, and transformVertices. |
|
Definition at line 97 of file Geometry.h. Referenced by beginUpdate, draw, Geometry, and ~Geometry. |