Beispiel #1
0
 protected override void AddToSceneCore(View3d.Window window)
 {
     if (Gfx != null)
     {
         window.AddObject(Gfx);
     }
 }
Beispiel #2
0
        public View3dControl(string name, bool gdi_compatible_backbuffer)
        {
            try
            {
                BackColor = Color.Gray;
                if (this.IsInDesignMode())
                {
                    return;
                }
                SetStyle(ControlStyles.Selectable, false);

                View3d        = View3d.Create();
                Window        = new View3d.Window(View3d, Handle, gdi_compatible_backbuffer, dbg_name: name);
                Window.Error += (s, a) => ReportError?.Invoke(this, new ReportErrorEventArgs(a.Message));

                InitializeComponent();

                Name                     = name;
                ClickTimeMS              = 180;
                MouseNavigation          = true;
                DefaultKeyboardShortcuts = true;
            }
            catch
            {
                Dispose();
                throw;
            }
        }
Beispiel #3
0
 protected override void AddToSceneCore(View3d.Window window)
 {
     if (Gfx != null)
     {
         // Graphics are created at the origin, position at XAxis.Max
         Gfx.O2P = m4x4.Translation((float)Chart.XAxis.Max, 0, ChartUI.Z.SnR);
         window.AddObject(Gfx);
     }
 }
Beispiel #4
0
 protected override void AddToSceneCore(View3d.Window window)
 {
     if (Gfx == null)
     {
         return;
     }
     Gfx.O2P = m4x4.Translation(0f, (float)Chart.YAxis.Min, ChartUI.Z.Indicators);
     window.AddObject(Gfx);
 }
Beispiel #5
0
        protected override void AddToSceneCore(View3d.Window window)
        {
            var pd = Instrument.PriceData;

            if (GfxAsk != null)
            {
                GfxAsk.O2P = m4x4.Translation((float)Chart.XAxis.Max, (float)pd.AskPrice, 0);
                window.AddObject(GfxAsk);
            }
            if (GfxBid != null)
            {
                GfxBid.O2P = m4x4.Translation((float)Chart.XAxis.Max, (float)pd.BidPrice, 0);
                window.AddObject(GfxBid);
            }
        }
Beispiel #6
0
        public View3dControl()
        {
            InitializeComponent();
            Stretch           = Stretch.Fill;
            StretchDirection  = StretchDirection.Both;
            UseLayoutRounding = true;
            Focusable         = true;

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                return;
            }

            try
            {
                // Initialise View3d in off-screen only mode (i.e. no window handle)
                View3d        = View3d.Create();
                Window        = new View3d.Window(View3d, IntPtr.Zero);
                Window.Error += (s, a) => OnReportError(new ReportErrorEventArgs(a.Message));
                Camera.Lookat(new v4(0, 0, 10, 1), v4.Origin, v4.YAxis);
                Camera.ClipPlanes(0.01f, 1000f, true);

                // Create a D3D11 off-screen render target image source
                Source = D3DImage = new D3D11Image();

                // Set defaults
                BackgroundColour         = Window.BackgroundColour;
                DesiredPixelAspect       = 1;
                ClickTimeMS              = 180;
                MouseNavigation          = true;
                DefaultKeyboardShortcuts = true;
                ViewPreset = EViewPreset.Current;

                // Default context menu implementation
                if (ContextMenu != null && ContextMenu.DataContext == null)
                {
                    ContextMenu.DataContext = this;
                }

                InitCommands();
                DataContext = this;
            }
            catch
            {
                Dispose();
                throw;
            }
        }
        public View3dLightingUI(Window owner, View3d.Window window)
        {
            InitializeComponent();
            Owner    = owner;
            Icon     = owner?.Icon;
            m_window = window;

            Light    = new View3d.Light(m_window.LightProperties);
            PinState = new PinData(this, EPin.Centre);

            SetAmbientColour  = Command.Create(this, SetAmbientColourInternal);
            SetDiffuseColour  = Command.Create(this, SetDiffuseColourInternal);
            SetSpecularColour = Command.Create(this, SetSpecularColourInternal);
            Accept            = Command.Create(this, AcceptInternal);

            DataContext = this;
        }
        public View3dObjectManagerUI(Window owner, View3d.Window window, IEnumerable <Guid>?exclude = null)
        {
            InitializeComponent();
            Owner = owner;
            Icon  = Owner?.Icon;

            PinState      = new PinData(this, EPin.Centre);
            ObjectManager = new View3d.ObjectManager(window, exclude ?? Array.Empty <Guid>());
            ObjectsView   = new ListCollectionView(ObjectManager.Objects);

            ExpandAll         = Command.Create(this, ExpandAllInternal);
            CollapseAll       = Command.Create(this, CollapseAllInternal);
            ApplyFilter       = Command.Create(this, ApplyFilterInternal);
            SetVisible        = Command.Create(this, SetVisibleInternal);
            SetWireframe      = Command.Create(this, SetWireframeInternal);
            UpdateSelected    = Command.Create(this, UpdateSelectedInternal);
            InvertSelection   = Command.Create(this, InvertSelectionInternal);
            ToggleShowNormals = Command.Create(this, InternalToggleShowNormals);

            DataContext = this;
        }
Beispiel #9
0
 /// <summary>Add the graphics associated with this element to the drawset</summary>
 protected override void AddToSceneCore(View3d.Window window)
 {
     window.AddObject(m_gfx);
 }