Ejemplo n.º 1
0
        public bool isExist(PointF pointStart, PointF pointEnd, bool isexit)
        {
            FlowDataF fd = new FlowDataF();

            fd.p0     = pointStart;
            fd.p1     = pointEnd;
            fd.isExit = isexit;
            return(listFlow.Contains(fd));
        }
Ejemplo n.º 2
0
        public void AddFlow(PointF pointStart, PointF pointEnd, bool isexit)
        {
            FlowDataF fd = new FlowDataF();

            fd.p0     = pointStart;
            fd.p1     = pointEnd;
            fd.isExit = isexit;
            listFlow.Add(fd);
        }
Ejemplo n.º 3
0
        public FlowDataF getElementF(int index)
        {
            FlowDataF fd = new FlowDataF();

            if (index <= listFlow.Count)
            {
                fd = (FlowDataF)listFlow[index];
            }
            return(fd);
        }
Ejemplo n.º 4
0
        public bool isExist(FlowDataF fdata)
        {
            FlowDataF fd;
            bool      succ = false;

            for (int i = 0; i < listFlow.Count; i++)
            {
                fd = (FlowDataF)listFlow[i];
                if (fd.Equals(fdata))
                {
                    succ = true;
                    break;
                }
            }
            return(succ);
        }
Ejemplo n.º 5
0
        public bool DeleteFlow(FlowDataF fdata)
        {
            FlowDataF fd;
            bool      succ = false;

            for (int i = 0; i < listFlow.Count; i++)
            {
                fd = (FlowDataF)listFlow[i];
                if (fd.Equals(fdata))
                {
                    listFlow.RemoveAt(i);
                    succ = true;
                    break;
                }
            }
            return(succ);
        }
Ejemplo n.º 6
0
        public bool DeleteFlow(PointF pointStart, PointF pointEnd, bool isexit)
        {
            FlowDataF fd = new FlowDataF();
            FlowDataF fdata;

            fd.p0     = pointStart;
            fd.p1     = pointEnd;
            fd.isExit = isexit;
            bool succ = false;

            for (int i = 0; i < listFlow.Count; i++)
            {
                fdata = (FlowDataF)listFlow[i];
                if (fd.Equals(fdata))
                {
                    listFlow.RemoveAt(i);
                    succ = true;
                    break;
                }
            }
            return(succ);
        }
Ejemplo n.º 7
0
        public bool GetCoordinateMinAndMaxFunc(ref PointF MinPoint, ref PointF MaxPoint)
        //函数名:bool GetCoordinateMinAndMaxFunc(ref point MinPoint,ref point MaxPoint )
        //输入:ListFlow待绘制图坐标数组
        //输出:上述坐标集合的最大值和最小值坐标MinPoint,MaxPoint
        //功能描述:获取ListFlow最大值和最小值
        {
            //算法
            //step1、数据有效性检查
            //若 ListFlow==null 则
            if (listFlow == null)
            {
                return(false);
            }
            //若 ListFlow ==0则
            if (listFlow.Count == 0)
            {
                return(false);
            }

            //step2、MinPoint,MaxPoint初始化
            //MinPoint,MaxPoint的X坐标赋值为ListFlow[0]的p0坐标X
            MinPoint.X = ((FlowDataF)(listFlow[0])).p0.X;
            MaxPoint.X = ((FlowDataF)(listFlow[0])).p0.X;

            //MinPoint,MaxPoint的Y坐标赋值为ListFlow[0]的p0坐标Y
            MinPoint.Y = ((FlowDataF)(listFlow[0])).p0.Y;
            MaxPoint.Y = ((FlowDataF)(listFlow[0])).p0.Y;

            FlowDataF FlowDataTemp = new FlowDataF();//

            //Step3、数组循环
            //for i=0 to ListFlow.Length
            for (int i = 0; i < listFlow.Count; i++)
            {
                FlowDataTemp = (FlowDataF)(listFlow[i]);

                //step4、X坐标与最大和最小值比较
                //若 第i个ListFlow坐标X大于MaxPoint坐标X 则
                if (FlowDataTemp.p0.X > MaxPoint.X)
                {
                    //MaxPoint坐标X赋值为第i个ListFlow坐标X
                    MaxPoint.X = FlowDataTemp.p0.X;
                }

                //若 第i个ListFlow坐标X小于MinPoint坐标X 则
                if (FlowDataTemp.p0.X < MinPoint.X)
                {
                    //MinPoint坐标X赋值为第i个ListFlow坐标X
                    MinPoint.X = FlowDataTemp.p0.X;
                }


                //Y坐标与最大和最小值比较
                //若 第i个ListFlow坐标Y大于MaxPoint坐标Y 则
                if (FlowDataTemp.p0.Y > MaxPoint.Y)
                {
                    //MaxPoint坐标Y赋值为第i个ListFlow坐标Y
                    MaxPoint.Y = FlowDataTemp.p0.Y;
                }
                //若 第i个ListFlow坐标Y小于MinPoint坐标Y 则
                if (FlowDataTemp.p0.Y < MinPoint.Y)
                {
                    //MinPoint坐标Y赋值为第i个ListFlow坐标Y
                    MinPoint.Y = FlowDataTemp.p0.Y;
                }
            }//step5、跳到step3

            //step6、返回true
            return(true);
        }
Ejemplo n.º 8
0
 public void AddFlow(FlowDataF fdata)
 {
     listFlow.Add(fdata);
 }