42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Expr_SingleRelation_HeaderFile |
18 | #define _Expr_SingleRelation_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Expr_GeneralRelation.hxx> |
24 | #include <Standard_Boolean.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | class Expr_GeneralExpression; |
42cf5bc1 |
27 | class Expr_NamedUnknown; |
28 | |
29 | |
30 | class Expr_SingleRelation; |
31 | DEFINE_STANDARD_HANDLE(Expr_SingleRelation, Expr_GeneralRelation) |
32 | |
33 | |
34 | class Expr_SingleRelation : public Expr_GeneralRelation |
35 | { |
36 | |
37 | public: |
38 | |
39 | |
40 | //! Defines the first member of the relation |
41 | Standard_EXPORT void SetFirstMember (const Handle(Expr_GeneralExpression)& exp); |
42 | |
43 | //! Defines the second member of the relation |
44 | Standard_EXPORT void SetSecondMember (const Handle(Expr_GeneralExpression)& exp); |
45 | |
46 | //! Returns the first member of the relation |
47 | Standard_EXPORT Handle(Expr_GeneralExpression) FirstMember() const; |
48 | |
49 | //! Returns the second member of the relation |
50 | Standard_EXPORT Handle(Expr_GeneralExpression) SecondMember() const; |
51 | |
52 | //! Tests if <me> is linear between its NamedUnknowns. |
79104795 |
53 | Standard_EXPORT Standard_Boolean IsLinear() const Standard_OVERRIDE; |
42cf5bc1 |
54 | |
55 | //! Returns the number of relations contained in <me>. |
79104795 |
56 | Standard_EXPORT Standard_Integer NbOfSubRelations() const Standard_OVERRIDE; |
42cf5bc1 |
57 | |
58 | //! Returns the number of SingleRelations contained in |
59 | //! <me> (Always 1). |
79104795 |
60 | Standard_EXPORT Standard_Integer NbOfSingleRelations() const Standard_OVERRIDE; |
42cf5bc1 |
61 | |
62 | //! Returns the relation denoted by <index> in <me>. |
63 | //! An exception is raised if index is out of range. |
79104795 |
64 | Standard_EXPORT Handle(Expr_GeneralRelation) SubRelation (const Standard_Integer index) const Standard_OVERRIDE; |
42cf5bc1 |
65 | |
66 | //! Tests if <me> contains <exp>. |
79104795 |
67 | Standard_EXPORT Standard_Boolean Contains (const Handle(Expr_GeneralExpression)& exp) const Standard_OVERRIDE; |
42cf5bc1 |
68 | |
54adc5e9 |
69 | //! Replaces all occurrences of <var> with <with> in <me>. |
79104795 |
70 | Standard_EXPORT void Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with) Standard_OVERRIDE; |
42cf5bc1 |
71 | |
72 | |
73 | |
74 | |
92efcf78 |
75 | DEFINE_STANDARD_RTTIEXT(Expr_SingleRelation,Expr_GeneralRelation) |
42cf5bc1 |
76 | |
77 | protected: |
78 | |
79 | |
80 | |
81 | |
82 | private: |
83 | |
84 | |
85 | Handle(Expr_GeneralExpression) myFirstMember; |
86 | Handle(Expr_GeneralExpression) mySecondMember; |
87 | |
88 | |
89 | }; |
90 | |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | |
97 | #endif // _Expr_SingleRelation_HeaderFile |