diff --git a/3d-viewer/3d_cache/3d_info.h b/3d-viewer/3d_cache/3d_info.h index 72049346e1..fc61ca2748 100644 --- a/3d-viewer/3d_cache/3d_info.h +++ b/3d-viewer/3d_cache/3d_info.h @@ -36,12 +36,12 @@ #include #include -class MODULE_3D_SETTINGS; +class FP_3DMODEL; struct S3D_INFO { S3D_INFO(); - S3D_INFO( const MODULE_3D_SETTINGS& aModel ); + S3D_INFO( const FP_3DMODEL& aModel ); SGPOINT m_Scale; ///< scaling factors for the 3D footprint shape SGPOINT m_Rotation; ///< an X,Y,Z rotation (unit = degrees) for the 3D shape diff --git a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.cpp b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.cpp index 396099fc64..f3bd6d3d73 100644 --- a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.cpp +++ b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.cpp @@ -31,7 +31,7 @@ bool S3D::Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, wxString& prevModelSelectDir, - int& prevModelWildcard, MODULE_3D_SETTINGS* aModel ) + int& prevModelWildcard, FP_3DMODEL* aModel ) { if( NULL == aModel ) return false; diff --git a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h index 7693d02bed..89412255f0 100644 --- a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h +++ b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h @@ -31,8 +31,8 @@ class FILENAME_RESOLVER; namespace S3D { - bool Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, - wxString& prevModelSelectDir, int& prevModelWildcard, MODULE_3D_SETTINGS* aModel ); + bool Select3DModel( wxWindow* aParent, S3D_CACHE* aCache, wxString& prevModelSelectDir, + int& prevModelWildcard, FP_3DMODEL* aModel ); bool Configure3DPaths( wxWindow* aParent, FILENAME_RESOLVER* aResolver ); } diff --git a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp index 586849397d..ffed059871 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp +++ b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.cpp @@ -41,7 +41,8 @@ DLG_SELECT_3DMODEL::DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, - MODULE_3D_SETTINGS* aModelItem, wxString& prevModelSelectDir, int& prevModelWildcard ) : + FP_3DMODEL* aModelItem, wxString& prevModelSelectDir, + int& prevModelWildcard ) : DLG_SELECT_3D_MODELE_BASE( aParent ), m_model( aModelItem ), m_cache( aCacheManager ), m_previousDir( prevModelSelectDir ), m_previousFilterIndex( prevModelWildcard ) diff --git a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h index fc05d793c9..0bc11b6fa3 100644 --- a/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h +++ b/3d-viewer/3d_cache/dialogs/dlg_select_3dmodel.h @@ -33,7 +33,7 @@ #include "dlg_select_3dmodel_base.h" -class MODULE_3D_SETTINGS; +class FP_3DMODEL; class S3D_CACHE; class FILENAME_RESOLVER; class C3D_MODEL_VIEWER; @@ -41,9 +41,9 @@ class C3D_MODEL_VIEWER; class DLG_SELECT_3DMODEL : public DLG_SELECT_3D_MODELE_BASE { private: - MODULE_3D_SETTINGS* m_model; // data for the selected model - S3D_CACHE* m_cache; // cache manager - FILENAME_RESOLVER* m_resolver; // 3D filename resolver + FP_3DMODEL* m_model; // data for the selected model + S3D_CACHE* m_cache; // cache manager + FILENAME_RESOLVER* m_resolver; // 3D filename resolver wxString& m_previousDir; int& m_previousFilterIndex; @@ -53,8 +53,8 @@ private: void updateDirChoiceList( void ); public: - DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, MODULE_3D_SETTINGS* aModelItem, - wxString& prevModelSelectDir, int& prevModelWildcard ); + DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, FP_3DMODEL* aModelItem, + wxString& prevModelSelectDir, int& prevModelWildcard ); bool TransferDataFromWindow() override; void OnSelectionChanged( wxCommandEvent& event )override; diff --git a/3d-viewer/3d_cache/dialogs/panel_prev_3d.cpp b/3d-viewer/3d_cache/dialogs/panel_prev_3d.cpp index e76ad4dec1..ce4d190ab2 100644 --- a/3d-viewer/3d_cache/dialogs/panel_prev_3d.cpp +++ b/3d-viewer/3d_cache/dialogs/panel_prev_3d.cpp @@ -41,8 +41,8 @@ #include -PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aModule, - std::vector* aParentModelList ) : +PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aFootprint, + std::vector* aParentModelList ) : PANEL_PREV_3D_BASE( aParent, wxID_ANY ), m_previewPane( nullptr ), m_infobar( nullptr ), @@ -86,8 +86,8 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* m_parentModelList = aParentModelList; - m_dummyModule = new MODULE( *aModule ); - m_dummyBoard->Add( m_dummyModule ); + m_dummyFootprint = new MODULE( *aFootprint ); + m_dummyBoard->Add( m_dummyFootprint ); // Create the infobar m_infobar = new WX_INFOBAR( this ); @@ -228,7 +228,7 @@ void PANEL_PREV_3D::SetSelectedModel( int idx ) if( m_parentModelList && idx >= 0 && idx < (int) m_parentModelList->size() ) { m_selected = idx; - const MODULE_3D_SETTINGS& modelInfo = m_parentModelList->at( (unsigned) m_selected ); + const FP_3DMODEL& modelInfo = m_parentModelList->at( (unsigned) m_selected ); // Use ChangeValue() instead of SetValue(). It's not the user making the change, so we // don't want to generate wxEVT_GRID_CELL_CHANGED events. @@ -273,7 +273,7 @@ void PANEL_PREV_3D::updateOrientation( wxCommandEvent &event ) if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() ) { // Write settings back to the parent - MODULE_3D_SETTINGS* modelInfo = &m_parentModelList->at( (unsigned) m_selected ); + FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected ); modelInfo->m_Scale.x = DoubleValueFromString( EDA_UNITS::UNSCALED, xscale->GetValue() ); modelInfo->m_Scale.y = DoubleValueFromString( EDA_UNITS::UNSCALED, yscale->GetValue() ); @@ -298,7 +298,7 @@ void PANEL_PREV_3D::onOpacitySlider( wxCommandEvent& event ) if( m_parentModelList && m_selected >= 0 && m_selected < (int) m_parentModelList->size() ) { // Write settings back to the parent - MODULE_3D_SETTINGS* modelInfo = &m_parentModelList->at( (unsigned) m_selected ); + FP_3DMODEL* modelInfo = &m_parentModelList->at( (unsigned) m_selected ); modelInfo->m_Opacity = m_opacity->GetValue() / 100.0; @@ -451,12 +451,12 @@ void PANEL_PREV_3D::onMouseWheelOffset( wxMouseEvent& event ) void PANEL_PREV_3D::UpdateDummyFootprint( bool aReloadRequired ) { - m_dummyModule->Models().clear(); + m_dummyFootprint->Models().clear(); - for( MODULE_3D_SETTINGS& model : *m_parentModelList) + for( FP_3DMODEL& model : *m_parentModelList) { if( model.m_Show ) - m_dummyModule->Models().push_back( model ); + m_dummyFootprint->Models().push_back( model ); } if( aReloadRequired ) diff --git a/3d-viewer/3d_cache/dialogs/panel_prev_3d.h b/3d-viewer/3d_cache/dialogs/panel_prev_3d.h index 90a541d91f..2518446006 100644 --- a/3d-viewer/3d_cache/dialogs/panel_prev_3d.h +++ b/3d-viewer/3d_cache/dialogs/panel_prev_3d.h @@ -74,23 +74,23 @@ class MODULE; class PANEL_PREV_3D: public EDA_3D_BOARD_HOLDER, public TOOLS_HOLDER, public PANEL_PREV_3D_BASE { public: - PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aModule, - std::vector* aParentModelList ); + PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aFootprint, + std::vector* aParentModelList ); ~PANEL_PREV_3D(); private: - EDA_3D_CANVAS* m_previewPane; - WX_INFOBAR* m_infobar; - BOARD_ADAPTER m_boardAdapter; - CCAMERA& m_currentCamera; - CTRACK_BALL m_trackBallCamera; + EDA_3D_CANVAS* m_previewPane; + WX_INFOBAR* m_infobar; + BOARD_ADAPTER m_boardAdapter; + CCAMERA& m_currentCamera; + CTRACK_BALL m_trackBallCamera; - BOARD* m_dummyBoard; - MODULE* m_dummyModule; + BOARD* m_dummyBoard; + MODULE* m_dummyFootprint; - std::vector* m_parentModelList; - int m_selected; /// Index into m_parentInfoList + std::vector* m_parentModelList; + int m_selected; /// Index into m_parentInfoList EDA_UNITS m_userUnits; diff --git a/3d-viewer/3d_canvas/board_adapter.h b/3d-viewer/3d_canvas/board_adapter.h index 434a3b3708..4f8e22697b 100644 --- a/3d-viewer/3d_canvas/board_adapter.h +++ b/3d-viewer/3d_canvas/board_adapter.h @@ -540,65 +540,50 @@ class BOARD_ADAPTER void createNewTrack( const TRACK* aTrack, CGENERICCONTAINER2D *aDstContainer, int aClearanceValue ); - void createNewPadWithClearance( const PAD *aPad, - CGENERICCONTAINER2D *aDstContainer, - PCB_LAYER_ID aLayer, - wxSize aClearanceValue ) const; + void createNewPadWithClearance( const PAD *aPad, CGENERICCONTAINER2D *aDstContainer, + PCB_LAYER_ID aLayer, wxSize aClearanceValue ) const; COBJECT2D *createNewPadDrill( const PAD* aPad, int aInflateValue ); - void AddPadsShapesWithClearanceToContainer( const MODULE *aModule, - CGENERICCONTAINER2D *aDstContainer, - PCB_LAYER_ID aLayerId, - int aInflateValue, - bool aSkipNPTHPadsWihNoCopper, - bool aSkipPlatedPads, - bool aSkipNonPlatedPads ); + void AddPadsWithClearanceToContainer( const MODULE *aModule, + CGENERICCONTAINER2D *aDstContainer, + PCB_LAYER_ID aLayerId, int aInflateValue, + bool aSkipNPTHPadsWihNoCopper, bool aSkipPlatedPads, + bool aSkipNonPlatedPads ); - void AddGraphicsShapesWithClearanceToContainer( const MODULE *aModule, - CGENERICCONTAINER2D *aDstContainer, - PCB_LAYER_ID aLayerId, - int aInflateValue ); + void AddFPShapesWithClearanceToContainer( const MODULE *aModule, + CGENERICCONTAINER2D *aDstContainer, + PCB_LAYER_ID aLayerId, int aInflateValue ); void AddShapeWithClearanceToContainer( const PCB_TEXT *aText, CGENERICCONTAINER2D *aDstContainer, - PCB_LAYER_ID aLayerId, - int aClearanceValue ); + PCB_LAYER_ID aLayerId, int aClearanceValue ); void AddShapeWithClearanceToContainer( const PCB_SHAPE *aShape, CGENERICCONTAINER2D *aDstContainer, - PCB_LAYER_ID aLayerId, - int aClearanceValue ); + PCB_LAYER_ID aLayerId, int aClearanceValue ); void AddShapeWithClearanceToContainer( const DIMENSION_BASE *aDimension, CGENERICCONTAINER2D *aDstContainer, - PCB_LAYER_ID aLayerId, - int aClearanceValue ); + PCB_LAYER_ID aLayerId, int aClearanceValue ); void AddSolidAreasShapesToContainer( const ZONE *aZoneContainer, CGENERICCONTAINER2D *aDstContainer, PCB_LAYER_ID aLayerId ); - void TransformArcToSegments( const wxPoint &aCentre, - const wxPoint &aStart, - double aArcAngle, - int aCircleToSegmentsCount, - int aWidth, - CGENERICCONTAINER2D *aDstContainer, - const BOARD_ITEM &aBoardItem ); + void TransformArcToSegments( const wxPoint &aCentre, const wxPoint &aStart, double aArcAngle, + int aCircleToSegmentsCount, int aWidth, + CGENERICCONTAINER2D *aDstContainer, const BOARD_ITEM &aBoardItem ); - void buildPadShapeThickOutlineAsSegments( const PAD *aPad, - CGENERICCONTAINER2D *aDstContainer, + void buildPadShapeThickOutlineAsSegments( const PAD *aPad, CGENERICCONTAINER2D *aDstContainer, int aWidth ); // Helper functions to create poly contours - void buildPadShapeThickOutlineAsPolygon( const PAD *aPad, - SHAPE_POLY_SET &aCornerBuffer, + void buildPadShapeThickOutlineAsPolygon( const PAD *aPad, SHAPE_POLY_SET &aCornerBuffer, int aWidth) const; - void transformGraphicModuleEdgeToPolygonSet( const MODULE *aModule, - PCB_LAYER_ID aLayer, - SHAPE_POLY_SET& aCornerBuffer ) const; + void transformFPShapesToPolygon( const MODULE *aFootprint, PCB_LAYER_ID aLayer, + SHAPE_POLY_SET& aCornerBuffer ) const; public: SFVEC4F m_BgColorBot; ///< background bottom color diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index 793fe2ee53..efbc2466bc 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -183,12 +183,12 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const DIMENSION_BASE* aDim // Based on -// void MODULE::TransformGraphicShapesWithClearanceToPolygonSet +// void FOOTPRINT::TransformFPShapesWithClearanceToPolygonSet // board_items_to_polygon_shape_transform.cpp#L204 -void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aModule, - CGENERICCONTAINER2D *aDstContainer, - PCB_LAYER_ID aLayerId, - int aInflateValue ) +void BOARD_ADAPTER::AddFPShapesWithClearanceToContainer( const MODULE* aModule, + CGENERICCONTAINER2D *aDstContainer, + PCB_LAYER_ID aLayerId, + int aInflateValue ) { std::vector texts; // List of FP_TEXT to convert FP_SHAPE* outline; @@ -473,13 +473,13 @@ COBJECT2D *BOARD_ADAPTER::createNewPadDrill( const PAD* aPad, int aInflateValue } -void BOARD_ADAPTER::AddPadsShapesWithClearanceToContainer( const MODULE* aModule, - CGENERICCONTAINER2D *aDstContainer, - PCB_LAYER_ID aLayerId, - int aInflateValue, - bool aSkipNPTHPadsWihNoCopper, - bool aSkipPlatedPads, - bool aSkipNonPlatedPads ) +void BOARD_ADAPTER::AddPadsWithClearanceToContainer( const MODULE* aModule, + CGENERICCONTAINER2D *aDstContainer, + PCB_LAYER_ID aLayerId, + int aInflateValue, + bool aSkipNPTHPadsWihNoCopper, + bool aSkipPlatedPads, + bool aSkipNonPlatedPads ) { for( PAD* pad : aModule->Pads() ) { diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index 69c72df004..82f66de0f2 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -553,11 +553,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) { // Note: NPTH pads are not drawn on copper layers when the pad // has same shape as its hole - AddPadsShapesWithClearanceToContainer( footprint, layerContainer, curr_layer_id, 0, - true, renderPlatedPadsAsPlated, false ); + AddPadsWithClearanceToContainer( footprint, layerContainer, curr_layer_id, 0, + true, renderPlatedPadsAsPlated, false ); // Micro-wave footprints may have items on copper layers - AddGraphicsShapesWithClearanceToContainer( footprint, layerContainer, curr_layer_id, 0 ); + AddFPShapesWithClearanceToContainer( footprint, layerContainer, curr_layer_id, 0 ); } } @@ -566,11 +566,11 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // ADD PLATED PADS for( MODULE* footprint : m_board->Footprints() ) { - AddPadsShapesWithClearanceToContainer( footprint, m_platedpads_container2D_F_Cu, F_Cu, - 0, true, false, true ); + AddPadsWithClearanceToContainer( footprint, m_platedpads_container2D_F_Cu, F_Cu, + 0, true, false, true ); - AddPadsShapesWithClearanceToContainer( footprint, m_platedpads_container2D_B_Cu, B_Cu, - 0, true, false, true ); + AddPadsWithClearanceToContainer( footprint, m_platedpads_container2D_B_Cu, B_Cu, + 0, true, false, true ); } m_platedpads_container2D_F_Cu->BuildBVH(); @@ -592,12 +592,12 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) { // Note: NPTH pads are not drawn on copper layers when the pad // has same shape as its hole - footprint->TransformPadsShapesWithClearanceToPolygon( *layerPoly, curr_layer_id, - 0, ARC_HIGH_DEF, ERROR_INSIDE, - true, renderPlatedPadsAsPlated, - false ); + footprint->TransformPadsWithClearanceToPolygon( *layerPoly, curr_layer_id, + 0, ARC_HIGH_DEF, ERROR_INSIDE, + true, renderPlatedPadsAsPlated, + false ); - transformGraphicModuleEdgeToPolygonSet( footprint, curr_layer_id, *layerPoly ); + transformFPShapesToPolygon( footprint, curr_layer_id, *layerPoly ); } } @@ -606,17 +606,17 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // ADD PLATED PADS contourns for( MODULE* footprint : m_board->Footprints() ) { - footprint->TransformPadsShapesWithClearanceToPolygon( *m_F_Cu_PlatedPads_poly, F_Cu, - 0, ARC_HIGH_DEF, ERROR_INSIDE, - true, false, true ); + footprint->TransformPadsWithClearanceToPolygon( *m_F_Cu_PlatedPads_poly, F_Cu, + 0, ARC_HIGH_DEF, ERROR_INSIDE, + true, false, true ); - //transformGraphicModuleEdgeToPolygonSet( module, F_Cu, *m_F_Cu_PlatedPads_poly ); + //transformFPShapesToPolygon( footprint, F_Cu, *m_F_Cu_PlatedPads_poly ); - footprint->TransformPadsShapesWithClearanceToPolygon( *m_B_Cu_PlatedPads_poly, B_Cu, - 0, ARC_HIGH_DEF, ERROR_INSIDE, - true, false, true ); + footprint->TransformPadsWithClearanceToPolygon( *m_B_Cu_PlatedPads_poly, B_Cu, + 0, ARC_HIGH_DEF, ERROR_INSIDE, + true, false, true ); - //transformGraphicModuleEdgeToPolygonSet( module, B_Cu, *m_B_Cu_PlatedPads_poly ); + //transformFPShapesToPolygon( footprint, B_Cu, *m_B_Cu_PlatedPads_poly ); } } } @@ -638,28 +638,25 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) switch( item->Type() ) { case PCB_SHAPE_T: - { - AddShapeWithClearanceToContainer( (PCB_SHAPE*)item, layerContainer, curr_layer_id, - 0 ); - } + AddShapeWithClearanceToContainer( static_cast( item ), layerContainer, + curr_layer_id, 0 ); break; case PCB_TEXT_T: - AddShapeWithClearanceToContainer( (PCB_TEXT*) item, layerContainer, curr_layer_id, - 0 ); + AddShapeWithClearanceToContainer( static_cast( item ), layerContainer, + curr_layer_id, 0 ); break; case PCB_DIM_ALIGNED_T: case PCB_DIM_CENTER_T: case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_LEADER_T: - AddShapeWithClearanceToContainer( (DIMENSION_BASE*) item, layerContainer, - curr_layer_id, 0 ); + AddShapeWithClearanceToContainer( static_cast( item ), + layerContainer, curr_layer_id, 0 ); break; default: - wxLogTrace( m_logTrace, - wxT( "createLayers: item type: %d not implemented" ), + wxLogTrace( m_logTrace, wxT( "createLayers: item type: %d not implemented" ), item->Type() ); break; } @@ -685,16 +682,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) switch( item->Type() ) { case PCB_SHAPE_T: - ( (PCB_SHAPE*) item )->TransformShapeWithClearanceToPolygon( *layerPoly, - cur_layer_id, 0, - ARC_HIGH_DEF, - ERROR_INSIDE ); - break; - case PCB_TEXT_T: - ( (PCB_TEXT*) item )->TransformShapeWithClearanceToPolygonSet( *layerPoly, 0, - ARC_HIGH_DEF, - ERROR_INSIDE ); + item->TransformShapeWithClearanceToPolygon( *layerPoly, cur_layer_id, 0, + ARC_HIGH_DEF, ERROR_INSIDE ); break; default: @@ -974,16 +964,9 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) switch( item->Type() ) { case PCB_SHAPE_T: - ( (PCB_SHAPE*) item )->TransformShapeWithClearanceToPolygon( *layerPoly, - curr_layer_id, 0, - ARC_HIGH_DEF, - ERROR_INSIDE ); - break; - case PCB_TEXT_T: - ( (PCB_TEXT*) item )->TransformShapeWithClearanceToPolygonSet( *layerPoly, 0, - ARC_HIGH_DEF, - ERROR_INSIDE ); + item->TransformShapeWithClearanceToPolygon( *layerPoly, curr_layer_id, 0, + ARC_HIGH_DEF, ERROR_INSIDE ); break; default: @@ -994,13 +977,13 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) // Add footprints tech layers - objects // ///////////////////////////////////////////////////////////////////// - for( MODULE* module : m_board->Footprints() ) + for( MODULE* footprint : m_board->Footprints() ) { if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) ) { int linewidth = g_DrawDefaultLineThickness; - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( !pad->IsOnLayer( curr_layer_id ) ) continue; @@ -1010,24 +993,22 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) } else { - AddPadsShapesWithClearanceToContainer( module, layerContainer, curr_layer_id, 0, - false, - false, - false ); + AddPadsWithClearanceToContainer( footprint, layerContainer, curr_layer_id, 0, + false, false, false ); } - AddGraphicsShapesWithClearanceToContainer( module, layerContainer, curr_layer_id, 0 ); + AddFPShapesWithClearanceToContainer( footprint, layerContainer, curr_layer_id, 0 ); } // Add footprints tech layers - contours - for( MODULE* module : m_board->Footprints() ) + for( MODULE* footprint : m_board->Footprints() ) { if( (curr_layer_id == F_SilkS) || (curr_layer_id == B_SilkS) ) { const int linewidth = g_DrawDefaultLineThickness; - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { if( !pad->IsOnLayer( curr_layer_id ) ) continue; @@ -1037,16 +1018,16 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) } else { - module->TransformPadsShapesWithClearanceToPolygon( *layerPoly, curr_layer_id, 0, - ARC_HIGH_DEF, ERROR_INSIDE ); + footprint->TransformPadsWithClearanceToPolygon( *layerPoly, curr_layer_id, 0, + ARC_HIGH_DEF, ERROR_INSIDE ); } // On tech layers, use a poor circle approximation, only for texts (stroke font) - module->TransformGraphicTextWithClearanceToPolygonSet( *layerPoly, curr_layer_id, 0, - ARC_HIGH_DEF, ERROR_INSIDE ); + footprint->TransformFPTextWithClearanceToPolygonSet( *layerPoly, curr_layer_id, 0, + ARC_HIGH_DEF, ERROR_INSIDE ); // Add the remaining things with dynamic seg count for circles - transformGraphicModuleEdgeToPolygonSet( module, curr_layer_id, *layerPoly ); + transformFPShapesToPolygon( footprint, curr_layer_id, *layerPoly ); } diff --git a/3d-viewer/3d_canvas/create_layer_poly.cpp b/3d-viewer/3d_canvas/create_layer_poly.cpp index 49c9305e4f..5393a7fa60 100644 --- a/3d-viewer/3d_canvas/create_layer_poly.cpp +++ b/3d-viewer/3d_canvas/create_layer_poly.cpp @@ -60,11 +60,10 @@ void BOARD_ADAPTER::buildPadShapeThickOutlineAsPolygon( const PAD* aPad, } -void BOARD_ADAPTER::transformGraphicModuleEdgeToPolygonSet( const MODULE *aModule, - PCB_LAYER_ID aLayer, - SHAPE_POLY_SET& aCornerBuffer ) const +void BOARD_ADAPTER::transformFPShapesToPolygon( const MODULE *aFootprint, PCB_LAYER_ID aLayer, + SHAPE_POLY_SET& aCornerBuffer ) const { - for( BOARD_ITEM* item : aModule->GraphicalItems() ) + for( BOARD_ITEM* item : aFootprint->GraphicalItems() ) { if( item->Type() == PCB_FP_SHAPE_T ) { diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index f82b1ccb3c..84905e84bb 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -749,27 +749,24 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent &event ) { case PCB_PAD_T: { - PAD* item = dynamic_cast( intersectedBoardItem ); + PAD* pad = dynamic_cast( intersectedBoardItem ); - if( item ) + if( pad && pad->IsOnCopperLayer() ) { - if( item->IsOnCopperLayer() ) - activityReporter.Report( wxString::Format( _( "Net %s\tNetClass %s\tPadName %s" ), - item->GetNet()->GetNetname(), - item->GetNet()->GetClassName(), - item->GetName() ) ); + activityReporter.Report( wxString::Format( _( "Net %s\tNetClass %s\tPadName %s" ), + pad->GetNet()->GetNetname(), + pad->GetNet()->GetClassName(), + pad->GetName() ) ); } } break; case PCB_MODULE_T: { - MODULE* module = dynamic_cast( intersectedBoardItem ); + MODULE* footprint = dynamic_cast( intersectedBoardItem ); - if( module ) - { - activityReporter.Report( module->GetReference() ); - } + if( footprint ) + activityReporter.Report( footprint->GetReference() ); } break; @@ -777,27 +774,26 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent &event ) case PCB_VIA_T: case PCB_ARC_T: { - TRACK* item = dynamic_cast( intersectedBoardItem ); + TRACK* track = dynamic_cast( intersectedBoardItem ); - if( item ) + if( track ) { activityReporter.Report( wxString::Format( _( "Net %s\tNetClass %s" ), - item->GetNet()->GetNetname(), - item->GetNet()->GetClassName() ) ); + track->GetNet()->GetNetname(), + track->GetNet()->GetClassName() ) ); } } break; case PCB_ZONE_T: { - ZONE* item = dynamic_cast( intersectedBoardItem ); + ZONE* zone = dynamic_cast( intersectedBoardItem ); - if( item ) + if( zone && zone->IsOnCopperLayer() ) { - if( item->IsOnCopperLayer() ) - activityReporter.Report( wxString::Format( _( "Net %s\tNetClass %s" ), - item->GetNet()->GetNetname(), - item->GetNet()->GetClassName() ) ); + activityReporter.Report( wxString::Format( _( "Net %s\tNetClass %s" ), + zone->GetNet()->GetNetname(), + zone->GetNet()->GetClassName() ) ); } } break; diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp index 8ac6d04088..ee670f5c08 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp @@ -967,7 +967,7 @@ void C3D_RENDER_OGL_LEGACY::load_3D_models( REPORTER* aStatusReporter ) // Go for all footprints for( MODULE* footprint : m_boardAdapter.GetBoard()->Footprints() ) { - for( const MODULE_3D_SETTINGS& model : footprint->Models() ) + for( const FP_3DMODEL& model : footprint->Models() ) { if( model.m_Show && !model.m_Filename.empty() ) { diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp index eb0412842f..7e5e5957f9 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp @@ -1351,7 +1351,7 @@ void C3D_RENDER_OGL_LEGACY::render_3D_module( const MODULE* module, modelunit_to_3d_units_factor ); // Get the list of model files for this model - for( const MODULE_3D_SETTINGS& sM : module->Models() ) + for( const FP_3DMODEL& sM : module->Models() ) { if( !sM.m_Show || sM.m_Filename.empty() ) continue; diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 48668561d5..13423e05c9 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -79,12 +79,12 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_ // convert pads for( MODULE* footprint : m_footprints ) { - footprint->TransformPadsShapesWithClearanceToPolygon( aOutlines, aLayer, 0, maxError, - ERROR_INSIDE ); + footprint->TransformPadsWithClearanceToPolygon( aOutlines, aLayer, 0, maxError, + ERROR_INSIDE ); // Micro-wave footprints may have items on copper layers - footprint->TransformGraphicShapesWithClearanceToPolygonSet( aOutlines, aLayer, 0, maxError, - ERROR_INSIDE ); + footprint->TransformFPShapesWithClearanceToPolygon( aOutlines, aLayer, 0, maxError, + ERROR_INSIDE ); } // convert copper zones @@ -113,7 +113,8 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_ case PCB_TEXT_T: { PCB_TEXT* text = static_cast( item ); - text->TransformShapeWithClearanceToPolygonSet( aOutlines, 0, maxError, ERROR_INSIDE ); + text->TransformShapeWithClearanceToPolygon( aOutlines, aLayer, 0, maxError, + ERROR_INSIDE ); } break; @@ -124,12 +125,12 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_ } -void MODULE::TransformPadsShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, - PCB_LAYER_ID aLayer, int aClearance, - int aMaxError, ERROR_LOC aErrorLoc, - bool aSkipNPTHPadsWihNoCopper, - bool aSkipPlatedPads, - bool aSkipNonPlatedPads ) const +void MODULE::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, + PCB_LAYER_ID aLayer, int aClearance, + int aMaxError, ERROR_LOC aErrorLoc, + bool aSkipNPTHPadsWihNoCopper, + bool aSkipPlatedPads, + bool aSkipNonPlatedPads ) const { for( PAD* pad : m_pads ) { @@ -222,11 +223,11 @@ void MODULE::TransformPadsShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerB * @aIncludeText = indicates footprint text items (reference, value, etc.) should be included * in the outline */ -void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer, - PCB_LAYER_ID aLayer, int aClearance, - int aError, ERROR_LOC aErrorLoc, - bool aIncludeText, - bool aIncludeEdges ) const +void MODULE::TransformFPShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, + PCB_LAYER_ID aLayer, int aClearance, + int aError, ERROR_LOC aErrorLoc, + bool aIncludeText, + bool aIncludeEdges ) const { std::vector texts; // List of FP_TEXT to convert @@ -346,15 +347,16 @@ void EDA_TEXT::TransformBoundingBoxWithClearanceToPolygon( SHAPE_POLY_SET* aCorn /** - * Function TransformShapeWithClearanceToPolygonSet + * Function TransformShapeWithClearanceToPolygon * Convert the text shape to a set of polygons (one per segment). * @aCornerBuffer = SHAPE_POLY_SET to store the polygon corners * @aClearanceValue = the clearance around the text * @aError = the maximum error to allow when approximating curves */ -void PCB_TEXT::TransformShapeWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer, - int aClearanceValue, - int aError, ERROR_LOC aErrorLoc ) const +void PCB_TEXT::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, + PCB_LAYER_ID aLayer, int aClearanceValue, + int aError, ERROR_LOC aErrorLoc, + bool aIgnoreLineWidth ) const { wxSize size = GetTextSize(); diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp index 2c09179a01..ebc5272a89 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp @@ -52,7 +52,7 @@ int DIALOG_FOOTPRINT_FP_EDITOR::m_page = 0; // remember the last open page d DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aParent, - MODULE* aModule ) : + MODULE* aFootprint ) : DIALOG_FOOTPRINT_FP_EDITOR_BASE( aParent ), m_netClearance( aParent, m_NetClearanceLabel, m_NetClearanceCtrl, m_NetClearanceUnits, true ), m_solderMask( aParent, m_SolderMaskMarginLabel, m_SolderMaskMarginCtrl, m_SolderMaskMarginUnits ), @@ -60,7 +60,7 @@ DIALOG_FOOTPRINT_FP_EDITOR::DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aP m_inSelect( false ) { m_frame = aParent; - m_footprint = aModule; + m_footprint = aFootprint; m_texts = new TEXT_MOD_GRID_TABLE( m_units, m_frame ); @@ -298,7 +298,7 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow() wxString origPath, alias, shortPath; FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver(); - for( const MODULE_3D_SETTINGS& model : m_footprint->Models() ) + for( const FP_3DMODEL& model : m_footprint->Models() ) { m_shapes3D_list.push_back( model ); origPath = model.m_Filename; @@ -434,8 +434,8 @@ void DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel( wxCommandEvent& ) int selected = m_modelsGrid->GetGridCursorRow(); - PROJECT& prj = Prj(); - MODULE_3D_SETTINGS model; + PROJECT& prj = Prj(); + FP_3DMODEL model; wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH ); wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX ); @@ -499,7 +499,7 @@ void DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DRow( wxCommandEvent& ) if( !m_modelsGrid->CommitPendingChanges() ) return; - MODULE_3D_SETTINGS model; + FP_3DMODEL model; model.m_Show = true; m_shapes3D_list.push_back( model ); @@ -697,7 +697,7 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow() case 3: m_footprint->SetZoneConnection( ZONE_CONNECTION::NONE ); break; } - std::list* draw3D = &m_footprint->Models(); + std::list* draw3D = &m_footprint->Models(); draw3D->clear(); draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() ); diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.h b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.h index d9eb9c460e..5c61147fe0 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.h +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.h @@ -39,33 +39,33 @@ class FOOTPRINT_EDIT_FRAME; class DIALOG_FOOTPRINT_FP_EDITOR : public DIALOG_FOOTPRINT_FP_EDITOR_BASE { private: - FOOTPRINT_EDIT_FRAME* m_frame; - MODULE* m_footprint; + FOOTPRINT_EDIT_FRAME* m_frame; + MODULE* m_footprint; - static int m_page; // remember the last open page during session + static int m_page; // remember the last open page during session - TEXT_MOD_GRID_TABLE* m_texts; + TEXT_MOD_GRID_TABLE* m_texts; - UNIT_BINDER m_netClearance; - UNIT_BINDER m_solderMask; - UNIT_BINDER m_solderPaste; + UNIT_BINDER m_netClearance; + UNIT_BINDER m_solderMask; + UNIT_BINDER m_solderPaste; - std::vector m_shapes3D_list; - PANEL_PREV_3D* m_PreviewPane; + std::vector m_shapes3D_list; + PANEL_PREV_3D* m_PreviewPane; - wxControl* m_delayedFocusCtrl; - int m_delayedFocusPage; + wxControl* m_delayedFocusCtrl; + int m_delayedFocusPage; - WX_GRID* m_delayedFocusGrid; - int m_delayedFocusRow; - int m_delayedFocusColumn; - wxString m_delayedErrorMessage; + WX_GRID* m_delayedFocusGrid; + int m_delayedFocusRow; + int m_delayedFocusColumn; + wxString m_delayedErrorMessage; - bool m_inSelect; + bool m_inSelect; public: // Constructor and destructor - DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aParent, MODULE* aModule ); + DIALOG_FOOTPRINT_FP_EDITOR( FOOTPRINT_EDIT_FRAME* aParent, MODULE* aFootprint ); ~DIALOG_FOOTPRINT_FP_EDITOR() override; bool Validate() override; diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index 3d31f5383d..9c846190d2 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -364,7 +364,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow() wxString origPath, alias, shortPath; FILENAME_RESOLVER* res = Prj().Get3DCacheManager()->GetResolver(); - for( const MODULE_3D_SETTINGS& model : m_footprint->Models() ) + for( const FP_3DMODEL& model : m_footprint->Models() ) { m_shapes3D_list.push_back( model ); origPath = model.m_Filename; @@ -503,8 +503,8 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnAdd3DModel( wxCommandEvent& ) int selected = m_modelsGrid->GetGridCursorRow(); - PROJECT& prj = Prj(); - MODULE_3D_SETTINGS model; + PROJECT& prj = Prj(); + FP_3DMODEL model; wxString initialpath = prj.GetRString( PROJECT::VIEWER_3D_PATH ); wxString sidx = prj.GetRString( PROJECT::VIEWER_3D_FILTER_INDEX ); @@ -568,7 +568,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnAdd3DRow( wxCommandEvent& ) if( !m_modelsGrid->CommitPendingChanges() ) return; - MODULE_3D_SETTINGS model; + FP_3DMODEL model; model.m_Show = true; m_shapes3D_list.push_back( model ); @@ -747,7 +747,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow() if( change_layer ) m_footprint->Flip( m_footprint->GetPosition(), m_frame->Settings().m_FlipLeftRight ); - std::list* draw3D = &m_footprint->Models(); + std::list* draw3D = &m_footprint->Models(); draw3D->clear(); draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() ); diff --git a/pcbnew/dialogs/dialog_footprint_properties.h b/pcbnew/dialogs/dialog_footprint_properties.h index 704387b760..5ad815d836 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.h +++ b/pcbnew/dialogs/dialog_footprint_properties.h @@ -56,7 +56,7 @@ private: UNIT_BINDER m_solderMask; UNIT_BINDER m_solderPaste; - std::vector m_shapes3D_list; + std::vector m_shapes3D_list; PANEL_PREV_3D* m_PreviewPane; wxString m_delayedErrorMessage; diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index e3dfecc670..c9d8f2a3e4 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -942,7 +942,7 @@ unsigned MODULE::GetUniquePadCount( INCLUDE_NPTH_T aIncludeNPTH ) const } -void MODULE::Add3DModel( MODULE_3D_SETTINGS* a3DModel ) +void MODULE::Add3DModel( FP_3DMODEL* a3DModel ) { if( NULL == a3DModel ) return; diff --git a/pcbnew/footprint.h b/pcbnew/footprint.h index 0540a3fd14..c71b309840 100644 --- a/pcbnew/footprint.h +++ b/pcbnew/footprint.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef MODULE_H_ -#define MODULE_H_ +#ifndef FOOTPRINT_H +#define FOOTPRINT_H #include @@ -72,10 +72,10 @@ enum MODULE_ATTR_T MOD_BOARD_ONLY = 0x0010 // Footprint has no corresponding symbol }; -class MODULE_3D_SETTINGS +class FP_3DMODEL { public: - MODULE_3D_SETTINGS() : + FP_3DMODEL() : // Initialize with sensible values m_Scale { 1, 1, 1 }, m_Rotation { 0, 0, 0 }, @@ -192,8 +192,8 @@ public: bool HasThroughHolePads() const; - std::list& Models() { return m_3D_Drawings; } - const std::list& Models() const { return m_3D_Drawings; } + std::list& Models() { return m_3D_Drawings; } + const std::list& Models() const { return m_3D_Drawings; } void SetPosition( const wxPoint& aPos ) override; wxPoint GetPosition() const override { return m_Pos; } @@ -357,15 +357,15 @@ public: * @param aSkipPlatedPads = used on 3D-Viewer to extract plated and nontplated pads. * @param aSkipNonPlatedPads = used on 3D-Viewer to extract plated and plated pads. */ - void TransformPadsShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, - PCB_LAYER_ID aLayer,int aClearance, - int aMaxError, ERROR_LOC aErrorLoc, - bool aSkipNPTHPadsWihNoCopper = false, - bool aSkipPlatedPads = false, - bool aSkipNonPlatedPads = false ) const; + void TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, + PCB_LAYER_ID aLayer, int aClearance, + int aMaxError, ERROR_LOC aErrorLoc, + bool aSkipNPTHPadsWihNoCopper = false, + bool aSkipPlatedPads = false, + bool aSkipNonPlatedPads = false ) const; /** - * function TransformGraphicShapesWithClearanceToPolygonSet + * function TransformFPShapesWithClearanceToPolygon * generate shapes of graphic items (outlines) on layer aLayer as polygons and adds these * polygons to aCornerBuffer * Useful to generate a polygonal representation of a footprint in 3D view and plot functions, @@ -377,23 +377,23 @@ public: * @param aIncludeText = True to transform text shapes * @param aIncludeEdges = True to transform module shapes */ - void TransformGraphicShapesWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer, - PCB_LAYER_ID aLayer, int aClearance, - int aError, ERROR_LOC aErrorLoc, - bool aIncludeText = true, - bool aIncludeEdges = true ) const; + void TransformFPShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, + PCB_LAYER_ID aLayer, int aClearance, + int aError, ERROR_LOC aErrorLoc, + bool aIncludeText = true, + bool aIncludeEdges = true ) const; /** - * @brief TransformGraphicTextWithClearanceToPolygonSet + * @brief TransformFPTextWithClearanceToPolygonSet * This function is the same as TransformGraphicShapesWithClearanceToPolygonSet * but only generate text */ - void TransformGraphicTextWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer, - PCB_LAYER_ID aLayer, int aClearance, - int aError, ERROR_LOC aErrorLoc ) const + void TransformFPTextWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer, + PCB_LAYER_ID aLayer, int aClearance, + int aError, ERROR_LOC aErrorLoc ) const { - TransformGraphicShapesWithClearanceToPolygonSet( aCornerBuffer, aLayer, aClearance, - aError, aErrorLoc, true, false ); + TransformFPShapesWithClearanceToPolygon( aCornerBuffer, aLayer, aClearance, aError, + aErrorLoc, true, false ); } /** @@ -567,9 +567,9 @@ public: * Function Add3DModel * adds \a a3DModel definition to the end of the 3D model list. * - * @param a3DModel A pointer to a #MODULE_3D_SETTINGS to add to the list. + * @param a3DModel A pointer to a #FP_3DMODEL to add to the list. */ - void Add3DModel( MODULE_3D_SETTINGS* a3DModel ); + void Add3DModel( FP_3DMODEL* a3DModel ); SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override; @@ -722,7 +722,7 @@ private: int m_CntRot90; // Horizontal automatic placement cost ( 0..10 ). int m_CntRot180; // Vertical automatic placement cost ( 0..10 ). - std::list m_3D_Drawings; // Linked list of 3D models. + std::list m_3D_Drawings; // Linked list of 3D models. std::map m_properties; wxArrayString* m_initial_comments; // s-expression comments in the module, // lazily allocated only if needed for speed @@ -731,4 +731,4 @@ private: SHAPE_POLY_SET m_poly_courtyard_back; // courtyards populated. }; -#endif // MODULE_H_ +#endif // FOOTPRINT_H diff --git a/pcbnew/microwave/microwave_footprint.cpp b/pcbnew/microwave/microwave_footprint.cpp index 69ebaf9fa8..08603be5bf 100644 --- a/pcbnew/microwave/microwave_footprint.cpp +++ b/pcbnew/microwave/microwave_footprint.cpp @@ -33,7 +33,7 @@ MODULE* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprintSha { int oX; PAD* pad; - MODULE* module; + MODULE* footprint; wxString msg, cmp_name; int pad_count = 2; int angle = 0; @@ -74,7 +74,7 @@ MODULE* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprintSha } wxString value = StringFromValue( editFrame.GetUserUnits(), gap_size ); - WX_TEXT_ENTRY_DIALOG dlg( &editFrame, msg, _( "Create microwave module" ), value ); + WX_TEXT_ENTRY_DIALOG dlg( &editFrame, msg, _( "Create microwave footprint" ), value ); if( dlg.ShowModal() != wxID_OK ) return NULL; // cancelled by user @@ -89,7 +89,7 @@ MODULE* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprintSha double fcoeff = 10.0, fval; msg.Printf( wxT( "%3.1f" ), angle / fcoeff ); WX_TEXT_ENTRY_DIALOG angledlg( &editFrame, _( "Angle in degrees:" ), - _( "Create microwave module" ), msg ); + _( "Create microwave footprint" ), msg ); if( angledlg.ShowModal() != wxID_OK ) return NULL; // cancelled by user @@ -111,8 +111,8 @@ MODULE* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprintSha if( abort ) return NULL; - module = createBaseFootprint( cmp_name, text_size, pad_count ); - auto it = module->Pads().begin(); + footprint = createBaseFootprint( cmp_name, text_size, pad_count ); + auto it = footprint->Pads().begin(); pad = *it; switch( aFootprintShape ) @@ -173,11 +173,11 @@ MODULE* MICROWAVE_TOOL::createFootprint( MICROWAVE_FOOTPRINT_SHAPE aFootprintSha break; } - // Update the module and board - module->CalculateBoundingBox(); + // Update the footprint and board + footprint->CalculateBoundingBox(); editFrame.OnModify(); - return module; + return footprint; } diff --git a/pcbnew/microwave/microwave_inductor.cpp b/pcbnew/microwave/microwave_inductor.cpp index 89a00da8d0..5529be824f 100644 --- a/pcbnew/microwave/microwave_inductor.cpp +++ b/pcbnew/microwave/microwave_inductor.cpp @@ -303,11 +303,10 @@ void MICROWAVE_TOOL::createInductorBetween( const VECTOR2I& aStart, const VECTOR wxString errorMessage; - auto inductorModule = std::unique_ptr( createMicrowaveInductor( pattern, - errorMessage ) ); + auto inductorFP = std::unique_ptr( createMicrowaveInductor( pattern, errorMessage ) ); // on any error, report if we can - if ( !inductorModule || !errorMessage.IsEmpty() ) + if ( !inductorFP || !errorMessage.IsEmpty() ) { if ( !errorMessage.IsEmpty() ) editFrame.ShowInfoBarError( errorMessage ); @@ -315,10 +314,10 @@ void MICROWAVE_TOOL::createInductorBetween( const VECTOR2I& aStart, const VECTOR else { // at this point, we can save the module - m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, inductorModule.get() ); + m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, inductorFP.get() ); BOARD_COMMIT commit( this ); - commit.Add( inductorModule.release() ); + commit.Add( inductorFP.release() ); commit.Push( _("Add microwave inductor" ) ); } } diff --git a/pcbnew/microwave/microwave_polygon.cpp b/pcbnew/microwave/microwave_polygon.cpp index 041eef8361..4525a1fcd9 100644 --- a/pcbnew/microwave/microwave_polygon.cpp +++ b/pcbnew/microwave/microwave_polygon.cpp @@ -242,7 +242,7 @@ MODULE* MICROWAVE_TOOL::createPolygonShape() { PAD* pad1; PAD* pad2; - MODULE* module; + MODULE* footprint; wxString cmp_name; int pad_count = 2; FP_SHAPE* shape; @@ -280,13 +280,13 @@ MODULE* MICROWAVE_TOOL::createPolygonShape() cmp_name = wxT( "muwave_polygon" ); // Create a footprint with 2 pads, orientation = 0, pos 0 - module = createBaseFootprint( cmp_name, 0, pad_count ); + footprint = createBaseFootprint( cmp_name, 0, pad_count ); // We try to place the footprint anchor to the middle of the shape len wxPoint offset; offset.x = -ShapeSize.x / 2; - auto it = module->Pads().begin(); + auto it = footprint->Pads().begin(); pad1 = *it; pad1->SetX0( offset.x ); @@ -297,11 +297,11 @@ MODULE* MICROWAVE_TOOL::createPolygonShape() pad2->SetX( pad2->GetPos0().x ); // Add a polygonal edge (corners will be added later) on copper layer - shape = new FP_SHAPE( module ); + shape = new FP_SHAPE( footprint ); shape->SetShape( S_POLYGON ); shape->SetLayer( F_Cu ); - module->Add( shape, ADD_MODE::INSERT ); + footprint->Add( shape, ADD_MODE::INSERT ); // Get the corner buffer of the polygonal edge std::vector polyPoints; @@ -346,7 +346,7 @@ MODULE* MICROWAVE_TOOL::createPolygonShape() shape->SetWidth( 0 ); PolyEdges.clear(); - module->CalculateBoundingBox(); + footprint->CalculateBoundingBox(); editFrame.OnModify(); - return module; + return footprint; } diff --git a/pcbnew/netinfo_list.cpp b/pcbnew/netinfo_list.cpp index 9f28605287..0dec294e5b 100644 --- a/pcbnew/netinfo_list.cpp +++ b/pcbnew/netinfo_list.cpp @@ -218,9 +218,9 @@ void NETINFO_MAPPING::Update() nets.insert( track->GetNetCode() ); // footprints/pads - for( MODULE* module : m_board->Footprints() ) + for( MODULE* footprint : m_board->Footprints() ) { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) nets.insert( pad->GetNetCode() ); } diff --git a/pcbnew/pcb_text.h b/pcbnew/pcb_text.h index 149a16a4fe..bbd672ec1e 100644 --- a/pcbnew/pcb_text.h +++ b/pcbnew/pcb_text.h @@ -111,16 +111,17 @@ public: } /** - * Function TransformShapeWithClearanceToPolygonSet + * Function TransformShapeWithClearanceToPolygon * Convert the text shape to a set of polygons (one by segment) * Used in 3D viewer * Circles and arcs are approximated by segments * @param aCornerBuffer = a buffer to store the polygon - * @param aClearance = the clearance around the text + * @param aClearanceValue = the clearance around the text * @param aError = deviation from true arc position to segment approx */ - void TransformShapeWithClearanceToPolygonSet( SHAPE_POLY_SET& aCornerBuffer, int aClearance, - int aError, ERROR_LOC aErrorLoc ) const; + void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, PCB_LAYER_ID aLayer, + int aClearanceValue, int aError, ERROR_LOC aErrorLoc, + bool aIgnoreLineWidth = false ) const override; // @copydoc BOARD_ITEM::GetEffectiveShape virtual std::shared_ptr GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override; diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 0393840985..45559ce8a3 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -219,19 +219,19 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, itemplotter.PlotBoardGraphicItems(); // Draw footprint texts: - for( MODULE* module : aBoard->Footprints() ) - itemplotter.PlotFootprintTextItems( module ); + for( MODULE* footprint : aBoard->Footprints() ) + itemplotter.PlotFootprintTextItems( footprint ); // Draw footprint other graphic items: - for( MODULE* module : aBoard->Footprints() ) - itemplotter.PlotFootprintGraphicItems( module ); + for( MODULE* footprint : aBoard->Footprints() ) + itemplotter.PlotFootprintGraphicItems( footprint ); // Plot footprint pads - for( MODULE* module : aBoard->Footprints() ) + for( MODULE* footprint : aBoard->Footprints() ) { aPlotter->StartBlock( NULL ); - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { OUTLINE_MODE padPlotMode = plotMode; @@ -632,9 +632,9 @@ void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask, int smallDrill = (aPlotOpt.GetDrillMarksType() == PCB_PLOT_PARAMS::SMALL_DRILL_SHAPE) ? SMALL_DRILL : INT_MAX; - for( MODULE* module : aBoard->Footprints() ) + for( MODULE* footprint : aBoard->Footprints() ) { - for( PAD* pad : module->Pads() ) + for( PAD* pad : footprint->Pads() ) { wxSize hole = pad->GetDrillSize(); @@ -727,11 +727,11 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, itemplotter.PlotBoardGraphicItems(); - for( MODULE* module : aBoard->Footprints() ) + for( MODULE* footprint : aBoard->Footprints() ) { - for( BOARD_ITEM* item : module->GraphicalItems() ) + for( BOARD_ITEM* item : footprint->GraphicalItems() ) { - itemplotter.PlotFootprintTextItems( module ); + itemplotter.PlotFootprintTextItems( footprint ); if( item->Type() == PCB_FP_SHAPE_T && item->GetLayer() == layer ) itemplotter.PlotFootprintGraphicItem( (FP_SHAPE*) item ); @@ -757,14 +757,14 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, #endif { // Plot pads - for( MODULE* module : aBoard->Footprints() ) + for( MODULE* footprint : aBoard->Footprints() ) { // add shapes with their exact mask layer size in initialPolys - module->TransformPadsShapesWithClearanceToPolygon( initialPolys, layer, 0, maxError, - ERROR_OUTSIDE ); + footprint->TransformPadsWithClearanceToPolygon( initialPolys, layer, 0, maxError, + ERROR_OUTSIDE ); // add shapes inflated by aMinThickness/2 in areas - module->TransformPadsShapesWithClearanceToPolygon( areas, layer, inflate, maxError, - ERROR_OUTSIDE ); + footprint->TransformPadsWithClearanceToPolygon( areas, layer, inflate, maxError, + ERROR_OUTSIDE ); } // Plot vias on solder masks, if aPlotOpt.GetPlotViaOnMaskLayer() is true, diff --git a/pcbnew/plugins/altium/altium_parser_pcb.h b/pcbnew/plugins/altium/altium_parser_pcb.h index 9bca48a23b..57228cfb9d 100644 --- a/pcbnew/plugins/altium/altium_parser_pcb.h +++ b/pcbnew/plugins/altium/altium_parser_pcb.h @@ -421,7 +421,7 @@ struct AMODEL wxString id; bool isEmbedded; - MODULE_3D_SETTINGS::VECTOR3D rotation; + FP_3DMODEL::VECTOR3D rotation; explicit AMODEL( ALTIUM_PARSER& aReader ); }; @@ -523,16 +523,16 @@ struct AARC6 struct ACOMPONENTBODY6 { - uint16_t component; + uint16_t component; - wxString modelName; - wxString modelId; - bool modelIsEmbedded; + wxString modelName; + wxString modelId; + bool modelIsEmbedded; - MODULE_3D_SETTINGS::VECTOR3D modelPosition; - MODULE_3D_SETTINGS::VECTOR3D modelRotation; - double rotation; - double bodyOpacity; + FP_3DMODEL::VECTOR3D modelPosition; + FP_3DMODEL::VECTOR3D modelRotation; + double rotation; + double bodyOpacity; explicit ACOMPONENTBODY6( ALTIUM_PARSER& aReader ); }; diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index 48e36fbc0c..d9a0404855 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -820,7 +820,7 @@ void ALTIUM_PCB::ParseComponentsBodies6Data( MODULE* module = m_components.at( elem.component ); const wxPoint& modulePosition = module->GetPosition(); - MODULE_3D_SETTINGS modelSettings; + FP_3DMODEL modelSettings; modelSettings.m_Filename = modelTuple->second; diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index 5c8209965b..f9ffd6d94c 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -376,14 +376,14 @@ void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) } -MODULE_3D_SETTINGS* PCB_PARSER::parse3DModel() +FP_3DMODEL* PCB_PARSER::parse3DModel() { wxCHECK_MSG( CurTok() == T_model, NULL, - wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as MODULE_3D_SETTINGS." ) ); + wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as FP_3DMODEL." ) ); T token; - MODULE_3D_SETTINGS* n3D = new MODULE_3D_SETTINGS; + FP_3DMODEL* n3D = new FP_3DMODEL; NeedSYMBOLorNUMBER(); n3D->m_Filename = FromUTF8(); diff --git a/pcbnew/plugins/kicad/pcb_parser.h b/pcbnew/plugins/kicad/pcb_parser.h index 24e10d82ff..340f5021dc 100644 --- a/pcbnew/plugins/kicad/pcb_parser.h +++ b/pcbnew/plugins/kicad/pcb_parser.h @@ -58,7 +58,7 @@ class PCB_TARGET; class VIA; class ZONE; class MARKER_PCB; -class MODULE_3D_SETTINGS; +class FP_3DMODEL; struct LAYER; @@ -250,7 +250,7 @@ class PCB_PARSER : public PCB_LEXER */ void parseEDA_TEXT( EDA_TEXT* aText ); - MODULE_3D_SETTINGS* parse3DModel(); + FP_3DMODEL* parse3DModel(); /** * Function parseDouble diff --git a/pcbnew/plugins/legacy/legacy_plugin.cpp b/pcbnew/plugins/legacy/legacy_plugin.cpp index 50ce12a1b2..0a4c686f9b 100644 --- a/pcbnew/plugins/legacy/legacy_plugin.cpp +++ b/pcbnew/plugins/legacy/legacy_plugin.cpp @@ -1861,7 +1861,7 @@ void LEGACY_PLUGIN::loadMODULE_TEXT( FP_TEXT* aText ) void LEGACY_PLUGIN::load3D( MODULE* aModule ) { - MODULE_3D_SETTINGS t3D; + FP_3DMODEL t3D; char* line; while( ( line = READLINE( m_reader ) ) != NULL )