Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:08

0001 // Created on: 1993-02-02
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1993-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 _Interface_ShareTool_HeaderFile
0018 #define _Interface_ShareTool_HeaderFile
0019 
0020 #include <Standard_Type.hxx>
0021 
0022 class Interface_HGraph;
0023 class Interface_InterfaceModel;
0024 class Interface_GeneralLib;
0025 class Interface_GTool;
0026 class Interface_Protocol;
0027 class Interface_Graph;
0028 class Interface_EntityIterator;
0029 
0030 //! Builds the Graph of Dependencies, from the General Service
0031 //! "Shared" -> builds for each Entity of a Model, the Shared and
0032 //! Sharing Lists, and gives access to them.
0033 //! Allows to complete with Implied References (which are not
0034 //! regarded as Shared Entities, but are nevertheless Referenced),
0035 //! this can be useful for Reference Checking
0036 class Interface_ShareTool 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   //! Creates a ShareTool from a Model and builds all required data,
0044   //! by calling the General Service Library and Modules
0045   //! (GeneralLib given as an argument)
0046   Standard_EXPORT Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel, const Interface_GeneralLib& lib);
0047   
0048   //! Same a above, but GeneralLib is detained by a GTool
0049   Standard_EXPORT Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_GTool)& gtool);
0050   
0051   //! Same a above, but GeneralLib is defined through a Protocol
0052   //! Protocol is used to build the working library
0053   Standard_EXPORT Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel, const Handle(Interface_Protocol)& protocol);
0054   
0055   //! Same as above, but works with the GTool of the Model
0056   Standard_EXPORT Interface_ShareTool(const Handle(Interface_InterfaceModel)& amodel);
0057   
0058   //! Creates a ShareTool from an already defined Graph
0059   //! Remark that the data of the Graph are copied
0060   Standard_EXPORT Interface_ShareTool(const Interface_Graph& agraph);
0061   
0062   //! Completes the Graph by Adding Implied References. Hence, they
0063   //! are considered as Sharing References in all the other queries
0064   Standard_EXPORT Interface_ShareTool(const Handle(Interface_HGraph)& ahgraph);
0065   
0066   //! Returns the Model used for Creation (directly or for Graph)
0067   Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
0068   
0069   //! Returns the data used by the ShareTool to work
0070   //! Can then be used directly (read only)
0071   Standard_EXPORT const Interface_Graph& Graph() const;
0072   
0073   //! Returns the Entities which are not Shared (their Sharing List
0074   //! is empty) in the Model
0075   Standard_EXPORT Interface_EntityIterator RootEntities() const;
0076   
0077   //! Returns True if <ent> is Shared by other Entities in the Model
0078   Standard_EXPORT Standard_Boolean IsShared (const Handle(Standard_Transient)& ent) const;
0079   
0080   //! Returns the List of Entities Shared by a given Entity <ent>
0081   Standard_EXPORT Interface_EntityIterator Shareds (const Handle(Standard_Transient)& ent) const;
0082   
0083   //! Returns the List of Entities Sharing a given Entity <ent>
0084   Standard_EXPORT Interface_EntityIterator Sharings (const Handle(Standard_Transient)& ent) const;
0085   
0086   //! Returns the count of Sharing Entities of an Entity, which
0087   //! are Kind of a given Type
0088   Standard_EXPORT Standard_Integer NbTypedSharings (const Handle(Standard_Transient)& ent, const Handle(Standard_Type)& atype) const;
0089   
0090   //! Returns the Sharing Entity of an Entity, which is Kind of a
0091   //! given Type. Allows to access a Sharing Entity of a given type
0092   //! when there is one and only one (current case)
0093   Standard_EXPORT Handle(Standard_Transient) TypedSharing (const Handle(Standard_Transient)& ent, const Handle(Standard_Type)& atype) const;
0094   
0095   //! Returns the complete list of entities shared by <ent> at any
0096   //! level, including <ent> itself
0097   //! If <ent> is the Model, considers the concatenation of
0098   //! AllShared for each root
0099   //! If <rootlast> is True (D), the list starts with lower level
0100   //! entities and ends by the root. Else, the root is first and
0101   //! the lower level entities are at end
0102   Standard_EXPORT Interface_EntityIterator All (const Handle(Standard_Transient)& ent, const Standard_Boolean rootlast = Standard_True) const;
0103   
0104   //! Utility method which Prints the content of an iterator
0105   //! (by their Numbers)
0106   Standard_EXPORT void Print (const Interface_EntityIterator& iter,Standard_OStream& S) const;
0107 
0108 
0109 
0110 
0111 protected:
0112 
0113 
0114 
0115 
0116 
0117 private:
0118 
0119 
0120 
0121   Handle(Interface_HGraph) theHGraph;
0122 
0123 
0124 };
0125 
0126 
0127 
0128 
0129 
0130 
0131 
0132 #endif // _Interface_ShareTool_HeaderFile