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  ~GEO_PrimMetaSQuad() override {}
33 
34 public:
35  void copyPrimitive(
36  const GEO_Primitive *src) override;
37  bool isDegenerate() const override;
38  GEO_Primitive *copy(int preserve_shared_pts=0) const override;
39  void copySubclassData(
40  const GA_Primitive *source) override;
41 
42 //
43 // Methods to handle meta interface
44  void fillTSPrim(TS_MetaSuperQuadric &tsprim) const;
45  GEO_MetaPrim *castToMetaPrim() override;
46  const GEO_MetaPrim *castToMetaPrim() const override;
47 
48  // A function that allocates a new TS_MetaSuperQuadric and returns it.
49  // Used in the metaExpression parser to handle multiple instances
50  // of a metaball being used in the same expression
51  TS_MetaPrimitive *getNewMetaPrim() const override;
52 
53  float density(const UT_Vector3 &pos) const override;
54  void getBBox(UT_BoundingBox &bbox) const override;
55 
56  bool getBBox(UT_BoundingBox *bbox) const override
57  { return GEO_PrimSphere::getBBox(bbox); }
58 
59  void setXYexp(float v) { xyExp = v; }
60  void setZexp(float v) { zExp = v; }
61  float getXYexp() const { return xyExp; }
62  float getZexp() const { return zExp; }
63 
64  const GA_PrimitiveJSON *getJSON() const override;
65 
66 protected:
67  /// We explicitly do not include the mask from the GEO_PrimSphere base.
69  { return GEO_FAMILY_META; }
70 
71  // Declare methods for intrinsic attributes
72  GA_DECLARE_INTRINSICS(override)
73 
74  bool savePrivateH9(std::ostream &os,
75  bool binary) const override;
76  bool loadPrivateH9(UT_IStream &is) override;
77 
78 private:
79 
80  float xyExp;
81  float zExp;
82 };
83 #endif
bool getBBox(UT_BoundingBox *bbox) const override
virtual GEO_MetaPrim * castToMetaPrim()
float getZexp() const
virtual void getBBox(UT_BoundingBox &bbox) const =0
bool getBBox(UT_BoundingBox *bbox) const override
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
const GLdouble * v
Definition: glcorearb.h:837
float getXYexp() const
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
const GA_PrimitiveJSON * getJSON() const override
#define GA_DECLARE_INTRINSICS(OVERRIDE)
Definition: GA_Primitive.h:80
virtual float density(const UT_Vector3 &pos) const =0
void copyPrimitive(const GEO_Primitive *src) override
GA_PrimitiveFamilyMask
#define GA_INVALID_OFFSET
Definition: GA_Types.h:687
void setZexp(float v)
GA_Size GA_Offset
Definition: GA_Types.h:646
GLintptr offset
Definition: glcorearb.h:665
~GEO_PrimMetaSQuad() override
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
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.
void copySubclassData(const GA_Primitive *source) override
virtual TS_MetaPrimitive * getNewMetaPrim() const =0
#define GEO_FAMILY_META
Definition: GEO_PrimType.h:81
bool isDegenerate() const override
Is the primitive degenerate.
GLenum src
Definition: glcorearb.h:1793