utils.cpp File Reference

#include "utils.h"
#include <sys/time.h>
#include <time.h>
#include <fstream>
#include <stdio.h>
#include <cstdio>

Include dependency graph for utils.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  hugin_utils

Functions

std::string GetCurrentTimeString ()
 current time as a string
std::string getExtension (const std::string &basename2)
 Get extension of a filename.
std::string stripExtension (const std::string &basename2)
 remove extension of a filename
std::string stripPath (const std::string &filename)
 remove the path of a filename (mainly useful for gui display of filenames)
std::string getPathPrefix (const std::string &filename)
 Get the path to a filename.
std::string doubleToString (double d, int digits)
 convert a double to a string, suitable for display within a GUI.
void ControlPointErrorColour (const double cperr, double &r, double &g, double &b)
bool FileExists (const std::string filename)
 checks if file exists
std::string GetAbsoluteFilename (const std::string filename)
 returns the full absolute filename


Detailed Description

Author:
Pablo d'Angelo <pablo.dangelo@web.de>
$Id$

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this software; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition in file utils.cpp.


Function Documentation

IMPEX void hugin_utils::ControlPointErrorColour const double  cperr,
double &  r,
double &  g,
double &  b
 

Definition at line 205 of file utils.cpp.

Referenced by PreviewControlPointTool::AfterDrawImagesEvent(), PreviewLayoutLinesTool::LineDetails::draw(), and CPImagesComboBox::OnDrawItem().

IMPEX std::string hugin_utils::doubleToString double  d,
int  fractionaldigits = -1
 

convert a double to a string, suitable for display within a GUI.

d value to convert t a string fractionaldigits number of fractional digits. -1: not specified, use default.

Definition at line 170 of file utils.cpp.

Referenced by hugin_utils::doubleTowxString(), HuginBase::LensDB::LensDBList::GetLensName(), PreviewFrame::panoramaChanged(), GLPreviewFrame::panoramaChanged(), and PanoPanel::UpdateDisplay().

IMPEX bool hugin_utils::FileExists const std::string  filename  ) 
 

checks if file exists

Definition at line 226 of file utils.cpp.

Referenced by PanoPanel::DoSendToBatch(), hugin_utils::GetAbsoluteFilename(), getProgram(), PanoDetector::loadProject(), main(), FailedProjectsDialog::OnSelectProject(), MainFrame::OnSendToAssistantQueue(), PT::wxAddImagesCmd::processPanorama(), MaskImageCtrl::setImage(), and CPImageCtrl::setImage().

IMPEX std::string hugin_utils::GetAbsoluteFilename const std::string  filename  ) 
 

returns the full absolute filename

replace realpath with function with works without this hack

Definition at line 232 of file utils.cpp.

References hugin_utils::FileExists(), and makefile::string.

Referenced by main().

IMPEX std::string hugin_utils::GetCurrentTimeString  ) 
 

current time as a string

Definition at line 53 of file utils.cpp.

IMPEX std::string hugin_utils::getExtension const std::string basename  ) 
 

Get extension of a filename.

Definition at line 61 of file utils.cpp.

References makefile::string.

Referenced by main(), HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::stitch(), and HuginBase::Nona::WeightedStitcher< ImageType, AlphaType >::stitch().

IMPEX std::string hugin_utils::getPathPrefix const std::string filename  ) 
 

Get the path to a filename.

Definition at line 146 of file utils.cpp.

References celeste::max().

Referenced by PanoDetector::loadProject(), main(), MainFrame::OnSaveProject(), and LensCalFrame::OnSaveProject().

IMPEX std::string hugin_utils::stripExtension const std::string basename  ) 
 

remove extension of a filename

Definition at line 92 of file utils.cpp.

Referenced by getKeyfilenameFor(), main(), MainFrame::OnSaveProject(), reduceFilesToHDR(), HuginBase::Nona::SimpleStitcher< ImageType, AlphaType >::stitch(), HuginBase::Nona::ReduceStitcher< ImageType, AlphaType >::stitch(), and HuginBase::Nona::WeightedStitcher< ImageType, AlphaType >::stitch().

IMPEX std::string hugin_utils::stripPath const std::string filename  ) 
 

remove the path of a filename (mainly useful for gui display of filenames)

Definition at line 122 of file utils.cpp.

References celeste::max().

Referenced by getKeyfilenameFor(), main(), MainFrame::OnSaveProject(), PT::wxLoadPTProjectCmd::processPanorama(), and AutoCtrlPointCreator::readUpdatedControlPoints().


Generated on Wed Jul 30 01:25:49 2014 for Hugintrunk by  doxygen 1.3.9.1