Exemplo n.º 1
0
        public Cross_section(string name, double station,
                             double leftEdgeElev, double rightEdgeElev, double midElev,
                             double width, List <MillingElement> millingElements, bool isToSectionView = false, ThreeDPoint midPointOfCrossSection = null)
        {
            DeltaLevelLeft     = midElev - leftEdgeElev;
            DeltaLevelRight    = midElev - rightEdgeElev;
            SlopeLeft          = (DeltaLevelLeft) / (width / 2);
            SlopeRight         = (DeltaLevelRight) / (width / 2);
            Width              = width;
            MillingElements    = millingElements;
            Name               = name;
            LeftEdgeElevation  = leftEdgeElev;
            RightEdgeElevation = rightEdgeElev;

            Station = station;

            MidPoint_Elevation = midElev;

            if (!isToSectionView)
            {
                ChangeStartEndPointForTheDiagram();
            }
            if (midPointOfCrossSection != null)
            {
                MidPointOfCrossSection = midPointOfCrossSection;
            }
        }
Exemplo n.º 2
0
        public Cross_section_for_sectionView(Cross_section crossSection, ThreeDPoint insertPointLocation, double insertPointElevation) :
            base(crossSection.Name, crossSection.Station, crossSection.LeftEdgeElevation, crossSection.RightEdgeElevation, crossSection.MidPoint_Elevation, crossSection.Width, crossSection.MillingElements,
                 true, crossSection.MidPointOfCrossSection)
        {
            base.ProjLayerThick        = crossSection.ProjLayerThick;
            this.InsertPoint_Location  = insertPointLocation;
            this.InsertPoint_Elevation = insertPointElevation;

            SwapX_and_Y_Coordinates();
            MoveCrossSectionToSectionView();
        }
Exemplo n.º 3
0
        // find mid point of cross section
        private ThreeDPoint FindMidPoint()
        {
            double midX;
            double midY;

            if (MillingElements.Count > 0)
            {
                midY = Math.Abs(MillingElements[0].RefStart);
                //midY = (MillingElements[0].StartPoint.CoordinateY + MillingElements[MillingElements.Count - 1].EndPoint.CoordinateY) / 2;
                midX = MillingElements[0].StartPoint.CoordinateX;
                ThreeDPoint midPoint = new ThreeDPoint(midX, midY);
                return(midPoint);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 4
0
        private double FindDeltaAcordingToSlope(ThreeDPoint midPoint, ThreeDPoint thePoint)
        {
            double delta = 0;

            if (midPoint.CoordinateY != thePoint.CoordinateY)
            {
                if (midPoint.CoordinateY < thePoint.CoordinateY)
                {
                    delta = (thePoint.CoordinateY - midPoint.CoordinateY) * SlopeLeft;
                }
                else
                {
                    delta = (midPoint.CoordinateY - thePoint.CoordinateY) * SlopeRight;
                }
            }

            return(delta);
        }
Exemplo n.º 5
0
        private void ChangeStartEndPointForTheDiagram()
        {
            // first change Y cordinate according to center line
            foreach (MillingElement singleElement in MillingElements)
            {
                // change the Y coordinate
                singleElement.StartPoint.CoordinateY = singleElement.StartPoint.CoordinateY + Width / 2;
                singleElement.EndPoint.CoordinateY   = singleElement.EndPoint.CoordinateY + Width / 2;
            }
            // find mid point
            MidPointOfCrossSection = FindMidPoint();
            ThreeDPoint midPointOfCrossSection = MidPointOfCrossSection;

            // change X coordinate of each start and end point to correspond to slope
            foreach (MillingElement singleElement in MillingElements)
            {
                // change the X coordinate
                singleElement.StartPoint.CoordinateX = singleElement.StartPoint.CoordinateX - FindDeltaAcordingToSlope(midPointOfCrossSection, singleElement.StartPoint);
                singleElement.EndPoint.CoordinateX   = singleElement.EndPoint.CoordinateX - FindDeltaAcordingToSlope(midPointOfCrossSection, singleElement.EndPoint);
            }
        }
Exemplo n.º 6
0
 // set end point
 private void SetEndPoint()
 {
     EndPoint = new ThreeDPoint((Station + refStart) * scaleX, (LineStart - LineLength - refStart) * scaleY);
 }
Exemplo n.º 7
0
 // set start point
 private void SetStartPoint()
 {
     StartPoint = new ThreeDPoint((Station + refStart) * scaleX, (LineStart - refStart) * scaleY);
 }