mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-30 22:20:34 +05:00
PAL13460 (PAL EDF 301 force the mesh to go through a point)
enable selection of vertices
This commit is contained in:
parent
6b3655d049
commit
e0af6f94f0
@ -40,6 +40,8 @@
|
|||||||
#include "SMDS_MeshNode.hxx"
|
#include "SMDS_MeshNode.hxx"
|
||||||
#include "SMESH_Actor.h"
|
#include "SMESH_Actor.h"
|
||||||
#include "SMESH_ActorUtils.h"
|
#include "SMESH_ActorUtils.h"
|
||||||
|
#include "SMESH_NumberFilter.hxx"
|
||||||
|
#include "SMESH_LogicalFilter.hxx"
|
||||||
|
|
||||||
#include "GEOMBase.h"
|
#include "GEOMBase.h"
|
||||||
#include "GeometryGUI.h"
|
#include "GeometryGUI.h"
|
||||||
@ -53,14 +55,15 @@
|
|||||||
#include "SVTK_ViewWindow.h"
|
#include "SVTK_ViewWindow.h"
|
||||||
#include "SVTK_ViewModel.h"
|
#include "SVTK_ViewModel.h"
|
||||||
#include "SalomeApp_Tools.h"
|
#include "SalomeApp_Tools.h"
|
||||||
|
#include "SalomeApp_TypeFilter.h"
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include "SUIT_ResourceMgr.h"
|
||||||
#include "SUIT_OverrideCursor.h"
|
#include "SUIT_OverrideCursor.h"
|
||||||
#include "SUIT_MessageBox.h"
|
#include "SUIT_MessageBox.h"
|
||||||
|
|
||||||
// OCCT Includes
|
// OCCT Includes
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Vertex.hxx>
|
||||||
#include <TopExp_Explorer.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
|
|
||||||
// QT Includes
|
// QT Includes
|
||||||
#include <qframe.h>
|
#include <qframe.h>
|
||||||
@ -254,6 +257,7 @@ SMESHGUI_MakeNodeAtPointOp::SMESHGUI_MakeNodeAtPointOp()
|
|||||||
{
|
{
|
||||||
mySimulation = 0;
|
mySimulation = 0;
|
||||||
myDlg = new SMESHGUI_MakeNodeAtPointDlg;
|
myDlg = new SMESHGUI_MakeNodeAtPointDlg;
|
||||||
|
myFilter = 0;
|
||||||
|
|
||||||
// connect signals and slots
|
// connect signals and slots
|
||||||
connect(myDlg->myX, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
|
connect(myDlg->myX, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
|
||||||
@ -288,6 +292,15 @@ void SMESHGUI_MakeNodeAtPointOp::startOperation()
|
|||||||
|
|
||||||
SMESHGUI_SelectionOp::startOperation();
|
SMESHGUI_SelectionOp::startOperation();
|
||||||
|
|
||||||
|
// SalomeApp_TypeFilter depends on a current study
|
||||||
|
if ( myFilter ) delete myFilter;
|
||||||
|
QPtrList<SUIT_SelectionFilter> filters;
|
||||||
|
filters.append( new SalomeApp_TypeFilter((SalomeApp_Study*)study(), "SMESH" ));
|
||||||
|
TColStd_MapOfInteger vertexType;
|
||||||
|
vertexType.Add( TopAbs_VERTEX );
|
||||||
|
filters.append( new SMESH_NumberFilter("GEOM", TopAbs_VERTEX, 1, vertexType ));
|
||||||
|
myFilter = new SMESH_LogicalFilter( filters, SMESH_LogicalFilter::LO_OR );
|
||||||
|
|
||||||
activateSelection(); // set filters
|
activateSelection(); // set filters
|
||||||
|
|
||||||
myDlg->myX->SetValue(0);
|
myDlg->myX->SetValue(0);
|
||||||
@ -323,6 +336,7 @@ void SMESHGUI_MakeNodeAtPointOp::stopOperation()
|
|||||||
SMESH::RepaintCurrentView();
|
SMESH::RepaintCurrentView();
|
||||||
myMeshActor = 0;
|
myMeshActor = 0;
|
||||||
}
|
}
|
||||||
|
selectionMgr()->removeFilter( myFilter );
|
||||||
SMESHGUI_SelectionOp::stopOperation();
|
SMESHGUI_SelectionOp::stopOperation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,10 +448,30 @@ void SMESHGUI_MakeNodeAtPointOp::onSelectionDone()
|
|||||||
return;
|
return;
|
||||||
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
Handle(SALOME_InteractiveObject) anIO = aList.First();
|
||||||
SMESH_Actor* aMeshActor = SMESH::FindActorByEntry(anIO->getEntry());
|
SMESH_Actor* aMeshActor = SMESH::FindActorByEntry(anIO->getEntry());
|
||||||
if (!aMeshActor)
|
|
||||||
return;
|
if (!aMeshActor) { // coord by geom
|
||||||
|
if ( myDlg->myCoordBtn->isOn() ) {
|
||||||
|
GEOM::GEOM_Object_var geom = SMESH::IObjectToInterface<GEOM::GEOM_Object>(anIO);
|
||||||
|
if ( !geom->_is_nil() ) {
|
||||||
|
TopoDS_Vertex aShape;
|
||||||
|
if ( GEOMBase::GetShape(geom, aShape) &&
|
||||||
|
aShape.ShapeType() == TopAbs_VERTEX ) {
|
||||||
|
gp_Pnt P = BRep_Tool::Pnt(aShape);
|
||||||
|
myNoPreview = true;
|
||||||
|
myDlg->myX->SetValue(P.X());
|
||||||
|
myDlg->myY->SetValue(P.Y());
|
||||||
|
myDlg->myZ->SetValue(P.Z());
|
||||||
|
myNoPreview = false;
|
||||||
|
redisplayPreview();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( !myMeshActor )
|
if ( !myMeshActor )
|
||||||
myMeshActor = aMeshActor;
|
myMeshActor = aMeshActor;
|
||||||
|
|
||||||
QString aString;
|
QString aString;
|
||||||
int nbElems = SMESH::GetNameOfSelectedElements(selector(),anIO, aString);
|
int nbElems = SMESH::GetNameOfSelectedElements(selector(),anIO, aString);
|
||||||
if (nbElems == 1) {
|
if (nbElems == 1) {
|
||||||
@ -561,6 +595,7 @@ void SMESHGUI_MakeNodeAtPointOp::activateSelection()
|
|||||||
{
|
{
|
||||||
selectionMgr()->clearFilters();
|
selectionMgr()->clearFilters();
|
||||||
SMESH::SetPointRepresentation(false);
|
SMESH::SetPointRepresentation(false);
|
||||||
|
selectionMgr()->installFilter( myFilter );
|
||||||
setSelectionMode( NodeSelection );
|
setSelectionMode( NodeSelection );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,9 +607,9 @@ void SMESHGUI_MakeNodeAtPointOp::activateSelection()
|
|||||||
|
|
||||||
SMESHGUI_MakeNodeAtPointOp::~SMESHGUI_MakeNodeAtPointOp()
|
SMESHGUI_MakeNodeAtPointOp::~SMESHGUI_MakeNodeAtPointOp()
|
||||||
{
|
{
|
||||||
if ( myDlg )
|
if ( myDlg ) delete myDlg;
|
||||||
delete myDlg;
|
if ( mySimulation ) delete mySimulation;
|
||||||
delete mySimulation;
|
if ( myFilter ) delete myFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
@ -80,6 +80,7 @@ private:
|
|||||||
|
|
||||||
SMESHGUI_MakeNodeAtPointDlg* myDlg;
|
SMESHGUI_MakeNodeAtPointDlg* myDlg;
|
||||||
|
|
||||||
|
SUIT_SelectionFilter* myFilter;
|
||||||
int myMeshOldDisplayMode;
|
int myMeshOldDisplayMode;
|
||||||
SMESHGUI_MeshEditPreview* mySimulation;
|
SMESHGUI_MeshEditPreview* mySimulation;
|
||||||
SMESH_Actor* myMeshActor;
|
SMESH_Actor* myMeshActor;
|
||||||
|
Loading…
Reference in New Issue
Block a user