Ejemplo n.º 1
0
        public static SymmetryBuilder CreateFromSymmetryName(string symmetryName, IEnumerable <string> unitIds)
        {
            SymmetryBuilder instance = CreateFromSymmetryName(symmetryName);

            instance.EnabledUnits = unitIds.ToArray();
            return(instance);
        }
Ejemplo n.º 2
0
        public virtual void DeepCopyPopulateFields(IDeepCloneObjectGraph graph, object clone)
        {
            SymmetryBuilder builder = (SymmetryBuilder)clone;

            builder._unitIdToSubunitNames             = _unitIdToSubunitNames;
            builder._unitIdToSubunitCoordinateSystems = _unitIdToSubunitCoordinateSystems;
            builder.EnabledUnits = EnabledUnits == null? null : (string[])EnabledUnits.Clone();
        }
Ejemplo n.º 3
0
        public static SymmetryBuilder Clone(SymmetryBuilder template)
        {
            Type symmetryType             = template.GetType();
            SymmetryDescriptor descriptor = _knownSymmetriesByType[symmetryType];
            SymmetryBuilder    builder    = CreateFromSymmetryName(descriptor.Architecture);

            builder.EnabledUnits = template.EnabledUnits == null? null : (string[])template.EnabledUnits.Clone();
            return(builder);
        }
Ejemplo n.º 4
0
        public static SymmetryBuilder CreateFromSymmetryName(string symmetryName)
        {
            if (!_knownSymmetriesByName.ContainsKey(symmetryName))
            {
                throw new ArgumentException(String.Format("Unknown symmetry requested: {0}", symmetryName));
            }

            SymmetryBuilder instance = (SymmetryBuilder)Activator.CreateInstance(_knownSymmetriesByName[symmetryName].Type);

            return(instance);
        }
Ejemplo n.º 5
0
        public static SymmetryBuilder CreateFromSymmetryName(string symmetryName, string unitId)
        {
            SymmetryBuilder instance = CreateFromSymmetryName(symmetryName, new string[] { unitId });

            return(instance);
        }