GeoTessCPP  2.1
Software to facilitate storage and retrieval of 3D information about the Earth.
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
GeoTessGrid.h
Go to the documentation of this file.
1 //- ****************************************************************************
2 //-
3 //- Copyright 2009 Sandia Corporation. Under the terms of Contract
4 //- DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
5 //- retains certain rights in this software.
6 //-
7 //- BSD Open Source License.
8 //- All rights reserved.
9 //-
10 //- Redistribution and use in source and binary forms, with or without
11 //- modification, are permitted provided that the following conditions are met:
12 //-
13 //- * Redistributions of source code must retain the above copyright notice,
14 //- this list of conditions and the following disclaimer.
15 //- * Redistributions in binary form must reproduce the above copyright
16 //- notice, this list of conditions and the following disclaimer in the
17 //- documentation and/or other materials provided with the distribution.
18 //- * Neither the name of Sandia National Laboratories nor the names of its
19 //- contributors may be used to endorse or promote products derived from
20 //- this software without specific prior written permission.
21 //-
22 //- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 //- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 //- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 //- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26 //- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 //- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 //- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 //- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 //- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 //- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 //- POSSIBILITY OF SUCH DAMAGE.
33 //-
34 //- ****************************************************************************
35 
36 #ifndef GEOTESSGRID_OBJECT_H
37 #define GEOTESSGRID_OBJECT_H
38 
39 // **** _SYSTEM INCLUDES_ ******************************************************
40 
41 #include <iostream>
42 #include <string>
43 #include <fstream>
44 #include <vector>
45 #include <set>
46 #include <list>
47 #include <set>
48 #include <sstream>
49 
50 // use standard library objects
51 using namespace std;
52 
53 // **** _LOCAL INCLUDES_ *******************************************************
54 
55 #include "CPPUtils.h"
56 #include "GeoTessUtils.h"
57 #include "ArrayReuse.h"
58 #include "GeoTessException.h"
60 
61 // **** _BEGIN GEOTESS NAMESPACE_ **********************************************
62 
63 namespace geotess
64 {
65 
66 // **** _FORWARD REFERENCES_ ***************************************************
67 
68 class IFStreamAscii;
69 class IFStreamBinary;
70 
71 // **** _CLASS DEFINITION_ *****************************************************
72 
98 struct Edge
99 {
103  int vj;
104 
108  int vk;
109 
110  int cornerj;
111 
115  int tLeft;
116 
120  int tRight;
121 
125  double normal[3]; //
126 
131  Edge* next; //
132 };
133 
164 {
165 protected:
166 
174  double** vertices;
175 
180 
186  int** triangles;
187 
192 
204  int** levels;
205 
209  int nLevels;
210 
225 
230 
244  void initialize();
245 
249  GeoTessGrid(const string& gid, const GeoTessOptimizationType* opttype) :
250  vertices(NULL), nVertices(0),
251  triangles(NULL), nTriangles(0),
252  levels(NULL), nLevels(0),
253  tessellations(NULL), nTessellations(0),
254  descendants(NULL), gridID(gid),
255  gridInputFile("null"), gridOutputFile("null"), gridSoftwareVersion(""),
256  gridGenerationDate(""), refCount(0)
257  {
258  }
259 
260 private:
261 
269  int* descendants;
270 
288  vector<vector<Edge*> > edgeList;
289 
302  mutable vector<vector<Edge*> > spokeList;
303 
310  mutable vector<double*> circumCenters;
311 
320  string gridID;
321 
325  string gridInputFile;
326 
330  string gridOutputFile;
331 
335  string gridSoftwareVersion;
336 
341  string gridGenerationDate;
342 
346  int refCount;
347 
352  vector< vector< vector<int> > > vtxTriangles;
353 
359  mutable vector< set<int> > connectedVertices;
360 
364  GeoTessGrid* loadGridAscii(const string& inputFile);
365 
370  GeoTessGrid* loadGridAscii(IFStreamAscii& input);
371 
375  GeoTessGrid* loadGridBinary(const string& inputFile);
376 
380  virtual GeoTessGrid* loadGridBinary(IFStreamBinary& ifs);
381 
382  static void loadGridAsciiFront(IFStreamAscii& input, int& gridFileFormat,
383  string& gridSWVersion, string& fileCreationDate,
384  string& gridid, const string& grdInptFile);
385 
386  static void loadGridBinaryFront(IFStreamBinary& ifs, int& gridFileFormat,
387  string& gridSWVersion, string& fileCreationDate,
388  string& gridid, const string& grdInptFile);
389 
404  const set<int>& getVertexIndices(const int& level);
405 
406  void computeSpokeLists(const int& level) const;
407 
408 public:
409 
416  vertices(NULL), nVertices(0),
417  triangles(NULL), nTriangles(0),
418  levels(NULL), nLevels(0),
419  tessellations(NULL), nTessellations(0),
420  descendants(NULL), gridID(""),
421  gridInputFile("null"), gridOutputFile("null"), gridSoftwareVersion(""),
422  gridGenerationDate(""), refCount(0)
423  { }
424 
430  vertices(NULL), nVertices(0),
431  triangles(NULL), nTriangles(0),
432  levels(NULL), nLevels(0),
433  tessellations(NULL), nTessellations(0),
434  descendants(NULL), gridID(""),
435  gridInputFile("null"), gridOutputFile("null"), gridSoftwareVersion(""),
436  gridGenerationDate(""), refCount(0)
437  { }
438 
443  GeoTessGrid(GeoTessGrid &other);
444 
450  GeoTessGrid& operator= (const GeoTessGrid& other);
451 
457  GeoTessGrid* loadGrid(const string& inputFile);
458 
465  static string getGridID(const string& fileName);
466 
473  static bool isGeoTessGrid(const string& inputFile);
474 
480  bool operator == (const GeoTessGrid& g) const
481  { return (gridID == g.gridID); }
482 
488  bool operator != (const GeoTessGrid& g) const
489  { return !(*this == g); }
490 
501  const string& getGridID() const
502  {
503  return gridID;
504  }
505 
510  const GeoTessOptimizationType& getOptimizationType() const { return GeoTessOptimizationType::SPEED; }
511 
518  void setGridSoftwareVersion(const string& swVersion) {gridSoftwareVersion = swVersion; };
519 
526  const string& getGridSoftwareVersion() const {return gridSoftwareVersion; };
527 
534  void setGridGenerationDate(const string& gridDate) {gridGenerationDate = gridDate; };
535 
542  const string& getGridGenerationDate() const {return gridGenerationDate; };
543 
548  void setGridInputFile(const string& gridFile) { gridInputFile = gridFile; }
549 
557  const string& getGridInputFile() const {return gridInputFile; }
558 
566  const string& getGridOutputFile() const { return gridOutputFile; }
567 
573  const double* getVertex(int vertex) const
574  {
575  return vertices[vertex];
576  }
577 
586  int findClosestVertex(double* unit_vector, int tessId)
587  {
588  int* t = triangles[getTriangle(getFirstTriangle(tessId, 0), unit_vector)];
589 
590  int index = 0;
591  double dot = GeoTessUtils::dot(unit_vector, vertices[t[0]]);
592 
593  double doti = GeoTessUtils::dot(unit_vector, vertices[t[1]]);
594  if (doti > dot)
595  {
596  index = 1;
597  dot = doti;
598  }
599 
600  doti = GeoTessUtils::dot(unit_vector, vertices[t[2]]);
601  if (doti > dot)
602  {
603  index = 2;
604  dot = doti;
605  }
606 
607  return t[index];
608  }
609 
618  int getVertexIndex(int triangle, int corner) const
619  { return triangles[triangle][corner]; }
620 
636  int getVertexIndex(int tessId, int level, int triangle, int corner) const
637  {
638  return triangles[levels[tessellations[tessId][0] + level][0] + triangle][corner];
639  }
640 
647  int getVertexIndex(const double* u)
648  {
649  for (int i=nTessellations-1; i>=0; --i)
650  {
651  int vid = getVertexIndex(u, i);
652  if (vid >= 0)
653  return vid;
654  }
655  return -1;
656  }
657 
666  int getVertexIndex(const double* u, int tessId)
667  {
668  int* t = triangles[getTriangle(getFirstTriangle(tessId, 0), u)];
669 
670  if (GeoTessUtils::dot(u, vertices[t[0]]) > cos(1e-7))
671  return t[0];
672  if (GeoTessUtils::dot(u, vertices[t[1]]) > cos(1e-7))
673  return t[1];
674  if (GeoTessUtils::dot(u, vertices[t[2]]) > cos(1e-7))
675  return t[2];
676  return -1;
677  }
678 
690  double* getVertex(int tessId, int level, int triangle, int corner)
691  {
692  return vertices[triangles[levels[tessellations[tessId][0] + level][0] + triangle][corner]];
693  }
694 
704  double const* const* getVertices() const { return vertices; }
705 
714  void getVerticesTopLevel(const int& tessellation, set<const double*>& vectors)
715  {
716  getVertices(tessellation, getNLevels(tessellation)-1, vectors);
717  }
718 
728  void getVertices(const int& tessellation, const int& level, set<const double*>& vectors);
729 
742  const set<int>& getVertexIndices(const int& tessId, const int& level)
743  { return getVertexIndices(getLevel(tessId, level)); }
744 
756  const set<int>& getVertexIndicesTopLevel(const int& tessId)
757  { return getVertexIndices(tessellations[tessId][1] - 1); }
758 
763  int getNVertices() const { return nVertices; }
764 
769  int getNTessellations() const { return nTessellations; }
770 
778  int getNLevels(int tessellation) const
779  { return tessellations[tessellation][1] - tessellations[tessellation][0]; }
780 
789  int getLevel(int tessellation, int i) const
790  { return tessellations[tessellation][0] + i; }
791 
807  int getLastLevel(int tessellation) const
808  { return tessellations[tessellation][1] - 1; }
809 
824  int getTopLevel(int tessellation) const
825  { return tessellations[tessellation][1] - tessellations[tessellation][0] - 1; }
826 
836  int getNTriangles(int tessellation, int level) const
837  {
838  return levels[tessellations[tessellation][0] + level][1]
839  - levels[tessellations[tessellation][0] + level][0];
840  }
841 
853  int getTriangle(int tessellation, int level, int i) const
854  { return levels[tessellations[tessellation][0] + level][0] + i; }
855 
865  int getFirstTriangle(int tessellation, int level) const
866  { return levels[tessellations[tessellation][0] + level][0]; }
867 
877  int getLastTriangle(int tessellation, int level) const
878  { return levels[tessellations[tessellation][0] + level][1]-1; }
879 
889  int const* const* getTriangles() const { return triangles; }
890 
902  const int* getTriangleVertexIndexes(int triangleIndex) const
903  { return triangles[triangleIndex]; }
904 
916  int getTriangleVertexIndex(int triangleIndex, int cornerIndex) const
917  { return triangles[triangleIndex][cornerIndex]; }
918 
930  const double* getTriangleVertex(int triangleIndex, int cornerIndex) const
931  { return vertices[triangles[triangleIndex][cornerIndex]]; }
932 
933 
942  void getTriangleVertices(int triangle, double** triVrt)
943  {
944  int* corners = triangles[triangle];
945  triVrt[0][0] = vertices[corners[0]][0];
946  triVrt[0][1] = vertices[corners[0]][1];
947  triVrt[0][2] = vertices[corners[0]][2];
948  triVrt[1][0] = vertices[corners[1]][0];
949  triVrt[1][1] = vertices[corners[1]][1];
950  triVrt[1][2] = vertices[corners[1]][2];
951  triVrt[2][0] = vertices[corners[2]][0];
952  triVrt[2][1] = vertices[corners[2]][1];
953  triVrt[2][2] = vertices[corners[2]][2];
954  }
955 
960  const void computeCircumCenters()
961  {
962  if (circumCenters.empty()) circumCenters.resize(nTriangles, NULL);
963 
964  for (int triangle=0; triangle<nTriangles; ++triangle)
965  if (circumCenters[triangle] == NULL)
966  {
967  int* corners = triangles[triangle];
968  circumCenters[triangle] = GeoTessUtils::circumCenterPlus(vertices[corners[0]],
969  vertices[corners[1]], vertices[corners[2]]);
970  }
971  }
972 
977  const void computeCircumCenters(const int& level)
978  {
979  if (circumCenters.empty()) circumCenters.resize(nTriangles);
980 
981  if (circumCenters[levels[level][0]] == NULL)
982  {
983  for (int triangle=levels[level][0]; triangle<levels[level][1]; ++triangle)
984  {
985  int* corners = triangles[triangle];
986  circumCenters[triangle] = GeoTessUtils::circumCenterPlus(vertices[corners[0]],
987  vertices[corners[1]], vertices[corners[2]]);
988  }
989  }
990  }
991 
1007  const double* getCircumCenter(const int& triangle) const { return circumCenters[triangle]; }
1008 
1026  void getCircumCenter(const int& triangle, double* cc) const
1027  { cc[0]=circumCenters[triangle][0]; cc[1]=circumCenters[triangle][1]; cc[2]=circumCenters[triangle][2]; }
1028 
1043  int getNeighbor(const int& triangleIndex, const int& neighborIndex) const
1044  { return neighborIndex == 3 ? descendants[triangleIndex] : edgeList[triangleIndex][neighborIndex]->tLeft; }
1045 
1070  int getNeighbor(const int& tessellation, const int& level, const int& triangle, const int& side)
1071  { return getNeighbor(getTriangle(tessellation, level, triangle), side); }
1072 
1087  void getNeighbors(int triangleIndex, vector<int>& neighbors)
1088  {
1089  neighbors.clear();
1090  vector<Edge*> edges = edgeList[triangleIndex];
1091  neighbors.push_back(edges[0]->tLeft);
1092  neighbors.push_back(edges[1]->tLeft);
1093  neighbors.push_back(edges[2]->tLeft);
1094  neighbors.push_back(descendants[triangleIndex]);
1095  }
1096 
1119  void getNeighbors(const int& tessellation, const int& level, const int& triangle, vector<int>& neighbors)
1120  { getNeighbors(getTriangle(tessellation, level, triangle), neighbors); }
1121 
1135  int getNeighborIndex(const int& tid, const int& nid)
1136  {
1137  if (edgeList[tid][0]->tLeft == nid)
1138  return 0;
1139  if (edgeList[tid][1]->tLeft == nid)
1140  return 1;
1141  if (edgeList[tid][2]->tLeft == nid)
1142  return 2;
1143  return -1;
1144  }
1145 
1146  int const* getDescendants() const { return descendants; }
1147 
1148  int getDescendant(const int& triangle) const { return descendants[triangle]; }
1149 
1150  int getDescendant(const int& tessId, const int& level, const int& triangle) const
1151  { return descendants[getTriangle(tessId, level, triangle)]; }
1152 
1156  string toString();
1157 
1165  int getTriangle(int triangleIndex, const double* vector);
1166 
1174  const vector<vector<int> >& getVertexTriangles(const int& level) const { return vtxTriangles[level]; }
1175 
1188  const vector<int>& getVertexTriangles(const int& tessId, const int& level, const int& vertex) const
1189  { return vtxTriangles[tessellations[tessId][0] + level][vertex]; }
1190 
1204  const vector<int>& getVertexTriangles(int tessId, int vertex) const
1205  { return getVertexTriangles(tessId, getNLevels(tessId)-1, vertex); }
1206 
1213  //void clearVertexTriangles();
1214 
1224  void getVertexNeighborsOrdered(const int& tessId, const int& level, const int& vertex, vector<int>& v);
1225 
1237  void getVertexNeighbors(const int& tessId, const int& level, const int& vertex, set<int>& nbrs)
1238  { getVertexNeighbors(tessId, level, vertex, 1, nbrs); }
1239 
1257  void getVertexNeighbors(const int& tessId, const int& level, const int& vertex,
1258  const int& order, set<int>& nbrs);
1259 
1260  // All methods below this point are public but are not documented in the doxygen documentation.
1261  // These are methods that typical applications will never need to call. They have to be
1262  // public because other classes in the GeoTess namespace need to access them.
1263  //
1265 
1269  GeoTessGrid(IFStreamAscii& input, const GeoTessOptimizationType* opttype) :
1270  vertices(NULL), triangles(NULL), levels(NULL), tessellations(NULL),
1271  descendants(NULL), gridID(""),
1272  gridInputFile("null"), gridOutputFile("null"), gridSoftwareVersion(""),
1273  gridGenerationDate(""), refCount(0)
1274  { loadGridAscii(input); }
1275 
1279  GeoTessGrid(IFStreamBinary& input, const GeoTessOptimizationType* opttype) :
1280  vertices(NULL), triangles(NULL), levels(NULL), tessellations(NULL),
1281  descendants(NULL), gridID(""),
1282  gridInputFile("null"), gridOutputFile("null"), gridSoftwareVersion(""),
1283  gridGenerationDate(""), refCount(0)
1284  { loadGridBinary(input); }
1285 
1289  GeoTessGrid(double** _vertices, int& _nVertices,
1290  int** _triangles, int& _nTriangles,
1291  int** _levels, int& _nLevels,
1292  int** _tessellations, int& _nTessellations,
1293  string& _gridID,
1294  string& _gridInputFile,
1295  string& _gridOutputFile,
1296  string& _gridSoftwareVersion,
1297  string& _gridGenerationDate,
1298  const GeoTessOptimizationType* _opttype) :
1299  vertices(_vertices), nVertices(_nVertices),
1300  triangles(_triangles), nTriangles(_nTriangles),
1301  levels(_levels), nLevels(_nLevels),
1302  tessellations(_tessellations), nTessellations(_nTessellations),
1303  descendants(NULL),
1304  gridID(_gridID),
1305  gridInputFile(_gridInputFile),
1306  gridOutputFile(_gridOutputFile),
1307  gridSoftwareVersion(_gridSoftwareVersion),
1308  gridGenerationDate(_gridGenerationDate),
1309  refCount(0)
1310  { initialize(); }
1311 
1315  virtual ~GeoTessGrid();
1316 
1320  int getReferenceCount() { return refCount; }
1321 
1325  void addReference() { ++refCount; }
1326 
1330  void removeReference()
1331  {
1332  if (isNotReferenced())
1333  {
1334  ostringstream os;
1335  os << endl << "ERROR in GeoTessGrid::removeReference" << endl
1336  << "Reference count (" << refCount << ") is already zero." << endl;
1337  throw GeoTessException(os, __FILE__, __LINE__, 2001);
1338  }
1339 
1340  --refCount;
1341  }
1342 
1346  bool isNotReferenced() { return (refCount == 0); }
1347 
1353  void writeGrid(const string& fileName);
1354 
1358  void writeGridAscii(const string& fileName);
1359 
1363  void writeGridAscii(IFStreamAscii& output);
1364 
1368  void writeGridBinary(const string& fileName);
1369 
1373  void writeGridBinary(IFStreamBinary& output);
1374 
1380  bool isSupportedFormatVersion(int frmtVrsn)
1381  { return (frmtVrsn == 2); }
1382 
1384 
1393  void testGrid();
1394 
1400  int getNLevels() const { return nLevels; }
1401 
1413  int const* const* getLevels() const { return levels; }
1414 
1429  int const* const* getTessellations() const { return tessellations; }
1430 
1438  int getNTriangles() const { return nTriangles; }
1439 
1440  vector<Edge*>& getSpokeList(const int& level) const
1441  { computeSpokeLists(level); return spokeList[level]; }
1442 
1443  const vector<vector<Edge*> >& getEdgeList() const { return edgeList; }
1444 
1445  const vector<Edge*>& getEdgeList(const int& triangle) const { return edgeList[triangle]; }
1446 
1453  void getCenter(const int& triangle, double* center)
1454  {
1455  vector<double*> corners;
1456  corners.push_back(vertices[triangles[triangle][0]]);
1457  corners.push_back(vertices[triangles[triangle][1]]);
1458  corners.push_back(vertices[triangles[triangle][2]]);
1459  GeoTessUtils::center(corners, center);
1460  }
1461 
1467  int delaunay();
1468 
1469 };
1470 // end class GeoTessGrid
1471 
1472 }// end namespace geotess
1473 
1474 #endif // GEOTESSGRID_OBJECT_H
const string & getGridID() const
Definition: GeoTessGrid.h:501
void getVertexNeighbors(const int &tessId, const int &level, const int &vertex, set< int > &nbrs)
Definition: GeoTessGrid.h:1237
void getCircumCenter(const int &triangle, double *cc) const
Definition: GeoTessGrid.h:1026
int getNLevels(int tessellation) const
Definition: GeoTessGrid.h:778
int tLeft
Definition: GeoTessGrid.h:115
const string & getGridGenerationDate() const
Definition: GeoTessGrid.h:542
int getLevel(int tessellation, int i) const
Definition: GeoTessGrid.h:789
const vector< Edge * > & getEdgeList(const int &triangle) const
Definition: GeoTessGrid.h:1445
const double * getVertex(int vertex) const
Definition: GeoTessGrid.h:573
vector< Edge * > & getSpokeList(const int &level) const
Definition: GeoTessGrid.h:1440
int getVertexIndex(const double *u)
Definition: GeoTessGrid.h:647
double ** vertices
Definition: GeoTessGrid.h:174
int const * getDescendants() const
Definition: GeoTessGrid.h:1146
int ** triangles
Definition: GeoTessGrid.h:186
Opens a file for binary read and write access.
Definition: IFStreamBinary.h:79
GeoTessGrid()
Definition: GeoTessGrid.h:415
GeoTessGrid(const GeoTessOptimizationType *opttype)
Definition: GeoTessGrid.h:429
int vj
Definition: GeoTessGrid.h:103
int vk
Definition: GeoTessGrid.h:108
const vector< int > & getVertexTriangles(int tessId, int vertex) const
Definition: GeoTessGrid.h:1204
const string & getGridInputFile() const
Definition: GeoTessGrid.h:557
Manages the geometry and topology of one or more multi-level triangular tessellations of a unit spher...
Definition: GeoTessGrid.h:163
const vector< int > & getVertexTriangles(const int &tessId, const int &level, const int &vertex) const
Definition: GeoTessGrid.h:1188
GeoTessGrid(const string &gid, const GeoTessOptimizationType *opttype)
Definition: GeoTessGrid.h:249
int getNVertices() const
Definition: GeoTessGrid.h:763
const vector< vector< int > > & getVertexTriangles(const int &level) const
Definition: GeoTessGrid.h:1174
int getNeighbor(const int &triangleIndex, const int &neighborIndex) const
Definition: GeoTessGrid.h:1043
void getVerticesTopLevel(const int &tessellation, set< const double * > &vectors)
Definition: GeoTessGrid.h:714
int getFirstTriangle(int tessellation, int level) const
Definition: GeoTessGrid.h:865
int ** tessellations
Definition: GeoTessGrid.h:224
void setGridGenerationDate(const string &gridDate)
Definition: GeoTessGrid.h:534
int getNeighbor(const int &tessellation, const int &level, const int &triangle, const int &side)
Definition: GeoTessGrid.h:1070
double const *const * getVertices() const
Definition: GeoTessGrid.h:704
const string & getGridOutputFile() const
Definition: GeoTessGrid.h:566
void setGridSoftwareVersion(const string &swVersion)
Definition: GeoTessGrid.h:518
int getNTessellations() const
Definition: GeoTessGrid.h:769
int nLevels
Definition: GeoTessGrid.h:209
int getVertexIndex(const double *u, int tessId)
Definition: GeoTessGrid.h:666
int const *const * getTessellations() const
Definition: GeoTessGrid.h:1429
Enumeration of the optimization strategies supported by GeoTess including OptimizationType::SPEED and...
Definition: GeoTessOptimizationType.h:66
int getVertexIndex(int triangle, int corner) const
Definition: GeoTessGrid.h:618
int nTessellations
Definition: GeoTessGrid.h:229
void setGridInputFile(const string &gridFile)
Definition: GeoTessGrid.h:548
Opens ascii file for read and write access.
Definition: IFStreamAscii.h:80
const vector< vector< Edge * > > & getEdgeList() const
Definition: GeoTessGrid.h:1443
const double * getCircumCenter(const int &triangle) const
Definition: GeoTessGrid.h:1007
int getLastTriangle(int tessellation, int level) const
Definition: GeoTessGrid.h:877
int getVertexIndex(int tessId, int level, int triangle, int corner) const
Definition: GeoTessGrid.h:636
const int * getTriangleVertexIndexes(int triangleIndex) const
Definition: GeoTessGrid.h:902
int nTriangles
Definition: GeoTessGrid.h:191
int cornerj
Definition: GeoTessGrid.h:110
int const *const * getTriangles() const
Definition: GeoTessGrid.h:889
int const *const * getLevels() const
Definition: GeoTessGrid.h:1413
int getLastLevel(int tessellation) const
Definition: GeoTessGrid.h:807
int getTriangleVertexIndex(int triangleIndex, int cornerIndex) const
Definition: GeoTessGrid.h:916
int nVertices
Definition: GeoTessGrid.h:179
Definition: GeoTessGrid.h:98
int getTriangle(int tessellation, int level, int i) const
Definition: GeoTessGrid.h:853
int ** levels
Definition: GeoTessGrid.h:204
int getNLevels() const
Definition: GeoTessGrid.h:1400
int getNeighborIndex(const int &tid, const int &nid)
Definition: GeoTessGrid.h:1135
Edge * next
Definition: GeoTessGrid.h:131
const set< int > & getVertexIndicesTopLevel(const int &tessId)
Definition: GeoTessGrid.h:756
const string & getGridSoftwareVersion() const
Definition: GeoTessGrid.h:526
int tRight
Definition: GeoTessGrid.h:120
void getCenter(const int &triangle, double *center)
Definition: GeoTessGrid.h:1453
void getTriangleVertices(int triangle, double **triVrt)
Definition: GeoTessGrid.h:942
void getNeighbors(const int &tessellation, const int &level, const int &triangle, vector< int > &neighbors)
Definition: GeoTessGrid.h:1119
#define GEOTESS_EXP_IMP
Definition: CPPGlobals.h:71
const set< int > & getVertexIndices(const int &tessId, const int &level)
Definition: GeoTessGrid.h:742
const double * getTriangleVertex(int triangleIndex, int cornerIndex) const
Definition: GeoTessGrid.h:930
int getNTriangles() const
Definition: GeoTessGrid.h:1438
double * getVertex(int tessId, int level, int triangle, int corner)
Definition: GeoTessGrid.h:690
int getDescendant(const int &tessId, const int &level, const int &triangle) const
Definition: GeoTessGrid.h:1150
const void computeCircumCenters(const int &level)
Definition: GeoTessGrid.h:977
int getTopLevel(int tessellation) const
Definition: GeoTessGrid.h:824
int findClosestVertex(double *unit_vector, int tessId)
Definition: GeoTessGrid.h:586
void getNeighbors(int triangleIndex, vector< int > &neighbors)
Definition: GeoTessGrid.h:1087
const GeoTessOptimizationType & getOptimizationType() const
Definition: GeoTessGrid.h:510
int getDescendant(const int &triangle) const
Definition: GeoTessGrid.h:1148
int getNTriangles(int tessellation, int level) const
Definition: GeoTessGrid.h:836
const void computeCircumCenters()
Definition: GeoTessGrid.h:960