Homepage Demos Overview Downloads Tutorials Reference
Credits

PolygonData Class Reference

#include <PolygonData.h>

Inheritance diagram for PolygonData:

Inheritance graph
[legend]
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 vector< Point > &pts, bool closed, bool end1Valid=true, bool end2Valid=true)
 PolygonData (const vector< LineData > &lns)
 PolygonData (const PolygonData &other)
BoundingBox getBoundingBox () const
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
 Shapes are admissible to the local map if they're large enough not to be noise.
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)
 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 (rgb new_color)
 Get the color.
virtual Sketch< bool > * render () const
 Render into a sketch space.
virtual unsigned short getDimension () const
const LineDataend1Ln () const
 Edge/Vertex Access Functions returns first edge of this polygon.
const LineDataend2Ln () const
 returns last edge of this polygon
const EndPointend1Pt () const
 returns end1Pt of end1Ln
const EndPointend2Pt () const
 returns end2Pt of end2Ln
const vector< Point > & getVertices () const
 returns all vertices of this polygon
const vector< LineData > & getEdges () const
 returns all edges of this polygon
vector< LineData > & getEdgesRW ()
 returns address of edge vector for modification

Static Public Member Functions

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

Protected Attributes

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

vector< Pointvertices

Friends

class Shape< PolygonData >


Constructor & Destructor Documentation

PolygonData ( const LineData  ) 

Constructors.

Definition at line 16 of file PolygonData.cc.

Referenced by PolygonData::convexHull().

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

Definition at line 24 of file PolygonData.cc.

PolygonData ( const 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

void applyTransform ( const NEWMAT::Matrix &  Tmat  )  [virtual]

Apply a transformation matrix to the shape.

Implements BaseData.

Definition at line 435 of file PolygonData.cc.

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

Convex hull using Graham's scan.

Definition at line 544 of file PolygonData.cc.

DATASTUFF_H ( PolygonData   ) 

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 EndPoint& end1Pt (  )  const [inline]

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& end2Pt (  )  const [inline]

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

extracts then-edges lines

Definition at line 40 of file PolygonData.cc.

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

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

forms polygons from lines

Definition at line 64 of file PolygonData.cc.

vector< ShapeRoot > formPolygons ( const vector< LineData > &  ,
vector< Shape< PolygonData > > &  existing,
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 91 of file PolygonData.cc.

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

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

Definition at line 157 of file PolygonData.cc.

BoundingBox getBoundingBox (  )  const [virtual]

Reimplemented from BaseData.

Definition at line 139 of file PolygonData.cc.

Point getCentroid (  )  const [virtual]

return the centroid of the shape in point format

Implements BaseData.

Definition at line 451 of file PolygonData.cc.

int getConfidence (  )  const [virtual]

returns minimum confidence of all edges

Reimplemented from BaseData.

Definition at line 317 of file PolygonData.cc.

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

Implements BaseData.

Definition at line 111 of file PolygonData.h.

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

returns all edges of this polygon

Definition at line 66 of file PolygonData.h.

Referenced by PolygonData::isMatchFor().

vector<LineData>& getEdgesRW (  )  [inline]

returns address of edge vector for modification

Definition at line 67 of file PolygonData.h.

static ShapeType_t getStaticType (  )  [inline, static]

Definition at line 38 of file PolygonData.h.

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

returns all vertices of this polygon

Definition at line 65 of file PolygonData.h.

bool isAdmissible (  )  const [virtual]

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

Reimplemented from BaseData.

Definition at line 355 of file PolygonData.cc.

bool isClosed (  )  const

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

Definition at line 471 of file PolygonData.cc.

Referenced by PolygonData::formPolygons().

bool isInside ( const Point pt  )  const [virtual]

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

Reimplemented from BaseData.

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

Referenced by PolygonData::tryClosePolygon().

bool isMatchForEdge ( const LineData other  )  const [private]

Definition at line 245 of file PolygonData.cc.

Referenced by PolygonData::isMatchFor().

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

Definition at line 79 of file PolygonData.h.

void printParams (  )  const [virtual]

Prints information about this shape.

Implements BaseData.

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

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

Render into a sketch space.

Implements BaseData.

Definition at line 475 of file PolygonData.cc.

void setColor ( rgb  new_color  )  [virtual]

Get the color.

Reimplemented from BaseData.

Definition at line 462 of file PolygonData.cc.

bool tryClosePolygon (  )  [private]

Definition at line 221 of file PolygonData.cc.

Referenced by PolygonData::PolygonData().

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

Definition at line 178 of file PolygonData.cc.

bool tryUpdateEdge ( const ShapeRoot  )  [private]

Definition at line 275 of file PolygonData.cc.

Referenced by PolygonData::updateParams().

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

updates existing edges, but does not importing new edges

Implements BaseData.

Definition at line 333 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 46 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 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 3.0beta
Generated Wed Oct 4 00:02:29 2006 by Doxygen 1.4.7