KiCad PCB EDA Suite
typeinfo.h File Reference
#include <type_traits>

Go to the source code of this file.

Enumerations

enum  KICAD_T {
  NOT_USED = -1, EOT = 0, TYPE_NOT_INIT = 0, PCB_T,
  SCREEN_T, PCB_FOOTPRINT_T, PCB_PAD_T, PCB_SHAPE_T,
  PCB_TEXT_T, PCB_FP_TEXT_T, PCB_FP_SHAPE_T, PCB_FP_ZONE_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_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_GRAPHIC_T, PCB_LOCATE_HOLE_T,
  PCB_LOCATE_PTH_T, PCB_LOCATE_NPTH_T, PCB_LOCATE_BOARD_EDGE_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_TEXT_T, SCH_LABEL_T,
  SCH_GLOBAL_LABEL_T, SCH_HIER_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_LINE_LOCATE_WIRE_T,
  SCH_LINE_LOCATE_BUS_T, SCH_LINE_LOCATE_GRAPHIC_LINE_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_ALIAS_T, LIB_SHAPE_T, LIB_TEXT_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

EOT 

search types array terminator (End Of Types)

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_TEXT_T 

class PCB_TEXT, text on a layer

PCB_FP_TEXT_T 

class FP_TEXT, text in a footprint

PCB_FP_SHAPE_T 

class FP_SHAPE, a footprint edge

PCB_FP_ZONE_T 

class ZONE, managed by a footprint

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_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_GRAPHIC_T 
PCB_LOCATE_HOLE_T 
PCB_LOCATE_PTH_T 
PCB_LOCATE_NPTH_T 
PCB_LOCATE_BOARD_EDGE_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_TEXT_T 
SCH_LABEL_T 
SCH_GLOBAL_LABEL_T 
SCH_HIER_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_LINE_LOCATE_WIRE_T 
SCH_LINE_LOCATE_BUS_T 
SCH_LINE_LOCATE_GRAPHIC_LINE_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_ALIAS_T 
LIB_SHAPE_T 
LIB_TEXT_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 

Definition at line 77 of file typeinfo.h.

78 {
79  NOT_USED = -1,
80 
81  EOT = 0,
82 
83  TYPE_NOT_INIT = 0,
84  PCB_T,
85  SCREEN_T,
86 
87  // Items in pcb
89  PCB_PAD_T,
90  PCB_SHAPE_T,
91  PCB_TEXT_T,
95  PCB_TRACE_T,
96  PCB_VIA_T,
97  PCB_ARC_T,
98  PCB_MARKER_T,
104  PCB_TARGET_T,
105  PCB_ZONE_T,
107  PCB_NETINFO_T,
108  PCB_GROUP_T,
109 
119 
120  // Schematic draw Items. The order of these items effects the sort order.
121  // It is currently ordered to mimic the old Eeschema locate behavior where
122  // the smallest item is the selected item.
123  SCH_MARKER_T,
128  SCH_LINE_T,
129  SCH_BITMAP_T,
130  SCH_TEXT_T,
131  SCH_LABEL_T,
134  SCH_FIELD_T,
135  SCH_SYMBOL_T,
137  SCH_SHEET_T,
138  SCH_PIN_T,
139 
140  // Be prudent with these types:
141  // they should be used only to locate a specific field type among SCH_FIELD_Ts
142  // N.B. If you add a type here, be sure to add it below to the BaseType()
147 
148  // Same for picking wires and buses from SCH_LINE_T items
152 
153  // Same for picking labels attached to wires and/or buses
156 
157  // Same for picking symbols which are power symbols
159 
160  // matches any type
162 
163  // General
164  SCH_SCREEN_T,
165 
166  SCHEMATIC_T,
167 
168  /*
169  * Draw items in library symbol.
170  *
171  * The order of these items effects the sort order for items inside the
172  * "DRAW/ENDDRAW" section of the symbol definition in a library file.
173  * If you add a new draw item, type, please make sure you add it so the
174  * sort order is logical.
175  */
176  LIB_SYMBOL_T,
177  LIB_ALIAS_T,
178  LIB_SHAPE_T,
179  LIB_TEXT_T,
180  LIB_PIN_T,
181 
182  /*
183  * Fields are not saved inside the "DRAW/ENDDRAW". Add new draw item
184  * types before this line.
185  */
186  LIB_FIELD_T,
187 
188  /*
189  * For GerbView: item types:
190  */
194 
195  /*
196  * For Pl_Editor: item types:
197  */
198  WSG_LINE_T,
199  WSG_RECT_T,
200  WSG_POLY_T,
201  WSG_TEXT_T,
202  WSG_BITMAP_T,
203  WSG_PAGE_T,
204 
205  // serialized layout used in undo/redo commands
206  WS_PROXY_UNDO_ITEM_T, // serialized layout used in undo/redo commands
207  WS_PROXY_UNDO_ITEM_PLUS_T, // serialized layout plus page and title block settings
208 
209  /*
210  * FOR PROJECT::_ELEMs
211  */
216  S3D_CACHE_T,
217 
218  // End value
220 };
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:100
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
Definition: typeinfo.h:84
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:108
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:102
the 3d code uses this value
Definition: typeinfo.h:79
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
class PAD, a pad in a footprint
Definition: typeinfo.h:89
search types array terminator (End Of Types)
Definition: typeinfo.h:81
not really an item, used to identify a screen
Definition: typeinfo.h:85
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
class BOARD_ITEM_LIST, a list of board items
Definition: typeinfo.h:106
class ZONE, a copper pour area
Definition: typeinfo.h:105
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:99
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:98
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:107
class ZONE, managed by a footprint
Definition: typeinfo.h:94
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:103
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90

Function Documentation

◆ BaseType()

constexpr KICAD_T BaseType ( const KICAD_T  aType)

Return the underlying type of the given type.

This is useful for finding the element type given one of the "non-type" types such as SCH_LINE_LOCATE_WIRE_T.

Parameters
aTypeGiven type to resolve.
Returns
Base type.

Definition at line 231 of file typeinfo.h.

232 {
233  switch( aType )
234  {
239  return SCH_FIELD_T;
240 
244  return SCH_LINE_T;
245 
248  return SCH_LABEL_T;
249 
251  return SCH_SYMBOL_T;
252 
253  case PCB_LOCATE_HOLE_T:
254  case PCB_LOCATE_PTH_T:
255  case PCB_LOCATE_NPTH_T:
256  return PCB_LOCATE_HOLE_T;
257 
258  case PCB_DIM_ALIGNED_T:
259  case PCB_DIM_CENTER_T:
261  case PCB_DIM_LEADER_T:
262  return PCB_DIMENSION_T;
263 
264  default:
265  return aType;
266  }
267 }
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:100
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:102
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:99
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:103

References PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_DIMENSION_T, PCB_LOCATE_HOLE_T, PCB_LOCATE_NPTH_T, PCB_LOCATE_PTH_T, SCH_FIELD_LOCATE_DATASHEET_T, SCH_FIELD_LOCATE_FOOTPRINT_T, SCH_FIELD_LOCATE_REFERENCE_T, SCH_FIELD_LOCATE_VALUE_T, SCH_FIELD_T, SCH_LABEL_LOCATE_BUS_T, SCH_LABEL_LOCATE_WIRE_T, SCH_LABEL_T, SCH_LINE_LOCATE_BUS_T, SCH_LINE_LOCATE_GRAPHIC_LINE_T, SCH_LINE_LOCATE_WIRE_T, SCH_LINE_T, SCH_SYMBOL_LOCATE_POWER_T, and SCH_SYMBOL_T.

Referenced by DIALOG_DIMENSION_PROPERTIES::DIALOG_DIMENSION_PROPERTIES(), EE_RTREE::EE_TYPE::EE_TYPE(), DRC_TEST_PROVIDER::forEachGeometryItem(), PCB_VIEWER_TOOLS::GraphicOutlines(), PCB_POINT_EDITOR::OnSelectionChange(), and PCB_VIEWER_TOOLS::TextOutlines().

◆ 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.

62 {
63  if( std::remove_pointer<Casted>::type::ClassOf ( aObject ) )
64  return static_cast<Casted>( aObject );
65 
66  return nullptr;
67 }

◆ IsA() [1/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.

41 {
42  return aObject && std::remove_pointer<T>::type::ClassOf( aObject );
43 }

◆ IsA() [2/2]

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

Definition at line 46 of file typeinfo.h.

47 {
48  return std::remove_pointer<T>::type::ClassOf( &aObject );
49 }

◆ IsEeschemaType()

constexpr bool IsEeschemaType ( const KICAD_T  aType)

Definition at line 321 of file typeinfo.h.

322 {
323  switch( aType )
324  {
325  case SCH_MARKER_T:
326  case SCH_JUNCTION_T:
327  case SCH_NO_CONNECT_T:
329  case SCH_BUS_BUS_ENTRY_T:
330  case SCH_LINE_T:
331  case SCH_BITMAP_T:
332  case SCH_TEXT_T:
333  case SCH_LABEL_T:
334  case SCH_GLOBAL_LABEL_T:
335  case SCH_HIER_LABEL_T:
336  case SCH_FIELD_T:
337  case SCH_SYMBOL_T:
338  case SCH_SHEET_PIN_T:
339  case SCH_SHEET_T:
340  case SCH_PIN_T:
341 
346 
350 
353 
355  case SCH_LOCATE_ANY_T:
356 
357  case SCH_SCREEN_T:
358  case SCHEMATIC_T:
359 
360  case LIB_SYMBOL_T:
361  case LIB_ALIAS_T:
362  case LIB_SHAPE_T:
363  case LIB_TEXT_T:
364  case LIB_PIN_T:
365 
366  case LIB_FIELD_T:
367  return true;
368 
369  default:
370  return false;
371  }
372 }

References LIB_ALIAS_T, LIB_FIELD_T, LIB_PIN_T, LIB_SHAPE_T, LIB_SYMBOL_T, LIB_TEXT_T, SCH_BITMAP_T, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_FIELD_LOCATE_DATASHEET_T, SCH_FIELD_LOCATE_FOOTPRINT_T, SCH_FIELD_LOCATE_REFERENCE_T, SCH_FIELD_LOCATE_VALUE_T, SCH_FIELD_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_JUNCTION_T, SCH_LABEL_LOCATE_BUS_T, SCH_LABEL_LOCATE_WIRE_T, SCH_LABEL_T, SCH_LINE_LOCATE_BUS_T, SCH_LINE_LOCATE_GRAPHIC_LINE_T, SCH_LINE_LOCATE_WIRE_T, SCH_LINE_T, SCH_LOCATE_ANY_T, SCH_MARKER_T, SCH_NO_CONNECT_T, SCH_PIN_T, SCH_SCREEN_T, SCH_SHEET_PIN_T, SCH_SHEET_T, SCH_SYMBOL_LOCATE_POWER_T, SCH_SYMBOL_T, SCH_TEXT_T, and SCHEMATIC_T.

Referenced by TEST_EE_ITEM_FIXTURE::Instantiate(), IsTypeAvailable(), and IsTypeCorrect().

◆ IsGerbviewType()

constexpr bool IsGerbviewType ( const KICAD_T  aType)

Definition at line 418 of file typeinfo.h.

419 {
420  switch( aType )
421  {
422  case GERBER_LAYOUT_T:
423  case GERBER_DRAW_ITEM_T:
424  case GERBER_IMAGE_T:
425  return true;
426 
427  default:
428  return false;
429  }
430 }

References GERBER_DRAW_ITEM_T, GERBER_IMAGE_T, and GERBER_LAYOUT_T.

Referenced by IsTypeAvailable(), and IsTypeCorrect().

◆ IsInstantiableType()

constexpr bool IsInstantiableType ( const KICAD_T  aType)

Definition at line 274 of file typeinfo.h.

275 {
276  if( IsNullType( aType ) )
277  return false;
278 
279  switch( aType )
280  {
281  case SCH_LOCATE_ANY_T:
282 
287 
291 
294 
296 
297  case PCB_LOCATE_STDVIA_T:
298  case PCB_LOCATE_UVIA_T:
299  case PCB_LOCATE_BBVIA_T:
300  case PCB_LOCATE_TEXT_T:
302  case PCB_LOCATE_HOLE_T:
303  case PCB_LOCATE_PTH_T:
304  case PCB_LOCATE_NPTH_T:
306 
307  case PCB_DIMENSION_T:
308 
309  case SCH_SCREEN_T:
310  case PCB_ITEM_LIST_T:
311  return false;
312 
313  default:
314  break;
315  }
316 
317  return true;
318 
319 }
class BOARD_ITEM_LIST, a list of board items
Definition: typeinfo.h:106
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:99
constexpr bool IsNullType(const KICAD_T aType)
Definition: typeinfo.h:269

References IsNullType(), PCB_DIMENSION_T, PCB_ITEM_LIST_T, PCB_LOCATE_BBVIA_T, PCB_LOCATE_BOARD_EDGE_T, PCB_LOCATE_GRAPHIC_T, PCB_LOCATE_HOLE_T, PCB_LOCATE_NPTH_T, PCB_LOCATE_PTH_T, PCB_LOCATE_STDVIA_T, PCB_LOCATE_TEXT_T, PCB_LOCATE_UVIA_T, SCH_FIELD_LOCATE_DATASHEET_T, SCH_FIELD_LOCATE_FOOTPRINT_T, SCH_FIELD_LOCATE_REFERENCE_T, SCH_FIELD_LOCATE_VALUE_T, SCH_LABEL_LOCATE_BUS_T, SCH_LABEL_LOCATE_WIRE_T, SCH_LINE_LOCATE_BUS_T, SCH_LINE_LOCATE_GRAPHIC_LINE_T, SCH_LINE_LOCATE_WIRE_T, SCH_LOCATE_ANY_T, SCH_SCREEN_T, and SCH_SYMBOL_LOCATE_POWER_T.

Referenced by TEST_BOARD_ITEM_FIXTURE::Instantiate(), TEST_EE_ITEM_FIXTURE::Instantiate(), and IsTypeAvailable().

◆ IsMiscType()

constexpr bool IsMiscType ( const KICAD_T  aType)

Definition at line 452 of file typeinfo.h.

453 {
454  switch( aType )
455  {
456  case SCREEN_T:
457 
458  case SYMBOL_LIB_TABLE_T:
459  case FP_LIB_TABLE_T:
460  case SYMBOL_LIBS_T:
461  case SEARCH_STACK_T:
462  case S3D_CACHE_T:
463  return true;
464 
465  default:
466  return false;
467  }
468 }
not really an item, used to identify a screen
Definition: typeinfo.h:85

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)

Definition at line 269 of file typeinfo.h.

270 {
271  return aType <= 0;
272 }

Referenced by IsInstantiableType(), and IsTypeCorrect().

◆ IsPageLayoutEditorType()

constexpr bool IsPageLayoutEditorType ( const KICAD_T  aType)

Definition at line 432 of file typeinfo.h.

433 {
434  switch( aType )
435  {
436  case WSG_LINE_T:
437  case WSG_RECT_T:
438  case WSG_POLY_T:
439  case WSG_TEXT_T:
440  case WSG_BITMAP_T:
441  case WSG_PAGE_T:
442 
445  return true;
446 
447  default:
448  return false;
449  }
450 }

References WS_PROXY_UNDO_ITEM_PLUS_T, WS_PROXY_UNDO_ITEM_T, WSG_BITMAP_T, WSG_LINE_T, WSG_PAGE_T, WSG_POLY_T, WSG_RECT_T, and WSG_TEXT_T.

Referenced by IsTypeAvailable(), and IsTypeCorrect().

◆ IsPcbnewType()

constexpr bool IsPcbnewType ( const KICAD_T  aType)

Definition at line 374 of file typeinfo.h.

375 {
376  switch( aType )
377  {
378  case PCB_T:
379 
380  case PCB_FOOTPRINT_T:
381  case PCB_PAD_T:
382  case PCB_SHAPE_T:
383  case PCB_TEXT_T:
384  case PCB_FP_TEXT_T:
385  case PCB_FP_SHAPE_T:
386  case PCB_FP_ZONE_T:
387  case PCB_TRACE_T:
388  case PCB_VIA_T:
389  case PCB_ARC_T:
390  case PCB_MARKER_T:
391  case PCB_DIMENSION_T:
392  case PCB_DIM_ALIGNED_T:
393  case PCB_DIM_LEADER_T:
394  case PCB_DIM_CENTER_T:
396  case PCB_TARGET_T:
397  case PCB_ZONE_T:
398  case PCB_ITEM_LIST_T:
399  case PCB_NETINFO_T:
400  case PCB_GROUP_T:
401 
402  case PCB_LOCATE_STDVIA_T:
403  case PCB_LOCATE_UVIA_T:
404  case PCB_LOCATE_BBVIA_T:
405  case PCB_LOCATE_TEXT_T:
407  case PCB_LOCATE_HOLE_T:
408  case PCB_LOCATE_PTH_T:
409  case PCB_LOCATE_NPTH_T:
411  return true;
412 
413  default:
414  return false;
415  }
416 }
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
Definition: typeinfo.h:100
class PCB_DIM_LEADER, a leader dimension (graphic item)
Definition: typeinfo.h:101
Definition: typeinfo.h:84
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:108
class PCB_DIM_CENTER, a center point marking (graphic item)
Definition: typeinfo.h:102
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:97
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
class PAD, a pad in a footprint
Definition: typeinfo.h:89
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:95
class BOARD_ITEM_LIST, a list of board items
Definition: typeinfo.h:106
class ZONE, a copper pour area
Definition: typeinfo.h:105
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:99
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:104
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
class PCB_MARKER, a marker used to show something
Definition: typeinfo.h:98
class NETINFO_ITEM, a description of a net
Definition: typeinfo.h:107
class ZONE, managed by a footprint
Definition: typeinfo.h:94
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
Definition: typeinfo.h:103
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:96
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90

References PCB_ARC_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_DIMENSION_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_ITEM_LIST_T, PCB_LOCATE_BBVIA_T, PCB_LOCATE_BOARD_EDGE_T, PCB_LOCATE_GRAPHIC_T, PCB_LOCATE_HOLE_T, PCB_LOCATE_NPTH_T, PCB_LOCATE_PTH_T, PCB_LOCATE_STDVIA_T, PCB_LOCATE_TEXT_T, PCB_LOCATE_UVIA_T, PCB_MARKER_T, PCB_NETINFO_T, PCB_PAD_T, PCB_SHAPE_T, PCB_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TRACE_T, PCB_VIA_T, and PCB_ZONE_T.

Referenced by TEST_BOARD_ITEM_FIXTURE::Instantiate(), IsTypeAvailable(), and IsTypeCorrect().

◆ IsTypeAvailable()

constexpr bool IsTypeAvailable ( KICAD_T  aType)

Definition at line 480 of file typeinfo.h.

481 {
482  if( !IsInstantiableType( aType ) )
483  return false;
484 
485  if( IsEeschemaType( aType ) )
486  {
487 #ifdef EESCHEMA
488  return true;
489 #endif // EESCHEMA
490  }
491 
492  if( IsPcbnewType( aType ) )
493  {
494 #ifdef PCBNEW
495  return true;
496 #endif // PCBNEW
497  }
498 
499  if( IsGerbviewType( aType ) )
500  {
501 #ifdef GERBVIEW
502  return true;
503 #endif // GERBVIEW
504  }
505 
506  if( IsPageLayoutEditorType( aType ) )
507  {
508 #ifdef PL_EDITOR
509  return true;
510 #endif // PL_EDITOR
511  }
512 
513  return false;
514 }
constexpr bool IsEeschemaType(const KICAD_T aType)
Definition: typeinfo.h:321
constexpr bool IsPcbnewType(const KICAD_T aType)
Definition: typeinfo.h:374
constexpr bool IsGerbviewType(const KICAD_T aType)
Definition: typeinfo.h:418
constexpr bool IsInstantiableType(const KICAD_T aType)
Definition: typeinfo.h:274
constexpr bool IsPageLayoutEditorType(const KICAD_T aType)
Definition: typeinfo.h:432

References IsEeschemaType(), IsGerbviewType(), IsInstantiableType(), IsPageLayoutEditorType(), and IsPcbnewType().

◆ IsTypeCorrect()

constexpr bool IsTypeCorrect ( KICAD_T  aType)

Definition at line 470 of file typeinfo.h.

471 {
472  return IsNullType( aType )
473  || IsEeschemaType( aType )
474  || IsPcbnewType( aType )
475  || IsGerbviewType( aType )
476  || IsPageLayoutEditorType( aType )
477  || IsMiscType( aType );
478 }
constexpr bool IsEeschemaType(const KICAD_T aType)
Definition: typeinfo.h:321
constexpr bool IsPcbnewType(const KICAD_T aType)
Definition: typeinfo.h:374
constexpr bool IsGerbviewType(const KICAD_T aType)
Definition: typeinfo.h:418
constexpr bool IsNullType(const KICAD_T aType)
Definition: typeinfo.h:269
constexpr bool IsPageLayoutEditorType(const KICAD_T aType)
Definition: typeinfo.h:432
constexpr bool IsMiscType(const KICAD_T aType)
Definition: typeinfo.h:452

References IsEeschemaType(), IsGerbviewType(), IsMiscType(), IsNullType(), IsPageLayoutEditorType(), and IsPcbnewType().

Referenced by BOOST_AUTO_TEST_CASE().