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
#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:
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;
}
}
-//**********************************************************
-//**********************************************************
-//**********************************************************
+/**
+* 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,
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;
};
/**
+* \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
};
/**
+* \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
*/
/**
+* \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:
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;
};
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();
}
/// 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;
};
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
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
return aMultiselectorWgt->getControl();
}
-QString ModuleBase_WidgetFactory::qs(const std::string& theStdString) const
+QString ModuleBase_WidgetFactory::qs(const std::string& theStdString)
{
return QString::fromStdString(theStdString);
}
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;
};
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
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;
};
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);
virtual bool focusTo() { return false; }
private:
+ /// A label control
QLabel* myLabel;
};
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;
};
#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);
};
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;
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();
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;
};
#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;
};