| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <memory> |
| 4 |
#include "inode.h" |
| 5 |
#include "imapformat.h" |
| 6 |
|
| 7 |
namespace map |
| 8 |
{ |
| 9 |
|
| 10 |
/** |
| 11 |
* Exporter class used to serialise a map to an output stream. |
| 12 |
* Use the given exportMap() method to write a scene to the |
| 13 |
* attached stream. For scene traversal the given functor |
| 14 |
* is used to allow for custom filtering of the scene nodes. |
| 15 |
* |
| 16 |
* Use GlobalMapModule().createMapExporter() to acquire an |
| 17 |
* instance of IMapExporter. |
| 18 |
* |
| 19 |
* Note: This is a scoped object by design, which will prepare |
| 20 |
* the scene during construction and clean it up on destruction. |
| 21 |
*/ |
| 22 |
class IMapExporter |
| 23 |
{ |
| 24 |
public: |
| 25 |
using Ptr = std::shared_ptr<IMapExporter>; |
| 26 |
|
| 27 |
virtual ~IMapExporter() {} |
| 28 |
|
| 29 |
// Export the scene below the given root node using the given traversal function |
| 30 |
virtual void exportMap(const scene::INodePtr& root, const GraphTraversalFunc& traverse) = 0; |
| 31 |
}; |
| 32 |
|
| 33 |
} |