676 lines
14 KiB
C++
676 lines
14 KiB
C++
#include "stdafx.h"
|
|
#include "UIITable.h"
|
|
#include "UIIBoundary.h"
|
|
#include "UIIBorderLine.h"
|
|
#include <algorithm>
|
|
#include "KTCadUtility.h"
|
|
#include "comdef.h"
|
|
#include "EarThwormDef.h"
|
|
extern Acad::ErrorStatus AddToModelSpace(AcDbEntity* pEnt,AcDbDatabase* pDb = NULL,bool bClose = true);
|
|
|
|
CUIITable::CUIITable(void)
|
|
{
|
|
|
|
}
|
|
|
|
CUIITable::~CUIITable(void)
|
|
{
|
|
while(m_arEntPtrs.length() > 0)
|
|
{
|
|
AcDbEntity* pEnt = (AcDbEntity*)m_arEntPtrs.first();
|
|
m_arEntPtrs.removeFirst();
|
|
DELETE_PTR(pEnt);
|
|
}
|
|
}
|
|
|
|
bool CUIITable::Add(AcGePoint3d& ptSta,AcGePoint3d& ptEnd)
|
|
{
|
|
CUIIBorderLine bLine;
|
|
bLine.Set(ptSta,ptEnd);
|
|
return Add(bLine);
|
|
}
|
|
|
|
bool CUIITable::Add(CUIIBorderLine& bLine)
|
|
{
|
|
int nDir = bLine.GetDir();
|
|
if (nDir >= 0)
|
|
{
|
|
double dPos = bLine.GetPos();
|
|
if (nDir == 0) //水平
|
|
{
|
|
CUIIBoundary* pBdary = NULL;
|
|
if (m_arHorBoundaryPtrs.size() == 0)
|
|
{
|
|
pBdary = new CUIIBoundary;
|
|
pBdary->Add(bLine);
|
|
m_arHorBoundaryPtrs.push_back(pBdary);
|
|
return true;
|
|
}
|
|
|
|
bool bFind = false;
|
|
for(int i = 0;i < m_arHorBoundaryPtrs.size();i++)
|
|
{
|
|
pBdary = m_arHorBoundaryPtrs.at(i);
|
|
|
|
if (pBdary->GetDir() == nDir && fabs(pBdary->GetPos() - dPos) < 1.e-3)
|
|
{
|
|
pBdary->Add(bLine);
|
|
bFind = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (!bFind)
|
|
{
|
|
pBdary = new CUIIBoundary;
|
|
pBdary->Add(bLine);
|
|
m_arHorBoundaryPtrs.push_back(pBdary);
|
|
Sort(nDir);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
if (nDir == 1)//垂直
|
|
{
|
|
CUIIBoundary* pBdary = NULL;
|
|
if (m_arHorBoundaryPtrs.size() == 0)
|
|
{
|
|
pBdary = new CUIIBoundary;
|
|
pBdary->Add(bLine);
|
|
m_arVerBoundaryPtrs.push_back(pBdary);
|
|
return true;
|
|
}
|
|
|
|
bool bFind = false;
|
|
for(int i = 0;i < m_arVerBoundaryPtrs.size();i++)
|
|
{
|
|
pBdary = m_arVerBoundaryPtrs.at(i);
|
|
|
|
if (pBdary->GetDir() == nDir && fabs(pBdary->GetPos() - dPos) < 1.e-3)
|
|
{
|
|
pBdary->Add(bLine);
|
|
bFind = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (!bFind)
|
|
{
|
|
pBdary = new CUIIBoundary;
|
|
pBdary->Add(bLine);
|
|
m_arVerBoundaryPtrs.push_back(pBdary);
|
|
Sort(nDir);
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void CUIITable::AddTitle(CUIITitle& title)
|
|
{
|
|
m_arTitle.push_back(title);
|
|
}
|
|
|
|
void CUIITable::SetKeyText(LPCTSTR pszKeyText)
|
|
{
|
|
_tcscpy(m_szKeyText,pszKeyText);
|
|
}
|
|
|
|
void CUIITable::GetKeyText(CString& sKeyText)
|
|
{
|
|
sKeyText = m_szKeyText;
|
|
}
|
|
|
|
bool CUIITable::CloseRect()
|
|
{
|
|
if (m_arHorBoundaryPtrs.size() < 2 || m_arVerBoundaryPtrs.size() < 2)
|
|
return false;
|
|
|
|
//获取最大范围
|
|
CUIIBoundary* pBoundary = NULL;
|
|
|
|
AcDbExtents ext;
|
|
pBoundary = m_arVerBoundaryPtrs.at(0);
|
|
ext.addPoint(pBoundary->GetStart());
|
|
ext.addPoint(pBoundary->GetEnd());
|
|
|
|
pBoundary = m_arVerBoundaryPtrs.at(m_arVerBoundaryPtrs.size() - 1);
|
|
ext.addPoint(pBoundary->GetStart());
|
|
ext.addPoint(pBoundary->GetEnd());
|
|
|
|
pBoundary = m_arHorBoundaryPtrs.at(0);
|
|
ext.addPoint(pBoundary->GetStart());
|
|
ext.addPoint(pBoundary->GetEnd());
|
|
|
|
pBoundary = m_arHorBoundaryPtrs.at(m_arHorBoundaryPtrs.size() - 1);
|
|
ext.addPoint(pBoundary->GetStart());
|
|
ext.addPoint(pBoundary->GetEnd());
|
|
|
|
AcGePoint3d pt1,pt2;
|
|
pt1.set(ext.minPoint().x,ext.maxPoint().y,0.0);
|
|
pt2.set(ext.maxPoint().x,ext.maxPoint().y,0.0);
|
|
Add(pt1,pt2);
|
|
|
|
pt1.set(ext.maxPoint().x,ext.minPoint().y,0.0);
|
|
pt2.set(ext.maxPoint().x,ext.maxPoint().y,0.0);
|
|
Add(pt1,pt2);
|
|
|
|
pt1.set(ext.minPoint().x,ext.minPoint().y,0.0);
|
|
pt2.set(ext.maxPoint().x,ext.minPoint().y,0.0);
|
|
Add(pt1,pt2);
|
|
|
|
return true;
|
|
}
|
|
|
|
void CUIITable::GetRect(AcDbExtents& ext)
|
|
{
|
|
if (m_arHorBoundaryPtrs.size() < 2 || m_arVerBoundaryPtrs.size() < 2)
|
|
return;
|
|
|
|
//获取最大范围
|
|
CUIIBoundary* pBoundary = NULL;
|
|
|
|
pBoundary = m_arVerBoundaryPtrs.at(0);
|
|
ext.addPoint(pBoundary->GetStart());
|
|
ext.addPoint(pBoundary->GetEnd());
|
|
|
|
pBoundary = m_arVerBoundaryPtrs.at(m_arVerBoundaryPtrs.size() - 1);
|
|
ext.addPoint(pBoundary->GetStart());
|
|
ext.addPoint(pBoundary->GetEnd());
|
|
|
|
pBoundary = m_arHorBoundaryPtrs.at(0);
|
|
ext.addPoint(pBoundary->GetStart());
|
|
ext.addPoint(pBoundary->GetEnd());
|
|
|
|
pBoundary = m_arHorBoundaryPtrs.at(m_arHorBoundaryPtrs.size() - 1);
|
|
ext.addPoint(pBoundary->GetStart());
|
|
ext.addPoint(pBoundary->GetEnd());
|
|
}
|
|
|
|
static bool CompareBoundary(CUIIBoundary* pBoundary1,CUIIBoundary* pBoundary2)
|
|
{
|
|
if ( pBoundary1->GetPos() - pBoundary2->GetPos() < 1.e-10)
|
|
{
|
|
return true;//up sort
|
|
}
|
|
return false;//down sort
|
|
}
|
|
|
|
void CUIITable::Sort(int nDir)
|
|
{
|
|
if (nDir == 0)
|
|
{
|
|
std::sort(m_arHorBoundaryPtrs.begin(),m_arHorBoundaryPtrs.end(),CompareBoundary);
|
|
}
|
|
else
|
|
{
|
|
std::sort(m_arVerBoundaryPtrs.begin(),m_arVerBoundaryPtrs.end(),CompareBoundary);
|
|
}
|
|
}
|
|
|
|
bool CUIITable::GetCell(AcGePoint3d& ptPos,CUIICell& cell)
|
|
{
|
|
int nDown = -1,nUp = -1;
|
|
double dDownY = 0.0,dUpY = 0.0;
|
|
CUIIBoundary* pBoundaryFr = NULL;
|
|
CUIIBoundary* pBoundaryTo = NULL;
|
|
CUIIBorderLine bLine;
|
|
|
|
//1.水平之间 =
|
|
for (int i = 0;i < m_arHorBoundaryPtrs.size() - 1;i++)
|
|
{
|
|
if (nDown == -1)
|
|
{
|
|
pBoundaryFr = m_arHorBoundaryPtrs.at(i);
|
|
}
|
|
pBoundaryTo = m_arHorBoundaryPtrs.at(i+1);
|
|
|
|
if (ptPos.y > pBoundaryFr->GetPos() && ptPos.y < pBoundaryTo->GetPos() )
|
|
{
|
|
//并且 X 在 boundary 之间
|
|
if (nDown == -1)
|
|
{
|
|
for (int j = 0;j < pBoundaryFr->GetCount();j++)
|
|
{
|
|
pBoundaryFr->Get(j,bLine);
|
|
if (ptPos.x > bLine.GetStart().x && ptPos.x < bLine.GetEnd().x)
|
|
{
|
|
nDown = i;
|
|
dDownY = pBoundaryFr->GetPos();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (nUp == -1)
|
|
{
|
|
for (int j = 0;j < pBoundaryTo->GetCount();j++)
|
|
{
|
|
pBoundaryTo->Get(j,bLine);
|
|
if (ptPos.x > bLine.GetStart().x && ptPos.x < bLine.GetEnd().x)
|
|
{
|
|
nUp = i + 1;
|
|
dUpY = pBoundaryTo->GetPos();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (nDown != -1 && nUp != -1)
|
|
break;
|
|
}
|
|
|
|
//2. 垂直
|
|
int nLeft = -1,nRight = -1;
|
|
double dLeftX = 0.0,dRightX = 0.0;
|
|
|
|
for (int i = 0;i < m_arVerBoundaryPtrs.size() - 1;i++)
|
|
{
|
|
if (nLeft == -1)
|
|
{
|
|
pBoundaryFr = m_arVerBoundaryPtrs.at(i);
|
|
}
|
|
pBoundaryTo = m_arVerBoundaryPtrs.at(i+1);
|
|
|
|
if (ptPos.x > pBoundaryFr->GetPos() && ptPos.x < pBoundaryTo->GetPos() )
|
|
{
|
|
//并且 X 在 boundary 之间
|
|
if (nLeft == -1)
|
|
{
|
|
for (int j = 0;j < pBoundaryFr->GetCount();j++)
|
|
{
|
|
pBoundaryFr->Get(j,bLine);
|
|
if (ptPos.y > bLine.GetStart().y && ptPos.y < bLine.GetEnd().y)
|
|
{
|
|
nLeft = i;
|
|
dLeftX = pBoundaryFr->GetPos();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (nRight == -1)
|
|
{
|
|
for (int j = 0;j < pBoundaryTo->GetCount();j++)
|
|
{
|
|
pBoundaryTo->Get(j,bLine);
|
|
if (ptPos.y > bLine.GetStart().y && ptPos.y < bLine.GetEnd().y)
|
|
{
|
|
nRight = i + 1;
|
|
dRightX = pBoundaryTo->GetPos();
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (nLeft != -1 && nRight != -1)
|
|
break;
|
|
}
|
|
|
|
if (nLeft != -1 && nRight != -1 && nDown != -1 && nUp != -1)
|
|
{
|
|
cell.ptGe[0].set(dLeftX,dDownY,0.0);
|
|
cell.ptGe[1].set(dRightX,dDownY,0.0);
|
|
cell.ptGe[2].set(dRightX,dUpY,0.0);
|
|
cell.ptGe[3].set(dLeftX,dUpY,0.0);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void CUIITable::TransformBy(AcGeMatrix3d& xform)
|
|
{
|
|
CUIIBoundary* pBoundary = NULL;
|
|
|
|
//水平线
|
|
for (int i = 0;i < m_arHorBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arHorBoundaryPtrs.at(i);
|
|
pBoundary->TransformBy(xform);
|
|
}
|
|
|
|
for (int i = 0;i < m_arVerBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arVerBoundaryPtrs.at(i);
|
|
pBoundary->TransformBy(xform);
|
|
}
|
|
|
|
AcDbText text;
|
|
for (int i = 0;i < m_arTitle.size();i++)
|
|
{
|
|
CUIITitle& title = m_arTitle[i];
|
|
|
|
text.setPosition(title.ptPos);
|
|
text.setHeight(title.dH);
|
|
text.setWidthFactor(title.dWFactor);
|
|
text.setTextString(title.szTitle);
|
|
text.setNormal(AcGeVector3d::kZAxis);
|
|
text.setColorIndex(2);
|
|
text.setTextStyle( CKTCadUtility::InitTextStyle(title.szStyle) );
|
|
text.transformBy(xform);
|
|
|
|
title.ptPos = text.position();
|
|
title.dH = text.height();
|
|
}
|
|
}
|
|
|
|
void CUIITable::ShowToModelSpace(AcDbDatabase* pDb,AcGeMatrix3d* pMatrix)
|
|
{
|
|
CUIIBorderLine bLine;
|
|
CUIIBoundary* pBoundary = NULL;
|
|
|
|
//水平线
|
|
for (int i = 0;i < m_arHorBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arHorBoundaryPtrs.at(i);
|
|
for(int j = 0;j < pBoundary->GetCount();j++)
|
|
{
|
|
pBoundary->Get(j,bLine);
|
|
|
|
AcDbLine* pLine = new AcDbLine(bLine.GetStart(),bLine.GetEnd());
|
|
pLine->setColorIndex(1);
|
|
|
|
if (pMatrix != NULL)
|
|
pLine->transformBy(*pMatrix);
|
|
|
|
AddToModelSpace(pLine,pDb);
|
|
}
|
|
}
|
|
|
|
//垂直线
|
|
for (int i = 0;i < m_arVerBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arVerBoundaryPtrs.at(i);
|
|
for(int j = 0;j < pBoundary->GetCount();j++)
|
|
{
|
|
pBoundary->Get(j,bLine);
|
|
|
|
AcDbLine* pLine = new AcDbLine(bLine.GetStart(),bLine.GetEnd());
|
|
pLine->setColorIndex(2);
|
|
|
|
if (pMatrix != NULL)
|
|
pLine->transformBy(*pMatrix);
|
|
|
|
AddToModelSpace(pLine,pDb);
|
|
}
|
|
}
|
|
|
|
//文字
|
|
for (int i = 0;i < m_arTitle.size();i++)
|
|
{
|
|
CUIITitle& title = m_arTitle.at(i);
|
|
|
|
AcDbText* pText = new AcDbText;
|
|
pText->setPosition(title.ptPos);
|
|
pText->setHeight(title.dH);
|
|
pText->setWidthFactor(title.dWFactor);
|
|
pText->setTextString(title.szTitle);
|
|
pText->setNormal(AcGeVector3d::kZAxis);
|
|
pText->setColorIndex(2);
|
|
|
|
pText->setTextStyle( CKTCadUtility::InitTextStyle(title.szStyle) );
|
|
|
|
if (pMatrix != NULL)
|
|
pText->transformBy(*pMatrix);
|
|
|
|
AddToModelSpace(pText,pDb);
|
|
}
|
|
}
|
|
|
|
void CUIITable::ShowInGsView(AcGsView* pview,AcGsModel* pModel)
|
|
{
|
|
CUIIBorderLine bLine;
|
|
CUIIBoundary* pBoundary = NULL;
|
|
|
|
//水平线
|
|
for (int i = 0;i < m_arHorBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arHorBoundaryPtrs.at(i);
|
|
for(int j = 0;j < pBoundary->GetCount();j++)
|
|
{
|
|
pBoundary->Get(j,bLine);
|
|
|
|
AcDbLine* pLine = new AcDbLine(bLine.GetStart(),bLine.GetEnd());
|
|
pLine->setColorIndex(1);
|
|
m_arEntPtrs.append(pLine);
|
|
pview->add(pLine,pModel);
|
|
}
|
|
}
|
|
|
|
//垂直线
|
|
for (int i = 0;i < m_arVerBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arVerBoundaryPtrs.at(i);
|
|
for(int j = 0;j < pBoundary->GetCount();j++)
|
|
{
|
|
pBoundary->Get(j,bLine);
|
|
|
|
AcDbLine* pLine = new AcDbLine(bLine.GetStart(),bLine.GetEnd());
|
|
pLine->setColorIndex(2);
|
|
m_arEntPtrs.append(pLine);
|
|
pview->add(pLine,pModel);
|
|
}
|
|
}
|
|
|
|
//文字
|
|
for (int i = 0;i < m_arTitle.size();i++)
|
|
{
|
|
CUIITitle& title = m_arTitle.at(i);
|
|
|
|
AcDbText* pText = new AcDbText;
|
|
pText->setPosition(title.ptPos);
|
|
pText->setHeight(title.dH);
|
|
pText->setWidthFactor(title.dWFactor);
|
|
pText->setTextString(title.szTitle);
|
|
pText->setNormal(AcGeVector3d::kZAxis);
|
|
pText->setColorIndex(2);
|
|
|
|
pText->setTextStyle( CKTCadUtility::InitTextStyle(title.szStyle) );
|
|
|
|
m_arEntPtrs.append(pText);
|
|
pview->add(pText,pModel);
|
|
}
|
|
}
|
|
|
|
void CUIITable::Draw(CDC* pDC)
|
|
{
|
|
CUIIBorderLine bLine;
|
|
CUIIBoundary* pBoundary = NULL;
|
|
|
|
//水平线
|
|
CPoint pt1,pt2;
|
|
for (int i = 0;i < m_arHorBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arHorBoundaryPtrs.at(i);
|
|
|
|
pt1.SetPoint( (int)pBoundary->GetStart().x,(int)pBoundary->GetStart().y);
|
|
pt2.SetPoint( (int)pBoundary->GetEnd().x,(int)pBoundary->GetEnd().y);
|
|
pDC->MoveTo(pt1);
|
|
pDC->LineTo(pt2);
|
|
}
|
|
|
|
//垂直线
|
|
for (int i = 0;i < m_arVerBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arVerBoundaryPtrs.at(i);
|
|
|
|
pt1.SetPoint( (int)pBoundary->GetStart().x,(int)pBoundary->GetStart().y);
|
|
pt2.SetPoint( (int)pBoundary->GetEnd().x,(int)pBoundary->GetEnd().y);
|
|
pDC->MoveTo(pt1);
|
|
pDC->LineTo(pt2);
|
|
}
|
|
}
|
|
|
|
bool CUIITable::Save(LPCTSTR pszFullFile)
|
|
{
|
|
CFile file;
|
|
if (file.Open(pszFullFile,CFile::modeCreate | CFile::modeWrite))
|
|
{
|
|
//head
|
|
char szHead[37];
|
|
strcpy(szHead,"kingtouch dfrm cote file 1.0");
|
|
file.Write(szHead,sizeof(szHead));
|
|
|
|
char szKeyText[512];
|
|
_bstr_t bst0(m_szKeyText);
|
|
strcpy(szKeyText,(const char*)bst0);
|
|
file.Write(szKeyText,sizeof(szKeyText));
|
|
|
|
//水平
|
|
int nLen = (int)m_arHorBoundaryPtrs.size();
|
|
file.Write(&nLen,sizeof(int));
|
|
|
|
CUIIBorderLine bLine;
|
|
CUIIBoundary* pBoundary = NULL;
|
|
|
|
int nLen2 = 0;
|
|
for (int i = 0;i < m_arHorBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arHorBoundaryPtrs.at(i);
|
|
|
|
nLen2 = pBoundary->GetCount();
|
|
file.Write(&nLen2,sizeof(int));
|
|
|
|
for (int j = 0;j < pBoundary->GetCount();j++)
|
|
{
|
|
pBoundary->Get(j,bLine);
|
|
file.Write(&bLine,sizeof(CUIIBorderLine));
|
|
}
|
|
}
|
|
|
|
//垂直
|
|
nLen = (int)m_arVerBoundaryPtrs.size();
|
|
file.Write(&nLen,sizeof(int));
|
|
|
|
for (int i = 0;i < m_arVerBoundaryPtrs.size();i++)
|
|
{
|
|
pBoundary = m_arVerBoundaryPtrs.at(i);
|
|
|
|
nLen2 = pBoundary->GetCount();
|
|
file.Write(&nLen2,sizeof(int));
|
|
|
|
for (int j = 0;j < pBoundary->GetCount();j++)
|
|
{
|
|
pBoundary->Get(j,bLine);
|
|
file.Write(&bLine,sizeof(CUIIBorderLine));
|
|
}
|
|
}
|
|
|
|
//标题 宽字节
|
|
nLen = (int)m_arTitle.size();
|
|
file.Write(&nLen,sizeof(int));
|
|
|
|
CUIITitleA titlea;
|
|
for (int i = 0;i < m_arTitle.size();i++)
|
|
{
|
|
CUIITitle& title = m_arTitle.at(i);
|
|
titlea.ptPos = title.ptPos;
|
|
titlea.dH = title.dH;
|
|
titlea.dWFactor = title.dWFactor;
|
|
|
|
_bstr_t bst(title.szStyle);
|
|
strcpy(titlea.szStyle,(const char*)bst);
|
|
|
|
_bstr_t bst2(title.szTitle);
|
|
strcpy(titlea.szTitle,(const char*)bst2);
|
|
|
|
file.Write(&titlea,sizeof(CUIITitleA));
|
|
}
|
|
file.Close();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
bool CUIITable::Read(LPCTSTR pszFullFile)
|
|
{
|
|
CFile file;
|
|
if (file.Open(pszFullFile,CFile::modeRead ) )
|
|
{
|
|
//head
|
|
char szHead[37];
|
|
file.Read(szHead,sizeof(szHead));
|
|
|
|
if (strcmp(szHead,"kingtouch dfrm cote file 1.0") != 0)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
char szKeyText[512];
|
|
file.Read(szKeyText,512);
|
|
|
|
_bstr_t bst0(szKeyText);
|
|
_tcscpy(m_szKeyText,(const TCHAR*)bst0);
|
|
|
|
int nLen = 0;
|
|
file.Read(&nLen,sizeof(int));
|
|
|
|
CUIIBorderLine bLine;
|
|
CUIIBoundary* pBoundary = NULL;
|
|
|
|
int nLen2 = 0;
|
|
for (int i = 0;i < nLen;i++)
|
|
{
|
|
file.Read(&nLen2,sizeof(int));
|
|
|
|
pBoundary = new CUIIBoundary;
|
|
for (int j = 0;j < nLen2;j++)
|
|
{
|
|
file.Read(&bLine,sizeof(CUIIBorderLine));
|
|
pBoundary->Add(bLine);
|
|
}
|
|
m_arHorBoundaryPtrs.push_back(pBoundary);
|
|
}
|
|
|
|
nLen = 0;
|
|
file.Read(&nLen,sizeof(int));
|
|
|
|
for (int i = 0;i < nLen;i++)
|
|
{
|
|
file.Read(&nLen2,sizeof(int));
|
|
|
|
pBoundary = new CUIIBoundary;
|
|
for (int j = 0;j < nLen2;j++)
|
|
{
|
|
file.Read(&bLine,sizeof(CUIIBorderLine));
|
|
pBoundary->Add(bLine);
|
|
}
|
|
m_arVerBoundaryPtrs.push_back(pBoundary);
|
|
}
|
|
|
|
nLen = 0;
|
|
file.Read(&nLen,sizeof(int));
|
|
|
|
CUIITitleA titlea;
|
|
CUIITitle title;
|
|
|
|
for (int i = 0;i < nLen;i++)
|
|
{
|
|
file.Read(&titlea,sizeof(CUIITitleA));
|
|
title.dH = titlea.dH;
|
|
title.ptPos = titlea.ptPos;
|
|
title.dWFactor = titlea.dWFactor;
|
|
|
|
_bstr_t bst(titlea.szStyle);
|
|
_tcscpy(title.szStyle,(const TCHAR*)bst);
|
|
|
|
_bstr_t bst2(titlea.szTitle);
|
|
_tcscpy(title.szTitle,(const TCHAR*)bst2);
|
|
|
|
m_arTitle.push_back(title);
|
|
}
|
|
file.Close();
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void CUIITable::HitCell(AcGePoint3d& ptGe,CUIICell& cell)
|
|
{
|
|
if ( GetCell(ptGe,cell) )
|
|
{
|
|
}
|
|
} |