AURobotServers
4
|
#include <urespoly.h>
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) |
UPosition * | getFromTop (int fromTop) |
UPosition | getLastPoint () |
bool | getLimits (double *minx, double *miny, double *maxx, double *maxy) |
UPosition * | getLowerLeftXY () |
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) |
UPosition * | getPoints () |
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 |
UPosition * | points |
int | pointsCnt |
int | pointsMax |
UPosition ** | ppoints |
int | ppointsCnt |
Named polygon for mission lines
|
inline |
constructor
References UTime::clear(), UPose::clear(), cooSys, name, relPose, relPoseUse, updateTime, and valid.
Referenced by UResPoly::add().
|
inline |
const char * UPolyItem::codeXML | ( | char * | buf, |
const int | bufCnt | ||
) |
code this poly item in XML format
buff | start of buffer |
bufCnt | length of 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
thisname | is the name to be tested against |
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
wildname | is the name to be tested against (with optionally one wildcard '*') |
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
preStr | start by inserting this string into buffer |
buff | start of buffer |
bufCnt | length of 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
newname | is the new name for the polygon - default is empty - max 32 characters (MNL) |
Referenced by UResPoly::add(), and ~UPolyItem().
|
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().
int UPolyItem::cooSys |
coordinate system 0=odo, 1=utm, 2=map
Referenced by UPaintPolygon::addPolyToViewer(), ULineMatch::addToPoly(), codeXML(), UFuncLoca2::handleCommand(), UFuncLocalize::handleLocalize(), UResPoly::handleNewData(), UFuncBall::makeDisplayPolygon(), UFuncImSeg::makeDisplayPolygon(), UPaintPolygon::makePolyCloud(), UResPoly::methodCallV(), UNavPaint::paintPolyItems(), UNavView::paintPolyItems(), UPaintPolygons::setPolygon(), and UPolyItem().
|
static |
size of names
Referenced by UResPoly::handleNewData(), and setName().
char UPolyItem::name[MNL] |
polygon name
Referenced by codeXML(), UResPoly::commandList(), UFuncLocalize::handleAddLine(), UFuncLoca2::handleAddLine(), UResPoly::handleNewData(), isA(), match(), UNavPaint::paintPolyItems(), UNavView::paintPolyItems(), print(), setName(), and UPolyItem().
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 |
Update time for this item, so that updated only can be send
Referenced by UResPoly::codePolysXml(), UResPoly::codePolyXml(), UResPoly::handleNewData(), UFuncBall::makeDisplayPolygon(), UFuncImSeg::makeDisplayPolygon(), UPaintPolygons::setPolygon(), setUpdated(), and UPolyItem().
bool UPolyItem::valid |
Is this item valid (or deleted)
Referenced by codeXML(), UResPoly::handleNewData(), and UPolyItem().