support now face coords for OM reader/writer

This commit is contained in:
Alexandra Heuschling
2021-01-13 14:15:08 +01:00
parent bdd10562d2
commit 74132eff65
5 changed files with 62 additions and 3 deletions

View File

@@ -152,6 +152,9 @@ public:
// set incident face handle for given halfedge
virtual void set_face(HalfedgeHandle _heh, FaceHandle _fh) = 0;
// request texture coordinate property
virtual void request_face_texcoords2D() = 0;
// set vertex texture coordinate
virtual void set_texcoord(HalfedgeHandle _heh, const Vec2f& _texcoord) = 0;

View File

@@ -285,9 +285,14 @@ public:
mesh_.set_face_handle(_heh, _fh);
}
virtual void request_face_texcoords2D() override
{
if(!mesh_.has_halfedge_texcoords2D())
mesh_.request_halfedge_texcoords2D();
}
virtual void set_texcoord(HalfedgeHandle _heh, const Vec2f& _texcoord) override
{
{
if (mesh_.has_halfedge_texcoords2D())
mesh_.set_texcoord2D(_heh, vector_cast<TexCoord2D>(_texcoord));
}