39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
#ifndef MY_MESH_H
|
|
#define MY_MESH_H
|
|
|
|
#include <OpenMesh/Core/IO/MeshIO.hh>
|
|
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
|
|
#include <OpenMesh/Core/Geometry/VectorT.hh>
|
|
#include <QMatrix4x4>
|
|
#include <QColor>
|
|
#include <QVector3D>
|
|
#include <OpenMesh/Core/Geometry/EigenVectorT.hh>
|
|
|
|
|
|
struct MyTraits : public OpenMesh::DefaultTraits {
|
|
using Point = Eigen::Vector3<qreal>;
|
|
using Normal = Eigen::Vector3<qreal>;
|
|
using Color = Eigen::Vector3<qreal>;
|
|
VertexAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Color | OpenMesh::Attributes::Status);
|
|
EdgeAttributes(OpenMesh::Attributes::Status);
|
|
HalfedgeAttributes(OpenMesh::Attributes::PrevHalfedge);
|
|
FaceAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status);
|
|
// EdgeAttributes(OpenMesh::Attributes::Color);
|
|
};
|
|
|
|
class MyMesh : public OpenMesh::TriMesh_ArrayKernelT<MyTraits> {
|
|
public:
|
|
Color default_color {.5, .5, .5};
|
|
QMatrix4x4 transform;
|
|
std::vector<std::vector<HalfedgeHandle>> holes;
|
|
};
|
|
|
|
typedef MyMesh::FaceHandle FaceHandle;
|
|
typedef MyMesh::VertexHandle VertexHandle;
|
|
typedef MyMesh::HalfedgeHandle HalfedgeHandle;
|
|
typedef MyMesh::EdgeHandle EdgeHandle;
|
|
typedef MyMesh::Point Point;
|
|
|
|
|
|
#endif
|