diff --git a/pcbnew/specctra_import_export/specctra.cpp b/pcbnew/specctra_import_export/specctra.cpp index 799a149322..f8260d4ef3 100644 --- a/pcbnew/specctra_import_export/specctra.cpp +++ b/pcbnew/specctra_import_export/specctra.cpp @@ -323,7 +323,7 @@ void SPECCTRA_DB::doPCB( PCB* growth ) */ NeedSYMBOL(); - growth->pcbname = CurText(); + growth->m_pcbname = CurText(); while( (tok = NextTok()) != T_RIGHT ) { @@ -335,67 +335,67 @@ void SPECCTRA_DB::doPCB( PCB* growth ) switch( tok ) { case T_parser: - if( growth->parser ) + if( growth->m_parser ) Unexpected( tok ); - growth->parser = new PARSER( growth ); - doPARSER( growth->parser ); + growth->m_parser = new PARSER( growth ); + doPARSER( growth->m_parser ); break; case T_unit: - if( growth->unit ) + if( growth->m_unit ) Unexpected( tok ); - growth->unit = new UNIT_RES( growth, tok ); - doUNIT( growth->unit ); + growth->m_unit = new UNIT_RES( growth, tok ); + doUNIT( growth->m_unit ); break; case T_resolution: - if( growth->resolution ) + if( growth->m_resolution ) Unexpected( tok ); - growth->resolution = new UNIT_RES( growth, tok ); - doRESOLUTION( growth->resolution ); + growth->m_resolution = new UNIT_RES( growth, tok ); + doRESOLUTION( growth->m_resolution ); break; case T_structure: - if( growth->structure ) + if( growth->m_structure ) Unexpected( tok ); - growth->structure = new STRUCTURE( growth ); - doSTRUCTURE( growth->structure ); + growth->m_structure = new STRUCTURE( growth ); + doSTRUCTURE( growth->m_structure ); break; case T_placement: - if( growth->placement ) + if( growth->m_placement ) Unexpected( tok ); - growth->placement = new PLACEMENT( growth ); - doPLACEMENT( growth->placement ); + growth->m_placement = new PLACEMENT( growth ); + doPLACEMENT( growth->m_placement ); break; case T_library: - if( growth->library ) + if( growth->m_library ) Unexpected( tok ); - growth->library = new LIBRARY( growth ); - doLIBRARY( growth->library ); + growth->m_library = new LIBRARY( growth ); + doLIBRARY( growth->m_library ); break; case T_network: - if( growth->network ) + if( growth->m_network ) Unexpected( tok ); - growth->network = new NETWORK( growth ); - doNETWORK( growth->network ); + growth->m_network = new NETWORK( growth ); + doNETWORK( growth->m_network ); break; case T_wiring: - if( growth->wiring ) + if( growth->m_wiring ) Unexpected( tok ); - growth->wiring = new WIRING( growth ); - doWIRING( growth->wiring ); + growth->m_wiring = new WIRING( growth ); + doWIRING( growth->m_wiring ); break; default: @@ -665,62 +665,62 @@ void SPECCTRA_DB::doSTRUCTURE( STRUCTURE* growth ) switch( tok ) { case T_unit: - if( growth->unit ) + if( growth->m_unit ) Unexpected( tok ); - growth->unit = new UNIT_RES( growth, tok ); - doUNIT( growth->unit ); + growth->m_unit = new UNIT_RES( growth, tok ); + doUNIT( growth->m_unit ); break; case T_resolution: - if( growth->unit ) + if( growth->m_unit ) Unexpected( tok ); - growth->unit = new UNIT_RES( growth, tok ); - doRESOLUTION( growth->unit ); + growth->m_unit = new UNIT_RES( growth, tok ); + doRESOLUTION( growth->m_unit ); break; case T_layer_noise_weight: - if( growth->layer_noise_weight ) + if( growth->m_layer_noise_weight ) Unexpected( tok ); - growth->layer_noise_weight = new LAYER_NOISE_WEIGHT( growth ); - doLAYER_NOISE_WEIGHT( growth->layer_noise_weight ); + growth->m_layer_noise_weight = new LAYER_NOISE_WEIGHT( growth ); + doLAYER_NOISE_WEIGHT( growth->m_layer_noise_weight ); break; case T_place_boundary: L_place: - if( growth->place_boundary ) + if( growth->m_place_boundary ) Unexpected( tok ); - growth->place_boundary = new BOUNDARY( growth, T_place_boundary ); - doBOUNDARY( growth->place_boundary ); + growth->m_place_boundary = new BOUNDARY( growth, T_place_boundary ); + doBOUNDARY( growth->m_place_boundary ); break; case T_boundary: - if( growth->boundary ) + if( growth->m_boundary ) { - if( growth->place_boundary ) + if( growth->m_place_boundary ) Unexpected( tok ); goto L_place; } - growth->boundary = new BOUNDARY( growth ); - doBOUNDARY( growth->boundary ); + growth->m_boundary = new BOUNDARY( growth ); + doBOUNDARY( growth->m_boundary ); break; case T_plane: COPPER_PLANE* plane; plane = new COPPER_PLANE( growth ); - growth->planes.push_back( plane ); + growth->m_planes.push_back( plane ); doKEEPOUT( plane ); break; case T_region: REGION* region; region = new REGION( growth ); - growth->regions.push_back( region ); + growth->m_regions.push_back( region ); doREGION( region ); break; @@ -732,42 +732,42 @@ L_place: break; case T_via: - if( growth->via ) + if( growth->m_via ) Unexpected( tok ); - growth->via = new VIA( growth ); - doVIA( growth->via ); + growth->m_via = new VIA( growth ); + doVIA( growth->m_via ); break; case T_control: - if( growth->control ) + if( growth->m_control ) Unexpected( tok ); - growth->control = new CONTROL( growth ); - doCONTROL( growth->control ); + growth->m_control = new CONTROL( growth ); + doCONTROL( growth->m_control ); break; case T_layer: LAYER* layer; layer = new LAYER( growth ); - growth->layers.push_back( layer ); + growth->m_layers.push_back( layer ); doLAYER( layer ); break; case T_rule: - if( growth->rules ) + if( growth->m_rules ) Unexpected( tok ); - growth->rules = new RULE( growth, T_rule ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, T_rule ); + doRULE( growth->m_rules ); break; case T_place_rule: - if( growth->place_rules ) + if( growth->m_place_rules ) Unexpected( tok ); - growth->place_rules = new RULE( growth, T_place_rule ); - doRULE( growth->place_rules ); + growth->m_place_rules = new RULE( growth, T_place_rule ); + doRULE( growth->m_place_rules ); break; case T_keepout: @@ -778,14 +778,14 @@ L_place: case T_elongate_keepout: KEEPOUT* keepout; keepout = new KEEPOUT( growth, tok ); - growth->keepouts.push_back( keepout ); + growth->m_keepouts.push_back( keepout ); doKEEPOUT( keepout ); break; case T_grid: GRID* grid; grid = new GRID( growth ); - growth->grids.push_back( grid ); + growth->m_grids.push_back( grid ); doGRID( grid ); break; @@ -820,16 +820,16 @@ void SPECCTRA_DB::doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) case T_layer: LAYER* layer; layer = new LAYER( growth ); - growth->layers.push_back( layer ); + growth->m_layers.push_back( layer ); doLAYER( layer ); break; case T_rule: - if( growth->rules ) + if( growth->m_rules ) Unexpected( tok ); - growth->rules = new RULE( growth, T_rule ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, T_rule ); + doRULE( growth->m_rules ); break; default: @@ -847,7 +847,7 @@ void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) if( IsSymbol(tok) ) { - growth->name = CurText(); + growth->m_name = CurText(); tok = NextTok(); } @@ -867,40 +867,40 @@ void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) if( NextTok() != T_NUMBER ) Expecting( T_NUMBER ); - growth->sequence_number = atoi( CurText() ); + growth->m_sequence_number = atoi( CurText() ); NeedRIGHT(); break; case T_rule: - if( growth->rules ) + if( growth->m_rules ) Unexpected( tok ); - growth->rules = new RULE( growth, T_rule ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, T_rule ); + doRULE( growth->m_rules ); break; case T_place_rule: - if( growth->place_rules ) + if( growth->m_place_rules ) Unexpected( tok ); - growth->place_rules = new RULE( growth, T_place_rule ); - doRULE( growth->place_rules ); + growth->m_place_rules = new RULE( growth, T_place_rule ); + doRULE( growth->m_place_rules ); break; case T_rect: - if( growth->shape ) + if( growth->m_shape ) Unexpected( tok ); - growth->shape = new RECTANGLE( growth ); - doRECTANGLE( (RECTANGLE*) growth->shape ); + growth->m_shape = new RECTANGLE( growth ); + doRECTANGLE( (RECTANGLE*) growth->m_shape ); break; case T_circle: - if( growth->shape ) + if( growth->m_shape ) Unexpected( tok ); - growth->shape = new CIRCLE( growth ); - doCIRCLE( (CIRCLE*) growth->shape ); + growth->m_shape = new CIRCLE( growth ); + doCIRCLE( (CIRCLE*) growth->m_shape ); break; case T_polyline_path: @@ -909,25 +909,25 @@ void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) case T_path: case T_polygon: - if( growth->shape ) + if( growth->m_shape ) Unexpected( tok ); - growth->shape = new PATH( growth, tok ); - doPATH( (PATH*) growth->shape ); + growth->m_shape = new PATH( growth, tok ); + doPATH( (PATH*) growth->m_shape ); break; case T_qarc: - if( growth->shape ) + if( growth->m_shape ) Unexpected( tok ); - growth->shape = new QARC( growth ); - doQARC( (QARC*) growth->shape ); + growth->m_shape = new QARC( growth ); + doQARC( (QARC*) growth->m_shape ); break; case T_window: WINDOW* window; window = new WINDOW( growth ); - growth->windows.push_back( window ); + growth->m_windows.push_back( window ); doWINDOW( window ); break; @@ -1259,12 +1259,12 @@ void SPECCTRA_DB::doVIA( VIA* growth ) if( !IsSymbol( tok ) ) Expecting( T_SYMBOL ); - growth->spares.push_back( CurText() ); + growth->m_spares.push_back( CurText() ); } } else if( IsSymbol( tok ) ) { - growth->padstacks.push_back( CurText() ); + growth->m_padstacks.push_back( CurText() ); } else { @@ -1521,7 +1521,7 @@ void SPECCTRA_DB::doRULE( RULE* growth ) // the last rule). Then save the last rule and clear the string builder. if( bracketNesting == 1 ) { - growth->rules.push_back( builder ); + growth->m_rules.push_back( builder ); builder.clear(); } } @@ -1631,7 +1631,7 @@ void SPECCTRA_DB::doREGION( REGION* growth ) if( IsSymbol( tok ) ) { - growth->region_id = CurText(); + growth->m_region_id = CurText(); tok = NextTok(); } @@ -1645,19 +1645,19 @@ void SPECCTRA_DB::doREGION( REGION* growth ) switch( tok ) { case T_rect: - if( growth->rectangle ) + if( growth->m_rectangle ) Unexpected( tok ); - growth->rectangle = new RECTANGLE( growth ); - doRECTANGLE( growth->rectangle ); + growth->m_rectangle = new RECTANGLE( growth ); + doRECTANGLE( growth->m_rectangle ); break; case T_polygon: - if( growth->polygon ) + if( growth->m_polygon ) Unexpected( tok ); - growth->polygon = new PATH( growth, T_polygon ); - doPATH( growth->polygon ); + growth->m_polygon = new PATH( growth, T_polygon ); + doPATH( growth->m_polygon ); break; case T_region_net: @@ -1676,11 +1676,11 @@ void SPECCTRA_DB::doREGION( REGION* growth ) break; case T_rule: - if( growth->rules ) + if( growth->m_rules ) Unexpected( tok ); - growth->rules = new RULE( growth, T_rule ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, T_rule ); + doRULE( growth->m_rules ); break; default: @@ -1691,7 +1691,7 @@ void SPECCTRA_DB::doREGION( REGION* growth ) if( tok == T_RIGHT ) { - if( !growth->rules ) + if( !growth->m_rules ) Expecting( T_rule ); break; @@ -1783,12 +1783,12 @@ void SPECCTRA_DB::doGRID( GRID* growth ) case T_via_keepout: case T_snap: case T_place: - growth->grid_type = tok; + growth->m_grid_type = tok; if( NextTok() != T_NUMBER ) Expecting( T_NUMBER ); - growth->dimension = strtod( CurText(), 0 ); + growth->m_dimension = strtod( CurText(), 0 ); tok = NextTok(); if( tok == T_LEFT ) @@ -1797,7 +1797,7 @@ void SPECCTRA_DB::doGRID( GRID* growth ) { if( tok == T_direction ) { - if( growth->grid_type == T_place ) + if( growth->m_grid_type == T_place ) Unexpected( tok ); tok = NextTok(); @@ -1805,27 +1805,27 @@ void SPECCTRA_DB::doGRID( GRID* growth ) if( tok != T_x && tok != T_y ) Unexpected( CurText() ); - growth->direction = tok; + growth->m_direction = tok; if( NextTok() != T_RIGHT ) Expecting(T_RIGHT); } else if( tok == T_offset ) { - if( growth->grid_type == T_place ) + if( growth->m_grid_type == T_place ) Unexpected( tok ); if( NextTok() != T_NUMBER ) Expecting( T_NUMBER ); - growth->offset = strtod( CurText(), 0 ); + growth->m_offset = strtod( CurText(), 0 ); if( NextTok() != T_RIGHT ) Expecting( T_RIGHT ); } else if( tok == T_image_type ) { - if( growth->grid_type != T_place ) + if( growth->m_grid_type != T_place ) Unexpected( tok ); tok = NextTok(); @@ -1833,7 +1833,7 @@ void SPECCTRA_DB::doGRID( GRID* growth ) if( tok != T_smd && tok != T_pin ) Unexpected( CurText() ); - growth->image_type = tok; + growth->m_image_type = tok; if( NextTok() != T_RIGHT ) Expecting( T_RIGHT ); @@ -1857,7 +1857,7 @@ void SPECCTRA_DB::doLAYER_RULE( LAYER_RULE* growth ) do { - growth->layer_ids.push_back( CurText() ); + growth->m_layer_ids.push_back( CurText() ); } while( IsSymbol( tok = NextTok() ) ); @@ -1867,8 +1867,8 @@ void SPECCTRA_DB::doLAYER_RULE( LAYER_RULE* growth ) if( NextTok() != T_rule ) Expecting( T_rule ); - growth->rule = new RULE( growth, T_rule ); - doRULE( growth->rule ); + growth->m_rule = new RULE( growth, T_rule ); + doRULE( growth->m_rule ); NeedRIGHT(); } @@ -1881,7 +1881,7 @@ void SPECCTRA_DB::doPLACE( PLACE* growth ) if( !IsSymbol( tok ) ) Expecting( "component_id" ); - growth->component_id = CurText(); + growth->m_component_id = CurText(); tok = NextTok(); @@ -1903,7 +1903,7 @@ void SPECCTRA_DB::doPLACE( PLACE* growth ) if( tok != T_front && tok != T_back ) Expecting( "front|back" ); - growth->side = tok; + growth->m_side = tok; if( NextTok() != T_NUMBER ) Expecting( "rotation" ); @@ -1924,7 +1924,7 @@ void SPECCTRA_DB::doPLACE( PLACE* growth ) tok = NextTok(); if( tok == T_x || tok == T_y || tok == T_xy || tok == T_off ) - growth->mirror = tok; + growth->m_mirror = tok; else Expecting( "x|y|xy|off" ); @@ -1934,14 +1934,14 @@ void SPECCTRA_DB::doPLACE( PLACE* growth ) tok = NextTok(); if( tok==T_added || tok==T_deleted || tok==T_substituted ) - growth->status = tok; + growth->m_status = tok; else Expecting("added|deleted|substituted"); break; case T_logical_part: - if( growth->logical_part.size() ) + if( growth->m_logical_part.size() ) Unexpected( tok ); tok = NextTok(); @@ -1949,56 +1949,56 @@ void SPECCTRA_DB::doPLACE( PLACE* growth ) if( !IsSymbol( tok ) ) Expecting( "logical_part_id"); - growth->logical_part = CurText(); + growth->m_logical_part = CurText(); break; case T_place_rule: - if( growth->place_rules ) + if( growth->m_place_rules ) Unexpected( tok ); - growth->place_rules = new RULE( growth, T_place_rule ); - doRULE( growth->place_rules ); + growth->m_place_rules = new RULE( growth, T_place_rule ); + doRULE( growth->m_place_rules ); break; case T_property: - if( growth->properties.size() ) + if( growth->m_properties.size() ) Unexpected( tok ); - doPROPERTIES( &growth->properties ); + doPROPERTIES( &growth->m_properties ); break; case T_lock_type: tok = NextTok(); if( tok == T_position || tok == T_gate || tok == T_subgate || tok == T_pin ) - growth->lock_type = tok; + growth->m_lock_type = tok; else Expecting( "position|gate|subgate|pin" ); break; case T_rule: - if( growth->rules || growth->region ) + if( growth->m_rules || growth->m_region ) Unexpected( tok ); - growth->rules = new RULE( growth, T_rule ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, T_rule ); + doRULE( growth->m_rules ); break; case T_region: - if( growth->rules || growth->region ) + if( growth->m_rules || growth->m_region ) Unexpected( tok ); - growth->region = new REGION( growth ); - doREGION( growth->region ); + growth->m_region = new REGION( growth ); + doREGION( growth->m_region ); break; case T_pn: - if( growth->part_number.size() ) + if( growth->m_part_number.size() ) Unexpected( tok ); NeedSYMBOLorNUMBER(); - growth->part_number = CurText(); + growth->m_part_number = CurText(); NeedRIGHT(); break; @@ -2016,7 +2016,7 @@ void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) if( !IsSymbol( tok ) && tok != T_NUMBER ) Expecting( "image_id" ); - growth->image_id = CurText(); + growth->m_image_id = CurText(); while( ( tok = NextTok() ) != T_RIGHT ) { @@ -2030,7 +2030,7 @@ void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) case T_place: PLACE* place; place = new PLACE( growth ); - growth->places.push_back( place ); + growth->m_places.push_back( place ); doPLACE( place ); break; @@ -2059,12 +2059,12 @@ void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) { case T_unit: case T_resolution: - growth->unit = new UNIT_RES( growth, tok ); + growth->m_unit = new UNIT_RES( growth, tok ); if( tok == T_resolution ) - doRESOLUTION( growth->unit ); + doRESOLUTION( growth->m_unit ); else - doUNIT( growth->unit ); + doUNIT( growth->m_unit ); break; case T_place_control: @@ -2077,7 +2077,7 @@ void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) tok = NextTok(); if( tok == T_mirror_first || tok == T_rotate_first ) - growth->flip_style = tok; + growth->m_flip_style = tok; else Expecting( "mirror_first|rotate_first" ); @@ -2088,7 +2088,7 @@ void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) case T_component: COMPONENT* component; component = new COMPONENT( growth ); - growth->components.push_back( component ); + growth->m_components.push_back( component ); doCOMPONENT( component ); break; @@ -2103,7 +2103,7 @@ void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) { T tok = NextTok(); - /* (padstack + /* (padstack [ ] {(shape [ ] @@ -2117,9 +2117,9 @@ void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) [(rule )]) */ - // padstack_id may be a number + // m_padstack_id may be a number if( !IsSymbol( tok ) && tok != T_NUMBER ) - Expecting( "padstack_id" ); + Expecting( "m_padstack_id" ); growth->m_padstack_id = CurText(); @@ -2281,14 +2281,14 @@ L_done_that: tok = NextTok(); if( tok!=T_on && tok!=T_off ) Expecting( "on|off" ); - growth->connect = tok; + growth->m_connect = tok; NeedRIGHT(); break; case T_window: WINDOW* window; window = new WINDOW( growth ); - growth->windows.push_back( window ); + growth->m_windows.push_back( window ); doWINDOW( window ); break; @@ -2308,7 +2308,7 @@ void SPECCTRA_DB::doIMAGE( IMAGE* growth ) [(side [front | back | both])] [ ] [ ] - {(pin [(rotate )] + {(pin [(rotate )] [ | ] [ ])} [{ }] @@ -2323,7 +2323,7 @@ void SPECCTRA_DB::doIMAGE( IMAGE* growth ) if( !IsSymbol( tok ) && tok != T_NUMBER ) Expecting( "image_id" ); - growth->image_id = CurText(); + growth->m_image_id = CurText(); while( ( tok = NextTok() ) != T_RIGHT ) { @@ -2335,11 +2335,11 @@ void SPECCTRA_DB::doIMAGE( IMAGE* growth ) switch( tok ) { case T_unit: - if( growth->unit ) + if( growth->m_unit ) Unexpected( tok ); - growth->unit = new UNIT_RES( growth, tok ); - doUNIT( growth->unit ); + growth->m_unit = new UNIT_RES( growth, tok ); + doUNIT( growth->m_unit ); break; case T_side: @@ -2348,7 +2348,7 @@ void SPECCTRA_DB::doIMAGE( IMAGE* growth ) if( tok != T_front && tok != T_back && tok != T_both ) Expecting( "front|back|both" ); - growth->side = tok; + growth->m_side = tok; NeedRIGHT(); break; @@ -2362,24 +2362,24 @@ void SPECCTRA_DB::doIMAGE( IMAGE* growth ) case T_pin: PIN* pin; pin = new PIN( growth ); - growth->pins.push_back( pin ); + growth->m_pins.push_back( pin ); doPIN( pin ); break; case T_rule: - if( growth->rules ) + if( growth->m_rules ) Unexpected( tok ); - growth->rules = new RULE( growth, tok ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, tok ); + doRULE( growth->m_rules ); break; case T_place_rule: - if( growth->place_rules ) + if( growth->m_place_rules ) Unexpected( tok ); - growth->place_rules = new RULE( growth, tok ); - doRULE( growth->place_rules ); + growth->m_place_rules = new RULE( growth, tok ); + doRULE( growth->m_place_rules ); break; case T_keepout: @@ -2390,7 +2390,7 @@ void SPECCTRA_DB::doIMAGE( IMAGE* growth ) case T_elongate_keepout: KEEPOUT* keepout; keepout = new KEEPOUT( growth, tok ); - growth->keepouts.push_back( keepout ); + growth->m_keepouts.push_back( keepout ); doKEEPOUT( keepout ); break; @@ -2405,16 +2405,16 @@ void SPECCTRA_DB::doPIN( PIN* growth ) { T tok = NextTok(); - /* (pin [(rotate )] + /* (pin [(rotate )] [ | ] [ ]) */ - // a padstack_id may be a number + // a m_padstack_id may be a number if( !IsSymbol( tok ) && tok!=T_NUMBER ) - Expecting( "padstack_id" ); + Expecting( "m_padstack_id" ); - growth->padstack_id = CurText(); + growth->m_padstack_id = CurText(); while( ( tok = NextTok() ) != T_RIGHT ) { @@ -2436,17 +2436,17 @@ void SPECCTRA_DB::doPIN( PIN* growth ) if( !IsSymbol( tok ) && tok != T_NUMBER ) Expecting( "pin_id" ); - growth->pin_id = CurText(); + growth->m_pin_id = CurText(); if( NextTok() != T_NUMBER ) Expecting( T_NUMBER ); - growth->vertex.x = strtod( CurText(), 0 ); + growth->m_vertex.x = strtod( CurText(), 0 ); if( NextTok() != T_NUMBER ) Expecting( T_NUMBER ); - growth->vertex.y = strtod( CurText(), 0 ); + growth->m_vertex.y = strtod( CurText(), 0 ); } } } @@ -2480,11 +2480,11 @@ void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) switch( tok ) { case T_unit: - if( growth->unit ) + if( growth->m_unit ) Unexpected( tok ); - growth->unit = new UNIT_RES( growth, tok ); - doUNIT( growth->unit ); + growth->m_unit = new UNIT_RES( growth, tok ); + doUNIT( growth->m_unit ); break; case T_padstack: @@ -2497,7 +2497,7 @@ void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) case T_image: IMAGE* image; image = new IMAGE( growth ); - growth->images.push_back( image ); + growth->m_images.push_back( image ); doIMAGE( image ); break; @@ -2537,7 +2537,7 @@ void SPECCTRA_DB::doNET( NET* growth ) if( !IsSymbol( tok ) ) Expecting( "net_id" ); - growth->net_id = CurText(); + growth->m_net_id = CurText(); while( ( tok = NextTok() ) != T_RIGHT ) { @@ -2549,7 +2549,7 @@ void SPECCTRA_DB::doNET( NET* growth ) switch( tok ) { case T_unassigned: - growth->unassigned = true; + growth->m_unassigned = true; NeedRIGHT(); break; @@ -2557,34 +2557,34 @@ void SPECCTRA_DB::doNET( NET* growth ) if( NextTok() != T_NUMBER ) Expecting( T_NUMBER ); - growth->net_number = atoi( CurText() ); + growth->m_net_number = atoi( CurText() ); NeedRIGHT(); break; case T_pins: case T_order: - growth->pins_type = tok; - pin_refs = &growth->pins; + growth->m_pins_type = tok; + pin_refs = &growth->m_pins; goto L_pins; case T_expose: - pin_refs = &growth->expose; + pin_refs = &growth->m_expose; goto L_pins; case T_noexpose: - pin_refs = &growth->noexpose; + pin_refs = &growth->m_noexpose; goto L_pins; case T_source: - pin_refs = &growth->source; + pin_refs = &growth->m_source; goto L_pins; case T_load: - pin_refs = &growth->load; + pin_refs = &growth->m_load; goto L_pins; case T_terminator: - pin_refs = &growth->terminator; + pin_refs = &growth->m_terminator; //goto L_pins; L_pins: @@ -2605,11 +2605,11 @@ L_pins: break; case T_comp_order: - if( growth->comp_order ) + if( growth->m_comp_order ) Unexpected( tok ); - growth->comp_order = new COMP_ORDER( growth ); - doCOMP_ORDER( growth->comp_order ); + growth->m_comp_order = new COMP_ORDER( growth ); + doCOMP_ORDER( growth->m_comp_order ); break; case T_type: @@ -2628,24 +2628,24 @@ L_pins: */ case T_rule: - if( growth->rules ) + if( growth->m_rules ) Unexpected( tok ); - growth->rules = new RULE( growth, T_rule ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, T_rule ); + doRULE( growth->m_rules ); break; case T_layer_rule: LAYER_RULE* layer_rule; layer_rule = new LAYER_RULE( growth ); - growth->layer_rules.push_back( layer_rule ); + growth->m_layer_rules.push_back( layer_rule ); doLAYER_RULE( layer_rule ); break; case T_fromto: FROMTO* fromto; fromto = new FROMTO( growth ); - growth->fromtos.push_back( fromto ); + growth->m_fromtos.push_back( fromto ); doFROMTO( fromto ); break; @@ -2677,14 +2677,14 @@ void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) case T_fromto: FROMTO* fromto; fromto = new FROMTO( growth ); - growth->fromtos.push_back( fromto ); + growth->m_fromtos.push_back( fromto ); doFROMTO( fromto ); break; case T_comp_order: COMP_ORDER* comp_order; comp_order = new COMP_ORDER( growth ); - growth->comp_orders.push_back( comp_order ); + growth->m_comp_orders.push_back( comp_order ); doCOMP_ORDER( comp_order ); break; @@ -2711,12 +2711,12 @@ void SPECCTRA_DB::doCLASS( CLASS* growth ) NeedSYMBOL(); - growth->class_id = CurText(); + growth->m_class_id = CurText(); // do net_ids, do not support s at this time while( IsSymbol( tok = NextTok() ) ) { - growth->net_ids.push_back( CurText() ); + growth->m_net_ids.push_back( CurText() ); } @@ -2730,26 +2730,26 @@ void SPECCTRA_DB::doCLASS( CLASS* growth ) switch( tok ) { case T_rule: - if( growth->rules ) + if( growth->m_rules ) Unexpected( tok ); - growth->rules = new RULE( growth, T_rule ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, T_rule ); + doRULE( growth->m_rules ); break; case T_layer_rule: LAYER_RULE* layer_rule; layer_rule = new LAYER_RULE( growth ); - growth->layer_rules.push_back( layer_rule ); + growth->m_layer_rules.push_back( layer_rule ); doLAYER_RULE( layer_rule ); break; case T_topology: - if( growth->topology ) + if( growth->m_topology ) Unexpected( tok ); - growth->topology = new TOPOLOGY( growth ); - doTOPOLOGY( growth->topology ); + growth->m_topology = new TOPOLOGY( growth ); + doTOPOLOGY( growth->m_topology ); break; case T_circuit: // handle all the circuit_descriptor here as strings @@ -2787,7 +2787,7 @@ void SPECCTRA_DB::doCLASS( CLASS* growth ) // to bracketNesting == 0, then save the builder and break; if( bracketNesting == 0 ) { - growth->circuit.push_back( builder ); + growth->m_circuit.push_back( builder ); break; } } @@ -2836,14 +2836,14 @@ void SPECCTRA_DB::doNETWORK( NETWORK* growth ) case T_net: NET* net; net = new NET( growth ); - growth->nets.push_back( net ); + growth->m_nets.push_back( net ); doNET( net ); break; case T_class: CLASS* myclass; myclass = new CLASS( growth ); - growth->classes.push_back( myclass ); + growth->m_classes.push_back( myclass ); doCLASS( myclass ); break; @@ -2863,9 +2863,7 @@ void SPECCTRA_DB::doCOMP_ORDER( COMP_ORDER* growth ) */ while( IsSymbol( tok = NextTok() ) ) - { - growth->placement_ids.push_back( CurText() ); - } + growth->m_placement_ids.push_back( CurText() ); if( tok != T_RIGHT ) Expecting( T_RIGHT ); @@ -2901,7 +2899,7 @@ void SPECCTRA_DB::doFROMTO( FROMTO* growth ) Expecting( T_SYMBOL ); } - growth->fromText = CurText(); + growth->m_fromText = CurText(); if( !IsSymbol(NextTok() ) ) { @@ -2909,7 +2907,7 @@ void SPECCTRA_DB::doFROMTO( FROMTO* growth ) Expecting( T_SYMBOL ); } - growth->toText = CurText(); + growth->m_toText = CurText(); SetStringDelimiter( old ); @@ -2928,31 +2926,31 @@ void SPECCTRA_DB::doFROMTO( FROMTO* growth ) if( tok != T_fix && tok != T_normal && tok != T_soft ) Expecting( "fix|normal|soft" ); - growth->fromto_type = tok; + growth->m_fromto_type = tok; NeedRIGHT(); break; case T_rule: - if( growth->rules ) + if( growth->m_rules ) Unexpected( tok ); - growth->rules = new RULE( growth, T_rule ); - doRULE( growth->rules ); + growth->m_rules = new RULE( growth, T_rule ); + doRULE( growth->m_rules ); break; case T_layer_rule: LAYER_RULE* layer_rule; layer_rule = new LAYER_RULE( growth ); - growth->layer_rules.push_back( layer_rule ); + growth->m_layer_rules.push_back( layer_rule ); doLAYER_RULE( layer_rule ); break; case T_net: - if( growth->net_id.size() ) + if( growth->m_net_id.size() ) Unexpected( tok ); NeedSYMBOL(); - growth->net_id = CurText(); + growth->m_net_id = CurText(); NeedRIGHT(); break; @@ -2996,19 +2994,19 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) switch( tok ) { case T_rect: - if( growth->shape ) + if( growth->m_shape ) Unexpected( tok ); - growth->shape = new RECTANGLE( growth ); - doRECTANGLE( (RECTANGLE*) growth->shape ); + growth->m_shape = new RECTANGLE( growth ); + doRECTANGLE( (RECTANGLE*) growth->m_shape ); break; case T_circle: - if( growth->shape ) + if( growth->m_shape ) Unexpected( tok ); - growth->shape = new CIRCLE( growth ); - doCIRCLE( (CIRCLE*) growth->shape ); + growth->m_shape = new CIRCLE( growth ); + doCIRCLE( (CIRCLE*) growth->m_shape ); break; case T_polyline_path: @@ -3017,24 +3015,24 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) case T_path: case T_polygon: - if( growth->shape ) + if( growth->m_shape ) Unexpected( tok ); - growth->shape = new PATH( growth, tok ); - doPATH( (PATH*) growth->shape ); + growth->m_shape = new PATH( growth, tok ); + doPATH( (PATH*) growth->m_shape ); break; case T_qarc: - if( growth->shape ) + if( growth->m_shape ) Unexpected( tok ); - growth->shape = new QARC( growth ); - doQARC( (QARC*) growth->shape ); + growth->m_shape = new QARC( growth ); + doQARC( (QARC*) growth->m_shape ); break; case T_net: NeedSYMBOLorNUMBER(); - growth->net_id = CurText(); + growth->m_net_id = CurText(); NeedRIGHT(); break; @@ -3042,7 +3040,7 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) if( NextTok() != T_NUMBER ) Expecting( T_NUMBER ); - growth->turret = atoi( CurText() ); + growth->m_turret = atoi( CurText() ); NeedRIGHT(); break; @@ -3052,7 +3050,7 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) if( tok != T_fix && tok != T_route && tok != T_normal && tok != T_protect ) Expecting( "fix|route|normal|protect" ); - growth->wire_type = tok; + growth->m_wire_type = tok; NeedRIGHT(); break; @@ -3062,33 +3060,33 @@ void SPECCTRA_DB::doWIRE( WIRE* growth ) if( tok != T_test && tok != T_fanout && tok != T_bus && tok != T_jumper ) Expecting( "test|fanout|bus|jumper" ); - growth->attr = tok; + growth->m_attr = tok; NeedRIGHT(); break; case T_shield: NeedSYMBOL(); - growth->shield = CurText(); + growth->m_shield = CurText(); NeedRIGHT(); break; case T_window: WINDOW* window; window = new WINDOW( growth ); - growth->windows.push_back( window ); + growth->m_windows.push_back( window ); doWINDOW( window ); break; case T_connect: - if( growth->connect ) + if( growth->m_connect ) Unexpected( tok ); - growth->connect = new CONNECT( growth ); - doCONNECT( growth->connect ); + growth->m_connect = new CONNECT( growth ); + doCONNECT( growth->m_connect ); break; case T_supply: - growth->supply = true; + growth->m_supply = true; NeedRIGHT(); break; @@ -3106,22 +3104,22 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) /* ::= (via - { } + { } [(net )] [(via_number )] [(type [fix | route | normal | protect])] [(attr [test | fanout | jumper | - virtual_pin ])] + virtual_pin ])] [(contact {})] [(supply)] ) (virtual_pin - (net ) + (net ) ) */ NeedSYMBOL(); - growth->padstack_id = CurText(); + growth->m_padstack_id = CurText(); while( ( tok = NextTok() ) == T_NUMBER ) { @@ -3132,7 +3130,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) point.y = strtod( CurText(), 0 ); - growth->vertexes.push_back( point ); + growth->m_vertexes.push_back( point ); } while( tok != T_RIGHT ) @@ -3146,7 +3144,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) { case T_net: NeedSYMBOL(); - growth->net_id = CurText(); + growth->m_net_id = CurText(); NeedRIGHT(); break; @@ -3154,7 +3152,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) if( NextTok() != T_NUMBER ) Expecting( "" ); - growth->via_number = atoi( CurText() ); + growth->m_via_number = atoi( CurText() ); NeedRIGHT(); break; @@ -3164,7 +3162,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) if( tok != T_fix && tok != T_route && tok != T_normal && tok != T_protect ) Expecting( "fix|route|normal|protect" ); - growth->via_type = tok; + growth->m_via_type = tok; NeedRIGHT(); break; @@ -3174,12 +3172,12 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) if( tok != T_test && tok != T_fanout && tok != T_jumper && tok != T_virtual_pin ) Expecting( "test|fanout|jumper|virtual_pin" ); - growth->attr = tok; + growth->m_attr = tok; if( tok == T_virtual_pin ) { NeedSYMBOL(); - growth->virtual_pin_name = CurText(); + growth->m_virtual_pin_name = CurText(); } NeedRIGHT(); @@ -3191,7 +3189,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) while( IsSymbol( tok ) ) { - growth->contact_layers.push_back( CurText() ); + growth->m_contact_layers.push_back( CurText() ); tok = NextTok(); } @@ -3201,7 +3199,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) break; case T_supply: - growth->supply = true; + growth->m_supply = true; NeedRIGHT(); break; @@ -3702,7 +3700,7 @@ void SPECCTRA_DB::ExportPCB( const wxString& aFilename, bool aNameChange ) FILE_OUTPUTFORMATTER formatter( aFilename, wxT( "wt" ), m_quote_char[0] ); if( aNameChange ) - m_pcb->pcbname = TO_UTF8( aFilename ); + m_pcb->m_pcbname = TO_UTF8( aFilename ); m_pcb->Format( &formatter, 0 ); } @@ -3724,22 +3722,22 @@ PCB* SPECCTRA_DB::MakePCB() { PCB* pcb = new PCB(); - pcb->parser = new PARSER( pcb ); - pcb->resolution = new UNIT_RES( pcb, T_resolution ); - pcb->unit = new UNIT_RES( pcb, T_unit ); + pcb->m_parser = new PARSER( pcb ); + pcb->m_resolution = new UNIT_RES( pcb, T_resolution ); + pcb->m_unit = new UNIT_RES( pcb, T_unit ); - pcb->structure = new STRUCTURE( pcb ); - pcb->structure->boundary = new BOUNDARY( pcb->structure ); - pcb->structure->via = new VIA( pcb->structure ); - pcb->structure->rules = new RULE( pcb->structure, T_rule ); + pcb->m_structure = new STRUCTURE( pcb ); + pcb->m_structure->m_boundary = new BOUNDARY( pcb->m_structure ); + pcb->m_structure->m_via = new VIA( pcb->m_structure ); + pcb->m_structure->m_rules = new RULE( pcb->m_structure, T_rule ); - pcb->placement = new PLACEMENT( pcb ); + pcb->m_placement = new PLACEMENT( pcb ); - pcb->library = new LIBRARY( pcb ); + pcb->m_library = new LIBRARY( pcb ); - pcb->network = new NETWORK( pcb ); + pcb->m_network = new NETWORK( pcb ); - pcb->wiring = new WIRING( pcb ); + pcb->m_wiring = new WIRING( pcb ); return pcb; } @@ -3838,13 +3836,13 @@ int PADSTACK::Compare( PADSTACK* lhs, PADSTACK* rhs ) int IMAGE::Compare( IMAGE* lhs, IMAGE* rhs ) { - if( !lhs->hash.size() ) - lhs->hash = lhs->makeHash(); + if( !lhs->m_hash.size() ) + lhs->m_hash = lhs->makeHash(); - if( !rhs->hash.size() ) - rhs->hash = rhs->makeHash(); + if( !rhs->m_hash.size() ) + rhs->m_hash = rhs->makeHash(); - int result = lhs->hash.compare( rhs->hash ); + int result = lhs->m_hash.compare( rhs->m_hash ); return result; } @@ -3925,47 +3923,47 @@ void PLACE::Format( OUTPUTFORMATTER* out, int nestLevel ) { bool useMultiLine; - const char* quote = out->GetQuoteChar( component_id.c_str() ); + const char* quote = out->GetQuoteChar( m_component_id.c_str() ); - if( place_rules || properties.size() || rules || region ) + if( m_place_rules || m_properties.size() || m_rules || m_region ) { useMultiLine = true; - out->Print( nestLevel, "(%s %s%s%s\n", Name(), quote, component_id.c_str(), quote ); + out->Print( nestLevel, "(%s %s%s%s\n", Name(), quote, m_component_id.c_str(), quote ); out->Print( nestLevel+1, "%s", "" ); } else { useMultiLine = false; - out->Print( nestLevel, "(%s %s%s%s", Name(), quote, component_id.c_str(), quote ); + out->Print( nestLevel, "(%s %s%s%s", Name(), quote, m_component_id.c_str(), quote ); } - if( hasVertex ) + if( m_hasVertex ) { - out->Print( 0, " %.6f %.6f", vertex.x, vertex.y ); - out->Print( 0, " %s", GetTokenText( side ) ); - out->Print( 0, " %.6f", rotation ); + out->Print( 0, " %.6f %.6f", m_vertex.x, m_vertex.y ); + out->Print( 0, " %s", GetTokenText( m_side ) ); + out->Print( 0, " %.6f", m_rotation ); } const char* space = " "; // one space, as c string. - if( mirror != T_NONE ) + if( m_mirror != T_NONE ) { - out->Print( 0, "%s(mirror %s)", space, GetTokenText( mirror ) ); + out->Print( 0, "%s(mirror %s)", space, GetTokenText( m_mirror ) ); space = ""; } - if( status != T_NONE ) + if( m_status != T_NONE ) { - out->Print( 0, "%s(status %s)", space, GetTokenText( status ) ); + out->Print( 0, "%s(status %s)", space, GetTokenText( m_status ) ); space = ""; } - if( logical_part.size() ) + if( m_logical_part.size() ) { - quote = out->GetQuoteChar( logical_part.c_str() ); - out->Print( 0, "%s(logical_part %s%s%s)", space, quote, logical_part.c_str(), quote ); + quote = out->GetQuoteChar( m_logical_part.c_str() ); + out->Print( 0, "%s(logical_part %s%s%s)", space, quote, m_logical_part.c_str(), quote ); space = ""; } @@ -3973,48 +3971,46 @@ void PLACE::Format( OUTPUTFORMATTER* out, int nestLevel ) { out->Print( 0, "\n" ); - if( place_rules ) - { - place_rules->Format( out, nestLevel+1 ); - } + if( m_place_rules ) + m_place_rules->Format( out, nestLevel+1 ); - if( properties.size() ) + if( m_properties.size() ) { out->Print( nestLevel + 1, "(property \n" ); - for( PROPERTIES::const_iterator i = properties.begin(); i != properties.end(); ++i ) + for( PROPERTIES::const_iterator i = m_properties.begin(); i != m_properties.end(); ++i ) i->Format( out, nestLevel + 2 ); out->Print( nestLevel + 1, ")\n" ); } - if( lock_type != T_NONE ) - out->Print( nestLevel + 1, "(lock_type %s)\n", GetTokenText( lock_type ) ); + if( m_lock_type != T_NONE ) + out->Print( nestLevel + 1, "(lock_type %s)\n", GetTokenText( m_lock_type ) ); - if( rules ) - rules->Format( out, nestLevel+1 ); + if( m_rules ) + m_rules->Format( out, nestLevel+1 ); - if( region ) - region->Format( out, nestLevel+1 ); + if( m_region ) + m_region->Format( out, nestLevel+1 ); - if( part_number.size() ) + if( m_part_number.size() ) { - quote = out->GetQuoteChar( part_number.c_str() ); - out->Print( nestLevel + 1, "(PN %s%s%s)\n", quote, part_number.c_str(), quote ); + quote = out->GetQuoteChar( m_part_number.c_str() ); + out->Print( nestLevel + 1, "(PN %s%s%s)\n", quote, m_part_number.c_str(), quote ); } } else { - if( lock_type != T_NONE ) + if( m_lock_type != T_NONE ) { - out->Print( 0, "%s(lock_type %s)", space, GetTokenText( lock_type ) ); + out->Print( 0, "%s(lock_type %s)", space, GetTokenText( m_lock_type ) ); space = ""; } - if( part_number.size() ) + if( m_part_number.size() ) { - quote = out->GetQuoteChar( part_number.c_str() ); - out->Print( 0, "%s(PN %s%s%s)", space, quote, part_number.c_str(), quote ); + quote = out->GetQuoteChar( m_part_number.c_str() ); + out->Print( 0, "%s(PN %s%s%s)", space, quote, m_part_number.c_str(), quote ); } } diff --git a/pcbnew/specctra_import_export/specctra.h b/pcbnew/specctra_import_export/specctra.h index 5eefd25c31..5dc907f5a9 100644 --- a/pcbnew/specctra_import_export/specctra.h +++ b/pcbnew/specctra_import_export/specctra.h @@ -203,7 +203,7 @@ class ELEM { public: - ELEM( DSN_T aType, ELEM* aParent = 0 ); + ELEM( DSN_T aType, ELEM* aParent = nullptr ); virtual ~ELEM(); @@ -289,7 +289,7 @@ class ELEM_HOLDER : public ELEM { public: - ELEM_HOLDER( DSN_T aType, ELEM* aParent = 0 ) : + ELEM_HOLDER( DSN_T aType, ELEM* aParent = nullptr ) : ELEM( aType, aParent ) { } @@ -503,10 +503,10 @@ public: bool singleLine; - if( rules.size() == 1 ) + if( m_rules.size() == 1 ) { singleLine = true; - out->Print( 0, " %s)", rules.begin()->c_str() ); + out->Print( 0, " %s)", m_rules.begin()->c_str() ); } else @@ -514,7 +514,7 @@ public: out->Print( 0, "\n" ); singleLine = false; - for( STRINGS::const_iterator i = rules.begin(); i != rules.end(); ++i ) + for( STRINGS::const_iterator i = m_rules.begin(); i != m_rules.end(); ++i ) out->Print( nestLevel+1, "%s\n", i->c_str() ); out->Print( nestLevel, ")" ); @@ -527,7 +527,7 @@ public: private: friend class SPECCTRA_DB; - STRINGS rules; ///< rules are saved in std::string form. + STRINGS m_rules; ///< rules are saved in std::string form. }; @@ -538,19 +538,19 @@ public: LAYER_RULE( ELEM* aParent ) : ELEM( T_layer_rule, aParent ) { - rule = 0; + m_rule = nullptr; } ~LAYER_RULE() { - delete rule; + delete m_rule; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override { out->Print( nestLevel, "(%s", Name() ); - for( STRINGS::const_iterator i=layer_ids.begin(); i != layer_ids.end(); ++i ) + for( STRINGS::const_iterator i = m_layer_ids.begin(); i != m_layer_ids.end(); ++i ) { const char* quote = out->GetQuoteChar( i->c_str() ); out->Print( 0, " %s%s%s", quote, i->c_str(), quote ); @@ -558,8 +558,8 @@ public: out->Print( 0 , "\n" ); - if( rule ) - rule->Format( out, nestLevel+1 ); + if( m_rule ) + m_rule->Format( out, nestLevel+1 ); out->Print( nestLevel, ")\n" ); } @@ -567,8 +567,8 @@ public: private: friend class SPECCTRA_DB; - STRINGS layer_ids; - RULE* rule; + STRINGS m_layer_ids; + RULE* m_rule; }; @@ -664,7 +664,7 @@ public: BOUNDARY( ELEM* aParent, DSN_T aType = T_boundary ) : ELEM( aType, aParent ) { - rectangle = 0; + rectangle = nullptr; } ~BOUNDARY() @@ -847,7 +847,7 @@ public: WINDOW( ELEM* aParent, DSN_T aType = T_window ) : ELEM( aType, aParent ) { - shape = 0; + shape = nullptr; } ~WINDOW() @@ -913,24 +913,24 @@ public: KEEPOUT( ELEM* aParent, DSN_T aType ) : ELEM( aType, aParent ) { - rules = 0; - place_rules = 0; - shape = 0; + m_rules = nullptr; + m_place_rules = nullptr; + m_shape = nullptr; - sequence_number = -1; + m_sequence_number = -1; } ~KEEPOUT() { - delete rules; - delete place_rules; - delete shape; + delete m_rules; + delete m_place_rules; + delete m_shape; } void SetShape( ELEM* aShape ) { - delete shape; - shape = aShape; + delete m_shape; + m_shape = aShape; if( aShape ) { @@ -947,7 +947,7 @@ public: void AddWindow( WINDOW* aWindow ) { aWindow->SetParent( this ); - windows.push_back( aWindow ); + m_windows.push_back( aWindow ); } void Format( OUTPUTFORMATTER* out, int nestLevel ) override @@ -956,10 +956,10 @@ public: out->Print( nestLevel, "(%s", Name() ); - if( name.size() ) + if( m_name.size() ) { - const char* quote = out->GetQuoteChar( name.c_str() ); - out->Print( 0, " %s%s%s", quote, name.c_str(), quote ); + const char* quote = out->GetQuoteChar( m_name.c_str() ); + out->Print( 0, " %s%s%s", quote, m_name.c_str(), quote ); } // Could be not needed: #if 1 @@ -969,35 +969,35 @@ public: } #endif - if( sequence_number != -1 ) - out->Print( 0, " (sequence_number %d)", sequence_number ); + if( m_sequence_number != -1 ) + out->Print( 0, " (sequence_number %d)", m_sequence_number ); - if( shape ) + if( m_shape ) { out->Print( 0, " " ); - shape->Format( out, 0 ); + m_shape->Format( out, 0 ); } - if( rules ) + if( m_rules ) { out->Print( 0, "%s", newline ); newline = ""; - rules->Format( out, nestLevel+1 ); + m_rules->Format( out, nestLevel+1 ); } - if( place_rules ) + if( m_place_rules ) { out->Print( 0, "%s", newline ); newline = ""; - place_rules->Format( out, nestLevel+1 ); + m_place_rules->Format( out, nestLevel+1 ); } - if( windows.size() ) + if( m_windows.size() ) { out->Print( 0, "%s", newline ); newline = ""; - for( WINDOWS::iterator i = windows.begin(); i != windows.end(); ++i ) + for( WINDOWS::iterator i = m_windows.begin(); i != m_windows.end(); ++i ) i->Format( out, nestLevel+1 ); out->Print( nestLevel, ")\n" ); @@ -1009,12 +1009,12 @@ public: } protected: - std::string name; - int sequence_number; - RULE* rules; - RULE* place_rules; + std::string m_name; + int m_sequence_number; + RULE* m_rules; + RULE* m_place_rules; - WINDOWS windows; + WINDOWS m_windows; /* ::= [ | @@ -1023,7 +1023,7 @@ protected: | ] */ - ELEM* shape; + ELEM* m_shape; private: friend class SPECCTRA_DB; @@ -1046,7 +1046,7 @@ public: void AppendVia( const char* aViaName ) { - padstacks.push_back( aViaName ); + m_padstacks.push_back( aViaName ); } void Format( OUTPUTFORMATTER* out, int nestLevel ) override @@ -1054,7 +1054,7 @@ public: const int RIGHTMARGIN = 80; int perLine = out->Print( nestLevel, "(%s", Name() ); - for( STRINGS::iterator i = padstacks.begin(); i != padstacks.end(); ++i ) + for( STRINGS::iterator i = m_padstacks.begin(); i != m_padstacks.end(); ++i ) { if( perLine > RIGHTMARGIN ) { @@ -1066,13 +1066,13 @@ public: perLine += out->Print( 0, " %s%s%s", quote, i->c_str(), quote ); } - if( spares.size() ) + if( m_spares.size() ) { out->Print( 0, "\n" ); perLine = out->Print( nestLevel+1, "(spare" ); - for( STRINGS::iterator i = spares.begin(); i != spares.end(); ++i ) + for( STRINGS::iterator i = m_spares.begin(); i != m_spares.end(); ++i ) { if( perLine > RIGHTMARGIN ) { @@ -1093,8 +1093,8 @@ public: private: friend class SPECCTRA_DB; - STRINGS padstacks; - STRINGS spares; + STRINGS m_padstacks; + STRINGS m_spares; }; @@ -1133,7 +1133,7 @@ public: CLASS_CLASS( ELEM* aParent, DSN_T aType ) : ELEM_HOLDER( aType, aParent ) { - classes = 0; + classes = nullptr; } ~CLASS_CLASS() @@ -1209,7 +1209,7 @@ public: cost = -1; cost_type = -1; - rules = 0; + rules = nullptr; } ~LAYER() @@ -1425,53 +1425,53 @@ public: REGION( ELEM* aParent ) : ELEM_HOLDER( T_region, aParent ) { - rectangle = 0; - polygon = 0; - rules = 0; + m_rectangle = nullptr; + m_polygon = nullptr; + m_rules = nullptr; } ~REGION() { - delete rectangle; - delete polygon; - delete rules; + delete m_rectangle; + delete m_polygon; + delete m_rules; } void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - if( region_id.size() ) + if( m_region_id.size() ) { - const char* quote = out->GetQuoteChar( region_id.c_str() ); - out->Print( nestLevel, "%s%s%s\n", quote, region_id.c_str(), quote ); + const char* quote = out->GetQuoteChar( m_region_id.c_str() ); + out->Print( nestLevel, "%s%s%s\n", quote, m_region_id.c_str(), quote ); } - if( rectangle ) - rectangle->Format( out, nestLevel ); + if( m_rectangle ) + m_rectangle->Format( out, nestLevel ); - if( polygon ) - polygon->Format( out, nestLevel ); + if( m_polygon ) + m_polygon->Format( out, nestLevel ); ELEM_HOLDER::FormatContents( out, nestLevel ); - if( rules ) - rules->Format( out, nestLevel ); + if( m_rules ) + m_rules->Format( out, nestLevel ); } private: friend class SPECCTRA_DB; - std::string region_id; + std::string m_region_id; //------------------------------------------- - RECTANGLE* rectangle; - PATH* polygon; + RECTANGLE* m_rectangle; + PATH* m_polygon; //------------------------------------------ /* region_net | region_class | region_class_class are all mutually exclusive and are put into the kids container. */ - RULE* rules; + RULE* m_rules; }; @@ -1481,30 +1481,30 @@ public: GRID( ELEM* aParent ) : ELEM( T_grid, aParent ) { - grid_type = T_via; - direction = T_NONE; - dimension = 0.0; - offset = 0.0; - image_type = T_NONE; + m_grid_type = T_via; + m_direction = T_NONE; + m_dimension = 0.0; + m_offset = 0.0; + m_image_type = T_NONE; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override { - out->Print( nestLevel, "(%s %s %.6g", Name(), GetTokenText( grid_type ), dimension ); + out->Print( nestLevel, "(%s %s %.6g", Name(), GetTokenText( m_grid_type ), m_dimension ); - if( grid_type == T_place ) + if( m_grid_type == T_place ) { - if( image_type==T_smd || image_type==T_pin ) - out->Print( 0, " (image_type %s)", GetTokenText( image_type ) ); + if( m_image_type == T_smd || m_image_type == T_pin ) + out->Print( 0, " (image_type %s)", GetTokenText( m_image_type ) ); } else { - if( direction==T_x || direction==T_y ) - out->Print( 0, " (direction %s)", GetTokenText( direction ) ); + if( m_direction == T_x || m_direction == T_y ) + out->Print( 0, " (direction %s)", GetTokenText( m_direction ) ); } - if( offset != 0.0 ) - out->Print( 0, " (offset %.6g)", offset ); + if( m_offset != 0.0 ) + out->Print( 0, " (offset %.6g)", m_offset ); out->Print( 0, ")\n"); } @@ -1512,11 +1512,11 @@ public: private: friend class SPECCTRA_DB; - DSN_T grid_type; ///< T_via | T_wire | T_via_keepout | T_place | T_snap - double dimension; - DSN_T direction; ///< T_x | T_y | -1 for both - double offset; - DSN_T image_type; + DSN_T m_grid_type; ///< T_via | T_wire | T_via_keepout | T_place | T_snap + double m_dimension; + DSN_T m_direction; ///< T_x | T_y | -1 for both + double m_offset; + DSN_T m_image_type; }; @@ -1526,28 +1526,28 @@ public: STRUCTURE_OUT( ELEM* aParent ) : ELEM( T_structure_out, aParent ) { - rules = 0; + m_rules = nullptr; } ~STRUCTURE_OUT() { - delete rules; + delete m_rules; } void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - for( LAYERS::iterator i = layers.begin(); i != layers.end(); ++i ) + for( LAYERS::iterator i = m_layers.begin(); i != m_layers.end(); ++i ) i->Format( out, nestLevel ); - if( rules ) - rules->Format( out, nestLevel ); + if( m_rules ) + m_rules->Format( out, nestLevel ); } private: friend class SPECCTRA_DB; - LAYERS layers; - RULE* rules; + LAYERS m_layers; + RULE* m_rules; }; @@ -1557,97 +1557,97 @@ public: STRUCTURE( ELEM* aParent ) : ELEM_HOLDER( T_structure, aParent ) { - unit = 0; - layer_noise_weight = 0; - boundary = 0; - place_boundary = 0; - via = 0; - control = 0; - rules = 0; - place_rules = 0; + m_unit = nullptr; + m_layer_noise_weight = nullptr; + m_boundary = nullptr; + m_place_boundary = nullptr; + m_via = nullptr; + m_control = nullptr; + m_rules = nullptr; + m_place_rules = nullptr; } ~STRUCTURE() { - delete unit; - delete layer_noise_weight; - delete boundary; - delete place_boundary; - delete via; - delete control; - delete rules; - delete place_rules; + delete m_unit; + delete m_layer_noise_weight; + delete m_boundary; + delete m_place_boundary; + delete m_via; + delete m_control; + delete m_rules; + delete m_place_rules; } void SetBOUNDARY( BOUNDARY *aBoundary ) { - delete boundary; - boundary = aBoundary; - if( boundary ) - { - boundary->SetParent( this ); - } + delete m_boundary; + m_boundary = aBoundary; + + if( m_boundary ) + m_boundary->SetParent( this ); } void SetPlaceBOUNDARY( BOUNDARY *aBoundary ) { - delete place_boundary; - place_boundary = aBoundary; - if( place_boundary ) - place_boundary->SetParent( this ); + delete m_place_boundary; + m_place_boundary = aBoundary; + + if( m_place_boundary ) + m_place_boundary->SetParent( this ); } void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - if( unit ) - unit->Format( out, nestLevel ); + if( m_unit ) + m_unit->Format( out, nestLevel ); - for( LAYERS::iterator i=layers.begin(); i!=layers.end(); ++i ) + for( LAYERS::iterator i=m_layers.begin(); i!=m_layers.end(); ++i ) i->Format( out, nestLevel ); - if( layer_noise_weight ) - layer_noise_weight->Format( out, nestLevel ); + if( m_layer_noise_weight ) + m_layer_noise_weight->Format( out, nestLevel ); - if( boundary ) - boundary->Format( out, nestLevel ); + if( m_boundary ) + m_boundary->Format( out, nestLevel ); - if( place_boundary ) - place_boundary->Format( out, nestLevel ); + if( m_place_boundary ) + m_place_boundary->Format( out, nestLevel ); - for( COPPER_PLANES::iterator i=planes.begin(); i!=planes.end(); ++i ) + for( COPPER_PLANES::iterator i=m_planes.begin(); i!=m_planes.end(); ++i ) i->Format( out, nestLevel ); - for( REGIONS::iterator i=regions.begin(); i!=regions.end(); ++i ) + for( REGIONS::iterator i=m_regions.begin(); i!=m_regions.end(); ++i ) i->Format( out, nestLevel ); - for( KEEPOUTS::iterator i=keepouts.begin(); i!=keepouts.end(); ++i ) + for( KEEPOUTS::iterator i=m_keepouts.begin(); i!=m_keepouts.end(); ++i ) i->Format( out, nestLevel ); - if( via ) - via->Format( out, nestLevel ); + if( m_via ) + m_via->Format( out, nestLevel ); - if( control ) - control->Format( out, nestLevel ); + if( m_control ) + m_control->Format( out, nestLevel ); for( int i=0; iFormat( out, nestLevel ); } - if( rules ) - rules->Format( out, nestLevel ); + if( m_rules ) + m_rules->Format( out, nestLevel ); - if( place_rules ) - place_rules->Format( out, nestLevel ); + if( m_place_rules ) + m_place_rules->Format( out, nestLevel ); - for( GRIDS::iterator i=grids.begin(); i!=grids.end(); ++i ) + for( GRIDS::iterator i=m_grids.begin(); i!=m_grids.end(); ++i ) i->Format( out, nestLevel ); } UNIT_RES* GetUnits() const override { - if( unit ) - return unit; + if( m_unit ) + return m_unit; return ELEM::GetUnits(); } @@ -1655,29 +1655,29 @@ public: private: friend class SPECCTRA_DB; - UNIT_RES* unit; + UNIT_RES* m_unit; - LAYERS layers; + LAYERS m_layers; - LAYER_NOISE_WEIGHT* layer_noise_weight; + LAYER_NOISE_WEIGHT* m_layer_noise_weight; - BOUNDARY* boundary; - BOUNDARY* place_boundary; - VIA* via; - CONTROL* control; - RULE* rules; + BOUNDARY* m_boundary; + BOUNDARY* m_place_boundary; + VIA* m_via; + CONTROL* m_control; + RULE* m_rules; - KEEPOUTS keepouts; + KEEPOUTS m_keepouts; - COPPER_PLANES planes; + COPPER_PLANES m_planes; typedef boost::ptr_vector REGIONS; - REGIONS regions; + REGIONS m_regions; - RULE* place_rules; + RULE* m_place_rules; typedef boost::ptr_vector GRIDS; - GRIDS grids; + GRIDS m_grids; }; @@ -1690,39 +1690,39 @@ public: PLACE( ELEM* aParent ) : ELEM( T_place, aParent ) { - side = T_front; + m_side = T_front; - rotation = 0.0; + m_rotation = 0.0; - hasVertex = false; + m_hasVertex = false; - mirror = T_NONE; - status = T_NONE; + m_mirror = T_NONE; + m_status = T_NONE; - place_rules = 0; + m_place_rules = nullptr; - lock_type = T_NONE; - rules = 0; - region = 0; + m_lock_type = T_NONE; + m_rules = nullptr; + m_region = nullptr; } ~PLACE() { - delete place_rules; - delete rules; - delete region; + delete m_place_rules; + delete m_rules; + delete m_region; } void SetVertex( const POINT& aVertex ) { - vertex = aVertex; - vertex.FixNegativeZero(); - hasVertex = true; + m_vertex = aVertex; + m_vertex.FixNegativeZero(); + m_hasVertex = true; } void SetRotation( double aRotation ) { - rotation = aRotation; + m_rotation = aRotation; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override; @@ -1730,32 +1730,32 @@ public: private: friend class SPECCTRA_DB; - std::string component_id; ///< reference designator + std::string m_component_id; ///< reference designator - DSN_T side; + DSN_T m_side; - double rotation; + double m_rotation; - bool hasVertex; - POINT vertex; + bool m_hasVertex; + POINT m_vertex; - DSN_T mirror; - DSN_T status; + DSN_T m_mirror; + DSN_T m_status; - std::string logical_part; + std::string m_logical_part; - RULE* place_rules; + RULE* m_place_rules; - PROPERTIES properties; + PROPERTIES m_properties; - DSN_T lock_type; + DSN_T m_lock_type; //------------------- - RULE* rules; - REGION* region; + RULE* m_rules; + REGION* m_region; //------------------ - std::string part_number; + std::string m_part_number; }; typedef boost::ptr_vector PLACES; @@ -1772,10 +1772,10 @@ public: { } - const std::string& GetImageId() const { return image_id; } + const std::string& GetImageId() const { return m_image_id; } void SetImageId( const std::string& aImageId ) { - image_id = aImageId; + m_image_id = aImageId; } @@ -1786,8 +1786,8 @@ public: void Format( OUTPUTFORMATTER* out, int nestLevel ) override { - const char* quote = out->GetQuoteChar( image_id.c_str() ); - out->Print( nestLevel, "(%s %s%s%s\n", Name(), quote, image_id.c_str(), quote ); + const char* quote = out->GetQuoteChar( m_image_id.c_str() ); + out->Print( nestLevel, "(%s %s%s%s\n", Name(), quote, m_image_id.c_str(), quote ); FormatContents( out, nestLevel+1 ); @@ -1796,17 +1796,17 @@ public: void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - for( PLACES::iterator i=places.begin(); i!=places.end(); ++i ) + for( PLACES::iterator i=m_places.begin(); i!=m_places.end(); ++i ) i->Format( out, nestLevel ); } private: friend class SPECCTRA_DB; -// std::string hash; ///< a hash string used by Compare(), not Format()ed/exported. +// std::string m_hash; ///< a hash string used by Compare(), not Format()ed/exported. - std::string image_id; - PLACES places; + std::string m_image_id; + PLACES m_places; }; typedef boost::ptr_vector COMPONENTS; @@ -1818,13 +1818,13 @@ public: PLACEMENT( ELEM* aParent ) : ELEM( T_placement, aParent ) { - unit = 0; - flip_style = DSN_T( T_NONE ); + m_unit = nullptr; + m_flip_style = DSN_T( T_NONE ); } ~PLACEMENT() { - delete unit; + delete m_unit; } /** @@ -1837,37 +1837,37 @@ public: */ COMPONENT* LookupCOMPONENT( const std::string& imageName ) { - for( unsigned i = 0; i < components.size(); ++i ) + for( unsigned i = 0; i < m_components.size(); ++i ) { - if( 0 == components[i].GetImageId().compare( imageName ) ) - return &components[i]; + if( 0 == m_components[i].GetImageId().compare( imageName ) ) + return &m_components[i]; } COMPONENT* added = new COMPONENT(this); - components.push_back( added ); + m_components.push_back( added ); added->SetImageId( imageName ); return added; } void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - if( unit ) - unit->Format( out, nestLevel ); + if( m_unit ) + m_unit->Format( out, nestLevel ); - if( flip_style != DSN_T( T_NONE ) ) + if( m_flip_style != DSN_T( T_NONE ) ) { out->Print( nestLevel, "(place_control (flip_style %s))\n", - GetTokenText( flip_style ) ); + GetTokenText( m_flip_style ) ); } - for( COMPONENTS::iterator i = components.begin(); i != components.end(); ++i ) + for( COMPONENTS::iterator i = m_components.begin(); i != m_components.end(); ++i ) i->Format( out, nestLevel ); } UNIT_RES* GetUnits() const override { - if( unit ) - return unit; + if( m_unit ) + return m_unit; return ELEM::GetUnits(); } @@ -1875,11 +1875,11 @@ public: private: friend class SPECCTRA_DB; - UNIT_RES* unit; + UNIT_RES* m_unit; - DSN_T flip_style; + DSN_T m_flip_style; - COMPONENTS components; + COMPONENTS m_components; }; @@ -1899,12 +1899,12 @@ public: SHAPE( ELEM* aParent, DSN_T aType = T_shape ) : WINDOW( aParent, aType ) { - connect = T_on; + m_connect = T_on; } void SetConnect( DSN_T aConnect ) { - connect = aConnect; + m_connect = aConnect; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override @@ -1914,14 +1914,14 @@ public: if( shape ) shape->Format( out, 0 ); - if( connect == T_off ) - out->Print( 0, "(connect %s)", GetTokenText( connect ) ); + if( m_connect == T_off ) + out->Print( 0, "(connect %s)", GetTokenText( m_connect ) ); - if( windows.size() ) + if( m_windows.size() ) { out->Print( 0, "\n" ); - for( WINDOWS::iterator i=windows.begin(); i!=windows.end(); ++i ) + for( WINDOWS::iterator i=m_windows.begin(); i!=m_windows.end(); ++i ) i->Format( out, nestLevel+1 ); out->Print( nestLevel, ")\n" ); @@ -1935,7 +1935,7 @@ public: private: friend class SPECCTRA_DB; - DSN_T connect; + DSN_T m_connect; /* ::= [ | @@ -1946,7 +1946,7 @@ private: ELEM* shape; // inherited from WINDOW */ - WINDOWS windows; + WINDOWS m_windows; }; @@ -1956,46 +1956,46 @@ public: PIN( ELEM* aParent ) : ELEM( T_pin, aParent ) { - rotation = 0.0; - isRotated = false; - kiNetCode = 0; + m_rotation = 0.0; + m_isRotated = false; + m_kiNetCode = 0; } void SetRotation( double aRotation ) { - rotation = aRotation; - isRotated = (aRotation != 0.0); + m_rotation = aRotation; + m_isRotated = (aRotation != 0.0); } void SetVertex( const POINT& aPoint ) { - vertex = aPoint; - vertex.FixNegativeZero(); + m_vertex = aPoint; + m_vertex.FixNegativeZero(); } void Format( OUTPUTFORMATTER* out, int nestLevel ) override { - const char* quote = out->GetQuoteChar( padstack_id.c_str() ); - if( isRotated ) - out->Print( nestLevel, "(pin %s%s%s (rotate %.6g)", quote, padstack_id.c_str(), quote, - rotation ); + const char* quote = out->GetQuoteChar( m_padstack_id.c_str() ); + if( m_isRotated ) + out->Print( nestLevel, "(pin %s%s%s (rotate %.6g)", quote, m_padstack_id.c_str(), quote, + m_rotation ); else - out->Print( nestLevel, "(pin %s%s%s", quote, padstack_id.c_str(), quote ); + out->Print( nestLevel, "(pin %s%s%s", quote, m_padstack_id.c_str(), quote ); - quote = out->GetQuoteChar( pin_id.c_str() ); - out->Print( 0, " %s%s%s %.6g %.6g)\n", quote, pin_id.c_str(), quote, vertex.x, vertex.y ); + quote = out->GetQuoteChar( m_pin_id.c_str() ); + out->Print( 0, " %s%s%s %.6g %.6g)\n", quote, m_pin_id.c_str(), quote, m_vertex.x, m_vertex.y ); } private: friend class SPECCTRA_DB; - std::string padstack_id; - double rotation; - bool isRotated; - std::string pin_id; - POINT vertex; + std::string m_padstack_id; + double m_rotation; + bool m_isRotated; + std::string m_pin_id; + POINT m_vertex; - int kiNetCode; ///< KiCad netcode + int m_kiNetCode; ///< KiCad netcode }; typedef boost::ptr_vector PINS; @@ -2009,18 +2009,18 @@ public: IMAGE( ELEM* aParent ) : ELEM_HOLDER( T_image, aParent ) { - side = T_both; - unit = 0; - rules = 0; - place_rules = 0; - duplicated = 0; + m_side = T_both; + m_unit = nullptr; + m_rules = nullptr; + m_place_rules = nullptr; + m_duplicated = 0; } ~IMAGE() { - delete unit; - delete rules; - delete place_rules; + delete m_unit; + delete m_rules; + delete m_place_rules; } /** @@ -2030,18 +2030,18 @@ public: std::string GetImageId() { - if( duplicated ) + if( m_duplicated ) { char buf[32]; - std::string ret = image_id; + std::string ret = m_image_id; ret += "::"; - sprintf( buf, "%d", duplicated ); + sprintf( buf, "%d", m_duplicated ); ret += buf; return ret; } - return image_id; + return m_image_id; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override @@ -2060,34 +2060,34 @@ public: // this is here for makeHash() void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - if( side != T_both ) - out->Print( 0, " (side %s)", GetTokenText( side ) ); + if( m_side != T_both ) + out->Print( 0, " (side %s)", GetTokenText( m_side ) ); out->Print( 0, "\n"); - if( unit ) - unit->Format( out, nestLevel ); + if( m_unit ) + m_unit->Format( out, nestLevel ); // format the kids, which in this class are the shapes ELEM_HOLDER::FormatContents( out, nestLevel ); - for( PINS::iterator i=pins.begin(); i!=pins.end(); ++i ) + for( PINS::iterator i=m_pins.begin(); i!=m_pins.end(); ++i ) i->Format( out, nestLevel ); - if( rules ) - rules->Format( out, nestLevel ); + if( m_rules ) + m_rules->Format( out, nestLevel ); - if( place_rules ) - place_rules->Format( out, nestLevel ); + if( m_place_rules ) + m_place_rules->Format( out, nestLevel ); - for( KEEPOUTS::iterator i=keepouts.begin(); i!=keepouts.end(); ++i ) + for( KEEPOUTS::iterator i=m_keepouts.begin(); i!=m_keepouts.end(); ++i ) i->Format( out, nestLevel ); } UNIT_RES* GetUnits() const override { - if( unit ) - return unit; + if( m_unit ) + return m_unit; return ELEM::GetUnits(); } @@ -2096,25 +2096,25 @@ private: friend class SPECCTRA_DB; friend class LIBRARY; - std::string hash; ///< a hash string used by Compare(), not Format()ed/exported. + std::string m_hash; ///< a hash string used by Compare(), not Format()ed/exported. - std::string image_id; - DSN_T side; - UNIT_RES* unit; + std::string m_image_id; + DSN_T m_side; + UNIT_RES* m_unit; /* The grammar spec says only one outline is supported, but I am seeing *.dsn examples with multiple outlines. So the outlines will go into the kids list. */ - PINS pins; + PINS m_pins; - RULE* rules; - RULE* place_rules; + RULE* m_rules; + RULE* m_place_rules; - KEEPOUTS keepouts; + KEEPOUTS m_keepouts; - int duplicated; ///< no. times this image_id is duplicated + int m_duplicated; ///< no. times this image_id is duplicated }; typedef boost::ptr_vector IMAGES; @@ -2134,10 +2134,10 @@ public: PADSTACK() : ELEM_HOLDER( T_padstack, nullptr ) { - m_unit = 0; + m_unit = nullptr; m_rotate = T_on; m_absolute = T_off; - m_rules = 0; + m_rules = nullptr; m_attach = T_off; } @@ -2260,19 +2260,19 @@ public: LIBRARY( ELEM* aParent, DSN_T aType = T_library ) : ELEM( aType, aParent ) { - unit = 0; + m_unit = nullptr; // via_start_index = -1; // 0 or greater means there is at least one via } ~LIBRARY() { - delete unit; + delete m_unit; } void AddPadstack( PADSTACK* aPadstack ) { aPadstack->SetParent( this ); - padstacks.push_back( aPadstack ); + m_padstacks.push_back( aPadstack ); } /* @@ -2295,9 +2295,9 @@ public: { unsigned i; - for( i=0; iimage_id.compare( images[i].image_id ) ) - aImage->duplicated = dups++; + if( 0 == aImage->m_image_id.compare( m_images[i].m_image_id ) ) + aImage->m_duplicated = dups++; } return -1; @@ -2321,7 +2321,7 @@ public: void AppendIMAGE( IMAGE* aImage ) { aImage->SetParent( this ); - images.push_back( aImage ); + m_images.push_back( aImage ); } /** @@ -2340,7 +2340,7 @@ public: return aImage; } - return &images[ndx]; + return &m_images[ndx]; } /** @@ -2350,9 +2350,9 @@ public: */ int FindVia( PADSTACK* aVia ) { - for( unsigned i = 0; i < vias.size(); ++i ) + for( unsigned i = 0; i < m_vias.size(); ++i ) { - if( 0 == PADSTACK::Compare( aVia, &vias[i] ) ) + if( 0 == PADSTACK::Compare( aVia, &m_vias[i] ) ) return int( i ); } @@ -2365,7 +2365,7 @@ public: void AppendVia( PADSTACK* aVia ) { aVia->SetParent( this ); - vias.push_back( aVia ); + m_vias.push_back( aVia ); } @@ -2375,7 +2375,7 @@ public: void AppendPADSTACK( PADSTACK* aPadstack ) { aPadstack->SetParent( this ); - padstacks.push_back( aPadstack ); + m_padstacks.push_back( aPadstack ); } /** @@ -2394,7 +2394,7 @@ public: return aVia; } - return &vias[ndx]; + return &m_vias[ndx]; } /** @@ -2404,9 +2404,9 @@ public: */ PADSTACK* FindPADSTACK( const std::string& aPadstackId ) { - for( unsigned i = 0; i < padstacks.size(); ++i ) + for( unsigned i = 0; i < m_padstacks.size(); ++i ) { - PADSTACK* ps = &padstacks[i]; + PADSTACK* ps = &m_padstacks[i]; if( ps->GetPadstackId().compare( aPadstackId ) == 0 ) return ps; @@ -2417,23 +2417,23 @@ public: void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - if( unit ) - unit->Format( out, nestLevel ); + if( m_unit ) + m_unit->Format( out, nestLevel ); - for( IMAGES::iterator i = images.begin(); i != images.end(); ++i ) + for( IMAGES::iterator i = m_images.begin(); i != m_images.end(); ++i ) i->Format( out, nestLevel ); - for( PADSTACKS::iterator i = padstacks.begin(); i != padstacks.end(); ++i ) + for( PADSTACKS::iterator i = m_padstacks.begin(); i != m_padstacks.end(); ++i ) i->Format( out, nestLevel ); - for( PADSTACKS::iterator i = vias.begin(); i != vias.end(); ++i ) + for( PADSTACKS::iterator i = m_vias.begin(); i != m_vias.end(); ++i ) i->Format( out, nestLevel ); } UNIT_RES* GetUnits() const override { - if( unit ) - return unit; + if( m_unit ) + return m_unit; return ELEM::GetUnits(); } @@ -2441,11 +2441,11 @@ public: private: friend class SPECCTRA_DB; - UNIT_RES* unit; - IMAGES images; + UNIT_RES* m_unit; + IMAGES m_images; - PADSTACKS padstacks; ///< all except vias, which are in 'vias' - PADSTACKS vias; + PADSTACKS m_padstacks; ///< all except vias, which are in 'vias' + PADSTACKS m_vias; }; @@ -2491,46 +2491,46 @@ public: FROMTO( ELEM* aParent ) : ELEM( T_fromto, aParent ) { - rules = 0; - fromto_type = DSN_T( T_NONE ); + m_rules = nullptr; + m_fromto_type = DSN_T( T_NONE ); } ~FROMTO() { - delete rules; + delete m_rules; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override { // no quoting on these two, the lexer preserved the quotes on input out->Print( nestLevel, "(%s %s %s ", - Name(), fromText.c_str(), toText.c_str() ); + Name(), m_fromText.c_str(), m_toText.c_str() ); - if( fromto_type != DSN_T( T_NONE ) ) - out->Print( 0, "(type %s)", GetTokenText( fromto_type ) ); + if( m_fromto_type != DSN_T( T_NONE ) ) + out->Print( 0, "(type %s)", GetTokenText( m_fromto_type ) ); - if( net_id.size() ) + if( m_net_id.size() ) { - const char* quote = out->GetQuoteChar( net_id.c_str() ); - out->Print( 0, "(net %s%s%s)", quote, net_id.c_str(), quote ); + const char* quote = out->GetQuoteChar( m_net_id.c_str() ); + out->Print( 0, "(net %s%s%s)", quote, m_net_id.c_str(), quote ); } bool singleLine = true; - if( rules || layer_rules.size() ) + if( m_rules || m_layer_rules.size() ) { out->Print( 0, "\n" ); singleLine = false; } - if( rules ) - rules->Format( out, nestLevel+1 ); + if( m_rules ) + m_rules->Format( out, nestLevel+1 ); /* if( circuit.size() ) out->Print( nestLevel, "%s\n", circuit.c_str() ); */ - for( LAYER_RULES::iterator i = layer_rules.begin(); i != layer_rules.end(); ++i ) + for( LAYER_RULES::iterator i = m_layer_rules.begin(); i != m_layer_rules.end(); ++i ) i->Format( out, nestLevel+1 ); out->Print( singleLine ? 0 : nestLevel, ")" ); @@ -2542,14 +2542,14 @@ public: private: friend class SPECCTRA_DB; - std::string fromText; - std::string toText; + std::string m_fromText; + std::string m_toText; - DSN_T fromto_type; - std::string net_id; - RULE* rules; -// std::string circuit; - LAYER_RULES layer_rules; + DSN_T m_fromto_type; + std::string m_net_id; + RULE* m_rules; +// std::string m_circuit; + LAYER_RULES m_layer_rules; }; typedef boost::ptr_vector FROMTOS; @@ -2570,7 +2570,7 @@ public: { out->Print( nestLevel, "(%s", Name() ); - for( STRINGS::iterator i = placement_ids.begin(); i != placement_ids.end(); ++i ) + for( STRINGS::iterator i = m_placement_ids.begin(); i != m_placement_ids.end(); ++i ) { const char* quote = out->GetQuoteChar( i->c_str() ); out->Print( 0, " %s%s%s", quote, i->c_str(), quote ); @@ -2585,7 +2585,7 @@ public: private: friend class SPECCTRA_DB; - STRINGS placement_ids; + STRINGS m_placement_ids; }; typedef boost::ptr_vector COMP_ORDERS; @@ -2599,28 +2599,28 @@ public: NET( ELEM* aParent ) : ELEM( T_net, aParent ) { - unassigned = false; - net_number = T_NONE; - pins_type = T_pins; + m_unassigned = false; + m_net_number = T_NONE; + m_pins_type = T_pins; - type = T_NONE; - supply = T_NONE; + m_type = T_NONE; + m_supply = T_NONE; - rules = 0; - comp_order = 0; + m_rules = nullptr; + m_comp_order = nullptr; } ~NET() { - delete rules; - delete comp_order; + delete m_rules; + delete m_comp_order; } int FindPIN_REF( const std::string& aComponent ) { - for( unsigned i = 0; i < pins.size(); ++i ) + for( unsigned i = 0; i < m_pins.size(); ++i ) { - if( aComponent.compare( pins[i].component_id ) == 0 ) + if( aComponent.compare( m_pins[i].component_id ) == 0 ) return int(i); } @@ -2629,31 +2629,31 @@ public: void Format( OUTPUTFORMATTER* out, int nestLevel ) override { - const char* quote = out->GetQuoteChar( net_id.c_str() ); + const char* quote = out->GetQuoteChar( m_net_id.c_str() ); const char* space = " "; - out->Print( nestLevel, "(%s %s%s%s", Name(), quote, net_id.c_str(), quote ); + out->Print( nestLevel, "(%s %s%s%s", Name(), quote, m_net_id.c_str(), quote ); - if( unassigned ) + if( m_unassigned ) { out->Print( 0, "%s(unassigned)", space ); space = ""; // only needed one space } - if( net_number != T_NONE ) + if( m_net_number != T_NONE ) { - out->Print( 0, "%s(net_number %d)", space, net_number ); + out->Print( 0, "%s(net_number %d)", space, m_net_number ); // space = ""; } out->Print( 0, "\n" ); - if( pins.size() ) + if( m_pins.size() ) { const int RIGHTMARGIN = 80; - int perLine = out->Print( nestLevel+1, "(%s", GetTokenText( pins_type ) ); + int perLine = out->Print( nestLevel+1, "(%s", GetTokenText( m_pins_type ) ); - for( PIN_REFS::iterator i = pins.begin(); i != pins.end(); ++i ) + for( PIN_REFS::iterator i = m_pins.begin(); i != m_pins.end(); ++i ) { if( perLine > RIGHTMARGIN ) { @@ -2671,19 +2671,19 @@ public: out->Print( 0, ")\n" ); } - if( comp_order ) - comp_order->Format( out, nestLevel+1 ); + if( m_comp_order ) + m_comp_order->Format( out, nestLevel+1 ); - if( type != T_NONE ) - out->Print( nestLevel+1, "(type %s)\n", GetTokenText( type ) ); + if( m_type != T_NONE ) + out->Print( nestLevel+1, "(type %s)\n", GetTokenText( m_type ) ); - if( rules ) - rules->Format( out, nestLevel+1 ); + if( m_rules ) + m_rules->Format( out, nestLevel+1 ); - for( LAYER_RULES::iterator i = layer_rules.begin(); i != layer_rules.end(); ++i ) + for( LAYER_RULES::iterator i = m_layer_rules.begin(); i != m_layer_rules.end(); ++i ) i->Format( out, nestLevel+1 ); - for( FROMTOS::iterator i = fromtos.begin(); i != fromtos.end(); ++i ) + for( FROMTOS::iterator i = m_fromtos.begin(); i != m_fromtos.end(); ++i ) i->Format( out, nestLevel+1 ); out->Print( nestLevel, ")\n" ); @@ -2692,30 +2692,30 @@ public: private: friend class SPECCTRA_DB; - std::string net_id; - bool unassigned; - int net_number; + std::string m_net_id; + bool m_unassigned; + int m_net_number; - DSN_T pins_type; ///< T_pins | T_order, type of field 'pins' below - PIN_REFS pins; + DSN_T m_pins_type; ///< T_pins | T_order, type of field 'pins' below + PIN_REFS m_pins; - PIN_REFS expose; - PIN_REFS noexpose; - PIN_REFS source; - PIN_REFS load; - PIN_REFS terminator; + PIN_REFS m_expose; + PIN_REFS m_noexpose; + PIN_REFS m_source; + PIN_REFS m_load; + PIN_REFS m_terminator; - DSN_T type; ///< T_fix | T_normal + DSN_T m_type; ///< T_fix | T_normal - DSN_T supply; ///< T_power | T_ground + DSN_T m_supply; ///< T_power | T_ground - RULE* rules; + RULE* m_rules; - LAYER_RULES layer_rules; + LAYER_RULES m_layer_rules; - FROMTOS fromtos; + FROMTOS m_fromtos; - COMP_ORDER* comp_order; + COMP_ORDER* m_comp_order; }; typedef boost::ptr_vector NETS; @@ -2731,19 +2731,19 @@ public: void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - for( FROMTOS::iterator i = fromtos.begin(); i != fromtos.end(); ++i ) + for( FROMTOS::iterator i = m_fromtos.begin(); i != m_fromtos.end(); ++i ) i->Format( out, nestLevel ); - for( COMP_ORDERS::iterator i = comp_orders.begin(); i != comp_orders.end(); ++i ) + for( COMP_ORDERS::iterator i = m_comp_orders.begin(); i != m_comp_orders.end(); ++i ) i->Format( out, nestLevel ); } private: friend class SPECCTRA_DB; - FROMTOS fromtos; + FROMTOS m_fromtos; - COMP_ORDERS comp_orders; + COMP_ORDERS m_comp_orders; }; @@ -2756,25 +2756,25 @@ public: CLASS( ELEM* aParent ) : ELEM( T_class, aParent ) { - rules = 0; - topology = 0; + m_rules = nullptr; + m_topology = nullptr; } ~CLASS() { - delete rules; - delete topology; + delete m_rules; + delete m_topology; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override { - const char* quote = out->GetQuoteChar( class_id.c_str() ); + const char* quote = out->GetQuoteChar( m_class_id.c_str() ); - int perLine = out->Print( nestLevel, "(%s %s%s%s", Name(), quote, class_id.c_str(), quote ); + int perLine = out->Print( nestLevel, "(%s %s%s%s", Name(), quote, m_class_id.c_str(), quote ); const int RIGHTMARGIN = 72; - for( STRINGS::iterator i=net_ids.begin(); i!=net_ids.end(); ++i ) + for( STRINGS::iterator i=m_net_ids.begin(); i!=m_net_ids.end(); ++i ) { const char* space = " "; @@ -2791,30 +2791,30 @@ public: bool newLine = false; - if( circuit.size() || rules || layer_rules.size() || topology ) + if( m_circuit.size() || m_rules || m_layer_rules.size() || m_topology ) { out->Print( 0, "\n" ); newLine = true; } - if( circuit.size() ) + if( m_circuit.size() ) { out->Print( nestLevel+1, "(circuit\n" ); - for( STRINGS::iterator i = circuit.begin(); i != circuit.end(); ++i ) + for( STRINGS::iterator i = m_circuit.begin(); i != m_circuit.end(); ++i ) out->Print( nestLevel + 2, "%s\n", i->c_str() ); out->Print( nestLevel+1, ")\n" ); } - if( rules ) - rules->Format( out, nestLevel+1 ); + if( m_rules ) + m_rules->Format( out, nestLevel+1 ); - for( LAYER_RULES::iterator i = layer_rules.begin(); i != layer_rules.end(); ++i ) + for( LAYER_RULES::iterator i = m_layer_rules.begin(); i != m_layer_rules.end(); ++i ) i->Format( out, nestLevel + 1 ); - if( topology ) - topology->Format( out, nestLevel+1 ); + if( m_topology ) + m_topology->Format( out, nestLevel+1 ); out->Print( newLine ? nestLevel : 0, ")\n" ); } @@ -2822,18 +2822,18 @@ public: private: friend class SPECCTRA_DB; - std::string class_id; + std::string m_class_id; - STRINGS net_ids; + STRINGS m_net_ids; /// circuit descriptor list - STRINGS circuit; + STRINGS m_circuit; - RULE* rules; + RULE* m_rules; - LAYER_RULES layer_rules; + LAYER_RULES m_layer_rules; - TOPOLOGY* topology; + TOPOLOGY* m_topology; }; typedef boost::ptr_vector CLASSLIST; @@ -2849,18 +2849,18 @@ public: void FormatContents( OUTPUTFORMATTER* out, int nestLevel ) override { - for( NETS::iterator i = nets.begin(); i != nets.end(); ++i ) + for( NETS::iterator i = m_nets.begin(); i != m_nets.end(); ++i ) i->Format( out, nestLevel ); - for( CLASSLIST::iterator i = classes.begin(); i != classes.end(); ++i ) + for( CLASSLIST::iterator i = m_classes.begin(); i != m_classes.end(); ++i ) i->Format( out, nestLevel ); } private: friend class SPECCTRA_DB; - NETS nets; - CLASSLIST classes; + NETS m_nets; + CLASSLIST m_classes; }; @@ -2883,25 +2883,25 @@ public: WIRE( ELEM* aParent ) : ELEM( T_wire, aParent ) { - shape = 0; - connect = 0; + m_shape = nullptr; + m_connect = nullptr; - turret = -1; - wire_type = T_NONE; - attr = T_NONE; - supply = false; + m_turret = -1; + m_wire_type = T_NONE; + m_attr = T_NONE; + m_supply = false; } ~WIRE() { - delete shape; - delete connect; + delete m_shape; + delete m_connect; } void SetShape( ELEM* aShape ) { - delete shape; - shape = aShape; + delete m_shape; + m_shape = aShape; if( aShape ) { @@ -2917,42 +2917,42 @@ public: { out->Print( nestLevel, "(%s ", Name() ); - if( shape ) - shape->Format( out, 0 ); + if( m_shape ) + m_shape->Format( out, 0 ); - if( net_id.size() ) + if( m_net_id.size() ) { - const char* quote = out->GetQuoteChar( net_id.c_str() ); - out->Print( 0, "(net %s%s%s)", quote, net_id.c_str(), quote ); + const char* quote = out->GetQuoteChar( m_net_id.c_str() ); + out->Print( 0, "(net %s%s%s)", quote, m_net_id.c_str(), quote ); } - if( turret >= 0 ) - out->Print( 0, "(turrent %d)", turret ); + if( m_turret >= 0 ) + out->Print( 0, "(turrent %d)", m_turret ); - if( wire_type != T_NONE ) - out->Print( 0, "(type %s)", GetTokenText( wire_type ) ); + if( m_wire_type != T_NONE ) + out->Print( 0, "(type %s)", GetTokenText( m_wire_type ) ); - if( attr != T_NONE ) - out->Print( 0, "(attr %s)", GetTokenText( attr ) ); + if( m_attr != T_NONE ) + out->Print( 0, "(attr %s)", GetTokenText( m_attr ) ); - if( shield.size() ) + if( m_shield.size() ) { - const char* quote = out->GetQuoteChar( shield.c_str() ); - out->Print( 0, "(shield %s%s%s)", quote, shield.c_str(), quote ); + const char* quote = out->GetQuoteChar( m_shield.c_str() ); + out->Print( 0, "(shield %s%s%s)", quote, m_shield.c_str(), quote ); } - if( windows.size() ) + if( m_windows.size() ) { out->Print( 0, "\n" ); - for( WINDOWS::iterator i = windows.begin(); i != windows.end(); ++i ) + for( WINDOWS::iterator i = m_windows.begin(); i != m_windows.end(); ++i ) i->Format( out, nestLevel + 1 ); } - if( connect ) - connect->Format( out, 0 ); + if( m_connect ) + m_connect->Format( out, 0 ); - if( supply ) + if( m_supply ) out->Print( 0, "(supply)" ); out->Print( 0, ")\n" ); @@ -2968,16 +2968,16 @@ private: | ] */ - ELEM* shape; + ELEM* m_shape; - std::string net_id; - int turret; - DSN_T wire_type; - DSN_T attr; - std::string shield; - WINDOWS windows; - CONNECT* connect; - bool supply; + std::string m_net_id; + int m_turret; + DSN_T m_wire_type; + DSN_T m_attr; + std::string m_shield; + WINDOWS m_windows; + CONNECT* m_connect; + bool m_supply; }; typedef boost::ptr_vector WIRES; @@ -2992,26 +2992,26 @@ public: WIRE_VIA( ELEM* aParent ) : ELEM( T_via, aParent ) { - via_number = -1; - via_type = T_NONE; - attr = T_NONE; - supply = false; + m_via_number = -1; + m_via_type = T_NONE; + m_attr = T_NONE; + m_supply = false; } const std::string& GetPadstackId() { - return padstack_id; + return m_padstack_id; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override { - const char* quote = out->GetQuoteChar( padstack_id.c_str() ); + const char* quote = out->GetQuoteChar( m_padstack_id.c_str() ); const int RIGHTMARGIN = 80; - int perLine = out->Print( nestLevel, "(%s %s%s%s", Name(), quote, padstack_id.c_str(), + int perLine = out->Print( nestLevel, "(%s %s%s%s", Name(), quote, m_padstack_id.c_str(), quote ); - for( POINTS::iterator i = vertexes.begin(); i != vertexes.end(); ++i ) + for( POINTS::iterator i = m_vertexes.begin(); i != m_vertexes.end(); ++i ) { if( perLine > RIGHTMARGIN ) { @@ -3026,10 +3026,10 @@ public: perLine += out->Print( 0, "%.6g %.6g", i->x, i->y ); } - if( net_id.size() || via_number!=-1 || via_type!=T_NONE || attr!=T_NONE || supply) + if( m_net_id.size() || m_via_number!=-1 || m_via_type!=T_NONE || m_attr!=T_NONE || m_supply) out->Print( 0, " " ); - if( net_id.size() ) + if( m_net_id.size() ) { if( perLine > RIGHTMARGIN ) { @@ -3037,11 +3037,11 @@ public: perLine = out->Print( nestLevel+1, "%s", "" ); } - quote = out->GetQuoteChar( net_id.c_str() ); - perLine += out->Print( 0, "(net %s%s%s)", quote, net_id.c_str(), quote ); + quote = out->GetQuoteChar( m_net_id.c_str() ); + perLine += out->Print( 0, "(net %s%s%s)", quote, m_net_id.c_str(), quote ); } - if( via_number != -1 ) + if( m_via_number != -1 ) { if( perLine > RIGHTMARGIN ) { @@ -3049,10 +3049,10 @@ public: perLine = out->Print( nestLevel+1, "%s", "" ); } - perLine += out->Print( 0, "(via_number %d)", via_number ); + perLine += out->Print( 0, "(via_number %d)", m_via_number ); } - if( via_type != T_NONE ) + if( m_via_type != T_NONE ) { if( perLine > RIGHTMARGIN ) { @@ -3060,10 +3060,10 @@ public: perLine = out->Print( nestLevel+1, "%s", "" ); } - perLine += out->Print( 0, "(type %s)", GetTokenText( via_type ) ); + perLine += out->Print( 0, "(type %s)", GetTokenText( m_via_type ) ); } - if( attr != T_NONE ) + if( m_attr != T_NONE ) { if( perLine > RIGHTMARGIN ) { @@ -3071,19 +3071,19 @@ public: perLine = out->Print( nestLevel+1, "%s", "" ); } - if( attr == T_virtual_pin ) + if( m_attr == T_virtual_pin ) { - quote = out->GetQuoteChar( virtual_pin_name.c_str() ); + quote = out->GetQuoteChar( m_virtual_pin_name.c_str() ); perLine += out->Print( 0, "(attr virtual_pin %s%s%s)", quote, - virtual_pin_name.c_str(), quote ); + m_virtual_pin_name.c_str(), quote ); } else { - perLine += out->Print( 0, "(attr %s)", GetTokenText( attr ) ); + perLine += out->Print( 0, "(attr %s)", GetTokenText( m_attr ) ); } } - if( supply ) + if( m_supply ) { if( perLine > RIGHTMARGIN ) { @@ -3094,12 +3094,12 @@ public: perLine += out->Print( 0, "(supply)" ); } - if( contact_layers.size() ) + if( m_contact_layers.size() ) { out->Print( 0, "\n" ); out->Print( nestLevel+1, "(contact\n" ); - for( STRINGS::iterator i = contact_layers.begin(); i != contact_layers.end(); ++i ) + for( STRINGS::iterator i = m_contact_layers.begin(); i != m_contact_layers.end(); ++i ) { quote = out->GetQuoteChar( i->c_str() ); out->Print( nestLevel+2, "%s%s%s\n", quote, i->c_str(), quote ); @@ -3116,15 +3116,15 @@ public: private: friend class SPECCTRA_DB; - std::string padstack_id; - POINTS vertexes; - std::string net_id; - int via_number; - DSN_T via_type; - DSN_T attr; - std::string virtual_pin_name; - STRINGS contact_layers; - bool supply; + std::string m_padstack_id; + POINTS m_vertexes; + std::string m_net_id; + int m_via_number; + DSN_T m_via_type; + DSN_T m_attr; + std::string m_virtual_pin_name; + STRINGS m_contact_layers; + bool m_supply; }; typedef boost::ptr_vector WIRE_VIAS; @@ -3139,7 +3139,7 @@ public: WIRING( ELEM* aParent ) : ELEM( T_wiring, aParent ) { - unit = 0; + unit = nullptr; } ~WIRING() @@ -3179,71 +3179,71 @@ private: class PCB : public ELEM { public: - PCB( ELEM* aParent = 0 ) : + PCB( ELEM* aParent = nullptr ) : ELEM( T_pcb, aParent ) { - parser = 0; - resolution = 0; - unit = 0; - structure = 0; - placement = 0; - library = 0; - network = 0; - wiring = 0; + m_parser = nullptr; + m_resolution = nullptr; + m_unit = nullptr; + m_structure = nullptr; + m_placement = nullptr; + m_library = nullptr; + m_network = nullptr; + m_wiring = nullptr; } ~PCB() { - delete parser; - delete resolution; - delete unit; - delete structure; - delete placement; - delete library; - delete network; - delete wiring; + delete m_parser; + delete m_resolution; + delete m_unit; + delete m_structure; + delete m_placement; + delete m_library; + delete m_network; + delete m_wiring; } void Format( OUTPUTFORMATTER* out, int nestLevel ) override { - const char* quote = out->GetQuoteChar( pcbname.c_str() ); + const char* quote = out->GetQuoteChar( m_pcbname.c_str() ); - out->Print( nestLevel, "(%s %s%s%s\n", Name(), quote, pcbname.c_str(), quote ); + out->Print( nestLevel, "(%s %s%s%s\n", Name(), quote, m_pcbname.c_str(), quote ); - if( parser ) - parser->Format( out, nestLevel+1 ); + if( m_parser ) + m_parser->Format( out, nestLevel+1 ); - if( resolution ) - resolution->Format( out, nestLevel+1 ); + if( m_resolution ) + m_resolution->Format( out, nestLevel+1 ); - if( unit ) - unit->Format( out, nestLevel+1 ); + if( m_unit ) + m_unit->Format( out, nestLevel+1 ); - if( structure ) - structure->Format( out, nestLevel+1 ); + if( m_structure ) + m_structure->Format( out, nestLevel+1 ); - if( placement ) - placement->Format( out, nestLevel+1 ); + if( m_placement ) + m_placement->Format( out, nestLevel+1 ); - if( library ) - library->Format( out, nestLevel+1 ); + if( m_library ) + m_library->Format( out, nestLevel+1 ); - if( network ) - network->Format( out, nestLevel+1 ); + if( m_network ) + m_network->Format( out, nestLevel+1 ); - if( wiring ) - wiring->Format( out, nestLevel+1 ); + if( m_wiring ) + m_wiring->Format( out, nestLevel+1 ); out->Print( nestLevel, ")\n" ); } UNIT_RES* GetUnits() const override { - if( unit ) - return unit; + if( m_unit ) + return m_unit; - if( resolution ) - return resolution->GetUnits(); + if( m_resolution ) + return m_resolution->GetUnits(); return ELEM::GetUnits(); } @@ -3251,15 +3251,15 @@ public: private: friend class SPECCTRA_DB; - std::string pcbname; - PARSER* parser; - UNIT_RES* resolution; - UNIT_RES* unit; - STRUCTURE* structure; - PLACEMENT* placement; - LIBRARY* library; - NETWORK* network; - WIRING* wiring; + std::string m_pcbname; + PARSER* m_parser; + UNIT_RES* m_resolution; + UNIT_RES* m_unit; + STRUCTURE* m_structure; + PLACEMENT* m_placement; + LIBRARY* m_library; + NETWORK* m_network; + WIRING* m_wiring; }; @@ -3403,7 +3403,7 @@ public: NET_OUT( ELEM* aParent ) : ELEM( T_net_out, aParent ) { - rules = 0; + rules = nullptr; net_number = -1; } @@ -3457,10 +3457,10 @@ public: ROUTE( ELEM* aParent ) : ELEM( T_route, aParent ) { - resolution = 0; - parser = 0; - structure_out = 0; - library = 0; + resolution = nullptr; + parser = nullptr; + structure_out = nullptr; + library = nullptr; } ~ROUTE() @@ -3526,7 +3526,7 @@ private: */ struct PIN_PAIR { - PIN_PAIR( ELEM* aParent = 0 ) : + PIN_PAIR( ELEM* aParent = nullptr ) : was( aParent ), is( aParent ) { @@ -3575,14 +3575,14 @@ private: class SESSION : public ELEM { public: - SESSION( ELEM* aParent = 0 ) : + SESSION( ELEM* aParent = nullptr ) : ELEM( T_session, aParent ) { - history = 0; - structure = 0; - placement = 0; - was_is = 0; - route = 0; + history = nullptr; + structure = nullptr; + placement = nullptr; + was_is = nullptr; + route = nullptr; } ~SESSION() @@ -3655,8 +3655,8 @@ public: // we don't own it: wxASSERT( !iOwnReaders ); - m_pcb = 0; - m_session = 0; + m_pcb = nullptr; + m_session = nullptr; m_quote_char += '"'; m_footprintsAreFlipped = false; @@ -3915,7 +3915,7 @@ private: * * @param aBoard The owner of the PAD's footprint. * @param aPad The PAD which needs to be made into a PADSTACK. - * @return The created padstack, including its padstack_id. + * @return The created padstack, including its m_padstack_id. */ PADSTACK* makePADSTACK( BOARD* aBoard, PAD* aPad ); diff --git a/pcbnew/specctra_import_export/specctra_export.cpp b/pcbnew/specctra_import_export/specctra_export.cpp index e15d4641a7..1ea4c0da0b 100644 --- a/pcbnew/specctra_import_export/specctra_export.cpp +++ b/pcbnew/specctra_import_export/specctra_export.cpp @@ -228,7 +228,7 @@ static bool isRoundKeepout( PAD* aPad ) */ static PATH* makePath( const POINT& aStart, const POINT& aEnd, const std::string& aLayerName ) { - PATH* path = new PATH( 0, T_path ); + PATH* path = new PATH( nullptr, T_path ); path->AppendPoint( aStart ); path->AppendPoint( aEnd ); @@ -614,9 +614,9 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, FOOTPRINT* aFootprint ) // get all the FOOTPRINT's pads. fpItems.Collect( aFootprint, { PCB_PAD_T } ); - IMAGE* image = new IMAGE( 0 ); + IMAGE* image = new IMAGE( nullptr ); - image->image_id = aFootprint->GetFPID().Format().c_str(); + image->m_image_id = aFootprint->GetFPID().Format().c_str(); // from the pads, and make an IMAGE using collated padstacks. for( int p = 0; p < fpItems.GetCount(); ++p ) @@ -637,7 +637,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, FOOTPRINT* aFootprint ) { KEEPOUT* keepout = new KEEPOUT( image, T_keepout ); - image->keepouts.push_back( keepout ); + image->m_keepouts.push_back( keepout ); CIRCLE* circle = new CIRCLE( keepout ); @@ -674,7 +674,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, FOOTPRINT* aFootprint ) PIN* pin = new PIN( image ); padNumber = pad->GetNumber(); - pin->pin_id = TO_UTF8( padNumber ); + pin->m_pin_id = TO_UTF8( padNumber ); if( padNumber != wxEmptyString && pinmap.find( padNumber ) == pinmap.end() ) { @@ -687,14 +687,14 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, FOOTPRINT* aFootprint ) sprintf( buf, "@%d", duplicates ); - pin->pin_id += buf; // append "@1" or "@2", etc. to pin name + pin->m_pin_id += buf; // append "@1" or "@2", etc. to pin name } - pin->kiNetCode = pad->GetNetCode(); + pin->m_kiNetCode = pad->GetNetCode(); - image->pins.push_back( pin ); + image->m_pins.push_back( pin ); - pin->padstack_id = padstack->m_padstack_id; + pin->m_padstack_id = padstack->m_padstack_id; EDA_ANGLE angle = pad->GetOrientation() - aFootprint->GetOrientation(); pin->SetRotation( angle.Normalize().AsDegrees() ); @@ -904,8 +904,8 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, FOOTPRINT* aFootprint ) if( !zone->IsOnLayer( PCB_LAYER_ID( layer ) ) ) continue; - KEEPOUT* keepout = new KEEPOUT( m_pcb->structure, keepout_type ); - image->keepouts.push_back( keepout ); + KEEPOUT* keepout = new KEEPOUT( m_pcb->m_structure, keepout_type ); + image->m_keepouts.push_back( keepout ); PATH* mainPolygon = new PATH( keepout, T_polygon ); keepout->SetShape( mainPolygon ); @@ -1066,7 +1066,7 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) keepout->SetShape( poly_ko ); poly_ko->SetLayerId( "signal" ); - m_pcb->structure->keepouts.push_back( keepout ); + m_pcb->m_structure->m_keepouts.push_back( keepout ); SHAPE_LINE_CHAIN& hole = m_brd_outlines.Hole( cnt, ii ); @@ -1132,9 +1132,9 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) for( int pcbNdx=0; pcbNdxstructure ); + LAYER* layer = new LAYER( m_pcb->m_structure ); - m_pcb->structure->layers.push_back( layer ); + m_pcb->m_structure->m_layers.push_back( layer ); layer->name = m_layerIds[pcbNdx]; @@ -1164,25 +1164,25 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) } // a space in a quoted token is NOT a terminator, true establishes this. - m_pcb->parser->space_in_quoted_tokens = true; + m_pcb->m_parser->space_in_quoted_tokens = true; //----- & -------------------- { // Tell freerouter to use "tenths of micrometers", which is 100 nm resolution. Possibly // more resolution is possible in freerouter, but it would need testing. - m_pcb->unit->units = T_um; - m_pcb->resolution->units = T_um; - m_pcb->resolution->value = 10; // tenths of a um + m_pcb->m_unit->units = T_um; + m_pcb->m_resolution->units = T_um; + m_pcb->m_resolution->value = 10; // tenths of a um } //----------------------------------------------- { // Because fillBOUNDARY() can throw an exception, we link in an empty boundary so the // BOUNDARY does not get lost in the event of of an exception. - BOUNDARY* boundary = new BOUNDARY( 0 ); + BOUNDARY* boundary = new BOUNDARY( nullptr ); - m_pcb->structure->SetBOUNDARY( boundary ); + m_pcb->m_structure->SetBOUNDARY( boundary ); fillBOUNDARY( aBoard, boundary ); } @@ -1193,7 +1193,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) int defaultClearance = netSettings->m_DefaultNetClass->GetClearance(); double clearance = scale( defaultClearance ); - STRINGS& rules = m_pcb->structure->rules->rules; + STRINGS& rules = m_pcb->m_structure->m_rules->m_rules; sprintf( rule, "(width %.6g)", scale( defaultTrackWidth ) ); rules.push_back( rule ); @@ -1251,31 +1251,31 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) if( !zone->IsOnLayer( PCB_LAYER_ID( layer ) ) ) continue; - COPPER_PLANE* plane = new COPPER_PLANE( m_pcb->structure ); + COPPER_PLANE* plane = new COPPER_PLANE( m_pcb->m_structure ); - m_pcb->structure->planes.push_back( plane ); + m_pcb->m_structure->m_planes.push_back( plane ); PATH* mainPolygon = new PATH( plane, T_polygon ); plane->SetShape( mainPolygon ); - plane->name = TO_UTF8( zone->GetNetname() ); + plane->m_name = TO_UTF8( zone->GetNetname() ); - if( plane->name.size() == 0 ) + if( plane->m_name.size() == 0 ) { char name[32]; // This is one of those no connection zones, netcode=0, and it has no name. // Create a unique, bogus netname. - NET* no_net = new NET( m_pcb->network ); + NET* no_net = new NET( m_pcb->m_network ); sprintf( name, "@:no_net_%d", netlessZones++ ); - no_net->net_id = name; + no_net->m_net_id = name; // add the bogus net name to network->nets. - m_pcb->network->nets.push_back( no_net ); + m_pcb->m_network->m_nets.push_back( no_net ); // use the bogus net name in the netless zone. - plane->name = no_net->net_id; + plane->m_name = no_net->m_net_id; } mainPolygon->layer_id = m_layerIds[ m_kicadLayer2pcb[ layer ] ]; @@ -1306,8 +1306,8 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) } } - WINDOW* window = 0; - PATH* cutout = 0; + WINDOW* window = nullptr; + PATH* cutout = nullptr; bool isStartContour = true; @@ -1383,8 +1383,8 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) if( !zone->IsOnLayer( PCB_LAYER_ID( layer ) ) ) continue; - KEEPOUT* keepout = new KEEPOUT( m_pcb->structure, keepout_type ); - m_pcb->structure->keepouts.push_back( keepout ); + KEEPOUT* keepout = new KEEPOUT( m_pcb->m_structure, keepout_type ); + m_pcb->m_structure->m_keepouts.push_back( keepout ); PATH* mainPolygon = new PATH( keepout, T_polygon ); keepout->SetShape( mainPolygon ); @@ -1460,7 +1460,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) //---------------------------- { - PIN_REF empty( m_pcb->network ); + PIN_REF empty( m_pcb->m_network ); std::string componentId; int highestNetCode = 0; NETINFO_LIST& netInfo = aBoard->GetNetInfo(); @@ -1475,12 +1475,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) m_nets.resize( highestNetCode + 1, nullptr ); for( unsigned i = 1 /* skip "No Net" at [0] */; i < m_nets.size(); ++i ) - m_nets[i] = new NET( m_pcb->network ); + m_nets[i] = new NET( m_pcb->m_network ); for( NETINFO_LIST::iterator i = netInfo.begin(); i != netInfo.end(); ++i ) { if( i->GetNetCode() > 0 ) - m_nets[i->GetNetCode()]->net_id = TO_UTF8( i->GetNetname() ); + m_nets[i->GetNetCode()]->m_net_id = TO_UTF8( i->GetNetname() ); } m_padstackset.clear(); @@ -1497,25 +1497,25 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) // necessarily long. The exported netlist will have some fabricated pin names in it. // If you don't like fabricated pin names, then make sure all pads within your // FOOTPRINTs are uniquely named! - for( unsigned p = 0; p < image->pins.size(); ++p ) + for( unsigned p = 0; p < image->m_pins.size(); ++p ) { - PIN* pin = &image->pins[p]; - int netcode = pin->kiNetCode; + PIN* pin = &image->m_pins[p]; + int netcode = pin->m_kiNetCode; if( netcode > 0 ) { NET* net = m_nets[netcode]; - net->pins.push_back( empty ); + net->m_pins.push_back( empty ); - PIN_REF& pin_ref = net->pins.back(); + PIN_REF& pin_ref = net->m_pins.back(); pin_ref.component_id = componentId; - pin_ref.pin_id = pin->pin_id; + pin_ref.pin_id = pin->m_pin_id; } } - IMAGE* registered = m_pcb->library->LookupIMAGE( image ); + IMAGE* registered = m_pcb->m_library->LookupIMAGE( image ); if( registered != image ) { @@ -1525,15 +1525,15 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) image = registered; } - COMPONENT* comp = m_pcb->placement->LookupCOMPONENT( image->GetImageId() ); + COMPONENT* comp = m_pcb->m_placement->LookupCOMPONENT( image->GetImageId() ); PLACE* place = new PLACE( comp ); - comp->places.push_back( place ); + comp->m_places.push_back( place ); place->SetRotation( footprint->GetOrientationDegrees() ); place->SetVertex( mapPt( footprint->GetPosition() ) ); - place->component_id = componentId; - place->part_number = TO_UTF8( footprint->GetValue() ); + place->m_component_id = componentId; + place->m_part_number = TO_UTF8( footprint->GetValue() ); // footprint is flipped from bottom side, set side to T_back if( footprint->GetFlag() ) @@ -1541,7 +1541,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) EDA_ANGLE angle = ANGLE_180 - footprint->GetOrientation(); place->SetRotation( angle.Normalize().AsDegrees() ); - place->side = T_back; + place->m_side = T_back; } } @@ -1553,7 +1553,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) PADSTACKSET::auto_type ps = m_padstackset.release( i ); PADSTACK* padstack = ps.release(); - m_pcb->library->AddPadstack( padstack ); + m_pcb->m_library->AddPadstack( padstack ); } // copy our SPECCTRA_DB::nets to the pcb->network @@ -1561,11 +1561,11 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) { NET* net = m_nets[n]; - if( net->pins.size() ) + if( net->m_pins.size() ) { // give ownership to pcb->network - m_pcb->network->nets.push_back( net ); - m_nets[n] = 0; + m_pcb->m_network->m_nets.push_back( net ); + m_nets[n] = nullptr; } } } @@ -1589,8 +1589,8 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) // we AppendVia() this first one, there is no way it can be a duplicate, // the pcb->library via container is empty at this point. After this, // we'll have to use LookupVia(). - wxASSERT( m_pcb->library->vias.size() == 0 ); - m_pcb->library->AppendVia( via ); + wxASSERT( m_pcb->m_library->m_vias.size() == 0 ); + m_pcb->m_library->AppendVia( via ); // set the "spare via" index at the start of the // pcb->library->spareViaIndex = pcb->library->vias.size(); @@ -1602,7 +1602,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) m_top_via_layer, m_bot_via_layer ); // maybe add 'via' to the library, but only if unique. - PADSTACK* registered = m_pcb->library->LookupVia( via ); + PADSTACK* registered = m_pcb->m_library->LookupVia( via ); if( registered != via ) delete via; @@ -1613,8 +1613,8 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) { // export all of them for now, later we'll decide what controls we need on this. std::string netname; - WIRING* wiring = m_pcb->wiring; - PATH* path = 0; + WIRING* wiring = m_pcb->m_wiring; + PATH* path = nullptr; int old_netcode = -1; int old_width = -1; @@ -1649,12 +1649,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) WIRE* wire = new WIRE( wiring ); wiring->wires.push_back( wire ); - wire->net_id = netname; + wire->m_net_id = netname; if( track->IsLocked() ) - wire->wire_type = T_fix; // tracks with fix property are not returned in .ses files + wire->m_wire_type = T_fix; // tracks with fix property are not returned in .ses files else - wire->wire_type = T_route; // could be T_protect + wire->m_wire_type = T_route; // could be T_protect int kiLayer = track->GetLayer(); int pcbLayer = m_kicadLayer2pcb[kiLayer]; @@ -1686,29 +1686,29 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) continue; PADSTACK* padstack = makeVia( via ); - PADSTACK* registered = m_pcb->library->LookupVia( padstack ); + PADSTACK* registered = m_pcb->m_library->LookupVia( padstack ); // if the one looked up is not our padstack, then delete our padstack // since it was a duplicate of one already registered. if( padstack != registered ) delete padstack; - WIRE_VIA* dsnVia = new WIRE_VIA( m_pcb->wiring ); + WIRE_VIA* dsnVia = new WIRE_VIA( m_pcb->m_wiring ); - m_pcb->wiring->wire_vias.push_back( dsnVia ); + m_pcb->m_wiring->wire_vias.push_back( dsnVia ); - dsnVia->padstack_id = registered->m_padstack_id; - dsnVia->vertexes.push_back( mapPt( via->GetPosition() ) ); + dsnVia->m_padstack_id = registered->m_padstack_id; + dsnVia->m_vertexes.push_back( mapPt( via->GetPosition() ) ); NETINFO_ITEM* net = aBoard->FindNet( netcode ); wxASSERT( net ); - dsnVia->net_id = TO_UTF8( net->GetNetname() ); + dsnVia->m_net_id = TO_UTF8( net->GetNetname() ); if( via->IsLocked() ) - dsnVia->via_type = T_fix; // vias with fix property are not returned in .ses files + dsnVia->m_via_type = T_fix; // vias with fix property are not returned in .ses files else - dsnVia->via_type = T_route; // could be T_protect + dsnVia->m_via_type = T_route; // could be T_protect } } @@ -1720,10 +1720,10 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) // Output the vias in the padstack list here, by name only. This must be done after // exporting existing vias as WIRE_VIAs. - VIA* vias = m_pcb->structure->via; + VIA* vias = m_pcb->m_structure->m_via; - for( unsigned viaNdx = 0; viaNdx < m_pcb->library->vias.size(); ++viaNdx ) - vias->AppendVia( m_pcb->library->vias[viaNdx].m_padstack_id.c_str() ); + for( unsigned viaNdx = 0; viaNdx < m_pcb->m_library->m_vias.size(); ++viaNdx ) + vias->AppendVia( m_pcb->m_library->m_vias[viaNdx].m_padstack_id.c_str() ); } //--------------------------------------------------------- @@ -1767,34 +1767,34 @@ void SPECCTRA_DB::exportNETCLASS( const std::shared_ptr& aNetClass, BO char text[256]; - CLASS* clazz = new CLASS( m_pcb->network ); + CLASS* clazz = new CLASS( m_pcb->m_network ); - m_pcb->network->classes.push_back( clazz ); + m_pcb->m_network->m_classes.push_back( clazz ); // Freerouter creates a class named 'default' anyway, and if we try to use that we end up // with two 'default' via rules so use something else as the name of our default class. - clazz->class_id = TO_UTF8( aNetClass->GetName() ); + clazz->m_class_id = TO_UTF8( aNetClass->GetName() ); for( NETINFO_ITEM* net : aBoard->GetNetInfo() ) { - if( net->GetNetClass()->GetName() == clazz->class_id ) - clazz->net_ids.push_back( TO_UTF8( net->GetNetname() ) ); + if( net->GetNetClass()->GetName() == clazz->m_class_id ) + clazz->m_net_ids.push_back( TO_UTF8( net->GetNetname() ) ); } - clazz->rules = new RULE( clazz, T_rule ); + clazz->m_rules = new RULE( clazz, T_rule ); // output the track width. int trackWidth = aNetClass->GetTrackWidth(); sprintf( text, "(width %.6g)", scale( trackWidth ) ); - clazz->rules->rules.push_back( text ); + clazz->m_rules->m_rules.push_back( text ); // output the clearance. int clearance = aNetClass->GetClearance(); sprintf( text, "(clearance %.6g)", scale( clearance ) + safetyMargin ); - clazz->rules->rules.push_back( text ); + clazz->m_rules->m_rules.push_back( text ); if( aNetClass->GetName() == NETCLASS::Default ) - clazz->class_id = "kicad_default"; + clazz->m_class_id = "kicad_default"; // The easiest way to get the via name is to create a temporary via (which generates the // name internal to the PADSTACK), and then grab the name and delete the via. There are not @@ -1804,7 +1804,7 @@ void SPECCTRA_DB::exportNETCLASS( const std::shared_ptr& aNetClass, BO m_top_via_layer, m_bot_via_layer ); snprintf( text, sizeof(text), "(use_via %s)", via->GetPadstackId().c_str() ); - clazz->circuit.push_back( text ); + clazz->m_circuit.push_back( text ); delete via; } diff --git a/pcbnew/specctra_import_export/specctra_import.cpp b/pcbnew/specctra_import_export/specctra_import.cpp index 96faa66044..7804fd4724 100644 --- a/pcbnew/specctra_import_export/specctra_import.cpp +++ b/pcbnew/specctra_import_export/specctra_import.cpp @@ -173,7 +173,7 @@ PCB_TRACK* SPECCTRA_DB::makeTRACK( WIRE* wire, PATH* aPath, int aPointIndex, int // wire->wire_type = T_fix, T_route, T_normal or T_protect // fix and protect could be used as lock option // but protect is returned for all tracks having initially the route or protect property - if( wire->wire_type == T_fix ) + if( wire->m_wire_type == T_fix ) track->SetLocked( true ); return track; @@ -183,7 +183,7 @@ PCB_TRACK* SPECCTRA_DB::makeTRACK( WIRE* wire, PATH* aPath, int aPointIndex, int PCB_VIA* SPECCTRA_DB::makeVIA( WIRE_VIA*aVia, PADSTACK* aPadstack, const POINT& aPoint, int aNetCode, int aViaDrillDefault ) { - PCB_VIA* via = 0; + PCB_VIA* via = nullptr; SHAPE* shape; int shapeCount = aPadstack->Length(); int drill_diam_iu = -1; @@ -324,7 +324,7 @@ PCB_VIA* SPECCTRA_DB::makeVIA( WIRE_VIA*aVia, PADSTACK* aPadstack, const POINT& // aVia->via_type = T_fix, T_route, T_normal or T_protect // fix and protect could be used as lock option // but protect is returned for all tracks having initially the route or protect property - if( aVia->via_type == T_fix ) + if( aVia->m_via_type == T_fix ) via->SetLocked( true ); return via; @@ -375,16 +375,16 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) // Walk the PLACEMENT object's COMPONENTs list, and for each PLACE within // each COMPONENT, reposition and re-orient each component and put on // correct side of the board. - COMPONENTS& components = m_session->placement->components; + COMPONENTS& components = m_session->placement->m_components; for( COMPONENTS::iterator comp=components.begin(); comp!=components.end(); ++comp ) { - PLACES& places = comp->places; + PLACES& places = comp->m_places; for( unsigned i=0; icomponent_id.c_str() ); + wxString reference = FROM_UTF8( place->m_component_id.c_str() ); FOOTPRINT* footprint = aBoard->FindFootprintByReference( reference ); if( !footprint ) @@ -393,19 +393,19 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) reference ) ); } - if( !place->hasVertex ) + if( !place->m_hasVertex ) continue; UNIT_RES* resolution = place->GetUnits(); wxASSERT( resolution ); - VECTOR2I newPos = mapPt( place->vertex, resolution ); + VECTOR2I newPos = mapPt( place->m_vertex, resolution ); footprint->SetPosition( newPos ); - if( place->side == T_front ) + if( place->m_side == T_front ) { // convert from degrees to tenths of degrees used in KiCad. - EDA_ANGLE orientation( place->rotation, DEGREES_T ); + EDA_ANGLE orientation( place->m_rotation, DEGREES_T ); if( footprint->GetLayer() != F_Cu ) { @@ -415,9 +415,9 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) footprint->SetOrientation( orientation ); } - else if( place->side == T_back ) + else if( place->m_side == T_back ) { - EDA_ANGLE orientation( place->rotation + 180.0, DEGREES_T ); + EDA_ANGLE orientation( place->m_rotation + 180.0, DEGREES_T ); if( footprint->GetLayer() != B_Cu ) { @@ -458,7 +458,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) for( unsigned i = 0; ishape->Type(); + DSN_T shape = wire->m_shape->Type(); if( shape != T_path ) { @@ -476,7 +476,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) } else { - PATH* path = (PATH*) wire->shape; + PATH* path = (PATH*) wire->m_shape; for( unsigned pt=0; pt < path->points.size()-1; ++pt ) { @@ -526,9 +526,9 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) int via_drill_default = netSettings->m_DefaultNetClass->GetViaDrill(); - for( unsigned v = 0; v < wire_via->vertexes.size(); ++v ) + for( unsigned v = 0; v < wire_via->m_vertexes.size(); ++v ) { - PCB_VIA* via = makeVIA( wire_via, padstack, wire_via->vertexes[v], netCode, + PCB_VIA* via = makeVIA( wire_via, padstack, wire_via->m_vertexes[v], netCode, via_drill_default ); aBoard->Add( via ); }