VTKWriter.hh 1.71 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//=============================================================================
//
//  Implements an IOManager writer module for VTK files
//
//=============================================================================

#ifndef __VTKWRITER_HH__
#define __VTKWRITER_HH__

//=== INCLUDES ================================================================

#include <string>
#include <fstream>

#include <OpenMesh/Core/System/config.h>
#include <OpenMesh/Core/Utils/SingletonT.hh>
#include <OpenMesh/Core/IO/exporter/BaseExporter.hh>
#include <OpenMesh/Core/IO/writer/BaseWriter.hh>

//== NAMESPACES ===============================================================

namespace OpenMesh {
namespace IO {

//=== IMPLEMENTATION ==========================================================

class OPENMESHDLLEXPORT _VTKWriter_ : public BaseWriter
{
public:
    _VTKWriter_();

    std::string get_description() const { return "VTK"; }
    std::string get_extensions()  const { return "vtk"; }

    bool write(const std::string&, BaseExporter&, Options, std::streamsize _precision = 6) const;
    bool write(std::ostream&, BaseExporter&, Options, std::streamsize _precision = 6) const;

    size_t binary_size(BaseExporter&, Options) const { return 0; }
};

//== TYPE DEFINITION ==========================================================

/// Declare the single entity of the OBJ writer
extern _VTKWriter_  __VTKWriterinstance;
OPENMESHDLLEXPORT _VTKWriter_& VTKWriter();

//=============================================================================
} // namespace IO
} // namespace OpenMesh
//=============================================================================
#endif
//=============================================================================