Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BaseData Class Reference

Base class that all shape data classes inherit from, e.g., LineData, BlobData, etc. More...

#include <BaseData.h>

Inheritance diagram for BaseData:

Detailed Description

Base class that all shape data classes inherit from, e.g., LineData, BlobData, etc.

Definition at line 28 of file BaseData.h.

List of all members.

Public Member Functions

 BaseData (ShapeSpace &_space, ShapeType_t typeval, int _parentId=0)
 Constructor.
 BaseData (const BaseData &otherData)
 Copy constructor.
virtual ~BaseData (void)
 Destructor.
virtual BaseDataclone (void) const =0
ShapeSpacegetSpace () const
ReferenceFrameType_t getRefFrameType () const
int getId () const
int getParentId () const
void setParentId (int _pid)
bool isViewable () const
void setViewable (bool _viewable)
int getViewableId () const
void inheritFrom (const BaseData &parent)
void inheritFrom (const ShapeRoot &parent)
void inheritFrom (const SketchDataRoot &parent)
int getLastMatchId () const
void setLastMatchId (int _lmid)
const std::string & getName () const
void setName (const std::string &_name)
void V (std::string const &_name="")
void N (std::string const &_name="")
virtual BoundingBox2D getBoundingBox () const
bool isSameColorAs (const ShapeRoot &other) const
 Test if shape colors are the same.
virtual bool isMatchFor (const ShapeRoot &other) const =0
 Shapes match if their coordinates agree. DOES NOT Assume type and color already checked.
virtual bool isAdmissible () const
 Combine two shapes by taking weighted average depending on confidence level.
virtual bool updateParams (const ShapeRoot &other, bool forceUpdate=false)=0
 Update shape parameters after matching to another shape.
virtual bool isInside (const Point &) const
 returns if a point is inside the shape or not. Reimplemented by EllipseData, SphereData, PolygonData
virtual unsigned short getDimension () const =0
virtual bool localizeByCamera () const
bool isObstacle () const
void setObstacle (bool _obstacle)
void deleteRendering ()
virtual Point getCentroid () const =0
 return the centroid of the shape in point format
virtual Shape< PointDatagetCentroidPtShape () const
virtual void printParams () const =0
 Prints information about this shape.
virtual void applyTransform (const fmat::Transform &Tmat, const ReferenceFrameType_t newref=unspecified)=0
 Apply a transformation matrix to the shape.
virtual void projectToGround (const fmat::Transform &camToBase, const PlaneEquation &groundplane)=0
 Project to ground plane using given matrix.
BaseDataoperator= (const BaseData &other)
 Copy operator. Assumes "&other =? this" check is done by the sub class calling this operator.

virtual int getConfidence () const
 Confidence.
void increaseConfidence (int n=1, int maxConfidence=-1)
 Confidence.
void increaseConfidence (const BaseData &other, int maxConfidence=-1)
 Confidence.
void increaseConfidence (const ShapeRoot &other, int maxConfidence=-1)
 Confidence.
void decreaseConfidence ()
 Confidence.
void setConfidence (const BaseData &other)
 Confidence.

virtual ShapeType_t getType () const =0
 Type.
const char * getTypeName () const
 Type.
bool isType (ShapeType_t this_type) const
 Test the shape type.
bool isSameTypeAs (const ShapeRoot &other) const
 Test if shape types are the same.

rgb getColor () const
 Color.
void setColor (const std::string &color_name)
 Set shape and rendering sketch color.
void setColor (const rgb &new_color)
 Color.
void setColor (const unsigned int color_index)
 Color.

bool getMobile () const
 Mobility.
void setMobile (bool mobility)
 Mobility.

Protected Attributes

ShapeSpacespace
std::string name
ShapeType_t type
int id
int parentId
int lastMatchId
 Id of the shape in the preceding space that gave rise to or was matched to this one.
int refcount
bool viewable
rgb color_rgb
int confidence
 Confidence that this shape exists and isn't noise.
bool mobile
 True if this shape can move in the world.
bool obstacle
 True if shape is an obstacle.
Sketch< bool > * rendering_sketch

Friends

class ShapeRoot
class ShapeSpace



Sketch< bool > & getRendering ()
 Update properties of the shape derived from endpoints or other basic parameters.
virtual Sketch< bool > * render () const =0
 Render into a sketch space.

Constructor & Destructor Documentation

BaseData ( ShapeSpace _space,
ShapeType_t  typeval,
int  _parentId = 0 
)

Constructor.

Definition at line 13 of file BaseData.cc.

BaseData ( const BaseData otherData  ) 

Copy constructor.

Definition at line 38 of file BaseData.cc.

~BaseData ( void   )  [virtual]

Destructor.

Definition at line 52 of file BaseData.cc.


Member Function Documentation

virtual void applyTransform ( const fmat::Transform Tmat,
const ReferenceFrameType_t  newref = unspecified 
) [pure virtual]
virtual BaseData* clone ( void   )  const [pure virtual]
void decreaseConfidence (  ) 

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 107 of file BaseData.h.

virtual BoundingBox2D getBoundingBox (  )  const [virtual]

Reimplemented in AprilTagData, BlobData, EllipseData, LineData, PointData, PolygonData, SiftData, and TargetData.

Definition at line 97 of file BaseData.h.

virtual Point getCentroid (  )  const [pure virtual]
Shape< PointData > getCentroidPtShape (  )  const [virtual]

Definition at line 57 of file BaseData.cc.

virtual int getConfidence ( void   )  const [virtual]

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Reimplemented in PolygonData.

Definition at line 101 of file BaseData.h.

Referenced by BaseData::increaseConfidence(), BaseData::setConfidence(), and AgentData::updateParams().

virtual unsigned short getDimension (  )  const [pure virtual]
int getLastMatchId (  )  const

Definition at line 88 of file BaseData.h.

bool getMobile (  )  const
Sketch< bool > & getRendering (  ) 

Update properties of the shape derived from endpoints or other basic parameters.

Rendering. Returns a pointer to the rendering associated with the ShapeRoot object. If no such rendering exists, it is created.

Reimplemented in LineData.

Definition at line 153 of file BaseData.cc.

Referenced by BrickData::extractBrick(), PyramidData::extractPyramid(), BlobData::findCornersDerivative(), BlobData::findCornersDiagonal(), and BlobData::findCornersShapeFit().

virtual ShapeType_t getType (  )  const [pure virtual]

Type.

Get the shape type.

void increaseConfidence ( const ShapeRoot other,
int  maxConfidence = -1 
)

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 174 of file BaseData.cc.

void increaseConfidence ( const BaseData other,
int  maxConfidence = -1 
)

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 170 of file BaseData.cc.

void increaseConfidence ( int  n = 1,
int  maxConfidence = -1 
)

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 164 of file BaseData.cc.

Referenced by BaseData::increaseConfidence().

void inheritFrom ( const SketchDataRoot parent  ) 

Definition at line 94 of file BaseData.cc.

void inheritFrom ( const ShapeRoot parent  ) 

Definition at line 89 of file BaseData.cc.

void inheritFrom ( const BaseData parent  ) 

Definition at line 84 of file BaseData.cc.

Referenced by BaseData::getCentroidPtShape().

virtual bool isAdmissible (  )  const [virtual]

Combine two shapes by taking weighted average depending on confidence level.

Shapes are admissible to the local map if they're large enough not to be noise.

Reimplemented in AprilTagData, BrickData, EllipseData, LineData, PolygonData, PyramidData, SiftData, SphereData, and TargetData.

Definition at line 149 of file BaseData.h.

virtual bool isInside ( const Point  )  const [virtual]

returns if a point is inside the shape or not. Reimplemented by EllipseData, SphereData, PolygonData

Reimplemented in PolygonData, and SphereData.

Definition at line 155 of file BaseData.h.

virtual bool isMatchFor ( const ShapeRoot other  )  const [pure virtual]

Shapes match if their coordinates agree. DOES NOT Assume type and color already checked.

Implemented in AgentData, AprilTagData, BlobData, BrickData, CylinderData, EllipseData, GraphicsData, LineData, LocalizationParticleData, MarkerData, PointData, PolygonData, PyramidData, SiftData, SphereData, and TargetData.

bool isObstacle (  )  const

Definition at line 167 of file BaseData.h.

bool isType ( ShapeType_t  this_type  )  const

Test the shape type.

Definition at line 119 of file BaseData.cc.

Referenced by BaseData::isSameTypeAs().

virtual bool localizeByCamera (  )  const [virtual]

Reimplemented in MarkerData.

Definition at line 165 of file BaseData.h.

void N ( std::string const &  _name = ""  ) 

Definition at line 104 of file BaseData.cc.

BaseData & operator= ( const BaseData other  ) 

Copy operator. Assumes "&other =? this" check is done by the sub class calling this operator.

Definition at line 63 of file BaseData.cc.

virtual void printParams (  )  const [pure virtual]
virtual void projectToGround ( const fmat::Transform camToBase,
const PlaneEquation groundplane 
) [pure virtual]
virtual Sketch<bool>* render (  )  const [private, pure virtual]
void setColor ( const unsigned int  color_index  ) 

Color.

Get the color.

Reimplemented in PolygonData.

Definition at line 139 of file BaseData.cc.

void setColor ( const rgb new_color  ) 

Color.

Get the color.

Reimplemented in PolygonData.

Definition at line 133 of file BaseData.cc.

void setColor ( const std::string &  color_name  ) 

Set shape and rendering sketch color.

Reimplemented in PolygonData.

Definition at line 129 of file BaseData.cc.

Referenced by BlobData::BlobData(), BaseData::inheritFrom(), MarkerData::MarkerData(), and BaseData::setColor().

void setConfidence ( const BaseData other  ) 

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 108 of file BaseData.h.

void setLastMatchId ( int  _lmid  ) 

Definition at line 89 of file BaseData.h.

void setMobile ( bool  mobility  ) 

Mobility.

Definition at line 146 of file BaseData.cc.

void setName ( const std::string &  _name  ) 

Definition at line 92 of file BaseData.h.

Referenced by BaseData::N(), and BaseData::V().

void setObstacle ( bool  _obstacle  ) 

Definition at line 168 of file BaseData.h.

void setParentId ( int  _pid  ) 

Definition at line 72 of file BaseData.h.

Referenced by BlobData::extractBlobs(), and BaseData::inheritFrom().

void setViewable ( bool  _viewable  ) 

Definition at line 75 of file BaseData.h.

Referenced by BaseData::N(), and BaseData::V().

virtual bool updateParams ( const ShapeRoot other,
bool  forceUpdate = false 
) [pure virtual]
void V ( std::string const &  _name = ""  ) 

Definition at line 99 of file BaseData.cc.


Friends And Related Function Documentation

friend class ShapeRoot [friend]

Definition at line 30 of file BaseData.h.

friend class ShapeSpace [friend]

Definition at line 31 of file BaseData.h.


Member Data Documentation

int lastMatchId [protected]

Id of the shape in the preceding space that gave rise to or was matched to this one.

Definition at line 40 of file BaseData.h.

Referenced by BaseData::getLastMatchId(), ShapeSpace::importShape(), BaseData::operator=(), and BaseData::setLastMatchId().

std::string name [protected]
ShapeType_t type [protected]

Definition at line 37 of file BaseData.h.

Referenced by BaseData::getTypeName(), BaseData::isType(), and BaseData::operator=().

bool viewable [protected]

The documentation for this class was generated from the following files:

DualCoding 5.1CVS
Generated Fri Mar 16 05:23:51 2012 by Doxygen 1.6.3