KiCad PCB EDA Suite
|
#include <pcb_selection_conditions.h>
Static Public Member Functions | |
static bool | OnlyConnectedItems (const SELECTION &aSelection) |
Test if selection contains exclusively connected items (pads, tracks, vias, zones). More... | |
static SELECTION_CONDITION | SameNet (bool aAllowUnconnected=false) |
Create a functor that tests if selection contains items belonging to the same net or are unconnected if aAllowUnconnected == true. More... | |
static SELECTION_CONDITION | SameLayer () |
Creates a functor that tests if selection contains items that belong exclusively to the same layer. More... | |
static SELECTION_CONDITION | OnlyGraphicShapeTypes (const std::set< SHAPE_T > aTypes) |
Create a functor that tests if the selection contains PCB_SHAPE* items of certain shapes. More... | |
static bool | ShowAlways (const SELECTION &aSelection) |
The default condition function (always returns true). More... | |
static bool | ShowNever (const SELECTION &aSelection) |
Always returns false. More... | |
static bool | NotEmpty (const SELECTION &aSelection) |
Test if there are any items selected. More... | |
static bool | Empty (const SELECTION &aSelection) |
Test if there are no items selected. More... | |
static bool | Idle (const SELECTION &aSelection) |
Test if there no items selected or being edited. More... | |
static bool | IdleSelection (const SELECTION &aSelection) |
Test if all selected items are not being edited. More... | |
static SELECTION_CONDITION | HasType (KICAD_T aType) |
Create a functor that tests if among the selected items there is at least one of a given type. More... | |
static SELECTION_CONDITION | HasTypes (const KICAD_T aTypes[]) |
Create a functor that tests if among the selected items there is at least one of a given types. More... | |
static SELECTION_CONDITION | OnlyType (KICAD_T aType) |
Create a functor that tests if the selected items are only of given type. More... | |
static SELECTION_CONDITION | OnlyTypes (const KICAD_T aTypes[]) |
Create a functor that tests if the selected items are only of given types. More... | |
static SELECTION_CONDITION | Count (int aNumber) |
Create a functor that tests if the number of selected items is equal to the value given as parameter. More... | |
static SELECTION_CONDITION | MoreThan (int aNumber) |
Create a functor that tests if the number of selected items is greater than the value given as parameter. More... | |
static SELECTION_CONDITION | LessThan (int aNumber) |
Create a functor that tests if the number of selected items is smaller than the value given as parameter. More... | |
Static Private Member Functions | |
static bool | sameNetFunc (const SELECTION &aSelection, bool aAllowUnconnected) |
< Helper function used by SameNet() More... | |
static bool | sameLayerFunc (const SELECTION &aSelection) |
Helper function used by OnlyGraphicShapeTypes() More... | |
static bool | onlyGraphicShapeTypesFunc (const SELECTION &aSelection, const std::set< SHAPE_T > aTypes) |
static bool | hasTypeFunc (const SELECTION &aSelection, KICAD_T aType) |
< Helper function used by HasType() More... | |
static bool | hasTypesFunc (const SELECTION &aSelection, const KICAD_T aTypes[]) |
Helper function used by OnlyType() More... | |
static bool | onlyTypeFunc (const SELECTION &aSelection, KICAD_T aType) |
Helper function used by OnlyTypes() More... | |
static bool | onlyTypesFunc (const SELECTION &aSelection, const KICAD_T aTypes[]) |
Helper function used by Count() More... | |
static bool | countFunc (const SELECTION &aSelection, int aNumber) |
Helper function used by MoreThan() More... | |
static bool | moreThanFunc (const SELECTION &aSelection, int aNumber) |
Helper function used by LessThan() More... | |
static bool | lessThanFunc (const SELECTION &aSelection, int aNumber) |
Helper function used by operator||. More... | |
static bool | orFunc (const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB, const SELECTION &aSelection) |
Helper function used by operator&&. More... | |
static bool | andFunc (const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB, const SELECTION &aSelection) |
Helper function used by operator! More... | |
static bool | notFunc (const SELECTION_CONDITION &aCondition, const SELECTION &aSelection) |
Helper function used by operator||. More... | |
static bool | orBoolFunc (const SELECTION_CONDITION &aConditionA, SELECTION_BOOL &aConditionB, const SELECTION &aSelection) |
Helper function used by operator&&. More... | |
static bool | andBoolFunc (const SELECTION_CONDITION &aConditionA, SELECTION_BOOL &aConditionB, const SELECTION &aSelection) |
Definition at line 35 of file pcb_selection_conditions.h.
|
inlinestaticprivateinherited |
Definition at line 238 of file selection_conditions.h.
|
inlinestaticprivateinherited |
Helper function used by operator!
Definition at line 218 of file selection_conditions.h.
|
staticinherited |
Create a functor that tests if the number of selected items is equal to the value given as parameter.
aNumber | is the number of expected items. |
Definition at line 85 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::countFunc().
Referenced by EE_SELECTION_TOOL::Init(), SCH_EDIT_TOOL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_PIN_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), CONVERT_TOOL::Init(), EDIT_TOOL::Init(), PAD_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticprivateinherited |
Helper function used by MoreThan()
Definition at line 165 of file selection_conditions.cpp.
References SELECTION::Size().
Referenced by SELECTION_CONDITIONS::Count().
|
staticinherited |
Test if there are no items selected.
aSelection | is the selection to be tested. |
Definition at line 41 of file selection_conditions.cpp.
References SELECTION::Empty().
Referenced by EE_SELECTION_TOOL::Init(), and PL_SELECTION_TOOL::Init().
|
staticinherited |
Create a functor that tests if among the selected items there is at least one of a given type.
aType | is the type that is searched. |
Definition at line 61 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::hasTypeFunc().
Referenced by PAD_TOOL::Init().
|
staticprivateinherited |
< Helper function used by HasType()
Helper function used by HasTypes()
Definition at line 103 of file selection_conditions.cpp.
References SELECTION::Empty().
Referenced by SELECTION_CONDITIONS::HasType().
|
staticinherited |
Create a functor that tests if among the selected items there is at least one of a given types.
aTypes | is an array containing types that are searched. It has to be ended with #KICAD_T::EOT as end marker. |
Definition at line 67 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::hasTypesFunc().
Referenced by EE_SELECTION_TOOL::Init().
|
staticprivateinherited |
Helper function used by OnlyType()
Definition at line 118 of file selection_conditions.cpp.
References SELECTION::Empty().
Referenced by SELECTION_CONDITIONS::HasTypes().
|
staticinherited |
Test if there no items selected or being edited.
aSelection | is the selection to be tested. |
Definition at line 47 of file selection_conditions.cpp.
References SELECTION::Front(), EDA_ITEM::GetEditFlags(), IS_DRAGGING, IS_MOVING, IS_NEW, IS_PASTED, and IS_RESIZING.
Referenced by EE_INSPECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), SCH_EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), SCH_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticinherited |
Test if all selected items are not being edited.
aSelection | is the selection to be tested. |
Definition at line 55 of file selection_conditions.cpp.
References SELECTION::Front(), and EDA_ITEM::GetEditFlags().
Referenced by SCH_EDIT_TOOL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), and SYMBOL_EDITOR_MOVE_TOOL::Init().
|
staticinherited |
Create a functor that tests if the number of selected items is smaller than the value given as parameter.
aNumber | is the number used for comparison. |
Definition at line 97 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::lessThanFunc().
Referenced by EE_SELECTION_TOOL::Init().
|
staticprivateinherited |
Helper function used by operator||.
Definition at line 177 of file selection_conditions.cpp.
References SELECTION::Size().
Referenced by SELECTION_CONDITIONS::LessThan().
|
staticinherited |
Create a functor that tests if the number of selected items is greater than the value given as parameter.
aNumber | is the number used for comparison. |
Definition at line 91 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::moreThanFunc().
Referenced by EE_SELECTION_TOOL::Init(), SCH_EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), CONVERT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticprivateinherited |
Helper function used by LessThan()
Definition at line 171 of file selection_conditions.cpp.
References SELECTION::Size().
Referenced by SELECTION_CONDITIONS::MoreThan().
|
staticinherited |
Test if there are any items selected.
aSelection | is the selection to be tested. |
Definition at line 35 of file selection_conditions.cpp.
References SELECTION::Empty().
Referenced by SCH_EDIT_TOOL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), EDIT_TOOL::Init(), GROUP_TOOL::Init(), PCB_SELECTION_TOOL::Init(), and PL_EDITOR_FRAME::setupUIConditions().
|
inlinestaticprivateinherited |
Helper function used by operator||.
Definition at line 225 of file selection_conditions.h.
|
static |
Test if selection contains exclusively connected items (pads, tracks, vias, zones).
aSelection | is the selection to be tested. |
Definition at line 36 of file pcb_selection_conditions.cpp.
References SELECTION::Empty(), PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, and PCB_ZONE_T.
Create a functor that tests if the selection contains PCB_SHAPE* items of certain shapes.
This implicitly includes an OnlyType( PCB_SHAPE_T ) as part of the test.
aTypes | is a list of allowed PCB_SHAPE shapes ( |
Definition at line 65 of file pcb_selection_conditions.cpp.
References onlyGraphicShapeTypesFunc().
Referenced by CONVERT_TOOL::Init().
|
staticprivate |
Definition at line 139 of file pcb_selection_conditions.cpp.
References SELECTION::Empty(), PCB_FP_SHAPE_T, and PCB_SHAPE_T.
Referenced by OnlyGraphicShapeTypes().
|
staticinherited |
Create a functor that tests if the selected items are only of given type.
aType | is the type that is searched. |
Definition at line 73 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::onlyTypeFunc().
Referenced by EE_SELECTION_TOOL::Init(), SCH_EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), SCH_MOVE_TOOL::Init(), SYMBOL_EDITOR_PIN_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), CONVERT_TOOL::Init(), EDIT_TOOL::Init(), PAD_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticprivateinherited |
Helper function used by OnlyTypes()
Definition at line 133 of file selection_conditions.cpp.
References SELECTION::Empty(), and EOT.
Referenced by SELECTION_CONDITIONS::OnlyType().
|
staticinherited |
Create a functor that tests if the selected items are only of given types.
aTypes | is an array containing types that are searched. It has to be ended with #KICAD_T::EOT as end marker. |
Definition at line 79 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::onlyTypesFunc().
Referenced by EE_SELECTION_TOOL::Init(), SCH_EDIT_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), CONVERT_TOOL::Init(), EDIT_TOOL::Init(), EDIT_TOOL::Properties(), PCB_EDIT_FRAME::setupUIConditions(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), BOARD_EDITOR_CONTROL::ViaSizeDec(), and BOARD_EDITOR_CONTROL::ViaSizeInc().
|
staticprivateinherited |
Helper function used by Count()
Definition at line 150 of file selection_conditions.cpp.
References SELECTION::Empty().
Referenced by SELECTION_CONDITIONS::OnlyTypes().
|
inlinestaticprivateinherited |
Helper function used by operator&&.
Definition at line 231 of file selection_conditions.h.
|
inlinestaticprivateinherited |
Helper function used by operator&&.
Definition at line 211 of file selection_conditions.h.
|
static |
Creates a functor that tests if selection contains items that belong exclusively to the same layer.
In case of items belonging to multiple layers, it is enough to have a single common layer with other items.
Definition at line 59 of file pcb_selection_conditions.cpp.
References sameLayerFunc().
Referenced by CONVERT_TOOL::Init().
|
staticprivate |
Helper function used by OnlyGraphicShapeTypes()
Definition at line 118 of file pcb_selection_conditions.cpp.
References SELECTION::Empty().
Referenced by SameLayer().
|
static |
Create a functor that tests if selection contains items belonging to the same net or are unconnected if aAllowUnconnected == true.
aAllowUnconnected | determines if unconnected items (with no net code assigned) should be treated as connected to the same net. |
Definition at line 53 of file pcb_selection_conditions.cpp.
References sameNetFunc().
|
staticprivate |
< Helper function used by SameNet()
Helper function used by SameLayer()
Definition at line 72 of file pcb_selection_conditions.cpp.
References SELECTION::Empty(), BOARD_CONNECTED_ITEM::GetNetCode(), and NETINFO_LIST::UNCONNECTED.
Referenced by SameNet().
|
inlinestaticinherited |
The default condition function (always returns true).
aSelection | is the selection to be tested. |
Definition at line 77 of file selection_conditions.h.
Referenced by ACTION_CONDITIONS::ACTION_CONDITIONS(), CONDITIONAL_MENU::AddSeparator(), EDA_DRAW_FRAME::AddStandardSubMenus(), EDA_3D_CONTROLLER::Init(), EE_TOOL_BASE< T >::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), PICKER_TOOL::Init(), ZOOM_TOOL::Init(), PL_DRAWING_TOOLS::Init(), PL_EDIT_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), ROUTER_TOOL::Init(), DRAWING_TOOL::Init(), PAD_TOOL::Init(), PCB_TOOL_BASE::Init(), SCH_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), PCB_EDIT_FRAME::setupUIConditions(), and SPECIAL_TOOLS_CONTEXT_MENU::SPECIAL_TOOLS_CONTEXT_MENU().
|
inlinestaticinherited |
Always returns false.
aSelection | is the selection to be tested. |
Definition at line 88 of file selection_conditions.h.
Referenced by ACTION_CONDITIONS::ACTION_CONDITIONS(), KICAD_MANAGER_FRAME::setupUIConditions(), and PL_EDITOR_FRAME::setupUIConditions().