]> 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>
Wed, 28 Jan 2015 12:34:36 +0000 (15:34 +0300)
committersbh <sergey.belash@opencascade.com>
Wed, 28 Jan 2015 12:34:36 +0000 (15:34 +0300)
77 files changed:
doc/Modules.doc [new file with mode: 0644]
doc/doxyfile.in
doc/general_architecture.doc [new file with mode: 0644]
doc/general_architecture_1.png [new file with mode: 0644]
doc/index.doc [new file with mode: 0644]
src/ConstructionPlugin/ConstructionPlugin_Axis.h
src/ConstructionPlugin/ConstructionPlugin_Plane.h
src/ConstructionPlugin/ConstructionPlugin_Point.h
src/GeomAPI/CMakeLists.txt
src/GeomAPI/GeomAPI_ICustomPrs.cpp [new file with mode: 0644]
src/GeomAPI/GeomAPI_ICustomPrs.h
src/GeomAlgoAPI/GeomAlgoAPI_BREPImport.h
src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h
src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.h
src/GeomAlgoAPI/GeomAlgoAPI_STEPImport.h
src/ModuleBase/ModuleBase_FilterNoConsructionSubShapes.h
src/ModuleBase/ModuleBase_IPropertyPanel.h
src/ModuleBase/ModuleBase_ISelection.h
src/ModuleBase/ModuleBase_Preferences.cpp
src/ModuleBase/ModuleBase_Preferences.h
src/ModuleBase/ModuleBase_ResultPrs.h
src/ModuleBase/ModuleBase_ViewerFilters.h
src/ModuleBase/ModuleBase_WidgetBoolValue.h
src/ModuleBase/ModuleBase_WidgetChoice.h
src/ModuleBase/ModuleBase_WidgetEditor.h
src/ModuleBase/ModuleBase_WidgetFactory.cpp
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.h
src/ModuleBase/ModuleBase_WidgetSwitch.h
src/NewGeom/NewGeom_DataModel.h
src/NewGeom/NewGeom_OCCSelector.h
src/NewGeom/NewGeom_SalomeViewer.h
src/PartSet/PartSet_Module.cpp
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_WidgetPoint2d.cpp
src/PartSet/PartSet_WidgetPoint2dDistance.cpp
src/PartSet/PartSet_WidgetShapeSelector.cpp
src/PartSet/PartSet_WidgetShapeSelector.h
src/PartSetPlugin/PartSetPlugin_Duplicate.h
src/PartSetPlugin/PartSetPlugin_Part.h
src/PartSetPlugin/PartSetPlugin_Remove.h
src/SketchPlugin/SketchPlugin_Arc.h
src/SketchPlugin/SketchPlugin_Circle.h
src/SketchPlugin/SketchPlugin_ConstraintBase.h
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.h
src/SketchPlugin/SketchPlugin_ConstraintDistance.h
src/SketchPlugin/SketchPlugin_ConstraintLength.h
src/SketchPlugin/SketchPlugin_ConstraintParallel.h
src/SketchPlugin/SketchPlugin_ConstraintPerpendicular.h
src/SketchPlugin/SketchPlugin_ConstraintRadius.h
src/SketchPlugin/SketchPlugin_ConstraintRigid.h
src/SketchPlugin/SketchPlugin_Feature.h
src/SketchPlugin/SketchPlugin_Line.h
src/SketchPlugin/SketchPlugin_Plugin.h
src/SketchPlugin/SketchPlugin_Point.h
src/SketchPlugin/SketchPlugin_Sketch.h
src/SketchPlugin/SketchPlugin_Validators.cpp
src/SketchPlugin/SketchPlugin_Validators.h
src/SketchPlugin/plugin-Sketch.xml
src/SketchSolver/SketchSolver_Constraint.h
src/SketchSolver/SketchSolver_ConstraintGroup.h
src/SketchSolver/SketchSolver_ConstraintManager.h
src/XGUI/XGUI_ActionsMgr.h
src/XGUI/XGUI_ErrorDialog.h
src/XGUI/XGUI_ObjectsBrowser.h
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_OperationMgr.h
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_QtEvents.h
src/XGUI/XGUI_SelectionMgr.cpp
src/XGUI/XGUI_SelectionMgr.h
src/XGUI/XGUI_Workshop.cpp

diff --git a/doc/Modules.doc b/doc/Modules.doc
new file mode 100644 (file)
index 0000000..0b41bfe
--- /dev/null
@@ -0,0 +1,80 @@
+// Special file to define and describe the modules (goups)
+
+/**
+ * \defgroup DataModel Data model
+ *
+ * \brief Structures for storage and management the application data.
+ * 
+ * Data structures are unified and splitted in universal <b>ModelAPI</b> package.
+ * The OCCT specialized implementation of ModelAPI interfaces is located in the <b>Model</b>.
+ * The geometrical primitives interfaces in <b>GeomAPI</b> package are supported by geometrical 
+ * persistence elements in <b>GeomDatAPI</b> interface and has OCCT-specific implementation in GeomData package.
+ *
+ */
+
+/**
+ * \defgroup DataAlgo Algorithms
+ *
+ * \brief Different algorithm used in the application
+ * 
+ * The geometrical algorithms implementation (basing on OCCT libraries) are located in <b>GeomAlgoAPI</b>.
+ *
+ */
+
+/**
+ * \defgroup Plugins Plugins
+ *
+ * \brief Implementation of specific features of the application is concentrated in plugins.
+ * 
+ * The C++ and Python features implementations are located in plugins: specially organized libraries
+ * and configuration files that allows to define the user interface and specific algorithms.
+ * There are many plugins that should be extended with the development of the application. The names
+ * of plugin-packages are ended with "Plugin" string:
+ * <b>PartSetPlugin</b>, <b>ConstructionPlugin</b>, <b>SketchPlugin</b>, <b>FeaturesPlugins</b>, etc.
+ *
+ */
+
+/**
+ * \defgroup GUI GUI of the application
+ *
+ * \brief Classes for griphic user interface definition
+ * 
+ * Classes of application windows definition, operations launching, 
+ * and objects presentations. It consists of two packages:
+ * - ModuleBase - level for modules definition
+ * - XGUI - implementation of Application GUI.
+ */
+
+/**
+ * \defgroup Salome A Salome connector
+ * 
+ * \brief A set of classes which provide wrapping of 
+ * OpenParts application as SALOME module
+ */
+
+/** 
+ * \defgroup Desktop Classes for standalone application
+ * 
+ * \brief This group contains classes for launching the application 
+ * in standalone desktop (without SALOME)
+ */
+
+/** 
+ * \defgroup Modules Modules
+ * 
+ * \brief Definition of a module as a set of classes for plugins management
+ */
+
+/**
+ * \defgroup Validators Validators
+ *
+ * \brief Implementation of internal logic of the feature
+ * 
+ * Validators are used for checking validity of the feature: each argument, 
+ * dependencies between the arguments. Validators are defined in the 
+ * configuration files and may be also used for selection filters (ModuleBase_SelectionValidator),
+ * passing configurable parameters from XML file to the feature implementation 
+ * (like in ExchangePlugin_ImportFormatValidator).
+ *
+ */
+
index c44dbe6f01411a6fd6d061215e4326bb7af707fc..56cda9b0b44b1a3038c99e06653e250347b36105 100644 (file)
@@ -669,7 +669,7 @@ WARN_LOGFILE           = log.txt
 # directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
-INPUT                  = @PROJECT_SOURCE_DIR@/src
+INPUT                  = @PROJECT_SOURCE_DIR@/src @CMAKE_CURRENT_SOURCE_DIR@
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -690,7 +690,8 @@ INPUT_ENCODING         = UTF-8
 FILE_PATTERNS          = *.h \
                          *.cpp \
                          *.hxx \
-                         *.cxx
+                         *.cxx \
+                         *.doc
 
 # The RECURSIVE tag can be used to turn specify whether or not subdirectories
 # should be searched for input files as well. Possible values are YES and NO.
@@ -752,7 +753,7 @@ EXAMPLE_RECURSIVE      = NO
 # directories that contain image that are included in the documentation (see
 # the \image command).
 
-IMAGE_PATH             =
+IMAGE_PATH             = @CMAKE_CURRENT_SOURCE_DIR@
 
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
 # invoke to filter for each input file. Doxygen will invoke the filter program
diff --git a/doc/general_architecture.doc b/doc/general_architecture.doc
new file mode 100644 (file)
index 0000000..b7eaec9
--- /dev/null
@@ -0,0 +1,86 @@
+/*!
+\page general_architecture General Architecture
+
+New GEOM is used either as a stand-alone application or as a Module integrated to the SALOME environment in order to, ultimately, replace the old GEOM.
+
+<h2>Stand-alone New GEOM</h2>
+
+When used outside SALOME, New GEOM must be hosted by an application window implementing the general ergonomics of New GEOM (the GUI), including the layout of the user interface, organization of menus, runtime help, etc.
+\n
+It is proposed that this application window can host several so-called Modules. Below, this main application window is named the Workshop.
+\n\n
+Each Module hosted by the Workshop deals with one type of document (ModelAPI_Document) only, saved in a format supported by the Module. One document type per Module. Also, in a Workshop window, only one document of a given type can be newed. So, when launching the Workshop, the user selects a type of document to be created. Then, from the application session, creating a new document will launch a new instance of the Workshop.
+\n\n
+The geometric model (i.e. the whole geometry produce by New GEOM) is created through operations, or features (ModelAPI_Feature), which define a meaningful piece of design (e.g. PartSetPlugin_Part, FeaturesPlugin_Extrusion, FeaturesPlugin_Placement, etc.). In order to easily create dedicated variants of the modeler, also to gradually develop New GEOM, each feature is implemented in a <i>Plug-in</i> (ModelAPI_Plugin, a piece of application including its own GUI, built separately from the application. It is loaded dynamically to the application). In other words, a Module is made of a collection of Plug-ins.
+\n\n
+The Workshop structures the features by related functionality presented in a tabbed interface. Each tab displays a set of available actions. These sets of features are called below <i>Workbenches</i>.
+\n\n
+Additionally, a Module can either reference or include other Modules:
+<ul>
+<li>
+A Module references another one when the document it produces references a document created by the other Module.
+In this case, each document is edited from the corresponding Module running in separate instances of the Workshop. The Workbenches of each Module are presented into distinct windows.
+</li>
+<li>
+A Module include another Module when additionally, the Module of referenced document runs into the same Workshop.
+In this context, both documents can be edited from a single instance of the Workshop. The Workbenches of both Modules are presented into the same window.
+</li>
+</ul>
+
+
+
+<h2>Application to New GEOM</h2>
+
+New GEOM is made of one Module, Set of Parts (a Set of Parts is a flat list of Parts, on the contrary of an Assembly in which the Parts are structured), including two other Modules, <i>Part</i> and <i>Properties</i>. The Set of Parts Module produces a <i>PartSet</i> document which references a list of Parts (one document per Part), the PartSet document being referenced by a Properties document (one document per PartSet).
+\n\n
+The Set of Parts, its Properties and the Parts it references are all edited from the same Workshop window. The Properties and Part documents cannot be open independently of PartSet (the corresponding Modules being available only as included in Set of Parts).
+\n
+When creating a new PartSet, a Property document is automatically created. The Workbench of the Set of Parts Module includes a feature for creating a new Part. Once the first Part is created, the Workbenches of Part Module are activated. One Part of the ParSet being always active, the features of Part Module apply to this Part.
+\n
+When the user saves its session, all documents are saved: the PartSet, its Properties and each Part.
+\n\n
+\image html general_architecture_1.png
+\n
+
+<b>Summary of the general architecture of New GEOM:</b>
+<ul>
+<li> New GEOM consists of several Modules running within a Workshop.</li>
+<li> Each Module produces one type of Document only.</li>
+<li> A Module is made of Plug-in implementing the Features supported by the Module.</li>
+<li> These Features are structured by Workbenches.</li>
+<li> A Module can provide access to the Workbenches of other Modules by including these Modules.</li>
+<li> The Modules communicate with the Workshop through Interfaces.</li>
+<li> The API of New GEOM consists of the Interface of the Workshop and of Modules.</li>
+<li> A configuration file describes the composition of the Workshop where the Modules and the Plug-in are referenced by their Global Unique Identifier (GUID).</li>
+</ul>
+
+
+
+<h2>New GEOM as SALOME module</h2>
+
+The NewGeom package allows to launch the application as one of the module of SALOME platform. In that case all user interface elements are integrated into SALOME platform: the \b NewGeom package is used for this connection.
+
+Initially the New GEOM application is defined as a Light SALOME module, later it may be changed in order to manage the communication with other SALOME modules correctly.
+\n
+To integrate New GEOM into SALOME the next steps are done:
+<ol>
+<li> LightApp_Module class from SALOME GUI LightApp package is redefined. This redefined class provides a connection between LightApp_Module interface and Workshop object of the application.</li>
+<li>Provide Workshop with a <i>module</i> mode of launching in SALOME environment. In this case it is launched without its own main window, 3d viewer and main menu.</li>
+<li>In <i>module</i> mode workshop uses:
+  <ol>
+  <li>SALOME desktop as a main window.</li>
+  <li>OCC viewer from SALOME platform instead of its own 3d viewer.</li>
+  <li>SALOME main menu and toolbars for creation of workbenches commands.</li>
+  <li>Object Browser of New GEOM application is used instead of SALOME Object Browser.</li>
+  <li>Creation of a New GEOM property panel as a docking window of SALOME desktop.</li>
+  <li>Use SALOME Python console instead of console in main window. Since 3 packages from SALOME GUI module become shared between this project and SALOME mod-ules and they are independed from other SALOME parts, it is proposed in the future to detach it from SALOME platform into separated prerequisite product to avoid code duplication.</li>
+  </ol>
+</li>
+<li>Each workbench will be defined as a menu in main menu bar of SALOME desktop and as a toolbar with corresponded title.</li>
+<li>Each feature in the workbench will be defined as a menu item in the corresponded menu and a button in the corresponded toolbar.</li>
+<li>Object Browser of SALOME is hidden on activation of NewGEOM and restored on its deactivation.</li>
+<li>Object Browser and Property panel of NewGEOM is shown on activation of the module and hidden on its deactivation.</li>
+<li>Persistent of NewGEOM is compatible with persistent of SALOME. On saving of SALOME study the content of NewGEOM data structure is saved into study also and restored on restoring of study.</li>
+</ol>
+
+*/
diff --git a/doc/general_architecture_1.png b/doc/general_architecture_1.png
new file mode 100644 (file)
index 0000000..3465128
Binary files /dev/null and b/doc/general_architecture_1.png differ
diff --git a/doc/index.doc b/doc/index.doc
new file mode 100644 (file)
index 0000000..e0806ca
--- /dev/null
@@ -0,0 +1,16 @@
+/*! \mainpage
+
+To browse the New GEOM module Developer Documentation, follow the links below or use navigation menu at the top and left of the page:
+<ul>
+<li> <a href="modules.html">Modules</a> - documentation of functionality splitted into groups.</li>
+<li> <a href="hierarchy.html">Class hierarchy</a></li> - graphical representation of classes hierarchy.</li>
+<li> <a href="annotated.html">Data Structures</a> - list of all data structures and classes with brief descriptions.</li>
+<li> <a href="files.html">Files</a> - list of all files with brief descriptions.</li>
+</ul>
+
+Also you may see \subpage general_architecture document that describes 
+the main principles and terms of the development.
+
+The creation of new feature in C++ or python can be done with help of \subpage first_feature_help .
+
+*/
index 099d547e35016bf482d28698ac12c1bd4d9903a9..87ab72be5b709825ffc7b42bc0246dd3a8d90832 100644 (file)
@@ -22,7 +22,7 @@ const std::string POINT_ATTR_FIRST = "firstPoint";
 const std::string POINT_ATTR_SECOND = "secondPoint";
 
 /**\class ConstructionPlugin_Axis
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new axis in PartSet.
  */
 class ConstructionPlugin_Axis : public ModelAPI_Feature, public GeomAPI_ICustomPrs
index 369f20586bf2d0aadd87700b2972d8bf20ba56b0..9697654e54d6aee54f04241b7dc941206f0dafbb 100644 (file)
@@ -21,7 +21,7 @@ const std::string FACE_ATTR = "planeFace";
 const std::string DISTANCE_ATTR = "distance";
 
 /**\class ConstructionPlugin_Plane
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new planar surface in PartSet.
  */
 class ConstructionPlugin_Plane : public ModelAPI_Feature, public GeomAPI_ICustomPrs
index 637b96193d5d0f205d926920c550171cccb00cc0..cbab9d1ce5253dd0a3ede6a12430b6df6fac6022 100644 (file)
@@ -21,7 +21,7 @@ const std::string POINT_ATTR_Y = "y";
 const std::string POINT_ATTR_Z = "z";
 
 /**\class ConstructionPlugin_Point
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
  */
 class ConstructionPlugin_Point : public ModelAPI_Feature
index 0de88e1edf91ef91631f56abee2b149da1e21ac6..ef0f5b1a97f453f5828c6242dce9486e1416f858 100644 (file)
@@ -52,6 +52,7 @@ SET(PROJECT_SOURCES
     GeomAPI_Curve.cpp
     GeomAPI_DataMapOfShapeShape.cpp
     GeomAPI_Vertex.cpp
+    GeomAPI_ICustomPrs.cpp
 )
 
 SET(PROJECT_LIBRARIES
diff --git a/src/GeomAPI/GeomAPI_ICustomPrs.cpp b/src/GeomAPI/GeomAPI_ICustomPrs.cpp
new file mode 100644 (file)
index 0000000..69bb68f
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File:        GeomAPI_ICustomPrs.cpp
+// Created:     11 Dec 2014
+// Author:      Vitaly SMETANNIKOV
+
+#include <GeomAPI_ICustomPrs.h>
+
+GeomAPI_ICustomPrs::~GeomAPI_ICustomPrs()
+{
+
+}
index cbed444b76919614476c2d0ea53f5a0068926f26..72c362d657e7e46787e30f3852cc878781de4e70 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef GeomAPI_ICustomPrs_H
 #define GeomAPI_ICustomPrs_H
 
+#include "GeomAPI.h"
 #include "GeomAPI_AISObject.h"
 
 /**
 class GeomAPI_ICustomPrs
 {
 public:
+  GEOMAPI_EXPORT virtual ~GeomAPI_ICustomPrs();
+
   /// Modifies the given presentation in the custom way.
   virtual void customisePresentation(AISObjectPtr thePrs) = 0;
 };
 
 typedef std::shared_ptr<GeomAPI_ICustomPrs> GeomCustomPrsPtr;
 
-#endif
\ No newline at end of file
+#endif
index e8db4b55603d6cf2169fe0eaa2dae285a369dda4..aa0c7202dd8fc62a6de4fadaa696db6ff74fbc62 100644 (file)
@@ -18,6 +18,7 @@
 
 namespace BREPImport {
 
+/// Implementation of the import BREP files algorithms
 GEOMALGOAPI_EXPORT
 TopoDS_Shape Import(const TCollection_AsciiString& theFileName,
                     const TCollection_AsciiString& theFormatName,
index 9db662fa25036522f0641c4af76f4c363dbb291c..0ac301469147eac039cbb5b2b724a65b3cb3fc15 100644 (file)
@@ -13,6 +13,7 @@
 #include <GeomAlgoAPI_MakeShape.h>
 #include <GeomAPI_DataMapOfShapeShape.h>
 #include <memory>
+
 /**\class GeomAlgoAPI_Extrusion
  * \ingroup DataAlgo
  * \brief Allows to create the prism based on a given face and a direction
index 4082464af400eb496fead480e3019ab41d59aa2e..186b12c67e794bb7e05eec981099fb9d8579db96 100644 (file)
@@ -11,7 +11,7 @@
 #include <GeomAlgoAPI.h>
 
 /**\class GeomAlgoAPI_MakeShape
- * \ingroup DataModel
+ * \ingroup DataAlgo
  * \brief Interface to the root class of all topological shapes constructions
  */
 class GeomAlgoAPI_MakeShape : public GeomAPI_Interface
index 6cb5df61c14c659ffad1ec1ce20203f8eafca67a..232f28dced00e767cc03b4f1edb4ea9de4805985 100644 (file)
 
 namespace STEPImport {
 
+/// Implementation of the import parameter from the STEP file
 GEOMALGOAPI_EXPORT
 Handle(TCollection_HAsciiString) GetValue(const TCollection_AsciiString& theFileName,
                                           const TCollection_AsciiString& theParameterName,
                                           TCollection_AsciiString& theError);
+
+/// Implementation of the import STEP files algorithms
 GEOMALGOAPI_EXPORT
 TopoDS_Shape Import(const TCollection_AsciiString& theFileName,
                     const TCollection_AsciiString& theFormatName, TCollection_AsciiString& theError,
index d70bfa6ce4fa96efb3ccf53d189eb705cb6ab0e5..4d5d3af9190d4b6e74264f4b88ed55fede4ecfc5 100644 (file)
@@ -16,6 +16,7 @@
 class ModuleBase_IWorkshop;
 
 /**
+* \class ModuleBase_FilterNoConsructionSubShapes
 * 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
index 224691890ed8d4eae59f5a69f6e87e5c72337053..22648e99806486e6f98a69384f5c25c4ca56bec8 100644 (file)
@@ -41,13 +41,6 @@ public:
   /// \return State of editing mode flag
   bool isEditingMode() const { return myIsEditing; }
 
-  /// Set Enable/Disable state of Ok button
-  /// \param theEnabled Enable/Disable state of Ok button
-  virtual void setOkEnabled(bool theEnabled) = 0;
-
-  /// \return Enable/disable state of Ok button
-  virtual bool isOkEnabled() const = 0;
-
   /// Set Enable/Disable state of Cancel button
   /// \param theEnabled Enable/Disable state of Cancel button
   virtual void setCancelEnabled(bool theEnabled) = 0;
index b6983d25ac82419d52cc10c2b7bd239c5b8c1314..5551999f4e6d77bf32daeefb67effc4b98ce8838 100644 (file)
 
 #include <QList>
 
+/**
+* A class which provides access to selection.
+* A selection can be obtained as from a viewer as from Object browser in various forms
+*/
 class ModuleBase_ISelection
 {
  public:
@@ -46,9 +50,13 @@ class ModuleBase_ISelection
   virtual QModelIndexList selectedIndexes() const = 0;
 
   //! Returns list of currently selected AIS objects
+  //! \param theList returning list of selected AIS objects
   virtual void selectedAISObjects(AIS_ListOfInteractive& theList) const = 0;
 
-  //! Returns list of currently selected shapes
+  //! Returns list of currently selected shapes and their owners (objects).
+  //! Both lists are synchronized
+  //! \param theList returning list of selected AIS objects
+  //! \param theOwners list of objects
   virtual void selectedShapes(NCollection_List<TopoDS_Shape>& theList, 
     std::list<ObjectPtr>& theOwners) const = 0;
 
index 50d95a7a0ad90b87c6e5270c567e72b187bbb8e9..616e659e06c6a9c69bc0fbdb8ff39ea3470c54b0 100644 (file)
@@ -146,12 +146,14 @@ void ModuleBase_Preferences::createCustomPage(ModuleBase_IPrefMgr* thePref, int
   }
 }
 
-//**********************************************************
-//**********************************************************
-//**********************************************************
+/**
+* Implementation of preferences manager interface
+*/
 class ModuleBase_PrefMgr: public ModuleBase_IPrefMgr
 {
 public:
+  /// Constructor
+  /// \param theMgr a preferences manager
   ModuleBase_PrefMgr(ModuleBase_PreferencesMgr* theMgr):myMgr(theMgr) {}
 
   virtual int addPreference(const QString& theLbl, int pId, 
index b7783c09dff2df92e865497ed561e3b83461f506..d156f5f708f24fcec6a3b09758524ea718c74296 100644 (file)
 class SUIT_ResourceMgr;
 class QWidget;
 
-/// \typedef ModuleBase_Pref Pair of values: section name, value name
+/// Pair of values: section name, value name
 typedef QPair<QString, QString> ModuleBase_Pref;
 
-/// \typedef ModuleBase_Prefs list of preferences
+/// List of preferences
 typedef QList<ModuleBase_Pref> ModuleBase_Prefs;
 
 //***********************************************************************
@@ -27,9 +27,14 @@ typedef QList<ModuleBase_Pref> ModuleBase_Prefs;
 class MODULEBASE_EXPORT ModuleBase_Preferences
 {
  public:
+   /// Name of preferences of viewer section
   static const QString VIEWER_SECTION;
+
+   /// Name of preferences of menu section
   static const QString MENU_SECTION;
 
+  /// Shows a dialog box to edit preferences
+  /// \param theModified a list of modified preferences
   static bool editPreferences(ModuleBase_Prefs& theModified);
 
   /// Returns currently installed resource manager
@@ -44,7 +49,6 @@ class MODULEBASE_EXPORT ModuleBase_Preferences
   static void updateConfigByResources();
 
   /// Updates SUIT_ResourceMgr values by Config_PropManager properties
-  /// \param theUpdateOnlyInvalid flag to update only invalid values, if it is false, all are updated
   static void updateResourcesByConfig();
 
   /// Set default values to the Config_PropManager properties
@@ -83,12 +87,14 @@ Q_OBJECT
   {
   }
 
+  /// Returns True if preferences were modified
   ModuleBase_Prefs modified() const
   {
     return myModified;
   }
 
  protected:
+   /// Store changed resource
   virtual void changedResources(const ResourceMap& theMap);
 
  private:
@@ -101,20 +107,28 @@ class MODULEBASE_EXPORT ModuleBase_PreferencesDlg : public QDialog
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theResurces resources manager
+   /// \param theParent a parent widget
   ModuleBase_PreferencesDlg(SUIT_ResourceMgr* theResurces, QWidget* theParent = 0);
   virtual ~ModuleBase_PreferencesDlg();
 
+  /// Returns True if preferences were changed
   bool isChanged() const
   {
     return myIsChanged;
   }
 
+  /// Returns list of modified preferences
+  /// \param theModified output list of modified preferences
   void modified(ModuleBase_Prefs& theModified) const;
 
  public slots:
+   /// A slot called on Ok button press
   virtual void accept();
 
 protected slots:
+  /// A slot called on Default button press
   void onDefault();
 
  private:
index e009a03aef08ff4aa1d75ec5e89b6138de9baf9f..f37bef1b4d59874f4ea306b0997c1572f1e63e21 100644 (file)
 
 DEFINE_STANDARD_HANDLE(ModuleBase_ResultPrs, AIS_Shape)
 
+/**
+* A redefinition of standard AIS Interactive Object in order to provide specific behaviour 
+* for wire presentations based in a one plane
+*/
 class ModuleBase_ResultPrs: public AIS_Shape
 {
 public:
+  /// Constructor
+  /// \param theResult a result object
   Standard_EXPORT ModuleBase_ResultPrs(ResultPtr theResult);
 
+  /// Returns result object
   Standard_EXPORT ResultPtr getResult() const { return myResult; }
 
+  /// Returns True if the presentation is in sketch mode
   Standard_EXPORT bool isSketchMode() const { return myIsSketchMode; }
 
   DEFINE_STANDARD_RTTI(ModuleBase_ResultPrs)
 protected:
+  /// Redefinition of virtual function
   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
     const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode = 0);
 
+  /// Redefinition of virtual function
   Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
     const Standard_Integer aMode) ;
 
 private:
+  /// Reference to result object
   ResultPtr myResult;
 
+  /// A sketch mode flag
   bool myIsSketchMode;
 
+  /// Original shape of the result object
   TopoDS_Shape myOriginalShape;
+
+  /// List of faces
   std::list<std::shared_ptr<GeomAPI_Shape> > myFacesList;
 };
 
index 0b34930942fe239327a6951b98e335ca2facd7b4..da1ba9f04af81a59fe36550b34b4cb5f3f17c584 100644 (file)
@@ -19,6 +19,7 @@ class ModuleBase_IWorkshop;
 
 
 /**
+* \class ModuleBase_ShapeDocumentFilter
 * 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
@@ -44,6 +45,7 @@ protected:
 };
 
 /**
+* \class ModuleBase_ShapeInPlaneFilter
 * 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
 */
@@ -73,6 +75,7 @@ private:
 
 
 /**
+* \class ModuleBase_ObjectTypesFilter
 * 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 cf41b6b89cb01d46e6947f83d4ed4bed12c86658..5325b4d995b257d960f811eaffe91dd87d7f4b18 100644 (file)
@@ -14,33 +14,32 @@ class Config_WidgetAPI;
 class QWidget;
 class QCheckBox;
 
+/**
+* Implementation of widget for boolean input (check box)
+*/ 
 class MODULEBASE_EXPORT ModuleBase_WidgetBoolValue : public ModuleBase_ModelWidget
 {
 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
   ModuleBase_WidgetBoolValue(QWidget* theParent, const Config_WidgetAPI* theData,
                              const std::string& theParentId);
 
   virtual ~ModuleBase_WidgetBoolValue();
 
-  /// Saves the internal parameters to the given feature
-  /// \param theObject a model feature to be changed
   virtual bool storeValue() const;
 
   virtual bool restoreValue();
 
-  /// Returns list of widget controls
-  /// \return a control list
   virtual QList<QWidget*> getControls() const;
 
-  /// Returns the internal parent wiget control, that can be shown anywhere
-  /// \returns the widget
   QWidget* getControl() const;
 
  private:
+   /// The check box
   QCheckBox* myCheckBox;
 };
 
index 99bd281f9505ac5e8a1ee1e4663841551f6832f3..9b5206b083f74ab2ebd8a54997c634930116e39b 100644 (file)
@@ -14,17 +14,30 @@ class QWidget;
 class QLabel;
 class QComboBox;
 
+/**
+* Implementation of model widget for choice widget definition (combo box)
+* It can be defined as following:
+* \code
+*   <choice id="bool_type" 
+*     label="Type" 
+*     tooltip="Type of boolean operation"
+*     string_list="Cut Fuse Common"
+*   />
+* \endcode
+*/
 class MODULEBASE_EXPORT ModuleBase_WidgetChoice : 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
   ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData, 
                           const std::string& theParentId);
 
   virtual ~ModuleBase_WidgetChoice();
   
-  /// Saves the internal parameters to the given feature
-  /// \param theObject a model feature to be changed
   virtual bool storeValue() const;
 
   virtual bool restoreValue();
@@ -39,15 +52,21 @@ Q_OBJECT
   }
 
   /// Returns list of widget controls
-  /// \return a control list
+  /// \return a controls list
   virtual QList<QWidget*> getControls() const;
 
 private slots:
+  /// Slot called on combo box index change
   void onCurrentIndexChanged(int theIndex);
 
 private:
+  /// Container widget
   QWidget* myContainer;
+
+  /// The label
   QLabel* myLabel;
+
+  /// The control
   QComboBox* myCombo;
 };
 
index 9f9358fae049cc2dae451cc1d2ef849ac2f55989..c992e60f9c406f9aed6fcb823c9f980c05449abc 100644 (file)
@@ -25,15 +25,14 @@ class MODULEBASE_EXPORT ModuleBase_WidgetEditor : public ModuleBase_WidgetDouble
 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
   ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData,
                           const std::string& theParentId);
   /// 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 theAttribute The attribute of the model widget
   ModuleBase_WidgetEditor(QWidget* theParent, const std::string& theAttribute);
 
   /// Destructor
@@ -54,8 +53,11 @@ Q_OBJECT
    void showPopupEditor();
 
  private:
-  FeaturePtr myFeature;  ///< the current widget feature
-  QStringList myFeatureKinds;  ///< the kinds of possible features
+   ///< the current widget feature
+   FeaturePtr myFeature;  
+
+   ///< the kinds of possible features
+   QStringList myFeatureKinds;  
 };
 
 #endif
index a726704137c781af1afd750d78fec6a7796d5f64..40f7227ca6d344cf1a2bfd77eb436960a91e8fd2 100644 (file)
@@ -254,7 +254,7 @@ QWidget* ModuleBase_WidgetFactory::multiSelectorControl(QWidget* theParent)
   return aMultiselectorWgt->getControl();
 }
 
-QString ModuleBase_WidgetFactory::qs(const std::string& theStdString) const
+QString ModuleBase_WidgetFactory::qs(const std::string& theStdString)
 {
   return QString::fromStdString(theStdString);
 }
index f81ee61c982ff850b9747c050a3a4394e8764d04..3fa399e986193af203bc0755f4dec906d0cbd749 100644 (file)
@@ -21,42 +21,92 @@ class QWidget;
 class Config_WidgetAPI;
 class ModuleBase_IWorkshop;
 
+/**
+* A class for creation of widgets instances in for property panel using XML deskription of 
+* a feature
+*/
 class MODULEBASE_EXPORT ModuleBase_WidgetFactory
 {
  public:
+   /// Constructor
+   /// \param theXmlRepresentation content of XML file
+   /// \param theWorkshop reference to workshop instance
   ModuleBase_WidgetFactory(const std::string& theXmlRepresentation,
                            ModuleBase_IWorkshop* theWorkshop);
   virtual ~ModuleBase_WidgetFactory();
 
+  /// Creates content widget for property panel
+  /// \param theParent a parent widget
   void createWidget(QWidget* theParent);
 
+  /// Returns list of model widgets
   QList<ModuleBase_ModelWidget*> getModelWidgets() const
   {
     return myModelWidgets;
   }
 
  protected:
-  //Widgets
+   /// Create widget by its type
+   /// \param theType a type
+   /// \param theParent a parent widget
   QWidget* createWidgetByType(const std::string& theType, QWidget* theParent = NULL);
+
+   /// Create a widget of container type
+   /// \param theType a type
+   /// \param theParent a parent widget
   QWidget* createContainer(const std::string& theType, QWidget* theParent = NULL);
+
+  /// Create label widget
+  /// \param theParent a parent widget
   QWidget* labelControl(QWidget* theParent);
+
+  /// Create double spin box widget
+  /// \param theParent a parent widget
   QWidget* doubleSpinBoxControl(QWidget* theParent);
+
+  /// Create double value editor widget
+  /// \param theParent a parent widget
   QWidget* doubleValueEditor(QWidget* theParent);
+
+  /// Create shape selector widget
+  /// \param theParent a parent widget
   QWidget* shapeSelectorControl(QWidget* theParent);
+
+  /// Create boolean input widget
+  /// \param theParent a parent widget
   QWidget* booleanControl(QWidget* theParent);
+
+  /// Create file selector widget
+  /// \param theParent a parent widget
   QWidget* fileSelectorControl(QWidget* theParent);
+
+  /// Create choice widget (combo box)
+  /// \param theParent a parent widget
   QWidget* choiceControl(QWidget* theParent);
+
+  /// Create line edit widget
+  /// \param theParent a parent widget
   QWidget* lineEditControl(QWidget* theParent);
-  QWidget* multiSelectorControl(QWidget* theParent);
 
+  /// Create multi selector widget
+  /// \param theParent a parent widget
+  QWidget* multiSelectorControl(QWidget* theParent);
 
-  QString qs(const std::string& theStdString) const;
+  /// Convert STD string to QT string
+  /// \param theStdString is STD string
+  static QString qs(const std::string& theStdString);
 
  private:
+   /// API object for XML reading
   Config_WidgetAPI* myWidgetApi;
+
+  /// Reference to workshop
   ModuleBase_IWorkshop* myWorkshop;
 
+  /// List of created model widgets
   QList<ModuleBase_ModelWidget*> myModelWidgets;
+
+  /// Id of current parent
   std::string myParentId;
 };
 
index 2133fe786aebda828553e6972886b9be34879b1d..06ca8bf5cf7d4a54de28013413f29cc7ca731e56 100644 (file)
 class QWidget;
 class QLineEdit;
 
+/**
+*  Implementation of model widget for open file widget.
+*  It can be defined as following:
+*  \code
+*      <file_selector
+*          id="import_file_selector"
+*          title="Import file"
+*          path="">
+*          <validator id="ExchangePlugin_ImportFormat" parameters="BREP:BREPImport,STEP:STEPImport" />
+*      </file_selector>
+*  \endcode
+*/
 class MODULEBASE_EXPORT ModuleBase_WidgetFileSelector : 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
   ModuleBase_WidgetFileSelector(QWidget* theParent,
                                 const Config_WidgetAPI* theData,
                                 const std::string& theParentId);
   virtual ~ModuleBase_WidgetFileSelector();
 
-  /// Saves the internal parameters to the given feature
-  /// \param theObject a model feature to be changed
   virtual bool storeValue() const;
 
   virtual bool restoreValue();
 
-  /// Returns the internal parent wiget control, that can be shown anywhere
-  /// \returns the widget
   QWidget* getControl() const;
 
-  /// Returns list of widget controls
-  /// \return a control list
   virtual QList<QWidget*> getControls() const;
 
   /// Returns true if a file on the current path in the line edit
@@ -48,18 +58,30 @@ class MODULEBASE_EXPORT ModuleBase_WidgetFileSelector : public ModuleBase_ModelW
   bool isCurrentPathValid();
 
  public slots:
+   /// Processing of path selection button press
   void onPathSelectionBtn();
+
+  /// Processing of path changing
   void onPathChanged();
 
  protected:
+   /// Returns string containing formats
   QString formatsString() const;
+
+  /// Return list of validator formats
   QStringList getValidatorFormats() const;
 
  private:
+   /// A control for path input
   QLineEdit* myPathField;
+
+  /// Container
   QWidget* myMainWidget;
 
+  /// A title of open file dialog box
   QString myTitle;
+
+  /// Default path
   QString myDefaultPath;
 };
 
index 3fbf7e883411325fe921c9279f0910e3f6023a26..c3489952e7c7066ca03386840f072ef41a24f6ba 100644 (file)
 
 class QLabel;
 
+/**
+* Implementation of model widget for a label control
+*/
 class MODULEBASE_EXPORT ModuleBase_WidgetLabel : 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
   ModuleBase_WidgetLabel(QWidget* theParent, const Config_WidgetAPI* theData,
                             const std::string& theParentId);
 
@@ -43,6 +50,7 @@ Q_OBJECT
   virtual bool focusTo() { return false; }
 
 private:
+  /// A label control
   QLabel* myLabel;
 };
 
index 09d02fae3dda726b77069c7d06698577806b09a3..0e47acbb8d5649f1edc3f22c6cf47fd61a4a85f0 100644 (file)
 class QWidget;
 class QLineEdit;
 
+/**
+* Implementation of model widget for line edit widget.
+* It can be defined with "stringvalue" keyword.
+*/
 class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : 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
   ModuleBase_WidgetLineEdit(QWidget* theParent,
                                 const Config_WidgetAPI* theData,
                                 const std::string& theParentId);
   virtual ~ModuleBase_WidgetLineEdit();
 
-  /// Saves the internal parameters to the given feature
-  /// \param theObject a model feature to be changed
   virtual bool storeValue() const;
 
   virtual bool restoreValue();
 
-  /// Returns the internal parent wiget control, that can be shown anywhere
-  /// \returns the widget
   QWidget* getControl() const;
 
-  /// Returns list of widget controls
-  /// \return a control list
   virtual QList<QWidget*> getControls() const;
 
  public slots:
+   /// A slot for processing text changed event
   void onTextChanged();
 
  private:
+   /// A line edit control
   QLineEdit* myLineEdit;
+
+  /// A container widget
   QWidget* myMainWidget;
 };
 
index 66ef0bc87f2ff6dcc960e30bd3d16a15af1f19b5..b65b4812b1d01ec8e4edca75b8e223cd1b79ee58 100644 (file)
@@ -124,7 +124,7 @@ protected slots:
   /// If true then local selector has to be activated in context
   bool myIsActive;
 
-  /// \typedef GeomSelection provides correspondance between Result object and its shape
+  /// Provides correspondance between Result object and its shape
   typedef QPair<ResultPtr, GeomShapePtr> GeomSelection;
 
   /// Variable of GeomSelection type
index 755714ffdfdd04fcc509a5bc8914eba30a00d8e6..f2dbb05c7e95b5ae19312538f39b26ec3633f2ef 100644 (file)
@@ -75,6 +75,9 @@ Q_OBJECT
 
   virtual bool restoreValue();
 
+  /// Defines if it is supposed that the widget should interact with the viewer.
+  virtual bool isViewerSelector() { return true; }
+
   /// Returns the internal parent wiget control, that can be shown anywhere
   /// \returns the widget
   QWidget* getControl() const
index e6e6eec91d3d658eedda831ae7eb0a71ba05c8c5..f105bc6fda25ba4c75eb4220ecc5f581f445c5bc 100644 (file)
 class QComboBox;
 class QVBoxLayout;
 
+/**
+* \ingroup GUI
+* Implements a model widget for swithch as a container widget. It can be defined in XML with "switch" keyword
+*/
 class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public QFrame
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param parent a parent widget
   ModuleBase_WidgetSwitch(QWidget* parent = NULL);
   virtual ~ModuleBase_WidgetSwitch();
 
+  /// Add a page to the widget
+  /// \param theWidget a page widget
+  /// \param theName a name of page
   int addPage(QWidget * theWidget, const QString & theName);
+
+  /// Returns count of pages
   int count() const;
+
+  /// Returns index of current page
   int currentIndex() const;
+
+  /// Returns current widget (page)
   QWidget * currentWidget() const;
+
+  /// Returns index of widget (page)
+  /// \param theWidget a widget page
   int indexOf(QWidget * theWidget) const;
+
+  /// Insert page
+  /// \param index an index (position) to insert 
+  /// \param theWidget a page widget
+  /// \param theName a name of the page
   int insertPage(int index, QWidget * theWidget, const QString & theName);
+
+  /// Returns True if a page by given index is enabled
+  /// \param index index of the page
   bool isPageEnabled(int index) const;
+
+  /// Returns text of the page by its id
+  /// \param index index of the page
   QString pageText(int index) const;
+
+  /// Returns tooltip of the page by its id
+  /// \param index index of the page
   QString pageToolTip(int index) const;
+
+  /// Remove page by its id
+  /// \param index index of the page
   void removePage(int index);
+
+  /// Enale/disable a page by its Id
+  /// \param index index of the page
+  /// \param enabled an enable flag
   void setPageEnabled(int index, bool enabled);
+
+  /// Set page name
+  /// \param index index of the page
+  /// \param text a name of the page
   void setPageName(int index, const QString & text);
+
+  /// Set page tooltip
+  /// \param index index of the page
+  /// \param toolTip a tooltip of the page
   void setPageToolTip(int index, const QString & toolTip);
 
  public slots:
+   /// Set current page by index
+  /// \param index index of the page
   void setCurrentIndex(int index);
 
 signals:
+  /// Emitted on current page change
   void currentPageChanged(int);
 
  protected:
+  /// Update widget
   void refresh();
 
  private:
+   /// Layout
   QVBoxLayout* myMainLay;
+
+  /// Combo box
   QComboBox* myCombo;
+
+  /// List of pages
   QWidgetList myCases;
 };
 
index 1024f275d6526488dff58f37acee2f9a42fcec8c..5f6f9519d345f5403528610fd8776835dbdf2dbf 100644 (file)
@@ -9,22 +9,51 @@
 
 class NewGeom_Module;
 
+/**
+* \ingroup Salome
+* A Data Model class provides a connection of SALOME data structure and OpenParts application data model
+*/
 class NewGeom_EXPORT NewGeom_DataModel : public LightApp_DataModel
 {
   Q_OBJECT
  public:
+   /// Constructor
+   /// \param theModule a module instance
   NewGeom_DataModel(NewGeom_Module* theModule);
   virtual ~NewGeom_DataModel();
 
+  /// Open a data file
+  /// \param thePath a path to the directory
+  /// \param theStudy a current study
+  /// \param theFiles a list of files to open
   virtual bool open(const QString& thePath, CAM_Study* theStudy, QStringList theFiles);
+
+  /// Save module data to file
+  /// \param theFiles list of created files
   virtual bool save(QStringList& theFiles);
+
+  /// Save module data to a file
+  /// \param thePath a path to the directory
+  /// \param theStudy a current study
+  /// \param theFiles a list of files to open
   virtual bool saveAs(const QString& thePath, CAM_Study* theStudy, QStringList& theFiles);
+
+  /// Close data structure
   virtual bool close();
+
+  /// Create data structure
+  /// \param theStudy a current study
   virtual bool create(CAM_Study* theStudy);
 
+  /// Returns True if the data structure has been modified
   virtual bool isModified() const;
+
+  /// Returns True if the data structure is already saved
   virtual bool isSaved() const;
 
+  /// Update data object
+  /// \param theObj an data object
+  /// \param theStudy a current study
   virtual void update(LightApp_DataObject* theObj = 0, LightApp_Study* theStudy = 0);
 
 protected:
@@ -35,8 +64,12 @@ protected:
   static void removeDirectory(const QString& theDirectoryName);
 
  private:
+   /// Pat to a study file
   QString myStudyPath;
-  QString myTmpDirectory; /// a path to the temporary directory, created by opening a document file
+
+  /// a path to the temporary directory, created by opening a document file
+  QString myTmpDirectory; 
+
   /// it should be created because the files reading is postponed in the module. The directory
   // should be removed after the model document is closed.
   NewGeom_Module* myModule;
index e086444f00aaae86b1f79ca567a6b3f096bff860..59a3ee0a6f4c15197c6868f958ef377fca320653 100644 (file)
@@ -7,14 +7,23 @@
 
 #include <LightApp_OCCSelector.h>
 
+/**
+* Redefinition of standard OCC selector in order to adapt it to NewGeom needs
+*/
 class NewGeom_EXPORT NewGeom_OCCSelector : public LightApp_OCCSelector
 {
  public:
+   /// Constructor
+   /// \param theViewer a viewer
+   /// \param theMgr a selection manager
   NewGeom_OCCSelector(OCCViewer_Viewer* theViewer, SUIT_SelectionMgr* theMgr);
   virtual ~NewGeom_OCCSelector();
 
  protected:
+   /// Redifinition of virtual function
   virtual void getSelection(SUIT_DataOwnerPtrList& theList) const;
+
+   /// Redifinition of virtual function
   virtual void setSelection(const SUIT_DataOwnerPtrList& theList);
 };
 
index 7ac8ea6a39fff9b42db2b4dc8aeb8efb080fa3f6..0377ce7e06d17ed86a351dc1cd22a6b271d40b8e 100644 (file)
@@ -19,10 +19,15 @@ class NewGeom_OCCSelector;
 class OCCViewer_Viewer;
 class SUIT_ViewManager;
 
-
+/**
+* A class for providing access of NewGeom functionality to 
+* SALOME view window functionality
+*/
 class NewGeom_SalomeView: public ModuleBase_IViewWindow
 {
 public:
+  /// Constructor
+  /// \param theViewer a reference to a viewer
   NewGeom_SalomeView(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
 
   virtual Handle(V3d_View) v3dView() const;
@@ -31,14 +36,21 @@ public:
   OCCViewer_Viewer* viewer() const { return myViewer; }
 
 private:
+  /// A reference to a viewer
   OCCViewer_Viewer* myViewer;
 };
 
 
+/**
+* A class for providing access of NewGeom functionality to 
+* SALOME viewer functionality
+*/
 class NewGeom_SalomeViewer : public ModuleBase_IViewer
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theParent a parent object
   NewGeom_SalomeViewer(QObject* theParent);
 
   ~NewGeom_SalomeViewer();
index 66a4e52dafb94081b4974c60a0159406c1b2c293..c0ea09cd9a950e132fbc553375d3b07e8ef7ff1c 100644 (file)
@@ -212,7 +212,7 @@ void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
           aPnt2dWgt->setPoint(aPoint->x(), aPoint->y());
           PartSet_Tools::setConstraints(mySketchMgr->activeSketch(), theOperation->feature(), 
             aWgt->attributeID(), aPoint->x(), aPoint->y());
-          theOperation->propertyPanel()->activateNextWidget(aPnt2dWgt);
+          aPanel->activateNextWidget(aPnt2dWgt);
         }
       }
     }
index bd8b15dd374cf64f4a89baa5f06a3df0c1edfb83..06fcc33712e6d31008c3e7b463d68acd00013550 100644 (file)
@@ -141,11 +141,20 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE
   if (!(theEvent->buttons() & Qt::LeftButton))
     return;
 
+  ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
+  ModuleBase_Operation* aOperation = aWorkshop->currentOperation();
+  if (aOperation && aOperation->isEditOperation()) {
+    ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
+    ModuleBase_ModelWidget* aActiveWgt = aPanel->activeWidget();
+    // If the current widget is a selector, do do nothing, it processes the mouse press
+    if(aActiveWgt && aActiveWgt->isViewerSelector()) {
+      return;
+    }
+  }
+
   // Clear dragging mode
   myIsDragging = false;
 
-  ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
-  ModuleBase_Operation* aOperation = aWorkshop->currentOperation();
   // Use only for sketch operations
   if (aOperation && myCurrentSketch) {
     if (!PartSet_Tools::sketchPlane(myCurrentSketch))
index c008d9d71650c08a3e881e3ff8a0632d81e9d503..1e061643c10d3e882968a739c3c0219ce2c2fe73 100644 (file)
@@ -12,7 +12,6 @@
 #include <XGUI_ModuleConnector.h>
 #include <XGUI_SelectionMgr.h>
 #include <XGUI_Selection.h>
-#include <XGUI_PropertyPanel.h>
 #include <XGUI_OperationMgr.h>
 
 #include <ModuleBase_DoubleSpinBox.h>
@@ -194,9 +193,12 @@ void PartSet_WidgetPoint2D::activate()
   QIntList aModes;
   aModes << TopAbs_VERTEX;
   myWorkshop->moduleConnector()->activateSubShapesSelection(aModes);
-  // 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
-  storeValue();
+  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()
@@ -282,7 +284,7 @@ void PartSet_WidgetPoint2D::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEv
   // the Ok button should be disabled in the property panel by moving the mouse point in the viewer
   // this leads that the user does not try to click Ok and it avoids an incorrect situation that the 
   // line is moved to the cursor to the Ok button
-  myWorkshop->propertyPanel()->setOkEnabled(false);
+  myWorkshop->operationMgr()->setApplyEnabled(false);
 
   gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWnd->v3dView());
 
index b67ca1413cc802daa5a97e0bd20d731b7c635b97..c3cba967bb8490347938c04084fe4779876bc915 100644 (file)
@@ -94,7 +94,7 @@ void PartSet_WidgetPoint2dDistance::onMouseRelease(ModuleBase_IViewWindow* theWn
 void PartSet_WidgetPoint2dDistance::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
 {
   myWorkshop->operationMgr()->setLockValidating(true);
-  myWorkshop->propertyPanel()->setOkEnabled(false);
+  myWorkshop->operationMgr()->setApplyEnabled(false);
 
   gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWnd->v3dView());
 
index 86137696a5b3ee3751119d125c495eb4767e36d2..cd69a1998d2e0620624667848994846ae8003549 100644 (file)
@@ -7,6 +7,11 @@
 #include "PartSet_WidgetShapeSelector.h"
 
 #include <ModelAPI_AttributeRefAttr.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
+#include <ModelAPI_RefAttrValidator.h>
+#include <ModelAPI_ResultValidator.h>
+
 #include <PartSet_Tools.h>
 #include <SketchPlugin_Feature.h>
 
@@ -40,6 +45,7 @@ bool PartSet_WidgetShapeSelector::storeValue() const
       if (aRefAttr) {
         TopoDS_Shape aShape = myShape->impl<TopoDS_Shape>();
         AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(mySelectedObject, aShape, mySketch);
+
         // this is an alternative, whether the attribute should be set or object in the attribute
         // the first check is the attribute because the object already exist
         // the object is set only if there is no selected attribute
@@ -56,6 +62,69 @@ bool PartSet_WidgetShapeSelector::storeValue() const
   return ModuleBase_WidgetShapeSelector::storeValue();
 }
 
+//********************************************************************
+bool PartSet_WidgetShapeSelector::isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape)
+{
+  // the method is redefined to analize the selected shape in validators
+  SessionPtr aMgr = ModelAPI_Session::get();
+  ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
+  std::list<ModelAPI_Validator*> aValidators;
+  std::list<std::list<std::string> > anArguments;
+  aFactory->validators(parentID(), attributeID(), aValidators, anArguments);
+
+  // Check the type of selected object
+  std::list<ModelAPI_Validator*>::iterator aValidator = aValidators.begin();
+  bool isValid = true;
+  for (; aValidator != aValidators.end(); aValidator++) {
+    const ModelAPI_ResultValidator* aResValidator =
+        dynamic_cast<const ModelAPI_ResultValidator*>(*aValidator);
+    if (aResValidator) {
+      isValid = false;
+      if (aResValidator->isValid(theObj)) {
+        isValid = true;
+        break;
+      }
+    }
+  }
+  if (!isValid)
+    return false;
+
+  // Check the acceptability of the object and shape as validator attribute
+  AttributePtr aPntAttr;
+  DataPtr aData = myFeature->data();
+  if (theShape.get() != NULL) {
+    AttributePtr aAttr = aData->attribute(attributeID());
+    AttributeRefAttrPtr aRefAttr = 
+      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(aAttr);
+    if (aRefAttr) {
+      TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
+      aPntAttr = PartSet_Tools::findAttributeBy2dPoint(theObj, aShape, mySketch);
+    }
+  }
+  // Check the acceptability of the object as attribute
+  aValidator = aValidators.begin();
+  std::list<std::list<std::string> >::iterator aArgs = anArguments.begin();
+  for (; aValidator != aValidators.end(); aValidator++, aArgs++) {
+    const ModelAPI_RefAttrValidator* aAttrValidator =
+        dynamic_cast<const ModelAPI_RefAttrValidator*>(*aValidator);
+    if (aAttrValidator) {
+      if (aPntAttr.get() != NULL)
+      {
+        if (!aAttrValidator->isValid(myFeature, *aArgs, aPntAttr)) {
+          return false;
+        }
+      }
+      else
+      {
+        if (!aAttrValidator->isValid(myFeature, *aArgs, theObj)) {
+          return false;
+        }
+      }
+    }
+  }
+  return true;
+}
+
 //*********************************************
 bool PartSet_WidgetConstraintShapeSelector::storeValue() const
 {
@@ -75,4 +144,3 @@ bool PartSet_WidgetConstraintShapeSelector::storeValue() const
   }
   return ModuleBase_WidgetShapeSelector::storeValue();
 }
-
index d4cf72aff480fa7674bf953a116297c9760bdf41..8f187cd8b47b1d1f8074506210f471f690ce91b6 100644 (file)
@@ -30,6 +30,10 @@ Q_OBJECT
   void setSketcher(CompositeFeaturePtr theSketch) { mySketch = theSketch; }
   CompositeFeaturePtr sketch() const { return mySketch; }
 
+protected:
+  /// Check the selected with validators if installed
+  virtual bool isValid(ObjectPtr theObj, std::shared_ptr<GeomAPI_Shape> theShape);
+
 private:
   CompositeFeaturePtr mySketch;
 };
index 8217ed87453d30b375ad9b15f88f16469e4535a0..5aa92ed1a2d2b339c2a77fd46b6db0e34d3fb904 100644 (file)
@@ -10,7 +10,7 @@
 #include "PartSetPlugin_Part.h"
 
 /**\class PartSetPlugin_Duplicate
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Duplicates the active part (not root). Creates a new "part" feature.
  */
 class PartSetPlugin_Duplicate : public PartSetPlugin_Part
index 590d69562d70b8d2de6fdad673609a520cf4082f..5b7d63e4947d53269f7ef29a52995e1916ef59b9 100644 (file)
@@ -11,7 +11,7 @@
 #include <ModelAPI_Feature.h>
 
 /**\class PartSetPlugin_Part
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
  */
 class PartSetPlugin_Part : public ModelAPI_Feature
index c29028d39fbc0865695dc485d27ddb4b107cad73..5f3e354255b220690d8a6d05d664be80ed230c7f 100644 (file)
@@ -11,7 +11,7 @@
 #include <ModelAPI_Feature.h>
 
 /**\class PartSetPlugin_Remove
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
  */
 class PartSetPlugin_Remove : public ModelAPI_Feature
index f24af300f5e0cad2a6dbb81830b6b6e2fe2684b4..044d074627efede8d9e5d561e4912573078d0603 100644 (file)
@@ -13,7 +13,7 @@
 #include <GeomAPI_IPresentable.h>
 
 /**\class SketchPlugin_Arc
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new arc of circle in PartSet.
  * The visualization of this object is separated in two parts. The first one is an AIS object
  * calculated when there is non-initialized attributes of the arc. The second is a result and
index 76bac7887bf111ab1f23b7b131714f4bc344820d..f3434d4b52566d187f150e99915de9cc9a06f509 100644 (file)
@@ -13,7 +13,7 @@
 #include <GeomAPI_IPresentable.h>
 
 /**\class SketchPlugin_Circle
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new circle in PartSet.
  */
 class SketchPlugin_Circle : public SketchPlugin_Feature 
index 721d310292f415a4d799d32eba6b2be84b212054..8636d3948ceae139a9db792ec92836340fbf2b76 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <list>
 
-/*  Description: 
+/** Description: 
  *    Each constraint uses a set of parameters. In the SolveSpace library 
  *    these parameters are named "valA", "ptA", "ptB", "entityA", "entityB". 
  *    The "ptA" and "ptB" parameters represents a point in the constraint.
@@ -31,7 +31,7 @@
  */
 
 /** \class SketchPlugin_ConstraintBase
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief Feature for creation of a new constraint between other features.
  *         Some feature's methods implemented here as dummy to
  *         Base class for all constraints.
index 7abe570f2f3575e1e2b7f5b1709193e39e30cdda..ce1939f7689a024ccc08847117c7e22486c0a737 100644 (file)
@@ -13,7 +13,7 @@
 #include <list>
 
 /** \class SketchPlugin_ConstraintCoincidence
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief Feature for creation of a new constraint which defines equivalence of two points
  *
  *  This constraint has two attributes:
index 53dfe43e7c010e85184cf73dd4360ec427ac0340..69f31879811b9586ed7f8d993d355af027c43206 100644 (file)
@@ -20,7 +20,7 @@ class GeomDataAPI_Point2D;
 #define DISTANCE_COLOR "#ff00ff"
 
 /** \class SketchPlugin_ConstraintDistance
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief Feature for creation of a new constraint which defines a distance
  *         between a point and another feature (point, line, plane or face)
  *
index 68141efa3d76e57a8ed72631673f16d39ae631b7..98ef62511e619b47eb56a68815e70916e2962af6 100644 (file)
@@ -17,7 +17,7 @@ class GeomDataAPI_Point2D;
 #define LENGTH_COLOR "#ff00ff"
 
 /** \class SketchPlugin_ConstraintLength
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief Feature for creation of a new constraint which defines a length of a line segment
  *
  *  This constraint has two attributes:
index 6e81c66d367428fe1edc1242cd269d78024002ec..4f3969073e2d2a0efa67c546aa5d3ecaedf36902 100644 (file)
@@ -14,7 +14,7 @@
 #define PARALLEL_COLOR "#ffff00"
 
 /** \class SketchPlugin_ConstraintParallel
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief Feature for creation of a new constraint parallelism of two lines
  *
  *  This constraint has two attributes:
index 1e1953eee9b57a6d096774bc8a0bd8fd41483a0e..f0998fa14204781386987a92e4e54628a9ed2b20 100644 (file)
@@ -14,7 +14,7 @@
 #define PERPENDICULAR_COLOR "#ffff00"
 
 /** \class SketchPlugin_ConstraintPerpendicular
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief Feature for creation of a new constraint for perpendicularity of two lines
  *
  *  This constraint has two attributes:
index bbdef20553af371c7a07e91a1a50995902884dd1..84c2043c422f715722191e5918522cc7524cbaa6 100644 (file)
@@ -14,7 +14,7 @@
 #define RADIUS_COLOR "#ff00ff"
 
 /** \class SketchPlugin_ConstraintRadius
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief Feature for creation of a new constraint which defines 
  *         a radius of a circle or an arc of circle
  *
index 4646ac7fda00cb6b6270635096f41ceda2ad1a64..5c94bcba6a1cee438cf174ddd098807ce146d3ab 100644 (file)
@@ -15,7 +15,7 @@
 #define FIXING_COLOR "#ffff00"
 
 /** \class SketchPlugin_ConstraintRigid
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief Feature for creation of a new constraint which defines immovable object
  *
  *  This constraint has one attribute:
index bf7cb93fabc27bd87eb40d1cd7237ebe4eb508c7..24a3c49e5785c4039f1c5cd12fa5ab619158ef0b 100644 (file)
@@ -20,7 +20,7 @@ class GeomAPI_Pnt2d;
 class Handle_AIS_InteractiveObject;
 
 /**\class SketchPlugin_Feature
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new feature in PartSet. This is an abstract class to give
  * an interface to create the sketch feature preview.
  */
index be5fadaad66033f31cbf06f746750f9cfc69f55c..1984f8368997b73e299588a6a4a008804c419a48 100644 (file)
@@ -13,7 +13,7 @@
 #include <list>
 
 /**\class SketchPlugin_Line
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
  */
 class SketchPlugin_Line : public SketchPlugin_Feature
index 9354ef398a42c2f87bc12152e99b6c5b1eba5bce..3b9de25ef6941f1ec63831c3a2aec82e8c0b0c03 100644 (file)
@@ -14,7 +14,7 @@
 #include <ModelAPI_Events.h>
 
 /**\class SketchPlugin_Plugin
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Interface common for any plugin: allows to use plugin by the plugins manager.
  */
 class SKETCHPLUGIN_EXPORT SketchPlugin_Plugin : public ModelAPI_Plugin, public Events_Listener
index c855dd32a95284c1d72cbbfa92213b7f2436d4d6..27a288763194468b636a996a8b723212b0c977a3 100644 (file)
@@ -13,7 +13,7 @@
 #include <list>
 
 /**\class SketchPlugin_Point
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of a new point.
  */
 class SketchPlugin_Point : public SketchPlugin_Feature
index 14e3082f0e6250231532dbc1232256231e87ecca..51ac70496b266da567e9d7b086728f5ed0f03da7 100644 (file)
@@ -24,7 +24,7 @@
 #define PLANE_SIZE          "200"     
 
 /**\class SketchPlugin_Sketch
- * \ingroup DataModel
+ * \ingroup Plugins
  * \brief Feature for creation of the new part in PartSet.
  */
 class SketchPlugin_Sketch : public ModelAPI_CompositeFeature//, public GeomAPI_IPresentable
index c7117d4a8b7cc6f7dc079b5784f8963f0fca00aa..b53102af2a268799729f716ecf5ffde12850d3c6 100644 (file)
@@ -25,7 +25,13 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const FeaturePtr& theFeature,
   // If the object is not a line then it is accepted
   const ModelAPI_ResultValidator* aLineValidator =
       dynamic_cast<const ModelAPI_ResultValidator*>(aFactory->validator("SketchPlugin_ResultLine"));
-  if (!aLineValidator->isValid(theObject))
+  bool aLineValid = aLineValidator->isValid(theObject);
+
+  const ModelAPI_ResultValidator* anArcValidator =
+      dynamic_cast<const ModelAPI_ResultValidator*>(aFactory->validator("SketchPlugin_ResultArc"));
+  bool anArcValid = anArcValidator->isValid(theObject);
+
+  if (!aLineValid && !anArcValid)
     return true;
 
   // If it is a line then we have to check that first attribute id not a line
@@ -38,14 +44,15 @@ bool SketchPlugin_DistanceAttrValidator::isValid(const FeaturePtr& theFeature,
 bool SketchPlugin_DistanceAttrValidator::isValid(
   const AttributePtr& theAttribute, const std::list<std::string>& theArguments ) const
 {
-  std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = 
-    std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
-  if (anAttr) {
-    const ObjectPtr& anObj = theAttribute->owner();
-    const FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(anObj);
-    return isValid(aFeature, theArguments, anAttr->object());
-  }
-  return true; // it may be not reference attribute, in this case, it is OK
+  // any point attribute is acceptable for the distance operation
+  return true;
+}
+
+bool SketchPlugin_DistanceAttrValidator::isValid(const FeaturePtr& theFeature,
+                                                 const std::list<std::string>& theArguments,
+                                                 const AttributePtr& theAttribute) const
+{
+  return isValid(theAttribute, theArguments);
 }
 
 bool SketchPlugin_DifferentObjectsValidator::isValid(const FeaturePtr& theFeature,
index 0e94d7a70152f50fe66a01f4c65eea2a91b5e74d..d6368a1eb3e30ba13697582c7c57f30a34187993 100644 (file)
@@ -30,7 +30,7 @@ class SketchPlugin_DistanceAttrValidator : public ModelAPI_RefAttrValidator
 
   //! Returns true if the attribute is good for the feature attribute
   virtual bool isValid(const FeaturePtr& theFeature, const std::list<std::string>& theArguments,
-                       const AttributePtr& theAttribute) const { return true; };
+                       const AttributePtr& theAttribute) const;
 };
 
 /**\class SketchPlugin_DifferentObjectsValidator
index 712efa2829f58bd02cb97d496634e4821582890c..0f6201227b8d1027f9e3b2aa12ae990b84e1c364 100644 (file)
@@ -58,6 +58,7 @@
           tooltip="Select point, line end point, line, center of circle or arc." 
                            shape_types="edge vertex">
                        <validator id="SketchPlugin_DifferentObjects"/>
+      <validator id="SketchPlugin_DistanceAttr" parameters="ConstraintEntityA"/>
       <selection_filter id="MultiFilter" parameters="line,vertex"/>
     </sketch_shape_selector>
                
index e194c2571cf48619bd2530d00415884b3a50d5d3..5a98e31be6f885eb03435a4ba85a71d64ad96c9e 100644 (file)
@@ -15,7 +15,7 @@
 #include <vector>
 
 /** \class   SketchSolver_Constraint
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief   Obtain information about SketchPlugin's constraint
  */
 class SketchSolver_Constraint
index 94734f20c0f0edec67accf815efd79046fe9f99d..36583e3381362b75fa054cc3983a0e39c33d3678 100644 (file)
@@ -25,7 +25,7 @@ typedef std::map< std::shared_ptr<SketchPlugin_Constraint>, std::vector<Slvs_hCo
   ConstraintMap;
 
 /** \class   SketchSolver_ConstraintGroup
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief   Keeps the group of constraints which based on the same entities
  */
 class SketchSolver_ConstraintGroup
index 4604a52b11d7dc233a53e86ae2b12f6753ae6ad2..f5e148362bd448bb8e6020c258de1e6980c824d3 100644 (file)
@@ -23,7 +23,7 @@
 #include <set>
 
 /** \class   SketchSolver_ConstraintManager
- *  \ingroup DataModel
+ *  \ingroup Plugins
  *  \brief   Listens the changes of SketchPlugin features and transforms the Constraint
  *           feature into the format understandable by SolveSpace library.
  *
index 3101cb0bd0acfd606493d24b5beea70c9bbac00e..8007e979421e63275f22a73277b729eed1b78e68 100644 (file)
@@ -23,11 +23,17 @@ class XGUI_OperationMgr;
 class ModuleBase_Operation;
 class QAction;
 
+/**
+* \ingroup GUI
+* A class for management of actions (features) activation/deactivation
+*/
 class XGUI_EXPORT XGUI_ActionsMgr : public QObject, public Events_Listener
 {
 Q_OBJECT
 
  public:
+   /// Constructor
+   /// \param theWorkshop an instance of workshop
   XGUI_ActionsMgr(XGUI_Workshop* theWorkshop);
   virtual ~XGUI_ActionsMgr();
 
@@ -35,13 +41,20 @@ Q_OBJECT
   //! Please note that nested commands in the Salome mode (No AppElements_Command, pure QActions)
   //! won't be extracted and should be added manually using the addNestedCommands method.
   void addCommand(QAction* theCmd);
+
   //! Sets relation between the command (with given Id) and it's nested actions.
   void addNestedCommands(const QString& theId, const QStringList& theCommands);
 
+  //! Returns list of nested commands by parent command Id
+  //! \param theId a parent command Id
   QStringList nestedCommands(const QString& theId) const;
 
+  /// Returns True if the given Id is an Id of nested command
+  /// \param theId an Id to check
   bool isNested(const QString& theId) const;
 
+  /// Registers shortcut (key sequence) for the command triggering
+  /// \param theKeySequence a key sequence to register
   QKeySequence registerShortcut(const QString& theKeySequence);
 
   //! Redefinition of Events_Listener method
index 9a5ca5803d07987aef505fba7933dc10178eb8eb..b442effba67fe4925700daca9b750bafd3aa4e69 100644 (file)
 
 class QTextEdit;
 
+/**
+* A class of dialog to show error message
+*/
 class XGUI_ErrorDialog : public QDialog
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param parent a parent widget
   XGUI_EXPORT XGUI_ErrorDialog(QWidget* parent);XGUI_EXPORT virtual ~XGUI_ErrorDialog();
 
  public slots:
-  XGUI_EXPORT void refresh();XGUI_EXPORT void clear();XGUI_EXPORT void addError(const QString&);XGUI_EXPORT void removeError(
-      const QString&);
+   /// Update dialog box
+  XGUI_EXPORT void refresh();
+
+  /// Clear messages
+  XGUI_EXPORT void clear();
+
+  /// Add error message
+  XGUI_EXPORT void addError(const QString&);
+
+  /// Remove error message
+  XGUI_EXPORT void removeError(const QString&);
 
  private:
+   /// Widget for error log
   QTextEdit* myErrorLog;
+
+  /// List of errors
   QStringList myErrors;
 };
 
index a52c844545999bd6e91a17fa4e8663517c937d01..93cc131be4f458eb27428306fca6400e2696549f 100644 (file)
 class XGUI_DocumentDataModel;
 class QLineEdit;
 
+/**
+* \ingroup GUI
+* Implementation of Data Tree object for Object Browser
+*/
 class XGUI_DataTree : public QTreeView
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theParent a parent widget
   XGUI_DataTree(QWidget* theParent);
   virtual ~XGUI_DataTree();
 
@@ -28,24 +34,32 @@ Q_OBJECT
     return mySelectedData;
   }
 
+  /// Returns current data model
   XGUI_DocumentDataModel* dataModel() const;
 
 signals:
   //! Emited when selection is changed
   void selectionChanged();
+
+  //! Emited when active part changed
   void activePartChanged(ObjectPtr thePart);
 
   //! Emited on context menu request
   void contextMenuRequested(QContextMenuEvent* theEvent);
 
 public slots:
+  /// Clear content of data tree
   virtual void clear();
 
  protected slots:
+   /// Commit modified data (used for renaming of objects)
   virtual void commitData(QWidget* theEditor);
 
  protected:
+   /// Redefinition of virtual method
   virtual void mouseDoubleClickEvent(QMouseEvent* theEvent);
+
+   /// Redefinition of virtual method
   virtual void contextMenuEvent(QContextMenuEvent* theEvent);
 
  private slots:
@@ -65,6 +79,8 @@ class XGUI_EXPORT XGUI_ObjectsBrowser : public QWidget
 {
 Q_OBJECT
  public:
+   /// Constructor
+   /// \param theParent a parent widget
   XGUI_ObjectsBrowser(QWidget* theParent);
   virtual ~XGUI_ObjectsBrowser();
 
@@ -80,6 +96,8 @@ Q_OBJECT
     return myObjectsList;
   }
 
+  /// Set selected list of objects
+  /// \param theObjects list of objects to select
   void setObjectsSelected(const QObjectPtrList& theObjects);
 
   //! Returns currently selected indexes
@@ -97,11 +115,14 @@ Q_OBJECT
   //! Activates currently selected part. Signal activePartChanged will not be sent
   void activatePart(const ResultPartPtr& thePart);
 
+  /// Rebuild data tree
   void rebuildDataTree();
 
+  /// Process application event
+  /// \param theMessage an event message
   void processEvent(const std::shared_ptr<Events_Message>& theMessage);
 
-  // Resets the object browser into initial state
+  /// Resets the object browser into initial state
   void clearContent();
 
 signals:
@@ -115,16 +136,26 @@ signals:
   void contextMenuRequested(QContextMenuEvent* theEvent);
 
  protected:
+   /// Redefinition of virtual method
   virtual bool eventFilter(QObject* obj, QEvent* theEvent);
 
  private slots:
+   /// Activate part
+   /// \param thePart a part to activate
   void onActivePartChanged(ObjectPtr thePart);
+
+  /// Show context menu
+  /// \param theEvent a context menu event
   void onContextMenuRequested(QContextMenuEvent* theEvent);
+
+  /// Show context menu on upper label
+  /// \param thePnt a position of context menu
   void onLabelContextMenuRequested(const QPoint& thePnt);
 
   //! Called on Edit command request
   void onEditItem();
 
+  /// Process selection changed event
   void onSelectionChanged();
 
  private:
index a8f68277b5aa2266d32b6cb4f4d6c4b33730a9d8..859c0da92888aca8f62c4198b75b1cad1b00aefb 100644 (file)
@@ -140,11 +140,38 @@ void XGUI_OperationMgr::onValidateOperation()
     return;
   ModuleBase_Operation* anOperation = currentOperation();
   if(anOperation && (!myIsValidationLock)) {
-    bool isValid = anOperation->isValid();
-    emit operationValidated(isValid);
+    setApplyEnabled(anOperation->isValid());
   }
 }
 
+void XGUI_OperationMgr::setApplyEnabled(const bool theEnabled)
+{
+  myIsApplyEnabled = theEnabled;
+  emit applyEnableChanged(theEnabled);
+}
+
+bool XGUI_OperationMgr::isApplyEnabled() const
+{
+  return myIsApplyEnabled;
+}
+
+bool XGUI_OperationMgr::canStopOperation()
+{
+  ModuleBase_Operation* anOperation = currentOperation();
+  if(operationsCount() > 1) //in case of nested (sketch) operation no confirmation needed
+    return true;
+  if (anOperation && anOperation->isModified()) {
+    QString aMessage = tr("%1 operation will be aborted.").arg(anOperation->id());
+    int anAnswer = QMessageBox::question(qApp->activeWindow(),
+                                         tr("Abort operation"),
+                                         aMessage,
+                                         QMessageBox::Ok | QMessageBox::Cancel,
+                                         QMessageBox::Cancel);
+    return anAnswer == QMessageBox::Ok;
+  }
+  return true;
+}
+
 bool XGUI_OperationMgr::commitOperation()
 {
   if (hasOperation() && currentOperation()->isValid()) {
@@ -165,8 +192,11 @@ bool XGUI_OperationMgr::canStartOperation(QString theId)
   ModuleBase_Operation* aCurrentOp = currentOperation();
   if (aCurrentOp) {
     if (!aCurrentOp->isGranted(theId)) {
-      if (canAbortOperation()) {
-        aCurrentOp->abort();
+      if (canStopOperation()) {
+        if (myIsApplyEnabled)
+          aCurrentOp->commit();
+        else
+          aCurrentOp->abort();
       } else {
         aCanStart = false;
       }
@@ -185,28 +215,11 @@ void XGUI_OperationMgr::onCommitOperation()
 
 void XGUI_OperationMgr::onAbortOperation()
 {
-  if (hasOperation() && canAbortOperation()) {
+  if (hasOperation() && canStopOperation()) {
     currentOperation()->abort();
   }
 }
 
-bool XGUI_OperationMgr::canAbortOperation()
-{
-  ModuleBase_Operation* anOperation = currentOperation();
-  if(operationsCount() > 1) //in case of nested (sketch) operation no confirmation needed
-    return true;
-  if (anOperation && anOperation->isModified()) {
-    QString aMessage = tr("%1 operation will be aborted.").arg(anOperation->id());
-    int anAnswer = QMessageBox::question(qApp->activeWindow(),
-                                         tr("Abort operation"),
-                                         aMessage,
-                                         QMessageBox::Ok | QMessageBox::Cancel,
-                                         QMessageBox::Cancel);
-    return anAnswer == QMessageBox::Ok;
-  }
-  return true;
-}
-
 void XGUI_OperationMgr::onOperationStarted()
 {
   ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
index 1cf7dcefcbbd5fcbb6a5cc6588f24f313d39a979..f5683f81aa5f4b3300397ac42b5a8ea8d9078e30 100644 (file)
@@ -77,11 +77,6 @@ Q_OBJECT
   /// \param theId id of the operation which is going to start
   bool canStartOperation(QString theId);
 
-  bool canStopOperation();
-
-  /// Returns true if the operation can be aborted
-  bool canAbortOperation();
-
   /// Blocking/unblocking enabling of Ok button in property panel.
   /// It is used when operation can not be validated even all attributes are valid
   void setLockValidating(bool toLock) { myIsValidationLock = toLock; }
@@ -89,7 +84,15 @@ Q_OBJECT
   /// Returns state of validation locking
   bool isValidationLocked() const { return myIsValidationLock; }
 
- public slots:
+  /// Sets apply state to the value and emit signal about this state is changed
+  /// \param theEnabled the state value
+  void setApplyEnabled(const bool theEnabled);
+
+  /// Returns enable apply state 
+  /// \return theEnabled a boolean value
+  bool isApplyEnabled() const;
+
+  public slots:
   /// Slot that commits the current operation.
   void onCommitOperation();
   /// Slot that aborts the current operation.
@@ -114,8 +117,8 @@ signals:
   /// Emitted when current operation is aborted
   void operationAborted(ModuleBase_Operation* theOperation);
 
-  /// Signal is emitted after the validate methods calls.
-  void operationValidated(bool);
+  /// Signal is emitted after the apply enable state changed.
+  void applyEnableChanged(bool);
 
   /// Signal is emitted after the current operation is filled with existing preselection.
   void operationActivatedByPreselection();
@@ -125,6 +128,8 @@ signals:
 
 
  protected:
+  /// Returns true if the operation can be aborted
+  bool canStopOperation();
 
   /// Commits the current operatin if it is valid
   bool commitOperation();
@@ -156,6 +161,8 @@ signals:
 
   /// Lock/Unlock access to Ok button in property panel
   bool myIsValidationLock;
+  /// Lock/Unlock access to Ok button in property panel
+  bool myIsApplyEnabled;
 };
 
 #endif
index fc337bc6305a1a2e9cd2753613db5b6a427ef3f4..d5d213691af95176d94067e20b4d9bc414c87c57 100644 (file)
@@ -226,18 +226,6 @@ void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget)
     emit noMoreWidgets();
 }
 
-void XGUI_PropertyPanel::setOkEnabled(bool theEnabled)
-{
-  QPushButton* anOkBtn = findChild<QPushButton*>(PROP_PANEL_OK);
-  anOkBtn->setEnabled(theEnabled);
-}
-
-bool XGUI_PropertyPanel::isOkEnabled() const
-{
-  QPushButton* anOkBtn = findChild<QPushButton*>(PROP_PANEL_OK);
-  return anOkBtn->isEnabled();
-}
-
 void XGUI_PropertyPanel::setCancelEnabled(bool theEnabled)
 {
   QPushButton* anCancelBtn = findChild<QPushButton*>(PROP_PANEL_CANCEL);
index 6e89ac0d660ac5b44257bc8066e774fa1d68c3d3..e632fe28d47dee3418d0a5aea74066cf7d7b261c 100644 (file)
@@ -70,13 +70,6 @@ Q_OBJECT
   /// \brief Enable/Disable stretch area in the panel
   void setStretchEnabled(bool isEnabled);
 
-  /// Set Enable/Disable state of Ok button
-  /// \param theEnabled Enable/Disable state of Ok button
-  virtual void setOkEnabled(bool theEnabled);
-
-  /// \return Enable/disable state of Ok button
-  virtual bool isOkEnabled() const;
-
   /// Set Enable/Disable state of Cancel button
   /// \param theEnabled Enable/Disable state of Cancel button
   virtual void setCancelEnabled(bool theEnabled);
index 7aa6fc34f2dafcc3df5e0628d1a2fba94675f453..f7c2211bd55ed05edc29c1240105d9c865c67350 100644 (file)
 #include <QEvent>
 #include <QString>
 
+/**
+* Class of event to send application events in multi thread environment
+*/
 class XGUI_EXPORT PostponeMessageQtEvent : public QEvent
 {
  public:
   static QEvent::Type PostponeMessageQtEventType;
 
+  /// Constructor
+  /// \param theMessage an event message to send
   PostponeMessageQtEvent(const std::shared_ptr<Events_Message>& theMessage)
       : QEvent(PostponeMessageQtEventType),
       myMessage(theMessage)
   {
   }
+
+  /// Returns type of the event
   static QEvent::Type type()
   {
     return PostponeMessageQtEventType;
   }
 
+  /// Returns current messasge
   std::shared_ptr<Events_Message> postponedMessage();
 
  private:
+   /// Message
   std::shared_ptr<Events_Message> myMessage;
 };
 
index b0d22089f8c3da6c6c7fe48836be2822bbe9225d..8304179726f246d4106c5cef7f06256dd71a53b5 100644 (file)
@@ -18,6 +18,8 @@
 #include <ModelAPI_Result.h>
 #include <ModelAPI_Object.h>
 
+#include <SelectMgr_ListIteratorOfListOfFilter.hxx>
+
 XGUI_SelectionMgr::XGUI_SelectionMgr(XGUI_Workshop* theParent)
     : QObject(theParent),
       myWorkshop(theParent)
@@ -57,6 +59,30 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the
   }
 }
 
+//**************************************************************
+void XGUI_SelectionMgr::updateSelectedOwners(bool isUpdateViewer)
+{
+  Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+  const SelectMgr_ListOfFilter& aFilters = aContext->Filters();
+
+  SelectMgr_IndexedMapOfOwner anOwnersToDeselect;
+
+  SelectMgr_ListIteratorOfListOfFilter anIt(aFilters);
+  for (; anIt.More(); anIt.Next()) {
+    Handle(SelectMgr_Filter) aFilter = anIt.Value();
+    for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected()) {
+      Handle(SelectMgr_EntityOwner) anOwner = aContext->SelectedOwner();
+      if (!aFilter->IsOk(anOwner))
+        anOwnersToDeselect.Add(aContext->SelectedOwner());
+    }
+  }
+
+  setSelectedOwners(anOwnersToDeselect, false);
+
+  if (isUpdateViewer)
+    aContext->UpdateCurrentViewer();
+}
+
 //**************************************************************
 void XGUI_SelectionMgr::onObjectBrowserSelection()
 {
index f1665a7465203a6e0670d7d3c19df7272e7810d3..6503f175d93b27fa53d1f694b89d6929837d4b5f 100644 (file)
@@ -43,6 +43,10 @@ Q_OBJECT
   void setSelectedOwners(const SelectMgr_IndexedMapOfOwner& theSelectedOwners,
                          bool isUpdateViewer);
 
+  //! Check that the selected owners are valid for the current filters
+  /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
+  void updateSelectedOwners(bool isUpdateViewer);
+
 signals:
   //! Emited when selection in a one of viewers was changed
   void selectionChanged();
index 742b0adc063ab6537b1b3d521ff3280921a0c8e1..d11c8043a05db60aa90bd3e2c426defc5789f426 100644 (file)
@@ -1106,7 +1106,7 @@ void XGUI_Workshop::createDockWidgets()
   connect(aCancelBtn, SIGNAL(clicked()), myOperationMgr, SLOT(onAbortOperation()));
   connect(myPropertyPanel, SIGNAL(keyReleased(QKeyEvent*)), myOperationMgr,
           SLOT(onKeyReleased(QKeyEvent*)));
-  connect(myOperationMgr, SIGNAL(operationValidated(bool)), myPropertyPanel,
+  connect(myOperationMgr, SIGNAL(applyEnableChanged(bool)), myPropertyPanel,
           SLOT(setAcceptEnabled(bool)));
 
 }