00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __SOP_Euclid_h__
00030 #define __SOP_Euclid_h__
00031
00032 #include <SOP/SOP_Node.h>
00033
00034 #include "EUC_Expression.h"
00035
00036 namespace HDK_Sample {
00037
00038 class SOP_EuclidBase : public SOP_Node
00039 {
00040 protected:
00041 SOP_EuclidBase(OP_Network *net, const char *name, OP_Operator *op);
00042 virtual ~SOP_EuclidBase();
00043
00044 virtual OP_ERROR cookMySop(OP_Context &context);
00045
00046 virtual EUC_Expression *cookExpression(OP_Context &context) = 0;
00047
00048 EUC_Expression *getInputExpression(int idx) const;
00049
00050 protected:
00051 bool HIDE(float t) { return (bool)evalInt(0, 0, t); }
00052 float CR(float t) { return evalFloat(1, 0, t); }
00053 float CG(float t) { return evalFloat(1, 1, t); }
00054 float CB(float t) { return evalFloat(1, 2, t); }
00055
00056 EUC_Expression *myExpression;
00057 };
00058
00059 class SOP_EuclidPoint : public SOP_EuclidBase
00060 {
00061 public:
00062 static OP_Node *myConstructor(OP_Network*, const char *,
00063 OP_Operator *);
00064 static PRM_Template myTemplateList[];
00065 protected:
00066 SOP_EuclidPoint(OP_Network *net, const char *name, OP_Operator *op);
00067
00068 virtual EUC_Expression *cookExpression(OP_Context &context);
00069
00070 float TX(float t) { return evalFloat(2, 0, t); }
00071 float TY(float t) { return evalFloat(2, 1, t); }
00072 };
00073
00074 class SOP_EuclidPointFromObject : public SOP_EuclidBase
00075 {
00076 public:
00077 static OP_Node *myConstructor(OP_Network*, const char *,
00078 OP_Operator *);
00079 static PRM_Template myTemplateList[];
00080 protected:
00081 SOP_EuclidPointFromObject(OP_Network *net, const char *name, OP_Operator *op);
00082
00083 virtual EUC_Expression *cookExpression(OP_Context &context);
00084
00085 int IDX(float t) { return evalInt(2, 0, t); }
00086 };
00087
00088 class SOP_EuclidLineFromPoints : public SOP_EuclidBase
00089 {
00090 public:
00091 static OP_Node *myConstructor(OP_Network*, const char *,
00092 OP_Operator *);
00093 static PRM_Template myTemplateList[];
00094 protected:
00095 SOP_EuclidLineFromPoints(OP_Network *net, const char *name, OP_Operator *op);
00096
00097 virtual EUC_Expression *cookExpression(OP_Context &context);
00098 };
00099
00100 class SOP_EuclidCircleFromPoints : public SOP_EuclidBase
00101 {
00102 public:
00103 static OP_Node *myConstructor(OP_Network*, const char *,
00104 OP_Operator *);
00105 static PRM_Template myTemplateList[];
00106 protected:
00107 SOP_EuclidCircleFromPoints(OP_Network *net, const char *name, OP_Operator *op);
00108
00109 virtual EUC_Expression *cookExpression(OP_Context &context);
00110 };
00111
00112 class SOP_EuclidIntersect : public SOP_EuclidBase
00113 {
00114 public:
00115 static OP_Node *myConstructor(OP_Network*, const char *,
00116 OP_Operator *);
00117 static PRM_Template myTemplateList[];
00118 protected:
00119 SOP_EuclidIntersect(OP_Network *net, const char *name, OP_Operator *op);
00120
00121 virtual EUC_Expression *cookExpression(OP_Context &context);
00122 };
00123
00124 class SOP_EuclidSelect : public SOP_EuclidBase
00125 {
00126 public:
00127 static OP_Node *myConstructor(OP_Network*, const char *,
00128 OP_Operator *);
00129 static PRM_Template myTemplateList[];
00130 protected:
00131 SOP_EuclidSelect(OP_Network *net, const char *name, OP_Operator *op);
00132
00133 virtual EUC_Expression *cookExpression(OP_Context &context);
00134
00135 int IDX(float t) { return evalInt(2, 0, t); }
00136 };
00137
00138 }
00139
00140 #endif