当前位置:   article > 正文

1111_acdb3dpolyline :: appendvertex

acdb3dpolyline :: appendvertex

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;
}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/114347
推荐阅读
相关标签
  

闽ICP备14008679号