#pragma once #include "config/types.h" #include "modelFactoryMesh_fwd.h" #include #include #include #include #include #include #include struct ModelFactoryTraits : public OpenMesh::DefaultTraits { FaceAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status | OpenMesh::Attributes::Color); EdgeAttributes(OpenMesh::Attributes::Status); VertexAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status); HalfedgeAttributes(OpenMesh::Attributes::TexCoord2D); using Point = RelativePosition3D; using Normal = Normal3D; using Color = RGBA; using TexCoord2D = TextureRelCoord; }; struct ModelFactoryMesh : public OpenMesh::PolyMesh_ArrayKernelT { bool normalsProvidedProperty {}; const OpenMesh::Helpers::Property smoothFaceProperty {this}; const OpenMesh::Helpers::Property materialFaceProperty {this}; const OpenMesh::Helpers::Property nameFaceProperty {this}; const OpenMesh::Helpers::Property nameAdjFaceProperty {this}; template std::pair add_namedFace(std::string name, Vs &&... vs) { const auto handle = add_face(std::forward(vs)...); configNamedFace(name, handle); return {std::move(name), handle}; } private: void configNamedFace(const std::string & name, OpenMesh::FaceHandle); };