From: gdd Date: Thu, 3 Feb 2011 22:47:55 +0000 (+0000) Subject: Begin allowing selection of vertex and groups (=compound) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=716a72ba634bdf7a0437cd738a9059e46e2d2eaa;p=plugins%2Fblsurfplugin.git Begin allowing selection of vertex and groups (=compound) Verification to be done --- diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index a21c153..374c79a 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -257,8 +257,6 @@ End initialization Python structures and objects **************************************************/ -class QDoubleValidator; - // // BEGIN EnforcedTreeWidgetDelegate // @@ -272,7 +270,6 @@ QWidget *EnforcedTreeWidgetDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem & option , const QModelIndex & index ) const { -// QLineEdit *editor = new QLineEdit(parent); if (index.column() == ENF_VER_X_COLUMN || \ index.column() == ENF_VER_Y_COLUMN || \ index.column() == ENF_VER_Z_COLUMN) @@ -281,14 +278,12 @@ QWidget *EnforcedTreeWidgetDelegate::createEditor(QWidget *parent, editor->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); return editor; } -// editor->setValidator(new QDoubleValidator(parent)); else { QLineEdit *editor = new QLineEdit(parent); return editor; } -// return editor; } void EnforcedTreeWidgetDelegate::setEditorData(QWidget *editor, @@ -300,7 +295,6 @@ void EnforcedTreeWidgetDelegate::setEditorData(QWidget *editor, index.column() == ENF_VER_Z_COLUMN) { SMESHGUI_SpinBox *lineEdit = static_cast(editor); lineEdit->setText(value); -// lineEdit->editor()->setText(value); } else { QLineEdit *lineEdit = static_cast(editor); @@ -311,8 +305,6 @@ void EnforcedTreeWidgetDelegate::setEditorData(QWidget *editor, void EnforcedTreeWidgetDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { -// QLineEdit *lineEdit = static_cast(editor); - if (index.column() == ENF_VER_X_COLUMN || \ index.column() == ENF_VER_Y_COLUMN || \ index.column() == ENF_VER_Z_COLUMN) @@ -328,7 +320,6 @@ void EnforcedTreeWidgetDelegate::setModelData(QWidget *editor, QAbstractItemMode if (! vertexExists(model, index, value)) { model->setData(index, value, Qt::EditRole); } -// MESSAGE("Value " << value.toString().toStdString() << " was set at index(" << index.row() << "," << index.column() << ")"); } /* TODO GROUPS else if (index.column() == ENF_VER_GROUP_COLUMN) { @@ -352,7 +343,7 @@ bool EnforcedTreeWidgetDelegate::vertexExists(QAbstractItemModel *model, QModelIndex parent = index.parent(); int row = index.row(); int col = index.column(); - + if (parent.isValid()) { if (col == ENF_VER_X_COLUMN || col == ENF_VER_Y_COLUMN || col == ENF_VER_Z_COLUMN) { double x, y, z; @@ -371,16 +362,13 @@ bool EnforcedTreeWidgetDelegate::vertexExists(QAbstractItemModel *model, x = parent.child(row, ENF_VER_X_COLUMN).data(Qt::EditRole).toDouble(); y = parent.child(row, ENF_VER_Y_COLUMN).data(Qt::EditRole).toDouble(); } - // MESSAGE("Checking for existing vertex " << x << ", " << y << "," << z); int nbChildren = model->rowCount(parent); for (int i = 0 ; i < nbChildren ; i++) { if (i != row) { double childX = parent.child(i, ENF_VER_X_COLUMN).data(Qt::EditRole).toDouble(); double childY = parent.child(i, ENF_VER_Y_COLUMN).data(Qt::EditRole).toDouble(); double childZ = parent.child(i, ENF_VER_Z_COLUMN).data(Qt::EditRole).toDouble(); -// MESSAGE("Vertex: " << childX << ", " << childY << "," << childZ); if ((childX == x) && (childY == y) && (childZ == z)) { -// MESSAGE("Found !"); exists = true; break; } @@ -439,7 +427,7 @@ BLSURFPluginGUI_HypothesisCreator::BLSURFPluginGUI_HypothesisCreator( const QStr PyRun_SimpleString("from math import *"); PyGILState_Release(gstate); - + } BLSURFPluginGUI_HypothesisCreator::~BLSURFPluginGUI_HypothesisCreator() @@ -451,43 +439,17 @@ BLSURFPluginGUI_HypothesisCreator::~BLSURFPluginGUI_HypothesisCreator() * */ GeomSelectionTools* BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool() { -// MESSAGE("BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool"); BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); -// MESSAGE("aStudy->StudyId(): " << aStudy->StudyId()); if (that->GeomToolSelected == NULL || that->GeomToolSelected->getMyStudy() != aStudy) { -// MESSAGE("GeomToolSelected is created"); that->GeomToolSelected = new GeomSelectionTools(aStudy); } -// else -// MESSAGE("GeomToolSelected already exists"); -// MESSAGE("that->GeomToolSelected->getMyStudy()->StudyId(): " << that->GeomToolSelected->getMyStudy()->StudyId()); return that->GeomToolSelected; } GEOM::GEOM_Gen_var BLSURFPluginGUI_HypothesisCreator::getGeomEngine() { return GeometryGUI::GetGeomGen(); -// GEOM::GEOM_Gen_var _geomEngine = NULL; -// SalomeApp_Application* anApp = getGeomSelectionTool()->GetSalomeApplication(); -// if (anApp) { -// MESSAGE("Got Application"); -// Engines::Component_var component = anApp->lcc()->FindOrLoad_Component( "FactoryServer","GEOM" ); -// _geomEngine = GEOM::GEOM_Gen::_narrow(component); -// } -// return _geomEngine; -} - -namespace { - inline bool isDouble( const QString& theText, const bool emptyOK=false ) { - QString str = theText.trimmed(); - bool isOk = true; - if ( !str.isEmpty() ) - str.toDouble(&isOk); - else - isOk = emptyOK; - return isOk; - } } @@ -495,28 +457,7 @@ bool BLSURFPluginGUI_HypothesisCreator::checkParams() const { MESSAGE("BLSURFPluginGUI_HypothesisCreator::checkParams"); bool ok = true; -// if ( !isDouble( myPhySize->text(), false )) { -// if ( myPhySize->text().isEmpty() ) -// myPhySize->setText(tr("OBLIGATORY_VALUE")); -// myPhySize->selectAll(); -// ok = false; -// } -// if ( !isDouble( myPhyMin->text(), true )) { -// myPhyMin->selectAll(); -// ok = false; -// } -// if ( !isDouble( myPhyMax->text(), true )) { -// myPhyMax->selectAll(); -// ok = false; -// } -// if ( !isDouble( myGeoMin->text(), true )) { -// myGeoMin->selectAll(); -// ok = false; -// } -// if ( !isDouble( myGeoMin->text(), true )) { -// myGeoMin->selectAll(); -// ok = false; -// } + if ( ok ) { myOptionTable->setFocus(); @@ -585,14 +526,14 @@ bool BLSURFPluginGUI_HypothesisCreator::checkParams() const // Enforced vertices // TODO - + return ok; } QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() { MESSAGE("BLSURFPluginGUI_HypothesisCreator::buildFrame"); - + QFrame* fr = new QFrame( 0 ); QVBoxLayout* lay = new QVBoxLayout( fr ); lay->setMargin( 5 ); @@ -655,7 +596,7 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() #endif myAllowQuadrangles = new QCheckBox( tr( "BLSURF_ALLOW_QUADRANGLES" ), myStdGroup ); myDecimesh = new QCheckBox( tr( "BLSURF_DECIMESH" ), myStdGroup ); - + // ADD WIDGETS (STANDARD TAB) int row = 0; if( isCreation() ) { @@ -720,8 +661,8 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() QPushButton* addBtn = new QPushButton( tr( "ADD_OPTION"), myAdvGroup ); addBtn->setMenu( new QMenu() ); QPushButton* rmBtn = new QPushButton( tr( "REMOVE_OPTION"), myAdvGroup ); - - + + // ADD WIDGETS (ADVANCED TAB) anAdvLayout->addWidget( new QLabel( tr( "BLSURF_TOPOLOGY" ), myAdvGroup ), 0, 0, 1, 1 ); anAdvLayout->addWidget( myTopology, 0, 1, 1, 1 ); @@ -760,8 +701,8 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() line2->setFrameShape(QFrame::HLine); line2->setFrameShadow(QFrame::Sunken); removeButton = new QPushButton(tr("BLSURF_SM_REMOVE"),mySmpGroup); - - + + // ADD WIDGETS (SIZEMAP TAB) anSmpLayout->addWidget(mySizeMapTable, SMP_POINT_BTN, 0, SMP_NB_LINES+1, 1); // anSmpLayout->addWidget(addAttractorButton, SMP_ATTRACTOR_BTN, 1, 1, 1); @@ -776,12 +717,12 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() // Enforced vertices parameters myEnfGroup = new QWidget(); QGridLayout* anEnfLayout = new QGridLayout(myEnfGroup); -// +// // myEnforcedVertexWidget = new DlgBlSurfHyp_Enforced(myEnfGroup); // anEnfLayout->addWidget(myEnforcedVertexWidget); // MESSAGE("Creating DlgBlSurfHyp_Enforced widget instance"); // myEnforcedVertexWidget = new DlgBlSurfHyp_Enforced(); - + myEnforcedTreeWidget = new QTreeWidget(myEnfGroup); myEnforcedTreeWidget->setColumnCount( ENF_VER_NB_COLUMNS ); myEnforcedTreeWidget->setSortingEnabled(true); @@ -812,25 +753,25 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() shapeTypes1.Add( TopAbs_COMPOUND ); shapeTypes2.Add( TopAbs_VERTEX ); shapeTypes2.Add( TopAbs_COMPOUND ); - + SMESH_NumberFilter* faceFilter = new SMESH_NumberFilter("GEOM", TopAbs_FACE, 0, shapeTypes1); myEnfFaceWdg = new StdMeshersGUI_ObjectReferenceParamWdg( faceFilter, 0, /*multiSel=*/true); myEnfFaceWdg->SetDefaultText("Select Faces", "QLineEdit { color: grey }"); - - SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, TopAbs_VERTEX); + + SMESH_NumberFilter* vertexFilter = new SMESH_NumberFilter("GEOM", TopAbs_SHAPE, 1, shapeTypes2); myEnfVertexWdg = new StdMeshersGUI_ObjectReferenceParamWdg( vertexFilter, 0, /*multiSel=*/true); myEnfVertexWdg->SetDefaultText("Select Vertices", "QLineEdit { color: grey }"); - + myEnfVertexWdg->AvoidSimultaneousSelection(myEnfFaceWdg); - + QLabel* myXCoordLabel = new QLabel( tr( "BLSURF_ENF_VER_X_LABEL" ), myEnfGroup ); myXCoord = new SMESHGUI_SpinBox(myEnfGroup); myXCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); - + QLabel* myYCoordLabel = new QLabel( tr( "BLSURF_ENF_VER_Y_LABEL" ), myEnfGroup ); myYCoord = new SMESHGUI_SpinBox(myEnfGroup); myYCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); - + QLabel* myZCoordLabel = new QLabel( tr( "BLSURF_ENF_VER_Z_LABEL" ), myEnfGroup ); myZCoord = new SMESHGUI_SpinBox(myEnfGroup); myZCoord->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, "length_precision"); @@ -839,7 +780,7 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() QLabel* myGroupNameLabel = new QLabel( tr( "BLSURF_ENF_VER_GROUP_LABEL" ), myEnfGroup ); myGroupName = new QLineEdit(myEnfGroup); */ - + addVertexButton = new QPushButton(tr("BLSURF_ENF_VER_VERTEX"),myEnfGroup); // QFrame *line = new QFrame(myEnfGroup); // line->setFrameShape(QFrame::HLine); @@ -855,13 +796,13 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() myGlobalGroupName = new QLineEdit(makeGroupsCheck); aGroupLayout->addWidget(myGlobalGroupName); */ - - + + anEnfLayout->addWidget(myEnforcedTreeWidget, 0, 0, ENF_VER_NB_LINES+1, 1); // FACE AND VERTEX SELECTION anEnfLayout->addWidget(myEnfFaceWdg, ENF_VER_FACE, 1, 1, 2); anEnfLayout->addWidget(myEnfVertexWdg, ENF_VER_VERTEX, 1, 1, 2); - + anEnfLayout->addWidget(myXCoordLabel, ENF_VER_X_COORD, 1, 1, 1); anEnfLayout->addWidget(myXCoord, ENF_VER_X_COORD, 2, 1, 1); anEnfLayout->addWidget(myYCoordLabel, ENF_VER_Y_COORD, 1, 1, 1); @@ -878,7 +819,7 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() /* TODO GROUPS anEnfLayout->addWidget(makeGroupsCheck, ENF_VER_GROUP_CHECK, 1, 1, 2); */ - + // --- tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) ); tab->insertTab( ADV_TAB, myAdvGroup, tr( "BLSURF_ADV_ARGS" ) ); @@ -926,7 +867,7 @@ void BLSURFPluginGUI_HypothesisCreator::update(QTreeWidgetItem* item, int column /* TODO GROUPS QString groupName = item->data(ENF_VER_GROUP_COLUMN, Qt::EditRole).toString(); */ - + QTreeWidgetItem* parent = item->parent(); if (parent) { QString shapeName = parent->data(ENF_VER_NAME_COLUMN, Qt::EditRole).toString(); @@ -952,24 +893,21 @@ void BLSURFPluginGUI_HypothesisCreator::onSelectEnforcedVertex() { { if ( CORBA::is_nil( getGeomEngine() ) && !GeometryGUI::InitGeomGen() ) return ; - + BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; GEOM::GEOM_IMeasureOperations_var measureOp = getGeomEngine()->GetIMeasureOperations( that->getGeomSelectionTool()->getMyStudy()->StudyId() ); if (CORBA::is_nil(measureOp)) return; - - for (int i=0; iGetObject< GEOM::GEOM_Object >(nbSelEnfVertex-1); + CORBA::Double x,y,z; + x = y = z = 0.; + measureOp->PointCoordinates (myEnfVertex, x, y, z); + if ( measureOp->IsDone() ) { - myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >(i); - CORBA::Double x,y,z; - x = y = z = 0.; - measureOp->PointCoordinates (myEnfVertex, x, y, z); - if ( measureOp->IsDone() ) - { - myXCoord->SetValue(x); - myYCoord->SetValue(y); - myZCoord->SetValue(z); - } + myXCoord->SetValue(x); + myYCoord->SetValue(y); + myZCoord->SetValue(z); } } } @@ -1050,7 +988,7 @@ void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(std::string theFaceEnt } if (okToCreate) { MESSAGE("In " << theFaceName << " vertex with coords " << x << ", " << y << ", " << z<< " is created"); - + QTreeWidgetItem *vertexItem = new QTreeWidgetItem( theItem); vertexItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled); int vertexIndex=1; @@ -1103,38 +1041,38 @@ This method is called when a item is added into the enforced vertices tree widge void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() { // MESSAGE("BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices"); - BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; - + BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; + that->getGeomSelectionTool()->selectionMgr()->clearFilters(); myEnfFaceWdg->deactivateSelection(); myEnfVertexWdg->deactivateSelection(); - + for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column) myEnforcedTreeWidget->resizeColumnToContents(column); - + // Vertex selection int selEnfFace = myEnfFaceWdg->NbObjects(); int selEnfVertex = myEnfVertexWdg->NbObjects(); bool coordsEmpty = (myXCoord->text().isEmpty()) || (myYCoord->text().isEmpty()) || (myZCoord->text().isEmpty()); - + if (selEnfFace == 0) return; - + if ((selEnfVertex == 0) && coordsEmpty) return; string entry, shapeName; - + for (int i = 0 ; i < selEnfFace ; i++) { myEnfFace = myEnfFaceWdg->GetObject< GEOM::GEOM_Object >(i); entry = myEnfFace->GetStudyEntry(); shapeName = myEnfFace->GetName(); - + // // TODO GROUPS // std::string groupName = myGroupName->text().toStdString(); // if (makeGroupsCheck->isChecked()) // groupName = myGlobalGroupName->text().toStdString(); -// +// // if (boost::trim_copy(groupName) == "") // groupName = ""; @@ -1179,7 +1117,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() { } } } - + // TopAbs_ShapeEnum shapeType; // GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool(); // LightApp_SelectionMgr* mySel = myGeomToolSelected->selectionMgr(); @@ -1203,7 +1141,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVertices() { // } for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column) myEnforcedTreeWidget->resizeColumnToContents(column); - + if ( myPhysicalMesh->currentIndex() != SizeMap ) { myPhysicalMesh->setCurrentIndex( SizeMap ); onPhysicalMeshChanged(); @@ -1385,7 +1323,7 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const } for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column) myEnforcedTreeWidget->resizeColumnToContents(column); - + // update widgets that->onPhysicalMeshChanged(); that->onGeometricMeshChanged(); @@ -1507,7 +1445,7 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData // MESSAGE("mySMPShapeTypeMap[" << myAttractorList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[myAttractorList[0]]); } } - + // Enforced vertices h_data.coordsList.clear(); h_data.entryCoordsListMap.clear(); @@ -1516,30 +1454,30 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData h_data.groupNameEnfVertexListMap.clear(); // h_data.enfVertexGroupNameMap.clear(); */ - + BLSURFPlugin::TEntryCoordsListMap_var entryCoordsListMap = h->GetAllCoordsByFace(); MESSAGE("entryCoordsListMap->length() = " << entryCoordsListMap->length()); for ( int i = 0;ilength(); ++i ) { std::string entry = entryCoordsListMap[i].entry.in(); BLSURFPlugin::TEnfVertexList_var vertexList = h->GetEnforcedVerticesEntry(entry.c_str()); - + TEnfVertexCoordsList& coordsList = h_data.entryCoordsListMap[entry]; /* TODO GROUPS std::string groupName = ""; */ for (int j=0 ; jlength(); ++j) { BLSURFPlugin::TEnfVertexCoords _coords = vertexList[j].coords; - + TEnfVertexCoords coords; coords.push_back(_coords[0]); coords.push_back(_coords[1]); coords.push_back(_coords[2]); coordsList.insert(coords); h_data.coordsList.insert(coords); - + TEnfVertex& enfVertex = h_data.coordsEnfVertexMap[coords]; - + enfVertex.name = vertexList[j].name.in(); enfVertex.coords = coords; enfVertex.faceEntries.insert(entry); @@ -1565,7 +1503,7 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData h_data.entryCoordsListMap.erase(entry); } } - + return true; } @@ -1610,22 +1548,6 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi h->SetAngleMeshC( h_data.myAngleMeshC ); } #ifdef WITH_SIZE_BOUNDARIES -// if ( !isDouble( h_data.myPhyMin )) -// h->SetPhyMin( -1 ); -// else if ( h->GetPhyMin() != h_data.myPhyMin.toDouble() ) -// h->SetPhyMin( h_data.myPhyMin.toDouble() ); -// if ( !isDouble( h_data.myPhyMax )) -// h->SetPhyMax( -1 ); -// else if ( h->GetPhyMax() != h_data.myPhyMax.toDouble() ) -// h->SetPhyMax( h_data.myPhyMax.toDouble() ); -// if ( !isDouble( h_data.myGeoMin )) -// h->SetGeoMin( -1 ); -// else if ( h->GetGeoMin() != h_data.myGeoMin.toDouble() ) -// h->SetGeoMin( h_data.myGeoMin.toDouble() ); -// if ( !isDouble( h_data.myGeoMax )) -// h->SetGeoMax( -1 ); -// else if ( h->GetGeoMax() != h_data.myGeoMax.toDouble() ) -// h->SetGeoMax( h_data.myGeoMax.toDouble() ); if (h_data.myPhyMin > 0) h->SetPhyMin( h_data.myPhyMin ); if (h_data.myPhyMax > 0) @@ -1636,7 +1558,6 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi h->SetGeoMax( h_data.myGeoMax ); #endif - //printf("storeParamsToHypo():myOptions->length()=%d\n",myOptions->length()); h->SetOptionValues( myOptions ); // is set in checkParams() BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; @@ -1673,7 +1594,7 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi h->SetSizeMapEntry( entry.toLatin1().constData(), fullSizeMap.toLatin1().constData() ); } } - + // Enforced vertices bool ret; int hypNbVertex; @@ -1682,12 +1603,12 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi /* TODO GROUPS std::string groupName = ""; */ - + TEntryCoordsListMap::const_iterator evmIt = h_data.entryCoordsListMap.begin(); - + BLSURFPlugin::TEntryCoordsListMap_var allCoordsByFace = h->GetAllCoordsByFace(); hypNbVertex = allCoordsByFace->length(); - + // All enforced vertices were deleted if (evmIt == h_data.entryCoordsListMap.end() && hypNbVertex!=0) h->ClearAllEnforcedVertices(); @@ -1701,7 +1622,7 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi h->UnsetEnforcedVerticesEntry(entry.c_str()); } } - + // One or several enforced vertices are added or removed for a specific entry TEnfVertexCoordsList coordsFromHyp; BLSURFPlugin::TEnfVertexList_var hypCoordsList; @@ -1738,7 +1659,7 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi MESSAGE("Error vertex not found"); throw std::runtime_error("Error vertex not found"); } - + enfVertex = it->second; x = enfVertex.coords[0]; y = enfVertex.coords[1]; @@ -1747,18 +1668,18 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi ret = h->SetEnforcedVertexEntry( entry.c_str(), x, y, z, enfVertex.name.c_str() ); else ret = h->SetEnforcedVertexEntryWithPoint( entry.c_str(), enfVertex.geomEntry.c_str(), enfVertex.name.c_str(), x, y, z ); - + /* TODO GROUPS groupName = enfVertex.grpName; h->SetEnforcedVertexEntryWithGroup( entry.c_str(), x, y, z, groupName.c_str() ); */ - + if (coordsFromHyp.find(coords) != coordsFromHyp.end()) { MESSAGE("Coords "<topLevelItemCount(); int nbEnforcedVertices = 0; std::string groupName = ""; @@ -1910,17 +1831,17 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes coords.push_back(childValueZ); evs.insert(coords); h_data.coordsList.insert(coords); - + TEnfVertex enfVertex; enfVertex.name = childName; enfVertex.coords = coords; enfVertex.faceEntries.insert(entry); enfVertex.geomEntry = vertexEntry; - + /* TODO GROUPS groupName = child->data(ENF_VER_GROUP_COLUMN,Qt::EditRole).toString().toStdString(); enfVertex.grpName = groupName; - + // Group if (makeGroupsCheck->isChecked()) groupName = myGlobalGroupName->text().toStdString(); @@ -1945,29 +1866,16 @@ void BLSURFPluginGUI_HypothesisCreator::onPhysicalMeshChanged() { bool isSizeMap = (myPhysicalMesh->currentIndex() == SizeMap); bool isCustom = (isPhysicalUserDefined || isSizeMap) ; bool geomIsCustom = (myGeometricMesh->currentIndex() == UserDefined); - + myGradation->setEnabled(!isPhysicalUserDefined || geomIsCustom); myPhySize->setEnabled(isCustom); myPhyMax->setEnabled(isCustom); myPhyMin->setEnabled(isCustom); if ( !myGradation->isEnabled()) -// myGradation->setValue( 1.1 ); myGradation->SetValue( 1.1 ); if ( !isCustom ) { -// QString aPhySize = ""; -// switch( myPhysicalMesh->currentIndex() ) { -// case DefaultSize: -// default: -// aPhySize = "10"; -// break; -// } -// myPhySize->setText( aPhySize ); -// if ( !isDouble( myPhyMin->text(), true )) -// myPhyMin->setText(""); -// if ( !isDouble( myPhyMax->text(), true )) -// myPhyMax->setText(""); if ( myGeometricMesh->currentIndex() == DefaultGeom ) { myGeometricMesh->setCurrentIndex( UserDefined ); onGeometricMeshChanged(); @@ -1979,7 +1887,7 @@ 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); @@ -1990,19 +1898,6 @@ void BLSURFPluginGUI_HypothesisCreator::onGeometricMeshChanged() { myGradation->SetValue( 1.1 ); if ( ! isCustom ) { -// double aAngleMeshS; -// switch( myGeometricMesh->currentIndex() ) { -// case DefaultGeom: -// default: -// aAngleMeshS = 8; -// break; -// } -// myAngleMeshS->SetValue( aAngleMeshS ); -// myAngleMeshC->SetValue( aAngleMeshS ); -// if ( !isDouble( myGeoMin->text(), true )) -// myGeoMin->setText(""); -// if ( !isDouble( myGeoMax->text(), true )) -// myGeoMax->setText(""); // hphy_flag = 0 and hgeo_flag = 0 is not allowed (spec) if ( myPhysicalMesh->currentIndex() == DefaultSize ) { myPhysicalMesh->setCurrentIndex( PhysicalUserDefined );