17 namespace datastructure {
33 string *anchorType =
nullptr,
34 *anchorAlignmentLR =
nullptr,
35 *anchorAlignmentTB =
nullptr;
37 string label_text = string();
46 anchorAlignmentLR(nullptr),
47 anchorAlignmentTB(nullptr) {
49 origin[0] = origin[1] = 0.0f;
54 this->label_text = t.label_text;
55 this->origin[0] = t.origin[0];
56 this->origin[1] = t.origin[1];
57 this->fontSize = t.fontSize;
60 this->anchorType =
new string(*(t.anchorType));
61 if (t.anchorAlignmentTB)
62 this->anchorAlignmentTB =
new string(*(t.anchorAlignmentTB));
63 if (t.anchorAlignmentLR)
64 this->anchorAlignmentLR =
new string(*(t.anchorAlignmentLR));
70 this->label_text = t.label_text;
71 this->origin[0] = t.origin[0];
72 this->origin[1] = t.origin[1];
78 if (anchorAlignmentLR) {
79 delete anchorAlignmentLR;
80 anchorAlignmentLR =
nullptr;
82 if (anchorAlignmentTB) {
83 delete anchorAlignmentTB;
84 anchorAlignmentTB =
nullptr;
87 this->fontSize = t.fontSize;
89 this->anchorType =
new string(*(t.anchorType));
90 if (t.anchorAlignmentTB)
91 this->anchorAlignmentTB =
new string(*(t.anchorAlignmentTB));
92 if (t.anchorAlignmentLR)
93 this->anchorAlignmentLR =
new string(*(t.anchorAlignmentLR));
110 if (anchorAlignmentLR)
111 delete anchorAlignmentLR;
112 if (anchorAlignmentTB)
113 delete anchorAlignmentTB;
180 if (!anchorAlignmentLR)
181 anchorAlignmentLR =
new string;
182 if (!anchorAlignmentTB)
183 anchorAlignmentTB =
new string;
185 *anchorAlignmentLR = typeLR;
186 *anchorAlignmentTB = typeTB;
220 anchorType =
new string;
235 throw "Anchor type not set!";
270 string shape_json = getSymbolAttributeRepresentation();
275 if (anchorAlignmentLR)
279 if (anchorAlignmentTB)
284 to_string(fontSize) +
COMMA;
289 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:31
This is a label object and used for defining text labels as part of the symbol collection.
Definition: Text.h:26
virtual string getShapeType() const override
Definition: Text.h:120
~Text()
Definition: Text.h:107
string getText() const
Get the symbol label.
Definition: Text.h:139
string getAnchorType()
This method gets the label's anchor type.
Definition: Text.h:233
Text & setText(string lbl)
Set the label text.
Definition: Text.h:128
double getFontSize()
This method gets the font size.
Definition: Text.h:259
double getAnchorLocationX()
This method gets the label anchor location.
Definition: Text.h:197
Text & setAnchorAlignment(string typeLR, string typeTB)
Definition: Text.h:179
Text(string l)
Definition: Text.h:103
double getAnchorLocationY()
This method gets the label anchor location.
Definition: Text.h:207
Text()
Definition: Text.h:44
Symbol & setFontSize(double sz)
This method sets the font size.
Definition: Text.h:247
const string getSymbolRepresentation() const override
This method returns the JSON representation of the shape.
Definition: Text.h:268
Text & setAnchorLocation(float locx, float locy)
This method sets the label origin;.
Definition: Text.h:163
Symbol & setAnchorType(string type)
This method sets the label's anchor type.
Definition: Text.h:218
Text & setAnchorLocation(float *loc)
This method sets the label origin;.
Definition: Text.h:149
Text(const Text &t)
Definition: Text.h:52
Support for drawing Bar charts.
Definition: alltypes.h:4
const string COLON
Definition: DataStructure.h:52
const string OPEN_BOX
Definition: DataStructure.h:55
const string COMMA
Definition: DataStructure.h:51
const string CLOSE_BOX
Definition: DataStructure.h:56
const string CLOSE_CURLY
Definition: DataStructure.h:54
const string QUOTE
Definition: DataStructure.h:50