KiCad PCB EDA Suite
specctra.h File Reference
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_set.hpp>
#include <specctra_import_export/specctra_lexer.h>
#include <memory>
#include <geometry/shape_poly_set.h>

Go to the source code of this file.

Classes

struct  DSN::POINT
 A point in the SPECCTRA DSN coordinate system. More...
 
struct  DSN::PROPERTY
 
class  DSN::ELEM
 A base class for any DSN element class. More...
 
class  DSN::ELEM_HOLDER
 A holder for any DSN class. More...
 
class  DSN::PARSER
 A configuration record per the SPECCTRA DSN file spec. More...
 
class  DSN::UNIT_RES
 A holder for either a T_unit or T_resolution object which are usually mutually exclusive in the dsn grammar, except within the T_pcb level. More...
 
class  DSN::RECTANGLE
 
class  DSN::RULE
 A <rule_descriptor> in the specctra dsn spec. More...
 
class  DSN::LAYER_RULE
 
class  DSN::PATH
 Support both the <path_descriptor> and the <polygon_descriptor> per the specctra dsn spec. More...
 
class  DSN::BOUNDARY
 
class  DSN::CIRCLE
 
class  DSN::QARC
 
class  DSN::WINDOW
 
class  DSN::KEEPOUT
 Used for <keepout_descriptor> and <plane_descriptor>. More...
 
class  DSN::VIA
 A <via_descriptor> in the specctra dsn spec. More...
 
class  DSN::CLASSES
 
class  DSN::CLASS_CLASS
 
class  DSN::CONTROL
 
class  DSN::LAYER
 
class  DSN::SPECCTRA_LAYER_PAIR
 
class  DSN::LAYER_NOISE_WEIGHT
 
class  DSN::COPPER_PLANE
 A <plane_descriptor> in the specctra dsn spec. More...
 
class  DSN::TOKPROP
 A container for a single property whose value is another DSN_T token. More...
 
class  DSN::STRINGPROP
 A container for a single property whose value is a string. More...
 
class  DSN::REGION
 
class  DSN::GRID
 
class  DSN::STRUCTURE_OUT
 
class  DSN::STRUCTURE
 
class  DSN::PLACE
 Implement a <placement_reference> in the specctra dsn spec. More...
 
class  DSN::COMPONENT
 Implement a <component_descriptor> in the specctra dsn spec. More...
 
class  DSN::PLACEMENT
 
class  DSN::SHAPE
 A "(shape ..)" element in the specctra dsn spec. More...
 
class  DSN::PIN
 
class  DSN::IMAGE
 
class  DSN::PADSTACK
 Hold either a via or a pad definition. More...
 
class  DSN::LIBRARY
 A <library_descriptor> in the specctra dsn specification. More...
 
struct  DSN::PIN_REF
 A <pin_reference> definition in the specctra dsn spec. More...
 
class  DSN::FROMTO
 
class  DSN::COMP_ORDER
 The <component_order_descriptor>. More...
 
class  DSN::NET
 A <net_descriptor> in the DSN spec. More...
 
class  DSN::TOPOLOGY
 
class  DSN::CLASS
 The <class_descriptor> in the specctra spec. More...
 
class  DSN::NETWORK
 
class  DSN::CONNECT
 
class  DSN::WIRE
 A <wire_shape_descriptor> in the specctra dsn spec. More...
 
class  DSN::WIRE_VIA
 A <wire_via_descriptor> in the specctra dsn spec. More...
 
class  DSN::WIRING
 A <wiring_descriptor> in the specctra dsn spec. More...
 
class  DSN::PCB
 
class  DSN::ANCESTOR
 
class  DSN::HISTORY
 
class  DSN::SUPPLY_PIN
 A <supply_pin_descriptor> in the specctra dsn spec. More...
 
class  DSN::NET_OUT
 A <net_out_descriptor> of the specctra dsn spec. More...
 
class  DSN::ROUTE
 
struct  DSN::PIN_PAIR
 Used within the WAS_IS class below to hold a pair of PIN_REFs and corresponds to the (pins was is) construct within the specctra dsn spec. More...
 
class  DSN::WAS_IS
 A <was_is_descriptor> in the specctra dsn spec. More...
 
class  DSN::SESSION
 A <session_file_descriptor> in the specctra dsn spec. More...
 
class  DSN::SPECCTRA_DB
 A DSN data tree, usually coming from a DSN file. More...
 

Namespaces

namespace  DSN
 This source file implements export and import capabilities to the specctra dsn file format.
 

Typedefs

typedef DSN::T DSN_T
 
typedef std::vector< std::string > DSN::STRINGS
 
typedef std::vector< POINT > DSN::POINTS
 
typedef std::vector< PROPERTYDSN::PROPERTIES
 
typedef boost::ptr_vector< LAYER_RULE > DSN::LAYER_RULES
 
typedef boost::ptr_vector< PATH > DSN::PATHS
 
typedef boost::ptr_vector< WINDOW > DSN::WINDOWS
 
typedef boost::ptr_vector< KEEPOUT > DSN::KEEPOUTS
 
typedef boost::ptr_vector< LAYERDSN::LAYERS
 
typedef boost::ptr_vector< SPECCTRA_LAYER_PAIR > DSN::SPECCTRA_LAYER_PAIRS
 
typedef boost::ptr_vector< COPPER_PLANE > DSN::COPPER_PLANES
 
typedef boost::ptr_vector< PLACE > DSN::PLACES
 
typedef boost::ptr_vector< COMPONENTDSN::COMPONENTS
 
typedef boost::ptr_vector< PIN > DSN::PINS
 
typedef boost::ptr_vector< IMAGEDSN::IMAGES
 
typedef boost::ptr_vector< PADSTACK > DSN::PADSTACKS
 
typedef std::vector< PIN_REF > DSN::PIN_REFS
 
typedef boost::ptr_vector< FROMTO > DSN::FROMTOS
 
typedef boost::ptr_vector< COMP_ORDER > DSN::COMP_ORDERS
 
typedef boost::ptr_vector< NET > DSN::NETS
 
typedef boost::ptr_vector< CLASS > DSN::CLASSLIST
 
typedef boost::ptr_vector< WIRE > DSN::WIRES
 
typedef boost::ptr_vector< WIRE_VIA > DSN::WIRE_VIAS
 
typedef boost::ptr_vector< ANCESTOR > DSN::ANCESTORS
 
typedef boost::ptr_vector< SUPPLY_PIN > DSN::SUPPLY_PINS
 
typedef boost::ptr_vector< NET_OUT > DSN::NET_OUTS
 
typedef std::vector< PIN_PAIR > DSN::PIN_PAIRS
 
typedef boost::ptr_set< PADSTACK > DSN::PADSTACKSET
 

Functions

void ExportBoardToSpecctraFile (BOARD *aBoard, const wxString &aFullFilename)
 Helper method to export board to DSN file. More...
 
const char * DSN::GetTokenText (T aTok)
 The DSN namespace and returns the C string representing a SPECCTRA_DB::keyword. More...
 
bool DSN::operator< (const PADSTACK &lhs, const PADSTACK &rhs)
 Used by the PADSTACKSET boost::ptr_set below. More...
 

Typedef Documentation

◆ DSN_T

typedef DSN::T DSN_T

Definition at line 48 of file specctra.h.

Function Documentation

◆ ExportBoardToSpecctraFile()

void ExportBoardToSpecctraFile ( BOARD aBoard,
const wxString &  aFullFilename 
)

Helper method to export board to DSN file.

Parameters
aBoardboard object
aFullFilenamespecctra file name

Definition at line 114 of file specctra_export.cpp.

115{
116 SPECCTRA_DB db;
117
118 db.SetPCB( SPECCTRA_DB::MakePCB() );
119
120 LOCALE_IO toggle; // Switch the locale to standard C
121
122 // Build the board outlines *before* flipping footprints
123 if( !db.BuiltBoardOutlines( aBoard ) )
124 wxLogWarning( _( "Board outline is malformed. Run DRC for a full analysis." ) );
125
126 // DSN Images (=KiCad FOOTPRINTs and PADs) must be presented from the top view. So we
127 // temporarily flip any footprints which are on the back side of the board to the front,
128 // and record this in the FOOTPRINT's flag field.
129 db.FlipFOOTPRINTs( aBoard );
130
131 try
132 {
133 aBoard->SynchronizeNetsAndNetClasses( false );
134 db.FromBOARD( aBoard );
135 db.ExportPCB( aFullFilename, true );
136 db.RevertFOOTPRINTs( aBoard );
137
138 // if an exception is thrown by FromBOARD() or ExportPCB(), then ~SPECCTRA_DB() will
139 // close the file.
140 }
141 catch( ... )
142 {
143 db.RevertFOOTPRINTs( aBoard );
144 throw;
145 }
146}
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:1528
A DSN data tree, usually coming from a DSN file.
Definition: specctra.h:3648
void ExportPCB(const wxString &aFilename, bool aNameChange=false)
Write the internal PCB instance out as a SPECTRA DSN format file.
Definition: specctra.cpp:3697
void FlipFOOTPRINTs(BOARD *aBoard)
Flip the footprints which are on the back side of the board to the front.
void SetPCB(PCB *aPcb)
Delete any existing PCB and replaces it with the given one.
Definition: specctra.h:3688
bool BuiltBoardOutlines(BOARD *aBoard)
Build the board outlines and store it in m_brd_outlines.
void FromBOARD(BOARD *aBoard)
Add the entire BOARD to the PCB but does not write it out.
void RevertFOOTPRINTs(BOARD *aBoard)
Flip the footprints which were on the back side of the board back to the back.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:41
#define _(s)

References _, DSN::SPECCTRA_DB::BuiltBoardOutlines(), DSN::SPECCTRA_DB::ExportPCB(), DSN::SPECCTRA_DB::FlipFOOTPRINTs(), DSN::SPECCTRA_DB::FromBOARD(), DSN::SPECCTRA_DB::RevertFOOTPRINTs(), DSN::SPECCTRA_DB::SetPCB(), and BOARD::SynchronizeNetsAndNetClasses().

Referenced by ExportSpecctraDSN(), and PCB_EDIT_FRAME::ExportSpecctraFile().