Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
6b05cf31
Commit
6b05cf31
authored
Oct 13, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in GRLineArray(). Cleanup Gerbview code
parent
ee4aadc4
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
168 additions
and
202 deletions
+168
-202
gr_basic.cpp
common/gr_basic.cpp
+141
-146
edit.cpp
gerbview/edit.cpp
+1
-31
gerberframe.cpp
gerbview/gerberframe.cpp
+1
-1
toolbars_gerber.cpp
gerbview/toolbars_gerber.cpp
+0
-7
gr_basic.h
include/gr_basic.h
+11
-4
class_zone.cpp
pcbnew/class_zone.cpp
+14
-13
No files found.
common/gr_basic.cpp
View file @
6b05cf31
This diff is collapsed.
Click to expand it.
gerbview/edit.cpp
View file @
6b05cf31
...
...
@@ -116,26 +116,10 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
Close
(
TRUE
);
break
;
case
ID_NEW_PROJECT
:
case
ID_LOAD_PROJECT
:
Files_io
(
event
);
break
;
case
ID_GERBVIEW_GLOBAL_DELETE
:
Erase_Current_Layer
(
TRUE
);
break
;
case
ID_GET_TOOLS
:
// InstallToolsFrame(this, wxPoint(-1,-1) );
break
;
case
ID_FIND_ITEMS
:
// InstallFindFrame(this, pos);
break
;
case
ID_NO_SELECT_BUTT
:
SetToolID
(
0
,
0
,
wxEmptyString
);
break
;
...
...
@@ -223,19 +207,5 @@ void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
*/
void
WinEDA_GerberFrame
::
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
{
EDA_BaseStruct
*
DrawStruct
=
GetScreen
()
->
GetCurItem
();
switch
(
m_ID_current_state
)
{
case
0
:
if
(
(
DrawStruct
==
NULL
)
||
((
DrawStruct
->
m_Flags
&
~
DRAW_ERASED
)
==
0
)
)
{
DrawStruct
=
GerberGeneralLocateAndDisplay
();
}
break
;
default
:
break
;
}
// Currently: no nothing
}
gerbview/gerberframe.cpp
View file @
6b05cf31
...
...
@@ -169,7 +169,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
ReCreateMenuBar
();
ReCreateHToolbar
();
ReCreateVToolbar
();
// ReCreateVToolbar(); // Currently: no right vertical toolbar
ReCreateOptToolbar
();
m_auimgr
.
SetManagedWindow
(
this
);
...
...
gerbview/toolbars_gerber.cpp
View file @
6b05cf31
...
...
@@ -47,13 +47,6 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
wxBitmap
(
open_xpm
),
_
(
"Load a new Gerber file on the current layer. Previous data will be deleted"
)
);
m_HToolBar
->
AddSeparator
();
m_HToolBar
->
AddTool
(
wxID_UNDO
,
wxEmptyString
,
wxBitmap
(
undelete_xpm
),
_
(
"Undelete"
)
);
m_HToolBar
->
AddSeparator
();
m_HToolBar
->
AddTool
(
wxID_PRINT
,
wxEmptyString
,
wxBitmap
(
print_button
),
...
...
include/gr_basic.h
View file @
6b05cf31
...
...
@@ -77,8 +77,6 @@ void GRDashedLine( EDA_Rect* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void
GRDashedLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x2
,
int
y2
,
int
width
,
int
Color
);
void
GRMoveTo
(
int
x
,
int
y
);
void
GRLineTo
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRMoveRel
(
int
x
,
int
y
);
void
GRLineRel
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x
,
int
y
,
int
width
,
int
Color
);
void
GRPoly
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
n
,
wxPoint
Points
[],
bool
Fill
,
int
width
,
int
Color
,
int
BgColor
);
...
...
@@ -204,7 +202,16 @@ void GRRectPs( EDA_Rect* aClipBox, wxDC* aDC,const EDA_Rect& aRect,
void
GRSFilledRect
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
int
x1
,
int
y1
,
int
x2
,
int
y2
,
int
width
,
int
Color
,
int
BgColor
);
void
GRLineArray
(
EDA_Rect
*
ClipBox
,
wxDC
*
DC
,
wxPoint
points
[],
int
lines
,
int
width
,
int
Color
);
/** Function GRLineArray
* draws an array of lines (not a polygon).
* @param aClipBox = the clip box
* @param aDC = the device context into which drawing should occur.
* @param aLines = a list of pair of coordinate in user space: a pair for each line.
* @param aWidth = the width of each line.
* @param aColor = an index into our color table of RGB colors.
* @see EDA_Colors and colors.h
*/
void
GRLineArray
(
EDA_Rect
*
aClipBox
,
wxDC
*
aDC
,
std
::
vector
<
wxPoint
>&
aLines
,
int
aWidth
,
int
aColor
);
#endif
/* define GR_BASIC */
pcbnew/class_zone.cpp
View file @
6b05cf31
...
...
@@ -18,7 +18,6 @@
#include "protos.h"
/************************/
/* class ZONE_CONTAINER */
/************************/
...
...
@@ -477,7 +476,8 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
// draw the lines
int
i_start_contour
=
0
;
wxPoint
lines
[(
GetNumCorners
()
*
2
)
+
2
];
std
::
vector
<
wxPoint
>
lines
;
lines
.
reserve
(
(
GetNumCorners
()
*
2
)
+
2
);
for
(
int
ic
=
0
;
ic
<
GetNumCorners
();
ic
++
)
{
seg_start
=
GetCornerPosition
(
ic
)
+
offset
;
...
...
@@ -490,23 +490,24 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, con
seg_end
=
GetCornerPosition
(
i_start_contour
)
+
offset
;
i_start_contour
=
ic
+
1
;
}
lines
[
ic
*
2
].
x
=
seg_start
.
x
;
lines
[
ic
*
2
].
y
=
seg_start
.
y
;
lines
[
ic
*
2
+
1
].
x
=
seg_start
.
x
;
lines
[
ic
*
2
+
1
].
y
=
seg_start
.
y
;
lines
.
push_back
(
seg_start
);
lines
.
push_back
(
seg_end
);
}
GRLineArray
(
&
panel
->
m_ClipBox
,
DC
,
lines
,
GetNumCorners
(),
0
,
color
);
GRLineArray
(
&
panel
->
m_ClipBox
,
DC
,
lines
,
0
,
color
);
// draw hatches
wxPoint
hatches
[(
m_Poly
->
m_HatchLines
.
size
()
*
2
)
+
2
];
lines
.
clear
();
lines
.
reserve
(
(
m_Poly
->
m_HatchLines
.
size
()
*
2
)
+
2
);
for
(
unsigned
ic
=
0
;
ic
<
m_Poly
->
m_HatchLines
.
size
();
ic
++
)
{
hatches
[
ic
*
2
].
x
=
m_Poly
->
m_HatchLines
[
ic
].
xi
+
offset
.
x
;
hatches
[
ic
*
2
].
y
=
m_Poly
->
m_HatchLines
[
ic
].
yi
+
offset
.
y
;
hatches
[
ic
*
2
+
1
].
x
=
m_Poly
->
m_HatchLines
[
ic
].
xf
+
offset
.
x
;
hatches
[
ic
*
2
+
1
].
y
=
m_Poly
->
m_HatchLines
[
ic
].
yf
+
offset
.
y
;
seg_start
.
x
=
m_Poly
->
m_HatchLines
[
ic
].
xi
+
offset
.
x
;
seg_start
.
y
=
m_Poly
->
m_HatchLines
[
ic
].
yi
+
offset
.
y
;
seg_end
.
x
=
m_Poly
->
m_HatchLines
[
ic
].
xf
+
offset
.
x
;
seg_end
.
y
=
m_Poly
->
m_HatchLines
[
ic
].
yf
+
offset
.
y
;
lines
.
push_back
(
seg_start
);
lines
.
push_back
(
seg_end
);
}
GRLineArray
(
&
panel
->
m_ClipBox
,
DC
,
hatches
,
m_Poly
->
m_HatchLines
.
size
()
,
0
,
color
);
GRLineArray
(
&
panel
->
m_ClipBox
,
DC
,
lines
,
0
,
color
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment