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. More... | |
EDA_ANGLE (const VECTOR2D &aVector) | |
EDA_ANGLE (const VECTOR2I &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 & | 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 |
static EDA_ANGLE | m_Angle0 = EDA_ANGLE( 0, DEGREES_T ) |
static EDA_ANGLE | m_Angle45 = EDA_ANGLE( 45, DEGREES_T ) |
static EDA_ANGLE | m_Angle90 = EDA_ANGLE( 90, DEGREES_T ) |
static EDA_ANGLE | m_Angle135 = EDA_ANGLE( 135, DEGREES_T ) |
static EDA_ANGLE | m_Angle180 = EDA_ANGLE( 180, DEGREES_T ) |
static EDA_ANGLE | m_Angle270 = EDA_ANGLE( 270, DEGREES_T ) |
static EDA_ANGLE | m_Angle360 = EDA_ANGLE( 360, DEGREES_T ) |
Private Attributes | |
double | m_value |
value in degrees More... | |
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.
|
inlineexplicit |
Definition at line 63 of file eda_angle.h.
References EDA_ANGLE(), m_value, RADIANS_T, VECTOR2< T >::x, and VECTOR2< T >::y.
|
inlineexplicit |
Definition at line 103 of file eda_angle.h.
References EDA_ANGLE(), m_value, RADIANS_T, VECTOR2< T >::x, and VECTOR2< T >::y.
|
inline |
Definition at line 145 of file eda_angle.h.
Referenced by Arccos(), Arcsin(), Arctan(), Arctan2(), EDA_ANGLE(), Invert(), IsParallelTo(), KeepUpright(), operator+=(), and operator-=().
|
inlinestatic |
Definition at line 238 of file eda_angle.h.
References EDA_ANGLE(), and RADIANS_T.
|
inlinestatic |
Definition at line 240 of file eda_angle.h.
References EDA_ANGLE(), and RADIANS_T.
|
inlinestatic |
Definition at line 242 of file eda_angle.h.
References EDA_ANGLE(), and RADIANS_T.
|
inlinestatic |
Definition at line 244 of file eda_angle.h.
References EDA_ANGLE(), and RADIANS_T.
|
inline |
Definition at line 149 of file eda_angle.h.
References m_value.
Referenced by std::abs(), DXF_IMPORT_PLUGIN::addEllipse(), CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), DXF_PLOTTER::Arc(), HPGL_PLOTTER::Arc(), PS_PLOTTER::Arc(), BOOST_AUTO_TEST_CASE(), UNIT_BINDER::ChangeAngleValue(), CADSTAR_PCB_ARCHIVE_LOADER::checkAndLogHatchCode(), CheckArcGeom(), HPGL_PLOTTER::Circle(), TEXT_ATTRIBUTES::Compare(), ConvertArcToPolyline(), ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), SHAPE_ARC::ConvertToPolyline(), PROPERTIES_FRAME::CopyPrmsFromItemToPanel(), CreateComponentsSection(), MICROWAVE_TOOL::createFootprint(), CreateShapesSection(), BOARD_ADAPTER::createTrack(), KIGFX::OPENGL_GAL::DrawBitmap(), drawCursorStrings(), EC_CONVERGING::EC_CONVERGING(), EXPORTER_PCB_VRML::ExportVrmlPadHole(), fillArcPOLY(), PCB_PLUGIN::format(), DS_DATA_MODEL_IO::format(), EDA_UNIT_UTILS::FormatAngle(), DSN::SPECCTRA_DB::FromBOARD(), GetArcToSegmentCount(), EDA_ANGLE_VARIANT_DATA::GetAsAny(), CADSTAR_SCH_ARCHIVE_LOADER::getCadstarAngle(), 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(), 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(), operator!=(), std::hash< TEXT_ATTRIBUTES >::operator()(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator<(), operator<<(), operator<=(), operator==(), operator>(), operator>=(), EAGLE_PLUGIN::orientFPText(), padHasOverrides(), ALTIUM_PCB::ParseComponentsBodies6Data(), DXF_PLOTTER::plotOneLineOfText(), BRDITEMS_PLOTTER::PlotPcbShape(), PCB_BITMAP::Rotate(), SCH_SEXPR_PLUGIN_CACHE::saveField(), GERBER_PLOTTER::selectAperture(), UNIT_BINDER::SetAngleValue(), SHAPE_ARC::sliceContainsPoint(), UNITS_PROVIDER::StringFromValue(), SVG_PLOTTER::Text(), AR_MATRIX::traceArc(), TransformIsClose(), SHAPE_ARC::update_bbox(), PCB_DIM_RADIAL::updateText(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw(), EDA_ANGLE_VARIANT_DATA::Write(), and zoneNeedsUpdate().
|
inline |
Definition at line 153 of file eda_angle.h.
References DEGREES_TO_RADIANS, and m_value.
Referenced by angleIsSpecial(), SVG_PLOTTER::Arc(), GEOM_TEST::ArePerpendicular(), KIGFX::OPENGL_GAL::BitmapText(), EXPORTER_STEP::buildFootprint3DShapes(), PSLIKE_PLOTTER::computeTextParameters(), Cos(), KIGFX::PCB_PAINTER::draw(), 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(), SHAPE_ARC::SHAPE_ARC(), Sin(), Tan(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), and TransformEllipseToBeziers().
|
inline |
Definition at line 151 of file eda_angle.h.
References KiROUND(), and m_value.
Referenced by LIB_TEXTBOX::compare(), FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS(), CADSTAR_SCH_ARCHIVE_LOADER::getCadstarAngle(), PCBNEW_SETTINGS::PCBNEW_SETTINGS(), AR_MATRIX::PlacePad(), SCH_LEGACY_PLUGIN_CACHE::saveArc(), SCH_LEGACY_PLUGIN_CACHE::saveText(), and SCH_SEXPR_PLUGIN_CACHE::saveText().
|
inline |
Definition at line 221 of file eda_angle.h.
References AsRadians().
Referenced by HPGL_PLOTTER::Arc(), PLOTTER::Arc(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertArcs6ToPcbShape(), ConvertArcToPolyline(), SHAPE_ARC::ConvertToPolyline(), DIALOG_POSITION_RELATIVE::getTranslationInIU(), DIALOG_MOVE_EXACT::GetTranslationInIU(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), TRANSFORM::MapAngles(), DIALOG_MOVE_EXACT::OnPolarChanged(), DIALOG_POSITION_RELATIVE::OnPolarChanged(), PCAD2KICAD::PCAD_ARC::Parse(), SCH_ALTIUM_PLUGIN::ParseArc(), GERBER_PLOTTER::plotArc(), GERBER_PLOTTER::plotRoundRectAsRegion(), RotatePoint(), SHAPE_ARC::SHAPE_ARC(), STROKE_PARAMS::Stroke(), AR_MATRIX::traceArc(), and AR_MATRIX::traceCircle().
|
inline |
Definition at line 201 of file eda_angle.h.
References AsDegrees(), DEGREES_T, and EDA_ANGLE().
Referenced by PSLIKE_PLOTTER::computeTextParameters(), CreateComponentsSection(), TRANSFORM::MapAngles(), and operator-().
bool EDA_ANGLE::IsCardinal | ( | ) | const |
Definition at line 49 of file eda_angle.cpp.
References m_value.
Referenced by GERBER_PLOTTER::FlashPadOval(), GERBER_PLOTTER::FlashPadRect(), SCH_LINE::IsOrthogonal(), AR_MATRIX::PlacePad(), and EDA_SHAPE::rotate().
bool EDA_ANGLE::IsCardinal90 | ( | ) | const |
Definition at line 63 of file eda_angle.cpp.
References std::abs(), and m_value.
Referenced by GERBER_PLOTTER::FlashPadOval(), and GERBER_PLOTTER::FlashPadRect().
|
inline |
Definition at line 174 of file eda_angle.h.
References m_value.
Referenced by ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), KIGFX::SCH_PAINTER::draw(), SCH_FIELD::GetDrawRotation(), SCH_FIELD::Plot(), LIB_FIELD::Plot(), SCH_EDIT_TOOL::Rotate(), SCH_LEGACY_PLUGIN_CACHE::saveField(), SCH_LEGACY_PLUGIN::saveField(), and DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow().
|
inline |
Definition at line 184 of file eda_angle.h.
References AsDegrees(), DEGREES_T, EDA_ANGLE(), and Normalize90().
Referenced by SCH_MOVE_TOOL::orthoLineDrag().
|
inline |
Definition at line 179 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_SCH_FIELD_PROPERTIES::UpdateField().
|
inline |
Definition at line 169 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::createTrack(), PCB_PLUGIN::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(), SVG_PLOTTER::Text(), KIFONT::STROKE_GLYPH::Transform(), TransformRoundChamferedRectToPolygon(), and TransformTrapezoidToPolygon().
EDA_ANGLE EDA_ANGLE::KeepUpright | ( | ) | const |
Definition at line 32 of file eda_angle.cpp.
References AsDegrees(), DEGREES_T, EDA_ANGLE(), and Normalize().
|
inline |
Definition at line 249 of file eda_angle.h.
References m_value.
Referenced by CADSTAR_SCH_ARCHIVE_LOADER::applyTextSettings(), PLOTTER::Arc(), PDF_PLOTTER::Arc(), BOOST_AUTO_TEST_CASE(), EDA_SHAPE::CalcArcAngles(), SHAPE_ARC::Collide(), EDA_SHAPE::computeArcBBox(), SHAPE_ARC::ConstructFromStartEndCenter(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertArcs6ToPcbShape(), ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper(), CreateComponentsSection(), 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(), KeepUpright(), PCB_TEXT::KeepUpright(), DSN::SPECCTRA_DB::makeIMAGE(), TRANSFORM::MapAngles(), Normalized(), PCAD2KICAD::PCAD_ARC::Parse(), SCH_SEXPR_PARSER::parseArc(), SCH_ALTIUM_PLUGIN::ParseArc(), FABMASTER::processArc(), PCB_BITMAP::Rotate(), PAD::Rotate(), PCB_DIMENSION_BASE::Rotate(), PCB_TEXTBOX::Rotate(), RotatePoint(), PAD::SetOrientation(), STROKE_PARAMS::Stroke(), GERBER_PLOTTER::ThickArc(), AR_MATRIX::traceArc(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_TEXTBOX_PROPERTIES::TransferDataFromWindow(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), PCB_DIM_ALIGNED::updateText(), and PCB_DIM_RADIAL::updateText().
|
inline |
Definition at line 288 of file eda_angle.h.
References m_value.
Referenced by SEG::Angle(), HPGL_PLOTTER::Arc(), BOOST_AUTO_TEST_CASE(), 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_LEGACY_PLUGIN_CACHE::saveArc(), FOOTPRINT::SetOrientation(), DIALOG_DIMENSION_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), and DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow().
|
inline |
Definition at line 299 of file eda_angle.h.
References m_value.
Referenced by BOOST_AUTO_TEST_CASE(), PCB_PLUGIN::format(), EDA_SHAPE::SetArcAngleAndEnd(), and KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw().
|
inline |
Definition at line 277 of file eda_angle.h.
References m_value.
Referenced by BOOST_AUTO_TEST_CASE(), build45DegLeader(), KIGFX::PCB_PAINTER::draw(), SCH_SCREEN::GetLabelOrientationForPoint(), GERBER_DRAW_ITEM::GetTextD_CodePrms(), and IsParallelTo().
|
inline |
Definition at line 260 of file eda_angle.h.
References Normalize().
Referenced by PCB_TEXTBOX::SetTextAngle().
|
inline |
Definition at line 266 of file eda_angle.h.
References m_value.
Referenced by BOOST_AUTO_TEST_CASE(), and CADSTAR_PCB_ARCHIVE_LOADER::getShapeFromVertex().
Definition at line 312 of file eda_angle.h.
References AsDegrees(), DEGREES_T, and EDA_ANGLE().
Definition at line 318 of file eda_angle.h.
References AsDegrees(), DEGREES_T, and EDA_ANGLE().
|
inline |
Definition at line 206 of file eda_angle.h.
References AsRadians().
Referenced by HPGL_PLOTTER::Arc(), PLOTTER::Arc(), ALTIUM_PCB::ConvertArcs6ToBoardItemOnLayer(), ALTIUM_PCB::ConvertArcs6ToPcbShape(), ConvertArcToPolyline(), SHAPE_ARC::ConvertToPolyline(), DIALOG_POSITION_RELATIVE::getTranslationInIU(), DIALOG_MOVE_EXACT::GetTranslationInIU(), CADSTAR_PCB_ARCHIVE_LOADER::loadDimensions(), TRANSFORM::MapAngles(), DIALOG_MOVE_EXACT::OnPolarChanged(), DIALOG_POSITION_RELATIVE::OnPolarChanged(), PCAD2KICAD::PCAD_ARC::Parse(), SCH_ALTIUM_PLUGIN::ParseArc(), PCB_DIM_ALIGNED::PCB_DIM_ALIGNED(), PCB_DIM_ORTHOGONAL::PCB_DIM_ORTHOGONAL(), GERBER_PLOTTER::plotArc(), GERBER_PLOTTER::plotRoundRectAsRegion(), RotatePoint(), SHAPE_ARC::SHAPE_ARC(), STROKE_PARAMS::Stroke(), and AR_MATRIX::traceCircle().
|
inline |
Definition at line 236 of file eda_angle.h.
References AsRadians().
|
staticconstexpr |
Definition at line 155 of file eda_angle.h.
Referenced by AsRadians(), and EDA_ANGLE().
Definition at line 328 of file eda_angle.h.
Referenced by BOOST_AUTO_TEST_CASE().
Definition at line 331 of file eda_angle.h.
Definition at line 332 of file eda_angle.h.
Definition at line 333 of file eda_angle.h.
Definition at line 334 of file eda_angle.h.
Definition at line 329 of file eda_angle.h.
Definition at line 330 of file eda_angle.h.
|
private |
value in degrees
Definition at line 325 of file eda_angle.h.
Referenced by AsDegrees(), AsRadians(), AsTenthsOfADegree(), EDA_ANGLE(), IsCardinal(), IsCardinal90(), IsHorizontal(), IsVertical(), IsZero(), Normalize(), Normalize180(), Normalize720(), Normalize90(), and NormalizeNegative().