0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / Expr / Expr_GeneralRelation.hxx
CommitLineData
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_GeneralRelation_HeaderFile
18#define _Expr_GeneralRelation_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
25e59720 23#include <Standard_Transient.hxx>
42cf5bc1 24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26class Standard_OutOfRange;
27class Standard_NumericError;
28class Expr_GeneralExpression;
29class Expr_NamedUnknown;
30class TCollection_AsciiString;
31
32
33class Expr_GeneralRelation;
25e59720 34DEFINE_STANDARD_HANDLE(Expr_GeneralRelation, Standard_Transient)
42cf5bc1 35
36//! Defines the general purposes of any relation between
37//! expressions.
25e59720 38class Expr_GeneralRelation : public Standard_Transient
42cf5bc1 39{
40
41public:
42
43
44 //! Returns the current status of the relation
45 Standard_EXPORT virtual Standard_Boolean IsSatisfied() const = 0;
46
47 //! Tests if <me> is linear between its NamedUnknowns.
48 Standard_EXPORT virtual Standard_Boolean IsLinear() const = 0;
49
50 //! Returns a GeneralRelation after replacement of
51 //! NamedUnknowns by an associated expression, and after
52 //! values computation.
53 Standard_EXPORT virtual Handle(Expr_GeneralRelation) Simplified() const = 0;
54
55 //! Replaces NamedUnknowns by associated expressions,
56 //! and computes values in <me>.
57 Standard_EXPORT virtual void Simplify() = 0;
58
59 //! Returns a copy of <me> having the same unknowns and
60 //! functions.
61 Standard_EXPORT virtual Handle(Expr_GeneralRelation) Copy() const = 0;
62
63 //! Returns the number of relations contained in <me>.
64 Standard_EXPORT virtual Standard_Integer NbOfSubRelations() const = 0;
65
66 //! Returns the number of SingleRelations contained in
67 //! <me>.
68 Standard_EXPORT virtual Standard_Integer NbOfSingleRelations() const = 0;
69
70 //! Returns the relation denoted by <index> in <me>.
71 //! An exception is raised if <index> is out of range.
72 Standard_EXPORT virtual Handle(Expr_GeneralRelation) SubRelation (const Standard_Integer index) const = 0;
73
74 //! Tests if <exp> contains <var>.
75 Standard_EXPORT virtual Standard_Boolean Contains (const Handle(Expr_GeneralExpression)& exp) const = 0;
76
77 //! Replaces all occurences of <var> with <with> in <me>.
78 Standard_EXPORT virtual void Replace (const Handle(Expr_NamedUnknown)& var, const Handle(Expr_GeneralExpression)& with) = 0;
79
80 //! returns a string representing <me> in a readable way.
81 Standard_EXPORT virtual TCollection_AsciiString String() const = 0;
82
83
84
85
25e59720 86 DEFINE_STANDARD_RTTIEXT(Expr_GeneralRelation,Standard_Transient)
42cf5bc1 87
88protected:
89
90
91
92
93private:
94
95
96
97
98};
99
100
101
102
103
104
105
106#endif // _Expr_GeneralRelation_HeaderFile