mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
Coding - GeomConvert_CurveToAnaCurve warnings fix
This commit is contained in:
parent
392ba7dbb6
commit
33339b0dc2
@ -41,6 +41,7 @@
|
|||||||
#include <math_Matrix.hxx>
|
#include <math_Matrix.hxx>
|
||||||
#include <math_Gauss.hxx>
|
#include <math_Gauss.hxx>
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
|
||||||
GeomConvert_CurveToAnaCurve::GeomConvert_CurveToAnaCurve():
|
GeomConvert_CurveToAnaCurve::GeomConvert_CurveToAnaCurve():
|
||||||
myGap(Precision::Infinite()),
|
myGap(Precision::Infinite()),
|
||||||
@ -650,15 +651,15 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCurve(const Handle(Geom_C
|
|||||||
const GeomConvert_ConvType theConvType, const GeomAbs_CurveType theTarget)
|
const GeomConvert_ConvType theConvType, const GeomAbs_CurveType theTarget)
|
||||||
{
|
{
|
||||||
cf = c1; cl = c2;
|
cf = c1; cl = c2;
|
||||||
Handle(Geom_Curve) c3d, newc3d[3];
|
std::array<Handle(Geom_Curve), 3> newc3d = {};
|
||||||
Standard_Integer i, imin = -1;
|
Handle(Geom_Curve) c3d = theC3d;
|
||||||
c3d = theC3d;
|
if (c3d.IsNull()) return c3d;
|
||||||
if (c3d.IsNull()) return newc3d[imin];
|
|
||||||
gp_Pnt P1 = c3d->Value(c1);
|
gp_Pnt P1 = c3d->Value(c1);
|
||||||
gp_Pnt P2 = c3d->Value(c2);
|
gp_Pnt P2 = c3d->Value(c2);
|
||||||
gp_Pnt P3 = c3d->Value(c1 + (c2 - c1) / 2);
|
gp_Pnt P3 = c3d->Value(c1 + (c2 - c1) / 2);
|
||||||
Standard_Real d[3] = { RealLast(), RealLast(), RealLast() };
|
std::array<Standard_Real, 3> d = { RealLast(), RealLast(), RealLast() };
|
||||||
Standard_Real fp[3], lp[3];
|
std::array<Standard_Real, 3> fp = {};
|
||||||
|
std::array<Standard_Real, 3> lp = {};
|
||||||
|
|
||||||
if (c3d->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
|
if (c3d->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
|
||||||
Handle(Geom_TrimmedCurve) aTc = Handle(Geom_TrimmedCurve)::DownCast(c3d);
|
Handle(Geom_TrimmedCurve) aTc = Handle(Geom_TrimmedCurve)::DownCast(c3d);
|
||||||
@ -723,7 +724,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCurve(const Handle(Geom_C
|
|||||||
|
|
||||||
// theConvType == GeomConvert_MinGap
|
// theConvType == GeomConvert_MinGap
|
||||||
// recognition in case of small curve
|
// recognition in case of small curve
|
||||||
imin = -1;
|
Standard_Integer imin = -1;
|
||||||
if((P1.Distance(P2) < 2*tolerance) && (P1.Distance(P3) < 2*tolerance)) {
|
if((P1.Distance(P2) < 2*tolerance) && (P1.Distance(P3) < 2*tolerance)) {
|
||||||
newc3d[1] = ComputeCircle(c3d, tolerance, c1, c2, fp[1], lp[1], d[1]);
|
newc3d[1] = ComputeCircle(c3d, tolerance, c1, c2, fp[1], lp[1], d[1]);
|
||||||
newc3d[0] = ComputeLine(c3d, tolerance, c1, c2, fp[0], lp[0], d[0]);
|
newc3d[0] = ComputeLine(c3d, tolerance, c1, c2, fp[0], lp[0], d[0]);
|
||||||
@ -746,7 +747,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCurve(const Handle(Geom_C
|
|||||||
newc3d[2] = ComputeEllipse(c3d, tol, c1, c2, fp[2], lp[2], d[2]);
|
newc3d[2] = ComputeEllipse(c3d, tol, c1, c2, fp[2], lp[2], d[2]);
|
||||||
}
|
}
|
||||||
Standard_Real dd = RealLast();
|
Standard_Real dd = RealLast();
|
||||||
for (i = 0; i < 3; ++i)
|
for (Standard_Integer i = 0; i < 3; ++i)
|
||||||
{
|
{
|
||||||
if (newc3d[i].IsNull()) continue;
|
if (newc3d[i].IsNull()) continue;
|
||||||
if (d[i] < dd)
|
if (d[i] < dd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user