OSG
3.4.0
|
#include <ElevationSlice.h>
Public Types | |
typedef std::vector< osg::Vec3d > | Vec3dList |
typedef std::pair< double, double > | DistanceHeight |
typedef std::vector < DistanceHeight > | DistanceHeightList |
Public Member Functions | |
ElevationSlice () | |
void | setStartPoint (const osg::Vec3d &startPoint) |
const osg::Vec3d & | getStartPoint () const |
void | setEndPoint (const osg::Vec3d &endPoint) |
const osg::Vec3d & | getEndPoint () const |
const Vec3dList & | getIntersections () const |
const DistanceHeightList & | getDistanceHeightIntersections () const |
void | computeIntersections (osg::Node *scene, osg::Node::NodeMask traversalMask=0xffffffff) |
void | clearDatabaseCache () |
void | setDatabaseCacheReadCallback (DatabaseCacheReadCallback *dcrc) |
DatabaseCacheReadCallback * | getDatabaseCacheReadCallback () |
Static Public Member Functions | |
static Vec3dList | computeElevationSlice (osg::Node *scene, const osg::Vec3d &startPoint, const osg::Vec3d &endPoint, osg::Node::NodeMask traversalMask=0xffffffff) |
Helper class for setting up and acquiring height above terrain intersections with terrain. By default assigns a osgSim::DatabaseCacheReadCallback that enables automatic loading of external PagedLOD tiles to ensure that the highest level of detail is used in intersections. This automatic loading of tiles is done by the intersection traversal that is done within the computeIntersections(..) method, so can result in long intersection times when external tiles have to be loaded. The external loading of tiles can be disabled by removing the read callback, this is done by calling the setDatabaseCacheReadCallback(DatabaseCacheReadCallback*) method with a value of 0.
Definition at line 32 of file ElevationSlice.h.
typedef std::pair<double,double> osgSim::ElevationSlice::DistanceHeight |
Definition at line 57 of file ElevationSlice.h.
typedef std::vector<DistanceHeight> osgSim::ElevationSlice::DistanceHeightList |
Definition at line 58 of file ElevationSlice.h.
typedef std::vector<osg::Vec3d> osgSim::ElevationSlice::Vec3dList |
Definition at line 52 of file ElevationSlice.h.
osgSim::ElevationSlice::ElevationSlice | ( | ) |
|
inline |
Clear the database cache.
Definition at line 75 of file ElevationSlice.h.
|
static |
Compute the vertical distance between the specified scene graph and a single HAT point.
void osgSim::ElevationSlice::computeIntersections | ( | osg::Node * | scene, |
osg::Node::NodeMask | traversalMask = 0xffffffff |
||
) |
Compute the intersections with the specified scene graph, the results are stored in vectors of Vec3d. Note, if the topmost node is a CoordinateSystemNode then the input points are assumed to be geocentric, with the up vector defined by the EllipsoidModel attached to the CoordinateSystemNode. If the topmost node is not a CoordinateSystemNode then a local coordinates frame is assumed, with a local up vector.
|
inline |
Get the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs.
Definition at line 83 of file ElevationSlice.h.
|
inline |
Get the intersections in the form a vector of pair<double,double> representing distance along the slice and height.
Definition at line 61 of file ElevationSlice.h.
|
inline |
Get the end point of the slice.
Definition at line 49 of file ElevationSlice.h.
|
inline |
Get the intersections in the form of a vector of Vec3d.
Definition at line 55 of file ElevationSlice.h.
|
inline |
Get the start point of the slice.
Definition at line 43 of file ElevationSlice.h.
void osgSim::ElevationSlice::setDatabaseCacheReadCallback | ( | DatabaseCacheReadCallback * | dcrc | ) |
Set the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs. Note, if you have multiple LineOfSight or ElevationSlice objects in use at one time then you should share a single DatabaseCacheReadCallback between all of them.
|
inline |
Set the end point of the slice.
Definition at line 46 of file ElevationSlice.h.
|
inline |
Set the start point of the slice.
Definition at line 40 of file ElevationSlice.h.
|
protected |
Definition at line 93 of file ElevationSlice.h.
|
protected |
Definition at line 91 of file ElevationSlice.h.
|
protected |
Definition at line 89 of file ElevationSlice.h.
|
protected |
Definition at line 90 of file ElevationSlice.h.
|
protected |
Definition at line 94 of file ElevationSlice.h.
|
protected |
Definition at line 88 of file ElevationSlice.h.