HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEO_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: Geometry Library (C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __GEO_PrimMetaBall_H__
13 #define __GEO_PrimMetaBall_H__
14 
15 #include "GEO_API.h"
16 #include <UT/UT_Vector3.h>
17 #include "GEO_MetaPrim.h"
18 #include "GEO_PrimSphere.h"
19 
20 class TS_MetaEllipsoid;
21 class UT_MemoryCounter;
22 
24 {
25 protected:
26  /// NOTE: The constructor should only be called from subclass
27  /// constructors.
30  {}
31 
32  /// NOTE: The destructor should only be called from subclass
33  /// destructors.
34  virtual ~GEO_PrimMetaBall() {}
35 
36 public:
37  virtual void copyPrimitive(const GEO_Primitive *src);
38  virtual bool isDegenerate() const;
39  virtual GEO_Primitive *copy(int preserve_shared_pts = 0) const;
40  virtual void copyUnwiredForMerge(const GA_Primitive *src,
41  const GA_MergeMap &map);
42 
43 //
44 // Methods to handle meta interface
45  void fillTSPrim(TS_MetaEllipsoid &tsprim) const;
46 
47  // A function that allocates a new TS_MetaEllipsoid and returns it.
48  // Used in the metaExpression parser to handle multiple instances
49  // of a metaball being used in the same expression
50  virtual TS_MetaPrimitive *getNewMetaPrim() const;
51 
52  virtual float density(const UT_Vector3 &pos) const;
53  virtual void getBBox(UT_BoundingBox &bbox) const;
54 
55  virtual int getBBox(UT_BoundingBox *bbox) const
56  { return GEO_PrimSphere::getBBox(bbox); }
57 
58  virtual GEO_MetaPrim *castToMetaPrim();
59  virtual const GEO_MetaPrim *castToMetaPrim() const;
60 
61  virtual const GA_PrimitiveJSON *getJSON() const;
62 
63 protected:
64  /// We explicitly do not include the mask from the GEO_PrimSphere base.
66  { return GEO_FAMILY_META; }
67 
68  // Declare intrinsic attributes
70 
71  virtual bool savePrivateH9(std::ostream &os, bool binary) const;
72  virtual bool loadPrivateH9(UT_IStream &is);
73 };
74 #endif
GEO_PrimMetaBall(GEO_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
virtual void getBBox(UT_BoundingBox &bbox) const =0
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
The merge map keeps track of information when merging details.
Definition: GA_MergeMap.h:53
virtual GEO_MetaPrim * castToMetaPrim(void)
virtual const GA_PrimitiveJSON * getJSON() const
#define GA_DECLARE_INTRINSICS(OVERRIDE)
Definition: GA_Primitive.h:79
#define GA_NO_OVERRIDE
Definition: GA_Primitive.h:75
3D Vector class.
virtual float density(const UT_Vector3 &pos) const =0
GA_PrimitiveFamilyMask
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
GA_Size GA_Offset
Definition: GA_Types.h:617
virtual ~GEO_PrimMetaBall()
virtual bool savePrivateH9(std::ostream &os, bool binary) const
GLintptr offset
Definition: glcorearb.h:664
Provide a JSON interface to a primitive.
#define GEO_API
Definition: GEO_API.h:10
static GA_PrimitiveFamilyMask buildFamilyMask()
We explicitly do not include the mask from the GEO_PrimSphere base.
virtual bool isDegenerate() const
Is the primitive degenerate.
virtual int getBBox(UT_BoundingBox *bbox) const
virtual void copyUnwiredForMerge(const GA_Primitive *src, const GA_MergeMap &map)
virtual GEO_Primitive * copy(int preserve_shared_pts=0) const
virtual void copyPrimitive(const GEO_Primitive *src)
virtual bool loadPrivateH9(UT_IStream &is)
virtual TS_MetaPrimitive * getNewMetaPrim() const =0
virtual int getBBox(UT_BoundingBox *bbox) const
#define GEO_FAMILY_META
Definition: GEO_PrimType.h:77
GLenum src
Definition: glcorearb.h:1792