00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _OP_OPTIONS_H_
00022 #define _OP_OPTIONS_H_
00023
00024 #include "OP_API.h"
00025 #include <UT/UT_Matrix4.h>
00026 #include <UT/UT_Options.h>
00027 #include <SYS/SYS_Types.h>
00028
00029 class OP_Node;
00030 class PRM_Template;
00031 class PRM_Parm;
00032
00033
00034
00035
00036
00037 class OP_API OP_Options : public UT_Options
00038 {
00039 public:
00040 explicit OP_Options();
00041 virtual ~OP_Options();
00042
00043
00044
00045
00046
00047 void interpolate(const OP_Options &source1,
00048 const OP_Options &source2,
00049 fpreal interp);
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 void setOptionFromTemplate(OP_Node *node,
00060 const PRM_Template &tplate,
00061 int pi, fpreal time);
00062 void setOptionFromTemplate(OP_Node *node,
00063 const PRM_Parm &parm,
00064 const PRM_Template &tplate,
00065 fpreal time);
00066
00067
00068
00069
00070 void setOptionFromParm(OP_Node *node, int pi, int vi,
00071 fpreal time);
00072
00073
00074
00075
00076
00077
00078 void setOptionFromTemplateDefault(const PRM_Template &tp);
00079
00080
00081
00082
00083
00084 bool setOptionFromCommand(const char *optionname,
00085 const char *optionvalue,
00086 fpreal optionvaluefloat,
00087 UT_OptionType optiontype);
00088
00089
00090
00091 UT_DMatrix4 getTransformFromOptions() const;
00092
00093
00094 const OP_Options &operator=(const UT_Options &src);
00095
00096 protected:
00097
00098
00099
00100
00101
00102 virtual void optionChanged(const char *name);
00103
00104
00105 virtual void getInterpolatedInt(int64 &value,
00106 const char *name,
00107 int source1,
00108 int source2,
00109 fpreal interp) const;
00110 virtual void getInterpolatedBool(bool &value,
00111 const char *name,
00112 bool source1,
00113 bool source2,
00114 fpreal interp) const;
00115 virtual void getInterpolatedFpreal(fpreal64 &value,
00116 const char *name,
00117 fpreal source1,
00118 fpreal source2,
00119 fpreal interp) const;
00120 virtual void getInterpolatedString(std::string &value,
00121 const char *name,
00122 const std::string &source1,
00123 const std::string &source2,
00124 fpreal interp) const;
00125 virtual void getInterpolatedVector2(UT_Vector2D &value,
00126 const char *name,
00127 const UT_Vector2D &source1,
00128 const UT_Vector2D &source2,
00129 fpreal interp) const;
00130 virtual void getInterpolatedVector3(UT_Vector3D &value,
00131 const char *name,
00132 const UT_Vector3D &source1,
00133 const UT_Vector3D &source2,
00134 fpreal interp) const;
00135 virtual void getInterpolatedVector4(UT_Vector4D &value,
00136 const char *name,
00137 const UT_Vector4D &source1,
00138 const UT_Vector4D &source2,
00139 fpreal interp) const;
00140 virtual void getInterpolatedQuaternion(UT_QuaternionD &value,
00141 const char *name,
00142 const UT_QuaternionD &source1,
00143 const UT_QuaternionD &source2,
00144 fpreal interp) const;
00145 virtual void getInterpolatedMatrix3(UT_Matrix3D &value,
00146 const char *name,
00147 const UT_Matrix3D &source1,
00148 const UT_Matrix3D &source2,
00149 fpreal interp) const;
00150 virtual void getInterpolatedMatrix4(UT_Matrix4D &value,
00151 const char *name,
00152 const UT_Matrix4D &source1,
00153 const UT_Matrix4D &source2,
00154 fpreal interp) const;
00155 virtual void getInterpolatedIntArray(UT_Int64Array &value,
00156 const char *name,
00157 const UT_Int64Array &source1,
00158 const UT_Int64Array &source2,
00159 fpreal interp);
00160 virtual void getInterpolatedFprealArray(UT_Fpreal64Array &value,
00161 const char *name,
00162 const UT_Fpreal64Array &source1,
00163 const UT_Fpreal64Array &source2,
00164 fpreal interp);
00165
00166 private:
00167 explicit OP_Options(const OP_Options &src);
00168 };
00169
00170 #endif
00171