1 #ifndef __FILTERDXF1_H__
2 #define __FILTERDXF1_H__
6 #include "filterinterface.h"
10 * This format filter class can import and export old DXF files
13 * This is legacy code from QCad 1.x.
15 * @author Andrew Mustun
17 class FilterDXF1 : public FilterInterface
24 * @return RS2::FormatDXF1.
26 //RS2::FormatType rtti() {
27 // return RS2::FormatDXF1;
31 virtual bool canImport(RS2::FormatType t) {
32 return (t==RS2::FormatDXF1);
35 virtual bool canExport(RS2::FormatType t) {
39 virtual bool fileImport(Drawing& g, const QString& file, RS2::FormatType /*type*/);
41 virtual bool fileExport(Drawing& /*g*/, const QString& /*file*/,
42 RS2::FormatType /*type*/) {
43 DEBUG->print(Debug::D_WARNING,
44 "Exporting of QCad 1.x file not implemented");
48 bool readFromBuffer();
53 void setBufP(int _fBufP);
65 void setBuf(char* _buf) {
68 void setFSize(uint _s) {
71 void copyBufFrom(const char* _buf);
72 bool gotoBufLine(char* _lstr);
73 bool gotoBufLineString(char* _lstr);
75 void replaceBinaryBytesBy(char _c);
76 void separateBuf(char _c1=13,
80 void removeComment(char _fc='(',
83 bool readFileInBuffer(char* _name, int _bNum=-1);
84 bool readFileInBuffer(int _bNum=-1);
86 void strDecodeDxfString(QString& str);
87 bool mtCompFloat(double _v1, double _v2, double _tol=1.0e-6);
90 /** Pointer to the graphic we currently operate on. */
92 FILE* fPointer; // File pointer
93 char* fBuf; // Filebuffer
94 int fBufP; // Filebuffer-Pointer (walks through 'fBuf')
95 uint fSize; // Filesize
96 bool dosFile; // File is in DOS-format