Esempio n. 1
0
        getStationTargetAlign(double dblStaRF, double dblOffRR, Alignment objAlignRF, Alignment objAlignTAR)
        {
            AlignmentEntity objAlignEntRF    = default(AlignmentEntity);
            AlignmentArc    objAlignEntArcRF = default(AlignmentArc);
            AlignmentLine   objAlignEntTanRF = default(AlignmentLine);

            AlignmentEntity objAlignEntTAR    = default(AlignmentEntity);
            AlignmentArc    objAlignEntArcTAR = default(AlignmentArc);
            AlignmentLine   objAlignEntTanTAR = default(AlignmentLine);

            double dblAngEntRF  = 0;
            double dblAngEntTAR = 0;

            double dblSkew   = 0;
            double dblOffRF  = 0;
            double dblStaTAR = 0;

            objAlignEntRF = objAlignRF.Entities.EntityAtStation(dblStaRF);
            if (objAlignEntRF.EntityType == AlignmentEntityType.Arc)
            {
                objAlignEntArcRF = (AlignmentArc)objAlignEntRF;
            }
            else if (objAlignEntRF.EntityType == AlignmentEntityType.Line)
            {
                objAlignEntTanRF = (AlignmentLine)objAlignEntRF;
            }

            Point2d pnt2dBEG = objAlignEntTanRF.StartPoint;
            Point2d pnt2dEND = objAlignEntTanRF.EndPoint;

            dblAngEntRF = pnt2dBEG.getDirection(pnt2dEND);

            objAlignRF.DistanceToAlignment(dblStaRF, objAlignTAR, AlignmentSide.Both, ref dblOffRF, ref dblStaTAR);

            objAlignEntTAR = objAlignTAR.Entities.EntityAtStation(dblStaTAR);
            if (objAlignEntTAR.EntityType == AlignmentEntityType.Arc)
            {
                objAlignEntArcTAR = (AlignmentArc)objAlignEntRF;
            }
            else if (objAlignEntTAR.EntityType == AlignmentEntityType.Line)
            {
                objAlignEntTanTAR = (AlignmentLine)objAlignEntTAR;
            }

            pnt2dBEG = objAlignEntTanTAR.StartPoint;

            pnt2dEND = objAlignEntTanTAR.EndPoint;

            dblAngEntTAR = pnt2dBEG.getDirection(pnt2dEND);

            dblSkew = dblAngEntTAR - dblAngEntRF;

            //dblStaTAR = dblStaRF * System.Math.Cos(dblSkew)
            return(dblStaTAR);
        }