# class cogs::Exporter

## Overview

Universal file exporter for COGS structures. More…

    #include <Exporter.h>

    class Exporter {
    public:
        // construction

        Exporter();
        Exporter(const Exporter& other);
        Exporter(const Exporter&& other);
        ~Exporter();

        // methods

        Exporter& operator=(const Exporter& other);
        Exporter& operator=(const Exporter&& other);
        bool SaveToFile(const std::string& filename) const;
        void Clear();
        void AddPointCloud(const cogs::PointCloud& pointcloud);
        void AddScan(const cogs::Scan& scan);
        void AddMesh(const cogs::Mesh& mesh);
    };

## Detailed Documentation

Universal file exporter for COGS structures.

Supports all COGS file extensions which can be found in cogs-file-format-extensions.

Internally uses Assimp library which supports common data formats found in http://assimp.sourceforge.net/main_features_formats.html. However, compatibility is not guaranteed for all file formats.

Assimp export was tested on the following file formats:

- Stanford Triangle Format (.ply)

- Wavefront (.obj)

- Stereo lithography (.stl)

### Methods

    bool SaveToFile(const std::string& filename) const

Saves all currently added data to a single file. Returns whether everything was saved successfully.

    void Clear()

Removes all previously added data from exporter.

    void AddPointCloud(const cogs::PointCloud& pointcloud)

Adds an object to the list of exported objects.

    void AddScan(const cogs::Scan& scan)

Adds an object to the list of exported objects.

    void AddMesh(const cogs::Mesh& mesh)

Adds an object to the list of exported objects.