GeoTessCPP 2.6.1 Software to facilitate storage and retrieval of 3D information about the Earth.

Loading...
Searching...
No Matches
GeoTessPositionNaturalNeighbor.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 GEOTESSPOSITIONNATURALNEIGHBOR_OBJECT_H
37#define GEOTESSPOSITIONNATURALNEIGHBOR_OBJECT_H
38
39// **** _SYSTEM INCLUDES_ ******************************************************
40
41#include <iostream>
42#include <string>
43#include <fstream>
44#include <vector>
45
46// use standard library objects
47 using namespace std;
48
49// **** _LOCAL INCLUDES_ *******************************************************
50
51#include "CPPUtils.h"
52#include "GeoTessUtils.h"
53#include "GeoTessPosition.h"
54#include "GeoTessInterpolatorType.h"
55#include "ArrayReuse.h"
56
57// **** _BEGIN GEOTESS NAMESPACE_ **********************************************
58
59 namespace geotess {
60
61// **** _FORWARD REFERENCES_ ***************************************************
62
63 class GeoTessModel;
64 class GeoTessProfile;
65
66// **** _CLASS DEFINITION_ *****************************************************
67
93 class GEOTESS_EXP_IMP GeoTessPositionNaturalNeighbor: public GeoTessPosition {
94
95 private:
96
97 vector<bool> marked;
98 vector<int> nnTriangles;
99 vector<Edge*> edges;
100
104 double const* const* gridVrtcs;
105
106 bool isNNTriangle(const int& t)
107 {
108 const double* center = grid.getCircumCenter(t);
109 // if the distance from the interpolation point to the
110 // circumcenter is less than the radius of the circumcircle
111 return GeoTessUtils::dot(center, unitVector) > center[3];
112 //GeoTessUtils::dot(center, grid.getTriangleVertex(triangle, 0));
113
114 }
115
116
117 protected:
118
128 virtual void update2D(int tid);
129
130 public:
131
135 GeoTessPositionNaturalNeighbor(GeoTessModel* model,
136 const GeoTessInterpolatorType& radialType);
137
141 virtual ~GeoTessPositionNaturalNeighbor();
142
147 virtual const GeoTessInterpolatorType& getInterpolatorType() const {
148 return GeoTessInterpolatorType::NATURAL_NEIGHBOR;
149 }
150
151 virtual long getMemory()
152 {
153 return (long)sizeof(GeoTessPositionNaturalNeighbor) + memory()
154 + (long)(marked.capacity() * sizeof(bool) + nnTriangles.capacity() * sizeof(int)
155 + edges.capacity() * sizeof(Edge*));
156 }
157
158};
159// end class GeoTessModelNaturalNeighbor
160
161}// end namespace geotess
162
163#endif // GEOTESSPOSITIONNATURALNEIGHBOR_OBJECT_H
ArrayReuse.h
GEOTESS_EXP_IMP
#define GEOTESS_EXP_IMP
Definition CPPGlobals.h:71
CPPUtils.h
GeoTessInterpolatorType.h
GeoTessPosition.h
GeoTessUtils.h
geotess::GeoTessInterpolatorType
Enumeration of the interpolation algorithms supported by GeoTess including LINEAR,...
Definition GeoTessInterpolatorType.h:72
geotess::GeoTessInterpolatorType::NATURAL_NEIGHBOR
static const GeoTessInterpolatorType NATURAL_NEIGHBOR
Definition GeoTessInterpolatorType.h:128
geotess::GeoTessModel
Top level class that manages the GeoTessMetaData, GeoTessGrid and GeoTessData that comprise a 3D Eart...
Definition GeoTessModel.h:120
geotess::GeoTessPosition
Information about an interpolated point at an arbitrary position in a model.
Definition GeoTessPosition.h:102
geotess::GeoTessPositionNaturalNeighbor::~GeoTessPositionNaturalNeighbor
virtual ~GeoTessPositionNaturalNeighbor()
geotess::GeoTessPositionNaturalNeighbor::getMemory
virtual long getMemory()
Definition GeoTessPositionNaturalNeighbor.h:151
geotess::GeoTessPositionNaturalNeighbor::getInterpolatorType
virtual const GeoTessInterpolatorType & getInterpolatorType() const
Definition GeoTessPositionNaturalNeighbor.h:147
geotess::GeoTessPositionNaturalNeighbor::update2D
virtual void update2D(int tid)
geotess::GeoTessPositionNaturalNeighbor::GeoTessPositionNaturalNeighbor
GeoTessPositionNaturalNeighbor(GeoTessModel *model, const GeoTessInterpolatorType &radialType)
geotess::GeoTessProfile
Abstract class that manages the radii and data values that span a single layer associated with a sing...
Definition GeoTessProfile.h:97
geotess::GeoTessUtils::dot
static double dot(const double *const v0, const double *const v1)
Definition GeoTessUtils.h:134
geotess
Definition ArrayReuse.h:55
geotess::Edge
Stores information about the connection between two adjacent vertices which separates two neighboring...
Definition GeoTessGrid.h:102