20 #ifndef PartSet_Module_H
21 #define PartSet_Module_H
24 #include "PartSet_Tools.h"
25 #include "PartSet_OverconstraintListener.h"
26 #include "PartSet_SketcherMgr.h"
28 #include <ModuleBase_IModule.h>
29 #include <ModuleBase_Definitions.h>
30 #include <ModelAPI_Feature.h>
31 #include <ModelAPI_Attribute.h>
32 #include <ModelAPI_CompositeFeature.h>
34 #include <Events_Listener.h>
37 #include <TopoDS_Shape.hxx>
38 #include <SelectMgr_ListOfFilter.hxx>
39 #include <SelectMgr_Filter.hxx>
44 #include <QModelIndex>
112 virtual bool createWidgets(
const FeaturePtr& theFeature,
const QString& theXmlRepr,
113 QList<ModuleBase_ModelWidget*>& theWidgets)
const;
128 const bool& isStartAfterCommitOnly);
171 virtual bool canApplyAction(
const ObjectPtr& theObject,
const QString& theActionId)
const;
193 const QString& theStartedOperationKind);
214 virtual bool addViewerMenu(
const QMap<QString, QAction*>& theStdActions,
216 QMap<int, QAction*>& theMenuActions)
const;
231 SelectMgr_ListOfFilter& theSelectionFilters);
236 bool isMouseOverWindow();
248 virtual void getGeomSelection(
const std::shared_ptr<ModuleBase_ViewerPrs>& theSelected,
249 ObjectPtr& theObject, AttributePtr& theAttribute);
258 bool isSketchNeutralPointActivated()
const;
268 virtual void processEvent(
const std::shared_ptr<Events_Message>& theMessage);
285 const bool theUpdateViewer);
291 const bool theUpdateViewer);
312 const bool theUpdateViewer);
348 virtual void updateViewerMenu(
const QMap<QString, QAction*>& theStdActions);
369 virtual bool processEnter(
const std::string& thePreviousAttributeID);
378 virtual GeomShapePtr
findShape(
const AttributePtr& theAttribute);
384 virtual AttributePtr
findAttribute(
const ObjectPtr& theObject,
const GeomShapePtr& theGeomShape);
403 static void setTexture(
const AISObjectPtr& thePrs,
const ResultPtr& theResult);
421 void onRemoveConflictingConstraints();
444 virtual void customSubShapesSelectionModes(QIntList& theModes);
449 void storeConstraintsState(
const std::string& theFeatureKindId);
454 void updateConstraintsState(
const std::string& theFeatureKind);
473 void onTreeViewDoubleClick(
const QModelIndex&);
475 void onActiveDocPopup(
const QPoint&);
481 void setDefaultConstraintShown();
484 bool myIsOperationIsLaunched;
495 QMap<PartSet_Tools::ConstraintVisibleState, bool> myHasConstraintShown;
499 PartSet_SketcherMgr::FeatureToSelectionMap myCurrentSelection;
500 QModelIndex myActivePartIndex;
Base interface for any event listener.
Definition: Events_Listener.h:37
virtual EVENTS_EXPORT void processEvent(const std::shared_ptr< Events_Message > &theMessage)=0
This method is called by loop when the event is started to process.
The result of a feature.
Definition: ModelAPI_Result.h:35
Interface to a module.
Definition: ModuleBase_IModule.h:70
virtual bool canActivateSelection(const ObjectPtr &theObject) const
Make some functionality after the objects are hidden in viewer.
Definition: ModuleBase_IModule.cpp:337
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
virtual void grantedOperationIds(ModuleBase_Operation *theOperation, QStringList &theIds) const
Returns list of granted operation indices.
Definition: ModuleBase_IModule.cpp:180
virtual bool canUsePreselection(const QString &thePreviousOperationKind, const QString &theStartedOperationKind)
Returns whether the started operation may use preselection of the previous one Cases are: previous op...
Definition: ModuleBase_IModule.cpp:268
virtual void editFeature(FeaturePtr theFeature)
Launching of a edit operation on the feature.
Definition: ModuleBase_IModule.cpp:322
virtual AISObjectPtr createPresentation(const ObjectPtr &theResult)
Create specific for the module presentation.
Definition: ModuleBase_IModule.cpp:163
virtual void createFeatures()
Reads description of features from XML file.
Definition: ModuleBase_IModule.cpp:215
virtual void enableCustomModes()
Enables disabled custom mode.
Definition: ModuleBase_IModule.h:312
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 bool canUndo() const
Returns True if there are available Undos and there is not an active operation.
Definition: ModuleBase_IModule.cpp:285
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
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 bool canBeShaded(HandlettheAIS) const
Returns true if the presentation can be shown in shading mode.
Definition: ModuleBase_IModule.cpp:168
virtual void customizePresentation(const ObjectPtr &theObject, const AISObjectPtr &thePrs) const
Customize presentation according to objects attributes.
Definition: ModuleBase_IModule.h:331
virtual void operationResumed(ModuleBase_Operation *theOperation)
Realizes some functionality by an operation resume By default it emits operationResumed signal.
Definition: ModuleBase_IModule.cpp:344
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 bool canRedo() const
Returns True if there are available Redos and there is not an active operation.
Definition: ModuleBase_IModule.cpp:291
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 QString getFeatureError(const FeaturePtr &theFeature)
Returns the feature error if the current state of the feature in the module is not correct If the fea...
Definition: ModuleBase_IModule.cpp:173
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
virtual bool canEraseObject(const ObjectPtr &theObject) const
Returns True if the current operation can be committed.
Definition: ModuleBase_IModule.cpp:258
virtual bool canDisplayObject(const ObjectPtr &theObject) const
Returns whether the object can be displayed.
Definition: ModuleBase_IModule.cpp:263
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 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 launchOperation(const QString &theCmdId, const bool &isStartAfterCommitOnly)
Creates an operation and send it to loop.
Definition: ModuleBase_IModule.cpp:108
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
Interface to ViewWindow object which contains 3d scene.
Definition: ModuleBase_IViewWindow.h:34
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
This is the module custom presentation, which manage an AIS presentation, that can be filled by a fea...
Definition: PartSet_CustomPrs.h:46
Implementation of Partset module.
Definition: PartSet_Module.h:69
PartSet_SketcherMgr * sketchMgr() const
Returns sketch manager object.
Definition: PartSet_Module.h:239
void setCustomized(const FeaturePtr &theFeature)
Set the object with the object results are customized.
int getVisualLayerId() const
Returns the viewer Z layer.
Definition: PartSet_Module.h:326
PartSet_OverconstraintListener * overconstraintListener()
Returns listener of overconstraint signal.
Definition: PartSet_Module.h:253
PartSet_SketcherReentrantMgr * sketchReentranceMgr() const
Returns sketch reentrant manager.
Definition: PartSet_Module.h:242
A class for processing overconstraint situation.
Definition: PartSet_OverconstraintListener.h:40
Implementation of Root node in data tree.
Definition: PartSet_TreeNodes.h:208
A class for management of sketch operations At the time of the sketcher operation active,...
Definition: PartSet_SketcherMgr.h:106
It provides reentrant create operations in sketch, that is when all inputs are valid,...
Definition: PartSet_SketcherReentrantMgr.h:57
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:82