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 () const
ShapeRoot copy () const
ShapeSpacegetSpace () const
void setSpace (ShapeSpace *_space)
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 void importAdjust ()
 Adjust shape components after the shape has been imported (e.g., used by polygons).
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=true)
bool isLandmark () const
void setLandmark (bool _landmark=true)
void deleteRendering ()
virtual Point getCentroid () const =0
 return the centroid of the shape in point format
virtual Shape< PointDatagetCentroidPtShape () const
virtual void setPosition (const Point &pt)
 Set the position of a shape.
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)
 Assignment 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.
bool landmark
 True if shape should be used as a landmark.
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 32 of file BaseData.cc.

BaseData ( const BaseData otherData  ) 

Copy constructor.

Definition at line 42 of file BaseData.cc.

~BaseData ( void   )  [virtual]

Destructor.

Definition at line 53 of file BaseData.cc.


Member Function Documentation

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

Definition at line 165 of file BaseData.cc.

Referenced by BaseData::copy().

ShapeRoot copy (  )  const

Definition at line 192 of file BaseData.cc.

void decreaseConfidence (  ) 

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 209 of file BaseData.cc.

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

Definition at line 58 of file BaseData.cc.

virtual int getConfidence ( void   )  const [virtual]

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Reimplemented in PolygonData.

Definition at line 107 of file BaseData.h.

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

int getLastMatchId (  )  const

Definition at line 92 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 155 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.

virtual void importAdjust (  )  [virtual]

Adjust shape components after the shape has been imported (e.g., used by polygons).

Reimplemented in PolygonData.

Definition at line 101 of file BaseData.h.

Referenced by ShapeSpace::addShape().

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

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 205 of file BaseData.cc.

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

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 201 of file BaseData.cc.

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

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 194 of file BaseData.cc.

Referenced by BaseData::increaseConfidence().

void inheritFrom ( const SketchDataRoot parent  ) 

Definition at line 96 of file BaseData.cc.

void inheritFrom ( const ShapeRoot parent  ) 

Definition at line 91 of file BaseData.cc.

void inheritFrom ( const BaseData parent  ) 

Definition at line 86 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, SkeletonData, SphereData, and TargetData.

Definition at line 156 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 162 of file BaseData.h.

bool isLandmark (  )  const

Definition at line 177 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, CrossData, CylinderData, DominoData, EllipseData, GraphicsData, LineData, LocalizationParticleData, MarkerData, NaughtData, PointData, PolygonData, PyramidData, SiftData, SkeletonData, SphereData, and TargetData.

bool isObstacle (  )  const

Definition at line 174 of file BaseData.h.

bool isType ( ShapeType_t  this_type  )  const

Test the shape type.

Definition at line 121 of file BaseData.cc.

Referenced by BaseData::isSameTypeAs().

virtual bool localizeByCamera (  )  const [virtual]

Reimplemented in MarkerData.

Definition at line 172 of file BaseData.h.

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

Definition at line 106 of file BaseData.cc.

BaseData & operator= ( const BaseData other  ) 

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

Definition at line 64 of file BaseData.cc.

virtual void printParams (  )  const [pure virtual]
virtual void projectToGround ( const fmat::Transform camToBase,
const PlaneEquation groundplane 
) [pure virtual]
void setColor ( const unsigned int  color_index  ) 

Color.

Get the color.

Reimplemented in PolygonData.

Definition at line 141 of file BaseData.cc.

void setColor ( const rgb new_color  ) 

Color.

Get the color.

Reimplemented in PolygonData.

Definition at line 135 of file BaseData.cc.

void setColor ( const std::string &  color_name  ) 

Set shape and rendering sketch color.

Reimplemented in PolygonData.

Definition at line 131 of file BaseData.cc.

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

void setConfidence ( const BaseData other  ) 

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 115 of file BaseData.h.

void setLandmark ( bool  _landmark = true  ) 

Definition at line 178 of file BaseData.h.

void setLastMatchId ( int  _lmid  ) 

Definition at line 93 of file BaseData.h.

void setMobile ( bool  mobility  ) 

Mobility.

Definition at line 148 of file BaseData.cc.

void setName ( const std::string &  _name  ) 

Definition at line 96 of file BaseData.h.

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

void setObstacle ( bool  _obstacle = true  ) 

Definition at line 175 of file BaseData.h.

void setParentId ( int  _pid  ) 
void setPosition ( const Point pt  )  [virtual]

Set the position of a shape.

Definition at line 214 of file BaseData.cc.

void setSpace ( ShapeSpace _space  ) 

Definition at line 70 of file BaseData.h.

void setViewable ( bool  _viewable  ) 

Definition at line 79 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 101 of file BaseData.cc.


Friends And Related Function Documentation

friend class ShapeRoot [friend]

Definition at line 30 of file BaseData.h.

Referenced by BaseData::copy().

friend class ShapeSpace [friend]

Reimplemented in CrossData.

Definition at line 31 of file BaseData.h.


Member Data Documentation

bool landmark [protected]

True if shape should be used as a landmark.

Definition at line 49 of file BaseData.h.

Referenced by BaseData::isLandmark(), BaseData::operator=(), and BaseData::setLandmark().

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]

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

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