HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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.
58  {}
59 
60 public:
61  /// NOTE: This constructor should only be called via GU_PrimitiveFactory.
64  {}
65 
66  /// Report approximate memory usage.
67  virtual int64 getMemoryUsage() const;
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  virtual void countMemory(UT_MemoryCounter &counter) const;
73 
74  virtual const GA_PrimitiveDefinition &getTypeDef() const
75  {
76  UT_ASSERT(theDefinition);
77  return *theDefinition;
78  }
79 
80  // Conversion Methods
81  virtual GEO_Primitive *convert(GEO_ConvertParms &parms,
82  GA_PointGroup *usedpts = 0);
83 
84  virtual GEO_Primitive *convertNew(GEO_ConvertParms &parms);
85 
86  virtual void normal(NormalComp &output) const {}
87 
88  // Optional Build Method
89  static GU_PrimMetaSQuad *build(const GU_PrimMetaSQuadParms &parms,
90  const char *kernel="wyvill");
91 
92  virtual int intersectRay(const UT_Vector3 &o, const UT_Vector3 &d,
93  float tmax = 1E17F, float tol = 1E-12F,
94  float *distance = 0, UT_Vector3 *pos = 0,
95  UT_Vector3 *nml = 0, int accurate = 0,
96  float *u = 0, float *v = 0,
97  int ignoretrim = 1) const;
98 
99 private:
100  static GA_PrimitiveDefinition *theDefinition;
101  friend class GU_PrimitiveFactory;
102 
103 // Don't warn about overriding deprecated virtual methods
105 };
107 
108 #endif
#define SYS_DEPRECATED_PUSH_DISABLE()
const GLdouble * v
Definition: glcorearb.h:836
#define SYS_DEPRECATED_POP_DISABLE()
virtual void normal(NormalComp &output) const
3D Vector class.
virtual int64 getMemoryUsage() const
Definition: GA_Primitive.h:204
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
GA_Size GA_Offset
Definition: GA_Types.h:617
long long int64
Definition: SYS_Types.h:106
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:102
T distance(const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
Definition: UT_Vector4.h:634
virtual void countMemory(UT_MemoryCounter &counter) const
GLintptr offset
Definition: glcorearb.h:664
GU_PrimMetaSQuad(GU_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
NOTE: This constructor should only be called via GU_PrimitiveFactory.
#define GU_API
Definition: GU_API.h:11
virtual ~GU_PrimMetaSQuad()
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
Definition of a geometric primitive.
virtual const GA_PrimitiveDefinition & getTypeDef() const
virtual GEO_Primitive * convertNew(GEO_ConvertParms &parms)=0