#include <QKeySequence>
#include <QIcon>
+#ifndef HAVE_SALOME
class AppElements_MainWindow;
class AppElements_Command;
class AppElements_Workbench;
+#endif
class XGUI_ActionsMgr;
class XGUI_ContextMenuMgr;
class QAction;
+
/**\class XGUI_Workshop
* \ingroup GUI
* \brief Class which defines a configuration of the application (Workshop) and launches it.
//! Starting of the application
void startApplication();
- // Activates the module controls. Should be called after module creation
+ /// Activates the module controls. Should be called after module creation
void activateModule();
- // Deactivates the module controls. Should be called after module creation
+ /// Deactivates the module controls. Should be called after module creation
void deactivateModule();
+#ifndef HAVE_SALOME
//! Returns main window (Desktop) of the application
AppElements_MainWindow* mainWindow() const
{
return myMainWindow;
}
+ //! Creates and adds a new workbench (menu group) with the given name and returns it
+ AppElements_Workbench* addWorkbench(const QString& theName);
+#endif
+
//! Returns selection manager object
XGUI_SelectionMgr* selector() const
{
return myContextMenuMgr;
}
- //! Creates and adds a new workbench (menu group) with the given name and returns it
- AppElements_Workbench* addWorkbench(const QString& theName);
-
//! Returns an object which provides interface to Salome Module (LightApp_Module)
XGUI_SalomeConnector* salomeConnector() const
{
//! Delete features
void deleteObjects();
+ //! Searches for selected features unused in other (not selected) features. If one or several
+ //! selected features are found, a warning message proposes to delete them. It contains
+ //! the list of features to be deleted.
+ void cleanHistory();
+
//! Returns true if the selected feature can be moved to the position after the current feature
//! \return boolean value
bool canMoveFeature();
/// \param theUpdateViewer update viewer flag
void synchronizeGroupInViewer(const DocumentPtr& theDoc, const std::string& theGroup, bool theUpdateViewer);
+ /// A constant string used for "Move to end" command definition
+ /// It is used for specific processing of Undo/Redo for this command.
+ static QString MOVE_TO_END_COMMAND;
+
signals:
/// Emitted when selection happens in Salome viewer
void salomeViewerSelection();
/// update history list (undo/redo commands)
void updateHistory();
- /// Create a new document
- void onNew();
-
- /// Open document from file
- void onOpen();
-
/// Save current document
bool onSave();
/// Save current document to a file selected by user
bool onSaveAs();
- /// Exit application
- void onExit();
-
/// Undo last command
void onUndo(int times = 1);
/// Redo previous command
void onRedo(int times = 1);
- /// Rebuild data tree
- void onRebuild();
+ // Rebuild data tree
+ //void onRebuild();
- /// Open preferences dialog box
- void onPreferences();
+ /// Validates the operation to change the "Apply" button state.
+ /// \param thePreviousState the previous state of the widget
+ void onWidgetStateChanged(int thePreviousState);
/// Show property panel
void showPropertyPanel();
/// Close document
void closeDocument();
+ /// Open document from file
+ void onOpen();
+
+ /// Create a new document
+ void onNew();
+
+#ifndef HAVE_SALOME
+ /// Exit application
+ void onExit();
+
+ /// Open preferences dialog box
+ void onPreferences();
+#endif
+
+ /// Activates/deactivates the trihedron in the viewer AIS context
+ void onTrihedronVisibilityChanged(bool theState);
+
protected:
/// Sets the granted operations for the parameter operation. Firstly, it finds the nested features
/// and set them into the operation. Secondly, it asks the module about ids of granted operations.
/// \param theOperation an operation
void setPropertyPanel(ModuleBase_Operation* theOperation);
+ /// Connects or disconnects to the value changed signal of the property panel widgets
+ /// \param isToConnect a boolean value whether connect or disconnect
+ void connectToPropertyPanel(const bool isToConnect);
+
private:
/// Display all results
//void displayAllResults();
/// the operation can be committed and do it if it returns true.
void onAcceptActionClicked();
- /// Listens the corresponded signal from operation manager and send it with the Ok
- /// action to operation manager.
- /// \param theEnabled an enabled state for the action
- //void onValidationStateChanged(bool theEnabled);
-
- //connect(myOperationMgr, SIGNAL(validationStateChanged(bool)),
- // aOkAct, SLOT(setEnabled(bool)));
-
-
private:
/// Init menu
void initMenu();
//! \param theSlot - onUndo(int) or onRedo(int) SLOT
void addHistoryMenu(QObject* theObject, const char* theSignal, const char* theSlot);
+
+ /// Calls removeFeature of the document for each object in the list
+ //! \param theList an objects to be deleted
+ //! \param theIgnoredFeatures a list of features to be ignored during delete
+ //! \param theActionId an action command key to find context menu object types enabled for remove
+ bool removeFeatures(const QObjectPtrList& theList,
+ const std::set<FeaturePtr>& theIgnoredFeatures,
+ const QString& theActionId);
+
//! Creates list of actions (commands) by given history list from session
QList<ActionInfo> processHistoryList(const std::list<std::string>&) const;
private:
+#ifndef HAVE_SALOME
AppElements_MainWindow* myMainWindow;
+#endif
+
ModuleBase_IModule* myModule;
XGUI_ErrorMgr* myErrorMgr;
XGUI_ObjectsBrowser* myObjectBrowser;