Mod: Convert from dynamic to static casts (#20452)

This commit is contained in:
Jonathan Zirkle
2025-03-31 09:17:51 -04:00
committed by GitHub
parent 487c62a663
commit ee6f757c57
2 changed files with 6 additions and 6 deletions

View File

@@ -70,7 +70,7 @@ bool StdCmdMeasure::isActive()
Gui::MDIView* view = Gui::getMainWindow()->activeWindow();
if (view && view->isDerivedFrom<Gui::View3DInventor>()) {
Gui::View3DInventorViewer* viewer = dynamic_cast<Gui::View3DInventor*>(view)->getViewer();
Gui::View3DInventorViewer* viewer = static_cast<Gui::View3DInventor*>(view)->getViewer();
return !viewer->isEditing();
}
return false;

View File

@@ -765,8 +765,8 @@ GeomLineSegment* GeomCurve::toLineSegment(KeepTag clone) const
Base::Vector3d start, end;
if (isDerivedFrom<GeomBoundedCurve>()) {
start = dynamic_cast<const GeomBoundedCurve*>(this)->getStartPoint();
end = dynamic_cast<const GeomBoundedCurve*>(this)->getEndPoint();
start = static_cast<const GeomBoundedCurve*>(this)->getStartPoint();
end = static_cast<const GeomBoundedCurve*>(this)->getEndPoint();
} else {
start = pointAtParameter(getFirstParameter());
end = pointAtParameter(getLastParameter());
@@ -4527,7 +4527,7 @@ bool GeomLine::isSame(const Geometry &_other, double tol, double atol) const
{
if(_other.getTypeId() != getTypeId()) {
if (_other.isDerivedFrom<GeomCurve>()) {
std::unique_ptr<Geometry> geo(dynamic_cast<const GeomCurve&>(_other).toLine());
std::unique_ptr<Geometry> geo(static_cast<const GeomCurve&>(_other).toLine());
if (geo)
return isSame(*geo, tol, atol);
}
@@ -4819,10 +4819,10 @@ GeomPlane* GeomSurface::toPlane(bool clone, double tol) const
{
if (isDerivedFrom<GeomPlane>()) {
if (clone) {
return dynamic_cast<GeomPlane*>(this->clone());
return static_cast<GeomPlane*>(this->clone());
}
else {
return dynamic_cast<GeomPlane*>(this->copy());
return static_cast<GeomPlane*>(this->copy());
}
}