Salome HOME
ModuleBase_ViewerPrs is wrapped into shared_ptr: remove include of this class from...
[modules/shaper.git] / src / ModuleBase / ModuleBase_IModule.h
index be36fede6b6475fb67ac8ffa5b4cbe4859e9ca2f..269c115683bafe6cba17bc69b23380bd4673e768 100755 (executable)
@@ -29,6 +29,9 @@ class Config_WidgetAPI;
 class ModuleBase_ModelWidget;\r
 class ModuleBase_Operation;\r
 class ModuleBase_IWorkshop;\r
+class ModelAPI_Result;\r
+\r
+class Handle_AIS_InteractiveObject;\r
 \r
 /**\r
  * \ingroup GUI\r
@@ -73,6 +76,10 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \param theFeature feature for editing\r
   virtual void editFeature(FeaturePtr theFeature);\r
 \r
+  /// Returns true if the operation can be committed. Result in default implementation is true.\r
+  /// \return boolean value\r
+  virtual bool canCommitOperation() const { return true; }\r
+\r
   /// Creates an operation and send it to loop\r
   /// \param theCmdId the operation name\r
   virtual void launchOperation(const QString& theCmdId);\r
@@ -102,7 +109,8 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \param theMenu a popup menu to be shown in the viewer\r
   /// \param theStdActions a map of standard actions\r
   /// \return true if items are added and there is no necessity to provide standard menu\r
-  virtual bool addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const { return false; }\r
+  virtual bool addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const\r
+  { return false; }\r
 \r
   /// Add menu items for object browser into the given menu\r
   /// \param theMenu a popup menu to be shown in the object browser\r
@@ -112,9 +120,8 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \param theType a type of widget\r
   /// \param theParent the parent object\r
   /// \param theWidgetApi the widget configuration. The attribute of the model widget is obtained from\r
-  /// \param theParentId is Id of a parent of the current attribute\r
   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent,\r
-                                      Config_WidgetAPI* theWidgetApi, std::string theParentId)\r
+                                                     Config_WidgetAPI* theWidgetApi)\r
   {\r
     return 0;\r
   }\r
@@ -198,7 +205,7 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
                                    const bool theUpdateViewer) {}\r
 \r
   /// Modifies the given presentation in the custom way.\r
-  virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,\r
+  virtual bool customisePresentation(std::shared_ptr<ModelAPI_Result> theResult, AISObjectPtr thePrs,\r
                                      GeomCustomPrsPtr theCustomPrs) { return false; };\r
 \r
   /// Update the object presentable properties such as color, lines width and other\r
@@ -224,9 +231,20 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \param theOperation the operation\r
   virtual void sendOperation(ModuleBase_Operation* theOperation);\r
 \r
+  /// Create specific for the module presentation\r
+  /// \param theResult an object for presentation\r
+  /// \return created presentation or NULL(default value)\r
+  virtual Handle_AIS_InteractiveObject createPresentation(\r
+                           const std::shared_ptr<ModelAPI_Result>& theResult);\r
+\r
   //! Returns data object by AIS\r
   virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;\r
 \r
+  //! Returns true if the presentation can be shown in shading mode\r
+  //! \param theAIS presentation to be checked\r
+  //! \return boolean value\r
+  virtual bool canBeShaded(Handle(AIS_InteractiveObject) theAIS) const;\r
+\r
   /// Update state of pop-up menu items in object browser\r
   /// \param theStdActions - a map of standard actions\r
   virtual void updateObjectBrowserMenu(const QMap<QString, QAction*>& theStdActions) {}\r