- int shapeID = node->getshapeId();
- if ( shapeID > 0 )
- {
- SMDS_PositionPtr pos = node->GetPosition();
- SMDS_TypeOfPosition posType = pos->GetTypeOfPosition();
- QString shapeType;
- double u,v;
- switch ( posType ) {
- case SMDS_TOP_EDGE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
- u = static_cast<SMDS_EdgePosition*>( pos )->GetUParameter();
- break;
- case SMDS_TOP_FACE: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" );
- u = static_cast<SMDS_FacePosition*>( pos )->GetUParameter();
- v = static_cast<SMDS_FacePosition*>( pos )->GetVParameter();
- break;
- case SMDS_TOP_VERTEX: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" );
- break;
- default: shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" );
- break;
- }
- QTreeWidgetItem* posItem = createItem( nodeItem, Bold );
- posItem->setText( 0, SMESHGUI_ElemInfo::tr("POSITION") );
- posItem->setText( 1, (shapeType + " #%1").arg( shapeID ));
- if ( posType == SMDS_TOP_EDGE || posType == SMDS_TOP_FACE ) {
- QTreeWidgetItem* uItem = createItem( posItem );
- uItem->setText( 0, SMESHGUI_ElemInfo::tr("U_POSITION") );
- uItem->setText( 1, QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )));
- if ( posType == SMDS_TOP_FACE ) {
- QTreeWidgetItem* vItem = createItem( posItem );
- vItem->setText( 0, SMESHGUI_ElemInfo::tr("V_POSITION") );
- vItem->setText( 1, QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )));
- }
- }
- }
+ SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
+ if ( !CORBA::is_nil( aMeshPtr ) ) {
+ SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
+ int shapeID = pos->shapeID;
+ if ( shapeID > 0 ) {
+ QString shapeType;
+ double u, v;
+ switch ( pos->shapeType ) {
+ case GEOM::EDGE:
+ shapeType = SMESHGUI_ElemInfo::tr( "GEOM_EDGE" );
+ if ( pos->params.length() == 1 )
+ u = pos->params[0];
+ break;
+ case GEOM::FACE:
+ shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" );
+ if ( pos->params.length() == 2 ) {
+ u = pos->params[0];
+ v = pos->params[1];
+ }
+ break;
+ case GEOM::VERTEX:
+ shapeType = SMESHGUI_ElemInfo::tr( "GEOM_VERTEX" );
+ break;
+ default:
+ shapeType = SMESHGUI_ElemInfo::tr( "GEOM_SOLID" );
+ break;
+ }
+ QTreeWidgetItem* posItem = createItem( nodeItem, Bold );
+ posItem->setText( 0, SMESHGUI_ElemInfo::tr("POSITION") );
+ posItem->setText( 1, (shapeType + " #%1").arg( shapeID ));
+ if ( pos->shapeType == GEOM::EDGE || pos->shapeType == GEOM::FACE ) {
+ QTreeWidgetItem* uItem = createItem( posItem );
+ uItem->setText( 0, SMESHGUI_ElemInfo::tr("U_POSITION") );
+ uItem->setText( 1, QString::number( u, precision > 0 ? 'f' : 'g', qAbs( precision )));
+ if ( pos->shapeType == GEOM::FACE ) {
+ QTreeWidgetItem* vItem = createItem( posItem );
+ vItem->setText( 0, SMESHGUI_ElemInfo::tr("V_POSITION") );
+ vItem->setText( 1, QString::number( v, precision > 0 ? 'f' : 'g', qAbs( precision )));
+ }
+ }
+ }
+ }