Files
envi-code/SourceCode/Code2026/tg_shs/shs_subgeLib/TPGeEdge.cpp
T
2026-09-28 15:28:50 +08:00

64 lines
1.1 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : TPGeEdge.cpp
// = Version : ver2.0
// = Author : xlc
// = CreateDate : 2002-09-09
// = Description: ÀàµÄ¶¨Òå
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "TPGeEdge.h"
#include "TGNode.h"
TPGeEdge::TPGeEdge(TPGeCurve2D*p) : pSeg(p)
{
}
TPGeEdge::~TPGeEdge()
{
if(pSeg != NULL)
{
delete pSeg;
}
}
TPGeCurve2D* TPGeEdge::FetchEdge()
{
TPGeCurve2D* p = pSeg;
pSeg = NULL;
return p;
}
TGNode* TPGeEdge::EndNode() const
{
return pNodeEnd;
}
void TPGeEdge::SetNode(TGNode*p1,TGNode*p2)
{
pNodeStart = p1;
pNodeEnd = p2;
}
bool TPGeEdge::operator > (const TPGeEdge&) const
{
return false;
}
bool TPGeEdge::operator < (const TPGeEdge&) const
{
return false;
}
bool TPGeEdge::FindLoop(TPGeEdgePath&path)
{
if(pNodeEnd == NULL)
{
return false;
}
path.AddTail(this);
return pNodeEnd->FindNode(pNodeStart,path);
}