Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
This commit is contained in:
@@ -368,9 +368,7 @@ void ExportOCAF::reallocateFreeShape(std::vector<App::DocumentObject*> hierarchi
|
||||
for (std::size_t i = 0; i < n; i++) {
|
||||
TDF_Label label = FreeLabels.at(i);
|
||||
// hierarchical part does contain only part currently and not node I should add node
|
||||
if (hierarchical_part.at(part_id.at(i))
|
||||
->getTypeId()
|
||||
.isDerivedFrom(Part::Feature::getClassTypeId())) {
|
||||
if (hierarchical_part.at(part_id.at(i))->isDerivedFrom<Part::Feature>()) {
|
||||
Part::Feature* part = static_cast<Part::Feature*>(hierarchical_part.at(part_id.at(i)));
|
||||
aShapeTool->SetShape(label, part->Shape.getValue());
|
||||
// Add color information
|
||||
|
||||
@@ -561,7 +561,7 @@ App::DocumentObject* ImportOCAF2::loadShapes()
|
||||
if (ret) {
|
||||
ret->recomputeFeature(true);
|
||||
}
|
||||
if (options.merge && ret && !ret->isDerivedFrom(Part::Feature::getClassTypeId())) {
|
||||
if (options.merge && ret && !ret->isDerivedFrom<Part::Feature>()) {
|
||||
auto shape = Part::Feature::getTopoShape(ret);
|
||||
auto feature =
|
||||
static_cast<Part::Feature*>(pDocument->addObject("Part::Feature", "Feature"));
|
||||
|
||||
@@ -38,7 +38,7 @@ ExportOCAFGui::ExportOCAFGui(Handle(TDocStd_Document) hDoc, bool explicitPlaceme
|
||||
void ExportOCAFGui::findColors(Part::Feature* part, std::vector<App::Color>& colors) const
|
||||
{
|
||||
Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part);
|
||||
if (vp && vp->isDerivedFrom(PartGui::ViewProviderPartExt::getClassTypeId())) {
|
||||
if (vp && vp->isDerivedFrom<PartGui::ViewProviderPartExt>()) {
|
||||
colors = static_cast<PartGui::ViewProviderPartExt*>(vp)->ShapeAppearance.getDiffuseColors();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user