public N3DTGLViewer(N3DTController c) { this.LightOn = false; this.MeshType = MESH_VIEWER_TYPE.POINTS; this.Rotation = ROTATION.DISABLE; this.Controller = c; this.Timer = new Timer(); this.Timer.Interval = 50; // 50 is the default value this.Timer.Tick += Timer_Tick; this.GlLoaded = false; this.GlControl = new OpenTK.GLControl(new OpenTK.Graphics.GraphicsMode(COLOR_FORMAT, DEPTH, STENCIL, SAMPLES)); this.GlControl.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; this.GlControl.Location = new Point(LOCATION_X, LOCATION_Y); this.GlControl.Size = new Size(SIZE_WIDTH, SIZE_HEIGHT); this.GlControl.Load += new EventHandler(this.glControl_Load); this.GlControl.MouseWheel += new MouseEventHandler(this.glControl_mouseWheel); this.GlControl.Resize += new EventHandler(this.glControl_Resize); this.GlControl.MouseDown += new MouseEventHandler(this.glControl_mouseDown); this.GlControl.MouseMove += new MouseEventHandler(this.glControl_mouseMove); this.GlControl.Paint += new PaintEventHandler(this.glControl_paint); this._angleX = this._angleY = 0; this._mouseStartX = this._mouseStartY = 0; }
public OBJFileFormat(N3DTController c) { this._controller = c; this._verticesList = new List <String>(); this._normalsList = new List <String>(); this._facesList = new List <String>(); }
public OBJFileFormat(N3DTController c) { this._controller = c; this._verticesList = new List<String>(); this._normalsList = new List<String>(); this._facesList = new List<String>(); }
public N3DTView() { InitializeComponent(); this.Controller = new N3DTController(this); this.InitPicturesBoxes(); this.GlViewer = new N3DTGLViewer(this.Controller); // Create the GL viewer this.Controls.Add(this.GlViewer.GlControl); // Add to the main view this.UpdateView(); }
public N3DTArduinoCommandView(N3DTController controller) { InitializeComponent(); this.Controller = controller; this.Arduino = this.Controller.Scanner.Arduino; this.cbPortCom.Items.Clear(); foreach (string p in SerialPort.GetPortNames()) this.cbPortCom.Items.Add(p); this.cbPortCom.SelectedIndex = 0; // first Com port by default this.cbBaudrate.SelectedIndex = 5; // Baudrate 9600 by default }
public N3DT3dConfigurationView(N3DTController controller) { InitializeComponent(); this.Controller = controller; if(this.Controller.View.GlViewer.Rotation == N3DTGLViewer.ROTATION.DISABLE) this.rbRotationDisabled.Checked = true; else if (this.Controller.View.GlViewer.Rotation == N3DTGLViewer.ROTATION.COUNTERCLOCKWISE) this.rbCounterClockWise.Checked = true; else this.rbClockWise.Checked = true; this.nudRotateSpeed.Value = this.Controller.View.GlViewer.Timer.Interval; }
public N3DTScan(N3DTController c) { this.Controller = c; this.Mesh = new N3DTMesh(NB_SCAN_STEP); this.StepDegree = 360.0 / NB_SCAN_STEP; this.CamIndex = 0; this.Camera = new N3DTCamera(this.CamIndex); this.Arduino = new N3DTArduinoCommand(); this.ThreadScan = new Thread(new ThreadStart(this.Execute)); this.IsScanning = false; this.StepResolution = 1; // Default value = 1 }
public N3DTArduinoCommandView(N3DTController controller) { InitializeComponent(); this.Controller = controller; this.Arduino = this.Controller.Scanner.Arduino; this.cbPortCom.Items.Clear(); foreach (string p in SerialPort.GetPortNames()) { this.cbPortCom.Items.Add(p); } this.cbPortCom.SelectedIndex = 0; // first Com port by default this.cbBaudrate.SelectedIndex = 5; // Baudrate 9600 by default }
public N3DT3dConfigurationView(N3DTController controller) { InitializeComponent(); this.Controller = controller; if (this.Controller.View.GlViewer.Rotation == N3DTGLViewer.ROTATION.DISABLE) { this.rbRotationDisabled.Checked = true; } else if (this.Controller.View.GlViewer.Rotation == N3DTGLViewer.ROTATION.COUNTERCLOCKWISE) { this.rbCounterClockWise.Checked = true; } else { this.rbClockWise.Checked = true; } this.nudRotateSpeed.Value = this.Controller.View.GlViewer.Timer.Interval; }
public N3DTFileFormat(N3DTController c) { this._controller = c; this._fileLines = new List <String>(); }
public N3DTFileFormat(N3DTController c) { this._controller = c; this._fileLines = new List<String>(); }
public N3DTCamConfigView(N3DTController controller) { InitializeComponent(); this.Controller = controller; this.Camera = this.Controller.GetCamera(); this.InitPictureBoxes(); this.CropArea = new Rectangle(0, 0, this.Controller.GetFramePictureBox().Width, this.Controller.GetFramePictureBox().Height); this.tbBrightness.Value = (this.Camera.Brightness > 0) ? (int)this.Camera.Brightness : 0; this.tbContrast.Value = (this.Camera.Contrast > 0) ? (int)this.Camera.Contrast : 0; this.tbGain.Value = (this.Camera.Gain > 0) ? (int)this.Camera.Gain : 0; this.tbHue.Value = (this.Camera.Hue > 0) ? (int)this.Camera.Hue : 0; this.tbSaturation.Value = (this.Camera.Saturation > 0) ? (int)this.Camera.Saturation : 0; switch (this.Camera.Marker) { case CAMERA_MARKER.CENTER_MARKER: this.rbCenterMarker.Checked = true; break; case CAMERA_MARKER.GRID_MAKER: this.rbGrid.Checked = true; break; case CAMERA_MARKER.NONE: this.rbNone.Checked = true; break; } this.Camera.s_max = 255; this.Camera.v_max = 255; this.tbHueMin.Value = Convert.ToInt16(this.Camera.h_min); this.tbHueMax.Value = Convert.ToInt16(this.Camera.h_max); this.tbSatMin.Value = Convert.ToInt16(this.Camera.s_min); this.tbSatMax.Value = Convert.ToInt16(this.Camera.s_max); this.tbBriMin.Value = Convert.ToInt16(this.Camera.v_min); this.tbBriMax.Value = Convert.ToInt16(this.Camera.v_max); this.lblTips.Text = "Definissez la zone où se trouve l'objet."; if (this.Controller.GetFilter() is N3DTImageDifferencesFilter) { this.tbThreshold.Value = (this.Controller.GetFilter() as N3DTImageDifferencesFilter).Threshold; this.lblThresholdPercent.Text = this.tbThreshold.Value.ToString() + "%"; } // Filter method selected this.gbHsvFilter.Enabled = (this.Controller.GetFilter().SelectedFilter == LASER_FILTER.HSV) ? true : false; this.gbImgDiff.Enabled = (this.Controller.GetFilter().SelectedFilter == LASER_FILTER.IMG_DIFF) ? true : false; this.rbHsvFilter.Checked = (this.Controller.GetFilter().SelectedFilter == LASER_FILTER.HSV) ? true : false; this.rbImgDiff.Checked = (this.Controller.GetFilter().SelectedFilter == LASER_FILTER.IMG_DIFF) ? true : false; // Show all cameras devices connected // Thanks to kerboo -> http://www.emgu.com/forum/viewtopic.php?f=7&t=3095 List <KeyValuePair <int, string> > ListCamerasData = new List <KeyValuePair <int, string> >(); DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); int _DeviceIndex = 0; foreach (DirectShowLib.DsDevice _Camera in _SystemCamereas) { ListCamerasData.Add(new KeyValuePair <int, string>(_DeviceIndex, _Camera.Name)); _DeviceIndex++; } //-> clear the combobox this.cbCameraDevices.DataSource = null; this.cbCameraDevices.Items.Clear(); //-> bind the combobox this.cbCameraDevices.DataSource = new BindingSource(ListCamerasData, null); this.cbCameraDevices.DisplayMember = "Value"; this.cbCameraDevices.ValueMember = "Key"; this.cbCameraDevices.SelectedIndex = this.Controller.Scanner.CamIndex; }
public N3DTCamConfigView(N3DTController controller) { InitializeComponent(); this.Controller = controller; this.Camera = this.Controller.GetCamera(); this.InitPictureBoxes(); this.CropArea = new Rectangle(0, 0, this.Controller.GetFramePictureBox().Width, this.Controller.GetFramePictureBox().Height); this.tbBrightness.Value = (this.Camera.Brightness > 0) ? (int)this.Camera.Brightness : 0; this.tbContrast.Value = (this.Camera.Contrast > 0) ? (int)this.Camera.Contrast : 0; this.tbGain.Value = (this.Camera.Gain > 0) ? (int)this.Camera.Gain : 0; this.tbHue.Value = (this.Camera.Hue > 0) ? (int)this.Camera.Hue : 0; this.tbSaturation.Value = (this.Camera.Saturation > 0) ? (int)this.Camera.Saturation : 0; switch (this.Camera.Marker) { case CAMERA_MARKER.CENTER_MARKER: this.rbCenterMarker.Checked = true; break; case CAMERA_MARKER.GRID_MAKER: this.rbGrid.Checked = true; break; case CAMERA_MARKER.NONE: this.rbNone.Checked = true; break; } this.Camera.s_max = 255; this.Camera.v_max = 255; this.tbHueMin.Value = Convert.ToInt16(this.Camera.h_min); this.tbHueMax.Value = Convert.ToInt16(this.Camera.h_max); this.tbSatMin.Value = Convert.ToInt16(this.Camera.s_min); this.tbSatMax.Value = Convert.ToInt16(this.Camera.s_max); this.tbBriMin.Value = Convert.ToInt16(this.Camera.v_min); this.tbBriMax.Value = Convert.ToInt16(this.Camera.v_max); this.lblTips.Text = "Definissez la zone où se trouve l'objet."; if (this.Controller.GetFilter() is N3DTImageDifferencesFilter) { this.tbThreshold.Value = (this.Controller.GetFilter() as N3DTImageDifferencesFilter).Threshold; this.lblThresholdPercent.Text = this.tbThreshold.Value.ToString() + "%"; } // Filter method selected this.gbHsvFilter.Enabled = (this.Controller.GetFilter().SelectedFilter == LASER_FILTER.HSV) ? true : false; this.gbImgDiff.Enabled = (this.Controller.GetFilter().SelectedFilter == LASER_FILTER.IMG_DIFF) ? true : false; this.rbHsvFilter.Checked = (this.Controller.GetFilter().SelectedFilter == LASER_FILTER.HSV) ? true : false; this.rbImgDiff.Checked = (this.Controller.GetFilter().SelectedFilter == LASER_FILTER.IMG_DIFF) ? true : false; // Show all cameras devices connected // Thanks to kerboo -> http://www.emgu.com/forum/viewtopic.php?f=7&t=3095 List<KeyValuePair<int, string>> ListCamerasData = new List<KeyValuePair<int, string>>(); DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); int _DeviceIndex = 0; foreach (DirectShowLib.DsDevice _Camera in _SystemCamereas) { ListCamerasData.Add(new KeyValuePair<int, string>(_DeviceIndex, _Camera.Name)); _DeviceIndex++; } //-> clear the combobox this.cbCameraDevices.DataSource = null; this.cbCameraDevices.Items.Clear(); //-> bind the combobox this.cbCameraDevices.DataSource = new BindingSource(ListCamerasData, null); this.cbCameraDevices.DisplayMember = "Value"; this.cbCameraDevices.ValueMember = "Key"; this.cbCameraDevices.SelectedIndex = this.Controller.Scanner.CamIndex; }
public N3DTScanningConfigView(N3DTController controller) { InitializeComponent(); this.Controller = controller; }