style cleanup and a few comments added.
This commit is contained in:
parent
e0351b4e4c
commit
ffabc17372
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -547,7 +547,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add modules PADs objects to containers
|
// Add modules PADs objects to containers
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
|
||||||
for( PCB_LAYER_ID curr_layer_id : layer_id )
|
for( PCB_LAYER_ID curr_layer_id : layer_id )
|
||||||
{
|
{
|
||||||
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
|
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
|
||||||
|
@ -595,8 +594,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
// has same shape as its hole
|
// has same shape as its hole
|
||||||
module->TransformPadsShapesWithClearanceToPolygon( curr_layer_id,
|
module->TransformPadsShapesWithClearanceToPolygon( curr_layer_id,
|
||||||
*layerPoly,
|
*layerPoly,
|
||||||
0,
|
0, true );
|
||||||
true );
|
|
||||||
|
|
||||||
transformGraphicModuleEdgeToPolygonSet( module, curr_layer_id, *layerPoly );
|
transformGraphicModuleEdgeToPolygonSet( module, curr_layer_id, *layerPoly );
|
||||||
}
|
}
|
||||||
|
@ -609,14 +607,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add graphic item on copper layers to object containers
|
// Add graphic item on copper layers to object containers
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
|
||||||
for( PCB_LAYER_ID curr_layer_id : layer_id )
|
for( PCB_LAYER_ID curr_layer_id : layer_id )
|
||||||
{
|
{
|
||||||
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
|
wxASSERT( m_layers_container2D.find( curr_layer_id ) != m_layers_container2D.end() );
|
||||||
|
|
||||||
CBVHCONTAINER2D *layerContainer = m_layers_container2D[curr_layer_id];
|
CBVHCONTAINER2D *layerContainer = m_layers_container2D[curr_layer_id];
|
||||||
|
|
||||||
// ADD GRAPHIC ITEMS ON COPPER LAYERS (texts)
|
// Add graphic items on copper layers (texts and other graphics)
|
||||||
for( auto item : m_board->Drawings() )
|
for( auto item : m_board->Drawings() )
|
||||||
{
|
{
|
||||||
if( !item->IsOnLayer( curr_layer_id ) )
|
if( !item->IsOnLayer( curr_layer_id ) )
|
||||||
|
@ -661,8 +658,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
start_Time = GetRunningMicroSecs();
|
start_Time = GetRunningMicroSecs();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Add graphic item on copper layers to poly contourns
|
// Add graphic item on copper layers to poly contourns (vertical outlines)
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
|
||||||
if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS )
|
if( GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS )
|
||||||
&& ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) )
|
&& ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) )
|
||||||
{
|
{
|
||||||
|
@ -672,7 +668,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
|
|
||||||
SHAPE_POLY_SET *layerPoly = m_layers_poly[cur_layer_id];
|
SHAPE_POLY_SET *layerPoly = m_layers_poly[cur_layer_id];
|
||||||
|
|
||||||
// ADD GRAPHIC ITEMS ON COPPER LAYERS (texts)
|
// Add graphic items on copper layers (texts and other )
|
||||||
for( BOARD_ITEM* item : m_board->Drawings() )
|
for( BOARD_ITEM* item : m_board->Drawings() )
|
||||||
{
|
{
|
||||||
if( !item->IsOnLayer( cur_layer_id ) )
|
if( !item->IsOnLayer( cur_layer_id ) )
|
||||||
|
@ -764,7 +760,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
if( GetFlag( FL_ZONE ) && GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS )
|
if( GetFlag( FL_ZONE ) && GetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS )
|
||||||
&& ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) )
|
&& ( m_render_engine == RENDER_ENGINE::OPENGL_LEGACY ) )
|
||||||
{
|
{
|
||||||
// ADD COPPER ZONES
|
// Add copper zones
|
||||||
for( ZONE_CONTAINER* zone : m_board->Zones() )
|
for( ZONE_CONTAINER* zone : m_board->Zones() )
|
||||||
{
|
{
|
||||||
if( zone == nullptr )
|
if( zone == nullptr )
|
||||||
|
@ -786,7 +782,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Simplify layer polygons
|
// Simplify layer polygons
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
if( aStatusReporter )
|
if( aStatusReporter )
|
||||||
aStatusReporter->Report( _( "Simplifying copper layers polygons" ) );
|
aStatusReporter->Report( _( "Simplifying copper layers polygons" ) );
|
||||||
|
@ -899,7 +894,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
};
|
};
|
||||||
|
|
||||||
// User layers are not drawn here, only technical layers
|
// User layers are not drawn here, only technical layers
|
||||||
|
|
||||||
for( LSEQ seq = LSET::AllNonCuMask().Seq( teckLayerList, arrayDim( teckLayerList ) );
|
for( LSEQ seq = LSET::AllNonCuMask().Seq( teckLayerList, arrayDim( teckLayerList ) );
|
||||||
seq;
|
seq;
|
||||||
++seq )
|
++seq )
|
||||||
|
@ -916,7 +910,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
m_layers_poly[curr_layer_id] = layerPoly;
|
m_layers_poly[curr_layer_id] = layerPoly;
|
||||||
|
|
||||||
// Add drawing objects
|
// Add drawing objects
|
||||||
// /////////////////////////////////////////////////////////////////////
|
|
||||||
for( BOARD_ITEM* item : m_board->Drawings() )
|
for( BOARD_ITEM* item : m_board->Drawings() )
|
||||||
{
|
{
|
||||||
if( !item->IsOnLayer( curr_layer_id ) )
|
if( !item->IsOnLayer( curr_layer_id ) )
|
||||||
|
@ -952,7 +945,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
|
|
||||||
|
|
||||||
// Add drawing contours
|
// Add drawing contours
|
||||||
// /////////////////////////////////////////////////////////////////////
|
|
||||||
for( BOARD_ITEM* item : m_board->Drawings() )
|
for( BOARD_ITEM* item : m_board->Drawings() )
|
||||||
{
|
{
|
||||||
if( !item->IsOnLayer( curr_layer_id ) )
|
if( !item->IsOnLayer( curr_layer_id ) )
|
||||||
|
@ -1002,7 +994,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
|
|
||||||
|
|
||||||
// Add modules tech layers - contours
|
// Add modules tech layers - contours
|
||||||
// /////////////////////////////////////////////////////////////////////
|
|
||||||
for( MODULE* module : m_board->Modules() )
|
for( MODULE* module : m_board->Modules() )
|
||||||
{
|
{
|
||||||
if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) )
|
if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) )
|
||||||
|
@ -1032,7 +1023,6 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
|
|
||||||
|
|
||||||
// Draw non copper zones
|
// Draw non copper zones
|
||||||
// /////////////////////////////////////////////////////////////////////
|
|
||||||
if( GetFlag( FL_ZONE ) )
|
if( GetFlag( FL_ZONE ) )
|
||||||
{
|
{
|
||||||
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
|
for( int ii = 0; ii < m_board->GetAreaCount(); ++ii )
|
||||||
|
@ -1066,8 +1056,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Build BVH for holes and vias
|
// Build BVH (Bounding volume hierarchy) for holes and vias
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifdef PRINT_STATISTICS_3D_VIEWER
|
#ifdef PRINT_STATISTICS_3D_VIEWER
|
||||||
unsigned stats_startHolesBVHTime = GetRunningMicroSecs();
|
unsigned stats_startHolesBVHTime = GetRunningMicroSecs();
|
||||||
|
|
Loading…
Reference in New Issue