pcbnew: made TransformShapeWithClearanceToPolygon virtual

This commit is contained in:
Tomasz Włostowski 2017-11-29 19:51:01 +01:00
parent c6a15f1b9b
commit 58ce865352
7 changed files with 33 additions and 4 deletions

View File

@ -39,7 +39,7 @@
class BOARD; class BOARD;
class BOARD_ITEM_CONTAINER; class BOARD_ITEM_CONTAINER;
class EDA_DRAW_PANEL; class EDA_DRAW_PANEL;
class SHAPE_POLY_SET;
/** /**
* Enum STROKE_T * Enum STROKE_T
@ -334,6 +334,11 @@ public:
static std::string FormatInternalUnits( const wxSize& aSize ); static std::string FormatInternalUnits( const wxSize& aSize );
virtual void ViewGetLayers( int aLayers[], int& aCount ) const override; virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
virtual void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue,
int aCircleToSegmentsCount,
double aCorrectionFactor ) const;
}; };
#endif /* BOARD_ITEM_STRUCT_H */ #endif /* BOARD_ITEM_STRUCT_H */

View File

@ -1251,3 +1251,12 @@ void CreateThermalReliefPadPolygon( SHAPE_POLY_SET& aCornerBuffer,
; ;
} }
} }
void ZONE_CONTAINER::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue,
int aCircleToSegmentsCount,
double aCorrectionFactor ) const
{
aCornerBuffer = m_FilledPolysList;
aCornerBuffer.Simplify( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
}

View File

@ -31,6 +31,7 @@
#include <fctsys.h> #include <fctsys.h>
#include <common.h> #include <common.h>
#include <pcbnew.h> #include <pcbnew.h>
#include <wx/debug.h>
#include <class_board.h> #include <class_board.h>
#include <string> #include <string>
@ -264,3 +265,11 @@ void BOARD_ITEM::SwapData( BOARD_ITEM* aImage )
{ {
} }
void BOARD_ITEM::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue,
int aCircleToSegmentsCount,
double aCorrectionFactor ) const
{
wxASSERT_MSG(false, wxT("Called TransformShapeWithClearanceToPolygon() on unsupported BOARD_ITEM."));
};

View File

@ -230,7 +230,7 @@ public:
void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue, int aClearanceValue,
int aCircleToSegmentsCount, int aCircleToSegmentsCount,
double aCorrectionFactor ) const; double aCorrectionFactor ) const override;
virtual wxString GetSelectMenuText() const override; virtual wxString GetSelectMenuText() const override;

View File

@ -428,7 +428,7 @@ public:
void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue, int aClearanceValue,
int aCircleToSegmentsCount, int aCircleToSegmentsCount,
double aCorrectionFactor ) const; double aCorrectionFactor ) const override;
/** /**
* Function GetClearance * Function GetClearance

View File

@ -194,7 +194,7 @@ public:
void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue, int aClearanceValue,
int aCircleToSegmentsCount, int aCircleToSegmentsCount,
double aCorrectionFactor ) const; double aCorrectionFactor ) const override;
/** /**
* Function IsPointOnEnds * Function IsPointOnEnds
* returns STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if * returns STARTPOINT if point if near (dist = min_dist) start point, ENDPOINT if

View File

@ -360,6 +360,12 @@ public:
void TransformOutlinesShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer, void TransformOutlinesShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aMinClearanceValue, int aMinClearanceValue,
bool aUseNetClearance ); bool aUseNetClearance );
void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
int aClearanceValue,
int aCircleToSegmentsCount,
double aCorrectionFactor ) const override;
/** /**
* Function HitTestForCorner * Function HitTestForCorner
* tests if the given wxPoint is near a corner. * tests if the given wxPoint is near a corner.