1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0031504: Data Exchange - Wrong output of progress indicator when writing to stl

Added new condition for first indicated element at Draw_ProgressIndicator::Show(),
because it’s more logical that at start progress starts at 0
Changed usage of Next() to Next(step) for increment progress to IND_THRESHOLD in RWStl::writeASCII() and RWStl::writeBinary()
Changed condition for continuation of writing and add interrupt to this function
Added possibility to use Progress indicator in writestl
Changed paremeter in constructor Message_ProgressSentry aPS() IND_THRESHOLD to 1
Changed test
This commit is contained in:
akaftasev
2020-05-22 13:04:49 +03:00
committed by bugmaster
parent 59ec2ccec9
commit 1fc1a207b0
8 changed files with 59 additions and 16 deletions

View File

@@ -41,7 +41,8 @@ StlAPI_Writer::StlAPI_Writer()
//purpose :
//=============================================================================
Standard_Boolean StlAPI_Writer::Write (const TopoDS_Shape& theShape,
const Standard_CString theFileName)
const Standard_CString theFileName,
const Handle(Message_ProgressIndicator)& theProgress)
{
Standard_Integer aNbNodes = 0;
Standard_Integer aNbTriangles = 0;
@@ -125,8 +126,8 @@ Standard_Boolean StlAPI_Writer::Write (const TopoDS_Shape& theShape,
OSD_Path aPath (theFileName);
Standard_Boolean isDone = (myASCIIMode
? RWStl::WriteAscii (aMesh, aPath)
: RWStl::WriteBinary (aMesh, aPath));
? RWStl::WriteAscii(aMesh, aPath, theProgress)
: RWStl::WriteBinary(aMesh, aPath, theProgress));
if (isDone && (aNbFacesNoTri > 0))
{

View File

@@ -22,6 +22,7 @@
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Message_ProgressIndicator.hxx>
class TopoDS_Shape;
@@ -45,7 +46,8 @@ public:
//! Converts a given shape to STL format and writes it to file with a given filename.
//! \return the error state.
Standard_EXPORT Standard_Boolean Write (const TopoDS_Shape& theShape,
const Standard_CString theFileName);
const Standard_CString theFileName,
const Handle(Message_ProgressIndicator)& theProgress = NULL);
private:
Standard_Boolean myASCIIMode;