[TD]fix dimension autocorrect

- autocorrect was not handling scaled and rotated reference geometry
  properly.
This commit is contained in:
wandererfan
2024-05-05 20:38:14 -04:00
parent 15b612ebca
commit d2d93458e9
17 changed files with 701 additions and 563 deletions

View File

@@ -39,25 +39,12 @@ namespace TechDraw
class TechDrawExport GeometryMatcher
{
public:
GeometryMatcher()
{}
explicit GeometryMatcher(DrawViewDimension* dim)
{
m_dimension = dim;
}
~GeometryMatcher() = default;
GeometryMatcher() :
m_dimension(nullptr) {}
explicit GeometryMatcher(DrawViewDimension* dim) :
m_dimension(dim) {}
bool compareGeometry(Part::TopoShape geom1, Part::TopoShape geom2);
bool comparePoints(TopoDS_Shape& shape1, TopoDS_Shape& shape2);
bool compareEdges(TopoDS_Shape& shape1, TopoDS_Shape& shape2);
bool compareLines(TopoDS_Edge& edge1, TopoDS_Edge& edge2);
bool compareCircles(TopoDS_Edge& edge1, TopoDS_Edge& edge2);
bool compareEllipses(TopoDS_Edge& edge1, TopoDS_Edge& edge2);
bool compareBSplines(TopoDS_Edge& edge1, TopoDS_Edge& edge2);
bool compareDifferent(TopoDS_Edge& edge1, TopoDS_Edge& edge2);
bool compareCircleArcs(TopoDS_Edge& edge1, TopoDS_Edge& edge2);
bool compareEllipseArcs(TopoDS_Edge& edge1, TopoDS_Edge& edge2);
bool compareGeometry(const Part::TopoShape& geom1, const Part::TopoShape& geom2);
double getPointTolerance() const
{
@@ -69,7 +56,18 @@ public:
}
private:
bool compareEndPoints(TopoDS_Edge& edge1, TopoDS_Edge& edge2);
static bool comparePoints(const TopoDS_Shape& shape1, const TopoDS_Shape& shape2);
static bool compareEdges(const TopoDS_Shape& shape1, const TopoDS_Shape& shape2);
static bool compareLines(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2);
static bool compareCircles(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2);
static bool compareEllipses(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2);
static bool compareBSplines(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2);
static bool compareDifferent(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2);
static bool compareCircleArcs(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2);
static bool compareEllipseArcs(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2);
static bool compareEndPoints(const TopoDS_Edge& edge1, const TopoDS_Edge& edge2);
DrawViewDimension* m_dimension;
double m_pointTolerance {EWTOLERANCE};