mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-14 16:07:01 +02:00
put back FilterLayeredItems to make samcake happy
This commit is contained in:
parent
e4c954e862
commit
ee74f6404e
2 changed files with 29 additions and 0 deletions
|
@ -21,6 +21,21 @@
|
|||
|
||||
using namespace render;
|
||||
|
||||
void FilterLayeredItems::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
|
||||
auto& scene = renderContext->_scene;
|
||||
|
||||
// Clear previous values
|
||||
outItems.clear();
|
||||
|
||||
// For each item, filter it into one bucket
|
||||
for (auto& itemBound : inItems) {
|
||||
auto& item = scene->getItem(itemBound.id);
|
||||
if (item.getLayer() == _keepLayer) {
|
||||
outItems.emplace_back(itemBound);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SliceItems::run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems) {
|
||||
outItems.clear();
|
||||
std::static_pointer_cast<Config>(renderContext->jobConfig)->setNumItems((int)inItems.size());
|
||||
|
|
|
@ -62,6 +62,20 @@ namespace render {
|
|||
}
|
||||
};
|
||||
|
||||
// Filter the items belonging to the job's keep layer
|
||||
class FilterLayeredItems {
|
||||
public:
|
||||
using JobModel = Job::ModelIO<FilterLayeredItems, ItemBounds, ItemBounds>;
|
||||
|
||||
FilterLayeredItems() {}
|
||||
FilterLayeredItems(int keepLayer) :
|
||||
_keepLayer(keepLayer) {}
|
||||
|
||||
int _keepLayer { 0 };
|
||||
|
||||
void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
|
||||
};
|
||||
|
||||
// SliceItems job config defining the slice range
|
||||
class SliceItemsConfig : public Job::Config {
|
||||
Q_OBJECT
|
||||
|
|
Loading…
Reference in a new issue