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
a42a83a3
Commit
a42a83a3
authored
Feb 25, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes to BRIGHT_BOX class.
parent
c5a3c108
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
26 deletions
+20
-26
bright_box.cpp
pcbnew/tools/bright_box.cpp
+7
-20
bright_box.h
pcbnew/tools/bright_box.h
+13
-6
No files found.
pcbnew/tools/bright_box.cpp
View file @
a42a83a3
...
@@ -30,44 +30,31 @@ using namespace KIGFX;
...
@@ -30,44 +30,31 @@ using namespace KIGFX;
BRIGHT_BOX
::
BRIGHT_BOX
(
BOARD_ITEM
*
aItem
)
:
BRIGHT_BOX
::
BRIGHT_BOX
(
BOARD_ITEM
*
aItem
)
:
EDA_ITEM
(
NOT_USED
),
// this item is never added to a BOARD so it needs no type
EDA_ITEM
(
NOT_USED
),
// this item is never added to a BOARD so it needs no type
item
(
aItem
)
m_
item
(
aItem
)
{
{
}
}
const
BOX2I
BRIGHT_BOX
::
ViewBBox
()
const
{
return
item
->
ViewBBox
();
}
void
BRIGHT_BOX
::
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
{
aLayers
[
0
]
=
BrightBoxLayer
;
aCount
=
1
;
}
void
BRIGHT_BOX
::
ViewDraw
(
int
aLayer
,
GAL
*
aGal
)
const
void
BRIGHT_BOX
::
ViewDraw
(
int
aLayer
,
GAL
*
aGal
)
const
{
{
aGal
->
SetIsStroke
(
true
);
aGal
->
SetIsStroke
(
true
);
aGal
->
SetIsFill
(
false
);
aGal
->
SetIsFill
(
false
);
aGal
->
SetLineWidth
(
L
ineWidth
);
aGal
->
SetLineWidth
(
L
INE_WIDTH
);
aGal
->
SetStrokeColor
(
B
rightColor
);
aGal
->
SetStrokeColor
(
B
OX_COLOR
);
if
(
item
->
Type
()
==
PCB_TRACE_T
)
if
(
m_
item
->
Type
()
==
PCB_TRACE_T
)
{
{
const
TRACK
*
track
=
static_cast
<
const
TRACK
*>
(
item
);
const
TRACK
*
track
=
static_cast
<
const
TRACK
*>
(
m_
item
);
aGal
->
DrawSegment
(
track
->
GetStart
(),
track
->
GetEnd
(),
track
->
GetWidth
()
);
aGal
->
DrawSegment
(
track
->
GetStart
(),
track
->
GetEnd
(),
track
->
GetWidth
()
);
}
}
else
else
{
{
BOX2I
box
=
item
->
ViewBBox
();
BOX2I
box
=
m_
item
->
ViewBBox
();
aGal
->
DrawRectangle
(
box
.
GetOrigin
(),
box
.
GetOrigin
()
+
box
.
GetSize
()
);
aGal
->
DrawRectangle
(
box
.
GetOrigin
(),
box
.
GetOrigin
()
+
box
.
GetSize
()
);
}
}
}
}
const
COLOR4D
BRIGHT_BOX
::
B
rightColor
=
KIGFX
::
COLOR4D
(
0.0
,
1.0
,
0.0
,
1.0
);
const
COLOR4D
BRIGHT_BOX
::
B
OX_COLOR
=
KIGFX
::
COLOR4D
(
0.0
,
1.0
,
0.0
,
1.0
);
pcbnew/tools/bright_box.h
View file @
a42a83a3
...
@@ -42,21 +42,28 @@ public:
...
@@ -42,21 +42,28 @@ public:
BRIGHT_BOX
(
BOARD_ITEM
*
aItem
);
BRIGHT_BOX
(
BOARD_ITEM
*
aItem
);
~
BRIGHT_BOX
()
{};
~
BRIGHT_BOX
()
{};
virtual
const
BOX2I
ViewBBox
()
const
;
virtual
const
BOX2I
ViewBBox
()
const
{
return
m_item
->
ViewBBox
();
}
void
ViewDraw
(
int
aLayer
,
KIGFX
::
GAL
*
aGal
)
const
;
void
ViewDraw
(
int
aLayer
,
KIGFX
::
GAL
*
aGal
)
const
;
void
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
;
void
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
{
aLayers
[
0
]
=
ITEM_GAL_LAYER
(
GP_OVERLAY
);
aCount
=
1
;
}
void
Show
(
int
x
,
std
::
ostream
&
st
)
const
void
Show
(
int
x
,
std
::
ostream
&
st
)
const
{
{
}
}
private
:
private
:
static
const
int
BrightBoxLayer
=
ITEM_GAL_LAYER
(
GP_OVERLAY
);
static
const
KIGFX
::
COLOR4D
BOX_COLOR
;
static
const
KIGFX
::
COLOR4D
BrightColor
;
static
const
double
LINE_WIDTH
=
100000
.
0
;
static
const
double
LineWidth
=
100000
.
0
;
BOARD_ITEM
*
item
;
BOARD_ITEM
*
m_
item
;
};
};
#endif
#endif
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