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
e050133c
Commit
e050133c
authored
Aug 07, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified color computation.
parent
8ab98ae6
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
128 deletions
+67
-128
painter.cpp
common/painter.cpp
+1
-1
painter.h
include/painter.h
+8
-19
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+46
-81
pcb_painter.h
pcbnew/pcb_painter.h
+12
-27
No files found.
common/painter.cpp
View file @
e050133c
...
...
@@ -57,7 +57,7 @@ RENDER_SETTINGS::~RENDER_SETTINGS()
}
void
RENDER_SETTINGS
::
U
pdate
()
void
RENDER_SETTINGS
::
u
pdate
()
{
m_hiContrastColor
=
COLOR4D
(
m_hiContrastFactor
,
m_hiContrastFactor
,
m_highlightFactor
,
m_layerOpacity
);
...
...
include/painter.h
View file @
e050133c
...
...
@@ -59,13 +59,6 @@ public:
RENDER_SETTINGS
();
virtual
~
RENDER_SETTINGS
();
/**
* Function Update
* Precalculates extra colors for layers (eg. highlighted, darkened and any needed version
* of base colors).
*/
virtual
void
Update
();
/**
* Function ImportLegacyColors
* Loads a list of color settings for layers.
...
...
@@ -122,6 +115,13 @@ public:
}
protected
:
/**
* Function update
* Precalculates extra colors for layers (eg. highlighted, darkened and any needed version
* of base colors).
*/
virtual
void
update
();
std
::
set
<
unsigned
int
>
m_activeLayers
;
/// Stores active layers number
/// Parameters for display modes
...
...
@@ -138,8 +138,7 @@ protected:
COLOR4D
m_selectionBorderColor
;
/// Color of selection box border
float
m_selectFactor
;
/// Specifies how color of selected items is changed
float
m_layerOpacity
;
/// Determines opacity of all layers, so every can be seen
/// at the same time
float
m_layerOpacity
;
/// Determines opacity of all layers
float
m_outlineWidth
;
/// Line width used when drawing outlines
/// Map of colors that were usually used for display
...
...
@@ -226,16 +225,6 @@ public:
virtual
const
COLOR4D
&
GetColor
(
const
VIEW_ITEM
*
aItem
,
int
aLayer
)
=
0
;
protected
:
/**
* Function getLayerColor
* is used for obtaining color that should be used for specific layer/net
* combination using stored color settings.
* @param aLayer is the layer number that is being drawn.
* @param aNetCode is a number of the net that is being drawn.
* @param aHighlighted says if the item is marked as highlighted.
*/
virtual
const
COLOR4D
&
getLayerColor
(
int
aLayer
,
int
aNetCode
,
bool
aHighlighted
)
const
=
0
;
/// Instance of graphic abstraction layer that gives an interface to call
/// commands used to draw (eg. DrawLine, DrawCircle, etc.)
GAL
*
m_gal
;
...
...
pcbnew/pcb_painter.cpp
View file @
e050133c
This diff is collapsed.
Click to expand it.
pcbnew/pcb_painter.h
View file @
e050133c
...
...
@@ -27,10 +27,8 @@
#define __CLASS_PCB_PAINTER_H
#include <layers_id_colors_and_visibility.h>
#include <painter.h>
class
EDA_ITEM
;
class
COLORS_DESIGN_SETTINGS
;
class
DISPLAY_OPTIONS
;
...
...
@@ -76,9 +74,6 @@ public:
PCB_RENDER_SETTINGS
();
/// @copydoc RENDER_SETTINGS::Update()
void
Update
();
/// @copydoc RENDER_SETTINGS::ImportLegacyColors()
void
ImportLegacyColors
(
COLORS_DESIGN_SETTINGS
*
aSettings
);
...
...
@@ -91,23 +86,24 @@ public:
void
LoadDisplayOptions
(
const
DISPLAY_OPTIONS
&
aOptions
);
protected
:
/// @copydoc RENDER_SETTINGS::Update()
void
update
();
/// Colors for all layers (including special, highlighted & darkened versions)
COLOR4D
m_layerColors
[
NB_LAYERS
];
COLOR4D
m_layerColorsHi
[
NB_LAYERS
];
COLOR4D
m_layerColorsSel
[
NB_LAYERS
];
COLOR4D
m_layerColorsDark
[
NB_LAYERS
];
COLOR4D
m_itemColors
[
END_PCB_VISIBLE_LIST
];
COLOR4D
m_itemColorsHi
[
END_PCB_VISIBLE_LIST
];
COLOR4D
m_itemColorsSel
[
END_PCB_VISIBLE_LIST
];
COLOR4D
m_itemColorsDark
[
END_PCB_VISIBLE_LIST
];
bool
m_sketchModeSelect
[
END_PCB_VISIBLE_LIST
];
COLOR4D
m_layerColors
[
TOTAL_LAYER_COUNT
];
COLOR4D
m_layerColorsHi
[
TOTAL_LAYER_COUNT
];
COLOR4D
m_layerColorsSel
[
TOTAL_LAYER_COUNT
];
COLOR4D
m_layerColorsDark
[
TOTAL_LAYER_COUNT
];
bool
m_sketchModeSelect
[
TOTAL_LAYER_COUNT
];
bool
m_padNumbers
;
bool
m_netNamesOnPads
;
bool
m_netNamesOnTracks
;
/// Maximum font size for netnames (and other dynamically shown strings)
static
const
double
MAX_FONT_SIZE
=
100000000
;
/// Option for different display modes for zones
DisplayZonesMode
m_displayZoneMode
;
};
...
...
@@ -131,7 +127,7 @@ public:
PAINTER
::
ApplySettings
(
aSettings
);
// Store PCB specific render settings
m_pcbSettings
=
dynamic_cast
<
PCB_RENDER_SETTINGS
*>
(
aSettings
);
m_pcbSettings
=
dynamic_cast
<
PCB_RENDER_SETTINGS
*>
(
aSettings
);
}
/// @copydoc PAINTER::GetColor()
...
...
@@ -140,17 +136,6 @@ public:
protected
:
PCB_RENDER_SETTINGS
*
m_pcbSettings
;
/// @copydoc PAINTER::getLayerColor()
const
COLOR4D
&
getLayerColor
(
int
aLayer
,
int
aNetCode
,
bool
aHighlighted
)
const
;
/**
* Function getItemColor
* Returns color for a special layer (eg. vias/pads holes, texts on front/bottom layer, etc.)
* @param aItemType Layer number of the item to be drawn.
* @param aNetCode Net number of the item to be drawn.
*/
const
COLOR4D
&
getItemColor
(
int
aItemType
,
int
aNetCode
,
bool
aHighlighted
)
const
;
// Drawing functions for various types of PCB-specific items
void
draw
(
const
TRACK
*
,
int
);
void
draw
(
const
SEGVIA
*
,
int
);
...
...
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