SHAPER
9.13.0
|
Interface to a module. More...
Public Types | |
enum | ModuleBase_CustomizeFlag { CustomizeArguments = 0 , CustomizeResults , CustomizeHighlightedObjects } |
enumeration to know which objects should be customized More... | |
Public Slots | |
virtual void | onFeatureTriggered () |
Called on call of command corresponded to a feature. More... | |
virtual void | onObjectDisplayed (ObjectPtr theObject, AISObjectPtr theAIS) |
Slot called on object display. More... | |
virtual void | onBeforeObjectErase (ObjectPtr theObject, AISObjectPtr theAIS) |
Slot called on before object erase. More... | |
virtual void | onViewTransformed (int theTrsfType=2) |
Called on transformation in current viewer. More... | |
Signals | |
void | resumed (ModuleBase_Operation *theOp) |
Segnal emitted when an operation is resumed. More... | |
Public Member Functions | |
ModuleBase_IModule (ModuleBase_IWorkshop *theParent) | |
Constructor. More... | |
virtual void | storeSelection () |
Stores the current selection. More... | |
virtual void | restoreSelection () |
Restores the current selection. More... | |
virtual void | createFeatures () |
Reads description of features from XML file. More... | |
virtual void | actionCreated (QAction *) |
Called on creation of menu item in desktop. More... | |
virtual void | editFeature (FeaturePtr theFeature) |
Launching of a edit operation on the feature. More... | |
virtual bool | canCommitOperation () const |
Returns true if the operation can be committed. More... | |
virtual void | launchOperation (const QString &theCmdId, const bool &isStartAfterCommitOnly) |
Creates an operation and send it to loop. More... | |
virtual void | launchModal (const QString &theCmdId) |
Executes feature as a modal dialog box. More... | |
virtual void | operationStarted (ModuleBase_Operation *theOperation) |
Realizes some functionality by an operation start. More... | |
virtual void | operationResumed (ModuleBase_Operation *theOperation) |
Realizes some functionality by an operation resume By default it emits operationResumed signal. More... | |
virtual void | operationStopped (ModuleBase_Operation *theOperation) |
Realizes some functionality by an operation stop. More... | |
virtual void | operationCommitted (ModuleBase_Operation *theOperation) |
Realizes some functionality by an operation commit. More... | |
virtual void | operationAborted (ModuleBase_Operation *theOperation) |
Realizes some functionality by an operation abort. More... | |
virtual ModuleBase_Operation * | currentOperation () const =0 |
Realizes some functionality by an operation start. More... | |
virtual bool | addViewerMenu (const QMap< QString, QAction * > &theStdActions, QWidget *theParent, QMap< int, QAction * > &theMenuActions) const |
Add menu items for viewer into the actions map. More... | |
virtual void | addObjectBrowserMenu (QMenu *theMenu) const |
Add menu items for object browser into the given menu. More... | |
virtual ModuleBase_ModelWidget * | createWidgetByType (const std::string &theType, QWidget *theParent, Config_WidgetAPI *theWidgetApi) |
Creates custom widgets for property panel. More... | |
virtual ModuleBase_ModelWidget * | activeWidget () const =0 |
Returns the active widget, by default it is the property panel active widget. More... | |
ModuleBase_IWorkshop * | workshop () const |
Returns current workshop. More... | |
virtual void | propertyPanelDefined (ModuleBase_Operation *theOperation) |
Call back forlast tuning of property panel before operation performance It is called as on clearing of property panel as on filling with new widgets. More... | |
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 workshop. More... | |
virtual bool | canUndo () const |
Returns True if there are available Undos and there is not an active operation. More... | |
virtual bool | canRedo () const |
Returns True if there are available Redos and there is not an active operation. More... | |
virtual bool | canApplyAction (const ObjectPtr &theObject, const QString &theActionId) const =0 |
Returns true if the action can be applyed to the object. More... | |
virtual bool | canEraseObject (const ObjectPtr &theObject) const |
Returns True if the current operation can be committed. More... | |
virtual bool | canDisplayObject (const ObjectPtr &theObject) const |
Returns whether the object can be displayed. More... | |
virtual bool | canUsePreselection (const QString &thePreviousOperationKind, const QString &theStartedOperationKind) |
Returns whether the started operation may use preselection of the previous one Cases are: previous operation is null, edit operation, previuos and started operations kinds are the same. More... | |
virtual bool | canActivateSelection (const ObjectPtr &theObject) const |
Make some functionality after the objects are hidden in viewer. More... | |
virtual bool | deleteObjects () |
Reacts to the delete action in module. More... | |
virtual void | closeDocument ()=0 |
Performs functionality on closing document. More... | |
virtual void | clearViewer ()=0 |
Clears specific presentations in the viewer. More... | |
virtual void | activeSelectionModes (QIntList &theModes) |
Returns a list of modes, where the AIS objects should be activated. More... | |
virtual void | moduleSelectionModes (int theModesType, QIntList &theModes)=0 |
Appends specific selection modes for the module to the list of types. More... | |
virtual void | moduleSelectionFilters (const QIntList &theFilterTypes, SelectMgr_ListOfFilter &theSelectionFilters)=0 |
Appends into container of filters module filters corresponded to the modes type. More... | |
virtual QIntList | selectionFilters () |
Returns types of registered module selection filters. More... | |
virtual | HandlesselectionFilter (const int theType) |
Returns selection filter. More... | |
void | registerSelectionFilter (const ModuleBase_SelectionFilterType theFilterType, const Handle &&theFilter) |
Append selection filter into the module and type of the filter in internal container. More... | |
virtual bool | isCustomPrsActivated (const ModuleBase_CustomizeFlag &theFlag) const |
Return true if the custom presentation is activated. More... | |
virtual void | activateCustomPrs (const FeaturePtr &theFeature, const ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer) |
Activate custom presentation for the object. More... | |
virtual void | deactivateCustomPrs (const ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer) |
Deactivate custom presentation for the object. More... | |
virtual bool | customizeFeature (ObjectPtr theObject, const ModuleBase_CustomizeFlag &theFlag, const bool theUpdateViewer) |
Modifies the given presentation in the custom way. More... | |
virtual void | disableCustomMode (ModuleBase_CustomizeFlag theMode) |
Disable displaying of custom mode. More... | |
virtual void | enableCustomModes () |
Enables disabled custom mode. More... | |
virtual void | customizeObjectBrowser (QWidget *theObjectBrowser) |
This method is called on object browser creation for customization of module specific features. More... | |
virtual ModuleBase_Operation * | createOperation (const std::string &theCmdId) |
Creates a new operation. More... | |
virtual AISObjectPtr | createPresentation (const ObjectPtr &theResult) |
Create specific for the module presentation. More... | |
virtual void | customizePresentation (const ObjectPtr &theObject, const AISObjectPtr &thePrs) const |
Customize presentation according to objects attributes. More... | |
virtual ObjectPtr | findPresentedObject (const AISObjectPtr &theAIS) const =0 |
Returns data object by AIS. More... | |
virtual bool | canBeShaded (HandlettheAIS) const |
Returns true if the presentation can be shown in shading mode. More... | |
virtual void | updateObjectBrowserMenu (const QMap< QString, QAction * > &theStdActions) |
Update state of pop-up menu items in object browser. More... | |
virtual void | updateViewerMenu (const QMap< QString, QAction * > &theStdActions) |
Update state of pop-up menu items in viewer. More... | |
virtual bool | isActionEnableStateFixed (const int theActionId) const |
Returns true if the action should be always enabled. More... | |
virtual QString | getFeatureError (const FeaturePtr &theFeature) |
Returns the feature error if the current state of the feature in the module is not correct If the feature is correct, it returns an empty value. More... | |
virtual void | grantedOperationIds (ModuleBase_Operation *theOperation, QStringList &theIds) const |
Returns list of granted operation indices. More... | |
virtual void | connectToPropertyPanel (ModuleBase_ModelWidget *theWidget, const bool isToConnect) |
Connects or disconnects to the value changed signal of the property panel widgets. More... | |
virtual void | widgetStateChanged (int thePreviousState) |
Validates the operation to change the "Apply" button state. More... | |
virtual bool | processEnter (const std::string &thePreviousAttributeID) |
Returns true if the event is processed. More... | |
virtual void | beforeOperationStopped (ModuleBase_Operation *theOperation) |
Performs some GUI actions before an operation transaction is stopped Default realization is empty. More... | |
virtual GeomShapePtr | findShape (const AttributePtr &theAttribute)=0 |
Finds a shape by attribute if it is possible. More... | |
virtual AttributePtr | findAttribute (const ObjectPtr &theObject, const GeomShapePtr &theGeomShape)=0 |
Finds an attribute by geom shape if it is possible. More... | |
virtual std::shared_ptr< Events_Message > | reentrantMessage ()=0 |
Returns reentrant message if it was accepted. More... | |
virtual void | setReentrantPreSelection (const std::shared_ptr< Events_Message > &theMessage)=0 |
Put current selection into reentrant message. More... | |
void | getXMLRepresentation (const std::string &theFeatureId, std::string &theXmlCfg, std::string &theDescription) |
Returns XML information by the feature index. More... | |
virtual ModuleBase_ITreeNode * | rootNode () const =0 |
Returns root tree node which represents a data model. More... | |
Protected Slots | |
virtual void | onSelectionChanged () |
Called on selection changed event. More... | |
Protected Member Functions | |
virtual void | registerValidators () |
Register validators for this module. More... | |
virtual void | registerProperties () |
Register properties of this module. More... | |
virtual ModuleBase_Operation * | getNewOperation (const std::string &theFeatureId) |
Returns new instance of operation object (used in createOperation for customization) More... | |
void | loadProprietaryPlugins () |
Load plugins required license. More... | |
void | processProprietaryFeatures () |
Collect features, which have valid license. More... | |
Protected Attributes | |
ModuleBase_IWorkshop * | myWorkshop |
Reference to workshop. More... | |
std::map< std::string, std::string > | myFeaturesInFiles |
Map of features in XML. More... | |
std::map< std::string, std::string > | myProprietaryFeatures |
Map of features in XML, which require license but not confirmed yet. More... | |
std::set< std::string > | myProprietaryPlugins |
Proprietary plugins. More... | |
std::set< std::string > | myFeaturesValidLicense |
Features, which have valid license. More... | |
std::map< ModuleBase_SelectionFilterType, Handle > | mySelectionFilters |
Interface to a module.
ModuleBase_IModule::ModuleBase_IModule | ( | ModuleBase_IWorkshop * | theParent | ) |
Constructor.
theParent | instance of workshop interface |
|
inlinevirtual |
Stores the current selection.
Reimplemented in PartSet_Module.
|
inlinevirtual |
Restores the current selection.
Reimplemented in PartSet_Module.
|
virtual |
Reads description of features from XML file.
Reimplemented in PartSet_Module.
|
virtual |
Called on creation of menu item in desktop.
|
virtual |
Launching of a edit operation on the feature.
theFeature | feature for editing |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Returns true if the operation can be committed.
Result in default implementation is true.
Reimplemented in PartSet_Module.
|
virtual |
Creates an operation and send it to loop.
theCmdId | the operation name |
isStartAfterCommitOnly | operation is launched if there is no active operation or it is committed |
selection should be obtained from workshop before ask if the operation can be started as the canStartOperation method performs commit/abort of previous operation. Sometimes commit/abort may cause selection clear(Sketch operation) as a result it will be lost and is not used for preselection.
reentrant operation(Sketch Line) should not be started if operation is aborted
Reimplemented in PartSet_Module.
|
virtual |
Executes feature as a modal dialog box.
theCmdId | the operation name |
|
inlinevirtual |
Realizes some functionality by an operation start.
theOperation | a started operation |
Reimplemented in PartSet_Module.
|
virtual |
Realizes some functionality by an operation resume By default it emits operationResumed signal.
theOperation | a resumed operation |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Realizes some functionality by an operation stop.
Reimplemented in PartSet_Module.
|
inlinevirtual |
Realizes some functionality by an operation commit.
Reimplemented in PartSet_Module.
|
inlinevirtual |
Realizes some functionality by an operation abort.
Reimplemented in PartSet_Module.
|
pure virtual |
Realizes some functionality by an operation start.
Implemented in PartSet_Module.
|
inlinevirtual |
Add menu items for viewer into the actions map.
theStdActions | a map of standard actions |
theParent | a parent widget |
theMenuActions | map of action/menu for the desirable index in the viewer menu |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Add menu items for object browser into the given menu.
theMenu | a popup menu to be shown in the object browser |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Creates custom widgets for property panel.
theType | a type of widget |
theParent | the parent object |
theWidgetApi | the widget configuration. The attribute of the model widget is obtained from |
Reimplemented in PartSet_Module.
|
pure virtual |
Returns the active widget, by default it is the property panel active widget.
Implemented in PartSet_Module.
|
inline |
Returns current workshop.
|
inlinevirtual |
Call back forlast tuning of property panel before operation performance It is called as on clearing of property panel as on filling with new widgets.
Reimplemented in PartSet_Module.
|
inlinevirtual |
Have an opportunity to create widgets for the current operation instead of standard creation in workshop.
theFeature | a feature of the started operation |
theXmlRepr | an XML representation of the operation |
theWidgets | a list of created widgets |
Reimplemented in PartSet_Module.
|
virtual |
Returns True if there are available Undos and there is not an active operation.
Reimplemented in PartSet_Module.
|
virtual |
Returns True if there are available Redos and there is not an active operation.
Reimplemented in PartSet_Module.
|
pure virtual |
Returns true if the action can be applyed to the object.
theObject | a checked object |
theActionId | an identifier of action, to be found in the menu manager like "DELETE_CMD" |
Implemented in PartSet_Module.
|
virtual |
Returns True if the current operation can be committed.
By default it is true.
theObject | a model object |
Reimplemented in PartSet_Module.
|
virtual |
Returns whether the object can be displayed.
The default realization returns true.
theObject | a model object |
Reimplemented in PartSet_Module.
|
virtual |
Returns whether the started operation may use preselection of the previous one Cases are: previous operation is null, edit operation, previuos and started operations kinds are the same.
thePreviousOperationKind | a kind of previous operation |
theStartedOperationKind | a kind of a started operation |
Reimplemented in PartSet_Module.
|
virtual |
Make some functionality after the objects are hidden in viewer.
theObjects | a list of hidden objects Returns true if selection for the object can be activate. By default a result or feature of the current operation can not be activated |
theObject | a model object |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Reacts to the delete action in module.
|
pure virtual |
Performs functionality on closing document.
Implemented in PartSet_Module.
|
pure virtual |
Clears specific presentations in the viewer.
Implemented in PartSet_Module.
|
inlinevirtual |
Returns a list of modes, where the AIS objects should be activated.
theModes | a list of modes |
Reimplemented in PartSet_Module.
|
pure virtual |
Appends specific selection modes for the module to the list of types.
theModesType | combination of available selection filters |
theModes | a selection modes to be extended |
Implemented in PartSet_Module.
|
pure virtual |
Appends into container of filters module filters corresponded to the modes type.
theFilterTypes | container of available selection filters |
theSelectionFilters | [out] container to be extend by elements |
Implemented in PartSet_Module.
|
virtual |
Returns types of registered module selection filters.
theSelectionFilters | [out] container of type value |
|
virtual |
Returns selection filter.
theType | selection filter type |
theFilter | instance of filter |
void ModuleBase_IModule::registerSelectionFilter | ( | const ModuleBase_SelectionFilterType | theFilterType, |
const Handle && | theFilter | ||
) |
Append selection filter into the module and type of the filter in internal container.
theFilterType | selection filter type |
theFilter | added filter |
|
inlinevirtual |
Return true if the custom presentation is activated.
theFlag | a flag of level of customization, which means that only part of sub-elements |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Activate custom presentation for the object.
Default realization is empty.
theFeature | a feature instance |
theFlag | a flag of level of customization, which means that only part of sub-elements |
theUpdateViewer | the parameter whether the viewer should be update immediately |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Deactivate custom presentation for the object.
Default realization is empty.
theFlag | a flag of level of customization, which means that only part of sub-elements |
theUpdateViewer | the parameter whether the viewer should be update immediately |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Modifies the given presentation in the custom way.
Update the object presentable properties such as color, lines width and other If the object is result with the color attribute value set, it is used, otherwise the customize is applyed to the object's feature if it is a custom prs
theObject | an object instance |
theFlag | a flag of level of customization, which means that only part of sub-elements should be updated(e.g. only highlighted elements) |
theUpdateViewer | the parameter whether the viewer should be update immediately |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Disable displaying of custom mode.
theMode | a mode to disable |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Enables disabled custom mode.
Reimplemented in PartSet_Module.
|
inlinevirtual |
This method is called on object browser creation for customization of module specific features.
theObjectBrowser | a pinter on Object Browser widget |
Reimplemented in PartSet_Module.
|
virtual |
Creates a new operation.
theCmdId | the operation name |
|
virtual |
Create specific for the module presentation.
The presentation has to be customized accordingly to the object.
theResult | an object for presentation |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Customize presentation according to objects attributes.
theObject | an object for presentation |
thePrs | a presentation object |
Reimplemented in PartSet_Module.
|
pure virtual |
Returns data object by AIS.
Implemented in PartSet_Module.
|
virtual |
Returns true if the presentation can be shown in shading mode.
theAIS | presentation to be checked |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Update state of pop-up menu items in object browser.
theStdActions | - a map of standard actions |
|
inlinevirtual |
Update state of pop-up menu items in viewer.
theStdActions | - a map of standard actions |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Returns true if the action should be always enabled.
theActionId | an action index: Accept or Accept All |
Reimplemented in PartSet_Module.
|
virtual |
Returns the feature error if the current state of the feature in the module is not correct If the feature is correct, it returns an empty value.
Reimplemented in PartSet_Module.
|
virtual |
Returns list of granted operation indices.
Reimplemented in PartSet_Module.
|
inlinevirtual |
Connects or disconnects to the value changed signal of the property panel widgets.
theWidget | a property contol widget |
isToConnect | a boolean value whether connect or disconnect |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Validates the operation to change the "Apply" button state.
thePreviousState | the previous state of the widget |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Returns true if the event is processed.
thePreviousAttributeID | an index of the previous active attribute |
Reimplemented in PartSet_Module.
|
inlinevirtual |
Performs some GUI actions before an operation transaction is stopped Default realization is empty.
Reimplemented in PartSet_Module.
|
pure virtual |
Finds a shape by attribute if it is possible.
theAttribute | an attribute |
Implemented in PartSet_Module.
|
pure virtual |
Finds an attribute by geom shape if it is possible.
theObject | an object of the attribute |
theGeomShape | a geom shape |
Implemented in PartSet_Module.
|
pure virtual |
Returns reentrant message if it was accepted.
Implemented in PartSet_Module.
|
pure virtual |
Put current selection into reentrant message.
theMessage | a message of reentrant operation |
Implemented in PartSet_Module.
void ModuleBase_IModule::getXMLRepresentation | ( | const std::string & | theFeatureId, |
std::string & | theXmlCfg, | ||
std::string & | theDescription | ||
) |
Returns XML information by the feature index.
theFeatureId | a feature id |
theXmlCfg | XML configuration |
theDescription | feature description |
|
pure virtual |
Returns root tree node which represents a data model.
Implemented in PartSet_Module.
|
signal |
Segnal emitted when an operation is resumed.
theOp | a resumed operation |
|
virtualslot |
Called on call of command corresponded to a feature.
|
inlinevirtualslot |
Slot called on object display.
theObject | a data object |
theAIS | a presentation object |
|
inlinevirtualslot |
Slot called on before object erase.
theObject | a data object |
theAIS | a presentation object |
|
inlinevirtualslot |
Called on transformation in current viewer.
theTrsfType | type of tranformation |
|
inlineprotectedvirtualslot |
Called on selection changed event.
|
inlineprotectedvirtual |
Register validators for this module.
Reimplemented in PartSet_Module.
|
inlineprotectedvirtual |
Register properties of this module.
|
protectedvirtual |
Returns new instance of operation object (used in createOperation for customization)
|
protected |
Load plugins required license.
|
protected |
Collect features, which have valid license.
|
protected |
Reference to workshop.
|
protected |
Map of features in XML.
|
protected |
Map of features in XML, which require license but not confirmed yet.
|
protected |
Proprietary plugins.
|
protected |
Features, which have valid license.