2019-12-28 05:21:59 +00:00
|
|
|
#ifndef DUST3D_REMESHER_H
|
|
|
|
#define DUST3D_REMESHER_H
|
|
|
|
#include <QObject>
|
|
|
|
#include <vector>
|
|
|
|
#include <QVector3D>
|
2019-12-29 08:52:35 +00:00
|
|
|
#include <QUuid>
|
2019-12-28 05:21:59 +00:00
|
|
|
|
|
|
|
class Remesher : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-01-04 10:29:10 +00:00
|
|
|
Remesher();
|
2019-12-28 05:21:59 +00:00
|
|
|
~Remesher();
|
|
|
|
void setMesh(const std::vector<QVector3D> &vertices,
|
|
|
|
const std::vector<std::vector<size_t>> &triangles);
|
2019-12-29 08:52:35 +00:00
|
|
|
void setNodes(const std::vector<std::pair<QVector3D, float>> &nodes,
|
|
|
|
const std::vector<std::pair<QUuid, QUuid>> &sourceIds);
|
2020-01-04 14:50:10 +00:00
|
|
|
void remesh(float targetVertexMultiplyFactor);
|
2019-12-29 08:52:35 +00:00
|
|
|
const std::vector<QVector3D> &getRemeshedVertices() const;
|
|
|
|
const std::vector<std::vector<size_t>> &getRemeshedFaces() const;
|
|
|
|
const std::vector<std::pair<QUuid, QUuid>> &getRemeshedVertexSources() const;
|
2019-12-28 05:21:59 +00:00
|
|
|
private:
|
|
|
|
std::vector<QVector3D> m_vertices;
|
|
|
|
std::vector<std::vector<size_t>> m_triangles;
|
|
|
|
std::vector<QVector3D> m_remeshedVertices;
|
|
|
|
std::vector<std::vector<size_t>> m_remeshedFaces;
|
2019-12-29 08:52:35 +00:00
|
|
|
std::vector<std::pair<QUuid, QUuid>> m_remeshedVertexSources;
|
|
|
|
std::vector<std::pair<QVector3D, float>> m_nodes;
|
|
|
|
std::vector<std::pair<QUuid, QUuid>> m_sourceIds;
|
|
|
|
void resolveSources();
|
2019-12-28 05:21:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|