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
68961c82
Commit
68961c82
authored
Jul 02, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added possibility to change display modes of zones.
parent
0f5aa063
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
20 deletions
+96
-20
dialog_general_options.cpp
pcbnew/dialogs/dialog_general_options.cpp
+15
-3
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+73
-15
pcb_painter.h
pcbnew/pcb_painter.h
+8
-2
No files found.
pcbnew/dialogs/dialog_general_options.cpp
View file @
68961c82
...
@@ -202,16 +202,28 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
...
@@ -202,16 +202,28 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
case
ID_TB_OPTIONS_SHOW_ZONES
:
case
ID_TB_OPTIONS_SHOW_ZONES
:
DisplayOpt
.
DisplayZonesMode
=
0
;
DisplayOpt
.
DisplayZonesMode
=
0
;
#ifdef KICAD_GAL
recache
=
true
;
if
(
!
IsGalCanvasActive
()
)
#endif
/* KICAD_GAL */
m_canvas
->
Refresh
();
m_canvas
->
Refresh
();
break
;
break
;
case
ID_TB_OPTIONS_SHOW_ZONES_DISABLE
:
case
ID_TB_OPTIONS_SHOW_ZONES_DISABLE
:
DisplayOpt
.
DisplayZonesMode
=
1
;
DisplayOpt
.
DisplayZonesMode
=
1
;
#ifdef KICAD_GAL
recache
=
true
;
if
(
!
IsGalCanvasActive
()
)
#endif
/* KICAD_GAL */
m_canvas
->
Refresh
();
m_canvas
->
Refresh
();
break
;
break
;
case
ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY
:
case
ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY
:
DisplayOpt
.
DisplayZonesMode
=
2
;
DisplayOpt
.
DisplayZonesMode
=
2
;
#ifdef KICAD_GAL
recache
=
true
;
if
(
!
IsGalCanvasActive
()
)
#endif
/* KICAD_GAL */
m_canvas
->
Refresh
();
m_canvas
->
Refresh
();
break
;
break
;
...
...
pcbnew/pcb_painter.cpp
View file @
68961c82
...
@@ -84,6 +84,21 @@ void PCB_RENDER_SETTINGS::LoadDisplayOptions( const DISPLAY_OPTIONS& aOptions )
...
@@ -84,6 +84,21 @@ void PCB_RENDER_SETTINGS::LoadDisplayOptions( const DISPLAY_OPTIONS& aOptions )
m_sketchModeSelect
[
PADS_VISIBLE
]
=
!
aOptions
.
DisplayPadFill
;
m_sketchModeSelect
[
PADS_VISIBLE
]
=
!
aOptions
.
DisplayPadFill
;
m_sketchModeSelect
[
VIAS_VISIBLE
]
=
!
aOptions
.
DisplayViaFill
;
m_sketchModeSelect
[
VIAS_VISIBLE
]
=
!
aOptions
.
DisplayViaFill
;
m_sketchModeSelect
[
TRACKS_VISIBLE
]
=
!
aOptions
.
DisplayPcbTrackFill
;
m_sketchModeSelect
[
TRACKS_VISIBLE
]
=
!
aOptions
.
DisplayPcbTrackFill
;
switch
(
aOptions
.
DisplayZonesMode
)
{
case
0
:
m_displayZoneMode
=
DZ_SHOW_FILLED
;
break
;
case
1
:
m_displayZoneMode
=
DZ_HIDE_FILLED
;
break
;
case
2
:
m_displayZoneMode
=
DZ_SHOW_OUTLINED
;
break
;
}
}
}
...
@@ -487,34 +502,77 @@ void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
...
@@ -487,34 +502,77 @@ void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
void
PCB_PAINTER
::
draw
(
const
ZONE_CONTAINER
*
aContainer
)
void
PCB_PAINTER
::
draw
(
const
ZONE_CONTAINER
*
aContainer
)
{
{
std
::
vector
<
CPolyPt
>
polyPoints
=
aContainer
->
GetFilledPolysList
().
GetList
();
COLOR4D
color
=
getLayerColor
(
aContainer
->
GetLayer
(),
aContainer
->
GetNet
()
);
if
(
polyPoints
.
size
()
==
0
)
// Nothing to draw
return
;
COLOR4D
fillColor
=
getLayerColor
(
aContainer
->
GetLayer
(),
aContainer
->
GetNet
()
);
std
::
vector
<
CPolyPt
>::
iterator
polyIterator
;
std
::
deque
<
VECTOR2D
>
corners
;
std
::
deque
<
VECTOR2D
>
corners
;
int
fillMode
=
aContainer
->
GetFillMode
()
;
PCB_RENDER_SETTINGS
::
DisplayZonesMode
displayMode
=
m_pcbSettings
->
m_displayZoneMode
;
m_gal
->
SetFillColor
(
fillColor
);
// Draw the outline
m_gal
->
SetStrokeColor
(
fillC
olor
);
m_gal
->
SetStrokeColor
(
c
olor
);
m_gal
->
SetIsFill
(
!
fillMod
e
);
m_gal
->
SetIsFill
(
fals
e
);
m_gal
->
SetIsStroke
(
true
);
m_gal
->
SetIsStroke
(
true
);
m_gal
->
SetLineWidth
(
aContainer
->
GetThermalReliefCopperBridge
()
/
2.0
);
m_gal
->
SetLineWidth
(
m_pcbSettings
->
m_outlineWidth
);
const
CPolyLine
*
outline
=
aContainer
->
Outline
();
for
(
int
i
=
0
;
i
<
outline
->
GetCornersCount
();
++
i
)
{
corners
.
push_back
(
VECTOR2D
(
outline
->
GetPos
(
i
)
)
);
}
// The last point for closing the polyline
corners
.
push_back
(
VECTOR2D
(
outline
->
GetPos
(
0
)
)
);
m_gal
->
DrawPolyline
(
corners
);
corners
.
clear
();
// Draw the outline's hatch lines
std
::
vector
<
CSegment
>::
const_iterator
hatch
,
hatch_end
;
for
(
hatch
=
outline
->
m_HatchLines
.
begin
(),
hatch_end
=
outline
->
m_HatchLines
.
end
();
hatch
!=
hatch_end
;
++
hatch
)
{
const
VECTOR2D
start
=
VECTOR2D
(
hatch
->
m_Start
);
const
VECTOR2D
end
=
VECTOR2D
(
hatch
->
m_End
);
// FIXME implement hatch mode
m_gal
->
DrawLine
(
start
,
end
);
}
// Draw the filling
if
(
displayMode
!=
PCB_RENDER_SETTINGS
::
DZ_HIDE_FILLED
)
{
const
std
::
vector
<
CPolyPt
>
polyPoints
=
aContainer
->
GetFilledPolysList
().
GetList
();
if
(
polyPoints
.
size
()
==
0
)
// Nothing to draw
return
;
if
(
fillMode
==
0
)
// Set up drawing options
m_gal
->
SetFillColor
(
color
);
m_gal
->
SetLineWidth
(
aContainer
->
GetThermalReliefCopperBridge
()
/
2.0
);
if
(
displayMode
==
PCB_RENDER_SETTINGS
::
DZ_SHOW_FILLED
)
{
m_gal
->
SetIsFill
(
true
);
m_gal
->
SetIsStroke
(
true
);
}
else
if
(
displayMode
==
PCB_RENDER_SETTINGS
::
DZ_SHOW_OUTLINED
)
{
{
m_gal
->
SetIsFill
(
false
);
m_gal
->
SetIsStroke
(
true
);
}
std
::
vector
<
CPolyPt
>::
const_iterator
polyIterator
;
for
(
polyIterator
=
polyPoints
.
begin
();
polyIterator
!=
polyPoints
.
end
();
polyIterator
++
)
for
(
polyIterator
=
polyPoints
.
begin
();
polyIterator
!=
polyPoints
.
end
();
polyIterator
++
)
{
{
// Find out all of polygons and then draw them
// Find out all of polygons and then draw them
corners
.
push_back
(
VECTOR2D
(
*
polyIterator
)
);
corners
.
push_back
(
VECTOR2D
(
*
polyIterator
)
);
if
(
polyIterator
->
end_contour
)
if
(
polyIterator
->
end_contour
)
{
if
(
displayMode
==
PCB_RENDER_SETTINGS
::
DZ_SHOW_FILLED
)
{
{
m_gal
->
DrawPolygon
(
corners
);
m_gal
->
DrawPolygon
(
corners
);
m_gal
->
DrawPolyline
(
corners
);
m_gal
->
DrawPolyline
(
corners
);
}
else
if
(
displayMode
==
PCB_RENDER_SETTINGS
::
DZ_SHOW_OUTLINED
)
{
m_gal
->
DrawPolyline
(
corners
);
}
corners
.
clear
();
corners
.
clear
();
}
}
}
}
...
...
pcbnew/pcb_painter.h
View file @
68961c82
...
@@ -61,7 +61,6 @@ class STROKE_FONT;
...
@@ -61,7 +61,6 @@ class STROKE_FONT;
class
PCB_RENDER_SETTINGS
:
public
RENDER_SETTINGS
class
PCB_RENDER_SETTINGS
:
public
RENDER_SETTINGS
{
{
public
:
public
:
friend
class
PCB_PAINTER
;
friend
class
PCB_PAINTER
;
enum
ClearanceMode
{
enum
ClearanceMode
{
...
@@ -70,6 +69,12 @@ public:
...
@@ -70,6 +69,12 @@ public:
CL_TRACKS
=
0x4
CL_TRACKS
=
0x4
};
};
enum
DisplayZonesMode
{
DZ_HIDE_FILLED
=
0
,
DZ_SHOW_FILLED
,
DZ_SHOW_OUTLINED
};
PCB_RENDER_SETTINGS
();
PCB_RENDER_SETTINGS
();
/// @copydoc RENDER_SETTINGS::Update()
/// @copydoc RENDER_SETTINGS::Update()
...
@@ -87,7 +92,6 @@ public:
...
@@ -87,7 +92,6 @@ public:
void
LoadDisplayOptions
(
const
DISPLAY_OPTIONS
&
aOptions
);
void
LoadDisplayOptions
(
const
DISPLAY_OPTIONS
&
aOptions
);
protected
:
protected
:
/// Colors for all layers (including special, highlighted & darkened versions)
/// Colors for all layers (including special, highlighted & darkened versions)
COLOR4D
m_layerColors
[
NB_LAYERS
];
COLOR4D
m_layerColors
[
NB_LAYERS
];
COLOR4D
m_layerColorsHi
[
NB_LAYERS
];
COLOR4D
m_layerColorsHi
[
NB_LAYERS
];
...
@@ -101,6 +105,8 @@ protected:
...
@@ -101,6 +105,8 @@ protected:
bool
m_sketchModeSelect
[
END_PCB_VISIBLE_LIST
];
bool
m_sketchModeSelect
[
END_PCB_VISIBLE_LIST
];
bool
m_visibleLayers
[
NB_LAYERS
];
bool
m_visibleLayers
[
NB_LAYERS
];
bool
m_visibleItems
[
END_PCB_VISIBLE_LIST
];
bool
m_visibleItems
[
END_PCB_VISIBLE_LIST
];
DisplayZonesMode
m_displayZoneMode
;
};
};
...
...
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