Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KoduObject.cc

Go to the documentation of this file.
00001 #include "Kodu/Objects/KoduObject.h"
00002 
00003 namespace Kodu {
00004 
00005     // constructor
00006     KoduObject::KoduObject(const std::string& kColor, const std::string& kType,
00007         SearchLocation_t locationsToSearch, bool canBeLandmark)
00008       : color(kColor),
00009         type(kType),
00010         searchLocations(locationsToSearch),
00011         objectIsLandmark(canBeLandmark),
00012         matchingObject(),
00013         matchingObjTag()
00014     { }
00015 
00016     // copy constructor
00017     KoduObject::KoduObject(const KoduObject& kObject)
00018       : color(kObject.color),
00019         type(kObject.type),
00020         searchLocations(kObject.searchLocations),
00021         objectIsLandmark(kObject.objectIsLandmark),
00022         matchingObject(kObject.matchingObject),
00023         matchingObjTag(kObject.matchingObjTag)
00024     { }
00025 
00026     // destructor
00027     KoduObject::~KoduObject() {
00028         // no explicit implementation
00029     }
00030 
00031     // assignment operator
00032     KoduObject& KoduObject::operator=(const KoduObject& kObject) {
00033         if (this != &kObject) {
00034             color = kObject.color;
00035             type = kObject.type;
00036             searchLocations = kObject.searchLocations;
00037             objectIsLandmark = kObject.objectIsLandmark;
00038             matchingObject = kObject.matchingObject;
00039             matchingObjTag = kObject.matchingObjTag;
00040         }
00041         return *this;
00042     }
00043 
00044     const std::string& KoduObject::getColor() const {
00045         return color;
00046     }
00047 
00048     const std::string& KoduObject::getType() const {
00049         return type;
00050     }
00051 
00052     bool KoduObject::isLandmark() const {
00053         return objectIsLandmark;
00054     }
00055 
00056     bool KoduObject::isMovable() const {
00057         // landmark objects should not be movable
00058         //return (!isLandmark());
00059         return false;
00060     }
00061 
00062     bool KoduObject::foundValidMatch() const {
00063         return matchingObject.isValid();
00064     }
00065 
00066     const DualCoding::ShapeRoot& KoduObject::getObject() const {
00067         return matchingObject;
00068     }
00069 
00070     const DualCoding::Shape<DualCoding::AprilTagData>& KoduObject::getObjectIdentifier() const {
00071         return matchingObjTag;
00072     }
00073 
00074     void KoduObject::setObject(const DualCoding::ShapeRoot& kShape) {
00075         matchingObject = kShape;
00076     }
00077 
00078     void KoduObject::setObjectIdentifier(const DualCoding::Shape<DualCoding::AprilTagData>& kIdentifier) {
00079         matchingObjTag = kIdentifier;
00080     }
00081 }

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:43 2016 by Doxygen 1.6.3