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

#include <Tools2D.h>

Public Member Functions

double Angle (void) 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 (void) const
 
Vector2dNegate (void)
 
Vector2dNormalize (void)
 
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 (void) const
 
 Vector2d (const Vector2d &v)
 
 Vector2d (double x, double y)
 
 Vector2d (float x, float y)
 
 Vector2d (void)
 INLINES. More...
 

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

INLINES.

References x.

Referenced by Rotate().

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

double Base::Vector2d::Distance ( const Vector2d v) const

◆ FromPolar()

◆ GetAngle()

double Vector2d::GetAngle ( const Vector2d v) const

References Length().

Referenced by DrawSketchHandlerExtend::mouseMove().

◆ IsEqual()

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

◆ IsNull()

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

References x, and y.

◆ Length()

◆ Negate()

Vector2d & Base::Vector2d::Negate ( void  )

References Length().

◆ Normalize()

◆ operator*() [1/2]

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

◆ operator*() [2/2]

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

◆ operator*=()

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

◆ operator+() [1/2]

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

◆ operator+() [2/2]

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

◆ operator+=()

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

◆ operator-() [1/2]

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

◆ operator-() [2/2]

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

◆ operator-=()

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

References x.

◆ operator/()

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

◆ operator/=()

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

◆ operator=()

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

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

◆ Scale()

◆ Set()

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

◆ Sqr()

double Base::Vector2d::Sqr ( void  ) const

Member Data Documentation

◆ x

double Base::Vector2d::x

Referenced by Mod.PartDesign.Scripts.FilletArc.Vector::add(), Part::BSplineCurve2dPy::buildFromPoles(), Part::BSplineCurve2dPy::buildFromPolesMultsKnots(), Base::Line2d::CalcBoundBox(), DraftGui.DraftToolBar::changeAngleValue(), DraftGui.DraftToolBar::changeXValue(), importSVG.svgHandler::characters(), DraftGui.DraftToolBar::checkSpecialChars(), 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::BSplineCurve2dPy::getCardinalSplineTangents(), Part::ArcOfConic2dPy::getLocation(), Part::Conic2dPy::getLocation(), Part::BSplineCurve2dPy::interpolate(), Base::BoundBox2d::Intersect(), Base::Line2d::Intersect(), IsNull(), Mod.PartDesign.Scripts.FilletArc.Vector::length(), Part::Geometry2dPy::mirror(), DrawSketchHandlerBox::mouseMove(), DrawSketchHandlerLineSet::mouseMove(), DrawSketchHandlerArc::mouseMove(), DrawSketchHandler3PointArc::mouseMove(), DrawSketchHandlerCircle::mouseMove(), DrawSketchHandlerArcOfEllipse::mouseMove(), DrawSketchHandlerArcOfHyperbola::mouseMove(), DrawSketchHandlerArcOfParabola::mouseMove(), DrawSketchHandler3PointCircle::mouseMove(), DrawSketchHandlerExtend::mouseMove(), DrawSketchHandlerSlot::mouseMove(), DrawSketchHandlerRegularPolygon::mouseMove(), SketcherGui::ViewProviderSketch::moveConstraint(), Mod.PartDesign.Scripts.FilletArc.Vector::mult(), Mod.PartDesign.Scripts.FilletArc.Vector::norm(), operator-=(), PathScripts.PathDressupHoldingTags.Tag::originAt(), DraftGui.DraftToolBar::pointUi(), DrawSketchHandlerBox::pressButton(), DrawSketchHandlerArc::pressButton(), DrawSketchHandlerGenConstraint::releaseButton(), DrawSketchHandlerLineSet::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerArc::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), DrawSketchHandler3PointArc::releaseButton(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerArcOfEllipse::releaseButton(), DrawSketchHandlerArcOfHyperbola::releaseButton(), DrawSketchHandlerArcOfParabola::releaseButton(), DrawSketchHandler3PointCircle::releaseButton(), DrawSketchHandlerPoint::releaseButton(), DrawSketchHandlerFillet::releaseButton(), DrawSketchHandlerTrimming::releaseButton(), DrawSketchHandlerExtend::releaseButton(), DrawSketchHandlerSlot::releaseButton(), DrawSketchHandlerRegularPolygon::releaseButton(), Part::Geom2dLineSegment::Save(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), Part::Geom2dLine::setLine(), Part::Geom2dConic::setLocation(), Part::Geom2dArcOfConic::setLocation(), Part::Geom2dEllipse::setMajorAxisDir(), Part::Geom2dArcOfEllipse::setMajorAxisDir(), Part::BezierCurve2dPy::setPoles(), SketcherGui::ViewProviderSketch::setPositionText(), Part::Conic2dPy::setXAxis(), Part::ArcOfConic2dPy::setXAxis(), Part::Conic2dPy::setYAxis(), Part::ArcOfConic2dPy::setYAxis(), Mod.PartDesign.Scripts.FilletArc.Vector::sub(), DraftGui.DraftToolBar::taskUi(), DraftGui.DraftToolBar::updateSnapper(), DraftGui.DraftToolBar::validatePoint(), Vector2d(), and automotive_design.right_angular_wedge::wr1().

◆ y

double Base::Vector2d::y

Referenced by Mod.PartDesign.Scripts.FilletArc.Vector::add(), Part::BSplineCurve2dPy::buildFromPoles(), Part::BSplineCurve2dPy::buildFromPolesMultsKnots(), Base::Line2d::CalcBoundBox(), DraftGui.DraftToolBar::changeAngleValue(), DraftGui.DraftToolBar::changeYValue(), importSVG.svgHandler::characters(), DraftGui.DraftToolBar::checkSpecialChars(), 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::BSplineCurve2dPy::getCardinalSplineTangents(), Part::Conic2dPy::getLocation(), Part::ArcOfConic2dPy::getLocation(), Part::BSplineCurve2dPy::interpolate(), Base::BoundBox2d::Intersect(), Base::Line2d::Intersect(), IsNull(), Mod.PartDesign.Scripts.FilletArc.Vector::length(), Part::Geometry2dPy::mirror(), DrawSketchHandlerBox::mouseMove(), DrawSketchHandlerLineSet::mouseMove(), DrawSketchHandlerArc::mouseMove(), DrawSketchHandler3PointArc::mouseMove(), DrawSketchHandlerCircle::mouseMove(), DrawSketchHandlerArcOfEllipse::mouseMove(), DrawSketchHandlerArcOfHyperbola::mouseMove(), DrawSketchHandlerArcOfParabola::mouseMove(), DrawSketchHandler3PointCircle::mouseMove(), DrawSketchHandlerExtend::mouseMove(), DrawSketchHandlerSlot::mouseMove(), DrawSketchHandlerRegularPolygon::mouseMove(), SketcherGui::ViewProviderSketch::moveConstraint(), Mod.PartDesign.Scripts.FilletArc.Vector::mult(), Mod.PartDesign.Scripts.FilletArc.Vector::norm(), PathScripts.PathDressupHoldingTags.Tag::originAt(), DraftGui.DraftToolBar::pointUi(), DrawSketchHandlerBox::pressButton(), DrawSketchHandlerArc::pressButton(), DrawSketchHandlerGenConstraint::releaseButton(), DrawSketchHandlerLineSet::releaseButton(), DrawSketchHandlerCopy::releaseButton(), DrawSketchHandlerArc::releaseButton(), DrawSketchHandlerRectangularArray::releaseButton(), DrawSketchHandler3PointArc::releaseButton(), DrawSketchHandlerCoincident::releaseButton(), DrawSketchHandlerArcOfEllipse::releaseButton(), DrawSketchHandlerArcOfHyperbola::releaseButton(), DrawSketchHandlerArcOfParabola::releaseButton(), DrawSketchHandler3PointCircle::releaseButton(), DrawSketchHandlerPoint::releaseButton(), DrawSketchHandlerFillet::releaseButton(), DrawSketchHandlerTrimming::releaseButton(), DrawSketchHandlerExtend::releaseButton(), DrawSketchHandlerSlot::releaseButton(), DrawSketchHandlerRegularPolygon::releaseButton(), Part::Geom2dLineSegment::Save(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), Part::Geom2dLine::setLine(), Part::Geom2dConic::setLocation(), Part::Geom2dArcOfConic::setLocation(), Part::Geom2dEllipse::setMajorAxisDir(), Part::Geom2dArcOfEllipse::setMajorAxisDir(), Part::BezierCurve2dPy::setPoles(), SketcherGui::ViewProviderSketch::setPositionText(), Part::ArcOfConic2dPy::setXAxis(), Part::Conic2dPy::setXAxis(), Part::ArcOfConic2dPy::setYAxis(), Part::Conic2dPy::setYAxis(), Mod.PartDesign.Scripts.FilletArc.Vector::sub(), DraftGui.DraftToolBar::taskUi(), DraftGui.DraftToolBar::updateSnapper(), and DraftGui.DraftToolBar::validatePoint().


The documentation for this class was generated from the following files:
  • src/Base/Tools2D.h
  • src/Base/Tools2D.cpp