AURobotServers
4
|
#include <uline.h>
Public Member Functions | |
virtual void | clear () |
virtual const char * | getDataType () |
double | getDistanceFromSeg (UPosition point, int *where=NULL) |
double | getDistanceFromSegSq (UPosition point, int *where=NULL) |
double | getDistanceXYSigned (UPosition point, int *where) |
UPosition | getOtherEnd () |
bool | getSegmentCrossingXY (ULineSegment *other, UPosition *crossing) |
void | print (const char *prestring=NULL) |
virtual void | setFromPoints (const UPosition *pos1, const UPosition *pos2) |
virtual void | setFromPoints (UPosition pos1, UPosition pos2) |
void | setFromPoints (double x1, double y1, double z1, double x2, double y2, double z2) |
void | show (const char *prestring=NULL) |
virtual void | snprint (const char *prestring, char *buff, const int buffCnt) |
Public Member Functions inherited from ULine | |
int | getCylinderCrossings (UPosition center, double r, double *t1, double *t2) |
double | getDistance (UPosition *point) |
double | getDistanceSq (UPosition *point) |
double | getDistanceSq (UPosition point) |
UPosition | getPlaneLineCrossing (ULine crossingLine, bool *notParallel=NULL) |
double | getPositionOnLine (UPosition *point) |
double | getPositionOnLine (UPosition point) |
UPosition | getPositionOnLine (const double t) |
double | getPositionOnLineXY (UPosition *point) |
double | getPositionOnLineXY (UPosition point) |
UPosition | getPositionOnLineXY (const double t) |
int | getSphereCrossings (UPosition center, double r, double *t1, double *t2) |
bool | getXYCrossing (ULine other, UPosition *crossingXY) |
double | getXYHeading () |
double | getXYsignedDistance (UPosition pos) |
bool | isValid () |
void | normalize () |
void | print (const char *prestring=NULL) |
void | set (UPosition iPos, UPosition iVec) |
void | set2D (double x, double y, double heading) |
void | setFromPoints (double x1, double y1, double z1, double x2, double y2, double z2) |
void | show (const char *prestring=NULL) |
void | turn90degXY (bool left) |
ULine () | |
ULine (double Px, double Py, double Pz, double Vx, double Vy, double Vz) | |
virtual | ~ULine () |
Public Member Functions inherited from UDataBase | |
bool | isA (const char *typeString) |
virtual bool | isAlsoA (const char *typeString) |
UDataBase () | |
virtual | ~UDataBase () |
Public Attributes | |
double | length |
Public Attributes inherited from ULine | |
UPosition | pos |
UPosition | vec |
Class to describe a 3D line using a 3D position, a unit vector and a length.
|
virtual |
|
inlinevirtual |
Get (end) type string for this structure
Reimplemented from ULine.
References ULine::clear(), ULine::setFromPoints(), ULine::show(), and ULine::snprint().
Referenced by UFunctionVarPool::initCallReturnStructType().
|
inline |
Get distance to line segment from a point (not squared). where = 0 if on line segment, 1 if closest to 'pos', and 2 if closest to 'other end'
Referenced by UPolygon::getDistance(), and testLineSegment().
double ULineSegment::getDistanceFromSegSq | ( | UPosition | point, |
int * | where = NULL |
||
) |
Get distance from a 3D point to a line segemnt, i.e. distance to the closest end or if closer to a point on the line segment, then this distance. the distance is squared. The optional second parameter returns the closest point (if != NULL) where = 0 if on line segment, 1 if closest to 'pos', and 2 if closest to 'other end'
References UPosition::distSq(), ULine::getPositionOnLine(), and ULine::pos.
double ULineSegment::getDistanceXYSigned | ( | UPosition | point, |
int * | where | ||
) |
Get — in XY space — the signed distance of 'point' relative to this segment. Positive is to the right of segment - seen from first end in direction towards other end. Returnes distance to either end or to a point on line whatever is closest. If 'where' is not NULL, then the closest part is returned here as: 0=point on line, 1= first point, 2= other end.
References dist, U2Dlined::distanceSigned(), ULine::getPositionOnLine(), ULine::pos, U2Dlined::set2P(), setFromPoints(), signofd(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by UPolygon::getDistanceXYsigned2(), UManArc::getMinDistanceXYSigned(), UPolygon::isOverlappingXYconvex2(), UAvoidPath2::setClosestPoint(), UReactivePath::testForObstacleNearExit(), and testSignedDistance().
|
inline |
Get position of other end of line segment
References ULine::getPositionOnLine().
Referenced by UAvoidPath2::addLnksToOpenSet(), UAvoidPath2::addNoVisLinesAsObstacles(), ULaserMeasurement::clear(), UResPassable::combineNearIntervals(), UFakeMap::copyToPoly(), UClientFuncLaserGui::doImage(), UAvoidCellGraph::fillVerticeList(), UAvoidPath2::findRoutesA(), UManLine::getMinDistanceXYSigned(), UManArc::getMinDistanceXYSigned(), UManPPSeq::getMinDistanceXYSigned(), UAvoidPath2::logObstacleGroups(), USFData::moveLocalToMap(), UFeatureData::moveLocalToOdo(), ULaserObst::moveToMap(), ULaserPi::moveToMap(), UNavPaint::paintFeatures(), UNavView::paintFeatures(), UClientFuncLaserGui::paintLineSegments(), UNavPaint::paintManData(), UClientFuncLaserGui::paintPathData(), UNavPaint::paintRoadLine(), UFunctionAvoid::sendCurrentAvoidPath(), ULaserPi::setInterval(), and UResRoadLine::updateRoadVariables().
bool ULineSegment::getSegmentCrossingXY | ( | ULineSegment * | other, |
UPosition * | crossing | ||
) |
Is this line segment crossing the other segment, Returns true if crossing (within ends), and The crossing (x,y-only) is returned in 'crossing' If no crossing is found, 'crossing' may be changed.
References a, ULine::getPositionOnLineXY(), and ULine::getXYCrossing().
Referenced by ULaserMeasurement::clear(), UPolygon::getCrossings(), UFakeMap::getFake2range(), UPolygon::isOverlappingXY(), UPolygon::isOverlappingXYconvex2(), UPolygon::isOverlappingXYtype(), and UAvoidLnkSeq::pathCrossing().
|
inline |
Set line from two points. Reference position is set from pos1, and other end is set to pos2 so that "pos1 + vec * length" ends at pos2.
Reimplemented from ULine.
References ULine::setFromPoints(), sqr(), UPosition::x, UPosition::y, and UPosition::z.
Referenced by ULaserMeasurement::clear(), UAvoidCellGraph::fillVerticeList(), ULaserObst::findEdgeObstacle(), UAvoidPath2::findObstAvoidRoute(), UPolygon::getCrossings(), UManSeq::getDeviationFromDirect(), UPolygon::getDistance(), getDistanceXYSigned(), UPolygon::getDistanceXYsigned2(), UFakeMap::getFake2range(), ULaserScan::getLineSegmentFit(), UManPPSeq::getMinDistanceXYSigned(), UAvoidNoVis::getNoVisSegment(), UPolygon::getSegment(), UAvoidLink::getTangentLine(), UPolygon::isOverlappingXY(), UPolygon::isOverlappingXYconvex2(), USFData::moveLocalToMap(), UFeatureData::moveLocalToOdo(), ULaserObst::moveToMap(), ULaserPi::moveToMap(), UFunctionAvoid::sendCurrentAvoidPath(), UAvoidPath2::setClosestPoint(), UAvoidNoVis::setNoVisSegment(), testLineSegment(), testManLineToSeg(), testManToSeg(), UAvoidPath2::testNoVisSegVisibility(), testSignedDistance(), testSmlEncoding(), and URoadLine::update().
Set line from two points. Reference position is set from pos1, and other end is set to pos2 so that "pos1 + vec * length" ends at pos2.
Reimplemented from ULine.
References UPosition::dist(), and ULine::setFromPoints().
void ULineSegment::setFromPoints | ( | double | x1, |
double | y1, | ||
double | z1, | ||
double | x2, | ||
double | y2, | ||
double | z2 | ||
) |
Set line segment from points. a line segment is a start point, a direction vector and a length.
x1,y1,z1 | defines the first (start) point |
x2,y2,z2 | defines the end point |
References ULine::setFromPoints(), and sqr().
void ULineSegment::show | ( | const char * | prestring = NULL | ) |
|
virtual |
double ULineSegment::length |
Length of line segment
Referenced by UAvoidPath2::addLnksToOpenSet(), UAvoidPath2::addNoVisLinesAsObstacles(), USmlTag::codeLineSegment(), UAvoidObst::crossingNonVisibilityLine(), UAvoidCellGraph::fillVerticeList(), ULaserObst::findEdgeObstacle(), UAvoidPath2::findRoutes(), UAvoidPath2::findRoutesA(), UAvoidPath2::findRouteToDest(), UResPassable::findTopOfRoad(), UAvoidLnkSeq::getDistance(), USmlTag::getLineSegment(), ULaserScan::getLineSegmentFit(), UManSeq::getMinDistanceXYSigned(), UAvoidLink::getTangentLine(), ULaserPi::getWidth(), UClientFuncSF::handleSF(), UResLaserIfSf::handleSF(), UResPassable::makePassableIntervalsFit(), UClientFuncLaserGui::paintLineSegments(), UAvoidLnkSeq::pathCrossing(), UAvoidPath2::setClosestPoint(), URoadLine::setNew(), URoadLine::update(), and UResRoadLine::updateRoadVariables().