|
[code]AcGePoint3dArray TPGTag::GetBoundingBox() const
{
assertReadEnabled();
AcGePoint3dArray pts;
AcDbObjectId obj = objectId();
if(obj.isValid())
{
ads_name name;
if(acdbGetAdsName(name, obj) == Acad::eOk)
{
struct resbuf* textent = NULL;
textent = acdbEntGet(name);
if(textent != NULL)
{
// Get the origin, Group Code 10
struct resbuf* entdata = entitem(textent,10);
ads_point origin;
origin = entdata->resval.rpoint;
origin = entdata->resval.rpoint;
origin = 0;
// Get the low left and upper right of the text box.
ads_point ll, ur;
int error = acedTextBox(textent, ll, ur);
if(error != RTNORM)
{
}
ads_real rotation, srot, crot;
entdata = entitem(textent, 50);
rotation = entdata->resval.rreal;
srot = sin(rotation);
crot = cos(rotation);
AcGePoint3d pt(0,0,0);
pt.x = origin + (ll*crot - ll*srot);
pt.y = origin + (ll*srot + ll*crot);
pts.append(pt);
pt.set(0,0,0);
pt.x = origin + (ur*crot - ll*srot);
pt.y = origin + (ur*srot + ll*crot);
pts.append(pt);
pt.set(0,0,0);
pt.x = origin + (ur*crot - ur*srot);
pt.y = origin + (ur*srot + ur*crot);
pts.append(pt);
pt.set(0,0,0);
pt.x = origin + (ll*crot - ur*srot);
pt.y = origin + (ll*srot + ur*crot); ;
pts.append(pt);
pt.set(0,0,0);
acutRelRb(textent);
}
}
}
return pts;
}[/code] |
|