2876 lines
72 KiB
C++
2876 lines
72 KiB
C++
//------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2011, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TDbBaseWall类
|
|
// = Version : ver1.0
|
|
// = Author : ywb
|
|
// = CreateDate : 2011-05-03
|
|
// = Description: 结构柱子类实现
|
|
// = Maintainers:
|
|
//
|
|
//------------------------------------------------------------------------+
|
|
#include "StdAfx.h"
|
|
#ifdef TASD
|
|
#include "TDbColumn.h"
|
|
#include "TAsdKeyDefine.h"
|
|
|
|
double g_dCoordinateLen = 300; // 坐标线的长度
|
|
|
|
#define COLUCOLOR 2
|
|
#define TBCOLUCOLOR 4
|
|
#define TCOLUCOLOR 7
|
|
#define BCOLUCOLOR 8
|
|
#define CORCOLUCOLOR 6
|
|
|
|
extern TARCH_EXP int g_nColuForce; //底层墙柱显示工况
|
|
|
|
Acad::ErrorStatus TDbColumn::StruExplodeOrDraw3d( TGGiExplodeDrawBase &dc ) const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
if (_tcscmp(dc.Desc(), XAcGiViewDraw::Descriptor())==0)
|
|
{
|
|
AcGiCommonDraw *dcCommon = ((XAcGiViewDraw &)dc).GetCommonDraw();
|
|
if (!dcCommon->context()->isPlotGeneration())
|
|
{
|
|
//单元编号
|
|
if(DocGetShowNo() && DocGetColuShowNo())
|
|
{
|
|
DrawCellNo(dc);
|
|
}
|
|
|
|
//刚域
|
|
if(DocGetShowRG() && DocGetColuShowRG())
|
|
{
|
|
DrawRG(dc);
|
|
}
|
|
}
|
|
}
|
|
|
|
// add by xlc on 120112荷载显示控制
|
|
if((DocGetColuShowLoad() && g_nLoadDrawMode == BYOBJLOAD)|| g_nLoadDrawMode == COLULOAD)
|
|
{
|
|
DrawColuLoad(dc, 3);
|
|
}
|
|
|
|
return Acad::eOk;
|
|
}
|
|
|
|
Acad::ErrorStatus TDbColumn::StruExplodeOrDraw2d( TGGiExplodeDrawBase &dc ) const
|
|
{
|
|
assertReadEnabled();
|
|
AcDbObjectId idLineType = AcDbObjectId::kNull, idOldLineType = AcDbObjectId::kNull;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_LTID, idLineType);
|
|
idOldLineType = dc.GetLineTypeId();
|
|
if (idLineType.isValid())
|
|
{
|
|
dc.SetLineType(idLineType);
|
|
}
|
|
|
|
TGGePoly2D plBot(m_polyOutline);
|
|
plBot.SetElevation(0);
|
|
|
|
// modify by wjx on 111230
|
|
// 柱坐标和特殊柱填充
|
|
int nColor = dc.GetColor();
|
|
int nType = GetHinge();
|
|
if(!g_bDetailMode) //简图
|
|
{
|
|
//仅布置和修改柱荷时显示柱坐标
|
|
if (g_nLoadDrawMode == COLULOAD)
|
|
{
|
|
DrawCoordinate(dc);
|
|
}
|
|
SepColuHach(dc);
|
|
|
|
if(nType == 0) // 普通柱
|
|
{
|
|
dc.SetColor(COLUCOLOR); // 黄色
|
|
dc.DrawXPoly(plBot);
|
|
}
|
|
else
|
|
{
|
|
if(nType == 1) // 上端铰柱
|
|
{
|
|
dc.SetColor(TCOLUCOLOR); // 白色
|
|
}
|
|
else if(nType == 2) // 下端铰柱
|
|
{
|
|
dc.SetColor(BCOLUCOLOR); // 灰色
|
|
}
|
|
else if(nType == 3) // 两端铰柱
|
|
{
|
|
dc.SetColor(TBCOLUCOLOR); // 青色
|
|
}
|
|
}
|
|
}
|
|
else // 详图
|
|
{
|
|
// 绘制线
|
|
dc << plBot;
|
|
dc.SetLineType(idOldLineType);
|
|
}
|
|
|
|
// 填充
|
|
int nHatchType = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_HATCH, nHatchType);
|
|
|
|
TColumnData::TColumnMaterial nMatTyp = kConcrete;
|
|
|
|
BOOL bHatch = FALSE; //是否填充
|
|
BOOL bThick = FALSE; //是否加粗
|
|
double dLineWidth = 0; //加粗线宽
|
|
CString sHatchType = _T("SOLID");
|
|
switch (nMatTyp)
|
|
{
|
|
case kConcrete: //混凝土柱
|
|
bHatch = DocGetConColuHatch();
|
|
bThick = DocGetConColuThick();
|
|
dLineWidth = DocGetConColuLWeight();
|
|
sHatchType = DocGetConColuHPatte();
|
|
break;
|
|
case kSteel: //钢柱
|
|
bHatch = DocGetStlColuHatch();
|
|
bThick = DocGetStlColuThick();
|
|
dLineWidth = DocGetStlColuLWeight();
|
|
sHatchType = DocGetStlColuHPatte();
|
|
break;
|
|
}
|
|
dLineWidth *= GetPScale();
|
|
|
|
if(nHatchType == 0 && DocGetIsSolidFill() && bHatch|| nHatchType == 1 || nType > 0)
|
|
{
|
|
TPushProperty vProp(this, dc);
|
|
if (m_idLayerHatch.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerHatch);
|
|
}
|
|
|
|
if (plBot.HasArcSegment())
|
|
{
|
|
TGGePoly2D poly;
|
|
plBot.Disperse(poly);
|
|
plBot.Reset();
|
|
plBot = poly;
|
|
}
|
|
|
|
if (_tcsicmp(sHatchType, _T("SOLID")) == 0)
|
|
{
|
|
dc << TGGeSolid(plBot);
|
|
}
|
|
else
|
|
{
|
|
dc << TGGeHatch(plBot, sHatchType, GetPScale());
|
|
}
|
|
}
|
|
|
|
dc.SetColor(nColor);
|
|
|
|
// 加粗
|
|
if(!g_bDetailMode) //简图
|
|
{
|
|
int nLineWeight = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_LNWEIGHT, nLineWeight);
|
|
if((nLineWeight == 0 && DocGetIsLineWeight() && bThick)|| nLineWeight == 1)
|
|
{
|
|
TGGePoly2D polyDest;
|
|
if (plBot.PathArea() > 0) // 顺时针
|
|
{
|
|
plBot.Offset(dLineWidth, polyDest);
|
|
}
|
|
else
|
|
{
|
|
plBot.Offset(dLineWidth * (-1), polyDest);
|
|
}
|
|
|
|
TGGePoly2D poly2dNew;
|
|
for (int i = 0; i < plBot.Length() - 1; i++)
|
|
{
|
|
poly2dNew.Reset();
|
|
poly2dNew.AppendNode(*plBot[i], *(plBot.m_ardbulges[i]));
|
|
poly2dNew.AppendNode(*plBot[i+1]);
|
|
poly2dNew.AppendNode(*polyDest[i+1], *(polyDest.m_ardbulges[i]) * (-1));
|
|
poly2dNew.AppendNode(*polyDest[i]);
|
|
poly2dNew.SetClosed();
|
|
dc << TGGeSolid(poly2dNew);
|
|
}
|
|
|
|
poly2dNew.Reset();
|
|
poly2dNew.AppendNode(*plBot[plBot.Length() - 1], *(plBot.m_ardbulges[plBot.Length() - 1]));
|
|
poly2dNew.AppendNode(*plBot[0]);
|
|
poly2dNew.AppendNode(*polyDest[0], *(polyDest.m_ardbulges[polyDest.Length() - 1]) * (-1));
|
|
poly2dNew.AppendNode(*polyDest[polyDest.Length() - 1]);
|
|
poly2dNew.SetClosed();
|
|
dc << TGGeSolid(poly2dNew);
|
|
}
|
|
}
|
|
|
|
// 显示柱尺寸
|
|
if (_tcscmp(dc.Desc(), XAcGiViewDraw::Descriptor())==0)
|
|
{
|
|
AcGiCommonDraw *dcCommon = ((XAcGiViewDraw &)dc).GetCommonDraw();
|
|
if (!dcCommon->context()->isPlotGeneration())
|
|
{
|
|
if(DocGetShowBH() && DocGetColuShowBH())
|
|
{
|
|
DrawBH(dc);
|
|
}
|
|
}
|
|
}
|
|
|
|
// 显示构件编号
|
|
if(DocGetColuShowCL())
|
|
{
|
|
DrawClab(dc);
|
|
}
|
|
|
|
// 绘制荷载信息
|
|
if((DocGetColuShowLoad() && g_nLoadDrawMode == BYOBJLOAD)|| g_nLoadDrawMode == COLULOAD)
|
|
|
|
{
|
|
DrawColuLoad(dc, 2);
|
|
}
|
|
|
|
// add by wjx on 120329
|
|
// 绘制轴力图
|
|
if(g_nGraph == FORCE_N)
|
|
{
|
|
DrawNGraph(dc);
|
|
}
|
|
|
|
//绘制底层墙柱内力
|
|
DrawWallColu(dc);
|
|
|
|
//绘制配筋面积
|
|
if(g_nReinAreaModeColu != eNorm)
|
|
{
|
|
DrawColuRein(dc);
|
|
}
|
|
return Acad::eOk;
|
|
}
|
|
/*
|
|
double TDbColumn::GetBottomElev() const
|
|
{
|
|
assertReadEnabled();
|
|
AcGePoint3d ptPos = AcGePoint3d::kOrigin;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_INSPTI, ptPos);
|
|
return ptPos.z;
|
|
}
|
|
|
|
void TDbColumn::SetBottomElev( double dElev )
|
|
{
|
|
assertWriteEnabled();
|
|
AcGePoint3d ptPos = AcGePoint3d::kOrigin;
|
|
GetSpecialtyData()->GetAt(KEY_INSPTI, ptPos);
|
|
ptPos.z = dElev;
|
|
GetSpecialtyData()->SetAt(KEY_INSPTI, ptPos);
|
|
}
|
|
|
|
double TDbColumn::GetTopElev() const
|
|
{
|
|
assertReadEnabled();
|
|
AcGePoint3d ptPos = AcGePoint3d::kOrigin;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_INSPTJ, ptPos);
|
|
return ptPos.z;
|
|
}
|
|
|
|
void TDbColumn::SetTopEleve(double dElev)
|
|
{
|
|
assertWriteEnabled();
|
|
AcGePoint3d ptPos = AcGePoint3d::kOrigin;
|
|
GetSpecialtyData()->GetAt(KEY_INSPTJ, ptPos);
|
|
ptPos.z = dElev;
|
|
GetSpecialtyData()->SetAt(KEY_INSPTJ, ptPos);
|
|
}
|
|
|
|
TADSGePoint3d TDbColumn::GetParameters() const
|
|
{
|
|
assertReadEnabled();
|
|
TADSGePoint3d pt, ptUp, ptLow;
|
|
m_polyOutline.GetExtend(ptLow, ptUp);
|
|
pt.x = fabs(ptLow.x - ptUp.x);
|
|
pt.y = fabs(ptLow.y - ptUp.y);
|
|
|
|
double dAngle = 0.0;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_AXANG, dAngle);
|
|
pt.z = dAngle;
|
|
|
|
return pt;
|
|
}
|
|
|
|
double TDbColumn::GetColumnHeight() const
|
|
{
|
|
AcGePoint3d pt1, pt2;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_INSPTJ, pt1);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_INSPTI, pt2);
|
|
return fabs(pt1.z - pt2.z);
|
|
}
|
|
|
|
*/
|
|
// 尺寸标注
|
|
void TDbColumn::DrawBH(TGGiExplodeDrawBase &dc) const
|
|
{
|
|
TDbText text;
|
|
text.setPropertiesFrom(this);
|
|
if (m_idLayerDim.isValid())
|
|
{
|
|
text.setLayer(m_idLayerDim);
|
|
}
|
|
|
|
AcDbObjectId idColuBHStyl = DocGetColuBHStyle();
|
|
if(idColuBHStyl.isNull())
|
|
{
|
|
idColuBHStyl = InitTextStyle(TS_STANDARD);
|
|
}
|
|
text.SetStyleId(idColuBHStyl); // 设置尺寸文字样式
|
|
|
|
text.SetHeight(DocGetColuBHHigh()); // 设置尺寸文字高度
|
|
|
|
text.setColorIndex(DocGetColuBHColor());// 设置尺寸文字颜色
|
|
|
|
text.SetAlignment(XExplodeDraw::kCenter);
|
|
|
|
TADSGePoint3d ptPara = GetParameters();
|
|
TADSGePoint3d ptLow, ptUp;
|
|
// GetExtents2d(ptLow, ptUp); // 获得柱子轮廓的最高点和最底点
|
|
m_polyOutline.GetExtend(ptLow, ptUp);
|
|
ptLow.z = 0.0;
|
|
ptUp.z = 0.0;
|
|
|
|
// 求柱子外围轮廓的宽和高
|
|
double dHeight, dWidth;
|
|
dHeight = fabs(ptUp.y - ptLow.y);
|
|
// dWidth = fabs(ptUp.x - ptLow.x);
|
|
|
|
// 设置文字内容
|
|
CString strText;
|
|
|
|
// 获得插入点
|
|
AcGePoint3d ptInsert = GetLocation();
|
|
|
|
TSectionShape nShape = GetSectionShape();
|
|
|
|
double dColuWidth = 0.0;
|
|
|
|
double dDis = DocGetColuBHDist() * GetPScale();
|
|
CString strWidth;
|
|
if(nShape != kCircle) // 非圆形
|
|
{
|
|
strText.Format(_T("%.fX%.f"), ptPara.x, ptPara.y);
|
|
text.SetText(strText);
|
|
|
|
//TGGePoly2D poly = GetOutlinePoly(); // 得到柱子的外围框
|
|
//TGGeCurveSegment seg;
|
|
//poly.Nth(0, seg);
|
|
|
|
//TADSGePoint3d ptStart = seg.GetStartPoint();
|
|
//TADSGePoint3d ptEnd = seg.GetEndPoint();
|
|
|
|
//double angle = ptPara.z;//ads_angle(ptStart, ptEnd);// 得到柱子的旋转角度
|
|
//AngleRangeToPI(angle); // 180-360度时的处理
|
|
|
|
//if(fabs(cos(angle)) <= g_angleZero) // 0-90度时得到文字需要移动的距离
|
|
//{
|
|
// dColuWidth = ptPara.x;
|
|
//}
|
|
//else // 90-180
|
|
//{
|
|
// dColuWidth = ptPara.y/cos(angle);
|
|
//}
|
|
|
|
|
|
dDis += dHeight/2;
|
|
ptInsert.y += dDis;// 得到插入点(在垂直方向移动dDis距离后的点)
|
|
}
|
|
else // 圆形
|
|
{
|
|
//GetSpecialtyDataReadOnly()->GetAt(KEY_B, dColuWidth);
|
|
|
|
strText.Format(_T("%.f"), ptPara.x); // 直径
|
|
text.SetText(strText);
|
|
|
|
dDis += ptPara.x/2;
|
|
ptInsert.y += dDis;
|
|
}
|
|
|
|
text.SetLocation(ptInsert); // 设置文字位置
|
|
|
|
TPushProperty vProp(&text, dc);
|
|
if (dc.IsFullExplode())
|
|
{
|
|
text.ExplodeOrDraw2d(dc);
|
|
}
|
|
else
|
|
{
|
|
dc.DrawEntity(text);
|
|
}
|
|
}
|
|
|
|
// 构件编号
|
|
void TDbColumn::DrawClab(TGGiExplodeDrawBase &dc) const
|
|
{
|
|
TPushProperty vProp(this, dc);
|
|
if (m_idLayerNum.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerNum);
|
|
}
|
|
|
|
// modify by wjx on 120105 没有编号时需要显示斜线和横线
|
|
double dLineLen = 200; // 线长
|
|
AcGePoint3d ptInsert = GetLocation(); // 得到柱子的插入点
|
|
|
|
// 画文字的斜线部分
|
|
TADSGePoint3d ptLow, ptUp;
|
|
// GetExtents2d(ptLow, ptUp); // 得到柱子的最高点和最低点
|
|
m_polyOutline.GetExtend(ptLow, ptUp);
|
|
ptLow.z = 0.0;
|
|
ptUp.z = 0.0;
|
|
|
|
double dHeight, dWidth;
|
|
dHeight = fabs(ptUp.y - ptLow.y);
|
|
dWidth = fabs(ptUp.x - ptLow.x);
|
|
|
|
// 设置斜线部分的起始点和终止点
|
|
TADSGePoint3d ptEnd(ptInsert.x + dWidth/2 + dLineLen, ptInsert.y + dHeight/2 + dLineLen, ptInsert.z);
|
|
TADSGePoint3d ptStart(ptInsert);
|
|
|
|
TGGeCurveSegment seg(ptStart, ptEnd, 0);
|
|
|
|
TGGeLine line(seg);
|
|
dc.DrawLine(line);
|
|
|
|
// 画文字宽和高
|
|
double dTextWidth = dLineLen, dTextHeight = 0;
|
|
|
|
CString strCLab;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_CLAB, strCLab);
|
|
|
|
if(!strCLab.IsEmpty())
|
|
{
|
|
TDbText text;
|
|
text.setPropertiesFrom(this);
|
|
|
|
AcDbObjectId idColuCLStyl = DocGetColuCLStyle();
|
|
if(idColuCLStyl.isNull())
|
|
{
|
|
idColuCLStyl = InitTextStyle(TS_STANDARD);
|
|
}
|
|
text.SetStyleId(idColuCLStyl); // 设置文字样式
|
|
text.SetHeight(DocGetColuCLHigh()); // 设置文字高度
|
|
text.setColorIndex(DocGetColuCLColor());// 设置文字颜色
|
|
text.SetAlignment(XExplodeDraw::kCenter);// 设置文字对齐方式
|
|
text.SetText(strCLab); // 设置文字内容
|
|
text.GetExtents(&dTextWidth, &dTextHeight); // 得到文字的宽和高
|
|
|
|
ptInsert = AcGePoint3d(ptEnd.x + dTextWidth/2, ptEnd.y, 0); // 计算文字的插入点
|
|
|
|
text.SetLocation(ptInsert); // 设置文字的插入点
|
|
|
|
//text.setLayer(DocGetColuCLLayer()); // 设置文字图层
|
|
if (m_idLayerNum.isValid())
|
|
{
|
|
text.setLayer(m_idLayerNum);
|
|
}
|
|
|
|
TPushProperty vProp(&text, dc);
|
|
if (dc.IsFullExplode())
|
|
{
|
|
text.ExplodeOrDraw2d(dc);
|
|
}
|
|
else
|
|
{
|
|
dc.DrawEntity(text);
|
|
}
|
|
}
|
|
|
|
ptStart = TADSGePoint3d(ptEnd);
|
|
ptEnd.x += dTextWidth * 1.2; // *1.2是因为文字下方的线要比文字的宽度长一些
|
|
|
|
seg = TGGeCurveSegment(ptStart, ptEnd, 0);
|
|
|
|
line = TGGeLine(seg);
|
|
dc.DrawLine(line);
|
|
}
|
|
|
|
// 单元编号
|
|
void TDbColumn::DrawCellNo(TGGiExplodeDrawBase &dc) const
|
|
{
|
|
CString strCellNo;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_CELLNO, strCellNo);
|
|
if (strCellNo.IsEmpty())
|
|
{
|
|
return;
|
|
}
|
|
|
|
TPushProperty vProp(this, dc);
|
|
if (m_idLayerNum.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerNum);
|
|
}
|
|
|
|
AcDbText text;
|
|
text.setTextString(strCellNo); // 设置文字的显示内容
|
|
|
|
// 设置文字样式
|
|
AcDbObjectId idColuNOStyl = DocGetColuNoStyle();
|
|
if(!idColuNOStyl.isNull())
|
|
{
|
|
text.setTextStyle(idColuNOStyl);
|
|
}
|
|
else
|
|
{
|
|
text.setTextStyle(InitTextStyle(TS_STANDARD));
|
|
}
|
|
|
|
text.setHeight(DocGetColuNoHigh() * GetPScale()); // 设置文字字高
|
|
|
|
text.setColorIndex(DocGetColuNoColor()); // 设置文字颜色
|
|
|
|
// 设置文字法向
|
|
if(_tcscmp(dc.Desc(), TGGiWorldViewportDraw::Descriptor())==0)
|
|
{
|
|
AcGiViewport &vp = ((TGGiWorldViewportDraw&)dc).m_pVd->viewport();
|
|
|
|
AcGePoint3d ptCamera, ptTarget;
|
|
vp.getCameraTarget(ptTarget);
|
|
vp.getCameraLocation(ptCamera);
|
|
|
|
AcGeVector3d vtViewDrt = ptCamera-ptTarget;
|
|
AcGeVector3d vtViewDir1= vp.viewDir();
|
|
|
|
AcGeVector3d vtCamera;
|
|
vp.getCameraUpVector(vtCamera);
|
|
|
|
vtViewDrt.normalize();
|
|
|
|
text.setNormal(vtViewDrt);
|
|
}
|
|
|
|
AcGePoint3d ptInsertJ = GetLocation();
|
|
ptInsertJ.z = GetLocation().z + GetHeight()/2;
|
|
|
|
TADSGePoint3d ptLow, ptUp;
|
|
// GetExtents2d(ptLow, ptUp); // 获得柱子轮廓的最高点和最底点
|
|
m_polyOutline.GetExtend(ptLow, ptUp);
|
|
ptLow.z = 0.0;
|
|
ptUp.z = 0.0;
|
|
|
|
// 求柱子外围轮廓的宽和高
|
|
double dWidth;
|
|
dWidth = fabs(ptUp.x - ptLow.x);
|
|
|
|
double dDis = (DocGetColuNoDist() * GetPScale()) + dWidth/2;// 得到文字到柱子的距离(考虑图纸比例)
|
|
ptInsertJ.x += dDis;
|
|
|
|
text.setPosition(ptInsertJ); // 设置文字的插入位置
|
|
text.setHorizontalMode(AcDb::kTextMid); // 设置文字的对齐方式
|
|
|
|
dc.DrawEntity(text);
|
|
}
|
|
|
|
// 刚域
|
|
void TDbColumn::DrawRG(TGGiExplodeDrawBase &dc) const
|
|
{
|
|
double dRGI, dRGJ;
|
|
bool bI = GetSpecialtyDataReadOnly()->GetAt(KEY_RIGIDI, dRGI);
|
|
double bJ = GetSpecialtyDataReadOnly()->GetAt(KEY_RIGIDJ, dRGJ);
|
|
if(!bI && !bJ)
|
|
{
|
|
return;
|
|
}
|
|
|
|
CString strRGI, strRGJ;
|
|
AcDbText text;
|
|
|
|
// 设置文字样式
|
|
AcDbObjectId idColuRGStyl = DocGetColuRGStyle();
|
|
if(!idColuRGStyl.isNull())
|
|
{
|
|
text.setTextStyle(idColuRGStyl);
|
|
}
|
|
else
|
|
{
|
|
text.setTextStyle(InitTextStyle(TS_STANDARD));
|
|
}
|
|
|
|
text.setHeight(DocGetColuRGHigh() * GetPScale());// 设置文字高度
|
|
|
|
text.setColorIndex(DocGetColuRGColor()); // 设置文字颜色
|
|
|
|
// 设置文字法向
|
|
if(_tcscmp(dc.Desc(), TGGiWorldViewportDraw::Descriptor())==0)
|
|
{
|
|
AcGiViewport &vp = ((TGGiWorldViewportDraw&)dc).m_pVd->viewport();
|
|
|
|
AcGePoint3d ptCamera, ptTarget;
|
|
vp.getCameraTarget(ptTarget);
|
|
vp.getCameraLocation(ptCamera);
|
|
|
|
AcGeVector3d vtViewDrt = ptCamera-ptTarget;
|
|
AcGeVector3d vtViewDir1= vp.viewDir();
|
|
|
|
AcGeVector3d vtCamera;
|
|
vp.getCameraUpVector(vtCamera);
|
|
|
|
vtViewDrt.normalize();
|
|
|
|
text.setNormal(vtViewDrt);
|
|
}
|
|
|
|
double dDis = (DocGetColuRGDist() * GetPScale()); // 得到文字到柱子的距离(考虑图层比例)
|
|
AcGePoint3d ptInsert;
|
|
|
|
text.setHorizontalMode(AcDb::kTextMid); // 设置文字的对齐方式
|
|
|
|
if(bI)
|
|
{
|
|
strRGI = TrimDoubleZero(dRGI);
|
|
ptInsert = GetLocation(); // 得到柱子的插入点
|
|
text.setTextString(strRGI); // 设置文字内容
|
|
ptInsert.z -= dDis;
|
|
ptInsert.z -= text.height();
|
|
|
|
text.setPosition(ptInsert); // 设置文字的插入位置
|
|
dc.DrawEntity(text); // 画文字对象
|
|
}
|
|
|
|
if(bJ)
|
|
{
|
|
strRGJ = TrimDoubleZero(dRGJ);
|
|
text.setTextString(strRGJ); // 设置文字内容
|
|
|
|
ptInsert = GetLocation(); // 得到柱高
|
|
ptInsert.z += dDis + GetHeight();
|
|
|
|
text.setPosition(ptInsert); // 设置文字位置
|
|
|
|
dc.DrawEntity(text);
|
|
}
|
|
|
|
}
|
|
|
|
// 柱坐标
|
|
void TDbColumn::DrawCoordinate(TGGiExplodeDrawBase &dc)const
|
|
{
|
|
// 坐标文字设置
|
|
TDbText textX, textY;
|
|
|
|
AcDbObjectId idColuBHStyl = DocGetColuBHStyle();
|
|
if(idColuBHStyl.isNull())
|
|
{
|
|
idColuBHStyl = InitTextStyle(TS_STANDARD);
|
|
}
|
|
textX.SetStyleId(idColuBHStyl); // 设置尺寸文字样式
|
|
textX.SetHeight(3); // 设置尺寸文字高度
|
|
textX.setColorIndex(DocGetColuBHColor()); // 设置尺寸文字颜色
|
|
textX.SetAlignment(XExplodeDraw::kMiddleLeft);
|
|
textX.SetText(_T("X"));
|
|
|
|
textY.SetStyleId(idColuBHStyl); // 设置尺寸文字样式
|
|
textY.SetHeight(3); // 设置尺寸文字高度
|
|
textY.setColorIndex(DocGetColuBHColor()); // 设置尺寸文字颜色
|
|
textY.SetAlignment(XExplodeDraw::kBottomCenter);
|
|
textY.SetText(_T("Y"));
|
|
|
|
// 获得柱子的插入点
|
|
AcGePoint3d ptInsert;
|
|
ptInsert = GetLocation();
|
|
XPoint ptInsertCopy(ptInsert);
|
|
|
|
// 得到柱子截面形状
|
|
TSectionShape nShape = GetSectionShape();
|
|
|
|
// 画坐标
|
|
TADSGePoint3d ptXEnd(ptInsert.x + g_dCoordinateLen, ptInsert.y, 0.0);// X轴
|
|
TADSGePoint3d ptStart(ptInsert);
|
|
TADSGePoint3d ptYEnd(ptInsert.x, ptInsert.y + g_dCoordinateLen, 0.0);// Y轴
|
|
|
|
TGGeCurveSegment segX(ptStart, ptXEnd, 0);
|
|
TGGeCurveSegment segY(ptStart, ptYEnd, 0);
|
|
|
|
TGGeLine lineX(segX);
|
|
TGGeLine lineY(segY);
|
|
|
|
AcDbPolyline polyX;
|
|
ptStart = ptXEnd;
|
|
ptXEnd = TADSGePoint3d(ptStart.x + g_dCoordinateLen/5, ptStart.y, 0.0);
|
|
polyX.addVertexAt(0, ptXEnd.AsAcGePoint2d());
|
|
|
|
textX.SetLocation(ptXEnd);
|
|
|
|
ptXEnd = TADSGePoint3d(ptStart.x, ptStart.y + g_dCoordinateLen/10, 0.0);
|
|
polyX.addVertexAt(1, ptXEnd.AsAcGePoint2d());
|
|
|
|
ptXEnd = TADSGePoint3d(ptStart.x, ptStart.y - g_dCoordinateLen/10, 0.0);
|
|
polyX.addVertexAt(2, ptXEnd.AsAcGePoint2d());
|
|
polyX.setClosed(Adesk::kTrue);
|
|
|
|
|
|
AcDbPolyline polyY;
|
|
ptStart = ptYEnd;
|
|
ptYEnd = TADSGePoint3d(ptStart.x, ptStart.y + g_dCoordinateLen/5, 0.0);
|
|
polyY.addVertexAt(0, ptYEnd.AsAcGePoint2d());
|
|
|
|
textY.SetLocation(ptYEnd);
|
|
|
|
ptYEnd = TADSGePoint3d(ptStart.x + g_dCoordinateLen/10, ptStart.y, 0.0);
|
|
polyY.addVertexAt(1, ptYEnd.AsAcGePoint2d());
|
|
|
|
ptYEnd = TADSGePoint3d(ptStart.x - g_dCoordinateLen/10, ptStart.y, 0.0);
|
|
polyY.addVertexAt(2, ptYEnd.AsAcGePoint2d());
|
|
polyY.setClosed(Adesk::kTrue);
|
|
|
|
if(nShape != kCircle)
|
|
{
|
|
// 得到柱子的转角
|
|
double dAngle;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_AXANG, dAngle);
|
|
|
|
ads_matrix matRot;
|
|
ptInsertCopy.GetRotationMatrix(dAngle, matRot);
|
|
|
|
// 矩阵转化
|
|
lineX.TransformBy(matRot);
|
|
lineY.TransformBy(matRot);
|
|
polyX.transformBy(AsAcGeMatrix3d(matRot));
|
|
polyY.transformBy(AsAcGeMatrix3d(matRot));
|
|
textX.transformBy(AsAcGeMatrix3d(matRot));
|
|
textY.transformBy(AsAcGeMatrix3d(matRot));
|
|
}
|
|
|
|
lineX.SetElevation(0.0);
|
|
lineY.SetElevation(0.0);
|
|
|
|
dc.DrawLine(lineX);
|
|
dc.DrawLine(lineY);
|
|
dc.Polyline(polyX);
|
|
dc.Polyline(polyY);
|
|
|
|
textX.ExplodeOrDraw2d(dc);
|
|
textY.ExplodeOrDraw2d(dc);
|
|
}
|
|
|
|
// add by wjx on 111222
|
|
// 功能:绘制柱子荷载
|
|
// [in]:nFlag2d3d:绘制2d3d标志2:2d 3:3d
|
|
void TDbColumn::DrawColuLoad(TGGiExplodeDrawBase &dc, int nFlag2d3d)const
|
|
{
|
|
//add by xlc on 120112荷载显示控制
|
|
BOOL bShowGraphic = false; //显示图形
|
|
BOOL bShowLive = false; //显示活荷
|
|
BOOL bShowUnLive = false; //显示恒荷
|
|
|
|
if(g_nLoadDrawMode == BYOBJLOAD)
|
|
{
|
|
bShowGraphic = true;
|
|
bShowLive = bShowUnLive = DocGetShowLoadPara();
|
|
}
|
|
else
|
|
{
|
|
bShowGraphic = GetViewStyle(BYGRAPHIC);
|
|
bShowLive = GetViewStyle(BYVARYING);
|
|
bShowUnLive = GetViewStyle(BYUNVARYING);
|
|
}
|
|
|
|
//都不显示时直接返回
|
|
if (!(bShowGraphic||bShowLive||bShowUnLive))
|
|
{
|
|
return;
|
|
}
|
|
|
|
// modify by wjx on 120130 修改柱子荷载信息的读取方式
|
|
std::vector<TStruLoad> vecLoad;
|
|
GetLoadsArray(vecLoad);
|
|
|
|
int nSize = vecLoad.size();
|
|
if(nSize < 1)
|
|
{
|
|
return;
|
|
}
|
|
|
|
TPushProperty vProp(this, dc);
|
|
if (m_idLayerLoad.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerLoad);
|
|
}
|
|
|
|
TStruLoad loadData;
|
|
double dTextDisL,dTextDisR, dTextDisT, dTextDisB, dTextDis;// 四个方向文字距离
|
|
dTextDisL = dTextDisT = (-250+DocGetLoadTextHeight());
|
|
dTextDisR = dTextDisB = (250-DocGetLoadTextHeight());
|
|
dTextDis = 300;
|
|
|
|
for(int i = 0; i < nSize; i++)
|
|
{
|
|
loadData = vecLoad[i];
|
|
if(nFlag2d3d == 2)
|
|
{
|
|
// 获得柱子的插入点
|
|
AcGePoint3d ptInsert;
|
|
ptInsert = GetLocation();
|
|
XPoint ptLoadS, ptLoadE; // 荷载图像的起始和终止点
|
|
double dLoadLen = 200; // 荷载图像长度
|
|
double dWidth, dHeight; // 柱子截面宽和高
|
|
|
|
TSectionShape nShape = GetSectionShape();
|
|
if(nShape == kRect) // 矩形
|
|
{
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_B, dWidth);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_H, dHeight);
|
|
}
|
|
else if(nShape == kIBeam)
|
|
{
|
|
double dU = 0.0, dB = 0.0, dD = 0.0, dF = 0.0;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_H,dHeight);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_B,dB);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_U,dU);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_D,dD);
|
|
|
|
if(dB - dU > _DIST_SNAP)
|
|
{
|
|
if(dB - dD > _DIST_SNAP)
|
|
{
|
|
dWidth = dB;
|
|
}
|
|
else
|
|
{
|
|
dWidth = dD;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(dU - dD > _DIST_SNAP)
|
|
{
|
|
dWidth = dU;
|
|
}
|
|
else
|
|
{
|
|
dWidth = dD;
|
|
}
|
|
}
|
|
}
|
|
else if(nShape == kCircle)
|
|
{
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_B, dWidth);
|
|
dHeight = dWidth;
|
|
}
|
|
|
|
int nKind = loadData.GetLoadKind();
|
|
double dLoadValue = loadData.GetValue();
|
|
double dArrow; // 箭头方向,文字距离
|
|
if(nKind == TStruLoad::LK_UNVARYING || nKind == TStruLoad::LK_VARYING)// x向作用
|
|
{
|
|
if(dLoadValue > _DIST_SNAP)
|
|
{
|
|
ptLoadS = XPoint(ptInsert.x - dWidth/2 - dLoadLen, ptInsert.y, 0.0);
|
|
ptLoadE = XPoint(ptInsert.x - dWidth/2, ptInsert.y, 0.0);
|
|
dArrow = -30;
|
|
dTextDisL -= DocGetLoadTextHeight();
|
|
dTextDis = dTextDisL;
|
|
}
|
|
else
|
|
{
|
|
ptLoadS = XPoint(ptInsert.x + dWidth/2 + dLoadLen, ptInsert.y, 0.0);
|
|
ptLoadE = XPoint(ptInsert.x + dWidth/2, ptInsert.y, 0.0);
|
|
dArrow = 30;
|
|
dTextDisR += DocGetLoadTextHeight();
|
|
dTextDis = dTextDisR;
|
|
}
|
|
}
|
|
else // y向作用
|
|
{
|
|
if(dLoadValue > _DIST_SNAP)
|
|
{
|
|
ptLoadS = XPoint(ptInsert.x, ptInsert.y - dHeight/2 - dLoadLen, 0.0);
|
|
ptLoadE = XPoint(ptInsert.x, ptInsert.y - dHeight/2, 0.0);
|
|
dArrow = -30;
|
|
dTextDisB -= DocGetLoadTextHeight();
|
|
dTextDis = dTextDisB;
|
|
}
|
|
else
|
|
{
|
|
ptLoadS = XPoint(ptInsert.x, ptInsert.y + dHeight/2 + dLoadLen, 0.0);
|
|
ptLoadE = XPoint(ptInsert.x, ptInsert.y + dHeight/2, 0.0);
|
|
dArrow = +30;
|
|
dTextDisT += DocGetLoadTextHeight();
|
|
dTextDis = dTextDisT;
|
|
}
|
|
}
|
|
|
|
if(bShowGraphic)
|
|
{
|
|
DrawColuLoad2d(dc, loadData, ptLoadS, ptLoadE, dArrow);
|
|
}
|
|
|
|
if (((loadData.GetLoadKind() == TStruLoad::LK_VARYING
|
|
||loadData.GetLoadKind() == TStruLoad::LK_VARYINGY) && bShowLive) //活荷
|
|
||((loadData.GetLoadKind() == TStruLoad::LK_UNVARYING
|
|
||loadData.GetLoadKind() == TStruLoad::LK_UNVARYINGY) && bShowUnLive) //恒荷
|
|
)
|
|
{
|
|
DrawLoadText2d(dc, loadData, ptLoadS, dTextDis);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(bShowGraphic)
|
|
{
|
|
DrawColuLoad3d(dc, loadData);
|
|
}
|
|
|
|
if (((loadData.GetLoadKind() == TStruLoad::LK_VARYING
|
|
||loadData.GetLoadKind() == TStruLoad::LK_VARYINGY)&&bShowLive) //活荷
|
|
||((loadData.GetLoadKind() == TStruLoad::LK_UNVARYING
|
|
||loadData.GetLoadKind() == TStruLoad::LK_UNVARYINGY)&&bShowUnLive) //恒荷
|
|
)
|
|
{
|
|
DrawLoadText3d(dc, loadData, dTextDis);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// add by wjx on 111222
|
|
// 功能:绘制2d荷载
|
|
// [in]:loadData:荷载信息
|
|
void TDbColumn::DrawColuLoad2d(TGGiExplodeDrawBase &dc, TStruLoad loadData,
|
|
XPoint ptLoadS, XPoint ptLoadE, double dArrow)const
|
|
{
|
|
// 获得柱子的插入点
|
|
AcGePoint3d ptInsert = GetLocation();
|
|
|
|
TSectionShape nShape = GetSectionShape();
|
|
|
|
int nKind = loadData.GetLoadKind();
|
|
|
|
double dLineWidth = 100;// 线粗
|
|
ads_matrix matRot;
|
|
if(nShape != kCircle)
|
|
{
|
|
// 得到柱子的转角
|
|
double dAngle;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_AXANG, dAngle);
|
|
XPoint(ptInsert).GetRotationMatrix(dAngle, matRot);
|
|
}
|
|
|
|
int nType = loadData.GetLoadType();
|
|
AcDbPolyline polyLine, line;
|
|
polyLine.setColorIndex(1);
|
|
line.setColorIndex(1);
|
|
|
|
// nType += 9;
|
|
switch (nType)
|
|
{
|
|
case TStruLoad::LT_FOCUS_V:
|
|
if(nShape != kCircle)
|
|
{
|
|
ptLoadS.TransformBy(matRot);
|
|
ptLoadE.TransformBy(matRot);
|
|
}
|
|
|
|
polyLine.addVertexAt(0, XPoint(ptLoadS.x, ptLoadS.y+10, 0), PI, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(1, XPoint(ptLoadS.x, ptLoadS.y-10, 0), 0.3, dLineWidth, dLineWidth);
|
|
polyLine.setClosed(Adesk::kTrue);
|
|
dc.DrawEntity(polyLine);
|
|
|
|
dLineWidth = 10;
|
|
line.addVertexAt(0, ptLoadS, 0, dLineWidth, dLineWidth);
|
|
line.addVertexAt(1, ptLoadE, 0, dLineWidth, dLineWidth);
|
|
dc.DrawEntity(line);
|
|
break;
|
|
case TStruLoad::LT_ALL_V:
|
|
if(nShape != kCircle)
|
|
{
|
|
ptLoadS.TransformBy(matRot);
|
|
ptLoadE.TransformBy(matRot);
|
|
}
|
|
|
|
dLineWidth = 20;
|
|
polyLine.addVertexAt(0, ptLoadS, 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(1, ptLoadE, 0, dLineWidth, dLineWidth);
|
|
dc.DrawEntity(polyLine);
|
|
break;
|
|
case TStruLoad::LT_FOLD_V:
|
|
dLineWidth = 20;
|
|
if(nKind == TStruLoad::LK_UNVARYING || nKind == TStruLoad::LK_VARYING)
|
|
{
|
|
polyLine.addVertexAt(0, XPoint(ptLoadS.x, ptLoadS.y+50, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(1, XPoint(ptLoadS.x, ptLoadS.y-50, 0), 0, dLineWidth, dLineWidth);
|
|
}
|
|
else
|
|
{
|
|
polyLine.addVertexAt(0, XPoint(ptLoadS.x+50, ptLoadS.y, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(1, XPoint(ptLoadS.x-50, ptLoadS.y, 0), 0, dLineWidth, dLineWidth);
|
|
}
|
|
|
|
polyLine.addVertexAt(2, ptLoadS, 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(3, ptLoadE, 0, dLineWidth, dLineWidth);
|
|
polyLine.transformBy(AsAcGeMatrix3d(matRot));
|
|
dc.DrawEntity(polyLine);
|
|
break;
|
|
case TStruLoad::LT_FOCUS_H:
|
|
dLineWidth = 10;
|
|
if(nKind == TStruLoad::LK_UNVARYING || nKind == TStruLoad::LK_VARYING)
|
|
{
|
|
polyLine.addVertexAt(0, XPoint(ptLoadE.x+dArrow, ptLoadE.y+50, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(1, ptLoadE, 0, 10, 10);
|
|
polyLine.addVertexAt(2, XPoint(ptLoadE.x+dArrow, ptLoadE.y-50, 0), 0, dLineWidth, dLineWidth);
|
|
}
|
|
else
|
|
{
|
|
polyLine.addVertexAt(0, XPoint(ptLoadE.x+50, ptLoadE.y+dArrow, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(1, ptLoadE, 0, 10, 10);
|
|
polyLine.addVertexAt(2, XPoint(ptLoadE.x-50, ptLoadE.y+dArrow, 0), 0, dLineWidth, dLineWidth);
|
|
}
|
|
polyLine.addVertexAt(3, ptLoadE, 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(4, ptLoadS, 0, dLineWidth, dLineWidth);
|
|
polyLine.transformBy(AsAcGeMatrix3d(matRot));
|
|
dc.DrawEntity(polyLine);
|
|
break;
|
|
case TStruLoad::LT_MOMENT_V:
|
|
dLineWidth= 20;
|
|
if(nKind == TStruLoad::LK_UNVARYING || nKind == TStruLoad::LK_VARYING)
|
|
{
|
|
polyLine.addVertexAt(0, XPoint(ptLoadE.x+dArrow, ptLoadE.y, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(1, XPoint(ptLoadE.x+dArrow, ptLoadE.y+40, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(2, ptLoadE, 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(3, XPoint(ptLoadE.x+dArrow, ptLoadE.y-40, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(4, XPoint(ptLoadE.x+dArrow, ptLoadE.y, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(5, XPoint(ptLoadE.x+dArrow*2, ptLoadE.y, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(6, XPoint(ptLoadE.x+dArrow*3, ptLoadE.y+40, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(7, XPoint(ptLoadE.x+dArrow*3, ptLoadE.y-40, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(8, XPoint(ptLoadE.x+dArrow*2, ptLoadE.y, 0), 0, 10, 10);
|
|
}
|
|
else
|
|
{
|
|
polyLine.addVertexAt(0, XPoint(ptLoadE.x, ptLoadE.y+dArrow, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(1, XPoint(ptLoadE.x+40, ptLoadE.y+dArrow, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(2, ptLoadE, 0, 30, 30);
|
|
polyLine.addVertexAt(3, XPoint(ptLoadE.x-40, ptLoadE.y+dArrow, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(4, XPoint(ptLoadE.x, ptLoadE.y+dArrow, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(5, XPoint(ptLoadE.x, ptLoadE.y+dArrow*2, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(6, XPoint(ptLoadE.x+40, ptLoadE.y+dArrow*3, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(7, XPoint(ptLoadE.x-40, ptLoadE.y+dArrow*3, 0), 0, dLineWidth, dLineWidth);
|
|
polyLine.addVertexAt(8, XPoint(ptLoadE.x, ptLoadE.y+dArrow*2, 0), 0, 10, 10);
|
|
}
|
|
polyLine.addVertexAt(9, ptLoadS, 0, 10, 10);
|
|
polyLine.transformBy(AsAcGeMatrix3d(matRot));
|
|
dc.DrawEntity(polyLine);
|
|
break;
|
|
}
|
|
}
|
|
|
|
// 绘制2d荷载文字
|
|
void TDbColumn::DrawLoadText2d(TGGiExplodeDrawBase &dc, TStruLoad loadData,
|
|
XPoint ptInsert, double dTextDis)const
|
|
{
|
|
int nKind = loadData.GetLoadKind(); // 荷载种类
|
|
|
|
TSectionShape nShape = GetSectionShape();
|
|
|
|
ads_matrix matRot;
|
|
// 得到柱子的转角
|
|
double dAngle = 0;
|
|
if(nShape != kCircle)
|
|
{
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_AXANG, dAngle);
|
|
|
|
TADSGePoint3d ptInsertColu = GetLocation();
|
|
ptInsertColu.GetRotationMatrix(dAngle, matRot);
|
|
}
|
|
|
|
// 设置文字
|
|
AcDbText text;
|
|
text.setTextStyle(InitTextStyle(TS_STANDARD));
|
|
text.setHeight(DocGetLoadTextHeight());// 设置文字高度
|
|
|
|
// 生成要显示的荷载文字
|
|
int nType = loadData.GetLoadType(); // 荷载类型
|
|
|
|
CString strLoadInfo;
|
|
switch (nType)
|
|
{
|
|
case TStruLoad::LT_FOCUS_V:
|
|
strLoadInfo.Format(_T("%d*%s*%s*%s"), nType, TrimDoubleZero(loadData.GetValue()),
|
|
TrimDoubleZero(loadData.GetPara1()), TrimDoubleZero(loadData.GetPara2()));
|
|
break;
|
|
case TStruLoad::LT_ALL_V:
|
|
strLoadInfo.Format(_T("%d*%s"), nType,TrimDoubleZero(loadData.GetValue()));
|
|
break;
|
|
case TStruLoad::LT_FOLD_V:
|
|
strLoadInfo.Format(_T("%d*%s*%s*%s*%s"), nType,TrimDoubleZero(loadData.GetValue()),
|
|
TrimDoubleZero(loadData.GetPara1()), TrimDoubleZero(loadData.GetPara2()),
|
|
TrimDoubleZero(loadData.GetPara3()));
|
|
break;
|
|
case TStruLoad::LT_FOCUS_H:
|
|
case TStruLoad::LT_MOMENT_V:
|
|
strLoadInfo.Format(_T("%d*%s*%s"), nType, TrimDoubleZero(loadData.GetValue()),
|
|
TrimDoubleZero(loadData.GetPara1()));
|
|
break;
|
|
}
|
|
|
|
text.setTextString(strLoadInfo);
|
|
|
|
TPushProperty vProp(this, dc);
|
|
if(nKind == TStruLoad::LK_UNVARYING || nKind == TStruLoad::LK_UNVARYINGY)
|
|
{
|
|
if (m_idLayerLoadC.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerLoadC);
|
|
text.setLayer(m_idLayerLoadC);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (m_idLayerLoadL.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerLoadL);
|
|
text.setLayer(m_idLayerLoadL);
|
|
}
|
|
}
|
|
|
|
if(nKind == TStruLoad::LK_UNVARYING || nKind == TStruLoad::LK_VARYING)
|
|
{
|
|
dAngle += PI/2;
|
|
ptInsert.x += dTextDis;
|
|
}
|
|
else
|
|
{
|
|
ptInsert.y += dTextDis;
|
|
}
|
|
|
|
if(nShape != kCircle)
|
|
{
|
|
ptInsert.TransformBy(matRot);
|
|
}
|
|
|
|
text.setPosition(ptInsert);
|
|
text.setRotation(dAngle);
|
|
text.setHorizontalMode(AcDb::kTextCenter); // 设置文字的对齐方式
|
|
text.setAlignmentPoint(ptInsert);
|
|
|
|
dc.DrawEntity(text);
|
|
}
|
|
|
|
// add by wjx on 111222
|
|
// 功能:绘制3d荷载
|
|
// [in]:loadData:荷载信息
|
|
void TDbColumn::DrawColuLoad3d(TGGiExplodeDrawBase &dc, TStruLoad loadData)const
|
|
{
|
|
AcGePoint3d ptI = GetLocation(), ptJ = GetLocation();
|
|
ptJ.z = ptI.z + GetHeight();
|
|
|
|
double dZ = GetHeight();
|
|
XPoint ptMid = XPoint(ptI.x, ptI.y, ptI.z + dZ/2);
|
|
XPoint ptH = XPoint(ptI.x, ptI.y, ptI.z + loadData.GetPara1()*1000);
|
|
TGGeCurveSegment seg, segCenter;
|
|
|
|
// 生成要显示的荷载文字
|
|
int nType = loadData.GetLoadType(); // 荷载类型
|
|
// nType += 9;
|
|
|
|
double dDis = 300, dDisZ;
|
|
CString strLoadInfo;
|
|
|
|
double dLenTemp = 100;
|
|
int nColor = dc.GetColor();
|
|
dc.SetColor(1);
|
|
|
|
int i = 0;
|
|
switch (nType)
|
|
{
|
|
case TStruLoad::LT_FOCUS_V:
|
|
seg = TGGeCurveSegment(ptMid, XPoint(ptMid.x+dDis, ptMid.y, ptMid.z), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
seg = TGGeCurveSegment(XPoint(ptMid.x+dDis, ptMid.y, ptMid.z), XPoint(ptMid.x+dDis, ptMid.y, ptH.z), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
seg = TGGeCurveSegment(XPoint(ptJ.x+dDis, ptJ.y, ptJ.z), XPoint(ptMid.x+dDis, ptMid.y, ptH.z+dLenTemp), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
seg = TGGeCurveSegment(XPoint(ptMid.x+dDis, ptMid.y, ptH.z+dLenTemp), XPoint(ptMid.x+dDis+dLenTemp, ptMid.y+dLenTemp, ptH.z+dLenTemp*2), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
seg = TGGeCurveSegment(XPoint(ptMid.x+dDis, ptMid.y, ptH.z+dLenTemp), XPoint(ptMid.x+dDis-dLenTemp, ptMid.y-dLenTemp, ptH.z+dLenTemp*2), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
break;
|
|
case TStruLoad::LT_ALL_V:
|
|
segCenter = TGGeCurveSegment(ptI, ptJ, 0);
|
|
seg = TGGeCurveSegment(XPoint(ptI.x+dDis, ptMid.y, ptI.z), XPoint(ptJ.x+dDis, ptJ.y, ptJ.z), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
dDisZ = seg.GetLength()/5;
|
|
for (; i <= 5; i++)
|
|
{
|
|
segCenter.ProjectToMe(XPoint(ptI.x+dDis, ptI.y, ptI.z+i*dDisZ), ptMid);
|
|
seg = TGGeCurveSegment(XPoint(ptI.x+dDis, ptI.y, ptI.z+i*dDisZ), ptMid, 0);
|
|
dc.DrawCurve(seg);
|
|
}
|
|
break;
|
|
case TStruLoad::LT_FOLD_V:
|
|
segCenter = TGGeCurveSegment(XPoint(ptI.x+dDis/2, ptI.y, ptI.z+loadData.GetPara2()*1000), XPoint(ptJ.x+dDis, ptJ.y, ptI.z+(loadData.GetPara2()+loadData.GetPara3())*1000), 0);
|
|
// seg = TGGeCurveSegment(XPoint(ptI.x+dDis/2, ptI.y, ptI.z+dZ/4), XPoint(ptJ.x+dDis, ptJ.y, ptJ.z-dZ/4), 0);
|
|
dc.DrawCurve(segCenter);
|
|
|
|
dDisZ = segCenter.GetLength()/5;
|
|
for (; i <= 5; i++)
|
|
{
|
|
segCenter.ProjectToMe(XPoint(ptI.x, ptI.y, ptI.z+loadData.GetPara2()*1000+i*dDisZ), ptMid);
|
|
seg = TGGeCurveSegment(XPoint(ptI.x, ptI.y, ptI.z+loadData.GetPara2()*1000+i*dDisZ), ptMid, 0);
|
|
dc.DrawCurve(seg);
|
|
}
|
|
break;
|
|
case TStruLoad::LT_FOCUS_H:
|
|
seg = TGGeCurveSegment(ptH, XPoint(ptH.x, ptH.y+dDis,ptH.z), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
seg = TGGeCurveSegment(ptH, XPoint(ptH.x+dLenTemp, ptH.y+dDis/2-dLenTemp,ptH.z), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
seg = TGGeCurveSegment(ptH, XPoint(ptH.x-dLenTemp, ptH.y+dDis/2-dLenTemp,ptH.z), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
break;
|
|
case TStruLoad::LT_MOMENT_V:
|
|
seg = TGGeCurveSegment(XPoint(ptH.x, ptH.y-dDis/2,ptH.z), XPoint(ptH.x, ptH.y+dDis/2,ptH.z), -PI*5/4);
|
|
dc.DrawCurve(seg);
|
|
|
|
seg = TGGeCurveSegment(XPoint(ptH.x, ptH.y+dDis/2,ptH.z), XPoint(ptH.x-dLenTemp, ptH.y+dDis/2+dLenTemp,ptH.z), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
seg = TGGeCurveSegment(XPoint(ptH.x, ptH.y+dDis/2,ptH.z), XPoint(ptH.x-dLenTemp, ptH.y+dDis/2-dLenTemp,ptH.z), 0);
|
|
dc.DrawCurve(seg);
|
|
|
|
break;
|
|
}
|
|
|
|
dc.SetColor(nColor);
|
|
}
|
|
|
|
// 绘制3d荷载文字
|
|
void TDbColumn::DrawLoadText3d(TGGiExplodeDrawBase &dc, TStruLoad loadData, double &dDis)const
|
|
{
|
|
int nKind = loadData.GetLoadKind(); // 荷载种类
|
|
|
|
// 设置文字
|
|
AcDbText text;
|
|
text.setTextStyle(InitTextStyle(TS_STANDARD));
|
|
text.setHeight(DocGetLoadTextHeight());// 设置文字高度
|
|
|
|
// 得到柱子的中心点
|
|
AcGePoint3d ptI = GetLocation();
|
|
double dZ = GetHeight()/2;
|
|
XPoint ptMid(ptI.x, ptI.y, ptI.z+dZ);
|
|
|
|
// 生成要显示的荷载文字
|
|
int nType = loadData.GetLoadType(); // 荷载类型
|
|
// nType += 9;
|
|
|
|
CString strLoadInfo;
|
|
switch (nType)
|
|
{
|
|
case TStruLoad::LT_FOCUS_V:
|
|
strLoadInfo.Format(_T("%d*%s*%s*%s"), nType, TrimDoubleZero(loadData.GetValue()),
|
|
TrimDoubleZero(loadData.GetPara1()), TrimDoubleZero(loadData.GetPara2()));
|
|
break;
|
|
case TStruLoad::LT_ALL_V:
|
|
strLoadInfo.Format(_T("%d*%s"), nType,TrimDoubleZero(loadData.GetValue()));
|
|
break;
|
|
case TStruLoad::LT_FOLD_V:
|
|
strLoadInfo.Format(_T("%d*%s*%s*%s*%s"), nType,TrimDoubleZero(loadData.GetValue()),
|
|
TrimDoubleZero(loadData.GetPara1()), TrimDoubleZero(loadData.GetPara2()),
|
|
TrimDoubleZero(loadData.GetPara3()));
|
|
break;
|
|
case TStruLoad::LT_FOCUS_H:
|
|
case TStruLoad::LT_MOMENT_V:
|
|
strLoadInfo.Format(_T("%d*%s*%s"), nType, TrimDoubleZero(loadData.GetValue()),
|
|
TrimDoubleZero(loadData.GetPara1()));
|
|
break;
|
|
}
|
|
|
|
text.setTextString(strLoadInfo);
|
|
|
|
TPushProperty vProp(this, dc);
|
|
if(nKind == TStruLoad::LK_UNVARYING || nKind == TStruLoad::LK_UNVARYINGY)
|
|
{
|
|
if (m_idLayerLoadC.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerLoadC);
|
|
text.setLayer(m_idLayerLoadC);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (m_idLayerLoadL.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerLoadL);
|
|
text.setLayer(m_idLayerLoadL);
|
|
}
|
|
}
|
|
|
|
text.setRotation(PI/2);
|
|
|
|
// 设置文字法向
|
|
if(_tcscmp(dc.Desc(), TGGiWorldViewportDraw::Descriptor())==0)
|
|
{
|
|
AcGiViewport &vp = ((TGGiWorldViewportDraw&)dc).m_pVd->viewport();
|
|
|
|
AcGePoint3d ptCamera, ptTarget;
|
|
vp.getCameraTarget(ptTarget);
|
|
vp.getCameraLocation(ptCamera);
|
|
|
|
AcGeVector3d vtViewDrt = ptCamera-ptTarget;
|
|
AcGeVector3d vtViewDir1= vp.viewDir();
|
|
|
|
AcGeVector3d vtCamera;
|
|
vp.getCameraUpVector(vtCamera);
|
|
|
|
vtViewDrt.normalize();
|
|
|
|
text.setNormal(vtViewDrt);
|
|
}
|
|
|
|
text.setPosition(XPoint(ptMid.x, ptMid.y+dDis, ptMid.z));
|
|
dc.DrawEntity(text);
|
|
|
|
dDis += DocGetLoadTextHeight();
|
|
}
|
|
|
|
//铰接属性
|
|
//返回值 0:普通柱,1:上端铰柱,2:下端铰柱,3:两端铰柱
|
|
int TDbColumn::GetHinge()const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
int nHinge(0);
|
|
if(GetSpecialtyDataReadOnly()->GetAt(KEY_HINGE, nHinge))
|
|
{
|
|
BOOL bTop = ((nHinge & HINGE_START) != 0);
|
|
BOOL bDown = ((nHinge & HINGE_END) != 0);
|
|
|
|
if (bTop && bDown)
|
|
{
|
|
return 3; //两端铰柱
|
|
}
|
|
else if (bTop)
|
|
{
|
|
return 1; //上端铰柱
|
|
}
|
|
else if(bDown)
|
|
{
|
|
return 2; //下端铰柱
|
|
}
|
|
}
|
|
return 0; //普通柱
|
|
}
|
|
|
|
// add by wjx 0n 111230
|
|
// 特殊柱填充
|
|
void TDbColumn::SepColuHach(TGGiExplodeDrawBase &dc)const
|
|
{
|
|
// 设置文字
|
|
double dTextHeight = 200;
|
|
AcDbText text;
|
|
text.setHeight(dTextHeight);// 设置文字高度
|
|
|
|
TADSGePoint3d ptLow, ptUp;
|
|
//GetExtents2d(ptLow, ptUp); // 获得柱子轮廓的最高点和最底点
|
|
m_polyOutline.GetExtend(ptLow, ptUp);
|
|
ptLow.z = 0.0;
|
|
ptUp.z = 0.0;
|
|
|
|
// 求柱子外围轮廓的宽和高
|
|
double dHeight, dWidth;
|
|
dHeight = fabs(ptUp.y - ptLow.y);
|
|
dWidth = fabs(ptUp.x - ptLow.x);
|
|
|
|
AcGePoint3d ptIns = GetLocation();
|
|
|
|
int nKind = kColu;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_KIND, nKind);
|
|
text.setPosition(XPoint(ptIns.x+dWidth/2, ptIns.y-dHeight/2, 0));
|
|
|
|
if(nKind == kConerColu) // 角柱
|
|
{
|
|
text.setTextString(_T("JZ"));
|
|
text.setColorIndex(CORCOLUCOLOR);//紫色
|
|
dc.DrawEntity(text);
|
|
}
|
|
else if(nKind == kTransColu) // 转换柱
|
|
{
|
|
text.setTextString(_T("ZHZ"));
|
|
text.setColorIndex(TCOLUCOLOR); //白色
|
|
dc.DrawEntity(text);
|
|
}
|
|
else if(nKind == kTransConColu) // 角柱和转换柱
|
|
{
|
|
text.setTextString(_T("JZ"));
|
|
text.setColorIndex(CORCOLUCOLOR);//紫色
|
|
dc.DrawEntity(text);
|
|
|
|
text.setTextString(_T("ZHZ"));
|
|
text.setColorIndex(TCOLUCOLOR); //白色
|
|
text.setPosition(XPoint(ptIns.x+dWidth/2, ptIns.y-dHeight/2+dTextHeight, 0));
|
|
dc.DrawEntity(text);
|
|
}
|
|
}
|
|
|
|
void TDbColumn::SetHinge(BOOL bTop, BOOL bTrue)
|
|
{
|
|
assertReadEnabled();
|
|
int nHingeNum(0);
|
|
int nHinge(0);
|
|
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_HINGE, nHinge);
|
|
if(bTop)
|
|
{
|
|
if(bTrue)
|
|
{
|
|
nHinge |= HINGE_START;
|
|
}
|
|
else
|
|
{
|
|
nHinge &= ~HINGE_START;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(bTrue)
|
|
{
|
|
nHinge |= HINGE_END;
|
|
}
|
|
else
|
|
{
|
|
nHinge &= ~HINGE_END;
|
|
}
|
|
}
|
|
GetSpecialtyData()->SetAt(KEY_HINGE, nHinge);
|
|
}
|
|
|
|
//add by xlc on 120118
|
|
//设置荷载数组
|
|
bool TDbColumn::SetLoadsArray(const std::vector<TStruLoad>& vectLoads)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearLoadsArray();
|
|
return SetAt(KEY_COLU, vectLoads);
|
|
}
|
|
//获得荷载数组
|
|
bool TDbColumn::GetLoadsArray(std::vector<TStruLoad>& vectLoads)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_COLU, vectLoads);
|
|
}
|
|
//清除荷载数组
|
|
void TDbColumn::ClearLoadsArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveLoadsKey(KEY_COLU);
|
|
}
|
|
|
|
// add by wjx on 120329 轴力包络图
|
|
// 数组中的顺序是工况, 轴力, 弯距x, 弯矩y, 剪力x, 剪力y
|
|
bool TDbColumn::SetNGraArray(const std::vector<TCombForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearNGraArray();
|
|
return SetAt(KEY_NGRA, vecData);
|
|
}
|
|
|
|
//获得轴力包络图数组
|
|
bool TDbColumn::GetNGraArray(std::vector<TCombForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_NGRA, vecData);
|
|
}
|
|
|
|
//清除轴力包络图数组
|
|
void TDbColumn::ClearNGraArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveNGraKey(KEY_NGRA);
|
|
}
|
|
|
|
// add by wjx on 120329 绘制轴力图
|
|
void TDbColumn::DrawNGraph(TGGiExplodeDrawBase &dc)const
|
|
{
|
|
std::vector<TCombForceData> vecData;
|
|
|
|
TPushProperty vProp(this, dc);
|
|
if (m_idLayerForce.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerForce);
|
|
}
|
|
|
|
if(GetNGraArray(vecData)) // 得到轴力数据
|
|
{
|
|
AcGePoint3d ptInsert, ptText;
|
|
ptInsert = GetLocation(); // 得到柱子的插入位置
|
|
|
|
double dPaperScale = GetPScale();
|
|
// 得到轴力文字总的高度
|
|
double dTotalHeight = g_dNGrapTextH * dPaperScale * 5;
|
|
|
|
// 计算文字的起始位置
|
|
ptText = ptInsert;
|
|
ptText.y = ptInsert.y + dTotalHeight/3;
|
|
|
|
// 计算文字与柱子的距离
|
|
double dTextWidth = 10*dPaperScale;
|
|
XPoint ptUp, ptLow;
|
|
// GetExtents2d(ptLow, ptUp);
|
|
m_polyOutline.GetExtend(ptLow, ptUp);
|
|
ptLow.z = 0.0;
|
|
ptUp.z = 0.0;
|
|
|
|
double dDis = fabs(ptUp.x - ptLow.x);
|
|
dDis = dDis/2 + dTextWidth;
|
|
ptText.x = ptInsert.x - dDis;
|
|
|
|
AcDbText text;
|
|
text.setTextStyle(InitTextStyle(TS_STANDARD));
|
|
text.setHeight(g_dNGrapTextH*dPaperScale);// 设置文字高度
|
|
int nColor = 2;
|
|
text.setColorIndex(nColor);
|
|
|
|
CString strText;
|
|
int nSize = vecData.size();
|
|
for(int i = 1; i < nSize; i++)
|
|
{
|
|
strText.Format(_T("%.3f"), vecData[i].m_dForce);
|
|
text.setTextString(strText);
|
|
text.setPosition(XPoint(ptText.x, ptText.y-g_dNGrapTextH*(i-1) * dPaperScale, 0));
|
|
dc.DrawEntity(text);
|
|
}
|
|
}
|
|
}
|
|
|
|
//底层墙柱内力图
|
|
void TDbColumn::DrawWallColu(TGGiExplodeDrawBase &dc)const
|
|
{
|
|
TPushProperty vProp(this, dc);
|
|
if (m_idLayerForce.isValid())
|
|
{
|
|
dc.SetLayer(m_idLayerForce);
|
|
}
|
|
|
|
std::vector<TCombForceData> vecData;
|
|
switch (g_nColuForce)
|
|
{
|
|
case eVXMax: //X向最大剪力
|
|
GetVXMaxArray(vecData);
|
|
break;
|
|
case eVYMax: //Y向最大剪力
|
|
GetVYMaxArray(vecData);
|
|
break;
|
|
case eNMax: //最大轴力
|
|
GetNMaxArray(vecData);
|
|
break;
|
|
case eNMin: //最小轴力
|
|
GetNMinArray(vecData);
|
|
break;
|
|
case eMXMax: //X向最大弯矩
|
|
GetMXMaxArray(vecData);
|
|
break;
|
|
case eMYMax: //Y向最大弯矩
|
|
GetMYMaxArray(vecData);
|
|
break;
|
|
default :
|
|
break;
|
|
}
|
|
if(vecData.size() > 0) // 得到内力数据
|
|
{
|
|
AcGePoint3d ptInsert, ptText;
|
|
ptInsert = GetLocation(); // 得到柱子的插入位置
|
|
|
|
double dPaperScale = GetPScale();
|
|
// 得到内力文字总的高度
|
|
double dTotalHeight = g_dNGrapTextH * dPaperScale * 5;
|
|
|
|
// 计算文字的起始位置
|
|
ptText = ptInsert;
|
|
ptText.y = ptInsert.y + dTotalHeight/3;
|
|
|
|
// 计算文字与柱子的距离
|
|
double dTextWidth = 10*dPaperScale;
|
|
XPoint ptUp, ptLow;
|
|
// GetExtents2d(ptLow, ptUp);
|
|
m_polyOutline.GetExtend(ptLow, ptUp);
|
|
ptLow.z = 0.0;
|
|
ptUp.z = 0.0;
|
|
|
|
double dDis = fabs(ptUp.x - ptLow.x);
|
|
dDis = dDis/2 + dTextWidth;
|
|
ptText.x = ptInsert.x - dDis;
|
|
|
|
AcDbText text;
|
|
text.setTextStyle(InitTextStyle(TS_STANDARD));
|
|
text.setHeight(g_dNGrapTextH*dPaperScale);// 设置文字高度
|
|
int nColor = 2;
|
|
text.setColorIndex(nColor);
|
|
|
|
CString strText;
|
|
int nSize = vecData.size();
|
|
for(int i = 1; i < nSize; i++)
|
|
{
|
|
strText.Format(_T("%.3f"), vecData[i].m_dForce);
|
|
text.setTextString(strText);
|
|
text.setPosition(XPoint(ptText.x, ptText.y-g_dNGrapTextH*(i-1) * dPaperScale, 0));
|
|
dc.DrawEntity(text);
|
|
}
|
|
}
|
|
}
|
|
|
|
//柱填充图层
|
|
AcDbObjectId TDbColumn::GetLayerHatch() const
|
|
{
|
|
return m_idLayerHatch;
|
|
}
|
|
void TDbColumn::SetLayerHatch(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerHatch = idLayer;
|
|
}
|
|
|
|
//柱尺寸图层
|
|
AcDbObjectId TDbColumn::GetLayerDim() const
|
|
{
|
|
return m_idLayerDim;
|
|
}
|
|
void TDbColumn::SetLayerDim(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerDim = idLayer;
|
|
}
|
|
|
|
//柱编号图层
|
|
AcDbObjectId TDbColumn::GetLayerNum() const
|
|
{
|
|
return m_idLayerNum;
|
|
}
|
|
void TDbColumn::SetLayerNum(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerNum = idLayer;
|
|
}
|
|
|
|
//柱标注图层
|
|
AcDbObjectId TDbColumn::GetLayerMark() const
|
|
{
|
|
return m_idLayerMark;
|
|
}
|
|
void TDbColumn::SetLayerMark(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerMark = idLayer;
|
|
}
|
|
|
|
//柱截面注写图层
|
|
AcDbObjectId TDbColumn::GetLayerSect() const
|
|
{
|
|
return m_idLayerSect;
|
|
}
|
|
void TDbColumn::SetLayerSect(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerSect = idLayer;
|
|
}
|
|
|
|
//柱表注写图层
|
|
AcDbObjectId TDbColumn::GetLayerTbl() const
|
|
{
|
|
return m_idLayerTbl;
|
|
}
|
|
void TDbColumn::SetLayerTbl(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerTbl = idLayer;
|
|
}
|
|
|
|
//柱平法纵筋图层
|
|
AcDbObjectId TDbColumn::GetLayerRBarV() const
|
|
{
|
|
return m_idLayerRBarV;
|
|
}
|
|
void TDbColumn::SetLayerRBarV(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerRBarV = idLayer;
|
|
}
|
|
|
|
//柱平法箍筋图层
|
|
AcDbObjectId TDbColumn::GetLayerRBarR() const
|
|
{
|
|
return m_idLayerRBarR;
|
|
}
|
|
void TDbColumn::SetLayerRBarR(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerRBarR = idLayer;
|
|
}
|
|
|
|
//柱实配面积图层
|
|
AcDbObjectId TDbColumn::GetLayerRealArea() const
|
|
{
|
|
return m_idLayerRealArea;
|
|
}
|
|
void TDbColumn::SetLayerRealArea(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerRealArea = idLayer;
|
|
}
|
|
|
|
//柱双偏压图层
|
|
AcDbObjectId TDbColumn::GetLayerChkBias() const
|
|
{
|
|
return m_idLayerChkBias;
|
|
}
|
|
void TDbColumn::SetLayerChkBias(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerChkBias = idLayer;
|
|
}
|
|
|
|
//柱轴压比图层
|
|
AcDbObjectId TDbColumn::GetLayerChkRati() const
|
|
{
|
|
return m_idLayerChkRati;
|
|
}
|
|
void TDbColumn::SetLayerChkRati(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerChkRati = idLayer;
|
|
}
|
|
//柱内力结果图层
|
|
AcDbObjectId TDbColumn::GetLayerForce() const
|
|
{
|
|
return m_idLayerForce;
|
|
}
|
|
void TDbColumn::SetLayerForce(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerForce = idLayer;
|
|
}
|
|
|
|
//柱计算配筋图层
|
|
AcDbObjectId TDbColumn::GetLayerCalcArea() const
|
|
{
|
|
return m_idLayerCalcArea;
|
|
}
|
|
void TDbColumn::SetLayerCalcArea(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerCalcArea = idLayer;
|
|
}
|
|
|
|
//柱荷载
|
|
AcDbObjectId TDbColumn::GetLayerLoad() const
|
|
{
|
|
return m_idLayerLoad;
|
|
}
|
|
void TDbColumn::SetLayerLoad(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerLoad = idLayer;
|
|
}
|
|
|
|
//柱活荷值
|
|
AcDbObjectId TDbColumn::GetLayerLoadL() const
|
|
{
|
|
return m_idLayerLoadL;
|
|
}
|
|
void TDbColumn::SetLayerLoadL(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerLoadL = idLayer;
|
|
}
|
|
|
|
//柱恒荷值
|
|
AcDbObjectId TDbColumn::GetLayerLoadC() const
|
|
{
|
|
return m_idLayerLoadC;
|
|
}
|
|
void TDbColumn::SetLayerLoadC(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idLayerLoadC = idLayer;
|
|
}
|
|
|
|
//文字样式
|
|
AcDbObjectId TDbColumn::GetTextStyleRB() const
|
|
{
|
|
return m_idTextStyleRB;
|
|
}
|
|
void TDbColumn::SetTextStyleRB(AcDbObjectId idLayer)
|
|
{
|
|
assertWriteEnabled();
|
|
m_idTextStyleRB = idLayer;
|
|
}
|
|
|
|
//X向最大剪力
|
|
bool TDbColumn::SetVXMaxArray(const std::vector<TCombForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearVXMaxArray();
|
|
return SetAt(KEY_VXMAX, vecData);
|
|
}
|
|
bool TDbColumn::GetVXMaxArray(std::vector<TCombForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_VXMAX, vecData);
|
|
}
|
|
void TDbColumn::ClearVXMaxArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveNGraKey(KEY_VXMAX);
|
|
}
|
|
//Y向最大剪力
|
|
bool TDbColumn::SetVYMaxArray(const std::vector<TCombForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearVYMaxArray();
|
|
return SetAt(KEY_VYMAX, vecData);
|
|
}
|
|
bool TDbColumn::GetVYMaxArray(std::vector<TCombForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_VYMAX, vecData);
|
|
}
|
|
void TDbColumn::ClearVYMaxArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveNGraKey(KEY_VYMAX);
|
|
}
|
|
//最大轴力
|
|
bool TDbColumn::SetNMaxArray(const std::vector<TCombForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearNMaxArray();
|
|
return SetAt(KEY_NMAX, vecData);
|
|
}
|
|
bool TDbColumn::GetNMaxArray(std::vector<TCombForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_NMAX, vecData);
|
|
}
|
|
void TDbColumn::ClearNMaxArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveNGraKey(KEY_NMAX);
|
|
}
|
|
//最小轴力
|
|
bool TDbColumn::SetNMinArray(const std::vector<TCombForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearNMinArray();
|
|
return SetAt(KEY_NMIN, vecData);
|
|
}
|
|
bool TDbColumn::GetNMinArray(std::vector<TCombForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_NMIN, vecData);
|
|
}
|
|
void TDbColumn::ClearNMinArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveNGraKey(KEY_NMIN);
|
|
}
|
|
//X向最大弯矩
|
|
bool TDbColumn::SetMXMaxArray(const std::vector<TCombForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearMXMaxArray();
|
|
return SetAt(KEY_MXMAX, vecData);
|
|
}
|
|
bool TDbColumn::GetMXMaxArray(std::vector<TCombForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_MXMAX, vecData);
|
|
}
|
|
void TDbColumn::ClearMXMaxArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveNGraKey(KEY_MXMAX);
|
|
}
|
|
bool TDbColumn::SetAt(LPCTSTR pszKey,const std::vector<TCombForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
if (pszKey != NULL)
|
|
{
|
|
CString sSubKey;
|
|
int nLength = vecData.size();
|
|
GetSpecialtyData()->SetAt(pszKey, nLength);
|
|
|
|
for (int i = 0;i < nLength; i++)
|
|
{
|
|
sSubKey.Format(_T("%sG%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_iGroup);
|
|
sSubKey.Format(_T("%sV%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_dForce);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool TDbColumn::GetAt(LPCTSTR pszKey,std::vector<TCombForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
vecData.clear();
|
|
|
|
if (pszKey != NULL)
|
|
{
|
|
CString sSubKey;
|
|
int nLength = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(pszKey, nLength);
|
|
|
|
double dVal = 0;
|
|
int i = 0,nCombNo;
|
|
while(nLength > 0)
|
|
{
|
|
TCombForceData fcData;
|
|
sSubKey.Format(_T("%sG%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, nCombNo))
|
|
{
|
|
fcData.m_iGroup = nCombNo;
|
|
}
|
|
sSubKey.Format(_T("%sV%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
fcData.m_dForce = dVal;
|
|
}
|
|
vecData.push_back(fcData);
|
|
|
|
i++;
|
|
nLength--;
|
|
}
|
|
}
|
|
|
|
return ((int)vecData.size() > 0);
|
|
}
|
|
void TDbColumn::RemoveNGraKey(LPCTSTR pszKey)
|
|
{
|
|
assertWriteEnabled();
|
|
if (pszKey != NULL)
|
|
{
|
|
CString sSubKey;
|
|
int nLength = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(sSubKey, nLength);
|
|
GetSpecialtyData()->RemoveAt(pszKey);
|
|
|
|
for (int i = 0;i < nLength; i++)
|
|
{
|
|
sSubKey.Format(_T("%sG%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sV%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
}
|
|
}
|
|
}
|
|
|
|
bool TDbColumn::SetAt(LPCTSTR pszKey,const std::vector<TStruLoad>& vectLoads)
|
|
{
|
|
assertWriteEnabled();
|
|
if (pszKey != NULL)
|
|
{
|
|
int nLength = vectLoads.size();
|
|
GetSpecialtyData()->SetAt(pszKey, nLength);
|
|
|
|
CString sSubKey;
|
|
for (int i = 0;i < nLength; i++)
|
|
{
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_ENTTYPE, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetEntType());
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADTYPE, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetLoadType());
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADKIND, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetLoadKind());
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADVAL, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetValue());
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA1, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetPara1());
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA2, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetPara2());
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA3, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetPara3());
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADFORCEX, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetForceX());
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADFORCEY, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vectLoads[i].GetForceY());
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
bool TDbColumn::GetAt(LPCTSTR pszKey,std::vector<TStruLoad>& vectLoads)const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
vectLoads.clear();
|
|
if (pszKey != NULL)
|
|
{
|
|
int nLength = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(pszKey, nLength);
|
|
|
|
CString sSubKey;
|
|
double dVal = 0;
|
|
int nVal = 0;
|
|
|
|
int i = 0;
|
|
while(nLength > 0)
|
|
{
|
|
TStruLoad struLoad;
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_ENTTYPE, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, nVal))
|
|
{
|
|
struLoad.SetEntType(nVal);
|
|
}
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADTYPE, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, nVal))
|
|
{
|
|
struLoad.SetLoadType(nVal);
|
|
}
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADKIND, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, nVal))
|
|
{
|
|
struLoad.SetLoadKind(nVal);
|
|
}
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADVAL, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
struLoad.SetValue(dVal);
|
|
}
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA1, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
struLoad.SetPara1(dVal);
|
|
}
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA2, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
struLoad.SetPara2(dVal);
|
|
}
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA3, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
struLoad.SetPara3(dVal);
|
|
}
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADFORCEX, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
struLoad.SetForceX(dVal);
|
|
}
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADFORCEY, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
struLoad.SetForceY(dVal);
|
|
}
|
|
|
|
vectLoads.push_back(struLoad);
|
|
i++;
|
|
nLength--;
|
|
}
|
|
}
|
|
|
|
return (vectLoads.size() > 0);
|
|
}
|
|
void TDbColumn::RemoveLoadsKey(LPCTSTR pszKey)
|
|
{
|
|
assertWriteEnabled();
|
|
if (pszKey != NULL)
|
|
{
|
|
int nLength = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(pszKey, nLength);
|
|
GetSpecialtyData()->RemoveAt(pszKey);
|
|
|
|
CString sSubKey;
|
|
for (int i = 0;i < nLength; i++)
|
|
{
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_ENTTYPE, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADTYPE, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADKIND, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADVAL, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA1, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA2, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADPARA3, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADFORCEX, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%s%s%d"),pszKey, KEY_LOADFORCEY, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
}
|
|
}
|
|
}
|
|
//Y向最大弯矩
|
|
bool TDbColumn::SetMYMaxArray(const std::vector<TCombForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearMYMaxArray();
|
|
return SetAt(KEY_MYMAX, vecData);
|
|
}
|
|
bool TDbColumn::GetMYMaxArray(std::vector<TCombForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_MYMAX, vecData);
|
|
}
|
|
void TDbColumn::ClearMYMaxArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveNGraKey(KEY_MYMAX);
|
|
}
|
|
|
|
bool TDbColumn::SetForceArray(LPCTSTR pszKey, const std::vector<TCombSectForceData>& vecData)
|
|
{
|
|
int nLength = vecData.size();
|
|
GetSpecialtyData()->SetAt(pszKey, nLength);
|
|
|
|
CString sSubKey;
|
|
for (int i = 0;i < nLength; i++)
|
|
{
|
|
sSubKey.Format(_T("%sC%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_iGroup);
|
|
|
|
sSubKey.Format(_T("%sS%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_secForce.m_nSectID);
|
|
|
|
sSubKey.Format(_T("%sA%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_secForce.m_force.m_dAxisForce);
|
|
|
|
sSubKey.Format(_T("%sSX%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_secForce.m_force.m_dShear12);
|
|
|
|
sSubKey.Format(_T("%sSY%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_secForce.m_force.m_dShear13);
|
|
|
|
sSubKey.Format(_T("%sMX%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_secForce.m_force.m_dMoment12);
|
|
|
|
sSubKey.Format(_T("%sMY%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_secForce.m_force.m_dMoment13);
|
|
|
|
sSubKey.Format(_T("%sN%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_secForce.m_force.m_dTorque);
|
|
}
|
|
return true;
|
|
}
|
|
bool TDbColumn::GetForceArray(LPCTSTR pszKey, std::vector<TCombSectForceData>& vecData)const
|
|
{
|
|
vecData.clear();
|
|
|
|
int nLength = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(pszKey, nLength);
|
|
|
|
CString sSubKey;
|
|
double dVal = 0;
|
|
int nVal = 0;
|
|
|
|
int i = 0;
|
|
while(nLength > 0)
|
|
{
|
|
TCombSectForceData forceData;
|
|
sSubKey.Format(_T("%sC%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, nVal))
|
|
{
|
|
forceData.m_iGroup = nVal;
|
|
}
|
|
|
|
sSubKey.Format(_T("%sS%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, nVal))
|
|
{
|
|
forceData.m_secForce.m_nSectID = nVal;
|
|
}
|
|
|
|
sSubKey.Format(_T("%sA%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
forceData.m_secForce.m_force.m_dAxisForce = dVal;
|
|
}
|
|
|
|
sSubKey.Format(_T("%sSX%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
forceData.m_secForce.m_force.m_dShear12 = dVal;
|
|
}
|
|
|
|
sSubKey.Format(_T("%sSY%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
forceData.m_secForce.m_force.m_dShear13 = dVal;
|
|
}
|
|
|
|
sSubKey.Format(_T("%sMX%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
forceData.m_secForce.m_force.m_dMoment12 = dVal;
|
|
}
|
|
|
|
sSubKey.Format(_T("%sMY%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
forceData.m_secForce.m_force.m_dMoment13 = dVal;
|
|
}
|
|
|
|
sSubKey.Format(_T("%sN%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
forceData.m_secForce.m_force.m_dTorque = dVal;
|
|
}
|
|
|
|
vecData.push_back(forceData);
|
|
i++;
|
|
nLength--;
|
|
}
|
|
return true;
|
|
}
|
|
void TDbColumn::ClearForceArray(LPCTSTR pszKey)
|
|
{
|
|
int nLength = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(pszKey, nLength);
|
|
GetSpecialtyData()->RemoveAt(pszKey);
|
|
|
|
CString sSubKey;
|
|
for (int i = 0;i < nLength; i++)
|
|
{
|
|
sSubKey.Format(_T("%sC%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%sS%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%sA%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%sSX%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%sSY%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%sMX%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%sMY%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
|
|
sSubKey.Format(_T("%sN%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
}
|
|
}
|
|
// 活载标准内力数据
|
|
bool TDbColumn::SetVSForceArray(const std::vector<TCombSectForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
return SetForceArray(KEY_VSFORC, vecData);
|
|
}
|
|
bool TDbColumn::GetVSForceArray(std::vector<TCombSectForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetForceArray(KEY_VSFORC, vecData);
|
|
}
|
|
void TDbColumn::ClearVSForceArray()
|
|
{
|
|
assertWriteEnabled();
|
|
ClearForceArray(KEY_VSFORC);
|
|
}
|
|
// 恒载标准内力数据
|
|
bool TDbColumn::SetSForceArray(const std::vector<TCombSectForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
return SetForceArray(KEY_SFORC, vecData);
|
|
}
|
|
bool TDbColumn::GetSForceArray(std::vector<TCombSectForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetForceArray(KEY_SFORC, vecData);
|
|
}
|
|
void TDbColumn::ClearSForceArray()
|
|
{
|
|
assertWriteEnabled();
|
|
ClearForceArray(KEY_SFORC);
|
|
}
|
|
//内力数据
|
|
bool TDbColumn::SetForceArray(const std::vector<TCombSectForceData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
return SetForceArray(KEY_FORC, vecData);
|
|
}
|
|
bool TDbColumn::GetForceArray(std::vector<TCombSectForceData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetForceArray(KEY_FORC, vecData);
|
|
}
|
|
void TDbColumn::ClearForceArray()
|
|
{
|
|
assertWriteEnabled();
|
|
ClearForceArray(KEY_FORC);
|
|
}
|
|
|
|
//柱正截面配筋面积数据
|
|
bool TDbColumn::SetRSArray(const std::vector<TReinSectData>& vecRSData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearRSArray();
|
|
return SetAt(KEY_RSA, vecRSData);
|
|
}
|
|
bool TDbColumn::GetRSArray(std::vector<TReinSectData>& vecRSData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_RSA, vecRSData);
|
|
}
|
|
void TDbColumn::ClearRSArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveRSDataKey(KEY_RSA);
|
|
}
|
|
//柱斜截面配筋面积数据
|
|
bool TDbColumn::SetRSSArray(const std::vector<TReinSectData>& vecRSData)
|
|
{
|
|
assertWriteEnabled();
|
|
ClearRSSArray();
|
|
return SetAt(KEY_RSSA, vecRSData);
|
|
}
|
|
bool TDbColumn::GetRSSArray(std::vector<TReinSectData>& vecRSData)const
|
|
{
|
|
assertReadEnabled();
|
|
return GetAt(KEY_RSSA, vecRSData);
|
|
}
|
|
void TDbColumn::ClearRSSArray()
|
|
{
|
|
assertWriteEnabled();
|
|
RemoveRSDataKey(KEY_RSSA);
|
|
}
|
|
|
|
//截面配筋面积数据
|
|
bool TDbColumn::SetAt(LPCTSTR pszKey,const std::vector<TReinSectData>& vecData)
|
|
{
|
|
assertWriteEnabled();
|
|
if (pszKey != NULL)
|
|
{
|
|
CString sSubKey;
|
|
int nLength = vecData.size();
|
|
GetSpecialtyData()->SetAt(pszKey, nLength);
|
|
|
|
for (int i = 0;i < nLength; i++)
|
|
{
|
|
sSubKey.Format(_T("%sL%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_nSectNo);
|
|
sSubKey.Format(_T("%sV%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_dArea);
|
|
sSubKey.Format(_T("%sP%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_dAreaS);
|
|
sSubKey.Format(_T("%sY%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_dAreaY);
|
|
sSubKey.Format(_T("%sF%d"),pszKey, i);
|
|
GetSpecialtyData()->SetAt(sSubKey, vecData[i].m_nFlag);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
bool TDbColumn::GetAt(LPCTSTR pszKey,std::vector<TReinSectData>& vecData)const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
vecData.clear();
|
|
|
|
if (pszKey != NULL)
|
|
{
|
|
CString sSubKey;
|
|
int nLength = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(pszKey, nLength);
|
|
|
|
double dVal = 0;
|
|
int i = 0,nSectNo;
|
|
while(nLength > 0)
|
|
{
|
|
TReinSectData rsData;
|
|
sSubKey.Format(_T("%sL%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, nSectNo))
|
|
{
|
|
rsData.m_nSectNo = nSectNo;
|
|
}
|
|
sSubKey.Format(_T("%sV%d"),pszKey, i);
|
|
if (GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
rsData.m_dArea = dVal;
|
|
}
|
|
|
|
sSubKey.Format(_T("%sP%d"),pszKey, i);
|
|
if(GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
rsData.m_dAreaS = dVal;
|
|
}
|
|
sSubKey.Format(_T("%sY%d"),pszKey, i);
|
|
if(GetSpecialtyDataReadOnly()->GetAt(sSubKey, dVal))
|
|
{
|
|
rsData.m_dAreaY = dVal;
|
|
}
|
|
sSubKey.Format(_T("%sF%d"),pszKey, i);
|
|
if(GetSpecialtyDataReadOnly()->GetAt(sSubKey, nSectNo))
|
|
{
|
|
rsData.m_nFlag = nSectNo;
|
|
}
|
|
|
|
vecData.push_back(rsData);
|
|
|
|
i++;
|
|
nLength--;
|
|
}
|
|
}
|
|
|
|
return ((int)vecData.size() > 0);
|
|
}
|
|
void TDbColumn::RemoveRSDataKey(LPCTSTR pszKey)
|
|
{
|
|
assertWriteEnabled();
|
|
if (pszKey != NULL)
|
|
{
|
|
CString sSubKey;
|
|
int nLength = 0;
|
|
GetSpecialtyDataReadOnly()->GetAt(sSubKey, nLength);
|
|
GetSpecialtyData()->RemoveAt(pszKey);
|
|
|
|
for (int i = 0;i < nLength; i++)
|
|
{
|
|
sSubKey.Format(_T("%sL%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sV%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sP%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sY%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sF%d"),pszKey, i);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
}
|
|
}
|
|
}
|
|
|
|
bool TDbColumn::ConstructShape(const TADSGePoint3d &pt, TGGePoly2D &poly) const
|
|
{
|
|
poly.Reset();
|
|
|
|
TSectionShape nShape = GetSectionShape();
|
|
bool bRet = false;
|
|
switch(nShape)
|
|
{
|
|
case kRect:
|
|
{
|
|
bRet = ConstructRectShape(pt, poly);
|
|
break;
|
|
}
|
|
case kIBeam:
|
|
{
|
|
bRet = ConstructIShape(pt, poly);
|
|
break;
|
|
}
|
|
case kCircle:
|
|
{
|
|
bRet = ConstructCircleShape(pt, poly);
|
|
break;
|
|
}
|
|
default:
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if (!bRet)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
if (poly.PathArea() > 0) // 顺时针时调整为逆时针
|
|
{
|
|
poly.Reverse();
|
|
}
|
|
|
|
double dAngle = 0.0;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_AXANG, dAngle);
|
|
ads_matrix xform;
|
|
pt.GetRotationMatrix(dAngle, xform);
|
|
AcGeMatrix3d mat;
|
|
for (int i = 0; i < 4; i++)
|
|
{
|
|
for (int j = 0; j < 4; j++)
|
|
{
|
|
mat(i, j) = xform[i][j];
|
|
}
|
|
}
|
|
poly.TransformBy(mat);
|
|
|
|
return true;
|
|
}
|
|
//以左下点为起点,逆时针
|
|
bool TDbColumn::ConstructRectShape(const TADSGePoint3d &pt, TGGePoly2D &poly) const
|
|
{
|
|
double dWidth = 0.0, dHeight = 0.0, dAng = 0.0;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_B, dWidth);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_H, dHeight);
|
|
AcGePoint3d ptOrigin = pt;
|
|
AcGeVector3d vtX = AcGeVector3d::kXAxis;
|
|
AcGeVector3d vtY = vtX;
|
|
vtY = vtY.rotateBy(PI / 2, AcGeVector3d::kZAxis);
|
|
AcGePoint3d ptLT = ptOrigin - vtX * dWidth * 0.5 + vtY * dHeight * 0.5;
|
|
AcGePoint3d ptRT = ptLT + vtX * dWidth;
|
|
AcGePoint3d ptLB = ptLT - vtY * dHeight;
|
|
AcGePoint3d ptRB = ptRT - vtY * dHeight;
|
|
poly.AppendNode(ptLB);
|
|
poly.AppendNode(ptRB);
|
|
poly.AppendNode(ptRT);
|
|
poly.AppendNode(ptLT);
|
|
poly.SetFlag(1);
|
|
|
|
return true;
|
|
}
|
|
|
|
//以左下点为起点,逆时针
|
|
bool TDbColumn::ConstructIShape(const TADSGePoint3d &pt, TGGePoly2D &poly) const
|
|
{
|
|
double dB = 0.0, dH = 0.0, dU = 0.0, dT = 0.0, dD = 0.0, dF = 0.0, dAngle = 0.0;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_B,dB);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_H,dH);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_U,dU);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_T,dT);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_D,dD);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_F,dF);
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_AXANG, dAngle);
|
|
AcGePoint3d ptOrigin = pt;
|
|
AcGeVector3d vtX = AcGeVector3d::kXAxis;
|
|
AcGeVector3d vtY = vtX;
|
|
vtY = vtY.rotateBy(PI / 2, AcGeVector3d::kZAxis);
|
|
AcGePoint3d pt1 = ptOrigin - vtX * dU * 0.5 + vtY * dH * 0.5;
|
|
AcGePoint3d pt2 = pt1 + vtX * dU;
|
|
AcGePoint3d pt3 = pt2 - vtY * dT;
|
|
AcGePoint3d pt4 = pt3 - vtX * (dU - dB) * 0.5;
|
|
AcGePoint3d pt5 = pt4 - vtY * (dH - dF - dT);
|
|
AcGePoint3d pt6 = pt5 + vtX * (dD - dB) * 0.5;
|
|
AcGePoint3d pt7 = pt6 - vtY * dF;
|
|
AcGePoint3d pt8 = pt7 - vtX * dD;
|
|
AcGePoint3d pt9 = pt8 + vtY * dF;
|
|
AcGePoint3d pt10 = pt9 + vtX * (dD - dB) * 0.5;
|
|
AcGePoint3d pt11 = pt10 + vtY * (dH - dT - dF);
|
|
AcGePoint3d pt12 = pt11 - vtX * (dU - dB) * 0.5;
|
|
|
|
poly.AppendNode(pt8);
|
|
poly.AppendNode(pt7);
|
|
poly.AppendNode(pt6);
|
|
poly.AppendNode(pt5);
|
|
poly.AppendNode(pt4);
|
|
poly.AppendNode(pt3);
|
|
poly.AppendNode(pt2);
|
|
poly.AppendNode(pt1);
|
|
poly.AppendNode(pt12);
|
|
poly.AppendNode(pt11);
|
|
poly.AppendNode(pt10);
|
|
poly.AppendNode(pt9);
|
|
poly.SetFlag(1);
|
|
return true;
|
|
}
|
|
|
|
bool TDbColumn::ConstructCircleShape(const TADSGePoint3d &pt, TGGePoly2D &poly) const
|
|
{
|
|
double dRadius = 0.0;
|
|
GetSpecialtyDataReadOnly()->GetAt(KEY_B, dRadius);
|
|
dRadius *= 0.5;
|
|
TGGeCircle cir(pt, dRadius);
|
|
TGGeCurveSegment seg;
|
|
seg = cir;
|
|
seg.AsPoly2D(poly);
|
|
return true;
|
|
}
|
|
|
|
double TDbColumn::GetCalcAngle() const
|
|
{
|
|
if(m_polyOutline.Length() < 2)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
AcGeVector3d vt = m_polyOutline[1] - m_polyOutline[0];
|
|
AcGeVector3d vtX = AcGeVector3d::kXAxis;
|
|
vtX.rotateBy(Ucs2Wcs(0.0), AcGeVector3d::kZAxis); // 考虑ucs
|
|
double dAngle = vtX.angleTo(vt, AcGeVector3d::kZAxis);
|
|
return dAngle;
|
|
}
|
|
|
|
|
|
//柱实际配筋面积数据
|
|
bool TDbColumn::SetRAreaArray(const TReinData& raData)
|
|
{
|
|
assertWriteEnabled();
|
|
CString pszKey = KEY_RAREA;
|
|
|
|
CString sSubKey;
|
|
sSubKey.Format(_T("%sX"),pszKey);
|
|
GetSpecialtyData()->SetAt(sSubKey, raData.m_dAreaX);
|
|
sSubKey.Format(_T("%sY"),pszKey);
|
|
GetSpecialtyData()->SetAt(sSubKey, raData.m_dAreaY);
|
|
sSubKey.Format(_T("%sGX"),pszKey);
|
|
GetSpecialtyData()->SetAt(sSubKey, raData.m_dAreaGX);
|
|
sSubKey.Format(_T("%sFX"),pszKey);
|
|
GetSpecialtyData()->SetAt(sSubKey, raData.m_dAreaFX);
|
|
sSubKey.Format(_T("%sGY"),pszKey);
|
|
GetSpecialtyData()->SetAt(sSubKey, raData.m_dAreaGY);
|
|
sSubKey.Format(_T("%sFY"),pszKey);
|
|
GetSpecialtyData()->SetAt(sSubKey, raData.m_dAreaFY);
|
|
|
|
return true;
|
|
}
|
|
bool TDbColumn::GetRAreaArray(TReinData& raData)const
|
|
{
|
|
assertReadEnabled();
|
|
CString pszKey = KEY_RAREA;
|
|
|
|
CString sSubKey;
|
|
sSubKey.Format(_T("%sX"),pszKey);
|
|
if(!GetSpecialtyDataReadOnly()->GetAt(sSubKey, raData.m_dAreaX))
|
|
{
|
|
return false;
|
|
}
|
|
sSubKey.Format(_T("%sY"),pszKey);
|
|
if(!GetSpecialtyDataReadOnly()->GetAt(sSubKey, raData.m_dAreaY))
|
|
{
|
|
return false;
|
|
}
|
|
sSubKey.Format(_T("%sGX"),pszKey);
|
|
if(!GetSpecialtyDataReadOnly()->GetAt(sSubKey, raData.m_dAreaGX))
|
|
{
|
|
return false;
|
|
}
|
|
sSubKey.Format(_T("%sFX"),pszKey);
|
|
if(!GetSpecialtyDataReadOnly()->GetAt(sSubKey, raData.m_dAreaFX))
|
|
{
|
|
return false;
|
|
}
|
|
sSubKey.Format(_T("%sGY"),pszKey);
|
|
if(!GetSpecialtyDataReadOnly()->GetAt(sSubKey, raData.m_dAreaGY))
|
|
{
|
|
return false;
|
|
}
|
|
sSubKey.Format(_T("%sFY"),pszKey);
|
|
if(!GetSpecialtyDataReadOnly()->GetAt(sSubKey, raData.m_dAreaFY))
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
|
|
}
|
|
void TDbColumn::ClearRAreaArray()
|
|
{
|
|
CString pszKey = KEY_RAREA;
|
|
|
|
{
|
|
CString sSubKey;
|
|
sSubKey.Format(_T("%sX"),pszKey);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sY"),pszKey);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sGX"),pszKey);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sFX"),pszKey);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sGY"),pszKey);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
sSubKey.Format(_T("%sFY"),pszKey);
|
|
GetSpecialtyData()->RemoveAt(sSubKey);
|
|
}
|
|
}
|
|
|
|
//配筋面积图
|
|
void TDbColumn::DrawColuRein(TGGiExplodeDrawBase &dc)const
|
|
{
|
|
int nPrec = 0;
|
|
bool bShow = false;
|
|
double dTop = 0, dBottom = 0, dMidUp = 0, dMidDown = 0;
|
|
double dAngle = 0;
|
|
TADSGePoint3d ptMin, ptMax, ptLoc;
|
|
CString strText;
|
|
TPushProperty vPorp(this, dc);
|
|
switch (g_nReinAreaModeColu)
|
|
{
|
|
case eCalArea: //计算配筋面积
|
|
{
|
|
m_polyOutline.GetExtend(ptMin, ptMax);
|
|
ptMin -= TADSGePoint3d(10,10,0);
|
|
ptMax += TADSGePoint3d(10,10,0);
|
|
|
|
TDbText text;
|
|
|
|
AcDbObjectId id = GetTextStyleId(_T("STANDARD"));
|
|
text.setPropertiesFrom(this);
|
|
double dTextHeight = 3.5; //文字字高
|
|
text.SetHeight(dTextHeight);
|
|
text.SetStyleId(id);
|
|
|
|
std::vector<TReinSectData> vecData;
|
|
if( GetRSArray(vecData))
|
|
{
|
|
dc.SetLayer(m_idLayerCalcArea);
|
|
int nSize = vecData.size();
|
|
if(nSize > 1)
|
|
{
|
|
TReinSectData reinDataB = vecData[0],reinDataT = vecData[nSize - 1];
|
|
dBottom = reinDataB.m_dArea;
|
|
dTop = reinDataT.m_dArea;
|
|
|
|
ptLoc = TADSGePoint3d(ptMin.x, ptMax.y, 0);
|
|
text.SetLocation(ptLoc);
|
|
dAngle = 0;
|
|
text.SetRotation(dAngle); //设置文字角度
|
|
text.SetAlignment(XExplodeDraw::kBottomLeft); //文字左侧底部对齐
|
|
strText.Format(_T("B: %.1f"), dBottom);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
|
|
ptLoc = TADSGePoint3d(ptMin.x, ptMax.y+dTextHeight*GetPScale(), 0);
|
|
text.SetLocation(ptLoc);
|
|
strText.Format(_T("T: %.1f"), dTop);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
|
|
if (GetSectionShape() == kRect) //矩形柱标注Y向
|
|
{
|
|
dBottom = reinDataB.m_dAreaY;
|
|
dTop = reinDataT.m_dAreaY;
|
|
|
|
ptLoc = TADSGePoint3d(ptMin.x, ptMin.y, 0);
|
|
text.SetLocation(ptLoc);
|
|
dAngle = 0;
|
|
text.SetRotation(dAngle+PI/2); //设置文字角度,
|
|
text.SetAlignment(XExplodeDraw::kBottomLeft); //文字左侧底部对齐
|
|
strText.Format(_T("B: %.1f"), dBottom);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
|
|
ptLoc = TADSGePoint3d(ptMin.x-dTextHeight*GetPScale(), ptMin.y, 0);
|
|
text.SetLocation(ptLoc);
|
|
strText.Format(_T("T: %.1f"), dTop);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
}
|
|
}
|
|
}
|
|
|
|
if(GetRSArray(vecData) && vecData.size() > 1)
|
|
{
|
|
ptLoc = TADSGePoint3d(ptMax.x, ptMin.y, 0);
|
|
text.SetLocation(ptLoc);
|
|
dAngle = 0;
|
|
text.SetRotation(dAngle); //设置文字角度
|
|
text.SetAlignment(XExplodeDraw::kTopLeft); //文字左侧底部对齐
|
|
strText.Format(_T("G: %.1f-%.1f"), vecData[0].m_dArea, vecData[0].m_dAreaY);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
}
|
|
}
|
|
break;
|
|
case eRealArea: //实配面积
|
|
{
|
|
TReinData rData;
|
|
if (GetRAreaArray(rData))
|
|
{
|
|
m_polyOutline.GetExtend(ptMin, ptMax);
|
|
ptMin -= TADSGePoint3d(10,10,0);
|
|
ptMax += TADSGePoint3d(10,10,0);
|
|
|
|
TDbText text;
|
|
|
|
AcDbObjectId id = GetTextStyleId(_T("STANDARD"));
|
|
text.setPropertiesFrom(this);
|
|
double dTextHeight = 3.5; //文字字高
|
|
text.SetHeight(dTextHeight);
|
|
text.SetStyleId(id);
|
|
dAngle = 0;
|
|
text.SetRotation(dAngle); //设置文字角度,
|
|
text.SetAlignment(XExplodeDraw::kTopLeft); //文字对齐
|
|
|
|
ptLoc = TADSGePoint3d(ptMax.x, ptMin.y, 0);
|
|
if (GetSectionShape() == kRect)
|
|
{
|
|
ptLoc = TADSGePoint3d(ptMax.x, ptMin.y, 0);
|
|
text.SetLocation(ptLoc);
|
|
strText.Format(_T("Asx: %.1f"), rData.m_dAreaX);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
|
|
ptLoc = TADSGePoint3d(ptMax.x, ptMin.y-dTextHeight*GetPScale(), 0);
|
|
text.SetLocation(ptLoc);
|
|
strText.Format(_T("Asy: %.1f"), rData.m_dAreaY);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
|
|
ptLoc = TADSGePoint3d(ptMax.x, ptMin.y-dTextHeight*2*GetPScale(), 0);
|
|
text.SetLocation(ptLoc);
|
|
strText.Format(_T("GX: %.1f-%.1f"), rData.m_dAreaGX, rData.m_dAreaFX);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
|
|
ptLoc = TADSGePoint3d(ptMax.x, ptMin.y-dTextHeight*3*GetPScale(), 0);
|
|
text.SetLocation(ptLoc);
|
|
strText.Format(_T("GY: %.1f-%.1f"), rData.m_dAreaGX, rData.m_dAreaFX);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
}
|
|
else
|
|
{
|
|
ptLoc = TADSGePoint3d(ptMax.x, ptMin.y, 0);
|
|
text.SetLocation(ptLoc);
|
|
strText.Format(_T("As: %.1f"), rData.m_dAreaX);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
|
|
ptLoc = TADSGePoint3d(ptMax.x, ptMin.y-dTextHeight*GetPScale(), 0);
|
|
text.SetLocation(ptLoc);
|
|
strText.Format(_T("G: %.1f-%.1f"), rData.m_dAreaGX, rData.m_dAreaFX);
|
|
text.SetText(strText);
|
|
dc.DrawEntity(text);
|
|
}
|
|
}
|
|
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
#endif |