예제 #1
0
    def method_0(self, double_0, angleUnits_0):
        if (angleUnits_0 == AngleUnits.Degrees):
            double_0 = Unit.ConvertDegToRad(double_0)
        if self.Direction != TurnDirection.Left:
            num = double_0 - math.pi / 2
        else:
            num = double_0 + math.pi / 2

        point3d = MathHelper.distanceBearingPoint(self.Center[0], num,
                                                  self.Radius[0])
        point3d1 = MathHelper.distanceBearingPoint(self.Center[1], num,
                                                   self.Radius[1])
        point3d2 = MathHelper.distanceBearingPoint(self.Center[2], num,
                                                   self.Radius[2])
        if (self.Direction == TurnDirection.Left):
            if (MathHelper.smethod_115(
                    point3d1, point3d,
                    MathHelper.distanceBearingPoint(point3d, double_0, 1000))
                    or MathHelper.smethod_119(point3d1, self.Center[0],
                                              self.Finish[0])):
                return point3d
            if (not MathHelper.smethod_115(
                    point3d2, point3d1,
                    MathHelper.distanceBearingPoint(point3d1, double_0, 1000))
                ) and (not MathHelper.smethod_119(point3d2, self.Center[1],
                                                  self.Finish[1])):
                return point3d2
            return point3d1
        if (MathHelper.smethod_119(
                point3d1, point3d,
                MathHelper.distanceBearingPoint(point3d, double_0, 1000))
                or MathHelper.smethod_115(point3d1, self.Center[0],
                                          self.Finish[0])):
            return point3d
        if (not MathHelper.smethod_119(
                point3d2, point3d1,
                MathHelper.distanceBearingPoint(point3d1, double_0, 1000))
            ) and (not MathHelper.smethod_115(point3d2, self.Center[1],
                                              self.Finish[1])):
            return point3d2
        return point3d1
 def vmethod_3(self, point3d_0, bool_0):
     point3d = Point3D()
     point3d = MathHelper.getIntersectionPoint(
         self.ptTHR, self.ptEND, point3d_0,
         MathHelper.distanceBearingPoint(point3d_0, self.trm90, 100))
     num = MathHelper.calcDistance(self.ptTHR, point3d)
     if not MathHelper.smethod_115(point3d, self.ptTHR, self.ptTHRm90):
         num = num + self.xstart
     else:
         num = self.xstart - min([num, self.xstart])
     num1 = num * self.tanslope
     if (bool_0):
         num1 = num1 + self.mocma
     return self.ptTHR.z() + num1
    def vmethod_3(self, point3d_0, bool_0):

        point3d = Point3D()
        point3d = MathHelper.getIntersectionPoint(
            self.ptTHR, self.ptEND, point3d_0,
            MathHelper.distanceBearingPoint(point3d_0, self.trm90, 100))
        num = 0
        if (MathHelper.smethod_115(point3d, self.ptTHR, self.ptTHRm90)):
            num = max([
                MathHelper.calcDistance(self.ptTHR, point3d), self.xstart
            ]) - self.xstart
        num1 = 0
        if (bool_0):
            num1 = self.mocma + num * self.tanslope
        return self.ptTHR.z() + num1
 def vmethod_3(self, point3d_0, bool_0):
     point3d = MathHelper.getIntersectionPoint(
         self.ptTHR, self.ptEND, point3d_0,
         MathHelper.distanceBearingPoint(point3d_0, self.trm90, 100))
     item = 0
     if (MathHelper.smethod_115(point3d, self.ptTHR, self.ptTHRm90)):
         num = MathHelper.calcDistance(self.ptTHR, point3d)
         num1 = 0
         count = len(self.segments)
         while (num1 < count):
             if (num < self.segments[num1].xstart):
                 if (not bool_0):
                     return self.ptTHR.z() + item
                 item = item + self.segments[num1].moc
                 return self.ptTHR.z() + item
             elif (num < self.segments[num1].xstart
                   or num >= self.segments[num1].xend):
                 if (num1 + 1 >= len(self.segments)):
                     item = (self.segments[num1].xend -
                             self.segments[num1].xfas
                             ) * self.segments[num1].tanafas
                     if (bool_0):
                         item = item + self.segments[num1].moc
                 elif (num <= self.segments[num1 + 1].xstart):
                     item = (self.segments[num1].xend -
                             self.segments[num1].xfas
                             ) * self.segments[num1].tanafas
                     if (not bool_0):
                         return self.ptTHR.z() + item
                     item1 = self.segments[num1].moc
                     item2 = self.segments[num1 + 1].moc
                     num2 = (item2 -
                             item1) / (self.segments[num1 + 1].xstart -
                                       self.segments[num1].xend)
                     item3 = item1 + (num - self.segments[num1].xend) * num2
                     item = item + item3
                     return self.ptTHR.z() + item
                 num1 += 1
             else:
                 item = (num - self.segments[num1].xfas
                         ) * self.segments[num1].tanafas
                 if (not bool_0):
                     return self.ptTHR.z() + item
                 item = item + self.segments[num1].moc
                 return self.ptTHR.z() + item
     elif (bool_0):
         item = item + self.segments[0].moc
     return self.ptTHR.z() + item
    def btnConstruct_Click(self):
        flag = FlightPlanBaseSimpleDlg.btnConstruct_Click(self)
        if not flag:
            return
        num = 0.0
        point3d = Point3D()
        point3d1 = Point3D()
        if not self.method_27(True):
            return


        
        point3d2 = self.parametersPanel.pnlTHR.getPoint3D()
        point3d3 = self.parametersPanel.pnlNavAid.getPoint3D()
        num1 = Unit.ConvertDegToRad(float(self.parametersPanel.txtDirection.Value))
        point3d4 = MathHelper.distanceBearingPoint(point3d2, num1 + 3.14159265358979, 1400)
        num2 = -1
        if MathHelper.smethod_115(point3d3, point3d2, point3d4):
            num2 = 1
        point3d5 = MathHelper.distanceBearingPoint(point3d4, num2 * 1.5707963267949 + num1, 150)
        point3d6 = MathHelper.distanceBearingPoint(point3d5, num1 + 3.14159265358979, 17120)
        if self.parametersPanel.cmbCategory.currentIndex() != 1:
            num = 0.267949192 
        elif self.parametersPanel.cmbCategory.currentIndex() == 1: 
            num = 0.577350269
        point3d7 = MathHelper.distanceBearingPoint(point3d6, num1 - num2 * 1.5707963267949, 150 + num * 17120)
        MathHelper.distanceBearingPoint(point3d5, num1, 150 / num)
        point3d = MathHelper.getIntersectionPoint(point3d3, MathHelper.distanceBearingPoint(point3d3, num1 + 1.5707963267949, 100), point3d2, point3d4)
        if point3d == None:
            raise UserWarning, Messages.ERR_FAILED_TO_CALCULATE_INTERSECTION_POINT
        num3 = MathHelper.calcDistance(point3d3, point3d) / 0.087488664
        if MathHelper.calcDistance(point3d, point3d4) >= num3:
            point3d1 = point3d4
            MathHelper.distanceBearingPoint(point3d6, num1 - num2 * 1.5707963267949, 1525.321791)
        else:
            point3d1 = MathHelper.distanceBearingPoint(point3d, num1 + 3.14159265358979, num3)
            MathHelper.distanceBearingPoint(point3d6, num1 - num2 * 1.5707963267949, 150 + 0.087488664 * (17120 - MathHelper.calcDistance(point3d4, point3d1)))
        MathHelper.distanceBearingPoint(point3d4, num1 + 3.14159265358979, 17120);

        constructionLayer = AcadHelper.createVectorLayer("AAConstruction", QGis.Line)
        AcadHelper.setGeometryAndAttributesInLayer(constructionLayer, PolylineArea([point3d7, point3d4]))
        AcadHelper.setGeometryAndAttributesInLayer(constructionLayer, PolylineArea([point3d1, point3d4, point3d5]))

        QgisHelper.appendToCanvas(define._canvas, [constructionLayer], SurfaceTypes.ApproachAlignment)
        QgisHelper.zoomToLayers([constructionLayer])
        self.resultLayerList = [constructionLayer]
예제 #6
0
 def method_6(self, polyline_0, point3d_0, double0, point3d1):
     double_0 = double0
     point3d_1 = point3d1
     #         Point3d point3d;
     flag = False
     origin = Point3D.get_Origin()
     i = 0
     for plylineAreaPoint in polyline_0:
         bulgeAt = plylineAreaPoint.Bulge
         if (bulgeAt != 0):
             point3dAt = plylineAreaPoint.Position
             point3d1 = polyline_0[0].Position if (
                 i == polyline_0.Count - 1) else polyline_0[i + 1].Position
             point3d = MathHelper.smethod_71(point3dAt, point3d1, bulgeAt)
             if (point3d != None):
                 point3d2 = MathHelper.distanceBearingPoint(
                     point3d, MathHelper.getBearing(point3d_0, point3d),
                     MathHelper.calcDistance(point3d, point3dAt))
                 if (flag):
                     if (self.orientation == OrientationType.Left):
                         if (not MathHelper.smethod_119(
                                 point3d2, point3d_0, origin)):
                             num = MathHelper.calcDistance(
                                 point3d_0, point3d2)
                             if (num > double_0):
                                 double_0 = num
                                 point3d_1 = point3d2
                             origin = point3d1
                             flag = True
                             continue
                         continue
                     elif (MathHelper.smethod_115(point3d2, point3d_0,
                                                  origin)):
                         continue
                 num = MathHelper.calcDistance(point3d_0, point3d2)
                 if (num > double_0):
                     double_0 = num
                     point3d_1 = point3d2
                 origin = point3d1
                 flag = True
         i += 1
     return (double_0, point3d_1)
 def getMOC(self, point3d_0):
     point3d = MathHelper.getIntersectionPoint(
         self.ptTHR, self.ptEND, point3d_0,
         MathHelper.distanceBearingPoint(point3d_0, self.trm90, 100))
     if (MathHelper.smethod_115(point3d, self.ptTHR, self.ptTHRm90)):
         num = MathHelper.calcDistance(self.ptTHR, point3d)
         for current in self.segments:
             if (num < current.xstart):
                 return current.moc
             if (num >= current.xstart and num <= current.xend):
                 return current.moc
             if self.segments.index(current) == len(self.segments) - 1:
                 return current.moc
             if (num <= self.segments[self.segments.index(current) +
                                      1].xstart):
                 item = current.moc
                 item1 = self.segments[self.segments.index(current) + 1].moc
                 num1 = (item1 - item) / (
                     self.segments[self.segments.index(current) + 1].xstart
                     - current.xend)
                 return item + (num - current.xend) * num1
     return self.segments[0].moc
    def vmethod_0(self, obstacle_0, returnList):
        double_0 = None
        double_3 = None
        point3d = MathHelper.getIntersectionPoint(
            self.ptTHR, self.ptEND, obstacle_0.Position,
            MathHelper.distanceBearingPoint(obstacle_0.Position, self.trm90,
                                            100))
        obstacleAreaResult_0 = ObstacleAreaResult.Primary
        num = MathHelper.calcDistance(self.ptTHR,
                                      point3d) - obstacle_0.tolerance
        if not MathHelper.smethod_115(point3d, self.ptTHR, self.ptTHRm90):
            num = self.xstart
        else:
            num = max([self.xstart, num])

        double_1 = self.mocma + (num - self.xstart) * self.tanslope
        double_2 = double_1
        if not MathHelper.pointInPolygon(self.primaryArea, obstacle_0.Position,
                                         obstacle_0.tolerance):
            double_0 = 0.0
            double_2 = 0.0
            for current in self.secondaryAreas:
                try:
                    num1 = None
                    num2 = None
                    resultList = []
                    obstacleAreaResult = current.imethod_1(
                        obstacle_0.Position, obstacle_0.tolerance, double_1,
                        resultList)
                    if obstacleAreaResult == ObstacleAreaResult.Outside:
                        obstacleAreaResult_0 = ObstacleAreaResult.Outside
                        continue
                    num1 = resultList[0]
                    num2 = resultList[1]

                    #                 obstacleAreaResult = current.imethod_1(obstacle_0.Position, obstacle_0.tolerance, double_1, out num1, out num2);
                    if obstacleAreaResult == ObstacleAreaResult.Primary:
                        obstacleAreaResult_0 = obstacleAreaResult
                        double_2 = num1
                        double_0 = num2
                        break
                    elif obstacleAreaResult == ObstacleAreaResult.Secondary and (
                            num1 > double_2 or double_2 == 0.0):
                        obstacleAreaResult_0 = obstacleAreaResult
                        double_2 = num1
                        double_0 = num2
                except IndexError:
                    pass
        if obstacleAreaResult_0 != ObstacleAreaResult.Outside:
            obstacle_0.area = obstacleAreaResult_0
            point3d1 = MathHelper.distanceBearingPoint(obstacle_0.Position,
                                                       self.tr,
                                                       obstacle_0.tolerance)
            double_3 = self.vmethod_3(point3d1, False)
            if obstacleAreaResult_0 == ObstacleAreaResult.Primary:
                double_3 = double_3 + (double_1 - double_2)

            returnList.append(double_0)
            returnList.append(double_1)
            returnList.append(double_2)
            returnList.append(double_3)

            return True
        return False
    def method_37(self, point3d_0, double_0, double_1, double_2):#, out Point3dCollection point3dCollection_0)
        point3dCollection_0 = Point3dCollection();
        if (self.parametersPanel.cmbApproachType.SelectedIndex != 0):
            if (self.parametersPanel.cmbRwyCode.SelectedIndex != 0):
                num2 = 120 if (self.parametersPanel.cmbRwyCode.SelectedIndex != 1 or not self.parametersPanel.chbAdCodeF.Checked) else 155
            else:
                num2 = 90;
            point3d = MathHelper.distanceBearingPoint(point3d_0, double_0, 60);
            point3d1 = MathHelper.distanceBearingPoint(point3d, double_0 + 1.5707963267949, num2 / 2).smethod_167(point3d_0.get_Z());
            point3d4 = MathHelper.distanceBearingPoint(point3d, double_0 - 1.5707963267949, num2 / 2).smethod_167(point3d_0.get_Z());
            point3d2 = MathHelper.distanceBearingPoint(point3d1, double_0, double_2).smethod_167(point3d_0.get_Z() + double_1);
            point3d3 = MathHelper.distanceBearingPoint(point3d4, double_0, double_2).smethod_167(point3d_0.get_Z() + double_1);
        else:
            try:
                metres = self.parametersPanel.txtStripWidth.Value.Metres
            except ValueError:
                raise UserWarning, "Strip Width is invalid!"
            point3d7 = MathHelper.distanceBearingPoint(point3d_0, double_0, 1400);
            point3d8 = MathHelper.distanceBearingPoint(point3d7, double_0 - 1.5707963267949, 100)
            try:
                dblTrack = float(self.parametersPanel.txtTrack.Value)
            except ValueError:
                raise UserWarning, "Track is invalid!"
            try:
                dblRwyDir = float(self.parametersPanel.txtRwyDir.Value)
            except ValueError:
                raise UserWarning, "Runway Direction is invalid!"
            listTurn = []
            num3 = MathHelper.smethod_77(dblTrack, dblRwyDir, AngleUnits.Degrees, listTurn)
            turnDirection = listTurn[0]
            if (num3 > 31):
                raise UserWarning, Messages.ERR_VSS_COURSE_CHANGE
            
            try:
                point3d5 = MathHelper.getIntersectionPoint(point3d7, point3d8, self.parametersPanel.txtTrack.captureRadialTool.startPoint, self.parametersPanel.txtTrack.captureRadialTool.endPoint)
            except AttributeError:
                raise UserWarning, "Please pick up Inbound Track!"
            if point3d5 == None:
                raise UserWarning, Messages.ERR_VSS_INTERSECTION_POINT_1400m
            num4 = MathHelper.calcDistance(point3d7, point3d5);
            if (num4 > 151):
                raise UserWarning, Messages.ERR_VSS_GATE
            try:
                dblThrFaf = float(self.parametersPanel.txtThrFaf.Value.Metres)
            except ValueError:
                raise UserWarning, "ThrFaf is invalid!"
            point3d6 = MathHelper.getIntersectionPoint(point3d_0, MathHelper.distanceBearingPoint(point3d_0, double_0, 100), self.parametersPanel.txtTrack.captureRadialTool.startPoint, self.parametersPanel.txtTrack.captureRadialTool.endPoint)
            if point3d6 == None:
                if (not MathHelper.smethod_115(point3d5, point3d_0, point3d7)):
                    num = 0.15;
                    num1 = (num4 + 201) / 1340;
                else:
                    num = (num4 + 201) / 1340;
                    num1 = 0.15;
            elif (not MathHelper.smethod_119(point3d6, point3d7, point3d8) and MathHelper.calcDistance(point3d6, point3d7) > 100):
                if (MathHelper.calcDistance(point3d6, point3d7) <= 1400):
                    raise UserWarning, Messages.ERR_VSS_INBOUND_TRACK
                if (not MathHelper.smethod_115(point3d5, point3d_0, point3d7)):
                    num = 0.15;
                    num1 = (num4 + 201) / 1340;
                else:
                    num = (num4 + 201) / 1340;
                    num1 = 0.15;
            elif (MathHelper.calcDistance(point3d6, point3d7) < dblThrFaf - 1400):
                point3d = MathHelper.distanceBearingPoint(point3d6, MathHelper.getBearing(self.parametersPanel.txtTrack.captureRadialTool.endPoint, self.parametersPanel.txtTrack.captureRadialTool.startPoint), 100);
                if (not MathHelper.smethod_115(point3d, point3d_0, point3d7)):
                    num = 0.15;
                    num1 = math.tan(Unit.ConvertDegToRad(num3) + math.atan(0.15));
                else:
                    num = math.tan(Unit.ConvertDegToRad(num3) + math.atan(0.15));
                    num1 = 0.15;
            elif (not MathHelper.smethod_115(point3d5, point3d_0, point3d7)):
                num = 0.15;
                num1 = (num4 + 201) / 1340;
            else:
                num = (num4 + 201) / 1340;
                num1 = 0.15;
            point3d = MathHelper.distanceBearingPoint(point3d_0, double_0, 60);
            point3d1 = MathHelper.distanceBearingPoint(point3d, double_0 - 1.5707963267949, metres / 2).smethod_167(point3d_0.get_Z());
            point3d4 = MathHelper.distanceBearingPoint(point3d, double_0 + 1.5707963267949, metres / 2).smethod_167(point3d_0.get_Z());
            point3d = MathHelper.distanceBearingPoint(point3d1, double_0, double_2);
            point3d2 = MathHelper.distanceBearingPoint(point3d, double_0 - 1.5707963267949, num * double_2).smethod_167(point3d_0.get_Z() + double_1);
            point3d = MathHelper.distanceBearingPoint(point3d4, double_0, double_2);
            point3d3 = MathHelper.distanceBearingPoint(point3d, double_0 + 1.5707963267949, num1 * double_2).smethod_167(point3d_0.get_Z() + double_1);

        point3dCollection_0.Add(point3d1);
        point3dCollection_0.Add(point3d2);
        point3dCollection_0.Add(point3d3);
        point3dCollection_0.Add(point3d4);
        return True, point3dCollection_0
 def __init__(self, point3d_0, double_0, speed_0, altitude_0, speed_1,
              double_1, double_2, orientationType_0):
     '''
     Constructor
     '''
     #         double num;
     #         double num1;
     #         double num2;
     #         double num3;
     #         double num4;
     #         Point3d point3d;
     #         Point3d point3d1;
     #         Point3d point3d2;
     #         Point3d point3d3;
     #         Point3d point3d4;
     #         Point3d point3d5;
     #         Point3d point3d6;
     #         Point3d point3d7;
     #         Point3d point3d8;
     #         Point3d point3d9;
     #         Point3d point3d10;
     #         Point3d point3d11;
     #         Point3d point3d12;
     #         Point3d point3d13;
     #         Point3d point3d14;
     #         Point3d point3d15;
     #         Point3d point3d16;
     #         Point3d point3d17;
     #         Point3d point3d18;
     #         Point3d point3d19;
     #         Point3d point3d20;
     #         Point3d point3d21;
     #         Point3d point3d22;
     #         Point3d point3d23;
     #         Point3d point3d24;
     #         Point3d point3d25;
     #         Point3d point3d26;
     #         Point3d point3d27;
     #         Point3d point3d28;
     #         Point3d point3d29;
     #         Point3d point3d30;
     #         Point3d point3d31;
     #         Point3d point3d32;
     #         Point3d point3d33;
     #         Point3d point3d34;
     #         Point3d point3d35;
     point3d_0 = point3d_0.smethod_167(0)
     self.ptBase = point3d_0
     self.trackDeg = MathHelper.smethod_3(double_0)
     self.trackRad = MathHelper.smethod_4(Unit.ConvertDegToRad(double_0))
     self.orientation = orientationType_0
     self.tas = Speed.smethod_0(speed_0, double_1, altitude_0)
     self.R = min([943.27 / self.tas.KilometresPerHour, 3])
     self.radius = Distance(
         Unit.ConvertKMToMeters(self.tas.KilometresPerHour /
                                (62.8318530717959 * self.R)))
     metresPerSecond = self.tas.MetresPerSecond
     metres = self.radius.Metres
     kilometresPerHour = speed_1.KilometresPerHour
     metresPerSecond1 = speed_1.MetresPerSecond
     r = 45 * metresPerSecond1 / self.R
     double2 = double_2 * 60
     self.ds = Distance(metresPerSecond * double2)
     self.wd = Distance(
         math.sqrt(self.ds.Metres * self.ds.Metres + 4 * metres * metres))
     num5 = 5 * metresPerSecond
     num6 = 11 * metresPerSecond
     num7 = (double2 - 5) * metresPerSecond
     num8 = (double2 - 5) * metresPerSecond
     num9 = (double2 + 21) * metresPerSecond
     num10 = (double2 + 21) * metresPerSecond
     num11 = 5 * metresPerSecond1
     num12 = 11 * metresPerSecond1
     num13 = num12 + r
     num14 = num12 + 2 * r
     num15 = num12 + 3 * r
     num16 = num12 + 4 * r
     num17 = num11 + 5 * r
     num18 = num11 + 6 * r
     num19 = (double2 + 6) * metresPerSecond1 + 4 * r
     num20 = (double2 + 6) * metresPerSecond1 + 4 * r
     num21 = num19 + 14 * metresPerSecond1
     num22 = num19 + 14 * metresPerSecond1
     num23 = num21 + r
     num24 = num21 + 2 * r
     num25 = num21 + 2 * r
     num26 = num21 + 3 * r
     num27 = num19 + 4 * r
     num28 = num21 + 4 * r
     r1 = 2 * metres + (double2 + 15) * metresPerSecond + (
         double2 + 26 + 195 / self.R) * metresPerSecond1
     num29 = 11 * metresPerSecond * math.cos(Unit.ConvertDegToRad(
         20)) + metres * (1 + math.sin(Unit.ConvertDegToRad(20))) + (
             double2 + 15) * metresPerSecond * math.tan(
                 Unit.ConvertDegToRad(5)) + (
                     double2 + 26 + 125 / self.R) * metresPerSecond1
     self.ias = speed_0
     self.wind = speed_1
     self.isa = double_1
     self.altitude = altitude_0
     self.time = double_2
     num30 = 1 if (orientationType_0 == OrientationType.Right) else -1
     turnDirection = TurnDirection.Right if (
         orientationType_0 == OrientationType.Right) else TurnDirection.Left
     turnDirection1 = TurnDirection.Left if (
         orientationType_0
         == OrientationType.Right) else TurnDirection.Right
     point3d36 = MathHelper.distanceBearingPoint(point3d_0, 0, 0)
     point3d37 = MathHelper.distanceBearingPoint(
         point3d36, Unit.ConvertDegToRad(double_0), num5)
     point3d38 = MathHelper.distanceBearingPoint(
         point3d36, Unit.ConvertDegToRad(double_0), num6)
     point3d39 = MathHelper.distanceBearingPoint(
         point3d38, Unit.ConvertDegToRad(double_0 + num30 * 90), metres)
     point3d40 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + num30 * -45), metres)
     point3d41 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0), metres)
     point3d42 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + num30 * 45), metres)
     point3d43 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + num30 * 90), metres)
     point3d39 = MathHelper.distanceBearingPoint(
         point3d37, Unit.ConvertDegToRad(double_0 + num30 * 90), metres)
     MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + num30 * 90), metres)
     point3d44 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + num30 * 135), metres)
     point3d45 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + 180), metres)
     point3d46 = MathHelper.distanceBearingPoint(
         point3d43, Unit.ConvertDegToRad(double_0 + 180 - num30 * 5), num7)
     point3d47 = MathHelper.distanceBearingPoint(
         point3d43, Unit.ConvertDegToRad(double_0 + 180 - num30 * 5), num9)
     point3d48 = MathHelper.distanceBearingPoint(
         point3d43, Unit.ConvertDegToRad(double_0 + 180 + num30 * 5), num8)
     point3d49 = MathHelper.distanceBearingPoint(
         point3d43, Unit.ConvertDegToRad(double_0 + 180 + num30 * 5), num10)
     point3d39 = MathHelper.distanceBearingPoint(
         point3d47, Unit.ConvertDegToRad(double_0 - num30 * 90), metres)
     point3d50 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + 180 - num30 * 45),
         metres)
     point3d51 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + 180), metres)
     MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + num30 * 90), metres)
     point3d39 = MathHelper.distanceBearingPoint(
         point3d49, Unit.ConvertDegToRad(double_0 - num30 * 90), metres)
     point3d52 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + 180), metres)
     point3d53 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 + 180 + num30 * 45),
         metres)
     point3d54 = MathHelper.distanceBearingPoint(
         point3d39, Unit.ConvertDegToRad(double_0 - num30 * 90), metres)
     point3d55 = MathHelper.distanceBearingPoint(
         point3d48, Unit.ConvertDegToRad(double_0 - num30 * 90), metres * 2)
     point3d, num = MathHelper.smethod_193(point3d38, num12, point3d40,
                                           num13, point3d41, num14, False)
     point3d1, num1 = MathHelper.smethod_193(point3d41, num14, point3d42,
                                             num15, point3d43, num16, False)
     point3d2, num2 = MathHelper.smethod_193(point3d43, num16, point3d44,
                                             num17, point3d45, num18, False)
     point3d3, num3 = MathHelper.smethod_193(point3d47, num21, point3d50,
                                             num23, point3d51, num24, False)
     point3d4, num4 = MathHelper.smethod_193(point3d52, num25, point3d53,
                                             num26, point3d54, num28, False)
     point3d56 = MathHelper.distanceBearingPoint(
         point3d4, Unit.ConvertDegToRad(double_0 - num30 * 90), num4)
     point3d57 = MathHelper.distanceBearingPoint(
         point3d56, Unit.ConvertDegToRad(double_0 + num30 * 90), num29)
     point3d58 = MathHelper.distanceBearingPoint(
         point3d3, Unit.ConvertDegToRad(double_0 + 180), num3)
     point3d58 = MathHelper.getIntersectionPoint(
         point3d_0,
         MathHelper.distanceBearingPoint(
             point3d_0, Unit.ConvertDegToRad(double_0 + 180), 100),
         point3d58,
         MathHelper.distanceBearingPoint(
             point3d58, Unit.ConvertDegToRad(double_0 + 90), 100))
     point3d59 = MathHelper.distanceBearingPoint(
         point3d4, Unit.ConvertDegToRad(double_0 + 180), num4)
     point3d59 = MathHelper.getIntersectionPoint(
         point3d_0,
         MathHelper.distanceBearingPoint(
             point3d_0, Unit.ConvertDegToRad(double_0 + 180), 100),
         point3d59,
         MathHelper.distanceBearingPoint(
             point3d59, Unit.ConvertDegToRad(double_0 + 90), 100))
     point3d5 = MathHelper.distanceBearingPoint(
         point3d58, Unit.ConvertDegToRad(double_0),
         r1) if (MathHelper.calcDistance(point3d_0, point3d58) >=
                 MathHelper.calcDistance(point3d_0, point3d59)
                 ) else MathHelper.distanceBearingPoint(
                     point3d59, Unit.ConvertDegToRad(double_0), r1)
     self.ptE = MathHelper.getIntersectionPoint(
         point3d5,
         MathHelper.distanceBearingPoint(
             point3d5, Unit.ConvertDegToRad(double_0 + 90), 100), point3d57,
         MathHelper.distanceBearingPoint(point3d57,
                                         Unit.ConvertDegToRad(double_0),
                                         100))
     self.nominal = PolylineArea()
     point3d56 = MathHelper.distanceBearingPoint(
         point3d_0, Unit.ConvertDegToRad(double_0 + num30 * 90), 2 * metres)
     point3d58 = MathHelper.distanceBearingPoint(
         point3d56, Unit.ConvertDegToRad(double_0 + 180), self.ds.Metres)
     point3d59 = MathHelper.distanceBearingPoint(
         point3d58, Unit.ConvertDegToRad(double_0 - num30 * 90), 2 * metres)
     self.nominal.Add(
         PolylineAreaPoint(
             point3d_0,
             MathHelper.smethod_59(Unit.ConvertDegToRad(double_0),
                                   point3d_0, point3d56)))
     self.nominal.method_1(point3d56)
     self.nominal.Add(
         PolylineAreaPoint(
             point3d58,
             MathHelper.smethod_59(Unit.ConvertDegToRad(double_0 + 180),
                                   point3d58, point3d59)))
     self.nominal.method_1(point3d59)
     self.nominal.method_1(point3d_0)
     self.wd = Distance(MathHelper.calcDistance(point3d_0, point3d58))
     self.area = PolylineArea()
     point3dCollection = []
     point3dCollection.append(
         MathHelper.distanceBearingPoint(point3d,
                                         Unit.ConvertDegToRad(double_0),
                                         num))
     point3dCollection.append(
         MathHelper.distanceBearingPoint(point3d1,
                                         Unit.ConvertDegToRad(double_0),
                                         num1))
     point3dCollection.append(
         MathHelper.distanceBearingPoint(
             point3d3, Unit.ConvertDegToRad(double_0 + num30 * 90), num3))
     point3dCollection.append(
         MathHelper.distanceBearingPoint(
             point3d3, Unit.ConvertDegToRad(double_0 + 180), num3))
     point3dCollection.append(
         MathHelper.distanceBearingPoint(
             point3d4, Unit.ConvertDegToRad(double_0 + 180), num4))
     point3dCollection.append(
         MathHelper.distanceBearingPoint(
             point3d4, Unit.ConvertDegToRad(double_0 - num30 * 90), num4))
     point3dCollection.append(
         MathHelper.distanceBearingPoint(point3d55,
                                         Unit.ConvertDegToRad(double_0),
                                         num27))
     point3d7, point3d8 = MathHelper.smethod_91(point3d3, num3, point3d4,
                                                num4, turnDirection)
     point3d9, point3d10 = MathHelper.smethod_91(point3d4, num4, point3d55,
                                                 num27, turnDirection)
     point3d11, point3d12 = MathHelper.smethod_91(point3d4, num4, point3d,
                                                  num, turnDirection)
     point3d13, point3d14 = MathHelper.smethod_91(point3d4, num4, point3d1,
                                                  num1, turnDirection)
     point3d15, point3d16 = MathHelper.smethod_91(point3d4, num4, point3d3,
                                                  num3, turnDirection)
     point3d17, point3d18 = MathHelper.smethod_91(point3d55, num27, point3d,
                                                  num, turnDirection)
     point3d19, point3d20 = MathHelper.smethod_91(point3d55, num27,
                                                  point3d1, num1,
                                                  turnDirection)
     point3d21, point3d22 = MathHelper.smethod_91(point3d55, num27,
                                                  point3d3, num3,
                                                  turnDirection)
     point3d23, point3d6 = MathHelper.smethod_91(point3d, num, point3d1,
                                                 num1, turnDirection)
     point3d24, point3d25 = MathHelper.smethod_91(point3d1, num1, point3d46,
                                                  num19, turnDirection)
     point3d26, point3d27 = MathHelper.smethod_91(point3d46, num19,
                                                  point3d3, num3,
                                                  turnDirection)
     point3d28, point3d29 = MathHelper.smethod_91(point3d43, num16,
                                                  point3d48, num20,
                                                  turnDirection1)
     point3d30, point3d31 = MathHelper.smethod_91(point3d48, num20,
                                                  point3d49, num22,
                                                  turnDirection1)
     if (num4 >= MathHelper.calcDistance(point3d4, point3d55) + num27):
         self.area.method_1(point3d7)
         self.area.method_3(
             point3d8,
             MathHelper.smethod_57(turnDirection, point3d8, point3d9,
                                   point3d4))
         self.area.method_1(point3d9)
         if (num27 <= MathHelper.calcDistance(point3d55, point3d1) + num1):
             flag = False
             if (num27 < MathHelper.calcDistance(point3d55, point3d) + num):
                 point3d39 = MathHelper.distanceBearingPoint(
                     point3d18,
                     MathHelper.getBearing(point3d17, point3d18) +
                     1.5707963267949 * num30, 100)
                 flag = MathHelper.smethod_119(
                     point3d23, point3d18,
                     point3d39) if (turnDirection != TurnDirection.Right
                                    ) else MathHelper.smethod_115(
                                        point3d23, point3d18, point3d39)
             if (flag):
                 self.area.Add(
                     PolylineAreaPoint(
                         point3d10,
                         MathHelper.smethod_57(turnDirection, point3d10,
                                               point3d17, point3d55)))
                 self.area.method_1(point3d17)
                 self.area.method_3(
                     point3d18,
                     MathHelper.smethod_57(turnDirection, point3d18,
                                           point3d23, point3d))
                 self.area.method_3(
                     point3d23,
                     MathHelper.smethod_57(turnDirection, point3d23,
                                           point3d24, point3d1))
                 self.area.method_1(point3d24)
             else:
                 self.area.Add(
                     PolylineAreaPoint(
                         point3d10,
                         MathHelper.smethod_57(turnDirection, point3d10,
                                               point3d19, point3d55)))
                 self.area.method_1(point3d19)
                 self.area.Add(
                     PolylineAreaPoint(
                         point3d20,
                         MathHelper.smethod_57(turnDirection, point3d20,
                                               point3d24, point3d1)))
                 self.area.method_1(point3d24)
             self.area.method_3(
                 point3d25,
                 MathHelper.smethod_57(turnDirection, point3d25, point3d26,
                                       point3d46))
             self.area.method_1(point3d26)
             self.area.method_3(
                 point3d27,
                 MathHelper.smethod_57(turnDirection, point3d27, point3d7,
                                       point3d3))
             self.area.method_1(point3d7)
         else:
             self.area.method_3(
                 point3d10,
                 MathHelper.smethod_57(turnDirection, point3d10, point3d21,
                                       point3d55))
             self.area.method_1(point3d21)
             self.area.method_3(
                 point3d22,
                 MathHelper.smethod_57(turnDirection, point3d22, point3d7,
                                       point3d3))
             self.area.method_1(point3d7)
     elif (num4 <= MathHelper.calcDistance(point3d4, point3d1) + num1):
         flag1 = False
         if (num4 < MathHelper.calcDistance(point3d4, point3d) + num):
             point3d39 = MathHelper.distanceBearingPoint(
                 point3d12,
                 MathHelper.getBearing(point3d11, point3d12) +
                 1.5707963267949 * num30, 100)
             flag1 = MathHelper.smethod_119(
                 point3d23, point3d12,
                 point3d39) if (turnDirection != TurnDirection.Right
                                ) else MathHelper.smethod_115(
                                    point3d23, point3d12, point3d39)
         if (flag1):
             self.area.method_1(point3d7)
             self.area.method_3(
                 point3d8,
                 MathHelper.smethod_57(turnDirection, point3d8, point3d11,
                                       point3d4))
             self.area.method_1(point3d11)
             self.area.method_3(
                 point3d12,
                 MathHelper.smethod_57(turnDirection, point3d12, point3d23,
                                       point3d))
             self.area.method_3(
                 point3d23,
                 MathHelper.smethod_57(turnDirection, point3d23, point3d24,
                                       point3d1))
             self.area.method_1(point3d24)
         else:
             self.area.method_1(point3d7)
             self.area.method_3(
                 point3d8,
                 MathHelper.smethod_57(turnDirection, point3d8, point3d13,
                                       point3d4))
             self.area.method_1(point3d13)
             self.area.method_3(
                 point3d14,
                 MathHelper.smethod_57(turnDirection, point3d14, point3d24,
                                       point3d1))
             self.area.method_1(point3d24)
         self.area.method_3(
             point3d25,
             MathHelper.smethod_57(turnDirection, point3d25, point3d26,
                                   point3d46))
         self.area.method_1(point3d26)
         self.area.method_3(
             point3d27,
             MathHelper.smethod_57(turnDirection, point3d27, point3d7,
                                   point3d3))
         self.area.method_1(point3d7)
     else:
         self.area.method_1(point3d7)
         self.area.method_3(
             point3d8,
             MathHelper.smethod_57(turnDirection, point3d8, point3d15,
                                   point3d4))
         self.area.method_1(point3d15)
         self.area.method_3(
             point3d16,
             MathHelper.smethod_57(turnDirection, point3d16, point3d7,
                                   point3d3))
         self.area.method_1(point3d7)
     self.outboundLineTop = PolylineArea()
     self.outboundLineTop.method_1(point3d24)
     self.outboundLineTop.method_3(
         point3d25,
         MathHelper.smethod_57(turnDirection, point3d25, point3d26,
                               point3d46))
     #         PolylineArea polylineArea = self.outboundLineTop;
     point3dArray = [point3d26, point3d27]
     self.outboundLineTop.method_7(point3dArray)
     self.outboundLineBottom = PolylineArea()
     self.outboundLineBottom.method_1(point3d28)
     self.outboundLineBottom.method_3(
         point3d29,
         MathHelper.smethod_57(turnDirection1, point3d29, point3d30,
                               point3d48))
     #         PolylineArea polylineArea1 = self.outboundLineBottom;
     point3dArray = [point3d30, point3d31]
     self.outboundLineBottom.method_7(point3dArray)
     self.spiral = PolylineArea()
     if (MathHelper.calcDistance(point3d, point3d_0) <= num):
         point3d32_39 = []
         MathHelper.smethod_34(
             point3d_0,
             MathHelper.distanceBearingPoint(point3d_0,
                                             Unit.ConvertDegToRad(double_0),
                                             100), point3d, num,
             point3d32_39)
         point3d32 = point3d32_39[0]
         point3d39 = point3d32_39[1]
         point3d33 = MathHelper.distanceBearingPoint(
             point3d, MathHelper.getBearing(point3d, point3d38), num)
         self.spiral.Add(
             PolylineAreaPoint(
                 point3d32,
                 MathHelper.smethod_57(turnDirection, point3d32, point3d33,
                                       point3d)))
     else:
         point3d32, point3d33 = MathHelper.smethod_91(
             point3d_0, 0, point3d, num, turnDirection)
         self.spiral.method_1(point3d32)
     point3d34, point3d35 = MathHelper.smethod_91(point3d, num, point3d1,
                                                  num1, turnDirection)
     self.spiral.Add(
         PolylineAreaPoint(
             point3d33,
             MathHelper.smethod_57(turnDirection, point3d33, point3d34,
                                   point3d)))
     point3d33 = point3d34
     point3d34, point3d35 = MathHelper.smethod_91(point3d1, num1, point3d2,
                                                  num2, turnDirection)
     self.spiral.Add(
         PolylineAreaPoint(
             point3d33,
             MathHelper.smethod_57(turnDirection, point3d33, point3d34,
                                   point3d1)))
     point3d33 = point3d34
     point3d39 = MathHelper.distanceBearingPoint(
         point3d2, Unit.ConvertDegToRad(double_0 + 180), num2)
     self.spiral.Add(
         PolylineAreaPoint(
             point3d33,
             MathHelper.smethod_57(turnDirection, point3d33, point3d39,
                                   point3d2)))
     self.spiral.method_1(point3d39)
     self.method_0(point3dCollection)
     self.method_1(
         MathHelper.distanceBearingPoint(point3d1,
                                         Unit.ConvertDegToRad(double_0),
                                         num1),
         MathHelper.distanceBearingPoint(
             point3d2, Unit.ConvertDegToRad(double_0 + num30 * 90), num2),
         MathHelper.distanceBearingPoint(
             point3d2, Unit.ConvertDegToRad(double_0 + 180), num2))
     point3d56 = MathHelper.distanceBearingPoint(
         point3d_0, Unit.ConvertDegToRad(double_0 + 180), 1000)
     point3d39 = MathHelper.getIntersectionPoint(point3d_0, point3d56,
                                                 point3d7, point3d8)
     point3d6_58 = []
     MathHelper.smethod_34(point3d_0, point3d56, point3d3, num3,
                           point3d6_58)
     point3d6 = point3d6_58[0]
     point3d58 = point3d6_58[1]
     point3d6_59 = []
     MathHelper.smethod_34(point3d_0, point3d56, point3d4, num4,
                           point3d6_59)
     point3d6 = point3d6_59[0]
     point3d59 = point3d6_59[1]
     if (orientationType_0 == OrientationType.Right):
         if (not MathHelper.smethod_119(point3d39, point3d3, point3d7) or
                 not MathHelper.smethod_115(point3d39, point3d4, point3d8)):
             self.ptC = point3d58 if (MathHelper.calcDistance(
                 point3d_0, point3d58) > MathHelper.calcDistance(
                     point3d_0, point3d59)) else point3d59
         else:
             self.ptC = point3d39
     elif (not MathHelper.smethod_115(point3d39, point3d3, point3d7)
           or not MathHelper.smethod_119(point3d39, point3d4, point3d8)):
         self.ptC = point3d58 if (
             MathHelper.calcDistance(point3d_0, point3d58) >
             MathHelper.calcDistance(point3d_0, point3d59)) else point3d59
     else:
         self.ptC = point3d39
     num31 = MathHelper.calcDistance(self.ptC, point3d43)
     point3d60 = MathHelper.distanceBearingPoint(
         self.ptC,
         MathHelper.getBearing(self.ptC, point3d43) +
         math.asin(num16 / num31) * num30,
         math.sqrt(num31 * num31 - num16 * num16))
     point3d6_58 = []
     MathHelper.smethod_34(self.ptC, point3d60, point3d1, num1, point3d6_58)
     point3d6 = point3d6_58[0]
     point3d58 = point3d6_58[1]
     point3d6_59 = []
     MathHelper.smethod_34(self.ptC, point3d60, point3d2, num2, point3d6_59)
     point3d6 = point3d6_59[0]
     point3d59 = point3d6_59[1]
     self.ptR = point3d58 if (
         MathHelper.calcDistance(self.ptC, point3d58) >
         MathHelper.calcDistance(self.ptC, point3d59)) else point3d59
예제 #11
0
    def checkObstacle(self, obstacle):
        if self.manualPolygon != None:
            if not self.manualPolygon.contains(obstacle.Position):
                return

        point3d = MathHelper.getIntersectionPoint(
            obstacle.Position,
            MathHelper.distanceBearingPoint(obstacle.Position, self.tr90p,
                                            100), self.ptTHR, self.ptTHR2)
        tolerance = MathHelper.calcDistance(self.ptTHR, point3d)
        if (not MathHelper.smethod_115(point3d, self.ptTHR, self.ptTHRm90)):
            tolerance = tolerance * -1
        num = tolerance + obstacle.tolerance
        tolerance = tolerance - obstacle.tolerance
        num1 = MathHelper.calcDistance(point3d,
                                       obstacle.Position) - obstacle.tolerance
        # if MathHelper.smethod_99(num1, 237.633410911, 0.0001):
        #     pass
        if (num1 < 0):
            num1 = 0
        # if MathHelper.smethod_115(obstacle.position, self.ptTHR, point3d):
        #     num1 *= 1 if tolerance > 0 else -1
        # else:
        #     num1 *= -1 if tolerance > 0 else 1
        z = obstacle.Position.z() + obstacle.trees

        for surface in self.surfacesList:
            oasSurfacesList = [
                OasSurface.OFZ, OasSurface.W, OasSurface.X1, OasSurface.X2,
                OasSurface.Y1, OasSurface.Y2, OasSurface.Z
            ]
            if len(surface.WS) > 3:
                oasSurfacesList.append(OasSurface.WS)

            for oasSurface in oasSurfacesList:
                num2 = 0
                num3 = tolerance
                num4 = num1

                calcList = [num3, num4, num2]

                if not surface.method_0(oasSurface, obstacle, calcList):
                    continue
                num3 = calcList[0]
                num4 = calcList[1]
                num2 = calcList[2]
                if (num2 < 0):
                    num2 = 0
                z1 = self.ptTHR.z() + num2
                zC = None
                if (z > z1):
                    if (self.method != OasMaEvaluationMethod.Standard):
                        zC = (self.xe + (num +
                                         (z - self.ptTHR.z()) / self.tanmacg)
                              ) * self.tanmacg * self.tangpa / (self.tanmacg +
                                                                self.tangpa)
                        zC = None if zC >= z - self.ptTHR.z(
                        ) else zC + self.ptTHR.z()
                    elif (num < -self.xe):
                        zC = self.ptTHR.z() + (
                            (z - self.ptTHR.z()) * (1 / self.tanmacg) +
                            (self.xe + num)) / (1 / self.tanmacg +
                                                1 / self.tangpa)
                    OasObstacles.resultCriticalObst.method_0(
                        obstacle, zC, oasSurface)

                if zC == None:
                    oca = obstacle.Position.z(
                    ) + obstacle.trees + self.hlAltitude.Metres
                    och = oca - self.ptTHR.z()
                else:
                    oca = zC + self.hlAltitude.Metres
                    och = oca - self.ptTHR.z()
                # if oca < 0:
                #     oca = None
                self.addObstacleToModel(obstacle, [
                    num3, num4, zC, z1, z - z1, oca, CriticalObstacleType.No
                    if z - z1 <= 0 else CriticalObstacleType.Yes, oasSurface
                ])

        return True
    def __init__(self, pinSVisualSegmentDep_0):
        IPinSVisualSegmentDep.__init__(self)
        self.RADIUS = 750
        self.OCS = 0
        self.OIS = 1
        self.poaOIS = PrimaryObstacleArea()
        self.poaOCS = PrimaryObstacleArea()
        self.paOIS = PolylineArea()
        self.paOCS = PolylineArea()
        self.selectionArea = []
        self.ptsOCSL = []
        self.ptsOCSR = []
        self.ptHRP = Point3D()
        self.ptIDF = Point3D()
        self.track = 0.0
        self.tang = 0.0
        self.elevOIS = 0.0
        self.cancelled = False

        self.ptIDF = pinSVisualSegmentDep_0.pnlIDF.getPoint3D()
        self.ptHRP = pinSVisualSegmentDep_0.pnlHRP.getPoint3D()
        self.track = MathHelper.smethod_4(
            Unit.ConvertDegToRad(
                float(pinSVisualSegmentDep_0.ui.txtTakeOffSurfaceTrack.Value)))
        num = MathHelper.getBearing(self.ptIDF, self.ptHRP)
        MathHelper.getBearing(self.ptHRP, self.ptIDF)
        altitude = pinSVisualSegmentDep_0.pnlMCAH.method_3(
            Altitude(self.ptHRP.get_Z()))
        metres = altitude.Metres
        if (metres < 90):
            raise UserWarning, Messages.ERR_INSUFFICIENT_MINIMUM_ALTITUDE
        altitude1 = pinSVisualSegmentDep_0.pnlMCAH.method_2(
            Altitude(self.ptHRP.get_Z()))
        metres1 = altitude1.Metres
        self.tang = 0.125
        num1 = 741
        num2 = 1482
        if (metres > 183):
            num3 = math.trunc((metres - 183) / 30)
            if ((metres - 183) % 30 > 0):
                num3 = num3 + 1
            num2 = num2 + num3 * 185
        num4 = 50
        if (metres > 183 and metres <= 304):
            num5 = math.trunc((metres - 183) / 30)
            if ((metres - 183) % 30 > 0):
                num5 = num5 + 1
            num4 = num4 - num5 * 5
            if (num4 < 30):
                num4 = 30
        elif (metres > 304):
            num4 = 30
        num6 = Unit.ConvertDegToRad(num4)
        num7 = MathHelper.calcDistance(self.ptIDF, self.ptHRP)
        if (num7 < 1000):
            eRRINSUFFICIENTSEGMENTLENGTHIDFHRP = Messages.ERR_INSUFFICIENT_SEGMENT_LENGTH_IDF_HRP
            distance = Distance(num2)
            raise UserWarning, eRRINSUFFICIENTSEGMENTLENGTHIDFHRP % distance.Metres
        turnDirectionList = []
        num8 = MathHelper.smethod_77(num, self.track, AngleUnits.Radians,
                                     turnDirectionList)
        turnDirection = turnDirectionList[0]
        if (num8 + num6 >= 3.14159265358979):
            eRRPINSCCHGLARGEUSEDIRECT = Messages.ERR_PINS_CCHG_LARGE_USE_DIRECT
            num9 = Unit.smethod_1(3.14159265358979 - num6)
            raise UserWarning, eRRPINSCCHGLARGEUSEDIRECT % num9
        self.paOIS = PolylineArea()
        self.paOIS.method_1(self.ptIDF)
        if (turnDirection == TurnDirection.Nothing
                or MathHelper.smethod_99(num8, 0, 0.1)):
            point3d = MathHelper.distanceBearingPoint(self.ptHRP, num - num6,
                                                      num2)
            point3d1 = MathHelper.distanceBearingPoint(self.ptHRP, num + num6,
                                                       num2)
            if (pinSVisualSegmentDep_0.ui.chbLeftTurnProhibited.isChecked()):
                point3d = MathHelper.distanceBearingPoint(
                    self.ptHRP, num, num2)
            elif (pinSVisualSegmentDep_0.ui.chbRightTurnProhibited.isChecked()
                  ):
                point3d1 = MathHelper.distanceBearingPoint(
                    self.ptHRP, num, num2)
            self.paOIS.method_3(
                point3d,
                MathHelper.smethod_57(TurnDirection.Right, point3d, point3d1,
                                      self.ptHRP))
            self.paOIS.method_1(point3d1)
        else:
            if num2 > num7:
                point3d2 = None
                point3d3 = None
            else:
                point3d2 = MathHelper.distanceBearingPoint(
                    self.ptHRP,
                    num - math.fabs(math.asin(num2 / num7)) - 1.5707963267949,
                    num2)
                point3d3 = MathHelper.distanceBearingPoint(
                    self.ptHRP,
                    num + math.fabs(math.asin(num2 / num7)) + 1.5707963267949,
                    num2)
            if (num8 < num6 and not pinSVisualSegmentDep_0.ui.
                    chbLeftTurnProhibited.isChecked()
                    and not pinSVisualSegmentDep_0.ui.chbRightTurnProhibited.
                    isChecked()):
                point3d = MathHelper.distanceBearingPoint(
                    self.ptHRP, self.track - num6, num2)
                point3d1 = MathHelper.distanceBearingPoint(
                    self.ptHRP, self.track + num6, num2)
                if (MathHelper.smethod_119(point3d2, self.ptHRP, point3d)):
                    point3d = point3d2
                if (MathHelper.smethod_115(point3d3, self.ptHRP, point3d1)):
                    point3d1 = point3d3
                self.paOIS.method_3(
                    point3d,
                    MathHelper.smethod_57(TurnDirection.Right, point3d,
                                          point3d1, self.ptHRP))
                self.paOIS.method_1(point3d1)
                self.paOIS.method_1(self.ptIDF)
            elif (turnDirection != TurnDirection.Left):
                point3d1 = MathHelper.distanceBearingPoint(
                    self.ptHRP, self.track + num6, num2)
                if (MathHelper.smethod_115(point3d3, self.ptHRP, point3d1)):
                    point3d1 = point3d3
                if (pinSVisualSegmentDep_0.ui.chbLeftTurnProhibited.isChecked(
                )):
                    point3d = MathHelper.distanceBearingPoint(
                        self.ptHRP, self.track, num2)
                    self.paOIS.method_1(self.ptHRP)
                    if not MathHelper.smethod_119(point3d3, self.ptHRP,
                                                  point3d):
                        self.paOIS.method_1(point3d)
                    else:
                        self.paOIS.method_3(
                            point3d,
                            MathHelper.smethod_57(TurnDirection.Right, point3d,
                                                  point3d1, self.ptHRP))
                        self.paOIS.method_1(point3d1)
                    self.paOIS.method_1(self.ptIDF)
                else:
                    num10 = Unit.ConvertDegToRad(30)
                    point3d = MathHelper.distanceBearingPoint(
                        self.ptHRP, self.track - num6, num2
                    ) if num8 - num6 <= num10 else MathHelper.distanceBearingPoint(
                        self.ptHRP, num + num10, num2)
                    if (MathHelper.smethod_119(point3d, self.ptIDF,
                                               self.ptHRP)):
                        self.paOIS.method_1(self.ptHRP)
                    self.paOIS.method_3(
                        point3d,
                        MathHelper.smethod_57(TurnDirection.Right, point3d,
                                              point3d1, self.ptHRP))
                    self.paOIS.method_1(point3d1)
                    self.paOIS.method_1(self.ptIDF)
            else:
                point3d = MathHelper.distanceBearingPoint(
                    self.ptHRP, self.track - num6, num2)
                if (MathHelper.smethod_119(point3d2, self.ptHRP, point3d)):
                    point3d = point3d2
                if (not pinSVisualSegmentDep_0.ui.chbRightTurnProhibited.
                        isChecked()):
                    num11 = Unit.ConvertDegToRad(30)
                    point3d1 = MathHelper.distanceBearingPoint(
                        self.ptHRP, self.track + num6, num2
                    ) if num8 - num6 <= num11 else MathHelper.distanceBearingPoint(
                        self.ptHRP, num - num11, num2)
                    self.paOIS.method_3(
                        point3d,
                        MathHelper.smethod_57(TurnDirection.Right, point3d,
                                              point3d1, self.ptHRP))
                    self.paOIS.method_1(point3d1)
                    if (MathHelper.smethod_115(point3d1, self.ptIDF,
                                               self.ptHRP)):
                        self.paOIS.method_1(self.ptHRP)
                    self.paOIS.method_1(self.ptIDF)
                else:
                    point3d1 = MathHelper.distanceBearingPoint(
                        self.ptHRP, self.track, num2)
                    if (MathHelper.smethod_115(point3d2, self.ptHRP,
                                               point3d1)):
                        self.paOIS.method_3(
                            point3d,
                            MathHelper.smethod_57(TurnDirection.Right, point3d,
                                                  point3d1, self.ptHRP))
                    self.paOIS.method_1(point3d1)
                    self.paOIS.method_1(self.ptHRP)
                    self.paOIS.method_1(self.ptIDF)


#         polyline = AcadHelper.smethod_131(self.paOIS);
#         polyline.set_Closed(true);
#         polyline = polyline.smethod_159(num1, OffsetGapType.Fillet, TurnDirection.Right);
        self.paOIS.offsetCurve(num1)
        self.poaOIS = PrimaryObstacleArea(self.paOIS)
        self.elevOIS = self.ptHRP.get_Z() + max([metres / 2 - 46, 46])
        metres2 = float(pinSVisualSegmentDep_0.ui.txtHSAW.Value.Metres)
        metres3 = float(pinSVisualSegmentDep_0.ui.txtHSAL.Value.Metres)
        num = MathHelper.smethod_4(
            Unit.ConvertDegToRad(
                float(pinSVisualSegmentDep_0.ui.txtTakeOffSurfaceTrack.Value)))
        self.paOCS = PolylineArea()
        self.ptsOCSL = []
        self.ptsOCSR = []
        point3d4 = MathHelper.distanceBearingPoint(
            MathHelper.distanceBearingPoint(self.ptHRP, num, metres3 / 2),
            num - 1.5707963267949, metres2 / 2)
        point3d5 = MathHelper.distanceBearingPoint(
            MathHelper.distanceBearingPoint(self.ptHRP, num, metres3 / 2),
            num + 1.5707963267949, metres2 / 2)
        num12 = math.atan(
            0.1
        ) if pinSVisualSegmentDep_0.ui.cmbDepartureType.SelectedIndex == 0 else math.atan(
            0.15)
        num13 = 152 / self.tang
        num14 = (120 - metres2 / 2) / math.tan(num12)
        self.ptsOCSL = []
        self.ptsOCSL.append(point3d4)
        self.ptsOCSL.append(
            MathHelper.distanceBearingPoint(
                point3d4, num - num12,
                num14 * math.cos(num12)).smethod_167(self.ptHRP.get_Z() +
                                                     num14 * self.tang))
        self.ptsOCSL.append(
            MathHelper.distanceBearingPoint(
                self.ptsOCSL[1], num,
                num13 - num14).smethod_167(self.ptHRP.get_Z() + 152))
        self.ptsOCSR = []
        self.ptsOCSR.append(point3d5)
        self.ptsOCSR.append(
            MathHelper.distanceBearingPoint(
                point3d5, num + num12,
                num14 * math.cos(num12)).smethod_167(self.ptHRP.get_Z() +
                                                     num14 * self.tang))
        self.ptsOCSR.append(
            MathHelper.distanceBearingPoint(
                self.ptsOCSR[1], num,
                num13 - num14).smethod_167(self.ptHRP.get_Z() + 152))
        self.paOCS = PolylineArea()
        for point in self.ptsOCSL:
            self.paOCS.method_1(point)
        for j in range(len(self.ptsOCSR) - 1, -1, -1):
            self.paOCS.method_1(self.ptsOCSR[j])
        self.paOCS.method_10()
        self.poaOCS = PrimaryObstacleArea(self.paOCS)
        self.selectionArea = (PrimaryObstacleArea(self.paOIS)).SelectionArea