14 #include <osg/BoundingSphere>
23 #include <osg/BoundingBox>
24 #include <osgEarth/Config>
25 #include <osgEarth/URI>
26 #include <osgEarth/GeoData>
42 const double worldWidth, std::vector<DtTerrainPagingGeometryPtr>& output);
64 const DtVector& min1 ,
const DtVector& max1 ,
65 const DtVector& min2 ,
const DtVector& max2 );
73 const DtVector& lower,
const DtVector& upper);
77 const DtVector& lower,
const DtVector& upper);
92 static std::unique_ptr<IndexInputInterface> Create(
const DtFilename&);
96 virtual bool read(
unsigned& lod,
unsigned& x,
unsigned& y,
double& min,
double& max,
bool& valid) = 0;
112 const osgEarth::Config& cfg)
113 : name(cfg.value<std::string>(
"name",
""))
115 , minTolerance(cfg.value<
double>(
"min_tolerance", 0))
116 , maxTolerance(cfg.value<
double>(
"max_tolerance", 0))
117 , minlod(cfg.value<
unsigned>(
"min_lod", 0))
118 , maxlod(cfg.value<
unsigned>(
"max_lod", tracker.maxLOD()))
119 , extent(tracker.profile()->getExtent())
121 double xmin = extent.xMin();
122 double ymin = extent.yMin();
123 double xmax = extent.xMax();
124 double ymax = extent.yMax();
126 if (tracker.localCS()->getCS_Type() ==
CS_DIS)
128 xmin = cfg.value<
double>(
"min_lon", xmin);
129 ymin = cfg.value<
double>(
"min_lat", ymin);
130 xmax = cfg.value<
double>(
"max_lon", xmax);
131 ymax = cfg.value<
double>(
"max_lat", ymax);
135 xmin = cfg.value<
double>(
"min_x", xmin);
136 ymin = cfg.value<
double>(
"min_y", ymin);
137 xmax = cfg.value<
double>(
"max_x", xmax);
138 ymax = cfg.value<
double>(
"max_y", ymax);
141 extent.set(xmin, ymin, xmax, ymax);
150 , maxlod(tracker.maxLOD())
151 , extent(tracker.mapNode()->getMap()->getProfile()->getExtent())
164 double value = p.
x();
181 return max -
min > width / 2;
185 :
min(std::numeric_limits<
double>::infinity())
186 ,
max(-std::numeric_limits<
double>::infinity())
bool shapeIntersectsAABB(const DtLocalVertexList &shape, const DtVector &lower, const DtVector &upper)
Convert geometry to internal coordinate system.
const double & x() const
Definition: point.h:188
void convertToOsgEarthCoordSys(DtPoint &p, CS_Type cstype)
convert to coordinate system used by osgEarth tiles
DtVrfChordIntersectionRecord represents a list of DtChordIntersectRecords. This is useful for followi...
Definition: vrfChordIntersectRecordList.h:31
double minTolerance
Definition: terrainUtil.h:106
void update(const DtPoint &p)
update min and max values
Definition: terrainUtil.h:162
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
Information about each individual index file.
Definition: terrainUtil.h:101
bool isDefault
Definition: terrainUtil.h:105
bool doubleEqual(double d1, double d2)
Convert geometry to internal coordinate system.
Definition: coordSystem.h:54
DtSphere boundingSphere2DtSphere(const osg::BoundingSphere &boundingSphere)
std::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
osgEarth::URI file
Definition: terrainUtil.h:104
code for checking if a geometry wraps around the borders of the world map
Definition: terrainUtil.h:157
void unwrap(double width, DtLocalVertexList &list, std::vector< DtTerrainPagingGeometryPtr > &output)
unwrap moves points lower one world width if they are on the upper half side of the world this is so ...
Definition: coordSystem.h:40
DtVrfChordIntersectionRecord * insertRecordAlongChord(const DtVrfChordIntersectionRecord &record, DtVrfChordIntersectRecordList &intList)
inserts points inter intersection record list checks each point against the one before and after and ...
bool wrapsAround(double width) const
check is points analyzed so far indicate shape wraps around the world
Definition: terrainUtil.h:178
std::string name
Definition: terrainUtil.h:103
osgEarth::GeoExtent extent
Definition: terrainUtil.h:108
Definition: vrfChordIntersectionRecord.h:19
CS_Type
Definition: coordSystem.h:35
void convertFromOsgEarthCoordSys(DtPoint &p, CS_Type cstype)
convert from coordinate system used by osgEarth tiles
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
double min
Definition: terrainUtil.h:159
void convertGeometry(const DtTerrainPagingGeometryPtr &geometry, const Coordinate_System *CS, const double worldWidth, std::vector< DtTerrainPagingGeometryPtr > &output)
Convert geometry to internal coordinate system.
unsigned minlod
Definition: terrainUtil.h:107
IndexConfig(const T &tracker, const osgEarth::Config &cfg)
Definition: terrainUtil.h:110
bool extentIntersectsAABB(const DtVector &min1, const DtVector &max1, const DtVector &min2, const DtVector &max2)
TODO ALL functions below should be inline.
class DtLocalVertexList:
Definition: localVertexList.h:20
bool pointIntersectsAABB(const DtVector &p, const DtVector &lower, const DtVector &upper)
Convert geometry to internal coordinate system.
MinMaxInfo()
Definition: terrainUtil.h:184
DtExtent sphereExtent(const DtSphere &sphere)
Convert geometry to internal coordinate system.
bool boundariesOverlap(double min1, double max1, double min2, double max2)
Convert geometry to internal coordinate system.
DtExtent boundingBox2DtExtent(const osg::BoundingBoxd &boundingBox)
IndexConfig(const T &tracker)
Definition: terrainUtil.h:144
double max
Definition: terrainUtil.h:159