HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_SolverMulti.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __SIM_SolverMulti_h__
9 #define __SIM_SolverMulti_h__
10 
11 #include "SIM_API.h"
12 #include "SIM_Solver.h"
13 #include "SIM_OptionsUser.h"
14 
15 /// This solver class passes the solve responsibility to one or more other
16 /// solvers. It searches for any SIM_Solver subdata attached to itself, and
17 /// calls each one in turn.
19  public SIM_OptionsUser
20 {
21 public:
23 
24 protected:
25  /// Basic SIM_SolverMulti constructor.
26  explicit SIM_SolverMulti(const SIM_DataFactory *factory);
27  /// Basic SIM_SolverMulti destructor.
28  virtual ~SIM_SolverMulti();
29 
30  /// Override this function to pass this call along to our child solvers.
32  SIM_ObjectArray &objects,
33  SIM_ObjectArray &newobjects,
34  SIM_ObjectArray &feedbacktoobjects,
35  const SIM_Time &timestep);
37  SIM_Relationship &relationship,
38  const SIM_Time &timestep);
39  /// Override this function to get the requirements of our child solvers.
40  virtual int getRequestedCacheSubclass() const;
41  virtual void getImpulseMassMatrixSubclass(
42  const SIM_Object &object,
43  const UT_Vector3 &impulseworldpos,
44  UT_DMatrix3 &immatrix) const;
46  const SIM_Object &object,
47  int ptnum, UT_DMatrix3 &immatrix) const;
49  const SIM_Object &object) const;
50  virtual fpreal getPropertyAtPositionSubclass(const SIM_Object &object,
51  const UT_Vector3 &worldpos,
52  const SIM_Property &property) const;
53  virtual fpreal getPropertyAtPointSubclass(const SIM_Object &object,
54  int ptnum,
55  const SIM_Property &property) const;
57  const SIM_Object &object,
58  UT_String &label) const;
59  virtual void getDefaultColliderSubclass(
60  const SIM_Object &object,
61  const UT_String &colliderlabel,
62  UT_String &collidertype,
63  bool &colliderreverseobjectroles) const;
64 
65 private:
66  /// Gets the solver to use for getting object properties.
67  const SIM_Solver *getCurrentSolver() const;
68 
69  static const SIM_DopDescription *getSolverMultiDopDescription();
70 
71  SIM_Solver *myCurrentSolver;
72 
75  SIM_Solver,
76  "Multiple Solver",
77  getSolverMultiDopDescription());
78 };
79 
80 #endif
81 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
#define SIM_NAME_PRIMARYSOLVER
Definition: SIM_Names.h:169
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
virtual void getDefaultColliderSubclass(const SIM_Object &object, const UT_String &colliderlabel, UT_String &collidertype, bool &colliderreverseobjectroles) const
virtual int getRequestedCacheSubclass() const
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
Holds pointers to a number of SIM_Object objects.
virtual void getImpulseMassMatrixSubclass(const SIM_Object &object, const UT_Vector3 &impulseworldpos, UT_DMatrix3 &immatrix) const
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
virtual SIM_PointImpulseMassMatrixResolver * getPointImpulseMassMatrixResolverSubclass(const SIM_Object &object) const
Builds a resolver for evaluating mass matrices swiftly.
virtual SIM_Result solveObjectsSubclass(SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time &timestep)=0
virtual fpreal getPropertyAtPositionSubclass(const SIM_Object &object, const UT_Vector3 &worldpos, const SIM_Property &property) const
virtual void getDefaultColliderLabelSubclass(const SIM_Object &object, UT_String &label) const
Gets the default collider label for an object using this solver.
double fpreal
Definition: SYS_Types.h:270
#define SIM_API
Definition: SIM_API.h:10
virtual SIM_Result solveRelationshipSubclass(SIM_Engine &engine, SIM_Relationship &relationship, const SIM_Time &timestep)
Definition: SIM_Solver.h:182
virtual void getPointImpulseMassMatrixSubclass(const SIM_Object &object, int ptnum, UT_DMatrix3 &immatrix) const
SIM_Property
virtual fpreal getPropertyAtPointSubclass(const SIM_Object &object, int ptnum, const SIM_Property &property) const