30 reserve( aGlyph.size() );
32 for(
const std::vector<VECTOR2D>& pointList : aGlyph )
33 push_back( pointList );
48 back().push_back( aPoint );
56 back().shrink_to_fit();
69 back().shrink_to_fit();
75 double aTilt,
const EDA_ANGLE& aAngle,
bool aMirror,
78 std::unique_ptr<STROKE_GLYPH> glyph = std::make_unique<STROKE_GLYPH>( *
this );
80 VECTOR2D end = glyph->m_boundingBox.GetEnd();
82 end.
x *= aGlyphSize.
x;
83 end.
y *= aGlyphSize.
y;
86 end.
x -= end.
y * aTilt;
88 glyph->m_boundingBox.SetEnd( end );
89 glyph->m_boundingBox.Offset( aOffset );
91 for( std::vector<VECTOR2D>& pointList : *glyph.get() )
98 point.
x -= point.y * aTilt;
103 point.
x = aOrigin.
x - ( point.x - aOrigin.
x );
123 const VECTOR2I& aPt3 )> aCallback )
const
138 aCallback( a, b, c );
const Vec & GetOrigin() const
const Vec & GetSize() const
BOX2D BoundingBox() override
void Triangulate(std::function< void(const VECTOR2I &aPt1, const VECTOR2I &aPt2, const VECTOR2I &aPt3)> aCallback) const
void AddPoint(const VECTOR2D &aPoint)
std::unique_ptr< GLYPH > Transform(const VECTOR2D &aGlyphSize, const VECTOR2I &aOffset, double aTilt, const EDA_ANGLE &aAngle, bool aMirror, const VECTOR2I &aOrigin)
size_t GetTriangleCount() const
void GetTriangle(int index, VECTOR2I &a, VECTOR2I &b, VECTOR2I &c) const
void CacheTriangulation(bool aPartition=true, bool aSimplify=false)
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
const TRIANGULATED_POLYGON * TriangulatedPolygon(int aIndex) const
unsigned int TriangulatedPolyCount() const
Return the number of triangulated polygons.
const BOX2I BBox(int aClearance=0) const override
Compute a bounding box of the shape, with a margin of aClearance a collision.
static bool empty(const wxTextEntryBase *aCtrl)
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)