Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

GraphicsData.cc

Go to the documentation of this file.
00001 using namespace std;
00002 
00003 #include "Shared/ProjectInterface.h"
00004 
00005 #include "GraphicsData.h"
00006 #include "ShapeSpace.h"
00007 #include "ShapeGraphics.h"
00008 #include "Sketch.h"
00009 
00010 namespace DualCoding {
00011 
00012 GraphicsData::GraphicsData(ShapeSpace  &_space) :
00013   BaseData(_space, getStaticType()), elements() {
00014   mobile = false;
00015   obstacle = false;
00016 }
00017 
00018 GraphicsData::~GraphicsData() {
00019   for (size_t i = 0; i < elements.size(); i++)
00020     delete elements[i];
00021 }
00022 
00023 void GraphicsData::GraphicsElement::setColor(const std::string &colorname) {
00024   color = ProjectInterface::getColorRGB(colorname);
00025 }
00026 
00027 void GraphicsData::add(const GraphicsElement *elt) {
00028   elements.push_back(elt);
00029 }
00030 
00031 void GraphicsData::printParams() const {
00032   std::cout << "GraphicsData[id = " << getId()
00033       << " elements=" << elements.size() << "]" << std::endl;
00034 }
00035 
00036 Sketch<bool>* GraphicsData::render() const {
00037   SketchSpace &SkS = space->getDualSpace();
00038   return new Sketch<bool>(SkS,"render("+getName()+")");
00039 }
00040 
00041 DATASTUFF_CC(GraphicsData);
00042 
00043 
00044 
00045 } // namespace

DualCoding 5.1CVS
Generated Mon May 9 04:56:26 2016 by Doxygen 1.6.3