GEOM::GEOM_Gen_var aGEOMEngine = HYDROData_GeomTool::GetGeomGen();
SALOMEDS::Study_var aDSStudy = HYDROData_GeomTool::GetStudyByID( theStudyId );
- QString aGeomObjEntry;
- bool isOK = Export( aGEOMEngine, aDSStudy, aGeomObjEntry );
+ QString aGeomObjEntry, anErrorMsg;
+ bool isOK = Export( aGEOMEngine, aDSStudy, aGeomObjEntry, anErrorMsg );
return isOK ? aGeomObjEntry : QString();
}
bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
SALOMEDS::Study_ptr theStudy,
- QString& theGeomObjEntry ) const
+ QString& theGeomObjEntry,
+ QString& theErrorMsg ) const
{
HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroupsDefs;
}
// Get faces
+ bool isAllNotSubmersible = true;
TopTools_ListOfShape aFaces;
HYDROData_SequenceOfObjects aCaseRegions = GetRegions( false );
HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
if( aRegion.IsNull() || !aRegion->IsSubmersible() )
continue;
+
+ if ( isAllNotSubmersible )
+ isAllNotSubmersible = false;
TopoDS_Shape aRegionShape = aRegion->GetShape( &aSeqOfGroupsDefs );
aFaces.Append( aRegionShape );
}
- return Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs, theGeomObjEntry );
+ bool aRes = false;
+
+ if ( aCaseRegions.IsEmpty() ) {
+ theErrorMsg = QString("the list of regions is empty.");
+ } else if ( isAllNotSubmersible ) {
+ theErrorMsg = QString("there are no submersible regions.");
+ } else {
+ aRes = Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs, theGeomObjEntry );;
+ }
+
+ return aRes;
}
bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
* Exports the calculation case data (shell and groups) to GEOM module.
* \param theGeomEngine GEOM module engine
* \param theStudy SALOMEDS study, is used for publishing of GEOM objects
+ * \param theGeomObjEntry the published GEOM object entry
+ * \param theErrorMsg the error message
* \return true in case of success
*/
HYDRODATA_EXPORT virtual bool Export( GEOM::GEOM_Gen_var theGeomEngine,
SALOMEDS::Study_ptr theStudy,
- QString& theGeomObjEntry ) const;
+ QString& theGeomObjEntry,
+ QString& theErrorMsg ) const;
public:
// Public methods to work with Calculation services
dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
// Export
+ QString anErrorMsg;
if ( aStudy ) {
SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy->studyDS() );
GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
QString anEntry;
- if ( aCalculation->Export( aGeomEngine, aDSStudy, anEntry ) ) {
+ if ( aCalculation->Export( aGeomEngine, aDSStudy, anEntry, theErrorMsg ) ) {
theUpdateFlags = UF_ObjBrowser;
isOk = true;
}