oaVector Class Reference


Public Methods

 oaVector ()
 oaVector (oaOffset xValIn, oaOffset yValIn)
 oaVector (const oaPoint &head)
 oaVector (const oaPoint &tail, const oaPoint &head)
oaOffsetx ()
oaOffsety ()
oaOffset x () const
oaOffset y () const
void set (const oaPoint &tail, const oaPoint &head)
void setLength (const oaInt4 length)
oaInt4 getLength () const
oaBoolean leftOf (const oaVector &ref) const
oaBoolean rightOf (const oaVector &ref) const
void rotate90 ()
void rotate180 ()
void rotate270 ()
void addToPoint (const oaPoint &start, oaPoint &result) const
void subFromPoint (const oaPoint &start, oaPoint &result) const
oaBoolean intersects (const oaPoint &ref, const oaVector &other, const oaPoint &otherRef, oaPoint &iPt) const
oaDouble operator * (const oaVector &v) const
oaBoolean operator== (const oaVector &v) const
oaBoolean operator!= (const oaVector &v) const
void normalize ()
oaDouble getCosAngle (const oaVector &v) const

Friends

class oaChecker< oaVector >

Detailed Description

The oaVector class implements a two-dimensional vector.


Constructor & Destructor Documentation

oaVector::oaVector   [inline]
 

This function constructs a default oaVector instance.

oaVector::oaVector oaOffset    xValIn,
oaOffset    yValIn
[inline]
 

This function constructs an oaVector object, initializing the vector with the specified X and Y offset values.

Parameters:
xValIn The X offset value to use
yValIn The Y offset value to use

oaVector::oaVector const oaPoint &    head [inline]
 

This function constructs an oaVector object, initializing the vector from a single head point with the origin at the implied tail.

Parameters:
head The head point of this vector

oaVector::oaVector const oaPoint &    head,
const oaPoint &    tail
[inline]
 

This function constructs an oaVector object, initializing the vector using the specified head and tail values.

Parameters:
head The head point of this vector
tail The tail point of this vector


Member Function Documentation

void oaVector::addToPoint const oaPoint &    start,
oaPoint &    result
const [inline]
 

This function adds this vector to the point start, and places the result in result.

Parameters:
start The starting point
result The resulting point after this vector is added to start

oaDouble oaVector::getCosAngle const oaVector &    v const
 

This function returns the cosine of the angle between this vector and the specified vector.

Parameters:
v The other vector to be used for angle measurement

oaInt4 oaVector::getLength   const
 

This function returns the length of this vector.

oaBoolean oaVector::intersects const oaPoint &    ref,
const oaVector &    other,
const oaPoint &    otherRef,
oaPoint &    iPt
const
 

This function finds the point of intersection between this vector and vector other. This function converts the vectors into segments. The segments do all the work.

Parameters:
ref The head of this vector
other The vector that intersects the reference vector
otherRef The head of vector other
iPt The point of intersection between the vectors

oaBoolean oaVector::leftOf const oaVector &    ref const
 

This function returns true if this vector is to the left of the specified vector. "Leftof" means the angle of this vector minus the angle of ref is between 0 and 180 degrees.

Parameters:
ref The specified vector

void oaVector::normalize  
 

This function normalizes this vector to a unit vector. The result is undefined for a zero length vector.

oaDouble oaVector::operator * const oaVector &    v const [inline]
 

This operator returns an oaDouble that equals the product of this oaVector and the specified oaVector v.

oaBoolean oaVector::operator!= const oaVector &    v const [inline]
 

This operator compares this oaVector with the specified oaVector v and returns true if the two vectors are not equal.

oaBoolean oaVector::operator== const oaVector &    v const [inline]
 

This operator compares this oaVector with the specified oaVector v and returns true if the two vectors are equal.

oaBoolean oaVector::rightOf const oaVector &    ref const
 

This function returns true if this vector is to the right of the specified vector. "Rightof" means the angle of this vector minus the angle of ref is between 180 and 360 degrees.

Parameters:
ref The specified vector

void oaVector::rotate180   [inline]
 

This function rotates this vector by 180 degrees in a clockwise direction.

void oaVector::rotate270   [inline]
 

This function rotates this vector by 270 degrees in a clockwise direction.

void oaVector::rotate90   [inline]
 

This function rotates this vector by 90 degrees in a clockwise direction.

void oaVector::set const oaPoint &    head,
const oaPoint &    tail
[inline]
 

This function recreates this vector based upon the segment generated from the head point to the tail point.

Parameters:
head The head point of the new vector
tail The tail point of the new vector

void oaVector::setLength const oaInt4    length
 

This function sets the length of this vector to the specified value. The result is undefined for a zero length vector.

Parameters:
length The length of the new vector

void oaVector::subFromPoint const oaPoint &    start,
oaPoint &    result
const [inline]
 

This function subtracts this vector from the point start and places the result in result.

oaInt4 oaVector::x   const [inline]
 

This function returns the X value of this vector.

oaInt4 & oaVector::x   [inline]
 

This function returns the X value of this vector.

oaInt4 oaVector::y   const [inline]
 

This function returns the Y value of this vector.

oaInt4 & oaVector::y   [inline]
 

This function returns the Y value of this vector.


Friends And Related Function Documentation

friend class oaChecker< oaVector > [friend]
 


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

Return to top of page