HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_PrimMetaSQuad.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_PrimMetaSQuad_H__
13 #define __GEO_PrimMetaSQuad_H__
14 
15 #include "GEO_API.h"
16 #include <UT/UT_Vector3.h>
17 #include "GEO_MetaPrim.h"
18 #include "GEO_PrimSphere.h"
19 
21 class UT_MemoryCounter;
22 
24 {
25 protected:
26  /// NOTE: The constructor should only be called from subclass
27  /// constructors.
29 
30  /// NOTE: The destructor should only be called from subclass
31  /// destructors.
32  virtual ~GEO_PrimMetaSQuad() {}
33 
34 public:
35  virtual void copyPrimitive(const GEO_Primitive *src);
36  virtual bool isDegenerate() const;
37  virtual GEO_Primitive *copy(int preserve_shared_pts = 0) const;
38  virtual void copySubclassData(const GA_Primitive *source);
39 
40 //
41 // Methods to handle meta interface
42  void fillTSPrim(TS_MetaSuperQuadric &tsprim) const;
43  virtual GEO_MetaPrim *castToMetaPrim();
44  virtual const GEO_MetaPrim *castToMetaPrim() const;
45 
46  // A function that allocates a new TS_MetaSuperQuadric 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  void setXYexp(float v) { xyExp = v; }
58  void setZexp(float v) { zExp = v; }
59  float getXYexp(void) const { return xyExp; }
60  float getZexp(void) const { return zExp; }
61 
62  virtual const GA_PrimitiveJSON *getJSON() const;
63 
64 protected:
65  /// We explicitly do not include the mask from the GEO_PrimSphere base.
67  { return GEO_FAMILY_META; }
68 
69  // Declare methods for intrinsic attributes
71 
72  virtual bool savePrivateH9(std::ostream &os, bool binary) const;
73  virtual bool loadPrivateH9(UT_IStream &is);
74 
75 private:
76 
77  float xyExp;
78  float zExp;
79 };
80 #endif
virtual void copySubclassData(const GA_Primitive *source)
GLenum src
Definition: glew.h:2410
virtual void getBBox(UT_BoundingBox &bbox) const =0
float getXYexp(void) const
virtual GEO_MetaPrim * castToMetaPrim(void)
virtual const GA_PrimitiveJSON * getJSON() const
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
virtual int getBBox(UT_BoundingBox *bbox) const
#define GA_DECLARE_INTRINSICS(OVERRIDE)
Definition: GA_Primitive.h:80
const GLdouble * v
Definition: glew.h:1391
#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
void setZexp(float v)
GA_Size GA_Offset
Definition: GA_Types.h:637
const GLuint GLenum const void * binary
Definition: glew.h:3502
float getZexp(void) const
Provide a JSON interface to a primitive.
void setXYexp(float v)
#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 void copyPrimitive(const GEO_Primitive *src)
OIIO_API bool copy(string_view from, string_view to, std::string &err)
#define const
Definition: zconf.h:214
virtual TS_MetaPrimitive * getNewMetaPrim() const =0
virtual int getBBox(UT_BoundingBox *bbox) const
virtual ~GEO_PrimMetaSQuad()
#define GEO_FAMILY_META
Definition: GEO_PrimType.h:77
GLintptr offset
Definition: glew.h:1682