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
9245b903
Commit
9245b903
authored
Nov 14, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code formatting.
parent
7721d02a
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
428 additions
and
426 deletions
+428
-426
shape_line_chain.cpp
common/geometry/shape_line_chain.cpp
+12
-10
seg.h
include/geometry/seg.h
+13
-12
shape.h
include/geometry/shape.h
+3
-3
shape_circle.h
include/geometry/shape_circle.h
+2
-2
shape_line_chain.h
include/geometry/shape_line_chain.h
+3
-3
shape_rect.h
include/geometry/shape_rect.h
+3
-3
shape_segment.h
include/geometry/shape_segment.h
+55
-55
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+1
-1
pns_dragger.cpp
pcbnew/router/pns_dragger.cpp
+66
-66
pns_itemset.cpp
pcbnew/router/pns_itemset.cpp
+5
-5
pns_itemset.h
pcbnew/router/pns_itemset.h
+21
-21
pns_joint.h
pcbnew/router/pns_joint.h
+20
-21
pns_line.cpp
pcbnew/router/pns_line.cpp
+2
-2
pns_line_placer.cpp
pcbnew/router/pns_line_placer.cpp
+49
-49
pns_line_placer.h
pcbnew/router/pns_line_placer.h
+23
-23
pns_router.cpp
pcbnew/router/pns_router.cpp
+5
-6
pns_router.h
pcbnew/router/pns_router.h
+1
-1
pns_routing_settings.h
pcbnew/router/pns_routing_settings.h
+20
-20
pns_shove.cpp
pcbnew/router/pns_shove.cpp
+77
-76
pns_shove.h
pcbnew/router/pns_shove.h
+9
-9
pns_sizes_settings.h
pcbnew/router/pns_sizes_settings.h
+1
-1
pns_via.h
pcbnew/router/pns_via.h
+1
-1
pns_walkaround.cpp
pcbnew/router/pns_walkaround.cpp
+5
-5
pns_walkaround.h
pcbnew/router/pns_walkaround.h
+1
-1
router_preview_item.cpp
pcbnew/router/router_preview_item.cpp
+6
-6
router_tool.cpp
pcbnew/router/router_tool.cpp
+21
-21
router_tool.h
pcbnew/router/router_tool.h
+3
-3
No files found.
common/geometry/shape_line_chain.cpp
View file @
9245b903
...
@@ -29,9 +29,9 @@ using boost::optional;
...
@@ -29,9 +29,9 @@ using boost::optional;
bool
SHAPE_LINE_CHAIN
::
Collide
(
const
VECTOR2I
&
aP
,
int
aClearance
)
const
bool
SHAPE_LINE_CHAIN
::
Collide
(
const
VECTOR2I
&
aP
,
int
aClearance
)
const
{
{
// fixme: ugly!
// fixme: ugly!
SEG
s
(
aP
,
aP
);
SEG
s
(
aP
,
aP
);
return
this
->
Collide
(
s
,
aClearance
);
return
this
->
Collide
(
s
,
aClearance
);
}
}
...
@@ -161,9 +161,9 @@ int SHAPE_LINE_CHAIN::Split( const VECTOR2I& aP )
...
@@ -161,9 +161,9 @@ int SHAPE_LINE_CHAIN::Split( const VECTOR2I& aP )
if
(
dist
<
min_dist
&&
seg
.
A
!=
aP
&&
seg
.
B
!=
aP
)
if
(
dist
<
min_dist
&&
seg
.
A
!=
aP
&&
seg
.
B
!=
aP
)
{
{
min_dist
=
dist
;
min_dist
=
dist
;
if
(
found_index
<
0
)
if
(
found_index
<
0
)
ii
=
s
;
ii
=
s
;
else
if
(
s
<
found_index
)
else
if
(
s
<
found_index
)
ii
=
s
;
ii
=
s
;
}
}
}
}
...
@@ -521,25 +521,27 @@ const std::string SHAPE_LINE_CHAIN::Format() const
...
@@ -521,25 +521,27 @@ const std::string SHAPE_LINE_CHAIN::Format() const
bool
SHAPE_LINE_CHAIN
::
CompareGeometry
(
const
SHAPE_LINE_CHAIN
&
aOther
)
const
bool
SHAPE_LINE_CHAIN
::
CompareGeometry
(
const
SHAPE_LINE_CHAIN
&
aOther
)
const
{
{
SHAPE_LINE_CHAIN
a
(
*
this
),
b
(
aOther
);
SHAPE_LINE_CHAIN
a
(
*
this
),
b
(
aOther
);
a
.
Simplify
();
a
.
Simplify
();
b
.
Simplify
();
b
.
Simplify
();
if
(
a
.
m_points
.
size
()
!=
b
.
m_points
.
size
()
)
if
(
a
.
m_points
.
size
()
!=
b
.
m_points
.
size
()
)
return
false
;
return
false
;
for
(
int
i
=
0
;
i
<
a
.
PointCount
();
i
++
)
for
(
int
i
=
0
;
i
<
a
.
PointCount
();
i
++
)
if
(
a
.
CPoint
(
i
)
!=
b
.
CPoint
(
i
)
)
if
(
a
.
CPoint
(
i
)
!=
b
.
CPoint
(
i
)
)
return
false
;
return
false
;
return
true
;
return
true
;
}
}
bool
SHAPE_LINE_CHAIN
::
Intersects
(
const
SHAPE_LINE_CHAIN
&
aChain
)
const
bool
SHAPE_LINE_CHAIN
::
Intersects
(
const
SHAPE_LINE_CHAIN
&
aChain
)
const
{
{
INTERSECTIONS
dummy
;
INTERSECTIONS
dummy
;
return
Intersect
(
aChain
,
dummy
)
!=
0
;
return
Intersect
(
aChain
,
dummy
)
!=
0
;
}
}
SHAPE
*
SHAPE_LINE_CHAIN
::
Clone
()
const
SHAPE
*
SHAPE_LINE_CHAIN
::
Clone
()
const
{
{
return
new
SHAPE_LINE_CHAIN
(
*
this
);
return
new
SHAPE_LINE_CHAIN
(
*
this
);
...
...
include/geometry/seg.h
View file @
9245b903
...
@@ -52,7 +52,7 @@ public:
...
@@ -52,7 +52,7 @@ public:
/** Default constructor
/** Default constructor
* Creates an empty (0, 0) segment, locally-referenced
* Creates an empty (0, 0) segment, locally-referenced
*/
*/
SEG
()
SEG
()
{
{
m_index
=
-
1
;
m_index
=
-
1
;
}
}
...
@@ -61,8 +61,8 @@ public:
...
@@ -61,8 +61,8 @@ public:
* Constructor
* Constructor
* Creates a segment between (aX1, aY1) and (aX2, aY2), locally referenced
* Creates a segment between (aX1, aY1) and (aX2, aY2), locally referenced
*/
*/
SEG
(
int
aX1
,
int
aY1
,
int
aX2
,
int
aY2
)
:
SEG
(
int
aX1
,
int
aY1
,
int
aX2
,
int
aY2
)
:
A
(
VECTOR2I
(
aX1
,
aY1
)
),
A
(
VECTOR2I
(
aX1
,
aY1
)
),
B
(
VECTOR2I
(
aX2
,
aY2
)
)
B
(
VECTOR2I
(
aX2
,
aY2
)
)
{
{
m_index
=
-
1
;
m_index
=
-
1
;
...
@@ -84,7 +84,7 @@ public:
...
@@ -84,7 +84,7 @@ public:
* @param aB reference to the end point in the parent shape
* @param aB reference to the end point in the parent shape
* @param aIndex index of the segment within the parent shape
* @param aIndex index of the segment within the parent shape
*/
*/
SEG
(
const
VECTOR2I
&
aA
,
const
VECTOR2I
&
aB
,
int
aIndex
)
:
A
(
aA
),
B
(
aB
)
SEG
(
const
VECTOR2I
&
aA
,
const
VECTOR2I
&
aB
,
int
aIndex
)
:
A
(
aA
),
B
(
aB
)
{
{
m_index
=
aIndex
;
m_index
=
aIndex
;
}
}
...
@@ -92,7 +92,7 @@ public:
...
@@ -92,7 +92,7 @@ public:
/**
/**
* Copy constructor
* Copy constructor
*/
*/
SEG
(
const
SEG
&
aSeg
)
:
A
(
aSeg
.
A
),
B
(
aSeg
.
B
),
m_index
(
aSeg
.
m_index
)
SEG
(
const
SEG
&
aSeg
)
:
A
(
aSeg
.
A
),
B
(
aSeg
.
B
),
m_index
(
aSeg
.
m_index
)
{
{
}
}
...
@@ -101,7 +101,7 @@ public:
...
@@ -101,7 +101,7 @@ public:
A
=
aSeg
.
A
;
A
=
aSeg
.
A
;
B
=
aSeg
.
B
;
B
=
aSeg
.
B
;
m_index
=
aSeg
.
m_index
;
m_index
=
aSeg
.
m_index
;
return
*
this
;
return
*
this
;
}
}
...
@@ -225,23 +225,24 @@ public:
...
@@ -225,23 +225,24 @@ public:
return
(
d1
<=
1
&&
d2
<=
1
);
return
(
d1
<=
1
&&
d2
<=
1
);
}
}
bool
Overlaps
(
const
SEG
&
aSeg
)
const
bool
Overlaps
(
const
SEG
&
aSeg
)
const
{
{
if
(
aSeg
.
A
==
aSeg
.
B
)
// single point corner case
if
(
aSeg
.
A
==
aSeg
.
B
)
// single point corner case
{
{
if
(
A
==
aSeg
.
A
||
B
==
aSeg
.
A
)
if
(
A
==
aSeg
.
A
||
B
==
aSeg
.
A
)
return
false
;
return
false
;
return
Contains
(
aSeg
.
A
);
return
Contains
(
aSeg
.
A
);
}
}
if
(
!
Collinear
(
aSeg
)
)
if
(
!
Collinear
(
aSeg
)
)
return
false
;
return
false
;
if
(
Contains
(
aSeg
.
A
)
||
Contains
(
aSeg
.
B
)
)
if
(
Contains
(
aSeg
.
A
)
||
Contains
(
aSeg
.
B
)
)
return
true
;
return
true
;
if
(
aSeg
.
Contains
(
A
)
||
aSeg
.
Contains
(
B
)
)
if
(
aSeg
.
Contains
(
A
)
||
aSeg
.
Contains
(
B
)
)
return
true
;
return
true
;
return
false
;
return
false
;
}
}
...
...
include/geometry/shape.h
View file @
9245b903
...
@@ -41,7 +41,7 @@ enum SHAPE_TYPE
...
@@ -41,7 +41,7 @@ enum SHAPE_TYPE
SH_SEGMENT
,
///> line segment
SH_SEGMENT
,
///> line segment
SH_LINE_CHAIN
,
///> line chain (polyline)
SH_LINE_CHAIN
,
///> line chain (polyline)
SH_CIRCLE
,
///> circle
SH_CIRCLE
,
///> circle
SH_CONVEX
,
///> convex polygon
SH_CONVEX
,
///> convex polygon
SH_POLYGON
,
///> any polygon (with holes, etc.)
SH_POLYGON
,
///> any polygon (with holes, etc.)
SH_COMPOUND
///> compound shape, consisting of multiple simple shapes
SH_COMPOUND
///> compound shape, consisting of multiple simple shapes
};
};
...
@@ -63,7 +63,7 @@ public:
...
@@ -63,7 +63,7 @@ public:
* Creates an empty shape of type aType
* Creates an empty shape of type aType
*/
*/
SHAPE
(
SHAPE_TYPE
aType
)
:
m_type
(
aType
)
SHAPE
(
SHAPE_TYPE
aType
)
:
m_type
(
aType
)
{}
{}
// Destructor
// Destructor
...
@@ -152,7 +152,7 @@ public:
...
@@ -152,7 +152,7 @@ public:
virtual
void
Move
(
const
VECTOR2I
&
aVector
)
=
0
;
virtual
void
Move
(
const
VECTOR2I
&
aVector
)
=
0
;
virtual
bool
IsSolid
()
const
=
0
;
virtual
bool
IsSolid
()
const
=
0
;
protected
:
protected
:
///> type of our shape
///> type of our shape
SHAPE_TYPE
m_type
;
SHAPE_TYPE
m_type
;
...
...
include/geometry/shape_circle.h
View file @
9245b903
...
@@ -38,7 +38,7 @@ public:
...
@@ -38,7 +38,7 @@ public:
SHAPE
(
SH_CIRCLE
),
m_radius
(
aRadius
),
m_center
(
aCenter
)
SHAPE
(
SH_CIRCLE
),
m_radius
(
aRadius
),
m_center
(
aCenter
)
{}
{}
SHAPE_CIRCLE
(
const
SHAPE_CIRCLE
&
aOther
)
:
SHAPE_CIRCLE
(
const
SHAPE_CIRCLE
&
aOther
)
:
SHAPE
(
SH_CIRCLE
),
SHAPE
(
SH_CIRCLE
),
m_radius
(
aOther
.
m_radius
),
m_radius
(
aOther
.
m_radius
),
m_center
(
aOther
.
m_center
)
m_center
(
aOther
.
m_center
)
...
@@ -86,7 +86,7 @@ public:
...
@@ -86,7 +86,7 @@ public:
return
m_center
;
return
m_center
;
}
}
void
Move
(
const
VECTOR2I
&
aVector
)
void
Move
(
const
VECTOR2I
&
aVector
)
{
{
m_center
+=
aVector
;
m_center
+=
aVector
;
}
}
...
...
include/geometry/shape_line_chain.h
View file @
9245b903
...
@@ -114,7 +114,7 @@ public:
...
@@ -114,7 +114,7 @@ public:
}
}
SHAPE_LINE_CHAIN
(
const
VECTOR2I
*
aV
,
int
aCount
)
:
SHAPE_LINE_CHAIN
(
const
VECTOR2I
*
aV
,
int
aCount
)
:
SHAPE
(
SH_LINE_CHAIN
),
SHAPE
(
SH_LINE_CHAIN
),
m_closed
(
false
)
m_closed
(
false
)
{
{
...
@@ -564,9 +564,9 @@ public:
...
@@ -564,9 +564,9 @@ public:
bool
CompareGeometry
(
const
SHAPE_LINE_CHAIN
&
aOther
)
const
;
bool
CompareGeometry
(
const
SHAPE_LINE_CHAIN
&
aOther
)
const
;
void
Move
(
const
VECTOR2I
&
aVector
)
void
Move
(
const
VECTOR2I
&
aVector
)
{
{
for
(
std
::
vector
<
VECTOR2I
>::
iterator
i
=
m_points
.
begin
();
i
!=
m_points
.
end
();
++
i
)
for
(
std
::
vector
<
VECTOR2I
>::
iterator
i
=
m_points
.
begin
();
i
!=
m_points
.
end
();
++
i
)
(
*
i
)
+=
aVector
;
(
*
i
)
+=
aVector
;
}
}
...
...
include/geometry/shape_rect.h
View file @
9245b903
...
@@ -57,7 +57,7 @@ public:
...
@@ -57,7 +57,7 @@ public:
SHAPE
(
SH_RECT
),
m_p0
(
aP0
),
m_w
(
aW
),
m_h
(
aH
)
SHAPE
(
SH_RECT
),
m_p0
(
aP0
),
m_w
(
aW
),
m_h
(
aH
)
{}
{}
SHAPE_RECT
(
const
SHAPE_RECT
&
aOther
)
:
SHAPE_RECT
(
const
SHAPE_RECT
&
aOther
)
:
SHAPE
(
SH_RECT
),
SHAPE
(
SH_RECT
),
m_p0
(
aOther
.
m_p0
),
m_p0
(
aOther
.
m_p0
),
m_w
(
aOther
.
m_w
),
m_w
(
aOther
.
m_w
),
...
@@ -159,7 +159,7 @@ public:
...
@@ -159,7 +159,7 @@ public:
return
m_h
;
return
m_h
;
}
}
void
Move
(
const
VECTOR2I
&
aVector
)
void
Move
(
const
VECTOR2I
&
aVector
)
{
{
m_p0
+=
aVector
;
m_p0
+=
aVector
;
}
}
...
@@ -168,7 +168,7 @@ public:
...
@@ -168,7 +168,7 @@ public:
{
{
return
true
;
return
true
;
}
}
private
:
private
:
///> Top-left corner
///> Top-left corner
VECTOR2I
m_p0
;
VECTOR2I
m_p0
;
...
...
include/geometry/shape_segment.h
View file @
9245b903
...
@@ -31,71 +31,71 @@
...
@@ -31,71 +31,71 @@
class
SHAPE_SEGMENT
:
public
SHAPE
{
class
SHAPE_SEGMENT
:
public
SHAPE
{
public
:
public
:
SHAPE_SEGMENT
()
:
SHAPE_SEGMENT
()
:
SHAPE
(
SH_SEGMENT
),
m_width
(
0
)
{};
SHAPE
(
SH_SEGMENT
),
m_width
(
0
)
{};
SHAPE_SEGMENT
(
const
VECTOR2I
&
aA
,
const
VECTOR2I
&
aB
,
int
aWidth
=
0
)
:
SHAPE
(
SH_SEGMENT
),
m_seg
(
aA
,
aB
),
m_width
(
aWidth
)
{};
SHAPE_SEGMENT
(
const
SEG
&
aSeg
,
int
aWidth
=
0
)
:
SHAPE_SEGMENT
(
const
VECTOR2I
&
aA
,
const
VECTOR2I
&
aB
,
int
aWidth
=
0
)
:
SHAPE
(
SH_SEGMENT
),
m_seg
(
aSeg
),
m_width
(
aWidth
)
{};
SHAPE
(
SH_SEGMENT
),
m_seg
(
aA
,
aB
),
m_width
(
aWidth
)
{};
~
SHAPE_SEGMENT
()
{};
SHAPE_SEGMENT
(
const
SEG
&
aSeg
,
int
aWidth
=
0
)
:
SHAPE
(
SH_SEGMENT
),
m_seg
(
aSeg
),
m_width
(
aWidth
)
{};
~
SHAPE_SEGMENT
()
{};
SHAPE
*
Clone
()
const
SHAPE
*
Clone
()
const
{
{
return
new
SHAPE_SEGMENT
(
m_seg
,
m_width
);
return
new
SHAPE_SEGMENT
(
m_seg
,
m_width
);
}
}
const
BOX2I
BBox
(
int
aClearance
=
0
)
const
const
BOX2I
BBox
(
int
aClearance
=
0
)
const
{
{
return
BOX2I
(
m_seg
.
A
,
m_seg
.
B
-
m_seg
.
A
).
Inflate
(
aClearance
+
m_width
/
2
);
return
BOX2I
(
m_seg
.
A
,
m_seg
.
B
-
m_seg
.
A
).
Inflate
(
aClearance
+
m_width
/
2
);
}
}
bool
Collide
(
const
SEG
&
aSeg
,
int
aClearance
=
0
)
const
bool
Collide
(
const
SEG
&
aSeg
,
int
aClearance
=
0
)
const
{
{
return
m_seg
.
Distance
(
aSeg
)
<=
m_width
/
2
+
aClearance
;
return
m_seg
.
Distance
(
aSeg
)
<=
m_width
/
2
+
aClearance
;
}
}
bool
Collide
(
const
VECTOR2I
&
aP
,
int
aClearance
=
0
)
const
bool
Collide
(
const
VECTOR2I
&
aP
,
int
aClearance
=
0
)
const
{
{
return
m_seg
.
Distance
(
aP
)
<=
m_width
/
2
+
aClearance
;
return
m_seg
.
Distance
(
aP
)
<=
m_width
/
2
+
aClearance
;
}
}
void
SetSeg
(
const
SEG
&
aSeg
)
void
SetSeg
(
const
SEG
&
aSeg
)
{
{
m_seg
=
aSeg
;
m_seg
=
aSeg
;
}
}
const
SEG
&
GetSeg
()
const
const
SEG
&
GetSeg
()
const
{
{
return
m_seg
;
return
m_seg
;
}
}
void
SetWidth
(
int
aWidth
)
void
SetWidth
(
int
aWidth
)
{
{
m_width
=
aWidth
;
m_width
=
aWidth
;
}
}
int
GetWidth
()
const
int
GetWidth
()
const
{
{
return
m_width
;
return
m_width
;
}
}
bool
IsSolid
()
const
bool
IsSolid
()
const
{
{
return
true
;
return
true
;
}
}
void
Move
(
const
VECTOR2I
&
aVector
)
void
Move
(
const
VECTOR2I
&
aVector
)
{
{
m_seg
.
A
+=
aVector
;
m_seg
.
A
+=
aVector
;
m_seg
.
B
+=
aVector
;
m_seg
.
B
+=
aVector
;
}
}
private
:
private
:
SEG
m_seg
;
SEG
m_seg
;
int
m_width
;
int
m_width
;
};
};
#endif
#endif
pcbnew/pcb_painter.cpp
View file @
9245b903
...
@@ -387,7 +387,7 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer )
...
@@ -387,7 +387,7 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer )
else
else
{
{
double
width
=
(
aVia
->
GetWidth
()
-
aVia
->
GetDrillValue
()
)
/
2.0
;
double
width
=
(
aVia
->
GetWidth
()
-
aVia
->
GetDrillValue
()
)
/
2.0
;
m_gal
->
SetLineWidth
(
width
);
m_gal
->
SetLineWidth
(
width
);
m_gal
->
SetIsFill
(
true
);
m_gal
->
SetIsFill
(
true
);
m_gal
->
SetIsStroke
(
false
);
m_gal
->
SetIsStroke
(
false
);
...
...
pcbnew/router/pns_dragger.cpp
View file @
9245b903
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include "pns_router.h"
#include "pns_router.h"
PNS_DRAGGER
::
PNS_DRAGGER
(
PNS_ROUTER
*
aRouter
)
:
PNS_DRAGGER
::
PNS_DRAGGER
(
PNS_ROUTER
*
aRouter
)
:
PNS_ALGO_BASE
(
aRouter
)
PNS_ALGO_BASE
(
aRouter
)
{
{
m_world
=
NULL
;
m_world
=
NULL
;
m_shove
=
NULL
;
m_shove
=
NULL
;
...
@@ -39,7 +39,7 @@ PNS_DRAGGER::~PNS_DRAGGER()
...
@@ -39,7 +39,7 @@ PNS_DRAGGER::~PNS_DRAGGER()
}
}
void
PNS_DRAGGER
::
SetWorld
(
PNS_NODE
*
aWorld
)
void
PNS_DRAGGER
::
SetWorld
(
PNS_NODE
*
aWorld
)
{
{
m_world
=
aWorld
;
m_world
=
aWorld
;
}
}
...
@@ -49,7 +49,7 @@ bool PNS_DRAGGER::startDragSegment( const VECTOR2D& aP, PNS_SEGMENT* aSeg )
...
@@ -49,7 +49,7 @@ bool PNS_DRAGGER::startDragSegment( const VECTOR2D& aP, PNS_SEGMENT* aSeg )
{
{
int
w2
=
aSeg
->
Width
()
/
2
;
int
w2
=
aSeg
->
Width
()
/
2
;
m_draggedLine
=
m_world
->
AssembleLine
(
aSeg
,
&
m_draggedSegmentIndex
);
m_draggedLine
=
m_world
->
AssembleLine
(
aSeg
,
&
m_draggedSegmentIndex
);
m_shove
->
SetInitialLine
(
m_draggedLine
);
m_shove
->
SetInitialLine
(
m_draggedLine
);
m_lastValidDraggedLine
=
*
m_draggedLine
;
m_lastValidDraggedLine
=
*
m_draggedLine
;
m_lastValidDraggedLine
.
ClearSegmentLinks
();
m_lastValidDraggedLine
.
ClearSegmentLinks
();
...
@@ -58,9 +58,9 @@ bool PNS_DRAGGER::startDragSegment( const VECTOR2D& aP, PNS_SEGMENT* aSeg )
...
@@ -58,9 +58,9 @@ bool PNS_DRAGGER::startDragSegment( const VECTOR2D& aP, PNS_SEGMENT* aSeg )
m_mode
=
CORNER
;
m_mode
=
CORNER
;
else
if
(
(
aP
-
aSeg
->
Seg
().
B
).
EuclideanNorm
()
<=
w2
)
else
if
(
(
aP
-
aSeg
->
Seg
().
B
).
EuclideanNorm
()
<=
w2
)
{
{
m_draggedSegmentIndex
++
;
m_draggedSegmentIndex
++
;
m_mode
=
CORNER
;
m_mode
=
CORNER
;
}
else
}
else
m_mode
=
SEGMENT
;
m_mode
=
SEGMENT
;
return
true
;
return
true
;
...
@@ -74,14 +74,14 @@ bool PNS_DRAGGER::startDragVia( const VECTOR2D& aP, PNS_VIA* aVia )
...
@@ -74,14 +74,14 @@ bool PNS_DRAGGER::startDragVia( const VECTOR2D& aP, PNS_VIA* aVia )
m_mode
=
VIA
;
m_mode
=
VIA
;
VECTOR2I
p0
(
aVia
->
Pos
()
);
VECTOR2I
p0
(
aVia
->
Pos
()
);
PNS_JOINT
*
jt
=
m_world
->
FindJoint
(
p0
,
aVia
->
Layers
().
Start
(),
aVia
->
Net
()
);
PNS_JOINT
*
jt
=
m_world
->
FindJoint
(
p0
,
aVia
->
Layers
().
Start
(),
aVia
->
Net
()
);
BOOST_FOREACH
(
PNS_ITEM
*
item
,
jt
->
LinkList
()
)
BOOST_FOREACH
(
PNS_ITEM
*
item
,
jt
->
LinkList
()
)
{
{
if
(
item
->
OfKind
(
PNS_ITEM
::
SEGMENT
)
)
if
(
item
->
OfKind
(
PNS_ITEM
::
SEGMENT
)
)
{
{
int
segIndex
;
int
segIndex
;
PNS_SEGMENT
*
seg
=
(
PNS_SEGMENT
*
)
item
;
PNS_SEGMENT
*
seg
=
(
PNS_SEGMENT
*
)
item
;
std
::
auto_ptr
<
PNS_LINE
>
l
(
m_world
->
AssembleLine
(
seg
,
&
segIndex
)
);
std
::
auto_ptr
<
PNS_LINE
>
l
(
m_world
->
AssembleLine
(
seg
,
&
segIndex
)
);
if
(
segIndex
!=
0
)
if
(
segIndex
!=
0
)
...
@@ -97,29 +97,29 @@ bool PNS_DRAGGER::startDragVia( const VECTOR2D& aP, PNS_VIA* aVia )
...
@@ -97,29 +97,29 @@ bool PNS_DRAGGER::startDragVia( const VECTOR2D& aP, PNS_VIA* aVia )
bool
PNS_DRAGGER
::
Start
(
const
VECTOR2I
&
aP
,
PNS_ITEM
*
aStartItem
)
bool
PNS_DRAGGER
::
Start
(
const
VECTOR2I
&
aP
,
PNS_ITEM
*
aStartItem
)
{
{
m_shove
=
new
PNS_SHOVE
(
m_world
,
Router
()
);
m_shove
=
new
PNS_SHOVE
(
m_world
,
Router
()
);
m_lastNode
=
NULL
;
m_lastNode
=
NULL
;
m_draggedItems
.
Clear
();
m_draggedItems
.
Clear
();
m_currentMode
=
Settings
().
Mode
();
m_currentMode
=
Settings
().
Mode
();
TRACE
(
2
,
"StartDragging: item %p [kind %d]"
,
aStartItem
%
aStartItem
->
Kind
()
);
TRACE
(
2
,
"StartDragging: item %p [kind %d]"
,
aStartItem
%
aStartItem
->
Kind
()
);
switch
(
aStartItem
->
Kind
()
)
switch
(
aStartItem
->
Kind
()
)
{
{
case
PNS_ITEM
:
:
SEGMENT
:
case
PNS_ITEM
:
:
SEGMENT
:
return
startDragSegment
(
aP
,
static_cast
<
PNS_SEGMENT
*>
(
aStartItem
)
);
return
startDragSegment
(
aP
,
static_cast
<
PNS_SEGMENT
*>
(
aStartItem
)
);
case
PNS_ITEM
:
:
VIA
:
case
PNS_ITEM
:
:
VIA
:
return
startDragVia
(
aP
,
static_cast
<
PNS_VIA
*>
(
aStartItem
)
);
return
startDragVia
(
aP
,
static_cast
<
PNS_VIA
*>
(
aStartItem
)
);
default
:
default
:
return
false
;
return
false
;
}
}
}
}
bool
PNS_DRAGGER
::
dragMarkObstacles
(
const
VECTOR2I
&
aP
)
bool
PNS_DRAGGER
::
dragMarkObstacles
(
const
VECTOR2I
&
aP
)
{
{
if
(
m_lastNode
)
if
(
m_lastNode
)
{
{
delete
m_lastNode
;
delete
m_lastNode
;
...
@@ -133,20 +133,20 @@ bool PNS_DRAGGER::dragMarkObstacles( const VECTOR2I& aP )
...
@@ -133,20 +133,20 @@ bool PNS_DRAGGER::dragMarkObstacles( const VECTOR2I& aP )
{
{
int
thresh
=
Settings
().
SmoothDraggedSegments
()
?
m_draggedLine
->
Width
()
/
4
:
0
;
int
thresh
=
Settings
().
SmoothDraggedSegments
()
?
m_draggedLine
->
Width
()
/
4
:
0
;
PNS_LINE
tmp
(
*
m_draggedLine
);
PNS_LINE
tmp
(
*
m_draggedLine
);
if
(
m_mode
==
SEGMENT
)
if
(
m_mode
==
SEGMENT
)
tmp
.
DragSegment
(
aP
,
m_draggedSegmentIndex
,
thresh
);
tmp
.
DragSegment
(
aP
,
m_draggedSegmentIndex
,
thresh
);
else
else
tmp
.
DragCorner
(
aP
,
m_draggedSegmentIndex
,
thresh
);
tmp
.
DragCorner
(
aP
,
m_draggedSegmentIndex
,
thresh
);
m_lastNode
=
m_shove
->
CurrentNode
()
->
Branch
();
m_lastNode
=
m_shove
->
CurrentNode
()
->
Branch
();
m_lastValidDraggedLine
=
tmp
;
m_lastValidDraggedLine
=
tmp
;
m_lastValidDraggedLine
.
ClearSegmentLinks
();
m_lastValidDraggedLine
.
ClearSegmentLinks
();
m_lastValidDraggedLine
.
Unmark
();
m_lastValidDraggedLine
.
Unmark
();
m_lastNode
->
Add
(
&
m_lastValidDraggedLine
);
m_lastNode
->
Add
(
&
m_lastValidDraggedLine
);
m_draggedItems
=
PNS_ITEMSET
(
&
m_lastValidDraggedLine
);
m_draggedItems
=
PNS_ITEMSET
(
&
m_lastValidDraggedLine
);
break
;
break
;
}
}
...
@@ -154,7 +154,7 @@ bool PNS_DRAGGER::dragMarkObstacles( const VECTOR2I& aP )
...
@@ -154,7 +154,7 @@ bool PNS_DRAGGER::dragMarkObstacles( const VECTOR2I& aP )
case
VIA
:
// fixme...
case
VIA
:
// fixme...
{
{
m_lastNode
=
m_shove
->
CurrentNode
()
->
Branch
();
m_lastNode
=
m_shove
->
CurrentNode
()
->
Branch
();
dumbDragVia
(
m_initialVia
,
m_lastNode
,
aP
);
dumbDragVia
(
m_initialVia
,
m_lastNode
,
aP
);
break
;
break
;
}
}
...
@@ -164,7 +164,7 @@ bool PNS_DRAGGER::dragMarkObstacles( const VECTOR2I& aP )
...
@@ -164,7 +164,7 @@ bool PNS_DRAGGER::dragMarkObstacles( const VECTOR2I& aP )
m_dragStatus
=
true
;
m_dragStatus
=
true
;
else
else
m_dragStatus
=
!
m_world
->
CheckColliding
(
m_draggedItems
);
m_dragStatus
=
!
m_world
->
CheckColliding
(
m_draggedItems
);
return
true
;
return
true
;
}
}
...
@@ -176,20 +176,20 @@ void PNS_DRAGGER::dumbDragVia( PNS_VIA* aVia, PNS_NODE* aNode, const VECTOR2I& a
...
@@ -176,20 +176,20 @@ void PNS_DRAGGER::dumbDragVia( PNS_VIA* aVia, PNS_NODE* aNode, const VECTOR2I& a
m_draggedVia
->
SetPos
(
aP
);
m_draggedVia
->
SetPos
(
aP
);
m_draggedItems
.
Clear
();
m_draggedItems
.
Clear
();
m_draggedItems
.
Add
(
m_draggedVia
);
m_draggedItems
.
Add
(
m_draggedVia
);
m_lastNode
->
Remove
(
aVia
);
m_lastNode
->
Remove
(
aVia
);
m_lastNode
->
Add
(
m_draggedVia
);
m_lastNode
->
Add
(
m_draggedVia
);
BOOST_FOREACH
(
PNS_LINE
&
l
,
m_origViaConnections
)
BOOST_FOREACH
(
PNS_LINE
&
l
,
m_origViaConnections
)
{
{
PNS_LINE
origLine
(
l
);
PNS_LINE
origLine
(
l
);
PNS_LINE
*
draggedLine
=
l
.
Clone
();
PNS_LINE
*
draggedLine
=
l
.
Clone
();
draggedLine
->
DragCorner
(
aP
,
0
);
draggedLine
->
DragCorner
(
aP
,
0
);
draggedLine
->
ClearSegmentLinks
();
draggedLine
->
ClearSegmentLinks
();
m_draggedItems
.
Add
(
draggedLine
);
// FIXME: mem leak
m_draggedItems
.
Add
(
draggedLine
);
// FIXME: mem leak
m_lastNode
->
Remove
(
&
origLine
);
m_lastNode
->
Remove
(
&
origLine
);
m_lastNode
->
Add
(
draggedLine
);
m_lastNode
->
Add
(
draggedLine
);
}
}
...
@@ -208,43 +208,43 @@ bool PNS_DRAGGER::dragShove( const VECTOR2I& aP )
...
@@ -208,43 +208,43 @@ bool PNS_DRAGGER::dragShove( const VECTOR2I& aP )
switch
(
m_mode
)
switch
(
m_mode
)
{
{
case
SEGMENT
:
case
SEGMENT
:
case
CORNER
:
case
CORNER
:
{
{
int
thresh
=
Settings
().
SmoothDraggedSegments
()
?
m_draggedLine
->
Width
()
/
4
:
0
;
int
thresh
=
Settings
().
SmoothDraggedSegments
()
?
m_draggedLine
->
Width
()
/
4
:
0
;
PNS_LINE
tmp
(
*
m_draggedLine
);
PNS_LINE
tmp
(
*
m_draggedLine
);
if
(
m_mode
==
SEGMENT
)
if
(
m_mode
==
SEGMENT
)
tmp
.
DragSegment
(
aP
,
m_draggedSegmentIndex
,
thresh
);
tmp
.
DragSegment
(
aP
,
m_draggedSegmentIndex
,
thresh
);
else
else
tmp
.
DragCorner
(
aP
,
m_draggedSegmentIndex
,
thresh
);
tmp
.
DragCorner
(
aP
,
m_draggedSegmentIndex
,
thresh
);
PNS_SHOVE
::
SHOVE_STATUS
st
=
m_shove
->
ShoveLines
(
tmp
);
PNS_SHOVE
::
SHOVE_STATUS
st
=
m_shove
->
ShoveLines
(
tmp
);
if
(
st
==
PNS_SHOVE
::
SH_OK
)
if
(
st
==
PNS_SHOVE
::
SH_OK
)
ok
=
true
;
ok
=
true
;
else
if
(
st
==
PNS_SHOVE
::
SH_HEAD_MODIFIED
)
else
if
(
st
==
PNS_SHOVE
::
SH_HEAD_MODIFIED
)
{
{
tmp
=
m_shove
->
NewHead
();
tmp
=
m_shove
->
NewHead
();
ok
=
true
;
ok
=
true
;
}
}
m_lastNode
=
m_shove
->
CurrentNode
()
->
Branch
();
m_lastNode
=
m_shove
->
CurrentNode
()
->
Branch
();
if
(
ok
)
if
(
ok
)
m_lastValidDraggedLine
=
tmp
;
m_lastValidDraggedLine
=
tmp
;
m_lastValidDraggedLine
.
ClearSegmentLinks
();
m_lastValidDraggedLine
.
ClearSegmentLinks
();
m_lastValidDraggedLine
.
Unmark
();
m_lastValidDraggedLine
.
Unmark
();
m_lastNode
->
Add
(
&
m_lastValidDraggedLine
);
m_lastNode
->
Add
(
&
m_lastValidDraggedLine
);
m_draggedItems
=
PNS_ITEMSET
(
&
m_lastValidDraggedLine
);
m_draggedItems
=
PNS_ITEMSET
(
&
m_lastValidDraggedLine
);
break
;
break
;
}
}
case
VIA
:
case
VIA
:
{
{
PNS_VIA
*
newVia
;
PNS_VIA
*
newVia
;
PNS_SHOVE
::
SHOVE_STATUS
st
=
m_shove
->
ShoveDraggingVia
(
m_draggedVia
,
aP
,
&
newVia
);
PNS_SHOVE
::
SHOVE_STATUS
st
=
m_shove
->
ShoveDraggingVia
(
m_draggedVia
,
aP
,
&
newVia
);
if
(
st
==
PNS_SHOVE
::
SH_OK
||
st
==
PNS_SHOVE
::
SH_HEAD_MODIFIED
)
if
(
st
==
PNS_SHOVE
::
SH_OK
||
st
==
PNS_SHOVE
::
SH_HEAD_MODIFIED
)
...
@@ -261,7 +261,7 @@ bool PNS_DRAGGER::dragShove( const VECTOR2I& aP )
...
@@ -261,7 +261,7 @@ bool PNS_DRAGGER::dragShove( const VECTOR2I& aP )
break
;
break
;
}
}
}
}
m_dragStatus
=
ok
;
m_dragStatus
=
ok
;
return
ok
;
return
ok
;
...
@@ -274,7 +274,7 @@ bool PNS_DRAGGER::FixRoute()
...
@@ -274,7 +274,7 @@ bool PNS_DRAGGER::FixRoute()
{
{
Router
()
->
CommitRouting
(
CurrentNode
()
);
Router
()
->
CommitRouting
(
CurrentNode
()
);
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
...
@@ -282,23 +282,23 @@ bool PNS_DRAGGER::FixRoute()
...
@@ -282,23 +282,23 @@ bool PNS_DRAGGER::FixRoute()
bool
PNS_DRAGGER
::
Drag
(
const
VECTOR2I
&
aP
)
bool
PNS_DRAGGER
::
Drag
(
const
VECTOR2I
&
aP
)
{
{
switch
(
m_currentMode
)
switch
(
m_currentMode
)
{
{
case
RM_MarkObstacles
:
case
RM_MarkObstacles
:
return
dragMarkObstacles
(
aP
);
return
dragMarkObstacles
(
aP
);
case
RM_Shove
:
case
RM_Shove
:
case
RM_Walkaround
:
case
RM_Walkaround
:
case
RM_Smart
:
case
RM_Smart
:
return
dragShove
(
aP
);
return
dragShove
(
aP
);
default
:
default
:
return
false
;
return
false
;
}
}
}
}
PNS_NODE
*
PNS_DRAGGER
::
CurrentNode
()
const
PNS_NODE
*
PNS_DRAGGER
::
CurrentNode
()
const
{
{
return
m_lastNode
;
return
m_lastNode
;
}
}
...
...
pcbnew/router/pns_itemset.cpp
View file @
9245b903
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
PNS_ITEMSET
::
PNS_ITEMSET
(
PNS_ITEM
*
aInitialItem
)
PNS_ITEMSET
::
PNS_ITEMSET
(
PNS_ITEM
*
aInitialItem
)
{
{
if
(
aInitialItem
)
if
(
aInitialItem
)
m_items
.
push_back
(
aInitialItem
);
m_items
.
push_back
(
aInitialItem
);
}
}
PNS_ITEMSET
&
PNS_ITEMSET
::
FilterLayers
(
int
aStart
,
int
aEnd
,
bool
aInvert
)
PNS_ITEMSET
&
PNS_ITEMSET
::
FilterLayers
(
int
aStart
,
int
aEnd
,
bool
aInvert
)
...
@@ -55,7 +55,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterKinds( int aKindMask, bool aInvert )
...
@@ -55,7 +55,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterKinds( int aKindMask, bool aInvert )
BOOST_FOREACH
(
PNS_ITEM
*
item
,
m_items
)
BOOST_FOREACH
(
PNS_ITEM
*
item
,
m_items
)
{
{
if
(
item
->
OfKind
(
aKindMask
)
^
aInvert
)
if
(
item
->
OfKind
(
aKindMask
)
^
aInvert
)
newItems
.
push_back
(
item
);
newItems
.
push_back
(
item
);
}
}
...
@@ -71,7 +71,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterNet( int aNet, bool aInvert )
...
@@ -71,7 +71,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterNet( int aNet, bool aInvert )
BOOST_FOREACH
(
PNS_ITEM
*
item
,
m_items
)
BOOST_FOREACH
(
PNS_ITEM
*
item
,
m_items
)
{
{
if
(
(
item
->
Net
()
==
aNet
)
^
aInvert
)
if
(
(
item
->
Net
()
==
aNet
)
^
aInvert
)
newItems
.
push_back
(
item
);
newItems
.
push_back
(
item
);
}
}
...
@@ -80,7 +80,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterNet( int aNet, bool aInvert )
...
@@ -80,7 +80,7 @@ PNS_ITEMSET& PNS_ITEMSET::FilterNet( int aNet, bool aInvert )
return
*
this
;
return
*
this
;
}
}
PNS_ITEMSET
&
PNS_ITEMSET
::
ExcludeItem
(
const
PNS_ITEM
*
aItem
)
PNS_ITEMSET
&
PNS_ITEMSET
::
ExcludeItem
(
const
PNS_ITEM
*
aItem
)
{
{
ITEMS
newItems
;
ITEMS
newItems
;
...
...
pcbnew/router/pns_itemset.h
View file @
9245b903
...
@@ -44,17 +44,17 @@ public:
...
@@ -44,17 +44,17 @@ public:
{
{
m_items
=
aOther
.
m_items
;
m_items
=
aOther
.
m_items
;
}
}
const
PNS_ITEMSET
&
operator
=
(
const
PNS_ITEMSET
&
aOther
)
const
PNS_ITEMSET
&
operator
=
(
const
PNS_ITEMSET
&
aOther
)
{
{
m_items
=
aOther
.
m_items
;
m_items
=
aOther
.
m_items
;
return
*
this
;
return
*
this
;
}
}
int
Count
(
int
aKindMask
=
-
1
)
const
int
Count
(
int
aKindMask
=
-
1
)
const
{
{
int
n
=
0
;
int
n
=
0
;
BOOST_FOREACH
(
PNS_ITEM
*
item
,
m_items
)
BOOST_FOREACH
(
PNS_ITEM
*
item
,
m_items
)
{
{
if
(
item
->
Kind
()
&
aKindMask
)
if
(
item
->
Kind
()
&
aKindMask
)
n
++
;
n
++
;
...
@@ -76,32 +76,32 @@ public:
...
@@ -76,32 +76,32 @@ public:
PNS_ITEMSET
&
ExcludeKinds
(
int
aKindMask
)
PNS_ITEMSET
&
ExcludeKinds
(
int
aKindMask
)
{
{
return
FilterKinds
(
aKindMask
,
true
);
return
FilterKinds
(
aKindMask
,
true
);
}
}
PNS_ITEMSET
&
ExcludeNet
(
int
aNet
)
PNS_ITEMSET
&
ExcludeNet
(
int
aNet
)
{
{
return
FilterNet
(
aNet
,
true
);
return
FilterNet
(
aNet
,
true
);
}
}
PNS_ITEMSET
&
ExcludeItem
(
const
PNS_ITEM
*
aItem
);
PNS_ITEMSET
&
ExcludeItem
(
const
PNS_ITEM
*
aItem
);
int
Size
()
const
int
Size
()
const
{
{
return
m_items
.
size
();
return
m_items
.
size
();
}
}
void
Add
(
PNS_ITEM
*
aItem
)
void
Add
(
PNS_ITEM
*
aItem
)
{
{
m_items
.
push_back
(
aItem
);
m_items
.
push_back
(
aItem
);
}
}
PNS_ITEM
*
Get
(
int
index
)
const
PNS_ITEM
*
Get
(
int
index
)
const
{
{
return
m_items
[
index
];
return
m_items
[
index
];
}
}
PNS_ITEM
*
operator
[]
(
int
index
)
const
PNS_ITEM
*
operator
[]
(
int
index
)
const
{
{
return
m_items
[
index
];
return
m_items
[
index
];
}
}
...
@@ -111,19 +111,19 @@ public:
...
@@ -111,19 +111,19 @@ public:
m_items
.
clear
();
m_items
.
clear
();
}
}
bool
Contains
(
const
PNS_ITEM
*
aItem
)
const
bool
Contains
(
const
PNS_ITEM
*
aItem
)
const
{
{
return
std
::
find
(
m_items
.
begin
(),
m_items
.
end
(),
aItem
)
!=
m_items
.
end
();
return
std
::
find
(
m_items
.
begin
(),
m_items
.
end
(),
aItem
)
!=
m_items
.
end
();
}
}
void
Erase
(
const
PNS_ITEM
*
aItem
)
void
Erase
(
const
PNS_ITEM
*
aItem
)
{
{
ITEMS
::
iterator
f
=
std
::
find
(
m_items
.
begin
(),
m_items
.
end
(),
aItem
);
ITEMS
::
iterator
f
=
std
::
find
(
m_items
.
begin
(),
m_items
.
end
(),
aItem
);
if
(
f
!=
m_items
.
end
()
)
if
(
f
!=
m_items
.
end
()
)
m_items
.
erase
(
f
);
m_items
.
erase
(
f
);
}
}
private
:
private
:
ITEMS
m_items
;
ITEMS
m_items
;
};
};
...
...
pcbnew/router/pns_joint.h
View file @
9245b903
...
@@ -72,7 +72,7 @@ public:
...
@@ -72,7 +72,7 @@ public:
m_layers
=
aB
.
m_layers
;
m_layers
=
aB
.
m_layers
;
}
}
PNS_ITEM
*
Clone
(
)
const
PNS_ITEM
*
Clone
(
)
const
{
{
assert
(
false
);
assert
(
false
);
return
NULL
;
return
NULL
;
...
@@ -98,17 +98,17 @@ public:
...
@@ -98,17 +98,17 @@ public:
///> Links the joint to a given board item (when it's added to the PNS_NODE)
///> Links the joint to a given board item (when it's added to the PNS_NODE)
void
Link
(
PNS_ITEM
*
aItem
)
void
Link
(
PNS_ITEM
*
aItem
)
{
{
if
(
m_linkedItems
.
Contains
(
aItem
)
)
if
(
m_linkedItems
.
Contains
(
aItem
)
)
return
;
return
;
m_linkedItems
.
Add
(
aItem
);
m_linkedItems
.
Add
(
aItem
);
}
}
///> Unlinks a given board item from the joint (upon its removal from a PNS_NODE)
///> Unlinks a given board item from the joint (upon its removal from a PNS_NODE)
///> Returns true if the joint became dangling after unlinking.
///> Returns true if the joint became dangling after unlinking.
bool
Unlink
(
PNS_ITEM
*
aItem
)
bool
Unlink
(
PNS_ITEM
*
aItem
)
{
{
m_linkedItems
.
Erase
(
aItem
);
m_linkedItems
.
Erase
(
aItem
);
return
m_linkedItems
.
Size
()
==
0
;
return
m_linkedItems
.
Size
()
==
0
;
}
}
...
@@ -124,24 +124,24 @@ public:
...
@@ -124,24 +124,24 @@ public:
/// trivial accessors
/// trivial accessors
const
HASH_TAG
&
Tag
()
const
const
HASH_TAG
&
Tag
()
const
{
{
return
m_tag
;
return
m_tag
;
}
}
const
VECTOR2I
&
Pos
()
const
const
VECTOR2I
&
Pos
()
const
{
{
return
m_tag
.
pos
;
return
m_tag
.
pos
;
}
}
int
Net
()
const
int
Net
()
const
{
{
return
m_tag
.
net
;
return
m_tag
.
net
;
}
}
const
LINKED_ITEMS
&
LinkList
()
const
const
LINKED_ITEMS
&
LinkList
()
const
{
{
return
m_linkedItems
.
CItems
();
return
m_linkedItems
.
CItems
();
}
}
const
PNS_ITEMSET
&
CLinks
()
const
const
PNS_ITEMSET
&
CLinks
()
const
...
@@ -159,7 +159,6 @@ public:
...
@@ -159,7 +159,6 @@ public:
return
m_linkedItems
.
Count
(
aMask
);
return
m_linkedItems
.
Count
(
aMask
);
}
}
void
Dump
()
const
;
void
Dump
()
const
;
bool
operator
==
(
const
PNS_JOINT
&
rhs
)
const
bool
operator
==
(
const
PNS_JOINT
&
rhs
)
const
...
@@ -174,9 +173,9 @@ public:
...
@@ -174,9 +173,9 @@ public:
m_layers
.
Merge
(
aJoint
.
m_layers
);
m_layers
.
Merge
(
aJoint
.
m_layers
);
BOOST_FOREACH
(
PNS_ITEM
*
item
,
aJoint
.
LinkList
()
)
BOOST_FOREACH
(
PNS_ITEM
*
item
,
aJoint
.
LinkList
()
)
{
{
m_linkedItems
.
Add
(
item
);
m_linkedItems
.
Add
(
item
);
}
}
}
}
...
...
pcbnew/router/pns_line.cpp
View file @
9245b903
...
@@ -123,7 +123,7 @@ int PNS_LINE::Marker()const
...
@@ -123,7 +123,7 @@ int PNS_LINE::Marker()const
}
}
void
PNS_LINE
::
copyLinks
(
const
PNS_LINE
*
aParent
)
void
PNS_LINE
::
copyLinks
(
const
PNS_LINE
*
aParent
)
{
{
if
(
aParent
->
m_segmentRefs
==
NULL
)
if
(
aParent
->
m_segmentRefs
==
NULL
)
{
{
...
@@ -413,7 +413,7 @@ void PNS_LINE::DragCorner ( const VECTOR2I& aP, int aIndex, int aSnappingThresho
...
@@ -413,7 +413,7 @@ void PNS_LINE::DragCorner ( const VECTOR2I& aP, int aIndex, int aSnappingThresho
if
(
aIndex
==
0
)
if
(
aIndex
==
0
)
path
=
dragCornerInternal
(
m_line
.
Reverse
(),
snapped
).
Reverse
();
path
=
dragCornerInternal
(
m_line
.
Reverse
(),
snapped
).
Reverse
();
else
if
(
aIndex
==
m_line
.
SegmentCount
()
)
else
if
(
aIndex
==
m_line
.
SegmentCount
()
)
path
=
dragCornerInternal
(
m_line
,
snapped
);
path
=
dragCornerInternal
(
m_line
,
snapped
);
else
else
{
{
...
...
pcbnew/router/pns_line_placer.cpp
View file @
9245b903
...
@@ -386,12 +386,12 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
...
@@ -386,12 +386,12 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
walkaround
.
SetSolidsOnly
(
false
);
walkaround
.
SetSolidsOnly
(
false
);
walkaround
.
SetIterationLimit
(
Settings
().
WalkaroundIterationLimit
()
);
walkaround
.
SetIterationLimit
(
Settings
().
WalkaroundIterationLimit
()
);
PNS_WALKAROUND
::
WALKAROUND_STATUS
wf
=
walkaround
.
Route
(
initTrack
,
walkFull
,
false
);
PNS_WALKAROUND
::
WALKAROUND_STATUS
wf
=
walkaround
.
Route
(
initTrack
,
walkFull
,
false
);
switch
(
Settings
().
OptimizerEffort
()
)
switch
(
Settings
().
OptimizerEffort
()
)
{
{
case
OE_LOW
:
case
OE_LOW
:
effort
=
0
;
effort
=
0
;
break
;
break
;
...
@@ -423,7 +423,7 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
...
@@ -423,7 +423,7 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
m_head
=
walkFull
;
m_head
=
walkFull
;
aNewHead
=
walkFull
;
aNewHead
=
walkFull
;
return
rv
;
return
rv
;
}
}
...
@@ -431,14 +431,14 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
...
@@ -431,14 +431,14 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead )
bool
PNS_LINE_PLACER
::
rhMarkObstacles
(
const
VECTOR2I
&
aP
,
PNS_LINE
&
aNewHead
)
bool
PNS_LINE_PLACER
::
rhMarkObstacles
(
const
VECTOR2I
&
aP
,
PNS_LINE
&
aNewHead
)
{
{
m_head
.
SetShape
(
m_direction
.
BuildInitialTrace
(
m_p_start
,
aP
)
);
m_head
.
SetShape
(
m_direction
.
BuildInitialTrace
(
m_p_start
,
aP
)
);
if
(
m_placingVia
)
if
(
m_placingVia
)
{
{
m_head
.
AppendVia
(
makeVia
(
m_head
.
CPoint
(
-
1
)
)
);
m_head
.
AppendVia
(
makeVia
(
m_head
.
CPoint
(
-
1
)
)
);
}
}
aNewHead
=
m_head
;
aNewHead
=
m_head
;
return
m_currentNode
->
CheckColliding
(
&
m_head
);
return
m_currentNode
->
CheckColliding
(
&
m_head
);
}
}
...
@@ -482,16 +482,16 @@ bool PNS_LINE_PLACER::rhShoveOnly ( const VECTOR2I& aP, PNS_LINE& aNewHead )
...
@@ -482,16 +482,16 @@ bool PNS_LINE_PLACER::rhShoveOnly ( const VECTOR2I& aP, PNS_LINE& aNewHead )
l2
.
AppendVia
(
v2
);
l2
.
AppendVia
(
v2
);
}
}
l
.
Line
().
Simplify
();
l
.
Line
().
Simplify
();
// in certain, uncommon cases there may be loops in the head+tail, In such case, we don't shove to avoid
// in certain, uncommon cases there may be loops in the head+tail, In such case, we don't shove to avoid
// screwing up the database.
// screwing up the database.
if
(
l
.
HasLoops
()
)
if
(
l
.
HasLoops
()
)
{
{
aNewHead
=
m_head
;
aNewHead
=
m_head
;
return
false
;
return
false
;
}
}
PNS_SHOVE
::
SHOVE_STATUS
status
=
m_shove
->
ShoveLines
(
l
);
PNS_SHOVE
::
SHOVE_STATUS
status
=
m_shove
->
ShoveLines
(
l
);
m_currentNode
=
m_shove
->
CurrentNode
();
m_currentNode
=
m_shove
->
CurrentNode
();
...
@@ -536,7 +536,7 @@ bool PNS_LINE_PLACER::routeHead( const VECTOR2I& aP, PNS_LINE& aNewHead )
...
@@ -536,7 +536,7 @@ bool PNS_LINE_PLACER::routeHead( const VECTOR2I& aP, PNS_LINE& aNewHead )
default
:
default
:
break
;
break
;
}
}
return
false
;
return
false
;
}
}
...
@@ -550,14 +550,14 @@ bool PNS_LINE_PLACER::optimizeTailHeadTransition()
...
@@ -550,14 +550,14 @@ bool PNS_LINE_PLACER::optimizeTailHeadTransition()
if
(
tmp
.
SegmentCount
()
<
1
)
if
(
tmp
.
SegmentCount
()
<
1
)
return
false
;
return
false
;
m_head
=
tmp
;
m_head
=
tmp
;
m_p_start
=
tmp
.
CLine
().
CPoint
(
0
);
m_p_start
=
tmp
.
CLine
().
CPoint
(
0
);
m_direction
=
DIRECTION_45
(
tmp
.
CSegment
(
0
)
);
m_direction
=
DIRECTION_45
(
tmp
.
CSegment
(
0
)
);
m_tail
.
Line
().
Clear
();
m_tail
.
Line
().
Clear
();
return
true
;
return
true
;
}
}
SHAPE_LINE_CHAIN
&
head
=
m_head
.
Line
();
SHAPE_LINE_CHAIN
&
head
=
m_head
.
Line
();
SHAPE_LINE_CHAIN
&
tail
=
m_tail
.
Line
();
SHAPE_LINE_CHAIN
&
tail
=
m_tail
.
Line
();
...
@@ -676,9 +676,9 @@ const PNS_LINE PNS_LINE_PLACER::Trace() const
...
@@ -676,9 +676,9 @@ const PNS_LINE PNS_LINE_PLACER::Trace() const
}
}
const
PNS_ITEMSET
PNS_LINE_PLACER
::
Traces
()
const
PNS_ITEMSET
PNS_LINE_PLACER
::
Traces
()
{
{
m_currentTrace
=
Trace
();
m_currentTrace
=
Trace
();
return
PNS_ITEMSET
(
&
m_currentTrace
);
return
PNS_ITEMSET
(
&
m_currentTrace
);
}
}
...
@@ -703,13 +703,13 @@ void PNS_LINE_PLACER::splitAdjacentSegments( PNS_NODE* aNode, PNS_ITEM* aSeg, co
...
@@ -703,13 +703,13 @@ void PNS_LINE_PLACER::splitAdjacentSegments( PNS_NODE* aNode, PNS_ITEM* aSeg, co
{
{
if
(
aSeg
&&
aSeg
->
OfKind
(
PNS_ITEM
::
SEGMENT
)
)
if
(
aSeg
&&
aSeg
->
OfKind
(
PNS_ITEM
::
SEGMENT
)
)
{
{
PNS_JOINT
*
jt
=
aNode
->
FindJoint
(
aP
,
aSeg
);
PNS_JOINT
*
jt
=
aNode
->
FindJoint
(
aP
,
aSeg
);
if
(
jt
&&
jt
->
LinkCount
()
>=
1
)
if
(
jt
&&
jt
->
LinkCount
()
>=
1
)
return
;
return
;
PNS_SEGMENT
*
s_old
=
static_cast
<
PNS_SEGMENT
*>
(
aSeg
);
PNS_SEGMENT
*
s_old
=
static_cast
<
PNS_SEGMENT
*>
(
aSeg
);
PNS_SEGMENT
*
s_new
[
2
];
PNS_SEGMENT
*
s_new
[
2
];
s_new
[
0
]
=
s_old
->
Clone
();
s_new
[
0
]
=
s_old
->
Clone
();
...
@@ -727,13 +727,13 @@ void PNS_LINE_PLACER::splitAdjacentSegments( PNS_NODE* aNode, PNS_ITEM* aSeg, co
...
@@ -727,13 +727,13 @@ void PNS_LINE_PLACER::splitAdjacentSegments( PNS_NODE* aNode, PNS_ITEM* aSeg, co
bool
PNS_LINE_PLACER
::
SetLayer
(
int
aLayer
)
bool
PNS_LINE_PLACER
::
SetLayer
(
int
aLayer
)
{
{
if
(
m_idle
)
if
(
m_idle
)
{
{
m_currentLayer
=
aLayer
;
m_currentLayer
=
aLayer
;
return
true
;
return
true
;
}
else
if
(
m_chainedPlacement
)
{
}
else
if
(
m_chainedPlacement
)
{
return
false
;
return
false
;
}
else
if
(
!
m_startItem
||
(
m_startItem
->
OfKind
(
PNS_ITEM
::
VIA
)
&&
m_startItem
->
Layers
().
Overlaps
(
aLayer
))
)
{
}
else
if
(
!
m_startItem
||
(
m_startItem
->
OfKind
(
PNS_ITEM
::
VIA
)
&&
m_startItem
->
Layers
().
Overlaps
(
aLayer
)
)
)
{
m_currentLayer
=
aLayer
;
m_currentLayer
=
aLayer
;
m_splitSeg
=
false
;
m_splitSeg
=
false
;
initPlacement
(
m_splitSeg
);
initPlacement
(
m_splitSeg
);
...
@@ -755,7 +755,7 @@ void PNS_LINE_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
...
@@ -755,7 +755,7 @@ void PNS_LINE_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
if
(
Router
()
->
SnappingEnabled
()
)
if
(
Router
()
->
SnappingEnabled
()
)
p
=
Router
()
->
SnapToItem
(
aStartItem
,
aP
,
splitSeg
);
p
=
Router
()
->
SnapToItem
(
aStartItem
,
aP
,
splitSeg
);
if
(
!
aStartItem
||
aStartItem
->
Net
()
<
0
)
if
(
!
aStartItem
||
aStartItem
->
Net
()
<
0
)
net
=
unknowNetIdx
--
;
net
=
unknowNetIdx
--
;
else
else
...
@@ -770,8 +770,8 @@ void PNS_LINE_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
...
@@ -770,8 +770,8 @@ void PNS_LINE_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem )
m_splitSeg
=
splitSeg
;
m_splitSeg
=
splitSeg
;
setInitialDirection
(
Settings
().
InitialDirection
()
);
setInitialDirection
(
Settings
().
InitialDirection
()
);
initPlacement
(
m_splitSeg
);
initPlacement
(
m_splitSeg
);
}
}
void
PNS_LINE_PLACER
::
initPlacement
(
bool
aSplitSeg
)
void
PNS_LINE_PLACER
::
initPlacement
(
bool
aSplitSeg
)
...
@@ -786,12 +786,12 @@ void PNS_LINE_PLACER::initPlacement( bool aSplitSeg )
...
@@ -786,12 +786,12 @@ void PNS_LINE_PLACER::initPlacement( bool aSplitSeg )
m_tail
.
SetLayer
(
m_currentLayer
);
m_tail
.
SetLayer
(
m_currentLayer
);
m_head
.
SetWidth
(
m_sizes
.
TrackWidth
()
);
m_head
.
SetWidth
(
m_sizes
.
TrackWidth
()
);
m_tail
.
SetWidth
(
m_sizes
.
TrackWidth
()
);
m_tail
.
SetWidth
(
m_sizes
.
TrackWidth
()
);
m_p_start
=
m_currentStart
;
m_p_start
=
m_currentStart
;
m_direction
=
m_initial_direction
;
m_direction
=
m_initial_direction
;
PNS_NODE
*
world
=
Router
()
->
GetWorld
();
PNS_NODE
*
world
=
Router
()
->
GetWorld
();
world
->
KillChildren
();
world
->
KillChildren
();
PNS_NODE
*
rootNode
=
world
->
Branch
();
PNS_NODE
*
rootNode
=
world
->
Branch
();
...
@@ -799,23 +799,23 @@ void PNS_LINE_PLACER::initPlacement( bool aSplitSeg )
...
@@ -799,23 +799,23 @@ void PNS_LINE_PLACER::initPlacement( bool aSplitSeg )
splitAdjacentSegments
(
rootNode
,
m_startItem
,
m_currentStart
);
splitAdjacentSegments
(
rootNode
,
m_startItem
,
m_currentStart
);
setWorld
(
rootNode
);
setWorld
(
rootNode
);
TRACE
(
1
,
"world %p, intitial-direction %s layer %d
\n
"
,
TRACE
(
1
,
"world %p, intitial-direction %s layer %d
\n
"
,
m_world
%
m_direction
.
Format
().
c_str
()
%
aLayer
);
m_world
%
m_direction
.
Format
().
c_str
()
%
aLayer
);
m_lastNode
=
NULL
;
m_lastNode
=
NULL
;
m_currentNode
=
m_world
;
m_currentNode
=
m_world
;
m_currentMode
=
Settings
().
Mode
();
m_currentMode
=
Settings
().
Mode
();
if
(
m_shove
)
if
(
m_shove
)
delete
m_shove
;
delete
m_shove
;
m_shove
=
NULL
;
m_shove
=
NULL
;
if
(
m_currentMode
==
RM_Shove
||
m_currentMode
==
RM_Smart
)
if
(
m_currentMode
==
RM_Shove
||
m_currentMode
==
RM_Smart
)
{
{
m_shove
=
new
PNS_SHOVE
(
m_world
->
Branch
(),
Router
()
);
m_shove
=
new
PNS_SHOVE
(
m_world
->
Branch
(),
Router
()
);
}
}
}
}
...
@@ -824,20 +824,20 @@ void PNS_LINE_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
...
@@ -824,20 +824,20 @@ void PNS_LINE_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
PNS_LINE
current
;
PNS_LINE
current
;
VECTOR2I
p
=
aP
;
VECTOR2I
p
=
aP
;
int
eiDepth
=
-
1
;
int
eiDepth
=
-
1
;
if
(
aEndItem
&&
aEndItem
->
Owner
()
)
if
(
aEndItem
&&
aEndItem
->
Owner
()
)
eiDepth
=
aEndItem
->
Owner
()
->
Depth
();
eiDepth
=
aEndItem
->
Owner
()
->
Depth
();
if
(
m_lastNode
)
if
(
m_lastNode
)
{
{
delete
m_lastNode
;
delete
m_lastNode
;
m_lastNode
=
NULL
;
m_lastNode
=
NULL
;
}
}
route
(
p
);
route
(
p
);
current
=
Trace
();
current
=
Trace
();
if
(
!
current
.
PointCount
()
)
if
(
!
current
.
PointCount
()
)
m_currentEnd
=
m_p_start
;
m_currentEnd
=
m_p_start
;
else
else
...
@@ -845,14 +845,14 @@ void PNS_LINE_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
...
@@ -845,14 +845,14 @@ void PNS_LINE_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem )
PNS_NODE
*
latestNode
=
m_currentNode
;
PNS_NODE
*
latestNode
=
m_currentNode
;
m_lastNode
=
latestNode
->
Branch
();
m_lastNode
=
latestNode
->
Branch
();
if
(
eiDepth
>=
0
&&
aEndItem
&&
latestNode
->
Depth
()
>
eiDepth
&&
if
(
eiDepth
>=
0
&&
aEndItem
&&
latestNode
->
Depth
()
>
eiDepth
&&
current
.
SegmentCount
()
&&
current
.
CPoint
(
-
1
)
==
aP
)
current
.
SegmentCount
()
&&
current
.
CPoint
(
-
1
)
==
aP
)
{
{
splitAdjacentSegments
(
m_lastNode
,
aEndItem
,
current
.
CPoint
(
-
1
)
);
splitAdjacentSegments
(
m_lastNode
,
aEndItem
,
current
.
CPoint
(
-
1
)
);
if
(
Settings
().
RemoveLoops
()
)
if
(
Settings
().
RemoveLoops
()
)
removeLoops
(
m_lastNode
,
&
current
);
removeLoops
(
m_lastNode
,
&
current
);
}
}
updateLeadingRatLine
();
updateLeadingRatLine
();
...
@@ -863,7 +863,7 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
...
@@ -863,7 +863,7 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
{
{
bool
realEnd
=
false
;
bool
realEnd
=
false
;
int
lastV
;
int
lastV
;
PNS_LINE
pl
=
Trace
();
PNS_LINE
pl
=
Trace
();
if
(
m_currentMode
==
RM_MarkObstacles
&&
if
(
m_currentMode
==
RM_MarkObstacles
&&
...
@@ -908,9 +908,9 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
...
@@ -908,9 +908,9 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
if
(
realEnd
)
if
(
realEnd
)
simplifyNewLine
(
m_lastNode
,
lastSeg
);
simplifyNewLine
(
m_lastNode
,
lastSeg
);
Router
()
->
CommitRouting
(
m_lastNode
);
Router
()
->
CommitRouting
(
m_lastNode
);
m_lastNode
=
NULL
;
m_lastNode
=
NULL
;
if
(
!
realEnd
)
if
(
!
realEnd
)
...
@@ -921,7 +921,7 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
...
@@ -921,7 +921,7 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
m_placingVia
=
false
;
m_placingVia
=
false
;
m_chainedPlacement
=
!
pl
.
EndsWithVia
();
m_chainedPlacement
=
!
pl
.
EndsWithVia
();
m_splitSeg
=
false
;
m_splitSeg
=
false
;
initPlacement
(
);
initPlacement
(
);
}
else
{
}
else
{
m_idle
=
true
;
m_idle
=
true
;
}
}
...
@@ -936,10 +936,10 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE* aLatest )
...
@@ -936,10 +936,10 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE* aLatest )
return
;
return
;
aNode
->
Add
(
aLatest
,
true
);
aNode
->
Add
(
aLatest
,
true
);
for
(
int
s
=
0
;
s
<
aLatest
->
SegmentCount
();
s
++
)
for
(
int
s
=
0
;
s
<
aLatest
->
SegmentCount
();
s
++
)
{
{
PNS_SEGMENT
*
seg
=
(
*
aLatest
->
LinkedSegments
()
)[
s
];
PNS_SEGMENT
*
seg
=
(
*
aLatest
->
LinkedSegments
()
)[
s
];
PNS_LINE
*
ourLine
=
aNode
->
AssembleLine
(
seg
);
PNS_LINE
*
ourLine
=
aNode
->
AssembleLine
(
seg
);
PNS_JOINT
a
,
b
;
PNS_JOINT
a
,
b
;
std
::
vector
<
PNS_LINE
*>
lines
;
std
::
vector
<
PNS_LINE
*>
lines
;
...
@@ -950,7 +950,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE* aLatest )
...
@@ -950,7 +950,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE* aLatest )
{
{
aNode
->
FindLineEnds
(
aLatest
,
a
,
b
);
aNode
->
FindLineEnds
(
aLatest
,
a
,
b
);
}
}
aNode
->
FindLinesBetweenJoints
(
a
,
b
,
lines
);
aNode
->
FindLinesBetweenJoints
(
a
,
b
,
lines
);
int
removedCount
=
0
;
int
removedCount
=
0
;
...
@@ -976,7 +976,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE* aLatest )
...
@@ -976,7 +976,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE* aLatest )
delete
ourLine
;
delete
ourLine
;
}
}
aNode
->
Remove
(
aLatest
);
aNode
->
Remove
(
aLatest
);
}
}
...
@@ -991,8 +991,8 @@ void PNS_LINE_PLACER::simplifyNewLine( PNS_NODE* aNode, PNS_SEGMENT* aLatest )
...
@@ -991,8 +991,8 @@ void PNS_LINE_PLACER::simplifyNewLine( PNS_NODE* aNode, PNS_SEGMENT* aLatest )
if
(
simplified
.
PointCount
()
!=
l
->
PointCount
()
)
if
(
simplified
.
PointCount
()
!=
l
->
PointCount
()
)
{
{
std
::
auto_ptr
<
PNS_LINE
>
lnew
(
l
->
Clone
()
);
std
::
auto_ptr
<
PNS_LINE
>
lnew
(
l
->
Clone
()
);
aNode
->
Remove
(
l
);
aNode
->
Remove
(
l
);
lnew
->
SetShape
(
simplified
);
lnew
->
SetShape
(
simplified
);
aNode
->
Add
(
lnew
.
get
()
);
aNode
->
Add
(
lnew
.
get
()
);
}
}
}
}
...
@@ -1012,21 +1012,21 @@ void PNS_LINE_PLACER::UpdateSizes( const PNS_SIZES_SETTINGS& aSizes )
...
@@ -1012,21 +1012,21 @@ void PNS_LINE_PLACER::UpdateSizes( const PNS_SIZES_SETTINGS& aSizes )
void
PNS_LINE_PLACER
::
updateLeadingRatLine
()
void
PNS_LINE_PLACER
::
updateLeadingRatLine
()
{
{
PNS_LINE
current
=
Trace
();
PNS_LINE
current
=
Trace
();
if
(
!
current
.
PointCount
()
)
if
(
!
current
.
PointCount
()
)
return
;
return
;
std
::
auto_ptr
<
PNS_NODE
>
tmpNode
(
m_lastNode
->
Branch
()
);
std
::
auto_ptr
<
PNS_NODE
>
tmpNode
(
m_lastNode
->
Branch
()
);
tmpNode
->
Add
(
&
current
);
tmpNode
->
Add
(
&
current
);
PNS_JOINT
*
jt
=
tmpNode
->
FindJoint
(
current
.
CPoint
(
-
1
),
PNS_JOINT
*
jt
=
tmpNode
->
FindJoint
(
current
.
CPoint
(
-
1
),
current
.
Layers
().
Start
(),
current
.
Net
()
);
current
.
Layers
().
Start
(),
current
.
Net
()
);
if
(
!
jt
)
if
(
!
jt
)
return
;
return
;
int
anchor
;
int
anchor
;
PNS_ITEM
*
it
=
tmpNode
->
NearestUnconnectedItem
(
jt
,
&
anchor
);
PNS_ITEM
*
it
=
tmpNode
->
NearestUnconnectedItem
(
jt
,
&
anchor
);
if
(
it
)
if
(
it
)
{
{
...
...
pcbnew/router/pns_line_placer.h
View file @
9245b903
...
@@ -43,7 +43,7 @@ class PNS_SIZES_SETTINGS;
...
@@ -43,7 +43,7 @@ class PNS_SIZES_SETTINGS;
/**
/**
* Class PNS_LINE_PLACER
* Class PNS_LINE_PLACER
*
*
* Single track placement algorithm. Interactively routes a track.
* Single track placement algorithm. Interactively routes a track.
* Applies shove and walkaround algorithms when needed.
* Applies shove and walkaround algorithms when needed.
*/
*/
...
@@ -55,7 +55,7 @@ public:
...
@@ -55,7 +55,7 @@ public:
/**
/**
* Function Start()
* Function Start()
*
*
* Starts routing a single track at point aP, taking item aStartItem as anchor
* Starts routing a single track at point aP, taking item aStartItem as anchor
* (unless NULL).
* (unless NULL).
*/
*/
...
@@ -63,8 +63,8 @@ public:
...
@@ -63,8 +63,8 @@ public:
/**
/**
* Function Move()
* Function Move()
*
*
* Moves the end of the currently routed trace to the point aP, taking
* Moves the end of the currently routed trace to the point aP, taking
* aEndItem as anchor (if not NULL).
* aEndItem as anchor (if not NULL).
* (unless NULL).
* (unless NULL).
*/
*/
...
@@ -72,7 +72,7 @@ public:
...
@@ -72,7 +72,7 @@ public:
/**
/**
* Function FixRoute()
* Function FixRoute()
*
*
* Commits the currently routed track to the parent node, taking
* Commits the currently routed track to the parent node, taking
* aP as the final end point and aEndItem as the final anchor (if provided).
* aP as the final end point and aEndItem as the final anchor (if provided).
* @return true, if route has been commited. May return false if the routing
* @return true, if route has been commited. May return false if the routing
...
@@ -80,10 +80,10 @@ public:
...
@@ -80,10 +80,10 @@ public:
* if Settings.CanViolateDRC() is on.
* if Settings.CanViolateDRC() is on.
*/
*/
bool
FixRoute
(
const
VECTOR2I
&
aP
,
PNS_ITEM
*
aEndItem
);
bool
FixRoute
(
const
VECTOR2I
&
aP
,
PNS_ITEM
*
aEndItem
);
/**
/**
* Function ToggleVia()
* Function ToggleVia()
*
*
* Enables/disables a via at the end of currently routed trace.
* Enables/disables a via at the end of currently routed trace.
*/
*/
void
ToggleVia
(
bool
aEnabled
);
void
ToggleVia
(
bool
aEnabled
);
...
@@ -103,7 +103,7 @@ public:
...
@@ -103,7 +103,7 @@ public:
* that has not "settled" yet.
* that has not "settled" yet.
*/
*/
const
PNS_LINE
&
Head
()
const
{
return
m_head
;
}
const
PNS_LINE
&
Head
()
const
{
return
m_head
;
}
/**
/**
* Function Tail()
* Function Tail()
*
*
...
@@ -131,7 +131,7 @@ public:
...
@@ -131,7 +131,7 @@ public:
*
*
* Returns the current end of the line being placed. It may not be equal
* Returns the current end of the line being placed. It may not be equal
* to the cursor position due to collisions.
* to the cursor position due to collisions.
*/
*/
const
VECTOR2I
&
CurrentEnd
()
const
const
VECTOR2I
&
CurrentEnd
()
const
{
{
return
m_currentEnd
;
return
m_currentEnd
;
...
@@ -141,8 +141,8 @@ public:
...
@@ -141,8 +141,8 @@ public:
* Function CurrentNet()
* Function CurrentNet()
*
*
* Returns the net code of currently routed track.
* Returns the net code of currently routed track.
*/
*/
int
CurrentNet
()
const
int
CurrentNet
()
const
{
{
return
m_currentNet
;
return
m_currentNet
;
}
}
...
@@ -151,8 +151,8 @@ public:
...
@@ -151,8 +151,8 @@ public:
* Function CurrentLayer()
* Function CurrentLayer()
*
*
* Returns the layer of currently routed track.
* Returns the layer of currently routed track.
*/
*/
int
CurrentLayer
()
const
int
CurrentLayer
()
const
{
{
return
m_currentLayer
;
return
m_currentLayer
;
}
}
...
@@ -163,14 +163,14 @@ public:
...
@@ -163,14 +163,14 @@ public:
* Returns the most recent world state.
* Returns the most recent world state.
*/
*/
PNS_NODE
*
CurrentNode
(
bool
aLoopsRemoved
=
false
)
const
;
PNS_NODE
*
CurrentNode
(
bool
aLoopsRemoved
=
false
)
const
;
/**
/**
* Function FlipPosture()
* Function FlipPosture()
*
*
* Toggles the current posture (straight/diagonal) of the trace head.
* Toggles the current posture (straight/diagonal) of the trace head.
*/
*/
void
FlipPosture
();
void
FlipPosture
();
/**
/**
* Function UpdateSizes()
* Function UpdateSizes()
*
*
...
@@ -198,18 +198,18 @@ private:
...
@@ -198,18 +198,18 @@ private:
* Function updateLeadingRatLine()
* Function updateLeadingRatLine()
*
*
* Draws the "leading" ratsnest line, which connects the end of currently
* Draws the "leading" ratsnest line, which connects the end of currently
* routed track and the nearest yet unrouted item. If the routing for
* routed track and the nearest yet unrouted item. If the routing for
* current net is complete, draws nothing.
* current net is complete, draws nothing.
*/
*/
void
updateLeadingRatLine
();
void
updateLeadingRatLine
();
/**
/**
* Function setWorld()
* Function setWorld()
*
*
* Sets the board to route.
* Sets the board to route.
*/
*/
void
setWorld
(
PNS_NODE
*
aWorld
);
void
setWorld
(
PNS_NODE
*
aWorld
);
/**
/**
* Function startPlacement()
* Function startPlacement()
*
*
...
@@ -245,10 +245,10 @@ private:
...
@@ -245,10 +245,10 @@ private:
* Function simplifyNewLine()
* Function simplifyNewLine()
*
*
* Assembles a line starting from segment aLatest, removes collinear segments
* Assembles a line starting from segment aLatest, removes collinear segments
* and redundant vertexes. If a simplification bhas been found, replaces the
* and redundant vertexes. If a simplification bhas been found, replaces the
* old line with the simplified one in aNode.
* old line with the simplified one in aNode.
*/
*/
void
simplifyNewLine
(
PNS_NODE
*
aNode
,
PNS_SEGMENT
*
aLatest
);
void
simplifyNewLine
(
PNS_NODE
*
aNode
,
PNS_SEGMENT
*
aLatest
);
/**
/**
* Function handleViaPlacement()
* Function handleViaPlacement()
...
@@ -385,7 +385,7 @@ private:
...
@@ -385,7 +385,7 @@ private:
///> current via drill
///> current via drill
int
m_viaDrill
;
int
m_viaDrill
;
///> current track width
///> current track width
int
m_currentWidth
;
int
m_currentWidth
;
...
@@ -393,12 +393,12 @@ private:
...
@@ -393,12 +393,12 @@ private:
int
m_currentLayer
;
int
m_currentLayer
;
bool
m_startsOnVia
;
bool
m_startsOnVia
;
VECTOR2I
m_currentEnd
,
m_currentStart
;
VECTOR2I
m_currentEnd
,
m_currentStart
;
PNS_LINE
m_currentTrace
;
PNS_LINE
m_currentTrace
;
PNS_MODE
m_currentMode
;
PNS_MODE
m_currentMode
;
PNS_ITEM
*
m_startItem
;
PNS_ITEM
*
m_startItem
;
bool
m_idle
;
bool
m_idle
;
bool
m_chainedPlacement
;
bool
m_chainedPlacement
;
...
...
pcbnew/router/pns_router.cpp
View file @
9245b903
...
@@ -456,7 +456,7 @@ bool PNS_ROUTER::StartDragging( const VECTOR2I& aP, PNS_ITEM* aStartItem )
...
@@ -456,7 +456,7 @@ bool PNS_ROUTER::StartDragging( const VECTOR2I& aP, PNS_ITEM* aStartItem )
bool
PNS_ROUTER
::
StartRouting
(
const
VECTOR2I
&
aP
,
PNS_ITEM
*
aStartItem
,
int
aLayer
)
bool
PNS_ROUTER
::
StartRouting
(
const
VECTOR2I
&
aP
,
PNS_ITEM
*
aStartItem
,
int
aLayer
)
{
{
m_placer
=
new
PNS_LINE_PLACER
(
this
);
m_placer
=
new
PNS_LINE_PLACER
(
this
);
m_placer
->
UpdateSizes
(
m_sizes
);
m_placer
->
UpdateSizes
(
m_sizes
);
m_placer
->
SetLayer
(
aLayer
);
m_placer
->
SetLayer
(
aLayer
);
m_placer
->
Start
(
aP
,
aStartItem
);
m_placer
->
Start
(
aP
,
aStartItem
);
...
@@ -504,7 +504,7 @@ void PNS_ROUTER::DisplayItem( const PNS_ITEM* aItem, int aColor, int aClearance
...
@@ -504,7 +504,7 @@ void PNS_ROUTER::DisplayItem( const PNS_ITEM* aItem, int aColor, int aClearance
void
PNS_ROUTER
::
DisplayItems
(
const
PNS_ITEMSET
&
aItems
)
void
PNS_ROUTER
::
DisplayItems
(
const
PNS_ITEMSET
&
aItems
)
{
{
BOOST_FOREACH
(
const
PNS_ITEM
*
item
,
aItems
.
CItems
()
)
BOOST_FOREACH
(
const
PNS_ITEM
*
item
,
aItems
.
CItems
()
)
DisplayItem
(
item
);
DisplayItem
(
item
);
}
}
...
@@ -604,7 +604,7 @@ void PNS_ROUTER::updateView( PNS_NODE* aNode, PNS_ITEMSET& aCurrent )
...
@@ -604,7 +604,7 @@ void PNS_ROUTER::updateView( PNS_NODE* aNode, PNS_ITEMSET& aCurrent )
return
;
return
;
if
(
Settings
().
Mode
()
==
RM_MarkObstacles
)
if
(
Settings
().
Mode
()
==
RM_MarkObstacles
)
markViolations
(
aNode
,
aCurrent
,
removed
);
markViolations
(
aNode
,
aCurrent
,
removed
);
aNode
->
GetUpdatedItems
(
removed
,
added
);
aNode
->
GetUpdatedItems
(
removed
,
added
);
...
@@ -760,7 +760,7 @@ bool PNS_ROUTER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
...
@@ -760,7 +760,7 @@ bool PNS_ROUTER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
void
PNS_ROUTER
::
StopRouting
()
void
PNS_ROUTER
::
StopRouting
()
{
{
// Update the ratsnest with new changes
// Update the ratsnest with new changes
if
(
m_placer
)
if
(
m_placer
)
{
{
int
n
=
m_placer
->
CurrentNet
();
int
n
=
m_placer
->
CurrentNet
();
...
@@ -827,7 +827,7 @@ void PNS_ROUTER::ToggleViaPlacement()
...
@@ -827,7 +827,7 @@ void PNS_ROUTER::ToggleViaPlacement()
int
PNS_ROUTER
::
GetCurrentNet
()
const
int
PNS_ROUTER
::
GetCurrentNet
()
const
{
{
if
(
m_placer
)
if
(
m_placer
)
return
m_placer
->
CurrentNet
();
return
m_placer
->
CurrentNet
();
return
-
1
;
return
-
1
;
}
}
...
@@ -841,7 +841,6 @@ int PNS_ROUTER::GetCurrentLayer() const
...
@@ -841,7 +841,6 @@ int PNS_ROUTER::GetCurrentLayer() const
}
}
void
PNS_ROUTER
::
DumpLog
()
void
PNS_ROUTER
::
DumpLog
()
{
{
PNS_LOGGER
*
logger
=
NULL
;
PNS_LOGGER
*
logger
=
NULL
;
...
...
pcbnew/router/pns_router.h
View file @
9245b903
...
@@ -217,7 +217,7 @@ private:
...
@@ -217,7 +217,7 @@ private:
void
highlightCurrent
(
bool
enabled
);
void
highlightCurrent
(
bool
enabled
);
void
markViolations
(
PNS_NODE
*
aNode
,
PNS_ITEMSET
&
aCurrent
,
PNS_NODE
::
ITEM_VECTOR
&
aRemoved
);
void
markViolations
(
PNS_NODE
*
aNode
,
PNS_ITEMSET
&
aCurrent
,
PNS_NODE
::
ITEM_VECTOR
&
aRemoved
);
VECTOR2I
m_currentEnd
;
VECTOR2I
m_currentEnd
;
RouterState
m_state
;
RouterState
m_state
;
...
...
pcbnew/router/pns_routing_settings.h
View file @
9245b903
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include "time_limit.h"
#include "time_limit.h"
class
DIRECTION_45
;
class
DIRECTION_45
;
///> Routing modes
///> Routing modes
enum
PNS_MODE
enum
PNS_MODE
{
{
...
@@ -37,9 +37,9 @@ enum PNS_MODE
...
@@ -37,9 +37,9 @@ enum PNS_MODE
};
};
///> Optimization effort
///> Optimization effort
enum
PNS_OPTIMIZATION_EFFORT
enum
PNS_OPTIMIZATION_EFFORT
{
{
OE_LOW
=
0
,
OE_LOW
=
0
,
OE_MEDIUM
=
1
,
OE_MEDIUM
=
1
,
OE_FULL
=
2
OE_FULL
=
2
};
};
...
@@ -60,44 +60,44 @@ public:
...
@@ -60,44 +60,44 @@ public:
///> Sets the routing mode.
///> Sets the routing mode.
void
SetMode
(
PNS_MODE
aMode
)
{
m_routingMode
=
aMode
;
}
void
SetMode
(
PNS_MODE
aMode
)
{
m_routingMode
=
aMode
;
}
///> Returns the optimizer effort. Bigger means cleaner traces, but slower routing.
///> Returns the optimizer effort. Bigger means cleaner traces, but slower routing.
PNS_OPTIMIZATION_EFFORT
OptimizerEffort
()
const
{
return
m_optimizerEffort
;
}
PNS_OPTIMIZATION_EFFORT
OptimizerEffort
()
const
{
return
m_optimizerEffort
;
}
///> Sets the optimizer effort. Bigger means cleaner traces, but slower routing.
///> Sets the optimizer effort. Bigger means cleaner traces, but slower routing.
void
SetOptimizerEffort
(
PNS_OPTIMIZATION_EFFORT
aEffort
)
{
m_optimizerEffort
=
aEffort
;
}
void
SetOptimizerEffort
(
PNS_OPTIMIZATION_EFFORT
aEffort
)
{
m_optimizerEffort
=
aEffort
;
}
///> Returns true if shoving vias is enbled.
///> Returns true if shoving vias is enbled.
bool
ShoveVias
()
const
{
return
m_shoveVias
;
}
bool
ShoveVias
()
const
{
return
m_shoveVias
;
}
///> Enables/disables shoving vias.
///> Enables/disables shoving vias.
void
SetShoveVias
(
bool
aShoveVias
)
{
m_shoveVias
=
aShoveVias
;
}
void
SetShoveVias
(
bool
aShoveVias
)
{
m_shoveVias
=
aShoveVias
;
}
///> Returns true if loop (redundant track) removal is on.
///> Returns true if loop (redundant track) removal is on.
bool
RemoveLoops
()
const
{
return
m_removeLoops
;
}
bool
RemoveLoops
()
const
{
return
m_removeLoops
;
}
///> Enables/disables loop (redundant track) removal.
///> Enables/disables loop (redundant track) removal.
void
SetRemoveLoops
(
bool
aRemoveLoops
)
{
m_removeLoops
=
aRemoveLoops
;
}
void
SetRemoveLoops
(
bool
aRemoveLoops
)
{
m_removeLoops
=
aRemoveLoops
;
}
///> Returns true if suggesting the finish of currently placed track is on.
///> Returns true if suggesting the finish of currently placed track is on.
bool
SuggestFinish
()
{
return
m_suggestFinish
;
}
bool
SuggestFinish
()
{
return
m_suggestFinish
;
}
///> Enables displaying suggestions for finishing the currently placed track.
///> Enables displaying suggestions for finishing the currently placed track.
void
SetSuggestFinish
(
bool
aSuggestFinish
)
{
m_suggestFinish
=
aSuggestFinish
;
}
void
SetSuggestFinish
(
bool
aSuggestFinish
)
{
m_suggestFinish
=
aSuggestFinish
;
}
///> Returns true if Smart Pads (automatic neckdown) is enabled.
///> Returns true if Smart Pads (automatic neckdown) is enabled.
bool
SmartPads
()
const
{
return
m_smartPads
;
}
bool
SmartPads
()
const
{
return
m_smartPads
;
}
///> Enables/disables Smart Pads (automatic neckdown).
///> Enables/disables Smart Pads (automatic neckdown).
void
SetSmartPads
(
bool
aSmartPads
)
{
m_smartPads
=
aSmartPads
;
}
void
SetSmartPads
(
bool
aSmartPads
)
{
m_smartPads
=
aSmartPads
;
}
///> Returns true if follow mouse mode is active (permanently on for the moment).
///> Returns true if follow mouse mode is active (permanently on for the moment).
bool
FollowMouse
()
const
bool
FollowMouse
()
const
{
{
return
m_followMouse
&&
!
(
Mode
()
==
RM_MarkObstacles
);
return
m_followMouse
&&
!
(
Mode
()
==
RM_MarkObstacles
);
}
}
///> Returns true if smoothing segments durign dragging is enabled.
///> Returns true if smoothing segments durign dragging is enabled.
bool
SmoothDraggedSegments
()
const
{
return
m_smoothDraggedSegments
;
}
bool
SmoothDraggedSegments
()
const
{
return
m_smoothDraggedSegments
;
}
///> Enables/disabled smoothing segments during dragging.
///> Enables/disabled smoothing segments during dragging.
...
@@ -106,11 +106,11 @@ public:
...
@@ -106,11 +106,11 @@ public:
///> Returns true if jumping over unmovable obstacles is on.
///> Returns true if jumping over unmovable obstacles is on.
bool
JumpOverObstacles
()
const
{
return
m_jumpOverObstacles
;
}
bool
JumpOverObstacles
()
const
{
return
m_jumpOverObstacles
;
}
///> Enables/disables jumping over unmovable obstacles.
///> Enables/disables jumping over unmovable obstacles.
void
SetJumpOverObstacles
(
bool
aJumpOverObstacles
)
{
m_jumpOverObstacles
=
aJumpOverObstacles
;
}
void
SetJumpOverObstacles
(
bool
aJumpOverObstacles
)
{
m_jumpOverObstacles
=
aJumpOverObstacles
;
}
void
SetStartDiagonal
(
bool
aStartDiagonal
)
{
m_startDiagonal
=
aStartDiagonal
;
}
void
SetStartDiagonal
(
bool
aStartDiagonal
)
{
m_startDiagonal
=
aStartDiagonal
;
}
bool
CanViolateDRC
()
const
{
return
m_canViolateDRC
;
}
bool
CanViolateDRC
()
const
{
return
m_canViolateDRC
;
}
void
SetCanViolateDRC
(
bool
aViolate
)
{
m_canViolateDRC
=
aViolate
;
}
void
SetCanViolateDRC
(
bool
aViolate
)
{
m_canViolateDRC
=
aViolate
;
}
...
@@ -136,7 +136,7 @@ private:
...
@@ -136,7 +136,7 @@ private:
PNS_MODE
m_routingMode
;
PNS_MODE
m_routingMode
;
PNS_OPTIMIZATION_EFFORT
m_optimizerEffort
;
PNS_OPTIMIZATION_EFFORT
m_optimizerEffort
;
int
m_walkaroundIterationLimit
;
int
m_walkaroundIterationLimit
;
int
m_shoveIterationLimit
;
int
m_shoveIterationLimit
;
...
...
pcbnew/router/pns_shove.cpp
View file @
9245b903
This diff is collapsed.
Click to expand it.
pcbnew/router/pns_shove.h
View file @
9245b903
...
@@ -37,7 +37,7 @@ class PNS_ROUTER;
...
@@ -37,7 +37,7 @@ class PNS_ROUTER;
/**
/**
* Class PNS_SHOVE
* Class PNS_SHOVE
*
*
* The actual Push and Shove algorithm.
* The actual Push and Shove algorithm.
*/
*/
class
PNS_SHOVE
:
public
PNS_ALGO_BASE
class
PNS_SHOVE
:
public
PNS_ALGO_BASE
...
@@ -88,11 +88,11 @@ private:
...
@@ -88,11 +88,11 @@ private:
SHOVE_STATUS
processSingleLine
(
PNS_LINE
*
aCurrent
,
PNS_LINE
*
aObstacle
,
PNS_LINE
*
aShoved
);
SHOVE_STATUS
processSingleLine
(
PNS_LINE
*
aCurrent
,
PNS_LINE
*
aObstacle
,
PNS_LINE
*
aShoved
);
SHOVE_STATUS
processHullSet
(
PNS_LINE
*
aCurrent
,
PNS_LINE
*
aObstacle
,
SHOVE_STATUS
processHullSet
(
PNS_LINE
*
aCurrent
,
PNS_LINE
*
aObstacle
,
PNS_LINE
*
aShoved
,
const
HULL_SET
&
hulls
);
PNS_LINE
*
aShoved
,
const
HULL_SET
&
hulls
);
bool
reduceSpringback
(
const
PNS_ITEMSET
&
aHeadItems
);
bool
reduceSpringback
(
const
PNS_ITEMSET
&
aHeadItems
);
bool
pushSpringback
(
PNS_NODE
*
aNode
,
const
PNS_ITEMSET
&
aHeadItems
,
bool
pushSpringback
(
PNS_NODE
*
aNode
,
const
PNS_ITEMSET
&
aHeadItems
,
const
PNS_COST_ESTIMATOR
&
aCost
);
const
PNS_COST_ESTIMATOR
&
aCost
);
SHOVE_STATUS
walkaroundLoneVia
(
PNS_LINE
*
aCurrent
,
PNS_LINE
*
aObstacle
,
PNS_LINE
*
aShoved
);
SHOVE_STATUS
walkaroundLoneVia
(
PNS_LINE
*
aCurrent
,
PNS_LINE
*
aObstacle
,
PNS_LINE
*
aShoved
);
bool
checkBumpDirection
(
PNS_LINE
*
aCurrent
,
PNS_LINE
*
aShoved
)
const
;
bool
checkBumpDirection
(
PNS_LINE
*
aCurrent
,
PNS_LINE
*
aShoved
)
const
;
...
@@ -104,20 +104,20 @@ private:
...
@@ -104,20 +104,20 @@ private:
SHOVE_STATUS
pushVia
(
PNS_VIA
*
aVia
,
const
VECTOR2I
&
aForce
,
int
aCurrentRank
);
SHOVE_STATUS
pushVia
(
PNS_VIA
*
aVia
,
const
VECTOR2I
&
aForce
,
int
aCurrentRank
);
void
unwindStack
(
PNS_SEGMENT
*
aSeg
);
void
unwindStack
(
PNS_SEGMENT
*
aSeg
);
void
unwindStack
(
PNS_ITEM
*
aItem
);
void
unwindStack
(
PNS_ITEM
*
aItem
);
void
runOptimizer
(
PNS_NODE
*
aNode
,
PNS_LINE
*
aHead
);
void
runOptimizer
(
PNS_NODE
*
aNode
,
PNS_LINE
*
aHead
);
void
pushLine
(
PNS_LINE
*
aL
);
void
pushLine
(
PNS_LINE
*
aL
);
void
popLine
();
void
popLine
();
const
RANGE
<
int
>
findShovedVertexRange
(
PNS_LINE
*
aL
);
const
RANGE
<
int
>
findShovedVertexRange
(
PNS_LINE
*
aL
);
PNS_LINE
*
assembleLine
(
const
PNS_SEGMENT
*
aSeg
,
int
*
aIndex
=
NULL
);
PNS_LINE
*
assembleLine
(
const
PNS_SEGMENT
*
aSeg
,
int
*
aIndex
=
NULL
);
PNS_LINE
*
cloneLine
(
const
PNS_LINE
*
aLine
);
PNS_LINE
*
cloneLine
(
const
PNS_LINE
*
aLine
);
SHOVE_STATUS
shoveIteration
(
int
aIter
);
SHOVE_STATUS
shoveIteration
(
int
aIter
);
SHOVE_STATUS
shoveMainLoop
();
SHOVE_STATUS
shoveMainLoop
();
std
::
vector
<
SPRINGBACK_TAG
>
m_nodeStack
;
std
::
vector
<
SPRINGBACK_TAG
>
m_nodeStack
;
std
::
vector
<
PNS_LINE
*>
m_lineStack
;
std
::
vector
<
PNS_LINE
*>
m_lineStack
;
...
@@ -126,7 +126,7 @@ private:
...
@@ -126,7 +126,7 @@ private:
PNS_NODE
*
m_root
;
PNS_NODE
*
m_root
;
PNS_NODE
*
m_currentNode
;
PNS_NODE
*
m_currentNode
;
OPT_LINE
m_newHead
;
OPT_LINE
m_newHead
;
PNS_LOGGER
m_logger
;
PNS_LOGGER
m_logger
;
...
...
pcbnew/router/pns_sizes_settings.h
View file @
9245b903
...
@@ -79,7 +79,7 @@ public:
...
@@ -79,7 +79,7 @@ public:
private
:
private
:
int
inheritTrackWidth
(
PNS_ITEM
*
aItem
);
int
inheritTrackWidth
(
PNS_ITEM
*
aItem
);
int
m_trackWidth
;
int
m_trackWidth
;
int
m_diffPairWidth
;
int
m_diffPairWidth
;
...
...
pcbnew/router/pns_via.h
View file @
9245b903
...
@@ -48,7 +48,7 @@ public:
...
@@ -48,7 +48,7 @@ public:
m_drill
=
aDrill
;
m_drill
=
aDrill
;
m_shape
=
SHAPE_CIRCLE
(
aPos
,
aDiameter
/
2
);
m_shape
=
SHAPE_CIRCLE
(
aPos
,
aDiameter
/
2
);
m_viaType
=
aViaType
;
m_viaType
=
aViaType
;
//If we're a through-board via, use all layers regardless of the set passed
//If we're a through-board via, use all layers regardless of the set passed
if
(
aViaType
==
VIA_THROUGH
)
if
(
aViaType
==
VIA_THROUGH
)
{
{
...
...
pcbnew/router/pns_walkaround.cpp
View file @
9245b903
...
@@ -83,10 +83,10 @@ PNS_WALKAROUND::WALKAROUND_STATUS PNS_WALKAROUND::singleStep( PNS_LINE& aPath,
...
@@ -83,10 +83,10 @@ PNS_WALKAROUND::WALKAROUND_STATUS PNS_WALKAROUND::singleStep( PNS_LINE& aPath,
m_logger
.
Log
(
&
current_obs
->
m_hull
,
2
,
"hull"
);
m_logger
.
Log
(
&
current_obs
->
m_hull
,
2
,
"hull"
);
m_logger
.
Log
(
current_obs
->
m_item
,
3
,
"item"
);
m_logger
.
Log
(
current_obs
->
m_item
,
3
,
"item"
);
#endif
#endif
int
len_pre
=
path_walk
[
0
].
Length
();
int
len_pre
=
path_walk
[
0
].
Length
();
int
len_alt
=
path_walk
[
1
].
Length
();
int
len_alt
=
path_walk
[
1
].
Length
();
PNS_LINE
walk_path
(
aPath
,
path_walk
[
1
]
);
PNS_LINE
walk_path
(
aPath
,
path_walk
[
1
]
);
bool
alt_collides
=
m_world
->
CheckColliding
(
&
walk_path
,
m_itemMask
);
bool
alt_collides
=
m_world
->
CheckColliding
(
&
walk_path
,
m_itemMask
);
...
@@ -158,7 +158,7 @@ PNS_WALKAROUND::WALKAROUND_STATUS PNS_WALKAROUND::Route( const PNS_LINE& aInitia
...
@@ -158,7 +158,7 @@ PNS_WALKAROUND::WALKAROUND_STATUS PNS_WALKAROUND::Route( const PNS_LINE& aInitia
{
{
int
len_cw
=
path_cw
.
CLine
().
Length
();
int
len_cw
=
path_cw
.
CLine
().
Length
();
int
len_ccw
=
path_ccw
.
CLine
().
Length
();
int
len_ccw
=
path_ccw
.
CLine
().
Length
();
if
(
m_forceLongerPath
)
if
(
m_forceLongerPath
)
aWalkPath
=
(
len_cw
>
len_ccw
?
path_cw
:
path_ccw
);
aWalkPath
=
(
len_cw
>
len_ccw
?
path_cw
:
path_ccw
);
else
else
...
@@ -179,7 +179,7 @@ PNS_WALKAROUND::WALKAROUND_STATUS PNS_WALKAROUND::Route( const PNS_LINE& aInitia
...
@@ -179,7 +179,7 @@ PNS_WALKAROUND::WALKAROUND_STATUS PNS_WALKAROUND::Route( const PNS_LINE& aInitia
m_iteration
++
;
m_iteration
++
;
}
}
if
(
m_iteration
==
m_iterationLimit
)
if
(
m_iteration
==
m_iterationLimit
)
{
{
int
len_cw
=
path_cw
.
CLine
().
Length
();
int
len_cw
=
path_cw
.
CLine
().
Length
();
...
@@ -235,7 +235,7 @@ PNS_WALKAROUND::WALKAROUND_STATUS PNS_WALKAROUND::Route( const PNS_LINE& aInitia
...
@@ -235,7 +235,7 @@ PNS_WALKAROUND::WALKAROUND_STATUS PNS_WALKAROUND::Route( const PNS_LINE& aInitia
if
(
aWalkPath
.
CPoint
(
0
)
!=
aInitialPath
.
CPoint
(
0
)
)
if
(
aWalkPath
.
CPoint
(
0
)
!=
aInitialPath
.
CPoint
(
0
)
)
return
STUCK
;
return
STUCK
;
WALKAROUND_STATUS
st
=
s_ccw
==
DONE
||
s_cw
==
DONE
?
DONE
:
STUCK
;
WALKAROUND_STATUS
st
=
s_ccw
==
DONE
||
s_cw
==
DONE
?
DONE
:
STUCK
;
if
(
aOptimize
&&
st
==
DONE
)
if
(
aOptimize
&&
st
==
DONE
)
...
...
pcbnew/router/pns_walkaround.h
View file @
9245b903
...
@@ -34,7 +34,7 @@ class PNS_WALKAROUND : public PNS_ALGO_BASE
...
@@ -34,7 +34,7 @@ class PNS_WALKAROUND : public PNS_ALGO_BASE
public
:
public
:
PNS_WALKAROUND
(
PNS_NODE
*
aWorld
,
PNS_ROUTER
*
aRouter
)
:
PNS_WALKAROUND
(
PNS_NODE
*
aWorld
,
PNS_ROUTER
*
aRouter
)
:
PNS_ALGO_BASE
(
aRouter
),
PNS_ALGO_BASE
(
aRouter
),
m_world
(
aWorld
),
m_world
(
aWorld
),
m_iterationLimit
(
DefaultIterationLimit
)
m_iterationLimit
(
DefaultIterationLimit
)
{
{
m_forceSingleDirection
=
false
;
m_forceSingleDirection
=
false
;
...
...
pcbnew/router/router_preview_item.cpp
View file @
9245b903
...
@@ -38,7 +38,7 @@ ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM( const PNS_ITEM* aItem, VIEW_GROUP* aPa
...
@@ -38,7 +38,7 @@ ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM( const PNS_ITEM* aItem, VIEW_GROUP* aPa
EDA_ITEM
(
NOT_USED
)
EDA_ITEM
(
NOT_USED
)
{
{
m_parent
=
aParent
;
m_parent
=
aParent
;
m_shape
=
NULL
;
m_shape
=
NULL
;
m_clearance
=
-
1
;
m_clearance
=
-
1
;
m_originLayer
=
m_layer
=
ITEM_GAL_LAYER
(
GP_OVERLAY
);
m_originLayer
=
m_layer
=
ITEM_GAL_LAYER
(
GP_OVERLAY
);
...
@@ -64,7 +64,7 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS_ITEM* aItem )
...
@@ -64,7 +64,7 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS_ITEM* aItem )
m_color
.
a
=
0.8
;
m_color
.
a
=
0.8
;
m_depth
=
BaseOverlayDepth
-
aItem
->
Layers
().
Start
();
m_depth
=
BaseOverlayDepth
-
aItem
->
Layers
().
Start
();
m_shape
=
aItem
->
Shape
()
->
Clone
();
m_shape
=
aItem
->
Shape
()
->
Clone
();
switch
(
aItem
->
Kind
()
)
switch
(
aItem
->
Kind
()
)
{
{
case
PNS_ITEM
:
:
LINE
:
case
PNS_ITEM
:
:
LINE
:
...
@@ -99,7 +99,7 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS_ITEM* aItem )
...
@@ -99,7 +99,7 @@ void ROUTER_PREVIEW_ITEM::Update( const PNS_ITEM* aItem )
if
(
aItem
->
Marker
()
&
MK_VIOLATION
)
if
(
aItem
->
Marker
()
&
MK_VIOLATION
)
m_color
=
COLOR4D
(
0
,
1
,
0
,
1
);
m_color
=
COLOR4D
(
0
,
1
,
0
,
1
);
if
(
aItem
->
Marker
()
&
MK_HEAD
)
if
(
aItem
->
Marker
()
&
MK_HEAD
)
m_color
.
Brighten
(
0.7
);
m_color
.
Brighten
(
0.7
);
...
@@ -178,7 +178,7 @@ void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::GAL* aGal ) const
...
@@ -178,7 +178,7 @@ void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::GAL* aGal ) const
aGal
->
SetLineWidth
(
m_width
+
2
*
m_clearance
);
aGal
->
SetLineWidth
(
m_width
+
2
*
m_clearance
);
aGal
->
DrawLine
(
s
->
GetSeg
().
A
,
s
->
GetSeg
().
B
);
aGal
->
DrawLine
(
s
->
GetSeg
().
A
,
s
->
GetSeg
().
B
);
}
}
break
;
break
;
}
}
...
@@ -194,7 +194,7 @@ void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::GAL* aGal ) const
...
@@ -194,7 +194,7 @@ void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::GAL* aGal ) const
aGal
->
SetIsStroke
(
false
);
aGal
->
SetIsStroke
(
false
);
aGal
->
DrawCircle
(
c
->
GetCenter
(),
c
->
GetRadius
()
+
m_clearance
);
aGal
->
DrawCircle
(
c
->
GetCenter
(),
c
->
GetRadius
()
+
m_clearance
);
}
}
break
;
break
;
}
}
...
@@ -225,7 +225,7 @@ void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::GAL* aGal ) const
...
@@ -225,7 +225,7 @@ void ROUTER_PREVIEW_ITEM::ViewDraw( int aLayer, KIGFX::GAL* aGal ) const
void
ROUTER_PREVIEW_ITEM
::
Line
(
const
SHAPE_LINE_CHAIN
&
aLine
,
int
aWidth
,
int
aStyle
)
void
ROUTER_PREVIEW_ITEM
::
Line
(
const
SHAPE_LINE_CHAIN
&
aLine
,
int
aWidth
,
int
aStyle
)
{
{
m_originLayer
=
m_layer
=
0
;
m_originLayer
=
m_layer
=
0
;
m_width
=
aWidth
;
m_width
=
aWidth
;
m_color
=
assignColor
(
aStyle
);
m_color
=
assignColor
(
aStyle
);
m_type
=
PR_SHAPE
;
m_type
=
PR_SHAPE
;
...
...
pcbnew/router/router_tool.cpp
View file @
9245b903
...
@@ -304,7 +304,7 @@ PNS_ITEM* ROUTER_TOOL::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLa
...
@@ -304,7 +304,7 @@ PNS_ITEM* ROUTER_TOOL::pickSingleItem( const VECTOR2I& aWhere, int aNet, int aLa
PNS_ITEM
*
prioritized
[
4
];
PNS_ITEM
*
prioritized
[
4
];
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
prioritized
[
i
]
=
0
;
prioritized
[
i
]
=
0
;
PNS_ITEMSET
candidates
=
m_router
->
QueryHoverItems
(
aWhere
);
PNS_ITEMSET
candidates
=
m_router
->
QueryHoverItems
(
aWhere
);
...
@@ -379,7 +379,7 @@ void ROUTER_TOOL::highlightNet( bool aEnabled, int aNetcode )
...
@@ -379,7 +379,7 @@ void ROUTER_TOOL::highlightNet( bool aEnabled, int aNetcode )
void
ROUTER_TOOL
::
handleCommonEvents
(
TOOL_EVENT
&
aEvent
)
void
ROUTER_TOOL
::
handleCommonEvents
(
TOOL_EVENT
&
aEvent
)
{
{
PCB_EDIT_FRAME
*
frame
=
getEditFrame
<
PCB_EDIT_FRAME
>
();
PCB_EDIT_FRAME
*
frame
=
getEditFrame
<
PCB_EDIT_FRAME
>
();
BOARD
*
board
=
getModel
<
BOARD
>
();
BOARD
*
board
=
getModel
<
BOARD
>
();
#ifdef DEBUG
#ifdef DEBUG
if
(
aEvent
.
IsKeyPressed
()
)
if
(
aEvent
.
IsKeyPressed
()
)
...
@@ -401,7 +401,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent )
...
@@ -401,7 +401,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent )
if
(
settingsDlg
.
ShowModal
()
)
if
(
settingsDlg
.
ShowModal
()
)
{
{
// FIXME: do we need an explicit update?
// FIXME: do we need an explicit update?
}
}
}
}
else
if
(
aEvent
.
IsAction
(
&
ACT_CustomTrackWidth
)
)
else
if
(
aEvent
.
IsAction
(
&
ACT_CustomTrackWidth
)
)
...
@@ -409,7 +409,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent )
...
@@ -409,7 +409,7 @@ void ROUTER_TOOL::handleCommonEvents( TOOL_EVENT& aEvent )
BOARD_DESIGN_SETTINGS
&
bds
=
board
->
GetDesignSettings
();
BOARD_DESIGN_SETTINGS
&
bds
=
board
->
GetDesignSettings
();
DIALOG_TRACK_VIA_SIZE
sizeDlg
(
frame
,
bds
);
DIALOG_TRACK_VIA_SIZE
sizeDlg
(
frame
,
bds
);
if
(
sizeDlg
.
ShowModal
()
)
if
(
sizeDlg
.
ShowModal
()
)
{
{
bds
.
UseCustomTrackViaSize
(
true
);
bds
.
UseCustomTrackViaSize
(
true
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
trackViaSizeChanged
);
m_toolMgr
->
RunAction
(
COMMON_ACTIONS
::
trackViaSizeChanged
);
...
@@ -437,7 +437,7 @@ void ROUTER_TOOL::updateStartItem( TOOL_EVENT& aEvent )
...
@@ -437,7 +437,7 @@ void ROUTER_TOOL::updateStartItem( TOOL_EVENT& aEvent )
{
{
VECTOR2I
p
=
aEvent
.
Position
();
VECTOR2I
p
=
aEvent
.
Position
();
startItem
=
pickSingleItem
(
p
);
startItem
=
pickSingleItem
(
p
);
bool
snapEnabled
=
!
aEvent
.
Modifier
(
MD_SHIFT
);
bool
snapEnabled
=
!
aEvent
.
Modifier
(
MD_SHIFT
);
m_router
->
EnableSnapping
(
snapEnabled
);
m_router
->
EnableSnapping
(
snapEnabled
);
if
(
!
snapEnabled
&&
startItem
&&
!
startItem
->
Layers
().
Overlaps
(
tl
)
)
if
(
!
snapEnabled
&&
startItem
&&
!
startItem
->
Layers
().
Overlaps
(
tl
)
)
...
@@ -520,20 +520,20 @@ void ROUTER_TOOL::updateEndItem( TOOL_EVENT& aEvent )
...
@@ -520,20 +520,20 @@ void ROUTER_TOOL::updateEndItem( TOOL_EVENT& aEvent )
TRACE
(
0
,
"%s, layer : %d"
,
m_endItem
->
KindStr
().
c_str
()
%
m_endItem
->
Layers
().
Start
()
);
TRACE
(
0
,
"%s, layer : %d"
,
m_endItem
->
KindStr
().
c_str
()
%
m_endItem
->
Layers
().
Start
()
);
}
}
int
ROUTER_TOOL
::
getStartLayer
(
const
PNS_ITEM
*
aItem
)
int
ROUTER_TOOL
::
getStartLayer
(
const
PNS_ITEM
*
aItem
)
{
{
int
tl
=
getView
()
->
GetTopLayer
();
int
tl
=
getView
()
->
GetTopLayer
();
if
(
m_startItem
)
if
(
m_startItem
)
{
{
const
PNS_LAYERSET
&
ls
=
m_startItem
->
Layers
();
const
PNS_LAYERSET
&
ls
=
m_startItem
->
Layers
();
if
(
ls
.
Overlaps
(
tl
)
)
if
(
ls
.
Overlaps
(
tl
)
)
return
tl
;
return
tl
;
else
else
return
ls
.
Start
();
return
ls
.
Start
();
}
}
return
tl
;
return
tl
;
}
}
void
ROUTER_TOOL
::
switchLayerOnViaPlacement
()
void
ROUTER_TOOL
::
switchLayerOnViaPlacement
()
...
@@ -542,7 +542,7 @@ void ROUTER_TOOL::switchLayerOnViaPlacement()
...
@@ -542,7 +542,7 @@ void ROUTER_TOOL::switchLayerOnViaPlacement()
int
al
=
frame
->
GetActiveLayer
();
int
al
=
frame
->
GetActiveLayer
();
int
cl
=
m_router
->
GetCurrentLayer
();
int
cl
=
m_router
->
GetCurrentLayer
();
if
(
cl
!=
al
)
if
(
cl
!=
al
)
{
{
m_router
->
SwitchLayer
(
al
);
m_router
->
SwitchLayer
(
al
);
...
@@ -559,7 +559,7 @@ void ROUTER_TOOL::switchLayerOnViaPlacement()
...
@@ -559,7 +559,7 @@ void ROUTER_TOOL::switchLayerOnViaPlacement()
bool
ROUTER_TOOL
::
onViaCommand
(
VIATYPE_T
aType
)
bool
ROUTER_TOOL
::
onViaCommand
(
VIATYPE_T
aType
)
{
{
BOARD
*
board
=
getModel
<
BOARD
>
();
BOARD
*
board
=
getModel
<
BOARD
>
();
BOARD_DESIGN_SETTINGS
&
bds
=
board
->
GetDesignSettings
();
BOARD_DESIGN_SETTINGS
&
bds
=
board
->
GetDesignSettings
();
PCB_EDIT_FRAME
*
frame
=
getEditFrame
<
PCB_EDIT_FRAME
>
();
PCB_EDIT_FRAME
*
frame
=
getEditFrame
<
PCB_EDIT_FRAME
>
();
...
@@ -572,32 +572,32 @@ bool ROUTER_TOOL::onViaCommand( VIATYPE_T aType )
...
@@ -572,32 +572,32 @@ bool ROUTER_TOOL::onViaCommand( VIATYPE_T aType )
sizes
.
AddLayerPair
(
frame
->
GetScreen
()
->
m_Route_Layer_TOP
,
sizes
.
AddLayerPair
(
frame
->
GetScreen
()
->
m_Route_Layer_TOP
,
frame
->
GetScreen
()
->
m_Route_Layer_BOTTOM
);
frame
->
GetScreen
()
->
m_Route_Layer_BOTTOM
);
if
(
!
m_router
->
IsPlacingVia
()
)
if
(
!
m_router
->
IsPlacingVia
()
)
{
{
// Cannot place microvias or blind vias if not allowed (obvious)
// Cannot place microvias or blind vias if not allowed (obvious)
if
(
(
aType
==
VIA_BLIND_BURIED
)
&&
(
!
bds
.
m_BlindBuriedViaAllowed
)
)
if
(
(
aType
==
VIA_BLIND_BURIED
)
&&
(
!
bds
.
m_BlindBuriedViaAllowed
)
)
return
false
;
return
false
;
if
(
(
aType
==
VIA_MICROVIA
)
&&
(
!
bds
.
m_MicroViasAllowed
)
)
if
(
(
aType
==
VIA_MICROVIA
)
&&
(
!
bds
.
m_MicroViasAllowed
)
)
return
false
;
return
false
;
//Can only place through vias on 2-layer boards
//Can only place through vias on 2-layer boards
if
(
(
aType
!=
VIA_THROUGH
)
&&
(
layerCount
<=
2
)
)
if
(
(
aType
!=
VIA_THROUGH
)
&&
(
layerCount
<=
2
)
)
return
false
;
return
false
;
//Can only place microvias if we're on an outer layer, or directly adjacent to one
//Can only place microvias if we're on an outer layer, or directly adjacent to one
if
(
(
aType
==
VIA_MICROVIA
)
&&
(
currentLayer
>
In1_Cu
)
&&
(
currentLayer
<
layerCount
-
2
)
)
if
(
(
aType
==
VIA_MICROVIA
)
&&
(
currentLayer
>
In1_Cu
)
&&
(
currentLayer
<
layerCount
-
2
)
)
return
false
;
return
false
;
//Cannot place blind vias with front/back as the layer pair, this doesn't make sense
//Cannot place blind vias with front/back as the layer pair, this doesn't make sense
if
(
(
aType
==
VIA_BLIND_BURIED
)
&&
(
sizes
.
GetLayerTop
()
==
F_Cu
)
&&
(
sizes
.
GetLayerBottom
()
==
B_Cu
)
)
if
(
(
aType
==
VIA_BLIND_BURIED
)
&&
(
sizes
.
GetLayerTop
()
==
F_Cu
)
&&
(
sizes
.
GetLayerBottom
()
==
B_Cu
)
)
return
false
;
return
false
;
}
}
sizes
.
SetViaType
(
aType
);
sizes
.
SetViaType
(
aType
);
m_router
->
ToggleViaPlacement
(
);
m_router
->
ToggleViaPlacement
(
);
m_router
->
UpdateSizes
(
sizes
);
m_router
->
UpdateSizes
(
sizes
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
// refresh
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
// refresh
return
false
;
return
false
;
...
@@ -612,7 +612,7 @@ void ROUTER_TOOL::performRouting()
...
@@ -612,7 +612,7 @@ void ROUTER_TOOL::performRouting()
int
routingLayer
=
getStartLayer
(
m_startItem
);
int
routingLayer
=
getStartLayer
(
m_startItem
);
frame
->
SetActiveLayer
(
ToLAYER_ID
(
routingLayer
)
);
frame
->
SetActiveLayer
(
ToLAYER_ID
(
routingLayer
)
);
// fixme: switch on invisible layer
// fixme: switch on invisible layer
if
(
m_startItem
&&
m_startItem
->
Net
()
>=
0
)
if
(
m_startItem
&&
m_startItem
->
Net
()
>=
0
)
{
{
...
@@ -631,7 +631,7 @@ void ROUTER_TOOL::performRouting()
...
@@ -631,7 +631,7 @@ void ROUTER_TOOL::performRouting()
sizes
.
AddLayerPair
(
frame
->
GetScreen
()
->
m_Route_Layer_TOP
,
sizes
.
AddLayerPair
(
frame
->
GetScreen
()
->
m_Route_Layer_TOP
,
frame
->
GetScreen
()
->
m_Route_Layer_BOTTOM
);
frame
->
GetScreen
()
->
m_Route_Layer_BOTTOM
);
m_router
->
UpdateSizes
(
sizes
);
m_router
->
UpdateSizes
(
sizes
);
m_router
->
StartRouting
(
m_startSnapPoint
,
m_startItem
,
routingLayer
);
m_router
->
StartRouting
(
m_startSnapPoint
,
m_startItem
,
routingLayer
);
m_endItem
=
NULL
;
m_endItem
=
NULL
;
...
@@ -659,7 +659,7 @@ void ROUTER_TOOL::performRouting()
...
@@ -659,7 +659,7 @@ void ROUTER_TOOL::performRouting()
if
(
m_router
->
FixRoute
(
m_endSnapPoint
,
m_endItem
)
)
if
(
m_router
->
FixRoute
(
m_endSnapPoint
,
m_endItem
)
)
break
;
break
;
if
(
needLayerSwitch
)
if
(
needLayerSwitch
)
{
{
switchLayerOnViaPlacement
();
switchLayerOnViaPlacement
();
}
}
...
@@ -764,7 +764,7 @@ int ROUTER_TOOL::Main( TOOL_EVENT& aEvent )
...
@@ -764,7 +764,7 @@ int ROUTER_TOOL::Main( TOOL_EVENT& aEvent )
else
else
performRouting
();
performRouting
();
}
}
else
if
(
evt
->
IsAction
(
&
ACT_Drag
)
)
else
if
(
evt
->
IsAction
(
&
ACT_Drag
)
)
performDragging
();
performDragging
();
handleCommonEvents
(
*
evt
);
handleCommonEvents
(
*
evt
);
...
...
pcbnew/router/router_tool.h
View file @
9245b903
...
@@ -47,10 +47,10 @@ private:
...
@@ -47,10 +47,10 @@ private:
PNS_ITEM
*
pickSingleItem
(
const
VECTOR2I
&
aWhere
,
int
aNet
=
-
1
,
int
aLayer
=
-
1
);
PNS_ITEM
*
pickSingleItem
(
const
VECTOR2I
&
aWhere
,
int
aNet
=
-
1
,
int
aLayer
=
-
1
);
int
getDefaultWidth
(
int
aNetCode
);
int
getDefaultWidth
(
int
aNetCode
);
void
performRouting
();
void
performRouting
();
void
performDragging
();
void
performDragging
();
void
highlightNet
(
bool
aEnabled
,
int
aNetcode
=
-
1
);
void
highlightNet
(
bool
aEnabled
,
int
aNetcode
=
-
1
);
void
updateStartItem
(
TOOL_EVENT
&
aEvent
);
void
updateStartItem
(
TOOL_EVENT
&
aEvent
);
...
@@ -59,7 +59,7 @@ private:
...
@@ -59,7 +59,7 @@ private:
void
getNetclassDimensions
(
int
aNetCode
,
int
&
aWidth
,
int
&
aViaDiameter
,
int
&
aViaDrill
);
void
getNetclassDimensions
(
int
aNetCode
,
int
&
aWidth
,
int
&
aViaDiameter
,
int
&
aViaDrill
);
void
handleCommonEvents
(
TOOL_EVENT
&
evt
);
void
handleCommonEvents
(
TOOL_EVENT
&
evt
);
int
getStartLayer
(
const
PNS_ITEM
*
aItem
);
int
getStartLayer
(
const
PNS_ITEM
*
aItem
);
void
switchLayerOnViaPlacement
();
void
switchLayerOnViaPlacement
();
bool
onViaCommand
(
VIATYPE_T
aType
);
bool
onViaCommand
(
VIATYPE_T
aType
);
...
...
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