mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-16 17:44:36 +00:00
** big change **
Added Layers managemnt. Interfaces are changing again...
This commit is contained in:
parent
c6d3349cb4
commit
875c22f19c
@ -24,6 +24,11 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.6 2007/04/16 09:25:28 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.5 2007/03/20 16:23:07 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -74,7 +79,7 @@ bool BaseMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshMo
|
||||
vcg::tri::io::ImporterPLY<CMeshO>::LoadMask(filename.c_str(), mask);
|
||||
m.Enable(mask);
|
||||
|
||||
int result = vcg::tri::io::ImporterPLY<CMeshO>::Open(m.cm(), filename.c_str(), mask, cb);
|
||||
int result = vcg::tri::io::ImporterPLY<CMeshO>::Open(m.cm, filename.c_str(), mask, cb);
|
||||
if (result != 0) // all the importers return 0 on success
|
||||
{
|
||||
QMessageBox::warning(parent, tr("PLY Opening Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ImporterPLY<CMeshO>::ErrorMsg(result)));
|
||||
@ -83,7 +88,7 @@ bool BaseMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshMo
|
||||
}
|
||||
else if (formatName.toUpper() == tr("STL"))
|
||||
{
|
||||
int result = vcg::tri::io::ImporterSTL<CMeshO>::Open(m.cm(), filename.c_str(), cb);
|
||||
int result = vcg::tri::io::ImporterSTL<CMeshO>::Open(m.cm, filename.c_str(), cb);
|
||||
if (result != 0) // all the importers return 0 on success
|
||||
{
|
||||
QMessageBox::warning(parent, tr("STL Opening Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ImporterSTL<CMeshO>::ErrorMsg(result)));
|
||||
@ -91,7 +96,7 @@ bool BaseMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshMo
|
||||
}
|
||||
int retVal=QMessageBox::question ( parent, tr("STL File Importing"),tr("Do you want to unify duplicated vertices?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No );
|
||||
if(retVal==QMessageBox::Yes )
|
||||
tri::Clean<CMeshO>::RemoveDuplicateVertex(m.cm());
|
||||
tri::Clean<CMeshO>::RemoveDuplicateVertex(m.cm);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -102,12 +107,12 @@ bool BaseMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshMo
|
||||
// verify if texture files are present
|
||||
QString missingTextureFilesMsg = "The following texture files were not found:\n";
|
||||
bool someTextureNotFound = false;
|
||||
for ( unsigned textureIdx = 0; textureIdx < m.cm().textures.size(); ++textureIdx)
|
||||
for ( unsigned textureIdx = 0; textureIdx < m.cm.textures.size(); ++textureIdx)
|
||||
{
|
||||
if (!QFile::exists(m.cm().textures[textureIdx].c_str()))
|
||||
if (!QFile::exists(m.cm.textures[textureIdx].c_str()))
|
||||
{
|
||||
missingTextureFilesMsg.append("\n");
|
||||
missingTextureFilesMsg.append(m.cm().textures[textureIdx].c_str());
|
||||
missingTextureFilesMsg.append(m.cm.textures[textureIdx].c_str());
|
||||
someTextureNotFound = true;
|
||||
}
|
||||
}
|
||||
@ -128,7 +133,7 @@ bool BaseMeshIOPlugin::save(const QString &formatName,QString &fileName, MeshMod
|
||||
|
||||
if(formatName.toUpper() == tr("PLY"))
|
||||
{
|
||||
int result = vcg::tri::io::ExporterPLY<CMeshO>::Save(m.cm(),filename.c_str(),mask,cb);
|
||||
int result = vcg::tri::io::ExporterPLY<CMeshO>::Save(m.cm,filename.c_str(),mask,cb);
|
||||
if(result!=0)
|
||||
{
|
||||
QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ExporterPLY<CMeshO>::ErrorMsg(result)));
|
||||
@ -138,7 +143,7 @@ bool BaseMeshIOPlugin::save(const QString &formatName,QString &fileName, MeshMod
|
||||
}
|
||||
if(formatName.toUpper() == tr("STL"))
|
||||
{
|
||||
int result = vcg::tri::io::ExporterSTL<CMeshO>::Save(m.cm(),filename.c_str(),mask,cb);
|
||||
int result = vcg::tri::io::ExporterSTL<CMeshO>::Save(m.cm,filename.c_str(),mask,cb);
|
||||
if(result!=0)
|
||||
{
|
||||
QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ExporterSTL<CMeshO>::ErrorMsg(result)));
|
||||
|
||||
@ -24,6 +24,11 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.11 2007/04/16 09:25:28 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.10 2007/03/20 16:23:07 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -133,9 +138,9 @@ const CleanFilter::FilterClass CleanFilter::getClass(QAction *a)
|
||||
}
|
||||
}
|
||||
|
||||
const QString CleanFilter::Info(QAction *action)
|
||||
const QString CleanFilter::Info(FilterType filterId)
|
||||
{
|
||||
switch(ID(action))
|
||||
switch(filterId)
|
||||
{
|
||||
case FP_REBUILD_SURFACE : return QString("Merge");
|
||||
case FP_REMOVE_ISOLATED_COMPLEXITY: return tr("Remove Isolated");
|
||||
@ -168,23 +173,21 @@ const int CleanFilter::getRequirements(QAction *action)
|
||||
}
|
||||
|
||||
bool CleanFilter::getStdFields(QAction *action, MeshModel &m, StdParList &parlst)
|
||||
{
|
||||
|
||||
|
||||
|
||||
{
|
||||
switch(ID(action))
|
||||
{
|
||||
case FP_REBUILD_SURFACE :
|
||||
parlst.addField("BallRadius","Enter ball size as a diag perc. (0 autoguess))",(float)maxDiag1);
|
||||
parlst.addFieldFloat("BallRadius","Enter ball size as a diag perc. (0 autoguess))",(float)maxDiag1);
|
||||
parlst.addFieldBool("ComputeNormal","Compute the per vertex normals using only the point set ",false);
|
||||
break;
|
||||
case FP_REMOVE_ISOLATED_DIAMETER:
|
||||
parlst.addField("MinComponentDiag","Enter size (as a diag perc 0..100)",(float)maxDiag2);
|
||||
parlst.addFieldFloat("MinComponentDiag","Enter size (as a diag perc 0..100)",(float)maxDiag2);
|
||||
break;
|
||||
case FP_REMOVE_ISOLATED_COMPLEXITY:
|
||||
parlst.addField("MinComponentSize","Enter minimum conn. comp size:",(int)minCC);
|
||||
parlst.addFieldInt("MinComponentSize","Enter minimum conn. comp size:",(int)minCC);
|
||||
break;
|
||||
case FP_REMOVE_WRT_Q:
|
||||
parlst.addField("MaxQualityThr","Delete all Vertices with quality under:",(float)val1);
|
||||
parlst.addFieldFloat("MaxQualityThr","Delete all Vertices with quality under:",(float)val1);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
@ -193,25 +196,32 @@ bool CleanFilter::getStdFields(QAction *action, MeshModel &m, StdParList &parlst
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CleanFilter::getStdParameters(QAction *action, QWidget *parent, MeshModel &m,FilterParameter &par)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool CleanFilter::getParameters(QAction *action, QWidget *parent, MeshModel &m,FilterParameter &par)
|
||||
{
|
||||
switch(ID(action))
|
||||
/* switch(ID(action))
|
||||
{
|
||||
case FP_REBUILD_SURFACE :
|
||||
case FP_REBUILD_SURFACE :
|
||||
maxDiag1 = par.getFloat("BallRadius");
|
||||
par.update("BallRadius",float(m.cm().bbox.Diag()*maxDiag1/100.0));
|
||||
ComputeNormalFlag=
|
||||
par.update("BallRadius",float(m.cm.bbox.Diag()*maxDiag1/100.0));
|
||||
return true;
|
||||
case FP_REMOVE_ISOLATED_DIAMETER:
|
||||
maxDiag2 = par.getFloat("MinComponentDiag");
|
||||
par.update("MinComponentDiag",float(m.cm().bbox.Diag()*maxDiag2/100.0));
|
||||
return true;
|
||||
par.update("MinComponentDiag",float(m.cm.bbox.Diag()*maxDiag2/100.0));
|
||||
return true;
|
||||
case FP_REMOVE_ISOLATED_COMPLEXITY:
|
||||
minCC = par.getInt("MinComponentSize");
|
||||
return true;
|
||||
case FP_REMOVE_WRT_Q:
|
||||
val1 = par.getFloat("MaxQualityThr");
|
||||
return true;
|
||||
}
|
||||
minCC = par.getInt("MinComponentSize");
|
||||
return true;
|
||||
case FP_REMOVE_WRT_Q:
|
||||
val1 = par.getFloat("MaxQualityThr");
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;*/
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -225,40 +235,40 @@ bool CleanFilter::applyFilter(QAction *filter, MeshModel &m, FilterParameter & p
|
||||
float radius = par.getFloat("BallRadius");
|
||||
float clustering = 0.1;
|
||||
float crease=0;
|
||||
m.cm().fn=0;
|
||||
m.cm().face.resize(0);
|
||||
NormalExtrapolation<vector<CVertexO> >::ExtrapolateNormals(m.cm().vert.begin(), m.cm().vert.end(), 10,-1,NormalExtrapolation<vector<CVertexO> >::IsCorrect, cb);
|
||||
tri::Pivot<CMeshO> pivot(m.cm(), radius, clustering, crease);
|
||||
m.cm.fn=0;
|
||||
m.cm.face.resize(0);
|
||||
NormalExtrapolation<vector<CVertexO> >::ExtrapolateNormals(m.cm.vert.begin(), m.cm.vert.end(), 10,-1,NormalExtrapolation<vector<CVertexO> >::IsCorrect, cb);
|
||||
tri::Pivot<CMeshO> pivot(m.cm, radius, clustering, crease);
|
||||
// the main processing
|
||||
pivot.buildMesh(cb);
|
||||
}
|
||||
if(filter->text() == ST(FP_REMOVE_ISOLATED_DIAMETER) )
|
||||
{
|
||||
float minCC= par.getFloat("MinComponentDiag");
|
||||
RemoveSmallConnectedComponentsDiameter<CMeshO>(m.cm(),minCC);
|
||||
RemoveSmallConnectedComponentsDiameter<CMeshO>(m.cm,minCC);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_REMOVE_ISOLATED_COMPLEXITY) )
|
||||
{
|
||||
float minCC= par.getInt("MinComponentSize");
|
||||
RemoveSmallConnectedComponentsSize<CMeshO>(m.cm(),minCC);
|
||||
RemoveSmallConnectedComponentsSize<CMeshO>(m.cm,minCC);
|
||||
}
|
||||
if(filter->text() == ST(FP_REMOVE_WRT_Q) )
|
||||
{
|
||||
float val=par.getFloat("MaxQualityThr");
|
||||
CMeshO::VertexIterator vi;
|
||||
for(vi=m.cm().vert.begin();vi!=m.cm().vert.end();++vi)
|
||||
for(vi=m.cm.vert.begin();vi!=m.cm.vert.end();++vi)
|
||||
if(!(*vi).IsD() && (*vi).Q()<val)
|
||||
{
|
||||
(*vi).SetD();
|
||||
m.cm().vn--;
|
||||
m.cm.vn--;
|
||||
}
|
||||
CMeshO::FaceIterator fi;
|
||||
for(fi=m.cm().face.begin();fi!=m.cm().face.end();++fi) if(!(*fi).IsD())
|
||||
for(fi=m.cm.face.begin();fi!=m.cm.face.end();++fi) if(!(*fi).IsD())
|
||||
if((*fi).V(0)->IsD() ||(*fi).V(1)->IsD() ||(*fi).V(2)->IsD() )
|
||||
{
|
||||
(*fi).SetD();
|
||||
--m.cm().fn;
|
||||
--m.cm.fn;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -24,6 +24,11 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.7 2007/04/16 09:25:28 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.6 2007/02/08 23:46:16 pirosu
|
||||
merged srcpar and par in the GetStdParameters() function
|
||||
|
||||
@ -88,7 +93,7 @@ class CleanFilter : public QObject, public MeshFilterInterface
|
||||
CleanFilter();
|
||||
~CleanFilter();
|
||||
virtual const QString ST(FilterType filter);
|
||||
virtual const QString Info(QAction *);
|
||||
virtual const QString Info(FilterType filter);
|
||||
virtual const PluginInfo &Info();
|
||||
|
||||
virtual const FilterClass getClass(QAction *);
|
||||
@ -97,6 +102,7 @@ class CleanFilter : public QObject, public MeshFilterInterface
|
||||
|
||||
bool getStdFields(QAction *, MeshModel &m, StdParList &parlst);
|
||||
bool getParameters(QAction *action, QWidget *parent, MeshModel &m,FilterParameter &par);
|
||||
bool getStdParameters(QAction *action, QWidget *parent, MeshModel &m,FilterParameter &par);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@ -24,6 +24,11 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.14 2007/04/16 09:25:28 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.13 2007/03/20 16:23:08 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -109,9 +114,9 @@ bool ColladaIOPlugin::open(const QString &formatName, QString &fileName, MeshMod
|
||||
|
||||
m.Enable(info->mask);
|
||||
for(unsigned int tx = 0; tx < info->texturefile.size();++tx)
|
||||
m.cm().textures.push_back(info->texturefile[tx].toStdString());
|
||||
m.cm.textures.push_back(info->texturefile[tx].toStdString());
|
||||
|
||||
int result = vcg::tri::io::ImporterDAE<CMeshO>::Open(m.cm(), filename.c_str(),m.addinfo);
|
||||
int result = vcg::tri::io::ImporterDAE<CMeshO>::Open(m.cm, filename.c_str(),m.addinfo);
|
||||
|
||||
|
||||
|
||||
@ -131,13 +136,13 @@ bool ColladaIOPlugin::open(const QString &formatName, QString &fileName, MeshMod
|
||||
// verify if texture files are present
|
||||
QString missingTextureFilesMsg = "The following texture files were not found:\n";
|
||||
bool someTextureNotFound = false;
|
||||
for ( unsigned textureIdx = 0; textureIdx < m.cm().textures.size(); ++textureIdx)
|
||||
for ( unsigned textureIdx = 0; textureIdx < m.cm.textures.size(); ++textureIdx)
|
||||
{
|
||||
FILE* pFile = fopen (m.cm().textures[textureIdx].c_str(), "r");
|
||||
FILE* pFile = fopen (m.cm.textures[textureIdx].c_str(), "r");
|
||||
if (pFile == NULL)
|
||||
{
|
||||
missingTextureFilesMsg.append("\n");
|
||||
missingTextureFilesMsg.append(m.cm().textures[textureIdx].c_str());
|
||||
missingTextureFilesMsg.append(m.cm.textures[textureIdx].c_str());
|
||||
someTextureNotFound = true;
|
||||
}
|
||||
else
|
||||
@ -146,9 +151,9 @@ bool ColladaIOPlugin::open(const QString &formatName, QString &fileName, MeshMod
|
||||
if (someTextureNotFound)
|
||||
QMessageBox::warning(parent, tr("Missing texture files"), missingTextureFilesMsg);
|
||||
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm()); // updates bounding box
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm); // updates bounding box
|
||||
if (!normalsUpdated)
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertex(m.cm()); // updates normals
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertex(m.cm); // updates normals
|
||||
|
||||
if (cb != NULL) (*cb)(99, "Done");
|
||||
|
||||
@ -164,9 +169,9 @@ bool ColladaIOPlugin::save(const QString &formatName,QString &fileName, MeshMode
|
||||
int result;
|
||||
|
||||
if (std::find(_mp.begin(),_mp.end(),&m) == _mp.end())
|
||||
result = vcg::tri::io::ExporterDAE<CMeshO>::Save(m.cm(),filename.c_str(),mask);
|
||||
result = vcg::tri::io::ExporterDAE<CMeshO>::Save(m.cm,filename.c_str(),mask);
|
||||
else
|
||||
result = vcg::tri::io::ExporterDAE<CMeshO>::Save(m.cm(),filename.c_str(),m.addinfo,mask);
|
||||
result = vcg::tri::io::ExporterDAE<CMeshO>::Save(m.cm,filename.c_str(),m.addinfo,mask);
|
||||
|
||||
if(result!=0)
|
||||
{
|
||||
|
||||
@ -122,7 +122,7 @@ void EditPaintPlugin::StartEdit(QAction * /*mode*/, MeshModel &m, GLArea * paren
|
||||
parent->setCursor(QCursor(QPixmap(":/images/cursor_paint.png"),1,1));
|
||||
first=true;
|
||||
pressed=0;
|
||||
tri::UpdateBounding<CMeshO>::Box(m.cm());
|
||||
tri::UpdateBounding<CMeshO>::Box(m.cm);
|
||||
if (paintbox==0) {
|
||||
paintbox=new PaintToolbox(parent->window());
|
||||
paint_dock=new QDockWidget(parent->window());
|
||||
@ -140,8 +140,8 @@ void EditPaintPlugin::StartEdit(QAction * /*mode*/, MeshModel &m, GLArea * paren
|
||||
m.updateDataMask(MeshModel::MM_VERTFACETOPO);
|
||||
|
||||
parent->getCurrentRenderMode().colorMode=vcg::GLW::CMPerVert;
|
||||
parent->mm->ioMask|=MeshModel::IOM_VERTCOLOR;
|
||||
parent->mm->ioMask|=MeshModel::IOM_VERTQUALITY;
|
||||
parent->mm()->ioMask|=MeshModel::IOM_VERTCOLOR;
|
||||
parent->mm()->ioMask|=MeshModel::IOM_VERTQUALITY;
|
||||
|
||||
curSel.clear();
|
||||
parent->update();
|
||||
@ -184,8 +184,8 @@ void EditPaintPlugin::mousePressEvent(QAction * ac, QMouseEvent * event, MeshMod
|
||||
pen.invisible=paintbox->getPaintInvisible();
|
||||
switch (paintbox->paintType()) {
|
||||
case 1: { pen.radius=paintbox->getRadius()*0.5; } break;
|
||||
case 2: { pen.radius=paintbox->getRadius()*m.cm().bbox.Diag()*0.01*0.5; } break;
|
||||
case 3: { pen.radius=paintbox->getRadius()*m.cm().bbox.DimY()*0.01*0.5; } break;
|
||||
case 2: { pen.radius=paintbox->getRadius()*m.cm.bbox.Diag()*0.01*0.5; } break;
|
||||
case 3: { pen.radius=paintbox->getRadius()*m.cm.bbox.DimY()*0.01*0.5; } break;
|
||||
case 4: { pen.radius=paintbox->getRadius()*0.5; } break;
|
||||
}
|
||||
curSel.clear();
|
||||
@ -471,7 +471,7 @@ void EditPaintPlugin::DrawXORCircle(MeshModel &m,GLArea * gla, bool doubleDraw)
|
||||
|
||||
PEZ=64;
|
||||
int STEPS=30;
|
||||
float diag=m.cm().bbox.Diag()*(-7);
|
||||
float diag=m.cm.bbox.Diag()*(-7);
|
||||
QPoint circle_points[64]; //because of the .NET 2003 problem
|
||||
|
||||
glPushAttrib(GL_ENABLE_BIT);
|
||||
@ -589,7 +589,7 @@ void getInternFaces(MeshModel & m,vector<CMeshO::FacePointer> *actual,vector<Ver
|
||||
|
||||
if (actual->size()==0) {
|
||||
CMeshO::FaceIterator fi;
|
||||
for(fi=m.cm().face.begin();fi!=m.cm().face.end();++fi)
|
||||
for(fi=m.cm.face.begin();fi!=m.cm.face.end();++fi)
|
||||
if(!(*fi).IsD()) {
|
||||
temp_po.push_back((&*fi));
|
||||
}
|
||||
@ -794,13 +794,13 @@ void EditPaintPlugin::fillFrom(MeshModel & m,CFaceO * face) {
|
||||
|
||||
bool EditPaintPlugin::getFaceAtMouse(MeshModel &m,CMeshO::FacePointer& val) {
|
||||
QPoint mid=QPoint(cur.x(),inverse_y);
|
||||
return (GLPickTri<CMeshO>::PickNearestFace(mid.x(), mid.y(), m.cm(), val,2,2));
|
||||
return (GLPickTri<CMeshO>::PickNearestFace(mid.x(), mid.y(), m.cm, val,2,2));
|
||||
}
|
||||
|
||||
bool EditPaintPlugin::getFacesAtMouse(MeshModel &m,vector<CMeshO::FacePointer> & val) {
|
||||
val.clear();
|
||||
QPoint mid=QPoint(cur.x(),inverse_y);
|
||||
GLPickTri<CMeshO>::PickFace(mid.x(), mid.y(), m.cm(), val,2,2);
|
||||
GLPickTri<CMeshO>::PickFace(mid.x(), mid.y(), m.cm, val,2,2);
|
||||
return (val.size()>0);
|
||||
}
|
||||
|
||||
@ -828,7 +828,7 @@ bool EditPaintPlugin::getVertexesAtMouse() {
|
||||
|
||||
bool EditPaintPlugin::hasSelected(MeshModel &m) {
|
||||
CMeshO::FaceIterator fi;
|
||||
for(fi=m.cm().face.begin();fi!=m.cm().face.end();++fi) {
|
||||
for(fi=m.cm.face.begin();fi!=m.cm.face.end();++fi) {
|
||||
if (!(*fi).IsD() && (*fi).IsS()) return true;
|
||||
}
|
||||
return false;
|
||||
@ -859,7 +859,7 @@ void EditPaintPlugin::fillGradient(MeshModel & m,GLArea * gla) {
|
||||
UndoItem u;
|
||||
int gradient_type=paintbox->getGradientType();
|
||||
int gradient_form=paintbox->getGradientForm();
|
||||
for(fi=m.cm().face.begin();fi!=m.cm().face.end();++fi)
|
||||
for(fi=m.cm.face.begin();fi!=m.cm.face.end();++fi)
|
||||
if (!(*fi).IsD() && (tutti || (*fi).IsS()))
|
||||
for (int lauf=0; lauf<3; lauf++) {
|
||||
if (!temporaneo.contains((*fi).V(lauf))) {
|
||||
@ -977,7 +977,7 @@ void EditPaintPlugin::Decorate(QAction * ac, MeshModel &m, GLArea * gla) {
|
||||
vector<CMeshO::FacePointer> faceSel;
|
||||
|
||||
if (paintbox->searchMode()==2) curSel.clear();
|
||||
//if (GLPickTri<CMeshO>::PickNearestFace(mid.x(), mid.y(), m.cm(), tmp, pen.width.x(), pen.width.y()))
|
||||
//if (GLPickTri<CMeshO>::PickNearestFace(mid.x(), mid.y(), m.cm, tmp, pen.width.x(), pen.width.y()))
|
||||
getInternFaces(m,&curSel,&newSel,&faceSel,gla,pen,cur,prev,pixels,mvmatrix,projmatrix,viewport);
|
||||
|
||||
//UndoItem u;
|
||||
|
||||
@ -24,6 +24,11 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.15 2007/04/16 09:25:29 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.14 2007/03/20 16:23:08 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -643,7 +648,7 @@ bool EpochIO::open(const QString &formatName, QString &fileName, MeshModel &m, i
|
||||
}
|
||||
Grid.Add(mm);
|
||||
}
|
||||
else tri::Append<CMeshO,CMeshO>::Mesh(m.cm(),mm); // append mesh mr to ml
|
||||
else tri::Append<CMeshO,CMeshO>::Mesh(m.cm,mm); // append mesh mr to ml
|
||||
|
||||
int tt2=clock();
|
||||
if(logFP) fprintf(logFP,"** Mesh %i : Append in %i\n",selectedCount,tt2-tt1);
|
||||
@ -655,7 +660,7 @@ bool EpochIO::open(const QString &formatName, QString &fileName, MeshModel &m, i
|
||||
if (cb != NULL) (*cb)(90, "Final Processing: clustering");
|
||||
if(clustering)
|
||||
{
|
||||
Grid.Extract(m.cm());
|
||||
Grid.Extract(m.cm);
|
||||
}
|
||||
|
||||
int t1=clock();
|
||||
@ -664,26 +669,26 @@ bool EpochIO::open(const QString &formatName, QString &fileName, MeshModel &m, i
|
||||
if (cb != NULL) (*cb)(95, "Final Processing: Removing Small Connected Components");
|
||||
if(removeSmallCC)
|
||||
{
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm()); // updates bounding box
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm); // updates bounding box
|
||||
m.updateDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_BORDERFLAG | MeshModel::MM_FACEMARK);
|
||||
RemoveSmallConnectedComponentsDiameter<CMeshO>(m.cm(),m.cm().bbox.Diag()*maxCCDiagVal/100.0);
|
||||
RemoveSmallConnectedComponentsDiameter<CMeshO>(m.cm,m.cm.bbox.Diag()*maxCCDiagVal/100.0);
|
||||
}
|
||||
|
||||
int t2=clock();
|
||||
if(logFP) fprintf(logFP,"Topology and removed CC in %i\n",t2-t1);
|
||||
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm()); // updates bounding box
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm); // updates bounding box
|
||||
|
||||
if (cb != NULL) (*cb)(97, "Final Processing: Closing Holes");
|
||||
if(closeHole)
|
||||
{
|
||||
m.updateDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_BORDERFLAG | MeshModel::MM_FACEMARK);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
vcg::tri::Hole<CMeshO>::EarCuttingFill<vcg::tri::MinimumWeightEar< CMeshO> >(m.cm(),maxHoleSize,false);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
vcg::tri::Hole<CMeshO>::EarCuttingFill<vcg::tri::MinimumWeightEar< CMeshO> >(m.cm,maxHoleSize,false);
|
||||
}
|
||||
|
||||
if (cb != NULL) (*cb)(100, "Done");
|
||||
// vcg::tri::UpdateNormals<CMeshO>::PerVertex(m.cm()); // updates normals
|
||||
// vcg::tri::UpdateNormals<CMeshO>::PerVertex(m.cm); // updates normals
|
||||
|
||||
|
||||
int t3=clock();
|
||||
|
||||
@ -23,6 +23,11 @@
|
||||
/****************************************************************************
|
||||
History
|
||||
$Log$
|
||||
Revision 1.34 2007/04/16 09:25:29 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.33 2007/03/20 16:23:09 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -178,9 +183,9 @@ const QString ExtraMeshColorizePlugin::ST(FilterType c) {
|
||||
}
|
||||
return QString("error!");
|
||||
}
|
||||
const QString ExtraMeshColorizePlugin::Info(QAction *action)
|
||||
const QString ExtraMeshColorizePlugin::Info(FilterType filterId)
|
||||
{
|
||||
switch(ID(action))
|
||||
switch(filterId)
|
||||
{
|
||||
case CP_MAP_QUALITY_INTO_COLOR : return tr("Colorize vertex and faces depending on quality field (manually equalized).");
|
||||
case CP_GAUSSIAN : return tr("Colorize vertex and faces depending on equalized gaussian curvature.");
|
||||
@ -235,9 +240,9 @@ bool ExtraMeshColorizePlugin::getParameters(QAction *action, QWidget *parent, Me
|
||||
{
|
||||
case CP_MAP_QUALITY_INTO_COLOR :
|
||||
Histogramf H;
|
||||
tri::Stat<CMeshO>::ComputePerVertexQualityHistogram(m.cm(),H);
|
||||
tri::Stat<CMeshO>::ComputePerVertexQualityHistogram(m.cm,H);
|
||||
|
||||
Frange mmmq(tri::Stat<CMeshO>::ComputePerVertexQualityMinMax(m.cm()));
|
||||
Frange mmmq(tri::Stat<CMeshO>::ComputePerVertexQualityMinMax(m.cm));
|
||||
eqSettings.meshMinQ = mmmq.minV;
|
||||
eqSettings.meshMaxQ = mmmq.maxV;
|
||||
|
||||
@ -271,7 +276,7 @@ bool ExtraMeshColorizePlugin::applyFilter(QAction *filter, MeshModel &m, FilterP
|
||||
{
|
||||
float RangeMin = par.getFloat("RangeMin");
|
||||
float RangeMax = par.getFloat("RangeMax");
|
||||
tri::UpdateColor<CMeshO>::VertexQuality(m.cm(),RangeMin,RangeMax);
|
||||
tri::UpdateColor<CMeshO>::VertexQuality(m.cm,RangeMin,RangeMax);
|
||||
break;
|
||||
}
|
||||
case CP_GAUSSIAN:
|
||||
@ -279,7 +284,7 @@ bool ExtraMeshColorizePlugin::applyFilter(QAction *filter, MeshModel &m, FilterP
|
||||
case CP_RMS:
|
||||
case CP_ABSOLUTE:
|
||||
{
|
||||
Curvature<CMeshO> c(m.cm());
|
||||
Curvature<CMeshO> c(m.cm);
|
||||
switch (ID(filter)){
|
||||
case CP_GAUSSIAN: c.MapGaussianCurvatureIntoQuality(); break;
|
||||
case CP_MEAN: c.MapMeanCurvatureIntoQuality(); break;
|
||||
@ -288,16 +293,16 @@ bool ExtraMeshColorizePlugin::applyFilter(QAction *filter, MeshModel &m, FilterP
|
||||
}
|
||||
|
||||
Histogramf H;
|
||||
tri::Stat<CMeshO>::ComputePerVertexQualityHistogram(m.cm(),H);
|
||||
tri::UpdateColor<CMeshO>::VertexQuality(m.cm(),H.Percentile(0.1),H.Percentile(0.9));
|
||||
tri::Stat<CMeshO>::ComputePerVertexQualityHistogram(m.cm,H);
|
||||
tri::UpdateColor<CMeshO>::VertexQuality(m.cm,H.Percentile(0.1),H.Percentile(0.9));
|
||||
|
||||
break;
|
||||
}
|
||||
case CP_SELFINTERSECT:
|
||||
{
|
||||
vector<CFaceO *> IntersFace;
|
||||
tri::Clean<CMeshO>::SelfIntersections(m.cm(),IntersFace);
|
||||
tri::UpdateColor<CMeshO>::FaceConstant(m.cm(),Color4b::White);
|
||||
tri::Clean<CMeshO>::SelfIntersections(m.cm,IntersFace);
|
||||
tri::UpdateColor<CMeshO>::FaceConstant(m.cm,Color4b::White);
|
||||
vector<CFaceO *>::iterator fpi;
|
||||
for(fpi=IntersFace.begin();fpi!=IntersFace.end();++fpi)
|
||||
(*fpi)->C()=Color4b::Red;
|
||||
@ -306,19 +311,19 @@ bool ExtraMeshColorizePlugin::applyFilter(QAction *filter, MeshModel &m, FilterP
|
||||
}
|
||||
|
||||
case CP_BORDER:
|
||||
vcg::tri::UpdateColor<CMeshO>::VertexBorderFlag(m.cm());
|
||||
vcg::tri::UpdateColor<CMeshO>::VertexBorderFlag(m.cm);
|
||||
break;
|
||||
case CP_COLOR_NON_MANIFOLD_FACE:
|
||||
ColorManifoldFace<CMeshO>(m.cm());
|
||||
ColorManifoldFace<CMeshO>(m.cm);
|
||||
break;
|
||||
case CP_COLOR_NON_MANIFOLD_VERTEX:
|
||||
ColorManifoldVertex<CMeshO>(m.cm());
|
||||
ColorManifoldVertex<CMeshO>(m.cm);
|
||||
break;
|
||||
case CP_RESTORE_ORIGINAL:
|
||||
m.restoreVertexColor();
|
||||
break;
|
||||
case CP_SMOOTH:
|
||||
LaplacianSmoothColor(m.cm(),1);
|
||||
LaplacianSmoothColor(m.cm,1);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
||||
@ -23,6 +23,11 @@
|
||||
/****************************************************************************
|
||||
History
|
||||
$Log$
|
||||
Revision 1.23 2007/04/16 09:25:29 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.22 2006/12/05 15:37:27 cignoni
|
||||
Added rough version of non manifold vertex coloring
|
||||
|
||||
@ -96,7 +101,7 @@ public:
|
||||
~ExtraMeshColorizePlugin(){};
|
||||
|
||||
virtual const QString ST(FilterType filter);
|
||||
virtual const QString Info(QAction *);
|
||||
virtual const QString Info(FilterType filterId);
|
||||
virtual const PluginInfo &Info();
|
||||
virtual const FilterClass getClass(QAction *);
|
||||
virtual bool getParameters(QAction *, QWidget *, MeshModel &m, FilterParameter &par);
|
||||
|
||||
@ -23,6 +23,11 @@
|
||||
/****************************************************************************
|
||||
History
|
||||
$Log$
|
||||
Revision 1.41 2007/04/16 09:25:29 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.40 2007/03/20 16:23:09 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -140,7 +145,7 @@ void ExtraMeshDecoratePlugin::Decorate(QAction *a, MeshModel &m, RenderMode &/*r
|
||||
if(a->text() == ST(DP_SHOW_NORMALS))
|
||||
{
|
||||
glPushAttrib(GL_ENABLE_BIT );
|
||||
float LineLen = m.cm().bbox.Diag()/20.0;
|
||||
float LineLen = m.cm.bbox.Diag()/20.0;
|
||||
CMeshO::VertexIterator vi;
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
@ -148,7 +153,7 @@ void ExtraMeshDecoratePlugin::Decorate(QAction *a, MeshModel &m, RenderMode &/*r
|
||||
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBegin(GL_LINES);
|
||||
glColor4f(.4f,.4f,1.f,.6f);
|
||||
for(vi=m.cm().vert.begin();vi!=m.cm().vert.end();++vi)
|
||||
for(vi=m.cm.vert.begin();vi!=m.cm.vert.end();++vi)
|
||||
if(!(*vi).IsD())
|
||||
{
|
||||
glVertex((*vi).P());
|
||||
@ -180,7 +185,7 @@ void ExtraMeshDecoratePlugin::DrawQuotedBox(MeshModel &m,QGLWidget *gla,QFont qf
|
||||
glGetIntegerv(GL_VIEWPORT,vp);
|
||||
|
||||
// Mesh boundingBox
|
||||
Box3f b(m.cm().bbox);
|
||||
Box3f b(m.cm.bbox);
|
||||
glColor(Color4b::LightGray);
|
||||
glBoxWire(b);
|
||||
|
||||
@ -431,7 +436,7 @@ void ExtraMeshDecoratePlugin::DrawBBoxCorner(MeshModel &m)
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glLineWidth(1.0);
|
||||
glColor(Color4b::Cyan);
|
||||
Box3f b=m.cm().bbox;
|
||||
Box3f b=m.cm.bbox;
|
||||
Point3f mi=b.min;
|
||||
Point3f ma=b.max;
|
||||
Point3f d3=(b.max-b.min)/4.0;
|
||||
@ -476,7 +481,7 @@ void ExtraMeshDecoratePlugin::DrawBBoxCorner(MeshModel &m)
|
||||
|
||||
void ExtraMeshDecoratePlugin::DrawAxis(MeshModel &m,QGLWidget* gla,QFont qf)
|
||||
{
|
||||
float hw=m.cm().bbox.Diag()/2.0;
|
||||
float hw=m.cm.bbox.Diag()/2.0;
|
||||
glPushAttrib(GL_ENABLE_BIT | GL_LINE_BIT | GL_POINT_BIT | GL_CURRENT_BIT | GL_LIGHTING_BIT | GL_COLOR_BUFFER_BIT );
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
@ -23,6 +23,11 @@
|
||||
/****************************************************************************
|
||||
History
|
||||
$Log$
|
||||
Revision 1.10 2007/04/16 09:25:29 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.9 2007/03/20 16:23:09 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -101,7 +106,7 @@ const PluginInfo &ExtraMeshEditPlugin::Info()
|
||||
event->modifiers() == Qt::ShiftModifier )
|
||||
{
|
||||
CMeshO::FaceIterator fi;
|
||||
for(fi=m.cm().face.begin();fi!=m.cm().face.end();++fi)
|
||||
for(fi=m.cm.face.begin();fi!=m.cm.face.end();++fi)
|
||||
if(!(*fi).IsD() && (*fi).IsS())
|
||||
LastSel.push_back(&*fi);
|
||||
}
|
||||
@ -203,7 +208,7 @@ const PluginInfo &ExtraMeshEditPlugin::Info()
|
||||
if(wid.y()<0) wid.setY(-wid.y());
|
||||
|
||||
/* CMeshO::FaceIterator fi;
|
||||
for(fi=m.cm().face.begin(),fpi=NewSel.begin();fpi!=NewSel.end();++fi)
|
||||
for(fi=m.cm.face.begin(),fpi=NewSel.begin();fpi!=NewSel.end();++fi)
|
||||
if(!(*fi).IsD()) {
|
||||
if(&(*fi)!=*fpi) (*fpi)->ClearS();
|
||||
else {
|
||||
@ -212,18 +217,18 @@ const PluginInfo &ExtraMeshEditPlugin::Info()
|
||||
}
|
||||
}
|
||||
|
||||
for(;fi!=m.cm().face.end();++fi)
|
||||
for(;fi!=m.cm.face.end();++fi)
|
||||
if(!(*fi).IsD()) (*fi).ClearS();
|
||||
|
||||
*/
|
||||
|
||||
CMeshO::FaceIterator fi;
|
||||
for(fi=m.cm().face.begin();fi!=m.cm().face.end();++fi)
|
||||
for(fi=m.cm.face.begin();fi!=m.cm.face.end();++fi)
|
||||
if(!(*fi).IsD()) (*fi).ClearS();
|
||||
|
||||
GLPickTri<CMeshO>::PickFace(mid.x(), mid.y(), m.cm(), NewSel, wid.x(), wid.y());
|
||||
GLPickTri<CMeshO>::PickFace(mid.x(), mid.y(), m.cm, NewSel, wid.x(), wid.y());
|
||||
qDebug("Pickface: rect %i %i - %i %i",mid.x(),mid.y(),wid.x(),wid.y());
|
||||
qDebug("Pickface: Got %i on %i",NewSel.size(),m.cm().face.size());
|
||||
qDebug("Pickface: Got %i on %i",NewSel.size(),m.cm.face.size());
|
||||
|
||||
switch(selMode)
|
||||
{
|
||||
@ -250,7 +255,7 @@ void ExtraMeshEditPlugin::StartEdit(QAction * /*mode*/, MeshModel &m, GLArea *gl
|
||||
{
|
||||
LastSel.clear();
|
||||
CMeshO::FaceIterator fi;
|
||||
for(fi=m.cm().face.begin();fi!=m.cm().face.end();++fi)
|
||||
for(fi=m.cm.face.begin();fi!=m.cm.face.end();++fi)
|
||||
if(!(*fi).IsD() && (*fi).IsS() )
|
||||
LastSel.push_back(&*fi);
|
||||
|
||||
|
||||
@ -22,6 +22,11 @@
|
||||
/****************************************************************************
|
||||
History
|
||||
$Log$
|
||||
Revision 1.94 2007/04/16 09:25:29 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.93 2007/03/27 12:20:18 cignoni
|
||||
Revamped logging iterface, changed function names in automatic parameters, better selection handling
|
||||
|
||||
@ -227,11 +232,6 @@ ExtraMeshFilterPlugin::ExtraMeshFilterPlugin()
|
||||
|
||||
foreach(tt , types())
|
||||
actionList << new QAction(ST(tt), this);
|
||||
|
||||
//refineDialog = new RefineDialog();
|
||||
//refineDialog->hide();
|
||||
// decimatorDialog = new DecimatorDialog();
|
||||
// decimatorDialog->hide();
|
||||
|
||||
genericELD = new GenericELDialog();
|
||||
genericELD->hide();
|
||||
@ -311,9 +311,9 @@ ExtraMeshFilterPlugin::~ExtraMeshFilterPlugin() {
|
||||
}
|
||||
}
|
||||
|
||||
const QString ExtraMeshFilterPlugin::Info(QAction *action)
|
||||
const QString ExtraMeshFilterPlugin::Info(FilterType filterID)
|
||||
{
|
||||
switch(ID(action))
|
||||
switch(filterID)
|
||||
{
|
||||
case FP_LOOP_SS : return tr("Apply Loop's Subdivision Surface algorithm. It is an approximate method which subdivide each triangle in four faces. It works for every triangle and has rules for extraordinary vertices");
|
||||
case FP_BUTTERFLY_SS : return tr("Apply Butterfly Subdivision Surface algorithm. It is an interpolated method, defined on arbitrary triangular meshes. The scheme is known to be C1 but not C2 on regular meshes");
|
||||
@ -387,21 +387,21 @@ bool ExtraMeshFilterPlugin::getStdFields(QAction *action, MeshModel &m, StdParLi
|
||||
switch(ID(action))
|
||||
{
|
||||
case FP_QUADRIC_SIMPLIFICATION:
|
||||
parlst.addFieldInt ("TargetFaceNum","Target number of faces", (m.cm().sfn>0) ? m.cm().sfn/2 : m.cm().fn/2);
|
||||
parlst.addFieldInt ("TargetFaceNum","Target number of faces", (m.cm.sfn>0) ? m.cm.sfn/2 : m.cm.fn/2);
|
||||
parlst.addFieldFloat("QualityThr","Quality threshold",lastq_QualityThr,"Quality threshold for penalizing bad shaped faces.\nThe value is in the range [0..1]\n 0 accept any kind of face (no penalties),\n 0.5 penalize faces with quality < 0.5, proportionally to their shape\n");
|
||||
parlst.addFieldBool ("PreserveBoundary","Preserve Boundary of the mesh",lastq_PreserveBoundary,"The simplification process tries not to destroy mesh boundaries");
|
||||
parlst.addFieldBool ("PreserveNormal","Preserve Normal",lastq_PreserveNormal,"Try to avoid face flipping effects and try to preserve the original orientation of the surface");
|
||||
parlst.addFieldBool ("OptimalPlacement","Optimal position of simplified vertices",lastq_OptimalPlacement,"Each collapsed vertex is placed in the position minimizing the quadric error.\n It can fail (creating bad spikes) in case of very flat areas. \nIf disabled edges are collapsed onto one of the two original vertices. ");
|
||||
parlst.addFieldBool ("Selected","Simplify only selected faces",m.cm().sfn>0,"The simplification is applied only to the selected set of faces.\n Take care of the target number of faces!");
|
||||
parlst.addFieldBool ("Selected","Simplify only selected faces",m.cm.sfn>0,"The simplification is applied only to the selected set of faces.\n Take care of the target number of faces!");
|
||||
break;
|
||||
case FP_QUADRIC_TEXCOORD_SIMPLIFICATION:
|
||||
parlst.addFieldInt ("TargetFaceNum","Target number of faces",(int)(m.cm().fn/2));
|
||||
parlst.addFieldInt ("TargetFaceNum","Target number of faces",(int)(m.cm.fn/2));
|
||||
parlst.addFieldFloat("QualityThr","Quality threshold",lastqtex_QualityThr,"Quality threshold for penalizing bad shaped faces");
|
||||
parlst.addFieldFloat("Extratcoordw","Texture discontinuity extra weight",lastqtex_extratw,"Additional weight for each extra Texture Coordinates for every (selected) vertex");
|
||||
break;
|
||||
case FP_CLOSE_HOLES:
|
||||
parlst.addFieldInt ("MaxHoleSize","Max size to be closed ",(int)30,"The size is expressed as number of edges composing the hole boundary");
|
||||
parlst.addFieldBool("Selected","Close holes with selected faces",m.cm().sfn>0);
|
||||
parlst.addFieldBool("Selected","Close holes with selected faces",m.cm.sfn>0);
|
||||
parlst.addFieldBool("NewFaceSelected","Select the newly created faces",true);
|
||||
parlst.addFieldBool("SelfIntersection","Prevent creation of selfIntersecting faces",true);
|
||||
break;
|
||||
@ -410,15 +410,15 @@ bool ExtraMeshFilterPlugin::getStdFields(QAction *action, MeshModel &m, StdParLi
|
||||
case FP_MIDPOINT:
|
||||
case FP_REMOVE_FACES_BY_EDGE:
|
||||
case FP_CLUSTERING:
|
||||
maxVal = m.cm().bbox.Diag();
|
||||
maxVal = m.cm.bbox.Diag();
|
||||
parlst.addFieldAbsPerc("Threshold","Threshold",maxVal*0.01,0,maxVal);
|
||||
parlst.addFieldBool ("Selected","Affect only selected faces",m.cm().sfn>0);
|
||||
parlst.addFieldBool ("Selected","Affect only selected faces",m.cm.sfn>0);
|
||||
break;
|
||||
case FP_TWO_STEP_SMOOTH:
|
||||
parlst.addFieldInt ("stepSmoothNum","Smoothing steps", (int) 3, "");
|
||||
parlst.addFieldFloat("normalThr","Feature Angle Threshold (deg)", (float) 60, "Specify a threshold angle for features that you want to be preserved.\nFeatures forming angles LARGER than the specified threshold will be preserved.");
|
||||
parlst.addFieldInt ("stepNormalNum","Normal Smoothing steps", (int) 20, "");
|
||||
parlst.addFieldBool ("Selected","Affect only selected faces",m.cm().sfn>0);
|
||||
parlst.addFieldBool ("Selected","Affect only selected faces",m.cm.sfn>0);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -453,7 +453,7 @@ bool ExtraMeshFilterPlugin::getParameters(QAction *action, QWidget *parent, Mesh
|
||||
{
|
||||
case FP_TRANSFORM:
|
||||
{
|
||||
transformDialog->setMesh(&m.cm());
|
||||
transformDialog->setMesh(&m.cm);
|
||||
int continueValue = transformDialog->exec();
|
||||
if (continueValue == QDialog::Rejected)
|
||||
return false;
|
||||
@ -480,7 +480,7 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPar
|
||||
{
|
||||
if( getClass(filter)==Remeshing)
|
||||
{
|
||||
if ( ! vcg::tri::Clean<CMeshO>::IsTwoManifoldFace(m.cm()) ) {
|
||||
if ( ! vcg::tri::Clean<CMeshO>::IsTwoManifoldFace(m.cm) ) {
|
||||
QMessageBox::warning(0, QString("Can't continue"), QString("Mesh faces not 2 manifold")); // text
|
||||
return false; // can't continue, mesh can't be processed
|
||||
}
|
||||
@ -491,50 +491,50 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPar
|
||||
switch(ID(filter)) {
|
||||
case FP_LOOP_SS :
|
||||
RefineOddEvenE<CMeshO, OddPointLoop<CMeshO>, EvenPointLoop<CMeshO> >
|
||||
(m.cm(), OddPointLoop<CMeshO>(), EvenPointLoop<CMeshO>(), threshold, selected, cb);
|
||||
(m.cm, OddPointLoop<CMeshO>(), EvenPointLoop<CMeshO>(), threshold, selected, cb);
|
||||
break;
|
||||
case FP_BUTTERFLY_SS :
|
||||
Refine<CMeshO,MidPointButterfly<CMeshO> >
|
||||
(m.cm(), MidPointButterfly<CMeshO>(), threshold, selected, cb);
|
||||
(m.cm, MidPointButterfly<CMeshO>(), threshold, selected, cb);
|
||||
break;
|
||||
case FP_MIDPOINT :
|
||||
Refine<CMeshO,MidPoint<CMeshO> >
|
||||
(m.cm(), MidPoint<CMeshO>(), threshold, selected, cb);
|
||||
(m.cm, MidPoint<CMeshO>(), threshold, selected, cb);
|
||||
}
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
}
|
||||
if (ID(filter) == FP_REMOVE_FACES_BY_EDGE ) {
|
||||
bool selected = par.getBool("Selected");
|
||||
float threshold = par.getFloat("Threshold");
|
||||
if(selected) tri::Clean<CMeshO>::RemoveFaceOutOfRangeEdgeSel<true>(m.cm(),0,threshold );
|
||||
else tri::Clean<CMeshO>::RemoveFaceOutOfRangeEdgeSel<false>(m.cm(),0,threshold );
|
||||
if(selected) tri::Clean<CMeshO>::RemoveFaceOutOfRangeEdgeSel<true>(m.cm,0,threshold );
|
||||
else tri::Clean<CMeshO>::RemoveFaceOutOfRangeEdgeSel<false>(m.cm,0,threshold );
|
||||
m.clearDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_BORDERFLAG);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_REMOVE_FACES_BY_AREA) )
|
||||
{
|
||||
int nullFaces=tri::Clean<CMeshO>::RemoveFaceOutOfRangeArea(m.cm(),0);
|
||||
int nullFaces=tri::Clean<CMeshO>::RemoveFaceOutOfRangeArea(m.cm,0);
|
||||
Log(GLLogStream::Info, "Removed %d null faces", nullFaces);
|
||||
m.clearDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_BORDERFLAG);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_REMOVE_UNREFERENCED_VERTEX) )
|
||||
{
|
||||
int delvert=tri::Clean<CMeshO>::RemoveUnreferencedVertex(m.cm());
|
||||
int delvert=tri::Clean<CMeshO>::RemoveUnreferencedVertex(m.cm);
|
||||
Log(GLLogStream::Info, "Removed %d unreferenced vertices",delvert);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_REMOVE_DUPLICATED_VERTEX) )
|
||||
{
|
||||
int delvert=tri::Clean<CMeshO>::RemoveDuplicateVertex(m.cm());
|
||||
int delvert=tri::Clean<CMeshO>::RemoveDuplicateVertex(m.cm);
|
||||
Log(GLLogStream::Info, "Removed %d duplicated vertices", delvert);
|
||||
if (delvert != 0)
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_REMOVE_NON_MANIFOLD) )
|
||||
{
|
||||
int nonManif=tri::Clean<CMeshO>::RemoveNonManifoldFace(m.cm());
|
||||
int nonManif=tri::Clean<CMeshO>::RemoveNonManifoldFace(m.cm);
|
||||
|
||||
if(nonManif) Log(GLLogStream::Info, "Removed %d Non Manifold Faces", nonManif);
|
||||
else Log(GLLogStream::Info, "Mesh is two-manifold. Nothing done.", nonManif);
|
||||
@ -544,26 +544,26 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPar
|
||||
{
|
||||
bool oriented;
|
||||
bool orientable;
|
||||
tri::Clean<CMeshO>::IsOrientedMesh(m.cm(), oriented,orientable);
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
tri::Clean<CMeshO>::IsOrientedMesh(m.cm, oriented,orientable);
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_LAPLACIAN_SMOOTH))
|
||||
{
|
||||
tri::UpdateSelection<CMeshO>::ClearVertex(m.cm());
|
||||
size_t cnt=tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(m.cm());
|
||||
if(cnt>0) LaplacianSmooth(m.cm(),1,true);
|
||||
else LaplacianSmooth(m.cm(),1,false);
|
||||
Log(GLLogStream::Info, "Smoothed %d vertices", cnt>0 ? cnt : m.cm().vn);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
tri::UpdateSelection<CMeshO>::ClearVertex(m.cm);
|
||||
size_t cnt=tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(m.cm);
|
||||
if(cnt>0) LaplacianSmooth(m.cm,1,true);
|
||||
else LaplacianSmooth(m.cm,1,false);
|
||||
Log(GLLogStream::Info, "Smoothed %d vertices", cnt>0 ? cnt : m.cm.vn);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_HC_LAPLACIAN_SMOOTH))
|
||||
{
|
||||
size_t cnt=tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(m.cm());
|
||||
if(cnt>0) HCSmooth(m.cm(),1,true);
|
||||
else HCSmooth(m.cm(),1,false);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
size_t cnt=tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(m.cm);
|
||||
if(cnt>0) HCSmooth(m.cm,1,true);
|
||||
else HCSmooth(m.cm,1,false);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_TWO_STEP_SMOOTH))
|
||||
@ -573,10 +573,10 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPar
|
||||
float normalThr = cos(math::ToRad(par.getFloat("normalThr")));
|
||||
int stepNormalNum = par.getInt("stepNormalNum");
|
||||
|
||||
//size_t cnt=tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(m.cm());
|
||||
tri::UpdateNormals<CMeshO>::PerFaceNormalized(m.cm());
|
||||
PasoDobleSmoothFast(m.cm(), stepSmoothNum, normalThr, stepNormalNum);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
//size_t cnt=tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(m.cm);
|
||||
tri::UpdateNormals<CMeshO>::PerFaceNormalized(m.cm);
|
||||
PasoDobleSmoothFast(m.cm, stepSmoothNum, normalThr, stepNormalNum);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_CLUSTERING))
|
||||
@ -584,17 +584,17 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPar
|
||||
bool selected = par.getBool("Selected");
|
||||
float threshold = par.getFloat("Threshold");
|
||||
vcg::tri::Clustering<CMeshO, vcg::tri::AverageCell<CMeshO> > Grid;
|
||||
Grid.Init(m.cm().bbox,100000,threshold);
|
||||
Grid.Add(m.cm());
|
||||
Grid.Extract(m.cm());
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
Grid.Init(m.cm.bbox,100000,threshold);
|
||||
Grid.Add(m.cm);
|
||||
Grid.Extract(m.cm);
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
m.clearDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_BORDERFLAG);
|
||||
}
|
||||
|
||||
if (filter->text() == ST(FP_INVERT_FACES) )
|
||||
{
|
||||
tri::Clean<CMeshO>::FlipMesh(m.cm());
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
tri::Clean<CMeshO>::FlipMesh(m.cm);
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
m.clearDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_BORDERFLAG);
|
||||
}
|
||||
|
||||
@ -604,9 +604,9 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPar
|
||||
Log(GLLogStream::Info,
|
||||
transformDialog->getLog().toAscii().data());
|
||||
|
||||
vcg::tri::UpdatePosition<CMeshO>::Matrix(m.cm(), matrix);
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm());
|
||||
vcg::tri::UpdatePosition<CMeshO>::Matrix(m.cm, matrix);
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm);
|
||||
}
|
||||
|
||||
|
||||
@ -619,9 +619,9 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPar
|
||||
lastq_OptimalPlacement = par.getBool("OptimalPlacement");
|
||||
lastq_Selected = par.getBool("Selected");
|
||||
|
||||
QuadricSimplification(m.cm(),TargetFaceNum,lastq_QualityThr, lastq_PreserveBoundary,lastq_PreserveNormal, lastq_OptimalPlacement,lastq_Selected, cb);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
tri::UpdateBounding<CMeshO>::Box(m.cm());
|
||||
QuadricSimplification(m.cm,TargetFaceNum,lastq_QualityThr, lastq_PreserveBoundary,lastq_PreserveNormal, lastq_OptimalPlacement,lastq_Selected, cb);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
tri::UpdateBounding<CMeshO>::Box(m.cm);
|
||||
}
|
||||
|
||||
|
||||
@ -631,40 +631,40 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction *filter, MeshModel &m, FilterPar
|
||||
lastqtex_QualityThr = par.getFloat("QualityThr");
|
||||
lastqtex_extratw = par.getFloat("Extratcoordw");
|
||||
|
||||
QuadricTexSimplification(m.cm(),TargetFaceNum,lastqtex_QualityThr,lastqtex_extratw, cb);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm());
|
||||
tri::UpdateBounding<CMeshO>::Box(m.cm());
|
||||
QuadricTexSimplification(m.cm,TargetFaceNum,lastqtex_QualityThr,lastqtex_extratw, cb);
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
|
||||
tri::UpdateBounding<CMeshO>::Box(m.cm);
|
||||
}
|
||||
|
||||
if (filter->text() == ST(FP_NORMAL_EXTRAPOLATION) ) {
|
||||
NormalExtrapolation<vector<CVertexO> >::ExtrapolateNormals(m.cm().vert.begin(), m.cm().vert.end(), 10,-1,NormalExtrapolation<vector<CVertexO> >::IsCorrect, cb);
|
||||
NormalExtrapolation<vector<CVertexO> >::ExtrapolateNormals(m.cm.vert.begin(), m.cm.vert.end(), 10,-1,NormalExtrapolation<vector<CVertexO> >::IsCorrect, cb);
|
||||
}
|
||||
|
||||
if(filter->text() == ST(FP_CLOSE_HOLES))
|
||||
{
|
||||
size_t OriginalSize= m.cm().face.size();
|
||||
size_t OriginalSize= m.cm.face.size();
|
||||
int MaxHoleSize = par.getInt("MaxHoleSize");
|
||||
bool SelectedFlag = par.getBool("Selected");
|
||||
bool SelfIntersectionFlag = par.getBool("SelfIntersection");
|
||||
bool NewFaceSelectedFlag = par.getBool("NewFaceSelected");
|
||||
|
||||
if( SelfIntersectionFlag )
|
||||
tri::Hole<CMeshO>::EarCuttingIntersectionFill<tri::SelfIntersectionEar< CMeshO> >(m.cm(),MaxHoleSize,SelectedFlag);
|
||||
tri::Hole<CMeshO>::EarCuttingIntersectionFill<tri::SelfIntersectionEar< CMeshO> >(m.cm,MaxHoleSize,SelectedFlag);
|
||||
else
|
||||
tri::Hole<CMeshO>::EarCuttingFill<vcg::tri::MinimumWeightEar< CMeshO> >(m.cm(),MaxHoleSize,SelectedFlag,cb);
|
||||
tri::Hole<CMeshO>::EarCuttingFill<vcg::tri::MinimumWeightEar< CMeshO> >(m.cm,MaxHoleSize,SelectedFlag,cb);
|
||||
|
||||
assert(tri::Clean<CMeshO>::IsFFAdjacencyConsistent(m.cm()));
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalized(m.cm());
|
||||
assert(tri::Clean<CMeshO>::IsFFAdjacencyConsistent(m.cm));
|
||||
tri::UpdateNormals<CMeshO>::PerVertexNormalized(m.cm);
|
||||
|
||||
// hole filling filter does not correctly update the border flags (but the topology is still ok!)
|
||||
m.clearDataMask(MeshModel::MM_BORDERFLAG);
|
||||
if(NewFaceSelectedFlag)
|
||||
{
|
||||
tri::UpdateSelection<CMeshO>::ClearFace(m.cm());
|
||||
for(int i=OriginalSize;i<m.cm().face.size();++i)
|
||||
if(!m.cm().face[i].IsD()) m.cm().face[i].SetS();
|
||||
tri::UpdateSelection<CMeshO>::ClearFace(m.cm);
|
||||
for(int i=OriginalSize;i<m.cm.face.size();++i)
|
||||
if(!m.cm.face[i].IsD()) m.cm.face[i].SetS();
|
||||
}
|
||||
//tri::UpdateTopology<CMeshO>::FaceFace(m.cm());
|
||||
//tri::UpdateTopology<CMeshO>::FaceFace(m.cm);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -22,6 +22,11 @@
|
||||
****************************************************************************/
|
||||
/* History
|
||||
$Log$
|
||||
Revision 1.43 2007/04/16 09:25:29 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.42 2007/02/25 21:31:49 cignoni
|
||||
new parameters for quadric simplification
|
||||
|
||||
@ -114,7 +119,7 @@ class ExtraMeshFilterPlugin : public QObject, public MeshFilterInterface
|
||||
ExtraMeshFilterPlugin();
|
||||
~ExtraMeshFilterPlugin();
|
||||
virtual const QString ST(FilterType filter);
|
||||
virtual const QString Info(QAction *);
|
||||
virtual const QString Info(FilterType filter);
|
||||
virtual const PluginInfo &Info();
|
||||
virtual const FilterClass getClass(QAction *);
|
||||
virtual bool getParameters(QAction *, QWidget *, MeshModel &m, FilterParameter &par);
|
||||
|
||||
@ -24,6 +24,11 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.94 2007/04/16 09:25:30 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.93 2007/03/20 16:23:10 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -95,7 +100,7 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshM
|
||||
return false;
|
||||
m.Enable(oi.mask);
|
||||
|
||||
int result = vcg::tri::io::ImporterOBJ<CMeshO>::Open(m.cm(), filename.c_str(), oi);
|
||||
int result = vcg::tri::io::ImporterOBJ<CMeshO>::Open(m.cm, filename.c_str(), oi);
|
||||
if (result != vcg::tri::io::ImporterOBJ<CMeshO>::E_NOERROR)
|
||||
{
|
||||
if (result & vcg::tri::io::ImporterOBJ<CMeshO>::E_NON_CRITICAL_ERROR)
|
||||
@ -114,7 +119,7 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshM
|
||||
}
|
||||
else if (formatName.toUpper() == tr("PTX"))
|
||||
{
|
||||
int result = vcg::tri::io::ImporterPTX<CMeshO>::Open(m.cm(), filename.c_str(), mask, cb);
|
||||
int result = vcg::tri::io::ImporterPTX<CMeshO>::Open(m.cm, filename.c_str(), mask, cb);
|
||||
if (result == 1)
|
||||
{
|
||||
QMessageBox::warning(parent, tr("PTX Opening Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ImporterPTX<CMeshO>::ErrorMsg(result)));
|
||||
@ -127,15 +132,15 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshM
|
||||
}
|
||||
else if (formatName.toUpper() == tr("OFF"))
|
||||
{
|
||||
int result = vcg::tri::io::ImporterOFF<CMeshO>::Open(m.cm(), filename.c_str(), mask, cb);
|
||||
int result = vcg::tri::io::ImporterOFF<CMeshO>::Open(m.cm, filename.c_str(), mask, cb);
|
||||
if (result != 0) // OFFCodes enum is protected
|
||||
{
|
||||
QMessageBox::warning(parent, tr("OFF Opening Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ImporterOFF<CMeshO>::ErrorMsg(result)));
|
||||
return false;
|
||||
}
|
||||
|
||||
CMeshO::FaceIterator fi = m.cm().face.begin();
|
||||
for (; fi != m.cm().face.end(); ++fi)
|
||||
CMeshO::FaceIterator fi = m.cm.face.begin();
|
||||
for (; fi != m.cm.face.end(); ++fi)
|
||||
face::ComputeNormalizedNormal(*fi);
|
||||
}
|
||||
else if (formatName.toUpper() == tr("3DS"))
|
||||
@ -146,7 +151,7 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshM
|
||||
vcg::tri::io::Importer3DS<CMeshO>::LoadMask(filename.c_str(), file, info);
|
||||
m.Enable(info.mask);
|
||||
|
||||
int result = vcg::tri::io::Importer3DS<CMeshO>::Open(m.cm(), filename.c_str(), file, info);
|
||||
int result = vcg::tri::io::Importer3DS<CMeshO>::Open(m.cm, filename.c_str(), file, info);
|
||||
if (result != vcg::tri::io::Importer3DS<CMeshO>::E_NOERROR)
|
||||
{
|
||||
QMessageBox::warning(parent, tr("3DS Opening Error"), errorMsgFormat.arg(fileName, vcg::tri::io::Importer3DS<CMeshO>::ErrorMsg(result)));
|
||||
@ -162,13 +167,13 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshM
|
||||
// verify if texture files are present
|
||||
QString missingTextureFilesMsg = "The following texture files were not found:\n";
|
||||
bool someTextureNotFound = false;
|
||||
for ( unsigned textureIdx = 0; textureIdx < m.cm().textures.size(); ++textureIdx)
|
||||
for ( unsigned textureIdx = 0; textureIdx < m.cm.textures.size(); ++textureIdx)
|
||||
{
|
||||
FILE* pFile = fopen (m.cm().textures[textureIdx].c_str(), "r");
|
||||
FILE* pFile = fopen (m.cm.textures[textureIdx].c_str(), "r");
|
||||
if (pFile == NULL)
|
||||
{
|
||||
missingTextureFilesMsg.append("\n");
|
||||
missingTextureFilesMsg.append(m.cm().textures[textureIdx].c_str());
|
||||
missingTextureFilesMsg.append(m.cm.textures[textureIdx].c_str());
|
||||
someTextureNotFound = true;
|
||||
}
|
||||
else
|
||||
@ -177,9 +182,9 @@ bool ExtraMeshIOPlugin::open(const QString &formatName, QString &fileName, MeshM
|
||||
if (someTextureNotFound)
|
||||
QMessageBox::warning(parent, tr("Missing texture files"), missingTextureFilesMsg);
|
||||
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm()); // updates bounding box
|
||||
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm); // updates bounding box
|
||||
if (!normalsUpdated)
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertex(m.cm()); // updates normals
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertex(m.cm); // updates normals
|
||||
|
||||
if (cb != NULL) (*cb)(99, "Done");
|
||||
|
||||
@ -195,7 +200,7 @@ bool ExtraMeshIOPlugin::save(const QString &formatName,QString &fileName, MeshMo
|
||||
|
||||
if(formatName.toUpper() == tr("3DS"))
|
||||
{
|
||||
int result = vcg::tri::io::Exporter3DS<CMeshO>::Save(m.cm(),filename.c_str(),mask,cb);
|
||||
int result = vcg::tri::io::Exporter3DS<CMeshO>::Save(m.cm,filename.c_str(),mask,cb);
|
||||
if(result!=0)
|
||||
{
|
||||
QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::Exporter3DS<CMeshO>::ErrorMsg(result)));
|
||||
@ -205,7 +210,7 @@ bool ExtraMeshIOPlugin::save(const QString &formatName,QString &fileName, MeshMo
|
||||
}
|
||||
else if(formatName.toUpper() == tr("WRL"))
|
||||
{
|
||||
int result = vcg::tri::io::ExporterWRL<CMeshO>::Save(m.cm(),filename.c_str(),mask,cb);
|
||||
int result = vcg::tri::io::ExporterWRL<CMeshO>::Save(m.cm,filename.c_str(),mask,cb);
|
||||
if(result!=0)
|
||||
{
|
||||
QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::ExporterWRL<CMeshO>::ErrorMsg(result)));
|
||||
@ -215,7 +220,7 @@ bool ExtraMeshIOPlugin::save(const QString &formatName,QString &fileName, MeshMo
|
||||
}
|
||||
else if( formatName.toUpper() == tr("OFF") || formatName.toUpper() == tr("DXF") || formatName.toUpper() == tr("OBJ") )
|
||||
{
|
||||
int result = vcg::tri::io::Exporter<CMeshO>::Save(m.cm(),filename.c_str(),mask,cb);
|
||||
int result = vcg::tri::io::Exporter<CMeshO>::Save(m.cm,filename.c_str(),mask,cb);
|
||||
if(result!=0)
|
||||
{
|
||||
QMessageBox::warning(parent, tr("Saving Error"), errorMsgFormat.arg(fileName, vcg::tri::io::Exporter<CMeshO>::ErrorMsg(result)));
|
||||
|
||||
@ -23,6 +23,11 @@
|
||||
/****************************************************************************
|
||||
History
|
||||
$Log$
|
||||
Revision 1.11 2007/04/16 09:25:30 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.10 2007/03/20 16:23:10 cignoni
|
||||
Big small change in accessing mesh interface. First step toward layers
|
||||
|
||||
@ -116,24 +121,24 @@ bool SelectionFilterPlugin::applyFilter(QAction *action, MeshModel &m, FilterPar
|
||||
switch(ID(action))
|
||||
{
|
||||
case FP_SELECT_DELETE :
|
||||
for(fi=m.cm().face.begin();fi!=m.cm().face.end();++fi)
|
||||
for(fi=m.cm.face.begin();fi!=m.cm.face.end();++fi)
|
||||
if(!(*fi).IsD() && (*fi).IsS() )
|
||||
{
|
||||
(*fi).SetD();
|
||||
--m.cm().fn;
|
||||
--m.cm.fn;
|
||||
}
|
||||
m.clearDataMask(MeshModel::MM_FACETOPO | MeshModel::MM_BORDERFLAG);
|
||||
break;
|
||||
case FP_SELECT_ALL : tri::UpdateSelection<CMeshO>::AllFace(m.cm()); break;
|
||||
case FP_SELECT_NONE : tri::UpdateSelection<CMeshO>::ClearFace(m.cm()); break;
|
||||
case FP_SELECT_INVERT : tri::UpdateSelection<CMeshO>::InvertFace(m.cm()); break;
|
||||
case FP_SELECT_ERODE : tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(m.cm());
|
||||
tri::UpdateSelection<CMeshO>::FaceFromVertexStrict(m.cm());
|
||||
case FP_SELECT_ALL : tri::UpdateSelection<CMeshO>::AllFace(m.cm); break;
|
||||
case FP_SELECT_NONE : tri::UpdateSelection<CMeshO>::ClearFace(m.cm); break;
|
||||
case FP_SELECT_INVERT : tri::UpdateSelection<CMeshO>::InvertFace(m.cm); break;
|
||||
case FP_SELECT_ERODE : tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(m.cm);
|
||||
tri::UpdateSelection<CMeshO>::FaceFromVertexStrict(m.cm);
|
||||
break;
|
||||
case FP_SELECT_DILATE : tri::UpdateSelection<CMeshO>::VertexFromFaceLoose(m.cm());
|
||||
tri::UpdateSelection<CMeshO>::FaceFromVertexLoose(m.cm());
|
||||
case FP_SELECT_DILATE : tri::UpdateSelection<CMeshO>::VertexFromFaceLoose(m.cm);
|
||||
tri::UpdateSelection<CMeshO>::FaceFromVertexLoose(m.cm);
|
||||
break;
|
||||
case FP_SELECT_BORDER_FACES: tri::UpdateSelection<CMeshO>::FaceFromBorder(m.cm());
|
||||
case FP_SELECT_BORDER_FACES: tri::UpdateSelection<CMeshO>::FaceFromBorder(m.cm);
|
||||
break;
|
||||
|
||||
|
||||
@ -142,9 +147,9 @@ bool SelectionFilterPlugin::applyFilter(QAction *action, MeshModel &m, FilterPar
|
||||
return true;
|
||||
}
|
||||
|
||||
const QString SelectionFilterPlugin::Info(QAction *action)
|
||||
const QString SelectionFilterPlugin::Info(FilterType filterId)
|
||||
{
|
||||
switch(ID(action))
|
||||
switch(filterId)
|
||||
{
|
||||
case FP_SELECT_DILATE : return tr("Dilate (expand) the current set of selected faces");
|
||||
case FP_SELECT_ERODE : return tr("Erode (reduce) the current set of selected faces");
|
||||
|
||||
@ -22,6 +22,11 @@
|
||||
****************************************************************************/
|
||||
/* History
|
||||
$Log$
|
||||
Revision 1.6 2007/04/16 09:25:30 cignoni
|
||||
** big change **
|
||||
Added Layers managemnt.
|
||||
Interfaces are changing again...
|
||||
|
||||
Revision 1.5 2007/02/08 15:59:46 cignoni
|
||||
Added Border selection filters
|
||||
|
||||
@ -55,7 +60,7 @@ class SelectionFilterPlugin : public QObject, public MeshFilterInterface
|
||||
|
||||
SelectionFilterPlugin();
|
||||
~SelectionFilterPlugin();
|
||||
virtual const QString Info(QAction *);
|
||||
virtual const QString Info(FilterType filter);
|
||||
virtual const PluginInfo &Info();
|
||||
|
||||
virtual const QString ST(FilterType filter);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user