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


C++ Composite::getId方法代码示例

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


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

示例1: finish

	void CityObject::finish( AppearanceManager& appearanceManager, const ParserParams& params ) 
	{
		Appearance* myappearance = appearanceManager.getAppearance( getId() );

        std::vector< Geometry* >::const_iterator itGeom = _geometries.begin();
        for ( ; itGeom != _geometries.end(); ++itGeom ) {
            if ( !( (*itGeom)->getComposite() ) ) {
                (*itGeom)->finish( appearanceManager, myappearance ? myappearance : 0, params );
            } else {
                Composite* geomComposite = (*itGeom)->getComposite();
                myappearance = appearanceManager.getAppearance( geomComposite->getId() );
                (*itGeom)->finish( appearanceManager, myappearance ? myappearance : 0, params );
            }
        }

        std::vector< ImplicitGeometry* >::const_iterator itImplGeom = _implicitGeometries.begin();
        for( ; itImplGeom != _implicitGeometries.end(); ++itImplGeom) {
            for(std::vector< Geometry* >::const_iterator it = (*itImplGeom)->_geometries.begin(); it != (*itImplGeom)->_geometries.end(); ++it) {
                if ( !( (*it)->getComposite() ) ) {
                    (*it)->finish( appearanceManager, myappearance ? myappearance : 0, params );
                } else {
                    Composite* geomComposite = (*it)->getComposite();
                    myappearance = appearanceManager.getAppearance( geomComposite->getId() );
                    (*it)->finish( appearanceManager, myappearance ? myappearance : 0, params );
                }
            }
        }

        bool finish = false;
        while ( !finish && params.optimize )
        {
            finish = true;
            int len = _geometries.size();
            for ( int i = 0; finish && i < len - 2; i++ )
            {
                for ( int j = i+1; finish && j < len - 1; j++ )
                {
                    if ( !_geometries[i]->merge( _geometries[j] ) ) continue;
                    delete _geometries[j];
                    _geometries.erase( _geometries.begin() + j );
                    finish = false;
                }
            }
        }
	}
开发者ID:jpouderoux,项目名称:libcitygml-jklimke,代码行数:45,代码来源:citymodel.cpp


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