libopencad
cadlayer.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 CADLAYER_H
32 #define CADLAYER_H
33 
34 #include "cadgeometry.h"
35 
36 class CADFile;
37 
38 using namespace std;
39 
40 class OCAD_EXTERN CADLayer
41 {
42 public:
43  CADLayer(CADFile * const file);
44  string getName() const;
45  void setName(const string &value);
46 
47  bool getFrozen() const;
48  void setFrozen(bool value);
49 
50  bool getOn() const;
51  void setOn(bool value);
52 
53  bool getFrozenByDefault() const;
54  void setFrozenByDefault(bool value);
55 
56  bool getLocked() const;
57  void setLocked(bool value);
58 
59  bool getPlotting() const;
60  void setPlotting(bool value);
61 
62  short getLineWeight() const;
63  void setLineWeight(short value);
64 
65  short getColor() const;
66  void setColor(short value);
67 
68  size_t getId() const;
69  void setId(const size_t &value);
70 
71  long getHandle() const;
72  void setHandle(long value);
73 
74  void addHandle(long handle, enum CADObject::ObjectType type);
75 
76  size_t getGeometryCount () const;
77  CADGeometry* getGeometry(size_t index);
78 
79 protected:
80  string layerName;
81  bool frozen;
82  bool on;
83  bool frozenByDefault;
84  bool locked;
85  bool plotting;
86  short lineWeight;
87  short color;
88  size_t layerId;
89  long handle;
90  short geometryType; // if all geometry is same type set this type or -1
91 
92  vector<long> geometryHandles;
93  vector< pair< long, map< string, long > > > geometryAttributes;
94 
95  CADFile * const pCADFile;
96 };
97 
98 #endif // CADLAYER_H
Base CAD geometry class.
Definition: cadgeometry.h:46
Definition: cadlayer.h:40
The abstact CAD file class.
Definition: cadfile.h:43