[TD]Refactor Dimensions for 3d upgrade
- separate validation, geometry and reference handling into individual files - improve 3d reference geometry handling - eliminate duplicate dim creation code - add Dimension reference repair dialog - Refactor formatting out of DrawViewDimension - move dimension repaint control to ViewProvider
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
#include "DrawUtil.h"
|
||||
#include "DrawViewAnnotation.h"
|
||||
#include "DrawViewDimension.h"
|
||||
#include "DimensionGeometry.h"
|
||||
#include "DrawViewPart.h"
|
||||
#include "DrawViewPartPy.h"
|
||||
#include "EdgeWalker.h"
|
||||
@@ -725,13 +726,13 @@ private:
|
||||
Base::Vector3d textLocn(dvd->X.getValue() + parentX, dvd->Y.getValue() + parentY, 0.0);
|
||||
Base::Vector3d lineLocn(dvd->X.getValue() + parentX, dvd->Y.getValue() + parentY, 0.0);
|
||||
pointPair pts = dvd->getLinearPoints();
|
||||
Base::Vector3d dimLine = pts.first - pts.second;
|
||||
Base::Vector3d dimLine = pts.first() - pts.second();
|
||||
Base::Vector3d norm(-dimLine.y, dimLine.x, 0.0);
|
||||
norm.Normalize();
|
||||
lineLocn = lineLocn + (norm * gap);
|
||||
Base::Vector3d extLine1Start = Base::Vector3d(pts.first.x, -pts.first.y, 0.0) +
|
||||
Base::Vector3d extLine1Start = Base::Vector3d(pts.first().x, - pts.first().y, 0.0) +
|
||||
Base::Vector3d(parentX, parentY, 0.0);
|
||||
Base::Vector3d extLine2Start = Base::Vector3d(pts.second.x, -pts.second.y, 0.0) +
|
||||
Base::Vector3d extLine2Start = Base::Vector3d(pts.second().x, - pts.second().y, 0.0) +
|
||||
Base::Vector3d(parentX, parentY, 0.0);
|
||||
if (dvd->Type.isValue("DistanceX") ) {
|
||||
type = 1;
|
||||
@@ -743,12 +744,12 @@ private:
|
||||
Base::Vector3d textLocn(dvd->X.getValue() + parentX, dvd->Y.getValue() + parentY, 0.0);
|
||||
Base::Vector3d lineLocn(dvd->X.getValue() + parentX, dvd->Y.getValue() + parentY, 0.0);
|
||||
anglePoints pts = dvd->getAnglePoints();
|
||||
Base::Vector3d end1 = pts.ends.first;
|
||||
Base::Vector3d end1 = pts.first();
|
||||
end1.y = -end1.y;
|
||||
Base::Vector3d end2 = pts.ends.second;
|
||||
Base::Vector3d end2 = pts.second();
|
||||
end2.y = -end2.y;
|
||||
|
||||
Base::Vector3d apex = pts.vertex;
|
||||
Base::Vector3d apex = pts.vertex();
|
||||
apex.y = -apex.y;
|
||||
apex = apex + parentPos;
|
||||
|
||||
@@ -766,7 +767,7 @@ private:
|
||||
Base::Vector3d center = pts.center;
|
||||
center.y = -center.y;
|
||||
center = center + parentPos;
|
||||
Base::Vector3d lineDir = (arrowPts.first - arrowPts.second).Normalize();
|
||||
Base::Vector3d lineDir = (arrowPts.first() - arrowPts.second()).Normalize();
|
||||
Base::Vector3d arcPoint = center + lineDir * pts.radius;
|
||||
writer.exportRadialDim(center, textLocn, arcPoint, dimText);
|
||||
} else if(dvd->Type.isValue("Diameter")){
|
||||
@@ -776,7 +777,7 @@ private:
|
||||
Base::Vector3d center = pts.center;
|
||||
center.y = -center.y;
|
||||
center = center + parentPos;
|
||||
Base::Vector3d lineDir = (arrowPts.first - arrowPts.second).Normalize();
|
||||
Base::Vector3d lineDir = (arrowPts.first() - arrowPts.second()).Normalize();
|
||||
Base::Vector3d end1 = center + lineDir * pts.radius;
|
||||
Base::Vector3d end2 = center - lineDir * pts.radius;
|
||||
writer.exportDiametricDim(textLocn, end1, end2, dimText);
|
||||
|
||||
Reference in New Issue
Block a user