PartSet_SketcherMgr::PartSet_SketcherMgr(PartSet_Module* theModule)
: QObject(theModule), myModule(theModule), myIsDragging(false), myDragDone(false),
- myIsPropertyPanelValueChanged(false), myIsMouseOverWindow(false),
+ myIsResetCurrentValue(false), myIsMouseOverWindow(false),
myIsMouseOverViewProcessed(true), myPreviousUpdateViewerEnabled(true),
myIsPopupMenuActive(false), myIsConstraintsShown(true)
{
// the mouse move and use the cursor position to update own values. If the presentaion is
// redisplayed before this update, the feature presentation jumps from reset value to current.
myIsMouseOverWindow = true;
- myIsPropertyPanelValueChanged = false;
+ myIsResetCurrentValue = false;
operationMgr()->onValidateOperation();
#ifdef DEBUG_MOUSE_OVER_WINDOW_FLAGS
qDebug(QString("onEnterViewPort: %1").arg(mouseOverWindowFlagsInfo()).toStdString().c_str());
{
myIsMouseOverViewProcessed = false;
myIsMouseOverWindow = false;
- myIsPropertyPanelValueChanged = false;
operationMgr()->onValidateOperation();
#ifdef DEBUG_MOUSE_OVER_WINDOW_FLAGS
qDebug(QString("onLeaveViewPort: %1").arg(mouseOverWindowFlagsInfo()).toStdString().c_str());
ModuleBase_Operation* aOperation = getCurrentOperation();
ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
ModuleBase_ModelWidget* aActiveWgt = aPanel->activeWidget();
- if (aActiveWgt) {
- aActiveWgt->reset();
+ if (aActiveWgt && aActiveWgt->reset()) {
+ myIsResetCurrentValue = true;
}
aDisplayer->enableUpdateViewer(isEnableUpdateViewer);
// hides the presentation of the current operation feature
- //myIsPropertyPanelValueChanged = false;
// the feature is to be erased here, but it is correct to call canDisplayObject because
// there can be additional check (e.g. editor widget in distance constraint)
FeaturePtr aFeature = getCurrentOperation()->feature();
return;
// visualize the current operation feature
- myIsPropertyPanelValueChanged = true;
+ myIsResetCurrentValue = false;
operationMgr()->onValidateOperation();
ModuleBase_Operation* aOperation = getCurrentOperation();
// the feature is to be erased here, but it is correct to call canDisplayObject because
void PartSet_SketcherMgr::stopNestedSketch(ModuleBase_Operation* theOp)
{
connectToPropertyPanel(false);
- myIsPropertyPanelValueChanged = false;
+ myIsResetCurrentValue = false;
myIsMouseOverViewProcessed = true;
operationMgr()->onValidateOperation();
}
{
bool aCanCommit = true;
- if (isNestedCreateOperation(getCurrentOperation()) && !canDisplayCurrentCreatedFeature())
+ if (isNestedCreateOperation(getCurrentOperation()) && myIsResetCurrentValue)
aCanCommit = false;
return aCanCommit;
bool PartSet_SketcherMgr::canDisplayCurrentCreatedFeature() const
{
- return myIsPropertyPanelValueChanged || myIsMouseOverWindow;
+ return myIsMouseOverWindow || !myIsResetCurrentValue;
#ifdef DEBUG_MOUSE_OVER_WINDOW_FLAGS
qDebug(QString("canDisplayCurrentCreatedFeature: %1").arg(mouseOverWindowFlagsInfo()).toStdString().c_str());
#endif
QString PartSet_SketcherMgr::mouseOverWindowFlagsInfo() const
{
- return QString("myIsPropertyPanelValueChanged = %1, myIsMouseOverWindow = %2")
- .arg(myIsPropertyPanelValueChanged).arg(myIsMouseOverWindow);
+ return QString("myIsResetCurrentValue = %1, myIsMouseOverWindow = %2")
+ .arg(myIsResetCurrentValue).arg(myIsMouseOverWindow);
}
XGUI_OperationMgr* PartSet_SketcherMgr::operationMgr() const
void visualizeFeature(ModuleBase_Operation* theOperation, const bool isToDisplay,
const bool isFlushRedisplay = true);
private:
- /// Gives a debug information about internal flags myIsMouseOverWindow and myIsPropertyPanelValueChanged
+ /// Gives a debug information about internal flags myIsMouseOverWindow and myIsResetCurrentValue
/// \return a string value
QString mouseOverWindowFlagsInfo() const;
bool myPreviousSelectionEnabled; // the previous selection enabled state in the viewer
bool myIsDragging;
bool myDragDone;
- bool myIsPropertyPanelValueChanged; /// the state that value in the property panel is changed
+ bool myIsResetCurrentValue; /// the state that value in the property panel is reset
bool myIsMouseOverWindow; /// the state that the mouse over the view
bool myIsMouseOverViewProcessed; /// the state whether the over view state is processed by mouseMove method
bool myIsPopupMenuActive; /// the state of the popup menu is shown