HRESULT WSHSampleUtil::GetMathPointListFromBody( const CATBody_var& ispIntersectBody, CATLISTV(CATMathPoint) &oLISTMathPoint )
{
HRESULT rc = S_OK;
do {
if ( !ispIntersectBody ) {
rc = E_FAIL;
break;
}
CATLISTP(CATCell) LISTCell;
ispIntersectBody->GetAllCells( LISTCell, 0 );
for( int index = 1; index <= LISTCell.Size(); index++ ){
CATCell *pPointCell = LISTCell[index];
if(!pPointCell){
continue;
}
CATCell_var spPointCell = pPointCell;
if(!spPointCell){
continue;
};
CATVertex_var spVertex = spPointCell;
if( !spVertex ){
continue;
}
CATPoint *pPoint = spVertex->GetPoint();
if(!pPoint){
continue;
}
double pointX = 0.0;
double pointY = 0.0;
double pointZ = 0.0;
pPoint->GetCoord(pointX, pointY, pointZ);
CATMathPoint mathPoint( pointX, pointY, pointZ );
oLISTMathPoint.Append(mathPoint);
}
} while ( FALSE );
return rc;
} |