Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

PolygonData Class Reference

#include <PolygonData.h>

Inheritance diagram for PolygonData:

List of all members.


Detailed Description

Definition at line 31 of file PolygonData.h.


Public Member Functions

 DATASTUFF_H (PolygonData)
 PolygonData (const LineData &)
 Constructors.
 PolygonData (ShapeSpace &space, const std::vector< Point > &pts, bool closed, bool end1Valid=true, bool end2Valid=true)
 PolygonData (const std::vector< LineData > &lns)
 PolygonData (const PolygonData &other)
BoundingBox getBoundingBox () const
std::vector< ShapeRootupdateState ()
bool isClosed () const
PolygonDataoperator= (const PolygonData &other)
virtual Point getCentroid () const
 return the centroid of the shape in point format
virtual bool isMatchFor (const ShapeRoot &other) const
 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)
 updates existing edges, but does not importing new edges
virtual int getConfidence () const
 returns minimum confidence of all edges
virtual bool isInside (const Point &pt) const
 returns if a point is inside the shape or not. Reimplemented by EllipseData, SphereData, PolygonData
virtual void printParams () const
 Prints information about this shape.
virtual void applyTransform (const NEWMAT::Matrix &Tmat, const ReferenceFrameType_t newref=unspecified)
 Apply a transformation matrix to the shape.
virtual void projectToGround (const NEWMAT::Matrix &camToBase, const NEWMAT::ColumnVector &groundplane)
 Project to ground plane using given matrix.
virtual void setColor (const rgb &new_color)
 Color.
virtual void setColor (const unsigned int color_index)
 Color.
virtual void setColor (const std::string &color_name)
 Set shape and rendering sketch color.
virtual Sketch< bool > * render () const
 Render into a sketch space.
virtual unsigned short getDimension () const
const LineDataend1Ln () const
 Edge/Vertex Access Functions.
const LineDataend2Ln () const
 returns last edge of this polygon
const EndPointend1Pt () const
 returns end1Pt of end1Ln
const EndPointend2Pt () const
 returns end2Pt of end2Ln
const std::vector< Point > & getVertices () const
 returns all vertices of this polygon
const std::vector< LineData > & getEdges () const
 returns all edges of this polygon
std::vector< LineData > & getEdgesRW ()
 returns address of edge vector for modification

Static Public Member Functions

static ShapeType_t getStaticType ()
static std::vector< Shape
< LineData > > 
extractPolygonEdges (Sketch< bool > const &sketch, Sketch< bool > const &occluder)
static std::vector< ShapeRootformPolygons (const std::vector< LineData > &, std::vector< Shape< PolygonData > > &existing, std::vector< ShapeRoot > &deleted)
static std::vector< ShapeRootformPolygons (const std::vector< LineData > &)
 forms polygons from lines
static Shape< PolygonDataconvexHull (const Sketch< bool > &sketch)
 Convex hull using Graham's scan.

Protected Attributes

std::vector< LineDataedges

Private Member Functions

bool tryClosePolygon ()
bool tryImportNewEndline (const LineData &line, bool useEnd1Pt=true, bool useEnd2Pt=true)
bool tryUpdateEdge (const ShapeRoot &)
bool isMatchForEdge (const LineData &other) const
bool formsNewEndline (const LineData &ln, bool useEnd1Pt=true, bool useEnd2Pt=true) const
void updateVertices ()
 called everytime polygon is changed. updates vertices by finding intersections of adjascent edges

Static Private Member Functions

static bool isFirstLineLonger (const Shape< LineData > &ln1, const Shape< LineData > &ln2)

Private Attributes

std::vector< Pointvertices

Friends

class Shape< PolygonData >

Constructor & Destructor Documentation

PolygonData ( const LineData side  ) 

Constructors.

Definition at line 18 of file PolygonData.cc.

Referenced by PolygonData::convexHull().

PolygonData ( ShapeSpace space,
const std::vector< Point > &  pts,
bool  closed,
bool  end1Valid = true,
bool  end2Valid = true 
)

Definition at line 26 of file PolygonData.cc.

PolygonData ( const std::vector< LineData > &  lns  )  [inline]

Definition at line 47 of file PolygonData.h.

PolygonData ( const PolygonData other  )  [inline]

Definition at line 49 of file PolygonData.h.


Member Function Documentation

static ShapeType_t getStaticType (  )  [inline, static]

Definition at line 38 of file PolygonData.h.

DATASTUFF_H ( PolygonData   ) 

vector< Shape< LineData > > extractPolygonEdges ( Sketch< bool > const &  sketch,
Sketch< bool > const &  occluder 
) [static]

extracts then-edges lines

Definition at line 42 of file PolygonData.cc.

Referenced by MapBuilder::getCamPolygons(), and MapBuilder::getCamWalls().

vector< ShapeRoot > formPolygons ( const std::vector< LineData > &  lines,
std::vector< Shape< PolygonData > > &  existing,
std::vector< ShapeRoot > &  deleted 
) [static]

forms polygons from lines and existing polygons existing polygons may be updated or deleted for which case they are added to deleted vector

Definition at line 93 of file PolygonData.cc.

Referenced by MapBuilder::matchSrcToDst(), and PolygonData::updateState().

vector< ShapeRoot > formPolygons ( const std::vector< LineData > &  lines  )  [static]

forms polygons from lines

Definition at line 66 of file PolygonData.cc.

const LineData& end1Ln (  )  const [inline]

Edge/Vertex Access Functions.

returns first edge of this polygon

Definition at line 61 of file PolygonData.h.

Referenced by PolygonData::isClosed(), PolygonData::tryClosePolygon(), and PolygonData::updateVertices().

const LineData& end2Ln (  )  const [inline]

returns last edge of this polygon

Definition at line 62 of file PolygonData.h.

Referenced by PolygonData::isClosed(), PolygonData::tryClosePolygon(), and PolygonData::updateVertices().

const EndPoint& end1Pt (  )  const [inline]

const EndPoint& end2Pt (  )  const [inline]

const std::vector<Point>& getVertices (  )  const [inline]

returns all vertices of this polygon

Definition at line 65 of file PolygonData.h.

const std::vector<LineData>& getEdges (  )  const [inline]

returns all edges of this polygon

Definition at line 66 of file PolygonData.h.

Referenced by PolygonData::isMatchFor().

std::vector<LineData>& getEdgesRW (  )  [inline]

returns address of edge vector for modification

Definition at line 67 of file PolygonData.h.

BoundingBox getBoundingBox (  )  const [virtual]

Reimplemented from BaseData.

Definition at line 141 of file PolygonData.cc.

vector< ShapeRoot > updateState (  ) 

Definition at line 257 of file PolygonData.cc.

bool isClosed (  )  const

Definition at line 239 of file PolygonData.cc.

Referenced by PolygonData::isInside(), and PolygonData::updateVertices().

Shape< PolygonData > convexHull ( const Sketch< bool > &  sketch  )  [static]

Convex hull using Graham's scan.

Definition at line 536 of file PolygonData.cc.

PolygonData& operator= ( const PolygonData other  )  [inline]

Definition at line 79 of file PolygonData.h.

bool tryClosePolygon (  )  [private]

Definition at line 223 of file PolygonData.cc.

Referenced by PolygonData::PolygonData().

bool tryImportNewEndline ( const LineData line,
bool  useEnd1Pt = true,
bool  useEnd2Pt = true 
) [private]

Definition at line 180 of file PolygonData.cc.

bool tryUpdateEdge ( const ShapeRoot ln  )  [private]

Definition at line 277 of file PolygonData.cc.

Referenced by PolygonData::updateParams().

bool isMatchForEdge ( const LineData other  )  const [private]

Definition at line 247 of file PolygonData.cc.

Referenced by PolygonData::isMatchFor().

bool formsNewEndline ( const LineData ln,
bool  useEnd1Pt = true,
bool  useEnd2Pt = true 
) const [private]

Definition at line 159 of file PolygonData.cc.

void updateVertices (  )  [private]

called everytime polygon is changed. updates vertices by finding intersections of adjascent edges

Definition at line 48 of file PolygonData.cc.

Referenced by PolygonData::PolygonData(), PolygonData::tryClosePolygon(), and PolygonData::updateParams().

bool isFirstLineLonger ( const Shape< LineData > &  ln1,
const Shape< LineData > &  ln2 
) [static, private]

Definition at line 481 of file PolygonData.cc.

Referenced by PolygonData::formPolygons().

Point getCentroid (  )  const [virtual]

return the centroid of the shape in point format

Implements BaseData.

Definition at line 453 of file PolygonData.cc.

bool isMatchFor ( const ShapeRoot other  )  const [virtual]

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

Implements BaseData.

Definition at line 295 of file PolygonData.cc.

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 from BaseData.

Definition at line 357 of file PolygonData.cc.

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

updates existing edges, but does not importing new edges

Implements BaseData.

Definition at line 335 of file PolygonData.cc.

int getConfidence (  )  const [virtual]

returns minimum confidence of all edges

Reimplemented from BaseData.

Definition at line 319 of file PolygonData.cc.

bool isInside ( const Point  )  const [virtual]

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

Reimplemented from BaseData.

Definition at line 368 of file PolygonData.cc.

void printParams (  )  const [virtual]

Prints information about this shape.

Implements BaseData.

Definition at line 425 of file PolygonData.cc.

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

Apply a transformation matrix to the shape.

Implements BaseData.

Definition at line 437 of file PolygonData.cc.

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

Project to ground plane using given matrix.

Implements BaseData.

Definition at line 446 of file PolygonData.cc.

void setColor ( const rgb &  new_color  )  [virtual]

Color.

Get the color.

Reimplemented from BaseData.

Definition at line 464 of file PolygonData.cc.

Referenced by PolygonData::setColor().

virtual void setColor ( const unsigned int  color_index  )  [virtual]

Color.

Get the color.

Reimplemented from BaseData.

void setColor ( const std::string &  color_name  )  [virtual]

Set shape and rendering sketch color.

Reimplemented from BaseData.

Definition at line 476 of file PolygonData.cc.

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

Render into a sketch space.

Implements BaseData.

Definition at line 485 of file PolygonData.cc.

virtual unsigned short getDimension (  )  const [inline, virtual]

Implements BaseData.

Definition at line 113 of file PolygonData.h.


Friends And Related Function Documentation

friend class Shape< PolygonData > [friend]

Definition at line 41 of file PolygonData.h.

Referenced by PolygonData::convexHull(), and PolygonData::formPolygons().


Member Data Documentation


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

DualCoding 4.0
Generated Thu Nov 22 00:54:02 2007 by Doxygen 1.5.4