Solved namespace ambiguities caused by the removal of a silly 'using namespace' in meshmodel.h

This commit is contained in:
Paolo Cignoni cignoni 2008-04-04 14:56:32 +00:00
parent db8240fc00
commit f2faae9092
7 changed files with 30 additions and 33 deletions

View File

@ -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;
}

View File

@ -68,6 +68,7 @@ The first version contains:
#include<vcg/complex/trimesh/update/bounding.h>
//#include <vcg/space/triangle3.h>
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;

View File

@ -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<CMeshO::FacePointer> tempSel; //to use when needed
vector<CMeshO::FacePointer> curSel; //the faces i am painting on
std::vector<CMeshO::FacePointer> tempSel; //to use when needed
std::vector<CMeshO::FacePointer> curSel; //the faces i am painting on
QHash<CVertexO *,Vert_Data_2> 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<CMeshO::FacePointer> &);
bool getFacesAtMouse(MeshModel &,std::vector<CMeshO::FacePointer> &);
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<vector<UndoItem> *> undos; // the vector of the undo's
vector<vector<UndoItem> *> redos; // the vector of the redo's
vector<UndoItem> * temp_vector; // the vector of the not yet added single undos
std::vector< std::vector<UndoItem> *> undos; // the vector of the undo's
std::vector< std::vector<UndoItem> *> redos; // the vector of the redo's
std::vector<UndoItem> * 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; lauf<redos.size(); lauf++) { redos[lauf]->clear(); delete redos[lauf];}
redos.clear();
undos.push_back(temp_vector);
temp_vector=new vector<UndoItem>();
temp_vector=new std::vector<UndoItem>();
}
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<UndoItem>();}
ColorUndo() { temp_vector=new std::vector<UndoItem>();}
};
/** 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; }

View File

@ -9,6 +9,8 @@ email: gfrei.andreas@gmx.net
#include <QPainter>
#include <QColorDialog>
using namespace std;
using namespace vcg;
Color4b to4b(QColor c) {
return Color4b(c.red(),c.green(),c.blue(),255);

View File

@ -1,14 +1,6 @@
#ifndef MESHCUTTING_H
#define MESHCUTTING_H
#ifdef max
#undef max
#endif
#ifdef min
#undef min
#endif
#include <iostream>
#include <fstream>
#include <cstdlib>
@ -62,7 +54,7 @@ namespace vcg {
template <class VERTEX_TYPE> class SegmentHeap {
private :
vector<CuttingTriplet<VERTEX_TYPE> > _container;
std::vector<CuttingTriplet<VERTEX_TYPE> > _container;
MinTriplet<VERTEX_TYPE> cmp;
public :
@ -79,8 +71,8 @@ namespace vcg {
}
void rebuild(){
typename vector<CuttingTriplet<VERTEX_TYPE> >::iterator iter = _container.begin();
typename vector<CuttingTriplet<VERTEX_TYPE> >::iterator last = _container.end();
typename std::vector<CuttingTriplet<VERTEX_TYPE> >::iterator iter = _container.begin();
typename std::vector<CuttingTriplet<VERTEX_TYPE> >::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<FaceType*> edgeFaceQueue;
std::queue<FaceType*> edgeFaceQueue;
for (vi = mesh->vert.begin(); vi != mesh->vert.end(); ++vi) {
if ( vi->IMark() == F ) vi->C() = Color4b::Yellow;

View File

@ -1,5 +1,6 @@
#include <editsegment.h>
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;

View File

@ -47,11 +47,11 @@ private:
QDockWidget *meshcut_dock;
MeshCutDialog * meshCutDialog;
GLArea * glarea;
MeshCutting<CMeshO> * meshCut;
vcg::MeshCutting<CMeshO> * meshCut;
QMap<GLArea *, MeshCutting<CMeshO> *> glarea_map;
QMap<GLArea *, vcg::MeshCutting<CMeshO> *> glarea_map;
vector<CMeshO::FacePointer> currentSelection;
std::vector<CMeshO::FacePointer> currentSelection;
GLfloat *pixels;
double mvmatrix[16]; //modelview