67 const std::vector<ARRAY_OPTIONS::TRANSFORM>& aExp )
69 std::vector<ARRAY_OPTIONS::TRANSFORM> transforms;
76 BOOST_CHECK_EQUAL( transforms.size(), aExp.size() );
78 for(
unsigned i = 0; i < std::min( transforms.size(), aExp.size() ); ++i )
80 BOOST_TEST_CONTEXT(
"Index " << i )
209 "2x3 rect alternate",
263 BOOST_TEST_CONTEXT( c.m_case_name )
267 grid_opts.
m_nx = c.m_geom.m_nx;
268 grid_opts.
m_ny = c.m_geom.m_ny;
269 grid_opts.
m_delta = c.m_geom.m_delta;
270 grid_opts.
m_offset = c.m_geom.m_offset;
271 grid_opts.
m_stagger = c.m_geom.m_stagger;
302 "Quad, no rotate items",
319 "Quad, rotate items",
335 "Three pts, 90 deg angle",
360 BOOST_TEST_CONTEXT( c.m_case_name )
364 grid_opts.
m_nPts = c.m_geom.n;
366 grid_opts.
m_centre = c.m_geom.centre;
381 std::vector<std::string> names;
388 BOOST_CHECK_EQUAL_COLLECTIONS( names.begin(), names.end(), aExp.begin(), aExp.end() );
427 {
"1",
"2",
"3",
"4",
"5",
"6" },
442 {
"A1",
"B1",
"A2",
"B2",
"A3",
"B3" },
459 {
"11",
"21",
"31",
"12",
"22",
"32" },
474 {
"5Z",
"6Z",
"5AA",
"6AA",
"5AB",
"6AB" },
487 BOOST_TEST_CONTEXT( c.m_case_name )
491 grid_opts.
m_nx = c.m_prms.m_nx;
492 grid_opts.
m_ny = c.m_prms.m_ny;
constexpr EDA_IU_SCALE schIUScale
bool SetOffset(const wxString &aOffsetName)
Set the axis start (as a string, which should decode to a valid index in the alphabet)
void SetAxisType(NUMBERING_TYPE aType)
Set the axis numbering type.
@ NUMBERING_NUMERIC
Arabic numerals: 0,1,2,3,4,5,6,7,8,9,10,11...
@ NUMBERING_ALPHA_FULL
Full 26-character alphabet.
Options that govern the setup of an "array" of multiple item.
virtual int GetArraySize() const =0
The number of points in this array.
virtual wxString GetItemNumber(int n) const =0
Get the position number (name) for the n'th array point.
virtual TRANSFORM GetTransform(int aN, const VECTOR2I &aPos) const =0
Get the transform of the n-th point in the array.
long m_nPts
number of point in the array
EDA_ANGLE m_angle
angle between points, or 0 for each point separated by this value (decideg)
bool m_horizontalThenVertical
bool m_reverseNumberingAlternate
std::vector< ARRAY_OPTIONS::TRANSFORM > m_exp_transforms
CIRC_ARRAY_GEOM_PARAMS m_geom
constexpr int mmToIU(double mm) const
std::vector< std::string > m_exp_names
GRID_ARRAY_NAMING_PARAMS m_prms
ARRAY_AXIS::NUMBERING_TYPE m_pri_type
ARRAY_AXIS::NUMBERING_TYPE m_sec_type
GRID_ARRAY_GEOM_PARAMS m_geom
std::vector< ARRAY_OPTIONS::TRANSFORM > m_exp_transforms
void CheckArrayTransforms(const ARRAY_OPTIONS &aOpts, const VECTOR2I &aPos, const std::vector< ARRAY_OPTIONS::TRANSFORM > &aExp)
Generate all array transforms for an array descriptor and compare against a list of expected transfor...
static const std::vector< CIRC_ARRAY_TEST_CASE > circ_geom_cases
static const std::vector< GRID_ARRAY_TEST_CASE > grid_geom_cases
BOOST_AUTO_TEST_CASE(GridGeometry)
Test of grid array geometry.
std::ostream & boost_test_print_type(std::ostream &os, const ARRAY_OPTIONS::TRANSFORM &aObj)
Define a stream function for logging this type.
void CheckArrayNumbering(const ARRAY_OPTIONS &aOpts, const std::vector< std::string > &aExp)
Generate all array names and check against expected.
bool TransformIsClose(const ARRAY_OPTIONS::TRANSFORM &aL, const ARRAY_OPTIONS::TRANSFORM &aR)
Predicate to see if a ARRAY_OPTIONS::TRANSFORM is equal or nearly equal.
static const std::vector< GRID_ARRAY_NAMING_CASE > grid_name_cases
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()