Пример #1
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("ForceNum", this.numbers);
     writer.SetBoolean("ClearSheet", this.clear);
     writer.SetBoolean("Headers", this.hideHeaders);
     return(base.Write(writer));
 }
Пример #2
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("KukaJointMovement", this.manufacturer);
     writer.SetBoolean("JointRotary", this.useRotary);
     writer.SetBoolean("JointLinear", this.useLinear);
     return(base.Write(writer));
 }
        // Methods to save the boolean state of the component between file opens

        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            writer.SetBoolean("showLabel", showLabel);
            writer.SetBoolean("enterEvent", enterEvent);

            return(base.Write(writer));
        }
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            bool rc = base.Write(writer);

            writer.SetBoolean(ID_HideInput, HiddenCodeInput);

            if (HiddenCodeInput)
            {
                writer.SetString(ID_CodeInput, Code);
            }

            writer.SetBoolean(ID_HideOutput, HiddenOutOutput);


            //update if possible and save editor location
            {
                Form editor;
                if (Attributes.TryGetEditor(out editor))
                {
                    DefaultEditorLocation = editor.Location;
                    DefaultEditorSize     = editor.Visible ? editor.Size : editor.RestoreBounds.Size;
                }
            }
            if (DefaultEditorLocation != null)
            {
                writer.SetDrawingPoint(ID_EditorLocation, DefaultEditorLocation.Value);
                writer.SetDrawingSize(ID_EditorSize, DefaultEditorSize);
            }

            return(rc);
        }
Пример #5
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetInt32("Manufacturer", (int)this.Manufacturer);
     writer.SetBoolean("Weight", this.weightOption.Checked);
     writer.SetBoolean("Declaration", this.declOption.Checked);
     writer.SetBoolean("Relative Tool Offset", this.reltoolOption.Checked);
     return(base.Write(writer));
 }
Пример #6
0
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("ShowTicks", showTicks);
     writer.SetBoolean("ShowTooltip", showTooltip);
     writer.SetBoolean("ShowValLabel", showValueReadout);
     writer.SetBoolean("ShowBounds", showBounds);
     writer.SetBoolean("showLabel", showLabel);
     return(base.Write(writer));
 }
Пример #7
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("UseTimeline", this.timeline);
     writer.SetBoolean("ShowSpeed", this.showSpeed);
     writer.SetBoolean("ShowAngles", this.showAngles);
     writer.SetBoolean("ShowMotion", this.showMotion);
     writer.SetBoolean("ShowExternal", this.showExternal);
     return(base.Write(writer));
 }
Пример #8
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("ModName", this.moduleName.Checked);
     writer.SetBoolean("Declarations", this.declarationsCheck.Checked);
     writer.SetBoolean("Overrides", this.overrideCheck.Checked);
     writer.SetInt32("Manufacturer", (int)this.Manufacturer);;
     writer.SetBoolean("IgnoreLen", this.ignore.Checked);
     return(base.Write(writer));
 }
Пример #9
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("OutputCode", this.m_outputCode);
     writer.SetInt32("Manufacturer", (int)this.m_Manufacturer);
     writer.SetBoolean("RotAxis", this.extRotary);
     writer.SetBoolean("LinAxis", this.extLinear);
     writer.SetBoolean("Method", this.m_interpolationTypes);
     return(base.Write(writer));
 }
Пример #10
0
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     // First add our own field.
     writer.SetBoolean("Length", ConvTypeL);
     writer.SetBoolean("Area", ConvTypeA);
     writer.SetBoolean("Volume", ConvTypeV);
     // Then call the base class implementation.
     return(base.Write(writer));
 }
Пример #11
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("OutputCode", this.outputCode.Checked);
     writer.SetInt32("Manufacturer", (int)this.Manufacturer);
     writer.SetInt32("MotionType", (int)this.c_motionType);
     writer.SetBoolean("RotAxis", this.extRotAxisCheck.Checked);
     writer.SetBoolean("LinAxis", this.extLinAxisCheck.Checked);
     return(base.Write(writer));
 }
Пример #12
0
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("Generate3d", show3d);
     writer.SetBoolean("IndividualOutputs", individualOutputs);
     writer.SetString("Feature", way);
     for (int i = 0; i < selectedTypes.Count; i++)
     {
         writer.SetString("SelectedTypes", i, selectedTypes[i]);
     }
     return(base.Write(writer));
 }
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            bool rc = base.Write(writer);

            writer.SetBoolean(HideInputIdentifier, !CodeInputVisible);
            if (!CodeInputVisible)
            {
                writer.SetString(CodeInputIdentifier, CodeInput);
            }

            writer.SetBoolean(HideOutputIdentifier, HideCodeOutput);

            return(rc);
        }
Пример #14
0
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     // First add our own field.
     writer.SetBoolean("Absolute", Absolute);
     // Then call the base class implementation.
     return(base.Write(writer));
 }
Пример #15
0
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            string all = "";

            if (storedPath.Count > 0)
            {
                foreach (string s in storedPath)
                {
                    all += s + "|";
                }
                all = all.Remove(all.Length - 1);
            }
            writer.SetString("selectedobject", all);
            writer.SetBoolean("lock", this.inputLock);
            writer.SetBoolean("maintain", this.maintainPath);
            writer.SetBoolean("order", this.sortByIndex);
            return(base.Write(writer));
        }
Пример #16
0
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     for (int s = 0; s < this.script_variables_in_use.Count; s++)
     {
         writer.SetString("script_variables_in_use[" + s + "]", this.script_variables_in_use[s]);
     }
     writer.SetBoolean("props_visible", this.props_visible);
     return(base.Write(writer));
 }
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            // we need to save all the items that we want to reappear when a GH file is saved and re-opened
            writer.SetInt32("Mode", (int)_mode);
            writer.SetInt32("loadselectid", loadselectid);
            writer.SetInt32("loadlistid", loadlistid);
            writer.SetInt32("catalogueIndex", catalogueIndex);
            writer.SetInt32("catalogueTypeIndex", catalogueTypeIndex);
            writer.SetInt32("catalogueProfileIndex", catalogueProfileIndex);
            writer.SetBoolean("isTapered", isTapered);
            writer.SetBoolean("isHollow", isHollow);
            writer.SetBoolean("isElliptical", isElliptical);
            writer.SetBoolean("isGeneral", isGeneral);
            writer.SetBoolean("isB2B", isB2B);

            // to save the dropdownlist content, spacer list and selection list
            // loop through the lists and save number of lists as well
            writer.SetInt32("dropdownCount", dropdowncontents.Count);
            for (int i = 0; i < dropdowncontents.Count; i++)
            {
                writer.SetInt32("dropdowncontentsCount" + i, dropdowncontents[i].Count);
                for (int j = 0; j < dropdowncontents[i].Count; j++)
                {
                    writer.SetString("dropdowncontents" + i + j, dropdowncontents[i][j]);
                }
            }
            // spacer list
            writer.SetInt32("spacerCount", dropdownspacer.Count);
            for (int i = 0; i < dropdownspacer.Count; i++)
            {
                writer.SetString("spacercontents" + i, dropdownspacer[i]);
            }
            // selection list
            writer.SetInt32("selectionCount", selections.Count);
            for (int i = 0; i < selections.Count; i++)
            {
                writer.SetString("selectioncontents" + i, selections[i]);
            }



            return(base.Write(writer));
        }
Пример #18
0
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetInt32("Mode", (int)_mode);
     writer.SetInt32("Display", (int)_disp);
     writer.SetBoolean("slider", slider);
     writer.SetInt32("noDec", noDigits);
     writer.SetDouble("valMax", MaxValue);
     writer.SetDouble("valMin", MinValue);
     writer.SetDouble("val", Value);
     return(base.Write(writer));
 }
Пример #19
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("StopPoint", this.stopPoint.Checked);
     writer.SetBoolean("UseReorientation", this.orientOpt.Checked);
     writer.SetBoolean("UseExternal", this.extAxOpt.Checked);
     writer.SetBoolean("UseDegrees", this.toolOriOpt.Checked);
     writer.SetBoolean("UseLinear", this.linExtOpt.Checked);
     writer.SetBoolean("UseRotary", this.rotExtOpt.Checked);
     writer.SetBoolean("OutputDec", this.declarationCheck.Checked);
     return(base.Write(writer));
 }
Пример #20
0
        // Serialize this instance to a Grasshopper writer object.
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            writer.SetBoolean("UseTimeline", this.timelineOption.Checked);
            writer.SetBoolean("ShowSpeed", this.speedCheck.Checked);
            writer.SetBoolean("ShowAngles", this.anglesCheck.Checked);
            writer.SetBoolean("ShowMotion", this.motionCheck.Checked);
            writer.SetBoolean("ShowExternal", this.externalCheck.Checked);
            writer.SetBoolean("ShowFlange", this.flangeCheck.Checked);
            writer.SetBoolean("FullProgramCheck", this.fullprogramCheck.Checked);


            return(base.Write(writer));
        }
Пример #21
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("Breps", this.flags[0]);
     writer.SetBoolean("Extrusions", this.flags[1]);
     writer.SetBoolean("Surfaces", this.flags[2]);
     writer.SetBoolean("Meshes", this.flags[3]);
     writer.SetBoolean("Curves", this.flags[4]);
     writer.SetBoolean("Points", this.flags[5]);
     return(base.Write(writer));
 }
Пример #22
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("UseRotation", this.rotOption.Checked);
     writer.SetBoolean("UseExtLin", this.extLinOpt.Checked);
     writer.SetBoolean("UseExtRot", this.extRotOpt.Checked);
     writer.SetBoolean("UseTime", this.timeOption.Checked);
     writer.SetBoolean("UseName", this.nameOption.Checked);
     writer.SetBoolean("OutputDec", this.declarationCheck.Checked);
     return(base.Write(writer));
 }
Пример #23
0
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     // we need to save all the items that we want to reappear when a GH file is saved and re-opened
     writer.SetBoolean("x", (bool)x);
     writer.SetBoolean("y", (bool)y);
     writer.SetBoolean("z", (bool)z);
     writer.SetBoolean("xx", (bool)xx);
     writer.SetBoolean("yy", (bool)yy);
     writer.SetBoolean("zz", (bool)zz);
     return(base.Write(writer));
 }
Пример #24
0
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            string roomInstancesListString = "";

            foreach (RoomInstance.IntPair intPair in RoomInstance.allAdjacencesList)
            {
                roomInstancesListString += intPair.a + "%" + intPair.b + "@";
            }

            /*   foreach (RoomInstance room in targetObjectList)
             *     if (room != null)
             *         roomInstancesListString += ((int)(room.Attributes.Pivot.X)).ToString() + "!" +
             *         ((int)(room.Attributes.Pivot.Y)).ToString() + "@";
             */
            if (roomInstancesListString.Length > 0)
            {
                roomInstancesListString = roomInstancesListString.Remove(roomInstancesListString.Length - 1);
            }

            writer.SetString("TargetObjectList", roomInstancesListString);
            writer.SetString("RoomName", (Owner as RoomInstance).RoomName);
            //    writer.SetInt32("RoomId", (int)(Owner as RoomInstance).RoomId);
            writer.SetDouble("RoomArea", (Owner as RoomInstance).RoomArea);

            writer.SetBoolean("isHall", (Owner as RoomInstance).isHall);

            string temp = "";

            foreach (int a in RoomInstance.entranceIds)
            {
                temp += a.ToString() + "&";
            }
            if (temp.Length > 0)
            {
                temp = temp.Remove(temp.Length - 1);
            }

            writer.SetString("EntranceIds", temp);

            return(base.Write(writer));
        }
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            string roomInstancesListString = "";

            foreach (string guid in roomInstancesGuidList)
            {
                roomInstancesListString += guid + "@";
            }

            if (roomInstancesListString.Length > 0)
            {
                roomInstancesListString.Remove(roomInstancesListString.Length - 1);
            }

            writer.SetString("RoomInstancesListString", roomInstancesListString);
            writer.SetString("HouseName", (Owner as HouseInstance).HouseName);
            writer.SetString("FloorName", (Owner as HouseInstance).FloorName);
            writer.SetBoolean("TryRotateBoundary", (Owner as HouseInstance).tryRotateBoundary);

            return(base.Write(writer));
        }
Пример #26
0
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            string roomInstancesListString = "";

            foreach (RoomInstance room in roomInstancesList)
            {
                roomInstancesListString += ((int)(room.Attributes.Pivot.X + room.Attributes.Bounds.Width / 2)).ToString() + "!" +
                                           ((int)(room.Attributes.Pivot.Y + room.Attributes.Bounds.Height / 2)).ToString() + "@";
            }

            if (roomInstancesListString.Length > 0)
            {
                roomInstancesListString.Remove(roomInstancesListString.Length - 1);
            }

            writer.SetString("RoomInstancesListString", roomInstancesListString);
            writer.SetString("HouseName", (Owner as HouseInstance).HouseName);
            writer.SetString("FloorName", (Owner as HouseInstance).FloorName);
            writer.SetBoolean("TryRotateBoundary", (Owner as HouseInstance).tryRotateBoundary);

            return(base.Write(writer));
        }
Пример #27
0
 // To persist the selection state variables we need to override Write to record state in the definition
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetString(storageKeyForSelectionState, GetStateKeys());
     writer.SetBoolean(storageKeyForHideObscure, this.hideObscureFeatures);
     return(base.Write(writer));
 }
Пример #28
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("CSDyn", this.dynamicCS.Checked);
     writer.SetBoolean("CSDec", this.outputDec.Checked);
     return(base.Write(writer));
 }
Пример #29
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("overwrite", this.overwrite);
     return(base.Write(writer));
 }
Пример #30
0
 // Serialize this instance to a Grasshopper writer object.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     writer.SetBoolean("LogOption", this.logOption.Checked);
     return(base.Write(writer));
 }