本文整理汇总了C++中osg::Node::className方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::className方法的具体用法?C++ Node::className怎么用?C++ Node::className使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Node
的用法示例。
在下文中一共展示了Node::className方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void GeodeFindVisitor::apply(osg::Node &searchNode) {
if (!strcmp (searchNode.className(), "Geode"))
{
_foundGeodes.push_back((osg::Geode*) &searchNode);
}
traverse(searchNode);
}
示例2: apply
void InfoVisitor::apply(osg::Node& node)
{
std::cout << spaces() << node.libraryName() << "::" << node.className() << std::endl;
++_level;
traverse(node);
--_level;
}
示例3: apply
void OsgVisitorFirstGeode::apply( osg::Node& node )
{
std::string class_name = node.className();
if (class_name == "Geode")
found_geode = (osg::Geode *) &node;
else
traverse(node);
}
示例4: apply
virtual void apply(osg::Node& node)
{
for(int i=0;i<_indent;++i)
std::cout<<" ";
std::cout<<"["<<_indent+1<<"]"<<node.libraryName()
<<"::"<<node.className()<<std::endl;
_indent++;
traverse(node);
_indent--;
}
示例5: debugPrint
void daeWriter::debugPrint(osg::Node &node)
{
#ifdef _DEBUG
std::string indent = "";
for (unsigned int i = 0; i < _nodePath.size(); i++)
{
indent += " ";
}
OSG_INFO << indent << node.className() << std::endl;
#endif
}
示例6: apply
virtual void apply(osg::Node& node)
{
std::cout
<< spaces()
<< node.libraryName()
<< "::"
<< node.className()
<< std::endl;
level_++;
traverse(node);
level_--;
}
示例7: apply
void BuildQtTreeView::apply(osg::Node& node)
{
osg::Geode *geode = 0L;
bool isGroup = false;
QString nodeName;
if(node.className()!="")
nodeName = "[" + QString::fromStdString(node.className()) + "]";
if(node.getName()!="")
nodeName += " " + QString::fromStdString(node.getName());
if (nodeName.isEmpty())
nodeName = QObject::tr("[<unknow_type>] <unnamed>");
TreeViewItem *item = new TreeViewItem(_parents.top());
item->setCheckState(0, Qt::Checked);
item->setOsgNode(&node);
item->setData(0, Qt::DisplayRole, nodeName);
if (dynamic_cast<osg::PagedLOD*>(&node))
{
item->setData(0, Qt::DecorationRole, QIcon(":/icons/TreeView/LOD.png"));
_parents.push(item);
isGroup = true;
}
else if (dynamic_cast<osg::LOD*>(&node))
{
item->setData(0, Qt::DecorationRole, QIcon(":/icons/TreeView/LOD.png"));
_parents.push(item);
isGroup = true;
}
else if (dynamic_cast<osg::Group*>(&node))
{
if (dynamic_cast<osg::MatrixTransform*>(&node))
item->setData(0, Qt::DecorationRole, QIcon(":/icons/TreeView/Matrix.png"));
else
item->setData(0, Qt::DecorationRole, QIcon(":/icons/TreeView/Group.png"));
_parents.push(item);
isGroup = true;
}
else if (dynamic_cast<osg::Billboard*>(&node))
{
item->setData(0, Qt::DecorationRole, QIcon(":/icons/TreeView/Billboard.png"));
}
else if ((geode = dynamic_cast<osg::Geode*>(&node)))
{
item->setData(0, Qt::DecorationRole, QIcon(":/icons/TreeView/Geode.png"));
for (unsigned int i=0; i<geode->getNumDrawables(); ++i)
{
osg::ref_ptr<osg::Drawable> drawable = geode->getDrawable(i);
if (drawable.valid())
{
TreeViewItem *subItem = new TreeViewItem(item);
//item->setCheckState(0, Qt::Checked);
//item->setOsgNode(&node);
subItem->setOsgObject(drawable.get());
subItem->setData(0, Qt::DisplayRole, "Drawable");
}
}
}
else
{
item->setData(0, Qt::DecorationRole, QIcon(":/icons/TreeView/Other.png"));
}
_maxTreeDepth = std::max<int>(_maxTreeDepth, _parents.size());
traverse(node);
if (isGroup)
{
_parents.pop();
}
}
示例8: getUniqueName
void WriterNodeVisitor::apply3DSMatrixNode(osg::Node &node, const osg::Matrix * m, const char * const prefix)
{
// Note: Creating a mesh instance with no transform and then copying the matrix doesn't work (matrix seems to be a temporary/computed value)
Lib3dsMeshInstanceNode * parent = _cur3dsNode;
Lib3dsMeshInstanceNode * node3ds = NULL;
if (m)
{
osg::Vec3 osgScl, osgPos;
osg::Quat osgRot, osgSo;
m->decompose(osgPos, osgRot, osgScl, osgSo);
float pos[3];
float scl[3];
float rot[4];
copyOsgVectorToLib3dsVector(pos, osgPos);
copyOsgVectorToLib3dsVector(scl, osgScl);
copyOsgQuatToLib3dsQuat(rot, osgRot);
node3ds = lib3ds_node_new_mesh_instance(NULL, getUniqueName(node.getName().empty() ? node.className() : node.getName(), true, prefix).c_str(), pos, scl, rot);
}
else
{
node3ds = lib3ds_node_new_mesh_instance(NULL, getUniqueName(node.getName().empty() ? node.className() : node.getName(), true, prefix).c_str(), NULL, NULL, NULL);
}
lib3ds_file_append_node(_file3ds, reinterpret_cast<Lib3dsNode*>(node3ds), reinterpret_cast<Lib3dsNode*>(parent));
_cur3dsNode = node3ds;
}