Convenient utility functions for TechDraw Module. More...
#include <DrawUtil.h>
Static Public Member Functions | |
static double | angleComposition (double fi, double delta) |
static double | angleDifference (double fi1, double fi2, bool reflex=false) |
static void | angleNormalize (double &fi) |
static double | angleWithX (TopoDS_Edge e, bool reverse) |
assumes 2d on XY quick angle for straight edges More... | |
static double | angleWithX (TopoDS_Edge e, TopoDS_Vertex v, double tolerance=VERTEXTOLERANCE) |
find angle of edge with x-Axis at First/LastVertex More... | |
static std::pair< Base::Vector3d, Base::Vector3d > | boxIntersect2d (Base::Vector3d point, Base::Vector3d dir, double xRange, double yRange) |
static bool | checkParallel (const Base::Vector3d v1, const Base::Vector3d v2, double tolerance=FLT_EPSILON) |
check if two vectors are parallel. Vectors don't have to be unit vectors More... | |
static bool | circulation (Base::Vector3d A, Base::Vector3d B, Base::Vector3d C) |
static Base::Vector3d | closestBasis (Base::Vector3d v) |
static PyObject * | colorToPyTuple (App::Color color) |
static void | copyFile (std::string inSpec, std::string outSpec) |
static void | countEdges (const char *label, const TopoDS_Shape &s) |
static void | countFaces (const char *label, const TopoDS_Shape &s) |
static int | countSubShapes (TopoDS_Shape shape, TopAbs_ShapeEnum subShape) |
static void | countWires (const char *label, const TopoDS_Shape &s) |
static void | dump1Vertex (const char *label, const TopoDS_Vertex &v) |
static void | dumpCS (const char *text, const gp_Ax2 &CS) |
static void | dumpCS3 (const char *text, const gp_Ax3 &CS) |
static void | dumpEdge (const char *label, int i, TopoDS_Edge e) |
static void | dumpEdges (const char *text, const TopoDS_Shape &s) |
static void | dumpVertexes (const char *text, const TopoDS_Shape &s) |
static void | findCircleRectangleIntersections (const Base::Vector2d &circleCenter, double circleRadius, const Base::BoundBox2d &rectangle, std::vector< Base::Vector2d > &intersections) |
static void | findCircularArcRectangleIntersections (const Base::Vector2d &circleCenter, double circleRadius, double arcBaseAngle, double arcRotation, const Base::BoundBox2d &rectangle, std::vector< Base::Vector2d > &intersections) |
static void | findConicRectangleIntersections (double conicAx2, double conicBxy, double conicCy2, double conicDx, double conicEy, double conicF, const Base::BoundBox2d &rectangle, std::vector< Base::Vector2d > &intersections) |
static void | findLineRectangleIntersections (const Base::Vector2d &linePoint, double lineAngle, const Base::BoundBox2d &rectangle, std::vector< Base::Vector2d > &intersections) |
static void | findLineSegmentRectangleIntersections (const Base::Vector2d &linePoint, double lineAngle, double segmentBasePosition, double segmentLength, const Base::BoundBox2d &rectangle, std::vector< Base::Vector2d > &intersections) |
static int | findRootForValue (double Ax2, double Bxy, double Cy2, double Dx, double Ey, double F, double value, bool findX, double roots[]) |
static std::string | formatVector (const Base::Vector3d &v) |
static std::string | formatVector (const gp_Dir &v) |
static std::string | formatVector (const gp_Dir2d &v) |
static std::string | formatVector (const gp_Pnt &v) |
static std::string | formatVector (const gp_Pnt2d &v) |
static std::string | formatVector (const gp_Vec &v) |
static std::string | formatVector (const QPointF &v) |
static bool | fpCompare (const double &d1, const double &d2, double tolerance=FLT_EPSILON) |
static double | getDefaultLineWeight (std::string s) |
static Base::Vector3d | getFaceCenter (TopoDS_Face f) |
static std::string | getGeomTypeFromName (std::string geomName) |
static int | getIndexFromName (std::string geomName) |
static Base::Vector3d | gpPnt2V3 (const gp_Pnt gp) |
static Base::Vector2d | Intersect2d (Base::Vector2d p1, Base::Vector2d d1, Base::Vector2d p2, Base::Vector2d d2) |
static Base::Vector3d | Intersect2d (Base::Vector3d p1, Base::Vector3d d1, Base::Vector3d p2, Base::Vector3d d2) |
find intersection in 2d for 2 lines in point+direction form More... | |
static void | intervalMarkCircular (std::vector< std::pair< double, bool > > &marking, double start, double length, bool value) |
static void | intervalMarkLinear (std::vector< std::pair< double, bool > > &marking, double start, double length, bool value) |
static unsigned int | intervalMerge (std::vector< std::pair< double, bool > > &marking, double boundary, bool wraps) |
static Base::Vector3d | invertY (Base::Vector3d v) |
static QPointF | invertY (QPointF p) |
static bool | isBetween (const Base::Vector3d pt, const Base::Vector3d end1, const Base::Vector3d end2) |
is pt between end1 and end2? More... | |
static bool | isCrazy (TopoDS_Edge e) |
static bool | isFirstVert (TopoDS_Edge e, TopoDS_Vertex v, double tolerance=VERTEXTOLERANCE) |
static bool | isLastVert (TopoDS_Edge e, TopoDS_Vertex v, double tolerance=VERTEXTOLERANCE) |
static bool | isSamePoint (TopoDS_Vertex v1, TopoDS_Vertex v2, double tolerance=VERTEXTOLERANCE) |
true if v1 and v2 are the same geometric point within tolerance More... | |
static bool | isZeroEdge (TopoDS_Edge e, double tolerance=VERTEXTOLERANCE) |
static std::string | makeGeomName (std::string geomType, int index) |
static bool | mergeBoundedPoint (const Base::Vector2d &point, const Base::BoundBox2d &boundary, std::vector< Base::Vector2d > &storage) |
static const char * | printBool (bool b) |
static App::Color | pyTupleToColor (PyObject *pColor) |
static QString | qbaToDebug (const QByteArray &line) |
static double | sensibleScale (double working_scale) |
static int | sgn (double x) |
static TopoDS_Shape | shapeFromString (std::string s) |
static std::string | shapeToString (TopoDS_Shape s) |
static double | simpleMinDist (TopoDS_Shape s1, TopoDS_Shape s2) |
static std::vector< std::string > | split (std::string csvLine) |
static double | sqr (double x) |
static std::vector< std::string > | tokenize (std::string csvLine, std::string delimiter=",$$$,") |
static Base::Vector3d | toR3 (const gp_Ax2 &fromSystem, const Base::Vector3d &fromPoint) |
convert fromPoint in coordinate system fromSystem to reference coordinate system More... | |
static gp_Pnt | V32gpPnt (const Base::Vector3d v) |
static Base::Vector3d | vecRotate (Base::Vector3d vec, double angle, Base::Vector3d axis, Base::Vector3d org=Base::Vector3d(0.0, 0.0, 0.0)) |
rotate vector by angle radians around axis through org More... | |
static bool | vectorLess (const Base::Vector3d &v1, const Base::Vector3d &v2) |
compare 2 vectors for sorting - true if v1 < v2 More... | |
static TopoDS_Shape | vectorToCompound (std::vector< TopoDS_Edge > vecIn) |
static Base::Vector3d | vertex2Vector (const TopoDS_Vertex &v) |
|
static |
References angleNormalize().
|
static |
References angleNormalize().
|
static |
Referenced by angleComposition(), angleDifference(), and intervalMarkCircular().
|
static |
assumes 2d on XY quick angle for straight edges
References Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.
Referenced by TechDraw::EdgeWalker::makeEmbedding(), and TechDraw::DrawProjectSplit::removeDuplicateEdges().
|
static |
find angle of edge with x-Axis at First/LastVertex
References Base::Console(), isFirstVert(), isLastVert(), Base::ConsoleSingleton::Message(), draftguitools.gui_annotationstyleeditor::param, draftutils.utils::tolerance(), Base::ConsoleSingleton::Warning(), Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.
|
static |
|
static |
check if two vectors are parallel. Vectors don't have to be unit vectors
References fpCompare(), and draftutils.utils::tolerance().
Referenced by closestBasis(), TechDraw::DrawProjGroupItem::execute(), TechDraw::DrawProjGroupItem::getViewAxis(), TechDraw::getViewAxis(), and TechDraw::legacyViewAxis1().
|
static |
Referenced by TechDraw::CenterLine::calcEndPoints2Lines().
|
static |
References checkParallel(), and Base::Vector3< _Precision >::GetAngle().
|
static |
|
static |
References Base::Console(), Base::FileInfo::copyTo(), Base::FileInfo::isReadable(), and Base::ConsoleSingleton::Message().
Referenced by TechDraw::DrawHatch::replaceFileIncluded(), TechDraw::DrawViewImage::replaceImageIncluded(), TechDraw::DrawGeomHatch::replacePatIncluded(), TechDraw::DrawViewSection::replacePatIncluded(), TechDraw::DrawViewSection::replaceSvgIncluded(), TechDraw::DrawTileWeld::replaceSymbolIncluded(), TechDraw::DrawHatch::setupFileIncluded(), TechDraw::DrawViewImage::setupImageIncluded(), TechDraw::DrawGeomHatch::setupPatIncluded(), TechDraw::DrawViewSection::setupPatIncluded(), TechDraw::DrawViewSection::setupSvgIncluded(), and TechDraw::DrawTileWeld::setupSymbolIncluded().
|
static |
References Base::Console(), and Base::ConsoleSingleton::Message().
|
static |
References Base::Console(), and Base::ConsoleSingleton::Message().
|
static |
Referenced by TechDraw::DrawViewDetail::detailExec().
|
static |
References Base::Console(), and Base::ConsoleSingleton::Message().
|
static |
References Base::Console(), and Base::ConsoleSingleton::Message().
|
static |
References Base::Console(), formatVector(), and Base::ConsoleSingleton::Message().
Referenced by TechDraw::DrawViewSection::getCSFromBase().
|
static |
References Base::Console(), formatVector(), and Base::ConsoleSingleton::Message().
|
static |
References Base::Console(), and Base::ConsoleSingleton::Message().
Referenced by dumpEdges().
|
static |
References Base::Console(), dumpEdge(), and Base::ConsoleSingleton::Message().
|
static |
References Base::Console(), and Base::ConsoleSingleton::Message().
|
static |
References findConicRectangleIntersections(), sqr(), Base::Vector2d::x, and Base::Vector2d::y.
Referenced by findCircularArcRectangleIntersections().
|
static |
References findCircleRectangleIntersections(), Base::Vector2d::FromPolar(), and mergeBoundedPoint().
|
static |
References findRootForValue(), and mergeBoundedPoint().
Referenced by findCircleRectangleIntersections(), and findLineRectangleIntersections().
|
static |
References findConicRectangleIntersections(), Base::Vector2d::FromPolar(), Base::Vector2d::x, and Base::Vector2d::y.
Referenced by findLineSegmentRectangleIntersections().
|
static |
References findLineRectangleIntersections(), Base::Vector2d::FromPolar(), and mergeBoundedPoint().
|
static |
References sqr().
Referenced by findConicRectangleIntersections().
|
static |
Referenced by TechDraw::CenterLine::CenterLineBuilder(), TechDraw::DrawViewPart::checkXDirection(), TechDraw::PATLineSpec::dump(), TechDraw::Vertex::dump(), TechDraw::edgeSortItem::dump(), dumpCS(), dumpCS3(), TechDrawGui::QGEPath::dumpGhostPoints(), TechDraw::DrawProjGroup::dumpISO(), and TechDrawGui::QGEPath::dumpMarkerPos().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
References draftutils.utils::tolerance().
Referenced by TechDraw::BSpline::asCircle(), boxIntersect2d(), TechDraw::CenterLine::calcEndPoints(), TechDraw::CenterLine::calcEndPoints2Lines(), TechDraw::CenterLine::calcEndPoints2Points(), TechDraw::CenterLine::calcEndPointsNoRef(), checkParallel(), TechDraw::DrawViewPart::checkXDirection(), TechDraw::DrawViewDetail::detailExec(), TechDraw::edgeSortItem::edgeEqual(), TechDraw::edgeSortItem::edgeLess(), TechDraw::DrawViewDimension::execute(), TechDraw::DrawViewMulti::execute(), TechDraw::DrawViewDimension::getFormattedDimensionValue(), TechDraw::DrawViewDimension::getFormattedToleranceValues(), TechDraw::DrawProjGroupItem::getLegacyX(), TechDraw::DrawProjGroup::getRect(), TechDraw::DrawViewPart::getXDirection(), TechDraw::DrawProjGroupItem::getXDirection(), TechDraw::DrawViewSection::getXDirection(), TechDraw::DrawViewDimension::hasOverUnderTolerance(), TechDraw::DrawViewDimension::haveTolerance(), Intersect2d(), isBetween(), TechDraw::DrawViewPart::isIso(), TechDraw::BSpline::isLine(), TechDraw::DrawViewPart::makeGeometryForShape(), TechDrawGui::QGIHighlight::makeReference(), TechDraw::DrawProjGroup::onChanged(), TechDraw::DrawViewPart::onChanged(), TechDrawGui::QGILeaderLine::onLineEditFinished(), TechDraw::DrawViewSection::sectionExec(), TechDraw::DrawView::setPosition(), TechDrawGui::QGIView::setPosition(), TechDrawGui::QGTracker::snapToAngle(), TechDrawGui::QGIView::updateView(), TechDraw::DrawView::validateScale(), and vectorLess().
|
static |
|
static |
Referenced by TechDraw::DrawGeomHatch::getTrimmedLinesSection().
|
static |
Referenced by TechDraw::CenterLine::calcEndPoints(), TechDraw::CenterLine::calcEndPoints2Lines(), TechDraw::CenterLine::calcEndPoints2Points(), TechDraw::CenterLine::CenterLineBuilder(), TechDraw::DrawViewDimension::checkReferences2D(), TechDrawGui::execHoleCircle(), TechDraw::DrawViewDimension::getPointsEdgeVert(), TechDraw::DrawViewDimension::getRefTypeSubElements(), TechDraw::DrawDimHelper::minMax(), and TechDrawGui::TaskCenterLine::TaskCenterLine().
|
static |
References Base::Console(), and Base::ConsoleSingleton::Log().
Referenced by TechDraw::DrawHatch::affectsFace(), TechDraw::CenterLine::calcEndPoints(), TechDraw::CenterLine::calcEndPoints2Lines(), TechDraw::CenterLine::calcEndPoints2Points(), TechDraw::DrawViewDimension::checkReferences2D(), TechDrawGui::TaskHatch::createHatch(), TechDrawGui::execHoleCircle(), TechDraw::DrawViewDimension::execute(), TechDrawGui::QGIViewPart::faceIsGeomHatched(), TechDraw::DrawHatch::faceIsHatched(), TechDrawGui::QGIViewPart::faceIsHatched(), TechDraw::CosmeticExtension::getCenterLineBySelection(), TechDraw::CosmeticExtension::getCosmeticEdgeBySelection(), TechDraw::CosmeticExtension::getCosmeticVertexBySelection(), TechDraw::CosmeticExtension::getGeomFormatBySelection(), TechDraw::DrawViewDimension::getPointsEdgeVert(), TechDraw::DrawViewDimension::getPointsOneEdge(), TechDraw::DrawViewDimension::getPointsTwoEdges(), TechDraw::DrawViewDimension::getPointsTwoVerts(), TechDraw::DrawViewDimension::leaderIntersectsArc(), TechDraw::DrawDimHelper::makeExtentDim(), and TechDraw::DrawDimHelper::minMax().
|
static |
Referenced by TechDraw::BSpline::asCircle(), and TechDraw::BSpline::isLine().
|
static |
References Base::Console(), fpCompare(), Base::ConsoleSingleton::Message(), Base::Vector2d::x, and Base::Vector2d::y.
|
static |
find intersection in 2d for 2 lines in point+direction form
References Base::Console(), fpCompare(), Base::ConsoleSingleton::Message(), Base::Vector3< _Precision >::x, and Base::Vector3< _Precision >::y.
|
static |
References angleNormalize(), and intervalMerge().
|
static |
References intervalMerge().
|
static |
Referenced by intervalMarkCircular(), and intervalMarkLinear().
|
static |
|
static |
|
static |
is pt between end1 and end2?
References fpCompare().
Referenced by TechDraw::DrawViewDimension::execute().
|
static |
|
static |
References isSamePoint(), and draftutils.utils::tolerance().
Referenced by angleWithX(), and TechDraw::EdgeWalker::makeEmbedding().
|
static |
References isSamePoint(), and draftutils.utils::tolerance().
Referenced by angleWithX(), and TechDraw::EdgeWalker::makeEmbedding().
|
static |
true if v1 and v2 are the same geometric point within tolerance
References draftutils.utils::tolerance().
Referenced by TechDraw::EdgeWalker::findUniqueVert(), isFirstVert(), isLastVert(), TechDraw::DrawProjectSplit::isOnEdge(), isZeroEdge(), and TechDraw::EdgeWalker::makeUniqueVList().
|
static |
References isSamePoint(), and draftutils.utils::tolerance().
Referenced by TechDraw::GeometryObject::addGeomFromCompound(), TechDraw::DrawViewPart::extractFaces(), and TechDraw::DrawProjectSplit::getEdges().
|
static |
References draftgeoutils.general::geomType().
|
static |
References Base::BoundBox2d::Contains().
Referenced by findCircularArcRectangleIntersections(), findConicRectangleIntersections(), and findLineSegmentRectangleIntersections().
|
static |
|
static |
|
static |
|
static |
Referenced by TechDraw::DrawView::autoScale(), and TechDraw::DrawProjGroup::calculateAutomaticScale().
|
static |
|
static |
|
static |
|
static |
References Base::Console(), and Base::ConsoleSingleton::Message().
Referenced by TechDraw::DrawProjectSplit::isOnEdge(), and TechDraw::BaseGeom::minDist().
|
static |
|
static |
Referenced by findCircleRectangleIntersections(), and findRootForValue().
|
static |
|
static |
convert fromPoint in coordinate system fromSystem to reference coordinate system
References Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by TechDraw::DrawViewDetail::detailExec().
|
static |
|
static |
rotate vector by angle radians around axis through org
References Base::Matrix4D::rotLine(), and draftgeoutils.general::vec().
Referenced by TechDraw::DrawViewSection::sectionLineEnds(), and TechDraw::DrawProjGroup::spin().
|
static |
compare 2 vectors for sorting - true if v1 < v2
References fpCompare().
Referenced by TechDraw::edgeSortItem::edgeLess(), and TechDraw::DrawProjectSplit::removeDuplicateEdges().
|
static |
|
static |