2
* @file AssistantMakefilelibExport.h
8
/* This is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This software is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU General Public
19
* License along with this software; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
#ifndef ASSISTANTMAKEFILELIBEXPORT_H_
25
#define ASSISTANTMAKEFILELIBEXPORT_H_
27
#include <hugin_shared.h>
28
#include <algorithm/PanoramaAlgorithm.h>
29
#include <panodata/PanoramaData.h>
31
#include <makefilelib/Manager.h>
32
#include <makefilelib/Makefile.h>
33
#include <makefilelib/Variable.h>
34
#include <makefilelib/Rule.h>
43
class IMPEX AssistantMakefilelibExport : public PanoramaAlgorithm
46
struct AssistantPrograms
51
std::string autooptimiser;
52
std::string pano_modify;
59
celeste="celeste_standalone";
61
autooptimiser="autooptimiser";
62
pano_modify="pano_modify";
69
std::ostream & makefile;
70
const std::string& projectFile;
71
const AssistantPrograms &progs;
72
const bool &runCeleste;
73
const double &celesteThreshold;
74
const bool &celesteSmallRadius;
75
const bool &runCPClean;
78
makefile::Manager mgr;
79
std::ostringstream valuestream;
82
void echoInfo(makefile::Rule& inforule, const std::string& info);
85
return makefile::Makefile::getSingleton().writeMakefile(makefile) != 0;
88
AssistantMakefilelibExport(PanoramaData & pano_,
89
const AssistantPrograms & progs_,
90
const bool &runCeleste_,
91
const double &celesteThreshold_,
92
const bool &celesteSmallRadius_,
93
const bool &runCPClean_,
95
std::ostream & makefile_,
96
const std::string& projectFile_)
97
: PanoramaAlgorithm(pano_),
98
pano(pano_), progs(progs_),
99
runCeleste(runCeleste_), celesteThreshold(celesteThreshold_), celesteSmallRadius(celesteSmallRadius_),
100
runCPClean(runCPClean_), scale(scale_), makefile(makefile_), projectFile(projectFile_)
102
valuestream.imbue(makefile::GetMakefileLocale());
105
static void createMakefile(PanoramaData & pano_,
106
const AssistantPrograms & progs_,
107
const bool &runCeleste_,
108
const double &celesteThreshold_,
109
const bool &celesteSmallRadius_,
110
const bool &runCPClean_,
111
const double &scale_,
112
std::ostream & makefile_,
113
const std::string& projectFile_)
115
AssistantMakefilelibExport* instance = new AssistantMakefilelibExport(
116
pano_, progs_, runCeleste_, celesteThreshold_, celesteSmallRadius_,
117
runCPClean_, scale_, makefile_, projectFile_);
118
instance->createItems();
119
instance->writeMakefile();
123
virtual bool modifiesPanoramaData() const
129
return createItems() && writeMakefile();
132
virtual ~AssistantMakefilelibExport()
134
// TODO Auto-generated destructor stub