Esempio n. 1
0
 private void timerDispatch_TickMethod(object sender, EventArgs e)
 {
     if ((SendOrientationParameters != null) &&
         checkBoxSendControlPars.Checked &&
         crawlAveragingModule.UpdateStep())
     {
         SendOrientationEventArgs orientationArgs =
             new SendOrientationEventArgs();
         orientationArgs.OrientationParameters.Add(
             crawlAveragingModule.CurrentAngle.Clone());
         if (checkBoxPan.Checked)
         {
             orientationArgs.OrientationParameters.Add(
                 crawlAveragingModule.CurrentTarget.Clone());
         }
         SendOrientationParameters(this, orientationArgs);
     }
 }
Esempio n. 2
0
 private void cameraDetector_SendOrientationParameters(object sender, SendOrientationEventArgs e)
 {
     acadManager.ModifyViewspace(e.OrientationParameters, false);
 }
Esempio n. 3
0
        private void OnSendParameters(List <Point3D> ViewDescriptor, List <Point3D> currentOrientation)
        {
            // Call subscribers to SendOrientationParameters event
            if ((SendOrientationParameters != null) && (checkBoxSendControlPars.Checked))
            {
                SendOrientationEventArgs orientationArgs =
                    new SendOrientationEventArgs();

                if (GlobalProperties.ViewPointMode)
                {
                    orientationArgs.OrientationParameters = ViewDescriptor;
                }
                else
                {
                    List <Point3D> rotationAngles = Geometry.GetRotationAngles(currentOrientation);
                    // Calculate the corresponding angles for X, Y and Z rotation
                    double xRot = Geometry.CalculateAngle(rotationAngles[0]) * 1;
                    double yRot = Geometry.CalculateAngle(rotationAngles[1]) * -1;
                    double zRot = Geometry.CalculateAngle(rotationAngles[2]) * 1;
                    xRot = Geometry.AngleRound(xRot, 10);
                    yRot = Geometry.AngleRound(yRot, 10);
                    zRot = Geometry.AngleRound(zRot, 10);
                    Point3D angles = new Point3D(xRot, yRot, zRot);

                    //vizDataText.SetText(
                    //    "target X: " + currentOrientation[0].X.ToString(),
                    //    "target Y: " + currentOrientation[0].Y.ToString(),
                    //    "target Z: " + currentOrientation[0].Z.ToString());
                    //"time: " + elapsedTime.ToString());

                    double xTarget = Geometry.ValueRound(currentOrientation[0].X, 10);
                    double yTarget = Geometry.ValueRound(currentOrientation[0].Y, 10);
                    double zTarget = Geometry.ValueRound(currentOrientation[0].Z, 10);
                    //if ((zTarget > 50) && (zTarget < 160))
                    //{
                    //    zTarget = 100;
                    //}

                    //if ((zTarget > 160) && (zTarget < 200))
                    //{
                    //    zTarget = 200;

                    //}
                    //if ((zTarget > 200) && (zTarget < 300))
                    //{
                    //    zTarget = 250;
                    //}
                    //if (zTarget > 300)
                    //{
                    //    zTarget = 300;
                    //}
                    Point3D target = new Point3D(xTarget, yTarget, zTarget);

                    double elapsedTime = 0;
                    if (GlobalProperties.UseTimers)
                    {
                        elapsedTime = crawlAveragingModule.FrameTick(angles, target);
                    }
                    else
                    {
                        orientationArgs.OrientationParameters.Add(angles);
                        //orientationArgs.OrientationParameters.Add(currentOrientation[0]);
                        if (checkBoxPan.Checked)
                        {
                            orientationArgs.OrientationParameters.Add(target);
                        }
                    }



                    //vizDataText.SetText(
                    //    "angle X: " + Geometry.ConvertToDeg(xRot).ToString(),
                    //    "angle Y: " + Geometry.ConvertToDeg(yRot).ToString(),
                    //    "angle Z: " + Geometry.ConvertToDeg(zRot).ToString(),
                    //    "time: " + elapsedTime.ToString());
                }

                if (!GlobalProperties.UseTimers)
                {
                    SendOrientationParameters(this, orientationArgs);
                }
            }
        }