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;
}
* */
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;
}
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() ) );
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);
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<QTreeWidgetItem *> selectedItems = myEnforcedTreeWidget->selectedItems();
QList<QTreeWidgetItem *> selectedVerteces;
QSet<QTreeWidgetItem *> selectedEntries;
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) {
}
foreach(item,selectedEntries) {
- MESSAGE("Remove " << item->text(ENF_VER_NAME_COLUMN).toStdString());
+// MESSAGE("Remove " << item->text(ENF_VER_NAME_COLUMN).toStdString());
delete item;
}
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 );
myOptionTable->resizeColumnToContents( OPTION_NAME_COLUMN );
// Sizemaps
- MESSAGE("retrieveParams():that->mySMPMap.size() = " << that->mySMPMap.size());
+// MESSAGE("retrieveParams():that->mySMPMap.size() = " << that->mySMPMap.size());
QMapIterator<QString, QString> i(that->mySMPMap);
GeomSelectionTools* myGeomToolSelected = that->getGeomSelectionTool();
while (i.hasNext()) {
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<std::string, std::set<std::vector<double> > >::const_iterator evmIt = data.enfVertMap.begin();
for ( ; evmIt != data.enfVertMap.end() ; ++evmIt) {
std::string entry = (*evmIt).first;
evs = (*evmIt).second;
}
catch(...) {
- MESSAGE("evs = (*evmIt)[entry]: FAIL");
+// MESSAGE("evs = (*evmIt)[entry]: FAIL");
break;
}
// 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;i<mySizeMaps->length(); ++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));
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]]);
}
}
*/
// attractor
BLSURFPlugin::string_array_var allMyAttractors = h->GetAttractorEntries();
- MESSAGE("myAttractors->length() = " << allMyAttractors->length());
+// MESSAGE("myAttractors->length() = " << allMyAttractors->length());
for ( int i = 0;i<allMyAttractors->length(); ++i ) {
QString myAttractors = allMyAttractors[i].in();
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;i<enforcedVertexMap->length(); ++i ) {
std::string entry = enforcedVertexMap[i].entry.in();
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);
}
}
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 {
else if (that->mySMPShapeTypeMap[entry] == TopAbs_VERTEX)
fullSizeMap = QString("def f(): return ") + sizeMap;
- MESSAGE("SetSizeMapEntry("<<entry.toStdString()<<") = " <<fullSizeMap.toStdString());
+// MESSAGE("SetSizeMapEntry("<<entry.toStdString()<<") = " <<fullSizeMap.toStdString());
h->SetSizeMapEntry( entry.toLatin1().constData(), fullSizeMap.toLatin1().constData() );
}
}
x = (*evsIt)[0];
y = (*evsIt)[1];
z = (*evsIt)[2];
- MESSAGE("SetEnforcedVertexEntry("<<entry<<", "<<x<<", "<<y<<", "<<z<<")");
+// MESSAGE("SetEnforcedVertexEntry("<<entry<<", "<<x<<", "<<y<<", "<<z<<")");
h->SetEnforcedVertexEntry( entry.c_str(), x, y, z );
}
// Remove old verteces
vertex.push_back(y);
vertex.push_back(z);
if (evs.find(vertex) == evs.end()) {
- MESSAGE("UnsetEnforcedVertexEntry("<<entry<<", "<<x<<", "<<y<<", "<<z<<")");
+// MESSAGE("UnsetEnforcedVertexEntry("<<entry<<", "<<x<<", "<<y<<", "<<z<<")");
h->UnsetEnforcedVertexEntry( entry.c_str(), x, y, z );
}
}
int nbEnforcedShapes = myEnforcedTreeWidget->topLevelItemCount();
int nbEnforcedVerteces = 0;
- MESSAGE("Nb of enforced shapes: " << nbEnforcedShapes);
+// MESSAGE("Nb of enforced shapes: " << nbEnforcedShapes);
for (int i=0 ; i<nbEnforcedShapes ; i++) {
QTreeWidgetItem* shapeItem = myEnforcedTreeWidget->topLevelItem(i);
if (shapeItem) {
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))
}
}
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));
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());
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();
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;
}
}
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))
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();
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 "<<myEntry.toStdString()<<" was not found.");
+// MESSAGE("Geometry with entry "<<myEntry.toStdString()<<" was not found.");
return false;
}
if (not that->mySMPShapeTypeMap.contains(myEntry)) {
- MESSAGE("Shape type with entry "<<myEntry.toStdString()<<" was not found.");
+// MESSAGE("Shape type with entry "<<myEntry.toStdString()<<" was not found.");
return false;
}
string expr;
if (that->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
PyGILState_Release(gstate);
- MESSAGE("SizeMap expression "<<expr<<" is valid");
+// MESSAGE("SizeMap expression "<<expr<<" is valid");
return true;
}