//
// 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 version 2.1 as published
+// 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.
// Modified by cma, Tue Apr 1 11:39:48 1997
// Modified by cma, Tue Apr 1 11:40:30 1997
-#include <Standard_Stream.hxx>
-#include <HLRBRep_PolyAlgo.ixx>
-#include <Standard_ErrorHandler.hxx>
-#include <TColStd_HArray1OfTransient.hxx>
-#include <TColStd_HArray1OfInteger.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepLib_MakeEdge.hxx>
#include <CSLib.hxx>
#include <CSLib_DerivativeStatus.hxx>
#include <CSLib_NormalStatus.hxx>
-#include <Geom_Surface.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <gp.hxx>
+#include <HLRAlgo_BiPoint.hxx>
+#include <HLRAlgo_EdgeStatus.hxx>
#include <HLRAlgo_ListIteratorOfListOfBPoint.hxx>
-#include <HLRAlgo_PolyShellData.hxx>
+#include <HLRAlgo_PolyAlgo.hxx>
#include <HLRAlgo_PolyData.hxx>
-#include <HLRAlgo_BiPoint.hxx>
-#include <TopoDS.hxx>
+#include <HLRAlgo_PolyInternalData.hxx>
+#include <HLRAlgo_PolyShellData.hxx>
+#include <HLRAlgo_Projector.hxx>
+#include <HLRBRep_PolyAlgo.hxx>
+#include <Poly_Polygon3D.hxx>
+#include <Poly_PolygonOnTriangulation.hxx>
+#include <Poly_Triangulation.hxx>
+#include <Precision.hxx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_OutOfRange.hxx>
+#include <Standard_Stream.hxx>
+#include <Standard_Type.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_HArray1OfTransient.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Shape.hxx>
#include <TopTools_Array1OfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <Poly_Triangulation.hxx>
-#include <Poly_Polygon3D.hxx>
-#include <Poly_PolygonOnTriangulation.hxx>
-#include <BRep_Builder.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepLib_MakeEdge.hxx>
-#include <Precision.hxx>
-#include <gp.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
#define EMskOutLin1 ((Standard_Boolean) 1)
#define EMskOutLin2 ((Standard_Boolean) 2)
#define MinSeg ((Standard_Integer*)IndexPtr)[7]
#define MaxSeg ((Standard_Integer*)IndexPtr)[8]
#define SegFlags ((Standard_Integer*)IndexPtr)[9]
-#ifdef DEB
+#ifdef OCCT_DEBUG
static Standard_Integer DoTrace = Standard_False;
static Standard_Integer DoError = Standard_False;
#endif
NN++;
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoError) {
cout << " HLRBRep_PolyAlgo::StoreShell : Face ";
cout << f << " non triangulated" << endl;
}
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoError) {
cout << "HLRBRep_PolyAlgo::StoreShell : Face ";
cout << f << " deja stockee" << endl;
Nod1NrmX = 1;
Nod1NrmY = 0;
Nod1NrmZ = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoError) {
cout << "HLRBRep_PolyAlgo::Normal : AverageNormal error";
cout << endl;
Standard_Real d = sqrt (X * X + Y * Y + Z * Z);
if (OK && d < 1.e-10) {
OK = Standard_False;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoError) {
cout << "HLRAlgo_PolyInternalData:: inverted normals on ";
cout << "node " << iNode << endl;
ZTI2 = Z2 = Nod12PntZ;
if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
cout << "Parameter error on Node " << i1p2 << endl;
&(((HLRAlgo_Array1OfPINod*)PINod1)->ChangeValue(Pol1(iPol)));
Nod12Indices = (*pi1p2)->Indices();
Nod12RValues = (*pi1p2)->RValues();
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoError) {
if (Nod11NrmX*Nod12NrmX +
Nod11NrmY*Nod12NrmY +
ZTI2 = Z2 = Nod12PntZ;
if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
cout << "Parameter error on Node " << i1p2 << endl;
}
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoError) {
cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
cout << e << " connex 1 sans PolygonOnTriangulation" << endl;
ZTI2 = Z2 = Nod12PntZ;
if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
cout << "Parameter error on Node " << i1p2 << endl;
&(((HLRAlgo_Array1OfPINod*)PINod2)->ChangeValue(Pol2(iPol)));
Nod22Indices = (*pi2p2)->Indices();
Nod22RValues = (*pi2p2)->RValues();
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoError) {
if (Nod11NrmX*Nod12NrmX +
Nod11NrmY*Nod12NrmY +
ZTI2 = Z2 = Nod12PntZ;
if (Nod12Edg1 == (Standard_Boolean) e) U2 = Nod12PCu1;
else if (Nod12Edg2 == (Standard_Boolean) e) U2 = Nod12PCu2;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::InitBiPointsWithConnexity : ";
cout << "Parameter error on Node " << i1p2 << endl;
}
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoError) {
cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
cout << e << " connect 2 without PolygonOnTriangulation" << endl;
0));
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoError) {
cout << "HLRBRep_PolyAlgo::InitBiPointsWithConnexity : Edge ";
cout << e << " Isolated, without Polygone 3D" << endl;
Nod11PntZ = Z3;
if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i1p1 << endl;
Nod12PntZ = Z3;
if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U3;
else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i1p2 << endl;
Nod11PntZ = Z3;
if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i1p1 << endl;
Nod21PntZ = Z3;
if (Nod21Edg1 == (Standard_Boolean) e) Nod21PCu1 = U3;
else if (Nod21Edg2 == (Standard_Boolean) e) Nod21PCu2 = U3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i2p1 << endl;
Nod12PntZ = Z3;
if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U3;
else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i1p2 << endl;
Nod22PntZ = Z3;
if (Nod22Edg1 == (Standard_Boolean) e) Nod22PCu1 = U3;
else if (Nod22Edg2 == (Standard_Boolean) e) Nod22PCu2 = U3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i2p2 << endl;
Nod11PntZ = Z3;
if (Nod11Edg1 == (Standard_Boolean) e) Nod11PCu1 = U3;
else if (Nod11Edg2 == (Standard_Boolean) e) Nod11PCu2 = U3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i1p1 << endl;
Nod21PntZ = Z3;
if (Nod21Edg1 == (Standard_Boolean) e) Nod21PCu1 = U3;
else if (Nod21Edg2 == (Standard_Boolean) e) Nod21PCu2 = U3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i2p1 << endl;
Nod12PntZ = Z4;
if (Nod12Edg1 == (Standard_Boolean) e) Nod12PCu1 = U4;
else if (Nod12Edg2 == (Standard_Boolean) e) Nod12PCu2 = U4;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i1p2 << endl;
Nod22PntZ = Z4;
if (Nod22Edg1 == (Standard_Boolean) e) Nod22PCu1 = U4;
else if (Nod22Edg2 == (Standard_Boolean) e) Nod22PCu2 = U4;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else {
cout << " HLRBRep_PolyAlgo::MoveOrInsertPoint : ";
cout << "Parameter error on Node " << i2p2 << endl;
TTMa[2][1] = ttma.Value(3,2);
TTMa[2][2] = ttma.Value(3,3);
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << " InsertOnOutLine : NbTData " << (*pid)->NbTData() << endl;
cout << " InsertOnOutLine : NbPISeg " << (*pid)->NbPISeg() << endl;
nbS = (*pid)->NbPISeg();
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << " InsertOnOutLine : NbTData " << (*pid)->NbTData() << endl;
cout << " InsertOnOutLine : NbPISeg " << (*pid)->NbPISeg() << endl;
Tri1Indices = tdata->Indices();
if ((Tri1Flags & FMskSide) == 0 &&
(Tri1Flags & FMskFrBack)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace)
cout << " face : " << f << " , triangle " << i << endl;
#endif
Nod11Flag |= NMskMove;
UpdateAroundNode(Tri1Node1,Nod11Indices,TData,PISeg,PINod);
FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << Tri1Node1 << " modifies : DX,DY ";
cout << X1 << " , " << Y1 << endl;
Nod12Flag |= NMskMove;
UpdateAroundNode(Tri1Node2,Nod12Indices,TData,PISeg,PINod);
FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << Tri1Node2 << " modifies : DX,DY ";
cout << X2 << " , " << Y2 << endl;
Nod13Flag |= NMskMove;
UpdateAroundNode(Tri1Node3,Nod13Indices,TData,PISeg,PINod);
FrBackInList = Standard_True;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << Tri1Node3 << " modifies : DX,DY ";
cout << X3 << " , " << Y3 << endl;
}
#endif
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoTrace)
cout << "modification error" << endl;
#endif
Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod1)->
ChangeValue(F1Pt1Index))->Indices();
if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace)
cout << F1Pt1Index << " modifies 11" << endl;
#endif
Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod1)->
ChangeValue(F1Pt2Index))->Indices();
if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace)
cout << F1Pt2Index << " modifies 12" << endl;
#endif
Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod2)->
ChangeValue(F2Pt1Index))->Indices();
if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace)
cout << F2Pt1Index << " modifies 21" << endl;
#endif
Nod11Indices = (((HLRAlgo_Array1OfPINod*)PINod2)->
ChangeValue(F2Pt2Index))->Indices();
if (Nod11Flag & NMskMove) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace)
cout << F2Pt2Index << " modifies 22" << endl;
#endif
Nod1NrmX = 1;
Nod1NrmY = 0;
Nod1NrmZ = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoError) {
cout << "HLRBRep_PolyAlgo::ChangeNode between " << ip1;
cout << " and " << ip2 << endl;
Nod2NrmX = 1;
Nod2NrmY = 0;
Nod2NrmZ = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoError) {
cout << "HLRBRep_PolyAlgo::ChangeNode between " << ip2;
cout << " and " << ip1 << endl;
&(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri1Node2));
const Handle(HLRAlgo_PolyInternalNode)* PN3 =
&(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri1Node3));
- const Standard_Address Nod1Indices = (*PN1)->Indices();
- const Standard_Address Nod2Indices = (*PN2)->Indices();
- const Standard_Address Nod3Indices = (*PN3)->Indices();
- const Standard_Address Nod1RValues = (*PN1)->RValues();
- const Standard_Address Nod2RValues = (*PN2)->RValues();
- const Standard_Address Nod3RValues = (*PN3)->RValues();
+ const Standard_Address aNod1Indices = (*PN1)->Indices();
+ const Standard_Address aNod2Indices = (*PN2)->Indices();
+ const Standard_Address aNod3Indices = (*PN3)->Indices();
+ const Standard_Address aNod1RValues = (*PN1)->RValues();
+ const Standard_Address aNod2RValues = (*PN2)->RValues();
+ const Standard_Address aNod3RValues = (*PN3)->RValues();
OrientTriangle(iTri1,Tri1Indices,
- Nod1Indices,Nod1RValues,
- Nod2Indices,Nod2RValues,
- Nod3Indices,Nod3RValues);
+ aNod1Indices,aNod1RValues,
+ aNod2Indices,aNod2RValues,
+ aNod3Indices,aNod3RValues);
}
if ( iTri2 != 0) {
const Standard_Address Tri2Indices =
&(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri2Node2));
const Handle(HLRAlgo_PolyInternalNode)* PN3 =
&(((HLRAlgo_Array1OfPINod*)PINod)->ChangeValue(Tri2Node3));
- const Standard_Address Nod1Indices = (*PN1)->Indices();
- const Standard_Address Nod2Indices = (*PN2)->Indices();
- const Standard_Address Nod3Indices = (*PN3)->Indices();
- const Standard_Address Nod1RValues = (*PN1)->RValues();
- const Standard_Address Nod2RValues = (*PN2)->RValues();
- const Standard_Address Nod3RValues = (*PN3)->RValues();
+ const Standard_Address aNod1Indices = (*PN1)->Indices();
+ const Standard_Address aNod2Indices = (*PN2)->Indices();
+ const Standard_Address aNod3Indices = (*PN3)->Indices();
+ const Standard_Address aNod1RValues = (*PN1)->RValues();
+ const Standard_Address aNod2RValues = (*PN2)->RValues();
+ const Standard_Address aNod3RValues = (*PN3)->RValues();
OrientTriangle(iTri2,Tri2Indices,
- Nod1Indices,Nod1RValues,
- Nod2Indices,Nod2RValues,
- Nod3Indices,Nod3RValues);
+ aNod1Indices,aNod1RValues,
+ aNod2Indices,aNod2RValues,
+ aNod3Indices,aNod3RValues);
}
if (Seg1LstSg1 == iNode) iiii = Seg1NxtSg1;
else iiii = Seg1NxtSg2;
//=======================================================================
void
-#ifdef DEB
+#ifdef OCCT_DEBUG
HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer iTri,
#else
HLRBRep_PolyAlgo::OrientTriangle(const Standard_Integer,
Tri1Flags |= FMskSide;
Tri1Flags &= ~FMskBack;
Tri1Flags |= FMskOnOutL;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << "HLRBRep_PolyAlgo::OrientTriangle : OnOutL";
cout << " triangle " << iTri << endl;
Standard_Real dz12 = Nod2PntZ - Nod1PntZ;
Standard_Real d12 = sqrt(dx12 * dx12 + dy12 * dy12 + dz12 * dz12);
if (d12 <= 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
cout << " triangle " << iTri << endl;
Standard_Real dz23 = Nod3PntZ - Nod2PntZ;
Standard_Real d23 = sqrt(dx23 * dx23 + dy23 * dy23 + dz23 * dz23);
if (d23 < 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
cout << " triangle " << iTri << endl;
Standard_Real dz31 = Nod1PntZ - Nod3PntZ;
Standard_Real d31 = sqrt(dx31 * dx31 + dy31 * dy31 + dz31 * dz31);
if (d31 < 1.e-10) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
cout << " triangle " << iTri << endl;
Standard_Real dz = dx12 * dy23 - dy12 * dx23;
Standard_Real d = sqrt(dx * dx + dy * dy + dz * dz);
if (d < 1.e-5) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoTrace) {
cout << "HLRBRep_PolyAlgo::OrientTriangle : Flat";
cout << " triangle " << iTri << endl;
}
iTri1 = 0;
iTri2 = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
if (DoError) {
cout << "HLRBRep_PolyAlgo::Triangles : error";
cout << " between " << ip1 << " and " << ip2 << endl;
Tri1Flags |= EMskOutLin2;
else if ((tn3 == pd && tn1 == pf) || (tn3 == pf && tn1 == pd))
Tri1Flags |= EMskOutLin3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoError) {
cout << "HLRAlgo_PolyInternalData::UpdateOutLines";
cout << " : segment not found" << endl;
Tri2Flags |= EMskOutLin2;
else if ((tn3 == pd && tn1 == pf) || (tn3 == pf && tn1 == pd))
Tri2Flags |= EMskOutLin3;
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoError) {
cout << "HLRAlgo_PolyInternalData::UpdateOutLines";
cout << " : segment not found" << endl;
BP.OutLine(outl);
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
else if (DoError) {
cout << "HLRBRep_PolyAlgo::UpdateEdgesBiPoints : error ";
cout << " between " << F1Index << setw(6);
Tri1Indices = OT->Indices();
Tri2Indices = NT->Indices();
if (!(Tri1Flags & FMskSide)) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if ((Tri1Flags & FMskFrBack) && DoTrace) {
cout << "HLRBRep_PolyAlgo::ReverseBackTriangle :";
cout << " face " << f << setw(6);