mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0031353: TDocStd_Application does not have api to set progress indicator
Add support of Message_ProgressIndicator in BinTools classes. Add support of Message_ProgressIndicator with possibility of user break in methods of opening and saving TDocStd_Application. Add tests of ProgressIndicator in TDocStd_Applacation.
This commit is contained in:
@@ -496,15 +496,15 @@ void GeomTools_Curve2dSet::Dump(Standard_OStream& OS)const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_Curve2dSet::Write(Standard_OStream& OS)const
|
||||
void GeomTools_Curve2dSet::Write (Standard_OStream& OS,
|
||||
const Handle(Message_ProgressIndicator) &theProgress)const
|
||||
{
|
||||
std::streamsize prec = OS.precision(17);
|
||||
|
||||
Standard_Integer i, nbsurf = myMap.Extent();
|
||||
OS << "Curve2ds "<< nbsurf << "\n";
|
||||
//OCC19559
|
||||
Handle(Message_ProgressIndicator) progress = GetProgress();
|
||||
Message_ProgressSentry PS(progress, "2D Curves", 0, nbsurf, 1);
|
||||
Message_ProgressSentry PS(theProgress, "2D Curves", 0, nbsurf, 1);
|
||||
for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
|
||||
PrintCurve2d(Handle(Geom2d_Curve)::DownCast(myMap(i)),OS,Standard_True);
|
||||
}
|
||||
@@ -840,7 +840,8 @@ Handle(Geom2d_Curve) GeomTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_Curve2dSet::Read(Standard_IStream& IS)
|
||||
void GeomTools_Curve2dSet::Read (Standard_IStream& IS,
|
||||
const Handle(Message_ProgressIndicator) &theProgress)
|
||||
{
|
||||
char buffer[255];
|
||||
IS >> buffer;
|
||||
@@ -852,32 +853,9 @@ void GeomTools_Curve2dSet::Read(Standard_IStream& IS)
|
||||
Standard_Integer i, nbcurve;
|
||||
IS >> nbcurve;
|
||||
//OCC19559
|
||||
Handle(Message_ProgressIndicator) progress = GetProgress();
|
||||
Message_ProgressSentry PS(progress, "2D Curves", 0, nbcurve, 1);
|
||||
Message_ProgressSentry PS(theProgress, "2D Curves", 0, nbcurve, 1);
|
||||
for (i = 1; i <= nbcurve && PS.More(); i++, PS.Next()) {
|
||||
Handle(Geom2d_Curve) C = GeomTools_Curve2dSet::ReadCurve2d (IS);
|
||||
myMap.Add(C);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Message_ProgressIndicator) GeomTools_Curve2dSet::GetProgress() const
|
||||
{
|
||||
return myProgress;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_Curve2dSet::SetProgress(const Handle(Message_ProgressIndicator)& PR)
|
||||
{
|
||||
myProgress = PR;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -60,48 +60,29 @@ public:
|
||||
|
||||
//! Writes the content of me on the stream <OS> in a
|
||||
//! format that can be read back by Read.
|
||||
Standard_EXPORT void Write (Standard_OStream& OS) const;
|
||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||
const Handle(Message_ProgressIndicator) &theProgress = NULL) const;
|
||||
|
||||
//! Reads the content of me from the stream <IS>. me
|
||||
//! is first cleared.
|
||||
Standard_EXPORT void Read (Standard_IStream& IS);
|
||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||
const Handle(Message_ProgressIndicator) &theProgress = NULL);
|
||||
|
||||
//! Dumps the curve on the stream, if compact is True
|
||||
//! use the compact format that can be read back.
|
||||
Standard_EXPORT static void PrintCurve2d (const Handle(Geom2d_Curve)& C, Standard_OStream& OS, const Standard_Boolean compact = Standard_False);
|
||||
Standard_EXPORT static void PrintCurve2d (const Handle(Geom2d_Curve)& C,
|
||||
Standard_OStream& OS,
|
||||
const Standard_Boolean compact = Standard_False);
|
||||
|
||||
//! Reads the curve from the stream. The curve is
|
||||
//! assumed to have been written with the Print
|
||||
//! method (compact = True).
|
||||
Standard_EXPORT static Handle(Geom2d_Curve) ReadCurve2d (Standard_IStream& IS);
|
||||
|
||||
Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& PR);
|
||||
|
||||
Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TColStd_IndexedMapOfTransient myMap;
|
||||
Handle(Message_ProgressIndicator) myProgress;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomTools_Curve2dSet_HeaderFile
|
||||
|
@@ -513,15 +513,15 @@ void GeomTools_CurveSet::Dump(Standard_OStream& OS)const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_CurveSet::Write(Standard_OStream& OS)const
|
||||
void GeomTools_CurveSet::Write (Standard_OStream& OS,
|
||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
||||
{
|
||||
std::streamsize prec = OS.precision(17);
|
||||
|
||||
Standard_Integer i, nbcurve = myMap.Extent();
|
||||
OS << "Curves "<< nbcurve << "\n";
|
||||
//OCC19559
|
||||
Handle(Message_ProgressIndicator) progress = GetProgress();
|
||||
Message_ProgressSentry PS(progress, "3D Curves", 0, nbcurve, 1);
|
||||
Message_ProgressSentry PS(theProgress, "3D Curves", 0, nbcurve, 1);
|
||||
for (i = 1; i <= nbcurve && PS.More(); i++, PS.Next()) {
|
||||
PrintCurve(Handle(Geom_Curve)::DownCast(myMap(i)),OS,Standard_True);
|
||||
}
|
||||
@@ -861,7 +861,8 @@ Handle(Geom_Curve) GeomTools_CurveSet::ReadCurve (Standard_IStream& IS)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_CurveSet::Read(Standard_IStream& IS)
|
||||
void GeomTools_CurveSet::Read (Standard_IStream& IS,
|
||||
const Handle(Message_ProgressIndicator)& theProgress)
|
||||
{
|
||||
char buffer[255];
|
||||
IS >> buffer;
|
||||
@@ -873,32 +874,9 @@ void GeomTools_CurveSet::Read(Standard_IStream& IS)
|
||||
Standard_Integer i, nbcurve;
|
||||
IS >> nbcurve;
|
||||
//OCC19559
|
||||
Handle(Message_ProgressIndicator) progress = GetProgress();
|
||||
Message_ProgressSentry PS(progress, "3D Curves", 0, nbcurve, 1);
|
||||
Message_ProgressSentry PS(theProgress, "3D Curves", 0, nbcurve, 1);
|
||||
for (i = 1; i <= nbcurve && PS.More(); i++, PS.Next()) {
|
||||
Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve (IS);
|
||||
myMap.Add(C);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Message_ProgressIndicator) GeomTools_CurveSet::GetProgress() const
|
||||
{
|
||||
return myProgress;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_CurveSet::SetProgress(const Handle(Message_ProgressIndicator)& PR)
|
||||
{
|
||||
myProgress = PR;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -60,48 +60,29 @@ public:
|
||||
|
||||
//! Writes the content of me on the stream <OS> in a
|
||||
//! format that can be read back by Read.
|
||||
Standard_EXPORT void Write (Standard_OStream& OS) const;
|
||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
||||
|
||||
//! Reads the content of me from the stream <IS>. me
|
||||
//! is first cleared.
|
||||
Standard_EXPORT void Read (Standard_IStream& IS);
|
||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
||||
|
||||
//! Dumps the curve on the stream, if compact is True
|
||||
//! use the compact format that can be read back.
|
||||
Standard_EXPORT static void PrintCurve (const Handle(Geom_Curve)& C, Standard_OStream& OS, const Standard_Boolean compact = Standard_False);
|
||||
Standard_EXPORT static void PrintCurve (const Handle(Geom_Curve)& C,
|
||||
Standard_OStream& OS,
|
||||
const Standard_Boolean compact = Standard_False);
|
||||
|
||||
//! Reads the curve from the stream. The curve is
|
||||
//! assumed to have been written with the Print
|
||||
//! method (compact = True).
|
||||
Standard_EXPORT static Handle(Geom_Curve) ReadCurve (Standard_IStream& IS);
|
||||
|
||||
Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& PR);
|
||||
|
||||
Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TColStd_IndexedMapOfTransient myMap;
|
||||
Handle(Message_ProgressIndicator) myProgress;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomTools_CurveSet_HeaderFile
|
||||
|
@@ -633,15 +633,15 @@ void GeomTools_SurfaceSet::Dump(Standard_OStream& OS)const
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_SurfaceSet::Write(Standard_OStream& OS)const
|
||||
void GeomTools_SurfaceSet::Write (Standard_OStream& OS,
|
||||
const Handle(Message_ProgressIndicator)& theProgress)const
|
||||
{
|
||||
std::streamsize prec = OS.precision(17);
|
||||
|
||||
Standard_Integer i, nbsurf = myMap.Extent();
|
||||
OS << "Surfaces "<< nbsurf << "\n";
|
||||
//OCC19559
|
||||
Handle(Message_ProgressIndicator) progress = GetProgress();
|
||||
Message_ProgressSentry PS(progress, "Surfaces", 0, nbsurf, 1);
|
||||
Message_ProgressSentry PS(theProgress, "Surfaces", 0, nbsurf, 1);
|
||||
for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
|
||||
PrintSurface(Handle(Geom_Surface)::DownCast(myMap(i)),OS,Standard_True);
|
||||
}
|
||||
@@ -930,7 +930,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom_Surface) GeomTools_SurfaceSet::ReadSurface(Standard_IStream& IS)
|
||||
Handle(Geom_Surface) GeomTools_SurfaceSet::ReadSurface (Standard_IStream& IS)
|
||||
{
|
||||
Standard_Integer stype;
|
||||
|
||||
@@ -1052,7 +1052,8 @@ Handle(Geom_Surface) GeomTools_SurfaceSet::ReadSurface(Standard_IStream& IS)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_SurfaceSet::Read(Standard_IStream& IS)
|
||||
void GeomTools_SurfaceSet::Read (Standard_IStream& IS,
|
||||
const Handle(Message_ProgressIndicator)& theProgress)
|
||||
{
|
||||
char buffer[255];
|
||||
IS >> buffer;
|
||||
@@ -1064,33 +1065,9 @@ void GeomTools_SurfaceSet::Read(Standard_IStream& IS)
|
||||
Standard_Integer i, nbsurf;
|
||||
IS >> nbsurf;
|
||||
//OCC19559
|
||||
Handle(Message_ProgressIndicator) progress = GetProgress();
|
||||
Message_ProgressSentry PS(progress, "Surfaces", 0, nbsurf, 1);
|
||||
Message_ProgressSentry PS(theProgress, "Surfaces", 0, nbsurf, 1);
|
||||
for (i = 1; i <= nbsurf && PS.More(); i++, PS.Next()) {
|
||||
Handle(Geom_Surface) S = GeomTools_SurfaceSet::ReadSurface (IS);
|
||||
myMap.Add(S);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Message_ProgressIndicator) GeomTools_SurfaceSet::GetProgress() const
|
||||
{
|
||||
return myProgress;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetProgress
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void GeomTools_SurfaceSet::SetProgress(const Handle(Message_ProgressIndicator)& PR)
|
||||
{
|
||||
myProgress = PR;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -60,48 +60,29 @@ public:
|
||||
|
||||
//! Writes the content of me on the stream <OS> in a
|
||||
//! format that can be read back by Read.
|
||||
Standard_EXPORT void Write (Standard_OStream& OS) const;
|
||||
Standard_EXPORT void Write (Standard_OStream& OS,
|
||||
const Handle(Message_ProgressIndicator)& theProgress = NULL) const;
|
||||
|
||||
//! Reads the content of me from the stream <IS>. me
|
||||
//! is first cleared.
|
||||
Standard_EXPORT void Read (Standard_IStream& IS);
|
||||
Standard_EXPORT void Read (Standard_IStream& IS,
|
||||
const Handle(Message_ProgressIndicator)& theProgress = NULL);
|
||||
|
||||
//! Dumps the surface on the stream, if compact is True
|
||||
//! use the compact format that can be read back.
|
||||
Standard_EXPORT static void PrintSurface (const Handle(Geom_Surface)& S, Standard_OStream& OS, const Standard_Boolean compact = Standard_False);
|
||||
Standard_EXPORT static void PrintSurface (const Handle(Geom_Surface)& S,
|
||||
Standard_OStream& OS,
|
||||
const Standard_Boolean compact = Standard_False);
|
||||
|
||||
//! Reads the surface from the stream. The surface is
|
||||
//! assumed to have been written with the Print
|
||||
//! method (compact = True).
|
||||
Standard_EXPORT static Handle(Geom_Surface) ReadSurface (Standard_IStream& IS);
|
||||
|
||||
Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& PR);
|
||||
|
||||
Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
TColStd_IndexedMapOfTransient myMap;
|
||||
Handle(Message_ProgressIndicator) myProgress;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomTools_SurfaceSet_HeaderFile
|
||||
|
Reference in New Issue
Block a user