]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To provide a way for temporary disable of the try-catch mechanism
authorapo <apo@opencascade.com>
Tue, 27 Dec 2005 14:18:20 +0000 (14:18 +0000)
committerapo <apo@opencascade.com>
Tue, 27 Dec 2005 14:18:20 +0000 (14:18 +0000)
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh

index 4191181540ade7a243d36615b09cfd52a373d763..c48f47df10d69c5d0ba04a1a61a28c2d99ad1108 100644 (file)
@@ -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"<<exc.what());
+      throw;
+    }catch(...){
+      INFOS("Unknown exception was occured!");
+      throw;
+    }
+#endif
+    return false;
+  }
+
   VISU_Gen_i::~VISU_Gen_i(){
     if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i");
   }
index 4ad14670fc04f9b9afe1344848805c50f41e976d..2be677ade9e6fc98e6fd3181080402d72b461877 100644 (file)
 #include "SALOME_Component_i.hxx"
 #include "SALOME_NamingService.hxx"
 
-namespace VISU{
+namespace VISU
+{
   class Result_i;
+  class ColoredPrs3d_i;
+
+  bool
+  CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
+                   const char* theMeshName, 
+                   VISU::Entity theEntity,
+                   const char* theFieldName, 
+                   CORBA::Double theIteration);
+
   class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
                     public virtual ::Engines_Component_i,
                     public virtual Base_i
@@ -31,34 +41,85 @@ namespace VISU{
               QMutex* theMutex);
     virtual ~VISU_Gen_i();
 
-    virtual char* GetID();
-    virtual VISU::VISUType GetType() { return VISU::TVISUGEN;};
+    virtual 
+    char* 
+    GetID();
+
+    virtual
+    VISU::VISUType 
+    GetType() { return VISU::TVISUGEN;};
+
+    virtual
+    void
+    SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
 
-    virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
-    virtual SALOMEDS::Study_ptr GetCurrentStudy();
+    virtual
+    SALOMEDS::Study_ptr
+    GetCurrentStudy();
 
-    virtual ViewManager_ptr GetViewManager();
+    virtual
+    ViewManager_ptr
+    GetViewManager();
 
-    virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName);
-    virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName );
+    virtual
+    SALOMEDS::SObject_ptr
+    ImportTables(const char* theFileName);
+
+    virtual
+    CORBA::Boolean
+    ExportTableToFile(SALOMEDS::SObject_ptr theTable, 
+                     const char* theFileName );
 
     //Create Result
-    virtual Result_ptr ImportFile(const char* theFileName);
-    virtual Result_ptr CreateResult(const char* theFileName);
-    virtual Result_ptr CopyAndImportFile(const char* theFileName);
-    virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
-    virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
+    virtual 
+    Result_ptr
+    ImportFile(const char* theFileName);
+
+    virtual
+    Result_ptr
+    CreateResult(const char* theFileName);
+
+    virtual
+    Result_ptr
+    CopyAndImportFile(const char* theFileName);
+
+    virtual
+    Result_ptr
+    ImportMed(SALOMEDS::SObject_ptr theMedSObject);
+
+    virtual
+    Result_ptr
+    ImportMedField(SALOME_MED::FIELD_ptr theField);
+
 
     //Create Presentation Of Submeshes
-    virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity);
-    virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
-                                       VISU::Entity theEntity, const char* theFamilyName);
-    virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName);
+    virtual
+    Mesh_ptr
+    MeshOnEntity(Result_ptr theResult, 
+                const char* theMeshName, 
+                VISU::Entity theEntity);
+
+    virtual
+    Mesh_ptr
+    FamilyMeshOnEntity(Result_ptr theResult, 
+                      const char* theMeshName,
+                      VISU::Entity theEntity, 
+                      const char* theFamilyName);
+
+    virtual
+    Mesh_ptr
+    GroupMesh(Result_ptr theResult, 
+             const char* theMeshName, 
+             const char* theGroupName);
 
     //Create 3D collored Presentation Of Different Types
     template<typename TPrs3d_i> 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<Result_i*>(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<Result_i*>(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> 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