+++ /dev/null
-#ifndef __FILTERDXF1_H__
-#define __FILTERDXF1_H__
-
-#include <fstream>
-
-#include "filterinterface.h"
-//#include "file.h"
-
-/**
- * This format filter class can import and export old DXF files
- * from QCad 1.x.
- *
- * This is legacy code from QCad 1.x.
- *
- * @author Andrew Mustun
- */
-class FilterDXF1 : public FilterInterface
-{
-public:
- FilterDXF1();
- ~FilterDXF1() {}
-
- /**
- * @return RS2::FormatDXF1.
- */
- //RS2::FormatType rtti() {
- // return RS2::FormatDXF1;
- //}
-
- /*
- virtual bool canImport(RS2::FormatType t) {
- return (t==RS2::FormatDXF1);
- }
-
- virtual bool canExport(RS2::FormatType t) {
- return false;
- }*/
-
- virtual bool fileImport(Drawing& g, const QString& file, RS2::FormatType /*type*/);
-
- virtual bool fileExport(Drawing& /*g*/, const QString& /*file*/,
- RS2::FormatType /*type*/) {
- DEBUG->print(Debug::D_WARNING,
- "Exporting of QCad 1.x file not implemented");
- return false;
- }
-
- bool readFromBuffer();
-
- void reset();
- void resetBufP();
-
- void setBufP(int _fBufP);
- int getBufP() {
- return fBufP;
- }
- void delBuffer();
- void dos2unix();
-
- QString getBufLine();
- char* getBufLineCh();
- char* getBuf() {
- return fBuf;
- }
- void setBuf(char* _buf) {
- fBuf=_buf;
- }
- void setFSize(uint _s) {
- fSize=_s;
- }
- void copyBufFrom(const char* _buf);
- bool gotoBufLine(char* _lstr);
- bool gotoBufLineString(char* _lstr);
-
- void replaceBinaryBytesBy(char _c);
- void separateBuf(char _c1=13,
- char _c2=10,
- char _c3=0,
- char _c4=0);
- void removeComment(char _fc='(',
- char _lc=')');
-
- bool readFileInBuffer(char* _name, int _bNum=-1);
- bool readFileInBuffer(int _bNum=-1);
-
- void strDecodeDxfString(QString& str);
- bool mtCompFloat(double _v1, double _v2, double _tol=1.0e-6);
-
-protected:
- /** Pointer to the graphic we currently operate on. */
- Drawing* graphic;
- FILE* fPointer; // File pointer
- char* fBuf; // Filebuffer
- int fBufP; // Filebuffer-Pointer (walks through 'fBuf')
- uint fSize; // Filesize
- bool dosFile; // File is in DOS-format
- int numElements;
- QString name;
- QFile file;
-}
-;
-
-#endif