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

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;
}