Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/12/16 10:42:58 (8 years ago)
Author:
gkronber
Message:

#1966: fixed various problems: bugs in cloning, bugs in persistence, method names, various minor improvements of source code for readability.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/PackingPlanVisualizations/2D/PackingPlan2D.cs

    r13477 r13497  
    3333namespace PackingPlanVisualizations {
    3434  public partial class PackingPlan2D : UserControl {
    35     WindowRenderTarget wndRender = null;
    36     Factory2D1 factory = new Factory2D1(FactoryType2D1.SingleThreaded);
    37     SharpDX.DirectWrite.Factory dwFactory = new SharpDX.DirectWrite.Factory(SharpDX.DirectWrite.FactoryType.Shared);
    38     RenderTargetProperties rndTargProperties = new RenderTargetProperties(new PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied));
    39     HwndRenderTargetProperties hwndProperties = new HwndRenderTargetProperties();
     35    private WindowRenderTarget wndRender;
     36    private readonly Factory2D1 factory = new Factory2D1(FactoryType2D1.SingleThreaded);
     37    private readonly SharpDX.DirectWrite.Factory dwFactory = new SharpDX.DirectWrite.Factory(SharpDX.DirectWrite.FactoryType.Shared);
     38    private readonly RenderTargetProperties rndTargProperties = new RenderTargetProperties(new PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied));
     39    private HwndRenderTargetProperties hwndProperties;
    4040
    4141
    42     #region Packing members BEGIN
    43     SolidColorBrush containerBrush;
    44     SolidColorBrush containerFillingBrush;
    45     SolidColorBrush itemBrush;
    46     SolidColorBrush itemFillingBrush;
    47     SolidColorBrush labelBrush;
    48     TextFormat textFormat;
     42    private SolidColorBrush containerBrush;
     43    private SolidColorBrush containerFillingBrush;
     44    private SolidColorBrush itemBrush;
     45    private SolidColorBrush itemFillingBrush;
     46    private SolidColorBrush labelBrush;
     47    private TextFormat textFormat;
    4948
    50     CenteredContainer2D container;
    51     #endregion
    52 
    53     //Initialization-Methods
     49    private CenteredContainer2D container;
    5450
    5551    public PackingPlan2D() {
    5652      InitializeComponent();
    57       this.SetStyle(
    58         ControlStyles.ResizeRedraw, true);
     53      this.SetStyle(ControlStyles.ResizeRedraw, true);
    5954    }
    6055
     
    7469    }
    7570
    76 
    77 
    78 
    79 
    80     //Packing-Methods
    8171    public void InitializeContainer(float width, float height) {
    8272      container = new CenteredContainer2D(new Vector2(Math.Max(this.Width - 12, 1), Math.Max(this.Height - 12, 1)), new Vector2(width, height));
     
    8676      container.AddItem(new Vector2(width, height), new Vector2(x, y), label);
    8777    }
    88 
    89     //Event-Listeners
    9078
    9179    private void PackingPlan2D_Load(object sender, EventArgs e) {
     
    119107        wndRender.Resize(new Size2(this.Width, this.Height));
    120108    }
    121 
    122109  }
    123110}
Note: See TracChangeset for help on using the changeset viewer.