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


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

本文整理汇总了C++中osg::Node::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::getName方法的具体用法?C++ Node::getName怎么用?C++ Node::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osg::Node的用法示例。


在下文中一共展示了Node::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: nap

void
FindNamedNode::apply( osg::Node& node )
{
    bool match = (
        ( ( _method == EXACT_MATCH ) &&
            ( node.getName() == _name ) ) ||
        ( ( _method == CONTAINS ) &&
            ( node.getName().find( _name ) != std::string::npos ) ) );

    if( match )
    {
        // Copy the NodePath, so we can alter it if necessary.
        osg::NodePath np = getNodePath();

        if( !_includeTargetNode )
            // Calling code has requested that the target node
            // be removed from the node paths.
            np.pop_back();

        NodeAndPath nap( &node, np );
        _napl.push_back( nap );
    }

    traverse( node );
}
开发者ID:AdriCS,项目名称:osgWorks-mirror,代码行数:25,代码来源:FindNamedNode.cpp

示例2: 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

示例3: apply

 void apply( osg::Node& node )
 {
     if ( !node.getName().empty() )
     {
         output() << node.getName() << std::endl;
         enter();
         traverse( node );
         leave();
     }
     else osgUtil::PrintVisitor::apply(node);
 }
开发者ID:512400330,项目名称:osgRecipes,代码行数:11,代码来源:main.cpp

示例4: getNodeName

// ### provide a name to node
std::string daeWriter::getNodeName(const osg::Node &node, const std::string &defaultName)
{
    std::string nodeName;

    if (node.getName().empty())
        nodeName = uniquify(defaultName);
    else
        nodeName = uniquify(node.getName());

    return nodeName;
}
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:12,代码来源:daeWriter.cpp

示例5: handle

void SimpleDotVisitor::handle(osg::Node &node, int id)
{
    std::stringstream label;

    label << "<top> Node";
    if (!node.getName().empty())
    {
        label << "| " << node.getName();
    }

    drawNode(id, "record", "solid", label.str(), "black", "white");
}
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:12,代码来源:SimpleDotVisitor.cpp

示例6: ext

osgDB::ReaderWriter::WriteResult
ReaderWriterDAE::writeNode( const osg::Node& node,
        const std::string& fname, const osgDB::ReaderWriter::Options* options ) const
{
    SERIALIZER();

    bool bOwnDAE = false;
    DAE* pDAE = NULL;

    std::string ext( osgDB::getLowerCaseFileExtension(fname) );
    if( ! acceptsExtension(ext) ) return WriteResult::FILE_NOT_HANDLED;

    // Process options
    osgDAE::daeWriter::Options pluginOptions;
    std::string srcDirectory( osgDB::getFilePath(node.getName().empty() ? fname : node.getName()) );        // Base dir when relativising images paths
    if( options )
    {
        pDAE = (DAE*)options->getPluginData("DAE");

        const std::string & baseDir = options->getPluginStringData("baseImageDir");        // Rename "srcModelPath" (and call getFilePath() on it)?
        if (!baseDir.empty()) srcDirectory = baseDir;

        const std::string & relativiseImagesPathNbUpDirs = options->getPluginStringData("DAE-relativiseImagesPathNbUpDirs");
        if (!relativiseImagesPathNbUpDirs.empty()) {
            std::istringstream iss(relativiseImagesPathNbUpDirs);
            iss >> pluginOptions.relativiseImagesPathNbUpDirs;
        }

        // Sukender's note: I don't know why DAE seems to accept comma-sparated options instead of space-separated options as other ReaderWriters. However, to avoid breaking compatibility, here's a workaround:
        std::string optString( options->getOptionString() );
        for(std::string::iterator it=optString.begin(); it!=optString.end(); ++it) {
            if (*it == ' ') *it = ',';
        }
        std::istringstream iss( optString );
        std::string opt;

        //while (iss >> opt)
        while( std::getline( iss, opt, ',' ) )
        {
            if( opt == "polygon") pluginOptions.usePolygons = true;
            else if (opt == "GoogleMode") pluginOptions.googleMode = true;
            else if (opt == "NoExtras") pluginOptions.writeExtras = false;
            else if (opt == "daeEarthTex") pluginOptions.earthTex = true;
            else if (opt == "daeZUpAxis") {}    // Nothing (old option)
            else if (opt == "daeLinkOriginalTexturesNoForce") { pluginOptions.linkOrignialTextures = true; pluginOptions.forceTexture = false; }
            else if (opt == "daeLinkOriginalTexturesForce")   { pluginOptions.linkOrignialTextures = true; pluginOptions.forceTexture = true; }
            else if (opt == "daeNamesUseCodepage") pluginOptions.namesUseCodepage = true;
            else if (!opt.empty())
            {
                OSG_NOTICE << std::endl << "COLLADA dae plugin: unrecognized option \"" << opt <<  std::endl;
            }
        }
    }
开发者ID:Kurdakov,项目名称:emscripten_OSG,代码行数:53,代码来源:ReaderWriterDAE.cpp

示例7: writePop

bool
FltExportVisitor::complete( const osg::Node& node )
{
    // Always write final pop level
    writePop();
    // Done writing records, close the record data temp file.
    _recordsStr.close();

    // Write OpenFlight file front matter: header, vertex palette, etc.
    writeHeader( node.getName() );

    writeColorPalette();
    _materialPalette->write( _dos );
    _texturePalette->write( _dos );
    _lightSourcePalette->write( _dos );
    _vertexPalette->write( _dos );

    // Write Comment ancillary record and specify the _dos DataOutputStream.
    writeComment( node, &_dos );

    // Copy record data temp file into final OpenFlight file.
    // Yee-uck. TBD need better stream copy routine.
    char buf;
    std::ifstream recIn;
    recIn.open( _recordsTempName.c_str(), std::ios::in | std::ios::binary );
    while (!recIn.eof() )
    {
        recIn.read( &buf, 1 );
        if (recIn.good())
            _dos << buf;
    }
    recIn.close();

    return true;
}
开发者ID:joevandyk,项目名称:osg,代码行数:35,代码来源:FltExportVisitor.cpp

示例8: apply

	virtual void apply (osg::Node& node) {
		if (node.getName() == m_NameToFind) {
			m_FoundNode = &node;
		} else {
			traverse(node);
		}
	}
开发者ID:nsmoooose,项目名称:csp,代码行数:7,代码来源:ScreenInfoManager.cpp

示例9: apply

 void FindNode::apply(osg::Node &node)
 {
     if(node.getName() == name)
         this->node = &node;
     else
         traverse(node);
 }
开发者ID:Brazilian-Institute-of-Robotics,项目名称:gui-vizkit3d,代码行数:7,代码来源:OsgVisitors.cpp

示例10: apply

		virtual void apply(osg::Node& node)
		{
			if (m_name == node.getName()) {
				m_found = & node;
				return;
			}
			traverse (node);
		}
开发者ID:MCA4213,项目名称:osgnewton,代码行数:8,代码来源:Utils.cpp

示例11: apply

 virtual void apply(osg::Node& node)
 {
     if (node.getName()==_name)
     {
         _foundNodes.push_back(&node);
     }
     traverse(node);
 }
开发者ID:yueying,项目名称:osg,代码行数:8,代码来源:osgsimulation.cpp

示例12: apply

    // This method gets called for every node in the scene
    //   graph. Check each node to see if its name matches
    //   out target. If so, save the node's address.
    virtual void apply( osg::Node& node )
    {
        if (node.getName() == _name)
            _node = &node;

        // Keep traversing the rest of the scene graph.
        traverse( node );
    }
开发者ID:whztt07,项目名称:osgqsg,代码行数:11,代码来源:FindNodeMain.cpp

示例13: apply

    // This method gets called for every node in the scene
    //   graph. Check each node to see if its name matches
    //   out target. If so, save the node's address.
    virtual void apply( osg::Node& node )
    {
        if (node.getName() == _name)
            foundNodeList.push_back(&node);

        // Keep traversing the rest of the scene graph.
        traverse( node );
    }
开发者ID:netzz,项目名称:visualartists,代码行数:11,代码来源:viewer.cpp

示例14: apply

void FindNode::apply( osg::Node& node )
{
	if (m_strName.compare(node.getName()) == 0)
	{
		m_pNode = &node;
		return;
	}
	traverse(node);
}
开发者ID:wangfeilong321,项目名称:Demos,代码行数:9,代码来源:findnode.cpp

示例15: setRootNode

void daeWriter::setRootNode(const osg::Node &node)
{
    std::string fname = osgDB::findDataFile(node.getName());

    // create Asset with root node providing meta data
    createAssetTag(node);

    const_cast<osg::Node*>(&node)->accept(_animatedNodeCollector);
}
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:9,代码来源:daeWriter.cpp


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