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.
14 #include <Message_ProgressScale.hxx>
15 #include <TCollection_HAsciiString.hxx>
17 //=======================================================================
20 //=======================================================================
22 inline void Message_ProgressIndicator::SetName (const Standard_CString name)
25 myScopes.ChangeValue(1).SetName ( name );
28 //=======================================================================
31 //=======================================================================
33 inline void Message_ProgressIndicator::SetName (const Handle(TCollection_HAsciiString) &name)
36 myScopes.ChangeValue(1).SetName ( name );
39 //=======================================================================
42 //=======================================================================
44 inline void Message_ProgressIndicator::SetRange (const Standard_Real min,
45 const Standard_Real max)
47 myScopes.ChangeValue(1).SetRange ( min, max );
50 //=======================================================================
53 //=======================================================================
55 inline void Message_ProgressIndicator::SetStep (const Standard_Real step)
57 myScopes.ChangeValue(1).SetStep ( step );
60 //=======================================================================
61 //function : SetInfinite
63 //=======================================================================
65 inline void Message_ProgressIndicator::SetInfinite (const Standard_Boolean isInf)
67 myScopes.ChangeValue(1).SetInfinite ( isInf );
70 //=======================================================================
73 //=======================================================================
75 inline void Message_ProgressIndicator::SetScale (const Standard_CString name,
76 const Standard_Real min,
77 const Standard_Real max,
78 const Standard_Real step,
79 const Standard_Boolean isInf)
82 SetScale ( min, max, step, isInf );
85 //=======================================================================
86 //function : Increment
88 //=======================================================================
90 inline void Message_ProgressIndicator::Increment ()
92 Increment ( myScopes(1).GetStep() );
95 //=======================================================================
96 //function : Increment
98 //=======================================================================
100 inline void Message_ProgressIndicator::Increment (const Standard_Real step)
102 SetValue ( GetValue() + step );
105 //=======================================================================
106 //function : NewScope
108 //=======================================================================
110 inline Standard_Boolean Message_ProgressIndicator::NewScope (const Standard_CString name)
112 return NewScope ( name ? new TCollection_HAsciiString ( name ) : 0 );
115 //=======================================================================
116 //function : NewScope
118 //=======================================================================
120 inline Standard_Boolean Message_ProgressIndicator::NewScope (const Handle(TCollection_HAsciiString) &name)
122 return NewScope ( myScopes(1).GetStep(), name );
125 //=======================================================================
126 //function : NewScope
128 //=======================================================================
130 inline Standard_Boolean Message_ProgressIndicator::NewScope (const Standard_Real span,
131 const Standard_CString name)
133 return NewScope ( span, name ? new TCollection_HAsciiString ( name ) : 0 );
136 //=======================================================================
137 //function : NextScope
139 //=======================================================================
141 inline Standard_Boolean Message_ProgressIndicator::NextScope (const Standard_CString name)
143 return NextScope ( myScopes.Length() >1 ? myScopes(1).GetStep() : 1., name );
146 //=======================================================================
147 //function : GetPosition
149 //=======================================================================
151 inline Standard_Real Message_ProgressIndicator::GetPosition () const
156 //=======================================================================
157 //function : GetNbScopes
159 //=======================================================================
161 inline Standard_Integer Message_ProgressIndicator::GetNbScopes () const
163 return myScopes.Length();
166 //=======================================================================
167 //function : GetScope
169 //=======================================================================
171 inline const Message_ProgressScale &Message_ProgressIndicator::GetScope (const Standard_Integer index) const
173 return myScopes(index);