KiCad PCB EDA Suite
|
#include <eda_angle.h>
Public Member Functions | |
EDA_ANGLE (double aValue, EDA_ANGLE_T aAngleType) | |
Angles can be created in degrees, 1/10ths of a degree, or radians, and read as any of the angle types. | |
constexpr | EDA_ANGLE (double aAngleInDegrees) |
Construct an EDA_ANGLE in degrees. | |
EDA_ANGLE (const VECTOR2D &aVector) | |
EDA_ANGLE () | |
double | AsDegrees () const |
int | AsTenthsOfADegree () const |
double | AsRadians () const |
bool | IsCardinal () const |
bool | IsCardinal90 () const |
bool | IsZero () const |
bool | IsHorizontal () const |
bool | IsVertical () const |
bool | IsParallelTo (EDA_ANGLE aAngle) const |
EDA_ANGLE | Invert () const |
double | Sin () const |
double | Cos () const |
double | Tan () const |
EDA_ANGLE | Normalize () |
EDA_ANGLE | Normalized () const |
EDA_ANGLE | NormalizeNegative () |
EDA_ANGLE | Normalize90 () |
EDA_ANGLE | Normalize180 () |
EDA_ANGLE | Normalize720 () |
EDA_ANGLE | KeepUpright () const |
EDA_ANGLE | Round (int digits) const |
EDA_ANGLE & | operator+= (const EDA_ANGLE &aAngle) |
EDA_ANGLE & | operator-= (const EDA_ANGLE &aAngle) |
Static Public Member Functions | |
static EDA_ANGLE | Arccos (double x) |
static EDA_ANGLE | Arcsin (double x) |
static EDA_ANGLE | Arctan (double x) |
static EDA_ANGLE | Arctan2 (double y, double x) |
Static Public Attributes | |
static constexpr double | DEGREES_TO_RADIANS = M_PI / 180.0 |
Private Attributes | |
double | m_value |
value in degrees | |
Definition at line 36 of file eda_angle.h.
|
inline |
Angles can be created in degrees, 1/10ths of a degree, or radians, and read as any of the angle types.
Angle type must be explicitly specified at creation, because there is no other way of knowing what an int or a double represents.
Definition at line 46 of file eda_angle.h.
References DEGREES_TO_RADIANS, m_value, RADIANS_T, and TENTHS_OF_A_DEGREE_T.
|
inlineconstexpr |
Construct an EDA_ANGLE in degrees.
aAngleInDegrees |
Definition at line 67 of file eda_angle.h.
|
inlineexplicit |
Definition at line 69 of file eda_angle.h.
References EDA_ANGLE(), m_value, RADIANS_T, VECTOR2< T >::x, and VECTOR2< T >::y.
|
inline |
Definition at line 109 of file eda_angle.h.
Referenced by Arccos(), Arcsin(), Arctan(), Arctan2(), EDA_ANGLE(), Invert(), IsParallelTo(), KeepUpright(), operator+=(), operator-=(), and Round().
|
inlinestatic |
Definition at line 210 of file eda_angle.h.
References EDA_ANGLE(), and RADIANS_T.
Referenced by DRC_TEST_PROVIDER_TRACK_ANGLE::Run().
|
inlinestatic |
Definition at line 212 of file eda_angle.h.
References EDA_ANGLE(), and RADIANS_T.
|
inlinestatic |
Definition at line 214 of file eda_angle.h.
References EDA_ANGLE(), and RADIANS_T.
|
inlinestatic |
Definition at line 216 of file eda_angle.h.
References EDA_ANGLE(), and RADIANS_T.
|
inline |
Definition at line 113 of file eda_angle.h.
References m_value.
Referenced by std::abs(), DXF_IMPORT_PLUGIN::addEllipse(), PCB_IO_IPC2581::addPad(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), DXF_PLOTTER::Arc(), GERBER_PLOTTER::Arc(), HPGL_PLOTTER::Arc(), PS_PLOTTER::Arc(), PNS::ArcHull(), BOOST_AUTO_TEST_CASE(), boost_test_print_type(), UNIT_BINDER::ChangeAngleValue(), CADSTAR_PCB_ARCHIVE_LOADER::checkAndLogHatchCode(), CheckArcGeom(), HPGL_PLOTTER::Circle(), TEXT_ATTRIBUTES::Compare(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ConvertArcToPolyline(), ALTIUM_PCB::ConvertComponentBody6ToFootprintItem(), ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), SHAPE_ARC::ConvertToPolyline(), PROPERTIES_FRAME::CopyPrmsFromItemToPanel(), GENCAD_EXPORTER::CreateComponentsSection(), MICROWAVE_TOOL::createFootprint(), PCB_IO_EASYEDAPRO_PARSER::createPAD(), GENCAD_EXPORTER::CreateShapesSection(), BOARD_ADAPTER::createTrackWithMargin(), KIGFX::OPENGL_GAL::DrawBitmap(), EC_CONVERGING::EC_CONVERGING(), EXPORTER_PCB_VRML::ExportVrmlPadHole(), PCB_IO_KICAD_SEXPR::format(), DS_DATA_MODEL_IO::format(), EDA_UNIT_UTILS::FormatAngle(), DSN::SPECCTRA_DB::FromBOARD(), GetArcToSegmentCount(), EDA_ANGLE_VARIANT_DATA::GetAsAny(), IMPORTED_ARC::GetBoundingBox(), CADSTAR_SCH_ARCHIVE_LOADER::getCadstarAngle(), KIGFX::PREVIEW::RULER_ITEM::GetDimensionStrings(), SCH_SCREEN::GetLabelOrientationForPoint(), PAD::GetMsgPanelInfo(), FOOTPRINT::GetOrientationDegrees(), PAD::GetOrientationDegrees(), EDA_TEXT::GetTextAngleDegrees(), PAD::GetThermalSpokeAngleDegrees(), ARRAY_CIRCULAR_OPTIONS::GetTransform(), PG_UNIT_EDITOR::GetValueFromControl(), hash_fp_item(), HelperShapeLineChainFromAltiumVertices(), HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK(), idf_export_footprint(), idf_export_outline(), Invert(), SHAPE_SEGMENT::Is45Degree(), IsParallelTo(), KeepUpright(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), CADSTAR_SCH_ARCHIVE_LOADER::loadSymbolFieldAttribute(), DSN::SPECCTRA_DB::makeIMAGE(), UNITS_PROVIDER::MessageTextFromValue(), EDA_UNIT_UTILS::UI::MessageTextFromValue(), DIALOG_MOVE_EXACT::OnPolarChanged(), DIALOG_POSITION_RELATIVE::OnPolarChanged(), DIALOG_SET_OFFSET::OnPolarChanged(), operator!=(), std::hash< TEXT_ATTRIBUTES >::operator()(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator<(), operator<<(), operator<=(), operator==(), operator>(), operator>=(), PCB_IO_EAGLE::orientFPText(), padNeedsUpdate(), ALTIUM_PCB::ParseComponentsBodies6Data(), DXF_PLOTTER::plotOneLineOfText(), BRDITEMS_PLOTTER::PlotShape(), REFERENCE_IMAGE::Rotate(), Round(), DRC_TEST_PROVIDER_TRACK_ANGLE::Run(), SCH_IO_KICAD_SEXPR_LIB_CACHE::saveField(), GERBER_PLOTTER::selectAperture(), PADSTACK::Serialize(), UNIT_BINDER::SetAngleValue(), UNITS_PROVIDER::StringFromValue(), SVG_PLOTTER::Text(), SPICE_VALUE::ToString(), AR_MATRIX::traceArc(), DIALOG_DRAW_LAYERS_SETTINGS::TransferDataToWindow(), TransformIsClose(), SHAPE_ARC::update_values(), PCB_DIM_RADIAL::updateText(), ARC_GEOM_SYNCER::Validate(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw(), EDA_ANGLE_VARIANT_DATA::Write(), ODB_PAD::WriteRecordContent(), and zoneNeedsUpdate().
|
inline |
Definition at line 117 of file eda_angle.h.
References DEGREES_TO_RADIANS, and m_value.
Referenced by angleIsSpecial(), GERBER_PLOTTER::Arc(), SVG_PLOTTER::Arc(), GEOM_TEST::ArePerpendicular(), KIGFX::OPENGL_GAL::BitmapText(), EXPORTER_STEP::buildFootprint3DShapes(), PSLIKE_PLOTTER::computeTextParameters(), Cos(), KIGFX::PCB_PAINTER::draw(), KIGFX::drawAltPinModesIcon(), KIGFX::CAIRO_GAL_BASE::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::OPENGL_GAL::drawSegment(), EXPORTER_PCB_VRML::ExportVrmlFootprint(), gen_arc(), RENDER_3D_OPENGL::get3dModelsFromFootprint(), EDA_SHAPE::GetLength(), SHAPE_ARC::GetLength(), BE_SHAPE_ARC::IsThereATangentPassingThroughPoint(), CU_SHAPE_CIRCLE::Paths(), CU_SHAPE_SEGMENT::Paths(), segmentIntersectsArc(), SHAPE_ARC::SHAPE_ARC(), BE_SHAPE_CIRCLE::ShortenChildDueToGV(), Sin(), Tan(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), and TransformEllipseToBeziers().
|
inline |
Definition at line 115 of file eda_angle.h.
References KiROUND(), and m_value.
Referenced by SCH_TEXTBOX::compare(), FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS(), CADSTAR_SCH_ARCHIVE_LOADER::getCadstarAngle(), std::hash< GLYPH_CACHE_KEY >::operator()(), PCBNEW_SETTINGS::PCBNEW_SETTINGS(), AR_MATRIX::PlacePad(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveArc(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveText(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveText().
|
inline |
Definition at line 189 of file eda_angle.h.
References AsRadians().
Referenced by HPGL_PLOTTER::Arc(), PS_PLOTTER::Arc(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertArcs6ToPcbShape(), ConvertArcToPolyline(), SHAPE_ARC::ConvertToPolyline(), drawTicksAlongLine(), IMPORTED_ARC::GetBoundingBox(), DIALOG_POSITION_RELATIVE::getTranslationInIU(), DIALOG_MOVE_EXACT::GetTranslationInIU(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), TRANSFORM::MapAngles(), DIALOG_MOVE_EXACT::OnPolarChanged(), DIALOG_POSITION_RELATIVE::OnPolarChanged(), DIALOG_SET_OFFSET::OnPolarChanged(), PCAD2KICAD::PCAD_ARC::Parse(), SCH_IO_ALTIUM::ParseArc(), SCH_IO_ALTIUM::ParsePieChart(), GERBER_PLOTTER::plotArc(), GERBER_PLOTTER::plotRoundRectAsRegion(), PLOTTER::polyArc(), RotatePoint(), SHAPE_ARC::SHAPE_ARC(), STROKE_PARAMS::Stroke(), AR_MATRIX::traceArc(), and AR_MATRIX::traceCircle().
|
inline |
Definition at line 165 of file eda_angle.h.
References AsDegrees(), DEGREES_T, and EDA_ANGLE().
Referenced by PSLIKE_PLOTTER::computeTextParameters(), GENCAD_EXPORTER::CreateComponentsSection(), and operator-().
bool EDA_ANGLE::IsCardinal | ( | ) | const |
Definition at line 40 of file eda_angle.cpp.
References m_value.
Referenced by ALTIUM_PCB::ConvertFills6ToFootprintItemOnLayer(), GERBER_PLOTTER::FlashPadOval(), GERBER_PLOTTER::FlashPadRect(), PCB_TEXTBOX::GetAnchorAndOppositeCorner(), KIGEOM::GetOvalKeyPoints(), SCH_LINE::IsOrthogonal(), PAD_POINT_EDIT_BEHAVIOR::MakePoints(), AR_MATRIX::PlacePad(), EDA_SHAPE::rotate(), and PAD_POINT_EDIT_BEHAVIOR::UpdatePoints().
bool EDA_ANGLE::IsCardinal90 | ( | ) | const |
Definition at line 54 of file eda_angle.cpp.
References std::abs(), and m_value.
Referenced by ALTIUM_PCB::ConvertFills6ToFootprintItemOnLayer(), GERBER_PLOTTER::FlashPadOval(), and GERBER_PLOTTER::FlashPadRect().
|
inline |
Definition at line 138 of file eda_angle.h.
References m_value.
Referenced by PNS::AREA_CONSTRAINT::Check(), ComputeDogbone(), ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), KIGFX::SCH_PAINTER::draw(), SCH_FIELD::GetDrawRotation(), PCB_TEXTBOX::GetShownText(), FIELDS_GRID_TABLE::GetValue(), EE_SELECTION_TOOL::GuessSelectionCandidates(), SCH_FIELD::Plot(), LINE_FILLET_ROUTINE::ProcessLinePair(), DOGBONE_CORNER_ROUTINE::ProcessLinePair(), SCH_EDIT_TOOL::Rotate(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveField(), and SCH_IO_KICAD_LEGACY::saveField().
|
inline |
Definition at line 148 of file eda_angle.h.
References AsDegrees(), DEGREES_T, EDA_ANGLE(), and Normalize90().
Referenced by SCH_MOVE_TOOL::orthoLineDrag().
|
inline |
Definition at line 143 of file eda_angle.h.
References m_value.
Referenced by SCH_EDIT_TOOL::ChangeTextType(), ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES(), and DIALOG_FIELD_PROPERTIES::UpdateField().
|
inline |
Definition at line 133 of file eda_angle.h.
References m_value.
Referenced by ZONE_FILLER::addHatchFillTypeOnZone(), CADSTAR_SCH_ARCHIVE_LOADER::applyTransform(), AM_PRIMITIVE::ConvertBasicShapeToPolygon(), D_CODE::ConvertShapeToPolygon(), CornerListToPolygon(), BOARD_ADAPTER::createTrackWithMargin(), PCB_IO_KICAD_SEXPR::format(), DS_DATA_MODEL_IO::format(), RENDER_3D_OPENGL::get3dModelsFromFootprint(), GERBER_DRAW_ITEM::GetABPosition(), PCB_TEXT::GetBoundingBox(), PAD::GetMsgPanelInfo(), KIFONT::OUTLINE_FONT::getTextAsGlyphsUnlocked(), ARRAY_CIRCULAR_OPTIONS::GetTransform(), GERBER_DRAW_ITEM::GetXYPosition(), API_HANDLER_PCB::handleGetTextExtents(), SVG_PLOTTER::Text(), KIFONT::STROKE_GLYPH::Transform(), TransformRoundChamferedRectToPolygon(), and TransformTrapezoidToPolygon().
EDA_ANGLE EDA_ANGLE::KeepUpright | ( | ) | const |
Definition at line 23 of file eda_angle.cpp.
References AsDegrees(), DEGREES_T, EDA_ANGLE(), and Normalize().
|
inline |
Definition at line 221 of file eda_angle.h.
References m_value.
Referenced by PCB_IO_IPC2581::addPad(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), PLOTTER::Arc(), BOOST_AUTO_TEST_CASE(), SHAPE_ARC::Collide(), EDA_SHAPE::computeArcBBox(), SHAPE_ARC::ConstructFromStartEndCenter(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertArcs6ToPcbShape(), ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), GENCAD_EXPORTER::CreateComponentsSection(), GENCAD_EXPORTER::CreateShapesSection(), GERBER_PLOTTER::FlashPadOval(), DSN::SPECCTRA_DB::FromBOARD(), PCB_TEXTBOX::GetAnchorAndOppositeCorner(), PCB_ARC::GetArcAngleEnd(), PCB_ARC::GetArcAngleStart(), GERBER_DRAW_ITEM::GetBoundingBox(), PCB_TEXT::GetDrawRotation(), SHAPE_ARC::GetEndAngle(), SHAPE_ARC::GetStartAngle(), HelperShapeLineChainFromAltiumVertices(), EDA_SHAPE::hitTest(), PCB_ARC::HitTest(), GERBER_DRAW_ITEM::HitTest(), BOX2< Vec >::Intersects(), PCB_TEXT::KeepUpright(), KeepUpright(), DSN::SPECCTRA_DB::makeIMAGE(), TRANSFORM::MapAngles(), Normalized(), padNeedsUpdate(), PCAD2KICAD::PCAD_ARC::Parse(), SCH_IO_KICAD_SEXPR_PARSER::parseSymbolArc(), FABMASTER::processArc(), REFERENCE_IMAGE::Rotate(), PCB_DIMENSION_BASE::Rotate(), PCB_TEXTBOX::Rotate(), RotatePoint(), PADSTACK::SetOrientation(), SHAPE_ARC::sliceContainsPoint(), STROKE_PARAMS::Stroke(), PLOTTER::ThickArc(), AR_MATRIX::traceArc(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), PCB_DIM_ALIGNED::updateText(), PCB_DIM_RADIAL::updateText(), and ODB_PAD::WriteRecordContent().
|
inline |
Definition at line 260 of file eda_angle.h.
References m_value.
Referenced by SEG::Angle(), BOOST_AUTO_TEST_CASE(), KIGFX::SCH_PAINTER::draw(), CADSTAR_SCH_ARCHIVE_LOADER::fixUpLibraryPins(), FOOTPRINT::Flip(), PCB_ARC::GetAngle(), SHAPE_ARC::GetCentralAngle(), CADSTAR_SCH_ARCHIVE_LOADER::getComponentOrientation(), PAD::GetMsgPanelInfo(), CADSTAR_SCH_ARCHIVE_LOADER::getSpinStyle(), SHAPE_SEGMENT::Is45Degree(), CADSTAR_PCB_ARCHIVE_LOADER::loadComponents(), CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbol(), PCB_DIM_ORTHOGONAL::Rotate(), PCB_TEXT::Rotate(), SCH_IO_KICAD_LEGACY_LIB_CACHE::saveArc(), FOOTPRINT::SetOrientation(), SPICE_VALUE::ToString(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow().
|
inline |
Definition at line 271 of file eda_angle.h.
References m_value.
Referenced by BOOST_AUTO_TEST_CASE(), PCB_IO_KICAD_SEXPR::format(), EDA_SHAPE::SetArcAngleAndEnd(), and KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw().
|
inline |
Definition at line 249 of file eda_angle.h.
References m_value.
Referenced by BOOST_AUTO_TEST_CASE(), build45DegLeader(), PCB_IO_EASYEDAPRO_PARSER::createPAD(), SCH_SCREEN::GetLabelOrientationForPoint(), KIGEOM::GetOvalKeyPoints(), GERBER_DRAW_ITEM::GetTextD_CodePrms(), IsParallelTo(), pointHasEscapedSnapLineX(), pointHasEscapedSnapLineY(), and KIGFX::PCB_PAINTER::renderNetNameForSegment().
|
inline |
Definition at line 232 of file eda_angle.h.
References Normalize().
Referenced by PCB_TEXTBOX::SetTextAngle().
|
inline |
Definition at line 238 of file eda_angle.h.
References m_value.
Referenced by PLOTTER::Arc(), BOOST_AUTO_TEST_CASE(), CADSTAR_PCB_ARCHIVE_LOADER::getShapeFromVertex(), and PLOTTER::ThickArc().
Definition at line 292 of file eda_angle.h.
References AsDegrees(), DEGREES_T, and EDA_ANGLE().
Definition at line 298 of file eda_angle.h.
References AsDegrees(), DEGREES_T, and EDA_ANGLE().
|
inline |
Definition at line 284 of file eda_angle.h.
References AsDegrees(), DEGREES_T, EDA_ANGLE(), and KiROUND().
|
inline |
Definition at line 170 of file eda_angle.h.
References AsRadians().
Referenced by HPGL_PLOTTER::Arc(), PS_PLOTTER::Arc(), CalcArcCenter(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertArcs6ToPcbShape(), ConvertArcToPolyline(), SHAPE_ARC::ConvertToPolyline(), drawTicksAlongLine(), IMPORTED_ARC::GetBoundingBox(), DIALOG_POSITION_RELATIVE::getTranslationInIU(), DIALOG_MOVE_EXACT::GetTranslationInIU(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), TRANSFORM::MapAngles(), DIALOG_MOVE_EXACT::OnPolarChanged(), DIALOG_POSITION_RELATIVE::OnPolarChanged(), DIALOG_SET_OFFSET::OnPolarChanged(), PCAD2KICAD::PCAD_ARC::Parse(), SCH_IO_ALTIUM::ParseArc(), SCH_IO_ALTIUM::ParsePieChart(), PCB_DIM_ALIGNED::PCB_DIM_ALIGNED(), PCB_DIM_ORTHOGONAL::PCB_DIM_ORTHOGONAL(), GERBER_PLOTTER::plotArc(), GERBER_PLOTTER::plotRoundRectAsRegion(), PLOTTER::polyArc(), RotatePoint(), SHAPE_ARC::SHAPE_ARC(), STROKE_PARAMS::Stroke(), and AR_MATRIX::traceCircle().
|
inline |
Definition at line 208 of file eda_angle.h.
References AsRadians().
|
staticconstexpr |
Definition at line 119 of file eda_angle.h.
Referenced by AsRadians(), and EDA_ANGLE().
|
private |
value in degrees
Definition at line 305 of file eda_angle.h.
Referenced by AsDegrees(), AsRadians(), AsTenthsOfADegree(), EDA_ANGLE(), IsCardinal(), IsCardinal90(), IsHorizontal(), IsVertical(), IsZero(), Normalize(), Normalize180(), Normalize720(), Normalize90(), and NormalizeNegative().