From: nge Date: Thu, 8 Oct 2009 09:00:03 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=315a2de47883b17a5efe0010a492c49447be40c9;p=plugins%2Fblsurfplugin.git *** empty log message *** --- diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index c55727b..0caa4c3 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -343,9 +343,9 @@ bool EnforcedTreeWidgetDelegate::vertexExists(QAbstractItemModel *model, 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); +// MESSAGE("Vertex: " << childX << ", " << childY << "," << childZ); if ((childX == x) && (childY == y) && (childZ == z)) { - MESSAGE("Found !"); +// MESSAGE("Found !"); exists = true; break; } @@ -416,17 +416,17 @@ BLSURFPluginGUI_HypothesisCreator::~BLSURFPluginGUI_HypothesisCreator() * */ GeomSelectionTools* BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool() { - MESSAGE("BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool"); +// MESSAGE("BLSURFPluginGUI_HypothesisCreator::getGeomSelectionTool"); BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - MESSAGE("aStudy->StudyId(): " << aStudy->StudyId()); +// MESSAGE("aStudy->StudyId(): " << aStudy->StudyId()); if (that->GeomToolSelected == NULL or that->GeomToolSelected->getMyStudy() != aStudy) { - MESSAGE("GeomToolSelected is created"); +// MESSAGE("GeomToolSelected is created"); that->GeomToolSelected = new GeomSelectionTools(aStudy); } - else - MESSAGE("GeomToolSelected already exists"); - MESSAGE("that->GeomToolSelected->getMyStudy()->StudyId(): " << that->GeomToolSelected->getMyStudy()->StudyId()); +// else +// MESSAGE("GeomToolSelected already exists"); +// MESSAGE("that->GeomToolSelected->getMyStudy()->StudyId(): " << that->GeomToolSelected->getMyStudy()->StudyId()); return that->GeomToolSelected; } @@ -795,7 +795,6 @@ QFrame* BLSURFPluginGUI_HypothesisCreator::buildFrame() connect( myEnforcedTreeWidget,SIGNAL( itemClicked(QTreeWidgetItem *, int)), this, SLOT( synchronizeCoords() ) ); connect( myEnforcedTreeWidget,SIGNAL( itemChanged(QTreeWidgetItem *, int)), this, SLOT( update(QTreeWidgetItem *, int) ) ); connect( myEnforcedTreeWidget,SIGNAL( itemSelectionChanged() ), this, SLOT( synchronizeCoords() ) ); - connect( myEnforcedTreeWidget,SIGNAL( activated(QModelIndex&)), this, SLOT( onEnforcedVertexActivated() ) ); connect( addVertexButton, SIGNAL( clicked()), this, SLOT( onAddEnforcedVerteces() ) ); connect( removeVertexButton, SIGNAL( clicked()), this, SLOT( onRemoveEnforcedVertex() ) ); @@ -931,7 +930,7 @@ void BLSURFPluginGUI_HypothesisCreator::addEnforcedVertex(std::string entry, std This method is called when a item is added into the enforced verteces tree widget */ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVerteces() { - MESSAGE("BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVerteces"); +// MESSAGE("BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVerteces"); for (int column = 0; column < myEnforcedTreeWidget->columnCount(); ++column) myEnforcedTreeWidget->resizeColumnToContents(column); @@ -976,7 +975,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddEnforcedVerteces() { This method is called when a item is removed from the enforced verteces tree widget */ void BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() { - MESSAGE("BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex"); +// MESSAGE("BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex"); QList selectedItems = myEnforcedTreeWidget->selectedItems(); QList selectedVerteces; QSet selectedEntries; @@ -993,7 +992,7 @@ void BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() { foreach(item,selectedVerteces) { QTreeWidgetItem* parent = item->parent(); - MESSAGE("From geometry "<< parent->text(ENF_VER_NAME_COLUMN).toStdString()<<" remove " << item->text(ENF_VER_NAME_COLUMN).toStdString()); +// MESSAGE("From geometry "<< parent->text(ENF_VER_NAME_COLUMN).toStdString()<<" remove " << item->text(ENF_VER_NAME_COLUMN).toStdString()); parent->removeChild(item); delete item; if (parent->childCount() == 0) { @@ -1004,7 +1003,7 @@ void BLSURFPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() { } foreach(item,selectedEntries) { - MESSAGE("Remove " << item->text(ENF_VER_NAME_COLUMN).toStdString()); +// MESSAGE("Remove " << item->text(ENF_VER_NAME_COLUMN).toStdString()); delete item; } @@ -1045,7 +1044,7 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const myVerbosity->setValue( data.myVerbosity ); if ( myOptions.operator->() ) { - MESSAGE("retrieveParams():myOptions->length() = " << myOptions->length()); +// MESSAGE("retrieveParams():myOptions->length() = " << myOptions->length()); for ( int i = 0, nb = myOptions->length(); i < nb; ++i ) { QString option = that->myOptions[i].in(); QStringList name_value = option.split( ":", QString::KeepEmptyParts ); @@ -1067,7 +1066,7 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN ); // Sizemaps - MESSAGE("retrieveParams():that->mySMPMap.size() = " << that->mySMPMap.size()); +// MESSAGE("retrieveParams():that->mySMPMap.size() = " << that->mySMPMap.size()); QMapIterator i(that->mySMPMap); GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool(); while (i.hasNext()) { @@ -1091,7 +1090,7 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const mySizeMapTable->resizeColumnToContents(SMP_SIZEMAP_COLUMN); // Enforced verteces - MESSAGE("retrieveParams(): data.enfVertMap.size() = " << data.enfVertMap.size()); +// MESSAGE("retrieveParams(): data.enfVertMap.size() = " << data.enfVertMap.size()); std::map > >::const_iterator evmIt = data.enfVertMap.begin(); for ( ; evmIt != data.enfVertMap.end() ; ++evmIt) { std::string entry = (*evmIt).first; @@ -1103,7 +1102,7 @@ void BLSURFPluginGUI_HypothesisCreator::retrieveParams() const evs = (*evmIt).second; } catch(...) { - MESSAGE("evs = (*evmIt)[entry]: FAIL"); +// MESSAGE("evs = (*evmIt)[entry]: FAIL"); break; } @@ -1180,18 +1179,18 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData // classic size maps BLSURFPlugin::string_array_var mySizeMaps = h->GetSizeMapEntries(); - MESSAGE("mySizeMaps->length() = " << mySizeMaps->length()); +// MESSAGE("mySizeMaps->length() = " << mySizeMaps->length()); QString fullSizeMaps; QStringList fullSizeMapList; GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool(); for ( int i = 0;ilength(); ++i ) { fullSizeMaps = mySizeMaps[i].in(); - MESSAGE("fullSizeMaps: " << fullSizeMaps.toStdString()); +// MESSAGE("fullSizeMaps: " << fullSizeMaps.toStdString()); fullSizeMapList = fullSizeMaps.split( "|", QString::KeepEmptyParts ); if ( fullSizeMapList.count() > 1 ) { string fullSizeMap = fullSizeMapList[1].toStdString(); int pos = fullSizeMap.find("return")+7; - MESSAGE("pos:" << pos); +// MESSAGE("pos:" << pos); QString sizeMap; try { sizeMap = QString::fromStdString(fullSizeMap.substr(pos, fullSizeMap.size()-pos)); @@ -1200,9 +1199,9 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData continue; } that->mySMPMap[fullSizeMapList[0]] = sizeMap; - MESSAGE("mySMPMap[" << fullSizeMapList[0].toStdString() << "] = " << sizeMap.toStdString()); +// MESSAGE("mySMPMap[" << fullSizeMapList[0].toStdString() << "] = " << sizeMap.toStdString()); that->mySMPShapeTypeMap[fullSizeMapList[0]] = myGeomToolSelected->entryToShapeType(fullSizeMapList[0].toStdString()); - MESSAGE("mySMPShapeTypeMap[" << fullSizeMapList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[fullSizeMapList[0]]); +// MESSAGE("mySMPShapeTypeMap[" << fullSizeMapList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[fullSizeMapList[0]]); } } @@ -1224,7 +1223,7 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData */ // attractor BLSURFPlugin::string_array_var allMyAttractors = h->GetAttractorEntries(); - MESSAGE("myAttractors->length() = " << allMyAttractors->length()); +// MESSAGE("myAttractors->length() = " << allMyAttractors->length()); for ( int i = 0;ilength(); ++i ) { QString myAttractors = allMyAttractors[i].in(); @@ -1232,14 +1231,14 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData if ( myAttractorList.count() > 1 ) { that->mySMPMap[myAttractorList[0]] = myAttractorList[1]; that->mySMPShapeTypeMap[myAttractorList[0]] = myGeomToolSelected->entryToShapeType(myAttractorList[0].toStdString()); - MESSAGE("mySMPMap[" << myAttractorList[0].toStdString() << "] = " << myAttractorList[1].toStdString()); - MESSAGE("mySMPShapeTypeMap[" << myAttractorList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[myAttractorList[0]]); +// MESSAGE("mySMPMap[" << myAttractorList[0].toStdString() << "] = " << myAttractorList[1].toStdString()); +// MESSAGE("mySMPShapeTypeMap[" << myAttractorList[0].toStdString() << "] = " << that->mySMPShapeTypeMap[myAttractorList[0]]); } } // Enforced verteces BLSURFPlugin::TEnforcedVertexMap_var enforcedVertexMap = h->GetAllEnforcedVerteces(); - MESSAGE("enforcedVertexMap->length() = " << enforcedVertexMap->length()); +// MESSAGE("enforcedVertexMap->length() = " << enforcedVertexMap->length()); for ( int i = 0;ilength(); ++i ) { std::string entry = enforcedVertexMap[i].entry.in(); @@ -1255,11 +1254,11 @@ bool BLSURFPluginGUI_HypothesisCreator::readParamsFromHypo( BlsurfHypothesisData ev.push_back(y); ev.push_back(z); evs.insert(ev); - MESSAGE("New enf vertex for entry " << entry << ": " << x << ", " << y << ", " << z); +// MESSAGE("New enf vertex for entry " << entry << ": " << x << ", " << y << ", " << z); } h_data.enfVertMap[entry] = evs; if (evs.size() == 0) { - MESSAGE("No enf vertex for entry " << entry << ": key is erased"); +// MESSAGE("No enf vertex for entry " << entry << ": key is erased"); h_data.enfVertMap.erase(entry); } } @@ -1338,15 +1337,15 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi const QString sizeMap = i.value(); if (sizeMap == "__TO_DELETE__") { - MESSAGE("Delete entry " << entry.toStdString() << " from engine"); +// MESSAGE("Delete entry " << entry.toStdString() << " from engine"); h->UnsetEntry(entry.toLatin1().constData()); } else if (sizeMap.startsWith("ATTRACTOR")) { - MESSAGE("SetAttractorEntry(" << entry.toStdString() << ")= " << sizeMap.toStdString()); +// MESSAGE("SetAttractorEntry(" << entry.toStdString() << ")= " << sizeMap.toStdString()); h->SetAttractorEntry( entry.toLatin1().constData(), sizeMap.toLatin1().constData() ); } else if (sizeMap.startsWith("def")) { - MESSAGE("SetCustomSizeMapEntry(" << entry.toStdString() << ")= " << sizeMap.toStdString()); +// MESSAGE("SetCustomSizeMapEntry(" << entry.toStdString() << ")= " << sizeMap.toStdString()); // h->SetCustomSizeMapEntry( entry.toLatin1().constData(), sizeMap.toLatin1().constData() ); } else { @@ -1359,7 +1358,7 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi else if (that->mySMPShapeTypeMap[entry] == TopAbs_VERTEX) fullSizeMap = QString("def f(): return ") + sizeMap; - MESSAGE("SetSizeMapEntry("<SetEnforcedVertexEntry( entry.c_str(), x, y, z ); } // Remove old verteces @@ -1399,7 +1398,7 @@ bool BLSURFPluginGUI_HypothesisCreator::storeParamsToHypo( const BlsurfHypothesi vertex.push_back(y); vertex.push_back(z); if (evs.find(vertex) == evs.end()) { - MESSAGE("UnsetEnforcedVertexEntry("<UnsetEnforcedVertexEntry( entry.c_str(), x, y, z ); } } @@ -1485,7 +1484,7 @@ QString BLSURFPluginGUI_HypothesisCreator::readParamsFromWidgets( BlsurfHypothes int nbEnforcedShapes = myEnforcedTreeWidget->topLevelItemCount(); int nbEnforcedVerteces = 0; - MESSAGE("Nb of enforced shapes: " << nbEnforcedShapes); +// MESSAGE("Nb of enforced shapes: " << nbEnforcedShapes); for (int i=0 ; itopLevelItem(i); if (shapeItem) { @@ -1705,7 +1704,7 @@ void BLSURFPluginGUI_HypothesisCreator::onSetSizeMap(int row,int col) BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; QString entry = that->mySizeMapTable->item(row, SMP_ENTRY_COLUMN)->text(); QString sizeMap = that->mySizeMapTable->item(row, SMP_SIZEMAP_COLUMN)->text().trimmed(); - MESSAGE("entry: " << entry.toStdString() << ", sizeMap: " << sizeMap.toStdString()); +// MESSAGE("entry: " << entry.toStdString() << ", sizeMap: " << sizeMap.toStdString()); if (not that->mySMPShapeTypeMap.contains(entry)) return; if (that->mySMPMap.contains(entry)) @@ -1721,7 +1720,7 @@ void BLSURFPluginGUI_HypothesisCreator::onSetSizeMap(int row,int col) } } else { - MESSAGE("Size map empty: reverse to precedent value" ); +// MESSAGE("Size map empty: reverse to precedent value" ); that->mySizeMapTable->item(row, SMP_SIZEMAP_COLUMN)->setText(that->mySMPMap[entry]); } that->mySizeMapTable->item(row, SMP_NAME_COLUMN)->setBackground(QBrush(*bgColor)); @@ -1749,7 +1748,7 @@ void BLSURFPluginGUI_HypothesisCreator::onAddMapOnPoint() void BLSURFPluginGUI_HypothesisCreator::insertElementType(TopAbs_ShapeEnum typeShapeAsked) { - MESSAGE("BLSURFPluginGUI_HypothesisCreator::insertElementType()"); +// MESSAGE("BLSURFPluginGUI_HypothesisCreator::insertElementType()"); BLSURFPlugin::BLSURFPlugin_Hypothesis_var h = BLSURFPlugin::BLSURFPlugin_Hypothesis::_narrow( initParamsHypothesis()); @@ -1773,7 +1772,7 @@ void BLSURFPluginGUI_HypothesisCreator::insertElementType(TopAbs_ShapeEnum typeS entry = myGeomToolSelected->getEntryOfObject(anObject); shapeName = anObject->getName(); shapeType = myGeomToolSelected->entryToShapeType(entry); - MESSAGE("Object Name = " << shapeName << "& Type is " << anObject->getComponentDataType() << " & ShapeType is " << shapeType); +// MESSAGE("Object Name = " << shapeName << "& Type is " << anObject->getComponentDataType() << " & ShapeType is " << shapeType); if (shapeType == typeShapeAsked) { mySizeMapTable->setFocus(); @@ -1786,7 +1785,7 @@ void BLSURFPluginGUI_HypothesisCreator::insertElementType(TopAbs_ShapeEnum typeS sizeMap = QString::fromStdString(oss.str()); if (that->mySMPMap.contains(shapeEntry)) { if (that->mySMPMap[shapeEntry] != "__TO_DELETE__") { - MESSAGE("Size map for shape with name(entry): "<< shapeName << "(" << entry << ")"); +// MESSAGE("Size map for shape with name(entry): "<< shapeName << "(" << entry << ")"); break; } } @@ -1816,7 +1815,7 @@ void BLSURFPluginGUI_HypothesisCreator::insertElementType(TopAbs_ShapeEnum typeS bool BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation() { - MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation()"); +// MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation()"); int row = 0, nbRows = mySizeMapTable->rowCount(); for ( ; row < nbRows; ++row ) if (not sizeMapValidationFromRow(row)) @@ -1826,7 +1825,7 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapsValidation() bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow(int myRow, bool displayError) { - MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow()"); +// MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow()"); QString myEntry = mySizeMapTable->item( myRow, SMP_ENTRY_COLUMN )->text(); bool res = sizeMapValidationFromEntry(myEntry,displayError); mySizeMapTable->setFocus(); @@ -1835,27 +1834,27 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromRow(int myRow, bool bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry(QString myEntry, bool displayError) { - MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry()"); +// MESSAGE("BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry()"); BLSURFPluginGUI_HypothesisCreator* that = (BLSURFPluginGUI_HypothesisCreator*)this; if (not that->mySMPMap.contains(myEntry)) { - MESSAGE("Geometry with entry "<mySMPShapeTypeMap.contains(myEntry)) { - MESSAGE("Shape type with entry "<mySMPMap[myEntry].startsWith("def")) { - MESSAGE("custom function" ); +// MESSAGE("custom function" ); expr = that->mySMPMap[myEntry].toStdString(); } else if (that->mySMPMap[myEntry].startsWith("ATTRACTOR")) { - MESSAGE("Attractor" ); +// MESSAGE("Attractor" ); 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 @@ -1926,7 +1925,7 @@ bool BLSURFPluginGUI_HypothesisCreator::sizeMapValidationFromEntry(QString myEnt PyGILState_Release(gstate); - MESSAGE("SizeMap expression "<FindObjectID(entry); if (aSO){ _PTR(SObject) aRefSObj; GEOM::GEOM_Object_var aShape; - MESSAGE("Got a SO"); + // MESSAGE("Got a SO"); // If selected object is a reference if ( aSO->ReferencedObject( aRefSObj )) aSO = aRefSObj; - MESSAGE("aSO->GetFatherComponent()->ComponentDataType(): " << aSO->GetFatherComponent()->ComponentDataType()); + // MESSAGE("aSO->GetFatherComponent()->ComponentDataType(): " << aSO->GetFatherComponent()->ComponentDataType()); if ( strcmp(aSO->GetFatherComponent()->ComponentDataType().c_str(),"GEOM") == 0) aShape = SMESH::SObjectToInterface(aSO); if ( !aShape->_is_nil() ){ - MESSAGE("Got the Geom Object "); - MESSAGE("Geom Object Type "<< aShape->GetType()); + // MESSAGE("Got the Geom Object "); + // MESSAGE("Geom Object Type "<< aShape->GetType()); SalomeApp_Application* anApp = GetSalomeApplication(); if (anApp) { - MESSAGE("Got Application"); +// MESSAGE("Got Application"); Engines::Component_var component = anApp->lcc()->FindOrLoad_Component( "FactoryServer","GEOM" ); GEOM::GEOM_Gen_var _geomEngine = GEOM::GEOM_Gen::_narrow(component); - MESSAGE("Got GEOM engine"); +// MESSAGE("Got GEOM engine"); // if the Geom Object is a group if (aShape->GetType() == GEOM_GROUP){ - MESSAGE("It's a group"); +// MESSAGE("It's a group"); GEOM::GEOM_IGroupOperations_var aGroupOp = _geomEngine->GetIGroupOperations(myStudy->StudyId()); ShapeType= (TopAbs_ShapeEnum)aGroupOp->GetType(aShape); } @@ -233,7 +233,7 @@ TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){ else { GEOM_Client* aClient = new GEOM_Client(); if ( aClient && !_geomEngine->_is_nil() ) { - MESSAGE("GEOM client is OK and GEOM engine is not null"); +// MESSAGE("GEOM client is OK and GEOM engine is not null"); S = aClient->GetShape( _geomEngine, aShape ); ShapeType=S.ShapeType(); } @@ -241,7 +241,7 @@ TopAbs_ShapeEnum GeomSelectionTools::entryToShapeType(std::string entry){ } } } - MESSAGE("ShapeType returned is " << ShapeType); +// MESSAGE("ShapeType returned is " << ShapeType); return ShapeType; }