26#ifndef __KICAD_TYPEINFO_H
27#define __KICAD_TYPEINFO_H
39template <
class T,
class I>
40bool IsA(
const I* aObject )
42 return aObject && std::remove_pointer<T>::type::ClassOf( aObject );
45template <
class T,
class I>
46bool IsA(
const I& aObject )
48 return std::remove_pointer<T>::type::ClassOf( &aObject );
60template<
class Casted,
class From>
63 if( std::remove_pointer<Casted>::type::ClassOf ( aObject ) )
64 return static_cast<Casted
>( aObject );
A base class for most all the KiCad significant classes used in schematics and boards.
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
constexpr bool IsGerbviewType(const KICAD_T aType)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_FIELD_LOCATE_VALUE_T
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ SCH_FIELD_LOCATE_REFERENCE_T
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_LOCATE_BOARD_EDGE_T
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ SCH_FIELD_LOCATE_FOOTPRINT_T
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ SCH_FIELD_LOCATE_VALUE_T
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
@ PCB_ITEM_LIST_T
class BOARD_ITEM_LIST, a list of board items
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ NOT_USED
the 3d code uses this value
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_SHAPE_LOCATE_CIRCLE_T
@ PCB_SHAPE_LOCATE_SEGMENT_T
@ SCH_FIELD_LOCATE_DATASHEET_T
@ PCB_SHAPE_LOCATE_RECT_T
@ SCH_ITEM_LOCATE_GRAPHIC_LINE_T
@ SCH_LABEL_LOCATE_WIRE_T
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_FIELD_LOCATE_REFERENCE_T
@ PCB_SHAPE_LOCATE_BEZIER_T
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_SHAPE_LOCATE_POLY_T
@ SCH_SYMBOL_LOCATE_POWER_T
@ DESIGN_BLOCK_LIB_TABLE_T
@ SCREEN_T
not really an item, used to identify a screen
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ WS_PROXY_UNDO_ITEM_PLUS_T
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
@ PCB_TABLE_T
class PCB_TABLE, table of PCB_TABLECELLs
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
@ PCB_FIELD_LOCATE_DATASHEET_T
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
@ PCB_FIELD_LOCATE_FOOTPRINT_T
constexpr bool IsTypeCorrect(KICAD_T aType)
constexpr bool IsPcbnewType(const KICAD_T aType)
constexpr bool IsMiscType(const KICAD_T aType)
constexpr bool IsInstantiableType(const KICAD_T aType)
Casted dyn_cast(From aObject)
A lightweight dynamic downcast.
constexpr bool IsNullType(const KICAD_T aType)
bool IsA(const I *aObject)
Check if the type of aObject is T.
constexpr bool IsEeschemaType(const KICAD_T aType)
constexpr bool IsPageLayoutEditorType(const KICAD_T aType)