OpenSceneGraph 3.6.5
ElevationSlice
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGSIM_ELEVATIONSLICE
15#define OSGSIM_ELEVATIONSLICE 1
16
18
19// include so we can get access to the DatabaseCacheReadCallback
20#include <osgSim/LineOfSight>
21
22namespace osgSim {
23
33{
34 public :
35
36
38
40 void setStartPoint(const osg::Vec3d& startPoint) { _startPoint = startPoint; }
41
43 const osg::Vec3d& getStartPoint() const { return _startPoint; }
44
46 void setEndPoint(const osg::Vec3d& endPoint) { _endPoint = endPoint; }
47
49 const osg::Vec3d& getEndPoint() const { return _endPoint; }
50
51
52 typedef std::vector<osg::Vec3d> Vec3dList;
53
55 const Vec3dList& getIntersections() const { return _intersections; }
56
57 typedef std::pair<double,double> DistanceHeight;
58 typedef std::vector<DistanceHeight> DistanceHeightList;
59
62
63
68 void computeIntersections(osg::Node* scene, osg::Node::NodeMask traversalMask=0xffffffff);
69
71 static Vec3dList computeElevationSlice(osg::Node* scene, const osg::Vec3d& startPoint, const osg::Vec3d& endPoint, osg::Node::NodeMask traversalMask=0xffffffff);
72
73
75 void clearDatabaseCache() { if (_dcrc.valid()) _dcrc->clearDatabaseCache(); }
76
81
84
85 protected :
86
87
92
95
96
97};
98
99}
100
101#endif
The osgSim library is a NodeKit that extends the core scene graph to support nodes and drawables that...
Definition BlinkSequence:27
Base class for all internal nodes in the scene graph.
Definition Node:72
unsigned int NodeMask
This is a set of bits (flags) that represent the Node.
Definition Node:363
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
DistanceHeightList _distanceHeightIntersections
Definition ElevationSlice:91
osg::ref_ptr< DatabaseCacheReadCallback > _dcrc
Definition ElevationSlice:93
void setDatabaseCacheReadCallback(DatabaseCacheReadCallback *dcrc)
Set the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgrap...
void setStartPoint(const osg::Vec3d &startPoint)
Set the start point of the slice.
Definition ElevationSlice:40
std::vector< osg::Vec3d > Vec3dList
Definition ElevationSlice:52
std::pair< double, double > DistanceHeight
Definition ElevationSlice:57
void setEndPoint(const osg::Vec3d &endPoint)
Set the end point of the slice.
Definition ElevationSlice:46
DatabaseCacheReadCallback * getDatabaseCacheReadCallback()
Get the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgrap...
Definition ElevationSlice:83
osg::Vec3d _startPoint
Definition ElevationSlice:88
const Vec3dList & getIntersections() const
Get the intersections in the form of a vector of Vec3d.
Definition ElevationSlice:55
void clearDatabaseCache()
Clear the database cache.
Definition ElevationSlice:75
const DistanceHeightList & getDistanceHeightIntersections() const
Get the intersections in the form a vector of pair<double,double> representing distance along the sli...
Definition ElevationSlice:61
Vec3dList _intersections
Definition ElevationSlice:90
const osg::Vec3d & getStartPoint() const
Get the start point of the slice.
Definition ElevationSlice:43
const osg::Vec3d & getEndPoint() const
Get the end point of the slice.
Definition ElevationSlice:49
static Vec3dList computeElevationSlice(osg::Node *scene, const osg::Vec3d &startPoint, const osg::Vec3d &endPoint, osg::Node::NodeMask traversalMask=0xffffffff)
Compute the vertical distance between the specified scene graph and a single HAT point.
osg::Vec3d _endPoint
Definition ElevationSlice:89
osgUtil::IntersectionVisitor _intersectionVisitor
Definition ElevationSlice:94
void 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.
std::vector< DistanceHeight > DistanceHeightList
Definition ElevationSlice:58
Definition LineOfSight:24
IntersectionVisitor is used to testing for intersections with the scene, traversing the scene using g...
Definition IntersectionVisitor:152
#define OSGSIM_EXPORT
Definition Export:38

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.