From fd8fb253d47aed0df53e4d3077f228377450c509 Mon Sep 17 00:00:00 2001 From: jriegel Date: Fri, 22 Mar 2013 12:34:27 +0100 Subject: [PATCH] Methode stub for retriving surface nodes (todo) --- src/Mod/Fem/App/FemMesh.cpp | 12 ++++++++++++ src/Mod/Fem/App/FemMesh.h | 5 +++++ src/Mod/Fem/Gui/TaskCreateNodeSet.cpp | 14 ++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 0b80148a1..759b72bf7 100755 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -381,6 +381,18 @@ void FemMesh::compute() myGen->Compute(*myMesh, myMesh->GetShapeToMesh()); } +std::set FemMesh::getSurfaceNodes(long ElemId,short FaceId, float Angle) const +{ + std::set result; + const SMESHDS_Mesh* data = myMesh->GetMeshDS(); + + const SMDS_MeshElement * element = data->FindElement(ElemId); + int fNbr = element->NbFaces(); + //element-> + + return result; +} + void FemMesh::readNastran(const std::string &Filename) { diff --git a/src/Mod/Fem/App/FemMesh.h b/src/Mod/Fem/App/FemMesh.h index d2502b4ca..274104b3f 100755 --- a/src/Mod/Fem/App/FemMesh.h +++ b/src/Mod/Fem/App/FemMesh.h @@ -79,6 +79,11 @@ public: virtual Data::Segment* getSubElement(const char* Type, unsigned long) const; //@} + /** @name search and retraivel */ + //@{ + std::set getSurfaceNodes(long ElemId,short FaceId, float Angle=360)const; + //@} + /** @name Placement control */ //@{ /// set the transformation diff --git a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp index efc203a04..8512a6f55 100644 --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp @@ -193,9 +193,23 @@ void TaskCreateNodeSet::onSelectionChanged(const Gui::SelectionChanges& msg) int elem = atoi(subName.substr(4).c_str()); int face = atoi(subName.substr(i+1).c_str() ); + tempSet.clear(); + + Base::Console().Message("Picked Element:%i Face:%i\n",elem,face); + + + if(! ui->checkBox_Add->isChecked()){ + std::set tmp = pcObject->FemMesh.getValue()->FemMesh.getValue().getSurfaceNodes(elem,face); + tempSet.insert(tmp.begin(),tmp.end()); + }else + tempSet = pcObject->FemMesh.getValue()->FemMesh.getValue().getSurfaceNodes(elem,face); + selectionMode = none; Gui::Selection().rmvSelectionGate(); + + MeshViewProvider->setHighlightNodes(tempSet); + } }