Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
GeoModelDev
GeoModel
Commits
c1890aef
Commit
c1890aef
authored
1 year ago
by
Johannes Junggeburth
Browse files
Options
Downloads
Patches
Plain Diff
GeoModelATLAS - Disable cloning in resize by default
parent
bd62f978
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!299
GeoModelATLAS - Disable cloning in resize by default
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoModelCore/GeoModelHelpers/GeoModelHelpers/defineWorld.h
+2
-1
2 additions, 1 deletion
GeoModelCore/GeoModelHelpers/GeoModelHelpers/defineWorld.h
GeoModelCore/GeoModelHelpers/src/defineWorld.cxx
+10
-21
10 additions, 21 deletions
GeoModelCore/GeoModelHelpers/src/defineWorld.cxx
with
12 additions
and
22 deletions
GeoModelCore/GeoModelHelpers/GeoModelHelpers/defineWorld.h
+
2
−
1
View file @
c1890aef
...
...
@@ -21,5 +21,6 @@ GeoIntrusivePtr<GeoPhysVol> createGeoWorld(const double worldBoxX = GeoWorldDim:
const
double
worldBoxZ
=
GeoWorldDim
::
worldBoxZ
);
/// Resize the world volume to be the needed size
GeoIntrusivePtr
<
GeoPhysVol
>
resizeGeoWorld
(
GeoIntrusivePtr
<
GeoPhysVol
>
world
);
GeoIntrusivePtr
<
GeoPhysVol
>
resizeGeoWorld
(
GeoIntrusivePtr
<
GeoPhysVol
>
world
,
bool
cloneNodes
=
false
);
#endif
This diff is collapsed.
Click to expand it.
GeoModelCore/GeoModelHelpers/src/defineWorld.cxx
+
10
−
21
View file @
c1890aef
...
...
@@ -43,7 +43,8 @@ GeoIntrusivePtr<GeoPhysVol> createGeoWorld(const double worldBoxX,
return
world
;
}
GeoIntrusivePtr
<
GeoPhysVol
>
resizeGeoWorld
(
GeoIntrusivePtr
<
GeoPhysVol
>
world
)
{
GeoIntrusivePtr
<
GeoPhysVol
>
resizeGeoWorld
(
GeoIntrusivePtr
<
GeoPhysVol
>
world
,
bool
cloneVolumes
)
{
if
(
!
world
)
return
world
;
//resize the world volume to the real needed volume
...
...
@@ -57,31 +58,19 @@ GeoIntrusivePtr<GeoPhysVol> resizeGeoWorld(GeoIntrusivePtr<GeoPhysVol> world) {
// loop over all children volumes
for
(
unsigned
int
i
=
0
;
i
<
nChild
;
i
++
)
{
PVConstLink
nodeLink
=
world
->
getChildVol
(
i
);
if
(
dynamic_cast
<
const
GeoVPhysVol
*>
(
&
(
*
(
nodeLink
)))
)
{
const
GeoVPhysVol
*
childVolV
=
&
(
*
(
nodeLink
));
if
(
dynamic_cast
<
const
GeoPhysVol
*>
(
childVolV
)
)
{
const
GeoPhysVol
*
childVol
=
dynamic_cast
<
const
GeoPhysVol
*>
(
childVolV
);
childVol
->
getLogVol
()
->
getShape
()
->
extent
(
xmin
,
ymin
,
zmin
,
xmax
,
ymax
,
zmax
);
}
else
if
(
dynamic_cast
<
const
GeoFullPhysVol
*>
(
childVolV
)
)
{
const
GeoFullPhysVol
*
childVol
=
dynamic_cast
<
const
GeoFullPhysVol
*>
(
childVolV
);
childVol
->
getLogVol
()
->
getShape
()
->
extent
(
xmin
,
ymin
,
zmin
,
xmax
,
ymax
,
zmax
);
}
xworld
=
std
::
max
({
xworld
,
std
::
abs
(
xmin
),
std
::
abs
(
xmax
)});
yworld
=
std
::
max
({
yworld
,
std
::
abs
(
ymin
),
std
::
abs
(
ymax
)});
zworld
=
std
::
max
({
zworld
,
std
::
abs
(
zmin
),
std
::
abs
(
zmax
)});
}
PVConstLink
childVol
=
world
->
getChildVol
(
i
);
childVol
->
getLogVol
()
->
getShape
()
->
extent
(
xmin
,
ymin
,
zmin
,
xmax
,
ymax
,
zmax
);
xworld
=
std
::
max
({
xworld
,
std
::
abs
(
xmin
),
std
::
abs
(
xmax
)});
yworld
=
std
::
max
({
yworld
,
std
::
abs
(
ymin
),
std
::
abs
(
ymax
)});
zworld
=
std
::
max
({
zworld
,
std
::
abs
(
zmin
),
std
::
abs
(
zmax
)});
}
GeoIntrusivePtr
<
GeoPhysVol
>
resizedWorld
{
createGeoWorld
(
xworld
,
yworld
,
zworld
)};
for
(
unsigned
int
ch
=
0
;
ch
<
world
->
getNChildNodes
();
++
ch
)
{
const
GeoGraphNode
*
node
=
*
(
world
->
getChildNode
(
ch
));
if
(
typeid
(
*
node
)
==
typeid
(
GeoFullPhysVol
)
||
typeid
(
*
node
)
==
typeid
(
GeoPhysVol
))
{
if
(
cloneVolumes
&&
(
typeid
(
*
node
)
==
typeid
(
GeoFullPhysVol
)
||
typeid
(
*
node
)
==
typeid
(
GeoPhysVol
))
)
{
const
GeoVPhysVol
*
subVol
{
dynamic_cast
<
const
GeoVPhysVol
*>
(
node
)};
GeoVPhysVol
*
nonConstVol
{
const_cast
<
GeoVPhysVol
*>
(
subVol
)};
resizedWorld
->
add
(
cloneVolume
(
nonConstVol
));
...
...
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