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/ref_ptr>
42 
46 
47 namespace txp
48 {
49 
50 class DT_DLL_osgdb_vrftxp TXPNode : public osg::Group
51 {
52 public:
53 
54  TXPNode();
55 
57  TXPNode(const TXPNode&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
58 
59  META_Node(txp, TXPNode);
60 
61  virtual void traverse(osg::NodeVisitor& nv);
62 
63  void setArchiveName(const std::string& archiveName);
64  void setOptions(const std::string& options);
65 
66  const std::string& getOptions() const;
67  const std::string& getArchiveName() const;
68 
69  std::vector<trpgManagedTile*> tilesToLoadFromLocation(const osg::Vec3d& dbLocation);
70 
71  //modified by Brad Anderegg on May-27-08
72  //because the TXPArchives are kept in an std::map and referenced later
73  //we do not want to create a new one, so we pass it in.
74  //If NULL is passed into loadArchive it will do the same thing it used to.
75  bool loadArchive(TXPArchive*);
76 
77  TXPArchive* getArchive() { return _archive.get(); }
78  TXPPageManager* getPageManager() { return _pageManager.get(); };
79 
80  void setArchive( TXPArchive* archive )
81  {
82  _archive = archive;
83  }
84 
85  virtual osg::BoundingSphere computeBound() const;
86 
87 protected:
88 
89  virtual ~TXPNode();
90 
91  void updateEye(osg::NodeVisitor& nv);
92  void updateSceneGraph();
93 
95  osg::Node* addPagedLODTile(int x, int y);
96 
97  std::string _archiveName;
98  std::string _options;
99 
101 
104 
105  double _originX;
106  double _originY;
107  osg::BoundingBox _extents;
108 
109  std::vector<osg::Node*> _nodesToAdd;
110  std::vector<osg::Node*> _nodesToRemove;
111 
112 };
113 
114 
115 }
116 
117 #endif
Definition: TXPArchive.h:65
#define DT_DLL_osgdb_vrftxp
Contains DLL export macros.
Definition: osgdb_vrftxpDefines.h:25
Definition: featureContext.h:37
osg::ref_ptr< TXPArchive > _archive
Definition: TXPNode.h:102
OpenThreads::Mutex _mutex
Definition: TXPNode.h:100
double _originY
Definition: TXPNode.h:106
std::vector< osg::Node * > _nodesToAdd
Definition: TXPNode.h:109
TXPPageManager * getPageManager()
Definition: TXPNode.h:78
double _originX
Definition: TXPNode.h:105
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
TXPArchive * getArchive()
Definition: TXPNode.h:77
std::vector< osg::Node * > _nodesToRemove
Definition: TXPNode.h:110
osg::BoundingBox _extents
Definition: TXPNode.h:107
osg::ref_ptr< TXPPageManager > _pageManager
Definition: TXPNode.h:103
Definition: TXPPageManager.h:45
Definition: TXPNode.h:50
std::string _archiveName
Definition: TXPNode.h:97
std::string _options
Definition: TXPNode.h:98
void setArchive(TXPArchive *archive)
Definition: TXPNode.h:80

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)