Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
23258: [CEA 1804] Do not merge the middle nodes of quadratic elements
[modules/smesh.git]
/
src
/
StdMeshersGUI
/
StdMeshersGUI_NbSegmentsCreator.cxx
diff --git
a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
index 0d86a141a936f791c0bd747c00e84fe178d4e626..0d095e26bb96313ad2fddfc5a4d3d6e9c320a5a6 100644
(file)
--- a/
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
+++ b/
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
5
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-25,7
+25,9
@@
// SMESH includes
//
#include "StdMeshersGUI_NbSegmentsCreator.h"
// SMESH includes
//
#include "StdMeshersGUI_NbSegmentsCreator.h"
-#include "StdMeshersGUI_DistrPreview.h"
+#ifndef DISABLE_PLOT2DVIEWER
+ #include "StdMeshersGUI_DistrPreview.h"
+#endif
#include "StdMeshersGUI_DistrTable.h"
#include "StdMeshersGUI_PropagationHelperWdg.h"
#include "StdMeshersGUI_SubShapeSelectorWdg.h"
#include "StdMeshersGUI_DistrTable.h"
#include "StdMeshersGUI_PropagationHelperWdg.h"
#include "StdMeshersGUI_SubShapeSelectorWdg.h"
@@
-64,7
+66,9
@@
StdMeshersGUI_NbSegmentsCreator::StdMeshersGUI_NbSegmentsCreator()
myDistr( 0 ),
myScale( 0 ),
myTable( 0 ),
myDistr( 0 ),
myScale( 0 ),
myTable( 0 ),
+#ifndef DISABLE_PLOT2DVIEWER
myPreview( 0 ),
myPreview( 0 ),
+#endif
myExpr( 0 ),
myConvBox( 0 ),
myConv( 0 ),
myExpr( 0 ),
myConvBox( 0 ),
myConv( 0 ),
@@
-90,9
+94,10
@@
bool StdMeshersGUI_NbSegmentsCreator::checkParams( QString& msg ) const
readParamsFromHypo( data_old );
readParamsFromWidgets( data_new );
bool res = storeParamsToHypo( data_new );
readParamsFromHypo( data_old );
readParamsFromWidgets( data_new );
bool res = storeParamsToHypo( data_new );
- storeParamsToHypo( data_old );
res = myNbSeg->isValid( msg, true ) && res;
res = myScale->isValid( msg, true ) && res;
res = myNbSeg->isValid( msg, true ) && res;
res = myScale->isValid( msg, true ) && res;
+ if ( !res )
+ storeParamsToHypo( data_old );
return res;
}
return res;
}
@@
-179,12
+184,14
@@
QFrame* StdMeshersGUI_NbSegmentsCreator::buildFrame()
// c) table
myTable = new StdMeshersGUI_DistrTableFrame( GroupC1 );
// c) table
myTable = new StdMeshersGUI_DistrTableFrame( GroupC1 );
+ myTable->setMinimumHeight(220);
myDistLayout->addWidget( myTable, 1, 0, 2, 1 );
myDistLayout->addWidget( myTable, 1, 0, 2, 1 );
+#ifndef DISABLE_PLOT2DVIEWER
// d) preview
myPreview = new StdMeshersGUI_DistrPreview( GroupC1, h.in() );
// d) preview
myPreview = new StdMeshersGUI_DistrPreview( GroupC1, h.in() );
- myPreview->setMinimumHeight(220);
myDistLayout->addWidget( myPreview, 1, 1, 2, 1 );
myDistLayout->addWidget( myPreview, 1, 1, 2, 1 );
+#endif
// 5) conversion (radiogroup)
myConvBox = new QGroupBox( tr( "SMESH_CONV_MODE" ), GroupC1 );
// 5) conversion (radiogroup)
myConvBox = new QGroupBox( tr( "SMESH_CONV_MODE" ), GroupC1 );
@@
-288,13
+295,13
@@
QString StdMeshersGUI_NbSegmentsCreator::storeParams() const
case Regular :
valStr += tr("SMESH_DISTR_REGULAR");
break;
case Regular :
valStr += tr("SMESH_DISTR_REGULAR");
break;
- case Scale :
- valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );
\
+ case Scale :
+ valStr += tr("SMESH_NB_SEGMENTS_SCALE_PARAM") + " = " + QString::number( data.myScale );
break;
case TabFunc : {
//valStr += tr("SMESH_TAB_FUNC");
bool param = true;
break;
case TabFunc : {
//valStr += tr("SMESH_TAB_FUNC");
bool param = true;
- for(
int i=
0; i < data.myTable.length(); i++, param = !param ) {
+ for(
CORBA::ULong i =
0; i < data.myTable.length(); i++, param = !param ) {
if ( param )
valStr += "[";
valStr += QString::number( data.myTable[ i ]);
if ( param )
valStr += "[";
valStr += QString::number( data.myTable[ i ]);
@@
-376,9
+383,10
@@
bool StdMeshersGUI_NbSegmentsCreator::storeParamsToHypo( const NbSegmentsHypothe
h->SetVarParameter( h_data.myNbSegVarName.toLatin1().constData(), "SetNumberOfSegments" );
h->SetNumberOfSegments( h_data.myNbSeg );
h->SetVarParameter( h_data.myNbSegVarName.toLatin1().constData(), "SetNumberOfSegments" );
h->SetNumberOfSegments( h_data.myNbSeg );
- int distr = h_data.myDistrType;
- h->SetDistrType( distr );
+ int distr = h_data.myDistrType;
+ if ( distr == 0 )
+ h->SetDistrType( distr ); // this is actually needed at non-uniform -> uniform switch
if( distr==1 ) {
h->SetVarParameter( h_data.myScaleVarName.toLatin1().constData(), "SetScaleFactor" );
h->SetScaleFactor( h_data.myScale );
if( distr==1 ) {
h->SetVarParameter( h_data.myScaleVarName.toLatin1().constData(), "SetScaleFactor" );
h->SetScaleFactor( h_data.myScale );
@@
-439,24
+447,27
@@
void StdMeshersGUI_NbSegmentsCreator::onValueChanged()
myTable->setData( arr ); //update data in table
}
myTable->setData( arr ); //update data in table
}
- myScale->set
Shown
( distr==1 );
- myLScale->set
Shown
( distr==1 );
- myReversedEdgesBox->set
Shown
( distr!=0 );
+ myScale->set
Visible
( distr==1 );
+ myLScale->set
Visible
( distr==1 );
+ myReversedEdgesBox->set
Visible
( distr!=0 );
if ( myReversedEdgesHelper ) {
myReversedEdgesHelper->Clear();
if ( myReversedEdgesHelper ) {
myReversedEdgesHelper->Clear();
- myReversedEdgesHelper->set
Shown
( distr!=0 );
+ myReversedEdgesHelper->set
Visible
( distr!=0 );
}
myDirectionWidget->ShowPreview( distr!=0 );
bool isFunc = distr==2 || distr==3;
}
myDirectionWidget->ShowPreview( distr!=0 );
bool isFunc = distr==2 || distr==3;
- myPreview->setShown( isFunc );
- myConvBox->setShown( isFunc );
+#ifndef DISABLE_PLOT2DVIEWER
+ myPreview->setVisible( isFunc );
+#endif
+ myConvBox->setVisible( isFunc );
- myTable->set
Shown
( distr==2 );
- myExpr->set
Shown
( distr==3 );
- myLExpr->set
Shown
( distr==3 );
- myInfo->set
Shown
( distr==3);
+ myTable->set
Visible
( distr==2 );
+ myExpr->set
Visible
( distr==3 );
+ myLExpr->set
Visible
( distr==3 );
+ myInfo->set
Visible
( distr==3);
+#ifndef DISABLE_PLOT2DVIEWER
//change of preview
int nbSeg = myNbSeg->value();
if( distr==2 ) //preview for table-described function
//change of preview
int nbSeg = myNbSeg->value();
if( distr==2 ) //preview for table-described function
@@
-470,6
+481,7
@@
void StdMeshersGUI_NbSegmentsCreator::onValueChanged()
if( isFunc )
myPreview->setConversion( StdMeshersGUI_DistrPreview::Conversion( myConv->checkedId() ) );
if( isFunc )
myPreview->setConversion( StdMeshersGUI_DistrPreview::Conversion( myConv->checkedId() ) );
+#endif
if ( (QtxComboBox*)sender() == myDistr && dlg() ) {
QApplication::instance()->processEvents();
if ( (QtxComboBox*)sender() == myDistr && dlg() ) {
QApplication::instance()->processEvents();