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 BeginGeo(OGCGeometryType type) { Shape shape = new Shape() { ParentOffset = _parents.Peek(), FigureOffset = -1, type = type }; if (type == OGCGeometryType.CompoundCurve && _segments == null) { _segments = new List <Segment>(); } else if (type == OGCGeometryType.CurvePolygon) { _nextFigureAttribute = FigureAttributes.Point; } _parents.Push(_shapes.Count); _shapes.Add(shape); }
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); }