◆ LayerData
◆ Layers
◆ RadiusLayerPolygonCache() [1/3]
| Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::RadiusLayerPolygonCache |
( |
| ) |
|
|
default |
◆ RadiusLayerPolygonCache() [2/3]
| Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::RadiusLayerPolygonCache |
( |
RadiusLayerPolygonCache && | rhs | ) |
|
|
inline |
◆ RadiusLayerPolygonCache() [3/3]
| Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::RadiusLayerPolygonCache |
( |
const RadiusLayerPolygonCache & | | ) |
|
|
delete |
◆ allocate_layers()
| void Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::allocate_layers |
( |
size_t | num_layers | ) |
|
|
private |
◆ clear()
| void Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::clear |
( |
| ) |
|
|
inline |
◆ clear_all_but_radius0()
| void Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::clear_all_but_radius0 |
( |
| ) |
|
|
inline |
300 {
302 auto begin = l.begin();
304 if (begin != end && ++ begin != end)
305 l.erase(begin, end);
306 }
307 }
std::map< coord_t, Polygons > LayerData
Definition TreeModelVolumes.hpp:213
T * begin(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:838
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:841
References m_data.
◆ get_allocate_layer_data()
| LayerData & Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::get_allocate_layer_data |
( |
LayerIndex | layer_idx | ) |
|
|
inlineprivate |
◆ get_lower_bound_area()
264 {
265 std::lock_guard<std::mutex> guard(
m_mutex);
267 return {};
268 const auto &layer =
m_data[key.second];
269 if (layer.empty())
270 return {};
271 auto it = layer.lower_bound(key.first);
272 if (it == layer.end() || it->first != key.first) {
273 if (it == layer.begin())
274 return {};
275 -- it;
276 }
277 return std::make_pair(it->first, std::reference_wrapper<const Polygons>(it->second));
278 }
std::mutex m_mutex
Definition TreeModelVolumes.hpp:317
int LayerIndex
Definition TreeSupportCommon.hpp:43
References m_data, and m_mutex.
◆ getArea()
Checks a cache for a given RadiusLayerPair and returns it if it is found.
- Parameters
-
| key | RadiusLayerPair of the requested areas. The radius will be calculated up to the provided layer. |
- Returns
- A wrapped optional reference of the requested area (if it was found, an empty optional if nothing was found)
254 {
255 std::lock_guard<std::mutex> guard(
m_mutex);
257 return std::optional<std::reference_wrapper<const Polygons>>{};
258 const auto &layer =
m_data[key.second];
259 auto it = layer.find(key.first);
260 return it == layer.end() ?
261 std::optional<std::reference_wrapper<const Polygons>>{} : std::optional<std::reference_wrapper<const Polygons>>{ it->second };
262 }
References m_data, and m_mutex.
◆ getMaxCalculatedLayer()
| LayerIndex Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::getMaxCalculatedLayer |
( |
coord_t | radius | ) |
const |
|
inline |
Get the highest already calculated layer in the cache.
- Parameters
-
| radius | The radius for which the highest already calculated layer has to be found. |
| map | The cache in which the lookup is performed. |
- Returns
- A wrapped optional reference of the requested area (if it was found, an empty optional if nothing was found)
286 {
287 std::lock_guard<std::mutex> guard(
m_mutex);
289 for (; layer_idx > 0; -- layer_idx)
290 if (
const auto &layer =
m_data[layer_idx]; layer.find(radius) != layer.end())
291 break;
292
293 return layer_idx == 0 ? -1 : layer_idx;
294 }
References m_data, and m_mutex.
◆ insert() [1/4]
| void Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::insert |
( |
LayerPolygonCache && | in, |
|
|
coord_t | radius ) |
|
inline |
◆ insert() [2/4]
| void Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::insert |
( |
std::vector< Polygons > && | in, |
|
|
coord_t | first_layer_idx, |
|
|
coord_t | radius ) |
|
inline |
◆ insert() [3/4]
| void Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::insert |
( |
std::vector< std::pair< coord_t, Polygons > > && | in, |
|
|
coord_t | radius ) |
|
inline |
231 {
232 std::lock_guard<std::mutex> guard(
m_mutex);
233 for (auto &d : in)
235 }
LayerData & get_allocate_layer_data(LayerIndex layer_idx)
Definition TreeModelVolumes.hpp:310
References get_allocate_layer_data(), and m_mutex.
◆ insert() [4/4]
| void Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::insert |
( |
std::vector< std::pair< RadiusLayerPair, Polygons > > && | in | ) |
|
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ sorted()
934{
935 std::vector<std::pair<RadiusLayerPair, std::reference_wrapper<const Polygons>>> out;
936 for (
auto &layer :
m_data) {
938 for (auto &radius_polygons : layer)
939 out.emplace_back(std::make_pair(radius_polygons.first, layer_idx), radius_polygons.second);
940 }
941 assert(std::is_sorted(out.begin(), out.end(), [](auto &l, auto &r){ return l.first.second < r.first.second || (l.first.second == r.first.second) && l.first.first < r.first.first; }));
942 return out;
943}
References m_data, and sorted().
Referenced by Slic3r::TreeSupport3D::TreeModelVolumes::precalculate(), and sorted().
◆ m_data
| Layers Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::m_data |
|
private |
Referenced by RadiusLayerPolygonCache(), allocate_layers(), clear(), clear_all_but_radius0(), get_allocate_layer_data(), get_lower_bound_area(), getArea(), getMaxCalculatedLayer(), insert(), insert(), operator=(), and sorted().
◆ m_mutex
| std::mutex Slic3r::TreeSupport3D::TreeModelVolumes::RadiusLayerPolygonCache::m_mutex |
|
mutableprivate |
The documentation for this class was generated from the following files: