]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom.git into Dev_0.7.1
authorsbh <sergey.belash@opencascade.com>
Thu, 29 Jan 2015 15:23:17 +0000 (18:23 +0300)
committersbh <sergey.belash@opencascade.com>
Thu, 29 Jan 2015 15:23:17 +0000 (18:23 +0300)
88 files changed:
doc/Modules.doc
src/Config/Config_ModuleReader.h
src/Config/Config_PropManager.h
src/ConstructionPlugin/point_widget.xml
src/Model/Model_AttributeSelection.cpp
src/Model/Model_Document.cpp
src/Model/Model_Session.cpp
src/ModuleBase/ModuleBase_DoubleSpinBox.h
src/ModuleBase/ModuleBase_Filter.h
src/ModuleBase/ModuleBase_FilterCustom.h
src/ModuleBase/ModuleBase_FilterFace.h
src/ModuleBase/ModuleBase_FilterFactory.h
src/ModuleBase/ModuleBase_FilterLinearEdge.h
src/ModuleBase/ModuleBase_FilterMulti.h
src/ModuleBase/ModuleBase_FilterNoConsructionSubShapes.h
src/ModuleBase/ModuleBase_FilterShapeType.h
src/ModuleBase/ModuleBase_IModule.cpp
src/ModuleBase/ModuleBase_IModule.h
src/ModuleBase/ModuleBase_IPrefMgr.h
src/ModuleBase/ModuleBase_IPropertyPanel.h
src/ModuleBase/ModuleBase_ISelection.h
src/ModuleBase/ModuleBase_IViewWindow.h
src/ModuleBase/ModuleBase_IViewer.h
src/ModuleBase/ModuleBase_IWorkshop.h
src/ModuleBase/ModuleBase_ModelWidget.cpp
src/ModuleBase/ModuleBase_ModelWidget.h
src/ModuleBase/ModuleBase_Operation.h
src/ModuleBase/ModuleBase_OperationDescription.h
src/ModuleBase/ModuleBase_Preferences.h
src/ModuleBase/ModuleBase_ResultPrs.h
src/ModuleBase/ModuleBase_SelectionValidator.h
src/ModuleBase/ModuleBase_Tools.h
src/ModuleBase/ModuleBase_ViewerFilters.h
src/ModuleBase/ModuleBase_ViewerPrs.h
src/ModuleBase/ModuleBase_WidgetBoolValue.h
src/ModuleBase/ModuleBase_WidgetChoice.h
src/ModuleBase/ModuleBase_WidgetDoubleValue.h
src/ModuleBase/ModuleBase_WidgetFactory.h
src/ModuleBase/ModuleBase_WidgetFileSelector.h
src/ModuleBase/ModuleBase_WidgetLabel.h
src/ModuleBase/ModuleBase_WidgetLineEdit.h
src/ModuleBase/ModuleBase_WidgetMultiSelector.h
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.h
src/NewGeom/NewGeom_Module.h
src/NewGeom/NewGeom_OCCSelector.h
src/NewGeom/NewGeom_SalomeViewer.h
src/PartSet/CMakeLists.txt
src/PartSet/PartSet_EditLine.cpp [deleted file]
src/PartSet/PartSet_EditLine.h [deleted file]
src/PartSet/PartSet_Filters.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_Module.h
src/PartSet/PartSet_Operation.cpp [deleted file]
src/PartSet/PartSet_Operation.h [deleted file]
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherMgr.h
src/PartSet/PartSet_TestOCC.cpp [deleted file]
src/PartSet/PartSet_TestOCC.h [deleted file]
src/PartSet/PartSet_Tools.h
src/PartSet/PartSet_Validators.h
src/PartSet/PartSet_WidgetPoint2d.cpp
src/PartSet/PartSet_WidgetPoint2d.h
src/PartSet/PartSet_WidgetPoint2dDistance.cpp
src/PartSet/PartSet_WidgetPoint2dDistance.h
src/PartSet/PartSet_WidgetShapeSelector.h
src/PartSet/PartSet_WidgetSketchLabel.cpp
src/PartSet/PartSet_WidgetSketchLabel.h
src/PartSetPlugin/PartSetPlugin_Plugin.h
src/XGUI/XGUI_ContextMenuMgr.h
src/XGUI/XGUI_DataTreeModel.h
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Displayer.h
src/XGUI/XGUI_DocumentDataModel.h
src/XGUI/XGUI_ErrorDialog.h
src/XGUI/XGUI_ModuleConnector.h
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_OperationMgr.h
src/XGUI/XGUI_PartDataModel.h
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_QtEvents.h
src/XGUI/XGUI_SalomeConnector.h
src/XGUI/XGUI_Selection.h
src/XGUI/XGUI_SelectionMgr.h
src/XGUI/XGUI_Tools.h
src/XGUI/XGUI_ViewerProxy.h
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_Workshop.h

index e891e1cc05e69f2015efe505c74189b166748057..71060e595a7be054a67c4a1d413bdfe22c8a02b1 100644 (file)
@@ -47,7 +47,7 @@
 /**
  * \defgroup GUI GUI of the application
  *
- * \brief Classes for griphic user interface definition
+ * \brief Classes for graphic user interface definition
  * 
  * Classes of application windows definition, operations launching, 
  * and objects presentations. It consists of two packages:
index f10762597e565c7113f3952839bcee978b9a9741..a6f8c1e2d4215565dc67b3e9afc059e1a5377e32 100644 (file)
@@ -39,7 +39,7 @@ class Config_ModuleReader : public Config_XMLReader
   /// Returns map that describes which file contains a feature (the feature is key, the file is value)
   CONFIG_EXPORT const std::map<std::string, std::string>& featuresInFiles() const;
   /// Returns module name: an xml attribute from the root of the plugins.xml:
-  /// e.g <plugins module="PartSet">
+  /// e.g \code <plugins module="PartSet"> \endcode 
   CONFIG_EXPORT std::string getModuleName();
   /// Detects type of the given plugin and loads it using loadLibrary or loadScript.
   CONFIG_EXPORT static void loadPlugin(const std::string& thePluginName);
index 2d2facf5836e709e8ef2a603b84933ada6d62fa0..751e3f44618be83535da73368f5e6504f83768f8 100644 (file)
@@ -14,7 +14,7 @@
 #include <string>
 #include <vector>
 
-/*
+/**
  * \class Config_PropManager
  * \ingroup Config
  * \brief Class which let to register properties
index ac1dd093b8c196ccbe2311b29754cd917bc11f6b..b691a0ae2db75dd12e97fb5619652e6dc1f748fa 100644 (file)
@@ -1,7 +1,7 @@
 <!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
 
 <source>
-  <doublevalue id="x" label="X:" icon=":pictures/x_point.png" tooltip="X coordinate"/>
-  <doublevalue id="y" label="Y:" icon=":pictures/y_point.png" tooltip="Y coordinate"/>
-  <doublevalue id="z" label="Z:" icon=":pictures/z_point.png" tooltip="Z coordinate"/>
+  <doublevalue id="x" label="X:" icon=":pictures/x_point.png" tooltip="X coordinate" default="0"/>
+  <doublevalue id="y" label="Y:" icon=":pictures/y_point.png" tooltip="Y coordinate" default="0"/>
+  <doublevalue id="z" label="Z:" icon=":pictures/z_point.png" tooltip="Z coordinate" default="0"/>
 </source>
index 418cce2f2c9c616d0484a0c77e6ad3fe97bbe8cc..324b8bc7d73406e0d6d29d2486f1379f72dbafd4 100644 (file)
@@ -52,7 +52,7 @@
 #include <TopAbs_ShapeEnum.hxx>
 #include <TopoDS_Iterator.hxx>
 using namespace std;
-//#define DEB_NAMING 1
+#define DEB_NAMING 1
 #ifdef DEB_NAMING
 #include <BRepTools.hxx>
 #endif
@@ -384,7 +384,7 @@ void Model_AttributeSelection::selectBody(
       return;
     }
   }
-  aSel.Select(aNewShape, aContext);
+  aSel.Select(aNewShape, aContext); 
 }
 
 /// registers the name of the shape in the label (theID == 0) of sub label (theID is a tag)
@@ -601,14 +601,15 @@ std::string Model_AttributeSelection::namingName()
 {
   std::shared_ptr<GeomAPI_Shape> aSubSh = value();
   ResultPtr aCont = context();
-  std::string aName;
+  std::string aName("Undefined name");
   if(!aSubSh.get() || aSubSh->isNull() || !aCont.get() || aCont->shape()->isNull()) 
     return aName;
   TopoDS_Shape aSubShape = aSubSh->impl<TopoDS_Shape>();
+  TopoDS_Shape aContext  = aCont->shape()->impl<TopoDS_Shape>();
 #ifdef DEB_NAMING
   BRepTools::Write(aSubShape, "Selection.brep");
+  BRepTools::Write(aContext, "Context.brep");
 #endif
-  TopoDS_Shape aContext  = aCont->shape()->impl<TopoDS_Shape>();
   std::shared_ptr<Model_Document> aDoc = 
     std::dynamic_pointer_cast<Model_Document>(aCont->document());
 
@@ -616,6 +617,7 @@ std::string Model_AttributeSelection::namingName()
   aName = GetShapeName(aDoc, aSubShape, selectionLabel());
   if(aName.empty() ) { // not in the document!
     TopAbs_ShapeEnum aType = aSubShape.ShapeType();
+       aName = "Undefined name";
        switch (aType) {
          case TopAbs_FACE:
       // the Face should be in DF. If it is not the case, it is an error ==> to be debugged            
@@ -623,21 +625,26 @@ std::string Model_AttributeSelection::namingName()
          case TopAbs_EDGE:
                  {
                  // name structure: F1 | F2 [| F3 | F4], where F1 & F2 the faces which gives the Edge in trivial case
-                 // if it is not atrivial case we use localization by neighbours. F3 & F4 - neighbour faces
-                 TopTools_IndexedMapOfShape aSMap; // map for ancestors of the sub-shape
+                 // if it is not atrivial case we use localization by neighbours. F3 & F4 - neighbour faces             
                  TopTools_IndexedDataMapOfShapeListOfShape aMap;
                  TopExp::MapShapesAndAncestors(aContext, TopAbs_EDGE, TopAbs_FACE, aMap);
+                 TopTools_IndexedMapOfShape aSMap; // map for ancestors of the sub-shape
                  bool isTrivialCase(true);
-                 for (int i = 1; i <= aMap.Extent(); i++) {
+/*               for (int i = 1; i <= aMap.Extent(); i++) {
                        const TopoDS_Shape& aKey = aMap.FindKey(i);
-                       if (aKey.IsNotEqual(aSubShape)) continue; // find exactly the selected key
-
+                       //if (aKey.IsNotEqual(aSubShape)) continue; // find exactly the selected key
+                       if (aKey.IsSame(aSubShape)) continue;
             const TopTools_ListOfShape& anAncestors = aMap.FindFromIndex(i);
                        // check that it is not a trivial case (F1 & F2: aNumber = 1)
                        isTrivialCase = isTrivial(anAncestors, aSMap);                  
                        break;
-                 }
-
+                 }*/
+                 if(aMap.Contains(aSubShape)) {
+                       const TopTools_ListOfShape& anAncestors = aMap.FindFromKey(aSubShape);
+                       // check that it is not a trivial case (F1 & F2: aNumber = 1)
+                       isTrivialCase = isTrivial(anAncestors, aSMap);          
+                 } else 
+                         break;
                  TopTools_ListOfShape aListOfNbs;
                  if(!isTrivialCase) { // find Neighbors
                        TNaming_Localizer aLocalizer;
index 680b7fd3ed6354db2a17bb0ae5a97d30213f1648..2499f0366272ae454b0d4c83f9be503a46a30d95 100644 (file)
@@ -242,6 +242,9 @@ void Model_Document::close(const bool theForever)
   std::shared_ptr<ModelAPI_Session> aPM = Model_Session::get();
   if (this != aPM->moduleDocument().get() && this == aPM->activeDocument().get()) {
     aPM->setActiveDocument(aPM->moduleDocument());
+  } else if (this == aPM->moduleDocument().get()) {
+    // erase the active document if root is closed
+    aPM->setActiveDocument(DocumentPtr());
   }
   // close all subs
   const std::set<std::string> aSubs = subDocuments(true);
index 9f1783fe7b0fb5cd5ea532d53830997d18453ce9..816b87f750d1e391f44a92ef939a0981d5214289 100644 (file)
@@ -187,10 +187,10 @@ void Model_Session::setActiveDocument(
 {
   if (myCurrentDoc != theDoc) {
     myCurrentDoc = theDoc;
-    if (theSendSignal) {
+    if (theDoc.get() && theSendSignal) {
       // syncronize the document: it may be just opened or opened but removed before
       std::shared_ptr<Model_Document> aDoc = std::dynamic_pointer_cast<Model_Document>(theDoc);
-      if (aDoc) {
+      if (aDoc.get()) {
         bool aWasChecked = myCheckTransactions;
         setCheckTransactions(false);
         aDoc->synchronizeFeatures(false, true);
index 5eb2d976e427169185f1dbf1cfbdc0f7048b4e0a..11de54784dfbf2e450ba148094a9d01d1cbe7b20 100644 (file)
@@ -13,6 +13,7 @@
 
 
 /**
+* \ingroup GUI
 * An extension and customozation of QDoubleSpinBox class
 */
 class MODULEBASE_EXPORT ModuleBase_DoubleSpinBox : public QDoubleSpinBox
index 4b684e272c76776d8c4e7e18a4e23028dc7e9179..e7a1a639bf486472b99f4dca491f80599c9084e7 100644 (file)
@@ -14,6 +14,7 @@
 #include <list>
 
 /**
+ * \ingroup GUI
  * This object is assigned by the name
  * in the XML file to the specific attribute or to the whole feature.
  * If isOK method of the filter returns "false", it is signalized in user interface
index 6683207cc2fcff56103105f91d37a80aa6ebc895..6de1620ccc8a721225ccf189e47bda0a978a385f 100644 (file)
@@ -12,6 +12,7 @@
 #include "ModuleBase_Filter.h"
 
 /**
+* \ingroup GUI
 * This is a child of ModuleBase_Filter to be used in the factory of filters. Despite of other
 * child it does not create the internal filter itself, it get it from the constructor argument.
 * This is useful for custom filters, which are not the standard OCC filters. It is not necessary
index c73f602f1d9429d1d09dd47cfd4e9fe0d613ce20..f3a6ef4277fbb2fdfc1acfa2f59d9f5cd5e1b55f 100644 (file)
@@ -14,6 +14,7 @@
 #include <StdSelect_TypeOfFace.hxx>
 
 /**
+* \ingroup GUI
 * A class of a viewer filter by faces
 */
 class ModuleBase_FilterFace: public ModuleBase_Filter
index 043bd64ad8ce1c52324ebc9ebaf510530855fd36..c1a7e36014e37118b1cf74b38baef0bc41f1e624 100644 (file)
@@ -17,6 +17,7 @@
 #include <set>
 
 /**
+ * \ingroup GUI
  * Allows to get a selection filter by the feature identifier and 
  * the attribute identifier (if attribute is validated).
  * All accessible filters must be registered by the ID string first.
index 10bc1d32e2565e9b72d02e1cd68160ef1d395e7f..0efb1a545af9e97ce9c8b6a2c46cbf5c9005f0fe 100644 (file)
@@ -14,6 +14,7 @@
 #include <StdSelect_TypeOfEdge.hxx>
 
 /**
+* \ingroup GUI
 * A class of a viewer filter by linear edges
 */
 class ModuleBase_FilterLinearEdge: public ModuleBase_Filter
index 9a69d59bab7ac45b33a036737c0949e6b8b94d3c..5b9e7dd01b95852e038eb0a8aafae432bfd496b5 100644 (file)
@@ -14,6 +14,7 @@
 #include <StdSelect_TypeOfFace.hxx>
 
 /**
+* \ingroup GUI
 * An implementation of filter which support using of several filters according to OR statement
 */
 class ModuleBase_FilterMulti: public ModuleBase_Filter
index 4d5d3af9190d4b6e74264f4b88ed55fede4ecfc5..e2d4cbf1dbe675fa4bc7a0e1c6f3e8cac48b9ed3 100644 (file)
@@ -16,6 +16,7 @@
 class ModuleBase_IWorkshop;
 
 /**
+* \ingroup GUI
 * \class ModuleBase_FilterNoConsructionSubShapes
 * A filter which provides filtering of selection in 3d viewer.
 * Installing of this filter lets to select objects which belong to 
index 9cf3208ebaf1c281255e56ee0321cb02421d6fd6..771217cd721d235f54d0aa402249be048e18dc4a 100644 (file)
@@ -14,6 +14,7 @@
 #include <StdSelect_TypeOfFace.hxx>
 
 /**
+* \ingroup GUI
 * A class of a viewer filter by shape type
 */
 class ModuleBase_FilterShapeType: public ModuleBase_Filter
index e44ee809d41445db6e624d3b3c6f8ab862377cb4..fd2686df308b3bc672761701127e048f974182b7 100644 (file)
@@ -109,6 +109,11 @@ void ModuleBase_IModule::actionCreated(QAction* theFeature)
   connect(theFeature, SIGNAL(triggered(bool)), this, SLOT(onFeatureTriggered()));
 }
 
+bool ModuleBase_IModule::canDisplayObject(const ObjectPtr& theObject) const
+{
+  ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
+  return anOperation && anOperation->hasObject(theObject);
+}
 
 void ModuleBase_IModule::onFeatureTriggered()
 {
index 29cdc430d099e3f81ecf3258f6c6b681ae90d610..9420d1e74d8818724ca2547c8e02fb9a9a5213a4 100644 (file)
@@ -23,6 +23,7 @@ class ModuleBase_Operation;
 class ModuleBase_IWorkshop;\r
 \r
 /**\r
+ * \ingroup GUI\r
  * Interface to a module\r
  */\r
 class MODULEBASE_EXPORT ModuleBase_IModule : public QObject\r
@@ -87,6 +88,11 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject
   /// It is called as on clearing of property panel as on filling with new widgets\r
   virtual void propertyPanelDefined(ModuleBase_Operation* theOperation) {}\r
 \r
+  /// Returns whether the object can be displayed at the bounds of the active operation.\r
+  /// Display only current operation results\r
+  /// \param theObject a model object\r
+  virtual bool canDisplayObject(const ObjectPtr& theObject) const;\r
+\r
 public slots:\r
   /// Called on call of command corresponded to a feature\r
   void onFeatureTriggered();\r
index c2c23ba901591c076649c1668cb5e1d584565142..147defa4b5e13841d4cd19f1c421234284a463b3 100644 (file)
@@ -12,6 +12,7 @@
 #include <SUIT_PreferenceMgr.h>
 
 /** 
+* \ingroup GUI
 * An interface class which provides incapsulation of SUIT_PreferenceMgr class instance 
 * It is used in order to make common interface to Preference manager in Salome 
 * and this application
index 22648e99806486e6f98a69384f5c25c4ca56bec8..fe8a110e00e3577fa5c3fdd5a9be7cd909dfe74d 100644 (file)
@@ -18,6 +18,7 @@
 class ModuleBase_ModelWidget;
 
 /**
+* \ingroup GUI
 * A class for Property panel object definition
 */
 class MODULEBASE_EXPORT ModuleBase_IPropertyPanel : public QDockWidget
index 5551999f4e6d77bf32daeefb67effc4b98ce8838..e3190488af69f6268a61a1998570abbd06a73edd 100644 (file)
@@ -19,6 +19,7 @@
 #include <QList>
 
 /**
+* \ingroup GUI
 * A class which provides access to selection.
 * A selection can be obtained as from a viewer as from Object browser in various forms
 */
index abf938d3bf56d9ba3dcdb6713d8aca1aa78c2a7a..89929982ebe3367dfa04a8921fcadd677aa57c1a 100644 (file)
@@ -9,6 +9,7 @@
 
 
 /** 
+* \ingroup GUI
 * Interface to ViewWindow object which contains 3d scene
 */
 class ModuleBase_IViewWindow
index c84a7d0582a8d58cae71e96ba12aaa443493fec4..ba7ee1b28f536114857a3d6e195018efd5a86e49 100644 (file)
@@ -14,6 +14,7 @@ class QContextMenuEvent;
 class ModuleBase_IViewWindow;
 
 /**
+ * \ingroup GUI
  * A Base object for definition of connector object to
  * Salome Viewer. Reimplemented in NewGeom_SalomeViewer class
  */
index e755062f6b4cc51e6a2d0690b919a35531824c99..b7f02f4a11740600f0ba31338599ddbac1fdcfd0 100644 (file)
@@ -22,6 +22,7 @@ class ModuleBase_Operation;
 class ModuleBase_FilterFactory;
 
 /**
+ * \ingroup GUI
  * Class which provides access to Workshop object serveces
  */
 class MODULEBASE_EXPORT ModuleBase_IWorkshop : public QObject
index 6a5421549ff74845da9a60dca29fd6257a54761d..73a422d94a6a58a84b0d6cc42ff87202533f945c 100644 (file)
@@ -85,6 +85,17 @@ bool ModuleBase_ModelWidget::focusTo()
   return true;
 }
 
+void ModuleBase_ModelWidget::activate()
+{
+  if (!isEditingMode()) {
+    // the control value is stored to the mode by the focus in on the widget
+    // we need the value is initialized in order to enable the apply button in the property panel
+    // it should happens only in the creation mode because during edition all fields are filled
+    storeValue();
+  }
+  activateCustom();
+}
+
 void ModuleBase_ModelWidget::updateObject(ObjectPtr theObj) const
 {
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
index c4b2ec614f3a6db38f57c9ab4ac66b024247c8e1..44b43e4620d47749a322ad3b23e4f6c4175eb81a 100644 (file)
@@ -20,6 +20,7 @@ class Config_WidgetAPI;
 class QKeyEvent;
 
 /**\class ModuleBase_ModelWidget
+ * \ingroup GUI
  * \brief An abstract custom widget class. This class realization is assumed to create some controls.
  * The controls values modification should send signal about values change.
  *
@@ -83,7 +84,7 @@ Q_OBJECT
   virtual bool focusTo();
 
   /// The methiod called when widget is activated
-  virtual void activate() {}
+  void activate();
 
   /// The methiod called when widget is deactivated
   virtual void deactivate() {}
@@ -161,6 +162,9 @@ signals:
     myAttributeID = theAttribute;
   }
 
+  /// The methiod called when widget is activated
+  virtual void activateCustom() {};
+
   /// Sends Update and Redisplay for the given object
   /// \param theObj is updating object
   void updateObject(ObjectPtr theObj) const;
index 77c8d3fe34e2b622d36476da8ff7b9b51660c06e..8842230b25a0f726d85989fee69a774dbfa25d19 100644 (file)
@@ -29,7 +29,8 @@ class ModuleBase_IViewer;
 class QKeyEvent;
 
 /*!
- \class ModuleBase_Operation
+ * \class ModuleBase_Operation
+ * \ingroup GUI
  * \brief Base class for all operations
  *
  *  Base class for all operations. If you perform an action it is reasonable to create
index 65c87285dfec8b0cb09659134fec6c3118953327..7de7c3288dac0b3e69684bdd98ba6d3702df7b49 100644 (file)
@@ -23,6 +23,7 @@
 \r
 /*!\r
  * \class ModuleBase_OperationDescription\r
+ * \ingroup GUI\r
  * Description of operation from XML\r
  */\r
 class MODULEBASE_EXPORT ModuleBase_OperationDescription\r
index d156f5f708f24fcec6a3b09758524ea718c74296..d2f6cb9bdfe44bf92bba55413a692f52ac0ff518 100644 (file)
@@ -23,6 +23,7 @@ typedef QPair<QString, QString> ModuleBase_Pref;
 typedef QList<ModuleBase_Pref> ModuleBase_Prefs;
 
 //***********************************************************************
+/// \ingroup GUI
 /// Class for manipulation  with preferences in the application
 class MODULEBASE_EXPORT ModuleBase_Preferences
 {
@@ -70,6 +71,7 @@ private:
 };
 
 //***********************************************************************
+/// \ingroup GUI
 /// Manager of preferences
 class MODULEBASE_EXPORT ModuleBase_PreferencesMgr : public SUIT_PreferenceMgr
 {
@@ -102,6 +104,7 @@ Q_OBJECT
 };
 
 //***********************************************************************
+/// \ingroup GUI
 /// Dialog box for preferences editing
 class MODULEBASE_EXPORT ModuleBase_PreferencesDlg : public QDialog
 {
index f37bef1b4d59874f4ea306b0997c1572f1e63e21..2cc200c310946fdd751c25e0066d3f061d1038f9 100644 (file)
@@ -17,6 +17,7 @@
 DEFINE_STANDARD_HANDLE(ModuleBase_ResultPrs, AIS_Shape)
 
 /**
+* \ingroup GUI
 * A redefinition of standard AIS Interactive Object in order to provide specific behaviour 
 * for wire presentations based in a one plane
 */
index 045e730e20fe28e182bfd2facaa0974effc995a3..a519ed849aded91e4f618c9bb991f4673c76a579 100644 (file)
@@ -16,6 +16,7 @@
 #include <string>
 
 /**
+* \ingroup Validators
 * A validator of selection
 */
 class ModuleBase_SelectionValidator : public ModelAPI_Validator
index a0e250914ed12f73bbd4180292a26379d2abb18c..c6ad57e8c5ae1676005dc1802882681e1c961802 100644 (file)
@@ -27,8 +27,10 @@ MODULEBASE_EXPORT void zeroMargins(QLayout* theLayout);
 
 
 /**
+ * \ingroup GUI
  * Methods to modify a resource pixmap
  */
+
 //! Create composite pixmap. 
 //! Pixmap \a theAdditionalIcon is drawn over pixmap \a dest with coordinates
 //! specified relatively to the upper left corner of \a theIcon.
index da1ba9f04af81a59fe36550b34b4cb5f3f17c584..1a215a4fccf47f483077f70688bd45c1da19628e 100644 (file)
@@ -20,6 +20,7 @@ class ModuleBase_IWorkshop;
 
 /**
 * \class ModuleBase_ShapeDocumentFilter
+* \ingroup GUI
 * A filter which provides filtering of selection in 3d viewer.
 * Installing of this filter lets to select objects which belong to 
 * currently active document or to global document
@@ -46,6 +47,7 @@ protected:
 
 /**
 * \class ModuleBase_ShapeInPlaneFilter
+* \ingroup GUI
 * A filter which provides filtering of selection in 3d viewer.
 * Installing of this filter lets to select of Vertexes and Edges which belongs to the given plane
 */
@@ -76,6 +78,7 @@ private:
 
 /**
 * \class ModuleBase_ObjectTypesFilter
+* \ingroup GUI
 * A filter which provides filtering of selection in 3d viewer.
 * Installing of this filter lets to select only object of requested type
 * Accepts following objects types:
index 6dec54b93b605eb2aa7442bd3f89a5f38f0bcfec..cd8751fe7e69a9f425f5d61564502afb51cc851a 100644 (file)
@@ -17,7 +17,7 @@
 #include <ModelAPI_Result.h>
 
 /**\class ModuleBase_ViewerPrs
- * \ingroup Module base
+ * \ingroup GUI
  * \brief Presentation. Provides container to have feature, shape and/or selection owner.
  */
 class ModuleBase_ViewerPrs
@@ -29,7 +29,7 @@ class ModuleBase_ViewerPrs
   }
 
   /// Constructor
-  /// \param theFeature a model feature
+  /// \param theResult an object
   /// \param theShape a viewer shape
   /// \param theOwner a selection owner
   ModuleBase_ViewerPrs(ObjectPtr theResult, const TopoDS_Shape& theShape,
@@ -45,8 +45,8 @@ class ModuleBase_ViewerPrs
   {
   }
 
-  /// Sets the feature.
-  /// \param theFeature a feature instance
+  /// Sets the object.
+  /// \param theResult an object instance
   void setFeature(ObjectPtr theResult)
   {
     myResult = theResult;
@@ -59,8 +59,8 @@ class ModuleBase_ViewerPrs
     return myResult;
   }
 
-  /// Returns the presentation owner
-  /// \param the owner
+  /// Set the presentation owner
+  /// \param theOwner an owner to set
   void setOwner(Handle_SelectMgr_EntityOwner theOwner)
   {
     myOwner = theOwner;
@@ -87,16 +87,21 @@ class ModuleBase_ViewerPrs
     return myShape;
   }
 
+  /// Set interactive object
+  /// \param theIO an interactive object
   void setInteractive(const Handle(AIS_InteractiveObject)& theIO)
   {
     myInteractive = theIO;
   }
 
+  /// Returns interactive object if it is installed
   Handle(AIS_InteractiveObject) interactive() const
   {
     return myInteractive;
   }
 
+  /// Returns True if the current object is equal to the given one
+  /// \param thePrs an object to compare
   bool operator==(const ModuleBase_ViewerPrs& thePrs)
   {
     bool aResult = (myResult.get() == thePrs.object().get());
@@ -110,7 +115,7 @@ class ModuleBase_ViewerPrs
   ObjectPtr myResult;  /// the feature
   Handle(SelectMgr_EntityOwner) myOwner;  /// the selection owner
   TopoDS_Shape myShape;  /// the shape
-  Handle(AIS_InteractiveObject) myInteractive;
+  Handle(AIS_InteractiveObject) myInteractive;  /// interactive object
 };
 
 #endif
index 5325b4d995b257d960f811eaffe91dd87d7f4b18..37b15780d73760d05dccff2b9e064d807683dfe6 100644 (file)
@@ -15,6 +15,7 @@ class QWidget;
 class QCheckBox;
 
 /**
+* \ingroup GUI
 * Implementation of widget for boolean input (check box)
 */ 
 class MODULEBASE_EXPORT ModuleBase_WidgetBoolValue : public ModuleBase_ModelWidget
index 9b5206b083f74ab2ebd8a54997c634930116e39b..3f13cc4afdbfdea772f9190c4835bd14a12515c0 100644 (file)
@@ -15,6 +15,7 @@ class QLabel;
 class QComboBox;
 
 /**
+* \ingroup GUI
 * Implementation of model widget for choice widget definition (combo box)
 * It can be defined as following:
 * \code
index d956662a5d9e77c2609307081d2f294153b1c038..c9032e66a3943fd31541e0a1bc365ff59a004854 100644 (file)
@@ -17,6 +17,7 @@ class QLabel;
 class QTimer;
 
 /**
+* \ingroup GUI
 * A class of property panel widget for double value input
 * It can be defined with "doublevalue" keyword. For example:
 * \code
index 3fa399e986193af203bc0755f4dec906d0cbd749..1292cec57fdd47a674a2d7121e596c3233f0baef 100644 (file)
@@ -22,6 +22,7 @@ class Config_WidgetAPI;
 class ModuleBase_IWorkshop;
 
 /**
+* \ingroup GUI
 * A class for creation of widgets instances in for property panel using XML deskription of 
 * a feature
 */
index 06ca8bf5cf7d4a54de28013413f29cc7ca731e56..3b183d7031a83f71c86059d3143d45d99fd09382 100644 (file)
@@ -21,6 +21,7 @@ class QWidget;
 class QLineEdit;
 
 /**
+* \ingroup GUI
 *  Implementation of model widget for open file widget.
 *  It can be defined as following:
 *  \code
index c3489952e7c7066ca03386840f072ef41a24f6ba..8d7d4281f9e490cadf1808040be4ad266d3480c5 100644 (file)
@@ -13,6 +13,7 @@
 class QLabel;
 
 /**
+* \ingroup GUI
 * Implementation of model widget for a label control
 */
 class MODULEBASE_EXPORT ModuleBase_WidgetLabel : public ModuleBase_ModelWidget
index 0e47acbb8d5649f1edc3f22c6cf47fd61a4a85f0..a5955f84c3ee86f606bccdd267f29c6d6bfd683d 100644 (file)
@@ -21,6 +21,7 @@ class QWidget;
 class QLineEdit;
 
 /**
+* \ingroup GUI
 * Implementation of model widget for line edit widget.
 * It can be defined with "stringvalue" keyword.
 */
index b65b4812b1d01ec8e4edca75b8e223cd1b79ee58..fa73d37590badcdc8f17d95f39031b73357c7837 100644 (file)
@@ -33,6 +33,7 @@ class QAction;
 
 
 /**
+* \ingroup GUI
 * Implementation of widget for shapes selection. This widget provides selection of several shapes.
 * It can be defined in XML file as following:
 * \code
index 361f6383d8507a66b94c38457a95eab6c878f4f5..070cec76c88d88845c2fcb4b2bb20fe29d5ac6f2 100644 (file)
@@ -454,7 +454,7 @@ void ModuleBase_WidgetShapeSelector::raisePanel() const
 }
 
 //********************************************************************
-void ModuleBase_WidgetShapeSelector::activate()
+void ModuleBase_WidgetShapeSelector::activateCustom()
 {
   activateSelection(true);
 }
index f2dbb05c7e95b5ae19312538f39b26ec3633f2ef..b4885d240a566e6c070aeb846f3bdee503c2dc8d 100644 (file)
@@ -26,6 +26,7 @@ class QToolButton;
 class ModuleBase_IWorkshop;
 
 /**
+* \ingroup GUI
 * Implementation of widget for shapes selection.
 * This type of widget can be defined in XML file with 'shape_selector' keyword.
 * For example:
@@ -101,9 +102,6 @@ Q_OBJECT
   virtual bool setSelection(ModuleBase_ViewerPrs theValue);
 
 
-  /// The methiod called when widget is activated
-  virtual void activate();
-
   /// The methiod called when widget is deactivated
   virtual void deactivate();
 
@@ -118,7 +116,10 @@ Q_OBJECT
   void onSelectionChanged();
 
  protected:
-   /// Computes and updates name of selected object in the widget
+  /// The methiod called when widget is activated
+  virtual void activateCustom();
+
+  /// Computes and updates name of selected object in the widget
   void updateSelectionName();
 
   /// Raise panel which contains this widget
index 09cc7181b27acdfa0fb7979e69fe472fa8bfc783..3482c12e8ad90e3d830d4325727574957cd99bcc 100644 (file)
@@ -18,6 +18,7 @@ class NewGeom_OCCSelector;
 class OCCViewer_Viewer;
 
 /** 
+ * \ingroup Salome
  * An implementation of SALOME connector class for implementation of
  * XGUI functionality as a module of SALOME
  */
index 59a3ee0a6f4c15197c6868f958ef377fca320653..d27a62c79d54fd8720b257839eba0a7da6df3492 100644 (file)
@@ -8,6 +8,7 @@
 #include <LightApp_OCCSelector.h>
 
 /**
+* \ingroup Salome
 * Redefinition of standard OCC selector in order to adapt it to NewGeom needs
 */
 class NewGeom_EXPORT NewGeom_OCCSelector : public LightApp_OCCSelector
index 0377ce7e06d17ed86a351dc1cd22a6b271d40b8e..1809dd2430ed674a1f8bda6452b2ccda8aa9caa1 100644 (file)
@@ -20,6 +20,7 @@ class OCCViewer_Viewer;
 class SUIT_ViewManager;
 
 /**
+* \ingroup Salome
 * A class for providing access of NewGeom functionality to 
 * SALOME view window functionality
 */
@@ -32,7 +33,11 @@ public:
 
   virtual Handle(V3d_View) v3dView() const;
 
+  /// Set the current viewer
+  /// \param theViewer a viewer instance
   void setViewer(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
+
+  /// Returns current viewer
   OCCViewer_Viewer* viewer() const { return myViewer; }
 
 private:
@@ -42,6 +47,7 @@ private:
 
 
 /**
+* \ingroup Salome
 * A class for providing access of NewGeom functionality to 
 * SALOME viewer functionality
 */
@@ -85,6 +91,8 @@ Q_OBJECT
   /// \param theZ the Z projection value
   virtual void setViewProjection(double theX, double theY, double theZ);
 
+  /// Set selector
+  /// \param theSel a selector instance
   void setSelector(NewGeom_OCCSelector* theSel);
 
   /// Add selection filter to the viewer
@@ -96,6 +104,7 @@ Q_OBJECT
   /// Remove all selection filters from the viewer
   virtual void clearSelectionFilters();
 
+  /// Returns current selector
   NewGeom_OCCSelector* selector() const
   {
     return mySelector;
index 9f0f38e8b15e17aa01767a6e92ea611150464b49..8c0eff95509abcfe7d2d04ecaad31d1ecb94be5e 100644 (file)
@@ -7,7 +7,6 @@ SET(CMAKE_AUTOMOC ON)
 SET(PROJECT_HEADERS
        PartSet.h
        PartSet_Constants.h
-       PartSet_EditLine.h
        PartSet_Module.h
        PartSet_Tools.h
        PartSet_WidgetSketchLabel.h
@@ -20,7 +19,6 @@ SET(PROJECT_HEADERS
 )
 
 SET(PROJECT_SOURCES
-       PartSet_EditLine.cpp
        PartSet_Module.cpp
        PartSet_Tools.cpp
        PartSet_WidgetSketchLabel.cpp
diff --git a/src/PartSet/PartSet_EditLine.cpp b/src/PartSet/PartSet_EditLine.cpp
deleted file mode 100644 (file)
index c063172..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        PartSet_EditLine.h
-// Created:     02 June 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_EditLine.h>
-
-#include <QLineEdit>
-
-PartSet_EditLine::PartSet_EditLine(QWidget* theParent)
-    : QObject(theParent)
-{
-  myEditor = new QLineEdit(theParent);
-  myEditor->setWindowFlags(Qt::ToolTip);
-  myEditor->setFocusPolicy(Qt::StrongFocus);
-
-  connect(myEditor, SIGNAL(returnPressed()), this, SLOT(onStopEditing()));
-}
-
-void PartSet_EditLine::start(const QPoint& thePoint, double theValue)
-{
-  myEditor->move(thePoint);
-  myEditor->setText(QString::number(theValue));
-  myEditor->show();
-
-  myEditor->selectAll();
-  myEditor->setFocus();
-}
-
-bool PartSet_EditLine::isStarted() const
-{
-  return myEditor->isVisible();
-}
-
-void PartSet_EditLine::stop()
-{
-  myEditor->hide();
-}
-
-double PartSet_EditLine::getValue() const
-{
-  return myEditor->text().toDouble();
-}
-
-void PartSet_EditLine::onStopEditing()
-{
-  stop();
-  emit stopped(getValue());
-}
diff --git a/src/PartSet/PartSet_EditLine.h b/src/PartSet/PartSet_EditLine.h
deleted file mode 100644 (file)
index cf85b78..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        PartSet_EditLine.h
-// Created:     02 Jun 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_EditLine_H
-#define PartSet_EditLine_H
-
-#include "PartSet.h"
-
-#include <QObject>
-#include <QPoint>
-
-class QLineEdit;
-class QWidget;
-
-/*!
- \class PartSet_EditLine
- * \brief The class to give an editor to modify a real value
- */
-class PARTSET_EXPORT PartSet_EditLine : public QObject
-{
-Q_OBJECT
- public:
-  /// Constructor
-  PartSet_EditLine(QWidget* theParent);
-  /// Destructor
-  virtual ~PartSet_EditLine()
-  {
-  }
-  ;
-
-  /// Show the editor in the given global position
-  /// \param thePoint a position
-  /// \param theValue a value for the editor
-  void start(const QPoint& thePoint, double theValue);
-
-  /// Checks whether the editor is started
-  /// \returns true if the editor is activated
-  bool isStarted() const;
-
-  /// Stop the editor, in other words hide it
-  void stop();
-
-signals:
-  /// Signals about the editing stop
-  /// \param theValue the editor value
-  void stopped(double theValue);
-
- protected:
-  /// Returns the editor value
-  /// \return the real value
-  double getValue() const;
-
- protected slots:
-  /// Slot to check the editing stop
-  void onStopEditing();
-
- protected:
-  QLineEdit* myEditor;  /// the value editor
-};
-
-#endif
index 56a34e531a7b21f8bc7ea4d5938fba245a0e6694..aba48302f78784315be71582cc63fc014fd4f608 100644 (file)
 
 
 /**
+* \class PartSet_GlobalFilter
+* \ingroup Modules
 * A class which filters groups object in addition to documents (see issue #310)
 */
 DEFINE_STANDARD_HANDLE(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter);
 class PartSet_GlobalFilter: public ModuleBase_ShapeDocumentFilter
 {
 public:
+  /// Constructor
+  /// \param theWorkshop a pointer to workshop
   PartSet_GlobalFilter(ModuleBase_IWorkshop* theWorkshop)
     : ModuleBase_ShapeDocumentFilter(theWorkshop) {}
 
+  /// Returns True if selected presentation can be selected
+  /// \param theOwner an owner of the persentation
   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
 
   DEFINE_STANDARD_RTTI(PartSet_GlobalFilter)
index c0ea09cd9a950e132fbc553375d3b07e8ef7ff1c..b05715c3847463a83df72c4fdda44ae894ae3c8d 100644 (file)
@@ -187,6 +187,26 @@ void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
   myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
 }
 
+bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const
+{
+  bool aCanDisplay = false;
+  if (mySketchMgr->activeSketch()) {
+    FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+
+    if (aFeature.get() != NULL) {
+      if (aFeature == mySketchMgr->activeSketch()) {
+        aCanDisplay = false;
+      }
+      else {
+        aCanDisplay = mySketchMgr->sketchOperationIdList().contains(aFeature->getKind().c_str());
+      }
+    }
+  }
+  else {
+    aCanDisplay = ModuleBase_IModule::canDisplayObject(theObject);
+  }
+  return aCanDisplay;
+}
 
 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
 {
@@ -219,6 +239,7 @@ void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
   } else {
     // Start editing constraint
     if (theOperation->isEditOperation()) {
+      // TODO: #391 - to be removed
       std::string aId = theOperation->id().toStdString();
       if (PartSet_SketcherMgr::sketchOperationIdList().contains(QString(aId.c_str()))) {
         if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
index 9723d53e3684b01f6fb42840e34ff0bdcd32c86d..326866c9fd16917a5163ffec8ba13394046375d6 100644 (file)
 class ModuleBase_Operation;
 class ModuleBase_IViewWindow;
 
+/**
+* \ingroup Modules
+* Implementation of Partset module
+*/
 class PARTSET_EXPORT PartSet_Module : public ModuleBase_IModule
 {
 Q_OBJECT
@@ -39,6 +43,8 @@ enum RestartingMode {
 };
 
 public:
+  /// Constructor
+  /// \param theWshop a pointer to a workshop
   PartSet_Module(ModuleBase_IWorkshop* theWshop);
   virtual ~PartSet_Module();
 
@@ -71,6 +77,12 @@ public:
   /// \param theOperation a stopped operation
   virtual void operationStopped(ModuleBase_Operation* theOperation);
 
+  /// Returns whether the object can be displayed at the bounds of the active operation.
+  /// Display only current operation results for usual operation and ask the sketcher manager
+  /// if it is a sketch operation
+  /// \param theObject a model object
+  virtual bool canDisplayObject(const ObjectPtr& theObject) const;
+
 public slots:
   /// SLOT, that is called by no more widget signal emitted by property panel
   /// Set a specific flag to restart the sketcher operation
@@ -80,28 +92,8 @@ protected slots:
   /// Called when previous operation is finished
   virtual void onSelectionChanged();
 
-  /// SLOT, that is called by mouse press in the viewer.
-  /// \param theWnd - the window where the event happens
-  /// \param theEvent the mouse event
-  //void onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
-
-  /// SLOT, that is called by mouse release in the viewer.
-  /// \param theWnd - the window where the event happens
-  /// \param theEvent the mouse event
-  //void onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
-  
-  /// SLOT, that is called by mouse move in the viewer.
-  /// \param theWnd - the window where the event happens
-  /// \param theEvent the mouse event
-  //void onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
-
-  /// SLOT, that is called by mouse double click in the viewer.
-  /// \param theWnd - the window where the event happens
-  /// \param theEvent the mouse event
-  //void onMouseDoubleClick(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
-
   /// SLOT, that is called by key release in the viewer.
-  /// The mouse moved point is sent to the current operation to be processed.
+  /// \param theWnd a view window
   /// \param theEvent the key event
   void onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent);
 
@@ -122,11 +114,10 @@ protected slots:
   virtual void registerFilters();
 
  private slots:
+   /// Processing of vertex selected
    void onVertexSelected();
 
-
  private:
-
   /// Breaks sequense of automatically resterted operations
   void breakOperationSequence();
 
diff --git a/src/PartSet/PartSet_Operation.cpp b/src/PartSet/PartSet_Operation.cpp
deleted file mode 100644 (file)
index 1335289..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        PartSet_Operation.cpp
-// Created:     24 Nov 2014
-// Author:      Vitaly SMETANNIKOV
-
-#include "PartSet_Operation.h"
-
-#include <ModuleBase_IWorkshop.h>
-#include <ModuleBase_ISelection.h>
-
-void PartSet_Operation::onSelectionChanged()
-{
-  if (isEditOperation()) {
-    ModuleBase_ISelection* aSelection = myWorkshop->selection();
-    QList<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
-    QList<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
-  }
-}
\ No newline at end of file
diff --git a/src/PartSet/PartSet_Operation.h b/src/PartSet/PartSet_Operation.h
deleted file mode 100644 (file)
index 83fce7e..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        PartSet_Operation.h
-// Created:     24 Nov 2014
-// Author:      Vitaly SMETANNIKOV
-
-#ifndef PartSet_Operation_H
-#define PartSet_Operation_H
-
-#include "PartSet.h"
-
-#include <ModuleBase_Operation.h>
-
-class ModuleBase_IWorkshop;
-
-class PARTSET_EXPORT PartSet_Operation : public ModuleBase_Operation
-{
-Q_OBJECT
- public:
-   PartSet_Operation(const QString& theId = "", QObject* theParent = 0)
-     :ModuleBase_Operation(theId, theParent) {}
-
-   void setWorkshop(ModuleBase_IWorkshop* theWorkshop) { myWorkshop = theWorkshop; } 
-
-public slots:
-  void onSelectionChanged();
-
-private:
-  ModuleBase_IWorkshop* myWorkshop;
-};
-
-#endif
\ No newline at end of file
index 06fcc33712e6d31008c3e7b463d68acd00013550..018001423cf4587155181f284f09482fffc8b65f 100644 (file)
@@ -45,6 +45,9 @@
 #include <SelectMgr_IndexedMapOfOwner.hxx>
 #include <StdSelect_BRepOwner.hxx>
 
+//#include <AIS_DimensionSelectionMode.hxx>
+//#include <AIS_Shape.hxx>
+
 #include <ModelAPI_Events.h>
 
 #include <QMouseEvent>
@@ -137,7 +140,6 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE
 {
   get2dPoint(theWnd, theEvent, myClickedPoint);
 
-  // 
   if (!(theEvent->buttons() & Qt::LeftButton))
     return;
 
@@ -425,6 +427,12 @@ void PartSet_SketcherMgr::launchEditing()
   // point
   QIntList aModes;
   aModes << TopAbs_VERTEX << TopAbs_EDGE;
+  // TODO: #391 - to be uncommented
+  /*aModes.append(AIS_DSM_Text);
+  aModes.append(AIS_DSM_Line);
+  aModes.append(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_VERTEX));
+  aModes.append(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_EDGE));*/
+
   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
   aConnector->activateSubShapesSelection(aModes);
 
index 0b79b084e0b18dd31deab0e8e67835c622e0b9a4..1507f92e98926f64a60d7ca38feb4210ca6e74f7 100644 (file)
@@ -31,7 +31,11 @@ class ModuleBase_Operation;
 class QMouseEvent;
 
 /**
+* \ingroup Modules
 * A class for management of sketch operations
+  At the time of the sketcher operation active, only the sketch sub-feature results are
+  displayed in the viewer. After the sketch create/edit operation is finished, the sub-feature
+  are hidden, the sketch feature result is displayed
 */
 class PARTSET_EXPORT PartSet_SketcherMgr : public QObject
 {
@@ -67,25 +71,29 @@ class PARTSET_EXPORT PartSet_SketcherMgr : public QObject
     double myCurX, myCurY; /// the point coordinates
   };
 public:
+  /// Constructor
+  /// \param theModule a pointer to PartSet module
   PartSet_SketcherMgr(PartSet_Module* theModule);
 
   virtual ~PartSet_SketcherMgr();
 
+  /// Returns list of strings which contains id's of sketch operations
   static QStringList sketchOperationIdList();
 
   /// Launches the operation from current highlighting
   void launchEditing();
 
-  // Returns current Sketch feature/ Returns NULL if there is no launched sketch operation
+  /// Returns current Sketch feature/ Returns NULL if there is no launched sketch operation
   CompositeFeaturePtr activeSketch() const { return myCurrentSketch; }
 
   /// Starts sketch operation
-  void startSketch(ModuleBase_Operation* theOperation);
+  void startSketch(ModuleBase_Operation* );
 
   /// Stops sketch operation
-  void stopSketch(ModuleBase_Operation* theOperation);
+  void stopSketch(ModuleBase_Operation* );
 
 public slots:
+  /// Process sketch plane selected event
   void onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>& thePln);
 
 
diff --git a/src/PartSet/PartSet_TestOCC.cpp b/src/PartSet/PartSet_TestOCC.cpp
deleted file mode 100644 (file)
index 57a1529..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        PartSet_TestOCC.h
-// Created:     28 Apr 2014
-// Author:      Natalia ERMOLAEVA
-
-#include <PartSet_TestOCC.h>
-
-#include <XGUI_Workshop.h>
-#include <XGUI_OperationMgr.h>
-#include <XGUI_Displayer.h>
-#include <XGUI_ViewerProxy.h>
-#include <PartSet_Tools.h>
-
-#include <ModuleBase_ViewerPrs.h>
-#include <ModelAPI_Feature.h>
-
-#include <SketchPlugin_Line.h>
-#include <ModelAPI_Document.h>
-
-static double myTestDelta;
-static ResultPtr myTestObject;
-
-#include <AIS_InteractiveContext.hxx>
-#include <AIS_Shape.hxx>
-#include <V3d_View.hxx>
-#include <BRepBuilderAPI_MakeEdge.hxx>
-#include <BRep_Tool.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS.hxx>
-
-void PartSet_TestOCC::testSelection(XGUI_Workshop* theWorkshop)
-{
-  if (!myTestObject) {
-    PartSet_TestOCC::createTestLine(theWorkshop);
-    PartSet_TestOCC::moveMouse(theWorkshop->viewer()->AISContext(),
-                               theWorkshop->viewer()->activeView());
-    PartSet_TestOCC::changeTestLine(theWorkshop);
-  }
-  std::shared_ptr<GeomAPI_AISObject> anIO = theWorkshop->displayer()->getAISObject(myTestObject);
-  if (!anIO->empty()) {
-    theWorkshop->viewer()->AISContext()->MoveTo(0, 0, theWorkshop->viewer()->activeView());
-    theWorkshop->viewer()->AISContext()->Select(0, 0, 2500, 2500,
-                                                theWorkshop->viewer()->activeView());
-  }
-}
-
-void PartSet_TestOCC::local_selection_change_shape(Handle_AIS_InteractiveContext theContext,
-                                                   Handle_V3d_View theView)
-{
-  // 1. Create shape
-  gp_Pnt aPnt1(100, 100, 0);
-  gp_Pnt aPnt2(150, 300, 0);
-  TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aPnt1, aPnt2).Edge();
-
-  // 2. Display shape and activate it in the local context
-  Handle(AIS_Shape) anAIS = new AIS_Shape(anEdge);
-  if (!theContext->HasOpenedContext()) {
-    theContext->ClearCurrents(false);
-    theContext->OpenLocalContext(false/*use displayed objects*/, true/*allow shape decomposition*/);
-  }
-  theContext->Display(anAIS, false);
-  theContext->Load(anAIS, -1, true/*allow decomposition*/);
-  theContext->Activate(anAIS, AIS_Shape::SelectionMode(TopAbs_VERTEX));
-  theContext->Activate(anAIS, AIS_Shape::SelectionMode(TopAbs_EDGE));
-
-  // 3. Change selection in the viewer
-  // emulate rectangle selection in the viewer
-  theContext->Select(0, 0, 2500, 2500, theView);
-
-  // 3. Change the shape of AIS presentation
-  gp_Pnt aPnt3(-100, -100, 0);
-  gp_Pnt aPnt4(200, 200, 0);
-  TopoDS_Edge anEdge2 = BRepBuilderAPI_MakeEdge(aPnt3, aPnt4).Edge();
-  anAIS->Set(anEdge2);
-  anAIS->Redisplay(Standard_True);
-  theContext->RecomputeSelectionOnly(anAIS);
-
-  // 4. Check the current viewer selection
-  Handle(AIS_InteractiveContext) aContext = theContext;
-  bool isFirstLinePoint = false;
-  bool isShapeSelected = false;
-  for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
-    TopoDS_Shape aShape = aContext->SelectedShape();
-    if (aShape.ShapeType() == TopAbs_VERTEX) {
-      const TopoDS_Vertex& aVertex = TopoDS::Vertex(aShape);
-      if (!aVertex.IsNull()) {
-        gp_Pnt aPoint = BRep_Tool::Pnt(aVertex);
-        double aD_1 = aPoint.Distance(aPnt1);
-        double aD_2 = aPoint.Distance(aPnt2);
-        isFirstLinePoint = aD_1 < Precision::Confusion() || aD_2 < Precision::Confusion();
-      }
-    }
-  }
-  if (isFirstLinePoint)
-    std::cout << "Error: The point of the first line should not be selected." << std::endl;
-}
-
-void PartSet_TestOCC::local_selection_erase(Handle_AIS_InteractiveContext theContext,
-                                            Handle_V3d_View theView)
-{
-  // 1. Create shape
-  gp_Pnt aPnt1(100, 100, 0);
-  gp_Pnt aPnt2(150, 300, 0);
-  TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aPnt1, aPnt2).Edge();
-
-  // 2. Display shape and activate it in the local context
-  Handle(AIS_Shape) anAIS = new AIS_Shape(anEdge);
-  if (!theContext->HasOpenedContext()) {
-    theContext->ClearCurrents(false);
-    theContext->OpenLocalContext(false/*use displayed objects*/, true/*allow shape decomposition*/);
-  }
-  theContext->Display(anAIS, false);
-  theContext->Load(anAIS, -1, true/*allow decomposition*/);
-  theContext->Activate(anAIS, AIS_Shape::SelectionMode(TopAbs_VERTEX));
-  theContext->Activate(anAIS, AIS_Shape::SelectionMode(TopAbs_EDGE));
-
-  // 3. Change selection in the viewer
-  // emulate rectangle selection in the viewer
-  theContext->Select(0, 0, 2500, 2500, theView);
-
-  theContext->Erase(anAIS);
-}
-
-void PartSet_TestOCC::createTestLine(XGUI_Workshop* theWorkshop)
-{
-  myTestDelta = 80;
-
-  ModuleBase_Operation* anOperation = theWorkshop->operationMgr()->currentOperation();
-  PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
-  FeaturePtr aSketch;
-
-  if (aPreviewOp) {
-    // create a line
-    std::shared_ptr<ModelAPI_Document> aDoc = ModelAPI_Session::get()->moduleDocument();
-    FeaturePtr aFeature = aDoc->addFeature(SketchPlugin_Line::ID());
-    if (aFeature)  // TODO: generate an error if feature was not created
-      aFeature->execute();
-
-    std::shared_ptr<SketchPlugin_Feature> aSketch = std::dynamic_pointer_cast<
-        SketchPlugin_Feature>(aPreviewOp->sketch());
-    aSketch->addSub(aFeature);
-
-    PartSet_Tools::setFeaturePoint(aFeature, 100, 100, SketchPlugin_Line::START_ID());
-    PartSet_Tools::setFeaturePoint(aFeature, 150, 300, SketchPlugin_Line::END_ID());
-
-    std::shared_ptr<GeomAPI_Shape> aPreview = PartSet_OperationSketchBase::preview(aFeature);
-
-    XGUI_Displayer* aDisplayer = theWorkshop->displayer();
-
-    std::shared_ptr<GeomAPI_AISObject> aPrevAIS;
-    std::shared_ptr<SketchPlugin_Feature> aSPFeature = std::dynamic_pointer_cast<
-        SketchPlugin_Feature>(aFeature);
-    //std::shared_ptr<GeomAPI_AISObject> anAIS = aSPFeature->getAISObject(aPrevAIS);
-    //if (!anAIS->empty())
-    aDisplayer->display(aFeature, false);
-    //aDisplayer->redisplay(aFeature->firstResult(), anAIS, false);
-
-    std::list<int> aModes;
-    aModes.push_back(TopAbs_VERTEX);
-    aModes.push_back(TopAbs_EDGE);
-    aDisplayer->activateInLocalContext(aFeature->firstResult(), aModes, true);
-
-    // change the line
-    /*double aDelta = -200;
-     for (int i = 0; i < 20; i++) {
-     aDelta = aDelta - i*2;
-     PartSet_Tools::setFeaturePoint(aFeature, 100+aDelta, 200+aDelta, SketchPlugin_Line::START_ID());
-     PartSet_Tools::setFeaturePoint(aFeature, 300+aDelta, 500+aDelta, SketchPlugin_Line::END_ID());
-
-     std::shared_ptr<GeomAPI_Shape> aPreview = PartSet_OperationSketchBase::preview(aFeature);
-     Handle(AIS_InteractiveObject) anAIS = PartSet_Presentation::createPresentation(
-     aFeature, aSketch,
-     aPreview ? aPreview->impl<TopoDS_Shape>() : TopoDS_Shape(), NULL);
-     if (!anAIS.IsNull())
-     aDisplayer->redisplay(aFeature, anAIS, true);
-
-     int aVal = 90;
-     for (int j = 0; j < 10000000; j++)
-     aVal = aVal/aVal+aVal*2;
-     }*/
-    //std::list<int> aModes;
-    //aModes.clear();
-    //aModes.push_back(TopAbs_VERTEX);
-    //aModes.push_back(TopAbs_EDGE);
-    //aDisplayer->activateInLocalContext(aFeature, aModes, true);
-    myTestObject = aFeature->firstResult();
-
-    QList<ObjectPtr> aFeatureList;
-    aFeatureList.append(myTestObject);
-    aDisplayer->setSelected(aFeatureList, true);
-  }
-}
-
-void PartSet_TestOCC::changeTestLine(XGUI_Workshop* theWorkshop)
-{
-  // change the line
-  if (!myTestObject)
-    return;
-  ResultPtr aFeature = myTestObject;
-
-  myTestDelta = myTestDelta - 50;
-  double aDelta = myTestDelta;
-  // TODO
-  //PartSet_Tools::setFeaturePoint(aFeature, -100/*aDelta*/, -100/*aDelta*/, LINE_ATTR_START);
-  //PartSet_Tools::setFeaturePoint(aFeature, 200/*aDelta*2*/, 200/*aDelta*2*/, LINE_ATTR_END);
-  //std::shared_ptr<GeomAPI_Shape> aPreview = PartSet_OperationSketchBase::preview(aFeature);
-
-  std::shared_ptr<GeomAPI_AISObject> aPrevAIS;
-  std::shared_ptr<SketchPlugin_Feature> aSPFeature = std::dynamic_pointer_cast<
-      SketchPlugin_Feature>(aFeature);
-  //std::shared_ptr<GeomAPI_AISObject> anAIS = aSPFeature->getAISObject(aPrevAIS);
-  //if (!anAIS->empty())
-  theWorkshop->displayer()->display(aFeature, true);
-  //  theWorkshop->displayer()->redisplay(aFeature, anAIS, true);
-  //std::list<int> aModes;
-  //aModes.clear();
-  //aModes.push_back(TopAbs_VERTEX);
-  //aModes.push_back(TopAbs_EDGE);
-  //aDisplayer->activateInLocalContext(aFeature, aModes, true);
-
-  /*QFeatureList aFeatureList;
-   aFeatureList.append(myTestObject);
-   theWorkshop->displayer()->setSelected(aFeatureList, true);*/
-
-  theWorkshop->displayer()->updateViewer();
-}
-
-void PartSet_TestOCC::moveMouse(Handle(AIS_InteractiveContext) theContext, Handle(V3d_View) theView)
-{
-  theContext->MoveTo(10, 10, theView);
-  theContext->Select();
-}
diff --git a/src/PartSet/PartSet_TestOCC.h b/src/PartSet/PartSet_TestOCC.h
deleted file mode 100644 (file)
index 0b656ea..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        PartSet_TestOCC.h
-// Created:     28 Apr 2014
-// Author:      Natalia ERMOLAEVA
-
-#ifndef PartSet_TestOCC_H
-#define PartSet_TestOCC_H
-
-#include "PartSet.h"
-
-class XGUI_Workshop;
-class Handle_AIS_InteractiveContext;
-class Handle_V3d_View;
-
-/*!
- \class PartSet_TestOCC
- * \brief The operation to test OCC viewer work
- */
-class PARTSET_EXPORT PartSet_TestOCC
-{
- public:
-  PartSet_TestOCC()
-  {
-  }
-  ;
-
-  /// Creates a line feature, select it, modify the line. Check whether the highlight is correct.
-  /// \param the workshop to provide an access to the application information
-  static void testSelection(XGUI_Workshop* theWorkshop);
-
-  /// Creates row OCC presentation, activate in the local context, modify it and check selection
-  /// BUG: The result contains the selection from the first presentation
-  /// \param theContext a viewer interactive context
-  /// \param theContext a view
-  static void local_selection_change_shape(Handle_AIS_InteractiveContext theContext,
-                                           Handle_V3d_View theView);
-
-  /// Creates row OCC presentation, activate in the local context, select it, erase the presentation
-  /// BUG: The selected shape are in the viewer even after erase
-  /// \param theContext a viewer interactive context
-  /// \param theContext a view
-  static void local_selection_erase(Handle_AIS_InteractiveContext theContext,
-                                    Handle_V3d_View theView);
-
- private:
-
-  /// Creates a temporary line
-  /// \param the workshop to get the operation manager and the displayer
-  static void createTestLine(XGUI_Workshop* theWorkshop);
-
-  /// Changes a temporary line
-  /// \param the workshop to get the operation manager and the displayer
-  static void changeTestLine(XGUI_Workshop* theWorkshop);
-
-  /// Emulates the mouse moving in the viewer
-  static void moveMouse(Handle_AIS_InteractiveContext theContext, Handle_V3d_View theView);
-};
-
-#endif
index 05104bb016714dc2e42ab9d47173c04d054c753a..31508cb9a32ca2e58a95f48b851481f81830133d 100644 (file)
@@ -33,7 +33,8 @@ class GeomAPI_Edge;
 class GeomAPI_Vertex;
 
 /*!
- \class PartSet_Tools
+ * \class PartSet_Tools
+ * \ingroup Modules
  * \brief The operation for the sketch feature creation
  */
 class PARTSET_EXPORT PartSet_Tools
@@ -42,12 +43,12 @@ class PARTSET_EXPORT PartSet_Tools
   /// Converts the 2D screen point to the 3D point on the view according to the point of view
   /// \param thePoint a screen point
   /// \param theView a 3D view
-  // Transferred to ModuleBase
   static gp_Pnt convertClickToPoint(QPoint thePoint, Handle_V3d_View theView);
 
   /// \brief Converts the 3D point to the projected coodinates on the sketch plane.
   /// \param thePoint the 3D point in the viewer
   /// \param theSketch the sketch feature
+  /// \param theView a view 3d object
   /// \param theX the X coordinate
   /// \param theY the Y coordinate
   static void convertTo2D(const gp_Pnt& thePoint, FeaturePtr theSketch,
@@ -58,7 +59,6 @@ class PARTSET_EXPORT PartSet_Tools
   /// \param theX the X coordinate
   /// \param theY the Y coordinate
   /// \param theSketch the sketch feature
-  /// \param thePoint the 3D point in the viewer
   static std::shared_ptr<GeomAPI_Pnt> convertTo3D(const double theX, const double theY, FeaturePtr theSketch);
 
   /// Returns an object that is under the mouse point. Firstly it checks the highlighting,
@@ -77,7 +77,12 @@ 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>());
 
@@ -90,7 +95,7 @@ class PARTSET_EXPORT PartSet_Tools
 
   /// \brief Save the double to the feature. If the attribute is double, it is filled.
   /// \param theFeature the feature
-  /// \param theValue the horizontal coordinate
+  /// \param theX the horizontal coordinate
   /// \param theAttribute the feature attribute
   static void setFeatureValue(FeaturePtr theFeature, double theX, const std::string& theAttribute);
 
@@ -111,8 +116,9 @@ class PARTSET_EXPORT PartSet_Tools
                             const std::string& theKind);
 
   /// Creates a constraint on two points
+  /// \param theSketch a sketch feature
   /// \param thePoint1 the first point
-  /// \param thePoint1 the second point
+  /// \param thePoint2 the second point
   static void createConstraint(CompositeFeaturePtr theSketch,
                                std::shared_ptr<GeomDataAPI_Point2D> thePoint1,
                                std::shared_ptr<GeomDataAPI_Point2D> thePoint2);
@@ -145,8 +151,10 @@ class PARTSET_EXPORT PartSet_Tools
 
   /// Creates a line (arc or circle) by given edge
   /// Created line will have fixed constraint
-  /// \param theEdge - an edge
-  /// \return - result of created feature
+  /// \param theShape an edge
+  /// \param theObject a selected result object
+  /// \param theSketch a sketch feature
+  /// \return result of created feature
   static ResultPtr createFixedObjectByEdge(const TopoDS_Shape& theShape, 
                                            const ObjectPtr& theObject, 
                                            CompositeFeaturePtr theSketch);
index eb44d6daae3eaaf8e6d1116eadcda3ecbb13f39b..be1bb0ef5c149fa4ea04866b636f62e49aaa74f0 100644 (file)
@@ -18,6 +18,7 @@
  * Selector validators
  */
 
+//! \ingroup Validators
 //! A class to validate a selection for Distance constraint operation
 class PartSet_DistanceValidator : public ModuleBase_SelectionValidator
 {
@@ -25,6 +26,7 @@ class PartSet_DistanceValidator : public ModuleBase_SelectionValidator
   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
 };
 
+//! \ingroup Validators
 //! A class to validate a selection for Length constraint operation
 class PartSet_LengthValidator : public ModuleBase_SelectionValidator
 {
@@ -32,6 +34,7 @@ class PartSet_LengthValidator : public ModuleBase_SelectionValidator
   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
 };
 
+//! \ingroup Validators
 //! A class to validate a selection for Perpendicular constraint operation
 class PartSet_PerpendicularValidator : public ModuleBase_SelectionValidator
 {
@@ -39,6 +42,7 @@ class PartSet_PerpendicularValidator : public ModuleBase_SelectionValidator
   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
 };
 
+//! \ingroup Validators
 //! A class to validate a selection for Perpendicular constraint operation
 class PartSet_ParallelValidator : public ModuleBase_SelectionValidator
 {
@@ -46,6 +50,7 @@ class PartSet_ParallelValidator : public ModuleBase_SelectionValidator
   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
 };
 
+//! \ingroup Validators
 //! A class to validate a selection for Perpendicular constraint operation
 class PartSet_RadiusValidator : public ModuleBase_SelectionValidator
 {
@@ -53,6 +58,7 @@ class PartSet_RadiusValidator : public ModuleBase_SelectionValidator
   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
 };
 
+//! \ingroup Validators
 //! A class to validate a selection for Perpendicular constraint operation
 class PartSet_RigidValidator : public ModuleBase_SelectionValidator
 {
@@ -60,25 +66,43 @@ class PartSet_RigidValidator : public ModuleBase_SelectionValidator
   PARTSET_EXPORT virtual bool isValid(const ModuleBase_ISelection* theSelection) const;
 };
 
+/**
+* \ingroup Validators
+* A validator which checks that objects selected for feature attributes are different (not the same)
+*/
 class PartSet_DifferentObjectsValidator : public ModelAPI_RefAttrValidator
 {
  public:
+   /// Returns True if the feature is valid
+   /// \param theFeature a feature to check
+   /// \param theArguments a list of arguments (names of attributes to check)
+   /// \param theObject a selected object
   virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
                        const ObjectPtr& theObject) const;
+
   //! Returns true if the attribute is good for the feature attribute
+  //! \param theFeature a feature to check
+  //! \param theArguments a list of arguments (names of attributes to check)
+  //! \param theAttribute an attribute
   virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
                        const AttributePtr& theAttribute) const;
 
+  //! 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)
   virtual bool isValid(const AttributePtr& theAttribute,
                        const std::list<std::string>& theArguments) const;
 };
 
 /**
-* aValidator which validates tha selected object is a Sketch
+* \ingroup Validators
+* A Validator which validates tha selected object is a Sketch
 */
 class PartSet_SketchValidator : public ModelAPI_ResultValidator
 {
  public:
+   /// Returns True if the given object is a sketch
+   /// \param theObject an object
   virtual bool isValid(const ObjectPtr theObject) const;
 };
 
index 1e061643c10d3e882968a739c3c0219ce2c2fe73..e8796669b9cc529bd2b625a8dc9de2e5d61aeca1 100644 (file)
@@ -44,6 +44,9 @@
 #include <cfloat>
 #include <climits>
 
+const double MaxCoordinate = 1e12;
+
+
 PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent, 
                                               const Config_WidgetAPI* theData,
                                               const std::string& theParentId)
@@ -98,15 +101,17 @@ bool PartSet_WidgetPoint2D::setSelection(ModuleBase_ViewerPrs theValue)
   TopoDS_Shape aShape = theValue.shape();
   double aX, aY;
   if (getPoint2d(aView, aShape, aX, aY)) {
-    setPoint(aX, aY);
-    isDone = true;
+    isDone = setPoint(aX, aY);
   }
   return isDone;
 }
 
-void PartSet_WidgetPoint2D::setPoint(double theX, double theY)
+bool PartSet_WidgetPoint2D::setPoint(double theX, double theY)
 {
-
+  if (fabs(theX) >= MaxCoordinate)
+    return false;
+  if (fabs(theY) >= MaxCoordinate)
+    return false;
   bool isBlocked = this->blockSignals(true);
   myXSpin->blockSignals(true);
   myXSpin->setValue(theX);
@@ -118,6 +123,7 @@ void PartSet_WidgetPoint2D::setPoint(double theX, double theY)
   this->blockSignals(isBlocked);
 
   emit valuesChanged();
+  return true;
 }
 
 bool PartSet_WidgetPoint2D::storeValue() const
@@ -182,7 +188,7 @@ QList<QWidget*> PartSet_WidgetPoint2D::getControls() const
 }
 
 
-void PartSet_WidgetPoint2D::activate()
+void PartSet_WidgetPoint2D::activateCustom()
 {
   XGUI_ViewerProxy* aViewer = myWorkshop->viewer();
   connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)), 
@@ -193,12 +199,6 @@ void PartSet_WidgetPoint2D::activate()
   QIntList aModes;
   aModes << TopAbs_VERTEX;
   myWorkshop->moduleConnector()->activateSubShapesSelection(aModes);
-  if (!isEditingMode()) {
-    // the control value is stored to the mode by the focus in on the widget
-    // we need the value is initialized in order to enable the apply button in the property panel
-    // it should happens only in the creation mode because during edition all fields are filled
-    storeValue();
-  }
 }
 
 void PartSet_WidgetPoint2D::deactivate()
@@ -257,7 +257,8 @@ void PartSet_WidgetPoint2D::onMouseRelease(ModuleBase_IViewWindow* theWnd, QMous
   double aX, anY;
   Handle(V3d_View) aView = theWnd->v3dView();
   PartSet_Tools::convertTo2D(aPoint, mySketch, aView, aX, anY);
-  //setPoint(aX, anY);
+  if (!setPoint(aX, anY))
+    return;
 
   std::shared_ptr<GeomDataAPI_Point2D> aFeaturePoint = std::dynamic_pointer_cast<
       GeomDataAPI_Point2D>(feature()->data()->attribute(attributeID()));
index ad0395461f2375f1ac8a4b0c2ad3578f4b69c23a..def3b2bb73e503ccfb416f05d9e691ae453aa167 100644 (file)
@@ -27,17 +27,21 @@ class QGroupBox;
 class QMouseEvent;
 
 /**\class PartSet_WidgetPoint2D
- * \ingroup GUI
- * \brief Custom widget. An abstract class to be redefined to fill with some GUI controls
+ * \ingroup Modules
+ * \brief Implementation of model widget to provide widget to input point 2d
+ * In XML can be defined as folloung:
+ * \code
+ * <sketch-2dpoint_selector id="CircleCenter" title="Center" tooltip="Center coordinates"/>
+ * \endcode
  */
 class PARTSET_EXPORT PartSet_WidgetPoint2D : public ModuleBase_ModelWidget
 {
 Q_OBJECT
  public:
   /// Constructor
-  /// \theParent the parent object
-  /// \theParent the parent object
-  /// \theData the widget configuation. The attribute of the model widget is obtained from
+  /// \param theParent the parent 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_WidgetPoint2D(QWidget* theParent, const Config_WidgetAPI* theData, 
                         const std::string& theParentId);
   /// Destructor
@@ -48,8 +52,6 @@ Q_OBJECT
   /// \param theValue the wrapped widget value
   virtual bool setSelection(ModuleBase_ViewerPrs theValue);
 
-  /// Saves the internal parameters to the given feature
-  /// \param theObject a model feature to be changed
   virtual bool storeValue() const;
 
   virtual bool restoreValue();
@@ -64,23 +66,26 @@ Q_OBJECT
 
   //bool initFromPrevious(ObjectPtr theObject);
 
-  /// The methiod called when widget is activated
-  virtual void activate();
-
   /// The methiod called when widget is deactivated
   virtual void deactivate();
 
+  /// Return workshop
   XGUI_Workshop* workshop() const { return myWorkshop; }
 
+  /// Set workshop
   void setWorkshop(XGUI_Workshop* theWork) { myWorkshop = theWork; }
 
   /// \returns the sketch instance
   CompositeFeaturePtr sketch() const { return mySketch; }
+
+  /// Set sketch instance
   void setSketch(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
 
   /// Fill the widget values by given point
-  /// \param thePoint the point
-  void setPoint(double theX, double theY);
+  /// \param theX the X coordinate
+  /// \param theY the Y coordinate
+  /// \returns True in case of success
+  bool setPoint(double theX, double theY);
 
   /// Returns coordinate X currently defined in the control
   double x() const;
@@ -90,18 +95,33 @@ Q_OBJECT
 
 signals:
   /// Signal about selection of an existing vertex from an object
-  /// \param theObject - the selected object
-  /// \param theShape - the selected shape
   void vertexSelected();
 
 protected slots:
+  /// Process mouse release event
+  /// \param theWnd a view window
+  /// \param theEvent a mouse event
   void onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
+
+  /// Process mouse move event
+  /// \param theWnd a view window
+  /// \param theEvent a mouse event
   void onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
 
+protected:
+  /// The methiod called when widget is activated
+  virtual void activateCustom();
+
 private slots:
+  /// Process value changed event
   void onValuesChanged();
 
  private:
+   /// Returns point 2d from selected vertex
+   /// \param theView a view window
+   /// \param theShape a vertex shape
+   /// \param theX an output value of X coordinate
+   /// \param theY an output value of Y coordinate
    bool getPoint2d(const Handle(V3d_View)& theView, const TopoDS_Shape& theShape, 
                    double& theX, double& theY) const;
 
index c3cba967bb8490347938c04084fe4779876bc915..be108103444444fb9defbfc239b8f925efcddc31 100644 (file)
@@ -60,7 +60,7 @@ void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
   }
 }
 
-void PartSet_WidgetPoint2dDistance::activate()
+void PartSet_WidgetPoint2dDistance::activateCustom()
 {
   XGUI_ViewerProxy* aViewer = myWorkshop->viewer();
   connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)), 
index ca95b75fd3ee11f0bd851fa1319dbc76d4a9985d..aa0ce98cd8170aebbe78cad44460efd2a638e45d 100644 (file)
@@ -17,46 +17,72 @@ class XGUI_Workshop;
 class ModuleBase_IViewWindow;
 class QMouseEvent;
 
+/**
+* \ingroup Modules
+* Implementation of model widget for widget which provides input of a distance between two points
+* In XML file can be defined as following:
+* \code
+* <point2ddistance id="CircleRadius" 
+*   first_point="CircleCenter" 
+*   label="Radius:" 
+*   min="0" 
+*   step="1.0" 
+*   default="0" 
+*   icon=":icons/radius.png" 
+*   tooltip="Set radius">
+*   <validator id="GeomValidators_Positive"/>
+* </point2ddistance>
+* \endcode
+*/ 
 class PARTSET_EXPORT PartSet_WidgetPoint2dDistance : public ModuleBase_WidgetDoubleValue
 {
 Q_OBJECT
  public:
   /// Constructor
-  /// \theParent the parent object
-  /// \theData the widget configuation. The attribute of the model widget is obtained from
+  /// \param theParent the parent 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_WidgetPoint2dDistance(QWidget* theParent, const Config_WidgetAPI* theData,
                                    const std::string& theParentId);
 
   virtual ~PartSet_WidgetPoint2dDistance();
 
-  /// The methiod called when widget is activated
-  virtual void activate();
-
   /// The methiod called when widget is deactivated
   virtual void deactivate();
 
-  /// Set the given wrapped value to the current widget
-  /// This value should be processed in the widget according to the needs
-  /// \param theValue the wrapped widget value
-  //virtual bool setValue(ModuleBase_WidgetValue* theValue);
-
+  /// Returns workshop
   XGUI_Workshop* workshop() const { return myWorkshop; }
 
+  /// Set workshop
+  /// \param theWork a pointer to workshop
   void setWorkshop(XGUI_Workshop* theWork) { myWorkshop = theWork; }
 
   /// \returns the sketch instance
   CompositeFeaturePtr sketch() const { return mySketch; }
+
+  /// Set sketch instance
   void setSketch(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
 
  protected slots:
+   /// Process of mouse release
+   /// \param theWnd a pointer to a window
+   /// \param theEvent a mouse event
   void onMouseRelease(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
+
+   /// Process of mouse move
+   /// \param theWnd a pointer to a window
+   /// \param theEvent a mouse event
   void onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent);
 
 protected:
+  /// The methiod called when widget is activated
+  virtual void activateCustom();
+
   /// Set the second point which defines a value in the widget as a distance with a first point defined by feature
   void setPoint(FeaturePtr theFeature, const std::shared_ptr<GeomAPI_Pnt2d>& thePnt);
 
 private slots:
+  /// Process values changed event
   void onValuesChanged();
 
  private:
index 8f187cd8b47b1d1f8074506210f471f690ce91b6..222bac774861dde14ece55b7fa51f81fe96a6433 100644 (file)
 
 #include <ModelAPI_CompositeFeature.h>
 
+
+/**
+* \ingroup Modules
+* Customosation of ModuleBase_WidgetShapeSelector in order to provide 
+* working with sketch specific objects.
+*/
 class PARTSET_EXPORT PartSet_WidgetShapeSelector: public ModuleBase_WidgetShapeSelector
 {
 Q_OBJECT
  public:
+  /// Constructor
+  /// \param theParent the parent object
+  /// \param theWorkshop instance of workshop interface
+  /// \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_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
     const Config_WidgetAPI* theData, const std::string& theParentId)
     : ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData, theParentId) {}
 
   virtual ~PartSet_WidgetShapeSelector() {}
 
-  /// Saves the internal parameters to the given feature
   virtual bool storeValue() const;
 
+  /// Set sketcher
+  /// \param theSketch a sketcher object
   void setSketcher(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
+
+  /// Retrurns installed sketcher
   CompositeFeaturePtr sketch() const { return mySketch; }
 
 protected:
@@ -35,14 +49,24 @@ protected:
   virtual bool isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape);
 
 private:
+  /// Pointer to a sketch 
   CompositeFeaturePtr mySketch;
 };
 
-
+/**
+* \ingroup Modules
+* Customosation of ModuleBase_WidgetShapeSelector in order to provide 
+* working with constraints.
+*/
 class PARTSET_EXPORT PartSet_WidgetConstraintShapeSelector: public ModuleBase_WidgetShapeSelector
 {
 Q_OBJECT
  public:
+  /// Constructor
+  /// \param theParent the parent object
+  /// \param theWorkshop instance of workshop interface
+  /// \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_WidgetConstraintShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
     const Config_WidgetAPI* theData, const std::string& theParentId)
     : ModuleBase_WidgetShapeSelector(theParent, theWorkshop, theData, theParentId) {}
@@ -52,10 +76,15 @@ Q_OBJECT
   /// Saves the internal parameters to the given feature
   virtual bool storeValue() const;
 
+  /// Set sketcher
+  /// \param theSketch a sketcher object
   void setSketcher(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
+
+  /// Retrurns installed sketcher
   CompositeFeaturePtr sketch() const { return mySketch; }
 
 private:
+  /// Pointer to a sketch 
   CompositeFeaturePtr mySketch;
 };
 
index bf48108641a3d72338b4904b8d7e1931c75a2314..afe12cd2d39ce60e64dc1994fcb02387218cf796 100644 (file)
@@ -131,7 +131,7 @@ std::shared_ptr<GeomAPI_Pln> PartSet_WidgetSketchLabel::plane() const
 
 }
 
-void PartSet_WidgetSketchLabel::activate()
+void PartSet_WidgetSketchLabel::activateCustom()
 {
   std::shared_ptr<GeomAPI_Pln> aPlane = plane();
   if (aPlane) {
index 0dbc1da33c9c93caf3c0a256d829b74332166baa..9c9ffad2cc8a4007c626792c5d06b205821b9e44 100644 (file)
@@ -24,17 +24,24 @@ class QTimer;
 class XGUI_OperationMgr;
 class XGUI_Workshop;
 
+/**
+* \ingroup Modules
+* A model widget implementation for a label which provides specific behaviour 
+* for sketcher starting and launching operations
+*/
 class PARTSET_EXPORT PartSet_WidgetSketchLabel : public ModuleBase_ModelWidget
 {
 Q_OBJECT
  public:
+  /// Constructor
+  /// \param theParent the parent 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_WidgetSketchLabel(QWidget* theParent, const Config_WidgetAPI* theData,
                             const std::string& theParentId);
 
   virtual ~PartSet_WidgetSketchLabel();
 
-  /// Saves the internal parameters to the given feature
-  /// \param theFeature a model feature to be changed
   virtual bool storeValue() const
   {
     return true;
@@ -51,33 +58,51 @@ Q_OBJECT
 
   QWidget* getControl() const;
 
-  /// The methiod called when widget is activated
-  virtual void activate();
-
   /// The methiod called when widget is deactivated
   virtual void deactivate();
 
+  /// Returns pointer to workshop
   XGUI_Workshop* workshop() const { return myWorkshop; }
 
+  /// Set pointer to workshop
+  /// \param theWork a pointer to workshop
   void setWorkshop(XGUI_Workshop* theWork) { myWorkshop = theWork; }
 
+  /// Returns sketcher plane
   std::shared_ptr<GeomAPI_Pln> plane() const;
 
 signals:
+  /// Signal on plane selection
   void planeSelected(const std::shared_ptr<GeomAPI_Pln>& thePln);
 
+protected:
+  /// The methiod called when widget is activated
+  virtual void activateCustom();
+
  private slots:
+   /// Slot on plane selection
   void onPlaneSelected();
+
+  /// Set sketch specific mode of selection
   void setSketchingMode();
 
  private:
+   /// Create preview of planes for sketch plane selection
+   /// \param theOrigin an origin of the plane
+   /// \param theNorm a normal vector of the plane
+   /// \param theRGB a color of plane presentation [r, g, b] array
   AISObjectPtr createPreviewPlane(std::shared_ptr<GeomAPI_Pnt> theOrigin, 
                                   std::shared_ptr<GeomAPI_Dir> theNorm, 
                                   const int theRGB[3]);
 
+  /// Set sketch plane by shape
+  /// \param theShape a planar face
   std::shared_ptr<GeomAPI_Dir> setSketchPlane(const TopoDS_Shape& theShape);
 
+  /// Erase preview planes
   void erasePreviewPlanes();
+
+  /// Show preview planes
   void showPreviewPlanes();
 
 
index 59ace5aa844925d932003f95b08eb89d41727d25..834c7c8a306b487271467ca9bef55574edb1475f 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <memory>
 
-/**\class FeaturesPlugin_Plugin
+/**\class PartSetPlugin_Plugin
  * \ingroup Plugins
  * \brief The main class for management the part set operations as plugin.
  */
@@ -32,6 +32,8 @@ class PARTSETPLUGIN_EXPORT PartSetPlugin_Plugin : public ModelAPI_Plugin,
 
   //! Redefinition of Events_Listener method
   virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
+  //! Performs the chenges of enabled/disabled state in the toolbar
+  //! due to the current state of the application.
   std::shared_ptr<ModelAPI_FeatureStateMessage> getFeaturesState();
 };
 
index c7af183f4e104de9ded8fb8a1d6fce0cf1e5a3ae..bb620cd7379412c2251ef8dbb4191562b90f6894 100644 (file)
@@ -14,12 +14,15 @@ class QContextMenuEvent;
 class QMenu;
 
 /**
+ * \ingroup GUI
  * A claas wihich provides manement of context menu
  */
 class XGUI_EXPORT XGUI_ContextMenuMgr : public QObject
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theParent a parent object
   XGUI_ContextMenuMgr(XGUI_Workshop* theParent);
   virtual ~XGUI_ContextMenuMgr();
 
@@ -27,6 +30,7 @@ Q_OBJECT
   void createActions();
 
   /// Returns action according to the given ID
+  /// \param theId an id of an action
   QAction* action(const QString& theId) const;
 
   /// Returns list of registered actions Ids
@@ -42,14 +46,22 @@ Q_OBJECT
   void connectViewer() const;
 
   /// Add menu atems for viewer into the given menu (used in SALOME mode)
+  /// \param theMenu a menu instance
   void addViewerItems(QMenu* theMenu) const;
 
 signals:
+  /// Signal aabout triggered action
+  /// \param theId an id of triggered action
+  /// \param isChecked is checked flag
   void actionTriggered(const QString& theId, bool isChecked);
 
  private slots:
+   /// Process action event
+   /// \param isChecked a checked action flag
   void onAction(bool isChecked);
 
+  /// Process context menu event
+  /// \param theEvent a context menu event
   void onContextMenuRequest(QContextMenuEvent* theEvent);
 
  private:
@@ -60,11 +72,16 @@ signals:
    */
   void addAction(const QString& theId, QAction* theAction);
 
+  /// Creates menu for object browser
   QMenu* objectBrowserMenu() const;
+
+  /// Creates menu for viewer
   QMenu* viewerMenu() const;
 
+  /// Map of created actions [id : Action]
   QMap<QString, QAction*> myActions;
 
+  /// Reference to workshop
   XGUI_Workshop* myWorkshop;
 };
 
index 72a3d93f5f4019787a1d1753a1acccb09d4d85f9..fb28e59f8406154317e05ff487e3527ef13c7482 100644 (file)
@@ -19,6 +19,8 @@
 class XGUI_EXPORT XGUI_FeaturesModel : public QAbstractItemModel
 {
  public:
+   /// Constructor
+   /// \param theParent a parent object
   XGUI_FeaturesModel(QObject* theParent)
       : QAbstractItemModel(theParent),
         myItemsColor(Qt::black)
@@ -27,6 +29,7 @@ class XGUI_EXPORT XGUI_FeaturesModel : public QAbstractItemModel
 
   //! 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
@@ -37,19 +40,23 @@ class XGUI_EXPORT XGUI_FeaturesModel : public QAbstractItemModel
   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;
 };
 
@@ -60,17 +67,22 @@ class XGUI_EXPORT XGUI_FeaturesModel : public QAbstractItemModel
 class XGUI_PartModel : public XGUI_FeaturesModel
 {
  public:
+   /// Constructor
+   /// \param theParent a parent object
   XGUI_PartModel(QObject* theParent)
       : XGUI_FeaturesModel(theParent)
   {
   }
 
+  /// Set part id
+  /// \param theId a new id
   void setPartId(int theId)
   {
     myId = theId;
   }
 
   //! 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;
 
   //! Return a Part object
index cab65bc08482e14ab69d345d0552761245f01289..401d1d3cafeb4997285ac69078ff9fbc24e625bc 100644 (file)
@@ -41,6 +41,8 @@
 
 const int MOUSE_SENSITIVITY_IN_PIXEL = 10;  ///< defines the local context mouse selection sensitivity
 
+//#define DEBUG_DISPLAY
+//#define DEBUG_ACTIVATE
 
 // Workaround for bug #25637
 void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList)
@@ -85,6 +87,14 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool isUpdateViewer)
   if (isVisible(theObject)) {
     redisplay(theObject, isUpdateViewer);
   } else {
+#ifdef DEBUG_DISPLAY
+    FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+    if (aFeature.get() != NULL) {
+      qDebug(QString("display feature: %1, displayed: %2").
+        arg(aFeature->data()->name().c_str()).
+        arg(displayedObjects().size()).toStdString().c_str());
+    }
+#endif
     AISObjectPtr anAIS;
 
     GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
@@ -159,7 +169,9 @@ void XGUI_Displayer::display(ObjectPtr theObject, AISObjectPtr theAIS,
       activateObjects(myActiveSelectionModes);
       myWorkshop->selector()->setSelectedOwners(aSelectedOwners, false);
     }
-  }
+    else
+      activate(anAISIO, myActiveSelectionModes);
+ }
   if (isUpdateViewer)
     updateViewer();
 }
@@ -245,13 +257,29 @@ void XGUI_Displayer::deactivate(ObjectPtr theObject)
   }
 }
 
-void XGUI_Displayer::activate(ObjectPtr theFeature)
+/*void XGUI_Displayer::activate(ObjectPtr theFeature)
 {
   activate(theFeature, myActiveSelectionModes);
 }
 
 void XGUI_Displayer::activate(ObjectPtr theObject, const QIntList& theModes)
 {
+#ifdef DEBUG_ACTIVATE
+    FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+
+    if (aFeature.get() != NULL) {
+      QIntList aModes;
+      getModesOfActivation(theObject, aModes);
+
+
+      qDebug(QString("activate feature: %1, theModes: %2, myActiveSelectionModes: %3, getModesOf: %4").
+        arg(aFeature->data()->name().c_str()).
+        arg(theModes.size()).
+        arg(myActiveSelectionModes.size()).
+        arg(aModes.size()).toStdString().c_str());
+    }
+#endif
+
   if (isVisible(theObject)) {
     Handle(AIS_InteractiveContext) aContext = AISContext();
     if (aContext.IsNull())
@@ -259,20 +287,10 @@ void XGUI_Displayer::activate(ObjectPtr theObject, const QIntList& theModes)
 
     AISObjectPtr anObj = myResult2AISObjectMap[theObject];
     Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
-    aContext->Deactivate(anAIS);
-    aContext->Load(anAIS, -1, true);
-    // In order to clear active modes list
-    if (theModes.size() > 0) {
-      foreach(int aMode, theModes) {
-        //aContext->Load(anAIS, aMode, true);
-        aContext->Activate(anAIS, aMode);
-      }
-    } else {
-      //aContext->Load(anAIS, 0, true);
-      aContext->Activate(anAIS);
-    }
+
+    activate(anAIS, theModes);
   }
-}
+}*/
 
 void XGUI_Displayer::getModesOfActivation(ObjectPtr theObject, QIntList& theModes)
 {
@@ -298,6 +316,12 @@ void XGUI_Displayer::getModesOfActivation(ObjectPtr theObject, QIntList& theMode
 
 void XGUI_Displayer::activateObjects(const QIntList& theModes)
 {
+#ifdef DEBUG_ACTIVATE
+  qDebug(QString("activate all features: theModes: %2, myActiveSelectionModes: %3").
+    arg(theModes.size()).
+    arg(myActiveSelectionModes.size()).
+    toStdString().c_str());
+#endif
   // In order to avoid doblications of selection modes
   QIntList aNewModes;
   foreach (int aMode, theModes) {
@@ -323,23 +347,7 @@ void XGUI_Displayer::activateObjects(const QIntList& theModes)
   Handle(AIS_InteractiveObject) anAISIO;
   for(aLIt.Initialize(aPrsList); aLIt.More(); aLIt.Next()){
     anAISIO = aLIt.Value();
-    aContext->Load(anAISIO, -1, true);
-    aContext->Deactivate(anAISIO);
-    aTrihedron = Handle(AIS_Trihedron)::DownCast(anAISIO);
-    //Deactivate trihedron which can be activated in local selector
-    if (aTrihedron.IsNull()) {
-      //aContext->Load(anAISIO, -1, true);
-      // In order to clear active modes list
-      if (myActiveSelectionModes.size() == 0) {
-        //aContext->Load(anAISIO, 0, true);
-        aContext->Activate(anAISIO);
-      } else {
-        foreach(int aMode, myActiveSelectionModes) {
-          //aContext->Load(anAISIO, aMode, true);
-          aContext->Activate(anAISIO, aMode);
-        }
-      }
-    }
+    activate(anAISIO, myActiveSelectionModes);
   }
 }
 
@@ -720,3 +728,29 @@ bool XGUI_Displayer::canBeShaded(ObjectPtr theObject) const
   Handle(AIS_InteractiveObject) anAIS = aAISObj->impl<Handle(AIS_InteractiveObject)>();
   return ::canBeShaded(anAIS);
 }
+
+void XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO,
+                              const QIntList& theModes) const
+{
+  Handle(AIS_InteractiveContext) aContext = AISContext();
+  if (aContext.IsNull() || theIO.IsNull())
+    return;
+
+  aContext->Load(theIO, -1, true);
+  aContext->Deactivate(theIO);
+  Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(theIO);
+  //Deactivate trihedron which can be activated in local selector
+  if (aTrihedron.IsNull()) {
+    //aContext->Load(anAISIO, -1, true);
+    // In order to clear active modes list
+    if (theModes.size() == 0) {
+      //aContext->Load(anAISIO, 0, true);
+      aContext->Activate(theIO);
+    } else {
+      foreach(int aMode, theModes) {
+        //aContext->Load(anAISIO, aMode, true);
+        aContext->Activate(theIO, aMode);
+      }
+    }
+  }
+}
index b917e55eb6e70e314d2a54b0700f6ad3738885f1..85900ddb30cd44942786e9f49e8ce58083b0da35 100644 (file)
@@ -139,7 +139,7 @@ class XGUI_EXPORT XGUI_Displayer
   /// Activates the given object (it can be selected)
   /// \param theObject object to activate
   /// \param theModes - modes on which it has to be activated (can be empty)
-  void activate(ObjectPtr theObject, const QIntList& theModes);
+  //void activate(ObjectPtr theObject, const QIntList& theModes);
 
   /// Returns the modes of activation
   /// \param theObject the feature or NULL if it not visualized
@@ -148,7 +148,7 @@ class XGUI_EXPORT XGUI_Displayer
 
   /// Activates the given object with default modes
   /// \param theObject object to activate
-  void activate(ObjectPtr theObject);
+  //void activate(ObjectPtr theObject);
 
   /// Returns true if the given object can be selected
   /// \param theObject object to check
@@ -206,6 +206,11 @@ class XGUI_EXPORT XGUI_Displayer
    */
   void redisplay(ObjectPtr theObject, bool isUpdateViewer = true);
 
+  /// Activates the interactive object in the local context.
+  /// \param theIO an interactive object
+  /// \param theModes - modes on which it has to be activated (can be empty)
+  void activate(const Handle(AIS_InteractiveObject)& theIO, const QIntList& theModes) const;
+
   /// Opens local context. Does nothing if it is already opened.
   void openLocalContext();
 
index 0b3f35fd1797b3b09b47ac25a1f612fd3ffdcbf2..63fa17a9ff61e06dad3153b71c78e7749b618075 100644 (file)
@@ -25,45 +25,86 @@ class XGUI_EXPORT XGUI_DocumentDataModel : public QAbstractItemModel, public Eve
 {
 Q_OBJECT
  public:
-
+   /// Constructor
+   /// \param theParent a parent object
   XGUI_DocumentDataModel(QObject* theParent);
   virtual ~XGUI_DocumentDataModel();
 
-  // Event Listener method
+  /// 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;
 
-  virtual QModelIndex index(int theRow, int theColumn, const QModelIndex &parent =
+  /// 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
   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
   ObjectPtr object(const QModelIndex& theIndex) const;
 
+  //! Returns index of the object
+  //! \param theObject object to find
   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 activatedIndex(const QModelIndex& theIndex);
 
   //! Retrurns active part
@@ -78,6 +119,7 @@ Q_OBJECT
   //! Deactivates a Part
   void deactivatePart();
 
+  //! Rebuild data tree
   void rebuildDataTree();
 
   //! Clear internal data
index b442effba67fe4925700daca9b750bafd3aa4e69..628495e2c496299cb0e0de459850febd73e1211f 100644 (file)
@@ -16,6 +16,7 @@
 class QTextEdit;
 
 /**
+* \ingroup GUI
 * A class of dialog to show error message
 */
 class XGUI_ErrorDialog : public QDialog
index ab3b09a17231ae22e6cb01d5e5cd19600f6e52b8..266967988e30ac953518ffa2c47e704f02e3d26f 100644 (file)
@@ -17,12 +17,15 @@ class XGUI_Workshop;
 class XGUI_Displayer;
 
 /**
+ * \ingroup GUI
  * Implementation of IWorkshop interface which provides access to Workshop sevices at module level
  */
 class XGUI_EXPORT XGUI_ModuleConnector : public ModuleBase_IWorkshop
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theWorkshop a workshop
   XGUI_ModuleConnector(XGUI_Workshop* theWorkshop);
 
   virtual ~XGUI_ModuleConnector();
@@ -59,9 +62,11 @@ Q_OBJECT
   //! If the list is empty then selection will be cleared
   virtual void setSelected(const QObjectPtrList& theFeatures);
 
+  //! Returns workshop
   XGUI_Workshop* workshop() const { return myWorkshop; }
 
 private:
+  /// Reference to workshop
   XGUI_Workshop* myWorkshop;
 
   /// A filter which provides selection within a current document or whole PartSet
index 859c0da92888aca8f62c4198b75b1cad1b00aefb..fa74ed50313618c714699ef4699d11c6714564fe 100644 (file)
@@ -13,7 +13,7 @@
 #include <QKeyEvent>
 
 XGUI_OperationMgr::XGUI_OperationMgr(QObject* theParent)
-    : QObject(theParent), myIsValidationLock(false)
+    : QObject(theParent), myIsValidationLock(false), myIsApplyEnabled(false)
 {
 }
 
index f5683f81aa5f4b3300397ac42b5a8ea8d9078e30..04505fed023b8cd29576f60dae71a8e308734a81 100644 (file)
@@ -63,6 +63,7 @@ Q_OBJECT
   /// else, or if there is no parent - returns NULL
   ModuleBase_Operation* previousOperation(ModuleBase_Operation* theOperation) const;
 
+  /// Redefinition of virtual function
   virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
 
   /// Start the operation and append it to the stack of operations
@@ -70,6 +71,7 @@ Q_OBJECT
   /// \return the state whether the current operation is started
   bool startOperation(ModuleBase_Operation* theOperation);
 
+  /// Abort all operations
   bool abortAllOperations();
 
   /// Returns whether the operation can be started. Check if there is already started operation and
@@ -133,15 +135,13 @@ signals:
 
   /// Commits the current operatin if it is valid
   bool commitOperation();
+
   /// Sets the current operation or NULL
   /// \param theOperation the started operation
-  /// \param isCheckBeforeStart the flag whether to check whether the operation can be started
-  /// \return the state whether the operation is resumed
   void resumeOperation(ModuleBase_Operation* theOperation);
 
  public slots:
   /// SLOT, that is called by the key in the property panel is clicked.
-  /// \param theName the attribute name
   /// \param theEvent the mouse event
   bool onKeyReleased(QKeyEvent* theEvent);
 
@@ -149,9 +149,17 @@ signals:
   /// Slot that is called by an operation stop. Removes the stopped operation form the stack.
   /// If there is a suspended operation, restart it.
   void onOperationStopped();
+
+  /// Slot called on operation start
   void onOperationStarted();
+
+  /// Slot called on operation abort
   void onOperationAborted();
+
+  /// Slot called on operation commit
   void onOperationCommitted();
+
+  /// Slot called on operation resume
   void onOperationResumed();
 
  private:
index 4ef9cd58fe5e77611c73fb0f32d3fd04994183b1..56f28ad5e441a6d2229d9e4454e7751187c33bf6 100644 (file)
@@ -15,22 +15,50 @@ class XGUI_EXPORT XGUI_TopDataModel : public XGUI_FeaturesModel
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theParent a parent object
   XGUI_TopDataModel(QObject* theParent);
   virtual ~XGUI_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;
-  virtual QVariant headerData(int section, Qt::Orientation orientation,
-                              int role = Qt::DisplayRole) const;
 
-  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
-  virtual int columnCount(const QModelIndex &parent = QModelIndex()) 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.
@@ -70,22 +98,49 @@ class XGUI_PartDataModel : public XGUI_PartModel
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theParent a parent object
   XGUI_PartDataModel(QObject* theParent);
   virtual ~XGUI_PartDataModel();
 
   // Reimpl from QAbstractItemModel
-  virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
-  virtual QVariant headerData(int section, Qt::Orientation orientation,
-                              int role = Qt::DisplayRole) const;
 
-  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
-  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
+  /// 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.
@@ -113,6 +168,7 @@ Q_OBJECT
   //! Returns document of the current part
   DocumentPtr partDocument() const;
 
+  //! Returns defult number of rows
   int getRowsNumber() const;
 
   //! Types of QModelIndexes
index e632fe28d47dee3418d0a5aea74066cf7d7b261c..c202af395b6a2055510138899dc168884536dad3 100644 (file)
@@ -30,6 +30,7 @@ const static char* PROP_PANEL_OK = "property_panel_ok";
 const static char* PROP_PANEL_CANCEL = "property_panel_cancel";
 
 /**
+* \ingroup GUI
 * Realization of Property panel object.
 */
 class XGUI_EXPORT XGUI_PropertyPanel : public ModuleBase_IPropertyPanel
index f7c2211bd55ed05edc29c1240105d9c865c67350..0a3528bd70a16324dbda57380b49215680ac197c 100644 (file)
 #include <QString>
 
 /**
+* \ingroup GUI
 * Class of event to send application events in multi thread environment
 */
 class XGUI_EXPORT PostponeMessageQtEvent : public QEvent
 {
  public:
+   /// An event type
   static QEvent::Type PostponeMessageQtEventType;
 
   /// Constructor
index 13ce80b05e6d4a02fd35c260a1ddc226ca9bf140..10d663b4f039298a03402a2bdbb72b7437f84912 100644 (file)
@@ -12,6 +12,7 @@ class QMainWindow;
 class ModuleBase_IViewer;
 
 /**
+ * \ingroup GUI
  * An interface which provides a connection of XGUI functionality 
  * with functionality of SALOME module interface.
  */
@@ -85,6 +86,7 @@ class XGUI_EXPORT XGUI_SalomeConnector
   //! Returns interface to Salome viewer
   virtual ModuleBase_IViewer* viewer() const = 0;
 
+  //! Create preferences
   virtual void createPreferences() = 0;
 };
 
index 5c3eb4a41309299f28ba1b538dc54e750b50385f..f766841d6edea79f9134a863816e55bd52b400ad 100644 (file)
@@ -23,6 +23,7 @@
 class XGUI_Workshop;
 
 /**
+* \ingroup GUI
 * Implementation of \ref ModuleBase_ISelection interface.
 */
 class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection
index 6503f175d93b27fa53d1f694b89d6929837d4b5f..98755ea20078afe8f50a0c7a001a35100a837376 100644 (file)
@@ -26,9 +26,12 @@ class XGUI_EXPORT XGUI_SelectionMgr : public QObject
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theParent a parent workshop
   XGUI_SelectionMgr(XGUI_Workshop* theParent);
   virtual ~XGUI_SelectionMgr();
 
+  /// Returns current selection
   XGUI_Selection* selection() const
   {
     return mySelection;
@@ -52,11 +55,17 @@ signals:
   void selectionChanged();
 
  private slots:
+   /// Reaction on selectio0n in Object browser
   void onObjectBrowserSelection();
+
+   /// Reaction on selectio0n in Viewer
   void onViewerSelection();
 
  private:
+   /// Reference to workshop
   XGUI_Workshop* myWorkshop;
+
+  /// Current selection object
   XGUI_Selection* mySelection;
 };
 
index 614b2be23ca15f8ac8b5e0fc79f195bbacd9aec6..7db64558ac26448911c1dd19bbbf343af1116f1f 100644 (file)
@@ -12,6 +12,7 @@
 #include <memory>
 
 /*!
+ \ingroup GUI
  \brief Return directory part of the file path.
 
  If the file path does not include directory part (the file is in the
  \return directory part of the file path
  */
 namespace XGUI_Tools {
+
+/**
+* Returns directory name from name of file
+* \param path a path to a file
+* \param isAbs is absolute or relative path
+*/
 QString XGUI_EXPORT dir(const QString& path, bool isAbs = true);
 
 /*!
index 7cd1f90d6e7b8e3bb9bb439d1962a33ef6b446de..e0894ff0f06724e4d6403102350e2925343a97b4 100644 (file)
@@ -10,6 +10,7 @@ class XGUI_Workshop;
 class AppElements_ViewWindow;
 
 /**
+ * \ingroup GUI
  * Proxy class which repersents or AppElements_Viewer or Salome Viewer
  * dependently on current launching environment.
  * It is reccomennded to use this class in operation for accessing to viewer 
@@ -19,6 +20,8 @@ class XGUI_EXPORT XGUI_ViewerProxy : public ModuleBase_IViewer
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theParent a parent object
   XGUI_ViewerProxy(XGUI_Workshop* theParent);
 
   //! Returns AIS_InteractiveContext from current OCCViewer
index d11c8043a05db60aa90bd3e2c426defc5789f426..4022d7fc70d4e4cb0750393b73cddf4e75dbbad9 100644 (file)
@@ -480,6 +480,7 @@ void XGUI_Workshop::onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectU
   std::set<ObjectPtr>::const_iterator aIt;
   for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
     ObjectPtr aObj = (*aIt);
+
     bool aHide = !aObj->data() || !aObj->data()->isValid();
     if (!aHide) { // check that this is not hidden result
       ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
@@ -499,8 +500,7 @@ void XGUI_Workshop::onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectU
       } else {
         if (myOperationMgr->hasOperation()) {
           ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
-          // Display only current operation results if operation has preview
-          if (aOperation->hasObject(aObj)/* && aOperation->hasPreview()*/) {
+          if (myModule->canDisplayObject(aObj)) {
             displayObject(aObj);
             // Deactivate object of current operation from selection
             if (myDisplayer->isActive(aObj))
@@ -522,17 +522,15 @@ void XGUI_Workshop::onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpd
   bool aHasPart = false;
   bool isDisplayed = false;
   for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
+
     ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aIt);
     if (aPart) {
       aHasPart = true;
       // If a feature is created from the aplication's python console  
       // it doesn't stored in the operation mgr and doesn't displayed
-    } else if (myOperationMgr->hasOperation()) {
-      ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
-      if (aOperation->hasObject(*aIt)) {  // Display only current operation results
-        displayObject(*aIt);
-        isDisplayed = true;
-      }
+    } else if (myModule->canDisplayObject(*aIt)) {
+      displayObject(*aIt);
+      isDisplayed = true;
     }
   }
   if (myObjectBrowser)
@@ -1245,17 +1243,17 @@ void XGUI_Workshop::activatePart(ResultPartPtr theFeature)
 }
 
 //**************************************************************
-void XGUI_Workshop::activateLastPart()
-{
-  SessionPtr aMgr = ModelAPI_Session::get();
-  DocumentPtr aDoc = aMgr->moduleDocument();
-  std::string aGrpName = ModelAPI_ResultPart::group();
-  ObjectPtr aLastPart = aDoc->object(aGrpName, aDoc->size(aGrpName) - 1);
-  ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aLastPart);
-  if (aPart) {
-    activatePart(aPart);
-  }
-}
+//void XGUI_Workshop::activateLastPart()
+//{
+//  SessionPtr aMgr = ModelAPI_Session::get();
+//  DocumentPtr aDoc = aMgr->moduleDocument();
+//  std::string aGrpName = ModelAPI_ResultPart::group();
+//  ObjectPtr aLastPart = aDoc->object(aGrpName, aDoc->size(aGrpName) - 1);
+//  ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aLastPart);
+//  if (aPart) {
+//    activatePart(aPart);
+//  }
+//}
 
 //**************************************************************
 void XGUI_Workshop::deleteObjects(const QObjectPtrList& theList)
index 13fa9039e7678785499ee88cc36efd7260f9558a..34ce06b91568e4483d9c0d03e458429d644d9bd4 100644 (file)
@@ -55,7 +55,9 @@ class XGUI_EXPORT XGUI_Workshop : 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
   XGUI_Workshop(XGUI_SalomeConnector* theConnector = 0);
   virtual ~XGUI_Workshop();
 
@@ -131,8 +133,10 @@ Q_OBJECT
     return myObjectBrowser;
   }
 
+  /// This method is called by Salome module when selection is changed
   void salomeViewerSelectionChanged();
 
+  /// Returns viewer which unifies access as to Salome viewer as to standalone viewer
   XGUI_ViewerProxy* viewer() const
   {
     return myViewerProxy;
@@ -161,8 +165,12 @@ Q_OBJECT
   //! Show the given features in 3d Viewer
   void showOnlyObjects(const QObjectPtrList& theList);
 
+  /// Set display mode for the given onjects
+  /// \param theList a list of displayed objects
+  /// \param theMode a mode to set (see \ref XGUI_Displayer)
   void setDisplayMode(const QObjectPtrList& theList, int theMode);
 
+  /// Returns current module
   ModuleBase_IModule* module() const
   {
     return myModule;
@@ -181,7 +189,7 @@ Q_OBJECT
   */
   void saveDocument(const QString& theName, std::list<std::string>& theFileNames);
 
-  /*
+  /**
    * If there is an active (uncommited) operation shows a prompt to abort it
    * and performs abortion if user agreed. Returns true if
    * - operation aborted successfully
@@ -190,8 +198,12 @@ Q_OBJECT
   bool isActiveOperationAborted();
 
 signals:
+  /// Emitted when selection happens in Salome viewer
   void salomeViewerSelection();
+
+  /// Emitted when error in applivation happens
   void errorOccurred(const QString&);
+
   //! the signal about the workshop actions states are updated.
   void commandStatusUpdated();
 
@@ -199,53 +211,102 @@ signals:
   void applicationStarted();
 
  public slots:
+   /// Update of commands status
   void updateCommandStatus();
 
+  /// Create a new dokument
   void onNew();
+
+  /// Open document from file
   void onOpen();
+
+  /// Save current document
   bool onSave();
+
+  /// Save current document to a file selected by user
   bool onSaveAs();
+
+  /// Exit application
   void onExit();
+
+  /// Undo last command
   void onUndo();
+
+  /// Redo previous command
   void onRedo();
+
+  /// Rebuild data tree
   void onRebuild();
+
+  /// Open preferences dialog box
   void onPreferences();
 
+  /// Show property panel
   void showPropertyPanel();
+
+  /// Hide property panel
   void hidePropertyPanel();
+
+  /// Show object Browser
   void showObjectBrowser();
+
+  /// Hide object Browser
   void hideObjectBrowser();
 
+  /// Reaction on command call
   void onFeatureTriggered();
+
+  /// Change active document
+  /// \param theObj a part object. If it is NULL then active document is a main document
   void changeCurrentDocument(ObjectPtr theObj);
 
-  void activateLastPart();
+  //void activateLastPart();
 
+  /// Close document
   void closeDocument();
 
  protected:
-  // Find the nested features and set them into the operation
-  // \param theOperation an operation
+  /// Find the nested features and set them into the operation
+  /// \param theOperation an operation
   void setNestedFeatures(ModuleBase_Operation* theOperation);
-  // Update the property panel content by the XML description of the operation and set the panel
-  // into the operation
-  // \param theOperation an operation
+
+  /// Update the property panel content by the XML description of the operation and set the panel
+  /// into the operation
+  /// \param theOperation an operation
   void setPropertyPanel(ModuleBase_Operation* theOperation);
 
+  /// Procedure to process postponed events
   bool event(QEvent * theEvent);
+
   //Event-loop processing methods:
+
+  /// Process event "Add a feature"
   void addFeature(const std::shared_ptr<Config_FeatureMessage>&);
+
+  /// Connect to operation signals
+  /// \param theOperation an operation
   void connectWithOperation(ModuleBase_Operation* theOperation);
 
-  void onFeatureUpdatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
-  void onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
-  void onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg);
-  void onObjectDeletedMsg(const std::shared_ptr<ModelAPI_ObjectDeletedMessage>& theMsg);
+  /// Process feature update message
+  void onFeatureUpdatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& );
 
-  void validateOperation(const QString& theOperationId);
+  ///Process feature created message
+  void onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& );
 
+  /// Process feature redisplay message
+  void onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& );
+
+  /// Process feature delete message
+  void onObjectDeletedMsg(const std::shared_ptr<ModelAPI_ObjectDeletedMessage>& );
+
+  /// Display all results
   void displayAllResults();
+
+  /// Displau results from document
+  /// \param theDoc a document
   void displayDocumentResults(DocumentPtr theDoc);
+
+  /// Display results from a group
   void displayGroupResults(DocumentPtr theDoc, std::string theGroup);
 
  private slots:
@@ -272,21 +333,37 @@ signals:
   /// \param theOpertion an aborted operation
   void onOperationAborted(ModuleBase_Operation* theOperation);
 
+  /// Process context menu command
+  /// \param theId id of the command
+  /// \param isChecked is checked flag
   void onContextMenuCommand(const QString& theId, bool isChecked);
 
+  /// Processing of values changed in model widget
   void onWidgetValuesChanged();
 
+  /// Set waiting cursor
   void onStartWaiting();
 
  private:
+   /// Init menu
   void initMenu();
 
+  /// Register validators
   void registerValidators() const;
 
+  /// Load module from external library
+  /// \param theModule name of the module
   ModuleBase_IModule* loadModule(const QString& theModule);
+
+  /// Activate module
   bool activateModule();
 
+  /// Create object browser widget
+  /// \param theParent a parent of widget
   QDockWidget* createObjectBrowser(QWidget* theParent);
+
+  /// Create property panel widget
+  /// \param theParent a parent of widget
   QDockWidget* createPropertyPanel(QWidget* theParent);
 
   // Creates Dock widgets: Object browser and Property panel