Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Point Class Reference

#include <Point.h>

Inheritance diagram for Point:

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
Pointoperator+= (const Point &b)
Point operator- (const Point &b) const
Pointoperator-= (const Point &b)
Point operator* (float b) const
Pointoperator*= (float b)
Point operator/ (float b) const
Pointoperator/= (float b)
bool operator== (const Point &b) const
bool operator!= (const Point &b) const
Pointoperator= (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

Point (  ) 

Constructors.

Definition at line 31 of file Point.h.

Referenced by Point::operator*(), Point::operator+(), Point::operator-(), and Point::operator/().

Point ( coordinate_t const &  xp,
coordinate_t const &  yp,
coordinate_t  zp = 0,
ReferenceFrameType_t  ref = unspecified 
)

Constructors.

Definition at line 32 of file Point.h.

Point ( const fmat::SubVector< 3, const float > &  c,
ReferenceFrameType_t  ref = unspecified 
)

Constructors.

Definition at line 34 of file Point.h.

Point ( const Point otherPt  ) 

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

AngSignPi atanYX (  )  const

Angle in xy-plane encoded by this vector.

Definition at line 34 of file Point.cc.

Referenced by AgentData::findAgentsBelt(), and Point::isLeftOf().

coordinate_t coordX (  )  const

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().

coordinate_t coordY (  )  const

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().

float getHeightAbovePoint ( const Point groundPoint,
const PlaneEquation groundplane 
)

Definition at line 172 of file Point.cc.

Referenced by PyramidData::projectToGround(), and BrickData::projectToGround().

ReferenceFrameType_t getRefFrameType (  )  const

Definition at line 48 of file Point.h.

bool isAbove ( const Point other,
float  distance = 0 
) const

These functions need a ShapeSpace argument because left/right depends on reference frame type.

Definition at line 72 of file Point.cc.

Referenced by DualCoding::bottomMost(), LineData::bottomPt(), Point::isBelow(), IsAbove::operator()(), DualCoding::topMost(), and LineData::topPt().

bool isBelow ( const Point other,
float  distance = 0 
) const

These functions need a ShapeSpace argument because left/right depends on reference frame type.

Definition at line 89 of file Point.cc.

Referenced by BrickData::addBrickWithTwoSides().

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 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 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 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).

bool isLeftOf ( const Point other,
float  distance = 0 
) const

These functions need a ShapeSpace argument because left/right depends on reference frame type.

Definition at line 47 of file Point.cc.

Referenced by PyramidData::findBoundingTriangle(), Point::isRightOf(), DualCoding::leftMost(), LineData::leftPt(), IsLeftOf::operator()(), DualCoding::rightMost(), and LineData::rightPt().

bool isRightOf ( const Point other,
float  distance = 0 
) const

These functions need a ShapeSpace argument because left/right depends on reference frame type.

Definition at line 69 of file Point.cc.

Referenced by BrickData::addBrickWithTwoSides().

void makeRefFrameCompatible ( const Point other  )  [private]

Definition at line 214 of file Point.cc.

Referenced by Point::operator+=(), and Point::operator-=().

bool operator!= ( const Point b  )  const

Definition at line 117 of file Point.h.

Point operator* ( float  b  )  const

Definition at line 219 of file Point.cc.

Point & operator*= ( float  b  ) 

Definition at line 221 of file Point.cc.

Point operator+ ( const Point b  )  const

Definition at line 198 of file Point.cc.

Point & operator+= ( const Point b  ) 

Definition at line 200 of file Point.cc.

Point operator- ( const Point b  )  const

Definition at line 206 of file Point.cc.

Point & operator-= ( const Point b  ) 

Definition at line 208 of file Point.cc.

Point operator/ ( float  b  )  const

Definition at line 227 of file Point.cc.

Point & operator/= ( float  b  ) 

Definition at line 229 of file Point.cc.

Point& operator= ( const Point b  ) 

Definition at line 119 of file Point.h.

bool operator== ( const Point b  )  const

Definition at line 234 of file Point.cc.

Referenced by Point::operator!=().

void printData (  )  const

Definition at line 240 of file Point.cc.

Referenced by BrickData::printParams().

bool projectToGround ( int  xres,
int  yres,
const PlaneEquation groundplane 
)

Definition at line 146 of file Point.cc.

bool projectToGround ( const fmat::Transform camToBase,
const PlaneEquation groundplane 
)

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().

void setCoords ( coordinate_t  x,
coordinate_t  y,
coordinate_t  z = 0 
)

Set position.

Definition at line 54 of file Point.h.

void setCoords ( const fmat::Column< 3 >  otherCoords  ) 

Set position.

Definition at line 53 of file Point.h.

Point unitVector (  )  const

Unit vector in the direction of this point.

Definition at line 42 of file Point.cc.

Referenced by AgentData::findAgentsBelt().

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.

Definition at line 28 of file Point.cc.

Referenced by EllipseData::updateProperties().

float xyNorm (  )  const

Length of the vector's projection in the x-y plane z coordinate is ignored.

Definition at line 38 of file Point.cc.

float xyzNorm (  )  const

Length of the xyz vector.

Definition at line 40 of file Point.cc.

Referenced by Point::unitVector().


Friends And Related Function Documentation

friend class EndPoint [friend]

Definition at line 128 of file Point.h.

std::ostream& operator<< ( std::ostream &  out,
const Point p 
) [friend]

Definition at line 130 of file Point.h.


Member Data Documentation


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

DualCoding 5.1CVS
Generated Mon May 9 04:56:31 2016 by Doxygen 1.6.3