HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #include <UT/UT_VectorTypes.h>
17 
18 class RU_RotoPoint;
19 class GU_Detail;
20 
22 {
26 };
27 
29 {
33 };
34 
36 {
37 public:
39  float detail =0.5f, float aspect = 1.0f);
40  ~RU_RotoSpline();
41 
42  exint entries() const { return myPoints.entries(); }
43  RU_RotoPoint *getPoint(int i) { return myPoints(i); }
44  RU_RotoPoint *getPointByIndex(float index);
45  void addPoint(RU_RotoPoint *point);
46 
47  RU_RotoFill getFillType() const { return myFillType; }
48 
49 
50 
51  GU_Detail *build(GU_Detail *rawcurve = 0);
52  GU_Detail *buildFeather(float basewidth = 0.5F, GU_Detail *rawcurve = 0);
53 
54  static void buildFreehand(const UT_Vector2Array &ipoints,
56  UT_Vector2Array &slopes1,
57  UT_Vector2Array &slopes2,
58  float tolerance,bool isbezier, bool close);
59 
60  // The feather parameter controls whether or not we create a point
61  // attribute containing each points feather width.
62  void buildRawCurve(GU_Detail &, bool feather=false);
63 
64 
65 private:
66  UT_Array<RU_RotoPoint *> myPoints;
67  RU_RotoFill myFillType;
68  float myAspect;
69  float myDetail;
70  RU_RotoType myCurveType;
71 };
72 
73 
75 {
76 public:
77  RU_RotoPoint(float index, float u, float v, float w,
78  float u1 =0.0F, float v1 = 0.0F,
79  float u2 = 0.0F, float v2 = 0.0F,
80  float feather = 0.0F)
81  : myU(u), myV(v), myThickness(w),
82  mySlopeU1(u1), mySlopeU2(u2), mySlopeV1(v1), mySlopeV2(v2),
83  myIndex(index), myFeatherWidth(feather) {}
84 
85  float myU, myV;
86  float myThickness;
87  float mySlopeU1, mySlopeU2, mySlopeV1, mySlopeV2;
88  float myIndex;
90 };
91 
92 
93 
94 #endif
RU_RotoType
Definition: RU_RotoSpline.h:28
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
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:77
const GLdouble * v
Definition: glcorearb.h:837
RU_RotoFill getFillType() const
Definition: RU_RotoSpline.h:47
#define RU_API
Definition: RU_API.h:10
int64 exint
Definition: SYS_Types.h:125
void close() override
GLfloat GLfloat GLfloat v2
Definition: glcorearb.h:818
GLdouble u1
Definition: glad.h:2676
GLfloat f
Definition: glcorearb.h:1926
RU_RotoPoint * getPoint(int i)
Definition: RU_RotoSpline.h:43
float myThickness
Definition: RU_RotoSpline.h:86
GLdouble GLdouble u2
Definition: glad.h:2676
float myFeatherWidth
Definition: RU_RotoSpline.h:89
GLuint index
Definition: glcorearb.h:786
GLfloat GLfloat v1
Definition: glcorearb.h:817
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
type
Definition: core.h:1059
exint entries() const
Definition: RU_RotoSpline.h:42
RU_RotoFill
Definition: RU_RotoSpline.h:21