Fem: Move Points and Normals properties to base class

This commit is contained in:
marioalexis
2024-02-13 19:55:46 -03:00
committed by Chris Hennes
parent a489b095f0
commit c49c52716c
26 changed files with 31 additions and 332 deletions

View File

@@ -91,6 +91,19 @@ Constraint::Constraint()
App::PropertyType(App::Prop_Output),
"Scale used for drawing constraints"); // OvG: Add scale parameter inherited
// by all derived constraints
ADD_PROPERTY_TYPE(Points,
(Base::Vector3d()),
"Constraint",
App::PropertyType(App::Prop_ReadOnly | App::Prop_Output | App::Prop_Hidden),
"Points where symbols are drawn");
ADD_PROPERTY_TYPE(Normals,
(Base::Vector3d()),
"Constraint",
App::PropertyType(App::Prop_ReadOnly | App::Prop_Output | App::Prop_Hidden),
"Normals where symbols are drawn");
Points.setValues(std::vector<Base::Vector3d>());
Normals.setValues(std::vector<Base::Vector3d>());
References.setScope(App::LinkScope::Global);
}
@@ -165,6 +178,16 @@ void Constraint::onChanged(const App::Property* prop)
}
}
}
std::vector<Base::Vector3d> points;
std::vector<Base::Vector3d> normals;
int scale = 1;
if (getPoints(points, normals, &scale)) {
Points.setValues(points);
Normals.setValues(normals);
Scale.setValue(scale);
Points.touch();
}
}
App::DocumentObject::onChanged(prop);