protected override bool Read(Rhino.FileIO.BinaryArchiveReader archive)
        {
            Rhino.Collections.ArchivableDictionary dict = archive.ReadDictionary();
            Beam ownerBeam = ProjectPlugIn.Instance.Beams.Find(o => o.Id == dict.GetInteger("BeamId"));

            BaseBrep = (Brep)dict["baseBrep"];

            int noBaseCurves = dict.GetInteger("NoBaseCurves");

            for (int i = 0; i < noBaseCurves; i++)
            {
                BaseCurves.Add((Curve)dict["BaseCurve" + i]);
            }


            Id = (int)dict["Id"];
            if ((string)dict["Material"] == "Concrete")
            {
                Material = new ConcreteMaterial((string)dict["MaterialStrength"], ownerBeam);
            }
            else if ((string)dict["Material"] == "Steel")
            {
                Material = new SteelMaterial((string)dict["MaterialName"], SteelType.StructuralSteel, ownerBeam);
            }
            //TODO Add extra materials
            else
            {
                Material = new ConcreteMaterial("C30/37", ownerBeam);
            }

            return(true);
        }
예제 #2
0
        protected override bool Read(Rhino.FileIO.BinaryArchiveReader archive)
        {
            Rhino.Collections.ArchivableDictionary dict = archive.ReadDictionary();
            object ho = base.ReadHotLoadData(dict);

            if (dict.ContainsKey("alpha"))
            {
                alpha = (int)dict["alpha"];
            }
            if (dict.ContainsKey("beta"))
            {
                beta = (double)dict["beta"];
            }
            if (dict.ContainsKey("classA"))
            {
                classA = JsonConvert.DeserializeObject <TestClassA>(dict.GetString("classA"));
            }
            if (dict.ContainsKey("classB"))
            {
                classB = JsonConvert.DeserializeObject <TestClassB>(dict.GetString("classB"));
            }
            if (dict.ContainsKey("classC"))
            {
                classC = JsonConvert.DeserializeObject <TestClassC>(dict.GetString("classC"));
            }
            //if (dict.ContainsKey("classD")) classD = JsonConvert.DeserializeObject<TestClassD>(dict.GetString("classD"));
            if (dict.ContainsKey("classE"))
            {
                classE = JsonConvert.DeserializeObject <TestClassE>(dict.GetString("classE"));
            }
            return(true);
        }
        protected override bool Read(Rhino.FileIO.BinaryArchiveReader archive)
        {
            Rhino.Collections.ArchivableDictionary dict = archive.ReadDictionary();
            int i = 0;

            while (dict.ContainsKey("geoSeg" + i))
            {
                Brep     brep = (Brep)dict["gsBrep" + i];
                Material material;

                if (dict[$"gsMaterial{i}"] == "Concrete")
                {
                    material = new ConcreteMaterial((string)dict[$"gsMaterialStrength{i}"]);
                    GeometrySegments.Add(new GeometrySegment(brep, material));
                }
                else if (dict[$"gsMaterial{i}"] == "Steel")
                {
                    material = new SteelMaterial((string)dict[$"gsMaterialName{i}"]);
                    GeometrySegments.Add(new GeometrySegment(brep, material));
                }
                //TODO Add extra materials
                else
                {
                    material = new ConcreteMaterial("C30/37");
                    GeometrySegments.Add(new GeometrySegment(brep, material));
                }

                i++;
            }
            return(true);
        }
        protected override bool Read(Rhino.FileIO.BinaryArchiveReader archive)
        {
            Rhino.Collections.ArchivableDictionary dict = archive.ReadDictionary();
            object ho = base.ReadHotLoadData(dict);

            return(true);
        }
예제 #5
0
 protected override bool Read(Rhino.FileIO.BinaryArchiveReader archive)
 {
     Rhino.Collections.ArchivableDictionary dict = archive.ReadDictionary();
     if (dict.ContainsKey("IntegerData") && dict.ContainsKey("StringData"))
     {
         IntegerData = (int)dict["IntegerData"];
         StringData  = dict["StringData"] as String;
     }
     return(true);
 }
예제 #6
0
 protected override bool Read(Rhino.FileIO.BinaryArchiveReader archive)
 {
     archive.Read3dmChunkVersion(out var major, out var minor);
     if (major == 1 && minor == 0)
     {
         var dic = archive.ReadDictionary();
         Deserialize(dic);
     }
     return(!archive.ReadErrorOccured);
 }
        protected override bool Read(Rhino.FileIO.BinaryArchiveReader archive)
        {
            Rhino.Collections.ArchivableDictionary dict = archive.ReadDictionary();
            BasePoint = (Point3d)dict["Point"];
            OutLine   = (Curve)dict["OutLine"];
            Diameter  = (int)dict["Diameter"];

            double fyk = (double)dict["MaterialStrength"];

            //TODO add a coorect material assignment
            Material = new SteelMaterial((string)dict["MaterialName"]);

            return(true);
        }
예제 #8
0
 protected override void ReadDocument(RhinoDoc doc, Rhino.FileIO.BinaryArchiveReader archive, Rhino.FileIO.FileReadOptions options)
 {
     m_dict = archive.ReadDictionary();
 }