|
@@ -3,9 +3,9 @@
|
|
|
#include "is_manifold.h"
|
|
|
#include <algorithm>
|
|
|
|
|
|
-template <typename DerivedV, typename DerivedF>
|
|
|
-IGL_INLINE void igl::tt_preprocess(const Eigen::PlainObjectBase<DerivedV>& /*V*/,
|
|
|
- const Eigen::PlainObjectBase<DerivedF>& F,
|
|
|
+template <typename Scalar, typename Index>
|
|
|
+IGL_INLINE void igl::tt_preprocess(const Eigen::PlainObjectBase<Scalar>& /*V*/,
|
|
|
+ const Eigen::PlainObjectBase<Index>& F,
|
|
|
std::vector<std::vector<int> >& TTT)
|
|
|
{
|
|
|
for(int f=0;f<F.rows();++f)
|
|
@@ -24,12 +24,12 @@ IGL_INLINE void igl::tt_preprocess(const Eigen::PlainObjectBase<DerivedV>& /*V*/
|
|
|
}
|
|
|
|
|
|
// Extract the face adjacencies
|
|
|
-template <typename DerivedF, typename DerivedTT>
|
|
|
-IGL_INLINE void igl::tt_extractTT(const Eigen::PlainObjectBase<DerivedF>& F,
|
|
|
+template <typename Index>
|
|
|
+IGL_INLINE void igl::tt_extractTT(const Eigen::PlainObjectBase<Index>& F,
|
|
|
std::vector<std::vector<int> >& TTT,
|
|
|
- Eigen::PlainObjectBase<DerivedTT>& TT)
|
|
|
+ Eigen::PlainObjectBase<Index>& TT)
|
|
|
{
|
|
|
- TT = Eigen::PlainObjectBase<DerivedTT>::Constant((int)(F.rows()),F.cols(),-1);
|
|
|
+ TT = Eigen::PlainObjectBase<Index>::Constant((int)(F.rows()),F.cols(),-1);
|
|
|
|
|
|
for(int i=1;i<(int)TTT.size();++i)
|
|
|
{
|
|
@@ -44,12 +44,12 @@ IGL_INLINE void igl::tt_extractTT(const Eigen::PlainObjectBase<DerivedF>& F,
|
|
|
}
|
|
|
|
|
|
// Extract the face adjacencies indices (needed for fast traversal)
|
|
|
-template <typename DerivedF, typename DerivedTT>
|
|
|
-IGL_INLINE void igl::tt_extractTTi(const Eigen::PlainObjectBase<DerivedF>& F,
|
|
|
+template <typename Index>
|
|
|
+IGL_INLINE void igl::tt_extractTTi(const Eigen::PlainObjectBase<Index>& F,
|
|
|
std::vector<std::vector<int> >& TTT,
|
|
|
- Eigen::PlainObjectBase<DerivedTT>& TTi)
|
|
|
+ Eigen::PlainObjectBase<Index>& TTi)
|
|
|
{
|
|
|
- TTi = Eigen::PlainObjectBase<DerivedTT>::Constant((int)(F.rows()),F.cols(),-1);
|
|
|
+ TTi = Eigen::PlainObjectBase<Index>::Constant((int)(F.rows()),F.cols(),-1);
|
|
|
|
|
|
for(int i=1;i<(int)TTT.size();++i)
|
|
|
{
|
|
@@ -64,10 +64,10 @@ IGL_INLINE void igl::tt_extractTTi(const Eigen::PlainObjectBase<DerivedF>& F,
|
|
|
}
|
|
|
|
|
|
// Compute triangle-triangle adjacency
|
|
|
-template <typename DerivedV, typename DerivedF, typename DerivedTT>
|
|
|
-IGL_INLINE void igl::tt(const Eigen::PlainObjectBase<DerivedV>& V,
|
|
|
- const Eigen::PlainObjectBase<DerivedF>& F,
|
|
|
- Eigen::PlainObjectBase<DerivedTT>& TT)
|
|
|
+template <typename Scalar, typename Index>
|
|
|
+IGL_INLINE void igl::tt(const Eigen::PlainObjectBase<Scalar>& V,
|
|
|
+ const Eigen::PlainObjectBase<Index>& F,
|
|
|
+ Eigen::PlainObjectBase<Index>& TT)
|
|
|
{
|
|
|
assert(igl::is_manifold(V,F));
|
|
|
std::vector<std::vector<int> > TTT;
|
|
@@ -77,11 +77,11 @@ IGL_INLINE void igl::tt(const Eigen::PlainObjectBase<DerivedV>& V,
|
|
|
}
|
|
|
|
|
|
// Compute triangle-triangle adjacency with indices
|
|
|
-template <typename DerivedV, typename DerivedF, typename DerivedTT>
|
|
|
-IGL_INLINE void igl::tt(const Eigen::PlainObjectBase<DerivedV>& V,
|
|
|
- const Eigen::PlainObjectBase<DerivedF>& F,
|
|
|
- Eigen::PlainObjectBase<DerivedTT>& TT,
|
|
|
- Eigen::PlainObjectBase<DerivedTT>& TTi)
|
|
|
+template <typename Scalar, typename Index>
|
|
|
+IGL_INLINE void igl::tt(const Eigen::PlainObjectBase<Scalar>& V,
|
|
|
+ const Eigen::PlainObjectBase<Index>& F,
|
|
|
+ Eigen::PlainObjectBase<Index>& TT,
|
|
|
+ Eigen::PlainObjectBase<Index>& TTi)
|
|
|
{
|
|
|
assert(igl::is_manifold(V,F));
|
|
|
std::vector<std::vector<int> > TTT;
|
|
@@ -94,6 +94,4 @@ IGL_INLINE void igl::tt(const Eigen::PlainObjectBase<DerivedV>& V,
|
|
|
#ifndef IGL_HEADER_ONLY
|
|
|
// Explicit template specialization
|
|
|
// generated by autoexplicit.sh
|
|
|
-template void igl::tt<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
|
-template void igl::tt<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> >&);
|
|
|
#endif
|