/// <summary> /// Default constructor /// </summary> public SimpleVelodyneViewer() { InitializeComponent(); viewPoints = new List <ViewPoint>(); cloudTransform = new ObjectTransfromation(); viewPort.MouseWheel += PictureBox_MouseWheel; RenderingMode = SimpleVelodyneViewerRenderingMode.Responsive; PointNumForPreview = 10000; MaximumSnapRadius = 20; ResetView(SimpleVelodyneViewerRenderingMode.Manual); // populate help text lblHelpText.Text = "Help" + Environment.NewLine; lblHelpText.Text += "Rotate : Left Mouse button" + Environment.NewLine; lblHelpText.Text += "Z rotation : SHIFT + Mouse wheel" + Environment.NewLine; lblHelpText.Text += "Zoom : Mouse wheel" + Environment.NewLine; lblHelpText.Text += "Move : CONTROL + Left mouse button" + Environment.NewLine; lblHelpText.Text += "Point size : CONTROL + Mouse wheel" + Environment.NewLine; lblHelpText.Text += "Reset view : Double left click" + Environment.NewLine; lblHelpText.Text += "Select pts : SHIFT + Left Mouse button + Select" + Environment.NewLine; lblHelpText.Text += "Reset sele : SHIFT + Double left click" + Environment.NewLine; }
/// <summary> /// Transform a point based on the transformation object. Includes rotation and translation /// </summary> /// <param name="pt">Points object</param> /// <param name="trans">Transformation object</param> /// <returns></returns> private PointLikeObject Transfrom(PointLikeObject pt, ObjectTransfromation trans) { PointLikeObject ptt = Rotate(pt, trans); ptt.X += trans.dx; ptt.Y += trans.dy; ptt.Z += trans.dz; return(ptt); }
/// <summary> /// Rotate a point based on the transformation object. Only rotation, translation is skipped /// </summary> /// <param name="pt">Points object</param> /// <param name="trans">Transformation object</param> /// <returns>Transformed object; the input object won't be copied</returns> private PointLikeObject Rotate(PointLikeObject pt, ObjectTransfromation trans) { PointLikeObject ptt = Rotate(pt, 0, 0, trans.kappa); return(Rotate(ptt, trans.alpha, trans.beta, trans.gamma)); }