]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_ShapeTools.h
Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeTools.h
index 22c8867870bc64c40eb835092d90ecc918d406f4..a96e0b1d9b6306d97e39e9b0f429e5439a5be186 100644 (file)
@@ -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<mailto:webmaster.salome@opencascade.com>
+//
 
 #ifndef GeomAlgoAPI_ShapeTools_H_
 #define GeomAlgoAPI_ShapeTools_H_
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_Vertex.h>
 
+#include <map>
 #include <set>
 
+class GeomAPI_Ax1;
 class GeomAPI_Edge;
 class GeomAPI_Dir;
 class GeomAPI_Face;
 class GeomAPI_PlanarEdges;
 class GeomAPI_Pln;
 class GeomAPI_Pnt;
+class GeomDataAPI_Point2D;
+class ModelAPI_Object;
 
 /// \class GeomAlgoAPI_ShapeTools
 /// \ingroup DataAlgo
@@ -116,19 +134,36 @@ public:
   GEOMALGOAPI_EXPORT static bool isParallel(const std::shared_ptr<GeomAPI_Edge> theEdge,
                                             const std::shared_ptr<GeomAPI_Face> theFace);
 
+  typedef std::map<std::shared_ptr<GeomAPI_Pnt>,
+                   std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D> >,
+                             std::list<std::shared_ptr<ModelAPI_Object> > > > PointToRefsMap;
   /// \brief Performs the split of the shape by points.
   /// \param[in] theBaseShape shape that should be splitted.
   /// \param[in] thePoints container of points to split
   /// \param[out] theShapes container of shapes after split
   GEOMALGOAPI_EXPORT static void splitShape(const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
-                                      const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
+                                      const PointToRefsMap& thePointsInfo,
                                       std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
 
+  /// \brief Performs the split of the shape by points.
+  /// \param[in] theBaseShape shape that should be splitted.
+  /// \param[in] thePoints container of points to split
+  /// \param[out] theShapes container of shapes after split
+  GEOMALGOAPI_EXPORT static void splitShape_p(const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
+                                      const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
+                                      std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
 
   GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> findShape(
                                     const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
                                     const std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
 
+  /// \brief Returns a dir from a shape and an axis.
+  /// \param[in] theBaseShape shape whose center of mass serves as the starting point of the dir.
+  /// \param[in] theAxis axis that serves as a direction for the dir
+  /// \return dir that builds from center of mass of the base shape and the axis
+  GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Dir> buildDirFromAxisAndShape(
+                                    const std::shared_ptr<GeomAPI_Shape> theBaseShape,
+                                    const std::shared_ptr<GeomAPI_Ax1> theAxis);
 };
 
 #endif