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
e1400f72
Commit
e1400f72
authored
3 months ago
by
Johannes Junggeburth
Committed by
Johannes Junggeburth
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Minor clean up of the cut volume action. Use PVLinks and make intrusive
parent
a674bdf8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!393
Minor clean up of the cut volume action. Use PVLinks and make intrusive
Pipeline
#9904853
passed
3 months ago
Stage: step-A
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoCutVolAction.h
+4
-4
4 additions, 4 deletions
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoCutVolAction.h
GeoModelCore/GeoModelKernel/src/GeoCutVolAction.cxx
+13
-15
13 additions, 15 deletions
GeoModelCore/GeoModelKernel/src/GeoCutVolAction.cxx
with
17 additions
and
19 deletions
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoCutVolAction.h
+
4
−
4
View file @
e1400f72
...
@@ -63,16 +63,16 @@ class GeoCutVolAction : public GeoVolumeAction
...
@@ -63,16 +63,16 @@ class GeoCutVolAction : public GeoVolumeAction
virtual
void
handleVPhysVol
(
const
GeoVPhysVol
*
vPV
);
virtual
void
handleVPhysVol
(
const
GeoVPhysVol
*
vPV
);
// Get the cutoff result
// Get the cutoff result
GeoPhysVol
*
getPV
();
GeoIntrusivePtr
<
GeoPhysVol
>
getPV
();
GeoFullPhysVol
*
getFPV
();
GeoIntrusivePtr
<
GeoFullPhysVol
>
getFPV
();
private:
private:
GeoVPhysVol
*
m_physVol
{
nullptr
};
PVLink
m_physVol
{
nullptr
};
const
GeoShape
&
m_shape
;
const
GeoShape
&
m_shape
;
const
GeoTrf
::
Transform3D
&
m_transform
;
const
GeoTrf
::
Transform3D
&
m_transform
;
std
::
stack
<
GeoVPhysVol
*
>
m_copyStack
;
std
::
stack
<
PVLink
>
m_copyStack
;
};
};
#endif
#endif
This diff is collapsed.
Click to expand it.
GeoModelCore/GeoModelKernel/src/GeoCutVolAction.cxx
+
13
−
15
View file @
e1400f72
...
@@ -27,7 +27,7 @@ void GeoCutVolAction::handleVPhysVol(const GeoVPhysVol *vPV)
...
@@ -27,7 +27,7 @@ void GeoCutVolAction::handleVPhysVol(const GeoVPhysVol *vPV)
unsigned
int
pathLen
=
this
->
getState
()
->
getPath
()
->
getLength
();
unsigned
int
pathLen
=
this
->
getState
()
->
getPath
()
->
getLength
();
// Get Logical Volume details
// Get Logical Volume details
const
GeoLogVol
*
lvOriginal
=
vPV
->
getLogVol
();
GeoIntrusivePtr
<
const
GeoLogVol
>
lvOriginal
=
vPV
->
getLogVol
();
const
std
::
string
&
lvNameOriginal
=
lvOriginal
->
getName
();
const
std
::
string
&
lvNameOriginal
=
lvOriginal
->
getName
();
const
GeoMaterial
*
lvMatOriginal
=
lvOriginal
->
getMaterial
();
const
GeoMaterial
*
lvMatOriginal
=
lvOriginal
->
getMaterial
();
const
GeoShape
*
lvShapeOriginal
=
lvOriginal
->
getShape
();
const
GeoShape
*
lvShapeOriginal
=
lvOriginal
->
getShape
();
...
@@ -35,13 +35,13 @@ void GeoCutVolAction::handleVPhysVol(const GeoVPhysVol *vPV)
...
@@ -35,13 +35,13 @@ void GeoCutVolAction::handleVPhysVol(const GeoVPhysVol *vPV)
if
(
pathLen
==
0
)
{
if
(
pathLen
==
0
)
{
// We are at the first PV. Create the resulting PV
// We are at the first PV. Create the resulting PV
const
GeoShape
&
cutShape
=
lvShapeOriginal
->
subtract
(
m_shape
<<
m_transform
);
const
GeoShape
&
cutShape
=
lvShapeOriginal
->
subtract
(
m_shape
<<
m_transform
);
GeoLogVol
*
lvNew
=
new
GeoLogVol
(
lvNameOriginal
,
&
cutShape
,
lvMatOriginal
);
GeoIntrusivePtr
<
GeoLogVol
>
lvNew
=
make_intrusive
<
GeoLogVol
>
(
lvNameOriginal
,
&
cutShape
,
lvMatOriginal
);
if
(
dynamic_cast
<
const
GeoFullPhysVol
*>
(
vPV
))
{
if
(
dynamic_cast
<
const
GeoFullPhysVol
*>
(
vPV
))
{
m_physVol
=
new
GeoFullPhysVol
(
lvNew
);
m_physVol
=
make_intrusive
<
GeoFullPhysVol
>
(
lvNew
);
}
}
else
{
else
{
m_physVol
=
new
GeoPhysVol
(
lvNew
);
m_physVol
=
make_intrusive
<
GeoPhysVol
>
(
lvNew
);
}
}
// Save the new PV in the copy stack
// Save the new PV in the copy stack
...
@@ -57,17 +57,17 @@ void GeoCutVolAction::handleVPhysVol(const GeoVPhysVol *vPV)
...
@@ -57,17 +57,17 @@ void GeoCutVolAction::handleVPhysVol(const GeoVPhysVol *vPV)
// Construct new PV
// Construct new PV
const
GeoShape
&
cutShape
=
lvShapeOriginal
->
subtract
(
m_shape
<<
cutTransform
);
const
GeoShape
&
cutShape
=
lvShapeOriginal
->
subtract
(
m_shape
<<
cutTransform
);
GeoLogVol
*
lvNew
=
new
GeoLogVol
(
lvNameOriginal
,
&
cutShape
,
lvMatOriginal
);
GeoIntrusivePtr
<
GeoLogVol
>
lvNew
=
make_intrusive
<
GeoLogVol
>
(
lvNameOriginal
,
&
cutShape
,
lvMatOriginal
);
GeoPhysVol
*
pvNew
=
new
GeoPhysVol
(
lvNew
);
PVLink
pvNew
=
make_intrusive
<
GeoPhysVol
>
(
lvNew
);
// Get its characteristics (name, id, transform to parent)
// Get its characteristics (name, id, transform to parent)
std
::
string
pvName
=
getState
()
->
getName
();
std
::
string
pvName
=
getState
()
->
getName
();
if
(
!
pvName
.
empty
())
copyParent
->
add
(
new
GeoNameTag
(
pvName
));
if
(
!
pvName
.
empty
())
copyParent
->
add
(
make_intrusive
<
GeoNameTag
>
(
pvName
));
const
Query
<
int
>
pvId
=
getState
()
->
getId
();
const
Query
<
int
>
pvId
=
getState
()
->
getId
();
if
(
pvId
.
isValid
())
copyParent
->
add
(
new
GeoIdentifierTag
(
pvId
));
if
(
pvId
.
isValid
())
copyParent
->
add
(
make_intrusive
<
GeoIdentifierTag
>
(
pvId
));
copyParent
->
add
(
new
GeoTransform
(
getState
()
->
getTransform
()));
copyParent
->
add
(
make_intrusive
<
GeoTransform
>
(
getState
()
->
getTransform
()));
copyParent
->
add
(
pvNew
);
copyParent
->
add
(
pvNew
);
// Save new PV in the copy stack
// Save new PV in the copy stack
...
@@ -75,13 +75,11 @@ void GeoCutVolAction::handleVPhysVol(const GeoVPhysVol *vPV)
...
@@ -75,13 +75,11 @@ void GeoCutVolAction::handleVPhysVol(const GeoVPhysVol *vPV)
}
}
}
}
GeoPhysVol
*
GeoCutVolAction
::
getPV
()
GeoIntrusivePtr
<
GeoPhysVol
>
GeoCutVolAction
::
getPV
()
{
{
return
dynamic_pointer_cast
<
GeoPhysVol
>
(
m_physVol
);
return
dynamic_cast
<
GeoPhysVol
*>
(
m_physVol
);
}
}
GeoFullPhysVol
*
GeoCutVolAction
::
getFPV
()
GeoIntrusivePtr
<
GeoFullPhysVol
>
GeoCutVolAction
::
getFPV
()
{
{
return
dynamic_pointer_cast
<
GeoFullPhysVol
>
(
m_physVol
);
return
dynamic_cast
<
GeoFullPhysVol
*>
(
m_physVol
);
}
}
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