mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 03:16:10 +00:00
Added Filter to colorize faces according to connected components decomposition
This commit is contained in:
parent
0ff5c8a627
commit
fe9b5ec7e4
@ -48,7 +48,8 @@ ExtraMeshColorizePlugin::ExtraMeshColorizePlugin() {
|
||||
CP_VERTEX_TO_FACE <<
|
||||
CP_FACE_TO_VERTEX <<
|
||||
CP_TEXTURE_TO_VERTEX <<
|
||||
CP_RANDOM_FACE;
|
||||
CP_RANDOM_FACE <<
|
||||
CP_RANDOM_CONNECTED_COMPONENT;
|
||||
|
||||
FilterIDType tt;
|
||||
foreach(tt , types())
|
||||
@ -70,6 +71,7 @@ QString ExtraMeshColorizePlugin::filterName(FilterIDType c) const{
|
||||
case CP_FACE_TO_VERTEX: return QString("Transfer Color: Face to Vertex");
|
||||
case CP_TEXTURE_TO_VERTEX: return QString("Transfer Color: Texture to Vertex");
|
||||
case CP_RANDOM_FACE: return QString("Random Face Color");
|
||||
case CP_RANDOM_CONNECTED_COMPONENT:return QString("Random Component Color ");
|
||||
default: assert(0);
|
||||
}
|
||||
return QString("error!");
|
||||
@ -94,7 +96,8 @@ QString ExtraMeshColorizePlugin::filterInfo(FilterIDType filterId) const {
|
||||
case CP_FACE_TO_VERTEX: return QString("Face to Vertex color transfer");
|
||||
case CP_TEXTURE_TO_VERTEX: return QString("Texture to Vertex color transfer");
|
||||
case CP_COLOR_NON_TOPO_COHERENT : return QString("Color edges topologically non coherent.");
|
||||
case CP_RANDOM_FACE: return QString("Colorize Faces randomly. If internal edges are present they are used");
|
||||
case CP_RANDOM_FACE: return QString("Colorize Faces randomly. If internal edges are present they are used. Useful for quads.");
|
||||
case CP_RANDOM_CONNECTED_COMPONENT: return QString("Colorize each connected component randomly.");
|
||||
default: assert(0); return QString("");
|
||||
}
|
||||
}
|
||||
@ -106,6 +109,7 @@ int ExtraMeshColorizePlugin::getRequirements(QAction *action){
|
||||
case CP_TRIANGLE_QUALITY: return MeshModel::MM_FACECOLOR | MeshModel::MM_FACEQUALITY;
|
||||
case CP_SATURATE_QUALITY: return MeshModel::MM_VERTFACETOPO;
|
||||
case CP_RANDOM_FACE: return MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACECOLOR;
|
||||
case CP_RANDOM_CONNECTED_COMPONENT:return MeshModel::MM_FACEFACETOPO | MeshModel::MM_FACECOLOR;
|
||||
case CP_CLAMP_QUALITY: return 0; // TODO: split clamp on vertex & faces and add requirements
|
||||
case CP_MAP_VQUALITY_INTO_COLOR: return MeshModel::MM_VERTCOLOR;
|
||||
case CP_MAP_FQUALITY_INTO_COLOR: return MeshModel::MM_FACECOLOR;
|
||||
@ -300,7 +304,13 @@ break;
|
||||
}
|
||||
|
||||
|
||||
case CP_RANDOM_FACE:
|
||||
case CP_RANDOM_CONNECTED_COMPONENT:
|
||||
m.updateDataMask(MeshModel::MM_FACEFACETOPO);
|
||||
m.updateDataMask(MeshModel::MM_FACEMARK);
|
||||
vcg::tri::UpdateColor<CMeshO>::FaceRandomConnectedComponent(m.cm);
|
||||
break;
|
||||
|
||||
case CP_RANDOM_FACE:
|
||||
vcg::tri::UpdateColor<CMeshO>::MultiFaceRandom(m.cm);
|
||||
break;
|
||||
|
||||
@ -362,6 +372,7 @@ MeshFilterInterface::FilterClass ExtraMeshColorizePlugin::getClass(QAction *a){
|
||||
return FilterClass(Quality + FaceColoring);
|
||||
|
||||
case CP_RANDOM_FACE:
|
||||
case CP_RANDOM_CONNECTED_COMPONENT:
|
||||
case CP_FACE_SMOOTH:
|
||||
case CP_VERTEX_TO_FACE:
|
||||
case CP_MAP_FQUALITY_INTO_COLOR:
|
||||
@ -377,6 +388,7 @@ int ExtraMeshColorizePlugin::getPreConditions(QAction *a) const{
|
||||
switch(ID(a)){
|
||||
case CP_TRIANGLE_QUALITY:
|
||||
case CP_RANDOM_FACE:
|
||||
case CP_RANDOM_CONNECTED_COMPONENT:
|
||||
case CP_DISCRETE_CURVATURE:
|
||||
case CP_COLOR_NON_TOPO_COHERENT:
|
||||
return MeshModel::MM_FACENUMBER;
|
||||
@ -404,6 +416,7 @@ int ExtraMeshColorizePlugin::postCondition( QAction* a ) const{
|
||||
case CP_TRIANGLE_QUALITY:
|
||||
return MeshModel::MM_FACECOLOR | MeshModel::MM_FACEQUALITY;
|
||||
case CP_RANDOM_FACE:
|
||||
case CP_RANDOM_CONNECTED_COMPONENT:
|
||||
case CP_COLOR_NON_TOPO_COHERENT:
|
||||
case CP_FACE_SMOOTH:
|
||||
case CP_VERTEX_TO_FACE:
|
||||
|
||||
@ -20,58 +20,6 @@
|
||||
* for more details. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/****************************************************************************
|
||||
History
|
||||
$Log$
|
||||
Revision 1.29 2008/04/07 10:33:56 cignoni
|
||||
added texture border colorization filter
|
||||
|
||||
Revision 1.28 2008/02/12 14:20:33 cignoni
|
||||
changed the function getParameter into the more meaningful getCustomParameter
|
||||
|
||||
Revision 1.27 2008/01/11 13:58:21 cignoni
|
||||
added selection of self-intersecting faces.
|
||||
|
||||
Revision 1.26 2007/11/20 18:26:52 ponchio
|
||||
Added triangle quality with possibiliti to cohose metric.
|
||||
|
||||
Revision 1.25 2007/11/19 17:08:54 ponchio
|
||||
Added triangle quality.
|
||||
|
||||
Revision 1.24 2007/10/02 08:13:53 cignoni
|
||||
New filter interface. Hopefully more clean and easy to use.
|
||||
|
||||
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
|
||||
|
||||
Revision 1.21 2006/11/29 00:59:17 cignoni
|
||||
Cleaned plugins interface; changed useless help class into a plain string
|
||||
|
||||
Revision 1.20 2006/11/07 09:10:32 cignoni
|
||||
Removed shorthHelp and added topo_non_coherent (draft)
|
||||
|
||||
Revision 1.19 2006/05/25 04:57:45 cignoni
|
||||
Major 0.7 release. A lot of things changed. Colorize interface gone away, Editing and selection start to work.
|
||||
Optional data really working. Clustering decimation totally rewrote. History start to work. Filters organized in classes.
|
||||
|
||||
Revision 1.18 2006/02/01 16:23:09 vannini
|
||||
Added "smooth color" filter
|
||||
|
||||
Revision 1.17 2006/01/29 18:59:12 mariolatronico
|
||||
changed #include "equalizerdialog.h" -> equalizerDialog.h
|
||||
|
||||
Revision 1.16 2006/01/27 18:27:53 vannini
|
||||
code refactoring for curvature colorize
|
||||
added colorize equalizer dialog and
|
||||
"Colorize by Quality" filter
|
||||
some small bugfixes
|
||||
removed color_curvature.h in favour of curvature.h
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef EXTRACOLORIZEPLUGIN_H
|
||||
#define EXTRACOLORIZEPLUGIN_H
|
||||
@ -108,7 +56,8 @@ public:
|
||||
CP_TEXTURE_TO_VERTEX,
|
||||
CP_VERTEX_TO_FACE,
|
||||
CP_COLOR_NON_TOPO_COHERENT,
|
||||
CP_RANDOM_FACE
|
||||
CP_RANDOM_FACE,
|
||||
CP_RANDOM_CONNECTED_COMPONENT
|
||||
};
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user