]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_Tools.h
Salome HOME
1. Correction for perfomance problem by Apply button state update: do not listen...
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.h
index 31556d8d822f88e79558e10ee7926a4cf6d7f7c0..6101364200a1494b6aba5e21ad80a8fd5ff90ff1 100755 (executable)
@@ -26,6 +26,9 @@ class QLayout;
 class QDoubleSpinBox;
 class ModuleBase_ParamIntSpinBox;
 class ModuleBase_ParamSpinBox;
+class ModuleBase_IWorkshop;
+
+class GeomAPI_Shape;
 
 namespace ModuleBase_Tools {
 
@@ -135,10 +138,10 @@ Check types of objects which are in the given list
 \param hasResult will be set to true if list contains Result objects
 \param hasFeature will be set to true if list contains Feature objects
 \param hasParameter will be set to true if list contains Parameter objects
-\param hasSubFeature will be set to true if list contains Sub-Feature objects
+\param hasCompositeOwner will be set to true if list contains Sub-Feature objects
 */
 MODULEBASE_EXPORT void checkObjects(const QObjectPtrList& theObjects, bool& hasResult,
-                           bool& hasFeature, bool& hasParameter, bool& hasSubFeature);
+                           bool& hasFeature, bool& hasParameter, bool& hasCompositeOwner);
 
 /*! Sets the default coeffient into the driver calculated accordingly the shape type.
 It provides 1.e-4 for a shape withe Edge shape type
@@ -159,14 +162,51 @@ MODULEBASE_EXPORT Quantity_Color color(const std::string& theSection,
                                        const std::string& theDefault);
 
 
-// Returns the object from the attribute
+/// Returns the object from the attribute
 /// \param theObj an object
 MODULEBASE_EXPORT ObjectPtr getObject(const AttributePtr& theAttribute);
 
-// Returns the object from the attribute
+/// Returns the object from the attribute
 /// \param theObj an object
 MODULEBASE_EXPORT TopAbs_ShapeEnum getCompoundSubType(const TopoDS_Shape& theShape);
 
+/// Returns list of parameters accessible in the active part and partset
+/// \theParameters a list of parameter names
+MODULEBASE_EXPORT void getParameters(QStringList& theParameters);
+
+/// Returns list of parameters accessible in the active part and partset
+/// \theParameters a list of parameter names
+MODULEBASE_EXPORT std::string findGreedAttribute(ModuleBase_IWorkshop* theWorkshop,
+                                                 const FeaturePtr& theFeature);
+
+/// Set the object to the attribute depending on the attribute type. If it is a list,
+/// the values are appended if they are not in the list yet.
+/// \param theAttribute an attribute where the object and shape are set
+/// \param theObject an object
+/// \param theShape a shape
+/// \param theWorkshop to find an attribute for the given shape for attribute reference
+/// \param theTemporarily if it is true, do not store and name the added in the data framework
+///        It is useful for attribute selection
+MODULEBASE_EXPORT void setObject(const AttributePtr& theAttribute, const ObjectPtr& theObject,
+                                 const std::shared_ptr<GeomAPI_Shape>& theShape,
+                                 ModuleBase_IWorkshop* theWorkshop,
+                                 const bool theTemporarily = false);
+
+/// Returns the shape of the attribute. If the attribute is AttributeRefAttrPtr, the shape is found
+/// using current module of the given workshop.
+/// \param theAttribute an attribute where the shape is set
+/// \param theWorkshop to find a shape for the given attribute
+MODULEBASE_EXPORT std::shared_ptr<GeomAPI_Shape> getShape(const AttributePtr& theAttribute,
+                                                          ModuleBase_IWorkshop* theWorkshop);
+
+/// Flush updated signal for the object. The viewer update is blocked in the process
+/// \param theObject parameter of the signal
+MODULEBASE_EXPORT void flushUpdated(ObjectPtr theObject);
+
+/// Sends a message about block/unblock viewer updating
+/// \param theValue a boolean value
+MODULEBASE_EXPORT void blockUpdateViewer(const bool theValue);
+
 }
 
 #endif