Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue #348 Validate sketch is disabled when point coordinates are set manually
[modules/shaper.git]
/
src
/
XGUI
/
XGUI_ObjectsBrowser.h
diff --git
a/src/XGUI/XGUI_ObjectsBrowser.h
b/src/XGUI/XGUI_ObjectsBrowser.h
index f9ae1fed396eebd1d8cd0c67675848eb252b04f1..a52c844545999bd6e91a17fa4e8663517c937d01 100644
(file)
--- a/
src/XGUI/XGUI_ObjectsBrowser.h
+++ b/
src/XGUI/XGUI_ObjectsBrowser.h
@@
-1,9
+1,13
@@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
#ifndef XGUI_ObjectsBrowser_H
#define XGUI_ObjectsBrowser_H
#include "XGUI.h"
#ifndef XGUI_ObjectsBrowser_H
#define XGUI_ObjectsBrowser_H
#include "XGUI.h"
-#include "XGUI_Constants.h"
+#include <ModuleBase_Definitions.h>
+#include <ModelAPI_Object.h>
+#include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Events.h>
#include <QWidget>
#include <QTreeView>
#include <QWidget>
#include <QTreeView>
@@
-11,87
+15,110
@@
class XGUI_DocumentDataModel;
class QLineEdit;
class XGUI_DocumentDataModel;
class QLineEdit;
-
-class XGUI_DataTree: public QTreeView
+class XGUI_DataTree : public QTreeView
{
{
-
Q_OBJECT
-public:
+Q_OBJECT
+
public:
XGUI_DataTree(QWidget* theParent);
virtual ~XGUI_DataTree();
XGUI_DataTree(QWidget* theParent);
virtual ~XGUI_DataTree();
- //! Returns list of currently selected features
- QFeatureList selectedFeatures() const { return mySelectedData; }
+ //! Returns list of currently selected objects
+ QObjectPtrList selectedObjects() const
+ {
+ return mySelectedData;
+ }
XGUI_DocumentDataModel* dataModel() const;
signals:
//! Emited when selection is changed
void selectionChanged();
XGUI_DocumentDataModel* dataModel() const;
signals:
//! Emited when selection is changed
void selectionChanged();
- void activePartChanged(
FeaturePtr thePart);
-
+ void activePartChanged(
ObjectPtr thePart);
+
//! Emited on context menu request
void contextMenuRequested(QContextMenuEvent* theEvent);
//! Emited on context menu request
void contextMenuRequested(QContextMenuEvent* theEvent);
-protected slots:
+public slots:
+ virtual void clear();
+
+ protected slots:
virtual void commitData(QWidget* theEditor);
virtual void commitData(QWidget* theEditor);
-protected:
+
protected:
virtual void mouseDoubleClickEvent(QMouseEvent* theEvent);
virtual void contextMenuEvent(QContextMenuEvent* theEvent);
virtual void mouseDoubleClickEvent(QMouseEvent* theEvent);
virtual void contextMenuEvent(QContextMenuEvent* theEvent);
-private slots:
+
private slots:
//! Called when selection in Data Tree is changed
void onSelectionChanged(const QItemSelection& theSelected, const QItemSelection& theDeselected);
//! Called when selection in Data Tree is changed
void onSelectionChanged(const QItemSelection& theSelected, const QItemSelection& theDeselected);
-private:
+
private:
//! List of currently selected data
//! List of currently selected data
- Q
Feature
List mySelectedData;
+ Q
ObjectPtr
List mySelectedData;
};
};
-
/**\class XGUI_ObjectsBrowser
* \ingroup GUI
* \brief Object browser window object. Represents data tree of current data structure
*/
/**\class XGUI_ObjectsBrowser
* \ingroup GUI
* \brief Object browser window object. Represents data tree of current data structure
*/
-
class XGUI_EXPORT XGUI_ObjectsBrowser : public QWidget
+class XGUI_EXPORT XGUI_ObjectsBrowser : public QWidget
{
{
-
Q_OBJECT
-public:
+Q_OBJECT
+
public:
XGUI_ObjectsBrowser(QWidget* theParent);
virtual ~XGUI_ObjectsBrowser();
//! Returns Model which provides access to data objects
XGUI_ObjectsBrowser(QWidget* theParent);
virtual ~XGUI_ObjectsBrowser();
//! Returns Model which provides access to data objects
- XGUI_DocumentDataModel* dataModel() const { return myDocModel; }
+ XGUI_DocumentDataModel* dataModel() const
+ {
+ return myDocModel;
+ }
- //! Returns list of currently selected features
- QFeatureList selectedFeatures() const { return myFeaturesList; }
+ //! Returns list of currently selected objects
+ QObjectPtrList selectedObjects() const
+ {
+ return myObjectsList;
+ }
+
+ void setObjectsSelected(const QObjectPtrList& theObjects);
//! Returns currently selected indexes
//! Returns currently selected indexes
- QModelIndexList selectedIndexes() const { return myTreeView->selectionModel()->selectedIndexes(); }
+ QModelIndexList selectedIndexes() const
+ {
+ return myTreeView->selectionModel()->selectedIndexes();
+ }
//! Returns TreeView widget
//! Returns TreeView widget
- XGUI_DataTree* treeView() const { return myTreeView; }
+ XGUI_DataTree* treeView() const
+ {
+ return myTreeView;
+ }
//! Activates currently selected part. Signal activePartChanged will not be sent
//! Activates currently selected part. Signal activePartChanged will not be sent
- void activatePart(const
Feature
Ptr& thePart);
+ void activatePart(const
ResultPart
Ptr& thePart);
void rebuildDataTree();
void rebuildDataTree();
+ void processEvent(const std::shared_ptr<Events_Message>& theMessage);
+
+ // Resets the object browser into initial state
+ void clearContent();
+
signals:
//! Emited when selection is changed
void selectionChanged();
//! Emited when current active document is changed
signals:
//! Emited when selection is changed
void selectionChanged();
//! Emited when current active document is changed
- void activePartChanged(
FeaturePtr thePart);
-
+ void activePartChanged(
ObjectPtr thePart);
+
//! Emited on context menu request
void contextMenuRequested(QContextMenuEvent* theEvent);
//! Emited on context menu request
void contextMenuRequested(QContextMenuEvent* theEvent);
-protected:
+
protected:
virtual bool eventFilter(QObject* obj, QEvent* theEvent);
virtual bool eventFilter(QObject* obj, QEvent* theEvent);
-private slots:
- void onActivePartChanged(
Feature
Ptr thePart);
+
private slots:
+ void onActivePartChanged(
Object
Ptr thePart);
void onContextMenuRequested(QContextMenuEvent* theEvent);
void onLabelContextMenuRequested(const QPoint& thePnt);
void onContextMenuRequested(QContextMenuEvent* theEvent);
void onLabelContextMenuRequested(const QPoint& thePnt);
@@
-100,7
+127,7
@@
private slots:
void onSelectionChanged();
void onSelectionChanged();
-private:
+
private:
void closeDocNameEditing(bool toSave);
//! Internal model
void closeDocNameEditing(bool toSave);
//! Internal model
@@
-109,7
+136,7
@@
private:
QLineEdit* myActiveDocLbl;
XGUI_DataTree* myTreeView;
QLineEdit* myActiveDocLbl;
XGUI_DataTree* myTreeView;
- Q
FeatureList myFeature
sList;
+ Q
ObjectPtrList myObject
sList;
};
};
-#endif
\ No newline at end of file
+#endif