HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_VolumeElement.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_VolumeElement.h (GEO Library, C++)
7  *
8  * COMMENTS: This is the base class for all volume element types.
9  */
10 
11 #pragma once
12 
13 #ifndef __GEO_VolumeElement__
14 #define __GEO_VolumeElement__
15 
16 #include "GEO_API.h"
17 #include "GEO_Primitive.h"
18 #include <GA/GA_Defines.h>
19 #include <SYS/SYS_Inline.h>
20 #include <UT/UT_Array.h>
21 
22 class GA_Detail;
23 
25 {
26 public:
29  : GEO_Primitive(d, offset)
30  {}
31 
32  /// The number of faces that make up this volume
33  virtual GA_Size getFaceCount() const = 0;
34  /// Returns the indices to the vertices, not the vertex offsets!
35  virtual int getFaceIndices(GA_Size faceno, UT_IntArray &vtxlist) const = 0;
36 
37  virtual GA_Offset findSharedFace(GA_Size faceno) const = 0;
38 
39  /// The number of edges in this volume.
40  virtual GA_Size getEdgeCount() const = 0;
41  /// Returns the indices of the edge. Note each edge shows up once
42  /// and due to the nature of volumes, is undirected.
43  virtual void getEdgeIndices(GA_Size edgeno, int &e0, int &e1) const = 0;
44 
45  int getBBox(UT_BoundingBox *bbox) const override;
46  void addToBSphere(UT_BoundingSphere *bsphere) const override;
47  UT_Vector3 baryCenter() const override;
48  UT_Vector3 computeNormal() const override;
49 
50 #if !GA_PRIMITIVE_VERTEXLIST
51  virtual void addPointRefToGroup(GA_PointGroup &grp) const;
52 
53  virtual bool vertexApply(bool (*apply)(GA_Offset vtx, void *),
54  void *data = 0) const;
55 #endif
56 
57 protected:
59  { return GA_FAMILY_VOLUMEELEMENT; }
60 
61  /// All subclasses should call this method to register the intrinsics.
62  /// @see GA_IntrinsicManager
65  { return GEO_Primitive::registerIntrinsics(defn); }
66 
68  GA_Offset result_vtx,
69  GA_AttributeRefMap &hlist,
70  fpreal u, fpreal v,
71  uint du, uint dv) const override;
73  UT_Vector4 &pos,
74  float u, float v = 0,
75  unsigned du=0, unsigned dv=0) const override
76  {
77  return GEO_Primitive::evaluatePointV4(pos, u, v,
78  du, dv);
79  }
81  GA_Offset result_vertex,
82  GA_AttributeRefMap &hlist) const override;
83 
85 };
87 
88 #endif
89 
static GA_IntrinsicManager::Registrar registerIntrinsics(GA_PrimitiveDefinition &defn)
virtual UT_Vector3 baryCenter() const
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
const GLdouble * v
Definition: glew.h:1391
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:233
GA_PrimitiveFamilyMask
virtual UT_Vector3 computeNormal() const =0
Return a normal vector for the primitive.
#define GA_INVALID_OFFSET
Definition: GA_Types.h:676
GA_Size GA_Offset
Definition: GA_Types.h:639
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
#define GEO_API
Definition: GEO_API.h:14
A handle to simplify manipulation of multiple attributes.
virtual int getBBox(UT_BoundingBox *bbox) const =0
void addPointRefToGroup(GA_PointGroup &grp) const
virtual bool evaluateBaryCenterRefMap(GA_Offset result_vtx, GA_AttributeRefMap &map) const
virtual bool vertexApply(bool(*apply)(GA_Offset vtx, void *), void *data=0) const
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
virtual void addToBSphere(UT_BoundingSphere *bsphere) const
Container class for all geometry.
Definition: GA_Detail.h:95
int evaluatePointV4(UT_Vector4 &pos, float u, float v=0, unsigned du=0, unsigned dv=0) const override
Definition of a geometric primitive.
SYS_FORCE_INLINE GEO_VolumeElement(GA_Detail *d, GA_Offset offset=GA_INVALID_OFFSET)
static GA_IntrinsicManager::Registrar registerIntrinsics(GA_PrimitiveDefinition &defn)
unsigned int uint
Definition: SYS_Types.h:45
virtual int evaluatePointV4(UT_Vector4 &pos, float u, float v=0, unsigned du=0, unsigned dv=0) const
static GA_PrimitiveFamilyMask buildFamilyMask()
GLintptr offset
Definition: glew.h:1682