forked from OpenDroneMap/ODM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Spotscale orthophoto/textured mesh additions
- Loading branch information
1 parent
d1ac460
commit 28409bb
Showing
41 changed files
with
7,760 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
project(odm_extract_utm) | ||
cmake_minimum_required(VERSION 2.8) | ||
|
||
set(PROJ4_INCLUDE_DIR "/usr/include/" CACHE "PROJ4_INCLUDE_DIR" "Path to the proj4 inlcude directory") | ||
set(PROJ4_LIBRARY "/usr/lib/libproj.so" CACHE "PROJ4_LIBRARY" "Path to the proj4 library directory") | ||
|
||
# Add compiler options. | ||
add_definitions(-Wall -Wextra) | ||
|
||
# Add source directory | ||
aux_source_directory("./src" SRC_LIST) | ||
|
||
# Add exectuteable | ||
add_executable(${PROJECT_NAME} ${SRC_LIST}) | ||
|
||
# Link | ||
target_link_libraries(${PROJECT_NAME} ${PROJ4_LIBRARY}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "Logger.hpp" | ||
|
||
|
||
Logger::Logger(bool isPrintingInCout) : isPrintingInCout_(isPrintingInCout) | ||
{ | ||
|
||
} | ||
|
||
Logger::~Logger() | ||
{ | ||
|
||
} | ||
|
||
void Logger::printToFile(std::string filePath) | ||
{ | ||
std::ofstream file(filePath.c_str(), std::ios::binary); | ||
file << logStream_.str(); | ||
file.close(); | ||
} | ||
|
||
bool Logger::isPrintingInCout() const | ||
{ | ||
return isPrintingInCout_; | ||
} | ||
|
||
void Logger::setIsPrintingInCout(bool isPrintingInCout) | ||
{ | ||
isPrintingInCout_ = isPrintingInCout; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#pragma once | ||
|
||
// STL | ||
#include <string> | ||
#include <sstream> | ||
#include <fstream> | ||
#include <iostream> | ||
|
||
/*! | ||
* \brief The Logger class is used to store program messages in a log file. | ||
* \details By using the << operator while printInCout is set, the class writes both to | ||
* cout and to file, if the flag is not set, output is written to file only. | ||
*/ | ||
class Logger | ||
{ | ||
public: | ||
/*! | ||
* \brief Logger Contains functionality for printing and displaying log information. | ||
* \param printInCout Flag toggling if operator << also writes to cout. | ||
*/ | ||
Logger(bool isPrintingInCout = true); | ||
|
||
/*! | ||
* \brief Destructor. | ||
*/ | ||
~Logger(); | ||
|
||
/*! | ||
* \brief print Prints the contents of the log to file. | ||
* \param filePath Path specifying where to write the log. | ||
*/ | ||
void printToFile(std::string filePath); | ||
|
||
/*! | ||
* \brief isPrintingInCout Check if console printing flag is set. | ||
* \return Console printing flag. | ||
*/ | ||
bool isPrintingInCout() const; | ||
|
||
/*! | ||
* \brief setIsPrintingInCout Set console printing flag. | ||
* \param isPrintingInCout Value, if true, messages added to the log are also printed in cout. | ||
*/ | ||
void setIsPrintingInCout(bool isPrintingInCout); | ||
|
||
/*! | ||
* Operator for printing messages to log and in the standard output stream if desired. | ||
*/ | ||
template<class T> | ||
friend Logger& operator<< (Logger &log, T t) | ||
{ | ||
// If console printing is enabled. | ||
if (log.isPrintingInCout_) | ||
{ | ||
std::cout << t; | ||
std::cout.flush(); | ||
} | ||
// Write to log. | ||
log.logStream_ << t; | ||
|
||
return log; | ||
} | ||
|
||
private: | ||
bool isPrintingInCout_; /*!< If flag is set, log is printed in cout and written to the log. */ | ||
|
||
std::stringstream logStream_; /*!< Stream for storing the log. */ | ||
}; |
Oops, something went wrong.