|
HRESULT hr = S_OK;
CComPtr <IBody2> pBody;
CComPtr <IEnumFaces2> pEnumFaces;
CComPtr <IFace2> pFace;
long nFetchedBodies = -1;
long nFetchedFaces = -1;
long nNumTessTriang = -1;
float* pTessTriang = NULL;
long i = 0;
bool bResult = false;
hr = pEnumBody->Reset();
hr = pEnumBody->Next(1, &pBody, &nFetchedBodies);
while (nFetchedBodies > 0)
{
hr = pBody->EnumFaces(&pEnumFaces);
// _ASSERT(pEnumFaces);
// set colour to blue
AutoColor Color(0, 0, 128);
// set line width to 1 pixel
AutoLineWidth LineWidth(1.0);
// get the first face
hr = pEnumFaces->Reset();
hr = pEnumFaces->Next(1, &pFace, &nFetchedFaces);
while (nFetchedFaces > 0)
{
// get display tessellation for this face
hr = pFace->GetTessTriangleCount(&nNumTessTriang);
_ASSERT(nNumTessTriang > 0);
pTessTriang = new float[9 * sizeof(float) * nNumTessTriang];
_ASSERT(pTessTriang);
ZeroMemory(pTessTriang, 9 * sizeof(float) * nNumTessTriang);
hr = pFace->IGetTessTriangles(VARIANT_TRUE, pTessTriang); |
|