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
6b90eb3a
Commit
6b90eb3a
authored
Apr 01, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring EDIT_POINTS, part 1: separated functions that operate on EDIT_POINTS and EDIT_LINES.
parent
e79934b0
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
52 deletions
+78
-52
edit_points.cpp
pcbnew/tools/edit_points.cpp
+14
-2
edit_points.h
pcbnew/tools/edit_points.h
+17
-3
point_editor.cpp
pcbnew/tools/point_editor.cpp
+47
-47
No files found.
pcbnew/tools/edit_points.cpp
View file @
6b90eb3a
...
@@ -83,9 +83,15 @@ EDIT_POINT* EDIT_POINTS::Previous( const EDIT_POINT& aPoint )
...
@@ -83,9 +83,15 @@ EDIT_POINT* EDIT_POINTS::Previous( const EDIT_POINT& aPoint )
}
}
}
}
return
NULL
;
}
EDIT_LINE
*
EDIT_POINTS
::
Previous
(
const
EDIT_LINE
&
aLine
)
{
for
(
unsigned
int
i
=
0
;
i
<
m_lines
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
m_lines
.
size
();
++
i
)
{
{
if
(
m_lines
[
i
]
==
a
Point
)
if
(
m_lines
[
i
]
==
a
Line
)
{
{
if
(
i
==
0
)
if
(
i
==
0
)
return
&
m_lines
[
m_lines
.
size
()
-
1
];
return
&
m_lines
[
m_lines
.
size
()
-
1
];
...
@@ -111,9 +117,15 @@ EDIT_POINT* EDIT_POINTS::Next( const EDIT_POINT& aPoint )
...
@@ -111,9 +117,15 @@ EDIT_POINT* EDIT_POINTS::Next( const EDIT_POINT& aPoint )
}
}
}
}
return
NULL
;
}
EDIT_LINE
*
EDIT_POINTS
::
Next
(
const
EDIT_LINE
&
aLine
)
{
for
(
unsigned
int
i
=
0
;
i
<
m_lines
.
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
m_lines
.
size
();
++
i
)
{
{
if
(
m_lines
[
i
]
==
a
Point
)
if
(
m_lines
[
i
]
==
a
Line
)
{
{
if
(
i
==
m_lines
.
size
()
-
1
)
if
(
i
==
m_lines
.
size
()
-
1
)
return
&
m_lines
[
0
];
return
&
m_lines
[
0
];
...
...
pcbnew/tools/edit_points.h
View file @
6b90eb3a
...
@@ -73,7 +73,7 @@ public:
...
@@ -73,7 +73,7 @@ public:
}
}
/**
/**
* Function Get
X
()
* Function Get
Y
()
*
*
* Returns Y coordinate of an EDIT_POINT.
* Returns Y coordinate of an EDIT_POINT.
*/
*/
...
@@ -356,6 +356,8 @@ public:
...
@@ -356,6 +356,8 @@ public:
*/
*/
EDIT_POINT
*
Previous
(
const
EDIT_POINT
&
aPoint
);
EDIT_POINT
*
Previous
(
const
EDIT_POINT
&
aPoint
);
EDIT_LINE
*
Previous
(
const
EDIT_LINE
&
aLine
);
/**
/**
* Function Next()
* Function Next()
*
*
...
@@ -367,16 +369,28 @@ public:
...
@@ -367,16 +369,28 @@ public:
*/
*/
EDIT_POINT
*
Next
(
const
EDIT_POINT
&
aPoint
);
EDIT_POINT
*
Next
(
const
EDIT_POINT
&
aPoint
);
EDIT_POINT
&
operator
[](
unsigned
int
aIndex
)
EDIT_LINE
*
Next
(
const
EDIT_LINE
&
aLine
);
EDIT_POINT
&
Point
(
unsigned
int
aIndex
)
{
{
return
m_points
[
aIndex
];
return
m_points
[
aIndex
];
}
}
const
EDIT_POINT
&
operator
[]
(
unsigned
int
aIndex
)
const
const
EDIT_POINT
&
Point
(
unsigned
int
aIndex
)
const
{
{
return
m_points
[
aIndex
];
return
m_points
[
aIndex
];
}
}
EDIT_LINE
&
Line
(
unsigned
int
aIndex
)
{
return
m_lines
[
aIndex
];
}
const
EDIT_LINE
&
Line
(
unsigned
int
aIndex
)
const
{
return
m_lines
[
aIndex
];
}
/**
/**
* Function Size()
* Function Size()
*
*
...
...
pcbnew/tools/point_editor.cpp
View file @
6b90eb3a
This diff is collapsed.
Click to expand it.
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