public IndexedViewableAlpha GetSelection(Vec3f[] match, bool applymodifiers)
        {
            SnapshotModel modeledit = GetEditModel();

            if (modeledit != null)
            {
                return(modeledit.GetSelection(match, applymodifiers));
            }

            IndexedViewableAlpha viewable = null;

            foreach (SnapshotModel model in Models)
            {
                if (!model.objselected || !model.objvisible)
                {
                    continue;
                }
                IndexedViewableAlpha nview = model.GetSelection(match, applymodifiers, true);
                viewable = IndexedViewableAlpha.Attach(viewable, nview);
            }
            return(viewable);

            /*IndexedViewableAlpha viewable = null;
             *          foreach( SnapshotModel model in Models )
             *          {
             *                  IndexedViewableAlpha viewadd = model.GetSelection( match, applymodifiers );
             *                  viewable = IndexedViewableAlpha.CombineFat( viewable, viewadd );
             *          }
             *          return viewable;*/
        }
        public IndexedViewableAlpha GetViewablesAttached(Vec3f[] match, bool applymods)
        {
            IndexedViewableAlpha viewable = null;

            foreach (SnapshotModel model in Models)
            {
                viewable = IndexedViewableAlpha.Attach(viewable, model.GetViewable(match, applymods));
            }
            return(viewable);
        }
        public static IndexedViewableAlpha MeshDiffAttach(SnapshotScene snapshot0, SnapshotScene snapshot1, Vec3f[] verts, bool applymods)
        {
            SnapshotModel[] models0 = snapshot0.Models;
            SnapshotModel[] models1 = snapshot1.Models;

            IndexedViewableAlpha viewable = null;

            int i;
            int c = models1.Length;

            foreach (SnapshotModel model0 in models0)
            {
                int uid = model0.objuid;
                for (i = 0; i < c; i++)
                {
                    if (models1[i].objuid == uid)
                    {
                        break;
                    }
                }
                if (i == c)
                {
                    //viewable += model0.GetViewable( verts, applymods );
                    viewable = IndexedViewableAlpha.Attach(viewable, model0.GetViewable(verts, applymods));
                    continue;
                }
                SnapshotModel model1 = models1[i];

                if (model0.GetEditCount() == model1.GetEditCount())
                {
                    continue;
                }
                IndexedViewableAlpha diff = SnapshotModel.MeshDiff(model0, model1, verts, applymods);
                //viewable += diff;
                viewable = IndexedViewableAlpha.Attach(viewable, diff);
            }

            return(viewable);
        }