KiCad PCB EDA Suite
Loading...
Searching...
No Matches
typeinfo.h File Reference
#include <type_traits>

Go to the source code of this file.

Enumerations

enum  KICAD_T {
  NOT_USED = -1 , TYPE_NOT_INIT = 0 , PCB_T , SCREEN_T ,
  PCB_FOOTPRINT_T , PCB_PAD_T , PCB_SHAPE_T , PCB_REFERENCE_IMAGE_T ,
  PCB_FIELD_T , PCB_GENERATOR_T , PCB_TEXT_T , PCB_TEXTBOX_T ,
  PCB_TABLE_T , PCB_TABLECELL_T , PCB_TRACE_T , PCB_VIA_T ,
  PCB_ARC_T , PCB_MARKER_T , PCB_DIMENSION_T , PCB_DIM_ALIGNED_T ,
  PCB_DIM_LEADER_T , PCB_DIM_CENTER_T , PCB_DIM_RADIAL_T , PCB_DIM_ORTHOGONAL_T ,
  PCB_TARGET_T , PCB_ZONE_T , PCB_ITEM_LIST_T , PCB_NETINFO_T ,
  PCB_GROUP_T , PCB_FIELD_LOCATE_REFERENCE_T , PCB_FIELD_LOCATE_VALUE_T , PCB_FIELD_LOCATE_FOOTPRINT_T ,
  PCB_FIELD_LOCATE_DATASHEET_T , PCB_LOCATE_STDVIA_T , PCB_LOCATE_UVIA_T , PCB_LOCATE_BBVIA_T ,
  PCB_LOCATE_TEXT_T , PCB_LOCATE_HOLE_T , PCB_LOCATE_PTH_T , PCB_LOCATE_NPTH_T ,
  PCB_LOCATE_BOARD_EDGE_T , PCB_SHAPE_LOCATE_SEGMENT_T , PCB_SHAPE_LOCATE_RECT_T , PCB_SHAPE_LOCATE_CIRCLE_T ,
  PCB_SHAPE_LOCATE_ARC_T , PCB_SHAPE_LOCATE_POLY_T , PCB_SHAPE_LOCATE_BEZIER_T , LIB_SYMBOL_T ,
  SCH_SHAPE_T , SCH_FIELD_T , SCH_TEXT_T , SCH_TEXTBOX_T ,
  SCH_PIN_T , SCH_MARKER_T , SCH_JUNCTION_T , SCH_NO_CONNECT_T ,
  SCH_BUS_WIRE_ENTRY_T , SCH_BUS_BUS_ENTRY_T , SCH_LINE_T , SCH_BITMAP_T ,
  SCH_TABLE_T , SCH_TABLECELL_T , SCH_LABEL_T , SCH_GLOBAL_LABEL_T ,
  SCH_HIER_LABEL_T , SCH_RULE_AREA_T , SCH_DIRECTIVE_LABEL_T , SCH_SYMBOL_T ,
  SCH_SHEET_PIN_T , SCH_SHEET_T , SCH_FIELD_LOCATE_REFERENCE_T , SCH_FIELD_LOCATE_VALUE_T ,
  SCH_FIELD_LOCATE_FOOTPRINT_T , SCH_FIELD_LOCATE_DATASHEET_T , SCH_ITEM_LOCATE_WIRE_T , SCH_ITEM_LOCATE_BUS_T ,
  SCH_ITEM_LOCATE_GRAPHIC_LINE_T , SCH_LABEL_LOCATE_ANY_T , SCH_LABEL_LOCATE_WIRE_T , SCH_LABEL_LOCATE_BUS_T ,
  SCH_SYMBOL_LOCATE_POWER_T , SCH_LOCATE_ANY_T , SCH_SCREEN_T , SCHEMATIC_T ,
  GERBER_LAYOUT_T , GERBER_DRAW_ITEM_T , GERBER_IMAGE_T , WSG_LINE_T ,
  WSG_RECT_T , WSG_POLY_T , WSG_TEXT_T , WSG_BITMAP_T ,
  WSG_PAGE_T , WS_PROXY_UNDO_ITEM_T , WS_PROXY_UNDO_ITEM_PLUS_T , SYMBOL_LIB_TABLE_T ,
  FP_LIB_TABLE_T , DESIGN_BLOCK_LIB_TABLE_T , SYMBOL_LIBS_T , SEARCH_STACK_T ,
  S3D_CACHE_T , MAX_STRUCT_TYPE_ID
}
 The set of class identification values stored in EDA_ITEM::m_structType. More...
 

Functions

template<class T , class I >
bool IsA (const I *aObject)
 Check if the type of aObject is T.
 
template<class T , class I >
bool IsA (const I &aObject)
 
template<class Casted , class From >
Casted dyn_cast (From aObject)
 A lightweight dynamic downcast.
 
constexpr KICAD_T BaseType (const KICAD_T aType)
 Return the underlying type of the given type.
 
constexpr bool IsNullType (const KICAD_T aType)
 
constexpr bool IsInstantiableType (const KICAD_T aType)
 
constexpr bool IsEeschemaType (const KICAD_T aType)
 
constexpr bool IsPcbnewType (const KICAD_T aType)
 
constexpr bool IsGerbviewType (const KICAD_T aType)
 
constexpr bool IsPageLayoutEditorType (const KICAD_T aType)
 
constexpr bool IsMiscType (const KICAD_T aType)
 
constexpr bool IsTypeCorrect (KICAD_T aType)
 

Enumeration Type Documentation

◆ KICAD_T

enum KICAD_T

The set of class identification values stored in EDA_ITEM::m_structType.

Enumerator
NOT_USED 

the 3d code uses this value

TYPE_NOT_INIT 
PCB_T 
SCREEN_T 

not really an item, used to identify a screen

PCB_FOOTPRINT_T 

class FOOTPRINT, a footprint

PCB_PAD_T 

class PAD, a pad in a footprint

PCB_SHAPE_T 

class PCB_SHAPE, a segment not on copper layers

PCB_REFERENCE_IMAGE_T 

class PCB_REFERENCE_IMAGE, bitmap on a layer

PCB_FIELD_T 

class PCB_FIELD, text associated with a footprint property

PCB_GENERATOR_T 

class PCB_GENERATOR, generator on a layer

PCB_TEXT_T 

class PCB_TEXT, text on a layer

PCB_TEXTBOX_T 

class PCB_TEXTBOX, wrapped text on a layer

PCB_TABLE_T 

class PCB_TABLE, table of PCB_TABLECELLs

PCB_TABLECELL_T 

class PCB_TABLECELL, PCB_TEXTBOX for use in tables

PCB_TRACE_T 

class PCB_TRACK, a track segment (segment on a copper layer)

PCB_VIA_T 

class PCB_VIA, a via (like a track segment on a copper layer)

PCB_ARC_T 

class PCB_ARC, an arc track segment on a copper layer

PCB_MARKER_T 

class PCB_MARKER, a marker used to show something

PCB_DIMENSION_T 

class PCB_DIMENSION_BASE: abstract dimension meta-type

PCB_DIM_ALIGNED_T 

class PCB_DIM_ALIGNED, a linear dimension (graphic item)

PCB_DIM_LEADER_T 

class PCB_DIM_LEADER, a leader dimension (graphic item)

PCB_DIM_CENTER_T 

class PCB_DIM_CENTER, a center point marking (graphic item)

PCB_DIM_RADIAL_T 

class PCB_DIM_RADIAL, a radius or diameter dimension

PCB_DIM_ORTHOGONAL_T 

class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y

PCB_TARGET_T 

class PCB_TARGET, a target (graphic item)

PCB_ZONE_T 

class ZONE, a copper pour area

PCB_ITEM_LIST_T 

class BOARD_ITEM_LIST, a list of board items

PCB_NETINFO_T 

class NETINFO_ITEM, a description of a net

PCB_GROUP_T 

class PCB_GROUP, a set of BOARD_ITEMs

PCB_FIELD_LOCATE_REFERENCE_T 
PCB_FIELD_LOCATE_VALUE_T 
PCB_FIELD_LOCATE_FOOTPRINT_T 
PCB_FIELD_LOCATE_DATASHEET_T 
PCB_LOCATE_STDVIA_T 
PCB_LOCATE_UVIA_T 
PCB_LOCATE_BBVIA_T 
PCB_LOCATE_TEXT_T 
PCB_LOCATE_HOLE_T 
PCB_LOCATE_PTH_T 
PCB_LOCATE_NPTH_T 
PCB_LOCATE_BOARD_EDGE_T 
PCB_SHAPE_LOCATE_SEGMENT_T 
PCB_SHAPE_LOCATE_RECT_T 
PCB_SHAPE_LOCATE_CIRCLE_T 
PCB_SHAPE_LOCATE_ARC_T 
PCB_SHAPE_LOCATE_POLY_T 
PCB_SHAPE_LOCATE_BEZIER_T 
LIB_SYMBOL_T 
SCH_SHAPE_T 
SCH_FIELD_T 
SCH_TEXT_T 
SCH_TEXTBOX_T 
SCH_PIN_T 
SCH_MARKER_T 
SCH_JUNCTION_T 
SCH_NO_CONNECT_T 
SCH_BUS_WIRE_ENTRY_T 
SCH_BUS_BUS_ENTRY_T 
SCH_LINE_T 
SCH_BITMAP_T 
SCH_TABLE_T 
SCH_TABLECELL_T 
SCH_LABEL_T 
SCH_GLOBAL_LABEL_T 
SCH_HIER_LABEL_T 
SCH_RULE_AREA_T 
SCH_DIRECTIVE_LABEL_T 
SCH_SYMBOL_T 
SCH_SHEET_PIN_T 
SCH_SHEET_T 
SCH_FIELD_LOCATE_REFERENCE_T 
SCH_FIELD_LOCATE_VALUE_T 
SCH_FIELD_LOCATE_FOOTPRINT_T 
SCH_FIELD_LOCATE_DATASHEET_T 
SCH_ITEM_LOCATE_WIRE_T 
SCH_ITEM_LOCATE_BUS_T 
SCH_ITEM_LOCATE_GRAPHIC_LINE_T 
SCH_LABEL_LOCATE_ANY_T 
SCH_LABEL_LOCATE_WIRE_T 
SCH_LABEL_LOCATE_BUS_T 
SCH_SYMBOL_LOCATE_POWER_T 
SCH_LOCATE_ANY_T 
SCH_SCREEN_T 
SCHEMATIC_T 
GERBER_LAYOUT_T 
GERBER_DRAW_ITEM_T 
GERBER_IMAGE_T 
WSG_LINE_T 
WSG_RECT_T 
WSG_POLY_T 
WSG_TEXT_T 
WSG_BITMAP_T 
WSG_PAGE_T 
WS_PROXY_UNDO_ITEM_T 
WS_PROXY_UNDO_ITEM_PLUS_T 
SYMBOL_LIB_TABLE_T 
FP_LIB_TABLE_T 
DESIGN_BLOCK_LIB_TABLE_T 
SYMBOL_LIBS_T 
SEARCH_STACK_T 
S3D_CACHE_T 
MAX_STRUCT_TYPE_ID 

Definition at line 77 of file typeinfo.h.

Function Documentation

◆ BaseType()

◆ dyn_cast()

template<class Casted , class From >
Casted dyn_cast ( From  aObject)

A lightweight dynamic downcast.

Cast aObject to type Casted*. Uses EDA_ITEM::Type() and #EDA_ITEM::ClassOf() to check if type matches.

Parameters
aObjectobject to be casted.
Returns
down-casted object or NULL if type doesn't match Casted.

Definition at line 61 of file typeinfo.h.

◆ IsA() [1/2]

template<class T , class I >
bool IsA ( const I aObject)

Definition at line 46 of file typeinfo.h.

◆ IsA() [2/2]

template<class T , class I >
bool IsA ( const I aObject)

Check if the type of aObject is T.

Parameters
aObjectthe object for type check.
Returns
true, if aObject type equals T.

Definition at line 40 of file typeinfo.h.

◆ IsEeschemaType()

◆ IsGerbviewType()

constexpr bool IsGerbviewType ( const KICAD_T  aType)
constexpr

Definition at line 478 of file typeinfo.h.

References GERBER_DRAW_ITEM_T, GERBER_IMAGE_T, and GERBER_LAYOUT_T.

Referenced by IsTypeCorrect().

◆ IsInstantiableType()

◆ IsMiscType()

constexpr bool IsMiscType ( const KICAD_T  aType)
constexpr

◆ IsNullType()

constexpr bool IsNullType ( const KICAD_T  aType)
constexpr

Definition at line 303 of file typeinfo.h.

Referenced by IsInstantiableType(), and IsTypeCorrect().

◆ IsPageLayoutEditorType()

constexpr bool IsPageLayoutEditorType ( const KICAD_T  aType)
constexpr

◆ IsPcbnewType()

◆ IsTypeCorrect()

constexpr bool IsTypeCorrect ( KICAD_T  aType)
constexpr