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

73 lines
1.3 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : TPGeGridNode.cpp
// = Version : ver2.0
// = Author : xlc
// = CreateDate : 2002-09-09
// = Description: ¼Ðµã¶ÔÏóÀàµÄ¶¨Òå
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "TPGeGridNode.h"
TPGeGridNode::TPGeGridNode(int type)
: m_nPara(-1),m_nType(type)
{
}
TPGeGridNode::TPGeGridNode(const TGPoint& pt,int type)
: TGPoint(pt),m_nPara(-1),m_nType(type)
{
}
TPGeGridNode::TPGeGridNode(const TPGeGridNode&node)
: TGPoint(node),m_nPara(node.m_nPara),m_nType(node.m_nType)
{
}
TPGeGridNode::~TPGeGridNode()
{
}
void TPGeGridNode::SetVisible(bool bVisible)
{
m_nType=bVisible;
}
bool TPGeGridNode::IsVisibleNode() const
{
return m_nType == 1;
}
bool TPGeGridNode::IsBoundaryNode() const
{
return m_nType == 2;
}
bool TPGeGridNode::operator >(const TPGeGridNode&node) const
{
return node < (*this);
}
bool TPGeGridNode::operator <(const TPGeGridNode &node) const
{
int d = (int)(x - node.x);
if (DOWN_ZEROD(d))
{
return true;
}
else if (UP_ZEROD(d))
{
return false;
}
else
{
return DOWN_ZEROD(y-node.y);
}
}