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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <Expr_Operators.hxx>
19 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x,const Handle(Expr_GeneralExpression)& y)
21 return new Expr_Sum(x,y);
24 Handle(Expr_Sum) operator+(const Standard_Real x,const Handle(Expr_GeneralExpression)& y)
26 Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
27 return new Expr_Sum(nv,y);
30 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
35 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
37 return new Expr_Difference(x,y);
40 Handle(Expr_Difference) operator-(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
42 Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
43 return new Expr_Difference(nv,y);
46 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
48 Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
49 return new Expr_Difference(x,nv);
52 Handle(Expr_UnaryMinus) operator-(const Handle(Expr_GeneralExpression)& x)
54 return new Expr_UnaryMinus(x);
57 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
59 return new Expr_Product(x,y);
62 Handle(Expr_Product) operator*(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
64 Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
65 return new Expr_Product(nv,y);
68 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
73 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
75 return new Expr_Division(x,y);
78 Handle(Expr_Division) operator/(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
80 Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
81 return new Expr_Division(nv,y);
84 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
86 Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
87 return new Expr_Division(x,nv);