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

 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 46 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 124 of file specctra_export.cpp.

125 {
126  SPECCTRA_DB db;
127 
128  db.SetPCB( SPECCTRA_DB::MakePCB() );
129 
130  LOCALE_IO toggle; // Switch the locale to standard C
131 
132  // Build the board outlines *before* flipping footprints
133  if( !db.BuiltBoardOutlines( aBoard ) )
134  wxLogWarning( _( "Board outline is malformed. Run DRC for a full analysis." ) );
135 
136  // DSN Images (=KiCad FOOTPRINTs and PADs) must be presented from the top view. So we
137  // temporarily flip any footprints which are on the back side of the board to the front,
138  // and record this in the FOOTPRINT's flag field.
139  db.FlipFOOTPRINTs( aBoard );
140 
141  try
142  {
144  db.FromBOARD( aBoard );
145  db.ExportPCB( aFullFilename, true );
146  db.RevertFOOTPRINTs( aBoard );
147 
148  // if an exception is thrown by FromBOARD or ExportPCB(), then
149  // ~SPECCTRA_DB() will close the file.
150  }
151  catch( ... )
152  {
153  db.RevertFOOTPRINTs( aBoard );
154  throw;
155  }
156 }
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
void SetPCB(PCB *aPcb)
Delete any existing PCB and replaces it with the given one.
Definition: specctra.h:3688
void SynchronizeNetsAndNetClasses()
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:1410
void RevertFOOTPRINTs(BOARD *aBoard)
Flip the footprints which were on the back side of the board back to the back.
#define _(s)
A DSN data tree, usually coming from a DSN file.
Definition: specctra.h:3647
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 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.

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

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