X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Edge.h;h=e2851f71b0c08f0390b0c42de2528aa415a7e4e0;hb=833f9ff0035309f13fe854e9dbc2413c1951b07a;hp=afe8243eaf3b5edee49122aeb07ad38d5f78d4ad;hpb=b6a827b5f2b1c61957dc2b22bfa11eba72175413;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Edge.h b/src/GeomAPI/GeomAPI_Edge.h index afe8243ea..e2851f71b 100644 --- a/src/GeomAPI/GeomAPI_Edge.h +++ b/src/GeomAPI/GeomAPI_Edge.h @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomAPI_Edge.hxx -// Created: 24 Jul 2014 -// Author: Artem ZHIDKOV +// Copyright (C) 2014-2017 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, 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// 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 +// #ifndef GeomAPI_Edge_H_ #define GeomAPI_Edge_H_ @@ -13,6 +27,7 @@ class GeomAPI_Pln; class GeomAPI_Pnt; class GeomAPI_Circ; class GeomAPI_Lin; +class GeomAPI_Ellipse; /**\class GeomAPI_Edge * \ingroup DataModel @@ -23,57 +38,93 @@ class GeomAPI_Edge : public GeomAPI_Shape { public: /// Makes an undefined Edge (no geometry). - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Edge(); /// Creation of edge by the edge-shape - GEOMAPI_EXPORT + GEOMAPI_EXPORT GeomAPI_Edge(const std::shared_ptr& theShape); /// Verifies that the edge is a line - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isLine() const; /// Verifies that the edge is a circle - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isCircle() const; /// Verifies that the edge is an arc of circle - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isArc() const; - /// Returns the first vertex coordinates of the edge - GEOMAPI_EXPORT + /// Verifies that the edge is an arc of circle + GEOMAPI_EXPORT + bool isEllipse() const; + + /// Returns the first vertex coordinates of the edge + GEOMAPI_EXPORT std::shared_ptr firstPoint(); - /// Returns the Last vertex coordinates of the edge - GEOMAPI_EXPORT + /// Returns the Last vertex coordinates of the edge + GEOMAPI_EXPORT std::shared_ptr lastPoint(); /// Returns a circle if edge is based on the circle curve - GEOMAPI_EXPORT - std::shared_ptr circle(); + GEOMAPI_EXPORT + std::shared_ptr circle() const; + + /// Returns an ellipse if edge is based on the ellipse curve + GEOMAPI_EXPORT + std::shared_ptr ellipse() const; /// Returns a line if edge is based on the linear curve - GEOMAPI_EXPORT - std::shared_ptr line(); + GEOMAPI_EXPORT + std::shared_ptr line() const; /// Returns true if the current edge is geometrically equal to the given edge - GEOMAPI_EXPORT + GEOMAPI_EXPORT bool isEqual(const std::shared_ptr theEdge) const; /// Returns range of parameter on the curve - GEOMAPI_EXPORT + GEOMAPI_EXPORT void getRange(double& theFirst, double& theLast) const; /// Returns true, if the edge is fully placed in the specified plane + /// \param thePlane a plane for intersection GEOMAPI_EXPORT bool isInPlane(const std::shared_ptr thePlane) const; + /// Returns list of intersection points if the edge has intersections with the given plane + /// \param thePlane a plane for intersection + GEOMAPI_EXPORT + void intersectWithPlane(const std::shared_ptr thePlane, + std::list >& theResult) const; + /// Returns edge length. GEOMAPI_EXPORT double length() const; + + /// Returns true if the edge is closed (like full circle) + GEOMAPI_EXPORT + bool isClosed() const; + + /// Returns true if the edge is degenerated (has no 3D curve) + GEOMAPI_EXPORT + bool isDegenerated() const; + + GEOMAPI_EXPORT + void setFirstPointTolerance(const double theTolerance); + + GEOMAPI_EXPORT + void setLastPointTolerance(const double theTolerance); + + /// Return middle point on the edge + GEOMAPI_EXPORT + virtual std::shared_ptr middlePoint() const; }; +//! Pointer on object +typedef std::shared_ptr GeomEdgePtr; + #endif