当前位置: 首页>>代码示例>>C++>>正文


C++ DL_Dxf::writeCircle方法代码示例

本文整理汇总了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,
开发者ID:eile,项目名称:trunk,代码行数:67,代码来源:dxfProfilesExporter.cpp


注:本文中的DL_Dxf::writeCircle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。