- Timestamp:
- 11/15/15 13:56:30 (9 years ago)
- Location:
- branches/HeuristicLab.BinPacking/PackingPlanVisualizations
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/PackingPlanVisualizations/2D/PackingPlan2D.cs
r13032 r13161 62 62 private void InitializeRenderTarget() { 63 63 hwndProperties.Hwnd = this.Handle; 64 hwndProperties.PixelSize = new DrawingSize(this.Width, this.Height);64 hwndProperties.PixelSize = new Size2(this.Width, this.Height); 65 65 hwndProperties.PresentOptions = PresentOptions.None; 66 66 textFormat = new TextFormat(dwFactory, "arial", 14); … … 130 130 private void PackingPlan2D_Resize(object sender, EventArgs e) { 131 131 if (wndRender != null) 132 wndRender.Resize(new DrawingSize(this.Width, this.Height));132 wndRender.Resize(new Size2(this.Width, this.Height)); 133 133 //this.Refresh(); 134 134 } -
branches/HeuristicLab.BinPacking/PackingPlanVisualizations/3D/PackingGame.cs
r13032 r13161 22 22 using System; 23 23 using SharpDX; 24 using SharpDX.Toolkit; 24 using SharpDX.Direct3D11; 25 using SharpDX.Toolkit; 25 26 using SharpDX.Toolkit.Graphics; 26 27 using SharpDX.Toolkit.Input; 27 28 28 29 using ButtonStateDX = SharpDX.Toolkit.Input.ButtonState; 29 using SharpDX.Direct3D11; 30 30 31 31 32 namespace PackingPlanVisualizations { … … 33 34 34 35 35 #region Global Private Variables 36 #region Global Private Variables 36 37 private GraphicsDeviceManager graphicsDeviceManager; 37 38 private PackingPlan3D control; … … 42 43 private int selectedItemIndex = -1; 43 44 44 private BasicEffect basicEffect; 45 private BasicEffect basicEffect; 45 46 private Color backgroundColor { get; set; } 46 47 47 private CenteredContainer container; 48 private CenteredContainer container; 48 49 private MouseManager Mouse; 49 #endregion Global Private Variables 50 #endregion Global Private Variables 50 51 51 52 protected override void Dispose(bool disposeManagedResources) { … … 58 59 public PackingGame(PackingPlan3D control) 59 60 : base() { 60 61 this.control = control; 61 62 graphicsDeviceManager = new GraphicsDeviceManager(this); 62 63 graphicsDeviceManager.PreferMultiSampling = true; 63 graphicsDeviceManager.PreparingDeviceSettings += 64 (object sender, PreparingDeviceSettingsEventArgs e) => { 64 graphicsDeviceManager.PreparingDeviceSettings += 65 (object sender, PreparingDeviceSettingsEventArgs e) => { 65 66 e.GraphicsDeviceInformation.PresentationParameters.MultiSampleCount = MSAALevel.X4; 66 67 return; 67 68 }; 68 69 var controlColor = Color.White;//System.Drawing.SystemColors.Control; 69 backgroundColor = new Color (controlColor.R,controlColor.G, controlColor.B, controlColor.A);70 backgroundColor = new Color(controlColor.R, controlColor.G, controlColor.B, controlColor.A); 70 71 71 72 Mouse = new MouseManager(this); … … 135 136 //Primitive color 136 137 basicEffect.AmbientLightColor = new Vector3(0.1f, 0.1f, 0.1f); 137 basicEffect.DiffuseColor = new Vector 3(1.0f, 1.0f, 1.0f);138 basicEffect.DiffuseColor = new Vector4(1.0f, 1.0f, 1.0f, 1.0f); 138 139 basicEffect.SpecularColor = new Vector3(0.25f, 0.25f, 0.25f); 139 140 basicEffect.SpecularPower = 5.0f; … … 204 205 GraphicsDevice.Clear(backgroundColor); 205 206 206 worldMatrix = 207 worldMatrix = 207 208 Matrix.RotationY(MathUtil.DegreesToRadians(-currentViewAngle.X / 4)) * 208 209 Matrix.RotationX(MathUtil.DegreesToRadians(currentViewAngle.Y / 4)); … … 229 230 item.RenderShapeTriangles(GraphicsDevice); 230 231 } else 231 item.RenderShapeLines(GraphicsDevice, new Color(0, 0,0));232 item.RenderShapeLines(GraphicsDevice, new Color(0, 0, 0)); 232 233 } 233 234 } … … 235 236 } 236 237 237 base.Draw(gameTime); 238 base.Draw(gameTime); 238 239 } 239 240 … … 244 245 245 246 protected override void Update(GameTime gameTime) { 246 computeMouseHandling(); 247 computeMouseHandling(); 247 248 base.Update(gameTime); 248 249 } … … 263 264 private void computeLeftMouseBtnHandling(MouseState mouseState) { 264 265 //Left btn released 265 if (mouseState.Left .Equals(ButtonStateDX.Released) && mouseState.Left.Equals(previousMouseState.Left)) {266 if (mouseState.LeftButton.Released && mouseState.LeftButton.Equals(previousMouseState.LeftButton)) { 266 267 //Console.WriteLine("Released"); 267 268 } 268 269 269 270 //Left btn pressed 270 else if (mouseState.Left .Equals(ButtonStateDX.Pressed) && mouseState.Left.Equals(previousMouseState.Left)) {271 else if (mouseState.LeftButton.Pressed && mouseState.LeftButton.Equals(previousMouseState.LeftButton)) { 271 272 currentViewAngle = new Vector2( 272 273 viewAngleOnBtnRelease.X + mouseState.X - mousePositionOnBtnDown.X, … … 279 280 280 281 //Left btn freshly pressed ==> ONLICK-EVENT 281 else if (mouseState.Left .Equals(ButtonStateDX.Pressed) && !previousMouseState.Left.Equals(ButtonStateDX.Pressed)) {282 else if (mouseState.LeftButton.Pressed && !previousMouseState.LeftButton.Pressed) { 282 283 Console.WriteLine("OnClick"); 283 284 PackingPlan3D native = (PackingPlan3D)Window.NativeWindow; … … 293 294 294 295 //Left btn freshly released ==> ONRELEASE-EVENT 295 else if (mouseState.Left .Equals(ButtonStateDX.Released) && !previousMouseState.Left.Equals(ButtonStateDX.Released)) {296 else if (mouseState.LeftButton.Released && !previousMouseState.LeftButton.Released) { 296 297 Console.WriteLine("OnRelease"); 297 298 viewAngleOnBtnRelease = currentViewAngle; -
branches/HeuristicLab.BinPacking/PackingPlanVisualizations/PackingPlanVisualizations.csproj
r13028 r13161 42 42 </PropertyGroup> 43 43 <ItemGroup> 44 <Reference Include="SharpDX , Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL">45 < SpecificVersion>False</SpecificVersion>46 < HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.dll</HintPath>44 <Reference Include="SharpDX"> 45 <HintPath>..\..\..\trunk\sources\bin\SharpDX.dll</HintPath> 46 <Private>False</Private> 47 47 </Reference> 48 <Reference Include="SharpDX.D 3DCompiler, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL">49 < SpecificVersion>False</SpecificVersion>50 < HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.D3DCompiler.dll</HintPath>48 <Reference Include="SharpDX.Direct2D1"> 49 <HintPath>..\..\..\trunk\sources\bin\SharpDX.Direct2D1.dll</HintPath> 50 <Private>False</Private> 51 51 </Reference> 52 <Reference Include="SharpDX.Direct 2D1, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL">53 < SpecificVersion>False</SpecificVersion>54 < HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.Direct2D1.dll</HintPath>52 <Reference Include="SharpDX.Direct3D11"> 53 <HintPath>..\..\..\trunk\sources\bin\SharpDX.Direct3D11.dll</HintPath> 54 <Private>False</Private> 55 55 </Reference> 56 <Reference Include="SharpDX.D irect3D11, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL">57 < SpecificVersion>False</SpecificVersion>58 < HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.Direct3D11.dll</HintPath>56 <Reference Include="SharpDX.DXGI"> 57 <HintPath>..\..\..\trunk\sources\bin\SharpDX.DXGI.dll</HintPath> 58 <Private>False</Private> 59 59 </Reference> 60 <Reference Include="SharpDX. DirectInput, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL">61 < SpecificVersion>False</SpecificVersion>62 < HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.DirectInput.dll</HintPath>60 <Reference Include="SharpDX.Toolkit"> 61 <HintPath>..\..\..\trunk\sources\bin\SharpDX.Toolkit.dll</HintPath> 62 <Private>False</Private> 63 63 </Reference> 64 <Reference Include="SharpDX. DXGI, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL">65 < SpecificVersion>False</SpecificVersion>66 < HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.DXGI.dll</HintPath>64 <Reference Include="SharpDX.Toolkit.Game"> 65 <HintPath>..\..\..\trunk\sources\bin\SharpDX.Toolkit.Game.dll</HintPath> 66 <Private>False</Private> 67 67 </Reference> 68 <Reference Include="SharpDX.Toolkit , Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL">69 < SpecificVersion>False</SpecificVersion>70 < HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.Toolkit.dll</HintPath>68 <Reference Include="SharpDX.Toolkit.Graphics"> 69 <HintPath>..\..\..\trunk\sources\bin\SharpDX.Toolkit.Graphics.dll</HintPath> 70 <Private>False</Private> 71 71 </Reference> 72 <Reference Include="SharpDX.Toolkit.Compiler, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL"> 73 <SpecificVersion>False</SpecificVersion> 74 <HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.Toolkit.Compiler.dll</HintPath> 75 </Reference> 76 <Reference Include="SharpDX.Toolkit.Game, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL"> 77 <HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.Toolkit.Game.dll</HintPath> 78 </Reference> 79 <Reference Include="SharpDX.Toolkit.Graphics, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL"> 80 <SpecificVersion>False</SpecificVersion> 81 <HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.Toolkit.Graphics.dll</HintPath> 82 </Reference> 83 <Reference Include="SharpDX.Toolkit.Input, Version=2.5.0.0, Culture=neutral, PublicKeyToken=627a3d6d1956f55a, processorArchitecture=MSIL"> 84 <SpecificVersion>False</SpecificVersion> 85 <HintPath>..\..\..\..\..\SharpDXNightly\Bin\Signed-net40\SharpDX.Toolkit.Input.dll</HintPath> 72 <Reference Include="SharpDX.Toolkit.Input"> 73 <HintPath>..\..\..\trunk\sources\bin\SharpDX.Toolkit.Input.dll</HintPath> 74 <Private>False</Private> 86 75 </Reference> 87 76 <Reference Include="System" /> … … 128 117 <None Include="HeuristicLab.snk" /> 129 118 </ItemGroup> 130 <ItemGroup>131 <Content Include="SharpDX\SharpDX.D3DCompiler.dll" />132 <Content Include="SharpDX\SharpDX.D3DCompiler.xml" />133 <Content Include="SharpDX\SharpDX.Direct2D1.dll" />134 <Content Include="SharpDX\SharpDX.Direct2D1.xml" />135 <Content Include="SharpDX\SharpDX.Direct3D11.dll" />136 <Content Include="SharpDX\SharpDX.Direct3D11.xml" />137 <Content Include="SharpDX\SharpDX.DirectInput.dll" />138 <Content Include="SharpDX\SharpDX.DirectInput.xml" />139 <Content Include="SharpDX\SharpDX.dll" />140 <Content Include="SharpDX\SharpDX.DXGI.dll" />141 <Content Include="SharpDX\SharpDX.DXGI.xml" />142 <Content Include="SharpDX\SharpDX.Toolkit.Compiler.dll" />143 <Content Include="SharpDX\SharpDX.Toolkit.Compiler.xml" />144 <Content Include="SharpDX\SharpDX.Toolkit.dll" />145 <Content Include="SharpDX\SharpDX.Toolkit.Game.dll" />146 <Content Include="SharpDX\SharpDX.Toolkit.Game.xml" />147 <Content Include="SharpDX\SharpDX.Toolkit.Graphics.dll" />148 <Content Include="SharpDX\SharpDX.Toolkit.Graphics.xml" />149 <Content Include="SharpDX\SharpDX.Toolkit.Input.dll" />150 <Content Include="SharpDX\SharpDX.Toolkit.Input.xml" />151 <Content Include="SharpDX\SharpDX.Toolkit.xml" />152 <Content Include="SharpDX\SharpDX.xml" />153 </ItemGroup>154 119 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 155 120 <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset
for help on using the changeset viewer.