HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_SolverSop.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_SolverSop_h__
9 #define __SIM_SolverSop_h__
10 
11 #include "SIMZ_API.h"
12 #include <SIM/SIM_OptionsUser.h>
13 #include <SIM/SIM_SingleSolver.h>
14 #include "SIMZ_Utils.h"
15 
16 #include <SOP/SOP_Compiled.h>
17 
18 class SIM_GeometryCopy;
19 
21  public SIM_OptionsUser
22 {
23 public:
24  // Access functions for our specific data.
25  GETSET_DATA_FUNCS_B("usesoppath", UseSopPath);
28  GETSET_DATA_FUNCS_S("primaryinputname", PrimaryInputName);
29  GETSET_DATA_FUNCS_B("doinvoke", DoInvoke);
30  GETSET_DATA_FUNCS_I("numinputs", NumInputs);
31 
32  GET_DATA_FUNC_I("numstamps", NumStamps);
33  void getStampVariable(UT_String &value, int n) const
34  { UT_WorkBuffer buf; buf.sprintf("stampname%d", n); return getOptions().getOptionS(buf.buffer(), value); }
35  fpreal getStampValueF(int n) const
36  { UT_WorkBuffer buf; buf.sprintf("stampvalf%d", n); return getOptions().getOptionF(buf.buffer()); }
37  void getStampValueS(UT_String &value, int n) const
38  { UT_WorkBuffer buf; buf.sprintf("stampvals%d", n); return getOptions().getOptionS(buf.buffer(), value); }
39  bool stampIsFloat(int n) const
40  { UT_WorkBuffer buf; buf.sprintf("stamptype%d", n); return getOptions().getOptionI(buf.buffer()) == 0; }
41 
42  void getInputName(UT_String &value, int inputno) const
43  { UT_WorkBuffer buf; buf.sprintf("inputname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
44  exint getInputSource(int inputno) const
45  { UT_WorkBuffer buf; buf.sprintf("inputsource%d", inputno); return getOptions().getOptionI(buf.buffer()); }
46  void getInputDataName(UT_String &value, int inputno) const
47  { UT_WorkBuffer buf; buf.sprintf("inputdataname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
48  void getInputObjectName(UT_String &value, int inputno) const
49  { UT_WorkBuffer buf; buf.sprintf("inputobjectname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
50  void getInputRelationship(UT_String &value, int inputno) const
51  { UT_WorkBuffer buf; buf.sprintf("inputrel%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
52  void getInputColliderLabel(UT_String &value, int inputno) const
53  { UT_WorkBuffer buf; buf.sprintf("inputcolliderlabel%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
54  exint getInputTimeMode(int inputno) const
55  { UT_WorkBuffer buf; buf.sprintf("inputtimemode%d", inputno); return getOptions().getOptionI(buf.buffer()); }
56 
57  GETSET_DATA_FUNCS_I("numoutputs", NumOutputs);
58  void getOutputName(UT_String &value, int inputno) const
59  { UT_WorkBuffer buf; buf.sprintf("outputname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
60  void getOutputDataName(UT_String &value, int inputno) const
61  { UT_WorkBuffer buf; buf.sprintf("outputdataname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
62  void getOutputSopPath(UT_String &value, int inputno) const
63  { UT_WorkBuffer buf; buf.sprintf("outputsoppath%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
64 
67  GETSET_DATA_FUNCS_B("usetimestep", UseTimeStep);
68  GETSET_DATA_FUNCS_F("timescale", TimeScale);
69 
70  static PRM_Template myTemplateList[];
71  static PRM_Template myTemplateList2[];
72 
73 protected:
74  explicit SIM_SolverSop(const SIM_DataFactory *factory);
75  ~SIM_SolverSop() override;
76  /// myCompiled aware copy constructor.
77  void makeEqualSubclass(const SIM_Data *source) override;
78 
80  SIM_Object &object,
81  SIM_ObjectArray &feedbacktoobjects,
82  const SIM_Time &timestep,
83  bool newobject) override;
85  SIM_Relationship &relation,
86  const SIM_Time &timestep) override;
87 
88 
89 private:
90  SIM_Result solveRootObject(SIM_Engine &engine,
91  SIM_RootData &rootdata,
92  const SIM_Time &timestep,
93  bool newobject);
94 
95  static const SIM_DopDescription *getSolverSopDopDescription();
96 
100  "SOP Solver",
101  getSolverSopDopDescription());
102 
103  // These should all be bundled into a single structure to represent
104  // a compiled chunk of nodes.
105  SOP_Compiled *myCompiled;
106  SOP_Compiled::TaskStateArray *myTaskStates;
107 };
108 
109 #endif
110 
virtual void makeEqualSubclass(const SIM_Data *source)
#define SIMZ_API
Definition: SIMZ_API.h:10
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
exint getInputSource(int inputno) const
Definition: SIM_SolverSop.h:44
void getInputRelationship(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:50
#define GETSET_DATA_FUNCS_B(DataName, FuncName)
void getOutputDataName(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:60
GLsizei const GLfloat * value
Definition: glcorearb.h:824
#define GETSET_DATA_FUNCS_S(DataName, FuncName)
void getInputObjectName(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:48
int64 exint
Definition: SYS_Types.h:125
SYS_FORCE_INLINE const char * buffer() const
int64 getOptionI(const UT_StringRef &name) const
#define GETSET_DATA_FUNCS_F(DataName, FuncName)
void getOutputName(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:58
void getStampValueS(UT_String &value, int n) const
Definition: SIM_SolverSop.h:37
void getInputName(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:42
void getInputColliderLabel(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:52
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
exint getInputTimeMode(int inputno) const
Definition: SIM_SolverSop.h:54
bool stampIsFloat(int n) const
Definition: SIM_SolverSop.h:39
GLdouble n
Definition: glcorearb.h:2008
#define GET_DATA_FUNC_I(DataName, FuncName)
Holds pointers to a number of SIM_Object objects.
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
int sprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
const SIM_Options & getOptions() const
void getStampVariable(UT_String &value, int n) const
Definition: SIM_SolverSop.h:33
fpreal getStampValueF(int n) const
Definition: SIM_SolverSop.h:35
#define SIM_NAME_DATAPATH
Definition: SIMZ_Utils.h:16
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual SIM_Result solveSingleObjectSubclass(SIM_Engine &engine, SIM_Object &object, SIM_ObjectArray &feedbacktoobjects, const SIM_Time &timestep, bool newobject)=0
void getInputDataName(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:46
virtual SIM_Result solveRelationshipSubclass(SIM_Engine &engine, SIM_Relationship &relationship, const SIM_Time &timestep)
Definition: SIM_Solver.h:182
#define SIM_NAME_TRANSFORMSOPOUTPUT
Definition: SIMZ_Utils.h:33
Definition: core.h:1131
#define SIM_NAME_SOLVEINITFRAME
Definition: SIMZ_Utils.h:36
fpreal64 getOptionF(const UT_StringRef &name) const
void getOutputSopPath(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:62
#define SIM_NAME_SOPPATH
Definition: SIMZ_Utils.h:31
This implements a SIM_Geometry that copies the source geometry.
const UT_StringHolder & getOptionS(const UT_StringRef &name) const