00001 00013 #ifndef __XPM_WRITER_H__ 00014 #define __XPM_WRITER_H__ 00015 00016 #include <writer/writer.h> 00017 #include <octree/index_oct.h> 00018 00019 #include <fstream> 00020 00025 class XpmWriter : public Writer { 00026 public: 00031 XpmWriter(const char* fileName); 00032 00036 virtual ~XpmWriter(); 00037 00042 virtual const char* getFormatName(); 00043 00048 virtual const FormatType getFormatType(); 00049 00058 void writeFile(IndexOct* tree) 00059 throw (WriteFileException*); 00060 00061 private: 00068 char getColorChar(AxIndex h, AxIndex i[2]); 00069 00076 const char* getFileName(int number); 00077 00084 AxIndex getWidth(); 00085 00090 void write(char colorChar); 00091 00096 void writeFooter(); 00097 00103 void writeHeader(int number); 00104 00108 void writeLineBegin(); 00109 00114 void writeLineEnd(bool isLast); 00115 00116 // ##### Variablen ################################################### 00117 00121 const char* extension; 00122 00126 const char* fileName; 00127 00131 IndexOct* octree; 00132 00136 ofstream out; 00137 00141 Axis sectAxis; 00142 00143 }; 00144 00145 #endif // ! __XPM_WRITER_H__