本文整理汇总了C++中DL_Dxf::writeCircle方法的典型用法代码示例。如果您正苦于以下问题:C++ DL_Dxf::writeCircle方法的具体用法?C++ DL_Dxf::writeCircle怎么用?C++ DL_Dxf::writeCircle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DL_Dxf
的用法示例。
在下文中一共展示了DL_Dxf::writeCircle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveHorizontalProfiles
//.........这里部分代码省略.........
{
//we deduce the right radius by linear interpolation
currentRadius = A->x + alpha * (B->x - A->x);
found = true;
break;
}
}
if (!found)
{
assert(false); //we have computed yMin and yMax so that 'height' is totally included inside the profile's boundaries...
continue;
}
}
const QString& currentLayer = profileNames[heightStep];
const DL_Attributes DefaultMaterial(currentLayer.toStdString(), DL_Codes::bylayer, -1, "BYLAYER");
const DL_Attributes GrayMaterial(currentLayer.toStdString(), DL_Codes::l_gray, -1, "");
//write layer title
if (params.profileTitles.size() == 1)
{
QString title = QString(params.profileTitles[0]).arg(height,0,'f',params.precision);
CCVector3d Ptop(xc, y0 + 2.0 * maxRadius * scale + c_profileMargin_mm / 2.0, 0.0);
dxf.writeText( *dw,
DL_TextData(Ptop.x,Ptop.y,Ptop.z,Ptop.x,Ptop.y,Ptop.z,c_textHeight_mm,1.0,0,1,0,title.toStdString(),"STANDARD",0.0),
GrayMaterial);
}
//write theoretical profile (polyline = circle)
{
dxf.writeCircle(*dw,
DL_CircleData(xc, yc, 0.0, currentRadius*scale),
DL_Attributes(currentLayer.toStdString(), DL_Codes::red, -1, "BYLAYER"));
}
assert(polySteps.size() == map->xSteps);
{
const DistanceMapGenerationTool::MapCell* cell = &map->at(jMap * map->xSteps);
for (unsigned iMap=0; iMap<map->xSteps; ++iMap, ++cell)
{
HorizStepData step;
step.angle_rad = 2.0*M_PI * static_cast<double>(iMap)/static_cast<double>(map->xSteps);
step.deviation = cell->count ? cell->value : 0.0;
polySteps[iMap] = step;
}
}
//profile "direction"
double cwSign = map->counterclockwise ? -1.0 : 1.0;
CCVector3d pageShift(xc,yc,0.0);
//write profile polyline
{
dxf.writePolyline( *dw,
DL_PolylineData(static_cast<int>(polySteps.size()),0,0,1), //closed shape!
DefaultMaterial);
for (size_t i=0; i<polySteps.size(); ++i)
{
const HorizStepData& step = polySteps[i];
double radius = currentRadius + step.deviation * params.devMagnifyCoef;
dxf.writeVertex(*dw, DL_VertexData( pageShift.x - (cwSign * radius * sin(step.angle_rad)) * scale,