|
||||
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_Protocol_HeaderFile 0018 #define _Interface_Protocol_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_Type.hxx> 0022 0023 #include <Standard_Transient.hxx> 0024 #include <Standard_Integer.hxx> 0025 class Interface_Graph; 0026 class Interface_Check; 0027 class Interface_InterfaceModel; 0028 0029 0030 class Interface_Protocol; 0031 DEFINE_STANDARD_HANDLE(Interface_Protocol, Standard_Transient) 0032 0033 //! General description of Interface Protocols. A Protocol defines 0034 //! a set of Entity types. This class provides also the notion of 0035 //! Active Protocol, as a working context, defined once then 0036 //! exploited by various Tools and Libraries. 0037 //! 0038 //! It also gives control of type definitions. By default, types 0039 //! are provided by CDL, but specific implementations, or topics 0040 //! like multi-typing, may involve another way 0041 class Interface_Protocol : public Standard_Transient 0042 { 0043 0044 public: 0045 0046 0047 //! Returns the Active Protocol, if defined (else, returns a 0048 //! Null Handle, which means "no defined active protocol") 0049 Standard_EXPORT static Handle(Interface_Protocol) Active(); 0050 0051 //! Sets a given Protocol to be the Active one (for the users of 0052 //! Active, see just above). Applies to every sub-type of Protocol 0053 Standard_EXPORT static void SetActive (const Handle(Interface_Protocol)& aprotocol); 0054 0055 //! Erases the Active Protocol (hence it becomes undefined) 0056 Standard_EXPORT static void ClearActive(); 0057 0058 //! Returns count of Protocol used as Resources (level one) 0059 Standard_EXPORT virtual Standard_Integer NbResources() const = 0; 0060 0061 //! Returns a Resource, given its rank (between 1 and NbResources) 0062 Standard_EXPORT virtual Handle(Interface_Protocol) Resource (const Standard_Integer num) const = 0; 0063 0064 //! Returns a unique positive CaseNumber for each Recognized 0065 //! Object. By default, recognition is based on Type(1) 0066 //! By default, calls the following one which is deferred. 0067 Standard_EXPORT virtual Standard_Integer CaseNumber (const Handle(Standard_Transient)& obj) const; 0068 0069 //! Returns True if type of <obj> is that defined from CDL 0070 //! This is the default but it may change according implementation 0071 Standard_EXPORT virtual Standard_Boolean IsDynamicType (const Handle(Standard_Transient)& obj) const; 0072 0073 //! Returns the count of DISTINCT types under which an entity may 0074 //! be processed. Each one is candidate to be recognized by 0075 //! TypeNumber, <obj> is then processed according it 0076 //! By default, returns 1 (the DynamicType) 0077 Standard_EXPORT virtual Standard_Integer NbTypes (const Handle(Standard_Transient)& obj) const; 0078 0079 //! Returns a type under which <obj> can be recognized and 0080 //! processed, according its rank in its definition list (see 0081 //! NbTypes). 0082 //! By default, returns DynamicType 0083 Standard_EXPORT Handle(Standard_Type) Type (const Handle(Standard_Transient)& obj, const Standard_Integer nt = 1) const; 0084 0085 //! Returns a unique positive CaseNumber for each Recognized Type, 0086 //! Returns Zero for "<type> not recognized" 0087 Standard_EXPORT virtual Standard_Integer TypeNumber (const Handle(Standard_Type)& atype) const = 0; 0088 0089 //! Evaluates a Global Check for a model (with its Graph) 0090 //! Returns True when done, False if data in model do not apply 0091 //! 0092 //! Very specific of each norm, i.e. of each protocol : the 0093 //! uppest level Protocol assumes it, it can call GlobalCheck of 0094 //! its resources only if it is necessary 0095 //! 0096 //! Default does nothing, can be redefined 0097 Standard_EXPORT virtual Standard_Boolean GlobalCheck (const Interface_Graph& G, Handle(Interface_Check)& ach) const; 0098 0099 //! Creates an empty Model of the considered Norm 0100 Standard_EXPORT virtual Handle(Interface_InterfaceModel) NewModel() const = 0; 0101 0102 //! Returns True if <model> is a Model of the considered Norm 0103 Standard_EXPORT virtual Standard_Boolean IsSuitableModel (const Handle(Interface_InterfaceModel)& model) const = 0; 0104 0105 //! Creates a new Unknown Entity for the considered Norm 0106 Standard_EXPORT virtual Handle(Standard_Transient) UnknownEntity() const = 0; 0107 0108 //! Returns True if <ent> is an Unknown Entity for the Norm, i.e. 0109 //! same Type as them created by method UnknownEntity 0110 //! (for an Entity out of the Norm, answer can be unpredicable) 0111 Standard_EXPORT virtual Standard_Boolean IsUnknownEntity (const Handle(Standard_Transient)& ent) const = 0; 0112 0113 0114 0115 0116 DEFINE_STANDARD_RTTIEXT(Interface_Protocol,Standard_Transient) 0117 0118 protected: 0119 0120 0121 0122 0123 private: 0124 0125 0126 0127 0128 }; 0129 0130 0131 0132 0133 0134 0135 0136 #endif // _Interface_Protocol_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |