Commit eeaa15ab authored by Pierre Kraemer's avatar Pierre Kraemer

CGoGNendl -> std::endl : incompatible avec ostream

parent c1269877
......@@ -47,7 +47,6 @@ using namespace CGoGN ;
* Ajouter les widgets necessaires, mettre des noms clairs pour
* les utiliser dans le .cpp (pour les call back principalement)
*/
class MyQT: public Utils::QT::SimpleQT
{
Q_OBJECT
......
......@@ -149,7 +149,7 @@ void decimate(
while(!finished)
{
CGoGNout << "Countdown : " ;
CGoGNout << std::setprecision(8) << (nbVertices - nbWantedVertices) << "\r" << std::flush;
CGoGNout << std::setprecision(8) << (nbVertices - nbWantedVertices) << "\r" << /* flush */ CGoGNendl ;
if(!selector->nextEdge(d)) {
CGoGNout << CGoGNendl << "out" << CGoGNendl ;
......
......@@ -86,28 +86,28 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
}
}
out << "ply" << CGoGNendl ;
out << "format ascii 1.0" << CGoGNendl ;
out << "comment no comment" << CGoGNendl ;
out << "element vertex " << vertices.size() << CGoGNendl ;
out << "property float x" << CGoGNendl ;
out << "property float y" << CGoGNendl ;
out << "property float z" << CGoGNendl ;
out << "element face " << facesSize.size() << CGoGNendl ;
out << "property list uchar int vertex_indices" << CGoGNendl ;
out << "end_header" << CGoGNendl ;
out << "ply" << std::endl ;
out << "format ascii 1.0" << std::endl ;
out << "comment no comment" << std::endl ;
out << "element vertex " << vertices.size() << std::endl ;
out << "property float x" << std::endl ;
out << "property float y" << std::endl ;
out << "property float z" << std::endl ;
out << "element face " << facesSize.size() << std::endl ;
out << "property list uchar int vertex_indices" << std::endl ;
out << "end_header" << std::endl ;
for(unsigned int i = 0; i < vertices.size(); ++i)
{
const VEC3& v = position[vertices[i]] ;
out << v[0] << " " << v[1] << " " << v[2] << CGoGNendl ;
out << v[0] << " " << v[1] << " " << v[2] << std::endl ;
}
for(unsigned int i = 0; i < facesSize.size(); ++i)
{
out << facesSize[i] ;
for(unsigned int j = 0; j < facesIdx[i].size(); ++j)
out << " " << facesIdx[i][j] ;
out << CGoGNendl ;
out << std::endl ;
}
out.close() ;
......@@ -164,20 +164,20 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
}
}
out << "OFF" << CGoGNendl ;
out << vertices.size() << " " << facesSize.size() << " " << 0 << CGoGNendl ;
out << "OFF" << std::endl ;
out << vertices.size() << " " << facesSize.size() << " " << 0 << std::endl ;
for(unsigned int i = 0; i < vertices.size(); ++i)
{
const VEC3& v = position[vertices[i]] ;
out << v[0] << " " << v[1] << " " << v[2] << CGoGNendl ;
out << v[0] << " " << v[1] << " " << v[2] << std::endl ;
}
for(unsigned int i = 0; i < facesSize.size(); ++i)
{
out << facesSize[i] ;
for(unsigned int j = 0; j < facesIdx[i].size(); ++j)
out << " " << facesIdx[i][j] ;
out << CGoGNendl ;
out << std::endl ;
}
out.close() ;
......@@ -219,7 +219,6 @@ bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position,
verticesBuffer.push_back(vert[0]);
verticesBuffer.push_back(vert[1]);
verticesBuffer.push_back(vert[2]);
// CGoGNout << vert<< CGoGNendl;
}
indicesBuffer.push_back(tableVertLab[e]);
e = the_map.phi1(e);
......@@ -227,13 +226,6 @@ bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position,
}
}
// for (int i=0; i< indicesBuffer.size(); ++i)
// {
// CGoGNout << indicesBuffer[i]<<", "<< CGoGNendl;
// if (i%3==0)
// CGoGNout << CGoGNendl;
// }
// Save the file using the OpenCTM API
CTMexporter ctm;
......@@ -311,43 +303,43 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
}
}
out << "ply" << CGoGNendl ;
out << "format ascii 1.0" << CGoGNendl ;
out << "comment ply PTM (F. Larue format)" << CGoGNendl ;
out << "element vertex " << vertices.size() << CGoGNendl ;
out << "property float x" << CGoGNendl ;
out << "property float y" << CGoGNendl ;
out << "property float z" << CGoGNendl ;
out << "property float tx" << CGoGNendl ;
out << "property float ty" << CGoGNendl ;
out << "property float tz" << CGoGNendl ;
out << "property float bx" << CGoGNendl ;
out << "property float by" << CGoGNendl ;
out << "property float bz" << CGoGNendl ;
out << "property float nx" << CGoGNendl ;
out << "property float ny" << CGoGNendl ;
out << "property float nz" << CGoGNendl ;
out << "property float L1_a" << CGoGNendl ;
out << "property float L1_b" << CGoGNendl ;
out << "property float L1_c" << CGoGNendl ;
out << "property float L1_d" << CGoGNendl ;
out << "property float L1_e" << CGoGNendl ;
out << "property float L1_f" << CGoGNendl ;
out << "property float L2_a" << CGoGNendl ;
out << "property float L2_b" << CGoGNendl ;
out << "property float L2_c" << CGoGNendl ;
out << "property float L2_d" << CGoGNendl ;
out << "property float L2_e" << CGoGNendl ;
out << "property float L2_f" << CGoGNendl ;
out << "property float L3_a" << CGoGNendl ;
out << "property float L3_b" << CGoGNendl ;
out << "property float L3_c" << CGoGNendl ;
out << "property float L3_d" << CGoGNendl ;
out << "property float L3_e" << CGoGNendl ;
out << "property float L3_f" << CGoGNendl ;
out << "element face " << nbf << CGoGNendl ;
out << "property list uchar int vertex_indices" << CGoGNendl ;
out << "end_header" << CGoGNendl ;
out << "ply" << std::endl ;
out << "format ascii 1.0" << std::endl ;
out << "comment ply PTM (F. Larue format)" << std::endl ;
out << "element vertex " << vertices.size() << std::endl ;
out << "property float x" << std::endl ;
out << "property float y" << std::endl ;
out << "property float z" << std::endl ;
out << "property float tx" << std::endl ;
out << "property float ty" << std::endl ;
out << "property float tz" << std::endl ;
out << "property float bx" << std::endl ;
out << "property float by" << std::endl ;
out << "property float bz" << std::endl ;
out << "property float nx" << std::endl ;
out << "property float ny" << std::endl ;
out << "property float nz" << std::endl ;
out << "property float L1_a" << std::endl ;
out << "property float L1_b" << std::endl ;
out << "property float L1_c" << std::endl ;
out << "property float L1_d" << std::endl ;
out << "property float L1_e" << std::endl ;
out << "property float L1_f" << std::endl ;
out << "property float L2_a" << std::endl ;
out << "property float L2_b" << std::endl ;
out << "property float L2_c" << std::endl ;
out << "property float L2_d" << std::endl ;
out << "property float L2_e" << std::endl ;
out << "property float L2_f" << std::endl ;
out << "property float L3_a" << std::endl ;
out << "property float L3_b" << std::endl ;
out << "property float L3_c" << std::endl ;
out << "property float L3_d" << std::endl ;
out << "property float L3_e" << std::endl ;
out << "property float L3_f" << std::endl ;
out << "element face " << nbf << std::endl ;
out << "property list uchar int vertex_indices" << std::endl ;
out << "end_header" << std::endl ;
for(unsigned int i = 0; i < vertices.size(); ++i)
{
......@@ -358,7 +350,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
out << frame[2][vi][0] << " " << frame[2][vi][1] << " " << frame[2][vi][2] << " " ;
out << colorPTM[0][vi][0] << " " << colorPTM[1][vi][0] << " " << colorPTM[2][vi][0] << " " << colorPTM[3][vi][0] << " " << colorPTM[4][vi][0] << " " << colorPTM[5][vi][0] <<" " ;
out << colorPTM[0][vi][1] << " " << colorPTM[1][vi][1] << " " << colorPTM[2][vi][1] << " " << colorPTM[3][vi][1] << " " << colorPTM[4][vi][1] << " " << colorPTM[5][vi][1] <<" " ;
out << colorPTM[0][vi][2] << " " << colorPTM[1][vi][2] << " " << colorPTM[2][vi][2] << " " << colorPTM[3][vi][2] << " " << colorPTM[4][vi][2] << " " << colorPTM[5][vi][2] << CGoGNendl ;
out << colorPTM[0][vi][2] << " " << colorPTM[1][vi][2] << " " << colorPTM[2][vi][2] << " " << colorPTM[3][vi][2] << " " << colorPTM[4][vi][2] << " " << colorPTM[5][vi][2] << std::endl ;
}
std::vector<unsigned int>::iterator it = faces.begin();
......@@ -368,7 +360,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
out << nbe ;
for(unsigned int j = 0; j < nbe; ++j)
out << " " << *it++;
out << CGoGNendl ;
out << std::endl ;
}
out.close() ;
......
......@@ -56,8 +56,7 @@ typename PFP::VEC3 stringToEmb(std::string s)
return coord;
}
unsigned int gcd(unsigned int a, unsigned int b)
inline unsigned int gcd(unsigned int a, unsigned int b)
{
while ( true )
......
......@@ -28,6 +28,7 @@
#include "Algo/ProgressiveMesh/vsplit.h"
#include "Algo/Decimation/selector.h"
#include "Algo/Decimation/edgeSelector.h"
#include "Algo/Decimation/geometryApproximator.h"
#include "Algo/Decimation/geometryPredictor.h"
#include "Algo/Decimation/lightfieldApproximator.h"
......
......@@ -41,7 +41,7 @@ ProgressiveMesh<PFP>::ProgressiveMesh(
) :
m_map(map), positionsTable(position), inactiveMarker(inactive), dartSelect(inactiveMarker)
{
CGoGNout << " creating approximator and predictor.." << std::flush ;
CGoGNout << " creating approximator and predictor.." << /* flush */ CGoGNendl ;
switch(a)
{
case Algo::Decimation::A_QEM : {
......@@ -70,17 +70,10 @@ ProgressiveMesh<PFP>::ProgressiveMesh(
m_predictors.push_back(pred) ;
m_approximators.push_back(new Algo::Decimation::Approximator_MidEdge<PFP>(m_map, positionsTable, pred)) ;
break ; }
case Algo::Decimation::A_LightfieldFull : {
m_approximators.push_back(new Algo::Decimation::Approximator_QEM<PFP>(m_map, positionsTable)) ;
AttributeHandler<Geom::Matrix<3,3,typename PFP::REAL> > frame = m_map.template getAttribute<Geom::Matrix<3,3,typename PFP::REAL> >(VERTEX_ORBIT, "frame") ;
AttributeHandler<Geom::Matrix<3,6,typename PFP::REAL> > RGBfunctions = m_map.template getAttribute<Geom::Matrix<3,6,typename PFP::REAL> >(VERTEX_ORBIT, "RGBfunctions") ;
m_approximators.push_back(new Algo::Decimation::Approximator_Frame<PFP>(m_map, frame)) ;
m_approximators.push_back(new Algo::Decimation::Approximator_RGBfunctions<PFP>(m_map, RGBfunctions)) ;
break ; }
}
CGoGNout << "..done" << CGoGNendl ;
CGoGNout << " creating selector.." << std::flush ;
CGoGNout << " creating selector.." << /* flush */ CGoGNendl ;
switch(s)
{
case Algo::Decimation::S_MapOrder : {
......@@ -101,15 +94,12 @@ ProgressiveMesh<PFP>::ProgressiveMesh(
case Algo::Decimation::S_Curvature : {
m_selector = new Algo::Decimation::EdgeSelector_Curvature<PFP>(m_map, positionsTable, m_approximators, dartSelect) ;
break ; }
case Algo::Decimation::S_Lightfield : {
m_selector = new Algo::Decimation::EdgeSelector_Lightfield<PFP>(map, positionsTable, m_approximators, dartSelect) ;
break ; }
}
CGoGNout << "..done" << CGoGNendl ;
m_initOk = true ;
CGoGNout << " initializing approximators.." << std::flush ;
CGoGNout << " initializing approximators.." << /* flush */ CGoGNendl ;
for(typename std::vector<Algo::Decimation::ApproximatorGen<PFP>*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it)
{
if(! (*it)->init())
......@@ -119,13 +109,13 @@ ProgressiveMesh<PFP>::ProgressiveMesh(
}
CGoGNout << "..done" << CGoGNendl ;
CGoGNout << " initializing predictors.." << std::flush ;
CGoGNout << " initializing predictors.." << /* flush */ CGoGNendl ;
for(typename std::vector<Algo::Decimation::PredictorGen<PFP>*>::iterator it = m_predictors.begin(); it != m_predictors.end(); ++it)
if(! (*it)->init())
m_initOk = false ;
CGoGNout << "..done" << CGoGNendl ;
CGoGNout << " initializing selector.." << std::flush ;
CGoGNout << " initializing selector.." << /* flush */ CGoGNendl ;
m_initOk = m_selector->init() ;
CGoGNout << "..done" << CGoGNendl ;
......@@ -155,7 +145,7 @@ void ProgressiveMesh<PFP>::createPM(unsigned int percentWantedVertices)
{
unsigned int nbVertices = m_map.getNbOrbits(VERTEX_ORBIT) ;
unsigned int nbWantedVertices = nbVertices * percentWantedVertices / 100 ;
CGoGNout << " creating PM (" << nbVertices << " vertices).." << std::flush ;
CGoGNout << " creating PM (" << nbVertices << " vertices).." << /* flush */ CGoGNendl ;
bool finished = false ;
Dart d ;
......@@ -535,7 +525,7 @@ void ProgressiveMesh<PFP>::calculCourbeDebitDistortion()
float distance;
Point p;
CGoGNout << "calcul de la courbe débit distortion " << std::flush;
CGoGNout << "calcul de la courbe débit distortion " << CGoGNendl;
// get original detail vectors
for(unsigned int i = 0; i < m_splits.size(); ++i)
......@@ -573,7 +563,7 @@ void ProgressiveMesh<PFP>::calculCourbeDebitDistortion()
courbe.push_back(p);
// returns to coarse mesh
gotoLevel(nbSplits());
CGoGNout << "..." << std::flush;
CGoGNout << "..." << CGoGNendl;
}
q.erase();
}
......
......@@ -34,7 +34,6 @@ namespace Algo
namespace PMesh
{
template <typename PFP>
class VSplit
{
......@@ -98,7 +97,6 @@ public:
}
} ;
} //namespace PMesh
} //namespace Algo
......
......@@ -284,8 +284,7 @@ Intersection intersectionSegmentTriangle(const VEC3& PA, const VEC3& PB, const V
template <typename VEC3, typename PLANE3D>
Intersection intersectPlaneRay(const PLANE3D& pl,const VEC3& p1,const VEC3& dir, VEC3& Inter)
{
typename VEC3::DATA_TYPE isect;
isect = (pl.normal()*(pl.normal()*pl.d()-p1)) / (pl.normal()*dir);
typename VEC3::DATA_TYPE isect = (pl.normal() * (pl.normal()*pl.d()-p1)) / (pl.normal()*dir);
if(0.0f <= isect)
{
......
......@@ -36,7 +36,6 @@
#include "Geometry/vector_gen.h"
namespace CGoGN { namespace Utils { class GLSLShader; } }
//namespace CGoGN { namespace Geom { class Vec3f; } }
namespace CGoGN
{
......@@ -173,6 +172,11 @@ public:
*/
void setParamObject(float width, float* pos) { m_glWidget->setParamObject(width, pos); }
/**
* set focal
*/
void setFocal(float f) { m_glWidget->setFocal(f); }
/**
* get the mouse position in GL widget
*/
......@@ -310,7 +314,7 @@ public:
* @param dir base directory
* @param filters file filters (syntax: "label1 (filter1);; label2 (filter2);; ...")
*/
std::string selectFile(const std::string& title = "open file", const std::string& dir = ".", const std::string& filters = "all (*.*)");
std::string selectFile(const std::string& title = "open file", const std::string& dir = ".", const std::string& filters = "all (*.*)");
public slots:
virtual void cb_New() { std::cerr << "callback not implemented" << std::endl; }
......
......@@ -71,8 +71,6 @@ protected:
int m_current_button;
int beginx;
int beginy;
// float curquat[4];
// float lastquat[4];
int newModel;
int moving;
......
......@@ -34,14 +34,16 @@ namespace Utils
namespace QT
{
class uiDockInterface: public QDockWidget, public Ui::DockWidget
class uiDockInterface : public QDockWidget, public Ui::DockWidget
{
public:
uiDockInterface() { setupUi(this); }
};
}
}
}
} // namespace QT
} // namespace Utils
} // namespace CGoGN
#endif
......@@ -72,11 +72,11 @@ public:
void zero () ;
friend std::ostream& operator<< (std::ostream &out, const QuadricRGBfunctions& q) {
out << "quadricRGBf : " << CGoGNendl ;
out << "q.A" << "= " << q.A << CGoGNendl ;
out << "quadricRGBf : " << std::endl ;
out << "q.A" << "= " << q.A << std::endl ;
for (unsigned int i = 0 ; i < 3 ; ++i) {
out << "q.b["<<i<<"] = " << q.b[i] << CGoGNendl ;
out << "q.c["<<i<<"] = " << q.c[i] << CGoGNendl ;
out << "q.b["<<i<<"] = " << q.b[i] << std::endl ;
out << "q.c["<<i<<"] = " << q.c[i] << std::endl ;
}
return out ;
} ;
......
......@@ -280,7 +280,7 @@ void Quantization<VEC>::vectorQuantizationDistortion(float distortionGoal, std::
computeDiscreteEntropy() ;
}
float log2(float x)
inline float log2(float x)
{
return log(x) / log(2.0f) ;
}
......
......@@ -542,7 +542,8 @@ bool GLSLShader::bind() const
glUseProgramObjectARB( m_program_object );
return true;
}
else return false;
else
return false;
}
void GLSLShader::unbind() const
......
......@@ -43,7 +43,6 @@ namespace QT
SimpleQT::SimpleQT():
m_dock(NULL)
{
m_glWidget = new GLWidget(this);
setCentralWidget(m_glWidget);
setWindowTitle(tr("CGoGN"));
......
......@@ -69,8 +69,8 @@ void GLWidget::setParamObject(float width, float* pos)
void GLWidget::setFocal(float df)
{
if (df > 3.0f)
df = 3.0f;
if (df > 5.0f)
df = 5.0f;
if (df < 0.2f)
df = 0.2f;
......@@ -180,7 +180,7 @@ void GLWidget::mouseMoveEvent(QMouseEvent* event)
break;
case Qt::MidButton:
{
float wl = -0.2f * FAR_PLANE / foc;
float wl = -0.5f * FAR_PLANE / foc;
m_cbs->trans_z() -= wl / W * (x - beginx);
m_cbs->trans_z() -= wl / H * (y - beginy);
}
......@@ -209,7 +209,7 @@ void GLWidget::mouseMoveEvent(QMouseEvent* event)
void GLWidget::wheelEvent ( QWheelEvent * event )
{
float wl = -0.02f * FAR_PLANE / foc;
float wl = -0.05f * FAR_PLANE / foc;
if (event->delta() > 0)
m_cbs->trans_z() += wl;
......
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