[TD]use correct property type for directions
This commit is contained in:
@@ -1042,6 +1042,7 @@ bool DrawViewPart::hasGeometry() const
|
||||
|
||||
const std::vector<TechDraw::VertexPtr>& verts = getVertexGeometry();
|
||||
const std::vector<TechDraw::BaseGeomPtr>& edges = getEdgeGeometry();
|
||||
|
||||
return !(verts.empty() && edges.empty());
|
||||
}
|
||||
|
||||
@@ -1477,6 +1478,33 @@ void DrawViewPart::resetReferenceVerts()
|
||||
addReferencesToGeom();
|
||||
}
|
||||
|
||||
void DrawViewPart::handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop)
|
||||
{
|
||||
if (prop == &Direction) {
|
||||
// Direction was PropertyVector but is now PropertyDirection
|
||||
App::PropertyVector tmp;
|
||||
if (strcmp(tmp.getTypeId().getName(), TypeName)==0) {
|
||||
tmp.setContainer(this);
|
||||
tmp.Restore(reader);
|
||||
auto tmpValue = tmp.getValue();
|
||||
Direction.setValue(tmpValue);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (prop == &XDirection) {
|
||||
// XDirection was PropertyFloat but is now PropertyLength
|
||||
App::PropertyVector tmp;
|
||||
if (strcmp(tmp.getTypeId().getName(), TypeName)==0) {
|
||||
tmp.setContainer(this);
|
||||
tmp.Restore(reader);
|
||||
auto tmpValue = tmp.getValue();
|
||||
XDirection.setValue(tmpValue);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// debugging ----------------------------------------------------------------------------
|
||||
|
||||
void DrawViewPart::dumpVerts(std::string text)
|
||||
|
||||
Reference in New Issue
Block a user