Skip to content

Commit

Permalink
Sketcher: add geo history to resuse deleted geo id
Browse files Browse the repository at this point in the history
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
realthunder committed Mar 3, 2018
1 parent 5fc101b commit 2ddd4b4
Show file tree
Hide file tree
Showing 5 changed files with 1,067 additions and 96 deletions.
Loading

0 comments on commit 2ddd4b4

Please sign in to comment.