From 211d0567288ecf155d8ac819f1a557fccb2dfb62 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 15 Aug 2019 22:56:32 -0700 Subject: [PATCH] 3d-viewer: Remove dead code The 2d-bbox of the 3d viewer was calculated and set but never used (cherry picked from commit 59ed9f086fe96c9cc24354e24b0d33967a82ae0e) --- 3d-viewer/3d_canvas/cinfo3d_visu.cpp | 3 -- 3d-viewer/3d_canvas/cinfo3d_visu.h | 3 -- .../3d_canvas/create_3Dgraphic_brd_items.cpp | 4 --- .../shapes2D/cpolygon2d.cpp | 29 ------------------- .../shapes2D/cpolygon2d.h | 4 --- 5 files changed, 43 deletions(-) diff --git a/3d-viewer/3d_canvas/cinfo3d_visu.cpp b/3d-viewer/3d_canvas/cinfo3d_visu.cpp index 154123fe94..2dd8e5545e 100644 --- a/3d-viewer/3d_canvas/cinfo3d_visu.cpp +++ b/3d-viewer/3d_canvas/cinfo3d_visu.cpp @@ -66,7 +66,6 @@ CINFO3D_VISU::CINFO3D_VISU() : m_boardCenter = SFVEC3F( 0.0f ); m_boardBoudingBox.Reset(); - m_board2dBBox3DU.Reset(); m_layers_container2D.clear(); m_layers_holes2D.clear(); @@ -462,8 +461,6 @@ void CINFO3D_VISU::createBoardPolygon() errmsg.append( _( "Cannot determine the board outline." ) ); wxLogMessage( errmsg ); } - - Polygon_Calc_BBox_3DU( m_board_poly, m_board2dBBox3DU, m_biuTo3Dunits ); } diff --git a/3d-viewer/3d_canvas/cinfo3d_visu.h b/3d-viewer/3d_canvas/cinfo3d_visu.h index 0660a06416..e508d7e087 100644 --- a/3d-viewer/3d_canvas/cinfo3d_visu.h +++ b/3d-viewer/3d_canvas/cinfo3d_visu.h @@ -550,9 +550,6 @@ class CINFO3D_VISU /// 3d bouding box of the pcb board in 3d units CBBOX m_boardBoudingBox; - /// 2d bouding box of the pcb board in 3d units - CBBOX2D m_board2dBBox3DU; - /// It contains polygon contours for each layer MAP_POLY m_layers_poly; diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index b0793061d7..3d868cf614 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -62,13 +62,11 @@ static int s_textWidth; static CGENERICCONTAINER2D *s_dstcontainer = NULL; static float s_biuTo3Dunits; -static const CBBOX2D *s_boardBBox3DU = NULL; static const BOARD_ITEM *s_boardItem = NULL; // This is a call back function, used by DrawGraphicText to draw the 3D text shape: void addTextSegmToContainer( int x0, int y0, int xf, int yf, void* aData ) { - wxASSERT( s_boardBBox3DU != NULL ); wxASSERT( s_dstcontainer != NULL ); const SFVEC2F start3DU( x0 * s_biuTo3Dunits, -y0 * s_biuTo3Dunits ); @@ -103,7 +101,6 @@ void CINFO3D_VISU::AddShapeWithClearanceToContainer( const TEXTE_PCB* aTextPCB, s_dstcontainer = aDstContainer; s_textWidth = aTextPCB->GetThickness() + ( 2 * aClearanceValue ); s_biuTo3Dunits = m_biuTo3Dunits; - s_boardBBox3DU = &m_board2dBBox3DU; // not actually used, but needed by DrawGraphicText const COLOR4D dummy_color = COLOR4D::BLACK; @@ -228,7 +225,6 @@ void CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMod s_boardItem = (const BOARD_ITEM *)&aModule->Value(); s_dstcontainer = aDstContainer; s_biuTo3Dunits = m_biuTo3Dunits; - s_boardBBox3DU = &m_board2dBBox3DU; for( unsigned ii = 0; ii < texts.size(); ++ii ) { diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp index 3d110bc658..54c6cc98a2 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.cpp @@ -711,35 +711,6 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks( } -void Polygon_Calc_BBox_3DU( const SHAPE_POLY_SET &aPolysList, - CBBOX2D &aOutBBox , - float aBiuTo3DunitsScale ) -{ - aOutBBox.Reset(); - - for( int idx = 0; idx < aPolysList.OutlineCount(); ++idx ) - { - // Each polygon in aPolysList is a polygon with holes - const SHAPE_POLY_SET::POLYGON& curr_polywithholes = aPolysList.CPolygon( idx ); - - for( unsigned ipoly = 0; ipoly < curr_polywithholes.size(); ++ipoly ) - { - const SHAPE_LINE_CHAIN& path = curr_polywithholes[ipoly]; // a simple polygon - - for( int jj = 0; jj < path.PointCount(); jj++ ) - { - const VECTOR2I& a = path.CPoint( jj ); - - aOutBBox.Union( SFVEC2F( (float) a.x * aBiuTo3DunitsScale, - (float)-a.y * aBiuTo3DunitsScale ) ); - } - } - } - - aOutBBox.ScaleNextUp(); -} - - #ifdef DEBUG static void polygon_Convert( const ClipperLib::Path &aPath, SEGMENTS &aOutSegment, diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.h b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.h index 98a6f74121..9f873177c1 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.h +++ b/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cpolygon2d.h @@ -150,10 +150,6 @@ void Convert_path_polygon_to_polygon_blocks_and_dummy_blocks( float aDivFactor, const BOARD_ITEM &aBoardItem ); -void Polygon_Calc_BBox_3DU( const SHAPE_POLY_SET &aPolysList, - CBBOX2D &aOutBBox, - float aBiuTo3DunitsScale ); - void Polygon2d_TestModule(); #endif // _CPOLYGON2D_H_