Example #1
0
        public void Deserialize(OSD cachedMesh)
        {
            OSDArray array = (OSDArray)cachedMesh;

            foreach (OSD triangle in array)
            {
                OSDArray triangleArray = (OSDArray)triangle;
                Add(new Triangle(new Vertex(triangleArray[0].AsVector3()),
                                 new Vertex(triangleArray[1].AsVector3()),
                                 new Vertex(triangleArray[2].AsVector3())));
            }
        }
Example #2
0
        public OSD Serialize()
        {
            OSDArray array = new OSDArray();

            foreach (Triangle t in m_triangles)
            {
                OSDArray triArray = new OSDArray();
                triArray.Add(new Vector3(t.v1.X, t.v1.Y, t.v1.Z));
                triArray.Add(new Vector3(t.v2.X, t.v2.Y, t.v2.Z));
                triArray.Add(new Vector3(t.v3.X, t.v3.Y, t.v3.Z));
                array.Add(triArray);
            }
            return(array);
        }
Example #3
0
        public OSD Serialize()
        {
            OSDArray array = new OSDArray();

            /*foreach (Face t in m_triangles)
             * {
             *  OSDArray triArray = new OSDArray
             *                          {
             *                              new Vector3(t.v1.X, t.v1.Y, t.v1.Z),
             *                              new Vector3(t.v2.X, t.v2.Y, t.v2.Z),
             *                              new Vector3(t.v3.X, t.v3.Y, t.v3.Z)
             *                          };
             *  array.Add(triArray);
             * }*/
            return(array);
        }
        public OSD Serialize()
        {
            OSDArray array = new OSDArray();

            return(array);
        }
 public OSD Serialize ()
 {
     OSDArray array = new OSDArray ();
     /*foreach (Face t in m_triangles)
     {
         OSDArray triArray = new OSDArray
                                 {
                                     new Vector3(t.v1.X, t.v1.Y, t.v1.Z),
                                     new Vector3(t.v2.X, t.v2.Y, t.v2.Z),
                                     new Vector3(t.v3.X, t.v3.Y, t.v3.Z)
                                 };
         array.Add(triArray);
     }*/
     return array;
 }
Example #6
0
        private void memberListContextMenuSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveMembers = new SaveFileDialog();
            saveMembers.Filter = "CSV|.csv|JSON|.json";
            saveMembers.Title = "Save visible group members";
            saveMembers.ShowDialog();
            if (saveMembers.FileName != string.Empty)
            {
                try
                {
                    switch (saveMembers.FilterIndex)
                    {
                        case 1:
                            System.IO.FileStream fs = (System.IO.FileStream)saveMembers.OpenFile();
                            System.IO.StreamWriter sw = new System.IO.StreamWriter(fs, System.Text.Encoding.UTF8);
                            sw.WriteLine("UUID,Name");
                            foreach (ListViewItem item in lvwGeneralMembers.Items)
                            {
                                sw.WriteLine("{0},{1}", item.Name, item.Text);
                            }
                            sw.Close();
                            break;
                        case 2:
                            OpenMetaverse.StructuredData.OSDArray members = new OpenMetaverse.StructuredData.OSDArray(lvwGeneralMembers.Items.Count);
                            foreach (ListViewItem item in lvwGeneralMembers.Items)
                            {
                                OpenMetaverse.StructuredData.OSDMap member = new OpenMetaverse.StructuredData.OSDMap(2);
                                member["UUID"] = item.Name;
                                member["Name"] = item.Text;
                                members.Add(member);
                            }
                            System.IO.File.WriteAllText(saveMembers.FileName, OpenMetaverse.StructuredData.OSDParser.SerializeJsonString(members));
                            break;
                    }

                    instance.TabConsole.DisplayNotificationInChat(string.Format("Saved {0} members to {1}", lvwGeneralMembers.Items.Count, saveMembers.FileName));
                }
                catch (Exception ex)
                {
                    instance.TabConsole.DisplayNotificationInChat("Failed to save member list: " + ex.Message, ChatBufferTextStyle.Error);
                }
            }
        }