AURobotServers  4
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
UPolyItem Class Reference

#include <urespoly.h>

Inheritance diagram for UPolyItem:
Inheritance graph

Public Member Functions

const char * codeXML (char *buf, const int bufCnt)
 
bool isA (const char *thisname)
 
bool match (const char *wildname)
 
const char * print (const char *preStr, char *buff, const int buffCnt)
 
void setName (const char *newname)
 
void setUpdated ()
 
 UPolyItem ()
 
 ~UPolyItem ()
 
- Public Member Functions inherited from UPolygon40
virtual void sortByAngleXYTo (UPosition *pc)
 
 UPolygon40 ()
 
- Public Member Functions inherited from UPolygon
bool add (UPosition point)
 
bool add (UPosition *point)
 
bool add (UPolygon *poly)
 
bool add (double x, double y, double z=0)
 
virtual void clear ()
 
virtual char * codeXml (char *buf, const int bufCnt, const char *extraAttr)
 
char * codeXml (const char *name, char *buf, int bufCnt, const char *extra)
 
bool copy (CvPoint *source, int sourceCnt)
 
bool copyPointsTo (UPolygon *destination)
 
bool copyTo (UPolygon *destination)
 
bool cut (U2Dlined *line, UPolygon *source, UPolygon *dstL, UPolygon *dstR)
 
int cutPoints (U2Dlined *line, U2Dpos *xPnts, int xPntsCnt)
 
bool extractConvexTo (UPolygon *destination)
 
double getClosestDistance (double toX, double toY, double maxRelevantDist, UPosition *closest, bool *atVertex=NULL)
 
int getCloseVertexCnt (double dist)
 
UPosition getCogXY ()
 
double getCogXYmaxDist ()
 
int getCrossings (ULineSegment *seg, UPosition xes[], const int xesCnt)
 
virtual const char * getDataType ()
 
double getDistance (double x, double y, int *closeSide=NULL, int *closeVertex=NULL)
 
double getDistanceXYsigned2 (UPosition pos, int *idx, UPosition *posOnPolygon, bool *vertex)
 
UPositiongetFromTop (int fromTop)
 
UPosition getLastPoint ()
 
bool getLimits (double *minx, double *miny, double *maxx, double *maxy)
 
UPositiongetLowerLeftXY ()
 
double getMostDistantVertexXY (double x, double y, double h, int side, UPosition *posOnPolygon)
 
int getMostDistantXY (ULineSegment *line, bool leftSide, bool insideSegment, double *distance, int exclude=-1, double *tPos=NULL)
 
UPosition getPoint (int index)
 
UPositiongetPoints ()
 
int getPointsCnt ()
 
int getPointsMax ()
 
UPosition getPPoint (int index)
 
UPosition ** getPPoints ()
 
ULineSegment getSegment (int index)
 
double getXYarea ()
 
bool insert (UPosition pos, int index)
 
virtual bool isAlsoA (const char *typeString)
 
bool isCogXYvalid ()
 
bool isEmbedded (UPolygon *other, double *maxDist=NULL)
 
bool isInsideConvex (double x, double y, double margin=0.0)
 
bool isOverlappingXY (UPolygon *poly2, int *count=NULL, UPosition xes[]=NULL, const int xesCnt=0)
 
bool isOverlappingXYconvex (UPolygon *poly2, double margin, int *closeThis=NULL, int *closePoly2=NULL)
 
bool isOverlappingXYconvex2 (UPolygon *poly2, double margin, UPosition *close=NULL)
 
bool isOverlappingXYconvexSeg (UPolygon *poly2, double margin, int closeThis[6], int *closeThisCnt, int closePoly2[6], int *closePoly2Cnt)
 
bool isOverlappingXYtype (UPolygon *poly2, int *xcnt, UPosition xes[], const int xesCnt, int type[])
 
bool isPolygon ()
 
bool isPolyline ()
 
UPosition pop ()
 
void print (const char *prestring)
 
void printSort (const char *prestring)
 
bool push (UPosition *point)
 
void remove (int index)
 
int removeNearVertex (double dist)
 
void setAsPolygon (bool value=true)
 
void setAsPolyline (bool value=true)
 
void setCogXYvalid (bool value)
 
void setColor (const char *colorStr)
 
bool setPoint (int idx, UPosition pos)
 
void setPointsCnt (int value)
 
bool setSize (int maxPoints)
 
virtual void snprint (const char *prestring, char *buff, const int buffCnt)
 
bool toConvex ()
 
 UPolygon ()
 
virtual ~UPolygon ()
 
- Public Member Functions inherited from UDataBase
bool isA (const char *typeString)
 
 UDataBase ()
 
virtual ~UDataBase ()
 
- Public Member Functions inherited from ULock
bool lock ()
 
void lockInit ()
 
void post ()
 
bool tryLock ()
 
bool tryWait ()
 
 ULock ()
 
void unlock ()
 
bool wait ()
 
 ~ULock ()
 

Public Attributes

int cooSys
 
char name [MNL]
 
UPose relPose
 
bool relPoseUse
 
UTime updateTime
 
bool valid
 
- Public Attributes inherited from UPolygon
char color [8]
 

Static Public Attributes

static const int MNL = 32
 
- Static Public Attributes inherited from UPolygon40
static const int MAX_POINTS = 40
 

Additional Inherited Members

- Protected Member Functions inherited from UPolygon
bool copySortedTo (UPolygon *destination)
 
- Protected Attributes inherited from UPolygon
bool aPolygon
 
UPosition cogXY
 
double cogXYmaxDist
 
bool cogXYvalid
 
UPositionpoints
 
int pointsCnt
 
int pointsMax
 
UPosition ** ppoints
 
int ppointsCnt
 

Detailed Description

Named polygon for mission lines

Constructor & Destructor Documentation

UPolyItem::UPolyItem ( )
inline

constructor

References UTime::clear(), UPose::clear(), cooSys, name, relPose, relPoseUse, updateTime, and valid.

Referenced by UResPoly::add().

UPolyItem::~UPolyItem ( )
inline

Destructor

References buf, codeXML(), isA(), match(), print(), and setName().

Member Function Documentation

const char * UPolyItem::codeXML ( char *  buf,
const int  bufCnt 
)

code this poly item in XML format

Parameters
buffstart of buffer
bufCntlength of buffer
Returns
a pointer to the buffer

References bool2str(), buf, USmlTag::codePolygon(), cooSys, UPose::h, name, UPolygon::pointsCnt, relPose, relPoseUse, valid, UPose::x, and UPose::y.

Referenced by UResPoly::codePolysXml(), UResPoly::codePolyXml(), and ~UPolyItem().

bool UPolyItem::isA ( const char *  thisname)

Test name of this poly item

Parameters
thisnameis the name to be tested against
Returns
true if name is identical - is not case sensitive

References name.

Referenced by match(), UResPoly::methodCall(), UResPoly::methodCallV(), and ~UPolyItem().

bool UPolyItem::match ( const char *  wildname)

Test name of this poly item against a name, that may hold one final wildcard (a *) i.e. 'foo*' will match 'footprint' and 'foo', but not 'fo' and 'foo*print' will match the same as 'foo*' a '*' will match all

Parameters
wildnameis the name to be tested against (with optionally one wildcard '*')
Returns
true if name matches 'thisname' - is not case sensitive

References isA(), name, and wildcmp().

Referenced by UResPoly::getNext(), and ~UPolyItem().

const char * UPolyItem::print ( const char *  preStr,
char *  buff,
const int  buffCnt 
)

Print current status to this buffer string

Parameters
preStrstart by inserting this string into buffer
buffstart of buffer
bufCntlength of buffer
Returns
a pointer to the buffer

References bool2str(), UPolygon::isPolygon(), name, and UPolygon::pointsCnt.

Referenced by UResPoly::commandList(), and ~UPolyItem().

void UPolyItem::setName ( const char *  newname)

Set name of this poly item

Parameters
newnameis the new name for the polygon - default is empty - max 32 characters (MNL)

References MNL, and name.

Referenced by UResPoly::add(), and ~UPolyItem().

void UPolyItem::setUpdated ( )
inline

set polygon as updated, i.e. set the update time to now.

References UTime::now(), and updateTime.

Referenced by UResPoly::add(), ULineMatch::addToPoly(), UFuncLoca2::correlateLines(), UFuncLocalize::handleLocalize(), and UResPoly::methodCallV().

Member Data Documentation

int UPolyItem::cooSys
const int UPolyItem::MNL = 32
static

size of names

Referenced by UResPoly::handleNewData(), and setName().

char UPolyItem::name[MNL]
UPose UPolyItem::relPose

if relative pose, the coordinates are relative to this pose (in the specified coordinate system)

Referenced by codeXML(), UResPoly::handleNewData(), and UPolyItem().

bool UPolyItem::relPoseUse

use the relative pose

Referenced by codeXML(), UResPoly::handleNewData(), and UPolyItem().

UTime UPolyItem::updateTime
bool UPolyItem::valid

Is this item valid (or deleted)

Referenced by codeXML(), UResPoly::handleNewData(), and UPolyItem().


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