myOK(false),
myLineWidth(lineWidth),
myGeometryGUI(theGeometryGUI),
- myLengthIORedoList()
+ myLengthIORedoList(),
+ myIsUndoRedo(false)
{
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_UNDO")));
//=================================================================================
void EntityGUI_3DSketcherDlg::ClickOnUndo()
{
+ myIsUndoRedo = true;
if (myPointsList.count() > 0) {
myRedoList.append(myPointsList.last());
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myTextPrs);
// Remove last point from list
+ myWorkPoint = myPointsList.last();
myPointsList.removeLast();
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
UpdateButtonsState();
updateViewer();
}
+ myIsUndoRedo = false;
}
//=================================================================================
//=================================================================================
void EntityGUI_3DSketcherDlg::ClickOnRedo()
{
+ myIsUndoRedo = true;
if (myRedoList.count() > 0) {
myPointsList.append(myRedoList.last());
((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->Display(myTextPrs);
// Remove last point from redo list
+ myWorkPoint = myRedoList.last();
myRedoList.removeLast();
GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
UpdateButtonsState();
updateViewer();
}
+ myIsUndoRedo = false;
}
//=================================================================================
bool twoAngles = GroupAngles->checkBox->isChecked();
XYZ Last = getLastPoint();
- XYZ Current = getCurrentPoint();
+ XYZ Current;
+ if( myIsUndoRedo ) {
+ Current = myWorkPoint;
+ } else {
+ Current = getCurrentPoint();
+ }
+
XYZ Penultimate = getPenultimatePoint();
gp_Pnt P1 = gp_Pnt(Last.x,Last.y,Last.z);
}
}
// If no angles, the plane is the one formed by the last edge and the current one
- aNormal = gp_Dir(Vec1.Crossed(Vec2));
+ if(Abs(Vec1.CrossMagnitude(Vec2)) > Precision::Confusion()) {
+ aNormal = gp_Dir(Vec1.Crossed(Vec2));
+ }
}
return aNormal;
}