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
5fe20bbc
Commit
5fe20bbc
authored
Dec 20, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed broken search filters.
parent
fe5c5953
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
17 deletions
+14
-17
ratsnest_data.cpp
pcbnew/ratsnest_data.cpp
+3
-9
ratsnest_data.h
pcbnew/ratsnest_data.h
+10
-5
ratsnest_viewitem.cpp
pcbnew/ratsnest_viewitem.cpp
+1
-3
No files found.
pcbnew/ratsnest_data.cpp
View file @
5fe20bbc
...
...
@@ -172,7 +172,6 @@ void RN_NET::validateEdge( RN_EDGE_PTR& aEdge )
{
valid
=
false
;
WITHOUT_FLAG
without_flag
;
std
::
list
<
RN_NODE_PTR
>
closest
=
GetClosestNodes
(
target
,
WITHOUT_FLAG
()
);
BOOST_FOREACH
(
RN_NODE_PTR
&
node
,
closest
)
{
...
...
@@ -220,12 +219,6 @@ const RN_EDGE_PTR& RN_LINKS::AddConnection( const RN_NODE_PTR& aNode1, const RN_
}
void
RN_LINKS
::
RemoveConnection
(
const
RN_EDGE_PTR
&
aEdge
)
{
m_edges
.
remove
(
aEdge
);
}
void
RN_NET
::
compute
()
{
const
RN_LINKS
::
RN_NODE_SET
&
boardNodes
=
m_links
.
GetNodes
();
...
...
@@ -536,7 +529,8 @@ const RN_NODE_PTR RN_NET::GetClosestNode( const RN_NODE_PTR& aNode ) const
}
const
RN_NODE_PTR
RN_NET
::
GetClosestNode
(
const
RN_NODE_PTR
&
aNode
,
RN_NODE_FILTER
aFilter
)
const
const
RN_NODE_PTR
RN_NET
::
GetClosestNode
(
const
RN_NODE_PTR
&
aNode
,
const
RN_NODE_FILTER
&
aFilter
)
const
{
const
RN_LINKS
::
RN_NODE_SET
&
nodes
=
m_links
.
GetNodes
();
RN_LINKS
::
RN_NODE_SET
::
const_iterator
it
,
itEnd
;
...
...
@@ -589,7 +583,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, int aN
std
::
list
<
RN_NODE_PTR
>
RN_NET
::
GetClosestNodes
(
const
RN_NODE_PTR
&
aNode
,
RN_NODE_FILTER
aFilter
,
int
aNumber
)
const
const
RN_NODE_FILTER
&
aFilter
,
int
aNumber
)
const
{
std
::
list
<
RN_NODE_PTR
>
closest
;
const
RN_LINKS
::
RN_NODE_SET
&
nodes
=
m_links
.
GetNodes
();
...
...
pcbnew/ratsnest_data.h
View file @
5fe20bbc
...
...
@@ -61,7 +61,8 @@ typedef hed::Triangulation TRIANGULATOR;
struct
RN_NODE_FILTER
:
public
std
::
unary_function
<
const
RN_NODE_PTR
&
,
bool
>
{
virtual
~
RN_NODE_FILTER
()
{}
virtual
bool
operator
()(
const
RN_NODE_PTR
&
aNode
)
virtual
bool
operator
()(
const
RN_NODE_PTR
&
aNode
)
const
{
return
true
;
// By default everything passes
}
...
...
@@ -70,7 +71,7 @@ struct RN_NODE_FILTER : public std::unary_function<const RN_NODE_PTR&, bool>
///> Filters out nodes that have the flag set.
struct
WITHOUT_FLAG
:
public
RN_NODE_FILTER
{
bool
operator
()(
const
RN_NODE_PTR
&
aNode
)
bool
operator
()(
const
RN_NODE_PTR
&
aNode
)
const
{
return
!
aNode
->
GetFlag
();
}
...
...
@@ -159,7 +160,10 @@ public:
* Removes a connection described by a given edge pointer.
* @param aEdge is a pointer to edge to be removed.
*/
void
RemoveConnection
(
const
RN_EDGE_PTR
&
aEdge
);
void
RemoveConnection
(
const
RN_EDGE_PTR
&
aEdge
)
{
m_edges
.
remove
(
aEdge
);
}
/**
* Function GetConnections()
...
...
@@ -395,7 +399,8 @@ public:
* @param aNode is the node for which the closest node is searched.
* @param aFilter is a functor that filters nodes.
*/
const
RN_NODE_PTR
GetClosestNode
(
const
RN_NODE_PTR
&
aNode
,
RN_NODE_FILTER
aFilter
)
const
;
const
RN_NODE_PTR
GetClosestNode
(
const
RN_NODE_PTR
&
aNode
,
const
RN_NODE_FILTER
&
aFilter
)
const
;
/**
* Function GetClosestNodes()
...
...
@@ -417,7 +422,7 @@ public:
* nodes then the size of list is limited to number of possible nodes.
*/
std
::
list
<
RN_NODE_PTR
>
GetClosestNodes
(
const
RN_NODE_PTR
&
aNode
,
RN_NODE_FILTER
aFilter
,
int
aNumber
=
-
1
)
const
;
const
RN_NODE_FILTER
&
aFilter
,
int
aNumber
=
-
1
)
const
;
/**
* Function GetEdges()
...
...
pcbnew/ratsnest_viewitem.cpp
View file @
5fe20bbc
...
...
@@ -59,8 +59,6 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
aGal
->
SetLineWidth
(
1.0
);
aGal
->
SetStrokeColor
(
COLOR4D
(
1.0
,
1.0
,
1.0
,
0.4
)
);
WITHOUT_FLAG
without_flag
;
// Draw the temporary ratsnest
BOOST_FOREACH
(
const
RN_NET
&
net
,
m_data
->
GetNets
()
)
{
...
...
@@ -73,7 +71,7 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
// Draw the "dynamic" ratsnest (ie. for objects that may be currently being moved)
BOOST_FOREACH
(
const
RN_NODE_PTR
&
node
,
net
.
GetSimpleNodes
()
)
{
RN_NODE_PTR
dest
=
net
.
GetClosestNode
(
node
,
without_flag
);
RN_NODE_PTR
dest
=
net
.
GetClosestNode
(
node
,
WITHOUT_FLAG
()
);
if
(
dest
&&
usedDestinations
.
find
(
dest
)
==
usedDestinations
.
end
()
)
{
...
...
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