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; }
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; }
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); }
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); }