Two cents on the basic types inside MeshLab, whose declaration are in meshmodel.h:
- the basic document type is a MeshDocument that is basically a list of MeshModel.
- each MeshModel corresponds to one layer and contains a vcg mesh of type CMeshO
- CMeshO is the vcg mesh type (a vcg::trimesh ) that you should provide to the various vcg Algorithms and from which you should get FaceIterators, VertexIterators and others types...
So for example when you open a file, a new MeshDocument is created, with a single layer that contains the loaded mesh. Some filters can create or destroy layers, for example the sampling filters usually create a new layer containing the sampled point clouds. Filters can work or on a single layer or on all the layers.
It is very important that filters keep coherent and updated the set of elements that are currently active for a given mesh, like for example colors, curvature, adjacency etc.