Files
envi-code/SourceCode/Code2026/tg_shs/shs_subgeLib/TPtList2.cpp
T
2026-09-28 15:28:50 +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);
}