TechDraw: Use freecad_cast whenever possible

This commit is contained in:
Kacper Donat
2025-04-25 00:05:45 +02:00
committed by Benjamin Nauck
parent 81c772938e
commit d9d518f905
45 changed files with 94 additions and 94 deletions

View File

@@ -300,7 +300,7 @@ void QGIViewPart::drawAllFaces(void)
newFace->setHatchOffset(fGeom->PatternOffset.getValue());
newFace->setHatchFile(fGeom->PatIncluded.getValue());
Gui::ViewProvider* gvp = QGIView::getViewProvider(fGeom);
ViewProviderGeomHatch* geomVp = dynamic_cast<ViewProviderGeomHatch*>(gvp);
ViewProviderGeomHatch* geomVp = freecad_cast<ViewProviderGeomHatch*>(gvp);
if (geomVp) {
newFace->setHatchColor(geomVp->ColorPattern.getValue());
newFace->setLineWeight(geomVp->WeightPattern.getValue());
@@ -321,7 +321,7 @@ void QGIViewPart::drawAllFaces(void)
// get the properties from the hatch viewprovider
Gui::ViewProvider* gvp = QGIView::getViewProvider(fHatch);
ViewProviderHatch* hatchVp = dynamic_cast<ViewProviderHatch*>(gvp);
ViewProviderHatch* hatchVp = freecad_cast<ViewProviderHatch*>(gvp);
if (hatchVp) {
if (hatchVp->HatchScale.getValue() > 0.0) {
newFace->setHatchScale(hatchVp->HatchScale.getValue());
@@ -993,7 +993,7 @@ void QGIViewPart::highlightMoved(QGIHighlight* highlight, QPointF newPos)
std::string highlightName = highlight->getFeatureName();
App::Document* doc = getViewObject()->getDocument();
App::DocumentObject* docObj = doc->getObject(highlightName.c_str());
auto detail = dynamic_cast<DrawViewDetail*>(docObj);
auto detail = freecad_cast<DrawViewDetail*>(docObj);
if (detail) {
auto oldAnchor = detail->AnchorPoint.getValue();
Base::Vector3d delta = Rez::appX(DrawUtil::toVector3d(newPos)) / getViewObject()->getScale();