~ubuntu-branches/debian/sid/dxflib/sid

« back to all changes in this revision

Viewing changes to debian/patches/hatches_fixes.patch

  • Committer: Package Import Robot
  • Author(s): Scott Howard
  • Date: 2012-03-03 21:25:22 UTC
  • Revision ID: package-import@ubuntu.com-20120303212522-9v5qqrxi1xzwd4tx
Tags: 2.2.0.0-8
More hatch fixes in debian/patches/hatches_fixes.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
7
@@ -45,12 +45,20 @@
 
8
                  int lFlags) {
 
9
         name = lName;
 
10
         flags = lFlags;
 
11
+        plotF = true;
 
12
+    }
 
13
+    DL_LayerData(const string& lName,
 
14
+                 int lFlags,bool lPlotF) {
 
15
+        name = lName;
 
16
+        flags = lFlags;
 
17
+        plotF = lPlotF;//set help Layer, if plotF is false.
 
18
     }
 
19
 
 
20
     /** Layer name. */
 
21
     string name;
 
22
     /** Layer flags. (1 = frozen, 2 = frozen by default, 4 = locked) */
 
23
     int flags;
 
24
+    bool plotF;
 
25
 };
 
26
 
 
27
 
 
28
@@ -1272,6 +1280,7 @@
 
29
 
 
30
     /*! Number of edges in this loop. */
 
31
     int numEdges;
 
32
+    int pathType; //Boundary path type
 
33
 };
 
34
 
 
35
 
 
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
 
40
@@ -816,8 +816,10 @@
 
41
     }
 
42
 
 
43
     // add layer
 
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)));
 
49
 }
 
50
 
 
51
 
 
52
@@ -1358,6 +1360,7 @@
 
53
             hatchLoopIndex++;
 
54
             hatchLoops[hatchLoopIndex]
 
55
             = DL_HatchLoopData(toInt(groupValue));
 
56
+            hatchLoops[hatchLoopIndex].pathType = toInt(values[92]);
 
57
 
 
58
             maxHatchEdges[hatchLoopIndex] = toInt(groupValue);
 
59
             hatchEdgeIndex[hatchLoopIndex] = -1;
 
60
@@ -1948,6 +1951,7 @@
 
61
 
 
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 @@
 
69
 
 
70
     dw.dxfString(6, (attrib.getLineType().length()==0 ?
 
71
                      string("CONTINUOUS") : attrib.getLineType()));
 
72
-
 
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;
 
81
             dw.dxfInt(290, 0);
 
82
+        }else{
 
83
+//            std::cout<<"DL_Dxf::writeLayer(): layer("<<data.name<<"): write(290)=1"<<std::endl;
 
84
+            dw.dxfInt(290, 1);
 
85
         }
 
86
     }
 
87
     if (version>=VER_2000 && attrib.getWidth()!=-1) {