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
16437e5d
Commit
16437e5d
authored
Aug 08, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added general purpose overlay layer and moved selection box to it.
parent
8c37e708
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
16 deletions
+15
-16
layers_id_colors_and_visibility.h
include/layers_id_colors_and_visibility.h
+3
-0
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+1
-0
selection_area.cpp
pcbnew/tools/selection_area.cpp
+8
-10
selection_area.h
pcbnew/tools/selection_area.h
+3
-2
selection_tool.cpp
pcbnew/tools/selection_tool.cpp
+0
-4
No files found.
include/layers_id_colors_and_visibility.h
View file @
16437e5d
...
@@ -240,6 +240,8 @@ enum PCB_VISIBLE
...
@@ -240,6 +240,8 @@ enum PCB_VISIBLE
PAD_BK_NETNAMES_VISIBLE
,
PAD_BK_NETNAMES_VISIBLE
,
PADS_NETNAMES_VISIBLE
,
PADS_NETNAMES_VISIBLE
,
GP_OVERLAY
,
// General purpose overlay
END_PCB_VISIBLE_LIST
// sentinel
END_PCB_VISIBLE_LIST
// sentinel
};
};
...
@@ -256,6 +258,7 @@ enum PCB_VISIBLE
...
@@ -256,6 +258,7 @@ enum PCB_VISIBLE
/// means that layer is displayed closer to the user, ie. on the top).
/// means that layer is displayed closer to the user, ie. on the top).
const
LAYER_NUM
GalLayerOrder
[]
=
const
LAYER_NUM
GalLayerOrder
[]
=
{
{
ITEM_GAL_LAYER
(
GP_OVERLAY
),
ITEM_GAL_LAYER
(
PADS_NETNAMES_VISIBLE
),
ITEM_GAL_LAYER
(
PADS_NETNAMES_VISIBLE
),
DRAW_N
,
COMMENT_N
,
ECO1_N
,
ECO2_N
,
EDGE_N
,
DRAW_N
,
COMMENT_N
,
ECO1_N
,
ECO2_N
,
EDGE_N
,
UNUSED_LAYER_29
,
UNUSED_LAYER_30
,
UNUSED_LAYER_31
,
UNUSED_LAYER_29
,
UNUSED_LAYER_30
,
UNUSED_LAYER_31
,
...
...
pcbnew/basepcbframe.cpp
View file @
16437e5d
...
@@ -831,6 +831,7 @@ void PCB_BASE_FRAME::LoadSettings()
...
@@ -831,6 +831,7 @@ void PCB_BASE_FRAME::LoadSettings()
view
->
SetRequired
(
ITEM_GAL_LAYER
(
PADS_NETNAMES_VISIBLE
),
ITEM_GAL_LAYER
(
PADS_VISIBLE
)
);
view
->
SetRequired
(
ITEM_GAL_LAYER
(
PADS_NETNAMES_VISIBLE
),
ITEM_GAL_LAYER
(
PADS_VISIBLE
)
);
view
->
SetRequired
(
ITEM_GAL_LAYER
(
PAD_FR_NETNAMES_VISIBLE
),
ITEM_GAL_LAYER
(
PAD_FR_VISIBLE
)
);
view
->
SetRequired
(
ITEM_GAL_LAYER
(
PAD_FR_NETNAMES_VISIBLE
),
ITEM_GAL_LAYER
(
PAD_FR_VISIBLE
)
);
view
->
SetRequired
(
ITEM_GAL_LAYER
(
PAD_BK_NETNAMES_VISIBLE
),
ITEM_GAL_LAYER
(
PAD_BK_VISIBLE
)
);
view
->
SetRequired
(
ITEM_GAL_LAYER
(
PAD_BK_NETNAMES_VISIBLE
),
ITEM_GAL_LAYER
(
PAD_BK_VISIBLE
)
);
view
->
SetLayerTarget
(
ITEM_GAL_LAYER
(
GP_OVERLAY
),
KiGfx
::
TARGET_OVERLAY
);
// Apply layer coloring scheme & display options
// Apply layer coloring scheme & display options
if
(
view
->
GetPainter
()
)
if
(
view
->
GetPainter
()
)
...
...
pcbnew/tools/selection_area.cpp
View file @
16437e5d
...
@@ -33,8 +33,8 @@ using namespace KiGfx;
...
@@ -33,8 +33,8 @@ using namespace KiGfx;
const
BOX2I
SELECTION_AREA
::
ViewBBox
()
const
const
BOX2I
SELECTION_AREA
::
ViewBBox
()
const
{
{
BOX2I
tmp
;
BOX2I
tmp
;
tmp
.
SetOrigin
(
m_origin
);
tmp
.
SetOrigin
(
m_origin
);
tmp
.
SetEnd
(
m_end
);
tmp
.
SetEnd
(
m_end
);
tmp
.
Normalize
();
tmp
.
Normalize
();
return
tmp
;
return
tmp
;
}
}
...
@@ -49,14 +49,12 @@ void SELECTION_AREA::ViewGetLayers( int aLayers[], int& aCount ) const
...
@@ -49,14 +49,12 @@ void SELECTION_AREA::ViewGetLayers( int aLayers[], int& aCount ) const
void
SELECTION_AREA
::
ViewDraw
(
int
aLayer
,
GAL
*
aGal
,
const
BOX2I
&
aVisibleArea
)
const
void
SELECTION_AREA
::
ViewDraw
(
int
aLayer
,
GAL
*
aGal
,
const
BOX2I
&
aVisibleArea
)
const
{
{
VECTOR2D
width
=
m_view
->
ToWorld
(
VECTOR2D
(
1.0
,
1.0
),
false
);
// fixme: pixel-sized stroke width setting?
aGal
->
SetLineWidth
(
1.0
);
aGal
->
SetLineWidth
(
width
.
x
);
aGal
->
SetStrokeColor
(
COLOR4D
(
1.0
,
1.0
,
0.4
,
1.0
)
);
aGal
->
SetStrokeColor
(
COLOR4D
(
1.0
,
1.0
,
0.4
,
1.0
));
aGal
->
SetFillColor
(
COLOR4D
(
0.3
,
0.3
,
0.5
,
0.3
)
);
aGal
->
SetFillColor
(
COLOR4D
(
0.3
,
0.3
,
0.5
,
0.3
));
aGal
->
SetIsStroke
(
true
);
aGal
->
SetIsStroke
(
true
);
aGal
->
SetIsFill
(
true
);
aGal
->
SetIsFill
(
true
);
aGal
->
DrawRectangle
(
m_origin
,
m_end
);
aGal
->
SetLayerDepth
(
100.0
);
aGal
->
DrawRectangle
(
m_origin
,
m_end
);
}
}
...
...
pcbnew/tools/selection_area.h
View file @
16437e5d
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include <view/view.h>
#include <view/view.h>
#include <gal/graphics_abstraction_layer.h>
#include <gal/graphics_abstraction_layer.h>
#include <base_struct.h>
#include <base_struct.h>
#include <layers_id_colors_and_visibility.h>
/**
/**
* Class SELECTION_AREA
* Class SELECTION_AREA
...
@@ -42,7 +43,7 @@
...
@@ -42,7 +43,7 @@
class
SELECTION_AREA
:
public
EDA_ITEM
class
SELECTION_AREA
:
public
EDA_ITEM
{
{
public
:
public
:
static
const
int
SelectionLayer
=
126
;
// fixme: define globally
static
const
int
SelectionLayer
=
ITEM_GAL_LAYER
(
GP_OVERLAY
);
SELECTION_AREA
();
SELECTION_AREA
();
~
SELECTION_AREA
()
{};
~
SELECTION_AREA
()
{};
...
@@ -62,7 +63,7 @@ public:
...
@@ -62,7 +63,7 @@ public:
m_end
=
aEnd
;
m_end
=
aEnd
;
}
}
void
Show
(
int
x
,
std
::
ostream
&
st
)
const
void
Show
(
int
x
,
std
::
ostream
&
st
)
const
{
{
}
}
...
...
pcbnew/tools/selection_tool.cpp
View file @
16437e5d
...
@@ -199,10 +199,6 @@ void SELECTION_TOOL::selectMultiple()
...
@@ -199,10 +199,6 @@ void SELECTION_TOOL::selectMultiple()
m_selArea
->
SetEnd
(
evt
->
Position
()
);
m_selArea
->
SetEnd
(
evt
->
Position
()
);
m_selArea
->
ViewSetVisible
(
true
);
m_selArea
->
ViewSetVisible
(
true
);
m_selArea
->
ViewUpdate
(
VIEW_ITEM
::
APPEARANCE
|
VIEW_ITEM
::
GEOMETRY
);
m_selArea
->
ViewUpdate
(
VIEW_ITEM
::
APPEARANCE
|
VIEW_ITEM
::
GEOMETRY
);
v
->
SetLayerVisible
(
SELECTION_AREA
::
SelectionLayer
);
v
->
SetLayerOrder
(
SELECTION_AREA
::
SelectionLayer
,
1000
);
v
->
SetLayerTarget
(
SELECTION_AREA
::
SelectionLayer
,
TARGET_OVERLAY
);
}
}
if
(
evt
->
IsMouseUp
(
MB_Left
)
)
if
(
evt
->
IsMouseUp
(
MB_Left
)
)
...
...
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