00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __rdControlSet_h__
00010 #define __rdControlSet_h__
00011
00012
00013
00014 #include <rdPtrArray.h>
00015 #include "rdModel.h"
00016 #include "rdControl.h"
00017
00018
00019 #ifndef UNIX
00020 template class RDSIMULATION_API rdArray<int>;
00021 #endif
00022
00023
00024
00025
00033 class RDSIMULATION_API rdControlSet : public rdPtrArray
00034 {
00035
00036
00037
00038
00039 private:
00041 static rdPtrArray _ControlTypes;
00042 protected:
00044 rdPtrArray _defaultControls;
00046 rdArray<int> _ptcMap;
00048 rdArray<int> _ptpMap;
00049
00050
00051
00052
00053
00054
00055
00056
00057 public:
00058 rdControlSet();
00059 rdControlSet(const char *aFileName);
00060 virtual ~rdControlSet();
00061 private:
00062 void setNull();
00063 void constructDefaultControls();
00064
00065
00066
00067
00068 public:
00069
00070 int getControlIndex(const char *aName) const;
00071 void getControlList(const char *aType,rdArray<int> &rList,
00072 bool aForModelControls=true) const;
00073
00074 rdControl* appendControl(rdControl *aControl);
00075 rdControl* setControl(int aIndex,rdControl *aControl);
00076 rdControl* getControl(int aIndex) const;
00077 rdControl* getControl(const char *aName) const;
00078
00079 int getNumControls(bool aForActuatorControls=true) const;
00080 void getControlValues(double aT,double rX[],
00081 bool aForModelControls=true) const;
00082 void getControlValues(double aT,rdArray<double> &rX,
00083 bool aForModelControls=true) const;
00084 void setControlValues(double aT,const double aX[],
00085 bool aForModelControls=true);
00086 void setControlValues(double aT,const rdArray<double> &aX,
00087 bool aForModelControls=true);
00088
00089 int getNumParameters(bool aForModelControls=true) const;
00090 void getParameterList(rdArray<int> &rList,
00091 bool aForModelControls=true) const;
00092 void getParameterList(double aT,rdArray<int> &rList,
00093 bool aForModelControls=true) const;
00094 void getParameterList(double aTLower,double aTUpper,rdArray<int> &rList,
00095 bool aForModelControls=true) const;
00096 void getParameterMins(rdArray<double> &rMins,
00097 const rdArray<int> *aList=NULL) const;
00098 void getParameterMaxs(rdArray<double> &rMaxs,
00099 const rdArray<int> *aList=NULL) const;
00100 void getParameterValues(double rP[],
00101 const rdArray<int> *aList=NULL) const;
00102 void getParameterValues(rdArray<double> &rP,
00103 const rdArray<int> *aList=NULL) const;
00104 void setParameterValues(const double aP[],
00105 const rdArray<int> *aList=NULL);
00106 void setParameterValues(const rdArray<double> &aP,
00107 const rdArray<int> *aList=NULL);
00108
00109
00110
00111
00112 int mapParameterToControl(int aIndex) const;
00113 int mapParameterToParameter(int aIndex) const;
00114 void generateParameterMaps();
00115 static void RegisterType(const rdControl &aControl);
00116
00117
00118
00119
00120 void updateObject(bool aDeep=true);
00121 void updateNode(bool aDeep=true);
00122 void generateNode(IDOM_Element *aParent);
00123
00124
00125 };
00126
00127
00128
00129
00130 #endif // __rdControlSet_h__
00131
00132