+ i->setData( 1, TypeRole, NodeConnectivity );
+ }
+ }
+ }
+ //Controls
+ QTreeWidgetItem* cntrItem = createItem( elemItem, Bold );
+ cntrItem->setText( 0, SMESHGUI_ElemInfo::tr( "CONTROLS" ) );
+ //Length
+ if( e->GetType()==SMDSAbs_Edge){
+ afunctor.reset( new SMESH::Controls::Length() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ afunctor->SetPrecision( cprecision );
+ QTreeWidgetItem* lenItem = createItem( cntrItem, Bold );
+ lenItem->setText( 0, tr( "LENGTH_EDGES" ) );
+ lenItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ }
+ if( e->GetType() == SMDSAbs_Face ) {
+ //Area
+ afunctor.reset( new SMESH::Controls::Area() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ afunctor->SetPrecision( cprecision );
+ QTreeWidgetItem* areaItem = createItem( cntrItem, Bold );
+ areaItem->setText( 0, tr( "AREA_ELEMENTS" ) );
+ areaItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue(id) ) );
+ //Taper
+ 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() );
+ afunctor->SetPrecision( cprecision );
+ QTreeWidgetItem* warpItem = createItem( cntrItem, Bold );
+ warpItem->setText( 0, tr( "WARP_ELEMENTS" ));
+ warpItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ //Skew
+ 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
+ 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 ) {
+ //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() );
+ QTreeWidgetItem* volItem = createItem( cntrItem, Bold );
+ volItem->setText( 0, tr( "VOLUME_3D_ELEMENTS" ) );
+ volItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ //ElementDiameter3D
+ afunctor.reset( new SMESH::Controls::MaxElementLength3D() );
+ afunctor->SetMesh( actor()->GetObject()->GetMesh() );
+ QTreeWidgetItem* diam3Item = createItem( cntrItem, Bold );
+ diam3Item->setText( 0, tr( "MAX_ELEMENT_LENGTH_3D" ) );
+ diam3Item->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
+ }
+ // element position
+ if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
+ SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
+ if ( !CORBA::is_nil( aMesh ) ) {
+ SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
+ int shapeID = pos.shapeID;
+ if ( shapeID > 0 ) {
+ QTreeWidgetItem* shItem = createItem( elemItem, Bold );
+ QString shapeType;
+ switch ( pos.shapeType ) {
+ case GEOM::EDGE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" ); break;
+ case GEOM::FACE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" ); break;
+ case GEOM::VERTEX: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" ); break;
+ case GEOM::SOLID: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" ); break;
+ case GEOM::SHELL: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHELL" ); break;
+ default: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SHAPE" ); break;
+ }
+ shItem->setText( 0, SMESHGUI_ElemInfo::tr( "POSITION" ) );
+ shItem->setText( 1, QString( "%1 #%2" ).arg( shapeType ).arg( shapeID ) );
+ }
+ }
+ }
+ // groups element belongs to
+ SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
+ if ( !CORBA::is_nil( aMesh ) ) {
+ SMESH::ListOfGroups_var groups = aMesh->GetGroups();
+ QTreeWidgetItem* groupsItem = 0;
+ for ( int i = 0; i < groups->length(); i++ ) {
+ SMESH::SMESH_GroupBase_var aGrp = groups[i];
+ if ( CORBA::is_nil( aGrp ) ) continue;
+ QString aName = aGrp->GetName();
+ if ( aGrp->GetType() != SMESH::NODE && !aName.isEmpty() && aGrp->Contains( id ) ) {
+ if ( !groupsItem ) {
+ groupsItem = createItem( elemItem, Bold );
+ groupsItem->setText( 0, SMESHGUI_AddInfo::tr( "GROUPS" ) );
+ }
+ QTreeWidgetItem* it = createItem( groupsItem, Bold );
+ it->setText( 0, aName.trimmed() );
+ if ( grp_details ) {
+ SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
+ SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
+ SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
+
+ // type : group on geometry, standalone group, group on filter
+ QTreeWidgetItem* typeItem = createItem( it );
+ typeItem->setText( 0, SMESHGUI_AddInfo::tr( "TYPE" ) );
+ if ( !CORBA::is_nil( aStdGroup ) ) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "STANDALONE_GROUP" ) );
+ }
+ else if ( !CORBA::is_nil( aGeomGroup ) ) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_GEOMETRY" ) );
+ GEOM::GEOM_Object_var gobj = aGeomGroup->GetShape();
+ _PTR(SObject) sobj = SMESH::ObjectToSObject( gobj );
+ if ( sobj ) {
+ QTreeWidgetItem* gobjItem = createItem( typeItem );
+ gobjItem->setText( 0, SMESHGUI_AddInfo::tr( "GEOM_OBJECT" ) );
+ gobjItem->setText( 1, sobj->GetName().c_str() );
+ }
+ }
+ else if ( !CORBA::is_nil( aFltGroup ) ) {
+ typeItem->setText( 1, SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" ) );
+ }
+
+ // size
+ QTreeWidgetItem* sizeItem = createItem( it );
+ sizeItem->setText( 0, SMESHGUI_AddInfo::tr( "SIZE" ) );
+ sizeItem->setText( 1, QString::number( aGrp->Size() ) );
+
+ // color
+ SALOMEDS::Color color = aGrp->GetColor();
+ QTreeWidgetItem* colorItem = createItem( it );
+ colorItem->setText( 0, SMESHGUI_AddInfo::tr( "COLOR" ) );
+ colorItem->setBackground( 1, QBrush( QColor( color.R*255., color.G*255., color.B*255.) ) );
+ }