[TD]Rotate CosmeticEdge with View

This commit is contained in:
wandererfan
2023-07-20 21:25:23 -04:00
committed by WandererFan
parent a40033ef9a
commit 8e52a0baf8
5 changed files with 81 additions and 43 deletions

View File

@@ -193,6 +193,25 @@ TechDraw::BaseGeomPtr CosmeticEdge::scaledGeometry(const double scale)
return newGeom;
}
TechDraw::BaseGeomPtr CosmeticEdge::scaledAndRotatedGeometry(const double scale, const double rotDegrees)
{
TopoDS_Edge e = m_geometry->getOCCEdge();
// TopoDS_Shape s = TechDraw::scaleShape(e, scale);
// Mirror shape in Y and scale
TopoDS_Shape s = TechDraw::mirrorShape(e, gp_Pnt(0.0, 0.0, 0.0), scale);
// rotate using OXYZ as the coordinate system
s = TechDraw::rotateShape(s, gp_Ax2(), rotDegrees);
s = TechDraw::mirrorShape(s);
TopoDS_Edge newEdge = TopoDS::Edge(s);
TechDraw::BaseGeomPtr newGeom = TechDraw::BaseGeom::baseFactory(newEdge);
newGeom->setClassOfEdge(ecHARD);
newGeom->setHlrVisible( true);
newGeom->setCosmetic(true);
newGeom->source(COSMETICEDGE);
newGeom->setCosmeticTag(getTagAsString());
return newGeom;
}
std::string CosmeticEdge::toString() const
{
std::stringstream ss;