16 #include <osg/NodeVisitor>
17 #include <osg/Referenced>
18 #include <osg/ref_ptr>
20 #include <osg/LightSource>
21 #include <osgEarth/PagedNode>
27 #include <unordered_set>
45 virtual void apply(osg::Node& node)
override;
48 virtual const bool encounteredPagedNode2()
const;
62 , myTmpTop(myStack.top())
68 myStack.push(myTmpTop);
70 std::stack <osg::ref_ptr<osg::Node> >&
myStack;
81 bool isFullyLoaded()
const;
82 virtual void apply(osg::Node& node)
override;
83 void apply(osgEarth::PagedNode2& pagedNode);
85 virtual void apply(osg::PagedLOD& node)
override;
86 virtual void apply(osg::LightSource& ls)
override;
89 virtual void reset()
override;
90 size_t count() {
return myCount; }
94 myNodePathHint = hint;
120 virtual void apply(osg::Node& node)
override;
121 void apply(osgEarth::PagedNode2& pagedNode);
122 virtual void apply(osg::Drawable& drawable)
override;
124 virtual void apply(osg::PagedLOD& node)
override;
125 virtual void apply(osg::LightSource& ls)
override;
135 verts =
new osg::Vec3Array();
137 #if OSG_VERSION_LESS_THAN(3,5,6)
138 inline void operator () (
const osg::Vec3& v1,
const osg::Vec3& v2,
const osg::Vec3& v3,
bool treatVertexDataAsTemporary)
140 inline void operator () (
const osg::Vec3& v1,
const osg::Vec3& v2,
const osg::Vec3& v3)
143 verts->push_back(v1);
144 verts->push_back(v2);
145 verts->push_back(v3);
150 inline void pushPagedNode2(osgEarth::PagedNode2& pagedNode2) { myPagedNode2Stack.push_back(&pagedNode2); }
168 virtual void apply(osg::Node& node)
override;
189 virtual void apply(osg::Node& node)
override;
190 void apply(osgEarth::PagedNode2& pagedNode);
191 virtual void apply(osg::LightSource& ls)
override;
214 virtual void apply(osg::Node& node)
override;
215 void apply(osgEarth::PagedNode2& pagedNode);
221 return myNodesTraveledInReverse;
231 size_t getDrawableHash(
const osg::Drawable& drawable,
const osg::Matrix& matrix);
boost::unordered_map< DtNodeId, DtPagedInExtendInfo > DtNodeBoundingExtendedInfoMap
Definition: boundingNodeInfo.h:140
const NodePagingRecordMap & myPagedInNodes
Holds all the nodes which have been paged in.
Definition: pagedNode2Visitors.h:199
bool addToPagedOutVolumesList(DtNodeBoundingInfoPtr pagedOutArea)
osg::ref_ptr< osg::Vec3Array > verts
Definition: pagedNode2Visitors.h:147
virtual void apply(osg::Transform &node) override
bool myPagedNode2encountered
Definition: pagedNode2Visitors.h:176
void setNodePathHint(const std::stack< osg::ref_ptr< osg::Node > > &hint)
Definition: pagedNode2Visitors.h:92
osg::ref_ptr< osg::Node > myTmpTop
Definition: pagedNode2Visitors.h:71
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:37
Visitor that collect the triangles once pagedNode2 data are loaded in the intersecting area...
Definition: pagedNode2Visitors.h:113
std::stack< osg::ref_ptr< osg::Node > > myNodePathHint
Definition: pagedNode2Visitors.h:106
std::vector< osg::Matrix > MatrixStack
Definition: pagedNode2Visitors.h:33
structure to retrieve the triangles
Definition: pagedNode2Visitors.h:131
std::unordered_map< std::string, NodePagingRecord > NodePagingRecordMap
Definition: vantageTerrainImplementationUtil.h:103
Visitor that load all the pagedNode2 data that intersecting with an area.
Definition: pagedNode2Visitors.h:76
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:206
std::set< osg::Node * > _traversedNodes
Definition: pagedNode2Visitors.h:202
DrawableMap & myNewDrawable
Definition: pagedNode2Visitors.h:156
size_t myCount
Definition: pagedNode2Visitors.h:107
DtScopedNodeStackPoopPusher(std::stack< osg::ref_ptr< osg::Node > > &stack)
Definition: pagedNode2Visitors.h:60
PagedNode2Stack myPagedNode2Stack
Definition: pagedNode2Visitors.h:154
std::set< std::string > myLoadingList
Definition: pagedNode2Visitors.h:105
const DrawableList & myExistingDrawable
Definition: pagedNode2Visitors.h:155
Subclass of DtPageInVisitor which pages in only nodes that fall along a particular geometry...
Definition: pageInVisitor.h:104
Definition: coordSystem.h:54
std::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
std::vector< DtNodeId > PagedNode2Stack
Definition: pagedNode2Visitors.h:153
DtNodeBoundingExtendedInfoMap & myPagedInBoundingMap
Definition: pagedNode2Visitors.h:157
const NodePagingRecordMap & myPagedInNodes
Definition: pagedNode2Visitors.h:158
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:103
std::map< size_t, DrawableInfo > DrawableMap
Definition: vantageTerrainImplementationUtil.h:85
std::shared_ptr< DtNodeBoundingInfo > DtNodeBoundingInfoPtr
Definition: boundingNodeInfo.h:94
Visitor that unload a pageNode2.
Definition: pagedNode2Visitors.h:163
NodePagingRecordMap & myPagedNode2OutNodes
Definition: pagedNode2Visitors.h:200
bool myFullyLoaded
Fully loaded is initially set to true then when traversing the scene graph it will check if all inter...
Definition: pagedNode2Visitors.h:102
void popPagedNode2()
Definition: pagedNode2Visitors.h:151
virtual void apply(osg::LOD &node) override
CollectTriangles()
Definition: pagedNode2Visitors.h:133
void pushPagedNode2(osgEarth::PagedNode2 &pagedNode2)
Definition: pagedNode2Visitors.h:150
vrf includes
Definition: boundingNodeInfo.h:28
osg::ref_ptr< osg::Node > myPagedNode2ToUnload
Definition: pagedNode2Visitors.h:174
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:225
#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:70
std::stack< osg::ref_ptr< osg::Node > > myNodesTraveledInReverse
Definition: pagedNode2Visitors.h:226
Definition: pagedNode2Visitors.h:57
virtual ~DtScopedNodeStackPoopPusher()
Definition: pagedNode2Visitors.h:66
bool myEncounteredPagedNode2
Whether or not the visitor has yet encountered a pagedNode2 node.
Definition: pagedNode2Visitors.h:53
size_t count()
Definition: pagedNode2Visitors.h:90
std::set< size_t > DrawableList
Definition: vantageTerrainImplementationUtil.h:84
const NodePagingRecordMap & myEmptyPagedInNodes
Definition: pagedNode2Visitors.h:201
Visitor that check loaded (active page in/out bounding sphere) pagedNode2.
Definition: pagedNode2Visitors.h:182
int _level
Definition: pagedNode2Visitors.h:203
Definition: pagedNode2Visitors.h:209
bool myEndTraversal
Definition: pagedNode2Visitors.h:175
const std::stack< osg::ref_ptr< osg::Node > > & nodesTraveled() const
Definition: pagedNode2Visitors.h:219
std::set< osg::ref_ptr< osgEarth::PagingManager > > myPagingManagers
Definition: pagedNode2Visitors.h:177