54 lines
1.7 KiB
C++
54 lines
1.7 KiB
C++
//-----------------------------------------------------------------------------+
|
|||
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
||
|
|
// = FileName : TGGeCurveSegment 类
|
||
|
|
// = Version : ver2.0
|
||
|
|
// = Author : wlw
|
||
|
|
// = CreateDate : 2002-09-09
|
||
|
|
// = Description: TGGeCurveSegment 定义
|
||
|
|
// = Maintainers:
|
||
|
|
//
|
||
|
|
//-----------------------------------------------------------------------------+
|
||
|
|
#include "StdAfx.h"
|
||
|
|
#include "TGGiWallVector.h"
|
||
|
|
#include "TSortWallOnPt.h"
|
||
|
|
#include "TAecSpaceWall.h"
|
||
|
|
#include "TEntitySet.h"
|
||
|
|
#include "TADSGePoint3d.h"
|
||
|
|
|
||
|
|
TGGiWallVector::TGGiWallVector(TAecSpaceWall *pWallData, ads_real dDir)
|
||
|
|
: pWall(pWallData), nDirection(dDir)
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// 以ptLoc为参考点定义方向,返回左边的曲线
|
||
|
|
// Bugs: When a Arc The direction of start and end is exact same
|
||
|
|
// 考虑了墙体标高, 用区域来判断两端点是否相等
|
||
|
|
TGGeCurveSegment TGGiWallVector::LeftCurve(TSortWallOnPt *pNode, int nFlg)
|
||
|
|
{
|
||
|
|
ASSERT(pNode != NULL);
|
||
|
|
|
||
|
|
TADSGePoint3d &ptStart = pWall->StartPoint();
|
||
|
|
return (pNode->ExactInclude(ptStart) ? pWall->Offset(-pWall->GetWidth(0), nFlg)
|
||
|
|
: pWall->Offset(pWall->GetWidth(1), nFlg));
|
||
|
|
}
|
||
|
|
|
||
|
|
// 以ptLoc为参考点定义方向,返回右边的曲线
|
||
|
|
// 考虑了墙体标高, 用区域来判断两端点是否相等
|
||
|
|
TGGeCurveSegment TGGiWallVector::RightCurve(TSortWallOnPt *pNode, int nFlg)
|
||
|
|
{
|
||
|
|
ASSERT(pNode != NULL);
|
||
|
|
|
||
|
|
TADSGePoint3d &ptStart = pWall->StartPoint();
|
||
|
|
return (pNode->ExactInclude(ptStart) ? pWall->Offset(pWall->GetWidth(1), nFlg)
|
||
|
|
: pWall->Offset(-pWall->GetWidth(0), nFlg));
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// 0--equal; 1--not equal
|
||
|
|
int TGGiWallVector::FindByEntity(const TGGiWallVector *ptrSrc, const void *ptrEnt)
|
||
|
|
{
|
||
|
|
int nEqual = ptrSrc->pWall->m_ent == *(const TEntitySet *)ptrEnt;
|
||
|
|
return !nEqual;
|
||
|
|
}
|
||
|
|
|