Commit 41796ace authored by Sylvain Thery's avatar Sylvain Thery

ajout CGoGNflush

parent c1269877
......@@ -68,24 +68,29 @@ void MyQT::balls_onoff(bool x)
{
render_balls = !render_balls;
updateGL();
CGoGNerr << " balls_onoff "<< CGoGNendl;
}
void MyQT::vectors_onoff(bool x)
{
render_vectors = !render_vectors;
updateGL();
CGoGNerr << " vectors_onoff "<< CGoGNflush;
}
void MyQT::text_onoff(bool x)
{
render_text = !render_text;
updateGL();
CGoGNerr << " text_onoff " << CGoGNflush;
}
void MyQT::topo_onoff(bool x)
{
render_topo = !render_topo;
updateGL();
CGoGNerr << " topo_onoff " << CGoGNflush;
}
void MyQT::slider_balls(int x)
......@@ -305,7 +310,8 @@ int main(int argc, char **argv)
CGoGNdbg2.toConsole(&sqt);
CGoGNerr.toConsole(&sqt);
CGoGNdbg2 << " TextureSize " << texSize << CGoGNendl;
CGoGNerr << " ERROR " << 5*7 << CGoGNendl;
CGoGNerr << " ERROR " << 5*7 << CGoGNflush;
// et on attend la fin.
return app.exec();
......
Dépendences Linux:
installer les paquets suivants:
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev lizip-dev libqt4-help qt4-designer qt4-dev-tools
cmake libXi-dev libXmu-dev freeglut3-dev libdevil-dev libglew-dev libgmp3-dev libxml2-dev libboost-dev lizip-dev libqt4-dev qt4-designer qt4-dev-tools
Pour compiler CGoGN:
......
......@@ -187,6 +187,7 @@ extern CGoGNStream::Dbg<1> CGoGNdbg;
extern CGoGNStream::Dbg<2> CGoGNdbg2;
extern CGoGNStream::Dbg<3> CGoGNdbg3;
extern CGoGNStream::Special CGoGNendl;
extern CGoGNStream::Special CGoGNflush;
} // namespace CGoGN
......
......@@ -246,6 +246,67 @@ Out<LEVEL>& Out<LEVEL>::operator<< (Special& os )
}
}
}
if (&os == &CGoGNflush)
{
char bufc[512];
// for cout & cerr just do the endl
if (m_out_mode & STDOUT)
std::cout << std::flush;
if (m_out_mode & STDERR)
std::cerr << std::flush;
if (m_out_mode & FILEOUT)
{
while (! m_buffer.eof())
{
m_buffer.getline(bufc,512);
*m_ofs << bufc << std::flush;
}
}
if (m_out_mode & QTSTATUSBAR)
{
while (! m_buffer.eof())
{
m_buffer.getline(bufc,512);
m_sqt_bar->statusMsg(bufc);
}
}
if (m_out_mode & QTCONSOLE)
{
while (! m_buffer.eof())
{
m_buffer.getline(bufc,512);
if (m_code >= 100)
m_sqt_console->console()->setTextColor(QColor(0, 150 - (m_code-100) * 20, 50 + (m_code-100) * 20));
else
{
if (m_code > 0)
m_sqt_console->console()->setTextColor(QColor(150, 0, 0));
else
m_sqt_console->console()->setTextColor(QColor(0, 0, 150));
}
m_sqt_console->console()->moveCursor(QTextCursor::End);
m_sqt_console->console()->insertPlainText(QString(bufc));
}
}
if (m_out_mode & SSBUFFER)
{
while (! m_buffer.eof())
{
m_buffer.getline(bufc, 512);
*m_oss << bufc << std::flush;
}
}
}
}
m_buffer.clear();
......
......@@ -40,6 +40,7 @@ CGoGNStream::Dbg<1> CGoGNdbg;
CGoGNStream::Dbg<2> CGoGNdbg2;
CGoGNStream::Dbg<3> CGoGNdbg3;
CGoGNStream::Special CGoGNendl;
CGoGNStream::Special CGoGNflush;
namespace CGoGNStream
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment