kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #14884
Re: Track copy - to be or not to be… I'm panelizing, python coder.
On 10/1/2014 2:42 PM, Daniel Dawid Majewski wrote:
> On 01.10.2014 16:25, Wayne Stambaugh wrote:
>> They do. It is automatically generated by the compiler just like the
>> source code comment explains. Unless you need some special copy
>> semantics (not just a direct copy of every class member which is what
>> the compiler will generate), you do not need to write your own copy
>> constructor.
> Ok, so where are nested following python methods ?:
> Copy(MODULE self, MODULE src)
> Copy(ZONE_CONTAINER self, ZONE_CONTAINER src)
> How I could make ?:
> Copy(TRACK self, TRACK src)
> Copy(VIA self, VIA src)
>
> Searching for
> regex:'\bCopy\b.*\b((ZONE_CONTAINER)|(MODULE)|(TEXTE_PCB)|(DIMENSION)|(TEXTE_MODULE)|(DRAWSEGMENT)|(MARKER_PCB)|(BOARD)|(EDGE_MODULE)|(D_PAD)|(TRACK)|(VIA))\b'...
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_zone.h':
> 112: void Copy( ZONE_CONTAINER* src );
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_zone.cpp':
> 799:void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_text_mod.h':
> 122: void Copy( TEXTE_MODULE* source ); // copy structure
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_text_mod.cpp':
> 148:void TEXTE_MODULE::Copy( TEXTE_MODULE* source )
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_pcb_text.h':
> 72: void Copy( TEXTE_PCB* source );
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_pcb_text.cpp':
> 62:void TEXTE_PCB::Copy( TEXTE_PCB* source )
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_pad.h':
> 97: void Copy( D_PAD* source );
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_pad.cpp':
> 411:void D_PAD::Copy( D_PAD* source )
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_module.h':
> 88: void Copy( MODULE* Module ); // Copy structure
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_module.cpp':
> 199:void MODULE::Copy( MODULE* aModule )
> 247: textm->Copy( static_cast<TEXTE_MODULE*>( item ) );
> 256: edge->Copy( (EDGE_MODULE*) item );
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_edge_mod.h':
> 62: void Copy( EDGE_MODULE* source ); // copy structure
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_edge_mod.cpp':
> 83:void EDGE_MODULE::Copy( EDGE_MODULE* source )
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_drawsegment.h':
> 173: void Copy( DRAWSEGMENT* source );
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_drawsegment.cpp':
> 87:void DRAWSEGMENT::Copy( DRAWSEGMENT* source )
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_dimension.h':
> 185: void Copy( DIMENSION* source );
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/class_dimension.cpp':
> 91:void DIMENSION::Copy( DIMENSION* source )
> In:'~/rpm/BUILD/kicad-sources-BZR.5158-main/pcbnew/board_undo_redo.cpp':
> 198: ( (MODULE*) aImage )->Copy( (MODULE*) this );
> 207: ( (ZONE_CONTAINER*) aImage )->Copy( (ZONE_CONTAINER*) this );
>
You would have to ask the folks that wrote the python scripting module.
I cannot answer that question. However, it should be possible to use
the default C++ copy constructor to create the python copy code.
References