36 #ifndef POINTMAP_OBJECT_H
37 #define POINTMAP_OBJECT_H
114 vector<vector<int> > pointMap;
155 + (
LONG_INT)(pointMap.capacity() *
sizeof(vector<int>)
156 + pointMap.size() * 3 * (
LONG_INT)
sizeof(
int));
165 void setActiveRegion();
189 GeoTessPolygon* plgn = GeoTessPolygonFactory::getPolygon(polygonFileName);
190 setActiveRegion(plgn);
224 return pointMap.size();
237 return pointMap[pointIndex][0];
263 return pointMap[pointIndex][1];
276 return pointMap[pointIndex][2];
289 return pointMap[pointIndex];
319 return profiles[vertex][layer]->
getPointIndex(profiles[vertex][layer]->getNData()-1);
342 vector<int>& map = pointMap[pointIndex];
343 profiles[map[0]][map[1]]->
setData(map[2], data);
353 vector<int>& map = pointMap[pointIndex];
354 return profiles[map[0]][map[1]]->
getData(map[2]);
365 template <
typename T>
368 vector<int>& map = pointMap[pointIndex];
382 vector<int>& map = pointMap[pointIndex];
383 return profiles[map[0]][map[1]]->
getValue(attributeIndex, map[2]);
397 vector<int>& map = pointMap[pointIndex];
398 return profiles[map[0]][map[1]]->
getData(map[2])->
getDouble(attributeIndex);
412 vector<int>& map = pointMap[pointIndex];
413 return profiles[map[0]][map[1]]->
getData(map[2])->
getFloat(attributeIndex);
427 vector<int>& map = pointMap[pointIndex];
428 return profiles[map[0]][map[1]]->
getData(map[2])->
getLong(attributeIndex);
442 vector<int>& map = pointMap[pointIndex];
443 return profiles[map[0]][map[1]]->
getData(map[2])->
getInt(attributeIndex);
457 vector<int>& map = pointMap[pointIndex];
458 return profiles[map[0]][map[1]]->
getData(map[2])->
getShort(attributeIndex);
472 vector<int>& map = pointMap[pointIndex];
473 return profiles[map[0]][map[1]]->
getData(map[2])->
getByte(attributeIndex);
485 bool isNaN(
int pointIndex,
int attributeIndex)
487 vector<int>& map = pointMap[pointIndex];
488 return profiles[map[0]][map[1]]->
isNaN(map[2], attributeIndex);
501 vector<int>& map = pointMap[pointIndex];
502 const double* vv = grid.
getVertex(map[0]);
503 double r = profiles[map[0]][map[1]]->
getRadius(map[2]);
517 return grid.
getVertex(pointMap[pointIndex][0]);
528 vector<int>& map = pointMap[pointIndex];
529 return profiles[map[0]][map[1]]->
getRadius(map[2]);
540 vector<int>& map = pointMap[pointIndex];
541 return GeoTessUtils::getEarthRadius(
543 - profiles[map[0]][map[1]]->getRadius(map[2]);
555 vector<int>& m1 = pointMap[pointIndex1];
556 vector<int>& m2 = pointMap[pointIndex2];
557 return GeoTessUtils::getDistance3D(grid.
getVertex(m1[0]),
559 profiles[m2[0]][m2[1]]->
getRadius(m2[2]));
596 void getPointNeighbors(set<int>& pointNeighbors,
int pointIndex);
605 return GeoTessUtils::getLatLonString(getPointUnitVector(pointIndex));
616 string frmt =
"%8.3f";
617 sprintf(s, frmt.c_str(), getPointDepth(pointIndex));
618 return GeoTessUtils::getLatLonString(getPointUnitVector(pointIndex))
627 #endif // POINTMAP_OBJECT_H
string toString(int pointIndex)
Retrieve a nicely formated string with lat, lon, depth of the point in degrees and km...
Definition: GeoTessPointMap.h:613
virtual double getDouble(int attributeIndex) const
Retrieve the value of the attribute at the specified attribute index as a double value.
virtual float getFloat(int attributeIndex) const
Retrieve the value of the attribute at the specified attribute index as a float value.
An ordered list of points on the surface of a unit sphere that define a closed polygon.
Definition: GeoTessPolygon.h:111
Relationships between vertices (2D positions in a tessellation), nodes (1D positions along a radial P...
Definition: GeoTessPointMap.h:74
const double * getVertex(int vertex) const
Retrieve the unit vector that corresponds to the specified vertex.
Definition: GeoTessGrid.h:630
bool isNaN(int pointIndex, int attributeIndex)
Return true if the value of the specified attribute at the specified point is NaN.
Definition: GeoTessPointMap.h:485
void setPointData(int pointIndex, GeoTessData *data)
Replace the Data object associated with the specified point.
Definition: GeoTessPointMap.h:340
float getPointValueFloat(int pointIndex, int attributeIndex)
Retrieve the value of the specified attribute at the specified point cast to float if necessary...
Definition: GeoTessPointMap.h:410
int getLayerIndex(int pointIndex)
Retrieve the index of the layer that corresponds to the specified pointIndex.
Definition: GeoTessPointMap.h:261
void getPointVector(int pointIndex, double *v)
Retrieve a vector representation of the specified point (not a unit vector).
Definition: GeoTessPointMap.h:499
Definition: ArrayReuse.h:55
string getPointLatLonString(int pointIndex)
Retrieve nicely formated string with lat, lon of the point in degrees.
Definition: GeoTessPointMap.h:603
bool isPopulated()
Determine whether or not this PointMap is populated.
Definition: GeoTessPointMap.h:215
virtual bool isNaN(int nodeIndex, int attributeIndex)
Return true if the specified Data value is NaN.
double getPointRadius(int pointIndex)
Retrieve the radius of the specified point.
Definition: GeoTessPointMap.h:526
virtual LONG_INT getLong(int attributeIndex) const
Retrieve the value of the attribute at the specified attribute index as a LONG_INT value...
Manages the geometry and topology of one or more multi-level triangular tessellations of a unit spher...
Definition: GeoTessGrid.h:166
int getPointIndexFirst(int vertex, int layer)
Retrieve the pointIndex of the point that corresponds to the first node in profile[vertex][layer].
Definition: GeoTessPointMap.h:332
int getTessId(int pointIndex)
Retrieve the index of the tessellation that corresponds to the specified pointIndex.
Definition: GeoTessPointMap.h:248
int getPointValueInt(int pointIndex, int attributeIndex)
Retrieve the value of the specified attribute at the specified point cast to int if necessary...
Definition: GeoTessPointMap.h:440
virtual GeoTessData ** getData()
Retrieve a shallow copy of the array of Data objects associated with this Profile.
GeoTessData * getPointData(int pointIndex)
Retrieve a reference to the Data object associated with the specified point.
Definition: GeoTessPointMap.h:351
virtual double getValue(const GeoTessInterpolatorType &rInterpType, int attributeIndex, double radius, bool allowRadiusOutOfRange) const
Retrieve the value of the specified attribute interpolated at the specified radius.
void setPointValue(int pointIndex, int attributeIndex, T value)
Set the value of the specified attribute at the specified point to the specified value.
Definition: GeoTessPointMap.h:366
int getVertexIndex(int pointIndex)
Retrieve the index of the vertex that corresponds to the specified pointIndex.
Definition: GeoTessPointMap.h:235
GeoTessPolygon * getPolygon()
Retrieve the pointer to the Polygon or Polygon3D object that supports this PointMap.
Definition: GeoTessPointMap.h:200
void setActiveRegion(const string &polygonFileName)
Populate the PointMap such that nodes located within the specified Polygon are active and all others ...
Definition: GeoTessPointMap.h:187
short getPointValueShort(int pointIndex, int attributeIndex)
Retrieve the value of the specified attribute at the specified point cast to short if necessary...
Definition: GeoTessPointMap.h:455
LONG_INT getPointValueLong(int pointIndex, int attributeIndex)
Retrieve the value of the specified attribute at the specified point cast to LONG_INT if necessary...
Definition: GeoTessPointMap.h:425
int getPointIndex(int vertex, int layer, int node)
Retrieve the pointIndex of the point that corresponds to the specified vertex, layer and node...
Definition: GeoTessPointMap.h:302
const vector< int > & getPointIndices(int pointIndex)
Retrieve a reference to the index map for the specified pointIndex.
Definition: GeoTessPointMap.h:287
virtual byte getByte(int attributeIndex) const
Retrieve the value of the attribute at the specified attribute index as a bute value.
byte getPointValueByte(int pointIndex, int attributeIndex)
Retrieve the value of the specified attribute at the specified point cast to byte if necessary...
Definition: GeoTessPointMap.h:470
#define byte
signed-byte typedef
Definition: CPPGlobals.h:94
virtual int getInt(int attributeIndex) const
Retrieve the value of the attribute at the specified attribute index as a int value.
virtual void setData(int index, GeoTessData *data)
Replace the Data currently associated with this Profile with new Data.
virtual GeoTessData & setValue(int attributeIndex, double v)
Set the value of the specified attributeIndex and return a reference to this Data object...
bool operator!=(const GeoTessPointMap &other)
Overloaded inequality operator.
Definition: GeoTessPointMap.h:145
double getDistance3D(int pointIndex1, int pointIndex2)
Retrieve the straight-line distance between two points in km.
Definition: GeoTessPointMap.h:553
#define LONG_INT
Definition: CPPGlobals.h:111
Abstract class that manages the radii and data values that span a single layer associated with a sing...
Definition: GeoTessProfile.h:96
Abstract base class that manages the data values attached to a single grid point. ...
Definition: GeoTessData.h:75
virtual int getPointIndex(int nodeIndex) const
Get the pointIndex that corresponds to the supplied nodeIndex.
Top level class that manages the GeoTessMetaData, GeoTessGrid and GeoTessData that comprise a 3D Eart...
Definition: GeoTessModel.h:119
double getPointValueDouble(int pointIndex, int attributeIndex)
Retrieve the value of the specified attribute at the specified point cast to double if necessary...
Definition: GeoTessPointMap.h:395
int getPointIndexLast(int vertex, int layer)
Retrieve the pointIndex of the point that corresponds to the last node in profile[vertex][layer].
Definition: GeoTessPointMap.h:317
int size()
Retrieve the number of points supported by this model.
Definition: GeoTessPointMap.h:222
double getPointDepth(int pointIndex)
Retrieve the radius of the specified point.
Definition: GeoTessPointMap.h:538
#define GEOTESS_EXP_IMP
Definition: CPPGlobals.h:71
const double * getPointUnitVector(int pointIndex) const
Retrieve a reference to the unit vector for the specified point.
Definition: GeoTessPointMap.h:515
virtual short getShort(int attributeIndex) const
Retrieve the value of the attribute at the specified attribute index as a short value.
virtual float getRadius(int i) const
Get the i'th radius value in this profile in km.
double getPointValue(int pointIndex, int attributeIndex)
Retrieve the value of the specified attribute at the specified point.
Definition: GeoTessPointMap.h:380
LONG_INT getMemory()
Definition: GeoTessPointMap.h:152
int getNodeIndex(int pointIndex)
Retrieve the index of the node that corresponds to the specified pointIndex.
Definition: GeoTessPointMap.h:274