Changeset 13041 for OpenSceneGraph/trunk/include/osgSim/ElevationSlice
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgSim/ElevationSlice
r12701 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 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 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 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 34 34 public : 35 35 36 36 37 37 ElevationSlice(); 38 39 /** Set the start point of the slice.*/ 38 39 /** Set the start point of the slice.*/ 40 40 void setStartPoint(const osg::Vec3d& startPoint) { _startPoint = startPoint; } 41 41 42 /** Get the start point of the slice.*/ 42 /** Get the start point of the slice.*/ 43 43 const osg::Vec3d& getStartPoint() const { return _startPoint; } 44 45 /** Set the end point of the slice.*/ 44 45 /** Set the end point of the slice.*/ 46 46 void setEndPoint(const osg::Vec3d& endPoint) { _endPoint = endPoint; } 47 47 48 /** Get the end point of the slice.*/ 48 /** Get the end point of the slice.*/ 49 49 const osg::Vec3d& getEndPoint() const { return _endPoint; } 50 50 51 51 52 52 typedef std::vector<osg::Vec3d> Vec3dList; 53 53 54 54 /** Get the intersections in the form of a vector of Vec3d. */ 55 55 const Vec3dList& getIntersections() const { return _intersections; } … … 57 57 typedef std::pair<double,double> DistanceHeight; 58 58 typedef std::vector<DistanceHeight> DistanceHeightList; 59 59 60 60 /** Get the intersections in the form a vector of pair<double,double> representing distance along the slice and height. */ 61 61 const DistanceHeightList& getDistanceHeightIntersections() const { return _distanceHeightIntersections; } 62 63 62 63 64 64 /** Compute the intersections with the specified scene graph, the results are stored in vectors of Vec3d. 65 65 * Note, if the topmost node is a CoordinateSystemNode then the input points are assumed to be geocentric, … … 70 70 /** Compute the vertical distance between the specified scene graph and a single HAT point.*/ 71 71 static Vec3dList computeElevationSlice(osg::Node* scene, const osg::Vec3d& startPoint, const osg::Vec3d& endPoint, osg::Node::NodeMask traversalMask=0xffffffff); 72 73 72 73 74 74 /** Clear the database cache.*/ 75 75 void clearDatabaseCache() { if (_dcrc.valid()) _dcrc->clearDatabaseCache(); } … … 84 84 85 85 protected : 86 87 86 87 88 88 osg::Vec3d _startPoint; 89 89 osg::Vec3d _endPoint; 90 90 Vec3dList _intersections; 91 91 DistanceHeightList _distanceHeightIntersections; 92 92 93 93 osg::ref_ptr<DatabaseCacheReadCallback> _dcrc; 94 94 osgUtil::IntersectionVisitor _intersectionVisitor;
