GeoTessCPP
2.2
Software to facilitate storage and retrieval of 3D information about the Earth.
|
Manages the geometry and topology of one or more multi-level triangular tessellations of a unit sphere. More...
#include <GeoTessGrid.h>
Public Member Functions | |
GeoTessGrid () | |
Default constructor. More... | |
GeoTessGrid (IFStreamAscii &input) | |
Standard constructor. More... | |
GeoTessGrid (IFStreamBinary &input) | |
Standard constructor. More... | |
GeoTessGrid (GeoTessGrid &other) | |
Copy constructor. More... | |
const void | computeCircumCenters () |
Compute the circumcenters of all triangles if they have not already been computed. More... | |
const void | computeCircumCenters (const int &level) |
Compute the circumcenters of all triangles on the specified level if they have not already been computed. More... | |
int | delaunay () |
Convert tessellation to a Delaunay tessellation. More... | |
int | findClosestVertex (double *unit_vector, int tessId) |
Retrieve the index of the vertex that is closest to the supplied unit vector. More... | |
void | getCenter (const int &triangle, double *center) |
Compute the unit vector that resides at the center of the specified triangle. More... | |
const double * | getCircumCenter (const int &triangle) const |
Retrieve the circumCenter of the specified triangle. More... | |
void | getCircumCenter (const int &triangle, double *cc) const |
Copy the circumCenter of the specified triangle. More... | |
int | getDescendant (const int &triangle) const |
int | getDescendant (const int &tessId, const int &level, const int &triangle) const |
int const * | getDescendants () const |
const vector< vector< Edge * > > & | getEdgeList () const |
const vector< Edge * > & | getEdgeList (const int &triangle) const |
int | getFirstTriangle (int tessellation, int level) const |
Retrieve the index of the first triangle on the specified level of the specified tessellation of the model. More... | |
const string & | getGridGenerationDate () const |
Retrieve the date when the contents of this grid was generated. More... | |
const string & | getGridID () const |
A String ID that uniquely identifies this GeoTessGrid. More... | |
const string & | getGridInputFile () const |
Retrieve the name of the file from which the grid was loaded. More... | |
const string & | getGridOutputFile () const |
Retrieve the name of the file to which this grid was most recently written, or the string "null" if it has not been written. More... | |
const string & | getGridSoftwareVersion () const |
Get the name and version number of the software that generated the contents of this grid. More... | |
int | getLastLevel (int tessellation) const |
Retrieve the index of the last level on the specified tessellation, relative to all levels in all tessellations. More... | |
int | getLastTriangle (int tessellation, int level) const |
Retrieve the index of the last triangle on the specified level of the specified tessellation of the model. More... | |
int | getLevel (int tessellation, int i) const |
Retrieve the index of one of the levels on the specified tessellation. More... | |
int const *const * | getLevels () const |
Retrieve a reference to all of the tessellation levels. More... | |
LONG_INT | getMemory () |
Retrieve the amount of memory required by this GeoTessGrid object in bytes. More... | |
int | getNeighbor (const int &triangleIndex, const int &neighborIndex) const |
Retrieve the index of one of the triangles that is a neighbor of the specified triangle. More... | |
int | getNeighbor (const int &tessellation, const int &level, const int &triangle, const int &side) |
Retrieve the index of the triangle that is the i'th neighbor of the specified triangle. More... | |
int | getNeighborIndex (const int &tid, const int &nid) |
If triangle with index tid has a neighbor with index nid, then return the index of neighbor in triangle's neighbor array. More... | |
void | getNeighbors (int triangleIndex, vector< int > &neighbors) |
Retrieve the indexes of the triangles that are neighbors of the specified triangle. More... | |
void | getNeighbors (const int &tessellation, const int &level, const int &triangle, vector< int > &neighbors) |
Retrieve the indexes of the triangles that are neighbors of the specified triangle. More... | |
int | getNLevels (int tessellation) const |
Retrieve number of tessellation levels that define the specified multi-level tessellation of the model. More... | |
int | getNLevels () const |
Returns the number of tessellation levels defined for this grid. More... | |
int | getNTessellations () const |
Returns the number of tessellations in the tessellations array. More... | |
int | getNTriangles (int tessellation, int level) const |
Retrieve the number of triangles that define the specified level of the specified multi-level tessellation of the model. More... | |
int | getNTriangles () const |
Retrieve the total number of triangles including those on all levels of all tessellations. More... | |
int | getNVertices () const |
Returns the number of vertices in the vectices array. More... | |
vector< Edge * > & | getSpokeList (const int &level) const |
int const *const * | getTessellations () const |
Retrieve a reference to all of the tessellations of this grid. More... | |
int | getTopLevel (int tessellation) const |
Retrieve the index of the last level on the specified tessellation, relative to first level of the specified tessellation. More... | |
int | getTriangle (int tessellation, int level, int i) const |
Retrieve the index of the i'th triangle on the specified level of the specified tessellation of the model. More... | |
int | getTriangle (int triangleIndex, const double *vector) |
Perform walking triangle search to find the index of the triangle that contains position defined by vector and which has no descendant. More... | |
int const *const * | getTriangles () const |
Retrieve a reference to the nTriangles x 3 array of int that specifies the indexes of the 3 vertices that define each triangle of the tessellation. More... | |
const double * | getTriangleVertex (int triangleIndex, int cornerIndex) const |
Retrieve the unit vector of the vertex located at one of the corners of the specified triangle. More... | |
int | getTriangleVertexIndex (int triangleIndex, int cornerIndex) const |
Retrieve the index of the i'th vertex (0..2) that represents one of the corners of the specified triangle. More... | |
const int * | getTriangleVertexIndexes (int triangleIndex) const |
Retrieve an int[3] array containing the indexes of the vertices that form the corners of the triangle with index triangleIndex. More... | |
void | getTriangleVertices (int triangle, double **triVrt) |
Get the 3 vertices that form the corners of the specified triangle, in clockwise order. More... | |
const double * | getVertex (int vertex) const |
Retrieve the unit vector that corresponds to the specified vertex. More... | |
double * | getVertex (int tessId, int level, int triangle, int corner) |
Get the unit vector of the vertex that occupies the specified position in the hierarchy. More... | |
int | getVertexIndex (int triangle, int corner) const |
Get the index of the vertex that occupies the specified position in the hierarchy. More... | |
int | getVertexIndex (int tessId, int level, int triangle, int corner) const |
Get the index of the vertex that occupies the specified position in the hierarchy. More... | |
int | getVertexIndex (const double *u) |
Retrieve the index of the vertex that is colocated with the supplied unit vector. More... | |
int | getVertexIndex (const double *u, int tessId) |
Retrieve the index of the vertex that is colocated with the supplied unit vector. More... | |
const set< int > & | getVertexIndices (const int &tessId, const int &level) |
Retrieve a set containing the indices of all the vertices that are connected together by triangles on the specified level. More... | |
const set< int > & | getVertexIndicesTopLevel (const int &tessId) |
Retrieve a set containing the indices of all the vertices that are connected together by triangles on the top level of the specified tessellation. More... | |
void | getVertexNeighbors (const int &tessId, const int &level, const int &vertex, set< int > &nbrs) |
Retrieve a list of the indexes of all the vertexes that are connected to the specified vertex by a single edge, considering only triangles in the specified tessellation and level. More... | |
void | getVertexNeighbors (const int &tessId, const int &level, const int &vertex, const int &order, set< int > &nbrs) |
Retrieve a list of the indexes of all the vertexes that are within a neighborhood of the specified vertex. More... | |
void | getVertexNeighborsOrdered (const int &tessId, const int &level, const int &vertex, vector< int > &v) |
GeoTessGrid maintains a list of the triangles that each vertex is a member of. More... | |
const vector< vector< int > > & | getVertexTriangles (const int &level) const |
Retrieve a list of the triangles a particular vertex is a member of, considering only triangles in the specified tessellation/level. More... | |
const vector< int > & | getVertexTriangles (const int &tessId, const int &level, const int &vertex) const |
Retrieve a list of the triangles a particular vertex is a member of, considering only triangles in the specified tessellation/level. More... | |
const vector< int > & | getVertexTriangles (int tessId, int vertex) const |
Retrieve a list of the triangles a particular vertex is a member of, considering only triangles in the top level of the specified tessellation. More... | |
double const *const * | getVertices () const |
Retrieve a reference to all of the vertices. More... | |
void | getVertices (const int &tessellation, const int &level, set< const double * > &vectors) |
Return a set containing the unit vectors of all the vertices that are connected together by triangles on the specified tessellation and level. More... | |
void | getVerticesTopLevel (const int &tessellation, set< const double * > &vectors) |
Retrieve a set containing the unit vectors of all the vertices that are connected together by triangles on the top level of the specified tessellation. More... | |
GeoTessGrid * | loadGrid (const string &inputFile) |
Load GeoTessGrid object from a File. More... | |
bool | operator!= (const GeoTessGrid &g) const |
Return true if the input Grid object (g) gridID is not equal to this Grid objects gridID. More... | |
GeoTessGrid & | operator= (const GeoTessGrid &other) |
Equal operator. More... | |
bool | operator== (const GeoTessGrid &g) const |
Return true if the input Grid object (g) gridID equals this Grid objects gridID. More... | |
void | setGridGenerationDate (const string &gridDate) |
Set the date when this grid was generated. More... | |
void | setGridInputFile (const string &gridFile) |
Set the grid input file name. More... | |
void | setGridSoftwareVersion (const string &swVersion) |
Set the name and version number of the software that generated the contents of this grid. More... | |
void | testGrid () |
Tests the integrity of the grid. More... | |
string | toString () |
Static Public Member Functions | |
static string | getGridID (const string &fileName) |
Open the specified file using the appropriate format, and read only enough of the file to retrieve the gridID. More... | |
static bool | isGeoTessGrid (const string &inputFile) |
Test a file to see if it is a GeoTessGrid file. More... | |
Protected Member Functions | |
GeoTessGrid (const string &gid) | |
Standard constructor. More... | |
void | initialize () |
Identify the neighbors and descendants of each triangle. More... | |
Protected Attributes | |
int ** | levels |
An n x 2 array where n is the number of tessellation levels in all the tessellations that constitute this model. More... | |
int | nLevels |
Number of levels. More... | |
int | nTessellations |
Number of tessellations. More... | |
int | nTriangles |
Number of triangles. More... | |
int | nVertices |
Number of vertices. More... | |
int ** | tessellations |
tessellations is a n x 2 int array where n is the number of tessellations in the topology of the model. More... | |
int ** | triangles |
An nTriangles x 3 array of integers. More... | |
double ** | vertices |
An nVertices x 3 array of tessellation vertices. More... | |
Manages the geometry and topology of one or more multi-level triangular tessellations of a unit sphere.
Has many functions to retrieve information about the grid but knows nothing about Data.
Manages the geometry and topology of one or more multi-level triangular tessellations of a unit sphere. It knows:
GeoTessGrid is thread-safe in that its internal state is not modified after its data has been loaded into memory. The design intention is that single instances of a GeoTessGrid object and GeoTessData object can be shared among all the threads in a multi-threaded application and each thread will have it's own instance of a GeoTessPosition object that references the common GeoTessGrid + GeoTessData combination.
References Ballard, S., J. R. Hipp and C. J. Young, 2009, Efficient and Accurate Calculation of Ray Theory Seismic Travel Time Through Variable Resolution 3D Earth Models, Seismological Research Letters, v.80, n. 6 p. 989-999.
|
inlineprotected |
Standard constructor.
Builds this grid from the input file name.
|
inline |
Default constructor.
All grid information initialized to NULL. Applications need to call
|
inline |
Standard constructor.
Builds this grid from an ascii file.
|
inline |
Standard constructor.
Builds this grid from a binary file.
geotess::GeoTessGrid::GeoTessGrid | ( | GeoTessGrid & | other | ) |
Copy constructor.
Makes a deep copy
other | the other GeoTessGrid whose values are to be duplicated here. |
|
inline |
Compute the circumcenters of all triangles if they have not already been computed.
|
inline |
Compute the circumcenters of all triangles on the specified level if they have not already been computed.
int geotess::GeoTessGrid::delaunay | ( | ) |
Convert tessellation to a Delaunay tessellation.
|
inline |
Retrieve the index of the vertex that is closest to the supplied unit vector.
Only vertices connected at the specified tessellation index are searched.
unit_vector | a unit vector |
tessId | tessellation to search for the specified unit vector. |
|
inline |
Compute the unit vector that resides at the center of the specified triangle.
triangle | the index of the triangle |
center | unit vector that is populated with the location of the center of the specified triangle; |
|
inline |
Retrieve the circumCenter of the specified triangle.
The circumCenter of a triangle is the center of the circle that has all three corners of the triangle on its circumference.
The fourth element of returned circumcenter is the dot product of the new circumcenter with one of the vertices. In other words, cc[3] = cos(ccRadius).
This method will fail if method computeCircumCenters() has not already been called. computeCircumCenters() is called from the GeoTessPositionNaturalNeighbor constructor.
triangle | Triangle for which the circumcenter will be returned. |
|
inline |
Copy the circumCenter of the specified triangle.
The circumCenter of a triangle is the center of the circle that has all three corners of the triangle on its circumference.
The fourth element of returned circumcenter is the dot product of the new circumcenter with one of the vertices. In other words, cc[3] = cos(ccRadius).
This method will fail if method computeCircumCenters() has not already been called. computeCircumCenters() is called from the GeoTessPositionNaturalNeighbor constructor.
triangle | Triangle for which the circumcenter will be returned. |
cc | the 4-element array into which the circumCenter will be copied. The first three elements will get the unit vector that defines circumCenter. Fourth element will get cos(ccRadius) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Retrieve the index of the first triangle on the specified level of the specified tessellation of the model.
tessellation | |
level | index of a level relative to the first level of the specified tessellation |
|
inline |
Retrieve the date when the contents of this grid was generated.
This is not necessarily the same as the date when the file was copied or translated.
|
static |
Open the specified file using the appropriate format, and read only enough of the file to retrieve the gridID.
fileName | name of file |
|
inline |
A String ID that uniquely identifies this GeoTessGrid.
It must be true that two GeoTessGrid objects that have different geometry or topology also have different uniqueID values. An MD5 hash of the primary data structures (tessellations, levels, triangles and vertices) would be an excellent choice for the uniqueId, but the uniqueId can be any String that uniquely identifies the grid.
|
inline |
Retrieve the name of the file from which the grid was loaded.
This will be the name of a GeoTessModel file if the grid was stored in the same file as the model.
|
inline |
Retrieve the name of the file to which this grid was most recently written, or the string "null" if it has not been written.
|
inline |
Get the name and version number of the software that generated the contents of this grid.
|
inline |
Retrieve the index of the last level on the specified tessellation, relative to all levels in all tessellations.
Levels for all tessellations are stored internally in a single array of level indices. In some instances, the index of a level relative to all the levels in all tessellations is needed. Use this method, getLastLevel(tessId), to retrieve this index. In other instances, the index of a level relative to the first level of a specified tessellation is needed. Use method getTopLevel(tessid) to retrieve that index.
tessellation |
|
inline |
Retrieve the index of the last triangle on the specified level of the specified tessellation of the model.
tessellation | |
level | index of a level relative to the first level of the specified tessellation |
|
inline |
Retrieve the index of one of the levels on the specified tessellation.
tessellation | |
i | the index of the desired level relative to the first level on tessellation. |
|
inline |
Retrieve a reference to all of the tessellation levels.
Levels consists of an nLevels x 2 array of ints. The int[2] array associated with each level is the first ([0]) and last ([1]) + 1 index of the triangles on the level.
Users should not modify the contents of the array.
|
inline |
Retrieve the amount of memory required by this GeoTessGrid object in bytes.
|
inline |
Retrieve the index of one of the triangles that is a neighbor of the specified triangle.
A triangle has at least 3 neighbors and usually has 4. For triangle T, neighbors 0, 1, and 2 reside on the same tessellation level as T and refer to the triangles that share an edge with T. If T has a fourth neighbor it is a descendent of T and resides on the next higher tessellation level relative to T. In other words, neighbor(3) is one of the triangles into which T was subdivided when the tessellation was constructed. If T does not have a descendant, then getNeighbor(3) will return -1. getNeighbor(i) will always return a valid triangle index for i=[0,1,2] but may or may not return a valid triangle index for i=3.
triangleIndex | index of the triangle whose neighbor is desired. |
neighborIndex | (0..3) |
|
inline |
Retrieve the index of the triangle that is the i'th neighbor of the specified triangle.
A triangle has at least 3 neighbors and usually has
tessellation | tessellation index |
level | index of a level relative to the first level of the specified tessellation |
triangle | the i'th triangle in the specified tessellation/level |
side | the index of the triangle side (0..2) |
|
inline |
If triangle with index tid has a neighbor with index nid, then return the index of neighbor in triangle's neighbor array.
In other words, if triangle nid is a neighbor of triangle tid, i.e., neighbors[tid][i] == nid, then this method returns i.
tid | the index of a triangle |
nid | the index of another triangle |
|
inline |
Retrieve the indexes of the triangles that are neighbors of the specified triangle.
A triangle has at least 3 neighbors and usually has 4. For triangle T, neighbors 0, 1, and 2 reside on the same tessellation level as T and refer to the triangles that share an edge with T. If T has a fourth neighbor it is a descendent of T and resides on the next higher tessellation level relative to T. In other words, neighbor(3) is one of the triangles into which T was subdivided when the tessellation was constructed. If T does not have a descendant, then getNeighbor(3) will return -1. getNeighbor(i) will always return a valid triangle index for i=[0,1,2] but may or may not return a valid triangle index for i=3.
triangleIndex | index of the triangle whose neighbors are desired. |
neighbors | an array that will be cleared and populated with the three triangle neighbors and the descendant of the supplied triangle. |
|
inline |
Retrieve the indexes of the triangles that are neighbors of the specified triangle.
A triangle has at least 3 neighbors and usually has 4. For triangle T, neighbors 0, 1, and 2 reside on the same tessellation level as T and refer to the triangles that share an edge with T. If T has a fourth neighbor it is a descendent of T and resides on the next higher tessellation level relative to T. In other words, neighbor(3) is one of the triangles into which T was subdivided when the tessellation was constructed. If T does not have a descendant, then getNeighbor(3) will return -1. getNeighbor(i) will always return a valid triangle index for i=[0,1,2] but may or may not return a valid triangle index for i=3.
tessellation | tessellation index |
level | index of a level relative to the first level of the specified tessellation |
triangle | the i'th triangle in the specified tessellation/level |
neighbors | an array that will be cleared and populated with the three triangle neighbors and the descendant of the supplied triangle. |
|
inline |
Retrieve number of tessellation levels that define the specified multi-level tessellation of the model.
tessellation |
|
inline |
Returns the number of tessellation levels defined for this grid.
|
inline |
Returns the number of tessellations in the tessellations array.
|
inline |
Retrieve the number of triangles that define the specified level of the specified multi-level tessellation of the model.
tessellation | |
level | index of a level relative to the first level of the specified tessellation |
|
inline |
Retrieve the total number of triangles including those on all levels of all tessellations.
|
inline |
Returns the number of vertices in the vectices array.
|
inline |
|
inline |
Retrieve a reference to all of the tessellations of this grid.
Tessellations is a n x 2 int array where n is the number of tessellations in the topology of the model. Each element specifies [0] the index of the first level and [1] last level + 1 that make up the tessellation.
A tessellation is a multi-level tessellation of a unit sphere, which is to say that it is a hierarchical set of single-level tessellations (see 'levels' above).
Users should not modify the contents of the array.
|
inline |
Retrieve the index of the last level on the specified tessellation, relative to first level of the specified tessellation.
Levels for all tessellations are stored internally in a single array of level indices. In some instances, the index of a level relative to the first level of a specified tessellation is needed. Use this method, getTopLevel(tessId), to retrieve this index. In other instances, the index of a level relative to all the levels in all tessellations is needed. Use method getLastLevel(tessid) to retrieve that index.
tessellation |
|
inline |
Retrieve the index of the i'th triangle on the specified level of the specified tessellation of the model.
tessellation | |
level | index of a level relative to the first level of the specified tessellation |
i |
int geotess::GeoTessGrid::getTriangle | ( | int | triangleIndex, |
const double * | vector | ||
) |
Perform walking triangle search to find the index of the triangle that contains position defined by vector and which has no descendant.
triangleIndex | the triangle from which to start the search |
vector | the unit vector of the point that is to be searched for. |
|
inline |
Retrieve a reference to the nTriangles x 3 array of int that specifies the indexes of the 3 vertices that define each triangle of the tessellation.
Users should not modify the contents of the array.
|
inline |
Retrieve the unit vector of the vertex located at one of the corners of the specified triangle.
triangleIndex | triangleIndex |
cornerIndex | 0..2 |
|
inline |
Retrieve the index of the i'th vertex (0..2) that represents one of the corners of the specified triangle.
triangleIndex | triangleIndex |
cornerIndex | 0..2 |
|
inline |
Retrieve an int[3] array containing the indexes of the vertices that form the corners of the triangle with index triangleIndex.
Users should not modify the contents of the array.
triangleIndex | triangleIndex |
|
inline |
Get the 3 vertices that form the corners of the specified triangle, in clockwise order.
triangle | index of the desired triangle |
triVrt | the 3 vertices (unit vectors). |
|
inline |
Retrieve the unit vector that corresponds to the specified vertex.
vertex | the index of the vertex |
|
inline |
Get the unit vector of the vertex that occupies the specified position in the hierarchy.
tessId | tessellation index |
level | index of a level relative to the first level of the specified tessellation |
triangle | the i'th triangle in the specified tessellation/level |
corner | the i'th corner of the specified tessellation/level/triangle |
|
inline |
Get the index of the vertex that occupies the specified position in the hierarchy.
triangle | the i'th triangle in the grid |
corner | the i'th corner of the specified triangle |
|
inline |
Get the index of the vertex that occupies the specified position in the hierarchy.
tessId | tessellation index |
level | index of a level relative to the first level of the specified tessellation |
triangle | the i'th triangle in the specified tessellation/level |
corner | the i'th corner of the specified tessellation/level/triangle |
|
inline |
Retrieve the index of the vertex that is colocated with the supplied unit vector.
u | a unit vector |
|
inline |
Retrieve the index of the vertex that is colocated with the supplied unit vector.
Only vertices connected at the specified tessellation index are searched.
u | a unit vector |
tessId | tessellation to search for the specified unit vector. |
|
inline |
Retrieve a set containing the indices of all the vertices that are connected together by triangles on the specified level.
The index of the level is relative to the first level of the specified tessellation.
Lazy evaluation is used to generate and store these sets.
tessId | index of the tessellation. |
level | index of the level relative to the first level of the specified tessellation. |
|
inline |
Retrieve a set containing the indices of all the vertices that are connected together by triangles on the top level of the specified tessellation.
Lazy evaluation is used to generate and store these sets.
tessId | index of the tessellation. |
|
inline |
Retrieve a list of the indexes of all the vertexes that are connected to the specified vertex by a single edge, considering only triangles in the specified tessellation and level.
Equivalent to calling this function with extra parameter "order" = 1.
tessId | tessellation index |
level | index of a level relative to the first level of the specified tessellation |
vertex | index of a vertex |
nbrs | indexes of vertices |
void geotess::GeoTessGrid::getVertexNeighbors | ( | const int & | tessId, |
const int & | level, | ||
const int & | vertex, | ||
const int & | order, | ||
set< int > & | nbrs | ||
) |
Retrieve a list of the indexes of all the vertexes that are within a neighborhood of the specified vertex.
The neighborhood is defined by the argument "order". If order is 1, then all the vertices that are connected by a single edge to vertex are included. If order is 2, then take the order 1 neighborhood and add all the vertices that are connected to any vertex in the order-1 neighborhood by a single edge. Keep doing that to as high order as desired. Only triangles in the specified tessellation and level are considered.
Supplied set nbrs is cleared at the beginning of this method and it will not contain starting vertex upon return.
tessId | tessellation index |
level | index of a level relative to the first level of the specified tessellation |
vertex | |
order | |
nbrs | list of vertex indices |
void geotess::GeoTessGrid::getVertexNeighborsOrdered | ( | const int & | tessId, |
const int & | level, | ||
const int & | vertex, | ||
vector< int > & | v | ||
) |
GeoTessGrid maintains a list of the triangles that each vertex is a member of.
there is a separate list for every tessellation level in the grid. Lazy evaluation is used to build this list.
This method clears the list for all tessellation levels. Retrieve a list of the indexes of all the vertexes that are connected to the specified vertex by a single edge, considering only triangles in the specified tessellation and level. The vertices will be arranged in clockwise order when viewed from outside the unit sphere.
tessId | the tessellation index |
level | index of a level relative to the first level of the specified tessellation |
vertex | index of central vertex |
v | vector of vertex indexes |
|
inline |
Retrieve a list of the triangles a particular vertex is a member of, considering only triangles in the specified tessellation/level.
level | index of a level relative to all levels in the grid. |
|
inline |
Retrieve a list of the triangles a particular vertex is a member of, considering only triangles in the specified tessellation/level.
Lazy evaluation is used here. The list of indexes is initially empty and is computed and stored on demand. Once computed the indexes remain in memory for the next time they might be called.
tessId | the tessellation index |
level | index of a level relative to the first level of the specified tessellation |
vertex | the index of the vertex |
|
inline |
Retrieve a list of the triangles a particular vertex is a member of, considering only triangles in the top level of the specified tessellation.
Lazy evaluation is used here. The list of indexes is initially empty and is computed and stored on demand. Once computed the indexes remain in memory for the next time they might be called.
tessId | tessellation index |
vertex |
|
inline |
Retrieve a reference to all of the vertices.
Vertices consists of an nVertices x 3 array of doubles. The double[3] array associated with each vertex is the 3 component unit vector that defines the position of the vertex.
Users should not modify the contents of the array.
void geotess::GeoTessGrid::getVertices | ( | const int & | tessellation, |
const int & | level, | ||
set< const double * > & | vectors | ||
) |
Return a set containing the unit vectors of all the vertices that are connected together by triangles on the specified tessellation and level.
tessellation | |
level | the level relative to the first level of the specified tessellation |
vectors | (output) a set containing the unit vectors of all the vertices that are connected together by triangles on the specified tessellation and level. |
|
inline |
Retrieve a set containing the unit vectors of all the vertices that are connected together by triangles on the top level of the specified tessellation.
tessellation | |
vectors | (output) a set containing the unit vectors of all the vertices that are connected together by triangles on the top level of the specified tessellation. |
|
protected |
Identify the neighbors and descendants of each triangle.
This method is called during construction of a GeoTessGrid object (i.e., when it is loaded from a file). Applications should not call this method.
|
static |
Test a file to see if it is a GeoTessGrid file.
inputFile |
GeoTessGrid* geotess::GeoTessGrid::loadGrid | ( | const string & | inputFile | ) |
Load GeoTessGrid object from a File.
inputFile | name of file from which to load grid. |
|
inline |
Return true if the input Grid object (g) gridID is not equal to this Grid objects gridID.
g | the other grid object to which this grid is to be compared. |
GeoTessGrid& geotess::GeoTessGrid::operator= | ( | const GeoTessGrid & | other | ) |
Equal operator.
Makes a deep copy.
other | the other GeoTessGrid whose values are to be duplicated here. |
|
inline |
Return true if the input Grid object (g) gridID equals this Grid objects gridID.
g | the other grid object to which this grid is to be compared. |
|
inline |
Set the date when this grid was generated.
This is not necessarily the same as the date when the file was copied or translated.
gridDate |
|
inline |
Set the grid input file name.
gridFile | name of grid file. |
|
inline |
Set the name and version number of the software that generated the contents of this grid.
swVersion | the name and version number of the software that generated the contents of this grid. |
void geotess::GeoTessGrid::testGrid | ( | ) |
Tests the integrity of the grid.
Visits every triangle T, and (1) checks to ensure that every neighbor of T includes T in its list of neighbors, and (2) checks that every neighbor of T shares exactly two nodes with T.
GeoTessException | if anything is amiss. |
string geotess::GeoTessGrid::toString | ( | ) |
|
protected |
An n x 2 array where n is the number of tessellation levels in all the tessellations that constitute this model.
For each tessellation level, the first element of the int[2] specifies the index of the first triangle in the tess level and the second element specifies the index of the last triangle on the tess level + 1.
A level is a single-level tessellation of a unit sphere, which is to say that it is a set of triangles that completely spans the surface of a unit sphere without gaps or overlaps.
|
protected |
Number of levels.
|
protected |
Number of tessellations.
|
protected |
Number of triangles.
|
protected |
Number of vertices.
|
protected |
tessellations is a n x 2 int array where n is the number of tessellations in the topology of the model.
Each element specifies [0] the index of the first level and [1] last level + 1 that make up the tessellation.
A tessellation is a multi-level tessellation of a unit sphere, which is to say that it is a hierarchical set of single-level tessellations (see 'levels' above).
To loop over the triangles of tessellation tessid, level levelid:
for (int i=getFirtTriangle(tessid, levelid); i < getLastTriangle(tessid, levelid); ++i)
{ // do something with triangles[i] }
|
protected |
An nTriangles x 3 array of integers.
Each triangle is represented by the indexes of the 3 vertices that form the corners of the triangle, listed in clockwise order when viewed from outside the tessellation.
|
protected |
An nVertices x 3 array of tessellation vertices.
Each vertex is represented by a 3-component unit vector with it's origin at the center of the earth. The x-component points toward lat,lon = 0, 0. The y-component points toward lat,lon = 0, 90. The z-component points toward north pole.