HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Curve.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: GU_Curve.h (C++)
7  *
8  * COMMENTS:
9  * Header file for GU_Curve.h class...
10  *
11  */
12 
13 #ifndef __GU_Curve_h__
14 #define __GU_Curve_h__
15 
16 #include "GU_API.h"
17 #include <GEO/GEO_Curve.h>
18 
20 class GEO_ConvertMethod;
21 class GEO_ConvertParms;
22 class GEO_Hull;
23 class GU_PrimPoly;
24 class GU_Detail;
25 class GU_RayInfoHit;
26 
27 /////////////////////////////////////////////////////////////
28 // //
29 // Class: GU_Curve //
30 // Descr: This class is responsible for general type //
31 // of operations on the spline curve classes. //
32 // //
33 /////////////////////////////////////////////////////////////
34 
36 {
37 public:
38  // Takes the curve and converts it to a polygon with vertices at the
39  // Greville points of the curve and places the polygon in the given
40  // destination detail. If no detail is given place in the curves
41  // parent detail.
42  static GU_PrimPoly *makeGrevillePoly(const GEO_Curve &curve, GU_Detail *dest);
43 
44  // Returns number of hits appended, or minus one if error.
45  static int intersect(const GEO_Curve &curve, const GEO_Primitive &prim,
46  UT_Array<GU_RayInfoHit> &hitList,
47  float tol = 0.01F, int ignoretrim = 1);
48 
49  static GEO_Primitive *convert(GEO_Curve *curve, GEO_ConvertParms &parms, GA_PointGroup *usedpts);
50  static GEO_Primitive *convertNew(GEO_Curve *curve, GEO_ConvertParms &parms);
51  static GEO_Hull *convertToSurfNew(GEO_Curve *curve, GEO_ConvertParms &parms);
52  static GEO_Primitive *convertToPoly(GEO_Curve *curve, GEO_ConvertParms &parms);
53  static GEO_Hull *convertToTrim(GEO_Curve *curve, GEO_ConvertParms &parms);
54  static GEO_Hull *convertToPotatoChip(GEO_Curve *curve, GA_ElementWranglerCache &w);
55 
56  // Build the vextex list, and optionally append points to the detail.
57  // Return 0 if OK, and -1 if error.
58  static bool create(GEO_Curve &curve, GA_Size nelems, bool closed,
59  bool appendPoints = true);
60 
61  // Return the start and and knots for a full uniform evaluation of the
62  // curve.
63  static void evaluationInterval(const GEO_Curve &curve, float lod,
64  float &ustart, float &ustop, int &nu);
65 
66  /// Fill with values within the valid interval.
67  /// Returns true if OK and false otherwise.
68  static bool evaluateCurve(const GEO_Curve &curve,
69  GEO_ConvertMethod &method,
70  UT_Vector4Array &pos);
71 
72 private:
73  // We don't want anybody to instantiate a GU_Curve.
74  GU_Curve() {}
75 };
76 
77 #endif
Tto convert(const Tfrom &source)
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:236
#define GU_API
Definition: GU_API.h:14
IMATH_CONSTEXPR14 bool intersect(const Line3< T > &line, const Vec3< T > &v0, const Vec3< T > &v1, const Vec3< T > &v2, Vec3< T > &pt, Vec3< T > &barycentric, bool &front) IMATH_NOEXCEPT
Definition: ImathLineAlgo.h:80
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
GLint lod
Definition: glcorearb.h:2765