HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP2_RotoShape.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: COP2_RotoShape.h
7  *
8  * COMMENTS:
9  * Generates multiple spline or polygon shapes.
10  */
11 #ifndef __COP2_ROTOSHAPE_H__
12 #define __COP2_ROTOSHAPE_H__
13 
14 #include "COP2_API.h"
15 class cop2_RotoCurve;
16 class GU_Detail;
17 
18 #include <UT/UT_ValArray.h>
19 
20 #include "COP2_Generator.h"
21 
23 {
24 public:
25  static OP_Node *myConstructor(OP_Network*, const char *,
26  OP_Operator *);
29  static PRM_Template myTemplateList[];
30  static CH_LocalVariable myVariableList[];
31 
32  // only used by the state to init the UI defaults.
33  static int getDefaultCurveType();
34  static void getCurveDefaults(int &comp, int &fill,
35  bool &fillout, float &thick, int &feather,
36  float &fwidth, float color[4]);
37 
38  // used only be the state: 0 = off, 1 = no bounds shift, 2 = raw spline.
39  void generateRawCurve(int rawmode);
40 
41 protected:
42  virtual bool updateParmsFlags();
43 
44  virtual COP2_ContextData *newContextData(const TIL_Plane *, int,
45  float t, int xres, int yres,
46  int thread, int max_threads);
47  virtual OP_ERROR generateTile(COP2_Context &context,
48  TIL_TileList *tilelist);
49 
50  virtual void getGeneratedBounds(COP2_Context &context,
51  int &bx1, int &by1,
52  int &bx2, int &by2);
53  virtual ~COP2_RotoShape();
54 private:
55  COP2_RotoShape(OP_Network *parent, const char *name,
56  OP_Operator *entry);
57 
58  // global.
59  int NUM_CURVES() { return evalInt("numcurves",0,0); }
60  float LOD(float t) { return evalFloat("detail",0,t); }
61  void ANTIALIAS(int &x, int &y, float t)
62  { x = evalInt("antialias", 0, t);
63  y = evalInt("antialias", 1, t); }
64 
65  // per-curve.
66  int NUM_POINTS(int curve);
67  int CURVE_TYPE(int curve);
68  int COMPOSITE(int curve);
69  int FILL(int curve);
70  bool FILL_OUTSIDE(int curve);
71  float THICKNESS(int curve, float t);
72  bool FEATHER(int curve);
73  int FEATHER_DROPOFF(int curve);
74  float FEATHER_WIDTH(int curve, float t);
75  void COLOR(int curve, float color[4], float t);
76 
77  void TRANSLATE(int curve, float &tx, float &ty, float t);
78  void PIVOT(int curve, float &px, float &py, float t);
79  void SCALE(int curve, float &sx, float &sy, float t);
80  float ROTATE(int curve, float t);
81 
82  // per-point, per-curve
83  void POINT_POS(int curve, int point, float &x, float &y, float t);
84  void POINT_SLOPE1(int curve, int point, float &x,float &y, float t);
85  void POINT_SLOPE2(int curve, int point, float &x,float &y, float t);
86  float POINT_THICKNESS(int curve, int point, float t);
87  float POINT_FEATHER(int curve, int point, float t);
88 
89  int myGenerateRaw;
90 };
91 
93 {
94 public:
96  virtual ~cop2_RotoShapeData();
97 
98  GU_Detail *getCurveDetail(int i);
99  GU_Detail *getFeatherDetail(int i);
100 
102 
103  int myMaxX;
104  int myMinX;
105  int myMaxY;
106  int myMinY;
107 };
108 
109 #endif
static OP_VariablePair myVariablePair
virtual OP_ERROR generateTile(COP2_Context &context, TIL_TileList *tilelist)=0
GLuint color
Definition: glcorearb.h:1260
UT_ValArray< cop2_RotoCurve * > myShapes
virtual bool updateParmsFlags()
fpreal evalFloat(int pi, int vi, fpreal t) const
UT_ErrorSeverity
Definition: UT_Error.h:25
GLint y
Definition: glcorearb.h:102
png_uint_32 i
Definition: png.h:2877
static OP_TemplatePair myTemplatePair
virtual COP2_ContextData * newContextData(const TIL_Plane *plane, int array_index, float t, int xres, int yres, int thread, int max_threads)
GLuint const GLchar * name
Definition: glcorearb.h:785
IFDmantra py
Definition: HDK_Image.dox:266
#define COP2_API
Definition: COP2_API.h:10
GLint GLenum GLint x
Definition: glcorearb.h:408
virtual void getGeneratedBounds(COP2_Context &context, int &bx1, int &by1, int &bx2, int &by2)
exint evalInt(int pi, int vi, fpreal t) const