-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2020 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
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
+#include "utilities.h"
+
#include <SVTK_ViewWindow.h>
// OCCT includes
// Create and display actor
myMapper = vtkDataSetMapper::New();
- myMapper->SetInput( myGrid );
+ myMapper->SetInputData( myGrid );
myPreviewActor = SALOME_Actor::New();
myPreviewActor->PickableOff();
myPreviewActor->SetMapper( myMapper );
myPreviewActor->SetRepresentation( 3 );
- vtkFloatingPointType anRGB[3];
+ double anRGB[3];
vtkProperty* aProp = vtkProperty::New();
GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
myPreviewActor->SetProperty( aProp );
- vtkFloatingPointType aFactor,aUnits;
+ double aFactor,aUnits;
myPreviewActor->SetResolveCoincidentTopology(true);
myPreviewActor->GetPolygonOffsetParameters(aFactor,aUnits);
myPreviewActor->SetPolygonOffsetParameters(aFactor,0.2*aUnits);
mySMESHGUI->SetActiveDialogBox( (QDialog*)this );
- myHelpFileName = "adding_nodes_and_elements_page.html#adding_polyhedrons_anchor";
+ myHelpFileName = "adding_nodes_and_elements.html#adding-polyhedrons-anchor";
Init();
}
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
/* to close dialog if study change */
- connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
-
+ connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
+ connect( mySMESHGUI, SIGNAL ( SignalActivatedViewManager() ), this, SLOT( onOpenView() ) );
+ connect( mySMESHGUI, SIGNAL ( SignalCloseView() ), this, SLOT( onCloseView() ) );
ConstructorsClicked(0);
SelectionIntoArgument();
}
if( !isValid() )
return;
- if ( myNbOkElements>0 && !mySMESHGUI->isActiveStudyLocked())
+ if ( myNbOkElements>0 && !SMESHGUI::isStudyLocked())
{
if(checkEditLine(false) == -1) {return;}
busy = true;
QDialog::reject();
}
+//=================================================================================
+// function : onOpenView()
+// purpose :
+//=================================================================================
+void SMESHGUI_CreatePolyhedralVolumeDlg::onOpenView()
+{
+ if ( mySelector && mySimulation ) {
+ mySimulation->SetVisibility(false);
+ SMESH::SetPointRepresentation(false);
+ }
+ else {
+ mySelector = SMESH::GetViewWindow( mySMESHGUI )->GetSelector();
+ mySimulation = new SMESH::TPolySimulation(
+ dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
+ ActivateThisDialog();
+ }
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose :
+//=================================================================================
+void SMESHGUI_CreatePolyhedralVolumeDlg::onCloseView()
+{
+ DeactivateActiveDialog();
+ mySelector = 0;
+ delete mySimulation;
+ mySimulation = 0;
+}
+
//=================================================================================
// function : ClickOnHelp()
// purpose :
buttonOk->setEnabled( false );
buttonApply->setEnabled( false );
- // check entered ids of faces and hilight them
+ // check entered ids of faces and highlight them
QStringList aListId;
if ( aMesh ) {
TColStd_MapOfInteger newIndices;
SelectionIntoArgument();
}
-
//=================================================================================
// function : enterEvent()
// purpose :
//=================================================================================
-void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent(QEvent* e)
+void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent (QEvent*)
{
- if ( ConstructorsBox->isEnabled() )
- return;
- ActivateThisDialog();
+ if ( !ConstructorsBox->isEnabled() ) {
+ SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI );
+ if ( aViewWindow && !mySelector && !mySimulation) {
+ mySelector = aViewWindow->GetSelector();
+ mySimulation = new SMESH::TPolySimulation(
+ dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
+ }
+ ActivateThisDialog();
+ }
}
//=================================================================================