Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

245 lines
4.5 KiB
C++

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