Skip to content

REFAC: PbdFunctors are Created in the Config Instead of PbdModel::Initialize

Andrew Wilson requested to merge andrew.wilson/iMSTK:ConfigPbdFunctors into master

This adds no new features, it makes Pbd more extensible. As the title states PbdFunctors are Created in the Config Instead of PbdModel::Initialize.

Initially the PbdConfig just assumed every constraint type had one stiffness value. Later special containers and interface was added for FEM. Then later added special stuff for bend. Now all the parameters for constraint generation are in polymorphic interfaces. ie: A subclass of PbdConstraintFunctor. This allows each subclass to have its own set of parameters. Making it extensible, shouldn't have to keep changing this interface.

Extra Cleanups:

  • Enum types removed for extensibility.
  • Now there are separate enums for the "standard generators" which are the PbdConstraintFunctors we provide. This is because you may have multiple generators that provide different schemes to generate the same constraints. ie: Two generators for distance constraints, etc.
  • PbdFETetConstraint renamed to PbdFemTetConstraint (the file name and class name were different).
  • PbdModel::getParameters renamed to PbdModel::getConfig to be consistent with the other DynamicalModel's.
  • When cutting was done a set of changed vertices were provided to PbdModel through a function. This had cases expanded for every type of constraint. These were appropriately moved to the PbdConstraintFunctor's. No giant switch case, and extensible.
Edited by Andrew Wilson

Merge request reports