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  virtual ~GEO_PrimNull() {}
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  virtual bool isDegenerate() const { return true; }
42  virtual int getBBox(UT_BoundingBox *bbox) const;
43  virtual void reverse() {}
44  virtual UT_Vector3 computeNormal() const;
45  virtual void copyPrimitive(const GEO_Primitive *s);
46  virtual int detachPoints(GA_PointGroup &g);
47  virtual GA_DereferenceStatus dereferencePoint(GA_Offset, bool);
48  virtual GA_DereferenceStatus dereferencePoints(
49  const GA_RangeMemberQuery &, bool);
50  virtual const GA_PrimitiveJSON *getJSON() const;
51  virtual bool evaluatePointRefMap(GA_Offset,
53  fpreal, fpreal, uint, uint) const;
54  /// @}
55 
56  /// @{
57  /// Special for factory primitives
59  { return GA_FAMILY_NONE; }
60  /// @}
61 
62  /// Report approximate memory usage.
63  virtual int64 getMemoryUsage() const
64  {
65  return sizeof(*this);
66  }
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  virtual void countMemory(UT_MemoryCounter &counter) const;
72 
73  /// @{
74  /// Minimal interface required by GU
75  virtual const GA_PrimitiveDefinition &getTypeDef() const
76  {
77  UT_ASSERT(theDefinition);
78  return *theDefinition;
79  }
80 
82  { return NULL; }
84  { return NULL; }
85  virtual void normal(NormalComp &) const {}
86  virtual int intersectRay(const UT_Vector3 &,
87  const UT_Vector3 &,
88  float, float,
89  float *, UT_Vector3 *,
90  UT_Vector3 *, int,
91  float *, float *,
92  int) const
93  { return 0; }
94  /// @}
95 
96 private:
97  static GA_PrimitiveDefinition *theDefinition;
98  friend class GU_PrimitiveFactory;
99 };
100 
101 #endif
102 
GLdouble s
Definition: glew.h:1390
virtual const GA_PrimitiveDefinition & getTypeDef() const
Definition: GEO_PrimNull.h:75
virtual void copyPrimitive(const GEO_Primitive *src)=0
virtual void normal(NormalComp &) const
Definition: GEO_PrimNull.h:85
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:674
GA_Size GA_Offset
Definition: GA_Types.h:637
virtual GEO_Primitive * convert(GEO_ConvertParms &, GA_PointGroup *)
Definition: GEO_PrimNull.h:81
long long int64
Definition: SYS_Types.h:111
virtual bool isDegenerate() const
Definition: GEO_PrimNull.h:41
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
virtual int64 getMemoryUsage() const
Report approximate memory usage.
Definition: GEO_PrimNull.h:63
static GA_PrimitiveFamilyMask buildFamilyMask()
Definition: GEO_PrimNull.h:58
A handle to simplify manipulation of multiple attributes.
virtual int getBBox(UT_BoundingBox *bbox) const =0
GEO_PrimNull(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
Definition: GEO_PrimNull.h:35
virtual ~GEO_PrimNull()
Definition: GEO_PrimNull.h:30
virtual GA_DereferenceStatus dereferencePoints(const GA_RangeMemberQuery &pt_q, bool dry_run=false)=0
unsigned int uint
Definition: SYS_Types.h:44
double fpreal
Definition: SYS_Types.h:276
virtual int detachPoints(GA_PointGroup &grp)=0
GLuint counter
Definition: glew.h:2740
virtual int intersectRay(const UT_Vector3 &, const UT_Vector3 &, float, float, float *, UT_Vector3 *, UT_Vector3 *, int, float *, float *, int) const
Definition: GEO_PrimNull.h:86
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.
virtual void reverse()
Definition: GEO_PrimNull.h:43
GLboolean GLboolean g
Definition: glew.h:9477
GLintptr offset
Definition: glew.h:1682
virtual GEO_Primitive * convertNew(GEO_ConvertParms &)
Definition: GEO_PrimNull.h:83