unsigned int OEMakeConnectedSurfaceCliques(OESurface &surf)

Assigns a different clique value, starting at 1, to each connected component of the surface. The number of connected components is returned. Listing 2 demonstrates cropping a surface to its largest component.

Listing 2: Extracting the largest portion of the surface

unsigned int nclqs = OEMakeConnectedSurfaceCliques(surf);

unsigned int maxclq = 0;
float maxarea=0.0f;
for (unsigned int i=1; i <= nclqs; i++)
  float area = OESurfaceCliqueArea(surf, i);
  if (maxarea < area)
    maxarea = area;
    maxclq = i;
OESurfaceCropToClique(surf, maxclq);