#include <GeometryGUI.h>
-#include <SMESHGUI_Utils.h>
-#include <SMESHGUI_SpinBox.h>
#include <SMESHGUI_HypothesesUtils.h>
+#include <SMESHGUI_SpinBox.h>
+#include <SMESHGUI_Utils.h>
#include <SMESH_NumberFilter.hxx>
#include <SMESH_TypeFilter.hxx>
#include <StdMeshersGUI_ObjectReferenceParamWdg.h>
+#include <StdMeshersGUI_SubShapeSelectorWdg.h>
#include <LightApp_SelectionMgr.h>
#include <SUIT_Session.h>
aStdLayout->addWidget( myBoundaryLayersGrowthCombo, row++, 1, 1, 1 );
QStringList typesBoundaryLayersGrowth;
- typesBoundaryLayersGrowth << tr( "HYBRID_LAYER_GROWTH_UPWARD" ) << tr( "HYBRID_LAYER_GROWTH_DOWNWARD" );
+ typesBoundaryLayersGrowth << tr( "HYBRID_LAYER_GROWTH_DOWNWARD" ) << tr( "HYBRID_LAYER_GROWTH_UPWARD" );
myBoundaryLayersGrowthCombo->addItems( typesBoundaryLayersGrowth );
aStdLayout->addWidget( new QLabel( tr( "HYBRID_HeightFirstLayer" ), myStdGroup ), row, 0, 1, 1 );
anEnfMeshLayout->addLayout(anEnfMeshLayout2, ENF_MESH_MESH+1, 1, ENF_MESH_NB_LINES, 1);
anEnfMeshLayout->setRowStretch(ENF_MESH_MESH, 10);
-
+
+ // selection of faces
+
+ QWidget* faceSelGroup = new QWidget( dlg() );
+ QGridLayout* faceSelLayout = new QGridLayout( faceSelGroup );
+
+ QLabel* facesLbl = new QLabel( tr("HYBRID_FACE_IDS"), faceSelGroup );
+ faceSelLayout->addWidget( facesLbl, 0, 0 );
+
+ myFaceSelector = new StdMeshersGUI_SubShapeSelectorWdg( faceSelGroup, TopAbs_FACE, true, true );
+ QString aMainEntry = SMESHGUI_GenericHypothesisCreator::getMainShapeEntry();
+ QString aSubEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
+ myFaceSelector->SetGeomShapeEntry( aSubEntry, aMainEntry );
+ faceSelLayout->addWidget( myFaceSelector, 1, 0, 2, 2 );
+ faceSelLayout->setRowStretch( 1, 10);
+
+
// add tabs
tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
tab->insertTab( ADV_TAB, myAdvGroup, tr( "HYBRID_ADV_ARGS" ) );
- //TODO remove or er usmay be lateful to select layers...
- //tab->insertTab( ENF_VER_TAB, myEnfGroup, tr( "HYBRID_ENFORCED_VERTICES" ) );
tab->insertTab( ENF_MESH_TAB, myEnfMeshGroup, tr( "HYBRID_ENFORCED_MESHES" ) );
+ if ( aMainEntry.isEmpty() && aSubEntry.isEmpty() ) // mesh not based of geometry
+ faceSelGroup->hide();
+ else
+ tab->insertTab( FACE_SEL_TAB, faceSelGroup, tr( "HYBRID_FACES_TAB" ));
tab->setCurrentIndex( STD_TAB );
// connections
+ connect( tab, SIGNAL( currentChanged ( int )), this, SLOT( onTabChanged( int ) ) );
//connect( myLayersOnAllWrapCheck, SIGNAL( toggled( bool ) ), this, SLOT( onLayersOnAllWrap(bool)));
connect( myLayersOnAllWrapCheck, SIGNAL( toggled( bool ) ), this, SLOT( updateWidgets() ) );
//connect( myToMeshHolesCheck, SIGNAL( toggled( bool ) ), this, SLOT( onToMeshHoles(bool)));
is synchronized with the coordinates of the enforced vertex clicked in the tree widget.
*/
void HYBRIDPluginGUI_HypothesisCreator::updateEnforcedVertexValues(QTableWidgetItem* item) {
-// MESSAGE("HYBRIDPluginGUI_HypothesisCreator::updateEnforcedVertexValues");
int row = myEnforcedTableWidget->row(item);
QVariant vertexName = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole);
if (!groupName.isEmpty())
toolTip += QString(" [") + groupName + QString("]");
-// MESSAGE("Tooltip: " << toolTip.toStdString());
for (int col=0;col<ENF_VER_NB_COLUMNS;col++)
myEnforcedTableWidget->item(row,col)->setToolTip(toolTip);
*/
void HYBRIDPluginGUI_HypothesisCreator::addEnforcedMesh(std::string name, std::string entry, int elementType, std::string groupName)
{
- MESSAGE("addEnforcedMesh(\"" << name << ", \"" << entry << "\", " << elementType << ", \"" << groupName << "\")");
bool okToCreate = true;
QString itemEntry = "";
int itemElementType = 0;
bool allColumns = true;
for (int row = 0;row<rowCount;row++) {
for (int col = 0 ; col < ENF_MESH_NB_COLUMNS ; col++) {
- MESSAGE("col: " << col);
if (col == ENF_MESH_CONSTRAINT_COLUMN){
if (qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col)) == 0) {
allColumns = false;
- MESSAGE("allColumns = false");
break;
}
}
else if (myEnforcedMeshTableWidget->item(row, col) == 0) {
allColumns = false;
- MESSAGE("allColumns = false");
break;
}
if (col == ENF_MESH_CONSTRAINT_COLUMN) {
QComboBox* itemComboBox = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row, col));
itemElementType = itemComboBox->currentIndex();
- MESSAGE("itemElementType: " << itemElementType);
}
else if (col == ENF_MESH_ENTRY_COLUMN)
itemEntry = myEnforcedMeshTableWidget->item(row, col)->data(Qt::EditRole).toString();
if (itemEntry == QString(entry.c_str()) && itemElementType == elementType) {
// // update group name
// if (itemGroupName.toStdString() != groupName) {
-// MESSAGE("Group is updated from \"" << itemGroupName.toStdString() << "\" to \"" << groupName << "\"");
// myEnforcedMeshTableWidget->item(row, ENF_MESH_GROUP_COLUMN)->setData( Qt::EditRole, QVariant(groupName.c_str()));
// }
okToCreate = false;
if (!okToCreate)
return;
- MESSAGE("Creation of enforced mesh");
myEnforcedMeshTableWidget->setRowCount(rowCount+1);
myEnforcedMeshTableWidget->setSortingEnabled(false);
for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
- MESSAGE("Column: " << col);
if (col == ENF_MESH_CONSTRAINT_COLUMN) {
QComboBox* comboBox = new QComboBox();
QPalette pal = comboBox->palette();
comboBox->insertItems(0,myEnfMeshConstraintLabels);
comboBox->setEditable(false);
comboBox->setCurrentIndex(elementType);
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << comboBox->currentText().toStdString());
myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
}
else {
case ENF_MESH_NAME_COLUMN:
item->setData( 0, name.c_str() );
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
myEnforcedMeshTableWidget->setItem(rowCount,col,item);
break;
case ENF_MESH_ENTRY_COLUMN:
item->setData( 0, entry.c_str() );
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
myEnforcedMeshTableWidget->setItem(rowCount,col,item);
break;
case ENF_MESH_GROUP_COLUMN:
item->setData( 0, groupName.c_str() );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
myEnforcedMeshTableWidget->setItem(rowCount,col,item);
break;
default:
break;
}
}
- MESSAGE("Done");
}
// connect( myEnforcedMeshTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
*/
void HYBRIDPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, double z, double size, std::string vertexName, std::string geomEntry, std::string groupName, bool isCompound)
{
- MESSAGE("addEnforcedVertex(" << x << ", " << y << ", " << z << ", " << size << ", \"" << vertexName << ", \"" << geomEntry << "\", \"" << groupName << "\", " << isCompound << ")");
myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *)));
bool okToCreate = true;
double itemX,itemY,itemZ,itemSize = 0;
if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || /*( (itemEntry.toStdString() != "") && */ (itemEntry.toStdString() == geomEntry)/*)*/) {
// update size
if (itemSize != size) {
- MESSAGE("Size is updated from \"" << itemSize << "\" to \"" << size << "\"");
myEnforcedTableWidget->item(row, ENF_VER_SIZE_COLUMN)->setData( Qt::EditRole, QVariant(size));
}
// update group name
if (itemGroupName.toStdString() != groupName) {
- MESSAGE("Group is updated from \"" << itemGroupName.toStdString() << "\" to \"" << groupName << "\"");
myEnforcedTableWidget->item(row, ENF_VER_GROUP_COLUMN)->setData( Qt::EditRole, QVariant(groupName.c_str()));
}
okToCreate = false;
} // for
if (!okToCreate) {
if (geomEntry.empty()) {
- MESSAGE("Vertex with coords " << x << ", " << y << ", " << z << " already exist: dont create again");
}
else {
- MESSAGE("Vertex with entry " << geomEntry << " already exist: dont create again");
}
return;
}
if (geomEntry.empty()) {
- MESSAGE("Vertex with coords " << x << ", " << y << ", " << z<< " is created");
}
else {
- MESSAGE("Vertex with geom entry " << geomEntry << " is created");
}
int vertexIndex=0;
}
}
- MESSAGE("myVertexName is \"" << myVertexName.toStdString() << "\"");
myEnforcedTableWidget->setRowCount(rowCount+1);
myEnforcedTableWidget->setSortingEnabled(false);
for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
- MESSAGE("Column: " << col);
QTableWidgetItem* item = new QTableWidgetItem();
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
switch (col) {
break;
}
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
myEnforcedTableWidget->setItem(rowCount,col,item);
- MESSAGE("Done");
}
connect( myEnforcedTableWidget,SIGNAL( itemChanged(QTableWidgetItem *)), this, SLOT( updateEnforcedVertexValues(QTableWidgetItem *) ) );
*/
void HYBRIDPluginGUI_HypothesisCreator::onAddEnforcedMesh()
{
- MESSAGE("HYBRIDPluginGUI_HypothesisCreator::onAddEnforcedMesh()");
HYBRIDPluginGUI_HypothesisCreator* that = (HYBRIDPluginGUI_HypothesisCreator*)this;
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
_PTR(SObject) aSObj; //SMESH::SMESH_IDSource::_nil;
QString meshEntry = myEnfMeshWdg->GetValue();
- MESSAGE("myEnfMeshWdg->GetValue()" << meshEntry.toStdString());
if (selEnfMeshes == 1)
{
- MESSAGE("1 SMESH object selected");
// myEnfMesh = myEnfMeshWdg->GetObject< SMESH::SMESH_IDSource >();
// std::string entry = myEnfMeshWdg->GetValue();
aSObj = aStudy->FindObjectID(meshEntry.toStdString().c_str());
}
else
{
- MESSAGE(selEnfMeshes << " SMESH objects selected");
QStringList meshEntries = meshEntry.split(" ", QString::SkipEmptyParts);
QStringListIterator meshEntriesIt (meshEntries);
while (meshEntriesIt.hasNext()) {
*/
void HYBRIDPluginGUI_HypothesisCreator::onAddEnforcedVertex()
{
- MESSAGE("HYBRIDPluginGUI_HypothesisCreator::onAddEnforcedVertex()");
HYBRIDPluginGUI_HypothesisCreator* that = (HYBRIDPluginGUI_HypothesisCreator*)this;
if (selEnfVertex <= 1)
{
- MESSAGE("0 or 1 GEOM object selected");
double x = 0, y = 0, z=0;
if (myXCoord->GetString() != "") {
x = myXCoord->GetValue();
z = myZCoord->GetValue();
}
if (selEnfVertex == 1) {
- MESSAGE("1 GEOM object selected");
myEnfVertex = myEnfVertexWdg->GetObject< GEOM::GEOM_Object >();
std::string entry = "";
if (myEnfVertex != GEOM::GEOM_Object::_nil())
addEnforcedVertex(x, y, z, size, myEnfVertex->GetName(),entry, groupName, myEnfVertex->GetShapeType() == GEOM::COMPOUND);
}
else {
- MESSAGE("0 GEOM object selected");
- MESSAGE("Coords: ("<<x<<","<<y<<","<<z<<")");
addEnforcedVertex(x, y, z, size, "", "", groupName);
}
}
it.toBack();
while ( it.hasPrevious() ) {
row = it.previous();
- MESSAGE("delete row #"<< row);
myEnforcedMeshTableWidget->removeRow(row );
}
it.toBack();
while ( it.hasPrevious() ) {
row = it.previous();
- MESSAGE("delete row #"<< row);
myEnforcedTableWidget->removeRow(row );
}
myAdvWidget->workingDirectoryLineEdit->setText( dir );
}
+void HYBRIDPluginGUI_HypothesisCreator::onTabChanged( int )
+{
+ myEnfVertexWdg->deactivateSelection();
+ myEnfMeshWdg->deactivateSelection();
+ myFaceSelector->ActivateSelection( false );
+ myFaceSelector->ShowPreview( false );
+}
+
void HYBRIDPluginGUI_HypothesisCreator::updateWidgets()
{
//customs automatic set
addEnfMeshButton->setEnabled(enabled);
removeEnfMeshButton->setEnabled(enabled);
myEnfMeshWdg->setEnabled(enabled);
- //xxx->setEnabled(enabled);
+ if ( QTabWidget* tab = qobject_cast<QTabWidget*>( myStdGroup->parentWidget()->parentWidget() ))
+ tab->setTabEnabled( FACE_SEL_TAB, enabled );
}
bool HYBRIDPluginGUI_HypothesisCreator::checkParams(QString& msg) const
{
- MESSAGE("HYBRIDPluginGUI_HypothesisCreator::checkParams");
if ( !QFileInfo( myAdvWidget->workingDirectoryLineEdit->text().trimmed() ).isWritable() ) {
SUIT_MessageBox::warning( dlg(),
void HYBRIDPluginGUI_HypothesisCreator::retrieveParams() const
{
- MESSAGE("HYBRIDPluginGUI_HypothesisCreator::retrieveParams");
HYBRIDPluginGUI_HypothesisCreator* that = (HYBRIDPluginGUI_HypothesisCreator*)this;
HYBRIDHypothesisData data;
readParamsFromHypo( data );
myAdvWidget->initialMemorySpin ->setValue ( qMax( data.myInitialMemory,
myAdvWidget->initialMemorySpin->minimum() ));
- myCollisionModeCombo ->setCurrentIndex( data.myCollisionMode );
- myBoundaryLayersGrowthCombo ->setCurrentIndex( data.myBoundaryLayersGrowth );
- myElementGenerationCombo ->setCurrentIndex( data.myElementGeneration );
- myAddMultinormalsCheck -> setChecked ( data.myAddMultinormals );
- mySmoothNormalsCheck -> setChecked ( data.mySmoothNormals );
- myHeightFirstLayerSpin -> setValue( data.myHeightFirstLayer );
- myNbOfBoundaryLayersSpin -> setValue( data.myNbOfBoundaryLayers );
+ myCollisionModeCombo ->setCurrentIndex( data.myCollisionMode );
+ myBoundaryLayersGrowthCombo ->setCurrentIndex( data.myBoundaryLayersGrowth );
+ myElementGenerationCombo ->setCurrentIndex( data.myElementGeneration );
+ myAddMultinormalsCheck -> setChecked ( data.myAddMultinormals );
+ mySmoothNormalsCheck -> setChecked ( data.mySmoothNormals );
+ myHeightFirstLayerSpin -> setValue( data.myHeightFirstLayer );
+ myNbOfBoundaryLayersSpin -> setValue( data.myNbOfBoundaryLayers );
myBoundaryLayersProgressionSpin -> setValue( data.myBoundaryLayersProgression );
- myMultinormalsAngleSpin -> setValue( data.myMultinormalsAngle );
+ myMultinormalsAngleSpin -> setValue( data.myMultinormalsAngle );
+ myFaceSelector ->SetListOfIDs( data.myFaceWLIds );
myAdvWidget->workingDirectoryLineEdit ->setText ( data.myWorkingDir );
myAdvWidget->keepWorkingFilesCheck ->setChecked( data.myKeepFiles );
myAdvWidget->boundaryRecoveryCheck ->setChecked( data.myBoundaryRecovery );
myAdvWidget->FEMCorrectionCheck ->setChecked( data.myFEMCorrection );
myAdvWidget->gradationSpinBox ->setValue ( data.myGradation );
- myAdvWidget->myAdvOptionsTable ->SetCustomOptions( data.myTextOption );
+ myAdvWidget->myAdvOptionsTable ->SetCustomOptions( data.myTextOption );
myAdvWidget->logInFileCheck ->setChecked( !data.myLogInStandardOutput );
myAdvWidget->removeLogOnSuccessCheck ->setChecked( data.myRemoveLogOnSuccess );
myEnforcedTableWidget->setRowCount(rowCount+1);
for (int col=0;col<ENF_VER_NB_COLUMNS;col++) {
- MESSAGE("Column: " << col);
-// MESSAGE("enfVertex->isCompound: " << enfVertex->isCompound);
QTableWidgetItem* item = new QTableWidgetItem();
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
switch (col) {
else
item->setIcon(QIcon(iconVertex.scaled(iconVertex.size()*0.7,Qt::KeepAspectRatio,Qt::SmoothTransformation)));
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
}
break;
case ENF_VER_X_COLUMN:
if (!enfVertex->isCompound) {
item->setData( 0, enfVertex->coords.at(0) );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
}
break;
case ENF_VER_Y_COLUMN:
if (!enfVertex->isCompound) {
item->setData( 0, enfVertex->coords.at(1) );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
}
break;
case ENF_VER_Z_COLUMN:
if (!enfVertex->isCompound) {
item->setData( 0, enfVertex->coords.at(2) );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
}
break;
case ENF_VER_SIZE_COLUMN:
item->setData( 0, enfVertex->size );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
break;
case ENF_VER_ENTRY_COLUMN:
item->setData( 0, enfVertex->geomEntry.c_str() );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
break;
case ENF_VER_COMPOUND_COLUMN:
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable);
item->setData( Qt::CheckStateRole, enfVertex->isCompound );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << enfVertex->isCompound);
break;
case ENF_VER_GROUP_COLUMN:
item->setData( 0, enfVertex->groupName.c_str() );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
break;
default:
break;
}
myEnforcedTableWidget->setItem(rowCount,col,item);
- MESSAGE("Done");
}
that->updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
rowCount++;
myEnforcedMeshTableWidget->setRowCount(rowCount+1);
for (int col=0;col<ENF_MESH_NB_COLUMNS;col++) {
- MESSAGE("Column: " << col);
if (col == ENF_MESH_CONSTRAINT_COLUMN) {
QComboBox* comboBox = new QComboBox();
QPalette pal = comboBox->palette();
comboBox->insertItems(0,myEnfMeshConstraintLabels);
comboBox->setEditable(false);
comboBox->setCurrentIndex(enfMesh->elementType);
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << comboBox->currentText().toStdString());
myEnforcedMeshTableWidget->setCellWidget(rowCount,col,comboBox);
}
else {
case ENF_MESH_NAME_COLUMN:
item->setData( 0, enfMesh->name.c_str() );
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
myEnforcedMeshTableWidget->setItem(rowCount,col,item);
break;
case ENF_MESH_ENTRY_COLUMN:
item->setData( 0, enfMesh->entry.c_str() );
item->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled);
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
myEnforcedMeshTableWidget->setItem(rowCount,col,item);
break;
case ENF_MESH_GROUP_COLUMN:
item->setData( 0, enfMesh->groupName.c_str() );
- MESSAGE("Add item in table at (" << rowCount << "," << col << "): " << item->text().toStdString());
myEnforcedMeshTableWidget->setItem(rowCount,col,item);
break;
default:
}
// myEnforcedMeshTableWidget->setItem(rowCount,col,item);
- MESSAGE("Done");
}
// that->updateEnforcedVertexValues(myEnforcedTableWidget->item(rowCount,ENF_VER_NAME_COLUMN));
rowCount++;
QString HYBRIDPluginGUI_HypothesisCreator::storeParams() const
{
- MESSAGE("HYBRIDPluginGUI_HypothesisCreator::storeParams");
- HYBRIDHypothesisData data;
- readParamsFromWidgets( data );
- storeParamsToHypo( data );
-
- QString valStr = "";
-
- if ( !data.myBoundaryRecovery )
- valStr = "-c " + QString::number( !data.myToMeshHoles );
-
- if ( data.myOptimizationLevel >= 0 && data.myOptimizationLevel < 5 && !data.myBoundaryRecovery) {
- const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
- valStr += " -o ";
- valStr += level[ data.myOptimizationLevel ];
- }
- if ( data.myMaximumMemory > 0 ) {
- valStr += " -m ";
- valStr += QString::number( data.myMaximumMemory );
- }
- if ( data.myInitialMemory > 0 && !data.myBoundaryRecovery ) {
- valStr += " -M ";
- valStr += QString::number( data.myInitialMemory );
- }
- valStr += " -v ";
- valStr += QString::number( data.myVerboseLevel );
-
- if ( !data.myToCreateNewNodes )
- valStr += " -p0";
-
- if ( data.myRemoveInitialCentralPoint )
- valStr += " -no_initial_central_point";
-
- if ( data.myBoundaryRecovery )
- valStr += " -C";
-
- if ( data.myFEMCorrection )
- valStr += " -FEM";
-
- if ( data.myGradation != 1.05 ) {
- valStr += " -Dcpropa=";
- valStr += QString::number( data.myGradation );
- }
-
- valStr += " ";
- valStr += data.myTextOption;
-
-// valStr += " #BEGIN ENFORCED VERTICES#";
-// // Add size map parameters storage
-// for (int i=0 ; i<mySmpModel->rowCount() ; i++) {
-// valStr += " (";
-// double x = mySmpModel->data(mySmpModel->index(i,ENF_VER_X_COLUMN)).toDouble();
-// double y = mySmpModel->data(mySmpModel->index(i,ENF_VER_Y_COLUMN)).toDouble();
-// double z = mySmpModel->data(mySmpModel->index(i,ENF_VER_Z_COLUMN)).toDouble();
-// double size = mySmpModel->data(mySmpModel->index(i,ENF_VER_SIZE_COLUMN)).toDouble();
-// valStr += QString::number( x );
-// valStr += ",";
-// valStr += QString::number( y );
-// valStr += ",";
-// valStr += QString::number( z );
-// valStr += ")=";
-// valStr += QString::number( size );
-// if (i!=mySmpModel->rowCount()-1)
-// valStr += ";";
-// }
-// valStr += " #END ENFORCED VERTICES#";
-// MESSAGE(valStr.toStdString());
+ HYBRIDHypothesisData data;
+ readParamsFromWidgets( data );
+ storeParamsToHypo( data );
+
+ QString valStr = "";
+
+ if ( !data.myBoundaryRecovery )
+ valStr = "-c " + QString::number( !data.myToMeshHoles );
+
+ if ( data.myOptimizationLevel >= 0 && data.myOptimizationLevel < 5 && !data.myBoundaryRecovery) {
+ const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
+ valStr += " -o ";
+ valStr += level[ data.myOptimizationLevel ];
+ }
+ if ( data.myMaximumMemory > 0 ) {
+ valStr += " -m ";
+ valStr += QString::number( data.myMaximumMemory );
+ }
+ if ( data.myInitialMemory > 0 && !data.myBoundaryRecovery ) {
+ valStr += " -M ";
+ valStr += QString::number( data.myInitialMemory );
+ }
+ valStr += " -v ";
+ valStr += QString::number( data.myVerboseLevel );
+
+ if ( !data.myToCreateNewNodes )
+ valStr += " -p0";
+
+ if ( data.myRemoveInitialCentralPoint )
+ valStr += " -no_initial_central_point";
+
+ if ( data.myBoundaryRecovery )
+ valStr += " -C";
+
+ if ( data.myFEMCorrection )
+ valStr += " -FEM";
+
+ if ( data.myGradation != 1.05 ) {
+ valStr += " -Dcpropa=";
+ valStr += QString::number( data.myGradation );
+ }
+
+ valStr += " ";
+ valStr += data.myTextOption;
+
+ // valStr += " #BEGIN ENFORCED VERTICES#";
+ // // Add size map parameters storage
+ // for (int i=0 ; i<mySmpModel->rowCount() ; i++) {
+ // valStr += " (";
+ // double x = mySmpModel->data(mySmpModel->index(i,ENF_VER_X_COLUMN)).toDouble();
+ // double y = mySmpModel->data(mySmpModel->index(i,ENF_VER_Y_COLUMN)).toDouble();
+ // double z = mySmpModel->data(mySmpModel->index(i,ENF_VER_Z_COLUMN)).toDouble();
+ // double size = mySmpModel->data(mySmpModel->index(i,ENF_VER_SIZE_COLUMN)).toDouble();
+ // valStr += QString::number( x );
+ // valStr += ",";
+ // valStr += QString::number( y );
+ // valStr += ",";
+ // valStr += QString::number( z );
+ // valStr += ")=";
+ // valStr += QString::number( size );
+ // if (i!=mySmpModel->rowCount()-1)
+ // valStr += ";";
+ // }
+ // valStr += " #END ENFORCED VERTICES#";
return valStr;
}
bool HYBRIDPluginGUI_HypothesisCreator::readParamsFromHypo( HYBRIDHypothesisData& h_data ) const
{
- MESSAGE("HYBRIDPluginGUI_HypothesisCreator::readParamsFromHypo");
HYBRIDPlugin::HYBRIDPlugin_Hypothesis_var h =
HYBRIDPlugin::HYBRIDPlugin_Hypothesis::_narrow( initParamsHypothesis() );
HypothesisData* data = SMESH::GetHypothesisData( hypType() );
h_data.myName = isCreation() && data ? hypName() : "";
+ h_data.myCollisionMode = h->GetCollisionMode();
+ h_data.myBoundaryLayersGrowth = h->GetBoundaryLayersGrowth();
+ h_data.myElementGeneration = h->GetElementGeneration();
+ h_data.myAddMultinormals = h->GetAddMultinormals();
+ h_data.mySmoothNormals = h->GetSmoothNormals();
+ h_data.myHeightFirstLayer = h->GetHeightFirstLayer();
+ h_data.myBoundaryLayersProgression = h->GetBoundaryLayersProgression();
+ h_data.myMultinormalsAngle = h->GetMultinormalsAngle();
+ h_data.myNbOfBoundaryLayers = h->GetNbOfBoundaryLayers();
+ h_data.myFaceWLIds = h->GetFacesWithLayers();
+
h_data.myLayersOnAllWrap = h->GetLayersOnAllWrap();
h_data.myToMeshHoles = h->GetToMeshHoles();
h_data.myToMakeGroupsOfDomains = /*h->GetToMeshHoles() &&*/ h->GetToMakeGroupsOfDomains();
h_data.myInitialMemory = h->GetInitialMemory();
h_data.myOptimizationLevel = h->GetOptimizationLevel();
- h_data.myCollisionMode = h->GetCollisionMode();
- h_data.myBoundaryLayersGrowth = h->GetBoundaryLayersGrowth();
- h_data.myElementGeneration = h->GetElementGeneration();
- h_data.myAddMultinormals = h->GetAddMultinormals();
- h_data.mySmoothNormals = h->GetSmoothNormals();
- h_data.myHeightFirstLayer = h->GetHeightFirstLayer();
- h_data.myBoundaryLayersProgression = h->GetBoundaryLayersProgression();
- h_data.myMultinormalsAngle = h->GetMultinormalsAngle();
- h_data.myNbOfBoundaryLayers = h->GetNbOfBoundaryLayers();
-
h_data.myKeepFiles = h->GetKeepFiles();
h_data.myWorkingDir = h->GetWorkingDirectory();
h_data.myVerboseLevel = h->GetVerboseLevel();
h_data.myRemoveLogOnSuccess = h->GetRemoveLogOnSuccess();
HYBRIDPlugin::HYBRIDEnforcedVertexList_var vertices = h->GetEnforcedVertices();
- MESSAGE("vertices->length(): " << vertices->length());
h_data.myEnforcedVertices.clear();
for (CORBA::ULong i=0 ; i<vertices->length() ; i++) {
TEnfVertex* myVertex = new TEnfVertex();
if (vertices[i].coords.length()) {
for (CORBA::ULong c = 0; c < vertices[i].coords.length() ; c++)
myVertex->coords.push_back(vertices[i].coords[c]);
- MESSAGE("Add enforced vertex ("<< myVertex->coords.at(0) << ","<< myVertex->coords.at(1) << ","<< myVertex->coords.at(2) << ") ="<< myVertex->size);
}
h_data.myEnforcedVertices.insert(myVertex);
}
HYBRIDPlugin::HYBRIDEnforcedMeshList_var enfMeshes = h->GetEnforcedMeshes();
- MESSAGE("enfMeshes->length(): " << enfMeshes->length());
h_data.myEnforcedMeshes.clear();
for (CORBA::ULong i=0 ; i<enfMeshes->length() ; i++) {
TEnfMesh* myEnfMesh = new TEnfMesh();
bool HYBRIDPluginGUI_HypothesisCreator::storeParamsToHypo( const HYBRIDHypothesisData& h_data ) const
{
- MESSAGE("HYBRIDPluginGUI_HypothesisCreator::storeParamsToHypo");
HYBRIDPlugin::HYBRIDPlugin_Hypothesis_var h =
HYBRIDPlugin::HYBRIDPlugin_Hypothesis::_narrow( hypothesis() );
h->SetInitialMemory ( h_data.myInitialMemory );
if ( h->GetOptimizationLevel() != h_data.myOptimizationLevel )
h->SetOptimizationLevel( h_data.myOptimizationLevel );
-
+
if ( h->GetCollisionMode() != h_data.myCollisionMode )
h->SetCollisionMode( h_data.myCollisionMode );
if ( h->GetBoundaryLayersGrowth() != h_data.myBoundaryLayersGrowth )
h->SetMultinormalsAngle ( h_data.myMultinormalsAngle );
if ( h->GetNbOfBoundaryLayers() != h_data.myNbOfBoundaryLayers )
h->SetNbOfBoundaryLayers ( h_data.myNbOfBoundaryLayers );
-
+ h->SetFacesWithLayers( h_data.myFaceWLIds );
+
if ( h->GetKeepFiles() != h_data.myKeepFiles)
h->SetKeepFiles ( h_data.myKeepFiles);
if ( h->GetWorkingDirectory() != h_data.myWorkingDir )
h->SetAdvancedOption ( h_data.myTextOption.toLatin1().constData() );
if ( h->GetStandardOutputLog() != h_data.myLogInStandardOutput )
h->SetStandardOutputLog ( h_data.myLogInStandardOutput );
- if ( h->GetRemoveLogOnSuccess() != h_data.myRemoveLogOnSuccess )
+ if ( h->GetRemoveLogOnSuccess() != h_data.myRemoveLogOnSuccess )
h->SetRemoveLogOnSuccess ( h_data.myRemoveLogOnSuccess );
// Enforced vertices
- int nbVertex = (int) h_data.myEnforcedVertices.size();
+ //int nbVertex = (int) h_data.myEnforcedVertices.size();
HYBRIDPlugin::HYBRIDEnforcedVertexList_var vertexHyp = h->GetEnforcedVertices();
int nbVertexHyp = vertexHyp->length();
- MESSAGE("Store params for size maps: " << nbVertex << " enforced vertices");
- MESSAGE("h->GetEnforcedVertices()->length(): " << nbVertexHyp);
// 1. Clear all enforced vertices in hypothesis
// 2. Add new enforced vertex according to h_data
} // for
// Enforced Meshes
- int nbEnfMeshes = (int) h_data.myEnforcedMeshes.size();
+ //int nbEnfMeshes = (int) h_data.myEnforcedMeshes.size();
HYBRIDPlugin::HYBRIDEnforcedMeshList_var enfMeshListHyp = h->GetEnforcedMeshes();
int nbEnfMeshListHyp = enfMeshListHyp->length();
- MESSAGE("Store params for size maps: " << nbEnfMeshes << " enforced meshes");
- MESSAGE("h->GetEnforcedMeshes()->length(): " << nbEnfMeshListHyp);
// 1. Clear all enforced vertices in hypothesis
// 2. Add new enforced vertex according to h_data
_PTR(SObject) aSObj = aStudy->FindObjectID(enfMesh->entry.c_str());
SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface<SMESH::SMESH_IDSource>( aSObj );
- MESSAGE("enfMesh->elementType: " << enfMesh->elementType);
SMESH::ElementType elementType;
switch(enfMesh->elementType) {
case 0:
bool HYBRIDPluginGUI_HypothesisCreator::readParamsFromWidgets( HYBRIDHypothesisData& h_data ) const
{
- MESSAGE("HYBRIDPluginGUI_HypothesisCreator::readParamsFromWidgets");
h_data.myName = myName ? myName->text() : "";
h_data.myLayersOnAllWrap = myLayersOnAllWrapCheck->isChecked();
h_data.myToMeshHoles = myToMeshHolesCheck->isChecked();
h_data.myMaximumMemory = myAdvWidget->maxMemoryCheck->isChecked() ? myAdvWidget->maxMemorySpin->value() : -1;
h_data.myInitialMemory = myAdvWidget->initialMemoryCheck->isChecked() ? myAdvWidget->initialMemorySpin->value() : -1;
h_data.myOptimizationLevel = myOptimizationLevelCombo->currentIndex();
-
- h_data.myCollisionMode = myCollisionModeCombo->currentIndex();
- h_data.myBoundaryLayersGrowth = myBoundaryLayersGrowthCombo->currentIndex();
- h_data.myElementGeneration = myElementGenerationCombo->currentIndex();
- h_data.myAddMultinormals = myAddMultinormalsCheck->isChecked();
- h_data.mySmoothNormals = mySmoothNormalsCheck->isChecked();
-
- h_data.myHeightFirstLayer = myHeightFirstLayerSpin -> value();
- h_data.myNbOfBoundaryLayers = myNbOfBoundaryLayersSpin -> value();
- h_data.myBoundaryLayersProgression = myBoundaryLayersProgressionSpin -> value();
- h_data.myMultinormalsAngle = myMultinormalsAngleSpin -> value();
-
+
+ h_data.myCollisionMode = myCollisionModeCombo->currentIndex();
+ h_data.myBoundaryLayersGrowth = myBoundaryLayersGrowthCombo->currentIndex();
+ h_data.myElementGeneration = myElementGenerationCombo->currentIndex();
+ h_data.myAddMultinormals = myAddMultinormalsCheck->isChecked();
+ h_data.mySmoothNormals = mySmoothNormalsCheck->isChecked();
+
+ h_data.myHeightFirstLayer = myHeightFirstLayerSpin -> value();
+ h_data.myNbOfBoundaryLayers = myNbOfBoundaryLayersSpin -> value();
+ h_data.myBoundaryLayersProgression = myBoundaryLayersProgressionSpin -> value();
+ h_data.myMultinormalsAngle = myMultinormalsAngleSpin -> value();
+ h_data.myFaceWLIds = myFaceSelector->GetListOfIDs();
+
h_data.myKeepFiles = myAdvWidget->keepWorkingFilesCheck->isChecked();
h_data.myWorkingDir = myAdvWidget->workingDirectoryLineEdit->text().trimmed();
h_data.myVerboseLevel = myAdvWidget->verboseLevelSpin->value();
h_data.myTextOption = myAdvWidget->myAdvOptionsTable->GetCustomOptions();
h_data.myLogInStandardOutput = !myAdvWidget->logInFileCheck->isChecked();
h_data.myRemoveLogOnSuccess = myAdvWidget->removeLogOnSuccessCheck->isChecked();
-
+
// Enforced vertices
h_data.myEnforcedVertices.clear();
QVariant valueX, valueY, valueZ;
TEnfVertex *myVertex = new TEnfVertex();
myVertex->name = myEnforcedTableWidget->item(row,ENF_VER_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
- MESSAGE("Add new enforced vertex \"" << myVertex->name << "\"" );
myVertex->geomEntry = myEnforcedTableWidget->item(row,ENF_VER_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
if (myVertex->geomEntry.size())
- MESSAGE("Geom entry is \"" << myVertex->geomEntry << "\"" );
myVertex->groupName = myEnforcedTableWidget->item(row,ENF_VER_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
if (myVertex->groupName.size())
- MESSAGE("Group name is \"" << myVertex->groupName << "\"" );
valueX = myEnforcedTableWidget->item(row,ENF_VER_X_COLUMN)->data(Qt::EditRole);
valueY = myEnforcedTableWidget->item(row,ENF_VER_Y_COLUMN)->data(Qt::EditRole);
valueZ = myEnforcedTableWidget->item(row,ENF_VER_Z_COLUMN)->data(Qt::EditRole);
myVertex->coords.push_back(valueX.toDouble());
myVertex->coords.push_back(valueY.toDouble());
myVertex->coords.push_back(valueZ.toDouble());
- MESSAGE("Coords are (" << myVertex->coords.at(0) << ", "
- << myVertex->coords.at(1) << ", "
- << myVertex->coords.at(2) << ")");
}
myVertex->size = myEnforcedTableWidget->item(row,ENF_VER_SIZE_COLUMN)->data(Qt::EditRole).toDouble();
- MESSAGE("Size is " << myVertex->size);
myVertex->isCompound = myEnforcedTableWidget->item(row,ENF_VER_COMPOUND_COLUMN)->data(Qt::CheckStateRole).toBool();
- MESSAGE("Is compound ? " << myVertex->isCompound);
h_data.myEnforcedVertices.insert(myVertex);
}
TEnfMesh *myEnfMesh = new TEnfMesh();
myEnfMesh->name = myEnforcedMeshTableWidget->item(row,ENF_MESH_NAME_COLUMN)->data(Qt::EditRole).toString().toStdString();
- MESSAGE("Add new enforced mesh \"" << myEnfMesh->name << "\"" );
myEnfMesh->entry = myEnforcedMeshTableWidget->item(row,ENF_MESH_ENTRY_COLUMN)->data(Qt::EditRole).toString().toStdString();
- MESSAGE("Entry is \"" << myEnfMesh->entry << "\"" );
myEnfMesh->groupName = myEnforcedMeshTableWidget->item(row,ENF_MESH_GROUP_COLUMN)->data(Qt::EditRole).toString().toStdString();
- MESSAGE("Group name is \"" << myEnfMesh->groupName << "\"" );
QComboBox* combo = qobject_cast<QComboBox*>(myEnforcedMeshTableWidget->cellWidget(row,ENF_MESH_CONSTRAINT_COLUMN));
myEnfMesh->elementType = combo->currentIndex();
- MESSAGE("Element type: " << myEnfMesh->elementType);
h_data.myEnforcedMeshes.insert(myEnfMesh);
std::cout << "h_data.myEnforcedMeshes.size(): " << h_data.myEnforcedMeshes.size() << std::endl;
}
#include <SMESH_MesherHelper.hxx>
#include <SMESH_ProxyMesh.hxx>
#include <SMESH_subMeshEventListener.hxx>
-// #include <StdMeshers_QuadToTriaAdaptor.hxx>
-// #include <StdMeshers_ViscousLayers.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepBndLib.hxx>
static const char theDomainGroupNamePrefix[] = "Domain_";
-static void removeFile( const TCollection_AsciiString& fileName )
+static void removeFile( const std::string& fileName )
{
try {
- SMESH_File( fileName.ToCString() ).remove();
+ SMESH_File( fileName ).remove();
}
catch ( ... ) {
- MESSAGE("Can't remove file: " << fileName.ToCString() << " ; file does not exist or permission denied");
+ MESSAGE("Can't remove file: " << fileName << " ; file does not exist or permission denied");
}
}
HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID(int hypId, int studyId, SMESH_Gen* gen)
: SMESH_3D_Algo(hypId, studyId, gen)
{
- MESSAGE("HYBRIDPlugin_HYBRID::HYBRIDPlugin_HYBRID");
_name = Name();
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
_onlyUnaryInput = true; // Compute() will be called on each solid
_iShape=0;
_nbShape=0;
_compatibleHypothesis.push_back( HYBRIDPlugin_Hypothesis::GetHypType());
- //_compatibleHypothesis.push_back( StdMeshers_ViscousLayers::GetHypType() );
_requireShape = false; // can work without shape_studyId
smeshGen_i = SMESH_Gen_i::GetSMESHGen();
CORBA::Object_var anObject = smeshGen_i->GetNS()->Resolve("/myStudyManager");
SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
- MESSAGE("studyid = " << _studyId);
-
myStudy = NULL;
myStudy = aStudyMgr->GetStudyByID(_studyId);
- if (!myStudy->_is_nil())
- MESSAGE("myStudy->StudyId() = " << myStudy->StudyId());
_computeCanceled = false;
}
HYBRIDPlugin_HYBRID::~HYBRIDPlugin_HYBRID()
{
- MESSAGE("HYBRIDPlugin_HYBRID::~HYBRIDPlugin_HYBRID");
}
//=============================================================================
aStatus = SMESH_Hypothesis::HYP_OK;
_hyp = 0;
- //_viscousLayersHyp = 0;
_keepFiles = false;
_removeLogOnSuccess = true;
_logInStandardOutput = false;
{
if ( !_hyp )
_hyp = dynamic_cast< const HYBRIDPlugin_Hypothesis*> ( *h );
- // if ( !_viscousLayersHyp )
- // _viscousLayersHyp = dynamic_cast< const StdMeshers_ViscousLayers*> ( *h );
}
if ( _hyp )
{
TopoDS_Shape HYBRIDPlugin_HYBRID::entryToShape(std::string entry)
{
- MESSAGE("HYBRIDPlugin_HYBRID::entryToShape "<<entry );
if ( myStudy->_is_nil() )
throw SALOME_Exception("MG-HYBRID plugin can't work w/o publishing in the study");
GEOM::GEOM_Object_var aGeomObj;
return S;
}
-//=======================================================================
-//function : findShape
-//purpose :
-//=======================================================================
-
-// static TopoDS_Shape findShape(const SMDS_MeshNode *aNode[],
-// TopoDS_Shape aShape,
-// const TopoDS_Shape shape[],
-// double** box,
-// const int nShape,
-// TopAbs_State * state = 0)
-// {
-// gp_XYZ aPnt(0,0,0);
-// int j, iShape, nbNode = 4;
-
-// for ( j=0; j<nbNode; j++ ) {
-// gp_XYZ p ( aNode[j]->X(), aNode[j]->Y(), aNode[j]->Z() );
-// if ( aNode[j]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_3DSPACE ) {
-// aPnt = p;
-// break;
-// }
-// aPnt += p / nbNode;
-// }
-
-// BRepClass3d_SolidClassifier SC (aShape, aPnt, Precision::Confusion());
-// if (state) *state = SC.State();
-// if ( SC.State() != TopAbs_IN || aShape.IsNull() || aShape.ShapeType() != TopAbs_SOLID) {
-// for (iShape = 0; iShape < nShape; iShape++) {
-// aShape = shape[iShape];
-// if ( !( aPnt.X() < box[iShape][0] || box[iShape][1] < aPnt.X() ||
-// aPnt.Y() < box[iShape][2] || box[iShape][3] < aPnt.Y() ||
-// aPnt.Z() < box[iShape][4] || box[iShape][5] < aPnt.Z()) ) {
-// BRepClass3d_SolidClassifier SC (aShape, aPnt, Precision::Confusion());
-// if (state) *state = SC.State();
-// if (SC.State() == TopAbs_IN)
-// break;
-// }
-// }
-// }
-// return aShape;
-// }
-
-//=======================================================================
-//function : readMapIntLine
-//purpose :
-//=======================================================================
-
-// static char* readMapIntLine(char* ptr, int tab[]) {
-// long int intVal;
-// std::cout << std::endl;
-
-// for ( int i=0; i<17; i++ ) {
-// intVal = strtol(ptr, &ptr, 10);
-// if ( i < 3 )
-// tab[i] = intVal;
-// }
-// return ptr;
-// }
-
-//================================================================================
-/*!
- * \brief returns true if a triangle defined by the nodes is a temporary face on a
- * side facet of pyramid and defines sub-domain inside the pyramid
- */
-//================================================================================
-
-// static bool isTmpFace(const SMDS_MeshNode* node1,
-// const SMDS_MeshNode* node2,
-// const SMDS_MeshNode* node3)
-// {
-// // find a pyramid sharing the 3 nodes
-// //const SMDS_MeshElement* pyram = 0;
-// SMDS_ElemIteratorPtr vIt1 = node1->GetInverseElementIterator(SMDSAbs_Volume);
-// while ( vIt1->more() )
-// {
-// const SMDS_MeshElement* pyram = vIt1->next();
-// if ( pyram->NbCornerNodes() != 5 ) continue;
-// int i2, i3;
-// if ( (i2 = pyram->GetNodeIndex( node2 )) >= 0 &&
-// (i3 = pyram->GetNodeIndex( node3 )) >= 0 )
-// {
-// // Triangle defines sub-domian inside the pyramid if it's
-// // normal points out of the pyram
-
-// // make i2 and i3 hold indices of base nodes of the pyram while
-// // keeping the nodes order in the triangle
-// const int iApex = 4;
-// if ( i2 == iApex )
-// i2 = i3, i3 = pyram->GetNodeIndex( node1 );
-// else if ( i3 == iApex )
-// i3 = i2, i2 = pyram->GetNodeIndex( node1 );
-
-// int i3base = (i2+1) % 4; // next index after i2 within the pyramid base
-// return ( i3base != i3 );
-// }
-// }
-// return false;
-// }
-
-//=======================================================================
-//function : findShapeID
-//purpose : find the solid corresponding to HYBRID sub-domain following
-// the technique proposed in GHS3D manual (available within
-// ghs3d installation) in chapter "B.4 Subdomain (sub-region) assignment".
-// In brief: normal of the triangle defined by the given nodes
-// points out of the domain it is associated to
-//=======================================================================
-
-// static int findShapeID(SMESH_Mesh& mesh,
-// const SMDS_MeshNode* node1,
-// const SMDS_MeshNode* node2,
-// const SMDS_MeshNode* node3,
-// const bool toMeshHoles)
-// {
-// const int invalidID = 0;
-// SMESHDS_Mesh* meshDS = mesh.GetMeshDS();
-
-// // face the nodes belong to
-// std::vector<const SMDS_MeshNode *> nodes(3);
-// nodes[0] = node1;
-// nodes[1] = node2;
-// nodes[2] = node3;
-// const SMDS_MeshElement * face = meshDS->FindElement( nodes, SMDSAbs_Face, /*noMedium=*/true);
-// if ( !face )
-// return isTmpFace(node1, node2, node3) ? HOLE_ID : invalidID;
-// #ifdef _DEBUG_
-// std::cout << "bnd face " << face->GetID() << " - ";
-// #endif
-// // geom face the face assigned to
-// SMESH_MeshEditor editor(&mesh);
-// int geomFaceID = editor.FindShape( face );
-// if ( !geomFaceID )
-// return isTmpFace(node1, node2, node3) ? HOLE_ID : invalidID;
-// TopoDS_Shape shape = meshDS->IndexToShape( geomFaceID );
-// if ( shape.IsNull() || shape.ShapeType() != TopAbs_FACE )
-// return invalidID;
-// TopoDS_Face geomFace = TopoDS::Face( shape );
-
-// // solids bounded by geom face
-// TopTools_IndexedMapOfShape solids, shells;
-// TopTools_ListIteratorOfListOfShape ansIt = mesh.GetAncestors(geomFace);
-// for ( ; ansIt.More(); ansIt.Next() ) {
-// switch ( ansIt.Value().ShapeType() ) {
-// case TopAbs_SOLID:
-// solids.Add( ansIt.Value() ); break;
-// case TopAbs_SHELL:
-// shells.Add( ansIt.Value() ); break;
-// default:;
-// }
-// }
-// // analyse found solids
-// if ( solids.Extent() == 0 || shells.Extent() == 0)
-// return invalidID;
-
-// const TopoDS_Solid& solid1 = TopoDS::Solid( solids(1) );
-// if ( solids.Extent() == 1 )
-// {
-// if ( toMeshHoles )
-// return meshDS->ShapeToIndex( solid1 );
-
-// // - Are we at a hole boundary face?
-// if ( shells(1).IsSame( BRepClass3d::OuterShell( solid1 )) )
-// { // - No, but maybe a hole is bound by two shapes? Does shells(1) touches another shell?
-// bool touch = false;
-// TopExp_Explorer eExp( shells(1), TopAbs_EDGE );
-// // check if any edge of shells(1) belongs to another shell
-// for ( ; eExp.More() && !touch; eExp.Next() ) {
-// ansIt = mesh.GetAncestors( eExp.Current() );
-// for ( ; ansIt.More() && !touch; ansIt.Next() ) {
-// if ( ansIt.Value().ShapeType() == TopAbs_SHELL )
-// touch = ( !ansIt.Value().IsSame( shells(1) ));
-// }
-// }
-// if (!touch)
-// return meshDS->ShapeToIndex( solid1 );
-// }
-// }
-// // find orientation of geom face within the first solid
-// TopExp_Explorer fExp( solid1, TopAbs_FACE );
-// for ( ; fExp.More(); fExp.Next() )
-// if ( geomFace.IsSame( fExp.Current() )) {
-// geomFace = TopoDS::Face( fExp.Current() );
-// break;
-// }
-// if ( !fExp.More() )
-// return invalidID; // face not found
-
-// // normale to triangle
-// gp_Pnt node1Pnt ( node1->X(), node1->Y(), node1->Z() );
-// gp_Pnt node2Pnt ( node2->X(), node2->Y(), node2->Z() );
-// gp_Pnt node3Pnt ( node3->X(), node3->Y(), node3->Z() );
-// gp_Vec vec12( node1Pnt, node2Pnt );
-// gp_Vec vec13( node1Pnt, node3Pnt );
-// gp_Vec meshNormal = vec12 ^ vec13;
-// if ( meshNormal.SquareMagnitude() < DBL_MIN )
-// return invalidID;
-
-// // get normale to geomFace at any node
-// bool geomNormalOK = false;
-// gp_Vec geomNormal;
-// SMESH_MesherHelper helper( mesh ); helper.SetSubShape( geomFace );
-// for ( int i = 0; !geomNormalOK && i < 3; ++i )
-// {
-// // find UV of i-th node on geomFace
-// const SMDS_MeshNode* nNotOnSeamEdge = 0;
-// if ( helper.IsSeamShape( nodes[i]->getshapeId() )) {
-// if ( helper.IsSeamShape( nodes[(i+1)%3]->getshapeId() ))
-// nNotOnSeamEdge = nodes[(i+2)%3];
-// else
-// nNotOnSeamEdge = nodes[(i+1)%3];
-// }
-// bool uvOK;
-// gp_XY uv = helper.GetNodeUV( geomFace, nodes[i], nNotOnSeamEdge, &uvOK );
-// // check that uv is correct
-// if (uvOK) {
-// double tol = 1e-6;
-// TopoDS_Shape nodeShape = helper.GetSubShapeByNode( nodes[i], meshDS );
-// if ( !nodeShape.IsNull() )
-// switch ( nodeShape.ShapeType() )
-// {
-// case TopAbs_FACE: tol = BRep_Tool::Tolerance( TopoDS::Face( nodeShape )); break;
-// case TopAbs_EDGE: tol = BRep_Tool::Tolerance( TopoDS::Edge( nodeShape )); break;
-// case TopAbs_VERTEX: tol = BRep_Tool::Tolerance( TopoDS::Vertex( nodeShape )); break;
-// default:;
-// }
-// gp_Pnt nodePnt ( nodes[i]->X(), nodes[i]->Y(), nodes[i]->Z() );
-// BRepAdaptor_Surface surface( geomFace );
-// uvOK = ( nodePnt.Distance( surface.Value( uv.X(), uv.Y() )) < 2 * tol );
-// if ( uvOK ) {
-// // normale to geomFace at UV
-// gp_Vec du, dv;
-// surface.D1( uv.X(), uv.Y(), nodePnt, du, dv );
-// geomNormal = du ^ dv;
-// if ( geomFace.Orientation() == TopAbs_REVERSED )
-// geomNormal.Reverse();
-// geomNormalOK = ( geomNormal.SquareMagnitude() > DBL_MIN * 1e3 );
-// }
-// }
-// }
-// if ( !geomNormalOK)
-// return invalidID;
-
-// // compare normals
-// bool isReverse = ( meshNormal * geomNormal ) < 0;
-// if ( !isReverse )
-// return meshDS->ShapeToIndex( solid1 );
-
-// if ( solids.Extent() == 1 )
-// return HOLE_ID; // we are inside a hole
-
-// return meshDS->ShapeToIndex( solids(2) );
-// }
-
-
//=======================================================================
//function : addElemInMeshGroup
//purpose : Update or create groups in mesh
SMESHDS_Group* aGroupDS = static_cast<SMESHDS_Group*>( groupDS );
aGroupDS->SMDSGroup().Add(anElem);
groupDone = true;
-// MESSAGE("Successfully added enforced element to existing group " << groupName);
break;
}
}
aGroup->SetName( groupName.c_str() );
SMESHDS_Group* aGroupDS = static_cast<SMESHDS_Group*>( aGroup->GetGroupDS() );
aGroupDS->SMDSGroup().Add(anElem);
-// MESSAGE("Successfully created enforced vertex group " << groupName);
groupDone = true;
}
if (!groupDone)
std::string currentGroupName = (std::string)group->GetName();
if (groupDS->IsEmpty() && groupsToRemove.find(currentGroupName) != groupsToRemove.end()) {
// Previous group created by enforced elements
- MESSAGE("Delete previous group created by removed enforced elements: " << group->GetName())
theMesh->RemoveGroup(groupDS->GetID());
}
}
static void makeDomainGroups( std::vector< std::vector< const SMDS_MeshElement* > >& elemsOfDomain,
SMESH_MesherHelper* theHelper)
{
- // int nbDomains = 0;
- // for ( size_t i = 0; i < elemsOfDomain.size(); ++i )
- // nbDomains += ( elemsOfDomain[i].size() > 0 );
-
- // if ( nbDomains > 1 )
for ( size_t iDomain = 0; iDomain < elemsOfDomain.size(); ++iDomain )
{
std::vector< const SMDS_MeshElement* > & elems = elemsOfDomain[ iDomain ];
//purpose : read GMF file w/o geometry associated to mesh
//=======================================================================
-static bool readGMFFile(MG_HYBRID_API* MGOutput,
- const char* theFile,
- HYBRIDPlugin_HYBRID* theAlgo,
- SMESH_MesherHelper* theHelper,
+static bool readGMFFile(MG_HYBRID_API* MGOutput,
+ const char* theFile,
+ HYBRIDPlugin_HYBRID* theAlgo,
+ SMESH_MesherHelper* theHelper,
std::vector <const SMDS_MeshNode*> & theNodeByHybridId,
std::vector <const SMDS_MeshElement*> & theFaceByHybridId,
- std::map<const SMDS_MeshNode*,int> & theNodeToHybridIdMap,
- std::vector<std::string> & aNodeGroupByHybridId,
- std::vector<std::string> & anEdgeGroupByHybridId,
- std::vector<std::string> & aFaceGroupByHybridId,
- std::set<std::string> & groupsToRemove,
- bool toMakeGroupsOfDomains=false,
- bool toMeshHoles=true)
+ std::map<const SMDS_MeshNode*,int> & theNodeToHybridIdMap,
+ std::vector<std::string> & aNodeGroupByHybridId,
+ std::vector<std::string> & anEdgeGroupByHybridId,
+ std::vector<std::string> & aFaceGroupByHybridId,
+ std::set<std::string> & groupsToRemove,
+ bool toMakeGroupsOfDomains=false,
+ bool toMeshHoles=true)
{
std::string tmpStr;
SMESHDS_Mesh* theMeshDS = theHelper->GetMeshDS();
tabRef[GmfHexahedra] = 8;
int ver, dim;
- MESSAGE("Read " << theFile << " file");
int InpMsh = MGOutput->GmfOpenMesh(theFile, GmfRead, &ver, &dim);
if (!InpMsh)
return false;
- MESSAGE("Done ");
// Hybrid is not multi-domain => We can't (and don't need to) read ids of domains in ouput file like in GHS3DPlugin
// We just need to get the id of the one and only solid
MGOutput->GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3], &domainID[iElem]);
#ifdef _DEBUG_
subdomainId2tetraId[dummy].insert(iElem+1);
-// MESSAGE("subdomainId2tetraId["<<dummy<<"].insert("<<iElem+1<<")");
#endif
}
}
makeDomainGroups( elemsOfDomain, theHelper );
#ifdef _DEBUG_
- MESSAGE("Nb subdomains " << subdomainId2tetraId.size());
std::map<int, std::set<int> >::const_iterator subdomainIt = subdomainId2tetraId.begin();
- TCollection_AsciiString aSubdomainFileName = theFile;
+ std::string aSubdomainFileName = theFile;
aSubdomainFileName = aSubdomainFileName + ".subdomain";
- ofstream aSubdomainFile ( aSubdomainFileName.ToCString() , ios::out);
+ ofstream aSubdomainFile ( aSubdomainFileName , ios::out);
aSubdomainFile << "Nb subdomains " << subdomainId2tetraId.size() << std::endl;
for(;subdomainIt != subdomainId2tetraId.end() ; ++subdomainIt) {
int subdomainId = subdomainIt->first;
std::set<int> tetraIds = subdomainIt->second;
- MESSAGE("Subdomain #"<<subdomainId<<": "<<tetraIds.size()<<" tetrahedrons");
std::set<int>::const_iterator tetraIdsIt = tetraIds.begin();
aSubdomainFile << subdomainId << std::endl;
for(;tetraIdsIt != tetraIds.end() ; ++tetraIdsIt) {
std::map<std::vector<double>, std::string> & enfVerticesWithGroup,
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues & theEnforcedVertices)
{
- //MESSAGE("writeGMFFile w/o geometry");
- std::cout << "!!!!!!!!!!!writeGMFFile w/o geometry for HYBRIDPLUGIN..." << std::endl;
std::string tmpStr;
int idx, idxRequired = 0, idxSol = 0;
//tabg each dummyint
const int dummyint2 = 2;
const int dummyint3 = 3;
const int dummyint4 = 4;
- const int dummyint5 = 5;
- const int dummyint6 = 6; //are interesting for layers
+ const int enforcedTag = HYBRIDPlugin_Hypothesis::EnforcedTag();
+ //const int dummyint6 = 6; //are interesting for layers
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues::const_iterator vertexIt;
std::vector<double> enfVertexSizes;
const SMDS_MeshElement* elem;
continue;
}
-// gp_Pnt myPoint(node->X(),node->Y(),node->Z());
-// nbFoundElems = pntCls->FindElementsByPoint(myPoint, SMDSAbs_Node, foundElems);
-// if (nbFoundElems ==0) {
-// std::cout << " not found" << std::endl;
-// if ((*aNodeToTopAbs_StateMap.find(node)).second == TopAbs_IN) {
-// nodesCoords.insert(coords);
-// theOrderedNodes.push_back(node);
-// }
-// }
-// else {
-// std::cout << " found in initial mesh" << std::endl;
-// const SMDS_MeshNode* existingNode = (SMDS_MeshNode*) foundElems.at(0);
-// nodesCoords.insert(coords);
-// theOrderedNodes.push_back(existingNode);
-// }
-
#ifdef _DEBUG_
std::cout << " not found" << std::endl;
#endif
continue;
}
-// nbFoundElems = pntCls->FindElementsByPoint(myPoint, SMDSAbs_Node, foundElems);
-// if (nbFoundElems ==0) {
-// std::cout << " not found" << std::endl;
-// if (result == TopAbs_IN) {
-// nodesCoords.insert(coords);
-// theRequiredNodes.push_back(node);
-// }
-// }
-// else {
-// std::cout << " found in initial mesh" << std::endl;
-// const SMDS_MeshNode* existingNode = (SMDS_MeshNode*) foundElems.at(0);
-// // nodesCoords.insert(coords);
-// theRequiredNodes.push_back(existingNode);
-// }
-//
-//
-//
-// if (pntCls->FindElementsByPoint(myPoint, SMDSAbs_Node, foundElems) == 0)
-// continue;
-
-// if ( result != TopAbs_IN )
-// continue;
-
#ifdef _DEBUG_
std::cout << " not found" << std::endl;
#endif
int solSize = 0;
std::vector<std::vector<double> > ReqVerTab;
if (nbEnforcedVertices) {
-// ReqVerTab.clear();
(nbEnforcedVertices <= 1) ? tmpStr = " node" : " nodes";
std::cout << nbEnforcedVertices << tmpStr << " from enforced vertices ..." << std::endl;
// Iterate over the enforced vertices
TopAbs_State result = pntCls->GetPointState( myPoint );
if ( result == TopAbs_OUT )
continue;
- //if (pntCls->FindElementsByPoint(myPoint, SMDSAbs_Node, foundElems) == 0)
- //continue;
-
-// if ( result != TopAbs_IN )
-// continue;
std::vector<double> coords;
coords.push_back(x);
coords.push_back(y);
// GmfVertices
std::cout << "Begin writing required nodes in GmfVertices" << std::endl;
std::cout << "Nb vertices: " << theOrderedNodes.size() << std::endl;
- MGInput->GmfSetKwd(idx, GmfVertices, theOrderedNodes.size()); //theOrderedNodes.size()+solSize)
+ MGInput->GmfSetKwd(idx, GmfVertices, theOrderedNodes.size());
for (hybridNodeIt = theOrderedNodes.begin();hybridNodeIt != theOrderedNodes.end();++hybridNodeIt) {
MGInput->GmfSetLin(idx, GmfVertices, (*hybridNodeIt)->X(), (*hybridNodeIt)->Y(), (*hybridNodeIt)->Z(), dummyint1);
}
double ValTab[] = {0.0};
MGInput->GmfSetKwd(idxRequired, GmfVertices, requiredNodes + solSize);
MGInput->GmfSetKwd(idxSol, GmfSolAtVertices, requiredNodes + solSize, 1, TypTab);
-// int usedEnforcedNodes = 0;
-// std::string gn = "";
for (hybridNodeIt = theRequiredNodes.begin();hybridNodeIt != theRequiredNodes.end();++hybridNodeIt) {
MGInput->GmfSetLin(idxRequired, GmfVertices, (*hybridNodeIt)->X(), (*hybridNodeIt)->Y(), (*hybridNodeIt)->Z(), dummyint2);
MGInput->GmfSetLin(idxSol, GmfSolAtVertices, ValTab);
int usedEnforcedEdges = 0;
if (theKeptEnforcedEdges.size()) {
anEdgeGroupByHybridId.resize( theKeptEnforcedEdges.size() );
-// idxRequired = MGInput->GmfOpenMesh(theRequiredFileName, GmfWrite, GMFVERSION, GMFDIMENSION);
-// if (!idxRequired)
-// return false;
MGInput->GmfSetKwd(idx, GmfEdges, theKeptEnforcedEdges.size());
-// MGInput->GmfSetKwd(idxRequired, GmfEdges, theKeptEnforcedEdges.size());
for(elemSetIt = theKeptEnforcedEdges.begin() ; elemSetIt != theKeptEnforcedEdges.end() ; ++elemSetIt) {
elem = (*elemSetIt);
nodeIt = elem->nodesIterator();
}
MGInput->GmfSetLin(idx, GmfEdges, nedge[0], nedge[1], dummyint4);
anEdgeGroupByHybridId[usedEnforcedEdges] = theEnforcedEdges.find(elem)->second;
-// MGInput->GmfSetLin(idxRequired, GmfEdges, nedge[0], nedge[1], dummyint);
usedEnforcedEdges++;
}
-// MGInput->GmfCloseMesh(idxRequired);
}
// GmfTriangles
int usedEnforcedTriangles = 0;
- if (anElemSetTri.size()+theKeptEnforcedTriangles.size()) {
+ if (anElemSetTri.size()+theKeptEnforcedTriangles.size())
+ {
aFaceGroupByHybridId.resize( anElemSetTri.size()+theKeptEnforcedTriangles.size() );
MGInput->GmfSetKwd(idx, GmfTriangles, anElemSetTri.size()+theKeptEnforcedTriangles.size());
int k=0;
- for(elemSetIt = anElemSetTri.begin() ; elemSetIt != anElemSetTri.end() ; ++elemSetIt,++k) {
+ for(elemSetIt = anElemSetTri.begin() ; elemSetIt != anElemSetTri.end() ; ++elemSetIt,++k)
+ {
elem = (*elemSetIt);
theFaceByHybridId.push_back( elem );
nodeIt = elem->nodesIterator();
int index=0;
- for ( int j = 0; j < 3; ++j ) {
+ for ( int j = 0; j < 3; ++j )
+ {
// find HYBRID ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
std::map< const SMDS_MeshNode*,int >::iterator it = aNodeToHybridIdMap.find(node);
ntri[index] = it->second;
index++;
}
- MGInput->GmfSetLin(idx, GmfTriangles, ntri[0], ntri[1], ntri[2], dummyint5);
+ MGInput->GmfSetLin(idx, GmfTriangles, ntri[0], ntri[1], ntri[2], /*tag=*/elem->getshapeId() );
aFaceGroupByHybridId[k] = "";
}
if ( !theHelper.GetMesh()->HasShapeToMesh() ) SMESHUtils::FreeVector( theFaceByHybridId );
std::cout << "Enforced triangles size " << theKeptEnforcedTriangles.size() << std::endl;
- if (theKeptEnforcedTriangles.size()) {
- for(elemSetIt = theKeptEnforcedTriangles.begin() ; elemSetIt != theKeptEnforcedTriangles.end() ; ++elemSetIt,++k) {
+ if (theKeptEnforcedTriangles.size())
+ {
+ for(elemSetIt = theKeptEnforcedTriangles.begin() ; elemSetIt != theKeptEnforcedTriangles.end() ; ++elemSetIt,++k)
+ {
elem = (*elemSetIt);
nodeIt = elem->nodesIterator();
int index=0;
- for ( int j = 0; j < 3; ++j ) {
+ for ( int j = 0; j < 3; ++j )
+ {
// find HYBRID ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
std::map< const SMDS_MeshNode*,int >::iterator it = anEnforcedNodeToHybridIdMap.find(node);
- if (it == anEnforcedNodeToHybridIdMap.end()) {
+ if (it == anEnforcedNodeToHybridIdMap.end())
+ {
it = anExistingEnforcedNodeToHybridIdMap.find(node);
if (it == anEnforcedNodeToHybridIdMap.end())
throw "Node not found";
ntri[index] = it->second;
index++;
}
- MGInput->GmfSetLin(idx, GmfTriangles, ntri[0], ntri[1], ntri[2], dummyint6);
+ MGInput->GmfSetLin(idx, GmfTriangles, ntri[0], ntri[1], ntri[2], enforcedTag);
aFaceGroupByHybridId[k] = theEnforcedTriangles.find(elem)->second;
usedEnforcedTriangles++;
}
}
- if (usedEnforcedTriangles) {
+ if (usedEnforcedTriangles)
+ {
MGInput->GmfSetKwd(idx, GmfRequiredTriangles, usedEnforcedTriangles);
for (int enfID=1;enfID<=usedEnforcedTriangles;enfID++)
MGInput->GmfSetLin(idx, GmfRequiredTriangles, anElemSetTri.size()+enfID);
}
- if (anElemSetQuad.size()) {
+ if (anElemSetQuad.size())
+ {
MGInput->GmfSetKwd(idx, GmfQuadrilaterals, anElemSetQuad.size());
int k=0;
- for(elemSetIt = anElemSetQuad.begin() ; elemSetIt != anElemSetQuad.end() ; ++elemSetIt,++k) {
+ for(elemSetIt = anElemSetQuad.begin() ; elemSetIt != anElemSetQuad.end() ; ++elemSetIt,++k)
+ {
elem = (*elemSetIt);
theFaceByHybridId.push_back( elem );
nodeIt = elem->nodesIterator();
int index=0;
- for ( int j = 0; j < 4; ++j ) {
+ for ( int j = 0; j < 4; ++j )
+ {
// find HYBRID ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
std::map< const SMDS_MeshNode*,int >::iterator it = aNodeToHybridIdMap.find(node);
nquad[index] = it->second;
index++;
}
- MGInput->GmfSetLin(idx, GmfQuadrilaterals, nquad[0], nquad[1], nquad[2], nquad[3], dummyint5);
+ MGInput->GmfSetLin(idx, GmfQuadrilaterals, nquad[0], nquad[1], nquad[2], nquad[3],
+ /*tag=*/elem->getshapeId() );
// _CEA_cbo what is it for???
//aFaceGroupByHybridId[k] = "";
}
}
-// static bool writeGMFFile(const char* theMeshFileName,
-// const char* theRequiredFileName,
-// const char* theSolFileName,
-// SMESH_MesherHelper& theHelper,
-// const SMESH_ProxyMesh& theProxyMesh,
-// std::map <int,int> & theNodeId2NodeIndexMap,
-// std::map <int,int> & theSmdsToHybridIdMap,
-// std::map <int,const SMDS_MeshNode*> & theHybridIdToNodeMap,
-// TIDSortedNodeSet & theEnforcedNodes,
-// TIDSortedElemSet & theEnforcedEdges,
-// TIDSortedElemSet & theEnforcedTriangles,
-// // TIDSortedElemSet & theEnforcedQuadrangles,
-// HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues & theEnforcedVertices)
-// {
-// MESSAGE("writeGMFFile with geometry");
-// int idx, idxRequired, idxSol;
-// int nbv, nbev, nben, aHybridID = 0;
-// const int dummyint = 0;
-// HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues::const_iterator vertexIt;
-// std::vector<double> enfVertexSizes;
-// TIDSortedNodeSet::const_iterator enfNodeIt;
-// const SMDS_MeshNode* node;
-// SMDS_NodeIteratorPtr nodeIt;
-//
-// idx = GmfOpenMesh(theMeshFileName, GmfWrite, GMFVERSION, GMFDIMENSION);
-// if (!idx)
-// return false;
-//
-// SMESHDS_Mesh * theMeshDS = theHelper.GetMeshDS();
-//
-// /* ========================== NODES ========================== */
-// // NB_NODES
-// nbv = theMeshDS->NbNodes();
-// if ( nbv == 0 )
-// return false;
-// nbev = theEnforcedVertices.size();
-// nben = theEnforcedNodes.size();
-//
-// // Issue 020674: EDF 870 SMESH: Mesh generated by Netgen not usable by HYBRID
-// // The problem is in nodes on degenerated edges, we need to skip nodes which are free
-// // and replace not-free nodes on edges by the node on vertex
-// TNodeNodeMap n2nDegen; // map a node on degenerated edge to a node on vertex
-// TNodeNodeMap::iterator n2nDegenIt;
-// if ( theHelper.HasDegeneratedEdges() )
-// {
-// set<int> checkedSM;
-// for (TopExp_Explorer e(theMeshDS->ShapeToMesh(), TopAbs_EDGE ); e.More(); e.Next())
-// {
-// SMESH_subMesh* sm = theHelper.GetMesh()->GetSubMesh( e.Current() );
-// if ( checkedSM.insert( sm->GetId() ).second && theHelper.IsDegenShape(sm->GetId() ))
-// {
-// if ( SMESHDS_SubMesh* smDS = sm->GetSubMeshDS() )
-// {
-// TopoDS_Shape vertex = TopoDS_Iterator( e.Current() ).Value();
-// const SMDS_MeshNode* vNode = SMESH_Algo::VertexNode( TopoDS::Vertex( vertex ), theMeshDS);
-// {
-// SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
-// while ( nIt->more() )
-// n2nDegen.insert( std::make_pair( nIt->next(), vNode ));
-// }
-// }
-// }
-// }
-// }
-//
-// const bool isQuadMesh =
-// theHelper.GetMesh()->NbEdges( ORDER_QUADRATIC ) ||
-// theHelper.GetMesh()->NbFaces( ORDER_QUADRATIC ) ||
-// theHelper.GetMesh()->NbVolumes( ORDER_QUADRATIC );
-//
-// std::vector<std::vector<double> > VerTab;
-// std::set<std::vector<double> > VerMap;
-// VerTab.clear();
-// std::vector<double> aVerTab;
-// // Loop from 1 to NB_NODES
-//
-// nodeIt = theMeshDS->nodesIterator();
-//
-// while ( nodeIt->more() )
-// {
-// node = nodeIt->next();
-// if ( isQuadMesh && theHelper.IsMedium( node )) // Issue 0021238
-// continue;
-// if ( n2nDegen.count( node ) ) // Issue 0020674
-// continue;
-//
-// std::vector<double> coords;
-// coords.push_back(node->X());
-// coords.push_back(node->Y());
-// coords.push_back(node->Z());
-// if (VerMap.find(coords) != VerMap.end()) {
-// aHybridID = theSmdsToHybridIdMap[node->GetID()];
-// theHybridIdToNodeMap[theSmdsToHybridIdMap[node->GetID()]] = node;
-// continue;
-// }
-// VerTab.push_back(coords);
-// VerMap.insert(coords);
-// aHybridID++;
-// theSmdsToHybridIdMap.insert( std::make_pair( node->GetID(), aHybridID ));
-// theHybridIdToNodeMap.insert( std::make_pair( aHybridID, node ));
-// }
-//
-//
-// /* ENFORCED NODES ========================== */
-// if (nben) {
-// std::cout << "Add " << nben << " enforced nodes to input .mesh file" << std::endl;
-// for(enfNodeIt = theEnforcedNodes.begin() ; enfNodeIt != theEnforcedNodes.end() ; ++enfNodeIt) {
-// double x = (*enfNodeIt)->X();
-// double y = (*enfNodeIt)->Y();
-// double z = (*enfNodeIt)->Z();
-// // Test if point is inside shape to mesh
-// gp_Pnt myPoint(x,y,z);
-// BRepClass3d_SolidClassifier scl(theMeshDS->ShapeToMesh());
-// scl.Perform(myPoint, 1e-7);
-// TopAbs_State result = scl.State();
-// if ( result != TopAbs_IN )
-// continue;
-// std::vector<double> coords;
-// coords.push_back(x);
-// coords.push_back(y);
-// coords.push_back(z);
-// if (theEnforcedVertices.find(coords) != theEnforcedVertices.end())
-// continue;
-// if (VerMap.find(coords) != VerMap.end())
-// continue;
-// VerTab.push_back(coords);
-// VerMap.insert(coords);
-// aHybridID++;
-// theNodeId2NodeIndexMap.insert( std::make_pair( (*enfNodeIt)->GetID(), aHybridID ));
-// }
-// }
-//
-//
-// /* ENFORCED VERTICES ========================== */
-// int solSize = 0;
-// std::vector<std::vector<double> > ReqVerTab;
-// ReqVerTab.clear();
-// if (nbev) {
-// std::cout << "Add " << nbev << " enforced vertices to input .mesh file" << std::endl;
-// for(vertexIt = theEnforcedVertices.begin() ; vertexIt != theEnforcedVertices.end() ; ++vertexIt) {
-// double x = vertexIt->first[0];
-// double y = vertexIt->first[1];
-// double z = vertexIt->first[2];
-// // Test if point is inside shape to mesh
-// gp_Pnt myPoint(x,y,z);
-// BRepClass3d_SolidClassifier scl(theMeshDS->ShapeToMesh());
-// scl.Perform(myPoint, 1e-7);
-// TopAbs_State result = scl.State();
-// if ( result != TopAbs_IN )
-// continue;
-// enfVertexSizes.push_back(vertexIt->second);
-// std::vector<double> coords;
-// coords.push_back(x);
-// coords.push_back(y);
-// coords.push_back(z);
-// if (VerMap.find(coords) != VerMap.end())
-// continue;
-// ReqVerTab.push_back(coords);
-// VerMap.insert(coords);
-// solSize++;
-// }
-// }
-//
-//
-// /* ========================== FACES ========================== */
-//
-// int nbTriangles = 0/*, nbQuadrangles = 0*/, aSmdsID;
-// TopTools_IndexedMapOfShape facesMap, trianglesMap/*, quadranglesMap*/;
-// TIDSortedElemSet::const_iterator elemIt;
-// const SMESHDS_SubMesh* theSubMesh;
-// TopoDS_Shape aShape;
-// SMDS_ElemIteratorPtr itOnSubMesh, itOnSubFace;
-// const SMDS_MeshElement* aFace;
-// map<int,int>::const_iterator itOnMap;
-// std::vector<std::vector<int> > tt, qt,et;
-// tt.clear();
-// qt.clear();
-// et.clear();
-// std::vector<int> att, aqt, aet;
-//
-// TopExp::MapShapes( theMeshDS->ShapeToMesh(), TopAbs_FACE, facesMap );
-//
-// for ( int i = 1; i <= facesMap.Extent(); ++i )
-// if (( theSubMesh = theProxyMesh.GetSubMesh( facesMap(i))))
-// {
-// SMDS_ElemIteratorPtr it = theSubMesh->GetElements();
-// while (it->more())
-// {
-// const SMDS_MeshElement *elem = it->next();
-// int nbCornerNodes = elem->NbCornerNodes();
-// if (nbCornerNodes == 3)
-// {
-// trianglesMap.Add(facesMap(i));
-// nbTriangles ++;
-// }
-// // else if (nbCornerNodes == 4)
-// // {
-// // quadranglesMap.Add(facesMap(i));
-// // nbQuadrangles ++;
-// // }
-// }
-// }
-//
-// /* TRIANGLES ========================== */
-// if (nbTriangles) {
-// for ( int i = 1; i <= trianglesMap.Extent(); i++ )
-// {
-// aShape = trianglesMap(i);
-// theSubMesh = theProxyMesh.GetSubMesh(aShape);
-// if ( !theSubMesh ) continue;
-// itOnSubMesh = theSubMesh->GetElements();
-// while ( itOnSubMesh->more() )
-// {
-// aFace = itOnSubMesh->next();
-// itOnSubFace = aFace->nodesIterator();
-// att.clear();
-// for ( int j = 0; j < 3; ++j ) {
-// // find HYBRID ID
-// node = castToNode( itOnSubFace->next() );
-// if (( n2nDegenIt = n2nDegen.find( node )) != n2nDegen.end() )
-// node = n2nDegenIt->second;
-// aSmdsID = node->GetID();
-// itOnMap = theSmdsToHybridIdMap.find( aSmdsID );
-// ASSERT( itOnMap != theSmdsToHybridIdMap.end() );
-// att.push_back((*itOnMap).second);
-// }
-// tt.push_back(att);
-// }
-// }
-// }
-//
-// if (theEnforcedTriangles.size()) {
-// std::cout << "Add " << theEnforcedTriangles.size() << " enforced triangles to input .mesh file" << std::endl;
-// // Iterate over the enforced triangles
-// for(elemIt = theEnforcedTriangles.begin() ; elemIt != theEnforcedTriangles.end() ; ++elemIt) {
-// aFace = (*elemIt);
-// itOnSubFace = aFace->nodesIterator();
-// bool isOK = true;
-// att.clear();
-//
-// for ( int j = 0; j < 3; ++j ) {
-// node = castToNode( itOnSubFace->next() );
-// if (( n2nDegenIt = n2nDegen.find( node )) != n2nDegen.end() )
-// node = n2nDegenIt->second;
-// // std::cout << node;
-// double x = node->X();
-// double y = node->Y();
-// double z = node->Z();
-// // Test if point is inside shape to mesh
-// gp_Pnt myPoint(x,y,z);
-// BRepClass3d_SolidClassifier scl(theMeshDS->ShapeToMesh());
-// scl.Perform(myPoint, 1e-7);
-// TopAbs_State result = scl.State();
-// if ( result != TopAbs_IN ) {
-// isOK = false;
-// theEnforcedTriangles.erase(elemIt);
-// continue;
-// }
-// std::vector<double> coords;
-// coords.push_back(x);
-// coords.push_back(y);
-// coords.push_back(z);
-// if (VerMap.find(coords) != VerMap.end()) {
-// att.push_back(theNodeId2NodeIndexMap[node->GetID()]);
-// continue;
-// }
-// VerTab.push_back(coords);
-// VerMap.insert(coords);
-// aHybridID++;
-// theNodeId2NodeIndexMap.insert( std::make_pair( node->GetID(), aHybridID ));
-// att.push_back(aHybridID);
-// }
-// if (isOK)
-// tt.push_back(att);
-// }
-// }
-//
-//
-// /* ========================== EDGES ========================== */
-//
-// if (theEnforcedEdges.size()) {
-// // Iterate over the enforced edges
-// std::cout << "Add " << theEnforcedEdges.size() << " enforced edges to input .mesh file" << std::endl;
-// for(elemIt = theEnforcedEdges.begin() ; elemIt != theEnforcedEdges.end() ; ++elemIt) {
-// aFace = (*elemIt);
-// bool isOK = true;
-// itOnSubFace = aFace->nodesIterator();
-// aet.clear();
-// for ( int j = 0; j < 2; ++j ) {
-// node = castToNode( itOnSubFace->next() );
-// if (( n2nDegenIt = n2nDegen.find( node )) != n2nDegen.end() )
-// node = n2nDegenIt->second;
-// double x = node->X();
-// double y = node->Y();
-// double z = node->Z();
-// // Test if point is inside shape to mesh
-// gp_Pnt myPoint(x,y,z);
-// BRepClass3d_SolidClassifier scl(theMeshDS->ShapeToMesh());
-// scl.Perform(myPoint, 1e-7);
-// TopAbs_State result = scl.State();
-// if ( result != TopAbs_IN ) {
-// isOK = false;
-// theEnforcedEdges.erase(elemIt);
-// continue;
-// }
-// std::vector<double> coords;
-// coords.push_back(x);
-// coords.push_back(y);
-// coords.push_back(z);
-// if (VerMap.find(coords) != VerMap.end()) {
-// aet.push_back(theNodeId2NodeIndexMap[node->GetID()]);
-// continue;
-// }
-// VerTab.push_back(coords);
-// VerMap.insert(coords);
-//
-// aHybridID++;
-// theNodeId2NodeIndexMap.insert( std::make_pair( node->GetID(), aHybridID ));
-// aet.push_back(aHybridID);
-// }
-// if (isOK)
-// et.push_back(aet);
-// }
-// }
-//
-//
-// /* Write vertices number */
-// MESSAGE("Number of vertices: "<<aHybridID);
-// MESSAGE("Size of vector: "<<VerTab.size());
-// GmfSetKwd(idx, GmfVertices, aHybridID/*+solSize*/);
-// for (int i=0;i<aHybridID;i++)
-// GmfSetLin(idx, GmfVertices, VerTab[i][0], VerTab[i][1], VerTab[i][2], dummyint);
-// // for (int i=0;i<solSize;i++) {
-// // std::cout << ReqVerTab[i][0] <<" "<< ReqVerTab[i][1] << " "<< ReqVerTab[i][2] << std::endl;
-// // GmfSetLin(idx, GmfVertices, ReqVerTab[i][0], ReqVerTab[i][1], ReqVerTab[i][2], dummyint);
-// // }
-//
-// if (solSize) {
-// idxRequired = GmfOpenMesh(theRequiredFileName, GmfWrite, GMFVERSION, GMFDIMENSION);
-// if (!idxRequired) {
-// GmfCloseMesh(idx);
-// return false;
-// }
-// idxSol = GmfOpenMesh(theSolFileName, GmfWrite, GMFVERSION, GMFDIMENSION);
-// if (!idxSol){
-// GmfCloseMesh(idx);
-// if (idxRequired)
-// GmfCloseMesh(idxRequired);
-// return false;
-// }
-//
-// int TypTab[] = {GmfSca};
-// GmfSetKwd(idxRequired, GmfVertices, solSize);
-// GmfSetKwd(idxSol, GmfSolAtVertices, solSize, 1, TypTab);
-//
-// for (int i=0;i<solSize;i++) {
-// double solTab[] = {enfVertexSizes.at(i)};
-// GmfSetLin(idxRequired, GmfVertices, ReqVerTab[i][0], ReqVerTab[i][1], ReqVerTab[i][2], dummyint);
-// GmfSetLin(idxSol, GmfSolAtVertices, solTab);
-// }
-// GmfCloseMesh(idxRequired);
-// GmfCloseMesh(idxSol);
-// }
-//
-// /* Write triangles number */
-// if (tt.size()) {
-// GmfSetKwd(idx, GmfTriangles, tt.size());
-// for (int i=0;i<tt.size();i++)
-// GmfSetLin(idx, GmfTriangles, tt[i][0], tt[i][1], tt[i][2], dummyint);
-// }
-//
-// /* Write edges number */
-// if (et.size()) {
-// GmfSetKwd(idx, GmfEdges, et.size());
-// for (int i=0;i<et.size();i++)
-// GmfSetLin(idx, GmfEdges, et[i][0], et[i][1], dummyint);
-// }
-//
-// /* QUADRANGLES ========================== */
-// // TODO: add pyramids ?
-// // if (nbQuadrangles) {
-// // for ( int i = 1; i <= quadranglesMap.Extent(); i++ )
-// // {
-// // aShape = quadranglesMap(i);
-// // theSubMesh = theProxyMesh.GetSubMesh(aShape);
-// // if ( !theSubMesh ) continue;
-// // itOnSubMesh = theSubMesh->GetElements();
-// // for ( int j = 0; j < 4; ++j )
-// // {
-// // aFace = itOnSubMesh->next();
-// // itOnSubFace = aFace->nodesIterator();
-// // aqt.clear();
-// // while ( itOnSubFace->more() ) {
-// // // find HYBRID ID
-// // aSmdsID = itOnSubFace->next()->GetID();
-// // itOnMap = theSmdsToHybridIdMap.find( aSmdsID );
-// // ASSERT( itOnMap != theSmdsToHybridIdMap.end() );
-// // aqt.push_back((*itOnMap).second);
-// // }
-// // qt.push_back(aqt);
-// // }
-// // }
-// // }
-// //
-// // if (theEnforcedQuadrangles.size()) {
-// // // Iterate over the enforced triangles
-// // for(elemIt = theEnforcedQuadrangles.begin() ; elemIt != theEnforcedQuadrangles.end() ; ++elemIt) {
-// // aFace = (*elemIt);
-// // bool isOK = true;
-// // itOnSubFace = aFace->nodesIterator();
-// // aqt.clear();
-// // for ( int j = 0; j < 4; ++j ) {
-// // int aNodeID = itOnSubFace->next()->GetID();
-// // itOnMap = theNodeId2NodeIndexMap.find(aNodeID);
-// // if (itOnMap != theNodeId2NodeIndexMap.end())
-// // aqt.push_back((*itOnMap).second);
-// // else {
-// // isOK = false;
-// // theEnforcedQuadrangles.erase(elemIt);
-// // break;
-// // }
-// // }
-// // if (isOK)
-// // qt.push_back(aqt);
-// // }
-// // }
-// //
-//
-// // /* Write quadrilaterals number */
-// // if (qt.size()) {
-// // GmfSetKwd(idx, GmfQuadrilaterals, qt.size());
-// // for (int i=0;i<qt.size();i++)
-// // GmfSetLin(idx, GmfQuadrilaterals, qt[i][0], qt[i][1], qt[i][2], qt[i][3], dummyint);
-// // }
-//
-// GmfCloseMesh(idx);
-// return true;
-// }
-
-
-//=======================================================================
-//function : writeFaces
-//purpose :
-//=======================================================================
-
-// static bool writeFaces (ofstream & theFile,
-// const SMESH_ProxyMesh& theMesh,
-// const TopoDS_Shape& theShape,
-// const std::map <int,int> & theSmdsToHybridIdMap,
-// const std::map <int,int> & theEnforcedNodeIdToHybridIdMap,
-// HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedEdges,
-// HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedTriangles)
-// {
-// // record structure:
-// //
-// // NB_ELEMS DUMMY_INT
-// // Loop from 1 to NB_ELEMS
-// // NB_NODES NODE_NB_1 NODE_NB_2 ... (NB_NODES + 1) times: DUMMY_INT
-
-// TopoDS_Shape aShape;
-// const SMESHDS_SubMesh* theSubMesh;
-// const SMDS_MeshElement* aFace;
-// const char* space = " ";
-// const int dummyint = 0;
-// std::map<int,int>::const_iterator itOnMap;
-// SMDS_ElemIteratorPtr itOnSubMesh, itOnSubFace;
-// int nbNodes, aSmdsID;
-
-// TIDSortedElemSet::const_iterator elemIt;
-// int nbEnforcedEdges = theEnforcedEdges.size();
-// int nbEnforcedTriangles = theEnforcedTriangles.size();
-
-// // count triangles bound to geometry
-// int nbTriangles = 0;
-
-// TopTools_IndexedMapOfShape facesMap, trianglesMap;
-// TopExp::MapShapes( theShape, TopAbs_FACE, facesMap );
-
-// int nbFaces = facesMap.Extent();
-
-// for ( int i = 1; i <= nbFaces; ++i )
-// if (( theSubMesh = theMesh.GetSubMesh( facesMap(i))))
-// nbTriangles += theSubMesh->NbElements();
-// std::string tmpStr;
-// (nbFaces == 0 || nbFaces == 1) ? tmpStr = " shape " : tmpStr = " shapes " ;
-// std::cout << " " << nbFaces << tmpStr << "of 2D dimension";
-// int nbEnforcedElements = nbEnforcedEdges+nbEnforcedTriangles;
-// if (nbEnforcedElements > 0) {
-// (nbEnforcedElements == 1) ? tmpStr = "shape:" : tmpStr = "shapes:";
-// std::cout << " and" << std::endl;
-// std::cout << " " << nbEnforcedElements
-// << " enforced " << tmpStr << std::endl;
-// }
-// else
-// std::cout << std::endl;
-// if (nbEnforcedEdges) {
-// (nbEnforcedEdges == 1) ? tmpStr = "edge" : tmpStr = "edges";
-// std::cout << " " << nbEnforcedEdges << " enforced " << tmpStr << std::endl;
-// }
-// if (nbEnforcedTriangles) {
-// (nbEnforcedTriangles == 1) ? tmpStr = "triangle" : tmpStr = "triangles";
-// std::cout << " " << nbEnforcedTriangles << " enforced " << tmpStr << std::endl;
-// }
-// std::cout << std::endl;
-
-// // theFile << space << nbTriangles << space << dummyint << std::endl;
-// std::ostringstream globalStream, localStream, aStream;
-
-// for ( int i = 1; i <= facesMap.Extent(); i++ )
-// {
-// aShape = facesMap(i);
-// theSubMesh = theMesh.GetSubMesh(aShape);
-// if ( !theSubMesh ) continue;
-// itOnSubMesh = theSubMesh->GetElements();
-// while ( itOnSubMesh->more() )
-// {
-// aFace = itOnSubMesh->next();
-// nbNodes = aFace->NbCornerNodes();
-
-// localStream << nbNodes << space;
-
-// itOnSubFace = aFace->nodesIterator();
-// for ( int j = 0; j < 3; ++j ) {
-// // find HYBRID ID
-// aSmdsID = itOnSubFace->next()->GetID();
-// itOnMap = theSmdsToHybridIdMap.find( aSmdsID );
-// // if ( itOnMap == theSmdsToHybridIdMap.end() ) {
-// // cout << "not found node: " << aSmdsID << endl;
-// // return false;
-// // }
-// ASSERT( itOnMap != theSmdsToHybridIdMap.end() );
-
-// localStream << (*itOnMap).second << space ;
-// }
-
-// // (NB_NODES + 1) times: DUMMY_INT
-// for ( int j=0; j<=nbNodes; j++)
-// localStream << dummyint << space ;
-
-// localStream << std::endl;
-// }
-// }
-
-// globalStream << localStream.str();
-// localStream.str("");
-
-// //
-// // FACES : END
-// //
-
-// // //
-// // // ENFORCED EDGES : BEGIN
-// // //
-// //
-// // // Iterate over the enforced edges
-// // int usedEnforcedEdges = 0;
-// // bool isOK;
-// // for(elemIt = theEnforcedEdges.begin() ; elemIt != theEnforcedEdges.end() ; ++elemIt) {
-// // aFace = (*elemIt);
-// // isOK = true;
-// // itOnSubFace = aFace->nodesIterator();
-// // aStream.str("");
-// // aStream << "2" << space ;
-// // for ( int j = 0; j < 2; ++j ) {
-// // aSmdsID = itOnSubFace->next()->GetID();
-// // itOnMap = theEnforcedNodeIdToHybridIdMap.find(aSmdsID);
-// // if (itOnMap != theEnforcedNodeIdToHybridIdMap.end())
-// // aStream << (*itOnMap).second << space;
-// // else {
-// // isOK = false;
-// // break;
-// // }
-// // }
-// // if (isOK) {
-// // for ( int j=0; j<=2; j++)
-// // aStream << dummyint << space ;
-// // // aStream << dummyint << space << dummyint;
-// // localStream << aStream.str() << std::endl;
-// // usedEnforcedEdges++;
-// // }
-// // }
-// //
-// // if (usedEnforcedEdges) {
-// // globalStream << localStream.str();
-// // localStream.str("");
-// // }
-// //
-// // //
-// // // ENFORCED EDGES : END
-// // //
-// // //
-// //
-// // //
-// // // ENFORCED TRIANGLES : BEGIN
-// // //
-// // // Iterate over the enforced triangles
-// // int usedEnforcedTriangles = 0;
-// // for(elemIt = theEnforcedTriangles.begin() ; elemIt != theEnforcedTriangles.end() ; ++elemIt) {
-// // aFace = (*elemIt);
-// // nbNodes = aFace->NbCornerNodes();
-// // isOK = true;
-// // itOnSubFace = aFace->nodesIterator();
-// // aStream.str("");
-// // aStream << nbNodes << space ;
-// // for ( int j = 0; j < 3; ++j ) {
-// // aSmdsID = itOnSubFace->next()->GetID();
-// // itOnMap = theEnforcedNodeIdToHybridIdMap.find(aSmdsID);
-// // if (itOnMap != theEnforcedNodeIdToHybridIdMap.end())
-// // aStream << (*itOnMap).second << space;
-// // else {
-// // isOK = false;
-// // break;
-// // }
-// // }
-// // if (isOK) {
-// // for ( int j=0; j<=3; j++)
-// // aStream << dummyint << space ;
-// // localStream << aStream.str() << std::endl;
-// // usedEnforcedTriangles++;
-// // }
-// // }
-// //
-// // if (usedEnforcedTriangles) {
-// // globalStream << localStream.str();
-// // localStream.str("");
-// // }
-// //
-// // //
-// // // ENFORCED TRIANGLES : END
-// // //
-
-// theFile
-// << nbTriangles/*+usedEnforcedTriangles+usedEnforcedEdges*/
-// << " 0" << std::endl
-// << globalStream.str();
-
-// return true;
-// }
-
-//=======================================================================
-//function : writePoints
-//purpose :
-//=======================================================================
-
-// static bool writePoints (ofstream & theFile,
-// SMESH_MesherHelper& theHelper,
-// std::map <int,int> & theSmdsToHybridIdMap,
-// std::map <int,int> & theEnforcedNodeIdToHybridIdMap,
-// std::map <int,const SMDS_MeshNode*> & theHybridIdToNodeMap,
-// HYBRIDPlugin_Hypothesis::TID2SizeMap & theNodeIDToSizeMap,
-// HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues & theEnforcedVertices,
-// HYBRIDPlugin_Hypothesis::TIDSortedNodeGroupMap & theEnforcedNodes,
-// HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedEdges,
-// HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedTriangles)
-// {
-// // record structure:
-// //
-// // NB_NODES
-// // Loop from 1 to NB_NODES
-// // X Y Z DUMMY_INT
-
-// SMESHDS_Mesh * theMeshDS = theHelper.GetMeshDS();
-// int nbNodes = theMeshDS->NbNodes();
-// if ( nbNodes == 0 )
-// return false;
-
-// int nbEnforcedVertices = theEnforcedVertices.size();
-// int nbEnforcedNodes = theEnforcedNodes.size();
-
-// const TopoDS_Shape shapeToMesh = theMeshDS->ShapeToMesh();
-
-// int aHybridID = 1;
-// SMDS_NodeIteratorPtr nodeIt = theMeshDS->nodesIterator();
-// const SMDS_MeshNode* node;
-
-// // Issue 020674: EDF 870 SMESH: Mesh generated by Netgen not usable by HYBRID
-// // The problem is in nodes on degenerated edges, we need to skip nodes which are free
-// // and replace not-free nodes on degenerated edges by the node on vertex
-// TNodeNodeMap n2nDegen; // map a node on degenerated edge to a node on vertex
-// TNodeNodeMap::iterator n2nDegenIt;
-// if ( theHelper.HasDegeneratedEdges() )
-// {
-// std::set<int> checkedSM;
-// for (TopExp_Explorer e(theMeshDS->ShapeToMesh(), TopAbs_EDGE ); e.More(); e.Next())
-// {
-// SMESH_subMesh* sm = theHelper.GetMesh()->GetSubMesh( e.Current() );
-// if ( checkedSM.insert( sm->GetId() ).second && theHelper.IsDegenShape(sm->GetId() ))
-// {
-// if ( SMESHDS_SubMesh* smDS = sm->GetSubMeshDS() )
-// {
-// TopoDS_Shape vertex = TopoDS_Iterator( e.Current() ).Value();
-// const SMDS_MeshNode* vNode = SMESH_Algo::VertexNode( TopoDS::Vertex( vertex ), theMeshDS);
-// {
-// SMDS_NodeIteratorPtr nIt = smDS->GetNodes();
-// while ( nIt->more() )
-// n2nDegen.insert( std::make_pair( nIt->next(), vNode ));
-// }
-// }
-// }
-// }
-// nbNodes -= n2nDegen.size();
-// }
-
-// const bool isQuadMesh =
-// theHelper.GetMesh()->NbEdges( ORDER_QUADRATIC ) ||
-// theHelper.GetMesh()->NbFaces( ORDER_QUADRATIC ) ||
-// theHelper.GetMesh()->NbVolumes( ORDER_QUADRATIC );
-// if ( isQuadMesh )
-// {
-// // descrease nbNodes by nb of medium nodes
-// while ( nodeIt->more() )
-// {
-// node = nodeIt->next();
-// if ( !theHelper.IsDegenShape( node->getshapeId() ))
-// nbNodes -= int( theHelper.IsMedium( node ));
-// }
-// nodeIt = theMeshDS->nodesIterator();
-// }
-
-// const char* space = " ";
-// const int dummyint = 0;
-
-// std::string tmpStr;
-// (nbNodes == 0 || nbNodes == 1) ? tmpStr = " node" : tmpStr = " nodes";
-// // NB_NODES
-// std::cout << std::endl;
-// std::cout << "The initial 2D mesh contains :" << std::endl;
-// std::cout << " " << nbNodes << tmpStr << std::endl;
-// if (nbEnforcedVertices > 0) {
-// (nbEnforcedVertices == 1) ? tmpStr = "vertex" : tmpStr = "vertices";
-// std::cout << " " << nbEnforcedVertices << " enforced " << tmpStr << std::endl;
-// }
-// if (nbEnforcedNodes > 0) {
-// (nbEnforcedNodes == 1) ? tmpStr = "node" : tmpStr = "nodes";
-// std::cout << " " << nbEnforcedNodes << " enforced " << tmpStr << std::endl;
-// }
-// std::cout << std::endl;
-// std::cout << "Start writing in 'points' file ..." << std::endl;
-
-// theFile << nbNodes << std::endl;
-
-// // Loop from 1 to NB_NODES
-
-// while ( nodeIt->more() )
-// {
-// node = nodeIt->next();
-// if ( isQuadMesh && theHelper.IsMedium( node )) // Issue 0021238
-// continue;
-// if ( n2nDegen.count( node ) ) // Issue 0020674
-// continue;
-
-// theSmdsToHybridIdMap.insert( std::make_pair( node->GetID(), aHybridID ));
-// theHybridIdToNodeMap.insert( std::make_pair( aHybridID, node ));
-// aHybridID++;
-
-// // X Y Z DUMMY_INT
-// theFile
-// << node->X() << space
-// << node->Y() << space
-// << node->Z() << space
-// << dummyint;
-
-// theFile << std::endl;
-
-// }
-
-// // Iterate over the enforced nodes
-// std::map<int,double> enfVertexIndexSizeMap;
-// if (nbEnforcedNodes) {
-// HYBRIDPlugin_Hypothesis::TIDSortedNodeGroupMap::const_iterator nodeIt = theEnforcedNodes.begin();
-// for( ; nodeIt != theEnforcedNodes.end() ; ++nodeIt) {
-// double x = nodeIt->first->X();
-// double y = nodeIt->first->Y();
-// double z = nodeIt->first->Z();
-// // Test if point is inside shape to mesh
-// gp_Pnt myPoint(x,y,z);
-// BRepClass3d_SolidClassifier scl(shapeToMesh);
-// scl.Perform(myPoint, 1e-7);
-// TopAbs_State result = scl.State();
-// if ( result != TopAbs_IN )
-// continue;
-// std::vector<double> coords;
-// coords.push_back(x);
-// coords.push_back(y);
-// coords.push_back(z);
-// if (theEnforcedVertices.find(coords) != theEnforcedVertices.end())
-// continue;
-
-// // double size = theNodeIDToSizeMap.find(nodeIt->first->GetID())->second;
-// // theHybridIdToNodeMap.insert( std::make_pair( nbNodes + i, (*nodeIt) ));
-// // MESSAGE("Adding enforced node (" << x << "," << y <<"," << z << ")");
-// // X Y Z PHY_SIZE DUMMY_INT
-// theFile
-// << x << space
-// << y << space
-// << z << space
-// << -1 << space
-// << dummyint << space;
-// theFile << std::endl;
-// theEnforcedNodeIdToHybridIdMap.insert( std::make_pair( nodeIt->first->GetID(), aHybridID ));
-// enfVertexIndexSizeMap[aHybridID] = -1;
-// aHybridID++;
-// // else
-// // MESSAGE("Enforced vertex (" << x << "," << y <<"," << z << ") is not inside the geometry: it was not added ");
-// }
-// }
-
-// if (nbEnforcedVertices) {
-// // Iterate over the enforced vertices
-// HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues::const_iterator vertexIt = theEnforcedVertices.begin();
-// for( ; vertexIt != theEnforcedVertices.end() ; ++vertexIt) {
-// double x = vertexIt->first[0];
-// double y = vertexIt->first[1];
-// double z = vertexIt->first[2];
-// // Test if point is inside shape to mesh
-// gp_Pnt myPoint(x,y,z);
-// BRepClass3d_SolidClassifier scl(shapeToMesh);
-// scl.Perform(myPoint, 1e-7);
-// TopAbs_State result = scl.State();
-// if ( result != TopAbs_IN )
-// continue;
-// MESSAGE("Adding enforced vertex (" << x << "," << y <<"," << z << ") = " << vertexIt->second);
-// // X Y Z PHY_SIZE DUMMY_INT
-// theFile
-// << x << space
-// << y << space
-// << z << space
-// << vertexIt->second << space
-// << dummyint << space;
-// theFile << std::endl;
-// enfVertexIndexSizeMap[aHybridID] = vertexIt->second;
-// aHybridID++;
-// }
-// }
-
-
-// std::cout << std::endl;
-// std::cout << "End writing in 'points' file." << std::endl;
-
-// return true;
-// }
-
-//=======================================================================
-//function : readResultFile
-//purpose : readResultFile with geometry
-//=======================================================================
-
-// static bool readResultFile(const int fileOpen,
-// #ifdef WIN32
-// const char* fileName,
-// #endif
-// HYBRIDPlugin_HYBRID* theAlgo,
-// SMESH_MesherHelper& theHelper,
-// TopoDS_Shape tabShape[],
-// double** tabBox,
-// const int nbShape,
-// std::map <int,const SMDS_MeshNode*>& theHybridIdToNodeMap,
-// std::map <int,int> & theNodeId2NodeIndexMap,
-// bool toMeshHoles,
-// int nbEnforcedVertices,
-// int nbEnforcedNodes,
-// HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedEdges,
-// HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap & theEnforcedTriangles,
-// bool toMakeGroupsOfDomains)
-// {
-// MESSAGE("HYBRIDPlugin_HYBRID::readResultFile()");
-// Kernel_Utils::Localizer loc;
-// struct stat status;
-// size_t length;
-
-// std::string tmpStr;
-
-// char *ptr, *mapPtr;
-// char *tetraPtr;
-// char *shapePtr;
-
-// SMESHDS_Mesh* theMeshDS = theHelper.GetMeshDS();
-
-// int nbElems, nbNodes, nbInputNodes;
-// int nbTriangle;
-// int ID, shapeID, hybridShapeID;
-// int IdShapeRef = 1;
-// int compoundID =
-// nbShape ? theMeshDS->ShapeToIndex( tabShape[0] ) : theMeshDS->ShapeToIndex( theMeshDS->ShapeToMesh() );
-
-// int *tab, *tabID, *nodeID, *nodeAssigne;
-// double *coord;
-// const SMDS_MeshNode **node;
-
-// tab = new int[3];
-// nodeID = new int[4];
-// coord = new double[3];
-// node = new const SMDS_MeshNode*[4];
-
-// TopoDS_Shape aSolid;
-// SMDS_MeshNode * aNewNode;
-// std::map <int,const SMDS_MeshNode*>::iterator itOnNode;
-// SMDS_MeshElement* aTet;
-// #ifdef _DEBUG_
-// std::set<int> shapeIDs;
-// #endif
-
-// // Read the file state
-// fstat(fileOpen, &status);
-// length = status.st_size;
-
-// // Mapping the result file into memory
-// #ifdef WIN32
-// HANDLE fd = CreateFile(fileName, GENERIC_READ, FILE_SHARE_READ,
-// NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-// HANDLE hMapObject = CreateFileMapping(fd, NULL, PAGE_READONLY,
-// 0, (DWORD)length, NULL);
-// ptr = ( char* ) MapViewOfFile(hMapObject, FILE_MAP_READ, 0, 0, 0 );
-// #else
-// ptr = (char *) mmap(0,length,PROT_READ,MAP_PRIVATE,fileOpen,0);
-// #endif
-// mapPtr = ptr;
-
-// ptr = readMapIntLine(ptr, tab);
-// tetraPtr = ptr;
-
-// nbElems = tab[0];
-// nbNodes = tab[1];
-// nbInputNodes = tab[2];
-
-// nodeAssigne = new int[ nbNodes+1 ];
-
-// if (nbShape > 0)
-// aSolid = tabShape[0];
-
-// // Reading the nodeId
-// for (int i=0; i < 4*nbElems; i++)
-// strtol(ptr, &ptr, 10);
-
-// MESSAGE("nbInputNodes: "<<nbInputNodes);
-// MESSAGE("nbEnforcedVertices: "<<nbEnforcedVertices);
-// MESSAGE("nbEnforcedNodes: "<<nbEnforcedNodes);
-// // Reading the nodeCoor and update the nodeMap
-// for (int iNode=1; iNode <= nbNodes; iNode++) {
-// if(theAlgo->computeCanceled())
-// return false;
-// for (int iCoor=0; iCoor < 3; iCoor++)
-// coord[ iCoor ] = strtod(ptr, &ptr);
-// nodeAssigne[ iNode ] = 1;
-// if ( iNode > (nbInputNodes-(nbEnforcedVertices+nbEnforcedNodes)) ) {
-// // Creating SMESH nodes
-// // - for enforced vertices
-// // - for vertices of forced edges
-// // - for hybrid nodes
-// nodeAssigne[ iNode ] = 0;
-// aNewNode = theMeshDS->AddNode( coord[0],coord[1],coord[2] );
-// theHybridIdToNodeMap.insert(theHybridIdToNodeMap.end(), std::make_pair( iNode, aNewNode ));
-// }
-// }
-
-// // Reading the number of triangles which corresponds to the number of sub-domains
-// nbTriangle = strtol(ptr, &ptr, 10);
-
-// tabID = new int[nbTriangle];
-// for (int i=0; i < nbTriangle; i++) {
-// if(theAlgo->computeCanceled())
-// return false;
-// tabID[i] = 0;
-// // find the solid corresponding to HYBRID sub-domain following
-// // the technique proposed in HYBRID manual in chapter
-// // "B.4 Subdomain (sub-region) assignment"
-// int nodeId1 = strtol(ptr, &ptr, 10);
-// int nodeId2 = strtol(ptr, &ptr, 10);
-// int nodeId3 = strtol(ptr, &ptr, 10);
-// if ( nbTriangle > 1 ) {
-// const SMDS_MeshNode* n1 = theHybridIdToNodeMap[ nodeId1 ];
-// const SMDS_MeshNode* n2 = theHybridIdToNodeMap[ nodeId2 ];
-// const SMDS_MeshNode* n3 = theHybridIdToNodeMap[ nodeId3 ];
-// if (!n1 || !n2 || !n3) {
-// tabID[i] = HOLE_ID;
-// continue;
-// }
-// try {
-// OCC_CATCH_SIGNALS;
-// // tabID[i] = findShapeID( theHelper, n1, n2, n3, toMeshHoles );
-// tabID[i] = findShapeID( *theHelper.GetMesh(), n1, n2, n3, toMeshHoles );
-// // -- 0020330: Pb with hybrid as a submesh
-// // check that found shape is to be meshed
-// if ( tabID[i] > 0 ) {
-// const TopoDS_Shape& foundShape = theMeshDS->IndexToShape( tabID[i] );
-// bool isToBeMeshed = false;
-// for ( int iS = 0; !isToBeMeshed && iS < nbShape; ++iS )
-// isToBeMeshed = foundShape.IsSame( tabShape[ iS ]);
-// if ( !isToBeMeshed )
-// tabID[i] = HOLE_ID;
-// }
-// // END -- 0020330: Pb with hybrid as a submesh
-// #ifdef _DEBUG_
-// std::cout << i+1 << " subdomain: findShapeID() returns " << tabID[i] << std::endl;
-// #endif
-// }
-// catch ( Standard_Failure & ex)
-// {
-// #ifdef _DEBUG_
-// std::cout << i+1 << " subdomain: Exception caugt: " << ex.GetMessageString() << std::endl;
-// #endif
-// }
-// catch (...) {
-// #ifdef _DEBUG_
-// std::cout << i+1 << " subdomain: unknown exception caught " << std::endl;
-// #endif
-// }
-// }
-// }
-
-// shapePtr = ptr;
-
-// if ( nbTriangle <= nbShape ) // no holes
-// toMeshHoles = true; // not avoid creating tetras in holes
-
-// // IMP 0022172: [CEA 790] create the groups corresponding to domains
-// std::vector< std::vector< const SMDS_MeshElement* > > elemsOfDomain( Max( nbTriangle, nbShape ));
-
-// // Associating the tetrahedrons to the shapes
-// shapeID = compoundID;
-// for (int iElem = 0; iElem < nbElems; iElem++) {
-// if(theAlgo->computeCanceled())
-// return false;
-// for (int iNode = 0; iNode < 4; iNode++) {
-// ID = strtol(tetraPtr, &tetraPtr, 10);
-// itOnNode = theHybridIdToNodeMap.find(ID);
-// node[ iNode ] = itOnNode->second;
-// nodeID[ iNode ] = ID;
-// }
-// // We always run HYBRID with "to mesh holes"==TRUE but we must not create
-// // tetras within holes depending on hypo option,
-// // so we first check if aTet is inside a hole and then create it
-// //aTet = theMeshDS->AddVolume( node[1], node[0], node[2], node[3] );
-// hybridShapeID = 0; // domain ID
-// if ( nbTriangle > 1 ) {
-// shapeID = HOLE_ID; // negative shapeID means not to create tetras if !toMeshHoles
-// hybridShapeID = strtol(shapePtr, &shapePtr, 10) - IdShapeRef;
-// if ( tabID[ hybridShapeID ] == 0 ) {
-// TopAbs_State state;
-// aSolid = findShape(node, aSolid, tabShape, tabBox, nbShape, &state);
-// if ( toMeshHoles || state == TopAbs_IN )
-// shapeID = theMeshDS->ShapeToIndex( aSolid );
-// tabID[ hybridShapeID ] = shapeID;
-// }
-// else
-// shapeID = tabID[ hybridShapeID ];
-// }
-// else if ( nbShape > 1 ) {
-// // Case where nbTriangle == 1 while nbShape == 2 encountered
-// // with compound of 2 boxes and "To mesh holes"==False,
-// // so there are no subdomains specified for each tetrahedron.
-// // Try to guess a solid by a node already bound to shape
-// shapeID = 0;
-// for ( int i=0; i<4 && shapeID==0; i++ ) {
-// if ( nodeAssigne[ nodeID[i] ] == 1 &&
-// node[i]->GetPosition()->GetTypeOfPosition() == SMDS_TOP_3DSPACE &&
-// node[i]->getshapeId() > 1 )
-// {
-// shapeID = node[i]->getshapeId();
-// }
-// }
-// if ( shapeID==0 ) {
-// aSolid = findShape(node, aSolid, tabShape, tabBox, nbShape);
-// shapeID = theMeshDS->ShapeToIndex( aSolid );
-// }
-// }
-// // set new nodes and tetrahedron onto the shape
-// for ( int i=0; i<4; i++ ) {
-// if ( nodeAssigne[ nodeID[i] ] == 0 ) {
-// if ( shapeID != HOLE_ID )
-// theMeshDS->SetNodeInVolume( node[i], shapeID );
-// nodeAssigne[ nodeID[i] ] = shapeID;
-// }
-// }
-// if ( toMeshHoles || shapeID != HOLE_ID ) {
-// aTet = theHelper.AddVolume( node[1], node[0], node[2], node[3],
-// /*id=*/0, /*force3d=*/false);
-// theMeshDS->SetMeshElementOnShape( aTet, shapeID );
-// if ( toMakeGroupsOfDomains )
-// {
-// if ( int( elemsOfDomain.size() ) < hybridShapeID+1 )
-// elemsOfDomain.resize( hybridShapeID+1 );
-// elemsOfDomain[ hybridShapeID ].push_back( aTet );
-// }
-// }
-// #ifdef _DEBUG_
-// shapeIDs.insert( shapeID );
-// #endif
-// }
-// if ( toMakeGroupsOfDomains )
-// makeDomainGroups( elemsOfDomain, &theHelper );
-
-// // Add enforced elements
-// HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap::const_iterator elemIt;
-// const SMDS_MeshElement* anElem;
-// SMDS_ElemIteratorPtr itOnEnfElem;
-// std::map<int,int>::const_iterator itOnMap;
-// shapeID = compoundID;
-// // Enforced edges
-// if (theEnforcedEdges.size()) {
-// (theEnforcedEdges.size() <= 1) ? tmpStr = " enforced edge" : " enforced edges";
-// std::cout << "Add " << theEnforcedEdges.size() << tmpStr << std::endl;
-// std::vector< const SMDS_MeshNode* > node( 2 );
-// // Iterate over the enforced edges
-// for(elemIt = theEnforcedEdges.begin() ; elemIt != theEnforcedEdges.end() ; ++elemIt) {
-// anElem = elemIt->first;
-// bool addElem = true;
-// itOnEnfElem = anElem->nodesIterator();
-// for ( int j = 0; j < 2; ++j ) {
-// int aNodeID = itOnEnfElem->next()->GetID();
-// itOnMap = theNodeId2NodeIndexMap.find(aNodeID);
-// if (itOnMap != theNodeId2NodeIndexMap.end()) {
-// itOnNode = theHybridIdToNodeMap.find((*itOnMap).second);
-// if (itOnNode != theHybridIdToNodeMap.end()) {
-// node.push_back((*itOnNode).second);
-// // shapeID =(*itOnNode).second->getshapeId();
-// }
-// else
-// addElem = false;
-// }
-// else
-// addElem = false;
-// }
-// if (addElem) {
-// aTet = theHelper.AddEdge( node[0], node[1], 0, false);
-// theMeshDS->SetMeshElementOnShape( aTet, shapeID );
-// }
-// }
-// }
-// // Enforced faces
-// if (theEnforcedTriangles.size()) {
-// (theEnforcedTriangles.size() <= 1) ? tmpStr = " enforced triangle" : " enforced triangles";
-// std::cout << "Add " << theEnforcedTriangles.size() << " enforced triangles" << std::endl;
-// std::vector< const SMDS_MeshNode* > node( 3 );
-// // Iterate over the enforced triangles
-// for(elemIt = theEnforcedTriangles.begin() ; elemIt != theEnforcedTriangles.end() ; ++elemIt) {
-// anElem = elemIt->first;
-// bool addElem = true;
-// itOnEnfElem = anElem->nodesIterator();
-// for ( int j = 0; j < 3; ++j ) {
-// int aNodeID = itOnEnfElem->next()->GetID();
-// itOnMap = theNodeId2NodeIndexMap.find(aNodeID);
-// if (itOnMap != theNodeId2NodeIndexMap.end()) {
-// itOnNode = theHybridIdToNodeMap.find((*itOnMap).second);
-// if (itOnNode != theHybridIdToNodeMap.end()) {
-// node.push_back((*itOnNode).second);
-// // shapeID =(*itOnNode).second->getshapeId();
-// }
-// else
-// addElem = false;
-// }
-// else
-// addElem = false;
-// }
-// if (addElem) {
-// aTet = theHelper.AddFace( node[0], node[1], node[2], 0, false);
-// theMeshDS->SetMeshElementOnShape( aTet, shapeID );
-// }
-// }
-// }
-
-// // Remove nodes of tetras inside holes if !toMeshHoles
-// if ( !toMeshHoles ) {
-// itOnNode = theHybridIdToNodeMap.find( nbInputNodes );
-// for ( ; itOnNode != theHybridIdToNodeMap.end(); ++itOnNode) {
-// ID = itOnNode->first;
-// if ( nodeAssigne[ ID ] == HOLE_ID )
-// theMeshDS->RemoveFreeNode( itOnNode->second, 0 );
-// }
-// }
-
-
-// if ( nbElems ) {
-// (nbElems <= 1) ? tmpStr = " tetrahedra" : " tetrahedrons";
-// cout << nbElems << tmpStr << " have been associated to " << nbShape;
-// (nbShape <= 1) ? tmpStr = " shape" : " shapes";
-// cout << tmpStr << endl;
-// }
-// #ifdef WIN32
-// UnmapViewOfFile(mapPtr);
-// CloseHandle(hMapObject);
-// CloseHandle(fd);
-// #else
-// munmap(mapPtr, length);
-// #endif
-// close(fileOpen);
-
-// delete [] tab;
-// delete [] tabID;
-// delete [] nodeID;
-// delete [] coord;
-// delete [] node;
-// delete [] nodeAssigne;
-
-// #ifdef _DEBUG_
-// shapeIDs.erase(-1);
-// if ((int) shapeIDs.size() != nbShape ) {
-// (shapeIDs.size() <= 1) ? tmpStr = " solid" : " solids";
-// std::cout << "Only " << shapeIDs.size() << tmpStr << " of " << nbShape << " found" << std::endl;
-// for (int i=0; i<nbShape; i++) {
-// shapeID = theMeshDS->ShapeToIndex( tabShape[i] );
-// if ( shapeIDs.find( shapeID ) == shapeIDs.end() )
-// std::cout << " Solid #" << shapeID << " not found" << std::endl;
-// }
-// }
-// #endif
-
-// return true;
-// }
-
-
//=============================================================================
/*!
*Here we are going to use the HYBRID mesher with geometry
// a unique working file name
// to avoid access to the same files by eg different users
_genericName = HYBRIDPlugin_Hypothesis::GetFileName(_hyp);
- TCollection_AsciiString aGenericName((char*) _genericName.c_str() );
- TCollection_AsciiString aGenericNameRequired = aGenericName + "_required";
+ std::string aGenericName = _genericName;
+ std::string aGenericNameRequired = aGenericName + "_required";
- TCollection_AsciiString aLogFileName = aGenericName + ".log"; // log
- TCollection_AsciiString aResultFileName;
+ std::string aLogFileName = aGenericName + ".log"; // log
+ std::string aResultFileName;
- TCollection_AsciiString aGMFFileName, aRequiredVerticesFileName, aSolFileName, aResSolFileName;
-//#ifdef _DEBUG_
+ std::string aGMFFileName, aRequiredVerticesFileName, aSolFileName, aResSolFileName;
aGMFFileName = aGenericName + ".mesh"; // GMF mesh file
aResultFileName = aGenericName + "Vol.mesh"; // GMF mesh file
aResSolFileName = aGenericName + "Vol.sol"; // GMF mesh file
aRequiredVerticesFileName = aGenericNameRequired + ".mesh"; // GMF required vertices mesh file
aSolFileName = aGenericNameRequired + ".sol"; // GMF solution file
-//#else
-// aGMFFileName = aGenericName + ".meshb"; // GMF mesh file
-// aResultFileName = aGenericName + "Vol.meshb"; // GMF mesh file
-// aRequiredVerticesFileName = aGenericNameRequired + ".meshb"; // GMF required vertices mesh file
-// aSolFileName = aGenericNameRequired + ".solb"; // GMF solution file
-//#endif
std::map <int,int> aNodeId2NodeIndexMap, aSmdsToHybridIdMap, anEnforcedNodeIdToHybridIdMap;
- //std::map <int,const SMDS_MeshNode*> aHybridIdToNodeMap;
std::map <int, int> nodeID2nodeIndexMap;
std::map<std::vector<double>, std::string> enfVerticesWithGroup;
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues coordsSizeMap = HYBRIDPlugin_Hypothesis::GetEnforcedVerticesCoordsSize(_hyp);
HYBRIDPlugin_Hypothesis::TIDSortedNodeGroupMap enforcedNodes = HYBRIDPlugin_Hypothesis::GetEnforcedNodes(_hyp);
HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap enforcedEdges = HYBRIDPlugin_Hypothesis::GetEnforcedEdges(_hyp);
HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap enforcedTriangles = HYBRIDPlugin_Hypothesis::GetEnforcedTriangles(_hyp);
-// TIDSortedElemSet enforcedQuadrangles = HYBRIDPlugin_Hypothesis::GetEnforcedQuadrangles(_hyp);
HYBRIDPlugin_Hypothesis::TID2SizeMap nodeIDToSizeMap = HYBRIDPlugin_Hypothesis::GetNodeIDToSizeMap(_hyp);
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexList enfVertices = HYBRIDPlugin_Hypothesis::GetEnforcedVertices(_hyp);
for ( ; enfVerIt != enfVertices.end() ; ++enfVerIt)
{
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex* enfVertex = (*enfVerIt);
-// if (enfVertex->geomEntry.empty() && enfVertex->coords.size()) {
if (enfVertex->coords.size()) {
coordsSizeMap.insert(std::make_pair(enfVertex->coords,enfVertex->size));
enfVerticesWithGroup.insert(std::make_pair(enfVertex->coords,enfVertex->groupName));
-// MESSAGE("enfVerticesWithGroup.insert(std::make_pair(("<<enfVertex->coords[0]<<","<<enfVertex->coords[1]<<","<<enfVertex->coords[2]<<"),\""<<enfVertex->groupName<<"\"))");
}
else {
-// if (!enfVertex->geomEntry.empty()) {
TopoDS_Shape GeomShape = entryToShape(enfVertex->geomEntry);
-// GeomType = GeomShape.ShapeType();
-
-// if (!enfVertex->isCompound) {
-// // if (GeomType == TopAbs_VERTEX) {
-// coords.clear();
-// aPnt = BRep_Tool::Pnt(TopoDS::Vertex(GeomShape));
-// coords.push_back(aPnt.X());
-// coords.push_back(aPnt.Y());
-// coords.push_back(aPnt.Z());
-// if (coordsSizeMap.find(coords) == coordsSizeMap.end()) {
-// coordsSizeMap.insert(std::make_pair(coords,enfVertex->size));
-// enfVerticesWithGroup.insert(std::make_pair(coords,enfVertex->groupName));
-// }
-// }
-//
-// // Group Management
-// else {
-// if (GeomType == TopAbs_COMPOUND){
- for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
- coords.clear();
- if (it.Value().ShapeType() == TopAbs_VERTEX){
- gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(it.Value()));
- coords.push_back(aPnt.X());
- coords.push_back(aPnt.Y());
- coords.push_back(aPnt.Z());
- if (coordsSizeMap.find(coords) == coordsSizeMap.end()) {
- coordsSizeMap.insert(std::make_pair(coords,enfVertex->size));
- enfVerticesWithGroup.insert(std::make_pair(coords,enfVertex->groupName));
-// MESSAGE("enfVerticesWithGroup.insert(std::make_pair(("<<coords[0]<<","<<coords[1]<<","<<coords[2]<<"),\""<<enfVertex->groupName<<"\"))");
- }
+ for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
+ coords.clear();
+ if (it.Value().ShapeType() == TopAbs_VERTEX){
+ gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(it.Value()));
+ coords.push_back(aPnt.X());
+ coords.push_back(aPnt.Y());
+ coords.push_back(aPnt.Z());
+ if (coordsSizeMap.find(coords) == coordsSizeMap.end()) {
+ coordsSizeMap.insert(std::make_pair(coords,enfVertex->size));
+ enfVerticesWithGroup.insert(std::make_pair(coords,enfVertex->groupName));
}
}
-// }
+ }
}
}
int nbEnforcedVertices = coordsSizeMap.size();
int nbEnforcedNodes = enforcedNodes.size();
-
+
std::string tmpStr;
(nbEnforcedNodes <= 1) ? tmpStr = "node" : "nodes";
std::cout << nbEnforcedNodes << " enforced " << tmpStr << " from hypo" << std::endl;
MG_HYBRID_API mgHybrid( _computeCanceled, _progress );
Ok = writeGMFFile(&mgHybrid,
- aGMFFileName.ToCString(),
- aRequiredVerticesFileName.ToCString(),
- aSolFileName.ToCString(),
+ aGMFFileName.c_str(),
+ aRequiredVerticesFileName.c_str(),
+ aSolFileName.c_str(),
*proxyMesh, helper,
aNodeByHybridId, aFaceByHybridId, aNodeToHybridIdMap,
aNodeGroupByHybridId, anEdgeGroupByHybridId, aFaceGroupByHybridId,
enfVerticesWithGroup, coordsSizeMap);
// Write aSmdsToHybridIdMap to temp file
- TCollection_AsciiString aSmdsToHybridIdMapFileName;
+ std::string aSmdsToHybridIdMapFileName;
aSmdsToHybridIdMapFileName = aGenericName + ".ids"; // ids relation
- ofstream aIdsFile ( aSmdsToHybridIdMapFileName.ToCString() , ios::out);
+ ofstream aIdsFile ( aSmdsToHybridIdMapFileName , ios::out);
Ok = aIdsFile.rdbuf()->is_open();
if (!Ok) {
INFOS( "Can't write into " << aSmdsToHybridIdMapFileName);
// run hybrid mesher
// -----------------
- TCollection_AsciiString cmd( (char*)HYBRIDPlugin_Hypothesis::CommandToRun( _hyp ).c_str() );
+ std::string cmd = HYBRIDPlugin_Hypothesis::CommandToRun( _hyp, theMesh );
if ( mgHybrid.IsExecutable() )
{
- cmd += TCollection_AsciiString(" --in ") + aGMFFileName;
- //if ( nbEnforcedVertices + nbEnforcedNodes)
- // cmd += TCollection_AsciiString(" --required_vertices ") + aGenericNameRequired;
- cmd += TCollection_AsciiString(" --out ") + aResultFileName;
+ cmd += " --in " + aGMFFileName;
+ cmd += " --out " + aResultFileName;
}
std::cout << std::endl;
std::cout << "Hybrid execution with geometry..." << std::endl;
std::cout << cmd;
if ( !_logInStandardOutput )
{
- mgHybrid.SetLogFile( aLogFileName.ToCString() );
+ mgHybrid.SetLogFile( aLogFileName );
if ( mgHybrid.IsExecutable() )
- cmd += TCollection_AsciiString(" 1>" ) + aLogFileName; // dump into file
+ cmd += " 1>" + aLogFileName; // dump into file
std::cout << " 1> " << aLogFileName;
}
std::cout << std::endl;
_computeCanceled = false;
std::string errStr;
- Ok = mgHybrid.Compute( cmd.ToCString(), errStr ); // run
+ Ok = mgHybrid.Compute( cmd, errStr ); // run
if ( _logInStandardOutput && mgHybrid.IsLibrary() )
std::cout << std::endl << mgHybrid.GetLog() << std::endl;
// Mapping the result file
- HYBRIDPlugin_Hypothesis::TSetStrings groupsToRemove = HYBRIDPlugin_Hypothesis::GetGroupsToRemove(_hyp);
- bool toMeshHoles =
- _hyp ? _hyp->GetToMeshHoles(true) : HYBRIDPlugin_Hypothesis::DefaultMeshHoles();
- const bool toMakeGroupsOfDomains = HYBRIDPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp );
+ HYBRIDPlugin_Hypothesis::TSetStrings groupsToRemove = HYBRIDPlugin_Hypothesis::GetGroupsToRemove(_hyp);
+ bool toMeshHoles =
+ _hyp ? _hyp->GetToMeshHoles(true) : HYBRIDPlugin_Hypothesis::DefaultMeshHoles();
+ const bool toMakeGroupsOfDomains = HYBRIDPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp );
- helper.IsQuadraticSubMesh( theShape );
- helper.SetElementsOnShape( false );
-
- Ok = readGMFFile(&mgHybrid, aResultFileName.ToCString(),
- this,
- &helper, aNodeByHybridId, aFaceByHybridId, aNodeToHybridIdMap,
- aNodeGroupByHybridId, anEdgeGroupByHybridId, aFaceGroupByHybridId,
- groupsToRemove, toMakeGroupsOfDomains, toMeshHoles);
+ helper.IsQuadraticSubMesh( theShape );
+ helper.SetElementsOnShape( false );
- removeEmptyGroupsOfDomains( helper.GetMesh(), !toMakeGroupsOfDomains );
+ Ok = readGMFFile(&mgHybrid, aResultFileName.c_str(),
+ this,
+ &helper, aNodeByHybridId, aFaceByHybridId, aNodeToHybridIdMap,
+ aNodeGroupByHybridId, anEdgeGroupByHybridId, aFaceGroupByHybridId,
+ groupsToRemove, toMakeGroupsOfDomains, toMeshHoles);
+ removeEmptyGroupsOfDomains( helper.GetMesh(), !toMakeGroupsOfDomains );
{
if ( _removeLogOnSuccess )
removeFile( aLogFileName );
-
- // if ( _hyp && _hyp->GetToMakeGroupsOfDomains() )
- // error( COMPERR_WARNING, "'toMakeGroupsOfDomains' is ignored since the mesh is on shape" );
}
else if ( mgHybrid.HasLog() )
{
// get problem description from the log file
_Ghs2smdsConvertor conv( aNodeByHybridId );
- storeErrorDescription( _logInStandardOutput ? 0 : aLogFileName.ToCString(),
+ storeErrorDescription( _logInStandardOutput ? 0 : aLogFileName.c_str(),
mgHybrid.GetLog(), conv );
}
else if ( !errStr.empty() )
}
if ( mgHybrid.IsExecutable() )
{
- std::cout << "<" << aResultFileName.ToCString() << "> HYBRID output file ";
+ std::cout << "<" << aResultFileName << "> HYBRID output file ";
if ( !Ok )
std::cout << "not ";
std::cout << "treated !" << std::endl;
bool HYBRIDPlugin_HYBRID::Compute(SMESH_Mesh& theMesh,
SMESH_MesherHelper* theHelper)
{
- MESSAGE("HYBRIDPlugin_HYBRID::Compute()");
-
theHelper->IsQuadraticSubMesh( theHelper->GetSubShape() );
// a unique working file name
// to avoid access to the same files by eg different users
_genericName = HYBRIDPlugin_Hypothesis::GetFileName(_hyp);
- TCollection_AsciiString aGenericName((char*) _genericName.c_str() );
- TCollection_AsciiString aGenericNameRequired = aGenericName + "_required";
+ std::string aGenericName((char*) _genericName.c_str() );
+ std::string aGenericNameRequired = aGenericName + "_required";
- TCollection_AsciiString aLogFileName = aGenericName + ".log"; // log
- TCollection_AsciiString aResultFileName;
+ std::string aLogFileName = aGenericName + ".log"; // log
+ std::string aResultFileName;
bool Ok;
- TCollection_AsciiString aGMFFileName, aRequiredVerticesFileName, aSolFileName, aResSolFileName;
-//#ifdef _DEBUG_
+ std::string aGMFFileName, aRequiredVerticesFileName, aSolFileName, aResSolFileName;
aGMFFileName = aGenericName + ".mesh"; // GMF mesh file
aResultFileName = aGenericName + "Vol.mesh"; // GMF mesh file
aResSolFileName = aGenericName + "Vol.sol"; // GMF mesh file
aRequiredVerticesFileName = aGenericNameRequired + ".mesh"; // GMF required vertices mesh file
aSolFileName = aGenericNameRequired + ".sol"; // GMF solution file
-//#else
-// aGMFFileName = aGenericName + ".meshb"; // GMF mesh file
-// aResultFileName = aGenericName + "Vol.meshb"; // GMF mesh file
-// aRequiredVerticesFileName = aGenericNameRequired + ".meshb"; // GMF required vertices mesh file
-// aSolFileName = aGenericNameRequired + ".solb"; // GMF solution file
-//#endif
std::map <int, int> nodeID2nodeIndexMap;
std::map<std::vector<double>, std::string> enfVerticesWithGroup;
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues coordsSizeMap;
TopoDS_Shape GeomShape;
-// TopAbs_ShapeEnum GeomType;
std::vector<double> coords;
gp_Pnt aPnt;
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertex* enfVertex;
for ( ; enfVerIt != enfVertices.end() ; ++enfVerIt)
{
enfVertex = (*enfVerIt);
-// if (enfVertex->geomEntry.empty() && enfVertex->coords.size()) {
if (enfVertex->coords.size()) {
coordsSizeMap.insert(std::make_pair(enfVertex->coords,enfVertex->size));
enfVerticesWithGroup.insert(std::make_pair(enfVertex->coords,enfVertex->groupName));
-// MESSAGE("enfVerticesWithGroup.insert(std::make_pair(("<<enfVertex->coords[0]<<","<<enfVertex->coords[1]<<","<<enfVertex->coords[2]<<"),\""<<enfVertex->groupName<<"\"))");
}
else {
-// if (!enfVertex->geomEntry.empty()) {
GeomShape = entryToShape(enfVertex->geomEntry);
-// GeomType = GeomShape.ShapeType();
-
-// if (!enfVertex->isCompound) {
-// // if (GeomType == TopAbs_VERTEX) {
-// coords.clear();
-// aPnt = BRep_Tool::Pnt(TopoDS::Vertex(GeomShape));
-// coords.push_back(aPnt.X());
-// coords.push_back(aPnt.Y());
-// coords.push_back(aPnt.Z());
-// if (coordsSizeMap.find(coords) == coordsSizeMap.end()) {
-// coordsSizeMap.insert(std::make_pair(coords,enfVertex->size));
-// enfVerticesWithGroup.insert(std::make_pair(coords,enfVertex->groupName));
-// }
-// }
-//
-// // Group Management
-// else {
-// if (GeomType == TopAbs_COMPOUND){
- for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
- coords.clear();
- if (it.Value().ShapeType() == TopAbs_VERTEX){
- aPnt = BRep_Tool::Pnt(TopoDS::Vertex(it.Value()));
- coords.push_back(aPnt.X());
- coords.push_back(aPnt.Y());
- coords.push_back(aPnt.Z());
- if (coordsSizeMap.find(coords) == coordsSizeMap.end()) {
- coordsSizeMap.insert(std::make_pair(coords,enfVertex->size));
- enfVerticesWithGroup.insert(std::make_pair(coords,enfVertex->groupName));
-// MESSAGE("enfVerticesWithGroup.insert(std::make_pair(("<<coords[0]<<","<<coords[1]<<","<<coords[2]<<"),\""<<enfVertex->groupName<<"\"))");
- }
+ for (TopoDS_Iterator it (GeomShape); it.More(); it.Next()){
+ coords.clear();
+ if (it.Value().ShapeType() == TopAbs_VERTEX){
+ aPnt = BRep_Tool::Pnt(TopoDS::Vertex(it.Value()));
+ coords.push_back(aPnt.X());
+ coords.push_back(aPnt.Y());
+ coords.push_back(aPnt.Z());
+ if (coordsSizeMap.find(coords) == coordsSizeMap.end()) {
+ coordsSizeMap.insert(std::make_pair(coords,enfVertex->size));
+ enfVerticesWithGroup.insert(std::make_pair(coords,enfVertex->groupName));
}
}
-// }
+ }
}
}
-// const SMDS_MeshNode* enfNode;
HYBRIDPlugin_Hypothesis::TIDSortedNodeGroupMap enforcedNodes = HYBRIDPlugin_Hypothesis::GetEnforcedNodes(_hyp);
-// HYBRIDPlugin_Hypothesis::TIDSortedNodeGroupMap::const_iterator enfNodeIt = enforcedNodes.begin();
-// for ( ; enfNodeIt != enforcedNodes.end() ; ++enfNodeIt)
-// {
-// enfNode = enfNodeIt->first;
-// coords.clear();
-// coords.push_back(enfNode->X());
-// coords.push_back(enfNode->Y());
-// coords.push_back(enfNode->Z());
-// if (enfVerticesWithGro
-// enfVerticesWithGroup.insert(std::make_pair(coords,enfNodeIt->second));
-// }
-
-
HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap enforcedEdges = HYBRIDPlugin_Hypothesis::GetEnforcedEdges(_hyp);
HYBRIDPlugin_Hypothesis::TIDSortedElemGroupMap enforcedTriangles = HYBRIDPlugin_Hypothesis::GetEnforcedTriangles(_hyp);
-// TIDSortedElemSet enforcedQuadrangles = HYBRIDPlugin_Hypothesis::GetEnforcedQuadrangles(_hyp);
HYBRIDPlugin_Hypothesis::TID2SizeMap nodeIDToSizeMap = HYBRIDPlugin_Hypothesis::GetNodeIDToSizeMap(_hyp);
std::string tmpStr;
MG_HYBRID_API mgHybrid( _computeCanceled, _progress );
Ok = writeGMFFile(&mgHybrid,
- aGMFFileName.ToCString(),
- aRequiredVerticesFileName.ToCString(), aSolFileName.ToCString(),
+ aGMFFileName.c_str(),
+ aRequiredVerticesFileName.c_str(), aSolFileName.c_str(),
*proxyMesh, *theHelper,
aNodeByHybridId, aFaceByHybridId, aNodeToHybridIdMap,
aNodeGroupByHybridId, anEdgeGroupByHybridId, aFaceGroupByHybridId,
// run hybrid mesher
// -----------------
- TCollection_AsciiString cmd = HYBRIDPlugin_Hypothesis::CommandToRun( _hyp, false ).c_str();
+ std::string cmd = HYBRIDPlugin_Hypothesis::CommandToRun( _hyp, theMesh );
if ( mgHybrid.IsExecutable() )
{
- cmd += TCollection_AsciiString(" --in ") + aGMFFileName;
- //if ( nbEnforcedVertices + nbEnforcedNodes)
- // cmd += TCollection_AsciiString(" --required_vertices ") + aGenericNameRequired;
- cmd += TCollection_AsciiString(" --out ") + aResultFileName;
+ cmd += " --in " + aGMFFileName;
+ cmd += " --out " + aResultFileName;
}
if ( !_logInStandardOutput )
{
- cmd += TCollection_AsciiString(" 1> " ) + aLogFileName; // dump into file
- mgHybrid.SetLogFile( aLogFileName.ToCString() );
+ cmd += " 1> " + aLogFileName; // dump into file
+ mgHybrid.SetLogFile( aLogFileName );
}
std::cout << std::endl;
std::cout << "Hybrid execution w/o geometry..." << std::endl;
_computeCanceled = false;
std::string errStr;
- Ok = mgHybrid.Compute( cmd.ToCString(), errStr ); // run
+ Ok = mgHybrid.Compute( cmd, errStr ); // run
if ( _logInStandardOutput && mgHybrid.IsLibrary() )
std::cout << std::endl << mgHybrid.GetLog() << std::endl;
const bool toMakeGroupsOfDomains = HYBRIDPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp );
Ok = Ok && readGMFFile(&mgHybrid,
- aResultFileName.ToCString(),
+ aResultFileName.c_str(),
this,
theHelper, aNodeByHybridId, aFaceByHybridId, aNodeToHybridIdMap,
aNodeGroupByHybridId, anEdgeGroupByHybridId, aFaceGroupByHybridId,
groupsToRemove, toMakeGroupsOfDomains);
updateMeshGroups(theHelper->GetMesh(), groupsToRemove);
- //removeEmptyGroupsOfDomains( theHelper->GetMesh(), notEmptyAsWell );
removeEmptyGroupsOfDomains( theHelper->GetMesh(), !toMakeGroupsOfDomains );
if ( Ok ) {
{
if ( _removeLogOnSuccess )
removeFile( aLogFileName );
-
- //if ( !toMakeGroupsOfDomains && _hyp && _hyp->GetToMakeGroupsOfDomains() )
- //error( COMPERR_WARNING, "'toMakeGroupsOfDomains' is ignored since 'toMeshHoles' is OFF." );
}
else if ( mgHybrid.HasLog() )
{
// get problem description from the log file
_Ghs2smdsConvertor conv( aNodeByHybridId );
- storeErrorDescription( _logInStandardOutput ? 0 : aLogFileName.ToCString(),
+ storeErrorDescription( _logInStandardOutput ? 0 : aLogFileName.c_str(),
mgHybrid.GetLog(), conv );
}
else {
// the log file is empty
removeFile( aLogFileName );
- INFOS( "HYBRID Error, command '" << cmd.ToCString() << "' failed" );
+ INFOS( "HYBRID Error, command '" << cmd << "' failed" );
error(COMPERR_ALGO_FAILED, "hybrid: command not found" );
}