objParser.h 895 B

123456789101112131415161718192021222324252627282930
  1. #ifndef OBJPARSER_H
  2. #define OBJPARSER_H
  3. // ===============================
  4. // AUTHOR : Angel Ortiz (angelo12 AT vt DOT edu)
  5. // CREATE DATE : 2018-07-14
  6. // PURPOSE : Read .OBJ files and load the data into a mesh
  7. // ===============================
  8. //Headers
  9. #include <fstream>
  10. #include <sstream>
  11. #include "mesh.h"
  12. //Just a namespace for functions related to loading data from wavefront OBJ files
  13. namespace OBJ{
  14. //Assumes that the path given is valid
  15. Mesh& buildMeshFromFile(Mesh &mesh, std::string path);
  16. //Checks if the path actually contains a valid file
  17. bool fileExists(std::string &path);
  18. //Get vertices, normals and all index data into the mesh object
  19. void loadFileData(Mesh &mesh, std::ifstream &file);
  20. //Simple string splitting method using a single char delimeter
  21. std::vector<std::string> splitStr(std::string &str, char delim);
  22. }
  23. #endif