7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 19:05:32 +00:00

Refactor layer enumerations to all live in the same place

This commit is contained in:
Jon Evans 2017-03-12 23:19:33 -04:00 committed by Wayne Stambaugh
parent 40f60c9871
commit 3ec28e2acf
168 changed files with 1302 additions and 1290 deletions
3d-viewer
common
eeschema
gerbview
include
pcbnew
autorouter
basepcbframe.cppblock.cppboard_items_to_polygon_shape_transform.cppclass_board.cppclass_board.hclass_board_design_settings.cppclass_dimension.cppclass_dimension.hclass_drawsegment.cppclass_edge_mod.cppclass_marker_pcb.cppclass_marker_pcb.hclass_mire.cppclass_mire.hclass_module.cppclass_module.hclass_netinfo_item.cppclass_pad.cppclass_pad.hclass_pad_draw_functions.cppclass_pcb_layer_box_selector.cppclass_pcb_layer_widget.cppclass_pcb_layer_widget.hclass_pcb_text.cppclass_text_mod.cppclass_track.cppclass_track.hclass_zone.cppclass_zone_settings.hclean.cppcollectors.cppcollectors.hdeltrack.cpp
dialogs
dimension.cppdrc_clearance_test_functions.cppeagle_plugin.cppeagle_plugin.hedgemod.cppedit.cppedit_pcb_text.cppeditedge.cppeditrack-part2.cpp
exporters
files.cppfootprint_wizard_frame.cppinitpcb.cppkicad_plugin.cpplegacy_plugin.cpplegacy_plugin.hmagnetic_tracks_functions.cppmodedit.cppmodule_editor_frame.hmoduleframe.cppmodules.cppmodview_frame.cpp
pcad2kicadpcb_plugin
pcb_draw_panel_gal.cpppcb_draw_panel_gal.hpcb_painter.cpppcb_painter.hpcb_parser.cpppcb_parser.hpcbframe.cpppcbnew.cpppcbnew.hpcbnew_config.cpppcbnew_config.hpcbplot.hplot_board_layers.cppplot_brditems_plotter.cppprint_board_functions.cppprintout_controler.cppratsnest.cppratsnest_viewitem.cpp
router
sel_layer.cppspecctra.cppspecctra.hspecctra_export.cppspecctra_import.cppswap_layers.cpp
swig
tool_pcb.cpptoolbars_update_user_interface.cpp
tools
tracepcb.cppzones_by_polygon.cpp

View File

@ -120,9 +120,9 @@ CINFO3D_VISU::~CINFO3D_VISU()
}
bool CINFO3D_VISU::Is3DLayerEnabled( LAYER_ID aLayer ) const
bool CINFO3D_VISU::Is3DLayerEnabled( PCB_LAYER_ID aLayer ) const
{
wxASSERT( aLayer < LAYER_ID_COUNT );
wxASSERT( aLayer < PCB_LAYER_ID_COUNT );
DISPLAY3D_FLG flg;
@ -372,7 +372,7 @@ void CINFO3D_VISU::InitSettings( REPORTER *aStatusTextReporter )
// calculate z position for each non copper layer
// Solder mask and Solder paste have the same Z position
for( int layer_id = MAX_CU_LAYERS; layer_id < LAYER_ID_COUNT; ++layer_id )
for( int layer_id = MAX_CU_LAYERS; layer_id < PCB_LAYER_ID_COUNT; ++layer_id )
{
float zposTop;
float zposBottom;
@ -526,9 +526,9 @@ void CINFO3D_VISU::CameraSetType( CAMERA_TYPE aCameraType )
}
SFVEC3F CINFO3D_VISU::GetLayerColor( LAYER_ID aLayerId ) const
SFVEC3F CINFO3D_VISU::GetLayerColor( PCB_LAYER_ID aLayerId ) const
{
wxASSERT( aLayerId < LAYER_ID_COUNT );
wxASSERT( aLayerId < PCB_LAYER_ID_COUNT );
const COLOR4D color = g_ColorsSettings.GetLayerColor( aLayerId );

View File

@ -52,10 +52,10 @@
#include <reporter.h>
/// A type that stores a container of 2d objects for each layer id
typedef std::map< LAYER_ID, CBVHCONTAINER2D *> MAP_CONTAINER_2D;
typedef std::map< PCB_LAYER_ID, CBVHCONTAINER2D *> MAP_CONTAINER_2D;
/// A type that stores polysets for each layer id
typedef std::map< LAYER_ID, SHAPE_POLY_SET *> MAP_POLY;
typedef std::map< PCB_LAYER_ID, SHAPE_POLY_SET *> MAP_POLY;
/// This defines the range that all coord will have to be rendered.
/// It will use this value to convert to a normalized value between
@ -106,7 +106,7 @@ class CINFO3D_VISU
* @param aLayer: layer ID to get status
* @return true if layer should be displayed, false if not
*/
bool Is3DLayerEnabled( LAYER_ID aLayer ) const;
bool Is3DLayerEnabled( PCB_LAYER_ID aLayer ) const;
/**
* @brief ShouldModuleBeDisplayed - Test if module should be displayed in
@ -256,7 +256,7 @@ class CINFO3D_VISU
* @param aLayerId: the layer to get the color information
* @return the color in SFVEC3F format
*/
SFVEC3F GetLayerColor( LAYER_ID aLayerId ) const;
SFVEC3F GetLayerColor( PCB_LAYER_ID aLayerId ) const;
/**
* @brief GetItemColor - get the technical color of a layer
@ -277,14 +277,14 @@ class CINFO3D_VISU
* @param aLayerId: layer id
* @return position in 3D unities
*/
float GetLayerTopZpos3DU( LAYER_ID aLayerId ) const { return m_layerZcoordTop[aLayerId]; }
float GetLayerTopZpos3DU( PCB_LAYER_ID aLayerId ) const { return m_layerZcoordTop[aLayerId]; }
/**
* @brief GetLayerBottomZpos3DU - Get the bottom z position
* @param aLayerId: layer id
* @return position in 3D unities
*/
float GetLayerBottomZpos3DU( LAYER_ID aLayerId ) const { return m_layerZcoordBottom[aLayerId]; }
float GetLayerBottomZpos3DU( PCB_LAYER_ID aLayerId ) const { return m_layerZcoordBottom[aLayerId]; }
/**
* @brief GetMapLayers - Get the map of container that have the objects per layer
@ -437,33 +437,33 @@ class CINFO3D_VISU
void AddPadsShapesWithClearanceToContainer( const MODULE *aModule,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aInflateValue,
bool aSkipNPTHPadsWihNoCopper );
void AddGraphicsShapesWithClearanceToContainer( const MODULE *aModule,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aInflateValue );
void AddShapeWithClearanceToContainer( const TEXTE_PCB *aTextPCB,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aClearanceValue );
void AddShapeWithClearanceToContainer( const DRAWSEGMENT *aDrawSegment,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aClearanceValue );
void AddShapeWithClearanceToContainer( const DIMENSION *aDimension,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aClearanceValue );
void AddSolidAreasShapesToContainer( const ZONE_CONTAINER *aZoneContainer,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId );
PCB_LAYER_ID aLayerId );
void TransformArcToSegments( const wxPoint &aCentre,
const wxPoint &aStart,
@ -483,13 +483,13 @@ class CINFO3D_VISU
int aWidth) const;
void transformPadsShapesWithClearanceToPolygon( const DLIST<D_PAD> &aPads,
LAYER_ID aLayer,
PCB_LAYER_ID aLayer,
SHAPE_POLY_SET &aCornerBuffer,
int aInflateValue,
bool aSkipNPTHPadsWihNoCopper) const;
void transformGraphicModuleEdgeToPolygonSet( const MODULE *aModule,
LAYER_ID aLayer,
PCB_LAYER_ID aLayer,
SHAPE_POLY_SET& aCornerBuffer ) const;
void buildPadShapePolygon( const D_PAD *aPad,
@ -616,10 +616,10 @@ class CINFO3D_VISU
double m_biuTo3Dunits;
/// Top (End) Z position of each layer (normalized)
float m_layerZcoordTop[LAYER_ID_COUNT];
float m_layerZcoordTop[PCB_LAYER_ID_COUNT];
/// Bottom (Start) Z position of each layer (normalized)
float m_layerZcoordBottom[LAYER_ID_COUNT];
float m_layerZcoordBottom[PCB_LAYER_ID_COUNT];
/// Copper thickness (normalized)
float m_copperThickness3DU;

View File

@ -91,7 +91,7 @@ void addTextSegmToContainer( int x0, int y0, int xf, int yf )
// board_items_to_polygon_shape_transform.cpp
void CINFO3D_VISU::AddShapeWithClearanceToContainer( const TEXTE_PCB* aTextPCB,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aClearanceValue )
{
wxSize size = aTextPCB->GetTextSize();
@ -141,7 +141,7 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const TEXTE_PCB* aTextPCB,
void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DIMENSION* aDimension,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aClearanceValue )
{
AddShapeWithClearanceToContainer(&aDimension->Text(), aDstContainer, aLayerId, aClearanceValue);
@ -178,7 +178,7 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DIMENSION* aDimension
// board_items_to_polygon_shape_transform.cpp#L204
void CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer( const MODULE* aModule,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aInflateValue )
{
std::vector<TEXTE_MODULE *> texts; // List of TEXTE_MODULE to convert
@ -603,7 +603,7 @@ void CINFO3D_VISU::createNewPad( const D_PAD* aPad,
void CINFO3D_VISU::AddPadsShapesWithClearanceToContainer( const MODULE* aModule,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aInflateValue,
bool aSkipNPTHPadsWihNoCopper )
{
@ -745,7 +745,7 @@ void CINFO3D_VISU::TransformArcToSegments( const wxPoint &aCentre,
// board_items_to_polygon_shape_transform.cpp#L431
void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSegment,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId,
PCB_LAYER_ID aLayerId,
int aClearanceValue )
{
// The full width of the lines to create:
@ -909,7 +909,7 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSeg
// board_items_to_polygon_shape_transform.cpp
void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneContainer,
CGENERICCONTAINER2D *aDstContainer,
LAYER_ID aLayerId )
PCB_LAYER_ID aLayerId )
{
// Copy the polys list because we have to simplify it
SHAPE_POLY_SET polyList = SHAPE_POLY_SET(aZoneContainer->GetFilledPolysList());
@ -1164,7 +1164,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
unsigned start_Time = stats_startCopperLayersTime;
#endif
LAYER_ID cu_seq[MAX_CU_LAYERS];
PCB_LAYER_ID cu_seq[MAX_CU_LAYERS];
LSET cu_set = LSET::AllCuMask( m_copperLayersCount );
m_stats_nr_tracks = 0;
@ -1216,7 +1216,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// Prepare copper layers index and containers
// /////////////////////////////////////////////////////////////////////////
std::vector< LAYER_ID > layer_id;
std::vector< PCB_LAYER_ID > layer_id;
layer_id.clear();
layer_id.reserve( m_copperLayersCount );
@ -1225,7 +1225,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
for( LSEQ cu = cu_set.Seq( cu_seq, DIM( cu_seq ) ); cu; ++cu )
{
const LAYER_ID curr_layer_id = *cu;
const PCB_LAYER_ID curr_layer_id = *cu;
if( !Is3DLayerEnabled( curr_layer_id ) ) // Skip non enabled layers
continue;
@ -1255,7 +1255,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
@ -1286,7 +1286,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
// ADD TRACKS
unsigned int nTracks = trackList.size();
@ -1370,7 +1370,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
// ADD TRACKS
const unsigned int nTracks = trackList.size();
@ -1481,7 +1481,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
{
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
@ -1599,7 +1599,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
@ -1636,7 +1636,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
{
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
@ -1679,7 +1679,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
@ -1739,7 +1739,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
{
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
@ -1800,7 +1800,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
if( aStatusTextReporter )
aStatusTextReporter->Report( wxString::Format( _( "Create zones of layer %s" ),
@ -1814,7 +1814,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
{
const ZONE_CONTAINER* zone = m_board->GetArea( ii );
const LAYER_ID zonelayer = zone->GetLayer();
const PCB_LAYER_ID zonelayer = zone->GetLayer();
if( zonelayer == curr_layer_id )
{
@ -1839,7 +1839,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
// /////////////////////////////////////////////////////////////////////
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
@ -1880,7 +1880,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
#pragma omp parallel for
for( signed int lIdx = 0; lIdx < nLayers; ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
wxASSERT( m_layers_poly.find( curr_layer_id ) != m_layers_poly.end() );
@ -1905,7 +1905,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
for( unsigned int lIdx = 0; lIdx < layer_id.size(); ++lIdx )
{
const LAYER_ID curr_layer_id = layer_id[lIdx];
const PCB_LAYER_ID curr_layer_id = layer_id[lIdx];
if( m_layers_outer_holes_poly.find( curr_layer_id ) !=
m_layers_outer_holes_poly.end() )
@ -1951,7 +1951,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
aStatusTextReporter->Report( _( "Build Tech layers" ) );
// draw graphic items, on technical layers
static const LAYER_ID teckLayerList[] = {
static const PCB_LAYER_ID teckLayerList[] = {
B_Adhes,
F_Adhes,
B_Paste,
@ -1975,7 +1975,7 @@ void CINFO3D_VISU::createLayers( REPORTER *aStatusTextReporter )
seq;
++seq )
{
const LAYER_ID curr_layer_id = *seq;
const PCB_LAYER_ID curr_layer_id = *seq;
if( !Is3DLayerEnabled( curr_layer_id ) )
continue;

View File

@ -125,7 +125,7 @@ void CINFO3D_VISU::buildPadShapeThickOutlineAsPolygon( const D_PAD* aPad,
// Based on the same function name in board_items_to_polyshape_transform.cpp
// It was implemented here to allow dynamic segments count per pad shape
void CINFO3D_VISU::transformPadsShapesWithClearanceToPolygon( const DLIST<D_PAD>& aPads, LAYER_ID aLayer,
void CINFO3D_VISU::transformPadsShapesWithClearanceToPolygon( const DLIST<D_PAD>& aPads, PCB_LAYER_ID aLayer,
SHAPE_POLY_SET& aCornerBuffer,
int aInflateValue,
bool aSkipNPTHPadsWihNoCopper ) const
@ -191,7 +191,7 @@ void CINFO3D_VISU::transformPadsShapesWithClearanceToPolygon( const DLIST<D_PAD>
}
void CINFO3D_VISU::transformGraphicModuleEdgeToPolygonSet( const MODULE *aModule,
LAYER_ID aLayer,
PCB_LAYER_ID aLayer,
SHAPE_POLY_SET& aCornerBuffer ) const
{
for( const EDA_ITEM* item = aModule->GraphicalItems();

View File

@ -493,7 +493,7 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER *aStatusTextReporter )
ii != outerMapHoles.end();
++ii )
{
LAYER_ID layer_id = static_cast<LAYER_ID>(ii->first);
PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
const SHAPE_POLY_SET *poly = static_cast<const SHAPE_POLY_SET *>(ii->second);
const CBVHCONTAINER2D *container = map_holes.at( layer_id );
@ -511,7 +511,7 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER *aStatusTextReporter )
ii != innerMapHoles.end();
++ii )
{
LAYER_ID layer_id = static_cast<LAYER_ID>(ii->first);
PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
const SHAPE_POLY_SET *poly = static_cast<const SHAPE_POLY_SET *>(ii->second);
const CBVHCONTAINER2D *container = map_holes.at( layer_id );
@ -539,7 +539,7 @@ void C3D_RENDER_OGL_LEGACY::reload( REPORTER *aStatusTextReporter )
ii != m_settings.GetMapLayers().end();
++ii )
{
LAYER_ID layer_id = static_cast<LAYER_ID>(ii->first);
PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
if( !m_settings.Is3DLayerEnabled( layer_id ) )
continue;
@ -685,7 +685,7 @@ void C3D_RENDER_OGL_LEGACY::add_triangle_top_bot( CLAYER_TRIANGLES *aDst,
}
void C3D_RENDER_OGL_LEGACY::get_layer_z_pos ( LAYER_ID aLayerID,
void C3D_RENDER_OGL_LEGACY::get_layer_z_pos ( PCB_LAYER_ID aLayerID,
float &aOutZtop,
float &aOutZbot ) const
{
@ -773,7 +773,7 @@ void C3D_RENDER_OGL_LEGACY::generate_3D_Vias_and_Pads()
const SFVEC2F via_center( via->GetStart().x * m_settings.BiuTo3Dunits(),
-via->GetStart().y * m_settings.BiuTo3Dunits() );
LAYER_ID top_layer, bottom_layer;
PCB_LAYER_ID top_layer, bottom_layer;
via->LayerPair( &top_layer, &bottom_layer );
float ztop, zbot, dummy;

View File

@ -302,7 +302,7 @@ void C3D_RENDER_OGL_LEGACY::setupMaterials()
}
void C3D_RENDER_OGL_LEGACY::set_layer_material( LAYER_ID aLayerID )
void C3D_RENDER_OGL_LEGACY::set_layer_material( PCB_LAYER_ID aLayerID )
{
switch( aLayerID )
{
@ -360,7 +360,7 @@ void C3D_RENDER_OGL_LEGACY::set_layer_material( LAYER_ID aLayerID )
}
SFVEC3F C3D_RENDER_OGL_LEGACY::get_layer_color( LAYER_ID aLayerID )
SFVEC3F C3D_RENDER_OGL_LEGACY::get_layer_color( PCB_LAYER_ID aLayerID )
{
SFVEC3F layerColor = m_settings.GetLayerColor( aLayerID );
@ -623,7 +623,7 @@ bool C3D_RENDER_OGL_LEGACY::Redraw( bool aIsMoving,
++ii )
{
const LAYER_ID layer_id = (LAYER_ID)(ii->first);
const PCB_LAYER_ID layer_id = (PCB_LAYER_ID)(ii->first);
// Mask kayers are not processed here because they are a special case
if( (layer_id == B_Mask) || (layer_id == F_Mask) )
@ -918,7 +918,7 @@ void C3D_RENDER_OGL_LEGACY::ogl_free_all_display_lists()
}
void C3D_RENDER_OGL_LEGACY::render_solder_mask_layer( LAYER_ID aLayerID,
void C3D_RENDER_OGL_LEGACY::render_solder_mask_layer( PCB_LAYER_ID aLayerID,
float aZPosition,
bool aIsRenderingOnPreviewMode )
{

View File

@ -47,8 +47,8 @@
#include <map>
typedef std::map< LAYER_ID, CLAYERS_OGL_DISP_LISTS* > MAP_OGL_DISP_LISTS;
typedef std::map< LAYER_ID, CLAYER_TRIANGLES * > MAP_TRIANGLES;
typedef std::map< PCB_LAYER_ID, CLAYERS_OGL_DISP_LISTS* > MAP_OGL_DISP_LISTS;
typedef std::map< PCB_LAYER_ID, CLAYER_TRIANGLES * > MAP_TRIANGLES;
typedef std::map< wxString, C_OGL_3DMODEL * > MAP_3DMODEL;
#define SIZE_OF_CIRCLE_TEXTURE 1024
@ -148,11 +148,11 @@ private:
float aZtop,
float aZbot );
void render_solder_mask_layer( LAYER_ID aLayerID,
void render_solder_mask_layer( PCB_LAYER_ID aLayerID,
float aZPosition,
bool aIsRenderingOnPreviewMode );
void get_layer_z_pos( LAYER_ID aLayerID,
void get_layer_z_pos( PCB_LAYER_ID aLayerID,
float &aOutZtop,
float &aOutZbot ) const;
@ -208,12 +208,12 @@ private:
SMATERIAL m_GrayMaterial;
}m_materials;
void set_layer_material( LAYER_ID aLayerID );
SFVEC3F get_layer_color( LAYER_ID aLayerID );
void set_layer_material( PCB_LAYER_ID aLayerID );
SFVEC3F get_layer_color( PCB_LAYER_ID aLayerID );
public:
const MAP_OGL_DISP_LISTS &GetLayerDispListMap() const { return m_ogl_disp_lists_layers; }
const CLAYERS_OGL_DISP_LISTS *GetLayerDispList( LAYER_ID aLayerId ) const { return m_ogl_disp_lists_layers.at( aLayerId ); }
const CLAYERS_OGL_DISP_LISTS *GetLayerDispList( PCB_LAYER_ID aLayerId ) const { return m_ogl_disp_lists_layers.at( aLayerId ); }
const CLAYERS_OGL_DISP_LISTS *GetBoardDispList() const { return m_ogl_disp_list_board; }
};

View File

@ -442,7 +442,7 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
ii != m_settings.GetMapLayers().end();
++ii )
{
LAYER_ID layer_id = static_cast<LAYER_ID>(ii->first);
PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
// Mask kayers are not processed here because they are a special case
if( (layer_id == B_Mask) || (layer_id == F_Mask) )
@ -644,7 +644,7 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
ii != m_settings.GetMapLayers().end();
++ii )
{
LAYER_ID layer_id = static_cast<LAYER_ID>(ii->first);
PCB_LAYER_ID layer_id = static_cast<PCB_LAYER_ID>(ii->first);
const CBVHCONTAINER2D *containerLayer2d =
static_cast<const CBVHCONTAINER2D *>(ii->second);
@ -971,7 +971,7 @@ void C3D_RENDER_RAYTRACING::reload( REPORTER *aStatusTextReporter )
// 3d_draw_helper_functions.cpp
void C3D_RENDER_RAYTRACING::insert3DViaHole( const VIA* aVia )
{
LAYER_ID top_layer, bottom_layer;
PCB_LAYER_ID top_layer, bottom_layer;
int radiusBUI = (aVia->GetDrillValue() / 2);
aVia->LayerPair( &top_layer, &bottom_layer );
@ -1001,7 +1001,7 @@ void C3D_RENDER_RAYTRACING::insert3DViaHole( const VIA* aVia )
if( m_settings.GetFlag( FL_USE_REALISTIC_MODE ) )
objPtr->SetColor( ConvertSRGBToLinear( (SFVEC3F)m_settings.m_CopperColor ) );
else
objPtr->SetColor( ConvertSRGBToLinear( m_settings.GetItemColor( VIAS_VISIBLE + aVia->GetViaType() ) ) );
objPtr->SetColor( ConvertSRGBToLinear( m_settings.GetItemColor( LAYER_VIAS + aVia->GetViaType() ) ) );
m_object_container.Add( objPtr );
}
@ -1018,7 +1018,7 @@ void C3D_RENDER_RAYTRACING::insert3DPadHole( const D_PAD* aPad )
if( m_settings.GetFlag( FL_USE_REALISTIC_MODE ) )
objColor = (SFVEC3F)m_settings.m_CopperColor;
else
objColor = m_settings.GetItemColor( PADS_VISIBLE );
objColor = m_settings.GetItemColor( LAYER_PADS );
const wxSize drillsize = aPad->GetDrillSize();
const bool hasHole = drillsize.x && drillsize.y;

View File

@ -66,18 +66,18 @@ static const EDA_COLOR_T default_layer_color[] = {
static const EDA_COLOR_T default_items_color[] = {
LIGHTGRAY, // unused
CYAN, // VIA_MICROVIA_VISIBLE
BROWN, // VIA_BBLIND_VISIBLE
LIGHTGRAY, // VIA_THROUGH_VISIBLE
YELLOW, // NON_PLATED_VISIBLE
LIGHTGRAY, // MOD_TEXT_FR_VISIBLE
BLUE, // MOD_TEXT_BK_VISIBLE
DARKGRAY, // MOD_TEXT_INVISIBLE
BLUE, // ANCHOR_VISIBLE
RED, // PAD_FR_VISIBLE
GREEN, // PAD_BK_VISIBLE
LIGHTGRAY, // RATSNEST_VISIBLE
DARKGRAY, // GRID_VISIBLE
CYAN, // LAYER_VIA_MICROVIA
BROWN, // LAYER_VIA_BBLIND
LIGHTGRAY, // LAYER_VIA_THROUGH
YELLOW, // LAYER_NON_PLATED
LIGHTGRAY, // LAYER_MOD_TEXT_FR
BLUE, // LAYER_MOD_TEXT_BK
DARKGRAY, // LAYER_MOD_TEXT_INVISIBLE
BLUE, // LAYER_ANCHOR
RED, // LAYER_PAD_FR
GREEN, // LAYER_PAD_BK
LIGHTGRAY, // LAYER_RATSNEST
DARKGRAY, // LAYER_GRID
LIGHTRED, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY, LIGHTGRAY,
@ -88,7 +88,7 @@ static const EDA_COLOR_T default_items_color[] = {
COLORS_DESIGN_SETTINGS::COLORS_DESIGN_SETTINGS()
{
for( unsigned src = 0, dst = 0; dst < DIM(m_LayersColors); ++dst )
for( unsigned src = 0, dst = 0; dst < DIM( m_LayersColors ); ++dst )
{
m_LayersColors[dst] = COLOR4D( default_layer_color[src++] );
@ -96,19 +96,16 @@ COLORS_DESIGN_SETTINGS::COLORS_DESIGN_SETTINGS()
src = 0; // wrap the source.
}
for( unsigned src = 0, dst = 0; dst < DIM(m_ItemsColors); ++dst )
for( unsigned src = 0, dst = LAYER_VIAS; dst < DIM( default_items_color ); ++dst )
{
m_ItemsColors[dst] = COLOR4D( default_items_color[src++] );
if( src >= DIM( default_items_color ) )
src = 0;
m_LayersColors[dst] = COLOR4D( default_items_color[src++] );
}
}
COLOR4D COLORS_DESIGN_SETTINGS::GetLayerColor( LAYER_NUM aLayer ) const
{
if( (unsigned) aLayer < DIM(m_LayersColors) )
if( (unsigned) aLayer < DIM( m_LayersColors ) )
{
return m_LayersColors[aLayer];
}
@ -118,7 +115,7 @@ COLOR4D COLORS_DESIGN_SETTINGS::GetLayerColor( LAYER_NUM aLayer ) const
void COLORS_DESIGN_SETTINGS::SetLayerColor( LAYER_NUM aLayer, COLOR4D aColor )
{
if( (unsigned) aLayer < DIM(m_LayersColors) )
if( (unsigned) aLayer < DIM( m_LayersColors ) )
{
m_LayersColors[aLayer] = aColor;
}
@ -127,9 +124,9 @@ void COLORS_DESIGN_SETTINGS::SetLayerColor( LAYER_NUM aLayer, COLOR4D aColor )
COLOR4D COLORS_DESIGN_SETTINGS::GetItemColor( int aItemIdx ) const
{
if( (unsigned) aItemIdx < DIM( m_ItemsColors ) )
if( (unsigned) aItemIdx < DIM( m_LayersColors ) )
{
return m_ItemsColors[aItemIdx];
return m_LayersColors[aItemIdx];
}
return COLOR4D::UNSPECIFIED;
@ -138,9 +135,9 @@ COLOR4D COLORS_DESIGN_SETTINGS::GetItemColor( int aItemIdx ) const
void COLORS_DESIGN_SETTINGS::SetItemColor( int aItemIdx, COLOR4D aColor )
{
if( (unsigned) aItemIdx < DIM(m_ItemsColors) )
if( (unsigned) aItemIdx < DIM( m_LayersColors ) )
{
m_ItemsColors[aItemIdx] = aColor;
m_LayersColors[aItemIdx] = aColor;
}
}
@ -149,7 +146,4 @@ void COLORS_DESIGN_SETTINGS::SetAllColorsAs( COLOR4D aColor )
{
for( unsigned ii = 0; ii < DIM(m_LayersColors); ii++ )
m_LayersColors[ii] = aColor;
for( unsigned ii = 0; ii < DIM(m_ItemsColors); ii++ )
m_ItemsColors[ii] = aColor;
}

View File

@ -175,7 +175,7 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
m_gal->BeginDrawing();
m_gal->ClearScreen( settings->GetBackgroundColor() );
KIGFX::COLOR4D gridColor = settings->GetLayerColor( ITEM_GAL_LAYER( GRID_VISIBLE ) );
KIGFX::COLOR4D gridColor = settings->GetLayerColor( LAYER_GRID );
m_gal->SetGridColor( gridColor );
if( m_view->IsDirty() )

View File

@ -30,7 +30,7 @@
#include <class_board.h>
LSET::LSET( const LAYER_ID* aArray, unsigned aCount ) :
LSET::LSET( const PCB_LAYER_ID* aArray, unsigned aCount ) :
BASE_SET()
{
for( unsigned i=0; i<aCount; ++i )
@ -42,7 +42,7 @@ LSET::LSET( unsigned aIdCount, int aFirst, ... ) :
BASE_SET()
{
// The constructor, without the mandatory aFirst argument, could have been confused
// by the compiler with the LSET( LAYER_ID ). With aFirst, that ambiguity is not
// by the compiler with the LSET( PCB_LAYER_ID ). With aFirst, that ambiguity is not
// present. Therefore aIdCount must always be >=1.
wxASSERT_MSG( aIdCount > 0, wxT( "aIdCount must be >= 1" ) );
@ -56,11 +56,11 @@ LSET::LSET( unsigned aIdCount, int aFirst, ... ) :
for( unsigned i=0; i<aIdCount; ++i )
{
LAYER_ID id = (LAYER_ID) va_arg( ap, int );
PCB_LAYER_ID id = (PCB_LAYER_ID) va_arg( ap, int );
// printf( "%s: id:%d LAYER_ID_COUNT:%d\n", __func__, id, LAYER_ID_COUNT );
// printf( "%s: id:%d PCB_LAYER_ID_COUNT:%d\n", __func__, id, PCB_LAYER_ID_COUNT );
assert( unsigned( id ) < LAYER_ID_COUNT );
assert( unsigned( id ) < PCB_LAYER_ID_COUNT );
set( id );
}
@ -70,7 +70,7 @@ LSET::LSET( unsigned aIdCount, int aFirst, ... ) :
}
const wxChar* LSET::Name( LAYER_ID aLayerId )
const wxChar* LSET::Name( PCB_LAYER_ID aLayerId )
{
const wxChar* txt;
@ -135,6 +135,7 @@ const wxChar* LSET::Name( LAYER_ID aLayerId )
case B_Fab: txt = wxT( "B.Fab" ); break;
default:
std::cout << aLayerId << std::endl;
wxASSERT_MSG( 0, wxT( "aLayerId out of range" ) );
txt = wxT( "BAD INDEX!" ); break;
}
@ -146,7 +147,7 @@ const wxChar* LSET::Name( LAYER_ID aLayerId )
LSEQ LSET::CuStack() const
{
// desired sequence
static const LAYER_ID sequence[] = {
static const PCB_LAYER_ID sequence[] = {
F_Cu,
In1_Cu,
In2_Cu,
@ -188,7 +189,7 @@ LSEQ LSET::CuStack() const
LSEQ LSET::Technicals( LSET aSetToOmit ) const
{
// desired sequence
static const LAYER_ID sequence[] = {
static const PCB_LAYER_ID sequence[] = {
B_Adhes,
F_Adhes,
B_Paste,
@ -212,7 +213,7 @@ LSEQ LSET::Technicals( LSET aSetToOmit ) const
LSEQ LSET::Users() const
{
// desired
static const LAYER_ID sequence[] = {
static const PCB_LAYER_ID sequence[] = {
Dwgs_User,
Cmts_User,
Eco1_User,
@ -333,7 +334,7 @@ int LSET::ParseHex( const char* aStart, int aCount )
}
LSEQ LSET::Seq( const LAYER_ID* aWishListSequence, unsigned aCount ) const
LSEQ LSET::Seq( const PCB_LAYER_ID* aWishListSequence, unsigned aCount ) const
{
LSEQ ret;
@ -342,7 +343,7 @@ LSEQ LSET::Seq( const LAYER_ID* aWishListSequence, unsigned aCount ) const
for( unsigned i=0; i<aCount; ++i )
{
LAYER_ID id = aWishListSequence[i];
PCB_LAYER_ID id = aWishListSequence[i];
if( test( id ) )
{
@ -356,7 +357,7 @@ LSEQ LSET::Seq( const LAYER_ID* aWishListSequence, unsigned aCount ) const
for( unsigned i=0; i<aCount; ++i )
{
LAYER_ID id = aWishListSequence[i];
PCB_LAYER_ID id = aWishListSequence[i];
if( test( id ) )
ret.push_back( id );
@ -374,7 +375,7 @@ LSEQ LSET::Seq() const
for( unsigned i=0; i<size(); ++i )
{
if( test(i) )
ret.push_back( LAYER_ID( i ) );
ret.push_back( PCB_LAYER_ID( i ) );
}
return ret;
@ -384,7 +385,7 @@ LSEQ LSET::Seq() const
LSEQ LSET::SeqStackupBottom2Top() const
{
// bottom-to-top stack-up layers
static const LAYER_ID sequence[] = {
static const PCB_LAYER_ID sequence[] = {
B_Fab,
B_CrtYd,
B_Adhes,
@ -441,7 +442,7 @@ LSEQ LSET::SeqStackupBottom2Top() const
}
LAYER_ID FlipLayer( LAYER_ID aLayerId, int aCopperLayersCount )
PCB_LAYER_ID FlipLayer( PCB_LAYER_ID aLayerId, int aCopperLayersCount )
{
switch( aLayerId )
{
@ -470,7 +471,7 @@ LAYER_ID FlipLayer( LAYER_ID aLayerId, int aCopperLayersCount )
if( IsCopperLayer( aLayerId ) && aCopperLayersCount >= 4 )
{
// internal copper layers count is aCopperLayersCount-2
LAYER_ID fliplayer = LAYER_ID(aCopperLayersCount - 2 - ( aLayerId - In1_Cu ) );
PCB_LAYER_ID fliplayer = PCB_LAYER_ID(aCopperLayersCount - 2 - ( aLayerId - In1_Cu ) );
// Ensure fliplayer has a value which does not crash pcbnew:
if( fliplayer < F_Cu )
fliplayer = F_Cu;
@ -574,7 +575,7 @@ LSET FlipLayerMask( LSET aMask, int aCopperLayersCount )
}
LAYER_ID LSET::ExtractLayer() const
PCB_LAYER_ID LSET::ExtractLayer() const
{
unsigned set_count = count();
@ -586,7 +587,7 @@ LAYER_ID LSET::ExtractLayer() const
for( unsigned i=0; i < size(); ++i )
{
if( test( i ) )
return LAYER_ID( i );
return PCB_LAYER_ID( i );
}
wxASSERT( 0 ); // set_count was verified as 1 above, what did you break?
@ -597,7 +598,7 @@ LAYER_ID LSET::ExtractLayer() const
LSET LSET::InternalCuMask()
{
static const LAYER_ID cu_internals[] = {
static const PCB_LAYER_ID cu_internals[] = {
In1_Cu,
In2_Cu,
In3_Cu,
@ -750,22 +751,22 @@ LSET LSET::BackMask()
LSEQ LSET::UIOrder() const
{
LAYER_ID order[LAYER_ID_COUNT];
PCB_LAYER_ID order[PCB_LAYER_ID_COUNT];
// Assmuming that the LAYER_ID order is according to preferred UI order, as of
// Assmuming that the PCB_LAYER_ID order is according to preferred UI order, as of
// today this is true. When that becomes not true, its easy to change the order
// in here to compensate.
for( unsigned i=0; i<DIM(order); ++i )
order[i] = LAYER_ID( i );
order[i] = PCB_LAYER_ID( i );
return Seq( order, DIM( order ) );
}
LAYER_ID ToLAYER_ID( int aLayer )
PCB_LAYER_ID ToLAYER_ID( int aLayer )
{
wxASSERT( unsigned( aLayer ) < LAYER_ID_COUNT );
return LAYER_ID( aLayer );
wxASSERT( unsigned( aLayer ) < PCB_LAYER_ID_COUNT );
return PCB_LAYER_ID( aLayer );
}

View File

@ -55,7 +55,7 @@ void RENDER_SETTINGS::update()
m_layerOpacity );
// Calculate darkened/highlighted variants of layer colors
for( int i = 0; i < TOTAL_LAYER_COUNT; i++ )
for( int i = 0; i < LAYER_ID_COUNT; i++ )
{
m_layerColorsHi[i] = m_layerColors[i].Brightened( m_highlightFactor );
m_layerColorsDark[i] = m_layerColors[i].Darkened( 1.0 - m_highlightFactor );

View File

@ -222,7 +222,7 @@ const BOX2I RULER_ITEM::ViewBBox() const
void RULER_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const
{
aLayers[0] = ITEM_GAL_LAYER( GP_OVERLAY );
aLayers[0] = LAYER_GP_OVERLAY;
aCount = 1;
}

View File

@ -25,7 +25,6 @@
#include <gal/graphics_abstraction_layer.h>
#include <view/view.h>
#include <layers_id_colors_and_visibility.h>
using namespace KIGFX::PREVIEW;
@ -51,7 +50,7 @@ void SIMPLE_OVERLAY_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
void SIMPLE_OVERLAY_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const
{
static const int SelectionLayer = ITEM_GAL_LAYER( GP_OVERLAY );
static const int SelectionLayer = LAYER_GP_OVERLAY;
aLayers[0] = SelectionLayer;
aCount = 1;

View File

@ -117,10 +117,10 @@ principle should be easily implemented by adapting the current STL containers.
%template(intVector) std::vector<int>;
%template(str_utf8_Map) std::map< std::string,UTF8 >;
// wrapper of BASE_SEQ (see typedef std::vector<LAYER_ID> BASE_SEQ;)
%template(base_seqVect) std::vector<enum LAYER_ID>;
// wrapper of BASE_SEQ (see typedef std::vector<PCB_LAYER_ID> BASE_SEQ;)
%template(base_seqVect) std::vector<enum PCB_LAYER_ID>;
// TODO: wrapper of BASE_SET (see std::bitset<LAYER_ID_COUNT> BASE_SET;)
// TODO: wrapper of BASE_SET (see std::bitset<PCB_LAYER_ID_COUNT> BASE_SET;)
// KiCad plugin handling

View File

@ -41,7 +41,7 @@
using namespace KIGFX;
VIEW_GROUP::VIEW_GROUP( VIEW* aView ) :
m_layer( ITEM_GAL_LAYER( GP_OVERLAY ) )
m_layer( LAYER_GP_OVERLAY )
{
}

View File

@ -131,7 +131,7 @@ void WORKSHEET_VIEWITEM::ViewDraw( int aLayer, VIEW* aView ) const
void WORKSHEET_VIEWITEM::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 1;
aLayers[0] = ITEM_GAL_LAYER( WORKSHEET );
aLayers[0] = LAYER_WORKSHEET;
}

View File

@ -161,18 +161,20 @@ PGM_BASE& Pgm()
}
static COLOR4D s_layerColor[LAYERSCH_ID_COUNT];
static COLOR4D s_layerColor[SCH_LAYER_ID_COUNT];
COLOR4D GetLayerColor( LAYERSCH_ID aLayer )
COLOR4D GetLayerColor( SCH_LAYER_ID aLayer )
{
wxASSERT( unsigned( aLayer ) < DIM( s_layerColor ) );
return s_layerColor[aLayer];
unsigned layer = SCH_LAYER_INDEX( aLayer );
wxASSERT( layer < DIM( s_layerColor ) );
return s_layerColor[layer];
}
void SetLayerColor( COLOR4D aColor, LAYERSCH_ID aLayer )
void SetLayerColor( COLOR4D aColor, SCH_LAYER_ID aLayer )
{
wxASSERT( unsigned( aLayer ) < DIM( s_layerColor ) );
s_layerColor[aLayer] = aColor;
unsigned layer = SCH_LAYER_INDEX( aLayer );
wxASSERT( layer < DIM( s_layerColor ) );
s_layerColor[layer] = aColor;
}
@ -186,34 +188,35 @@ static PARAM_CFG_ARRAY& cfg_params()
// eeschema KIFACE comes in.
#define CLR(x, y, z)\
ca.push_back( new PARAM_CFG_SETCOLOR( true, wxT( x ), &s_layerColor[y], z ) );
ca.push_back( new PARAM_CFG_SETCOLOR( true, wxT( x ),\
&s_layerColor[SCH_LAYER_INDEX( y )], z ) );
CLR( "ColorWireEx", LAYER_WIRE, COLOR4D( GREEN ) )
CLR( "ColorBusEx", LAYER_BUS, COLOR4D( BLUE ) )
CLR( "ColorConnEx", LAYER_JUNCTION, COLOR4D( GREEN ) )
CLR( "ColorLLabelEx", LAYER_LOCLABEL, COLOR4D( BLACK ) )
CLR( "ColorHLabelEx", LAYER_HIERLABEL, COLOR4D( BROWN ) )
CLR( "ColorGLabelEx", LAYER_GLOBLABEL, COLOR4D( RED ) )
CLR( "ColorPinNumEx", LAYER_PINNUM, COLOR4D( RED ) )
CLR( "ColorPinNameEx", LAYER_PINNAM, COLOR4D( CYAN ) )
CLR( "ColorFieldEx", LAYER_FIELDS, COLOR4D( MAGENTA ) )
CLR( "ColorReferenceEx", LAYER_REFERENCEPART, COLOR4D( CYAN ) )
CLR( "ColorValueEx", LAYER_VALUEPART, COLOR4D( CYAN ) )
CLR( "ColorNoteEx", LAYER_NOTES, COLOR4D( LIGHTBLUE ) )
CLR( "ColorBodyEx", LAYER_DEVICE, COLOR4D( RED ) )
CLR( "ColorBodyBgEx", LAYER_DEVICE_BACKGROUND, COLOR4D( LIGHTYELLOW ) )
CLR( "ColorNetNameEx", LAYER_NETNAM, COLOR4D( DARKGRAY ) )
CLR( "ColorPinEx", LAYER_PIN, COLOR4D( RED ) )
CLR( "ColorSheetEx", LAYER_SHEET, COLOR4D( MAGENTA ) )
CLR( "ColorSheetFileNameEx", LAYER_SHEETFILENAME, COLOR4D( BROWN ) )
CLR( "ColorSheetNameEx", LAYER_SHEETNAME, COLOR4D( CYAN ) )
CLR( "ColorSheetLabelEx", LAYER_SHEETLABEL, COLOR4D( BROWN ) )
CLR( "ColorNoConnectEx", LAYER_NOCONNECT, COLOR4D( BLUE ) )
CLR( "ColorErcWEx", LAYER_ERC_WARN, COLOR4D( GREEN ) )
CLR( "ColorErcEEx", LAYER_ERC_ERR, COLOR4D( RED ) )
CLR( "ColorGridEx", LAYER_GRID, COLOR4D( DARKGRAY ) )
CLR( "ColorBgCanvasEx", LAYER_BACKGROUND, COLOR4D( WHITE ) )
CLR( "ColorBrighenedEx", LAYER_BRIGHTENED, COLOR4D( PUREMAGENTA ) )
CLR( "ColorWireEx", LAYER_WIRE, COLOR4D( GREEN ) )
CLR( "ColorBusEx", LAYER_BUS, COLOR4D( BLUE ) )
CLR( "ColorConnEx", LAYER_JUNCTION, COLOR4D( GREEN ) )
CLR( "ColorLLabelEx", LAYER_LOCLABEL, COLOR4D( BLACK ) )
CLR( "ColorHLabelEx", LAYER_HIERLABEL, COLOR4D( BROWN ) )
CLR( "ColorGLabelEx", LAYER_GLOBLABEL, COLOR4D( RED ) )
CLR( "ColorPinNumEx", LAYER_PINNUM, COLOR4D( RED ) )
CLR( "ColorPinNameEx", LAYER_PINNAM, COLOR4D( CYAN ) )
CLR( "ColorFieldEx", LAYER_FIELDS, COLOR4D( MAGENTA ) )
CLR( "ColorReferenceEx", LAYER_REFERENCEPART, COLOR4D( CYAN ) )
CLR( "ColorValueEx", LAYER_VALUEPART, COLOR4D( CYAN ) )
CLR( "ColorNoteEx", LAYER_NOTES, COLOR4D( LIGHTBLUE ) )
CLR( "ColorBodyEx", LAYER_DEVICE, COLOR4D( RED ) )
CLR( "ColorBodyBgEx", LAYER_DEVICE_BACKGROUND, COLOR4D( LIGHTYELLOW ) )
CLR( "ColorNetNameEx", LAYER_NETNAM, COLOR4D( DARKGRAY ) )
CLR( "ColorPinEx", LAYER_PIN, COLOR4D( RED ) )
CLR( "ColorSheetEx", LAYER_SHEET, COLOR4D( MAGENTA ) )
CLR( "ColorSheetFileNameEx", LAYER_SHEETFILENAME, COLOR4D( BROWN ) )
CLR( "ColorSheetNameEx", LAYER_SHEETNAME, COLOR4D( CYAN ) )
CLR( "ColorSheetLabelEx", LAYER_SHEETLABEL, COLOR4D( BROWN ) )
CLR( "ColorNoConnectEx", LAYER_NOCONNECT, COLOR4D( BLUE ) )
CLR( "ColorErcWEx", LAYER_ERC_WARN, COLOR4D( GREEN ) )
CLR( "ColorErcEEx", LAYER_ERC_ERR, COLOR4D( RED ) )
CLR( "ColorGridEx", LAYER_SCHEMATIC_GRID, COLOR4D( DARKGRAY ) )
CLR( "ColorBgCanvasEx", LAYER_SCHEMATIC_BACKGROUND, COLOR4D( WHITE ) )
CLR( "ColorBrighenedEx", LAYER_BRIGHTENED, COLOR4D( PUREMAGENTA ) )
}
return ca;
@ -230,10 +233,10 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// Give a default colour for all layers
// (actual color will be initialized by config)
for( LAYERSCH_ID ii = LAYER_FIRST; ii < LAYERSCH_ID_COUNT; ++ii )
for( SCH_LAYER_ID ii = SCH_LAYER_ID_START; ii < SCH_LAYER_ID_END; ++ii )
SetLayerColor( COLOR4D( DARKGRAY ), ii );
SetLayerColor( COLOR4D::WHITE, LAYER_BACKGROUND );
SetLayerColor( COLOR4D::WHITE, LAYER_SCHEMATIC_BACKGROUND );
// Must be called before creating the main frame in order to
// display the real hotkeys in menus or tool tips

View File

@ -595,8 +595,8 @@ void SCH_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
wxConfigLoadSetups( aCfg, GetConfigurationSettings() );
SetGridColor( GetLayerColor( LAYER_GRID ) );
SetDrawBgColor( GetLayerColor( LAYER_BACKGROUND ) );
SetGridColor( GetLayerColor( LAYER_SCHEMATIC_GRID ) );
SetDrawBgColor( GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
SetDefaultBusThickness( aCfg->Read( DefaultBusWidthEntry, DEFAULTBUSTHICKNESS ) );
SetDefaultLineThickness( aCfg->Read( DefaultDrawLineWidthEntry, DEFAULTDRAWLINETHICKNESS ) );
@ -759,8 +759,8 @@ void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
{
EDA_DRAW_FRAME::LoadSettings( aCfg );
SetGridColor( GetLayerColor( LAYER_GRID ) );
SetDrawBgColor( GetLayerColor( LAYER_BACKGROUND ) );
SetGridColor( GetLayerColor( LAYER_SCHEMATIC_GRID ) );
SetDrawBgColor( GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
SetDefaultLineThickness( aCfg->Read( DefaultDrawLineWidthEntry, DEFAULTDRAWLINETHICKNESS ) );
SetDefaultPinLength( aCfg->Read( DefaultPinLengthEntry, DEFAULTPINLENGTH ) );

View File

@ -30,6 +30,7 @@
#define _GENERAL_H_
#include <gal/color4d.h>
#include <layers_id_colors_and_visibility.h>
using KIGFX::COLOR4D;
@ -68,48 +69,6 @@ class SCH_SHEET;
#define GR_DEFAULT_DRAWMODE GR_COPY
// this enum is for color management
// Using here "LAYER" in name is due to historical reasons.
// Eeschema does not actually use layers. It just uses "LAYER_XX" as identifier
// mainly for item color
typedef enum {
LAYER_FIRST,
LAYER_WIRE = LAYER_FIRST,
LAYER_BUS,
LAYER_JUNCTION,
LAYER_LOCLABEL,
LAYER_GLOBLABEL,
LAYER_HIERLABEL,
LAYER_PINNUM,
LAYER_PINNAM,
LAYER_REFERENCEPART,
LAYER_VALUEPART,
LAYER_FIELDS,
LAYER_DEVICE,
LAYER_NOTES,
LAYER_NETNAM,
LAYER_PIN,
LAYER_SHEET,
LAYER_SHEETNAME,
LAYER_SHEETFILENAME,
LAYER_SHEETLABEL,
LAYER_NOCONNECT,
LAYER_ERC_WARN,
LAYER_ERC_ERR,
LAYER_DEVICE_BACKGROUND,
LAYER_GRID,
LAYER_BACKGROUND,
LAYER_BRIGHTENED,
LAYERSCH_ID_COUNT
} LAYERSCH_ID;
inline LAYERSCH_ID operator++( LAYERSCH_ID& a )
{
a = LAYERSCH_ID( int( a ) + 1 );
return a;
}
/* Rotation, mirror of graphic items in components bodies are handled by a
* transform matrix. The default matrix is useful to draw lib entries with
* using this default matrix ( no rotation, no mirror but Y axis is bottom to top, and
@ -140,8 +99,8 @@ void SetDefaultTextSize( int aSize );
int GetDefaultBusThickness();
void SetDefaultBusThickness( int aThickness );
COLOR4D GetLayerColor( LAYERSCH_ID aLayer );
void SetLayerColor( COLOR4D aColor, LAYERSCH_ID aLayer );
COLOR4D GetLayerColor( SCH_LAYER_ID aLayer );
void SetLayerColor( COLOR4D aColor, SCH_LAYER_ID aLayer );
// Color to draw selected items
COLOR4D GetItemSelectedColor();

View File

@ -65,13 +65,13 @@ void SCH_BASE_FRAME::OnOpenLibraryViewer( wxCommandEvent& event )
// Virtual from EDA_DRAW_FRAME
COLOR4D SCH_BASE_FRAME::GetDrawBgColor() const
{
return GetLayerColor( LAYER_BACKGROUND );
return GetLayerColor( LAYER_SCHEMATIC_BACKGROUND );
}
void SCH_BASE_FRAME::SetDrawBgColor( COLOR4D aColor)
{
m_drawBgColor= aColor;
SetLayerColor( aColor, LAYER_BACKGROUND );
SetLayerColor( aColor, LAYER_SCHEMATIC_BACKGROUND );
}

View File

@ -116,7 +116,7 @@ public:
class SCH_ITEM : public EDA_ITEM
{
protected:
LAYERSCH_ID m_Layer;
SCH_LAYER_ID m_Layer;
EDA_ITEMS m_connections; ///< List of items connected to this item.
wxPoint m_storedPos; ///< a temporary variable used in some move commands
///> to store a initial pos (of the item or mouse cursor)
@ -161,14 +161,14 @@ public:
* Function GetLayer
* returns the layer this item is on.
*/
LAYERSCH_ID GetLayer() const { return m_Layer; }
SCH_LAYER_ID GetLayer() const { return m_Layer; }
/**
* Function SetLayer
* sets the layer this item is on.
* @param aLayer The layer number.
*/
void SetLayer( LAYERSCH_ID aLayer ) { m_Layer = aLayer; }
void SetLayer( SCH_LAYER_ID aLayer ) { m_Layer = aLayer; }
/**
* Function GetPenSize virtual pure

View File

@ -1591,7 +1591,7 @@ void SCH_LEGACY_PLUGIN::Format( SCH_SCREEN* aScreen )
m_out->Print( 0, "LIBS:%s\n", TO_UTF8( lib.GetName() ) );
// This section is not used, but written for file compatibility
m_out->Print( 0, "EELAYER %d %d\n", LAYERSCH_ID_COUNT, 0 );
m_out->Print( 0, "EELAYER %d %d\n", SCH_LAYER_ID_COUNT, 0 );
m_out->Print( 0, "EELAYER END\n" );
/* Write page info, ScreenNumber and NumberOfScreen; not very meaningful for
@ -1972,7 +1972,7 @@ void SCH_LEGACY_PLUGIN::saveText( SCH_TEXT* aText )
wxString text = aText->GetText();
LAYERSCH_ID layer = aText->GetLayer();
SCH_LAYER_ID layer = aText->GetLayer();
if( layer == LAYER_NOTES || layer == LAYER_LOCLABEL )
{

View File

@ -486,7 +486,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
}
// This section is not used, but written for file compatibility
if( fprintf( aFile, "EELAYER %d %d\n", LAYERSCH_ID_COUNT, 0 ) < 0
if( fprintf( aFile, "EELAYER %d %d\n", SCH_LAYER_ID_COUNT, 0 ) < 0
|| fprintf( aFile, "EELAYER END\n" ) < 0 )
return false;

View File

@ -629,8 +629,8 @@ void LIB_VIEW_FRAME::LoadSettings( wxConfigBase* aCfg )
{
EDA_DRAW_FRAME::LoadSettings( aCfg );
SetGridColor( GetLayerColor( LAYER_GRID ) );
SetDrawBgColor( GetLayerColor( LAYER_BACKGROUND ) );
SetGridColor( GetLayerColor( LAYER_SCHEMATIC_GRID ) );
SetDrawBgColor( GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
aCfg->Read( LIBLIST_WIDTH_KEY, &m_libListWidth, 150 );
aCfg->Read( CMPLIST_WIDTH_KEY, &m_cmpListWidth, 150 );

Some files were not shown because too many files have changed in this diff Show More