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


C++ GetFieldHandlePtr::isInternal方法代码示例

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


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

示例1: visitContainer

void OSGWriter::visitContainer(FieldContainer * const pFC)
{

    if(pFC == NULL)
    {
        return;
    }

    typedef std::pair<FCInfoHelperMap::iterator, bool> MapInsertInfo;

          std::string         containerName;
//    const FieldContainerType &fcType    = pFC->getType();
          UInt32              numFields = pFC->getNumFields();
          MapInsertInfo       insertInfo;

    insertInfo = _visitedFCMap.insert(std::make_pair(pFC, FCInfoHelper()));

    if(insertInfo.second == true)
    {
        //the FC was NOT visited before
        for(UInt32 field = 1; field <= numFields; field++)
        {
            GetFieldHandlePtr fHandle = pFC->getField(field);

            if(fHandle == NULL || (fHandle != NULL && fHandle->isInternal()))
            {
                continue;
            }

            visitField(fHandle);
        }
    }
    else
    {
        //the FC was in the map => FC is shared

        FCInfoHelperMap::iterator iter = _visitedFCMap.find(pFC);

        if(iter == _visitedFCMap.end())
        {
            SWARNING << "OSGWriter::visitContainer(): FieldContainer * "
                     << "not found in map" << std::endl;
            return;
        }
        if(iter->second.hasName == false)
        {
            iter->second.setName(pFC);
            iter->second.hasName = true;
        }
    }
}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:51,代码来源:OSGOSGWriter.cpp

示例2: writeContainer

void OSGWriter::writeContainer(FieldContainer * const pFC,
                               bool                   bIndent)
{
    if(pFC == NULL)
    {
        return;
    }

    UInt32 numFields = pFC->getNumFields();

    FCInfoHelperMap::iterator iter = _visitedFCMap.find(pFC);

    if(iter == _visitedFCMap.end())
    {
        SWARNING << "OSGWriter::writeContainer(): FieldContainer * "
                 << "not found in map" << std::endl;
        return;
    }

    if(!iter->second.written)
    {
        //FC is not written yet
        iter->second.written = true;

        if(bIndent == true)
        {
            _outStream << BeginElem;
        }

        if(iter->second.hasName)
        {
            _outStream << "DEF "
                       << iter->second.containerName 
                       << " "
                       << pFC->getTypeName()
                       << EndElemNL
                       << BeginElem
                       << "{"
                       << EndElemNL;
        }
        else
        {
            _outStream <<  pFC->getTypeName() 
                       << EndElemNL
                       << BeginElem
                       << "{"
                       << EndElemNL;
        }
        
        _outStream << IncIndent;

        for(UInt32 field = numFields; field > 0; field--)
        {
            GetFieldHandlePtr fHandle = pFC->getField(field);

            if(fHandle == NULL || (fHandle != NULL && fHandle->isInternal()))
            {
                continue;
            }

            writeField(fHandle);
        }

        _outStream << DecIndent;

        _outStream << BeginElem 
                   << "}" 
                   << EndElemNL;
    }
    else
    {
        //FC is already written -> its shared -> write reference
        if(!iter->second.hasName)
        {
            SWARNING << "OSGWriter::writeContainer(): FieldContainer is "
                     << "shared, but not named"
                     << std::endl;
            return;
        }
        
        if(bIndent == true)
        {
            _outStream << BeginElem;
        }

        _outStream << "USE "
                   << iter->second.containerName 
                   << EndElemNL;
    }

}
开发者ID:jondo2010,项目名称:OpenSG,代码行数:91,代码来源:OSGOSGWriter.cpp


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