Salome HOME
updated copyright message
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Tools.h
index 74193772e09097fa388e8289ff3f2fb841ac25e6..83212febf6c706c448fbfee1a9d722dfe89f42fd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -26,7 +26,9 @@
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_AttributeRefAttr.h>
 #include <GeomAPI_Shape.h>
+#include <GeomAPI_AISObject.h>
 #include <GeomDataAPI_Point2D.h>
+#include <GeomDataAPI_Point2DArray.h>
 #include <GeomAlgoAPI_ShapeTools.h>
 
 #include <list>
@@ -48,7 +50,7 @@ void clearExpressions(FeaturePtr theFeature);
 std::shared_ptr<GeomAPI_Pnt2d> getCoincidencePoint(const FeaturePtr theStartCoin);
 
 /// Find all Coincident constraints referred to the feature or its attribute
-std::set<FeaturePtr> findCoincidentConstraints(const FeaturePtr& theFeature);
+std::set<FeaturePtr> findCoincidentConstraints(const ObjectPtr& theObject);
 
 /// Finds lines coincident at point
 /// \param[in] theStartCoin coincidence feature
@@ -135,9 +137,19 @@ void convertRefAttrToPointOrTangentCurve(const AttributeRefAttrPtr&      theRefA
                                          std::shared_ptr<GeomAPI_Shape>& theTangentCurve,
                                          std::shared_ptr<GeomAPI_Pnt2d>& thePassingPoint);
 
-
 /// Calculate global coordinates for flyout point of Length constraint
 GeomPnt2dPtr flyoutPointCoordinates(const std::shared_ptr<SketchPlugin_Constraint>& theConstraint);
+
+/// Sets attributes of feature presentation
+/// \param[in] thePrs a presentation
+/// \param[in] isAxiliary is axiliary flag
+void customizeFeaturePrs(const AISObjectPtr& thePrs, bool isAxiliary);
+
+void setDimensionColor(const AISObjectPtr& theDimPrs);
+
+/// Replace string in the name of object
+void replaceInName(ObjectPtr theObject, const std::wstring& theSource, const std::wstring& theDest);
+
 }; // namespace SketchPlugin_Tools
 
 namespace SketchPlugin_SegmentationTools
@@ -206,6 +218,25 @@ namespace SketchPlugin_SegmentationTools
   /// \param theFeaturesToUpdate a constraint index
   void updateFeaturesAfterOperation(const std::set<FeaturePtr>& theFeaturesToUpdate);
 
+
+  /// Creates a line feature filled by center of base feature and given points
+  /// \param theBaseFeature another arc feature
+  /// \param theFirstAttribute an attribute with coordinates for the start point
+  /// \param theSecondAttribute an attribute with coordinates for the end point
+  FeaturePtr createLineFeature(const FeaturePtr& theBaseFeature,
+                               const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPoint,
+                               const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint);
+
+  /// Creates a circular/elliptic arc feature filled by center
+  /// (or by center and focus for elliptic arc) of base feature and given points
+  /// \param theBaseFeature     another circle or ellipse or circular/elliptic arc
+  /// \param theFirstAttribute  an attribute with coordinates for the start point
+  /// \param theSecondAttribute an attribute with coordinates for the end point
+  FeaturePtr createArcFeature(
+      const FeaturePtr& theBaseFeature,
+      const std::shared_ptr<GeomAPI_Pnt2d>& theFirstPoint,
+      const std::shared_ptr<GeomAPI_Pnt2d>& theSecondPoint);
+
 }; // namespace SketchPlugin_SegmentationTools
 
 #endif // SKETCHPLUGIN_TOOLS_H_
\ No newline at end of file