Commit df9b6393 authored by Patrik Huber's avatar Patrik Huber

Changed function names to snake_case

parent 14ff9b6e
...@@ -41,7 +41,7 @@ namespace eos { ...@@ -41,7 +41,7 @@ namespace eos {
/** /**
* Forward declarations * Forward declarations
*/ */
std::vector<cv::Vec2f> loadIsomap(boost::filesystem::path isomapFile); std::vector<cv::Vec2f> load_isomap(boost::filesystem::path isomap_file);
/** /**
* Load a shape or color model from a .scm file containing * Load a shape or color model from a .scm file containing
...@@ -57,12 +57,12 @@ std::vector<cv::Vec2f> loadIsomap(boost::filesystem::path isomapFile); ...@@ -57,12 +57,12 @@ std::vector<cv::Vec2f> loadIsomap(boost::filesystem::path isomapFile);
* *
* - The pcaBasis matrix stored in the file and loaded is the orthogonal PCA basis, i.e. it is not normalised by the eigenvalues. * - The pcaBasis matrix stored in the file and loaded is the orthogonal PCA basis, i.e. it is not normalised by the eigenvalues.
* *
* @param[in] modelFilename A binary .scm-file containing the model. * @param[in] model_filename A binary .scm-file containing the model.
* @param[in] isomapFile An optional path to an isomap containing texture coordinates. * @param[in] isomap_file An optional path to an isomap containing texture coordinates.
* @return The Morphable Model loaded from the file. * @return The Morphable Model loaded from the file.
* @throws ... * @throws ...
*/ */
MorphableModel loadScmModel(boost::filesystem::path modelFilename, boost::filesystem::path isomapFile = boost::filesystem::path()) MorphableModel load_scm_model(boost::filesystem::path model_filename, boost::filesystem::path isomap_file = boost::filesystem::path())
{ {
using cv::Mat; using cv::Mat;
if (sizeof(unsigned int) != 4) { // note/todo: maybe use uint32 or similar instead? Yep, but still we could encounter endianness-trouble. if (sizeof(unsigned int) != 4) { // note/todo: maybe use uint32 or similar instead? Yep, but still we could encounter endianness-trouble.
...@@ -72,9 +72,9 @@ MorphableModel loadScmModel(boost::filesystem::path modelFilename, boost::filesy ...@@ -72,9 +72,9 @@ MorphableModel loadScmModel(boost::filesystem::path modelFilename, boost::filesy
std::cout << "Warning: We're reading 8 Bytes from the file but sizeof(double) != 8. Check the code/behaviour." << std::endl; std::cout << "Warning: We're reading 8 Bytes from the file but sizeof(double) != 8. Check the code/behaviour." << std::endl;
} }
std::ifstream modelFile(modelFilename.string(), std::ios::binary); std::ifstream modelFile(model_filename.string(), std::ios::binary);
if (!modelFile.is_open()) { if (!modelFile.is_open()) {
std::string msg("Unable to open model file: " + modelFilename.string()); std::string msg("Unable to open model file: " + model_filename.string());
std::cout << msg << std::endl; std::cout << msg << std::endl;
throw std::runtime_error(msg); throw std::runtime_error(msg);
} }
...@@ -214,8 +214,8 @@ MorphableModel loadScmModel(boost::filesystem::path modelFilename, boost::filesy ...@@ -214,8 +214,8 @@ MorphableModel loadScmModel(boost::filesystem::path modelFilename, boost::filesy
// Load the isomap with texture coordinates if a filename has been given: // Load the isomap with texture coordinates if a filename has been given:
std::vector<cv::Vec2f> texCoords; std::vector<cv::Vec2f> texCoords;
if (!isomapFile.empty()) { if (!isomap_file.empty()) {
texCoords = loadIsomap(isomapFile); texCoords = load_isomap(isomap_file);
if (shapeModel.get_data_dimension() / 3.0f != texCoords.size()) { if (shapeModel.get_data_dimension() / 3.0f != texCoords.size()) {
std::string errorMessage("Error, wrong number of texture coordinates. Don't have the same number of texcoords than the shape model has vertices."); std::string errorMessage("Error, wrong number of texture coordinates. Don't have the same number of texcoords than the shape model has vertices.");
std::cout << errorMessage << std::endl; std::cout << errorMessage << std::endl;
...@@ -234,7 +234,7 @@ MorphableModel loadScmModel(boost::filesystem::path modelFilename, boost::filesy ...@@ -234,7 +234,7 @@ MorphableModel loadScmModel(boost::filesystem::path modelFilename, boost::filesy
* @return The 2D texture coordinates for every vertex. * @return The 2D texture coordinates for every vertex.
* @throws ... * @throws ...
*/ */
std::vector<cv::Vec2f> loadIsomap(boost::filesystem::path isomapFile) std::vector<cv::Vec2f> load_isomap(boost::filesystem::path isomapFile)
{ {
using std::string; using std::string;
std::vector<float> xCoords, yCoords; std::vector<float> xCoords, yCoords;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment