52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
//-------------------------------------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TGroups 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TGroups 定义
|
|
// = Maintainers:
|
|
//
|
|
//-------------------------------------------------------------------------------------------------------+
|
|
#include "StdAfx.h"
|
|
#include "TGroups.h"
|
|
#include "TADSGePoint3d.h"
|
|
#include "TchGlobalFunc.h"
|
|
|
|
TGroups::~TGroups()
|
|
{
|
|
|
|
}
|
|
|
|
int TGroups::operator == (const TGroups &other) const
|
|
{
|
|
if (type != other.type)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
switch(TypeOfCode(code))
|
|
{
|
|
case RTSTR : return !_tcsicmp(string,other.string);
|
|
case RTANG:
|
|
case RTREAL : return fabs(real-other.real) < 1E-8;
|
|
case RTSHORT : return shortInt == other.shortInt;
|
|
case RTLONG : return longInt == other.longInt;
|
|
case RTENAME :
|
|
case RTPICKS : return ads_name_equal(adsName, other.adsName);
|
|
case RTPOINT :
|
|
case RT3DPOINT: return *(TADSGePoint3d *)point == *(TADSGePoint3d *)other.point;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
inline TGroups& TGroups::operator = (const TGroups &src)
|
|
{
|
|
memcpy(this, &src, sizeof(TGroups));
|
|
if(TypeOfCode(code) == RTSTR)
|
|
{
|
|
string = _tcsdup(src.string);
|
|
}
|
|
return *this;
|
|
}
|