|
KiCad PCB EDA Suite
|
#include <constraints/pcb_constraint.h>#include <algorithm>#include <base_units.h>#include <bitmaps.h>#include <eda_units.h>#include <geometry/eda_angle.h>#include <geometry/shape_compound.h>#include <i18n_utility.h>#include <pcb_shape.h>#include <properties/property.h>#include <properties/property_mgr.h>#include <api/api_enums.h>#include <api/board/board_types.pb.h>#include <google/protobuf/any.pb.h>Go to the source code of this file.
Classes | |
| struct | PCB_CONSTRAINT_DESC |
Functions | |
| const char * | ConstraintTypeToken (PCB_CONSTRAINT_TYPE aType) |
| Stable file-format token for a constraint type (e.g. "parallel"). Used by serialization. | |
| PCB_CONSTRAINT_TYPE | ConstraintTypeFromToken (const wxString &aToken) |
| Parse a constraint-type token; returns UNDEFINED for an unknown token. | |
| bool | ConstraintValueIsLength (PCB_CONSTRAINT_TYPE aType) |
| True if this type's value is a length in IU (serialized in mm); false for an angle in degrees. | |
| const char * | ConstraintAnchorToken (CONSTRAINT_ANCHOR aAnchor) |
| Stable file-format token for a member anchor (e.g. "start"). | |
| CONSTRAINT_ANCHOR | ConstraintAnchorFromToken (const wxString &aToken) |
| Parse an anchor token; returns WHOLE for an unknown token. | |
| wxString | ConstraintTypeGlyph (PCB_CONSTRAINT_TYPE aType) |
| Compact glyph for a constraint type (e.g. "//", "=") for on-canvas badges. | |
| BITMAPS | ConstraintTypeBitmap (PCB_CONSTRAINT_TYPE aType) |
| Badge icon for a constraint type; INVALID_BITMAP for UNDEFINED. | |
| wxString | ConstraintAnchorLabel (CONSTRAINT_ANCHOR aAnchor) |
| Translated name of the feature an anchor references (e.g. | |
| wxString | ConstraintTypeLabel (PCB_CONSTRAINT_TYPE aType) |
| Human-readable name of a constraint type (e.g. "Parallel"), for menus and lists. | |
| wxString | ConstraintDisplayLabel (const PCB_CONSTRAINT &aConstraint, EDA_UNITS aUnits) |
| Display label for a constraint in lists and menus. | |
| wxString | ConstraintMemberLabel (BOARD_ITEM *aItem, const CONSTRAINT_MEMBER &aMember, UNITS_PROVIDER *aUnitsProvider) |
| Label for one constrained item in a list combining the item description with its anchored feature such as Line start An indexed VERTEX member names the feature by 1 based ordinal corner N on a rectangle or vertex N on a polygon Shared by the board panel and the footprint editor dialog. | |
| bool | ConstraintsAreDuplicate (const PCB_CONSTRAINT &aA, const PCB_CONSTRAINT &aB) |
| True if two constraints express the same relation, meaning the same type and the same members compared without regard to order (so A-B equals B-A). | |
Variables | |
| static struct PCB_CONSTRAINT_DESC | _PCB_CONSTRAINT_DESC |
| CONSTRAINT_ANCHOR ConstraintAnchorFromToken | ( | const wxString & | aToken | ) |
Parse an anchor token; returns WHOLE for an unknown token.
Definition at line 112 of file pcb_constraint.cpp.
References anchor, ConstraintAnchorToken(), VERTEX, and WHOLE.
Referenced by BOOST_AUTO_TEST_CASE(), and PCB_IO_KICAD_SEXPR_PARSER::parseCONSTRAINT().
| wxString ConstraintAnchorLabel | ( | CONSTRAINT_ANCHOR | aAnchor | ) |
| const char * ConstraintAnchorToken | ( | CONSTRAINT_ANCHOR | aAnchor | ) |
Stable file-format token for a member anchor (e.g. "start").
Definition at line 95 of file pcb_constraint.cpp.
References CENTER, END, MID, RADIUS, START, VERTEX, and WHOLE.
Referenced by ConstraintAnchorFromToken(), and PCB_IO_KICAD_SEXPR::format().
| wxString ConstraintDisplayLabel | ( | const PCB_CONSTRAINT & | aConstraint, |
| EDA_UNITS | aUnits ) |
Display label for a constraint in lists and menus.
A valued constraint reads "<type>: <value>" with the value formatted in aUnits (lengths) or degrees (angles); a reference (non-driving) value is parenthesized, mirroring CAD reference dimensions. A constraint with no value is just its type name.
Definition at line 385 of file pcb_constraint.cpp.
References ConstraintTypeLabel(), ConstraintValueIsLength(), DEGREES_T, PCB_CONSTRAINT::GetConstraintType(), PCB_CONSTRAINT::GetValue(), PCB_CONSTRAINT::HasValue(), PCB_CONSTRAINT::IsDriving(), EDA_UNIT_UTILS::UI::MessageTextFromValue(), pcbIUScale, and text.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PopulateConstraintList(), and CONSTRAINT_EDIT_TOOL::updateConstraintMsgPanel().
| wxString ConstraintMemberLabel | ( | BOARD_ITEM * | aItem, |
| const CONSTRAINT_MEMBER & | aMember, | ||
| UNITS_PROVIDER * | aUnitsProvider ) |
Label for one constrained item in a list combining the item description with its anchored feature such as Line start An indexed VERTEX member names the feature by 1 based ordinal corner N on a rectangle or vertex N on a polygon Shared by the board panel and the footprint editor dialog.
Definition at line 405 of file pcb_constraint.cpp.
References _, anchor, ConstraintAnchorLabel(), EDA_ITEM::GetItemDescription(), EDA_SHAPE::GetShape(), CONSTRAINT_MEMBER::m_anchor, CONSTRAINT_MEMBER::m_index, RECTANGLE, text, and VERTEX.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), PopulateConstraintList(), and CONSTRAINT_EDIT_TOOL::updateConstraintMsgPanel().
| bool ConstraintsAreDuplicate | ( | const PCB_CONSTRAINT & | aA, |
| const PCB_CONSTRAINT & | aB ) |
True if two constraints express the same relation, meaning the same type and the same members compared without regard to order (so A-B equals B-A).
Value and driving are ignored, so a second dimensional constraint on the same geometry counts as a duplicate since it could only conflict. Used to reject authoring an identical constraint.
Definition at line 437 of file pcb_constraint.cpp.
References PCB_CONSTRAINT::GetConstraintType(), and PCB_CONSTRAINT::GetMembers().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), dimensionBindingIsDuplicate(), and CONSTRAINT_EDIT_TOOL::isDuplicateConstraint().
| BITMAPS ConstraintTypeBitmap | ( | PCB_CONSTRAINT_TYPE | aType | ) |
Badge icon for a constraint type; INVALID_BITMAP for UNDEFINED.
Definition at line 157 of file pcb_constraint.cpp.
References ANGULAR_DIMENSION, ARC_ANGLE, COINCIDENT, COLLINEAR, CONCENTRIC, constraint_angular_dimension, constraint_arc_angle, constraint_coincident, constraint_collinear, constraint_concentric, constraint_equal_length, constraint_equal_radius, constraint_fixed_length, constraint_fixed_position, constraint_fixed_radius, constraint_horizontal, constraint_midpoint, constraint_parallel, constraint_perpendicular, constraint_point_on_line, constraint_symmetric, constraint_tangent, constraint_vertical, EQUAL_LENGTH, EQUAL_RADIUS, FIXED_LENGTH, FIXED_POSITION, FIXED_RADIUS, HORIZONTAL, INVALID_BITMAP, MIDPOINT, PARALLEL, PERPENDICULAR, POINT_ON_LINE, SYMMETRIC, TANGENT, UNDEFINED, and VERTICAL.
Referenced by CONSTRAINT_BADGE_ITEM::icon().
| PCB_CONSTRAINT_TYPE ConstraintTypeFromToken | ( | const wxString & | aToken | ) |
Parse a constraint-type token; returns UNDEFINED for an unknown token.
Definition at line 68 of file pcb_constraint.cpp.
References ARC_ANGLE, ConstraintTypeToken(), and UNDEFINED.
Referenced by PCB_IO_KICAD_SEXPR_PARSER::parseCONSTRAINT().
| wxString ConstraintTypeGlyph | ( | PCB_CONSTRAINT_TYPE | aType | ) |
Compact glyph for a constraint type (e.g. "//", "=") for on-canvas badges.
Definition at line 126 of file pcb_constraint.cpp.
References ANGULAR_DIMENSION, ARC_ANGLE, COINCIDENT, COLLINEAR, CONCENTRIC, EQUAL_LENGTH, EQUAL_RADIUS, FIXED_LENGTH, FIXED_POSITION, FIXED_RADIUS, HORIZONTAL, MIDPOINT, PARALLEL, PERPENDICULAR, POINT_ON_LINE, SYMMETRIC, TANGENT, UNDEFINED, and VERTICAL.
Referenced by BOOST_AUTO_TEST_CASE().
| wxString ConstraintTypeLabel | ( | PCB_CONSTRAINT_TYPE | aType | ) |
Human-readable name of a constraint type (e.g. "Parallel"), for menus and lists.
Definition at line 203 of file pcb_constraint.cpp.
References _, ANGULAR_DIMENSION, ARC_ANGLE, COINCIDENT, COLLINEAR, CONCENTRIC, EQUAL_LENGTH, EQUAL_RADIUS, FIXED_LENGTH, FIXED_POSITION, FIXED_RADIUS, HORIZONTAL, MIDPOINT, PARALLEL, PERPENDICULAR, POINT_ON_LINE, SYMMETRIC, TANGENT, UNDEFINED, and VERTICAL.
Referenced by ConstraintDisplayLabel(), PCB_CONSTRAINT::GetItemDescription(), and CONSTRAINT_EDIT_TOOL::pickShapeConstraint().
| const char * ConstraintTypeToken | ( | PCB_CONSTRAINT_TYPE | aType | ) |
Stable file-format token for a constraint type (e.g. "parallel"). Used by serialization.
Definition at line 39 of file pcb_constraint.cpp.
References ANGULAR_DIMENSION, ARC_ANGLE, COINCIDENT, COLLINEAR, CONCENTRIC, EQUAL_LENGTH, EQUAL_RADIUS, FIXED_LENGTH, FIXED_POSITION, FIXED_RADIUS, HORIZONTAL, MIDPOINT, PARALLEL, PERPENDICULAR, POINT_ON_LINE, SYMMETRIC, TANGENT, UNDEFINED, and VERTICAL.
Referenced by ConstraintTypeFromToken(), and PCB_IO_KICAD_SEXPR::format().
| bool ConstraintValueIsLength | ( | PCB_CONSTRAINT_TYPE | aType | ) |
True if this type's value is a length in IU (serialized in mm); false for an angle in degrees.
Definition at line 82 of file pcb_constraint.cpp.
References FIXED_LENGTH, and FIXED_RADIUS.
Referenced by ConstraintDisplayLabel(), DIALOG_CONSTRAINT_VALUE::DIALOG_CONSTRAINT_VALUE(), PCB_IO_KICAD_SEXPR::format(), and PCB_IO_KICAD_SEXPR_PARSER::parseCONSTRAINT().
|
static |