/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (C) 2015 HUBzero Foundation, LLC * * Author: Leif Delgass */ #ifndef GEOVIS_UTIL_H #define GEOVIS_UTIL_H #include #include #include #include #include namespace GeoVis { class FindFeatureSourceIndexNodeVisitor : public osg::NodeVisitor { public: FindFeatureSourceIndexNodeVisitor() : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), source(NULL) { } virtual ~FindFeatureSourceIndexNodeVisitor() {} virtual void apply(osg::Node& node) { if (strcmp(node.className(), "FeatureSourceIndexNode") == 0) { osgEarth::Features::FeatureSourceIndexNode *fsin = dynamic_cast(&node); osgEarth::Features::FeatureSourceIndex *index = fsin->getIndex(); if (source == NULL || index->getFeatureSource() == source) { nodes.push_back(fsin); } } traverse(node); } osgEarth::Features::FeatureSource *source; std::vector nodes; }; extern std::string loadCSVLayer(const char *filename, const char *longitudeColName = "longitude", const char *latitudeColName = "latitude"); } #endif