HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  virtual int getBBox(UT_BoundingBox *bbox) const;
46  virtual void addToBSphere(UT_BoundingSphere *bsphere) const;
47  virtual UT_Vector3 baryCenter() const;
48  virtual UT_Vector3 computeNormal() const;
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 
67  virtual bool evaluatePointRefMap(GA_Offset result_vtx,
68  GA_AttributeRefMap &hlist,
69  fpreal u, fpreal v, uint du, uint dv) const;
70  virtual int evaluatePointV4( UT_Vector4 &pos, float u, float v = 0,
71  unsigned du=0, unsigned dv=0) const
72  {
73  return GEO_Primitive::evaluatePointV4(pos, u, v,
74  du, dv);
75  }
76  virtual bool evaluateBaryCenterRefMap(GA_Offset result_vertex,
77  GA_AttributeRefMap &hlist) const;
78 
80 };
82 
83 #endif
84 
static GA_IntrinsicManager::Registrar registerIntrinsics(GA_PrimitiveDefinition &defn)
virtual UT_Vector3 baryCenter() const
virtual int evaluatePointV4(UT_Vector4 &pos, float u, float v=0, unsigned du=0, unsigned dv=0) const
#define SYS_DEPRECATED_PUSH_DISABLE()
const GLdouble * v
Definition: glcorearb.h:836
#define SYS_DEPRECATED_POP_DISABLE()
3D Vector class.
exint GA_Size
Defines the bit width for index and offset types in GA.
Definition: GA_Types.h:211
GA_PrimitiveFamilyMask
virtual UT_Vector3 computeNormal() const =0
Return a normal vector for the primitive.
#define GA_INVALID_OFFSET
Definition: GA_Types.h:654
GA_Size GA_Offset
Definition: GA_Types.h:617
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLintptr offset
Definition: glcorearb.h:664
#define GEO_API
Definition: GEO_API.h:10
A handle to simplify manipulation of multiple attributes.
virtual int getBBox(UT_BoundingBox *bbox) const =0
void addPointRefToGroup(GA_PointGroup &grp) const
GLboolean * data
Definition: glcorearb.h:130
unsigned int uint
Definition: SYS_Types.h:39
virtual bool evaluateBaryCenterRefMap(GA_Offset result_vtx, GA_AttributeRefMap &map) const
virtual bool vertexApply(bool(*apply)(GA_Offset vtx, void *), void *data=0) const
double fpreal
Definition: SYS_Types.h:269
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:96
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)
virtual int evaluatePointV4(UT_Vector4 &pos, float u, float v=0, unsigned du=0, unsigned dv=0) const
static GA_PrimitiveFamilyMask buildFamilyMask()