Ejemplo n.º 1
0
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            _mode = (FoldMode)reader.GetInt32("Mode");
            _disp = (DisplayValue)reader.GetInt32("Display");

            slider   = reader.GetBoolean("slider");
            noDigits = reader.GetInt32("noDec");
            MaxValue = reader.GetDouble("valMax");
            MinValue = reader.GetDouble("valMin");
            Value    = reader.GetDouble("val");

            dropdowncontents = new List <List <string> >();
            dropdowncontents.Add(dropdownitems);
            if (_mode == FoldMode.Displacement)
            {
                dropdowncontents.Add(dropdowndisplacement);
            }
            if (_mode == FoldMode.Stress)
            {
                dropdowncontents.Add(dropdownstress);
            }

            selections = new List <string>();
            selections.Add(dropdowncontents[0][(int)_mode]);
            selections.Add(dropdowncontents[1][(int)_disp]);

            first = false;

            this.CreateAttributes();
            return(base.Read(reader));
        }
Ejemplo n.º 2
0
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            Operation = (ClipType)reader.GetInt32("Operation");
            FillType  = (PolyFillType)reader.GetInt32("FillType");

            return(base.Read(reader));
        }
Ejemplo n.º 3
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     if (reader.ItemExists("OutputCode"))
     {
         this.outputCode.Checked = reader.GetBoolean("OutputCode");
     }
     if (reader.ItemExists("Manufacturer"))
     {
         this.Manufacturer = (Manufacturer)reader.GetInt32("Manufacturer");
     }
     if (reader.ItemExists("MotionType"))
     {
         this.c_motionType = (MotionType)reader.GetInt32("MotionType");
     }
     if (reader.ItemExists("RotAxis"))
     {
         this.extRotAxisCheck.Checked = reader.GetBoolean("RotAxis");
     }
     if (reader.ItemExists("LinAxis"))
     {
         this.extLinAxisCheck.Checked = reader.GetBoolean("LinAxis");
     }
     if (reader.ItemExists("ShowZone"))
     {
         this.showZoneCheck.Checked = reader.GetBoolean("ShowZone");
     }
     if (reader.ItemExists("Method"))
     {
         this.interpolation.Checked = reader.GetBoolean("Method");
     }
     return(base.Read(reader));
 }
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            // when a GH file is opened we need to read in the data that was previously set by user

            _mode = (FoldMode)reader.GetInt32("Mode");

            // dropdown content list
            int dropdownCount = reader.GetInt32("dropdownCount");

            dropdowncontents = new List <List <string> >();
            for (int i = 0; i < dropdownCount; i++)
            {
                int           dropdowncontentsCount = reader.GetInt32("dropdowncontentsCount" + i);
                List <string> tempcontent           = new List <string>();
                for (int j = 0; j < dropdowncontentsCount; j++)
                {
                    tempcontent.Add(reader.GetString("dropdowncontents" + i + j));
                }
                dropdowncontents.Add(tempcontent);
            }
            // spacer list
            int dropdownspacerCount = reader.GetInt32("spacerCount");

            dropdownspacer = new List <string>();
            for (int i = 0; i < dropdownspacerCount; i++)
            {
                dropdownspacer.Add(reader.GetString("spacercontents" + i));
            }
            // selection list
            int selectionsCount = reader.GetInt32("selectionCount");

            selections = new List <string>();
            for (int i = 0; i < selectionsCount; i++)
            {
                selections.Add(reader.GetString("selectioncontents" + i));
            }

            loadlistid   = reader.GetInt32("loadlistid");
            loadselectid = reader.GetInt32("loadselectid");

            catalogueIndex        = reader.GetInt32("catalogueIndex");
            catalogueTypeIndex    = reader.GetInt32("catalogueTypeIndex");
            catalogueProfileIndex = reader.GetInt32("catalogueProfileIndex");

            isTapered    = reader.GetBoolean("isTapered");
            isHollow     = reader.GetBoolean("isHollow");
            isElliptical = reader.GetBoolean("isElliptical");
            isGeneral    = reader.GetBoolean("isGeneral");
            isB2B        = reader.GetBoolean("isB2B");

            // we need to recreate the custom UI again as this is created before this read IO is called
            // otherwise the component will not display the selected items on the canvas
            this.CreateAttributes();
            return(base.Read(reader));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Read a file
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            var hisChunk = reader.FindChunk("historicData");
            var genChunk = reader.FindChunk("genoData");

            if (hisChunk != null)
            {
                var data = new GH_Structure <GH_Number>();
                data.Read(hisChunk);
                Value.historicData = new GH_Structure <GH_Number>(data, true);
            }

            if (genChunk != null)
            {
                var data = new GH_Structure <GH_Guid>();
                data.Read(genChunk);
                Value.genoGuids = new GH_Structure <GH_Guid>(data, true);
            }

            if (reader.ItemExists("popCount"))
            {
                Value.PopCount = reader.GetInt32("popCount");
            }

            return(true);
        }
Ejemplo n.º 6
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     _mode        = (FoldMode)reader.GetInt32("Mode");
     selecteditem = reader.GetString("select");
     this.CreateAttributes();
     return(base.Read(reader));
 }
Ejemplo n.º 7
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     this.m_outputCode         = reader.GetBoolean("OutputCode");
     this.m_Manufacturer       = (Manufacturer)reader.GetInt32("Manufacturer");
     this.extRotary            = reader.GetBoolean("RotAxis");
     this.extLinear            = reader.GetBoolean("LinAxis");
     this.m_interpolationTypes = reader.GetBoolean("Method");
     return(base.Read(reader));
 }
Ejemplo n.º 8
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     if (reader.ItemExists("Manufacturer"))
     {
         this.Manufacturer = (Manufacturer)reader.GetInt32("Manufacturer");
     }
     if (reader.ItemExists("StartPose"))
     {
         this.PoseOut.Checked = reader.GetBoolean("Pose");
     }
     return(base.Read(reader));
 }
Ejemplo n.º 9
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     // First read our own field.
     try {
         this.sourceType = (SourceType)reader.GetInt32("sourceType");
     }
     catch {
         this.sourceType = SourceType.UDP;
     }
     UpdateMessage();
     // Then call the base class implementation.
     return(base.Read(reader));
 }
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            Factor = reader.GetDouble("MultiplierFactor");

            _targetIds.Clear();
            _targetObjs.Clear();
            int targetCount = reader.GetInt32("TargetCount");

            for (int i = 0; i < targetCount; i++)
            {
                Guid id = Guid.Empty;
                if (reader.TryGetGuid("TargetID", i, ref id))
                {
                    AddTarget(id);
                }
            }

            return(base.Read(reader));
        }
Ejemplo n.º 11
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     if (reader.ItemExists("Manufacturer"))
     {
         this.Manufacturer = (Manufacturer)reader.GetInt32("Manufacturer");
     }
     if (reader.ItemExists("Weight"))
     {
         this.weightOption.Checked = reader.GetBoolean("Weight");
     }
     if (reader.ItemExists("Declaration"))
     {
         this.declOption.Checked = reader.GetBoolean("Declaration");
     }
     if (reader.ItemExists("Relative Tool Offset"))
     {
         this.reltoolOption.Checked = reader.GetBoolean("Relative Tool Offset");
     }
     return(base.Read(reader));
 }
Ejemplo n.º 12
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     if (reader.ItemExists("ModName"))
     {
         this.moduleName.Checked = reader.GetBoolean("ModName");
     }
     if (reader.ItemExists("Declarations"))
     {
         this.declarationsCheck.Checked = reader.GetBoolean("Declarations");
     }
     if (reader.ItemExists("Overrides"))
     {
         this.overrideCheck.Checked = reader.GetBoolean("Overrides");
     }
     if (reader.ItemExists("Manufacturer"))
     {
         this.Manufacturer = (Manufacturer)reader.GetInt32("Manufacturer");
     }
     if (reader.ItemExists("IgnoreLen"))
     {
         this.ignore.Checked = reader.GetBoolean("IgnoreLen");
     }
     return(base.Read(reader));
 }
Ejemplo n.º 13
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     _mode = (FoldMode)reader.GetInt32("Mode");
     return(base.Read(reader));
 }
Ejemplo n.º 14
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     Value = (Bricscad.Bim.BimCategory)reader.GetInt32("Category");
     return(true);
 }
Ejemplo n.º 15
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     Value = (Bricscad.Bim.BimTypeElement)reader.GetInt32("ElementType");
     return(true);
 }