# struct cogs::Mesh

## Overview

A Mesh is structure containing a point-cloud a triangulation and a material. Not all of these are required. More…

    #include <Mesh.h>

    struct Mesh {
        // fields

        std::shared_ptr<PointCloud> points;
        std::shared_ptr<Triangulation> faces;
        std::shared_ptr<MaterialModel> material;

        // methods

        bool HasPoints() const;
        bool HasFaces() const;
        bool HasMaterial() const;
        virtual bool Import(const std::string& filename);
        virtual bool Export(const std::string& filename) const;
    };

## Detailed Documentation

A Mesh is structure containing a point-cloud a triangulation and a material. Not all of these are required.

Each of the point-cloud, faces or material may be undefined.

### Methods

    bool HasPoints() const

Returns true when mesh has points assigned - non nullptr.

    bool HasFaces() const

Returns true when mesh has faces assigned - non nullptr.

    bool HasMaterial() const

Returns true when mesh has material assigned - non nullptr.

    virtual bool Import(const std::string& filename)

Import from a file. Return success.

    virtual bool Export(const std::string& filename) const

Import to a file. Create a directory hierarchy if necessary. Return success.