![]() |
KiCad PCB EDA Suite
|
#include <eda_3d_conditions.h>
Public Member Functions | |
EDA_3D_CONDITIONS (BOARD_ADAPTER *aAdapter) | |
Define conditions for a 3D viewer frame. More... | |
SELECTION_CONDITION | MaterialMode (MATERIAL_MODE aMaterial) |
Creates a functor that tests if a specific material mode is active. More... | |
SELECTION_CONDITION | Flag (DISPLAY3D_FLG aFlag) |
Creates a functor that tests if the board adapter has a flag set currently. More... | |
SELECTION_CONDITION | GridSize (GRID3D_TYPE aGridSize) |
Creates a functor that tests the current grid size. More... | |
Static Public Member Functions | |
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 | 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 | materialModeFunction (const SELECTION &aSelection, BOARD_ADAPTER *aAdapter, MATERIAL_MODE aMaterial) |
< Helper function used by MaterialMode() More... | |
static bool | flagFunction (const SELECTION &aSelection, BOARD_ADAPTER *aAdapter, DISPLAY3D_FLG aFlag) |
Helper function used by GridDize() More... | |
static bool | gridSizeFunction (const SELECTION &aSelection, BOARD_ADAPTER *aAdapter, GRID3D_TYPE aGridSize) |
The board adapter to read the 3D viewer state from. More... | |
Private Attributes | |
BOARD_ADAPTER * | m_adapter |
Definition at line 35 of file eda_3d_conditions.h.
|
inline |
Define conditions for a 3D viewer frame.
aAdapter | is the board adapter to query for information. |
Definition at line 43 of file eda_3d_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 77 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::countFunc().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_PIN_TOOL::Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().
|
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 PL_SELECTION_TOOL::Init(), and EE_SELECTION_TOOL::Init().
SELECTION_CONDITION EDA_3D_CONDITIONS::Flag | ( | DISPLAY3D_FLG | aFlag | ) |
Creates a functor that tests if the board adapter has a flag set currently.
aAdapter | is the board adapter the setting is in |
aFlag | is the flag to test for. |
Definition at line 39 of file eda_3d_conditions.cpp.
References flagFunction().
|
staticprivate |
Helper function used by GridDize()
Definition at line 59 of file eda_3d_conditions.cpp.
References BOARD_ADAPTER::GetFlag().
Referenced by Flag().
SELECTION_CONDITION EDA_3D_CONDITIONS::GridSize | ( | GRID3D_TYPE | aGridSize | ) |
Creates a functor that tests the current grid size.
aAdapter | is the board adapter the setting is in |
aGridSize | is the grid size to test for. |
Definition at line 45 of file eda_3d_conditions.cpp.
References gridSizeFunction().
|
staticprivate |
The board adapter to read the 3D viewer state from.
Definition at line 67 of file eda_3d_conditions.cpp.
References BOARD_ADAPTER::GetGridType().
Referenced by GridSize().
|
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 59 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::hasTypeFunc().
Referenced by PAD_TOOL::Init().
|
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(), and EDA_ITEM::GetEditFlags().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), EE_INSPECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_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 53 of file selection_conditions.cpp.
References SELECTION::Front(), and EDA_ITEM::GetEditFlags().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_MOVE_TOOL::Init(), and SCH_EDIT_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 89 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::lessThanFunc().
Referenced by EE_SELECTION_TOOL::Init().
SELECTION_CONDITION EDA_3D_CONDITIONS::MaterialMode | ( | MATERIAL_MODE | aMaterial | ) |
Creates a functor that tests if a specific material mode is active.
aAdapter | is the board adapter the setting is in |
aMaterial | is the material mode to test for. |
Definition at line 33 of file eda_3d_conditions.cpp.
References materialModeFunction().
|
staticprivate |
< Helper function used by MaterialMode()
Helper function used by Flag()
Definition at line 51 of file eda_3d_conditions.cpp.
References BOARD_ADAPTER::GetMaterialMode().
Referenced by MaterialMode().
|
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 83 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::moreThanFunc().
Referenced by SCH_EDIT_TOOL::Init(), CONVERT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
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 SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), GROUP_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), PCB_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), and PL_EDITOR_FRAME::setupUIConditions().
|
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 65 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::onlyTypeFunc().
Referenced by SYMBOL_EDITOR_PIN_TOOL::Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), SCH_MOVE_TOOL::Init(), EE_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().
|
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 71 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::onlyTypesFunc().
Referenced by SCH_EDIT_TOOL::Init(), CONVERT_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), EE_SELECTION_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().
|
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(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), PL_EDIT_TOOL::Init(), PAD_TOOL::Init(), PL_DRAWING_TOOLS::Init(), EDA_3D_CONTROLLER::Init(), DRAWING_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), PCB_TOOL_BASE::Init(), PICKER_TOOL::Init(), SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_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(), and PL_EDITOR_FRAME::setupUIConditions().
|
private |
Definition at line 88 of file eda_3d_conditions.h.