Esempio n. 1
0
        //追踪一条封闭的等值线
        private void TracingOneClosedContour()
        {
            int rows    = _accessContour.GridInfo._rows;    //这里是网格点的行列数
            int columns = _accessContour.GridInfo._columns;

            int startI = _curIsoPoint._row;
            int startJ = _curIsoPoint._column;

            _isoPointListInfo = new IsoPointListInfo();
            List <IsoPoint> isoPointList = new List <IsoPoint>();

            _isoPointListInfo._aIsoPointList = isoPointList;
            _isoPointListInfo._value         = _curFollowingValue;

            CalcCoord(_curIsoPoint._row, _curIsoPoint._column, false);

            TracingNextPoint();

            _preIsoPoint = _curIsoPoint;
            _curIsoPoint = _nextIsoPoint;

            bool isClosed = false;

            while (!isClosed)
            {
                TracingNextPoint();

                _preIsoPoint = _curIsoPoint;
                _curIsoPoint = _nextIsoPoint;

                isClosed = (_curIsoPoint._row == startI) && (_curIsoPoint._column == startJ) && (false == _curIsoPoint._isHorizon);
            }

            _allIsoPointList.Add(_isoPointListInfo);
        }
Esempio n. 2
0
        //追踪一条等值线
        //这个函数要完成一条等值线追踪的所有操作
        private void TracingOneNonClosedContour()
        {
            int rows    = _accessContour.GridInfo._rows;    //这里是网格点的行列数
            int columns = _accessContour.GridInfo._columns;

            _isoPointListInfo = new IsoPointListInfo();
            List <IsoPoint> isoPointList = new List <IsoPoint>();

            _isoPointListInfo._aIsoPointList = isoPointList;
            _isoPointListInfo._value         = _curFollowingValue;

            CalcCoord(_curIsoPoint._row, _curIsoPoint._column, _curIsoPoint._isHorizon);

            if (_curIsoPoint._isHorizon)
            {
                _xSide[_curIsoPoint._row, _curIsoPoint._column]._isIsoPoint = false;
            }
            else
            {
                _ySide[_curIsoPoint._row, _curIsoPoint._column]._isIsoPoint = false;
            }

            TracingNextPoint();

            _preIsoPoint = _curIsoPoint;
            _curIsoPoint = _nextIsoPoint;

            bool isFinish = (_curIsoPoint._row == 0 && _curIsoPoint._isHorizon) || (_curIsoPoint._column == 0 && !_curIsoPoint._isHorizon) ||
                            (_curIsoPoint._row == rows - 1) || (_curIsoPoint._column == columns - 1);

            while (!isFinish)
            {
                TracingNextPoint();

                _preIsoPoint = _curIsoPoint;
                _curIsoPoint = _nextIsoPoint;

                isFinish = (_curIsoPoint._row == 0 && _curIsoPoint._isHorizon) || (_curIsoPoint._column == 0 && !_curIsoPoint._isHorizon) ||
                           (_curIsoPoint._row == rows - 1) || (_curIsoPoint._column == columns - 1);
            }

            _allIsoPointList.Add(_isoPointListInfo);
        }