Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

BaseData Class Reference

#include <BaseData.h>

Inheritance diagram for BaseData:

List of all members.


Detailed Description

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

Definition at line 51 of file BaseData.h.

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.

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 BoundingBox 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
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 NEWMAT::Matrix &Tmat, const ReferenceFrameType_t newref=unspecified)=0
 Apply a transformation matrix to the shape.
virtual void projectToGround (const NEWMAT::Matrix &camToBase, const NEWMAT::ColumnVector &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.
Sketch< bool > * rendering_sketch

Friends

class ShapeRoot
class ShapeSpace

Constructor & Destructor Documentation

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

Constructor.

Definition at line 35 of file BaseData.cc.

BaseData ( const BaseData otherData  ) 

Copy constructor.

Definition at line 58 of file BaseData.cc.

~BaseData ( void   )  [virtual]

Destructor.

Definition at line 71 of file BaseData.cc.


Member Function Documentation

virtual BaseData* clone ( void   )  const [pure virtual]

ShapeSpace& getSpace (  )  const [inline]

void setParentId ( int  _pid  )  [inline]

Definition at line 91 of file BaseData.h.

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

void setViewable ( bool  _viewable  )  [inline]

Definition at line 94 of file BaseData.h.

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

void inheritFrom ( const BaseData parent  ) 

Definition at line 102 of file BaseData.cc.

Referenced by BaseData::getCentroidPtShape().

void inheritFrom ( const ShapeRoot parent  ) 

Definition at line 107 of file BaseData.cc.

void inheritFrom ( const SketchDataRoot parent  ) 

Definition at line 112 of file BaseData.cc.

int getLastMatchId (  )  const [inline]

Definition at line 107 of file BaseData.h.

void setLastMatchId ( int  _lmid  )  [inline]

Definition at line 108 of file BaseData.h.

void setName ( const std::string &  _name  )  [inline]

Definition at line 111 of file BaseData.h.

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

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

Definition at line 117 of file BaseData.cc.

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

Definition at line 122 of file BaseData.cc.

virtual BoundingBox getBoundingBox (  )  const [inline, virtual]

Reimplemented in EllipseData, LineData, PointData, PolygonData, and TargetData.

Definition at line 116 of file BaseData.h.

virtual int getConfidence (  )  const [inline, virtual]

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Reimplemented in PolygonData.

Definition at line 120 of file BaseData.h.

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

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

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 182 of file BaseData.cc.

Referenced by BaseData::increaseConfidence().

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

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 188 of file BaseData.cc.

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

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 192 of file BaseData.cc.

void decreaseConfidence (  )  [inline]

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 126 of file BaseData.h.

void setConfidence ( const BaseData other  )  [inline]

Confidence.

returns confidence of Data. Reimpletemnted in PolygonData

Definition at line 127 of file BaseData.h.

virtual ShapeType_t getType (  )  const [pure virtual]

Type.

Get the shape type.

bool isType ( ShapeType_t  this_type  )  const

Test the shape type.

Definition at line 137 of file BaseData.cc.

Referenced by BaseData::isSameTypeAs().

bool isSameTypeAs ( const ShapeRoot other  )  const

void setColor ( const std::string &  color_name  ) 

Set shape and rendering sketch color.

Reimplemented in PolygonData.

Definition at line 147 of file BaseData.cc.

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

void setColor ( const rgb &  new_color  ) 

Color.

Get the color.

Reimplemented in PolygonData.

Definition at line 151 of file BaseData.cc.

void setColor ( const unsigned int  color_index  ) 

Color.

Get the color.

Reimplemented in PolygonData.

Definition at line 157 of file BaseData.cc.

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, BlobData, BrickData, EllipseData, LineData, LocalizationParticleData, PointData, PolygonData, PyramidData, SphereData, and TargetData.

virtual bool isAdmissible (  )  const [inline, 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 BrickData, EllipseData, LineData, PolygonData, PyramidData, SphereData, and TargetData.

Definition at line 168 of file BaseData.h.

virtual bool updateParams ( const ShapeRoot other,
bool  forceUpdate = false 
) [pure virtual]

Update shape parameters after matching to another shape.

Implemented in AgentData, BlobData, BrickData, EllipseData, LineData, LocalizationParticleData, PointData, PolygonData, PyramidData, SphereData, and TargetData.

virtual bool isInside ( const Point  )  const [inline, virtual]

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

Reimplemented in PolygonData, and SphereData.

Definition at line 174 of file BaseData.h.

virtual unsigned short getDimension (  )  const [pure virtual]

bool getMobile (  )  const

void setMobile ( bool  mobility  ) 

Mobility.

Definition at line 164 of file BaseData.cc.

virtual Point getCentroid (  )  const [pure virtual]

return the centroid of the shape in point format

Implemented in AgentData, BlobData, BrickData, EllipseData, LineData, LocalizationParticleData, PointData, PolygonData, PyramidData, SphereData, and TargetData.

Referenced by BaseData::getCentroidPtShape().

Shape< PointData > getCentroidPtShape (  )  const [virtual]

Definition at line 76 of file BaseData.cc.

virtual void printParams (  )  const [pure virtual]

virtual void applyTransform ( const NEWMAT::Matrix &  Tmat,
const ReferenceFrameType_t  newref = unspecified 
) [pure virtual]

Apply a transformation matrix to the shape.

Implemented in AgentData, BlobData, BrickData, EllipseData, LineData, LocalizationParticleData, PointData, PolygonData, PyramidData, SphereData, and TargetData.

virtual void projectToGround ( const NEWMAT::Matrix &  camToBase,
const NEWMAT::ColumnVector &  groundplane 
) [pure virtual]

Project to ground plane using given matrix.

Implemented in AgentData, BlobData, BrickData, EllipseData, LineData, LocalizationParticleData, PointData, PolygonData, PyramidData, SphereData, and TargetData.

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 171 of file BaseData.cc.

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

virtual Sketch<bool>* render (  )  const [private, pure virtual]

BaseData & operator= ( const BaseData other  ) 

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

Definition at line 82 of file BaseData.cc.

Referenced by TargetData::operator=(), PolygonData::operator=(), PointData::operator=(), LocalizationParticleData::operator=(), and LineData::operator=().


Friends And Related Function Documentation

friend class ShapeRoot [friend]

Definition at line 53 of file BaseData.h.

friend class ShapeSpace [friend]

Definition at line 54 of file BaseData.h.


Member Data Documentation

std::string name [protected]

ShapeType_t type [protected]

Definition at line 59 of file BaseData.h.

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

int lastMatchId [protected]

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

Definition at line 62 of file BaseData.h.

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

rgb color_rgb [protected]


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

DualCoding 4.0
Generated Thu Nov 22 00:53:55 2007 by Doxygen 1.5.4