Salome HOME
Update viewer after selection clear for OCCT 7.4.0.
[modules/shaper.git] / src / PartSet / PartSet_Tools.h
index 250e82a19119653cb83bf5b71f2b0768026f4f68..574ecc5b4221c00a379af6b1f7e5f9b3961cf04d 100644 (file)
@@ -193,9 +193,11 @@ public:
   * \param theObj - an object
   * \param theShape - a Shape
   * \param theSketch - a Sketch to get a plane of converting to 2d
+  * \return Found attribute and index of point if the attribute is an array
   */
-  static AttributePtr findAttributeBy2dPoint(ObjectPtr theObj, const TopoDS_Shape theShape,
-                                             FeaturePtr theSketch);
+  static std::pair<AttributePtr, int> findAttributeBy2dPoint(ObjectPtr theObj,
+                                                             const TopoDS_Shape theShape,
+                                                             FeaturePtr theSketch);
 
   /**
   * Finds an attribute value in attribute reference attribute value
@@ -216,7 +218,7 @@ public:
 
   /**
   * Convertes parameters into a geom point
-  * \theEvent a Qt event to find mouse position
+  * \param theEvent a Qt event to find mouse position
   * \param theWindow view window to define eye of view
   * \param theSketch to convert 3D point coordinates into coorditates of the sketch plane
   */
@@ -224,6 +226,16 @@ public:
                                                  ModuleBase_IViewWindow* theWindow,
                                                  const FeaturePtr& theSketch);
 
+  /** Returns point 2d from selected shape
+   *  \param theView a view window
+   *  \param theShape a vertex shape
+   *  \param theX an output value of X coordinate
+   *  \param theY an output value of Y coordinate
+   */
+  static std::shared_ptr<GeomAPI_Pnt2d> getPnt2d(const Handle(V3d_View)& theView,
+                                                 const TopoDS_Shape& theShape,
+                                                 const FeaturePtr& theSketch);
+
   /**
   * Gets all references to the feature, take coincidence constraint features, get point 2d attributes
   * and compare the point value to be equal with the given. Returns the first feature, which has