osgEarth 2.1.1
|
#include <osgEarthFeatures/BuildTextOperator>
#include <osgEarth/Utils>
#include <osgDB/ReadFile>
#include <osgDB/ReaderWriter>
#include <osg/Geometry>
#include <osg/MatrixTransform>
#include <osg/Material>
#include <osg/Geode>
#include <osg/Version>
#include <osg/LineWidth>
#include <osg/Point>
#include <osg/Depth>
#include <osg/PolygonOffset>
#include <osg/ClusterCullingCallback>
#include <osgText/Text>
#include <osgUtil/IntersectionVisitor>
#include <osgUtil/PolytopeIntersector>
Go to the source code of this file.
Defines | |
#define | LC "[BuildTextOperator] " |
Functions | |
static std::string | parseAttributes (Feature *feature, const std::string &content, const std::string &delim) |
#define LC "[BuildTextOperator] " |
Definition at line 38 of file BuildTextOperator.cpp.
static std::string parseAttributes | ( | Feature * | feature, |
const std::string & | content, | ||
const std::string & | delim | ||
) | [static] |
Definition at line 45 of file BuildTextOperator.cpp.
{ if (delim.size()<2) return content; std::string out; size_t pos = 0; while(true) { // Search for an attribute delimiter size_t d = content.find_first_of(delim[0], pos); if (d==std::string::npos) { // No more delimiters? Add remaining text and we're done out += content.substr(pos); break; } // An attribute was found! // Add non-attribute text out += content.substr(pos, d-pos); pos = d+1; // Extract attribute name d = content.find_first_of(delim[1], pos); if (d==std::string::npos) { // No more delimiters? Add remaining text and we're done out += content.substr(pos); break; } // Add attribute and continue out += feature->getString( content.substr(pos, d-pos) ); pos = d+1; } return out; }