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  virtual ~GU_PrimMetaBall()
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  virtual int64 getMemoryUsage() const;
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  virtual void countMemory(UT_MemoryCounter &counter) const;
72 
73  virtual const GA_PrimitiveDefinition &getTypeDef() const
74  {
75  UT_ASSERT(theDefinition);
76  return *theDefinition;
77  }
78 
79 
80  // Conversion Methods
82  GA_PointGroup *usedpts = 0);
84 
85  virtual void normal(NormalComp &output) const {}
86 
87  // Optional Build Method
88  static GU_PrimMetaBall *build(const GU_PrimMetaBallParms &parms,
89  const char *type = "wyvill");
90 
91  // Other representations. The rotation vector must be specified in a
92  // RIGHT-HANDED system.
93 
94  virtual int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
95  float tmax = 1E17F, float tol = 1E-12F,
96  float *distance = 0, UT_Vector3 *pos = 0,
97  UT_Vector3 *nml = 0, int accurate = 0,
98  float *u = 0, float *v = 0,
99  int ignoretrim = 1) const;
100 
101 private:
102  static GA_PrimitiveDefinition *theDefinition;
103  friend class GU_PrimitiveFactory;
104 
105 // Don't warn about overriding deprecated virtual methods
107 };
109 
110 #endif
virtual void normal(NormalComp &output) const
#define SYS_DEPRECATED_PUSH_DISABLE()
const GLdouble * v
Definition: glcorearb.h:836
#define SYS_DEPRECATED_POP_DISABLE()
GU_PrimMetaBall(GU_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
NOTE: This constructor should only be called via GU_PrimitiveFactory.
3D Vector class.
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:201
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual const GA_PrimitiveDefinition & getTypeDef() const
long long int64
Definition: SYS_Types.h:107
T distance(const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
Definition: UT_Vector4.h:698
virtual void countMemory(UT_MemoryCounter &counter) const
GLintptr offset
Definition: glcorearb.h:664
#define GU_API
Definition: GU_API.h:12
double fpreal
Definition: SYS_Types.h:270
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
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual GEO_Primitive * convert(GEO_ConvertParms &parms, GA_PointGroup *usedpts=0)=0
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:126
Definition of a geometric primitive.
virtual GEO_Primitive * convertNew(GEO_ConvertParms &parms)=0
virtual ~GU_PrimMetaBall()