Add logo.
Jezzasoft Font family: Myriad Pro Bold Font size: 32px Dust3D Font family: Klavika Bold Font size: 48px GIMP: Font color: black Adjust brightness and Contrast Contrast: -50master
parent
d86004b46a
commit
ec154633be
Binary file not shown.
|
@ -4,5 +4,6 @@
|
|||
<file>resources/rotate.svg</file>
|
||||
<file>resources/zoomin.svg</file>
|
||||
<file>resources/zoomout.svg</file>
|
||||
<file>resources/dust3d_jezzasoft.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
|
@ -14,6 +14,7 @@
|
|||
#include <QComboBox>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QLabel>
|
||||
#include <assert.h>
|
||||
#include "mainwindow.h"
|
||||
#include "skeletonwidget.h"
|
||||
|
@ -93,10 +94,22 @@ MainWindow::MainWindow()
|
|||
|
||||
modelRightLayout->addStretch();
|
||||
|
||||
QLabel *dust3dJezzasoftLabel = new QLabel;
|
||||
QImage dust3dJezzasoftImage;
|
||||
dust3dJezzasoftImage.load(":/resources/dust3d_jezzasoft.png");
|
||||
dust3dJezzasoftLabel->setPixmap(QPixmap::fromImage(dust3dJezzasoftImage));
|
||||
|
||||
QVBoxLayout *mainLeftLayout = new QVBoxLayout;
|
||||
mainLeftLayout->addStretch();
|
||||
mainLeftLayout->addWidget(dust3dJezzasoftLabel);
|
||||
mainLeftLayout->setSpacing(0);
|
||||
mainLeftLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
SkeletonWidget *skeletonWidget = new SkeletonWidget(this);
|
||||
m_skeletonWidget = skeletonWidget;
|
||||
|
||||
QHBoxLayout *modelPageLayout = new QHBoxLayout;
|
||||
modelPageLayout->addLayout(mainLeftLayout);
|
||||
modelPageLayout->addWidget(skeletonWidget);
|
||||
//modelPageLayout->addLayout(modelRightLayout);
|
||||
|
||||
|
|
16
src/mesh.cpp
16
src/mesh.cpp
|
@ -1,5 +1,6 @@
|
|||
#include "mesh.h"
|
||||
#include "meshlite.h"
|
||||
#include "theme.h"
|
||||
#include <assert.h>
|
||||
|
||||
#define MAX_VERTICES_PER_FACE 100
|
||||
|
@ -60,9 +61,9 @@ Mesh::Mesh(void *meshlite, int meshId) :
|
|||
v->normX = edgeNormals[firstIndex + 0];
|
||||
v->normY = edgeNormals[firstIndex + 1];
|
||||
v->normZ = edgeNormals[firstIndex + 2];
|
||||
v->colorR = 0;
|
||||
v->colorG = 0;
|
||||
v->colorB = 0;
|
||||
v->colorR = 0.0;
|
||||
v->colorG = 0.0;
|
||||
v->colorB = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,6 +79,9 @@ Mesh::Mesh(void *meshlite, int meshId) :
|
|||
GLfloat *triangleNormals = new GLfloat[triangleCount * 3];
|
||||
int loadedTriangleNormalItemCount = meshlite_get_triangle_normal_array(meshlite, triangleMesh, triangleNormals, triangleCount * 3);
|
||||
|
||||
float modelR = Theme::white.redF();
|
||||
float modelG = Theme::white.greenF();
|
||||
float modelB = Theme::white.blueF();
|
||||
m_triangleVertexCount = triangleCount * 3;
|
||||
m_triangleVertices = new Vertex[m_triangleVertexCount * 3];
|
||||
for (int i = 0; i < triangleCount; i++) {
|
||||
|
@ -94,9 +98,9 @@ Mesh::Mesh(void *meshlite, int meshId) :
|
|||
v->normX = triangleNormals[firstIndex + 0];
|
||||
v->normY = triangleNormals[firstIndex + 1];
|
||||
v->normZ = triangleNormals[firstIndex + 2];
|
||||
v->colorR = 1.0;
|
||||
v->colorG = 1.0;
|
||||
v->colorB = 1.0;
|
||||
v->colorR = modelR;
|
||||
v->colorG = modelG;
|
||||
v->colorB = modelB;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ SkeletonEditGraphicsView::SkeletonEditGraphicsView(QWidget *parent) :
|
|||
m_backgroundLoaded(false),
|
||||
m_modelWidget(NULL),
|
||||
m_modelWidgetProxy(NULL),
|
||||
m_combineEnabled(false),
|
||||
m_combineEnabled(true),
|
||||
m_unionEnabled(true),
|
||||
m_subdivEnabled(false)
|
||||
{
|
||||
|
@ -230,6 +230,9 @@ bool SkeletonEditGraphicsView::keyPress(QKeyEvent *event, const QPointF &scenePo
|
|||
} else if (event->key() == Qt::Key_S) {
|
||||
m_subdivEnabled = !m_subdivEnabled;
|
||||
emit nodesChanged();
|
||||
} else if (event->key() == Qt::Key_Tab) {
|
||||
if (m_nextStartNodeItem)
|
||||
setNextStartNodeItem(m_nextStartNodeItem->nextSidePair());
|
||||
} else if (event->key() == Qt::Key_Delete || event->key() ==Qt::Key_Backspace) {
|
||||
removeSelectedItems();
|
||||
processed = true;
|
||||
|
@ -457,6 +460,7 @@ bool SkeletonEditGraphicsView::wheel(QWheelEvent *event, const QPointF &scenePos
|
|||
AddItemRadius(m_pendingNodeItem, delta);
|
||||
if (!m_inAddNodeMode && m_lastHoverNodeItem) {
|
||||
AddItemRadius(m_lastHoverNodeItem, delta);
|
||||
AddItemRadius(m_lastHoverNodeItem->nextSidePair(), delta);
|
||||
processed = true;
|
||||
emit nodesChanged();
|
||||
}
|
||||
|
|
|
@ -272,4 +272,11 @@ void SkeletonSnapshot::resolveRootNode()
|
|||
|
||||
if (m_rootNode.isEmpty())
|
||||
m_rootNode = findMaxNeighborNumberNode();
|
||||
|
||||
if (m_rootNode.isEmpty()) {
|
||||
nodeIterator = nodes.begin();
|
||||
if (nodeIterator != nodes.end()) {
|
||||
m_rootNode = nodeIterator->first;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,9 +83,8 @@ void SkeletonToMesh::process()
|
|||
float y = (nodeIterator->second["y"].toFloat() - frontMiddleY) / canvasHeight;
|
||||
float z = (nextSidePair->second["x"].toFloat() - sideMiddleX) / canvasHeight;
|
||||
float r = nodeIterator->second["radius"].toFloat() / canvasHeight;
|
||||
float t = nextSidePair->second["radius"].toFloat() / canvasHeight;
|
||||
int bmeshNodeId = meshlite_bmesh_add_node(meshliteContext, bmeshId, x, y, z, r, t);
|
||||
printf("meshlite_bmesh_add_node x:%f y:%f z:%f r:%f t:%f nodeName:%s bmeshNodeId:%d\n", x, y, z, r, t, nodeIterator->first.toUtf8().constData(), bmeshNodeId);
|
||||
int bmeshNodeId = meshlite_bmesh_add_node(meshliteContext, bmeshId, x, y, z, r);
|
||||
printf("meshlite_bmesh_add_node x:%f y:%f z:%f r:%f nodeName:%s bmeshNodeId:%d\n", x, y, z, r, nodeIterator->first.toUtf8().constData(), bmeshNodeId);
|
||||
bmeshNodeMap[nodeIterator->first] = bmeshNodeId;
|
||||
}
|
||||
|
||||
|
@ -116,15 +115,17 @@ void SkeletonToMesh::process()
|
|||
} else {
|
||||
mergedMeshId = mergeMeshs(meshliteContext, meshIds);
|
||||
}
|
||||
if (subdivEnabled) {
|
||||
if (combineEnabled) {
|
||||
if (mergedMeshId > 0) {
|
||||
mergedMeshId = meshlite_combine_coplanar_faces(meshliteContext, mergedMeshId);
|
||||
}
|
||||
}
|
||||
if (subdivEnabled) {
|
||||
if (mergedMeshId > 0 && meshlite_is_triangulated_manifold(meshliteContext, mergedMeshId)) {
|
||||
mergedMeshId = meshlite_subdivide(meshliteContext, mergedMeshId);
|
||||
}
|
||||
}
|
||||
if (mergedMeshId > 0) {
|
||||
if (combineEnabled) {
|
||||
mergedMeshId = meshlite_combine_adj_faces(meshliteContext, mergedMeshId);
|
||||
}
|
||||
m_mesh = new Mesh(meshliteContext, mergedMeshId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,16 +14,17 @@
|
|||
// White
|
||||
// 0xf7, 0xd9, 0xc8
|
||||
|
||||
QColor Theme::red = QColor(0xff, 0xff, 0xff);
|
||||
QColor Theme::green = QColor(0xff, 0xff, 0xff);
|
||||
QColor Theme::red = QColor(0xfc, 0x66, 0x21);
|
||||
QColor Theme::green = QColor(0xaa, 0xeb, 0xc4);
|
||||
QColor Theme::blue = QColor(0x2a, 0x5a, 0xac);
|
||||
QColor Theme::white = QColor(0xf7, 0xd9, 0xc8);
|
||||
float Theme::normalAlpha = 96.0 / 255;
|
||||
float Theme::branchAlpha = 64.0 / 255;
|
||||
float Theme::checkedAlpha = 1.0;
|
||||
float Theme::edgeAlpha = 1.0;
|
||||
float Theme::fillAlpha = 50.0 / 255;
|
||||
int Theme::skeletonNodeBorderSize = 2;
|
||||
int Theme::skeletonEdgeWidth = 2;
|
||||
int Theme::skeletonNodeBorderSize = 0;
|
||||
int Theme::skeletonEdgeWidth = 0;
|
||||
|
||||
std::map<QString, QString> createSideColorNameMap() {
|
||||
std::map<QString, QString> map;
|
||||
|
|
|
@ -10,6 +10,7 @@ public:
|
|||
static QColor red;
|
||||
static QColor green;
|
||||
static QColor blue;
|
||||
static QColor white;
|
||||
static float normalAlpha;
|
||||
static float checkedAlpha;
|
||||
static float branchAlpha;
|
||||
|
|
|
@ -22,12 +22,14 @@
|
|||
// https://doc.cgal.org/latest/Polygon_mesh_processing/Polygon_mesh_processing_2corefinement_mesh_union_8cpp-example.html#a2
|
||||
// https://doc.cgal.org/latest/Polygon_mesh_processing/Polygon_mesh_processing_2triangulate_faces_example_8cpp-example.html
|
||||
// https://github.com/CGAL/cgal/issues/2875
|
||||
// https://doc.cgal.org/latest/Polygon_mesh_processing/Polygon_mesh_processing_2hausdorff_distance_remeshing_example_8cpp-example.html#a3
|
||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Polygon_mesh_processing/corefinement.h>
|
||||
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <CGAL/assertions_behaviour.h>
|
||||
#include <CGAL/Polygon_mesh_processing/remesh.h>
|
||||
|
||||
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
|
||||
typedef CGAL::Surface_mesh<Kernel::Point_3> CgalMesh;
|
||||
|
@ -120,6 +122,7 @@ CgalMesh *unionCgalMeshs(CgalMesh *first, CgalMesh *second)
|
|||
delete mesh;
|
||||
return NULL;
|
||||
}
|
||||
//CGAL::Polygon_mesh_processing::isotropic_remeshing(mesh->faces(), 0.4, *mesh);
|
||||
} catch (...) {
|
||||
delete mesh;
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue