More module -> footprint.
This commit is contained in:
parent
52a46341db
commit
fc9cf1d827
|
@ -36,12 +36,12 @@
|
|||
#include <wx/string.h>
|
||||
#include <plugins/3dapi/sg_base.h>
|
||||
|
||||
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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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,7 +41,7 @@ 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
|
||||
FP_3DMODEL* m_model; // data for the selected model
|
||||
S3D_CACHE* m_cache; // cache manager
|
||||
FILENAME_RESOLVER* m_resolver; // 3D filename resolver
|
||||
|
||||
|
@ -53,7 +53,7 @@ private:
|
|||
void updateDirChoiceList( void );
|
||||
|
||||
public:
|
||||
DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, MODULE_3D_SETTINGS* aModelItem,
|
||||
DLG_SELECT_3DMODEL( wxWindow* aParent, S3D_CACHE* aCacheManager, FP_3DMODEL* aModelItem,
|
||||
wxString& prevModelSelectDir, int& prevModelWildcard );
|
||||
|
||||
bool TransferDataFromWindow() override;
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
#include <widgets/infobar.h>
|
||||
|
||||
|
||||
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aModule,
|
||||
std::vector<MODULE_3D_SETTINGS>* aParentModelList ) :
|
||||
PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aFootprint,
|
||||
std::vector<FP_3DMODEL>* 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 )
|
||||
|
|
|
@ -74,8 +74,8 @@ 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<MODULE_3D_SETTINGS>* aParentModelList );
|
||||
PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, MODULE* aFootprint,
|
||||
std::vector<FP_3DMODEL>* aParentModelList );
|
||||
|
||||
~PANEL_PREV_3D();
|
||||
|
||||
|
@ -87,9 +87,9 @@ private:
|
|||
CTRACK_BALL m_trackBallCamera;
|
||||
|
||||
BOARD* m_dummyBoard;
|
||||
MODULE* m_dummyModule;
|
||||
MODULE* m_dummyFootprint;
|
||||
|
||||
std::vector<MODULE_3D_SETTINGS>* m_parentModelList;
|
||||
std::vector<FP_3DMODEL>* m_parentModelList;
|
||||
int m_selected; /// Index into m_parentInfoList
|
||||
|
||||
EDA_UNITS m_userUnits;
|
||||
|
|
|
@ -540,64 +540,49 @@ 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,
|
||||
void AddPadsWithClearanceToContainer( const MODULE *aModule,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId,
|
||||
int aInflateValue,
|
||||
bool aSkipNPTHPadsWihNoCopper,
|
||||
bool aSkipPlatedPads,
|
||||
PCB_LAYER_ID aLayerId, int aInflateValue,
|
||||
bool aSkipNPTHPadsWihNoCopper, bool aSkipPlatedPads,
|
||||
bool aSkipNonPlatedPads );
|
||||
|
||||
void AddGraphicsShapesWithClearanceToContainer( const MODULE *aModule,
|
||||
void AddFPShapesWithClearanceToContainer( const MODULE *aModule,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId,
|
||||
int aInflateValue );
|
||||
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,
|
||||
void transformFPShapesToPolygon( const MODULE *aFootprint, PCB_LAYER_ID aLayer,
|
||||
SHAPE_POLY_SET& aCornerBuffer ) const;
|
||||
|
||||
public:
|
||||
|
|
|
@ -183,9 +183,9 @@ 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,
|
||||
void BOARD_ADAPTER::AddFPShapesWithClearanceToContainer( const MODULE* aModule,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId,
|
||||
int aInflateValue )
|
||||
|
@ -473,7 +473,7 @@ COBJECT2D *BOARD_ADAPTER::createNewPadDrill( const PAD* aPad, int aInflateValue
|
|||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::AddPadsShapesWithClearanceToContainer( const MODULE* aModule,
|
||||
void BOARD_ADAPTER::AddPadsWithClearanceToContainer( const MODULE* aModule,
|
||||
CGENERICCONTAINER2D *aDstContainer,
|
||||
PCB_LAYER_ID aLayerId,
|
||||
int aInflateValue,
|
||||
|
|
|
@ -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,
|
||||
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,10 +566,10 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
|||
// ADD PLATED PADS
|
||||
for( MODULE* footprint : m_board->Footprints() )
|
||||
{
|
||||
AddPadsShapesWithClearanceToContainer( footprint, m_platedpads_container2D_F_Cu, F_Cu,
|
||||
AddPadsWithClearanceToContainer( footprint, m_platedpads_container2D_F_Cu, F_Cu,
|
||||
0, true, false, true );
|
||||
|
||||
AddPadsShapesWithClearanceToContainer( footprint, m_platedpads_container2D_B_Cu, B_Cu,
|
||||
AddPadsWithClearanceToContainer( footprint, m_platedpads_container2D_B_Cu, B_Cu,
|
||||
0, true, false, true );
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
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,
|
||||
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,
|
||||
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<PCB_SHAPE*>( item ), layerContainer,
|
||||
curr_layer_id, 0 );
|
||||
break;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
AddShapeWithClearanceToContainer( (PCB_TEXT*) item, layerContainer, curr_layer_id,
|
||||
0 );
|
||||
AddShapeWithClearanceToContainer( static_cast<PCB_TEXT*>( 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<DIMENSION_BASE*>( 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,
|
||||
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,
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -60,11 +60,10 @@ void BOARD_ADAPTER::buildPadShapeThickOutlineAsPolygon( const PAD* aPad,
|
|||
}
|
||||
|
||||
|
||||
void BOARD_ADAPTER::transformGraphicModuleEdgeToPolygonSet( const MODULE *aModule,
|
||||
PCB_LAYER_ID aLayer,
|
||||
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 )
|
||||
{
|
||||
|
|
|
@ -749,27 +749,24 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent &event )
|
|||
{
|
||||
case PCB_PAD_T:
|
||||
{
|
||||
PAD* item = dynamic_cast<PAD *>( intersectedBoardItem );
|
||||
PAD* pad = dynamic_cast<PAD*>( 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() ) );
|
||||
pad->GetNet()->GetNetname(),
|
||||
pad->GetNet()->GetClassName(),
|
||||
pad->GetName() ) );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case PCB_MODULE_T:
|
||||
{
|
||||
MODULE* module = dynamic_cast<MODULE *>( intersectedBoardItem );
|
||||
MODULE* footprint = dynamic_cast<MODULE *>( 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<TRACK *>( intersectedBoardItem );
|
||||
TRACK* track = dynamic_cast<TRACK *>( 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<ZONE*>( intersectedBoardItem );
|
||||
ZONE* zone = dynamic_cast<ZONE*>( intersectedBoardItem );
|
||||
|
||||
if( item )
|
||||
if( zone && zone->IsOnCopperLayer() )
|
||||
{
|
||||
if( item->IsOnCopperLayer() )
|
||||
activityReporter.Report( wxString::Format( _( "Net %s\tNetClass %s" ),
|
||||
item->GetNet()->GetNetname(),
|
||||
item->GetNet()->GetClassName() ) );
|
||||
zone->GetNet()->GetNetname(),
|
||||
zone->GetNet()->GetClassName() ) );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -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() )
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -79,11 +79,11 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_
|
|||
// convert pads
|
||||
for( MODULE* footprint : m_footprints )
|
||||
{
|
||||
footprint->TransformPadsShapesWithClearanceToPolygon( aOutlines, aLayer, 0, maxError,
|
||||
footprint->TransformPadsWithClearanceToPolygon( aOutlines, aLayer, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
|
||||
// Micro-wave footprints may have items on copper layers
|
||||
footprint->TransformGraphicShapesWithClearanceToPolygonSet( aOutlines, aLayer, 0, maxError,
|
||||
footprint->TransformFPShapesWithClearanceToPolygon( aOutlines, aLayer, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,8 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_
|
|||
case PCB_TEXT_T:
|
||||
{
|
||||
PCB_TEXT* text = static_cast<PCB_TEXT*>( item );
|
||||
text->TransformShapeWithClearanceToPolygonSet( aOutlines, 0, maxError, ERROR_INSIDE );
|
||||
text->TransformShapeWithClearanceToPolygon( aOutlines, aLayer, 0, maxError,
|
||||
ERROR_INSIDE );
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -124,7 +125,7 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_
|
|||
}
|
||||
|
||||
|
||||
void MODULE::TransformPadsShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
void MODULE::TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearance,
|
||||
int aMaxError, ERROR_LOC aErrorLoc,
|
||||
bool aSkipNPTHPadsWihNoCopper,
|
||||
|
@ -222,7 +223,7 @@ 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,
|
||||
void MODULE::TransformFPShapesWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearance,
|
||||
int aError, ERROR_LOC aErrorLoc,
|
||||
bool aIncludeText,
|
||||
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
@ -435,7 +435,7 @@ void DIALOG_FOOTPRINT_FP_EDITOR::OnAdd3DModel( wxCommandEvent& )
|
|||
int selected = m_modelsGrid->GetGridCursorRow();
|
||||
|
||||
PROJECT& prj = Prj();
|
||||
MODULE_3D_SETTINGS model;
|
||||
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<MODULE_3D_SETTINGS>* draw3D = &m_footprint->Models();
|
||||
std::list<FP_3DMODEL>* draw3D = &m_footprint->Models();
|
||||
draw3D->clear();
|
||||
draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ private:
|
|||
UNIT_BINDER m_solderMask;
|
||||
UNIT_BINDER m_solderPaste;
|
||||
|
||||
std::vector<MODULE_3D_SETTINGS> m_shapes3D_list;
|
||||
std::vector<FP_3DMODEL> m_shapes3D_list;
|
||||
PANEL_PREV_3D* m_PreviewPane;
|
||||
|
||||
wxControl* m_delayedFocusCtrl;
|
||||
|
@ -65,7 +65,7 @@ private:
|
|||
|
||||
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;
|
||||
|
|
|
@ -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;
|
||||
|
@ -504,7 +504,7 @@ void DIALOG_FOOTPRINT_PROPERTIES::OnAdd3DModel( wxCommandEvent& )
|
|||
int selected = m_modelsGrid->GetGridCursorRow();
|
||||
|
||||
PROJECT& prj = Prj();
|
||||
MODULE_3D_SETTINGS model;
|
||||
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<MODULE_3D_SETTINGS>* draw3D = &m_footprint->Models();
|
||||
std::list<FP_3DMODEL>* draw3D = &m_footprint->Models();
|
||||
draw3D->clear();
|
||||
draw3D->insert( draw3D->end(), m_shapes3D_list.begin(), m_shapes3D_list.end() );
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ private:
|
|||
UNIT_BINDER m_solderMask;
|
||||
UNIT_BINDER m_solderPaste;
|
||||
|
||||
std::vector<MODULE_3D_SETTINGS> m_shapes3D_list;
|
||||
std::vector<FP_3DMODEL> m_shapes3D_list;
|
||||
PANEL_PREV_3D* m_PreviewPane;
|
||||
|
||||
wxString m_delayedErrorMessage;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 <deque>
|
||||
|
||||
|
@ -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<MODULE_3D_SETTINGS>& Models() { return m_3D_Drawings; }
|
||||
const std::list<MODULE_3D_SETTINGS>& Models() const { return m_3D_Drawings; }
|
||||
std::list<FP_3DMODEL>& Models() { return m_3D_Drawings; }
|
||||
const std::list<FP_3DMODEL>& Models() const { return m_3D_Drawings; }
|
||||
|
||||
void SetPosition( const wxPoint& aPos ) override;
|
||||
wxPoint GetPosition() const override { return m_Pos; }
|
||||
|
@ -357,7 +357,7 @@ 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,
|
||||
void TransformPadsWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
|
||||
PCB_LAYER_ID aLayer, int aClearance,
|
||||
int aMaxError, ERROR_LOC aErrorLoc,
|
||||
bool aSkipNPTHPadsWihNoCopper = false,
|
||||
|
@ -365,7 +365,7 @@ public:
|
|||
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,
|
||||
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,
|
||||
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<MODULE_3D_SETTINGS> m_3D_Drawings; // Linked list of 3D models.
|
||||
std::list<FP_3DMODEL> m_3D_Drawings; // Linked list of 3D models.
|
||||
std::map<wxString, wxString> 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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -303,11 +303,10 @@ void MICROWAVE_TOOL::createInductorBetween( const VECTOR2I& aStart, const VECTOR
|
|||
|
||||
wxString errorMessage;
|
||||
|
||||
auto inductorModule = std::unique_ptr<MODULE>( createMicrowaveInductor( pattern,
|
||||
errorMessage ) );
|
||||
auto inductorFP = std::unique_ptr<MODULE>( 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" ) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<wxPoint> polyPoints;
|
||||
|
@ -346,7 +346,7 @@ MODULE* MICROWAVE_TOOL::createPolygonShape()
|
|||
shape->SetWidth( 0 );
|
||||
PolyEdges.clear();
|
||||
|
||||
module->CalculateBoundingBox();
|
||||
footprint->CalculateBoundingBox();
|
||||
editFrame.OnModify();
|
||||
return module;
|
||||
return footprint;
|
||||
}
|
||||
|
|
|
@ -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() );
|
||||
}
|
||||
|
||||
|
|
|
@ -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<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
|
||||
|
|
|
@ -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,13 +757,13 @@ 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,
|
||||
footprint->TransformPadsWithClearanceToPolygon( initialPolys, layer, 0, maxError,
|
||||
ERROR_OUTSIDE );
|
||||
// add shapes inflated by aMinThickness/2 in areas
|
||||
module->TransformPadsShapesWithClearanceToPolygon( areas, layer, inflate, maxError,
|
||||
footprint->TransformPadsWithClearanceToPolygon( areas, layer, inflate, maxError,
|
||||
ERROR_OUTSIDE );
|
||||
}
|
||||
|
||||
|
|
|
@ -421,7 +421,7 @@ struct AMODEL
|
|||
wxString id;
|
||||
bool isEmbedded;
|
||||
|
||||
MODULE_3D_SETTINGS::VECTOR3D rotation;
|
||||
FP_3DMODEL::VECTOR3D rotation;
|
||||
|
||||
explicit AMODEL( ALTIUM_PARSER& aReader );
|
||||
};
|
||||
|
@ -529,8 +529,8 @@ struct ACOMPONENTBODY6
|
|||
wxString modelId;
|
||||
bool modelIsEmbedded;
|
||||
|
||||
MODULE_3D_SETTINGS::VECTOR3D modelPosition;
|
||||
MODULE_3D_SETTINGS::VECTOR3D modelRotation;
|
||||
FP_3DMODEL::VECTOR3D modelPosition;
|
||||
FP_3DMODEL::VECTOR3D modelRotation;
|
||||
double rotation;
|
||||
double bodyOpacity;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue