Ejemplo n.º 1
0
        public IPluginViewSettings Add2DView(EventType eventType, Panel hostControl)
        {
            IPluginViewSettings pluginViewSettings = new DepthPlugin2DViewSettings();

#if TODO_PLAYING_AROUND
            if (hostControl != null)
            {
                Border border = new Border()
                {
                    BorderBrush         = System.Windows.Media.Brushes.Yellow,
                    BorderThickness     = new System.Windows.Thickness(2),
                    HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch
                };
                border.SetValue(Canvas.LeftProperty, 256.0);
                border.SetValue(Canvas.TopProperty, 200.0);
                TextBlock text = new TextBlock()
                {
                    Text                = "TEST",
                    Foreground          = System.Windows.Media.Brushes.Blue,
                    HorizontalAlignment = System.Windows.HorizontalAlignment.Right
                };
                border.Child = text;
                hostControl.Children.Add(border);
            }
#endif // TODO_PLAYING_AROUND

            return(pluginViewSettings);
        }
        private DepthPlugin2DViewSettings(DepthPlugin2DViewSettings source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            this.viewType = source.viewType;
        }
Ejemplo n.º 3
0
        // object owning data should be locked
        private static void UpdateData(DepthPlugin2DViewSettings pluginViewSettings, EventTypePluginData data)
        {
            Debug.Assert(data != null);

            if ((pluginViewSettings != null) && (data.depthMap != null) && (data.depthTexture != null))
            {
                switch (pluginViewSettings.ViewType)
                {
                case DepthPlugin2DViewSettings.Depth2DViewType.Color:
                    data.depthMap.RampConversion(data.depthTexture, viz.DepthRampMode.Color);
                    break;

                case DepthPlugin2DViewSettings.Depth2DViewType.Grey:
                    data.depthMap.RampConversion(data.depthTexture, viz.DepthRampMode.Grey);
                    break;

                default:
                    Debug.Assert(false);
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        private viz.Texture GetTexture(IPluginViewSettings pluginViewSettings, EventTypePluginData data)
        {
            Debug.Assert(data != null);

            viz.Texture value = null;

            lock (this.lockObj)
            {
                if (data.sharedDepthFrame != null)
                {
                    DepthPlugin2DViewSettings depth2DSettingsViewSettings = pluginViewSettings as DepthPlugin2DViewSettings;
                    if (depth2DSettingsViewSettings != null)
                    {
                        DepthPlugin.UpdateData(depth2DSettingsViewSettings, data);

                        value = data.depthTexture;
                    }
                }
            }

            return(value);
        }
        private DepthPlugin2DViewSettings(DepthPlugin2DViewSettings source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            this.viewType = source.viewType;
        }
        // object owning data should be locked 
        private static void UpdateData(DepthPlugin2DViewSettings pluginViewSettings, EventTypePluginData data)
        {
            Debug.Assert(data != null);

            if ((pluginViewSettings != null) && (data.depthMap != null) && (data.depthTexture != null))
            {
                switch (pluginViewSettings.ViewType)
                {
                    case DepthPlugin2DViewSettings.Depth2DViewType.Color:
                        data.depthMap.RampConversion(data.depthTexture, viz.DepthRampMode.Color);
                        break;

                    case DepthPlugin2DViewSettings.Depth2DViewType.Grey:
                        data.depthMap.RampConversion(data.depthTexture, viz.DepthRampMode.Grey);
                        break;

                    default:
                        Debug.Assert(false);
                        break;
                }
            }
        }
        public IPluginViewSettings Add2DView(EventType eventType, Panel hostControl)
        {
            IPluginViewSettings pluginViewSettings = new DepthPlugin2DViewSettings();

#if TODO_PLAYING_AROUND
            if (hostControl != null)
            {
                Border border = new Border()
                    {
                        BorderBrush = System.Windows.Media.Brushes.Yellow,
                        BorderThickness = new System.Windows.Thickness(2),
                        HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch
                    };
                border.SetValue(Canvas.LeftProperty, 256.0);
                border.SetValue(Canvas.TopProperty, 200.0);
                TextBlock text = new TextBlock()
                    {
                        Text = "TEST",
                        Foreground = System.Windows.Media.Brushes.Blue,
                        HorizontalAlignment = System.Windows.HorizontalAlignment.Right
                    };
                border.Child = text;
                hostControl.Children.Add(border);
            }
#endif // TODO_PLAYING_AROUND

            return pluginViewSettings;
        }