23 for (std::vector<LayerSlice>::const_iterator i =
_slices.begin(); i !=
_slices.end(); ++i)
31 "sectionThickness: First index (%ld) must be <= second index (%ld)!", is, ie);
32 else if (is > _layers.size())
34 "sectionThickness: First index (%ld) out of range. #layers=%ld).", is, _layers.size());
35 else if (ie > _layers.size())
37 "sectionThickness: Second index (%ld) out of range. #layers=%ld).", is, _layers.size());
38 for (std::size_t i = is; i <= ie; ++i)
39 thick += _layers[i]->thicknessWithPreOffset();
44 std::vector<Layer*>& layers = layering.
layers();
46 for_each(layers.begin(), layers.end(), detail::deletePtr<Layer>);
50 int repeat = layer.hasAttr(
_U(repeat)) ? layer.repeat() : 1;
54 std::string material = slice.materialStr();
55 LayerSlice lslice(slice.isSensitive(), slice.thickness(), material);
60 for(
int k = 0; k < repeat; ++k )
61 layers.emplace_back(
new Layer(lay));
64 throw std::runtime_error(
"LayeringCnv::fromCompact: No layer children to be build!");
73 return _stack.layers()[which];
78 double thickness = 0e0;
81 thickness += slice.thickness();
88 double thickness = 0e0;
91 if (slice.isRadiator())
92 thickness += slice.thickness();
99 double pos =- singleLayerThickness(e)/2.0;
102 pos += slice.thickness();
103 if (slice.isSensitive()){
105 sens_pos.emplace_back(pos - slice.thickness()/2.);
112 std::vector<Layer*>& layers = this->layers();
113 for_each(layers.begin(), layers.end(), detail::deletePtr<Layer>);