Example #1
0
 void Clear()
 {
     Values = new double[0, 0, 0];
     Title  = "Prop_" + (Namber++).ToString();
     Scale  = new PropScale();
     Groups = new List <ModifiersGroup>();
 }
Example #2
0
 public Prop(string title, double[,,] values, List <ModifiersGroup> mg, PropScale scale)
 {
     this.Title  = title;
     this.Values = values;
     this.Groups = mg;
     this.Scale  = scale;
 }
Example #3
0
        public static Prop Read(BinaryReader reader)
        {
            byte version = reader.ReadByte();

            switch (version)
            {
            case Version0:
            {
                string title = reader.ReadString();
                int    nx    = reader.ReadInt32();
                int    ny    = reader.ReadInt32();
                int    nz    = reader.ReadInt32();
                double[,,] values = new double[nx, ny, nz];
                for (int i = 0; i < nx; ++i)
                {
                    for (int j = 0; j < ny; ++j)
                    {
                        for (int k = 0; k < nz; ++k)
                        {
                            values[i, j, k] = reader.ReadDouble();
                        }
                    }
                }
                int nm = reader.ReadInt32();
                List <ModifiersGroup> mg = new List <ModifiersGroup>();
                for (int m = 0; m < nm; ++m)
                {
                    mg.Add(ModifiersGroup.Read(reader));
                }
                PropScale scale = PropScale.Read(reader);
                return(new Prop(title, values, mg, scale));
            }

            default:
                return(new Prop());
            }
        }