public bool SaveSelectedModel() { if (this.GLrender.RenderableObjects.Count > 0) { RenderableObject o = null; o = this.GLrender.RenderableObjects[this.GLrender.SelectedModelIndex]; if (o != null) { PointCloud pc = o.PointCloud; pc.ToObjFile(pc.FileNameLong); } } else { System.Windows.Forms.MessageBox.Show("please switch to 3D Tab if scanning is in progress - (nothing to save) "); return(false); } return(true); }
public Matrix4 CalculateRegistrationMatrix(PointCloud pcOriginal) { //Vector3 v = new Vector3(); Matrix4 myMatrix = Matrix4.Identity; if (this.GLrender.RenderableObjects.Count > 1) { RenderableObject o = this.GLrender.RenderableObjects[0]; PointCloud pc1 = o.PointCloud; myMatrix = SVD_Float.FindTransformationMatrix(pcOriginal, pc1, ICP_VersionUsed.Zinsser); //myMatrix = SVD.FindTransformationMatrix_WithoutCentroids(v.ArrayVector3ToList(pc1.Vectors), v.ArrayVector3ToList(pc2.Vectors), ICP_VersionUsed.Scaling_Zinsser); } else { System.Windows.Forms.MessageBox.Show("Please load two Point Clouds first"); } return(myMatrix); }
private void toolStripChangeColor_Click(object sender, EventArgs e) { if (comboModels.SelectedIndex >= 0) { ColorDialog colDiag = new ColorDialog(); // Sets the initial color select to the current text color. // Update the text box color if the user clicks OK if (colDiag.ShowDialog() == DialogResult.OK) { RenderableObject pcr = this.OGLControl.GLrender.RenderableObjects[this.OGLControl.GLrender.SelectedModelIndex]; PointCloud pc = pcr.PointCloud; pc.SetColor(new Vector3(colDiag.Color.R / 255f, colDiag.Color.G / 255f, colDiag.Color.B / 255f)); this.OGLControl.Refresh(); } } else { System.Windows.Forms.MessageBox.Show("Please load a 3D object first"); } }
private void ClearAll() { if (RenderableObjects.Count > 0) { for (int i = 0; i < RenderableObjects.Count; i++) { RenderableObject obj = RenderableObjects[i]; obj.Dispose(); } RenderableObjects.Clear(); } if (AdditionalObjectsToDraw.Count > 0) { for (int i = 0; i < AdditionalObjectsToDraw.Count; i++) { RenderableObject obj = AdditionalObjectsToDraw[i]; obj.Dispose(); } AdditionalObjectsToDraw.Clear(); } }
private void RotateModel(int iObject, float xAngle, float yAngle) { RenderableObject o = this.RenderableObjects[iObject]; o.PointCloud.RotateDegrees(xAngle, yAngle, 0f); }
private void ScaleModel(int iObject, float scale) { RenderableObject o = this.RenderableObjects[iObject]; o.PointCloud.Scale(scale); }