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 <set>
33 
34 class BOARD;
35 class DIMENSION_BASE;
36 
38 {
39 public:
41  wxString aFilename, LAYER_MAPPING_HANDLER aLayerMappingHandler, bool aLogLayerWarnings )
42  : CADSTAR_PCB_ARCHIVE_PARSER( aFilename )
43  {
44  m_layerMappingHandler = aLayerMappingHandler;
45  m_logLayerWarnings = aLogLayerWarnings;
46  m_board = nullptr;
47  m_project = nullptr;
48  m_designCenter.x = 0;
49  m_designCenter.y = 0;
50  m_doneCopperWarning = false;
52  m_doneNetClassWarning = false;
53  m_numNets = 0;
54  }
55 
56 
58  {
59  for( std::pair<SYMDEF_ID, FOOTPRINT*> libItem : m_libraryMap )
60  {
61  FOOTPRINT* footprint = libItem.second;
62 
63  if( footprint )
64  delete footprint;
65  }
66  }
67 
72  void Load( BOARD* aBoard, PROJECT* aProject );
73 
78  std::vector<FOOTPRINT*> GetLoadedLibraryFootpints() const;
79 
80 private:
85  std::map<LAYER_ID, PCB_LAYER_ID> m_layermap;
86  std::map<SYMDEF_ID, FOOTPRINT*> m_libraryMap;
88  std::map<GROUP_ID, PCB_GROUP*> m_groupMap;
92  std::map<COMPONENT_ID, FOOTPRINT*> m_componentMap;
96  std::map<NET_ID, NETINFO_ITEM*> m_netMap;
100  std::map<ROUTECODE_ID, NETCLASSPTR> m_netClassMap;
101  std::map<TEMPLATE_ID, ZONE*> m_zonesMap;
102  std::vector<LAYER_ID> m_powerPlaneLayers;
103  wxPoint m_designCenter;
106  std::set<HATCHCODE_ID> m_hatchcodesTested;
109  std::set<PADCODE_ID> m_padcodesTested;
111  bool m_doneCopperWarning;
115  bool m_doneNetClassWarning;
117  int m_numNets;
119 
120 
121  // Functions for loading individual elements:
122  void loadBoardStackup();
123  void remapUnsureLayers();
124  void loadDesignRules();
125  void loadComponentLibrary();
126  void loadGroups();
127  void loadBoards();
128  void loadFigures();
129  void loadTexts();
130  void loadDimensions();
131  void loadAreas();
132  void loadComponents();
134  void loadTemplates();
135  void loadCoppers();
136  void loadNets();
137  void loadTextVariables();
138 
139  // Helper functions for element loading:
140  void logBoardStackupWarning( const wxString& aCadstarLayerName,
141  const PCB_LAYER_ID& aKiCadLayer );
142  void logBoardStackupMessage( const wxString& aCadstarLayerName,
143  const PCB_LAYER_ID& aKiCadLayer );
144  void initStackupItem( const LAYER& aCadstarLayer, BOARD_STACKUP_ITEM* aKiCadItem,
145  int aDielectricSublayer );
146  void loadLibraryFigures( const SYMDEF_PCB& aComponent, FOOTPRINT* aFootprint );
147  void loadLibraryCoppers( const SYMDEF_PCB& aComponent, FOOTPRINT* aFootprint );
148  void loadLibraryAreas( const SYMDEF_PCB& aComponent, FOOTPRINT* aFootprint );
149  void loadLibraryPads( const SYMDEF_PCB& aComponent, FOOTPRINT* aFootprint );
150  void loadComponentAttributes( const COMPONENT& aComponent, FOOTPRINT* aFootprint );
151  void loadNetTracks( const NET_ID& aCadstarNetID, const NET_PCB::ROUTE& aCadstarRoute );
152  void loadNetVia( const NET_ID& aCadstarNetID, const NET_PCB::VIA& aCadstarVia );
153  void checkAndLogHatchCode( const HATCHCODE_ID& aCadstarHatchcodeID );
154  void applyDimensionSettings( const DIMENSION& aCadstarDim, DIMENSION_BASE* aKiCadDim );
155 
156 
161 
162  //Helper functions for drawing /loading objects onto screen:
163 
176  void drawCadstarText( const TEXT& aCadstarText, BOARD_ITEM_CONTAINER* aContainer,
177  const GROUP_ID& aCadstarGroupID = wxEmptyString,
178  const LAYER_ID& aCadstarLayerOverride = wxEmptyString,
179  const wxPoint& aMoveVector = { 0, 0 },
180  const double& aRotationAngle = 0.0,
181  const double& aScalingFactor = 1.0,
182  const wxPoint& aTransformCentre = { 0, 0 },
183  const bool& aMirrorInvert = false );
184 
199  void drawCadstarShape( const SHAPE& aCadstarShape, const PCB_LAYER_ID& aKiCadLayer,
200  const int& aLineThickness, const wxString& aShapeName,
201  BOARD_ITEM_CONTAINER* aContainer,
202  const GROUP_ID& aCadstarGroupID = wxEmptyString,
203  const wxPoint& aMoveVector = { 0, 0 },
204  const double& aRotationAngle = 0.0, const double& aScalingFactor = 1.0,
205  const wxPoint& aTransformCentre = { 0, 0 },
206  const bool& aMirrorInvert = false );
207 
221  void drawCadstarCutoutsAsSegments( const std::vector<CUTOUT>& aCutouts,
222  const PCB_LAYER_ID& aKiCadLayer, const int& aLineThickness,
223  BOARD_ITEM_CONTAINER* aContainer,
224  const GROUP_ID& aCadstarGroupID = wxEmptyString,
225  const wxPoint& aMoveVector = { 0, 0 },
226  const double& aRotationAngle = 0.0,
227  const double& aScalingFactor = 1.0,
228  const wxPoint& aTransformCentre = { 0, 0 },
229  const bool& aMirrorInvert = false );
230 
245  void drawCadstarVerticesAsSegments( const std::vector<VERTEX>& aCadstarVertices,
246  const PCB_LAYER_ID& aKiCadLayer, const int& aLineThickness,
247  BOARD_ITEM_CONTAINER* aContainer,
248  const GROUP_ID& aCadstarGroupID = wxEmptyString,
249  const wxPoint& aMoveVector = { 0, 0 },
250  const double& aRotationAngle = 0.0,
251  const double& aScalingFactor = 1.0,
252  const wxPoint& aTransformCentre = { 0, 0 },
253  const bool& aMirrorInvert = false );
254 
267  std::vector<PCB_SHAPE*> getDrawSegmentsFromVertices( const std::vector<VERTEX>& aCadstarVertices,
268  BOARD_ITEM_CONTAINER* aContainer = nullptr,
269  const GROUP_ID& aCadstarGroupID = wxEmptyString,
270  const wxPoint& aMoveVector = { 0, 0 },
271  const double& aRotationAngle = 0.0,
272  const double& aScalingFactor = 1.0,
273  const wxPoint& aTransformCentre = { 0, 0 },
274  const bool& aMirrorInvert = false );
275 
289  PCB_SHAPE* getDrawSegmentFromVertex( const POINT& aCadstarStartPoint,
290  const VERTEX& aCadstarVertex,
291  BOARD_ITEM_CONTAINER* aContainer = nullptr,
292  const GROUP_ID& aCadstarGroupID = wxEmptyString,
293  const wxPoint& aMoveVector = { 0, 0 },
294  const double& aRotationAngle = 0.0,
295  const double& aScalingFactor = 1.0,
296  const wxPoint& aTransformCentre = { 0, 0 },
297  const bool& aMirrorInvert = false );
298 
306  ZONE* getZoneFromCadstarShape( const SHAPE& aCadstarShape, const int& aLineThickness,
307  BOARD_ITEM_CONTAINER* aParentContainer );
308 
321  SHAPE_POLY_SET getPolySetFromCadstarShape( const SHAPE& aCadstarShape,
322  const int& aLineThickness = -1,
323  BOARD_ITEM_CONTAINER* aContainer = nullptr,
324  const wxPoint& aMoveVector = { 0, 0 },
325  const double& aRotationAngle = 0.0,
326  const double& aScalingFactor = 1.0,
327  const wxPoint& aTransformCentre = { 0, 0 },
328  const bool& aMirrorInvert = false );
329 
335  SHAPE_LINE_CHAIN getLineChainFromDrawsegments( const std::vector<PCB_SHAPE*> aDrawSegments );
336 
348  std::vector<TRACK*> makeTracksFromDrawsegments( const std::vector<PCB_SHAPE*> aDrawsegments,
349  BOARD_ITEM_CONTAINER* aParentContainer,
350  NETINFO_ITEM* aNet = nullptr,
351  PCB_LAYER_ID aLayerOverride = UNDEFINED_LAYER,
352  int aWidthOverride = -1 );
353 
361  void addAttribute( const ATTRIBUTE_LOCATION& aCadstarAttrLoc,
362  const ATTRIBUTE_ID& aCadstarAttributeID, FOOTPRINT* aFootprint,
363  const wxString& aAttributeValue );
364 
365  //Helper Functions for obtaining CADSTAR elements in the parsed structures
366  int getLineThickness( const LINECODE_ID& aCadstarLineCodeID );
367  COPPERCODE getCopperCode( const COPPERCODE_ID& aCadstaCopperCodeID );
368  HATCHCODE getHatchCode( const HATCHCODE_ID& aCadstarHatchcodeID );
369  LAYERPAIR getLayerPair( const LAYERPAIR_ID& aCadstarLayerPairID );
370  PADCODE getPadCode( const PADCODE_ID& aCadstarPadCodeID );
371  PART getPart( const PART_ID& aCadstarPartID );
372  ROUTECODE getRouteCode( const ROUTECODE_ID& aCadstarRouteCodeID );
373  TEXTCODE getTextCode( const TEXTCODE_ID& aCadstarTextCodeID );
374  VIACODE getViaCode( const VIACODE_ID& aCadstarViaCodeID );
375  wxString getAttributeName( const ATTRIBUTE_ID& aCadstarAttributeID );
376  wxString getAttributeValue( const ATTRIBUTE_ID& aCadstarAttributeID,
377  const std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE>& aCadstarAttributeMap );
378 
379  // Helper Functions for obtaining individual elements as KiCad elements:
380  double getHatchCodeAngleDegrees( const HATCHCODE_ID& aCadstarHatchcodeID );
381  PAD* getKiCadPad( const COMPONENT_PAD& aCadstarPad, FOOTPRINT* aParent );
382  FOOTPRINT* getFootprintFromCadstarID( const COMPONENT_ID& aCadstarComponentID );
383  int getKiCadHatchCodeThickness( const HATCHCODE_ID& aCadstarHatchcodeID );
384  int getKiCadHatchCodeGap( const HATCHCODE_ID& aCadstarHatchcodeID );
385  PCB_GROUP* getKiCadGroup( const GROUP_ID& aCadstarGroupID );
386 
392  wxPoint getKiCadPoint( wxPoint aCadstarPoint );
393 
399  int getKiCadLength( long long aCadstarLength )
400  {
401  return aCadstarLength * KiCadUnitMultiplier;
402  }
403 
409  double getAngleTenthDegree( const long long& aCadstarAngle )
410  {
411  // CADSTAR v6 (which outputted Format Version 8) and earlier versions used 1/10 degree
412  // as the unit for angles/orientations. It is assumed that CADSTAR version 7 (i.e. Format
413  // Version 9 and later) is the version that introduced 1/1000 degree for angles.
414  if( Header.Format.Version > 8 )
415  {
416  return (double) aCadstarAngle / 100.0;
417  }
418  else
419  {
420  return (double) aCadstarAngle;
421  }
422  }
423 
429  double getAngleDegrees( const long long& aCadstarAngle )
430  {
431  return getAngleTenthDegree( aCadstarAngle ) / 10.0;
432  }
433 
439  double getPolarAngle( wxPoint aPoint );
440 
447  NETINFO_ITEM* getKiCadNet( const NET_ID& aCadstarNetID );
448 
455  PCB_LAYER_ID getKiCadCopperLayerID( unsigned int aLayerNum, bool aDetectMaxLayer = true );
456 
462  bool isLayerSet( const LAYER_ID& aCadstarLayerID );
463 
469  PCB_LAYER_ID getKiCadLayer( const LAYER_ID& aCadstarLayerID );
470 
476  LSET getKiCadLayerSet( const LAYER_ID& aCadstarLayerID );
477 
478 
479  bool isFootprint( BOARD_ITEM_CONTAINER* aContainer )
480  {
481  return aContainer && aContainer->Type() == PCB_FOOTPRINT_T;
482  }
483 
484 
485  void addToGroup( const GROUP_ID& aCadstarGroupID, BOARD_ITEM* aKiCadItem );
486 
493  GROUP_ID createUniqueGroupID( const wxString& aName );
494 };
495 
496 
497 #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)
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:82
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
void loadNetTracks(const NET_ID &aCadstarNetID, const NET_PCB::ROUTE &aCadstarRoute)
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)
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)
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 loadNetVia(const NET_ID &aCadstarNetID, const NET_PCB::VIA &aCadstarVia)
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 applyDimensionSettings(const DIMENSION &aCadstarDim, DIMENSION_BASE *aKiCadDim)
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:67
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)
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.
ZONE handles a list of polygons defining a copper zone.
Definition: zone.h:57
An abstract shape on 2D plane.
Definition: shape.h:116
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)
this class manage one layer needed to make a physical board it can be a solder mask,...
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)
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:60
double getHatchCodeAngleDegrees(const HATCHCODE_ID &aCadstarHatchcodeID)
HATCHCODE getHatchCode(const HATCHCODE_ID &aCadstarHatchcodeID)
FOOTPRINT * getFootprintFromCadstarID(const COMPONENT_ID &aCadstarComponentID)
VIACODE getViaCode(const VIACODE_ID &aCadstarViaCodeID)
Abstract dimension API.
Definition: dimension.h:95
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:162
std::vector< 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.