613 lines
14 KiB
C++
613 lines
14 KiB
C++
#include "stdafx.h"
|
|
#include "TDbParking.h"
|
|
#include "dbproxy.h"
|
|
|
|
ACRX_DXF_DEFINE_MEMBERS(ATSParking, ATSEntity, AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent,
|
|
AcDbProxyEntity::kNoOperation, ATS_PARKING, "ATS_PARKING缺乏解释器图形看不见, 请下载上华软件|网址: www.shanghuasoft.com");
|
|
|
|
IMPLEMENT_TENTBASE(ATSParking);
|
|
|
|
ATSParking::ATSParking():
|
|
TDbEntity(),
|
|
m_iStyle(0),
|
|
m_iQuadrant(0),
|
|
m_ptVertex1(AcGePoint3d(0,0,0)),
|
|
m_ptVertex2(AcGePoint3d(0,0,0)),
|
|
m_ptVertex3(AcGePoint3d(0,0,0)),
|
|
m_ptVertex4(AcGePoint3d(0,0,0)),
|
|
m_ptMid(AcGePoint3d(0,0,0)),
|
|
m_dAngle(0),
|
|
m_ptBlockCenter(AcGePoint3d(0,0,0)),
|
|
m_idBlock(InitBlock(_T("$车$00000001"))),
|
|
m_bDirect(FALSE)
|
|
{
|
|
|
|
}
|
|
|
|
ATSParking::ATSParking(const XString &sName):
|
|
TDbEntity(),
|
|
m_iStyle(0),
|
|
m_iQuadrant(0),
|
|
m_ptVertex1(AcGePoint3d(0,0,0)),
|
|
m_ptVertex2(AcGePoint3d(0,0,0)),
|
|
m_ptVertex3(AcGePoint3d(0,0,0)),
|
|
m_ptVertex4(AcGePoint3d(0,0,0)),
|
|
m_ptMid(AcGePoint3d(0,0,0)),
|
|
m_dAngle(0),
|
|
m_ptBlockCenter(AcGePoint3d(0,0,0)),
|
|
m_idBlock(InitBlock(sName)),
|
|
m_bDirect(FALSE)
|
|
{
|
|
|
|
}
|
|
|
|
ATSParking::~ATSParking()
|
|
{
|
|
}
|
|
|
|
void ATSParking::CopyPropertiesFrom(AcDbEntity *pSrcEntity, unsigned gMatchFlag)
|
|
{
|
|
TDbEntity::CopyPropertiesFrom(pSrcEntity,gMatchFlag);
|
|
//
|
|
ATSParking *pDest = ATSParking::cast(pSrcEntity);
|
|
if (pDest)
|
|
{
|
|
m_iStyle = pDest->m_iStyle;
|
|
m_iQuadrant = pDest->m_iQuadrant;
|
|
|
|
m_ptVertex1 = pDest->m_ptVertex1;
|
|
m_ptVertex2 = pDest->m_ptVertex2;
|
|
m_ptVertex3 = pDest->m_ptVertex3;
|
|
m_ptVertex4 = pDest->m_ptVertex4;
|
|
|
|
m_ptMid = pDest->m_ptMid;
|
|
|
|
m_dAngle = pDest->m_dAngle;
|
|
m_ptBlockCenter = pDest->m_ptBlockCenter;
|
|
m_idBlock = pDest->m_idBlock;
|
|
|
|
m_bDirect = pDest->m_bDirect;
|
|
}
|
|
|
|
}
|
|
Acad::ErrorStatus ATSParking::dwgInFields (AcDbDwgFiler *pFiler)
|
|
{
|
|
assertWriteEnabled();
|
|
Acad::ErrorStatus errorStatus = TDbEntity::dwgInFields(pFiler);
|
|
if (Acad::eOk != errorStatus)
|
|
{
|
|
return errorStatus;
|
|
}
|
|
|
|
pFiler->readItem((AcGePoint2d *)&m_ptVertex1);
|
|
pFiler->readItem((AcGePoint2d *)&m_ptVertex2);
|
|
pFiler->readItem((AcGePoint2d *)&m_ptVertex3);
|
|
pFiler->readItem((AcGePoint2d *)&m_ptVertex4);
|
|
pFiler->readItem((AcGePoint2d *)&m_ptMid);
|
|
pFiler->readItem(&m_iStyle);
|
|
pFiler->readItem(&m_iQuadrant);
|
|
pFiler->readItem(&m_bDirect);
|
|
|
|
pFiler->readItem(&m_dAngle);
|
|
pFiler->readItem((AcGePoint2d *)&m_ptBlockCenter);
|
|
|
|
return pFiler->filerStatus();
|
|
}
|
|
|
|
Acad::ErrorStatus ATSParking::dwgOutFields(AcDbDwgFiler*pFiler) const
|
|
{
|
|
assertReadEnabled();
|
|
Acad::ErrorStatus errorStatus = TDbEntity::dwgOutFields(pFiler);
|
|
if (Acad::eOk != errorStatus)
|
|
{
|
|
return errorStatus;
|
|
}
|
|
|
|
pFiler->writeItem((const AcGePoint2d &)m_ptVertex1);
|
|
pFiler->writeItem((const AcGePoint2d &)m_ptVertex2);
|
|
pFiler->writeItem((const AcGePoint2d &)m_ptVertex3);
|
|
pFiler->writeItem((const AcGePoint2d &)m_ptVertex4);
|
|
pFiler->writeItem((const AcGePoint2d &)m_ptMid);
|
|
pFiler->writeItem(m_iStyle);
|
|
pFiler->writeItem(m_iQuadrant);
|
|
pFiler->writeItem(m_bDirect);
|
|
|
|
pFiler->writeItem(m_dAngle);
|
|
pFiler->writeItem((const AcGePoint2d &)m_ptBlockCenter);
|
|
|
|
return pFiler->filerStatus();
|
|
}
|
|
|
|
void ATSParking::Fill(const XPoint &ptStart,const AcGeVector3d &vec,int angle,double iWidth,double iHeight,int iSize,int iStyle,int iQuadrant)
|
|
{
|
|
//模式
|
|
m_iStyle = iStyle;
|
|
|
|
//象限
|
|
m_iQuadrant = iQuadrant;
|
|
|
|
//顶点1
|
|
m_ptVertex1 = ptStart;
|
|
|
|
//顶点2
|
|
m_ptVertex2 = m_ptVertex1 + vec;
|
|
|
|
//顶点3、4
|
|
XLine lineBase(m_ptVertex1,m_ptVertex2);
|
|
ads_real rAngBase = lineBase.Direction();
|
|
ads_point ptads3;
|
|
ads_point ptads4;
|
|
ads_point ptText;
|
|
acutPolar(m_ptVertex2,(rAngBase +iSize*angle*PI/180),iHeight,ptads3);
|
|
acutPolar(m_ptVertex1,(rAngBase +iSize*angle*PI/180),iHeight,ptads4);
|
|
m_ptVertex3 = ptads3;
|
|
m_ptVertex4 = ptads4;
|
|
XLine lineHead(m_ptVertex4, m_ptVertex3);
|
|
switch (m_iQuadrant)
|
|
{
|
|
case 0:
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase + iSize*angle*PI/180), iHeight, ptText);
|
|
if (m_dOffset > 0)
|
|
{
|
|
acutPolar(ptText, (rAngBase + iSize * 0.5 * PI), m_dOffset, m_ptText);
|
|
}
|
|
else
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase + iSize*angle*PI/180), iHeight + m_dOffset, m_ptText);
|
|
}
|
|
}
|
|
break;
|
|
case 1:
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase - iSize*angle*PI/180), iHeight, ptText);
|
|
if (m_dOffset > 0)
|
|
{
|
|
acutPolar(ptText, (rAngBase - iSize * 0.5 * PI), m_dOffset, m_ptText);
|
|
}
|
|
else
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase - iSize*angle*PI/180), iHeight + m_dOffset, m_ptText);
|
|
}
|
|
}
|
|
break;
|
|
case 2:
|
|
{
|
|
if (angle == 90)
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase - iSize*angle*PI/180), iHeight, ptText);
|
|
}
|
|
else
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase - iSize*(180 - angle)*PI/180), iHeight, ptText);
|
|
}
|
|
if (m_dOffset > 0)
|
|
{
|
|
acutPolar(ptText, (rAngBase - iSize * 0.5 * PI), m_dOffset, m_ptText);
|
|
}
|
|
else
|
|
{
|
|
if (angle == 90)
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase - iSize*angle*PI/180), iHeight + m_dOffset, m_ptText);
|
|
}
|
|
else
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase - iSize*(180 - angle)*PI/180), iHeight + m_dOffset, m_ptText);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case 3:
|
|
{
|
|
if (angle == 90)
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase + iSize*angle*PI/180), iHeight, ptText);
|
|
}
|
|
else
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase + iSize*(180 - angle)*PI/180), iHeight, ptText);
|
|
}
|
|
if (m_dOffset > 0)
|
|
{
|
|
acutPolar(ptText, (rAngBase + iSize * 0.5 * PI), m_dOffset, m_ptText);
|
|
}
|
|
else
|
|
{
|
|
if (angle == 90)
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase + iSize*angle*PI/180), iHeight + m_dOffset, m_ptText);
|
|
}
|
|
else
|
|
{
|
|
acutPolar(lineBase.MidPoint(), (rAngBase + iSize*(180 - angle)*PI/180), iHeight + m_dOffset, m_ptText);
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
break;
|
|
}
|
|
//中点
|
|
XLine lineformid34(m_ptVertex3,m_ptVertex4);
|
|
XLine lineformid23(m_ptVertex2,m_ptVertex3);
|
|
m_ptMid = lineformid34.MidPoint();
|
|
if (iWidth > iHeight)
|
|
{
|
|
m_bDirect = TRUE;
|
|
m_ptMid = lineformid23.MidPoint();
|
|
}
|
|
|
|
//块位置点
|
|
if (!m_bDirect)
|
|
{
|
|
AcGeVector3d vecX(0,100,0);
|
|
double dAngle = vecX.angleTo(vec);
|
|
vecX.rotateBy(dAngle,AcGeVector3d(0,0,1));
|
|
if (fabs(vecX.angleTo(vec)) <1E-6)
|
|
{
|
|
m_dAngle = dAngle +(iSize*angle*1.0/180)*PI;
|
|
}
|
|
else
|
|
{
|
|
m_dAngle = -dAngle +(iSize*angle*1.0/180)*PI;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
AcGeVector3d vecX(100,0,0);
|
|
double dAngle = vecX.angleTo(vec);
|
|
vecX.rotateBy(dAngle,AcGeVector3d(0,0,1));
|
|
if (fabs(vecX.angleTo(vec)) <1E-6)
|
|
{
|
|
m_dAngle = dAngle ;
|
|
}
|
|
else
|
|
{
|
|
m_dAngle = -dAngle ;
|
|
}
|
|
}
|
|
|
|
XLine lineformid13(m_ptVertex1,m_ptVertex3);
|
|
m_ptBlockCenter = lineformid13.MidPoint();
|
|
}
|
|
|
|
//弧
|
|
void ATSParking::Fill(const XPoint &ptCenter,const XPoint &ptStart,const AcGeVector3d &vec,double iWidth,double iHeight,int iSize,int iStyle)
|
|
{
|
|
//模式
|
|
m_iStyle = iStyle;
|
|
|
|
//象限
|
|
m_iQuadrant = 0;
|
|
|
|
//顶点1
|
|
m_ptVertex1 = ptStart;
|
|
|
|
//顶点2
|
|
m_ptVertex2 = m_ptVertex1 + vec;
|
|
|
|
//顶点3、4
|
|
double dOffSet = 0;
|
|
XLine lineBase(m_ptVertex1,m_ptVertex2);
|
|
ads_real rAngBase = lineBase.Direction();
|
|
ads_point ptads3;
|
|
ads_point ptads4;
|
|
ads_point ptText;
|
|
acutPolar(m_ptVertex2,(rAngBase + iSize*0.5*PI),iHeight,ptads3);
|
|
acutPolar(m_ptVertex1,(rAngBase + iSize*0.5*PI),iHeight,ptads4);
|
|
if (abs(m_dOffset + 0.5 * iHeight) < 1.0e-6)//字在中间
|
|
{
|
|
dOffSet = abs(m_dOffset);
|
|
}
|
|
else//修改 tyj 20160830:字在外侧或内侧(m_dOffset为正,在外侧;m_dOffset为负,在内测)
|
|
{
|
|
dOffSet = iHeight + m_dOffset;
|
|
}
|
|
acutPolar(lineBase.MidPoint(), (rAngBase + iSize*0.5*PI), dOffSet, ptText);
|
|
m_ptText = ptText;
|
|
XLine line34(ptads3,ptads4);
|
|
XLine line3(ptCenter,m_ptVertex2);
|
|
XLine line4(ptCenter,m_ptVertex1);
|
|
|
|
line34.Intersection(&line3,m_ptVertex3);
|
|
line34.Intersection(&line4,m_ptVertex4);
|
|
|
|
//中点
|
|
XLine lineformid34(m_ptVertex3,m_ptVertex4);
|
|
XLine lineformid23(m_ptVertex2,m_ptVertex3);
|
|
m_ptMid = lineformid34.MidPoint();
|
|
if (iWidth > iHeight)
|
|
{
|
|
m_bDirect = TRUE;
|
|
m_ptMid = lineformid23.MidPoint();
|
|
}
|
|
|
|
//块位置点
|
|
if (!m_bDirect)
|
|
{
|
|
AcGeVector3d vecX(0,100,0);
|
|
double dAngle = vecX.angleTo(vec);
|
|
vecX.rotateBy(dAngle,AcGeVector3d(0,0,1));
|
|
if (fabs(vecX.angleTo(vec)) <1E-6)
|
|
{
|
|
m_dAngle = dAngle +(iSize*90*1.0/180)*PI;
|
|
}
|
|
else
|
|
{
|
|
m_dAngle = -dAngle +(iSize*90*1.0/180)*PI;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
AcGeVector3d vecX(100,0,0);
|
|
double dAngle = vecX.angleTo(vec);
|
|
vecX.rotateBy(dAngle,AcGeVector3d(0,0,1));
|
|
if (fabs(vecX.angleTo(vec)) <1E-6)
|
|
{
|
|
m_dAngle = dAngle ;
|
|
}
|
|
else
|
|
{
|
|
m_dAngle = -dAngle ;
|
|
}
|
|
}
|
|
|
|
XLine lineformid12(m_ptVertex1,m_ptVertex2);
|
|
XLine lineMid(lineformid12.MidPoint(), lineformid34.MidPoint());
|
|
m_ptBlockCenter = lineMid.MidPoint();
|
|
|
|
//XLine lineformid13(m_ptVertex1,m_ptVertex3);
|
|
//m_ptBlockCenter = lineformid13.MidPoint();
|
|
|
|
}
|
|
|
|
Acad::ErrorStatus ATSParking::ExplodeOrDraw2d(XExplodeDraw &dc) const
|
|
{
|
|
assertReadEnabled();
|
|
|
|
AcDbPolyline line(4);
|
|
if (m_iQuadrant == kQuadrant1 || m_iQuadrant == kQuadrant4)
|
|
{
|
|
/*if (m_ptVertex1.x > m_ptVertex2.x)
|
|
{
|
|
line.addVertexAt(0,m_ptVertex2);
|
|
line.addVertexAt(1,m_ptVertex1);
|
|
line.addVertexAt(2,m_ptVertex4);
|
|
line.addVertexAt(3,m_ptVertex3);
|
|
}
|
|
else*/
|
|
{
|
|
line.addVertexAt(0,m_ptVertex1);
|
|
line.addVertexAt(1,m_ptVertex2);
|
|
line.addVertexAt(2,m_ptVertex3);
|
|
line.addVertexAt(3,m_ptVertex4);
|
|
}
|
|
}
|
|
else if (m_iQuadrant == kQuadrant3 || m_iQuadrant == kQuadrant2)
|
|
{
|
|
/*if (m_ptVertex1.x > m_ptVertex2.x)
|
|
{
|
|
line.addVertexAt(0,m_ptVertex1);
|
|
line.addVertexAt(1,m_ptVertex2);
|
|
line.addVertexAt(2,m_ptVertex3);
|
|
line.addVertexAt(3,m_ptVertex4);
|
|
}
|
|
else*/
|
|
{
|
|
line.addVertexAt(0,m_ptVertex2);
|
|
line.addVertexAt(1,m_ptVertex1);
|
|
line.addVertexAt(2,m_ptVertex4);
|
|
line.addVertexAt(3,m_ptVertex3);
|
|
}
|
|
}
|
|
line.setClosed(true);
|
|
TransformByEx(line);
|
|
dc.DrawEntity(line);
|
|
//单斜线
|
|
if (m_iStyle == k1Bias)
|
|
{
|
|
//AcDbPolyline line(2);
|
|
AcDbLine line;
|
|
if (m_iQuadrant == kQuadrant1 || m_iQuadrant == kQuadrant4)
|
|
{
|
|
if (m_ptVertex1.x > m_ptVertex2.x)
|
|
{
|
|
/*line.addVertexAt(0,m_ptVertex1);
|
|
line.addVertexAt(1,m_ptVertex3);*/
|
|
line.setStartPoint(m_ptVertex1);
|
|
line.setEndPoint(m_ptVertex3);
|
|
}
|
|
else
|
|
{
|
|
/* line.addVertexAt(0,m_ptVertex2);
|
|
line.addVertexAt(1,m_ptVertex4);*/
|
|
line.setStartPoint(m_ptVertex2);
|
|
line.setEndPoint(m_ptVertex4);
|
|
}
|
|
|
|
}
|
|
else if (m_iQuadrant == kQuadrant3 || m_iQuadrant == kQuadrant2)
|
|
{
|
|
if (m_ptVertex1.x > m_ptVertex2.x)
|
|
{
|
|
/*line.addVertexAt(0,m_ptVertex2);
|
|
line.addVertexAt(1,m_ptVertex4);*/
|
|
line.setStartPoint(m_ptVertex2);
|
|
line.setEndPoint(m_ptVertex4);
|
|
}
|
|
else
|
|
{
|
|
/*line.addVertexAt(0,m_ptVertex1);
|
|
line.addVertexAt(1,m_ptVertex3);*/
|
|
line.setStartPoint(m_ptVertex1);
|
|
line.setEndPoint(m_ptVertex3);
|
|
}
|
|
}
|
|
TransformByEx(line);
|
|
dc.DrawEntity(line);
|
|
}
|
|
//双斜线
|
|
else if (m_iStyle == k2Bias)
|
|
{
|
|
//AcDbPolyline line(3);
|
|
AcDbLine line1, line2;
|
|
if (m_ptVertex1.Distance(m_ptVertex2) > m_ptVertex2.Distance(m_ptVertex3))
|
|
{
|
|
/* line.addVertexAt(0,m_ptVertex1);
|
|
line.addVertexAt(1,m_ptMid);
|
|
line.addVertexAt(2,m_ptVertex4);*/
|
|
line1.setStartPoint(m_ptVertex1);
|
|
line1.setEndPoint(m_ptMid);
|
|
line2.setStartPoint(m_ptMid);
|
|
line2.setEndPoint(m_ptVertex4);
|
|
|
|
}
|
|
else
|
|
{
|
|
if (m_iQuadrant == kQuadrant1 || m_iQuadrant == kQuadrant4)
|
|
{
|
|
if (m_ptVertex1.x > m_ptVertex2.x)
|
|
{
|
|
/*line.addVertexAt(0,m_ptVertex1);
|
|
line.addVertexAt(1,m_ptMid);
|
|
line.addVertexAt(2,m_ptVertex2);*/
|
|
line1.setStartPoint(m_ptVertex1);
|
|
line1.setEndPoint(m_ptMid);
|
|
line2.setStartPoint(m_ptMid);
|
|
line2.setEndPoint(m_ptVertex2);
|
|
}
|
|
else
|
|
{
|
|
/* line.addVertexAt(0,m_ptVertex2);
|
|
line.addVertexAt(1,m_ptMid);
|
|
line.addVertexAt(2,m_ptVertex1);*/
|
|
line1.setStartPoint(m_ptVertex2);
|
|
line1.setEndPoint(m_ptMid);
|
|
line2.setStartPoint(m_ptMid);
|
|
line2.setEndPoint(m_ptVertex1);
|
|
}
|
|
|
|
}
|
|
else if (m_iQuadrant == kQuadrant3 || m_iQuadrant == kQuadrant2)
|
|
{
|
|
if (m_ptVertex1.x > m_ptVertex2.x)
|
|
{
|
|
/* line.addVertexAt(0,m_ptVertex2);
|
|
line.addVertexAt(1,m_ptMid);
|
|
line.addVertexAt(2,m_ptVertex1);*/
|
|
line1.setStartPoint(m_ptVertex2);
|
|
line1.setEndPoint(m_ptMid);
|
|
line2.setStartPoint(m_ptMid);
|
|
line2.setEndPoint(m_ptVertex1);
|
|
}
|
|
else
|
|
{
|
|
/*line.addVertexAt(0,m_ptVertex1);
|
|
line.addVertexAt(1,m_ptMid);
|
|
line.addVertexAt(2,m_ptVertex2);*/
|
|
line1.setStartPoint(m_ptVertex1);
|
|
line1.setEndPoint(m_ptMid);
|
|
line2.setStartPoint(m_ptMid);
|
|
line2.setEndPoint(m_ptVertex2);
|
|
}
|
|
}
|
|
}
|
|
TransformByEx(line1);
|
|
TransformByEx(line2);
|
|
dc.DrawEntity(line1);
|
|
dc.DrawEntity(line2);
|
|
}
|
|
//有停车
|
|
else if (m_iStyle == kCar)
|
|
{
|
|
AcDbBlockReference block(m_ptBlockCenter,m_idBlock);
|
|
|
|
if (m_bDirect)
|
|
{
|
|
AcGeMatrix3d matrix;
|
|
matrix.setToRotation(-0.5*PI,AcGeVector3d(0,0,1),m_ptBlockCenter);
|
|
block.transformBy(matrix);
|
|
}
|
|
AcGeMatrix3d matrix;
|
|
matrix.setToRotation(m_dAngle,AcGeVector3d(0,0,1),m_ptBlockCenter);
|
|
block.transformBy(matrix);
|
|
// add by gjm 2012/09/13
|
|
if (DocGetMeterUnitDraw())
|
|
{
|
|
AcGeMatrix3d mat3d;
|
|
mat3d.setToScaling(0.001);
|
|
block.transformBy(mat3d);
|
|
block.setPosition(m_ptBlockCenter);
|
|
}
|
|
// end
|
|
TransformByEx(block);
|
|
dc.DrawEntity(block);
|
|
}
|
|
return Acad::eOk;
|
|
}
|
|
|
|
void ATSParking::TransformByEx(AcDbEntity &ent) const
|
|
{
|
|
switch(m_iQuadrant)
|
|
{
|
|
case kQuadrant1:
|
|
{
|
|
}
|
|
break;
|
|
case kQuadrant4:
|
|
{
|
|
AcGeLine3d mirrorline;
|
|
mirrorline.set(m_ptVertex1.AsAcGePoint3d(),m_ptVertex2.AsAcGePoint3d());
|
|
AcGeMatrix3d matrit;
|
|
matrit.setToMirroring(mirrorline);
|
|
matrit(2,2) = 1;
|
|
ent.transformBy(matrit);
|
|
}
|
|
break;
|
|
case kQuadrant3:
|
|
{
|
|
XLine seg(m_ptVertex1,m_ptVertex2);
|
|
AcGePoint3d ptMid = seg.MidPoint();
|
|
AcGeLine3d mirrorline;
|
|
mirrorline.set(m_ptVertex1.AsAcGePoint3d(),m_ptVertex2.AsAcGePoint3d());
|
|
AcGeMatrix3d matrit;
|
|
matrit.setToMirroring(mirrorline);
|
|
matrit(2,2) = 1;
|
|
ent.transformBy(matrit);
|
|
mirrorline.rotateBy(0.5*PI,AcGeVector3d(0,0,1),ptMid);
|
|
matrit.setToMirroring(mirrorline);
|
|
matrit(2,2) = 1;
|
|
ent.transformBy(matrit);
|
|
}
|
|
break;
|
|
case kQuadrant2:
|
|
{
|
|
XLine seg(m_ptVertex1,m_ptVertex2);
|
|
AcGePoint3d ptMid = seg.MidPoint();
|
|
AcGeLine3d mirrorline;
|
|
mirrorline.set(m_ptVertex1.AsAcGePoint3d(),m_ptVertex2.AsAcGePoint3d());
|
|
mirrorline.rotateBy(0.5*PI,AcGeVector3d(0,0,1),ptMid);
|
|
AcGeMatrix3d matrit;
|
|
matrit.setToMirroring(mirrorline);
|
|
matrit(2,2) = 1;
|
|
ent.transformBy(matrit);
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
XPoint ATSParking::GetBasePt()
|
|
{
|
|
return m_ptVertex1;
|
|
}
|
|
XPoint ATSParking::GetPtText()
|
|
{
|
|
return m_ptText;
|
|
}
|
|
double ATSParking::GetRotAngle()
|
|
{
|
|
return m_dAngle;
|
|
} |