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

76 lines
1.3 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : TPtList2.cpp
// = Version : ver2.0
// = Author : xlc
// = CreateDate : 2002-09-09
// = Description: 类的定义
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "TPtList2.h"
TPtList2::TPtList2()
: pa(0)
{
}
TPtList2::TPtList2(const TGPoint&pt,double PA)
: TPtList1(pt),pa(PA)
{
}
TPtList2::TPtList2(const TGMLine2D& mline)
: pa(0)
{
TPtList2*p = this;
p->Data() = mline.GetVertex(0);
for(long i = 1; i < mline.GetVertexNum(); i++)
{
p->CNNext(new TPtList2(mline.GetVertex(i)));
p = p->Next();
}
if(mline.IsClosed())
{
p->CNNext(this);
}
}
TPtList2::~TPtList2()
{
}
TPtList2 *TPtList2::Next()const
{
return (TPtList2*)(TPtList1::Next());
}
TPtList2 *TPtList2::GetTail()const
{
return (TPtList2*)(TPtList1::GetTail());
}
bool TPtList2::operator ==(const TPtList2&pt)const
{
double d=pa-pt.pa;
return EQUAL_ZERO(d);
}
bool TPtList2::operator !=(const TPtList2&pt)const
{
return !(*this==pt);
}
bool TPtList2::operator >(const TPtList2&pt)const
{
return UP_ZERO(pa-pt.pa);
}
bool TPtList2::operator <(const TPtList2&pt)const
{
return DOWN_ZERO(pa-pt.pa);
}