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 |
Vector2d & | Negate (void) |
Vector2d & | Normalize (void) |
double | operator* (const Vector2d &v) const |
Vector2d | operator* (double c) const |
Vector2d & | operator*= (double c) |
Vector2d | operator+ (const Vector2d &v) const |
Vector2d | operator+ (void) const |
Vector2d & | operator+= (const Vector2d &v) |
Vector2d | operator- (const Vector2d &v) const |
Vector2d | operator- (void) const |
Vector2d & | operator-= (const Vector2d &v) |
Vector2d | operator/ (double c) const |
Vector2d & | operator/= (double c) |
Vector2d & | operator= (const Vector2d &v) |
bool | operator== (const Vector2d &v) const |
Vector2d | Perpendicular (bool clockwise=false) const |
void | ProjectToLine (const Vector2d &point, const Vector2d &line) |
Vector2d & | Rotate (double angle) |
Vector2d & | Scale (double factor) |
Vector2d & | Set (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]
◆ 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()
double Base::Vector2d::Angle | ( | void | ) | const |
◆ Distance()
double Base::Vector2d::Distance | ( | const Vector2d & | v | ) | const |
Referenced by DrawSketchHandlerExtend::mouseMove(), and DrawSketchHandlerExtend::releaseButton().
◆ FromPolar()
|
static |
Referenced by TechDrawGui::QGIViewDimension::computeExtensionLinePoints(), TechDrawGui::QGIViewDimension::computePerpendicularIntersection(), TechDrawGui::QGIViewDimension::drawAngle(), TechDrawGui::QGIViewDimension::drawDiameter(), TechDrawGui::QGIViewDimension::drawDimensionArc(), TechDrawGui::QGIViewDimension::drawDimensionLine(), TechDrawGui::QGIViewDimension::drawDistanceExecutive(), TechDrawGui::QGIViewDimension::drawRadiusExecutive(), TechDrawGui::QGIViewDimension::drawSingleLine(), TechDraw::DrawUtil::findCircularArcRectangleIntersections(), TechDraw::DrawUtil::findLineRectangleIntersections(), and TechDraw::DrawUtil::findLineSegmentRectangleIntersections().
◆ GetAngle()
double Vector2d::GetAngle | ( | const Vector2d & | v | ) | const |
References Length().
Referenced by DrawSketchHandlerExtend::mouseMove().
◆ IsEqual()
Referenced by Base::BoundBox2d::BoundBox2d().
◆ IsNull()
◆ Length()
double Base::Vector2d::Length | ( | void | ) | const |
Referenced by TechDrawGui::QGIViewDimension::computeExtensionLinePoints(), TechDrawGui::QGIViewDimension::computeLineAndLabelAngles(), TechDrawGui::QGIViewDimension::drawAngle(), TechDrawGui::QGIViewDimension::drawDiameter(), TechDrawGui::QGIViewDimension::drawRadiusExecutive(), GetAngle(), DrawSketchHandlerExtend::mouseMove(), DrawSketchHandlerRegularPolygon::mouseMove(), Negate(), ProjectToLine(), SketcherGui::DrawSketchHandler::seekAutoConstraint(), Part::Geom2dEllipse::setMajorAxisDir(), and Part::Geom2dArcOfEllipse::setMajorAxisDir().
◆ Negate()
◆ Normalize()
Vector2d & Base::Vector2d::Normalize | ( | void | ) |
◆ 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]
◆ operator+() [2/2]
Vector2d Base::Vector2d::operator+ | ( | void | ) | const |
◆ operator+=()
◆ operator-() [1/2]
◆ operator-() [2/2]
Vector2d Base::Vector2d::operator- | ( | void | ) | const |
◆ operator-=()
◆ operator/()
Vector2d Base::Vector2d::operator/ | ( | double | c | ) | const |
◆ operator/=()
Vector2d & Base::Vector2d::operator/= | ( | double | c | ) |
◆ operator=()
◆ operator==()
◆ Perpendicular()
◆ ProjectToLine()
References Length(), Normalize(), and Scale().
Referenced by DrawSketchHandlerExtend::mouseMove().
◆ Rotate()
Vector2d & Base::Vector2d::Rotate | ( | double | angle | ) |
References Vector2d().
◆ Scale()
Vector2d & Base::Vector2d::Scale | ( | double | factor | ) |
◆ 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