HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_PrimMetaBall.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_PrimMetaBall.h (C++)
7  *
8  * COMMENTS:
9  * Header file for GU_PrimMetaBall.h class...
10  *
11  */
12 
13 #ifndef __GU_PrimMetaBall_h__
14 #define __GU_PrimMetaBall_h__
15 
16 #include "GU_API.h"
17 #include <GEO/GEO_PrimMetaBall.h>
18 #include "GU_Detail.h"
19 
20 class GEO_ConvertParms;
21 class GEO_Hull;
22 class GU_PrimPoly;
23 class GU_PrimMesh;
24 class GU_PrimNURBSurf;
25 class GU_PrimRBezSurf;
26 class UT_MemoryCounter;
27 
28 /////////////////////////////////////////////////////////////
29 // //
30 // Class: GU_PrimMetaBall //
31 // Descr: This class is responsible for operations //
32 // done on sphere primitives. As we need to access //
33 // the GU_Detail, the pointer is passed in the //
34 // constructor. The second constructor creates a //
35 // sphere with the given parameters. //
36 // //
37 /////////////////////////////////////////////////////////////
38 
40 {
41 public:
43  fpreal weight=2);
44 
46  GA_Offset ptoff; // use this point instead of yours
48  float weight;
49 };
50 
52 {
53 protected:
54  /// NOTE: Primitives should not be deleted directly. They are managed
55  /// by the GA_PrimitiveList and the stash.
56  ~GU_PrimMetaBall() override
57  {}
58 
59 public:
60  /// NOTE: This constructor should only be called via GU_PrimitiveFactory.
62  : GEO_PrimMetaBall(gdp, offset)
63  {}
64 
65  /// Report approximate memory usage.
66  int64 getMemoryUsage() const override;
67 
68  /// Count memory usage using a UT_MemoryCounter in order to count
69  /// shared memory correctly.
70  /// NOTE: This should always include sizeof(*this).
71  void countMemory(UT_MemoryCounter &counter) const override;
72 
73  const GA_PrimitiveDefinition &getTypeDef() const override
74  {
75  UT_ASSERT(theDefinition);
76  return *theDefinition;
77  }
78 
79 
80  // Conversion Methods
82  GA_PointGroup *usedpts = 0) override;
83  GEO_Primitive *convertNew(GEO_ConvertParms &parms) override;
84 
85  void normal(NormalComp &output) const override {}
86  void normal(NormalCompD &output) const override {}
87 
88  // Optional Build Method
89  static GU_PrimMetaBall *build(const GU_PrimMetaBallParms &parms,
90  const char *type = "wyvill");
91 
92  // Other representations. The rotation vector must be specified in a
93  // RIGHT-HANDED system.
94 
95  int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
96  float tmax = 1E17F, float tol = 1E-12F,
97  float *distance = 0, UT_Vector3 *pos = 0,
98  UT_Vector3 *nml = 0, int accurate = 0,
99  float *u = 0, float *v = 0,
100  int ignoretrim = 1) const override;
101 
102 private:
103  static GA_PrimitiveDefinition *theDefinition;
104  friend class GU_PrimitiveFactory;
105 
106 // Don't warn about overriding deprecated virtual methods
108 };
110 
111 #endif
const GLdouble * v
Definition: glcorearb.h:837
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
void normal(NormalComp &output) const override
GU_PrimMetaBall(GU_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
NOTE: This constructor should only be called via GU_PrimitiveFactory.
void normal(NormalCompD &output) const override
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:209
~GU_PrimMetaBall() override
#define GA_INVALID_OFFSET
Definition: GA_Types.h:687
GA_Size GA_Offset
Definition: GA_Types.h:646
GLintptr offset
Definition: glcorearb.h:665
const GA_PrimitiveDefinition & getTypeDef() const override
virtual void countMemory(UT_MemoryCounter &counter) const
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
static GEO_PrimSphere * build(GA_Detail &detail, GA_Offset existing_ptoff=GA_INVALID_OFFSET)
virtual int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d, float tmax=1E17F, float tol=1E-12F, float *distance=0, UT_Vector3 *pos=0, UT_Vector3 *nml=0, int accurate=0, float *u=0, float *v=0, int ignoretrim=1) const
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual GEO_Primitive * convert(GEO_ConvertParms &parms, GA_PointGroup *usedpts=0)=0
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition of a geometric primitive.
SIM_API const UT_StringHolder distance
type
Definition: core.h:1059
virtual GEO_Primitive * convertNew(GEO_ConvertParms &parms)=0