Fem: Apply clang-format

This commit is contained in:
wmayer
2023-09-22 12:38:37 +02:00
committed by wwmayer
parent 800006a505
commit 91a40b2007
79 changed files with 3674 additions and 2787 deletions

View File

@@ -24,7 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Precision.hxx>
#include <Precision.hxx>
#endif
#include "FemConstraintForce.h"
@@ -36,19 +36,29 @@ PROPERTY_SOURCE(Fem::ConstraintForce, Fem::Constraint)
ConstraintForce::ConstraintForce()
{
ADD_PROPERTY(Force,(0.0));
ADD_PROPERTY_TYPE(Direction,(nullptr),"ConstraintForce",(App::PropertyType)(App::Prop_None),
ADD_PROPERTY(Force, (0.0));
ADD_PROPERTY_TYPE(Direction,
(nullptr),
"ConstraintForce",
(App::PropertyType)(App::Prop_None),
"Element giving direction of constraint");
ADD_PROPERTY(Reversed,(0));
ADD_PROPERTY_TYPE(Points,(Base::Vector3d()),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
ADD_PROPERTY(Reversed, (0));
ADD_PROPERTY_TYPE(Points,
(Base::Vector3d()),
"ConstraintForce",
App::PropertyType(App::Prop_ReadOnly | App::Prop_Output),
"Points where arrows are drawn");
ADD_PROPERTY_TYPE(DirectionVector,(Base::Vector3d(0,0,1)),"ConstraintForce",App::PropertyType(App::Prop_ReadOnly|App::Prop_Output),
ADD_PROPERTY_TYPE(DirectionVector,
(Base::Vector3d(0, 0, 1)),
"ConstraintForce",
App::PropertyType(App::Prop_ReadOnly | App::Prop_Output),
"Direction of arrows");
naturalDirectionVector = Base::Vector3d(0,0,0); // by default use the null vector to indicate an invalid value
naturalDirectionVector =
Base::Vector3d(0, 0, 0); // by default use the null vector to indicate an invalid value
Points.setValues(std::vector<Base::Vector3d>());
}
App::DocumentObjectExecReturn *ConstraintForce::execute()
App::DocumentObjectExecReturn* ConstraintForce::execute()
{
return Constraint::execute();
}
@@ -62,21 +72,27 @@ void ConstraintForce::onChanged(const App::Property* prop)
if (prop == &References) {
std::vector<Base::Vector3d> points;
std::vector<Base::Vector3d> normals;
int scale = 1; //OvG: Enforce use of scale
int scale = 1; // OvG: Enforce use of scale
if (getPoints(points, normals, &scale)) {
Points.setValues(points); // We don't use the normals because all arrows should have the same direction
Scale.setValue(scale); //OvG Scale
// We don't use the normals because all arrows should have
// the same direction
Points.setValues(points);
Scale.setValue(scale);
Points.touch();
}
} else if (prop == &Direction) {
}
else if (prop == &Direction) {
Base::Vector3d direction = getDirection(Direction);
if (direction.Length() < Precision::Confusion())
if (direction.Length() < Precision::Confusion()) {
return;
}
naturalDirectionVector = direction;
if (Reversed.getValue())
if (Reversed.getValue()) {
direction = -direction;
}
DirectionVector.setValue(direction);
} else if (prop == &Reversed) {
}
else if (prop == &Reversed) {
// if the direction is invalid try to compute it again
if (naturalDirectionVector.Length() < Precision::Confusion()) {
naturalDirectionVector = getDirection(Direction);
@@ -84,16 +100,20 @@ void ConstraintForce::onChanged(const App::Property* prop)
if (naturalDirectionVector.Length() >= Precision::Confusion()) {
if (Reversed.getValue() && (DirectionVector.getValue() == naturalDirectionVector)) {
DirectionVector.setValue(-naturalDirectionVector);
} else if (!Reversed.getValue() && (DirectionVector.getValue() != naturalDirectionVector)) {
}
else if (!Reversed.getValue()
&& (DirectionVector.getValue() != naturalDirectionVector)) {
DirectionVector.setValue(naturalDirectionVector);
}
}
} else if (prop == &NormalDirection) {
}
else if (prop == &NormalDirection) {
// Set a default direction if no direction reference has been given
if (!Direction.getValue()) {
Base::Vector3d direction = NormalDirection.getValue();
if (Reversed.getValue())
if (Reversed.getValue()) {
direction = -direction;
}
DirectionVector.setValue(direction);
naturalDirectionVector = direction;
}