Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
f105933e
Commit
f105933e
authored
3 months ago
by
Mikhail Svechnikov
Browse files
Options
Downloads
Plain Diff
[m.0] Connect only selected projections to real-time plot update (
#1046
) (Closes
#1046
)
Merging branch 'm.0' into 'main'. See merge request
!2785
parents
27678d46
89c2bbc9
No related branches found
No related tags found
1 merge request
!2785
Connect only selected projections to real-time plot update (#1046)
Pipeline
#177945
passed
3 months ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/View/Overlay/LineOverlays.cpp
+0
-2
0 additions, 2 deletions
GUI/View/Overlay/LineOverlays.cpp
GUI/View/Scene/MaskGraphicsScene.cpp
+22
-2
22 additions, 2 deletions
GUI/View/Scene/MaskGraphicsScene.cpp
GUI/View/Scene/MaskGraphicsScene.h
+2
-0
2 additions, 0 deletions
GUI/View/Scene/MaskGraphicsScene.h
with
24 additions
and
4 deletions
GUI/View/Overlay/LineOverlays.cpp
+
0
−
2
View file @
f105933e
...
@@ -84,7 +84,6 @@ void HorizontalLineOverlay::onChangedY()
...
@@ -84,7 +84,6 @@ void HorizontalLineOverlay::onChangedY()
{
{
setBlockOnProperty
(
true
);
setBlockOnProperty
(
true
);
m_item
->
setPos
(
y2coo
(
this
->
y
()));
m_item
->
setPos
(
y2coo
(
this
->
y
()));
emit
m_item
->
maskGeometryChanged
();
setBlockOnProperty
(
false
);
setBlockOnProperty
(
false
);
}
}
...
@@ -132,7 +131,6 @@ void VerticalLineOverlay::onChangedX()
...
@@ -132,7 +131,6 @@ void VerticalLineOverlay::onChangedX()
{
{
setBlockOnProperty
(
true
);
setBlockOnProperty
(
true
);
m_item
->
setPos
(
x2coo
(
this
->
x
()));
m_item
->
setPos
(
x2coo
(
this
->
x
()));
emit
m_item
->
maskGeometryChanged
();
setBlockOnProperty
(
false
);
setBlockOnProperty
(
false
);
}
}
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Scene/MaskGraphicsScene.cpp
+
22
−
2
View file @
f105933e
...
@@ -543,6 +543,7 @@ void MaskGraphicsScene::onSceneSelectionChanged()
...
@@ -543,6 +543,7 @@ void MaskGraphicsScene::onSceneSelectionChanged()
if
(
m_masks
->
currentItem
()
&&
m_masks
->
currentItem
()
->
isVisible
())
if
(
m_masks
->
currentItem
()
&&
m_masks
->
currentItem
()
->
isVisible
())
m_masks
->
setCurrentIndex
(
-
1
);
m_masks
->
setCurrentIndex
(
-
1
);
m_prjns
->
setCurrentIndex
(
-
1
);
m_prjns
->
setCurrentIndex
(
-
1
);
connectSelectedLineMove
(
nullptr
);
}
else
{
}
else
{
const
MaskItem
*
selected_item
=
maskItemForOverlay
(
selectedMaskOverlay
());
const
MaskItem
*
selected_item
=
maskItemForOverlay
(
selectedMaskOverlay
());
ASSERT
(
selected_item
);
ASSERT
(
selected_item
);
...
@@ -551,11 +552,11 @@ void MaskGraphicsScene::onSceneSelectionChanged()
...
@@ -551,11 +552,11 @@ void MaskGraphicsScene::onSceneSelectionChanged()
current_set
->
setCurrentIndex
(
current_set
->
index_of
(
selected_item
));
current_set
->
setCurrentIndex
(
current_set
->
index_of
(
selected_item
));
unselectOtherModelThan
(
current_set
);
unselectOtherModelThan
(
current_set
);
// switch projection plot
if
(
current_set
==
m_prjns
)
{
if
(
current_set
==
m_prjns
)
{
const
auto
*
line_item
=
dynamic_cast
<
const
LineItem
*>
(
selected_item
);
const
auto
*
line_item
=
dynamic_cast
<
const
LineItem
*>
(
selected_item
);
ASSERT
(
line_item
);
ASSERT
(
line_item
);
emit
lineItemMoved
(
line_item
);
emit
lineItemMoved
(
line_item
);
// switch projection plot
connectSelectedLineMove
(
line_item
);
// activate updating projection plot while moving
}
}
// switch panel
// switch panel
...
@@ -597,6 +598,25 @@ void MaskGraphicsScene::selectOnlyGivenItem(QGraphicsItem* givenItem)
...
@@ -597,6 +598,25 @@ void MaskGraphicsScene::selectOnlyGivenItem(QGraphicsItem* givenItem)
emit
selectionChanged
();
emit
selectionChanged
();
}
}
void
MaskGraphicsScene
::
connectSelectedLineMove
(
const
LineItem
*
given_line
)
{
for
(
const
auto
&
[
item
,
overlay
]
:
m_mask2overlay
)
{
if
(
item
==
given_line
)
{
if
(
dynamic_cast
<
const
HorizontalLineItem
*>
(
given_line
))
connect
(
overlay
,
&
QGraphicsObject
::
yChanged
,
item
,
&
OverlayItem
::
maskGeometryChanged
,
Qt
::
UniqueConnection
);
else
if
(
dynamic_cast
<
const
VerticalLineItem
*>
(
given_line
))
connect
(
overlay
,
&
QGraphicsObject
::
xChanged
,
item
,
&
OverlayItem
::
maskGeometryChanged
,
Qt
::
UniqueConnection
);
}
else
{
disconnect
(
overlay
,
&
QGraphicsObject
::
xChanged
,
item
,
&
OverlayItem
::
maskGeometryChanged
);
disconnect
(
overlay
,
&
QGraphicsObject
::
yChanged
,
item
,
&
OverlayItem
::
maskGeometryChanged
);
}
}
}
//! Processes RectangleItem and EllipseItem drawing.
//! Processes RectangleItem and EllipseItem drawing.
//! Called upon mouse move event (with left button down).
//! Called upon mouse move event (with left button down).
//! If mouse has moved sufficiently far, a new item is created.
//! If mouse has moved sufficiently far, a new item is created.
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Scene/MaskGraphicsScene.h
+
2
−
0
View file @
f105933e
...
@@ -90,6 +90,8 @@ private:
...
@@ -90,6 +90,8 @@ private:
void
selectOnlyItemAtMousePos
(
QGraphicsSceneMouseEvent
*
event
);
void
selectOnlyItemAtMousePos
(
QGraphicsSceneMouseEvent
*
event
);
void
selectOnlyGivenItem
(
QGraphicsItem
*
givenItem
);
void
selectOnlyGivenItem
(
QGraphicsItem
*
givenItem
);
void
connectSelectedLineMove
(
const
LineItem
*
given_line
);
void
processRectangleOrEllipseItem
(
QGraphicsSceneMouseEvent
*
event
);
void
processRectangleOrEllipseItem
(
QGraphicsSceneMouseEvent
*
event
);
void
processPolygonItem
(
QGraphicsSceneMouseEvent
*
event
);
void
processPolygonItem
(
QGraphicsSceneMouseEvent
*
event
);
void
processLineItem
(
QGraphicsSceneMouseEvent
*
event
);
void
processLineItem
(
QGraphicsSceneMouseEvent
*
event
);
...
...
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