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
cc5c0383
Commit
cc5c0383
authored
Aug 08, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added selection box for modules.
parent
16437e5d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
0 deletions
+29
-0
class_module.cpp
pcbnew/class_module.cpp
+6
-0
class_module.h
pcbnew/class_module.h
+3
-0
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+19
-0
pcb_painter.h
pcbnew/pcb_painter.h
+1
-0
No files found.
pcbnew/class_module.cpp
View file @
cc5c0383
...
...
@@ -1024,3 +1024,9 @@ void MODULE::SetOrientation( double newangle )
CalculateBoundingBox
();
}
void
MODULE
::
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
{
aCount
=
1
;
aLayers
[
0
]
=
ITEM_GAL_LAYER
(
GP_OVERLAY
);
// Selection box
}
pcbnew/class_module.h
View file @
cc5c0383
...
...
@@ -497,6 +497,9 @@ public:
/// Return the initial comments block or NULL if none, without transfer of ownership.
const
wxArrayString
*
GetInitialComments
()
const
{
return
m_initial_comments
;
}
/// @copydoc VIEW_ITEM::ViewGetLayers()
virtual
void
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
;
#if defined(DEBUG)
virtual
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
)
const
{
ShowDummy
(
os
);
}
// override
#endif
...
...
pcbnew/pcb_painter.cpp
View file @
cc5c0383
...
...
@@ -219,6 +219,10 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
draw
(
(
DRAWSEGMENT
*
)
aItem
);
break
;
case
PCB_MODULE_T
:
draw
(
(
MODULE
*
)
aItem
);
break
;
case
PCB_TEXT_T
:
draw
(
(
TEXTE_PCB
*
)
aItem
);
break
;
...
...
@@ -654,6 +658,21 @@ void PCB_PAINTER::draw( const DRAWSEGMENT* aSegment )
}
void
PCB_PAINTER
::
draw
(
const
MODULE
*
aModule
)
{
// For modules we have to draw a selection box if needed
if
(
aModule
->
IsSelected
()
)
{
BOX2I
boundingBox
=
aModule
->
ViewBBox
();
m_gal
->
SetIsStroke
(
false
);
m_gal
->
SetIsFill
(
true
);
m_gal
->
SetFillColor
(
COLOR4D
(
1.0
,
1.0
,
1.0
,
0.5
)
);
m_gal
->
DrawRectangle
(
boundingBox
.
GetOrigin
(),
boundingBox
.
GetEnd
()
);
}
}
void
PCB_PAINTER
::
draw
(
const
TEXTE_PCB
*
aText
)
{
if
(
aText
->
GetText
().
Length
()
==
0
)
...
...
pcbnew/pcb_painter.h
View file @
cc5c0383
...
...
@@ -141,6 +141,7 @@ protected:
void
draw
(
const
SEGVIA
*
,
int
);
void
draw
(
const
D_PAD
*
,
int
);
void
draw
(
const
DRAWSEGMENT
*
);
void
draw
(
const
MODULE
*
);
void
draw
(
const
TEXTE_PCB
*
);
void
draw
(
const
TEXTE_MODULE
*
,
int
);
void
draw
(
const
ZONE_CONTAINER
*
);
...
...
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