|
模型中有很多sw2节点,为了寻找这些节点编写了如下程序,
myFindNodeVisitor findSignal01("sw2");
mModel->accept(findSignal01);
int size_t=findSignal01.m_nodeList.size();
std::vector<osg::Node*>::iterator iter=findSignal01.m_nodeList.begin();
for(int i=0;i<size_t;i++)
{
signalswitch[i][0]=dynamic_cast<osgSim::MultiSwitch*>(node);
iter++;
}
编译时出错
\MFC_OSG.cpp(153) : error C2440: 'type cast' : cannot convert from 'std::_Vector_iterator<_Ty,_Alloc> *' to 'osg::Node'
1> with
1> [
1> _Ty=osg::Node *,
1> _Alloc=std::allocator<osg::Node *>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
求帮忙,告诉我怎么把这些节点都寻找到,并且能用上它们,万分感谢 |
|