0022923: The command 'intersect' throws an exception.
[occt.git] / src / Expr / Expr_Operators.cxx
1 //static const char* sccsid = "@(#)Expr_Operators.cxx   3.2 95/01/10"; // Do not delete this line. Used by sccs.
2 // Copyright:   Matra-Datavision 1992
3 // File:        Expr_Operators.cxx
4 // Created:     Fri Jul 10 10:49:40 1992
5 // Author:      Arnaud BOUZY
6 //              <adn>
7
8 #include <Expr_Operators.hxx>
9
10 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x,const Handle(Expr_GeneralExpression)& y)
11 {
12   return new Expr_Sum(x,y);
13 }
14
15 Handle(Expr_Sum) operator+(const Standard_Real x,const Handle(Expr_GeneralExpression)& y)
16 {
17   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
18   return new Expr_Sum(nv,y);
19 }
20
21 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
22 {
23   return y+x;
24 }
25
26 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
27 {
28   return new Expr_Difference(x,y);
29 }
30
31 Handle(Expr_Difference) operator-(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
32 {
33   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
34   return new Expr_Difference(nv,y);
35 }
36
37 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
38 {
39   Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
40   return new Expr_Difference(x,nv);
41 }
42
43 Handle(Expr_UnaryMinus) operator-(const Handle(Expr_GeneralExpression)& x)
44 {
45   return new Expr_UnaryMinus(x);
46 }
47
48 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
49 {
50   return new Expr_Product(x,y);
51 }
52
53 Handle(Expr_Product) operator*(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
54 {
55   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
56   return new Expr_Product(nv,y);
57 }
58
59 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
60 {
61   return y*x;
62 }
63
64 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
65 {
66   return new Expr_Division(x,y);
67 }
68
69 Handle(Expr_Division) operator/(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
70 {
71   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
72   return new Expr_Division(nv,y);
73 }
74
75 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
76 {
77   Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
78   return new Expr_Division(x,nv);
79 }
80