public MaterialsGUI(Material mat) { oneMaterial = (mat != null); InitializeComponent(); material = mat; IsotropicTypeProps isotropic; if (mat != null && mat.TypeProperties is IsotropicTypeProps) isotropic = (IsotropicTypeProps)mat.TypeProperties; else isotropic = MaterialManager.Instance.DefaultSteel.TypeProperties as IsotropicTypeProps; if (isotropic == null) isotropic = new IsotropicTypeProps(1.999E+11F, 0.3F, 0.0000117F); typeList.Add(isotropic); UniaxialTypeProps uniaxial; if (mat != null && mat.TypeProperties is UniaxialTypeProps) uniaxial = (UniaxialTypeProps)mat.TypeProperties; else uniaxial = MaterialManager.Instance.DefaultRebar.TypeProperties as UniaxialTypeProps; if (uniaxial == null) uniaxial = new UniaxialTypeProps(1.999E+11F, 0.0000117F); typeList.Add(uniaxial); designPropList.Add(new NoDesignProps()); designPropList.Add(new SteelDesignProps()); designPropList.Add(MaterialManager.Instance.DefaultConcrete.DesignProperties); //designPropList.Add(new AluminumDesignProps()); designPropList.Add(new RebarDesignProps()); //designPropList.Add(new ColdFormedDesignProps()); }
private void readMaterial(System.Xml.XmlNode node) { if (!"Material".Equals(node.Name)) return; string att; string name = Canguro.Model.Serializer.Deserializer.readAttribute(node, "Material", "MAT"); MaterialTypeProps tProps; float e = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "E", "0")); float u = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "U", "0")); float a = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "A", "0")); att = Canguro.Model.Serializer.Deserializer.readAttribute(node, "Type", "Isotropic"); switch (att) { case "Uniaxial": tProps = new UniaxialTypeProps(e, a); break; case "Isotropic": default: tProps = new IsotropicTypeProps(e, u, a); break; } string design = Canguro.Model.Serializer.Deserializer.readAttribute(node, "DesignType", "None"); MaterialDesignProps dProps; switch (design) { case "Rebar": dProps = new RebarDesignProps(); break; case "ColdFormed": dProps = new ColdFormedDesignProps(); break; case "Steel": dProps = new SteelDesignProps(); // Changes when readSteelDesignProps() is called. break; case "Concrete": dProps = new NoDesignProps(); // Changes when readConcreteDesignProps() is called. break; case "Aluminum": dProps = new AluminumDesignProps(); break; default: dProps = new NoDesignProps(); break; } float d = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "UnitMass", "d")); Material mat = new Material(name, false, dProps, tProps, d); Materials[name] = mat; }
private void readMaterial(System.Xml.XmlNode node) { if (!"Material".Equals(node.Name)) { return; } string att; string name = Canguro.Model.Serializer.Deserializer.readAttribute(node, "Material", "MAT"); MaterialTypeProps tProps; float e = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "E", "0")); float u = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "U", "0")); float a = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "A", "0")); att = Canguro.Model.Serializer.Deserializer.readAttribute(node, "Type", "Isotropic"); switch (att) { case "Uniaxial": tProps = new UniaxialTypeProps(e, a); break; case "Isotropic": default: tProps = new IsotropicTypeProps(e, u, a); break; } string design = Canguro.Model.Serializer.Deserializer.readAttribute(node, "DesignType", "None"); MaterialDesignProps dProps; switch (design) { case "Rebar": dProps = new RebarDesignProps(); break; case "ColdFormed": dProps = new ColdFormedDesignProps(); break; case "Steel": dProps = new SteelDesignProps(); // Changes when readSteelDesignProps() is called. break; case "Concrete": dProps = new NoDesignProps(); // Changes when readConcreteDesignProps() is called. break; case "Aluminum": dProps = new AluminumDesignProps(); break; default: dProps = new NoDesignProps(); break; } float d = float.Parse(Canguro.Model.Serializer.Deserializer.readAttribute(node, "UnitMass", "d")); Material mat = new Material(name, false, dProps, tProps, d); Materials[name] = mat; }