LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
layer.cpp
Go to the documentation of this file.
1 #include "layer.h"
3 #include <cassert>
4 
5 using namespace lc;
6 
8 }
9 
10 Layer::Layer(const std::string name, const MetaLineWidthByValue lineWidth, const Color color) :
13  _name(name),
14  _lineWidth(lineWidth),
15  _color(color),
16  _linepattern(nullptr),
17  _isFrozen(false) {
18  assert(!StringHelper::isBlank(name) && "Name cannot be blank");
19 }
20 
21 Layer::Layer(const std::string name,
22  const MetaLineWidthByValue lineWidth,
23  const Color color,
24  DxfLinePatternByValue_CSPtr linepattern,
25  const bool frozen) :
28  _name(name),
29  _lineWidth(lineWidth),
30  _color(color),
31  _linepattern(linepattern),
32  _isFrozen(frozen) {
33  assert(!StringHelper::isBlank(name) && "Name cannot be blank");
34 }
35 
36 Layer::Layer(const std::string name, const MetaLineWidthByValue lineWidth) :
39  _name(name),
40  _lineWidth(lineWidth),
41  _linepattern(nullptr),
42  _isFrozen(false) {
43  assert(!StringHelper::isBlank(name) && "Name cannot be blank");
44 }
45 
46 Layer::Layer(const std::string name, const Color color) :
49  _name(name),
50  _color(color),
51  _linepattern(nullptr),
52  _isFrozen(false) {
53  assert(!StringHelper::isBlank(name) && "Name cannot be blank"); // Name must be set
54 }
55 
59  _name(builder.name()),
60  _lineWidth(builder.lineWidth()),
61  _color(builder.color()),
62  _linepattern(builder.linePattern()),
63  _isFrozen(builder.isFrozen()) {
64 }
65 
67  return _color;
68 }
70  return _lineWidth;
71 }
72 
73 DxfLinePatternByValue_CSPtr Layer::linePattern() const {
74  return _linepattern;
75 }
76 
77 bool Layer::isFrozen() const {
78  return _isFrozen;
79 }
80 
81 const std::string Layer::name() const {
82  return _name;
83 }
84 
DxfLinePatternByValue_CSPtr _linepattern
Definition: layer.h:58
bool _isFrozen
Definition: layer.h:59
MetaLineWidthByValue lineWidth() const
Definition: layer.cpp:69
Color color() const
Definition: layer.cpp:66
Color _color
Definition: layer.h:57
Definition: cadentity.h:12
virtual const std::string name() const
Definition: layer.cpp:81
Layer()
Definition: layer.cpp:7
MetaLineWidthByValue _lineWidth
Definition: layer.h:56
std::string _name
Definition: layer.h:55
bool isFrozen() const
Definition: layer.cpp:77
DxfLinePatternByValue_CSPtr linePattern() const
Definition: layer.cpp:73
static bool isBlank(const std::string str)
Definition: string_helper.h:49