IF(SALOME_BUILD_GUI)
SET(GMSHPLUGIN_RESOURCES_FILES_WITH_GUI
- gmsh.png
+ gmsh.png
+ gmsh_small.png
)
ENDIF(SALOME_BUILD_GUI)
//=============================================================================
bool GMSHPlugin_GMSH_2D::Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
+ const TopoDS_Shape& aShape)
{
GMSHPlugin_Mesher mesher(&aMesh, aShape);
mesher.SetParameters(dynamic_cast<const GMSHPlugin_Hypothesis*>(_hypothesis));
_secondOrder = false;
_useIncomplElem = true;
_is2d = false;
+ _compounds.clear();
}
}
CORBA::Object_var obj = SMESH_Gen_i::getStudyServant()->ConvertIORToObject(aVal);
aGeomObj = GEOM::GEOM_Object::_narrow(obj);
}
- if ( !aGeomObj->_is_nil() )
- geomShape = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
+ geomShape = smeshGen_i->GeomObjectToShape( aGeomObj.in() );
+ if ( geomShape.IsNull() )
+ continue;
TopAbs_ShapeEnum geomType = geomShape.ShapeType();
if ( geomType == TopAbs_COMPOUND)// voir s'il ne faut pas mettre une erreur dans le cas contraire
{
MESSAGE("shapeType == TopAbs_COMPOUND");
TopoDS_Iterator it(geomShape);
+ if ( !it.More() )
+ continue;
TopAbs_ShapeEnum shapeType = it.Value().ShapeType();
#if GMSH_MAJOR_VERSION >=4
std::vector< std::pair< int, int > > dimTags;
{
const TopoDS_Shape& topoShape = it.Value();
ASSERT(topoShape.ShapeType() == shapeType);
- occgeo->importShapes( &topoShape, false, dimTags );
+ if ( _mesh->GetMeshDS()->ShapeToIndex( topoShape ) > 0 )
+ occgeo->importShapes( &topoShape, false, dimTags );
+ else
+ {
+ TopoDS_Shape face = TopExp_Explorer( _shape, shapeType ).Current();
+ SMESH_subMesh* sm = _mesh->GetSubMesh( face );
+ sm->GetComputeError() =
+ SMESH_ComputeError::New
+ ( COMPERR_WARNING, "Compound shape does not belong to the main geometry. Ingnored");
+ }
}
std::vector<int> tags;
int dim = ( shapeType == TopAbs_EDGE ) ? 1 : 2;
readParamsFromHypo( data_old );
readParamsFromWidgets( data_new );
bool res = storeParamsToHypo( data_new );
+ msg = data_new.myErrorMsg;
storeParamsToHypo( data_old );
return res;
}
SALOME_ListIO ListSelectedObjects;
mySel->selectedObjects(ListSelectedObjects, NULL, false );
SALOME_ListIteratorOfListIO Object_It(ListSelectedObjects);
- for (Object_It ; Object_It.More() ; Object_It.Next())
+ for ( ; Object_It.More() ; Object_It.Next())
{
Handle(SALOME_InteractiveObject) anObject = Object_It.Value();
std::string entry, shapeName;
GMSHPluginGUI_HypothesisCreator* that = (GMSHPluginGUI_HypothesisCreator*)this;
GMSHPlugin::string_array_var myEntries = h->GetCompoundOnEntries();
- for ( int i=0 ; i<myEntries->length() ; i++ )
+ for ( CORBA::ULong i=0 ; i<myEntries->length() ; i++ )
{
QString entry = myEntries[i].in();
that->myCompoundSet.insert(entry);
h->SetSecondOrder( h_data.mySecondOrder );
h->SetUseIncomplElem( h_data.myUseIncomplElem );
h->SetIs2d( myIs2D );
-
+
+ QString mainEntry = getMainShapeEntry();
for (QSet<QString>::const_iterator i = myCompoundSet.begin(); i != myCompoundSet.end(); ++i)
{
- const QString entry = *i;
+ QString entry = *i;
+ if ( myCompoundToRemove.contains( entry ))
+ continue;
+ if ( !mainEntry.isEmpty() && !entry.startsWith( mainEntry ))
+ {
+ h_data.myErrorMsg = "Compound group is not defined on the main geometry";
+ ok = false;
+ break;
+ }
h->SetCompoundOnEntry(entry.toLatin1().constData());
}
for (QSet<QString>::const_iterator i = myCompoundToRemove.begin(); i != myCompoundToRemove.end(); ++i)
bool mySecondOrder;
double mySizeFactor,myMaxSize, myMinSize;
QString myMaxSizeVar, myMinSizeVar, mySmouthStepsVar, mySizeFactorVar;
+ mutable QString myErrorMsg;
} GmshHypothesisData;
/*!
<source>ICON_DLG_GMSH_PARAMETERS_2D</source>
<translation>gmsh.png</translation>
</message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_GMSH</source>
+ <translation>gmsh_small.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_GMSH_2D</source>
+ <translation>gmsh_small.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_GMSH_Parameters_2D</source>
+ <translation>gmsh_small.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_GMSH_Parameters_2D</source>
+ <translation>gmsh_small.png</translation>
+ </message>
</context>
</TS>