Salome HOME
Update code documentation
authorvsv <vitaly.smetannikov@opencascade.com>
Tue, 27 Jan 2015 13:14:14 +0000 (16:14 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Tue, 27 Jan 2015 13:14:14 +0000 (16:14 +0300)
17 files changed:
src/ModuleBase/ModuleBase_FilterNoConsructionSubShapes.h
src/ModuleBase/ModuleBase_ISelection.h
src/ModuleBase/ModuleBase_Preferences.cpp
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/NewGeom/NewGeom_OCCSelector.h
src/NewGeom/NewGeom_SalomeViewer.h
src/XGUI/XGUI_ErrorDialog.h
src/XGUI/XGUI_QtEvents.h

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 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 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 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 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 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;
 };