Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

log Class Reference
[Functions]

Write brief comment for log here. More...

#include <log.h>

List of all members.

Static Public Member Functions

void write (string log)
void write (string log, double data)
void write (string log, int data)
void write (string log, Matrix data)
void write (string log, ExampleModel data)
void write (string log, ReferenceModel data)
void setDebug (bool debug)
void clear ()

Static Public Attributes

const char * m_filename = "PCG.log"
bool m_debug = false


Detailed Description

Write brief comment for log here.

Write detailed description for log here.

Remarks:
Write remarks for log here.
See also:
Separate items with the '|' character.

Definition at line 47 of file log.h.


Member Function Documentation

void log::clear  )  [static]
 

Definition at line 141 of file log.cpp.

References m_filename.

Referenced by Batch::Batch(), and Batch::TestSystem().

00141                 {
00142         ofstream logfile;
00143         logfile.open (m_filename, ios::out);
00144         logfile << "";
00145         logfile.close();
00146 }

void log::setDebug bool  debug  )  [static]
 

Definition at line 148 of file log.cpp.

References m_debug.

Referenced by Batch::Batch().

00148                              {
00149         m_debug = debug;
00150 }

void log::write string  log,
ReferenceModel  data
[static]
 

Definition at line 110 of file log.cpp.

References model::Model::getFaces(), model::Model::getVertexs(), and m_filename.

00110                                                {
00111         ofstream logfile;
00112         char timeStr [19];
00113         #ifndef __WINDOWS__
00114         _strtime( timeStr );
00115         #else
00116         _strtime_s( timeStr );
00117         #endif
00118         logfile.open (m_filename, ios::out | ios::app);
00119         logfile << timeStr << " " << log << "\n";
00120         logfile << "Vertices: " << data.getVertexs().size()  << "\n";
00121         logfile << "Faces:    " << data.getFaces().size()  << "\n";
00122         logfile.close();
00123         if(m_debug) {
00124                 ofstream modelfile;
00125                 modelfile.open (log.append("-MODEL.log").c_str());
00126                 modelfile << "Vertices: " << data.getVertexs().size() << "\n";
00127                 modelfile << "faces:    " << data.getFaces().size() << "\n";
00128                 for(int i=0;i<(int)data.getVertexs().size();i++) {
00129                         modelfile       << "Index: " << data.getVertexs()[i]->getIndex() << "\n";
00130                         modelfile       << "Normal: (" << data.getVertexs()[i]->getNormal()->x;
00131                         modelfile       << "," << data.getVertexs()[i]->getNormal()->y;
00132                         modelfile       << "," << data.getVertexs()[i]->getNormal()->z << ")\n";
00133                         modelfile       << "Coordinate: (" << data.getVertexs()[i]->getCoordinates()->x;
00134                         modelfile       << "," << data.getVertexs()[i]->getCoordinates()->y;
00135                         modelfile       << "," << data.getVertexs()[i]->getCoordinates()->z << ")\n";
00136                 }
00137                 modelfile.close();
00138         }
00139 }

Here is the call graph for this function:

void log::write string  log,
ExampleModel  data
[static]
 

Definition at line 81 of file log.cpp.

References model::Model::getFaces(), model::Model::getVertexs(), and m_filename.

00081                                              {
00082         ofstream logfile;
00083         char timeStr [19];
00084         #ifndef __WINDOWS__
00085         _strtime( timeStr );
00086         #else
00087         _strtime_s( timeStr );
00088         #endif
00089         logfile.open (m_filename, ios::out | ios::app);
00090         logfile << timeStr << " " << log << "\n";
00091         logfile << "Vertices: " << data.getVertexs().size()  << "\n";
00092         logfile << "Faces:    " << data.getFaces().size()  << "\n";
00093         logfile.close();
00094         if(m_debug) {
00095                 ofstream modelfile;
00096                 modelfile.open (log.append("-MODEL.log").c_str());
00097                 for(int i=0;i<(int)data.getVertexs().size();i++) {
00098                         modelfile       << "Index: " << data.getVertexs()[i]->getIndex() << "\n";
00099                         modelfile       << "Normal: (" << data.getVertexs()[i]->getNormal()->x;
00100                         modelfile       << "," << data.getVertexs()[i]->getNormal()->y;
00101                         modelfile       << "," << data.getVertexs()[i]->getNormal()->z << ")\n";
00102                         modelfile       << "Coordinate: (" << data.getVertexs()[i]->getCoordinates()->x;
00103                         modelfile       << "," << data.getVertexs()[i]->getCoordinates()->y;
00104                         modelfile       << "," << data.getVertexs()[i]->getCoordinates()->z << ")\n";
00105                 }
00106                 modelfile.close();
00107         }
00108 }

Here is the call graph for this function:

void log::write string  log,
Matrix  data
[static]
 

Definition at line 61 of file log.cpp.

References m_filename.

00061                                        {
00062         ofstream logfile;
00063         char timeStr [19];
00064         #ifndef __WINDOWS__
00065         _strtime( timeStr );
00066         #else
00067         _strtime_s( timeStr );
00068         #endif
00069         logfile.open (m_filename, ios::out | ios::app);
00070         logfile << timeStr << " " << log << "\n";
00071         logfile << "Dim: [" << data.Nrows() << "," << data.Ncols() << "]\n";
00072         logfile.close();
00073         if(m_debug) {
00074                 ofstream matrixfile;
00075                 matrixfile.open (log.append("-MATRIX.log").c_str());
00076                 matrixfile << setw(10) << setprecision(5) << data;
00077                 matrixfile.close();
00078         }
00079 }

void log::write string  log,
int  data
[static]
 

Definition at line 48 of file log.cpp.

References m_filename.

00048                                     {
00049         ofstream logfile;
00050         char timeStr [19];
00051         #ifndef __WINDOWS__
00052         _strtime( timeStr );
00053         #else
00054         _strtime_s( timeStr );
00055         #endif
00056         logfile.open (m_filename, ios::out | ios::app);
00057         logfile << timeStr << " " << log << ": " << data << "\n";
00058         logfile.close();
00059 }

void log::write string  log,
double  data
[static]
 

Definition at line 35 of file log.cpp.

References m_filename.

00035                                        {
00036         ofstream logfile;
00037         char timeStr [19];
00038         #ifndef __WINDOWS__
00039         _strtime( timeStr );
00040         #else
00041         _strtime_s( timeStr );
00042         #endif
00043         logfile.open (m_filename, ios::out | ios::app);
00044         logfile << timeStr << " " << log << ": " << data << "\n";
00045         logfile.close();
00046 }

void log::write string  log  )  [static]
 

Definition at line 21 of file log.cpp.

References m_filename.

Referenced by model::Analyzer::adjust(), Batch::analyzeModel(), model::Analyzer::Analyzer(), Batch::Batch(), model::Analyzer::computeEnergy(), model::Analyzer::covariance(), functions::Exporter::exportModel(), Batch::ExportModels(), model::Analyzer::findComponents(), model::Analyzer::getModel(), Batch::getRandomModels(), model::Analyzer::mean(), model::Analyzer::mergeData(), model::Analyzer::selectComponents(), Batch::TestAnalyzer(), Batch::TestSystem(), and model::Analyzer::transformation().

00021                           {
00022         ofstream logfile;
00023         char timeStr [19];
00024         #ifndef __WINDOWS__
00025         _strtime( timeStr );
00026         #else
00027         _strtime_s( timeStr );
00028         #endif
00029         
00030         logfile.open (m_filename, ios::out | ios::app);
00031         logfile << timeStr << " " << log << "\n";
00032         logfile.close();
00033 }


Member Data Documentation

bool log::m_debug = false [static]
 

Definition at line 153 of file log.cpp.

Referenced by setDebug().

const char * log::m_filename = "PCG.log" [static]
 

Definition at line 152 of file log.cpp.

Referenced by clear(), and write().


The documentation for this class was generated from the following files:
Generated on Tue Apr 17 09:39:46 2007 for PCG Library by  doxygen 1.3.9.1