Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

92 lines
1.8 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : TPGeGridCell.cpp
// = Version : ver2.0
// = Author : xlc
// = CreateDate : 2002-09-09
// = Description: 类的定义
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "TPGeGridCell.h"
#include "TPGeGridNode.h"
#include "TPGeGridSeg.h"
TPGeGridCell::~TPGeGridCell()
{
}
bool TPGeGridCell::operator <(const TPGeGridCell&)const
{
return false;
}
bool TPGeGridCell::operator >(const TPGeGridCell&)const
{
return false;
}
void TPGeGridCell::Make3DFace(const TPGeCurve2D &outline,TGObjectList&mlines)
{
TDualPtrList<TPGeGridNode> lstPt;
if (m_allNode[0]->IsVisibleNode())
{
lstPt << *m_allNode[0];
}
if (m_allSeg[0] != NULL)
{
lstPt << m_allSeg[0]->m_lstCutPoint;
}
if (m_allNode[1]->IsVisibleNode())
{
lstPt << *m_allNode[1];
}
if (m_allSeg[1] != NULL)
{
lstPt << m_allSeg[1]->m_lstCutPoint;
}
if (m_allNode[2]->IsVisibleNode())
{
lstPt << *m_allNode[2];
}
if (m_allSeg[2] != NULL)
{
const TDualPtrList<TPGeGridNode> &lstCut = m_allSeg[2]->m_lstCutPoint;
for (long i = lstCut.GetLength() - 1; i >= 0; i--)
{
lstPt << lstCut.GetAt(i);
}
}
if (m_allNode[3]->IsVisibleNode())
{
lstPt << *m_allNode[3];
}
if (m_allSeg[3] != NULL)
{
const TDualPtrList<TPGeGridNode> &lstCut = m_allSeg[3]->m_lstCutPoint;
for (long i = lstCut.GetLength() - 1; i >= 0; i--)
{
lstPt << lstCut.GetAt(i);
}
}
if (lstPt.GetLength() < 3)
{
return;
}
TGMLine2D *pMline = new TGMLine2D(lstPt.GetLength(),true);
for (lstPt.MoveToFirst();!lstPt.IsOut();lstPt.MoveToNext())
{
(*pMline)[lstPt.GetCur()] = lstPt.GetCurData();
}
mlines << pMline;
}