19 namespace datastructure {
35 string *anchorType =
nullptr,
36 *anchorAlignmentLR =
nullptr,
37 *anchorAlignmentTB =
nullptr;
39 string label_text = string();
48 anchorAlignmentLR(nullptr),
49 anchorAlignmentTB(nullptr) {
51 origin[0] = origin[1] = 0.0f;
56 this->label_text = t.label_text;
57 this->origin[0] = t.origin[0];
58 this->origin[1] = t.origin[1];
59 this->fontSize = t.fontSize;
62 this->anchorType =
new string(*(t.anchorType));
63 if (t.anchorAlignmentTB)
64 this->anchorAlignmentTB =
new string(*(t.anchorAlignmentTB));
65 if (t.anchorAlignmentLR)
66 this->anchorAlignmentLR =
new string(*(t.anchorAlignmentLR));
72 this->label_text = t.label_text;
73 this->origin[0] = t.origin[0];
74 this->origin[1] = t.origin[1];
80 if (anchorAlignmentLR) {
81 delete anchorAlignmentLR;
82 anchorAlignmentLR =
nullptr;
84 if (anchorAlignmentTB) {
85 delete anchorAlignmentTB;
86 anchorAlignmentTB =
nullptr;
89 this->fontSize = t.fontSize;
91 this->anchorType =
new string(*(t.anchorType));
92 if (t.anchorAlignmentTB)
93 this->anchorAlignmentTB =
new string(*(t.anchorAlignmentTB));
94 if (t.anchorAlignmentLR)
95 this->anchorAlignmentLR =
new string(*(t.anchorAlignmentLR));
112 if (anchorAlignmentLR)
113 delete anchorAlignmentLR;
114 if (anchorAlignmentTB)
115 delete anchorAlignmentTB;
182 if (!anchorAlignmentLR)
183 anchorAlignmentLR =
new string;
184 if (!anchorAlignmentTB)
185 anchorAlignmentTB =
new string;
188 *anchorAlignmentLR = typeLR;
189 *anchorAlignmentTB = typeTB;
223 anchorType =
new string;
238 throw "Anchor type not set!";
274 string shape_json = getSymbolAttributeRepresentation();
279 if (anchorAlignmentLR)
283 if (anchorAlignmentTB)
288 to_string(fontSize) +
COMMA;
293 to_string(origin[0]) +
COMMA + to_string(origin[1]) +
This is an abstract class for deriving a number of Symbol shape objects, for use in a SymbolCollectio...
Definition: Symbol.h:32
This is a label object and used for defining text labels as part of the symbol collection.
Definition: Text.h:28
virtual string getShapeType() const override
Definition: Text.h:122
~Text()
Definition: Text.h:109
string getText() const
Get the symbol label.
Definition: Text.h:141
string getAnchorType()
This method gets the label's anchor type.
Definition: Text.h:236
Text & setText(string lbl)
Set the label text.
Definition: Text.h:130
double getFontSize()
This method gets the font size.
Definition: Text.h:262
double getAnchorLocationX()
This method gets the label anchor location.
Definition: Text.h:200
Text & setAnchorAlignment(string typeLR, string typeTB)
Definition: Text.h:181
Text(string l)
Definition: Text.h:105
double getAnchorLocationY()
This method gets the label anchor location.
Definition: Text.h:210
Text()
Definition: Text.h:46
Symbol & setFontSize(double sz)
This method sets the font size.
Definition: Text.h:250
const string getSymbolRepresentation() const override
This method returns the JSON representation of the shape.
Definition: Text.h:272
Text & setAnchorLocation(float locx, float locy)
This method sets the label origin;.
Definition: Text.h:165
Symbol & setAnchorType(string type)
This method sets the label's anchor type.
Definition: Text.h:221
Text & setAnchorLocation(float *loc)
This method sets the label origin;.
Definition: Text.h:151
Text(const Text &t)
Definition: Text.h:54
these methods convert byte arrays in to base64 codes and are used in BRIDGES to represent the color a...
Definition: alltypes.h:4
const string COLON
Definition: DataStructure.h:51
const string OPEN_BOX
Definition: DataStructure.h:54
const string COMMA
Definition: DataStructure.h:50
const string CLOSE_BOX
Definition: DataStructure.h:55
const string CLOSE_CURLY
Definition: DataStructure.h:53
const string QUOTE
Definition: DataStructure.h:49