31 reserve( aGlyph.size() );
33 for(
const std::vector<VECTOR2D>& pointList : aGlyph )
34 push_back( pointList );
49 back().push_back( aPoint );
57 back().shrink_to_fit();
70 back().shrink_to_fit();
76 double aTilt,
const EDA_ANGLE& aAngle,
bool aMirror,
79 std::unique_ptr<STROKE_GLYPH> glyph = std::make_unique<STROKE_GLYPH>( *
this );
83 end.x *= aGlyphSize.
x;
84 end.y *= aGlyphSize.
y;
89 glyph->m_boundingBox.SetEnd(
end );
90 glyph->m_boundingBox.Offset( aOffset );
92 for( std::vector<VECTOR2D>& pointList : *glyph )
99 point.
x -= point.y * aTilt;
104 point.
x = aOrigin.
x - ( point.x - aOrigin.
x );
119 for( std::vector<VECTOR2D>& pointList : *
this )
136 const VECTOR2I& aPt3 )> aCallback )
const
148 aCallback( a, b, c );
164std::vector<std::unique_ptr<SHAPE_POLY_SET::TRIANGULATED_POLYGON>>
167 std::vector<std::unique_ptr<SHAPE_POLY_SET::TRIANGULATED_POLYGON>> data;
169 for(
const std::unique_ptr<SHAPE_POLY_SET::TRIANGULATED_POLYGON>& poly :
m_triangulatedPolys )
170 data.push_back( std::make_unique<SHAPE_POLY_SET::TRIANGULATED_POLYGON>( *poly ) );
177 std::vector<std::unique_ptr<SHAPE_POLY_SET::TRIANGULATED_POLYGON>>& aHintData )
constexpr const Vec & GetOrigin() const
constexpr const SizeVec & GetSize() const
void CacheTriangulation(bool aSimplify=false, const TASK_SUBMITTER &aSubmitter={}, bool aBuildIndexes=false) override
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
BOX2D BoundingBox() override
void Triangulate(std::function< void(const VECTOR2I &aPt1, const VECTOR2I &aPt2, const VECTOR2I &aPt3)> aCallback) const
std::vector< std::unique_ptr< SHAPE_POLY_SET::TRIANGULATED_POLYGON > > GetTriangulationData() const
void AddPoint(const VECTOR2D &aPoint)
void Move(const VECTOR2I &aOffset)
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 aSimplify, std::vector< std::unique_ptr< TRIANGULATED_POLYGON > > *aHintData, const TASK_SUBMITTER &aSubmitter={}, bool aBuildIndexes=false)
virtual void CacheTriangulation(bool aSimplify=false, const TASK_SUBMITTER &aSubmitter={}, bool aBuildIndexes=false)
Build a polygon triangulation, needed to draw a polygon on OpenGL and in some other calculations.
std::vector< std::unique_ptr< TRIANGULATED_POLYGON > > m_triangulatedPolys
const TRIANGULATED_POLYGON * TriangulatedPolygon(int aIndex) const
unsigned int TriangulatedPolyCount() const
Return the number of triangulated polygons.
std::function< void(std::function< void()>)> TASK_SUBMITTER
Callback that submits a unit of work for asynchronous execution.
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)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D