1056 lines
29 KiB
C++
1056 lines
29 KiB
C++
#include "stdafx.h"
|
|
//#include "DimJIg.h"
|
|
#include "anotate_export.h"
|
|
#include "dbDimension.h"
|
|
|
|
AcDbEntity* TMakeDim::makeRadius(
|
|
const AcGePoint3d &ptCnt
|
|
, const AcGePoint3d &ptEnd
|
|
)
|
|
{
|
|
TDbRadiusDim *pDim = new TDbRadiusDim;
|
|
pDim->SetLayoutRotation(Ucs2Wcs(0.0));
|
|
pDim->SetStyleId(InitDimStyle(DS_RADIUS));
|
|
pDim->SetDimCenter(ptCnt);
|
|
pDim->SetDimEndPoint(ptEnd);
|
|
double nDimDist = pDim->GetDimLen(FALSE);
|
|
if (nDimDist > ptCnt.distanceTo(ptEnd))
|
|
pDim->SetDimLen(-nDimDist, FALSE);
|
|
|
|
pDim->SetDiameter(FALSE);
|
|
return pDim;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeDiameter(
|
|
const AcGePoint3d &ptCnt
|
|
, const AcGePoint3d &ptEnd
|
|
)
|
|
{
|
|
TDbRadiusDim *pDim = new TDbRadiusDim;
|
|
pDim->SetLayoutRotation(Ucs2Wcs(0.0));
|
|
pDim->SetStyleId(InitDimStyle(DS_RADIUS));
|
|
pDim->SetDimCenter(ptCnt);
|
|
pDim->SetDimEndPoint(ptEnd);
|
|
|
|
TDbText text;
|
|
pDim->GetDimText(text); // if is default, then it is empty
|
|
XString sText = pDim->GetText();
|
|
text.SetText(sText);
|
|
XPoint ptExt = text.GetExtents();
|
|
if (pDim->GetRadius() < ptExt.x)
|
|
pDim->SetDimLen(-ptExt.x*1.5, FALSE);
|
|
|
|
pDim->SetDiameter(TRUE);
|
|
return pDim;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeAngle(
|
|
const AcGePoint3d &ptCen
|
|
, const AcGePoint3d &ptStart
|
|
, const AcGePoint3d &ptEnd
|
|
)
|
|
{
|
|
TDbDimension2 *pDim = new TDbDimension2;
|
|
pDim->SetAngular(TRUE);
|
|
pDim->SetDist2DimLine(2.0);
|
|
pDim->SetLayoutRotation(Ucs2Wcs(0));
|
|
pDim->SetStyleId(InitDimStyle(DS_LINEAR));
|
|
|
|
XPoint ptLoc;
|
|
ads_polar(asDblArray(ptStart)
|
|
, ads_angle(asDblArray(ptCen), asDblArray(ptStart)),
|
|
2.0*DocGetPScale(),
|
|
ptLoc);
|
|
pDim->SetLocation(ptLoc);
|
|
pDim->SetDimRadius(ptCen.distanceTo(ptStart));
|
|
pDim->SetRotation(CT_std_angle(ads_angle(asDblArray(ptCen), asDblArray(ptStart)) + PI / 2));
|
|
pDim->SetObjRadius(ptCen.distanceTo(ptStart) + 2.0*DocGetPScale());
|
|
|
|
XArc ar(asDblArray(ptCen), ptCen.distanceTo(ptStart)
|
|
, ads_angle(asDblArray(ptCen), asDblArray(ptStart))
|
|
, ads_angle(asDblArray(ptCen), asDblArray(ptEnd)));
|
|
|
|
if (pDim->IsValidSegment(ar.GetLength()))
|
|
pDim->AppendSegment(ar.GetLength());
|
|
|
|
pDim->SetLayoutRotation(Ucs2Wcs(0.0));
|
|
|
|
return pDim;
|
|
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeArc(
|
|
const AcGeCircArc3d &arc
|
|
, ETYPE type, double toDimLine
|
|
)
|
|
{
|
|
double xx = arc.radius();
|
|
double yy = arc.startAng();
|
|
double zz = arc.endAng();
|
|
AcGePoint3d ptC = arc.center();
|
|
|
|
// arDim 为要标注的对象
|
|
TGGeArc arDim(asDblArray(arc.center()), arc.radius(), arc.startAng(), arc.endAng());
|
|
|
|
// 创建出标注的arc对象
|
|
|
|
|
|
TDbDimension2 *pDim = new TDbDimension2;
|
|
TGGeCurveSegment segDim;
|
|
segDim = arDim;
|
|
|
|
pDim->SetStyleId(InitDimStyle(DS_LINEAR));
|
|
pDim->SetLocation(segDim.StartPoint());
|
|
pDim->SetRotation(segDim.IDirection(0));
|
|
pDim->SetAngular(TRUE);
|
|
pDim->SetObjRadius(arDim.GetRadius());
|
|
XArc arDimLine = arDim;
|
|
|
|
double dimRad(.0);
|
|
switch (type)
|
|
{
|
|
case TMakeDim::eAngle:
|
|
pDim->SetDimArcLen(FALSE);
|
|
pDim->SetDimChord(FALSE);
|
|
pDim->SetDist2DimLine(toDimLine);
|
|
dimRad = arDim.GetRadius() - toDimLine * DocGetPScale();
|
|
break;
|
|
case TMakeDim::eChord:
|
|
pDim->SetDimArcLen(FALSE);
|
|
pDim->SetDimChord(TRUE);
|
|
pDim->SetDist2DimLine(0.0);
|
|
dimRad = arDim.GetRadius();
|
|
break;
|
|
case TMakeDim::eArc:
|
|
pDim->SetDimArcLen(TRUE);
|
|
pDim->SetDimChord(FALSE);
|
|
pDim->SetDist2DimLine(toDimLine);
|
|
dimRad = arDim.GetRadius() - toDimLine * DocGetPScale();
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
pDim->SetDimRadius(dimRad);
|
|
arDimLine.SetRadius(dimRad);
|
|
pDim->AppendSegment(arDimLine.GetLength());
|
|
|
|
return pDim;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeMPoint(
|
|
const std::vector<AcGePoint3d> &pts
|
|
, double toDimLine
|
|
)
|
|
{
|
|
if (pts.size() < 2) return NULL;
|
|
|
|
TDbDimension2 *pDim = new TDbDimension2;
|
|
|
|
pDim->SetDist2DimLine(toDimLine);
|
|
pDim->SetLocation(pts[0]);
|
|
pDim->SetAngular(FALSE);
|
|
AcDbObjectId idDimStyle = InitDimStyle(DS_LINEAR);
|
|
pDim->SetStyleId(idDimStyle);
|
|
|
|
for (size_t i = 0; i < pts.size(); ++i)
|
|
{
|
|
if (i + 1 >= pts.size()) break;
|
|
pDim->AppendSegment(pts[i].distanceTo(pts[i+1]));
|
|
}
|
|
pDim->SetLayoutRotation(Ucs2Wcs(0.0));
|
|
return pDim;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::make2Point(
|
|
const AcGePoint3d &ptS
|
|
, const AcGePoint3d &ptE
|
|
, double toDimLine
|
|
)
|
|
{
|
|
std::vector<AcGePoint3d> pts(2);
|
|
pts[0] = ptS;
|
|
pts[1] = ptE;
|
|
return makeMPoint(pts, toDimLine);
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::make2Point(
|
|
const AcGePoint3d &ptS
|
|
, const AcGePoint3d &ptE
|
|
, LPCTSTR pszDim
|
|
, double toDimLine)
|
|
{
|
|
std::vector<AcGePoint3d> pts(2);
|
|
pts[0] = ptS;
|
|
pts[1] = ptE;
|
|
TDbDimension2 *pDim = (TDbDimension2*)makeMPoint(pts, toDimLine);
|
|
pDim->SetTextContent(0, pszDim);
|
|
return pDim;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeCoordDim(
|
|
const AcGePoint3d &ptLoc
|
|
, const AcGePoint3d &ptSec
|
|
, ETYPE Unit
|
|
, int precision
|
|
, ETYPE arrow
|
|
, ETYPE wcs
|
|
, ETYPE xy
|
|
, double NorthAng
|
|
)
|
|
{
|
|
TDbSymbCoord *pCoord = new TDbSymbCoord;
|
|
XPoint pt = ptLoc;
|
|
pt = Ucs2Wcs(pt);
|
|
XPoint ptWCS = pt;
|
|
|
|
ads_matrix mat;
|
|
XPoint().GetRotationMatrix(-NorthAng + PI*.5, mat);
|
|
|
|
if (wcs == eUCS)
|
|
pt = Wcs2Ucs(pt);
|
|
else
|
|
pt.TransformBy(mat);
|
|
|
|
double x, y;
|
|
if (Unit == emmM) // mm-M
|
|
{
|
|
x = _AS_METER(ptLoc.y);
|
|
y = _AS_METER(ptLoc.x);
|
|
}
|
|
else // M-M
|
|
{
|
|
x = ptLoc.y;
|
|
y = ptLoc.x;
|
|
}
|
|
|
|
if (fabs(x) < 1E-6)
|
|
x = 0;
|
|
if (fabs(y) < 1E-6)
|
|
y = 0;
|
|
|
|
pCoord->SetLocation(ptWCS);
|
|
pCoord->SetValue(XPoint(x, y));
|
|
pCoord->SetTextStyleId(InitTextStyle(TS_SYMBOL));
|
|
pCoord->SetAB(xy == eAB);
|
|
|
|
TDbSymbMultiLeader::TArrowStyle eArrowType = TDbSymbMultiLeader::kNone;
|
|
switch (arrow)
|
|
{
|
|
case eNoneArrow: eArrowType = TDbSymbMultiLeader::kNone; break;
|
|
case eCircle: eArrowType = TDbSymbMultiLeader::kDote; break;
|
|
case eArrow: eArrowType = TDbSymbMultiLeader::kArrow; break;
|
|
case eCross: eArrowType = TDbSymbMultiLeader::kCrossing; break;
|
|
default:eArrowType = TDbSymbMultiLeader::kNone; break;
|
|
}
|
|
|
|
pCoord->SetStyle(eArrowType);
|
|
pCoord->SetLayoutRotation(Ucs2Wcs(0.0));//modified by whl
|
|
pCoord->SetPrecNum(precision);
|
|
|
|
XPoint ptResult(ptSec);
|
|
XVector3D vt = ptResult - ptWCS;
|
|
double nAngle = ads_angle(XPoint(), vt);
|
|
|
|
nAngle = CT_std_angle(nAngle - Ucs2Wcs(0.0));//add by whl
|
|
|
|
Adesk::UInt8 nQuadrant;
|
|
if (nAngle >= 0.0 && nAngle < PI / 2)
|
|
nQuadrant = 0;
|
|
else if (nAngle >= PI / 2 && nAngle < PI)
|
|
nQuadrant = 1;
|
|
else if (nAngle >= PI && nAngle < PI*1.5)
|
|
nQuadrant = 2;
|
|
else
|
|
nQuadrant = 3;
|
|
XLine ln(ptWCS, nAngle);
|
|
pCoord->SetQuadrant(nQuadrant);//设置象限
|
|
pCoord->SetTurnPoint(ptResult);
|
|
|
|
return pCoord;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbCut(
|
|
const AcGePoint3d &ptS
|
|
, const AcGePoint3d &ptE
|
|
, double len
|
|
)
|
|
{
|
|
TDbSymbCut *pCut = new TDbSymbCut;
|
|
|
|
AcGeVector3d vt = ptS - ptE;
|
|
vt.rotateBy(PI * .5, AcGeVector3d::kZAxis);
|
|
vt.normalize();
|
|
vt *= len;
|
|
AcGePoint3d pt3 = ptE + vt;
|
|
AcGePoint3d pt4 = ptS + vt;
|
|
|
|
TGGePoly2D poly;
|
|
poly.AppendNode(ptS);
|
|
poly.AppendNode(ptE);
|
|
poly.AppendNode(pt3);
|
|
poly.AppendNode(pt4);
|
|
|
|
pCut->SetOutline(poly);
|
|
pCut->SetEdgeType(0, 1);
|
|
pCut->SetClipType(TGGiClipBoundary::kClipOut);
|
|
|
|
return pCut;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeDrawingNameSymb(
|
|
const AcGePoint3d &pt
|
|
, LPCTSTR pszName
|
|
, LPCTSTR pszScale
|
|
, double nameHeight
|
|
, double scaleHeight
|
|
, LPCTSTR pszNameStyle
|
|
, LPCTSTR pszScaleStyle
|
|
, bool bShowScale
|
|
, ETYPE Gb
|
|
)
|
|
{
|
|
AcDbObjectId nameStyleID(AcDbObjectId::kNull), scaleStyleID(AcDbObjectId::kNull);
|
|
|
|
if (!pszName || !pszNameStyle) return NULL;
|
|
nameStyleID = GetTextStyleId(pszNameStyle);
|
|
if (!nameStyleID) return NULL;
|
|
|
|
if (bShowScale)
|
|
{
|
|
if (!pszScale || !pszScaleStyle) return NULL;
|
|
scaleStyleID = GetTextStyleId(pszScaleStyle);
|
|
if (!scaleStyleID) return NULL;
|
|
}
|
|
|
|
TDbDrawingName *pEnt = new TDbDrawingName;
|
|
|
|
pEnt->SetNameText(pszName);
|
|
pEnt->SetNameStyleId(nameStyleID);
|
|
pEnt->SetNameHeight(nameHeight);
|
|
|
|
if (bShowScale)
|
|
{
|
|
pEnt->SetScaleText(pszScale);
|
|
pEnt->SetScaleStyleId(scaleStyleID);
|
|
pEnt->SetScaleHeight(scaleHeight);
|
|
}
|
|
|
|
pEnt->SetShowScale(bShowScale);
|
|
pEnt->SetDrawStyle(Gb == eGB ? 1 : 0);
|
|
pEnt->SetMidLocation(pt);
|
|
return pEnt;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbLeader(
|
|
const AcGePoint3d &pt1
|
|
, const AcGePoint3d &pt2
|
|
, double baseLen
|
|
, LPCTSTR pszUp
|
|
, LPCTSTR pszDown
|
|
, LPCTSTR pszStyle
|
|
, double height
|
|
, ETYPE arrow
|
|
, double arrowSize
|
|
, ETYPE align
|
|
)
|
|
{
|
|
if (!pszStyle) return NULL;
|
|
AcDbObjectId idStyle = GetTextStyleId(pszStyle);
|
|
if (!idStyle) return NULL;
|
|
|
|
TDbSymbMultiLeader *pEnt = new TDbSymbMultiLeader;
|
|
|
|
pEnt->SetTextStyleId(idStyle);
|
|
pEnt->SetTextHeight(height);
|
|
|
|
pEnt->SetText1(!pszUp ? _T("") : pszUp);
|
|
pEnt->SetText2(!pszDown ? _T("") : pszDown);
|
|
pEnt->SetArrowSize(arrowSize);
|
|
|
|
TDbSymbMultiLeader::TArrowStyle eArrowType = TDbSymbMultiLeader::kNone;
|
|
switch (arrow)
|
|
{
|
|
case TMakeDim::eNoneArrow: eArrowType = TDbSymbMultiLeader::kNone; break;
|
|
case TMakeDim::eCircle: eArrowType = TDbSymbMultiLeader::kDote; break;
|
|
case TMakeDim::eArrow: eArrowType = TDbSymbMultiLeader::kArrow; break;
|
|
case TMakeDim::eCross: eArrowType = TDbSymbMultiLeader::kCrossing; break;
|
|
default:eArrowType = TDbSymbMultiLeader::kNone; break;
|
|
}
|
|
pEnt->SetArrow(eArrowType);
|
|
|
|
TDbSymbMultiLeader::TSymbMLTextAlign nAlign = TDbSymbMultiLeader::kAtStart;
|
|
switch (align)
|
|
{
|
|
case TMakeDim::eBeginAlign: nAlign = TDbSymbMultiLeader::kAtStart; break;
|
|
case TMakeDim::eEndAlign: nAlign = TDbSymbMultiLeader::kAtEnd; break;
|
|
case TMakeDim::eMidAlign: nAlign = TDbSymbMultiLeader::kAtMiddle; break;
|
|
default: nAlign = TDbSymbMultiLeader::kAtStart; break;
|
|
}
|
|
|
|
pEnt->SetTextAlign(nAlign);
|
|
|
|
XPointList lstVertexes;
|
|
lstVertexes.Append(new XPoint(Ucs2Wcs(pt1)));
|
|
pEnt->SetLeaderVertexes(lstVertexes);
|
|
|
|
pEnt->SetLeaderPoint(pt2);
|
|
|
|
pEnt->SetTextBaseLen(baseLen, FALSE);
|
|
|
|
return pEnt;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbNode(
|
|
const AcGePoint3d &pt1
|
|
, const AcGePoint3d &pt2
|
|
, double baseLen // 文字基线长度
|
|
, LPCTSTR pszUp
|
|
, LPCTSTR pszStyle
|
|
, double height
|
|
, ETYPE arrow
|
|
, double arrowSize
|
|
, ETYPE align)
|
|
{
|
|
return makeSymbLeader(pt1, pt2, baseLen, pszUp, _T(""), pszStyle, height, arrow, arrowSize, align);
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeNorthThumb(
|
|
const AcGePoint3d &pt
|
|
, double ang
|
|
)
|
|
{
|
|
TDbSymbNorthThumb *pEnt = new TDbSymbNorthThumb;
|
|
pEnt->SetCenter(pt);
|
|
pEnt->SetRotation(ang);
|
|
return pEnt;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeNorthThumb(
|
|
const AcGePoint3d &pt
|
|
, const AcGePoint3d &ptAng
|
|
)
|
|
{
|
|
TDbSymbNorthThumb *pEnt = new TDbSymbNorthThumb;
|
|
pEnt->SetCenter(pt);
|
|
pEnt->SetRotation(ads_angle(asDblArray(pt), asDblArray(ptAng)));
|
|
return pEnt;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbArrow(
|
|
const AcGePoint3d &ptS
|
|
, const AcGePoint3d &ptE
|
|
, LPCTSTR pszUp
|
|
, LPCTSTR pszDown
|
|
, LPCTSTR pszStyle
|
|
, double height
|
|
, double arrowSize
|
|
, ETYPE arrow
|
|
, ETYPE align
|
|
)
|
|
{
|
|
if (!pszStyle) return NULL;
|
|
AcDbObjectId idStyle = GetTextStyleId(pszStyle);
|
|
if (!idStyle) return NULL;
|
|
|
|
TDbSymbArrow *pEnt = new TDbSymbArrow;
|
|
|
|
pEnt->SetTextStyleId(idStyle);
|
|
pEnt->SetTextHeight(height);
|
|
|
|
pEnt->SetText(!pszUp ? _T("") : pszUp);
|
|
pEnt->SetText2(!pszDown ? _T("") : pszDown);
|
|
|
|
pEnt->SetArrowSize(arrowSize);
|
|
|
|
TDbSymbArrow::TArrowType arType = TDbSymbArrow::kArrow;
|
|
switch (arrow)
|
|
{
|
|
case TMakeDim::eNoneArrow: arType = TDbSymbArrow::kNone; break;
|
|
case TMakeDim::eCircle: arType = TDbSymbArrow::kDote; break;
|
|
case TMakeDim::eArrow: arType = TDbSymbArrow::kArrow; break;
|
|
case TMakeDim::eHalfArrow: arType = TDbSymbArrow::kHalfArrow; break;
|
|
case TMakeDim::eCross: arType = TDbSymbArrow::kCrossing; break;
|
|
}
|
|
pEnt->SetArrowType(arType);
|
|
|
|
TDbSymbArrow::TArTextAlign txAlign = TDbSymbArrow::kAlignMid;
|
|
switch (align)
|
|
{
|
|
case TMakeDim::eSideLineAlign: txAlign = TDbSymbArrow::kAtSide; break;
|
|
case TMakeDim::eMidLineAlign: txAlign = TDbSymbArrow::kAlignMid; break;
|
|
case TMakeDim::eEndLineAlign: txAlign = TDbSymbArrow::kAlignEnd; break;
|
|
}
|
|
pEnt->SetTextAlign(txAlign);
|
|
|
|
TGGePoly2D poly;
|
|
poly.AppendNode(ptE);
|
|
poly.AppendNode(ptS);
|
|
pEnt->SetPoly2D(poly);
|
|
|
|
pEnt->SetShowText2(TRUE);
|
|
|
|
return pEnt;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbIndex(
|
|
const AcGePoint3d &pt1
|
|
, double dRadius
|
|
, const AcGePoint3d &pt2
|
|
, double baseLen
|
|
, LPCTSTR pszIdxUp
|
|
, LPCTSTR pszIdxDown
|
|
, LPCTSTR pszDimUp
|
|
, LPCTSTR pszDimDown
|
|
, LPCTSTR pszIdxStyle
|
|
, LPCTSTR pszDimStyle
|
|
, double height
|
|
, ETYPE align
|
|
)
|
|
{
|
|
if (!pszIdxStyle || !pszDimStyle) return NULL;
|
|
|
|
AcDbObjectId idIdxStyle = GetTextStyleId(pszIdxStyle);
|
|
AcDbObjectId idDimStyle = GetTextStyleId(pszDimStyle);
|
|
|
|
if (!idIdxStyle || !idDimStyle) return NULL;
|
|
|
|
TDbSymbIndexPointer *pEnt = new TDbSymbIndexPointer;
|
|
|
|
pEnt->SetTextStyleId(idIdxStyle);
|
|
pEnt->SetDimTextStyle(idDimStyle);
|
|
pEnt->SetTextHeight(height);
|
|
|
|
pEnt->SetText1(!pszDimUp ? _T("") : pszDimUp);
|
|
pEnt->SetText2(!pszDimDown ? _T("") : pszDimDown);
|
|
pEnt->SetIndexLabel(!pszIdxUp ? _T("") : pszIdxUp);
|
|
pEnt->SetDrawingLabel(!pszIdxDown ? _T("") : pszIdxDown);
|
|
pEnt->SetIndexPointer(TRUE);
|
|
|
|
TDbSymbIndexPointer::TSymbIPTextAlign nAlign = TDbSymbIndexPointer::kAtStart;
|
|
switch (align)
|
|
{
|
|
case TMakeDim::eBeginAlign: nAlign = TDbSymbIndexPointer::kAtStart; break;
|
|
case TMakeDim::eEndAlign: nAlign = TDbSymbIndexPointer::kAtEnd; break;
|
|
case TMakeDim::eMidAlign: nAlign = TDbSymbIndexPointer::kAtMiddle; break;
|
|
default: nAlign = TDbSymbIndexPointer::kAtStart; break;
|
|
}
|
|
pEnt->SetTextAlign(nAlign);
|
|
|
|
|
|
pEnt->SetStartPoint(pt1); // 起点
|
|
pEnt->SetSourceExtent(dRadius*2.0);
|
|
pEnt->SetTurnPoint(pt2); // 转折点
|
|
pEnt->SetTextBaseLen(baseLen, FALSE); // 文字基线长度
|
|
|
|
return pEnt;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbIndexDim(
|
|
const AcGePoint3d &pt
|
|
, LPCTSTR pszUp
|
|
, LPCTSTR pszDown
|
|
, LPCTSTR pszScale
|
|
, LPCTSTR pszStyleDim
|
|
, LPCTSTR pszStyleScale
|
|
, double height
|
|
, double radius
|
|
, double lw
|
|
)
|
|
{
|
|
if (!pszStyleScale || !pszStyleDim) return NULL;
|
|
|
|
AcDbObjectId idStyleScale = GetTextStyleId(pszStyleScale);
|
|
AcDbObjectId idStyleDim = GetTextStyleId(pszStyleDim);
|
|
|
|
if (!idStyleDim || !idStyleScale) return NULL;
|
|
|
|
TDbSymbDrawingIndex *pEnt = new TDbSymbDrawingIndex;
|
|
pEnt->SetLayoutRotation(Ucs2Wcs(0.0));
|
|
|
|
pEnt->SetDrawingLabel(!pszDown ? _T("") : pszDown); //图号
|
|
pEnt->SetIndexLabel(!pszUp ? _T("") : pszUp); //编号
|
|
pEnt->SetTextStyleId(idStyleDim);
|
|
pEnt->SetScaleStyleId(idStyleScale);
|
|
|
|
pEnt->SetScaleTextHeight(height);
|
|
pEnt->SetDrawScale(pszScale != NULL);
|
|
pEnt->SetScaleText(!pszScale ? _T("") : pszScale);
|
|
|
|
pEnt->SetCenter(pt);
|
|
|
|
pEnt->SetRadius(radius);
|
|
pEnt->SetLineWidth(lw);
|
|
|
|
return pEnt;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbSection(
|
|
const AcGePoint3d &pt1
|
|
, const AcGePoint3d &pt2
|
|
, const AcGePoint3d &ptDir
|
|
, LPCTSTR pszLable
|
|
, LPCTSTR pszDrawing
|
|
, ETYPE sectionType
|
|
, LPCTSTR pszStyleLable
|
|
, LPCTSTR pszStyleDrawing
|
|
, double heightLable
|
|
, double heightDrawing
|
|
, ETYPE drawingPos
|
|
, ETYPE drawingDir)
|
|
{
|
|
if (!pszStyleLable || !pszStyleDrawing) return NULL;
|
|
|
|
AcDbObjectId idStyleLable = GetTextStyleId(pszStyleLable);
|
|
AcDbObjectId idStyleDrawing = GetTextStyleId(pszStyleDrawing);
|
|
|
|
if (!idStyleLable || !idStyleDrawing) return NULL;
|
|
|
|
|
|
TDbSymbSection *pEnt = new TDbSymbSection;
|
|
|
|
pEnt->SetLayoutRotation(Ucs2Wcs(0.0));
|
|
|
|
pEnt->SetText(!pszLable ? _T("") : pszLable);
|
|
pEnt->SetTextHeight(heightLable);
|
|
pEnt->SetTextStyleId(idStyleLable);
|
|
|
|
pEnt->SetDrawingIndex(!pszDrawing ? _T("") : pszDrawing);
|
|
pEnt->SetIndexHeight(heightDrawing);
|
|
pEnt->SetIndexStyleId(idStyleDrawing);
|
|
|
|
int sectionMode = 4;
|
|
switch (sectionType)
|
|
{
|
|
case TMakeDim::eZJPQ: sectionMode = 1; break;
|
|
case TMakeDim::eDMPQ: sectionMode = 4; break;
|
|
default: sectionMode = 4; break;
|
|
}
|
|
|
|
if (sectionMode == 4)
|
|
pEnt->SetViewLine(FALSE);
|
|
|
|
int sectionLoc = 0;
|
|
|
|
switch (drawingPos)
|
|
{
|
|
case TMakeDim::e2Pos: sectionLoc = 0; break;
|
|
case TMakeDim::eEndPos: sectionLoc = 1; break;
|
|
case TMakeDim::eStartPos: sectionLoc = 2; break;
|
|
default: sectionLoc = 0; break;
|
|
}
|
|
|
|
if (sectionLoc == 0) //两端显示
|
|
{
|
|
pEnt->SetIsHasIndexS(TRUE);
|
|
pEnt->SetIsHasIndexE(TRUE);
|
|
}
|
|
else if (sectionLoc == 1)//始端显示
|
|
{
|
|
pEnt->SetIsHasIndexS(TRUE);
|
|
pEnt->SetIsHasIndexE(FALSE);
|
|
}
|
|
else if (sectionLoc == 2)//末端显示
|
|
{
|
|
pEnt->SetIsHasIndexS(FALSE);
|
|
pEnt->SetIsHasIndexE(TRUE);
|
|
}
|
|
|
|
int sectionDir = 0;
|
|
switch (drawingDir)
|
|
{
|
|
case TMakeDim::ePQWZX: sectionDir = 0; break;
|
|
case TMakeDim::ePSFXX: sectionDir = 1; break;
|
|
default: sectionDir = 0; break;
|
|
}
|
|
pEnt->SetDimDirection(sectionDir);
|
|
|
|
XLine line(asDblArray(pt1), asDblArray(pt2));
|
|
int side = line.OnWhichSide(ptDir);
|
|
|
|
if (side == OFFSET_LEFT)
|
|
pEnt->SetViewDirection(CT_std_angle(ads_angle(asDblArray(pt1), asDblArray(pt2))) + PI * .5);
|
|
else
|
|
pEnt->SetViewDirection(CT_std_angle(ads_angle(asDblArray(pt1), asDblArray(pt2))) - PI * .5);
|
|
|
|
|
|
TGGePoly2D poly;
|
|
poly.AppendNode(pt1);
|
|
poly.AppendNode(pt2);
|
|
pEnt->SetPoly2D(poly);
|
|
|
|
return pEnt;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbElevation1(
|
|
const AcGePoint3d &pt
|
|
, LPCTSTR pszText
|
|
, LPCTSTR pszStyle
|
|
, double height
|
|
, bool bHasBaseLine
|
|
, double baseLen
|
|
, bool bHasLeaderLine
|
|
, double leaderLen
|
|
, bool bPre2
|
|
)
|
|
{
|
|
if (!pszStyle) return NULL;
|
|
AcDbObjectId idStyle = GetTextStyleId(pszStyle);
|
|
if (!idStyle) return NULL;
|
|
|
|
TDbSymbElevation *pEnt = new TDbSymbElevation;
|
|
|
|
pEnt->SetTextStyleId(idStyle);
|
|
|
|
pEnt->SetLocation(pt);
|
|
pEnt->SetText(!pszText ? _T("") : pszText);
|
|
pEnt->SetTextHeight(height);
|
|
pEnt->SetTextBaseLen(pEnt->GetDefaultTextBaseLen());
|
|
pEnt->SetPrec2(bPre2);
|
|
|
|
pEnt->SetLeader(bHasLeaderLine);
|
|
pEnt->SetBaseLine(bHasBaseLine);
|
|
if (bHasBaseLine)
|
|
pEnt->SetBaseLen(baseLen);
|
|
if (bHasLeaderLine)
|
|
pEnt->SetLeaderLen(baseLen);
|
|
|
|
return pEnt;
|
|
}
|
|
|
|
double TMakeDim::getElevation(AcDbEntity *pEnt)
|
|
{
|
|
if (!pEnt) return false;
|
|
if (!pEnt->isKindOf(TDbSymbElevation::desc())) return .0;
|
|
TDbSymbElevation *pElev = (TDbSymbElevation*)pEnt;
|
|
double dd(.0);
|
|
pElev->GetElev1(dd);
|
|
return dd;
|
|
}
|
|
|
|
bool TMakeDim::modifyElevation(AcDbEntity *pEnt, LPCTSTR sElev)
|
|
{
|
|
if (!pEnt) return false;
|
|
if (!sElev) return false;
|
|
if (!pEnt->isKindOf(TDbSymbElevation::desc())) return false;
|
|
TDbSymbElevation *pElev = (TDbSymbElevation*)pEnt;
|
|
pElev->SetText(sElev);
|
|
return true;
|
|
}
|
|
|
|
AcDbEntity* TMakeDim::makeSymbElevation2(
|
|
const AcGePoint3d &pt
|
|
, LPCTSTR pszText
|
|
, LPCTSTR pszStyle
|
|
, double height
|
|
, bool bPre2
|
|
)
|
|
{
|
|
if (!pszStyle) return NULL;
|
|
AcDbObjectId idStyle = GetTextStyleId(pszStyle);
|
|
if (!idStyle) return NULL;
|
|
|
|
TDbSymbElevation *pEnt = new TDbSymbElevation;
|
|
|
|
pEnt->SetTextStyleId(idStyle);
|
|
|
|
pEnt->SetLocation(pt);
|
|
pEnt->SetText(!pszText ? _T("") : pszText);
|
|
pEnt->SetTextHeight(height);
|
|
pEnt->SetHollowTriangle(TRUE);
|
|
pEnt->SetTextBaseLen(3.);
|
|
pEnt->SetPrec2(bPre2);
|
|
|
|
return pEnt;
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeRadius(
|
|
const AcGePoint3d &ptCnt /* 圆心 */
|
|
, const AcGePoint3d &ptEnd /* 圆上的标注点 */)
|
|
{
|
|
return TMakeDim::makeRadius(ptCnt, ptEnd);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeDiameter(
|
|
const AcGePoint3d &ptCnt /* 圆心 */
|
|
, const AcGePoint3d &ptEnd /* 圆上的标注点 */)
|
|
{
|
|
return TMakeDim::makeDiameter(ptCnt, ptEnd);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeAngle(
|
|
const AcGePoint3d &ptCnt /* 圆心 */
|
|
, const AcGePoint3d &ptStart /* 标注起始点 */
|
|
, const AcGePoint3d &ptEnd /* 标注终止点 */)
|
|
{
|
|
return TMakeDim::makeAngle(ptCnt, ptStart, ptEnd);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeArc(
|
|
const AcGeCircArc3d &arc /* 要标注的对象(圆弧对象) */
|
|
, TMakeDim::ETYPE type /* 标注类型 */
|
|
, double toDimLine /* 定位点到尺寸线的距离, 可以为负值, 图纸单位 */)
|
|
{
|
|
return TMakeDim::makeArc(arc, type, toDimLine);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeMPoint(
|
|
const std::vector<AcGePoint3d> &pts /* 点组,数量不小于2 */
|
|
, double toDimLine /* 定位点到尺寸线的距离, 可以为负值, 图纸单位 */)
|
|
{
|
|
return TMakeDim::makeMPoint(pts, toDimLine);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* make2Point(
|
|
const AcGePoint3d &ptS /* 要标注的起点 */
|
|
, const AcGePoint3d &ptE /* 要标注的终点 */
|
|
, double toDimLine /* 定位点到尺寸线的距离, 可以为负值, 图纸单位 */)
|
|
{
|
|
return TMakeDim::make2Point(ptS, ptE, toDimLine);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* make2Point2(
|
|
const AcGePoint3d &ptS /* 要标注的起点 */
|
|
, const AcGePoint3d &ptE /* 要标注的终点 */
|
|
, LPCTSTR pszDim
|
|
, double toDimLine /* 定位点到尺寸线的距离, 可以为负值, 图纸单位 */)
|
|
{
|
|
return TMakeDim::make2Point(ptS, ptE, pszDim, toDimLine);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeCoordDim(
|
|
const AcGePoint3d &ptLoc /* 要标注的点 */
|
|
, const AcGePoint3d &ptSec /* 转折点 */
|
|
, TMakeDim::ETYPE Unit /*= TMakeDim::emmM /* 绘图单位 */
|
|
, int precision /*= 3 /* 精度 */
|
|
, TMakeDim::ETYPE arrow /*= TMakeDim::eNoneArrow /* 箭头样式 */
|
|
, TMakeDim::ETYPE wcs /*= TMakeDim::eWCS /* 坐标取值 */
|
|
, TMakeDim::ETYPE xy /*= TMakeDim::eXY /* 坐标类型 */
|
|
, double NorthAng /*= 90. /* 北向角度 */)
|
|
{
|
|
return TMakeDim::makeCoordDim(ptLoc, ptSec, Unit, precision, arrow, wcs, xy, NorthAng);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbCut(
|
|
const AcGePoint3d &ptS /* 起点 */
|
|
, const AcGePoint3d &ptE /* 终点 */
|
|
, double len /* 向外延伸长度 */)
|
|
{
|
|
return TMakeDim::makeSymbCut(ptS, ptE, len);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeDrawingNameSymb(
|
|
const AcGePoint3d &pt /* 标注点 */
|
|
, LPCTSTR pszName /* 标注文字 */
|
|
, LPCTSTR pszScale /* 比例文字 */
|
|
, double nameheight /*= 7. /* 标注文字字高 */
|
|
, double scaleheight /*= 5. /* 比例文字字高 */
|
|
, LPCTSTR pszNameStyle /*= _T("STANDARD") /* 标注文字样式 */
|
|
, LPCTSTR pszScaleStyle /*= _T("STANDARD") /* 比例文字样式 */
|
|
, bool bShowScale /*= true /* 是否显示比例 */
|
|
, TMakeDim::ETYPE Gb /*= TMakeDim::eOld /* 图名标注标准 */)
|
|
{
|
|
return TMakeDim::makeDrawingNameSymb(pt, pszName, pszScale, nameheight, scaleheight, pszNameStyle, pszScaleStyle, bShowScale, Gb);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbLeader(
|
|
const AcGePoint3d &pt1 /* 标注点 */
|
|
, const AcGePoint3d &pt2 /* 转折点 */
|
|
, double baseLen /* 文字基线长度 */
|
|
, LPCTSTR pszUp /* 上标文字 */
|
|
, LPCTSTR pszDown /* 下标文字 */
|
|
, LPCTSTR pszStyle /*= _T("STANDARD") /* 文字样式 */
|
|
, double height /*= 3.5 /* 字高 */
|
|
, TMakeDim::ETYPE arrow /*= TMakeDim::eNoneArrow /* 箭头样式 */
|
|
, double arrowSize /*= 3.0 /* 箭头大小 */
|
|
, TMakeDim::ETYPE align /*= TMakeDim::eMidAlign /* 文字相对基线对齐方式 */)
|
|
{
|
|
return TMakeDim::makeSymbLeader(pt1, pt2, baseLen, pszUp, pszDown, pszStyle, height, arrow, arrowSize, align);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbNode(
|
|
const AcGePoint3d &pt1 /* 标注点 */
|
|
, const AcGePoint3d &pt2 /* 转折点 */
|
|
, double baseLen /* 文字基线长度 */
|
|
, LPCTSTR pszUp /* 上标文字 */
|
|
, LPCTSTR pszStyle /*= _T("STANDARD") /* 文字样式 */
|
|
, double height /*= 3.5 /* 字高 */
|
|
, TMakeDim::ETYPE arrow /*= TMakeDim::eNoneArrow /* 箭头样式 */
|
|
, double arrowSize /*= 3.0 /* 箭头大小 */
|
|
, TMakeDim::ETYPE align /*= TMakeDim::eBeginAlign /* 文字相对基线对齐方式 */)
|
|
{
|
|
return TMakeDim::makeSymbNode(pt1, pt2, baseLen, pszUp, pszStyle, height, arrow, arrowSize, align);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeNorthThumb(
|
|
const AcGePoint3d &pt /* 插入点 */
|
|
, const AcGePoint3d &ptAng /* 取另一个点, 用 pt 和 ptAng 来判断指向角度 */)
|
|
{
|
|
return TMakeDim::makeNorthThumb(pt, ptAng);
|
|
}
|
|
|
|
// extern "C" __declspec(dllexport) AcDbEntity* makeNorthThumb(
|
|
// const AcGePoint3d &pt // 插入点
|
|
// , double ang // 指向角度
|
|
// )
|
|
// {
|
|
// return TMakeDim::makeNorthThumb(pt, ang);
|
|
// }
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbArrow(
|
|
const AcGePoint3d &ptS /* 起点 */
|
|
, const AcGePoint3d &ptE /* 终点 */
|
|
, LPCTSTR pszUp /* 上标文字 */
|
|
, LPCTSTR pszDown /* 下标文字 */
|
|
, LPCTSTR pszStyle /*= _T("STANDARD") /* 文字样式 */
|
|
, double height /*= 3.5 /* 字高 */
|
|
, double arrowSize /*= 3.0 /* 箭头大小 */
|
|
, TMakeDim::ETYPE arrow /*= TMakeDim::eArrow /* 箭头样式 */
|
|
, TMakeDim::ETYPE align /*= TMakeDim::eMidLineAlign /* 对齐方式 */)
|
|
{
|
|
return TMakeDim::makeSymbArrow(ptS, ptE, pszUp, pszDown, pszStyle, height, arrowSize, arrow, align);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbIndex(
|
|
const AcGePoint3d &pt1 /* 起始点 */
|
|
, double dRadius /* 范围半径 */
|
|
, const AcGePoint3d &pt2 /* 转折点 */
|
|
, double baseLen /* 文字基线长度 */
|
|
, LPCTSTR pszIdxUp /* 索引编号 */
|
|
, LPCTSTR pszIdxDown /* 索引图号 */
|
|
, LPCTSTR pszDimUp /* 上标文字 */
|
|
, LPCTSTR pszDimDown /* 下标文字 */
|
|
, LPCTSTR pszIdxStyle /*= _T("STANDARD") /* 索引文字样式 */
|
|
, LPCTSTR pszDimStyle /*= _T("STANDARD") /* 标注文字样式 */
|
|
, double height /*= 3.5 /* 标注文字字高 */
|
|
, TMakeDim::ETYPE align /*= TMakeDim::eEndAlign /* 标注对齐方式 */)
|
|
{
|
|
return TMakeDim::makeSymbIndex(pt1, dRadius, pt2, baseLen, pszIdxUp, pszIdxDown, pszDimUp, pszDimDown, pszIdxStyle, pszDimStyle, height, align);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbIndexDim(
|
|
const AcGePoint3d &pt /* 插入点 */
|
|
, LPCTSTR pszUp /* 上标文字 */
|
|
, LPCTSTR pszDown /*= NULL /* 下标文字 */
|
|
, LPCTSTR pszScale /*= NULL /* 比例文字 */
|
|
, LPCTSTR pszStyleDim /*= _T("STANDARD") /* 标注文字样式 */
|
|
, LPCTSTR pszStyleScale /*= _T("STANDARD") /* 比例文字样式 */
|
|
, double height /*= 3.5 /* 字高 */
|
|
, double radius /*= 7 /* 半径 */
|
|
, double lw /*= .5 /* 线宽 */)
|
|
{
|
|
return TMakeDim::makeSymbIndexDim(pt, pszUp, pszDown, pszScale, pszStyleDim, pszStyleScale, height, radius, lw);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbSection(
|
|
const AcGePoint3d &pt1 /* 起点 */
|
|
, const AcGePoint3d &pt2 /* 终点 */
|
|
, const AcGePoint3d &ptDir /*方向点*/
|
|
, LPCTSTR pszLable /* 编号文字 */
|
|
, LPCTSTR pszDrawing /*= NULL /* 图号文字 */
|
|
, TMakeDim::ETYPE sectionType /*= TMakeDim::eDMPQ /* 标注样式 */
|
|
, LPCTSTR pszStyleLable /*= _T("STANDARD") /* 标注文字样式 */
|
|
, LPCTSTR pszStyleDrawing /*= _T("STANDARD") /* 比例文字样式 */
|
|
, double heightLable /*= 5.0 /* 编号字高 */
|
|
, double heightDrawing /*= 3.5 /* 图号字高 */
|
|
, TMakeDim::ETYPE drawingPos /*= TMakeDim::e2Pos /* 图号位置类型 */
|
|
, TMakeDim::ETYPE drawingDir /*= TMakeDim::ePQWZX /* 图号方向 */)
|
|
{
|
|
return TMakeDim::makeSymbSection(pt1, pt2, ptDir, pszLable, pszDrawing, sectionType, pszStyleLable, pszStyleDrawing, heightLable, heightDrawing, drawingPos, drawingDir);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbElevation1(
|
|
const AcGePoint3d &pt /* 插入点 */
|
|
, LPCTSTR pszText /* 标注文字 */
|
|
, LPCTSTR pszStyle /*= _T("STANDARD") /* 标注文字样式 */
|
|
, double height /*= 3.5 /* 字高 */
|
|
, bool bHasBaseLine /*= false /* 带基线? */
|
|
, double baseLen /*= 0. /* 基线长度 */
|
|
, bool bHasLeaderLine /*= false /* 带引线? */
|
|
, double leaderLen /*= 0. /* 引线长度 */
|
|
, bool bPre2 /*= true /* 精度为2,否为3 */)
|
|
{
|
|
return TMakeDim::makeSymbElevation1(pt, pszText, pszStyle, height, bHasBaseLine, baseLen, bHasLeaderLine, leaderLen, bPre2);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) AcDbEntity* makeSymbElevation2(
|
|
const AcGePoint3d &pt /* 插入点 */
|
|
, LPCTSTR pszText /* 标注文字 */
|
|
, LPCTSTR pszStyle /*= _T("STANDARD") /* 标注文字样式 */
|
|
, double height /*= 3.5 /* 字高 */
|
|
, bool bPre2 /*= true /* 精度为2,否为3 */)
|
|
{
|
|
return TMakeDim::makeSymbElevation2(pt, pszText, pszStyle, height, bPre2);
|
|
}
|
|
|
|
|
|
extern "C" __declspec(dllexport) double getElevation(AcDbEntity *pEnt)
|
|
{
|
|
return TMakeDim::getElevation(pEnt);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool modifyElevation(AcDbEntity * pEnt, LPCTSTR sElev)
|
|
{
|
|
return TMakeDim::modifyElevation(pEnt, sElev);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool setObjId2DataMap(AcDbEntity* pEnt, LPCTSTR pszKey, const AcDbObjectId& idValue)
|
|
{
|
|
return TMakeDim::setData2DataMap<AcDbObjectId>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool getObjIdByDataMap(AcDbEntity* pEnt, LPCTSTR pszKey, AcDbObjectId& idValue)
|
|
{
|
|
return TMakeDim::getDataByDataMap<AcDbObjectId>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool setInteger2DataMap(AcDbEntity* pEnt, LPCTSTR pszKey, const int& idValue)
|
|
{
|
|
return TMakeDim::setData2DataMap<int>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool getIntegerByDataMap(AcDbEntity* pEnt, LPCTSTR pszKey, int& idValue)
|
|
{
|
|
return TMakeDim::getDataByDataMap<int>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool setPt3d2DataMap(AcDbEntity * pEnt, LPCTSTR pszKey, const AcGePoint3d &idValue)
|
|
{
|
|
return TMakeDim::setData2DataMap<AcGePoint3d>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool getPt3dByDataMap(AcDbEntity * pEnt, LPCTSTR pszKey, AcGePoint3d &idValue)
|
|
{
|
|
return TMakeDim::getDataByDataMap<AcGePoint3d>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool setStr2DataMap(AcDbEntity * pEnt, LPCTSTR pszKey, const CString &idValue)
|
|
{
|
|
return TMakeDim::setData2DataMap<CString>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool getStrByDataMap(AcDbEntity * pEnt, LPCTSTR pszKey, CString &idValue)
|
|
{
|
|
return TMakeDim::getDataByDataMap<CString>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool setDouble2DataMap(AcDbEntity * pEnt, LPCTSTR pszKey, const double &idValue)
|
|
{
|
|
return TMakeDim::setData2DataMap<double>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool getDoubleByDataMap(AcDbEntity * pEnt, LPCTSTR pszKey, double &idValue)
|
|
{
|
|
return TMakeDim::getDataByDataMap<double>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool setVec3d2DataMap(AcDbEntity * pEnt, LPCTSTR pszKey, const AcGeVector3d &idValue)
|
|
{
|
|
return TMakeDim::setData2DataMap<AcGeVector3d>(pEnt, pszKey, idValue);
|
|
}
|
|
|
|
extern "C" __declspec(dllexport) bool getVec3dByDataMap(AcDbEntity * pEnt, LPCTSTR pszKey, AcGeVector3d &idValue)
|
|
{
|
|
return TMakeDim::getDataByDataMap<AcGeVector3d>(pEnt, pszKey, idValue);
|
|
}
|