예제 #1
0
        public void CloneTest()
        {
            var exp   = new Max(new[] { new Number(1), new Number(2) }, 2);
            var clone = exp.Clone();

            Assert.Equal(exp, clone);
        }
예제 #2
0
        /// <summary>
        /// Creates a geometry (Polygon) that resembles this bounding box.
        /// </summary>
        /// <returns></returns>
        public Geometry ToGeometry()
        {
            var linearRing =
                new LinearRing(new[]
            {
                Min.Clone(), new Point(Min.X, Max.Y),
                Max.Clone(), new Point(Max.X, Min.Y),
                Min.Clone()
            });

            return(new Polygon(linearRing, null));
        }
예제 #3
0
        /// <summary>
        /// Клонирование объекта значения
        /// </summary>
        /// <returns>Клон объекта</returns>
        public override object Clone( )
        {
            SequenceVariable variable = new SequenceVariable(Name, (Value)Value.Clone( ));

            if (Min != null)
            {
                variable.Min = (Value)Min.Clone( );
            }
            if (Max != null)
            {
                variable.Max = (Value)Max.Clone( );
            }
            if (Step != null)
            {
                variable.Step = (Value)Step.Clone( );
            }
            return(variable);
        }
예제 #4
0
        /// <summary>
        /// Клонирование объекта значения
        /// </summary>
        /// <returns>Клон объекта</returns>
        public override object Clone( )
        {
            SystemVariable variable = new SystemVariable(Name, IsReadOnly, (Value)Value.Clone( ));

            if (Min != null)
            {
                variable.Min = (Value)Min.Clone( );
            }
            if (Max != null)
            {
                variable.Max = (Value)Max.Clone( );
            }
            if (Step != null)
            {
                variable.Step = (Value)Step.Clone( );
            }
            variable.IsLookExpression = IsLookExpression;
            return(variable);
        }
예제 #5
0
        /// <summary>
        /// Клонирование объекта значения
        /// </summary>
        /// <returns>Клон объекта</returns>
        public override object Clone( )
        {
            GlobalVariable variable = new GlobalVariable(Name, (Value)Value.Clone( ));

            if (Min != null)
            {
                variable.Min = (Value)Min.Clone( );
            }
            if (Max != null)
            {
                variable.Max = (Value)Max.Clone( );
            }
            if (Step != null)
            {
                variable.Step = (Value)Step.Clone( );
            }
            variable.IsAdd = IsAdd;
            return(variable);
        }
예제 #6
0
파일: Box.cs 프로젝트: sungaoyong/ProSuite
        /// <summary>
        /// set this box to the bounding box of this and point
        /// </summary>
        public void Include([NotNull] Pnt point, int dimension)
        {
            if (Min == Max)
            {
                Min = Min.Clone();
                Max = Max.Clone();
            }

            for (var i = 0; i < dimension; i++)
            {
                if (point[i] < Min[i])
                {
                    Min[i] = point[i];
                }
                else if (point[i] > Max[i])
                {
                    Max[i] = point[i];
                }
            }
        }
예제 #7
0
파일: Box.cs 프로젝트: sungaoyong/ProSuite
        /// <summary>
        /// set this box to the bounding box of this and box
        /// </summary>
        /// <param name="box"></param>
        /// <param name="dimension"></param>
        public void Include([NotNull] IBox box, int dimension)
        {
            if (Min == Max)
            {
                Min = Min.Clone();
                Max = Max.Clone();
            }

            for (var i = 0; i < dimension; i++)
            {
                if (box.Min[i] < Min[i])
                {
                    Min[i] = box.Min[i];
                }

                if (box.Max[i] > Max[i])
                {
                    Max[i] = box.Max[i];
                }
            }
        }
예제 #8
0
파일: Box.cs 프로젝트: sungaoyong/ProSuite
 public Box Clone()
 {
     return(new Box(Min.Clone(), Max.Clone()));
 }