Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:16:07

0001 // Created on: 1994-04-21
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1994-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 _IFSelect_Signature_HeaderFile
0018 #define _IFSelect_Signature_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Standard_Integer.hxx>
0023 #include <TCollection_AsciiString.hxx>
0024 #include <NCollection_Sequence.hxx>
0025 #include <NCollection_HSequence.hxx>
0026 #include <Interface_SignType.hxx>
0027 class Standard_Transient;
0028 class Interface_InterfaceModel;
0029 
0030 //! Signature provides the basic service used by the classes
0031 //! SelectSignature and Counter (i.e. Name, Value), which is :
0032 //! - for an entity in a model, give a characteristic string, its
0033 //! signature
0034 //! This string has not to be unique in the model, but gives a
0035 //! value for such or such important feature.
0036 //! Examples : Dynamic Type; Category; etc
0037 class IFSelect_Signature : public Interface_SignType
0038 {
0039 
0040 public:
0041   //! Sets the information data to tell "integer cases" with
0042   //! possible min and max values
0043   //! To be called when creating
0044   Standard_EXPORT void SetIntCase(const bool hasmin,
0045                                   const int  valmin,
0046                                   const bool hasmax,
0047                                   const int  valmax);
0048 
0049   //! Tells if this Signature gives integer values
0050   //! and returns values from SetIntCase if True
0051   Standard_EXPORT bool IsIntCase(bool& hasmin, int& valmin, bool& hasmax, int& valmax) const;
0052 
0053   //! Adds a possible case
0054   //! To be called when creating, IF the list of possible cases for
0055   //! Value is known when starting
0056   //! For instance, for CDL types, rather do not fill this,
0057   //! but for a specific enumeration (such as a status), can be used
0058   Standard_EXPORT void AddCase(const char* const acase);
0059 
0060   //! Returns the predefined list of possible cases, filled by AddCase
0061   //! Null Handle if no predefined list (hence, to be counted)
0062   //! Useful to filter on really possible vase, for instance, or
0063   //! for a help
0064   Standard_EXPORT occ::handle<NCollection_HSequence<TCollection_AsciiString>> CaseList() const;
0065 
0066   //! Returns an identification of the Signature (a word), given at
0067   //! initialization time
0068   //! Returns the Signature for a Transient object. It is specific
0069   //! of each sub-class of Signature. For a Null Handle, it should
0070   //! provide ""
0071   //! It can work with the model which contains the entity
0072   Standard_EXPORT const char* Name() const override;
0073 
0074   //! The label of a Signature uses its name as follow :
0075   //! "Signature : <name>"
0076   Standard_EXPORT TCollection_AsciiString Label() const;
0077 
0078   //! Tells if the value for <ent> in <model> matches a text, with
0079   //! a criterium <exact>.
0080   //! The default definition calls MatchValue
0081   //! Can be redefined
0082   Standard_EXPORT virtual bool Matches(const occ::handle<Standard_Transient>&       ent,
0083                                        const occ::handle<Interface_InterfaceModel>& model,
0084                                        const TCollection_AsciiString&               text,
0085                                        const bool                                   exact) const;
0086 
0087   //! Default procedure to tell if a value <val> matches a text
0088   //! with a criterium <exact>. <exact> = True requires equality,
0089   //! else only contained (no reg-exp)
0090   Standard_EXPORT static bool MatchValue(const char* const              val,
0091                                          const TCollection_AsciiString& text,
0092                                          const bool                     exact);
0093 
0094   //! This procedure converts an Integer to a CString
0095   //! It is a convenient way when the value of a signature has the
0096   //! form of a simple integer value
0097   //! The value is to be used immediately (one buffer only, no copy)
0098   Standard_EXPORT static const char* IntValue(const int val);
0099 
0100   DEFINE_STANDARD_RTTIEXT(IFSelect_Signature, Interface_SignType)
0101 
0102 protected:
0103   //! Initializes a Signature with its name
0104   Standard_EXPORT IFSelect_Signature(const char* const name);
0105 
0106   TCollection_AsciiString thename;
0107 
0108 private:
0109   int                                                         thecasi[3];
0110   occ::handle<NCollection_HSequence<TCollection_AsciiString>> thecasl;
0111 };
0112 
0113 #endif // _IFSelect_Signature_HeaderFile