Base: Use explicit pointer syntax for freecad_cast (#20694)

* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
This commit is contained in:
Kacper Donat
2025-04-11 16:11:33 +02:00
committed by GitHub
parent 02bb799209
commit 77e40b9747
73 changed files with 305 additions and 304 deletions

View File

@@ -52,7 +52,7 @@ void MultiTransform::positionBySupport()
PartDesign::Transformed::positionBySupport();
std::vector<App::DocumentObject*> transFeatures = Transformations.getValues();
for (auto f : transFeatures) {
auto transFeature = freecad_cast<PartDesign::Transformed>(f);
auto transFeature = freecad_cast<PartDesign::Transformed*>(f);
if (!transFeature) {
throw Base::TypeError("Transformation features must be subclasses of Transformed");
}
@@ -85,7 +85,7 @@ MultiTransform::getTransformations(const std::vector<App::DocumentObject*> origi
// Find centre of gravity of first original
// FIXME: This method will NOT give the expected result for more than one original!
if (auto addFeature =
freecad_cast<PartDesign::FeatureAddSub>(originals.front())) {
freecad_cast<PartDesign::FeatureAddSub*>(originals.front())) {
TopoDS_Shape original = addFeature->AddSubShape.getShape().getShape();
GProp_GProps props;
@@ -98,7 +98,7 @@ MultiTransform::getTransformations(const std::vector<App::DocumentObject*> origi
std::list<gp_Pnt> cogs;
for (auto const& f : transFeatures) {
auto transFeature = freecad_cast<PartDesign::Transformed>(f);
auto transFeature = freecad_cast<PartDesign::Transformed*>(f);
if (!transFeature) {
throw Base::TypeError("Transformation features must be subclasses of Transformed");
}