示例#1
0
 internal void Detach(GLDrawContext context)
 {
     foreach (var primitive in context.Primitives)
     {
         _Detach(primitive);
     }
 }
示例#2
0
        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));
                }
            }
        }
示例#3
0
        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> >();
        }
示例#4
0
        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);
        }
示例#5
0
 /// <summary>
 /// Actual drawing logic
 /// </summary>
 /// <param name="context"></param>
 protected abstract void Draw(GLDrawContext context);