HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_VolumeElement Class Reference

#include <GEO_VolumeElement.h>

Public Member Functions

SYS_FORCE_INLINE GEO_VolumeElement ()
 
SYS_FORCE_INLINE GEO_VolumeElement (const GA_Detail *gdp, GA_Offset offset=GA_INVALID_OFFSET)
 
bool isValid () const
 
void bind (const GA_Detail *gdp, GA_Offset offset)
 
void setOffset (GA_Offset offset)
 Update the element to point to another primitive in same detail. More...
 
const GA_Detaildetail () const
 
GA_Offset getMapOffset () const
 
GA_PrimitiveTypeId typeId () const
 
GA_Size getVertexCount () const
 
GA_OffsetListRef getVertexList () const
 
GA_Offset getVertexOffset (GA_Size index) const
 
GA_Offset getPointOffset (GA_Size index) const
 
GA_Size getFaceCount () const
 
int getFaceIndices (GA_Size faceno, UT_Array< int > &vtxlist) const
 
int getFaceIndexCount (GA_Size faceno) const
 
GA_Offset findSharedFace (GA_Size faceno) const
 
GA_Size getEdgeCount () const
 
void getEdgeIndices (GA_Size edgeno, int &e0, int &e1) const
 
void computeInteriorPointWeights (UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w)
 

Static Public Member Functions

template<typename OP >
static void dispatch (GA_PrimitiveTypeId type, const GA_Detail *gdp, GA_Offset offset, OP op)
 
template<typename OP >
static void dispatch (const GA_Detail *gdp, GA_Offset offset, OP op)
 
template<typename OP >
static void dispatch (GA_PrimitiveTypeId type, const GA_Primitive *baseprim, OP op)
 
static GA_Size getVertexCount (GA_PrimitiveTypeId type, const GA_Detail *gdp, GA_Offset offset)
 
static GA_OffsetListRef getVertexList (const GA_Detail *gdp, GA_Offset offset)
 Return shallow copy of the vertex list. More...
 
static GA_Offset getVertexOffset (const GA_Detail *gdp, GA_Offset offset, GA_Size index)
 Return the vertex offset from a given vertex index. More...
 
static GA_Offset getPointOffset (const GA_Detail *gdp, GA_Offset offset, GA_Size index)
 Return the point offset from a given vertex index. More...
 
static GA_Size getFaceCount (GA_PrimitiveTypeId type, const GA_Detail *d, GA_Offset offset)
 The number of faces that make up this volume. More...
 
static int getFaceIndices (GA_PrimitiveTypeId type, const GA_Detail *gdp, GA_Offset offset, GA_Size faceno, UT_Array< int > &vtxlist)
 Returns the indices to the vertices, not the vertex offsets! More...
 
static int getFaceIndexCount (GA_PrimitiveTypeId type, const GA_Detail *gdp, GA_Offset offset, GA_Size faceno)
 Returns the number of indices in specified face. More...
 
static GA_Offset findSharedFace (GA_PrimitiveTypeId type, const GA_Detail *gdp, GA_Offset offset, GA_Size faceno)
 
static GA_Size getEdgeCount (GA_PrimitiveTypeId type, const GA_Detail *gdp, GA_Offset offset)
 The number of edges in this volume. More...
 
static void getEdgeIndices (GA_PrimitiveTypeId type, const GA_Detail *gdp, GA_Offset offset, GA_Size edgeno, int &e0, int &e1)
 
static void computeInteriorPointWeights (GA_PrimitiveTypeId type, const GA_Detail *gdp, GA_Offset offset, UT_Array< GA_Offset > &vtxlist, UT_Array< float > &weightlist, fpreal u, fpreal v, fpreal w)
 Evaluate the interior point weights. More...
 

Protected Attributes

const GA_DetailmyDetail
 
GA_Offset myOffset
 
GA_PrimitiveTypeId myType
 

Detailed Description

Definition at line 37 of file GEO_VolumeElement.h.

Constructor & Destructor Documentation

SYS_FORCE_INLINE GEO_VolumeElement::GEO_VolumeElement ( )
inline

Definition at line 41 of file GEO_VolumeElement.h.

SYS_FORCE_INLINE GEO_VolumeElement::GEO_VolumeElement ( const GA_Detail gdp,
GA_Offset  offset = GA_INVALID_OFFSET 
)
inline

Definition at line 49 of file GEO_VolumeElement.h.

Member Function Documentation

void GEO_VolumeElement::bind ( const GA_Detail gdp,
GA_Offset  offset 
)
inline

Definition at line 142 of file GEO_VolumeElement.h.

static void GEO_VolumeElement::computeInteriorPointWeights ( GA_PrimitiveTypeId  type,
const GA_Detail gdp,
GA_Offset  offset,
UT_Array< GA_Offset > &  vtxlist,
UT_Array< float > &  weightlist,
fpreal  u,
fpreal  v,
fpreal  w 
)
inlinestatic

Evaluate the interior point weights.

Definition at line 227 of file GEO_VolumeElement.h.

void GEO_VolumeElement::computeInteriorPointWeights ( UT_Array< GA_Offset > &  vtxlist,
UT_Array< float > &  weightlist,
fpreal  u,
fpreal  v,
fpreal  w 
)
inline

Definition at line 229 of file GEO_VolumeElement.h.

const GA_Detail* GEO_VolumeElement::detail ( ) const
inline

Definition at line 164 of file GEO_VolumeElement.h.

template<typename OP >
static void GEO_VolumeElement::dispatch ( GA_PrimitiveTypeId  type,
const GA_Detail gdp,
GA_Offset  offset,
OP  op 
)
inlinestatic

This lets you create a stack-version of the primitive so you can duck-type directly to GEO_PrimTetrahedron, GEO_PrimHexahedron, etc. Usage: GEO_VolumeElement::dispatch(type, gdp, primoff, [&](auto &prim) { prim.normal(comp); }); will be the equivalent of creating a stack GEO_PrimTetrahedon(gdp, primoff) and calling normal on it.

To retreive the actual type you can use decltype

GEO_VolumeElement::dispatch(type, gdp, primoff, [&](auto &prim) { using PrimT = SYS_RemoveCVRef_t<decltype(prim)>; typename PrimT::Face face(prim, i); });

Definition at line 74 of file GEO_VolumeElement.h.

template<typename OP >
static void GEO_VolumeElement::dispatch ( const GA_Detail gdp,
GA_Offset  offset,
OP  op 
)
inlinestatic

Definition at line 101 of file GEO_VolumeElement.h.

template<typename OP >
static void GEO_VolumeElement::dispatch ( GA_PrimitiveTypeId  type,
const GA_Primitive baseprim,
OP  op 
)
inlinestatic

Definition at line 109 of file GEO_VolumeElement.h.

static GA_Offset GEO_VolumeElement::findSharedFace ( GA_PrimitiveTypeId  type,
const GA_Detail gdp,
GA_Offset  offset,
GA_Size  faceno 
)
static
GA_Offset GEO_VolumeElement::findSharedFace ( GA_Size  faceno) const
inline

Definition at line 210 of file GEO_VolumeElement.h.

static GA_Size GEO_VolumeElement::getEdgeCount ( GA_PrimitiveTypeId  type,
const GA_Detail gdp,
GA_Offset  offset 
)
inlinestatic

The number of edges in this volume.

Definition at line 214 of file GEO_VolumeElement.h.

GA_Size GEO_VolumeElement::getEdgeCount ( ) const
inline

Definition at line 216 of file GEO_VolumeElement.h.

static void GEO_VolumeElement::getEdgeIndices ( GA_PrimitiveTypeId  type,
const GA_Detail gdp,
GA_Offset  offset,
GA_Size  edgeno,
int e0,
int e1 
)
inlinestatic

Returns the indices of the edge. Note each edge shows up once and due to the nature of volumes, is undirected.

Definition at line 221 of file GEO_VolumeElement.h.

void GEO_VolumeElement::getEdgeIndices ( GA_Size  edgeno,
int e0,
int e1 
) const
inline

Definition at line 223 of file GEO_VolumeElement.h.

static GA_Size GEO_VolumeElement::getFaceCount ( GA_PrimitiveTypeId  type,
const GA_Detail d,
GA_Offset  offset 
)
inlinestatic

The number of faces that make up this volume.

Definition at line 192 of file GEO_VolumeElement.h.

GA_Size GEO_VolumeElement::getFaceCount ( ) const
inline

Definition at line 194 of file GEO_VolumeElement.h.

static int GEO_VolumeElement::getFaceIndexCount ( GA_PrimitiveTypeId  type,
const GA_Detail gdp,
GA_Offset  offset,
GA_Size  faceno 
)
inlinestatic

Returns the number of indices in specified face.

Definition at line 204 of file GEO_VolumeElement.h.

int GEO_VolumeElement::getFaceIndexCount ( GA_Size  faceno) const
inline

Definition at line 206 of file GEO_VolumeElement.h.

static int GEO_VolumeElement::getFaceIndices ( GA_PrimitiveTypeId  type,
const GA_Detail gdp,
GA_Offset  offset,
GA_Size  faceno,
UT_Array< int > &  vtxlist 
)
inlinestatic

Returns the indices to the vertices, not the vertex offsets!

Definition at line 198 of file GEO_VolumeElement.h.

int GEO_VolumeElement::getFaceIndices ( GA_Size  faceno,
UT_Array< int > &  vtxlist 
) const
inline

Definition at line 200 of file GEO_VolumeElement.h.

GA_Offset GEO_VolumeElement::getMapOffset ( ) const
inline

Definition at line 165 of file GEO_VolumeElement.h.

static GA_Offset GEO_VolumeElement::getPointOffset ( const GA_Detail gdp,
GA_Offset  offset,
GA_Size  index 
)
inlinestatic

Return the point offset from a given vertex index.

Definition at line 186 of file GEO_VolumeElement.h.

GA_Offset GEO_VolumeElement::getPointOffset ( GA_Size  index) const
inline

Definition at line 188 of file GEO_VolumeElement.h.

static GA_Size GEO_VolumeElement::getVertexCount ( GA_PrimitiveTypeId  type,
const GA_Detail gdp,
GA_Offset  offset 
)
inlinestatic

Definition at line 168 of file GEO_VolumeElement.h.

GA_Size GEO_VolumeElement::getVertexCount ( ) const
inline

Definition at line 170 of file GEO_VolumeElement.h.

static GA_OffsetListRef GEO_VolumeElement::getVertexList ( const GA_Detail gdp,
GA_Offset  offset 
)
inlinestatic

Return shallow copy of the vertex list.

Definition at line 174 of file GEO_VolumeElement.h.

GA_OffsetListRef GEO_VolumeElement::getVertexList ( ) const
inline

Definition at line 176 of file GEO_VolumeElement.h.

static GA_Offset GEO_VolumeElement::getVertexOffset ( const GA_Detail gdp,
GA_Offset  offset,
GA_Size  index 
)
inlinestatic

Return the vertex offset from a given vertex index.

Definition at line 180 of file GEO_VolumeElement.h.

GA_Offset GEO_VolumeElement::getVertexOffset ( GA_Size  index) const
inline

Definition at line 182 of file GEO_VolumeElement.h.

bool GEO_VolumeElement::isValid ( ) const
inline

Definition at line 134 of file GEO_VolumeElement.h.

void GEO_VolumeElement::setOffset ( GA_Offset  offset)
inline

Update the element to point to another primitive in same detail.

Definition at line 154 of file GEO_VolumeElement.h.

GA_PrimitiveTypeId GEO_VolumeElement::typeId ( ) const
inline

Definition at line 166 of file GEO_VolumeElement.h.

Member Data Documentation

const GA_Detail* GEO_VolumeElement::myDetail
protected

Definition at line 233 of file GEO_VolumeElement.h.

GA_Offset GEO_VolumeElement::myOffset
protected

Definition at line 234 of file GEO_VolumeElement.h.

GA_PrimitiveTypeId GEO_VolumeElement::myType
protected

Definition at line 235 of file GEO_VolumeElement.h.


The documentation for this class was generated from the following file: