mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0024096: Eliminate compiler warning C4505 in MSVC++ with warning level 4
Removed obsolete functions from sources. Some useful debug functions were 'defined' ( put into #ifdef ...#endif ) Removed some redundant code
This commit is contained in:
@@ -71,12 +71,6 @@
|
||||
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
|
||||
static Standard_Boolean IsFromFirstToSecond(const TopoDS_Edge& theEdge,
|
||||
const Standard_Real theParameterOnUEdge,
|
||||
const TopoDS_Edge& theUEdge1,
|
||||
const TopoDS_Edge& theUEdge2,
|
||||
const TopoDS_Face& theFace);
|
||||
|
||||
static Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
|
||||
const Standard_Integer theEIndex1,
|
||||
const Standard_Integer theEIndex2,
|
||||
@@ -205,12 +199,6 @@ static Standard_Boolean ChooseSection(const TopoDS_Shape& Comp,
|
||||
gp_Pln& resPlane,
|
||||
Standard_Boolean& IsSingular);
|
||||
|
||||
static Standard_Boolean ChoosePlane(const TopoDS_Shape& Comp,
|
||||
const gp_Ax2& bis,
|
||||
gp_Pln& resPlane,
|
||||
TopoDS_Compound& NewComp);
|
||||
|
||||
|
||||
// ===========================================================================================
|
||||
// function: Constructor
|
||||
// purpose:
|
||||
@@ -1008,53 +996,6 @@ Standard_Boolean FindCommonVertex(const BOPDS_PDS& theDS,
|
||||
return bvertexfound;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// static function: IsFromFirstToSecond
|
||||
// purpose:
|
||||
// ------------------------------------------------------------------------------------------
|
||||
Standard_Boolean IsFromFirstToSecond(const TopoDS_Edge& theEdge,
|
||||
const Standard_Real theParameterOnUEdge,
|
||||
const TopoDS_Edge& theUEdge1,
|
||||
const TopoDS_Edge& theUEdge2,
|
||||
const TopoDS_Face& theFace) {
|
||||
TopoDS_Face aFace = theFace;
|
||||
aFace.Orientation(TopAbs_FORWARD);
|
||||
TopoDS_Edge E1, E2;
|
||||
TopExp_Explorer anExp(aFace, TopAbs_EDGE);
|
||||
|
||||
for(; anExp.More(); anExp.Next()) {
|
||||
if(E1.IsNull() && theUEdge1.IsSame(anExp.Current())) {
|
||||
E1 = TopoDS::Edge(anExp.Current());
|
||||
}
|
||||
else if(E2.IsNull() && theUEdge2.IsSame(anExp.Current())) {
|
||||
E2 = TopoDS::Edge(anExp.Current());
|
||||
}
|
||||
}
|
||||
|
||||
if(E1.IsNull() || E2.IsNull())
|
||||
return Standard_True;
|
||||
|
||||
gp_Pnt2d PU1, PU2, pf, pl;
|
||||
Standard_Real f, l;
|
||||
Handle(Geom2d_Curve) C1 = BRep_Tool::CurveOnSurface(E1, aFace, f, l);
|
||||
Handle(Geom2d_Curve) C2 = BRep_Tool::CurveOnSurface(E2, aFace, f, l);
|
||||
Handle(Geom2d_Curve) CC = BRep_Tool::CurveOnSurface(theEdge, aFace, f, l);
|
||||
PU1 = C1->Value(theParameterOnUEdge);
|
||||
PU2 = C2->Value(theParameterOnUEdge);
|
||||
BRep_Tool::Range(theEdge, f, l);
|
||||
pf = CC->Value(f);
|
||||
pl = CC->Value(l);
|
||||
Standard_Real aTolerance = Precision::Confusion();
|
||||
|
||||
if(pf.Distance(PU1) < aTolerance)
|
||||
return Standard_True;
|
||||
|
||||
if(pl.Distance(PU2) < aTolerance)
|
||||
return Standard_True;
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// static function: GetUEdges
|
||||
// purpose:
|
||||
@@ -2221,174 +2162,3 @@ static Standard_Boolean ChooseSection(const TopoDS_Shape& Comp,
|
||||
return Standard_False;
|
||||
//end of simplest case
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ChoosePlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
static Standard_Boolean ChoosePlane(const TopoDS_Shape& Comp,
|
||||
const gp_Ax2& bis,
|
||||
gp_Pln& resPlane,
|
||||
TopoDS_Compound& NewComp)
|
||||
{
|
||||
Standard_Real TolConf = 1.e-4, TolAng = 1.e-5;
|
||||
|
||||
Standard_Integer N = 100;
|
||||
Standard_Integer Eind, ind, i, j;
|
||||
TopTools_SequenceOfShape Eseq;
|
||||
TopExp_Explorer Explo( Comp, TopAbs_EDGE );
|
||||
for (; Explo.More(); Explo.Next())
|
||||
Eseq.Append( Explo.Current() );
|
||||
|
||||
Standard_Integer NumberOfEdges = Eseq.Length();
|
||||
TColgp_Array2OfPnt Points( 0, NumberOfEdges*2-1, 1, N/4 );
|
||||
|
||||
for (Eind = 0; Eind < NumberOfEdges; Eind++)
|
||||
{
|
||||
TopoDS_Edge anEdge = TopoDS::Edge( Eseq(Eind+1) );
|
||||
BRepAdaptor_Curve aCurve(anEdge);
|
||||
GCPnts_UniformAbscissa Distribution( aCurve, N+1 );
|
||||
for (i = 1; i <= N/4; i++)
|
||||
{
|
||||
Standard_Real par = Distribution.Parameter(i);
|
||||
Points( Eind*2, i ) = aCurve.Value(par);
|
||||
}
|
||||
for (i = 3*N/4+2; i <= N+1; i++)
|
||||
{
|
||||
Standard_Real par = Distribution.Parameter(i);
|
||||
Points( Eind*2+1, i-3*N/4-1 ) = aCurve.Value(par);
|
||||
}
|
||||
}
|
||||
|
||||
TColgp_Array1OfPnt Origins( 0, NumberOfEdges*2-1 );
|
||||
TColgp_Array1OfDir Normals( 0, NumberOfEdges*2-1 );
|
||||
TColStd_Array1OfBoolean IsSingular( 0, NumberOfEdges*2-1 );
|
||||
Standard_Real MinAngle = M_PI/2;
|
||||
Standard_Integer MinInd;
|
||||
for (ind = 0; ind < NumberOfEdges*2; ind++)
|
||||
{
|
||||
TColgp_Array1OfPnt pnts( 1, N/4 );
|
||||
for (i = 1; i <= N/4; i++)
|
||||
pnts(i) = Points( ind, i );
|
||||
gp_Ax2 Axe;
|
||||
GeomLib::AxeOfInertia( pnts, Axe, IsSingular(ind) );
|
||||
if (!IsSingular(ind))
|
||||
{
|
||||
Origins(ind) = Axe.Location();
|
||||
Normals(ind) = Axe.Direction();
|
||||
Standard_Real Angle = bis.Angle( Axe );
|
||||
if (Angle > M_PI/2)
|
||||
Angle = M_PI - Angle;
|
||||
if (Angle < MinAngle)
|
||||
{
|
||||
MinAngle = Angle;
|
||||
MinInd = ind;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gp_Ax2 TheAxe( Origins(MinInd), Normals(MinInd) );
|
||||
Standard_Real MaxAngleWithPln = M_PI/16;
|
||||
TColStd_SequenceOfInteger iseq;
|
||||
TColgp_SequenceOfPnt Pseq;
|
||||
for (ind = 0; ind < NumberOfEdges*2; ind++)
|
||||
if (!IsSingular(ind))
|
||||
{
|
||||
Standard_Real Angle = Normals(ind).Angle( TheAxe.Direction() );
|
||||
if (Angle > M_PI/2)
|
||||
Angle = M_PI - Angle;
|
||||
if (Angle <= MaxAngleWithPln)
|
||||
{
|
||||
iseq.Append(ind);
|
||||
for (j = 1; j <= N/4; j++)
|
||||
Pseq.Append( Points(ind,j) );
|
||||
}
|
||||
}
|
||||
|
||||
TColgp_Array1OfPnt Parray( 1, Pseq.Length() );
|
||||
for (i = 1; i <= Parray.Length(); i++)
|
||||
Parray(i) = Pseq(i);
|
||||
Standard_Boolean issing;
|
||||
GeomLib::AxeOfInertia( Parray, TheAxe, issing );
|
||||
resPlane = gp_Pln( TheAxe );
|
||||
|
||||
i = 1;
|
||||
BRep_Builder B;
|
||||
B.MakeCompound(NewComp);
|
||||
while (i <= iseq.Length())
|
||||
{
|
||||
Standard_Integer ind0 = iseq(i);
|
||||
if (IsEven(ind0) && i < iseq.Length() && iseq(i+1) == ind0+1) //the whole edge
|
||||
{
|
||||
B.Add( NewComp, Eseq(ind0/2+1) );
|
||||
i += 2;
|
||||
}
|
||||
else
|
||||
i++;
|
||||
}
|
||||
|
||||
Standard_Integer slen = Pseq.Length();
|
||||
for (ind = 0; ind < NumberOfEdges*2; ind += 2)
|
||||
{
|
||||
Standard_Integer IndSing = -1, IndNotSing = -1;
|
||||
gp_Lin aLine;
|
||||
if (IsSingular(ind) && IsSingular(ind+1))
|
||||
{
|
||||
Standard_Boolean OnPlane0 = Standard_False, OnPlane1 = Standard_False;
|
||||
aLine = gce_MakeLin( Points(ind, 1), Points(ind, N/4) );
|
||||
if (resPlane.Contains( aLine, TolConf, TolAng ))
|
||||
{
|
||||
for (j = 1; j <= N/4; j++)
|
||||
Pseq.Append( Points(ind,j) );
|
||||
OnPlane0 = Standard_True;
|
||||
}
|
||||
aLine = gce_MakeLin( Points(ind+1, 1), Points(ind+1, N/4) );
|
||||
if (resPlane.Contains( aLine, TolConf, TolAng ))
|
||||
{
|
||||
for (j = 1; j <= N/4; j++)
|
||||
Pseq.Append( Points(ind+1,j) );
|
||||
OnPlane1 = Standard_True;
|
||||
}
|
||||
if (OnPlane0 && OnPlane1)
|
||||
B.Add( NewComp, Eseq(ind/2+1) );
|
||||
}
|
||||
else if (IsSingular(ind))
|
||||
{
|
||||
IndSing = ind;
|
||||
IndNotSing = ind+1;
|
||||
}
|
||||
else if (IsSingular(ind+1))
|
||||
{
|
||||
IndNotSing = ind;
|
||||
IndSing = ind+1;
|
||||
}
|
||||
if (IndSing != -1 && IndNotSing != -1)
|
||||
{
|
||||
aLine = gce_MakeLin( Points(IndSing, 1), Points(IndSing, N/4) );
|
||||
if (resPlane.Contains( aLine, TolConf, TolAng ))
|
||||
{
|
||||
for (j = 1; j <= N/4; j++)
|
||||
Pseq.Append( Points(IndSing,j) );
|
||||
|
||||
for (i = 1; i <= iseq.Length(); i++)
|
||||
if (iseq(i) == IndNotSing)
|
||||
break;
|
||||
if (i <= iseq.Length())
|
||||
B.Add( NewComp, Eseq(ind/2+1) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Recompute the axe of plane
|
||||
if (Pseq.Length() > slen)
|
||||
{
|
||||
TColgp_Array1OfPnt Parray2( 1, Pseq.Length() );
|
||||
for (i = 1; i <= Parray2.Length(); i++)
|
||||
Parray2(i) = Pseq(i);
|
||||
GeomLib::AxeOfInertia( Parray2, TheAxe, issing );
|
||||
resPlane = gp_Pln( TheAxe );
|
||||
}
|
||||
|
||||
//Temporary
|
||||
return Standard_True;
|
||||
}
|
||||
|
Reference in New Issue
Block a user