X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Tools.h;h=574ecc5b4221c00a379af6b1f7e5f9b3961cf04d;hb=ccebb4b23e0354829c9636110b903c59923d8e30;hp=0bd4159c45290407fa968856cb5a8eaecc808c4b;hpb=c4eab94a20a0d93100549a210582d46409fec1cc;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Tools.h b/src/PartSet/PartSet_Tools.h index 0bd4159c4..574ecc5b4 100644 --- a/src/PartSet/PartSet_Tools.h +++ b/src/PartSet/PartSet_Tools.h @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -143,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 @@ -187,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 @@ -210,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 */ @@ -218,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 @@ -292,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