myToUseBoundaryRecoveryVersion(DefaultToUseBoundaryRecoveryVersion()),
myToUseFemCorrection(DefaultToUseFEMCorrection()),
myToRemoveCentralPoint(DefaultToRemoveCentralPoint()),
+ myGradation(DefaultGradation()),
_enfVertexList(DefaultGHS3DEnforcedVertexList()),
_enfVertexCoordsSizeList(DefaultGHS3DEnforcedVertexCoordsValues()),
_enfVertexEntrySizeList(DefaultGHS3DEnforcedVertexEntryValues()),
return myTextOption;
}
+//=======================================================================
+//function : SetGradation
+//=======================================================================
+
+void GHS3DPlugin_Hypothesis::SetGradation(double gradation)
+{
+ if ( myGradation != gradation ) {
+ myGradation = gradation;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
+//=======================================================================
+//function : GetGradation
+//=======================================================================
+
+double GHS3DPlugin_Hypothesis::GetGradation() const
+{
+ return myGradation;
+}
+
//=======================================================================
//function : SetEnforcedVertex
//=======================================================================
return false;
}
+//=======================================================================
+//function : DefaultGradation
+//=======================================================================
+
+double GHS3DPlugin_Hypothesis::DefaultGradation()
+{
+ return 1.05;
+}
+
// //=======================================================================
// //function : DefaultID2SizeMap
// //=======================================================================
save << (int)myToUseBoundaryRecoveryVersion << " ";
save << (int)myToUseFemCorrection << " ";
save << (int)myToRemoveCentralPoint << " ";
+ save << myGradation << " ";
if (!myTextOption.empty()) {
save << "__OPTIONS_BEGIN__ ";
save << myTextOption << " ";
{
bool isOK = true;
int i;
+ double d;
isOK = (load >> i);
if (isOK)
else
load.clear(ios::badbit | load.rdstate());
+ isOK = (load >> d);
+ if (isOK)
+ myGradation = d;
+ else
+ load.clear(ios::badbit | load.rdstate());
+
std::string separator;
bool hasOptions = false;
bool hasEnforcedVertices = false;
//================================================================================
std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* hyp,
- const bool hasShapeToMesh)
+ const bool hasShapeToMesh)
{
TCollection_AsciiString cmd;
if (hasShapeToMesh)
bool v = hyp ? ( hyp->myTextOption.find("-v") == std::string::npos ) : true;
bool fem = hyp ? ( hyp->myTextOption.find("-FEM")== std::string::npos ) : true;
bool rem = hyp ? ( hyp->myTextOption.find("-no_initial_central_point")== std::string::npos ) : true;
+ bool gra = hyp ? ( hyp->myTextOption.find("-Dcpropa")== std::string::npos ) : true;
// if use boundary recovery version, few options are allowed
bool useBndRecovery = !C;
cmd += (char*) hyp->myTextOption.c_str();
}
+ // to define volumic gradation.
+ if ( gra && hyp) {
+ cmd += " -Dcpropa=";
+ cmd += hyp->myGradation;
+ }
+
#ifdef WNT
cmd += " < NUL";
#endif
myBoundaryRecoveryCheck = new QCheckBox( tr( "RECOVERY_VERSION" ), myAdvGroup );
myFEMCorrectionCheck = new QCheckBox( tr( "FEM_CORRECTION" ), myAdvGroup );
+
+ QLabel* myGradationLabel = new QLabel( tr( "GHS3D_GRADATION" ), myAdvGroup );
+ myGradation = new SMESHGUI_SpinBox(myAdvGroup);
+ myGradation->RangeStepAndValidator(1.05, 5.0, 0.05, "length_precision");
QLabel* aTextOptionLabel = new QLabel( tr( "TEXT_OPTION" ), myAdvGroup );
myTextOption = new QLineEdit( myAdvGroup );
- anAdvLayout->addWidget( myMaximumMemoryCheck, 0, 0, 1, 1 );
- anAdvLayout->addWidget( myMaximumMemorySpin, 0, 1, 1, 1 );
- anAdvLayout->addWidget( aMegabyteLabel, 0, 2, 1, 1 );
- anAdvLayout->addWidget( myInitialMemoryCheck, 1, 0, 1, 1 );
- anAdvLayout->addWidget( myInitialMemorySpin, 1, 1, 1, 1 );
- anAdvLayout->addWidget( aMegabyteLabel2, 1, 2, 1, 1 );
- anAdvLayout->addWidget( aWorkinDirLabel, 2, 0, 1, 1 );
- anAdvLayout->addWidget( myWorkingDir, 2, 1, 1, 2 );
- anAdvLayout->addWidget( dirBtn, 2, 3, 1, 1 );
- anAdvLayout->addWidget( myKeepFiles, 3, 0, 1, 4 );
- anAdvLayout->addWidget( aVerboseLevelLabel, 4, 0, 1, 1 );
- anAdvLayout->addWidget( myVerboseLevelSpin, 4, 1, 1, 1 );
- anAdvLayout->addWidget( myToCreateNewNodesCheck, 5, 0, 1, 4 );
- anAdvLayout->addWidget( myRemoveInitialCentralPointCheck, 6, 0, 1, 4 );
- anAdvLayout->addWidget( myBoundaryRecoveryCheck, 7, 0, 1, 4 );
- anAdvLayout->addWidget( myFEMCorrectionCheck, 8, 0, 1, 4 );
- anAdvLayout->addWidget( aTextOptionLabel, 9, 0, 1, 1 );
- anAdvLayout->addWidget( myTextOption, 9, 1, 1, 2 );
+ row = 0;
+ anAdvLayout->addWidget( myMaximumMemoryCheck, row, 0, 1, 1 );
+ anAdvLayout->addWidget( myMaximumMemorySpin, row, 1, 1, 1 );
+ anAdvLayout->addWidget( aMegabyteLabel, row++, 2, 1, 1 );
+ anAdvLayout->addWidget( myInitialMemoryCheck, row, 0, 1, 1 );
+ anAdvLayout->addWidget( myInitialMemorySpin, row, 1, 1, 1 );
+ anAdvLayout->addWidget( aMegabyteLabel2, row++, 2, 1, 1 );
+ anAdvLayout->addWidget( aWorkinDirLabel, row, 0, 1, 1 );
+ anAdvLayout->addWidget( myWorkingDir, row, 1, 1, 2 );
+ anAdvLayout->addWidget( dirBtn, row++, 3, 1, 1 );
+ anAdvLayout->addWidget( myKeepFiles, row++, 0, 1, 4 );
+ anAdvLayout->addWidget( aVerboseLevelLabel, row, 0, 1, 1 );
+ anAdvLayout->addWidget( myVerboseLevelSpin, row++, 1, 1, 2 );
+ anAdvLayout->addWidget( myToCreateNewNodesCheck, row++, 0, 1, 4 );
+ anAdvLayout->addWidget( myRemoveInitialCentralPointCheck, row++, 0, 1, 4 );
+ anAdvLayout->addWidget( myBoundaryRecoveryCheck, row++, 0, 1, 4 );
+ anAdvLayout->addWidget( myFEMCorrectionCheck, row++, 0, 1, 4 );
+ anAdvLayout->addWidget( myGradationLabel, row, 0, 1, 1 );
+ anAdvLayout->addWidget( myGradation, row++, 1, 1, 2 );
+ anAdvLayout->addWidget( aTextOptionLabel, row, 0, 1, 1 );
+ anAdvLayout->addWidget( myTextOption, row++, 1, 1, 2 );
// Enforced vertices parameters
myEnfGroup = new QWidget();
myEnforcedTableWidget->setColumnCount( ENF_VER_NB_COLUMNS );
myEnforcedTableWidget->setSortingEnabled(true);
QStringList enforcedHeaders;
- enforcedHeaders << tr( "GHS3D_ENF_NAME_COLUMN" )
- << tr( "GHS3D_ENF_VER_X_COLUMN" )<< tr( "GHS3D_ENF_VER_Y_COLUMN" ) << tr( "GHS3D_ENF_VER_Z_COLUMN" )
+ enforcedHeaders << tr( "GHS3D_ENF_NAME_COLUMN" )
+ << tr( "GHS3D_ENF_VER_X_COLUMN" )<< tr( "GHS3D_ENF_VER_Y_COLUMN" ) << tr( "GHS3D_ENF_VER_Z_COLUMN" )
<< tr( "GHS3D_ENF_SIZE_COLUMN" ) << tr("GHS3D_ENF_ENTRY_COLUMN") << tr("GHS3D_ENF_VER_COMPOUND_COLUMN") << tr( "GHS3D_ENF_GROUP_COLUMN" );
-
+
myEnforcedTableWidget->setHorizontalHeaderLabels(enforcedHeaders);
myEnforcedTableWidget->verticalHeader()->hide();
myEnforcedTableWidget->horizontalHeader()->setStretchLastSection(true);
myRemoveInitialCentralPointCheck ->setChecked ( data.myRemoveInitialCentralPoint );
myBoundaryRecoveryCheck ->setChecked ( data.myBoundaryRecovery );
myFEMCorrectionCheck ->setChecked ( data.myFEMCorrection );
+ myGradation ->setValue ( data.myGradation );
myTextOption ->setText ( data.myTextOption );
TEnfVertexList::const_iterator it;
int rowCount = 0;
- myEnforcedTableWidget->clear();
+ myEnforcedTableWidget->clearContents();
myEnforcedTableWidget->setSortingEnabled(false);
myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
for(it = data.myEnforcedVertices.begin() ; it != data.myEnforcedVertices.end(); it++ )
// Update Enforced meshes QTableWidget
TEnfMeshList::const_iterator itMesh;
rowCount = 0;
- myEnforcedMeshTableWidget->clear();
+ myEnforcedMeshTableWidget->clearContents();
myEnforcedMeshTableWidget->setSortingEnabled(false);
// myEnforcedMeshTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
for(itMesh = data.myEnforcedMeshes.begin() ; itMesh != data.myEnforcedMeshes.end(); itMesh++ )
if ( data.myFEMCorrection )
valStr += " -FEM";
+ if ( data.myGradation != 1.05 ) {
+ valStr += " -Dcpropa=";
+ valStr += QString::number( data.myGradation );
+ }
+
valStr += " ";
valStr += data.myTextOption;
h_data.myRemoveInitialCentralPoint = h->GetToRemoveCentralPoint();
h_data.myBoundaryRecovery = h->GetToUseBoundaryRecoveryVersion();
h_data.myFEMCorrection = h->GetFEMCorrection();
+ h_data.myGradation = h->GetGradation();
h_data.myTextOption = h->GetTextOption();
GHS3DPlugin::GHS3DEnforcedVertexList_var vertices = h->GetEnforcedVertices();
h->SetToUseBoundaryRecoveryVersion( h_data.myBoundaryRecovery );
if ( h->GetFEMCorrection() != h_data.myFEMCorrection )
h->SetFEMCorrection( h_data.myFEMCorrection );
+ if ( h->GetGradation() != h_data.myGradation )
+ h->SetGradation ( h_data.myGradation );
if ( h->GetTextOption() != h_data.myTextOption )
h->SetTextOption ( h_data.myTextOption.toLatin1().constData() );
h_data.myRemoveInitialCentralPoint = myRemoveInitialCentralPointCheck->isChecked();
h_data.myBoundaryRecovery = myBoundaryRecoveryCheck->isChecked();
h_data.myFEMCorrection = myFEMCorrectionCheck->isChecked();
+ h_data.myGradation = myGradation->value();
h_data.myTextOption = myTextOption->text();
// Enforced vertices