namespace {
-const int SPACING = 6;
-const int MARGIN = 9;
-const int MAXITEMS = 10;
-const int GROUPS_ID = 100;
-const int SUBMESHES_ID = 200;
-const int SPACING_INFO = 2;
-
-enum InfoRole {
- TypeRole = Qt::UserRole + 10,
- IdRole,
-};
-
-enum InfoType {
- NodeConnectivity = 100,
- ElemConnectivity,
-};
+ const int SPACING = 6;
+ const int MARGIN = 9;
+ const int MAXITEMS = 10;
+ const int GROUPS_ID = 100;
+ const int SUBMESHES_ID = 200;
+ const int SPACING_INFO = 2;
+
+ const char* id_preview_resource = "id_preview_resource";
+
+ enum InfoRole {
+ TypeRole = Qt::UserRole + 10,
+ IdRole,
+ };
+
+ enum InfoType {
+ NodeConnectivity = 100,
+ ElemConnectivity,
+ };
} // namesapce
/*!
a3DPriLin->setObjectName("nbLinearPrism");
QLabel* a3DPriQuad = createField();
a3DPriQuad->setObjectName("nbQuadraticPrism");
+ QLabel* a3DPriBiQuad = createField();
+ a3DPriBiQuad->setObjectName("nbBiQuadraticPrism");
QLabel* a3DHexPriLab = new QLabel( tr( "HEX_PRISMS_LAB" ), this );
QLabel* a3DHexPriTotal = createField();
a3DHexPriTotal->setObjectName("nbHexagonalPrism");
myWidgets[ index++ ] << a3DTetLab << a3DTetTotal << a3DTetLin << a3DTetQuad;
myWidgets[ index++ ] << a3DHexLab << a3DHexTotal << a3DHexLin << a3DHexQuad << a3DHexBiQuad;
myWidgets[ index++ ] << a3DPyrLab << a3DPyrTotal << a3DPyrLin << a3DPyrQuad;
- myWidgets[ index++ ] << a3DPriLab << a3DPriTotal << a3DPriLin << a3DPriQuad;
+ myWidgets[ index++ ] << a3DPriLab << a3DPriTotal << a3DPriLin << a3DPriQuad << a3DPriBiQuad;
myWidgets[ index++ ] << a3DHexPriLab << a3DHexPriTotal;
myWidgets[ index++ ] << a3DPolLab << a3DPolTotal;
l->addWidget( a3DPriTotal, 24, 1 );
l->addWidget( a3DPriLin, 24, 2 );
l->addWidget( a3DPriQuad, 24, 3 );
+ l->addWidget( a3DPriBiQuad, 24, 4 );
l->addWidget( a3DHexPriLab, 25, 0 );
l->addWidget( a3DHexPriTotal, 25, 1 );
l->addWidget( a3DPolLab, 26, 0 );
long nbTetrahedrons = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra];
long nbHexahedrons = info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa];
long nbPyramids = info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid];
- long nbPrisms = info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta];
+ long nbPrisms = info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta] + info[SMDSEntity_BiQuad_Penta];
long nb3DLinear = info[SMDSEntity_Tetra] + info[SMDSEntity_Hexa] + info[SMDSEntity_Pyramid] + info[SMDSEntity_Penta] + info[SMDSEntity_Polyhedra] + info[SMDSEntity_Hexagonal_Prism];
long nb3DQuadratic = info[SMDSEntity_Quad_Tetra] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_Quad_Pyramid] + info[SMDSEntity_Quad_Penta];
- long nb3DBiQuadratic = info[SMDSEntity_TriQuad_Hexa];
+ long nb3DBiQuadratic = info[SMDSEntity_TriQuad_Hexa] + info[SMDSEntity_BiQuad_Penta];
long nb3DTotal = nb3DLinear + nb3DQuadratic + nb3DBiQuadratic;
myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( nb3DTotal ));
myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( nb3DLinear ));
myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( nbPrisms ));
myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Penta] ));
myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Penta] ));
+ myWidgets[i3DPrisms][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_BiQuad_Penta] ));
myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ));
myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ));
long nbElemTotal = info[SMDSEntity_0D] + info[SMDSEntity_Ball] + nbEdges + nb2DTotal + nb3DTotal;
\brief Set mesh data source (actor)
\param actor mesh object actor
*/
-void SMESHGUI_ElemInfo::setSource( SMESH_Actor* actor )
+void SMESHGUI_ElemInfo::setSource( SMESH_Actor* actor, SMESH::SMESH_IDSource_var obj )
{
if ( myActor != actor ) {
myActor = actor;
myIsElement = -1;
+ SMESH::SMESH_Mesh_var mesh = obj->GetMesh();
+ myMeshHasShape = ( !mesh->_is_nil() && mesh->HasShapeToMesh() );
clear();
}
}
gtype = SMESHGUI_ElemInfo::tr( "HEXAHEDRON" ); break;
case SMDSEntity_Penta:
case SMDSEntity_Quad_Penta:
+ case SMDSEntity_BiQuad_Penta:
gtype = SMESHGUI_ElemInfo::tr( "PRISM" ); break;
case SMDSEntity_Hexagonal_Prism:
gtype = SMESHGUI_ElemInfo::tr( "HEX_PRISM" ); break;
//ElemDiam2D
afunctor.reset( new SMESH::Controls::MaxElementLength2D() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ afunctor->SetPrecision( cprecision );
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_2D" )).arg( afunctor->GetValue( id )) );
+ //min edge length
+ afunctor.reset( new SMESH::Controls::Length2D() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MIN_ELEM_EDGE" )).arg( afunctor->GetValue( id )) );
}
if( e->GetType() == SMDSAbs_Volume ) {
//AspectRatio3D
gtype = SMESHGUI_ElemInfo::tr( "HEXAHEDRON" ); break;
case SMDSEntity_Penta:
case SMDSEntity_Quad_Penta:
+ case SMDSEntity_BiQuad_Penta:
gtype = SMESHGUI_ElemInfo::tr( "PRISM" ); break;
case SMDSEntity_Hexagonal_Prism:
gtype = SMESHGUI_ElemInfo::tr( "HEX_PRISM" ); break;
skewItem->setText( 0, tr( "SKEW_ELEMENTS" ));
skewItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
}
+ //Deflection
+ if ( hasShapeToMesh() )
+ {
+ afunctor.reset( new SMESH::Controls::Deflection2D() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ QTreeWidgetItem* deflItem = createItem( cntrItem, Bold );
+ deflItem->setText( 0, tr( "DEFLECTION_2D" ));
+ deflItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+ }
//ElemDiam2D
if ( !e->IsPoly() )
{
diam3Item->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
}
+ //min edge length
+ afunctor.reset( new SMESH::Controls::Length2D() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ QTreeWidgetItem* minEdgeItem = createItem( cntrItem, Bold );
+ minEdgeItem->setText( 0, tr( "MIN_ELEM_EDGE" ));
+ minEdgeItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
+
// gravity center
XYZ gc = gravityCenter( e );
QTreeWidgetItem* gcItem = createItem( elemItem, Bold );
connect( myElemInfo, SIGNAL( itemInfo( int )), this, SLOT( showItemInfo( int )));
connect( myElemInfo, SIGNAL( itemInfo( QString )), this, SLOT( showItemInfo( QString )));
+ myIDPreviewCheck->setChecked( SMESHGUI::resourceMgr()->booleanValue( "SMESH", id_preview_resource, false ));
+
updateSelection();
}
SMESH::GetNameOfSelectedElements( selector, IO, ID ) :
SMESH::GetNameOfSelectedNodes( selector, IO, ID );
}
- myElemInfo->setSource( myActor ) ;
+ myElemInfo->setSource( myActor, obj ) ;
if ( nb > 0 ) {
myID->setText( ID.trimmed() );
QSet<long> ids;
void SMESHGUI_MeshInfoDlg::idPreviewChange( bool isOn )
{
myIDPreview->SetPointsLabeled( isOn && !myID->text().simplified().isEmpty() );
+ SMESHGUI::resourceMgr()->setValue("SMESH", id_preview_resource, isOn );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow() )
aViewWindow->Repaint();
}