Fix selection for radius Dims

- selection of ellipse curves was allowed
  but not supported for radius dims.
This commit is contained in:
wandererfan
2018-05-14 09:18:39 -04:00
committed by wmayer
parent ea87335842
commit 89a7b2a92f
2 changed files with 10 additions and 5 deletions

View File

@@ -248,6 +248,8 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
TechDrawGeometry::BaseGeom* base = getViewPart()->getProjEdgeByIndex(idx);
TechDrawGeometry::Circle* circle;
arcPoints pts;
pts.center = Base::Vector3d(0.0,0.0,0.0);
pts.radius = 0.0;
if( (base && base->geomType == TechDrawGeometry::GeomType::CIRCLE) ||
(base && base->geomType == TechDrawGeometry::GeomType::ARCOFCIRCLE)) {
circle = static_cast<TechDrawGeometry::Circle*> (base);
@@ -277,6 +279,8 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void)
TechDrawGeometry::BaseGeom* base = getViewPart()->getProjEdgeByIndex(idx);
TechDrawGeometry::Circle* circle;
arcPoints pts;
pts.center = Base::Vector3d(0.0,0.0,0.0);
pts.radius = 0.0;
if ((base && base->geomType == TechDrawGeometry::GeomType::CIRCLE) ||
(base && base->geomType == TechDrawGeometry::GeomType::ARCOFCIRCLE)) {
circle = static_cast<TechDrawGeometry::Circle*> (base);
@@ -364,7 +368,7 @@ std::string DrawViewDimension::getFormatedValue(bool obtuse)
QString specStr = QString::fromUtf8(FormatSpec.getStrValue().data(),FormatSpec.getStrValue().size());
double val = std::abs(getDimValue()); //internal units!
Base::Quantity qVal;
qVal.setValue(val);
if (Type.isValue("Angle")) {
@@ -490,6 +494,7 @@ double DrawViewDimension::getDimValue()
} else if(Type.isValue("Radius")){
arcPoints pts = m_arcPoints;
result = pts.radius / getViewPart()->getScale(); //Projected BaseGeom is scaled for drawing
} else if(Type.isValue("Diameter")){
arcPoints pts = m_arcPoints;

View File

@@ -1005,11 +1005,11 @@ int _isValidSingleEdge(Gui::Command* cmd) {
edgeType = isDiagonal;
}
} else if (geom->geomType == TechDrawGeometry::CIRCLE ||
geom->geomType == TechDrawGeometry::ELLIPSE ||
geom->geomType == TechDrawGeometry::ARCOFCIRCLE ||
geom->geomType == TechDrawGeometry::ARCOFELLIPSE ) {
geom->geomType == TechDrawGeometry::ARCOFCIRCLE ) {
edgeType = isCircle;
} else if (geom->geomType == TechDrawGeometry::BSPLINE) {
} else if (geom->geomType == TechDrawGeometry::ELLIPSE ||
geom->geomType == TechDrawGeometry::ARCOFELLIPSE ||
geom->geomType == TechDrawGeometry::BSPLINE) {
edgeType = isCurve;
} else {
edgeType = isInvalid;