HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_PrimNull.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: GEO_PrimNull.h (GEO Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GEO_PrimNull__
12 #define __GEO_PrimNull__
13 
14 #include "GEO_API.h"
15 #include "GEO_Primitive.h"
16 #include <GA/GA_Types.h>
17 #include <UT/UT_Assert.h>
18 #include <UT/UT_Vector3.h>
19 
20 class GA_Detail;
21 class GEO_ConvertParms;
22 
23 /// Null primitive is a stand-in primitive to handle loading of unknown
24 /// primitives
26 {
27 protected:
28  /// NOTE: The destructor should only be called from subclass
29  /// destructors.
30  ~GEO_PrimNull() override {}
31 
32 public:
33  /// NOTE: The constructor should only be called from subclass
34  /// constructors.
36  : GEO_Primitive(d, offset)
37  {}
38 
39  /// @{
40  /// Required interface for GEO
41  bool isDegenerate() const override { return true; }
42  bool getBBox(UT_BoundingBox *bbox) const override;
43  void reverse() override {}
44  UT_Vector3D computeNormalD() const override;
45  UT_Vector3 computeNormal() const override;
46  void copyPrimitive(const GEO_Primitive *s) override;
47  int detachPoints(GA_PointGroup &g) override;
48  GA_DereferenceStatus dereferencePoint(GA_Offset, bool) override;
49  GA_DereferenceStatus dereferencePoints(
50  const GA_RangeMemberQuery &, bool) override;
51  const GA_PrimitiveJSON *getJSON() const override;
53  GA_Offset,
55  fpreal, fpreal, uint, uint) const override;
56  /// @}
57 
58  /// @{
59  /// Special for factory primitives
61  { return GA_FAMILY_NONE; }
62  /// @}
63 
64  /// Report approximate memory usage.
65  int64 getMemoryUsage() const override
66  { return sizeof(*this); }
67 
68  /// Count memory usage using a UT_MemoryCounter in order to count
69  /// shared memory correctly.
70  /// NOTE: This should always include sizeof(*this).
71  void countMemory(
72  UT_MemoryCounter &counter) const override;
73 
74  /// @{
75  /// Minimal interface required by GU
76  const GA_PrimitiveDefinition &getTypeDef() const override
77  {
78  UT_ASSERT(theDefinition);
79  return *theDefinition;
80  }
81 
83  GA_PointGroup *) override
84  { return NULL; }
86  { return NULL; }
87 
88  void normal(NormalComp &) const override {}
89  void normal(NormalCompD &) const override {}
91  const UT_Vector3 &,
92  const UT_Vector3 &,
93  float, float,
94  float *, UT_Vector3 *,
95  UT_Vector3 *, int,
96  float *, float *,
97  int) const override
98  { return 0; }
99  /// @}
100 
101 private:
102  static GA_PrimitiveDefinition *theDefinition;
103  friend class GU_PrimitiveFactory;
104 };
105 
106 #endif
107 
bool isDegenerate() const override
Definition: GEO_PrimNull.h:41
virtual void copyPrimitive(const GEO_Primitive *src)=0
virtual UT_Vector3D computeNormalD() const =0
GLboolean GLboolean g
Definition: glcorearb.h:1222
GLdouble s
Definition: glad.h:3009
virtual GA_DereferenceStatus dereferencePoint(GA_Offset point, bool dry_run=false)=0
Abstract base class for a range membership query object.
GA_PrimitiveFamilyMask
virtual UT_Vector3 computeNormal() const =0
Return a normal vector for the primitive.
#define GA_INVALID_OFFSET
Definition: GA_Types.h:687
int intersectRay(const UT_Vector3 &, const UT_Vector3 &, float, float, float *, UT_Vector3 *, UT_Vector3 *, int, float *, float *, int) const override
Definition: GEO_PrimNull.h:90
void normal(NormalCompD &) const override
Definition: GEO_PrimNull.h:89
GA_Size GA_Offset
Definition: GA_Types.h:646
GLintptr offset
Definition: glcorearb.h:665
GEO_Primitive * convert(GEO_ConvertParms &, GA_PointGroup *) override
Definition: GEO_PrimNull.h:82
virtual void countMemory(UT_MemoryCounter &counter) const
virtual const GA_PrimitiveJSON * getJSON() const =0
Provide a JSON interface to a primitive.
#define GEO_API
Definition: GEO_API.h:14
void normal(NormalComp &) const override
Definition: GEO_PrimNull.h:88
long long int64
Definition: SYS_Types.h:116
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_PrimNull.h:60
A handle to simplify manipulation of multiple attributes.
const GA_PrimitiveDefinition & getTypeDef() const override
Definition: GEO_PrimNull.h:76
GEO_PrimNull(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
Definition: GEO_PrimNull.h:35
int64 getMemoryUsage() const override
Report approximate memory usage.
Definition: GEO_PrimNull.h:65
virtual GA_DereferenceStatus dereferencePoints(const GA_RangeMemberQuery &pt_q, bool dry_run=false)=0
void reverse() override
Definition: GEO_PrimNull.h:43
virtual int detachPoints(GA_PointGroup &grp)=0
fpreal64 fpreal
Definition: SYS_Types.h:277
virtual bool getBBox(UT_BoundingBox *bbox) const =0
virtual bool evaluatePointRefMap(GA_Offset result_vtx, GA_AttributeRefMap &map, fpreal u, fpreal v=0, uint du=0, uint dv=0) const =0
Container class for all geometry.
Definition: GA_Detail.h:96
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition of a geometric primitive.
unsigned int uint
Definition: SYS_Types.h:45
GEO_Primitive * convertNew(GEO_ConvertParms &) override
Definition: GEO_PrimNull.h:85
~GEO_PrimNull() override
Definition: GEO_PrimNull.h:30