Position DPGI Dimensions correctly in Dxf file

This commit is contained in:
wandererfan
2018-06-02 09:31:48 -04:00
parent 881059fd61
commit d3befd1801

View File

@@ -608,8 +608,19 @@ private:
if (dvp == nullptr) {
continue;
}
double parentX = dvp->X.getValue();
double parentY = dvp->Y.getValue();
double grandParentX = 0.0;
double grandParentY = 0.0;
if (dvp->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())) {
TechDraw::DrawProjGroupItem* dpgi = static_cast<TechDraw::DrawProjGroupItem*>(dvp);
TechDraw::DrawProjGroup* dpg = dpgi->getPGroup();
if (dpg == nullptr) {
continue;
}
grandParentX = dpg->X.getValue();
grandParentY = dpg->Y.getValue();
}
double parentX = dvp->X.getValue() + grandParentX;
double parentY = dvp->Y.getValue() + grandParentY;
Base::Vector3d parentPos(parentX,parentY,0.0);
std::string sDimText = dvd->getFormatedValue();
char* dimText = &sDimText[0u]; //hack for const-ness