Mod: Use new addObject<T>(...) using regex
This commit is contained in:
@@ -159,7 +159,7 @@ void CmdMeshPartTrimByPlane::activated(int)
|
||||
|
||||
copy.trimByPlane(plnBase, -plnNormal);
|
||||
App::Document* doc = it->getDocument();
|
||||
Mesh::Feature* fea = static_cast<Mesh::Feature*>(doc->addObject("Mesh::Feature"));
|
||||
Mesh::Feature* fea = doc->addObject<Mesh::Feature>();
|
||||
fea->Label.setValue(it->Label.getValue());
|
||||
Mesh::MeshObject* feamesh = fea->Mesh.startEditing();
|
||||
feamesh->swap(copy);
|
||||
|
||||
@@ -327,8 +327,7 @@ void CrossSections::apply()
|
||||
App::Document* doc = it->getDocument();
|
||||
std::string s = it->getNameInDocument();
|
||||
s += "_cs";
|
||||
Part::Feature* section =
|
||||
static_cast<Part::Feature*>(doc->addObject("Part::Feature", s.c_str()));
|
||||
Part::Feature* section = doc->addObject<Part::Feature>(s.c_str());
|
||||
section->Shape.setValue(comp);
|
||||
section->purgeTouched();
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ void CurveOnMeshHandler::displaySpline(const Handle(Geom_BSplineCurve) & spline)
|
||||
Gui::View3DInventorViewer* view3d = d_ptr->viewer->getViewer();
|
||||
App::Document* doc = view3d->getDocument()->getDocument();
|
||||
doc->openTransaction("Add spline");
|
||||
Part::Feature* part = static_cast<Part::Feature*>(doc->addObject("Part::Spline", "Spline"));
|
||||
Part::Feature* part = doc->addObject<Part::Feature>("Spline");
|
||||
part->Shape.setValue(edge);
|
||||
doc->commitTransaction();
|
||||
}
|
||||
@@ -562,8 +562,7 @@ void CurveOnMeshHandler::displayPolyline(const TopoDS_Wire& wire)
|
||||
Gui::View3DInventorViewer* view3d = d_ptr->viewer->getViewer();
|
||||
App::Document* doc = view3d->getDocument()->getDocument();
|
||||
doc->openTransaction("Add polyline");
|
||||
Part::Feature* part =
|
||||
static_cast<Part::Feature*>(doc->addObject("Part::Feature", "Polyline"));
|
||||
Part::Feature* part = doc->addObject<Part::Feature>("Polyline");
|
||||
part->Shape.setValue(wire);
|
||||
doc->commitTransaction();
|
||||
}
|
||||
|
||||
@@ -655,7 +655,7 @@ bool Mesh2ShapeGmsh::loadOutput()
|
||||
stlIn.close();
|
||||
kernel.harmonizeNormals();
|
||||
|
||||
auto fea = static_cast<Mesh::Feature*>(doc->addObject("Mesh::Feature", "Mesh"));
|
||||
auto fea = doc->addObject<Mesh::Feature>("Mesh");
|
||||
fea->Label.setValue(d->label);
|
||||
fea->Mesh.setValue(kernel.getKernel());
|
||||
stl.deleteFile();
|
||||
|
||||
Reference in New Issue
Block a user