本文整理汇总了C++中MeshDocument::updateRenderStateMeshes方法的典型用法代码示例。如果您正苦于以下问题:C++ MeshDocument::updateRenderStateMeshes方法的具体用法?C++ MeshDocument::updateRenderStateMeshes怎么用?C++ MeshDocument::updateRenderStateMeshes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshDocument
的用法示例。
在下文中一共展示了MeshDocument::updateRenderStateMeshes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyFilter
bool SampleXMLFilterPlugin::applyFilter( const QString& filterName,MeshDocument& md,EnvWrap& env, vcg::CallBackPos* cb)
{
if (filterName == "Random vertex displacement")
{
MeshModel &m=*md.mm();
srand(time(NULL));
const float max_displacement =env.evalFloat("Displacement");
for(unsigned int i = 0; i< m.cm.vert.size(); i++)
{
// Typical usage of the callback for showing a nice progress bar in the bottom.
// // First parameter is a 0..100 number indicating percentage of completion, the second is an info string.
cb(100*i/m.cm.vert.size(), "Randomly Displacing...");
float rndax = (float(2.0f*rand())/RAND_MAX - 1.0f ) *max_displacement;
float rnday = (float(2.0f*rand())/RAND_MAX - 1.0f ) *max_displacement;
float rndaz = (float(2.0f*rand())/RAND_MAX - 1.0f ) *max_displacement;
m.cm.vert[i].P() += vcg::Point3f(rndax,rnday,rndaz);
//if ( i % 1000 == 0)
QList<int> meshlist;
meshlist << m.id();
md.updateRenderStateMeshes(meshlist,int(MeshModel::MM_VERTCOORD));
if (intteruptreq)
return true;
}
//// Log function dump textual info in the lower part of the MeshLab screen.
Log("Successfully displaced %i vertices",m.cm.vn);
//// to access to the parameters of the filter dialog simply use the getXXXX function of the FilterParameter Class
if(env.evalBool("UpdateNormals"))
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFace(m.cm);
vcg::tri::UpdateBounding<CMeshO>::Box(m.cm);
return true;
}
return false;
}