Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-15 08:29:22

0001 // Created on: 1991-01-14
0002 // Created by: Arnaud BOUZY
0003 // Copyright (c) 1991-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 _Expr_GeneralRelation_HeaderFile
0018 #define _Expr_GeneralRelation_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <Standard_Integer.hxx>
0025 class Expr_GeneralExpression;
0026 class Expr_NamedUnknown;
0027 class TCollection_AsciiString;
0028 
0029 class Expr_GeneralRelation;
0030 DEFINE_STANDARD_HANDLE(Expr_GeneralRelation, Standard_Transient)
0031 
0032 //! Defines the general purposes of any relation between
0033 //! expressions.
0034 class Expr_GeneralRelation : public Standard_Transient
0035 {
0036 
0037 public:
0038   //! Returns the current status of the relation
0039   Standard_EXPORT virtual Standard_Boolean IsSatisfied() const = 0;
0040 
0041   //! Tests if <me> is linear between its NamedUnknowns.
0042   Standard_EXPORT virtual Standard_Boolean IsLinear() const = 0;
0043 
0044   //! Returns a GeneralRelation after replacement of
0045   //! NamedUnknowns by an associated expression, and after
0046   //! values computation.
0047   Standard_EXPORT virtual Handle(Expr_GeneralRelation) Simplified() const = 0;
0048 
0049   //! Replaces NamedUnknowns by associated expressions,
0050   //! and computes values in <me>.
0051   Standard_EXPORT virtual void Simplify() = 0;
0052 
0053   //! Returns a copy of <me> having the same unknowns and
0054   //! functions.
0055   Standard_EXPORT virtual Handle(Expr_GeneralRelation) Copy() const = 0;
0056 
0057   //! Returns the number of relations contained in <me>.
0058   Standard_EXPORT virtual Standard_Integer NbOfSubRelations() const = 0;
0059 
0060   //! Returns the number of SingleRelations contained in
0061   //! <me>.
0062   Standard_EXPORT virtual Standard_Integer NbOfSingleRelations() const = 0;
0063 
0064   //! Returns the relation denoted by <index> in <me>.
0065   //! An exception is raised if <index> is out of range.
0066   Standard_EXPORT virtual Handle(Expr_GeneralRelation) SubRelation(
0067     const Standard_Integer index) const = 0;
0068 
0069   //! Tests if <exp> contains <var>.
0070   Standard_EXPORT virtual Standard_Boolean Contains(
0071     const Handle(Expr_GeneralExpression)& exp) const = 0;
0072 
0073   //! Replaces all occurrences of <var> with <with> in <me>.
0074   Standard_EXPORT virtual void Replace(const Handle(Expr_NamedUnknown)&      var,
0075                                        const Handle(Expr_GeneralExpression)& with) = 0;
0076 
0077   //! returns a string representing <me> in a readable way.
0078   Standard_EXPORT virtual TCollection_AsciiString String() const = 0;
0079 
0080   DEFINE_STANDARD_RTTIEXT(Expr_GeneralRelation, Standard_Transient)
0081 
0082 protected:
0083 private:
0084 };
0085 
0086 #endif // _Expr_GeneralRelation_HeaderFile