KiCad PCB EDA Suite
cadstar_pcb_archive_loader.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2020-2021 Roberto Fernandez Bautista <roberto.fer.bau@gmail.com>
5  * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
26 #ifndef CADSTAR_PCB_ARCHIVE_LOADER_H_
27 #define CADSTAR_PCB_ARCHIVE_LOADER_H_
28 
31 #include <board.h>
32 #include <footprint.h>
33 #include <set>
34 
35 class BOARD;
36 class BOARD_STACKUP_ITEM;
37 class PCB_DIMENSION_BASE;
38 
40 {
41 public:
43  wxString aFilename, LAYER_MAPPING_HANDLER aLayerMappingHandler, bool aLogLayerWarnings )
44  : CADSTAR_PCB_ARCHIVE_PARSER( aFilename )
45  {
46  m_layerMappingHandler = aLayerMappingHandler;
47  m_logLayerWarnings = aLogLayerWarnings;
48  m_board = nullptr;
49  m_project = nullptr;
50  m_designCenter.x = 0;
51  m_designCenter.y = 0;
52  m_doneCopperWarning = false;
54  m_doneNetClassWarning = false;
55  m_numNets = 0;
56  }
57 
58 
60  {
61  for( std::pair<SYMDEF_ID, FOOTPRINT*> libItem : m_libraryMap )
62  {
63  FOOTPRINT* footprint = libItem.second;
64 
65  if( footprint )
66  delete footprint;
67  }
68  }
69 
74  void Load( BOARD* aBoard, PROJECT* aProject );
75 
80  std::vector<FOOTPRINT*> GetLoadedLibraryFootpints() const;
81 
82 private:
87  std::map<LAYER_ID, PCB_LAYER_ID> m_layermap;
88  std::map<SYMDEF_ID, FOOTPRINT*> m_libraryMap;
90  std::map<GROUP_ID, PCB_GROUP*> m_groupMap;
94  std::map<COMPONENT_ID, FOOTPRINT*> m_componentMap;
98 
106  using ASSOCIATED_COPPER_PADS = std::map<PAD_ID, std::vector<PAD_ID>>;
107 
111  std::map<SYMDEF_ID, ASSOCIATED_COPPER_PADS> m_librarycopperpads;
112 
113  std::map<NET_ID, NETINFO_ITEM*> m_netMap;
114  std::map<ROUTECODE_ID, NETCLASSPTR> m_netClassMap;
115  std::map<TEMPLATE_ID, ZONE*> m_zonesMap;
116  std::vector<LAYER_ID> m_powerPlaneLayers;
117  wxPoint m_designCenter;
120  std::set<HATCHCODE_ID> m_hatchcodesTested;
123  std::set<PADCODE_ID> m_padcodesTested;
125  bool m_doneCopperWarning;
129  bool m_doneNetClassWarning;
131  int m_numNets;
133 
134 
135  // Functions for loading individual elements:
136  void loadBoardStackup();
137  void remapUnsureLayers();
138  void loadDesignRules();
139  void loadComponentLibrary();
140  void loadGroups();
141  void loadBoards();
142  void loadFigures();
143  void loadTexts();
144  void loadDimensions();
145  void loadAreas();
146  void loadComponents();
148  void loadTemplates();
149  void loadCoppers();
150  void loadNets();
151  void loadTextVariables();
152 
153  // Helper functions for element loading:
154  void logBoardStackupWarning( const wxString& aCadstarLayerName,
155  const PCB_LAYER_ID& aKiCadLayer );
156  void logBoardStackupMessage( const wxString& aCadstarLayerName,
157  const PCB_LAYER_ID& aKiCadLayer );
158  void initStackupItem( const LAYER& aCadstarLayer, BOARD_STACKUP_ITEM* aKiCadItem,
159  int aDielectricSublayer );
160  void loadLibraryFigures( const SYMDEF_PCB& aComponent, FOOTPRINT* aFootprint );
161  void loadLibraryCoppers( const SYMDEF_PCB& aComponent, FOOTPRINT* aFootprint );
162  void loadLibraryAreas( const SYMDEF_PCB& aComponent, FOOTPRINT* aFootprint );
163  void loadLibraryPads( const SYMDEF_PCB& aComponent, FOOTPRINT* aFootprint );
164  void loadComponentAttributes( const COMPONENT& aComponent, FOOTPRINT* aFootprint );
165  void loadNetTracks( const NET_ID& aCadstarNetID, const NET_PCB::ROUTE& aCadstarRoute,
166  long aStartWidth = std::numeric_limits<long>::max(),
167  long aEndWidth = std::numeric_limits<long>::max() );
168 
170  int loadNetVia( const NET_ID& aCadstarNetID, const NET_PCB::VIA& aCadstarVia );
171  void checkAndLogHatchCode( const HATCHCODE_ID& aCadstarHatchcodeID );
172  void applyDimensionSettings( const DIMENSION& aCadstarDim, PCB_DIMENSION_BASE* aKiCadDim );
173 
174 
179 
180  //Helper functions for drawing /loading objects onto screen:
181 
194  void drawCadstarText( const TEXT& aCadstarText, BOARD_ITEM_CONTAINER* aContainer,
195  const GROUP_ID& aCadstarGroupID = wxEmptyString,
196  const LAYER_ID& aCadstarLayerOverride = wxEmptyString,
197  const wxPoint& aMoveVector = { 0, 0 },
198  const double& aRotationAngle = 0.0,
199  const double& aScalingFactor = 1.0,
200  const wxPoint& aTransformCentre = { 0, 0 },
201  const bool& aMirrorInvert = false );
202 
217  void drawCadstarShape( const SHAPE& aCadstarShape, const PCB_LAYER_ID& aKiCadLayer,
218  const int& aLineThickness, const wxString& aShapeName,
219  BOARD_ITEM_CONTAINER* aContainer,
220  const GROUP_ID& aCadstarGroupID = wxEmptyString,
221  const wxPoint& aMoveVector = { 0, 0 },
222  const double& aRotationAngle = 0.0, const double& aScalingFactor = 1.0,
223  const wxPoint& aTransformCentre = { 0, 0 },
224  const bool& aMirrorInvert = false );
225 
239  void drawCadstarCutoutsAsSegments( const std::vector<CUTOUT>& aCutouts,
240  const PCB_LAYER_ID& aKiCadLayer, const int& aLineThickness,
241  BOARD_ITEM_CONTAINER* aContainer,
242  const GROUP_ID& aCadstarGroupID = wxEmptyString,
243  const wxPoint& aMoveVector = { 0, 0 },
244  const double& aRotationAngle = 0.0,
245  const double& aScalingFactor = 1.0,
246  const wxPoint& aTransformCentre = { 0, 0 },
247  const bool& aMirrorInvert = false );
248 
263  void drawCadstarVerticesAsSegments( const std::vector<VERTEX>& aCadstarVertices,
264  const PCB_LAYER_ID& aKiCadLayer, const int& aLineThickness,
265  BOARD_ITEM_CONTAINER* aContainer,
266  const GROUP_ID& aCadstarGroupID = wxEmptyString,
267  const wxPoint& aMoveVector = { 0, 0 },
268  const double& aRotationAngle = 0.0,
269  const double& aScalingFactor = 1.0,
270  const wxPoint& aTransformCentre = { 0, 0 },
271  const bool& aMirrorInvert = false );
272 
285  std::vector<PCB_SHAPE*> getDrawSegmentsFromVertices( const std::vector<VERTEX>& aCadstarVertices,
286  BOARD_ITEM_CONTAINER* aContainer = nullptr,
287  const GROUP_ID& aCadstarGroupID = wxEmptyString,
288  const wxPoint& aMoveVector = { 0, 0 },
289  const double& aRotationAngle = 0.0,
290  const double& aScalingFactor = 1.0,
291  const wxPoint& aTransformCentre = { 0, 0 },
292  const bool& aMirrorInvert = false );
293 
307  PCB_SHAPE* getDrawSegmentFromVertex( const POINT& aCadstarStartPoint,
308  const VERTEX& aCadstarVertex,
309  BOARD_ITEM_CONTAINER* aContainer = nullptr,
310  const GROUP_ID& aCadstarGroupID = wxEmptyString,
311  const wxPoint& aMoveVector = { 0, 0 },
312  const double& aRotationAngle = 0.0,
313  const double& aScalingFactor = 1.0,
314  const wxPoint& aTransformCentre = { 0, 0 },
315  const bool& aMirrorInvert = false );
316 
324  ZONE* getZoneFromCadstarShape( const SHAPE& aCadstarShape, const int& aLineThickness,
325  BOARD_ITEM_CONTAINER* aParentContainer );
326 
339  SHAPE_POLY_SET getPolySetFromCadstarShape( const SHAPE& aCadstarShape,
340  const int& aLineThickness = -1,
341  BOARD_ITEM_CONTAINER* aContainer = nullptr,
342  const wxPoint& aMoveVector = { 0, 0 },
343  const double& aRotationAngle = 0.0,
344  const double& aScalingFactor = 1.0,
345  const wxPoint& aTransformCentre = { 0, 0 },
346  const bool& aMirrorInvert = false );
347 
353  SHAPE_LINE_CHAIN getLineChainFromDrawsegments( const std::vector<PCB_SHAPE*> aDrawSegments );
354 
366  std::vector<PCB_TRACK*> makeTracksFromDrawsegments( const std::vector<PCB_SHAPE*> aDrawsegments,
367  BOARD_ITEM_CONTAINER* aParentContainer,
368  NETINFO_ITEM* aNet = nullptr,
369  PCB_LAYER_ID aLayerOverride = UNDEFINED_LAYER,
370  int aWidthOverride = -1 );
371 
379  void addAttribute( const ATTRIBUTE_LOCATION& aCadstarAttrLoc,
380  const ATTRIBUTE_ID& aCadstarAttributeID, FOOTPRINT* aFootprint,
381  const wxString& aAttributeValue );
382 
391  void applyRouteOffset( wxPoint* aPointToOffset, const wxPoint& aRefPoint,
392  const long& aOffsetAmount );
393 
394  //Helper Functions for obtaining CADSTAR elements in the parsed structures
395  int getLineThickness( const LINECODE_ID& aCadstarLineCodeID );
396  COPPERCODE getCopperCode( const COPPERCODE_ID& aCadstaCopperCodeID );
397  HATCHCODE getHatchCode( const HATCHCODE_ID& aCadstarHatchcodeID );
398  LAYERPAIR getLayerPair( const LAYERPAIR_ID& aCadstarLayerPairID );
399  PADCODE getPadCode( const PADCODE_ID& aCadstarPadCodeID );
400  PART getPart( const PART_ID& aCadstarPartID );
401  ROUTECODE getRouteCode( const ROUTECODE_ID& aCadstarRouteCodeID );
402  TEXTCODE getTextCode( const TEXTCODE_ID& aCadstarTextCodeID );
403  VIACODE getViaCode( const VIACODE_ID& aCadstarViaCodeID );
404  wxString getAttributeName( const ATTRIBUTE_ID& aCadstarAttributeID );
405  wxString getAttributeValue( const ATTRIBUTE_ID& aCadstarAttributeID,
406  const std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE>& aCadstarAttributeMap );
407 
408  // Helper Functions for obtaining individual elements as KiCad elements:
409  double getHatchCodeAngleDegrees( const HATCHCODE_ID& aCadstarHatchcodeID );
410  PAD* getKiCadPad( const COMPONENT_PAD& aCadstarPad, FOOTPRINT* aParent );
411  PAD*& getPadReference( FOOTPRINT* aFootprint, const PAD_ID aCadstarPadID );
412  FOOTPRINT* getFootprintFromCadstarID( const COMPONENT_ID& aCadstarComponentID );
413  int getKiCadHatchCodeThickness( const HATCHCODE_ID& aCadstarHatchcodeID );
414  int getKiCadHatchCodeGap( const HATCHCODE_ID& aCadstarHatchcodeID );
415  PCB_GROUP* getKiCadGroup( const GROUP_ID& aCadstarGroupID );
416 
422  wxPoint getKiCadPoint( wxPoint aCadstarPoint );
423 
429  int getKiCadLength( long long aCadstarLength )
430  {
431  return aCadstarLength * KiCadUnitMultiplier;
432  }
433 
439  double getAngleTenthDegree( const long long& aCadstarAngle )
440  {
441  // CADSTAR v6 (which outputted Format Version 8) and earlier versions used 1/10 degree
442  // as the unit for angles/orientations. It is assumed that CADSTAR version 7 (i.e. Format
443  // Version 9 and later) is the version that introduced 1/1000 degree for angles.
444  if( Header.Format.Version > 8 )
445  {
446  return (double) aCadstarAngle / 100.0;
447  }
448  else
449  {
450  return (double) aCadstarAngle;
451  }
452  }
453 
459  double getAngleDegrees( const long long& aCadstarAngle )
460  {
461  return getAngleTenthDegree( aCadstarAngle ) / 10.0;
462  }
463 
469  double getPolarAngle( wxPoint aPoint );
470 
477  NETINFO_ITEM* getKiCadNet( const NET_ID& aCadstarNetID );
478 
485  PCB_LAYER_ID getKiCadCopperLayerID( unsigned int aLayerNum, bool aDetectMaxLayer = true );
486 
492  bool isLayerSet( const LAYER_ID& aCadstarLayerID );
493 
499  PCB_LAYER_ID getKiCadLayer( const LAYER_ID& aCadstarLayerID );
500 
506  LSET getKiCadLayerSet( const LAYER_ID& aCadstarLayerID );
507 
508 
509  bool isFootprint( BOARD_ITEM_CONTAINER* aContainer )
510  {
511  return aContainer && aContainer->Type() == PCB_FOOTPRINT_T;
512  }
513 
514 
515  void addToGroup( const GROUP_ID& aCadstarGroupID, BOARD_ITEM* aKiCadItem );
516 
523  GROUP_ID createUniqueGroupID( const wxString& aName );
524 };
525 
526 
527 #endif // CADSTAR_PCB_ARCHIVE_LOADER_H_
COPPERCODE getCopperCode(const COPPERCODE_ID &aCadstaCopperCodeID)
int getKiCadLength(long long aCadstarLength)
void addAttribute(const ATTRIBUTE_LOCATION &aCadstarAttrLoc, const ATTRIBUTE_ID &aCadstarAttributeID, FOOTPRINT *aFootprint, const wxString &aAttributeValue)
Adds a CADSTAR Attribute to a KiCad footprint.
int getKiCadHatchCodeGap(const HATCHCODE_ID &aCadstarHatchcodeID)
void applyDimensionSettings(const DIMENSION &aCadstarDim, PCB_DIMENSION_BASE *aKiCadDim)
std::vector< PCB_TRACK * > makeTracksFromDrawsegments(const std::vector< PCB_SHAPE * > aDrawsegments, BOARD_ITEM_CONTAINER *aParentContainer, NETINFO_ITEM *aNet=nullptr, PCB_LAYER_ID aLayerOverride=UNDEFINED_LAYER, int aWidthOverride=-1)
Returns a vector of pointers to TRACK/ARC objects.
Pcbnew PLUGIN for CADSTAR PCB Archive (*.cpa) format: an ASCII format based on S-expressions.
NETINFO_ITEM * getKiCadNet(const NET_ID &aCadstarNetID)
Searches m_netMap and returns the NETINFO_ITEM pointer if exists.
Container for project specific data.
Definition: project.h:62
double getAngleDegrees(const long long &aCadstarAngle)
ZONE * getZoneFromCadstarShape(const SHAPE &aCadstarShape, const int &aLineThickness, BOARD_ITEM_CONTAINER *aParentContainer)
std::map< COMPONENT_ID, FOOTPRINT * > m_componentMap
Map between Cadstar and KiCad components on the board.
double getAngleTenthDegree(const long long &aCadstarAngle)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:80
void drawCadstarShape(const SHAPE &aCadstarShape, const PCB_LAYER_ID &aKiCadLayer, const int &aLineThickness, const wxString &aShapeName, BOARD_ITEM_CONTAINER *aContainer, const GROUP_ID &aCadstarGroupID=wxEmptyString, const wxPoint &aMoveVector={ 0, 0 }, const double &aRotationAngle=0.0, const double &aScalingFactor=1.0, const wxPoint &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
A set of BOARD_ITEMs (i.e., without duplicates).
Definition: pcb_group.h:50
wxString getAttributeValue(const ATTRIBUTE_ID &aCadstarAttributeID, const std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > &aCadstarAttributeMap)
LAYER_MAPPING_HANDLER m_layerMappingHandler
Callback to get layer mapping.
CADSTAR_PCB_ARCHIVE_LOADER(wxString aFilename, LAYER_MAPPING_HANDLER aLayerMappingHandler, bool aLogLayerWarnings)
wxPoint m_designCenter
Used for calculating the required offset to apply to the Cadstar design so that it fits in KiCad canv...
PCB_GROUP * getKiCadGroup(const GROUP_ID &aCadstarGroupID)
LAYERPAIR getLayerPair(const LAYERPAIR_ID &aCadstarLayerPairID)
long PAD_ID
Pad identifier (pin) in the PCB.
void remapUnsureLayers()
Callback m_layerMappingHandler for layers we aren't sure of.
bool m_doneSpacingClassWarning
Used by getKiCadNet() to avoid multiple duplicate warnings.
std::map< SYMDEF_ID, FOOTPRINT * > m_libraryMap
Map between Cadstar and KiCad components in the library.
ROUTECODE getRouteCode(const ROUTECODE_ID &aCadstarRouteCodeID)
Abstract dimension API.
Definition: pcb_dimension.h:95
void checkAndLogHatchCode(const HATCHCODE_ID &aCadstarHatchcodeID)
std::set< HATCHCODE_ID > m_hatchcodesTested
Used by checkAndLogHatchCode() to avoid multiple duplicate warnings.
void loadComponentAttributes(const COMPONENT &aComponent, FOOTPRINT *aFootprint)
void logBoardStackupWarning(const wxString &aCadstarLayerName, const PCB_LAYER_ID &aKiCadLayer)
void loadLibraryPads(const SYMDEF_PCB &aComponent, FOOTPRINT *aFootprint)
std::vector< FOOTPRINT * > GetLoadedLibraryFootpints() const
Return a copy of the loaded library footprints (caller owns the objects)
void drawCadstarText(const TEXT &aCadstarText, BOARD_ITEM_CONTAINER *aContainer, const GROUP_ID &aCadstarGroupID=wxEmptyString, const LAYER_ID &aCadstarLayerOverride=wxEmptyString, const wxPoint &aMoveVector={ 0, 0 }, const double &aRotationAngle=0.0, const double &aScalingFactor=1.0, const wxPoint &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
std::map< GROUP_ID, PCB_GROUP * > m_groupMap
Map between Cadstar and KiCad groups.
void drawCadstarVerticesAsSegments(const std::vector< VERTEX > &aCadstarVertices, const PCB_LAYER_ID &aKiCadLayer, const int &aLineThickness, BOARD_ITEM_CONTAINER *aContainer, const GROUP_ID &aCadstarGroupID=wxEmptyString, const wxPoint &aMoveVector={ 0, 0 }, const double &aRotationAngle=0.0, const double &aScalingFactor=1.0, const wxPoint &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
Uses PCB_SHAPE to draw the vertices on m_board object.
std::function< std::map< wxString, PCB_LAYER_ID >(const std::vector< INPUT_LAYER_DESC > &)> LAYER_MAPPING_HANDLER
Pointer to a function that takes a map of source and KiCad layers and returns a re-mapped version.
void loadLibraryAreas(const SYMDEF_PCB &aComponent, FOOTPRINT *aFootprint)
PCB_LAYER_ID
A quick note on layer IDs:
PAD * getKiCadPad(const COMPONENT_PAD &aCadstarPad, FOOTPRINT *aParent)
bool m_doneNetClassWarning
Used by getKiCadNet() to avoid multiple duplicate warnings.
LSET is a set of PCB_LAYER_IDs.
PART getPart(const PART_ID &aCadstarPartID)
Normal via.
Definition: router_tool.cpp:70
void initStackupItem(const LAYER &aCadstarLayer, BOARD_STACKUP_ITEM *aKiCadItem, int aDielectricSublayer)
void loadLibraryCoppers(const SYMDEF_PCB &aComponent, FOOTPRINT *aFootprint)
Represent a set of closed polygons.
bool isFootprint(BOARD_ITEM_CONTAINER *aContainer)
int loadNetVia(const NET_ID &aCadstarNetID, const NET_PCB::VIA &aCadstarVia)
Load via and return via size.
std::set< PADCODE_ID > m_padcodesTested
Used by getKiCadPad() to avoid multiple duplicate warnings.
PCB_LAYER_ID getKiCadCopperLayerID(unsigned int aLayerNum, bool aDetectMaxLayer=true)
SHAPE_LINE_CHAIN getLineChainFromDrawsegments(const std::vector< PCB_SHAPE * > aDrawSegments)
Returns a SHAPE_LINE_CHAIN object from a series of PCB_SHAPE objects.
void applyRouteOffset(wxPoint *aPointToOffset, const wxPoint &aRefPoint, const long &aOffsetAmount)
CADSTAR's Post Processor does an action called "Route Offset" which is applied when a route is wider ...
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
An abstract shape on 2D plane.
Definition: shape.h:116
void loadNetTracks(const NET_ID &aCadstarNetID, const NET_PCB::ROUTE &aCadstarRoute, long aStartWidth=std::numeric_limits< long >::max(), long aEndWidth=std::numeric_limits< long >::max())
int getKiCadHatchCodeThickness(const HATCHCODE_ID &aCadstarHatchcodeID)
void Load(BOARD *aBoard, PROJECT *aProject)
Loads a CADSTAR PCB Archive file into the KiCad BOARD object given.
std::map< TEMPLATE_ID, ZONE * > m_zonesMap
Map between Cadstar and KiCad zones.
wxString getAttributeName(const ATTRIBUTE_ID &aCadstarAttributeID)
Manage one layer needed to make a physical board.
Definition: board_stackup.h:89
std::map< PAD_ID, std::vector< PAD_ID > > ASSOCIATED_COPPER_PADS
Map of pad anchor points (first) to copper pads (second).
Represents a CADSTAR PCB Archive (CPA) file.
class FOOTPRINT, a footprint
Definition: typeinfo.h:88
PADCODE getPadCode(const PADCODE_ID &aCadstarPadCodeID)
TEXTCODE getTextCode(const TEXTCODE_ID &aCadstarTextCodeID)
int getLineThickness(const LINECODE_ID &aCadstarLineCodeID)
Handle the data for a net.
Definition: netinfo.h:64
PCB_SHAPE * getDrawSegmentFromVertex(const POINT &aCadstarStartPoint, const VERTEX &aCadstarVertex, BOARD_ITEM_CONTAINER *aContainer=nullptr, const GROUP_ID &aCadstarGroupID=wxEmptyString, const wxPoint &aMoveVector={ 0, 0 }, const double &aRotationAngle=0.0, const double &aScalingFactor=1.0, const wxPoint &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
Returns a pointer to a PCB_SHAPE object.
std::map< NET_ID, NETINFO_ITEM * > m_netMap
Map between Cadstar and KiCad Nets.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
bool m_logLayerWarnings
Used in loadBoardStackup()
GROUP_ID createUniqueGroupID(const wxString &aName)
Adds a new PCB_GROUP* to m_groupMap.
SHAPE_LINE_CHAIN.
bool m_doneCopperWarning
Used by loadCoppers() to avoid multiple duplicate warnings.
PCB_LAYER_ID getKiCadLayer(const LAYER_ID &aCadstarLayerID)
PAD *& getPadReference(FOOTPRINT *aFootprint, const PAD_ID aCadstarPadID)
void addToGroup(const GROUP_ID &aCadstarGroupID, BOARD_ITEM *aKiCadItem)
void drawCadstarCutoutsAsSegments(const std::vector< CUTOUT > &aCutouts, const PCB_LAYER_ID &aKiCadLayer, const int &aLineThickness, BOARD_ITEM_CONTAINER *aContainer, const GROUP_ID &aCadstarGroupID=wxEmptyString, const wxPoint &aMoveVector={ 0, 0 }, const double &aRotationAngle=0.0, const double &aScalingFactor=1.0, const wxPoint &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
Uses PCB_SHAPE to draw the cutouts on m_board object.
void loadLibraryFigures(const SYMDEF_PCB &aComponent, FOOTPRINT *aFootprint)
void calculateZonePriorities()
Tries to make a best guess as to the zone priorities based on the pour status.
long Version
Archive version number (e.g.
wxString LAYER_ID
ID of a Sheet (if schematic) or board Layer (if PCB)
bool isLayerSet(const LAYER_ID &aCadstarLayerID)
Abstract interface for BOARD_ITEMs capable of storing other items inside.
std::vector< PCB_SHAPE * > getDrawSegmentsFromVertices(const std::vector< VERTEX > &aCadstarVertices, BOARD_ITEM_CONTAINER *aContainer=nullptr, const GROUP_ID &aCadstarGroupID=wxEmptyString, const wxPoint &aMoveVector={ 0, 0 }, const double &aRotationAngle=0.0, const double &aScalingFactor=1.0, const wxPoint &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
Returns a vector of pointers to PCB_SHAPE objects.
std::map< LAYER_ID, PCB_LAYER_ID > m_layermap
Map between Cadstar and KiCad Layers.
Definition: pad.h:57
double getHatchCodeAngleDegrees(const HATCHCODE_ID &aCadstarHatchcodeID)
std::map< SYMDEF_ID, ASSOCIATED_COPPER_PADS > m_librarycopperpads
Associated copper pads (if any) for each component library definition.
HATCHCODE getHatchCode(const HATCHCODE_ID &aCadstarHatchcodeID)
FOOTPRINT * getFootprintFromCadstarID(const COMPONENT_ID &aCadstarComponentID)
VIACODE getViaCode(const VIACODE_ID &aCadstarViaCodeID)
std::map< ROUTECODE_ID, NETCLASSPTR > m_netClassMap
Map between Cadstar and KiCad classes.
std::vector< LAYER_ID > m_powerPlaneLayers
List of layers that are marked as power plane in CADSTAR.
LSET getKiCadLayerSet(const LAYER_ID &aCadstarLayerID)
SHAPE_POLY_SET getPolySetFromCadstarShape(const SHAPE &aCadstarShape, const int &aLineThickness=-1, BOARD_ITEM_CONTAINER *aContainer=nullptr, const wxPoint &aMoveVector={ 0, 0 }, const double &aRotationAngle=0.0, const double &aScalingFactor=1.0, const wxPoint &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
Returns a SHAPE_POLY_SET object from a Cadstar SHAPE.
void logBoardStackupMessage(const wxString &aCadstarLayerName, const PCB_LAYER_ID &aKiCadLayer)
int m_numNets
Number of nets loaded so far.
wxPoint getKiCadPoint(wxPoint aCadstarPoint)
Scales, offsets and inverts y axis to make the point usable directly in KiCad.
int KiCadUnitMultiplier
Use this value to convert units in this CPA file to KiCad units.
Linear, leader (radius/diameter) or angular dimension.
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113