class TextureVisitor:public osg::NodeVisitor
{
public:
TextureVisitor();
TextureVisitor(QString dirPath);
void apply(osg::Node& node);
void apply(osg::Geode& geode);
void apply(osg::StateSet* state);
/*
函数名称: getPaths
函数描述:
输入参数: 获取节点下的图片路径
输出参数:
函数返回:
函数备注:
*/
inline QStringList getPaths(){return _list;}
protected:
QStringList _list;
QString _dirPath;
};
TextureVisitor::TextureVisitor():osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN)
{
}
TextureVisitor::TextureVisitor(QString dirPath):osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN)
{
_dirPath = dirPath;
}
void TextureVisitor::apply(osg::Node& node)
{
if(node.getStateSet())
{
apply(node.getStateSet());
}
traverse(node);
}
void TextureVisitor::apply(osg::Geode& geode)
{
if(g