1
Description: Fixes for hatch implimentaiton from LibreCAD project
2
Author: Rallaz <rallaz@gmail.com>
3
Index: dxflib/src/dl_entities.h
4
===================================================================
5
--- dxflib.orig/src/dl_entities.h 2012-03-03 21:00:30.349286383 -0500
6
+++ dxflib/src/dl_entities.h 2012-03-03 21:04:21.701291880 -0500
13
+ DL_LayerData(const string& lName,
14
+ int lFlags,bool lPlotF) {
17
+ plotF = lPlotF;//set help Layer, if plotF is false.
22
/** Layer flags. (1 = frozen, 2 = frozen by default, 4 = locked) */
30
/*! Number of edges in this loop. */
32
+ int pathType; //Boundary path type
36
Index: dxflib/src/dl_dxf.cpp
37
===================================================================
38
--- dxflib.orig/src/dl_dxf.cpp 2012-03-03 21:00:30.565286387 -0500
39
+++ dxflib/src/dl_dxf.cpp 2012-03-03 21:04:21.705291877 -0500
44
+ // 290 holds plotF flag, helpLayer holds (! plotF )
45
+// std::cout<<"DL_Dxf::addLayer(): layer("<<values[2]<<"): toInt(values[290]) = "<<toInt(values[290])<<std::endl;
46
creationInterface->addLayer(DL_LayerData(values[2],
47
- toInt(values[70])));
48
+ toInt(values[70]),(toInt(values[290],1)!=0)));
54
hatchLoops[hatchLoopIndex]
55
= DL_HatchLoopData(toInt(groupValue));
56
+ hatchLoops[hatchLoopIndex].pathType = toInt(values[92]);
58
maxHatchEdges[hatchLoopIndex] = toInt(groupValue);
59
hatchEdgeIndex[hatchLoopIndex] = -1;
62
for (int l=0; l<maxHatchLoops; l++) {
63
DL_HatchLoopData ld(maxHatchEdges[l]);
64
+ ld.pathType = hatchLoops[l].pathType;
65
creationInterface->addHatchLoop(ld);
66
for (int b=0; b<maxHatchEdges[l]; b++) {
67
creationInterface->addHatchEdge(hatchEdges[l][b]);
68
@@ -3312,13 +3316,17 @@
70
dw.dxfString(6, (attrib.getLineType().length()==0 ?
71
string("CONTINUOUS") : attrib.getLineType()));
73
+//std::cout<<"DL_Dxf::writeLayer(): layer("<<data.name<<")"<<std::endl;
74
if (version>=VER_2000) {
75
// layer defpoints cannot be plotted
76
std::string lstr = data.name;
77
std::transform(lstr.begin(), lstr.end(), lstr.begin(), tolower);
78
- if (lstr=="defpoints") {
79
+ if (lstr=="defpoints"|| ! data.plotF) {
80
+// std::cout<<"DL_Dxf::writeLayer(): layer("<<data.name<<"): write(290)=0"<<std::endl;
83
+// std::cout<<"DL_Dxf::writeLayer(): layer("<<data.name<<"): write(290)=1"<<std::endl;
87
if (version>=VER_2000 && attrib.getWidth()!=-1) {