16 #include <osg/NodeVisitor>
17 #include <osg/ref_ptr>
19 #include <osg/LightSource>
20 #include <osgEarth/PagedNode>
26 #include <unordered_set>
44 virtual void apply(osg::Node& node);
47 virtual const bool encounteredPagedNode2()
const;
61 , myTmpTop(myStack.top())
67 myStack.push(myTmpTop);
69 std::stack <osg::ref_ptr<osg::Node> >&
myStack;
80 bool isFullyLoaded()
const;
81 void apply(osg::Node& node);
82 void apply(osgEarth::PagedNode2& pagedNode);
84 void apply(osg::PagedLOD& node);
85 void apply(osg::LightSource& ls);
89 size_t count() {
return myCount; }
93 myNodePathHint = hint;
118 void apply(osg::Node& node);
119 void apply(osgEarth::PagedNode2& pagedNode);
120 void apply(osg::Drawable& drawable);
122 void apply(osg::PagedLOD& node);
123 void apply(osg::LightSource& ls);
133 verts =
new osg::Vec3Array();
135 #if OSG_VERSION_LESS_THAN(3,5,6)
136 inline void operator () (
const osg::Vec3& v1,
const osg::Vec3& v2,
const osg::Vec3& v3,
bool treatVertexDataAsTemporary)
138 inline void operator () (
const osg::Vec3& v1,
const osg::Vec3& v2,
const osg::Vec3& v3)
141 verts->push_back(v1);
142 verts->push_back(v2);
143 verts->push_back(v3);
148 inline void pushPagedNode2(osgEarth::PagedNode2& pagedNode2) { myPagedNode2Stack.push_back(&pagedNode2); }
166 void apply(osg::Node& node);
186 void apply(osg::Node& node);
187 void apply(osgEarth::PagedNode2& pagedNode);
188 void apply(osg::LightSource& ls);
211 void apply(osg::Node& node);
212 void apply(osgEarth::PagedNode2& pagedNode);
218 return myNodesTraveledInReverse;
228 size_t getDrawableHash(
const osg::Drawable& drawable,
const osg::Matrix& matrix);
DtBoost::shared_ptr< DtNodeBoundingInfo > DtNodeBoundingInfoPtr
Definition: boundingNodeInfo.h:85
boost::unordered_map< DtNodeId, DtPagedInExtendInfo > DtNodeBoundingExtendedInfoMap
Definition: boundingNodeInfo.h:131
const NodePagingRecordMap & myPagedInNodes
Holds all the nodes which have been paged in.
Definition: pagedNode2Visitors.h:196
bool addToPagedOutVolumesList(DtNodeBoundingInfoPtr pagedOutArea)
DtBoost::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
osg::ref_ptr< osg::Vec3Array > verts
Definition: pagedNode2Visitors.h:145
bool myPagedNode2encountered
Definition: pagedNode2Visitors.h:174
void setNodePathHint(const std::stack< osg::ref_ptr< osg::Node > > &hint)
Definition: pagedNode2Visitors.h:91
osg::ref_ptr< osg::Node > myTmpTop
Definition: pagedNode2Visitors.h:70
size_t getDrawableHash(const osg::Drawable &drawable, const osg::Matrix &matrix)
Return a unique ID for a drawable and it's matrix.
Visitor that tracks whether any part of the terrain contain a pagedNode2.
Definition: pagedNode2Visitors.h:36
Visitor that collect the triangles once pagedNode2 data are loaded in the intersecting area...
Definition: pagedNode2Visitors.h:112
std::stack< osg::ref_ptr< osg::Node > > myNodePathHint
Definition: pagedNode2Visitors.h:105
std::vector< osg::Matrix > MatrixStack
Definition: pagedNode2Visitors.h:32
structure to retrieve the triangles
Definition: pagedNode2Visitors.h:129
std::unordered_map< std::string, NodePagingRecord > NodePagingRecordMap
Definition: vantageTerrainImplementationUtil.h:102
Visitor that load all the pagedNode2 data that intersecting with an area.
Definition: pagedNode2Visitors.h:75
std::unordered_map< std::string, DtNodeBoundingInfoPtr > myPagedOutBoundingListIndex
This is an indexed version of myPagedOutBoundingList (from parent class) so that it is quicker to loo...
Definition: pagedNode2Visitors.h:203
std::set< osg::Node * > _traversedNodes
Definition: pagedNode2Visitors.h:199
DrawableMap & myNewDrawable
Definition: pagedNode2Visitors.h:154
size_t myCount
Definition: pagedNode2Visitors.h:106
DtScopedNodeStackPoopPusher(std::stack< osg::ref_ptr< osg::Node > > &stack)
Definition: pagedNode2Visitors.h:59
PagedNode2Stack myPagedNode2Stack
Definition: pagedNode2Visitors.h:152
std::set< std::string > myLoadingList
Definition: pagedNode2Visitors.h:104
const DrawableList & myExistingDrawable
Definition: pagedNode2Visitors.h:153
Subclass of DtPageInVisitor which pages in only nodes that fall along a particular geometry...
Definition: pageInVisitor.h:104
Definition: coordSystem.h:54
std::vector< DtNodeId > PagedNode2Stack
Definition: pagedNode2Visitors.h:151
DtNodeBoundingExtendedInfoMap & myPagedInBoundingMap
Definition: pagedNode2Visitors.h:155
const NodePagingRecordMap & myPagedInNodes
Definition: pagedNode2Visitors.h:156
Visitor class used to find the active paged of a OSG scene graph.
Definition: boundingVolumeTerrainSourcePager.h:48
std::set< osg::ref_ptr< osgEarth::PagingManager > > myPagingManagers
Definition: pagedNode2Visitors.h:102
std::map< size_t, DrawableInfo > DrawableMap
Definition: vantageTerrainImplementationUtil.h:84
Visitor that unload a pageNode2.
Definition: pagedNode2Visitors.h:161
NodePagingRecordMap & myPagedNode2OutNodes
Definition: pagedNode2Visitors.h:197
bool myFullyLoaded
Fully loaded is initially set to true then when traversing the scene graph it will check if all inter...
Definition: pagedNode2Visitors.h:101
void popPagedNode2()
Definition: pagedNode2Visitors.h:149
CollectTriangles()
Definition: pagedNode2Visitors.h:131
void pushPagedNode2(osgEarth::PagedNode2 &pagedNode2)
Definition: pagedNode2Visitors.h:148
Definition: boundingNodeInfo.h:19
osg::ref_ptr< osg::Node > myPagedNode2ToUnload
Definition: pagedNode2Visitors.h:172
A DtChord is a finite line segment in 3-space, represented by two points. Data derived from the two e...
std::set< osg::ref_ptr< osgEarth::PagingManager > > myPagingManagers
Definition: pagedNode2Visitors.h:222
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
std::stack< osg::ref_ptr< osg::Node > > & myStack
Definition: pagedNode2Visitors.h:69
std::stack< osg::ref_ptr< osg::Node > > myNodesTraveledInReverse
Definition: pagedNode2Visitors.h:223
Definition: pagedNode2Visitors.h:56
virtual ~DtScopedNodeStackPoopPusher()
Definition: pagedNode2Visitors.h:65
virtual void apply(osg::Transform &node)
bool myEncounteredPagedNode2
Whether or not the visitor has yet encountered a pagedNode2 node.
Definition: pagedNode2Visitors.h:52
size_t count()
Definition: pagedNode2Visitors.h:89
std::set< size_t > DrawableList
Definition: vantageTerrainImplementationUtil.h:83
const NodePagingRecordMap & myEmptyPagedInNodes
Definition: pagedNode2Visitors.h:198
Visitor that check loaded (active page in/out bounding sphere) pagedNode2.
Definition: pagedNode2Visitors.h:180
int _level
Definition: pagedNode2Visitors.h:200
Definition: pagedNode2Visitors.h:206
bool myEndTraversal
Definition: pagedNode2Visitors.h:173
const std::stack< osg::ref_ptr< osg::Node > > & nodesTraveled() const
Definition: pagedNode2Visitors.h:216
virtual void apply(osg::LOD &node)
std::set< osg::ref_ptr< osgEarth::PagingManager > > myPagingManagers
Definition: pagedNode2Visitors.h:175