Ignore:
Timestamp:
Jul 19, 2011, 9:47:13 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/include/util/terrainQuery.h

    r300 r305  
    1515*/
    1616
    17 #ifndef OSGSIM_HEIGHTABOVETERRAIN
    18 #define OSGSIM_HEIGHTABOVETERRAIN 1
     17#ifndef osgVisual_HEIGHTABOVETERRAIN
     18#define osgVisual_HEIGHTABOVETERRAIN 1
    1919
    2020#include <osgUtil/IntersectionVisitor>
     
    2323#include <osgSim/LineOfSight>
    2424
    25 namespace osgSim {
     25namespace osgVisual {
    2626
    2727/** Helper class for setting up and acquiring height above terrain intersections with terrain.
    28   * By default assigns a osgSim::DatabaseCacheReadCallback that enables automatic loading
     28  * By default assigns a osgVisual::DatabaseCacheReadCallback that enables automatic loading
    2929  * of external PagedLOD tiles to ensure that the highest level of detail is used in intersections.
    3030  * This automatic loading of tiles is done by the intersection traversal that is done within
     
    3333  * The external loading of tiles can be disabled by removing the read callback, this is done by
    3434  * calling the setDatabaseCacheReadCallback(DatabaseCacheReadCallback*) method with a value of 0.*/
    35 class OSGSIM_EXPORT HeightAboveTerrain
     35class terrainQuery
    3636{
    3737    public :
    3838
     39                enum DataSource
     40                {
     41                        LOADED_SCENE,
     42                        PAGE_HIGHEST_LOD
     43                       
     44                };
    3945   
    40         HeightAboveTerrain(bool loadHighestLOD = true);
     46        terrainQuery();
    4147       
    4248   
     
    8187
    8288        /** Compute the vertical distance between the specified scene graph and a single HAT point. */
    83         static double computeHeightAboveTerrain(osg::Node* scene, const osg::Vec3d& point, bool loadHighestLOD = true, osg::Node::NodeMask traversalMask=0xffffffff);
     89        static double computeHeightAboveTerrain(osg::Node* scene, const osg::Vec3d& point, DataSource pagingBehaviour, osg::Node::NodeMask traversalMask=0xffffffff);
    8490       
    8591                /** Compute the vertical position of the scene at a single HOT point. */
    86         static double computeHeightOfTerrain(osg::Node* scene, const osg::Vec3d& point, bool loadHighestLOD = true, osg::Node::NodeMask traversalMask=0xffffffff);
     92        static double computeHeightOfTerrain(osg::Node* scene, const osg::Vec3d& point, DataSource pagingBehaviour, osg::Node::NodeMask traversalMask=0xffffffff);
    8793
    8894       
     
    9399          * Note, if you have multiple LineOfSight or HeightAboveTerrain objects in use at one time then you should share a single
    94100          * DatabaseCacheReadCallback between all of them. */
    95         void setDatabaseCacheReadCallback(DatabaseCacheReadCallback* dcrc);
     101                void setDatabaseCacheReadCallback(osgSim::DatabaseCacheReadCallback* dcrc);
    96102
    97103        /** Get the ReadCallback that does the reading of external PagedLOD models, and caching of loaded subgraphs.*/
    98         DatabaseCacheReadCallback* getDatabaseCacheReadCallback() { return _dcrc.get(); }
     104                osgSim::DatabaseCacheReadCallback* getDatabaseCacheReadCallback() { return _dcrc.get(); }
    99105       
    100106    protected :
     
    118124        HATList                                 _HATList;
    119125
    120        
    121         osg::ref_ptr<DatabaseCacheReadCallback> _dcrc;
     126                osg::ref_ptr<osgSim::DatabaseCacheReadCallback> _dcrc;
    122127        osgUtil::IntersectionVisitor            _intersectionVisitor;
    123128
Note: See TracChangeset for help on using the changeset viewer.