KiCad PCB EDA Suite
|
#include <geometry/shape_arc.h>
#include <geometry/shape_line_chain.h>
#include <trigo.h>
#include <qa_utils/geometry/geometry.h>
#include <qa_utils/numeric.h>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include "geom_test_utils.h"
Go to the source code of this file.
Classes | |
struct | SLC_CASES |
NOTE: Collision of SHAPE_LINE_CHAIN with arcs is tested in test_shape_arc.cpp. More... | |
struct | CLOSE_TOGGLE_SHAPE_CASE |
struct | REMOVE_SHAPE_CASE |
Functions | |
BOOST_AUTO_TEST_CASE (ClipperConstructorCase1) | |
BOOST_AUTO_TEST_CASE (ArcToPolyline) | |
BOOST_AUTO_TEST_CASE (ArcToPolylineLargeCoords) | |
BOOST_AUTO_TEST_CASE (SetClosedDuplicatePoint) | |
BOOST_AUTO_TEST_CASE (ToggleClosed) | |
BOOST_AUTO_TEST_CASE (PointInPolygon) | |
BOOST_AUTO_TEST_CASE (SimplifyDuplicatePoint) | |
BOOST_AUTO_TEST_CASE (SimplifyKeepEndPoint) | |
BOOST_AUTO_TEST_CASE (SimplifyPNSChain) | |
BOOST_AUTO_TEST_CASE (SimplifyComplexChain) | |
BOOST_AUTO_TEST_CASE (RemoveShape) | |
BOOST_AUTO_TEST_CASE (RemoveShapeAfterSimplify) | |
BOOST_AUTO_TEST_CASE (ShapeCount) | |
BOOST_AUTO_TEST_CASE (NextShape) | |
BOOST_AUTO_TEST_CASE (AppendArc) | |
BOOST_AUTO_TEST_CASE (ArcWrappingToStartSharedPoints) | |
BOOST_AUTO_TEST_CASE (Split) | |
BOOST_AUTO_TEST_CASE (Slice) | |
BOOST_AUTO_TEST_CASE (NearestPointPt) | |
BOOST_AUTO_TEST_CASE (ReplaceChain) | |
Variables | |
static const std::vector< CLOSE_TOGGLE_SHAPE_CASE > | close_toggle_shape_cases |
static const std::vector< REMOVE_SHAPE_CASE > | remove_shape_cases |
BOOST_AUTO_TEST_CASE | ( | AppendArc | ) |
Definition at line 696 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::ArcCount(), SHAPE_LINE_CHAIN::GetPoint(), GEOM_TEST::IsOutlineValid(), and SHAPE_LINE_CHAIN::PointCount().
BOOST_AUTO_TEST_CASE | ( | ArcToPolyline | ) |
Definition at line 203 of file test_shape_line_chain.cpp.
References ANGLE_180, SHAPE_LINE_CHAIN::CPoints(), SHAPE_LINE_CHAIN::CShapes(), and GEOM_TEST::IsOutlineValid().
BOOST_AUTO_TEST_CASE | ( | ArcToPolylineLargeCoords | ) |
Definition at line 236 of file test_shape_line_chain.cpp.
References ANGLE_180, SHAPE_LINE_CHAIN::Append(), and GEOM_TEST::IsOutlineValid().
BOOST_AUTO_TEST_CASE | ( | ArcWrappingToStartSharedPoints | ) |
Definition at line 785 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::IsArcEnd(), SHAPE_LINE_CHAIN::IsArcStart(), SHAPE_LINE_CHAIN::IsPtOnArc(), SHAPE_LINE_CHAIN::IsSharedPt(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::SetClosed().
BOOST_AUTO_TEST_CASE | ( | ClipperConstructorCase1 | ) |
Definition at line 129 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::ArcCount(), SHAPE_LINE_CHAIN::IsClosed(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::ShapeCount().
BOOST_AUTO_TEST_CASE | ( | NearestPointPt | ) |
Definition at line 1207 of file test_shape_line_chain.cpp.
References SEG::A, ANGLE_180, SEG::B, SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), and GEOM_TEST::IsOutlineValid().
BOOST_AUTO_TEST_CASE | ( | NextShape | ) |
Definition at line 637 of file test_shape_line_chain.cpp.
BOOST_AUTO_TEST_CASE | ( | PointInPolygon | ) |
Definition at line 370 of file test_shape_line_chain.cpp.
BOOST_AUTO_TEST_CASE | ( | RemoveShape | ) |
Definition at line 578 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::ArcCount(), GEOM_TEST::IsOutlineValid(), remove_shape_cases, SHAPE_LINE_CHAIN::RemoveShape(), and SHAPE_LINE_CHAIN::ShapeCount().
BOOST_AUTO_TEST_CASE | ( | RemoveShapeAfterSimplify | ) |
Definition at line 597 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::ArcCount(), GEOM_TEST::IsOutlineValid(), remove_shape_cases, SHAPE_LINE_CHAIN::RemoveShape(), SHAPE_LINE_CHAIN::ShapeCount(), and SHAPE_LINE_CHAIN::Simplify().
BOOST_AUTO_TEST_CASE | ( | ReplaceChain | ) |
Definition at line 1237 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::CLastPoint(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::Replace(), and SHAPE_LINE_CHAIN::SetWidth().
BOOST_AUTO_TEST_CASE | ( | SetClosedDuplicatePoint | ) |
Definition at line 279 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::CPoints(), SHAPE_LINE_CHAIN::CShapes(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::SetClosed().
BOOST_AUTO_TEST_CASE | ( | ShapeCount | ) |
Definition at line 620 of file test_shape_line_chain.cpp.
BOOST_AUTO_TEST_CASE | ( | SimplifyComplexChain | ) |
Definition at line 468 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::SetClosed(), and SHAPE_LINE_CHAIN::Simplify().
BOOST_AUTO_TEST_CASE | ( | SimplifyDuplicatePoint | ) |
Definition at line 401 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::CPoints(), SHAPE_LINE_CHAIN::CShapes(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::Simplify().
BOOST_AUTO_TEST_CASE | ( | SimplifyKeepEndPoint | ) |
Definition at line 421 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::CPoints(), SHAPE_LINE_CHAIN::CShapes(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::SetClosed(), and SHAPE_LINE_CHAIN::Simplify().
BOOST_AUTO_TEST_CASE | ( | SimplifyPNSChain | ) |
Definition at line 441 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::Simplify().
BOOST_AUTO_TEST_CASE | ( | Slice | ) |
CASE 1: Start at arc endpoint, finish middle of arc /
CASE 2: Start at middle of an arc, finish at arc startpoint /
CASE 3: Full arc, nothing else /
CASE 4: Full arc, and straight segments to next arc start /
Definition at line 917 of file test_shape_line_chain.cpp.
References SEG::A, ANGLE_180, SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::Arc(), SHAPE_LINE_CHAIN::ArcCount(), SEG::B, SHAPE_ARC::Collide(), SHAPE_ARC::ConstructFromStartEndCenter(), SHAPE_ARC::DefaultAccuracyForPCB(), SHAPE_ARC::GetArcMid(), SHAPE_ARC::GetCenter(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_LINE_CHAIN::GetPoint(), SHAPE_LINE_CHAIN::IsArcEnd(), SHAPE_LINE_CHAIN::IsArcStart(), SHAPE_ARC::IsClockwise(), GEOM_TEST::IsOutlineValid(), SLC_CASES::OnePoint, SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::Slice(), and SLC_CASES::TwoPoints.
BOOST_AUTO_TEST_CASE | ( | Split | ) |
Definition at line 843 of file test_shape_line_chain.cpp.
References SEG::A, ANGLE_180, SHAPE_LINE_CHAIN::ArcCount(), SEG::B, SHAPE_ARC::GetP0(), SHAPE_LINE_CHAIN::GetPoint(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::IsSharedPt(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::Split().
BOOST_AUTO_TEST_CASE | ( | ToggleClosed | ) |
Definition at line 344 of file test_shape_line_chain.cpp.
References close_toggle_shape_cases, SHAPE_LINE_CHAIN::IsClosed(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::SetClosed(), and SHAPE_LINE_CHAIN::ShapeCount().
|
static |
Definition at line 326 of file test_shape_line_chain.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 509 of file test_shape_line_chain.cpp.
Referenced by BOOST_AUTO_TEST_CASE().