// Created on: 1997-04-17
// Created by: Christophe MARION
// Copyright (c) 1997-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.
//#define No_Standard_OutOfRange
-#define OCC191 // jfa 26/02/2002 Bug of cone display
-
-#include <HLRBRep_Data.ixx>
-
-#include <StdFail_UndefinedDerivative.hxx>
-#include <Precision.hxx>
-#include <gp_Dir.hxx>
+#include <BRepTopAdaptor_Tool.hxx>
+#include <BRepTopAdaptor_TopolTool.hxx>
+#include <ElCLib.hxx>
#include <Geom2d_Curve.hxx>
-#include <IntRes2d_IntersectionPoint.hxx>
-#include <IntRes2d_IntersectionSegment.hxx>
-#include <IntCurveSurface_IntersectionPoint.hxx>
-#include <IntCurveSurface_TransitionOnCurve.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
+#include <gp.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Dir2d.hxx>
#include <HLRAlgo.hxx>
+#include <HLRAlgo_Interference.hxx>
#include <HLRAlgo_ListIteratorOfInterferenceList.hxx>
+#include <HLRAlgo_Projector.hxx>
+#include <HLRBRep_Data.hxx>
+#include <HLRBRep_EdgeData.hxx>
#include <HLRBRep_EdgeFaceTool.hxx>
-#include <ElCLib.hxx>
-#include <gp.hxx>
+#include <HLRBRep_FaceData.hxx>
+#include <IntCurveSurface_IntersectionPoint.hxx>
+#include <IntCurveSurface_TransitionOnCurve.hxx>
+#include <IntRes2d_IntersectionPoint.hxx>
+#include <IntRes2d_IntersectionSegment.hxx>
+#include <Precision.hxx>
+#include <Standard_Type.hxx>
+#include <StdFail_UndefinedDerivative.hxx>
+#include <TColStd_ListIteratorOfListOfInteger.hxx>
+
#include <stdio.h>
-#include <BRepTopAdaptor_Tool.hxx>
+IMPLEMENT_STANDARD_RTTIEXT(HLRBRep_Data,MMgt_TShared)
Standard_Integer nbOkIntersection;
Standard_Integer nbPtIntersection;
long unsigned **TabBit;
Standard_Integer nTabBit;
-#ifdef DEB
+#ifdef OCCT_DEBUG
Standard_Integer StNbLect,StNbEcr,StNbMax,StNbMoy,StNbMoyNonNul; //-- STAT
#endif
+private:
+ TableauRejection(const TableauRejection&);
+ TableauRejection& operator=(const TableauRejection&);
+
public:
//-- ============================================================
TableauRejection() {
N=0; nTabBit=0; UV=NULL; nbUV=NULL; IndUV=NULL; TabBit=NULL;
-#ifdef DEB
+#ifdef OCCT_DEBUG
StNbLect=StNbEcr=StNbMax=StNbMoy=StNbMoyNonNul=0;
#endif
}
//-- ============================================================
void SetDim(const Standard_Integer n) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<<"\n@#@#@#@#@# SetDim "<<n<<endl;
#endif
if(UV)
Destroy();
-#ifdef DEB
+#ifdef OCCT_DEBUG
StNbLect=StNbEcr=StNbMax=StNbMoy=0;
#endif
N=n;
}
//-- ============================================================
void Destroy() {
-#ifdef DEB
+#ifdef OCCT_DEBUG
if(N) {
Standard_Integer nnn=0;
StNbMoy=StNbMoyNonNul=0;
free(IndUV[i]);
IndUV[i]=NULL;
}
- else { cout<<" IndUV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; }
-
+#ifdef OCCT_DEBUG
+ else
+ cout<<" IndUV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
+#endif
}
for(i=0;i<N;i++) {
if(UV[i]) {
free(UV[i]);
UV[i]=NULL;
}
+#ifdef OCCT_DEBUG
else { cout<<" UV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; }
+#endif
}
- if(nbUV) { free(nbUV); nbUV=NULL; } else { cout<<" nbUV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; }
- if(IndUV) { free(IndUV); IndUV=NULL;} else { cout<<" IndUV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; }
- if(UV) { free(UV); UV=NULL; } else { cout<<" UV ~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; }
+ if(nbUV) { free(nbUV); nbUV=NULL; }
+ if(IndUV) { free(IndUV); IndUV=NULL;}
+ if(UV) { free(UV); UV=NULL; }
N=0;
}
}
//-- ============================================================
void Set(Standard_Integer i0,Standard_Integer j0,const Standard_Real u) {
i0--; j0--;
-#ifdef DEB
+#ifdef OCCT_DEBUG
StNbEcr++;
#endif
Standard_Integer k=-1;
//-- ============================================================
Standard_Real Get(Standard_Integer i0,Standard_Integer j0) {
i0--; j0--;
-#ifdef DEB
+#ifdef OCCT_DEBUG
StNbLect++;
#endif
}
}
};
-
-
-
+
//-- ================================================================================
-//=======================================================================
-//function : FindInList
-//purpose :
-//=======================================================================
-// Unused :
-#ifdef DEB
-static Standard_Boolean FindInList (const TColStd_ListOfInteger& L,
- const Standard_Integer V)
-{
- for (TColStd_ListIteratorOfListOfInteger ILV(L);
- ILV.More();
- ILV.Next()) {
- if (V == ILV.Value())
- return Standard_True;
- }
- return Standard_False;
-}
-#endif
-
//=======================================================================
//function : AdjustParameter
//purpose :
Standard_Boolean withOutL = Standard_False;
for (myFaceItr1.InitEdge(*fd);
- myFaceItr1.MoreEdge() && !cut && !withOutL;
+ myFaceItr1.MoreEdge();
myFaceItr1.NextEdge()) {
if (myFaceItr1.Internal()) {
withOutL = Standard_True;
fd->Side(FS.IsSide(tol,myToler*10));
Standard_Boolean inverted = Standard_False;
if (fd->WithOutL() && !fd->Side()) {
- //inverted = OrientOutLine(face,*fd);
+ inverted = OrientOutLine(face,*fd);
OrientOthEdge(face,*fd);
}
if (fd->Side()) {
myFEOutLine = myFaceItr1.OutLine ();
myFEInternal = myFaceItr1.Internal ();
myFEDouble = myFaceItr1.Double ();
- HLRBRep_EdgeData* ed = &(myEData(myFE));
+ HLRBRep_EdgeData* EDataFE1 = &(myEData(myFE));
if (!myFEDouble &&
(myFEOri == TopAbs_FORWARD ||
myFEOri == TopAbs_REVERSED)) {
- myFEGeom = &(ed->ChangeGeometry());
- const HLRBRep_Curve& EC = ed->Geometry();
+ myFEGeom = &(EDataFE1->ChangeGeometry());
+ const HLRBRep_Curve& EC = EDataFE1->Geometry();
p = EC.Parameter3d((EC.LastParameter () +
EC.FirstParameter()) / 2);
if (HLRBRep_EdgeFaceTool::UVPoint(p,myFEGeom,iFaceGeom,pu,pv)) {
mySLProps.SetParameters(pu,pv);
gp_Pnt Pt;
Pt = EC.Value3D(p);
-#ifdef OCC191
if (mySLProps.IsNormalDefined())
-#endif
{
gp_Vec Nm = mySLProps.Normal();
Pt.Transform(T);
myFaceItr1.MoreEdge();
myFaceItr1.NextEdge()) {
myFE = myFaceItr1.Edge();
- HLRBRep_EdgeData* ed = &(myEData(myFE));
- if (!fd->Simple()) ed->AutoIntersectionDone(Standard_False);
- HLRAlgo::DecodeMinMax(ed->MinMax(),
+ HLRBRep_EdgeData* EDataFE2 = &(myEData(myFE));
+ if (!fd->Simple()) EDataFE2->AutoIntersectionDone(Standard_False);
+ HLRAlgo::DecodeMinMax(EDataFE2->MinMax(),
(Standard_Address)EdgeMin,
(Standard_Address)EdgeMax);
if (myFaceItr1.BeginningOfWire())
if (myFEOri == TopAbs_FORWARD ||
myFEOri == TopAbs_REVERSED) {
// Edge from the boundary
- if (!((HLRBRep_EdgeData*)myFEData)->Vertical() && !myFEDouble) {
+ if (!((HLRBRep_EdgeData*)myFEData)->Vertical() && !(myFEDouble && !myFEOutLine)) {
// not a vertical edge and not a double Edge
Standard_Address MinMaxFEdg = ((HLRBRep_EdgeData*)myFEData)->MinMax();
//-- -----------------------------------------------------------------------
}
else {
myNbPoints = myNbSegments = 0;
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "HLRBRep_Data::NextInterference : ";
if (myLE == myFE)
cout << "Edge " << myLE
else {
stbef = TopAbs_OUT;
staft = TopAbs_OUT;
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "HLRBRep_Data::EdgeState : undefined" << endl;
#endif
}
else {
stbef = TopAbs_OUT;
staft = TopAbs_OUT;
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "HLRBRep_Data::EdgeState : undefined" << endl;
#endif
}
else if (p > param + tolpar)
Loop = Standard_False;
else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "HLRBRep_Data::HidingStartLevel : ";
cout << "Bad Parameter." << endl;
#endif
//purpose :
//=======================================================================
-Standard_Boolean
-HLRBRep_Data::OrientOutLine (const Standard_Integer I,
- HLRBRep_FaceData& FD)
+
+Standard_Boolean HLRBRep_Data::OrientOutLine (const Standard_Integer I, HLRBRep_FaceData& FD)
{
+ (void)I; // avoid compiler warning
+
const Handle(HLRAlgo_WiresBlock)& wb = FD.Wires();
Standard_Integer nw = wb->NbWires();
Standard_Integer iw1,ie1,ne1;
(iFaceGeom,pu,pv,V);
gp_Vec Nm = mySLProps.Normal();
if (curv == 0) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "HLRBRep_Data::OrientOutLine " << I;
cout << " Edge " << myFE << " : ";
cout << "CurvatureValue == 0." << endl;
Nm.Transform(T);
Nm.Cross(Tg);
if (Tg.Magnitude() < gp::Resolution()) {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "HLRBRep_Data::OrientOutLine " << I;
cout << " Edge " << myFE << " : ";
cout << "Tg.Magnitude() == 0." << endl;
eb1->Orientation(ie1,myFEOri);
}
else {
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout << "HLRBRep_Data::OrientOutLine " << I;
cout << " Edge " << myFE << " : ";
cout << "UVPoint not found, OutLine not Oriented" << endl;
eb1->Orientation(ie1,myFEOri);
}
}
+#ifdef OCCT_DEBUG
else {
cout << "HLRBRep_Data::OrientOthEdge " << I;
cout << " Edge " << myFE << " : ";
cout << "UVPoint not found, Edge not Oriented" << endl;
}
+#else
+ (void)I; // avoid compiler warning
+#endif
}
}
}
VertMax[15] = (Standard_Integer)((myDeca[15]+TotMax[15])*mySurD[15]);
TopAbs_State
-HLRBRep_Data::Classify (const Standard_Integer /*E*/,
+HLRBRep_Data::Classify (const Standard_Integer E,
const HLRBRep_EdgeData& ED,
const Standard_Boolean LevelFlag,
Standard_Integer& Level,
const Standard_Real param)
{
+ (void)E; // avoid compiler warning
+
nbClassification++;
Standard_Integer VertMin[16],VertMax[16],MinMaxVert[16];
Standard_Real TotMin[16],TotMax[16];
(Standard_Address)VertMax,
(Standard_Address)MinMaxVert);
-
-
-#if 0
+#ifdef OCCT_DEBUG
{
Standard_Integer qwe,qwep8,q,q1,q2;
printf("\n E:%d -------\n",E);
}
#endif
-
-
-
if (((MaxFace1 - MinVert1) & 0x80008000) != 0 ||
((MaxVert1 - MinFace1) & 0x80008000) != 0 ||
((MaxFace2 - MinVert2) & 0x80008000) != 0 ||