Commit e050133c authored by Maciej Suminski's avatar Maciej Suminski

Simplified color computation.

parent 8ab98ae6
...@@ -57,7 +57,7 @@ RENDER_SETTINGS::~RENDER_SETTINGS() ...@@ -57,7 +57,7 @@ RENDER_SETTINGS::~RENDER_SETTINGS()
} }
void RENDER_SETTINGS::Update() void RENDER_SETTINGS::update()
{ {
m_hiContrastColor = COLOR4D( m_hiContrastFactor, m_hiContrastFactor, m_highlightFactor, m_hiContrastColor = COLOR4D( m_hiContrastFactor, m_hiContrastFactor, m_highlightFactor,
m_layerOpacity ); m_layerOpacity );
......
...@@ -59,13 +59,6 @@ public: ...@@ -59,13 +59,6 @@ public:
RENDER_SETTINGS(); RENDER_SETTINGS();
virtual ~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 * Function ImportLegacyColors
* Loads a list of color settings for layers. * Loads a list of color settings for layers.
...@@ -122,6 +115,13 @@ public: ...@@ -122,6 +115,13 @@ public:
} }
protected: 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 std::set<unsigned int> m_activeLayers; /// Stores active layers number
/// Parameters for display modes /// Parameters for display modes
...@@ -138,8 +138,7 @@ protected: ...@@ -138,8 +138,7 @@ protected:
COLOR4D m_selectionBorderColor; /// Color of selection box border COLOR4D m_selectionBorderColor; /// Color of selection box border
float m_selectFactor; /// Specifies how color of selected items is changed float m_selectFactor; /// Specifies how color of selected items is changed
float m_layerOpacity; /// Determines opacity of all layers, so every can be seen float m_layerOpacity; /// Determines opacity of all layers
/// at the same time
float m_outlineWidth; /// Line width used when drawing outlines float m_outlineWidth; /// Line width used when drawing outlines
/// Map of colors that were usually used for display /// Map of colors that were usually used for display
...@@ -226,16 +225,6 @@ public: ...@@ -226,16 +225,6 @@ public:
virtual const COLOR4D& GetColor( const VIEW_ITEM* aItem, int aLayer ) = 0; virtual const COLOR4D& GetColor( const VIEW_ITEM* aItem, int aLayer ) = 0;
protected: 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 /// Instance of graphic abstraction layer that gives an interface to call
/// commands used to draw (eg. DrawLine, DrawCircle, etc.) /// commands used to draw (eg. DrawLine, DrawCircle, etc.)
GAL* m_gal; GAL* m_gal;
......
This diff is collapsed.
...@@ -27,10 +27,8 @@ ...@@ -27,10 +27,8 @@
#define __CLASS_PCB_PAINTER_H #define __CLASS_PCB_PAINTER_H
#include <layers_id_colors_and_visibility.h> #include <layers_id_colors_and_visibility.h>
#include <painter.h> #include <painter.h>
class EDA_ITEM; class EDA_ITEM;
class COLORS_DESIGN_SETTINGS; class COLORS_DESIGN_SETTINGS;
class DISPLAY_OPTIONS; class DISPLAY_OPTIONS;
...@@ -76,9 +74,6 @@ public: ...@@ -76,9 +74,6 @@ public:
PCB_RENDER_SETTINGS(); PCB_RENDER_SETTINGS();
/// @copydoc RENDER_SETTINGS::Update()
void Update();
/// @copydoc RENDER_SETTINGS::ImportLegacyColors() /// @copydoc RENDER_SETTINGS::ImportLegacyColors()
void ImportLegacyColors( COLORS_DESIGN_SETTINGS* aSettings ); void ImportLegacyColors( COLORS_DESIGN_SETTINGS* aSettings );
...@@ -91,23 +86,24 @@ public: ...@@ -91,23 +86,24 @@ public:
void LoadDisplayOptions( const DISPLAY_OPTIONS& aOptions ); void LoadDisplayOptions( const DISPLAY_OPTIONS& aOptions );
protected: protected:
/// @copydoc RENDER_SETTINGS::Update()
void update();
/// 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 [TOTAL_LAYER_COUNT];
COLOR4D m_layerColorsHi [NB_LAYERS]; COLOR4D m_layerColorsHi [TOTAL_LAYER_COUNT];
COLOR4D m_layerColorsSel [NB_LAYERS]; COLOR4D m_layerColorsSel [TOTAL_LAYER_COUNT];
COLOR4D m_layerColorsDark[NB_LAYERS]; COLOR4D m_layerColorsDark[TOTAL_LAYER_COUNT];
COLOR4D m_itemColors [END_PCB_VISIBLE_LIST];
COLOR4D m_itemColorsHi [END_PCB_VISIBLE_LIST]; bool m_sketchModeSelect[TOTAL_LAYER_COUNT];
COLOR4D m_itemColorsSel [END_PCB_VISIBLE_LIST];
COLOR4D m_itemColorsDark [END_PCB_VISIBLE_LIST];
bool m_sketchModeSelect[END_PCB_VISIBLE_LIST];
bool m_padNumbers; bool m_padNumbers;
bool m_netNamesOnPads; bool m_netNamesOnPads;
bool m_netNamesOnTracks; bool m_netNamesOnTracks;
/// Maximum font size for netnames (and other dynamically shown strings)
static const double MAX_FONT_SIZE = 100000000; static const double MAX_FONT_SIZE = 100000000;
/// Option for different display modes for zones
DisplayZonesMode m_displayZoneMode; DisplayZonesMode m_displayZoneMode;
}; };
...@@ -131,7 +127,7 @@ public: ...@@ -131,7 +127,7 @@ public:
PAINTER::ApplySettings( aSettings ); PAINTER::ApplySettings( aSettings );
// Store PCB specific render settings // Store PCB specific render settings
m_pcbSettings = dynamic_cast<PCB_RENDER_SETTINGS*> ( aSettings ); m_pcbSettings = dynamic_cast<PCB_RENDER_SETTINGS*>( aSettings );
} }
/// @copydoc PAINTER::GetColor() /// @copydoc PAINTER::GetColor()
...@@ -140,17 +136,6 @@ public: ...@@ -140,17 +136,6 @@ public:
protected: protected:
PCB_RENDER_SETTINGS* m_pcbSettings; 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 // Drawing functions for various types of PCB-specific items
void draw( const TRACK*, int ); void draw( const TRACK*, int );
void draw( const SEGVIA*, int ); void draw( const SEGVIA*, int );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment