HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_GEOPrimMetaBall.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_GEOPrimMetaBall.h (GU Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_GEOPrimMetaBall__
12 #define __GT_GEOPrimMetaBall__
13 
14 #include "GT_API.h"
15 #include "GT_Primitive.h"
16 #include <UT/UT_BoundingBox.h>
17 #include <GU/GU_DetailHandle.h>
18 
19 class GA_Range;
20 class GU_Detail;
21 class GEO_MetaExpression;
22 
23 /// Metaball primitive for GT
24 ///
25 /// Currently only one motion segment is supported.
27 {
28 public:
30  GT_GEOPrimMetaBall(const GU_ConstDetailHandle *detail_list,
31  int nsegments,
32  const GA_Range &prim_range,
33  const GT_AttributeListHandle &prims,
36  ~GT_GEOPrimMetaBall() override;
37 
38  const char *className() const override
39  { return "GT_GEOPrimMetaBall"; }
40 
41  /// @{
42  /// Members on GT_Primitive
43  int getPrimitiveType() const override;
44  void enlargeBounds(UT_BoundingBox boxes[],
45  int nsegments) const override;
46  bool refine(GT_Refine &refiner,
47  const GT_RefineParms *parms=NULL) const override;
48  int getMotionSegments() const override;
49  int64 getMemoryUsage() const override;
50  GT_PrimitiveHandle doSoftCopy() const override
51  { return new GT_GEOPrimMetaBall(*this); }
52  /// @}
53 
54  /// Viewport refinement options
55  const GT_ViewportRefineOptions &viewportRefineOptions() const override;
56 
57  int getNumMetaballs() const;
58  UT_Matrix4D getTransform(int metaball_index) const;
59 
60  /// Split into disjoint clusters
61  bool cluster(GT_Refine &refiner) const;
62 
63  /// Polygonize into an iso-surface
64  bool polygonize(GT_Refine &refiner,
65  const GT_RefineParms *parms) const;
66 
68  { return myPoints; }
69 
71  { return myUniforms; }
72 
73  /// Return a data array containing the primitive offsets of the
74  /// corresponding GA primitives.
75  GT_DataArrayHandle getPrimitiveIds() const;
76  GT_DataArrayHandle getVertexIds() const;
77 
78  bool updateGeoPrim(const GU_ConstDetailHandle &dtl,
79  const GT_RefineParms &refine) override;
80 private:
81  void computeBox();
82  GEO_MetaExpression *getExpr() const
83  {
84  return myExpression;
85  }
86  GU_ConstDetailHandle myHandle;
87  const GU_Detail *myDetail;
88  GEO_MetaExpression *myExpression;
89  UT_BoundingBox myBounds;
90  GT_AttributeListHandle myPoints;
91  GT_AttributeListHandle myUniforms;
92  GA_Range *myRange;
93 };
94 
95 #endif
const char * className() const override
virtual int getMotionSegments() const =0
virtual bool updateGeoPrim(const GU_ConstDetailHandle &dtl, const GT_RefineParms &parms)
update any cached data for geometry and its attributes
virtual bool refine(GT_Refine &refiner, const GT_RefineParms *parms=NULL) const
virtual const GT_ViewportRefineOptions & viewportRefineOptions() const
const GT_AttributeListHandle & getUniformAttributes() const override
virtual int getPrimitiveType() const
const GT_AttributeListHandle & getPointAttributes() const override
#define GT_API
Definition: GT_API.h:11
GLenum src
Definition: glcorearb.h:1793
A range of elements in an index-map.
Definition: GA_Range.h:42
long long int64
Definition: SYS_Types.h:116
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
virtual int64 getMemoryUsage() const =0
GLuint GLdouble GLdouble GLint GLint const GLdouble * points
Definition: glew.h:3460
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
GT_PrimitiveHandle doSoftCopy() const override
virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const =0