Make FP_SHAPE GetEffectiveShape() relative to board, not footprint.

This commit is contained in:
Jeff Young 2020-11-14 14:14:34 +00:00
parent aa06de2db4
commit 74ad1562d9
3 changed files with 17 additions and 1 deletions

View File

@ -106,6 +106,17 @@ void FP_SHAPE::SetDrawCoord()
} }
std::shared_ptr<SHAPE> FP_SHAPE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const
{
std::vector<SHAPE*> shapes = MakeEffectiveShapes();
for( SHAPE* shape : shapes )
shape->Move( m_Parent->GetPosition() );
return std::make_shared<SHAPE_COMPOUND>( shapes );
}
// see class_edge_mod.h // see class_edge_mod.h
void FP_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) void FP_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{ {

View File

@ -130,6 +130,11 @@ public:
*/ */
void SetDrawCoord(); void SetDrawCoord();
/**
* Makes a set of SHAPE objects representing the FP_SHAPE. Caller owns the objects.
*/
std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override; void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
wxString GetClass() const override wxString GetClass() const override

View File

@ -285,7 +285,7 @@ public:
* Makes a set of SHAPE objects representing the PCB_SHAPE. Caller owns the objects. * Makes a set of SHAPE objects representing the PCB_SHAPE. Caller owns the objects.
*/ */
std::vector<SHAPE*> MakeEffectiveShapes() const; // fixme: move to shape_compound std::vector<SHAPE*> MakeEffectiveShapes() const; // fixme: move to shape_compound
virtual std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override; std::shared_ptr<SHAPE> GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override; void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;