[TD]fix location of CV on rotated views

This commit is contained in:
wandererfan
2023-12-22 11:12:10 -05:00
committed by WandererFan
parent 2fe19267df
commit e6517089df
12 changed files with 155 additions and 69 deletions

View File

@@ -44,6 +44,7 @@
using namespace TechDraw;
using namespace std;
using DU = DrawUtil;
#define GEOMETRYEDGE 0
#define COSMETICEDGE 1
@@ -215,6 +216,19 @@ TechDraw::BaseGeomPtr CosmeticEdge::scaledAndRotatedGeometry(const double scale,
return newGeom;
}
//! makes an unscaled, unrotated line from two scaled & rotated end points. If points is Gui space coordinates,
//! they should be inverted (DU::invertY) before calling this method.
//! the result of this method should be used in addCosmeticEdge().
TechDraw::BaseGeomPtr CosmeticEdge::makeCanonicalLine(DrawViewPart* dvp, Base::Vector3d start, Base::Vector3d end)
{
Base::Vector3d cStart = CosmeticVertex::makeCanonicalPoint(dvp, start);
Base::Vector3d cEnd = CosmeticVertex::makeCanonicalPoint(dvp, end);
gp_Pnt gStart = DU::togp_Pnt(cStart);
gp_Pnt gEnd = DU::togp_Pnt(cEnd);
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(gStart, gEnd);
return TechDraw::BaseGeom::baseFactory(edge)->inverted();
}
std::string CosmeticEdge::toString() const
{
std::stringstream ss;