本文整理汇总了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;
}
}
}
}