#include #include "meshresultpostprocessor.h" #include "uvunwrap.h" #include "triangletangentresolve.h" MeshResultPostProcessor::MeshResultPostProcessor(const Outcome &outcome) { m_outcome = new Outcome; *m_outcome = outcome; } MeshResultPostProcessor::~MeshResultPostProcessor() { delete m_outcome; } Outcome *MeshResultPostProcessor::takePostProcessedOutcome() { Outcome *outcome = m_outcome; m_outcome = nullptr; return outcome; } void MeshResultPostProcessor::poseProcess() { #ifndef NDEBUG return; #endif if (!m_outcome->nodes.empty()) { { std::vector> triangleVertexUvs; std::set seamVertices; std::map> partUvRects; uvUnwrap(*m_outcome, triangleVertexUvs, seamVertices, partUvRects); m_outcome->setTriangleVertexUvs(triangleVertexUvs); m_outcome->setPartUvRects(partUvRects); } { std::vector triangleTangents; triangleTangentResolve(*m_outcome, triangleTangents); m_outcome->setTriangleTangents(triangleTangents); } } } void MeshResultPostProcessor::process() { poseProcess(); emit finished(); }