// Created on: 1995-12-21 // Created by: Jean Yves LEBEY // Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #include #include #include #include #include #include #include #include #include #include #include #include #ifdef OCCT_DEBUG extern Standard_Boolean TopOpeBRepBuild_GettraceAREA(); extern Standard_Boolean TopOpeBRepDS_GettraceSTRANGE(); #endif //======================================================================= //function : DumpList //purpose : //======================================================================= #ifdef OCCT_DEBUG void TopOpeBRepBuild_Area1dBuilder::DumpList(const TopOpeBRepBuild_ListOfLoop& LOL) { Standard_Integer iLOL; TopOpeBRepBuild_ListIteratorOfListOfLoop itLOL; for (iLOL = 0, itLOL.Initialize(LOL); itLOL.More(); iLOL++, itLOL.Next()) { if (iLOL) cout<<" "; else cout<<"DUMP_AREA : "; const Handle(TopOpeBRepBuild_Loop)& L = itLOL.Value(); L->Dump();cout<IsShape(); #ifdef OCCT_DEBUG if (TopOpeBRepBuild_GettraceAREA()) { cout<<"++++ new loop : "; L->Dump(); if (boundaryL) cout<<" is bound"; else cout<<" is not bound"; cout<IsShape(); REM_Loop_FROM_LISTOFLoop (LoopIter,AreaIter.Value(),(void*)("loop of cur. area, cur. area")); } else { LoopIter.Next(); } } // insert the loop in the area ADD_Loop_TO_LISTOFLoop(L,aArea,(void*)("area = current")); if ( ! removedLoops.IsEmpty() ) { if ( allShape ) { ADD_LISTOFLoop_TO_LISTOFLoop (removedLoops,boundaryloops, (void*)("allShape = 1"),(void*)("removedLoops"),(void*)("boundaryloops")); } else { // make a new area with the removed loops TopOpeBRepBuild_ListOfLoop thelist; myArea.Append(thelist); ADD_LISTOFLoop_TO_LISTOFLoop (removedLoops,myArea.Last(), (void*)("allShape = 0"),(void*)("removedLoops"),(void*)("new area")); } } } // Loopinside == True else { Standard_Integer ashapeinside,ablockinside; TopOpeBRepBuild_ListOfLoop thelist1; myArea.Append(thelist1); TopOpeBRepBuild_ListOfLoop& newArea0 = myArea.Last(); ADD_Loop_TO_LISTOFLoop(L,newArea0,(void*)("new area")); LoopIter.Initialize(boundaryloops); while ( LoopIter.More() ) { ashapeinside = ablockinside = Standard_False; state = LC.Compare(LoopIter.Value(),L); if (state == TopAbs_UNKNOWN) Atomize(state,TopAbs_IN); ashapeinside = (state == TopAbs_IN); if (ashapeinside) { state = LC.Compare(L,LoopIter.Value()); if (state == TopAbs_UNKNOWN) Atomize(state,TopAbs_IN); ablockinside = (state == TopAbs_IN); } if ( ashapeinside && ablockinside ) { const Handle(TopOpeBRepBuild_Loop)& curL = LoopIter.Value(); ADD_Loop_TO_LISTOFLoop (curL,newArea0,(void*)("ashapeinside && ablockinside, new area")); REM_Loop_FROM_LISTOFLoop (LoopIter,boundaryloops,(void*)("loop of boundaryloops, boundaryloops")); } else { LoopIter.Next(); } } // end of boundaryloops scan } // Loopinside == False } // end of block loop } // end of LoopSet LS scan #ifdef OCCT_DEBUG if (TopOpeBRepBuild_GettraceAREA()) { if ( ! myArea.IsEmpty() ) { cout<<"------- Areas -------"<Dump(); cout<Dump(); cout<