tornavis/source/blender/windowmanager
Joseph Eagar d7cfb6ac71 Sculpt: Opaque vertex type for sculpt
This is a port of sculpt-dev's `SculptVertRef` refactor
(note that `SculptVertRef was renamed to PBVHVertRef`)
to master. `PBVHVertRef` is a structure that abstracts
the concept of a vertex in the sculpt code; it's simply
an `intptr_t` wrapped in a struct.

For `PBVH_FACES` and `PBVH_GRIDS` this struct stores a
vertex index, but for `BMesh` it stores a direct pointer
to a BMVert.  The intptr_t is wrapped in a struct to prevent
the accidental usage of it as an index.

There are many reasons to do this:

* Right now `BMesh` verts are not logical sculpt verts;
  to use the sculpt API they must first be converted to indices.
  This requires a lot of indirect lookups into tables, leading to performance
  loss.  It has also led to greater code complexity and duplication.
* Having an abstract vertex type makes it feasible to have one unified
  temporary attribute API for all three PBVH modes, which in turn
  made it rather trivial to port sculpt brushes to DynTopo in
  sculpt-dev (e.g. the layer brush, draw sharp, the smooth brushes,
  the paint brushes, etc).  This attribute API will be in a future patch.
* We need to do this anyway for the eventual move to C++.

Differential Revision: https://developer.blender.org/D14272
Reviewed By: Brecht Van Lommel
Ref D14272
2022-07-29 19:03:51 -07:00
..
gizmo Cleanup: Remove scene frame macros (`CFRA` et al.) 2022-06-30 18:38:44 +02:00
intern Cleanup: Replace reinterpret_cast<> with static_cast<> in UI code 2022-07-29 18:45:12 +02:00
message_bus Cleanup: Move RNA path functions into own C++ file 2022-07-29 16:56:48 +02:00
xr Cleanup: spelling in comments 2022-07-06 15:28:54 +10:00
CMakeLists.txt Sculpt: Opaque vertex type for sculpt 2022-07-29 19:03:51 -07:00
WM_api.h Fix `on_drag_start` handler not getting ID when dragging from Outliner 2022-07-14 19:21:56 +02:00
WM_keymap.h Cleanup: use event parameters for functions that create key-map items 2022-04-04 14:32:42 +10:00
WM_message.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
WM_toolsystem.h WM: suppress assertion when switching tools 2022-05-06 17:44:32 +10:00
WM_types.h WM: Remove ASCII members from wmEvent & GHOST_TEventKeyData 2022-07-14 15:59:19 +10:00
wm.h Cleanup: ensure space after file named in headers 2022-04-04 13:34:42 +10:00
wm_cursors.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_draw.h Cleanup: ensure space after file named in headers 2022-04-04 13:34:42 +10:00
wm_event_system.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_event_types.h Cleanup: add ISMOUSE_MOTION macro 2022-07-21 16:23:33 +10:00
wm_files.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_surface.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_window.h GHOST: get/set cursor position now uses client instead of screen coords 2022-06-30 23:46:57 +10:00