Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
fe13569b
Commit
fe13569b
authored
Sep 11, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix TRACK::Copy() usage
parent
4173f9b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
class_track.cpp
pcbnew/class_track.cpp
+17
-13
No files found.
pcbnew/class_track.cpp
View file @
fe13569b
...
...
@@ -66,14 +66,12 @@ TRACK::TRACK( const TRACK& Source ) :
}
/* Because of the way SEGVIA
is
derived from TRACK and because there are
/* Because of the way SEGVIA
and SEGZONE are
derived from TRACK and because there are
virtual functions being used, we can no longer simply copy a TRACK and
expect it to be a via. We must construct a true SEGVIA so its constructor
can initialize the virtual function table properly. So this constructor
is being retired in favor of a factory type function called Copy()
which can duplicate either a TRACK or a SEGVIA.
expect it to be a via or zone. We must construct a true SEGVIA or SEGZONE so its constructor
can initialize the virtual function table properly. This factory type of
function called Copy() can duplicate either a TRACK, SEGVIA, or SEGZONE.
*/
TRACK
*
TRACK
::
Copy
()
const
{
if
(
Type
()
==
TYPETRACK
)
...
...
@@ -82,6 +80,9 @@ TRACK* TRACK::Copy() const
if
(
Type
()
==
TYPEVIA
)
return
new
SEGVIA
(
(
const
SEGVIA
&
)
*
this
);
if
(
Type
()
==
TYPEZONE
)
return
new
SEGZONE
(
(
const
SEGZONE
&
)
*
this
);
return
NULL
;
// should never happen
}
...
...
@@ -458,21 +459,23 @@ TRACK* TRACK::GetEndNetCode( int NetCode )
}
#if 0
/**********************************/
TRACK
*
TRACK
::
Copy
(
int
NbSegm
)
TRACK* TRACK:: Copy
List( int NbSegm ) const
/**********************************/
/* Copie d'un Element ou d'une chaine de n elements
* Retourne un pointeur sur le nouvel element ou le debut de la
* nouvelle chaine
*/
{
TRACK
*
NewTrack
,
*
FirstTrack
,
*
OldTrack
,
*
Source
=
this
;
int
ii
;
TRACK* NewTrack;
TRACK* FirstTrack;
TRACK* OldTrack;
const TRACK* Source = this;
FirstTrack
=
NewTrack
=
new
TRACK
(
*
Source
);
FirstTrack = NewTrack =
Source->Copy(
);
for
(
ii
=
1
;
ii
<
NbSegm
;
ii
++
)
for( i
nt i
i = 1; ii < NbSegm; ii++ )
{
Source = Source->Next();
if( Source == NULL )
...
...
@@ -487,6 +490,7 @@ TRACK* TRACK:: Copy( int NbSegm )
return FirstTrack;
}
#endif
/********************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment