Changeset 5938 for geovis/trunk/Util.h
- Timestamp:
- Dec 3, 2015 12:30:50 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Util.h
r5873 r5938 8 8 #define GEOVIS_UTIL_H 9 9 10 #include <cstring> 10 11 #include <string> 11 12 13 #include <osg/NodeVisitor> 14 #include <osgEarthFeatures/FeatureIndex> 15 #include <osgEarthFeatures/FeatureSourceIndexNode> 16 12 17 namespace GeoVis { 18 19 class FindFeatureSourceIndexNodeVisitor : public osg::NodeVisitor { 20 public: 21 FindFeatureSourceIndexNodeVisitor() : 22 osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), 23 source(NULL) 24 { 25 } 26 27 virtual ~FindFeatureSourceIndexNodeVisitor() {} 28 29 virtual void apply(osg::Node& node) 30 { 31 if (strcmp(node.className(), "FeatureSourceIndexNode") == 0) { 32 osgEarth::Features::FeatureSourceIndexNode *fsin = dynamic_cast<osgEarth::Features::FeatureSourceIndexNode *>(&node); 33 osgEarth::Features::FeatureSourceIndex *index = fsin->getIndex(); 34 if (source == NULL || index->getFeatureSource() == source) { 35 nodes.push_back(fsin); 36 } 37 } 38 traverse(node); 39 } 40 41 osgEarth::Features::FeatureSource *source; 42 std::vector<osgEarth::Features::FeatureSourceIndexNode *> nodes; 43 }; 13 44 14 45 extern std::string loadCSVLayer(const char *filename, const char *longitudeColName = "longitude", const char *latitudeColName = "latitude");
Note: See TracChangeset
for help on using the changeset viewer.