libigl v2.5.0
Loading...
Searching...
No Matches
readOBJ.h
Go to the documentation of this file.
1// This file is part of libigl, a simple c++ geometry processing library.
2//
3// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
4//
5// This Source Code Form is subject to the terms of the Mozilla Public License
6// v. 2.0. If a copy of the MPL was not distributed with this file, You can
7// obtain one at http://mozilla.org/MPL/2.0/.
8
9#ifndef IGL_READOBJ_H
10#define IGL_READOBJ_H
11#include "igl_inline.h"
12// History:
13// return type changed from void to bool Alec 18 Sept 2011
14// added pure vector of vectors version that has much more support Alec 31 Oct
15// 2011
16
17#ifndef IGL_NO_EIGEN
18# include <Eigen/Core>
19#endif
20#include <string>
21#include <vector>
22#include <cstdio>
23
24namespace igl
25{
39 // @param[out] FM #tuple list containing (vertex index, normal index, texture coordinates index, material)
41 template <typename Scalar, typename Index>
43 const std::string obj_file_name,
44 std::vector<std::vector<Scalar > > & V,
45 std::vector<std::vector<Scalar > > & TC,
46 std::vector<std::vector<Scalar > > & N,
47 std::vector<std::vector<Index > > & F,
48 std::vector<std::vector<Index > > & FTC,
49 std::vector<std::vector<Index > > & FN,
50 std::vector<std::tuple<std::string, Index, Index >> &FM
51 );
53 template <typename Scalar, typename Index>
55 const std::string obj_file_name,
56 std::vector<std::vector<Scalar > > & V,
57 std::vector<std::vector<Scalar > > & TC,
58 std::vector<std::vector<Scalar > > & N,
59 std::vector<std::vector<Index > > & F,
60 std::vector<std::vector<Index > > & FTC,
61 std::vector<std::vector<Index > > & FN);
64 template <typename Scalar, typename Index>
66 FILE * obj_file,
67 std::vector<std::vector<Scalar > > & V,
68 std::vector<std::vector<Scalar > > & TC,
69 std::vector<std::vector<Scalar > > & N,
70 std::vector<std::vector<Index > > & F,
71 std::vector<std::vector<Index > > & FTC,
72 std::vector<std::vector<Index > > & FN,
73 std::vector<std::tuple<std::string, Index, Index >> &FM);
75 template <typename Scalar, typename Index>
77 const std::string obj_file_name,
78 std::vector<std::vector<Scalar > > & V,
79 std::vector<std::vector<Index > > & F);
84 template <
85 typename DerivedV,
86 typename DerivedTC,
87 typename DerivedCN,
88 typename DerivedF,
89 typename DerivedFTC,
90 typename DerivedFN>
92 const std::string str,
93 Eigen::PlainObjectBase<DerivedV>& V,
94 Eigen::PlainObjectBase<DerivedTC>& TC,
95 Eigen::PlainObjectBase<DerivedCN>& CN,
96 Eigen::PlainObjectBase<DerivedF>& F,
97 Eigen::PlainObjectBase<DerivedFTC>& FTC,
98 Eigen::PlainObjectBase<DerivedFN>& FN);
100 template <typename DerivedV, typename DerivedF>
102 const std::string str,
103 Eigen::PlainObjectBase<DerivedV>& V,
104 Eigen::PlainObjectBase<DerivedF>& F);
111 template <typename DerivedV, typename DerivedI, typename DerivedC>
113 const std::string str,
114 Eigen::PlainObjectBase<DerivedV>& V,
115 Eigen::PlainObjectBase<DerivedI>& I,
116 Eigen::PlainObjectBase<DerivedC>& C);
117
118}
119
120#ifndef IGL_STATIC_LIBRARY
121# include "readOBJ.cpp"
122#endif
123
124#endif
#define IGL_INLINE
Definition igl_inline.h:15
Definition AABB.h:17
bool readOBJ(const std::string obj_file_name, std::vector< std::vector< Scalar > > &V, std::vector< std::vector< Scalar > > &TC, std::vector< std::vector< Scalar > > &N, std::vector< std::vector< Index > > &F, std::vector< std::vector< Index > > &FTC, std::vector< std::vector< Index > > &FN, std::vector< std::tuple< std::string, Index, Index > > &FM)
Read a mesh from an ascii obj file, filling in vertex positions, normals and texture coordinates.