]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merge with version on tag OCC-V2_1_0d
authoradmin <salome-admin@opencascade.com>
Wed, 1 Dec 2004 10:50:47 +0000 (10:50 +0000)
committeradmin <salome-admin@opencascade.com>
Wed, 1 Dec 2004 10:50:47 +0000 (10:50 +0000)
53 files changed:
INSTALL
adm_local/unix/config_files/check_Med.m4
bin/VERSION
doc/salome/tui/VISU/HTML/VISU_Gen.html
doc/salome/tui/VISU/doxyfile
doc/salome/tui/VISU/sources/static/tree.js
idl/VISU_Gen.idl
resources/VISUCatalog.xml
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/ENGINE/Makefile.in
src/ENGINE/VISU_Engine_i.cc
src/ENGINE/VISU_Engine_i.hh
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_Actor.h
src/OBJECT/VISU_MeshAct.cxx
src/OBJECT/VISU_MeshAct.h
src/OBJECT/VISU_ScalarMapAct.cxx
src/OBJECT/VISU_VectorsAct.cxx
src/PIPELINE/VISUPipeLine.cxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/VISUGUI/Makefile.in
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_EditContainerDlg.cxx
src/VISUGUI/VisuGUI_InitMeshDlg.cxx
src/VISUGUI/VisuGUI_ScalarBarDlg.cxx
src/VISUGUI/VisuGUI_Selection.cxx
src/VISU_I/Makefile.in
src/VISU_I/VISUConfig.cc
src/VISU_I/VISUConfig.hh
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_CorbaMedConvertor.hxx
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_Result_i.hh
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_Table_i.cc
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_Vectors_i.cc
src/VISU_I/VISU_ViewManager_i.cc
src/VISU_I/VISU_ViewManager_i.hh
src/VISU_SWIG/Makefile.in
src/VISU_SWIG/visu.py
src/VISU_SWIG/visu_delete.py [new file with mode: 0644]

diff --git a/INSTALL b/INSTALL
index a1ae4a8a8ccf613864509f37ee32085b3226648c..56f49b1dd8f7cae1453d4f23c884fc43bde2bec4 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-This is the version 2.0.0 of VISU
+This is the version 2.1.0 of VISU
 Compatible with :
-       - KERNEL 2.0.0
-       - MED 2.0.0
+       - KERNEL 2.1.0
+       - MED 2.1.0
index 49272705302c59cc4c61a4feee2de1ccb57092d9..727bf4381b53e544f1eb59b39e1cc0463030b326 100644 (file)
@@ -22,20 +22,11 @@ if test "x$MED_DIR" == "x" ; then
     # MED_ROOT_DIR environment variable defined
       MED_DIR=$MED_ROOT_DIR
 
-   else
-
-    # search Med binaries in PATH variable
-      AC_PATH_PROG(TEMP, libMEDMEM_Swig.py)
-      if test "x$TEMP" != "x" ; then
-         MED_BIN_DIR=`dirname $TEMP`
-         MED_DIR=`dirname $MED_BIN_DIR`
-      fi
-      
    fi
 # 
 fi
 
-if test -f ${MED_DIR}/bin/salome/libMEDMEM_Swig.py ; then
+if test -f ${MED_DIR}/idl/salome/MED.idl ; then
    Med_ok=yes
    AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
 
index 5b88fed55ea71973e356ee51dd6ee4beb165b350..1369d8c2a4f4490a10b20b832cd495af8bb9cf85 100755 (executable)
@@ -1 +1 @@
-THIS IS SALOME - VISU VERSION: 2.0.0
+THIS IS SALOME - VISU VERSION: 2.1.0
index 13cb79cea6336b7a258fc99e94c9612e04cd0833..5d4af0b62760aab7519bf38cefd2708e6b06166c 100644 (file)
 <td width="50%" bgcolor= "lightgreen" ><font size="+2"><div align="center"><b><i>IDL file</i></b></div></font></td>
 <td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
 </tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void Destroy (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>Destroy (  )</b></div></td>
-</tr>
 </table><br>
 <table width="100%" BORDER>
 <tr bgcolor="#FFFFCC">
 <td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetScalarMode ( in long theScaling )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetScalarMode ( theScaling )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetScalarMode ( in long theScalarMode )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetScalarMode ( theScalarMode )</b></div></td>
 </tr>
 <tr>
 <td bgcolor= "lightgreen"><div align="center"><b>long  GetScalarMode (  )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = GetMax (  )</b></div></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientation ( in Orientation theOrientation )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetOrientation ( theOrientation )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetBarOrientation ( in Orientation theOrientation )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetBarOrientation ( theOrientation )</b></div></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>Orientation  GetOrientation (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetOrientation (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>Orientation  GetBarOrientation (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetBarOrientation (  )</b></div></td>
 </tr>
 <tr>
 <td bgcolor= "lightgreen"><div align="center"><b>void SetPosition ( in double X, in double Y )</b></div></td>
 <td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientationType ( in Orientation theNb )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetOrientationType ( theNb )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientation ( in Orientation theOrientation, in double theXAngle, in double theYAngle )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetOrientation ( theOrientation, theXAngle, theYAngle )</b></div></td>
 </tr>
 <tr>
 <td bgcolor= "lightgreen"><div align="center"><b>Orientation  GetOrientationType (  )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = GetOrientationType (  )</b></div></td>
 </tr>
 <tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateX (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX (  )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateY (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY (  )</b></div></td>
+</tr>
+<tr>
 <td bgcolor= "lightgreen"><div align="center"><b>void SetDisplacement ( in double theDisp )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>SetDisplacement ( theDisp )</b></div></td>
 </tr>
 <td bgcolor= "lightgreen"><div align="center"><b>long  GetNbPlanes (  )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = GetNbPlanes (  )</b></div></td>
 </tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateX ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateX ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateX (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX (  )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateY ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateY ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateY (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY (  )</b></div></td>
-</tr>
 </table><br>
 <table width="100%" BORDER>
 <tr bgcolor="#FFFFCC">
 <td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientationType ( in Orientation theNb )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetOrientationType ( theNb )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientation ( in Orientation theOrientation, in double theXAngle, in double theYAngle )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetOrientation ( theOrientation, theXAngle, theYAngle )</b></div></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientationType2 ( in Orientation theNb )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetOrientationType2 ( theNb )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetOrientation2 ( in Orientation theOrientation, in double theXAngle, in double theYAngle )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetOrientation2 ( theOrientation, theXAngle, theYAngle )</b></div></td>
 </tr>
 <tr>
 <td bgcolor= "lightgreen"><div align="center"><b>Orientation  GetOrientationType (  )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = GetOrientationType2 (  )</b></div></td>
 </tr>
 <tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateX (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX (  )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateX2 (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX2 (  )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateY (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY (  )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateY2 (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY2 (  )</b></div></td>
+</tr>
+<tr>
 <td bgcolor= "lightgreen"><div align="center"><b>void SetDisplacement ( in double theDisp )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>SetDisplacement ( theDisp )</b></div></td>
 </tr>
 <td bgcolor= "lightgreen"><div align="center"><b>long  GetNbLines (  )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = GetNbLines (  )</b></div></td>
 </tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateX ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateX ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateX2 ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateX2 ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateX (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX (  )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateX2 (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateX2 (  )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateY ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateY ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetRotateY2 ( in double theAngle )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetRotateY2 ( theAngle )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateY (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY (  )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double  GetRotateY2 (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetRotateY2 (  )</b></div></td>
-</tr>
 </table><br>
 <table width="100%" BORDER>
 <tr bgcolor="#FFFFCC">
 <td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetDirection ( in Direction theDirection )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetDirection ( theDirection )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>Direction  GetDirection (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetDirection (  )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetStepLength ( in double theStep )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetStepLength ( theStep )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double  GetStepLength (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetStepLength (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>boolean  SetParams ( in double theIntStep, in double thePropogationTime, in double theStepLength, in Prs3d thePrs3d, in double thePercents, in Direction theDirection )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = SetParams ( theIntStep, thePropogationTime, theStepLength, thePrs3d, thePercents, theDirection )</b></div></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetPropagationTime ( in double theTime )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetPropagationTime ( theTime )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>double  GetIntegrationStep (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetIntegrationStep (  )</b></div></td>
 </tr>
 <tr>
 <td bgcolor= "lightgreen"><div align="center"><b>double  GetPropagationTime (  )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = GetPropagationTime (  )</b></div></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetIntegrationStep ( in double theStep )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetIntegrationStep ( theStep )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>double  GetIntegrationStep (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetIntegrationStep (  )</b></div></td>
-</tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetSource ( in Prs3d thePrs3d )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetSource ( thePrs3d )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>double  GetStepLength (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetStepLength (  )</b></div></td>
 </tr>
 <tr>
 <td bgcolor= "lightgreen"><div align="center"><b>Prs3d  GetSource (  )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = GetSource (  )</b></div></td>
 </tr>
 <tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void SetUsedPoints ( in double thePercents )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>SetUsedPoints ( thePercents )</b></div></td>
-</tr>
-<tr>
 <td bgcolor= "lightgreen"><div align="center"><b>double  GetUsedPoints (  )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = GetUsedPoints (  )</b></div></td>
 </tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>Direction  GetDirection (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetDirection (  )</b></div></td>
+</tr>
 </table><br>
 <table width="100%" BORDER>
 <tr bgcolor="#FFFFCC">
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = ImportTables ( theFileName )</b></div></td>
 </tr>
 <tr>
+<td bgcolor= "lightgreen"><div align="center"><b>boolean  ExportTableToFile ( in SObject theTable, in string theFileName )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = ExportTableToFile ( theTable, theFileName )</b></div></td>
+</tr>
+<tr>
 <td bgcolor= "lightgreen"><div align="center"><b>Result  ImportFile ( in string theFileName )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = ImportFile ( theFileName )</b></div></td>
 </tr>
 <tr>
+<td bgcolor= "lightgreen"><div align="center"><b>Result  CopyAndImportFile ( in string theFileName )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = CopyAndImportFile ( theFileName )</b></div></td>
+</tr>
+<tr>
 <td bgcolor= "lightgreen"><div align="center"><b>Result  ImportMed ( in SObject theMedSObject )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = ImportMed ( theMedSObject )</b></div></td>
 </tr>
 <td bgcolor= "lightgreen"><div align="center"><b>Animation  CreateAnimation ( in View3D theView3d )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>return_value = CreateAnimation ( theView3d )</b></div></td>
 </tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void DeleteResult ( in Result theResult )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>DeleteResult ( theResult )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void DeletePrs3d ( in Prs3d thePrs3d )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>DeletePrs3d ( thePrs3d )</b></div></td>
+</tr>
 </table><br>
 <table width="100%" BORDER>
 <tr bgcolor="#FFFFCC">
 <td width="50%" bgcolor= "lightgreen"><font size="+2"><div align="center"><b><i>Python</i></b></div></font></td>
 </tr>
 <tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void ShowPart ( in ViewRepresentation ViewRepr, in boolean state )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>ShowPart ( ViewRepr, state )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>boolean  IsPartShown ( in ViewRepresentation ViewRepr )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = IsPartShown ( ViewRepr )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetViewWidth ( in long Width )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetViewWidth ( Width )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetViewHeight ( in long Height )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetViewHeight ( Height )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>long  GetViewWidth (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetViewWidth (  )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>long  GetViewHeight (  )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>return_value = GetViewHeight (  )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetViewPositionHorizontal ( in ViewPosition ViewPosHor )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetViewPositionHorizontal ( ViewPosHor )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetViewPositionVertical ( in ViewPosition ViewPosVer )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetViewPositionVertical ( ViewPosVer )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetRelativePosition ( in double x, in double y )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetRelativePosition ( x, y )</b></div></td>
+</tr>
+<tr>
+<td bgcolor= "lightgreen"><div align="center"><b>void SetRelativeSize ( in double x, in double y )</b></div></td>
+<td bgcolor= "lightgreen"><div align="center"><b>SetRelativeSize ( x, y )</b></div></td>
+</tr>
+<tr>
 <td bgcolor= "lightgreen"><div align="center"><b>void SetTitle ( in string theTitle )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>SetTitle ( theTitle )</b></div></td>
 </tr>
 <td bgcolor= "lightgreen"><div align="center"><b>void Destroy ( in View theView )</b></div></td>
 <td bgcolor= "lightgreen"><div align="center"><b>Destroy ( theView )</b></div></td>
 </tr>
-<tr>
-<td bgcolor= "lightgreen"><div align="center"><b>void ProcessEvents (  )</b></div></td>
-<td bgcolor= "lightgreen"><div align="center"><b>ProcessEvents (  )</b></div></td>
-</tr>
 </table><br>
 </b></HTML>
index 81569276de5ce7b1d5d51d69143699cbf5f2c3c4..3ee35aeac5ac3d7e1407955243367dd79c02ee55 100755 (executable)
@@ -3,7 +3,7 @@
 #---------------------------------------------------------------------------
 # General configuration options
 #---------------------------------------------------------------------------
-PROJECT_NAME           = "SALOME - VISU - v.2.0.0"
+PROJECT_NAME           = "SALOME - VISU - v.2.1.0"
 PROJECT_NUMBER         = id#1.1
 OUTPUT_DIRECTORY       = ../
 OUTPUT_LANGUAGE        = English
index 264bfe2d3d0757c47b6d0b1ad8272df13099c2fd..72b94f7c895d9b4e904c7b7c074a963602410844 100755 (executable)
@@ -1,4 +1,4 @@
-foldersTree = gFld("<b>SALOME v.2.0.0 </b>", "", "")
+foldersTree = gFld("<b>SALOME v.2.1.0 </b>", "", "")
      insDoc(foldersTree, gLnk("Main Page", "", "main.html"))
 
 aux1 = insFld(foldersTree, gFld("TUI Reference Guide", ""))
index a01a2bb9093db3a20beeaab7c343d4f78614841c..f27a904b46c35fe0c250e07be0fea1cb8af90421 100644 (file)
@@ -961,14 +961,6 @@ post-processing presentations from given %Result and %Table object reference, us
 provided by %ViewManager.
 */
    interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base{
-/*! SAN & VSR : Test QT_EVENT 
->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-*/
-     void CreateTestView();
-     void ShowTestObject();
-/*! SAN & VSR : Test QT_EVENT
-<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-*/
 /*! Sets a definite study to be current.
 */
      void SetCurrentStudy(in SALOMEDS::Study theStudy);
@@ -1123,6 +1115,11 @@ Creates a presentation form containing an array of references to the curves.
 \param theView3d The 3D view, where the animation will be rendered.
 */
      Animation CreateAnimation(in View3D theView3d);
+
+     void DeleteResult(in Result theResult);
+
+     void DeletePrs3d(in Prs3d thePrs3d);
+
   };
 /*! \brief %View interface
 
@@ -1131,6 +1128,29 @@ Creates a presentation form containing an array of references to the curves.
  %View interface is a base for all types of %view interfaces.
 */
   interface View: Base{
+
+    enum ViewRepresentation { OBJECTBROWSER, VIEWER, PYTHON, MESSAGES }; // displaying part ("ALL" isn't setable)
+
+    void ShowPart (in ViewRepresentation ViewRepr, in boolean state );
+
+    boolean IsPartShown( in ViewRepresentation ViewRepr );
+
+    void SetViewWidth (in long Width); //setting width of view
+    void SetViewHeight (in long Height); //setting height of view 
+
+    long GetViewWidth(); //getting view width
+
+    long GetViewHeight(); //getting view height
+    
+    enum ViewPosition {TOP, CENTER, BOTTOM, RIGHT, LEFT}; //position of the study frame
+    
+    void SetViewPositionHorizontal (in ViewPosition ViewPosHor); //setting of the horizontal view position
+   
+    void SetViewPositionVertical (in ViewPosition ViewPosVer); //setting of the vertical view position
+
+    void SetRelativePosition( in double x, in double y );
+    void SetRelativeSize( in double x, in double y );
 /*!
 Sets the title of the %View frame.
 \param theTitle String parameter defining the title of the %View frame.
index 46eb84b282efdb8233c27e3c5f62d1136fefc94a..7c59871e9968ee3c8fdc2e4263a80a293e46d7ef 100644 (file)
@@ -16,7 +16,7 @@
                <component-username>Post-Pro</component-username>
                <component-type>VISU</component-type>
                <component-author>NRI</component-author>
-               <component-version> 1.0</component-version>
+               <component-version>2.1.0</component-version>
                <component-comment>Visu component - Maquette septembre</component-comment>
                <component-multistudy>1</component-multistudy>
                <component-icone>ModuleVisu.png</component-icone>
index 79856149c9b8d9a36bc88dcf14e55fbf82eca278..24f787c28ac3ae13550d571c254715ebfa9f623c 100644 (file)
@@ -45,7 +45,7 @@ static int MYDEBUG = 0;
 
 void parseFile(const char* theFileName) {
   try{
-    cout<<"'"<<theFileName<<"'...\n";
+    MESSAGE("'"<<theFileName<<"'...");
     auto_ptr<VISU_Convertor> aCon(CreateConvertor(theFileName));
     //aCon->GetSize();
     //return;
@@ -104,11 +104,11 @@ void parseFile(const char* theFileName) {
       }
     }
   OK:
-    cout<<"OK"<<endl;
-  }catch(std::runtime_error& exc){
-    MESSAGE("Follow exception was accured in file:"<<theFileName<<"\n"<<exc.what());
+    MESSAGE("OK");
+  }catch(std::exception& exc){
+    MESSAGE("Follow exception was occured in file:"<<theFileName<<"\n"<<exc.what());
   }catch(...){
-    MESSAGE("Unknown exception was accured in VISU_Convertor_impl in file:"<<theFileName);
+    MESSAGE("Unknown exception was occured in VISU_Convertor_impl in file:"<<theFileName);
   } 
 }
 
@@ -132,10 +132,10 @@ int main(int argc, char** argv){
       }
       return 0;
     }
-  }catch(std::runtime_error& exc){
-    cout<<"Follow exception was accured :\n"<<exc.what()<<endl;
+  }catch(std::exception& exc){
+    MESSAGE("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    cout<<"Unknown exception was accured in VISU_Convertor_impl"<<endl;
+    MESSAGE("Unknown exception was occured in VISU_Convertor_impl");
   } 
   return 1;
 }
index 97fddf99d2bab3d749a907aa2ecc50c4322592e3..1e3aaa6119ae8ba1dbd3760001c9b6d5e2351b99 100644 (file)
@@ -163,7 +163,7 @@ namespace{
        int aMeshDimension = theMesh.myDim;
        bool anIsDimPresent[3] = {false, false, false};
        for(int iDim = 0; iDim < aMeshDimension; iDim++){
-         string aDimName = theMesh.myPointsDim.at(iDim);
+         string aDimName = theMesh.myPointsDim[iDim];
          if(aDimName == "x" || aDimName == "X")
            anIsDimPresent[eX] = true;
          else if(aDimName == "y" || aDimName == "Y")
@@ -646,12 +646,12 @@ VISU_Convertor_impl::GetTimeStampOnMesh(const string& theMeshName,
        //anExtractFilter->DebugOn();
        try{
          LoadMeshOnEntity(*pVTKMeshOnEntity);
-       }catch(std::runtime_error& exc){
+       }catch(std::exception& exc){
          pVTKMeshOnEntity = pMeshOnEntity;
-         MESSAGE("Follow exception was accured :\n"<<exc.what());
+         MESSAGE("Follow exception was occured :\n"<<exc.what());
        }catch(...){
          pVTKMeshOnEntity = pMeshOnEntity;
-         MESSAGE("Unknown exception was accured!");
+         MESSAGE("Unknown exception was occured!");
        }
        GetMeshOnEntity(pVTKMeshOnEntity->myMeshName,pVTKMeshOnEntity->myEntity);
        
index 320f6a4bb0208bb017ae7897ceb2fbc9d7765056..d26a08ba6eb3d0b5c03765f46c2848498cad90d2 100644 (file)
@@ -24,7 +24,7 @@ LIB_MOC =
 LIB_SERVER_IDL = VISU_Gen.idl SALOME_Component.idl \
                  SALOME_Exception.idl SALOME_GenericObj.idl \
                  SALOME_Session.idl MED.idl
-LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl
+LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Comm.idl
 
 # Executables targets
 BIN = 
index fd0c065efad7e5408e9431ad738e9a705c098b4f..0edb9acc90f9f451edcb151180b283946f728754 100644 (file)
@@ -294,6 +294,16 @@ namespace VISU{
   }
 
 
+  void VISU_Gen_i::DeleteResult(Result_ptr theResult){
+    myVisuGen->DeleteResult(theResult);
+  }
+
+
+  void VISU_Gen_i::DeletePrs3d(Prs3d_ptr thePrs3d){
+    myVisuGen->DeletePrs3d(thePrs3d);
+  }
+
+
   void VISU_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent){
     myVisuGen->Close(theComponent);
   }
@@ -341,18 +351,4 @@ namespace VISU{
     return myVisuGen->PasteInto(theStream,theObjectID,theObject);
   }
 
-
-  /*! SAN & VSR : Test QT_EVENT 
-    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-  */
-  void VISU_Gen_i::CreateTestView() {
-    myVisuGen->CreateTestView();
-  }
-  void VISU_Gen_i::ShowTestObject() {
-    myVisuGen->ShowTestObject();
-  }
-  /*! SAN & VSR : Test QT_EVENT
-    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-  */
-
 };
index 10f96e14d4fb21ae80074e838de032c445ba25ed..8ad9db0f2b0812b61ed0e4d6ed6b9a689b1754ca 100644 (file)
@@ -87,6 +87,9 @@ namespace VISU{
     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 SALOMEDS::Driver
     virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
                                    const char* theURL,
@@ -128,14 +131,6 @@ namespace VISU{
     SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
                                    CORBA::Long theObjectID,
                                    SALOMEDS::SObject_ptr theObject);
-    /*! SAN & VSR : Test QT_EVENT 
-      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-    */
-    virtual void CreateTestView();
-    virtual void ShowTestObject();
-    /*! SAN & VSR : Test QT_EVENT
-      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-    */
   };
 };
 
index a3f440c72931120dd08d3b0d023fc7a41b68c8b9..74036d0c95feaf8803f1ee9f6f825a76415898b2 100644 (file)
 
 #include "VISU_Actor.h"
 #include "VISU_PipeLine.hxx"
+#include "SALOME_ShrinkFilter.h"
+#include "SALOME_GeometryFilter.h"
 #include "SALOME_PassThroughFilter.h"
-#include "utilities.h"
  
+#include <stdexcept>
+
 // VTK Includes
 #include <vtkProperty.h>
-#include <vtkDataSetMapper.h>
+
+#include <vtkDataSet.h>
+#include <vtkPolyData.h>
+#include <vtkUnstructuredGrid.h>
+
+#include <vtkShrinkFilter.h>
 #include <vtkShrinkPolyData.h>
+
+#include <vtkDataSetMapper.h>
 #include <vtkGeometryFilter.h>
 #include <vtkObjectFactory.h>
 
+#include "utilities.h"
+
 using namespace std;
 
 static int MYVTKDEBUG = 0;
@@ -64,23 +76,16 @@ VISU_Actor::VISU_Actor(){
 
   myIsShrunk = false;
   myIsShrinkable = false;
-  myShrinkFilter = vtkShrinkPolyData::New();
+  myShrinkFilter = SALOME_ShrinkFilter::New();
+  myShrinkFilter->SetStoreMapping(true);
+  SetShrinkFactor();
+  
+  myMapper = vtkDataSetMapper::New();
 
   myIO = NULL;
   myName = "";
 
-  ishighlighted = false;
-  IsHighlighting = true;
-  HighlightProperty = vtkProperty::New();
-  HighlightProperty->SetAmbient(0.5);            
-  HighlightProperty->SetDiffuse(0.3);            
-  HighlightProperty->SetSpecular(0.2);           
-  HighlightProperty->SetRepresentationToSurface();
-  HighlightProperty->SetAmbientColor(1, 1, 1);
-  HighlightProperty->SetDiffuseColor(1, 1, 1);
-  HighlightProperty->SetSpecularColor(0.5, 0.5, 0.5);
-
-  vtkProperty* aProperty = this->GetProperty();
+  vtkProperty* aProperty = GetProperty();
   aProperty->SetAmbient(0.5); 
   aProperty->SetDiffuse(0.2);
   aProperty->SetSpecular(0.2);
@@ -92,8 +97,12 @@ VISU_Actor::VISU_Actor(){
 
 VISU_Actor::~VISU_Actor(){
   SALOME_Actor::SetProperty(NULL);
-  HighlightProperty->Delete();
-  if(myPipeLine) myPipeLine->UnRegister(this);
+
+  myMapper->RemoveAllInputs();
+  myMapper->Delete();
+
+  if(myPipeLine) 
+    myPipeLine->UnRegister(this);
 
   myShrinkFilter->UnRegisterAllOutputs();
   myShrinkFilter->Delete();
@@ -130,10 +139,8 @@ void VISU_Actor::SetPipeLine(VISU_PipeLine* thePipeLine) {
     //Now, we use vtkShrinkPolyData (not vtkShrinkFilter), 
     //and the class there is no such limitation.
     
-    vtkDataSetMapper* aNewMapper = vtkDataSetMapper::New();
-    aNewMapper->SetInput(aDataSet);
-    SetMapper(aNewMapper);
-    aNewMapper->Delete();
+    myMapper->SetInput(aDataSet);
+    SetMapper(myMapper);
   }
 }
 
@@ -143,6 +150,8 @@ void VISU_Actor::SetParent(VISU_Actor* theParent){
 
 void VISU_Actor::SetRepresentation(int theMode) { 
   SALOME_Actor::SetRepresentation(theMode);
+  if(myRepresentation == VTK_POINTS)
+    UnShrink();
 }
 
 void VISU_Actor::SetOpacity(float theValue){
@@ -153,34 +162,41 @@ float VISU_Actor::GetOpacity(){
   return GetProperty()->GetOpacity();
 }
 
-void VISU_Actor::SetShrinkable(bool theIsShrinkable){
-  myIsShrinkable = theIsShrinkable;
-}
 
-void VISU_Actor::SetShrink(float theFactor){
+void VISU_Actor::SetShrink(){
   if(!myIsShrinkable) return;
-  //_CS_PhB operator []  if(vtkPolyData* aDataSet = myPassFilter.at(1)->GetPolyDataOutput()){
-  if(vtkPolyData* aDataSet = myPassFilter[1]->GetPolyDataOutput()){
-    myShrinkFilter->SetShrinkFactor(theFactor);
+  if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
     myShrinkFilter->SetInput(aDataSet);
-  //_CS_PhB operator [] myPassFilter.at(2)->SetInput(myShrinkFilter->GetOutput());
-    myPassFilter[2]->SetInput(myShrinkFilter->GetOutput());
+    myPassFilter[1]->SetInput(myShrinkFilter->GetOutput());
     myIsShrunk = true;
   }
 }
 
 void VISU_Actor::UnShrink(){
   if(!myIsShrunk) return;
-  //_CS_PhB operator [] if(vtkPolyData* aDataSet = myPassFilter.at(1)->GetPolyDataOutput()){
-  if(vtkPolyData* aDataSet = myPassFilter[1]->GetPolyDataOutput()){
-  //_CS_PhB operator []  myPassFilter.at(2)->SetInput(aDataSet);
-  //_CS_PhB operator []  myPassFilter.at(2)->Modified();
-    myPassFilter[2]->SetInput(aDataSet);
-    myPassFilter[2]->Modified();
+  if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
+    myPassFilter[1]->SetInput(aDataSet);
+    myPassFilter[1]->Modified();
     myIsShrunk = false;
+    Modified();
   }
 }
 
+void VISU_Actor::SetShrinkable(bool theIsShrinkable){
+  myIsShrinkable = theIsShrinkable;
+}
+
+void VISU_Actor::SetShrinkFactor(float theValue){
+  myShrinkFilter->SetShrinkFactor(theValue);
+  Modified();
+}
+
+float VISU_Actor::GetShrinkFactor(){
+  return myShrinkFilter->GetShrinkFactor();
+}
+
+
+//----------------------------------------------------------------------------
 void VISU_Actor::SetVisibility(int theMode){
   SALOME_Actor::SetVisibility(theMode);
 }
@@ -205,6 +221,7 @@ float VISU_Actor::GetLineWidth(){
   return GetProperty()->GetLineWidth();
 }
 
+//----------------------------------------------------------------------------
 void VISU_Actor::ShallowCopy(vtkProp *prop){
   VISU_Actor *anActor = VISU_Actor::SafeDownCast(prop);
   if(anActor != NULL){
@@ -214,21 +231,13 @@ void VISU_Actor::ShallowCopy(vtkProp *prop){
   SALOME_Actor::ShallowCopy(prop);
 }
 
-void VISU_Actor::highlight(Standard_Boolean highlight) {
-  if (this->IsHighlighting) {
-    if(highlight && !ishighlighted) {
-      ishighlighted=true;
-      this->SetProperty(HighlightProperty);
-    }else if (!highlight)
-      if(ishighlighted)        ishighlighted=false;
-  }
-}
-
-int VISU_Actor::GetObjId(int theVtkID){
-  if (GetRepresentation() == 0) return -1; // points    
-  return myGeomFilter->GetObjId(theVtkID);
+//----------------------------------------------------------------------------
+int VISU_Actor::GetNodeObjId(int theVtkID){
+  if ( myIsShrunk ) 
+    return myShrinkFilter->GetNodeObjId(theVtkID);
+  return theVtkID;
 }
 
-VISU_Actor::TVectorId VISU_Actor::GetVtkId(int theObjID){
-  return myGeomFilter->GetVtkId(theObjID);
+int VISU_Actor::GetElemObjId(int theVtkID){
+  return myGeomFilter->GetElemObjId(theVtkID);
 }
index b6925202f678b06dfc78208be3624564d70333f7..83b8e75c6c254bb5469b5ba27dd942ae6136050a 100644 (file)
 #define VISU_ACTOR_H
 
 #include "SALOME_Actor.h"
-#include "SALOME_GeometryFilter.h"
 
-#include <stdexcept>
 #include <string>
 
 class vtkProp;
 class vtkProperty;
-class vtkShrinkPolyData;
+class vtkDataSetMapper;
 
+class SALOME_ShrinkFilter;
 class VISU_PipeLine;
 
 namespace VISU { 
@@ -56,7 +55,7 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
   vtkTypeMacro(VISU_Actor,SALOME_Actor);
   void ShallowCopy(vtkProp *prop);
   static VISU_Actor* New();
-  ~VISU_Actor();
+  virtual ~VISU_Actor();
 
   virtual void setIO(const Handle(SALOME_InteractiveObject)& theIO);
 
@@ -69,21 +68,22 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
   VISU_Actor* GetParent(){ return myParent;}
   virtual void SetParent(VISU_Actor* theParent);
 
-  virtual void highlight(Standard_Boolean highlight);
-  Standard_Boolean isHighlighted() { return true; };
-
   virtual void SetOpacity(float theValue);
   virtual float GetOpacity();
 
-  virtual void SetShrinkable(bool theIsShrinkable);
-  virtual bool GetShrinkable() { return myIsShrinkable;}
-
   virtual void SetRepresentation(int theMode);
 
+
+  virtual bool IsShrunkable() { return myIsShrinkable;}
   virtual bool IsShrunk() { return myIsShrunk;}
-  virtual void SetShrink(float theFactor = 0.8); 
+  virtual void SetShrink();
   virtual void UnShrink(); 
 
+  virtual void SetShrinkable(bool theIsShrinkable);
+  virtual void SetShrinkFactor(float theFactor = 0.8); 
+  virtual float GetShrinkFactor();
+
+
   virtual void SetVisibility(int theMode);
   virtual int GetVisibility();
 
@@ -93,10 +93,11 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
   virtual void SetLineWidth(float theLineWidth);
   virtual float GetLineWidth();
   
-  int GetObjId(int theVtkID);
-  TVectorId GetVtkId(int theObjID);
 
-  bool IsHighlighting;
+  virtual int GetNodeObjId(int theVtkID);
+  virtual int GetElemObjId(int theVtkID);
+
+
   std::string myFieldName;
 
  protected:
@@ -105,9 +106,9 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
   VISU_Actor* myParent;
   VISU::Prs3d_i* myPrs3d;
   VISU_PipeLine* myPipeLine;
-  vtkProperty* HighlightProperty;
+  vtkDataSetMapper* myMapper;
 
-  vtkShrinkPolyData* myShrinkFilter;
+  SALOME_ShrinkFilter* myShrinkFilter;
   bool myIsShrinkable;
   bool myIsShrunk;
 };
index 51ad82595e22e2f4de99575eb8d85272e04d92cd..ac262e529002d65aa946b27fc023d26ae5824899 100644 (file)
 #include "VISU_MeshAct.h"
 #include "SALOME_PassThroughFilter.h"
 
+#include <vtkObjectFactory.h>
+#include <vtkRenderer.h>
+#include <vtkTexture.h>
+
 #include <vtkFeatureEdges.h>
 #include <vtkDataSetMapper.h>
 #include <vtkDataSet.h>
@@ -123,8 +127,14 @@ void VISU_MeshAct::SetShrinkable(bool theIsShrinkable){
   myNodeActor->SetShrinkable(theIsShrinkable);
 }
 
+void VISU_MeshAct::SetShrinkFactor(float theValue){
+  VISU_Actor::SetShrinkFactor(theValue);
+  mySurfaceActor->SetShrinkFactor(theValue);
+  myEdgeActor->SetShrinkFactor(theValue);
+}
+
 vtkProperty* VISU_MeshAct::GetSurfaceProperty(){ 
-  mySurfaceActor->GetProperty();
+  return mySurfaceActor->GetProperty();
 } 
 
 void VISU_MeshAct::SetSurfaceProperty(vtkProperty* theProperty){ 
@@ -132,7 +142,7 @@ void VISU_MeshAct::SetSurfaceProperty(vtkProperty* theProperty){
 }
 
 vtkProperty* VISU_MeshAct::GetEdgeProperty(){ 
-  myEdgeActor->GetProperty();
+  return myEdgeActor->GetProperty();
 } 
 
 void VISU_MeshAct::SetEdgeProperty(vtkProperty* theProperty){ 
@@ -140,20 +150,13 @@ void VISU_MeshAct::SetEdgeProperty(vtkProperty* theProperty){
 }
 
 vtkProperty* VISU_MeshAct::GetNodeProperty(){ 
-  myNodeActor->GetProperty();
+  return myNodeActor->GetProperty();
 } 
 
 void VISU_MeshAct::SetNodeProperty(vtkProperty* theProperty){ 
   myNodeActor->SetProperty(theProperty);
 }
 
-void VISU_MeshAct::highlight(Standard_Boolean highlight){
-  VISU_Actor::highlight(highlight);
-  mySurfaceActor->highlight(highlight);
-  myEdgeActor->highlight(highlight);
-  myNodeActor->highlight(highlight);
-}
-
 void VISU_MeshAct::SetOpacity(float theValue){
   GetSurfaceProperty()->SetOpacity(theValue);
 }
@@ -170,18 +173,20 @@ float VISU_MeshAct::GetLineWidth(){
   return GetEdgeProperty()->GetLineWidth();
 }
 
-void VISU_MeshAct::SetShrink(float theFactor){
-  VISU_Actor::SetShrink(theFactor);
-  mySurfaceActor->SetShrink(theFactor);
-  myEdgeActor->SetShrink(theFactor);
-  SetRepresentation(GetRepresentation());
+void VISU_MeshAct::SetShrink(){
+  if(myRepresentation == VTK_POINTS)
+    return;
+  VISU_Actor::SetShrink();
+  mySurfaceActor->SetShrink();
+  myEdgeActor->SetShrink();
+  //SetRepresentation(GetRepresentation());
 }
 
 void VISU_MeshAct::UnShrink(){
   VISU_Actor::UnShrink();
   mySurfaceActor->UnShrink();
   myEdgeActor->UnShrink();
-  SetRepresentation(GetRepresentation());
+  //SetRepresentation(GetRepresentation());
 }
 
 void VISU_MeshAct::SetRepresentation(int theMode){
@@ -192,16 +197,16 @@ void VISU_MeshAct::SetRepresentation(int theMode){
   myEdgeActor->PickableOff();
   myNodeActor->PickableOff();
   switch(theMode){
-  case 0: //POINTS
+  case VTK_POINTS:
     myNodeActor->VisibilityOn();
     myNodeActor->PickableOn();
     break;
-  case 1: //WIREFRAME
+  case VTK_WIREFRAME:
     myEdgeActor->VisibilityOn();
     myEdgeActor->SetRepresentation(1);
     myEdgeActor->PickableOn();
     break;
-  case 2: //SURFACE
+  case VTK_SURFACE:
     mySurfaceActor->VisibilityOn();
     break;
   case 3: //INSIDEFRAME
@@ -215,6 +220,8 @@ void VISU_MeshAct::SetRepresentation(int theMode){
     mySurfaceActor->VisibilityOn();
     break;
   }
+  if(myRepresentation == VTK_POINTS)
+    UnShrink();
 }
 
 void VISU_MeshAct::SetVisibility(int theMode){
index 38b45dc35eef56247ebfce4e32fadea907e20707..6530c7a28ceacf36380db1828757103d3d1b6182 100644 (file)
@@ -47,8 +47,6 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor {
   virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ;
   virtual void SetTransform(SALOME_Transform* theTransform); 
 
-  virtual void highlight(Standard_Boolean highlight);
-
   virtual vtkProperty* GetSurfaceProperty(); 
   virtual void SetSurfaceProperty(vtkProperty* theProperty);
 
@@ -69,8 +67,9 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor {
   virtual void SetVisibility(int theMode);
 
   virtual void SetShrinkable(bool theIsShrinkable);
+  virtual void SetShrinkFactor(float theFactor = 0.8); 
 
-  virtual void SetShrink(float theFactor = 0.8); 
+  virtual void SetShrink(); 
   virtual void UnShrink(); 
 
   virtual void Render(vtkRenderer *, vtkMapper *);
index 30a7c4a7d2626b267c631247a87d4e77189135e4..0a138e2cc4cf9cdff9b048a4f88b78b6fdf5bfb0 100644 (file)
@@ -30,6 +30,9 @@
 #include "VISU_LookupTable.hxx"
 #include "VISU_ScalarBarActor.hxx"
 
+#include <vtkObjectFactory.h>
+#include <vtkRenderer.h>
+
 vtkStandardNewMacro(VISU_ScalarMapAct);
 
 VISU_ScalarMapAct::VISU_ScalarMapAct(){
index 30de9bae2b2ed3ede78360aa85e75bf0e0c1e88e..8f055d2504f91e039fd8b31c49bd2b2e1f530312 100644 (file)
@@ -32,6 +32,9 @@
  
 // VTK Includes
 #include <vtkObjectFactory.h>
+#include <vtkDataSetMapper.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkPolyData.h>
 
 using namespace std;
 
@@ -47,7 +50,7 @@ VISU_VectorsAct::~VISU_VectorsAct(){}
 
 
 void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
-  if(myPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine)){
+  if((myPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine))){
     VISU_Actor::SetPipeLine(myPipeLine);
     myPipeLine->Delete();
   }
index f89dc7ef9375aa9c6641d1a0210f0eb49de1b365..7f0b646b87ec1ec01f2aa62cd3fb0a327155f21b 100644 (file)
@@ -45,6 +45,8 @@ typedef VISU_ScalarMapPL TPresent;
 #include <vtkCamera.h>
 #include <vtkActor.h>
 
+#include "utilities.h"
+
 using namespace std;
 
 static int isOnlyMesh = false;
@@ -131,10 +133,10 @@ int main(int argc, char** argv){
        }
       }
     }
-  }catch(std::runtime_error& exc){
-    cout<<"Follow exception was accured :\n"<<exc.what()<<endl;
+  }catch(std::exception& exc){
+    MESSAGE("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    cout<<"Unknown exception was accured in VISU_Convertor_impl"<<endl;
+    MESSAGE("Unknown exception was occured in VISU_Convertor_impl");
   } 
   return 1;
 }
index 2cbdba5744354669518e4c04c10124b18db17737..be8925f440a151f47dfd23e2980cd5254935c1b6 100644 (file)
@@ -177,6 +177,7 @@ float VISU_CutPlanesPL::GetRotateX(int theNum){
   case YZ: return myAng[theNum][1];
   case ZX: return myAng[theNum][2];
   }
+  return 0;
 }
 
 float VISU_CutPlanesPL::GetRotateY(int theNum){
@@ -185,6 +186,7 @@ float VISU_CutPlanesPL::GetRotateY(int theNum){
   case YZ: return myAng[theNum][2];
   case ZX: return myAng[theNum][0];
   }
+  return 0;
 }
 
 
index 1072770079436e8caac3ae88a18a10e5b768c73d..cb4b270505af606b1cc010001061eb4960466bdf 100644 (file)
@@ -83,7 +83,8 @@ LIB_CLIENT_IDL = SALOME_Exception.idl \
                 SALOMEDS.idl \
                 SALOME_ModuleCatalog.idl \
                 SALOME_Component.idl \
-                 SALOMEDS_Attributes.idl \
+                SALOMEDS_Attributes.idl \
+                SALOME_Comm.idl
 
 LIB_SERVER_IDL = 
 
index a8e596684c4e34793251588d26210fc13a9def1f..eb81af8ac08ee601a6babe536dcaf8384cad09bc 100644 (file)
 #include "SALOMEGUI_TableDlg.h"
 #include "SALOMEGUI_SetupCurveDlg.h"
 #include "SALOMEGUI_SetValueDlg.h"
+#include "SALOMEGUI_Desktop.h"
 #include "Plot2d_SetupPlot2dDlg.h"
 #include "Plot2d_ViewFrame.h"
 #include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_RenderWindow.h"
 #include "VTKViewer_InteractorStyleSALOME.h"
+#include "VTKViewer_RenderWindowInteractor.h"
 #include "VisuGUI_FileDlg.h"
 
 // QT Includes
 #include CORBA_CLIENT_HEADER(MED_Gen)
 
 #include <vtkActor.h>
+#include <vtkRenderer.h>
 #include <vtkDataSetMapper.h>
+#include <vtkActorCollection.h>
 
 // Open CASCADE Include
 #include <TCollection_AsciiString.hxx>
@@ -165,7 +170,20 @@ private:
   QFont font;
 };
 
-static VisuGUI MYVISUGUI("");
+
+inline bool IsSObjectTable(SALOMEDS::SObject_ptr theSObject){
+  if(!theSObject->_is_nil()) {
+    SALOMEDS::GenericAttribute_var anAttr;
+    if(theSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ))
+      return true;
+    if(theSObject->FindAttribute( anAttr, "AttributeTableOfReal" ))
+      return true;
+  }  
+  return false;
+}
+
+
+static VisuGUI MYVISUGUI;
 VisuGUI *visuGUI = &MYVISUGUI;
 
 VISU::VISU_Gen_i* VisuGUI::GetVisuGen(){
@@ -240,6 +258,7 @@ VisuGUI::CameraOrient VisuGUI::SetFitAll(VTKViewer_ViewFrame* theViewFrame){
   }
   theViewFrame->getRenderer()->ResetCameraClippingRange();
   theViewFrame->onViewFitAll();
+  return aCameraOrient;
 }
  
 QAD_Desktop* VisuGUI::GetDesktop(){
@@ -920,41 +939,43 @@ void VisuGUI::DisplayOnlyPrs() {
 // function : ErasePrs()
 // purpose  :
 //=====================================================================================
-void VisuGUI::ErasePrs() {
-  if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs");
-  CORBA::Object_var anObject = GetSelectedObj();
-  if ( !CORBA::is_nil( anObject ) ) {
-    // is it Prs3d object ?
-    VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
-    if(aPrsObject){
-      if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs : Prs3d object");
-      ErasePrs(aPrsObject);
-      VTKViewer_ViewFrame* vf = GetVtkViewFrame();
-      if (vf) {
-       vf->Repaint();
-      }
-    }
-    // is it Curve ?
-    VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
-    if(aCurve){
-      if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs : Curve object");
-      PlotCurve(aCurve, VISU::eErase );
+static void ErasePrs(CORBA::Object_ptr theObject) {
+  if(MYDEBUG) MESSAGE("ErasePrs");
+  if ( !CORBA::is_nil( theObject ) ) {
+    VISU::Base_var aBase = VISU::Base::_narrow(theObject);
+    if ( CORBA::is_nil( aBase ) ) return;
+    VISU::VISUType aType = aBase->GetType();
+    switch (aType){
+    case VISU::TCURVE:{
+      if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
+       VisuGUI::PlotCurve(aCurve, VISU::eErase );
+      break;
     }
-    // is it Container ?
-    VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
-    if(aContainer){
-      if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs : Container object");
-      PlotContainer(aContainer, VISU::eErase );
+    case VISU::TCONTAINER:{
+      if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
+       VisuGUI::PlotContainer(aContainer, VISU::eErase );
+      break;
     }
-    // is it Table ?
-    VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
-    if(aTable){
-      if(MYDEBUG) MESSAGE("VisuGUI::ErasePrs : Table object");
-      PlotTable(aTable, VISU::eErase );
+    case VISU::TTABLE:{
+      if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
+       VisuGUI::PlotTable(aTable, VISU::eErase );
+      break;
     }
+    default:{
+      if(VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())){
+       VisuGUI::ErasePrs(aPrsObject);
+       if (VTKViewer_ViewFrame* vf = VisuGUI::GetVtkViewFrame())
+         vf->Repaint();
+      }
+    }}
   }
 }
 
+void VisuGUI::ErasePrs() {
+  ::ErasePrs(GetSelectedObj());
+}
+
+
 //=====================================================================================
 // function : DisplayManyPrs()
 // purpose  :
@@ -1393,7 +1414,7 @@ void VisuGUI::CreateMesh() {
   }
 #ifdef CHECKTIME
   timer.Stop();
-  cout<<"VisuGUI::CreateMesh() - CREATE MESH\n";
+  MESSAGE("VisuGUI::CreateMesh() - CREATE MESH");
   timer.Show();
 #endif
 
@@ -1419,7 +1440,7 @@ void VisuGUI::CreateMesh() {
       SetFitAll(vf);
 #ifdef CHECKTIME
       timer.Stop();
-      cout<<"VisuGUI::CreateMesh() - DISPLAY MESH\n";
+      MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
       timer.Show();
 #endif
       //GetActiveStudy()->updateObjBrowser(); //not necessary
@@ -1506,7 +1527,7 @@ static void ShrinkMesh(VISU_Actor *theActor){
   if(theActor->IsShrunk()) 
     theActor->UnShrink();
   else
-    theActor->SetShrink(0.8);
+    theActor->SetShrink();
 }
 
 void VisuGUI::ChangeRepresentation(VISU::PresentationType theType) {
@@ -1636,19 +1657,25 @@ void VisuGUI::PlotTable( VISU::Table_i* table, int theDisplaying )
            }
            else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
              if ( plotCurve ) {
-               plotCurve->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
-               //plotCurve->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
-               plotCurve->setVerTitle( strdup( theCurve->GetName() ) );
-               plotCurve->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
-               plotCurve->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
+               plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
+               //plotCurve->setVerTitle(  theCurve->GetVerTitle().c_str() );
+               plotCurve->setVerTitle( theCurve->GetName() );
+               plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
+               plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
                /* - DATA NOT UPDATED */
-               if ( !plotCurve->isAutoAssign() ) {
+               double* xList = 0;
+               double* yList = 0;
+               int     nbPoints = theCurve->GetData( xList, yList );
+               if ( nbPoints > 0 && xList && yList ) {
+                 plotCurve->setData( xList, yList, nbPoints );
+               }
+               if ( !theCurve->IsAuto() ) {
                  plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
                  plotCurve->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() ); 
                  SALOMEDS::Color color = theCurve->GetColor();
                  plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
-                 plotCurve->setAutoAssign( theCurve->IsAuto() );
                }
+               plotCurve->setAutoAssign( theCurve->IsAuto() );
                aPlot->displayCurve( plotCurve, false );
              }
              else {
@@ -1662,6 +1689,7 @@ void VisuGUI::PlotTable( VISU::Table_i* table, int theDisplaying )
                  newColor.G = crv->getColor().green()/255.;
                  newColor.B = crv->getColor().blue()/255.;
                  theCurve->SetColor( newColor );
+                 crv->setAutoAssign( theCurve->IsAuto() );
                }
              }
            }
@@ -1695,19 +1723,24 @@ void VisuGUI::PlotCurve( VISU::Curve_i* theCurve, int theDisplaying )
     }
     else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
       if ( plotCurve ) {
-       plotCurve->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
-       //plotCurve->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
-       plotCurve->setVerTitle( strdup( theCurve->GetName() ) );
-       plotCurve->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
-       plotCurve->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
-       /* DATA NOT UPDATED */
-       if ( !plotCurve->isAutoAssign() ) {
+       plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
+       //plotCurve->setVerTitle( ( theCurve->GetVerTitle().c_str() ) );
+       plotCurve->setVerTitle( theCurve->GetName() );
+       plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
+       plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
+       double* xList = 0;
+       double* yList = 0;
+       int     nbPoints = theCurve->GetData( xList, yList );
+       if ( nbPoints > 0 && xList && yList ) {
+         plotCurve->setData( xList, yList, nbPoints );
+       }
+       if ( !theCurve->IsAuto() ) {
          plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
          plotCurve->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() ); 
          SALOMEDS::Color color = theCurve->GetColor();
          plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
-         plotCurve->setAutoAssign( theCurve->IsAuto() );
        }
+       plotCurve->setAutoAssign( theCurve->IsAuto() );
        aPlot->displayCurve( plotCurve, false );
       }
       else {
@@ -1721,6 +1754,7 @@ void VisuGUI::PlotCurve( VISU::Curve_i* theCurve, int theDisplaying )
          newColor.G = crv->getColor().green()/255.;
          newColor.B = crv->getColor().blue()/255.;
          theCurve->SetColor( newColor );
+         crv->setAutoAssign( theCurve->IsAuto() );
        }
       }
     }
@@ -1740,7 +1774,7 @@ void VisuGUI::PlotContainer( VISU::Container_i* container, int theDisplaying )
       for ( int k = 1; k <= nbCurves; k++ ) {
        VISU::Curve_i* theCurve = container->GetCurve( k );
        if ( theCurve && theCurve->IsValid() ) {
-         Plot2d_Curve* plotCurve = aPlot->getCurveByIO( new SALOME_InteractiveObject( strdup(theCurve->GetEntry()), "", "" ) );
+         Plot2d_Curve* plotCurve = aPlot->getCurveByIO( new SALOME_InteractiveObject( theCurve->GetEntry(), "", "" ) );
 //       for ( int i = 0; i < clist.count(); i++ ) {
 //         if ( clist.at( i )->hasIO() && !strcmp( clist.at( i )->getIO()->getEntry(), theCurve->GetEntry() ) ) {
 //           plotCurve = clist.at( i );
@@ -1755,19 +1789,24 @@ void VisuGUI::PlotContainer( VISU::Container_i* container, int theDisplaying )
          }
          else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
            if ( plotCurve ) {
-             plotCurve->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
-              //plotCurve->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
-              plotCurve->setVerTitle( strdup( theCurve->GetName() ) );
-             plotCurve->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
-             plotCurve->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
-             /* - DATA NOT UPDATED */
-             if ( !plotCurve->isAutoAssign() ) {
+             plotCurve->setHorTitle( theCurve->GetHorTitle().c_str() );
+              //plotCurve->setVerTitle( ( theCurve->GetVerTitle().c_str() ) );
+              plotCurve->setVerTitle( theCurve->GetName() );
+             plotCurve->setHorUnits( theCurve->GetHorUnits().c_str() );
+             plotCurve->setVerUnits( theCurve->GetVerUnits().c_str() );
+             double* xList = 0;
+             double* yList = 0;
+             int     nbPoints = theCurve->GetData( xList, yList );
+             if ( nbPoints > 0 && xList && yList ) {
+               plotCurve->setData( xList, yList, nbPoints );
+             }
+             if ( !theCurve->IsAuto() ) {
                plotCurve->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
                plotCurve->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() ); 
                SALOMEDS::Color color = theCurve->GetColor();
                plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
-               plotCurve->setAutoAssign( theCurve->IsAuto() );
              }
+             plotCurve->setAutoAssign( theCurve->IsAuto() );
              aPlot->displayCurve( plotCurve, false );
            }
            else {
@@ -1781,6 +1820,7 @@ void VisuGUI::PlotContainer( VISU::Container_i* container, int theDisplaying )
                newColor.G = crv->getColor().green()/255.;
                newColor.B = crv->getColor().blue()/255.;
                theCurve->SetColor( newColor );
+               crv->setAutoAssign( theCurve->IsAuto() );
              }
            }
          }
@@ -1816,10 +1856,10 @@ void VisuGUI::ShowTable() {
     // possibly this is Table SObject
     SO = GetActiveStudy()->getStudyDocument()->FindObjectID( anIO->getEntry() );
   }
-  SALOMEDS::GenericAttribute_var anAttr;
-  if ( SO->_is_nil() || ( !SO->FindAttribute( anAttr, "AttributeTableOfInteger" ) 
-                      && !SO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) ) 
+
+  if(!IsSObjectTable(SO))
     return;
+
   SALOMEGUI_TableDlg* dlg = new SALOMEGUI_TableDlg( QAD_Application::getDesktop(),
                                                    SO, 
                                                    false, 
@@ -1845,10 +1885,7 @@ void VisuGUI::CreateTable() {
     if(!aSObject->_is_nil()) {
       CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
       VISU::CutLines_var aCutLines = VISU::CutLines::_narrow( anObject );
-      SALOMEDS::GenericAttribute_var anAttr;
-      if(!aCutLines->_is_nil() ||
-        aSObject->FindAttribute( anAttr, "AttributeTableOfInteger") ||
-        aSObject->FindAttribute( anAttr, "AttributeTableOfReal" )) {
+      if(!aCutLines->_is_nil() || IsSObjectTable(aSObject)) {
        GetVisuGen()->CreateTable(aSObject->GetID());
        GetActiveStudy()->updateObjBrowser();
       }
@@ -1871,6 +1908,12 @@ void VisuGUI::DeleteObject() {
   if (anIO->hasEntry()){
     SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
     if(!aSObject->_is_nil()){
+      SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject);
+      for(aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()){
+       SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
+       CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
+       ::ErasePrs(aChildObj);
+      }
       SALOMEDS::StudyBuilder_var aStudyBuilder = VisuGUI::NewBuilder();
       // There is a transaction
       aStudyBuilder->NewCommand();
@@ -1936,12 +1979,11 @@ void VisuGUI::PlotData() {
          SALOMEDS::AttributeName_var    aName;
          QString SOName;
          SALOMEDS::SObject_var SO = GetActiveStudy()->getStudyDocument()->FindObjectID( table->GetObjectEntry() );
-         if ( !SO->_is_nil() && ( SO->FindAttribute( anAttr, "AttributeTableOfInteger" ) ||
-                                  SO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) ) {
+         if ( IsSObjectTable(SO) ) {
            // get name of SObject
            if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
              aName = SALOMEDS::AttributeName::_narrow( anAttr );
-             SOName = strdup( aName->Value() );
+             SOName = aName->Value();
            }
            Plot2d_SetupPlot2dDlg* dlg = new Plot2d_SetupPlot2dDlg( SO, QAD_Application::getDesktop() );
            if ( dlg->exec() == QDialog::Accepted ) {
@@ -2006,13 +2048,11 @@ void VisuGUI::PlotData() {
       
     // check if Table SObject is selected
     SALOMEDS::SObject_var SO = GetActiveStudy()->getStudyDocument()->FindObjectID( Sel->firstIObject()->getEntry() );
-    if ( !SO->_is_nil() && 
-        ( SO->FindAttribute( anAttr, "AttributeTableOfInteger" ) ||
-          SO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) ) {
+    if ( IsSObjectTable(SO) ) {
       // get name of SObject
       if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
        aName = SALOMEDS::AttributeName::_narrow( anAttr );
-       SOName = strdup( aName->Value() );
+       SOName = aName->Value();
       }
       Plot2d_SetupPlot2dDlg* dlg = new Plot2d_SetupPlot2dDlg( SO, QAD_Application::getDesktop() );
       if ( dlg->exec() == QDialog::Accepted ) {
@@ -2077,9 +2117,7 @@ void VisuGUI::CreatePlot(SALOMEDS::SObject_var theTableSO) {
   SALOMEDS::GenericAttribute_var anAttr;
   SALOMEDS::AttributeName_var    aName;
 
-  if ( !theTableSO->_is_nil() && 
-       ( theTableSO->FindAttribute( anAttr, "AttributeTableOfInteger" ) ||
-        theTableSO->FindAttribute( anAttr, "AttributeTableOfReal" ) ) ) {
+  if ( IsSObjectTable(theTableSO) ) {
     CORBA::Object_var aTable = VISU::SObjectToObject(theTableSO);
     CORBA::Object_var aContainer = GetVisuGen()->CreateContainer();
     if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
@@ -2318,9 +2356,9 @@ void VisuGUI::Sweep() {
       }
     }
   }catch(std::exception& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
   }
   QApplication::restoreOverrideCursor();
 }
@@ -2734,14 +2772,18 @@ bool VisuGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* thePopup, const QStri
   bool aIsLocked = isStudyLocked( GetActiveStudy()->getStudyDocument() );
   
   bool isVTKViewer = (GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK);
-  thePopup->clear();
   SALOME_Selection* aSelection = SALOME_Selection::Selection(GetActiveStudy()->getSelection());
-  if ( aSelection->IObjectCount() == 0 ) {
+  QString aParentComponent     = ((SALOMEGUI_Desktop*)parent)->getComponentFromSelection();
+  int nbSel = aSelection->IObjectCount();
+
+  thePopup->clear();
+
+  if ( nbSel == 0 ) {
     if ( theParent == "Viewer" && isVTKViewer && !aIsLocked)
       thePopup->insertItem( "Save view parameters", visuGUI, SLOT( SaveViewParams() ) );
     return false;
   }
-  if( aSelection->IObjectCount() > 1 ) {
+  if( nbSel > 1 ) {
     int selMode = checkHomoSelection();
     if(MYDEBUG) MESSAGE("VisuGUI::CustomPopup: multiple selection : selMode = "<<selMode );
     if ( selMode == homoCurves ) {
@@ -2898,7 +2940,7 @@ bool VisuGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* thePopup, const QStri
                  aPresMenu->insertItem("Insideframe", visuGUI, SLOT(MakeInsideframe()));
                  break;
                }
-               if(anVISUActor->GetShrinkable())
+               if(anVISUActor->IsShrunkable())
                  if(aType != VISU::TVECTORS && aType != VISU::TSTREAMLINES){
                    if (anVISUActor->IsShrunk())
                      aPresMenu->insertItem("Unshrink", visuGUI, SLOT(MakeShrink()));
@@ -2989,6 +3031,15 @@ bool VisuGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* thePopup, const QStri
       SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow( anObject );
       if(!CORBA::is_nil(aField))
         thePopup->insertItem( "Import TimeStamp", visuGUI, SLOT( ImportMedField() ) );
+      if ( aParentComponent != parent->getActiveComponent() )  {
+        //insert pre-defined Display/Erase items
+       if ( thePopup->count() > 0 ) {
+         thePopup->insertSeparator();
+       }
+       thePopup->insertItem (tr ("MEN_APP_DISPLAY"),      GetActiveStudy()->getApp(), SLOT(onDisplay(int)), 0, QAD_Display_Popup_ID);
+       thePopup->insertItem (tr ("MEN_APP_DISPLAY_ONLY"), GetActiveStudy()->getApp(), SLOT(onDisplay(int)), 0, QAD_DisplayOnly_Popup_ID);
+       thePopup->insertItem (tr ("MEN_APP_ERASE"),        GetActiveStudy()->getApp(), SLOT(onErase()),      0, QAD_Erase_Popup_ID);
+      }
       return false;
     }
   }else{
@@ -3042,16 +3093,26 @@ bool VisuGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* thePopup, const QStri
        }
        return false;
       }else{
-       SALOMEDS::GenericAttribute_var anAttr;
-       if(aSObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) || 
-          aSObject->FindAttribute( anAttr, "AttributeTableOfReal" )){
+
+       if(IsSObjectTable(aSObject)){
          thePopup->insertItem( "Show Table",    visuGUI, SLOT(ShowTable()));
          thePopup->insertItem( "Create Curves", visuGUI, SLOT(PlotData()));
          thePopup->insertItem( "Export Table", visuGUI, SLOT( ExportTableToFile() ) );
+         thePopup->insertSeparator();
+         thePopup->insertItem( "Delete", visuGUI, SLOT( DeleteObject() ) );
          return false;
        }
+
+       CORBA::Long aTag = 1;
+       SALOMEDS::SObject_var aSubObject;
+       if(aSObject->FindSubObject(aTag,aSubObject) && IsSObjectTable(aSubObject)) {
+         thePopup->insertItem( "Delete", visuGUI, SLOT( DeleteObject() ) );
+         return false;
+       }
+
        aSObject = aSObject->GetFather();
        if(aSObject->_is_nil()) return false;
+       SALOMEDS::GenericAttribute_var anAttr;
        aSObject->FindAttribute(anAttr, "AttributeName");
        SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
        if(aName->_is_nil()) return false;
@@ -3060,16 +3121,27 @@ bool VisuGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* thePopup, const QStri
        //  thePopup->insertItem( "Import MED", visuGUI, SLOT( ImportMedField() ) );
        if(strcmp(aValue.in(),"MEDFIELD") == 0)
          thePopup->insertItem( "Import Field", visuGUI, SLOT( ImportMedField() ) );
+       if ( aParentComponent != parent->getActiveComponent() )  {
+         //insert pre-defined Display/Erase items
+         if ( thePopup->count() > 0 ) {
+           thePopup->insertSeparator();
+         }
+         thePopup->insertItem (tr ("MEN_APP_DISPLAY"),      GetActiveStudy()->getApp(), SLOT(onDisplay(int)), 0, QAD_Display_Popup_ID);
+         thePopup->insertItem (tr ("MEN_APP_DISPLAY_ONLY"), GetActiveStudy()->getApp(), SLOT(onDisplay(int)), 0, QAD_DisplayOnly_Popup_ID);
+         thePopup->insertItem (tr ("MEN_APP_ERASE"),        GetActiveStudy()->getApp(), SLOT(onErase()),      0, QAD_Erase_Popup_ID);
+       }
        return false;
       }
     }
   }
+  return false;
 }
 
 //===========================================================================
 // BuildPresentation
 //===========================================================================
-void VisuGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO)
+void VisuGUI::BuildPresentation( const Handle(SALOME_InteractiveObject)& theIO,
+                                 QAD_ViewFrame* )
 {
   BEGIN_OF("VisuGUI::BuildPresentation");
 
@@ -3431,7 +3503,7 @@ bool FNAME(SALOMEDS::SObject_var theField) { \
   TYPE* pPresent = FCREATE(theField,aMeshName,(VISU::Entity)anEntity.toInt(),aFieldName,aTimeStampId.toInt()); \
   if(MYCHECKTIME) { \
     timer.Stop(); \
-    cout<<"BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) - CREATE PRSOBJECT\n"; \
+    MESSAGE("BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) - CREATE PRSOBJECT"); \
     timer.Show(); \
   } \
   if (pPresent) { \
@@ -3481,7 +3553,7 @@ bool VisuGUI::CreateCutPlanes(SALOMEDS::SObject_var theField) {
     CreateCutPlanesPrs(theField,aMeshName,(VISU::Entity)anEntity.toInt(),aFieldName,aTimeStampId.toInt());
   if(MYCHECKTIME) {
     timer.Stop();
-    cout<<"BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) - CREATE PRSOBJECT\n";
+    MESSAGE("BUILDPRS(TYPE, FCREATE, FNAME, DLGNAME) - CREATE PRSOBJECT");
     timer.Show();
   }
   if (pPresent) {
@@ -3524,7 +3596,7 @@ try {
                                     aFieldName,aTimeStampId.toInt()); 
   if(MYCHECKTIME) { 
     timer.Stop(); 
-    cout<<"BUILDPRS(VISU::CutLines_i, CreateCutLinesPrs, VisuGUI::CreateCutLines, VisuGUI_CutLinesDlg) - CREATE PRSOBJECT\n"; 
+    MESSAGE("BUILDPRS(VISU::CutLines_i, CreateCutLinesPrs, VisuGUI::CreateCutLines, VisuGUI_CutLinesDlg) - CREATE PRSOBJECT");
     timer.Show(); 
   } 
   if (pPresent) { 
@@ -3603,7 +3675,7 @@ void VisuGUI::ImportTablesFromFile(){
     
 #ifdef CHECKTIME
     timer.Stop();
-    cout<<"VisuGUI::ImportTablesFromFile() - IMPORT FILE\n";
+    MESSAGE("VisuGUI::ImportTablesFromFile() - IMPORT FILE");
     timer.Show();
 #endif
     
@@ -3748,7 +3820,7 @@ void VisuGUI::ImportFromFile(TImportFun theImportFun){
     }
 #ifdef CHECKTIME
     timer.Stop();
-    cout<<"VisuGUI::ImportFromFile() - IMPORT FILE\n";
+    MESSAGE("VisuGUI::ImportFromFile() - IMPORT FILE");
     timer.Show();
 #endif
 
@@ -3865,7 +3937,11 @@ VISU_Actor* VisuGUI::UpdateViewer(VISU::Prs3d_i* thePrs, bool theDispOnly){
         
       } else if (theDispOnly) {
        anVISUActor->GetParent()->VisibilityOff();
+      } else {
       }
+    } else if (theDispOnly && anActor->GetVisibility()) {
+      anActor->VisibilityOff();
+    } else {
     } 
   }
   if (aResActor) return aResActor;
@@ -3948,7 +4024,7 @@ void VisuGUI::CreateActor(VISU::Prs3d_i* thePrs) {
                                tr ("VISU_BUT_OK") );
       throw exc;
     } catch (...) {
-      cout<<" Unknown exception"<<endl;
+      MESSAGE(" Unknown exception");
       QApplication::restoreOverrideCursor();
       INFOS("Unknown exception is caught in VisuGUI::CreateActor");
       INFOS("Available memory : "<<VISU_PipeLine::GetAvailableMemory());
@@ -3959,7 +4035,7 @@ void VisuGUI::CreateActor(VISU::Prs3d_i* thePrs) {
     }
 #ifdef CHECKTIME
     timer.Stop();
-    cout<<"VisuGUI::CreateActor(VISU::Prs3d_i* thePrs) - DISPLAY ACTOR\n";
+    MESSAGE("VisuGUI::CreateActor(VISU::Prs3d_i* thePrs) - DISPLAY ACTOR");
     timer.Show();
 #endif
   }
index 9bed10f884c35eba421a51a8f26a7d9cb5f39d1a..aa78fe3455279282c285bdc74dea3cadad28acda 100644 (file)
@@ -189,7 +189,8 @@ class VisuGUI : public SALOMEGUI{
                                          const QString & theContext,
                                          const QString & theParent,
                                          const QString & theObject);
-  virtual void BuildPresentation(const Handle(SALOME_InteractiveObject)&);
+  virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&,
+                                  QAD_ViewFrame*  = 0 );
   virtual bool OnMousePress(QMouseEvent* pe ,
                                           QAD_Desktop* parent, 
                                           QAD_StudyFrame* studyFrame);
index 2a32fd87ce58dd7fbaf185e8b4980e1b6d32a25f..a92048576ae44c5c3fe87ee0283fc5d69984cde1 100644 (file)
@@ -25,6 +25,7 @@
 #include <qhgroupbox.h>
 
 #include <vtkRenderer.h>
+#include <vtkPolyData.h>
 #include <vtkAppendPolyData.h>
 #include <vtkDataSetMapper.h>
 
index 8eed6adec4b04a4b5845492422899a79bc6c99bf..7758df1e5f2e3cb768499dd7b63551ee6539a28f 100644 (file)
@@ -46,6 +46,7 @@
 #include <qtabwidget.h>
 
 #include <vtkRenderer.h>
+#include <vtkPolyData.h>
 #include <vtkAppendPolyData.h>
 #include <vtkDataSetMapper.h>
 
index 50a1571bfd44eebf0c9d187934116269ae6b3668..0ab0238d60774bfaa4978ef1d1b37a108c25ae99 100644 (file)
@@ -361,7 +361,7 @@ QString VisuGUI_EditContainerDlg::getSObjectName(SALOMEDS::SObject_var theSObjec
   SALOMEDS::AttributeName_var    aName;
   if ( theSObject->FindAttribute(anAttr, "AttributeName") ) {
     aName = SALOMEDS::AttributeName::_narrow( anAttr );
-    return QString(strdup( aName->Value() ));
+    return QString(aName->Value());
   } 
   return QString("");
 }
index af7232f24aae991314a740921a899a14df0467b9..784a158d9a7f97e6a5e96143858ed079b1082ec0 100644 (file)
@@ -370,7 +370,6 @@ void VisuGUI_InitMeshDlg::closeEvent( QCloseEvent* e )
 void VisuGUI_InitMeshDlg::TextChangedInLineEdit(const QString& newText)
 {  
   QLineEdit* send = (QLineEdit*)sender();
-  QString newT = strdup(newText) ;
   
   if (send == LineEdit_NameMesh) {
     myNameMesh = newText;
index 019d436c5eec857e35ad9e4636f1cc12d3605087..2e2ab54e2bfd1fa264e99ba76d8696ebf32cac7e 100644 (file)
@@ -1020,6 +1020,7 @@ int VisuGUI_TextPrefDlg::FuncName() \
   case 1: return VTK_COURIER; \
   case 2: return VTK_TIMES; \
   } \
+  return VTK_ARIAL; \
 }
 
 #define SETFONT(FuncName, Control) \
index cacf63f3a33bd280b0feb893e30107e956078c36..68b15a96f5deb7d555099e7e8ae6ea83f3c41819 100644 (file)
@@ -39,8 +39,7 @@
 #include "QAD_RightFrame.h"
 #include "VTKViewer_ViewFrame.h"
 
-#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
 
 #include <map>
 
 #include <qlayout.h>
 #include <qhbuttongroup.h>
 #include <qradiobutton.h>
+#include <qvalidator.h>
 #include <qpushbutton.h>
 
+#include <vtkDataSetMapper.h>
 #include <vtkDataSet.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
 #include <vtkCell.h>
-#include <qvalidator.h>
 
 #include "utilities.h"
 
@@ -313,20 +315,19 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
       myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
     }
 
-    TColStd_MapOfInteger aMapIndex;
+    TColStd_IndexedMapOfInteger aMapIndex;
     typedef map<int,float*> PointsMap;
     PointsMap aPointsMap;
     mySelection->GetIndex(anIO, aMapIndex);
-    TColStd_MapIteratorOfMapOfInteger anIter(aMapIndex);
     
     VISU_Actor* anActor = visuGUI->GetActor(aPrs3d);  
     if(!anActor)
       return;
-    vtkDataSet* aDataSet = anActor->GetMapper()->GetInput();
+    vtkDataSet* aDataSet = anActor->GetInput();
     vtkPointData* aPntData = aDataSet->GetPointData();
 
-    for (;anIter.More();anIter.Next()){
-      int aID = anIter.Key();
+    for ( int ind = 1; ind <= aMapIndex.Extent(); ind++){
+      int aID = aMapIndex( ind );
       
       switch (aType) {
       case 0:
@@ -356,9 +357,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
              clearFields();
            }
            else {
-             int aDSId = anActor->GetObjId(aID);
-             if (aDSId==-1) aDSId = aID;
-             myCellIDValLbl->setText( QString::number(aDSId) );
+             myCellIDValLbl->setText( QString::number(aID) );
              myCellScalarValLbl->setText(getValue(aData, aID));
              myCellVectorValLbl->setText(getVector(aData, aID));
          
@@ -437,26 +436,17 @@ bool onIdEdit(const QString& theText,
              QString theValue,
              QLabel* theFieldName)
 {
-  int anId = theText.toInt();
   Handle(SALOME_InteractiveObject) anIO;
   if(VISU::Prs3d_i* aPrs3d = visuGUI->GetSelectedPrs3d(&anIO)){
+    int anId = theText.toInt();
     vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput();
     int aMaxId = (aDataSet->*theMethod)();
     if(anId < 0) anId = 0;
-    if(aMaxId <= anId) anId = aMaxId-1;
+    if(anId >= aMaxId) anId = aMaxId-1;
     theSelection->ClearIObjects();
     theSelection->AddIObject(anIO);
-    VISU_Actor* anVISUActor = visuGUI->GetActor(aPrs3d);
-    if(theIsCell){
-      VISU_Actor::TVectorId aVec = anVISUActor->GetVtkId(anId);
-      if(!aVec.empty()){
-       theSelection->AddOrRemoveIndex( anIO, aVec, false );
-       return true;
-      }
-    }else{
-      theSelection->AddOrRemoveIndex(anIO, anId, false);
-      return true;
-    }
+    theSelection->AddOrRemoveIndex( anIO, anId, false );
+    return true;
   }else{
     theMeshName->setText(theValue);
     theFieldName->setText("");
index 93df0b42e80059df6c85368362c062df368d2c27..057a12f3e5bb9de162a04d20f754a693b351b019 100644 (file)
@@ -30,7 +30,8 @@ LIB_MOC = VISU_TimeAnimation.h
 LIB_SERVER_IDL = VISU_Gen.idl SALOME_Component.idl \
                  SALOME_Exception.idl SALOME_GenericObj.idl MED.idl
 
-LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl
+LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl \
+                SALOME_Comm.idl
 
 # Executables targets
 BIN = 
index 353cfdf7a81954c78a7cceaca86e91bb71389fe9..c137e26ffaf98b7315e97967a535fa73cb3f627e 100644 (file)
@@ -150,9 +150,9 @@ namespace VISU{
        return (i->second)(theSObject,thePrefix,aMap);
       }
     }catch(std::logic_error& exc){
-      INFOS("Follow exception was accured :\n"<<exc.what());
+      INFOS("Follow exception was occured :\n"<<exc.what());
     }catch(...){
-      INFOS("Unknown exception was accured!");
+      INFOS("Unknown exception was occured!");
     }
     return NULL;
   }
@@ -180,7 +180,7 @@ namespace VISU{
       PortableServer::Servant aServant = aPOA->reference_to_servant(theObject);
       return aServant;
     } catch (...) {
-      INFOS("GetServant - Unknown exception was accured!!!"); 
+      INFOS("GetServant - Unknown exception was occured!!!"); 
       return NULL;
     }
   }
@@ -199,7 +199,7 @@ namespace VISU{
          anObj = anORB->string_to_object(aValue);
       }
     }catch(...){
-      INFOS("SObjectToObject - Unknown exception was accured!!!");
+      INFOS("SObjectToObject - Unknown exception was occured!!!");
     }
     return anObj;
   }
index ba38a0ee54365508edd7c3e155acda547c736128..ca83125f74ec778ed596969614168b2017bb9cc8 100644 (file)
@@ -103,7 +103,7 @@ namespace VISU{
     typedef std::map<std::string,QString> TRestoringMap;
     typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject, 
                                         const std::string& thePrefix, const TRestoringMap& theMap);
-    typedef std::map<string,TStorableEngine> TCallbackMap;
+    typedef std::map<std::string,TStorableEngine> TCallbackMap;
     static void Registry(const char* theComment, TStorableEngine theEngine);
     static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString); 
     static const QString& FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
@@ -117,7 +117,7 @@ namespace VISU{
 
   //===========================================================================
   const CORBA::Boolean IsMultifile();
-  QString GenerateName(const string& theFmt, int theId);
+  QString GenerateName(const std::string& theFmt, int theId);
 
   PortableServer::ServantBase_var GetServant(CORBA::Object_ptr theObject);
   CORBA::Object_var SObjectToObject(SALOMEDS::SObject_ptr theSObject);
@@ -134,4 +134,5 @@ namespace VISU{
                                   const char* theComment, int IsAllLevels = true);
 }
 
+
 #endif
index 50acfbe13567e88d4269000a00e170704b95892a..2c1d3a0f55a8a0677c70636a47a51234a32cf672 100644 (file)
@@ -261,6 +261,7 @@ VISU_Convertor* VISU_MEDFieldConvertor::Build() {
 
   VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
   aMesh.myDim = aMEDMesh->getSpaceDimension();
+  aMesh.myPointsDim.resize(aMesh.myDim);
   aMesh.myName = aMeshName.in();
   VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
   aMesh2.myMesh = aMEDMesh;
@@ -296,7 +297,7 @@ VISU_Convertor* VISU_MEDFieldConvertor::Build() {
   VISUMED::TField::TValForTime& aValForTime2 = aField2.myValField[iTimeStamp];
   aValForTime2.myField = myField;
   if(MYDEBUG) 
-    MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<aFieldName<<"'; myId = "<<aField.myId<<"; myTime = "<<dt);
+    MESSAGE("VISU_MEDFieldConvertor::Build - aFieldName = '"<<aFieldName<<"'; myId = "<<aField.myId<<"; myTime = "<<dt);
   return this;
 }
 
@@ -308,200 +309,213 @@ VISU_Convertor* VISU_MEDConvertor::Build() {
   CORBA::Object_var aMedObject = SObjectToObject(mySObject);
   if(!CORBA::is_nil(aMedObject)){
     SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(aMedObject);
-    if(!aMED->_is_nil()){
-      CORBA::Short aTag = mySObject->Tag();
-      SALOMEDS::SObject_var aMedCompSObj = mySObject->GetFather();
-      SALOMEDS::SObject_var aMeshSObj;
-      if(!aMedCompSObj->FindSubObject(aTag+1,aMeshSObj)) 
-       throw std::runtime_error("VISU_MEDConvertor::Build >> Cann't find MEDMESH label !!!");
-      if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - MEDMESH found.");
-      SALOMEDS::ChildIterator_var aMeshIterator = aStudy->NewChildIterator(aMeshSObj);
-      for(; aMeshIterator->More(); aMeshIterator->Next()){
-       aMeshSObj = aMeshIterator->Value();
-       if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshSObj = '"<<::GetName(aMeshSObj)<<"'");
-       CORBA::Object_var aMedMesh = SObjectToObject(aMeshSObj);
-       if(CORBA::is_nil(aMedMesh)) continue;
-       SALOME_MED::MESH_var aMEDMesh = SALOME_MED::MESH::_narrow(aMedMesh);
-       if(aMEDMesh->_is_nil()) continue;
-       CORBA::String_var aMeshName = aMEDMesh->getName();
-       VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
-       aMesh.myDim = aMEDMesh->getSpaceDimension();
-       aMesh.myName = aMeshName.in();
-       aMesh.myPointsDim.resize(aMesh.myDim);
-       VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
-       aMesh2.myMesh = aMEDMesh;
-       if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh.myDim);
-       SALOMEDS::ChildIterator_var aSupportIterator = aStudy->NewChildIterator(aMeshSObj);
-       for(; aSupportIterator->More(); aSupportIterator->Next()){
-         SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
-         CORBA::Object_var aMedSupport = SObjectToObject(aSupportSObj);
-         if(CORBA::is_nil(aMedSupport)) continue;
-         SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); 
-         if(aMEDSupport->_is_nil()) continue;
-         SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
-         SALOME_MED::medEntityMesh aMEDEntity = aMEDSupport->getEntity();
-         VISU::TEntity anEntity = aMed2VisuEntity[aMEDEntity];
-         CORBA::String_var aSupportName = aMEDSupport->getName();
-         if(aMEDSupport->isOnAllElements()){
-           if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<"' anEntity = "<<anEntity);
-           int aNbCells, aCellsSize;
-           //Check, if there is any data on the support?
-           if(anEntity == VISU::NODE_ENTITY){
-             aMesh.myNbPoints = aMeshOnSupport->getNumberOfNodes();
-             aNbCells = aMesh.myNbPoints;
-             aCellsSize = 2*aMesh.myNbPoints;
-           }else{
-             GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,anEntity);
-           }
-           if(aNbCells == 0) continue;
-           VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
-           aMeshOnEntity.myMeshName = aMeshName.in();
-           aMeshOnEntity.myEntity = anEntity;
-           aMeshOnEntity.myNbCells = aNbCells;
-           aMeshOnEntity.myCellsSize = aCellsSize;
-
-           VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
-           aMeshOnEntity2.mySupport = aMEDSupport;
-         }else{
-           SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
-           if(!aMEDFamily->_is_nil()) {
-             int aNbCells, aCellsSize;
-             GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
-             if(aNbCells > 0){
-               if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFamily = '"<<aSupportName<<"' anEntity = "<<anEntity);
-               VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
-               VISU::TFamily& aFamily = aMeshOnEntity.myFamilyMap[aSupportName.in()];
-               aFamily.myName = aSupportName.in();
-               aFamily.myEntity = anEntity;
-               aFamily.myNbCells = aNbCells;
-               aFamily.myCellsSize = aCellsSize;
-               aFamily.myId = aMEDFamily->getIdentifier();
-
-               VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
-               VISUMED::TFamily& aFamily2 = aMeshOnEntity2.myFamilyMap[aSupportName.in()];
-               aFamily2.myFamily = aMEDFamily;
-             }
-           }
-           SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
-           if(!aMEDGroup->_is_nil()) {
-             if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup = '"<<aSupportName<<"' anEntity = "<<anEntity);
-             VISUMED::TGroupMap& aGroupMap2 = aMesh2.myGroupMap;
-             VISUMED::TGroup& aGroup2 = aGroupMap2[aSupportName.in()];
-             aGroup2.myGroup = aMEDGroup;
-             SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
-             int iFamilyEnd = aFamilies->length();
-             for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
-               aMEDFamily = aFamilies[iFamaily];
-               CORBA::String_var aFamilyName = aMEDFamily->getName();
-               VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
-               if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"'");
-               VISU::TFamily& aFamily = aMeshOnEntity.myFamilyMap[aFamilyName.in()];
-               VISU::TBindGroups& aBindGroups = aFamily.myGroups;
-               aBindGroups.insert(aSupportName.in());
-             }
-           }
-         }
-       }
-       //Correction of TMesh.TGroupMap
-       const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh.myMeshOnEntityMap;
-       if(aMeshOnEntityMap.empty()) continue;
-       VISU::TGroupMap& aGroupMap = aMesh.myGroupMap;
-       VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
-       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
-         const VISU::TMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-         const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity.myFamilyMap;
-         if(aFamilyMap.empty()) continue;
-         VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
-         for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
-           const VISU::TFamily& aFamily = aFamilyMapIter->second;
-           const VISU::TBindGroups& aBindGroups = aFamily.myGroups;
-           if(aBindGroups.empty()) continue;
-           VISU::TBindGroups::const_iterator aBindGroupsIter = aBindGroups.begin();
-           for(; aBindGroupsIter != aBindGroups.end(); aBindGroupsIter++){
-             const string& aGroupName = *aBindGroupsIter;
-             VISU::TGroup& aGroup = aGroupMap[aGroupName];
-             aGroup.myName = aGroupName;
-             aGroup.myMeshName = aMesh.myName;
-             aGroup.myNbCells += aFamily.myNbCells;
-             aGroup.myCellsSize += aFamily.myCellsSize;
-             VISU::TFamilyAndEntity aFamilyAndEntity(aFamily.myName,aFamily.myEntity);
-             aGroup.myFamilyAndEntitySet.insert(aFamilyAndEntity);
-           }
-         }
-       }
-      }
-      SALOMEDS::SObject_var aFieldSObj;
-      if(aMedCompSObj->FindSubObject(aTag+2,aFieldSObj)){
-       if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - MEDFIELD found.");
-       SALOMEDS::ChildIterator_var aFieldIterator = aStudy->NewChildIterator(aFieldSObj);
-       for(int iField = 0; aFieldIterator->More(); aFieldIterator->Next(), iField++){
-         aFieldSObj = aFieldIterator->Value();
-         if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<::GetName(aFieldSObj)<<"'");
-         SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(aFieldSObj);
-         for(int iTimeStamp = 1; aTimeStampIterator->More(); aTimeStampIterator->Next(), iTimeStamp++){
-           SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
-           if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<::GetName(aTimeStampSObj)<<"'");
-           CORBA::Object_var aMedField = SObjectToObject(aTimeStampSObj);
-           if(CORBA::is_nil(aMedField)) continue;
-           SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
-           if(aMEDField->_is_nil()) continue;
-           SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
-           if(aMEDSupport->_is_nil()) continue;
-           SALOME_MED::medEntityMesh aMEDEntity = aMEDSupport->getEntity();
-           VISU::TEntity anEntity = aMed2VisuEntity[aMEDEntity];
-           SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
-           if(aMEDMesh->_is_nil()) continue;
-           CORBA::String_var aMeshName = aMEDMesh->getName();
-           CORBA::String_var aFieldName = aMEDField->getName();
-
-           VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
-           aMesh.myDim = aMEDMesh->getSpaceDimension();
-           aMesh.myName = aMeshName.in();
-           VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
-           aMesh2.myMesh = aMEDMesh;
+    return Build(aMED);
+  }
+
+  SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(mySObject);
+  return Build(aTimeStampIterator);
+}
 
+
+VISU_Convertor* VISU_MEDConvertor::Build(SALOME_MED::MED_ptr theMED)
+{
+  if(theMED->_is_nil()) return NULL;
+  CORBA::Short aTag = mySObject->Tag();
+  SALOMEDS::SObject_var aMedCompSObj = mySObject->GetFather();
+  SALOMEDS::SObject_var aMeshSObj;
+  if(!aMedCompSObj->FindSubObject(aTag+1,aMeshSObj)) 
+    throw std::runtime_error("VISU_MEDConvertor::Build >> Cann't find MEDMESH label !!!");
+  if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - MEDMESH found.");
+  SALOMEDS::Study_var aStudy = mySObject->GetStudy();
+  SALOMEDS::ChildIterator_var aMeshIterator = aStudy->NewChildIterator(aMeshSObj);
+  for(; aMeshIterator->More(); aMeshIterator->Next()){
+    aMeshSObj = aMeshIterator->Value();
+    if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshSObj = '"<<::GetName(aMeshSObj)<<"'");
+    CORBA::Object_var aMedMesh = SObjectToObject(aMeshSObj);
+    if(CORBA::is_nil(aMedMesh)) continue;
+    SALOME_MED::MESH_var aMEDMesh = SALOME_MED::MESH::_narrow(aMedMesh);
+    if(aMEDMesh->_is_nil()) continue;
+    CORBA::String_var aMeshName = aMEDMesh->getName();
+    VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
+    aMesh.myDim = aMEDMesh->getSpaceDimension();
+    aMesh.myName = aMeshName.in();
+    aMesh.myPointsDim.resize(aMesh.myDim);
+    VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
+    aMesh2.myMesh = aMEDMesh;
+    if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aMeshName = "<<aMeshName<<"; myDim = "<<aMesh.myDim);
+    SALOMEDS::ChildIterator_var aSupportIterator = aStudy->NewChildIterator(aMeshSObj);
+    for(; aSupportIterator->More(); aSupportIterator->Next()){
+      SALOMEDS::SObject_var aSupportSObj = aSupportIterator->Value();
+      CORBA::Object_var aMedSupport = SObjectToObject(aSupportSObj);
+      if(CORBA::is_nil(aMedSupport)) continue;
+      SALOME_MED::SUPPORT_var aMEDSupport = SALOME_MED::SUPPORT::_narrow(aMedSupport); 
+      if(aMEDSupport->_is_nil()) continue;
+      SALOME_MED::MESH_var aMeshOnSupport = aMEDSupport->getMesh();
+      SALOME_MED::medEntityMesh aMEDEntity = aMEDSupport->getEntity();
+      VISU::TEntity anEntity = aMed2VisuEntity[aMEDEntity];
+      CORBA::String_var aSupportName = aMEDSupport->getName();
+      if(aMEDSupport->isOnAllElements()){
+       if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - Support isOnAllElements = '"<<aSupportName<<"' anEntity = "<<anEntity);
+       int aNbCells, aCellsSize;
+       //Check, if there is any data on the support?
+       if(anEntity == VISU::NODE_ENTITY){
+         aMesh.myNbPoints = aMeshOnSupport->getNumberOfNodes();
+         aNbCells = aMesh.myNbPoints;
+         aCellsSize = 2*aMesh.myNbPoints;
+       }else{
+         GetCellsSize(aNbCells,aCellsSize,aMeshOnSupport,anEntity);
+       }
+       if(aNbCells == 0) continue;
+       VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
+       aMeshOnEntity.myMeshName = aMeshName.in();
+       aMeshOnEntity.myEntity = anEntity;
+       aMeshOnEntity.myNbCells = aNbCells;
+       aMeshOnEntity.myCellsSize = aCellsSize;
+       
+       VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
+       aMeshOnEntity2.mySupport = aMEDSupport;
+      }else{
+       SALOME_MED::FAMILY_var aMEDFamily = SALOME_MED::FAMILY::_narrow(aMedSupport);
+       if(!aMEDFamily->_is_nil()) {
+         int aNbCells, aCellsSize;
+         GetCellsSize(aNbCells,aCellsSize,aMEDFamily);
+         if(aNbCells > 0){
+           if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFamily = '"<<aSupportName<<"' anEntity = "<<anEntity);
            VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
-           aMeshOnEntity.myEntity = anEntity;
-           aMeshOnEntity.myMeshName = aMeshName.in();
+           VISU::TFamily& aFamily = aMeshOnEntity.myFamilyMap[aSupportName.in()];
+           aFamily.myName = aSupportName.in();
+           aFamily.myEntity = anEntity;
+           aFamily.myNbCells = aNbCells;
+           aFamily.myCellsSize = aCellsSize;
+           aFamily.myId = aMEDFamily->getIdentifier();
+           
            VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
-           aMeshOnEntity2.mySupport = aMEDSupport;
-           if(anEntity == VISU::NODE_ENTITY)
-             aMesh2.myMeshOnEntityMap[VISU::CELL_ENTITY].mySupport = aMEDSupport;
-           GetCellsSize(aMesh,aMEDMesh,anEntity);
-
-           VISU::TField& aField = aMeshOnEntity.myFieldMap[aFieldName.in()];
-           aField.myId = iField;
-           aField.myName = aFieldName.in();
-           aField.myEntity = anEntity;
-           aField.myMeshName = aMeshName.in();
-           aField.myNbComp = aMEDField->getNumberOfComponents();
-           aField.myNbValField = iTimeStamp;
-           aField.myDataSize = aMeshOnEntity.myNbCells * aField.myNbComp;
-           if(MYDEBUG && !iTimeStamp) 
-             MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity.myNbCells = "<<aMeshOnEntity.myNbCells);
-           aField.myCompNames.resize(aField.myNbComp);
-           aField.myUnitNames.resize(aField.myNbComp);
-
-           int anId = aMEDField->getIterationNumber();
-           VISU::TField::TValForTime& aValForTime = aField.myValField[anId];
-           aValForTime.myId = anId;
-           aValForTime.myTime = VISU::TField::TTime(aMEDField->getTime(),"");
-           VISUMED::TField& aField2 = aMeshOnEntity2.myFieldMap[aFieldName.in()];
-           VISUMED::TField::TValForTime& aValForTime2 = aField2.myValField[anId];
-           aValForTime2.myField = aMEDField;
-           if(MYDEBUG) 
-             MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
-                     "'; myEntity = "<<anEntity<<"; myTime = "<<aValForTime.myTime.first);
-         }      
-       }
+           VISUMED::TFamily& aFamily2 = aMeshOnEntity2.myFamilyMap[aSupportName.in()];
+           aFamily2.myFamily = aMEDFamily;
+         }
+       }
+       SALOME_MED::GROUP_var aMEDGroup = SALOME_MED::GROUP::_narrow(aMedSupport);
+       if(!aMEDGroup->_is_nil()) {
+         if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup = '"<<aSupportName<<"' anEntity = "<<anEntity);
+         VISUMED::TGroupMap& aGroupMap2 = aMesh2.myGroupMap;
+         VISUMED::TGroup& aGroup2 = aGroupMap2[aSupportName.in()];
+         aGroup2.myGroup = aMEDGroup;
+         SALOME_MED::Family_array_var aFamilies = aMEDGroup->getFamilies();
+         int iFamilyEnd = aFamilies->length();
+         for(int iFamaily = 0; iFamaily < iFamilyEnd; iFamaily++){
+           aMEDFamily = aFamilies[iFamaily];
+           CORBA::String_var aFamilyName = aMEDFamily->getName();
+           VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
+           if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aGroup - aFamilyName = '"<<aFamilyName.in()<<"'");
+           VISU::TFamily& aFamily = aMeshOnEntity.myFamilyMap[aFamilyName.in()];
+           VISU::TBindGroups& aBindGroups = aFamily.myGroups;
+           aBindGroups.insert(aSupportName.in());
+         }
+       }
+      }
+    }
+    //Correction of TMesh.TGroupMap
+    const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh.myMeshOnEntityMap;
+    if(aMeshOnEntityMap.empty()) continue;
+    VISU::TGroupMap& aGroupMap = aMesh.myGroupMap;
+    VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+    for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
+      const VISU::TMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+      const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity.myFamilyMap;
+      if(aFamilyMap.empty()) continue;
+      VISU::TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+      for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+       const VISU::TFamily& aFamily = aFamilyMapIter->second;
+       const VISU::TBindGroups& aBindGroups = aFamily.myGroups;
+       if(aBindGroups.empty()) continue;
+       VISU::TBindGroups::const_iterator aBindGroupsIter = aBindGroups.begin();
+       for(; aBindGroupsIter != aBindGroups.end(); aBindGroupsIter++){
+         const string& aGroupName = *aBindGroupsIter;
+         VISU::TGroup& aGroup = aGroupMap[aGroupName];
+         aGroup.myName = aGroupName;
+         aGroup.myMeshName = aMesh.myName;
+         aGroup.myNbCells += aFamily.myNbCells;
+         aGroup.myCellsSize += aFamily.myCellsSize;
+         VISU::TFamilyAndEntity aFamilyAndEntity(aFamily.myName,aFamily.myEntity);
+         aGroup.myFamilyAndEntitySet.insert(aFamilyAndEntity);
+       }
       }
-      return this; 
     }
-    return NULL; 
   }
-  SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(mySObject);
-  for(int iTimeStamp = 1; aTimeStampIterator->More(); aTimeStampIterator->Next(), iTimeStamp++){
-    SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
+  SALOMEDS::SObject_var aFieldSObj;
+  if(aMedCompSObj->FindSubObject(aTag+2,aFieldSObj)){
+    if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - MEDFIELD found.");
+    SALOMEDS::ChildIterator_var aFieldIterator = aStudy->NewChildIterator(aFieldSObj);
+    for(int iField = 0; aFieldIterator->More(); aFieldIterator->Next(), iField++){
+      aFieldSObj = aFieldIterator->Value();
+      if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aFieldName = '"<<::GetName(aFieldSObj)<<"'");
+      SALOMEDS::ChildIterator_var aTimeStampIterator = aStudy->NewChildIterator(aFieldSObj);
+      for(int iTimeStamp = 1; aTimeStampIterator->More(); aTimeStampIterator->Next(), iTimeStamp++){
+       SALOMEDS::SObject_var aTimeStampSObj = aTimeStampIterator->Value();
+       if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<::GetName(aTimeStampSObj)<<"'");
+       CORBA::Object_var aMedField = SObjectToObject(aTimeStampSObj);
+       if(CORBA::is_nil(aMedField)) continue;
+       SALOME_MED::FIELD_var aMEDField = SALOME_MED::FIELD::_narrow(aMedField);
+       if(aMEDField->_is_nil()) continue;
+       SALOME_MED::SUPPORT_var aMEDSupport = aMEDField->getSupport();
+       if(aMEDSupport->_is_nil()) continue;
+       SALOME_MED::medEntityMesh aMEDEntity = aMEDSupport->getEntity();
+       VISU::TEntity anEntity = aMed2VisuEntity[aMEDEntity];
+       SALOME_MED::MESH_var aMEDMesh = aMEDSupport->getMesh();
+       if(aMEDMesh->_is_nil()) continue;
+       CORBA::String_var aMeshName = aMEDMesh->getName();
+       CORBA::String_var aFieldName = aMEDField->getName();
+       
+       VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
+       aMesh.myDim = aMEDMesh->getSpaceDimension();
+       aMesh.myName = aMeshName.in();
+       VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
+       aMesh2.myMesh = aMEDMesh;
+       
+       VISU::TMeshOnEntity& aMeshOnEntity = aMesh.myMeshOnEntityMap[anEntity];
+       aMeshOnEntity.myEntity = anEntity;
+       aMeshOnEntity.myMeshName = aMeshName.in();
+       VISUMED::TMeshOnEntity& aMeshOnEntity2 = aMesh2.myMeshOnEntityMap[anEntity];
+       aMeshOnEntity2.mySupport = aMEDSupport;
+       if(anEntity == VISU::NODE_ENTITY)
+         aMesh2.myMeshOnEntityMap[VISU::CELL_ENTITY].mySupport = aMEDSupport;
+       GetCellsSize(aMesh,aMEDMesh,anEntity);
+       
+       VISU::TField& aField = aMeshOnEntity.myFieldMap[aFieldName.in()];
+       aField.myId = iField;
+       aField.myName = aFieldName.in();
+       aField.myEntity = anEntity;
+       aField.myMeshName = aMeshName.in();
+       aField.myNbComp = aMEDField->getNumberOfComponents();
+       aField.myNbValField = iTimeStamp;
+       aField.myDataSize = aMeshOnEntity.myNbCells * aField.myNbComp;
+       if(MYDEBUG && !iTimeStamp) 
+         MESSAGE("VISU_MEDConvertor::Build - aMeshOnEntity.myNbCells = "<<aMeshOnEntity.myNbCells);
+       aField.myCompNames.resize(aField.myNbComp);
+       aField.myUnitNames.resize(aField.myNbComp);
+       
+       int anId = aMEDField->getIterationNumber();
+       VISU::TField::TValForTime& aValForTime = aField.myValField[anId];
+       aValForTime.myId = anId;
+       aValForTime.myTime = VISU::TField::TTime(aMEDField->getTime(),"");
+       VISUMED::TField& aField2 = aMeshOnEntity2.myFieldMap[aFieldName.in()];
+       VISUMED::TField::TValForTime& aValForTime2 = aField2.myValField[anId];
+       aValForTime2.myField = aMEDField;
+       if(MYDEBUG) 
+         MESSAGE("VISU_MEDConvertor::Build - aMeshName = '"<<aMeshName<<
+                 "'; myEntity = "<<anEntity<<"; myTime = "<<aValForTime.myTime.first);
+      }      
+    }
+  }
+  return this; 
+}
+
+VISU_Convertor* VISU_MEDConvertor::Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator)
+{
+  if(theTimeStampIterator->_is_nil()) return NULL;
+  for(int iTimeStamp = 1; theTimeStampIterator->More(); theTimeStampIterator->Next(), iTimeStamp++){
+    SALOMEDS::SObject_var aTimeStampSObj = theTimeStampIterator->Value();
     if(MYDEBUG) MESSAGE("VISU_MEDConvertor::Build - aTimeStampSObj = '"<<::GetName(aTimeStampSObj)<<"'");
     CORBA::Object_var aMedField = SObjectToObject(aTimeStampSObj);
     if(CORBA::is_nil(aMedField)) continue;
@@ -518,6 +532,7 @@ VISU_Convertor* VISU_MEDConvertor::Build() {
 
     VISU::TMesh &aMesh = myMeshMap[aMeshName.in()];
     aMesh.myDim = aMEDMesh->getSpaceDimension();
+    aMesh.myPointsDim.resize(aMesh.myDim);
     aMesh.myName = aMeshName.in();
     aMesh.myNbPoints = aMEDMesh->getNumberOfNodes();
     VISUMED::TMesh &aMesh2 = myMeshMap2[aMeshName.in()];
@@ -561,6 +576,7 @@ VISU_Convertor* VISU_MEDConvertor::Build() {
   return this; 
 }
 
+
 int VISU_MEDConvertor::LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
                                        const string& theFamilyName)
 {
index 5a86fc7dbb5c39f3cba806d521aff168b1de683b..53bd83adfcca9e723b8668127928e4030369821b 100644 (file)
@@ -33,6 +33,8 @@
 #include "VISUConfig.hh"
 #include "VISU_Convertor_impl.hxx"
 
+#include <string>      
+
 extern "C"{
 #include <med.h>
 }  
@@ -50,12 +52,12 @@ namespace VISUMED{
     typedef std::map<int,TValForTime> TValField;
     TValField myValField;
   };
-  typedef map<string,TField> TFieldMap;
+  typedef std::map<std::string,TField> TFieldMap;
 
   struct TMeshOnEntity{
     SALOME_MED::SUPPORT_var mySupport;
-    typedef pair<int,int> TIndexAndSize;
-    typedef map<int,TIndexAndSize> TCellsFirstIndex;
+    typedef std::pair<int,int> TIndexAndSize;
+    typedef std::map<int,TIndexAndSize> TCellsFirstIndex;
     TCellsFirstIndex myCellsFirstIndex;
     TFamilyMap myFamilyMap;
     TFieldMap myFieldMap;
@@ -81,12 +83,18 @@ class VISU_MEDConvertor: public VISU_Convertor_impl{
   VISUMED::TMeshMap myMeshMap2;
   SALOMEDS::SObject_var mySObject;
   VISU_MEDConvertor() {};
+
  public:
   VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject) : mySObject(SALOMEDS::SObject::_duplicate(theMedSObject)) {}
-  virtual VISU_Convertor* Build() ;
+  virtual VISU_Convertor* Build();
+
  protected:
+
+  VISU_Convertor* Build(SALOME_MED::MED_ptr theMED);
+  VISU_Convertor* Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator);
+
   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
-                              const string& theFamilyName = "");
+                              const std::string& theFamilyName = "");
 
   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
                              const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
@@ -96,9 +104,9 @@ class VISU_MEDConvertor: public VISU_Convertor_impl{
                              VISU::TField& theField, 
                              VISU::TField::TValForTime& theValForTime);
 
-  int LoadPoints(VISU::TMesh& theMesh, const string& theFamilyName = "") ;
+  int LoadPoints(VISU::TMesh& theMesh, const std::string& theFamilyName = "") ;
 
-  int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName = "");
+  int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const std::string& theFamilyName = "");
 
   int LoadField(const VISU::TMeshOnEntity& theMeshOnEntity,
                const VISU::TField& theField, VISU::TField::TValForTime& theValForTime);
index 76b54bca987e3e61fde4602b9844dccfed34b05d..4021956fd18dfe51354b573d6aaf9e719f6d69e5 100644 (file)
@@ -376,9 +376,9 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
        aTableOfReal->SetRowUnit(iLineId+2,aUnitName.latin1());
       }
     }
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch (...){
-    INFOS("Unknown exception was accured !!!");
+    INFOS("Unknown exception was occured !!!");
   }
 }
index d77a80fdf386bdd60e39946319b6c4e9637ff15f..8333217fd7fddded443a1e955f752017e586718c 100644 (file)
@@ -29,6 +29,8 @@
 #include "VISU_DeformedShape_i.hh"
 #include "VISU_ScalarMapAct.h"
 
+#include <vtkDataSetMapper.h>
+
 using namespace VISU;
 using namespace std;
 
@@ -47,10 +49,10 @@ int VISU::DeformedShape_i::IsPossible(Result_i* theResult, const char* theMeshNa
     if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) return 0;
     const VISU::TField& aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
     return aField.myNbComp > 1;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
   }
   return 0;
 }
index 33527f6d89565c7a906701ac0af271cd427c040d..5db5aed55b5d09867b69460f7d969c6eabe1563f 100644 (file)
@@ -175,8 +175,8 @@ namespace VISU{
     Mutex mt(myMutex);
     SALOMEDS::Study_var aStudy = theComponent->GetStudy(); 
     SALOMEDS::StudyBuilder_var  aStudyBuilder = aStudy->NewBuilder(); 
-    TCollection_AsciiString aTmpDir =
-      isMultiFile?TCollection_AsciiString((char*)theURL):SALOMEDS_Tool::GetTmpDir();
+    const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
+    TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
     VisuTmpDir = aTmpDir.ToCString();
     SALOMEDS::ListOfFileNames_var aSeq =
       SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile);
@@ -212,7 +212,8 @@ namespace VISU{
                                      bool isMultiFile)
   {
     Mutex mt(myMutex);
-    TCollection_AsciiString aTmpDir = isMultiFile? strdup(theURL): SALOMEDS_Tool::GetTmpDir();
+    const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
+    TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
     if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
     int aCounter = 0;
     TColStd_SequenceOfAsciiString aFileNames;
@@ -227,7 +228,7 @@ namespace VISU{
        if(aSourceId == Result_i::eFile || aSourceId == Result_i::eRestoredFile){
          const QFileInfo& aFileInfo = pResult->GetFileInfo();
          QString aPrefix("");
-         if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
+         if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str();
          QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
          static QString aCommand;
          aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
@@ -263,8 +264,8 @@ namespace VISU{
                                           bool isMultiFile) 
   {
     Mutex mt(myMutex);
-    CORBA::String_var aString = SALOMEDS_Tool::GetTmpDir();
-    TCollection_AsciiString aTmpDir = isMultiFile? (const Standard_CString)theURL: (const Standard_CString)aString.in();
+    const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str();
+    TCollection_AsciiString aTmpDir(const_cast<char*>(aDir));
     if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
     int aCounter = 0;
     TColStd_SequenceOfAsciiString aFileNames;
@@ -279,7 +280,7 @@ namespace VISU{
        if(aSourceId == Result_i::eFile || aSourceId == Result_i::eRestoredFile){
          const QFileInfo& aFileInfo = pResult->GetFileInfo();
          QString aPrefix("");
-         if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
+         if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str();
          QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
          static QString aCommand;
          aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
@@ -436,9 +437,9 @@ namespace VISU{
        return aPresent->_this();
       else{
        aPresent->_remove_ref();
-       return VISU::Mesh::_nil();
       }
     }
+    return VISU::Mesh::_nil();
   }
 
   Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, 
@@ -455,9 +456,9 @@ namespace VISU{
        return aPresent->_this();
       else{
        aPresent->_remove_ref();
-       return VISU::Mesh::_nil();
       }
     }
+    return VISU::Mesh::_nil();
   }
 
   Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult, 
@@ -473,9 +474,9 @@ namespace VISU{
        return aPresent->_this();
       else{
        aPresent->_remove_ref();
-       return VISU::Mesh::_nil();
       }
     }
+    return VISU::Mesh::_nil();
   }
 
   ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult, 
@@ -647,8 +648,10 @@ namespace VISU{
          }
        }
       }
+    }catch(std::exception& exc){
+      INFOS("Follow exception was occured :\n"<<exc.what());
     }catch (...){
-      INFOS("Unknown exception was accured!");
+      INFOS("Unknown exception was occured!");
     }
     return false;
   }
@@ -680,26 +683,29 @@ namespace VISU{
     if (!pStorable) {
       return NULL;
     }
-    CORBA::String_var aTmpDir = SALOMEDS_Tool::GetTmpDir();
-    
+
+    string aTmpDir = SALOMEDS_Tool::GetTmpDir();
+    string aCopyPersist =  aTmpDir + "copy_persistent";
+
+    ofstream stmOut2(aCopyPersist.c_str(),ios::out);
     string aStr = pStorable->ToString().c_str();
-    ofstream stmOut2((string(aTmpDir) + string("copy_persistent")).c_str(),ios::out);
     stmOut2<<aStr<<endl;
     stmOut2.close();
     
     if (Result_i* aResultObj = dynamic_cast<Result_i*>(aPOA->reference_to_servant(aCorbaObj))) {
       string aFileName = string(SALOMEDS_Tool::GetNameFromPath(theObject->GetStudy()->URL())) + "_";
+      if(strlen(aFileName.c_str()) == 1) aFileName="";
       const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
       aFileName += aFileInfo.fileName().latin1();
       static QString aCommand;
+      string aFullFileName =  aTmpDir + aFileName;
       aCommand.sprintf("cp %s %s",
                       aFileInfo.filePath().latin1(),
-                      (string(aTmpDir) + aFileName).c_str());
+                      aFullFileName.c_str());
       if(system(aCommand) == -1) {
        if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<<aCommand);
        return NULL;
       }
-      
       aSeq->length(2);
       aSeq[0] = "copy_persistent";
       aSeq[1] = aFileName.c_str();
@@ -707,8 +713,9 @@ namespace VISU{
       aSeq->length(1);
       aSeq[0] = "copy_persistent";
     }
-    aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aSeq.in(), false);
-    SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeq.in(), true);
+
+    aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq.in(), false);
+    SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true);
     
     // Assign an ID = 1 the the type VISU::Result
     theObjectID = 1;
@@ -734,11 +741,11 @@ namespace VISU{
     SALOMEDS::SObject_var aResultSO;
     if (theObjectID != 1) 
       return aResultSO._retn();
+
+    string aTmpDir = SALOMEDS_Tool::GetTmpDir();
+    SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), false);
     
-    CORBA::String_var aTmpDir = (const char*)SALOMEDS_Tool::GetTmpDir();
-    SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
-    
-    ifstream stmIn((string(aTmpDir) + string("copy_persistent")).c_str());
+    ifstream stmIn((aTmpDir + string("copy_persistent")).c_str());
     stmIn.seekg(0, ios::end);
     int aLength = stmIn.tellg();
     stmIn.seekg(0, ios::beg);
@@ -747,9 +754,13 @@ namespace VISU{
     aString[aLength] = 0;
     myIsMultiFile = false;
     
-    string aFileName(aTmpDir.in());
-    if(aSeq->length() > 1) aFileName += aSeq[1].in();
-    
+    string aFileName(aTmpDir);
+    string aBasicFileName;
+    if(aSeq->length() > 1) {
+      aBasicFileName = aSeq[1].in();
+      aFileName += aBasicFileName;
+    }
+
     SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
     SALOMEDS::Study_var aStudy = theObject->GetStudy();
     SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
@@ -768,7 +779,8 @@ namespace VISU{
     SALOMEDS::ListOfFileNames_var aSeqToRm = new SALOMEDS::ListOfFileNames;
     aSeqToRm->length(1);
     aSeqToRm[0] = "copy_persistent";
-    SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeqToRm.in(), true);
+
+    SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeqToRm.in(), true);
     
     anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR");
     SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
@@ -777,4 +789,4 @@ namespace VISU{
     return aResultSO._retn();
   }
 
-};
+}
index 99572fae16bbb470a0bd2bc9053fd34749af0b8e..7869cd6c55e89b4d0a9639689f7c39d4102304d0 100644 (file)
@@ -95,6 +95,9 @@ namespace VISU{
     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 SALOMEDS::Driver
     virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
                                    const char* theURL,
@@ -136,14 +139,6 @@ namespace VISU{
     SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
                                    CORBA::Long theObjectID,
                                    SALOMEDS::SObject_ptr theObject);
-    /*! SAN & VSR : Test QT_EVENT 
-      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-    */
-    virtual void CreateTestView();
-    virtual void ShowTestObject();
-    /*! SAN & VSR : Test QT_EVENT
-      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-    */
   };
 }
 #endif 
index c556d1739c6429d4c7016662f9283174a636950b..d5f6e584e4ed548df1b391f3d2e388811e7871e0 100644 (file)
@@ -77,10 +77,10 @@ int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, Entit
     bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
     MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     return aResult;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
   }
   return 0;
 }
@@ -101,10 +101,10 @@ int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, const
     bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
     INFOS("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     return aResult;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
   }
   return 0;
 }
@@ -175,7 +175,7 @@ VISU::Mesh_i::~Mesh_i(){
 VISU::Storable* VISU::Mesh_i::Build(int theRestoring){
   SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
   aStudyBuilder->NewCommand();  // There is a transaction
-  try{
+  //try{
     if(myResult->GetInput() == NULL) 
       throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
     if(!theRestoring){
@@ -228,13 +228,13 @@ VISU::Storable* VISU::Mesh_i::Build(int theRestoring){
       CORBA::String_var aString = GetID();
       anIOR->SetValue(aString); 
     }
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
-    return NULL;
-  }catch(...){
-    INFOS("Unknown exception was accured!");
-    return NULL;
-  } 
+  //}catch(std::exception& exc){
+  //  INFOS("Follow exception was occured :\n"<<exc.what());
+  //  return NULL;
+  //}catch(...){
+  //  INFOS("Unknown exception was occured!");
+  //  return NULL;
+  //
   aStudyBuilder->CommitCommand();
   return this;
 }
index 9a71122e5e8036b9ae58e39effee308c4c478a19..5220a7884ac1ffbc7f9884efdac6c2eebb9191b8 100644 (file)
@@ -30,6 +30,7 @@
 #include "VISU_Actor.h"
 
 #include <vtkGeometryFilter.h>
+#include <vtkDataSetMapper.h>
 
 using namespace VISU;
 using namespace std;
@@ -73,8 +74,7 @@ void VISU::Prs3d_i::CreateActor(VISU_Actor* theActor, const Handle(SALOME_Intera
     if(myAddToStudy){
       Handle(SALOME_InteractiveObject) anIO = theIO;
       if(anIO.IsNull()){
-       CORBA::String_var anEntry = mySObject->GetID();
-       anIO = new SALOME_InteractiveObject(strdup(anEntry.in()),"VISU",strdup(GetName()));
+       anIO = new SALOME_InteractiveObject(mySObject->GetID(),"VISU",GetName());
       }
       theActor->setIO(anIO); 
     }
index 3fcdc2b1432ab76a7253956a0146c7996e63c961..dc8b0903070e0742a47b00644e6307152b5924bf 100644 (file)
@@ -150,10 +150,10 @@ int VISU::Result_i::IsPossible(){
     bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
     MESSAGE("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
     return aResult;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
   }
   return 0;
 }
@@ -187,10 +187,10 @@ CORBA::Boolean VISU::Result_i::BuildAll(){
            int aTimeStamp = aValFieldIter->first;
            try{
              myInput->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
-           }catch(std::runtime_error& exc){
-             INFOS("Follow exception was accured :\n"<<exc.what());
+           }catch(std::exception& exc){
+             INFOS("Follow exception was occured :\n"<<exc.what());
            }catch(...){
-             INFOS("Unknown exception was accured!!!");
+             INFOS("Unknown exception was occured!!!");
            }
          }
        }
@@ -201,10 +201,10 @@ CORBA::Boolean VISU::Result_i::BuildAll(){
          const string& aGroupName = aGroupMapIter->first;
          try{
            myInput->GetMeshOnGroup(aMeshName,aGroupName);
-         }catch(std::runtime_error& exc){
-           INFOS("Follow exception was accured :\n"<<exc.what());
+         }catch(std::exception& exc){
+           INFOS("Follow exception was occured :\n"<<exc.what());
          }catch(...){
-           INFOS("Unknown exception was accured!!!");
+           INFOS("Unknown exception was occured!!!");
          }
        }
        //Import families
@@ -214,27 +214,27 @@ CORBA::Boolean VISU::Result_i::BuildAll(){
          const string& aFamilyName = aFamilyMapIter->first;
          try{
            myInput->GetMeshOnEntity(aMeshName,anEntity,aFamilyName);
-         }catch(std::runtime_error& exc){
-           INFOS("Follow exception was accured :\n"<<exc.what());
+         }catch(std::exception& exc){
+           INFOS("Follow exception was occured :\n"<<exc.what());
          }catch(...){
-           INFOS("Unknown exception was accured!!!");
+           INFOS("Unknown exception was occured!!!");
          }
        }
        //Import mesh on entity
        try{
          myInput->GetMeshOnEntity(aMeshName,anEntity);
-       }catch(std::runtime_error& exc){
-         INFOS("Follow exception was accured :\n"<<exc.what());
+       }catch(std::exception& exc){
+         INFOS("Follow exception was occured :\n"<<exc.what());
        }catch(...){
-         INFOS("Unknown exception was accured!!!");
+         INFOS("Unknown exception was occured!!!");
        }
       }
     }
     myIsDone = 1;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!!!");
+    INFOS("Unknown exception was occured!!!");
   }
   return myIsDone;
 }
@@ -376,11 +376,11 @@ VISU::Storable* VISU::Result_i::Build(SALOMEDS::SObject_ptr theSObject)
     QString aIsBuild = QAD_CONFIG->getSetting("Visu:BuildResult");
     bool isBuildAll = aIsBuild.isEmpty()? 0 : aIsBuild.toInt();
     if(isBuildAll) BuildAll();
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
     return NULL;
   }catch(...){
-    INFOS("Unknown exception was accured!!!");
+    INFOS("Unknown exception was occured!!!");
     return NULL;
   }
   aStudyBuilder->CommitCommand();
@@ -393,7 +393,7 @@ VISU::Storable* VISU::Result_i::Create(const char* theFileName){
     myInitFileName = myFileInfo.filePath().latin1();
     myName = ::GenerateName(myFileInfo.fileName()).latin1();
     if(GetSourceId() == eRestoredFile){
-      auto_ptr<char> aTmpDir(SALOMEDS_Tool::GetTmpDir());
+      auto_ptr<char> aTmpDir((char*)SALOMEDS_Tool::GetTmpDir().c_str());
       static QString aCommand;
       aCommand.sprintf("cp %s %s",myFileInfo.absFilePath().latin1(),aTmpDir.get());
       if(system(aCommand) == -1){
@@ -405,12 +405,11 @@ VISU::Storable* VISU::Result_i::Create(const char* theFileName){
     }
     myInput = CreateConvertor(myFileInfo.absFilePath().latin1());
     if(!myInput) 
-      throw std::runtime_error("Create - Cannot create a Convertor for this file!!!");
-    return Build();
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+      throw std::runtime_error("Create - Cannot create a Convertor for this file!!!"); return Build();
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!!!");
+    INFOS("Unknown exception was occured!!!");
   }
   return NULL;
 }
@@ -426,10 +425,10 @@ VISU::Storable* VISU::Result_i::Create(SALOMEDS::SObject_ptr theMedSObject){
     myName = ::GenerateName("aResult").latin1();
     VISU::Storable* aStorable = Build(theMedSObject);
     return aStorable;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!!!");
+    INFOS("Unknown exception was occured!!!");
   }
   return NULL;
 }
@@ -444,12 +443,14 @@ VISU::Storable* VISU::Result_i::Create(SALOME_MED::FIELD_ptr theField){
     myFileInfo.setFile(aCompDataType.c_str());
     myInitFileName = aCompDataType;
     myName = ::GenerateName("aResult").latin1();
-    VISU::Storable* aStorable = Build();
+    CORBA::String_var anIOR = myStudyDocument->ConvertObjectToIOR(theField);
+    SALOMEDS::SObject_var aFieldSObject = myStudyDocument->FindObjectIOR(anIOR);
+    VISU::Storable* aStorable = Build(aFieldSObject);
     return aStorable;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!!!");
+    INFOS("Unknown exception was occured!!!");
   }
   return NULL;
 }
@@ -540,10 +541,10 @@ VISU::Storable* VISU::Result_i::Restore(SALOMEDS::SObject_ptr theSObject,
     if(aIsBuild.isEmpty()? 0 : aIsBuild.toInt()) 
       BuildAll();
     return this;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!!!");
+    INFOS("Unknown exception was occured!!!");
   }
   return NULL;
 }
index 471917179103dcdce64b9ac10f6611adec33d748..1f85a2c9dd6ba7027d0f4ec08d823b1b0ee5aa93 100644 (file)
@@ -55,7 +55,7 @@ namespace VISU{
     TSourceId mySourceId;
     TInput *myInput;
     CORBA::Boolean myIsDone;
-    string myName, myInitFileName;
+    std::string myName, myInitFileName;
     QFileInfo myFileInfo;
 
   protected:
@@ -68,16 +68,16 @@ namespace VISU{
     virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
     virtual Storable* Create(SALOME_MED::FIELD_ptr theField);
     virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
-                             const Storable::TRestoringMap& theMap, const string& thePrefix);
+                             const Storable::TRestoringMap& theMap, const std::string& thePrefix);
 
     static Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
-                            const string& thePrefix, const Storable::TRestoringMap& theMap);
+                            const std::string& thePrefix, const Storable::TRestoringMap& theMap);
 
     virtual void ToStream(std::ostringstream& theStr);
     virtual const char* GetComment() const;
-    static const string myComment;
+    static const std::string myComment;
     TInput* GetInput();
-    const string& GetName() const { return myName;}
+    const std::string& GetName() const { return myName;}
     const QFileInfo& GetFileInfo() const { return myFileInfo;}
     const Result_i::TSourceId& GetSourceId() const { return mySourceId;}
 
@@ -87,8 +87,8 @@ namespace VISU{
     SALOMEDS::SComponent_var mySComponent;
 
   public:
-    string GetRefFatherEntry();
-    string GetEntry();
+    std::string GetRefFatherEntry();
+    std::string GetEntry();
     const SALOMEDS::SObject_var& GetSObject() const;
     const SALOMEDS::Study_var& GetStudyDocument() const;
     const SALOMEDS::SComponent_var& GetSComponent() const;
index a668d043c807246d55b3ad416b4a3f1e6a78eb6b..96beba4d0b59643604d023c0545083bd44ec3832 100644 (file)
@@ -30,6 +30,9 @@
 #include "VISU_ScalarMapAct.h"
 #include "QAD_Config.h"
 
+#include <vtkDataSetMapper.h>
+#include <vtkTextProperty.h>
+
 using namespace VISU;
 using namespace std;
 
@@ -55,10 +58,10 @@ int VISU::ScalarMap_i::IsPossible(Result_i* theResult, const char* theMeshName,
       MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     }
     return aResult;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
   }
   return 0;
 }
@@ -463,11 +466,11 @@ VISU::Storable* VISU::ScalarMap_i::Build(int theRestoring){
       CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
       mySObject = myStudy->FindObjectIOR(anIOR);
     }
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
     return NULL;
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
     return NULL;
   }
   if(myAddToStudy) aStudyBuilder->CommitCommand();
index 85fd5da7c75963ed0e72767eb4ad8e53533ab44d..66a2305f10f24f4f7990c73adc19ff70c849f0da 100644 (file)
@@ -29,6 +29,7 @@
 #include "VISU_StreamLines_i.hh"
 #include "VISU_Actor.h"
 
+#include <vtkDataSetMapper.h>
 #include <vtkAppendFilter.h>
 
 using namespace VISU;
@@ -52,10 +53,10 @@ int VISU::StreamLines_i::IsPossible(Result_i* theResult, const char* theMeshName
     bool aResult = VISU_StreamLinesPL::IsPossible(anOutput);
     MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
     return aResult;
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
   }
   return 0;
 }
@@ -147,7 +148,7 @@ VISU::StreamLines_i::SetParams(CORBA::Double theIntStep,
   VISU::Prs3d_i* aPrs3di = NULL;
   vtkPointSet* aSource = NULL;
   if(!thePrs3d->_is_nil())
-    if(aPrs3di = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in())){
+    if((aPrs3di = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in()))){
       for(int i = myAppendFilter->GetNumberOfInputs()-1; i >= 0; i--)
        myAppendFilter->RemoveInput(myAppendFilter->GetInput(i));
       myAppendFilter->AddInput(aPrs3di->GetPL()->GetMapper()->GetInput());
index 0c683dc3bf98503b26ae309d2d45bdde33ec8abc..1607524ce31c374d90be9189c629b34f436e4fc8 100644 (file)
@@ -37,6 +37,7 @@
 #include <strstream>
 
 #include <qfileinfo.h>
+#include <qstring.h>
 #include <qfile.h>
 
 using namespace std;
@@ -388,14 +389,14 @@ string VISU::Curve_i::GetHorTitle()
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles();
       if ( rowTitles->length() > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() ) {
-       title = strdup( rowTitles[ myHRow-1 ] );
+       title = rowTitles[ myHRow-1 ];
       }
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles();
       if ( rowTitles->length() > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() ) {
-       title = strdup( rowTitles[ myHRow-1 ] );
+       title = rowTitles[ myHRow-1 ];
       }
     }
   }
@@ -418,13 +419,13 @@ string VISU::Curve_i::GetVerTitle()
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowTitles = anInt->GetRowTitles();
       if ( rowTitles->length() > 0 && myVRow > 0 && myVRow <= anInt->GetNbRows() )
-       title = strdup( rowTitles[ myVRow-1 ] );
+       title = rowTitles[ myVRow-1 ];
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowTitles = aReal->GetRowTitles();
       if ( rowTitles->length() > 0 && myVRow > 0 && myVRow <= aReal->GetNbRows() )
-       title = strdup( rowTitles[ myVRow-1 ] );
+       title = rowTitles[ myVRow-1 ];
     }
   }
   return title;
@@ -446,13 +447,13 @@ string VISU::Curve_i::GetHorUnits()
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowUnits = anInt->GetRowUnits();
       if ( rowUnits->length() > 0 && myHRow > 0 && myHRow <= anInt->GetNbRows() )
-       units = strdup( rowUnits[ myHRow-1 ] );
+       units = rowUnits[ myHRow-1 ];
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowUnits = aReal->GetRowUnits();
       if ( rowUnits->length() > 0 && myHRow > 0 && myHRow <= aReal->GetNbRows() )
-       units = strdup( rowUnits[ myHRow-1 ] );
+       units = rowUnits[ myHRow-1 ];
     }
   }
   return units;
@@ -474,13 +475,13 @@ string VISU::Curve_i::GetVerUnits()
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowUnits = anInt->GetRowUnits();
       if ( rowUnits->length() > 0 && myVRow > 0 && myVRow <= anInt->GetNbRows() )
-       units = strdup( rowUnits[ myVRow-1] );
+       units = rowUnits[ myVRow-1];
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
       SALOMEDS::StringSeq_var rowUnits = aReal->GetRowUnits();
       if ( rowUnits->length() > 0 && myVRow > 0 && myVRow <= aReal->GetNbRows() )
-       units = strdup( rowUnits[ myVRow-1 ] );
+       units = rowUnits[ myVRow-1 ];
     }
   }
   return units;
@@ -579,9 +580,9 @@ Plot2d_Curve* VISU::Curve_i::CreatePresentation()
   SALOMEDS::Color color = GetColor();
   crv->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
   crv->setAutoAssign( IsAuto() );
-  crv->setIO(new SALOME_InteractiveObject(strdup(mySObj->GetID()),"VISU",strdup(GetName()))); 
+  crv->setIO(new SALOME_InteractiveObject(mySObj->GetID(),"VISU",GetName()));
   if ( myTable )
-    crv->setTableIO(new SALOME_InteractiveObject(strdup(myTable->GetObjectEntry()),"VISU",strdup(myTable->GetName()))); 
+    crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(),"VISU",myTable->GetName()));
   return crv;
 }
 /*!
@@ -623,7 +624,7 @@ void VISU::Curve_i::ToStream( std::ostringstream& theStr )
   Gets reference table's entry
 */
 const char* VISU::Curve_i::GetTableID() { 
-  return CORBA::string_dup(myTable->GetObjectEntry());
+  return myTable->GetObjectEntry();
 }
 /*!
   Called from engine to restore curve from the file
@@ -904,7 +905,7 @@ VISU::Storable* VISU::Container_i::Restore(SALOMEDS::SObject_ptr theSObject,
 //-------------------------------------------------------------
 //             Implementation of reading from file
 //-------------------------------------------------------------
-typedef double TValue;
+typedef string TValue;
 typedef vector<TValue> TValues;
 
 struct TRow{
@@ -976,82 +977,126 @@ int getLine(ifstream& theStmIn, QString& theString){
 void ImportTables(const char* theFileName, TTableCont& theTableCont){
   static int STRPRECISION = 12;
   ifstream aStmIn;
-  QFileInfo aFileInfo(theFileName);
-  if(!aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size()) return;
-  aStmIn.open(theFileName);
+  QFileInfo aFileInfo( theFileName );
+  if( !aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size() )
+    return;
+  aStmIn.open( theFileName );
   QString aTmp;
-  do{
-    //Find beginning of Table
-    while(getLine(aStmIn,aTmp) && aTmp == "\n");
-    if(MYDEBUG) cout<<"\n There is new Table2D with Title = ";
+  do {
+    // find beginning of table (tables are separated by empty lines)
+    while( getLine( aStmIn, aTmp ) && aTmp.stripWhiteSpace() == "");
     TTable2D aTable2D;
-    while(!aStmIn.eof() && aTmp != "\n"){
-      if(aTmp.find("#TITLE:") == 0){
-       int aLen = aTmp.find(":") + 1;
-       aTmp.remove(0,aLen);
-       QString aTitle = aTmp.stripWhiteSpace();
-       aTable2D.myTitle = aTitle.latin1();
-       if(MYDEBUG) cout<<aTitle<<endl;
-      }else if(aTmp.find("#COLUMN_TITLES:") == 0){
-       int aLen = aTmp.find(":") + 1;
-       aTmp.remove(0,aLen);
-       QStringList aStrList = QStringList::split("|",aTmp);
-       if(MYDEBUG) cout<<"Its Column Titles : ";
-       for(int i = 0; i < aStrList.count(); i++){
-         aTmp = aStrList[i].stripWhiteSpace();
-         aTable2D.myColumnTitles.push_back(aTmp.latin1());
-         if(MYDEBUG) cout<<"\t"<<aTmp;
+    if(MYDEBUG) cout << "New table is found" << endl;
+    while( !aStmIn.eof() && aTmp.stripWhiteSpace() != "" ){
+      QString data = aTmp.stripWhiteSpace();
+      QString cmt = "";
+      QString keyword = "";
+      // split string to data and comment (comment starts from '#' symbol)
+      int index = aTmp.find( "#" );
+      if ( index >= 0 ) {
+       data = aTmp.left( index ).stripWhiteSpace();
+       cmt = aTmp.mid( index+1 ).stripWhiteSpace();
+      }
+      // if comment is not empty, try to get keyword from it (separated by ':' symbol)
+      if ( !cmt.isEmpty() ) {
+       int index1 = cmt.find( ":" );
+       if ( index1 >= 0 ) {
+         QString tmpstr = cmt.left( index1 ).stripWhiteSpace();
+         if ( tmpstr == QString( "TITLE" ) ||
+              tmpstr == QString( "COLUMN_TITLES" ) ||
+              tmpstr == QString( "COLUMN_UNITS" ) ||
+              tmpstr == QString( "COMMENT" ) ) {
+           keyword = tmpstr;
+           cmt = cmt.mid( index1+1 ).stripWhiteSpace();
+         }
+       }
+      }
+      // if data is empty, process only comment
+      if ( data.isEmpty() ) {
+       // if keyword is found, try to process it
+       // elsewise it is a simple comment, just ignore it
+       if ( !keyword.isEmpty() ) {
+         if ( keyword == QString( "TITLE" ) ) {
+           QString title = cmt;
+           if ( aTable2D.myTitle != "" )
+             title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title;
+           if(MYDEBUG) cout << "...Table TITLE is: " << title.latin1() << endl;
+           aTable2D.myTitle = title.latin1();
+         }
+         else if ( keyword == QString( "COLUMN_TITLES" ) ) {
+           // comment may contain column headers
+           QStringList aStrList = QStringList::split( "|", cmt );
+           if(MYDEBUG) cout << "...Column TITLES are: ";
+           for ( int i = 0; i < aStrList.count(); i++ ) {
+             QString tmpstr = aStrList[ i ].stripWhiteSpace();
+             if(MYDEBUG) cout << tmpstr.latin1() << " ";
+             aTable2D.myColumnTitles.push_back( tmpstr.latin1() );
+           }
+           if(MYDEBUG) cout << endl;
+         }
+         else if ( keyword == QString( "COLUMN_UNITS" ) ) {
+           // comment may contain column units
+           QStringList aStrList = QStringList::split( " ", cmt );
+           if(MYDEBUG) cout << "...Column UNITS are: ";
+           for ( int i = 0; i < aStrList.count(); i++ ) {
+             QString tmpstr = aStrList[ i ].stripWhiteSpace();
+             if(MYDEBUG) cout << tmpstr.latin1() << " ";
+             aTable2D.myColumnUnits.push_back( tmpstr.latin1() );
+           }
+           if(MYDEBUG) cout << endl;
+         }
+         else if ( keyword == QString( "COMMENT" ) ) {
+           // keyword 'COMMENT' processing can be here
+           // currently it is ignored
+           if(MYDEBUG) cout << "...COMMENT: " << cmt.latin1() << endl;
+         }
        }
-       if(MYDEBUG) cout<<endl;
-      }else if(aTmp.find("#COLUMN_UNITS:") == 0){
-       int aLen = aTmp.find(":") + 1;
-       aTmp.remove(0,aLen);
-       QStringList aStrList = QStringList::split(" ",aTmp);
-       if(MYDEBUG) cout<<"Its Column Units : ";
-       for(int i = 0; i < aStrList.count(); i++){
-         aTmp = aStrList[i].stripWhiteSpace();
-         aTable2D.myColumnUnits.push_back(aTmp.latin1());
-         if(MYDEBUG) cout<<"\t"<<aTmp;
+       else {
+         if(MYDEBUG) cout << "...comment: " << cmt.latin1() << endl;
+         // simple comment processing can be here
+         // currently it is ignored
        }
-       if(MYDEBUG) cout<<endl;
-      }else if(aTmp.find("#") == 0){
-       //It is a comment
-      }else if(aTmp.find("#TITLE:") > 0){
-       QStringList aStrList = QStringList::split("#TITLE:",aTmp);
-       QString aTitle = aStrList[1].stripWhiteSpace();
+      }
+      // if data is not empty, try to process it
+      else {
        TRow aRow; 
-       aRow.myTitle = aTitle.latin1();
-       if(MYDEBUG) cout<<aTitle<<" : ";
-       QStringList aValList = QStringList::split(" ",aStrList[0]);
-       for(int i = 0; i < aValList.count(); i++){
-         float aVal = aValList[i].toFloat();
-         aRow.myValues.push_back(aVal);
-         if(MYDEBUG) cout<<"\t"<<aVal;
+       if(MYDEBUG) cout << "...New row is found: " << endl;
+       if ( !cmt.isEmpty() ) {
+         aRow.myTitle = cmt.latin1();
+         if(MYDEBUG) cout << "......ROW TITLE is: " << cmt.latin1() << endl;
+       }
+       QStringList aValList = QStringList::split( " ", data );
+       for ( int i = 0; i < aValList.count(); i++ ) {
+         if ( aValList[i].stripWhiteSpace() != "" ) {
+           TValue aVal = aValList[i].stripWhiteSpace().latin1();
+           aRow.myValues.push_back( aVal );
+         }
        }
-       aTable2D.myRows.push_back(aRow);
-       if(MYDEBUG) cout<<endl;
-      }else{
-       TRow aRow;
+       if( aRow.myValues.size() > 0 )
+         aTable2D.myRows.push_back( aRow );
+       // ************** OLD CODE ******************
+       /*
        TValue aVal;
-       istrstream aStream(aTmp);
-       aStream.precision(STRPRECISION);
-       while(aStream>>aVal){
-         aRow.myValues.push_back(aVal);
-         if(MYDEBUG) cout<<"\t"<<aVal;
+       istrstream aStream( data );
+       aStream.precision( STRPRECISION );
+       while( aStream >> aVal ) {
+         aRow.myValues.push_back( aVal );
        }
-       if(aRow.myValues.size() > 0)
-         aTable2D.myRows.push_back(aRow);
-       if(MYDEBUG) cout<<endl;
+       if( aRow.myValues.size() > 0 )
+         aTable2D.myRows.push_back( aRow );
+       */
+       // ************** OLD CODE ******************
       }
-      getLine(aStmIn,aTmp);
+      getLine( aStmIn, aTmp );
     }
-    if(aTable2D.Check()){
-      if(MYDEBUG) cout<<"aTable2D checked "<<aTable2D.myTitle<<endl;
-      theTableCont.push_back(aTable2D);
+    if( aTable2D.Check() ) {
+      if(MYDEBUG) cout << "aTable2D is checked OK " << aTable2D.myTitle << endl;
+      theTableCont.push_back( aTable2D );
     }
-  }while(!aStmIn.eof());
+  }
+  while( !aStmIn.eof() );
   aStmIn.close();
-  if(MYDEBUG) cout<<"After close"<<endl;
+  if(MYDEBUG) cout << "After close" << endl;
 }
 
 SALOMEDS::SObject_var VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy){
@@ -1088,12 +1133,16 @@ SALOMEDS::SObject_var VISU::ImportTables(const char* theFileName, SALOMEDS::Stud
     int kEnd = aNewTable2D.myRows[0].myValues.size();
     aTableOfReal->SetNbColumns(kEnd);
     for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++){
-      if(MYDEBUG) cout<<"j = "<<j<<endl;
-      SALOMEDS::DoubleSeq_var aDoubleSeq = new SALOMEDS::DoubleSeq();
-      aDoubleSeq->length(kEnd);
-      if(MYDEBUG) cout<<"kEnd = "<<kEnd<<endl;
-      for(int k = 0; k < kEnd; k++) aDoubleSeq[k] = aNewTable2D.myRows[j].myValues[k];
-      aTableOfReal->AddRow(aDoubleSeq.in());
+      if(MYDEBUG) cout<<"j = "<<j<<"; kEnd = "<<kEnd<<endl;
+
+      for(int k = 0; k < kEnd; k++){
+       QString aVal = aNewTable2D.myRows[j].myValues[k].c_str();
+       bool anIsOk = false;
+       double aValue = aVal.toDouble(&anIsOk);
+       if(anIsOk && !aVal.contains("NAN",false) && !aVal.contains("INF",false))
+         aTableOfReal->PutValue(aValue,j+1,k+1);
+      }
+
       aTableOfReal->SetRowTitle(j+1,aNewTable2D.myRows[j].myTitle.c_str());
       aTableOfReal->SetRowUnit(j+1,aNewTable2D.myRows[j].myUnit.c_str());
     }
index 13d2f6b1a8cfa0615381c31d4a6a9be35f09098c..e1245e97bc75efe6beab0513edf7ca228c685e8c 100644 (file)
@@ -93,10 +93,6 @@ void VISU_TimeAnimation::clearData(FieldData& theData) {
   vtkRenderer* aRen = myView->getRenderer();
   if (!theData.myActors.empty()) {
     for (int i = 0, iEnd = theData.myActors.size(); i < iEnd; i++) {
-      //_CS_PhB      if (theData.myActors.at(i) != 0) {
-      //_CS_PhB        theData.myActors.at(i)->RemoveFromRender(aRen);
-      //_CS_PhB        theData.myActors.at(i)->Delete();
-      //_CS_PhB     }
       if (theData.myActors[i] != 0) {
        theData.myActors[i]->RemoveFromRender(aRen);
        theData.myActors[i]->Delete();
@@ -106,9 +102,6 @@ void VISU_TimeAnimation::clearData(FieldData& theData) {
   }
   if (!theData.myPrs.empty()) {
     for (int i = 0, iEnd = theData.myPrs.size(); i < iEnd; i++) 
-     //_CS_PhB if (theData.myPrs.at(i) != 0) {
-     //_CS_PhB theData.myPrs.at(i)->_remove_ref();
-     //_CS_PhB     }
       if (theData.myPrs[i] != 0) {
        theData.myPrs[i]->_remove_ref();
       }
@@ -147,11 +140,6 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
     aTimeStamp = anIter->Value();
     if (aTimeStamp->_is_nil()) continue;
 
-   //_CS_PhB aData.myTiming.at(i) = getTimeValue(aTimeStamp);
-   //_CS_PhB if (isRangeDefined()) {
-   //_CS_PhB   if (aData.myTiming.at(i) < myMinVal) continue;
-   //_CS_PhB   if (aData.myTiming.at(i) > myMaxVal) break;
-   //_CS_PhB }
     aData.myTiming[i] = getTimeValue(aTimeStamp);
     if (isRangeDefined()) {
       if (aData.myTiming[i] < myMinVal) continue;
@@ -172,7 +160,6 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::ScalarMap_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-    //_CS_PhB  aData.myPrs.at(i) = aPresent;
        aData.myPrs[i] = aPresent;
       }
       break;
@@ -184,7 +171,6 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::IsoSurfaces_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-    //_CS_PhB aData.myPrs.at(i) = aPresent;
        aData.myPrs[i] = aPresent;
       }
       break;
@@ -196,7 +182,6 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::CutPlanes_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-     //_CS_PhB         aData.myPrs.at(i) = aPresent;
        aData.myPrs[i] = aPresent;
       }
       break;
@@ -208,7 +193,6 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::DeformedShape_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-     //_CS_PhB aData.myPrs.at(i) = aPresent;
        aData.myPrs[i] = aPresent;
       }
       break;
@@ -220,7 +204,6 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::Vectors_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-     //_CS_PhB         aData.myPrs.at(i) = aPresent;
        aData.myPrs[i] = aPresent;
       }
       break;
@@ -232,13 +215,10 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::StreamLines_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-     //_CS_PhB aData.myPrs.at(i) = aPresent;
        aData.myPrs[i] = aPresent;
       }
       break;
     }
-   //_CS_PhB if (aData.myPrs.at(i)->GetMin() < aMin) aMin = aData.myPrs.at(i)->GetMin();
-   //_CS_PhB if (aData.myPrs.at(i)->GetMax() > aMax) aMax = aData.myPrs.at(i)->GetMax();
     if (aData.myPrs[i]->GetMin() < aMin) aMin = aData.myPrs[i]->GetMin();
     if (aData.myPrs[i]->GetMax() > aMax) aMax = aData.myPrs[i]->GetMax();
     i++;
@@ -247,11 +227,9 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
   QString aFixRange = QAD_CONFIG->getSetting("Visu:SBImposeRange");
   if (aFixRange.compare("true") != 0) {
     for (i = 0; i < aData.myNbFrames; i++) 
-    //_CS_PhB  aData.myPrs.at(i)->SetRange(aMin, aMax);
       aData.myPrs[i]->SetRange(aMin, aMax);
     if(aData.myPrsType == VISU::TISOSURFACE)
       for (i = 0; i < aData.myNbFrames; i++)
- //_CS_PhB     if(VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aData.myPrs.at(i)))
        if(VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aData.myPrs[i]))
           aPrs->SetSubRange(aMin, aMax);
   }
@@ -277,7 +255,6 @@ CORBA::Boolean VISU_TimeAnimation::generateFrames() {
     for (long j = 0; j < aData.myNbFrames; j++) {
       VISU_Actor* aActor = NULL;
       try{
- //_CS_PhB     aActor = aData.myPrs.at(j)->CreateActor();
        aActor = aData.myPrs[j]->CreateActor();
        myView->AddActor(aActor);
        if(j == 0)
@@ -286,16 +263,13 @@ CORBA::Boolean VISU_TimeAnimation::generateFrames() {
          aActor->VisibilityOff();
       }catch(...){ //catch(std::runtime_error& exc){
        aNoError = false;
- //_CS_PhB     myLastError += QString("%1 ").arg(aData.myTiming.at(j));
        myLastError += QString("%1 ").arg(aData.myTiming[j]);
       }
- //_CS_PhB     aData.myActors.at(j) = aActor;
       aData.myActors[j] = aActor;
     }
   }
   myFrame = 0;
-  myLastError += QString(" timestamp(s) cannot /local/salome/SALOME2/VISU/V1_4_1a/VISU_SRC/src/VISU_I/VISU_TimeAnimation.cxxbe created.");
-  //_CS_PhB     emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
+  myLastError += QString(" timestamp(s) cannot be created.");
   emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
   myView->Repaint();
   return aNoError;
@@ -307,16 +281,11 @@ void VISU_TimeAnimation::clearView() {
     MESSAGE("Viewer is nod defined for animation");
     return;
   }
-  //_CS_PhB : "mt" ne sert pas dans cette methode  VISU::Mutex mt(myMutex,qApp,MYDELAY);
   vtkRenderer* aRen = myView->getRenderer();
   for (int i = 0; i < getNbFields(); i++) {
     FieldData& aData = myFieldsLst[i];
     if (!aData.myActors.empty()) {
       for (int i = 0, iEnd = aData.myActors.size(); i < iEnd; i++) {
-//_CS_PhB      if (aData.myActors.at(i) != 0) {
-//_CS_PhB        aData.myActors.at(i)->RemoveFromRender(aRen);
-//_CS_PhB        aData.myActors.at(i)->Delete();
-//_CS_PhB      }
        if (aData.myActors[i] != 0) {
          aData.myActors[i]->RemoveFromRender(aRen);
          aData.myActors[i]->Delete();
@@ -325,7 +294,7 @@ void VISU_TimeAnimation::clearView() {
       aData.myActors.clear();
     }
   }
-  myView->getRW()->getRenderWindow()->Render();
+  VISU::RepaintView(myView);
   //myView->update();
 }
 
@@ -348,19 +317,14 @@ void VISU_TimeAnimation::nextFrame() {
   if (myFrame < (myFieldsLst[0].myNbFrames-1)) {
     int i;
     for (i = 0; i < getNbFields(); i++) 
-
-//_CS_PhB      if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
       if (myFieldsLst[i].myActors[myFrame] != 0)
        myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+
     myFrame++;
     for (i = 0; i < getNbFields(); i++) 
-//_CS_PhB      if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOn(); 
       if (myFieldsLst[i].myActors[myFrame] != 0)
        myFieldsLst[i].myActors[myFrame]->VisibilityOn();
  
-//_CS_PhB     emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
     emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
     myView->Repaint();
   }
@@ -372,19 +336,14 @@ void VISU_TimeAnimation::prevFrame() {
   if (myFrame > 0) {
     int i;
     for (i = 0; i < getNbFields(); i++) 
-  //_CS_PhB     if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
       if (myFieldsLst[i].myActors[myFrame] != 0)
        myFieldsLst[i].myActors[myFrame]->VisibilityOff();
 
     myFrame--;
     for (i = 0; i < getNbFields(); i++) 
-  //_CS_PhB     if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();    
       if (myFieldsLst[i].myActors[myFrame] != 0)
        myFieldsLst[i].myActors[myFrame]->VisibilityOn(); 
    
-  //_CS_PhB   emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
     emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
     myView->Repaint();
   }
@@ -396,19 +355,14 @@ void VISU_TimeAnimation::firstFrame() {
   int i;
   for (i = 0; i < getNbFields(); i++) 
     if(!myFieldsLst[i].myActors.empty())
-  //_CS_PhB    if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
       if (myFieldsLst[i].myActors[myFrame] != 0)
        myFieldsLst[i].myActors[myFrame]->VisibilityOff();
   myFrame = 0;
   for (i = 0; i < getNbFields(); i++) 
     if(!myFieldsLst[i].myActors.empty())
- //_CS_PhB    if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();    
       if (myFieldsLst[i].myActors[myFrame] != 0)
        myFieldsLst[i].myActors[myFrame]->VisibilityOn();    
   if(!myFieldsLst[0].myTiming.empty()){
- //_CS_PhB   emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
     emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
     myView->Repaint();
   }
@@ -419,18 +373,14 @@ void VISU_TimeAnimation::lastFrame() {
   stopAnimation();
   int i;
   for (i = 0; i < getNbFields(); i++) 
- //_CS_PhB   if (myFieldsLst[i].myActors.at(myFrame) != 0)
- //_CS_PhB     myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
    if (myFieldsLst[i].myActors[myFrame] != 0)
       myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+
   myFrame = myFieldsLst[0].myNbFrames-1;
   for (i = 0; i < getNbFields(); i++) 
-//_CS_PhB    if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
     if (myFieldsLst[i].myActors[myFrame] != 0)
       myFieldsLst[i].myActors[myFrame]->VisibilityOn();
 
-//_CS_PhB  emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
   emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
   myView->Repaint();
 }
@@ -446,19 +396,14 @@ void VISU_TimeAnimation::gotoFrame(CORBA::Long theFrame) {
   qApp->syncX();
   int i;
   for (i = 0; i < getNbFields(); i++) 
-//_CS_PhB    if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
     if (myFieldsLst[i].myActors[myFrame] != 0)
       myFieldsLst[i].myActors[myFrame]->VisibilityOff();
 
   myFrame = theFrame;
   for (i = 0; i < getNbFields(); i++) 
-//_CS_PhB    if (myFieldsLst[i].myActors.at(myFrame) != 0)
-//_CS_PhB      myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
     if (myFieldsLst[i].myActors[myFrame] != 0)
       myFieldsLst[i].myActors[myFrame]->VisibilityOn();
 
-//_CS_PhB  emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
   emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
   myView->Repaint();
   qApp->flushX(); 
@@ -473,7 +418,6 @@ VISU::ScalarMap_ptr VISU_TimeAnimation::getPresentation(CORBA::Long theField, CO
     return VISU::ScalarMap::_nil();
   if ((theFrame < 0) || (theFrame > (myFieldsLst[theField].myNbFrames - 1)))
     return VISU::ScalarMap::_nil();
-//_CS_PhB  return myFieldsLst[theField].myPrs.at(theFrame)->_this();
   return myFieldsLst[theField].myPrs[theFrame]->_this();
 }
 
@@ -494,27 +438,19 @@ void VISU_TimeAnimation::run() {
   double aOneVal;
   bool isDumping = !myDumpPath.isEmpty();
   aOneVal = (myFieldsLst[0].myNbFrames > 2) ?
- //_CS_PhB    myFieldsLst[0].myTiming.at(1) - myFieldsLst[0].myTiming.at(0) : 1;
     myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0] : 1;
   qApp->lock();      
   while (myIsActive) {
- //_CS_PhB    emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
     emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
     for (int i = 0; i < getNbFields(); i++) {
       FieldData& aData = myFieldsLst[i];
       if (myFrame > 0) {
-//_CS_PhB      if (aData.myActors.at(myFrame-1) != 0) 
-//_CS_PhB        aData.myActors.at(myFrame-1)->VisibilityOff();
        if (aData.myActors[myFrame-1] != 0) 
          aData.myActors[myFrame-1]->VisibilityOff();
       } else { 
-//_CS_PhB      if (aData.myActors.at(aData.myNbFrames-1) != 0)
-//_CS_PhB        aData.myActors.at(aData.myNbFrames-1)->VisibilityOff();
        if (aData.myActors[aData.myNbFrames-1] != 0)
          aData.myActors[aData.myNbFrames-1]->VisibilityOff();
       }
-//_CS_PhB      if (aData.myActors.at(myFrame) != 0) {
-//_CS_PhB      aData.myActors.at(myFrame)->VisibilityOn();
       if (aData.myActors[myFrame] != 0) {
        aData.myActors[myFrame]->VisibilityOn();
       }
@@ -523,7 +459,6 @@ void VISU_TimeAnimation::run() {
     if (isDumping) {
       QPixmap px = QPixmap::grabWindow(myView->getViewWidget()->winId());
       QString aFile(myDumpPath);
-//_CS_PhB      QString aName = QString("%1").arg(myFieldsLst[0].myTiming.at(myFrame));
       QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
       int aPos = -1;
       while ((aPos = aName.find(".")) > -1 )
@@ -531,7 +466,7 @@ void VISU_TimeAnimation::run() {
       aFile += aName;
       aFile += ".jpeg";
       px.save(aFile, "JPEG");
-    }//_CS_PhB
+    }
     if (!isDumping) {
       if (myProportional) {
        switch (myFrame) {
@@ -540,14 +475,12 @@ void VISU_TimeAnimation::run() {
          break;        
        case 1:
          if (myFieldsLst[0].myNbFrames > 2)
-//_CS_PhB          k = (myFieldsLst[0].myTiming.at(myFrame+1) - myFieldsLst[0].myTiming.at(myFrame))/aOneVal;
            k = (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal;
          else
            k = 1;
          break;        
        default:
          k = (myFrame < (myFieldsLst[0].myNbFrames-1))? 
-//_CS_PhB          (myFieldsLst[0].myTiming.at(myFrame+1) - myFieldsLst[0].myTiming.at(myFrame))/aOneVal : 1;
            (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal : 1;
        }
       } else
@@ -611,6 +544,7 @@ double VISU_TimeAnimation::getTimeValue(SALOMEDS::SObject_var theTimeStamp) {
     QString aNameString(aName->Value());
     return aNameString.toDouble();
   }
+  return -1.0;
 }
   
 //************************************************************************
index 4cb92b29557ccf78aa7f4a5aed5d2310c170238e..b7ac3c0ae07ecf149be5c4fb65ec6786467969b6 100644 (file)
@@ -54,10 +54,10 @@ int VISU::Vectors_i::IsPossible(Result_i* theResult, const char* theMeshName, VI
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
       MESSAGE("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     }
-  }catch(std::runtime_error& exc){
-    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    INFOS("Unknown exception was accured!");
+    INFOS("Unknown exception was occured!");
   }
   return aResult;
 }
index 1ec6ddfbfb34859f81dcbb5d57ddb1be864443e0..f2f34ed05bcb57cfde4b251891f951936f74a85b 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "VISU_PrsObject_i.hh"
 #include "VISU_Result_i.hh"
+#include "VISU_Gen_i.hh"
 
 #include "VISU_Prs3d_i.hh"
 #include "VISU_Mesh_i.hh"
 #include "QAD_Desktop.h"
 #include "QAD_Tools.h"
 #include "QAD_Study.h"
+#include "QAD_LeftFrame.h"
 #include "QAD_RightFrame.h"
 #include "QAD_StudyFrame.h"
+#include "QAD_PyEditor.h"
 
 #include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_RenderWindow.h"
 #include "SALOMEGUI_TableDlg.h"
 #include "Plot2d_CurveContainer.h"
 #include "Plot2d_ViewFrame.h"
@@ -62,8 +66,6 @@
 #include <qstring.h>
 #include <qfileinfo.h>
 
-#include <vtkTransformPolyDataFilter.h>
-#include <vtkDataSetMapper.h>
 #include <vtkRenderer.h>
 #include <vtkCamera.h>
 
@@ -76,7 +78,6 @@ static int MYDEBUG = 0;
 #endif
 
 static QFileInfo aFileInfo;
-static int MYDELAY = 1;
 
 namespace VISU{
   //===========================================================================
@@ -100,6 +101,233 @@ namespace VISU{
     }
   };
 
+  class TSetViewRepresentation: public SALOME_Event{
+    VISU::View::ViewRepresentation myViewRepr;
+    View_i*                        myView;
+    CORBA::Boolean                 myState;
+ public:
+    TSetViewRepresentation( View_i*  aView, 
+                           VISU::View::ViewRepresentation ViewRepr,
+                           CORBA::Boolean State ):
+      SALOME_Event(), myViewRepr( ViewRepr ), myView( aView ), myState( State )
+    {}
+    virtual void Execute(){
+
+  bool old = myView->IsPartShown( myViewRepr );
+
+  QAD_RightFrame* fr = myView->myStudyFrame->getRightFrame();
+
+  if( myView->myStudyFrame != NULL ){
+    switch( myViewRepr )
+      {
+      case VISU::View::OBJECTBROWSER:
+       if( myState!=old )
+         if( myState )
+           myView->myStudyFrame->unCompressLeft();
+         else
+           myView->myStudyFrame->compressLeft();
+       break;
+      case VISU::View::VIEWER:
+       if( myState!=old )
+         if( myState )
+           fr->unCompressUp();
+         else
+           fr->compressUp();
+       break;
+      case VISU::View::PYTHON:
+       if( myState!=old )
+         if( myState )
+           fr->unCompressLeft();
+         else
+           fr->compressLeft();
+       break;
+      case VISU::View::MESSAGES:
+       if( myState!=old )
+         if( myState )
+           fr->unCompressRight();
+         else
+           fr->compressRight();
+       break;
+      };
+    }
+  }
+};
+
+  class TGetViewRepresentation: public SALOME_Event
+  {
+  public:
+    typedef CORBA::Boolean TResult;
+    TResult myResult;
+    VISU::View::ViewRepresentation myPart;
+    View_i*  myView;
+
+    TGetViewRepresentation( View_i* aView, VISU::View::ViewRepresentation Part ):
+      SALOME_Event(), myResult( false ), myPart( Part ), myView( aView )
+       {
+       }
+      virtual void Execute(){
+       switch( myPart )
+         {
+         case VISU::View::OBJECTBROWSER:
+           myResult = !myView->myStudyFrame->isCompressedLeft();
+           break;
+         case VISU::View::VIEWER:
+           myResult = !myView->myStudyFrame->getRightFrame()->isCompressedViewFrame();
+           break;
+         case VISU::View::PYTHON:
+           myResult = !myView->myStudyFrame->getRightFrame()->isCompressedPython();
+           break;
+         case VISU::View::MESSAGES:
+           myResult = !myView->myStudyFrame->getRightFrame()->isCompressedMessage();
+         }
+      }
+  };
+
+  class TSetViewWidthHeight: public SALOME_Event{
+    CORBA::Long mySize;
+    bool myIsWidth;
+    View_i*  myView;
+  public:
+      TSetViewWidthHeight( View_i* aView, CORBA::Long Size, bool IsWidth ):
+       SALOME_Event(), mySize( Size ), myView( aView ), myIsWidth( IsWidth )
+         {}
+      virtual void Execute(){
+        if( myView->myStudyFrame != NULL ){
+         QWidget* aStudyParent = myView->myStudyFrame->parentWidget(true);
+         int aleft   = aStudyParent->frameGeometry().left();
+         int atop    = aStudyParent->frameGeometry().top();
+         int aheight = aStudyParent->frameGeometry().height();
+         int awidth  = aStudyParent->frameGeometry().width();
+         QRect aQRect;
+         if( myIsWidth )
+           aQRect = QRect( aleft, atop, mySize, aheight );
+         else
+           aQRect = QRect( aleft, atop, awidth, mySize );
+
+         aStudyParent->setGeometry(aQRect);
+       } 
+      }
+  };    
+
+  class TGetViewWidthHeight: public SALOME_Event{
+  public:
+    typedef CORBA::Long TResult;
+    TResult myResult;
+    bool myIsWidth;
+    View_i*  myView;
+  public:
+      TGetViewWidthHeight( View_i* aView, bool IsWidth ):
+       SALOME_Event(), myView( aView ), myIsWidth( IsWidth )
+         {}
+
+         virtual void Execute()
+           {
+             if( myView ) {
+               QWidget* aStudyParent = myView->myStudyFrame->parentWidget(true);
+               if( myIsWidth )
+                 myResult = aStudyParent->frameGeometry().width();
+               else
+                 myResult = aStudyParent->frameGeometry().height();
+             }
+           }
+  };
+
+  class TSetViewPositionHorizontal: public SALOME_Event{
+    VISU::View::ViewPosition     myViewPos;
+    View_i*                      myView;   
+  public:
+     TSetViewPositionHorizontal ( View_i* aView,
+                                 VISU::View::ViewPosition ViewPos  ):
+       SALOME_Event(), myView( aView ), myViewPos(ViewPos)
+    {}
+    virtual void Execute(){
+    QWidget* aWorkspace = dynamic_cast <QWidget*> (myView->myStudy->getApp()->getDesktop()->getMainFrame());
+    QWidget* aStudy = dynamic_cast <QWidget*> (myView->myStudyFrame);
+    QWidget* aStudyParent = aStudy->parentWidget(true);
+    if ( aStudyParent != 0 )
+      if ( aWorkspace!=NULL || aStudy != NULL )
+       switch(myViewPos){
+         case VISU::View::LEFT:
+         QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignLeft);
+           break;
+         case VISU::View::CENTER:
+           QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignHCenter);
+           break;
+         case VISU::View::RIGHT:
+           QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignRight);
+           break;
+       }
+    }
+  };
+
+  class TSetViewPositionVertical: public SALOME_Event{
+    VISU::View::ViewPosition     myViewPos;
+    View_i*                      myView;
+  public:
+      TSetViewPositionVertical ( View_i* aView,
+                                VISU::View::ViewPosition ViewPos  ):
+       SALOME_Event(), myView( aView ), myViewPos(ViewPos)
+    {}
+    virtual void Execute(){
+    QWidget* aWorkspace = dynamic_cast <QWidget*> (myView->myStudy->getApp()->getDesktop()->getMainFrame());
+    QWidget* aStudy = dynamic_cast <QWidget*>(myView->myStudyFrame);
+    QWidget* aStudyParent = aStudy->parentWidget(true);
+    if ( aStudyParent != 0 )
+      if ( aWorkspace!=NULL || aStudy != NULL )
+       switch(myViewPos){
+         case VISU::View::TOP:
+         QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignTop);
+           break;
+         case VISU::View::CENTER:
+           QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignVCenter);
+           break;
+         case VISU::View::BOTTOM:
+           QAD_Tools::alignWidget(aStudyParent,aWorkspace,Qt::AlignBottom);
+           break;
+       }
+    }
+  };
+
+  class TSetRelativePosition : public SALOME_Event
+  {
+    View_i*                      myView;
+    CORBA::Double                myX, myY;
+  public:
+    TSetRelativePosition ( View_i* aView, CORBA::Double X, CORBA::Double Y ):
+      SALOME_Event(), myView( aView ), myX( X ), myY( Y )
+    {}
+    virtual void Execute(){
+      QWidget* aWorkspace = dynamic_cast <QWidget*> (myView->myStudy->getApp()->getDesktop()->getMainFrame());
+      if( aWorkspace )
+      {
+       QAD_StudyFrame* aFrame = myView->myStudyFrame;
+       QWidget* aStudyParent = aFrame->parentWidget(true);
+       aStudyParent->move( int( myX * aWorkspace->width() ), int( myY * aWorkspace->height() ) );
+      }
+    }
+  };
+
+  class TSetRelativeSize : public SALOME_Event
+  {
+    View_i*                      myView;
+    CORBA::Double                myX, myY;
+  public:
+    TSetRelativeSize ( View_i* aView, CORBA::Double X, CORBA::Double Y ):
+      SALOME_Event(), myView( aView ), myX( X ), myY( Y )
+    {}
+    virtual void Execute(){
+      QWidget* aWorkspace = dynamic_cast <QWidget*> (myView->myStudy->getApp()->getDesktop()->getMainFrame());
+      if( aWorkspace )
+      {
+       QAD_StudyFrame* aFrame = myView->myStudyFrame;
+       QWidget* aStudyParent = aFrame->parentWidget(true);
+       aStudyParent->setGeometry( aStudyParent->x(), aStudyParent->y(),
+                            int( myX * aWorkspace->width() ), int( myY * aWorkspace->height() ) );
+      }
+    }
+  };
+
+
 
   class TSavePictureEvent: public SALOME_Event{
     QWidget* myWidget;
@@ -152,12 +380,16 @@ namespace VISU{
   }
 
 
-  void RepaintView(QAD_StudyFrame* theStudyFrame){
-    GetRenderer(theStudyFrame)->ResetCameraClippingRange();
-    GetViewFrame(theStudyFrame)->getRW()->getRenderWindow()->Render();
+  void RepaintView(VTKViewer_ViewFrame* theViewFrame){
+    theViewFrame->getRenderer()->ResetCameraClippingRange();
+    theViewFrame->getRW()->getRenderWindow()->Render();
     //GetViewFrame(theStudyFrame)->Repaint();
   }
 
+  void RepaintView(QAD_StudyFrame* theStudyFrame){
+    RepaintView(GetViewFrame(theStudyFrame));
+  }
+
 
   VISU_Actor* UpdateViewer(QAD_StudyFrame* theStudyFrame, int theDisplaing, Prs3d_i* thePrs){
     VTKViewer_ViewFrame* vf = GetViewFrame(theStudyFrame);
@@ -225,18 +457,23 @@ namespace VISU{
       for ( int i = 0; i < clist.count(); i++ ) {
        if ( theCurve && clist.at( i )->hasIO() && !strcmp( clist.at( i )->getIO()->getEntry(), theCurve->GetEntry() ) ) {
          if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - "<<clist.at( i ) );
-         clist.at( i )->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
-         clist.at( i )->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
-         clist.at( i )->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
-         clist.at( i )->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
-         /* - DATA NOT UPDATED */
-         if ( !clist.at( i )->isAutoAssign() ) {
+         clist.at( i )->setHorTitle( theCurve->GetHorTitle().c_str() );
+         clist.at( i )->setVerTitle( theCurve->GetVerTitle().c_str() );
+         clist.at( i )->setHorUnits( theCurve->GetHorUnits().c_str() );
+         clist.at( i )->setVerUnits( theCurve->GetVerUnits().c_str() );
+         double* xList = 0;
+         double* yList = 0;
+         int     nbPoints = theCurve->GetData( xList, yList );
+         if ( nbPoints > 0 && xList && yList ) {
+           clist.at( i )->setData( xList, yList, nbPoints );
+         }
+         if ( !theCurve->IsAuto() ) {
            clist.at( i )->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
            clist.at( i )->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() ); 
            SALOMEDS::Color color = theCurve->GetColor();
            clist.at( i )->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
-           clist.at( i )->setAutoAssign( theCurve->IsAuto() );
          }
+         clist.at( i )->setAutoAssign( theCurve->IsAuto() );
          theView->displayCurve( clist.at( i ) );
          bFound = true;
        }
@@ -244,8 +481,17 @@ namespace VISU{
       if ( !bFound ) {
        Plot2d_Curve* crv = theCurve->CreatePresentation();
        if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve (new) - "<<crv );
-       if ( crv )
+       if ( crv ) {
          theView->displayCurve( crv );
+         theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
+         theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
+         SALOMEDS::Color newColor;
+         newColor.R = crv->getColor().red()/255.;
+         newColor.G = crv->getColor().green()/255.;
+         newColor.B = crv->getColor().blue()/255.;
+         theCurve->SetColor( newColor );
+         crv->setAutoAssign( theCurve->IsAuto() );
+       }
       }
     }
     else if ( theDisplaying == eDisplayOnly ) {
@@ -253,18 +499,23 @@ namespace VISU{
       for ( int i = 0; i < clist.count(); i++ ) {
        if ( theCurve && clist.at( i )->hasIO() && !strcmp( clist.at( i )->getIO()->getEntry(), theCurve->GetEntry() ) ) {
          if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - "<<clist.at( i ) );
-         clist.at( i )->setHorTitle( strdup( theCurve->GetHorTitle().c_str() ) );
-         clist.at( i )->setVerTitle( strdup( theCurve->GetVerTitle().c_str() ) );
-         clist.at( i )->setHorUnits( strdup( theCurve->GetHorUnits().c_str() ) );
-         clist.at( i )->setVerUnits( strdup( theCurve->GetVerUnits().c_str() ) );
-         /* - DATA NOT UPDATED */
-         if ( !clist.at( i )->isAutoAssign() ) {
+         clist.at( i )->setHorTitle( theCurve->GetHorTitle().c_str() );
+         clist.at( i )->setVerTitle( theCurve->GetVerTitle().c_str() );
+         clist.at( i )->setHorUnits( theCurve->GetHorUnits().c_str() );
+         clist.at( i )->setVerUnits( theCurve->GetVerUnits().c_str() );
+         double* xList = 0;
+         double* yList = 0;
+         int     nbPoints = theCurve->GetData( xList, yList );
+         if ( nbPoints > 0 && xList && yList ) {
+           clist.at( i )->setData( xList, yList, nbPoints );
+         }
+         if ( !theCurve->IsAuto() ) {
            clist.at( i )->setLine( (Plot2d_Curve::LineType)theCurve->GetLine(), theCurve->GetLineWidth() );
            clist.at( i )->setMarker( (Plot2d_Curve::MarkerType)theCurve->GetMarker() ); 
            SALOMEDS::Color color = theCurve->GetColor();
            clist.at( i )->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
-           clist.at( i )->setAutoAssign( theCurve->IsAuto() );
          }
+         clist.at( i )->setAutoAssign( theCurve->IsAuto() );
          theView->displayCurve( clist.at( i ) );
          bFound = true;
        }
@@ -275,8 +526,17 @@ namespace VISU{
       if ( !bFound ) {
        Plot2d_Curve* crv = theCurve->CreatePresentation();
        if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve (new) - "<<crv );
-       if ( crv )
+       if ( crv ) {
          theView->displayCurve( crv );
+         theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
+         theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
+         SALOMEDS::Color newColor;
+         newColor.R = crv->getColor().red()/255.;
+         newColor.G = crv->getColor().green()/255.;
+         newColor.B = crv->getColor().blue()/255.;
+         theCurve->SetColor( newColor );
+         crv->setAutoAssign( theCurve->IsAuto() );
+       }
       }
     }
   }
@@ -304,38 +564,36 @@ namespace VISU{
   }
 
 
-  VISU::View_ptr ViewManager_i::GetCurrentView(){
-    class TEvent: public SALOME_Event{
-      SALOMEDS::Study_ptr myStudyDocument;
-    public:
-      TEvent( SALOMEDS::Study_ptr theStudy):
-       myStudyDocument(theStudy)
-      {}
-      virtual void Execute(){
-       if(QAD_Study* aStudy = QAD_Application::getDesktop()->findStudy( myStudyDocument )){
-         if ( QAD_StudyFrame* aStudyFrame = aStudy->getActiveStudyFrame() ) {
-           if(MYDEBUG) 
-             MESSAGE("GetCurrentView::Execute - TypeView = "<<aStudyFrame->getTypeView());
-           if ( aStudyFrame->getTypeView() == VIEW_VTK ) {
-             VISU::View3D_i* pView = new View3D_i(myStudyDocument);
-             if(pView->Create(0)) 
-               myResult = pView->_this();
-           } else if ( aStudyFrame->getTypeView() == VIEW_PLOT2D ) {
-             VISU::XYPlot_i* pView = new XYPlot_i(myStudyDocument);
-             if(pView->Create(0)) 
-               myResult = pView->_this();
-           }
+  class TGetCurrentViewEvent: public SALOME_Event{
+    SALOMEDS::Study_ptr myStudyDocument;
+  public:
+    TGetCurrentViewEvent( SALOMEDS::Study_ptr theStudy):
+      myStudyDocument(theStudy),
+      myResult(VISU::View::_nil())
+    {}
+    virtual void Execute(){
+      if(QAD_Study* aStudy = QAD_Application::getDesktop()->findStudy( myStudyDocument )){
+       if ( QAD_StudyFrame* aStudyFrame = aStudy->getActiveStudyFrame() ) {
+         if(MYDEBUG) 
+           MESSAGE("GetCurrentView::Execute - TypeView = "<<aStudyFrame->getTypeView());
+         if ( aStudyFrame->getTypeView() == VIEW_VTK ) {
+           VISU::View3D_i* pView = new View3D_i(myStudyDocument);
+           if(pView->Create(0)) 
+             myResult = pView->_this();
+         } else if ( aStudyFrame->getTypeView() == VIEW_PLOT2D ) {
+           VISU::XYPlot_i* pView = new XYPlot_i(myStudyDocument);
+           if(pView->Create(0)) 
+             myResult = pView->_this();
          }
        }
       }
-      typedef VISU::View_var TResult;
-      TResult myResult;
-    };
-    TEvent* ve = new TEvent( myStudyDocument );
-    ve->process();
-    TEvent::TResult aResult = ve->myResult;
-    ve->release();
-    return aResult._retn();
+    }
+    typedef VISU::View_ptr TResult;
+    TResult myResult;
+  };
+
+  VISU::View_ptr ViewManager_i::GetCurrentView(){
+    return ProcessEvent(new TGetCurrentViewEvent( myStudyDocument ));
   }
   
   
@@ -381,31 +639,29 @@ namespace VISU{
   }
 
 
-  VISU::TableView_ptr ViewManager_i::CreateTableView(VISU::Table_ptr theTable){
-    class TEvent: public TCreateViewEvent{
-      Table_ptr myTable;
-    public:
-      TEvent(SALOMEDS::Study_ptr theStudy,
-            Table_ptr theTable):
-       TCreateViewEvent(theStudy),
-       myTable(theTable)
-      {}
-      virtual void Execute(){
-       if ( CheckStudy( myStudyDocument ) ) {
-         VISU::TableView_i* pView = new TableView_i(myStudyDocument);
-         if(pView->Create(myTable) != NULL) 
-           myResult = pView->_this();
-       }
+  class TCreateTableViewEvent: public TCreateViewEvent{
+    Table_ptr myTable;
+  public:
+    TCreateTableViewEvent(SALOMEDS::Study_ptr theStudy,
+                         Table_ptr theTable):
+      TCreateViewEvent(theStudy),
+      myTable(theTable),
+      myResult(VISU::TableView::_nil())
+    {}
+    virtual void Execute(){
+      if ( CheckStudy( myStudyDocument ) ) {
+       VISU::TableView_i* pView = new TableView_i(myStudyDocument);
+       if(pView->Create(myTable) != NULL) 
+         myResult = pView->_this();
       }
-      typedef VISU::TableView_var TResult;
-      TResult myResult;
-    };
+    }
+    typedef VISU::TableView_ptr TResult;
+    TResult myResult;
+  };
+
+  VISU::TableView_ptr ViewManager_i::CreateTableView(VISU::Table_ptr theTable){
     if(MYDEBUG) MESSAGE("ViewManager_i::CreateTableView");
-    TEvent* ve = new TEvent(myStudyDocument,theTable);
-    ve->process();
-    TEvent::TResult aResult = ve->myResult;
-    ve->release();
-    return aResult._retn();
+    return ProcessEvent(new TCreateTableViewEvent(myStudyDocument,theTable));
   }
 
 
@@ -432,6 +688,7 @@ namespace VISU{
 
   //===========================================================================
   View_i::View_i(SALOMEDS::Study_ptr theStudy) {
+    myStudyFrame =  NULL;
     if(MYDEBUG) MESSAGE("View_i::View_i");
     CORBA::String_var aName = theStudy->Name();
     myStudy = CheckStudy(theStudy);
@@ -741,11 +998,7 @@ namespace VISU{
 
 
   CORBA::Boolean XYPlot_i::SavePicture(const char* theFileName) {
-    TSavePictureEvent* ve = new TSavePictureEvent(myView->getViewWidget(),theFileName);
-    ve->process();
-    TSavePictureEvent::TResult aResult = ve->myResult;
-    ve->release();
-    return aResult;
+    return ProcessEvent(new TSavePictureEvent(myView->getViewWidget(),theFileName));
   }
 
 
@@ -829,9 +1082,8 @@ namespace VISU{
        vtkRenderer* Renderer = vf->getRenderer();
        vtkActorCollection* theActors = Renderer->GetActors();
        theActors->InitTraversal();
-       vtkActor *actor;
-       while(actor = theActors->GetNextActor()){
-         if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(actor)){
+       while(vtkActor *anAct = theActors->GetNextActor()){
+         if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
            VISU::Prs3d_i* aPrs3d  = anActor->GetPrs3d();
            if(anActor->GetVisibility() && aPrs3d){
              aPrs3d->Update();
@@ -847,11 +1099,7 @@ namespace VISU{
 
 
   CORBA::Boolean View3D_i::SavePicture(const char* theFileName) {
-    TSavePictureEvent* ve = new TSavePictureEvent(myStudyFrame->getRightFrame()->getViewFrame()->getViewWidget(),theFileName);
-    ve->process();
-    TSavePictureEvent::TResult aResult = ve->myResult;
-    ve->release();
-    return aResult;
+    return ProcessEvent(new TSavePictureEvent(myStudyFrame->getRightFrame()->getViewFrame()->getViewWidget(),theFileName));
   }
 
 
@@ -918,27 +1166,24 @@ namespace VISU{
   }
 
 
+  class TRestoreViewParamsEvent: public SALOME_Event{
+    QAD_StudyFrame* myStudyFrame;
+    const char* myName;
+  public:
+    TRestoreViewParamsEvent(QAD_StudyFrame* theStudyFrame,
+                           const char* theName):
+      myStudyFrame(theStudyFrame),
+      myName(theName)
+    {}
+    virtual void Execute(){
+      myResult = View3D_i::RestoreViewParams(myStudyFrame,myName);
+    }
+    typedef CORBA::Boolean TResult;
+    TResult myResult;
+  };
+
   CORBA::Boolean View3D_i::RestoreViewParams(const char* theName){
-    class TEvent: public SALOME_Event{
-      QAD_StudyFrame* myStudyFrame;
-      const char* myName;
-    public:
-      TEvent(QAD_StudyFrame* theStudyFrame,
-            const char* theName):
-       myStudyFrame(theStudyFrame),
-       myName(theName)
-      {}
-      virtual void Execute(){
-       myResult = RestoreViewParams(myStudyFrame,myName);
-      }
-      typedef CORBA::Boolean TResult;
-      TResult myResult;
-    };
-    TEvent* ve = new TEvent(myStudyFrame,theName);
-    ve->process();
-    TEvent::TResult aResult = ve->myResult;
-    ve->release();
-    return aResult;
+    return ProcessEvent(new TRestoreViewParamsEvent(myStudyFrame,theName));
   }
 
 
@@ -1038,6 +1283,56 @@ namespace VISU{
   }
 
   //-------------------- View interface --------------------
+
+  void View_i::ShowPart( VISU::View::ViewRepresentation ViewRepr, CORBA::Boolean state  ) {
+    ProcessVoidEvent( new TSetViewRepresentation( this, ViewRepr, state ) );
+    Update();
+  }
+
+  CORBA::Boolean View_i::IsPartShown( VISU::View::ViewRepresentation Part )
+  {
+    return ProcessEvent( new TGetViewRepresentation( this, Part ) );
+  }
+
+  void View_i::SetViewWidth(CORBA::Long Width){
+    ProcessVoidEvent( new TSetViewWidthHeight( this, Width, true ) );
+     }
+  
+  void View_i::SetViewHeight(CORBA::Long Height){ 
+    ProcessVoidEvent( new TSetViewWidthHeight( this, Height, false ) );
+     }
+
+  CORBA::Long View_i::GetViewWidth() 
+  {
+    return ProcessEvent( new TGetViewWidthHeight( this, true ) );
+  }
+
+  CORBA::Long View_i::GetViewHeight()
+  {
+    return ProcessEvent( new TGetViewWidthHeight( this, false ) );
+  }
+
+  void View_i::SetViewPositionHorizontal( VISU::View::ViewPosition ViewPosHor ){
+    ProcessVoidEvent( new TSetViewPositionHorizontal( this, ViewPosHor ) );
+  }
+
+  void View_i::SetViewPositionVertical( VISU::View::ViewPosition ViewPosVer ){
+    ProcessVoidEvent( new TSetViewPositionVertical( this, ViewPosVer ) );
+  }
+
+  void View_i::SetRelativePosition( CORBA::Double x, CORBA::Double y )
+  {
+    ProcessVoidEvent( new TSetRelativePosition( this, x, y ) );
+  }
+
+  void View_i::SetRelativeSize( CORBA::Double x, CORBA::Double y )
+  {
+    ProcessVoidEvent( new TSetRelativeSize( this, x, y ) );
+  }
+
+
+
+
   void View3D_i::SetTitle(const char* theTitle){
     ProcessVoidEvent(new TVoidMemFun1ArgEvent<QAD_StudyFrame,const QString&,QString>
                     (myStudyFrame,&QAD_StudyFrame::setTitle,QString(theTitle)));
@@ -1309,92 +1604,97 @@ namespace VISU{
     ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,myStudyFrame,aScale));
   }
   //===========================================================================
-};
 
 
-/*! SAN & VSR : Test QT_EVENT 
-  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-*/
-#include "VISU_Gen_i.hh"
-#include "QAD_Config.h"
-#include <vtkPolyDataMapper.h>
-#include <vtkSphereSource.h>
-#include <vtkProperty.h>
+  VISU_Actor* GetActor(VISU::Prs3d_i* thePrs3d, VTKViewer_ViewFrame* theVTKFrame){
+    vtkActor *anActor;
+    vtkActorCollection *anActColl = theVTKFrame->getRenderer()->GetActors();
+    anActColl->InitTraversal();
+    while(vtkActor *anActor = anActColl->GetNextActor())
+      if(VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
+       if(thePrs3d == anVISUActor->GetPrs3d())
+         return anVISUActor->GetParent();
+    return NULL;
+  }
 
-namespace VISU{
-  class TestViewEvent : public SALOME_Event {
-  public:
-    virtual void Execute(){
-      QAD_Desktop* desktop = QAD_Application::getDesktop();
-      QAD_Study*   aStudy = desktop->getActiveStudy();
-      if ( !aStudy ) {
-       QString defViewer = QAD_CONFIG->getSetting( "Viewer::DefaultViewer" );
-       int dv = defViewer.toInt();
-       QAD_CONFIG->addSetting( "Viewer::DefaultViewer", QString::number( VIEW_VTK ) );
-       desktop->createStudy();
-       if ( !defViewer.isEmpty() ) {
-         QAD_CONFIG->addSetting( "Viewer::DefaultViewer", QString::number( dv ) );
+
+  void DeletePrs3d(Prs3d_ptr thePrs3d){
+    if(Prs3d_i* aPrs3d = dynamic_cast<Prs3d_i*>(GetServant(thePrs3d).in())){
+      SALOMEDS::SObject_var aSObject = aPrs3d->GetSObject();
+      SALOMEDS::Study_var aStudyDocument = aSObject->GetStudy();
+      if(QAD_Desktop* aDesktop = QAD_Application::getDesktop()){
+       if(QAD_Study* aStudy = aDesktop->findStudy(aStudyDocument)){
+         aStudy->unHighlightAll();
+         int aNbStudyFrames = aStudy->getStudyFramesCount();
+         for(int aFrameId = 0; aFrameId < aNbStudyFrames; aFrameId++){
+           if(QAD_StudyFrame* aFrame = aStudy->getStudyFrame(aFrameId)){
+             QAD_ViewFrame* aViewFrame = aFrame->getRightFrame()->getViewFrame();
+             if(VTKViewer_ViewFrame* aVTKFrame = dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame)){
+               if(VISU_Actor* anActor = VISU::GetActor(aPrs3d,aVTKFrame)){
+                 aVTKFrame->RemoveActor(anActor);
+                 anActor->Delete();
+               }
+               aVTKFrame->unHighlightAll();
+             }
+           }
+         }
+
+         aPrs3d->RemoveFromStudy(); 
+         aPrs3d->Destroy(); 
+
+         aStudy->updateObjBrowser(); //update Object browser
        }
       }
-      else {
-       aStudy->newWindow3d( "", VIEW_VTK );
-      }
     }
-  };
+  }
+
 
-  void VISU_Gen_i::CreateTestView() {
-    TestViewEvent* ve = new TestViewEvent();
-    ve->process();
-    ve->release();
+  void VISU_Gen_i::DeleteResult(Result_ptr theResult)
+  {
+    class TEvent: public SALOME_Event{
+      Result_ptr myResult;
+    public:
+      TEvent(Result_ptr theResult): myResult(theResult) {}
+      virtual void Execute(){
+       if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(myResult).in())){
+         SALOMEDS::SObject_var aSObject = aResult->GetSObject();
+         SALOMEDS::Study_var aStudyDocument = aSObject->GetStudy();
+         SALOMEDS::ChildIterator_var aChildIter = aStudyDocument->NewChildIterator(aSObject);
+         for(aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()){
+           SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
+           CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
+           if(CORBA::is_nil(aChildObj)) continue;
+           VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aChildObj);
+           if(CORBA::is_nil(aPrs3d)) continue;
+           VISU::DeletePrs3d(aPrs3d);
+         }
+
+         aResult->RemoveFromStudy(); 
+         aResult->Destroy(); 
+
+         if(QAD_Desktop* aDesktop = QAD_Application::getDesktop())
+           if(QAD_Study* aStudy = aDesktop->findStudy(aStudyDocument))
+             aStudy->updateObjBrowser(); //update Object browser
+       }
+      }
+    };
+
+    ProcessVoidEvent(new TEvent(theResult));
   }
 
 
-  class TestObjectEvent : public SALOME_Event {
-  public:
-    virtual void Execute(){
-      float aRadius = 150.0 * random() / RAND_MAX + 10.;
-      float aX = 1000.0 * random() / RAND_MAX - 500.;
-      float aY = 1000.0 * random() / RAND_MAX - 500.;
-      float aZ = 1000.0 * random() / RAND_MAX - 500.;
-      float aR = (float)random() / RAND_MAX;
-      float aG = (float)random() / RAND_MAX;
-      float aB = (float)random() / RAND_MAX;
-
-      vtkSphereSource* aSource = vtkSphereSource::New();
-      aSource->SetRadius( aRadius );
-      aSource->SetCenter( aX, aY, aZ );
-  
-      vtkProperty* prop = vtkProperty::New();
-      prop->SetColor( aR, aG, aB );
-  
-      vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
-      aMapper->SetInput( aSource->GetOutput() );
-      
-      vtkActor* sphere = vtkActor::New();
-      sphere->SetMapper( aMapper );
-      sphere->SetProperty( prop );
-
-      QAD_Desktop* desktop = QAD_Application::getDesktop();
-      QAD_Study*   aStudy = desktop->getActiveStudy();
-      if ( !aStudy )
-       return ;
-      QAD_StudyFrame* sf = desktop->getActiveStudy()->getActiveStudyFrame();
-      VTKViewer_ViewFrame* vf = GetViewFrame( sf );
-      if ( !vf )
-       return;
-      sphere->SetVisibility( true );
-      vf->getRenderer()->AddActor(sphere);
-      vf->Repaint();
-    }
-  };
+  void VISU_Gen_i::DeletePrs3d(Prs3d_ptr thePrs3d)
+  {
+    class TEvent: public SALOME_Event{
+      Prs3d_ptr myPrs3d;
+    public:
+      TEvent(Prs3d_ptr thePrs3d): myPrs3d(thePrs3d) {}
+      virtual void Execute(){
+       VISU::DeletePrs3d(myPrs3d);
+      }
+    };
 
-  void VISU_Gen_i::ShowTestObject() {
-    TestObjectEvent* ve = new TestObjectEvent();
-    ve->process();
-    ve->release();
-    return;
+    ProcessVoidEvent(new TEvent(thePrs3d));
   }
-  /*! SAN & VSR : Test QT_EVENT
-    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-  */
-};
+
+}
index b399434dcf78c01cae1bebf3dccc79441c0a8ef0..c647ea6de970d61784c081cf850d952fea59e778 100644 (file)
@@ -65,9 +65,23 @@ namespace VISU{
   class View_i : public virtual POA_VISU::View,
                  public virtual Storable
   {
-  protected:
-    QAD_Study* myStudy;
   public:
+    QAD_Study*      myStudy;
+    QAD_StudyFrame* myStudyFrame;
+
+  public:
+    virtual void ShowPart( VISU::View::ViewRepresentation ViewRepr, CORBA::Boolean state  );
+    virtual CORBA::Boolean IsPartShown( VISU::View::ViewRepresentation ViewRepr );
+    virtual void SetViewWidth(CORBA::Long Width);
+    virtual void SetViewHeight(CORBA::Long Height);
+    virtual CORBA::Long GetViewWidth();
+    virtual CORBA::Long GetViewHeight();
+    virtual void SetViewPositionHorizontal(VISU::View::ViewPosition ViewPosHor);
+    virtual void SetViewPositionVertical(VISU::View::ViewPosition ViewPosVer);
+
+    virtual void SetRelativePosition( CORBA::Double x, CORBA::Double y );
+    virtual void SetRelativeSize( CORBA::Double x, CORBA::Double y );
+
     View_i(SALOMEDS::Study_ptr theStudy);
     virtual ~View_i();
     virtual void SetBackground(const SALOMEDS::Color& theColor);
@@ -87,6 +101,7 @@ namespace VISU{
     virtual void Close() = 0;
     virtual void ToStream(std::ostringstream& theStr);
     virtual const char* GetComment() const;
+
   public:
     virtual std::string View_i::GetEntry();
   };
@@ -148,7 +163,6 @@ namespace VISU{
 
     virtual void Close();
   protected:
-    QAD_StudyFrame*   myStudyFrame;
     Plot2d_ViewFrame* myView;
   public:
     virtual Storable* Create(int theNew);
@@ -251,20 +265,21 @@ namespace VISU{
     virtual void Close();
 
   protected:
-    QAD_StudyFrame* myStudyFrame;
     static int myNbViewParams;
 
   public:
     virtual Storable* Create(int theNew);
     virtual void ToStream(std::ostringstream& theStr);
     virtual const char* GetComment() const;
-    static const string myComment;
+    static const std::string myComment;
     QAD_StudyFrame* GetStudyFrame() const { return myStudyFrame;}
   };
 
   VTKViewer_ViewFrame* GetViewFrame(QAD_StudyFrame* theStudyFrame);
   vtkRenderer* GetRenderer(QAD_StudyFrame* theStudyFrame);
   vtkCamera* GetCamera(QAD_StudyFrame* theStudyFrame);
+
+  void RepaintView(VTKViewer_ViewFrame* theViewFrame);
   void RepaintView(QAD_StudyFrame* theStudyFrame);
 
   enum Displaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll};
index d4b0ac365519ae629a67ff508cb52ad15c48daa5..8474ef9e7513378463b22146adc5f09e9e9b6fbb 100644 (file)
@@ -43,7 +43,7 @@ SWIG_FLAGS +=
 SWIG_DEF = libVISU_Swig.i
 EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
        visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py\
-       visu_table.py visu_big_table.py visu_view.py \
+       visu_table.py visu_big_table.py visu_view.py visu_delete.py\
        visu_swig_test.py test_events.py batch_test_events.py
 EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py
 
index 840c61eab9691de12e87e3916f1cb94aad9c3748..fc023764d0d9fe39a7f352a2741064364050a569 100644 (file)
@@ -38,7 +38,8 @@ def Initialize(theORB, theNamingService, theLifeCycleCORBA, theStudyManager, the
     myNamingService = theNamingService
     myLifeCycleCORBA = theLifeCycleCORBA
     myLocalStudyManager = theStudyManager
-    mySession = myNamingService.Resolve("/Kernel/Session")
+    while mySession == None:
+       mySession = myNamingService.Resolve("/Kernel/Session")
     mySession = mySession._narrow(SALOME.Session)
     mySession.GetInterface()
     myDelay = theDelay
diff --git a/src/VISU_SWIG/visu_delete.py b/src/VISU_SWIG/visu_delete.py
new file mode 100644 (file)
index 0000000..b73173c
--- /dev/null
@@ -0,0 +1,28 @@
+import VISU
+import SALOMEDS
+from visu_gui import *
+
+myViewManager = myVisu.GetViewManager();
+myView = myViewManager.Create3DView();
+
+medFile = "fra.med"
+myFieldName = "VITESSE";
+
+aMeshName ="LE VOLUME"
+anEntity = VISU.NODE
+aTimeStampId = 1
+
+medFile = os.getenv('KERNEL_ROOT_DIR') + '/examples/' + medFile
+myResult = myVisu.ImportFile(medFile)
+
+aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+myView.Display(aScalarMap);
+myView.FitAll();
+
+aCutPlanes = myVisu.CutPlanesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+myView = myViewManager.Create3DView();
+myView.Display(aCutPlanes);
+myView.FitAll();
+
+myVisu.DeletePrs3d(aScalarMap)
+myVisu.DeleteResult(myResult)