Beispiel #1
0
        /*
         * public void Dispose()
         * {
         *  foreach (Mesh m in this._meshCache)
         *  {
         *      m.Dispose();
         *  }
         * }*/


        public override bool Write(GH_IWriter writer)
        {
            base.Write(writer);

            try {
                writer.RemoveChunk("PersistentData");
                writer.SetInt32("GridCount", PersistentData.DataCount);

                var total = 0;
                for (var i = 0; i < PersistentData.Branches.Count; i++)
                {
                    var path = PersistentData.Paths[i];
                    foreach (var ghvg in PersistentData.Branches[i])
                    {
                        var currentGrid = writer.CreateChunk("Grid", total);
                        currentGrid.SetString("Data", ByteHelper.ByteToHex(ByteHelper.Compress(ByteHelper.ToByte(ghvg.Value))));
                        currentGrid.SetString("Path", path.ToString());
                        total++;
                    }
                }
                return(true);
            } catch (Exception e) {
                AddRuntimeMessage(GH_RuntimeMessageLevel.Error, e + " " + e.StackTrace);
                return(true);
            }
        }