00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __SIM_SolverSwitch_h__
00015 #define __SIM_SolverSwitch_h__
00016
00017 #include "SIM_API.h"
00018 #include "SIM_Solver.h"
00019 #include "SIM_OptionsUser.h"
00020
00021
00022
00023
00024 class SIM_API SIM_SolverSwitch : public SIM_Solver,
00025 public SIM_OptionsUser
00026 {
00027 public:
00028 GETSET_DATA_FUNCS_S(SIM_NAME_SWITCHVALUENAME, SwitchValueName);
00029 GETSET_DATA_FUNCS_I(SIM_NAME_DEFAULTSWITCHVALUE, DefaultSwitchValue);
00030
00031 protected:
00032
00033 explicit SIM_SolverSwitch(const SIM_DataFactory *factory);
00034
00035 virtual ~SIM_SolverSwitch();
00036
00037
00038 virtual SIM_Result solveObjectsSubclass(SIM_Engine &engine,
00039 SIM_ObjectArray &objects,
00040 SIM_ObjectArray &newobjects,
00041 SIM_ObjectArray &feedbacktoobjects,
00042 const SIM_Time ×tep);
00043
00044 virtual int getRequestedCacheSubclass();
00045 virtual void getImpulseMassMatrixSubclass(
00046 const SIM_Object &object,
00047 const UT_Vector3 &impulseworldpos,
00048 UT_DMatrix3 &immatrix) const;
00049 virtual void getPointImpulseMassMatrixSubclass(
00050 const SIM_Object &object,
00051 int ptnum, UT_DMatrix3 &immatrix) const;
00052 virtual fpreal getPropertyAtPositionSubclass(const SIM_Object &object,
00053 const UT_Vector3 &worldpos,
00054 const SIM_Property &property) const;
00055 virtual fpreal getPropertyAtPointSubclass(const SIM_Object &object,
00056 int ptnum, const SIM_Property &property) const;
00057 virtual void getDefaultColliderLabelSubclass(
00058 const SIM_Object &object,
00059 UT_String &label) const;
00060 virtual void getDefaultColliderSubclass(
00061 const SIM_Object &object,
00062 const UT_String &colliderlabel,
00063 UT_String &collidertype,
00064 bool &colliderreverseobjectroles) const;
00065
00066 private:
00067 int getSubSolverAssignment(const SIM_Object &object,
00068 SIM_ConstSolverArray &subsolvers,
00069 const char *switchvaluename) const;
00070 void getSubSolverAssignments(SIM_ObjectArray &objects,
00071 SIM_SolverArray &subsolvers,
00072 const char *switchvaluename,
00073 UT_RefArray<SIM_ObjectArray> &ssobjs);
00074
00075 static const SIM_DopDescription *getSolverSwitchDopDescription();
00076
00077 DECLARE_STANDARD_GETCASTTOTYPE();
00078 DECLARE_DATAFACTORY(SIM_SolverSwitch,
00079 SIM_Solver,
00080 "Switch Solver",
00081 getSolverSwitchDopDescription());
00082 };
00083
00084 #endif
00085