View Issue Details

IDProjectCategoryView StatusLast Update
0002171SketcherBugpublic2015-06-25 14:47
Reporterwmayer Assigned Toabdullah  
PriorityurgentSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Fixed in Version0.16 
Summary0002171: Several issues when trying to delete an element of a sketch
DescriptionAfter fixing a crash you will see that deleted elements still get rendered. Even a recompute (or the option to auto-recompute) doesn't fix this. You have to leave and re-enter edit mode to avoid to render them.
Steps To ReproduceAs a test project get the attachment of this thread:
http://forum.freecadweb.org/viewtopic.php?f=3&t=11508&p=92665#p92693

Open the project and enter edit mode of the sketch. Delete the top upper horizontal line (line 9). ==> Crash in ViewProviderSketch::updateColor()

It crashes because the returned value of getSketchObject()->getGeometry(GeoId) (with GeoId = 15) is a null pointer. However, when fixing the crash by checking the returned value you will notice that the deleted element is still rendered.


Additional InformationA different behaviour occurs when deleting e.g. the element line 4. In this case it crashes inside ViewProviderSketch::drawConstraintIcons() on the line
> SoTranslation *translationPtr = static_cast<SoTranslation *>(sep->getChild(CONSTRAINT_SEPARATOR_INDEX_FIRST_TRANSLATION));
So, obviously the SoSeparator at this time doesn't have any children any more.
TagsNo tags attached.
FreeCAD Information

Activities

There are no notes attached to this issue.

Related Changesets

FreeCAD: master 21416961

2015-06-25 13:58:43

abdullah

Details Diff
Sketch: Bug fix: On delete crash with unsuccesful solving

==========================================================

Fixes the one reported by JMG here (Thanks!!):
http://forum.freecadweb.org/viewtopic.php?f=3&t=11508#p92693

Why?
- The newly introduced redrawing policy requires that the solver geometry matches in number the sketchobject geometry.
- Most (all) problems with updateColor or getGeometry returning a null pointer are related to an out of sync between UI geometry and SketchObject geometry.

General solution:
- In other bugs, a missing "solve()" is the problem, once the solver and sketchobject geometries have the same number, an SketchObject::OnChanged triggers
a VPSketch::draw (via VPSketch::updateData) which updates the UI geometry to match SketchObject geometry and then the problem does not arise.

Particular solution:
- In this bug, the problem is not a missing solve, but the fact that the solving was not succesful and did not synchronize the geometries, however triggering a
draw() on unsuccessful solving, syncronizes the UI geometry with the SketchObject geometry and the crash is gone.
Affected Issues
0002171
mod - src/Mod/Sketcher/Gui/ViewProviderSketch.cpp Diff File

FreeCAD: master cac47d25

2015-06-25 14:27:13

abdullah

Details Diff
Sketch: Bug Fix: Maintain the Elements and Constraint Widget synchronized

=========================================================================

What?
Sometimes this widgets where out of sync

Why?
Under the update only when it is redrawn policy, sometimes only one of them, i.e. the one associated with the property
triggering the updateData was updated.

Solution:
Both are updated after every redraw.

It also complements the previous bug fix related to crash on deleting, by updating the widgets to account for the deleted geometry.
Affected Issues
0002171
mod - src/Mod/Sketcher/Gui/ViewProviderSketch.cpp Diff File

Issue History

Date Modified Username Field Change
2015-06-25 12:18 wmayer New Issue
2015-06-25 12:18 wmayer Status new => assigned
2015-06-25 12:18 wmayer Assigned To => abdullah
2015-06-25 12:23 wmayer Reproducibility have not tried => always
2015-06-25 12:23 wmayer Steps to Reproduce Updated
2015-06-25 12:23 wmayer Additional Information Updated
2015-06-25 14:47 wmayer Changeset attached => FreeCAD Master master 21416961
2015-06-25 14:47 wmayer Changeset attached => FreeCAD Master master cac47d25
2015-06-25 14:47 wmayer Status assigned => closed
2015-06-25 14:47 wmayer Resolution open => fixed
2015-06-25 14:47 wmayer Fixed in Version => 0.16