mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-11 16:19:16 +05:00
IPAL53870: Dump study script creates an excess sub-mesh
+ Allow Quadratic Mesh hypothesis on sub-meshes for http://www.salome-platform.org/forum/forum_14/325180606/861648983 + Remove unfeasible controls from Mesh Element Info
This commit is contained in:
parent
92bb7ceb6e
commit
b2eb2c3cef
@ -165,7 +165,6 @@
|
||||
label-id ="Quadratic Mesh"
|
||||
icon-id ="mesh_algo_quad.png"
|
||||
dim ="1"
|
||||
context ="GLOBAL"
|
||||
auxiliary="true"/>
|
||||
|
||||
<hypothesis type ="MaxElementArea"
|
||||
|
@ -1973,25 +1973,14 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
|
||||
areaItem->setText( 0, tr( "AREA_ELEMENTS" ) );
|
||||
areaItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue(id) ) );
|
||||
//Taper
|
||||
if ( e->NbNodes() == 4 ) // see SMESH_Controls.cxx
|
||||
{
|
||||
afunctor.reset( new SMESH::Controls::Taper() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
afunctor->SetPrecision( cprecision );
|
||||
QTreeWidgetItem* taperlItem = createItem( cntrItem, Bold );
|
||||
taperlItem->setText( 0, tr( "TAPER_ELEMENTS" ) );
|
||||
taperlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
//AspectRatio2D
|
||||
afunctor.reset( new SMESH::Controls::AspectRatio() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
QTreeWidgetItem* ratlItem = createItem( cntrItem, Bold );
|
||||
ratlItem->setText( 0, tr( "ASPECTRATIO_ELEMENTS" ));
|
||||
ratlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
//Minimum angle
|
||||
afunctor.reset( new SMESH::Controls::MinimumAngle() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
afunctor->SetPrecision( cprecision );
|
||||
QTreeWidgetItem* minanglItem = createItem( cntrItem, Bold );
|
||||
minanglItem->setText( 0, tr( "MINIMUMANGLE_ELEMENTS" ) );
|
||||
minanglItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
//Wraping angle
|
||||
afunctor.reset( new SMESH::Controls::Warping() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
@ -1999,27 +1988,53 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
|
||||
QTreeWidgetItem* warpItem = createItem( cntrItem, Bold );
|
||||
warpItem->setText( 0, tr( "WARP_ELEMENTS" ));
|
||||
warpItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
}
|
||||
//AspectRatio2D
|
||||
if ( !e->IsPoly() )
|
||||
{
|
||||
afunctor.reset( new SMESH::Controls::AspectRatio() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
QTreeWidgetItem* ratlItem = createItem( cntrItem, Bold );
|
||||
ratlItem->setText( 0, tr( "ASPECTRATIO_ELEMENTS" ));
|
||||
ratlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
}
|
||||
//Minimum angle
|
||||
afunctor.reset( new SMESH::Controls::MinimumAngle() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
afunctor->SetPrecision( cprecision );
|
||||
QTreeWidgetItem* minanglItem = createItem( cntrItem, Bold );
|
||||
minanglItem->setText( 0, tr( "MINIMUMANGLE_ELEMENTS" ) );
|
||||
minanglItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
//Skew
|
||||
if ( e->NbNodes() == 3 || e->NbNodes() == 4 )
|
||||
{
|
||||
afunctor.reset( new SMESH::Controls::Skew() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
afunctor->SetPrecision( cprecision );
|
||||
QTreeWidgetItem* skewItem = createItem( cntrItem, Bold );
|
||||
skewItem->setText( 0, tr( "SKEW_ELEMENTS" ) );
|
||||
skewItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
}
|
||||
//ElemDiam2D
|
||||
if ( !e->IsPoly() )
|
||||
{
|
||||
afunctor.reset( new SMESH::Controls::MaxElementLength2D() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
QTreeWidgetItem* diamItem = createItem( cntrItem, Bold );
|
||||
diamItem->setText( 0, tr( "MAX_ELEMENT_LENGTH_2D" ));
|
||||
diamItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
}
|
||||
}
|
||||
if( e->GetType() == SMDSAbs_Volume ) {
|
||||
if ( !e->IsPoly() )
|
||||
{
|
||||
//AspectRatio3D
|
||||
afunctor.reset( new SMESH::Controls::AspectRatio3D() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
QTreeWidgetItem* ratlItem3 = createItem( cntrItem, Bold );
|
||||
ratlItem3->setText( 0, tr( "ASPECTRATIO_3D_ELEMENTS" ) );
|
||||
ratlItem3->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
|
||||
}
|
||||
//Volume
|
||||
afunctor.reset( new SMESH::Controls::Volume() );
|
||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||
|
@ -2048,7 +2048,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand )
|
||||
{
|
||||
addCmd = *cmd;
|
||||
cmd = addHypCmds.erase( cmd );
|
||||
if ( !theGen->IsToKeepAllCommands() && CanClear() ) {
|
||||
if ( !theGen->IsToKeepAllCommands() /*&& CanClear()*/ ) {
|
||||
addCmd->Clear();
|
||||
theCommand->Clear();
|
||||
}
|
||||
@ -3474,28 +3474,31 @@ bool _pySegmentLengthAroundVertexHyp::Addition2Creation( const Handle(_pyCommand
|
||||
|
||||
_pyID vertex = theCmd->GetArg( 1 );
|
||||
|
||||
// the problem here is that segment algo will not be found
|
||||
// the problem here is that segment algo can be not found
|
||||
// by pyHypothesis::Addition2Creation() for <vertex>, so we try to find
|
||||
// geometry where segment algorithm is assigned
|
||||
Handle(_pyHypothesis) algo;
|
||||
_pyID geom = vertex;
|
||||
Handle(_pyHypothesis) algo = theGen->FindAlgo( geom, theMeshID, this );
|
||||
while ( algo.IsNull() && !geom.IsEmpty()) {
|
||||
// try to find geom as a father of <vertex>
|
||||
geom = FatherID( geom );
|
||||
algo = theGen->FindAlgo( geom, theMeshID, this );
|
||||
}
|
||||
if ( algo.IsNull() )
|
||||
if ( algo.IsNull() || geom.IsEmpty() )
|
||||
return false; // also possible to find geom as brother of veretex...
|
||||
|
||||
// set geom instead of vertex
|
||||
theCmd->SetArg( 1, geom );
|
||||
|
||||
// set vertex as a second arg
|
||||
if ( myCurCrMethod->myArgs.size() < 1) setCreationArg( 1, "1" ); // :(
|
||||
setCreationArg( 2, vertex );
|
||||
|
||||
// mesh.AddHypothesis(vertex, SegmentLengthAroundVertex) -->
|
||||
// theMeshID.LengthNearVertex( length, vertex )
|
||||
return _pyHypothesis::Addition2Creation( theCmd, theMeshID );
|
||||
// SegmentLengthAroundVertex = Regular_1D.LengthNearVertex( length )
|
||||
if ( _pyHypothesis::Addition2Creation( theCmd, theMeshID ))
|
||||
{
|
||||
// set vertex as a second arg
|
||||
theCmd->SetArg( 2, vertex );
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -381,6 +381,7 @@ class StdMeshersBuilder_Segment(Mesh_Algorithm):
|
||||
pass
|
||||
# 0D algorithm
|
||||
if self.geom is None:
|
||||
self.geom = store_geom
|
||||
raise RuntimeError, "Attemp to create SegmentAroundVertex_0D algoritm on None shape"
|
||||
from salome.smesh.smeshBuilder import AssureGeomPublished, GetName, TreatHypoStatus
|
||||
AssureGeomPublished( self.mesh, self.geom )
|
||||
|
Loading…
Reference in New Issue
Block a user