mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-04 15:15:38 +05:00
[SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D
//================================================================================ /*! + * \brief Return name of the algorithm that does not support submeshes and makes + * submesh creation useless + * \retval char* - string is to be deleted!!! + */ +//================================================================================ + +char* SMESHGUI_MeshOp::isSubmeshIgnored() const
This commit is contained in:
parent
2bc1c40f58
commit
8e7cd4625d
@ -340,6 +340,53 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const
|
||||
return false;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return name of the algorithm that does not support submeshes and makes
|
||||
* submesh creation useless
|
||||
* \retval char* - string is to be deleted!!!
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
char* SMESHGUI_MeshOp::isSubmeshIgnored() const
|
||||
{
|
||||
if ( myToCreate && !myIsMesh ) {
|
||||
|
||||
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
|
||||
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
|
||||
_PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() );
|
||||
if ( pMesh ) {
|
||||
|
||||
QStringList algoNames;
|
||||
THypList algoList;
|
||||
existingHyps(3, Algo, pMesh, algoNames, algoList);
|
||||
if (!algoList.empty()) {
|
||||
HypothesisData* algo = SMESH::GetHypothesisData( algoList[0].first->GetName() );
|
||||
if ( algo &&
|
||||
algo->InputTypes.empty() && // builds all dimensions it-self
|
||||
!algo->IsSupportSubmeshes )
|
||||
return CORBA::string_dup( algoNames[0].latin1() );
|
||||
}
|
||||
|
||||
// GEOM::GEOM_Object_var geom;
|
||||
// if (_PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() ))
|
||||
// geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
|
||||
|
||||
// if ( !geom->_is_nil() && geom->GetShapeType() >= GEOM::FACE ) { // WIRE, EDGE as well
|
||||
existingHyps(2, Algo, pMesh, algoNames, algoList);
|
||||
if (!algoList.empty()) {
|
||||
HypothesisData* algo = SMESH::GetHypothesisData( algoList[0].first->GetName() );
|
||||
if ( algo &&
|
||||
algo->InputTypes.empty() && // builds all dimensions it-self
|
||||
!algo->IsSupportSubmeshes )
|
||||
return CORBA::string_dup( algoNames[0].latin1() );
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief find an existing submesh by the selected shape
|
||||
@ -526,8 +573,20 @@ void SMESHGUI_MeshOp::selectionDone()
|
||||
myDlg->selectObject( "", SMESHGUI_MeshDlg::Geom, "" );
|
||||
selectObject( _PTR(SObject)() );
|
||||
selectionDone();
|
||||
return;
|
||||
}
|
||||
}
|
||||
// discard selected mesh if submesh creation not allowed because of
|
||||
// a global algorithm that does not support submeshes
|
||||
if ( char* algoName = isSubmeshIgnored() ) {
|
||||
SUIT_MessageBox::warn1( myDlg, tr( "SMESH_ERROR" ),
|
||||
tr("SUBMESH_NOT_ALLOWED").arg(algoName), tr( "SMESH_BUT_OK" ));
|
||||
CORBA::string_free( algoName );
|
||||
myDlg->selectObject( "", SMESHGUI_MeshDlg::Mesh, "" );
|
||||
selectObject( _PTR(SObject)() );
|
||||
selectionDone();
|
||||
return;
|
||||
}
|
||||
|
||||
// enable/disable popup for choice of geom selection way
|
||||
bool enable = false;
|
||||
|
@ -100,7 +100,7 @@ private:
|
||||
QStringList& theHyps,
|
||||
THypDataList& theDataList,
|
||||
HypothesisData* theAlgoData = 0 ) const;
|
||||
void existingHyps( const int theDim,
|
||||
static void existingHyps( const int theDim,
|
||||
const int theHypType,
|
||||
_PTR(SObject) theFather,
|
||||
QStringList& theHyps,
|
||||
@ -129,6 +129,7 @@ private:
|
||||
SMESH::SMESH_Hypothesis_var getInitParamsHypothesis( const QString& aHypType,
|
||||
const QString& aServerLib ) const;
|
||||
bool isSubshapeOk() const;
|
||||
char* isSubmeshIgnored() const;
|
||||
_PTR(SObject) getSubmeshByGeom() const;
|
||||
void selectObject( _PTR(SObject) ) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user