mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-29 11:10:33 +05:00
PAL10878 - "name" is absent when "Number of segment" is being created
This commit is contained in:
parent
8a9307decf
commit
fdc26f9a4d
@ -3,6 +3,9 @@
|
|||||||
#include "StdMeshersGUI_DistrTable.h"
|
#include "StdMeshersGUI_DistrTable.h"
|
||||||
#include "StdMeshersGUI_DistrPreview.h"
|
#include "StdMeshersGUI_DistrPreview.h"
|
||||||
|
|
||||||
|
#include <SMESHGUI_Utils.h>
|
||||||
|
#include <SMESHGUI_HypothesesUtils.h>
|
||||||
|
|
||||||
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
|
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
|
||||||
|
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
@ -77,6 +80,16 @@ QFrame* StdMeshersGUI_NbSegmentsCreator::buildFrame()
|
|||||||
myGroupLayout->setColStretch( 1, 1 );
|
myGroupLayout->setColStretch( 1, 1 );
|
||||||
|
|
||||||
int row = 0;
|
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
|
// 1) number of segments
|
||||||
myGroupLayout->addWidget( new QLabel( tr( "SMESH_NB_SEGMENTS_PARAM" ), GroupC1 ), row, 0 );
|
myGroupLayout->addWidget( new QLabel( tr( "SMESH_NB_SEGMENTS_PARAM" ), GroupC1 ), row, 0 );
|
||||||
myNbSeg = new QtxIntSpinBox( GroupC1 );
|
myNbSeg = new QtxIntSpinBox( GroupC1 );
|
||||||
@ -153,6 +166,8 @@ void StdMeshersGUI_NbSegmentsCreator::retrieveParams() const
|
|||||||
NbSegmentsHypothesisData data;
|
NbSegmentsHypothesisData data;
|
||||||
readParamsFromHypo( data );
|
readParamsFromHypo( data );
|
||||||
|
|
||||||
|
if( myName )
|
||||||
|
myName->setText( data.myName );
|
||||||
myNbSeg->setValue( data.myNbSeg );
|
myNbSeg->setValue( data.myNbSeg );
|
||||||
myDistr->setCurrentItem( data.myDistrType );
|
myDistr->setCurrentItem( data.myDistrType );
|
||||||
myScale->setValue( data.myScale );
|
myScale->setValue( data.myScale );
|
||||||
@ -173,6 +188,9 @@ bool StdMeshersGUI_NbSegmentsCreator::readParamsFromHypo( NbSegmentsHypothesisDa
|
|||||||
StdMeshers::StdMeshers_NumberOfSegments_var h =
|
StdMeshers::StdMeshers_NumberOfSegments_var h =
|
||||||
StdMeshers::StdMeshers_NumberOfSegments::_narrow( hypothesis() );
|
StdMeshers::StdMeshers_NumberOfSegments::_narrow( hypothesis() );
|
||||||
|
|
||||||
|
HypothesisData* data = SMESH::GetHypothesisData( hypType() );
|
||||||
|
h_data.myName = isCreation() && data ? data->Label : QString();
|
||||||
|
|
||||||
h_data.myNbSeg = (int) h->GetNumberOfSegments();
|
h_data.myNbSeg = (int) h->GetNumberOfSegments();
|
||||||
int distr = (int) h->GetDistrType();
|
int distr = (int) h->GetDistrType();
|
||||||
h_data.myDistrType = distr;
|
h_data.myDistrType = distr;
|
||||||
@ -206,6 +224,7 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
|
|||||||
bool ok = true;
|
bool ok = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.latin1() );
|
||||||
h->SetNumberOfSegments( h_data.myNbSeg );
|
h->SetNumberOfSegments( h_data.myNbSeg );
|
||||||
int distr = h_data.myDistrType;
|
int distr = h_data.myDistrType;
|
||||||
h->SetDistrType( distr );
|
h->SetDistrType( distr );
|
||||||
@ -235,6 +254,7 @@ bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
|
|||||||
|
|
||||||
bool StdMeshersGUI_NbSegmentsCreator::readParamsFromWidgets( NbSegmentsHypothesisData& h_data ) const
|
bool StdMeshersGUI_NbSegmentsCreator::readParamsFromWidgets( NbSegmentsHypothesisData& h_data ) const
|
||||||
{
|
{
|
||||||
|
h_data.myName = myName ? myName->text() : QString();
|
||||||
h_data.myNbSeg = myNbSeg->value();
|
h_data.myNbSeg = myNbSeg->value();
|
||||||
h_data.myDistrType = myDistr->currentItem();
|
h_data.myDistrType = myDistr->currentItem();
|
||||||
h_data.myConv = myConv->id( myConv->selected() );
|
h_data.myConv = myConv->id( myConv->selected() );
|
||||||
|
@ -21,7 +21,7 @@ typedef struct
|
|||||||
int myNbSeg, myDistrType, myConv;
|
int myNbSeg, myDistrType, myConv;
|
||||||
double myScale;
|
double myScale;
|
||||||
SMESH::double_array myTable;
|
SMESH::double_array myTable;
|
||||||
QString myExpr;
|
QString myName, myExpr;
|
||||||
|
|
||||||
} NbSegmentsHypothesisData;
|
} NbSegmentsHypothesisData;
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ private:
|
|||||||
SMESHGUI_SpinBox* myScale;
|
SMESHGUI_SpinBox* myScale;
|
||||||
StdMeshersGUI_DistrTableFrame* myTable;
|
StdMeshersGUI_DistrTableFrame* myTable;
|
||||||
StdMeshersGUI_DistrPreview* myPreview;
|
StdMeshersGUI_DistrPreview* myPreview;
|
||||||
QLineEdit* myExpr;
|
QLineEdit *myName, *myExpr;
|
||||||
QButtonGroup* myConv;
|
QButtonGroup* myConv;
|
||||||
QLabel *myLScale, *myLTable, *myLExpr, *myLConv, *myInfo;
|
QLabel *myLScale, *myLTable, *myLExpr, *myLConv, *myInfo;
|
||||||
QGridLayout* myGroupLayout;
|
QGridLayout* myGroupLayout;
|
||||||
|
Loading…
Reference in New Issue
Block a user