corresponding linear ones, but in addition they have \a midside nodes
located between the corner nodes on element sides.
-If a quadratic quadrilateral element has an additional node at the
-element center, it is a bi-quadratic element (or
-QUAD9). If a quadratic hexahedral element has 7 additional nodes:
-at the element center and at the center of each side, it is a
-tri-quadratic element (or HEXA27).
+If a quadratic 2D element has an additional node at the
+element center, it is a bi-quadratic element (both TRIA7 and
+QUAD9 elements are supported). If a quadratic hexahedral element has 7
+additional nodes: at the element center and at the center of each
+side, it is a tri-quadratic element (or HEXA27).
The convention of nodal connectivity of elements used in SALOME is
the MED library convention. You can consult the description of nodal
To create any <b>Quadratic Element</b> specify the nodes which will form your
-triangle by selecting them in the 3D viewer with pressed Shift
+element by selecting them in the 3D viewer with pressed Shift
button. Their numbers will appear in the dialog box as <b>Corner Nodes</b>
(alternatively you can just input numbers in this field without
-selection).The edges formed by the corner nodes will appear in the
-table. To define the middle nodes for each edge double-click on the
-respective field and input the number of the node. All edges and the
-object formed by them will be displayed in the Object browser. When
-all edges are defined you will be able to click \b Apply or <b>Apply and Close</b> button to
+selection). The edges formed by the corner nodes will appear in the
+table. To define the middle nodes for each edge, double-click on the
+respective field and input the number of the node (or pick the node in
+the viewer). For bi-quadratic and tri-quadratic elements, your also
+need to specify central nodes.
+As soon as all needed nodes are specified, a preview of a new
+quadratic element will be displayed in the 3D viewer. Then
+you will be able to click \b Apply or <b>Apply and Close</b> button to
add the element to the mesh.
\image html aqt.png
-\b Reverse button for Quadratic Edges switches the first and the last
-nodes. For all other elements it reverses the element.
+\b Reverse button reverses the element.
</li>
</ol>
<ul>
<li>If it is necessary to convert a linear mesh to quadratic or a quadratic
mesh to linear. **Convert to bi-quadratic** option does the same as
- **Convert to quadratic** except for that QUAD9 elements are created
- instead of QUAD8, and HEXA27 elements are created instead of
- HEXA20. Note that the choice is available only if the selected mesh
- (or sub-mesh) contains both quadratic and linear elements, else the
+ **Convert to quadratic** except for that TRIA7, QUAD9 and HEXA27
+ elements are created instead of TRIA6, QUAD8, and HEXA20 elements
+ respectively. Note that the choice is available only if the selected
+ mesh (or sub-mesh) contains both quadratic and linear elements, else the
direction of conversion is selected automatically.</li>
-<li>If it is necessary to place medium nodes of the quadratic mesh on the
-geometry (meshed object). This option is relevant for conversion to
-quadratic provided that the mesh is based on a geometry (not imported from file).</li>
+<li>If it is necessary to place **medium nodes** of the quadratic mesh **on the
+ geometry** (meshed object). This option is relevant for conversion to
+ quadratic provided that the mesh is based on a geometry (not imported
+ from file).</li>
</ul>
\image html image156.gif
\brief Simple 'busy state' flag locker.
\internal
*/
-
class BusyLocker
{
public:
\brief Simple editable table item.
\internal
*/
-
class IdEditItem: public QTableWidgetItem
{
public:
// function : SMESHGUI_AddQuadraticElementDlg()
// purpose : constructor
//=================================================================================
+
SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
const SMDSAbs_EntityType theType )
: QDialog( SMESH::GetDesktop( theModule ) ),
case SMDSEntity_BiQuad_Quadrangle:
anElementName = QString("BIQUADRATIC_QUADRANGLE");
break;
+ case SMDSEntity_BiQuad_Triangle:
+ anElementName = QString("BIQUADRATIC_TRIANGLE");
+ break;
case SMDSEntity_Quad_Tetra:
anElementName = QString("QUADRATIC_TETRAHEDRON");
break;
// function : ~SMESHGUI_AddQuadraticElementDlg()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
+
SMESHGUI_AddQuadraticElementDlg::~SMESHGUI_AddQuadraticElementDlg()
{
delete mySimulation;
// function : Init()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::Init()
{
myRadioButton1->setChecked(true);
myNbCorners = 3;
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_triangles
break;
+ case SMDSEntity_BiQuad_Triangle:
+ aNumRows = 3;
+ myNbCorners = 3;
+ myNbCenterNodes = 1;
+ myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_triangles
+ break;
case SMDSEntity_Quad_Quadrangle:
aNumRows = 4;
myNbCorners = 4;
// function : ClickOnApply()
// purpose :
//=================================================================================
-void SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
+
+bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
{
if( !isValid() )
- return;
+ return false;
if ( mySMESHGUI->isActiveStudyLocked() || myBusy || !IsValid() )
- return;
+ return false;
BusyLocker lock( myBusy );
break;
case SMDSEntity_Quad_Triangle:
case SMDSEntity_Quad_Quadrangle:
+ case SMDSEntity_BiQuad_Triangle:
case SMDSEntity_BiQuad_Quadrangle:
case SMDSEntity_Quad_Tetra:
case SMDSEntity_Quad_Pyramid:
int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),
tr( "MESH_STANDALONE_GRP_CHOSEN" ).arg( aGroupName ),
tr( "SMESH_BUT_YES" ), tr( "SMESH_BUT_NO" ), 0, 1 );
- if ( res == 1 ) return;
+ if ( res == 1 ) return false;
}
aGroup = myGroups[idx-1];
}
anElemId = aMeshEditor->AddEdge(anArrayOfIdeces.inout()); break;
case SMDSEntity_Quad_Triangle:
case SMDSEntity_Quad_Quadrangle:
+ case SMDSEntity_BiQuad_Triangle:
case SMDSEntity_BiQuad_Quadrangle:
anElementType = SMESH::FACE;
anElemId = aMeshEditor->AddFace(anArrayOfIdeces.inout()); break;
updateButtons();
SMESHGUI::Modified();
+
+ return true;
}
//=================================================================================
// function : ClickOnOk()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::ClickOnOk()
{
- ClickOnApply();
- reject();
+ if ( ClickOnApply() )
+ reject();
}
//=================================================================================
// function : reject()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::reject()
{
mySelectionMgr->clearSelected();
// function : ClickOnHelp()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp()
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
// function : onTextChange()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText)
{
if (myBusy) return;
// function : SelectionIntoArgument()
// purpose : Called when selection has changed
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
{
if (myBusy) return;
anElementType = SMESH::EDGE; break;
case SMDSEntity_Quad_Triangle:
case SMDSEntity_Quad_Quadrangle:
+ case SMDSEntity_BiQuad_Triangle:
case SMDSEntity_BiQuad_Quadrangle:
anElementType = SMESH::FACE; break;
case SMDSEntity_Quad_Tetra:
// function : displaySimulation()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::displaySimulation()
{
if ( IsValid() )
// function : SetCurrentSelection()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::SetCurrentSelection()
{
QPushButton* send = (QPushButton*)sender();
// function : DeactivateActiveDialog()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::DeactivateActiveDialog()
{
if (GroupConstructors->isEnabled()) {
// function : ActivateThisDialog()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::ActivateThisDialog()
{
/* Emit a signal to deactivate the active dialog */
// function : enterEvent()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::enterEvent (QEvent*)
{
if (GroupConstructors->isEnabled())
// function : onReverse()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::onReverse (int state)
{
mySimulation->SetVisibility(false);
updateButtons();
}
-
//=================================================================================
// function : IsValid()
// purpose :
//=================================================================================
+
bool SMESHGUI_AddQuadraticElementDlg::IsValid()
{
SMDS_Mesh* aMesh = 0;
// function : UpdateTable()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
{
QStringList aListCorners = myCornerNodes->text().split(" ", QString::SkipEmptyParts);
aLastColIds = LastEdgeIds;
break;
case SMDSEntity_Quad_Triangle:
+ case SMDSEntity_BiQuad_Triangle:
aFirstColIds = FirstTriangleIds;
aLastColIds = LastTriangleIds;
break;
}
}
-
//=================================================================================
// function : onTableActivate()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::onCellDoubleClicked( int theRow, int theCol )
{
myCurrentLineEdit = 0;
updateButtons();
}
-
//=================================================================================
// function : onCellTextChange()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::onCellTextChange(int theRow, int theCol)
{
myCurrentLineEdit = 0;
// function : keyPressEvent()
// purpose :
//=================================================================================
+
void SMESHGUI_AddQuadraticElementDlg::keyPressEvent( QKeyEvent* e )
{
QDialog::keyPressEvent( e );
}
}
+//=======================================================================
+//function : updateButtons
+//purpose :
+//=======================================================================
+
void SMESHGUI_AddQuadraticElementDlg::updateButtons()
{
bool valid = IsValid();
// function : isValid
// purpose :
//=================================================================================
+
bool SMESHGUI_AddQuadraticElementDlg::isValid()
{
if( GroupGroups->isChecked() && ComboBox_GroupName->currentText().isEmpty() ) {
void onCellDoubleClicked( int, int );
void ClickOnOk();
- void ClickOnApply();
+ bool ClickOnApply();
void ClickOnHelp();
void SetCurrentSelection();
void SelectionIntoArgument();
{
SMESH::long_array_var nbElemOfType = idSource->GetMeshInfo();
- bool hasBiQuad = ( nbElemOfType[SMDSEntity_BiQuad_Quadrangle ] ||
+ bool hasBiQuad = ( nbElemOfType[SMDSEntity_BiQuad_Triangle ] ||
+ nbElemOfType[SMDSEntity_BiQuad_Quadrangle ] ||
nbElemOfType[SMDSEntity_TriQuad_Hexa ] );
- bool hasLinStruct = ( nbElemOfType[SMDSEntity_Quadrangle ] ||
+ bool hasLinBiQuad = ( nbElemOfType[SMDSEntity_Triangle ] ||
+ nbElemOfType[SMDSEntity_Quadrangle ] ||
nbElemOfType[SMDSEntity_Hexa ] );
- bool hasQuadStruct = ( nbElemOfType[SMDSEntity_Quad_Quadrangle ] ||
+ bool hasQuadBiQuad = ( nbElemOfType[SMDSEntity_Quad_Triangle ] ||
+ nbElemOfType[SMDSEntity_Quad_Quadrangle ] ||
nbElemOfType[SMDSEntity_Quad_Hexa ] );
bool hasQuad = ( nbElemOfType[SMDSEntity_Quad_Edge ] ||
int tgtType = 0;
if ( hasBiQuad )
tgtType |= ( Quadratic | Linear );
- if ( hasLinStruct )
+ if ( hasLinBiQuad )
tgtType |= ( BiQuadratic | Quadratic );
- if ( hasQuadStruct )
+ if ( hasQuadBiQuad )
tgtType |= ( BiQuadratic | Linear );
if ( hasQuad )
tgtType |= Linear;
//================================================================================
vtkIdType getCellType( const SMDSAbs_ElementType theType,
- const bool thePoly,
- const int theNbNodes )
+ const bool thePoly,
+ const int theNbNodes )
{
switch( theType )
{
else if ( theNbNodes == 3 ) return VTK_TRIANGLE;
else if ( theNbNodes == 4 ) return VTK_QUAD;
else if ( theNbNodes == 6 ) return VTK_QUADRATIC_TRIANGLE;
+ else if ( theNbNodes == 7 ) return VTK_BIQUADRATIC_TRIANGLE;
else if ( theNbNodes == 8 ) return VTK_QUADRATIC_QUAD;
else if ( theNbNodes == 9 ) return VTK_BIQUADRATIC_QUAD;
else return VTK_EMPTY_CELL;
myWidgets[i1D][iTotal] ->setProperty( "text", QString::number( nbEdges ) );
myWidgets[i1D][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Edge] ) );
myWidgets[i1D][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Edge] ) );
- long nbTriangles = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle];
+ long nbTriangles = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle];
long nbQuadrangles = info[SMDSEntity_Quadrangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
long nb2DLinear = info[SMDSEntity_Triangle] + info[SMDSEntity_Quadrangle] + info[SMDSEntity_Polygon];
- long nb2DQuadratic = info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
+ long nb2DQuadratic = info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle] + info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle];
myWidgets[i2D][iTotal] ->setProperty( "text", QString::number( nb2DLinear + nb2DQuadratic ) );
myWidgets[i2D][iLinear] ->setProperty( "text", QString::number( nb2DLinear ) );
myWidgets[i2D][iQuadratic] ->setProperty( "text", QString::number( nb2DQuadratic ) );
myWidgets[i2DTriangles][iTotal] ->setProperty( "text", QString::number( nbTriangles ) );
myWidgets[i2DTriangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Triangle] ) );
- myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Triangle] ) );
+ myWidgets[i2DTriangles][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle]) );
myWidgets[i2DQuadrangles][iTotal] ->setProperty( "text", QString::number( nbQuadrangles ) );
myWidgets[i2DQuadrangles][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Quadrangle] ) );
myWidgets[i2DQuadrangles][iQuadratic]->setProperty( "text", QString::number( info[SMDSEntity_Quad_Quadrangle] + info[SMDSEntity_BiQuad_Quadrangle] ));
SMESH::Controls::NumericalFunctorPtr afunctor;
if ( !e ) return;
- // element ID && type
+ // Element ID && Type
QString stype;
switch( e->GetType() ) {
case SMDSAbs_0DElement:
myInfo->append( QString( "<b>%1 #%2</b>" ).arg( stype ).arg( id ) );
// separator
myInfo->append( "" );
- // geometry type
+
+ // Geometry type
QString gtype;
switch( e->GetEntityType() ) {
case SMDSEntity_Triangle:
case SMDSEntity_Quad_Triangle:
+ case SMDSEntity_BiQuad_Triangle:
gtype = SMESHGUI_ElemInfo::tr( "TRIANGLE" ); break;
case SMDSEntity_Quadrangle:
case SMDSEntity_Quad_Quadrangle:
}
if ( !gtype.isEmpty() )
myInfo->append( QString( "<b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "TYPE" ) ).arg( gtype ) );
- // quadratic flag and gravity center (any element except 0D)
+
+ // Quadratic flag (any element except 0D)
if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Ball ) {
- // quadratic flag
myInfo->append( QString( "<b>%1?</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "QUADRATIC" ) ).arg( e->IsQuadratic() ? SMESHGUI_ElemInfo::tr( "YES" ) : SMESHGUI_ElemInfo::tr( "NO" ) ) );
- // separator
- myInfo->append( "" );
- // gravity center
- XYZ gc = gravityCenter( e );
- myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" ) ).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ) );
}
if ( const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>( e )) {
- // ball diameter
+ // Ball diameter
myInfo->append( QString( "<b>%1:</b> %2" ).arg( SMESHGUI_ElemInfo::tr( "BALL_DIAMETER" ) ).arg( ball->GetDiameter() ));
}
// separator
myInfo->append( "" );
- // connectivity
+
+ // Connectivity
SMDS_ElemIteratorPtr nodeIt = e->nodesIterator();
for ( int idx = 1; nodeIt->more(); idx++ ) {
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
}
// separator
myInfo->append( "" );
- //controls
+
+ // Controls
myInfo->append( QString( "<b>%1:</b>" ).arg( SMESHGUI_ElemInfo::tr( "CONTROLS" ) ) );
//Length
- if ( e->GetType() == SMDSAbs_Edge ) {
+ if ( e->GetType() == SMDSAbs_Edge ) {
afunctor.reset( new SMESH::Controls::Length() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "LENGTH_EDGES" ) ).arg( afunctor->GetValue( id ) ) );
}
if( e->GetType() == SMDSAbs_Face ) {
- //Area
+ //Area
afunctor.reset( new SMESH::Controls::Area() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "AREA_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
- //Taper
+ //Taper
afunctor.reset( new SMESH::Controls::Taper() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
afunctor->SetPrecision( cprecision );
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "TAPER_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
- //AspectRatio2D
+ //AspectRatio2D
afunctor.reset( new SMESH::Controls::AspectRatio() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_ELEMENTS" ) ).arg( afunctor->GetValue( id ) ) );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_3D" ) ).arg( afunctor->GetValue( id ) ) );
}
- // element position
+ // separator
+ myInfo->append( "" );
+
+ // Gravity center
+ XYZ gc = gravityCenter( e );
+ myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" ) ).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ) );
+
+ // Element position
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
}
}
}
- // groups element belongs to
+
+ // Groups the element belongs to
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
if ( !CORBA::is_nil( aMesh ) ) {
SMESH::ListOfGroups_var groups = aMesh->GetGroups();
// element ID && type
QString stype;
switch( e->GetType() ) {
- case SMDSAbs_0DElement:
- stype = SMESHGUI_ElemInfo::tr( "0D_ELEMENT" ); break;
- case SMDSAbs_Ball:
- stype = SMESHGUI_ElemInfo::tr( "BALL" ); break;
- case SMDSAbs_Edge:
- stype = SMESHGUI_ElemInfo::tr( "EDGE" ); break;
- case SMDSAbs_Face:
- stype = SMESHGUI_ElemInfo::tr( "FACE" ); break;
- case SMDSAbs_Volume:
- stype = SMESHGUI_ElemInfo::tr( "VOLUME" ); break;
- default:
- break;
+ case SMDSAbs_0DElement: stype = SMESHGUI_ElemInfo::tr( "0D_ELEMENT" ); break;
+ case SMDSAbs_Ball: stype = SMESHGUI_ElemInfo::tr( "BALL" ); break;
+ case SMDSAbs_Edge: stype = SMESHGUI_ElemInfo::tr( "EDGE" ); break;
+ case SMDSAbs_Face: stype = SMESHGUI_ElemInfo::tr( "FACE" ); break;
+ case SMDSAbs_Volume: stype = SMESHGUI_ElemInfo::tr( "VOLUME" ); break;
+ default:;
}
if ( stype.isEmpty() ) return;
QTreeWidgetItem* elemItem = createItem( 0, Bold | All );
switch( e->GetEntityType() ) {
case SMDSEntity_Triangle:
case SMDSEntity_Quad_Triangle:
+ case SMDSEntity_BiQuad_Triangle:
gtype = SMESHGUI_ElemInfo::tr( "TRIANGLE" ); break;
case SMDSEntity_Quadrangle:
case SMDSEntity_Quad_Quadrangle:
typeItem->setText( 0, SMESHGUI_ElemInfo::tr( "TYPE" ) );
typeItem->setText( 1, gtype );
}
- // quadratic flag and gravity center (any element except 0D)
- if ( e->GetEntityType() > SMDSEntity_0D && e->GetEntityType() < SMDSEntity_Ball ) {
+ // quadratic flag (for edges, faces and volumes)
+ if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
// quadratic flag
QTreeWidgetItem* quadItem = createItem( elemItem, Bold );
quadItem->setText( 0, SMESHGUI_ElemInfo::tr( "QUADRATIC" ) );
quadItem->setText( 1, e->IsQuadratic() ? SMESHGUI_ElemInfo::tr( "YES" ) : SMESHGUI_ElemInfo::tr( "NO" ) );
- // gravity center
- XYZ gc = gravityCenter( e );
- QTreeWidgetItem* gcItem = createItem( elemItem, Bold );
- gcItem->setText( 0, SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" ) );
- QTreeWidgetItem* xItem = createItem( gcItem );
- xItem->setText( 0, "X" );
- xItem->setText( 1, QString::number( gc.x(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
- QTreeWidgetItem* yItem = createItem( gcItem );
- yItem->setText( 0, "Y" );
- yItem->setText( 1, QString::number( gc.y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
- QTreeWidgetItem* zItem = createItem( gcItem );
- zItem->setText( 0, "Z" );
- zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
}
if ( const SMDS_BallElement* ball = dynamic_cast<const SMDS_BallElement*>( e )) {
// ball diameter
diamItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
}
if( e->GetType() == SMDSAbs_Volume ) {
- //AspectRatio3D
+ //AspectRatio3D
afunctor.reset( new SMESH::Controls::AspectRatio3D() );
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
QTreeWidgetItem* ratlItem3 = createItem( cntrItem, Bold );
QTreeWidgetItem* volItem = createItem( cntrItem, Bold );
volItem->setText( 0, tr( "VOLUME_3D_ELEMENTS" ) );
volItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id ) ) );
- //ElementDiameter3D
+ //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 ) ) );
}
+
+ // gravity center
+ XYZ gc = gravityCenter( e );
+ QTreeWidgetItem* gcItem = createItem( elemItem, Bold );
+ gcItem->setText( 0, SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" ) );
+ QTreeWidgetItem* xItem = createItem( gcItem );
+ xItem->setText( 0, "X" );
+ xItem->setText( 1, QString::number( gc.x(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ QTreeWidgetItem* yItem = createItem( gcItem );
+ yItem->setText( 0, "Y" );
+ yItem->setText( 1, QString::number( gc.y(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
+ QTreeWidgetItem* zItem = createItem( gcItem );
+ zItem->setText( 0, "Z" );
+ zItem->setText( 1, QString::number( gc.z(), precision > 0 ? 'f' : 'g', qAbs( precision ) ) );
// element position
+ SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
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;
}
}
// 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;
// faces
myNbFace ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
theInfo[SMDSEntity_Quad_Triangle] +
+ theInfo[SMDSEntity_BiQuad_Triangle] +
theInfo[SMDSEntity_Quadrangle] +
theInfo[SMDSEntity_Quad_Quadrangle] +
theInfo[SMDSEntity_BiQuad_Quadrangle] +
{
// triangles
myNbTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] +
- theInfo[SMDSEntity_Quad_Triangle] ));
+ theInfo[SMDSEntity_Quad_Triangle] +
+ theInfo[SMDSEntity_BiQuad_Triangle] ));
myNbLinTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Triangle] ));
- myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] ));
+ myNbQuadTrai ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Triangle] +
+ theInfo[SMDSEntity_BiQuad_Triangle] ));
// quadrangles
myNbQuad ->setText( QString("%1").arg( theInfo[SMDSEntity_Quadrangle] +
theInfo[SMDSEntity_Quad_Quadrangle] +
<source>ICON_DLG_QUADRATIC_TRIANGLE</source>
<translation>mesh_quad_triangle.png</translation>
</message>
+ <message>
+ <source>ICON_DLG_BIQUADRATIC_TRIANGLE</source>
+ <translation>mesh_biquad_triangle.png</translation>
+ </message>
<message>
<source>ICON_DLG_REM_ELEMENT</source>
<translation>mesh_rem_element.png</translation>