瀏覽代碼

Merge branch 'master-upstream' into python_bindings

Former-commit-id: f4300900944a269730265b903903419423c86e95
Sebastian Koch 9 年之前
父節點
當前提交
884eb5bc9c
共有 4 個文件被更改,包括 7 次插入6 次删除
  1. 1 0
      .gitignore
  2. 1 1
      .travis.yml
  3. 1 2
      python/CMakeLists.txt
  4. 4 3
      python/tutorial/607_ScreenCapture.py

+ 1 - 0
.gitignore

@@ -94,3 +94,4 @@ python/build3
 *.pyc
 python/build4
 python/scripts/generated
+python/builddebug

+ 1 - 1
.travis.yml

@@ -11,7 +11,7 @@ matrix:
         - cd python
         - mkdir build
         - cd build
-        - cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 -DLIBIGL_WITH_EMBREE=OFF ../
+        - cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 -DLIBIGL_WITH_EMBREE=OFF -DLIBIGL_USE_STATIC_LIBRARY=ON ../
         - make -j 2
         - cd ../../
         - cd tutorial

+ 1 - 2
python/CMakeLists.txt

@@ -62,7 +62,7 @@ option(LIBIGL_WITH_LIM              "Use LIM"            ON)
 option(LIBIGL_WITH_MATLAB           "Use Matlab"         OFF)
 option(LIBIGL_WITH_MOSEK            "Use MOSEK"          OFF)
 option(LIBIGL_WITH_BBW              "Use BBW"            ON)
-option(LIBIGL_WITH_OPENGL_AND_PNG   "Use OpenGL"         ON)
+option(LIBIGL_WITH_PNG              "Use PNG"            ON)
 option(LIBIGL_WITH_TETGEN           "Use Tetgen"         ON)
 option(LIBIGL_WITH_TRIANGLE         "Use Triangle"       ON)
 option(LIBIGL_WITH_XML              "Use XML"            ON)
@@ -190,4 +190,3 @@ elseif (UNIX)
     endif()
   endif()
 endif()
-

+ 4 - 3
python/tutorial/607_ScreenCapture.py

@@ -9,6 +9,7 @@ from shared import TUTORIAL_SHARED_PATH, check_dependencies
 dependencies = ["png", "viewer"]
 check_dependencies(dependencies)
 
+temp_png = os.path.join(os.getcwd(),"out.png")
 
 def key_down(viewer, key, modifier):
     if key == ord('1'):
@@ -22,7 +23,7 @@ def key_down(viewer, key, modifier):
         viewer.core.draw_buffer(viewer.data, viewer.opengl, False, R, G, B, A)
 
         # Save it to a PNG
-        igl.png.writePNG(R, G, B, A, "out.png")
+        igl.png.writePNG(R, G, B, A, temp_png)
     elif key == ord('2'):
         # Allocate temporary buffers
         R = igl.eigen.MatrixXuc()
@@ -31,7 +32,7 @@ def key_down(viewer, key, modifier):
         A = igl.eigen.MatrixXuc()
 
         # Read the PNG
-        igl.png.readPNG("out.png", R, G, B, A)
+        igl.png.readPNG(temp_png, R, G, B, A)
 
         # Replace the mesh with a triangulated square
         V = igl.eigen.MatrixXd([[-0.5, -0.5, 0],
@@ -74,4 +75,4 @@ if __name__ == "__main__":
     viewer.data.set_mesh(V, F)
     viewer.launch()
 
-    os.remove("out.png")
+    os.remove(temp_png)