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
f620b53d
Commit
f620b53d
authored
10 months ago
by
Joseph Boudreau
Browse files
Options
Downloads
Patches
Plain Diff
Deal with mutable materials such as a gas mixture.
parent
87828fbb
No related branches found
No related tags found
1 merge request
!320
Deal with mutable materials such as a gas mixture.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoLogVol.h
+13
-4
13 additions, 4 deletions
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoLogVol.h
GeoModelExamples/KitchenSinkPlugin/src/KitchenSinkPlugin.cxx
+3
-0
3 additions, 0 deletions
GeoModelExamples/KitchenSinkPlugin/src/KitchenSinkPlugin.cxx
with
16 additions
and
4 deletions
GeoModelCore/GeoModelKernel/GeoModelKernel/GeoLogVol.h
+
13
−
4
View file @
f620b53d
...
...
@@ -4,7 +4,6 @@
#ifndef GEOMODELKERNEL_GEOLOGVOL_H
#define GEOMODELKERNEL_GEOLOGVOL_H
/**
* @class GeoLogVol
*
...
...
@@ -17,7 +16,9 @@
#include
"GeoModelKernel/GeoIntrusivePtr.h"
#include
"GeoModelKernel/GeoMaterial.h"
#include
<vector>
#include
<thread>
#include
<shared_mutex>
#include
<mutex>
class
GeoLogVol
:
public
RCBase
{
public:
...
...
@@ -35,7 +36,14 @@ class GeoLogVol : public RCBase
// Returns the material of the logical volume.
const
GeoMaterial
*
getMaterial
()
const
{
return
m_material
;
std
::
shared_lock
lock
{
m_mutex
};
return
m_material
;
}
// In some cases (gases, liquids) materials be updated?
void
setMaterial
(
const
GeoMaterial
*
newMaterial
)
const
{
std
::
unique_lock
guards
{
m_mutex
};
m_material
=
newMaterial
;
}
protected
:
...
...
@@ -47,7 +55,8 @@ class GeoLogVol : public RCBase
std
::
string
m_name
{};
// Material composition of this volume.
GeoIntrusivePtr
<
const
GeoMaterial
>
m_material
{};
mutable
GeoIntrusivePtr
<
const
GeoMaterial
>
m_material
{};
mutable
std
::
shared_mutex
m_mutex
{};
// Shape of this volume.
GeoIntrusivePtr
<
const
GeoShape
>
m_shape
{};
...
...
This diff is collapsed.
Click to expand it.
GeoModelExamples/KitchenSinkPlugin/src/KitchenSinkPlugin.cxx
+
3
−
0
View file @
f620b53d
...
...
@@ -301,6 +301,9 @@ void KitchenSinkPlugin::create(GeoVPhysVol *world, bool /*publish*/) {
);
world
->
add
(
wTransform
);
world
->
add
(
wPhys
);
wLog
->
setMaterial
(
Stainless
);
}
//--------------------------------------//
...
...
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