Change the feature create operation to work without a custom presentation.
ADD_DEFINITIONS(-DMODULEBASE_EXPORTS ${CAS_DEFINITIONS})
ADD_LIBRARY(ModuleBase SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-TARGET_LINK_LIBRARIES(ModuleBase ${PROJECT_LIBRARIES})
+TARGET_LINK_LIBRARIES(ModuleBase GeomAPI ${PROJECT_LIBRARIES})
INSTALL(TARGETS ModuleBase DESTINATION bin)
aCustom->storeValue(myFeature);
}
+void ModuleBase_Operation::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
+{
+}
+
void ModuleBase_Operation::startOperation()
{
if (!myIsEditing)
#include <boost/shared_ptr.hpp>
class ModelAPI_Document;
+class ModuleBase_ModelWidget;
class QKeyEvent;
bool isEditOperation() const { return myIsEditing; }
+public slots:
+ /// Slots which listen the mode widget activation
+ /// \param theWidget the model widget
+ virtual void onWidgetActivated(ModuleBase_ModelWidget* theWidget);
+
+signals:
+ /// Signals about the activating of the next widget
+ /// \param theWidget the previous active widget
+ void activateNextWidget(ModuleBase_ModelWidget* theWidget);
+
protected:
/// Virtual method called when operation started (see start() method for more description)
/// Default impl calls corresponding slot and commits immediately.
#include <ModelAPI_Data.h>
#include <ModelAPI_Object.h>
#include <GeomDataAPI_Point2D.h>
+#include <GeomAPI_Pnt2d.h>
#include <QGroupBox>
#include <QGridLayout>
{
}
+void ModuleBase_WidgetPoint2D::setPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint)
+{
+ bool isBlocked = this->blockSignals(true);
+ myXSpin->setValue(thePoint->x());
+ myYSpin->setValue(thePoint->y());
+ this->blockSignals(isBlocked);
+
+ emit valuesChanged();
+}
+
bool ModuleBase_WidgetPoint2D::storeValue(FeaturePtr theFeature) const
{
boost::shared_ptr<ModelAPI_Data> aData = theFeature->data();
#include <QObject>
class ModelAPI_Feature;
+class GeomAPI_Pnt2d;
class QGroupBox;
class QDoubleSpinBox;
/// Destructor
virtual ~ModuleBase_WidgetPoint2D();
+ /// Fill the widget values by given point
+ /// \param thePoint the point
+ void setPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
+
/// Saves the internal parameters to the given feature
/// \param theFeature a model feature to be changed
virtual bool storeValue(FeaturePtr theFeature) const;
PartSet_OperationCreateFeature.h
PartSet_OperationEditConstraint.h
PartSet_OperationEditFeature.h
+ PartSet_OperationFeatureCreate.h
PartSet_OperationSketchBase.h
PartSet_OperationSketch.h
PartSet_Presentation.h
PartSet_OperationCreateFeature.cpp
PartSet_OperationEditConstraint.cpp
PartSet_OperationEditFeature.cpp
+ PartSet_OperationFeatureCreate.cpp
PartSet_OperationSketchBase.cpp
PartSet_OperationSketch.cpp
PartSet_Presentation.cpp
#include <PartSet_OperationEditFeature.h>
#include <PartSet_OperationEditConstraint.h>
#include <PartSet_OperationCreateConstraint.h>
+#include <PartSet_OperationFeatureCreate.h>
#include <ModuleBase_Operation.h>
#include <ModuleBase_OperationDescription.h>
#include <ModuleBase_WidgetFactory.h>
PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
if (aPrevOp)
aSketch = aPrevOp->sketch();
- if (PartSet_OperationCreateFeature::canProcessKind(theCmdId))
+ if (PartSet_OperationFeatureCreate::canProcessKind(theCmdId))
+ anOperation = new PartSet_OperationFeatureCreate(theCmdId.c_str(), this, aSketch);
+ else if (PartSet_OperationCreateFeature::canProcessKind(theCmdId))
anOperation = new PartSet_OperationCreateFeature(theCmdId.c_str(), this, aSketch);
else if (theCmdId == PartSet_OperationEditFeature::Type())
anOperation = new PartSet_OperationEditFeature(theCmdId.c_str(), this, aSketch);
--- /dev/null
+// File: PartSet_OperationFeatureCreate.h
+// Created: 20 Apr 2014
+// Author: Natalia ERMOLAEVA
+
+#include <PartSet_OperationFeatureCreate.h>
+
+#include <PartSet_Tools.h>
+#include <PartSet_OperationSketch.h>
+#include <PartSet_FeaturePointPrs.h>
+#include <PartSet_FeatureLinePrs.h>
+#include <PartSet_FeatureCirclePrs.h>
+#include <PartSet_FeatureArcPrs.h>
+
+#include <SketchPlugin_Feature.h>
+#include <SketchPlugin_Point.h>
+#include <SketchPlugin_Line.h>
+#include <SketchPlugin_Circle.h>
+#include <SketchPlugin_Arc.h>
+
+#include <GeomAPI_Pnt2d.h>
+
+#include <ModuleBase_OperationDescription.h>
+#include <ModuleBase_WidgetPoint2D.h>
+
+#include <XGUI_ViewerPrs.h>
+#include <XGUI_Constants.h>
+
+#include <V3d_View.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS.hxx>
+#include <BRep_Tool.hxx>
+
+#ifdef _DEBUG
+#include <QDebug>
+#endif
+
+#include <QMouseEvent>
+
+using namespace std;
+
+PartSet_OperationFeatureCreate::PartSet_OperationFeatureCreate(const QString& theId,
+ QObject* theParent,
+ FeaturePtr theFeature)
+: PartSet_OperationSketchBase(theId, theParent), mySketch(theFeature), myActiveWidget(0)
+ //myPointSelectionMode(SM_FirstPoint)
+{
+ //std::string aKind = theId.toStdString();
+ //myFeaturePrs = PartSet_Tools::createFeaturePrs(aKind, theFeature);
+}
+
+PartSet_OperationFeatureCreate::~PartSet_OperationFeatureCreate()
+{
+}
+
+bool PartSet_OperationFeatureCreate::canProcessKind(const std::string& theId)
+{
+ return theId == SKETCH_LINE_KIND;/* || theId == SKETCH_POINT_KIND || theId == SKETCH_CIRCLE_KIND ||
+ theId == SKETCH_ARC_KIND;*/
+}
+
+bool PartSet_OperationFeatureCreate::canBeCommitted() const
+{
+ return !myActiveWidget;//myPointSelectionMode == SM_DonePoint;
+}
+
+bool PartSet_OperationFeatureCreate::isGranted(ModuleBase_IOperation* theOperation) const
+{
+ return theOperation->getDescription()->operationId().toStdString() == PartSet_OperationSketch::Type();
+}
+
+std::list<int> PartSet_OperationFeatureCreate::getSelectionModes(FeaturePtr theFeature) const
+{
+ std::list<int> aModes;
+ if (theFeature != feature())
+ aModes = PartSet_OperationSketchBase::getSelectionModes(theFeature);
+ return aModes;
+}
+
+void PartSet_OperationFeatureCreate::init(FeaturePtr theFeature,
+ const std::list<XGUI_ViewerPrs>& /*theSelected*/,
+ const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
+{
+ if (!theFeature || theFeature->getKind() != SKETCH_LINE_KIND)
+ return;
+ myInitFeature = theFeature;
+}
+
+FeaturePtr PartSet_OperationFeatureCreate::sketch() const
+{
+ return mySketch;
+}
+
+void PartSet_OperationFeatureCreate::mouseReleased(QMouseEvent* theEvent, Handle(V3d_View) theView,
+ const std::list<XGUI_ViewerPrs>& theSelected,
+ const std::list<XGUI_ViewerPrs>& /*theHighlighted*/)
+{
+ if (canBeCommitted()/*myPointSelectionMode == SM_DonePoint*/)
+ {
+ // if the point creation is finished, the next mouse release should commit the modification
+ // the next release can happens by double click in the viewer
+ commit();
+ restartOperation(feature()->getKind(), feature());
+ return;
+ }
+
+ double aX, anY;
+
+ gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView);
+ if (theSelected.empty()) {
+ PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
+ }
+ else {
+ XGUI_ViewerPrs aPrs = theSelected.front();
+ const TopoDS_Shape& aShape = aPrs.shape();
+ if (!aShape.IsNull()) // the point is selected
+ {
+ if (aShape.ShapeType() == TopAbs_VERTEX) {
+ const TopoDS_Vertex& aVertex = TopoDS::Vertex(aShape);
+ if (!aVertex.IsNull()) {
+ aPoint = BRep_Tool::Pnt(aVertex);
+ PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
+
+ //myFeaturePrs->setConstraints(aX, anY, myPointSelectionMode);
+ }
+ }
+ else if (aShape.ShapeType() == TopAbs_EDGE) // the line is selected
+ {
+ PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
+ // move to selected line
+ if (feature()->getKind() == SKETCH_LINE_KIND) {
+ //boost::shared_ptr<PartSet_FeatureLinePrs> aLinePrs =
+ // boost::dynamic_pointer_cast<PartSet_FeatureLinePrs>(myFeaturePrs);
+ //if (aLinePrs) {
+ // FeaturePtr aFeature = aPrs.feature();
+ //aLinePrs->projectPointOnLine(aFeature, myPointSelectionMode, aPoint, theView, aX, anY);
+ //}
+ }
+ }
+ }
+ }
+
+ setWidgetPoint(aX, anY);
+ flushUpdated();
+ emit activateNextWidget(myActiveWidget);
+
+ /*switch (myPointSelectionMode)
+ {
+ case SM_FirstPoint:
+ case SM_SecondPoint:
+ case SM_ThirdPoint: {
+ if (feature()->getKind() == SKETCH_ARC_KIND) {
+ boost::shared_ptr<PartSet_FeatureArcPrs> anArcPrs =
+ boost::dynamic_pointer_cast<PartSet_FeatureArcPrs>(myFeaturePrs);
+ if (anArcPrs) {
+ anArcPrs->projectPointOnFeature(feature(), sketch(), aPoint, theView, aX, anY);
+ }
+ }
+ PartSet_SelectionMode aMode = myFeaturePrs->setPoint(aX, anY, myPointSelectionMode);
+ flushUpdated();
+ setPointSelectionMode(aMode);
+ }
+ break;
+ default:
+ break;
+ }*/
+}
+
+void PartSet_OperationFeatureCreate::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView)
+{
+ if (canBeCommitted()/*myPointSelectionMode == SM_DonePoint*/) {
+ commit();
+ restartOperation(feature()->getKind(), feature());
+ }
+ else {
+ /*switch (myPointSelectionMode)
+ {
+ case SM_FirstPoint:
+ case SM_SecondPoint:
+ case SM_ThirdPoint:
+ {*/
+ double aX, anY;
+ gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), theView);
+ PartSet_Tools::convertTo2D(aPoint, sketch(), theView, aX, anY);
+ /*if (myPointSelectionMode == SM_ThirdPoint) {
+ if (feature()->getKind() == SKETCH_ARC_KIND) {
+ boost::shared_ptr<PartSet_FeatureArcPrs> anArcPrs =
+ boost::dynamic_pointer_cast<PartSet_FeatureArcPrs>(myFeaturePrs);
+ if (anArcPrs) {
+ anArcPrs->projectPointOnFeature(feature(), sketch(), aPoint, theView, aX, anY);
+ }
+ }
+ }*/
+ //myFeaturePrs->setPoint(aX, anY, myPointSelectionMode);
+ setWidgetPoint(aX, anY);
+ flushUpdated();
+ //emit focusActivated(myFeaturePrs->getAttribute(myPointSelectionMode));
+ //emit activateNextWidget(myActiveWidget);
+ /*}
+ break;
+ case SM_DonePoint:
+ {
+ commit();
+ restartOperation(feature()->getKind(), feature());
+ }
+ default:
+ break;*/
+ }
+}
+
+void PartSet_OperationFeatureCreate::keyReleased(std::string theName, QKeyEvent* theEvent)
+{
+ int aKeyType = theEvent->key();
+ // the second point should be activated by any modification in the property panel
+ if (!theName.empty())
+ {
+ //setPointSelectionMode(myFeaturePrs->getNextMode(theName), false);
+ }
+ keyReleased(theEvent->key());
+}
+
+void PartSet_OperationFeatureCreate::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
+{
+ myActiveWidget = theWidget;
+}
+
+void PartSet_OperationFeatureCreate::keyReleased(const int theKey)
+{
+ switch (theKey) {
+ case Qt::Key_Return: {
+ if (canBeCommitted()/*myPointSelectionMode == SM_DonePoint*/)
+ {
+ commit();
+ // it start a new line creation at a free point
+ restartOperation(feature()->getKind(), FeaturePtr()/*feature()*/);
+ }
+ }
+ break;
+ case Qt::Key_Escape: {
+ if (canBeCommitted()/*myPointSelectionMode == SM_DonePoint*/)
+ {
+ commit();
+ }
+ else
+ {
+ abort();
+ }
+ }
+ default:
+ break;
+ }
+}
+
+void PartSet_OperationFeatureCreate::startOperation()
+{
+ PartSet_OperationSketchBase::startOperation();
+ //setPointSelectionMode(!myInitFeature ? SM_FirstPoint : SM_SecondPoint);
+
+ emit multiSelectionEnabled(false);
+}
+
+void PartSet_OperationFeatureCreate::abortOperation()
+{
+ emit featureConstructed(feature(), FM_Hide);
+ PartSet_OperationSketchBase::abortOperation();
+}
+
+void PartSet_OperationFeatureCreate::stopOperation()
+{
+ PartSet_OperationSketchBase::stopOperation();
+ emit multiSelectionEnabled(true);
+}
+
+void PartSet_OperationFeatureCreate::afterCommitOperation()
+{
+ PartSet_OperationSketchBase::afterCommitOperation();
+ emit featureConstructed(feature(), FM_Deactivation);
+}
+
+FeaturePtr PartSet_OperationFeatureCreate::createFeature(const bool theFlushMessage)
+{
+ FeaturePtr aNewFeature = ModuleBase_Operation::createFeature(false);
+ if (sketch()) {
+ boost::shared_ptr<SketchPlugin_Feature> aFeature =
+ boost::dynamic_pointer_cast<SketchPlugin_Feature>(sketch());
+
+ aFeature->addSub(aNewFeature);
+ }
+ //myFeaturePrs->init(aNewFeature);
+ //myFeaturePrs->setFeature(myInitFeature, SM_FirstPoint);
+
+ emit featureConstructed(aNewFeature, FM_Activation);
+ if (theFlushMessage)
+ flushCreated();
+ return aNewFeature;
+}
+
+/*void PartSet_OperationFeatureCreate::setPointSelectionMode(const PartSet_SelectionMode& theMode,
+ const bool isToEmitSignal)
+{
+ myPointSelectionMode = theMode;
+ if (isToEmitSignal) {
+ std::string aName = myFeaturePrs->getAttribute(theMode);
+ if (aName.empty() && theMode == SM_DonePoint) {
+ aName = XGUI::PROP_PANEL_OK;
+ }
+ emit focusActivated(aName);
+ }
+}*/
+
+void PartSet_OperationFeatureCreate::setWidgetPoint(double theX, double theY)
+{
+ ModuleBase_WidgetPoint2D* aWidget = dynamic_cast<ModuleBase_WidgetPoint2D*>(myActiveWidget);
+ aWidget->setPoint(boost::shared_ptr<GeomAPI_Pnt2d>(new GeomAPI_Pnt2d(theX, theY)));
+}
\ No newline at end of file
--- /dev/null
+// File: PartSet_OperationFeatureCreate.h
+// Created: 20 Apr 2014
+// Author: Natalia ERMOLAEVA
+
+#ifndef PartSet_OperationFeatureCreate_H
+#define PartSet_OperationFeatureCreate_H
+
+#include "PartSet.h"
+
+#include <PartSet_OperationSketchBase.h>
+#include <PartSet_Constants.h>
+
+#include <QObject>
+
+class PartSet_FeaturePrs;
+class GeomDataAPI_Point2D;
+class QMouseEvent;
+class QKeyEvent;
+
+/*!
+ \class PartSet_OperationFeatureCreate
+ * \brief The operation for the sketch feature creation
+*/
+class PARTSET_EXPORT PartSet_OperationFeatureCreate : public PartSet_OperationSketchBase
+{
+ Q_OBJECT
+
+public:
+ /// Returns true if the feature with the given kind can be created by this operation
+ /// \param theId the feature kind
+ /// \return the boolean result
+ static bool canProcessKind(const std::string& theId);
+
+public:
+ /// Constructor
+ /// \param theId the feature identifier
+ /// \param theParent the operation parent
+ /// \param theSketch the parent feature
+ PartSet_OperationFeatureCreate(const QString& theId, QObject* theParent,
+ FeaturePtr theSketch);
+ /// Destructor
+ virtual ~PartSet_OperationFeatureCreate();
+
+ /// Verifies whether this operator can be commited.
+ /// \return Returns TRUE if current operation can be committed, e.g. all parameters are filled
+ virtual bool canBeCommitted() const;
+
+ /// Returns that this operator can be started above already running one.
+ /// The runned operation should be the sketch feature modified operation
+ /// \param theOperation the previous running operation
+ virtual bool isGranted(ModuleBase_IOperation* theOperation) const;
+
+ /// Returns the operation local selection mode
+ /// \param theFeature the feature object to get the selection mode
+ /// \return the selection mode
+ virtual std::list<int> getSelectionModes(FeaturePtr theFeature) const;
+
+ /// Initializes some fields accorging to the feature
+ /// \param theSelected the list of selected presentations
+ /// \param theHighlighted the list of highlighted presentations
+ virtual void init(FeaturePtr theFeature,
+ const std::list<XGUI_ViewerPrs>& theSelected,
+ const std::list<XGUI_ViewerPrs>& theHighlighted);
+
+ /// Returns the operation sketch feature
+ /// \returns the sketch instance
+ virtual FeaturePtr sketch() const;
+
+ /// Gives the current selected objects to be processed by the operation
+ /// \param theEvent the mouse event
+ /// \param theView a viewer to have the viewer the eye position
+ /// \param theSelected the list of selected presentations
+ /// \param theHighlighted the list of highlighted presentations
+ virtual void mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
+ const std::list<XGUI_ViewerPrs>& theSelected,
+ const std::list<XGUI_ViewerPrs>& theHighlighted);
+ /// Gives the current mouse point in the viewer
+ /// \param thePoint a point clicked in the viewer
+ /// \param theEvent the mouse event
+ virtual void mouseMoved(QMouseEvent* theEvent, Handle_V3d_View theView);
+ /// Processes the key pressed in the view
+ /// \param theKey a key value
+ virtual void keyReleased(const int theKey);
+
+ virtual void keyReleased(std::string theName, QKeyEvent* theEvent);
+
+public slots:
+ /// Slots which listen the mode widget activation
+ /// \param theWidget the model widget
+ virtual void onWidgetActivated(ModuleBase_ModelWidget* theWidget);
+
+protected:
+ /// \brief Virtual method called when operation is started
+ /// Virtual method called when operation started (see start() method for more description)
+ /// After the parent operation body perform, set sketch feature to the created line feature
+ virtual void startOperation();
+
+ /// Virtual method called when operation aborted (see abort() method for more description)
+ /// Before the feature is aborted, it should be hidden from the viewer
+ virtual void abortOperation();
+
+ /// Virtual method called when operation stopped - committed or aborted.
+ /// Restore the multi selection state
+ virtual void stopOperation();
+
+ /// Virtual method called after operation committed (see commit() method for more description)
+ virtual void afterCommitOperation();
+
+ /// Creates an operation new feature
+ /// In addition to the default realization it appends the created line feature to
+ /// the sketch feature
+ /// \param theFlushMessage the flag whether the create message should be flushed
+ /// \returns the created feature
+ virtual FeaturePtr createFeature(const bool theFlushMessage = true);
+
+protected:
+ ///< Set the point selection mode. Emit signal about focus change if necessary.
+ /// \param theMode a new selection mode
+ /// \param isToEmitSignal the neccessity to emit signal
+ //void setPointSelectionMode(const PartSet_SelectionMode& theMode,
+ // const bool isToEmitSignal = true);
+
+ /// Set the widget point
+ /// \param theX the horizontal coordinate
+ /// \param theY the vertical coordinate
+ void setWidgetPoint(double theX, double theY);
+
+private:
+ //boost::shared_ptr<PartSet_FeaturePrs> myFeaturePrs; ///< the feature presentation
+ FeaturePtr myInitFeature; ///< the initial feature
+ FeaturePtr mySketch; ///< the sketch of the feature
+ //PartSet_SelectionMode myPointSelectionMode; ///< point selection mode
+
+ ModuleBase_ModelWidget* myActiveWidget; ///< the active widget
+};
+
+#endif
connect(theOperation, SIGNAL(stopped()), this, SLOT(onOperationStopped()));
connect(theOperation, SIGNAL(started()), this, SIGNAL(operationStarted()));
connect(theOperation, SIGNAL(resumed()), this, SIGNAL(operationResumed()));
+ connect(theOperation, SIGNAL(activateNextWidget(ModuleBase_ModelWidget*)),
+ this, SIGNAL(activateNextWidget(ModuleBase_ModelWidget*)));
theOperation->start();
return true;
if (anOperation)
anOperation->keyReleased(theName, theEvent);
}
+
+void XGUI_OperationMgr::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
+{
+ ModuleBase_Operation* anOperation = currentOperation();
+ if (anOperation)
+ anOperation->onWidgetActivated(theWidget);
+}
void operationStopped(ModuleBase_Operation* theOperation);
/// Signal about an operation is resumed. It is emitted after the resume() of operation is done.
void operationResumed();
+ /// Signal about the necessety of the next widget activating
+ /// \param theWidget the model widget
+ void activateNextWidget(ModuleBase_ModelWidget* theWidget);
protected:
/// Sets the current operation or NULL
/// \param theEvent the mouse event
void onKeyReleased(const std::string& theName, QKeyEvent* theEvent);
+ /// SLOT, that reacts to the widget activation
+ /// \param theWidget an activated widget
+ void onWidgetActivated(ModuleBase_ModelWidget* theWidget);
+
private:
typedef QList<ModuleBase_Operation*> Operations; ///< definition for a list of operations
Operations myOperations; ///< a stack of started operations. The active operation is on top,
}
}
ModuleBase_ModelWidget* aWidget = theWidgets.first();
- if (aWidget)
- aWidget->focusTo();
+ if (aWidget) {
+ activateWidget(aWidget);
+ }
}
}
}
}
}
+
+void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget)
+{
+ ModuleBase_ModelWidget* aNextWidget = 0;
+
+ QList<ModuleBase_ModelWidget*>::const_iterator anIt = myWidgets.begin(),
+ aLast = myWidgets.end();
+ for (;anIt != aLast; anIt++)
+ {
+ if ((*anIt) == theWidget) {
+ anIt++;
+ if (anIt != aLast)
+ aNextWidget = *anIt;
+ break;
+ }
+ }
+ activateWidget(aNextWidget);
+}
+
+void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget)
+{
+ if (theWidget)
+ theWidget->focusTo();
+ emit widgetActivated(theWidget);
+}
/// slot to set the focus to the widget visualized an attribute with the given name
/// \param theAttributteName
void onFocusActivated(const std::string& theAttributeName);
+ /// slot to activate the next widget in the property panel
+ /// \param theWidget a widget. The next widget should be activated
+ void onActivateNextWidget(ModuleBase_ModelWidget* theWidget);
signals:
/// The signal about key release on the control, that corresponds to the attribute
/// \param theAttributeName a name of the attribute
/// \param theEvent key release event
void keyReleased(const std::string& theAttributeName, QKeyEvent* theEvent);
+ /// The signal about the widget activation
+ /// \param theWidget the activated widget
+ void widgetActivated(ModuleBase_ModelWidget* theWidget);
+
+protected:
+ /// Activate the widget, which means the focus on the widget.
+ /// The signal about the widget activation is emitted
+ /// \param theWidget
+ void activateWidget(ModuleBase_ModelWidget* theWidget);
private:
QWidget* myCustomWidget;
connect(myPropertyPanel, SIGNAL(keyReleased(const std::string&, QKeyEvent*)),
myOperationMgr, SLOT(onKeyReleased(const std::string&, QKeyEvent*)));
+
+ connect(myPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)),
+ myOperationMgr, SLOT(onWidgetActivated(ModuleBase_ModelWidget*)));
+ connect(myOperationMgr, SIGNAL(activateNextWidget(ModuleBase_ModelWidget*)),
+ myPropertyPanel, SLOT(onActivateNextWidget(ModuleBase_ModelWidget*)));
}
//******************************************************