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

106 lines
3.5 KiB
C++

#include "stdafx.h"
#include "ConvertOld.h"
AcDbObjectId T3Object::GetLayer()const
{
AcDbObjectId id=AcDbObjectId::kNull;
AcDbEntity *pEnt=NULL;
acdbOpenObject(pEnt,m_idSubObject[0],AcDb::kForRead);
if (pEnt!=NULL)
{
id=pEnt->layerId();
pEnt->close();
}
return id;
}
Adesk::UInt16 T3Object::GetColorIndex()const
{
Adesk::UInt16 id=256;
AcDbEntity *pEnt=NULL;
acdbOpenObject(pEnt,m_idSubObject[0],AcDb::kForRead);
if (pEnt!=NULL)
{
id=pEnt->colorIndex();
pEnt->close();
}
return id;
}
AcDbObjectId T3Object::Make()
{
AcDbEntity *pEnt=MakeEntity();
if (pEnt==NULL)
{
pEnt->setColorIndex(GetColorIndex());
AcDbObjectId idLayer=GetLayer();
if (idLayer!=AcDbObjectId::kNull)
pEnt->setLayer(idLayer);
m_idObject=AddToModelSpace(pEnt,Adesk::kTrue);
}
else
m_idObject=AcDbObjectId::kNull;
return m_idObject;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AcDbEntity *T3Column::CreateEntity()const
{
TDbColumn*pColu=new TDbColumn;
pColu->SetOutlinePoly(m_polyOutline);
pColu->SetLocation(m_ptCenter);
pColu->SetSectionShape(m_nShape);
pColu->SetElevation(T3AllObjects::s_fDefaultElev);
pColu->SetHeight(T3AllObjects::s_fDefaultHeight);
pColu->SetMaterial(T3AllObjects::s_nDefaultColumnMat);
return pColu;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AcDbEntity *T3Wall::CreateEntity()const
{
TDbWall* pWall=new TDbWall;
pWall->StartPoint()=StartPoint();
pWall->EndPoint()=EndPoint();
pWall->SetBulge(GetBulge());
pWall->SetWidth(0,m_fLeftWidth);
pWall->SetWidth(1,m_fRightWidth);
pWall->SetHeight(T3AllObjects::s_fDefaultHeight);
pWall->SetElevation(T3AllObjects::s_fDefaultElev);
pWall->SetStyle(T3AllObjects::s_nDefaultWallMat);
return pWall;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AcDbEntity *T3Opening::CreateEntity()const
{
if (m_idWalls.length()>1)
{
TDbCornerWin* pWin=new TDbCornerWin;
//...
return pWin;
}
else if (m_idWalls.length()==1)
{
TDbOpening *pWin=new TDbOpening;
//...
return pWin;
}
else
return NULL;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
double T3AllObjects::s_fMaxWallWidth=500;//最大墙宽
CString T3AllObjects::s_sWallLayer=LAY_WALL;//墙图层定义
CString T3AllObjects::s_sOpeningLayer=LAY_WIN;//门窗图层定义
CString T3AllObjects::s_sColumnLayer=LAY_COLU;//柱图层定义
CString T3AllObjects::s_sDefaultDoor;//默认门图块
CString T3AllObjects::s_sDefaultWin;//默认窗图块
CString T3AllObjects::s_sDefaultColumnRect;//默认方柱图块
CString T3AllObjects::s_sDefaultColumnCircle;//默认圆柱图块
double T3AllObjects::s_fDefaultHeight=3000;//墙柱高
double T3AllObjects::s_fDefaultElev=0;//墙柱低标高
double T3AllObjects::s_fDefaultWinSill=900;//窗台高
double T3AllObjects::s_fDefaultDoorSill=0;//门槛高
double T3AllObjects::s_fDefaultWinHeight=1500;//窗高
double T3AllObjects::s_fDefaultDoorHeight=2100;//门高
CString T3AllObjects::s_sDefaultDoor3d;//三维门样式
CString T3AllObjects::s_sDefaultWin3d;//三维空样式
TWallData::TWallStyle T3AllObjects::s_nDefaultWallMat=TWallData::kBrick;//普通材质
TColumnData::TColumnMaterial T3AllObjects::s_nDefaultColumnMat=TColumnData::kConcrete;//柱材质