Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:29

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 <TColStd_HSequenceOfTransient.hxx>
0024 #include <Transfer_ProcessForTransient.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <Standard_CString.hxx>
0027 #include <Standard_Transient.hxx>
0028 #include <TCollection_AsciiString.hxx>
0029 #include <NCollection_DataMap.hxx>
0030 class Interface_InterfaceModel;
0031 class Interface_HGraph;
0032 class Interface_Graph;
0033 class Interface_EntityIterator;
0034 
0035 class Transfer_TransientProcess;
0036 DEFINE_STANDARD_HANDLE(Transfer_TransientProcess, Transfer_ProcessForTransient)
0037 
0038 //! Adds specific features to the generic definition :
0039 //! TransientProcess is intended to work from an InterfaceModel
0040 //! to a set of application objects.
0041 //!
0042 //! Hence, some information about starting entities can be gotten
0043 //! from the model : for Trace, CheckList, Integrity Status
0044 class Transfer_TransientProcess : public Transfer_ProcessForTransient
0045 {
0046 
0047 public:
0048 
0049   
0050   //! Sets TransientProcess at initial state, with an initial size
0051   Standard_EXPORT Transfer_TransientProcess(const Standard_Integer nb = 10000);
0052   
0053   //! Sets an InterfaceModel, used by StartTrace, CheckList, queries
0054   //! on Integrity, to give information significant for each norm.
0055   Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model);
0056   
0057   //! Returns the Model used for StartTrace
0058   Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
0059   
0060   //! Sets a Graph : superseedes SetModel if already done
0061   Standard_EXPORT void SetGraph (const Handle(Interface_HGraph)& HG);
0062   
0063   Standard_EXPORT Standard_Boolean HasGraph() const;
0064   
0065   Standard_EXPORT Handle(Interface_HGraph) HGraph() const;
0066   
0067   Standard_EXPORT const Interface_Graph& Graph() const;
0068   
0069   //! Sets a Context : according to receiving appli, to be
0070   //! interpreted by the Actor
0071   Standard_EXPORT void SetContext (const Standard_CString name, const Handle(Standard_Transient)& ctx);
0072   
0073   //! Returns the Context attached to a name, if set and if it is
0074   //! Kind of the type, else a Null Handle
0075   //! Returns True if OK, False if no Context
0076   Standard_EXPORT Standard_Boolean GetContext (const Standard_CString name, const Handle(Standard_Type)& type, Handle(Standard_Transient)& ctx) const;
0077   
0078   //! Returns (modifiable) the whole definition of Context
0079   //! Rather for internal use (ex.: preparing and setting in once)
0080   Standard_EXPORT NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>& Context();
0081   
0082   //! Specific printing to trace an entity : prints label and type
0083   //! (if model is set)
0084   Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, Standard_OStream& S) const Standard_OVERRIDE;
0085   
0086   //! Specific number of a starting object for check-list : Number
0087   //! in model
0088   Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
0089   
0090   //! Returns the list of sharings entities, AT ANY LEVEL, which are
0091   //! kind of a given type. Calls TypedSharings from Graph
0092   //! Returns an empty list if the Graph has not been aknowledged
0093   Standard_EXPORT Interface_EntityIterator TypedSharings (const Handle(Standard_Transient)& start, const Handle(Standard_Type)& type) const;
0094   
0095   //! Tells if an entity is well loaded from file (even if its data
0096   //! fail on checking, they are present). Mostly often, answers
0097   //! True. Else, there was a syntactic error in the file.
0098   //! A non-loaded entity MAY NOT BE transferred, unless its Report
0099   //! (in the model) is interpreted
0100   Standard_EXPORT Standard_Boolean IsDataLoaded (const Handle(Standard_Transient)& ent) const;
0101   
0102   //! Tells if an entity fails on data checking (load time,
0103   //! syntactic, or semantic check). Normally, should answer False.
0104   //! It is not prudent to try transferring an entity which fails on
0105   //! data checking
0106   Standard_EXPORT Standard_Boolean IsDataFail (const Handle(Standard_Transient)& ent) const;
0107   
0108   //! Prints statistics on a given output, according mode
0109   Standard_EXPORT void PrintStats (const Standard_Integer mode, Standard_OStream& S) const;
0110   
0111   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) RootsForTransfer();
0112 
0113 
0114 
0115 
0116   DEFINE_STANDARD_RTTIEXT(Transfer_TransientProcess,Transfer_ProcessForTransient)
0117 
0118 protected:
0119 
0120 
0121 
0122 
0123 private:
0124 
0125 
0126   Handle(Interface_InterfaceModel) themodel;
0127   Handle(Interface_HGraph) thegraph;
0128   NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thectx;
0129   Handle(TColStd_HSequenceOfTransient) thetrroots;
0130 
0131 
0132 };
0133 
0134 
0135 
0136 
0137 
0138 
0139 
0140 #endif // _Transfer_TransientProcess_HeaderFile