瀏覽代碼

render_to_png_async uses std thread instead of boost

Former-commit-id: e6d4dae9b12b2468de9395a6ce88503f92bb6ff3
Alec Jacobson 11 年之前
父節點
當前提交
a80ece525a

+ 1 - 1
README.md

@@ -12,7 +12,7 @@ a single function.  The function may have multiple prototypes. All functions
 should use the igl namespace and should adhere to the conventions and styles
 listed below.
 
-> **New:** As of 1 July 2014, we have release our libigl beta version 1.0.
+> **New:** As of 1 July 2014, we have released libigl as beta version 1.0.
 > There are a number of changes we collected for this release to minimize
 > confusion and changes to how you use libigl. See [Version 1.0
 > Changes][version1.0changes].

+ 2 - 3
include/igl/draw_beach_ball.cpp

@@ -28,9 +28,6 @@
 ////////////////////////////////////////////////////////////////////////////
 // Begin Copied Straight from AntTweakBar
 ////////////////////////////////////////////////////////////////////////////
-static const float  FLOAT_EPS     = 1.0e-7f;
-static const float  FLOAT_EPS_SQ  = 1.0e-14f;
-static const float  FLOAT_PI      = 3.14159265358979323846f;
 enum EArrowParts     { ARROW_CONE, ARROW_CONE_CAP, ARROW_CYL, ARROW_CYL_CAP };
 
 template <typename T> SAFE_INLINE const T& TClamp(const T& X, const T& Limit1, const T& Limit2)
@@ -133,6 +130,7 @@ static void CreateSphere()
                     norm = sqrtf(x*x+y*y+z*z);
                     x /= norm; y /= norm; z /= norm;
                     s_SphTri.push_back(x); s_SphTri.push_back(y); s_SphTri.push_back(z);
+static const float  FLOAT_EPS     = 1.0e-7f;
                     if( u[l]+v[l]>FLOAT_EPS )
                         col = ColorBlend(COL_A[i], ColorBlend(COL_B[i], COL_C[i], v[l]/(u[l]+v[l])), u[l]+v[l]);
                     else
@@ -169,6 +167,7 @@ static void CreateArrow()
     float x0, x1, y0, y1, z0, z1, a0, a1, nx, nn;
     for(i=0; i<SUBDIV; ++i)
     {
+static const float  FLOAT_PI      = 3.14159265358979323846f;
         a0 = 2.0f*FLOAT_PI*(float(i))/SUBDIV;
         a1 = 2.0f*FLOAT_PI*(float(i+1))/SUBDIV;
         x0 = ARROW_BGN;

+ 2 - 4
include/igl/png/render_to_png_async.cpp

@@ -5,7 +5,6 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_NO_BOOST
 #include "render_to_png_async.h"
 #include <YImage.hpp>
 
@@ -43,7 +42,7 @@ static IGL_INLINE bool render_to_png_async_helper(
   return img->save(png_file.c_str(),fast);
 }
 
-IGL_INLINE boost::thread igl::render_to_png_async(
+IGL_INLINE std::thread igl::render_to_png_async(
   const std::string png_file,
   const int width,
   const int height,
@@ -62,6 +61,5 @@ IGL_INLINE boost::thread igl::render_to_png_async(
     GL_UNSIGNED_BYTE,
     img->data());
   // Part that should be asynchronous  
-  return boost::thread(render_to_png_async_helper,img,png_file,alpha,fast);
+  return std::thread(render_to_png_async_helper,img,png_file,alpha,fast);
 }
-#endif

+ 3 - 5
include/igl/png/render_to_png_async.h

@@ -5,11 +5,11 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_NO_BOOST
 #ifndef IGL_RENDER_TO_PNG_ASYNC_H
 #define IGL_RENDER_TO_PNG_ASYNC_H
 #include <igl/igl_inline.h>
-#include <boost/thread/thread.hpp>
+#include <thread>
+//#include <boost/thread/thread.hpp>
 
 #include <string>
 namespace igl
@@ -27,7 +27,7 @@ namespace igl
   // Returns true only if no errors occured
   //
   // See also: igl/render_to_tga which is faster but writes .tga files
-  IGL_INLINE boost::thread render_to_png_async(
+  IGL_INLINE std::thread render_to_png_async(
     const std::string png_file,
     const int width,
     const int height,
@@ -40,5 +40,3 @@ namespace igl
 #endif
 
 #endif
-
-#endif

+ 1 - 1
tutorial/tutorial.html.REMOVED.git-id

@@ -1 +1 @@
-7c2e6ed8a0789197fdaae35c8a1cbd5f502f3c53
+141eb93f575045ab7a950e5674b54ec2fa87b197

+ 1 - 1
tutorial/tutorial.md.REMOVED.git-id

@@ -1 +1 @@
-2bcd36c5c18863f2eaf279713ab8b56765c6ccb0
+d0833fffecc624061e2d057e37e4e3e99cc11351