Exemplo n.º 1
0
        /// <summary>
        /// 判断右侧的零部件;
        /// </summary>
        /// <param name="mrPart"></param>
        private void JudgeRightPart(CMrPart mrPart)
        {
            double minX = mrPart.GetMinXPoint().X;
            double maxX = mrPart.GetMinXPoint().X;
            double minY = mrPart.GetMinYPoint().Y;
            double maxY = mrPart.GetMaxYPoint().Y;

            if (maxX < 0 || minY > 0 || maxY < 0)
            {
                return;
            }
            if (mRightPart == null)
            {
                mRightPart = mrPart;
                return;
            }
            if (Math.Abs(maxX - minX) > 50)
            {
                return;
            }

            double rightPartMaxX = mRightPart.GetMaxXPoint().X;

            if (rightPartMaxX > maxX)
            {
                mRightPart = mrPart;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 判断左侧的零部件;
        /// </summary>
        /// <param name="mrPart"></param>
        private void JudgeLeftPart(CMrPart mrPart)
        {
            double minX = mrPart.GetMinXPoint().X;
            double maxX = mrPart.GetMaxXPoint().X;
            double minY = mrPart.GetMinYPoint().Y;
            double maxY = mrPart.GetMaxYPoint().Y;

            if (minX > 0 || minY > 0 || maxY < 0)
            {
                return;
            }

            if (mLeftPart == null)
            {
                mLeftPart = mrPart;
                return;
            }

            if (Math.Abs(maxX - minX) > 50)
            {
                return;
            }

            double leftPartMinX = mLeftPart.GetMinXPoint().X;

            if (leftPartMinX < minX)
            {
                mLeftPart = mrPart;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 判断是否是中间的板状零件;
        /// </summary>
        /// <param name="mrPart"></param>
        /// <returns></returns>
        private bool IsMidPlate(CMrPart mrPart)
        {
            Vector normal = mrPart.mNormal;

            if (!CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 0, 1)))
            {
                return(false);
            }
            if (!mrPart.IsHaveBolt())
            {
                return(false);
            }

            double minX = mrPart.GetMinXPoint().X;
            double maxX = mrPart.GetMaxXPoint().X;
            double minY = mrPart.GetMinYPoint().Y;
            double maxY = mrPart.GetMaxYPoint().Y;

            if (minX < 0 && maxX > 0 && minY < 0 && maxY > 0)
            {
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 判断右侧的零部件是否需要标注;
        /// </summary>
        /// <param name="mrPart"></param>
        /// <returns></returns>
        private bool IsRightPartNeedDim(CMrPart mrPart)
        {
            double minX = mrPart.GetMinXPoint().X;
            double maxX = mrPart.GetMaxXPoint().X;

            double rightPartMaxX = mRightPart.GetMaxXPoint().X;
            double rightPartMinX = mRightPart.GetMinXPoint().X;

            if (CDimTools.GetInstance().CompareTwoDoubleValue(maxX, rightPartMaxX) == 0 ||
                CDimTools.GetInstance().CompareTwoDoubleValue(minX, rightPartMinX) == 0 ||
                CDimTools.GetInstance().CompareTwoDoubleValue(maxX, rightPartMinX) == 0)
            {
                return(false);
            }
            if (CDimTools.GetInstance().CompareTwoDoubleValue(minX, rightPartMinX) >= 0 &&
                CDimTools.GetInstance().CompareTwoDoubleValue(maxX, rightPartMaxX) <= 0)
            {
                return(false);
            }
            if (!CDimTools.GetInstance().IsTwoVectorParallel(mLeftPart.mNormal, new Vector(1, 0, 0)))
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 判断是否需要向下标注;
        /// </summary>
        /// <returns></returns>
        private bool IsNeedDownDim(CMrPart mrPart)
        {
            Vector normal  = mrPart.mNormal;
            Vector zVector = new Vector(0, 0, 1);

            if (!CDimTools.GetInstance().IsTwoVectorParallel(normal, zVector) || !mrPart.IsHaveBolt())
            {
                return(false);
            }

            double minY = mrPart.GetMinYPoint().Y;
            double maxY = mrPart.GetMaxYPoint().Y;
            double minX = mrPart.GetMinXPoint().X;
            double maxX = mrPart.GetMaxXPoint().X;

//             if (minY < 0 && maxY > 0 && minX < 0 && maxX > 0)
//             {
//                 return true;
//             }
            if (maxY < 0)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获取左侧檩托板的标注集;
        /// </summary>
        /// <param name="nFlag">1:左侧;2:右侧</param>
        /// <returns></returns>
        private List <CMrDimSet> GetMrApronPlateDimSet(int nFlag)
        {
            List <CMrDimSet> mrDimSetList = new List <CMrDimSet>();

            Dictionary <CMrPart, CMrApronPlate> mMapPartToApronPlate = CMrCylinderDoorTopManager.GetInstance().mMapYNormalPartToMrApronPlate;

            //如果是右侧;
            if (nFlag == 2)
            {
                foreach (CMrApronPlate mrApronPlate in mMapPartToApronPlate.Values)
                {
                    CMrPart yNormalPart = mrApronPlate.mYNormalPart;
                    double  minX        = yNormalPart.GetMinXPoint().X;
                    if (minX < 0)
                    {
                        continue;
                    }
                    CMrDimSet mrDimSet = new CMrDimSet();
                    bool      bIsUp    = mrApronPlate.mIsUp;

                    if (bIsUp)
                    {
                        mrDimSet.AddPoint(yNormalPart.GetMaxXMinYPoint());
                    }
                    else
                    {
                        mrDimSet.AddPoint(yNormalPart.GetMaxXMaxYPoint());
                    }
                    mrDimSetList.Add(mrDimSet);
                }
            }
            //如果是左侧;
            else if (nFlag == 1)
            {
                foreach (CMrApronPlate mrApronPlate in mMapPartToApronPlate.Values)
                {
                    CMrPart yNormalPart = mrApronPlate.mYNormalPart;
                    double  maxX        = yNormalPart.GetMaxXPoint().X;
                    if (maxX > 0)
                    {
                        continue;
                    }
                    CMrDimSet mrDimSet = new CMrDimSet();
                    bool      bIsUp    = mrApronPlate.mIsUp;

                    if (bIsUp)
                    {
                        mrDimSet.AddPoint(yNormalPart.GetMinXMinYPoint());
                    }
                    else
                    {
                        mrDimSet.AddPoint(yNormalPart.GetMinXMaxYPoint());
                    }
                    mrDimSetList.Add(mrDimSet);
                }
            }

            return(mrDimSetList);
        }
        /// <summary>
        /// 获得支撑及牛腿中间的垂直加筋板;
        /// </summary>
        /// <param name="mrSupportPlate"></param>
        /// <returns></returns>
        private List <CMrPart> GetSupportPlateMiddleConnectPlates(CMrPart mrSupportPlate)
        {
            Point maxXPoint = mrSupportPlate.GetMaxXPoint();
            Point minXPoint = mrSupportPlate.GetMinXPoint();

            List <CMrPart> mrConnectPlates = new List <CMrPart>();

            if (maxXPoint.X < 0)
            {
                foreach (CMrPart mrPart in mVerticalConnectPlateList)
                {
                    if (IsOutsidePlate(mrPart) || mrPart.GetMaxXPoint().X > 0)
                    {
                        continue;
                    }
                    if (CDimTools.GetInstance().IsPartInOtherPartBox(mrPart, mrSupportPlate))
                    {
                        mrConnectPlates.Add(mrPart);
                    }
                }
                return(mrConnectPlates);
            }
            else if (minXPoint.X > 0)
            {
                foreach (CMrPart mrPart in mVerticalConnectPlateList)
                {
                    if (IsOutsidePlate(mrPart) || mrPart.GetMinXPoint().X < 0)
                    {
                        continue;
                    }
                    if (CDimTools.GetInstance().IsPartInOtherPartBox(mrPart, mrSupportPlate))
                    {
                        mrConnectPlates.Add(mrPart);
                    }
                }
                return(mrConnectPlates);
            }

            return(null);
        }
        /// <summary>
        /// 判断主梁的螺钉是否在该平板内;
        /// </summary>
        private bool JudgeMainBeamBoltInPlate(CMrPart mrPart)
        {
            List <CMrBoltArray> mrBoltArrayList = CMrMainBeam.GetInstance().GetBoltArrayList();

            double minX = mrPart.GetMinXPoint().X;
            double maxX = mrPart.GetMaxXPoint().X;
            double minY = mrPart.GetMinYPoint().Y;
            double maxY = mrPart.GetMaxYPoint().Y;

            foreach (CMrBoltArray mrBoltArray in mrBoltArrayList)
            {
                List <Point> pointList = mrBoltArray.GetBoltPointList();

                foreach (Point pt in pointList)
                {
                    if (pt.X < maxX && pt.X > minX && pt.Y < maxY && pt.Y > minY)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 构建所有需要进行打剖面的零部件;
        /// </summary>
        private void BuildNeedSectionPartList()
        {
            CMrPart mainBeam = CMrMainBeam.GetInstance();

            double mainBeamMinY = mainBeam.GetMinYPoint().Y;
            double mainBeamMaxY = mainBeam.GetMaxYPoint().Y;
            double mainBeamMinX = mainBeam.GetMinXPoint().X;
            double mainBeamMaxX = mainBeam.GetMaxXPoint().X;

            foreach (CMrPart mrPart in mrPartList)
            {
                Vector normal = mrPart.mNormal;

                if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 1, 0)))
                {
                    if (!mrPart.IsHaveBolt())
                    {
                        continue;
                    }

                    double partMinX = mrPart.GetMinXPoint().X;
                    double partMaxX = mrPart.GetMaxXPoint().X;

                    if (CDimTools.GetInstance().CompareTwoDoubleValue(partMaxX, mainBeamMinX) <= 0 ||
                        CDimTools.GetInstance().CompareTwoDoubleValue(partMinX, mainBeamMaxX) >= 0)
                    {
                        continue;
                    }
                    mAllSectionPartList.Add(mrPart);
                }
                else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(1, 0, 0)))
                {
                    if (!mrPart.IsHaveBolt())
                    {
                        continue;
                    }
                    double partMinX = mrPart.GetMinXPoint().X;
                    double partMaxX = mrPart.GetMaxXPoint().X;
                    double partMinY = mrPart.GetMinYPoint().Y;
                    double partMaxY = mrPart.GetMaxYPoint().Y;

                    //过滤掉双夹板;
                    if (CDimTools.GetInstance().CompareTwoDoubleValue(partMinY, mainBeamMinY) < 0 &&
                        CDimTools.GetInstance().CompareTwoDoubleValue(partMaxY, mainBeamMinY) > 0)
                    {
                        continue;
                    }
                    if (CDimTools.GetInstance().CompareTwoDoubleValue(partMinY, mainBeamMaxY) < 0 &&
                        CDimTools.GetInstance().CompareTwoDoubleValue(partMaxY, mainBeamMaxY) > 0)
                    {
                        continue;
                    }

                    if (CDimTools.GetInstance().CompareTwoDoubleValue(partMaxX, mainBeamMinX) <= 0 ||
                        CDimTools.GetInstance().CompareTwoDoubleValue(partMinX, mainBeamMaxX) >= 0)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                }
                else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 0, 1)))
                {
                    if (mrPart.IsHaveBolt())
                    {
                        double partMinX = mrPart.GetMinXPoint().X;
                        double partMaxX = mrPart.GetMaxXPoint().X;
                        double partMinY = mrPart.GetMinYPoint().Y;
                        double partMaxY = mrPart.GetMaxYPoint().Y;

                        if (CDimTools.GetInstance().CompareTwoDoubleValue(partMinX, mainBeamMaxX) >= 0 ||
                            CDimTools.GetInstance().CompareTwoDoubleValue(partMaxX, mainBeamMinX) <= 0)
                        {
                            mAllSectionPartList.Add(mrPart);
                        }
                    }
                    else //判断是否是底板零部件,底板零部件默认加入到链表中;
                    {
                        double partMinX = mrPart.GetMinXPoint().X;
                        double partMaxX = mrPart.GetMaxXPoint().X;
                        double partMaxY = mrPart.GetMaxYPoint().Y;

                        if (CDimTools.GetInstance().CompareTwoDoubleValue(partMaxY, mainBeamMinY) == 0 &&
                            partMinX < mainBeamMinX && partMaxX > mainBeamMaxX)
                        {
                            mAllSectionPartList.Add(mrPart);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// 创建水平方向的剖面;
        /// </summary>
        /// <param name="mrSection"></param>
        private void CreateVerticalMiddleSection(CMrSection mrSection, CMrPart mrPart)
        {
            //判断是否需要创建该剖面或者只是添加零件标记;
            CMrSection mrSameSection = null;

            View.ViewAttributes viewAttributes = new View.ViewAttributes();
            viewAttributes.LoadAttributes(CCommonPara.mSectionAttPath);

            SectionMarkBase.SectionMarkAttributes sectionMarkAttributes = new SectionMarkBase.SectionMarkAttributes();
            sectionMarkAttributes.LoadAttributes(CCommonPara.mSectionMarkNotePath);

            View        sectionView = null;
            SectionMark setionMark  = null;

            double dblX = 50;

            CMrPart mTopBeam     = CMrBeamDoorManager.GetInstance().mTopBeam;
            Point   tBLeftTopPt  = mTopBeam.mLeftTopPoint;
            Point   tBRightTopPt = mTopBeam.mRightTopPoint;
            Point   midMaxYPt    = CMrBeamDoorManager.GetInstance().mMidMaxPoint;

            Vector leftDirectVector  = new Vector(midMaxYPt.X - tBLeftTopPt.X, midMaxYPt.Y - tBLeftTopPt.Y, 0);
            Vector rightDirectVector = new Vector(midMaxYPt.X - tBRightTopPt.X, midMaxYPt.Y - tBRightTopPt.Y, 0);

            Point leftTopPt  = null;
            Point rightTopPt = null;

            if (CDimTools.GetInstance().IsTwoVectorParallel(mrPart.mNormal, new Vector(0, 1, 0)))
            {
                leftTopPt  = mrPart.GetMinXMaxYPoint();
                rightTopPt = mrPart.GetMaxXMaxYPoint();
            }
            else if (CDimTools.GetInstance().JudgeLineSlope(new Point(0, 0, 0), leftDirectVector) == MrSlopeType.MORETHAN_ZERO ||
                     CDimTools.GetInstance().JudgeLineSlope(new Point(0, 0, 0), rightDirectVector) == MrSlopeType.MORETHAN_ZERO)
            {
                leftTopPt  = mrPart.GetMinXPoint();
                rightTopPt = mrPart.GetMaxYPoint();
            }
            else if (CDimTools.GetInstance().JudgeLineSlope(new Point(0, 0, 0), leftDirectVector) == MrSlopeType.LESSTHAN_ZERO ||
                     CDimTools.GetInstance().JudgeLineSlope(new Point(0, 0, 0), rightDirectVector) == MrSlopeType.LESSTHAN_ZERO)
            {
                leftTopPt  = mrPart.GetMaxYPoint();
                rightTopPt = mrPart.GetMaxXPoint();
            }

            Point newPt   = new Point(rightTopPt.X + dblX, rightTopPt.Y, 0);
            Point startPt = CDimTools.GetInstance().ComputeFootPointToLine(newPt, leftTopPt, rightTopPt);

            newPt = new Point(leftTopPt.X - dblX, leftTopPt.Y, 0);
            Point endPt = CDimTools.GetInstance().ComputeFootPointToLine(newPt, leftTopPt, rightTopPt);

            if (CCommonPara.mVerticalSection == MrSectionOrientation.MrSectionDown)
            {
                Point tempPt = startPt;
                startPt = endPt;
                endPt   = startPt;
            }

            bool bNeedCreateView = IsTheSectionNeedCreateView(mrSection, ref mrSameSection);

            if (bNeedCreateView)
            {
                mSectionMarkIndex++;
                mrSection.mSectionMark = mSectionMarkArray[mSectionMarkIndex];

                View.CreateSectionView(mFrontView, startPt, endPt, new Point(0, 0, 0), CCommonPara.mDblSectionUpDepth
                                       , CCommonPara.mDblSectionDownDepth, viewAttributes, sectionMarkAttributes, out sectionView, out setionMark);
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 构建需要进行剖视的零部件;
        /// </summary>
        private void BuildNeedSectionPartList()
        {
            CMrPart mainBeam = CMrMainBeam.GetInstance();

            double mainBeamMinY = mainBeam.GetMinYPoint().Y;
            double mainBeamMaxY = mainBeam.GetMaxYPoint().Y;
            double mainBeamMinX = mainBeam.GetMinXPoint().X;
            double mainBeamMaxX = mainBeam.GetMaxXPoint().X;

            CMrPart leftPart       = CMrCylinderDoorFrontManager.GetInstance().mLeftPart;
            CMrPart leftMiddlePart = CMrCylinderDoorFrontManager.GetInstance().mLeftTopMiddlePart;
            CMrPart leftTopPart    = CMrCylinderDoorFrontManager.GetInstance().mLeftTopPart;

            CMrPart rightPart       = CMrCylinderDoorFrontManager.GetInstance().mRightPart;
            CMrPart rightMiddlePart = CMrCylinderDoorFrontManager.GetInstance().mRightTopMiddlePart;
            CMrPart rightTopPart    = CMrCylinderDoorFrontManager.GetInstance().mRightTopPart;

            mrPartList.Remove(leftPart);
            mrPartList.Remove(leftMiddlePart);
            mrPartList.Remove(rightPart);
            mrPartList.Remove(rightMiddlePart);

            foreach (CMrPart mrPart in mrPartList)
            {
                double partMinX = mrPart.GetMinXPoint().X;
                double partMaxX = mrPart.GetMaxXPoint().X;
                double partMaxY = mrPart.GetMaxYPoint().Y;
                double partMinY = mrPart.GetMinYPoint().Y;

                if (!mrPart.IsHaveBolt())
                {
                    continue;
                }

                Vector normal = mrPart.mNormal;

                //如果法向量与X轴平行;
                if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(1, 0, 0)))
                {
                    if (mrPart == leftTopPart || mrPart == rightTopPart)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }

                    //1.如果竖直的板在柱子中间;
                    if (CDimTools.GetInstance().CompareTwoDoubleValue(partMinX, mainBeamMinX) > 0 &&
                        CDimTools.GetInstance().CompareTwoDoubleValue(partMaxX, mainBeamMaxX) < 0)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                    //2.如果竖直的板在主梁侧板的外侧;
                    if (leftPart != null && CDimTools.GetInstance().CompareTwoDoubleValue(partMaxX, leftPart.GetMinXPoint().X) < 0)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                    if (rightPart != null && CDimTools.GetInstance().CompareTwoDoubleValue(partMinX, rightPart.GetMaxXPoint().X) > 0)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                }
                //如果法向量与Y轴平行;
                else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 1, 0)))
                {
                    //如果是檩托板中的零部件则返回;
                    if (CMrCylinderDoorFrontManager.GetInstance().FindMrApronPlateByYNormalPart(mrPart) != null)
                    {
                        continue;
                    }

                    //如果是底板;
                    if (CDimTools.GetInstance().CompareTwoDoubleValue(mainBeamMinY, partMaxY) == 0)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                    //如果是顶板;
                    if (CDimTools.GetInstance().CompareTwoDoubleValue(mainBeamMaxY, partMinY) == 0)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                    if (CDimTools.GetInstance().CompareTwoDoubleValue(partMinX, mainBeamMaxX) > 0 ||
                        CDimTools.GetInstance().CompareTwoDoubleValue(partMaxX, mainBeamMinX) < 0)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                    if (CDimTools.GetInstance().CompareTwoDoubleValue(partMinX, mainBeamMinX) > 0 ||
                        CDimTools.GetInstance().CompareTwoDoubleValue(partMaxX, mainBeamMaxX) < 0)
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                }
            }

            //1.把类型1中檩托板的任意一块板加进来;
            CMrApronPlate mrApronPlate = CMrCylinderDoorFrontManager.GetInstance().GetFirstMrApronPlateType1();

            if (mrApronPlate != null)
            {
                mAllSectionPartList.Add(mrApronPlate.mYNormalPart);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 绘制上侧的零部件标注;
        /// </summary>
        private void DrawYVectorUpDim()
        {
            List <Point> pointList = new List <Point>();

            bool bNeedAddLeftPart  = true;
            bool bNeedAddRightPart = true;

            foreach (CMrPart mrPart in mMrPartList)
            {
                double minY = mrPart.GetMinYPoint().Y;
                double maxY = mrPart.GetMaxYPoint().Y;

                if (minY < 0 && maxY < 0)
                {
                    continue;
                }

                Vector normal = mrPart.mNormal;

                //1.先判断螺钉的标注;
                List <CMrBoltArray> mrBoltArrayList = mrPart.GetBoltArrayList();

                foreach (CMrBoltArray mrBoltArray in mrBoltArrayList)
                {
                    if (!CDimTools.GetInstance().IsTwoVectorParallel(mrBoltArray.mNormal, new Vector(0, 0, 01)))
                    {
                        continue;
                    }
                    List <Point> maxYPointList = mrBoltArray.GetMaxYPointList();
                    pointList.AddRange(maxYPointList);

                    //把该螺钉组添加到映射表中;
                    mDicBoltArrayToUpDim.Add(mrBoltArray, true);
                }
                //2.如果法向与Y轴平行;
                if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(1, 0, 0)))
                {
                    if (mrPart.GetMaxXPoint().X < mLeftPart.GetMaxXPoint().X || mrPart.GetMinXPoint().X > mRightPart.GetMinXPoint().X)
                    {
                        continue;
                    }

                    if (!IsLeftPartNeedDim(mrPart))
                    {
                        bNeedAddLeftPart = false;
                        pointList.Add(mrPart.GetMaxYMaxXPoint());
                    }
                    else if (!IsRightPartNeedDim(mrPart))
                    {
                        bNeedAddRightPart = false;
                        pointList.Add(mrPart.GetMaxYMinXPoint());
                    }
                    else
                    {
                        pointList.Add(mrPart.GetMaxYMinXPoint());
                    }
                }
                if (IsMidPlate(mrPart))
                {
                    pointList.Add(mrPart.GetMaxYMinXPoint());
                    pointList.Add(mrPart.GetMaxYMaxXPoint());
                }
            }
            if (pointList.Count == 0)
            {
                return;
            }

            if (mLeftPart != null && bNeedAddLeftPart)
            {
                pointList.Add(mLeftPart.GetMaxYMinXPoint());
            }
            if (mRightPart != null && bNeedAddRightPart)
            {
                pointList.Add(mRightPart.GetMaxYMaxXPoint());
            }

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

            pointList.Sort(sorterX);

            PointList dimPointList = new PointList();

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

            Vector dimVector   = new Vector(0, 1, 0);
            double dimDistance = Math.Abs(CCommonPara.mViewMaxY - pointList[0].Y) + 0.6 * CCommonPara.mDefaultDimDistance;

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, dimPointList, dimVector, dimDistance, CCommonPara.mSizeDimPath);
        }
        /// <summary>
        /// 绘制主梁上螺钉的标注,需要判断螺钉与主梁顶部的距离,如果距离超过一定的阈值只进行单独标注;
        /// </summary>
        private void DrawMainBeamBoltDim()
        {
            CMrPart mrLeftPart  = CMrCylinderDoorFrontManager.GetInstance().mLeftPart;
            CMrPart mrRightPart = CMrCylinderDoorFrontManager.GetInstance().mRightPart;

            List <CMrBoltArray> mrBoltArrayList = mMainBeam.GetBoltArrayList();

            foreach (CMrBoltArray mrBoltArray in mrBoltArrayList)
            {
                Vector normal = mrBoltArray.mNormal;

                if (!CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 0, 1)))
                {
                    continue;
                }

                double distance = Math.Abs(mrBoltArray.GetMaxYPoint().Y - mMainBeam.GetMaxYPoint().Y);

                if (distance < 200)
                {
                    //1.标注螺钉组的上侧标注;
                    PointList pointList = new PointList();

                    foreach (Point point in mrBoltArray.GetMaxYPointList())
                    {
                        pointList.Add(point);
                    }
                    pointList.Add(mrRightPart.GetMaxXMaxYPoint());
                    pointList.Add(mrLeftPart.GetMinXMaxYPoint());

                    double dimDistance = Math.Abs(mMainBeam.GetMaxYPoint().Y - pointList[0].Y) + CCommonPara.mDefaultDimDistance;
                    Vector dimVector   = new Vector(0, 1, 0);
                    CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, dimDistance, CCommonPara.mSizeDimPath);
                }
                else
                {
                    //1.标注螺钉组的上侧标注;
                    PointList pointList = new PointList();

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

                    Point boltMaxYPt = mrBoltArray.GetMaxYPoint();

                    Vector leftPartNormal  = mrLeftPart.mNormal;
                    Vector rightPartNormal = mrRightPart.mNormal;

                    if (CDimTools.GetInstance().IsTwoVectorParallel(leftPartNormal, new Vector(1, 0, 0)))
                    {
                        pointList.Add(new Point(mrLeftPart.GetMinXPoint().X, boltMaxYPt.Y, 0));
                    }
                    if (CDimTools.GetInstance().IsTwoVectorParallel(rightPartNormal, new Vector(1, 0, 0)))
                    {
                        pointList.Add(new Point(mrRightPart.GetMaxXPoint().X, boltMaxYPt.Y, 0));
                    }
                    if (pointList.Count >= 2)
                    {
                        double dimDistance = CCommonPara.mDefaultDimDistance;
                        Vector dimVector   = new Vector(0, 1, 0);
                        CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, dimDistance, CCommonPara.mSizeDimPath);
                    }
                }
            }
        }
        /// <summary>
        /// 绘制主梁外侧法向与X轴平行的零件标注;
        /// </summary>
        private void DrawXNormalAlonePartDim()
        {
            List <CMrPart> xNormalAlonePartList = CMrCylinderDoorFrontManager.GetInstance().mXNormalAloneDimPartList;

            CMrPart leftPart          = CMrCylinderDoorFrontManager.GetInstance().mLeftPart;
            CMrPart leftTopPart       = CMrCylinderDoorFrontManager.GetInstance().mLeftTopPart;
            CMrPart leftTopMiddlePart = CMrCylinderDoorFrontManager.GetInstance().mLeftTopMiddlePart;

            CMrPart rightPart          = CMrCylinderDoorFrontManager.GetInstance().mRightPart;
            CMrPart rightTopPart       = CMrCylinderDoorFrontManager.GetInstance().mRightTopPart;
            CMrPart rightTopMiddlePart = CMrCylinderDoorFrontManager.GetInstance().mRightTopMiddlePart;

            double leftPartMinX  = leftPart.GetMinXPoint().X;
            double rightPartMaxX = rightPart.GetMaxXPoint().X;

            foreach (CMrPart mrPart in xNormalAlonePartList)
            {
                double partMinX = mrPart.GetMinXPoint().X;
                double partMaxX = mrPart.GetMaxXPoint().X;

                if (partMinX < leftPartMinX)
                {
                    PointList pointList     = new PointList();
                    Point     minXmaxYPoint = mrPart.GetMinXMaxYPoint();
                    pointList.Add(minXmaxYPoint);

                    double dimDistance = CCommonPara.mDefaultDimDistance;
                    Vector dimVector   = new Vector(0, 1, 0);

                    if (leftTopPart != null && leftTopPart.GetMinXMinYPoint().Y < minXmaxYPoint.Y)
                    {
                        pointList.Add(new Point(leftTopPart.GetMinXPoint().X, minXmaxYPoint.Y, 0));
                    }
                    else if (leftTopMiddlePart != null && leftTopMiddlePart.GetMinXMinYPoint().Y < minXmaxYPoint.Y)
                    {
                        pointList.Add(new Point(leftTopMiddlePart.GetMinXPoint().X, minXmaxYPoint.Y, 0));
                    }
                    else
                    {
                        pointList.Add(new Point(leftPartMinX, minXmaxYPoint.Y, 0));
                    }
                    CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, dimDistance, CCommonPara.mSizeDimPath);
                }
                else if (partMaxX > rightPartMaxX)
                {
                    PointList pointList     = new PointList();
                    Point     maxXmaxYPoint = mrPart.GetMaxXMaxYPoint();
                    pointList.Add(maxXmaxYPoint);
                    double dimDistance = CCommonPara.mDefaultDimDistance;
                    Vector dimVector   = new Vector(0, 1, 0);

                    if (rightTopPart != null && rightTopPart.GetMaxXMinYPoint().Y < maxXmaxYPoint.Y)
                    {
                        pointList.Add(new Point(rightTopPart.GetMaxXPoint().X, maxXmaxYPoint.Y, 0));
                    }
                    else if (rightTopMiddlePart != null && rightTopMiddlePart.GetMaxXMinYPoint().Y < maxXmaxYPoint.Y)
                    {
                        pointList.Add(new Point(rightTopMiddlePart.GetMaxXPoint().X, maxXmaxYPoint.Y, 0));
                    }
                    else
                    {
                        pointList.Add(new Point(rightPartMaxX, maxXmaxYPoint.Y, 0));
                    }

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