#ifdef TIMING_BUILDBLOCK
#define TIMING_DEF \
UT_StopWatch timer; \
timer.start();
#define TIMING_LOG(msg) \
printf(msg ": %f milliseconds\n", 1000*timer.stop()); \
fflush(stdout); \
timer.start();
#else
#define TIMING_DEF
#define TIMING_LOG(msg)
#endif
using namespace HDK_Sample;
#define PT_PER_TET 4
{
}
GEO_PrimTetra::~GEO_PrimTetra()
{
}
void
{
}
bool
unsigned dv) const
{
if (du==0 && dv==0)
{
}
else
{
}
return true;
}
void
{
}
{
}
{
}
{
float signedvol = -(v3-
v0).
dot(
cross(v1-v0, v2-v0));
signedvol /= 6;
return signedvol;
}
{
area = area / 2;
}
{
}
int
{
count++;
if (count == 0)
return 0;
if (count == PT_PER_TET)
return -2;
return -1;
}
{
{
{
}
}
}
{
int count = 0;
{
{
count++;
}
}
if (count == PT_PER_TET)
if (count == 0)
}
namespace HDK_Sample {
using namespace UT::Literal;
{
public:
{
}
enum
{
geo_TBJ_VERTEX,
geo_TBJ_ENTRIES
};
int getEntries() const override { return geo_TBJ_ENTRIES; }
{
switch (i)
{
case geo_TBJ_VERTEX: return theKWVertex;
case geo_TBJ_ENTRIES: break;
}
}
{
switch (i)
{
case geo_TBJ_VERTEX:
return tet(pr)->saveVertexArray(w, map);
case geo_TBJ_ENTRIES:
break;
}
return false;
}
{
switch (i)
{
case geo_TBJ_VERTEX:
return false;
case geo_TBJ_ENTRIES:
break;
}
return false;
}
{
switch (i)
{
case geo_TBJ_VERTEX:
return tet(pr)->loadVertexArray(p, map);
case geo_TBJ_ENTRIES:
break;
}
return false;
}
{
switch (i)
{
case geo_TBJ_VERTEX:
return false;
case geo_TBJ_ENTRIES:
break;
}
return false;
}
{
switch (i)
{
case geo_TBJ_VERTEX:
return false;
case geo_TBJ_ENTRIES:
break;
}
return false;
}
private:
};
}
tetrahedronJSON()
{
if (!theJSON)
return theJSON;
}
{
return tetrahedronJSON();
}
bool
{
}
bool
{
{
for (int i = 0; i < nvertex; i++)
{
if (vtxoffs[i] >= 0)
vtxoffs[i] +=
GA_Size(startvtxoff);
}
}
if (nvertex < PT_PER_TET)
return false;
return true;
}
bool
{
return true;
}
{
return sum;
}
bool
{
{
{
return true;
}
}
return false;
}
void
{
if (psrc == this)
return;
}
{
if (!clone)
return nullptr;
return clone;
}
void
{
}
{
if (vtx_to_prim)
{
vtx_to_prim->
setLink(vtxoff+i, primoff);
}
if (appendPoints)
{
{
}
}
return tet;
}
namespace {
class geo_SetTopoPrimsParallel
{
public:
geo_SetTopoPrimsParallel(
: myTopology(topology)
, myStartPrim(startprim)
, myStartVtx(startvtx)
{}
{
{
GA_Size relativestart = start - myStartVtx;
GA_Size relativeend = end - myStartVtx;
if (vert != 0)
{
myTopology->setLink(start++, tet);
++tet;
}
for (; tet != endtet; ++tet)
{
myTopology->setLink(start++, tet);
}
if (start < end)
{
while (start < end)
myTopology->setLink(start++, tet);
}
}
}
private:
};
}
const int *tetpointnumbers)
{
if (ntets == 0)
const GA_Offset endvtx = startvtx + nvertices;
if (vertexToPoint)
{
geo_SetTopoMappedParallel<int>(vertexToPoint, startpt, startvtx, tetpointnumbers));
}
if (vertexToPrim)
{
geo_SetTopoPrimsParallel(vertexToPrim, startprim, startvtx));
}
geo_SetVertexListsParallel(detail, startprim, startvtx));
if (pointToVertex && vertexToNext && vertexToPrev)
{
UTparallelSort(map.array(), map.array() + nvertices, geo_VerticesByPointCompare<int,true>(tetpointnumbers));
geo_NextPrevParallel<int>(map.getArray(), map.size(), tetpointnumbers, nextvtxarray.getArray(), prevvtxarray.getArray(), startvtx, startpt, pointToVertex, vertexToPrev, lock));
geo_Pt2VtxTopoParallel<int>(pointToVertex, map.getArray(), map.size(), tetpointnumbers, startvtx, startpt));
map.setCapacity(0);
geo_LinkToposParallel<int>(vertexToNext, vertexToPrev, nextvtxarray.getArray(), prevvtxarray.getArray(), startvtx));
}
return startprim;
}
static void
geoNewPrimTetraBlock(
bool allowed_to_parallelize)
{
if (allowed_to_parallelize && nprimitives >= 4*
GA_PAGE_SIZE)
{
for ( ; primoff != endprimoff; ++primoff, ++pprims)
});
}
else
{
GA_Offset endprimoff(start_offset + nprimitives);
for (
GA_Offset primoff(start_offset); primoff != endprimoff; ++primoff, ++new_prims)
}
}
void
{
if (theDefinition)
return;
return;
"HDK_Tetrahedron",
geoNewPrimTetraBlock,
"hdk_tetrahedron");
#ifndef TETRA_GR_PRIMITIVE
#else
const int hook_priority = 0;
hook_priority,
#endif
}
{
return mem;
}
void
{
}
{
return poly;
}
{
{
geo_buildPoly(this, gdp, 0, 1, 2, parms);
geo_buildPoly(this, gdp, 1, 3, 2, parms);
geo_buildPoly(this, gdp, 1, 0, 3, parms);
prim = geo_buildPoly(this, gdp, 0, 2, 3, parms);
}
return prim;
}
{
if (prim)
{
}
return prim;
}
void
{
}
void
{
}
int
int, float *, float *, int) const
{
if (result)
{
if (distance) *distance =
dist;
if (pos) *pos = org + dist * dir;
}
}
extern "C" {
void
{
}
}
enum
{
};
namespace
{
{
}
static const char *
{
return "My Name";
}
};
intrinsicAddress)
intrinsicAuthor)