72 lines
1.3 KiB
C++
72 lines
1.3 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TPtList1.cpp
|
|
// = Version : ver2.0
|
|
// = Author : xlc
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: 类的定义
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#include "StdAfx.h"
|
|
#include "TPtList1.h"
|
|
|
|
TPtList1::TPtList1()
|
|
{
|
|
|
|
}
|
|
|
|
TPtList1::TPtList1(const TGPoint&pt)
|
|
: TPtList(pt)
|
|
{
|
|
|
|
}
|
|
|
|
TPtList1::TPtList1(const TGMLine2D& mline)
|
|
{
|
|
TPtList1*p = this;
|
|
p->Data() = mline.GetVertex(0);
|
|
for (long i = 1; i < mline.GetVertexNum(); i++)
|
|
{
|
|
p->CNNext(new TPtList1(mline.GetVertex(i)));
|
|
p = p->Next();
|
|
}
|
|
if (mline.IsClosed())
|
|
{
|
|
p->CNNext(this);
|
|
}
|
|
}
|
|
|
|
TPtList1::~TPtList1()
|
|
{
|
|
|
|
}
|
|
|
|
TPtList1 *TPtList1::Next()const
|
|
{
|
|
return (TPtList1*)(TPtList::Next());
|
|
}
|
|
|
|
TPtList1 *TPtList1::GetTail()const
|
|
{
|
|
return (TPtList1*)(TPtList::GetTail());
|
|
}
|
|
|
|
void TPtList1::SetAllFlag(int f)
|
|
{
|
|
AddFlag(f);
|
|
for (TPtList1 *p1 = Next(); p1 != this; p1->AddFlag(f),p1 = p1->Next());
|
|
}
|
|
|
|
void TPtList1::RemoveAllFlag(int f)
|
|
{
|
|
RemoveFlag(f);
|
|
for (TPtList1 *p1=Next();p1 != this;p1->RemoveFlag(f),p1=p1->Next());
|
|
}
|
|
|
|
void TPtList1::ClearAllFlag()
|
|
{
|
|
ClearFlag();
|
|
for (TPtList1 *p1=Next();p1 != this;p1->ClearFlag(),p1=p1->Next());
|
|
}
|