DominoData.h
Go to the documentation of this file.00001 #ifndef _DOMINODATA_H_
00002 #define _DOMINODATA_H_
00003
00004 #include "BrickData.h"
00005
00006 namespace DualCoding {
00007
00008
00009 class DominoData : public BrickData {
00010
00011 public:
00012 DominoData(ShapeSpace& _space, int _lowValue, int _highValue,
00013 const fmat::SubVector<3,const fmat::fmatReal>& _centroid,
00014 const fmat::Column<3> _extents,
00015 const fmat::SubMatrix<3,3,const fmat::fmatReal> &_orient) :
00016 BrickData(_space, _centroid, _extents, _orient), lowValue(_lowValue), highValue(_highValue),
00017 length(2*_extents[0]), width(2*_extents[1]), height(2*_extents[2]), lineColor()
00018 {
00019 type = dominoDataType;
00020 }
00021
00022 DATASTUFF_H(DominoData);
00023
00024 static ShapeType_t getStaticType() { return dominoDataType; }
00025
00026 int getLowValue() const { return lowValue; }
00027 int getHighValue() const { return highValue; }
00028 void setValues(int low, int high) { lowValue=low; highValue=high; }
00029
00030 float getLength() const { return length; }
00031 float getWidth() const { return width; }
00032 float getHeight() const { return height; }
00033
00034 rgb getLineColor() const { return lineColor; }
00035 void setLineColor(rgb _lineColor) { lineColor = _lineColor; }
00036
00037
00038 virtual bool isMatchFor(const ShapeRoot& other) const;
00039
00040 void flipLeftRight();
00041
00042 enum ObjectFeature { none=0, center, lowEnd, highEnd, leftSide, rightSide };
00043
00044
00045 void computeGraspPoint(const ObjectFeature pos,
00046 Point &location,
00047 AngTwoPi &orient) const;
00048
00049
00050 void computeTargetPosition(const ObjectFeature pos,
00051 Point &location,
00052 AngTwoPi &orient) const;
00053
00054 protected:
00055 int lowValue;
00056 int highValue;
00057 float length;
00058 float width;
00059 float height;
00060 rgb lineColor;
00061 };
00062
00063 }
00064
00065 #endif