0025748: Parallel version of progress indicator
[occt.git] / src / Transfer / Transfer_TransferOutput.hxx
1 // Created on: 1992-02-04
2 // Created by: Christian CAILLET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Transfer_TransferOutput_HeaderFile
18 #define _Transfer_TransferOutput_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <Message_ProgressRange.hxx>
25
26 class Transfer_TransientProcess;
27 class Interface_InterfaceModel;
28 class Standard_NoSuchObject;
29 class Transfer_TransferFailure;
30 class Transfer_ActorOfTransientProcess;
31 class Standard_Transient;
32 class Interface_Protocol;
33 class Interface_Graph;
34 class Interface_EntityIterator;
35
36 //! A TransferOutput is a Tool which manages the transfer of
37 //! entities created by an Interface, stored in an InterfaceModel,
38 //! into a set of Objects suitable for an Application
39 //! Objects to be transferred are given, by method Transfer
40 //! (which calls Transfer from TransientProcess)
41 //! A default action is available to get all roots of the Model
42 //! Result is given as a TransferIterator (see TransferProcess)
43 //! Also, it is possible to pilot directly the TransientProcess
44 class Transfer_TransferOutput 
45 {
46 public:
47
48   DEFINE_STANDARD_ALLOC
49
50   
51   //! Creates a TransferOutput ready to use, with a TransientProcess
52   Standard_EXPORT Transfer_TransferOutput(const Handle(Transfer_ActorOfTransientProcess)& actor, const Handle(Interface_InterfaceModel)& amodel);
53   
54   //! Creates a TransferOutput from an already existing
55   //! TransientProcess, and a Model
56   //! Returns (by Reference, hence can be changed) the Mode for
57   //! Scope Management. False (D) means Scope is ignored.
58   //! True means that each individual Transfer (direct or through
59   //! TransferRoots) is regarded as one Scope
60   Standard_EXPORT Transfer_TransferOutput(const Handle(Transfer_TransientProcess)& proc, const Handle(Interface_InterfaceModel)& amodel);
61   
62   //! Returns the Starting Model
63   Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
64   
65   //! Returns the TransientProcess used to work
66   Standard_EXPORT Handle(Transfer_TransientProcess) TransientProcess() const;
67   
68   //! Transfer checks that all taken Entities come from the same
69   //! Model, then calls Transfer from TransientProcess
70   Standard_EXPORT void Transfer (const Handle(Standard_Transient)& obj,
71                                  const Message_ProgressRange& theProgress = Message_ProgressRange());
72   
73   //! Runs transfer on the roots of the Interface Model
74   //! The Roots are computed with a ShareFlags created from a
75   //! Protocol given as Argument
76   Standard_EXPORT void TransferRoots (const Handle(Interface_Protocol)& protocol,
77                                       const Message_ProgressRange& theProgress = Message_ProgressRange());
78   
79   //! Runs transfer on the roots defined by a Graph of dependences
80   //! (which detains also a Model and its Entities)
81   //! Roots are computed with a ShareFlags created from the Graph
82   Standard_EXPORT void TransferRoots (const Interface_Graph& G,
83                                       const Message_ProgressRange& theProgress = Message_ProgressRange());
84   
85   //! Runs transfer on the roots of the Interface Model
86   //! Remark : the Roots are computed with a ShareFlags created
87   //! from the Active Protocol
88   Standard_EXPORT void TransferRoots(const Message_ProgressRange& theProgress = Message_ProgressRange());
89   
90   //! Returns the list of Starting Entities with these criteria :
91   //! - <normal> False, gives the entities bound with ABNORMAL STATUS
92   //! (e.g. : Fail recorded, Exception raised during Transfer)
93   //! - <normal> True, gives Entities with or without a Result, but
94   //! with no Fail, no Exception (Warnings are not counted)
95   //! - <roots> False, considers all entities recorded (either for
96   //! Result, or for at least one Fail or Warning message)
97   //! - <roots> True (Default), considers only roots of Transfer
98   //! (the Entities recorded at highest level)
99   //! This method is based on AbnormalResult from TransferProcess
100   Standard_EXPORT Interface_EntityIterator ListForStatus (const Standard_Boolean normal, const Standard_Boolean roots = Standard_True) const;
101   
102   //! Fills a Model with the list determined by ListForStatus
103   //! This model starts from scratch (made by NewEmptyModel from the
104   //! current Model), then is filled by AddWithRefs
105   //!
106   //! Useful to get separately from a transfer, the entities which
107   //! have caused problem, in order to furtherly analyse them (with
108   //! normal = False), or the "good" entities, to obtain a data set
109   //! "which works well" (with normal = True)
110   Standard_EXPORT Handle(Interface_InterfaceModel) ModelForStatus (const Handle(Interface_Protocol)& protocol, const Standard_Boolean normal, const Standard_Boolean roots = Standard_True) const;
111
112
113
114
115 protected:
116
117
118
119
120
121 private:
122
123
124
125   Handle(Transfer_TransientProcess) theproc;
126   Handle(Interface_InterfaceModel) themodel;
127
128
129 };
130
131
132
133
134
135
136
137 #endif // _Transfer_TransferOutput_HeaderFile