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 
16 #include "GT_ElementSetMap.h"
17 #include "GT_Primitive.h"
18 
19 /// @brief A mesh of unconnected points
21 {
22 public:
25  const GT_AttributeListHandle &uniform)
26  {
27  init(points, uniform);
28  }
30  : myPoints(src.myPoints)
31  , myUniform(src.myUniform)
32  , myPointSetMap(src.myPointSetMap)
33  , GT_Primitive(src)
34  {
35  }
36  ~GT_PrimPointMesh() override;
37 
38  const char *className() const override { return "GT_PrimPointMesh"; }
39  bool save(UT_JSONWriter &w) const override;
40 
41  /// - @c attribs
42  /// The length of this array determines the number of points. There is
43  /// one entry per point.
45  const GT_AttributeListHandle &uniform)
46  {
47  myPoints = points;
48  myUniform = uniform;
49  return true;
50  }
51 
52  GT_Size getPointCount() const;
53  SYS_DEPRECATED(12.5) GT_Size getVertexCount() const
54  { return getPointCount(); }
55 
56  /// Get the varying data array. There is one entry for each vertex
58  { return myPoints; }
60  { return myUniform; }
61 
62  /// @{
63  /// Access attributes
65  { return myPoints; }
66  // Uniforms are mapped to detail attributes for points, as they behave as
67  // detail attributes to GL.
69  { return myUniform; }
70  /// @}
71 
72  /// @{
73  /// Access to the point sets
74  const GT_ElementSetMapPtr &pointSetMap() const { return myPointSetMap; }
76  { myPointSetMap = v; }
77  /// @}
78 
79  /// @{
80  /// Methods defined on GT_Primitive
81  void enlargeBounds(UT_BoundingBox boxes[],
82  int nsegment) const override;
84  int n) const override;
85  int getPrimitiveType() const override;
86  int getMotionSegments() const override;
87  int64 getMemoryUsage() const override;
88  /// @}
89 
90  /// Harden all attributes so there are no dangling dependencies
91  GT_PrimitiveHandle doHarden() const override;
92  GT_PrimitiveHandle doSoftCopy() const override
93  { return new GT_PrimPointMesh(*this); }
94 
95  /// The virtual implementation of attribute merging
97  const GT_Primitive &src,
99  const UT_StringMMPattern *point,
100  const UT_StringMMPattern *uniform,
101  const UT_StringMMPattern *detail
102  ) const override;
103 private:
104  GT_AttributeListHandle myPoints;
105  GT_AttributeListHandle myUniform;
106  GT_ElementSetMapPtr myPointSetMap;
107 };
108 
109 #endif
SIM_API const UT_StringHolder vertex
virtual int getMotionSegments() const =0
GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glad.h:2676
#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
const GLdouble * v
Definition: glcorearb.h:837
#define GT_API
Definition: GT_API.h:13
void setPointSetMap(const GT_ElementSetMapPtr &v)
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
const GT_AttributeListHandle & getPoints() const
Get the varying data array. There is one entry for each vertex.
GLdouble n
Definition: glcorearb.h:2008
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
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
virtual GT_PrimitiveHandle doHarden() const
virtual int64 getMemoryUsage() const =0
int64 GT_Size
Definition: GT_Types.h:128
bool init(const GT_AttributeListHandle &points, const GT_AttributeListHandle &uniform)
virtual bool save(UT_JSONWriter &w) const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
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_ElementSetMapPtr & pointSetMap() const
const GT_AttributeListHandle & getUniform() const
GLenum src
Definition: glcorearb.h:1793