//
// 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.
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <TopOpeBRepTool_TOOL.ixx>
+
+#include <Bnd_Box.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepAdaptor_Surface.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Iterator.hxx>
-#include <Precision.hxx>
-#include <BRep_Tool.hxx>
-#include <BRep_Builder.hxx>
+#include <BRepBndLib.hxx>
+#include <BRepLProp_CLProps.hxx>
+#include <ElCLib.hxx>
+#include <Geom2d_Curve.hxx>
#include <Geom2d_Line.hxx>
#include <Geom2dAPI_ProjectPointOnCurve.hxx>
-#include <gp_Pln.hxx>
-#include <gp_Cylinder.hxx>
-#include <gp_Lin.hxx>
+#include <GeomLProp_SLProps.hxx>
#include <gp_Circ.hxx>
+#include <gp_Cone.hxx>
+#include <gp_Cylinder.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Dir2d.hxx>
#include <gp_Elips.hxx>
#include <gp_Hypr.hxx>
+#include <gp_Lin.hxx>
#include <gp_Parab.hxx>
-#include <TopOpeBRepTool_define.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <gp_Sphere.hxx>
+#include <gp_Torus.hxx>
+#include <gp_Vec.hxx>
+#include <gp_Vec2d.hxx>
+#include <NCollection_Array1.hxx>
+#include <Precision.hxx>
+#include <TColStd_Array1OfReal.hxx>
+#include <TColStd_IndexedMapOfReal.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
#include <TopOpeBRepTool.hxx>
-#include <TopOpeBRepTool_EXPORT.hxx>
#include <TopOpeBRepTool_2d.hxx>
+#include <TopOpeBRepTool_C2DF.hxx>
+#include <TopOpeBRepTool_define.hxx>
+#include <TopOpeBRepTool_EXPORT.hxx>
#include <TopOpeBRepTool_ShapeTool.hxx>
+#include <TopOpeBRepTool_TOOL.hxx>
#include <TopTools_DataMapOfIntegerShape.hxx>
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_IndexedMapOfReal.hxx>
-#include <TCollection_CompareOfReal.hxx>
-#include <SortTools_QuickSortOfReal.hxx>
-#include <BRepLProp_CLProps.hxx>
-#include <GeomLProp_SLProps.hxx>
-#include <gp_Torus.hxx>
-#include <gp_Cone.hxx>
-#include <gp_Sphere.hxx>
-#include <Bnd_Box.hxx>
-#include <BRepBndLib.hxx>
-#include <ElCLib.hxx>
+#include <algorithm>
#define M_FORWARD(sta) (sta == TopAbs_FORWARD)
#define M_REVERSED(sta) (sta == TopAbs_REVERSED)
#define M_INTERNAL(sta) (sta == TopAbs_INTERNAL)
Standard_Real par1 = BRep_Tool::Parameter(v1,E);
Standard_Real par2 = BRep_Tool::Parameter(v2,E);
-#ifdef DEB
+#ifdef OCCT_DEBUG
// if (par1>par2) cout<<"TopOpeBRepTool_TOOL::Vertices ERROR"<<endl;
#endif
Standard_Integer ivparSMA = (par1<par2) ? FORWARD : REVERSED;
mapiv.Bind(iv,v);
}
Standard_Integer nv = mapiv.Extent();
- TColStd_Array1OfReal tabpar(1,nv);
+ NCollection_Array1<Standard_Real> tabpar(1,nv);
// for (Standard_Integer i = 1; i <= nv; i++) {
Standard_Integer i ;
for ( i = 1; i <= nv; i++) {
}
TopTools_ListOfShape newlov;
- TCollection_CompareOfReal compare; SortTools_QuickSortOfReal::Sort(tabpar, compare);
+ std::sort (tabpar.begin(), tabpar.end());
for (i = 1; i <= nv; i++) {
Standard_Real par = tabpar.Value(i);
Standard_Integer iv = mappar.FindIndex(par);
Standard_Boolean TopOpeBRepTool_TOOL::TggeomE(const Standard_Real par, const BRepAdaptor_Curve& BC,
gp_Vec& Tg)
{
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
// GeomAbs_CurveType ct =
//#endif
// BC.GetType();
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
// Standard_Boolean apoles = (ct == GeomAbs_BezierCurve)||(ct == GeomAbs_BSplineCurve);
//#endif
if ((!inbounds) && (!onf) && (!onl)) return Standard_False;
Standard_Real thepar = par;
-// if (apoles && (onf || onl)) thepar = onf ? (thepar+tolp) : (thepar-tolp);
gp_Pnt thepnt; BC.D1(thepar, thepnt, Tg);
Tg.Normalize();
gp_Pnt2d uv; Standard_Boolean ok = FUN_tool_paronEF(e,par,f,uv);
if (!ok) return Standard_False;
gp_Dir ng( FUN_tool_nggeomF(uv,f) );
-#ifdef DEB
+#ifdef OCCT_DEBUG
gp_Dir ngApp;
#endif
ok = TopOpeBRepTool_TOOL::NgApp(par,e,f,tola,Ng);
direct = toto.Direct();
}
Standard_Real prod = axis.Dot(tg0);
- Standard_Boolean maxAcurv = FUN_nullprodv(1-Abs(prod));
+ Standard_Boolean isMaxAcurv = FUN_nullprodv(1-Abs(prod));
Standard_Boolean nullcurv = FUN_nullprodv(prod);
Standard_Real prod2 = ngS.Dot(tg0);
if (cyl || cone) nullcurv = nullcurv || FUN_nullprodv(1-Abs(prod2));
if (nullcurv) {curv = 0.; curvdone = Standard_True;}
- if (maxAcurv) {
+ if (isMaxAcurv) {
GeomLProp_SLProps slprops(S,uv0.X(),uv0.Y(),2,Precision::Confusion());
Standard_Boolean curdef = slprops.IsCurvatureDefined();
if (curdef) {
Standard_Boolean & isoU, Standard_Boolean& isoV, gp_Dir2d& d2d, gp_Pnt2d& o2d)
{
Standard_Real f,l,tol; const Handle(Geom2d_Curve)& PC = C2DF.PC(f,l,tol);
-//#ifdef DEB
+//#ifdef OCCT_DEBUG
// const iso = UVISO(PC,isoU,isoV,d2d,o2d);
//#else
const Standard_Boolean iso = UVISO(PC,isoU,isoV,d2d,o2d);
ngF = ng; return Standard_True;
}
}
-#ifdef DEB
+#ifdef OCCT_DEBUG
cout<<"FUN_tool_nggeomF NYI"<<endl;
#endif
return Standard_False;
Standard_Real uf=bs.FirstUParameter(),ul=bs.LastUParameter(),vf=bs.FirstVParameter(),vl=bs.LastVParameter();
Standard_Boolean onuf = (Abs(uf-u)<tolu), onul = (Abs(ul-u)<tolu);
Standard_Boolean onvf = (Abs(vf-v)<tolv), onvl = (Abs(vl-v)<tolv);
- if (onuf) onU = ONFIRST; if (onul) onU = ONLAST;
- if (onvf) onV = ONFIRST; if (onvl) onV = ONLAST;
- if (u < (uf-tolu)) onU = INFFIRST; if (u > (ul+tolu)) onU = SUPLAST;
- if (v < (vf-tolv)) onV = INFFIRST; if (v > (vl+tolv)) onV = SUPLAST;
+ if (onuf) onU = ONFIRST;
+ if (onul) onU = ONLAST;
+ if (onvf) onV = ONFIRST;
+ if (onvl) onV = ONLAST;
+ if (u < (uf-tolu)) onU = INFFIRST;
+ if (u > (ul+tolu)) onU = SUPLAST;
+ if (v < (vf-tolv)) onV = INFFIRST;
+ if (v > (vl+tolv)) onV = SUPLAST;
}
//=======================================================================
gp_Vec tge; Standard_Boolean ok = TopOpeBRepTool_TOOL::TggeomE(par,ed,tge);
if (!ok) return Standard_False;
gp_Vec ngf = FUN_tool_nggeomF(uv,fa);
- Standard_Real prod = tge.Dot(ngf);
- Standard_Boolean etgf = Abs(prod) < tola;
+ Standard_Real aProdDot = tge.Dot(ngf);
+ Standard_Boolean etgf = Abs(aProdDot) < tola;
if (!etgf) return Standard_True;
BRepAdaptor_Surface bs(fa);