VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TXPNode.h
Go to the documentation of this file.
1 /***************************************************************************
3  * December 2003
4  *
5  * This TerraPage loader was re-written in a fashion to use PagedLOD
6  * to manage paging entirely, also includes a version of Terrex's smart mesh
7  * adapted to work with PagedLOD. The essential code by Boris Bralo is still present,
8  * slight modified.
9  * nick at terrex dot com
10  *
11  * Ported to PagedLOD technology by Trajce Nikolov (Nick) & Robert Osfield
12  *****************************************************************************/
13 
14 /***************************************************************************
15  * OpenSceneGraph loader for Terrapage format database
16  * by Boris Bralo 2002
17  *
18  * based on/modifed sgl (Scene Graph Library) loader by Bryan Walsh
19  *
20  * This loader is based on/modified from Terrain Experts Performer Loader,
21  * and was ported to SGL by Bryan Walsh / bryanw at earthlink dot net
22  *
23  * That loader is redistributed under the terms listed on Terrain Experts
24  * website (www.terrex.com/www/pages/technology/technologypage.htm)
25  *
26  * "TerraPage is provided as an Open Source format for use by anyone...
27  * We supply the TerraPage C++ source code free of charge. Anyone
28  * can use it and redistribute it as needed (including our competitors).
29  * We do, however, ask that you keep the TERREX copyrights intact."
30  *
31  * Copyright Terrain Experts Inc. 1999.
32  * All Rights Reserved.
33  *
34  *****************************************************************************/
35 #ifndef __TXPNODE_H_
36 #define __TXPNODE_H_
37 
38 #include <osg/Group>
39 #include <osg/NodeVisitor>
40 #include <osg/NodeCallback>
41 #include <osg/Referenced>
42 #include <osg/ref_ptr>
43 
47 
48 namespace txp
49 {
50 
51 class DT_DLL_osgdb_vrftxp TXPNode : public osg::Group
52 {
53 public:
54 
55  TXPNode();
56 
58  TXPNode(const TXPNode&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
59 
60  META_Node(txp, TXPNode);
61 
62  virtual void traverse(osg::NodeVisitor& nv) override;
63 
64  void setArchiveName(const std::string& archiveName);
65  void setOptions(const std::string& options);
66 
67  const std::string& getOptions() const;
68  const std::string& getArchiveName() const;
69 
70  std::vector<trpgManagedTile*> tilesToLoadFromLocation(const osg::Vec3d& dbLocation);
71 
72  //modified by Brad Anderegg on May-27-08
73  //because the TXPArchives are kept in an std::map and referenced later
74  //we do not want to create a new one, so we pass it in.
75  //If NULL is passed into loadArchive it will do the same thing it used to.
76  bool loadArchive(TXPArchive*);
77 
78  TXPArchive* getArchive() { return _archive.get(); }
79  TXPPageManager* getPageManager() { return _pageManager.get(); };
80 
81  void setArchive( TXPArchive* archive )
82  {
83  _archive = archive;
84  }
85 
86  virtual osg::BoundingSphere computeBound() const override;
87 
88 protected:
89 
90  virtual ~TXPNode() override;
91 
92  void updateEye(osg::NodeVisitor& nv);
93  void updateSceneGraph();
94 
96  osg::Node* addPagedLODTile(int x, int y);
97 
98  std::string _archiveName;
99  std::string _options;
100 
102 
105 
106  double _originX;
107  double _originY;
108  osg::BoundingBox _extents;
109 
110  std::vector<osg::Node*> _nodesToAdd;
111  std::vector<osg::Node*> _nodesToRemove;
112 
113 };
114 
115 
116 }
117 
118 #endif
Definition: TXPArchive.h:65
#define DT_DLL_osgdb_vrftxp
Contains DLL export macros.
Definition: osgdb_vrftxpDefines.h:25
Definition: featureContext.h:36
osg::ref_ptr< TXPArchive > _archive
Definition: TXPNode.h:103
OpenThreads::Mutex _mutex
Definition: TXPNode.h:101
double _originY
Definition: TXPNode.h:107
std::vector< osg::Node * > _nodesToAdd
Definition: TXPNode.h:110
TXPPageManager * getPageManager()
Definition: TXPNode.h:79
double _originX
Definition: TXPNode.h:106
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
TXPArchive * getArchive()
Definition: TXPNode.h:78
std::vector< osg::Node * > _nodesToRemove
Definition: TXPNode.h:111
osg::BoundingBox _extents
Definition: TXPNode.h:108
osg::ref_ptr< TXPPageManager > _pageManager
Definition: TXPNode.h:104
Definition: TXPPageManager.h:45
Definition: TXPNode.h:51
std::string _archiveName
Definition: TXPNode.h:98
std::string _options
Definition: TXPNode.h:99
void setArchive(TXPArchive *archive)
Definition: TXPNode.h:81

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)