本文整理汇总了C++中DL_Dxf::writePolylineEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ DL_Dxf::writePolylineEnd方法的具体用法?C++ DL_Dxf::writePolylineEnd怎么用?C++ DL_Dxf::writePolylineEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DL_Dxf
的用法示例。
在下文中一共展示了DL_Dxf::writePolylineEnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveHorizontalProfiles
//.........这里部分代码省略.........
dw->sectionEnd();
}
//Writing the Entities Section
{
dw->sectionEntities();
//we make the profile fit in the middle of the page (21.0 x 29.7 cm)
double scale = std::min((c_pageWidth_mm - 2.0 * c_profileMargin_mm)/(2.0*maxRadius),
(c_pageHeight_mm - 2.0 * c_profileMargin_mm)/(2.0*maxRadius));
//min corner of profile area
// const double x0 = (c_pageWidth_mm - 2.0*maxRadius*scale) / 2.0;
const double y0 = (c_pageHeight_mm - 2.0*maxRadius*scale) / 2.0;
//center of profile area
const double xc = c_pageWidth_mm / 2.0;
const double yc = c_pageHeight_mm / 2.0;
//write legend
{
DL_Attributes DefaultLegendMaterial(LEGEND_LAYER, DL_Codes::bylayer, -1, "BYLAYER");
//write page contour
{
dxf.writePolyline( *dw,
DL_PolylineData(4,0,0,1),
DefaultLegendMaterial);
dxf.writeVertex(*dw, DL_VertexData( c_pageMargin_mm, c_pageMargin_mm, 0.0));
dxf.writeVertex(*dw, DL_VertexData( c_pageMargin_mm, c_pageHeight_mm-c_pageMargin_mm, 0.0));
dxf.writeVertex(*dw, DL_VertexData( c_pageWidth_mm-c_pageMargin_mm, c_pageHeight_mm-c_pageMargin_mm, 0.0));
dxf.writeVertex(*dw, DL_VertexData( c_pageWidth_mm-c_pageMargin_mm, c_pageMargin_mm, 0.0));
dxf.writePolylineEnd(*dw);
}
double xLegend = c_pageMargin_mm + 2.0*c_textHeight_mm;
double yLegend = c_pageMargin_mm + 2.0*c_textHeight_mm;
const double legendWidth_mm = 20.0;
//Y axis
double axisTip = maxRadius*scale + 5.0;
dxf.writeLine( *dw,
DL_LineData(xc, yc, 0.0, xc, yc-axisTip, 0.0),
DefaultLegendMaterial);
//Y axis tip as triangle
{
double axisTipSize = 3.0;
dxf.writePolyline( *dw,
DL_PolylineData(3,0,0,1), //closed polyline!
DefaultLegendMaterial);
dxf.writeVertex(*dw, DL_VertexData( xc, yc-(axisTip+axisTipSize), 0.0));
dxf.writeVertex(*dw, DL_VertexData( xc-axisTipSize/2.0, yc-axisTip, 0.0));
dxf.writeVertex(*dw, DL_VertexData( xc+axisTipSize/2.0, yc-axisTip, 0.0));
dxf.writePolylineEnd(*dw);
dxf.writeText( *dw,
DL_TextData(xc,yc-(axisTip+2.0*axisTipSize),0.0,xc,yc-(axisTip+2.0*axisTipSize),0.0,c_textHeight_mm,1.0,0,1,3,"Y","STANDARD",0.0),
DefaultLegendMaterial);
}
//deviation magnification factor
QString magnifyStr = QString::number(params.devMagnifyCoef);
dxf.writeText( *dw,
示例2: SaveVerticalProfiles
//.........这里部分代码省略.........
dxf.writeEndBlock(*dw, "*Paper_Space");
dxf.writeBlock(*dw, DL_BlockData("*Paper_Space0", 0, 0.0, 0.0, 0.0));
dxf.writeEndBlock(*dw, "*Paper_Space0");
dw->sectionEnd();
}
//Writing the Entities Section
{
dw->sectionEntities();
//we make the profile fit in the middle of the page (21.0 x 29.7 cm)
double scale = std::min((c_pageWidth_mm - 2.0 * c_profileMargin_mm)/xSpan,
(c_pageHeight_mm - 2.0 * c_profileMargin_mm)/ySpan);
//min corner of profile area
const double x0 = (c_pageWidth_mm - xSpan*scale) / 2.0;
const double y0 = (c_pageHeight_mm - ySpan*scale) / 2.0;
//write theoretical profile (polyline)
{
unsigned vertexCount = profile->size();
dxf.writePolyline( *dw,
DL_PolylineData(static_cast<int>(vertexCount),0,0,0),
DL_Attributes(PROFILE_LAYER, DL_Codes::bylayer, -1, "BYLAYER"));
for (unsigned i=0; i<vertexCount; ++i)
{
const CCVector3* P = profile->getPoint(i);
dxf.writeVertex(*dw, DL_VertexData(x0+(P->x-xMin)*scale,y0+(P->y-yMin)*scale,0.0));
}
dxf.writePolylineEnd(*dw);
}
//write legend
{
DL_Attributes DefaultLegendMaterial(LEGEND_LAYER, DL_Codes::bylayer, -1, "BYLAYER");
//write page contour
{
dxf.writePolyline( *dw,
DL_PolylineData(4,0,0,1),
DefaultLegendMaterial);
dxf.writeVertex(*dw, DL_VertexData( c_pageMargin_mm, c_pageMargin_mm, 0.0));
dxf.writeVertex(*dw, DL_VertexData( c_pageMargin_mm, c_pageHeight_mm-c_pageMargin_mm, 0.0));
dxf.writeVertex(*dw, DL_VertexData( c_pageWidth_mm-c_pageMargin_mm, c_pageHeight_mm-c_pageMargin_mm, 0.0));
dxf.writeVertex(*dw, DL_VertexData( c_pageWidth_mm-c_pageMargin_mm, c_pageMargin_mm, 0.0));
dxf.writePolylineEnd(*dw);
}
double xLegend = c_pageMargin_mm + 2.0*c_textHeight_mm;
double yLegend = c_pageMargin_mm + 2.0*c_textHeight_mm;
const double legendWidth_mm = 20.0;
//deviation magnification factor
QString magnifyStr = QString::number(params.devMagnifyCoef);
dxf.writeText( *dw,
DL_TextData(xLegend,yLegend,0.0,xLegend,yLegend,0.0,c_textHeight_mm,1.0,0,0,0,(QString("Deviation magnification factor: ")+magnifyStr).toStdString(),"STANDARD",0.0),
DefaultLegendMaterial);
//next line
yLegend += c_textHeight_mm*2.0;
示例3: saveToFile
//.........这里部分代码省略.........
layerNames << layerName;
dxf.writeLayer(*dw,
DL_LayerData(layerName.toStdString(), 0),
DL_Attributes(
std::string(""),
i == 0 ? DL_Codes::green : /*-*/DL_Codes::green, //invisible if negative!
lineWidth,
"CONTINUOUS"));
}
}
dw->tableEnd();
//Writing Various Other Tables
dxf.writeStyle(*dw);
dxf.writeView(*dw);
dxf.writeUcs(*dw);
dw->tableAppid(1);
dw->tableAppidEntry(0x12);
dw->dxfString(2, "ACAD");
dw->dxfInt(70, 0);
dw->tableEnd();
//Writing Dimension Styles
dxf.writeDimStyle( *dw,
/*arrowSize*/1,
/*extensionLineExtension*/1,
/*extensionLineOffset*/1,
/*dimensionGap*/1,
/*dimensionTextSize*/1);
//Writing Block Records
dxf.writeBlockRecord(*dw);
dw->tableEnd();
//Ending the Tables Section
dw->sectionEnd();
//Writing the Blocks Section
{
dw->sectionBlocks();
dxf.writeBlock(*dw, DL_BlockData("*Model_Space", 0, 0.0, 0.0, 0.0));
dxf.writeEndBlock(*dw, "*Model_Space");
dxf.writeBlock(*dw, DL_BlockData("*Paper_Space", 0, 0.0, 0.0, 0.0));
dxf.writeEndBlock(*dw, "*Paper_Space");
dxf.writeBlock(*dw, DL_BlockData("*Paper_Space0", 0, 0.0, 0.0, 0.0));
dxf.writeEndBlock(*dw, "*Paper_Space0");
dw->sectionEnd();
}
//Writing the Entities Section
{
dw->sectionEntities();
//write polylines
for (unsigned i=0; i<polyCount; ++i)
{
const ccPolyline* poly = static_cast<ccPolyline*>(polylines[i]);
unsigned vertexCount = poly->size();
int flags = poly->isClosed() ? 1 : 0;
if (!poly->is2DMode())
flags |= 8; //3D polyline
dxf.writePolyline( *dw,
DL_PolylineData(static_cast<int>(vertexCount),0,0,flags),
DL_Attributes(layerNames[i].toStdString(), DL_Codes::bylayer, -1, "BYLAYER") );
for (unsigned i=0; i<vertexCount; ++i)
{
CCVector3 P;
poly->getPoint(i,P);
dxf.writeVertex(*dw, DL_VertexData( P.x, P.y, P.y ) );
}
dxf.writePolylineEnd(*dw);
}
dw->sectionEnd();
}
//Writing the Objects Section
dxf.writeObjects(*dw);
dxf.writeObjectsEnd(*dw);
//Ending and Closing the File
dw->dxfEOF();
dw->close();
delete dw;
dw = 0;
ccLog::Print("[DXF] File %s saved successfully",filename);
return CC_FERR_NO_ERROR;
#endif
}