+
+void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview )
+{
+ if ( myPreviewCheckBox->isChecked() && toDisplayPreview ) {
+ if ( isValid( true ) ) {
+ try{
+ SUIT_OverrideCursor aWaitCursor;
+ // get Ids of elements
+ SMESH::SMESH_IDSource_var obj;
+ SMESH::long_array_var anElemIds = getIds( obj );
+
+ SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor();
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer();
+
+ double aMaxAngle = myMaxAngleSpin->GetValue() * M_PI / 180.0;
+
+ if ( CORBA::is_nil( obj ) )
+ aMeshEditor->TriToQuad( anElemIds.inout(), aCriterion, aMaxAngle );
+ else
+ aMeshEditor->TriToQuadObject( obj, aCriterion, aMaxAngle );
+
+ SMESH::MeshPreviewStruct_var aMeshPreviewStruct = aMeshEditor->GetPreviewData();
+
+ vtkProperty* aProp = vtkProperty::New();
+ aProp->SetRepresentationToWireframe();
+ aProp->SetColor( 250, 0, 250 );
+ aProp->SetLineWidth( SMESH::GetFloat( "SMESH:element_width", 1 ) + 3 );
+ mySimulation->GetActor()->SetProperty( aProp );
+ aProp->Delete();
+
+ mySimulation->SetData( aMeshPreviewStruct._retn() );
+ } catch ( ... ) {
+ hidePreview();
+ }
+ } else {
+ hidePreview();
+ }
+ } else {
+ hidePreview();
+ }
+}