Base::Vector2d Class Reference

The vector class for 2D calculations. More...

#include <Tools2D.h>

Public Member Functions

double Angle () const
 
double Distance (const Vector2d &v) const
 
double GetAngle (const Vector2d &v) const
 
bool IsEqual (const Vector2d &v, double tolerance=0.0) const
 
bool IsNull (double tolerance=0.0) const
 
double Length () const
 
Vector2dNegate ()
 
Vector2dNormalize ()
 
double operator* (const Vector2d &v) const
 
Vector2d operator* (double c) const
 
Vector2doperator*= (double c)
 
Vector2d operator+ (const Vector2d &v) const
 
Vector2d operator+ (void) const
 
Vector2doperator+= (const Vector2d &v)
 
Vector2d operator- (const Vector2d &v) const
 
Vector2d operator- (void) const
 
Vector2doperator-= (const Vector2d &v)
 
Vector2d operator/ (double c) const
 
Vector2doperator/= (double c)
 
Vector2doperator= (const Vector2d &v)
 
bool operator== (const Vector2d &v) const
 
Vector2d Perpendicular (bool clockwise=false) const
 
void ProjectToLine (const Vector2d &point, const Vector2d &line)
 
Vector2dRotate (double angle)
 
Vector2dScale (double factor)
 
Vector2dSet (double x, double y)
 
double Sqr () const
 
 Vector2d ()
 INLINES. More...
 
 Vector2d (const Vector2d &v)
 
 Vector2d (double x, double y)
 
 Vector2d (float x, float y)
 

Static Public Member Functions

static Vector2d FromPolar (double r, double fi)
 

Public Attributes

double x
 
double y
 

Detailed Description

The vector class for 2D calculations.

Constructor & Destructor Documentation

◆ Vector2d() [1/4]

Base::Vector2d::Vector2d ( )

◆ Vector2d() [2/4]

Base::Vector2d::Vector2d ( float  x,
float  y 
)

◆ Vector2d() [3/4]

Base::Vector2d::Vector2d ( double  x,
double  y 
)

◆ Vector2d() [4/4]

Base::Vector2d::Vector2d ( const Vector2d v)

Member Function Documentation

◆ Angle()

◆ Distance()

◆ FromPolar()

◆ GetAngle()

double Vector2d::GetAngle ( const Vector2d v) const

◆ IsEqual()

bool Base::Vector2d::IsEqual ( const Vector2d v,
double  tolerance = 0.0 
) const

◆ IsNull()

bool Base::Vector2d::IsNull ( double  tolerance = 0.0) const

◆ Length()

◆ Negate()

Vector2d & Base::Vector2d::Negate ( )

References x, and y.

◆ Normalize()

◆ operator*() [1/2]

double Base::Vector2d::operator* ( const Vector2d v) const

References x.

◆ operator*() [2/2]

Vector2d Base::Vector2d::operator* ( double  c) const

References Vector2d().

◆ operator*=()

Vector2d & Base::Vector2d::operator*= ( double  c)

◆ operator+() [1/2]

Vector2d Base::Vector2d::operator+ ( const Vector2d v) const

References Vector2d().

◆ operator+() [2/2]

Vector2d Base::Vector2d::operator+ ( void  ) const

References Vector2d().

◆ operator+=()

Vector2d & Base::Vector2d::operator+= ( const Vector2d v)

References x.

◆ operator-() [1/2]

Vector2d Base::Vector2d::operator- ( const Vector2d v) const

References Vector2d().

◆ operator-() [2/2]

Vector2d Base::Vector2d::operator- ( void  ) const

References Vector2d().

◆ operator-=()

Vector2d & Base::Vector2d::operator-= ( const Vector2d v)

References x.

◆ operator/()

Vector2d Base::Vector2d::operator/ ( double  c) const

References Vector2d().

◆ operator/=()

Vector2d & Base::Vector2d::operator/= ( double  c)

◆ operator=()

Vector2d & Base::Vector2d::operator= ( const Vector2d v)

References x.

◆ operator==()

bool Base::Vector2d::operator== ( const Vector2d v) const

◆ Perpendicular()

Vector2d Base::Vector2d::Perpendicular ( bool  clockwise = false) const

◆ ProjectToLine()

void Vector2d::ProjectToLine ( const Vector2d point,
const Vector2d line 
)

◆ Rotate()

Vector2d & Base::Vector2d::Rotate ( double  angle)

References x.

◆ Scale()

◆ Set()

Vector2d & Base::Vector2d::Set ( double  x,
double  y 
)

References x, and y.

◆ Sqr()

double Base::Vector2d::Sqr ( ) const

References y.

Member Data Documentation

◆ x

double Base::Vector2d::x

Referenced by Mod.PartDesign.Scripts.FilletArc.Vector::add(), Base::Line2d::CalcBoundBox(), DraftGui.DraftToolBar::changeXValue(), importSVG.svgHandler::characters(), PathScripts.PathInspect.GCodeEditorDialog::cleanup(), Base::Polygon2d::Contains(), Mod.PartDesign.Scripts.FilletArc.Vector::cross(), PathScripts.PostUtils.GCodeEditorDialog::done(), Mod.PartDesign.Scripts.FilletArc.Vector::dot(), TechDrawGui::QGIViewDimension::drawDiameter(), TechDrawGui::QGIViewDimension::drawRadiusExecutive(), TechDrawGui::QGIViewDimension::drawSingleArc(), TechDraw::DrawUtil::findCircleRectangleIntersections(), TechDraw::DrawUtil::findLineRectangleIntersections(), Base::Line2d::FromPos(), Part::Geom2dLine::Geom2dLine(), Part::Geom2dCircle::getCircleCenter(), SketcherGui::GetPointAngle(), Base::BoundBox2d::Intersect(), Base::Line2d::Intersect(), TechDraw::DrawUtil::Intersect2d(), Mod.PartDesign.Scripts.FilletArc.Vector::length(), DrawSketchHandlerBSplineInsertKnot::mouseMove(), SketcherGui::DrawSketchHandlerArc::mouseMove(), SketcherGui::DrawSketchHandler3PointArc::mouseMove(), SketcherGui::DrawSketchHandlerArcOfEllipse::mouseMove(), SketcherGui::DrawSketchHandlerArcOfHyperbola::mouseMove(), SketcherGui::DrawSketchHandlerArcOfParabola::mouseMove(), SketcherGui::DrawSketchHandlerCircle::mouseMove(), SketcherGui::DrawSketchHandler3PointCircle::mouseMove(), SketcherGui::DrawSketchHandlerExtend::mouseMove(), SketcherGui::DrawSketchHandlerLineSet::mouseMove(), SketcherGui::DrawSketchHandlerRegularPolygon::mouseMove(), SketcherGui::DrawSketchHandlerBox::mouseMove(), SketcherGui::DrawSketchHandlerOblong::mouseMove(), SketcherGui::DrawSketchHandlerSlot::mouseMove(), SketcherGui::DrawSketchHandlerTrimming::mouseMove(), Mod.PartDesign.Scripts.FilletArc.Vector::mult(), Negate(), Mod.PartDesign.Scripts.FilletArc.Vector::norm(), operator*(), operator+=(), operator-=(), operator=(), PathScripts.PathDressupHoldingTags.Tag::originAt(), DraftGui.DraftToolBar::pointUi(), SketcherGui::DrawSketchHandlerArc::pressButton(), SketcherGui::DrawSketchHandlerBox::pressButton(), DrawSketchHandlerGenConstraint::releaseButton(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), SketcherGui::DrawSketchHandlerArc::releaseButton(), SketcherGui::DrawSketchHandler3PointArc::releaseButton(), SketcherGui::DrawSketchHandlerArcOfEllipse::releaseButton(), SketcherGui::DrawSketchHandler3PointCircle::releaseButton(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), SketcherGui::DrawSketchHandlerLineSet::releaseButton(), SketcherGui::DrawSketchHandlerPoint::releaseButton(), SketcherGui::DrawSketchHandlerRegularPolygon::releaseButton(), SketcherGui::DrawSketchHandlerBox::releaseButton(), SketcherGui::DrawSketchHandlerOblong::releaseButton(), SketcherGui::DrawSketchHandlerSlot::releaseButton(), SketcherGui::DrawSketchHandlerSplitting::releaseButton(), SketcherGui::DrawSketchHandlerTrimming::releaseButton(), SketcherGui::DrawSketchHandlerArcOfHyperbola::releaseButton(), SketcherGui::DrawSketchHandlerArcOfParabola::releaseButton(), DraftGui.DraftToolBar::reset_ui_values(), Rotate(), Part::Geom2dLineSegment::Save(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), Set(), Part::Geom2dLine::setLine(), Part::Geom2dConic::setLocation(), Part::Geom2dArcOfConic::setLocation(), Part::Geom2dEllipse::setMajorAxisDir(), Part::Geom2dArcOfEllipse::setMajorAxisDir(), SketcherGui::EditModeCoinManager::setPositionText(), Mod.PartDesign.Scripts.FilletArc.Vector::sub(), DraftGui.DraftToolBar::update_cartesian_coords(), DraftGui.DraftToolBar::update_spherical_coords(), DraftGui.DraftToolBar::updateSnapper(), DraftGui.DraftToolBar::validatePoint(), and automotive_design.right_angular_wedge::wr1().

◆ y

double Base::Vector2d::y

Referenced by Mod.PartDesign.Scripts.FilletArc.Vector::add(), Base::Line2d::CalcBoundBox(), DraftGui.DraftToolBar::changeYValue(), importSVG.svgHandler::characters(), PathScripts.PathInspect.GCodeEditorDialog::cleanup(), Base::Polygon2d::Contains(), Mod.PartDesign.Scripts.FilletArc.Vector::cross(), PathScripts.PostUtils.GCodeEditorDialog::done(), Mod.PartDesign.Scripts.FilletArc.Vector::dot(), TechDrawGui::QGIViewDimension::drawDiameter(), TechDrawGui::QGIViewDimension::drawSingleArc(), TechDraw::DrawUtil::findCircleRectangleIntersections(), TechDraw::DrawUtil::findLineRectangleIntersections(), Base::Line2d::FromPos(), Part::Geom2dLine::Geom2dLine(), TechDrawGui::QGIViewDimension::getAsmeRefJointPoint(), TechDrawGui::QGIViewDimension::getAsmeRefOutsetPoint(), Part::Geom2dCircle::getCircleCenter(), SketcherGui::GetPointAngle(), Base::BoundBox2d::Intersect(), Base::Line2d::Intersect(), TechDraw::DrawUtil::Intersect2d(), Mod.PartDesign.Scripts.FilletArc.Vector::length(), DrawSketchHandlerBSplineInsertKnot::mouseMove(), SketcherGui::DrawSketchHandlerArc::mouseMove(), SketcherGui::DrawSketchHandler3PointArc::mouseMove(), SketcherGui::DrawSketchHandlerArcOfEllipse::mouseMove(), SketcherGui::DrawSketchHandlerArcOfHyperbola::mouseMove(), SketcherGui::DrawSketchHandlerArcOfParabola::mouseMove(), SketcherGui::DrawSketchHandlerCircle::mouseMove(), SketcherGui::DrawSketchHandler3PointCircle::mouseMove(), SketcherGui::DrawSketchHandlerExtend::mouseMove(), SketcherGui::DrawSketchHandlerLineSet::mouseMove(), SketcherGui::DrawSketchHandlerRegularPolygon::mouseMove(), SketcherGui::DrawSketchHandlerBox::mouseMove(), SketcherGui::DrawSketchHandlerOblong::mouseMove(), SketcherGui::DrawSketchHandlerSlot::mouseMove(), SketcherGui::DrawSketchHandlerTrimming::mouseMove(), Mod.PartDesign.Scripts.FilletArc.Vector::mult(), Negate(), Mod.PartDesign.Scripts.FilletArc.Vector::norm(), PathScripts.PathDressupHoldingTags.Tag::originAt(), DraftGui.DraftToolBar::pointUi(), SketcherGui::DrawSketchHandlerArc::pressButton(), SketcherGui::DrawSketchHandlerBox::pressButton(), DrawSketchHandlerGenConstraint::releaseButton(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), SketcherGui::DrawSketchHandlerArc::releaseButton(), SketcherGui::DrawSketchHandler3PointArc::releaseButton(), SketcherGui::DrawSketchHandlerArcOfEllipse::releaseButton(), SketcherGui::DrawSketchHandler3PointCircle::releaseButton(), SketcherGui::DrawSketchHandlerExtend::releaseButton(), SketcherGui::DrawSketchHandlerFillet::releaseButton(), SketcherGui::DrawSketchHandlerLineSet::releaseButton(), SketcherGui::DrawSketchHandlerPoint::releaseButton(), SketcherGui::DrawSketchHandlerRegularPolygon::releaseButton(), SketcherGui::DrawSketchHandlerBox::releaseButton(), SketcherGui::DrawSketchHandlerOblong::releaseButton(), SketcherGui::DrawSketchHandlerSlot::releaseButton(), SketcherGui::DrawSketchHandlerSplitting::releaseButton(), SketcherGui::DrawSketchHandlerTrimming::releaseButton(), SketcherGui::DrawSketchHandlerArcOfHyperbola::releaseButton(), SketcherGui::DrawSketchHandlerArcOfParabola::releaseButton(), DraftGui.DraftToolBar::reset_ui_values(), Part::Geom2dLineSegment::Save(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), Set(), Part::Geom2dLine::setLine(), Part::Geom2dConic::setLocation(), Part::Geom2dArcOfConic::setLocation(), Part::Geom2dEllipse::setMajorAxisDir(), Part::Geom2dArcOfEllipse::setMajorAxisDir(), SketcherGui::EditModeCoinManager::setPositionText(), Sqr(), Mod.PartDesign.Scripts.FilletArc.Vector::sub(), DraftGui.DraftToolBar::update_cartesian_coords(), DraftGui.DraftToolBar::update_spherical_coords(), DraftGui.DraftToolBar::updateSnapper(), and DraftGui.DraftToolBar::validatePoint().


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