1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Message_ProgressIndicator.hxx>
16 #include <Message_ProgressSentry.hxx>
17 #include <TCollection_HAsciiString.hxx>
19 //=======================================================================
20 //function : Message_ProgressSentry
22 //=======================================================================
23 Message_ProgressSentry::Message_ProgressSentry (const Handle(Message_ProgressIndicator) &progress,
24 const Standard_CString name,
25 const Standard_Real min,
26 const Standard_Real max,
27 const Standard_Real step,
28 const Standard_Boolean isInf,
29 const Standard_Real newScopeSpan) :
30 myProgress(progress), myActive(!progress.IsNull())
32 if ( ! myActive ) return;
33 progress->SetName ( name );
34 progress->SetScale ( min, max, step, isInf );
35 progress->NewScope ( newScopeSpan >0 ? newScopeSpan : step );
38 //=======================================================================
39 //function : Message_ProgressSentry
41 //=======================================================================
43 Message_ProgressSentry::Message_ProgressSentry (const Handle(Message_ProgressIndicator) &progress,
44 const Handle(TCollection_HAsciiString) &name,
45 const Standard_Real min,
46 const Standard_Real max,
47 const Standard_Real step,
48 const Standard_Boolean isInf,
49 const Standard_Real newScopeSpan) :
50 myProgress(progress), myActive(!progress.IsNull())
52 if ( ! myActive ) return;
53 progress->SetName ( name );
54 progress->SetScale ( min, max, step, isInf );
55 progress->NewScope ( newScopeSpan >0 ? newScopeSpan : step );