예제 #1
0
            public static Mutable DeepCopy(Mutable ptype)
            {
                Mutable copy = null;

                if (ptype is Ptype.Hierarchical.HierarchicalMutable)
                {
                    Ptype.Hierarchical.HierarchicalMutable hp = (Ptype.Hierarchical.HierarchicalMutable)ptype;
                    copy = new Ptype.Hierarchical.HierarchicalMutable();
                    Ptype.Hierarchical.HierarchicalMutable hpcopy = (Ptype.Hierarchical.HierarchicalMutable)copy;
                    hpcopy.children.AddRange(hp.children);
                    hpcopy.childrenNames.AddRange(hp.childrenNames);
                }

                else
                {
                    copy = new Mutable();
                }

                copy.Regions  = (Dictionary <String, Region>)ptype.Regions;
                copy.Features = (Dictionary <String, Bitmap>)ptype.Features;
                copy.Model    = ptype.Model;
                copy.Id       = ptype.Id;

                return(copy);
            }
예제 #2
0
			public static Mutable DeepCopy(Mutable ptype)
			{
				Mutable copy = null;
				if (ptype is Ptype.Hierarchical.HierarchicalMutable)
				{
					Ptype.Hierarchical.HierarchicalMutable hp = (Ptype.Hierarchical.HierarchicalMutable) ptype;
					copy = new Ptype.Hierarchical.HierarchicalMutable();
					Ptype.Hierarchical.HierarchicalMutable hpcopy = (Ptype.Hierarchical.HierarchicalMutable)copy;
					hpcopy.children.AddRange(hp.children);
					hpcopy.childrenNames.AddRange(hp.childrenNames);
				}

				else
				{
					copy = new Mutable();
				}

				copy.Regions = (Dictionary<String,Region>)ptype.Regions;
				copy.Features = (Dictionary<String,Bitmap>)ptype.Features;
				copy.Model = ptype.Model;
				copy.Id = ptype.Id;

				return copy;
			}