0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / Expr / Expr_Operators.cxx
1 // Created on: 1992-07-10
2 // Created by: Arnaud BOUZY
3 // Copyright (c) 1992-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 #include <Expr_Operators.hxx>
18
19 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x,const Handle(Expr_GeneralExpression)& y)
20 {
21   return new Expr_Sum(x,y);
22 }
23
24 Handle(Expr_Sum) operator+(const Standard_Real x,const Handle(Expr_GeneralExpression)& y)
25 {
26   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
27   return new Expr_Sum(nv,y);
28 }
29
30 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
31 {
32   return y+x;
33 }
34
35 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
36 {
37   return new Expr_Difference(x,y);
38 }
39
40 Handle(Expr_Difference) operator-(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
41 {
42   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
43   return new Expr_Difference(nv,y);
44 }
45
46 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
47 {
48   Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
49   return new Expr_Difference(x,nv);
50 }
51
52 Handle(Expr_UnaryMinus) operator-(const Handle(Expr_GeneralExpression)& x)
53 {
54   return new Expr_UnaryMinus(x);
55 }
56
57 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
58 {
59   return new Expr_Product(x,y);
60 }
61
62 Handle(Expr_Product) operator*(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
63 {
64   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
65   return new Expr_Product(nv,y);
66 }
67
68 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
69 {
70   return y*x;
71 }
72
73 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
74 {
75   return new Expr_Division(x,y);
76 }
77
78 Handle(Expr_Division) operator/(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
79 {
80   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
81   return new Expr_Division(nv,y);
82 }
83
84 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
85 {
86   Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
87   return new Expr_Division(x,nv);
88 }
89