-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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
const bool the3d2d,
bool theDoInit):
SMESHGUI_PreviewDlg(theModule),
- mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySMESHGUI(theModule)
{
setModal(false);
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
+ connect(mySMESHGUI, SIGNAL(SignalActivatedViewManager()), SLOT( onOpenView()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseView()), SLOT( onCloseView()));
// dialog controls
connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn() ));
//=======================================================================
// name : SMESHGUI_MultiEditDlg::getIds
-// Purpose : Retrive identifiers from list box or the whole object
+// Purpose : Retrieve identifiers from list box or the whole object
//=======================================================================
SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj)
QDialog::reject();
}
+//=================================================================================
+// function : onOpenView()
+// purpose :
+//=================================================================================
+void SMESHGUI_MultiEditDlg::onOpenView()
+{
+ if(!mySelector) {
+ mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+ mySMESHGUI->EmitSignalDeactivateDialog();
+ setEnabled(true);
+ }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose :
+//=================================================================================
+void SMESHGUI_MultiEditDlg::onCloseView()
+{
+ onDeactivate();
+ mySelector = 0;
+}
+
+
//=================================================================================
// function : onHelp()
// purpose :
void SMESHGUI_MultiEditDlg::enterEvent (QEvent*)
{
if (!isEnabled()) {
+ SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+ if ( aViewWindow && !mySelector) {
+ mySelector = aViewWindow->GetSelector();
+ }
mySMESHGUI->EmitSignalDeactivateDialog();
setEnabled(true);
setSelectionMode();
//=======================================================================
bool SMESHGUI_MultiEditDlg::isIdValid (const int theId) const
{
+ if ( !myActor )
+ return true; // filter can't work w/o actor
+
SVTK_Selector* aSelector = SMESH::GetSelector();
Handle(SMESHGUI_Filter) aFilter =
Handle(SMESHGUI_Filter)::DownCast(aSelector->GetFilter(myFilterType));
}
if (entityType()) {
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(VolumeSelection);
SMESH::SetFilter(new SMESHGUI_VolumesFilter());
- } else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(FaceSelection);
+ aViewWindow->SetSelectionMode(VolumeSelection); // here myActor set to a filter
+ } else {
if (myFilterType == SMESH::TriaFilter)
SMESH::SetFilter(new SMESHGUI_TriangleFilter());
else if (myFilterType == SMESH::QuadFilter)
SMESH::SetFilter(new SMESHGUI_QuadrangleFilter());
else
SMESH::SetFilter(new SMESHGUI_FacesFilter());
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(FaceSelection); // here myActor set to a filter
}
}
int SMESHGUI_ChangeOrientationDlg::nbElemsInMesh()
{
- return ( myFilterType = SMESH::FaceFilter ) ? myMesh->NbFaces() : myMesh->NbVolumes();
+ return ( myFilterType == SMESH::FaceFilter ) ? myMesh->NbFaces() : myMesh->NbVolumes();
}
/*!
{
if ( hasObj )
return theEditor->QuadTo4Tri( obj ), true;
- SMESH::SMESH_IDSource_wrap elems = theEditor->MakeIDSource( theIds, SMESH::FACE );
+ SMESH::IDSource_wrap elems = theEditor->MakeIDSource( theIds, SMESH::FACE );
theEditor->QuadTo4Tri( elems );
return true;
}
QLabel* dXLbl = new QLabel( tr("SMESH_DX"), myFacetSelGrp);
QLabel* dYLbl = new QLabel( tr("SMESH_DY"), myFacetSelGrp);
QLabel* dZLbl = new QLabel( tr("SMESH_DZ"), myFacetSelGrp);
- QPushButton* axisBtn[3];
for ( int i = 0; i < 3; ++i )
{
myPointSpin[i] = new SMESHGUI_SpinBox( myFacetSelGrp );
const SMESH::long_array& theIds,
SMESH::SMESH_IDSource_ptr theObj)
{
- SMESH::SMESH_IDSource_wrap obj = theObj;
+ SMESH::IDSource_wrap obj = theObj;
if ( CORBA::is_nil( obj ))
obj = theEditor->MakeIDSource( theIds, SMESH::VOLUME );
else
gp_XYZ bc( 0,0,0 );
Bnd_B3d bbox;
SMDS_NodeIteratorPtr nIt = elem->nodeIterator();
- vector< const SMDS_MeshNode* > nodes;
+ std::vector< const SMDS_MeshNode* > nodes;
nodes.reserve( elem->NbNodes() );
while ( nIt->more() )
{
if ( sender() == myAxisBtn[i] )
break;
if ( i == 3 )
- i == 0;
+ i = 0;
myDirSpin[i]->SetValue(1.);
if ( myActor && !myMesh->_is_nil() && myMesh->NbNodes() > 0 )