//-------------------------------------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TImageDrawDCEx 类 // = Version : ver2.0 // = Author : wlw // = CreateDate : 2002-09-09 // = Description: TImageDrawDCEx 定义 // = Maintainers: // //-------------------------------------------------------------------------------------------------------+ #include "StdAfx.h" #include "TImageDrawDCEx.h" TImageDrawDCEx::TImageDrawDCEx(CDC *pDC, const CRect &rect, COLORREF bkcolor) :TImageDrawDC(pDC, rect, bkcolor) { m_nIT = IT_SLIDE; m_nFrontColor = 7; } TImageDrawDCEx::TImageDrawDCEx() { m_nIT = IT_SLIDE; m_nFrontColor = 7; } void TImageDrawDCEx::Reset() { m_slide.Reset(); } TImageDrawDCEx::~TImageDrawDCEx() { } BOOL TImageDrawDCEx::IsFullExplode() const { return TRUE; } void TImageDrawDCEx::DrawText(const TCHAR *pszContent/* = NULL*/) { } void TImageDrawDCEx::DrawSolid(const TGGePoly2D &polyOutline) { } void TImageDrawDCEx::DrawHatch(const TGGePoly2D &polyOutline, const TCHAR *pszPattern, double nScale) { } void TImageDrawDCEx::DrawHatchEx(const TGGePoly2D &polyOutline, const TCHAR *pszPattern, double nScale,double rotation) { } void TImageDrawDCEx::DrawMesh(const TGGePoly2D &polyOut, const TVector3D &vtOffset) { } void TImageDrawDCEx::DrawMesh(const TGGePoly2D &polyRegion1, const TGGePoly2D &polyRegion2) { } void TImageDrawDCEx::DrawMesh(const Adesk::UInt32 rows, const Adesk::UInt32 columns, const AcGePoint3d* pVertexList, const AcGiEdgeData* pEdgeData) { } void TImageDrawDCEx::DrawShell(const TGGePoly2D &polyOut, const TDPtrList &lstPolyIn) { } void TImageDrawDCEx::DrawShell(Adesk::UInt32 nbVertex, const AcGePoint3d* pVertexList, Adesk::UInt32 faceListSize, const Adesk::Int32* pFaceList, const AcGiEdgeData* pEdgeData) { } void TImageDrawDCEx::DrawBody(const TGGePoly2D &polySrc, const TVector3D &vtOffset) { } void TImageDrawDCEx::DrawBody(const TGGePoly2D &polyOut, const TGGePoly2D &polyIn, const TVector3D &vtOffset) { } void TImageDrawDCEx::DrawFace(const TGGe3DFace &face) { } void TImageDrawDCEx::DrawBlock(const AcDbBlockTableRecord &blockRec, const TADSGePoint3d &ptInsert, const AcGeScale3d &scales, double nRot, BOOL bMakeBlock) { } void TImageDrawDCEx::DrawXCurve(const TGGeCurveSegment& curve) { DrawCurve(curve); } void TImageDrawDCEx::DrawXLine(const TGGeLine& line) { DrawLine(line); } void TImageDrawDCEx::DrawXArc(const TGGeArc& arc) { DrawArc(arc); } void TImageDrawDCEx::DrawXCircle(const TGGeCircle& cir) { DrawCircle(cir); } void TImageDrawDCEx::DrawX3DFace(const TGGe3DFace& face) { DrawFace(face); } Adesk::UInt16 TImageDrawDCEx::GetColor() const { return m_nFrontColor; } void TImageDrawDCEx::SetColor(Adesk::UInt16 nColor) { if(nColor > 0 && nColor < 256) { m_nFrontColor = nColor; } } void TImageDrawDCEx::DrawLine(const TGGeLine &ln, double nThickness) { m_slide.Append(new TGGeColorLine(ln.GetStartPoint(), ln.GetEndPoint(), m_nFrontColor)); } void TImageDrawDCEx::Draw(const TADSGePointList &pts) { int nLen = pts.Length(); for(int i = 0; i < nLen - 1; i++) { DrawLine(TGGeLine(pts[i], pts[i + 1])); } } void TImageDrawDCEx::DrawArc(const TGGeArc &arc, double nThickness) { int nDiv = 30; ads_real intAng = fabs(arc.Bulge()); int n = (int)(intAng / PI / 2.0 * nDiv); if(n <= 0) { n = 1; } ads_real ang = intAng / n; TADSGePointList pts; TADSGePoint3d vertex; for(int i = 0; i <= n; i++) { ads_real drt = arc.GetStarAngle() + i * ang; ads_polar(arc.GetCenterPt(), drt, arc.GetRadius(), vertex); pts.Append(new TADSGePoint3d(vertex)); } Draw(pts); } void TImageDrawDCEx::DrawCircle(const TGGeCircle &cir, double nThickness) { int nDiv = 30; ads_real ang = PI * 2.0 / nDiv; TADSGePointList pts; TADSGePoint3d vertex; for(int i = 0; i <= nDiv; i++) { ads_real drt = i * ang; ads_polar(cir.GetCenterPt(), drt, cir.GetRadius(), vertex); pts.Append(new TADSGePoint3d(vertex)); } Draw(pts); } const TCHAR * TImageDrawDCEx::Descriptor() { return _T("TImageDrawDCEx"); } const TCHAR * TImageDrawDCEx::Desc() { return Descriptor(); } AcDbObjectId TImageDrawDCEx::GetLayerId() const { return AcDbObjectId::kNull; } Acad::ErrorStatus TImageDrawDCEx::SetLayer(const AcDbObjectId &id) { return Acad::eNotImplementedYet; } Acad::ErrorStatus TImageDrawDCEx::SetLayer(const TCHAR *pszLay) { return Acad::eNotImplementedYet; } Acad::ErrorStatus TImageDrawDCEx::SetLineType(const TCHAR *pltype) { return Acad::eNotImplementedYet; } Acad::ErrorStatus TImageDrawDCEx::SetMaterial(const TCHAR* sMaterial) { return Acad::eNotImplementedYet; }