libopencad
opencad_api.h
1 /*******************************************************************************
2  * Project: libopencad
3  * Purpose: OpenSource CAD formats support library
4  * Author: Alexandr Borzykh, mush3d at gmail.com
5  * Author: Dmitry Baryshnikov, bishop.dev@gmail.com
6  * Language: C++
7  *******************************************************************************
8  * The MIT License (MIT)
9  *
10  * Copyright (c) 2016 Alexandr Borzykh
11  * Copyright (c) 2016 NextGIS, <info@nextgis.com>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a copy
14  * of this software and associated documentation files (the "Software"), to deal
15  * in the Software without restriction, including without limitation the rights
16  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17  * copies of the Software, and to permit persons to whom the Software is
18  * furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in all
21  * copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29  * SOFTWARE.
30  *******************************************************************************/
31 
32 #ifndef OPENCAD_API_H
33 #define OPENCAD_API_H
34 
35 #include "cadfile.h"
36 
37 enum CADVersions
38 {
39  DWG_R13 = 1012,
40  DWG_R14 = 1014,
41  DWG_R2000 = 1015,
42  DWG_R2004 = 1018,
43  DWG_R2007 = 1021,
44  DWG_R2010 = 1024,
45  DWG_R2013 = 1027,
46  DXF_UNDEF = -1000,
47  DXF_R13 = -DWG_R13,
48  DXF_R14 = -DWG_R14,
49  DXF_R2000 = -DWG_R2000,
50  DXF_R2004 = -DWG_R2004,
51  DXF_R2007 = -DWG_R2007,
52  DXF_R2010 = -DWG_R2010,
53  DXF_R2013 = -DWG_R2013
54 };
55 
56 enum CADErrorCodes
57 {
58  SUCCESS = 0,
59  FILE_OPEN_FAILED,
60  UNSUPPORTED_VERSION,
61  FILE_PARSE_FAILED,
62  SECTION_LOCATOR_READ_FAILED,
63  HEADER_SECTION_READ_FAILED,
64  CLASSES_SECTION_READ_FAILED,
65  TABLES_SECTION_READ_FAILED,
66  BLOCKS_SECTION_READ_FAILED,
67  ENTITIES_SECTION_READ_FAILED,
68  OBJECTS_SECTION_READ_FAILED,
69  THUMBNAILIMAGE_SECTION_READ_FAILED,
70  TABLE_READ_FAILED,
71  VALUE_EXISTS
72 };
73 
74 
75 OCAD_EXTERN int GetVersion();
76 OCAD_EXTERN const char* GetVersionString();
77 OCAD_EXTERN CADFile* OpenCADFile( CADFileIO* pCADFileIO, enum CADFile::OpenOptions eOptions);
78 OCAD_EXTERN CADFile* OpenCADFile( const char* pszFileName, enum CADFile::OpenOptions eOptions );
79 OCAD_EXTERN int GetLastErrorCode();
80 OCAD_EXTERN CADFileIO* GetDefaultFileIO ( const char *pszFileName );
81 OCAD_EXTERN int IdentifyCADFile( CADFileIO* pCADFileIO );
82 OCAD_EXTERN const char* GetCADFormats();
83 
84 #endif // OPENCAD_API_H
OpenOptions
The CAD file open options enum.
Definition: cadfile.h:51
The CADFileIO class provides in/out file operations as read, write, seek, etc. This is abstract class...
Definition: cadfileio.h:40
The abstact CAD file class.
Definition: cadfile.h:43