//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd. // = FileName : TGObject.cpp // = Version : ver2.0 // = Author : xlc // = CreateDate : 2002-09-09 // = Description: 类的定义 // = Maintainers: // //-----------------------------------------------------------------------------+ #include "StdAfx.h" #include "TGObject.h" #include "TGMatrix.h" #include "TGObjectList.h" TGObject::OutputGObject TGObject::s_pOutputFun = NULL; IMPLEMENT_RUN_TIME_CLASS1(TGObject,"TGObject",TWRunTimeClass) TGObject::~TGObject() { } bool TGObject::operator>(const TGObject&obj) const { return GetClassID()>obj.GetClassID(); } bool TGObject::operator<(const TGObject&obj) const { return GetClassID()TransformBy(mat); } } void TGObject::TransWcs(TGObject*pObj) const { TPGeCoordSys ecs; if (GetEcs(ecs)) { TGMatrix mat; ecs.GetMatrixFrom(&mat); pObj->TransformBy(mat); } } bool TGObject::IsExtendInter(const TPGeExtend2D& pExt) const { ASSERT(pExt != NULL); TPGeExtend2D ext1; if (!GetExtend2D(ext1)) { return true;//无限大,因此有交 } else { return pExt.IsIntersect(ext1); } } bool TGObject::IsExtendInter(const TPGeExtend3D& pExt) const { ASSERT(pExt != NULL); TPGeExtend3D ext1; if (!GetExtend3D(ext1)) { return true; //无限大,因此有交 } else { return pExt.IsIntersect(ext1); } }