42cf5bc1 |
1 | // Created on: 1996-09-04 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1996-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_TransientProcess_HeaderFile |
18 | #define _Transfer_TransientProcess_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TColStd_HSequenceOfTransient.hxx> |
24 | #include <Transfer_ProcessForTransient.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <Standard_CString.hxx> |
28 | #include <Standard_Type.hxx> |
997e128f |
29 | #include <Standard_Transient.hxx> |
30 | #include <TCollection_AsciiString.hxx> |
31 | #include <NCollection_DataMap.hxx> |
42cf5bc1 |
32 | class Interface_InterfaceModel; |
33 | class Interface_HGraph; |
42cf5bc1 |
34 | class Interface_Graph; |
42cf5bc1 |
35 | class Interface_EntityIterator; |
36 | |
42cf5bc1 |
37 | class Transfer_TransientProcess; |
38 | DEFINE_STANDARD_HANDLE(Transfer_TransientProcess, Transfer_ProcessForTransient) |
39 | |
40 | //! Adds specific features to the generic definition : |
41 | //! TransientProcess is intended to work from an InterfaceModel |
42 | //! to a set of application objects. |
43 | //! |
a25d5aaa |
44 | //! Hence, some information about starting entities can be gotten |
42cf5bc1 |
45 | //! from the model : for Trace, CheckList, Integrity Status |
46 | class Transfer_TransientProcess : public Transfer_ProcessForTransient |
47 | { |
48 | |
49 | public: |
50 | |
51 | |
52 | //! Sets TransientProcess at initial state, with an initial size |
53 | Standard_EXPORT Transfer_TransientProcess(const Standard_Integer nb = 10000); |
54 | |
55 | //! Sets an InterfaceModel, used by StartTrace, CheckList, queries |
a25d5aaa |
56 | //! on Integrity, to give information significant for each norm. |
42cf5bc1 |
57 | Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model); |
58 | |
59 | //! Returns the Model used for StartTrace |
60 | Standard_EXPORT Handle(Interface_InterfaceModel) Model() const; |
61 | |
62 | //! Sets a Graph : superseedes SetModel if already done |
63 | Standard_EXPORT void SetGraph (const Handle(Interface_HGraph)& HG); |
64 | |
65 | Standard_EXPORT Standard_Boolean HasGraph() const; |
66 | |
67 | Standard_EXPORT Handle(Interface_HGraph) HGraph() const; |
68 | |
69 | Standard_EXPORT const Interface_Graph& Graph() const; |
70 | |
71 | //! Sets a Context : according to receiving appli, to be |
72 | //! interpreted by the Actor |
73 | Standard_EXPORT void SetContext (const Standard_CString name, const Handle(Standard_Transient)& ctx); |
74 | |
75 | //! Returns the Context attached to a name, if set and if it is |
76 | //! Kind of the type, else a Null Handle |
77 | //! Returns True if OK, False if no Context |
78 | Standard_EXPORT Standard_Boolean GetContext (const Standard_CString name, const Handle(Standard_Type)& type, Handle(Standard_Transient)& ctx) const; |
79 | |
80 | //! Returns (modifiable) the whole definition of Context |
81 | //! Rather for internal use (ex.: preparing and setting in once) |
997e128f |
82 | Standard_EXPORT NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>& Context(); |
42cf5bc1 |
83 | |
84 | //! Specific printing to trace an entity : prints label and type |
85 | //! (if model is set) |
0ebe5b0a |
86 | Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, Standard_OStream& S) const Standard_OVERRIDE; |
42cf5bc1 |
87 | |
88 | //! Specific number of a starting object for check-list : Number |
89 | //! in model |
90 | Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE; |
91 | |
92 | //! Returns the list of sharings entities, AT ANY LEVEL, which are |
93 | //! kind of a given type. Calls TypedSharings from Graph |
94 | //! Returns an empty list if the Graph has not been aknowledged |
95 | Standard_EXPORT Interface_EntityIterator TypedSharings (const Handle(Standard_Transient)& start, const Handle(Standard_Type)& type) const; |
96 | |
97 | //! Tells if an entity is well loaded from file (even if its data |
98 | //! fail on checking, they are present). Mostly often, answers |
99 | //! True. Else, there was a syntactic error in the file. |
100 | //! A non-loaded entity MAY NOT BE transferred, unless its Report |
101 | //! (in the model) is interpreted |
102 | Standard_EXPORT Standard_Boolean IsDataLoaded (const Handle(Standard_Transient)& ent) const; |
103 | |
104 | //! Tells if an entity fails on data checking (load time, |
105 | //! syntactic, or semantic check). Normally, should answer False. |
106 | //! It is not prudent to try transferring an entity which fails on |
107 | //! data checking |
108 | Standard_EXPORT Standard_Boolean IsDataFail (const Handle(Standard_Transient)& ent) const; |
109 | |
110 | //! Prints statistics on a given output, according mode |
0ebe5b0a |
111 | Standard_EXPORT void PrintStats (const Standard_Integer mode, Standard_OStream& S) const; |
42cf5bc1 |
112 | |
113 | Standard_EXPORT Handle(TColStd_HSequenceOfTransient) RootsForTransfer(); |
114 | |
115 | |
116 | |
117 | |
92efcf78 |
118 | DEFINE_STANDARD_RTTIEXT(Transfer_TransientProcess,Transfer_ProcessForTransient) |
42cf5bc1 |
119 | |
120 | protected: |
121 | |
122 | |
123 | |
124 | |
125 | private: |
126 | |
127 | |
128 | Handle(Interface_InterfaceModel) themodel; |
129 | Handle(Interface_HGraph) thegraph; |
997e128f |
130 | NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thectx; |
42cf5bc1 |
131 | Handle(TColStd_HSequenceOfTransient) thetrroots; |
132 | |
133 | |
134 | }; |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | |
142 | #endif // _Transfer_TransientProcess_HeaderFile |