Salome HOME
Source documentation updated. Obsolete files removed
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 22 Sep 2015 16:52:07 +0000 (19:52 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 22 Sep 2015 16:52:07 +0000 (19:52 +0300)
67 files changed:
src/ModuleBase/CMakeLists.txt
src/ModuleBase/ModuleBase_IDocumentDataModel.cpp [deleted file]
src/ModuleBase/ModuleBase_IDocumentDataModel.h [deleted file]
src/ModuleBase/ModuleBase_IErrorMgr.h
src/ModuleBase/ModuleBase_IModule.h
src/ModuleBase/ModuleBase_ISelection.h
src/ModuleBase/ModuleBase_IViewer.h
src/ModuleBase/ModuleBase_IWorkshop.h
src/ModuleBase/ModuleBase_ModelWidget.h
src/ModuleBase/ModuleBase_PageGroupBox.h
src/ModuleBase/ModuleBase_PageWidget.h
src/ModuleBase/ModuleBase_PagedContainer.h
src/ModuleBase/ModuleBase_ParamSpinBox.cpp
src/ModuleBase/ModuleBase_ParamSpinBox.h
src/ModuleBase/ModuleBase_ToolBox.h
src/ModuleBase/ModuleBase_ViewerFilters.h
src/ModuleBase/ModuleBase_WidgetExprEditor.h
src/ModuleBase/ModuleBase_WidgetFileSelector.h
src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
src/ModuleBase/ModuleBase_WidgetLineEdit.h
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/ModuleBase/ModuleBase_WidgetMultiSelector.h
src/ModuleBase/ModuleBase_WidgetSelector.h
src/ModuleBase/ModuleBase_WidgetSwitch.h
src/ModuleBase/ModuleBase_WidgetToolbox.h
src/ModuleBase/ModuleBase_WidgetValidated.h
src/NewGeom/NewGeom_Module.h
src/NewGeom/NewGeom_NestedButton.h
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_CustomPrs.h
src/PartSet/PartSet_DataTreeModel.cpp [deleted file]
src/PartSet/PartSet_DataTreeModel.h [deleted file]
src/PartSet/PartSet_DocumentDataModel.cpp [deleted file]
src/PartSet/PartSet_DocumentDataModel.h [deleted file]
src/PartSet/PartSet_ExternalObjectsMgr.h
src/PartSet/PartSet_LockApplyMgr.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_PartDataModel.cpp [deleted file]
src/PartSet/PartSet_PartDataModel.h [deleted file]
src/PartSet/PartSet_SketcherMgr.h
src/PartSet/PartSet_Tools.h
src/PartSet/PartSet_TopDataModel.cpp [deleted file]
src/PartSet/PartSet_TopDataModel.h [deleted file]
src/PartSet/PartSet_Validators.h
src/PartSet/PartSet_WidgetMultiSelector.h
src/PartSet/PartSet_WidgetPoint2d.h
src/PartSet/PartSet_WidgetPoint2dDistance.h
src/PartSet/PartSet_WidgetShapeSelector.h
src/PartSet/PartSet_WidgetSketchCreator.h
src/PartSet/PartSet_WidgetSketchLabel.h
src/XGUI/XGUI_ContextMenuMgr.h
src/XGUI/XGUI_CustomPrs.h
src/XGUI/XGUI_DataModel.cpp
src/XGUI/XGUI_DataModel.h
src/XGUI/XGUI_Displayer.h
src/XGUI/XGUI_ErrorMgr.h
src/XGUI/XGUI_ModuleConnector.h
src/XGUI/XGUI_ObjectsBrowser.cpp
src/XGUI/XGUI_ObjectsBrowser.h
src/XGUI/XGUI_OperationMgr.h
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_SalomeConnector.h
src/XGUI/XGUI_Tools.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h
src/XGUI/XGUI_WorkshopListener.h

index 119a717bd5a80f1cc42fb16e8afa64ad02aa47a0..a0a85d709b5c1d958d358b7d814c96f68eb029f0 100644 (file)
@@ -11,7 +11,6 @@ SET(PROJECT_HEADERS
   ModuleBase_Filter.h
   ModuleBase_FilterFactory.h
   ModuleBase_FilterValidated.h
-  ModuleBase_IDocumentDataModel.h
   ModuleBase_IErrorMgr.h
   ModuleBase_IModule.h
   ModuleBase_IPrefMgr.h
@@ -63,7 +62,6 @@ SET(PROJECT_SOURCES
   ModuleBase_Filter.cpp
   ModuleBase_FilterFactory.cpp
   ModuleBase_FilterValidated.cpp
-  ModuleBase_IDocumentDataModel.cpp
   ModuleBase_IErrorMgr.cpp
   ModuleBase_IModule.cpp
   ModuleBase_IPrefMgr.cpp
diff --git a/src/ModuleBase/ModuleBase_IDocumentDataModel.cpp b/src/ModuleBase/ModuleBase_IDocumentDataModel.cpp
deleted file mode 100644 (file)
index f59990f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        ModuleBase_IDocumentDataModel.cpp
-// Created:     28 Apr 2015
-// Author:      Vitaly SMETANNIKOV
-
-#include "ModuleBase_IDocumentDataModel.h"
-
-ModuleBase_IDocumentDataModel::ModuleBase_IDocumentDataModel(QObject* theParent) : QAbstractItemModel(theParent)
-{
-
-}
-
-void ModuleBase_IDocumentDataModel::clear()
-{
-
-}
-
-void ModuleBase_IDocumentDataModel::rebuildDataTree()
-{
-
-}
diff --git a/src/ModuleBase/ModuleBase_IDocumentDataModel.h b/src/ModuleBase/ModuleBase_IDocumentDataModel.h
deleted file mode 100644 (file)
index aecb015..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-// File:        ModuleBase_IDocumentDataModel.h
-// Created:     28 Apr 2015
-// Author:      Vitaly SMETANNIKOV
-
-
-#ifndef ModuleBase_IDocumentDataModel_H
-#define ModuleBase_IDocumentDataModel_H
-
-#include "ModuleBase.h"
-#include <QAbstractItemModel>
-#include <ModelAPI_Object.h>
-
-class MODULEBASE_EXPORT ModuleBase_IDocumentDataModel : public QAbstractItemModel
-{
-Q_OBJECT
-public:
-  ModuleBase_IDocumentDataModel(QObject* theParent);
-
-  //! Returns an object by the given Model index.
-  //! Returns 0 if the given index is not index of an object
-  virtual ObjectPtr object(const QModelIndex& theIndex) const = 0;
-
-  //! Returns index of the object
-  //! \param theObject object to find
-  virtual QModelIndex objectIndex(const ObjectPtr theObject) const = 0;
-
-  //! Clear internal data
-  virtual void clear();
-
-  //! Rebuild data tree
-  virtual void rebuildDataTree();
-
-  /// Returns last history object index
-  virtual QModelIndex lastHistoryIndex() const { return QModelIndex(); }
-
-};
-
-#endif
\ No newline at end of file
index d6423725324803ded94e5da83202ec28518b7e3b..701a49f80ee58ce649bb3d534aca4e0420c362c2 100644 (file)
 
 class ModuleBase_IPropertyPanel;
 
+/**
+ * \class ModuleBase_IErrorMgr
+ * \ingroup GUI
+ * \brief An interface to Errors manager object
+ */
 class MODULEBASE_EXPORT ModuleBase_IErrorMgr : public QObject
 {
   Q_OBJECT
 public:
   /// Default constructor
+  /// \param theParent a parent object
   ModuleBase_IErrorMgr(QObject* theParent = 0);
   /// Virtual destructor
   virtual ~ModuleBase_IErrorMgr();
index 327bb423072c080db38faa65f143eee9b2483c21..301bcbe5b193719311f74a23dbd959eade6ce9dc 100644 (file)
@@ -23,7 +23,6 @@ class Config_WidgetAPI;
 class ModuleBase_ModelWidget;\r
 class ModuleBase_Operation;\r
 class ModuleBase_IWorkshop;\r
-class ModuleBase_IDocumentDataModel;\r
 \r
 /**\r
  * \ingroup GUI\r
@@ -40,10 +39,10 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
 \r
   virtual ~ModuleBase_IModule() {}\r
 \r
-  // Add default selection filters of the module to the current viewer\r
+  /// Add default selection filters of the module to the current viewer\r
   virtual void activateSelectionFilters() {};\r
 \r
-  // Remove default selection filters of the module from the current viewer\r
+  /// Remove default selection filters of the module from the current viewer\r
   virtual void deactivateSelectionFilters() {};\r
 \r
   /// Reads description of features from XML file \r
@@ -79,7 +78,6 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   virtual void onOperationAborted(ModuleBase_Operation* theOperation) {}\r
 \r
   /// Realizes some functionality by an operation start\r
-  /// \param theOperation a started operation\r
   virtual ModuleBase_Operation* currentOperation() const = 0;\r
 \r
   /// Add menu items for viewer into the given menu\r
@@ -92,15 +90,11 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \param theMenu a popup menu to be shown in the object browser\r
   virtual void addObjectBrowserMenu(QMenu* theMenu) const {};\r
 \r
-  /// Called when it is necessary to update a command state (enable or disable it)\r
-  //virtual bool isFeatureEnabled(const QString& theCmdId) const = 0;\r
-\r
   /// Creates custom widgets for property panel\r
   /// \param theType a type of widget\r
   /// \param theParent the parent object\r
   /// \param theWidgetApi the widget configuration. The attribute of the model widget is obtained from\r
   /// \param theParentId is Id of a parent of the current attribute\r
-  /// \param theModelWidgets list of widget objects\r
   virtual ModuleBase_ModelWidget* createWidgetByType(const std::string& theType, QWidget* theParent,\r
                                       Config_WidgetAPI* theWidgetApi, std::string theParentId)\r
   {\r
@@ -147,11 +141,6 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// \returns true if the action is processed\r
   virtual bool deleteObjects() { return false; };\r
 \r
-#ifdef ModuleDataModel\r
-  /// Returns data model object for representation of data tree in Object browser\r
-  virtual ModuleBase_IDocumentDataModel* dataModel() const = 0;\r
-#endif\r
-\r
   /// Performs functionality on closing document\r
   virtual void closeDocument() = 0;\r
 \r
@@ -200,8 +189,11 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   virtual QString getFeatureError(const FeaturePtr& theFeature);\r
 \r
 signals:\r
+  /// Signal which is emitted when operation is launched\r
   void operationLaunched();\r
 \r
+  /// Segnal emitted when an operation is resumed\r
+  /// \param theOp a resumed operation\r
   void operationResumed(ModuleBase_Operation* theOp);\r
 \r
 public slots:\r
index a64335b8311cffa4fad7e8231f712b46f3096ed0..2c60a76ac05d98038825e48a222649d5ae2948fa 100644 (file)
@@ -60,6 +60,7 @@ class ModuleBase_ISelection
    */
   virtual QObjectPtrList selectedObjects() const = 0;
 
+  /// Set selected objects list
   virtual void setSelectedObjects( const QObjectPtrList& ) const = 0;
 
   /**
index a82b5d24a1c4535465120f9b9568cb723eb6ee68..7547d6c1f33ddb89ba67c065e9585ba3540af8e2 100644 (file)
@@ -79,6 +79,8 @@ Q_OBJECT
   /// Update current viewer
   virtual void update() = 0;
 
+  /// Returns a scale factor of the given view
+  /// \param theView a view object
   const double Scale(const Handle(V3d_View)& theView)
   {
     if (!myWindowScale.contains(theView))
@@ -86,13 +88,16 @@ Q_OBJECT
     return myWindowScale[theView];
   }
 
+  /// Remember a scale factor for the view object
+  /// \param theView a view object
+  /// \param theVal a scale factor
   void SetScale(const Handle(V3d_View)& theView, const double theVal) { myWindowScale[theView] = theVal; }
 
   /// Method returns True if the viewer can process editing objects 
   /// by mouse drugging. If this is impossible thet it has to return False.
   virtual bool canDragByMouse() const { return true; }
 
-  // Fit all along Z (perpendicular to display)
+  /// Fit all along Z (perpendicular to display)
   virtual void Zfitall() = 0;
 
 signals:
@@ -140,6 +145,7 @@ signals:
   void viewTransformed(int theTransformation);
 
   protected:
+    /// A map for storing a scale factors dependent on view object
     QMap<Handle(V3d_View), double> myWindowScale;
 };
 
index 67fed3b81fcc130ded827a86e23cb6129f59fe20..77f4cfe3f4da25b38949809c33747f643af71399 100644 (file)
@@ -80,22 +80,25 @@ Q_OBJECT
   virtual ModuleBase_Operation* findStartedOperation(const QString& theId) = 0;
 
   //! Returns true if the operation with id theId can be stopped
-  //! \param theId a stopped operation
+  //! \param theOperation a stopped operation
   //! \return boolean result
   virtual bool canStopOperation(ModuleBase_Operation* theOperation) = 0;
 
   //! Aborts the operation.
-  //! \param theId an aborted operation
+  //! \param theOperation an aborted operation
   virtual void abortOperation(ModuleBase_Operation* theOperation) = 0;
 
   //! Returns AIS object by data object
+  //! \param theObject a data object
   virtual AISObjectPtr findPresentation(const ObjectPtr& theObject) const = 0;
 
   //! Returns data object by AIS
+  //! \param theAIS a presentation
   virtual ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const = 0;
 
   //! Select features clearing previous selection. 
   //! If the list is empty then selection will be cleared
+  //! \param theValues a list of presentations
   virtual void setSelected(const QList<ModuleBase_ViewerPrs>& theValues) = 0;
 
 signals:
index bc01dc9a28d682bafe37c69d444d8db64ca906e5..175305244a2ca1aaaca441766dcc5e152e8659b7 100644 (file)
@@ -80,7 +80,7 @@ Q_OBJECT
   /// Set the given wrapped value to the current widget
   /// This value should be processed in the widget according to the needs
   /// \param theValues the wrapped selection values
-  /// \param toValidate the boolean value whether the value should be checked by filters
+  /// \param theToValidate the boolean value whether the value should be checked by filters
   virtual bool setSelection(QList<ModuleBase_ViewerPrs>& theValues,
                             const bool theToValidate)
   {
@@ -137,6 +137,7 @@ Q_OBJECT
   }
 
   /// Set feature which is processing by active operation
+  /// \param theFeature a feature object
   /// \param theToStoreValue a value about necessity to store the widget value to the feature
   void setFeature(const FeaturePtr& theFeature, const bool theToStoreValue = false);
 
index ee28287ed1bac16b19cdc2a91f86fbb3cd8caa43..a5f33f9f2897aeec44b9b003e71cce9182b9e647 100644 (file)
@@ -19,6 +19,7 @@ class QGridLayout;
 
 
 /*!
+ * \ingroup GUI
  * Represent a property panel's list of ModuleBase_ModelWidgets.
  */
 class MODULEBASE_EXPORT ModuleBase_PageGroupBox : public QGroupBox, public ModuleBase_PageBase
index 33d552d5fcb318a7963c951357b8428ec0c669a5..2528843bb1db9b915004a9cd3cbe9187246a08db 100644 (file)
@@ -18,6 +18,7 @@ class ModuleBase_ModelWidget;
 class QGridLayout;
 
 /*!
+ * \ingroup GUI
  * Represent a property panel's list of ModuleBase_ModelWidgets.
  */
 class MODULEBASE_EXPORT ModuleBase_PageWidget : public QFrame, public ModuleBase_PageBase
index 59730cd7d4e1afa822aaf3e7dac463b2522e78dc..b98055fc9dcb640713822ed18b6097cc5041b809 100644 (file)
@@ -21,30 +21,54 @@ class MODULEBASE_EXPORT ModuleBase_PagedContainer : public ModuleBase_ModelWidge
 {
   Q_OBJECT
  public:
+   /// A constructor
+   /// \param theParent a parent widget
+   /// \param theData a data of the widget
+   /// \param theParentId an Id of the parent object
   ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData,
                            const std::string& theParentId);
   virtual ~ModuleBase_PagedContainer();
 
+  /// Add a new page
+  /// \param theWidget a page object
+  /// \param theName a name of the page
+  /// \param theCaseId an Id of the page
+  /// \param theIcon aqn Icon of the page
   virtual int addPage( ModuleBase_PageBase* theWidget,
                        const QString& theName,
                        const QString& theCaseId,
                        const QPixmap& theIcon );
 
-  // ModuleBase_ModelWidget
+  /// Redefinition of virtual function
   virtual QList<QWidget*> getControls() const;
+
+  /// Redefinition of virtual function
   virtual bool focusTo();
+
+  /// Redefinition of virtual function
   virtual void setHighlighted(bool isHighlighted);
+
+  /// Redefinition of virtual function
   virtual void enableFocusProcessing();
 
  protected:
+   /// Returns index of current page
   virtual int currentPageIndex() const = 0;
+
+  /// Set current page by index
   virtual void setCurrentPageIndex(int ) = 0;
-  // ModuleBase_ModelWidget
+
+  /// Redefinition of virtual function
   virtual void activateCustom();
+
+  /// Redefinition of virtual function
   virtual bool storeValueCustom() const;
+
+  /// Redefinition of virtual function
   virtual bool restoreValueCustom();
 
  protected slots:
+   /// A slot called on page change
   void onPageChanged();
 
  private:
index febd29badbf419cdbf187edbbcf8533742bf04e6..bfd0823866a868242e6e83567dd7933792166e2d 100644 (file)
 #include <string>
 #include <iostream>
 
-/*!
- \class ModuleBase_ParamSpinBox
- */
-
-/*!
- \brief Constructor.
-
- Constructs a spin box with 0.0 as minimum value and 99.99 as maximum value,
- a step value of 1.0 and a precision of 2 decimal places.
- The value is initially set to 0.00.
 
- \param parent parent object
- */
 ModuleBase_ParamSpinBox::ModuleBase_ParamSpinBox(QWidget* theParent, int thePrecision)
     : ModuleBase_DoubleSpinBox(theParent, thePrecision),
       myAcceptVariables(true)
@@ -69,20 +57,11 @@ void ModuleBase_ParamSpinBox::connectSignalsAndSlots()
           this, SLOT(onTextChanged(const QString&)));
 }
 
-/*!
- \brief This function is called when value is changed.
- */
 void ModuleBase_ParamSpinBox::onTextChanged(const QString& text)
 {
   myTextValue = text;
 }
 
-/*!
- \brief Interpret text entered by the user as a value.
- \param text text entered by the user
- \return mapped value
- \sa textFromValue()
- */
 double ModuleBase_ParamSpinBox::valueFromText(const QString& theText) const
 {
   if (!hasVariable(theText))
index 7d14e951136d1f4cc6065fd650adc5adba00ec82..f771b5656fa046ff128a3b8efa2db23757151f6d 100644 (file)
@@ -8,6 +8,10 @@
 
 #include <QValidator>
 
+/**
+* \ingroup GUI
+* An extension of a double spin box which let to use parameters and expressions for value definition
+*/
 class MODULEBASE_EXPORT ModuleBase_ParamSpinBox : public ModuleBase_DoubleSpinBox
 {
   Q_OBJECT
@@ -15,6 +19,16 @@ class MODULEBASE_EXPORT ModuleBase_ParamSpinBox : public ModuleBase_DoubleSpinBo
   enum State { Invalid = 0, NoVariable, Incompatible, Acceptable };
 
 public:
+  /*!
+   \brief Constructor.
+
+   Constructs a spin box with 0.0 as minimum value and 99.99 as maximum value,
+   a step value of 1.0 and a precision of 2 decimal places.
+   The value is initially set to 0.00.
+
+   \param theParent a parent object
+   \param thePrecision a precision of values display
+   */
   explicit ModuleBase_ParamSpinBox( QWidget* theParent = 0, int thePrecision = -12 );
   virtual ~ModuleBase_ParamSpinBox();
 
@@ -29,26 +43,36 @@ public:
 
   virtual void setText(const QString&);
 
+  /// Set a flag about accepted variable
   void setAcceptVariables(const bool);
+
+  /// Returns accepted variables flag
   bool isAcceptVariables() const;
-  bool hasVariable() const;
 
-//signals:
-  //void textChanged(const QString&);
+  /// Returns True if the input value contains variable
+  bool hasVariable() const;
 
  protected:
+   /// Returns True if the given text contains variable
+   /// \param theText a text string
   bool hasVariable(const QString& theText) const;
+
+  /// Returns state of the control
   State isValid(const QString&, double&) const;
 
+  /// Returns True if the given value is within min and max of the control
   bool checkRange(const double) const;
 
-  bool findVariable(const QString&, double&) const;
+  /// Finds a variable by its name. Rreturns true in success
+  /// \param theName a name of variable
+  /// \param outValue an output val;ue of the variable
+  bool findVariable(const QString& theName, double& outValue) const;
 
  protected:
-  //virtual void keyPressEvent(QKeyEvent*);
   virtual void showEvent(QShowEvent*);
 
  protected slots:
+   /// A slot called on text change
   void onTextChanged(const QString&);
 
  private:
index 4462f80edcb6b9759626e392f0e7d497619ec0cc..1c2c1ef7d37df2cf6cc859207c2311589ccfe076 100644 (file)
@@ -15,23 +15,43 @@ class QFrame;
 class QHBoxLayout;
 class QStackedWidget;
 
+/**
+ * \class ModuleBase_ToolBox
+ * \ingroup GUI
+ * \brief An extension of QFrame object
+ */
 class MODULEBASE_EXPORT ModuleBase_ToolBox : public QFrame
 {
   Q_OBJECT
 
 public:
+  /// Constructor
+  /// \param theParent a parent widget
   ModuleBase_ToolBox( QWidget* theParent );
   virtual ~ModuleBase_ToolBox();
 
+  ///  Add a new item to the tool box
+  /// \param thePage a widget of the new item
+  /// \param theName a name of the item
+  /// \param theIcon an icon of the item
   void addItem( QWidget* thePage, const QString& theName, const QPixmap& theIcon );
+
+  /// \return number of items
   int count() const;
+
+  /// \return index of current widget
   int currentIndex() const;
-  void setCurrentIndex( const int );
+
+  /// Set current item
+  /// \param theIdx an index
+  void setCurrentIndex( const int theIdx);
 
 signals:
+  /// A signal which is emited on current item changed
   void currentChanged( int );
 
 private slots:
+  /// A slot called on button press
   void onButton( int );
 
 private:
index 9c1ad9b464973e32288ea31f7136740b338a1642..8314f70546b69907268289f9e879098ef691e7ea 100644 (file)
@@ -60,7 +60,7 @@ public:
   Standard_EXPORT ModuleBase_ShapeInPlaneFilter(): SelectMgr_Filter() {}
 
   /// Set working plane
-  /// \param thePane plane object
+  /// \param thePlane a plane object
   void setPlane(const std::shared_ptr<GeomAPI_Pln>& thePlane) { myPlane = thePlane; }
 
   /// Returns current working plane
index c5ad7b26495390bc3a1a1cc445e77a3150faa924..39ae9823546f07afd09c1960fe7ba6dd70f21c37 100644 (file)
@@ -23,27 +23,51 @@ class QWidget;
 class QStringListModel;
 class QCompleter;
 
+/**
+* \ingroup GUI
+* A multi-line text editor which lets to input formula and provides a list of completion strings
+*/
 class ExpressionEditor: public QPlainTextEdit
 {
   Q_OBJECT
-
  public:
+   /// Constructor
+   /// \param theParent a parent widget
   explicit ExpressionEditor(QWidget* theParent = 0);
   virtual ~ExpressionEditor();
 
+  /// Set list of completion strings
   void setCompletionList(QStringList&);
 
+  /// Set a text which will be shown when the listr is empty
   void setPlaceHolderText( const QString& );
+
+  /// Returns placeholder list
   QString placeHolderText() const;
 
  public slots:
-  void insertCompletion(const QString&, bool isSingleWord = false);
+  /// Insert additional string for completion
+  /// \param theCompletion a string to insert
+  /// \param isSingleWord a flag shows that inserted string is single word or not
+  void insertCompletion(const QString& theCompletion, bool isSingleWord = false);
+
+  /// Perform completion
   void performCompletion();
 
  protected:
+  /// Perform completion by prefix
+  /// \param theCompletionPrefix a prefix for looking for completion
   void performCompletion(const QString& theCompletionPrefix);
+
+  /// Redefinition of virtual method
+  /// \param theEvent a key press event
   virtual void keyPressEvent(QKeyEvent* theEvent);
+
+  /// Key events processing
+  /// theEvent a key event
   bool handledCompletedAndSelected(QKeyEvent* theEvent);
+
+  /// Redefinition of virtual method
   virtual void paintEvent( QPaintEvent* );
 
  private:
@@ -55,7 +79,7 @@ class ExpressionEditor: public QPlainTextEdit
 
 /**
 * \ingroup GUI
-* TODO(sbh) add doc
+* A Widget which provides an input of an expression
 */
 class MODULEBASE_EXPORT ModuleBase_WidgetExprEditor : public ModuleBase_ModelWidget
 {
@@ -65,12 +89,14 @@ class MODULEBASE_EXPORT ModuleBase_WidgetExprEditor : public ModuleBase_ModelWid
   /// \param theParent the parent object
   /// \param theData the widget configuration.
   /// \param theParentId is Id of a parent of the current attribute
+  /// \param thePlaceHolder a placeholder string
   ModuleBase_WidgetExprEditor( QWidget* theParent,
                                const Config_WidgetAPI* theData,
                                const std::string& theParentId,
                                const std::string& thePlaceHolder );
   virtual ~ModuleBase_WidgetExprEditor();
 
+  /// Redefinition of virtual method
   virtual QList<QWidget*> getControls() const;
 
  public slots:
@@ -82,6 +108,7 @@ protected:
   /// \return True in success
   virtual bool storeValueCustom() const;
 
+  /// Redefinition of virtual method
   virtual bool restoreValueCustom();
 
 private:
index e1f402b03b862dae284cc433c4f6bf486d50c812..ba6a4e019f8506ab16a7ad734e30ffb142ae478f 100644 (file)
@@ -86,6 +86,10 @@ protected:
   /// Returns string containing formats
   QString filterString() const;
 
+  /// Add an extension to file name if the extension is not defined
+  /// \param theFileName a file name
+  /// \param theFilter a file filter
+  /// \return the file name with extension
   static QString applyExtension(const QString& theFileName, const QString& theFilter);
 
 protected:
index 273cc902016246860653d4168e7fa0b56e0fc197..defdbee482ed7223535ec29324eb8e3d00b781e8 100644 (file)
 #include <memory>
 #include <string>
 
+/**
+* Customization of Line edit control
+*/
 class CustomLineEdit : public QLineEdit
 {
 public:
+  /// Constructor
+  /// \param theParent a parent widget
+  /// \param thePlaceHolder a string which is shown when text is empty
   CustomLineEdit( QWidget* theParent, const QString& thePlaceHolder )
     : QLineEdit( theParent ), myPlaceHolder( thePlaceHolder )
   {
@@ -40,6 +46,8 @@ public:
   {
   }
 
+  /// Redefiniotion of virtual method
+  /// \param theEvent a paint event
   virtual void paintEvent( QPaintEvent* theEvent )
   {
     QLineEdit::paintEvent( theEvent );
index d812bc158fe9bd893b16b54caf3aed8eebc72c86..1f5f3fd71160ec93d574907c27e0ad09d32284ae 100644 (file)
@@ -33,12 +33,14 @@ class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidge
   /// \param theParent the parent object
   /// \param theData the widget configuration.
   /// \param theParentId is Id of a parent of the current attribute
+  /// \param thePlaceHolder a string of placeholder
   ModuleBase_WidgetLineEdit( QWidget* theParent,
                              const Config_WidgetAPI* theData,
                              const std::string& theParentId,
                              const std::string& thePlaceHolder );
   virtual ~ModuleBase_WidgetLineEdit();
 
+  /// Redefinition of virtual method
   virtual QList<QWidget*> getControls() const;
 
  public slots:
@@ -49,6 +51,8 @@ protected:
   /// Saves the internal parameters to the given feature
   /// \return True in success
   virtual bool storeValueCustom() const;
+
+  /// Redefinition of virtual method
   virtual bool restoreValueCustom();
 
 private:
index 8a703d3208963f6d253f7ad3863b2b09510c431c..af676208cc5d3c9c53c12096e93c092d6ab06812 100755 (executable)
 #include <memory>
 #include <string>
 
+/**
+* Customization of a List Widget to make it to be placed on full width of container
+*/
 class CustomListWidget : public QListWidget
 {
 public:
+  /// Constructor
+  /// \param theParent a parent widget
   CustomListWidget( QWidget* theParent )
     : QListWidget( theParent )
   {
   }
 
+  /// Redefinition of virtual method
   virtual QSize        sizeHint() const
   {
     int aHeight = 2*QFontMetrics( font() ).height();
@@ -51,6 +57,7 @@ public:
     return QSize( aSize.width(), aHeight );
   }
 
+  /// Redefinition of virtual method
   virtual QSize        minimumSizeHint() const
   {
     int aHeight = 2*QFontMetrics( font() ).height();
index 403847ddf3e3c4577d711e70d34a6be8e5c803d0..d3a9b8a09d74e883d3b8f1c25d360e6f8be40fd1 100755 (executable)
@@ -69,11 +69,12 @@ class MODULEBASE_EXPORT ModuleBase_WidgetMultiSelector : public ModuleBase_Widge
   /// Set the given wrapped value to the current widget
   /// This value should be processed in the widget according to the needs
   /// \param theValues the wrapped selection values
+  /// \param theToValidate a validation of the values flag
   virtual bool setSelection(QList<ModuleBase_ViewerPrs>& theValues,
                             const bool theToValidate);
 
   /// Checks the widget validity. By default, it returns true.
-  /// \param theValue a selected presentation in the view
+  /// \param thePrs a selected presentation in the view
   /// \return a boolean value
   virtual bool isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs);
 
@@ -103,7 +104,7 @@ protected:
   /// Clear attribute
   virtual void clearAttribute();
 
-  // Set the focus on the last item in  the list
+  /// Set the focus on the last item in  the list
   virtual void updateFocus();
 
   /// Computes and updates name of selected object in the widget
@@ -163,6 +164,7 @@ protected:
   /// Variable of GeomSelection
   int mySelectionCount; // number of elements in the attribute selection list when store
 
+  /// A flag to store use_choice parameter state
   bool myIsUseChoice;
 };
 
index 99af3ad74a5ccbc06ad14dc4e623734e4b322005..0deb253bdb1358353d186f7164d5aeb479164ba5 100755 (executable)
@@ -43,12 +43,12 @@ Q_OBJECT
   virtual bool isViewerSelector() { return true; }
 
   /// Checks the widget validity. By default, it returns true.
-  /// \param theValue a selected presentation in the view
+  /// \param thePrs a selected presentation in the view
   /// \return a boolean value
   virtual bool isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs);
 
   /// Fills the attribute with the value of the selected owner
-  /// \param theOwner a selected owner
+  /// \param thePrs a selected owner
   virtual bool setSelectionCustom(const ModuleBase_ViewerPrs& thePrs);
 
   /// The methiod called when widget is deactivated
@@ -66,7 +66,7 @@ protected:
   /// Set an empty value to attribute
   virtual void clearAttribute() = 0;
 
-  // Update focus after the attribute value change
+  /// Update focus after the attribute value change
   virtual void updateFocus() = 0;
 
   /// Return the attribute values wrapped in a list of viewer presentations
index 8addb375cf4cb39e7efc8f5fc7c8781a6417bfc6..1f278042bc650f11fd704e3f2e7de7db5f2ef2b3 100644 (file)
@@ -25,7 +25,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public ModuleBase_PagedContain
   Q_OBJECT
  public:
    /// Constructor
-   /// \param parent a parent widget
+  /// \param theParent the parent object
+  /// \param theData the widget configuration. The attribute of the model widget is obtained from
+  /// \param theParentId is Id of a parent of the current attribute
   ModuleBase_WidgetSwitch(QWidget* theParent,
                           const Config_WidgetAPI* theData,
                           const std::string& theParentId);
@@ -38,14 +40,18 @@ class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public ModuleBase_PagedContain
   /// Add a page to the widget
   /// \param theWidget a page widget
   /// \param theName a name of page
+  /// \param theCaseId an Id of the page
+  /// \param theIcon an icon of the page
   virtual int addPage( ModuleBase_PageBase* theWidget,
                        const QString& theName,
                        const QString& theCaseId,
                        const QPixmap& theIcon );
 
  protected:
+   /// Returns index of the current page
   virtual int currentPageIndex() const;
-   /// Set current page by index
+
+  /// Set current page by index
   /// \param index index of the page
   virtual void setCurrentPageIndex(int index);
 
index 44565db2c8bbbecf830fcc886a26667bd671018b..28e48c0fce27b20b33ccdd81dbdc47b596ca5dd1 100644 (file)
@@ -22,6 +22,10 @@ class MODULEBASE_EXPORT ModuleBase_WidgetToolbox : public ModuleBase_PagedContai
 {
   Q_OBJECT
  public:
+  /// Constructor
+  /// \param theParent the parent object
+  /// \param theData the widget configuration. The attribute of the model widget is obtained from
+  /// \param theParentId is Id of a parent of the current attribute
   ModuleBase_WidgetToolbox(QWidget* theParent, const Config_WidgetAPI* theData,
                            const std::string& theParentId);
   virtual ~ModuleBase_WidgetToolbox();
@@ -30,7 +34,11 @@ class MODULEBASE_EXPORT ModuleBase_WidgetToolbox : public ModuleBase_PagedContai
   /// \return false because this is an info widget
   virtual bool canSetValue() const { return false; };
 
-  /// Overrides ModuleBase_PagedContainer
+  /// Add a page to the widget
+  /// \param theWidget a page widget
+  /// \param theName a name of page
+  /// \param theCaseId an Id of the page
+  /// \param theIcon an icon of the page
   virtual int addPage( ModuleBase_PageBase* theWidget,
                        const QString& theName,
                        const QString& theCaseId,
@@ -39,6 +47,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetToolbox : public ModuleBase_PagedContai
  protected:
   /// Implements ModuleBase_PagedContainer
   virtual int currentPageIndex() const;
+
   /// Implements ModuleBase_PagedContainer
   virtual void setCurrentPageIndex(int);
 
index 70405e695bcb7d5d0475704616779873f80bc182..f1a5ef17ee27842fb50ca4362c0fbef5de396996 100644 (file)
@@ -36,6 +36,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg
  public:
   /// Constructor
   /// \param theParent the parent object
+  /// \param theWorkshop a reference to workshop
   /// \param theData the widget configuation. The attribute of the model widget is obtained from
   /// \param theParentId is Id of a parent of the current attribute
   ModuleBase_WidgetValidated(QWidget* theParent,
@@ -45,8 +46,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg
   virtual ~ModuleBase_WidgetValidated();
 
   /// Checks whether all active viewer filters validate the presentation
-  /// \param theWorkshop an active workshop
-  /// \param theValue a selected presentation in the view
+  /// \param thePrs a selected presentation in the view
   /// \return a boolean value
   bool isValidInFilters(const ModuleBase_ViewerPrs& thePrs);
 
@@ -60,6 +60,7 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg
   /// The method is called by the current operation to process the operation preselection.
   /// It is redefined to check the value validity and if it is, fill the attribute with by value
   /// \param theValues the wrapped selection values
+  /// \param theToValidate a flag on validation of the values
   virtual bool setSelection(QList<ModuleBase_ViewerPrs>& theValues,
                             const bool theToValidate);
 
@@ -67,7 +68,6 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg
   ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const;
 
   /// It obtains selection filters from the workshop and activates them in the active viewer
-  /// \param theWorkshop an active workshop
   /// \param toActivate a flag about activation or deactivation the filters
   void activateFilters(const bool toActivate);
 
@@ -84,12 +84,12 @@ protected:
   virtual void restoreAttributeValue(const bool theValid);
 
   /// Checks the widget validity. By default, it returns true.
-  /// \param theValue a selected presentation in the view
+  /// \param thePrs a selected presentation in the view
   /// \return a boolean value
   virtual bool isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs);
 
   /// Fills the attribute with the value of the selected owner
-  /// \param theOwner a selected owner
+  /// \param thePrs a selected owner
   virtual bool setSelectionCustom(const ModuleBase_ViewerPrs& thePrs) = 0;
 
   /// Checks the current attibute in all attribute validators
@@ -110,7 +110,7 @@ protected:
   /// \param theValid a valid state
   void storeValidState(const ModuleBase_ViewerPrs& theValue, const bool theValid);
 
-  // Removes all presentations from internal maps.
+  /// Removes all presentations from internal maps.
   void clearValidState();
 
   /// Returns a list of selected presentations in the viewer and object browser
@@ -124,8 +124,11 @@ protected:
   void filterPresentations(QList<ModuleBase_ViewerPrs>& theValues);
 
 protected:
-  ModuleBase_IWorkshop* myWorkshop;  /// Reference to workshop
-  bool myIsInValidate; // the widget is in validation mode: store is performed, restore is not
+  /// Reference to workshop
+  ModuleBase_IWorkshop* myWorkshop; 
+
+  /// The widget is in validation mode: store is performed, restore is not
+  bool myIsInValidate; 
 
 private:
   ObjectPtr myPresentedObject; /// back up of the filtered object
index d537b8a8d7a3886fe8983666a57ad0c536dd573f..3a2875dde35810aa73df2b804e197ff203dbcb4e 100644 (file)
@@ -57,13 +57,17 @@ Q_OBJECT
   virtual QAction* addFeature(const QString& theWBName,
                               const ActionInfo& theInfo);
 
+  /// Add a nested feature
+  /// \param theWBName a workbench name
+  /// \param theInfo the action  parameters
+  /// \param theNestedActions a list of nested actions
   virtual QAction* addFeatureOfNested(const QString& theWBName,
                                     const ActionInfo& theInfo,
                                     const QList<QAction*>& theNestedActions);
 
   //! Returns true if the feature action is a nested action, in other words,
   //! it is created by addNestedFeature().
-  //! \param theId - an action of a feature
+  //! \param theAction - an action of a feature
   //! returns boolean result
   virtual bool isFeatureOfNested(const QAction* theAction);
 
@@ -76,6 +80,9 @@ Q_OBJECT
   virtual void addDesktopMenuSeparator(const char* theMenuSourceText,
                                        const int theMenuPosition = 10);
 
+  /// Add an action to a tool bar
+  /// \param theAction an ation to add
+  /// \param theToolBarTitle a name of tool bar
   virtual bool addActionInToolbar( QAction* theAction, const QString& theToolBarTitle );
     
   virtual QMainWindow* desktop() const;
@@ -164,6 +171,7 @@ Q_OBJECT
   /// Create popup menu manager
   virtual QtxPopupMgr* popupMgr();
 
+  /// Abort all operations
   virtual bool abortAllOperations();
 
  private:
index bc39376c4c7110e876ccfb9fcb723369a8d91485..69d8bc2979572d682f2961095a574012608cb397 100644 (file)
@@ -23,16 +23,22 @@ class NewGeom_NestedButton : public QWidgetAction
 {
   Q_OBJECT
  public:
-  NewGeom_NestedButton(QObject *parent, const QList<QAction*>& theNestedActions);
+   /// Constructor
+   /// \param theParent a parent objects
+   /// \param theNestedActions a list of nested actions
+  NewGeom_NestedButton(QObject* theParent, const QList<QAction*>& theNestedActions);
   virtual ~NewGeom_NestedButton();
 
  private slots:
   /// Shows/hides the additional buttons widget
   void showAdditionalButtons(bool);
+
+  /// Slot called on action state
   void actionStateChanged();
 
  protected:
   /// Creates the button representation
+  /// \param theParent a parent widget
   virtual QWidget * createWidget(QWidget * theParent);
 
  private:
index 388a735fbd97e80240f1ed838c3f5b41c2795922..0db713356e0ec54a8ba83343e567399160c1aa78 100644 (file)
@@ -26,11 +26,7 @@ SET(PROJECT_HEADERS
        PartSet_FilterInfinite.h
        PartSet_SketcherMgr.h
        PartSet_MenuMgr.h
-       PartSet_DocumentDataModel.h
-       PartSet_PartDataModel.h
-       PartSet_DataTreeModel.h
        PartSet_WidgetSketchCreator.h
-       PartSet_TopDataModel.h
        PartSet_IconFactory.h
 )
 
@@ -54,11 +50,7 @@ SET(PROJECT_SOURCES
        PartSet_FilterInfinite.cpp
        PartSet_SketcherMgr.cpp
        PartSet_MenuMgr.cpp
-       PartSet_DocumentDataModel.cpp
-       PartSet_PartDataModel.cpp
-       PartSet_DataTreeModel.cpp
        PartSet_WidgetSketchCreator.cpp
-       PartSet_TopDataModel.cpp
        PartSet_IconFactory.cpp
 )
 
index d21bdd0e3afe43e303da98caec158062aaba447d..c12768e0e549f4248fdcba0c060e0255722e3d81 100755 (executable)
@@ -29,6 +29,8 @@ class XGUI_Workshop;
 class PartSet_CustomPrs
 {
 public:
+  /// Constructor
+  /// \param theWorkshop a reference to workshop
   PARTSET_EXPORT PartSet_CustomPrs(ModuleBase_IWorkshop* theWorkshop);
   PARTSET_EXPORT virtual ~PartSet_CustomPrs() {};
 
@@ -48,6 +50,7 @@ public:
 
   /// If the presentation is active[displayed], the shapes of the presentation is recomputed
   /// and the presentation is redisplayed.
+  /// \param theObject an object to redisplay
   /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly
   /// \returns true if the presentation is redisplayed
   bool redisplay(const ObjectPtr& theObject, const bool theUpdateViewer);
diff --git a/src/PartSet/PartSet_DataTreeModel.cpp b/src/PartSet/PartSet_DataTreeModel.cpp
deleted file mode 100644 (file)
index 2c433f7..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-#include "PartSet_DataTreeModel.h"
-
-PartSet_FeaturesModel::PartSet_FeaturesModel(QObject* theParent) 
-: QAbstractItemModel(theParent),
-  myItemsColor(Qt::black)
-{
-
-}
-
-PartSet_PartModel::PartSet_PartModel(QObject* theParent)
-: PartSet_FeaturesModel(theParent)
-{
-
-}
-
-PartSet_PartModel::~PartSet_PartModel()
-{
-  myPart = FeaturePtr();
-}
diff --git a/src/PartSet/PartSet_DataTreeModel.h b/src/PartSet/PartSet_DataTreeModel.h
deleted file mode 100644 (file)
index 0fa8f63..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-#ifndef PartSet_DataTreeModel_H
-#define PartSet_DataTreeModel_H
-
-#include "PartSet.h"
-
-#include <ModelAPI_Document.h>
-#include <ModelAPI_Feature.h>
-#include <ModelAPI_ResultPart.h>
-#include <ModelAPI_Session.h>
-
-#include <QAbstractItemModel>
-#include <QColor>
-
-/**\class PartSet_FeaturesModel
- * \ingroup GUI
- * \brief Abstaract class of model object which operates with features data.
- */
-class PARTSET_EXPORT PartSet_FeaturesModel : public QAbstractItemModel
-{
- public:
-   /// Constructor
-   /// \param theParent a parent object
-  PartSet_FeaturesModel(QObject* theParent);
-
-  //! Returns Feature object by the given Model index.
-  //! Returns 0 if the given index is not index of a feature
-  /// \param theIndex a model index
-  virtual ObjectPtr object(const QModelIndex& theIndex) const = 0;
-
-  //! Returns QModelIndex which corresponds to the given feature
-  //! If the feature is not found then index is not valid
-  virtual QModelIndex objectIndex(const ObjectPtr& theFeature) const = 0;
-
-  //! Returns parent index of the given feature
-  virtual QModelIndex findParent(const ObjectPtr& theObject) const = 0;
-
-  //! Returns index corresponded to the group
-  //! \param theGroup a group name
-  virtual QModelIndex findGroup(const std::string& theGroup) const = 0;
-
-  //! Set color of items
-  void setItemsColor(const QColor& theColor)
-  {
-    myItemsColor = theColor;
-  }
-
-  //! Returns color of items
-  QColor itemsColor() const
-  {
-    return myItemsColor;
-  }
-
- protected:
-   /// Color of items
-  QColor myItemsColor;
-};
-
-/**\class PartSet_PartModel
- * \ingroup GUI
- * \brief Abstaract class of model object which operates with parts data.
- */
-class PartSet_PartModel : public PartSet_FeaturesModel
-{
- public:
-   /// Constructor
-   /// \param theParent a parent object
-  PartSet_PartModel(QObject* theParent);
-   /// Destructor 
-  ~PartSet_PartModel();
-
-  /// Set part id
-  /// \param theId a new id
-  void setPart(FeaturePtr thePart)
-  {
-    myPart = thePart;
-  }
-
-  /// Returns Id of the part
-  FeaturePtr part() const { return myPart; }
-
-  //! Returns true if the given document is a sub-document of this tree
-  //! \param theDoc a document to check
-  virtual bool hasDocument(const DocumentPtr& theDoc) const = 0;
-
-  /// Returns position of the part in history 
-  int position() const 
-  {
-    DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-    return aRootDoc->index(myPart);
-  }
-
- protected:
-  //! Id of the current part object in the document
-  FeaturePtr myPart;
-};
-
-#endif
diff --git a/src/PartSet/PartSet_DocumentDataModel.cpp b/src/PartSet/PartSet_DocumentDataModel.cpp
deleted file mode 100644 (file)
index 84ac7a1..0000000
+++ /dev/null
@@ -1,876 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-#include "PartSet_DocumentDataModel.h"
-#include "PartSet_PartDataModel.h"
-#include "PartSet_TopDataModel.h"
-#include "PartSet_Module.h"
-//#include "XGUI_Tools.h"
-
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_Feature.h>
-#include <ModelAPI_Data.h>
-#include <ModelAPI_ResultPart.h>
-#include <ModelAPI_Events.h>
-#include <ModelAPI_Object.h>
-
-#include <Events_Loop.h>
-
-#include <Config_FeatureMessage.h>
-#include <ModuleBase_Tools.h>
-#include <ModuleBase_ActionInfo.h>
-
-#include <PartSetPlugin_Part.h>
-
-#include <QIcon>
-#include <QString>
-#include <QBrush>
-#include <QTreeView>
-
-#include <set>
-
-#define ACTIVE_COLOR QColor(0,72,140)
-#define PASSIVE_COLOR Qt::black
-
-QMap<QString, QString> PartSet_DocumentDataModel::myIcons;
-
-
-PartSet_DocumentDataModel::PartSet_DocumentDataModel(QObject* theParent)
-    : ModuleBase_IDocumentDataModel(theParent),
-      myActivePartModel(0)
-{
-  // Create a top part of data tree model
-  myModel = new PartSet_TopDataModel(this);
-  myModel->setItemsColor(ACTIVE_COLOR);
-
-  Events_Loop* aLoop = Events_Loop::loop();
-  aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
-  aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
-  aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED));
-  aLoop->registerListener(this, Events_Loop::eventByName(Config_FeatureMessage::GUI_EVENT()));
-}
-
-PartSet_DocumentDataModel::~PartSet_DocumentDataModel()
-{
-  clearModelIndexes();
-  clearSubModels();
-}
-
-void PartSet_DocumentDataModel::processEvent(const std::shared_ptr<Events_Message>& theMessage)
-{
-  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-
-
-  // Created object event *******************
-  if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) {
-    std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
-        std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
-    std::set<ObjectPtr> aObjects = aUpdMsg->objects();
-
-    std::set<ObjectPtr>::const_iterator aIt;
-    for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
-      ObjectPtr aObject = (*aIt);
-      FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
-      if (aFeature && (!aFeature->isInHistory()))
-        continue;
-
-      DocumentPtr aDoc = aObject->document();
-      if (aDoc == aRootDoc) {  // If root objects
-        if (aObject->groupName() == ModelAPI_ResultPart::group()) {  // Update only Parts group
-            // Add a new part
-          int aStart = aRootDoc->size(ModelAPI_ResultPart::group());
-          if (aStart > 0) {
-            FeaturePtr aPartFeature = ModelAPI_Feature::feature(aObject);
-            PartSet_PartDataModel* aModel = new PartSet_PartDataModel(this);
-            int anId = aRootDoc->index(aPartFeature);
-            aModel->setPart(aPartFeature);
-            myPartModels.append(aModel);
-            insertRow(aStart, partFolderNode(0));
-          }
-        } else {  // Update top groups (other except parts
-          QModelIndex aIndex = myModel->findParent(aObject);
-          int aStart = myModel->rowCount(aIndex) - 1;
-          if (aStart < 0)
-            aStart = 0;
-          aIndex = createIndex(aIndex.row(), aIndex.column(), (void*) getModelIndex(aIndex));
-          insertRow(aStart, aIndex);
-        }
-      } else {  // if sub-objects of first level nodes
-        PartSet_PartModel* aPartModel = 0;
-        foreach (PartSet_PartModel* aPart, myPartModels) {
-          if (aPart->hasDocument(aDoc)) {
-            aPartModel = aPart;
-            break;
-          }
-        }
-        if (aPartModel) {
-          QModelIndex aIndex = aPartModel->findParent(aObject);
-          int aStart = aPartModel->rowCount(aIndex);  // check this index
-          aIndex = createIndex(aIndex.row(), aIndex.column(), (void*) getModelIndex(aIndex));
-          insertRow(aStart, aIndex);
-        } else
-          reset();
-      }
-    }
-    // Deleted object event ***********************
-  } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_DELETED)) {
-    std::shared_ptr<ModelAPI_ObjectDeletedMessage> aUpdMsg =
-        std::dynamic_pointer_cast<ModelAPI_ObjectDeletedMessage>(theMessage);
-    DocumentPtr aDoc = aUpdMsg->document();
-    std::set<std::string> aGroups = aUpdMsg->groups();
-
-    std::set<std::string>::const_iterator aIt;
-    for (aIt = aGroups.begin(); aIt != aGroups.end(); ++aIt) {
-      std::string aGroup = (*aIt);
-      if (aDoc == aRootDoc) {  // If root objects
-        if (aGroup == ModelAPI_ResultPart::group()) {  // Update only Parts group
-          PartSet_PartModel* aDelPartModel = 0;
-          foreach (PartSet_PartModel* aPartModel, myPartModels) {
-            if (aPartModel->position() == -1) {
-              aDelPartModel = aPartModel;
-              break;
-            }
-          }
-          if (aDelPartModel) {
-            deactivatePart();
-            int aStart = myPartModels.size() - 1;
-            removeSubModel(aDelPartModel);
-            removeRow(aStart, partFolderNode(0));
-          }
-        } if (aGroup == ModelAPI_Feature::group()) { // Update History node
-          int aRow = historyOffset() + aRootDoc->size(ModelAPI_Feature::group());
-          removeRow(aRow);
-        } else {  // Update top groups (other except parts
-          QModelIndex aIndex = myModel->findGroup(aGroup);
-          int aStart = myModel->rowCount(aIndex);
-          aIndex = createIndex(aIndex.row(), aIndex.column(), (void*) getModelIndex(aIndex));
-          removeRow(aStart, aIndex);
-        }
-      } else {
-        PartSet_PartModel* aPartModel = 0;
-        foreach (PartSet_PartModel* aPart, myPartModels) {
-          if (aPart->hasDocument(aDoc)) {
-            aPartModel = aPart;
-            break;
-          }
-        }
-        if (aPartModel) {
-          QModelIndex aIndex = aPartModel->findGroup(aGroup);
-          if (aIndex.isValid()) {
-            int aStart = aPartModel->rowCount(aIndex);
-            aIndex = createIndex(aIndex.row(), aIndex.column(), (void*) getModelIndex(aIndex));
-            removeRow(aStart, aIndex);
-          } else {
-            int aRow = aPartModel->rowCount();
-            aIndex = createIndex(aPartModel->position() + historyOffset(), 0, HistoryNode);
-            removeRow(aRow, aIndex);
-          }
-        }
-      }
-    }
-    // Deleted object event ***********************
-  } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) {
-    //std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg = std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
-    //ObjectPtr aFeature = aUpdMsg->feature();
-    //DocumentPtr aDoc = aFeature->document();
-
-    // TODO: Identify the necessary index by the modified feature
-    QModelIndex aIndex;
-    emit dataChanged(aIndex, aIndex);
-
-    // Reset whole tree **************************
-  } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) {
-    std::shared_ptr<Config_FeatureMessage> aFeatureMsg =
-       std::dynamic_pointer_cast<Config_FeatureMessage>(theMessage);
-    if (!aFeatureMsg->isInternal()) {
-      ActionInfo aFeatureInfo;
-      aFeatureInfo.initFrom(aFeatureMsg);
-      // Remember features icons
-      myIcons[QString::fromStdString(aFeatureMsg->id())] = aFeatureInfo.iconFile;
-    }
-  } else {
-    rebuildDataTree();
-  }
-}
-
-void PartSet_DocumentDataModel::rebuildDataTree()
-{
-  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-
-  beginResetModel();
-  clearModelIndexes();
-
-  // Delete extra models
-  ObjectPtr aObj;
-  FeaturePtr aFeature;
-  QList<PartSet_PartModel*> aDelList;
-  foreach (PartSet_PartModel* aPartModel, myPartModels) {
-    if (aPartModel->position() == -1) 
-      aDelList.append(aPartModel);
-  }
-  foreach (PartSet_PartModel* aPartModel, aDelList) {
-    removeSubModel(aPartModel);
-  }
-  // Add non existing models
-  int aHistNb = aRootDoc->size(ModelAPI_Feature::group());
-  for (int i = 0; i < aHistNb; i++) {
-    aObj = aRootDoc->object(ModelAPI_Feature::group(), i);
-    aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
-    if (aFeature->getKind() == PartSetPlugin_Part::ID()) {
-      if (!findPartModel(aFeature)) {
-        PartSet_PartDataModel* aModel = new PartSet_PartDataModel(this);
-        aModel->setPart(aFeature);
-        myPartModels.append(aModel);
-      }
-    }
-  }
-  endResetModel();
-}
-
-QVariant PartSet_DocumentDataModel::data(const QModelIndex& theIndex, int theRole) const
-{
-  if (!theIndex.isValid())
-    return QVariant();
-
-  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-  QModelIndex aParent = theIndex.parent();
-  if ((theIndex.column() == 1) ) {
-    if ((theIndex.internalId() >= PartsFolder) && (theIndex.internalId() <= PartResult)) {
-      if (ModelAPI_Session::get()->activeDocument() == aRootDoc) {
-        if (!aParent.isValid()) {
-          switch (theRole) {
-          case Qt::DecorationRole:
-            if (theIndex.row() == lastHistoryRow())
-              return QIcon(":pictures/arrow.png");
-          }
-        }
-      }
-    } else {
-      QModelIndex* aIndex = toSourceModelIndex(theIndex);
-      const QAbstractItemModel* aModel = aIndex->model();
-      if (isPartSubModel(aModel)) {
-        return aModel->data(*aIndex, theRole);
-      }
-    }
-    return QVariant();
-  }
-
-  switch (theIndex.internalId()) {
-    case PartsFolder:
-      switch (theRole) {
-        case Qt::DisplayRole:
-          return tr("Parts") + QString(" (%1)").arg(rowCount(theIndex));
-        case Qt::DecorationRole:
-          return QIcon(":pictures/constr_folder.png");
-        case Qt::ToolTipRole:
-          return tr("Parts folder");
-        case Qt::ForegroundRole:
-          if (myActivePartIndex.isValid())
-              return QBrush(PASSIVE_COLOR);
-            else
-              return QBrush(ACTIVE_COLOR);
-        default:
-          return QVariant();
-      }
-      break;
-    case HistoryNode:
-      {
-        int aOffset = historyOffset();
-        ObjectPtr aObj = aRootDoc->object(ModelAPI_Feature::group(), theIndex.row() - aOffset);
-        FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
-        if (!aFeature)
-          return QVariant();
-        switch (theRole) {
-          case Qt::DisplayRole:
-            if (aFeature)
-              return aFeature->data()->name().c_str();
-            else
-              return QVariant();
-          case Qt::DecorationRole:
-            return featureIcon(aFeature);
-          case Qt::ToolTipRole:
-            {
-              ResultPtr aResult = aFeature->firstResult();
-              bool isResultAndNotLoaded = false;
-              if( aResult.get() )
-              {
-                ResultPartPtr aResultPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>( aResult );
-                if( aResultPart.get() )
-                  isResultAndNotLoaded = !aResultPart->isActivated();
-              }
-              if( isResultAndNotLoaded )
-                return tr( "The part should be activated before the user may edit it" );
-              else
-                return tr( "Feature object" );
-            }
-          case Qt::ForegroundRole:
-            if (theIndex.row() > lastHistoryRow())
-              return QBrush(Qt::lightGray);
-            else {
-              if (myActivePartIndex.isValid())
-                return QBrush(PASSIVE_COLOR);
-              else
-                return QBrush(ACTIVE_COLOR);
-            }
-          default:
-            return QVariant();
-        }
-      }
-      break;
-    case PartResult:
-      {
-        ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), theIndex.row());
-        if (aObject) {
-          switch (theRole) {
-            case Qt::DisplayRole:
-              return std::dynamic_pointer_cast<ModelAPI_Object>(aObject)->data()->name().c_str();
-            case Qt::DecorationRole:
-              return QIcon(":pictures/part_ico.png");
-            case Qt::ForegroundRole:
-              {
-                if (theIndex == myActivePartIndex)
-                  return QBrush(ACTIVE_COLOR);
-                else
-                  return QBrush(PASSIVE_COLOR);
-              }
-            default:
-              return QVariant();
-          }
-        }
-      }
-      break;
-  }
-  if (aParent.internalId() == HistoryNode) {
-    int aId = aParent.row() - historyOffset();
-    QModelIndex* aIndex = toSourceModelIndex(theIndex);
-    return findPartModel(aId)->data(*aIndex, theRole);
-  }
-  return toSourceModelIndex(theIndex)->data(theRole);
-}
-
-QVariant PartSet_DocumentDataModel::headerData(int theSection, Qt::Orientation theOrient,
-                                            int theRole) const
-{
-  return QVariant();
-}
-
-int PartSet_DocumentDataModel::rowCount(const QModelIndex& theParent) const
-{
-  SessionPtr aSession = ModelAPI_Session::get();
-  if (!aSession->hasModuleDocument())
-    return 0;
-  DocumentPtr aRootDoc = aSession->moduleDocument();
-  if (!theParent.isValid()) {
-    // Size of external models
-    int aVal = historyOffset();
-    // Plus history size
-    aVal += aRootDoc->size(ModelAPI_Feature::group());
-    return aVal;
-  }
-  if (theParent.internalId() == PartsFolder) {
-    return aRootDoc->size(ModelAPI_ResultPart::group());
-    //int aSize = myPartModels.size();
-    //return myPartModels.size();
-  }
-  if (theParent.internalId() == HistoryNode) {
-    int aId = theParent.row() - historyOffset();
-    PartSet_PartModel* aModel = findPartModel(aId);
-    if (aModel)
-      return aModel->rowCount(QModelIndex());
-    return 0;
-  }
-  if (theParent.internalId() == PartResult)
-    return 0;
-  QModelIndex* aParent = toSourceModelIndex(theParent);
-  const QAbstractItemModel* aModel = aParent->model();
-  if (!isSubModel(aModel))
-    return 0;
-
-  /*if (isPartSubModel(aModel)) {
-   if (aModel != myActivePart)
-   return 0;
-   }*/
-  return aModel->rowCount(*aParent);
-}
-
-int PartSet_DocumentDataModel::columnCount(const QModelIndex& theParent) const
-{
-  return 2;
-}
-
-QModelIndex PartSet_DocumentDataModel::index(int theRow, int theColumn,
-                                          const QModelIndex& theParent) const
-{
-  QModelIndex aIndex;
-  if (!theParent.isValid()) {
-    int aOffs = myModel->rowCount();
-    if (theRow < aOffs) {
-      aIndex = myModel->index(theRow, theColumn, theParent);
-      aIndex = createIndex(theRow, theColumn, (void*) getModelIndex(aIndex));
-    } else {
-      if (theRow == aOffs)  // Create Parts node
-        aIndex = partFolderNode(theColumn);
-      else {
-        // create history node
-        aIndex = createIndex(theRow, theColumn, HistoryNode);
-      }
-    }
-  } else {
-    if (theParent.internalId() == PartsFolder) {
-       aIndex = createIndex(theRow, theColumn, PartResult);
-    } else { 
-      if (theParent.internalId() == HistoryNode) {
-        int aId = theParent.row() - historyOffset();
-        aIndex = findPartModel(aId)->index(theRow, theColumn, QModelIndex());
-      } else {
-        QModelIndex* aParent = (QModelIndex*) theParent.internalPointer();
-        aIndex = aParent->model()->index(theRow, theColumn, (*aParent));
-      }
-      aIndex = createIndex(theRow, theColumn, (void*) getModelIndex(aIndex));
-    }
-  }
-  return aIndex;
-}
-
-QModelIndex PartSet_DocumentDataModel::parent(const QModelIndex& theIndex) const
-{
-  if ((theIndex.internalId() == PartsFolder) || (theIndex.internalId() == HistoryNode))
-    return QModelIndex();
-
-  if (theIndex.internalId() == PartResult)
-    return partFolderNode(0);
-
-  QModelIndex* aIndex = toSourceModelIndex(theIndex);
-  const QAbstractItemModel* aModel = aIndex->model();
-  if (!isSubModel(aModel))
-    return QModelIndex();
-
-  QModelIndex aIndex1 = aModel->parent(*aIndex);
-  const PartSet_PartModel* aPartModel = dynamic_cast<const PartSet_PartModel*>(aModel);
-  if (aPartModel && (!aIndex1.isValid())) {
-    int aId = aPartModel->position();
-    int aRow = aId + historyOffset();
-    return createIndex(aRow, 0, (qint32) HistoryNode);
-  }
-
-  if (aIndex1.isValid())
-    return createIndex(aIndex1.row(), 0, (void*) getModelIndex(aIndex1));
-  return aIndex1;
-}
-
-bool PartSet_DocumentDataModel::hasChildren(const QModelIndex& theParent) const
-{
-  if (!theParent.isValid())
-    return true;
-  return rowCount(theParent) > 0;
-}
-
-QModelIndex* PartSet_DocumentDataModel::toSourceModelIndex(const QModelIndex& theProxy) const
-{
-  QModelIndex* aIndexPtr = static_cast<QModelIndex*>(theProxy.internalPointer());
-  return aIndexPtr;
-}
-
-QModelIndex* PartSet_DocumentDataModel::findModelIndex(const QModelIndex& theIndex) const
-{
-  QList<QModelIndex*>::const_iterator aIt;
-  for (aIt = myIndexes.constBegin(); aIt != myIndexes.constEnd(); ++aIt) {
-    QModelIndex* aIndex = (*aIt);
-    if ((*aIndex) == theIndex)
-      return aIndex;
-  }
-  return 0;
-}
-
-QModelIndex* PartSet_DocumentDataModel::getModelIndex(const QModelIndex& theIndex) const
-{
-  QModelIndex* aIndexPtr = findModelIndex(theIndex);
-  if (!aIndexPtr) {
-    aIndexPtr = new QModelIndex(theIndex);
-    PartSet_DocumentDataModel* that = (PartSet_DocumentDataModel*) this;
-    that->myIndexes.append(aIndexPtr);
-  }
-  return aIndexPtr;
-}
-
-void PartSet_DocumentDataModel::clearModelIndexes()
-{
-  foreach (QModelIndex* aIndex, myIndexes) 
-    delete aIndex;
-  myIndexes.clear();
-}
-
-void PartSet_DocumentDataModel::clearSubModels()
-{
-  foreach (PartSet_PartModel* aPart, myPartModels) 
-    delete aPart;
-  myPartModels.clear();
-  myActivePartModel = 0;
-}
-
-ObjectPtr PartSet_DocumentDataModel::object(const QModelIndex& theIndex) const
-{
-  if (theIndex.internalId() == PartsFolder)
-    return ObjectPtr();
-  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-  if (theIndex.internalId() == HistoryNode) {
-    int aOffset = historyOffset();
-    return aRootDoc->object(ModelAPI_Feature::group(), theIndex.row() - aOffset);
-  }
-  if (theIndex.internalId() == PartResult) {
-    return aRootDoc->object(ModelAPI_ResultPart::group(), theIndex.row());
-  }
-  QModelIndex* aIndex = toSourceModelIndex(theIndex);
-  if (!isSubModel(aIndex->model()))
-    return ObjectPtr();
-
-  const PartSet_FeaturesModel* aModel = dynamic_cast<const PartSet_FeaturesModel*>(aIndex->model());
-  return aModel->object(*aIndex);
-}
-
-bool PartSet_DocumentDataModel::insertRows(int theRow, int theCount, const QModelIndex& theParent)
-{
-  beginInsertRows(theParent, theRow, theRow + theCount - 1);
-  //endInsertRows();
-
-  // Update history
-  QModelIndex aRoot;
-  int aRow = rowCount(aRoot);
-  beginInsertRows(aRoot, aRow, aRow);
-  endInsertRows();
-
-  return true;
-}
-
-bool PartSet_DocumentDataModel::removeRows(int theRow, int theCount, const QModelIndex& theParent)
-{
-  beginRemoveRows(theParent, theRow, theRow + theCount - 1);
-  endRemoveRows();
-  return true;
-}
-
-void PartSet_DocumentDataModel::removeSubModel(int theModelId)
-{
-  PartSet_PartModel* aModel = myPartModels.at(theModelId);
-  removeSubModel(aModel);
-}
-
-void PartSet_DocumentDataModel::removeSubModel(PartSet_PartModel* theModel)
-{
-  QIntList aToRemove;
-  for (int i = 0; i < myIndexes.size(); i++) {
-    if (myIndexes.at(i)->model() == theModel)
-      aToRemove.append(i);
-  }
-  int aId;
-  while (aToRemove.size() > 0) {
-    aId = aToRemove.last();
-    delete myIndexes.at(aId);
-    myIndexes.removeAt(aId);
-    aToRemove.removeLast();
-  }
-  if (theModel == myActivePartModel)
-    myActivePartModel = 0;
-  myPartModels.removeAll(theModel);
-  delete theModel;
-}
-
-
-bool PartSet_DocumentDataModel::isSubModel(const QAbstractItemModel* theModel) const
-{
-  if (theModel == myModel)
-    return true;
-  return isPartSubModel(theModel);
-}
-
-bool PartSet_DocumentDataModel::isPartSubModel(const QAbstractItemModel* theModel) const
-{
-  return myPartModels.contains((PartSet_PartModel*) theModel);
-}
-
-QModelIndex PartSet_DocumentDataModel::partFolderNode(int theColumn) const
-{
-  int aPos = myModel->rowCount(QModelIndex());
-  return createIndex(aPos, theColumn, PartsFolder);
-}
-
-int PartSet_DocumentDataModel::historyOffset() const
-{
-  // Nb of rows of top model + Parts folder
-  return myModel->rowCount(QModelIndex()) + 1;
-}
-
-bool PartSet_DocumentDataModel::activatePart(const QModelIndex& theIndex)
-{
-  if ((theIndex.internalId() == PartsFolder) || (theIndex.internalId() == HistoryNode))
-    return false;
-
-  if (theIndex.isValid() && (theIndex.internalId() == PartResult)) {
-    myActivePartIndex = theIndex;
-    myModel->setItemsColor(PASSIVE_COLOR);
-    if (myActivePartModel) 
-      myActivePartModel->setItemsColor(PASSIVE_COLOR);
-    
-    // Find activated part feature by its ID
-    ResultPartPtr aPartRes = activePart();
-    FeaturePtr aFeature = ModelAPI_Feature::feature(aPartRes);
-    if (aFeature.get()) {
-      myActivePartModel = findPartModel(aFeature);
-      myActivePartModel->setItemsColor(ACTIVE_COLOR);
-    }
-  } 
-  return true;
-}
-
-ResultPartPtr PartSet_DocumentDataModel::activePart() const
-{
-  if (myActivePartIndex.isValid()) {
-    DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-    ObjectPtr aObj = aRootDoc->object(ModelAPI_ResultPart::group(), myActivePartIndex.row());
-    return std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
-  }
-  return ResultPartPtr();
-}
-
-QModelIndex PartSet_DocumentDataModel::activePartTree() const
-{
-  if (myActivePartModel) {
-    return createIndex(myActivePartModel->position() + historyOffset(), 0, HistoryNode);
-  }
-  return QModelIndex();
-}
-
-void PartSet_DocumentDataModel::deactivatePart()
-{
-  if (myActivePartIndex.isValid()) {
-    if (myActivePartModel) 
-      myActivePartModel->setItemsColor(PASSIVE_COLOR);
-    myActivePartModel = 0;
-    myActivePartIndex = QModelIndex();
-    myModel->setItemsColor(ACTIVE_COLOR);
-  }
-}
-
-Qt::ItemFlags PartSet_DocumentDataModel::flags(const QModelIndex& theIndex) const
-{
-  if ((theIndex.internalId() >= PartsFolder) && (theIndex.internalId() <= PartResult)) {
-    Qt::ItemFlags aFlags = Qt::ItemIsSelectable;
-    if (object(theIndex).get()) {
-      aFlags |= Qt::ItemIsEditable;
-    }
-    // Disable items which are below of last history row
-    // Do not disable second column
-    if (theIndex.internalId() == HistoryNode) {
-      if (theIndex.row() <= lastHistoryRow() || (theIndex.column() == 1))
-        aFlags |= Qt::ItemIsEnabled;
-    } else
-      aFlags |= Qt::ItemIsEnabled;
-    return aFlags;
-  } else {
-    QModelIndex* aIndex = toSourceModelIndex(theIndex);
-    const QAbstractItemModel* aModel = aIndex->model();
-    Qt::ItemFlags aFlags = aModel->flags(*aIndex);
-    if (aModel == myModel) {
-      if (myModel->object(*aIndex).get())
-        aFlags |= Qt::ItemIsEditable;
-    }
-    return aFlags;
-  }
-}
-
-QModelIndex PartSet_DocumentDataModel::partIndex(const ResultPartPtr& theObject) const
-{
-  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-  int aNb = aRootDoc->size(ModelAPI_ResultPart::group());
-  for (int aId = 0; aId < aNb; aId++) {
-    if (theObject == aRootDoc->object(ModelAPI_ResultPart::group(), aId))
-      return createIndex(aId, 0, PartResult);
-  }
-  return QModelIndex();
-}
-
-QModelIndex PartSet_DocumentDataModel::objectIndex(const ObjectPtr theObject) const
-{
-  // Check that this feature belongs to root document
-  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-  DocumentPtr aDoc = theObject->document();
-  if (aDoc == aRootDoc) {
-    // This feature belongs to histrory or top model
-    FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(theObject);
-    if (aFeature) {
-      int aId;
-      int aNb = aRootDoc->size(ModelAPI_Feature::group());
-      for (aId = 0; aId < aNb; aId++) {
-        if (theObject == aRootDoc->object(ModelAPI_Feature::group(), aId))
-          break;
-      }
-      if (aId < aNb)
-        return index(aId + historyOffset(), 0, QModelIndex());
-    } else {
-      QModelIndex aIndex = myModel->objectIndex(theObject);
-      return
-          aIndex.isValid() ?
-              createIndex(aIndex.row(), 0, (void*) getModelIndex(aIndex)) :
-              QModelIndex();
-    }
-  } else {
-    PartSet_PartModel* aPartModel = 0;
-    foreach(PartSet_PartModel* aModel, myPartModels) {
-      if (aModel->hasDocument(aDoc)) {
-        aPartModel = aModel;
-        break;
-      }
-    }
-    if (aPartModel) {
-      QModelIndex aIndex = aPartModel->objectIndex(theObject);
-      return aIndex.isValid() ?
-              createIndex(aIndex.row(), 0, (void*) getModelIndex(aIndex)) :
-              QModelIndex();
-    }
-  }
-  return QModelIndex();
-}
-
-
-void PartSet_DocumentDataModel::clear()
-{
-  clearModelIndexes();
-  clearSubModels();
-  //myActivePart = 0;
-  myActivePartIndex = QModelIndex();
-  myModel->setItemsColor(ACTIVE_COLOR);
-}
-
-int PartSet_DocumentDataModel::lastHistoryRow() const
-{
-  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-  FeaturePtr aFeature = aRootDoc->currentFeature(true);
-  if (aFeature.get())
-    return historyOffset() + aRootDoc->index(aFeature);
-  else 
-    return historyOffset() - 1;
-}
-
-void PartSet_DocumentDataModel::setLastHistoryItem(const QModelIndex& theIndex)
-{
-  SessionPtr aMgr = ModelAPI_Session::get();
-  DocumentPtr aRootDoc = aMgr->moduleDocument();
-  std::string aOpName = tr("History change").toStdString();
-  if (theIndex.internalId() == HistoryNode) {
-    ObjectPtr aObject = object(theIndex);
-    aMgr->startOperation(aOpName);
-    aRootDoc->setCurrentFeature(std::dynamic_pointer_cast<ModelAPI_Feature>(aObject), true);
-    aMgr->finishOperation();
-  } else {
-    aMgr->startOperation(aOpName);
-    aRootDoc->setCurrentFeature(FeaturePtr(), true);
-    aMgr->finishOperation();
-  }
-}
-
-QModelIndex PartSet_DocumentDataModel::lastHistoryItem() const
-{
-  return index(lastHistoryRow(), 1);
-}
-
-
-QIcon PartSet_DocumentDataModel::featureIcon(const FeaturePtr& theFeature)
-{
-  QIcon anIcon;
-
-  std::string aKind = theFeature->getKind();
-  QString aId(aKind.c_str());
-  if (!myIcons.contains(aId))
-    return anIcon;
-
-  QString anIconString = myIcons[aId];
-
-  ModelAPI_ExecState aState = theFeature->data()->execState();
-  switch(aState) {
-    case ModelAPI_StateDone:
-    case ModelAPI_StateNothing: {
-      anIcon = QIcon(anIconString);
-    }
-    break;
-    case ModelAPI_StateMustBeUpdated: {
-      anIcon = ModuleBase_Tools::lighter(anIconString);
-    }
-    break;
-    case ModelAPI_StateExecFailed: {
-      anIcon = ModuleBase_Tools::composite(":icons/exec_state_failed.png", anIconString);
-    }
-    break;
-    case ModelAPI_StateInvalidArgument: {
-      anIcon = ModuleBase_Tools::composite(":icons/exec_state_invalid_parameters.png",
-                                           anIconString);
-    }
-    break;
-    default: break;  
-  }
-  return anIcon;  
-}
-
-void PartSet_DocumentDataModel::onMouseDoubleClick(const QModelIndex& theIndex)
-{
-  if (theIndex.column() != 1)
-    return;
-  if (flags(theIndex) == 0)
-    return;
-  QTreeView* aTreeView = dynamic_cast<QTreeView*>(sender());
-  if ((theIndex.internalId() >= PartsFolder) && (theIndex.internalId() <= PartResult)) {
-    if (myActivePartModel)
-      // It means that the root document is not active
-      return;
-    QModelIndex aNewIndex;
-    if (theIndex.internalId() == HistoryNode) 
-      aNewIndex = theIndex;
-    int aOldId = lastHistoryRow();
-    setLastHistoryItem(theIndex);
-    int aStartRow = std::min(aOldId, theIndex.row());
-    int aEndRow = std::max(aOldId, theIndex.row());
-    for (int i = aStartRow; i <= aEndRow; i++) {
-      aTreeView->update(createIndex(i, 0, HistoryNode));
-      aTreeView->update(createIndex(i, 1, HistoryNode));
-    }
-    
-  } else {
-    QModelIndex* aIndex = toSourceModelIndex(theIndex);
-    const QAbstractItemModel* aModel = aIndex->model();
-    if (isPartSubModel(aModel)) {
-      PartSet_PartDataModel* aPartModel = (PartSet_PartDataModel*)aModel;
-      QModelIndex aOldItem = aPartModel->lastHistoryItem();
-      aPartModel->setLastHistoryItem(*aIndex);
-      QModelIndex aOldIndex = createIndex(aOldItem.row(), aOldItem.column(), (void*) getModelIndex(aOldItem));
-      int aStartRow = std::min(aOldItem.row(), aIndex->row());
-      int aEndRow = std::max(aOldItem.row(), aIndex->row());
-      for (int i = aStartRow; i <= aEndRow; i++) {
-        QModelIndex aInd1 = aPartModel->index(i, 0);
-        QModelIndex aInd2 = createIndex(i, 0, (void*) getModelIndex(aInd1));
-        aTreeView->update(aInd2);
-        aInd1 = aPartModel->index(i, 1);
-        aInd2 = createIndex(i, 1, (void*) getModelIndex(aInd1));
-        aTreeView->update(aInd2);
-      }
-    }
-  }
-} 
-
-
-PartSet_PartModel* PartSet_DocumentDataModel::findPartModel(FeaturePtr thePart) const
-{
-  foreach (PartSet_PartModel* aModel, myPartModels) {
-    if (aModel->part() == thePart)
-      return aModel;
-  }
-  return 0;
-}
-
-PartSet_PartModel* PartSet_DocumentDataModel::findPartModel(int thePosition) const
-{
-  foreach (PartSet_PartModel* aModel, myPartModels) {
-    if (aModel->position() == thePosition)
-      return aModel;
-  }
-  return 0;
-}
\ No newline at end of file
diff --git a/src/PartSet/PartSet_DocumentDataModel.h b/src/PartSet/PartSet_DocumentDataModel.h
deleted file mode 100644 (file)
index e059a1f..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-#ifndef PartSet_DocumentDataModel_H
-#define PartSet_DocumentDataModel_H
-
-#include "PartSet.h"
-#include <ModuleBase_Definitions.h>
-#include <ModelAPI_ResultPart.h>
-#include <ModelAPI_Feature.h>
-#include <ModuleBase_IDocumentDataModel.h>
-
-#include <Events_Listener.h>
-#include <QList>
-#include <QMap>
-
-class ModelAPI_Document;
-class PartSet_PartModel;
-class PartSet_TopDataModel;
-
-/**\class PartSet_DocumentDataModel
- * \ingroup GUI
- * \brief This is a proxy data model for Object Browser (QTreeView).
- * It contains several sub-models for generation of each sub-part of data tree.
- */
-class PARTSET_EXPORT PartSet_DocumentDataModel : public ModuleBase_IDocumentDataModel, public Events_Listener
-{
-Q_OBJECT
- public:
-   /// Constructor
-   /// \param theParent a parent object
-  PartSet_DocumentDataModel(QObject* theParent);
-  virtual ~PartSet_DocumentDataModel();
-
-  /// Event Listener method
-  /// \param theMessage an event message
-  virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
-
-  /// Returns the data stored under the given role for the item referred to by the index.
-  /// \param theIndex a model index
-  /// \param theRole a data role (see Qt::ItemDataRole)
-  virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
-
-  /// Returns the data for the given role and section in the header with the specified orientation.
-  /// \param theSection a section
-  /// \param theOrient an orientation
-  /// \param theRole a data role (see Qt::ItemDataRole)
-  virtual QVariant headerData(int theSection, Qt::Orientation theOrient, int theRole =
-                                  Qt::DisplayRole) const;
-
-  /// Returns the number of rows under the given parent. When the parent is valid it means that 
-  /// rowCount is returning the number of children of parent.
-  /// \param theParent a parent model index
-  virtual int rowCount(const QModelIndex& theParent = QModelIndex()) const;
-
-  /// Returns the number of columns for the children of the given parent.
-  /// It has a one column
-  /// \param theParent a parent model index
-  virtual int columnCount(const QModelIndex& theParent = QModelIndex()) const;
-
-  /// Returns the index of the item in the model specified by the given row, column and parent index.
-  /// \param theRow a row
-  /// \param theColumn a column
-  /// \param theParent a parent model index
-  virtual QModelIndex index(int theRow, int theColumn, const QModelIndex &theParent =
-                                QModelIndex()) const;
-
-  /// Returns the parent of the model item with the given index. 
-  /// If the item has no parent, an invalid QModelIndex is returned.
-  /// \param theIndex a model index
-  virtual QModelIndex parent(const QModelIndex& theIndex) const;
-
-  /// Returns true if parent has any children; otherwise returns false.
-  /// \param theParent a parent model index
-  virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const;
-
-  /// Inserts count rows into the model before the given row. 
-  /// Items in the new row will be children of the item represented by the parent model index.
-  /// \param theRow a start row
-  /// \param theCount a nember of rows to insert
-  /// \param theParent a parent model index
-  bool insertRows(int theRow, int theCount, const QModelIndex& theParent = QModelIndex());
-
-  /// Removes count rows starting with the given row under parent parent from the model.
-  /// \param theRow a start row
-  /// \param theCount a nember of rows to remove
-  /// \param theParent a parent model index
-  bool removeRows(int theRow, int theCount, const QModelIndex& theParent = QModelIndex());
-
-  /// Returns the item flags for the given index.
-  /// \param theIndex a model index
-  virtual Qt::ItemFlags flags(const QModelIndex& theIndex) const;
-
-  //! Returns an object by the given Model index.
-  //! Returns 0 if the given index is not index of an object
-  virtual ObjectPtr object(const QModelIndex& theIndex) const;
-
-  //! Returns index of the object
-  //! \param theObject object to find
-  virtual QModelIndex objectIndex(const ObjectPtr theObject) const;
-
-  //! Returns QModelIndex which corresponds to the given part
-  //! If the object is not found then index is not valid
-  //! \param thePart a part for analysis
-  QModelIndex partIndex(const ResultPartPtr& thePart) const;
-
-  //! Activates a part data model if the index is a Part node index. 
-  //! Returns true if active part changed.
-  //! \param theIndex a model index
-  bool activatePart(const QModelIndex& theIndex);
-
-  //! Retrurns active part
-  ResultPartPtr activePart() const;
-
-  //! Retrurns QModelIndex of active part
-  QModelIndex activePartIndex() const
-  {
-    return myActivePartIndex;
-  }
-
-  //! Returns parent index of active part tree (index of Part feature) 
-  QModelIndex activePartTree() const;
-
-  //! Deactivates a Part
-  void deactivatePart();
-
-  //! Rebuild data tree
-  virtual void rebuildDataTree();
-
-  //! Clear internal data
-  virtual void clear();
-
-  //! Set an Index which will be considered as a last history index
-  //! \param theIndex a last index for history
-  void setLastHistoryItem(const QModelIndex& theIndex);
-
-  //! Returns last history item
-  QModelIndex lastHistoryItem() const;
-
-  //! Returns icon name according to feature
-  static QIcon featureIcon(const FeaturePtr& theFeature);
-
- public slots:
-   void onMouseDoubleClick(const QModelIndex& theIndex);
-
- private:
-
-  enum
-  {
-    PartsFolder,
-    HistoryNode,
-    PartResult
-  };
-
-  //! Converts QModelIndex of this model to QModelIndex of a one of sub-models.
-  QModelIndex* toSourceModelIndex(const QModelIndex& theProxy) const;
-
-  //! Finds a pointer on QModelIndex which is equal to the given one
-  QModelIndex* findModelIndex(const QModelIndex& theIndex) const;
-
-  //! Returns pointer on QModelIndex which is equal to the given one.
-  QModelIndex* getModelIndex(const QModelIndex& theIndex) const;
-
-  //! Deletes all saved pointers on QModelIndex objects.
-  void clearModelIndexes();
-
-  //! Deletes all saved pointers on QModelIndex objects.
-  void clearSubModels();
-
-  //! Removes sub-model on removing a part object. Also it removes QModelIndex-es which refer to this model
-  void removeSubModel(int theModelId);
-
-  //! Removes sub-model on removing a part object. Also it removes QModelIndex-es which refer to this model
-  void removeSubModel(PartSet_PartModel* theModel);
-
-  //! Returns true if the given model is a one of sub-models (of both types)
-  bool isSubModel(const QAbstractItemModel* theModel) const;
-
-  //! Returns true if the given model is a one of sub-models of Part type
-  bool isPartSubModel(const QAbstractItemModel* theModel) const;
-
-  //! Returns Parts Folder node
-  //! \param theColumn an Id of column
-  QModelIndex partFolderNode(int theColumn) const;
-
-  int lastHistoryRow() const;
-
-  int historyOffset() const;
-
-  PartSet_PartModel* findPartModel(FeaturePtr thePart) const;
-
-  PartSet_PartModel* findPartModel(int thePosition) const;
-
-  //! Data model of top part of data tree (not parts object)
-  PartSet_TopDataModel* myModel;
-
-  //! Data models for Parts data tree representation (one data model per a one part)
-  QList<PartSet_PartModel*> myPartModels;
-
-  //! Active part in part editing mode
-  PartSet_PartModel* myActivePartModel;
-
-  QModelIndex myActivePartIndex;
-
-  //! List of saved QModelIndexes created by sub-models
-  QList<QModelIndex*> myIndexes;
-
-  static QMap<QString, QString> myIcons;
-};
-
-#endif
index 3d292afceeb485e31d89aaeb0e5c3a8039c7a460..05d7f5b61c6157da11c4c89623520b5b3cabc3f5 100755 (executable)
@@ -39,6 +39,9 @@ class PARTSET_EXPORT PartSet_ExternalObjectsMgr
   /// Returns the state whether the external object is used
   bool useExternal() const { return myUseExternal; }
 
+  /// Checks validity of the given object
+  /// \param theObject an object to check
+  /// \return valid or not valid
   bool isValidObject(const ObjectPtr& theObject);
 
   /// Finds or create and external object
index bf6fed7ddf15ac13e9ed0693e7cfbd1991bca02f..a73cb14371ff62599dfcf278c9c113cbc3cd3f60 100755 (executable)
@@ -25,21 +25,27 @@ class PARTSET_EXPORT PartSet_LockApplyMgr : public QObject
 
 public:
   /// Constructor
-  /// \param theExternal the external state
-  /// \param theDefaultValue the default value for the external object using
+  /// \param theParent a parent object
+  /// \param theWorkshop a reference to workshop
   PartSet_LockApplyMgr(QObject* theParent,
                        ModuleBase_IWorkshop* theWorkshop);
 
   virtual ~PartSet_LockApplyMgr() {}
 
+  /// Activates the object
   void activate();
+
+  /// Deactivates the object
   void deactivate();
+
+  /// Unlocks validation in operations manager
   void valuesChanged();
 
 protected slots:
-  // Set lock validating in the operation manager. Set apply is disabled
+  /// Set lock validating in the operation manager. Set apply is disabled
   void onLockValidating();
-  // Set unlock validating in the operation manager. Call method to update the apply state.
+
+  /// Set unlock validating in the operation manager. Call method to update the apply state.
   void onUnlockValidating();
 
 private:
index 00ba380b2216d5624896f44d52a18310c95cd36f..0cbbf175982b5fb231d355600f8e93fe5cebc305 100755 (executable)
@@ -128,9 +128,6 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
   new PartSet_IconFactory();
 
   mySketchMgr = new PartSet_SketcherMgr(this);
-#ifdef ModuleDataModel
-  myDataModel = new PartSet_DocumentDataModel(this);
-#endif
 
   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWshop);
   XGUI_Workshop* aWorkshop = aConnector->workshop();
@@ -880,12 +877,6 @@ void PartSet_Module::customizeObjectBrowser(QWidget* theObjectBrowser)
     aOB->treeView()->setExpandsOnDoubleClick(false);
     connect(aOB->treeView(), SIGNAL(doubleClicked(const QModelIndex&)), 
       SLOT(onTreeViewDoubleClick(const QModelIndex&)));
-#ifdef ModuleDataModel
-    connect(aOB, SIGNAL(headerMouseDblClicked(const QModelIndex&)), 
-      SLOT(onTreeViewDoubleClick(const QModelIndex&)));
-    connect(aOB->treeView(), SIGNAL(doubleClicked(const QModelIndex&)), 
-      myDataModel, SLOT(onMouseDoubleClick(const QModelIndex&)));
-#endif
   }
 }
 
@@ -987,38 +978,13 @@ void PartSet_Module::processEvent(const std::shared_ptr<Events_Message>& theMess
 
     SessionPtr aMgr = ModelAPI_Session::get();
     DocumentPtr aActiveDoc = aMgr->activeDocument();
-#ifdef ModuleDataModel
-    QModelIndex aOldIndex = myDataModel->activePartTree();
-    DocumentPtr aDoc = aMgr->moduleDocument();
-    if (aActiveDoc == aDoc) {
-      if (aOldIndex.isValid())
-        aTreeView->setExpanded(aOldIndex, false);
-      myDataModel->deactivatePart();
-      aPalet.setColor(QPalette::Text, QColor(0, 72, 140));
-    } else {
-      std::string aGrpName = ModelAPI_ResultPart::group();
-      for (int i = 0; i < aDoc->size(aGrpName); i++) {
-        ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aDoc->object(aGrpName, i));
-        if (aPart->partDoc() == aActiveDoc) {
-          QModelIndex aIndex = myDataModel->partIndex(aPart);
-          if (myDataModel->activatePart(aIndex)) {
-            if (aOldIndex.isValid())
-              aTreeView->setExpanded(aOldIndex, false);
-            aTreeView->setExpanded(myDataModel->activePartTree(), true);
-            aPalet.setColor(QPalette::Text, Qt::black);
-          }
-          break;
-        }
-      }
-    }
-#else
     if (aActivePartIndex.isValid())
       aTreeView->setExpanded(aActivePartIndex, false);
     XGUI_DataModel* aDataModel = aWorkshop->objectBrowser()->dataModel();
     aActivePartIndex = aDataModel->documentRootIndex(aActiveDoc);
     if (aActivePartIndex.isValid())
       aTreeView->setExpanded(aActivePartIndex, true);
-#endif
+
     aLabel->setPalette(aPalet);
     aWorkshop->updateCommandStatus();
 
@@ -1048,9 +1014,7 @@ void PartSet_Module::onTreeViewDoubleClick(const QModelIndex& theIndex)
   }
   if (theIndex.column() != 0) // Use only first column
     return;
-#ifdef ModuleDataModel
-  ObjectPtr aObj = myDataModel->object(theIndex);
-#else
+
   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
   XGUI_Workshop* aWorkshop = aConnector->workshop();
   XGUI_DataModel* aDataModel = aWorkshop->objectBrowser()->dataModel();
@@ -1058,7 +1022,6 @@ void PartSet_Module::onTreeViewDoubleClick(const QModelIndex& theIndex)
   if ((aDataModel->flags(theIndex) & Qt::ItemIsSelectable) == 0)
     return;
   ObjectPtr aObj = aDataModel->object(theIndex);
-#endif
 
   ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
   if (!aPart.get()) { // Probably this is Feature
index f43efaf94702da0da6957f2595f59f13917c6693..a475b5f657a5fd47ce73ef4c3133de788db89d1e 100644 (file)
@@ -4,7 +4,6 @@
 #define PartSet_Module_H
 
 #include "PartSet.h"
-#include "PartSet_DocumentDataModel.h"
 
 #include <ModuleBase_IModule.h>
 #include <ModuleBase_Definitions.h>
@@ -21,6 +20,7 @@
 #include <QMap>
 #include <QMenu>
 #include <QObject>
+#include <QModelIndex>
 
 #include <string>
 
@@ -155,13 +155,9 @@ public:
   /// \return true if items are added and there is no necessity to provide standard menu
   bool isMouseOverWindow();
 
+  /// Returns sketch manager object
   PartSet_SketcherMgr* sketchMgr() const { return mySketchMgr; }
 
-#ifdef ModuleDataModel
-  /// Returns data model object for representation of data tree in Object browser
-  virtual ModuleBase_IDocumentDataModel* dataModel() const { return myDataModel; }
-#endif
-
   /// Performs functionality on closing document
   virtual void closeDocument();
 
@@ -287,9 +283,6 @@ protected slots:
   int myVisualLayerId;
 
   bool myHasConstraintShown;
-#ifdef ModuleDataModel
-  PartSet_DocumentDataModel* myDataModel;
-#endif
 
   QModelIndex aActivePartIndex;
 };
diff --git a/src/PartSet/PartSet_PartDataModel.cpp b/src/PartSet/PartSet_PartDataModel.cpp
deleted file mode 100644 (file)
index fff14f9..0000000
+++ /dev/null
@@ -1,449 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-#include "PartSet_PartDataModel.h"
-#include "PartSet_Module.h"
-#include "PartSet_DocumentDataModel.h"
-
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_Feature.h>
-#include <ModelAPI_Result.h>
-#include <ModelAPI_Data.h>
-#include <ModelAPI_AttributeDocRef.h>
-#include <ModelAPI_Object.h>
-#include <ModelAPI_ResultPart.h>
-#include <ModelAPI_ResultConstruction.h>
-#include <ModelAPI_ResultParameter.h>
-#include <ModelAPI_ResultBody.h>
-#include <ModelAPI_ResultGroup.h>
-#include <ModelAPI_AttributeDouble.h>
-#include <ModelAPI_Events.h>
-#include <ModelAPI_Tools.h>
-
-#include <Events_Loop.h>
-
-#include <QIcon>
-#include <QBrush>
-
-
-PartSet_PartDataModel::PartSet_PartDataModel(QObject* theParent)
-    : PartSet_PartModel(theParent)
-{
-}
-
-PartSet_PartDataModel::~PartSet_PartDataModel()
-{
-}
-
-QVariant PartSet_PartDataModel::data(const QModelIndex& theIndex, int theRole) const
-{
-  DocumentPtr aPartDoc = partDocument();
-  if (theIndex.column() == 1) {
-    DocumentPtr aActiveDoc = ModelAPI_Session::get()->activeDocument();
-    QModelIndex aParent = theIndex.parent();
-    if (aActiveDoc == aPartDoc) {
-      if (!aParent.isValid()) {
-        switch (theRole) {
-        case Qt::DecorationRole:
-          if (theIndex.row() == lastHistoryRow())
-            return QIcon(":pictures/arrow.png");
-        }
-      }
-    }
-    return QVariant();
-  }
-
-  if (theIndex.internalId() >= 0) {
-    ObjectPtr aObj = object(theIndex);
-    switch (theRole) {
-      case Qt::DisplayRole:
-        return aObj->data()->name().c_str();
-      case Qt::DecorationRole: 
-        {
-          FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
-          if (aFeature)
-            return PartSet_DocumentDataModel::featureIcon(aFeature);
-        }
-        break;
-      case Qt::ForegroundRole:
-        if (theIndex.internalId() > lastHistoryRow())
-          return QBrush(Qt::lightGray);
-        return QBrush(myItemsColor);
-    }
-  }
-
-  switch (theRole) {
-    case Qt::DisplayRole:
-      // return a name
-      switch (theIndex.internalId()) {
-        //case MyRoot: {
-        //  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-        //  ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), myId);
-        //  if (aObject)
-        //    return std::dynamic_pointer_cast<ModelAPI_Object>(aObject)->data()->name().c_str();
-        //}
-        case ParamsFolder:
-          return tr("Parameters") + QString(" (%1)").arg(rowCount(theIndex));
-        case ConstructFolder:
-          return tr("Constructions") + QString(" (%1)").arg(rowCount(theIndex));
-        case BodiesFolder:
-          return tr("Bodies") + QString(" (%1)").arg(rowCount(theIndex));
-        case GroupsFolder:
-          return tr("Groups") + QString(" (%1)").arg(rowCount(theIndex));
-        case ParamObject: {
-          ObjectPtr aObject = aPartDoc->object(ModelAPI_ResultParameter::group(), theIndex.row());
-          if (aObject) {
-            ResultParameterPtr aParam = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aObject);
-            AttributeDoublePtr aValueAttribute = aParam->data()->real(ModelAPI_ResultParameter::VALUE());
-            QString aVal = QString::number(aValueAttribute->value());
-            QString aTitle = QString(aObject->data()->name().c_str());
-            return aTitle + " = " + aVal;
-          }
-        }
-          break;
-        case ConstructObject: {
-          ObjectPtr aObject = aPartDoc->object(ModelAPI_ResultConstruction::group(), theIndex.row());
-          if (aObject)
-            return std::dynamic_pointer_cast<ModelAPI_Object>(aObject)->data()->name().c_str();
-        }
-          break;
-        case BodiesObject: {
-          ObjectPtr aObject = aPartDoc->object(ModelAPI_ResultBody::group(), theIndex.row());
-          if (aObject)
-            return aObject->data()->name().c_str();
-        }
-          break;
-        case GroupObject: {
-          ObjectPtr aObject = aPartDoc->object(ModelAPI_ResultGroup::group(), theIndex.row());
-          if (aObject)
-            return aObject->data()->name().c_str();
-        }
-        case HistoryObject: {
-          ObjectPtr aObject = aPartDoc->object(ModelAPI_Feature::group(), theIndex.row() - getRowsNumber());
-          if (aObject)
-            return aObject->data()->name().c_str();
-        }
-      }
-      break;
-    case Qt::DecorationRole:
-      // return an Icon
-      switch (theIndex.internalId()) {
-        //case MyRoot:
-        //  return QIcon(":pictures/part_ico.png");
-        case ParamsFolder:
-          return QIcon(":pictures/params_folder.png");
-        case ConstructFolder:
-        case BodiesFolder:
-          return QIcon(":pictures/constr_folder.png");
-        case GroupsFolder:
-          return QIcon(":pictures/constr_folder.png");
-        case ConstructObject:
-        case GroupObject:
-        case BodiesObject: {
-          std::string aGroup;
-          if (theIndex.internalId() == ConstructObject)
-            aGroup = ModelAPI_ResultConstruction::group();
-          else if (theIndex.internalId() == BodiesObject)
-            aGroup = ModelAPI_ResultBody::group();
-          else if (theIndex.internalId() == GroupObject)
-            aGroup = ModelAPI_ResultGroup::group();
-          if (aGroup.length() > 0) {
-            ObjectPtr anObject = aPartDoc->object(aGroup, theIndex.row());
-            if (anObject && anObject->data() && 
-                anObject->data()->execState() == ModelAPI_StateMustBeUpdated) {
-              return QIcon(":pictures/constr_object_modified.png");
-            }
-          }
-          return QIcon(":pictures/constr_object.png");
-        }
-        case HistoryObject: {
-          ObjectPtr aObject = aPartDoc->object(ModelAPI_Feature::group(), theIndex.row() - getRowsNumber());
-          FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
-          if (aFeature)
-            return PartSet_DocumentDataModel::featureIcon(aFeature);
-        }
-      }
-      break;
-    case Qt::ToolTipRole:
-      // return Tooltip
-      break;
-    case Qt::ForegroundRole:
-      if (theIndex.internalId() == HistoryObject) {
-        if (theIndex.row() > lastHistoryRow())
-          return QBrush(Qt::lightGray);
-      }
-      return QBrush(myItemsColor);
-  }
-  return QVariant();
-}
-
-QVariant PartSet_PartDataModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
-  return QVariant();
-}
-
-int PartSet_PartDataModel::rowCount(const QModelIndex& parent) const
-{
-  if (!parent.isValid()) {
-    DocumentPtr aDoc = partDocument();
-    if (aDoc.get()) {
-      return getRowsNumber() + aDoc->size(ModelAPI_Feature::group());
-    } else 
-      return 0;
-  }
-  switch (parent.internalId()) {
-    case ParamsFolder:
-      return partDocument()->size(ModelAPI_ResultParameter::group());
-    case ConstructFolder:
-      return partDocument()->size(ModelAPI_ResultConstruction::group());
-    case BodiesFolder:
-      return partDocument()->size(ModelAPI_ResultBody::group());
-    case GroupsFolder:
-      return partDocument()->size(ModelAPI_ResultGroup::group());
-    case HistoryObject:
-      {
-        ObjectPtr aObj = object(parent);
-        CompositeFeaturePtr aCompFeature = 
-          std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aObj);
-        if (aCompFeature.get()) {
-          return aCompFeature->numberOfSubs(true);
-        }
-      }
-  }
-  return 0;
-}
-
-int PartSet_PartDataModel::columnCount(const QModelIndex &parent) const
-{
-  return 2;
-}
-
-QModelIndex PartSet_PartDataModel::index(int theRow, int theColumn, const QModelIndex &theParent) const
-{
-  if (!theParent.isValid()) {
-    switch (theRow) {
-      case 0:
-        return createIndex(theRow, theColumn, (qint32) ParamsFolder);
-      case 1:
-        return createIndex(theRow, theColumn, (qint32) ConstructFolder);
-      case 2:
-        return createIndex(theRow, theColumn, (qint32) BodiesFolder);
-      case 3:
-        {
-        int aSize = partDocument()->size(ModelAPI_ResultGroup::group());
-        if (aSize > 0)
-          return createIndex(theRow, theColumn, (qint32) GroupsFolder);
-        else
-          return createIndex(theRow, theColumn, (qint32) HistoryObject);
-        }
-      default:
-        return createIndex(theRow, theColumn, (qint32) HistoryObject);
-    }
-  } else {
-    int aId = (int) theParent.internalId();
-    switch (aId) {
-      case ParamsFolder:
-        return createIndex(theRow, theColumn, (qint32) ParamObject);
-      case ConstructFolder:
-        return createIndex(theRow, theColumn, (qint32) ConstructObject);
-      case BodiesFolder:
-        return createIndex(theRow, theColumn, (qint32) BodiesObject);
-      case GroupsFolder:
-        return createIndex(theRow, theColumn, (qint32) GroupObject);
-      case HistoryObject:
-        {
-          return createIndex(theRow, theColumn, (qint32) theParent.row());
-        }
-    }
-  }
-  return QModelIndex();
-}
-
-QModelIndex PartSet_PartDataModel::parent(const QModelIndex& theIndex) const
-{
-  if (theIndex.internalId() >= 0) {
-    int aPRow = theIndex.internalId();
-    return createIndex(aPRow, 0, (qint32) HistoryObject);
-  }
-  switch (theIndex.internalId()) {
-    case ParamsFolder:
-    case ConstructFolder:
-    case BodiesFolder:
-    case GroupsFolder:
-    case HistoryObject:
-      return QModelIndex();
-
-    case ParamObject:
-      return createIndex(0, 0, (qint32) ParamsFolder);
-    case ConstructObject:
-      return createIndex(1, 0, (qint32) ConstructFolder);
-    case BodiesObject:
-      return createIndex(2, 0, (qint32) BodiesFolder);
-    case GroupObject:
-      return createIndex(3, 0, (qint32) GroupsFolder);
-  }
-  return QModelIndex();
-}
-
-bool PartSet_PartDataModel::hasChildren(const QModelIndex& theParent) const
-{
-  return rowCount(theParent) > 0;
-}
-
-DocumentPtr PartSet_PartDataModel::partDocument() const
-{
-  ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(myPart->firstResult()); 
-  if (aPart.get()) // this may be null is Part feature is disabled
-    return aPart->partDoc();
-  return DocumentPtr();
-}
-
-ObjectPtr PartSet_PartDataModel::object(const QModelIndex& theIndex) const
-{
-  if (theIndex.internalId() >= 0) {
-    int aPRow = theIndex.internalId();
-    ObjectPtr aObj = 
-      partDocument()->object(ModelAPI_Feature::group(), aPRow - getRowsNumber());
-    CompositeFeaturePtr aCompFeature = 
-      std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aObj);
-    if (aCompFeature.get()) {
-      return aCompFeature->subFeature(theIndex.row(), true);
-    }
-    return ObjectPtr();
-  }
-  switch (theIndex.internalId()) {
-    case ParamsFolder:
-    case ConstructFolder:
-    case BodiesFolder:
-    case GroupsFolder:
-      return ObjectPtr();
-
-    case ParamObject:
-      return partDocument()->object(ModelAPI_ResultParameter::group(), theIndex.row());
-    case ConstructObject:
-      return partDocument()->object(ModelAPI_ResultConstruction::group(), theIndex.row());
-    case BodiesObject:
-      return partDocument()->object(ModelAPI_ResultBody::group(), theIndex.row());
-    case GroupObject:
-      return partDocument()->object(ModelAPI_ResultGroup::group(), theIndex.row());
-    case HistoryObject:
-      return partDocument()->object(ModelAPI_Feature::group(), theIndex.row() - getRowsNumber());
-  }
-  return ObjectPtr();
-}
-
-bool PartSet_PartDataModel::hasDocument(const DocumentPtr& theDoc) const
-{
-  return (partDocument() == theDoc);
-}
-
-QModelIndex PartSet_PartDataModel::findParent(const ObjectPtr& theObject) const
-{
-  return findGroup(theObject->groupName().c_str());
-}
-
-QModelIndex PartSet_PartDataModel::findGroup(const std::string& theGroup) const
-{
-  if (theGroup == ModelAPI_ResultParameter::group())
-    return createIndex(0, 0, (qint32) ParamsFolder);
-  if (theGroup == ModelAPI_ResultConstruction::group())
-    return createIndex(1, 0, (qint32) ConstructFolder);
-  if (theGroup == ModelAPI_ResultBody::group())
-    return createIndex(2, 0, (qint32) BodiesFolder);
-  if (theGroup == ModelAPI_ResultGroup::group())
-    return createIndex(3, 0, (qint32) GroupsFolder);
-  return QModelIndex();
-}
-
-QModelIndex PartSet_PartDataModel::objectIndex(const ObjectPtr& theObject) const
-{
-  QModelIndex aIndex;
-  if (theObject) {
-    if (part() == theObject)
-      return aIndex;
-
-    std::string aGroup = theObject->groupName();
-    DocumentPtr aDoc = theObject->document();
-    int aNb = aDoc->size(aGroup);
-    int aRow = -1;
-    for (int i = 0; i < aNb; i++) {
-      if (aDoc->object(aGroup, i) == theObject) {
-        aRow = i;
-        break;
-      }
-    }
-    if (aRow == -1)
-      return aIndex;
-    if (aGroup == ModelAPI_ResultParameter::group())
-      return createIndex(aRow, 0, (qint32) ParamObject);
-    else if (aGroup == ModelAPI_ResultConstruction::group())
-      return createIndex(aRow, 0, (qint32) ConstructObject);
-    else if (aGroup == ModelAPI_ResultBody::group())
-      return createIndex(aRow, 0, (qint32) BodiesObject);
-    else if (aGroup == ModelAPI_ResultGroup::group())
-      return createIndex(aRow, 0, (qint32) GroupObject);
-    else
-      return createIndex(aRow + getRowsNumber(), 0, (qint32) HistoryObject);
-  }
-  return aIndex;
-}
-
-
-int PartSet_PartDataModel::getRowsNumber() const
-{
-  int aSize = partDocument()->size(ModelAPI_ResultGroup::group());
-  if (aSize == 0) // If there are no groups then do not show group folder
-    return 3;
-  return 4;
-}
-
-int PartSet_PartDataModel::lastHistoryRow() const
-{
-  DocumentPtr aDoc = partDocument();
-  FeaturePtr aFeature = aDoc->currentFeature(true);
-  if (aFeature.get())
-    return getRowsNumber() + aDoc->index(aFeature);
-  else
-    return getRowsNumber() - 1;
-}
-
-void PartSet_PartDataModel::setLastHistoryItem(const QModelIndex& theIndex)
-{
-  SessionPtr aMgr = ModelAPI_Session::get();
-  DocumentPtr aDoc = partDocument();
-  std::string aOpName = tr("History change").toStdString();
-  if (theIndex.internalId() == HistoryObject) {
-    ObjectPtr aObject = object(theIndex);
-    aMgr->startOperation(aOpName);
-    aDoc->setCurrentFeature(std::dynamic_pointer_cast<ModelAPI_Feature>(aObject), true);
-    aMgr->finishOperation();
-  } else {
-    aMgr->startOperation(aOpName);
-    aDoc->setCurrentFeature(FeaturePtr(), true);
-    aMgr->finishOperation();
-  }
-}
-
-QModelIndex PartSet_PartDataModel::lastHistoryItem() const
-{
-  return index(lastHistoryRow(), 1);
-}
-
-Qt::ItemFlags PartSet_PartDataModel::flags(const QModelIndex& theIndex) const
-{
-  // Disable sub-features at column 1
-  if ((theIndex.column() == 1)  && (theIndex.internalId() >= 0))
-    return 0;
-
-  Qt::ItemFlags aFlags = Qt::ItemIsSelectable;
-  if (object(theIndex)) {
-    aFlags |= Qt::ItemIsEditable;
-  }
-
-  if (theIndex.internalId() == HistoryObject) {
-    if (theIndex.row() <= lastHistoryRow() || (theIndex.column() == 1))
-      aFlags |= Qt::ItemIsEnabled;
-  } else
-    aFlags |= Qt::ItemIsEnabled;
-  return aFlags;
-}
diff --git a/src/PartSet/PartSet_PartDataModel.h b/src/PartSet/PartSet_PartDataModel.h
deleted file mode 100644 (file)
index 1012f2d..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-#ifndef PartSet_PartDataModel_H
-#define PartSet_PartDataModel_H
-
-#include "PartSet.h"
-#include "PartSet_DataTreeModel.h"
-
-
-/**\class PartSet_PartDataModel
- * \ingroup GUI
- * \brief This is a data model for Object Browser (QTreeView).
- * It represents data tree only of a one part
- */
-class PartSet_PartDataModel : public PartSet_PartModel
-{
-Q_OBJECT
- public:
-   /// Constructor
-   /// \param theParent a parent object
-  PartSet_PartDataModel(QObject* theParent);
-  virtual ~PartSet_PartDataModel();
-
-  // Reimpl from QAbstractItemModel
-
-  /// Returns the data stored under the given role for the item referred to by the index.
-  /// \param theIndex a model index
-  /// \param theRole a data role (see Qt::ItemDataRole)
-  virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
-
-  /// Returns the data for the given role and section in the header with the specified orientation.
-  /// \param theSection a section
-  /// \param theOrient an orientation
-  /// \param theRole a data role (see Qt::ItemDataRole)
-  virtual QVariant headerData(int theSection, Qt::Orientation theOrient,
-                              int theRole = Qt::DisplayRole) const;
-
-  /// Returns the number of rows under the given parent. When the parent is valid it means that 
-  /// rowCount is returning the number of children of parent.
-  /// \param theParent a parent model index
-  virtual int rowCount(const QModelIndex &theParent = QModelIndex()) const;
-
-  /// Returns the number of columns for the children of the given parent.
-  /// It has a one column
-  /// \param theParent a parent model index
-  virtual int columnCount(const QModelIndex &theParent = QModelIndex()) const;
-
-  /// Returns the item flags for the given index.
-  /// \param theIndex a model index
-  virtual Qt::ItemFlags flags(const QModelIndex& theIndex) const;
-
-  /// Returns the index of the item in the model specified by the given row, column and parent index.
-  /// \param theRow a row
-  /// \param theColumn a column
-  /// \param theParent a parent model index
-  virtual QModelIndex index(int theRow, int theColumn, const QModelIndex& theParent =
-                                QModelIndex()) const;
-
-  /// Returns the parent of the model item with the given index. 
-  /// If the item has no parent, an invalid QModelIndex is returned.
-  /// \param theIndex a model index
-  virtual QModelIndex parent(const QModelIndex& theIndex) const;
-
-  /// Returns true if parent has any children; otherwise returns false.
-  /// \param theParent a parent model index
-  virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const;
-
-  //! Returns object by the given Model index.
-  //! Returns 0 if the given index is not index of a object
-  virtual ObjectPtr object(const QModelIndex& theIndex) const;
-
-  //! Returns QModelIndex which corresponds to the given object
-  //! If the object is not found then index is not valid
-  virtual QModelIndex objectIndex(const ObjectPtr& theObject) const;
-
-  //! Returns true if the given document is a sub-document of this tree
-  virtual bool hasDocument(const DocumentPtr& theDoc) const;
-
-  //! Returns parent index of the given object
-  virtual QModelIndex findParent(const ObjectPtr& theObject) const;
-
-  //! Returns index corresponded to the group
-  virtual QModelIndex findGroup(const std::string& theGroup) const;
-
-  //! Set an Index which will be considered as a last history index
-  //! \param theIndex a last index for history
-  void setLastHistoryItem(const QModelIndex& theIndex);
-
-  //! Returns last history item
-  QModelIndex lastHistoryItem() const;
-
- private:
-
-  //! Returns document of the current part
-  DocumentPtr partDocument() const;
-
-  //! Returns defult number of rows
-  int getRowsNumber() const;
-
-  int lastHistoryRow() const;
-
-  //! Types of QModelIndexes
-  //! All types have negative Id's. Positive Id means sub-feature and contains row of its parent
-  enum DataIds
-  {
-    //MyRoot,
-    ParamsFolder = -100,
-    ParamObject,
-    ConstructFolder,
-    ConstructObject,
-    BodiesFolder,
-    BodiesObject,
-    GroupsFolder,
-    GroupObject,
-    HistoryObject
-  };
-};
-
-#endif
index 8344edf2b63eedabe74405c703695c1bf8d44bdf..94540d988989d647f1b27dae4973cb400cad7ebf 100644 (file)
@@ -164,7 +164,7 @@ public:
 
   /// Saves the current selection in the viewer into an internal container
   /// It obtains the selected attributes. The highlighted objects can be processes as the selected ones
-  /// \param theHighlightedUse a boolean flag
+  /// \param theHighlightedOnly a boolean flag
   void storeSelection(const bool theHighlightedOnly = false);
 
   /// Restores previously saved selection state
index ad5fbcbcfc0dde05bf0d3c8ba25088ab373ce6e3..f204d3df46997e96e7f81feafa73e2cd4870f90b 100755 (executable)
@@ -71,22 +71,6 @@ class PARTSET_EXPORT PartSet_Tools
   /// Returns pointer to the root document.
   static std::shared_ptr<ModelAPI_Document> document();
 
-  /// Find an attribute which corresponds to a given pont coordinates
-  /// \param theSketch the sketch feature
-  /// \param theX X coordinate
-  /// \param theY Y coordinate
-  /// \param theTolerance tolerance
-  /// \param theIgnore list of features which has to be ignored
-  //static std::shared_ptr<GeomDataAPI_Point2D> findAttributePoint(CompositeFeaturePtr theSketch, 
-  //  double theX, double theY, double theTolerance, const QList<FeaturePtr>& theIgnore = QList<FeaturePtr>());
-
-  /// Returns a point attribute of the feature by the coordinates if it is
-  /// \param theFeature the feature
-  /// \param theX the horizontal coordinate
-  /// \param theY the vertical coordinate
-  //static std::shared_ptr<GeomDataAPI_Point2D> getFeaturePoint(FeaturePtr theFeature,
-  //                                                              double theX, double theY);
-
   /// \brief Save the double to the feature. If the attribute is double, it is filled.
   /// \param theFeature the feature
   /// \param theX the horizontal coordinate
@@ -201,12 +185,14 @@ class PARTSET_EXPORT PartSet_Tools
   /**
   * Finds an attribute value in attribute reference attribute value
   * \param theAttribute - an attribure reference filled with an attribute
+  * \param theWorkshop a reference to workshop
   * \return a geometry shape
   */
   static GeomShapePtr findShapeBy2DPoint(const AttributePtr& theAttribute,
                                          ModuleBase_IWorkshop* theWorkshop);
 
-  /* Returns point of coincidence feature
+  /**
+  * Returns point of coincidence feature
   * \param theFeature the coincidence feature
   * \param theAttribute the attribute name
   */
diff --git a/src/PartSet/PartSet_TopDataModel.cpp b/src/PartSet/PartSet_TopDataModel.cpp
deleted file mode 100644 (file)
index 67f8cb8..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-
-#include "PartSet_TopDataModel.h"
-#include "PartSet_Module.h"
-#include "PartSet_DocumentDataModel.h"
-
-#include <ModelAPI_Session.h>
-#include <ModelAPI_Document.h>
-#include <ModelAPI_Feature.h>
-#include <ModelAPI_Result.h>
-#include <ModelAPI_Data.h>
-#include <ModelAPI_AttributeDocRef.h>
-#include <ModelAPI_Object.h>
-#include <ModelAPI_ResultPart.h>
-#include <ModelAPI_ResultConstruction.h>
-#include <ModelAPI_ResultParameter.h>
-#include <ModelAPI_ResultBody.h>
-#include <ModelAPI_ResultGroup.h>
-#include <ModelAPI_AttributeDouble.h>
-#include <ModelAPI_Events.h>
-
-#include <Events_Loop.h>
-
-#include <QIcon>
-#include <QBrush>
-
-
-PartSet_TopDataModel::PartSet_TopDataModel(QObject* theParent)
-    : PartSet_FeaturesModel(theParent)
-{
-}
-
-PartSet_TopDataModel::~PartSet_TopDataModel()
-{
-}
-
-QVariant PartSet_TopDataModel::data(const QModelIndex& theIndex, int theRole) const
-{
-  if (theIndex.column() == 1)
-    return QVariant();
-
-  switch (theRole) {
-    case Qt::DisplayRole:
-      // return a name
-      switch (theIndex.internalId()) {
-        case ParamsFolder:
-          return tr("Parameters") + QString(" (%1)").arg(rowCount(theIndex));
-        case ParamObject: {
-          DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-          ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultParameter::group(), theIndex.row());
-          if (aObject) {
-            ResultParameterPtr aParam = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aObject);
-            AttributeDoublePtr aValueAttribute = aParam->data()->real(ModelAPI_ResultParameter::VALUE());
-            QString aVal = QString::number(aValueAttribute->value());
-            QString aTitle = QString(aObject->data()->name().c_str());
-            return aTitle + " = " + aVal;
-          }
-        }
-          break;
-        case ConstructFolder:
-          return tr("Constructions") + QString(" (%1)").arg(rowCount(theIndex));
-        case ConstructObject: {
-          DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-          ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultConstruction::group(),
-                                               theIndex.row());
-          if (aObject)
-            return aObject->data()->name().c_str();
-        }
-          break;
-        //case GroupsFolder:
-        //  return tr("Groups") + QString(" (%1)").arg(rowCount(theIndex));
-        //case GroupObject: {
-        //  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-        //  ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultGroup::group(),
-        //                                       theIndex.row());
-        //  if (aObject)
-        //    return aObject->data()->name().c_str();
-        //}
-        //  break;
-      }
-      break;
-
-    case Qt::DecorationRole:
-      {
-      // return an Icon
-      switch (theIndex.internalId()) {
-        case ParamsFolder:
-          return QIcon(":pictures/params_folder.png");
-        case ConstructFolder:
-          return QIcon(":pictures/constr_folder.png");
-        case ConstructObject:
-          return QIcon(":pictures/constr_object.png");
-        //case GroupsFolder:
-        //  return QIcon(":pictures/constr_folder.png");
-        }
-      }
-      break;
-
-    case Qt::ToolTipRole:
-      // return Tooltip
-      break;
-    case Qt::ForegroundRole:
-      return QBrush(myItemsColor);
-      break;
-  }
-  return QVariant();
-}
-
-QVariant PartSet_TopDataModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
-  return QVariant();
-}
-
-int PartSet_TopDataModel::rowCount(const QModelIndex& theParent) const
-{
-  if (!theParent.isValid())
-    return 2;  // In case of groups using it has to be +1
-
-  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-  if (theParent.internalId() == ParamsFolder)
-    return aRootDoc->size(ModelAPI_ResultParameter::group());
-
-  if (theParent.internalId() == ConstructFolder)
-    return aRootDoc->size(ModelAPI_ResultConstruction::group());
-
-  //if (theParent.internalId() == GroupsFolder)
-  //  return aRootDoc->size(ModelAPI_ResultGroup::group());
-
-  return 0;
-}
-
-int PartSet_TopDataModel::columnCount(const QModelIndex &parent) const
-{
-  return 1;
-}
-
-QModelIndex PartSet_TopDataModel::index(int theRow, int theColumn, const QModelIndex& theParent) const
-{
-  if (!theParent.isValid()) {
-    switch (theRow) {
-      case 0:
-        return createIndex(theRow, theColumn, (qint32) ParamsFolder);
-      case 1:
-        return createIndex(theRow, theColumn, (qint32) ConstructFolder);
-      //case 2:
-      //  return createIndex(theRow, theColumn, (qint32) GroupsFolder);
-    }
-  } else {
-    if (theParent.internalId() == ParamsFolder)
-      return createIndex(theRow, theColumn, (qint32) ParamObject);
-
-    if (theParent.internalId() == ConstructFolder)
-      return createIndex(theRow, theColumn, (qint32) ConstructObject);
-
-    //if (theParent.internalId() == GroupsFolder)
-    //  return createIndex(theRow, theColumn, (qint32) GroupObject);
-  }
-  return QModelIndex();
-}
-
-QModelIndex PartSet_TopDataModel::parent(const QModelIndex& theIndex) const
-{
-  int aId = (int) theIndex.internalId();
-  switch (aId) {
-    case ParamsFolder:
-    case ConstructFolder:
-    //case GroupsFolder:
-      return QModelIndex();
-    case ParamObject:
-      return createIndex(0, 0, (qint32) ParamsFolder);
-    case ConstructObject:
-      return createIndex(1, 0, (qint32) ConstructFolder);
-    //case GroupObject:
-    //  return createIndex(2, 0, (qint32) GroupsFolder);
-  }
-  return QModelIndex();
-}
-
-bool PartSet_TopDataModel::hasChildren(const QModelIndex& theParent) const
-{
-  return rowCount(theParent) > 0;
-}
-
-ObjectPtr PartSet_TopDataModel::object(const QModelIndex& theIndex) const
-{
-  switch (theIndex.internalId()) {
-    case ParamsFolder:
-    case ConstructFolder:
-      return ObjectPtr();
-    case ParamObject: {
-      DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-      return aRootDoc->object(ModelAPI_ResultParameter::group(), theIndex.row());
-    }
-    case ConstructObject: {
-      DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-      return aRootDoc->object(ModelAPI_ResultConstruction::group(), theIndex.row());
-    }
-    //case GroupObject: {
-    //  DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-    //  return aRootDoc->object(ModelAPI_ResultGroup::group(), theIndex.row());
-    //}
-  }
-  return ObjectPtr();
-}
-
-QModelIndex PartSet_TopDataModel::findParent(const ObjectPtr& theObject) const
-{
-  return findGroup(theObject->groupName().c_str());
-}
-
-QModelIndex PartSet_TopDataModel::findGroup(const std::string& theGroup) const
-{
-  if (theGroup == ModelAPI_ResultParameter::group())
-    return createIndex(0, 0, (qint32) ParamsFolder);
-  if (theGroup == ModelAPI_ResultConstruction::group())
-    return createIndex(1, 0, (qint32) ConstructFolder);
-  //if (theGroup == ModelAPI_ResultGroup::group())
-  //  return createIndex(2, 0, (qint32) ConstructFolder);
-  return QModelIndex();
-}
-
-QModelIndex PartSet_TopDataModel::objectIndex(const ObjectPtr& theObject) const
-{
-  QModelIndex aIndex;
-  if (theObject) {
-    DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-    std::string aGroup = theObject->groupName();
-    int aNb = aRootDoc->size(aGroup);
-    int aRow = -1;
-    for (int i = 0; i < aNb; i++) {
-      if (aRootDoc->object(aGroup, i) == theObject) {
-        aRow = i;
-        break;
-      }
-    }
-    if (aRow != -1) {
-      if (aGroup == ModelAPI_ResultParameter::group())
-        return createIndex(aRow, 0, (qint32) ParamObject);
-      if (aGroup == ModelAPI_ResultConstruction::group())
-        return createIndex(aRow, 0, (qint32) ConstructObject);
-      //if (aGroup == ModelAPI_ResultGroup::group())
-      //  return createIndex(aRow, 0, (qint32) GroupObject);
-    }
-  }
-  return aIndex;
-}
-
diff --git a/src/PartSet/PartSet_TopDataModel.h b/src/PartSet/PartSet_TopDataModel.h
deleted file mode 100644 (file)
index 8b72db6..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-#ifndef PartSet_TopDataModel_H
-#define PartSet_TopDataModel_H
-
-#include "PartSet.h"
-#include "PartSet_DataTreeModel.h"
-
-/**\class PartSet_TopDataModel
- * \ingroup GUI
- * \brief This is a data model for Object Browser (QTreeView).
- * It represents only upper part of data tree (non-parts tree items)
- */
-class PARTSET_EXPORT PartSet_TopDataModel : public PartSet_FeaturesModel
-{
-Q_OBJECT
- public:
-   /// Constructor
-   /// \param theParent a parent object
-  PartSet_TopDataModel(QObject* theParent);
-  virtual ~PartSet_TopDataModel();
-
-  // Reimpl from QAbstractItemModel
-
-  /// Returns the data stored under the given role for the item referred to by the index.
-  /// \param theIndex a model index
-  /// \param theRole a data role (see Qt::ItemDataRole)
-  virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
-
-  /// Returns the data for the given role and section in the header with the specified orientation.
-  /// \param theSection a section
-  /// \param theOrient an orientation
-  /// \param theRole a data role (see Qt::ItemDataRole)
-  virtual QVariant headerData(int theSection, Qt::Orientation theOrient,
-                              int theRole = Qt::DisplayRole) const;
-
-  /// Returns the number of rows under the given parent. When the parent is valid it means that 
-  /// rowCount is returning the number of children of parent.
-  /// \param theParent a parent model index
-  virtual int rowCount(const QModelIndex &theParent = QModelIndex()) const;
-
-  /// Returns the number of columns for the children of the given parent.
-  /// It has a one column
-  /// \param theParent a parent model index
-  virtual int columnCount(const QModelIndex &theParent = QModelIndex()) const;
-
-
-  /// Returns the index of the item in the model specified by the given row, column and parent index.
-  /// \param theRow a row
-  /// \param theColumn a column
-  /// \param theParent a parent model index
-  virtual QModelIndex index(int theRow, int theColumn, const QModelIndex& theParent =
-                                QModelIndex()) const;
-
-  /// Returns the parent of the model item with the given index. 
-  /// If the item has no parent, an invalid QModelIndex is returned.
-  /// \param theIndex a model index
-  virtual QModelIndex parent(const QModelIndex& theIndex) const;
-
-  /// Returns true if parent has any children; otherwise returns false.
-  /// \param theParent a parent model index
-  virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const;
-
-  //! Returns object by the given Model index.
-  //! Returns 0 if the given index is not index of a object
-  virtual ObjectPtr object(const QModelIndex& theIndex) const;
-
-  //! Returns QModelIndex which corresponds to the given object
-  //! If the object is not found then index is not valid
-  virtual QModelIndex objectIndex(const ObjectPtr& theObject) const;
-
-  //! Returns parent index of the given object
-  virtual QModelIndex findParent(const ObjectPtr& theObject) const;
-
-  //! Returns index corresponded to the group
-  virtual QModelIndex findGroup(const std::string& theGroup) const;
-
- private:
-  //! Types of QModelIndexes
-  enum DataIds
-  {
-    ParamsFolder,
-    ParamObject,
-    ConstructFolder,
-    ConstructObject
-    //GroupsFolder,
-    //GroupObject
-  };
-
-};
-
-#endif
\ No newline at end of file
index 0e02a0e9fcbb1bfb861b010cf2ecaadde8e4c1f3..23706f81ccc27b286f3f44df3409f261e483b027 100644 (file)
@@ -126,6 +126,7 @@ class PartSet_DifferentObjectsValidator : public ModelAPI_AttributeValidator
   //! Returns true if the attribute is good for the feature attribute
   //! \param theAttribute an attribute
   //! \param theArguments a list of arguments (names of attributes to check)
+  //! \param theError an output error string
   virtual bool isValid(const AttributePtr& theAttribute,
                        const std::list<std::string>& theArguments,
                        std::string& theError) const;
@@ -149,6 +150,7 @@ class PartSet_SketchEntityValidator : public ModelAPI_AttributeValidator
   //! Returns true if the attribute is good for the feature attribute
   //! \param theAttribute an attribute
   //! \param theArguments a list of arguments (names of attributes to check)
+  //! \param theError an output error string
   virtual bool isValid(const AttributePtr& theAttribute,
                        const std::list<std::string>& theArguments,
                        std::string& theError) const;
@@ -165,6 +167,7 @@ class PartSet_CoincidentAttr : public ModelAPI_AttributeValidator
   //! returns true if attribute is valid
   //! \param theAttribute the checked attribute
   //! \param theArguments arguments of the attribute
+  //! \param theError an output error string
   virtual bool isValid(const AttributePtr& theAttribute,
                        const std::list<std::string>& theArguments,
                        std::string& theError) const;
index bf745d6433d11837a8906ec068b10446c8e0c5b0..5207201cb4b8710870b6ea0b46242a800c66c9aa 100644 (file)
@@ -48,7 +48,7 @@ Q_OBJECT
 
 protected:
   /// Checks the widget validity. By default, it returns true.
-  /// \param theValue a selected presentation in the view
+  /// \param thePrs a selected presentation in the view
   /// \return a boolean value
   virtual bool isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs);
 
@@ -67,7 +67,9 @@ protected:
                                 GeomShapePtr& theShape);
 
 protected:
+  /// Manager of external objects
   PartSet_ExternalObjectsMgr* myExternalObjectMgr;
+
   /// Pointer to a sketch 
   CompositeFeaturePtr mySketch;
 };
index a07107f669ab30a56c698ddcd5333d1ea7fec5bc..c85ad2082c2c81906cda79fbe3cdc421c5173b5b 100644 (file)
@@ -56,6 +56,7 @@ Q_OBJECT
   /// Set the given wrapped value to the current widget
   /// This value should be processed in the widget according to the needs
   /// \param theValues the wrapped widget values
+  /// \param theToValidate a validation flag
   virtual bool setSelection(QList<ModuleBase_ViewerPrs>& theValues,
                             const bool theToValidate);
 
@@ -114,6 +115,7 @@ protected:
 
   /// Returns true if the feature contains Point2D attribute with the same coordinates
   /// The attribute of the widget is not processed.
+  /// \param theFeature a feature
   /// \param theX the X coordinate
   /// \param theY the Y coordinate
   /// \return boolean result
index 889ee2ed0fb210b3b206ee7f4eda3cc7e9b4f98a..f300f2fb8262d5df0dcf11735011b762ed576fa0 100644 (file)
@@ -90,10 +90,16 @@ private slots:
   void onValuesChanged();
 
 protected:
+  /// A reference to workshop
   ModuleBase_IWorkshop* myWorkshop;
-  PartSet_LockApplyMgr* myLockApplyMgr; ///< a manager to lock/unlock Apply button in PP
+  
+  /// A manager to lock/unlock Apply button in PP
+  PartSet_LockApplyMgr* myLockApplyMgr;
 
+  /// A name of the first point
   std::string myFirstPntName;
+
+  /// Reference to sketch
   CompositeFeaturePtr mySketch;
 };
 
index a2ba2d2bd5310a1033f25f3cb53f2ab9a1966387..4d2da507bd74dd91395d3a166c056b7900048693 100644 (file)
@@ -44,7 +44,7 @@ Q_OBJECT
 
 protected:
   /// Checks the widget validity. By default, it returns true.
-  /// \param theValue a selected presentation in the view
+  /// \param thePrs a selected presentation in the view
   /// \return a boolean value
   virtual bool isValidSelectionCustom(const ModuleBase_ViewerPrs& thePrs);
 
@@ -83,7 +83,9 @@ protected:
   void setPointAttribute(ObjectPtr theSelectedObject, GeomShapePtr theShape);
 
 protected:
+  /// A reference to external objects manager
   PartSet_ExternalObjectsMgr* myExternalObjectMgr;
+
   /// Pointer to a sketch 
   CompositeFeaturePtr mySketch;
 };
index 5f1d8d9961f7b2fecded54eff63619ae090e8f30..f92285d37c4ffd5354b088c56f92cf0f3fe1598b 100644 (file)
@@ -30,6 +30,7 @@ Q_OBJECT
  public:
   /// Constructor
   /// \param theParent the parent object
+  /// \param theModule a reference to a module object
   /// \param theData the widget configuation. The attribute of the model widget is obtained from
   /// \param theParentId is Id of a parent of the current attribute
   PartSet_WidgetSketchCreator(QWidget* theParent, PartSet_Module* theModule, 
index 2bc8d85d682d04865b9e815d9adbdced64400b2f..25807c81b0dc1010ece814373eaaf325a66ec03a 100644 (file)
@@ -40,8 +40,10 @@ Q_OBJECT
  public:
   /// Constructor
   /// \param theParent the parent object
+  /// \param theWorkshop a reference to workshop
   /// \param theData the widget configuation. The attribute of the model widget is obtained from
   /// \param theParentId is Id of a parent of the current attribute
+  /// \param toShowConstraints a current show constraints state
   PartSet_WidgetSketchLabel(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
                             const Config_WidgetAPI* theData,
                             const std::string& theParentId, bool toShowConstraints);
@@ -53,6 +55,7 @@ Q_OBJECT
   /// The method is called by the current operation to process the operation preselection.
   /// It is redefined to do nothing if the plane of the sketch has been already set.
   /// \param theValues the wrapped selection values
+  /// \param theToValidate a validation flag
   virtual bool setSelection(QList<ModuleBase_ViewerPrs>& theValues,
                             const bool theToValidate);
 
@@ -71,12 +74,15 @@ Q_OBJECT
   virtual void setHighlighted(bool) { /*do nothing*/ };
   virtual void enableFocusProcessing();
 
+  /// Set show constraints state
+  /// \param theOn a flag show constraints or not
   void showConstraints(bool theOn);
 
 signals:
   /// Signal on plane selection
   void planeSelected(const std::shared_ptr<GeomAPI_Pln>& thePln);
 
+  /// A show constraint toggled signal
   void showConstraintToggled(bool);
 
 protected:
@@ -92,7 +98,7 @@ protected:
   virtual void restoreAttributeValue(const bool theValid);
 
   /// Fills the attribute with the value of the selected owner
-  /// \param theOwner a selected owner
+  /// \param thePrs a selected owner
   virtual bool setSelectionCustom(const ModuleBase_ViewerPrs& thePrs);
 
   /// Saves the internal parameters to the given feature
index db0e71e8541c533142b3a9c49c337b4d66d95e64..40de3f5335dffc244cdebb58e907e80421532eb7 100644 (file)
@@ -49,7 +49,10 @@ Q_OBJECT
   /// Connect to viewer from workshop. Has to called at creation of viewer.
   void connectViewer();
 
+  /// Add menu items for Object browser pop-up
   void addObjBrowserMenu(QMenu*) const;
+
+  /// Add menu items for Viewer pop-up
   void addViewerMenu(QMenu*) const;
 
   /// Returns a list of object group names of the action
index a1e636a5c15368e2a37ad91280baef85ed43134c..36014cfec63c1c628c339d01fd62e95e8b3deae7 100644 (file)
@@ -25,6 +25,9 @@ public:
   virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs,
                                      std::shared_ptr<GeomAPI_ICustomPrs> theCustomPrs);
 
+  /// Returns color of a result object
+  /// \param theResult a result object
+  /// \param theColor a color in form of RGB vector
   static void getResultColor(ResultPtr theResult, std::vector<int>& theColor);
 };
 
index 2485d367c8f15e75dc8d37b20d01bfa341370208..bac4aedaedd8c59127e137e8549799a1ac0228fc 100644 (file)
@@ -58,7 +58,7 @@ ModelAPI_Document* getSubDocument(void* theObj)
 
 
 // Constructor *************************************************
-XGUI_DataModel::XGUI_DataModel(QObject* theParent) : ModuleBase_IDocumentDataModel(theParent)
+XGUI_DataModel::XGUI_DataModel(QObject* theParent) : QAbstractItemModel(theParent)
 {
   myXMLReader.readAll();
 
index 9c5966277ce2d790be9369b5ecd15b279da674cd..d08ccc42a8f301529b7d0e5f6352c3e1f6ac6b36 100644 (file)
@@ -13,9 +13,9 @@
 #include <ModelAPI_Object.h>
 #include <ModelAPI_Document.h>
 #include <Config_DataModelReader.h>
-#include <ModuleBase_IDocumentDataModel.h>
 #include <Events_Listener.h>
 
+#include <QAbstractItemModel>
 
 /**\class XGUI_DataModel
  * \ingroup GUI
  * - An index which contains internal pointer as ModelAPI_Object its the object
  * - An index which contains internal pointer as ModelAPI_Document is a folder which belongs to this document
  */
-class XGUI_EXPORT XGUI_DataModel : public ModuleBase_IDocumentDataModel, public Events_Listener
+class XGUI_EXPORT XGUI_DataModel : public QAbstractItemModel, public Events_Listener
 {
 Q_OBJECT
 public:
+  /// Constructor
+  /// \param theParent a parent object
   XGUI_DataModel(QObject* theParent);
 
   /// Event Listener method
index c4ac99b1cde9cd6a71df4aa90a9fd55eae9379f7..b189189f6b3428d610e4d625717cfe9b3eaf0eb0 100644 (file)
@@ -118,7 +118,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject
   /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly
   void closeLocalContexts(const bool theUpdateViewer = true);
 
-  // Remove default selection filters of the module from the current viewer
+  /// Remove default selection filters of the module from the current viewer
   void deactivateSelectionFilters();
 
   /// \brief Add selection filter
@@ -145,12 +145,15 @@ class XGUI_EXPORT XGUI_Displayer: public QObject
   void updateViewer() const;
 
   /// Activate interactive context
-  /// \param theIO
-  /// \param theMode
+  /// \param theIO an interactive object
+  /// \param theMode activation mode
+  /// \param theUpdateViewer update viewer flag
   void activateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode,
                    const bool theUpdateViewer) const;
 
   /// Activate interactive context. It is necessary to call ClearOutdatedSelection after deactivation
+  /// \param theIO an interactive object
+  /// \param theMode a mode to deactivate. When theMode=-1 then all modes will be deactivated
   void deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode = -1) const;
 
   /// Searches the interactive object by feature
@@ -186,6 +189,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject
   /// Activates in local context displayed outside of the context.
   /// \param theModes - modes on which it has to be activated (can be empty)
   /// \param theObjList - list of objects which has to be activated.
+  /// \param theUpdateViewer an update viewer flag
   void activateObjects(const QIntList& theModes, const QObjectPtrList& theObjList,
                        const bool theUpdateViewer = true);
 
index c339d6cf0bd4c652d9bb82a8f97c4282787ac180..89deaeef928cb6430759c511e1030e4704cd1a8e 100644 (file)
@@ -18,14 +18,24 @@ class QAction;
 class QDialog;
 class QLabel;
 
+/**
+ * \class XGUI_ErrorMgr
+ * \ingroup GUI
+ * \brief Class of Errors manager object
+ */
 class XGUI_EXPORT XGUI_ErrorMgr : public ModuleBase_IErrorMgr
 {
   Q_OBJECT
 public:
+  /// Constructor
+  /// \param theParent a parent object
+  /// \param theWorkshop a workshop object
   XGUI_ErrorMgr(QObject* theParent, ModuleBase_IWorkshop* theWorkshop);
   /// Virtual destructor
   virtual ~XGUI_ErrorMgr();
 
+  /// Update actions for the given feature
+  /// \param theFeature a feature
   void updateActions(const FeaturePtr& theFeature);
 
   /// Update enable state of AcceptAll action if the feature uses it
index 27aaa47c8f8d8fcd7477855899f850a4571e0cd7..598c7a22e956a9605ad9855a9c772a90aee39386 100644 (file)
@@ -63,12 +63,12 @@ Q_OBJECT
   virtual ModuleBase_Operation* findStartedOperation(const QString& theId);
 
   //! Returns true if the operation with id theId can be stopped. The operation manager is called.
-  //! \param theId a stopped operation
+  //! \param theOperation a stopped operation
   //! \return boolean result
   virtual bool canStopOperation(ModuleBase_Operation* theOperation);
 
   //! Aborts the operation. The operation manager is called.
-  //! \param theId an aborted operation
+  //! \param theOperation an aborted operation
   void abortOperation(ModuleBase_Operation* theOperation);
 
   //! Returns AIS object by data object
index c43ca86fa984f2763438d973f0266923fb7f1d79..d89d6171b0a8eaa8f1a3078557b3e94d7975ef81 100644 (file)
@@ -10,7 +10,6 @@
 #include <ModelAPI_Tools.h>
 
 #include <ModuleBase_Tools.h>
-#include <ModuleBase_IDocumentDataModel.h>
 
 #include <QLayout>
 #include <QLabel>
@@ -44,7 +43,7 @@ public:
   {
     QLineEdit* aEditor = dynamic_cast<QLineEdit*>(editor);
     if (aEditor) {
-      ModuleBase_IDocumentDataModel* aModel = myTreedView->dataModel();
+      XGUI_DataModel* aModel = myTreedView->dataModel();
       ObjectPtr aObj = aModel->object(index);
       if (aObj.get() != NULL) {
         aEditor->setText(aObj->data()->name().c_str());
@@ -69,19 +68,17 @@ XGUI_DataTree::XGUI_DataTree(QWidget* theParent)
 
   setItemDelegateForColumn(0, new XGUI_TreeViewItemDelegate(this));
 
-#ifndef ModuleDataModel
   connect(this, SIGNAL(doubleClicked(const QModelIndex&)), 
     SLOT(onDoubleClick(const QModelIndex&)));
-#endif
 }
 
 XGUI_DataTree::~XGUI_DataTree()
 {
 }
 
-ModuleBase_IDocumentDataModel* XGUI_DataTree::dataModel() const
+XGUI_DataModel* XGUI_DataTree::dataModel() const
 {
-  return static_cast<ModuleBase_IDocumentDataModel*>(model());
+  return static_cast<XGUI_DataModel*>(model());
 }
 
 void XGUI_DataTree::contextMenuEvent(QContextMenuEvent* theEvent)
@@ -95,7 +92,7 @@ void XGUI_DataTree::commitData(QWidget* theEditor)
   if (aEditor) {
     QString aName = aEditor->text();
     QModelIndexList aIndexList = selectionModel()->selectedIndexes();
-    ModuleBase_IDocumentDataModel* aModel = dataModel();
+    XGUI_DataModel* aModel = dataModel();
     ObjectPtr aObj = aModel->object(aIndexList.first());
     SessionPtr aMgr = ModelAPI_Session::get();
     aMgr->startOperation("Rename");
@@ -112,8 +109,7 @@ void XGUI_DataTree::commitData(QWidget* theEditor)
 
 void XGUI_DataTree::clear() 
 {
-  ModuleBase_IDocumentDataModel* aModel = dataModel();
-  aModel->clear();
+  dataModel()->clear();
   reset();
 }
 
@@ -134,7 +130,7 @@ void XGUI_DataTree::onDoubleClick(const QModelIndex& theIndex)
   // When operation is opened then we can not change history
   if (aMgr->isOperation())
     return;
-  ModuleBase_IDocumentDataModel* aModel = dataModel();
+  XGUI_DataModel* aModel = dataModel();
   if (aModel->flags(theIndex) == 0)
     return;
   ObjectPtr aObj = aModel->object(theIndex);
@@ -219,13 +215,11 @@ XGUI_ObjectsBrowser::XGUI_ObjectsBrowser(QWidget* theParent)
   aLabelWgt->setFrameShape(myTreeView->frameShape());
   aLabelWgt->setFrameShadow(myTreeView->frameShadow());
 
-#ifndef ModuleDataModel
   myDocModel = new XGUI_DataModel(this);
   myTreeView->setModel(myDocModel);
   QItemSelectionModel* aSelMod = myTreeView->selectionModel();
   connect(aSelMod, SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
           this, SLOT(onSelectionChanged(const QItemSelection&, const QItemSelection&)));
-#endif
 
   connect(myActiveDocLbl, SIGNAL(customContextMenuRequested(const QPoint&)), this,
           SLOT(onLabelContextMenuRequested(const QPoint&)));
@@ -382,18 +376,6 @@ void XGUI_ObjectsBrowser::clearContent()
   myTreeView->clear(); 
 }
 
-#ifdef ModuleDataModel
-void XGUI_ObjectsBrowser::setDataModel(ModuleBase_IDocumentDataModel* theModel)
-{
-  myDocModel = theModel;
-  //myDocModel = new XGUI_DataModel(this);
-  myTreeView->setModel(myDocModel);
-  QItemSelectionModel* aSelMod = myTreeView->selectionModel();
-  connect(aSelMod, SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
-          this, SLOT(onSelectionChanged(const QItemSelection&, const QItemSelection&)));
-}
-#endif
-
 void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& theSelected,
                                        const QItemSelection& theDeselected)
 {
@@ -404,11 +386,7 @@ QObjectPtrList XGUI_ObjectsBrowser::selectedObjects(QModelIndexList* theIndexes)
 {
   QObjectPtrList aList;
   QModelIndexList aIndexes = selectedIndexes();
-#ifdef ModuleDataModel
-  ModuleBase_IDocumentDataModel* aModel = dataModel();
-#else
   XGUI_DataModel* aModel = dataModel();
-#endif
   QModelIndexList::const_iterator aIt;
   for (aIt = aIndexes.constBegin(); aIt != aIndexes.constEnd(); ++aIt) {
     if ((*aIt).column() == 0) {
index d92788abecde6f02730041ba7202c3690b3c1b5b..53e9a5fb5cfb9df7dd99bb78850a275a43131cb7 100644 (file)
@@ -16,8 +16,6 @@ class ModuleBase_IDocumentDataModel;
 class QLineEdit;
 class XGUI_DataModel;
 
-//#define ModuleDataModel
-
 /**
 * \ingroup GUI
 * Implementation of Data Tree object for Object Browser
@@ -33,7 +31,7 @@ Q_OBJECT
   virtual ~XGUI_DataTree();
 
   /// Returns current data model
-  ModuleBase_IDocumentDataModel* dataModel() const;
+  XGUI_DataModel* dataModel() const;
 
 signals:
   //! Emited on context menu request
@@ -47,6 +45,7 @@ public slots:
   /// Commit modified data (used for renaming of objects)
   virtual void commitData(QWidget* theEditor);
 
+  /// A slot which is called on mouse double click
   void onDoubleClick(const QModelIndex&);
 
  protected:
@@ -72,17 +71,10 @@ Q_OBJECT
   virtual ~XGUI_ObjectsBrowser();
 
   //! Returns Model which provides access to data objects
-#ifdef ModuleDataModel
-  ModuleBase_IDocumentDataModel* dataModel() const
-  {
-    return myDocModel;
-  }
-#else
   XGUI_DataModel* dataModel() const
   {
     return myDocModel;
   }
-#endif
 
   //! Returns list of currently selected objects
   //! \param theIndexes - output list of corresponded indexes (can be NULL)
@@ -113,11 +105,6 @@ Q_OBJECT
   /// Resets the object browser into initial state
   void clearContent();
 
-  /// Set Data Model for the Object Browser
-#ifdef ModuleDataModel
-  void setDataModel(ModuleBase_IDocumentDataModel* theModel);
-#endif
-
 public slots:
   //! Called on Edit command request
   void onEditItem();
@@ -152,11 +139,7 @@ signals:
   void closeDocNameEditing(bool toSave);
 
   //! Internal model
-#ifdef ModuleDataModel
-  ModuleBase_IDocumentDataModel* myDocModel;
-#else
   XGUI_DataModel* myDocModel;
-#endif
   QLineEdit* myActiveDocLbl;
   XGUI_DataTree* myTreeView;
 };
index 3cd0f9a379eeaac1ebbe805d8d191858d93f4eae..5ea3af47cfd2b36fc3013142bbb1ad614f02a901 100644 (file)
@@ -35,10 +35,14 @@ Q_OBJECT
  public:
   /// Constructor
   /// \param theParent the parent
+  /// \param theWorkshop a reference to workshop
   XGUI_OperationMgr(QObject* theParent, ModuleBase_IWorkshop* theWorkshop);
+
   /// Destructor
   virtual ~XGUI_OperationMgr();
 
+  /// Set reference to workshop
+  /// \param theWorkshop reference to workshop
   void setWorkshop(ModuleBase_IWorkshop* theWorkshop)
   { myWorkshop = theWorkshop; };
 
@@ -139,14 +143,6 @@ signals:
   /// Emitted when current operation is aborted
   void operationAborted(ModuleBase_Operation* theOperation);
 
-  /// Signal is emitted after the apply enable state changed.
-  //void validationStateChanged(bool);
-
-  /// Signal is emitted after the model is modified. It is emitted for all active operations.
-  /// \param theFeatureKind a feature id
-  /// \param theState validity of the operation with the feature kind
-  //void nestedStateChanged(const std::string& theFeatureKind, const bool theState);
-
   /// Signal is emitted after the current operation is filled with existing preselection.
   void operationActivatedByPreselection();
 
index aba338e6970823b7a7748d8e17bdc5dd0e6fd772..083242fd16c18b7acca6ea240bf13dadcb25f148 100644 (file)
@@ -115,6 +115,7 @@ Q_OBJECT
   virtual void activateWidget(ModuleBase_ModelWidget* theWidget);
 
  protected:
+  /// A header widget
   QWidget* myHeaderWidget;
 
  private:
index 807e1868fd4c0c16b9cd89b4c5b854547a34a5f2..50c622f018e2aee23e24dd3d9df5f219e2904c9d 100644 (file)
@@ -48,13 +48,14 @@ class XGUI_EXPORT XGUI_SalomeConnector
   //! Creates a feature (command) in SALOME desktop
   //! \param theWBName - name of toolbar (workbench)
   //! \param theInfo - information about action (icon, text, etc)
+  //! \param theNestedActions a list of nested actions
   virtual QAction* addFeatureOfNested(const QString& theWBName,
                                     const ActionInfo& theInfo,
                                     const QList<QAction*>& theNestedActions) = 0;
 
   //! Returns true if the feature action is a nested action, in other words,
   //! it is created by addFeatureOfNested().
-  //! \param theId - an action of a feature
+  //! \param theAction - an action of a feature
   //! returns boolean result
   virtual bool isFeatureOfNested(const QAction* theAction) = 0;
 
@@ -78,6 +79,9 @@ class XGUI_EXPORT XGUI_SalomeConnector
   virtual void addDesktopMenuSeparator(const char* theMenuSourceText,
                                        const int theMenuPosition = 10) = 0;
 
+  /// Add an action into tool bar
+  /// \param theAction the Action object
+  /// \param theToolBarTitle the toolbar name
   virtual bool addActionInToolbar( QAction* theAction, const QString& theToolBarTitle ) = 0;
 
   //! Returns desktop window of SALOME
index 178b8b2a4c9bc4034a319a9cb818c1219b67180a..7cf55846e5bbd9762979d2f340cb33dca47191f4 100644 (file)
@@ -54,7 +54,7 @@ QString XGUI_EXPORT file(const QString& path, bool withExt = true);
  */
 QString XGUI_EXPORT addSlash(const QString& path);
 
-/// The model concerning tools
+// The model concerning tools
 
 /*!
  Returns true if the feature is a model object
@@ -73,18 +73,22 @@ std::string XGUI_EXPORT featureInfo(FeaturePtr theFeature);
  all objects in the list are not PartSet document.
  It shows the warning control if the result is false.
  \param theParent a parent for the warning control
- \param theList a list of object
+ \param aList a list of object
  \return a boolean value
  */
 bool XGUI_EXPORT canRemoveOrRename(QWidget* theParent, const QObjectPtrList& aList);
 
 /*! 
- Returns true if theObject can be renamed in theName
+ Check possibility to rename object
+ \param theParent a parent widget
+ \param theObject an object to rename
+ \param theName a name
  */
 bool canRename(QWidget* theParent, const ObjectPtr& theObject, const QString& theName);
 
 /*!
  Returns true if there are no parts in the document, which are not activated
+ \param theNotActivatedNames out string which contains not activated names
  \return a boolean value
  */
 bool XGUI_EXPORT allDocumentsActivated(QString& theNotActivatedNames);
@@ -115,6 +119,8 @@ bool XGUI_EXPORT isSubOfComposite(const ObjectPtr& theObject, const FeaturePtr&
  which has the object as a sub object.
  \param theSourceObject an object, which references are searched
  \param theObject an intermediate recursive object, should be set in the source object
+ \param theDirectRefFeatures direct references
+ \param theIndirectRefFeatures indirect references
  \param theAlreadyProcessed set of processed elements, used for optimization (do not reanalyse processed)
  \return a boolean value
  */
index 9715028144d51cf576a6f99b4893d87a5a1abd8b..4f20df5efaf10df960ce3c8f3aff81b554f9a083 100644 (file)
@@ -973,9 +973,6 @@ QDockWidget* XGUI_Workshop::createObjectBrowser(QWidget* theParent)
   aObjDock->setStyleSheet(
       "::title { position: relative; padding-left: 5px; text-align: left center }");
   myObjectBrowser = new XGUI_ObjectsBrowser(aObjDock);
-#ifdef ModuleDataModel
-  myObjectBrowser->setDataModel(myModule->dataModel());
-#endif
   myModule->customizeObjectBrowser(myObjectBrowser);
   aObjDock->setWidget(myObjectBrowser);
 
index 03195947a0cf8aa01c56c27791dc49f7954e3b16..628e721ce5bcd756319cc8ce474801f882d82226 100644 (file)
@@ -62,10 +62,10 @@ Q_OBJECT
   //! 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();
 
   //! Returns main window (Desktop) of the application
index 14c2edbfd75f76e719787cb97603365c56d416c9..cf611cb264680e099968938df799dfa85ffb36c5 100755 (executable)
@@ -28,9 +28,8 @@ class XGUI_EXPORT XGUI_WorkshopListener : public QObject, public Events_Listener
 {
   Q_OBJECT
 public:
-  /// Constructor
-  /// \param theConnector a Salome connector object. 
-  /// Used only if the workshop is launched in Salome environment
+  /// Constructor. Used only if the workshop is launched in Salome environment
+  /// \param theWorkshop a reference to workshop. 
    XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop);
   virtual ~XGUI_WorkshopListener();
 
@@ -44,12 +43,6 @@ signals:
   /// Emitted when error in applivation happens
   void errorOccurred(const QString&);
 
-protected slots:
-  /// Updates Apply All button state of the feature to the state if the feature has the button
-  /// \param theFeatureId an index of the feature, the action is searched, which state is to be changed
-  /// \param theState an action enable state
-  //void onNestedStateChanged(const std::string& theFeatureId, const bool theState);
-
 protected:
   /// Procedure to process postponed events
   bool event(QEvent * theEvent);