浏览代码

templates and clean up

Former-commit-id: 6cf2b9eaa1e1ebdd9cc042a95c8c60b2e57bdd5d
Alec Jacobson (jalec 11 年之前
父节点
当前提交
40aa09d1f3
共有 4 个文件被更改,包括 29 次插入92 次删除
  1. 28 0
      include/igl/IO
  2. 0 49
      include/igl/concat.cpp
  3. 0 43
      include/igl/concat.h
  4. 1 0
      include/igl/matlab_format.cpp

+ 28 - 0
include/igl/IO

@@ -0,0 +1,28 @@
+// 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 
+// obtain one at http://mozilla.org/MPL/2.0/.
+#ifndef IGL_IO
+#define IGL_IO
+// Input and output functions
+#include "read.h"
+#include "readDMAT.h"
+#include "readMESH.h"
+#include "readNODE.h"
+#include "readOBJ.h"
+#include "readOFF.h"
+#include "readTGF.h"
+#include "readWRL.h"
+#include "readCSV.h"
+#include "file_contents_as_string.h"
+#include "write.h"
+#include "writeDMAT.h"
+#include "writeMESH.h"
+#include "writeOBJ.h"
+#include "writeOFF.h"
+#include "writeTGF.h"
+
+#endif

+ 0 - 49
include/igl/concat.cpp

@@ -1,49 +0,0 @@
-// 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 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#include "concat.h"
-
-#include <cstdio>
-
-template <typename T>
-IGL_INLINE void igl::concat(
-                   const T A, 
-                   const T B,
-                   const bool horiz,                 
-                   T& O)
-{
-  if (horiz)
-  {
-    // O = [A,B]
-    assert(A.rows() == B.rows());
-    O = T(A.rows(),A.cols()+B.cols());
-    O << A,B;
-  }
-  else
-  {
-    // O = [A;B]
-    assert(A.cols() == B.cols());
-    O = T(A.rows()+B.rows(),A.cols());
-    O << A,B;
-  }
-}
-
-template <typename T>
-IGL_INLINE T igl::concat(
-                const T A, 
-                const T B,
-                bool horiz
-                )
-{
-  T O = T(1,1);
-  concat(A,B,horiz,O);
-  return O;
-}
-
-#ifndef IGL_HEADER_ONLY
-// Explicit template specialization
-#endif

+ 0 - 43
include/igl/concat.h

@@ -1,43 +0,0 @@
-// 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 
-// obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_CONCAT_H
-#define IGL_CONCAT_H
-#include "igl_inline.h"
-#include <Eigen/Dense>
-namespace igl
-{
-  // Concatenates dense matrices
-  // Templates:
-  //   T  should be a eigen matrix primitive type like int or double
-  // Inputs:
-  //   A first matrix
-  //   B second matrix
-  //   horiz if true, matrices are concatenated horizontally
-  // Output:
-  //   O if horiz = false return [A;B] else [A,B]
-  template <typename T>
-  IGL_INLINE void concat(
-                     const T A, 
-                     const T B,
-                     const bool horiz,                 
-                     T& O);
-  
-  template <typename T>
-  IGL_INLINE T concat(
-                  const T A, 
-                  const T B,
-                  bool horiz = false
-                  );
-
-}
-
-#ifdef IGL_HEADER_ONLY
-#  include "concat.cpp"
-#endif
-
-#endif

+ 1 - 0
include/igl/matlab_format.cpp

@@ -107,4 +107,5 @@ template Eigen::WithFormat<Eigen::Array<int, -1, 1, 0, -1, 1> > const igl::matla
 template Eigen::WithFormat<Eigen::Matrix<double, 4, 4, 0, 4, 4> > const igl::matlab_format<Eigen::Matrix<double, 4, 4, 0, 4, 4> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 4, 4, 0, 4, 4> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >);
 template Eigen::WithFormat<Eigen::Matrix<double, -1, 4, 0, -1, 4> > const igl::matlab_format<Eigen::Matrix<double, -1, 4, 0, -1, 4> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 4, 0, -1, 4> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >);
 template Eigen::WithFormat<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const igl::matlab_format<Eigen::Matrix<double, -1, 2, 0, -1, 2> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 2, 0, -1, 2> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >);
+template Eigen::WithFormat<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const igl::matlab_format<Eigen::Matrix<double, 2, 1, 0, 2, 1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >);
 #endif