Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:17:43

0001 // Created on: 1996-09-04
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Transfer_TransientProcess_HeaderFile
0018 #define _Transfer_TransientProcess_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <NCollection_Sequence.hxx>
0025 #include <NCollection_HSequence.hxx>
0026 #include <Transfer_ProcessForTransient.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <Standard_CString.hxx>
0029 #include <TCollection_AsciiString.hxx>
0030 #include <NCollection_DataMap.hxx>
0031 class Interface_InterfaceModel;
0032 class Interface_HGraph;
0033 class Interface_Graph;
0034 class Interface_EntityIterator;
0035 
0036 //! Adds specific features to the generic definition :
0037 //! TransientProcess is intended to work from an InterfaceModel
0038 //! to a set of application objects.
0039 //!
0040 //! Hence, some information about starting entities can be gotten
0041 //! from the model : for Trace, CheckList, Integrity Status
0042 class Transfer_TransientProcess : public Transfer_ProcessForTransient
0043 {
0044 
0045 public:
0046   //! Sets TransientProcess at initial state, with an initial size
0047   Standard_EXPORT Transfer_TransientProcess(const int nb = 10000);
0048 
0049   //! Sets an InterfaceModel, used by StartTrace, CheckList, queries
0050   //! on Integrity, to give information significant for each norm.
0051   Standard_EXPORT void SetModel(const occ::handle<Interface_InterfaceModel>& model);
0052 
0053   //! Returns the Model used for StartTrace
0054   Standard_EXPORT occ::handle<Interface_InterfaceModel> Model() const;
0055 
0056   //! Sets a Graph : supersedes SetModel if already done
0057   Standard_EXPORT void SetGraph(const occ::handle<Interface_HGraph>& HG);
0058 
0059   Standard_EXPORT bool HasGraph() const;
0060 
0061   Standard_EXPORT occ::handle<Interface_HGraph> HGraph() const;
0062 
0063   Standard_EXPORT const Interface_Graph& Graph() const;
0064 
0065   //! Sets a Context : according to receiving appli, to be
0066   //! interpreted by the Actor
0067   Standard_EXPORT void SetContext(const char* const                      name,
0068                                   const occ::handle<Standard_Transient>& ctx);
0069 
0070   //! Returns the Context attached to a name, if set and if it is
0071   //! Kind of the type, else a Null Handle
0072   //! Returns True if OK, False if no Context
0073   Standard_EXPORT bool GetContext(const char* const                 name,
0074                                   const occ::handle<Standard_Type>& type,
0075                                   occ::handle<Standard_Transient>&  ctx) const;
0076 
0077   //! Returns (modifiable) the whole definition of Context
0078   //! Rather for internal use (ex.: preparing and setting in once)
0079   Standard_EXPORT NCollection_DataMap<TCollection_AsciiString, occ::handle<Standard_Transient>>&
0080                   Context();
0081 
0082   //! Specific printing to trace an entity : prints label and type
0083   //! (if model is set)
0084   Standard_EXPORT void PrintTrace(const occ::handle<Standard_Transient>& start,
0085                                   Standard_OStream&                      S) const override;
0086 
0087   //! Specific number of a starting object for check-list : Number
0088   //! in model
0089   Standard_EXPORT int CheckNum(const occ::handle<Standard_Transient>& ent) const override;
0090 
0091   //! Returns the list of sharings entities, AT ANY LEVEL, which are
0092   //! kind of a given type. Calls TypedSharings from Graph
0093   //! Returns an empty list if the Graph has not been acknowledged
0094   Standard_EXPORT Interface_EntityIterator
0095     TypedSharings(const occ::handle<Standard_Transient>& start,
0096                   const occ::handle<Standard_Type>&      type) const;
0097 
0098   //! Tells if an entity is well loaded from file (even if its data
0099   //! fail on checking, they are present). Mostly often, answers
0100   //! True. Else, there was a syntactic error in the file.
0101   //! A non-loaded entity MAY NOT BE transferred, unless its Report
0102   //! (in the model) is interpreted
0103   Standard_EXPORT bool IsDataLoaded(const occ::handle<Standard_Transient>& ent) const;
0104 
0105   //! Tells if an entity fails on data checking (load time,
0106   //! syntactic, or semantic check). Normally, should answer False.
0107   //! It is not prudent to try transferring an entity which fails on
0108   //! data checking
0109   Standard_EXPORT bool IsDataFail(const occ::handle<Standard_Transient>& ent) const;
0110 
0111   //! Prints statistics on a given output, according mode
0112   Standard_EXPORT void PrintStats(const int mode, Standard_OStream& S) const;
0113 
0114   Standard_EXPORT occ::handle<NCollection_HSequence<occ::handle<Standard_Transient>>>
0115                   RootsForTransfer();
0116 
0117   DEFINE_STANDARD_RTTIEXT(Transfer_TransientProcess, Transfer_ProcessForTransient)
0118 
0119 private:
0120   occ::handle<Interface_InterfaceModel>                                         themodel;
0121   occ::handle<Interface_HGraph>                                                 thegraph;
0122   NCollection_DataMap<TCollection_AsciiString, occ::handle<Standard_Transient>> thectx;
0123   occ::handle<NCollection_HSequence<occ::handle<Standard_Transient>>>           thetrroots;
0124 };
0125 
0126 #endif // _Transfer_TransientProcess_HeaderFile