Esempio n. 1
0
        //Layer clarification
        public string layerClarification(int[] rightLeftMost, double [] arrayX, double [] arrayY, bool[,] isLine, int numberOfPoint)
        {
            //layer data
            string layerInfo = "";

            //reset predata of layer
            mListLayer.Clear();

            //visited tracking array
            bool [] isVisited = new bool [numberOfPoint];
            for (int i = 0; i < numberOfPoint; i++)
            {
                isVisited[i] = false;
            }

            for (int i = 0; i < rightLeftMost.Length; i++)
            {
                //Create new layer then add points to it
                LayerUtils addLayer = new LayerUtils();

                PointUtils addPoint = new PointUtils();
                addPoint.setXY(arrayX[rightLeftMost[i]], arrayY[rightLeftMost[i]]);
                addLayer.addPointToLayer(addPoint);
                isVisited[rightLeftMost[i]] = true;

                for (int j = 0; j < numberOfPoint; j++)
                {
                    if (isLine[rightLeftMost[i], j] && !isVisited[j])
                    {
                        if ((arrayY[rightLeftMost[i]] >= arrayY[j]))
                        {
                            isVisited[j] = true;
                            PointUtils addPoint2 = new PointUtils();
                            addPoint.setXY(arrayX[j], arrayY[j]);
                            addLayer.addPointToLayer(addPoint2);
                        }
                    }
                }
                mListLayer.Add(addLayer);
            }
            for (int i = 0; i < mListLayer.Count; i++)
            {
                layerInfo += "\nDistance/High of Layer : " + i;
                layerInfo += mListLayer[i].toStringData().ToString();
            }

            return(layerInfo);
        }
Esempio n. 2
0
        public string getStringResult()
        {
            string str = "";

            for (int i = 0; i < numberSet; i++)
            {
                //Create new layer then add points to it
                LayerUtils addLayer = new LayerUtils();

                //Console.Write("Layer {0} : \n", i);
                str += "Layer " + i + " : \n";
                for (int j = 0; j < numberPointOfSet[i]; j++)
                {
                    //Console.Write("x = {0}\ty = {1}\n", resultX[i, j], resultY[i, j]);
                    str += "x = " + resultX[i, j] + "\ty = " + resultY[i, j] + "\n";
                    PointUtils addPoint = new PointUtils();
                    addPoint.setXY(resultX[i, j], resultY[i, j]);
                    addLayer.addPointToLayer(addPoint);
                }
                mListLayer.Add(addLayer);

                //Console.Write("\n");
                str += "\n";
            }

            calculateHighDistance(mListLayer, zeroPoint, getMss());
            for (int i = 0; i < mListLayer.Count; i++)
            {
                str += "\nDistance/High of Layer : " + i;
                str += mListLayer[i].toStringData().ToString();
            }
            return(str);
        }