Files
envi-code/SourceCode/Code2026/AdsXRx/XHatch.cpp
T
2026-09-28 15:28:50 +08:00

102 lines
1.9 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, SH Software Co. Ltd.
// = FileName : XHatch Àà
// = Version : ver2.0
// = Author : zjq
// = CreateDate : 2002-09-09
// = Description: XHatch ÀඨÒå
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "XHatch.h"
XHatch::XHatch(XPoly2D poly,const TCHAR* sName,double nScale)
: m_poly(poly),m_sHatchName(sName),m_dScale(nScale),m_dRotation(0.0)
{
}
XHatch::XHatch(XPoly2D poly,const TCHAR* sName,double nScale,double nAngle)
: m_poly(poly),m_sHatchName(sName),m_dScale(nScale),m_dRotation(nAngle)
{
}
XHatch::~XHatch()
{
}
bool XHatch::IsKindOf(XEntity::TEntityId entType) const
{
switch(entType)
{
case XEntity::eEntity:
case XEntity::eHatch:
return true;
}
return false;
}
XEntity::TEntityId XHatch::Type() const
{
return XEntity::eHatch;
}
void XHatch::CopyFrom(const XEntity* pSrc)
{
if (this != pSrc && pSrc->IsKindOf(XEntity::eHatch))
{
m_poly = ((XHatch*)pSrc)->GetHatchPoly();
m_sHatchName = ((XHatch*)pSrc)->GetHatchName();
m_dScale = ((XHatch*)pSrc)->GetHatchScale();
m_dRotation = ((XHatch*)pSrc)->GetHatchRotation();
}
}
bool XHatch::IsSolid()const
{
return _tcscmp(m_sHatchName,_T("SOLID")) == 0;
}
XPoly2D XHatch::GetHatchPoly()const
{
return m_poly;
}
void XHatch::SetHatchPoly(XPoly2D poly)
{
m_poly = poly;
}
CString XHatch::GetHatchName()const
{
return m_sHatchName;
}
void XHatch::SetHatchName(CString sHatchName)
{
m_sHatchName = sHatchName;
}
double XHatch::GetHatchScale()const
{
return m_dScale;
}
void XHatch::SetHatchScale(double dScale)
{
m_dScale = dScale;
}
double XHatch::GetHatchRotation()const
{
return m_dRotation;
}
void XHatch::SetHatchRotation(double dRotation)
{
m_dRotation = dRotation;
}