From 53e11d6c377068616cc937469d8fbff30c7470c8 Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 27 Dec 2005 14:18:20 +0000 Subject: [PATCH] To provide a way for temporary disable of the try-catch mechanism --- src/VISU_I/VISU_Gen_i.cc | 28 ++- src/VISU_I/VISU_Gen_i.hh | 367 ++++++++++++++++++++++++++++----------- 2 files changed, 292 insertions(+), 103 deletions(-) diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 41911815..c48f47df 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -91,6 +91,7 @@ static QFileInfo aFileInfo; #ifdef _DEBUG_ static int MYDEBUG = 0; +#define _DEXCEPT_ #else static int MYDEBUG = 0; #endif @@ -108,7 +109,8 @@ extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, return aVISU_Gen->_this(); } -namespace VISU{ +namespace VISU +{ static string VisuTmpDir; static CORBA::Boolean myIsMultiFile; @@ -227,6 +229,30 @@ namespace VISU{ if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : there is no opened study in StudyManager !!!"); } + bool + CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { +#ifndef _DEXCEPT_ + try{ +#endif + if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration))) + return true; +#ifndef _DEXCEPT_ + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"< TPrs3d_i* - CreatePrs3d(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true) + CreatePrs3d(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration, + bool theAddToStudy = true) { if(myStudyDocument->GetProperties()->IsLocked()) return NULL; @@ -66,14 +127,11 @@ namespace VISU{ typedef typename TPrs3d_i::TInterface TPrs3d; typename TPrs3d::_var_type aPrs3d; Mutex mt(myMutex); - if(Result_i* pResult = dynamic_cast(GetServant(theResult).in())){ - if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){ - TPrs3d_i* aPresent = new TPrs3d_i(pResult,theAddToStudy); - try{ - if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration))) - return aPresent; - }catch(...){ - } + if(Result_i* aResult = dynamic_cast(GetServant(theResult).in())){ + if(TPrs3d_i::IsPossible(aResult,theMeshName,theEntity,theFieldName,int(theIteration))){ + TPrs3d_i* aPresent = new TPrs3d_i(aResult,theAddToStudy); + if(CreatColoredPrs3d(aPresent,theMeshName,theEntity,theFieldName,theIteration)) + return aPresent; aPresent->_remove_ref(); } } @@ -81,8 +139,12 @@ namespace VISU{ } template typename TPrs3d_i::TInterface::_var_type - Prs3dOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true) + Prs3dOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration, + bool theAddToStudy = true) { typedef typename TPrs3d_i::TInterface TPrs3d; typename TPrs3d::_var_type aPrs3d; @@ -91,41 +153,104 @@ namespace VISU{ return TPrs3d::_nil(); } - virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual GaussPoints_ptr GaussPointsOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual Vectors_ptr VectorsOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual CutLines_ptr CutLinesOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual Plot3D_ptr Plot3DOnField(Result_ptr theResult, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); + virtual + ScalarMap_ptr + ScalarMapOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + + virtual + GaussPoints_ptr + GaussPointsOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + + virtual + DeformedShape_ptr + DeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + + virtual + Vectors_ptr + VectorsOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + + virtual + IsoSurfaces_ptr + IsoSurfacesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + + virtual + CutPlanes_ptr + CutPlanesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + + virtual + CutLines_ptr + CutLinesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + + virtual + StreamLines_ptr + StreamLinesOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + + virtual + Plot3D_ptr + Plot3DOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration); + //Create Digital Presentation - virtual Table_ptr CreateTable(const char* theTableEntry); - virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow); - virtual Container_ptr CreateContainer(); - virtual Animation_ptr CreateAnimation(View3D_ptr theView3d); + virtual + Table_ptr + CreateTable(const char* theTableEntry); - virtual void DeleteResult(Result_ptr theResult); - virtual void DeletePrs3d(Prs3d_ptr thePrs3d); + virtual + Curve_ptr + CreateCurve(Table_ptr theTable, + CORBA::Long theHRow, + CORBA::Long theVRow); + + virtual + Container_ptr + CreateContainer(); + + virtual + Animation_ptr + CreateAnimation(View3D_ptr theView3d); + + virtual + void + DeleteResult(Result_ptr theResult); + + virtual + void + DeletePrs3d(Prs3d_ptr thePrs3d); // inherited methods from Engines::Component virtual @@ -133,47 +258,85 @@ namespace VISU{ DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean theIsPublished, CORBA::Boolean& theIsValidScript); + // inherited methods from SALOMEDS::Driver - virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool isMultiFile); - virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool isMultiFile); - virtual bool Load(SALOMEDS::SComponent_ptr, - const SALOMEDS::TMPFile &, - const char* theURL, - bool isMultiFile); - virtual bool LoadASCII(SALOMEDS::SComponent_ptr, - const SALOMEDS::TMPFile &, - const char* theURL, - bool isMultiFile); - - virtual void Close(SALOMEDS::SComponent_ptr IORSComponent); - - virtual char* ComponentDataType(); - - virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, - const char* IORString, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII); - virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, - const char* aLocalPersistentID, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII); - - virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR); - virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, - CORBA::Object_ptr theObject, - const char* theName) throw (SALOME::SALOME_Exception); - - CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject); - SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID); - CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID); - SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream, - CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theObject); + virtual + SALOMEDS::TMPFile* + Save(SALOMEDS::SComponent_ptr theComponent, + const char* theURL, + bool isMultiFile); + + virtual + SALOMEDS::TMPFile* + SaveASCII(SALOMEDS::SComponent_ptr theComponent, + const char* theURL, + bool isMultiFile); + + virtual + bool + Load(SALOMEDS::SComponent_ptr, + const SALOMEDS::TMPFile &, + const char* theURL, + bool isMultiFile); + + virtual + bool + LoadASCII(SALOMEDS::SComponent_ptr, + const SALOMEDS::TMPFile &, + const char* theURL, + bool isMultiFile); + + virtual + void + Close(SALOMEDS::SComponent_ptr IORSComponent); + + virtual + char* + ComponentDataType(); + + virtual + char* + IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, + const char* IORString, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII); + + virtual + char* + LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, + const char* aLocalPersistentID, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII); + + virtual + bool + CanPublishInStudy(CORBA::Object_ptr theIOR); + + virtual + SALOMEDS::SObject_ptr + PublishInStudy(SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theSObject, + CORBA::Object_ptr theObject, + const char* theName) throw (SALOME::SALOME_Exception); + + CORBA::Boolean + CanCopy(SALOMEDS::SObject_ptr theObject); + + SALOMEDS::TMPFile* + CopyFrom(SALOMEDS::SObject_ptr theObject, + CORBA::Long& theObjectID); + + CORBA::Boolean + CanPaste(const char* theComponentName, + CORBA::Long theObjectID); + + SALOMEDS::SObject_ptr + PasteInto(const SALOMEDS::TMPFile& theStream, + CORBA::Long theObjectID, + SALOMEDS::SObject_ptr theObject); }; } + +#undef _VISU_GEN_DEXCEPT_ + #endif -- 2.39.2