Commit e775cee9 authored by dickelbeck's avatar dickelbeck

more amazing free software

parent b91f11ad
...@@ -2702,36 +2702,32 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) throw( IOError ) ...@@ -2702,36 +2702,32 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) throw( IOError )
switch( tok ) switch( tok )
{ {
case T_rect: case T_rect:
case T_circle: if( growth->shape )
case T_path:
case T_polygon:
case T_qarc:
if( growth->rectangle || growth->circle || growth->path || growth->qarc )
unexpected( tok ); unexpected( tok );
default: ; growth->shape = new RECTANGLE( growth );
} doRECTANGLE( (RECTANGLE*) growth->shape );
switch( tok )
{
case T_rect:
growth->rectangle = new RECTANGLE( growth );
doRECTANGLE( growth->rectangle );
break; break;
case T_circle: case T_circle:
growth->circle = new CIRCLE( growth ); if( growth->shape )
doCIRCLE( growth->circle ); unexpected( tok );
growth->shape = new CIRCLE( growth );
doCIRCLE( (CIRCLE*) growth->shape );
break; break;
case T_path: case T_path:
case T_polygon: case T_polygon:
growth->path = new PATH( growth, tok ); if( growth->shape )
doPATH( growth->path ); unexpected( tok );
growth->shape = new PATH( growth, tok );
doPATH( (PATH*) growth->shape );
break; break;
case T_qarc: case T_qarc:
growth->qarc = new QARC( growth ); if( growth->shape )
doQARC( growth->qarc ); unexpected( tok );
growth->shape = new QARC( growth );
doQARC( (QARC*) growth->shape );
break; break;
case T_net: case T_net:
...@@ -3472,6 +3468,7 @@ PCB* SPECCTRA_DB::MakePCB() ...@@ -3472,6 +3468,7 @@ PCB* SPECCTRA_DB::MakePCB()
pcb->structure->rules = new RULE( pcb->structure, T_rule ); pcb->structure->rules = new RULE( pcb->structure, T_rule );
pcb->placement = new PLACEMENT( pcb ); pcb->placement = new PLACEMENT( pcb );
pcb->placement->flip_style = T_mirror_first;
pcb->library = new LIBRARY( pcb ); pcb->library = new LIBRARY( pcb );
......
...@@ -1782,7 +1782,7 @@ public: ...@@ -1782,7 +1782,7 @@ public:
ELEM( T_placement, aParent ) ELEM( T_placement, aParent )
{ {
unit = 0; unit = 0;
flip_style = T_NONE; flip_style = T_mirror_first;
} }
~PLACEMENT() ~PLACEMENT()
...@@ -2660,12 +2660,14 @@ class WIRE : public ELEM ...@@ -2660,12 +2660,14 @@ class WIRE : public ELEM
{ {
friend class SPECCTRA_DB; friend class SPECCTRA_DB;
//----- only one of these is used, like a union ----- /* <shape_descriptor >::=
PATH* path; ///< used for both path and polygon [<rectangle_descriptor> |
RECTANGLE* rectangle; <circle_descriptor> |
CIRCLE* circle; <polygon_descriptor> |
QARC* qarc; <path_descriptor> |
//--------------------------------------------------- <qarc_descriptor> ]
*/
ELEM* shape;
std::string net_id; std::string net_id;
int turret; int turret;
...@@ -2680,10 +2682,7 @@ public: ...@@ -2680,10 +2682,7 @@ public:
WIRE( ELEM* aParent ) : WIRE( ELEM* aParent ) :
ELEM( T_wire, aParent ) ELEM( T_wire, aParent )
{ {
path = 0; shape = 0;
rectangle = 0;
circle = 0;
qarc = 0;
connect = 0; connect = 0;
turret = -1; turret = -1;
...@@ -2694,27 +2693,29 @@ public: ...@@ -2694,27 +2693,29 @@ public:
~WIRE() ~WIRE()
{ {
delete path; delete shape;
delete rectangle;
delete circle;
delete qarc;
delete connect; delete connect;
} }
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError ) void SetShape( ELEM* aShape )
{ {
// these are mutually exclusive delete shape;
if( rectangle ) shape = aShape;
rectangle->Format( out, nestLevel );
else if( path )
path->Format( out, nestLevel );
else if( circle ) if( aShape )
circle->Format( out, nestLevel ); {
wxASSERT(aShape->Type()==T_rect || aShape->Type()==T_circle
else if( qarc ) || aShape->Type()==T_qarc || aShape->Type()==T_path
qarc->Format( out, nestLevel ); || aShape->Type()==T_polygon);
aShape->SetParent( this );
}
}
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
{
if( shape )
shape->Format( out, nestLevel );
if( net_id.size() ) if( net_id.size() )
{ {
...@@ -3392,19 +3393,22 @@ public: ...@@ -3392,19 +3393,22 @@ public:
*/ */
class SPECCTRA_DB : public OUTPUTFORMATTER class SPECCTRA_DB : public OUTPUTFORMATTER
{ {
LEXER* lexer; LEXER* lexer;
PCB* pcb; PCB* pcb;
SESSION* session; SESSION* session;
FILE* fp; FILE* fp;
wxString filename; wxString filename;
std::string quote_char; std::string quote_char;
STRINGFORMATTER sf; STRINGFORMATTER sf;
// FromBOARD() uses this
STRINGS layerIds;
/** /**
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment