1 -- File: ShapeProcess_Context.cdl
2 -- Created: Mon Aug 21 19:11:11 2000
3 -- Author: Andrey BETENEV
4 -- <abv@nnov.matra-dtv.fr>
5 ---Copyright: Matra Datavision 2000
8 class Context from ShapeProcess inherits TShared from MMgt
10 ---Purpose: Provides convenient interface to resource file
11 -- Allows to load resource file and get values of
12 -- attributes starting from some scope, for example
13 -- if scope is defined as "ToV4" and requested parameter
14 -- is "exec.op", value of "ToV4.exec.op" parameter from
15 -- the resource file will be returned
19 Manager from Resource,
20 AsciiString from TCollection,
21 HSequenceOfHAsciiString from TColStd,
22 Messenger from Message,
23 ProgressIndicator from Message
28 ---Purpose: Creates an empty tool
30 Create (file: CString; scope: CString = "");
31 ---Purpose: Creates a new tool and initialises by name of
32 -- resource file and (if specified) starting scope
33 -- Calls method Init()
35 Init (me: mutable; file: CString; scope: CString = "")
37 ---Purpose: Initialises a tool by loading resource file and
38 -- (if specified) sets starting scope
39 -- Returns False if resource file not found
41 LoadResourceManager(me: mutable; file: CString) returns Manager from Resource;
42 ---Purpose: Loading Resource_Manager object if this object not
43 -- equal internal static Resource_Manager object or
44 -- internal static Resource_Manager object is null
46 ResourceManager (me) returns Manager from Resource;
47 ---Purpose: Returns internal Resource_Manager object
48 ---C++: return const &
50 SetScope (me: mutable; scope: CString);
51 ---Purpose: Set a new (sub)scope
53 UnSetScope (me: mutable);
54 ---Purpose: Go out of current scope
56 IsParamSet (me; param: CString) returns Boolean;
57 ---Purpose: Returns True if parameter is defined in the resource file
59 GetReal (me; param: CString; val: out Real ) returns Boolean;
60 GetInteger (me; param: CString; val: out Integer) returns Boolean;
61 GetBoolean (me; param: CString; val: out Boolean) returns Boolean;
62 GetString (me; param: CString; val: out AsciiString from TCollection) returns Boolean;
63 ---Purpose: Get value of parameter as being of specific type
64 -- Returns False if parameter is not defined or has a wrong type
66 RealVal (me; param: CString; def: Real ) returns Real;
67 IntegerVal (me; param: CString; def: Integer) returns Integer;
68 BooleanVal (me; param: CString; def: Boolean) returns Boolean;
69 StringVal (me; param: CString; def: CString) returns CString;
70 ---Purpose: Get value of parameter as being of specific type
71 -- If parameter is not defined or does not have expected
72 -- type, returns default value as specified
74 SetMessenger (me: mutable; messenger: Messenger from Message);
75 ---Purpose : Sets Messenger used for outputting messages.
77 Messenger (me) returns Messenger from Message;
78 ---Purpose : Returns Messenger used for outputting messages.
80 SetProgress (me: mutable; theProgress: ProgressIndicator from Message);
81 ---Purpose : Sets Progress Indicator.
83 Progress (me) returns ProgressIndicator from Message;
84 ---Purpose : Returns Progress Indicator.
86 SetTraceLevel (me: mutable; tracelev: Integer);
87 ---Purpose : Sets trace level used for outputting messages
88 -- - 0: no trace at all
90 -- - 2: errors and warnings
92 -- Default is 1 : Errors traced
94 TraceLevel (me) returns Integer;
95 ---Purpose : Returns trace level used for outputting messages.
99 myRC: Manager from Resource;
100 myScope: HSequenceOfHAsciiString from TColStd;
101 myMessenger: Messenger from Message;
102 myProgress: ProgressIndicator from Message;