[FEM] ViewProviderFemConstrain*: remove unused includes - part 1

- also sort includes
- also fix warnings about too long lines
This commit is contained in:
Uwe
2022-10-03 17:10:36 +02:00
parent ef62fc3530
commit 79d17d13bf
11 changed files with 401 additions and 419 deletions

View File

@@ -21,27 +21,23 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Standard_math.hxx>
# include <Precision.hxx>
# include <Inventor/nodes/SoSeparator.h>
# include <Inventor/nodes/SoTranslation.h>
# include <Inventor/nodes/SoRotation.h>
# include <Inventor/nodes/SoMultipleCopy.h>
# include <QMessageBox>
# include <Precision.hxx>
# include <Inventor/SbRotation.h>
# include <Inventor/SbVec3f.h>
# include <Inventor/nodes/SoMultipleCopy.h>
# include <Inventor/nodes/SoSeparator.h>
#endif
#include "ViewProviderFemConstraintFluidBoundary.h"
#include <Mod/Fem/App/FemConstraintFluidBoundary.h>
#include "TaskFemConstraintFluidBoundary.h"
#include "Gui/Control.h"
#include <Base/Console.h>
#include "ViewProviderFemConstraintFluidBoundary.h"
#include "TaskFemConstraintFluidBoundary.h"
using namespace FemGui;
@@ -63,7 +59,8 @@ bool ViewProviderFemConstraintFluidBoundary::setEdit(int ModNum)
// When double-clicking on the item for this constraint,
// object unsets and sets its edit mode without closing the task panel
Gui::TaskView::TaskDialog *dlg = Gui::Control().activeDialog();
TaskDlgFemConstraintFluidBoundary *constrDlg = qobject_cast<TaskDlgFemConstraintFluidBoundary *>(dlg);
TaskDlgFemConstraintFluidBoundary *constrDlg =
qobject_cast<TaskDlgFemConstraintFluidBoundary *>(dlg);
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = nullptr; // another constraint left open its task panel
if (dlg && !constrDlg) {
@@ -109,7 +106,7 @@ bool ViewProviderFemConstraintFluidBoundary::setEdit(int ModNum)
//Rendering: Combination of ConstraintFixed and ConstraintForce
#define ARROWLENGTH (4)
#define ARROWHEADRADIUS (ARROWLENGTH/3.0f)
#define ARROWHEADRADIUS (ARROWLENGTH / 3.0f)
#define WIDTH (2)
#define HEIGHT (1)
//#define USE_MULTIPLE_COPY //OvG: MULTICOPY fails to update scaled display on initial drawing - so disable
@@ -125,28 +122,17 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
float scaledlength = ARROWLENGTH * pcConstraint->Scale.getValue();
std::string boundaryType = pcConstraint->BoundaryType.getValueAsString();
if (strcmp(prop->getName(),"BoundaryType") == 0)
{
if (strcmp(prop->getName(), "BoundaryType") == 0) {
if (boundaryType == "wall")
{
FaceColor.setValue(0.0,1.0,1.0);
}
FaceColor.setValue(0.0, 1.0, 1.0);
else if (boundaryType == "interface")
{
FaceColor.setValue(0.0,1.0,0.0);
}
FaceColor.setValue(0.0, 1.0, 0.0);
else if (boundaryType == "freestream")
{
FaceColor.setValue(1.0,1.0,0.0);
}
else if(boundaryType == "inlet")
{
FaceColor.setValue(1.0,0.0,0.0);
}
FaceColor.setValue(1.0, 1.0, 0.0);
else if (boundaryType == "inlet")
FaceColor.setValue(1.0, 0.0, 0.0);
else //(boundaryType == "outlet")
{
FaceColor.setValue(0.0,0.0,1.0);
}
FaceColor.setValue(0.0, 0.0, 1.0);
}
if (boundaryType == "inlet" || boundaryType == "outlet"){
@@ -182,9 +168,10 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
forceDirection = normal;
SbVec3f dir(forceDirection.x, forceDirection.y, forceDirection.z);
SbRotation rot(SbVec3f(0,1,0), dir);
SbRotation rot(SbVec3f(0, 1, 0), dir);
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end();
p++) {
SbVec3f base(p->x, p->y, p->z);
if (forceDirection.GetAngle(normal) < M_PI_2) // Move arrow so it doesn't disappear inside the solid
base = base + dir * scaledlength; //OvG: Scaling
@@ -215,7 +202,7 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
}
SbVec3f dir(forceDirection.x, forceDirection.y, forceDirection.z);
SbRotation rot(SbVec3f(0,1,0), dir);
SbRotation rot(SbVec3f(0, 1, 0), dir);
const std::vector<Base::Vector3d>& points = pcConstraint->Points.getValues();
@@ -226,13 +213,14 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
#endif
int idx = 0;
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end();
p++) {
SbVec3f base(p->x, p->y, p->z);
if (forceDirection.GetAngle(normal) < M_PI_2)
base = base + dir * scaledlength; //OvG: Scaling
#ifdef USE_MULTIPLE_COPY
SbMatrix m;
m.setTransform(base, rot, SbVec3f(1,1,1));
m.setTransform(base, rot, SbVec3f(1, 1, 1));
matrices[idx] = m;
#else
SoSeparator* sep = static_cast<SoSeparator*>(pShapeSep->getChild(idx));
@@ -279,7 +267,7 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
SbVec3f base(p->x, p->y, p->z);
SbVec3f dir(n->x, n->y, n->z);
SbRotation rot(SbVec3f(0,-1,0), dir);
SbRotation rot(SbVec3f(0, -1, 0), dir);
#ifdef USE_MULTIPLE_COPY
SbMatrix m;
m.setTransform(base, rot, SbVec3f(1,1,1));