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);
114 virtual const string getDataStructureRepresentation()
const {
116 string symbol_json = string();
117 for (
auto& entry : symbols) {
119 entry->getSymbolRepresentation() +
COMMA;
122 if (symbols.size()) {
123 symbol_json.erase(symbol_json.size() - 1);
127 to_string(domainxmin) +
COMMA + to_string(domainxmax) +
131 to_string(domainymin) +
COMMA + to_string(domainymax) +
This is the superclass of all data structure types in BRIDGES.
Definition: DataStructure.h:73
virtual const string getDStype() const
This method gets the data structure type.
Definition: SymbolCollection.h:86
const string COLON
Definition: DataStructure.h:51
void addSymbolPtr(std::shared_ptr< Symbol > s)
This method adds a symbol to the collection.
Definition: SymbolCollection.h:96
const string OPEN_BOX
Definition: DataStructure.h:54
const string CLOSE_CURLY
Definition: DataStructure.h:53
void addSymbol(T s)
Definition: SymbolCollection.h:101
SymbolCollection()
Definition: SymbolCollection.h:78
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 CLOSE_BOX
Definition: DataStructure.h:55
void setViewport(float xmin, float xmax, float ymin, float ymax)
set the dimensions of the view
Definition: SymbolCollection.h:68
the ShapeCollection represents a collection of symbols (shapes, polygons, and text) to visualize in B...
Definition: SymbolCollection.h:38
const string COMMA
Definition: DataStructure.h:50
const string QUOTE
Definition: DataStructure.h:49