KiCad PCB EDA Suite
TRACK_VIA_DESC Struct Reference

Public Member Functions

 TRACK_VIA_DESC ()
 

Detailed Description

Definition at line 1042 of file class_track.cpp.

Constructor & Destructor Documentation

◆ TRACK_VIA_DESC()

TRACK_VIA_DESC::TRACK_VIA_DESC ( )
inline

Definition at line 1044 of file class_track.cpp.

1045  {
1047  .Undefined( VIATYPE::NOT_DEFINED )
1048  .Map( VIATYPE::THROUGH, _( "Through" ) )
1049  .Map( VIATYPE::BLIND_BURIED, _( "Blind/Buried" ) )
1050  .Map( VIATYPE::MICROVIA, _( "Microvia" ) );
1051 
1053 
1054  if( layerEnum.Choices().GetCount() == 0 )
1055  {
1056  layerEnum.Undefined( UNDEFINED_LAYER );
1057 
1058  for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq )
1059  layerEnum.Map( *seq, LSET::Name( *seq ) );
1060  }
1061 
1063 
1064  // Track
1065  REGISTER_TYPE( TRACK );
1067 
1068  propMgr.AddProperty( new PROPERTY<TRACK, int>( _( "Width" ),
1070  propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _( "Position X" ),
1071  new PROPERTY<TRACK, int, BOARD_ITEM>( _( "Origin X" ),
1073  propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _( "Position Y" ),
1074  new PROPERTY<TRACK, int, BOARD_ITEM>( _( "Origin Y" ),
1076  propMgr.AddProperty( new PROPERTY<TRACK, int>( _( "End X" ),
1078  propMgr.AddProperty( new PROPERTY<TRACK, int>( _( "End Y" ),
1080 
1081  // Via
1082  REGISTER_TYPE( VIA );
1084 
1085  // TODO layerset for vias?
1086  // TODO test drill, use getdrillvalue?
1087  propMgr.ReplaceProperty( TYPE_HASH( TRACK ), _( "Width" ),
1088  new PROPERTY<VIA, int, TRACK>( _( "Diameter" ), &VIA::SetWidth, &VIA::GetWidth,
1090  propMgr.AddProperty( new PROPERTY<VIA, int>( _( "Drill" ),
1092  propMgr.ReplaceProperty( TYPE_HASH( BOARD_ITEM ), _( "Layer" ),
1093  new PROPERTY_ENUM<VIA, PCB_LAYER_ID, BOARD_ITEM>( _( "Layer Top" ),
1095  propMgr.AddProperty( new PROPERTY_ENUM<VIA, PCB_LAYER_ID>( _( "Layer Bottom" ),
1097  propMgr.AddProperty( new PROPERTY_ENUM<VIA, VIATYPE>( _( "Via Type" ),
1099  }
static PROPERTY_MANAGER & Instance()
Definition: property_mgr.h:61
#define TYPE_HASH(x)
Macro to generate unique identifier for a type
Definition: property.h:53
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
ENUM_MAP & Undefined(T aValue)
Definition: property.h:531
static ENUM_MAP< T > & Instance()
Definition: property.h:517
wxPGChoices & Choices()
Definition: property.h:557
void SetEndY(int aY)
Definition: class_track.h:119
BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected and have...
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names
Definition: property_mgr.h:244
void SetWidth(int aWidth)
Definition: class_track.h:109
Display value expressed in distance units (mm/inch)
Definition: property.h:47
int GetY() const
int GetDrillValue() const
Function GetDrillValue "calculates" the drill value for vias (m-Drill if > 0, or default drill value ...
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Function Name returns the fixed name association with aLayerId.
Definition: lset.cpp:81
int GetEndY() const
Definition: class_track.h:122
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declares an inheritance relationship between types.
void SetY(int aY)
static LSET AllLayersMask()
Definition: lset.cpp:756
void SetX(int aX)
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
int GetX() const
int GetWidth() const
Definition: class_track.h:110
#define _(s)
Definition: 3d_actions.cpp:33
void AddProperty(PROPERTY_BASE *aProperty)
Registers a property.
void SetDrill(int aDrill)
Function SetDrill sets the drill value for vias.
Definition: class_track.h:483
VIATYPE GetViaType() const
Definition: class_track.h:381
void SetBottomLayer(PCB_LAYER_ID aLayer)
void ReplaceProperty(size_t aBase, const wxString &aName, PROPERTY_BASE *aNew)
Replaces an existing property for a specific type.
Provides class metadata.
Definition: property_mgr.h:58
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition: property.h:523
void SetViaType(VIATYPE aViaType)
Definition: class_track.h:382
PCB_LAYER_ID BottomLayer() const
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
int GetEndX() const
Definition: class_track.h:121
void SetEndX(int aX)
Definition: class_track.h:118

References _, PROPERTY_MANAGER::AddProperty(), LSET::AllLayersMask(), BLIND_BURIED, VIA::BottomLayer(), ENUM_MAP< T >::Choices(), DISTANCE, VIA::GetDrillValue(), TRACK::GetEndX(), TRACK::GetEndY(), BOARD_ITEM::GetLayer(), VIA::GetViaType(), TRACK::GetWidth(), BOARD_ITEM::GetX(), BOARD_ITEM::GetY(), PROPERTY_MANAGER::InheritsAfter(), PROPERTY_MANAGER::Instance(), ENUM_MAP< T >::Instance(), ENUM_MAP< T >::Map(), MICROVIA, LSET::Name(), NOT_DEFINED, REGISTER_TYPE, PROPERTY_MANAGER::ReplaceProperty(), VIA::SetBottomLayer(), VIA::SetDrill(), TRACK::SetEndX(), TRACK::SetEndY(), BOARD_ITEM::SetLayer(), VIA::SetViaType(), TRACK::SetWidth(), BOARD_ITEM::SetX(), BOARD_ITEM::SetY(), THROUGH, TYPE_HASH, ENUM_MAP< T >::Undefined(), and UNDEFINED_LAYER.


The documentation for this struct was generated from the following file: