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 ) if( aShape )
path->Format( out, nestLevel ); {
wxASSERT(aShape->Type()==T_rect || aShape->Type()==T_circle
|| aShape->Type()==T_qarc || aShape->Type()==T_path
|| aShape->Type()==T_polygon);
else if( circle ) aShape->SetParent( this );
circle->Format( out, nestLevel ); }
}
else if( qarc ) void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
qarc->Format( out, nestLevel ); {
if( shape )
shape->Format( out, nestLevel );
if( net_id.size() ) if( net_id.size() )
{ {
...@@ -3406,6 +3407,9 @@ class SPECCTRA_DB : public OUTPUTFORMATTER ...@@ -3406,6 +3407,9 @@ class SPECCTRA_DB : public OUTPUTFORMATTER
STRINGFORMATTER sf; STRINGFORMATTER sf;
// FromBOARD() uses this
STRINGS layerIds;
/** /**
* Function nextTok * Function nextTok
......
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