Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef OPTIONS_H_
00009 #define OPTIONS_H_
00010
00011 #include <iostream>
00012 #include <string>
00013 #include <vector>
00014 #include <boost/program_options.hpp>
00015
00016 using std::ostream;
00017 using std::cout;
00018 using std::endl;
00019 using std::string;
00020 using std::vector;
00021
00022
00023 namespace reconstruct{
00024
00025 using namespace boost::program_options;
00026
00031 class Options {
00032 public:
00033
00038 Options(int argc, char** argv);
00039 virtual ~Options();
00040
00044 float getVoxelsize()const;
00045
00049 int getNumThreads() const;
00050
00054 bool printUsage() const;
00055
00059 bool filenameSet() const;
00060
00066 bool saveFaceNormals() const;
00067
00072 bool saveNormals() const;
00073
00077 bool createClusters() const;
00078
00082 bool optimizeClusters() const;
00083
00088 bool savePointsAndNormals() const;
00089
00094 bool recalcNormals() const;
00095
00100 int getKi() const;
00101
00106 int getKn() const;
00107
00112 int getKd() const;
00113
00117 string getInputFileName() const;
00118
00124 int getIntersections() const;
00125 private:
00126
00128 float m_voxelsize;
00129
00131 int m_numThreads;
00132
00134 variables_map m_variables;
00135
00137 options_description m_descr;
00138
00140 positional_options_description m_pdescr;
00141
00143 string m_faceNormalFile;
00144
00146 int m_numberOfDefaults;
00147
00149 int m_kd;
00150
00152 int m_kn;
00153
00155 int m_ki;
00156
00158 int m_intersections;
00159 };
00160
00161
00163 inline ostream& operator<<(ostream& os, const Options &o)
00164 {
00165 cout << "##### Program options: " << endl;
00166 if(o.getIntersections() > 0)
00167 {
00168 cout << "##### Intersections \t\t: " << o.getIntersections() << endl;
00169 }
00170 else
00171 {
00172 cout << "##### Voxelsize \t\t: " << o.getVoxelsize() << endl;
00173 }
00174 cout << "##### Output file \t\t: " << o.getInputFileName() << endl;
00175 cout << "##### Number of threads \t: " << o.getNumThreads() << endl;
00176 cout << "##### k_n \t\t\t: " << o.getKn() << endl;
00177 cout << "##### k_i \t\t\t: " << o.getKi() << endl;
00178 cout << "##### k_d \t\t\t: " << o.getKd() << endl;
00179 if(o.saveFaceNormals())
00180 {
00181 cout << "##### Write Face Normals \t: YES" << endl;
00182 }
00183 if(o.createClusters())
00184 {
00185 cout << "##### Create cluster \t\t: YES" << endl;
00186 }
00187 if(o.optimizeClusters())
00188 {
00189 cout << "##### Optimize cluster \t\t: YES" << endl;
00190 }
00191 if(o.saveNormals())
00192 {
00193 cout << "##### Save normals \t\t: YES" << endl;
00194 }
00195 if(o.recalcNormals())
00196 {
00197 cout << "##### Recalc normals \t\t: YES" << endl;
00198 }
00199 if(o.savePointsAndNormals())
00200 {
00201 cout << "##### Save points and normals \t: YES" << endl;
00202 }
00203 return os;
00204 }
00205
00206 }
00207
00208
00209 #endif