HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_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: GU_PrimMetaSQuad.h (C++)
7  *
8  * COMMENTS:
9  * Header file for GU_PrimMetaSQuad.h class...
10  *
11  */
12 
13 #ifndef __GU_PrimMetaSQuad_h__
14 #define __GU_PrimMetaSQuad_h__
15 
16 #include "GU_API.h"
17 #include <GEO/GEO_PrimMetaSQuad.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_PrimMetaSQuad //
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 
47  float weight;
48  float xyExp;
49  float zExp;
50 };
51 
53 {
54 protected:
55  /// NOTE: Primitives should not be deleted directly. They are managed
56  /// by the GA_PrimitiveList and the stash.
57  ~GU_PrimMetaSQuad() override
58  {}
59 
60 public:
61  /// NOTE: This constructor should only be called via GU_PrimitiveFactory.
64  {}
65 
66  /// Report approximate memory usage.
67  int64 getMemoryUsage() const override;
68 
69  /// Count memory usage using a UT_MemoryCounter in order to count
70  /// shared memory correctly.
71  /// NOTE: This should always include sizeof(*this).
72  void countMemory(UT_MemoryCounter &counter) const override;
73 
74  const GA_PrimitiveDefinition &getTypeDef() const override
75  {
76  UT_ASSERT(theDefinition);
77  return *theDefinition;
78  }
79 
80  // Conversion Methods
82  GA_PointGroup *usedpts = 0) override;
83 
84  GEO_Primitive *convertNew(GEO_ConvertParms &parms) override;
85 
86  void normal(NormalComp &output) const override {}
87  void normal(NormalCompD &output) const override {}
88 
89  // Optional Build Method
90  static GU_PrimMetaSQuad *build(const GU_PrimMetaSQuadParms &parms,
91  const char *kernel="wyvill");
92 
93  int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
94  float tmax = 1E17F, float tol = 1E-12F,
95  float *distance = 0, UT_Vector3 *pos = 0,
96  UT_Vector3 *nml = 0, int accurate = 0,
97  float *u = 0, float *v = 0,
98  int ignoretrim = 1) const override;
99 
100 private:
101  static GA_PrimitiveDefinition *theDefinition;
102  friend class GU_PrimitiveFactory;
103 
104 // Don't warn about overriding deprecated virtual methods
106 };
108 
109 #endif
const GA_PrimitiveDefinition & getTypeDef() const override
const GLdouble * v
Definition: glcorearb.h:837
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:209
#define GA_INVALID_OFFSET
Definition: GA_Types.h:687
GA_Size GA_Offset
Definition: GA_Types.h:646
GLintptr offset
Definition: glcorearb.h:665
virtual void countMemory(UT_MemoryCounter &counter) const
GU_PrimMetaSQuad(GU_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
NOTE: This constructor should only be called via GU_PrimitiveFactory.
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
void normal(NormalComp &output) const override
void normal(NormalCompD &output) const override
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
virtual GEO_Primitive * convert(GEO_ConvertParms &parms, GA_PointGroup *usedpts=0)=0
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition of a geometric primitive.
SIM_API const UT_StringHolder distance
~GU_PrimMetaSQuad() override
virtual GEO_Primitive * convertNew(GEO_ConvertParms &parms)=0