#include "StdMeshersGUI_DistrTable.h"
#include "StdMeshersGUI_DistrPreview.h"
+#include <SMESHGUI_Utils.h>
+#include <SMESHGUI_HypothesesUtils.h>
+
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
#include <SalomeApp_Tools.h>
myGroupLayout->setColStretch( 1, 1 );
int row = 0;
+ // 0) name
+ myName = 0;
+ if( isCreation() )
+ {
+ myName = new QLineEdit( GroupC1 );
+ myGroupLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), GroupC1 ), row, 0 );
+ myGroupLayout->addWidget( myName, row, 1 );
+ row++;
+ }
+
// 1) number of segments
myGroupLayout->addWidget( new QLabel( tr( "SMESH_NB_SEGMENTS_PARAM" ), GroupC1 ), row, 0 );
myNbSeg = new QtxIntSpinBox( GroupC1 );
NbSegmentsHypothesisData data;
readParamsFromHypo( data );
+ if( myName )
+ myName->setText( data.myName );
myNbSeg->setValue( data.myNbSeg );
myDistr->setCurrentItem( data.myDistrType );
myScale->setValue( data.myScale );
StdMeshers::StdMeshers_NumberOfSegments_var h =
StdMeshers::StdMeshers_NumberOfSegments::_narrow( hypothesis() );
+ HypothesisData* data = SMESH::GetHypothesisData( hypType() );
+ h_data.myName = isCreation() && data ? data->Label : QString();
+
h_data.myNbSeg = (int) h->GetNumberOfSegments();
int distr = (int) h->GetDistrType();
h_data.myDistrType = distr;
bool ok = true;
try
{
+ SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.latin1() );
h->SetNumberOfSegments( h_data.myNbSeg );
int distr = h_data.myDistrType;
h->SetDistrType( distr );
bool StdMeshersGUI_NbSegmentsCreator::readParamsFromWidgets( NbSegmentsHypothesisData& h_data ) const
{
+ h_data.myName = myName ? myName->text() : QString();
h_data.myNbSeg = myNbSeg->value();
h_data.myDistrType = myDistr->currentItem();
h_data.myConv = myConv->id( myConv->selected() );
int myNbSeg, myDistrType, myConv;
double myScale;
SMESH::double_array myTable;
- QString myExpr;
+ QString myName, myExpr;
} NbSegmentsHypothesisData;
SMESHGUI_SpinBox* myScale;
StdMeshersGUI_DistrTableFrame* myTable;
StdMeshersGUI_DistrPreview* myPreview;
- QLineEdit* myExpr;
+ QLineEdit *myName, *myExpr;
QButtonGroup* myConv;
QLabel *myLScale, *myLTable, *myLExpr, *myLConv, *myInfo;
QGridLayout* myGroupLayout;