2023-06-17 00:28:19 +05:00
|
|
|
// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
|
2006-05-06 14:51:48 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2006-05-06 14:51:48 +06:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// 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
|
2014-02-20 18:25:37 +06:00
|
|
|
// version 2.1 of the License, or (at your option) any later version.
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2009-02-17 10:27:49 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH SMESHGUI : GUI for SMESH component
|
|
|
|
// File : SMESHGUI_ConvToQuadOp.cxx
|
|
|
|
// Author : Open CASCADE S.A.S.
|
|
|
|
// SMESH includes
|
2006-05-06 14:51:48 +06:00
|
|
|
//
|
|
|
|
#include "SMESHGUI_ConvToQuadOp.h"
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
#include "SMESHGUI.h"
|
2009-02-17 10:27:49 +05:00
|
|
|
#include "SMESHGUI_ConvToQuadDlg.h"
|
2012-10-08 17:56:59 +06:00
|
|
|
#include "SMESHGUI_MeshEditPreview.h"
|
2006-05-06 14:51:48 +06:00
|
|
|
#include "SMESHGUI_Utils.h"
|
2012-10-08 17:56:59 +06:00
|
|
|
#include "SMESH_ActorUtils.h"
|
2012-08-09 16:03:55 +06:00
|
|
|
#include "SMESH_TypeFilter.hxx"
|
2012-10-08 17:56:59 +06:00
|
|
|
#include "SMDSAbs_ElementType.hxx"
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SALOME GUI includes
|
|
|
|
#include <LightApp_UpdateFlags.h>
|
2012-08-09 16:03:55 +06:00
|
|
|
#include <SUIT_MessageBox.h>
|
|
|
|
#include <SUIT_OverrideCursor.h>
|
|
|
|
#include <SalomeApp_Tools.h>
|
2012-10-08 17:56:59 +06:00
|
|
|
#include <SALOME_Actor.h>
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// IDL includes
|
|
|
|
#include <SALOMEconfig.h>
|
2008-03-07 12:47:05 +05:00
|
|
|
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
// VTK includes
|
|
|
|
#include <vtkProperty.h>
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Constructor
|
|
|
|
*
|
|
|
|
* Initialize operation
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
SMESHGUI_ConvToQuadOp::SMESHGUI_ConvToQuadOp()
|
|
|
|
: SMESHGUI_SelectionOp(),
|
2012-10-08 17:56:59 +06:00
|
|
|
myDlg( 0 ),
|
|
|
|
myBadElemsPreview(0)
|
2006-05-06 14:51:48 +06:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Destructor
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
SMESHGUI_ConvToQuadOp::~SMESHGUI_ConvToQuadOp()
|
|
|
|
{
|
2012-10-08 17:56:59 +06:00
|
|
|
if ( myDlg ) delete myDlg;
|
|
|
|
if ( myBadElemsPreview ) delete myBadElemsPreview;
|
2006-05-06 14:51:48 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Gets dialog of this operation
|
|
|
|
* \retval LightApp_Dialog* - pointer to dialog of this operation
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
LightApp_Dialog* SMESHGUI_ConvToQuadOp::dlg() const
|
|
|
|
{
|
|
|
|
return myDlg;
|
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Creates dialog if necessary and shows it
|
|
|
|
*
|
|
|
|
* Virtual method redefined from base class called when operation is started creates
|
|
|
|
* dialog if necessary and shows it, activates selection
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
void SMESHGUI_ConvToQuadOp::startOperation()
|
|
|
|
{
|
|
|
|
if( !myDlg )
|
|
|
|
{
|
|
|
|
myDlg = new SMESHGUI_ConvToQuadDlg( );
|
|
|
|
}
|
|
|
|
connect( myDlg, SIGNAL( onClicked( int ) ), SLOT( ConnectRadioButtons( int ) ) );
|
|
|
|
|
2017-12-08 19:09:48 +05:00
|
|
|
myHelpFileName = "convert_to_from_quadratic_mesh.html";
|
2008-03-07 12:47:05 +05:00
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
SMESHGUI_SelectionOp::startOperation();
|
|
|
|
|
2015-03-25 14:36:47 +05:00
|
|
|
myDlg->SetMediumNdsOnGeom( true );
|
2006-05-06 14:51:48 +06:00
|
|
|
myDlg->activateObject( 0 );
|
2012-08-09 16:03:55 +06:00
|
|
|
myDlg->ShowWarning( false );
|
2006-05-06 14:51:48 +06:00
|
|
|
myDlg->show();
|
|
|
|
|
|
|
|
selectionDone();
|
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Updates dialog's look and feel
|
|
|
|
*
|
|
|
|
* Virtual method redefined from the base class updates dialog's look and feel
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
void SMESHGUI_ConvToQuadOp::selectionDone()
|
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
if ( !dlg()->isVisible() )
|
2006-05-06 14:51:48 +06:00
|
|
|
return;
|
|
|
|
|
|
|
|
SMESHGUI_SelectionOp::selectionDone();
|
|
|
|
try
|
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
QString anObjEntry = myDlg->selectedObject( 0 );
|
2018-01-22 13:57:06 +05:00
|
|
|
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
|
2012-08-09 16:03:55 +06:00
|
|
|
if ( !pObj ) return;
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH::SMESH_IDSource_var idSource =
|
|
|
|
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( pObj );
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
myDlg->setButtonEnabled( true, QtxDialog::OK | QtxDialog::Apply );
|
|
|
|
if( idSource->_is_nil() )
|
2006-05-06 14:51:48 +06:00
|
|
|
{
|
|
|
|
myDlg->SetEnabledControls( false );
|
2012-08-09 16:03:55 +06:00
|
|
|
myDlg->setButtonEnabled( false, QtxDialog::OK | QtxDialog::Apply );
|
|
|
|
return;
|
2006-05-06 14:51:48 +06:00
|
|
|
}
|
2013-03-06 19:57:01 +06:00
|
|
|
SMESH::SMESH_Mesh_var mesh = idSource->GetMesh();
|
|
|
|
bool hasGeom = mesh->HasShapeToMesh();
|
|
|
|
MeshDestinationType meshTgtType = DestinationMesh( idSource );
|
|
|
|
myDlg->SetEnabledRB( meshTgtType, hasGeom && ( meshTgtType & ( BiQuadratic | Quadratic )));
|
2012-08-09 16:03:55 +06:00
|
|
|
|
|
|
|
// show warning on non-conformal result mesh
|
|
|
|
if ( ! idSource->_is_nil() )
|
|
|
|
{
|
|
|
|
SMESH::SMESH_subMesh_var subMesh =
|
|
|
|
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pObj );
|
|
|
|
bool toShow = false;
|
|
|
|
if ( !subMesh->_is_nil() )
|
|
|
|
{
|
|
|
|
SMESH::SMESH_Mesh_var mesh = idSource->GetMesh();
|
|
|
|
idSource = SMESH::SMESH_IDSource::_narrow( mesh );
|
2013-03-06 19:57:01 +06:00
|
|
|
bool isMixOrder;
|
|
|
|
DestinationMesh( idSource, &isMixOrder );
|
|
|
|
toShow = !isMixOrder;
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
|
|
|
myDlg->ShowWarning( toShow );
|
|
|
|
}
|
2006-05-06 14:51:48 +06:00
|
|
|
}
|
|
|
|
catch ( const SALOME::SALOME_Exception& S_ex )
|
|
|
|
{
|
|
|
|
SalomeApp_Tools::QtCatchCorbaException( S_ex );
|
|
|
|
}
|
|
|
|
catch ( ... )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Creates selection filter
|
|
|
|
* \param theId - identifier of current selection widget
|
|
|
|
* \retval SUIT_SelectionFilter* - pointer to the created filter or null
|
|
|
|
*
|
|
|
|
* Creates selection filter in accordance with identifier of current selection widget
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
SUIT_SelectionFilter* SMESHGUI_ConvToQuadOp::createFilter( const int theId ) const
|
|
|
|
{
|
|
|
|
if ( theId == 0 )
|
2012-12-13 17:41:29 +06:00
|
|
|
return new SMESH_TypeFilter( SMESH::MESHorSUBMESH );
|
2006-05-06 14:51:48 +06:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Edits mesh
|
|
|
|
*
|
|
|
|
* Virtual slot redefined from the base class called when "Apply" button is clicked
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
bool SMESHGUI_ConvToQuadOp::onApply()
|
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
SUIT_OverrideCursor aWaitCursor;
|
2006-05-06 14:51:48 +06:00
|
|
|
|
|
|
|
QString aMess;
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
QString anObjEntry = myDlg->selectedObject( 0 );
|
2018-01-22 13:57:06 +05:00
|
|
|
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
|
2012-08-09 16:03:55 +06:00
|
|
|
if ( !pObj )
|
2006-05-06 14:51:48 +06:00
|
|
|
{
|
|
|
|
dlg()->show();
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning( myDlg,
|
2012-08-09 16:03:55 +06:00
|
|
|
tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
|
2006-05-06 14:51:48 +06:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH::SMESH_Mesh_var mesh;
|
|
|
|
SMESH::SMESH_IDSource_var idSource =
|
|
|
|
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( pObj );
|
|
|
|
if( !CORBA::is_nil(idSource) )
|
|
|
|
mesh = idSource->GetMesh();
|
2006-05-06 14:51:48 +06:00
|
|
|
|
|
|
|
if( CORBA::is_nil(mesh) )
|
|
|
|
{
|
2009-02-17 10:27:49 +05:00
|
|
|
SUIT_MessageBox::warning( myDlg,
|
2012-08-09 16:03:55 +06:00
|
|
|
tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
|
2006-05-06 14:51:48 +06:00
|
|
|
return false;
|
2012-08-09 16:03:55 +06:00
|
|
|
}
|
2006-05-06 14:51:48 +06:00
|
|
|
|
|
|
|
bool aResult = false;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
SMESH::SMESH_MeshEditor_var aEditor = mesh->GetMeshEditor();
|
2012-08-09 16:03:55 +06:00
|
|
|
aResult = true;
|
|
|
|
SMESH::SMESH_Mesh_var sourceMesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pObj );
|
2013-03-06 19:57:01 +06:00
|
|
|
if( myDlg->CurrentRB()==1 || myDlg->CurrentRB()==2)
|
2006-05-06 14:51:48 +06:00
|
|
|
{
|
2012-10-08 17:56:59 +06:00
|
|
|
bool force3d = true;
|
2006-05-06 14:51:48 +06:00
|
|
|
if( myDlg->IsEnabledCheck() )
|
2012-10-08 17:56:59 +06:00
|
|
|
force3d = myDlg->IsMediumNdsOnGeom();
|
2013-03-06 19:57:01 +06:00
|
|
|
bool theToBiQuad = myDlg->IsBiQuadratic();
|
|
|
|
if ( sourceMesh->_is_nil() ) {
|
|
|
|
if ( theToBiQuad ) aEditor->ConvertToBiQuadratic ( force3d, idSource );
|
|
|
|
else aEditor->ConvertToQuadraticObject( force3d, idSource );
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ( theToBiQuad ) aEditor->ConvertToBiQuadratic( force3d, sourceMesh );
|
|
|
|
else aEditor->ConvertToQuadratic ( force3d );
|
|
|
|
}
|
2012-10-08 17:56:59 +06:00
|
|
|
if ( !force3d )
|
|
|
|
{
|
|
|
|
SMESH::ComputeError_var error = aEditor->GetLastError();
|
|
|
|
if ( error->hasBadMesh )
|
|
|
|
{
|
|
|
|
if ( myBadElemsPreview ) delete myBadElemsPreview; // viewWindow may change
|
|
|
|
myBadElemsPreview = new SMESHGUI_MeshEditPreview( viewWindow() );
|
2013-03-06 19:57:01 +06:00
|
|
|
|
2013-03-01 19:13:25 +06:00
|
|
|
double aPointSize = SMESH::GetFloat("SMESH:node_size",3);
|
|
|
|
double aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
|
2012-10-08 17:56:59 +06:00
|
|
|
vtkProperty* prop = vtkProperty::New();
|
|
|
|
prop->SetLineWidth( aLineWidth * 3 );
|
|
|
|
prop->SetPointSize( aPointSize * 3 );
|
|
|
|
prop->SetColor( 250, 0, 250 );
|
|
|
|
myBadElemsPreview->GetActor()->SetProperty( prop );
|
|
|
|
prop->Delete();
|
|
|
|
|
|
|
|
SMESH::MeshPreviewStruct_var previewData = aEditor->GetPreviewData();
|
2018-11-14 18:41:52 +05:00
|
|
|
myBadElemsPreview->SetData( previewData.in() );
|
2012-10-08 17:56:59 +06:00
|
|
|
myBadElemsPreview->SetVisibility(true);
|
|
|
|
|
|
|
|
SUIT_MessageBox* mb = new SUIT_MessageBox(SUIT_MessageBox::Warning,
|
|
|
|
tr( "SMESH_WRN_WARNING" ),
|
|
|
|
tr("EDITERR_NO_MEDIUM_ON_GEOM"),
|
|
|
|
SUIT_MessageBox::Ok, myDlg);
|
|
|
|
mb->setWindowModality( Qt::NonModal );
|
|
|
|
mb->setAttribute( Qt::WA_DeleteOnClose );
|
|
|
|
mb->show();
|
|
|
|
connect ( mb, SIGNAL( finished(int) ), this, SLOT( onWarningWinFinished() ));
|
|
|
|
//connect ( mb, SIGNAL( rejected() ), this, SLOT( onWarningWinFinished() ));
|
|
|
|
}
|
|
|
|
}
|
2006-05-06 14:51:48 +06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
if ( sourceMesh->_is_nil() )
|
|
|
|
aEditor->ConvertFromQuadraticObject( idSource );
|
|
|
|
else
|
|
|
|
aEditor->ConvertFromQuadratic();
|
2006-05-06 14:51:48 +06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
catch ( const SALOME::SALOME_Exception& S_ex )
|
|
|
|
{
|
|
|
|
SalomeApp_Tools::QtCatchCorbaException( S_ex );
|
|
|
|
aResult = false;
|
|
|
|
}
|
|
|
|
catch ( ... )
|
|
|
|
{
|
|
|
|
aResult = false;
|
|
|
|
}
|
|
|
|
if( aResult )
|
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESHGUI::Modified();
|
2006-05-06 14:51:48 +06:00
|
|
|
update( UF_ObjBrowser | UF_Model | UF_Viewer );
|
|
|
|
selectionDone();
|
|
|
|
}
|
|
|
|
return aResult;
|
|
|
|
}
|
|
|
|
|
2012-10-08 17:56:59 +06:00
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief SLOT called when a warning window is closed
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
void SMESHGUI_ConvToQuadOp::onWarningWinFinished()
|
|
|
|
{
|
|
|
|
if ( myBadElemsPreview )
|
|
|
|
myBadElemsPreview->SetVisibility(false);
|
|
|
|
}
|
|
|
|
|
2006-05-06 14:51:48 +06:00
|
|
|
//================================================================================
|
|
|
|
/*! ConsistMesh
|
2013-03-06 19:57:01 +06:00
|
|
|
* Determines, what elements this mesh does not contain.
|
2006-05-06 14:51:48 +06:00
|
|
|
*/
|
|
|
|
//================================================================================
|
2013-03-06 19:57:01 +06:00
|
|
|
|
|
|
|
SMESHGUI_ConvToQuadOp::MeshDestinationType
|
|
|
|
SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSource,
|
2016-02-19 17:40:34 +05:00
|
|
|
bool* isMixOrder)
|
2006-05-06 14:51:48 +06:00
|
|
|
{
|
2021-03-17 19:11:57 +05:00
|
|
|
SMESH::smIdType_array_var nbElemOfType = idSource->GetMeshInfo();
|
2013-03-06 19:57:01 +06:00
|
|
|
|
2013-05-16 23:17:56 +06:00
|
|
|
bool hasBiQuad = ( nbElemOfType[SMDSEntity_BiQuad_Triangle ] ||
|
|
|
|
nbElemOfType[SMDSEntity_BiQuad_Quadrangle ] ||
|
2017-09-07 17:04:57 +05:00
|
|
|
nbElemOfType[SMDSEntity_BiQuad_Penta ] ||
|
2013-03-06 19:57:01 +06:00
|
|
|
nbElemOfType[SMDSEntity_TriQuad_Hexa ] );
|
2013-05-16 23:17:56 +06:00
|
|
|
bool hasLinBiQuad = ( nbElemOfType[SMDSEntity_Triangle ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Quadrangle ] ||
|
2013-03-06 19:57:01 +06:00
|
|
|
nbElemOfType[SMDSEntity_Hexa ] );
|
2013-05-16 23:17:56 +06:00
|
|
|
bool hasQuadBiQuad = ( nbElemOfType[SMDSEntity_Quad_Triangle ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Quad_Quadrangle ] ||
|
2013-03-06 19:57:01 +06:00
|
|
|
nbElemOfType[SMDSEntity_Quad_Hexa ] );
|
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
bool hasQuad = ( nbElemOfType[SMDSEntity_Quad_Edge ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Quad_Triangle ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Quad_Quadrangle] ||
|
|
|
|
nbElemOfType[SMDSEntity_Quad_Tetra ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Quad_Hexa ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Quad_Pyramid ] ||
|
2015-07-09 14:41:53 +05:00
|
|
|
nbElemOfType[SMDSEntity_Quad_Polygon ] ||
|
2012-08-09 16:03:55 +06:00
|
|
|
nbElemOfType[SMDSEntity_Quad_Penta ] );
|
|
|
|
|
|
|
|
bool hasLin = ( nbElemOfType[SMDSEntity_Edge ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Triangle ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Quadrangle] ||
|
|
|
|
nbElemOfType[SMDSEntity_Tetra ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Hexa ] ||
|
|
|
|
nbElemOfType[SMDSEntity_Pyramid ] ||
|
2015-07-09 14:41:53 +05:00
|
|
|
nbElemOfType[SMDSEntity_Polygon ] ||
|
2012-08-09 16:03:55 +06:00
|
|
|
nbElemOfType[SMDSEntity_Penta ] );
|
|
|
|
|
2013-03-06 19:57:01 +06:00
|
|
|
int tgtType = 0;
|
|
|
|
if ( hasBiQuad )
|
|
|
|
tgtType |= ( Quadratic | Linear );
|
2013-05-16 23:17:56 +06:00
|
|
|
if ( hasLinBiQuad )
|
2013-03-06 19:57:01 +06:00
|
|
|
tgtType |= ( BiQuadratic | Quadratic );
|
2013-05-16 23:17:56 +06:00
|
|
|
if ( hasQuadBiQuad )
|
2013-03-06 19:57:01 +06:00
|
|
|
tgtType |= ( BiQuadratic | Linear );
|
|
|
|
if ( hasQuad )
|
|
|
|
tgtType |= Linear;
|
|
|
|
if ( hasLin )
|
|
|
|
tgtType |= Quadratic;
|
|
|
|
|
|
|
|
if ( tgtType == 0 )
|
|
|
|
tgtType = Quadratic;
|
|
|
|
|
|
|
|
if ( isMixOrder )
|
|
|
|
*isMixOrder = ( hasLin && ( hasQuad || hasBiQuad ));
|
|
|
|
|
|
|
|
return MeshDestinationType( tgtType );
|
2006-05-06 14:51:48 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
void SMESHGUI_ConvToQuadOp::ConnectRadioButtons( int id )
|
|
|
|
{
|
2012-08-09 16:03:55 +06:00
|
|
|
QString anObjEntry = myDlg->selectedObject( 0 );
|
2018-01-22 13:57:06 +05:00
|
|
|
_PTR(SObject) pObj = SMESH::getStudy()->FindObjectID( anObjEntry.toUtf8().data() );
|
2012-08-09 16:03:55 +06:00
|
|
|
if ( !pObj ) return;
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
SMESH::SMESH_IDSource_var idSource =
|
|
|
|
SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( pObj );
|
|
|
|
SMESH::SMESH_Mesh_var mesh = idSource->GetMesh();
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2012-08-09 16:03:55 +06:00
|
|
|
bool hasGeom = mesh->HasShapeToMesh();
|
2006-05-06 14:51:48 +06:00
|
|
|
|
2013-03-06 19:57:01 +06:00
|
|
|
if( id==0 || !hasGeom )
|
2006-05-06 14:51:48 +06:00
|
|
|
myDlg->SetEnabledCheck( false );
|
|
|
|
else
|
|
|
|
myDlg->SetEnabledCheck( true );
|
|
|
|
}
|