public DxForm(string ApplicationName, string ApplicationVersion) { APPLICATION_NAME = ApplicationName; APPLICATION_VERSION = ApplicationVersion; #if RENDER_0 APPLICATION_VERSION += " [version without 3D models rendering]"; #endif InitializeComponent(); #if RENDER_1 Application.AddMessageFilter(new CScrollPanelMessageFilter(this.PanelDirectX)); // neaded to get event about scroll wheal in the panel this.PanelDirectX.MouseMove += new System.Windows.Forms.MouseEventHandler(ClEventSender.getInstance().BroadcastMouseMoveEvent); this.PanelDirectX.MouseDown += new System.Windows.Forms.MouseEventHandler(ClEventSender.getInstance().BroadcastMouseButtonDownEvent); this.PanelDirectX.MouseUp += new System.Windows.Forms.MouseEventHandler(ClEventSender.getInstance().BroadcastMouseButtonUpEvent); this.PanelDirectX.MouseWheel += new System.Windows.Forms.MouseEventHandler(ClEventSender.getInstance().BroadcastMouseWheelEvent); #endif ClInformationReciver viewer = new ClInformationReciver(this); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eDebugText); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eError); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eProgress); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eTextInternal); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eTextExternal); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eStartProcessing); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eStopProcessing); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eColorMapChanged); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eNextRecognitionScore); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eWindowInfo); this.Text = APPLICATION_NAME+" ver. "+APPLICATION_VERSION; #if RENDER_1 ClRender Render = ClRender.getInstance(); Render.CreateDevice(this.PanelDirectX); ClCamera Camera = new ClCamera(); // Create camera object Camera.RegisterForEvent(ClEventSender.eEvents.e_MouseMove); Camera.RegisterForEvent(ClEventSender.eEvents.e_MouseButtonDown); Camera.RegisterForEvent(ClEventSender.eEvents.e_MouseButtonUp); Camera.RegisterForEvent(ClEventSender.eEvents.e_MouseWheel); Render.SetCamera(Camera); // Register camera as a render object // Render.AddRenderObj(new ClCoordinateSystem()); #endif List<string> fileTypes = Cl3DModel.sm_ListManagedFilesExtensions; string filter = ""; string AllNames = "All supported types"; string AllExt = ""; foreach (string type in fileTypes) { AllExt += "*." + type + ";"; filter += type.ToUpper() + "|*." + type+"|"; } filter = filter.Remove(filter.Length - 1); AllExt = AllExt.Remove(AllExt.Length - 1); openFileDialog.Filter = AllNames+"|"+AllExt+"|"+filter; }
public DxForm(string ApplicationName, string ApplicationVersion) { APPLICATION_NAME = ApplicationName; APPLICATION_VERSION = ApplicationVersion; #if RENDER_0 APPLICATION_VERSION += " [version without 3D models rendering]"; #endif InitializeComponent(); #if RENDER_1 Application.AddMessageFilter(new CScrollPanelMessageFilter(this.PanelDirectX)); // neaded to get event about scroll wheal in the panel this.PanelDirectX.MouseMove += new System.Windows.Forms.MouseEventHandler(ClEventSender.getInstance().BroadcastMouseMoveEvent); this.PanelDirectX.MouseDown += new System.Windows.Forms.MouseEventHandler(ClEventSender.getInstance().BroadcastMouseButtonDownEvent); this.PanelDirectX.MouseUp += new System.Windows.Forms.MouseEventHandler(ClEventSender.getInstance().BroadcastMouseButtonUpEvent); this.PanelDirectX.MouseWheel += new System.Windows.Forms.MouseEventHandler(ClEventSender.getInstance().BroadcastMouseWheelEvent); #endif ClInformationReciver viewer = new ClInformationReciver(this); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eDebugText); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eError); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eProgress); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eTextInternal); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eTextExternal); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eStartProcessing); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eStopProcessing); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eColorMapChanged); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eNextRecognitionScore); ClInformationSender.RegisterReceiver(viewer, ClInformationSender.eInformationType.eWindowInfo); this.Text = APPLICATION_NAME + " ver. " + APPLICATION_VERSION; #if RENDER_1 ClRender Render = ClRender.getInstance(); Render.CreateDevice(this.PanelDirectX); ClCamera Camera = new ClCamera(); // Create camera object Camera.RegisterForEvent(ClEventSender.eEvents.e_MouseMove); Camera.RegisterForEvent(ClEventSender.eEvents.e_MouseButtonDown); Camera.RegisterForEvent(ClEventSender.eEvents.e_MouseButtonUp); Camera.RegisterForEvent(ClEventSender.eEvents.e_MouseWheel); Render.SetCamera(Camera); // Register camera as a render object // Render.AddRenderObj(new ClCoordinateSystem()); #endif List <string> fileTypes = Cl3DModel.sm_ListManagedFilesExtensions; string filter = ""; string AllNames = "All supported types"; string AllExt = ""; foreach (string type in fileTypes) { AllExt += "*." + type + ";"; filter += type.ToUpper() + "|*." + type + "|"; } filter = filter.Remove(filter.Length - 1); AllExt = AllExt.Remove(AllExt.Length - 1); openFileDialog.Filter = AllNames + "|" + AllExt + "|" + filter; }