35 const std::vector<INPUT_LAYER_DESC>& aInputLayerDescriptionVector )
37 std::map<wxString, PCB_LAYER_ID> retval;
42 retval.insert( { layerDesc.Name, layerDesc.AutoMapLayer } );
85 return wxT(
"CADSTAR PCB Archive" );
97 std::vector<FOOTPRINT*> retval;
101 retval.push_back( static_cast<FOOTPRINT*>( fp->Clone() ) );
125 if( aProperties->
Value(
"page_width", &page_width )
126 && aProperties->
Value(
"page_height", &page_height ) )
130 int w = atoi( page_width.
c_str() );
131 int h = atoi( page_height.
c_str() );
133 int desired_x = ( w - bbbox.
GetWidth() ) / 2;
134 int desired_y = ( h - bbbox.
GetHeight() ) / 2;
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
Pcbnew PLUGIN for CADSTAR PCB Archive (*.cpa) format: an ASCII format based on S-expressions.
Container for project specific data.
const EDA_RECT GetBoardEdgesBoundingBox() const
Returns the board bounding box calculated using exclusively the board edges (graphics on Edge....
std::vector< FOOTPRINT * > m_loaded_footprints
A name/value tuple with unique names and optional values.
virtual void RegisterLayerMappingCallback(LAYER_MAPPING_HANDLER aLayerMappingHandler)
Register a different handler to be called when mapping of input layers to KiCad layers occurs.
const char * c_str() const
void RegisterLayerMappingCallback(LAYER_MAPPING_HANDLER aLayerMappingHandler) override
Register a different handler to be called when mapping of Cadstar to KiCad layers occurs.
std::vector< FOOTPRINT * > GetLoadedLibraryFootpints() const
Return a copy of the loaded library footprints (caller owns the objects)
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.
Loads a cpa file into a KiCad BOARD object.
static std::map< wxString, PCB_LAYER_ID > DefaultLayerMappingCallback(const std::vector< INPUT_LAYER_DESC > &aInputLayerDescriptionVector)
Return the automapped layers.
LAYER_MAPPING_HANDLER m_layer_mapping_handler
Callback to get layer mapping.
const wxString GetFileExtension() const override
Returns the file extension for the PLUGIN.
void Load(BOARD *aBoard, PROJECT *aProject)
Loads a CADSTAR PCB Archive file into the KiCad BOARD object given.
bool Value(const char *aName, UTF8 *aFetchedValue=nullptr) const
Fetch a property by aName and returns true if that property was found, else false.
void clearLoadedFootprints()
void Move(const wxPoint &aMoveVector) override
Move this object.
BOARD * Load(const wxString &aFileName, BOARD *aAppendToMe, const PROPERTIES *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PLUGIN implementation knows about into either ...
std::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints() override
Return a container with the cached library footprints generated in the last call to Load.
Information pertinent to a Pcbnew printed circuit board.
const PROPERTIES * m_props
Handle the component boundary box.
CADSTAR_PCB_ARCHIVE_PLUGIN()
~CADSTAR_PCB_ARCHIVE_PLUGIN()
bool m_show_layer_mapping_warnings
const wxString PluginName() const override
Return a brief hard coded name for this PLUGIN.