赞
踩
Acad::ErrorStatus
rx_scanPline(AcDb2dPolyline* pline,
AcGePoint3dArray& points,
AcGeDoubleArray& bulges)
{
Acad::ErrorStatus es = Acad::eOk;
AcDb2dVertex* vert = NULL;
AcDbObjectId vId;
AcDbObjectIterator *vIter;
vIter = pline->vertexIterator();
for (; !vIter->done(); vIter->step()) {
vId = vIter->objectId();
AOK(pline->openVertex(vert, vId, AcDb::kForRead));
points.append(vert->position());
bulges.append(vert->bulge());
}
delete vIter;
return es;
}
Acad::ErrorStatus
rx_scanPline(AcDb3dPolyline* pline, AcGePoint3dArray& points)
{
Acad::ErrorStatus es = Acad::eOk;
AcDb3dPolylineVertex* vert = NULL;
AcDbObjectId vId;
AcDbObjectIterator *vIter;
vIter = pline->vertexIterator();
for (; !vIter->done(); vIter->step()) {
vId = vIter->objectId();
AOK(pline->openVertex(vert, vId, AcDb::kForRead));
points.append(vert->position());
}
delete vIter;
return es;
}
double
aint(double x)
{
long l;
// Note that this routine cannot handle the full floating point
// number range. This function should be in the machine-dependent
// floating point library!
l = long(x);
if ((int) (-0.5) != 0 && l < 0)
l++;
x = l;
return x;
}
// Range reduce angle to 0 <= angle < 2 * PI 确定角度范围
double
rx_fixangle(double angle)
{
return angle - (2 * 3.14159265358979323846) * aint((angle / (2 * 3.14159265358979323846)) -
(angle < 0.0));
}
void
rx_fixindex(int& index, int maxIndex)
{
if (index > maxIndex)
index -= maxIndex;
if (index < 0)
index += maxIndex;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。