当前位置: 首页>>代码示例>>C++>>正文


C++ Node::className方法代码示例

本文整理汇总了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);
}
开发者ID:ConfusedReality,项目名称:pkg_augmented-reality_polAR,代码行数:7,代码来源:GeodeFindVisitor.cpp

示例2: apply

 void InfoVisitor::apply(osg::Node& node)
 {
     std::cout << spaces() << node.libraryName() << "::" << node.className() << std::endl;
     ++_level;
     traverse(node);
     --_level;
 }
开发者ID:vwaurich,项目名称:OMVis,代码行数:7,代码来源:InfoVisiter.cpp

示例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);
}
开发者ID:BackupTheBerlios,项目名称:rvzware,代码行数:9,代码来源:OsgVisitorFirstGeode.cpp

示例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--;
	}
开发者ID:mapleyustat,项目名称:EAView,代码行数:10,代码来源:EAView.cpp

示例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
}
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:12,代码来源:daeWriter.cpp

示例6: apply

    virtual void apply(osg::Node& node)
    {
        std::cout
            << spaces()
            << node.libraryName()
            << "::"
            << node.className()
            << std::endl;

        level_++;
        traverse(node);
        level_--;
    }
开发者ID:ghub,项目名称:osg3bg,代码行数:13,代码来源:ch5_7.cpp

示例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();
    }
}
开发者ID:oliviertournaire,项目名称:QosgSceneEdit,代码行数:75,代码来源:BuildQtTreeView.cpp

示例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;
}
开发者ID:artoolkit,项目名称:osg,代码行数:27,代码来源:WriterNodeVisitor.cpp


注:本文中的osg::Node::className方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。