Ejemplo n.º 1
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     this.manufacturer = reader.GetBoolean("KukaJointMovement");
     this.useRotary    = reader.GetBoolean("JointRotary");
     this.useLinear    = reader.GetBoolean("JointLinear");
     return(base.Read(reader));
 }
Ejemplo n.º 2
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     this.numbers     = reader.GetBoolean("ForceNum");
     this.clear       = reader.GetBoolean("ClearSheet");
     this.hideHeaders = reader.GetBoolean("Headers");
     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));
 }
Ejemplo n.º 4
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     // First read our own field.
     ConvTypeL = reader.GetBoolean("Length");
     ConvTypeA = reader.GetBoolean("Area");
     ConvTypeV = reader.GetBoolean("Volume");
     // Then call the base class implementation.
     return(base.Read(reader));
 }
Ejemplo n.º 5
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.º 6
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     this.timeline     = reader.GetBoolean("UseTimeline");
     this.showSpeed    = reader.GetBoolean("ShowSpeed");
     this.showAngles   = reader.GetBoolean("ShowAngles");
     this.showMotion   = reader.GetBoolean("ShowMotion");
     this.showExternal = reader.GetBoolean("ShowExternal");
     return(base.Read(reader));
 }
Ejemplo n.º 7
0
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            showTicks        = reader.GetBoolean("ShowTicks");
            showTooltip      = reader.GetBoolean("ShowTooltip");
            showValueReadout = reader.GetBoolean("ShowValLabel");
            showBounds       = reader.GetBoolean("ShowBounds");
            reader.TryGetBoolean("showLabel", ref showLabel);

            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.º 9
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     if (reader.ItemExists("CSDyn"))
     {
         this.dynamicCS.Checked = reader.GetBoolean("CSDyn");
     }
     if (reader.ItemExists("CSDec"))
     {
         this.outputDec.Checked = reader.GetBoolean("CSDec");
     }
     return(base.Read(reader));
 }
Ejemplo n.º 10
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     if (reader.ItemExists("LogOption"))
     {
         this.logOption.Checked = reader.GetBoolean("LogOption");
     }
     if (reader.ItemExists("ModFileOption"))
     {
         this.modFile.Checked = reader.GetBoolean("ModFileOption");
     }
     return(base.Read(reader));
 }
Ejemplo n.º 11
0
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            try
            {
                show3d            = reader.GetBoolean("Generate3d");
                individualOutputs = reader.GetBoolean("IndividualOutputs");
                way = reader.GetString("Feature");
                System.Globalization.TextInfo ti = new System.Globalization.CultureInfo("en-US", false).TextInfo;
                wayFT = ElkLib.FeatureType.Building;
                bool tryEnum = Enum.TryParse(ti.ToTitleCase(way), out wayFT);

                if (wayFT == ElkLib.FeatureType.Building)
                {
                    show3dMenuItem.Enabled = true;
                }
                else
                {
                    show3dMenuItem.Enabled = false;
                    show3d = false;
                }

                selectedTypes = new List <string>();
                bool keepGoing = true;
                int  i         = 0;
                while (keepGoing)
                {
                    try
                    {
                        string selection = reader.GetString("SelectedTypes", i);
                        if (selection != null && selection != string.Empty)
                        {
                            selectedTypes.Add(selection);
                        }
                        else
                        {
                            keepGoing = false;
                        }
                    }
                    catch
                    {
                        keepGoing = false;
                    }
                    i++;
                }

                AdjustParams();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("ReadError:\n" + ex.ToString());
            }
            return(base.Read(reader));
        }
Ejemplo n.º 12
0
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            string roomInstancesListString = reader.GetString("RoomInstancesListString");

            string[] strArray = roomInstancesListString.Split('@');

            foreach (string guidS in strArray)
            {
                try
                {
                    roomInstancesList.Add(Owner.OnPingDocument().FindComponent(
                                              new System.Drawing.Point(int.Parse(guidS.Split('!')[0]), int.Parse(guidS.Split('!')[1]))) as RoomInstance);
                }
                catch (Exception e) { }
            }
            //  roomInstancesListString.Remove(roomInstancesListString.Length - 1);

            (Owner as HouseInstance).HouseName         = reader.GetString("HouseName");
            (Owner as HouseInstance).FloorName         = reader.GetString("FloorName");
            (Owner as HouseInstance).tryRotateBoundary = reader.GetBoolean("TryRotateBoundary");

            Owner.ExpireSolution(true);

            return(base.Read(reader));
        }
Ejemplo n.º 13
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     // First read our own field.
     Absolute = reader.GetBoolean("Absolute");
     // Then call the base class implementation.
     return(base.Read(reader));
 }
Ejemplo n.º 14
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.º 15
0
        // Deserialize this instance from a Grasshopper reader object.
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            if (reader.ItemExists("UseTimeline"))
            {
                this.timelineOption.Checked = reader.GetBoolean("UseTimeline");
            }
            if (reader.ItemExists("ShowSpeed"))
            {
                this.speedCheck.Checked = reader.GetBoolean("ShowSpeed");
            }
            if (reader.ItemExists("ShowAngles"))
            {
                this.anglesCheck.Checked = reader.GetBoolean("ShowAngles");
            }
            if (reader.ItemExists("ShowMotion"))
            {
                this.motionCheck.Checked = reader.GetBoolean("ShowMotion");
            }
            if (reader.ItemExists("ShowExternal"))
            {
                this.externalCheck.Checked = reader.GetBoolean("ShowExternal");
            }
            if (reader.ItemExists("ShowFlange"))
            {
                this.flangeCheck.Checked = reader.GetBoolean("ShowFlange");
            }
            if (reader.ItemExists("FullProgramCheck"))
            {
                this.fullprogramCheck.Checked = reader.GetBoolean("FullProgramCheck");
            }

            return(base.Read(reader));
        }
Ejemplo n.º 16
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     if (reader.ItemExists("StopPoint"))
     {
         this.stopPoint.Checked = reader.GetBoolean("StopPoint");
     }
     if (reader.ItemExists("UseReorientation"))
     {
         this.orientOpt.Checked = reader.GetBoolean("UseReorientation");
     }
     if (reader.ItemExists("UseExternal"))
     {
         this.extAxOpt.Checked = reader.GetBoolean("UseExternal");
     }
     if (reader.ItemExists("UseDegrees"))
     {
         this.toolOriOpt.Checked = reader.GetBoolean("UseDegrees");
     }
     if (reader.ItemExists("UseLinear"))
     {
         this.linExtOpt.Checked = reader.GetBoolean("UseLinear");
     }
     if (reader.ItemExists("UseRotary"))
     {
         this.rotExtOpt.Checked = reader.GetBoolean("UseRotary");
     }
     if (reader.ItemExists("OutputDec"))
     {
         this.declarationCheck.Checked = reader.GetBoolean("OutputDec");
     }
     return(base.Read(reader));
 }
Ejemplo n.º 17
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.º 18
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.º 19
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     if (reader.ItemExists("UseRotation"))
     {
         this.rotOption.Checked = reader.GetBoolean("UseRotation");
     }
     if (reader.ItemExists("UseExtLin"))
     {
         this.extLinOpt.Checked = reader.GetBoolean("UseExtLin");
     }
     if (reader.ItemExists("UseExtRot"))
     {
         this.extRotOpt.Checked = reader.GetBoolean("UseExtRot");
     }
     if (reader.ItemExists("UseTime"))
     {
         this.timeOption.Checked = reader.GetBoolean("UseTime");
     }
     if (reader.ItemExists("UseName"))
     {
         this.nameOption.Checked = reader.GetBoolean("UseName");
     }
     if (reader.ItemExists("OutputDec"))
     {
         this.declarationCheck.Checked = reader.GetBoolean("OutputDec");
     }
     return(base.Read(reader));
 }
Ejemplo n.º 20
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.º 21
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     this.flags[0] = reader.GetBoolean("Breps");
     this.flags[1] = reader.GetBoolean("Extrusions");
     this.flags[2] = reader.GetBoolean("Surfaces");
     this.flags[3] = reader.GetBoolean("Meshes");
     this.flags[4] = reader.GetBoolean("Curves");
     this.flags[5] = reader.GetBoolean("Points");
     return(base.Read(reader));
 }
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            string roomInstancesListString = reader.GetString("RoomInstancesListString");

            strArray = roomInstancesListString.Split('@');



            (Owner as HouseInstance).HouseName         = reader.GetString("HouseName");
            (Owner as HouseInstance).FloorName         = reader.GetString("FloorName");
            (Owner as HouseInstance).tryRotateBoundary = reader.GetBoolean("TryRotateBoundary");

            Owner.ExpireSolution(false);

            UpdateRoomInstancesColors();
            return(base.Read(reader));
        }
Ejemplo n.º 23
0
        // To persist selection state variables we need to override Read to check for state in the definiton
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            if (reader.ItemExists(this.storageKeyForHideObscure)) // Load form UI state (e.g. hide obscure)
            {
                this.hideObscureFeatures = reader.GetBoolean(storageKeyForHideObscure);
            }

            // Load selected items stored as key=value lists
            if (reader.ItemExists(storageKeyForSelectionState))
            {
                var stateKeyValues = reader.GetString(storageKeyForSelectionState);
                if (!string.IsNullOrEmpty(stateKeyValues))
                {
                    this.storedSelectionState = reader.GetString(storageKeyForSelectionState);
                }
            }
            return(base.Read(reader));
        }
Ejemplo n.º 24
0
 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
     x  = (bool)reader.GetBoolean("x");
     y  = (bool)reader.GetBoolean("y");
     z  = (bool)reader.GetBoolean("z");
     xx = (bool)reader.GetBoolean("xx");
     yy = (bool)reader.GetBoolean("yy");
     zz = (bool)reader.GetBoolean("zz");
     // 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.º 25
0
        public override bool Read(GH_IO.Serialization.GH_IReader reader)
        {
            string roomInstancesListString = reader.GetString("TargetObjectList");

            writerTargetObjectsListString = roomInstancesListString.Split('@');

            // roomInstancesListString.Remove(roomInstancesListString.Length - 1);

            (Owner as RoomInstance).RoomName = reader.GetString("RoomName");                  //, (Owner as RoomInstance).RoomName);
                                                                                              //    (Owner as RoomInstance).RoomId = (uint)reader.GetInt32("RoomId");//, (int)(Owner as RoomInstance).RoomId);
            (Owner as RoomInstance).RoomArea = (int)Math.Floor(reader.GetDouble("RoomArea")); //, (Owner as RoomInstance).RoomArea);

            try
            {
                (Owner as RoomInstance).isHall = reader.GetBoolean("isHall");
            }
            catch (Exception e) { }

            RoomInstance.entranceIds = new List <int>();
            string temp = "";

            try
            {
                temp = reader.GetString("EntranceIds");
            }
            catch (Exception) { }

            if (temp != null && temp.Length > 0)
            {
                string[] tempList = temp.Split('&');
                foreach (string s in tempList)
                {
                    RoomInstance.entranceIds.Add(Int32.Parse(s));
                }
            }

            Owner.ExpireSolution(false);

            return(base.Read(reader));
        }
Ejemplo n.º 26
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     PointsOnly = reader.GetBoolean("PointsOnly");
     return(base.Read(reader));
 }
Ejemplo n.º 27
0
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     Between    = reader.GetBoolean("between");
     Coincident = reader.GetBoolean("coincident");
     return(base.Read(reader));
 }
Ejemplo n.º 28
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     this.manufacturer = reader.GetBoolean("Kuka");
     return(base.Read(reader));
 }
Ejemplo n.º 29
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     this.overwrite = reader.GetBoolean("overwrite");
     return(base.Read(reader));
 }
Ejemplo n.º 30
0
 // Deserialize this instance from a Grasshopper reader object.
 public override bool Read(GH_IO.Serialization.GH_IReader reader)
 {
     this.m_Sync = reader.GetBoolean("SyncDO");
     return(base.Read(reader));
 }