1 // Created on: 1991-01-14
2 // Created by: Arnaud BOUZY
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Expr_SystemRelation_HeaderFile
18 #define _Expr_SystemRelation_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Expr_SequenceOfGeneralRelation.hxx>
24 #include <Expr_GeneralRelation.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 class Standard_OutOfRange;
28 class Standard_NoSuchObject;
29 class Standard_DimensionMismatch;
30 class Standard_NumericError;
31 class Expr_GeneralRelation;
32 class Expr_GeneralExpression;
33 class Expr_NamedUnknown;
34 class TCollection_AsciiString;
37 class Expr_SystemRelation;
38 DEFINE_STANDARD_HANDLE(Expr_SystemRelation, Expr_GeneralRelation)
41 class Expr_SystemRelation : public Expr_GeneralRelation
47 //! Creates a system with one relation
48 Standard_EXPORT Expr_SystemRelation(const Handle(Expr_GeneralRelation)& relation);
50 //! Appends <relation> in the list of components of <me>.
51 Standard_EXPORT void Add (const Handle(Expr_GeneralRelation)& relation);
53 Standard_EXPORT void Remove (const Handle(Expr_GeneralRelation)& relation);
55 //! Tests if <me> is linear between its NamedUnknowns.
56 Standard_EXPORT Standard_Boolean IsLinear() const Standard_OVERRIDE;
58 //! Returns the number of relations contained in <me>.
59 Standard_EXPORT Standard_Integer NbOfSubRelations() const Standard_OVERRIDE;
61 //! Returns the number of SingleRelations contained in
63 Standard_EXPORT Standard_Integer NbOfSingleRelations() const Standard_OVERRIDE;
65 //! Returns the relation denoted by <index> in <me>.
66 //! An exception is raised if <index> is out of range.
67 Standard_EXPORT Handle(Expr_GeneralRelation) SubRelation (const Standard_Integer index) const Standard_OVERRIDE;
69 Standard_EXPORT Standard_Boolean IsSatisfied() const Standard_OVERRIDE;
71 //! Returns a GeneralRelation after replacement of
72 //! NamedUnknowns by an associated expression, and after
73 //! values computation.
74 Standard_EXPORT Handle(Expr_GeneralRelation) Simplified() const Standard_OVERRIDE;
76 //! Replaces NamedUnknowns by associated expressions,
77 //! and computes values in <me>.
78 Standard_EXPORT void Simplify() Standard_OVERRIDE;
80 //! Returns a copy of <me> having the same unknowns and functions.
81 Standard_EXPORT Handle(Expr_GeneralRelation) Copy() const Standard_OVERRIDE;
83 //! Tests if <me> contains <exp>.
84 Standard_EXPORT Standard_Boolean Contains (const Handle(Expr_GeneralExpression)& exp) const Standard_OVERRIDE;
86 //! Replaces all occurences of <var> with <with> in <me>.
87 Standard_EXPORT void Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with) Standard_OVERRIDE;
89 //! returns a string representing <me> in a readable way.
90 Standard_EXPORT TCollection_AsciiString String() const Standard_OVERRIDE;
95 DEFINE_STANDARD_RTTIEXT(Expr_SystemRelation,Expr_GeneralRelation)
105 Expr_SequenceOfGeneralRelation myRelations;
116 #endif // _Expr_SystemRelation_HeaderFile