Fix build

master
huxingyi 2018-05-07 10:16:58 -07:00
parent dc33bfd0a3
commit d7fb742d7b
18 changed files with 63 additions and 60 deletions

View File

@ -50,6 +50,7 @@ after_test:
- 7z a dust3d_unstable_%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\CGAL-4.11.1\build\bin\Release\CGAL-vc140-mt-4.11.1.dll
- 7z a dust3d_unstable_%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\CGAL-4.11.1\auxiliary\gmp\lib\libgmp-10.dll
- 7z a dust3d_unstable_%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\CGAL-4.11.1\auxiliary\gmp\lib\libmpfr-4.dll
- 7z a dust3d_unstable_%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\ci\opengl32sw.dll
- 7z a dust3d_unstable_%PLATFORM%.zip %QTDIR%\bin\Qt5Widgets.dll
- 7z a dust3d_unstable_%PLATFORM%.zip %QTDIR%\bin\Qt5Gui.dll
- 7z a dust3d_unstable_%PLATFORM%.zip %QTDIR%\bin\Qt5Core.dll

BIN
ci/opengl32sw.dll Normal file

Binary file not shown.

View File

@ -80,8 +80,8 @@ HEADERS += src/gltffile.h
SOURCES += src/theme.cpp
HEADERS += src/theme.h
SOURCES += src/mesh.cpp
HEADERS += src/mesh.h
SOURCES += src/meshloader.cpp
HEADERS += src/meshloader.h
SOURCES += src/meshutil.cpp
HEADERS += src/meshutil.h
@ -120,6 +120,8 @@ HEADERS += src/version.h
QMAKE_CXXFLAGS += -std=c++11
win32 {
LIBS += -luser32
isEmpty(BOOST_INCLUDEDIR) {
BOOST_INCLUDEDIR = $$(BOOST_INCLUDEDIR)
}

View File

@ -57,9 +57,9 @@ void MeshGenerator::addPartPreviewRequirement(const QString &partId)
}
}
Mesh *MeshGenerator::takeResultMesh()
MeshLoader *MeshGenerator::takeResultMesh()
{
Mesh *resultMesh = m_mesh;
MeshLoader *resultMesh = m_mesh;
m_mesh = nullptr;
return resultMesh;
}
@ -363,7 +363,7 @@ void MeshGenerator::process()
if (m_requirePartPreviewMap.find(partIdIt) != m_requirePartPreviewMap.end()) {
ModelOfflineRender *render = m_partPreviewRenderMap[partIdIt];
int trimedMeshId = meshlite_trim(meshliteContext, meshId, 1);
render->updateMesh(new Mesh(meshliteContext, trimedMeshId, -1, modelColor));
render->updateMesh(new MeshLoader(meshliteContext, trimedMeshId, -1, modelColor));
QImage *image = new QImage(render->toImage(QSize(Theme::previewImageRenderSize, Theme::previewImageRenderSize)));
m_partPreviewMap[partIdIt] = image;
}
@ -414,7 +414,7 @@ void MeshGenerator::process()
if (mergedMeshId > 0) {
if (m_requirePreview) {
m_previewRender->updateMesh(new Mesh(meshliteContext, mergedMeshId));
m_previewRender->updateMesh(new MeshLoader(meshliteContext, mergedMeshId));
QImage *image = new QImage(m_previewRender->toImage(QSize(Theme::previewImageRenderSize, Theme::previewImageRenderSize)));
m_preview = image;
}
@ -426,7 +426,7 @@ void MeshGenerator::process()
loadGeneratedPositionsToMeshResultContext(meshliteContext, triangulatedFinalMeshId);
//PositionMap<QColor> positionColorMap;
//m_meshResultContext->calculatePositionColorMap(positionColorMap);
m_mesh = new Mesh(meshliteContext, finalMeshId, triangulatedFinalMeshId, broken ? Theme::broken : Theme::white, &m_meshResultContext->triangleColors());
m_mesh = new MeshLoader(meshliteContext, finalMeshId, triangulatedFinalMeshId, broken ? Theme::broken : Theme::white, &m_meshResultContext->triangleColors());
}
if (m_previewRender) {

View File

@ -7,7 +7,7 @@
#include <set>
#include <QThread>
#include "skeletonsnapshot.h"
#include "mesh.h"
#include "meshloader.h"
#include "modelofflinerender.h"
#include "meshresultcontext.h"
@ -19,7 +19,7 @@ public:
~MeshGenerator();
void addPreviewRequirement();
void addPartPreviewRequirement(const QString &partId);
Mesh *takeResultMesh();
MeshLoader *takeResultMesh();
QImage *takePreview();
QImage *takePartPreview(const QString &partId);
MeshResultContext *takeMeshResultContext();
@ -29,7 +29,7 @@ public slots:
void process();
private:
SkeletonSnapshot *m_snapshot;
Mesh *m_mesh;
MeshLoader *m_mesh;
QImage *m_preview;
std::map<QString, QImage *> m_partPreviewMap;
bool m_requirePreview;

View File

@ -1,12 +1,12 @@
#include <assert.h>
#include "mesh.h"
#include "meshloader.h"
#include "meshlite.h"
#include "theme.h"
#include "positionmap.h"
#define MAX_VERTICES_PER_FACE 100
Mesh::Mesh(void *meshlite, int meshId, int triangulatedMeshId, QColor modelColor, const std::vector<QColor> *triangleColors) :
MeshLoader::MeshLoader(void *meshlite, int meshId, int triangulatedMeshId, QColor modelColor, const std::vector<QColor> *triangleColors) :
m_triangleVertices(NULL),
m_triangleVertexCount(0),
m_edgeVertices(NULL),
@ -137,48 +137,48 @@ Mesh::Mesh(void *meshlite, int meshId, int triangulatedMeshId, QColor modelColor
delete[] edgeNormals;
}
Mesh::~Mesh()
MeshLoader::~MeshLoader()
{
delete[] m_triangleVertices;
m_triangleVertexCount = 0;
}
const std::vector<QVector3D> &Mesh::vertices()
const std::vector<QVector3D> &MeshLoader::vertices()
{
return m_vertices;
}
const std::vector<std::vector<int>> &Mesh::faces()
const std::vector<std::vector<int>> &MeshLoader::faces()
{
return m_faces;
}
const std::vector<QVector3D> &Mesh::triangulatedVertices()
const std::vector<QVector3D> &MeshLoader::triangulatedVertices()
{
return m_triangulatedVertices;
}
const std::vector<TriangulatedFace> &Mesh::triangulatedFaces()
const std::vector<TriangulatedFace> &MeshLoader::triangulatedFaces()
{
return m_triangulatedFaces;
}
Vertex *Mesh::triangleVertices()
Vertex *MeshLoader::triangleVertices()
{
return m_triangleVertices;
}
int Mesh::triangleVertexCount()
int MeshLoader::triangleVertexCount()
{
return m_triangleVertexCount;
}
Vertex *Mesh::edgeVertices()
Vertex *MeshLoader::edgeVertices()
{
return m_edgeVertices;
}
int Mesh::edgeVertexCount()
int MeshLoader::edgeVertexCount()
{
return m_edgeVertexCount;
}

View File

@ -1,5 +1,5 @@
#ifndef MESH_H
#define MESH_H
#ifndef MESH_LOADER_H
#define MESH_LOADER_H
#include <QObject>
#include <QOpenGLFunctions>
#include <vector>
@ -30,11 +30,11 @@ struct TriangulatedFace
QColor color;
};
class Mesh
class MeshLoader
{
public:
Mesh(void *meshlite, int meshId, int triangulatedMeshId = -1, QColor modelColor=Theme::white, const std::vector<QColor> *triangleColors=nullptr);
~Mesh();
MeshLoader(void *meshlite, int meshId, int triangulatedMeshId = -1, QColor modelColor=Theme::white, const std::vector<QColor> *triangleColors=nullptr);
~MeshLoader();
Vertex *triangleVertices();
int triangleVertexCount();
Vertex *edgeVertices();

View File

@ -149,7 +149,7 @@ int unionMeshs(void *meshliteContext, const std::vector<int> &meshIds, int *erro
for (size_t i = 0; i < meshIds.size(); i++) {
int triangledMeshId = meshlite_triangulate(meshliteContext, meshIds[i]);
//if (!meshlite_is_triangulated_manifold(meshliteContext, triangledMeshId))
// qDebug() << "Mesh is not manifold after triangulated:" << triangledMeshId;
// qDebug() << "MeshLoader is not manifold after triangulated:" << triangledMeshId;
ExactMesh *mesh = makeCgalMeshFromMeshlite<ExactKernel>(meshliteContext, triangledMeshId);
if (CGAL::Polygon_mesh_processing::does_self_intersect(*mesh)) {
qDebug() << "CGAL::Polygon_mesh_processing::does_self_intersect:" << i;

View File

@ -22,7 +22,7 @@ ModelMeshBinder::~ModelMeshBinder()
delete m_mesh;
}
void ModelMeshBinder::updateMesh(Mesh *mesh)
void ModelMeshBinder::updateMesh(MeshLoader *mesh)
{
QMutexLocker lock(&m_meshMutex);
if (mesh != m_mesh) {

View File

@ -4,14 +4,14 @@
#include <QMutex>
#include <QOpenGLBuffer>
#include <QString>
#include "mesh.h"
#include "meshloader.h"
class ModelMeshBinder
{
public:
ModelMeshBinder();
~ModelMeshBinder();
void updateMesh(Mesh *mesh);
void updateMesh(MeshLoader *mesh);
void exportMeshAsObj(const QString &filename);
void exportMeshAdObjPlusMaterials(const QString &filename);
void initialize();
@ -21,7 +21,7 @@ public:
void hideWireframes();
bool isWireframesVisible();
private:
Mesh *m_mesh;
MeshLoader *m_mesh;
int m_renderTriangleVertexCount;
int m_renderEdgeVertexCount;
bool m_meshUpdated;

View File

@ -29,7 +29,7 @@ ModelOfflineRender::~ModelOfflineRender()
delete m_mesh;
}
void ModelOfflineRender::updateMesh(Mesh *mesh)
void ModelOfflineRender::updateMesh(MeshLoader *mesh)
{
delete m_mesh;
m_mesh = mesh;

View File

@ -8,7 +8,7 @@
#include <QThread>
#include "modelshaderprogram.h"
#include "modelmeshbinder.h"
#include "mesh.h"
#include "meshloader.h"
class ModelOfflineRender : QOffscreenSurface
{
@ -16,11 +16,11 @@ public:
ModelOfflineRender(QScreen *targetScreen = Q_NULLPTR);
~ModelOfflineRender();
void setRenderThread(QThread *thread);
void updateMesh(Mesh *mesh);
void updateMesh(MeshLoader *mesh);
QImage toImage(const QSize &size);
private:
QOpenGLContext *m_context;
Mesh *m_mesh;
MeshLoader *m_mesh;
};
#endif

View File

@ -277,7 +277,7 @@ void ModelWidget::wheelEvent(QWheelEvent *event)
setGeometry(geometry().marginsAdded(margins));
}
void ModelWidget::updateMesh(Mesh *mesh)
void ModelWidget::updateMesh(MeshLoader *mesh)
{
m_meshBinder.updateMesh(mesh);
update();

View File

@ -7,7 +7,7 @@
#include <QMatrix4x4>
#include <QMutex>
#include <QRubberBand>
#include "mesh.h"
#include "meshloader.h"
#include "modelshaderprogram.h"
#include "modelmeshbinder.h"
@ -24,7 +24,7 @@ public:
static bool isTransparent() { return m_transparent; }
static void setTransparent(bool t) { m_transparent = t; }
void updateMesh(Mesh *mesh);
void updateMesh(MeshLoader *mesh);
void exportMeshAsObj(const QString &filename);
void exportMeshAsObjPlusMaterials(const QString &filename);
void setGraphicsFunctions(SkeletonGraphicsFunctions *graphicsFunctions);

View File

@ -775,23 +775,23 @@ void SkeletonDocument::fromSnapshot(const SkeletonSnapshot &snapshot)
addFromSnapshot(snapshot);
}
Mesh *SkeletonDocument::takeResultMesh()
MeshLoader *SkeletonDocument::takeResultMesh()
{
Mesh *resultMesh = m_resultMesh;
MeshLoader *resultMesh = m_resultMesh;
m_resultMesh = nullptr;
return resultMesh;
}
Mesh *SkeletonDocument::takeResultSkeletonMesh()
MeshLoader *SkeletonDocument::takeResultSkeletonMesh()
{
Mesh *resultSkeletonMesh = m_resultSkeletonMesh;
MeshLoader *resultSkeletonMesh = m_resultSkeletonMesh;
m_resultSkeletonMesh = nullptr;
return resultSkeletonMesh;
}
void SkeletonDocument::meshReady()
{
Mesh *resultMesh = m_meshGenerator->takeResultMesh();
MeshLoader *resultMesh = m_meshGenerator->takeResultMesh();
MeshResultContext *meshResultContext = m_meshGenerator->takeMeshResultContext();
QImage *resultPreview = m_meshGenerator->takePreview();
@ -822,7 +822,7 @@ void SkeletonDocument::meshReady()
delete m_meshGenerator;
m_meshGenerator = nullptr;
qDebug() << "Mesh generation done";
qDebug() << "MeshLoader generation done";
emit resultMeshChanged();
@ -853,7 +853,7 @@ void SkeletonDocument::generateMesh()
return;
}
qDebug() << "Mesh generating..";
qDebug() << "MeshLoader generating..";
m_resultMeshIsObsolete = false;
@ -942,7 +942,7 @@ void SkeletonDocument::generateSkeleton()
void SkeletonDocument::skeletonReady()
{
Mesh *resultSkeletonMesh = m_skeletonGenerator->takeResultSkeletonMesh();
MeshLoader *resultSkeletonMesh = m_skeletonGenerator->takeResultSkeletonMesh();
delete m_resultSkeletonMesh;
m_resultSkeletonMesh = resultSkeletonMesh;
@ -973,7 +973,7 @@ void SkeletonDocument::postProcess()
m_postProcessResultIsObsolete = false;
if (!m_currentMeshResultContext) {
qDebug() << "Mesh is null";
qDebug() << "MeshLoader is null";
return;
}

View File

@ -9,7 +9,7 @@
#include <QImage>
#include <cmath>
#include "skeletonsnapshot.h"
#include "mesh.h"
#include "meshloader.h"
#include "meshgenerator.h"
#include "skeletongenerator.h"
#include "theme.h"
@ -238,8 +238,8 @@ public:
const SkeletonEdge *findEdge(QUuid edgeId) const;
const SkeletonPart *findPart(QUuid partId) const;
const SkeletonEdge *findEdgeByNodes(QUuid firstNodeId, QUuid secondNodeId) const;
Mesh *takeResultMesh();
Mesh *takeResultSkeletonMesh();
MeshLoader *takeResultMesh();
MeshLoader *takeResultSkeletonMesh();
void updateTurnaround(const QImage &image);
bool hasPastableContentInClipboard() const;
bool undoable() const;
@ -302,12 +302,12 @@ private:
private: // need initialize
bool m_resultMeshIsObsolete;
MeshGenerator *m_meshGenerator;
Mesh *m_resultMesh;
MeshLoader *m_resultMesh;
int m_batchChangeRefCount;
MeshResultContext *m_currentMeshResultContext;
bool m_resultSkeletonIsObsolete;
SkeletonGenerator *m_skeletonGenerator;
Mesh *m_resultSkeletonMesh;
MeshLoader *m_resultSkeletonMesh;
bool m_textureIsObsolete;
TextureGenerator *m_textureGenerator;
bool m_postProcessResultIsObsolete;

View File

@ -19,9 +19,9 @@ SkeletonGenerator::~SkeletonGenerator()
delete m_meshResultContext;
}
Mesh *SkeletonGenerator::takeResultSkeletonMesh()
MeshLoader *SkeletonGenerator::takeResultSkeletonMesh()
{
Mesh *resultSkeletonMesh = m_resultSkeletonMesh;
MeshLoader *resultSkeletonMesh = m_resultSkeletonMesh;
m_resultSkeletonMesh = nullptr;
return resultSkeletonMesh;
}
@ -33,7 +33,7 @@ MeshResultContext *SkeletonGenerator::takeResultContext()
return resultContext;
}
Mesh *SkeletonGenerator::createSkeletonMesh()
MeshLoader *SkeletonGenerator::createSkeletonMesh()
{
void *meshliteContext = meshlite_create_context();
int sklt = meshlite_skeletonmesh_create(meshliteContext);
@ -63,7 +63,7 @@ Mesh *SkeletonGenerator::createSkeletonMesh()
}
int meshId = meshlite_skeletonmesh_generate_mesh(meshliteContext, sklt);
Mesh *skeletonMesh = new Mesh(meshliteContext, meshId, -1, Theme::green);
MeshLoader *skeletonMesh = new MeshLoader(meshliteContext, meshId, -1, Theme::green);
meshlite_destroy_context(meshliteContext);

View File

@ -2,7 +2,7 @@
#define SKELETON_GENERATOR_H
#include <QObject>
#include "meshresultcontext.h"
#include "mesh.h"
#include "meshloader.h"
// https://raw.githubusercontent.com/KhronosGroup/glTF/master/specification/2.0/figures/gltfOverview-2.0.0a.png
@ -12,7 +12,7 @@ class SkeletonGenerator : public QObject
public:
SkeletonGenerator(const MeshResultContext &meshResultContext);
~SkeletonGenerator();
Mesh *takeResultSkeletonMesh();
MeshLoader *takeResultSkeletonMesh();
MeshResultContext *takeResultContext();
signals:
void finished();
@ -20,10 +20,10 @@ public slots:
void process();
private:
void combineAllBmeshSkeletons();
Mesh *createSkeletonMesh();
MeshLoader *createSkeletonMesh();
private:
MeshResultContext *m_meshResultContext;
Mesh *m_resultSkeletonMesh;
MeshLoader *m_resultSkeletonMesh;
};
#endif