1 /******************************************************************************
2 **  libDXFrw - Library to read/write DXF files (ascii & binary)              **
3 **                                                                           **
4 **  Copyright (C) 2011-2015 José F. Soriano, rallazz@gmail.com               **
5 **                                                                           **
6 **  This library is free software, licensed under the terms of the GNU       **
7 **  General Public License as published by the Free Software Foundation,     **
8 **  either version 2 of the License, or (at your option) any later version.  **
9 **  You should have received a copy of the GNU General Public License        **
10 **  along with this program.  If not, see <http://www.gnu.org/licenses/>.    **
11 ******************************************************************************/
12 
13 #ifndef DRW_CLASSES_H
14 #define DRW_CLASSES_H
15 
16 
17 #include "drw_base.h"
18 //#include "libdwgr.h"
19 
20 class dxfReader;
21 class dxfWriter;
22 class dwgBuffer;
23 
24 /** Class to handle classes table entries
25  *  TODO: verify the dxf read/write part
26  *  @author Rallaz
27  */
28 class DRW_Class
29 {
30   public:
DRW_Class()31     DRW_Class()
32       : proxyFlag( 0 )
33       , instanceCount( 0 )
34       , wasaProxyFlag( 0 )
35       , entityFlag( 0 )
36       , classNum( 0 )
37       , dwgType( 0 )
38     {
39     }
~DRW_Class()40     ~DRW_Class()
41     {
42     }
43 
44     void parseCode( int code, dxfReader *reader );
45     void write( dxfWriter *writer, DRW::Version ver );
46     bool parseDwg( DRW::Version version, dwgBuffer *buf, dwgBuffer *strBuf );
47 
48   private:
49     void toDwgType();
50   public:
51     UTF8STRING recName;      //!< Record name, code 1
52     UTF8STRING className;    //!< C++ class name, code 2
53     UTF8STRING appName;      //!< App name, code 3
54     int proxyFlag;           //!< Proxy capabilities flag, code 90
55     int instanceCount;       //!< Number of instances for a custom class, code 91
56     int wasaProxyFlag;       //!< Proxy flag (app loaded on save), code 280
57     int entityFlag;          //!< Entity flag, code 281 (0 object, 1 entity)
58   public: //only for read dwg
59     duint16 classNum;
60     int dwgType;
61 };
62 
63 #endif
64 
65 // EOF
66