本文整理汇总了C++中DL_Dxf::writeText方法的典型用法代码示例。如果您正苦于以下问题:C++ DL_Dxf::writeText方法的具体用法?C++ DL_Dxf::writeText怎么用?C++ DL_Dxf::writeText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DL_Dxf
的用法示例。
在下文中一共展示了DL_Dxf::writeText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveVerticalProfiles
//.........这里部分代码省略.........
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;
//units
QString unitsStr("mm");
dxf.writeText( *dw,
DL_TextData(xLegend,yLegend,0.0,xLegend,yLegend,0.0,c_textHeight_mm,1.0,0,0,0,(QString("Deviation units: ")+unitsStr).toStdString(),"STANDARD",0.0),
DefaultLegendMaterial);
//next line
yLegend += c_textHeight_mm*2.0;
//true profile line (red)
dxf.writeLine( *dw,
DL_LineData(xLegend,yLegend,0,xLegend+legendWidth_mm,yLegend,0.0),
DL_Attributes(LEGEND_LAYER, DL_Codes::green, -1, "BYLAYER"));
dxf.writeText( *dw,
DL_TextData(xLegend+legendWidth_mm+c_textMargin_mm,yLegend,0.0,xLegend+legendWidth_mm+c_textMargin_mm,yLegend,0.0,c_textHeight_mm,1.0,0,0,0,params.legendRealProfileTitle.toStdString(),"STANDARD",0.0),
DefaultLegendMaterial);
//next line
yLegend += c_textHeight_mm*2.0;
//theoretical profile line (red)
dxf.writeLine( *dw,
DL_LineData(xLegend,yLegend,0,xLegend+legendWidth_mm,yLegend,0.0),
DL_Attributes(LEGEND_LAYER, DL_Codes::red, -1, "BYLAYER"));
示例2: SaveHorizontalProfiles
//.........这里部分代码省略.........
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,
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;
//units
QString unitsStr("mm");
dxf.writeText( *dw,
DL_TextData(xLegend,yLegend,0.0,xLegend,yLegend,0.0,c_textHeight_mm,1.0,0,0,0,(QString("Deviation units: ")+unitsStr).toStdString(),"STANDARD",0.0),
DefaultLegendMaterial);
//next line
yLegend += c_textHeight_mm*2.0;
//true profile line (red)
dxf.writeLine( *dw,
DL_LineData(xLegend,yLegend,0,xLegend+legendWidth_mm,yLegend,0.0),
DL_Attributes(LEGEND_LAYER, DL_Codes::green, -1, "BYLAYER"));
dxf.writeText( *dw,
DL_TextData(xLegend+legendWidth_mm+c_textMargin_mm,yLegend,0.0,xLegend+legendWidth_mm+c_textMargin_mm,yLegend,0.0,c_textHeight_mm,1.0,0,0,0,params.legendRealProfileTitle.toStdString(),"STANDARD",0.0),
DefaultLegendMaterial);
//next line