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  ~GU_IsoMeta() override;
40 
41  const UT_BoundingBox &getBounds() const { return myBox; }
42 
43  float evalEdge(const UT_Vector3 &pt) override;
44  bool hasGradient() const override { return true; }
45  UT_Vector3 evalGrad(const UT_Vector3 &pt) override;
46 
47 private:
49  GU_Detail &detail,
50  GA_Offset vtxoff) override;
52  GEO_Primitive *primitive) override;
53 
54 private:
55  void construct(GU_Detail *dest, const GU_Detail *src,
56  const TS_MetaExpressionPtr &expr);
57 
58 private:
59  GA_AttributeRefMap myVertexHandles;
60  GA_AttributeRefMap myPrimitiveHandles;
61  GA_RWHandleV3 myN;
62  TS_MetaExpressionPtr myExpr;
63  UT_BoundingBox myBox;
64 };
65 
66 #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
virtual void fillPointVertexAttributes(GU_Detail &detail, GA_Offset vtxoff)
Definition: GU_Iso.h:58
GA_Size GA_Offset
Definition: GA_Types.h:646
A handle to simplify manipulation of multiple attributes.
#define GU_API
Definition: GU_API.h:14
const UT_BoundingBox & getBounds() const
Definition: GU_IsoMeta.h:41
bool hasGradient() const override
Check whether gradients are available for surfacing.
Definition: GU_IsoMeta.h:44
GLenum src
Definition: glcorearb.h:1793