35 base_set.
Append( 0, 0, -1, -1,
true );
36 base_set.
Append( 0, 10, -1, -1,
true );
37 base_set.
Append( 10, 10, -1, -1,
true );
38 base_set.
Append( 10, 10, -1, -1,
true );
39 base_set.
Append( 10, 10, -1, -1,
true );
40 base_set.
Append( 10, 10, -1, -1,
true );
41 base_set.
Append( 10, 0, -1, -1,
true );
45 BOOST_CHECK_EQUAL( removed, 3 );
51 base_set.
Append( 0, 0, -1, -1,
true );
52 base_set.
Append( 0, 10, -1, -1,
true );
53 base_set.
Append( 0, 10, -1, -1,
true );
54 base_set.
Append( 10, 10, -1, -1,
true );
55 base_set.
Append( 10, 10, -1, -1,
true );
56 base_set.
Append( 10, 0, -1, -1,
true );
57 base_set.
Append( 10, 0, -1, -1,
true );
58 base_set.
Append( 0, 0, -1, -1,
true );
62 BOOST_CHECK_EQUAL( removed, 4 );
71 base_set.
Append( 0, 0, -1, -1,
true );
72 base_set.
Append( 0, 10, -1, -1,
true );
73 base_set.
Append( 10, 10, -1, -1,
true );
74 base_set.
Append( 10, 0, -1, -1,
true );
116 base_set.
Append( 0, 0, -1, -1,
true );
117 base_set.
Append( 0, 10, -1, -1,
true );
118 base_set.
Append( 10, 10, -1, -1,
true );
119 base_set.
Append( 10, 0, -1, -1,
true );
122 base_set.
Append( 20, 0, -1, -1,
true );
123 base_set.
Append( 20, 10, -1, -1,
true );
124 base_set.
Append( 30, 10, -1, -1,
true );
125 base_set.
Append( 30, 0, -1, -1,
true );
Represent a set of closed polygons.
int VertexCount(int aOutline=-1, int aHole=-1) const
Return the number of vertices in a given outline/hole.
void DeletePolygon(int aIdx)
Delete aIdx-th polygon from the set.
int FullPointCount() const
Return the number of points in the shape poly set.
int RemoveNullSegments()
Look for null segments; ie, segments whose ends are exactly the same and deletes them.
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)
bool GetNeighbourIndexes(int aGlobalIndex, int *aPrevious, int *aNext) const
Return the global indexes of the previous and the next corner of the aGlobalIndex-th corner of a cont...
int NewOutline()
Creates a new empty polygon in the set and returns its index.
int OutlineCount() const
Return the number of outlines in the set.
Numerical test predicates.
BOOST_TEST(box.ClosestPointTo(VECTOR2D(0, 0))==VECTOR2D(1, 2))
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(RemoveNullSegments)