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  void getInputName(UT_String &value, int inputno) const
33  { UT_WorkBuffer buf; buf.sprintf("inputname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
34  exint getInputSource(int inputno) const
35  { UT_WorkBuffer buf; buf.sprintf("inputsource%d", inputno); return getOptions().getOptionI(buf.buffer()); }
36  void getInputDataName(UT_String &value, int inputno) const
37  { UT_WorkBuffer buf; buf.sprintf("inputdataname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
38  void getInputObjectName(UT_String &value, int inputno) const
39  { UT_WorkBuffer buf; buf.sprintf("inputobjectname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
40  void getInputRelationship(UT_String &value, int inputno) const
41  { UT_WorkBuffer buf; buf.sprintf("inputrel%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
42  void getInputColliderLabel(UT_String &value, int inputno) const
43  { UT_WorkBuffer buf; buf.sprintf("inputcolliderlabel%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
44  exint getInputTimeMode(int inputno) const
45  { UT_WorkBuffer buf; buf.sprintf("inputtimemode%d", inputno); return getOptions().getOptionI(buf.buffer()); }
46 
47  GETSET_DATA_FUNCS_I("numoutputs", NumOutputs);
48  void getOutputName(UT_String &value, int inputno) const
49  { UT_WorkBuffer buf; buf.sprintf("outputname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
50  void getOutputDataName(UT_String &value, int inputno) const
51  { UT_WorkBuffer buf; buf.sprintf("outputdataname%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
52  void getOutputSopPath(UT_String &value, int inputno) const
53  { UT_WorkBuffer buf; buf.sprintf("outputsoppath%d", inputno); return getOptions().getOptionS(buf.buffer(), value); }
54 
57  GETSET_DATA_FUNCS_B("usetimestep", UseTimeStep);
58  GETSET_DATA_FUNCS_F("timescale", TimeScale);
59 
60  static PRM_Template myTemplateList[];
61  static PRM_Template myTemplateList2[];
62 
63 protected:
64  explicit SIM_SolverSop(const SIM_DataFactory *factory);
65  virtual ~SIM_SolverSop();
66  /// myCompiled aware copy constructor.
67  virtual void makeEqualSubclass(const SIM_Data *source);
68 
70  SIM_Object &object,
71  SIM_ObjectArray &feedbacktoobjects,
72  const SIM_Time &timestep,
73  bool newobject);
75  SIM_Relationship &relation,
76  const SIM_Time &timestep);
77 
78 
79 private:
80  SIM_Result solveRootObject(SIM_Engine &engine,
81  SIM_RootData &rootdata,
82  const SIM_Time &timestep,
83  bool newobject);
84 
85  static const SIM_DopDescription *getSolverSopDopDescription();
86 
90  "SOP Solver",
91  getSolverSopDopDescription());
92 
93  // These should all be bundled into a single structure to represent
94  // a compiled chunk of nodes.
95  SOP_Compiled *myCompiled;
96  SOP_Compiled::TaskStateArray *myTaskStates;
97 };
98 
99 #endif
100 
virtual void makeEqualSubclass(const SIM_Data *source)
#define SIMZ_API
Definition: SIMZ_API.h:10
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:45
exint getInputSource(int inputno) const
Definition: SIM_SolverSop.h:34
void getInputRelationship(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:40
#define GETSET_DATA_FUNCS_B(DataName, FuncName)
void getOutputDataName(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:50
#define GETSET_DATA_FUNCS_S(DataName, FuncName)
void getInputObjectName(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:38
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:48
void getInputName(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:32
void getInputColliderLabel(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:42
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:58
exint getInputTimeMode(int inputno) const
Definition: SIM_SolverSop.h:44
int64 exint
Definition: SYS_Types.h:116
Holds pointers to a number of SIM_Object objects.
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:802
#define GETSET_DATA_FUNCS_I(DataName, FuncName)
int sprintf(const char *fmt,...) SYS_PRINTF_CHECK_ATTRIBUTE(2
const SIM_Options & getOptions() const
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
GLsizei const GLfloat * value
Definition: glcorearb.h:823
#define SIM_NAME_DATAPATH
Definition: SIMZ_Utils.h:16
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:36
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
#define SIM_NAME_SOLVEINITFRAME
Definition: SIMZ_Utils.h:36
void getOutputSopPath(UT_String &value, int inputno) const
Definition: SIM_SolverSop.h:52
#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