Ejemplo n.º 1
0
 public void EndFigure()
 {
     UpdateFigureOffsets(_figures.Count - 1, _shapes.Count - 1);
     if (_shapes[_shapes.Count - 1].type == OGCGeometryType.Polygon)
     {
         _vertices[_vertices.Count - 1] = _vertices[_figures[_figures.Count - 1].VertexOffset];
     }
     _state = State.Start;
 }
Ejemplo n.º 2
0
        public void EndFigure()
        {
            if (CurrentOperation != Operation.Figure)
            {
                throw new FormatException($"24301: Expected a call to BeginFigure or End{GeoType}, but EndFigure was called.");
            }

            operationStack.Pop();
            UpdateFigureOffsets(_figures.Count - 1, _shapes.Count - 1);
            if (_shapes[_shapes.Count - 1].type == OGCGeometryType.Polygon)
            {
                _vertices[_vertices.Count - 1] = _vertices[_figures[_figures.Count - 1].VertexOffset];
            }
            _state = State.Start;
        }
Ejemplo n.º 3
0
        public void BeginFigure()
        {
            if (CurrentOperation != Operation.Geo)
            {
                throw new FormatException($"24300: Expected a call to Begin{GeoType}, but BeginFigure was called.");
            }

            FigureAttributes nextFigureAttribute = FigureAttributes.Line;
            var shapeType = _shapes[_shapes.Count - 1].type;

            if (shapeType == OGCGeometryType.CircularString)
            {
                nextFigureAttribute = FigureAttributes.Arc;
            }
            else if (shapeType == OGCGeometryType.CompoundCurve)
            {
                nextFigureAttribute = FigureAttributes.Curve;
            }
            else if (shapeType == OGCGeometryType.CurvePolygon)
            {
                nextFigureAttribute = _nextFigureAttribute;
                if (nextFigureAttribute == FigureAttributes.Curve && _segments == null)
                {
                    _segments = new List <Segment>();
                }
            }
            var figure = new Figure()
            {
                FigureAttribute = nextFigureAttribute,
                VertexOffset    = _vertices.Count
            };

            if (nextFigureAttribute != FigureAttributes.Curve)
            {
                _state = State.Figure;
            }
            else if (_state != State.Segment)
            {
                _state = State.Segment;
            }
            _figures.Add(figure);
            operationStack.Push(Operation.Figure);
        }
Ejemplo n.º 4
0
        public void BeginFigure()
        {
            FigureAttributes nextFigureAttribute = FigureAttributes.Line;
            var shapeType = _shapes[_shapes.Count - 1].type;

            if (shapeType == OGCGeometryType.CircularString)
            {
                nextFigureAttribute = FigureAttributes.Arc;
            }
            else if (shapeType == OGCGeometryType.CompoundCurve)
            {
                nextFigureAttribute = FigureAttributes.Curve;
            }
            else if (shapeType == OGCGeometryType.CurvePolygon)
            {
                nextFigureAttribute = _nextFigureAttribute;
                if (nextFigureAttribute == FigureAttributes.Curve && _segments == null)
                {
                    _segments = new List <Segment>();
                }
            }
            var figure = new Figure()
            {
                FigureAttribute = nextFigureAttribute,
                VertexOffset    = _vertices.Count
            };

            if (nextFigureAttribute != FigureAttributes.Curve)
            {
                _state = State.Figure;
            }
            else if (_state != State.Segment)
            {
                _state = State.Segment;
            }
            _figures.Add(figure);
        }