0022904: Clean up sccsid variables
[occt.git] / src / Expr / Expr_GreaterThan.cxx
1 // Copyright:   Matra-Datavision 1991
2 // File:        Expr_GreaterThan.cxx
3 // Created:     Thu Jun 13 10:20:34 1991
4 // Author:      Arnaud BOUZY
5 //              <adn>
6
7 #include <Expr_GreaterThan.ixx>
8 #include <Expr_NumericValue.hxx>
9 #include <Expr.hxx>
10
11 Expr_GreaterThan::Expr_GreaterThan (const Handle(Expr_GeneralExpression)& exp1, const Handle(Expr_GeneralExpression)& exp2)
12 {
13   SetFirstMember(exp1);
14   SetSecondMember(exp2);
15 }
16
17 Standard_Boolean Expr_GreaterThan::IsSatisfied () const
18 {
19   Handle(Expr_GeneralExpression) fm = FirstMember();
20   Handle(Expr_GeneralExpression) sm = SecondMember();
21   fm = fm->Simplified();
22   sm = sm->Simplified();
23   if (fm->IsKind(STANDARD_TYPE(Expr_NumericValue))) {
24     if (sm->IsKind(STANDARD_TYPE(Expr_NumericValue))) {
25       Handle(Expr_NumericValue) nfm = Handle(Expr_NumericValue)::DownCast(fm);
26       Handle(Expr_NumericValue) nsm = Handle(Expr_NumericValue)::DownCast(sm);
27       return (nfm->GetValue() > nsm->GetValue());
28     }
29   }
30   return Standard_False;
31 }
32
33 Handle(Expr_GeneralRelation) Expr_GreaterThan::Simplified () const
34 {
35   Handle(Expr_GeneralExpression) fm = FirstMember();
36   Handle(Expr_GeneralExpression) sm = SecondMember();
37   return new Expr_GreaterThan(fm->Simplified(),sm->Simplified());
38 }
39
40 void Expr_GreaterThan::Simplify ()
41 {
42   Handle(Expr_GeneralExpression) fm = FirstMember();
43   Handle(Expr_GeneralExpression) sm = SecondMember();
44   SetFirstMember(fm->Simplified());
45   SetSecondMember(sm->Simplified());
46 }
47
48 Handle(Expr_GeneralRelation) Expr_GreaterThan::Copy () const
49 {
50   return new Expr_GreaterThan(Expr::CopyShare(FirstMember()),
51                               Expr::CopyShare(SecondMember()));
52 }
53
54 TCollection_AsciiString Expr_GreaterThan::String() const
55 {
56   return FirstMember()->String() + " > " + SecondMember()->String();
57 }