Modernize code, replace Handle_<X> with Handle(X)

Same like c35297a8fb158be47772cb5fc9cee76ca88ff871
This commit is contained in:
Stefan Brüns 2021-03-10 01:57:16 +01:00
parent 8abd52a47b
commit cf4d9eff33
2 changed files with 19 additions and 19 deletions

View File

@ -282,7 +282,7 @@ namespace netgen
double surfacecont = 0; double surfacecont = 0;
{ {
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
rebuild->Apply(shape); rebuild->Apply(shape);
for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next()) for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next())
{ {
@ -313,7 +313,7 @@ namespace netgen
cout << endl << "- repairing faces" << endl; cout << endl << "- repairing faces" << endl;
Handle(ShapeFix_Face) sff; Handle(ShapeFix_Face) sff;
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
rebuild->Apply(shape); rebuild->Apply(shape);
@ -370,7 +370,7 @@ namespace netgen
{ {
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
rebuild->Apply(shape); rebuild->Apply(shape);
for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next()) for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next())
{ {
@ -387,7 +387,7 @@ namespace netgen
cout << endl << "- fixing small edges" << endl; cout << endl << "- fixing small edges" << endl;
Handle(ShapeFix_Wire) sfw; Handle(ShapeFix_Wire) sfw;
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
rebuild->Apply(shape); rebuild->Apply(shape);
@ -454,7 +454,7 @@ namespace netgen
{ {
BuildFMap(); BuildFMap();
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
rebuild->Apply(shape); rebuild->Apply(shape);
for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next()) for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next())
@ -482,7 +482,7 @@ namespace netgen
{ {
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
rebuild->Apply(shape); rebuild->Apply(shape);
for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next()) for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next())
{ {
@ -608,7 +608,7 @@ namespace netgen
{ {
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
rebuild->Apply(shape); rebuild->Apply(shape);
for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next()) for (exp1.Init (shape, TopAbs_EDGE); exp1.More(); exp1.Next())
{ {
@ -653,7 +653,7 @@ namespace netgen
TopoDS_Solid solid = TopoDS::Solid(exp0.Current()); TopoDS_Solid solid = TopoDS::Solid(exp0.Current());
TopoDS_Solid newsolid = solid; TopoDS_Solid newsolid = solid;
BRepLib::OrientClosedSolid (newsolid); BRepLib::OrientClosedSolid (newsolid);
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
// rebuild->Apply(shape); // rebuild->Apply(shape);
rebuild->Replace(solid, newsolid); rebuild->Replace(solid, newsolid);
TopoDS_Shape newshape = rebuild->Apply(shape, TopAbs_COMPSOLID);//, 1); TopoDS_Shape newshape = rebuild->Apply(shape, TopAbs_COMPSOLID);//, 1);
@ -1076,7 +1076,7 @@ namespace netgen
TopoDS_Solid solid = TopoDS::Solid(exp0.Current()); TopoDS_Solid solid = TopoDS::Solid(exp0.Current());
TopoDS_Solid newsolid = solid; TopoDS_Solid newsolid = solid;
BRepLib::OrientClosedSolid (newsolid); BRepLib::OrientClosedSolid (newsolid);
Handle_ShapeBuild_ReShape rebuild = new ShapeBuild_ReShape; Handle(ShapeBuild_ReShape) rebuild = new ShapeBuild_ReShape;
rebuild->Replace(solid, newsolid); rebuild->Replace(solid, newsolid);
TopoDS_Shape newshape = rebuild->Apply(shape, TopAbs_SHAPE, 1); TopoDS_Shape newshape = rebuild->Apply(shape, TopAbs_SHAPE, 1);
@ -1408,10 +1408,10 @@ namespace netgen
static Timer timer_getnames("LoadOCC-get names"); static Timer timer_getnames("LoadOCC-get names");
// Initiate a dummy XCAF Application to handle the STEP XCAF Document // Initiate a dummy XCAF Application to handle the STEP XCAF Document
static Handle_XCAFApp_Application dummy_app = XCAFApp_Application::GetApplication(); static Handle(XCAFApp_Application) dummy_app = XCAFApp_Application::GetApplication();
// Create an XCAF Document to contain the STEP file itself // Create an XCAF Document to contain the STEP file itself
Handle_TDocStd_Document step_doc; Handle(TDocStd_Document) step_doc;
// Check if a STEP File is already open under this handle, if so, close it to prevent // Check if a STEP File is already open under this handle, if so, close it to prevent
// Segmentation Faults when trying to create a new document // Segmentation Faults when trying to create a new document
@ -1441,8 +1441,8 @@ namespace netgen
timer_transfer.Stop(); timer_transfer.Stop();
// Read in the shape(s) and the colours present in the STEP File // Read in the shape(s) and the colours present in the STEP File
Handle_XCAFDoc_ShapeTool step_shape_contents = XCAFDoc_DocumentTool::ShapeTool(step_doc->Main()); Handle(XCAFDoc_ShapeTool) step_shape_contents = XCAFDoc_DocumentTool::ShapeTool(step_doc->Main());
Handle_XCAFDoc_ColorTool step_colour_contents = XCAFDoc_DocumentTool::ColorTool(step_doc->Main()); Handle(XCAFDoc_ColorTool) step_colour_contents = XCAFDoc_DocumentTool::ColorTool(step_doc->Main());
TDF_LabelSequence step_shapes; TDF_LabelSequence step_shapes;
step_shape_contents->GetShapes(step_shapes); step_shape_contents->GetShapes(step_shapes);
@ -1567,10 +1567,10 @@ namespace netgen
OCCGeometry *occgeo; OCCGeometry *occgeo;
occgeo = new OCCGeometry; occgeo = new OCCGeometry;
// Initiate a dummy XCAF Application to handle the IGES XCAF Document // Initiate a dummy XCAF Application to handle the IGES XCAF Document
static Handle_XCAFApp_Application dummy_app = XCAFApp_Application::GetApplication(); static Handle(XCAFApp_Application) dummy_app = XCAFApp_Application::GetApplication();
// Create an XCAF Document to contain the IGES file itself // Create an XCAF Document to contain the IGES file itself
Handle_TDocStd_Document iges_doc; Handle(TDocStd_Document) iges_doc;
// Check if a IGES File is already open under this handle, if so, close it to prevent // Check if a IGES File is already open under this handle, if so, close it to prevent
// Segmentation Faults when trying to create a new document // Segmentation Faults when trying to create a new document
@ -1596,8 +1596,8 @@ namespace netgen
reader.Transfer(iges_doc); reader.Transfer(iges_doc);
// Read in the shape(s) and the colours present in the IGES File // Read in the shape(s) and the colours present in the IGES File
Handle_XCAFDoc_ShapeTool iges_shape_contents = XCAFDoc_DocumentTool::ShapeTool(iges_doc->Main()); Handle(XCAFDoc_ShapeTool) iges_shape_contents = XCAFDoc_DocumentTool::ShapeTool(iges_doc->Main());
Handle_XCAFDoc_ColorTool iges_colour_contents = XCAFDoc_DocumentTool::ColorTool(iges_doc->Main()); Handle(XCAFDoc_ColorTool) iges_colour_contents = XCAFDoc_DocumentTool::ColorTool(iges_doc->Main());
TDF_LabelSequence iges_shapes; TDF_LabelSequence iges_shapes;
iges_shape_contents->GetShapes(iges_shapes); iges_shape_contents->GetShapes(iges_shapes);
@ -1667,7 +1667,7 @@ namespace netgen
// Fixed a bug in the OpenCascade XDE Colour handling when // Fixed a bug in the OpenCascade XDE Colour handling when
// opening BREP Files, since BREP Files have no colour data. // opening BREP Files, since BREP Files have no colour data.
// Hence, the face_colours Handle needs to be created as a NULL handle. // Hence, the face_colours Handle needs to be created as a NULL handle.
occgeo->face_colours = Handle_XCAFDoc_ColorTool(); occgeo->face_colours = Handle(XCAFDoc_ColorTool)();
occgeo->face_colours.Nullify(); occgeo->face_colours.Nullify();
occgeo->changed = 1; occgeo->changed = 1;
occgeo->BuildFMap(); occgeo->BuildFMap();

View File

@ -221,7 +221,7 @@ namespace netgen
// OpenCascade XDE Support // OpenCascade XDE Support
// XCAF Handle to make the face colours available to the rest of // XCAF Handle to make the face colours available to the rest of
// the system // the system
Handle_XCAFDoc_ColorTool face_colours; Handle(XCAFDoc_ColorTool) face_colours;
mutable int changed; mutable int changed;
mutable NgArray<int> facemeshstatus; mutable NgArray<int> facemeshstatus;