![]() |
VR-Forces 4.1 Class Documentation
|
Triangulates all the polygons with more than three vertices of a gdb terrain database. More...
Static Public Member Functions | |
| static bool | triangulateTerrain (DtTerrainDatabase *db) |
| Converts all the polygon indirect nodes of db into triangle indirect nodes by applying a triangulation algorithm to each polygon node. | |
| static DtTriangulationResult | triangulatePolygon (DtTerrainDatabase *db, DtPolygonIndirect *node, DtGroup *const parent) |
| Triangulates the polygon defined by node. | |
Static Protected Member Functions | |
| static double | kross (const DtVertexManager *mgr, int a, int b, int c) |
| Returns the value of the z component of the cross product between the segments defined by the indexes ab and ac. | |
| static bool | collinear (const DtVertexManager *mgr, int a, int b, int c) |
| Determines whether the points at indexes a, b, and c are all collinear. | |
| static bool | segmentInCone (const DtVertexManager *mgr, int v0, int v1, int vm, int vp) |
| Checks whether the segment v0v1 is contained in the cone with vertex v0 and edges with directions (vm - vi) and (vp - vi) | |
| static bool | between (const DtVertexManager *mgr, int a, int b, int c) |
| Determines whether the point vb is between va and vc. | |
| static bool | properIntersect (const DtVertexManager *mgr, int a, int b, int c, int d) |
| Checks whether the segment va-vb properly intersects the segment vc-vd: They share a point interior to both segments. | |
| static bool | intersect (const DtVertexManager *mgr, int a, int b, int c, int d) |
| Checks whether the segment va-vb intersects with segment vc-vd: They intersect properly or one endpoint of one segment lies between the two endpoints of the other segment. | |
| static bool | isDiagonal (const DtVertexManager *mgr, int numberOfVertices, std::vector< DtVertexID > &vertIds, int i0, int i1) |
| Determines whether the segment defined by vi0 and vi1 is contained by the polygon vertIDs and does not fully intersect any of its edges. | |
| static bool | isValidPoly (const DtPolygonIndirect *poly) |
| Determines whether poly has a non-zero normal. | |
| static bool | isFlatSurface (const DtPolygonIndirect *poly) |
| Determines whether all the vertices inside poly are coplanar. | |
| static void | printVerts (std::vector< DtVertexID > lst) |
| Prints the contents of the list lst. | |
| static void | triangulatePolygon (DtTerrainDatabase *db, DtSurfaceID sid, const DtVertexManager *mgr, DtGroup *const parent, std::vector< DtVertexID > &vertIds) |
| Triangulates the polygon defined by vertIds. | |
| static bool | alignPolygonToXYPlane (DtPolygonIndirect *poly, DtHomogeneousTransfMatrix &aMatrix) |
| Projects the polygon poly onto the xy plane by aligning its normal with the z axis. | |
| static void | transformPolygon (DtPolygonIndirect *poly, DtHomogeneousTransfMatrix &aMatrix) |
| Applies the transformation aMatrix to the polygon node poly. | |
Static Protected Attributes | |
| static const double | theErrorMargin |
Triangulates all the polygons with more than three vertices of a gdb terrain database.
The algorithmic used in this class is based on the theory presented in Computational Geometry in C (Joseph O'Rourke) - Chapter 1 Geometric Tools for Computer Graphics (Schneider) - Section 13.9 Computer Graphics (Foley & Van Dam) - p. 222 Notation: vi = vertex located at position i inside the vertex manager
|
static |
Converts all the polygon indirect nodes of db into triangle indirect nodes by applying a triangulation algorithm to each polygon node.
The polygon node is removed from the database and transformed into 2+ triangle indirect nodes.
| db | - Terrain database to be triangulated |
|
static |
Triangulates the polygon defined by node.
It creates an exact copy of the polygon but with triangles. This method creates and adds TRIANGLE_INDIRECT nodes into the terrain database. Each triangle is created with the surface Id sid.
| db | - (in) Terrain database where the nodes will be added |
| node | - (in) Polygon to be triangulated parent - (in) Parent of the node |
|
staticprotected |
Returns the value of the z component of the cross product between the segments defined by the indexes ab and ac.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c | - (in) Indexes of the vertices inside mgr, defining the segment |
|
staticprotected |
Determines whether the points at indexes a, b, and c are all collinear.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c | - (in) Indexes of the vertices inside the vertex manager |
|
staticprotected |
Checks whether the segment v0v1 is contained in the cone with vertex v0 and edges with directions (vm - vi) and (vp - vi)
| mgr | - (in) Vertex manager containing the actual vertices |
| v0,v1 | - (in) Indexes of the segment |
| vm | - (in) Index of the vertex located immediately before v0 |
| vp | - (in) Index of the vertex located immediately after v0 |
|
staticprotected |
Determines whether the point vb is between va and vc.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c | - (in) Indexes of the vertices to be tested for collinearity |
|
staticprotected |
Checks whether the segment va-vb properly intersects the segment vc-vd: They share a point interior to both segments.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c,d | - (in) Indexes of the vertices defining the segments to be tested |
|
staticprotected |
Checks whether the segment va-vb intersects with segment vc-vd: They intersect properly or one endpoint of one segment lies between the two endpoints of the other segment.
| mgr | - (in) Vertex manager containing the actual vertices |
| a,b,c,d | - (in) Indexes of the vertices defining the segments to be tested |
|
staticprotected |
Determines whether the segment defined by vi0 and vi1 is contained by the polygon vertIDs and does not fully intersect any of its edges.
| mgr | - (in) Vertex manager containing the actual vertices |
| numberOfVertices | - (in) Size of vertIds |
| i0,i1 | - (in) Indexes of the vertices defining the segment to be tested |
|
staticprotected |
Determines whether poly has a non-zero normal.
| poly | - (in) Polygon to be tested |
|
staticprotected |
Determines whether all the vertices inside poly are coplanar.
| poly | - (in) Polygon to be tested |
|
staticprotected |
Prints the contents of the list lst.
| lst | - (in) List of vertices to be printed |
|
staticprotected |
Triangulates the polygon defined by vertIds.
It creates an exact copy of the polygon but with triangles. This method creates and adds TRIANGLE_INDIRECT nodes into the terrain database. Each triangle is created with the surface Id sid.
| db | - (in) Terrain database where the nodes will be added |
| sid | - (in) Surface id of the new nodes |
| mgr | - (in) Vertex manager containing the actual vertices |
| vertIds | - (in) Vector containing the indexes that define the |
| parent | - (in) Parent associated with the polygon being triangulated polygon to be triangulated |
|
staticprotected |
Projects the polygon poly onto the xy plane by aligning its normal with the z axis.
| poly | - (in) Polygon to align |
| aMatrix | - (out) Transformation matrix used to project the polygon |
|
staticprotected |
Applies the transformation aMatrix to the polygon node poly.
| poly | - (in) Polygon to transform |
| aMatrix | - (in) Transformation matrix to apply on the polygon |
|
staticprotected |