3D-Viewer: when possible, uses only the board edges to calculate boundings
Add Report messages to Raytracing Fixes https://gitlab.com/kicad/code/kicad/issues/6316
This commit is contained in:
parent
753383d6ec
commit
e105451f44
|
@ -278,9 +278,31 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||||
{
|
{
|
||||||
wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::InitSettings" ) );
|
wxLogTrace( m_logTrace, wxT( "BOARD_ADAPTER::InitSettings" ) );
|
||||||
|
|
||||||
|
if( aStatusReporter )
|
||||||
|
aStatusReporter->Report( _( "Build board outline" ) );
|
||||||
|
|
||||||
|
wxString msg;
|
||||||
|
|
||||||
|
const bool succeedToGetBoardPolygon = createBoardPolygon( &msg );
|
||||||
|
|
||||||
|
if( aWarningReporter )
|
||||||
|
{
|
||||||
|
if( !succeedToGetBoardPolygon )
|
||||||
|
aWarningReporter->Report( msg, RPT_SEVERITY_WARNING );
|
||||||
|
else
|
||||||
|
aWarningReporter->Report( wxEmptyString );
|
||||||
|
}
|
||||||
|
|
||||||
// Calculates the board bounding box (board outlines + items)
|
// Calculates the board bounding box (board outlines + items)
|
||||||
// to ensure any item, even outside the board outlines can be seen
|
// to ensure any item, even outside the board outlines can be seen
|
||||||
EDA_RECT bbbox = m_board->ComputeBoundingBox( false );
|
|
||||||
|
bool boardEdgesOnly = true;
|
||||||
|
|
||||||
|
if( m_board->IsFootprintHolder() || !GetFlag( FL_USE_REALISTIC_MODE )
|
||||||
|
|| !succeedToGetBoardPolygon )
|
||||||
|
boardEdgesOnly = false;
|
||||||
|
|
||||||
|
EDA_RECT bbbox = m_board->ComputeBoundingBox( boardEdgesOnly );
|
||||||
|
|
||||||
// Gives a non null size to avoid issues in zoom / scale calculations
|
// Gives a non null size to avoid issues in zoom / scale calculations
|
||||||
if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
|
if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )
|
||||||
|
@ -422,19 +444,6 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||||
unsigned stats_startCreateBoardPolyTime = GetRunningMicroSecs();
|
unsigned stats_startCreateBoardPolyTime = GetRunningMicroSecs();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( aStatusReporter )
|
|
||||||
aStatusReporter->Report( _( "Build board body" ) );
|
|
||||||
|
|
||||||
wxString msg;
|
|
||||||
|
|
||||||
if( aWarningReporter )
|
|
||||||
{
|
|
||||||
if( !createBoardPolygon( &msg ) )
|
|
||||||
aWarningReporter->Report( msg, RPT_SEVERITY_WARNING );
|
|
||||||
else
|
|
||||||
aWarningReporter->Report( wxEmptyString );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( aStatusReporter )
|
if( aStatusReporter )
|
||||||
aStatusReporter->Report( _( "Create layers" ) );
|
aStatusReporter->Report( _( "Create layers" ) );
|
||||||
|
|
||||||
|
|
|
@ -485,6 +485,9 @@ void C3D_RENDER_RAYTRACING::Reload( REPORTER* aStatusReporter,
|
||||||
|
|
||||||
setupMaterials();
|
setupMaterials();
|
||||||
|
|
||||||
|
if( aStatusReporter )
|
||||||
|
aStatusReporter->Report( _( "Load Raytracing: board" ) );
|
||||||
|
|
||||||
// Create and add the outline board
|
// Create and add the outline board
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -696,6 +699,8 @@ void C3D_RENDER_RAYTRACING::Reload( REPORTER* aStatusReporter,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( aStatusReporter )
|
||||||
|
aStatusReporter->Report( _( "Load Raytracing: layers" ) );
|
||||||
|
|
||||||
// Add layers maps (except B_Mask and F_Mask)
|
// Add layers maps (except B_Mask and F_Mask)
|
||||||
// /////////////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -952,6 +957,8 @@ void C3D_RENDER_RAYTRACING::Reload( REPORTER* aStatusReporter,
|
||||||
unsigned stats_startLoad3DmodelsTime = stats_endConvertTime;
|
unsigned stats_startLoad3DmodelsTime = stats_endConvertTime;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if( aStatusReporter )
|
||||||
|
aStatusReporter->Report( _( "Loading 3D models" ) );
|
||||||
|
|
||||||
load_3D_models( m_object_container, aOnlyLoadCopperAndShapes );
|
load_3D_models( m_object_container, aOnlyLoadCopperAndShapes );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue