[PartDesign] Fix spelling of auxiliary and curvilinear…

…but also handle the properties name change from old files
This commit is contained in:
Syres916
2025-04-05 13:42:05 +01:00
committed by Chris Hennes
parent 3d9df65bec
commit b2fb84fb3a
7 changed files with 68 additions and 40 deletions

View File

@@ -72,11 +72,11 @@ Pipe::Pipe()
ADD_PROPERTY_TYPE(Spine, (nullptr), "Sweep", App::Prop_None, "Path to sweep along");
ADD_PROPERTY_TYPE(SpineTangent, (false), "Sweep", App::Prop_None,
"Include tangent edges into path");
ADD_PROPERTY_TYPE(AuxillerySpine, (nullptr), "Sweep", App::Prop_None,
ADD_PROPERTY_TYPE(AuxiliarySpine, (nullptr), "Sweep", App::Prop_None,
"Secondary path to orient sweep");
ADD_PROPERTY_TYPE(AuxillerySpineTangent, (false), "Sweep", App::Prop_None,
ADD_PROPERTY_TYPE(AuxiliarySpineTangent, (false), "Sweep", App::Prop_None,
"Include tangent edges into secondary path");
ADD_PROPERTY_TYPE(AuxilleryCurvelinear, (true), "Sweep", App::Prop_None,
ADD_PROPERTY_TYPE(AuxiliaryCurvilinear, (true), "Sweep", App::Prop_None,
"Calculate normal between equidistant points on both spines");
ADD_PROPERTY_TYPE(Mode, (long(0)), "Sweep", App::Prop_None, "Profile mode");
ADD_PROPERTY_TYPE(Binormal, (Base::Vector3d()), "Sweep", App::Prop_None,
@@ -191,10 +191,10 @@ App::DocumentObjectExecReturn *Pipe::execute()
// auxiliary
TopoDS_Shape auxpath;
if (Mode.getValue() == 3) {
App::DocumentObject* auxspine = AuxillerySpine.getValue();
App::DocumentObject* auxspine = AuxiliarySpine.getValue();
if (!(auxspine && auxspine->isDerivedFrom<Part::Feature>()))
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "No auxiliary spine linked."));
std::vector<std::string> auxsubedge = AuxillerySpine.getSubValues();
std::vector<std::string> auxsubedge = AuxiliarySpine.getSubValues();
const Part::TopoShape& auxshape =
static_cast<Part::Feature*>(auxspine)->Shape.getValue();
@@ -479,8 +479,8 @@ void Pipe::setupAlgorithm(BRepOffsetAPI_MakePipeShell& mkPipeShell, const TopoDS
}
if (auxiliary) {
mkPipeShell.SetMode(TopoDS::Wire(auxshape), AuxilleryCurvelinear.getValue());
// mkPipeShell.SetMode(TopoDS::Wire(auxshape), AuxilleryCurvelinear.getValue(),
mkPipeShell.SetMode(TopoDS::Wire(auxshape), AuxiliaryCurvilinear.getValue());
// mkPipeShell.SetMode(TopoDS::Wire(auxshape), AuxiliaryCurvilinear.getValue(),
// BRepFill_ContactOnBorder);
}
}
@@ -613,3 +613,29 @@ void Pipe::handleChangedPropertyType(Base::XMLReader& reader, const char* TypeNa
ProfileBased::handleChangedPropertyType(reader, TypeName, prop);
}
}
void Pipe::handleChangedPropertyName(Base::XMLReader& reader,
const char* TypeName,
const char* PropName)
{
// The AuxiliarySpine property was AuxillerySpine in the past
std::string strAuxillerySpine("AuxillerySpine");
// The AuxiliarySpineTangent property was AuxillerySpineTangent in the past
std::string strAuxillerySpineTangent("AuxillerySpineTangent");
// The AuxiliaryCurvilinear property was AuxilleryCurvelinear in the past
std::string strAuxilleryCurvelinear("AuxilleryCurvelinear");
Base::Type type = Base::Type::fromName(TypeName);
if (AuxiliarySpine.getClassTypeId() == type && strAuxillerySpine == PropName) {
AuxiliarySpine.Restore(reader);
}
else if (AuxiliarySpineTangent.getClassTypeId() == type
&& strAuxillerySpineTangent == PropName) {
AuxiliarySpineTangent.Restore(reader);
}
else if (AuxiliaryCurvilinear.getClassTypeId() == type && strAuxilleryCurvelinear == PropName) {
AuxiliaryCurvilinear.Restore(reader);
}
else {
ProfileBased::handleChangedPropertyName(reader, TypeName, PropName);
}
}