Beispiel #1
0
 public void SetRenderer(ISourceRenderer renderer)
 {
     foreach (var child in Children)
     {
         child.SetRenderer(renderer);
     }
 }
 public void SetRenderer(ISourceRenderer renderer)
 {
     if (renderer is ICloudRenderer <SlamLine> typedRenderer)
     {
         OnAdded          += typedRenderer.OnItemsAdded;
         OnUpdated        += typedRenderer.OnItemsUpdated;
         OnRemoved        += typedRenderer.OnItemsRemoved;
         OnVisibleChanged += visible =>
         {
             if (visible)
             {
                 typedRenderer.OnItemsAdded(this, new AddedEventArgs <SlamLine>(this));
             }
             else
             {
                 typedRenderer.OnClear(this);
             }
         };
         if (Count > 0)
         {
             OnAdded?.Invoke(this, new AddedEventArgs <SlamLine>(this));
         }
     }
     else if (renderer is TrackedObjectCloud trackedRenderer)
     {
         OnFollowed   += trackedRenderer.FollowCamera;
         OnUnfollowed += trackedRenderer.StopFollowCamera;
     }
 }
Beispiel #3
0
 public void SetRenderer(ISourceRenderer renderer)
 {
     if (renderer is IMeshRenderer meshRenderer)
     {
         OnMeshUpdated += meshRenderer.OnMeshUpdated;
     }
 }
Beispiel #4
0
        public void SetRenderer(ISourceRenderer renderer)
        {
            _traceContainer.SetRenderer(renderer);
            if (!(renderer is ICloudRenderer <TCloudItem> typedRenderer))
            {
                return;
            }
            OnAdded          += typedRenderer.OnItemsAdded;
            OnUpdated        += typedRenderer.OnItemsUpdated;
            OnRemoved        += typedRenderer.OnItemsRemoved;
            OnVisibleChanged += visible =>
            {
                if (visible)
                {
                    typedRenderer.OnItemsAdded(this, new AddedEventArgs <TCloudItem>(this));
                }
                else
                {
                    typedRenderer.OnClear(this);
                }
            };

            if (Count > 0)
            {
                typedRenderer.OnItemsAdded(this, new AddedEventArgs <TCloudItem>(this));
            }
        }
 public override void SetRenderer(ISourceRenderer renderer)
 {
     if (renderer is not ICloudRenderer <SlamPoint> pointRenderer)
     {
         return;
     }
     OnShow  += pointRenderer.ShowItems;
     OnClear += pointRenderer.OnClear;
 }
Beispiel #6
0
 public void SetRenderer(ISourceRenderer dataRenderer)
 {
     if (dataRenderer is WindowsManager factory)
     {
         factory.CreateWindow <SlamInfoRenderer>(DisplayName, (renderer, window) =>
         {
             _info  = renderer;
             Window = window;
         });
     }
 }
 public void SetRenderer(ISourceRenderer renderer)
 {
     if (renderer is WindowsManager factory)
     {
         factory.CreateWindow <TRenderer>(Title, (r, window) =>
         {
             Renderer = r;
             Window   = window;
             SetRendererCallback();
         });
     }
 }
        public void SetRenderer(ISourceRenderer renderer)
        {
            switch (renderer)
            {
            case ICloudRenderer <SlamTrackedObject> trackedRenderer:
                OnAdded          += trackedRenderer.OnItemsAdded;
                OnUpdated        += trackedRenderer.OnItemsUpdated;
                OnRemoved        += trackedRenderer.OnItemsRemoved;
                OnVisibleChanged += visible =>
                {
                    if (visible)
                    {
                        trackedRenderer.OnItemsAdded(this, new AddedEventArgs <SlamTrackedObject>(this));
                    }
                    else
                    {
                        trackedRenderer.OnClear(this);
                    }
                };
                if (Count > 0)
                {
                    OnAdded?.Invoke(this, new AddedEventArgs <SlamTrackedObject>(this));
                }

                _trackedObjsRenderer = trackedRenderer;
                break;

            case ICloudRenderer <SlamLine> lineRenderer:
                _lineRenderer = lineRenderer;
                lock (_lineContainers)
                {
                    foreach (var container in _lineContainers)
                    {
                        container.SetRenderer(_lineRenderer);
                    }
                }

                break;
            }
        }
 public abstract void SetRenderer(ISourceRenderer renderer);
 public void SetRenderer(ISourceRenderer renderer)
 {
     _renderers.Add(renderer);
 }