summaryrefslogtreecommitdiffstats
path: root/FileManager.h
blob: 93c9ec24f5a354f33587237dc19867cca1e2b9c2 (plain)
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
#ifndef FILEMANAGER_H_
#define FILEMANAGER_H_

#include <gtk/gtk.h>
#include <libxml/xmlwriter.h>
#include "Triangle.h"
#include "Vertex3d.h"


class Window;


class FileManager
{
  private:
    Window *window;
    
    gchar *filename;
    bool dirty;
    
    // prevent shallow copy
    FileManager(const FileManager &f);
    const FileManager& operator=(const FileManager &f);
    
    bool writeTriangle(xmlTextWriterPtr writer, const Triangle &triangle, float height);
    bool writeSide(xmlTextWriterPtr writer, const Vertex &v1, const Vertex &v2, float height);
    bool writeVertex(xmlTextWriterPtr writer, float x, float y, float z);
    bool writeTexCoords(xmlTextWriterPtr writer, float s, float t);
    bool writeStart(xmlTextWriterPtr writer, const Vertex3d &start);
    
  public:
    FileManager(Window *window);
    virtual ~FileManager();
    
    bool save(GtkWindow *parent);
    bool saveAs(GtkWindow *parent);
    
    bool write();
};

#endif /*FILEMANAGER_H_*/