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
Hide 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 ) :
...
@@ -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
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
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. So this constructor
can initialize the virtual function table properly. This factory type of
is being retired in favor of a factory type function called Copy()
function called Copy() can duplicate either a TRACK, SEGVIA, or SEGZONE.
which can duplicate either a TRACK or a SEGVIA.
*/
*/
TRACK
*
TRACK
::
Copy
()
const
TRACK
*
TRACK
::
Copy
()
const
{
{
if
(
Type
()
==
TYPETRACK
)
if
(
Type
()
==
TYPETRACK
)
...
@@ -81,6 +79,9 @@ TRACK* TRACK::Copy() const
...
@@ -81,6 +79,9 @@ TRACK* TRACK::Copy() const
if
(
Type
()
==
TYPEVIA
)
if
(
Type
()
==
TYPEVIA
)
return
new
SEGVIA
(
(
const
SEGVIA
&
)
*
this
);
return
new
SEGVIA
(
(
const
SEGVIA
&
)
*
this
);
if
(
Type
()
==
TYPEZONE
)
return
new
SEGZONE
(
(
const
SEGZONE
&
)
*
this
);
return
NULL
;
// should never happen
return
NULL
;
// should never happen
}
}
...
@@ -458,21 +459,23 @@ TRACK* TRACK::GetEndNetCode( int NetCode )
...
@@ -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
/* Copie d'un Element ou d'une chaine de n elements
* Retourne un pointeur sur le nouvel element ou le debut de la
* Retourne un pointeur sur le nouvel element ou le debut de la
* nouvelle chaine
* nouvelle chaine
*/
*/
{
{
TRACK
*
NewTrack
,
*
FirstTrack
,
*
OldTrack
,
*
Source
=
this
;
TRACK* NewTrack;
int
ii
;
TRACK* FirstTrack;
TRACK* OldTrack;
FirstTrack
=
NewTrack
=
new
TRACK
(
*
Source
);
const TRACK* Source = this;
FirstTrack = NewTrack = Source->Copy();
for
(
ii
=
1
;
ii
<
NbSegm
;
ii
++
)
for( i
nt i
i = 1; ii < NbSegm; ii++ )
{
{
Source = Source->Next();
Source = Source->Next();
if( Source == NULL )
if( Source == NULL )
...
@@ -487,6 +490,7 @@ TRACK* TRACK:: Copy( int NbSegm )
...
@@ -487,6 +490,7 @@ TRACK* TRACK:: Copy( int NbSegm )
return FirstTrack;
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