stl file. However, I cannot find the StlMesh_Mesh.hxx file and the StlMesh_MeshExplorer.hxx file in the installed opencascade. Where can I find the file?
You are right. There are not any leak, it is a smart pointer creating.
Handle - OCCT smart pointer. Moreover it is a macros, the own smart pointer type is "opencascade::handle". But it has a little different from std::shared_pointer or other std smart pointeres. It it the same with boost::intrusive_ptr
Wed, 01/04/2023 - 09:04
bool ImportSTL(const TCollection_AsciiString& theFileName)
{
StlAPI_Reader aReader;
TopoDS_Shape aShape;
Standard_Boolean isResult = aReader.Read(aShape, theFileName.ToCString());
if (!isResult)
{
return false;
}
myAISContext()->Display(new AIS_Shape(aShape), Standard_True);
return true;
}
Wed, 01/04/2023 - 09:04
The StlMesh_Mesh.hxx file is no longer required.
Wed, 04/26/2023 - 12:35
//myAISContext()->Display(new AIS_Shape(aShape), Standard_True);
new AIS_Shape(aShape) should be Handle?
Wed, 04/26/2023 - 12:40
Hello, please check the next link:https://dev.opencascade.org/doc/overview/html/occt_user_guides__visualiz...
Yes, it should.
Best regards, Dmitrii.
Fri, 04/28/2023 - 18:33
> new AIS_Shape(aShape)
Seems like leaked pointer. Unless it's some smart pointer structure
Sat, 04/29/2023 - 01:38
You are right. There are not any leak, it is a smart pointer creating.
Handle - OCCT smart pointer. Moreover it is a macros, the own smart pointer type is "opencascade::handle". But it has a little different from std::shared_pointer or other std smart pointeres. It it the same with boost::intrusive_ptr
Best regards, Dmitrii.