|
13 | 13 | #include <G4LogicalVolumeStore.hh> |
14 | 14 | #include <G4ReflectionFactory.hh> |
15 | 15 | #include <G4ReplicaNavigation.hh> |
| 16 | +#include <G4VNestedParameterisation.hh> |
16 | 17 | #include <G4VPVParameterisation.hh> |
17 | 18 | #include <G4VPhysicalVolume.hh> |
18 | 19 | #include <VecGeom/management/ReflFactory.h> |
@@ -270,6 +271,7 @@ auto Converter::operator()(arg_type g4world) -> result_type |
270 | 271 | result.world = world_pv; |
271 | 272 | result.logical_volumes = convert_lv_->make_volume_map(); |
272 | 273 | result.physical_volumes = std::move(placed_volumes_); |
| 274 | + result.nested_pv = std::move(nested_); |
273 | 275 |
|
274 | 276 | G4VG_ENSURE(result.world); |
275 | 277 | G4VG_ENSURE(!result.logical_volumes.empty()); |
@@ -336,11 +338,24 @@ auto Converter::build_with_daughters(G4LogicalVolume const* mother_g4lv) |
336 | 338 | case EVolume::kParameterised: |
337 | 339 | // Place each paramterized instance of the daughter |
338 | 340 | G4VG_ASSERT(g4pv->GetParameterisation()); |
| 341 | + if (auto* nested = dynamic_cast<G4VNestedParameterisation*>( |
| 342 | + g4pv->GetParameterisation())) |
| 343 | + { |
| 344 | + G4VG_LOG(warning) |
| 345 | + << "Encountered nested parameterisation '" |
| 346 | + << TypeDemangler<G4VNestedParameterisation>{}(*nested) |
| 347 | + << "' for physical volume '" << g4pv->GetName() |
| 348 | + << "' (corresponding LV: " |
| 349 | + << PrintableLV{g4pv->GetLogicalVolume()} << "): " |
| 350 | + << "only one instance will be placed, and " |
| 351 | + "solid/material changes will be ignored"; |
| 352 | + nested_.push_back(g4pv); |
| 353 | + } |
339 | 354 | place_daughter(g4pv, ParamUpdater{g4pv->GetParameterisation()}); |
340 | 355 | break; |
341 | 356 | default: |
342 | 357 | G4VG_LOG(error) |
343 | | - << "Unsupported type '" |
| 358 | + << "Unsupported custom placement type '" |
344 | 359 | << TypeDemangler<G4VPhysicalVolume>{}(*g4pv) |
345 | 360 | << "' for physical volume '" << g4pv->GetName() |
346 | 361 | << "' (corresponding LV: " |
|
0 commit comments