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  ~GT_PrimPointMesh() override;
34 
35  const char *className() const override { return "GT_PrimPointMesh"; }
36  bool save(UT_JSONWriter &w) const override
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.
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  void enlargeBounds(UT_BoundingBox boxes[],
76  int nsegment) const override;
78  int n) const override;
79  int getPrimitiveType() const override;
80  int getMotionSegments() const override;
81  int64 getMemoryUsage() const override;
82  /// @}
83 
84  /// Harden all attributes so there are no dangling dependencies
85  GT_PrimitiveHandle doHarden() const override;
86  GT_PrimitiveHandle doSoftCopy() const override
87  { return new GT_PrimPointMesh(*this); }
88 
89  /// The virtual implementation of attribute merging
91  const GT_Primitive &src,
92  const UT_StringMMPattern *vertex,
93  const UT_StringMMPattern *point,
94  const UT_StringMMPattern *uniform,
95  const UT_StringMMPattern *detail
96  ) const override;
97 private:
98  GT_AttributeListHandle myPoints;
99  GT_AttributeListHandle myUniform;
100 };
101 
102 #endif
virtual int getMotionSegments() const =0
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
#define SYS_DEPRECATED(__V__)
GT_PrimitiveHandle doSoftCopy() const override
const GT_AttributeListHandle & getPointAttributes() const override
virtual int getPrimitiveType() const
const GT_AttributeListHandle & getDetailAttributes() const override
#define GT_API
Definition: GT_API.h:11
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:35
GLenum src
Definition: glcorearb.h:1792
const GT_AttributeListHandle & getPoints() const
Get the varying data array. There is one entry for each vertex.
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
bool save(UT_JSONWriter &w) const override
GT_PrimPointMesh(const GT_PrimPointMesh &src)
const char * className() const override
GT_PrimPointMesh(const GT_AttributeListHandle &points, const GT_AttributeListHandle &uniform)
virtual void enlargeRenderBounds(UT_BoundingBox boxes[], int nsegments) const
A mesh of unconnected points.
long long int64
Definition: SYS_Types.h:116
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
virtual GT_PrimitiveHandle doHarden() const
virtual int64 getMemoryUsage() const =0
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glew.h:3460
GLdouble n
Definition: glcorearb.h:2007
int64 GT_Size
Definition: GT_Types.h:123
bool init(const GT_AttributeListHandle &points, const GT_AttributeListHandle &uniform)
bool saveAttributeLists(UT_JSONWriter &w) const
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