-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#define SPACING 6
#define MARGIN 11
+namespace
+{
+ enum { MANUAL_MODE = 0, SEARCH_MODE }; // how a node to move is specified
+}
+
/*!
* \brief Dialog to publish a sub-shape of the mesh main shape
* by selecting mesh elements
mySMESHGUI = 0;
myDlg = new SMESHGUI_MakeNodeAtPointDlg;
myFilter = 0;
- myHelpFileName = "mesh_through_point_page.html";
+ myHelpFileName = "mesh_through_point.html";
myNoPreview = false;
myUpdateDestination = false;
myDlg->myDestDZ->setReadOnly(true);
myDlg->myRButNodeToMove->setChecked(true);
- myDlg->ConstructorsClicked(GetConstructorId());
+ myDlg->ConstructorsClicked( GetConstructorId() );
myDlg->show();
mySimulation = 0;
}
if ( myMeshActor ) {
- myMeshActor->SetPointRepresentation(false);
- SMESH::RepaintCurrentView();
myMeshActor = 0;
}
+ SMESH::SetPointRepresentation( false );
+ SMESH::RepaintCurrentView();
+
disconnect(mySMESHGUI, SIGNAL (SignalActivatedViewManager()), this, SLOT(onOpenView()));
- disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
+ disconnect(mySMESHGUI, SIGNAL (SignalCloseView()), this, SLOT(onCloseView()));
selectionMgr()->removeFilter( myFilter );
SMESHGUI_SelectionOp::stopOperation();
}
bool SMESHGUI_MakeNodeAtPointOp::onApply()
{
- if( isStudyLocked() )
+ if( SMESHGUI::isStudyLocked() )
return false;
if ( !myMeshActor ) {
if (aMeshEditor->_is_nil())
return true;
- aMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
+ aMesh->SetParameters( aParameters.join(":").toUtf8().constData() );
bool ok;
int anId = myDlg->myId->text().toInt( &ok );
if( !ok || anId < 1 )
- anId = aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
- myDlg->myDestinationY->GetValue(),
- myDlg->myDestinationZ->GetValue());
+ anId = FromSmIdType<int>(aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
+ myDlg->myDestinationY->GetValue(),
+ myDlg->myDestinationZ->GetValue()));
int aResult = aMeshEditor->MoveNode(anId,
myDlg->myDestinationX->GetValue(),
return;
myNoPreview = true;
+ if ( !myMeshActor && GetConstructorId() == SEARCH_MODE )
+ onSelectionDone();
+
SMESH::MeshPreviewStruct_var aMeshPreviewStruct;
bool moveShown = false;
myDlg->myDestDZ->setReadOnly(true);
}
if ( isPreview && isMoveNode && anId == 0 )
- anId = aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
- myDlg->myDestinationY->GetValue(),
- myDlg->myDestinationZ->GetValue());
+ anId = FromSmIdType<int>(aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(),
+ myDlg->myDestinationY->GetValue(),
+ myDlg->myDestinationZ->GetValue()));
// find id and/or just compute preview
aPreviewer->MoveNode(anId,
myDlg->myDestinationX->GetValue(),
}
}
}
- }catch (...) {
+ }
+ catch (...) {
}
}
}
if (!mySimulation)
mySimulation = new SMESHGUI_MeshEditPreview(SMESH::GetViewWindow( mySMESHGUI ));
// display data
- if ( aMeshPreviewStruct.operator->() )
+ if ( & aMeshPreviewStruct.in() )
{
- mySimulation->SetData(aMeshPreviewStruct._retn());
+ mySimulation->SetData( aMeshPreviewStruct.in() );
}
else
{
if( const SMDS_MeshNode* aNode = aMesh->FindNode( theText.toInt() ) )
{
- TColStd_MapOfInteger aListInd;
- aListInd.Add( aNode->GetID() );
+ SVTK_TVtkIDsMap aListInd;
+ aListInd.Add( FromSmIdType<int>(aNode->GetID()) );
selector()->AddOrRemoveIndex( anIO, aListInd, false );
if( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() ) )
aViewWindow->highlight( anIO, true, true );