4 #include <unordered_map>
25 #ifndef SYMBOL_COLLECTION_H
27 #define SYMBOL_COLLECTION_H
30 namespace datastructure {
43 std::vector<std::shared_ptr<Symbol >> symbols;
51 mutable float domainxmin = -100.0;
52 mutable float domainxmax = 100.0;
53 mutable float domainymin = -100.0;
54 mutable float domainymax = 100.0;
87 return "SymbolCollectionV2";
100 template <
typename T>
102 std::shared_ptr<T> pt = std::make_shared<T>(s);
103 addSymbolPtr ((std::shared_ptr<Symbol>)pt);
112 virtual const string getDataStructureRepresentation()
const override {
114 string symbol_json = string();
115 for (
auto& entry : symbols) {
117 entry->getSymbolRepresentation() +
COMMA;
120 if (symbols.size()) {
121 symbol_json.erase(symbol_json.size() - 1);
125 to_string(domainxmin) +
COMMA + to_string(domainxmax) +
129 to_string(domainymin) +
COMMA + to_string(domainymax) +
This is the superclass of all data structure types in BRIDGES.
Definition: DataStructure.h:74
the ShapeCollection represents a collection of symbols (shapes, polygons, and text) to visualize in B...
Definition: SymbolCollection.h:38
void addSymbol(T s)
Definition: SymbolCollection.h:101
virtual const string getDStype() const override
This method gets the data structure type.
Definition: SymbolCollection.h:86
void setViewport(float xmin, float xmax, float ymin, float ymax)
set the dimensions of the view
Definition: SymbolCollection.h:68
SymbolCollection()
Definition: SymbolCollection.h:78
void addSymbolPtr(std::shared_ptr< Symbol > s)
This method adds a symbol to the collection.
Definition: SymbolCollection.h:96
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