HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GT_PrimCurve.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: GT_PrimCurve.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_PrimCurve__
12 #define __GT_PrimCurve__
13 
14 #include "GT_API.h"
15 #include "GT_Primitive.h"
16 
17 /// @brief A single linear or cubic patch
19 public:
20  GT_PrimCurve();
22  const GT_AttributeListHandle &vertex,
23  const GT_AttributeListHandle &uniform,
24  bool wrap)
25  {
26  init(basis, vertex, uniform, wrap);
27  }
28  virtual ~GT_PrimCurve();
29 
30  virtual const char *className() const { return "GT_PrimCurve"; }
31  virtual bool save(UT_JSONWriter &w) const;
32 
33  /// @{
34  /// Methods defined on GT_Primitive
35  virtual void enlargeBounds(UT_BoundingBox boxes[],
36  int nsegments) const;
37  virtual void enlargeRenderBounds(UT_BoundingBox b[], int n) const;
38  virtual int getPrimitiveType() const;
39  virtual int getMotionSegments() const;
40  virtual int64 getMemoryUsage() const;
41  /// @}
42 
43  /// Construct a simple curve.
44  /// - @c vertex @n Attribute data per vertex
45  /// - @c uniform @n Single value which is uniform over the patch
46  bool init(GT_Basis basis,
47  const GT_AttributeListHandle &vertex,
48  const GT_AttributeListHandle &uniform,
49  bool wrapped);
50 
51  /// @{
52  /// Accessor
53  GT_Basis getBasis() const { return myBasis; }
54  bool getWrap() const { return myWrap; }
55  const GT_AttributeListHandle &getVertex() const { return myVertex; }
56  const GT_AttributeListHandle &getUniform() const { return myUniform; }
57  /// @}
58 
59  /// @{
60  /// Access attributes
62  { return myVertex; }
64  { return myUniform; }
65  /// @}
66 
67  /// @{
68  /// Methods for GEO/GU support.
69  /// Compute perimeter of a curve or an indexed curve
70  virtual fpreal computePerimeter(int seg) const;
71  static fpreal curveLength(const GT_DataArray &P,
72  GT_Size nvtx=-1, GT_Offset start=0,
73  const UT_Matrix4D *xform = NULL);
74  /// @}
75 
76  /// Harden all attributes so there are no dangling dependencies
77  virtual GT_PrimitiveHandle doHarden() const;
79  { return new GT_PrimCurve(*this); }
80 
81  /// The virtual implementation of attribute merging
83  const UT_StringMMPattern *vertex,
84  const UT_StringMMPattern *point,
85  const UT_StringMMPattern *uniform,
86  const UT_StringMMPattern *detail) const;
87 
88 private:
89  GT_AttributeListHandle myVertex;
90  GT_AttributeListHandle myUniform;
92  bool myWrap;
93 };
94 
95 #endif
virtual const GT_AttributeListHandle & getVertexAttributes() const
Definition: GT_PrimCurve.h:61
virtual int getMotionSegments() const =0
virtual int getPrimitiveType() const
virtual fpreal computePerimeter(int seg=0) const
GLuint start
Definition: glcorearb.h:474
GT_PrimCurve(GT_Basis basis, const GT_AttributeListHandle &vertex, const GT_AttributeListHandle &uniform, bool wrap)
Definition: GT_PrimCurve.h:21
#define GT_API
Definition: GT_API.h:11
const GT_AttributeListHandle & getVertex() const
Definition: GT_PrimCurve.h:55
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
virtual const char * className() const
Definition: GT_PrimCurve.h:30
long long int64
Definition: SYS_Types.h:106
GLdouble n
Definition: glcorearb.h:2007
const GT_AttributeListHandle & getUniform() const
Definition: GT_PrimCurve.h:56
Abstract data class for an array of float, int or string data.
Definition: GT_DataArray.h:38
bool getWrap() const
Definition: GT_PrimCurve.h:54
virtual const GT_AttributeListHandle & getUniformAttributes() const
Definition: GT_PrimCurve.h:63
virtual void enlargeRenderBounds(UT_BoundingBox boxes[], int nsegments) const
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
The base class for all GT primitive types.
Definition: GT_Primitive.h:41
virtual GT_PrimitiveHandle doHarden() const
virtual int64 getMemoryUsage() const =0
virtual GT_PrimitiveHandle doSoftCopy() const
Definition: GT_PrimCurve.h:78
double fpreal
Definition: SYS_Types.h:269
GT_Basis myBasis
Definition: GT_CurveEval.h:262
virtual bool save(UT_JSONWriter &w) const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
GT_Basis getBasis() const
Definition: GT_PrimCurve.h:53
GT_Basis
Definition: GT_Types.h:49
int64 GT_Offset
Definition: GT_Types.h:110
int64 GT_Size
Definition: GT_Types.h:109
A single linear or cubic patch.
Definition: GT_PrimCurve.h:18
virtual GT_PrimitiveHandle doAttributeMerge(const GT_Primitive &src, const UT_StringMMPattern *vertex, const UT_StringMMPattern *point, const UT_StringMMPattern *uniform, const UT_StringMMPattern *detail) const
The virtual implementation of attribute merging.
virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const =0
GLenum src
Definition: glcorearb.h:1792