libopencad
cadtables.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 #ifndef CADTABLES_H
32 #define CADTABLES_H
33 
34 #include "cadheader.h"
35 #include "cadlayer.h"
36 
37 class CADFile;
38 
39 using namespace std;
40 
44 class OCAD_EXTERN CADTables
45 {
46 public:
50  enum TableType
51  {
52  CurrentViewportTable,
53  BlocksTable,
54  LayersTable,
55  StyleTable,
56  LineTypesTable,
57  ViewTable,
58  UCSTable,
59  ViewportTable,
60  APPIDTable,
61  EntityTable,
62  ACADGroupDict,
63  ACADMLineStyleDict,
64  NamedObjectsDict,
65  LayoutsDict,
66  PlotSettingsDict,
67  PlotStylesDict,
68  BlockRecordPaperSpace,
69  BlockRecordModelSpace
70  };
71 public:
72  CADTables();
73  void addTable(enum TableType eType, CADHandle hHandle);
74  int readTable(CADFile * const file, enum TableType eType);
75  size_t getLayerCount() const;
76  CADLayer& getLayer(size_t index);
77 
78 protected:
79  int readLayersTable(CADFile * const file, long index);
80  void fillLayer(const CADEntityObject* ent);
81 protected:
82  map<enum TableType, CADHandle> tableMap;
83  vector<CADLayer> layers;
84 };
85 
86 #endif // CADTABLES_H
Definition: cadheader.h:39
Definition: cadlayer.h:40
TableType
The CAD table types enum.
Definition: cadtables.h:50
Definition: cadobjects.h:286
The abstact CAD file class.
Definition: cadfile.h:43
The CAD tables class. Store tables.
Definition: cadtables.h:44