Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
mantidproject
mantid
Commits
a7d73b92
Commit
a7d73b92
authored
6 years ago
by
Roman Tolchenov
Browse files
Options
Downloads
Patches
Plain Diff
Special case of tubes in deeper nestings. Re #24089.
Example: VISION/elastic-backscattering bank.
parent
4c6b80cc
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
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PanelsSurface.h
+1
-1
1 addition, 1 deletion
...ntview/inc/MantidQtWidgets/InstrumentView/PanelsSurface.h
qt/widgets/instrumentview/src/PanelsSurface.cpp
+40
-7
40 additions, 7 deletions
qt/widgets/instrumentview/src/PanelsSurface.cpp
with
41 additions
and
8 deletions
qt/widgets/instrumentview/inc/MantidQtWidgets/InstrumentView/PanelsSurface.h
+
1
−
1
View file @
a7d73b92
...
...
@@ -63,7 +63,7 @@ protected:
void
processStructured
(
size_t
rootIndex
);
void
processTubes
(
size_t
rootIndex
);
boost
::
optional
<
size_t
>
processTubes
(
size_t
rootIndex
);
void
processGrid
(
size_t
rootIndex
);
...
...
This diff is collapsed.
Click to expand it.
qt/widgets/instrumentview/src/PanelsSurface.cpp
+
40
−
7
View file @
a7d73b92
...
...
@@ -372,17 +372,45 @@ void PanelsSurface::processGrid(size_t rootIndex) {
processStructured
(
layers
[
layerIndex
]);
}
void
PanelsSurface
::
processTubes
(
size_t
rootIndex
)
{
boost
::
optional
<
size_t
>
PanelsSurface
::
processTubes
(
size_t
rootIndex
)
{
const
auto
&
componentInfo
=
m_instrActor
->
componentInfo
();
auto
bankIndex
=
componentInfo
.
parent
(
rootIndex
);
// findParentBank(componentInfo, rootIndex);
const
auto
bankIndex0
=
componentInfo
.
parent
(
rootIndex
);
auto
bankIndex
=
bankIndex0
;
auto
*
bankChildren
=
&
componentInfo
.
children
(
bankIndex
);
while
(
bankChildren
->
size
()
==
1
)
{
if
(
!
componentInfo
.
hasParent
(
bankIndex
))
{
return
boost
::
none
;
}
bankIndex
=
componentInfo
.
parent
(
bankIndex
);
bankChildren
=
&
componentInfo
.
children
(
bankIndex
);
}
auto
tubes
=
(
bankIndex
==
bankIndex0
)
?
*
bankChildren
:
std
::
vector
<
size_t
>
();
if
(
tubes
.
empty
())
{
for
(
auto
index
:
*
bankChildren
)
{
boost
::
optional
<
size_t
>
tubeIndex
=
index
;
while
(
componentInfo
.
componentType
(
tubeIndex
.
value
())
!=
ComponentType
::
OutlineComposite
)
{
auto
&
children
=
componentInfo
.
children
(
tubeIndex
.
value
());
if
(
children
.
empty
())
{
tubeIndex
=
boost
::
none
;
break
;
}
tubeIndex
=
children
[
0
];
}
if
(
tubeIndex
)
{
tubes
.
emplace_back
(
tubeIndex
.
value
());
}
}
if
(
tubes
.
empty
())
return
bankIndex
;
}
auto
name
=
componentInfo
.
name
(
bankIndex
);
auto
tubes
=
componentInfo
.
children
(
bankIndex
);
auto
normal
=
tubes
.
size
()
>
1
?
calculateBankNormal
(
componentInfo
,
tubes
)
:
V3D
();
if
(
normal
.
nullVector
()
||
!
isBankFlat
(
componentInfo
,
bankIndex
,
tubes
,
normal
))
return
;
return
boost
::
none
;
// save bank info
auto
index
=
m_flatBanks
.
size
();
...
...
@@ -428,6 +456,7 @@ void PanelsSurface::processTubes(size_t rootIndex) {
p0
=
p2
;
p1
=
p3
;
}
return
bankIndex
;
}
std
::
pair
<
std
::
vector
<
size_t
>
,
Mantid
::
Kernel
::
V3D
>
...
...
@@ -502,8 +531,12 @@ PanelsSurface::findFlatPanels(size_t rootIndex, std::vector<bool> &visited) {
}
if
(
componentType
==
ComponentType
::
OutlineComposite
)
{
processTubes
(
rootIndex
);
setBankVisited
(
componentInfo
,
parentIndex
,
visited
);
const
auto
bankIndex
=
processTubes
(
rootIndex
);
if
(
bankIndex
)
{
setBankVisited
(
componentInfo
,
bankIndex
.
value
(),
visited
);
}
else
{
setBankVisited
(
componentInfo
,
parentIndex
,
visited
);
}
return
boost
::
none
;
}
...
...
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