#ifndef GLOBALPOINTSTESTINFOVISITOR_HPP #define GLOBALPOINTSTESTINFOVISITOR_HPP #include "globalpointstestinfovisitor.h" template GlobalPointsTestInfoVisitor::GlobalPointsTestInfoVisitor() { m_infoCloud = nullptr; m_testFunction = nullptr; m_foundedPoints = new FoundedCloudIndex(); } template GlobalPointsTestInfoVisitor::~GlobalPointsTestInfoVisitor() { delete m_foundedPoints; } template void GlobalPointsTestInfoVisitor::setCurrentInformation(const ItemModel *model, const PermanentItemScene *scene) { Q_UNUSED(model) m_infoCloud = scene->getPointCloudAttributesProvider()->getInfoCloud(); } template void GlobalPointsTestInfoVisitor::addPointsToCompute(const Eigen::Vector3d &offset, std::vector &indices, const size_t &firstPointGlobalIndex) { Q_UNUSED(offset) if((m_infoCloud != nullptr) && (m_testFunction != nullptr)) { std::vector::const_iterator it = indices.begin(); std::vector::const_iterator end = indices.end(); ElementInfo* firstSelectInfo = &(*m_infoCloud)[firstPointGlobalIndex]; while(it != end) { if(m_testFunction(firstSelectInfo[*it])) m_foundedPoints->addIndex(firstPointGlobalIndex + (*it)); ++it; } } } template void GlobalPointsTestInfoVisitor::setFunction(testFunction f) { m_testFunction = f; } template FoundedCloudIndex* GlobalPointsTestInfoVisitor::getFoundedPoints() const { return m_foundedPoints; } template FoundedCloudIndex* GlobalPointsTestInfoVisitor::takeFoundedPoints() { FoundedCloudIndex* s = m_foundedPoints; m_foundedPoints = new FoundedCloudIndex(); return s; } #endif // GLOBALPOINTSTESTINFOVISITOR_HPP