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


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

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


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

示例1: SaveVerticalProfiles


//.........这里部分代码省略.........
			//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() >= static_cast<int>(angularStepCount))
			//{
			//	layerName = params.profileTitles[i];
			//	layerName.replace(QChar(' '),QChar('_'));
			//}

			profileNames << layerName;
			dxf.writeLayer(*dw, 
				DL_LayerData(layerName.toStdString(), 0), 
				DL_Attributes(
				std::string(""),
				i == 0 ? DL_Codes::green : -DL_Codes::green, //invisible if negative!
				s_lineWidth,
				"CONTINUOUS"));
		}
	}
	dw->tableEnd();

	//Writing Various Other Tables
	//dxf.writeStyle(*dw); //DXFLIB V2.5
	dxf.writeStyle(*dw,DL_StyleData("Standard",0,0.0,0.75,0.0,0,2.5,"txt","")); //DXFLIB V3.3
	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);
	//dxf.writeBlockRecord(*dw, "myblock1");
	//dxf.writeBlockRecord(*dw, "myblock2");
	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
开发者ID:eile,项目名称:trunk,代码行数:67,代码来源:dxfProfilesExporter.cpp

示例2: SaveHorizontalProfiles


//.........这里部分代码省略.........
			//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;
			dxf.writeLayer(*dw, 
				DL_LayerData(layerName.toStdString(), 0), 
				DL_Attributes(
				std::string(""),
				i == 0 ? DL_Codes::green : -DL_Codes::green, //invisible if negative!
				s_lineWidth,
				"CONTINUOUS"));
		}
	}
	dw->tableEnd();

	//Writing Various Other Tables
	//dxf.writeStyle(*dw); //DXFLIB V2.5
	dxf.writeStyle(*dw,DL_StyleData("Standard",0,0.0,0.75,0.0,0,2.5,"txt","")); //DXFLIB V3.3
	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();
开发者ID:eile,项目名称:trunk,代码行数:67,代码来源:dxfProfilesExporter.cpp

示例3: 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

示例4: saveToFile


//.........这里部分代码省略.........

		//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);

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

示例5: main

int main(int argc, char **argv)
{
	if (argc < 5) {
		std::cerr << "Usage: dxf-import <main input file> <overlay input file> <overlay layer name prefix> <output file>\n";
		return 1;
	}
	
	std::string mainInput = argv[1];
	std::string overlayInput = argv[2];
	std::string layerPrefix = argv[3];
	
	LayerCounter mainLayerCounter(layerPrefix, false);
	mainLayerCounter.input(mainInput);
	
	LayerCounter overlayLayerCounter(layerPrefix, true);
	overlayLayerCounter.input(overlayInput);
	
	DL_Dxf output;
	DL_WriterA *writer = output.out(argv[4]);
	if (!writer) {
		std::cerr << "Unable to open output file '" << argv[4] << "'\n";
		return 1;
	}
	
	
	output.writeHeader(*writer);
	VariableWriter(&output, writer).input(mainInput);
	writer->sectionEnd();
	
	
	writer->sectionTables();
	output.writeVPort(*writer);
	writeLineTypes(output, writer);
	
	writer->tableLayers(mainLayerCounter.layers() + overlayLayerCounter.layers());
	LayerWriter(layerPrefix, false, &output, writer).input(mainInput);
	LayerWriter(layerPrefix, true, &output, writer).input(overlayInput);
	writer->tableEnd();
	
	output.writeStyle(*writer);
	output.writeView(*writer);
	output.writeUcs(*writer);
	writer->tableAppid(1);
	writer->tableAppidEntry(0x12);
	writer->dxfString(2, "ACAD");
	writer->dxfInt(70, 0);
	writer->tableEnd();
	output.writeDimStyle(*writer, 3.0, 3.0, 1.5, 2.0, 3.0);
	
	output.writeBlockRecord(*writer);
	BlockRecordWriter(layerPrefix, false, &output, writer).input(mainInput);
	BlockRecordWriter(layerPrefix, true, &output, writer).input(overlayInput);
	writer->tableEnd();
	
	writer->sectionEnd();
	
	
	std::map<std::string, ImageHandle> images;
	
	
	writer->sectionBlocks();
	output.writeBlock(*writer, DL_BlockData("*Model_Space", 0, 0.0, 0.0, 0.0));
	output.writeEndBlock(*writer, "*Model_Space");
	output.writeBlock(*writer, DL_BlockData("*Paper_Space", 0, 0.0, 0.0, 0.0));
	output.writeEndBlock(*writer, "*Paper_Space");
	output.writeBlock(*writer, DL_BlockData("*Paper_Space0", 0, 0.0, 0.0, 0.0));
	output.writeEndBlock(*writer, "*Paper_Space0");
	EntityWriter(layerPrefix, false, &output, writer, true, &images).input(mainInput);
	EntityWriter(layerPrefix, true, &output, writer, true, &images).input(overlayInput);
	writer->sectionEnd();
	
	
	writer->sectionEntities();
	EntityWriter(layerPrefix, false, &output, writer, false, &images).input(mainInput);
	EntityWriter(layerPrefix, true, &output, writer, false, &images).input(overlayInput);
	writer->sectionEnd();
	
	
	output.writeObjects(*writer);
	ObjectWriter(&output, writer, &images).input(mainInput);
	ObjectWriter(&output, writer, &images).input(overlayInput);
	output.writeObjectsEnd(*writer);
	
	
	writer->dxfEOF();	
	writer->close();
	delete writer;
	
	return 0;
}
开发者ID:ohm2013,项目名称:gis,代码行数:90,代码来源:dxf-import.cpp

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