HuginBase::LensDB::LensDB::Database Class Reference

List of all members.

Public Member Functions

 Database (const std::string &filename)
 ~Database ()
bool CreateTables ()
int GetDBVersion () const
std::string GetDBFilename () const
bool GetCropFactor (const std::string &maker, const std::string &model, double &cropFactor) const
bool SaveCropFactor (const std::string &maker, const std::string &model, const double cropFactor)
bool GetLensProjection (const std::string &lens, int &projection) const
bool SaveLensProjection (const std::string &lens, const int projection)
bool GetHFOV (const std::string &lens, const double focallength, std::vector< HFOVData > &hfovData) const
bool SaveHFOV (const std::string &lens, const double focallength, const double HFOV, const int weight=10)
bool GetLensCrop (const std::string &lens, const double focal, const int width, const int height, std::vector< CropData > &cropData) const
bool SaveLensCrop (const std::string &lens, const double focal, const int width, const int height, const int left, const int right, const int top, const int bottom)
bool RemoveLensCrop (const std::string &lens, const double focal, const int width, const int height)
bool GetDistortionData (const std::string &lens, const double focallength, std::vector< Distortiondata > &distData) const
bool SaveDistortion (const std::string &lens, const double focallength, const double a, const double b, const double c, const int weight=10)
bool GetVignettingData (const std::string &lens, const double focallength, const double aperture, std::vector< Vignettingdata > &vigData) const
bool SaveVignetting (const std::string &lens, const double focallength, const double aperture, const double distance, const double Vb, const double Vc, const double Vd, const int weight=10)
bool GetTCAData (const std::string &lens, const double focallength, std::vector< TCAdata > &tcaData) const
bool SaveTCAData (const std::string &lens, const double focallength, const double ra, const double rb, const double rc, const double rd, const double ba, const double bb, const double bc, const double bd, const int weight=10)
bool SaveEMoR (const std::string &maker, const std::string &model, const int iso, const double Ra, const double Rb, const double Rc, const double Rd, const double Re, const int weight=10)
bool GetLensNames (const bool distortion, const bool vignetting, const bool tca, LensList &lensList) const
bool CleanUp ()
bool RemoveLens (const std::string &lensname)
bool RemoveCamera (const std::string &maker, const std::string &model)
bool ExportToFile (const std::string &filename)
bool ImportFromFile (const std::string &filename)

Private Member Functions

void BeginTransaction ()
void EndTransaction ()
bool RemoveLensFromTable (const std::string &table, const std::string &lens)
bool RemoveCameraFromTable (const std::string &table, const std::string &maker, const std::string &model)
void OutputSQLToStream (const std::string &sqlstatement, std::ostream &stream)
bool ImportCropFactor (std::istream &input)
bool ImportProjection (std::istream &input)
bool ImportHFOV (std::istream &input)
bool ImportLensCrop (std::istream &input)
bool ImportDistortion (std::istream &input)
bool ImportVignetting (std::istream &input)
bool ImportTCA (std::istream &input)
bool ImportEMOR (std::istream &input)

Private Attributes

std::string m_filename
sqlite3 * m_db
bool m_runningTransaction

Classes

struct  CropData
struct  Distortiondata
struct  HFOVData
struct  TCAdata
struct  Vignettingdata

Detailed Description

Definition at line 44 of file LensDB.cpp.


Constructor & Destructor Documentation

HuginBase::LensDB::LensDB::Database::Database ( const std::string filename  )  [inline, explicit]

Definition at line 77 of file LensDB.cpp.

References cerr, CreateTables(), hugin_utils::FileExists(), m_db, and m_filename.

HuginBase::LensDB::LensDB::Database::~Database (  )  [inline]

Definition at line 105 of file LensDB.cpp.

References EndTransaction(), m_db, and m_runningTransaction.


Member Function Documentation

void HuginBase::LensDB::LensDB::Database::BeginTransaction (  )  [inline, private]

Definition at line 997 of file LensDB.cpp.

References m_db, and m_runningTransaction.

Referenced by CleanUp(), RemoveCamera(), RemoveLens(), SaveCropFactor(), SaveLensCrop(), and SaveLensProjection().

bool HuginBase::LensDB::LensDB::Database::CleanUp (  )  [inline]

Definition at line 726 of file LensDB.cpp.

References BeginTransaction(), EndTransaction(), and m_db.

Referenced by HuginBase::LensDB::LensDB::CleanUpDatabase(), ExportToFile(), and ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::CreateTables (  )  [inline]

Definition at line 117 of file LensDB.cpp.

References cerr, and m_db.

Referenced by Database().

void HuginBase::LensDB::LensDB::Database::EndTransaction (  )  [inline, private]

Definition at line 1004 of file LensDB.cpp.

References m_db, and m_runningTransaction.

Referenced by CleanUp(), RemoveCamera(), RemoveLens(), RemoveLensCrop(), SaveCropFactor(), SaveLensCrop(), SaveLensProjection(), and ~Database().

bool HuginBase::LensDB::LensDB::Database::ExportToFile ( const std::string filename  )  [inline]

Definition at line 789 of file LensDB.cpp.

References cerr, CleanUp(), m_db, and OutputSQLToStream().

Referenced by HuginBase::LensDB::LensDB::ExportToFile().

bool HuginBase::LensDB::LensDB::Database::GetCropFactor ( const std::string maker,
const std::string model,
double &  cropFactor 
) const [inline]

Definition at line 182 of file LensDB.cpp.

References m_db.

Referenced by HuginBase::LensDB::LensDB::GetCropFactor().

std::string HuginBase::LensDB::LensDB::Database::GetDBFilename (  )  const [inline]

Definition at line 176 of file LensDB.cpp.

References m_filename.

Referenced by HuginBase::LensDB::LensDB::GetDBFilename().

int HuginBase::LensDB::LensDB::Database::GetDBVersion (  )  const [inline]

Definition at line 156 of file LensDB.cpp.

References m_db.

bool HuginBase::LensDB::LensDB::Database::GetDistortionData ( const std::string lens,
const double  focallength,
std::vector< Distortiondata > &  distData 
) const [inline]

Definition at line 455 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::Distortiondata::a, HuginBase::LensDB::LensDB::Database::Distortiondata::b, HuginBase::LensDB::LensDB::Database::Distortiondata::c, HuginBase::LensDB::LensDB::Database::Distortiondata::focallength, and m_db.

Referenced by HuginBase::LensDB::LensDB::GetDistortion().

bool HuginBase::LensDB::LensDB::Database::GetHFOV ( const std::string lens,
const double  focallength,
std::vector< HFOVData > &  hfovData 
) const [inline]

Definition at line 303 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::HFOVData::focallength, HuginBase::LensDB::LensDB::Database::HFOVData::HFOV, and m_db.

Referenced by HuginBase::LensDB::LensDB::GetFov().

bool HuginBase::LensDB::LensDB::Database::GetLensCrop ( const std::string lens,
const double  focal,
const int  width,
const int  height,
std::vector< CropData > &  cropData 
) const [inline]

Definition at line 356 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::CropData::bottom, HuginBase::LensDB::LensDB::Database::CropData::focallength, HuginBase::LensDB::LensDB::Database::CropData::left, m_db, HuginBase::LensDB::LensDB::Database::CropData::right, and HuginBase::LensDB::LensDB::Database::CropData::top.

Referenced by HuginBase::LensDB::LensDB::GetCrop().

bool HuginBase::LensDB::LensDB::Database::GetLensNames ( const bool  distortion,
const bool  vignetting,
const bool  tca,
LensList lensList 
) const [inline]

Definition at line 676 of file LensDB.cpp.

References m_db.

Referenced by HuginBase::LensDB::LensDB::GetLensNames().

bool HuginBase::LensDB::LensDB::Database::GetLensProjection ( const std::string lens,
int &  projection 
) const [inline]

Definition at line 248 of file LensDB.cpp.

References m_db.

Referenced by HuginBase::LensDB::LensDB::GetProjection().

bool HuginBase::LensDB::LensDB::Database::GetTCAData ( const std::string lens,
const double  focallength,
std::vector< TCAdata > &  tcaData 
) const [inline]

Definition at line 587 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::TCAdata::ba, HuginBase::LensDB::LensDB::Database::TCAdata::bb, HuginBase::LensDB::LensDB::Database::TCAdata::bc, HuginBase::LensDB::LensDB::Database::TCAdata::bd, HuginBase::LensDB::LensDB::Database::TCAdata::focallength, m_db, HuginBase::LensDB::LensDB::Database::TCAdata::ra, HuginBase::LensDB::LensDB::Database::TCAdata::rb, HuginBase::LensDB::LensDB::Database::TCAdata::rc, and HuginBase::LensDB::LensDB::Database::TCAdata::rd.

Referenced by HuginBase::LensDB::LensDB::GetTCA().

bool HuginBase::LensDB::LensDB::Database::GetVignettingData ( const std::string lens,
const double  focallength,
const double  aperture,
std::vector< Vignettingdata > &  vigData 
) const [inline]

Definition at line 508 of file LensDB.cpp.

References HuginBase::LensDB::LensDB::Database::Vignettingdata::aperture, HuginBase::LensDB::LensDB::Database::Vignettingdata::focallength, m_db, HuginBase::LensDB::LensDB::Database::Vignettingdata::Vb, HuginBase::LensDB::LensDB::Database::Vignettingdata::Vc, and HuginBase::LensDB::LensDB::Database::Vignettingdata::Vd.

Referenced by HuginBase::LensDB::LensDB::GetVignetting().

bool HuginBase::LensDB::LensDB::Database::ImportCropFactor ( std::istream input  )  [inline, private]

Definition at line 1075 of file LensDB.cpp.

References cerr, SaveCropFactor(), hugin_utils::SplitString(), and hugin_utils::stringToDouble().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportDistortion ( std::istream input  )  [inline, private]

Definition at line 1414 of file LensDB.cpp.

References cerr, SaveDistortion(), hugin_utils::SplitString(), hugin_utils::stringToDouble(), and hugin_utils::stringToInt().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportEMOR ( std::istream input  )  [inline, private]

Definition at line 1806 of file LensDB.cpp.

References cerr, SaveEMoR(), hugin_utils::SplitString(), hugin_utils::stringToDouble(), and hugin_utils::stringToInt().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportFromFile ( const std::string filename  )  [inline]

Definition at line 841 of file LensDB.cpp.

References cerr, CleanUp(), cout, ImportCropFactor(), ImportDistortion(), ImportEMOR(), ImportHFOV(), ImportLensCrop(), ImportProjection(), ImportTCA(), ImportVignetting(), celeste::line, m_db, and hugin_utils::SplitString().

Referenced by HuginBase::LensDB::LensDB::ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportHFOV ( std::istream input  )  [inline, private]

Definition at line 1203 of file LensDB.cpp.

References cerr, SaveHFOV(), hugin_utils::SplitString(), hugin_utils::stringToDouble(), and hugin_utils::stringToInt().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportLensCrop ( std::istream input  )  [inline, private]

Definition at line 1287 of file LensDB.cpp.

References cerr, SaveLensCrop(), hugin_utils::SplitString(), hugin_utils::stringToDouble(), and hugin_utils::stringToInt().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportProjection ( std::istream input  )  [inline, private]

Definition at line 1144 of file LensDB.cpp.

References cerr, SaveLensProjection(), hugin_utils::SplitString(), and hugin_utils::stringToInt().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportTCA ( std::istream input  )  [inline, private]

Definition at line 1646 of file LensDB.cpp.

References cerr, SaveTCAData(), hugin_utils::SplitString(), hugin_utils::stringToDouble(), and hugin_utils::stringToInt().

Referenced by ImportFromFile().

bool HuginBase::LensDB::LensDB::Database::ImportVignetting ( std::istream input  )  [inline, private]

Definition at line 1519 of file LensDB.cpp.

References cerr, vigra_ext::distance(), SaveVignetting(), hugin_utils::SplitString(), hugin_utils::stringToDouble(), and hugin_utils::stringToInt().

Referenced by ImportFromFile().

void HuginBase::LensDB::LensDB::Database::OutputSQLToStream ( const std::string sqlstatement,
std::ostream stream 
) [inline, private]

Definition at line 1049 of file LensDB.cpp.

References m_db.

Referenced by ExportToFile().

bool HuginBase::LensDB::LensDB::Database::RemoveCamera ( const std::string maker,
const std::string model 
) [inline]

Definition at line 776 of file LensDB.cpp.

References BeginTransaction(), EndTransaction(), m_db, and RemoveCameraFromTable().

Referenced by HuginBase::LensDB::LensDB::RemoveCamera().

bool HuginBase::LensDB::LensDB::Database::RemoveCameraFromTable ( const std::string table,
const std::string maker,
const std::string model 
) [inline, private]

Definition at line 1031 of file LensDB.cpp.

References m_db.

Referenced by RemoveCamera().

bool HuginBase::LensDB::LensDB::Database::RemoveLens ( const std::string lensname  )  [inline]

Definition at line 759 of file LensDB.cpp.

References BeginTransaction(), EndTransaction(), m_db, and RemoveLensFromTable().

Referenced by HuginBase::LensDB::LensDB::RemoveLens().

bool HuginBase::LensDB::LensDB::Database::RemoveLensCrop ( const std::string lens,
const double  focal,
const int  width,
const int  height 
) [inline]

Definition at line 430 of file LensDB.cpp.

References EndTransaction(), and m_db.

Referenced by HuginBase::LensDB::LensDB::SaveLensCrop().

bool HuginBase::LensDB::LensDB::Database::RemoveLensFromTable ( const std::string table,
const std::string lens 
) [inline, private]

Definition at line 1014 of file LensDB.cpp.

References m_db.

Referenced by RemoveLens().

bool HuginBase::LensDB::LensDB::Database::SaveCropFactor ( const std::string maker,
const std::string model,
const double  cropFactor 
) [inline]

Definition at line 209 of file LensDB.cpp.

References BeginTransaction(), EndTransaction(), and m_db.

Referenced by ImportCropFactor(), and HuginBase::LensDB::LensDB::SaveCameraCrop().

bool HuginBase::LensDB::LensDB::Database::SaveDistortion ( const std::string lens,
const double  focallength,
const double  a,
const double  b,
const double  c,
const int  weight = 10 
) [inline]

Definition at line 483 of file LensDB.cpp.

References m_db.

Referenced by ImportDistortion(), and HuginBase::LensDB::LensDB::SaveDistortion().

bool HuginBase::LensDB::LensDB::Database::SaveEMoR ( const std::string maker,
const std::string model,
const int  iso,
const double  Ra,
const double  Rb,
const double  Rc,
const double  Rd,
const double  Re,
const int  weight = 10 
) [inline]

Definition at line 650 of file LensDB.cpp.

References m_db.

Referenced by ImportEMOR(), and HuginBase::LensDB::LensDB::SaveEMoR().

bool HuginBase::LensDB::LensDB::Database::SaveHFOV ( const std::string lens,
const double  focallength,
const double  HFOV,
const int  weight = 10 
) [inline]

Definition at line 329 of file LensDB.cpp.

References m_db.

Referenced by ImportHFOV(), and HuginBase::LensDB::LensDB::SaveLensFov().

bool HuginBase::LensDB::LensDB::Database::SaveLensCrop ( const std::string lens,
const double  focal,
const int  width,
const int  height,
const int  left,
const int  right,
const int  top,
const int  bottom 
) [inline]

Definition at line 387 of file LensDB.cpp.

References BeginTransaction(), EndTransaction(), and m_db.

Referenced by ImportLensCrop(), and HuginBase::LensDB::LensDB::SaveLensCrop().

bool HuginBase::LensDB::LensDB::Database::SaveLensProjection ( const std::string lens,
const int  projection 
) [inline]

Definition at line 270 of file LensDB.cpp.

References BeginTransaction(), EndTransaction(), and m_db.

Referenced by ImportProjection(), and HuginBase::LensDB::LensDB::SaveLensProjection().

bool HuginBase::LensDB::LensDB::Database::SaveTCAData ( const std::string lens,
const double  focallength,
const double  ra,
const double  rb,
const double  rc,
const double  rd,
const double  ba,
const double  bb,
const double  bc,
const double  bd,
const int  weight = 10 
) [inline]

Definition at line 620 of file LensDB.cpp.

References m_db.

Referenced by ImportTCA(), and HuginBase::LensDB::LensDB::SaveTCA().

bool HuginBase::LensDB::LensDB::Database::SaveVignetting ( const std::string lens,
const double  focallength,
const double  aperture,
const double  distance,
const double  Vb,
const double  Vc,
const double  Vd,
const int  weight = 10 
) [inline]

Definition at line 560 of file LensDB.cpp.

References m_db.

Referenced by ImportVignetting(), and HuginBase::LensDB::LensDB::SaveVignetting().


Member Data Documentation

sqlite3* HuginBase::LensDB::LensDB::Database::m_db [private]

Definition at line 1944 of file LensDB.cpp.

Referenced by BeginTransaction(), CleanUp(), CreateTables(), Database(), EndTransaction(), ExportToFile(), GetCropFactor(), GetDBVersion(), GetDistortionData(), GetHFOV(), GetLensCrop(), GetLensNames(), GetLensProjection(), GetTCAData(), GetVignettingData(), ImportFromFile(), OutputSQLToStream(), RemoveCamera(), RemoveCameraFromTable(), RemoveLens(), RemoveLensCrop(), RemoveLensFromTable(), SaveCropFactor(), SaveDistortion(), SaveEMoR(), SaveHFOV(), SaveLensCrop(), SaveLensProjection(), SaveTCAData(), SaveVignetting(), and ~Database().

std::string HuginBase::LensDB::LensDB::Database::m_filename [private]

Definition at line 1941 of file LensDB.cpp.

Referenced by Database(), and GetDBFilename().

bool HuginBase::LensDB::LensDB::Database::m_runningTransaction [private]

Definition at line 1945 of file LensDB.cpp.

Referenced by BeginTransaction(), EndTransaction(), and ~Database().


The documentation for this class was generated from the following file:
Generated on 20 Apr 2018 for Hugintrunk by  doxygen 1.4.7