Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sketcher: add geo history to resuse deleted geo id
The behavior is controlled by the following parameter: BaseApp/Preferences/Mod/Sketcher/GeoHistoryLevel 0 : disable, 1(default) : reuse id only if the new geometries's both start and end points matches some deleted geometry, 2 : resuse id when either start or end points matches some deleted geometry. It works like this. The sketch object will keep an adjacency list of each existing geometries. Every time the geometry changes, a new boost::geometry::retree is built based on existing vertex positions. The adjacency list is updated while the rtree is built. The list will sychronize the adjacency id list of all existing geometry, but keep any delete geometry id unchanged. When new geometry is created, sketch object will query the rtree based on the start and end points of the new geometry, and try to find any deleted geometries id's that are connected to the same existing geometries that owns the hitting points, and reuse its id. The net effect is that, say, when you delete an edge in a square, and replace it with a bspline, the bspline will have the exact same id as the deleted line. So, if you only delete and replace one edge at a time, you can change the type of all edges while keeping the same id's. Moving points during the process will not have any negative effect.
- Loading branch information