aStdLayout->addWidget( myName, row++, 1, 1, 1 );
}
+ aStdLayout->addWidget( new QLabel( tr( "BLSURF_GRADATION" ), myStdGroup ), row, 0, 1, 1 );
+ myGradation = new QtxDoubleSpinBox( myStdGroup );
+ aStdLayout->addWidget( myGradation, row++, 1, 1, 1 );
+ myGradation->setMinimum( 1.1 );
+ myGradation->setMaximum( 2.5 );
+ myGradation->setSingleStep( 0.1 );
+
aStdLayout->addWidget( new QLabel( tr( "BLSURF_PHY_MESH" ), myStdGroup ), row, 0, 1, 1 );
myPhysicalMesh = new QComboBox( myStdGroup );
aStdLayout->addWidget( myPhysicalMesh, row++, 1, 1, 1 );
myAngleMeshC->setMaximum( 16 );
myAngleMeshC->setSingleStep( 0.5 );
- aStdLayout->addWidget( new QLabel( tr( "BLSURF_GRADATION" ), myStdGroup ), row, 0, 1, 1 );
- myGradation = new QtxDoubleSpinBox( myStdGroup );
- aStdLayout->addWidget( myGradation, row++, 1, 1, 1 );
- myGradation->setMinimum( 1.1 );
- myGradation->setMaximum( 2.5 );
- myGradation->setSingleStep( 0.1 );
-
#ifdef WITH_SIZE_BOUNDARIES
aStdLayout->addWidget( new QLabel( tr( "BLSURF_HGEOMIN" ), myStdGroup ), row, 0, 1, 1 );
myGeoMin = new QLineEdit( myStdGroup );
if ( fullSizeMapList.count() > 1 ) {
string fullSizeMap = fullSizeMapList[1].toStdString();
int pos = fullSizeMap.find("return")+7;
- QString sizeMap = QString::fromStdString(fullSizeMap.substr(pos, fullSizeMap.size()-pos));
+ MESSAGE("pos:" << pos);
+ QString sizeMap;
+ try {
+ sizeMap = QString::fromStdString(fullSizeMap.substr(pos, fullSizeMap.size()-pos));
+ }
+ catch (...) {
+ continue;
+ }
that->mySMPMap[fullSizeMapList[0]] = sizeMap;
MESSAGE("mySMPMap[" << fullSizeMapList[0].toStdString() << "] = " << sizeMap.toStdString());
that->mySMPShapeTypeMap[fullSizeMapList[0]] = myGeomToolSelected->entryToShapeType(fullSizeMapList[0].toStdString());
void BLSURFPluginGUI_HypothesisCreator::onPhysicalMeshChanged() {
MESSAGE("BLSURFPluginGUI_HypothesisCreator::onPhysicalMeshChanged");
- bool isCustom = ((myPhysicalMesh->currentIndex() == PhysicalUserDefined) || (myPhysicalMesh->currentIndex() == SizeMap)) ;
+ bool isPhysicalUserDefined = (myPhysicalMesh->currentIndex() == PhysicalUserDefined);
+ bool isSizeMap = (myPhysicalMesh->currentIndex() == SizeMap);
+ bool isCustom = (isPhysicalUserDefined || isSizeMap) ;
+ bool geomIsCustom = (myGeometricMesh->currentIndex() == UserDefined);
+
+ myGradation->setEnabled(not isPhysicalUserDefined || geomIsCustom);
myPhySize->setEnabled(isCustom);
myPhyMax->setEnabled(isCustom);
myPhyMin->setEnabled(isCustom);
+ if ( !isSizeMap) {
+ double gradation;
+ switch( myPhysicalMesh->currentIndex() ) {
+ case DefaultSize:
+ default:
+ gradation = 1.1;
+ break;
+ }
+ myGradation->setValue( gradation );
+ }
+
if ( !isCustom ) {
QString aPhySize = "";
switch( myPhysicalMesh->currentIndex() ) {
void BLSURFPluginGUI_HypothesisCreator::onGeometricMeshChanged() {
MESSAGE("BLSURFPluginGUI_HypothesisCreator::onGeometricMeshChanged");
bool isCustom = (myGeometricMesh->currentIndex() == UserDefined);
+ bool phyIsSizemap = (myPhysicalMesh->currentIndex() == SizeMap);
+
myAngleMeshS->setEnabled(isCustom);
myAngleMeshC->setEnabled(isCustom);
+ myGradation->setEnabled(isCustom || phyIsSizemap);
myGeoMax->setEnabled(isCustom);
myGeoMin->setEnabled(isCustom);
}
else if (that->mySMPMap[myEntry].startsWith("ATTRACTOR")) {
MESSAGE("Attractor" );
-// if ((that->mySMPMap[myEntry].count(QRegExp("ATTRACTOR([0-9])")) != 1))
- if ((that->mySMPMap[myEntry].count('(') != 1) or
- (that->mySMPMap[myEntry].count(')') != 1) or
- (that->mySMPMap[myEntry].count(';') != 4) or
- (that->mySMPMap[myEntry].size() == 15)){
+ if ((that->mySMPMap[myEntry].count(QRegExp("^ATTRACTOR\\((?:(-?0(\\.\\d*)*|-?[1-9]+\\d*(\\.\\d*)*|-?\\.(\\d)+);){5}(True|False)\\)$")) != 1)) {
+// if ((that->mySMPMap[myEntry].count('(') != 1) or
+// (that->mySMPMap[myEntry].count(')') != 1) or
+// (that->mySMPMap[myEntry].count(';') != 4) or
+// (that->mySMPMap[myEntry].size() == 15)){
if (displayError)
- SUIT_MessageBox::warning( dlg(),"Definition of attractor : Error" ,"An attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b)" );
+ SUIT_MessageBox::warning( dlg(),"Definition of attractor : Error" ,"An attractor is defined with the following pattern: ATTRACTOR(xa;ya;za;a;b;True|False)" );
return false;
}
return true;