Salome HOME
updated copyright message
[modules/shaper.git] / src / ModelGeomAlgo / ModelGeomAlgo_Point2D.h
old mode 100755 (executable)
new mode 100644 (file)
index 6e717c1..471c973
@@ -1,8 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        ModelGeomAlgo_Point2D.h
-// Created:     20 Jul 2016
-// Author:      Natalia ERMOLAEVA
+// Copyright (C) 2014-2023  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 ModelGeomAlgo_Point2D_H
 #define ModelGeomAlgo_Point2D_H
@@ -24,8 +37,9 @@ class GeomDataAPI_Point2D;
 #include <map>
 
 
-namespace ModelGeomAlgo_Point2D {
-
+class ModelGeomAlgo_Point2D
+{
+public:
   /// Searches Point2D attribute of reference of the attribute of given feature
   /// \param theFeature a feature to obtain AttributeRefAttr
   /// \param theAttribute a name of AttributeRefAttr on the given feature
@@ -33,7 +47,7 @@ namespace ModelGeomAlgo_Point2D {
   /// \param theObjectFeatureAttribute a feature attribute in object that satisfies the search
   /// \param isSkipFeatureAttributes a boolean value if coincidences to the feature attributes
   /// \returns found point attribute or NULL
-  MODELGEOMALGO_EXPORT std::shared_ptr<GeomDataAPI_Point2D> getPointOfRefAttr(
+  static MODELGEOMALGO_EXPORT std::shared_ptr<GeomDataAPI_Point2D> getPointOfRefAttr(
                         ModelAPI_Feature* theFeature,
                         const std::string& theAttribute,
                         const std::string& theObjectFeatureKind = "",
@@ -50,7 +64,8 @@ namespace ModelGeomAlgo_Point2D {
   /// \param isSkipFeatureAttributes a boolean value if coincidences to the feature attributes
   /// should be skipped
   /// \returns found point attribute or NULL
-  MODELGEOMALGO_EXPORT void getPointsOfReference(const std::shared_ptr<ModelAPI_Object>& theObject,
+  static MODELGEOMALGO_EXPORT
+        void getPointsOfReference(const std::shared_ptr<ModelAPI_Object>& theObject,
                                   const std::string& theReferenceFeatureKind,
                                   std::set<std::shared_ptr<GeomDataAPI_Point2D> >& theAttributes,
                                   const std::string& theObjectFeatureKind = "",
@@ -66,11 +81,15 @@ namespace ModelGeomAlgo_Point2D {
                    std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D> >,
                              std::list<std::shared_ptr<ModelAPI_Object> > > > PointToRefsMap;
 
-  MODELGEOMALGO_EXPORT void getPointsIntersectedShape(
+  static MODELGEOMALGO_EXPORT void getPointsIntersectedShape(
                   const std::shared_ptr<ModelAPI_Feature>& theBaseFeature,
                   const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
                   PointToRefsMap& thePointToAttributeOrObject);
 
+  static MODELGEOMALGO_EXPORT std::list<std::shared_ptr<GeomAPI_Pnt> > getSetOfPntIntersectedShape(
+                  const std::shared_ptr<ModelAPI_Feature>& theBaseFeature,
+                  const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures);
+
   /// Removes attributes which points are out of the base shape
   /// \param theBaseShape a shape of check
   /// \param theAttributes a container of point 2D attributes
@@ -79,7 +98,7 @@ namespace ModelGeomAlgo_Point2D {
   /// \param theDirY plane X direction to generate 3D point by 2D attribute point
   /// \param thePoints a container of 3D points belong to the shape
   /// \param theAttributeToPoint a container of attribute to point
-  MODELGEOMALGO_EXPORT void getPointsInsideShape(
+  static MODELGEOMALGO_EXPORT void getPointsInsideShape(
                         const std::shared_ptr<GeomAPI_Shape> theBaseShape,
                         const std::set<std::shared_ptr<GeomDataAPI_Point2D> >& theAttributes,
                         const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
@@ -95,7 +114,7 @@ namespace ModelGeomAlgo_Point2D {
   /// \param theDirY plane X direction to generate 3D point by 2D attribute point
   /// \param thePoints a container of 3D points belong to the shape
   /// \param theAttributeToPoint a container of attribute to point
-  MODELGEOMALGO_EXPORT void getPointsInsideShape_p(
+  static MODELGEOMALGO_EXPORT void getPointsInsideShape_p(
                               const std::shared_ptr<GeomAPI_Shape> theBaseShape,
                               const std::set<std::shared_ptr<GeomDataAPI_Point2D> >& theAttributes,
                               const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
@@ -104,12 +123,20 @@ namespace ModelGeomAlgo_Point2D {
                               std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
                               std::map<std::shared_ptr<GeomDataAPI_Point2D>,
                                        std::shared_ptr<GeomAPI_Pnt> >& theAttributeToPoint);
-
   /// Finds projected point to the given shape line
   /// \param theBaseShape a shape of check
   /// \param thePoint [in] a point to project
   /// \param theProjectedPoint [out] a projected point
-  MODELGEOMALGO_EXPORT bool isPointOnEdge(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
+  static MODELGEOMALGO_EXPORT bool isPointOnEdge(const std::shared_ptr<GeomAPI_Shape> theBaseShape,
+                                          const std::shared_ptr<GeomAPI_Pnt>& thePoint,
+                                          std::shared_ptr<GeomAPI_Pnt>& theProjectedPoint);
+
+  /// Finds projected point to the given shape, which does not placed on the shape boundaries
+  /// \param theBaseShape a shape of check
+  /// \param thePoint [in] a point to project
+  /// \param theProjectedPoint [out] a projected point
+  static MODELGEOMALGO_EXPORT bool isInnerPointOnEdge(
+                                          const std::shared_ptr<GeomAPI_Shape> theBaseShape,
                                           const std::shared_ptr<GeomAPI_Pnt>& thePoint,
                                           std::shared_ptr<GeomAPI_Pnt>& theProjectedPoint);
 
@@ -118,17 +145,17 @@ namespace ModelGeomAlgo_Point2D {
   /// \param theFeature an investigated feature
   /// \param theAttributesOnly a container of necessary attributes, if empty, all
   /// \return string value
-  MODELGEOMALGO_EXPORT std::string getPontAttributesInfo(
-                           const std::shared_ptr<ModelAPI_Feature>& theFeature,
-                           const std::set<std::shared_ptr<ModelAPI_Attribute> >& theAttributesOnly);
+  static MODELGEOMALGO_EXPORT std::string getPontAttributesInfo(
+                      const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                      const std::set<std::shared_ptr<ModelAPI_Attribute> >& theAttributesOnly);
 
   /// Return point attribute string info
   /// \param theAttribute an investigated attribute
   /// \return string value
-  MODELGEOMALGO_EXPORT std::string getPointAttributeInfo(
-                                  const std::shared_ptr<ModelAPI_Attribute>& theAttribute);
+  static MODELGEOMALGO_EXPORT std::string getPointAttributeInfo(
+                      const std::shared_ptr<ModelAPI_Attribute>& theAttribute);
 
 #endif
-}
+};
 
 #endif