4 #include <unordered_map> 25 #ifndef SYMBOL_COLLECTION_H 27 #define SYMBOL_COLLECTION_H 30 namespace datastructure {
43 unordered_map<int, Symbol*> symbols;
51 mutable float domainxmin = 0.0;
52 mutable float domainxmax = 100.0;
53 mutable float domainymin = 0.0;
54 mutable float domainymax = 100.0;
55 bool autoscaledomain =
false;
61 autoscaledomain =
false;
79 return "SymbolCollection";
101 void updateAxisDomains(
const Symbol* s)
const {
105 if (dims[0] < domainxmin) {
106 domainxmin = dims[0];
108 if (dims[1] > domainxmax) {
109 domainxmax = dims[1];
113 if (dims[2] < domainymin) {
114 domainymin = dims[2];
116 if (dims[3] > domainymax) {
117 domainymax = dims[3];
132 virtual const string getDataStructureRepresentation()
const {
135 for (
auto& entry : symbols)
136 updateAxisDomains(entry.second);
139 string symbol_json = string();
140 for (
auto& entry : symbols) {
142 entry.second->getSymbolRepresentation() +
COMMA;
145 if (symbols.size()) {
146 symbol_json.erase(symbol_json.size() - 1);
150 to_string(domainxmin) +
COMMA + to_string(domainxmax) +
154 to_string(domainymin) +
COMMA + to_string(domainymax) +
void addSymbol(Symbol *s)
This method adds a symbol to the collection.
Definition: SymbolCollection.h:87
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:78
const string COLON
Definition: DataStructure.h:51
const string OPEN_BOX
Definition: DataStructure.h:54
const string CLOSE_CURLY
Definition: DataStructure.h:53
This is an abstract class for deriving a number of Symbol shape objects, for use in a SymbolCollectio...
Definition: Symbol.h:32
SymbolCollection()
Definition: SymbolCollection.h:70
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)
Definition: SymbolCollection.h:59
the ShapeCollection represents a collection of symbols (shapes, polygons, and text) to visualize in B...
Definition: SymbolCollection.h:38
virtual vector< float > getDimensions() const =0
const string COMMA
Definition: DataStructure.h:50
const string QUOTE
Definition: DataStructure.h:49
int getIdentifier()
Definition: Symbol.h:122