00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __DOP_Auto_h__
00019 #define __DOP_Auto_h__
00020
00021 #include "DOP_API.h"
00022 #include <SIM/SIM_Options.h>
00023 #include <SIM/SIM_RootDataId.h>
00024 #include "DOP_Node.h"
00025
00026 class DOP_API DOP_Auto : public DOP_Node
00027 {
00028 public:
00029 DOP_Auto(OP_Network *net, const char *name, OP_Operator *entry);
00030 virtual ~DOP_Auto();
00031
00032 virtual const char *inputLabel(unsigned idx) const;
00033
00034 virtual float getVariableValue(int index, int thread);
00035 virtual void getVariableString(int index, UT_String &str,
00036 int thread);
00037
00038 virtual void getNodeSpecificInfoText(OP_Context &context,
00039 int verbose,
00040 UT_WorkBuffer &text);
00041
00042 static OP_Node *myConstructor(OP_Network *net,
00043 const char *name,
00044 OP_Operator *entry);
00045 static PRM_Template theCommonTemplates[];
00046 static CH_LocalVariable theCommonVariables[];
00047
00048 protected:
00049 virtual void processObjectsSubclass(fpreal time,
00050 int foroutputidx,
00051 const SIM_ObjectArray &objects,
00052 DOP_Engine &engine);
00053
00054
00055
00056 virtual void applyOutputDataSubclass(fpreal time,
00057 int outputidx,
00058 SIM_RootData &rootdata,
00059 const char *parentdataname,
00060 DOP_Engine &engine,
00061 UT_StringArray *datanames);
00062 virtual void preNetworkProcessingSubclass(DOP_Engine &engine);
00063 virtual void getInputInfoSubclass(int inputidx,
00064 DOP_InOutInfo &info);
00065 virtual void getOutputInfoSubclass(int outputidx,
00066 DOP_InOutInfo &info);
00067 virtual PRM_Template*getCommonTemplates() const;
00068 virtual int getFirstSubdataInput() const;
00069 virtual bool getHasInputObjects() const;
00070
00071 virtual int SHAREDATA();
00072 virtual int UNIQUEDATANAME();
00073 virtual void DATANAME(UT_String &str, fpreal t);
00074
00075 void GROUP(UT_String &str, fpreal t);
00076
00077 const SIM_Data *getShareData(const SIM_Engine &engine,
00078 const char *lcddatatype);
00079 void setShareData(const SIM_RootData &rootdata,
00080 const char *dataname);
00081 void attachInputSubData(SIM_RootData &rootdata,
00082 const char *dataname,
00083 DOP_Engine &engine,
00084 float time);
00085
00086
00087
00088
00089
00090 void doApplyOutputData(fpreal time,
00091 int outputidx,
00092 SIM_RootData &rootdata,
00093 const char *parentdataname,
00094 DOP_Engine &engine,
00095 UT_StringArray *datanames,
00096 bool active);
00097
00098
00099
00100 virtual void doApplyOutputDataSubclass(fpreal time,
00101 int outputidx,
00102 SIM_RootData &rootdata,
00103 const char *parentdataname,
00104 DOP_Engine &engine,
00105 UT_StringArray *datanames,
00106 bool active);
00107
00108 void removeData(SIM_RootData &rootdata,
00109 const UT_String &dataname);
00110
00111 private:
00112 int PARMOP(const char *parmname);
00113
00114 bool getParmsToModify(UT_IntArray &parmstomodify,
00115 const SIM_Data *existingdata,
00116 bool existingdataiscompatibletype);
00117 CH_LocalVariable *getVariableById(int index) const;
00118 void setParametersOnData(SIM_Data *data,
00119 DOP_Engine &engine,
00120 const UT_IntArray &parmstomodify,
00121 fpreal time);
00122 void createData(SIM_RootData &rootdata,
00123 const UT_String &dataname,
00124 const char *datatype,
00125 const char *lcddatatype,
00126 DOP_Engine &engine,
00127 fpreal time,
00128 int outputidx);
00129
00130 const SIM_Data *myCurrentData;
00131 const SIM_Engine *myCurrentEngine;
00132 SIM_Options myOptions;
00133 SIM_RootDataId myLastCreatedDataId;
00134 UT_String myLastCreatedDataName;
00135 };
00136
00137 #endif