|
Acad::ErrorStatus GetRegion(AcDbRegion* pRegion, AcGePoint3dArray& ptArray)
{
if (pRegion == NULL)
return Acad::eNullObjectPointer;
//构造brep
AcBrBrep brep;
AcBr::ErrorStatus es = brep.set(*pRegion);
//构造brepface迭代器
AcBrBrepFaceTraverser traverser;
es = traverser.setBrep(brep);
for (; !traverser.done(); traverser.next())
{
//获取当前face
AcBrFace face;
es = traverser.getFace(face);
//faceloop迭代器
AcBrFaceLoopTraverser faceTraverser;
es = faceTraverser.setFace(face);
for (; !faceTraverser.done(); faceTraverser.next())
{
//loopedge
AcBrLoopEdgeTraverser edgeTraverser;
es = edgeTraverser.setLoop(faceTraverser);
for (; !edgeTraverser.done(); edgeTraverser.next())
{
//edge
AcBrEdge edge;
es = edgeTraverser.getEdge(edge);
AcBrVertex start;
es = edge.getVertex1(start);
AcGePoint3d pt;
start.getPoint(pt);
ptArray.append(pt);
AcGeCurve3d* pCurve = NULL;
es = edge.getCurve(pCurve);
AcDbCurve* dbCurve = NULL;
//acdbAssignGelibCurveToAcDbCurve(*pCurve, dbCurve);
Acad::ErrorStatus aes = AcDbCurve::createFromAcGeCurve(*pCurve, dbCurve);
delete pCurve;
if (dbCurve != NULL)
{
}
}
}
}
return Acad::eOk;
} |
|