Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1998-01-08
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1998-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_GTool_HeaderFile
0018 #define _Interface_GTool_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Interface_GeneralLib.hxx>
0024 #include <Interface_DataMapOfTransientInteger.hxx>
0025 #include <TColStd_IndexedDataMapOfTransientTransient.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <Standard_Integer.hxx>
0028 class Interface_Protocol;
0029 class Interface_SignType;
0030 class Interface_InterfaceModel;
0031 class Interface_GeneralModule;
0032 
0033 
0034 class Interface_GTool;
0035 DEFINE_STANDARD_HANDLE(Interface_GTool, Standard_Transient)
0036 
0037 //! GTool - General Tool for a Model
0038 //! Provides the functions performed by Protocol/GeneralModule for
0039 //! entities of a Model, and recorded in a GeneralLib
0040 //! Optimized : once an entity has been queried, the GeneralLib is
0041 //! not longer queried
0042 //! Shareable between several users : as a Handle
0043 class Interface_GTool : public Standard_Transient
0044 {
0045 
0046 public:
0047 
0048   
0049   //! Creates an empty, not set, GTool
0050   Standard_EXPORT Interface_GTool();
0051   
0052   //! Creates a GTool from a Protocol
0053   //! Optional starting count of entities
0054   Standard_EXPORT Interface_GTool(const Handle(Interface_Protocol)& proto, const Standard_Integer nbent = 0);
0055   
0056   //! Sets a new SignType
0057   Standard_EXPORT void SetSignType (const Handle(Interface_SignType)& sign);
0058   
0059   //! Returns the SignType. Can be null
0060   Standard_EXPORT Handle(Interface_SignType) SignType() const;
0061   
0062   //! Returns the Signature for a Transient Object in a Model
0063   //! It calls SignType to do that
0064   //! If SignType is not defined, return ClassName of <ent>
0065   Standard_EXPORT Standard_CString SignValue (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const;
0066   
0067   //! Returns the Name of the SignType, or "Class Name"
0068   Standard_EXPORT Standard_CString SignName() const;
0069   
0070   //! Sets a new Protocol
0071   //! if <enforce> is False and the new Protocol equates the old one
0072   //! then nothing is done
0073   Standard_EXPORT void SetProtocol (const Handle(Interface_Protocol)& proto, const Standard_Boolean enforce = Standard_False);
0074   
0075   //! Returns the Protocol.  Warning : it can be Null
0076   Standard_EXPORT Handle(Interface_Protocol) Protocol() const;
0077   
0078   //! Returns the GeneralLib itself
0079   Standard_EXPORT Interface_GeneralLib& Lib();
0080   
0081   //! Reservates maps for a count of entities
0082   //! <enforce> False : minimum count
0083   //! <enforce> True  : clears former reservations
0084   //! Does not clear the maps
0085   Standard_EXPORT void Reservate (const Standard_Integer nb, const Standard_Boolean enforce = Standard_False);
0086   
0087   //! Clears the maps which record, for each already recorded entity
0088   //! its Module and Case Number
0089   Standard_EXPORT void ClearEntities();
0090   
0091   //! Selects for an entity, its Module and Case Number
0092   //! It is optimised : once done for each entity, the result is
0093   //! mapped and the GeneralLib is not longer queried
0094   //! <enforce> True overpasses this optimisation
0095   Standard_EXPORT Standard_Boolean Select (const Handle(Standard_Transient)& ent, Handle(Interface_GeneralModule)& gmod, Standard_Integer& CN, const Standard_Boolean enforce = Standard_False);
0096 
0097 
0098 
0099 
0100   DEFINE_STANDARD_RTTIEXT(Interface_GTool,Standard_Transient)
0101 
0102 protected:
0103 
0104 
0105 
0106 
0107 private:
0108 
0109 
0110   Handle(Interface_Protocol) theproto;
0111   Handle(Interface_SignType) thesign;
0112   Interface_GeneralLib thelib;
0113   Interface_DataMapOfTransientInteger thentnum;
0114   TColStd_IndexedDataMapOfTransientTransient thentmod;
0115 
0116 
0117 };
0118 
0119 
0120 
0121 
0122 
0123 
0124 
0125 #endif // _Interface_GTool_HeaderFile