// Created on: 1994-02-17
// Created by: Jean Yves LEBEY
// Copyright (c) 1994-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
//
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// 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.
//
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
-#include <TopOpeBRep_FacesFiller.ixx>
-
+#include <Bnd_Box.hxx>
+#include <BndLib_Add3dCurve.hxx>
#include <BRep_Tool.hxx>
-#include <TopoDS.hxx>
-#include <TopExp.hxx>
-#include <Standard_CString.hxx>
#include <BRepTools.hxx>
+#include <gp_Pnt.hxx>
#include <Precision.hxx>
-#include <TColStd_ListOfInteger.hxx>
+#include <Standard_CString.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
-#include <TopOpeBRep_FFDumper.hxx>
-#include <TopOpeBRepTool_TOOL.hxx>
-#include <TopOpeBRepTool_defineG.hxx>
-#include <TopOpeBRepTool_EXPORT.hxx>
-#include <TopOpeBRepTool_makeTransition.hxx>
-
-#include <TopOpeBRepDS_Dumper.hxx>
-#include <TopOpeBRepDS_InterferenceTool.hxx>
-#include <TopOpeBRepDS_Curve.hxx>
-#include <TopOpeBRepDS_ProcessInterferencesTool.hxx>
-
+#include <TColStd_ListOfInteger.hxx>
+#include <TopExp.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
#include <TopOpeBRep.hxx>
+#include <TopOpeBRep_define.hxx>
+#include <TopOpeBRep_FacesFiller.hxx>
+#include <TopOpeBRep_FacesIntersector.hxx>
+#include <TopOpeBRep_FFDumper.hxx>
#include <TopOpeBRep_FFTransitionTool.hxx>
#include <TopOpeBRep_GeomTool.hxx>
+#include <TopOpeBRep_LineInter.hxx>
+#include <TopOpeBRep_PointClassifier.hxx>
#include <TopOpeBRep_PointGeomTool.hxx>
-#include <TopOpeBRep_FFDumper.hxx>
-
-#include <TopOpeBRep_define.hxx>
-
-#include <Bnd_Box.hxx>
-#include <BndLib_Add3dCurve.hxx>
+#include <TopOpeBRep_VPointInter.hxx>
+#include <TopOpeBRep_VPointInterClassifier.hxx>
+#include <TopOpeBRep_VPointInterIterator.hxx>
+#include <TopOpeBRepDS_Curve.hxx>
+#include <TopOpeBRepDS_DataStructure.hxx>
+#include <TopOpeBRepDS_Dumper.hxx>
+#include <TopOpeBRepDS_HDataStructure.hxx>
+#include <TopOpeBRepDS_Interference.hxx>
+#include <TopOpeBRepDS_InterferenceTool.hxx>
+#include <TopOpeBRepDS_Point.hxx>
+#include <TopOpeBRepDS_ProcessInterferencesTool.hxx>
+#include <TopOpeBRepDS_Transition.hxx>
+#include <TopOpeBRepTool_defineG.hxx>
+#include <TopOpeBRepTool_EXPORT.hxx>
+#include <TopOpeBRepTool_makeTransition.hxx>
+#include <TopOpeBRepTool_TOOL.hxx>
#ifdef DRAW
#include <TopOpeBRep_DRAW.hxx>
#endif
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_EXPORT void debrest(const Standard_Integer i) {cout<<"+ debrest "<<i<<endl;}
Standard_EXPORT void debrline() {cout<<"+ debrline"<<endl;}
// attached to the edge (stored in the DS).
//=======================================================================
static Standard_Boolean FUN_findTF(const TopOpeBRepDS_PDataStructure pDS,
- const Standard_Integer iE, const Standard_Integer iF, const Standard_Integer iOOF,
+ const Standard_Integer iE, const Standard_Integer, const Standard_Integer iOOF,
TopOpeBRepDS_Transition& TF)
{
Standard_Real factor = 0.5;
if (!ok1) return Standard_False;
Standard_Real f,l; FUN_tool_bounds(OOE,f,l);
- TopAbs_State stb,sta;
+ TopAbs_State stb = TopAbs_UNKNOWN,sta = TopAbs_UNKNOWN;
TopOpeBRepTool_makeTransition MKT;
OOdone = MKT.Initialize(OOE,f,l,oopar,F,uv,factor);
if (OOdone) OOdone = MKT.SetRest(E,paronE);
return ok;
}
-Standard_EXPORT Standard_Boolean GLOBAL_btcx = Standard_False;void debtcx(){};
+Standard_EXPORT Standard_Boolean GLOBAL_btcx = Standard_False;void debtcx(){}
Standard_EXPORT void debtcxmess(Standard_Integer f1,Standard_Integer f2,Standard_Integer il)
{cout<<"f1,f2,il : "<<f1<<","<<f2<<","<<il<<endl;cout.flush();debtcx();}
if (reject) return;
ResetDSC();
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Integer ili = myLine->Index(),nli = myFacesIntersector->NbLines();
Standard_Boolean tcx = TopOpeBRepDS_GettraceCX(ili);
Standard_Boolean tDSF = TopOpeBRepDS_GettraceDSF();
myHDS->SortOnParameter(myDSCIL);
-#ifdef DEB
+#ifdef OCCT_DEBUG
TopOpeBRepDS_Dumper Dumper(myHDS);
if (tDSF||traceDSNC) Dumper.DumpLOI(myDSCIL,cout,"current curve : ");
#endif
//=======================================================================
void TopOpeBRep_FacesFiller::ProcessVPnotonR(const TopOpeBRep_VPointInter& VP)
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean traceDSF = TopOpeBRepDS_GettraceDSF();
Standard_Boolean traceDSP = TopOpeBRepDS_GettraceDSP();
Standard_Boolean traceISTO = TopOpeBRepDS_GettraceISTO();
Standard_Integer ShapeIndex = 0;
Standard_Integer iVP = VP.Index();
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Integer ili=myLine->Index(),ivp=iVP,isi=ShapeIndex;
if(traceDSF || traceDSP){
cout<<"trc tnvp 1 "<<myexF1<<" "<<myexF2<<" "<<ili<<" "<<ivp<<" "<<isi;
Standard_Boolean CPIfound = GetGeometry(itCPIL,VP,PVIndex,PVKind);
if ( !CPIfound ) {
if (iVP != iINON1 && iVP != iINONn) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<<"VP "<<iVP<<" on "<<0<<" : point d'intersection anormal : rejet"<<endl;
#endif
return;
//=======================================================================
void TopOpeBRep_FacesFiller::ProcessRLine()
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean tDSF = TopOpeBRepDS_GettraceDSF();
#endif
Standard_Integer rank = myDS->AncestorRank(iErest);
Standard_Integer OOrank = (rank == 1)? 2: 1;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (tDSF) {cout<<"+ edge restriction "<<myDS->SectionEdge(Erest);
cout<<" (DS "<<iErest<<")"<<endl;}
Standard_Boolean trce = TopOpeBRepDS_GettraceSPSX(iErest); if(trce) debrest(iErest);
Standard_Boolean T1unk = T1.IsUnknown();
Standard_Boolean T2unk = T2.IsUnknown();
Standard_Boolean processUNK = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean nopunk = TopOpeBRep_GetcontextNOPUNK();
if (nopunk) processUNK = Standard_False;
#endif
if (processUNK && (T1unk || T2unk)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepDS_GettraceSTRANGE(); trc = trc || tDSF;
if (trc) cout<<"T UNKNOWN FEI F"<<iF1<<" F"<<iF2<<" on Erest"<<iErest<<endl;
#endif
if (OOTok) {
if (OOrank == 1) FDS_SetT(T1,T);
else FDS_SetT(T2,T);
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) {
cout<<"F"<<iOOF<<" + new FEI(";TopAbs::Print(T.Before(),cout);cout<<",";
TopAbs::Print(T.After(),cout);cout<<" (F"<<iF<<") (E"<<iErest<<"))\n";
if (Tok) {
if (rank == 1) FDS_SetT(T1,T);
else FDS_SetT(T2,T);
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trc) {cout<<"F"<<iF<<" + new FEI(";TopAbs::Print(T.Before(),cout);cout<<",";
TopAbs::Print(T.After(),cout);cout<<" (F"<<iOOF<<") (E"<<iErest<<"))\n";}
#endif
VPI.Init((*myLine));
Standard_Real tola = Precision::Angular()*1.e5;//NYIXPUTOL
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (tDSF) {
debrline();
cout<<endl<<"------------ Rline processing --------------------"<<endl;
const TopOpeBRep_VPointInter& vpf = VPI.CurrentVP();
for (; VPI.More(); VPI.Next()) {
const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (tDSF) {cout<<endl;myHFFD->DumpVP(VP);}
#endif
Standard_Integer absindex = VP.ShapeIndex(); // 0,1,2,3
Standard_Integer obOO = TopOpeBRepTool_TOOL::OnBoundary(OOpar,OOE); //vertex can be missed
if ((obRest == EXTERNAL)||(obOO == EXTERNAL)){
-#ifdef DEB
+#ifdef OCCT_DEBUG
if(obRest==EXTERNAL) cout<<"***********ProcessRLine : faulty parameter on Erest"<<endl;
if(obOO==EXTERNAL) cout<<"***********ProcessRLine : faulty parameter on OOE"<<endl;
#endif
TopoDS_Face OOFace = (*this).Face(OOShapeIndex);
Standard_Integer iOOFace = myDS->Shape(OOFace);
- TopoDS_Edge edge,OOedge; Standard_Integer SIedgeIndex,OOedgeIndex;
- Standard_Real paredge,OOparedge;
+ TopoDS_Edge edge,OOedge; Standard_Integer OOedgeIndex;
+#ifdef OCCT_DEBUG
+ Standard_Integer SIedgeIndex;
+#endif
+ Standard_Real paredge;
Standard_Integer onbound;
- if (SIErest)
- {edge = Erest; SIedgeIndex = iErest; paredge = parRest; onbound = obRest;
- OOedge = OOE; OOedgeIndex = iOO; OOparedge = OOpar;}
- else
- {OOedge = Erest;OOedgeIndex = iErest; OOparedge = parRest; onbound = obOO;
- edge = OOE; SIedgeIndex = iOO; paredge = OOpar;}
-
+ if (SIErest) {
+ edge = Erest;
+#ifdef OCCT_DEBUG
+ SIedgeIndex = iErest;
+#endif
+ paredge = parRest;
+ onbound = obRest;
+ OOedge = OOE;
+ OOedgeIndex = iOO;
+ } else {
+ OOedge = Erest;
+ OOedgeIndex = iErest;
+ onbound = obOO;
+ edge = OOE;
+#ifdef OCCT_DEBUG
+ SIedgeIndex = iOO;
+#endif
+ paredge = OOpar;
+ }
// PVIndex :
// --------
// xpu150399 : BUC60382
const TopOpeBRepDS_Transition& llt2 = FaceFaceTransition(2);
TopOpeBRepDS_Transition Trans = (ShapeIndex == 1)? llt1 : llt2;
Standard_Boolean TransUNK = Trans.IsUnknown();
- TopAbs_Orientation Transori; if (!TransUNK) Transori = Trans.Orientation(TopAbs_IN);
-
+
TopOpeBRepDS_Transition transEdge; Standard_Boolean Tunk = Standard_True;
if (!TransUNK) { //xpu281098 PRO12875(edge9,OOface11)
if ((absindex==ShapeIndex)||(absindex==3)) {
if (!ok) continue;
transEdge.Before(Tr.Before()); transEdge.After(Tr.After());
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (tDSF) {cout<<"*-> new transEdge (edge"<<SIedgeIndex<<",face"<<iOOFace<<")=";
TopAbs::Print(transEdge.Before(),cout);
cout<<" ";TopAbs::Print(transEdge.After(),cout);cout<<endl;}
//=======================================================================
void TopOpeBRep_FacesFiller::FillLineVPonR()
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean tDSF = TopOpeBRepDS_GettraceDSF();
Standard_Boolean trline = Standard_False;
#endif
mykeptVPnbr = 0;
if (myLine->TypeLineCurve() == TopOpeBRep_RESTRICTION) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trline) FUN_traceRLine(*myLine);
#endif
ProcessRLine();
return;
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (trline) FUN_traceGLine(*myLine);
#endif
myLineIsonEdge = LSameDomainERL(*myLine, myERL);
// walking (case mouch1a 1 1) : line (vpfirst on 3,vplast on 0,nvpkept = 2) => kept
myLastVPison0 = ::FUN_haslastvpon0(*myLine);
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (tDSF) {
if (myLineIsonEdge) cout<<" geometric line is on edge"<<endl;
else cout <<" geometric line not on edge"<<endl;
// sharing same domain with the current geometric line are computed here
//----------------------------------------------------------------------
-#ifdef DEB
- Standard_Boolean trcd = Standard_False;
+#ifdef OCCT_DEBUG
#ifdef DRAW
+ Standard_Boolean trcd = Standard_False;
if (trcd) FUN_DrawMap(myDataforDegenEd);
#endif
#endif
//=======================================================================
void TopOpeBRep_FacesFiller::FillLine()
{
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean tDSF = TopOpeBRepDS_GettraceDSF();
#endif
const TopOpeBRep_VPointInter& VP = VPI.CurrentVP();
if ( ! VP.Keep() ) continue;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (tDSF) cout<<endl;
#endif
if (onsampt) id = Standard_True;
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (TopOpeBRepDS_GettraceDSF()) {
cout<<endl<<"minmax "<<pmin<<","<<pmax;
if (id) cout<<" --> rejet";
TopOpeBRepDS_Curve DSC;
myDSCIndex = myDS->AddCurve(DSC);
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSNC())
cout<<"new DSC "<<myDSCIndex<<endl;
if (TopOpeBRepDS_GettraceDSLT()) myLine->DumpLineTransitions(cout);
{
TopOpeBRepDS_Point DSP = TopOpeBRep_PointGeomTool::MakePoint(VP);
Standard_Boolean b = myHDS->GetGeometry(IT,DSP,G,K);
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSP();
if (b && trc) {
Standard_Boolean newinDS = Standard_False; myHFFD->DumpDSP(VP,K,G,newinDS);
K = TopOpeBRepDS_POINT;
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Boolean trc = TopOpeBRepDS_GettraceDSF() || TopOpeBRepDS_GettraceDSP();
if (trc) {
Standard_Boolean newinDS = Standard_True; myHFFD->DumpDSP(VP,K,G,newinDS);