Esempio n. 1
0
        public Galaxy(GraphicsDevice pGraphicsDevice, SharedList pSharedList, ContentManager pContentManager, Camera pCamera, HeightMap heightMap)
        {
            _sharedList = pSharedList;

            /*_emiters.Add(new Emiter(new Vector3(50f, 100f, 50f), new Vector3(-0.5f, 0f, -0.5f), _sharedList));
             *
             * _emiters.Add(new Emiter(new Vector3(0f, 100f, 0f), new Vector3(1.0f, 5f, 1.0f), _sharedList));
             * _emiters.Add(new Emiter(new Vector3(100f, 100f, 0f), new Vector3(-1.0f, 5f, 1.0f), _sharedList));
             * _emiters.Add(new Emiter(new Vector3(0f, 100f, 100f), new Vector3(1.0f, 5f, -1.0f), _sharedList));
             * _emiters.Add(new Emiter(new Vector3(100f, 100f, 100f), new Vector3(-1.0f, 5f, -1.0f), _sharedList));
             *
             * _emiters.Add(new Emiter(new Vector3(-100f, 100f, -100f), new Vector3(1.0f, 5f, 1.0f), _sharedList));
             * _emiters.Add(new Emiter(new Vector3(-200f, 100f, -100f), new Vector3(1.0f, 5f, 1.0f), _sharedList));
             * _emiters.Add(new Emiter(new Vector3(-100f, 100f, -200f), new Vector3(1.0f, 5f, 1.0f), _sharedList));
             * _emiters.Add(new Emiter(new Vector3(-200f, 100f, -200f), new Vector3(1.0f, 5f, 1.0f), _sharedList));*/

            _emiters.Add(new LinearEmiter(new Vector3(-100f, 100f, -100f), new Vector3(1.0f, 5f, 1.0f), _sharedList));

            _camera         = pCamera;
            _graphicsDevice = pGraphicsDevice;
            _contentManager = pContentManager;

            _heightMap = heightMap;

            _drawEngine   = new DrawEngine(pGraphicsDevice, pContentManager, _sharedList);
            _physicEngine = new PhysicEngine(pGraphicsDevice, pContentManager, _sharedList, _heightMap);
        }
Esempio n. 2
0
        private void DrawAll(Graphics g)
        {
            BlockOfFlats block = BlockOfFlats.GetKLadviBlockOfFlats();
            //CanvasContext context = new CanvasContext(0, 0, panelCanvas.Width, panelCanvas.Height);
            CanvasContext context = new CanvasContext(panelCanvas.ClientRectangle.Left, panelCanvas.ClientRectangle.Top, panelCanvas.ClientRectangle.Width, panelCanvas.ClientRectangle.Height);

            block.DrawSelf(g, context);
            DrawEngine drawEngine = new DrawEngine(block, g, context);
            //drawEngine.DrawAllElements();

            Window window = Window.GetStandardWindow();
            //CanvasContext context2 = new CanvasContext(0, 0, panelCanvas.Width, panelCanvas.Height);
            CanvasContext context2 = new CanvasContext(panelCanvas.ClientRectangle.Left, panelCanvas.ClientRectangle.Top, panelCanvas.ClientRectangle.Width, panelCanvas.ClientRectangle.Height);

            window.DrawSelf(g, context2);

            Door door = Door.GetSingleDoor();

            door.DrawSelf(g, context);

            //Floor floor = Floor.GetGroundFloor();
            ////Floor floor = Floor.GetFirstFloor();
            //CanvasContext context = new CanvasContext(panelCanvas.ClientRectangle.Left, panelCanvas.ClientRectangle.Top, panelCanvas.ClientRectangle.Width, panelCanvas.ClientRectangle.Height);
            ////floor.DrawSelf(g, context);
            //DrawEngine drawEngine = new DrawEngine(floor, g, context);
            //drawEngine.DrawAllElements();
        }
Esempio n. 3
0
 public virtual void DrawLine(Bitmap bitmap, AET_entry_base to, int y, Point relativePosition)
 {
     if (beforeDraw(to, y))
     {
         for (int k = (int)x; k < (int)to.x; k++)
         {
             DrawEngine.DrawPixel(bitmap, k + relativePosition.X, y + relativePosition.Y, xStep(to, k, y));
         }
     }
 }
        public ContiniousMovementControl()
        {
            this.InitializeComponent();
            this._drawEngine = new DrawEngine(this._multiplier);

            this.labelPanTiltPosition.Text = string.Empty;
            this.labelError.Text           = string.Empty;

            this.buttonStart.Enabled         = true;
            this.buttonStartRelative.Enabled = true;
            this.buttonStop.Enabled          = false;
        }
Esempio n. 5
0
        private void GLControl_Load(object sender, EventArgs e)
        {
            this._GLControlLoaded = true;
            GLControl.MakeCurrent();
            Engine = new DrawEngine();
            GLSLShaderRenderer Render = new GLSLShaderRenderer();

            Render.RenderDestination = this.GLControl;
            Render.TargetType        = RenderTargetType.Editor;
            Engine.CurrentRenderer   = Render;
            GLSLShaderMaterialTranslator Translator = new GLSLShaderMaterialTranslator();

            Engine.CurrentTranslator = Translator;
            Engine.SetDefaults();
        }
        public static void SetMultiplatformSupport()
        {
            try
            {
                // Set the optional multi-platform support
                // Refer to https://www.leadtools.com/help/leadtools/v20/dh/to/leadtools-drawing-engine-and-multi-platform-consideration.html

                // Get the current options
                DrawEngineOptions options = DrawEngine.GetOptions();

                var drawEngineTypeString = ServiceHelper.GetSettingValue(ServiceHelper.Key_Application_DrawEngineType);
                if (!string.IsNullOrEmpty(drawEngineTypeString))
                {
                    options.EngineType = (DrawEngineType)Enum.Parse(typeof(DrawEngineType), drawEngineTypeString, true);
                }

                var shadowFontModeString = ServiceHelper.GetSettingValue(ServiceHelper.Key_Application_ShadowFontMode);
                if (!string.IsNullOrEmpty(shadowFontModeString))
                {
                    options.ShadowFontMode = (DrawShadowFontMode)Enum.Parse(typeof(DrawShadowFontMode), shadowFontModeString, true);
                }

                DrawEngine.SetOptions(options);

                // Set the shadow fonts directory
                string shadowFontsDirectory = GetSettingValue(ServiceHelper.Key_Application_ShadowFontsDirectory);
                shadowFontsDirectory = ServiceHelper.GetAbsolutePath(shadowFontsDirectory);
                if (!string.IsNullOrEmpty(shadowFontsDirectory))
                {
                    if (Directory.Exists(shadowFontsDirectory))
                    {
                        // Set the shadow fonts
                        RasterDefaults.SetResourceDirectory(LEADResourceDirectory.Fonts, shadowFontsDirectory);
                    }
                    else
                    {
                        throw new InvalidOperationException(string.Format("Unable to set shadow fonts because the file {0} does not exist or is not a directory.", shadowFontsDirectory));
                    }
                }

                _multiplatformSupportStatus = "Ready";
            }
            catch
            {
                _multiplatformSupportStatus = "Error";
                throw;
            }
        }
Esempio n. 7
0
        private void DrawAll(Graphics g)
        {
            BlockOfFlats  block   = BlockOfFlats.GetKLadviBlockOfFlats();
            CanvasContext context = new CanvasContext(0, 0, panelCanvas.Width, panelCanvas.Height);

            block.DrawSelf(g, context);
            DrawEngine drawEngine = new DrawEngine(block, g, context);

            drawEngine.DrawAllElements();

            Window window = Window.GetStandardWindow();

            window.DrawSelf(g, context);
            Door door = Door.GetSingleDoor();

            door.DrawSelf(g, context);
        }
        public FastMovementControl()
        {
            this.InitializeComponent();
            this._drawEngine = new DrawEngine(this._drawEngineMultiplier);

            this.labelError.Text   = string.Empty;
            this._lastPosition     = new PanTiltPosition();
            this._currentPtIndices = 0;
            this._movementInfos    = new List <FastMovementInfo>();

            this._bindingSource.DataSource = this._movementInfos;
            this.dataGridViewFastMovement.AutoGenerateColumns = false;
            this.dataGridViewFastMovement.DataSource          = this._bindingSource;

            this._ptUpdateTimer          = new Timer();
            this._ptUpdateTimer.Elapsed += UpdateTimerElapsed;
            this._ptUpdateTimer.Interval = 250;
        }
Esempio n. 9
0
 public void Render(Bitmap bitmap, Point relativePosition)
 {
     if (!Active && renderedOnStable && lastRelativePosition == relativePosition)
     {
         foreach (var point in Points)
         {
             DrawEngine.DrawPixel(bitmap, point.Key.X, point.Key.Y, point.Value);
         }
     }
     else
     {
         DrawEngine.MidpointLineDrawer(bitmap, new Point(Position.X + relativePosition.X, Position.Y + relativePosition.Y),
                                       new Point(End.X + relativePosition.X, End.Y + relativePosition.Y), Color.Gray, out Points);
         if (!Active)
         {
             renderedOnStable     = true;
             lastRelativePosition = relativePosition;
         }
     }
 }
Esempio n. 10
0
 public override void Draw(GameTime gameTime)
 {
     DrawEngine.QueueSpriteForDraw(this.Sprite);
 }
Esempio n. 11
0
        public Main()
        {
            this.InitializeComponent();

            this._deviceConfigurationHelper = new DeviceConfigurationHelper();
            this._deviceConfiguration       = this._deviceConfigurationHelper.LoadConfig("default");

            using (var dialog = new ConfigDialog(_deviceConfiguration))
            {
                dialog.StartPosition = FormStartPosition.CenterParent;
                var dialogResult = dialog.ShowDialog(this);
                switch (dialogResult)
                {
                case DialogResult.OK:
                    this._deviceConfiguration = dialog.DeviceConfiguration;
                    this._deviceConfigurationHelper.SaveConfig("default", this._deviceConfiguration);
                    break;

                case DialogResult.Cancel:
                case DialogResult.None:
                    Task.Run(() => this.Invoke(o => o.Close()));
                    return;
                }
            }

            this.Text = $"Alturos PanTilt TestUI ({Application.ProductVersion})";
            this.SetConfigurationInfo();

            var startPtHeadCommunication = Task.Run(() => this.StartPanTiltCommunication());

            this.UpdateMousePanel();
            this.panelMouseControl.MouseWheel += MouseWheelZoom;

            //Disable TabPage Zoom - No ZoomProvider available
            //this.tabControl1.TabPages.Remove(this.tabPageCameraZoom);
            this._zoomProvider = new MockZoomProvider();
            this._zoomProvider.SetZoomAsync(0);
            this._zoomProvider.ZoomChanged += CameraControlZoomChanged;

            if (this._deviceConfiguration.CameraActive)
            {
                //Live Camera Image
                var url = $"http://{this._deviceConfiguration.CameraIpAddress}{this._deviceConfiguration.CameraJpegUrl}";

                IVideoSource source = new JPEGStream(url);
                ((JPEGStream)source).FrameInterval = 200;

                this._videoSourcePlayer             = new Accord.Controls.VideoSourcePlayer();
                this._videoSourcePlayer.VideoSource = source;
                this._videoSourcePlayer.Start();
                this._videoSourcePlayer.Dock = DockStyle.Fill;
                this.tabPageLiveView.Controls.Add(this._videoSourcePlayer);
            }
            else
            {
                //Visual Map
                this._cameraDrawEngine = new DrawEngine(4);
                this.UpdateCurrentImage();
                this.pictureBox_CameraPos.Visible = true;
            }

            startPtHeadCommunication.Wait();

            if (this._panTiltControl != null)
            {
                this.continiousMovementControl1.SetPanTiltControl(this._panTiltControl);
                this.fastMovementControl1.SetPanTiltControl(this._panTiltControl);
                this.absolutePositionControl1.SetPanTiltControl(this._panTiltControl);
                this._panTiltControl.PanTiltAbsolute(0, 0);
            }
        }
Esempio n. 12
0
 public DrawToolBucketLogic(ToolType _type, DrawEngine _engin)
 {
     toolType   = _type;
     drawEngine = _engin;
 }
Esempio n. 13
0
        public Main()
        {
            Log.Debug("Start");

            this.InitializeComponent();

            this._deviceConfigurationHelper = new DeviceConfigurationHelper();
            this._deviceConfiguration       = this._deviceConfigurationHelper.LoadConfig("default");

            using (var dialog = new ConfigDialog(_deviceConfiguration))
            {
                dialog.StartPosition = FormStartPosition.CenterParent;
                var dialogResult = dialog.ShowDialog(this);
                switch (dialogResult)
                {
                case DialogResult.OK:
                    this._deviceConfiguration = dialog.DeviceConfiguration;
                    this._deviceConfigurationHelper.SaveConfig("default", this._deviceConfiguration);
                    break;

                case DialogResult.Cancel:
                case DialogResult.None:
                    Task.Run(() => this.Invoke(o => o.Close()));
                    return;
                }
            }

            this.Text = $"Alturos PanTilt TestUI - v{Application.ProductVersion}";
            this.labelPositionPan.Text  = "Pan: ?,??";
            this.labelPositionTilt.Text = "Tilt: ?,??";

            this.SetConfigurationInfo();

            var startPtHeadCommunication = Task.Run(() => this.StartPanTiltCommunication());

            this.UpdateMousePanel();

            if (this._deviceConfiguration.CameraActive)
            {
                //Live Camera Image
                var url = $"http://{this._deviceConfiguration.CameraIpAddress}{this._deviceConfiguration.CameraJpegUrl}";

                IVideoSource source = new JPEGStream(url);
                ((JPEGStream)source).FrameInterval = 200;

                this._videoSourcePlayer = new Accord.Controls.VideoSourcePlayer
                {
                    VideoSource = source,
                    Dock        = DockStyle.Fill
                };
                this._videoSourcePlayer.Start();
                this.tabPageLiveView.Controls.Add(this._videoSourcePlayer);
            }
            else
            {
                //Visual Map
                this._cameraDrawEngine = new DrawEngine(4);
                this.UpdateCurrentImage();
                this.pictureBox_CameraPos.Visible = true;
            }

            startPtHeadCommunication.Wait();

            if (this._panTiltControl != null)
            {
                this.continiousMovementControl1.SetPanTiltControl(this._panTiltControl);
                this.fastMovementControl1.SetPanTiltControl(this._panTiltControl);
                this.absolutePositionControl1.SetPanTiltControl(this._panTiltControl);
                this.eneoUserControl1.SetPanTiltControl(this._panTiltControl);
                this.alturosUserControl1.SetPanTiltControl(this._panTiltControl);
                this.movementFloodControl1.SetPanTiltControl(this._panTiltControl);
                this.commandSequenceControl1.SetPanTiltControl(this._panTiltControl);
                this.alturosUserControl1.SetDeviceConfiguration(this._deviceConfiguration);
                this.feedbackAnalyzeControl1.SetPanTiltControl(this._panTiltControl);
                this._panTiltControl.PanTiltAbsolute(0, 0);
            }
        }