VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOceanExtractorVisitor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
16 #include <osg/NodeVisitor>
17 
18 #include <ostream>
19 #include <string>
20 #include <vector>
21 
22 #include <boost/regex.hpp>
23 #include <boost/unordered_map.hpp>
24 #include <boost/unordered_set.hpp>
25 
26 namespace osg
27 {
28  class Geode;
29  class Group;
30  class Node;
31  class LOD;
32 };
33 
34 namespace makVrv
35 {
44  class DtOceanExtractorVisitor : public osg::NodeVisitor
45  {
46  public:
48  typedef std::vector<boost::regex> RegexVector;
49 
55  const std::string& rule, bool isRegEx );
56 
58  virtual ~DtOceanExtractorVisitor();
59 
60  public:
66  virtual void apply(osg::Group& group);
67 
70  virtual void apply(osg::Node& node);
71 
73  virtual bool nodesExtracted() const;
74 
75  protected:
77  virtual bool extractStaticOcean(osg::Node& node);
78 
80  virtual bool checkTextures( const osg::Node& node );
81 
83  virtual bool makeNodeStaticOcean( osg::Node& node );
84 
85  protected:
86  std::string mySearchForString;
89  osg::Group* myStartGroup;
91  boost::unordered_set<int> myTexturesRemoved;
92  boost::unordered_set<int> myTextureNonMatchCache;
94  std::vector<osg::ref_ptr<osg::Node> > myNodesToRemove;
95  };
96 
97 }
virtual bool checkTextures(const osg::Node &node)
Check the textures pointed to by a node against the search criteria.
bool myNodesExtracted
Definition: DtOceanExtractorVisitor.h:93
virtual void apply(osg::Group &group)
This is the method called when the visitor is visiting groups We detect the DtTerrainPatchGroup (via ...
boost::unordered_map< int, std::string > TextureMap
typdef a map of textures
Definition: DtTextureVisitor.h:38
Declaration of the makVrv::DtTextureVisitor class.
virtual ~DtOceanExtractorVisitor()
Virtual DTOR.
boost::unordered_set< int > myTexturesRemoved
Definition: DtOceanExtractorVisitor.h:91
bool myExpressionIsRegEx
Definition: DtOceanExtractorVisitor.h:88
RegexVector mySearchForRegularExpressions
Definition: DtOceanExtractorVisitor.h:87
boost::unordered_set< int > myTextureNonMatchCache
Definition: DtOceanExtractorVisitor.h:92
virtual bool makeNodeStaticOcean(osg::Node &node)
When a static ocean node is discovered, mark it.
std::vector< boost::regex > RegexVector
typdef a vector of regex for convenience
Definition: DtOceanExtractorVisitor.h:48
DtOceanExtractorVisitor tags nodes as static ocean via the setUserValue capability, based on a texture name or texture regular expression.
Definition: DtOceanExtractorVisitor.h:44
DtTextureVisitor::TextureMap & myTextureMap
Definition: DtOceanExtractorVisitor.h:90
Contains DLL export macros.
DtOceanExtractorVisitor(DtTextureVisitor::TextureMap &textureMap, const std::string &rule, bool isRegEx)
Default CTOR Inputs are the map of textures held be the terrain pactch, the search string or regular ...
virtual bool extractStaticOcean(osg::Node &node)
Method called on a node to attempt extraction.
virtual bool nodesExtracted() const
Return whether any nodes were marked as static ocean.
std::vector< osg::ref_ptr< osg::Node > > myNodesToRemove
Definition: DtOceanExtractorVisitor.h:94
std::string mySearchForString
Definition: DtOceanExtractorVisitor.h:86
osg::Group * myStartGroup
Definition: DtOceanExtractorVisitor.h:89

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)