Homepage Demos Overview Downloads Tutorials Reference
Credits

SketchDataRoot.cc

Go to the documentation of this file.
00001 // These have to go in the .cc file because SketchSpace.h circularly depends
00002 // on SketchData.h, so we can't reference members of SketchSpace in the
00003 // SketchDataRoot.h file.
00004 
00005 #include "SketchDataRoot.h"
00006 #include "SketchSpace.h"  // can't include this in SketchDataRoot.h due to circularities
00007 
00008 namespace DualCoding {
00009 
00010 const size_t SketchDataRoot::getWidth() const { return space->getWidth(); }
00011 const size_t SketchDataRoot::getHeight() const { return space->getHeight(); }
00012 const size_t SketchDataRoot::getNumPixels() const { return space->getNumPixels(); }
00013 
00014 void SketchDataRoot::inheritFrom(const SketchDataRoot &parent) {
00015   setParentId(parent.getViewableId());
00016   setColor(parent.getColor());
00017   if ( getType() == sketchBool )
00018     setColorMap(segMap);
00019   else
00020     setColorMap(parent.getColorMap());
00021 }
00022 
00023 void SketchDataRoot::inheritFrom(const ShapeRoot &parent) {
00024   setParentId(parent->getViewableId());
00025   setColor(parent->getColor());
00026 }
00027 
00028 void SketchDataRoot::inheritFrom(const BaseData &parent) {
00029   setParentId(parent.getViewableId());
00030   setColor(parent.getColor());
00031 }
00032 
00033 void SketchDataRoot::V(std::string const &_name) {
00034   setViewable(true);
00035   if ( !_name.empty() ) setName(_name);
00036 }
00037 
00038 void SketchDataRoot::N(std::string const &_name) {
00039   setViewable(false);
00040   if ( !_name.empty() ) setName(_name);
00041 }
00042 
00043 } // namespace

DualCoding 3.0beta
Generated Wed Oct 4 00:01:54 2006 by Doxygen 1.4.7