HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_PrimPointMesh.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_PrimPointMesh.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_PrimPointMesh__
12 #define __GT_PrimPointMesh__
13 
14 #include "GT_API.h"
15 #include "GT_Primitive.h"
16 
17 /// @brief A mesh of unconnected points
19 {
20 public:
23  const GT_AttributeListHandle &uniform)
24  {
25  init(points, uniform);
26  }
28  : myPoints(src.myPoints)
29  , myUniform(src.myUniform)
30  , GT_Primitive(src)
31  {
32  }
33  virtual ~GT_PrimPointMesh();
34 
35  virtual const char *className() const { return "GT_PrimPointMesh"; }
36  virtual bool save(UT_JSONWriter &w) const
37  {
38  jsonWriter j(w, "Points");
39  return saveAttributeLists(*j);
40  }
41 
42  /// - @c attribs
43  /// The length of this array determines the number of points. There is
44  /// one entry per point.
45  bool init(const GT_AttributeListHandle &points,
46  const GT_AttributeListHandle &uniform)
47  {
48  myPoints = points;
49  myUniform = uniform;
50  return true;
51  }
52 
53  GT_Size getPointCount() const;
54  SYS_DEPRECATED(12.5) GT_Size getVertexCount() const
55  { return getPointCount(); }
56 
57  /// Get the varying data array. There is one entry for each vertex
59  { return myPoints; }
61  { return myUniform; }
62 
63  /// @{
64  /// Access attributes
66  { return myPoints; }
67  // Uniforms are mapped to detail attributes for points, as they behave as
68  // detail attributes to GL.
70  { return myUniform; }
71  /// @}
72 
73  /// @{
74  /// Methods defined on GT_Primitive
75  virtual void enlargeBounds(UT_BoundingBox boxes[],
76  int nsegment) const;
77  virtual void enlargeRenderBounds(UT_BoundingBox b[], int n) const;
78  virtual int getPrimitiveType() const;
79  virtual int getMotionSegments() const;
80  virtual int64 getMemoryUsage() const;
81  /// @}
82 
83  /// Harden all attributes so there are no dangling dependencies
84  virtual GT_PrimitiveHandle doHarden() const;
86  { return new GT_PrimPointMesh(*this); }
87 
88  /// The virtual implementation of attribute merging
90  const UT_StringMMPattern *vertex,
91  const UT_StringMMPattern *point,
92  const UT_StringMMPattern *uniform,
93  const UT_StringMMPattern *detail) const;
94 private:
95  GT_AttributeListHandle myPoints;
96  GT_AttributeListHandle myUniform;
97 };
98 
99 #endif
virtual int getMotionSegments() const =0
#define SYS_DEPRECATED(__V__)
virtual int getPrimitiveType() const
virtual const GT_AttributeListHandle & getPointAttributes() const
#define GT_API
Definition: GT_API.h:11
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:32
const GT_AttributeListHandle & getPoints() const
Get the varying data array. There is one entry for each vertex.
long long int64
Definition: SYS_Types.h:107
virtual bool save(UT_JSONWriter &w) const
GLdouble n
Definition: glcorearb.h:2007
GT_PrimPointMesh(const GT_PrimPointMesh &src)
GT_PrimPointMesh(const GT_AttributeListHandle &points, const GT_AttributeListHandle &uniform)
virtual void enlargeRenderBounds(UT_BoundingBox boxes[], int nsegments) const
virtual GT_PrimitiveHandle doSoftCopy() const
A mesh of unconnected points.
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
virtual GT_PrimitiveHandle doHarden() const
virtual int64 getMemoryUsage() const =0
bool init(const GT_AttributeListHandle &points, const GT_AttributeListHandle &uniform)
virtual const char * className() const
bool saveAttributeLists(UT_JSONWriter &w) const
virtual const GT_AttributeListHandle & getDetailAttributes() const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
int64 GT_Size
Definition: GT_Types.h:112
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
const GT_AttributeListHandle & getUniform() const
GLenum src
Definition: glcorearb.h:1792