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


C++ CBrush::planesEnd方法代码示例

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


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

示例1: forceDetailBrushes

void CFilterer::forceDetailBrushes()
{
	list<CBrushPlane>::iterator pIter, pEnd;

	bool forceItDetail;
	CBrush *brush;
	int brushesMadeDetail = 0;
	for(int i=0;i<worldEntity->getBrushesNo();i++) {
		brush = &worldEntity->getBrush(i);
		if(!brush->isStructural())
			continue;
		forceItDetail = true;
		pIter = brush->planesBegin();
		pEnd = brush->planesEnd();

		while(pIter!=pEnd){
			if(!pIter->canBeDetail()){
				forceItDetail = false;
				break;
			}
			++pIter;
		}

		if(forceItDetail){
			brush->setStructural(false);
			brushesMadeDetail++;
		}
	}
	cout << brushesMadeDetail<<" forced detail"<<endl;
}
开发者ID:harkal,项目名称:sylphis3d,代码行数:30,代码来源:filterer.cpp

示例2: mergeDetails

void CFilterer::mergeDetails(CBTree<CBspNode *>::Node *node){
    if(!node->isLeaf())	{
        mergeDetails(node->child(0));
        mergeDetails(node->child(1));
        return;
    }

    //NOW LEAF
    CBspLeaf *leaf = (CBspLeaf *)node->data;
    if(!leaf->getArea())
        return;
    vector<CBrush *>::iterator i, e;
    list < CBrushPlane >::iterator dpi, dpe;
    CPolygon *detailP, structuralP;

    e=leaf->bEnd();
    CBrush *db;//detail part brush
    //VertsVector::iterator v, ve;
    vector<CBrush *> allNb; //these are these and neigbor brushes
    vector<CBspLeaf *>::iterator li, le;
    vector<CBrush *>::iterator brushI, brushE;
    li=leaf->oLeafsBegin();
    le=leaf->oLeafsEnd();
    while(li!=le){
        (*li)->appendYourBrushes(allNb, worldEntity);
        li++;
    }
    leaf->appendYourBrushes(allNb, worldEntity);

    brushE = allNb.end();

    bool isAllInBrush;

    // this holds brushes which contains at least one vertex of a poly
    // but not all vertices
    list<CBrush *> brushesIn;

    list<CPolygon *>::iterator pi, pe;
    pi=leaf->polygonsBegin();
    pe=leaf->polygonsEnd();
    while(pi!=pe){
        if(!(*pi)->isKeep() || (*pi)->isLeak()){
            ++pi;
            continue;
        }
        for(brushI=allNb.begin(); brushI!=brushE;++brushI){
            assert((*brushI)->getBrushId()!=-1);
            assert((*pi)->getBrushId()!=-1);
            /*
            if((*brushI)->getBrushId() == (*i)->getBrushId())//if is the brush of this polygon do nothing
            continue;
            */ 
            if((*brushI)->getBrushId() == (*pi)->getBrushId())
                continue;
            if((*brushI)->isOpaque()){
                if((*brushI)->subPolygon(*pi)){
                    leaf->erasePolygon(pi);
                    break;
                }
            }
        }
        ++pi;
    }

    for(i=leaf->bBegin();i!=e;++i){
        brushesIn.clear();
        db  = *i;
        dpi = db->planesBegin();
        dpe = db->planesEnd();
        for( ; dpi != dpe ; ++dpi ){
            detailP = dpi->getPolygon();
            if(!detailP->isKeep())
                continue;

            isAllInBrush=false;
            for(brushI=allNb.begin(); brushI!=brushE;++brushI){
                assert((*brushI)->getBrushId()!=-1);
                assert((*i)->getBrushId()!=-1);
                if((*brushI)->getBrushId() == (*i)->getBrushId())//if is the brush of this polygon do nothing
                    continue;

                if((*brushI)->isOpaque()){
                    isAllInBrush = (*brushI)->subPolygon(detailP);
                    if(isAllInBrush)
                        break;
                }
            }

            if(isAllInBrush)
                continue;
            detailP->merge();
        }
    }
}
开发者ID:harkal,项目名称:sylphis3d,代码行数:94,代码来源:filterer.cpp


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