KiCad PCB EDA Suite
|
#include <export_gencad_writer.h>
Public Member Functions | |
GENCAD_EXPORTER (BOARD *aBoard) | |
bool | WriteFile (const wxString &aFullFileName) |
Export a genCAD file. | |
void | SetPlotOffet (VECTOR2I aOffset) |
Set the coordinates offet when exporting items. | |
void | FlipBottomPads (bool aFlip) |
Flip pad shapes on the bottom side. | |
void | UsePinNamesUnique (bool aUnique) |
Make pin names unique. | |
void | UseIndividualShapes (bool aUnique) |
Make pad shapes unique. | |
void | StoreOriginCoordsInFile (bool aStore) |
Store coord origin in genCAD file. | |
Private Member Functions | |
bool | CreateHeaderInfoData () |
Creates the header section. | |
void | CreateArtworksSection () |
void | CreateTracksInfoData () |
void | CreateBoardSection () |
void | CreateComponentsSection () |
void | CreateDevicesSection () |
void | CreateRoutesSection () |
void | CreateSignalsSection () |
void | CreateShapesSection () |
void | CreatePadsShapesSection () |
void | FootprintWriteShape (FOOTPRINT *aFootprint, const wxString &aShapeName) |
const wxString | getShapeName (FOOTPRINT *aFootprint) |
double | MapXTo (int aX) |
double | MapYTo (int aY) |
Private Attributes | |
BOARD * | m_board |
wxString | m_fullFileName |
FILE * | m_file |
bool | m_flipBottomPads |
bool | m_useUniquePins |
bool | m_useIndividualShapes |
bool | m_storeOriginCoords |
VECTOR2I | GencadOffset |
Definition at line 24 of file export_gencad_writer.h.
|
inline |
Definition at line 27 of file export_gencad_writer.h.
|
private |
Definition at line 249 of file export_gencad_writer.cpp.
References m_file.
Referenced by WriteFile().
|
private |
Definition at line 1043 of file export_gencad_writer.cpp.
References SEG::A, SEG::B, BOARD::GetBoardPolygonOutlines(), SHAPE_POLY_SET::IterateSegmentsWithHoles(), m_board, m_file, MapXTo(), MapYTo(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by WriteFile().
|
private |
Definition at line 750 of file export_gencad_writer.cpp.
References EDA_ANGLE::AsDegrees(), B_SilkS, escapeString(), F_SilkS, BOARD::Footprints(), GenCADLayerName(), BOARD::GetCopperLayerCount(), BOX2< Vec >::GetHeight(), getShapeName(), BOX2< Vec >::GetWidth(), EDA_ANGLE::Invert(), m_board, m_file, MapXTo(), MapYTo(), EDA_ANGLE::Normalize(), SCALE_FACTOR, and TO_UTF8.
Referenced by WriteFile().
|
private |
Definition at line 998 of file export_gencad_writer.cpp.
References componentShapes, escapeString(), LIB_ID::Format(), FOOTPRINT::GetFPID(), FOOTPRINT::GetValue(), m_file, shapeNames, and TO_UTF8.
Referenced by WriteFile().
|
private |
Creates the header section.
Definition at line 873 of file export_gencad_writer.cpp.
References ExpandTextVars(), GetBuildVersion(), TITLE_BLOCK::GetDate(), BOARD::GetFileName(), BOARD::GetProject(), TITLE_BLOCK::GetRevision(), BOARD::GetTitleBlock(), m_board, m_file, m_storeOriginCoords, MapXTo(), MapYTo(), and TO_UTF8.
Referenced by WriteFile().
|
private |
Definition at line 257 of file export_gencad_writer.cpp.
References PADSTACK::ALL_LAYERS, PAD::Compare(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), LSET::CuStack(), ERROR_INSIDE, F_Cu, fmt_mask(), GenCADLayerName(), GenCADLayerNameFlipped(), BOARD::GetCopperLayerCount(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetEnabledLayers(), BOARD::GetEnabledLayers(), BOARD::GetPads(), KI_FALLTHROUGH, m_board, m_file, m_flipBottomPads, BOARD_DESIGN_SETTINGS::m_MaxError, next(), SHAPE_POLY_SET::OutlineCount(), pad, SHAPE_LINE_CHAIN::PointCount(), SCALE_FACTOR, LSET::Seq(), BOARD::Tracks(), TransformRoundChamferedRectToPolygon(), UNIMPLEMENTED_FOR, via, ViaSort(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by WriteFile().
|
private |
Definition at line 907 of file export_gencad_writer.cpp.
References BOARD::GetCopperLayerCount(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetEnabledLayers(), BOARD_CONNECTED_ITEM::GetNetCode(), m_board, and BOARD::Tracks().
Referenced by WriteFile().
|
private |
Definition at line 632 of file export_gencad_writer.cpp.
References EDA_ANGLE::AsDegrees(), componentShapes, escapeString(), BOARD::Footprints(), FootprintWriteShape(), hashFootprint(), m_board, m_file, m_flipBottomPads, m_useIndividualShapes, m_useUniquePins, EDA_ANGLE::Normalize(), pad, SCALE_FACTOR, shapeNames, TO_UTF8, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by WriteFile().
|
private |
Definition at line 821 of file export_gencad_writer.cpp.
References escapeString(), BOARD::FindNet(), BOARD::Footprints(), NETINFO_ITEM::GetNetCode(), BOARD::GetNetCount(), NETINFO_ITEM::GetNetname(), m_board, m_file, pad, and TO_UTF8.
Referenced by WriteFile().
|
private |
Definition at line 1076 of file export_gencad_writer.cpp.
References m_board, m_file, SCALE_FACTOR, and BOARD::Tracks().
Referenced by WriteFile().
|
inline |
Flip pad shapes on the bottom side.
Definition at line 48 of file export_gencad_writer.h.
References m_flipBottomPads.
Referenced by PCB_EDIT_FRAME::ExportToGenCAD(), and PCBNEW_JOBS_HANDLER::JobExportGencad().
|
private |
Definition at line 1099 of file export_gencad_writer.cpp.
References ANGLE_0, B_SilkS, VECTOR2< T >::Distance(), escapeString(), F_SilkS, FP_THROUGH_HOLE, EDA_SHAPE::GetArcAngle(), FOOTPRINT::GetAttributes(), PCB_SHAPE::GetCenter(), EDA_SHAPE::GetEnd(), FOOTPRINT::GetOrientation(), FOOTPRINT::GetPosition(), EDA_SHAPE::GetShape(), EDA_SHAPE::GetStart(), FOOTPRINT::GraphicalItems(), KiROUND(), m_file, PCB_SHAPE_T, RotatePoint(), SCALE_FACTOR, TO_UTF8, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by CreateShapesSection().
|
private |
Definition at line 121 of file export_gencad_writer.cpp.
References componentShapes, FOOTPRINT::GetReference(), m_useIndividualShapes, and shapeNames.
Referenced by CreateComponentsSection().
|
private |
Definition at line 145 of file export_gencad_writer.cpp.
References GencadOffset, SCALE_FACTOR, and VECTOR2< T >::x.
Referenced by CreateBoardSection(), CreateComponentsSection(), and CreateHeaderInfoData().
|
private |
Definition at line 151 of file export_gencad_writer.cpp.
References GencadOffset, SCALE_FACTOR, and VECTOR2< T >::y.
Referenced by CreateBoardSection(), CreateComponentsSection(), and CreateHeaderInfoData().
|
inline |
Set the coordinates offet when exporting items.
Definition at line 45 of file export_gencad_writer.h.
References GencadOffset.
Referenced by PCB_EDIT_FRAME::ExportToGenCAD(), and PCBNEW_JOBS_HANDLER::JobExportGencad().
|
inline |
Store coord origin in genCAD file.
Definition at line 57 of file export_gencad_writer.h.
References m_storeOriginCoords.
Referenced by PCB_EDIT_FRAME::ExportToGenCAD(), and PCBNEW_JOBS_HANDLER::JobExportGencad().
|
inline |
Make pad shapes unique.
Definition at line 54 of file export_gencad_writer.h.
References m_useIndividualShapes.
Referenced by PCB_EDIT_FRAME::ExportToGenCAD(), and PCBNEW_JOBS_HANDLER::JobExportGencad().
|
inline |
Make pin names unique.
Definition at line 51 of file export_gencad_writer.h.
References m_useUniquePins.
Referenced by PCB_EDIT_FRAME::ExportToGenCAD(), and PCBNEW_JOBS_HANDLER::JobExportGencad().
bool GENCAD_EXPORTER::WriteFile | ( | const wxString & | aFullFileName | ) |
Export a genCAD file.
aFullFileName | is the full filenam to create |
Definition at line 157 of file export_gencad_writer.cpp.
References B_Cu, componentShapes, BOARD::ComputeBoundingBox(), CreateArtworksSection(), CreateBoardSection(), CreateComponentsSection(), CreateDevicesSection(), CreateHeaderInfoData(), CreatePadsShapesSection(), CreateRoutesSection(), CreateShapesSection(), CreateSignalsSection(), CreateTracksInfoData(), BOARD::Footprints(), m_board, m_file, and shapeNames.
Referenced by PCB_EDIT_FRAME::ExportToGenCAD(), and PCBNEW_JOBS_HANDLER::JobExportGencad().
|
private |
Definition at line 90 of file export_gencad_writer.h.
Referenced by MapXTo(), MapYTo(), and SetPlotOffet().
|
private |
Definition at line 79 of file export_gencad_writer.h.
Referenced by CreateBoardSection(), CreateComponentsSection(), CreateHeaderInfoData(), CreatePadsShapesSection(), CreateRoutesSection(), CreateShapesSection(), CreateSignalsSection(), CreateTracksInfoData(), and WriteFile().
|
private |
Definition at line 81 of file export_gencad_writer.h.
Referenced by CreateArtworksSection(), CreateBoardSection(), CreateComponentsSection(), CreateDevicesSection(), CreateHeaderInfoData(), CreatePadsShapesSection(), CreateShapesSection(), CreateSignalsSection(), CreateTracksInfoData(), FootprintWriteShape(), and WriteFile().
|
private |
Definition at line 84 of file export_gencad_writer.h.
Referenced by CreatePadsShapesSection(), CreateShapesSection(), and FlipBottomPads().
|
private |
Definition at line 80 of file export_gencad_writer.h.
|
private |
Definition at line 87 of file export_gencad_writer.h.
Referenced by CreateHeaderInfoData(), and StoreOriginCoordsInFile().
|
private |
Definition at line 86 of file export_gencad_writer.h.
Referenced by CreateShapesSection(), getShapeName(), and UseIndividualShapes().
|
private |
Definition at line 85 of file export_gencad_writer.h.
Referenced by CreateShapesSection(), and UsePinNamesUnique().