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


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

本文整理汇总了C++中DL_Dxf::writeLayer方法的典型用法代码示例。如果您正苦于以下问题:C++ DL_Dxf::writeLayer方法的具体用法?C++ DL_Dxf::writeLayer怎么用?C++ DL_Dxf::writeLayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DL_Dxf的用法示例。


在下文中一共展示了DL_Dxf::writeLayer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SaveVerticalProfiles


//.........这里部分代码省略.........
		dxf.writeLineType(*dw, DL_LineTypeData("BYBLOCK", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BYLAYER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CONTINUOUS", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO02W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO03W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO04W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO05W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDER2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDERX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTER2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTERX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOT", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOT2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOTX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHED", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHED2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHEDX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDE", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDE2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDEX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOT", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOT2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOTX2", 0));
		dw->tableEnd();
	}

	//Writing the Layers
	dw->tableLayers(angularStepCount+3);
	QStringList profileNames;
	{
		//default layer
		dxf.writeLayer(*dw, 
			DL_LayerData("0", 0), 
			DL_Attributes(
			std::string(""),      // leave empty
			DL_Codes::black,      // default color
			100,                  // default width (in 1/100 mm)
			"CONTINUOUS"));       // default line style

		//theoretical profile layer
		dxf.writeLayer(*dw, 
			DL_LayerData(PROFILE_LAYER, 0), 
			DL_Attributes(
			std::string(""),
			DL_Codes::red,
			s_lineWidth,
			"CONTINUOUS"));

		//legend layer
		dxf.writeLayer(*dw, 
			DL_LayerData(LEGEND_LAYER, 0), 
			DL_Attributes(
			std::string(""),
			DL_Codes::black,
			s_lineWidth,
			"CONTINUOUS"));

		//vert. profile layers
		for (unsigned i=0; i<angularStepCount; ++i)
		{
			//default layer name
			QString layerName = QString(VERT_PROFILE_LAYER).arg(i+1,3,10,QChar('0'));
			//but we use the profile title if we have one!
			//DGM: nope, as it may be longer than 31 characters (R14 limit)
开发者ID:eile,项目名称:trunk,代码行数:67,代码来源:dxfProfilesExporter.cpp

示例2: SaveHorizontalProfiles


//.........这里部分代码省略.........
		dxf.writeLineType(*dw, DL_LineTypeData("BYBLOCK", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BYLAYER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CONTINUOUS", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO02W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO03W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO04W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO05W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDER2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDERX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTER2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTERX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOT", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOT2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOTX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHED", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHED2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHEDX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDE", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDE2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDEX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOT", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOT2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOTX2", 0));
		dw->tableEnd();
	}

	//Writing the Layers
	dw->tableLayers(heightStepCount+2);
	QStringList profileNames;
	{
		//default layer
		dxf.writeLayer(*dw, 
			DL_LayerData("0", 0), 
			DL_Attributes(
			std::string(""),      // leave empty
			DL_Codes::black,      // default color
			100,                  // default width (in 1/100 mm)
			"CONTINUOUS"));       // default line style

		//legend layer
		dxf.writeLayer(*dw, 
			DL_LayerData(LEGEND_LAYER, 0), 
			DL_Attributes(
			std::string(""),
			DL_Codes::black,
			s_lineWidth,
			"CONTINUOUS"));

		//horiz. profile layers
		for (unsigned i=0; i<heightStepCount; ++i)
		{
			//default profile name
			QString layerName = QString(HORIZ_PROFILE_LAYER).arg(i+1,3,10,QChar('0'));
			//but we use the profile title if we have one!
			//DGM: nope, as it may be longer than 31 characters (R14 limit)
			//if (params.profileTitles.size() == 1)
			//{
			//	//profile height
			//	double height = yMin + static_cast<double>(i) / static_cast<double>(heightStepCount-1) * ySpan;
			//	layerName = QString(params.profileTitles[0]).arg(height,0,'f',params.precision);
			//	layerName.replace(QChar(' '),QChar('_'));
			//}

			profileNames << layerName;
开发者ID:eile,项目名称:trunk,代码行数:67,代码来源:dxfProfilesExporter.cpp

示例3: saveToFile


//.........这里部分代码省略.........
		dxf.writeLineType(*dw, DL_LineTypeData("BYBLOCK", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BYLAYER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CONTINUOUS", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO02W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO03W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO04W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("ACAD_ISO05W100", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDER2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("BORDERX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTER", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTER2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("CENTERX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOT", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOT2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHDOTX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHED", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHED2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DASHEDX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDE", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDE2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DIVIDEX2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOT", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOT2", 0));
		dxf.writeLineType(*dw, DL_LineTypeData("DOTX2", 0));
		dw->tableEnd();
	}

	//Writing the Layers
	dw->tableLayers(static_cast<int>(polyCount)+1);
	QStringList layerNames;
	{
		//default layer
		dxf.writeLayer(*dw, 
			DL_LayerData("0", 0), 
			DL_Attributes(
			std::string(""),      // leave empty
			DL_Codes::black,      // default color
			100,                  // default width (in 1/100 mm)
			"CONTINUOUS"));       // default line style

		//polylines layers
		for (unsigned i=0; i<polyCount; ++i)
		{
			//default layer name
			//TODO: would be better to use the polyline name!
			//but it can't be longer than 31 characters (R14 limit)
			QString layerName = QString("POLYLINE_%1").arg(i+1,3,10,QChar('0'));

			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);
开发者ID:kod3r,项目名称:trunk,代码行数:66,代码来源:DxfFilter.cpp

示例4: main

int main() {
    DL_Dxf dxf;
    DL_WriterA* dw = dxf.out("dimension.dxf", DL_Codes::AC1015);
 
    // section header:
    dxf.writeHeader(*dw);
    dw->sectionEnd();
 
    // section tables:
    dw->sectionTables();

    // VPORT:
    dxf.writeVPort(*dw);

    // LTYPE:
    dw->tableLinetypes(1);
    dxf.writeLinetype(*dw, DL_LinetypeData("CONTINUOUS", "Continuous", 0, 0, 0.0));
    dxf.writeLinetype(*dw, DL_LinetypeData("BYLAYER", "", 0, 0, 0.0));
    dxf.writeLinetype(*dw, DL_LinetypeData("BYBLOCK", "", 0, 0, 0.0));
    dw->tableEnd();

    // LAYER:
    dw->tableLayers(1);
    dxf.writeLayer(
        *dw,
        DL_LayerData("0", 0),
        DL_Attributes("", 1, 0x00ff0000, 15, "CONTINUOUS")
    );
    dw->tableEnd();

    // STYLE:
    dw->tableStyle(1);
    DL_StyleData style("Standard", 0, 0.0, 1.0, 0.0, 0, 2.5, "txt", "");
    style.bold = false;
    style.italic = false;
    dxf.writeStyle(*dw, style);
    dw->tableEnd();

    // VIEW:
    dxf.writeView(*dw);

    // UCS:
    dxf.writeUcs(*dw);

    // APPID:
    dw->tableAppid(1);
    dxf.writeAppid(*dw, "ACAD");
    dw->tableEnd();

    // DIMSTYLE:
    dxf.writeDimStyle(*dw, 2.5, 0.625, 0.625, 0.625, 2.5);

    // BLOCK_RECORD:
    dxf.writeBlockRecord(*dw);
    dw->tableEnd();

    dw->sectionEnd();
 
    // BLOCK:
    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();
 
    // ENTITIES:
    dw->sectionEntities();
 
    DL_Attributes attributes("0", 256, -1, -1, "BYLAYER");

    // LINE:
    DL_LineData lineData(10, 5, 0, 30, 5, 0);
    dxf.writeLine(*dw, lineData, attributes);
 
    // DIMENSION:
    DL_DimensionData dimData(10.0,                  // def point (dimension line pos)
                             50.0,
                             0.0,
                             0,                     // text pos (irrelevant if flag 0x80 (128) set for type
                             0,
                             0.0,
                             0x1,                   // type: aligned with auto text pos (0x80 NOT set)
                             8,                     // attachment point: bottom center
                             2,                     // line spacing: exact
                             1.0,                   // line spacing factor
                             "",                    // text
                             "Standard",            // style
                             0.0,                   // text angle
                             1.0,                   // linear factor
                             1.0);                  // dim scale

    DL_DimAlignedData dimAlignedData(10.0,          // extension point 1
                                     5.0,
                                     0.0,
                                     30.0,          // extension point 2
                                     5.0,
                                     0.0);
//.........这里部分代码省略.........
开发者ID:MrCairo90,项目名称:CloudCompare,代码行数:101,代码来源:main.cpp

示例5: main

int main() {
    DL_Dxf dxf;
    DL_WriterA* dw = dxf.out("hatch.dxf", DL_Codes::AC1015);
 
    // section header:
    dxf.writeHeader(*dw);
    dw->sectionEnd();
 
    // section tables:
    dw->sectionTables();

    // VPORT:
    dxf.writeVPort(*dw);

    // LTYPE:
    dw->tableLinetypes(1);
    dxf.writeLinetype(*dw, DL_LinetypeData("CONTINUOUS", "Continuous", 0, 0, 0.0));
    dxf.writeLinetype(*dw, DL_LinetypeData("BYLAYER", "", 0, 0, 0.0));
    dxf.writeLinetype(*dw, DL_LinetypeData("BYBLOCK", "", 0, 0, 0.0));
    dw->tableEnd();

    // LAYER:
    dw->tableLayers(1);
    dxf.writeLayer(
        *dw,
        DL_LayerData("0", 0),
        DL_Attributes("", 2, 0, 100, "CONTINUOUS")
    );
    dw->tableEnd();

    // STYLE:
    dw->tableStyle(1);
    DL_StyleData style("Standard", 0, 0.0, 1.0, 0.0, 0, 2.5, "txt", "");
    style.bold = false;
    style.italic = false;
    dxf.writeStyle(*dw, style);
    dw->tableEnd();

    // VIEW:
    dxf.writeView(*dw);

    // UCS:
    dxf.writeUcs(*dw);

    // APPID:
    dw->tableAppid(1);
    dxf.writeAppid(*dw, "ACAD");
    dw->tableEnd();

    // DIMSTYLE:
    dxf.writeDimStyle(*dw, 2.5, 0.625, 0.625, 0.625, 2.5);

    // BLOCK_RECORD:
    dxf.writeBlockRecord(*dw);
    dw->tableEnd();

    dw->sectionEnd();
 
    // BLOCK:
    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();
 
    // ENTITIES:
    dw->sectionEntities();
 
    DL_Attributes attributes("0", 2, 0, -1, "BYLAYER");
 
    // start hatch with one loop:
    DL_HatchData data(1, false, 100.0, 0.0, "ESCHER", 0.0, 0.0);
    dxf.writeHatch1(*dw, data, attributes);
 
    // start loop:
    DL_HatchLoopData lData(1);
    dxf.writeHatchLoop1(*dw, lData);
 
    // write edge:
    DL_HatchEdgeData eData(
        0.0,
        0.0,
        100.0,
        0.0,
        M_PI*2,
        true
    );
    dxf.writeHatchEdge(*dw, eData);
 
    // end loop:
    dxf.writeHatchLoop2(*dw, lData);
 
    // end hatch:
    dxf.writeHatch2(*dw, data, attributes);
 
    // end section ENTITIES:
    dw->sectionEnd();
//.........这里部分代码省略.........
开发者ID:Jackieee,项目名称:qcad,代码行数:101,代码来源:main.cpp


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