/// <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); }
/// <summary> /// 获得支撑板中间的连接板的标注; /// </summary> /// <returns></returns> public CMrDimSet GetSupportPlateMiddleConnectPlateDimSet(CMrPart mrSupportPlate) { if (!CDimTools.GetInstance().IsTwoVectorParallel(mrSupportPlate.mNormal, new Vector(0, 0, 1)) || CDimTools.GetInstance().IsPartTheAngleSteel(mrSupportPlate) || IsOutsidePlate(mrSupportPlate)) { return(null); } CCylinderTopViewSetting cylinderTopViewSetting = CCylinderDimSetting.GetInstance().mTopViewSetting; List <CMrPart> mrConnectPlates = GetSupportPlateMiddleConnectPlates(mrSupportPlate); if (mrConnectPlates == null || mrConnectPlates.Count == 0) { return(null); } CMrDimSet mrDimSet = new CMrDimSet(); foreach (CMrPart mrPart in mrConnectPlates) { mrDimSet.AddPoint(mrPart.GetMinYMinXPoint()); bool bValue = cylinderTopViewSetting.FindMarkValueByName(CCylinderTopViewSetting.mstrConnentPlateOnSupport); mrPart.SetNeedAddMarkFlag(bValue); } if (mrDimSet.Count > 0) { mrDimSet.AddPoint(new Point(0, mrDimSet.GetDimPointList()[0].Y, 0)); } return(mrDimSet); }
/// <summary> /// 绘制主梁左侧工作点与工作点之间的标注; /// </summary> private void DrawWorkPointToWorkPointDimY() { CCylinderTopViewSetting cylinderTopViewSetting = CCylinderDimSetting.GetInstance().mTopViewSetting; PointList pointList = new PointList(); bool bMarkValue = cylinderTopViewSetting.FindMarkValueByName(CCylinderTopViewSetting.mstrWorkPointToWorkPoint); mMainBeam.SetNeedAddMarkFlag(bMarkValue); //1.判断工作点与工作点之间是否需要标注,需要标注的话是一道单尺寸; bool bNeedDimWpToWp = cylinderTopViewSetting.FindDimValueByName(CCylinderTopViewSetting.mstrWorkPointToWorkPoint); if (bNeedDimWpToWp) { Point leftWorkPoint = CMrMainBeam.GetInstance().mLeftWorkPoint; Point rightWorkPoint = CMrMainBeam.GetInstance().mRightWorkPoint; pointList.Add(leftWorkPoint); pointList.Add(rightWorkPoint); Vector leftDimVector = new Vector(-1, 0, 0); mLeftDimDistance = GetLeftDimDistance(leftWorkPoint); CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, leftDimVector, mLeftDimDistance, CCommonPara.mMainSizeDimPath); } }
/// <summary> /// 绘制主梁左侧长度的标注; /// </summary> private void DrawMainPartLengthDimY() { CCylinderTopViewSetting cylinderTopViewSetting = CCylinderDimSetting.GetInstance().mTopViewSetting; //1.判断是否需要标注主梁的长度,如果需要采用单一的一道总尺寸; bool bNeedDimMainPartLength = cylinderTopViewSetting.FindDimValueByName(CCylinderTopViewSetting.mstrMainPartLength); bool bMarkValue = cylinderTopViewSetting.FindMarkValueByName(CCylinderTopViewSetting.mstrMainPartLength); mMainBeam.SetNeedAddMarkFlag(bMarkValue); if (!bNeedDimMainPartLength) { return; } Point minYPoint = mMainBeam.GetMinYMinXPoint(); Point maxYPoint = mMainBeam.GetMaxYMinXPoint(); bMarkValue = cylinderTopViewSetting.FindMarkValueByName(CCylinderTopViewSetting.mstrWorkPointToWorkPoint); mMainBeam.SetNeedAddMarkFlag(bMarkValue); //2.如果需要标注工作点到工作点,并且主部件与工作点的距离左边或者右边为0,或者都为0时则不标注主部件长度; bool bNeedWorkPtToWorkPt = cylinderTopViewSetting.FindDimValueByName(CCylinderTopViewSetting.mstrWorkPointToWorkPoint); if (bNeedWorkPtToWorkPt) { double xDistanceLeft = Math.Abs(maxYPoint.Y - CMrMainBeam.GetInstance().mLeftWorkPoint.Y); double xDistanceRight = Math.Abs(minYPoint.Y - CMrMainBeam.GetInstance().mRightWorkPoint.Y); if (xDistanceLeft < CCommonPara.mDblError || xDistanceRight < CCommonPara.mDblError) { return; } } PointList pointList = new PointList(); pointList.Add(minYPoint); pointList.Add(maxYPoint); Vector leftDimVector = new Vector(-1, 0, 0); mLeftDimDistance = GetLeftDimDistance(minYPoint); CDimTools.GetInstance().DrawDimensionSet(mViewBase, pointList, leftDimVector, mLeftDimDistance, CCommonPara.mMainSizeDimPath); }