Skip to content

Add a demote vertex operator; fix many issues.

David Thompson requested to merge dcthomp/smtk:demote-vertex-final into master

This commit adds a "demote vertex" operator that removes a manifold vertex (i.e., 0 or 2 edges attached), rewriting any incident edges as a single new edge. This commit should close #52 (closed) .

Details

Implementing this operator exposed quite a few issues in existing polygon operations and includes fixes for them. In more detail, this commit:

  • Moves cell-deletion code out of the polygon operator and into the polygon-session and base model classes.
  • Fixes an issue when removing free cells from a model:
    • Dual arrangements were not being located before the original was removed.
    • Unembedding an entity was specifying the relationship backwards (EMBEDDED_IN vs INCLUDES).
  • Fixes pmodel::removeModelEdgeFromEndpoints() to return the proper face-adjacencies when detaching the edge from its endpoints.
  • Adds API so that edge insertion can use these adjacencies to attach a newly-created edge to the pre-existing faces (used by both "demote vertex" and "split edge").
  • Report the vertex created by split so that the UI will display it in the tree view.
  • Merge/split the "name" property of cells using the existing session methods. This makes the "demote vertex" and "split edge" operators more user-friendly, but not always more intuitive (since the preserved name may not make much sense after multiple split/demote cycles).
  • Adds a method to obtain relation indices from any entity. This provide a way to ask any arrangement (regardless of its type) for its corresponding indices into the list of relations. This can be used to invalidate relations by index or otherwise alter them surgically if you promise you know what you're doing.
  • Cleans up some model manager methods:
    • Invalidate relations when undoing their owning arrangement. This prevents issues with stale relations being mistaken for active ones. Each entry in an entity's relations array should be referenced by 0 or 1 arrangements; 2 or more arrangements should never refer to the same index in the relations array.
    • Rename "bdy" to "brd" so it is relevant.
  • Fixes up edge uses properly when splitting an edge: edge uses created when splitting an edge were populated with 2 HAS_SHELL arrangements: one with an invalid (-1) index into the relations array and one with a valid index. But an edge use can only participate in one loop, and the invalid index was being chosen so that the edge-use did not appear to have an owning loop (and thus model).
  • Clean up other edge-split foibles:
    • Do not add duplicate relationships between edges and their endpoints.
    • Do assign default names to new edges during splits.
  • Removes unused modified variables from some polygon API; accept debugLevel.
  • Mirror the model manager's log file to stdout. This makes debugging easier since the UI panel is not always visible and will not display log messages until an operation is complete (while the logger will flush them to stdout as each message is processed).
  • Improves logging, docs, and added accessors.
  • Implements more robust testing when finding arrangements in the model manager. This does not fix the underlying issue that some arrangement information is not being removed by earlier operations, but does get "create all faces" working by ensuring that edge-uses requested for use in detected face-loops are really there.
  • Prevent re-creation of pre-existing faces. Now you can re-run "create all faces" when some faces exist and not be left with invalid duplicate faces.

Merge request reports

Loading