Fem: Apply clang-format
This commit is contained in:
@@ -22,13 +22,13 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <Inventor/events/SoMouseButtonEvent.h>
|
||||
# include <Inventor/nodes/SoCamera.h>
|
||||
# include <Inventor/nodes/SoEventCallback.h>
|
||||
#include <Inventor/events/SoMouseButtonEvent.h>
|
||||
#include <Inventor/nodes/SoCamera.h>
|
||||
#include <Inventor/nodes/SoEventCallback.h>
|
||||
|
||||
# include <SMESH_Mesh.hxx>
|
||||
# include <SMESHDS_Mesh.hxx>
|
||||
# include <Standard_math.hxx>
|
||||
#include <SMESHDS_Mesh.hxx>
|
||||
#include <SMESH_Mesh.hxx>
|
||||
#include <Standard_math.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
@@ -43,10 +43,10 @@
|
||||
#include <Mod/Fem/App/FemMeshObject.h>
|
||||
#include <Mod/Fem/App/FemSetNodesObject.h>
|
||||
|
||||
#include "TaskCreateNodeSet.h"
|
||||
#include "ui_TaskCreateNodeSet.h"
|
||||
#include "FemSelectionGate.h"
|
||||
#include "TaskCreateNodeSet.h"
|
||||
#include "ViewProviderFemMesh.h"
|
||||
#include "ui_TaskCreateNodeSet.h"
|
||||
|
||||
|
||||
using namespace FemGui;
|
||||
@@ -54,10 +54,10 @@ using namespace Gui;
|
||||
|
||||
|
||||
TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject* pcObject, QWidget* parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("FEM_CreateNodesSet"), tr("Nodes set"), true, parent),
|
||||
pcObject(pcObject),
|
||||
selectionMode(none),
|
||||
ui(new Ui_TaskCreateNodeSet)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("FEM_CreateNodesSet"), tr("Nodes set"), true, parent)
|
||||
, pcObject(pcObject)
|
||||
, selectionMode(none)
|
||||
, ui(new Ui_TaskCreateNodeSet)
|
||||
{
|
||||
// we need a separate container widget to add all controls to
|
||||
proxy = new QWidget(this);
|
||||
@@ -85,7 +85,6 @@ TaskCreateNodeSet::TaskCreateNodeSet(Fem::FemSetNodesObject* pcObject, QWidget*
|
||||
MeshViewProvider->setHighlightNodes(tempSet);
|
||||
|
||||
ui->groupBox_AngleSearch->setEnabled(false);
|
||||
|
||||
}
|
||||
|
||||
void TaskCreateNodeSet::Poly()
|
||||
@@ -139,23 +138,27 @@ void TaskCreateNodeSet::DefineNodesCallback(void* ud, SoEventCallback* n)
|
||||
|
||||
Gui::SelectionRole role;
|
||||
std::vector<SbVec2f> clPoly = view->getGLPolygon(&role);
|
||||
if (clPoly.size() < 3)
|
||||
if (clPoly.size() < 3) {
|
||||
return;
|
||||
if (clPoly.front() != clPoly.back())
|
||||
}
|
||||
if (clPoly.front() != clPoly.back()) {
|
||||
clPoly.push_back(clPoly.front());
|
||||
}
|
||||
|
||||
SoCamera* cam = view->getSoRenderManager()->getCamera();
|
||||
SbViewVolume vv = cam->getViewVolume();
|
||||
Gui::ViewVolumeProjection proj(vv);
|
||||
Base::Polygon2d polygon;
|
||||
for (auto it : clPoly)
|
||||
for (auto it : clPoly) {
|
||||
polygon.Add(Base::Vector2d(it[0], it[1]));
|
||||
}
|
||||
|
||||
taskBox->DefineNodes(polygon, proj, role == Gui::SelectionRole::Inner ? true : false);
|
||||
}
|
||||
|
||||
void TaskCreateNodeSet::DefineNodes(const Base::Polygon2d& polygon,
|
||||
const Gui::ViewVolumeProjection& proj, bool inner)
|
||||
const Gui::ViewVolumeProjection& proj,
|
||||
bool inner)
|
||||
{
|
||||
const SMESHDS_Mesh* data = pcObject->FemMesh.getValue<Fem::FemMeshObject*>()
|
||||
->FemMesh.getValue()
|
||||
@@ -165,15 +168,17 @@ void TaskCreateNodeSet::DefineNodes(const Base::Polygon2d& polygon,
|
||||
SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator();
|
||||
Base::Vector3f pt2d;
|
||||
|
||||
if (!ui->checkBox_Add->isChecked())
|
||||
if (!ui->checkBox_Add->isChecked()) {
|
||||
tempSet.clear();
|
||||
}
|
||||
|
||||
while (aNodeIter->more()) {
|
||||
const SMDS_MeshNode* aNode = aNodeIter->next();
|
||||
Base::Vector3f vec(aNode->X(), aNode->Y(), aNode->Z());
|
||||
pt2d = proj(vec);
|
||||
if (polygon.Contains(Base::Vector2d(pt2d.x, pt2d.y)) == inner)
|
||||
if (polygon.Contains(Base::Vector2d(pt2d.x, pt2d.y)) == inner) {
|
||||
tempSet.insert(aNode->GetID());
|
||||
}
|
||||
}
|
||||
|
||||
MeshViewProvider->setHighlightNodes(tempSet);
|
||||
@@ -181,8 +186,9 @@ void TaskCreateNodeSet::DefineNodes(const Base::Polygon2d& polygon,
|
||||
|
||||
void TaskCreateNodeSet::onSelectionChanged(const Gui::SelectionChanges& msg)
|
||||
{
|
||||
if (selectionMode == none)
|
||||
if (selectionMode == none) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (msg.Type == Gui::SelectionChanges::AddSelection) {
|
||||
std::string subName(msg.pSubName);
|
||||
|
||||
Reference in New Issue
Block a user