Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

PolygonData Class Reference

#include <PolygonData.h>

Inheritance diagram for PolygonData:

Detailed Description

Definition at line 30 of file PolygonData.h.

List of all members.

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)
void importAdjust ()
 Adjust shape components after the shape has been imported (e.g., used by polygons).
BoundingBox2D 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 equivalentVertices (const PolygonData &other) const
 Return true if polys have the same vertices but possibly in a rotated order due to rebuilding.
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 bool intersectsLine (const LineData &line)
virtual void printParams () const
 Prints information about this shape.
virtual void applyTransform (const fmat::Transform &Tmat, const ReferenceFrameType_t newref=unspecified)
 Apply a transformation matrix to the shape.
virtual void projectToGround (const fmat::Transform &camToBase, const PlaneEquation &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
void setVertices (std::vector< Point > &vs, bool closed, bool end1Valid=true, bool end2Valid=true)
 Edge/Vertex Access Functions.

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< ShapeRootrebuildPolygons (const std::vector< LineData > &, std::vector< Shape< PolygonData > > &existing, std::vector< Shape< PolygonData > > &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 LineData &line)
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 LineData &ln1, const 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 27 of file PolygonData.cc.

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

Definition at line 46 of file PolygonData.h.

PolygonData ( const PolygonData other  ) 

Definition at line 48 of file PolygonData.h.


Member Function Documentation

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

Apply a transformation matrix to the shape.

Implements BaseData.

Definition at line 451 of file PolygonData.cc.

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

Convex hull using Graham's scan.

Definition at line 557 of file PolygonData.cc.

DATASTUFF_H ( PolygonData   ) 
const LineData& end1Ln (  )  const

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 EndPoint& end1Pt (  )  const
const LineData& end2Ln (  )  const

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& end2Pt (  )  const
bool equivalentVertices ( const PolygonData other  )  const [virtual]

Return true if polys have the same vertices but possibly in a rotated order due to rebuilding.

Definition at line 312 of file PolygonData.cc.

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

extracts then-edges lines

Definition at line 46 of file PolygonData.cc.

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

forms polygons from lines

Definition at line 84 of file PolygonData.cc.

Referenced by PolygonData::rebuildPolygons(), and PolygonData::updateState().

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

Definition at line 165 of file PolygonData.cc.

BoundingBox2D getBoundingBox (  )  const [virtual]

Reimplemented from BaseData.

Definition at line 158 of file PolygonData.cc.

Point getCentroid (  )  const [virtual]

return the centroid of the shape in point format

Implements BaseData.

Definition at line 469 of file PolygonData.cc.

int getConfidence ( void   )  const [virtual]

returns minimum confidence of all edges

Reimplemented from BaseData.

Definition at line 333 of file PolygonData.cc.

virtual unsigned short getDimension (  )  const [virtual]

Implements BaseData.

Definition at line 119 of file PolygonData.h.

const std::vector<LineData>& getEdges (  )  const

returns all edges of this polygon

Definition at line 66 of file PolygonData.h.

Referenced by PolygonData::isMatchFor().

std::vector<LineData>& getEdgesRW (  ) 

returns address of edge vector for modification

Definition at line 67 of file PolygonData.h.

static ShapeType_t getStaticType (  )  [static]

Definition at line 37 of file PolygonData.h.

const std::vector<Point>& getVertices (  )  const

returns all vertices of this polygon

Definition at line 65 of file PolygonData.h.

void importAdjust (  )  [virtual]

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

Reimplemented from BaseData.

Definition at line 150 of file PolygonData.cc.

bool intersectsLine ( const LineData line  )  [virtual]

Definition at line 424 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 isClosed (  )  const
bool isFirstLineLonger ( const LineData ln1,
const LineData ln2 
) [static, private]

Definition at line 502 of file PolygonData.cc.

Referenced by PolygonData::formPolygons().

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.

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 286 of file PolygonData.cc.

bool isMatchForEdge ( const LineData other  )  const [private]

Definition at line 245 of file PolygonData.cc.

PolygonData& operator= ( const PolygonData other  ) 

Definition at line 83 of file PolygonData.h.

void printParams (  )  const [virtual]

Prints information about this shape.

Implements BaseData.

Definition at line 438 of file PolygonData.cc.

void projectToGround ( const fmat::Transform camToBase,
const PlaneEquation groundplane 
) [virtual]

Project to ground plane using given matrix.

Implements BaseData.

Definition at line 460 of file PolygonData.cc.

vector< ShapeRoot > rebuildPolygons ( const std::vector< LineData > &  lines,
std::vector< Shape< PolygonData > > &  existing,
std::vector< Shape< PolygonData > > &  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 111 of file PolygonData.cc.

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

Render into a sketch space.

Implements BaseData.

Definition at line 506 of file PolygonData.cc.

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

Set shape and rendering sketch color.

Reimplemented from BaseData.

Definition at line 497 of file PolygonData.cc.

void setColor ( const unsigned int  color_index  )  [virtual]

Color.

Get the color.

Reimplemented from BaseData.

Definition at line 493 of file PolygonData.cc.

void setColor ( const rgb new_color  )  [virtual]

Color.

Get the color.

Reimplemented from BaseData.

Definition at line 485 of file PolygonData.cc.

Referenced by PolygonData::setColor().

void setVertices ( std::vector< Point > &  vs,
bool  closed,
bool  end1Valid = true,
bool  end2Valid = true 
)

Edge/Vertex Access Functions.

returns first edge of this polygon

Definition at line 70 of file PolygonData.cc.

bool tryClosePolygon (  )  [private]

Definition at line 225 of file PolygonData.cc.

Referenced by PolygonData::setVertices().

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

Definition at line 186 of file PolygonData.cc.

bool tryUpdateEdge ( const LineData line  )  [private]

Definition at line 274 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 349 of file PolygonData.cc.

vector< ShapeRoot > updateState (  ) 

Definition at line 255 of file PolygonData.cc.

void updateVertices (  )  [private]

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

Definition at line 52 of file PolygonData.cc.

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


Friends And Related Function Documentation

friend class Shape< PolygonData > [friend]

Definition at line 40 of file PolygonData.h.


Member Data Documentation


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

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