VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
triangulator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2006 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: triangulator.h,v $ $Revision: 1.8 $ $State: Exp $
7 *******************************************************************************/
8 
9 #ifndef triangulator_H_
10 #define triangulator_H_
11 
12 #include <vector>
13 #include "gdb/vertexManager.h"
14 #include "gdb/gdbDefines.h"
15 
18 
20 {
24 };
25 
26 
35 {
36 
37 public:
38 
44  static bool triangulateTerrain(DtTerrainDatabase* db);
45 
55  static DtTriangulationResult triangulatePolygon(
56  DtTerrainDatabase* db,
57  DtPolygonIndirect* node,
58  DtGroup* const parent);
59 
60 protected:
61 
67  static double kross(const DtVertexManager* mgr, int a, int b, int c);
68 
73  static bool collinear(const DtVertexManager* mgr, int a, int b, int c);
74 
82  static bool segmentInCone(const DtVertexManager* mgr, int v0, int v1, int vm, int vp);
83 
89  static bool between(const DtVertexManager* mgr, int a, int b, int c);
90 
97  static bool properIntersect(const DtVertexManager* mgr, int a, int b, int c, int d);
98 
106  static bool intersect(const DtVertexManager* mgr, int a, int b, int c, int d);
107 
114  static bool isDiagonal(const DtVertexManager* mgr, int numberOfVertices,
115  std::vector<DtVertexID>& vertIds, int i0, int i1);
116 
120  static bool isValidPoly(const DtPolygonIndirect* poly);
121 
125  static bool isFlatSurface(const DtPolygonIndirect* poly);
126 
129  static void printVerts(std::vector<DtVertexID> lst);
130 
141  static void triangulatePolygon(
142  DtTerrainDatabase* db,
143  DtSurfaceID sid,
144  const DtVertexManager* mgr,
145  DtGroup* const parent,
146  std::vector<DtVertexID>& vertIds);
147 
153  static bool alignPolygonToXYPlane(
154  DtPolygonIndirect* poly,
156 
160  static void transformPolygon(
161  DtPolygonIndirect* poly,
163 
164 protected:
165 
166  static const double theErrorMargin;
167 
168 };
169 
170 #endif
171 
Definition: triangulator.h:23
Definition: group.h:28
Definition: triangulator.h:21
#define DT_DLL_gdb
Definition: gdbDefines.h:25
Definition: vertexManager.h:26
Definition: triangulator.h:22
static const double theErrorMargin
Definition: triangulator.h:166
unsigned int DtSurfaceID
Definition: surfaceManager.h:25
Definition: polygonIndirect.h:29
Definition: terrainDatabase.h:148
DtTriangulationResult
Definition: triangulator.h:19
Definition: homogeneousTransformMatrix.h:25
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&#39;Rourke) - Chapter 1 Geometric Tools for Computer Graphics (Schneider) - Section 13.9 Computer Graphics (Foley &amp; Van Dam) - p. 222 Notation: vi = vertex located at position i inside the vertex manager.
Definition: triangulator.h:34

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)