HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RU_RotoSpline.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: RU_RotoSpline.h
7  *
8  * COMMENTS:
9  * RotoSpline creation class.
10  */
11 #ifndef RU_ROTOSPLINE_H
12 #define RU_ROTOSPLINE_H
13 
14 #include "RU_API.h"
15 #include <UT/UT_Array.h>
16 
17 class RU_RotoPoint;
18 class GU_Detail;
19 
21 {
25 };
26 
28 {
32 };
33 
35 {
36 public:
38  float detail =0.5f, float aspect = 1.0f);
39  ~RU_RotoSpline();
40 
41  exint entries() const { return myPoints.entries(); }
42  RU_RotoPoint *getPoint(int i) { return myPoints(i); }
43  RU_RotoPoint *getPointByIndex(float index);
44  void addPoint(RU_RotoPoint *point);
45 
46  RU_RotoFill getFillType() const { return myFillType; }
47 
48 
49 
50  GU_Detail *build(GU_Detail *rawcurve = 0);
51  GU_Detail *buildFeather(float basewidth = 0.5F, GU_Detail *rawcurve = 0);
52 
53  static void buildFreehand(const UT_Vector2Array &ipoints,
54  UT_Vector2Array &points,
55  UT_Vector2Array &slopes1,
56  UT_Vector2Array &slopes2,
57  float tolerance,bool isbezier, bool close);
58 
59  // The feather parameter controls whether or not we create a point
60  // attribute containing each points feather width.
61  void buildRawCurve(GU_Detail &, bool feather=false);
62 
63 
64 private:
65  UT_Array<RU_RotoPoint *> myPoints;
66  RU_RotoFill myFillType;
67  float myAspect;
68  float myDetail;
69  RU_RotoType myCurveType;
70 };
71 
72 
74 {
75 public:
76  RU_RotoPoint(float index, float u, float v, float w,
77  float u1 =0.0F, float v1 = 0.0F,
78  float u2 = 0.0F, float v2 = 0.0F,
79  float feather = 0.0F)
80  : myU(u), myV(v), myThickness(w),
81  mySlopeU1(u1), mySlopeU2(u2), mySlopeV1(v1), mySlopeV2(v2),
82  myIndex(index), myFeatherWidth(feather) {}
83 
84  float myU, myV;
85  float myThickness;
86  float mySlopeU1, mySlopeU2, mySlopeV1, mySlopeV2;
87  float myIndex;
89 };
90 
91 
92 
93 #endif
RU_RotoType
Definition: RU_RotoSpline.h:27
RU_RotoPoint(float index, float u, float v, float w, float u1=0.0F, float v1=0.0F, float u2=0.0F, float v2=0.0F, float feather=0.0F)
Definition: RU_RotoSpline.h:76
const GLdouble * v
Definition: glcorearb.h:836
RU_RotoFill getFillType() const
Definition: RU_RotoSpline.h:46
#define RU_API
Definition: RU_API.h:10
GLfloat GLfloat GLfloat v2
Definition: glcorearb.h:817
png_uint_32 i
Definition: png.h:2877
GLfloat f
Definition: glcorearb.h:1925
int64 exint
Definition: SYS_Types.h:115
RU_RotoPoint * getPoint(int i)
Definition: RU_RotoSpline.h:42
float myThickness
Definition: RU_RotoSpline.h:85
float myFeatherWidth
Definition: RU_RotoSpline.h:88
virtual void close()
GLuint index
Definition: glcorearb.h:785
GLfloat GLfloat v1
Definition: glcorearb.h:816
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
exint entries() const
Definition: RU_RotoSpline.h:41
RU_RotoFill
Definition: RU_RotoSpline.h:20