internal void Detach(GLDrawContext context) { foreach (var primitive in context.Primitives) { _Detach(primitive); } }
private void _UpdateBounds(GLDrawContext context) { var scale = _panel.ScaleX; _bounds = RectF.Empty; _geometryBounds = RectF.Empty; if (context.HasPrimitives) { foreach (var primitive in context.Primitives) { _bounds.Union(primitive.GetBounds(scale)); _geometryBounds.Union(primitive.GetGeometryBounds(scale)); } } }
public GLVisual() { _context1 = new GLDrawContext(this); _context2 = new GLDrawContext(this); _bounds = RectF.Empty; _geometryBounds = RectF.Empty; _hitTestVisible = true; _isDeleted = true; _fillModels = new Dictionary <Color, List <MeshModel> >(); _arrowModels = new Dictionary <Color, List <MeshModel> >(); _streamModels = new List <MeshModel>(); _lineModels = new SortedDictionary <PenF, List <MeshModel> >(); _arcModels = new SortedDictionary <PenF, List <MeshModel> >(); _pointModels = new SortedDictionary <PointPair, List <MeshModel> >(); }
public virtual bool Dispose() { if (IsUpdating) { NeedDispose = true; return(false); } if (_isDisposed) { return(false); } _isDisposed = true; NeedDispose = false; _DisposeModels(); _context1?.Dispose(); _context1 = null; _context2?.Dispose(); _context2 = null; _panel = null; return(true); }
/// <summary> /// Actual drawing logic /// </summary> /// <param name="context"></param> protected abstract void Draw(GLDrawContext context);