//-----------------------------------------------------------------------------+ // 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); } }