20 #ifndef ModuleBase_IModule_H
21 #define ModuleBase_IModule_H
23 #include "ModuleBase.h"
24 #include "ModuleBase_IWorkshop.h"
25 #include <ModuleBase_SelectionFilterType.h>
27 #include <ModelAPI_Feature.h>
28 #include <ModelAPI_Attribute.h>
30 #include <GeomAPI_Shape.h>
31 #include <GeomAPI_ICustomPrs.h>
33 #include <SelectMgr_ListOfFilter.hxx>
45 #pragma warning(disable: 4100)
75 CustomizeArguments = 0,
77 CustomizeHighlightedObjects
93 virtual void createFeatures();
96 virtual void actionCreated(QAction*);
100 virtual void editFeature(FeaturePtr theFeature);
110 virtual void launchOperation(
const QString& theCmdId,
111 const bool& isStartAfterCommitOnly);
115 virtual void launchModal(
const QString& theCmdId);
145 QMap<int, QAction*>& theMenuActions)
const
180 virtual bool createWidgets(
const FeaturePtr& theFeature,
const QString& theXmlRepr,
181 QList<ModuleBase_ModelWidget*>& theWidgets)
const {
return false; }
184 virtual bool canUndo()
const;
187 virtual bool canRedo()
const;
193 virtual bool canApplyAction(
const ObjectPtr& theObject,
const QString& theActionId)
const = 0;
201 virtual bool canEraseObject(
const ObjectPtr& theObject)
const;
205 virtual bool canDisplayObject(
const ObjectPtr& theObject)
const;
212 virtual bool canUsePreselection(
const QString& thePreviousOperationKind,
213 const QString& theStartedOperationKind);
222 virtual bool canActivateSelection(
const ObjectPtr& theObject)
const;
247 SelectMgr_ListOfFilter& theSelectionFilters) = 0;
251 virtual QIntList selectionFilters();
261 void registerSelectionFilter(
const ModuleBase_SelectionFilterType theFilterType,
276 const bool theUpdateViewer) {}
282 const bool theUpdateViewer) {}
303 const bool theUpdateViewer) {
326 virtual AISObjectPtr createPresentation(
const ObjectPtr& theResult);
358 virtual QString getFeatureError(
const FeaturePtr& theFeature);
361 virtual void grantedOperationIds(
ModuleBase_Operation* theOperation, QStringList& theIds)
const;
374 virtual bool processEnter(
const std::string& thePreviousAttributeID) {
return false; };
383 virtual GeomShapePtr
findShape(
const AttributePtr& theAttribute) = 0;
390 const GeomShapePtr& theGeomShape) = 0;
403 void getXMLRepresentation(
const std::string& theFeatureId, std::string& theXmlCfg,
404 std::string& theDescription);
416 virtual void onFeatureTriggered();
447 void loadProprietaryPlugins();
450 void processProprietaryFeatures();
465 std::map<ModuleBase_SelectionFilterType, Handle(
SelectMgr_Filter)> mySelectionFilters;
476 #define CREATE_MODULE "createModule"
Message for communication between sender and listener of event.
Definition: Events_Message.h:65
The result of a feature.
Definition: ModelAPI_Result.h:35
Interface to a module.
Definition: ModuleBase_IModule.h:70
virtual bool isCustomPrsActivated(const ModuleBase_CustomizeFlag &theFlag) const
Return true if the custom presentation is activated.
Definition: ModuleBase_IModule.h:267
virtual void addObjectBrowserMenu(QMenu *theMenu) const
Add menu items for object browser into the given menu.
Definition: ModuleBase_IModule.h:150
std::set< std::string > myProprietaryPlugins
Proprietary plugins.
Definition: ModuleBase_IModule.h:461
virtual void enableCustomModes()
Enables disabled custom mode.
Definition: ModuleBase_IModule.h:312
void resumed(ModuleBase_Operation *theOp)
Segnal emitted when an operation is resumed.
virtual bool canApplyAction(const ObjectPtr &theObject, const QString &theActionId) const =0
Returns true if the action can be applyed to the object.
virtual ObjectPtr findPresentedObject(const AISObjectPtr &theAIS) const =0
Returns data object by AIS.
virtual void beforeOperationStopped(ModuleBase_Operation *theOperation)
Performs some GUI actions before an operation transaction is stopped Default realization is empty.
Definition: ModuleBase_IModule.h:378
virtual bool customizeFeature(ObjectPtr theObject, const ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
Modifies the given presentation in the custom way.
Definition: ModuleBase_IModule.h:302
virtual AttributePtr findAttribute(const ObjectPtr &theObject, const GeomShapePtr &theGeomShape)=0
Finds an attribute by geom shape if it is possible.
virtual void storeSelection()
Stores the current selection.
Definition: ModuleBase_IModule.h:87
virtual void moduleSelectionFilters(const QIntList &theFilterTypes, SelectMgr_ListOfFilter &theSelectionFilters)=0
Appends into container of filters module filters corresponded to the modes type.
virtual void onBeforeObjectErase(ObjectPtr theObject, AISObjectPtr theAIS)
Slot called on before object erase.
Definition: ModuleBase_IModule.h:426
virtual void operationCommitted(ModuleBase_Operation *theOperation)
Realizes some functionality by an operation commit.
Definition: ModuleBase_IModule.h:130
virtual void operationAborted(ModuleBase_Operation *theOperation)
Realizes some functionality by an operation abort.
Definition: ModuleBase_IModule.h:133
virtual std::shared_ptr< Events_Message > reentrantMessage()=0
Returns reentrant message if it was accepted.
virtual void clearViewer()=0
Clears specific presentations in the viewer.
virtual GeomShapePtr findShape(const AttributePtr &theAttribute)=0
Finds a shape by attribute if it is possible.
ModuleBase_CustomizeFlag
enumeration to know which objects should be customized
Definition: ModuleBase_IModule.h:74
@ CustomizeResults
references of other objects referenced to the current feature
Definition: ModuleBase_IModule.h:76
virtual void connectToPropertyPanel(ModuleBase_ModelWidget *theWidget, const bool isToConnect)
Connects or disconnects to the value changed signal of the property panel widgets.
Definition: ModuleBase_IModule.h:366
virtual void updateViewerMenu(const QMap< QString, QAction * > &theStdActions)
Update state of pop-up menu items in viewer.
Definition: ModuleBase_IModule.h:348
virtual void updateObjectBrowserMenu(const QMap< QString, QAction * > &theStdActions)
Update state of pop-up menu items in object browser.
Definition: ModuleBase_IModule.h:344
virtual void customizePresentation(const ObjectPtr &theObject, const AISObjectPtr &thePrs) const
Customize presentation according to objects attributes.
Definition: ModuleBase_IModule.h:331
ModuleBase_IWorkshop * workshop() const
Returns current workshop.
Definition: ModuleBase_IModule.h:168
std::map< std::string, std::string > myFeaturesInFiles
Map of features in XML.
Definition: ModuleBase_IModule.h:457
virtual void moduleSelectionModes(int theModesType, QIntList &theModes)=0
Appends specific selection modes for the module to the list of types.
virtual void deactivateCustomPrs(const ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
Deactivate custom presentation for the object.
Definition: ModuleBase_IModule.h:281
virtual void onViewTransformed(int theTrsfType=2)
Called on transformation in current viewer.
Definition: ModuleBase_IModule.h:430
virtual void customizeObjectBrowser(QWidget *theObjectBrowser)
This method is called on object browser creation for customization of module specific features.
Definition: ModuleBase_IModule.h:316
virtual ModuleBase_ModelWidget * createWidgetByType(const std::string &theType, QWidget *theParent, Config_WidgetAPI *theWidgetApi)
Creates custom widgets for property panel.
Definition: ModuleBase_IModule.h:157
virtual void operationStopped(ModuleBase_Operation *theOperation)
Realizes some functionality by an operation stop.
Definition: ModuleBase_IModule.h:127
virtual void restoreSelection()
Restores the current selection.
Definition: ModuleBase_IModule.h:90
virtual void operationStarted(ModuleBase_Operation *theOperation)
Realizes some functionality by an operation start.
Definition: ModuleBase_IModule.h:119
virtual void activateCustomPrs(const FeaturePtr &theFeature, const ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer)
Activate custom presentation for the object.
Definition: ModuleBase_IModule.h:274
virtual bool addViewerMenu(const QMap< QString, QAction * > &theStdActions, QWidget *theParent, QMap< int, QAction * > &theMenuActions) const
Add menu items for viewer into the actions map.
Definition: ModuleBase_IModule.h:143
ModuleBase_IWorkshop * myWorkshop
Reference to workshop.
Definition: ModuleBase_IModule.h:454
std::set< std::string > myFeaturesValidLicense
Features, which have valid license.
Definition: ModuleBase_IModule.h:463
virtual void widgetStateChanged(int thePreviousState)
Validates the operation to change the "Apply" button state.
Definition: ModuleBase_IModule.h:370
virtual void registerValidators()
Register validators for this module.
Definition: ModuleBase_IModule.h:438
virtual bool deleteObjects()
Reacts to the delete action in module.
Definition: ModuleBase_IModule.h:226
virtual void registerProperties()
Register properties of this module.
Definition: ModuleBase_IModule.h:441
std::map< std::string, std::string > myProprietaryFeatures
Map of features in XML, which require license but not confirmed yet.
Definition: ModuleBase_IModule.h:459
virtual bool createWidgets(const FeaturePtr &theFeature, const QString &theXmlRepr, QList< ModuleBase_ModelWidget * > &theWidgets) const
Have an opportunity to create widgets for the current operation instead of standard creation in works...
Definition: ModuleBase_IModule.h:180
virtual ModuleBase_ModelWidget * activeWidget() const =0
Returns the active widget, by default it is the property panel active widget.
virtual bool isActionEnableStateFixed(const int theActionId) const
Returns true if the action should be always enabled.
Definition: ModuleBase_IModule.h:353
virtual void propertyPanelDefined(ModuleBase_Operation *theOperation)
Call back forlast tuning of property panel before operation performance It is called as on clearing o...
Definition: ModuleBase_IModule.h:172
virtual void onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS)
Slot called on object display.
Definition: ModuleBase_IModule.h:421
virtual void setReentrantPreSelection(const std::shared_ptr< Events_Message > &theMessage)=0
Put current selection into reentrant message.
virtual ModuleBase_Operation * currentOperation() const =0
Realizes some functionality by an operation start.
virtual bool processEnter(const std::string &thePreviousAttributeID)
Returns true if the event is processed.
Definition: ModuleBase_IModule.h:374
virtual void disableCustomMode(ModuleBase_CustomizeFlag theMode)
Disable displaying of custom mode.
Definition: ModuleBase_IModule.h:309
virtual void activeSelectionModes(QIntList &theModes)
Returns a list of modes, where the AIS objects should be activated.
Definition: ModuleBase_IModule.h:236
virtual ModuleBase_ITreeNode * rootNode() const =0
Returns root tree node which represents a data model.
virtual void closeDocument()=0
Performs functionality on closing document.
virtual void onSelectionChanged()
Called on selection changed event.
Definition: ModuleBase_IModule.h:434
virtual bool canCommitOperation() const
Returns true if the operation can be committed.
Definition: ModuleBase_IModule.h:104
Definition: ModuleBase_ITreeNode.h:44
Class which provides access to Workshop object services.
Definition: ModuleBase_IWorkshop.h:48
Base class for all operations.
Definition: ModuleBase_Operation.h:53
Presentation.
Definition: ModuleBase_ViewerPrs.h:37