mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 11:30:37 +05:00
0020978: EDF 1475 SMESH: Convert linear to quadratic on a submesh
class SMESH_MeshEditor_i { + void ConvertToQuadraticObject(CORBA::Boolean theForce3d, + SMESH::SMESH_IDSource_ptr theObject) + void ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
This commit is contained in:
parent
77e2a3970b
commit
8b06eac8bd
@ -1160,7 +1160,7 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
|
||||
bool isPyMeshMethod = sameMethods.Contains( method );
|
||||
if ( !isPyMeshMethod )
|
||||
{
|
||||
//Replace SMESH_MeshEditor "MakeGroups" functions on the Mesh
|
||||
//Replace SMESH_MeshEditor "MakeGroups" functions by the Mesh
|
||||
//functions with the flag "theMakeGroups = True" like:
|
||||
//SMESH_MeshEditor.CmdMakeGroups => Mesh.Cmd(...,True)
|
||||
int pos = method.Search("MakeGroups");
|
||||
@ -1197,13 +1197,28 @@ void _pyMeshEditor::Process( const Handle(_pyCommand)& theCommand)
|
||||
// DoubleNodeGroupNew() -> DoubleNodeGroup()
|
||||
// DoubleNodeGroupsNew() -> DoubleNodeGroups()
|
||||
// DoubleNodeElemGroupsNew() -> DoubleNodeElemGroups()
|
||||
if ( !isPyMeshMethod && ( method == "DoubleNodeElemGroupNew" || method == "DoubleNodeElemGroupsNew" ||
|
||||
method == "DoubleNodeGroupNew" || method == "DoubleNodeGroupsNew"))
|
||||
if ( !isPyMeshMethod && ( method == "DoubleNodeElemGroupNew" ||
|
||||
method == "DoubleNodeElemGroupsNew" ||
|
||||
method == "DoubleNodeGroupNew" ||
|
||||
method == "DoubleNodeGroupsNew"))
|
||||
{
|
||||
isPyMeshMethod=true;
|
||||
theCommand->SetMethod( method.SubString( 1, method.Length()-3));
|
||||
theCommand->SetArg(theCommand->GetNbArgs()+1,"True");
|
||||
}
|
||||
// ConvertToQuadraticObject(bool,obj) -> ConvertToQuadratic(bool,obj)
|
||||
// ConvertFromQuadraticObject(obj) -> ConvertFromQuadratic(obj)
|
||||
if ( !isPyMeshMethod && ( method == "ConvertToQuadraticObject" ||
|
||||
method == "ConvertFromQuadraticObject" ))
|
||||
{
|
||||
isPyMeshMethod=true;
|
||||
theCommand->SetMethod( method.SubString( 1, method.Length()-6));
|
||||
// prevent moving creation of the converted sub-mesh to the end of the script
|
||||
bool isFromQua = ( method.Value( 8 ) == 'F' );
|
||||
Handle(_pySubMesh) sm = theGen->FindSubMesh( theCommand->GetArg( isFromQua ? 1 : 2 ));
|
||||
if ( !sm.IsNull() )
|
||||
sm->Process( theCommand );
|
||||
}
|
||||
|
||||
// meshes made by *MakeMesh() methods are not wrapped by _pyMesh,
|
||||
// so let _pyMesh care of it (TMP?)
|
||||
@ -2510,7 +2525,7 @@ void _pySubMesh::Process( const Handle(_pyCommand)& theCommand )
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Clear creatin command if no commands invoked
|
||||
* \brief Clear creation command if no commands invoked
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
|
@ -4785,6 +4785,74 @@ CORBA::Boolean SMESH_MeshEditor_i::ConvertFromQuadratic()
|
||||
myMesh->SetIsModified( true );
|
||||
return isDone;
|
||||
}
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Makes a part of the mesh quadratic
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
void SMESH_MeshEditor_i::ConvertToQuadraticObject(CORBA::Boolean theForce3d,
|
||||
SMESH::SMESH_IDSource_ptr theObject)
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
Unexpect aCatch(SALOME_SalomeException);
|
||||
TPythonDump pyDump;
|
||||
TIDSortedElemSet elems;
|
||||
if ( idSourceToSet( theObject, GetMeshDS(), elems, SMDSAbs_All, /*emptyIfIsMesh=*/true ))
|
||||
{
|
||||
if ( elems.empty() )
|
||||
{
|
||||
ConvertToQuadratic( theForce3d );
|
||||
}
|
||||
else if ( (*elems.begin())->GetType() == SMDSAbs_Node )
|
||||
{
|
||||
THROW_SALOME_CORBA_EXCEPTION("Group of nodes is not allowed", SALOME::BAD_PARAM);
|
||||
}
|
||||
else
|
||||
{
|
||||
::SMESH_MeshEditor anEditor( myMesh );
|
||||
anEditor.ConvertToQuadratic(theForce3d, elems);
|
||||
}
|
||||
}
|
||||
myMesh->GetMeshDS()->Modified();
|
||||
myMesh->SetIsModified( true );
|
||||
|
||||
pyDump << this << ".ConvertToQuadraticObject( "<<theForce3d<<", "<<theObject<<" )";
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Makes a part of the mesh linear
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
void SMESH_MeshEditor_i::ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
|
||||
throw (SALOME::SALOME_Exception)
|
||||
{
|
||||
Unexpect aCatch(SALOME_SalomeException);
|
||||
TPythonDump pyDump;
|
||||
TIDSortedElemSet elems;
|
||||
if ( idSourceToSet( theObject, GetMeshDS(), elems, SMDSAbs_All, /*emptyIfIsMesh=*/true ))
|
||||
{
|
||||
if ( elems.empty() )
|
||||
{
|
||||
ConvertFromQuadratic();
|
||||
}
|
||||
else if ( (*elems.begin())->GetType() == SMDSAbs_Node )
|
||||
{
|
||||
THROW_SALOME_CORBA_EXCEPTION("Group of nodes is not allowed", SALOME::BAD_PARAM);
|
||||
}
|
||||
else
|
||||
{
|
||||
::SMESH_MeshEditor anEditor( myMesh );
|
||||
anEditor.ConvertFromQuadratic(elems);
|
||||
}
|
||||
}
|
||||
myMesh->GetMeshDS()->Modified();
|
||||
myMesh->SetIsModified( true );
|
||||
|
||||
pyDump << this << ".ConvertFromQuadraticObject( "<<theObject<<" )";
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : makeMesh
|
||||
|
@ -179,6 +179,11 @@ public:
|
||||
|
||||
void ConvertToQuadratic(CORBA::Boolean Force3d);
|
||||
CORBA::Boolean ConvertFromQuadratic();
|
||||
void ConvertToQuadraticObject(CORBA::Boolean theForce3d,
|
||||
SMESH::SMESH_IDSource_ptr theObject)
|
||||
throw (SALOME::SALOME_Exception);
|
||||
void ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
|
||||
throw (SALOME::SALOME_Exception);
|
||||
|
||||
void RenumberNodes();
|
||||
void RenumberElements();
|
||||
|
Loading…
Reference in New Issue
Block a user