Test for 0022778: Bug in BRepMesh
[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-2012 OPEN CASCADE SAS
5 //
6 // The content of this file is subject to the Open CASCADE Technology Public
7 // License Version 6.5 (the "License"). You may not use the content of this file
8 // except in compliance with the License. Please obtain a copy of the License
9 // at http://www.opencascade.org and read it completely before using this file.
10 //
11 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 //
14 // The Original Code and all software distributed under the License is
15 // distributed on an "AS IS" basis, without warranty of any kind, and the
16 // Initial Developer hereby disclaims all such warranties, including without
17 // limitation, any warranties of merchantability, fitness for a particular
18 // purpose or non-infringement. Please see the License for the specific terms
19 // and conditions governing the rights and limitations under the License.
20
21
22 #include <Expr_Operators.hxx>
23
24 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x,const Handle(Expr_GeneralExpression)& y)
25 {
26   return new Expr_Sum(x,y);
27 }
28
29 Handle(Expr_Sum) operator+(const Standard_Real x,const Handle(Expr_GeneralExpression)& y)
30 {
31   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
32   return new Expr_Sum(nv,y);
33 }
34
35 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
36 {
37   return y+x;
38 }
39
40 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
41 {
42   return new Expr_Difference(x,y);
43 }
44
45 Handle(Expr_Difference) operator-(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
46 {
47   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
48   return new Expr_Difference(nv,y);
49 }
50
51 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
52 {
53   Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
54   return new Expr_Difference(x,nv);
55 }
56
57 Handle(Expr_UnaryMinus) operator-(const Handle(Expr_GeneralExpression)& x)
58 {
59   return new Expr_UnaryMinus(x);
60 }
61
62 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
63 {
64   return new Expr_Product(x,y);
65 }
66
67 Handle(Expr_Product) operator*(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
68 {
69   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
70   return new Expr_Product(nv,y);
71 }
72
73 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
74 {
75   return y*x;
76 }
77
78 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
79 {
80   return new Expr_Division(x,y);
81 }
82
83 Handle(Expr_Division) operator/(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
84 {
85   Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
86   return new Expr_Division(nv,y);
87 }
88
89 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
90 {
91   Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
92   return new Expr_Division(x,nv);
93 }
94