#include "stdafx.h" #include "TDbUnderGroundRamp.h" #include "GlwGlobalVariable.h" #include "GlwUGRampDataManage.h" #include "UndergroundRampStyle.h" #include "UndergroundRampDlg.h" TDbUnderGroundRamp::TDbUnderGroundRamp(void) { } TDbUnderGroundRamp::~TDbUnderGroundRamp(void) { } void TDbUnderGroundRamp::SetPolyOutLine(XPoly2D &poly2DOut, XPoly2D &poly2DIn, TGGeCurveSegment &segStartSec) { PolyConvert(poly2DOut, m_polyLineOut); PolyConvert(poly2DIn, m_polyLineIn); m_startSecLine.setStartPoint(segStartSec.GetStartPoint()); m_startSecLine.setEndPoint(segStartSec.GetEndPoint()); } void TDbUnderGroundRamp ::SetPolyMidLine(XPoly2D &polyMid) { PolyConvert(polyMid, m_polyMid); } void TDbUnderGroundRamp::SetRampDrawStyle(int nRampStyle) { m_nRampStyle = nRampStyle; } void TDbUnderGroundRamp::SetBrokenLine(XPoly2D &ploy2D) { PolyConvert(ploy2D, m_brokenLine); } void TDbUnderGroundRamp::SetArrowPoly2D(XPoly2D &ploy2D) { m_arrowPoly = ploy2D; } Adesk::Boolean TDbUnderGroundRamp::subWorldDraw(AcGiWorldDraw *pWd) { BOOL bIsMeter = DocGetMeterUnitDraw(); pWd->subEntityTraits().setColor(2); GlwUGRampDataManage* pRampDataManage = GET_GLOBAL_VARIABLE(GlwUGRampDataManage); int nDrawStyle = pRampDataManage->GetDrawStyle(); AcCmColor color; color.setColorIndex(2); if (nDrawStyle == CUndergroundRampDlg::VIEW3 || nDrawStyle == CUndergroundRampDlg::VIEW6 || nDrawStyle == CUndergroundRampDlg::VIEW9) { m_polyLineIn.setConstantWidth(_AS_SYS_UNIT(DOUBLET_SPACING)); m_polyLineIn.setLayer(InitLayer(LAY_ROAD)); } else m_polyLineIn.setConstantWidth(0); m_polyLineIn.worldDraw(pWd); if (nDrawStyle == CUndergroundRampDlg::VIEW2 || nDrawStyle == CUndergroundRampDlg::VIEW5 || nDrawStyle == CUndergroundRampDlg::VIEW8) m_polyLineOut.worldDraw(pWd); if (nDrawStyle == CUndergroundRampDlg::VIEW4 || nDrawStyle == CUndergroundRampDlg::VIEW5 || nDrawStyle == CUndergroundRampDlg::VIEW6 || nDrawStyle == CUndergroundRampDlg::VIEW7 || nDrawStyle == CUndergroundRampDlg::VIEW8 || nDrawStyle == CUndergroundRampDlg::VIEW9) m_brokenLine.worldDraw(pWd); m_startSecLine.worldDraw(pWd); if (pRampDataManage->GetIsDimArrow()) { TDbSymbArrow arrow; arrow.SetPoly2D(m_arrowPoly); if (bIsMeter) arrow.SetArrowSize(1.2); else arrow.SetArrowSize(12); TGGiWorldViewportDraw dc(pWd,NULL); AcCmColor color; color.setColorIndex(3); arrow.setColor(color); arrow.ExplodeOrDraw2d(dc); } pWd->subEntityTraits().setColor(1); if (pRampDataManage->GetIsDrawMidLine()) { if(bIsMeter) m_polyMid.setLinetypeScale(0.001); m_polyMid.worldDraw(pWd); } return Adesk::kTrue; }