/// <summary>
        /// 获取x值和y值都最大的点;
        /// </summary>
        /// <returns></returns>
        public Point GetMaxXMaxYPoint()
        {
            List <Point> pointList = new List <Point>();

            foreach (CMrBolt mrBolt in mMrBoltList)
            {
                pointList.Add(mrBolt.mPosition);
            }

            Point maxXPoint = CDimTools.GetInstance().GetMaxXPoint(pointList);

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

            foreach (Point point in pointList)
            {
                if (CDimTools.GetInstance().CompareTwoDoubleValue(point.X, maxXPoint.X) == 0)
                {
                    maxXPointList.Add(point);
                }
            }

            Point maxXAndMaxYPoint = CDimTools.GetInstance().GetMaxYPoint(maxXPointList);

            return(maxXAndMaxYPoint);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建标注;
        /// </summary>
        public void CreateDim()
        {
            //启动初始化函数;
            Thread thread = new Thread(new ParameterizedThreadStart(ThreadFunc));

            thread.Start();

            //首先清空标注和标记;
            CDimTools.GetInstance().ClearAllDim(mViewBase);
            CDimTools.GetInstance().ClearAllPartMark(mViewBase);

            lock (mLockString)
            {
#if DEBUG
                if (CMrBeamDoorManager.GetInstance().mType == MrBeamDoorType.TypeNormal)
                {
                    DrawXUpDimNormal();
                    DrawXDownDimNormal();
                    DrawPartDimNormal();
                    DrawMainBeamBoltDimNormal();
                    DrawPartMarkNormal();
                }
                else
                {
                    DrawXUpDimMiddle();
                    DrawXDownDimMiddle();
                    DrawPartDimMiddle();
                    DrawMainBeamBoltDimMiddle();
                    DrawPartMarkMiddle();
                }
#else
                try
                {
                    if (CMrBeamDoorManager.GetInstance().mType == MrBeamDoorType.TypeNormal)
                    {
                        DrawXUpDimNormal();
                        DrawXDownDimNormal();
                        DrawPartDimNormal();
                        DrawMainBeamBoltDimNormal();
                        DrawPartMarkNormal();
                    }
                    else
                    {
                        DrawXUpDimMiddle();
                        DrawXDownDimMiddle();
                        DrawPartDimMiddle();
                        DrawMainBeamBoltDimMiddle();
                        DrawPartMarkMiddle();
                    }
                }
                catch (Exception e)
                {
                    string strText = "提示:程序发生异常\n" + "异常信息:" + e.Message;
                    MessageBox.Show(strText);
                    return;
                }
#endif
            }
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 初始化;
        /// </summary>
        protected void Init()
        {
            if (mViewBase == null)
            {
                return;
            }
            CDimTools dimTools = CDimTools.GetInstance();

            //初始化视图包围盒;
            dimTools.InitViewBox();

            //获取所有螺钉的数据字典;
            Dictionary <Identifier, TSD.Bolt> dicIdentifierBolt = dimTools.GetAllBoltInDrawing(mViewBase);

            //获取所有Drawing视图中的Part;
            List <TSD.Part> partList = dimTools.GetAllPartInDrawing(mViewBase);

            foreach (TSD.Part partInDrawing in partList)
            {
                //1.获取部件的信息;
                TSM.ModelObject modelObjectInModel = dimTools.TransformDrawingToModel(partInDrawing);
                TSM.Part        partInModel        = modelObjectInModel as TSM.Part;
                CMrPart         mrPart             = null;

                if (CMrMainBeam.GetInstance().mPartInModel.Identifier.GUID == partInModel.Identifier.GUID)
                {
                    mrPart    = CMrMainBeam.GetInstance();
                    mMainBeam = CMrMainBeam.GetInstance();
                    mMainBeam.mPartInDrawing = partInDrawing;
                }
                else
                {
                    mrPart = new CMrPart(partInModel, partInDrawing);
                }

                dimTools.InitMrPart(modelObjectInModel, mViewBase, mrPart);
                AppendMrPart(mrPart);
                InitMrPart(mrPart);

                mrPart.GetBeamTopViewInfo().InitMrPartTopViewInfo();

                //2.获取部件中的所有螺钉组;
                List <BoltArray> boltArrayList = dimTools.GetAllBoltArray(partInModel);

                foreach (BoltArray boltArray in boltArrayList)
                {
                    TSD.Bolt boltInDrawing = dicIdentifierBolt[boltArray.Identifier];

                    CMrBoltArray mrBoltArray = new CMrBoltArray(boltArray, boltInDrawing);
                    dimTools.InitMrBoltArray(boltArray, mViewBase, mrBoltArray);
                    InitMrBoltArray(mrBoltArray);
                    mrPart.AppendMrBoltArray(mrBoltArray);
                }
                dimTools.UpdateViewBox(mrPart);
            }
            CMrMarkManager.GetInstance().Clear();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 创建所有零件的剖面;
        /// </summary>
        private void CreateAllPartSection()
        {
            CDimTools.GetInstance().SortMrPartByMaxY(mAllSectionPartList);

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

                CMrSection mrSection = new CMrSection(MrSectionType.MrSectionCylinder);
                mrSection.AppendSectionPart(mrPart);

                if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(1, 0, 0)))
                {
                    Point minXPt = mrPart.GetMinXPoint();
                    Point maxXpt = mrPart.GetMaxXPoint();
                    mrSection.mSectionMidX = (minXPt.X + maxXpt.X) / 2.0;
                    mrSection.mSectionMaxY = mrPart.GetMaxYPoint().Y;
                    mrSection.mSectionMinY = mrPart.GetMinYPoint().Y;

                    mrSection.mSectionMode = MrSectionMode.MrHorizontal;
                }
                else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 1, 0)))
                {
                    Point minYPt = mrPart.GetMinYPoint();
                    Point maxYpt = mrPart.GetMaxYPoint();
                    mrSection.mSectionMidY = (minYPt.Y + maxYpt.Y) / 2.0;
                    mrSection.mSectionMode = MrSectionMode.MrVertical;
                }
                else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 0, 1)))
                {
                    Point minYPt = mrPart.GetMinYPoint();
                    Point maxYpt = mrPart.GetMaxYPoint();
                    mrSection.mSectionMidY = maxYpt.Y;
                    mrSection.mSectionMode = MrSectionMode.MrVertical;
                }

                //1.如果零部件已经存在于剖面中则直接返回;
                if (IsPartInSection(mrPart, mrSection.mSectionMode))
                {
                    continue;
                }

                //2.把所有属于该剖面的零部件加入;
                AddPartInSection(mrSection);

                mSectionList.Add(mrSection);

                if (mrSection.mSectionMode == MrSectionMode.MrHorizontal)
                {
                    CreateHorizontalSection(mrSection);
                }
                else if (mrSection.mSectionMode == MrSectionMode.MrVertical)
                {
                    CreateVerticalSection(mrSection);
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 绘制所有零件的上方标注;
        /// </summary>
        public void DrawAllPartUpDimX()
        {
            //移除主梁;
            mMrPartList.Remove(mMainBeam);

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

            bool bNeedUpDim = false;

            //1.遍历获得所有零件的向上标注的点;
            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetBeamTopViewInfo().GetPartUpDimSet();

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

            CBeamTopViewSetting beamTopViewSetting = CBeamDimSetting.GetInstance().mTopViewSetting;

            //2.判断主梁的螺栓是否需要标注;
            bool bNeedMainBeamBoltDim = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrBolt);

            if (bNeedMainBeamBoltDim)
            {
                CMrDimSet mrDimSet = GetMainPartBoltUpDimX();
                upDimPointList.AddRange(mrDimSet.GetDimPointList());
            }
            if (bNeedUpDim == false && bNeedMainBeamBoltDim == false)
            {
                return;
            }

            //3.默认把主梁的左右最小最大值点加入到链表中;
            Point minXPoint = mMainBeam.GetMinXPoint();
            Point maxXPoint = mMainBeam.GetMaxXPoint();

            upDimPointList.Add(minXPoint);
            upDimPointList.Add(maxXPoint);

            PointList pointList = new PointList();

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

            Vector upDimVector = new Vector(0, 1, 0);

            mUpDimDistance = GetUpDimDistance(upDimPointList[0]);
            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, mUpDimDistance, CCommonPara.mSizeDimPath);
            mMrPartList.Add(mMainBeam);
        }
        /// <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);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 标注切割的尺寸;
        /// </summary>
        public void DrawCuttingDim()
        {
            CBeamTopViewSetting beamTopViewSetting = CBeamDimSetting.GetInstance().mTopViewSetting;
            PointList           pointList          = new PointList();

            //判断是否需要标注切割部分,切割需要采用单一尺寸来标注;
            bool bNeedDimCutting = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrCutting);

            if (bNeedDimCutting)
            {
                Point minYMinXPoint = mMainBeam.GetMinYMinXPoint();
                Point maxYMinXPoint = mMainBeam.GetMaxYMinXPoint();

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

                //A.判断主梁左侧的切割;
                if (maxYMinXPoint.X > minYMinXPoint.X)
                {
                    pointList.Clear();
                    pointList.Add(maxYMinXPoint);
                    pointList.Add(minYMinXPoint);
                    double dimDistance = CCommonPara.mDefaultDimDistance;
                    CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mMainSizeDimPath);
                }
                if (maxYMinXPoint.X < minYMinXPoint.X)
                {
                    pointList.Clear();
                    pointList.Add(maxYMinXPoint);
                    pointList.Add(minYMinXPoint);
                    double dimDistance = CCommonPara.mDefaultDimDistance;
                    CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, downDimVector, dimDistance, CCommonPara.mMainSizeDimPath);
                }

                //B.判断主梁右侧的切割;
                Point minYMaxXPoint = mMainBeam.GetMinYMaxXPoint();
                Point maxYMaxXPoint = mMainBeam.GetMaxYMaxXPoint();

                if (minYMaxXPoint.X > maxYMaxXPoint.X)
                {
                    pointList.Clear();
                    pointList.Add(maxYMaxXPoint);
                    pointList.Add(minYMaxXPoint);
                    double dimDistance = CCommonPara.mDefaultDimDistance;
                    CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, dimDistance, CCommonPara.mMainSizeDimPath);
                }
                else if (minYMaxXPoint.X < maxYMaxXPoint.X)
                {
                    pointList.Clear();
                    pointList.Add(minYMaxXPoint);
                    pointList.Add(maxYMaxXPoint);
                    double dimDistance = CCommonPara.mDefaultDimDistance;
                    CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, downDimVector, dimDistance, CCommonPara.mMainSizeDimPath);
                }
            }
        }
        /// <summary>
        /// 构建正常情况下需要创建剖面的零部件;
        /// </summary>
        private void BuildNormalNeedSectionPartList()
        {
            CMrPart mLeftBeam   = CMrBeamDoorManager.GetInstance().mLeftBeam;
            CMrPart mRightBeam  = CMrBeamDoorManager.GetInstance().mRightBeam;
            CMrPart mTopBeam    = CMrBeamDoorManager.GetInstance().mTopBeam;
            CMrPart mBottomBeam = CMrBeamDoorManager.GetInstance().mBottonBeam;

            //1.左右侧挡板需要进行剖视;
            mAllSectionPartList.Add(mLeftBeam);
            mAllSectionPartList.Add(mRightBeam);

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

            Point leftBottomPt  = mBottomBeam.mLeftBottomPoint;
            Point rightBottomPt = mBottomBeam.mRightBottomPoint;

            Vector directVector = new Vector(rightTopPt.X - leftTopPt.X, rightTopPt.Y - leftTopPt.Y, rightTopPt.Z - leftTopPt.Z);

            mrPartList.Remove(CMrMainBeam.GetInstance());
            mrPartList.Remove(mTopBeam);
            mrPartList.Remove(mBottomBeam);

            foreach (CMrPart mrPart in mrPartList)
            {
                //排除在主梁外面的零部件;
                if (CDimTools.GetInstance().IsThePointOnLine(mrPart.GetMaxYPoint(), leftTopPt, rightTopPt) > 0 ||
                    CDimTools.GetInstance().IsThePointOnLine(mrPart.GetMinYPoint(), leftBottomPt, rightBottomPt) < 0)
                {
                    continue;
                }

                Vector normal = mrPart.mNormal;

                //判断主梁的螺钉是否在板内,如果在则需要剖面;
                if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 0, 1)))
                {
                    if (JudgeMainBeamBoltInPlate(mrPart))
                    {
                        mAllSectionPartList.Add(mrPart);
                    }
                }

                if (!mrPart.IsHaveBolt())
                {
                    continue;
                }
                if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(1, 0, 0)) ||
                    CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 0, 1)) ||
                    CDimTools.GetInstance().IsTwoVectorParallel(normal, directVector) ||
                    CDimTools.GetInstance().IsTwoVectorVertical(normal, directVector))
                {
                    mAllSectionPartList.Add(mrPart);
                }
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 绘制主梁左侧的标注;
        /// </summary>
        public void DrawYMainLeftDim()
        {
            List <Point> leftDimPointList = new List <Point>();

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet partDimSet = mrPart.GetCylinderDoorTopViewInfo().GetYLeftPartDim();
                CMrDimSet boltDimSet = mrPart.GetCylinderDoorTopViewInfo().GetYLeftBoltDim();

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

            //把最大Y值和最小Y值的点加进来;
            if (mMaxYPart != null)
            {
                leftDimPointList.Add(mMaxYPart.GetMaxYMinXPoint());
            }
            if (mMinYPart != null)
            {
                leftDimPointList.Add(mMinYPart.GetMinYMinXPoint());
            }

            //把檩托板的点加进来;
            List <CMrDimSet> mrDimSetList = GetMrApronPlateDimSet(1);

            foreach (CMrDimSet mrDimSet in mrDimSetList)
            {
                if (mrDimSet != null)
                {
                    leftDimPointList.AddRange(mrDimSet.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  minYPoint      = leftDimPointList[0];
            double dimDistance    = Math.Abs(CCommonPara.mViewMinX - minYPoint.X) + 2 * CCommonPara.mDefaultDimDistance;
            Vector rightDimVector = new Vector(-1, 0, 0);

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, rightDimVector, dimDistance, CCommonPara.mSizeDimPath);
        }
        /// <summary>
        /// 获得螺钉中Y值最小的点;
        /// </summary>
        /// <returns></returns>
        public Point GetMinYPoint()
        {
            List <Point> pointList = new List <Point>();

            foreach (CMrBolt mrBolt in mMrBoltList)
            {
                pointList.Add(mrBolt.mPosition);
            }
            return(CDimTools.GetInstance().GetMinYPoint(pointList));
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 绘制主梁法向与Y轴平行时的零件标记;
        /// </summary>
        private void DrawYVectorMark()
        {
            DrawingHandler drawingHandler = new DrawingHandler();

            TSD.UI.DrawingObjectSelector DS = drawingHandler.GetDrawingObjectSelector();

            Vector xVector = new Vector(1, 0, 0);
            Vector yVector = new Vector(0, 1, 0);
            Vector zVector = new Vector(0, 0, 1);

            //1.绘制带螺钉的板的零件标记;
            foreach (CMrPart mrPart in mMrPartList)
            {
                double minY = mrPart.GetMinYPoint().Y;
                double maxY = mrPart.GetMaxYPoint().Y;

                Vector normal = mrPart.mNormal;

                //如果法向与Z轴平行并且有螺钉;
                if (CDimTools.GetInstance().IsTwoVectorParallel(normal, zVector) && mrPart.IsHaveBolt())
                {
                    DS.SelectObject(mrPart.mPartInDrawing);

                    //2.绘制螺钉标记;
                    List <CMrBoltArray> mrBoltArrayList = mrPart.GetBoltArrayList();

                    foreach (CMrBoltArray mrBoltArray in mrBoltArrayList)
                    {
                        if (CDimTools.GetInstance().IsTwoVectorParallel(mrBoltArray.mNormal, zVector))
                        {
                            DS.SelectObject(mrBoltArray.mBoltInDrawing);
                        }
                    }
                }
                //如果法向与Z轴平行没有螺钉(暂且判定为凸起的螺帽);
                else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, zVector) && !mrPart.IsHaveBolt())
                {
                    if (minY > 0 || maxY < 0)
                    {
                        DS.SelectObject(mrPart.mPartInDrawing);
                    }
                }
                //如果法向与Y轴平行;
                else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, yVector))
                {
                    if (minY > 0 || maxY < 0)
                    {
                        DS.SelectObject(mrPart.mPartInDrawing);
                    }
                }
            }

            CDimTools.GetInstance().DrawMarkByMacro();
        }
        /// <summary>
        /// 绘制支撑板上及牛腿上的螺钉以及上面的连接板在X方向的标注;
        /// </summary>
        private void DrawSupportPlateBoltAndConnectPlateDimX()
        {
            CCylinderTopViewSetting cylinderTopViewSetting = CCylinderDimSetting.GetInstance().mTopViewSetting;

            mMrPartList.Remove(mMainBeam);

            foreach (CMrPart mrPart in mMrPartList)
            {
                CMrDimSet mrBoltDimSet = mrPart.GetCylinderTopViewInfo().GetSupportPlateBoltXDimSet();

                CMrDimSet mrConnectPlateDimSet = GetSupportPlateMiddleConnectPlateDimSet(mrPart);

                PointList pointList = new PointList();

                //1.支撑板或连接板是否需要标注;
                if (cylinderTopViewSetting.FindDimValueByName(CCylinderTopViewSetting.mstrSupportPlate))
                {
                    if (mrBoltDimSet != null)
                    {
                        foreach (Point point in mrBoltDimSet.GetDimPointList())
                        {
                            pointList.Add(point);
                        }
                    }
                }
                //2.支撑板与连接板中间的加筋板是否需要标注;
                if (cylinderTopViewSetting.FindDimValueByName(CCylinderTopViewSetting.mstrConnentPlateOnSupport))
                {
                    if (mrConnectPlateDimSet != null)
                    {
                        foreach (Point point in mrConnectPlateDimSet.GetDimPointList())
                        {
                            pointList.Add(point);
                        }
                    }
                }
                if (pointList.Count > 0)
                {
                    if (mrBoltDimSet != null && mrBoltDimSet.Count > 0)
                    {
                        double dimDistance = mrBoltDimSet.mDimDistance;
                        Vector dimVector   = mrBoltDimSet.mDimVector;
                        CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, dimDistance, CCommonPara.mSizeDimPath);
                    }
                    else
                    {
                        double dimDistance = Math.Abs(mrPart.GetMinYPoint().Y - pointList[0].Y) + CCommonPara.mDefaultDimDistance;
                        Vector dimVector   = new Vector(0, -1, 0);
                        CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, dimDistance, CCommonPara.mSizeDimPath);
                    }
                }
            }
            mMrPartList.Add(mMainBeam);
        }
        /// <summary>
        /// 根据CMrDimSet来创建Tekla中的标注;
        /// </summary>
        /// <param name="mrDimSet"></param>
        private void CreateDimByMrDimSet(CMrDimSet mrDimSet)
        {
            PointList pointList = new PointList();

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

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, mrDimSet.mDimVector, mrDimSet.mDimDistance, CCommonPara.mSizeDimPath);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 绘制在中间法向与Y轴方向平行的零件标注;
        /// </summary>
        public void DrawYNormalPartDimMiddle()
        {
            CMrPart midYNormalPart = null;
            Point   midPoint       = CMrBeamDoorManager.GetInstance().mMidMaxPoint;

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

            foreach (CMrPart mrPart in mMrPartList)
            {
                if (mrPart == topBeam || mrPart == leftBottomBeam || mrPart == rightBottomBeam)
                {
                    continue;
                }

                Vector normal = mrPart.mNormal;

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

                Point minXPoint = mrPart.GetMinXPoint();
                Point maxXPoint = mrPart.GetMaxXPoint();

                if (minXPoint.X < midPoint.X && maxXPoint.X > midPoint.X)
                {
                    if (midYNormalPart == null)
                    {
                        midYNormalPart = mrPart;
                    }
                    else if (mrPart.GetMaxYPoint().Y > midYNormalPart.GetMaxYPoint().Y)
                    {
                        midYNormalPart = mrPart;
                    }
                }
            }
            if (midYNormalPart == null)
            {
                return;
            }

            PointList pointList = new PointList();

            pointList.Add(midYNormalPart.GetMaxXMinYPoint());
            pointList.Add(rightBottomBeam.GetMinXMaxYPoint());

            Vector dimVector = new Vector(1, 0, 0);
            double length    = 2 * CCommonPara.mDefaultDimDistance;

            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, length, CCommonPara.mSizeDimPath);
        }
        /// <summary>
        /// 判断是否需要在上面进行标注;
        /// </summary>
        /// <returns></returns>
        protected bool IsNeedXUpDimNormal()
        {
            Vector normal = mMrPart.mNormal;

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

            double partHeight = Math.Abs(mMrPart.GetMaxYPoint().Y - mMrPart.GetMinYPoint().Y);

            double mainBeamHeight = Math.Abs(CMrMainBeam.GetInstance().GetMaxYPoint().Y - CMrMainBeam.GetInstance().GetMinYPoint().Y);

            CMrPart mTopBeam = CMrBeamDoorManager.GetInstance().mTopBeam;

            Vector topBeamNormal = mTopBeam.mNormal;

            Point leftTopPoint     = CMrMainBeam.GetInstance().mLeftTopPoint;
            Point rightTopPoint    = CMrMainBeam.GetInstance().mRightTopPoint;
            Point rightBottomPoint = CMrMainBeam.GetInstance().mRightBottomPoint;

            Point partMinY = mMrPart.GetMinYPoint();
            Point partMaxY = mMrPart.GetMaxYPoint();

            //(1).如果是零件是左右两侧的板;
            if (mMrPart == CMrBeamDoorManager.GetInstance().mLeftBeam || mMrPart == CMrBeamDoorManager.GetInstance().mRightBeam)
            {
                return(false);
            }
            //(2).如果零件在主梁的上方;
            if (CDimTools.GetInstance().IsThePointOnLine(partMinY, leftTopPoint, rightTopPoint) > 0)
            {
                if (CDimTools.GetInstance().IsTwoVectorVertical(normal, topBeamNormal))
                {
                    CMrBeamDoorManager.GetInstance().AppendUpDimPart(mMrPart);

                    return(true);
                }
            }
            //(3).如果零件与主梁对角线相交,并且与地面垂直;
            if (CDimTools.GetInstance().IsThePointOnLine(partMaxY, leftTopPoint, rightBottomPoint) > 0 &&
                CDimTools.GetInstance().IsThePointOnLine(partMinY, leftTopPoint, rightBottomPoint) < 0 &&
                partHeight > mainBeamHeight / 3.0)
            {
                if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(1, 0, 0)))
                {
                    CMrBeamDoorManager.GetInstance().AppendUpDimPart(mMrPart);
                    return(true);
                }
            }
            return(false);
        }
        /// <summary>
        /// 绘制剖面标注;
        /// </summary>
        private void DrawSectionDim()
        {
            //判断主梁在剖视图中的法向,主要是考虑与X方向和Y方向平行的两个方向;
            Vector normal = mMainBeam.mNormal;

            Vector xVector = new Vector(1, 0, 0);
            Vector yVector = new Vector(0, 1, 0);

            if (CDimTools.GetInstance().IsTwoVectorParallel(normal, yVector))
            {
                DrawYVectorSectionDim();
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 绘制零件标记;
        /// </summary>
        private void DrawPartMark()
        {
            Vector normal = mMainBeam.mNormal;

            if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 1, 0)))
            {
                DrawYVectorPartMark();
            }
            else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(1, 0, 0)))
            {
                DrawXVectorPartMark();
            }
        }
        /// <summary>
        /// 获取X值最大的点;
        /// </summary>
        /// <returns></returns>
        public Point GetMaxXPoint()
        {
            List <Point> pointList = new List <Point>();

            foreach (CMrBolt mrBolt in mMrBoltList)
            {
                pointList.Add(mrBolt.mPosition);
            }

            Point maxXPoint = CDimTools.GetInstance().GetMaxXPoint(pointList);

            return(maxXPoint);
        }
        /// <summary>
        /// 开始进行标注;
        /// </summary>
        public void CreateDim()
        {
            //启动初始化函数;
            Thread thread = new Thread(new ParameterizedThreadStart(ThreadFunc));

            thread.Start();

            //首先清空标注和标记;
            CDimTools.GetInstance().ClearAllDim(mViewBase);
            CDimTools.GetInstance().ClearAllPartMark(mViewBase);

            lock (mLockString)
            {
#if DEBUG
                DrawSupportPlateBoltDimY();
                DrawAllPartLeftFenSizeDimY();
                DrawMainPartBoltDimY();
                DrawAllPartRightFenSizeDimY();
                DrawMainPartLengthDimY();
                DrawWorkPointToMainPartDimY();
                DrawWorkPointToWorkPointDimY();
                DrawSupportPlateBoltAndConnectPlateDimX();
                DrawAngleSheetBoltDimX();
                DrawMainPartBoltDimX();
                DrawPartMark();
                DrawMainPartBoltMark();
#else
                try
                {
                    DrawSupportPlateBoltDimY();
                    DrawAllPartLeftFenSizeDimY();
                    DrawMainPartBoltDimY();
                    DrawAllPartRightFenSizeDimY();
                    DrawMainPartLengthDimY();
                    DrawWorkPointToMainPartDimY();
                    DrawWorkPointToWorkPointDimY();
                    DrawSupportPlateBoltAndConnectPlateDimX();
                    DrawAngleSheetBoltDimX();
                    DrawMainPartBoltDimX();
                    DrawPartMark();
                    DrawMainPartBoltMark();
                }
                catch (Exception e)
                {
                    string strText = "提示:程序发生异常\n" + "异常信息:" + e.Message;
                    MessageBox.Show(strText);
                    return;
                }
#endif
            }
        }
        /// <summary>
        /// 绘制工作点到主梁的距离;
        /// </summary>
        private void DrawWorkPointToMainPartDimY()
        {
            CCylinderTopViewSetting cylinderTopViewSetting = CCylinderDimSetting.GetInstance().mTopViewSetting;

            bool bMarkValue = cylinderTopViewSetting.FindMarkValueByName(CCylinderTopViewSetting.mstrWorkPointToMainPart);

            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            //1.判断是否需要标注主梁与工作点之间的距离,采用一道尺寸来进行标注;
            bool bNeedDimWpToMainPart = cylinderTopViewSetting.FindDimValueByName(CCylinderTopViewSetting.mstrWorkPointToMainPart);

            if (!bNeedDimWpToMainPart)
            {
                return;
            }

            Point mainBeamMinY   = CMrMainBeam.GetInstance().GetMinYMinXPoint();
            Point mainBeamMaxY   = CMrMainBeam.GetInstance().GetMaxYMinXPoint();
            Point leftWorkPoint  = CMrMainBeam.GetInstance().mLeftWorkPoint;
            Point rightWorkPoint = CMrMainBeam.GetInstance().mRightWorkPoint;

            bMarkValue = cylinderTopViewSetting.FindMarkValueByName(CCylinderTopViewSetting.mstrWorkPointToWorkPoint);
            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            //2.如果工作点到工作点需要进行标注,而主部件左右侧与工作点的左右侧的距离都为0则不需要标注;
            bool bNeedWorkPtToWorkPt = cylinderTopViewSetting.FindDimValueByName(CCylinderTopViewSetting.mstrWorkPointToWorkPoint);

            if (bNeedWorkPtToWorkPt)
            {
                double xDistanceLeft  = Math.Abs(mainBeamMaxY.Y - leftWorkPoint.Y);
                double xDistanceRight = Math.Abs(mainBeamMaxY.Y - rightWorkPoint.Y);

                if (xDistanceLeft < CCommonPara.mDblError && xDistanceRight < CCommonPara.mDblError)
                {
                    return;
                }
            }

            PointList pointList = new PointList();

            pointList.Add(leftWorkPoint);
            pointList.Add(rightWorkPoint);
            pointList.Add(mainBeamMinY);
            pointList.Add(mainBeamMaxY);

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

            mLeftDimDistance = GetLeftDimDistance(leftWorkPoint);
            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, leftDimVector, mLeftDimDistance, CCommonPara.mMainSizeDimPath);
        }
Ejemplo n.º 22
0
        /// <summary>
        /// 获取选择的图纸列表;
        /// </summary>
        public void GetSelDrawingList()
        {
            mbUpdate = true;

            mDicMarkNumberToType.Clear();
            mrAssemblyDrawingList.Clear();

            List <CMrAssemblyDrawing> assemblyDrawingList = CDimTools.GetInstance().GetSelMrAssemblyDrawingList();

            foreach (CMrAssemblyDrawing assemblyDrawing in assemblyDrawingList)
            {
                mrAssemblyDrawingList.Add(assemblyDrawing);
            }
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 判断框架柱剖面中的两个零件是否相同;
        /// </summary>
        /// <param name="mrSrcPart"></param>
        /// <param name="mrDesPart"></param>
        /// <returns></returns>
        private bool IsTwoCylinderPartSame(CMrPart mrSrcPart, CMrPart mrDesPart)
        {
            Vector srcVector = mrSrcPart.mNormal;
            Vector desVector = mrDesPart.mNormal;

            string strSrcPartMark = mrSrcPart.mPartInModel.GetPartMark();
            string strDesPartMark = mrDesPart.mPartInModel.GetPartMark();

            if (!CDimTools.GetInstance().IsTwoVectorParallel(desVector, srcVector))
            {
                return(false);
            }

            if (!strSrcPartMark.Equals(strDesPartMark))
            {
                return(false);
            }

            if (mrSrcPart.IsHaveBolt() != mrDesPart.IsHaveBolt())
            {
                return(false);
            }

            List <CMrBoltArray> mrSrcBoltArray = mrSrcPart.GetBoltArrayList();
            List <CMrBoltArray> mrDesBoltArray = mrDesPart.GetBoltArrayList();

            if (mrSrcBoltArray.Count != mrDesBoltArray.Count)
            {
                return(false);
            }

            List <Point> mrSrcBoltPointList = new List <Point>();
            List <Point> mrDesBoltPointList = new List <Point>();

            foreach (CMrBoltArray mrBoltArray in mrSrcBoltArray)
            {
                mrSrcBoltPointList.AddRange(mrBoltArray.GetBoltPointList());
            }

            foreach (CMrBoltArray mrBoltArray in mrDesBoltArray)
            {
                mrDesBoltPointList.AddRange(mrBoltArray.GetBoltPointList());
            }

            if (mrSrcBoltPointList.Count != mrDesBoltPointList.Count)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 标注工作点到主零件的距离之间尺寸;
        /// </summary>
        public void DrawWorkPointToMainPartDimX()
        {
            CBeamTopViewSetting beamTopViewSetting = CBeamDimSetting.GetInstance().mTopViewSetting;

            bool bMarkValue = beamTopViewSetting.FindMarkValueByName(CBeamTopViewSetting.mstrWorkPointToMainPart);

            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            //1.判断是否需要标注主梁与工作点之间的距离,采用一道尺寸来进行标注;
            bool bNeedDimWpToMainPart = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrWorkPointToMainPart);

            if (!bNeedDimWpToMainPart)
            {
                return;
            }

            Point mainBeamMinX   = CMrMainBeam.GetInstance().GetMinXPoint();
            Point mainBeamMaxX   = CMrMainBeam.GetInstance().GetMaxXPoint();
            Point leftWorkPoint  = CMrMainBeam.GetInstance().mLeftWorkPoint;
            Point rightWorkPoint = CMrMainBeam.GetInstance().mRightWorkPoint;

            bMarkValue = beamTopViewSetting.FindMarkValueByName(CBeamTopViewSetting.mstrWorkPointToWorkPoint);
            mMainBeam.SetNeedAddMarkFlag(bMarkValue);

            //2.如果工作点到工作点需要进行标注,而主部件左右侧与工作点的左右侧的距离都为0则不需要标注;
            bool bNeedWorkPtToWorkPt = beamTopViewSetting.FindDimValueByName(CBeamTopViewSetting.mstrWorkPointToWorkPoint);

            if (bNeedWorkPtToWorkPt)
            {
                double xDistanceLeft  = Math.Abs(mainBeamMinX.X - leftWorkPoint.X);
                double xDistanceRight = Math.Abs(mainBeamMaxX.X - rightWorkPoint.X);

                if (xDistanceLeft < CCommonPara.mDblError && xDistanceRight < CCommonPara.mDblError)
                {
                    return;
                }
            }

            PointList pointList = new PointList();

            pointList.Add(leftWorkPoint);
            pointList.Add(rightWorkPoint);
            pointList.Add(mainBeamMinX);
            pointList.Add(mainBeamMaxX);

            Vector upDimVector = new Vector(0, 1, 0);

            mUpDimDistance = GetUpDimDistance(leftWorkPoint);
            CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, upDimVector, mUpDimDistance, CCommonPara.mMainSizeDimPath);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 绘制主梁上螺钉的标注;
        /// </summary>
        private void DrawMainBeamBoltDimNormal()
        {
            CMrPart topBeam = CMrBeamDoorManager.GetInstance().mTopBeam;

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

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

            foreach (CMrBoltArray mrBoltArray in mrBoltArrayList)
            {
                Point boltPoint = mrBoltArray.GetMaxXPoint();

                //寻找与该零件最近的零部件;
                CMrPart mostNearPart = CMrBeamDoorManager.GetInstance().GetMostNearPart(boltPoint);

                if (mostNearPart == null)
                {
                    continue;
                }

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

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

                if (slopeType == MrSlopeType.MORETHAN_ZERO)
                {
                    pointList.Add(mostNearPart.mRightTopPoint);
                }
                else
                {
                    pointList.Add(mostNearPart.mLeftTopPoint);
                }

                pointList.Add(boltPoint);

                Vector dimVector   = CMrBeamDoorManager.GetInstance().GetTopBeamUpDimVector();
                double dblDistance = CCommonPara.mDefaultDimDistance;
                CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, dblDistance, CCommonPara.mSizeDimPath);

                //(2).与顶板竖直方向标注板的位置;
                pointList.Clear();
                pointList.Add(boltPoint);
                Point fontPt = CDimTools.GetInstance().ComputeFootPointToLine(boltPoint, topBeam.mLeftTopPoint, topBeam.mRightTopPoint);
                pointList.Add(fontPt);
                dimVector = new Vector(rightTopPoint.X - leftTopPoint.X, rightTopPoint.Y - leftTopPoint.Y, 0);
                CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, dimVector, dblDistance, CCommonPara.mSizeDimPath);
            }
        }
        /// <summary>
        /// 判断该板是否需要进行标注;
        /// </summary>
        /// <returns></returns>
        protected bool IsNeedXUpDimMiddle()
        {
            Vector normal = mMrPart.mNormal;

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

            CMrPart mTopBeam = CMrBeamDoorManager.GetInstance().mTopBeam;

            Vector leftTopVector  = CMrBeamDoorManager.GetInstance().mLeftTopVector;
            Vector rightTopVector = CMrBeamDoorManager.GetInstance().mRightTopVector;

            Point leftBottom       = mTopBeam.mLeftBottomPoint;
            Point rightBottomPoint = mTopBeam.mRightBottomPoint;
            Point midTopPoint      = CMrBeamDoorManager.GetInstance().mMidMaxPoint;

            Point partMinY = mMrPart.GetMinYPoint();

            //(1).如果是零件是左右两侧的板;
            if (mMrPart == CMrBeamDoorManager.GetInstance().mLeftBeam ||
                mMrPart == CMrBeamDoorManager.GetInstance().mRightBeam)
            {
                return(false);
            }

            //(2).如果零件在主梁的左上方;
            if (CDimTools.GetInstance().IsThePointOnLine(partMinY, leftBottom, midTopPoint) > 0)
            {
                if (CDimTools.GetInstance().IsTwoVectorVertical(normal, leftTopVector))
                {
                    CMrBeamDoorManager.GetInstance().AppendUpDimPart(mMrPart);

                    return(true);
                }
            }
            //(3).如果零件在主梁的右上方;
            if (CDimTools.GetInstance().IsThePointOnLine(partMinY, rightBottomPoint, midTopPoint) > 0)
            {
                if (CDimTools.GetInstance().IsTwoVectorVertical(normal, rightTopVector))
                {
                    CMrBeamDoorManager.GetInstance().AppendUpDimPart(mMrPart);

                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 判断顶部的零部件,顶部的零部件法向可能与Y轴平行,也可能在XY平面内;
        /// </summary>
        /// <param name="?"></param>
        private void JudgeTopPart(CMrPart mrPart)
        {
            Vector normal = mrPart.mNormal;
            double maxY   = mrPart.GetMaxYPoint().Y;

            if (maxY < mMainBeamMaxY)
            {
                return;
            }

            //1.如果零部件的法向与Y轴的法向相同;
            if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 1, 0)))
            {
                if (mTopPart == null)
                {
                    mTopPart = mrPart;
                }
                else if (maxY > mTopPart.GetMaxYPoint().Y)
                {
                    mTopPart = mrPart;
                }
            }
            //2.如果法向在XY平面内;
            else if (CDimTools.GetInstance().IsVectorInXYPlane(normal))
            {
                if (mTopPart == null)
                {
                    mTopPart = mrPart;
                }
                else if (mLeftTopPart != null && mRightTopPart != null)
                {
                    double leftTopMaxY  = mLeftTopPart.GetMaxYPoint().Y;
                    double rightTopMaxY = mRightTopPart.GetMaxYPoint().Y;

                    if (maxY > leftTopMaxY && maxY > rightTopMaxY)
                    {
                        return;
                    }
                    else if (maxY > mTopPart.GetMaxYPoint().Y)
                    {
                        mTopPart = mrPart;
                    }
                }
                else if (maxY > mTopPart.GetMaxYPoint().Y)
                {
                    mTopPart = mrPart;
                }
            }
        }
Ejemplo n.º 28
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);
        }
Ejemplo n.º 29
0
        /// <summary>
        /// 绘制剖面的标注;
        /// </summary>
        private void DrawSectionDim()
        {
            Vector normal = mMainBeam.mNormal;

            //如果主梁的法向与Y轴平行;
            if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(0, 1, 0)))
            {
                DrawYVectorSectionDim();
            }
            //如果主梁的法向与X轴平行;
            else if (CDimTools.GetInstance().IsTwoVectorParallel(normal, new Vector(1, 0, 0)))
            {
                DrawXVectorSectionDim();
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 获取最小Y值点的链表;
        /// </summary>
        /// <returns></returns>
        public List <Point> GetMinYPointList()
        {
            Point minYPoint = CDimTools.GetInstance().GetMinYPoint(mPointList);

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

            foreach (Point point in mPointList)
            {
                if (CDimTools.GetInstance().CompareTwoDoubleValue(point.Y, minYPoint.Y) == 0)
                {
                    minYPointList.Add(point);
                }
            }
            return(minYPointList);
        }