예제 #1
0
        /// <summary>
        /// 对于正常的左右倾斜梁的上标注;
        /// </summary>
        public void DrawXUpDimNormal()
        {
            bool bNeedUpDim = false;

            List <Point> upDimPointList = new List <Point>();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetBeamDoorFrontViewInfo().GetXUpDimSetNormal();

                if (partDimSet != null && partDimSet.Count > 0)
                {
                    bNeedUpDim = true;
                    upDimPointList.AddRange(partDimSet.GetDimPointList());
                }
            }

            if (bNeedUpDim == false)
            {
                return;
            }

            CMrPart topBeam = CMrBeamDoorManager.GetInstance().mTopBeam;

            upDimPointList.Add(topBeam.mLeftTopPoint);
            upDimPointList.Add(topBeam.mRightTopPoint);

            Comparison <Point> sorterX = new Comparison <Point>(CDimTools.ComparePointX);

            upDimPointList.Sort(sorterX);

            PointList pointList = new PointList();

            foreach (Point point in upDimPointList)
            {
                pointList.Add(point);
            }

            Point  MinXPoint   = upDimPointList[0];
            double dimDistance = Math.Abs(CCommonPara.mViewMaxY - MinXPoint.Y) + 2 * CCommonPara.mDefaultDimDistance;

            Vector upDimVector = CMrBeamDoorManager.GetInstance().GetTopBeamUpDimVector();

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mSizeDimPath);

            //再标注一个总长度;
            pointList.Clear();

            Point firstPoint  = topBeam.mLeftTopPoint;
            Point secondPoint = topBeam.mRightTopPoint;

            pointList.Add(firstPoint);
            pointList.Add(secondPoint);

            dimDistance = Math.Abs(CCommonPara.mViewMaxY - firstPoint.Y) + 4 * CCommonPara.mDefaultDimDistance;

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mSizeDimPath);
        }
        /// <summary>
        /// 绘制主梁右侧Y方向上的标注;
        /// </summary>
        private void DrawYMainRightDim()
        {
            List <Point> rightDimPointList = new List <Point>();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetCylinderDoorFrontViewInfo().GetYPartMainRightDimSet();

                if (partDimSet != null && partDimSet.Count > 0)
                {
                    rightDimPointList.AddRange(partDimSet.GetDimPointList());
                }
            }

            //1.得到主梁中间需要整体进行标注的标注集;
            CMrDimSet mrDimSet = GetYNormalMiddlePartDimSet();

            rightDimPointList.AddRange(mrDimSet.GetDimPointList());

            //2.得到顶部需要进行标注的零部件;
            CMrDimSet mrTopPartDimSet = GetTopPartDimSet(2);

            rightDimPointList.AddRange(mrTopPartDimSet.GetDimPointList());

            //3.得到主梁上螺钉组的标注集;
            CMrDimSet mrBoltDimSet = GetMainBeamYRightBoltDimSet();

            rightDimPointList.AddRange(mrBoltDimSet.GetDimPointList());

            Comparison <Point> sorterY = new Comparison <Point>(CDimTools.ComparePointY);

            rightDimPointList.Sort(sorterY);

            PointList pointList = new PointList();

            foreach (Point point in rightDimPointList)
            {
                pointList.Add(point);
            }

            Point  minYPoint      = rightDimPointList[0];
            double dimDistance    = Math.Abs(CCommonPara.mViewMaxX - minYPoint.X) + 2 * CCommonPara.mDefaultDimDistance;
            Vector rightDimVector = new Vector(1, 0, 0);

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, rightDimVector, dimDistance, CCommonPara.mSizeDimPath);

            //2.标注一个主尺寸;
            Point maxYPoint = rightDimPointList[rightDimPointList.Count - 1];

            pointList.Clear();
            pointList.Add(minYPoint);
            pointList.Add(maxYPoint);

            dimDistance = dimDistance + 2 * CCommonPara.mDefaultDimDistance;
            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, rightDimVector, dimDistance, CCommonPara.mMainSizeDimPath);
        }
예제 #3
0
        /// <summary>
        /// 绘制第三种中间梁的下标注;
        /// </summary>
        public void DrawXDownDimMiddle()
        {
            bool bNeedDownDim = false;

            List <Point> downDimPointList = new List <Point>();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetBeamDoorFrontViewInfo().GetXDownDimSetMiddle();

                if (partDimSet != null && partDimSet.Count > 0)
                {
                    bNeedDownDim = true;
                    downDimPointList.AddRange(partDimSet.GetDimPointList());
                }
            }
            if (bNeedDownDim == false)
            {
                return;
            }

            CMrPart topBeam         = CMrBeamDoorManager.GetInstance().mTopBeam;
            CMrPart leftBottomBeam  = CMrBeamDoorManager.GetInstance().mLeftBottomBeam;
            CMrPart rightBottomBeam = CMrBeamDoorManager.GetInstance().mRightBottomBeam;

            downDimPointList.Add(leftBottomBeam.mLeftBottomPoint);
            downDimPointList.Add(topBeam.mLeftTopPoint);
            downDimPointList.Add(rightBottomBeam.mRightBottomPoint);
            downDimPointList.Add(topBeam.mRightTopPoint);

            Comparison <Point> sorterX = new Comparison <Point>(CDimTools.ComparePointX);

            downDimPointList.Sort(sorterX);

            PointList pointList = new PointList();

            foreach (Point point in downDimPointList)
            {
                pointList.Add(point);
            }

            Point MinXPoint = downDimPointList[0];

            double dimDistance = Math.Abs(CCommonPara.mViewMinY - MinXPoint.Y) + 1.2 * CCommonPara.mDefaultDimDistance;

            Vector downDimVector = new Vector(0, -1, 0);

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, downDimVector, dimDistance, CCommonPara.mSizeDimPath);
        }
예제 #4
0
        /// <summary>
        /// 对于正常的左右倾斜梁的下标注;
        /// </summary>
        public void DrawXDownDimNormal()
        {
            List <Point> downDimPointList = new List <Point>();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetBeamDoorFrontViewInfo().GetXDownDimSetNormal();

                if (partDimSet != null && partDimSet.Count > 0)
                {
                    downDimPointList.AddRange(partDimSet.GetDimPointList());
                }
            }

            CMrPart topBeam    = CMrBeamDoorManager.GetInstance().mTopBeam;
            CMrPart bottomBeam = CMrBeamDoorManager.GetInstance().mBottonBeam;
            CMrPart leftBeam   = CMrBeamDoorManager.GetInstance().mLeftBeam;
            CMrPart rightBeam  = CMrBeamDoorManager.GetInstance().mRightBeam;

            downDimPointList.Add(topBeam.mLeftTopPoint);
            downDimPointList.Add(bottomBeam.mLeftBottomPoint);
            downDimPointList.Add(topBeam.mRightTopPoint);
            downDimPointList.Add(bottomBeam.mRightBottomPoint);

            Comparison <Point> sorterX = new Comparison <Point>(CDimTools.ComparePointX);

            downDimPointList.Sort(sorterX);

            PointList pointList = new PointList();

            foreach (Point point in downDimPointList)
            {
                pointList.Add(point);
            }

            double dimDistance   = Math.Abs(CCommonPara.mViewMinY - downDimPointList[0].Y) + 1.5 * CCommonPara.mDefaultDimDistance;
            Vector downDimVector = new Vector(0, -1, 0);

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, downDimVector, dimDistance, CCommonPara.mSizeDimPath);
        }
        /// <summary>
        /// 绘制主梁左侧Y方向上的标注;
        /// </summary>
        private void DrawYMainLeftDim()
        {
            List <Point> leftDimPointList = new List <Point>();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetCylinderDoorFrontViewInfo().GetYPartMainLeftDimSet();

                if (partDimSet != null && partDimSet.Count > 0)
                {
                    leftDimPointList.AddRange(partDimSet.GetDimPointList());
                }
            }

            //1.得到顶部需要进行标注的零部件;
            CMrDimSet mrTopPartDimSet = GetTopPartDimSet(1);

            leftDimPointList.AddRange(mrTopPartDimSet.GetDimPointList());

            Comparison <Point> sorterY = new Comparison <Point>(CDimTools.ComparePointY);

            leftDimPointList.Sort(sorterY);

            PointList pointList = new PointList();

            foreach (Point point in leftDimPointList)
            {
                pointList.Add(point);
            }

            Point  MinXPoint      = leftDimPointList[0];
            double dimDistance    = Math.Abs(CCommonPara.mViewMinX - MinXPoint.X) + 2 * CCommonPara.mDefaultDimDistance;
            Vector rightDimVector = new Vector(-1, 0, 0);

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, rightDimVector, dimDistance, CCommonPara.mSizeDimPath);
        }
예제 #6
0
        /// <summary>
        /// 绘制中间主梁类型为3时向上的标注;
        /// </summary>
        private void DrawTypeMiddle3XUpDim()
        {
            //1.绘制左侧上方的标注;
            bool bNeedUpDim = false;

            List <Point> upDimPointList = new List <Point>();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetBeamDoorFrontViewInfo().GetTypeMiddle3XUpDimSetMiddle();

                if (partDimSet != null && partDimSet.Count > 0)
                {
                    bNeedUpDim = true;
                    upDimPointList.AddRange(partDimSet.GetDimPointList());
                }
            }
            if (bNeedUpDim == false)
            {
                return;
            }

            CMrPart topBeam = CMrBeamDoorManager.GetInstance().mTopBeam;

            Point leftTopPt  = topBeam.mLeftTopPoint;
            Point rightTopPt = topBeam.mRightTopPoint;

            upDimPointList.Add(leftTopPt);
            upDimPointList.Add(rightTopPt);

            Comparison <Point> sorterX = new Comparison <Point>(CDimTools.ComparePointX);

            upDimPointList.Sort(sorterX);

            PointList pointList = new PointList();

            foreach (Point point in upDimPointList)
            {
                pointList.Add(point);
            }

            double dimDistance = Math.Abs(CCommonPara.mViewMaxY - upDimPointList[0].Y) + 2 * CCommonPara.mDefaultDimDistance;

            //计算标注向量;
            Vector directVector = new Vector(rightTopPt.X - leftTopPt.X, rightTopPt.Y - leftTopPt.Y, 0);

            directVector.Normalize();
            Vector upDimVector = new Vector(directVector.Y, -directVector.X, 0);

            MrSlopeType mrSlopeType = CDimTools.GetInstance().JudgeLineSlope(directVector, new Point(0, 0, 0));

            if (mrSlopeType == MrSlopeType.LESSTHAN_ZERO)
            {
                upDimVector = new Vector(Math.Abs(upDimVector.X), Math.Abs(upDimVector.Y), 0);
            }
            else if (mrSlopeType == MrSlopeType.MORETHAN_ZERO)
            {
                upDimVector = new Vector(-Math.Abs(upDimVector.X), Math.Abs(upDimVector.Y), 0);
            }

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mSizeDimPath);

            //2.再标注一个总长度;
            pointList.Clear();
            pointList.Add(leftTopPt);
            pointList.Add(rightTopPt);

            dimDistance = Math.Abs(CCommonPara.mViewMaxY - leftTopPt.Y) + 4 * CCommonPara.mDefaultDimDistance;

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mSizeDimPath);
        }
예제 #7
0
        /// <summary>
        /// 绘制中间主梁的类型为1和2时向上的标注;
        /// </summary>
        private void DrawTypeMiddle1And2XUpDim()
        {
            //1.绘制左侧上方的标注;
            bool bNeedUpDim = false;

            List <Point> upDimPointList = new List <Point>();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetBeamDoorFrontViewInfo().GetLeftXUpDimSetMiddle();

                if (partDimSet != null && partDimSet.Count > 0)
                {
                    bNeedUpDim = true;
                    upDimPointList.AddRange(partDimSet.GetDimPointList());
                }
            }
            if (bNeedUpDim == false)
            {
                return;
            }

            CMrPart topBeam = CMrBeamDoorManager.GetInstance().mTopBeam;

            //把中间Y值最大的点加入到标注链表中;
            upDimPointList.Add(CMrBeamDoorManager.GetInstance().mMidMaxPoint);
            upDimPointList.Add(topBeam.mLeftTopPoint);

            Comparison <Point> sorterX = new Comparison <Point>(CDimTools.ComparePointX);

            upDimPointList.Sort(sorterX);

            PointList pointList = new PointList();

            foreach (Point point in upDimPointList)
            {
                pointList.Add(point);
            }

            Point minXPoint1 = upDimPointList[0];

            double dimDistance = Math.Abs(CCommonPara.mViewMaxY - minXPoint1.Y) + 2 * CCommonPara.mDefaultDimDistance;
            Vector upDimVector = CMrBeamDoorManager.GetInstance().mLeftTopVector;

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mSizeDimPath);

            //2.再标注左侧的一个总长度;
            pointList.Clear();

            Point firstPoint  = topBeam.mLeftTopPoint;
            Point secondPoint = CMrBeamDoorManager.GetInstance().mMidMaxPoint;

            pointList.Add(firstPoint);
            pointList.Add(secondPoint);

            dimDistance = Math.Abs(CCommonPara.mViewMaxY - firstPoint.Y) + 4 * CCommonPara.mDefaultDimDistance;

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mSizeDimPath);

            //3.绘制右侧上方的标注;
            bNeedUpDim = false;
            upDimPointList.Clear();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetBeamDoorFrontViewInfo().GetRightXUpDimSetMiddle();

                if (partDimSet != null && partDimSet.Count > 0)
                {
                    bNeedUpDim = true;
                    upDimPointList.AddRange(partDimSet.GetDimPointList());
                }
            }
            if (bNeedUpDim == false)
            {
                return;
            }

            //把中间Y值最大的点加入到标注链表中;
            upDimPointList.Add(CMrBeamDoorManager.GetInstance().mMidMaxPoint);
            upDimPointList.Add(topBeam.mRightTopPoint);
            upDimPointList.Sort(sorterX);

            int nCount = upDimPointList.Count;

            upDimPointList.Reverse(0, nCount);

            pointList.Clear();

            foreach (Point point in upDimPointList)
            {
                pointList.Add(point);
            }

            Point minXPoint2 = upDimPointList[0];

            dimDistance = Math.Abs(CCommonPara.mViewMaxY - minXPoint2.Y) + 2 * CCommonPara.mDefaultDimDistance;
            upDimVector = CMrBeamDoorManager.GetInstance().mRightTopVector;

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mSizeDimPath);

            //4.再标注右侧的一个总长度;
            pointList.Clear();

            firstPoint  = topBeam.mRightTopPoint;
            secondPoint = CMrBeamDoorManager.GetInstance().mMidMaxPoint;

            pointList.Add(firstPoint);
            pointList.Add(secondPoint);

            dimDistance = Math.Abs(CCommonPara.mViewMaxY - firstPoint.Y) + 4 * CCommonPara.mDefaultDimDistance;
            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mSizeDimPath);
        }
예제 #8
0
        /// <summary>
        /// 绘制主梁中间的零部件标注;
        /// 主梁中间的零部件只有法向与主梁顶部部件平行的才进行标注;
        /// </summary>
        private void DrawMainBeamMiddlePartDimNormal()
        {
            CMrPart topBeam = CMrBeamDoorManager.GetInstance().mTopBeam;

            Point leftTopPoint  = topBeam.mLeftTopPoint;
            Point rightTopPoint = topBeam.mRightTopPoint;

            CMrBeamDoorManager.GetInstance().BuildMostNearPartToPartList(mMrPartList);

            Dictionary <CMrPart, List <CMrPart> > dicPartToPartList = CMrBeamDoorManager.GetInstance().mDicPartToPartList;

            List <CMrDimSet> mrDimSetList = new List <CMrDimSet>();

            foreach (CMrPart mostNearPart in dicPartToPartList.Keys)
            {
                List <CMrPart> mrPartList = dicPartToPartList[mostNearPart];

                if (mrPartList.Count == 0)
                {
                    continue;
                }

                //(1).与顶板平行方向标注螺钉;
                CMrDimSet mrDimSet = new CMrDimSet();

                MrSlopeType slopeType = CDimTools.GetInstance().JudgeLineSlope(leftTopPoint, rightTopPoint);

                if (slopeType == MrSlopeType.MORETHAN_ZERO)
                {
                    mrDimSet.AddPoint(mostNearPart.mRightTopPoint);
                }
                else
                {
                    mrDimSet.AddPoint(mostNearPart.mLeftTopPoint);
                }

                foreach (CMrPart mrPart in mrPartList)
                {
                    CMrBoltArray mrBoltArray = mrPart.GetBoltArrayList()[0];
                    Point        boltPoint   = mrBoltArray.GetMaxXPoint();
                    mrDimSet.AddPoint(boltPoint);
                }

                mrDimSet.mDimVector   = CMrBeamDoorManager.GetInstance().GetTopBeamUpDimVector();
                mrDimSet.mDimDistance = CCommonPara.mDefaultDimDistance;
                mrDimSetList.Add(mrDimSet);

                //(2).与顶板竖直方向标注;
                mrDimSet = new CMrDimSet();
                mrDimSet.AddPoint(mrPartList[0].mRightBottomPoint);

                Point fontPt = CDimTools.GetInstance().ComputeFootPointToLine(mrPartList[0].mRightBottomPoint, topBeam.mLeftTopPoint, topBeam.mRightTopPoint);
                mrDimSet.AddPoint(fontPt);
                mrDimSet.mDimDistance = CCommonPara.mDefaultDimDistance;

                mrDimSet.mDimVector = new Vector(rightTopPoint.X - leftTopPoint.X, rightTopPoint.Y - leftTopPoint.Y, 0);
                mrDimSetList.Add(mrDimSet);
            }
            foreach (CMrDimSet mrDimSet in mrDimSetList)
            {
                List <Point> dimPointList = mrDimSet.GetDimPointList();

                PointList pointList = new PointList();

                foreach (Point point in dimPointList)
                {
                    pointList.Add(point);
                }

                Vector dimVector = mrDimSet.mDimVector;
                double length    = mrDimSet.mDimDistance;

                CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, length, CCommonPara.mSizeDimPath);
            }
        }