TechDraw: Use freecad_cast whenever possible
This commit is contained in:
committed by
Benjamin Nauck
parent
81c772938e
commit
d9d518f905
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user