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
3701e131
Commit
3701e131
authored
Dec 10, 2013
by
Maciej Suminski
Committed by
Wayne Stambaugh
Dec 10, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Commit merge request lp:197858 (fixes lp:1249736).
parents
dbd72122
d7fc8db0
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
1791 deletions
+44
-1791
view.cpp
common/view/view.cpp
+22
-8
rtree.h
include/geometry/rtree.h
+21
-23
rtree.h
include/rtree.h
+0
-1758
view_rtree.h
include/view/view_rtree.h
+1
-2
No files found.
common/view/view.cpp
View file @
3701e131
...
...
@@ -153,10 +153,12 @@ struct queryVisitor
{
}
void
operator
()(
VIEW_ITEM
*
aItem
)
bool
operator
()(
VIEW_ITEM
*
aItem
)
{
if
(
aItem
->
ViewIsVisible
()
)
m_cont
.
push_back
(
VIEW
::
LAYER_ITEM_PAIR
(
aItem
,
m_layer
)
);
return
true
;
}
Container
&
m_cont
;
...
...
@@ -387,7 +389,7 @@ struct VIEW::updateItemsColor
{
}
void
operator
()(
VIEW_ITEM
*
aItem
)
bool
operator
()(
VIEW_ITEM
*
aItem
)
{
// Obtain the color that should be used for coloring the item
const
COLOR4D
color
=
painter
->
GetSettings
()
->
GetColor
(
aItem
,
layer
);
...
...
@@ -395,6 +397,8 @@ struct VIEW::updateItemsColor
if
(
group
>=
0
)
gal
->
ChangeGroupColor
(
group
,
color
);
return
true
;
}
int
layer
;
...
...
@@ -447,12 +451,14 @@ struct VIEW::changeItemsDepth
{
}
void
operator
()(
VIEW_ITEM
*
aItem
)
bool
operator
()(
VIEW_ITEM
*
aItem
)
{
int
group
=
aItem
->
getGroup
(
layer
);
if
(
group
>=
0
)
gal
->
ChangeGroupDepth
(
group
,
depth
);
return
true
;
}
int
layer
,
depth
;
...
...
@@ -571,15 +577,17 @@ struct VIEW::drawItem
{
}
void
operator
()(
VIEW_ITEM
*
aItem
)
bool
operator
()(
VIEW_ITEM
*
aItem
)
{
// Conditions that have te be fulfilled for an item to be drawn
bool
drawCondition
=
aItem
->
ViewIsVisible
()
&&
aItem
->
ViewGetLOD
(
currentLayer
->
id
)
<
view
->
m_scale
;
if
(
!
drawCondition
)
return
;
return
true
;
view
->
draw
(
aItem
,
currentLayer
->
id
);
return
true
;
}
const
VIEW_LAYER
*
currentLayer
;
...
...
@@ -676,9 +684,11 @@ bool VIEW::IsDirty() const
struct
VIEW
::
unlinkItem
{
void
operator
()(
VIEW_ITEM
*
aItem
)
bool
operator
()(
VIEW_ITEM
*
aItem
)
{
aItem
->
m_view
=
NULL
;
return
true
;
}
};
...
...
@@ -690,7 +700,7 @@ struct VIEW::recacheItem
{
}
void
operator
()(
VIEW_ITEM
*
aItem
)
bool
operator
()(
VIEW_ITEM
*
aItem
)
{
// Remove previously cached group
int
prevGroup
=
aItem
->
getGroup
(
layer
);
...
...
@@ -712,6 +722,8 @@ struct VIEW::recacheItem
{
aItem
->
setGroup
(
layer
,
-
1
);
}
return
true
;
}
VIEW
*
view
;
...
...
@@ -792,12 +804,14 @@ struct VIEW::clearLayerCache
{
}
void
operator
()(
VIEW_ITEM
*
aItem
)
bool
operator
()(
VIEW_ITEM
*
aItem
)
{
if
(
aItem
->
storesGroups
()
)
{
aItem
->
deleteGroups
();
}
return
true
;
}
VIEW
*
view
;
...
...
include/geometry/rtree.h
View file @
3701e131
...
...
@@ -163,7 +163,7 @@ public:
/// Calculate Statistics
Statistics
CalcStats
(
);
Statistics
CalcStats
();
/// Remove all entries from tree
void
RemoveAll
();
...
...
@@ -1286,7 +1286,7 @@ int RTREE_QUAL::PickBranch( Rect* a_rect, Node* a_node )
ELEMTYPEREAL
increase
;
ELEMTYPEREAL
bestIncr
=
(
ELEMTYPEREAL
)
-
1
;
ELEMTYPEREAL
area
;
ELEMTYPEREAL
bestArea
;
ELEMTYPEREAL
bestArea
=
0
;
int
best
=
0
;
Rect
tempRect
;
...
...
@@ -1622,7 +1622,7 @@ void RTREE_QUAL::PickSeeds( PartitionVars* a_parVars )
&
a_parVars
->
m_branchBuf
[
indexB
].
m_rect
);
waste
=
CalcRectVolume
(
&
oneRect
)
-
area
[
indexA
]
-
area
[
indexB
];
if
(
waste
>
worst
)
if
(
waste
>
=
worst
)
{
worst
=
waste
;
seed0
=
indexA
;
...
...
@@ -1856,8 +1856,6 @@ bool RTREE_QUAL::Search( Node* a_node, Rect* a_rect, int& a_foundCount, bool a_r
}
//calculate the minimum distance between a point and a rectangle as defined by Manolopoulos et al.
//it uses the square distance to avoid the use of ELEMTYPEREAL values, which are slower.
RTREE_TEMPLATE
...
...
include/rtree.h
deleted
100644 → 0
View file @
dbd72122
This diff is collapsed.
Click to expand it.
include/view/view_rtree.h
View file @
3701e131
...
...
@@ -27,7 +27,7 @@
#include <math/box2.h>
#include <rtree.h>
#include <
geometry/
rtree.h>
namespace
KIGFX
{
...
...
@@ -76,7 +76,6 @@ public:
* Executes a function object aVisitor for each item whose bounding box intersects
* with aBounds.
*/
template
<
class
Visitor
>
void
Query
(
const
BOX2I
&
aBounds
,
Visitor
&
aVisitor
)
// const
{
...
...
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