KiCad PCB EDA Suite
CollisionFixture Struct Reference

Fixture for the Collision test suite. More...

Public Member Functions

 CollisionFixture ()
 Constructor. More...
 
 ~CollisionFixture ()
 

Public Attributes

struct KI_TEST::CommonTestData common
 
std::vector< VECTOR2IcollidingPoints
 
std::vector< VECTOR2InonCollidingPoints
 

Detailed Description

Fixture for the Collision test suite.

It contains an instance of the common data and two vectors containing colliding and non-colliding points.

Definition at line 36 of file test_shape_poly_set_collision.cpp.

Constructor & Destructor Documentation

◆ CollisionFixture()

CollisionFixture::CollisionFixture ( )
inline

Constructor.

Definition at line 47 of file test_shape_poly_set_collision.cpp.

48  {
49  // Create points colliding with the poly set.
50 
51  // Inside the polygon
52  collidingPoints.emplace_back( 10, 90 );
53 
54  // Inside the polygon, but on a re-entrant angle of a hole
55  collidingPoints.emplace_back( 15, 16 );
56 
57  // On a hole edge => inside the polygon
58  collidingPoints.emplace_back( 40, 25 );
59 
60  // On the outline edge => inside the polygon
61  collidingPoints.emplace_back( 0, 10 );
62 
63  // Create points not colliding with the poly set.
64 
65  // Completely outside of the polygon
66  nonCollidingPoints.emplace_back( 200, 200 );
67 
68  // Inside the outline and inside a hole => outside the polygon
69  nonCollidingPoints.emplace_back( 15, 12 );
70  }
std::vector< VECTOR2I > collidingPoints
std::vector< VECTOR2I > nonCollidingPoints

References collidingPoints, and nonCollidingPoints.

◆ ~CollisionFixture()

CollisionFixture::~CollisionFixture ( )
inline

Definition at line 72 of file test_shape_poly_set_collision.cpp.

73  {
74  }

Member Data Documentation

◆ collidingPoints

std::vector<VECTOR2I> CollisionFixture::collidingPoints

Definition at line 42 of file test_shape_poly_set_collision.cpp.

Referenced by CollisionFixture().

◆ common

struct KI_TEST::CommonTestData CollisionFixture::common

Definition at line 39 of file test_shape_poly_set_collision.cpp.

◆ nonCollidingPoints

std::vector<VECTOR2I> CollisionFixture::nonCollidingPoints

Definition at line 42 of file test_shape_poly_set_collision.cpp.

Referenced by CollisionFixture().


The documentation for this struct was generated from the following file: