Part: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:38:52 +02:00
parent 1a83d18a8f
commit eb55f1fe52
22 changed files with 46 additions and 46 deletions

View File

@@ -102,7 +102,7 @@ void ViewProviderSplineExtension::extensionSetupContextMenu(QMenu* menu, QObject
void ViewProviderSplineExtension::extensionUpdateData(const App::Property* prop)
{
Gui::ViewProviderExtension::extensionUpdateData(prop);
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId() && strcmp(prop->getName(), "Shape") == 0) {
if (prop->is<Part::PropertyPartShape>() && strcmp(prop->getName(), "Shape") == 0) {
// update control points if there
if (pcControlPoints) {
Gui::coinRemoveAllChildren(pcControlPoints);
@@ -139,7 +139,7 @@ void ViewProviderSplineExtension::showControlPoints(bool show, const App::Proper
return;
// ask for the property we are interested in
if (prop && prop->getTypeId() == Part::PropertyPartShape::getClassTypeId()) {
if (prop && prop->is<Part::PropertyPartShape>()) {
const TopoDS_Shape& shape = static_cast<const Part::PropertyPartShape*>(prop)->getValue();
if (shape.IsNull())
return; // empty shape