X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_ShapeTools.h;h=af2a81f5c3e1580ecb5ccfb6fac7a98a6dcfb439;hb=5fb6a80c4e86e21b1181b4e6ee940d946b5c52e4;hp=a45e54d4ae6ac85db753361e3fa3ed4d64ee74fa;hpb=42394362cfec9b39f7def70c83e99c77a48fdfe5;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h index a45e54d4a..af2a81f5c 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomAlgoAPI_ShapeTools.h -// Created: 3 August 2015 -// Author: Dmitry Bobylev +// 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 GeomAlgoAPI_ShapeTools_H_ #define GeomAlgoAPI_ShapeTools_H_ @@ -22,6 +36,7 @@ class GeomAPI_Face; class GeomAPI_PlanarEdges; class GeomAPI_Pln; class GeomAPI_Pnt; +class GeomAPI_Wire; class GeomDataAPI_Point2D; class ModelAPI_Object; @@ -34,6 +49,9 @@ public: /// \return the total volume of the solids of the current shape or 0.0 if it can be computed. GEOMALGOAPI_EXPORT static double volume(const std::shared_ptr theShape); + /// \return the total area of the faces of the current shape or 0.0 if it can be computed. + GEOMALGOAPI_EXPORT static double area(const std::shared_ptr theShape); + /// \return the centre of mass of the current face. /// The coordinates returned for the center of mass /// are expressed in the absolute Cartesian coordinate system. @@ -41,6 +59,14 @@ public: GEOMALGOAPI_EXPORT static std::shared_ptr centreOfMass(const std::shared_ptr theShape); + /// \brief Obtain radius of cylindrical face. + /// Return negative value if the face is not a cylinder + GEOMALGOAPI_EXPORT static double radius(const std::shared_ptr& theCylinder); + + /// \brief Calculate minimal distance between shapes + GEOMALGOAPI_EXPORT static double minimalDistance(const GeomShapePtr& theShape1, + const GeomShapePtr& theShape2); + /// \brief Combines faces with common edges to shells, or solids to compsolids. /// \param[in] theCompound compound of shapes. /// \param[in] theType type of combine. @@ -120,6 +146,13 @@ public: GEOMALGOAPI_EXPORT static bool isParallel(const std::shared_ptr theEdge, const std::shared_ptr theFace); + // Computes intersection point between the edge curve and a face surface (only one point, with + // preferences to point that belongs to edge and face boundaries. + /// \returns null if there is no intersection + GEOMALGOAPI_EXPORT static std::list > intersect( + const std::shared_ptr theEdge, const std::shared_ptr theFace, + const bool thePointsOutsideFace); + typedef std::map, std::pair >, std::list > > > PointToRefsMap; @@ -150,6 +183,15 @@ public: GEOMALGOAPI_EXPORT static std::shared_ptr buildDirFromAxisAndShape( const std::shared_ptr theBaseShape, const std::shared_ptr theAxis); + + /// \brief Reapproximate a wire to build a single edge + GEOMALGOAPI_EXPORT static std::shared_ptr wireToEdge( + const std::shared_ptr& theWire); + + /// \brief Get non-composite sub-shapes of the given shape. + /// \param[in] theShape shape that should be exploded + /// \return list of sub-shapes (vertices, edges, faces, solids) + GEOMALGOAPI_EXPORT static ListOfShape getLowLevelSubShapes(const GeomShapePtr& theShape); }; #endif