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
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.
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.
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.
22 #include <Expr_Operators.hxx>
24 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x,const Handle(Expr_GeneralExpression)& y)
26 return new Expr_Sum(x,y);
29 Handle(Expr_Sum) operator+(const Standard_Real x,const Handle(Expr_GeneralExpression)& y)
31 Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
32 return new Expr_Sum(nv,y);
35 Handle(Expr_Sum) operator+(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
40 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
42 return new Expr_Difference(x,y);
45 Handle(Expr_Difference) operator-(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
47 Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
48 return new Expr_Difference(nv,y);
51 Handle(Expr_Difference) operator-(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
53 Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
54 return new Expr_Difference(x,nv);
57 Handle(Expr_UnaryMinus) operator-(const Handle(Expr_GeneralExpression)& x)
59 return new Expr_UnaryMinus(x);
62 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
64 return new Expr_Product(x,y);
67 Handle(Expr_Product) operator*(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
69 Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
70 return new Expr_Product(nv,y);
73 Handle(Expr_Product) operator*(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
78 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Handle(Expr_GeneralExpression)& y)
80 return new Expr_Division(x,y);
83 Handle(Expr_Division) operator/(const Standard_Real x, const Handle(Expr_GeneralExpression)& y)
85 Handle(Expr_NumericValue) nv = new Expr_NumericValue(x);
86 return new Expr_Division(nv,y);
89 Handle(Expr_Division) operator/(const Handle(Expr_GeneralExpression)& x, const Standard_Real y)
91 Handle(Expr_NumericValue) nv = new Expr_NumericValue(y);
92 return new Expr_Division(x,nv);