+ /// Performs functionality on closing document\r
+ virtual void closeDocument() = 0;\r
+\r
+ /// Clears specific presentations in the viewer\r
+ virtual void clearViewer() = 0;\r
+\r
+ /// Returns a list of modes, where the AIS objects should be activated\r
+ /// \param theModes a list of modes\r
+ virtual void activeSelectionModes(QIntList& theModes) {}\r
+\r
+ /// Appends specific selection modes for the module to the list of types\r
+ /// \param theTypes a selection modes to be extended\r
+ virtual void customSubShapesSelectionModes(QIntList& theTypes) {}\r
+\r
+ /// Return true if the custom presentation is activated\r
+ /// \param theFlag a flag of level of customization, which means that only part of sub-elements\r
+ /// \return boolean value\r
+ virtual bool isCustomPrsActivated(const ModuleBase_CustomizeFlag& theFlag) const { return false; };\r
+\r
+ /// Activate custom presentation for the object. Default realization is empty.\r
+ /// \param theFeature a feature instance\r
+ /// \param theFlag a flag of level of customization, which means that only part of sub-elements\r
+ /// \param theUpdateViewer the parameter whether the viewer should be update immediately\r
+ virtual void activateCustomPrs(const FeaturePtr& theFeature,\r
+ const ModuleBase_CustomizeFlag& theFlag,\r
+ const bool theUpdateViewer) {}\r
+\r
+ /// Deactivate custom presentation for the object. Default realization is empty.\r
+ /// \param theFlag a flag of level of customization, which means that only part of sub-elements\r
+ /// \param theUpdateViewer the parameter whether the viewer should be update immediately\r
+ 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(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
+ /// 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
+ /// \param theObject an object instance\r
+ /// \param theFlag a flag of level of customization, which means that only part of sub-elements\r
+ /// should be updated(e.g. only highlighted elements)\r
+ /// \param theUpdateViewer the parameter whether the viewer should be update immediately\r
+ /// \returns true if the object is modified\r
+ virtual bool customizeObject(ObjectPtr theObject, const ModuleBase_CustomizeFlag& theFlag,\r
+ const bool theUpdateViewer);\r
+\r
+ /// This method is called on object browser creation for customization of module specific features\r
+ /// \param theObjectBrowser a pinter on Object Browser widget\r
+ virtual void customizeObjectBrowser(QWidget* theObjectBrowser) {}\r
+\r
+ /// Creates a new operation\r
+ /// \param theCmdId the operation name\r
+ virtual ModuleBase_Operation* createOperation(const std::string& theCmdId);\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
+\r
+ /// Update state of pop-up menu items in viewer\r
+ /// \param theStdActions - a map of standard actions\r
+ virtual void updateViewerMenu(const QMap<QString, QAction*>& theStdActions) {}\r
+\r
+ /// Returns true if the action should be always enabled\r
+ /// \param theActionId an action index: Accept or Accept All\r
+ /// \return boolean value\r
+ virtual bool isActionEnableStateFixed(const int theActionId) const { return false; }\r
+\r
+ //! Returns the feature error if the current state of the feature in the module is not correct\r
+ //! If the feature is correct, it returns an empty value\r
+ //! \return string value\r
+ virtual QString getFeatureError(const FeaturePtr& theFeature);\r
+\r
+ /// Returns list of granted operation indices\r
+ virtual void grantedOperationIds(ModuleBase_Operation* theOperation, QStringList& theIds) const;\r
+\r
+ /// Connects or disconnects to the value changed signal of the property panel widgets\r
+ /// \param theWidget a property contol widget\r
+ /// \param isToConnect a boolean value whether connect or disconnect\r
+ virtual void connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect) {};\r
+\r
+ /// Validates the operation to change the "Apply" button state.\r
+ /// \param thePreviousState the previous state of the widget\r
+ virtual void widgetStateChanged(int thePreviousState) {};\r
+\r
+ /// Returns true if the event is processed.\r
+ /// \param thePreviousAttributeID an index of the previous active attribute\r
+ virtual bool processEnter(const std::string& thePreviousAttributeID) { return false; };\r
+\r
+ /// Performs some GUI actions before an operation transaction is stopped\r
+ /// Default realization is empty\r
+ virtual void beforeOperationStopped(ModuleBase_Operation* theOperation) {};\r
+\r
+ /// Finds a shape by attribute if it is possible\r
+ /// \param theAttribute an attribute\r
+ /// \return a geom shape\r
+ virtual GeomShapePtr findShape(const AttributePtr& theAttribute) = 0;\r
+\r
+ /// Finds an attribute by geom shape if it is possible\r
+ /// \param theObject an object of the attribute\r
+ /// \param theGeomShape a geom shape\r
+ /// \return theAttribute\r
+ 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
+\r
+ /// Segnal emitted when an operation is resumed\r
+ /// \param theOp a resumed operation\r
+ void resumed(ModuleBase_Operation* theOp);\r
+\r