// File: TopOpeBRepBuild_BuilderON2d.cxx // Created: Thu May 7 10:36:33 1998 // Author: Xuan PHAM PHU // #include #include #include #include #include #include #include #include #include #include #include #include #define M_OUT(st) (st == TopAbs_OUT) #define M_IN( st) (st == TopAbs_IN) #define M_FORWARD(st) (st == TopAbs_FORWARD) #define M_REVERSED(st) (st == TopAbs_REVERSED) #ifdef DEB Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextEINTERNAL(); Standard_EXPORT Standard_Boolean TopOpeBRepBuild_GetcontextEEXTERNAL(); Standard_EXPORT void debfillonf(const Standard_Integer iF); Standard_EXPORT void debON2d(const Standard_Integer iF) {cout<<"++ debON2d "<DataStructure()->DS(); if (GLOBAL_DS2d == NULL) GLOBAL_DS2d = (TopOpeBRepDS_PDataStructure)new TopOpeBRepDS_DataStructure(); const TopOpeBRepDS_ListOfInterference& lFEI = GLOBAL_DS2d->ShapeInterferences(FOR); #ifdef DEB Standard_Integer iFOR;Standard_Boolean tFOR=myPB->GtraceSPS(FOR,iFOR); if (tFOR) debfillonf(iFOR); if (tFOR) {cout<Dump(cout);cout<Splits(EG,TopAbs_ON); #ifdef DEB // Standard_Integer nEspON=lEspON.Extent(); #endif for(TopTools_ListIteratorOfListOfShape it(lEspON);it.More();it.Next()) { const TopoDS_Shape& EspON=it.Value(); GFillONParts2dWES2(I,EspON); } } } //======================================================================= //function : GFillONPartsWES2 //purpose : //======================================================================= void TopOpeBRepBuild_BuilderON::GFillONParts2dWES2(const Handle(TopOpeBRepDS_Interference)& I,const TopoDS_Shape& EspON) { const Handle(TopOpeBRepDS_HDataStructure)& HDS=myPB->DataStructure(); const TopOpeBRepDS_DataStructure& BDS= HDS->DS(); const Handle(TopOpeBRepDS_ShapeShapeInterference)& SSI=Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I); TopAbs_State TB1,TB2;myPG->StatesON(TB1,TB2); TopOpeBRepDS_Kind GT,ST;Standard_Integer GI,SI;FDS_data(SSI,GT,GI,ST,SI); // const TopOpeBRepDS_Transition& TFE=SSI->Transition(); Standard_Boolean EGBoundFOR=SSI->GBound(); const TopoDS_Face& FOR=TopoDS::Face(myFace); Standard_Integer iFOR=BDS.Shape(FOR); const TopoDS_Edge& EG=TopoDS::Edge(BDS.Shape(GI)); #ifdef DEB // Standard_Integer iEG=BDS.Shape(EG); #endif const TopoDS_Face& FS=TopoDS::Face(BDS.Shape(SI)); #ifdef DEB // Standard_Integer iFS=BDS.Shape(FS); // Standard_Boolean isclosedFF=BRep_Tool::IsClosed(EG,FOR); // Standard_Boolean isclosedFS=BRep_Tool::IsClosed(EG,FS); // Standard_Boolean isclosed=(isclosedFF || isclosedFS); // Standard_Boolean isrest=BDS.IsSectionEdge(EG); // Standard_Boolean issplit=myPB->IsSplit(EG,TopAbs_ON); // Standard_Integer rankFS=myPB->GShapeRank(FS); #endif Standard_Integer rankEG=myPB->GShapeRank(EG); #ifdef DEB // Standard_Integer rankFOR=myPB->GShapeRank(FOR); #endif // TopAbs_State TBEG = (rankEG == 1) ? TB1 : TB2; TopAbs_State TBEG = FUN_build_TB(myPB,rankEG); #ifdef DEB // TopAbs_State TFEbef = TFE.Before(); // TopAbs_State TFEaft = TFE.After(); // Standard_Boolean EGboundFOR = // Handle(TopOpeBRepDS_ShapeShapeInterference)::DownCast(I)->GBound(); #endif Standard_Boolean eghassd = HDS->HasSameDomain(EG); #ifdef DEB Standard_Boolean tFOR=myPB->GtraceSPS(iFOR); // Standard_Boolean tE=myPB->GtraceSPS(GI); // Standard_Boolean tEFOR = (tE && tFOR); if (tFOR) {debON2d(iFOR);} if (tFOR) {I->Dump(cout);cout<Opefus(); Standard_Boolean opeCut = myPB->Opec12() || myPB->Opec21(); Standard_Boolean opeCom = myPB->Opecom(); Standard_Boolean yap6 = Standard_True; yap6 = yap6 && FFinSD; // yap6 = yap6 && (!EGBoundFOR); // yap6 = yap6 && EGBoundFCX; yap6 = yap6 && (EGBoundFOR || EGBoundFCX); yap6 = yap6 && eghassd; //========================================= if ( yap6) { #ifdef DEB if (tFOR) cout<<"* yap6 = 1"<DataStructure(),iFOR,iFCX,GI,TopoDS::Edge(EspON),shareG); else if (EGBoundFOR) ok = FUN_ds_shareG(myPB->DataStructure(),iFCX,iFOR,GI,TopoDS::Edge(EspON),shareG); if (!ok) return; // nyiFUNRAISE #ifdef DEB if (tFOR) cout<<" shareG="<AddStartElement(newE); #ifdef DEB if (tFOR) cout<<" add spON e"<