00001 /* 00002 Copyright (C) 2010 - 2014 Christoph Haenisch 00003 00004 Chair of Medical Engineering (mediTEC) 00005 RWTH Aachen University 00006 Pauwelsstr. 20 00007 52074 Aachen 00008 Germany 00009 00010 See license.txt for more information. 00011 00012 Version 0.8.1 (2016-04-15) 00013 */ 00014 00021 #include "TRTK/Coordinate.hpp" 00022 00023 00024 namespace TRTK 00025 { 00026 00027 00028 // Operators of the form int op Coordinate<class double> 00029 00040 Coordinate<double> operator+(int value, const Coordinate<double> & coordinate) 00041 { 00042 return coordinate + value; 00043 } 00044 00045 00057 Coordinate<double> operator-(int value, const Coordinate<double> & coordinate) 00058 { 00059 return coordinate * (-1) + value; 00060 } 00061 00062 00073 Coordinate<double> operator*(int value, const Coordinate<double> & coordinate) 00074 { 00075 return coordinate * value; 00076 } 00077 00078 00090 Coordinate<double> operator/(int value, const Coordinate<double> & coordinate) 00091 { 00092 Coordinate<double> coordinate2; 00093 coordinate2.resize(coordinate.size(), value); 00094 00095 return coordinate2.operator/(coordinate); 00096 } 00097 00098 00099 // Operators of the form double op Coordinate<int> 00100 00111 Coordinate<int> operator+(double value, const Coordinate<int> & coordinate) 00112 { 00113 return coordinate + static_cast<int>(value); 00114 } 00115 00116 00129 Coordinate<int> operator-(double value, const Coordinate<int> & coordinate) 00130 { 00131 return coordinate * (-1) + static_cast<int>(value); 00132 } 00133 00134 00148 Coordinate<int> operator*(double value, const Coordinate<int> & coordinate) 00149 { 00150 return Coordinate<double>(coordinate) * value; 00151 // return coordinate * static_cast<int>(value); 00152 } 00153 00154 00168 Coordinate<int> operator/(double value, const Coordinate<int> & coordinate) 00169 { 00170 Coordinate<double> coordinate2; 00171 coordinate2.resize(coordinate.size(), value); 00172 00173 return coordinate2.operator/(coordinate); 00174 } 00175 00176 00177 } // namespace TRTK
Documentation generated by Doxygen