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,
34  const GT_AttributeListHandle &points);
37 
38  virtual const char *className() const { return "GT_GEOPrimMetaBall"; }
39 
40  /// @{
41  /// Members on GT_Primitive
42  virtual int getPrimitiveType() const;
43  virtual void enlargeBounds(UT_BoundingBox boxes[],
44  int nsegments) const;
45  virtual bool refine(GT_Refine &refiner,
46  const GT_RefineParms *parms=NULL) const;
47  virtual int getMotionSegments() const;
48  virtual int64 getMemoryUsage() const;
50  { return new GT_GEOPrimMetaBall(*this); }
51  /// @}
52 
53  /// Viewport refinement options
54  virtual const GT_ViewportRefineOptions &viewportRefineOptions() const;
55 
56  int getNumMetaballs() const;
57  UT_Matrix4D getTransform(int metaball_index) const;
58 
59  /// Split into disjoint clusters
60  bool cluster(GT_Refine &refiner) const;
61 
62  /// Polygonize into an iso-surface
63  bool polygonize(GT_Refine &refiner,
64  const GT_RefineParms *parms) const;
65 
67  { return myPoints; }
68 
70  { return myUniforms; }
71 
72  /// Return a data array containing the primitive offsets of the
73  /// corresponding GA primitives.
74  GT_DataArrayHandle getPrimitiveIds() const;
75  GT_DataArrayHandle getVertexIds() const;
76 
77  virtual bool updateGeoPrim(const GU_ConstDetailHandle &dtl,
78  const GT_RefineParms &refine);
79 private:
80  void computeBox();
81  GEO_MetaExpression *getExpr() const
82  {
83  return myExpression;
84  }
85  GU_ConstDetailHandle myHandle;
86  const GU_Detail *myDetail;
87  GEO_MetaExpression *myExpression;
88  UT_BoundingBox myBounds;
89  GT_AttributeListHandle myPoints;
90  GT_AttributeListHandle myUniforms;
91  GA_Range *myRange;
92 };
93 
94 #endif
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
virtual int getPrimitiveType() const
#define GT_API
Definition: GT_API.h:11
virtual const GT_AttributeListHandle & getPointAttributes() const
virtual const GT_AttributeListHandle & getUniformAttributes() const
virtual GT_PrimitiveHandle doSoftCopy() const
A range of elements in an index-map.
Definition: GA_Range.h:42
virtual const char * className() const
long long int64
Definition: SYS_Types.h:107
The base class for all GT primitive types.
Definition: GT_Primitive.h:43
virtual int64 getMemoryUsage() const =0
Processes primitives generated by refinement process.
Definition: GT_Refine.h:20
virtual void enlargeBounds(UT_BoundingBox boxes[], int nsegments) const =0
GLenum src
Definition: glcorearb.h:1792