本文整理汇总了C++中TopTools_IndexedDataMapOfShapeListOfShape::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ TopTools_IndexedDataMapOfShapeListOfShape::Clear方法的具体用法?C++ TopTools_IndexedDataMapOfShapeListOfShape::Clear怎么用?C++ TopTools_IndexedDataMapOfShapeListOfShape::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopTools_IndexedDataMapOfShapeListOfShape
的用法示例。
在下文中一共展示了TopTools_IndexedDataMapOfShapeListOfShape::Clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_bodies
CubitStatus OCCSurface::get_bodies(DLIList<OCCBody*>& bodies)
{
TopoDS_Face* topo_face = this->get_TopoDS_Face();
OCCQueryEngine* oqe = OCCQueryEngine::instance();
DLIList <OCCBody* > *all_bodies = oqe->BodyList;
TopTools_IndexedDataMapOfShapeListOfShape M;
OCCBody * body = NULL;
for(int j = 0; j < all_bodies->size(); j++)
{
body = all_bodies->get_and_step();
TopExp_Explorer Ex;
TopoDS_Face the_face;
TopoDS_Shape ashape = *(body->get_TopoDS_Shape());
M.Clear();
TopExp::MapShapesAndAncestors(ashape, TopAbs_FACE, TopAbs_COMPSOLID, M);
if(!M.Contains(*topo_face))
continue;
bodies.append_unique(body);
}
return CUBIT_SUCCESS;
}
示例2: PerformInternalShapes
//=======================================================================
//function : PerformInternalShapes
//purpose :
//=======================================================================
void GEOMAlgo_BuilderFace::PerformInternalShapes()
{
myErrorStatus=0;
//
Standard_Integer aNbWI=myLoopsInternal.Extent();
if (!aNbWI) {// nothing to do
return;
}
//
//Standard_Real aTol;
BRep_Builder aBB;
TopTools_ListIteratorOfListOfShape aIt1, aIt2;
TopoDS_Iterator aIt;
TopTools_MapOfShape aME, aMEP;
TopTools_MapIteratorOfMapOfShape aItME;
TopTools_IndexedDataMapOfShapeListOfShape aMVE;
TopTools_ListOfShape aLSI;
//
// 1. All internal edges
aIt1.Initialize(myLoopsInternal);
for (; aIt1.More(); aIt1.Next()) {
const TopoDS_Shape& aWire=aIt1.Value();
aIt.Initialize(aWire);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
aME.Add(aE);
}
}
aNbWI=aME.Extent();
//
// 2 Process faces
aIt2.Initialize(myAreas);
for ( ; aIt2.More(); aIt2.Next()) {
TopoDS_Face& aF=TopoDS::Face(aIt2.Value());
//
aMVE.Clear();
TopExp::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
//
// 2.1 Separate faces to process aMEP
aMEP.Clear();
aItME.Initialize(aME);
for (; aItME.More(); aItME.Next()) {
const TopoDS_Edge& aE=TopoDS::Edge(aItME.Key());
if (IsInside(aE, aF, myContext)) {
aMEP.Add(aE);
}
}
//
// 2.2 Make Internal Wires
aLSI.Clear();
MakeInternalWires(aMEP, aLSI);
//
// 2.3 Add them to aF
aIt1.Initialize(aLSI);
for (; aIt1.More(); aIt1.Next()) {
const TopoDS_Shape& aSI=aIt1.Value();
aBB.Add (aF, aSI);
}
//
// 2.4 Remove faces aMFP from aMF
aItME.Initialize(aMEP);
for (; aItME.More(); aItME.Next()) {
const TopoDS_Shape& aE=aItME.Key();
aME.Remove(aE);
}
//
aNbWI=aME.Extent();
if (!aNbWI) {
break;
}
} //for ( ; aIt2.More(); aIt2.Next()) {
}
示例3: Handle
//=======================================================================
//function : FillIn3DParts
//purpose :
//=======================================================================
void GEOMAlgo_Builder::FillIn3DParts()
{
myErrorStatus=0;
//
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
const Handle(IntTools_Context)& aCtx= pPF->Context();
//
Standard_Boolean bIsIN, bHasImage;
Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF;
TopAbs_ShapeEnum aType;
TopAbs_State aState;
TopTools_IndexedMapOfShape aMSolids, aMS, aMFaces, aMFIN;
TopTools_MapOfShape aMFDone;
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
TopTools_ListIteratorOfListOfShape aItS;
TopoDS_Iterator aIt, aItF;
BRep_Builder aBB;
TopoDS_Solid aSolidSp;
TopoDS_Face aFP;
//
myDraftSolids.Clear();
//
aNbS=aDS.NumberOfShapesOfTheObject();
for (i=1; i<=aNbS; ++i) {
const TopoDS_Shape& aS=aDS.Shape(i);
//
aType=aS.ShapeType();
if (aType==TopAbs_SOLID) {
// all solids from DS
aMSolids.Add(aS);
}
else if (aType==TopAbs_FACE) {
// all faces (originals from DS or theirs images)
if (myImages.HasImage(aS)) {
const TopTools_ListOfShape& aLS=myImages.Image(aS);
aItS.Initialize(aLS);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aFx=aItS.Value();
//
if (mySameDomainShapes.Contains(aFx)) {
const TopoDS_Shape& aFSDx=mySameDomainShapes.FindFromKey(aFx);
aMFaces.Add(aFSDx);
}
else {
aMFaces.Add(aFx);
}
}
}
else {
if (mySameDomainShapes.Contains(aS)) {
const TopoDS_Shape& aFSDx=mySameDomainShapes.FindFromKey(aS);
aMFaces.Add(aFSDx);
}
else {
aMFaces.Add(aS);
}
}
}
}
//
aNbFaces=aMFaces.Extent();
aNbSolids=aMSolids.Extent();
//
for (i=1; i<=aNbSolids; ++i) {
const TopoDS_Solid& aSolid=TopoDS::Solid(aMSolids(i));
aMFDone.Clear();
aMFIN.Clear();
aMEF.Clear();
//
aBB.MakeSolid(aSolidSp);
//
TopTools_ListOfShape aLIF;
//
BuildDraftSolid(aSolid, aSolidSp, aLIF);
aNbLIF=aLIF.Extent();
//
// 1 all faces/edges from aSolid [ aMS ]
bHasImage=Standard_False;
aMS.Clear();
aIt.Initialize(aSolid);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aShell=aIt.Value();
//
if (myImages.HasImage(aShell)) {
bHasImage=Standard_True;
//
const TopTools_ListOfShape& aLS=myImages.Image(aShell);
aItS.Initialize(aLS);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aSx=aItS.Value();
aMS.Add(aSx);
TopExp::MapShapes(aSx, TopAbs_FACE, aMS);
TopExp::MapShapes(aSx, TopAbs_EDGE, aMS);
TopExp::MapShapesAndAncestors(aSx, TopAbs_EDGE, TopAbs_FACE, aMEF);
}
//.........这里部分代码省略.........
示例4: PerformShapesToAvoid
//=======================================================================
//function :PerformShapesToAvoid
//purpose :
//=======================================================================
void GEOMAlgo_BuilderFace::PerformShapesToAvoid()
{
Standard_Boolean bFound;
Standard_Integer i, iCnt, aNbV, aNbE;
TopTools_IndexedDataMapOfShapeListOfShape aMVE;
TopTools_ListIteratorOfListOfShape aIt;
//
myShapesToAvoid.Clear();
//
iCnt=0;
while (1) {
++iCnt;
bFound=Standard_False;
//
// 1. MEF
aMVE.Clear();
aIt.Initialize (myShapes);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
if (!myShapesToAvoid.Contains(aE)) {
TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
}
// else {
// int a=0;
// }
}
aNbV=aMVE.Extent();
//
// 2. myEdgesToAvoid
for (i=1; i<=aNbV; ++i) {
const TopoDS_Vertex& aV=TopoDS::Vertex(aMVE.FindKey(i));
//
TopTools_ListOfShape& aLE=aMVE.ChangeFromKey(aV);
aNbE=aLE.Extent();
if (!aNbE) {
continue;
}
//
const TopoDS_Edge& aE1=TopoDS::Edge(aLE.First());
if (aNbE==1) {
if (BRep_Tool::Degenerated(aE1)) {
continue;
}
if (aV.Orientation()==TopAbs_INTERNAL) {
continue;
}
bFound=Standard_True;
myShapesToAvoid.Add(aE1);
}
else if (aNbE==2) {
const TopoDS_Edge& aE2=TopoDS::Edge(aLE.Last());
if (aE2.IsSame(aE1)) {
TopoDS_Vertex aV1x, aV2x;
//
TopExp::Vertices(aE1, aV1x, aV2x);
if (aV1x.IsSame(aV2x)) {
continue;
}
bFound=Standard_True;
myShapesToAvoid.Add(aE1);
myShapesToAvoid.Add(aE2);
}
}
}// for (i=1; i<=aNbE; ++i) {
//
if (!bFound) {
break;
}
//
}//while (1)
//printf(" EdgesToAvoid=%d, iCnt=%d\n", EdgesToAvoid.Extent(), iCnt);
}