My interactive map ended up using two addons (and a third addon just as a dependency):
- ofxCSV (third-party)
- ofxUI (third-party)
- ofxXmlSettings (included addon, dependency of ofxUI)
ofxCSV was necessary to parse the data, and since other students in the class recommended it and had already got it working (and were able to kindly assist in my questions and confusion), it seemed like a good option. I ended up figuring out how to:
- Preprocess the file beforehand (rename to a CSV, delete null rows so the program wouldn’t choke)
- Cast things in openFrameworks (there’s a lot of nice oF syntax that makes certain tasks look way better than they would in C++)
- Choose a data structure to store the hotels (vectors are very convenient!)
…in the process of getting this up and running and able to process my file. So it actually served as a good general introduction to “How to C++ the openFrameworks way”.
I added ofxUI later, so I had to deal with the interesting issue of how to add an existing addon to a project. I couldn’t figure out at first how to do so, and it turns out that in addition to adding a new addon to your addons makefile, you also need to (if developing in Xcode) symbolically add the addon directory to your app’s working directory. ofxXmlSettings was just an ofxUI dependency. After figuring out how to add more addons, using both went fairly simple. ofxUI has the advantage of being very well-maintained and established, so there was no explicit web documentation but a ton of examples that were provided with the addon.
I’m kind of surprised how much of the project was really just wrangling with the addons and figuring out the functionality available to me, but it was pretty instructive. A lot of the work went into the unglamorous parts of “how do I even write this single line of code”, but the addons were fantastically helpful in making a ton of functionality much easier and more accessible to do.