put back FilterLayeredItems to make samcake happy

This commit is contained in:
SamGondelman 2017-08-16 16:08:38 -07:00
parent e4c954e862
commit ee74f6404e
2 changed files with 29 additions and 0 deletions

View file

@ -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());

View file

@ -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