Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
26e975ca
Commit
26e975ca
authored
12 years ago
by
Andreas Schenk
Browse files
Options
Downloads
Patches
Plain Diff
changed static variable in DataViewerPanelBase to member variable to account
for multiple DataViewers
parent
7a54a6ca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/gui/src/data_viewer/data_viewer_panel_base.cc
+16
-16
16 additions, 16 deletions
modules/gui/src/data_viewer/data_viewer_panel_base.cc
modules/gui/src/data_viewer/data_viewer_panel_base.hh
+2
-1
2 additions, 1 deletion
modules/gui/src/data_viewer/data_viewer_panel_base.hh
with
18 additions
and
17 deletions
modules/gui/src/data_viewer/data_viewer_panel_base.cc
+
16
−
16
View file @
26e975ca
...
@@ -77,7 +77,8 @@ DataViewerPanelBase::DataViewerPanelBase(const Data& data,QWidget* parent):
...
@@ -77,7 +77,8 @@ DataViewerPanelBase::DataViewerPanelBase(const Data& data,QWidget* parent):
update_extent_
(),
update_extent_
(),
fast_low_mag_
(
true
),
fast_low_mag_
(
true
),
fast_high_mag_
(
true
),
fast_high_mag_
(
true
),
antialiasing_
(
true
)
antialiasing_
(
true
),
drag_start_
()
{
{
update_min_max
();
update_min_max
();
UpdateNormalizer
(
data_min_
,
data_max_
,
1.0
,
false
);
UpdateNormalizer
(
data_min_
,
data_max_
,
1.0
,
false
);
...
@@ -521,35 +522,34 @@ void DataViewerPanelBase::mouseMoveEvent(QMouseEvent* event)
...
@@ -521,35 +522,34 @@ void DataViewerPanelBase::mouseMoveEvent(QMouseEvent* event)
int
dy
=
event
->
y
()
-
last_y_
;
int
dy
=
event
->
y
()
-
last_y_
;
move
(
dx
,
dy
);
move
(
dx
,
dy
);
}
else
if
(
event
->
buttons
()
==
Qt
::
LeftButton
&&
event
->
modifiers
()
==
Qt
::
NoModifier
)
{
}
else
if
(
event
->
buttons
()
==
Qt
::
LeftButton
&&
event
->
modifiers
()
==
Qt
::
NoModifier
)
{
static
Point
drag_start
;
// left mouse drag does selection box
// left mouse drag does selection box
if
(
!
rubberband_
->
isVisible
()){
if
(
!
rubberband_
->
isVisible
()){
drag_start
=
WinToPoint
(
rubberband_
->
geometry
().
topLeft
());
drag_start
_
=
WinToPoint
(
rubberband_
->
geometry
().
topLeft
());
rubberband_
->
show
();
rubberband_
->
show
();
}
}
QSize
vsize
=
size
();
QSize
vsize
=
size
();
Point
mouse_pos
=
WinToPoint
(
event
->
x
(),
event
->
y
());
Point
mouse_pos
=
WinToPoint
(
event
->
x
(),
event
->
y
());
Point
max_pos
=
WinToPoint
(
vsize
.
width
(),
vsize
.
height
());
Point
max_pos
=
WinToPoint
(
vsize
.
width
(),
vsize
.
height
());
Point
min_pos
=
WinToPoint
(
0
,
0
);
Point
min_pos
=
WinToPoint
(
0
,
0
);
selection_
=
Extent
(
Point
(
std
::
max
(
min_pos
[
0
],
std
::
min
(
drag_start
[
0
],
mouse_pos
[
0
])),
selection_
=
Extent
(
Point
(
std
::
max
(
min_pos
[
0
],
std
::
min
(
drag_start
_
[
0
],
mouse_pos
[
0
])),
std
::
max
(
min_pos
[
1
],
std
::
min
(
drag_start
[
1
],
mouse_pos
[
1
])),
slab_
),
std
::
max
(
min_pos
[
1
],
std
::
min
(
drag_start
_
[
1
],
mouse_pos
[
1
])),
slab_
),
Point
(
std
::
max
(
drag_start
[
0
],
std
::
min
(
max_pos
[
0
],
mouse_pos
[
0
])),
Point
(
std
::
max
(
drag_start
_
[
0
],
std
::
min
(
max_pos
[
0
],
mouse_pos
[
0
])),
std
::
max
(
drag_start
[
1
],
std
::
min
(
max_pos
[
1
],
mouse_pos
[
1
])),
slab_
));
std
::
max
(
drag_start
_
[
1
],
std
::
min
(
max_pos
[
1
],
mouse_pos
[
1
])),
slab_
));
if
(
selection_mode_
>
0
){
if
(
selection_mode_
>
0
){
Size
s
=
selection_
.
GetSize
();
Size
s
=
selection_
.
GetSize
();
int
minsize
=
std
::
min
<
int
>
(
s
[
0
],
s
[
1
]);
int
minsize
=
std
::
min
<
int
>
(
s
[
0
],
s
[
1
]);
if
(
selection_mode_
==
2
){
if
(
selection_mode_
==
2
){
minsize
=
1
<<
static_cast
<
int
>
(
floor
(
log
(
Real
(
minsize
))
/
log
(
Real
(
2.0
))));
minsize
=
1
<<
static_cast
<
int
>
(
floor
(
log
(
Real
(
minsize
))
/
log
(
Real
(
2.0
))));
}
}
if
(
drag_start
[
0
]
>
mouse_pos
[
0
]
&&
drag_start
[
1
]
>
mouse_pos
[
1
]){
if
(
drag_start
_
[
0
]
>
mouse_pos
[
0
]
&&
drag_start
_
[
1
]
>
mouse_pos
[
1
]){
selection_
.
SetStart
(
drag_start
-
Point
(
minsize
,
minsize
)
+
Point
(
1
,
1
));
selection_
.
SetStart
(
drag_start
_
-
Point
(
minsize
,
minsize
)
+
Point
(
1
,
1
));
selection_
.
SetEnd
(
drag_start
);
selection_
.
SetEnd
(
drag_start
_
);
}
else
if
(
drag_start
[
0
]
>
mouse_pos
[
0
]
&&
drag_start
[
1
]
<=
mouse_pos
[
1
]){
}
else
if
(
drag_start
_
[
0
]
>
mouse_pos
[
0
]
&&
drag_start
_
[
1
]
<=
mouse_pos
[
1
]){
selection_
.
SetStart
(
drag_start
-
Point
(
minsize
,
0
)
+
Point
(
1
,
0
));
selection_
.
SetStart
(
drag_start
_
-
Point
(
minsize
,
0
)
+
Point
(
1
,
0
));
selection_
.
SetEnd
(
drag_start
+
Point
(
0
,
minsize
)
-
Point
(
0
,
1
));
selection_
.
SetEnd
(
drag_start
_
+
Point
(
0
,
minsize
)
-
Point
(
0
,
1
));
}
else
if
(
drag_start
[
0
]
<=
mouse_pos
[
0
]
&&
drag_start
[
1
]
>
mouse_pos
[
1
]){
}
else
if
(
drag_start
_
[
0
]
<=
mouse_pos
[
0
]
&&
drag_start
_
[
1
]
>
mouse_pos
[
1
]){
selection_
.
SetStart
(
drag_start
-
Point
(
0
,
minsize
)
+
Point
(
0
,
1
));
selection_
.
SetStart
(
drag_start
_
-
Point
(
0
,
minsize
)
+
Point
(
0
,
1
));
selection_
.
SetEnd
(
drag_start
+
Point
(
minsize
,
0
)
-
Point
(
1
,
0
));
selection_
.
SetEnd
(
drag_start
_
+
Point
(
minsize
,
0
)
-
Point
(
1
,
0
));
}
else
{
}
else
{
selection_
.
SetEnd
(
selection_
.
GetStart
()
+
Point
(
minsize
,
minsize
)
-
Point
(
1
,
1
));
selection_
.
SetEnd
(
selection_
.
GetStart
()
+
Point
(
minsize
,
minsize
)
-
Point
(
1
,
1
));
}
}
...
...
This diff is collapsed.
Click to expand it.
modules/gui/src/data_viewer/data_viewer_panel_base.hh
+
2
−
1
View file @
26e975ca
...
@@ -245,7 +245,8 @@ private:
...
@@ -245,7 +245,8 @@ private:
bool
fast_high_mag_
;
bool
fast_high_mag_
;
bool
antialiasing_
;
bool
antialiasing_
;
Point
drag_start_
;
void
move
(
int
dx
,
int
dy
);
void
move
(
int
dx
,
int
dy
);
void
slab
(
int
dz
);
void
slab
(
int
dz
);
void
zoom
(
int
d
);
void
zoom
(
int
d
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment