Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / ModelGeomAlgo / ModelGeomAlgo_Shape.h
index 847b01b3e57903181234da19def1be8a5e3c2813..2354e8049b3bcf2e845b3e8793b4465f2465bf1f 100644 (file)
@@ -1,8 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        ModelGeomAlgo_Point2D.h
-// Created:     20 Jul 2016
-// Author:      Natalia ERMOLAEVA
+// 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 ModelGeomAlgo_Shape_H
 #define ModelGeomAlgo_Shape_H
@@ -25,6 +39,27 @@ namespace ModelGeomAlgo_Shape {
                               const std::shared_ptr<ModelAPI_Feature>& theFeature,
                               const GeomAPI_Shape::ShapeType& theType,
                               std::set<std::shared_ptr<ModelAPI_Result> >& theShapeResults);
+
+  struct SubshapeOfResult
+  {
+    std::shared_ptr<ModelAPI_Result> myResult;
+    std::shared_ptr<GeomAPI_Shape> mySubshape;
+    int myCenterType;
+  };
+
+  /// Searches a sub-shape in the results of the given features,
+  /// which contains the given point.
+  /// \param[in]  theFeature    feature, which results are being processed
+  /// \param[in]  thePoint      selected point which identifies the shape
+  /// \param[in]  theShapeType  type of the selected shape
+  /// \param[out] theSelected   applicable result, sub-shape of the found result and
+  ///                           type of the point if it is a center of circle or a focus of ellipse
+  /// \return \c true if the result and its applicable sub-shape are found
+  MODELGEOMALGO_EXPORT bool findSubshapeByPoint(
+                              const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                              const std::shared_ptr<GeomAPI_Pnt>& thePoint,
+                              const GeomAPI_Shape::ShapeType& theShapeType,
+                              std::list<SubshapeOfResult>& theSelected);
 }
 
 #endif