#define EXPORT_NAME "HYDRO_" + GetName()
+#include <SALOME_NamingService.hxx>
+#include <SALOME_LifeCycleCORBA.hxx>
+
+
+
+
+
IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
return aNewGroup;
}
+QString HYDROData_CalculationCase::Export( int theStudyId ) const
+{
+ int argc = 0;
+ char** argv = 0;
+ CORBA::ORB_var anORB = CORBA::ORB_init( argc, argv, "omniORB4"/*CORBA::ORB_ID*/ );
+ SALOME_NamingService aNameService( anORB );
+ SALOME_LifeCycleCORBA aLCC( &aNameService );
+ Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component( "FactoryServer", "GEOM" );
+ GEOM::GEOM_Gen_var aGEOMEngine = GEOM::GEOM_Gen::_narrow( aComponent );
+
+ CORBA::Object_var aSMObject = aNameService.Resolve("/myStudyManager");
+ SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject);
+ SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID( theStudyId );
+
+ QString aGeomObjEntry;
+ bool isOK = Export( aGEOMEngine, aDSStudy, aGeomObjEntry );
+ return isOK ? aGeomObjEntry : QString();
+}
+
bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
- SALOMEDS::Study_ptr theStudy ) const
+ SALOMEDS::Study_ptr theStudy,
+ QString& theGeomObjEntry ) const
{
HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroupsDefs;
aFaces.Append( aRegionShape );
}
- return Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs );
+ return Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs, theGeomObjEntry );
}
bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
SALOMEDS::Study_ptr theStudy,
const TopTools_ListOfShape& theFaces,
- const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs ) const
+ const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs,
+ QString& theGeomObjEntry ) const
{
// Sew faces
BRepBuilderAPI_Sewing aSewing( Precision::Confusion() * 10.0 );
// Publish the sewed shape
QString aName = EXPORT_NAME;
GEOM::GEOM_Object_ptr aMainShape =
- publishShapeInGEOM( theGeomEngine, theStudy, aSewedShape, aName );
+ publishShapeInGEOM( theGeomEngine, theStudy, aSewedShape, aName, theGeomObjEntry );
if ( aMainShape->_is_nil() )
return false;
GEOM::GEOM_Object_ptr HYDROData_CalculationCase::publishShapeInGEOM(
GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy,
- const TopoDS_Shape& theShape, const QString& theName ) const
+ const TopoDS_Shape& theShape, const QString& theName,
+ QString& theGeomObjEntry ) const
{
+ theGeomObjEntry = "";
GEOM::GEOM_Object_var aGeomObj;
if ( theGeomEngine->_is_nil() || theStudy->_is_nil() ||
if ( aResultSO->_is_nil() ) {
aGeomObj = GEOM::GEOM_Object::_nil();
}
+ else
+ theGeomObjEntry = aResultSO->GetID();
}
return aGeomObj._retn();
myLastWarning.Data = theData;
}
-int HYDROData_CalculationCase::GetRulesCount() const
-{
- TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomRules );
- return HYDROData_PriorityQueue::GetRulesCount( aRulesLab );
-}
-
bool HYDROData_CalculationCase::GetRule( int theIndex,
Handle(HYDROData_Object)& theObject1,
HYDROData_PriorityType& thePriority,