SHAPER  9.13.0
PartSet_Module Class Reference

Implementation of Partset module. More...

Inheritance diagram for PartSet_Module:
Inheritance graph

Public Types

enum  ModuleBase_CustomizeFlag { CustomizeArguments = 0 , CustomizeResults , CustomizeHighlightedObjects }
 enumeration to know which objects should be customized More...
 

Public Slots

virtual void onObjectDisplayed (ObjectPtr theObject, AISObjectPtr theAIS)
 Slolt 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...
 
void onRemoveConflictingConstraints ()
 Called on remove conflicting constraints. More...
 
virtual void onFeatureTriggered ()
 Called on call of command corresponded to a feature. More...
 

Signals

void resumed (ModuleBase_Operation *theOp)
 Segnal emitted when an operation is resumed. More...
 

Public Member Functions

 PartSet_Module (ModuleBase_IWorkshop *theWshop)
 Constructor. More...
 
virtual void storeSelection ()
 Stores the current selection. More...
 
virtual void restoreSelection ()
 Restores the current selection. More...
 
virtual ModuleBase_ModelWidgetcreateWidgetByType (const std::string &theType, QWidget *theParent, Config_WidgetAPI *theWidgetApi)
 Creates custom widgets for property panel. More...
 
virtual ModuleBase_ModelWidgetactiveWidget () const
 Returns the active widget, by default it is the property panel active widget If the internal edit operation is started, this is the first widget of the operation. More...
 
virtual void propertyPanelDefined (ModuleBase_Operation *theOperation)
 Call back forlast tuning of property panel before operation performance. More...
 
virtual bool createWidgets (const FeaturePtr &theFeature, const QString &theXmlRepr, QList< ModuleBase_ModelWidget * > &theWidgets) const
 If there is found selected attribute, widgets are created and contains only a widget for the attribute It is important for Property Panel filling by sketch point attribute. 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 operationStarted (ModuleBase_Operation *theOperation)
 Realizes some functionality by an operation start Displays all sketcher sub-Objects, hides sketcher result, appends selection filters Activate the operation presentation. More...
 
virtual void operationResumed (ModuleBase_Operation *theOperation)
 Realizes some functionality by an operation resume Activate the operation presentation. More...
 
virtual void operationCommitted (ModuleBase_Operation *theOperation)
 Realizes some functionality by an operation commit Restarts sketcher operation automatically of it is necessary. More...
 
virtual void operationAborted (ModuleBase_Operation *theOperation)
 Realizes some functionality by an operation abort Hides all sketcher sub-Objects, displays sketcher result and removes selection filters. More...
 
virtual void operationStopped (ModuleBase_Operation *theOperation)
 Realizes some functionality by an operation stop Hides all sketcher sub-Objects, displays sketcher result and removes selection filters. More...
 
virtual ModuleBase_OperationcurrentOperation () const
 Returns current operation. More...
 
virtual bool canUndo () const
 Returns True if there are available Undos and the sketch manager allows undo. More...
 
virtual bool canRedo () const
 Returns True if there are available Redos and the sketch manager allows redo. More...
 
virtual bool canApplyAction (const ObjectPtr &theObject, const QString &theActionId) const
 Returnas 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 at the bounds of the active operation. More...
 
virtual bool canUsePreselection (const QString &thePreviousOperationKind, const QString &theStartedOperationKind)
 Returns parent result if accepted, true if the started operation is a nested operation of the previous operation. More...
 
virtual bool canActivateSelection (const ObjectPtr &theObject) const
 Make some functionality after the objects are hidden in viewer. More...
 
virtual void addObjectBrowserMenu (QMenu *theMenu) const
 Add menu atems for object browser into the given menu. 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 activeSelectionModes (QIntList &theModes)
 Returns a list of modes, where the AIS objects should be activated. More...
 
virtual void moduleSelectionModes (int theModesType, QIntList &theModes)
 Appends specific selection modes for the module to the list of types. More...
 
virtual void moduleSelectionFilters (const QIntList &theFilterTypes, SelectMgr_ListOfFilter &theSelectionFilters)
 Appends into container of filters module filters corresponded to the modes type. More...
 
bool isMouseOverWindow ()
 Returns whether the mouse enter the viewer's window. More...
 
PartSet_SketcherMgrsketchMgr () const
 Returns sketch manager object. More...
 
PartSet_SketcherReentrantMgrsketchReentranceMgr () const
 Returns sketch reentrant manager. More...
 
virtual void getGeomSelection (const std::shared_ptr< ModuleBase_ViewerPrs > &theSelected, ObjectPtr &theObject, AttributePtr &theAttribute)
 Find object and attribute(if selected) for the given viewer selection. More...
 
PartSet_OverconstraintListeneroverconstraintListener ()
 Returns listener of overconstraint signal. More...
 
bool isSketchNeutralPointActivated () const
 Returns true if the current operation is not reentrant and the current state of the application is not in launch operation mode. More...
 
virtual void closeDocument ()
 Performs functionality on closing document. More...
 
virtual void clearViewer ()
 Clears specific presentations in the viewer. More...
 
virtual void processEvent (const std::shared_ptr< Events_Message > &theMessage)
 Event Listener method. More...
 
void setCustomized (const FeaturePtr &theFeature)
 Set the object with the object results are customized. 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 customisation of module specific features. More...
 
int getVisualLayerId () const
 Returns the viewer Z layer. 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
 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 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 widgetStateChanged (int thePreviousState)
 Validates the current operation and send the state change to sketch manager. 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)
 Finds a shape by attribute if it is possible. More...
 
virtual AttributePtr findAttribute (const ObjectPtr &theObject, const GeomShapePtr &theGeomShape)
 Finds an attribute by geom shape if it is possible. More...
 
virtual std::shared_ptr< Events_MessagereentrantMessage ()
 Returns reentrant message if it was accepted. More...
 
virtual void setReentrantPreSelection (const std::shared_ptr< Events_Message > &theMessage)
 Put current selection into reentrant message. More...
 
virtual ModuleBase_ITreeNoderootNode () const
 Returns root tree node which represents a data model. More...
 
XGUI_WorkshopgetWorkshop () const
 Returns the workshop. 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 launchModal (const QString &theCmdId)
 Executes feature as a modal dialog box. More...
 
ModuleBase_IWorkshopworkshop () const
 Returns current workshop. 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 ModuleBase_OperationcreateOperation (const std::string &theCmdId)
 Creates a new operation. More...
 
virtual void updateObjectBrowserMenu (const QMap< QString, QAction * > &theStdActions)
 Update state of pop-up menu items in object browser. More...
 
void getXMLRepresentation (const std::string &theFeatureId, std::string &theXmlCfg, std::string &theDescription)
 Returns XML information by the feature index. More...
 
virtual EVENTS_EXPORT bool groupMessages ()
 Listener that needs mostly grouped messages received returns true in this method. More...
 

Static Public Member Functions

static void setTexture (const AISObjectPtr &thePrs, const ResultPtr &theResult)
 add texture More...
 

Protected Slots

virtual void onSelectionChanged ()
 Called when previous operation is finished. More...
 
void onKeyRelease (ModuleBase_IViewWindow *theWnd, QKeyEvent *theEvent)
 SLOT, that is called by key release in the viewer. More...
 
void onViewCreated (ModuleBase_IViewWindow *)
 A slot called on view window creation. More...
 
void onChoiceChanged (ModuleBase_ModelWidget *theWidget, int theIndex)
 A slot to change property panel title by choice type change if the title information exists in the XML definition of this control attribute. More...
 

Protected Member Functions

virtual void customSubShapesSelectionModes (QIntList &theModes)
 Appends specific selection modes for the module to the list of types. More...
 
void storeConstraintsState (const std::string &theFeatureKindId)
 Sets the constraints states in internal map. More...
 
void updateConstraintsState (const std::string &theFeatureKind)
 If the feature kind is a geometrical or dimensional constraint, set visible state for all types of constraints. More...
 
virtual void registerValidators ()
 Register validators for this module. More...
 
virtual void connectToPropertyPanel (ModuleBase_ModelWidget *theWidget, const bool isToConnect)
 Connects or disconnects to the value changed signal of the property panel widgets. More...
 
void updateSketcherOnStart (ModuleBase_Operation *theOperation)
 Updates reentrant manager state or sketcher operations for the started operation. More...
 
void updatePresentationsOnStart (ModuleBase_Operation *theOperation)
 Updates presetnations of results and arguments by operation start. More...
 
virtual void registerProperties ()
 Register properties of this module. More...
 
virtual ModuleBase_OperationgetNewOperation (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...
 
void groupWhileFlush (const std::shared_ptr< Events_Message > &theMessage)
 Allows to group messages while they are flushed (for flush for groupMessages=true listeners) More...
 
EVENTS_EXPORT void flushGrouped (const Events_ID &theID)
 Sends myGroups on flush finish. More...
 

Protected Attributes

ModuleBase_IWorkshopmyWorkshop
 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
 

Detailed Description

Implementation of Partset module.

Member Enumeration Documentation

◆ ModuleBase_CustomizeFlag

enumeration to know which objects should be customized

Enumerator
CustomizeResults 

references of other objects referenced to the current feature

CustomizeHighlightedObjects 

results of the current feature

highlighted objects of the active widget

Constructor & Destructor Documentation

◆ PartSet_Module()

PartSet_Module::PartSet_Module ( ModuleBase_IWorkshop theWshop)

Constructor.

Parameters
theWshopa pointer to a workshop

Member Function Documentation

◆ storeSelection()

void PartSet_Module::storeSelection ( )
virtual

Stores the current selection.

Reimplemented from ModuleBase_IModule.

◆ restoreSelection()

void PartSet_Module::restoreSelection ( )
virtual

Restores the current selection.

Reimplemented from ModuleBase_IModule.

◆ createWidgetByType()

ModuleBase_ModelWidget * PartSet_Module::createWidgetByType ( const std::string &  theType,
QWidget theParent,
Config_WidgetAPI theWidgetApi 
)
virtual

Creates custom widgets for property panel.

Reimplemented from ModuleBase_IModule.

◆ activeWidget()

ModuleBase_ModelWidget * PartSet_Module::activeWidget ( ) const
virtual

Returns the active widget, by default it is the property panel active widget If the internal edit operation is started, this is the first widget of the operation.

Implements ModuleBase_IModule.

◆ propertyPanelDefined()

void PartSet_Module::propertyPanelDefined ( ModuleBase_Operation theOperation)
virtual

Call back forlast tuning of property panel before operation performance.

Reimplemented from ModuleBase_IModule.

◆ createWidgets()

bool PartSet_Module::createWidgets ( const FeaturePtr &  theFeature,
const QString &  theXmlRepr,
QList< ModuleBase_ModelWidget * > &  theWidgets 
) const
virtual

If there is found selected attribute, widgets are created and contains only a widget for the attribute It is important for Property Panel filling by sketch point attribute.

Parameters
theFeaturea feature of the started operation
theXmlRepran XML representation of the operation
theWidgetsa list of created widgets
Returns
boolean result, false by default

Reimplemented from ModuleBase_IModule.

◆ editFeature()

void PartSet_Module::editFeature ( FeaturePtr  theFeature)
virtual

Launching of a edit operation on the feature.

Parameters
theFeaturefeature for editing

Reimplemented from ModuleBase_IModule.

◆ canCommitOperation()

bool PartSet_Module::canCommitOperation ( ) const
virtual

Returns true if the operation can be committed.

Result in default implementation is true.

Returns
boolean value

Reimplemented from ModuleBase_IModule.

◆ launchOperation()

void PartSet_Module::launchOperation ( const QString &  theCmdId,
const bool &  isStartAfterCommitOnly 
)
virtual

Creates an operation and send it to loop.

Parameters
theCmdIdthe operation name
isStartAfterCommitOnlyoperation is launched if there is no active operation or it is committed

Reimplemented from ModuleBase_IModule.

◆ operationStarted()

void PartSet_Module::operationStarted ( ModuleBase_Operation theOperation)
virtual

Realizes some functionality by an operation start Displays all sketcher sub-Objects, hides sketcher result, appends selection filters Activate the operation presentation.

Parameters
theOperationa started operation

Restart sketcher operations automatically it is important to call method of sketch reentrant manager before filling of PP because it fills some created feature attributes, these new values should be used to fill the property panel

state of command actions should be updated after displayed objects modification because deactivation(for example) of objects may influence on selection in the viewer State of command actions may depend on selection in the viewer(e.g. Sketch)

Reimplemented from ModuleBase_IModule.

◆ operationResumed()

void PartSet_Module::operationResumed ( ModuleBase_Operation theOperation)
virtual

Realizes some functionality by an operation resume Activate the operation presentation.

Parameters
theOperationa resumed operation

Reimplemented from ModuleBase_IModule.

◆ operationCommitted()

void PartSet_Module::operationCommitted ( ModuleBase_Operation theOperation)
virtual

Realizes some functionality by an operation commit Restarts sketcher operation automatically of it is necessary.

Parameters
theOperationa committed operation

deactivate of overconstraint listener should be performed after Sketch commit (#2176)

Restart sketcher operations automatically

Reimplemented from ModuleBase_IModule.

◆ operationAborted()

void PartSet_Module::operationAborted ( ModuleBase_Operation theOperation)
virtual

Realizes some functionality by an operation abort Hides all sketcher sub-Objects, displays sketcher result and removes selection filters.

Parameters
theOperationan aborted operation

Restart sketcher operations automatically

deactivate of overconstraint listener should be performed after Sketch abort (#2176)

Reimplemented from ModuleBase_IModule.

◆ operationStopped()

void PartSet_Module::operationStopped ( ModuleBase_Operation theOperation)
virtual

Realizes some functionality by an operation stop Hides all sketcher sub-Objects, displays sketcher result and removes selection filters.

Parameters
theOperationa stopped operation

Reimplemented from ModuleBase_IModule.

◆ currentOperation()

ModuleBase_Operation * PartSet_Module::currentOperation ( ) const
virtual

Returns current operation.

Implements ModuleBase_IModule.

◆ canUndo()

bool PartSet_Module::canUndo ( ) const
virtual

Returns True if there are available Undos and the sketch manager allows undo.

Returns
the boolean result

Reimplemented from ModuleBase_IModule.

◆ canRedo()

bool PartSet_Module::canRedo ( ) const
virtual

Returns True if there are available Redos and the sketch manager allows redo.

Returns
the boolean result

Reimplemented from ModuleBase_IModule.

◆ canApplyAction()

bool PartSet_Module::canApplyAction ( const ObjectPtr &  theObject,
const QString &  theActionId 
) const
virtual

Returnas true if the action can be applyed to the object.

Parameters
theObjecta checked object
theActionIdan identifier of action, to be found in the menu manager like "DELETE_CMD"
Returns
the a booean result

Implements ModuleBase_IModule.

◆ canEraseObject()

bool PartSet_Module::canEraseObject ( const ObjectPtr &  theObject) const
virtual

Returns True if the current operation can be committed.

Asks the sketch manager.

Returns
a boolean value Returns whether the object can be erased at the bounds of the active operation. The sub-objects of the current operation can not be erased
Parameters
theObjecta model object

Reimplemented from ModuleBase_IModule.

◆ canDisplayObject()

bool PartSet_Module::canDisplayObject ( const ObjectPtr &  theObject) const
virtual

Returns whether the object can be displayed at the bounds of the active operation.

Display only current operation results for usual operation and ask the sketcher manager if it is a sketch operation

Parameters
theObjecta model object

Reimplemented from ModuleBase_IModule.

◆ canUsePreselection()

bool PartSet_Module::canUsePreselection ( const QString &  thePreviousOperationKind,
const QString &  theStartedOperationKind 
)
virtual

Returns parent result if accepted, true if the started operation is a nested operation of the previous operation.

Parameters
thePreviousOperationKinda kind of previous operation
theStartedOperationKinda kind of a new operation

Reimplemented from ModuleBase_IModule.

◆ canActivateSelection()

bool PartSet_Module::canActivateSelection ( const ObjectPtr &  theObject) const
virtual

Make some functionality after the objects are hidden in viewer.

Parameters
theObjectsa list of hidden objects Returns true if selection for the object can be activate. For sketch operation allow the selection activation if the operation is edit, for other operation uses the default result
theObjecta model object

Reimplemented from ModuleBase_IModule.

◆ addObjectBrowserMenu()

void PartSet_Module::addObjectBrowserMenu ( QMenu theMenu) const
virtual

Add menu atems for object browser into the given menu.

Parameters
theMenua popup menu to be shown in the object browser

Reimplemented from ModuleBase_IModule.

◆ addViewerMenu()

bool PartSet_Module::addViewerMenu ( const QMap< QString, QAction * > &  theStdActions,
QWidget theParent,
QMap< int, QAction * > &  theMenuActions 
) const
virtual

Add menu items for viewer into the actions map.

Parameters
theStdActionsa map of standard actions
theParenta parent widget
theMenuActionsmap of action/menu for the desirable index in the viewer menu
Returns
true if items are added and there is no necessity to provide standard menu

Reimplemented from ModuleBase_IModule.

◆ activeSelectionModes()

void PartSet_Module::activeSelectionModes ( QIntList &  theModes)
virtual

Returns a list of modes, where the AIS objects should be activated.

Parameters
theModesa list of modes

Reimplemented from ModuleBase_IModule.

◆ moduleSelectionModes()

void PartSet_Module::moduleSelectionModes ( int  theModesType,
QIntList &  theModes 
)
virtual

Appends specific selection modes for the module to the list of types.

Parameters
theModesTypecombination of available selection filters
theModesa selection modes to be extended

Implements ModuleBase_IModule.

◆ moduleSelectionFilters()

void PartSet_Module::moduleSelectionFilters ( const QIntList &  theFilterTypes,
SelectMgr_ListOfFilter &  theSelectionFilters 
)
virtual

Appends into container of filters module filters corresponded to the modes type.

Parameters
theFilterTypescontainer of available selection filters
theSelectionFilters[out] container to be extend by elements

Implements ModuleBase_IModule.

◆ isMouseOverWindow()

bool PartSet_Module::isMouseOverWindow ( )

Returns whether the mouse enter the viewer's window.

Returns
true if items are added and there is no necessity to provide standard menu

◆ sketchMgr()

PartSet_SketcherMgr* PartSet_Module::sketchMgr ( ) const
inline

Returns sketch manager object.

◆ sketchReentranceMgr()

PartSet_SketcherReentrantMgr* PartSet_Module::sketchReentranceMgr ( ) const
inline

Returns sketch reentrant manager.

◆ getGeomSelection()

void PartSet_Module::getGeomSelection ( const std::shared_ptr< ModuleBase_ViewerPrs > &  theSelected,
ObjectPtr &  theObject,
AttributePtr &  theAttribute 
)
virtual

Find object and attribute(if selected) for the given viewer selection.

Parameters
theSelecteda viewer selection
theObjecta selected model object
theAttributea selected model attribute

◆ overconstraintListener()

PartSet_OverconstraintListener* PartSet_Module::overconstraintListener ( )
inline

Returns listener of overconstraint signal.

Returns
the listener

◆ isSketchNeutralPointActivated()

bool PartSet_Module::isSketchNeutralPointActivated ( ) const

Returns true if the current operation is not reentrant and the current state of the application is not in launch operation mode.

Returns
boolean value

◆ closeDocument()

void PartSet_Module::closeDocument ( )
virtual

Performs functionality on closing document.

Implements ModuleBase_IModule.

◆ clearViewer()

void PartSet_Module::clearViewer ( )
virtual

Clears specific presentations in the viewer.

Implements ModuleBase_IModule.

◆ processEvent()

void PartSet_Module::processEvent ( const std::shared_ptr< Events_Message > &  theMessage)
virtual

Event Listener method.

Parameters
theMessagean event message

Implements Events_Listener.

◆ setCustomized()

void PartSet_Module::setCustomized ( const FeaturePtr &  theFeature)

Set the object with the object results are customized.

Parameters
theFeaturea feature

◆ isCustomPrsActivated()

bool PartSet_Module::isCustomPrsActivated ( const ModuleBase_CustomizeFlag theFlag) const
virtual

Return true if the custom presentation is activated.

Parameters
theFlaga flag of level of customization, which means that only part of sub-elements
Returns
boolean value

Reimplemented from ModuleBase_IModule.

◆ activateCustomPrs()

void PartSet_Module::activateCustomPrs ( const FeaturePtr &  theFeature,
const ModuleBase_CustomizeFlag theFlag,
const bool  theUpdateViewer 
)
virtual

Activate custom presentation for the object.

Parameters
theFeaturea feature instance
theFlaga flag of level of customization, which means that only part of sub-elements
theUpdateViewerthe parameter whether the viewer should be update immediately

Reimplemented from ModuleBase_IModule.

◆ deactivateCustomPrs()

void PartSet_Module::deactivateCustomPrs ( const ModuleBase_CustomizeFlag theFlag,
const bool  theUpdateViewer 
)
virtual

Deactivate custom presentation for the object.

Parameters
theFlaga flag of level of customization, which means that only part of sub-elements
theUpdateViewerthe parameter whether the viewer should be update immediately

Reimplemented from ModuleBase_IModule.

◆ customizeFeature()

bool PartSet_Module::customizeFeature ( ObjectPtr  theObject,
const ModuleBase_CustomizeFlag theFlag,
const bool  theUpdateViewer 
)
virtual

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

Parameters
theObjectan object instance
theFlaga flag of level of customization, which means that only part of sub-elements should be updated(e.g. only highlighted elements)
theUpdateViewerthe parameter whether the viewer should be update immediatelly
Returns
true if the object is modified

Reimplemented from ModuleBase_IModule.

◆ disableCustomMode()

void PartSet_Module::disableCustomMode ( ModuleBase_CustomizeFlag  theMode)
virtual

Disable displaying of custom mode.

Parameters
theModea mode to disable

Reimplemented from ModuleBase_IModule.

◆ enableCustomModes()

void PartSet_Module::enableCustomModes ( )
virtual

Enables disabled custom mode.

Reimplemented from ModuleBase_IModule.

◆ customizeObjectBrowser()

void PartSet_Module::customizeObjectBrowser ( QWidget theObjectBrowser)
virtual

This method is called on object browser creation for customisation of module specific features.

Parameters
theObjectBrowsera pinter on Object Browser widget

Reimplemented from ModuleBase_IModule.

◆ getVisualLayerId()

int PartSet_Module::getVisualLayerId ( ) const
inline

Returns the viewer Z layer.

◆ createPresentation()

AISObjectPtr PartSet_Module::createPresentation ( const ObjectPtr &  theResult)
virtual

Create specific for the module presentation.

Parameters
theResultan object for presentation
Returns
created presentation or NULL(default value)

Reimplemented from ModuleBase_IModule.

◆ customizePresentation()

void PartSet_Module::customizePresentation ( const ObjectPtr &  theObject,
const AISObjectPtr &  thePrs 
) const
virtual

Customize presentation according to objects attributes.

Parameters
theObjectan object for presentation
thePrsa presentation object

set texture parameters, if any

Reimplemented from ModuleBase_IModule.

◆ findPresentedObject()

ObjectPtr PartSet_Module::findPresentedObject ( const AISObjectPtr &  theAIS) const
virtual

Returns data object by AIS.

If last line finished on vertex the lines creation sequence has to be break

Implements ModuleBase_IModule.

◆ canBeShaded()

bool PartSet_Module::canBeShaded ( HandlettheAIS  ) const
virtual

Returns true if the presentation can be shown in shading mode.

Parameters
theAISpresentation to be checked
Returns
boolean value

Reimplemented from ModuleBase_IModule.

◆ updateViewerMenu()

void PartSet_Module::updateViewerMenu ( const QMap< QString, QAction * > &  theStdActions)
virtual

Update state of pop-up menu items in viewer.

Parameters
theStdActions- a map of standard actions

Reimplemented from ModuleBase_IModule.

◆ isActionEnableStateFixed()

bool PartSet_Module::isActionEnableStateFixed ( const int  theActionId) const
virtual

Returns true if the action should be always enabled.

Parameters
theActionIdan action index: Accept or Accept All
Returns
boolean value

Reimplemented from ModuleBase_IModule.

◆ getFeatureError()

QString PartSet_Module::getFeatureError ( const FeaturePtr &  theFeature)
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.

Returns
string value

Reimplemented from ModuleBase_IModule.

◆ grantedOperationIds()

void PartSet_Module::grantedOperationIds ( ModuleBase_Operation theOperation,
QStringList &  theIds 
) const
virtual

Returns list of granted operation indices.

Reimplemented from ModuleBase_IModule.

◆ widgetStateChanged()

void PartSet_Module::widgetStateChanged ( int  thePreviousState)
virtual

Validates the current operation and send the state change to sketch manager.

Parameters
thePreviousStatethe previous widget value state

Reimplemented from ModuleBase_IModule.

◆ processEnter()

bool PartSet_Module::processEnter ( const std::string &  thePreviousAttributeID)
virtual

Returns true if the event is processed.

It gives the reentrance manager to process the enter.

Parameters
thePreviousAttributeIDan index of the previous active attribute

Reimplemented from ModuleBase_IModule.

◆ beforeOperationStopped()

void PartSet_Module::beforeOperationStopped ( ModuleBase_Operation theOperation)
virtual

Performs some GUI actions before an operation transaction is stopped Default realization is empty.

Reimplemented from ModuleBase_IModule.

◆ findShape()

GeomShapePtr PartSet_Module::findShape ( const AttributePtr &  theAttribute)
virtual

Finds a shape by attribute if it is possible.

Parameters
theAttributean attribute
Returns
a geom shape

Implements ModuleBase_IModule.

◆ findAttribute()

AttributePtr PartSet_Module::findAttribute ( const ObjectPtr &  theObject,
const GeomShapePtr &  theGeomShape 
)
virtual

Finds an attribute by geom shape if it is possible.

Parameters
theObjectan object of the attribute
theGeomShapea geom shape
Returns
theAttribute

Implements ModuleBase_IModule.

◆ reentrantMessage()

std::shared_ptr< Events_Message > PartSet_Module::reentrantMessage ( )
virtual

Returns reentrant message if it was accepted.

Implements ModuleBase_IModule.

◆ setReentrantPreSelection()

void PartSet_Module::setReentrantPreSelection ( const std::shared_ptr< Events_Message > &  theMessage)
virtual

Put current selection into reentrant message.

Parameters
theMessagea message of reentrant operation

Implements ModuleBase_IModule.

◆ rootNode()

ModuleBase_ITreeNode * PartSet_Module::rootNode ( ) const
virtual

Returns root tree node which represents a data model.

Implements ModuleBase_IModule.

◆ getWorkshop()

XGUI_Workshop * PartSet_Module::getWorkshop ( ) const

Returns the workshop.

◆ createFeatures()

void PartSet_Module::createFeatures ( )
virtual

Reads description of features from XML file.

Reimplemented from ModuleBase_IModule.

◆ setTexture()

void PartSet_Module::setTexture ( const AISObjectPtr &  thePrs,
const ResultPtr &  theResult 
)
static

add texture

set color to white and change material aspect, in order to keep a natural apect of the image.

◆ onObjectDisplayed

void PartSet_Module::onObjectDisplayed ( ObjectPtr  theObject,
AISObjectPtr  theAIS 
)
virtualslot

Slolt called on object display.

Parameters
theObjecta data object
theAISa presentation object

◆ onBeforeObjectErase

void PartSet_Module::onBeforeObjectErase ( ObjectPtr  theObject,
AISObjectPtr  theAIS 
)
virtualslot

Slot called on before object erase.

Parameters
theObjecta data object
theAISa presentation object

◆ onViewTransformed

void PartSet_Module::onViewTransformed ( int  theTrsfType = 2)
virtualslot

Called on transformation in current viewer.

Parameters
theTrsfTypetype of tranformation

◆ onRemoveConflictingConstraints

void PartSet_Module::onRemoveConflictingConstraints ( )
slot

Called on remove conflicting constraints.

◆ onSelectionChanged

void PartSet_Module::onSelectionChanged ( )
protectedvirtualslot

Called when previous operation is finished.

◆ onKeyRelease

void PartSet_Module::onKeyRelease ( ModuleBase_IViewWindow theWnd,
QKeyEvent *  theEvent 
)
protectedslot

SLOT, that is called by key release in the viewer.

Parameters
theWnda view window
theEventthe key event

◆ onViewCreated

void PartSet_Module::onViewCreated ( ModuleBase_IViewWindow )
protectedslot

A slot called on view window creation.

◆ onChoiceChanged

void PartSet_Module::onChoiceChanged ( ModuleBase_ModelWidget theWidget,
int  theIndex 
)
protectedslot

A slot to change property panel title by choice type change if the title information exists in the XML definition of this control attribute.

Parameters
theWidgeta sender
theIndexthe current choice index

◆ customSubShapesSelectionModes()

void PartSet_Module::customSubShapesSelectionModes ( QIntList &  theModes)
protectedvirtual

Appends specific selection modes for the module to the list of types.

Parameters
theModesa selection modes to be extended

◆ storeConstraintsState()

void PartSet_Module::storeConstraintsState ( const std::string &  theFeatureKindId)
protected

Sets the constraints states in internal map.

If the feature kind is a dimensional constraint other dimensions are shown.

Parameters
theFeatureKindIda feature kind

◆ updateConstraintsState()

void PartSet_Module::updateConstraintsState ( const std::string &  theFeatureKind)
protected

If the feature kind is a geometrical or dimensional constraint, set visible state for all types of constraints.

Parameters
theFeatureKindIda feature kind

◆ registerValidators()

void PartSet_Module::registerValidators ( )
protectedvirtual

Register validators for this module.

Reimplemented from ModuleBase_IModule.

◆ connectToPropertyPanel()

void PartSet_Module::connectToPropertyPanel ( ModuleBase_ModelWidget theWidget,
const bool  isToConnect 
)
protectedvirtual

Connects or disconnects to the value changed signal of the property panel widgets.

Parameters
theWidgeta property contol widget
isToConnecta boolean value whether connect or disconnect

Reimplemented from ModuleBase_IModule.

◆ updateSketcherOnStart()

void PartSet_Module::updateSketcherOnStart ( ModuleBase_Operation theOperation)
protected

Updates reentrant manager state or sketcher operations for the started operation.

Parameters
theOperationthe started operation

◆ updatePresentationsOnStart()

void PartSet_Module::updatePresentationsOnStart ( ModuleBase_Operation theOperation)
protected

Updates presetnations of results and arguments by operation start.

Parameters
theOperationthe started operation

◆ actionCreated()

void ModuleBase_IModule::actionCreated ( QAction *  theFeature)
virtualinherited

Called on creation of menu item in desktop.

◆ launchModal()

void ModuleBase_IModule::launchModal ( const QString &  theCmdId)
virtualinherited

Executes feature as a modal dialog box.

Parameters
theCmdIdthe operation name

◆ workshop()

ModuleBase_IWorkshop* ModuleBase_IModule::workshop ( ) const
inlineinherited

Returns current workshop.

◆ selectionFilters()

QIntList ModuleBase_IModule::selectionFilters ( )
virtualinherited

Returns types of registered module selection filters.

Parameters
theSelectionFilters[out] container of type value

◆ HandlesselectionFilter()

virtual ModuleBase_IModule::HandlesselectionFilter ( const int  theType)
virtualinherited

Returns selection filter.

Parameters
theTypeselection filter type
theFilterinstance of filter

◆ registerSelectionFilter()

void ModuleBase_IModule::registerSelectionFilter ( const ModuleBase_SelectionFilterType  theFilterType,
const Handle &&  theFilter 
)
inherited

Append selection filter into the module and type of the filter in internal container.

Parameters
theFilterTypeselection filter type
theFilteradded filter

◆ createOperation()

ModuleBase_Operation * ModuleBase_IModule::createOperation ( const std::string &  theCmdId)
virtualinherited

Creates a new operation.

Parameters
theCmdIdthe operation name

◆ updateObjectBrowserMenu()

virtual void ModuleBase_IModule::updateObjectBrowserMenu ( const QMap< QString, QAction * > &  theStdActions)
inlinevirtualinherited

Update state of pop-up menu items in object browser.

Parameters
theStdActions- a map of standard actions

◆ getXMLRepresentation()

void ModuleBase_IModule::getXMLRepresentation ( const std::string &  theFeatureId,
std::string &  theXmlCfg,
std::string &  theDescription 
)
inherited

Returns XML information by the feature index.

Parameters
theFeatureIda feature id
theXmlCfgXML configuration
theDescriptionfeature description

◆ resumed

void ModuleBase_IModule::resumed ( ModuleBase_Operation theOp)
signalinherited

Segnal emitted when an operation is resumed.

Parameters
theOpa resumed operation

◆ onFeatureTriggered

void ModuleBase_IModule::onFeatureTriggered ( )
virtualslotinherited

Called on call of command corresponded to a feature.

◆ registerProperties()

virtual void ModuleBase_IModule::registerProperties ( )
inlineprotectedvirtualinherited

Register properties of this module.

◆ getNewOperation()

ModuleBase_Operation * ModuleBase_IModule::getNewOperation ( const std::string &  theFeatureId)
protectedvirtualinherited

Returns new instance of operation object (used in createOperation for customization)

◆ loadProprietaryPlugins()

void ModuleBase_IModule::loadProprietaryPlugins ( )
protectedinherited

Load plugins required license.

◆ processProprietaryFeatures()

void ModuleBase_IModule::processProprietaryFeatures ( )
protectedinherited

Collect features, which have valid license.

◆ groupMessages()

virtual EVENTS_EXPORT bool Events_Listener::groupMessages ( )
inlinevirtualinherited

Listener that needs mostly grouped messages received returns true in this method.

In this case during the message is flushed, all the new messages are grouped, not sended immideately and then sent in the end of flush.

Reimplemented in SketchSolver_Manager, and SketchPlugin_OverConstraintsResolver.

◆ groupWhileFlush()

void Events_Listener::groupWhileFlush ( const std::shared_ptr< Events_Message > &  theMessage)
protectedinherited

Allows to group messages while they are flushed (for flush for groupMessages=true listeners)

◆ flushGrouped()

void Events_Listener::flushGrouped ( const Events_ID theID)
protectedinherited

Sends myGroups on flush finish.

Field Documentation

◆ myWorkshop

ModuleBase_IWorkshop* ModuleBase_IModule::myWorkshop
protectedinherited

Reference to workshop.

◆ myFeaturesInFiles

std::map<std::string, std::string> ModuleBase_IModule::myFeaturesInFiles
protectedinherited

Map of features in XML.

◆ myProprietaryFeatures

std::map<std::string, std::string> ModuleBase_IModule::myProprietaryFeatures
protectedinherited

Map of features in XML, which require license but not confirmed yet.

◆ myProprietaryPlugins

std::set<std::string> ModuleBase_IModule::myProprietaryPlugins
protectedinherited

Proprietary plugins.

◆ myFeaturesValidLicense

std::set<std::string> ModuleBase_IModule::myFeaturesValidLicense
protectedinherited

Features, which have valid license.