本文整理汇总了C++中PatchData::type方法的典型用法代码示例。如果您正苦于以下问题:C++ PatchData::type方法的具体用法?C++ PatchData::type怎么用?C++ PatchData::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PatchData
的用法示例。
在下文中一共展示了PatchData::type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
// Currently, the only thing supported is updating each vertices
// coordinates and flags. Connectivity changes aren't supported yet.
void Mesquite::MeshSet::update_mesh(const PatchData &pd, MsqError &err)
{
MSQ_FUNCTION_TIMER( "MeshSet::update_mesh" );
if (pd.num_nodes() == 0)
return;
size_t i;
switch (pd.type())
{
// If the patch type is marked as local,
// all handles belong to the currentMesh.
case PatchData::ELEMENTS_ON_VERTEX_PATCH:
// For each vertex, update the coordinates
// and the "mesquite byte".
for (i = 0; i < pd.num_nodes(); i++)
{
if(!pd.vertexArray[i].is_flag_set( MsqVertex::MSQ_HARD_FIXED))
{
(*currentMesh)->vertex_set_coordinates(pd.vertexHandlesArray[i],
pd.vertexArray[i],
err); MSQ_ERRRTN(err);
}
(*currentMesh)->vertex_set_byte(pd.vertexHandlesArray[i],
pd.vertexArray[i].vertexBitFlags,
err); MSQ_ERRRTN(err);
}
break;
// If the patch type is marked as global,
// the handles may belong to more than
// one Mesh.
case PatchData::GLOBAL_PATCH:
{
list<Mesquite::Mesh*>::iterator mesh_itr = meshSet.begin();
assert( mesh_itr != meshSet.end() );
Mesquite::Mesh* cur_mesh = *mesh_itr;
Mesquite::VertexIterator *vert_itr = cur_mesh->vertex_iterator(err);
MSQ_ERRRTN(err);
for (i = 0; i < pd.num_nodes(); i++)
{
if (vert_itr->is_at_end())
{
mesh_itr++;
if ( mesh_itr==meshSet.end() )
return;
cur_mesh = *mesh_itr;
delete vert_itr;
vert_itr = cur_mesh->vertex_iterator(err); MSQ_ERRRTN(err);
}
if(!pd.vertexArray[i].is_flag_set( MsqVertex::MSQ_HARD_FIXED))
{
cur_mesh->vertex_set_coordinates(pd.vertexHandlesArray[i],
pd.vertexArray[i],
err); MSQ_ERRRTN(err);
}
cur_mesh->vertex_set_byte(pd.vertexHandlesArray[i],
pd.vertexArray[i].vertexBitFlags,
err); MSQ_ERRRTN(err);
}
delete vert_itr;
}
break;
default:
{
MSQ_SETERR(err)("PatchData Type not accepted yet.", MsqError::NOT_IMPLEMENTED);
break;
}
}
}