Selaa lähdekoodia

write -> write_triangle_mesh

Former-commit-id: fbd5fb382f1839886b6b7cb663f60123b0dbd97a
Daniele Panozzo 11 vuotta sitten
vanhempi
commit
86e8846fe2

+ 2 - 2
examples/basic_topology/example1.cpp

@@ -29,12 +29,12 @@ int main (int argc, const char * argv[])
     cout << F << endl;
     cout << "-------------" << endl;
 
-    igl::write("bunny_out.off",V,F);
+    igl::write_triangle_mesh("bunny_out.off",V,F);
 
     // Face Topology
     cout << "TT Topology:" << endl;
     Eigen::MatrixXi TT;
-    igl::tt(V,F,TT);
+    igl::triangle_triangle_adjacency(V,F,TT);
     cout << TT << endl;
     cout << "-------------" << endl;
 

+ 6 - 6
examples/patches/example.cpp

@@ -149,7 +149,7 @@ void TW_CALL set_rotation_type(const void * value, void * clientData)
   using namespace igl;
   const RotationType old_rotation_type = rotation_type;
   rotation_type = *(const RotationType *)(value);
-  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP && 
+  if(rotation_type == ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP &&
     old_rotation_type != ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP)
   {
     push_undo();
@@ -291,7 +291,7 @@ void display()
     {
       draw_mesh(V,F,s.N,s.C);
     }
-  
+
     // visualize selected patch
     glLineWidth(10);
     glBegin(GL_TRIANGLES);
@@ -390,7 +390,7 @@ void mouse_wheel(int wheel, int direction, int mouse_x, int mouse_y)
       break;
     default:
     case CENTER_TYPE_FPS:
-      // Move `eye` and `at` 
+      // Move `eye` and `at`
       camera.dolly((wheel==0?Vector3d(0,0,1):Vector3d(-1,0,0))*0.1*direction);
       break;
   }
@@ -487,7 +487,7 @@ void mouse_drag(int mouse_x, int mouse_y)
       }
       case ROTATION_TYPE_TWO_AXIS_VALUATOR_FIXED_UP:
       {
-        // Rotate according to two axis valuator with fixed up vector 
+        // Rotate according to two axis valuator with fixed up vector
         two_axis_valuator_fixed_up(
           width, height,
           2.0,
@@ -606,7 +606,7 @@ bool save(const std::string & out_filename)
 {
   using namespace std;
   using namespace igl;
-  if(write(out_filename,V,F))
+  if(write_triangle_mesh(out_filename,V,F))
   {
     cout<<GREENGIN("Saved mesh to `"<<out_filename<<"` successfully.")<<endl;
     return true;
@@ -689,7 +689,7 @@ void key(unsigned char key, int mouse_x, int mouse_y)
         cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
       }
   }
-  
+
 }
 
 int main(int argc, char * argv[])

+ 9 - 9
include/igl/write.cpp → include/igl/write_triangle_mesh.cpp

@@ -1,11 +1,11 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
-// 
-// 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 
+//
+// 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/.
-#include "write.h"
+#include "write_triangle_mesh.h"
 
 #include "writeOBJ.h"
 #include "writeOFF.h"
@@ -13,7 +13,7 @@
 #include <iostream>
 
 template <typename DerivedV, typename DerivedF>
-IGL_INLINE bool igl::write(
+IGL_INLINE bool igl::write_triangle_mesh(
   const std::string str,
   const Eigen::PlainObjectBase<DerivedV>& V,
   const Eigen::PlainObjectBase<DerivedF>& F)
@@ -24,10 +24,10 @@ IGL_INLINE bool igl::write(
     ;
   while (*p != '.')
     p--;
-  
+
   if (!strcmp(p, ".obj") || !strcmp(p, ".OBJ"))
     return igl::writeOBJ(str,V,F);
-  
+
   if (!strcmp(p, ".off") || !strcmp(p, ".OFF"))
     return igl::writeOFF(str,V,F);
 
@@ -38,5 +38,5 @@ IGL_INLINE bool igl::write(
 #ifndef IGL_HEADER_ONLY
 // Explicit template specialization
 // generated by autoexplicit.sh
-template bool igl::write<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
+template bool igl::write_triangle_mesh<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&);
 #endif

+ 10 - 10
include/igl/write.h → include/igl/write_triangle_mesh.h

@@ -1,31 +1,31 @@
 // This file is part of libigl, a simple c++ geometry processing library.
-// 
+//
 // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
-// 
-// 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 
+//
+// 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_WRITE_H
-#define IGL_WRITE_H
+#ifndef IGL_WRITE_TRIANGLE_MESH_H
+#define IGL_WRITE_TRIANGLE_MESH_H
 #include "igl_inline.h"
 
 #include <Eigen/Core>
 #include <string>
 
-namespace igl 
+namespace igl
 {
   // write mesh to an ascii file with automatic detection of file format. supported: obj, off)
   // Known Bugs:
-  //  Does not correctly find file extensions: myfile.foo.off 
+  //  Does not correctly find file extensions: myfile.foo.off
   template <typename DerivedV, typename DerivedF>
-  IGL_INLINE bool write(
+  IGL_INLINE bool write_triangle_mesh(
                         const std::string str,
                         const Eigen::PlainObjectBase<DerivedV>& V,
                         const Eigen::PlainObjectBase<DerivedF>& F);
 }
 
 #ifdef IGL_HEADER_ONLY
-#  include "write.cpp"
+#  include "write_triangle_mesh.cpp"
 #endif
 
 #endif