From f2faae90928d58cb9a307367b112245da71ff53b Mon Sep 17 00:00:00 2001 From: Paolo Cignoni cignoni Date: Fri, 4 Apr 2008 14:56:32 +0000 Subject: [PATCH] Solved namespace ambiguities caused by the removal of a silly 'using namespace' in meshmodel.h --- .../filter_trioptimize/filter_trioptimize.cpp | 5 ++-- src/meshlabplugins/editpaint/editpaint.cpp | 3 ++- src/meshlabplugins/editpaint/editpaint.h | 26 +++++++++---------- src/meshlabplugins/editpaint/paintbox.cpp | 2 ++ src/meshlabplugins/editsegment/cutting.h | 16 +++--------- .../editsegment/editsegment.cpp | 5 ++-- src/meshlabplugins/editsegment/editsegment.h | 6 ++--- 7 files changed, 30 insertions(+), 33 deletions(-) diff --git a/src/fgt/filter_trioptimize/filter_trioptimize.cpp b/src/fgt/filter_trioptimize/filter_trioptimize.cpp index fe620eb8e..437515a57 100644 --- a/src/fgt/filter_trioptimize/filter_trioptimize.cpp +++ b/src/fgt/filter_trioptimize/filter_trioptimize.cpp @@ -138,8 +138,9 @@ const int TriOptimizePlugin::getRequirements(QAction *action) switch (ID(action)) { case FP_EDGE_FLIP: return MeshModel::MM_FACETOPO | - MeshModel::MM_VERTFACETOPO | - MeshModel::MM_BORDERFLAG; + MeshModel::MM_VERTFACETOPO | + MeshModel::MM_VERTMARK | + MeshModel::MM_BORDERFLAG; case FP_NEAR_LAPLACIAN_SMOOTH: return MeshModel::MM_BORDERFLAG; } diff --git a/src/meshlabplugins/editpaint/editpaint.cpp b/src/meshlabplugins/editpaint/editpaint.cpp index 9264259dc..b177e1243 100755 --- a/src/meshlabplugins/editpaint/editpaint.cpp +++ b/src/meshlabplugins/editpaint/editpaint.cpp @@ -68,6 +68,7 @@ The first version contains: #include //#include +using namespace std; using namespace vcg; EditPaintPlugin::EditPaintPlugin() { @@ -137,7 +138,7 @@ void EditPaintPlugin::StartEdit(QAction * /*mode*/, MeshModel &m, GLArea * paren paint_dock->setVisible(true); paint_dock->layout()->update(); //m.updateDataMask(MeshModel::MM_FACETOPO); - m.updateDataMask(MeshModel::MM_VERTFACETOPO); + m.updateDataMask(MeshModel::MM_VERTFACETOPO | MeshModel::MM_VERTMARK ); parent->getCurrentRenderMode().colorMode=vcg::GLW::CMPerVert; parent->mm()->ioMask|=MeshModel::IOM_VERTCOLOR; diff --git a/src/meshlabplugins/editpaint/editpaint.h b/src/meshlabplugins/editpaint/editpaint.h index ac0920e6d..e5f4173e7 100755 --- a/src/meshlabplugins/editpaint/editpaint.h +++ b/src/meshlabplugins/editpaint/editpaint.h @@ -42,7 +42,7 @@ struct Penn { struct UndoItem { CVertexO * vertex; - Color4b original; + vcg::Color4b original; }; struct Vert_Data { @@ -52,12 +52,12 @@ struct Vert_Data { struct Vert_Data_2 { float distance; - Color4b color; + vcg::Color4b color; }; struct Vert_Data_3{ float pos[3]; - Color4b color; + vcg::Color4b color; }; /** the main class of the plugin */ @@ -97,8 +97,8 @@ private: GLint viewport[4]; //viewport GLfloat *pixels; // the z-buffer int inverse_y; // gla->curSiz.height()-cur.y() TODO probably removable - vector tempSel; //to use when needed - vector curSel; //the faces i am painting on + std::vector tempSel; //to use when needed + std::vector curSel; //the faces i am painting on QHash visited_vertexes; //the vertexes i am painting on Penn pen; //contains informations about the painting mode, color, type ... PaintToolbox *paintbox; //the widget with the painting stuff @@ -111,7 +111,7 @@ private: void drawLine(GLArea * gla); // to draw a xor-line from start to cur, used for gradient void fillGradient(MeshModel &,GLArea * gla); bool getFaceAtMouse(MeshModel &,CMeshO::FacePointer &); - bool getFacesAtMouse(MeshModel &,vector &); + bool getFacesAtMouse(MeshModel &,std::vector &); bool getVertexAtMouse(MeshModel &,CMeshO::VertexPointer &); bool getVertexesAtMouse(); void fillFrom(MeshModel &,CFaceO *); @@ -151,9 +151,9 @@ public slots: there is still some error, and at the moment it manages only color undo, but not vertex-pos undo */ class ColorUndo { private: - vector *> undos; // the vector of the undo's - vector *> redos; // the vector of the redo's - vector * temp_vector; // the vector of the not yet added single undos + std::vector< std::vector *> undos; // the vector of the undo's + std::vector< std::vector *> redos; // the vector of the redo's + std::vector * temp_vector; // the vector of the not yet added single undos public: /** adds the single undos as unified undo and checks if there are more then 15 undos, in that case it removes the first undo */ @@ -163,7 +163,7 @@ public: for (int lauf=0; laufclear(); delete redos[lauf];} redos.clear(); undos.push_back(temp_vector); - temp_vector=new vector(); + temp_vector=new std::vector(); } void undo(); void redo(); @@ -178,7 +178,7 @@ public: bool hasRedo() { return redos.size()!=0; } /** adds a single item */ inline void addItem(UndoItem u) { temp_vector->push_back(u); } - ColorUndo() { temp_vector=new vector();} + ColorUndo() { temp_vector=new std::vector();} }; /** manages the paint window */ @@ -186,8 +186,8 @@ class PaintToolbox : public QWidget { Q_OBJECT public: PaintToolbox ( /*const QString & title,*/ QWidget * parent = 0, Qt::WindowFlags flags = 0 ); - Color4b getColor(Qt::MouseButton); - void setColor(Color4b,Qt::MouseButton); + vcg::Color4b getColor(Qt::MouseButton); + void setColor(vcg::Color4b,Qt::MouseButton); void setColor(int,int,int,Qt::MouseButton mouse); double getRadius() { if (ui.tabWidget->currentIndex()==1) return ui.pen_radius_2->value(); return ui.pen_radius->value(); } int paintType() { if (ui.tabWidget->currentIndex()==1) return ui.pen_type_2->currentIndex()+1; return ui.pen_type->currentIndex()+1; } diff --git a/src/meshlabplugins/editpaint/paintbox.cpp b/src/meshlabplugins/editpaint/paintbox.cpp index 9b9d6f7fd..3f396a310 100644 --- a/src/meshlabplugins/editpaint/paintbox.cpp +++ b/src/meshlabplugins/editpaint/paintbox.cpp @@ -9,6 +9,8 @@ email: gfrei.andreas@gmx.net #include #include +using namespace std; +using namespace vcg; Color4b to4b(QColor c) { return Color4b(c.red(),c.green(),c.blue(),255); diff --git a/src/meshlabplugins/editsegment/cutting.h b/src/meshlabplugins/editsegment/cutting.h index d90f31b27..88ed080b2 100644 --- a/src/meshlabplugins/editsegment/cutting.h +++ b/src/meshlabplugins/editsegment/cutting.h @@ -1,14 +1,6 @@ #ifndef MESHCUTTING_H #define MESHCUTTING_H -#ifdef max -#undef max -#endif - -#ifdef min -#undef min -#endif - #include #include #include @@ -62,7 +54,7 @@ namespace vcg { template class SegmentHeap { private : - vector > _container; + std::vector > _container; MinTriplet cmp; public : @@ -79,8 +71,8 @@ namespace vcg { } void rebuild(){ - typename vector >::iterator iter = _container.begin(); - typename vector >::iterator last = _container.end(); + typename std::vector >::iterator iter = _container.begin(); + typename std::vector >::iterator last = _container.end(); //last punta all'ultimo elemento valido --last; int num_to_remove = 0; @@ -337,7 +329,7 @@ namespace vcg { FaceIterator fi; VertexIterator vi; - queue edgeFaceQueue; + std::queue edgeFaceQueue; for (vi = mesh->vert.begin(); vi != mesh->vert.end(); ++vi) { if ( vi->IMark() == F ) vi->C() = Color4b::Yellow; diff --git a/src/meshlabplugins/editsegment/editsegment.cpp b/src/meshlabplugins/editsegment/editsegment.cpp index bc98ea684..35552ccf7 100644 --- a/src/meshlabplugins/editsegment/editsegment.cpp +++ b/src/meshlabplugins/editsegment/editsegment.cpp @@ -1,5 +1,6 @@ #include +using namespace std; using namespace vcg; inline bool isFront(const QPointF &a, const QPointF &b, const QPointF &c) { @@ -312,8 +313,8 @@ void EditSegment::StartEdit(QAction * mode, MeshModel & m, GLArea * parent) { meshcut_dock->setVisible(true); meshcut_dock->layout()->update(); - m.updateDataMask(MeshModel::MM_VERTFACETOPO); - m.updateDataMask(MeshModel::MM_FACETOPO); + m.updateDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_VERTFACETOPO | MeshModel::MM_VERTMARK ); + parent->getCurrentRenderMode().colorMode=vcg::GLW::CMPerVert; parent->mm()->ioMask|=MeshModel::IOM_VERTCOLOR; diff --git a/src/meshlabplugins/editsegment/editsegment.h b/src/meshlabplugins/editsegment/editsegment.h index e9dc9122a..cb90e35a3 100644 --- a/src/meshlabplugins/editsegment/editsegment.h +++ b/src/meshlabplugins/editsegment/editsegment.h @@ -47,11 +47,11 @@ private: QDockWidget *meshcut_dock; MeshCutDialog * meshCutDialog; GLArea * glarea; - MeshCutting * meshCut; + vcg::MeshCutting * meshCut; - QMap *> glarea_map; + QMap *> glarea_map; - vector currentSelection; + std::vector currentSelection; GLfloat *pixels; double mvmatrix[16]; //modelview