HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_IsoMeta.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: GU_IsoMeta.h ( GU Library, C++)
7  *
8  * COMMENTS: Fast meta-ball polygonization.
9  *
10  * CAVEATS: The conversion can only happen once (i.e. it's not possible to
11  * convert multiple times since the data queue gets used up and
12  * needs to be re-initialized.
13  */
14 
15 #ifndef __GU_IsoMeta__
16 #define __GU_IsoMeta__
17 
18 #include "GU_API.h"
19 #include "GU_Iso.h"
20 #include <GA/GA_AttributeRefMap.h>
21 #include <GA/GA_Handle.h>
22 #include <TS/TS_Expression.h>
23 #include <UT/UT_BoundingBox.h>
24 #include <UT/UT_IntArray.h>
25 
26 class GA_PrimitiveGroup;
27 class GEO_Primitive;
28 class GEO_MetaPrim;
29 class TS_MetaExpression;
30 class GEO_MetaExpression;
31 
33 {
34 public:
35  GU_IsoMeta(GU_Detail *dest, const GU_Detail *src,
36  const GA_PrimitiveGroup *grp = NULL);
37  GU_IsoMeta(GU_Detail *dest, const GU_Detail *src,
38  const GEO_MetaExpression *expr);
39  virtual ~GU_IsoMeta();
40 
41  const UT_BoundingBox &getBounds() const { return myBox; }
42 
43  virtual float evalEdge(const UT_Vector3 &pt);
44  virtual bool hasGradient() const { return true; }
45  virtual UT_Vector3 evalGrad(const UT_Vector3 &pt);
46 
47 private:
48  virtual void fillPointVertexAttributes(GU_Detail &detail,
49  GA_Offset vtxoff);
50  virtual void fillPrimitiveAttributes(GEO_Primitive *primitive);
51 
52 private:
53  void construct(GU_Detail *dest, const GU_Detail *src,
54  const TS_MetaExpressionPtr &expr);
55 
56 private:
57  GA_AttributeRefMap myVertexHandles;
58  GA_AttributeRefMap myPrimitiveHandles;
59  GA_RWHandleV3 myN;
60  TS_MetaExpressionPtr myExpr;
61  UT_BoundingBox myBox;
62 };
63 
64 #endif
virtual UT_Vector3 evalGrad(const UT_Vector3 &pos)
Evaluate gradients if available.
Definition: GU_Iso.h:50
virtual float evalEdge(const UT_Vector3 &pos)
Evaluate the field at a position.
Definition: GU_Iso.h:43
virtual void fillPrimitiveAttributes(GEO_Primitive *primitive)
This function can be used to fill out primitive attribute information.
Definition: GU_Iso.h:62
3D Vector class.
virtual void fillPointVertexAttributes(GU_Detail &detail, GA_Offset vtxoff)
Definition: GU_Iso.h:58
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual bool hasGradient() const
Check whether gradients are available for surfacing.
Definition: GU_IsoMeta.h:44
A handle to simplify manipulation of multiple attributes.
#define GU_API
Definition: GU_API.h:12
const UT_BoundingBox & getBounds() const
Definition: GU_IsoMeta.h:41
GLenum src
Definition: glcorearb.h:1792