// C++ : Gestion des soous-shapes
-// Copyright (C) 2009-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/
-// or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
//--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
#include "HexEdgeShape.hxx"
#include <GCPnts_AbscissaPoint.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <Geom_Circle.hxx>
+
+/****************
+#include <Standard_Stream.hxx>
+#include <GEOMImpl_IMeasureOperations.hxx>
+#include <GEOMImpl_Types.hxx>
+#include <GEOMImpl_MeasureDriver.hxx>
+#include <GEOMImpl_IMeasure.hxx>
+#include <GEOMImpl_IShapesOperations.hxx>
+#include <GEOMUtils.hxx>
+#include <GEOMAlgo_ShapeInfo.hxx>
+#include <GEOMAlgo_ShapeInfoFiller.hxx>
+*********************************/
BEGIN_NAMESPACE_HEXA
lin_end [dir_x] = lin_end [dir_y] = lin_end [dir_z] = 0;
par_mini = 0;
par_maxi = 0;
+ lin_radius = 0;
+ lin_angle = 0;
}
// ====================================================== getCurve
BRepAdaptor_Curve* EdgeShape::getCurve ()
else
return NOTHING;
}
+// ========================================================= definedBy
+bool EdgeShape::definedBy (double p1[], double p2[])
+{
+ if (maj_curve)
+ updateCurve ();
+
+ bool rep = false;
+ if (samePoints (p1, lin_start))
+ rep = samePoints (p2, lin_end);
+ else if (samePoints (p1, lin_end))
+ rep = samePoints (p2, lin_start);
+ return rep;
+}
// ========================================================= getParam
double EdgeShape::getParam (double* coord)
{
return -1.0;
GeomAdaptor_Curve adapt_curve (handle);
+
+/******************
+ enum GeomAbs_CurveType { GeomAbs_Line, GeomAbs_Circle, GeomAbs_Ellipse,
+ GeomAbs_Hyperbola, GeomAbs_Parabola, GeomAbs_BezierCurve,
+ GeomAbs_BSplineCurve, GeomAbs_OtherCurve };
+ **********************/
+
double abscis = GCPnts_AbscissaPoint::Length (adapt_curve, umin, gparam);
double hparam = abscis/lin_length;
is_associated = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ // ------- Cf GEOMImpl_IMeasureOperations.cxx
+
// ====================================================== updateCurve
void EdgeShape::updateCurve ()
{
// Extremites
getPoint (0, lin_start);
getPoint (1, lin_end);
+
+ lin_radius = lin_angle = 0;
+ kind_of = (EnumKindOfShape) adapt_curve.GetType();
+#ifndef NO_CASCADE
+ if (kind_of==KS_Circle)
+ {
+ Handle(Geom_Circle) hgc = Handle(Geom_Circle)::DownCast (handle);
+ lin_radius = hgc->Radius ();
+ lin_angle = (par_maxi-par_mini)*180/M_PI;
+ }
+#endif
+}
+// ====================================================== getAngle
+double EdgeShape::getAngle ()
+{
+ if (maj_curve)
+ updateCurve ();
+
+ return lin_angle;
+}
+// ====================================================== getRadius
+double EdgeShape::getRadius ()
+{
+ if (maj_curve)
+ updateCurve ();
+
+ return lin_radius;
+}
+// ====================================================== getRadius
+EnumKindOfShape EdgeShape::kindOf ()
+{
+ if (maj_curve)
+ updateCurve ();
+
+ return kind_of;
}
END_NAMESPACE_HEXA