comparison Framework/Layers/CircleMeasureTracker.cpp @ 376:70256a53ff21

fix compatibility with Visual Studio 2008
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 05 Nov 2018 13:25:03 +0100
parents a7de01c8fd29
children b70e9be013e4
comparison
equal deleted inserted replaced
373:d6136a7e914d 376:70256a53ff21
17 * You should have received a copy of the GNU Affero General Public License 17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/ 19 **/
20 20
21 21
22 #define _USE_MATH_DEFINES // To access M_PI in Visual Studio
23 #include <cmath>
24
25 #include "CircleMeasureTracker.h" 22 #include "CircleMeasureTracker.h"
26 23
27 #include <stdio.h> 24 #include <stdio.h>
25 #include <boost/math/constants/constants.hpp>
28 26
29 namespace OrthancStone 27 namespace OrthancStone
30 { 28 {
31 CircleMeasureTracker::CircleMeasureTracker(IStatusBar* statusBar, 29 CircleMeasureTracker::CircleMeasureTracker(IStatusBar* statusBar,
32 const CoordinateSystem3D& slice, 30 const CoordinateSystem3D& slice,
64 62
65 cairo_t* cr = context.GetObject(); 63 cairo_t* cr = context.GetObject();
66 cairo_save(cr); 64 cairo_save(cr);
67 cairo_set_line_width(cr, 2.0 / zoom); 65 cairo_set_line_width(cr, 2.0 / zoom);
68 cairo_translate(cr, x, y); 66 cairo_translate(cr, x, y);
69 cairo_arc(cr, 0, 0, r, 0, 2 * M_PI); 67 cairo_arc(cr, 0, 0, r, 0, 2.0 * boost::math::constants::pi<double>());
70 cairo_stroke_preserve(cr); 68 cairo_stroke_preserve(cr);
71 cairo_stroke(cr); 69 cairo_stroke(cr);
72 cairo_restore(cr); 70 cairo_restore(cr);
73 71
74 context.DrawText(font_, FormatRadius(), x, y, BitmapAnchor_Center); 72 context.DrawText(font_, FormatRadius(), x, y, BitmapAnchor_Center);