/// <summary> /// Write the makefile to the given archive /// </summary> /// <param name="Writer">The archive to write to</param> public void Write(BinaryArchiveWriter Writer) { Writer.WriteLong(CreateTimeUtc.Ticks); Writer.WriteString(ToolchainInfo); Writer.WriteString(ExternalMetadata); Writer.WriteFileReference(ReceiptFile); Writer.WriteDirectoryReference(ProjectIntermediateDirectory); Writer.WriteInt((int)TargetType); Writer.WriteBool(bDeployAfterCompile); Writer.WriteBool(bHasProjectScriptPlugin); Writer.WriteArray(AdditionalArguments, Item => Writer.WriteString(Item)); Writer.WriteArray(PreBuildScripts, Item => Writer.WriteFileReference(Item)); Writer.WriteList(Actions, Action => Action.Write(Writer)); Writer.WriteList(EnvironmentVariables, x => { Writer.WriteString(x.Item1); Writer.WriteString(x.Item2); }); Writer.WriteList(OutputItems, Item => Writer.WriteFileItem(Item)); Writer.WriteDictionary(ModuleNameToOutputItems, k => Writer.WriteString(k), v => Writer.WriteArray(v, e => Writer.WriteFileItem(e))); Writer.WriteHashSet(HotReloadModuleNames, x => Writer.WriteString(x)); Writer.WriteDictionary(DirectoryToSourceFiles, k => Writer.WriteDirectoryItem(k), v => Writer.WriteArray(v, e => Writer.WriteFileItem(e))); Writer.WriteHashSet(WorkingSet, x => Writer.WriteFileItem(x)); Writer.WriteHashSet(CandidatesForWorkingSet, x => Writer.WriteFileItem(x)); Writer.WriteList(UObjectModules, e => e.Write(Writer)); Writer.WriteList(UObjectModuleHeaders, x => x.Write(Writer)); Writer.WriteHashSet(PluginFiles, x => Writer.WriteFileItem(x)); Writer.WriteHashSet(AdditionalDependencies, x => Writer.WriteFileItem(x)); }
protected override void WriteDocument(RhinoDoc doc, BinaryArchiveWriter archive, FileWriteOptions options) { var dict = new Rhino.Collections.ArchivableDictionary(1, "RigiBodyData"); //If user save during animation, save the shapes at the time when start was pressed if (!TimePanel.Instance.Restarted || TimePanel.Instance.TrackbarValue != 0) { List <RigidBody> copyToAdd = new List <RigidBody>();; for (int i = 0; i < RigidBodyManager.World.RigidBodies.Count; i++) { copyToAdd.Add(RigidBodyManager.DuplicateRigidBody(RigidBodyManager.FramesRigidBodies[0][i], RigidBodyManager.FramesRigidBodies[0][i].IsStatic)); } dict.Set("rigidBodies", RigidBodyManager.ObjectToByteArray(copyToAdd)); } else { dict.Set("rigidBodies", RigidBodyManager.ObjectToByteArray(RigidBodyManager.RigidBodies)); } dict.Set("guidList", RigidBodyManager.ObjectToByteArray(RigidBodyManager.GuidList)); dict.Set("geometryList", RigidBodyManager.ObjectToByteArray(RigidBodyManager.GeometryList)); dict.Set("MaxFrameBoxValue", (int)TimePanel.Instance.MaxFrameBoxValue); dict.Set("worldCount", RigidBodyManager.World.RigidBodies.Count); archive.WriteDictionary(dict); }
protected override bool Write(BinaryArchiveWriter archive) { // deserialize properties to archivable dictionary var dict = DeserializeToDictionary(); // write dict to archive archive.WriteDictionary(dict); return(!archive.WriteErrorOccured); }
/// <summary> /// Saves this action history to disk /// </summary> void Save() { DirectoryReference.CreateDirectory(Location.Directory); using (BinaryArchiveWriter Writer = new BinaryArchiveWriter(Location)) { Writer.WriteInt(CurrentVersion); Writer.WriteDictionary(OutputItemToCommandLineHash, Key => Writer.WriteFileItem(Key), Value => Writer.WriteFixedSizeByteArray(Value)); } bModified = false; }
/// <summary> /// Called when Rhino is saving a .3dm file to allow the plug-in to save document user data. /// </summary> protected override void WriteDocument(RhinoDoc doc, BinaryArchiveWriter archive, FileWriteOptions options) { // Write the version of our document data archive.Write3dmChunkVersion(MAJOR, MINOR); // Write the string table StringDocumentDataTable.WriteDocument(archive); // Write the simple table SimpleDocumentDataTable.WriteDocument(archive); // Write the dictionary archive.WriteDictionary(Dictionary); }
public override bool SaveObject(RhinoDoc doc, RhinoObject doc_object, ref Transform transform, BinaryArchiveWriter archive) { string name = doc_object.Name; Rhino.Collections.ArchivableDictionary userdata = doc_object.UserDictionary; userdata.Set("ObjName", name); archive.WriteDictionary(userdata); return(!archive.WriteErrorOccured); }
public bool WriteToArchive(BinaryArchiveWriter archive) { archive.Write3dmChunkVersion(1, 0); //HBObject, orphaned objects var dic = Serialize(); archive.WriteDictionary(dic); return(!archive.WriteErrorOccured); }
protected override void WriteDocument(RhinoDoc doc, BinaryArchiveWriter archive, FileWriteOptions options) { ArchivableDictionary dict = new ArchivableDictionary(); int i = 1; dict.Set("BeamCount", Beams.Count); dict.Set("CountableUserData", CountableUserData.getCounter()); foreach (Beam beam in Beams) { if (beam.GetType() == typeof(Column)) { Column col = beam as Column; dict.Set("BeamType" + i, "Column"); dict.Set("ky" + i, col.Ky); dict.Set("kz" + i, col.Kz); dict.Set("ColLength" + i, col.Length); dict.Set("CliConcreteStrenghtClass" + i, beam.CrossSec.ConcreteMaterial.StrengthClass ?? null); dict.Set("ColumnCalculationSettings1" + i, col.ColumnCalcSettings.ColumnCalMethod[ColumnCalculationMethod.NominalCurvature1]); dict.Set("ColumnCalculationSettings2" + i, col.ColumnCalcSettings.ColumnCalMethod[ColumnCalculationMethod.NominalCurvature2]); dict.Set("ColumnCalculationSettings3" + i, col.ColumnCalcSettings.ColumnCalMethod[ColumnCalculationMethod.NominalStiffness1]); dict.Set("ColumnCalculationSettings4" + i, col.ColumnCalcSettings.ColumnCalMethod[ColumnCalculationMethod.NominalStiffness2]); } else { dict.Set("BeamType" + i, "Other"); } dict.Set("Rh" + i, beam.ClimateCond.RH); dict.Set("T0" + i, beam.ClimateCond.T0); dict.Set("T" + i, beam.ClimateCond.T); dict.Set("BeamName" + i, beam.Name); dict.Set("Gammac" + i, beam.Gammac); dict.Set("Gammas" + i, beam.Gammas); dict.Set("Gammar" + i, beam.Gammar); dict.Set("Acc" + i, beam.Acc); dict.Set("CrossSecName" + i, beam.CrossSec.Name); dict.Set("ConcreteStrenghtClass" + i, beam.CrossSec.ConcreteMaterial.StrengthClass ?? null); dict.Set("BeamId" + i, beam.CrossSec.Id); dict.Set("geomLarges" + i, beam.CrossSec.GeometryLargeIds); dict.Set("reinf" + i, beam.CrossSec.ReinforementIds); if (beam.CrossSec.GetType() == typeof(RectangleCrossSection)) { RectangleCrossSection crossSectionTemp = beam.CrossSec as RectangleCrossSection; dict.Set("CrossSectionType" + i, "Rect"); dict.Set("NoReinfH" + i, crossSectionTemp.NoReinfH); dict.Set("NoReinfW" + i, crossSectionTemp.NoReinfW); dict.Set("ConcreteCover" + i, crossSectionTemp.ConcreteCover); dict.Set("ConcreteWidth" + i, crossSectionTemp.ConcreteWidth); dict.Set("ConcreteHeight" + i, crossSectionTemp.ConcreteHeight); dict.Set("HasSteelShell" + i, crossSectionTemp.HasSteelShell); dict.Set("SteelThickness" + i, crossSectionTemp.SteelThickness); dict.Set("MainDiameter" + i, crossSectionTemp.MainD); dict.Set("StirrupDiameter" + i, crossSectionTemp.StirrupD); dict.Set("SteelMaterialName" + i, crossSectionTemp.SteelMaterial.StrengthClass ?? null); dict.Set("ReinforcementMaterialName" + i, crossSectionTemp.ReinfMaterial.StrengthClass ?? null); dict.Set("Rotation" + i, crossSectionTemp.Rotation); } else if (beam.CrossSec.GetType() == typeof(CrossSection)) { dict.Set("CrossSectionType" + i, "Basic"); } else if (beam.CrossSec.GetType() == typeof(CircleCrossSection)) { CircleCrossSection crossSectionTemp = beam.CrossSec as CircleCrossSection; dict.Set("CrossSectionType" + i, "Rect"); dict.Set("NoReinf" + i, crossSectionTemp.NoReinf); dict.Set("ConcreteCover" + i, crossSectionTemp.ConcreteCover); dict.Set("ConcreteDiameter" + i, crossSectionTemp.ConcreteDiameter); dict.Set("HasSteelShell" + i, crossSectionTemp.HasSteelShell); dict.Set("SteelThickness" + i, crossSectionTemp.SteelThickness); dict.Set("MainDiameter" + i, crossSectionTemp.MainD); dict.Set("StirrupDiameter" + i, crossSectionTemp.StirrupD); dict.Set("SteelMaterialName" + i, crossSectionTemp.SteelMaterial.StrengthClass ?? null); dict.Set("ReinforcementMaterialName" + i, crossSectionTemp.ReinfMaterial.StrengthClass ?? null); } int k = 1; dict.Set("NumberOfLoadCases" + i, beam.LoadCases.Count); foreach (LoadCase loadCase in beam.LoadCases) { if (loadCase.GetType() == typeof(ColLoadCase)) { ColLoadCase clc = (ColLoadCase)loadCase; dict.Set("LoadCaseType" + i + "s" + k, "ColLoadCase"); dict.Set("N_Ed" + i + "s" + k, clc.N_Ed); dict.Set("M_EzTop" + i + "s" + k, clc.M_EzTop); dict.Set("M_EzBottom" + i + "s" + k, clc.M_EzBottom); dict.Set("M_EyTop" + i + "s" + k, clc.M_EyTop); dict.Set("M_EyBottom" + i + "s" + k, clc.M_EyBottom); dict.Set("Ratio" + i + "s" + k, clc.Ratio); dict.Set("CCurve" + i + "s" + k, clc.Ccurve); } else if (loadCase.GetType() == typeof(SimpleLoadCase)) { SimpleLoadCase slc = (SimpleLoadCase)loadCase; dict.Set("LoadCaseType" + i + "s" + k, "SimpleLoadCase"); dict.Set("N_Ed" + i + "s" + k, slc.N_Ed); dict.Set("M_Edy" + i + "s" + k, slc.M_Edy); dict.Set("M_Edz" + i + "s" + k, slc.M_Edz); } dict.Set("LoadCaseName" + i + "s" + k, loadCase.Name); switch (loadCase.Ls) { case LimitState.Ultimate: dict.Set("LimitState" + i + "s" + k, 0); break; case LimitState.Service_CH: dict.Set("LimitState" + i + "s" + k, 1); break; case LimitState.Service_FR: dict.Set("LimitState" + i + "s" + k, 2); break; case LimitState.Service_QP: dict.Set("LimitState" + i + "s" + k, 3); break; default: break; } k++; } i++; } if (CurrentBeam != null) { dict.Set("currentBeamId", CurrentBeam.Id); } else { dict.Set("currentBeamId", -1); } archive.WriteDictionary(dict); }
/// <summary> /// Write the dependencies object to disk /// </summary> /// <param name="Writer">Archive to write to</param> public void Write(BinaryArchiveWriter Writer) { Writer.WriteDictionary(Dependencies, Key => Key.Write(Writer), Value => Writer.WriteList(Value, x => Writer.WriteString(x))); }
/// <summary> /// Called when Rhino is saving a .3dm file to allow the plug-in to save document user data. /// </summary> protected override void WriteDocument(RhinoDoc doc, BinaryArchiveWriter archive, FileWriteOptions options) { archive.Write3dmChunkVersion(MAJOR, MINOR); archive.WriteDictionary(m_dictionary); }