Esempio n. 1
0
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     // First add our own field.
     writer.SetString("Input_id", Input_id);
     // Then call the base class implementation.
     return(base.Write(writer));
 }
Esempio n. 2
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));
 }
Esempio n. 3
0
 ////////////////////////////////////////////////////////////////////////
 // Try to solve the saving of source Type.
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     // First add our own field.
     writer.SetInt32("sourceType", (int)this.sourceType);
     // Then call the base class implementation.
     return(base.Write(writer));
 }
Esempio n. 4
0
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            int f = (int)_subdv;

            writer.SetInt32("subdivide", f);
            return(base.Write(writer));
        }
Esempio n. 5
0
 //This region handles serialisation and deserialisation, meaning that
 // component states will be remembered when reopening GH script
 public override bool Write(GH_IO.Serialization.GH_IWriter writer)
 {
     //writer.SetInt32("Mode", (int)_mode);
     writer.SetString("File", (string)fileName);
     //writer.SetBoolean("Advanced", (bool)advanced);
     return(base.Write(writer));
 }
Esempio n. 6
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));
 }
        // 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));
        }
Esempio n. 8
0
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            writer.SetInt32("Operation", (int)Operation);
            writer.SetInt32("FillType", (int)FillType);

            return(base.Write(writer));
        }
 // 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));
 }
        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);
        }
Esempio n. 11
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));
 }
 // 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));
 }
Esempio n. 13
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));
 }
Esempio n. 14
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));
 }
Esempio n. 15
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));
 }
Esempio n. 16
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));
 }
 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));
 }
Esempio n. 18
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));
 }
Esempio n. 19
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));
 }
Esempio n. 20
0
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            // write the information to the component.
            for (int i = 0; i < elements.Count; i++)
            {
                writer.SetString("Element", i, elements[i]);
            }

            return(base.Write(writer));
        }
Esempio n. 21
0
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            if (!Enum.IsDefined(typeof(DocStorage), DocStorageMode))
            {
                DocStorageMode = DocStorage.InGrasshopperMemory;
            }
            writer.SetInt32(TargetDocIdentifier, (int)DocStorageMode);

            return(base.Write(writer));
        }
Esempio n. 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));
 }
Esempio n. 23
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));
 }
Esempio n. 24
0
        /// <summary>
        /// Write to a file
        /// </summary>
        /// <param name="writer"></param>
        /// <returns></returns>
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            if (Value != null)
            {
                Value.historicData.Write(writer.CreateChunk("historicData"));
                Value.genoGuids.Write(writer.CreateChunk("genoData"));
                writer.SetInt32("popCount", Value.PopCount);
            }

            return(true);
        }
        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            writer.SetDouble("MultiplierFactor", Factor);
            writer.SetInt32("TargetCount", _targetIds.Count);
            for (int i = 0; i < _targetIds.Count; i++)
            {
                writer.SetGuid("TargetID", i, _targetIds[i]);
            }

            return(base.Write(writer));
        }
Esempio n. 26
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));
 }
Esempio n. 27
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));
 }
Esempio n. 28
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));
 }
Esempio n. 29
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));
        }
Esempio n. 30
0
        /*******************************************/

        public override bool Write(GH_IO.Serialization.GH_IWriter writer)
        {
            writer.SetString("Component", Caller.Write());

            int index = ListItems.IndexOf(FirstSelectedItem);

            if (index >= 0)
            {
                writer.SetInt32("Selection", index);
            }

            return(base.Write(writer));
        }