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_BITMAP_T ,
  PCB_TEXT_T , PCB_TEXTBOX_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_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 , SCH_MARKER_T ,
  SCH_JUNCTION_T , SCH_NO_CONNECT_T , SCH_BUS_WIRE_ENTRY_T , SCH_BUS_BUS_ENTRY_T ,
  SCH_LINE_T , SCH_SHAPE_T , SCH_BITMAP_T , SCH_TEXTBOX_T ,
  SCH_TEXT_T , SCH_LABEL_T , SCH_GLOBAL_LABEL_T , SCH_HIER_LABEL_T ,
  SCH_DIRECTIVE_LABEL_T , SCH_FIELD_T , SCH_SYMBOL_T , SCH_SHEET_PIN_T ,
  SCH_SHEET_T , SCH_PIN_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 ,
  LIB_SYMBOL_T , LIB_SHAPE_T , LIB_TEXT_T , LIB_TEXTBOX_T ,
  LIB_PIN_T , LIB_FIELD_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 , 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. More...
 
template<class T , class I >
bool IsA (const I &aObject)
 
template<class Casted , class From >
Casted dyn_cast (From aObject)
 A lightweight dynamic downcast. More...
 
constexpr KICAD_T BaseType (const KICAD_T aType)
 Return the underlying type of the given type. More...
 
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)
 
constexpr bool IsTypeAvailable (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_BITMAP_T 

class PCB_BITMAP, bitmap 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_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_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_BO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MBOL_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 456 of file typeinfo.h.

References GERBER_DRAW_ITEM_T, GERBER_IMAGE_T, and GERBER_LAYOUT_T.

Referenced by IsTypeAvailable(), and IsTypeCorrect().

◆ IsInstantiableType()

◆ IsMiscType()

constexpr bool IsMiscType ( const KICAD_T  aType)
constexpr

Definition at line 490 of file typeinfo.h.

References FP_LIB_TABLE_T, S3D_CACHE_T, SCREEN_T, SEARCH_STACK_T, SYMBOL_LIB_TABLE_T, and SYMBOL_LIBS_T.

Referenced by IsTypeCorrect().

◆ IsNullType()

constexpr bool IsNullType ( const KICAD_T  aType)
constexpr

Definition at line 291 of file typeinfo.h.

Referenced by IsInstantiableType(), and IsTypeCorrect().

◆ IsPageLayoutEditorType()

constexpr bool IsPageLayoutEditorType ( const KICAD_T  aType)
constexpr

◆ IsPcbnewType()

◆ IsTypeAvailable()

constexpr bool IsTypeAvailable ( KICAD_T  aType)
constexpr

◆ IsTypeCorrect()

constexpr bool IsTypeCorrect ( KICAD_T  aType)
constexpr