2021-09-20 20:36:29 +02:00
|
|
|
#ifndef MY_MESH_H
|
|
|
|
#define MY_MESH_H
|
|
|
|
|
|
|
|
#include <OpenMesh/Core/IO/MeshIO.hh>
|
2021-10-03 11:43:55 +02:00
|
|
|
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
|
2021-09-20 20:36:29 +02:00
|
|
|
#include <OpenMesh/Core/Geometry/VectorT.hh>
|
2021-10-02 20:47:02 +02:00
|
|
|
#include <QMatrix4x4>
|
|
|
|
#include <QColor>
|
2021-10-22 14:28:54 +02:00
|
|
|
#include <QVector3D>
|
2021-11-09 22:17:39 +01:00
|
|
|
#include <OpenMesh/Core/Geometry/EigenVectorT.hh>
|
2021-09-20 20:36:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
struct MyTraits : public OpenMesh::DefaultTraits {
|
2021-11-12 20:59:37 +01:00
|
|
|
using Point = Eigen::Vector3<qreal>;
|
|
|
|
using Normal = Eigen::Vector3<qreal>;
|
|
|
|
using Color = Eigen::Vector3<qreal>;
|
2021-11-12 17:08:19 +01:00
|
|
|
VertexAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Color);
|
2021-09-20 20:36:29 +02:00
|
|
|
HalfedgeAttributes(OpenMesh::Attributes::PrevHalfedge);
|
|
|
|
FaceAttributes(OpenMesh::Attributes::Normal);
|
2021-11-25 14:59:13 +01:00
|
|
|
// EdgeAttributes(OpenMesh::Attributes::Color);
|
2021-09-20 20:36:29 +02:00
|
|
|
};
|
2021-10-02 20:47:02 +02:00
|
|
|
|
2021-10-03 11:43:55 +02:00
|
|
|
class MyMesh : public OpenMesh::TriMesh_ArrayKernelT<MyTraits> {
|
2021-10-02 20:47:02 +02:00
|
|
|
public:
|
2021-11-25 14:59:13 +01:00
|
|
|
Color default_color {.5, .5, .5};
|
2021-10-02 20:47:02 +02:00
|
|
|
QMatrix4x4 transform;
|
2021-11-12 17:08:19 +01:00
|
|
|
std::vector<std::vector<HalfedgeHandle>> holes;
|
2021-10-02 20:47:02 +02:00
|
|
|
};
|
|
|
|
|
2021-10-02 12:03:23 +02:00
|
|
|
typedef MyMesh::FaceHandle FaceHandle;
|
|
|
|
typedef MyMesh::VertexHandle VertexHandle;
|
|
|
|
typedef MyMesh::HalfedgeHandle HalfedgeHandle;
|
|
|
|
typedef MyMesh::EdgeHandle EdgeHandle;
|
|
|
|
typedef MyMesh::Point Point;
|
|
|
|
|
|
|
|
|
2021-09-20 20:36:29 +02:00
|
|
|
#endif
|