Salome HOME
#1277 SKETCH : Bad restitution coordinates in the point creation panel
[modules/shaper.git] / src / ModuleBase / ModuleBase_IModule.h
index 56f7e2bbc1d5c7ed4314f2911a06f994735d9c9c..75a962dad7abdc0608b485fc8273deb31ad0614a 100755 (executable)
 #include <ModelAPI_Attribute.h>\r
 \r
 #include <GeomAPI_Shape.h>\r
+#include <GeomAPI_ICustomPrs.h>\r
 \r
 #include <QString>\r
 #include <QObject>\r
 #include <QMap>\r
+#include <QList>\r
 \r
 #include <string>\r
+#include <vector>\r
 #include <map>\r
 \r
 class QAction;\r
@@ -120,6 +123,13 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// It is called as on clearing of property panel as on filling with new widgets\r
   virtual void propertyPanelDefined(ModuleBase_Operation* theOperation) {}\r
 \r
+  /// Have an opportunity to create widgets for the current operation instead of standard creation in workshop\r
+  /// \param theOperation a started operation\r
+  /// \param theWidgets a list of created widgets\r
+  /// \return boolean result, false by default\r
+  virtual bool createWidgets(ModuleBase_Operation* theOperation,\r
+                             QList<ModuleBase_ModelWidget*>& theWidgets) const { return false; }\r
+\r
   //! Returns True if there are available Undos and there is not an active operation\r
   virtual bool canUndo() const;\r
 \r
@@ -144,6 +154,10 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \param theObject a model object\r
   virtual bool canDisplayObject(const ObjectPtr& theObject) const;\r
 \r
+  /// Make some functionality after the objects are hidden in viewer\r
+  /// \param theObjects a list of hidden objects\r
+  virtual void processHiddenObject(const std::list<ObjectPtr>& theObjects) {};\r
+\r
   /// Returns true if selection for the object can be activate.\r
   /// By default a result or feature of the current operation can not be activated\r
   /// \param theObject a model object\r
@@ -177,6 +191,10 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   virtual void deactivateCustomPrs(const ModuleBase_CustomizeFlag& theFlag,\r
                                    const bool theUpdateViewer) {}\r
 \r
+  /// Modifies the given presentation in the custom way.\r
+  virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,\r
+                                     GeomCustomPrsPtr theCustomPrs) { return false; };\r
+\r
   /// Update the object presentable properties such as color, lines width and other\r
   /// If the object is result with the color attribute value set, it is used,\r
   /// otherwise the customize is applyed to the object's feature if it is a custom prs\r
@@ -252,6 +270,13 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   virtual AttributePtr findAttribute(const ObjectPtr& theObject,\r
                                      const GeomShapePtr& theGeomShape) = 0;\r
 \r
+  /// Returns XML information by the feature index\r
+  /// \param theFeatureId a feature id\r
+  /// \param theXmlCfg XML configuration\r
+  /// \param theDescription feature description\r
+  void getXMLRepresentation(const std::string& theFeatureId, std::string& theXmlCfg,\r
+                            std::string& theDescription);\r
+\r
 signals:\r
   /// Signal which is emitted when operation is launched\r
   void operationLaunched();\r
@@ -292,7 +317,6 @@ protected slots:
   virtual ModuleBase_Operation* getNewOperation(const std::string& theFeatureId);\r
 \r
 protected:\r
-\r
   /// Reference to workshop\r
   ModuleBase_IWorkshop* myWorkshop;\r
 \r