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  int getBBox(UT_BoundingBox *bbox) const override;
43  void reverse() override {}
44  UT_Vector3 computeNormal() const override;
45  void copyPrimitive(const GEO_Primitive *s) override;
46  int detachPoints(GA_PointGroup &g) override;
47  GA_DereferenceStatus dereferencePoint(GA_Offset, bool) override;
48  GA_DereferenceStatus dereferencePoints(
49  const GA_RangeMemberQuery &, bool) override;
50  const GA_PrimitiveJSON *getJSON() const override;
52  GA_Offset,
54  fpreal, fpreal, uint, uint) const override;
55  /// @}
56 
57  /// @{
58  /// Special for factory primitives
60  { return GA_FAMILY_NONE; }
61  /// @}
62 
63  /// Report approximate memory usage.
64  int64 getMemoryUsage() const override
65  { return sizeof(*this); }
66 
67  /// Count memory usage using a UT_MemoryCounter in order to count
68  /// shared memory correctly.
69  /// NOTE: This should always include sizeof(*this).
70  void countMemory(
71  UT_MemoryCounter &counter) const override;
72 
73  /// @{
74  /// Minimal interface required by GU
75  const GA_PrimitiveDefinition &getTypeDef() const override
76  {
77  UT_ASSERT(theDefinition);
78  return *theDefinition;
79  }
80 
82  GA_PointGroup *) override
83  { return NULL; }
85  { return NULL; }
86 
87  void normal(NormalComp &) const override {}
89  const UT_Vector3 &,
90  const UT_Vector3 &,
91  float, float,
92  float *, UT_Vector3 *,
93  UT_Vector3 *, int,
94  float *, float *,
95  int) const override
96  { return 0; }
97  /// @}
98 
99 private:
100  static GA_PrimitiveDefinition *theDefinition;
101  friend class GU_PrimitiveFactory;
102 };
103 
104 #endif
105 
GLdouble s
Definition: glew.h:1390
bool isDegenerate() const override
Definition: GEO_PrimNull.h:41
virtual void copyPrimitive(const GEO_Primitive *src)=0
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:676
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:88
GA_Size GA_Offset
Definition: GA_Types.h:639
GEO_Primitive * convert(GEO_ConvertParms &, GA_PointGroup *) override
Definition: GEO_PrimNull.h:81
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:87
long long int64
Definition: SYS_Types.h:116
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_PrimNull.h:59
A handle to simplify manipulation of multiple attributes.
const GA_PrimitiveDefinition & getTypeDef() const override
Definition: GEO_PrimNull.h:75
virtual int getBBox(UT_BoundingBox *bbox) const =0
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:64
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
GLuint counter
Definition: glew.h:2740
fpreal64 fpreal
Definition: SYS_Types.h:277
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:95
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
Definition of a geometric primitive.
unsigned int uint
Definition: SYS_Types.h:45
GEO_Primitive * convertNew(GEO_ConvertParms &) override
Definition: GEO_PrimNull.h:84
~GEO_PrimNull() override
Definition: GEO_PrimNull.h:30
GLboolean GLboolean g
Definition: glew.h:9477
GLintptr offset
Definition: glew.h:1682