20#include <boost/test/unit_test.hpp>
107 line.
SetDragPolicy( std::make_unique<POLYGON_EDGE_DRAG_POLICY>( line, points ) );
129 line.
SetDragPolicy( std::make_unique<POLYGON_EDGE_DRAG_POLICY>( line, points ) );
161 line.
SetDragPolicy( std::make_unique<POLYGON_EDGE_DRAG_POLICY>( line, points ) );
183 void Push(
const wxString&,
int )
override {}
216 "finalizing a collapsed polygon stripped every corner" );
A base class for most all the KiCad significant classes used in schematics and boards.
virtual EDA_ITEM * Clone() const
Create a duplicate of this item with linked list members set to NULL.
"Standard" polygon editing behavior for EDA_SHAPE polygons.
void FinalizeItem(EDIT_POINTS &aPoints, COMMIT &aCommit) override
Finalize the edit operation.
SHAPE_POLY_SET & GetPolyShape()
EDA_SHAPE(SHAPE_T aType, int aLineWidth, FILL_T aFill)
virtual void SetPolyShape(const SHAPE_POLY_SET &aShape)
Represent a line connecting two EDIT_POINTs.
virtual void SetPosition(const VECTOR2I &aPosition) override
Return coordinates of an EDIT_POINT.
POLYGON_EDGE_DRAG_POLICY * GetDragPolicy() const
void SetRelation(std::unique_ptr< EDIT_RELATION > aRelation)
Set a relation for an EDIT_LINE.
virtual void ApplyRelation(const GRID_HELPER &aGrid) override
Correct coordinates of an EDIT_POINT by applying its relation.
EDIT_POINT & GetEnd()
Return the end EDIT_POINT.
EDIT_POINT & GetOrigin()
Return the origin EDIT_POINT.
void SetDragPolicy(std::unique_ptr< POLYGON_EDGE_DRAG_POLICY > aPolicy)
EDIT_POINTS is a VIEW_ITEM that manages EDIT_POINTs and EDIT_LINEs and draws them.
void AddPoint(const EDIT_POINT &aPoint)
Add an EDIT_POINT.
EDIT_LINE & Line(unsigned int aIndex)
EDIT_POINT & Point(unsigned int aIndex)
void AddLine(const EDIT_LINE &aLine)
Adds an EDIT_LINE.
Represent a single point that can be used for modifying items.
int GetY() const
Return Y coordinate of an EDIT_POINT.
EDIT_RELATION * GetRelation() const
Return the relation imposed on an EDIT_POINT.
virtual void ApplyRelation(const GRID_HELPER &aGrid)
Correct coordinates of an EDIT_POINT by applying its relation.
virtual VECTOR2I GetPosition() const
Return coordinates of an EDIT_POINT.
int GetX() const
Return X coordinate of an EDIT_POINT.
void SetRelation(std::unique_ptr< EDIT_RELATION > aRelation)
Set a relation for an EDIT_POINT.
static std::unique_ptr< EDIT_RELATION > PerpendicularTranslation(const EDIT_LINE &aLine)
static std::unique_ptr< EDIT_RELATION > SameX(const EDIT_POINT &aReference)
EDIT_RELATION_KIND Kind() const
POLYGON_LINE_MODE GetMode() const
static void BuildForPolyOutline(EDIT_POINTS &aPoints, const SHAPE_POLY_SET &aOutline)
Build the edit points for the given polygon outline.
void Push(const wxString &, int) override
Execute the changes.
void Revert() override
Revert the commit by restoring the modified items state.
void RevertToCheckpoint(int aCheckpoint) override
EDA_ITEM * undoLevelItem(EDA_ITEM *aItem) const override
EDA_ITEM * ResolveItem(KIID &aID) override
Search for an item in this commit that matches the provided KIID.
EDA_ITEM * makeImage(EDA_ITEM *aItem) const override
Represent a set of closed polygons.
void SetVertex(const VERTEX_INDEX &aIndex, const VECTOR2I &aPos)
Accessor function to set the position of a specific point.
int TotalVertices() const
Return total number of vertices stored in the set.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
int NewOutline()
Creates a new empty polygon in the set and returns its index.
int NewHole(int aOutline=-1)
Creates a new hole in a given outline.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(PointRelationsExposeTypedSemantics)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I