HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 copySubclassData(const GA_Primitive *source);
41 
42 //
43 // Methods to handle meta interface
44  void fillTSPrim(TS_MetaEllipsoid &tsprim) const;
45 
46  // A function that allocates a new TS_MetaEllipsoid and returns it.
47  // Used in the metaExpression parser to handle multiple instances
48  // of a metaball being used in the same expression
49  virtual TS_MetaPrimitive *getNewMetaPrim() const;
50 
51  virtual float density(const UT_Vector3 &pos) const;
52  virtual void getBBox(UT_BoundingBox &bbox) const;
53 
54  virtual int getBBox(UT_BoundingBox *bbox) const
55  { return GEO_PrimSphere::getBBox(bbox); }
56 
57  virtual GEO_MetaPrim *castToMetaPrim();
58  virtual const GEO_MetaPrim *castToMetaPrim() const;
59 
60  virtual const GA_PrimitiveJSON *getJSON() const;
61 
62 protected:
63  /// We explicitly do not include the mask from the GEO_PrimSphere base.
65  { return GEO_FAMILY_META; }
66 
67  // Declare intrinsic attributes
69 
70  virtual bool savePrivateH9(std::ostream &os, bool binary) const;
71  virtual bool loadPrivateH9(UT_IStream &is);
72 };
73 #endif
GEO_PrimMetaBall(GEO_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
virtual void copySubclassData(const GA_Primitive *source)
GLenum src
Definition: glew.h:2410
virtual void getBBox(UT_BoundingBox &bbox) const =0
virtual GEO_MetaPrim * castToMetaPrim(void)
virtual const GA_PrimitiveJSON * getJSON() const
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
#define GA_DECLARE_INTRINSICS(OVERRIDE)
Definition: GA_Primitive.h:80
#define GA_NO_OVERRIDE
Definition: GA_Primitive.h:76
virtual float density(const UT_Vector3 &pos) const =0
GA_PrimitiveFamilyMask
#define GA_INVALID_OFFSET
Definition: GA_Types.h:674
GA_Size GA_Offset
Definition: GA_Types.h:637
virtual ~GEO_PrimMetaBall()
virtual bool savePrivateH9(std::ostream &os, bool binary) const
const GLuint GLenum const void * binary
Definition: glew.h:3502
Provide a JSON interface to a primitive.
#define GEO_API
Definition: GEO_API.h:14
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 copyPrimitive(const GEO_Primitive *src)
OIIO_API bool copy(string_view from, string_view to, std::string &err)
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
GLintptr offset
Definition: glew.h:1682