#include <SIM_Solver.h>

Public Types | |
| enum | SIM_Result { SIM_SOLVER_SUCCESS, SIM_SOLVER_REPEAT, SIM_SOLVER_SUBSTEP, SIM_SOLVER_FAIL } |
Public Member Functions | |
| SIM_Result | solveObjects (SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time ×tep) |
| SIM_Result | postSolveObjects (SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time ×tep) |
| SIM_Result | solveRelationship (SIM_Engine &engine, SIM_Relationship &relationship, const SIM_Time ×tep) |
| int | getRequestedCache () |
| void | getImpulseMassMatrix (const SIM_Object &object, const UT_Vector3 &impulseworldpos, UT_DMatrix3 &immatrix) const |
| void | getPointImpulseMassMatrix (const SIM_Object &object, GA_Index ptnum, UT_DMatrix3 &immatrix) const |
| fpreal | getPropertyAtPosition (const SIM_Object &object, const UT_Vector3 &worldpos, const SIM_Property &property) const |
| fpreal | getPropertyAtPoint (const SIM_Object &object, GA_Index ptnum, const SIM_Property &property) const |
| SIM_PropertyResolver * | getPropertyResolver (const SIM_Object &object, const SIM_Property &property) const |
| Builds a resolver to efficiently compute property values. | |
| void | getDefaultColliderLabel (const SIM_Object &object, UT_String &label) const |
| Gets the default collider label for an object using this solver. | |
| void | getDefaultCollider (const SIM_Object &object, const UT_String &colliderlabel, UT_String &collidertype, bool &colliderreverseobjectroles) const |
| void | setStartTime (const SIM_Time &starttime) |
| bool | isStatic (const SIM_Object *obj) const |
Static Public Member Functions | |
| static const char * | getPropertyAttribName (const SIM_Property &property) |
| static fpreal | getPropertyAtPositionStatic (const SIM_Object &object, const UT_Vector3 &worldpos, const SIM_Property &property) |
| static fpreal | getPropertyAtPointStatic (const SIM_Object &object, GA_Index ptnum, const SIM_Property &property) |
| static SIM_PropertyResolver * | getPropertyResolverStatic (const SIM_Object &object, const SIM_Property &property) |
| Static resolver for getting property values. | |
Protected Member Functions | |
| SIM_Solver (const SIM_DataFactory *factory) | |
| Basic SIM_Solver constructor. | |
| virtual | ~SIM_Solver () |
| Basic SIM_Solver destructor. | |
| bool | getStartTime (SIM_Time &time) |
| void | clearStartTime () |
| void | getSolverSubdata (SIM_SolverArray &subsolvers, UT_StringArray *subsolvernames) |
| void | getConstSolverSubdata (SIM_ConstSolverArray &subsolvers, UT_StringArray *subsolvernames) const |
| virtual bool | isStaticSubclass (const SIM_Object *obj) const |
| Determines if this solver does nothing on the object. | |
| virtual SIM_Result | solveObjectsSubclass (SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time ×tep)=0 |
| virtual SIM_Result | postSolveObjectsSubclass (SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time ×tep) |
| virtual SIM_Result | solveRelationshipSubclass (SIM_Engine &engine, SIM_Relationship &relationship, const SIM_Time ×tep) |
| virtual int | getRequestedCacheSubclass () |
| virtual void | getImpulseMassMatrixSubclass (const SIM_Object &object, const UT_Vector3 &impulseworldpos, UT_DMatrix3 &immatrix) const |
| virtual void | getPointImpulseMassMatrixSubclass (const SIM_Object &object, int ptnum, UT_DMatrix3 &immatrix) const |
| virtual fpreal | getPropertyAtPositionSubclass (const SIM_Object &object, const UT_Vector3 &worldpos, const SIM_Property &property) const |
| virtual fpreal | getPropertyAtPointSubclass (const SIM_Object &object, int ptnum, const SIM_Property &property) const |
| virtual SIM_PropertyResolver * | getPropertyResolverSubclass (const SIM_Object &object, const SIM_Property &property) const |
| Builds a resolver for evaulating properties swiftly. | |
| virtual void | getDefaultColliderLabelSubclass (const SIM_Object &object, UT_String &label) const |
| Gets the default collider label for an object using this solver. | |
| virtual void | getDefaultColliderSubclass (const SIM_Object &object, const UT_String &colliderlabel, UT_String &collidertype, bool &colliderreverseobjectroles) const |
Definition at line 31 of file SIM_Solver.h.
The possible return codes from a solve operation. These are kept in order of priority to make multi-solvers easier to write. Any result value from a subsolver that is greater than the previous highest subsolver result becmoes the new overall return value.
Definition at line 38 of file SIM_Solver.h.
| SIM_Solver::SIM_Solver | ( | const SIM_DataFactory * | factory | ) | [explicit, protected] |
Basic SIM_Solver constructor.
| virtual SIM_Solver::~SIM_Solver | ( | ) | [protected, virtual] |
Basic SIM_Solver destructor.
| void SIM_Solver::clearStartTime | ( | ) | [protected] |
| void SIM_Solver::getConstSolverSubdata | ( | SIM_ConstSolverArray & | subsolvers, | |
| UT_StringArray * | subsolvernames | |||
| ) | const [protected] |
Gets an array of const SIM_Solver subdata attached to this data. Useful for solvers which switch between or run other solvers.
| void SIM_Solver::getDefaultCollider | ( | const SIM_Object & | object, | |
| const UT_String & | colliderlabel, | |||
| UT_String & | collidertype, | |||
| bool & | colliderreverseobjectroles | |||
| ) | const |
Gets the default collider type for use on an object with a particular collider label. This information is used by SIM_Object::getCollider() to create a SIM_Collider to use for collision detection betweena pair of objects. The collidertype value returns the name of the SIM_Collider subclass to use, and the collidereverseobjectroles parameter returns whether the reverse object roles flag should be turned on for the new collider. See the ReverseObjectRoles flag in SIM_Collider for an explanation of this parameter.
| void SIM_Solver::getDefaultColliderLabel | ( | const SIM_Object & | object, | |
| UT_String & | label | |||
| ) | const |
Gets the default collider label for an object using this solver.
| virtual void SIM_Solver::getDefaultColliderLabelSubclass | ( | const SIM_Object & | object, | |
| UT_String & | label | |||
| ) | const [protected, virtual] |
Gets the default collider label for an object using this solver.
Reimplemented in RBD_Solver, SIM_SolverBlend, SIM_SolverEnable, SIM_SolverMulti, SIM_SolverSwitch, and SIM_SolverPop.
| virtual void SIM_Solver::getDefaultColliderSubclass | ( | const SIM_Object & | object, | |
| const UT_String & | colliderlabel, | |||
| UT_String & | collidertype, | |||
| bool & | colliderreverseobjectroles | |||
| ) | const [protected, virtual] |
Gets the default collider type for use on an object with a particular collider label.
Reimplemented in RBD_Solver, SIM_SolverBlend, SIM_SolverEnable, SIM_SolverMulti, SIM_SolverSwitch, and SIM_SolverPop.
| void SIM_Solver::getImpulseMassMatrix | ( | const SIM_Object & | object, | |
| const UT_Vector3 & | impulseworldpos, | |||
| UT_DMatrix3 & | immatrix | |||
| ) | const |
Gets the impulse mass matrix of an object for an impulse at the provided world space position. This function simply calls getImpulseMassMatrixSubclass().
| virtual void SIM_Solver::getImpulseMassMatrixSubclass | ( | const SIM_Object & | object, | |
| const UT_Vector3 & | impulseworldpos, | |||
| UT_DMatrix3 & | immatrix | |||
| ) | const [protected, virtual] |
Gets the impulse mass matrix of an object for an impulse at the provided world space position. The default implementation gets the closest point in the geometry and calls getPointImpulseMassMatrix().
Reimplemented in GAS_Integrator, GAS_SubStep, RBD_Solver, SIM_SolverBlend, SIM_SolverEnable, SIM_SolverMulti, SIM_SolverSwitch, and SIM_SolverPop.
| void SIM_Solver::getPointImpulseMassMatrix | ( | const SIM_Object & | object, | |
| GA_Index | ptnum, | |||
| UT_DMatrix3 & | immatrix | |||
| ) | const |
Gets the impulse mass matrix of an object for an impulse at the provided point on the geometry of the object. This function simply calls getPointImpulseMassMatrixSubclass().
| virtual void SIM_Solver::getPointImpulseMassMatrixSubclass | ( | const SIM_Object & | object, | |
| int | ptnum, | |||
| UT_DMatrix3 & | immatrix | |||
| ) | const [protected, virtual] |
Gets the impulse mass matrix of an object for an impulse at the provided point on the geometry of the object. The default implementation finds the world space position of the point and calls getImpulseMassMatrix().
Reimplemented in GAS_Integrator, GAS_SubStep, RBD_Solver, SIM_SolverBlend, SIM_SolverEnable, SIM_SolverMulti, SIM_SolverSwitch, and SIM_SolverPop.
| fpreal SIM_Solver::getPropertyAtPoint | ( | const SIM_Object & | object, | |
| GA_Index | ptnum, | |||
| const SIM_Property & | property | |||
| ) | const |
Gets the value of some physical property for the supplied object at a given point on the object's geometry. This function simply calls getPropertyAtPointSubclass().
| static fpreal SIM_Solver::getPropertyAtPointStatic | ( | const SIM_Object & | object, | |
| GA_Index | ptnum, | |||
| const SIM_Property & | property | |||
| ) | [static] |
Static method that implements a good standard approach to getting a property at a given point number.
| virtual fpreal SIM_Solver::getPropertyAtPointSubclass | ( | const SIM_Object & | object, | |
| int | ptnum, | |||
| const SIM_Property & | property | |||
| ) | const [protected, virtual] |
Gets the value of some physical property for the supplied object at a given point on the object's geometry.
Reimplemented in GAS_SubSolver, RBD_Solver, SIM_SolverBlend, SIM_SolverEnable, SIM_SolverMulti, and SIM_SolverSwitch.
| fpreal SIM_Solver::getPropertyAtPosition | ( | const SIM_Object & | object, | |
| const UT_Vector3 & | worldpos, | |||
| const SIM_Property & | property | |||
| ) | const |
Gets the value of some physical property for the supplied object at a given position in world space. This function simply calls getPropertyAtPositionSubclass().
| static fpreal SIM_Solver::getPropertyAtPositionStatic | ( | const SIM_Object & | object, | |
| const UT_Vector3 & | worldpos, | |||
| const SIM_Property & | property | |||
| ) | [static] |
Static method that implements a good standard approach to getting a property at a given position.
| virtual fpreal SIM_Solver::getPropertyAtPositionSubclass | ( | const SIM_Object & | object, | |
| const UT_Vector3 & | worldpos, | |||
| const SIM_Property & | property | |||
| ) | const [protected, virtual] |
Gets the value of some physical property for the supplied object at a given position in world space.
Reimplemented in GAS_SubSolver, RBD_Solver, SIM_SolverBlend, SIM_SolverEnable, SIM_SolverMulti, and SIM_SolverSwitch.
| static const char* SIM_Solver::getPropertyAttribName | ( | const SIM_Property & | property | ) | [static] |
Returns the standard attribute name that corresponds to a given SIM_Property value.
| SIM_PropertyResolver* SIM_Solver::getPropertyResolver | ( | const SIM_Object & | object, | |
| const SIM_Property & | property | |||
| ) | const |
Builds a resolver to efficiently compute property values.
| static SIM_PropertyResolver* SIM_Solver::getPropertyResolverStatic | ( | const SIM_Object & | object, | |
| const SIM_Property & | property | |||
| ) | [static] |
Static resolver for getting property values.
| virtual SIM_PropertyResolver* SIM_Solver::getPropertyResolverSubclass | ( | const SIM_Object & | object, | |
| const SIM_Property & | property | |||
| ) | const [protected, virtual] |
| int SIM_Solver::getRequestedCache | ( | ) |
Get the number of cached time steps we want to solve for these objects. This function calls getRequestedCacheSubclass to get the real value.
| virtual int SIM_Solver::getRequestedCacheSubclass | ( | ) | [protected, virtual] |
Returns the amount of history required by this solver. Override this function if your solver requires past data to calculate the next time step. The default implementation returns 0.
Reimplemented in SIM_SolverBlend, SIM_SolverEnable, SIM_SolverMulti, SIM_SolverSwitch, and SIM_SolverPop.
| void SIM_Solver::getSolverSubdata | ( | SIM_SolverArray & | subsolvers, | |
| UT_StringArray * | subsolvernames | |||
| ) | [protected] |
Gets an array of SIM_Solver subdata attached to this data. Useful for solvers which switch between or run other solvers.
| bool SIM_Solver::getStartTime | ( | SIM_Time & | time | ) | [protected] |
| bool SIM_Solver::isStatic | ( | const SIM_Object * | obj | ) | const [inline] |
Definition at line 139 of file SIM_Solver.h.
| virtual bool SIM_Solver::isStaticSubclass | ( | const SIM_Object * | obj | ) | const [inline, protected, virtual] |
Determines if this solver does nothing on the object.
Reimplemented in SIM_SolverEnable, SIM_SolverStatic, and SIM_SolverSwitch.
Definition at line 162 of file SIM_Solver.h.
| SIM_Result SIM_Solver::postSolveObjects | ( | SIM_Engine & | engine, | |
| SIM_ObjectArray & | objects, | |||
| SIM_ObjectArray & | newobjects, | |||
| SIM_ObjectArray & | feedbacktoobjects, | |||
| const SIM_Time & | timestep | |||
| ) |
| virtual SIM_Result SIM_Solver::postSolveObjectsSubclass | ( | SIM_Engine & | engine, | |
| SIM_ObjectArray & | objects, | |||
| SIM_ObjectArray & | newobjects, | |||
| SIM_ObjectArray & | feedbacktoobjects, | |||
| const SIM_Time & | timestep | |||
| ) | [inline, protected, virtual] |
| void SIM_Solver::setStartTime | ( | const SIM_Time & | starttime | ) |
| SIM_Result SIM_Solver::solveObjects | ( | SIM_Engine & | engine, | |
| SIM_ObjectArray & | objects, | |||
| SIM_ObjectArray & | newobjects, | |||
| SIM_ObjectArray & | feedbacktoobjects, | |||
| const SIM_Time & | timestep | |||
| ) |
Solve for the given objects. This function is called for each timestep after the one where the objects are first created. This function calls solveObjectSubclass to perform the real work.
| virtual SIM_Result SIM_Solver::solveObjectsSubclass | ( | SIM_Engine & | engine, | |
| SIM_ObjectArray & | objects, | |||
| SIM_ObjectArray & | newobjects, | |||
| SIM_ObjectArray & | feedbacktoobjects, | |||
| const SIM_Time & | timestep | |||
| ) | [protected, pure virtual] |
This method solves for some objects. It performs whatever processing is necessary to take objects from their state at one time to another. The default implementation does nothing. The objects parameter holds all the objects that should be solved for this timestep. The newobjects parameter is a set of objects that were just created in this timestep, and so should in most cases not be solved on this timestep so that they maintain correct initial conditions.
Implemented in GAS_EachDataSolver, GAS_Integrator, GAS_RepeatSolver, GAS_SubSolver, GAS_SubStep, RBD_Solver, SIM_SingleSolver, SIM_SolverBlend, SIM_SolverEnable, SIM_SolverMulti, SIM_SolverSwitch, and SIM_SolverScript.
| SIM_Result SIM_Solver::solveRelationship | ( | SIM_Engine & | engine, | |
| SIM_Relationship & | relationship, | |||
| const SIM_Time & | timestep | |||
| ) |
Solves for a relationship. Invoked if "Solver" is a subdata of a SIM_Relationship data.
| virtual SIM_Result SIM_Solver::solveRelationshipSubclass | ( | SIM_Engine & | engine, | |
| SIM_Relationship & | relationship, | |||
| const SIM_Time & | timestep | |||
| ) | [inline, protected, virtual] |
Reimplemented in SIM_SolverEnable, SIM_SolverMulti, SIM_SolverSwitch, and SIM_SolverSop.
Definition at line 185 of file SIM_Solver.h.
1.5.9