public PatchWindow() { Viewport = new Viewport(this); InitializeComponent(); }
public void DetachFromViewport() { if (Viewport == null) return; Viewport.MouseClick -= Viewport_MouseClick; Viewport.MouseMove -= Viewport_MouseMove; Viewport.Paint -= Viewport_Paint; Viewport.GetControl().MakeCurrent(); SurfaceMesh.FreeBuffers(); foreach (var group in PointGroups) group.PointCloud.FreeBuffers(); Viewport = null; LockTarget = null; }
public void AttachToViewport(Viewport viewport) { if (Viewport != null) { Viewport.MouseClick -= Viewport_MouseClick; Viewport.MouseMove -= Viewport_MouseMove; Viewport.MouseWheel -= Viewport_MouseWheel; Viewport.MouseDown -= Viewport_MouseDown; Viewport.MouseUp -= Viewport_MouseUp; Viewport.Paint -= Viewport_Paint; } Viewport = viewport; Viewport.MouseClick += Viewport_MouseClick; Viewport.MouseMove += Viewport_MouseMove; Viewport.MouseWheel += Viewport_MouseWheel; Viewport.MouseDown += Viewport_MouseDown; Viewport.MouseUp += Viewport_MouseUp; Viewport.Paint += Viewport_Paint; foreach (var item in PointGroups) item.PointCloud.GLContext = viewport.GetControl(); SelectionTexture.UpdateBuffers(); }
public void AttachToViewport(Viewport viewport) { DetachFromViewport(); Viewport = viewport; Viewport.MouseClick += Viewport_MouseClick; Viewport.MouseMove += Viewport_MouseMove; Viewport.Paint += Viewport_Paint; SurfaceMesh.GLContext = viewport.GetControl(); SurfaceMesh.UpdateBuffers(); foreach (var group in PointGroups) group.PointCloud.UpdateBuffers(); }