Point Class Reference
#include <Point.h>
Detailed Description
We define Point as a separate lightweight class because it is used as a component of all the xxxData classes, and we don't want to nest these structures.
Definition at line 23 of file Point.h.
List of all members.
Public Member Functions |
| Point (const Point &otherPt) |
| Copy constructor.
|
virtual | ~Point () |
| Destructor.
|
fmat::Column< 3 > & | getCoords () const |
coordinate_t | coordX () const |
coordinate_t | coordY () const |
coordinate_t | coordZ () const |
ReferenceFrameType_t | getRefFrameType () const |
void | setRefFrameType (const ReferenceFrameType_t ref) |
| Set reference frame type.
|
float | distanceFrom (const Point &other) const |
| Euclidean distance from another point to this one.
|
float | xyDistanceFrom (const Point &other) const |
| Euclidean distance from another point to this one, looking only at the x-y projection; z coordinates are ignored.
|
AngSignPi | atanYX () const |
| Angle in xy-plane encoded by this vector.
|
float | xyNorm () const |
| Length of the vector's projection in the x-y plane z coordinate is ignored.
|
float | xyzNorm () const |
| Length of the xyz vector.
|
Point | unitVector () const |
| Unit vector in the direction of this point.
|
float | getHeightAbovePoint (const Point &groundPoint, const PlaneEquation &groundplane) |
void | applyTransform (const fmat::Transform &T, const ReferenceFrameType_t newref=unspecified) |
| Apply a transformation matrix to translate and/or rotate the point.
|
bool | projectToGround (const fmat::Transform &camToBase, const PlaneEquation &groundplane) |
| projects this to ground plane according to camToBase matrix
|
bool | projectToGround (int xres, int yres, const PlaneEquation &groundplane) |
Point | operator+ (const Point &b) const |
Point & | operator+= (const Point &b) |
Point | operator- (const Point &b) const |
Point & | operator-= (const Point &b) |
Point | operator* (float b) const |
Point & | operator*= (float b) |
Point | operator/ (float b) const |
Point & | operator/= (float b) |
bool | operator== (const Point &b) const |
bool | operator!= (const Point &b) const |
Point & | operator= (const Point &b) |
void | printData () const |
|
|
| Point () |
| Constructors.
|
| Point (coordinate_t const &xp, coordinate_t const &yp, coordinate_t zp=0, ReferenceFrameType_t ref=unspecified) |
| Constructors.
|
| Point (const fmat::SubVector< 3, const float > &c, ReferenceFrameType_t ref=unspecified) |
| Constructors.
|
|
|
void | setCoords (const Point &otherPt) |
| Set position.
|
void | setCoords (const fmat::Column< 3 > otherCoords) |
| Set position.
|
void | setCoords (coordinate_t x, coordinate_t y, coordinate_t z=0) |
| Set position.
|
|
|
bool | isLeftOf (const Point &other, float distance=0) const |
| These functions need a ShapeSpace argument because left/right depends on reference frame type.
|
bool | isRightOf (const Point &other, float distance=0) const |
| These functions need a ShapeSpace argument because left/right depends on reference frame type.
|
bool | isAbove (const Point &other, float distance=0) const |
| These functions need a ShapeSpace argument because left/right depends on reference frame type.
|
bool | isBelow (const Point &other, float distance=0) const |
| These functions need a ShapeSpace argument because left/right depends on reference frame type.
|
|
|
bool | isBetween (const Point &other1, const Point &other2) const |
| These functions return true based on relative positions, assuming points lie in some x-y plane (z coordinate is ignored).
|
bool | isBetween (const Shape< LineData > &line1, const Shape< LineData > &line2) const |
| These functions return true based on relative positions, assuming points lie in some x-y plane (z coordinate is ignored).
|
bool | isBetween (const LineData &line1, const LineData &line2) const |
| These functions return true based on relative positions, assuming points lie in some x-y plane (z coordinate is ignored).
|
bool | isInside (const std::vector< LineData > &bound) const |
| These functions return true based on relative positions, assuming points lie in some x-y plane (z coordinate is ignored).
|
Public Attributes |
fmat::Column< 3 > | coords |
ReferenceFrameType_t | refFrameType |
Private Member Functions |
void | makeRefFrameCompatible (const Point &other) |
Friends |
class | EndPoint |
std::ostream & | operator<< (std::ostream &out, const Point &p) |
Constructor & Destructor Documentation
Constructors.
Definition at line 32 of file Point.h.
Constructors.
Definition at line 34 of file Point.h.
Copy constructor.
Definition at line 39 of file Point.h.
virtual ~Point |
( |
|
) |
[virtual] |
Destructor.
Definition at line 42 of file Point.h.
Member Function Documentation
Apply a transformation matrix to translate and/or rotate the point.
Reimplemented in PointData.
Definition at line 94 of file Point.cc.
Referenced by TargetData::applyTransform(), SphereData::applyTransform(), SkeletonData::applyTransform(), PyramidData::applyTransform(), NaughtData::applyTransform(), MarkerData::applyTransform(), LineData::applyTransform(), EllipseData::applyTransform(), CylinderData::applyTransform(), BrickData::applyTransform(), BlobData::applyTransform(), AprilTagData::applyTransform(), AgentData::applyTransform(), SkeletonData::projectToGround(), MarkerData::projectToGround(), and AprilTagData::projectToGround().
Definition at line 45 of file Point.h.
Referenced by Point::atanYX(), MarkerData::calculateCameraDistance(), EndPoint::checkValidity(), AgentData::circlesVerticallyAligned(), AgentData::compareCircleDist(), BiColorMarkerData::extractMarkers(), NaughtData::extractNaughts(), AgentData::findAgentsBelt(), Region::findCentralMoment(), AgentData::findCirclesManual(), BlobData::findCornersDerivative(), BlobData::findCornersDiagonal(), LineData::firstPt(), LineData::firstPtCoord(), EllipseData::getBoundingBox(), CylinderData::getBoundingBox(), BrickData::getBoundingBox(), Point::getHeightAbovePoint(), AgentData::getIdFromCenter(), AgentData::getIdFromCorner(), ShapeSpace::getShapeListForGUI(), LineData::houghTransform(), LineData::intersectionWithLine(), LineData::intersectsLine(), Point::isAbove(), Region::isContained(), PolygonData::isInside(), Point::isLeftOf(), LineData::LineData(), LineData::lineEquation_abc(), LineData::lineEquation_abc_xz(), LineData::lineEquation_mb(), BlobData::new_blob(), Point::operator==(), LineData::perpendicularDistanceFrom(), LineData::pointIsAbove(), LineData::pointIsBelow(), LineData::pointIsLeftOf(), LineData::pointIsRightOf(), LineData::pointOnLine(), LineData::pointsOnPerimeterOfWindow(), LineData::pointsOnSameSide(), Point::printData(), LineData::printEnds(), TargetData::printParams(), SphereData::printParams(), PointData::printParams(), LocalizationParticleData::printParams(), LineData::printParams(), SphereData::projectToGround(), SkeletonData::projectToGround(), PyramidData::projectToGround(), Point::projectToGround(), MarkerData::projectToGround(), CylinderData::projectToGround(), BrickData::projectToGround(), AprilTagData::projectToGround(), CylinderData::render(), BlobData::render(), LineData::secondPt(), LineData::secondPtCoord(), LineData::setDrawCoords(), TargetData::update_derived_properties(), EllipseData::updateProperties(), Skeleton::validJoint(), Point::xyDistanceFrom(), Point::xyNorm(), and Point::xyzNorm().
Definition at line 46 of file Point.h.
Referenced by Point::atanYX(), MarkerData::calculateCameraDistance(), EndPoint::checkValidity(), AgentData::circlesHorizontallyAligned(), BiColorMarkerData::extractMarkers(), NaughtData::extractNaughts(), AgentData::findAgentsBelt(), Region::findCentralMoment(), AgentData::findCirclesManual(), BlobData::findCornersDerivative(), BlobData::findCornersDiagonal(), LineData::firstPt(), LineData::firstPtCoord(), EllipseData::getBoundingBox(), CylinderData::getBoundingBox(), BrickData::getBoundingBox(), Point::getHeightAbovePoint(), AgentData::getIdFromCenter(), AgentData::getIdFromCorner(), ShapeSpace::getShapeListForGUI(), LineData::houghTransform(), LineData::intersectionWithLine(), LineData::intersectsLine(), Point::isAbove(), Region::isContained(), PolygonData::isInside(), Point::isLeftOf(), LineData::LineData(), LineData::lineEquation_abc(), LineData::lineEquation_mb(), BlobData::new_blob(), Point::operator==(), LineData::perpendicularDistanceFrom(), LineData::pointIsAbove(), LineData::pointIsBelow(), LineData::pointIsLeftOf(), LineData::pointIsRightOf(), LineData::pointOnLine(), LineData::pointsOnPerimeterOfWindow(), LineData::pointsOnSameSide(), Point::printData(), LineData::printEnds(), TargetData::printParams(), SphereData::printParams(), PointData::printParams(), LocalizationParticleData::printParams(), LineData::printParams(), SphereData::projectToGround(), SkeletonData::projectToGround(), PyramidData::projectToGround(), Point::projectToGround(), MarkerData::projectToGround(), CylinderData::projectToGround(), BrickData::projectToGround(), AprilTagData::projectToGround(), CylinderData::render(), BlobData::render(), LineData::secondPt(), LineData::secondPtCoord(), LineData::setDrawCoords(), TargetData::update_derived_properties(), EllipseData::updateProperties(), Skeleton::validJoint(), Point::xyDistanceFrom(), Point::xyNorm(), and Point::xyzNorm().
Definition at line 47 of file Point.h.
Referenced by Point::getHeightAbovePoint(), ShapeSpace::getShapeListForGUI(), LineData::lineEquation_abc_xz(), Point::operator==(), Point::printData(), TargetData::printParams(), SphereData::projectToGround(), SkeletonData::projectToGround(), PyramidData::projectToGround(), MarkerData::projectToGround(), CylinderData::projectToGround(), BrickData::projectToGround(), AprilTagData::projectToGround(), CylinderData::render(), BlobData::render(), TargetData::update_derived_properties(), Skeleton::validJoint(), and Point::xyzNorm().
Euclidean distance from another point to this one.
Definition at line 24 of file Point.cc.
Referenced by PolygonData::formsNewEndline(), PolygonData::isClosed(), SphereData::isInside(), PolygonData::isInside(), SphereData::isMatchFor(), SkeletonData::isMatchFor(), PointData::isMatchFor(), MarkerData::isMatchFor(), LocalizationParticleData::isMatchFor(), EndPoint::isMatchFor(), EllipseData::isMatchFor(), DominoData::isMatchFor(), BrickData::isMatchFor(), BlobData::isMatchFor(), AprilTagData::isMatchFor(), PolygonData::tryImportNewEndline(), TargetData::update_derived_properties(), LineData::update_derived_properties(), and BlobData::update_derived_properties().
Definition at line 44 of file Point.h.
Referenced by CylinderData::extractCylinders(), PointData::extractPoints(), AgentData::findAgentsBelt(), AgentData::getBoundingBox(), BiColorMarkerData::printParams(), PointData::render(), NaughtData::render(), MarkerData::render(), BlobData::render(), LineData::setDrawCoords(), and BaseData::setPosition().
These functions return true based on relative positions, assuming points lie in some x-y plane (z coordinate is ignored).
These functions return true based on relative positions, assuming points lie in some x-y plane (z coordinate is ignored).
These functions return true based on relative positions, assuming points lie in some x-y plane (z coordinate is ignored).
bool isInside |
( |
const std::vector< LineData > & |
bound |
) |
const |
These functions return true based on relative positions, assuming points lie in some x-y plane (z coordinate is ignored).
void makeRefFrameCompatible |
( |
const Point & |
other |
) |
[private] |
projects this to ground plane according to camToBase matrix
Mathematical implementation:
We'll convert the ray to the plane's reference frame, solve there. We find a point on the ray (ro_b) and the direction of the ray (rv_b).
Find distance from the ray offset (ro_b) and the closest point on the plane.
Find scaling factor by projecting ray vector (rv_b) onto plane normal.
Intersection point will be rv_b*dist/align + ro_b, but need to watch out for case where align==0 (rv_b and plane are parallel, no intersection)
Reimplemented in PointData.
Definition at line 103 of file Point.cc.
Referenced by MarkerData::calculateCameraDistance(), AgentData::findAgentsBelt(), TargetData::projectToGround(), SphereData::projectToGround(), PyramidData::projectToGround(), NaughtData::projectToGround(), LineData::projectToGround(), EllipseData::projectToGround(), CylinderData::projectToGround(), BrickData::projectToGround(), BlobData::projectToGround(), and AgentData::projectToGround().
Set position.
Definition at line 54 of file Point.h.
Set position.
Definition at line 53 of file Point.h.
void setCoords |
( |
const Point & |
otherPt |
) |
|
Set position.
Definition at line 52 of file Point.h.
Referenced by MarkerData::calculateCameraDistance(), AgentData::findAgentsBelt(), BlobData::findCorners(), BlobData::findCornersShapeFit(), Region::mostDistantPtFrom(), Point::operator=(), LineData::pointsOnPerimeterOfWindow(), SphereData::projectToGround(), PyramidData::projectToGround(), BrickData::projectToGround(), SkeletonData::setCentroid(), CrossData::setCentroid(), AprilTagData::setCentroid(), SphereData::setCentroidPt(), SiftData::setCentroidPt(), NaughtData::setCentroidPt(), EllipseData::setCentroidPt(), AgentData::setCentroidPt(), and LineData::setEndPts().
Point unitVector |
( |
|
) |
const |
float xyDistanceFrom |
( |
const Point & |
other |
) |
const |
Length of the vector's projection in the x-y plane z coordinate is ignored.
Definition at line 38 of file Point.cc.
Friends And Related Function Documentation
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const Point & |
p | |
|
) |
| | [friend] |
Member Data Documentation
Definition at line 26 of file Point.h.
Referenced by Point::applyTransform(), BrickData::BrickData(), MarkerData::calculateCameraDistance(), Point::coordX(), Point::coordY(), Point::coordZ(), Point::distanceFrom(), SkeletonData::getBoundingBox(), SiftData::getBoundingBox(), PointData::getBoundingBox(), LineData::getBoundingBox(), BlobData::getBoundingBox(), BlobData::getCentroid(), Point::getCoords(), Point::getHeightAbovePoint(), LineData::isOverlappedWith(), Point::operator*(), Point::operator*=(), Point::operator+=(), Point::operator-=(), Point::operator/(), Point::operator/=(), MarkerData::printParams(), BlobData::printParams(), AgentData::printParams(), SkeletonData::projectToGround(), Point::projectToGround(), MarkerData::projectToGround(), BlobData::projectToGround(), AprilTagData::projectToGround(), Point::setCoords(), and EndPoint::updateParams().
Definition at line 27 of file Point.h.
Referenced by Point::applyTransform(), BrickData::BrickData(), Point::getRefFrameType(), Point::isAbove(), Point::isLeftOf(), Point::makeRefFrameCompatible(), Point::operator*(), Point::operator/(), Point::operator=(), PointData::PointData(), Point::projectToGround(), and Point::setRefFrameType().
The documentation for this class was generated from the following files:
|