1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_IWorkshop.h
4 // Created: 2 June 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ModuleBase_IWorkshop_H
8 #define ModuleBase_IWorkshop_H
10 #include "ModuleBase.h"
11 #include "ModuleBase_Definitions.h"
12 #include <ModuleBase_FilterValidated.h>
14 #include <ModelAPI_Object.h>
15 #include <GeomAPI_AISObject.h>
19 class ModuleBase_IModule;
20 class ModuleBase_ISelection;
21 class ModuleBase_IViewer;
22 class ModuleBase_IPropertyPanel;
23 class ModuleBase_Operation;
24 class ModuleBase_FilterFactory;
28 * Class which provides access to Workshop object serveces
30 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
35 /// \param theParent parent object
36 ModuleBase_IWorkshop(QObject* theParent);
38 virtual ~ModuleBase_IWorkshop()
41 /// Return current selection instance
42 virtual ModuleBase_ISelection* selection() const = 0;
44 /// Activate sub-shapes selection (opens local context)
45 /// Types has to be defined according to TopAbs_ShapeEnum
46 virtual void activateSubShapesSelection(const QIntList& theTypes) = 0;
48 /// Deactivate sub-shapes selection (closes local context)
49 virtual void deactivateSubShapesSelection() = 0;
51 //! Returns instance of loaded module
52 virtual ModuleBase_IModule* module() const = 0;
54 //! Returns current viewer
55 virtual ModuleBase_IViewer* viewer() const = 0;
57 //! Returns property panel
58 virtual ModuleBase_IPropertyPanel* propertyPanel() const = 0;
60 /// A filter to process an attribute validators
62 Handle(ModuleBase_FilterValidated) validatorFilter();
64 //! Returns the factory of selection filters : the only one instance per application
65 ModuleBase_FilterFactory* selectionFilters() const;
67 //! Returns currently active operation
68 virtual ModuleBase_Operation* currentOperation() const = 0;
70 //! Returns true if the operation with id theId can be started
71 virtual bool canStartOperation(QString theId) = 0;
73 //! Returns AIS opbject by data object
74 virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
76 //! Returns data object by AIS
77 virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
79 //! Select features clearing previous selection.
80 //! If the list is empty then selection will be cleared
81 virtual void setSelected(const QObjectPtrList& theFeatures) = 0;
84 /// Signal selection chaged.
85 void selectionChanged();
87 /// Signal which is emited after activation of property panel
88 void propertyPanelActivated();
91 /// A filter to process an attribute validators
92 Handle(ModuleBase_FilterValidated) myValidatorFilter;