Example #1
0
        public MultiValueTable CreateValueTable(List <double> _Xs, string _unit_x,
                                                List <double> _Ys, string _unit_y,
                                                List <double> _Zs, string _unit_z,
                                                List <double> _Fs, bool _can_interpolate, string _name)
        {
            // determine which constructor to call
            if (_Fs == null || _Fs.Count < 1)
            {
                return(null);
            }
            if (_Xs == null || _Xs.Count < 1)
            {
                return(null);
            }

            MultiValueTable created = null;

            if (_Ys == null || _Ys.Count < 2)
            {
                created = new MultiValueTable1D(_Xs, _unit_x, _unit_y, _unit_z, _Fs, _can_interpolate, _name);
            }
            else if (_Zs == null || _Zs.Count < 2)
            {
                created = new MultiValueTable2D(_Xs, _unit_x, _Ys, _unit_y, _unit_z, _Fs, _can_interpolate, _name);
            }
            else
            {
                created = new MultiValueTable3D(_Xs, _unit_x, _Ys, _unit_y, _Zs, _unit_z, _Fs, _can_interpolate, _name);
            }

            // check if a valid value table was created
            if (created == null)
            {
                return(null);
            }
            if (created.NrX == 0)
            {
                return(null);
            }

            this.value_record.Add(created);
            return(created);
        }
Example #2
0
 protected MultiValueTable2D(MultiValueTable2D _original)
     : base(_original)
 {
 }
Example #3
0
        // only call when parsing
        internal MultiValueTable ReconstructTable(long _id, string _name, bool _can_interpolate, MultiValPointer _disp_vect,
                                                  int _nr_x, double _min_x, double _max_x, string _unit_x,
                                                  int _nr_y, double _min_y, double _max_y, string _unit_y,
                                                  int _nr_z, double _min_z, double _max_z, string _unit_z,
                                                  List <double> _Xs, List <double> _Ys, List <double> _Zs, Dictionary <Point3D, double> _Fs)
        {
            if (_id < 0)
            {
                return(null);
            }
            // determine which constructor to call
            if (_Fs == null || _Fs.Count < 1)
            {
                return(null);
            }
            if (_Xs == null || _Xs.Count < 1)
            {
                return(null);
            }

            MultiValueTable created = null;

            if (_Ys == null || _Ys.Count < 2)
            {
                created = new MultiValueTable1D(_id, _name, _can_interpolate, _disp_vect,
                                                _nr_x, _min_x, _max_x, _unit_x,
                                                _Xs, _unit_y, _unit_z, _Fs);
            }
            else if (_Zs == null || _Zs.Count < 2)
            {
                created = new MultiValueTable2D(_id, _name, _can_interpolate, _disp_vect,
                                                _nr_x, _min_x, _max_x, _unit_x,
                                                _nr_y, _min_y, _max_y, _unit_y,
                                                _Xs, _Ys, _unit_z, _Fs);
            }
            else
            {
                created = new MultiValueTable3D(_id, _name, _can_interpolate, _disp_vect,
                                                _nr_x, _min_x, _max_x, _unit_x,
                                                _nr_y, _min_y, _max_y, _unit_y,
                                                _nr_z, _min_z, _max_z, _unit_z,
                                                _Xs, _Ys, _Zs, _Fs);
            }

            // check if a valid value table was created
            if (created == null)
            {
                return(null);
            }
            if (created.NrX == 0)
            {
                return(null);
            }

            // create
            this.value_record.Add(created);
            // adjust type counter
            MultiValue.NR_MULTI_VALUES = Math.Max(MultiValue.NR_MULTI_VALUES, created.MVID);
            // done
            return(created);
        }