00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __COP2_ROTOSHAPE_H__
00021 #define __COP2_ROTOSHAPE_H__
00022
00023 #include "COP2_API.h"
00024 class cop2_RotoCurve;
00025 class GU_Detail;
00026
00027 #include <UT/UT_PtrArray.h>
00028
00029 #include "COP2_Generator.h"
00030
00031 class COP2_API COP2_RotoShape : public COP2_Generator
00032 {
00033 public:
00034 virtual unsigned disableParms();
00035
00036 static OP_Node *myConstructor(OP_Network*, const char *,
00037 OP_Operator *);
00038 static OP_TemplatePair myTemplatePair;
00039 static OP_VariablePair myVariablePair;
00040 static PRM_Template myTemplateList[];
00041 static CH_LocalVariable myVariableList[];
00042
00043
00044 static int getDefaultCurveType();
00045 static void getCurveDefaults(int &comp, int &fill,
00046 bool &fillout, float &thick, int &feather,
00047 float &fwidth, float color[4]);
00048
00049
00050 void generateRawCurve(int rawmode);
00051
00052 protected:
00053 virtual COP2_ContextData *newContextData(const TIL_Plane *, int,
00054 float t, int xres, int yres,
00055 int thread, int max_threads);
00056 virtual OP_ERROR generateTile(COP2_Context &context,
00057 TIL_TileList *tilelist);
00058
00059 virtual void getGeneratedBounds(COP2_Context &context,
00060 int &bx1, int &by1,
00061 int &bx2, int &by2);
00062 virtual ~COP2_RotoShape();
00063 private:
00064 COP2_RotoShape(OP_Network *parent, const char *name,
00065 OP_Operator *entry);
00066
00067
00068 int NUM_CURVES() { return evalInt("numcurves",0,0); }
00069 float LOD(float t) { return evalFloat("detail",0,t); }
00070 void ANTIALIAS(int &x, int &y, float t)
00071 { x = evalInt("antialias", 0, t);
00072 y = evalInt("antialias", 1, t); }
00073
00074
00075 int NUM_POINTS(int curve);
00076 int CURVE_TYPE(int curve);
00077 int COMPOSITE(int curve);
00078 int FILL(int curve);
00079 bool FILL_OUTSIDE(int curve);
00080 float THICKNESS(int curve, float t);
00081 bool FEATHER(int curve);
00082 int FEATHER_DROPOFF(int curve);
00083 float FEATHER_WIDTH(int curve, float t);
00084 void COLOR(int curve, float color[4], float t);
00085
00086 void TRANSLATE(int curve, float &tx, float &ty, float t);
00087 void PIVOT(int curve, float &px, float &py, float t);
00088 void SCALE(int curve, float &sx, float &sy, float t);
00089 float ROTATE(int curve, float t);
00090
00091
00092 void POINT_POS(int curve, int point, float &x, float &y, float t);
00093 void POINT_SLOPE1(int curve, int point, float &x,float &y, float t);
00094 void POINT_SLOPE2(int curve, int point, float &x,float &y, float t);
00095 float POINT_THICKNESS(int curve, int point, float t);
00096 float POINT_FEATHER(int curve, int point, float t);
00097
00098 int myGenerateRaw;
00099 };
00100
00101 class COP2_API cop2_RotoShapeData : public COP2_ContextData
00102 {
00103 public:
00104 cop2_RotoShapeData();
00105 virtual ~cop2_RotoShapeData();
00106
00107 GU_Detail *getCurveDetail(int i);
00108 GU_Detail *getFeatherDetail(int i);
00109
00110 UT_PtrArray<cop2_RotoCurve *> myShapes;
00111
00112 int myMaxX;
00113 int myMinX;
00114 int myMaxY;
00115 int myMinY;
00116 };
00117
00118 #endif