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 )
switch( tok )
{
case T_rect:
case T_circle:
case T_path:
case T_polygon:
case T_qarc:
if( growth->rectangle || growth->circle || growth->path || growth->qarc )
if( growth->shape )
unexpected( tok );
default: ;
}
switch( tok )
{
case T_rect:
growth->rectangle = new RECTANGLE( growth );
doRECTANGLE( growth->rectangle );
growth->shape = new RECTANGLE( growth );
doRECTANGLE( (RECTANGLE*) growth->shape );
break;
case T_circle:
growth->circle = new CIRCLE( growth );
doCIRCLE( growth->circle );
if( growth->shape )
unexpected( tok );
growth->shape = new CIRCLE( growth );
doCIRCLE( (CIRCLE*) growth->shape );
break;
case T_path:
case T_polygon:
growth->path = new PATH( growth, tok );
doPATH( growth->path );
if( growth->shape )
unexpected( tok );
growth->shape = new PATH( growth, tok );
doPATH( (PATH*) growth->shape );
break;
case T_qarc:
growth->qarc = new QARC( growth );
doQARC( growth->qarc );
if( growth->shape )
unexpected( tok );
growth->shape = new QARC( growth );
doQARC( (QARC*) growth->shape );
break;
case T_net:
......@@ -3472,6 +3468,7 @@ PCB* SPECCTRA_DB::MakePCB()
pcb->structure->rules = new RULE( pcb->structure, T_rule );
pcb->placement = new PLACEMENT( pcb );
pcb->placement->flip_style = T_mirror_first;
pcb->library = new LIBRARY( pcb );
......
......@@ -1782,7 +1782,7 @@ public:
ELEM( T_placement, aParent )
{
unit = 0;
flip_style = T_NONE;
flip_style = T_mirror_first;
}
~PLACEMENT()
......@@ -2660,12 +2660,14 @@ class WIRE : public ELEM
{
friend class SPECCTRA_DB;
//----- only one of these is used, like a union -----
PATH* path; ///< used for both path and polygon
RECTANGLE* rectangle;
CIRCLE* circle;
QARC* qarc;
//---------------------------------------------------
/* <shape_descriptor >::=
[<rectangle_descriptor> |
<circle_descriptor> |
<polygon_descriptor> |
<path_descriptor> |
<qarc_descriptor> ]
*/
ELEM* shape;
std::string net_id;
int turret;
......@@ -2680,10 +2682,7 @@ public:
WIRE( ELEM* aParent ) :
ELEM( T_wire, aParent )
{
path = 0;
rectangle = 0;
circle = 0;
qarc = 0;
shape = 0;
connect = 0;
turret = -1;
......@@ -2694,27 +2693,29 @@ public:
~WIRE()
{
delete path;
delete rectangle;
delete circle;
delete qarc;
delete shape;
delete connect;
}
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
void SetShape( ELEM* aShape )
{
// these are mutually exclusive
if( rectangle )
rectangle->Format( out, nestLevel );
delete shape;
shape = aShape;
else if( path )
path->Format( out, nestLevel );
if( aShape )
{
wxASSERT(aShape->Type()==T_rect || aShape->Type()==T_circle
|| aShape->Type()==T_qarc || aShape->Type()==T_path
|| aShape->Type()==T_polygon);
else if( circle )
circle->Format( out, nestLevel );
aShape->SetParent( this );
}
}
else if( qarc )
qarc->Format( out, nestLevel );
void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )
{
if( shape )
shape->Format( out, nestLevel );
if( net_id.size() )
{
......@@ -3406,6 +3407,9 @@ class SPECCTRA_DB : public OUTPUTFORMATTER
STRINGFORMATTER sf;
// FromBOARD() uses this
STRINGS layerIds;
/**
* 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