X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FPartSet%2FPartSet_Tools.h;h=38ad4db8974b6dacbec08eb220e397174e500da4;hb=64bd95cebe79a5639800635efb7b0d21f13c079c;hp=2e88b022bca0e8f4be6f98c87e30b2d9f25151e4;hpb=29e92b65cd20fe014dc7d946034cc47e500e21e1;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Tools.h b/src/PartSet/PartSet_Tools.h old mode 100755 new mode 100644 index 2e88b022b..38ad4db89 --- a/src/PartSet/PartSet_Tools.h +++ b/src/PartSet/PartSet_Tools.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 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 @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef PartSet_Tools_H @@ -27,6 +26,7 @@ #include #include +#include #include #include @@ -144,6 +144,11 @@ public: /// \return API object of geom plane static std::shared_ptr sketchPlane(CompositeFeaturePtr theSketch); + /// Create a sketch plane instance + /// \param theSketch a sketch feature + /// \return API object of geom plane + static void nullifySketchPlane(CompositeFeaturePtr theSketch); + /// Create a point 3D on a basis of point 2D and sketch feature /// \param thePoint2D a point on a sketch /// \param theSketch a sketch feature @@ -188,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 findAttributeBy2dPoint(ObjectPtr theObj, + const TopoDS_Shape theShape, + FeaturePtr theSketch); /** * Finds an attribute value in attribute reference attribute value @@ -211,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 */ @@ -219,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 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 @@ -293,7 +310,31 @@ public: FeaturePtr& theCreatedFeature); - static void getFirstAndLastIndexInFolder(const ObjectPtr& theFolder, int& theFirst, int& theLast); + static void getFirstAndLastIndexInFolder(const ObjectPtr& theFolder, + int& theFirst, int& theLast); + + + /** + * Returns default color value for the given object + */ + static void getDefaultColor(ObjectPtr theObject, const bool isEmptyColorValid, + std::vector& theColor); + + /** + * Returns default deflection value for the given object + */ + static double getDefaultDeflection(const ObjectPtr& theObject); + + + /** + * Returns default transparency value + */ + static double getDefaultTransparency(); + + /** + * Returns cursor according to (SKETCH_TAB_NAME, "operation_cursor") property value + */ + static QCursor getOperationCursor(); }; #endif