KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_eda_angle.cpp File Reference
#include <boost/test/tools/context.hpp>
#include <cmath>
#include <iomanip>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <geometry/eda_angle.h>

Go to the source code of this file.

Classes

struct  EDA_ANGLE_NORMALISE_CASE
 

Functions

 BOOST_AUTO_TEST_CASE (Normalize)
 
 BOOST_AUTO_TEST_CASE (NormalizeHugeAndNonFinite)
 
static double refStep (double aValue, double aLow, bool aLowIncl, double aHigh, bool aHighIncl, double aPeriod)
 Reference copy of the stepping loops that normalization used before exact folding.
 
static bool refIsCardinal (double aValue)
 
static bool refIsCardinal90 (double aValue)
 
static EDA_ANGLE deg (double d)
 
static EDA_ORIENTATION orientation (double d)
 
 BOOST_AUTO_TEST_CASE (NormalizeMatchesSteppingLoops)
 
 BOOST_AUTO_TEST_CASE (ConstantAngles)
 
 BOOST_AUTO_TEST_CASE (Snapped)
 
 BOOST_AUTO_TEST_CASE (AngleReflect)
 
 BOOST_AUTO_TEST_CASE (Orientation)
 
 BOOST_AUTO_TEST_CASE (OrientationReflect)
 

Variables

static const std::vector< EDA_ANGLE_NORMALISE_CASE > normalize_cases
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/8]

BOOST_AUTO_TEST_CASE ( AngleReflect )

◆ BOOST_AUTO_TEST_CASE() [2/8]

BOOST_AUTO_TEST_CASE ( ConstantAngles )

◆ BOOST_AUTO_TEST_CASE() [3/8]

◆ BOOST_AUTO_TEST_CASE() [4/8]

◆ BOOST_AUTO_TEST_CASE() [5/8]

BOOST_AUTO_TEST_CASE ( NormalizeMatchesSteppingLoops )

◆ BOOST_AUTO_TEST_CASE() [6/8]

BOOST_AUTO_TEST_CASE ( Orientation )

◆ BOOST_AUTO_TEST_CASE() [7/8]

BOOST_AUTO_TEST_CASE ( OrientationReflect )

Definition at line 353 of file test_eda_angle.cpp.

References BOOST_CHECK_EQUAL(), deg(), and orientation().

◆ BOOST_AUTO_TEST_CASE() [8/8]

BOOST_AUTO_TEST_CASE ( Snapped )

◆ deg()

◆ orientation()

static EDA_ORIENTATION orientation ( double d)
static

Definition at line 183 of file test_eda_angle.cpp.

References deg().

Referenced by PCB_IO_IPC2581::addPackage(), ORCAD_CONVERTER::addSymbolPin(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ZONE_FILLER::buildThermalSpokes(), ALTIUM_PCB::ConvertComponentBody6ToFootprintItem(), SHAPE_LINE_CHAIN::convertToClipper2(), PCB_IO_EASYEDAPRO_PARSER::createPAD(), PADS_SCH::PADS_SCH_SYMBOL_BUILDER::createPin(), PCB_IO_EASYEDAPRO_V3_PARSER::createV3PAD(), KIGFX::PCB_PAINTER::drawDrillMarks(), BOARD::ExchangeFootprint(), PCB_IO_EASYEDA::FootprintLoad(), DSN::SPECCTRA_DB::FromSESSION(), SCH_SYMBOL::GetOrientationProp(), CADSTAR_SCH_ARCHIVE_LOADER::getSpinStyle(), SCH_IO_KICAD_LEGACY::loadPageSettings(), SCH_IO_KICAD_LEGACY_LIB_CACHE::loadPin(), SCH_IO_PADS::LoadSchematicFile(), SCH_IO_KICAD_LEGACY::loadSymbol(), SYMBOL_EDIT_FRAME::LoadSymbolFromSchematic(), OrcadReadDrawnInstance(), OrcadReadGraphicInst(), OrcadReadPlacedInstance(), SCH_IO_ALTIUM::ParseComponent(), ALTIUM_PCB::ParseComponentsBodies6Data(), PCB_IO_KICAD_SEXPR_PARSER::parseDIMENSION(), PADS_SCH::PADS_SCH_PARSER::parseSymbolDef(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), PCB_IO_KICAD_SEXPR_PARSER::parseZONE(), ORCAD_CONVERTER::placeBitmap(), FOOTPRINT::Rotate(), SCH_IO_KICAD_SEXPR::saveSymbol(), SCH_WRITER_V10::saveSymbol(), SCH_WRITER_V9::saveSymbol(), SCH_SYMBOL::SetMirrorX(), SCH_SYMBOL::SetMirrorY(), SetTextPositioning(), SCH_IO_GEDA::toKiCadOrientation(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataToWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow().

◆ refIsCardinal()

static bool refIsCardinal ( double aValue)
static

Definition at line 154 of file test_eda_angle.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ refIsCardinal90()

static bool refIsCardinal90 ( double aValue)
static

Definition at line 166 of file test_eda_angle.cpp.

References std::abs().

Referenced by BOOST_AUTO_TEST_CASE().

◆ refStep()

static double refStep ( double aValue,
double aLow,
bool aLowIncl,
double aHigh,
bool aHighIncl,
double aPeriod )
static

Reference copy of the stepping loops that normalization used before exact folding.

They are exact at the magnitudes sampled here, so the folded versions must match them bit for bit, signed zero included.

Definition at line 142 of file test_eda_angle.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

Variable Documentation

◆ normalize_cases

const std::vector<EDA_ANGLE_NORMALISE_CASE> normalize_cases
static
Initial value:
=
{
{ 90.0, 90.0, -270.0, 90.0, 90.0, 90.0 },
{ -90.0, 270.0, -90.0, -90.0, -90.0, -90.0 },
{ 135.0, 135.0, -225.0, -45.0, 135.0, 135.0 },
{ -135.0, 225.0, -135.0, 45.0, -135.0, -135.0 },
{ 180.0, 180.0, -180.0, 0.0, 180.0, 180.0 },
{ -180.0, 180.0, -180.0, 0.0, 180.0, -180.0 },
{ 360.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
{ -360.0, 0.0, 0.0, 0.0, 0.0, -360.0 },
{ 390.0, 30.0, -330.0, 30.0, 30.0, 30.0 },
{ -390.0, 330.0, -30.0, -30.0, -30.0, -30.0 },
{ 720.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
{ -720.0, 0.0, 0.0, 0.0, 0.0, -360.0 },
}

Definition at line 46 of file test_eda_angle.cpp.

Referenced by BOOST_AUTO_TEST_CASE().