From 5c531a300242bee57bdb1f54cbcb945c97ae2855 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 26 Jan 2015 16:07:38 +0300 Subject: [PATCH] Code documentation update --- doc/doxyfile.in | 2 +- src/ModuleBase/ModuleBase_FilterMulti.h | 3 + .../ModuleBase_SelectionValidator.h | 9 +++ src/ModuleBase/ModuleBase_WidgetDoubleValue.h | 4 +- .../ModuleBase_WidgetShapeSelector.h | 67 +++++++++++++++++-- src/XGUI/XGUI_Displayer.h | 11 +-- src/XGUI/XGUI_Selection.h | 5 ++ 7 files changed, 89 insertions(+), 12 deletions(-) diff --git a/doc/doxyfile.in b/doc/doxyfile.in index 5ca8b8a0d..c44dbe6f0 100644 --- a/doc/doxyfile.in +++ b/doc/doxyfile.in @@ -861,7 +861,7 @@ VERBATIM_HEADERS = YES # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. -ALPHABETICAL_INDEX = NO +ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns diff --git a/src/ModuleBase/ModuleBase_FilterMulti.h b/src/ModuleBase/ModuleBase_FilterMulti.h index e7ba0f175..2d5b7edaa 100644 --- a/src/ModuleBase/ModuleBase_FilterMulti.h +++ b/src/ModuleBase/ModuleBase_FilterMulti.h @@ -13,6 +13,9 @@ #include +/** +* An implementation of filter which support using of several filters according to OR statement +*/ class ModuleBase_FilterMulti: public ModuleBase_Filter { /** diff --git a/src/ModuleBase/ModuleBase_SelectionValidator.h b/src/ModuleBase/ModuleBase_SelectionValidator.h index 180d59936..4863146bc 100644 --- a/src/ModuleBase/ModuleBase_SelectionValidator.h +++ b/src/ModuleBase/ModuleBase_SelectionValidator.h @@ -15,10 +15,19 @@ #include #include +/** +* \class A validator of selection +*/ class ModuleBase_SelectionValidator : public ModelAPI_Validator { public: + /// \fn Returns True if selection is valid + /// \param theSelection selection instance virtual bool isValid(const ModuleBase_ISelection* theSelection) const = 0; + + /// \fn Returns True if selection is valid + /// \param theSelection selection instance + /// \param theArguments list of arguments virtual bool isValid(const ModuleBase_ISelection* theSelection, const std::list& theArguments) const { diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.h b/src/ModuleBase/ModuleBase_WidgetDoubleValue.h index 5c1ef4bb9..d956662a5 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.h +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.h @@ -19,7 +19,9 @@ class QTimer; /** * A class of property panel widget for double value input * It can be defined with "doublevalue" keyword. For example: -* "" +* \code +* +* \endcode */ class MODULEBASE_EXPORT ModuleBase_WidgetDoubleValue : public ModuleBase_ModelWidget { diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h index 7757d3141..755714ffd 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.h @@ -25,12 +25,46 @@ class QLineEdit; class QToolButton; class ModuleBase_IWorkshop; +/** +* Implementation of widget for shapes selection. +* This type of widget can be defined in XML file with 'shape_selector' keyword. +* For example: +* \code +* +* \endcode +* It can use following parameters: +* - id - name of object attribute +* - label - content of widget's label +* - icon - icon which can be used instead label +* - tooltip - the witget's tooltip text +* - shape_types - list of shape types for selection. +* Possible values: face, vertex, wire, edge, shell, solid +* - object_types - types of selectable objects. +* For today it supports only one type "construction" +* which corresponds to ModelAPI_ResultConstruction object type +* - concealment - hide or not hide selected object after operation +*/ class MODULEBASE_EXPORT ModuleBase_WidgetShapeSelector : public ModuleBase_ModelWidget { Q_OBJECT public: + + /// Converts string value (name of shape type) to shape enum value + /// \param theType - string with shape type name + /// \return TopAbs_ShapeEnum value static TopAbs_ShapeEnum shapeType(const QString& theType); + /// Constructor + /// \param theParent the parent object + /// \param theWorkshop instance of workshop interface + /// \param theData the widget configuation. The attribute of the model widget is obtained from + /// \param theParentId is Id of a parent of the current attribute ModuleBase_WidgetShapeSelector(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop, const Config_WidgetAPI* theData, const std::string& theParentId); @@ -52,6 +86,7 @@ Q_OBJECT /// \return a control list virtual QList getControls() const; + /// Returns currently selected data object ObjectPtr selectedFeature() const { return mySelectedObject; @@ -76,29 +111,34 @@ Q_OBJECT void activateSelection(bool toActivate); private slots: + /// Slot which is called on selection event void onSelectionChanged(); protected: + /// Computes and updates name of selected object in the widget void updateSelectionName(); - void raisePanel() const; - /// Returns true if shape of given object corresponds to requested shape type - /// This method is called only in non sub-shapes selection mode - //virtual bool acceptObjectShape(const ObjectPtr theObject) const; + /// Raise panel which contains this widget + void raisePanel() const; /// Returns true if selected shape corresponds to requested shape types - /// This method is called only in sub-shapes selection mode + /// \param theShape a shape virtual bool acceptSubShape(std::shared_ptr theShape) const; /// Returns true if selected object corresponds to requested Object type /// Thid method is used in any selection mode + /// \param theObject an object virtual bool acceptObjectType(const ObjectPtr theObject) const; // Set the given object as a value of the widget + /// \param theObj an object + /// \param theShape a shape void setObject(ObjectPtr theObj, std::shared_ptr theShape = std::shared_ptr()); /// Check the selected with validators if installed + /// \param theObj the object for checking + /// \param theShape the shape for checking virtual bool isValid(ObjectPtr theObj, std::shared_ptr theShape); /// Clear attribute @@ -106,20 +146,35 @@ Q_OBJECT //----------- Class members ------------- protected: + + /// Container of the widget's control QWidget* myContainer; + + /// Label of the widget QLabel* myLabel; + + /// Input control of the widget QLineEdit* myTextLine; + /// Reference to workshop ModuleBase_IWorkshop* myWorkshop; + /// Pointer to selected object ObjectPtr mySelectedObject; - std::shared_ptr myShape; + /// Pointer to selected shape + GeomShapePtr myShape; + + /// List of accepting shapes types QStringList myShapeTypes; + + /// List of accepting object types QStringList myObjectTypes; + /// Active/inactive flag bool myIsActive; + /// Filter by objects types Handle(ModuleBase_ObjectTypesFilter) myObjTypeFilter; }; diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index 75f424311..09a880ecf 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -35,11 +35,14 @@ class XGUI_Workshop; class XGUI_EXPORT XGUI_Displayer { public: - /// Enumeration of possible display mode + /// \enum display mode enum DisplayMode { - NoMode = -1, /// Mode is not defined - Wireframe, /// Wireframe display mode - Shading /// Shading display mode + /// Mode is not defined + NoMode = -1, + /// Wireframe display mode + Wireframe, + /// Shading display mode + Shading }; /// Constructor diff --git a/src/XGUI/XGUI_Selection.h b/src/XGUI/XGUI_Selection.h index 5dcd44ee1..5c3eb4a41 100644 --- a/src/XGUI/XGUI_Selection.h +++ b/src/XGUI/XGUI_Selection.h @@ -22,9 +22,14 @@ class XGUI_Workshop; +/** +* Implementation of \ref ModuleBase_ISelection interface. +*/ class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection { public: + /// Constructor + /// \param theWorkshop reference to workshop instance XGUI_Selection(XGUI_Workshop* theWorkshop); /// Returns a list of viewer selected presentations -- 2.39.2