From 2881f2a09651a9a3df5cd64601b0a72955d9cd29 Mon Sep 17 00:00:00 2001 From: edgarriba Date: Wed, 6 Aug 2014 09:21:38 +0200 Subject: [PATCH] Fixed warnings --- .../calib3d/real_time_pose_estimation/src/CsvReader.cpp | 6 +++--- .../calib3d/real_time_pose_estimation/src/CsvReader.h | 5 ++--- .../calib3d/real_time_pose_estimation/src/CsvWriter.cpp | 14 +++++++------- .../calib3d/real_time_pose_estimation/src/CsvWriter.h | 16 +++++++++------- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp index 6b876ff..7b18944 100644 --- a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvReader.cpp @@ -2,13 +2,13 @@ #include "Utils.h" /** The default constructor of the CSV reader Class */ -CsvReader::CsvReader(const std::string &path, const char &separator){ +CsvReader::CsvReader(const string &path, const char &separator){ _file.open(path.c_str(), ifstream::in); _separator = separator; } /* Read a plane text file with .ply format */ -void CsvReader::readPLY(std::vector &list_vertex, std::vector > &list_triangles) +void CsvReader::readPLY(vector &list_vertex, vector > &list_triangles) { std::string line, tmp_str, n; int num_vertex = 0, num_triangles = 0; @@ -61,7 +61,7 @@ void CsvReader::readPLY(std::vector &list_vertex, std::vector #include - #include using namespace std; @@ -19,7 +18,7 @@ public: * @param separator - The separator character between words per line * @return */ - CsvReader(const std::string &path, const char &separator = ' '); + CsvReader(const string &path, const char &separator = ' '); /** * Read a plane text file with .ply format @@ -28,7 +27,7 @@ public: * @param list_triangle - The container of the triangles list of the mesh * @return */ - void readPLY(std::vector &list_vertex, std::vector > &list_triangles); + void readPLY(vector &list_vertex, vector > &list_triangles); private: /** The current stream file for the reader */ diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp index 0178f4d..5a6b5a9 100644 --- a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.cpp @@ -1,8 +1,8 @@ #include "CsvWriter.h" #include "Utils.h" -CsvWriter::CsvWriter(const std::string &path, const std::string &separator){ - _file.open(path.c_str(), std::ofstream::out); +CsvWriter::CsvWriter(const string &path, const string &separator){ + _file.open(path.c_str(), ofstream::out); _isFirstTerm = true; _separator = separator; } @@ -12,9 +12,9 @@ CsvWriter::~CsvWriter() { _file.close(); } -void CsvWriter::writeXYZ(const std::vector &list_points3d) +void CsvWriter::writeXYZ(const vector &list_points3d) { - std::string x, y, z; + string x, y, z; for(unsigned int i = 0; i < list_points3d.size(); ++i) { x = FloatToString(list_points3d[i].x); @@ -26,9 +26,9 @@ void CsvWriter::writeXYZ(const std::vector &list_points3d) } -void CsvWriter::writeUVXYZ(const std::vector &list_points3d, const std::vector &list_points2d, const cv::Mat &descriptors) +void CsvWriter::writeUVXYZ(const vector &list_points3d, const vector &list_points2d, const Mat &descriptors) { - std::string u, v, x, y, z, descriptor_str; + string u, v, x, y, z, descriptor_str; for(unsigned int i = 0; i < list_points3d.size(); ++i) { u = FloatToString(list_points2d[i].x); @@ -41,7 +41,7 @@ void CsvWriter::writeUVXYZ(const std::vector &list_points3d, const for(int j = 0; j < 32; ++j) { - descriptor_str = FloatToString((float)descriptors.at(i,j)); + descriptor_str = FloatToString(descriptors.at(i,j)); _file << _separator << descriptor_str; } _file << std::endl; diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.h b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.h index c2eea75..ce1a870 100644 --- a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.h +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/CsvWriter.h @@ -1,21 +1,23 @@ #ifndef CSVWRITER_H #define CSVWRITER_H -#include #include - +#include #include +using namespace std; +using namespace cv; + class CsvWriter { public: - CsvWriter(const std::string &path, const std::string &separator = " "); + CsvWriter(const string &path, const string &separator = " "); ~CsvWriter(); - void writeXYZ(const std::vector &list_points3d); - void writeUVXYZ(const std::vector &list_points3d, const std::vector &list_points2d, const cv::Mat &descriptors); + void writeXYZ(const vector &list_points3d); + void writeUVXYZ(const vector &list_points3d, const vector &list_points2d, const Mat &descriptors); private: - std::ofstream _file; - std::string _separator; + ofstream _file; + string _separator; bool _isFirstTerm; }; -- 2.7.4