Separate PBD constraint generation from PbdModel
It would probably be good to separate these and provide another class for generating constraints. One that can be subclassed and customized by a user without having to subclass PbdModel itself to customize. This would also nicely reduce the size of the PbdModel class.
It could serve as sort of a constraint generation policy. For example, right now we define constraint generation in a global matter with enums. If "enableConstraint" then it is assumed the user wants these constraints everywhere on the mesh. What happens when the mesh changes? Or is entirely replaced?
Ideally this almost functor like policy class would have two virtual functions.
- One for a global change, called when initializing the first time or if the geometry of the model completely replaced.
- The second for local change and local reinit. It would preserve the original constraint parameters and possibly remap the indices of the constraints if topology change occurred. Optionally no map is provided (this would be if buffering and removal was used such that indices do not change).
This way a user could provide a very custom constraint generation policy for custom applications (for instance in VESS there is a mask of vertices that don't even have constraints). Might be a nice way to deal with topology changes of the PbdModel.