本文整理汇总了C++中ON_SimpleArray::MemSet方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_SimpleArray::MemSet方法的具体用法?C++ ON_SimpleArray::MemSet怎么用?C++ ON_SimpleArray::MemSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_SimpleArray
的用法示例。
在下文中一共展示了ON_SimpleArray::MemSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetConnectedComponents
int ON_Mesh::GetConnectedComponents( bool bUseVertexConnections,
bool bTopologicalConnections,
ON_SimpleArray<int>& facet_component_labels
) const
{
int i, facecount = m_F.Count(), meshidx = 0;
//This array will act as an associative array to m_F since ON_MeshFace do not have something
//like m_trim_user_i on a ON_BrepTrim. It will have the indice of the final mesh the face
//belongs to.
if (facecount != facet_component_labels.Count())
{
facet_component_labels.Reserve(facecount);
facet_component_labels.SetCount(facecount);
}
//initialize to 0
facet_component_labels.MemSet(0);
ON_SimpleArray<int> DupFaceArray(facecount);
DupFaceArray.SetCount(facecount);
const ON_MeshTopology& Top = Topology();
if (!Top.IsValid())
return 0;
ON_SimpleArray<int> FacesToCheck;
FacesToCheck.Reserve(64);
i = 0;
while (i < facecount)
{
meshidx++;
FacesToCheck.Append(i);
while(0 != FacesToCheck.Count())
{
//Figure out which faces are connected to each other
FindAdjacentFaces(Top, FacesToCheck, facet_component_labels, DupFaceArray, bUseVertexConnections, bTopologicalConnections);
int j;
for (j=0;j<FacesToCheck.Count();j++)
facet_component_labels[FacesToCheck[j]] = meshidx;
}
for(;i<facecount;i++)
{
if (0 == facet_component_labels[i])
break;
}
}
return meshidx;
}