]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for NPAL18713 : EDF 611 VISU : Using ScalarMapOnDeformedShape is ambiguous. TG_start_Deformed_CutPlanes
authormkr <mkr@opencascade.com>
Tue, 20 May 2008 14:45:49 +0000 (14:45 +0000)
committermkr <mkr@opencascade.com>
Tue, 20 May 2008 14:45:49 +0000 (14:45 +0000)
53 files changed:
doc/salome/gui/VISU/images/smds1.png
doc/salome/gui/VISU/input/calar_map_on_deformed_shape.doc
doc/salome/gui/VISU/pics/smds1.png
doc/salome/gui/VISU/visugenidl_doc/VISU__Gen_8idl.html
doc/salome/gui/VISU/visugenidl_doc/interfaceVISU_1_1ScalarMapOnDeformedShape.html
doc/salome/gui/VISU/visugenidl_doc/namespaceVISU.html
doc/salome/gui/VISU/whdata/whftdata0.htm
doc/salome/gui/VISU/whdata/whtdata0.htm
doc/salome/gui/VISU/whgdata/whlstt3.htm
doc/salome/gui/VISU/whgdata/whlstt4.htm
doc/salome/gui/VISU/whxdata/whftdata0.xml
doc/salome/gui/VISU/whxdata/whtdata0.xml
idl/VISU_Gen.idl
src/ENGINE/VISU_Engine_i.cc
src/ENGINE/VISU_Engine_i.hh
src/PIPELINE/Makefile.am
src/PIPELINE/VISUPipeLine.cxx
src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx [new file with mode: 0644]
src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx [new file with mode: 0644]
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx [deleted file]
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx [deleted file]
src/VISUGUI/Makefile.am
src/VISUGUI/VISU_images.po
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_ActionsDef.h
src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx [new file with mode: 0644]
src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h [new file with mode: 0644]
src/VISUGUI/VisuGUI_PopupTools.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx [deleted file]
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h [deleted file]
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_Tools.cxx
src/VISU_I/Makefile.am
src/VISU_I/VISUConfig.cc
src/VISU_I/VISU_ColoredPrs3dCache_i.cc
src/VISU_I/VISU_ColoredPrs3dFactory.cc
src/VISU_I/VISU_ColoredPrs3dFactory.hh
src/VISU_I/VISU_DeformedShapeAndScalarMap_i.cc [new file with mode: 0644]
src/VISU_I/VISU_DeformedShapeAndScalarMap_i.hh [new file with mode: 0644]
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_I.cxx
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc [deleted file]
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh [deleted file]
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_View_i.cc
src/VISU_SWIG/VISU_Example_01.py
src/VISU_SWIG/VISU_Example_07.py
src/VISU_SWIG/visu.py
src/VISU_SWIG/visu_cache.py

index 24c5feda71d28271be6e63a1388b1b6aaa3cea20..f74008d4577b87ddc1a355c8e1ceacdf886d1df0 100644 (file)
Binary files a/doc/salome/gui/VISU/images/smds1.png and b/doc/salome/gui/VISU/images/smds1.png differ
index 0ec95fb59d6bd04f170ce14489accd0a670c8f3f..bc7ea73048f06a7e301ad8edbb4f576e2709fb7a 100644 (file)
@@ -1,30 +1,30 @@
 /*!
 
-\page scalar_map_on_deformed_shape_page Scalar Map on Deformed Shape presentation
+\page scalar_map_on_deformed_shape_page Deformed Shape and Scalar Map presentation
 
-\n <b>Scalar Map on Deformed Shape</b> presentation is a mix of the
+\n <b>Deformed Shape and Scalar Map</b> presentation is a mix of the
 two: \ref scalar_map_page "Scalar Map" and \ref deformed_shape_page
 "Deformed Shape". In this presentation the Scalar Map is built on a
 Deformed Shape.
 
-<em>To create a Scalar Map on Deformed Shape presentation:</em>
+<em>To create a Deformed Shape and Scalar Map presentation:</em>
 \par
 &ndash; Right-click on one of the time stamps of the field in the
-Object browser and from the pop-up menu choose <b>Scalar Map on
-Deformed Shape</b>, or
+Object browser and from the pop-up menu choose <b>Deformed Shape and
+Scalar Map</b>, or
 \n &ndash; Click on one of the time stamps of the field in the Object
-browser and select from the main menu <b>Visualization > Scalar Map on
-Deformed Shape</b>, or click <em>"Scalar Map on Deformed Shape"</em>
+browser and select from the main menu <b>Visualization > Deformed Shape and
+Scalar Map</b>, or click <em>"Deformed Shape and Scalar Map"</em>
 icon in the <b>Visualization Toolbar</b>.
 
 \image html image40.gif
-<center><em>"Scalar Map on Deformed Shape" icon</em></center>
+<center><em>"Deformed Shape and Scalar Map" icon</em></center>
 
 \image html smds1.png
 
 \par
-<b>Scalar Map on Deformed Shape</b> tab allows you to set additional
-parameters of your Scalar Map on Deformed Shape presentation:
+<b>Deformed Shape and Scalar Map</b> tab allows you to set additional
+parameters of your Deformed Shape and Scalar Map presentation:
 <ul>
 <li><b>Scale Factor:</b> visualization scaling of all vector values
 applied to the cells of the mesh.</li>
@@ -43,7 +43,7 @@ Compare ordinary Scalar Map presentation:
 
 \image html smds-example1.png
 
-with Scalar Map on Deformed Shape presentation:
+with Deformed Shape and Scalar Map presentation:
 
 \image html smds-example.png
 
index 24c5feda71d28271be6e63a1388b1b6aaa3cea20..f74008d4577b87ddc1a355c8e1ceacdf886d1df0 100755 (executable)
Binary files a/doc/salome/gui/VISU/pics/smds1.png and b/doc/salome/gui/VISU/pics/smds1.png differ
index 5d34130d68ec32f48c19426cf5ea542b3f122965..25789b67e60bc18264a17007248efa8e2858ad04 100644 (file)
@@ -74,7 +74,7 @@ Include dependency graph for VISU_Gen.idl:<p><center><img src="VISU__Gen_8idl__i
 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deformed shape presentation interface.  <a href="interfaceVISU_1_1DeformedShape.html#_details">More...</a><br></td></tr>
 <tr><td class="memItemLeft" nowrap align="right" valign="top">interface &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">VISU.ScalarMapOnDeformedShape</a></td></tr>
 
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Scalar Map on Deformed shape presentation interface.  <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deformed shape and Scalar Map presentation interface.  <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
 <tr><td class="memItemLeft" nowrap align="right" valign="top">interface &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1Plot3D.html">VISU.Plot3D</a></td></tr>
 
 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a> interface.  <a href="interfaceVISU_1_1Plot3D.html#_details">More...</a><br></td></tr>
index 878345b4c0b68e14a7f1c0691991c0558636cf28..7909505277362199db3c75a4aa3bdf0dbb7a0018 100644 (file)
@@ -14,7 +14,7 @@
 <!-- Generated by Doxygen 1.4.7 -->
 <div class="nav">
 <a class="el" href="namespaceVISU.html">VISU</a>.<a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">ScalarMapOnDeformedShape</a></div>
-<h1>VISU.ScalarMapOnDeformedShape Interface Reference</h1><!-- doxytag: class="VISU::ScalarMapOnDeformedShape" --><!-- doxytag: inherits="VISU::ScalarMap" -->Scalar Map on Deformed shape presentation interface.  
+<h1>VISU.ScalarMapOnDeformedShape Interface Reference</h1><!-- doxytag: class="VISU::ScalarMapOnDeformedShape" --><!-- doxytag: inherits="VISU::ScalarMap" -->Deformed shape and Scalar Map presentation interface.  
 <a href="#_details">More...</a>
 <p>
 <code>import &quot;VISU_Gen.idl&quot;;</code>
index 9543044bb6becbe5efd1c5892d95ff3db0a236ef..8de0ca8a0eab6c52afbe9baf1f503ca2359b08f4 100644 (file)
@@ -60,7 +60,7 @@
 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deformed shape presentation interface.  <a href="interfaceVISU_1_1DeformedShape.html#_details">More...</a><br></td></tr>
 <tr><td class="memItemLeft" nowrap align="right" valign="top">interface &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">ScalarMapOnDeformedShape</a></td></tr>
 
-<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Scalar Map on Deformed shape presentation interface.  <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Deformed shape and Scalar Map presentation interface.  <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
 <tr><td class="memItemLeft" nowrap align="right" valign="top">interface &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a></td></tr>
 
 <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a> interface.  <a href="interfaceVISU_1_1Plot3D.html#_details">More...</a><br></td></tr>
index eae6a6241a9dd52c55b2e7e94d6e43cbe29598b7..5acacd5e88d1cac92f45254d6b16ab705b761b34 100755 (executable)
@@ -49,7 +49,7 @@ aTE("Plot2D Viewer","plot2d_viewer.htm");
 aTE("Plot 3D presentation","plot_3d_presentation.htm");
 aTE("Primitive Types","primitive_types.htm");
 aTE("Scalar Bar","scalar_bar.htm");
-aTE("Scalar Map on Deformed Shape presentation","scalar_map_on_deformed_shape_presentation.htm");
+aTE("Deformed Shape and Scalar Map presentation","scalar_map_on_deformed_shape_presentation.htm");
 aTE("Segmentation","segmentation.htm");
 aTE("Types of Gauss Points Presentations","types_of_gauss_points_presentations.htm");
 aTE("VTK 3D Viewer","vtk_3d_viewer.htm");
index fe3b5c793b370bfc25b247e040ae5520868f5c92..67da6bc2d33244fe90cd223d8d4e6ce270908feb 100755 (executable)
@@ -24,7 +24,7 @@
        aTE(2,0,"Deformed Shape presentation","files/deformed_shape_presentation.htm");
        aTE(2,0,"Vectors Presentation","files/vectors_presentation.htm");
        aTE(2,0,"Stream Lines presentation","files/stream_lines_presentation.htm");
-       aTE(2,0,"Scalar Map on Deformed Shape presentation","scalar_map_on_deformed_shape_presentation.htm");
+       aTE(2,0,"Deformed Shape and Scalar Map presentation","scalar_map_on_deformed_shape_presentation.htm");
        aTE(2,0,"Plot 3D presentation","plot_3d_presentation.htm");
        aTE(2,0,"Animating presentations","files/animating_presentations.htm");
        aTE(1,9,"Gauss Points Presentations");
index d960e94db7ebb7006ebb2c4f4be5357893fde3b6..56224cc4ea7d9816e5845da11b0201304c93c8cd 100755 (executable)
@@ -53,7 +53,7 @@ img {vertial-align:middle;}
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../files/deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape presentation</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../files/vectors_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Vectors Presentation</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../files/stream_lines_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Stream Lines presentation</a></nobr><br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Scalar Map on Deformed Shape presentation</a></nobr><br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape and Scalar Map presentation</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../plot_3d_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Plot 3D presentation</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../files/animating_presentations.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Animating presentations</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a name="4"></a><a href="whlstt4.htm#4" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Gauss Points Presentations</a></nobr><br>
index 253afb61247f5727f90cfd1c04d105f63806d03b..49593c242b42cb211a735013e303652758afa0bd 100755 (executable)
@@ -53,7 +53,7 @@ img {vertial-align:middle;}
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../files/deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape presentation</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../files/vectors_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Vectors Presentation</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../files/stream_lines_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Stream Lines presentation</a></nobr><br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Scalar Map on Deformed Shape presentation</a></nobr><br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape and Scalar Map presentation</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../plot_3d_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Plot 3D presentation</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a href="../files/animating_presentations.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Animating presentations</a></nobr><br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<nobr><a name="4"></a><a href="whlstt3.htm#4" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> Gauss Points Presentations</a></nobr><br>
index 18b3f31dcf3074863959b13fc9f2c7c6d7773c5b..37c3d3378b37d5246a6b2e92e3ad7e9b4ccc3092 100755 (executable)
@@ -37,7 +37,7 @@
 <topic name="Plot 3D presentation" url="plot_3d_presentation.htm" />
 <topic name="Primitive Types" url="primitive_types.htm" />
 <topic name="Scalar Bar" url="scalar_bar.htm" />
-<topic name="Scalar Map on Deformed Shape presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
+<topic name="Deformed Shape and Scalar Map presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
 <topic name="Segmentation" url="segmentation.htm" />
 <topic name="Types of Gauss Points Presentations" url="types_of_gauss_points_presentations.htm" />
 <topic name="VTK 3D Viewer" url="vtk_3d_viewer.htm" />
index 14a0dff2ade979f20858261be2735c7024800ec9..13b3a71505b62082f9554632aab80bbcbebb4a64 100755 (executable)
@@ -16,7 +16,7 @@
       <item name="Deformed Shape presentation" url="files/deformed_shape_presentation.htm" />
       <item name="Vectors Presentation" url="files/vectors_presentation.htm" />
       <item name="Stream Lines presentation" url="files/stream_lines_presentation.htm" />
-      <item name="Scalar Map on Deformed Shape presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
+      <item name="Deformed Shape and Scalar Map presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
       <item name="Plot 3D presentation" url="plot_3d_presentation.htm" />
       <item name="Animating presentations" url="files/animating_presentations.htm" />
       <book name="Gauss Points Presentations" >
index de6e5119176c9e7aba63ee602dcca82342c92f2e..783375886784b4209d055c170249364dc4ba6685 100644 (file)
@@ -78,7 +78,8 @@ module VISU {
     TSCALARMAP, /*!< Scalarmap 3D presentation object */
     TISOSURFACES, /*!< Iso surface 3D presentation object */
     TDEFORMEDSHAPE, /*!< Deformed shape 3D presentation object */
-    TSCALARMAPONDEFORMEDSHAPE, /*!< Scalar map on deformed shape 3D presentation object */
+    TSCALARMAPONDEFORMEDSHAPE, /*!< Scalar map on deformed shape 3D presentation object. It is obsolete. Use TDEFORMEDSHAPEANDSCALARMAP instead */
+    TDEFORMEDSHAPEANDSCALARMAP, /*!< Deformed shape and scalar map 3D presentation object */
     TGAUSSPOINTS, /*!< Gauss Points 3D presentation object */
     TPLOT3D, /*!< Plot3D 3D presentation object */
     TPOINTMAP3D, /*!< 3D presentation for table object */
@@ -879,7 +880,7 @@ module VISU {
    *
    * Presentation parameters of the scalar map on deformed shape presentation.
    */
-  interface ScalarMapOnDeformedShape : ScalarMap {
+  interface DeformedShapeAndScalarMap : ScalarMap {
     
     /*!
      * Sets the scale of the presentatable object.
@@ -2005,6 +2006,18 @@ module VISU {
                                       in Entity theEntity, in string theFieldName,
                                       in long theTimeStampNumber);
 
+    /*!
+     * Creates a deformed shape presentation. This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
+     * \param theResult    Data generated in other sources. (MED object or file)
+     * \param theMeshName  One of the meshes presented in MED file
+     * \param theEntity    Type of entity where the field is defined
+     * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
+     * \param theTimeStampNumber Number of iteration on the field
+     */
+    DeformedShapeAndScalarMap ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
+                                                             in Entity theEntity, in string theFieldName,
+                                                             in long theTimeStampNumber);
+
     /*!
      * Creates a deformed shape presentation.
      * \param theResult    Data generated in other sources. (MED object or file)
@@ -2013,9 +2026,9 @@ module VISU {
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
      * \param theTimeStampNumber Number of iteration on the field
      */
-    ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
-                                                            in Entity theEntity, in string theFieldName,
-                                                            in long theTimeStampNumber);
+    DeformedShapeAndScalarMap DeformedShapeAndScalarMapOnField(in Result theResult, in string theMeshName,
+                                                              in Entity theEntity, in string theFieldName,
+                                                              in long theTimeStampNumber);
 
     /*!
      * Creates a vector presentation.
index 80b53607fd17f052e13cc9df8dbef42b8d4fb78e..d857f64495f2cbb3c95d6243c7f6aa5adb4cfa66 100644 (file)
@@ -278,7 +278,7 @@ namespace VISU{
     return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
-  ScalarMapOnDeformedShape_ptr 
+  DeformedShapeAndScalarMap_ptr 
   VISU_Gen_i
   ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, 
                                    const char* theMeshName, 
@@ -286,7 +286,18 @@ namespace VISU{
                                    const char* theFieldName, 
                                    CORBA::Long theIteration)
   {
-    return myVisuGen->ScalarMapOnDeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+    return DeformedShapeAndScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+  }
+
+  DeformedShapeAndScalarMap_ptr 
+  VISU_Gen_i
+  ::DeformedShapeAndScalarMapOnField(Result_ptr theResult, 
+                                    const char* theMeshName, 
+                                    VISU::Entity theEntity,
+                                    const char* theFieldName, 
+                                    CORBA::Long theIteration)
+  {
+    return myVisuGen->DeformedShapeAndScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
   Vectors_ptr 
index 8c5964c6e5e903ae416b8933f6325def9b4fd771..247a1074216ae35a3866a27fecc6738e6f1251f0 100644 (file)
@@ -152,14 +152,23 @@ namespace VISU
                  const char* theFieldName, 
                  CORBA::Long theIteration);
 
+    //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
     virtual
-    ScalarMapOnDeformedShape_ptr
+    DeformedShapeAndScalarMap_ptr
     ScalarMapOnDeformedShapeOnField(Result_ptr theResult, 
                                    const char* theMeshName, 
                                    VISU::Entity theEntity,
                                    const char* theFieldName, 
                                    CORBA::Long theIteration);
 
+    virtual
+    DeformedShapeAndScalarMap_ptr
+    DeformedShapeAndScalarMapOnField(Result_ptr theResult, 
+                                    const char* theMeshName, 
+                                    VISU::Entity theEntity,
+                                    const char* theFieldName, 
+                                    CORBA::Long theIteration);
+    
     //Create Digital Presentation
     virtual Table_ptr CreateTable(const char* theTableEntry);
     virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
index 1a93742e7f89f882cc924f1a871df808b13fb182..82bc4155629ec519701c0c66c83cc9a2876f10ce 100644 (file)
@@ -63,7 +63,7 @@ salomeinclude_HEADERS= \
        VISU_PlanesWidget.hxx \
        VISU_SphereWidget.hxx \
        VISU_WidgetCtrl.hxx \
-       VISU_ScalarMapOnDeformedShapePL.hxx \
+       VISU_DeformedShapeAndScalarMapPL.hxx \
        VISUPipeline.hxx \
        VISU_LabelPointsFilter.hxx
 
@@ -102,7 +102,7 @@ dist_libVisuPipeLine_la_SOURCES= \
        VISU_SphereWidget.cxx \
        VISU_WidgetCtrl.cxx \
        VISU_ScalarBarCtrl.cxx \
-       VISU_ScalarMapOnDeformedShapePL.cxx \
+       VISU_DeformedShapeAndScalarMapPL.cxx \
        VISU_LabelPointsFilter.cxx
 
 libVisuPipeLine_la_CPPFLAGS= \
index 307f99f9c449c1b8b3246317a43b9b1987b3158e..ff3ba992709659d8879bde019c730e14d9dee3c1 100644 (file)
@@ -33,7 +33,7 @@
 #include "VISU_VectorsPL.hxx"
 #include "VISU_StreamLinesPL.hxx"
 #include "VISU_GaussPointsPL.hxx"
-#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+#include "VISU_DeformedShapeAndScalarMapPL.hxx"
 #include "VISU_Plot3DPL.hxx"
 #include "VISU_ScalarBarActor.hxx"
 
diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx
new file mode 100644 (file)
index 0000000..67e1b32
--- /dev/null
@@ -0,0 +1,368 @@
+//  VISU DeformedShapeAndScalarMapPL
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File:    VISU_DeformedShapeAndScalarMapPL.cxx
+// Author:  Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_DeformedShapeAndScalarMapPL.hxx"
+#include "VISU_FieldTransform.hxx"
+#include "VISU_Extractor.hxx"
+#include "VISU_LookupTable.hxx"
+#include "VISU_DeformedShapePL.hxx"
+#include "VTKViewer_TransformFilter.h"
+#include "VTKViewer_Transform.h"
+#include "VISU_MergeFilter.hxx"
+
+#include "VISU_PipeLineUtils.hxx"
+
+#include <vtkWarpVector.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkCellDataToPointData.h>
+#include <vtkPointDataToCellData.h>
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VISU_DeformedShapeAndScalarMapPL)
+
+//----------------------------------------------------------------------------
+/*!
+ * Constructor. Creating new instances of vtkWarpVector,vtkMergeFilter,vtkUnstructuredGrid
+ * Where:
+ * \li myDeformVectors is vtkWarpVector  - deformation vectors data
+ * \li myScalarsMergeFilter   is vtkMergeFilter - merge filter.
+ * Merge filter which unify the deformation and scalars
+ * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
+*/
+VISU_DeformedShapeAndScalarMapPL
+::VISU_DeformedShapeAndScalarMapPL():
+  myScaleFactor(0.0)
+{
+  myWarpVector = vtkWarpVector::New();
+
+  myScalarsMergeFilter = VISU_MergeFilter::New();
+  myScalarsMergeFilter->SetMergingInputs(true);
+
+  myScalarsExtractor = VISU_Extractor::New();
+
+  myScalarsFieldTransform = VISU_FieldTransform::New();
+
+  myCellDataToPointData = vtkCellDataToPointData::New();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Destructor.
+ * Delete all fields.
+*/
+VISU_DeformedShapeAndScalarMapPL
+::~VISU_DeformedShapeAndScalarMapPL()
+{
+  myWarpVector->Delete();
+
+  myScalarsMergeFilter->Delete();
+  
+  myScalarsExtractor->Delete();
+
+  myScalarsFieldTransform->Delete();
+
+  myCellDataToPointData->Delete();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Initial method
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::Init()
+{
+  Superclass::Init();
+  
+  SetScale(VISU_DeformedShapePL::GetDefaultScale(this));
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Build method
+ * Building of deformation and puts result to merge filter.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::Build()
+{
+  Superclass::Build();
+}
+
+
+//----------------------------------------------------------------------------
+vtkDataSet* 
+VISU_DeformedShapeAndScalarMapPL
+::InsertCustomPL()
+{
+  GetMapper()->SetColorModeToMapScalars();
+  GetMapper()->ScalarVisibilityOn();
+
+  VISU::CellDataToPoint(myWarpVector,
+                       myCellDataToPointData,
+                       GetMergedInput());
+  
+  myScalars = GetMergedInput();
+
+  UpdateScalars();
+
+  myScalarsFieldTransform->SetInput(myScalarsExtractor->GetOutput());
+
+  // Sets geometry for merge filter
+  myScalarsMergeFilter->SetGeometry(myWarpVector->GetUnstructuredGridOutput());
+
+  vtkDataSet* aScalarsDataSet = myScalarsFieldTransform->GetOutput();
+  myScalarsMergeFilter->SetScalars(aScalarsDataSet);
+  myScalarsMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsDataSet);
+  myScalarsMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsDataSet);
+
+  return myScalarsMergeFilter->GetOutput();
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ *  Update method
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::Update()
+{
+  Superclass::Update();
+  //{
+  //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsExtractor.vtk";
+  //  VISU::WriteToFile(myScalarsExtractor->GetUnstructuredGridOutput(), aFileName);
+  //}
+  //{
+  //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk";
+  //  VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
+  //}
+  //{
+  //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsMergeFilter.vtk";
+  //  VISU::WriteToFile(myScalarsMergeFilter->GetUnstructuredGridOutput(), aFileName);
+  //}
+}
+
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_DeformedShapeAndScalarMapPL
+::GetMemorySize()
+{
+  unsigned long int aSize = Superclass::GetMemorySize();
+
+  if(vtkDataSet* aDataSet = myWarpVector->GetOutput())
+    aSize += aDataSet->GetActualMemorySize() * 1024;
+  
+  if(vtkDataSet* aDataSet = myScalarsExtractor->GetOutput())
+    aSize += aDataSet->GetActualMemorySize() * 1024;
+
+  if(vtkDataSet* aDataSet = myScalarsMergeFilter->GetOutput())
+    aSize += aDataSet->GetActualMemorySize() * 1024;
+
+  if(myCellDataToPointData->GetInput())
+    if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
+      aSize += aDataSet->GetActualMemorySize() * 1024;
+
+  return aSize;
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Update scalars method.
+ * Put scalars to merge filter.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::UpdateScalars()
+{
+  vtkDataSet* aScalars = GetScalars();
+  myScalarsExtractor->SetInput(aScalars);
+
+  if(VISU::IsDataOnCells(aScalars))
+    GetMapper()->SetScalarModeToUseCellData();
+  else
+    GetMapper()->SetScalarModeToUsePointData();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Copy information about pipline.
+ * Copy scale and scalars.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput)
+{
+  Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
+
+  if(VISU_DeformedShapeAndScalarMapPL *aPipeLine = dynamic_cast<VISU_DeformedShapeAndScalarMapPL*>(thePipeLine)){
+     SetScale(aPipeLine->GetScale());
+     SetScalars(aPipeLine->GetScalars());
+  }
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Set scalars.
+ * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScalars(vtkDataSet *theScalars)
+{
+  if(GetScalars() == theScalars)
+    return;
+
+  myScalars = theScalars;
+  UpdateScalars();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Get pointer to input scalars.
+ */
+vtkDataSet* 
+VISU_DeformedShapeAndScalarMapPL
+::GetScalars()
+{
+  return myScalars.GetPointer();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Sets scale for deformed shape
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScale(vtkFloatingPointType theScale) 
+{
+  if(VISU::CheckIsSameValue(myScaleFactor, theScale))
+    return;
+
+  myWarpVector->SetScaleFactor(theScale);
+  myScaleFactor = theScale;
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets scale of deformed shape.
+ */
+vtkFloatingPointType
+VISU_DeformedShapeAndScalarMapPL
+::GetScale() 
+{
+  return myWarpVector->GetScaleFactor();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Set scale factor of deformation.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
+  Superclass::SetMapScale(theMapScale);
+  myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets scalar mode.
+ */
+int
+VISU_DeformedShapeAndScalarMapPL
+::GetScalarMode()
+{
+  return myScalarsExtractor->GetScalarMode();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Sets scalar mode.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScalarMode(int theScalarMode)
+{
+  VISU_ScalarMapPL::SetScalarMode(theScalarMode, GetScalars(), myScalarsExtractor);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScaling(int theScaling) 
+{
+  if(GetScaling() == theScaling)
+    return;
+
+  GetBarTable()->SetScale(theScaling);
+
+  if(theScaling == VTK_SCALE_LOG10)
+    myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Log10));
+  else
+    myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Ident));
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetScalarRange(vtkFloatingPointType theRange[2])
+{
+  if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
+    return;
+
+  myScalarsFieldTransform->SetScalarRange(theRange);
+  GetBarTable()->SetRange(theRange);
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType* 
+VISU_DeformedShapeAndScalarMapPL
+::GetScalarRange() 
+{
+  return myScalarsFieldTransform->GetScalarRange();
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets ranges of extracted scalars
+ * \param theRange[2] - output values
+ * \li theRange[0] - minimum value
+ * \li theRange[1] - maximum value
+ */
+void 
+VISU_DeformedShapeAndScalarMapPL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
+  myScalarsExtractor->Update();
+  myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange);
+}
diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx
new file mode 100644 (file)
index 0000000..e1041b4
--- /dev/null
@@ -0,0 +1,146 @@
+//  VISU OBJECT : interactive object for VISU entities implementation
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File:    VISU_DeformedShapeAndScalarMapPL.hxx
+// Author:  Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_DeformedShapeAndScalarMapPL_HeaderFile
+#define VISU_DeformedShapeAndScalarMapPL_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include "VISU_ScalarMapPL.hxx"
+
+class VISU_MergeFilter;
+class vtkWarpVector;
+class vtkUnstructuredGrid;
+class vtkCellDataToPointData;
+class vtkPointDataToCellData;
+
+
+//----------------------------------------------------------------------------
+class VISU_PIPELINE_EXPORT VISU_DeformedShapeAndScalarMapPL : public VISU_ScalarMapPL
+{
+public:
+  vtkTypeMacro(VISU_DeformedShapeAndScalarMapPL, VISU_ScalarMapPL);
+
+  static 
+  VISU_DeformedShapeAndScalarMapPL* 
+  New();
+
+  virtual
+  void
+  SetScale(vtkFloatingPointType theScale);
+
+  virtual
+  vtkFloatingPointType
+  GetScale();
+
+  virtual
+  int
+  GetScalarMode();
+
+  virtual
+  void
+  SetScalarMode(int theScalarMode = 0);
+
+  virtual
+  void
+  SetScaling(int theScaling);
+  
+  virtual
+  void
+  SetScalarRange(vtkFloatingPointType theRange[2]);
+
+  virtual
+  vtkFloatingPointType* 
+  GetScalarRange();
+
+  virtual
+  void
+  GetSourceRange(vtkFloatingPointType theRange[2]);
+
+  virtual
+  void
+  SetScalars(vtkDataSet *theScalars);
+
+  virtual
+  vtkDataSet* 
+  GetScalars();
+
+public:
+  //! Redefined method for initialization of the pipeline.
+  virtual
+  void
+  Init();
+
+  //! Redefined method for building the pipeline.
+  virtual
+  void
+  Build();
+
+  //! Redefined method for updating the pipeline.
+  virtual
+  void
+  Update();
+
+  //! Gets memory size used by the instance (bytes).
+  virtual
+  unsigned long int
+  GetMemorySize();
+
+  //! Update scalars.
+  void
+  UpdateScalars();
+  
+  virtual
+  void
+  SetMapScale(vtkFloatingPointType theMapScale = 1.0);
+  
+protected:
+  VISU_DeformedShapeAndScalarMapPL();
+  
+  virtual
+  ~VISU_DeformedShapeAndScalarMapPL();
+  
+  virtual
+  vtkDataSet* 
+  InsertCustomPL();
+
+  virtual
+  void
+  DoShallowCopy(VISU_PipeLine *thePipeLine,
+               bool theIsCopyInput);
+
+private:
+  VISU_DeformedShapeAndScalarMapPL(const VISU_DeformedShapeAndScalarMapPL&);
+
+  vtkFloatingPointType myScaleFactor;
+  vtkWarpVector  *myWarpVector;
+  VISU_MergeFilter *myScalarsMergeFilter;
+  vtkSmartPointer<vtkUnstructuredGrid> myScalars;
+  vtkCellDataToPointData* myCellDataToPointData;
+  VISU_FieldTransform* myScalarsFieldTransform;
+  VISU_Extractor* myScalarsExtractor;
+};
+
+#endif
diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
deleted file mode 100644 (file)
index 008939b..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-//  VISU ScalarMapOnDeformedShapePL
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File:    VISU_ScalarMapOnDeformedShapePL.cxx
-// Author:  Eugeny Nikolaev
-// Module : VISU
-
-#include "VISU_ScalarMapOnDeformedShapePL.hxx"
-#include "VISU_FieldTransform.hxx"
-#include "VISU_Extractor.hxx"
-#include "VISU_LookupTable.hxx"
-#include "VISU_DeformedShapePL.hxx"
-#include "VTKViewer_TransformFilter.h"
-#include "VTKViewer_Transform.h"
-#include "VISU_MergeFilter.hxx"
-
-#include "VISU_PipeLineUtils.hxx"
-
-#include <vtkWarpVector.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkCellDataToPointData.h>
-#include <vtkPointDataToCellData.h>
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL)
-
-//----------------------------------------------------------------------------
-/*!
- * Constructor. Creating new instances of vtkWarpVector,vtkMergeFilter,vtkUnstructuredGrid
- * Where:
- * \li myDeformVectors is vtkWarpVector  - deformation vectors data
- * \li myScalarsMergeFilter   is vtkMergeFilter - merge filter.
- * Merge filter which unify the deformation and scalars
- * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
-*/
-VISU_ScalarMapOnDeformedShapePL
-::VISU_ScalarMapOnDeformedShapePL():
-  myScaleFactor(0.0),
-  myMapScaleFactor(1.0)
-{
-  myWarpVector = vtkWarpVector::New();
-
-  myScalarsMergeFilter = VISU_MergeFilter::New();
-  myScalarsMergeFilter->SetMergingInputs(true);
-
-  myScalarsExtractor = VISU_Extractor::New();
-
-  myScalarsFieldTransform = VISU_FieldTransform::New();
-
-  myCellDataToPointData = vtkCellDataToPointData::New();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Destructor.
- * Delete all fields.
-*/
-VISU_ScalarMapOnDeformedShapePL
-::~VISU_ScalarMapOnDeformedShapePL()
-{
-  myWarpVector->Delete();
-
-  myScalarsMergeFilter->Delete();
-  
-  myScalarsExtractor->Delete();
-
-  myScalarsFieldTransform->Delete();
-
-  myCellDataToPointData->Delete();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Initial method
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::Init()
-{
-  Superclass::Init();
-  
-  SetScale(VISU_DeformedShapePL::GetDefaultScale(this));
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Build method
- * Building of deformation and puts result to merge filter.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::Build()
-{
-  Superclass::Build();
-}
-
-
-//----------------------------------------------------------------------------
-vtkDataSet* 
-VISU_ScalarMapOnDeformedShapePL
-::InsertCustomPL()
-{
-  GetMapper()->SetColorModeToMapScalars();
-  GetMapper()->ScalarVisibilityOn();
-
-  VISU::CellDataToPoint(myWarpVector,
-                       myCellDataToPointData,
-                       GetMergedInput());
-  
-  myScalars = GetMergedInput();
-
-  UpdateScalars();
-
-  myScalarsFieldTransform->SetInput(myScalarsExtractor->GetOutput());
-
-  // Sets geometry for merge filter
-  myScalarsMergeFilter->SetGeometry(myWarpVector->GetUnstructuredGridOutput());
-
-  vtkDataSet* aScalarsDataSet = myScalarsFieldTransform->GetOutput();
-  myScalarsMergeFilter->SetScalars(aScalarsDataSet);
-  myScalarsMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsDataSet);
-  myScalarsMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsDataSet);
-
-  return myScalarsMergeFilter->GetOutput();
-}
-
-
-//----------------------------------------------------------------------------
-/*!
- *  Update method
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::Update()
-{
-  Superclass::Update();
-  //{
-  //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsExtractor.vtk";
-  //  VISU::WriteToFile(myScalarsExtractor->GetUnstructuredGridOutput(), aFileName);
-  //}
-  //{
-  //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk";
-  //  VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
-  //}
-  //{
-  //  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsMergeFilter.vtk";
-  //  VISU::WriteToFile(myScalarsMergeFilter->GetUnstructuredGridOutput(), aFileName);
-  //}
-}
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU_ScalarMapOnDeformedShapePL
-::GetMemorySize()
-{
-  unsigned long int aSize = Superclass::GetMemorySize();
-
-  if(vtkDataSet* aDataSet = myWarpVector->GetOutput())
-    aSize += aDataSet->GetActualMemorySize() * 1024;
-  
-  if(vtkDataSet* aDataSet = myScalarsExtractor->GetOutput())
-    aSize += aDataSet->GetActualMemorySize() * 1024;
-
-  if(vtkDataSet* aDataSet = myScalarsMergeFilter->GetOutput())
-    aSize += aDataSet->GetActualMemorySize() * 1024;
-
-  if(myCellDataToPointData->GetInput())
-    if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
-      aSize += aDataSet->GetActualMemorySize() * 1024;
-
-  return aSize;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Update scalars method.
- * Put scalars to merge filter.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::UpdateScalars()
-{
-  vtkDataSet* aScalars = GetScalars();
-  myScalarsExtractor->SetInput(aScalars);
-
-  if(VISU::IsDataOnCells(aScalars))
-    GetMapper()->SetScalarModeToUseCellData();
-  else
-    GetMapper()->SetScalarModeToUsePointData();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Copy information about pipline.
- * Copy scale and scalars.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::DoShallowCopy(VISU_PipeLine *thePipeLine,
-               bool theIsCopyInput)
-{
-  Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
-
-  if(VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine)){
-     SetScale(aPipeLine->GetScale());
-     SetScalars(aPipeLine->GetScalars());
-  }
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Set scalars.
- * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScalars(vtkDataSet *theScalars)
-{
-  if(GetScalars() == theScalars)
-    return;
-
-  myScalars = theScalars;
-  UpdateScalars();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Get pointer to input scalars.
- */
-vtkDataSet* 
-VISU_ScalarMapOnDeformedShapePL
-::GetScalars()
-{
-  return myScalars.GetPointer();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Sets scale for deformed shape
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScale(vtkFloatingPointType theScale) 
-{
-  if(VISU::CheckIsSameValue(myScaleFactor, theScale))
-    return;
-
-  myWarpVector->SetScaleFactor(theScale*myMapScaleFactor);
-  myScaleFactor = theScale;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Gets scale of deformed shape.
- */
-vtkFloatingPointType
-VISU_ScalarMapOnDeformedShapePL
-::GetScale() 
-{
-  return myScaleFactor;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Set scale factor of deformation.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetMapScale(vtkFloatingPointType theMapScale)
-{
-  myMapScaleFactor = theMapScale;
-  Superclass::SetMapScale(theMapScale);
-
-  vtkFloatingPointType aMapScale = myScaleFactor * theMapScale;
-
-  if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), aMapScale))
-    return;
-
-  myWarpVector->SetScaleFactor(aMapScale);
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Gets scalar mode.
- */
-int
-VISU_ScalarMapOnDeformedShapePL
-::GetScalarMode()
-{
-  return myScalarsExtractor->GetScalarMode();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Sets scalar mode.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScalarMode(int theScalarMode)
-{
-  VISU_ScalarMapPL::SetScalarMode(theScalarMode, GetScalars(), myScalarsExtractor);
-}
-
-//----------------------------------------------------------------------------
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScaling(int theScaling) 
-{
-  if(GetScaling() == theScaling)
-    return;
-
-  GetBarTable()->SetScale(theScaling);
-
-  if(theScaling == VTK_SCALE_LOG10)
-    myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Log10));
-  else
-    myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Ident));
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetScalarRange(vtkFloatingPointType theRange[2])
-{
-  if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
-    return;
-
-  myScalarsFieldTransform->SetScalarRange(theRange);
-  GetBarTable()->SetRange(theRange);
-}
-
-
-//----------------------------------------------------------------------------
-vtkFloatingPointType* 
-VISU_ScalarMapOnDeformedShapePL
-::GetScalarRange() 
-{
-  return myScalarsFieldTransform->GetScalarRange();
-}
-
-
-//----------------------------------------------------------------------------
-/*!
- * Gets ranges of extracted scalars
- * \param theRange[2] - output values
- * \li theRange[0] - minimum value
- * \li theRange[1] - maximum value
- */
-void 
-VISU_ScalarMapOnDeformedShapePL
-::GetSourceRange(vtkFloatingPointType theRange[2])
-{
-  myScalarsExtractor->Update();
-  myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange);
-}
diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx
deleted file mode 100644 (file)
index ea73735..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-//  VISU OBJECT : interactive object for VISU entities implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File:    VISU_ScalarMapOnDeformedShapePL.hxx
-// Author:  Eugeny Nikolaev
-// Module : VISU
-
-#ifndef VISU_ScalarMapOnDeformedShapePL_HeaderFile
-#define VISU_ScalarMapOnDeformedShapePL_HeaderFile
-
-#include "VISUPipeline.hxx"
-#include "VISU_ScalarMapPL.hxx"
-
-class VISU_MergeFilter;
-class vtkWarpVector;
-class vtkUnstructuredGrid;
-class vtkCellDataToPointData;
-class vtkPointDataToCellData;
-
-
-//----------------------------------------------------------------------------
-class VISU_PIPELINE_EXPORT VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL
-{
-public:
-  vtkTypeMacro(VISU_ScalarMapOnDeformedShapePL, VISU_ScalarMapPL);
-
-  static 
-  VISU_ScalarMapOnDeformedShapePL* 
-  New();
-
-  virtual
-  void
-  SetScale(vtkFloatingPointType theScale);
-
-  virtual
-  vtkFloatingPointType
-  GetScale();
-
-  virtual
-  int
-  GetScalarMode();
-
-  virtual
-  void
-  SetScalarMode(int theScalarMode = 0);
-
-  virtual
-  void
-  SetScaling(int theScaling);
-  
-  virtual
-  void
-  SetScalarRange(vtkFloatingPointType theRange[2]);
-
-  virtual
-  vtkFloatingPointType* 
-  GetScalarRange();
-
-  virtual
-  void
-  GetSourceRange(vtkFloatingPointType theRange[2]);
-
-  virtual
-  void
-  SetScalars(vtkDataSet *theScalars);
-
-  virtual
-  vtkDataSet* 
-  GetScalars();
-
-public:
-  //! Redefined method for initialization of the pipeline.
-  virtual
-  void
-  Init();
-
-  //! Redefined method for building the pipeline.
-  virtual
-  void
-  Build();
-
-  //! Redefined method for updating the pipeline.
-  virtual
-  void
-  Update();
-
-  //! Gets memory size used by the instance (bytes).
-  virtual
-  unsigned long int
-  GetMemorySize();
-
-  //! Update scalars.
-  void
-  UpdateScalars();
-  
-  virtual
-  void
-  SetMapScale(vtkFloatingPointType theMapScale = 1.0);
-  
-protected:
-  VISU_ScalarMapOnDeformedShapePL();
-  
-  virtual
-  ~VISU_ScalarMapOnDeformedShapePL();
-  
-  virtual
-  vtkDataSet* 
-  InsertCustomPL();
-
-  virtual
-  void
-  DoShallowCopy(VISU_PipeLine *thePipeLine,
-               bool theIsCopyInput);
-
-private:
-  VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&);
-
-  vtkFloatingPointType myScaleFactor;
-  vtkFloatingPointType myMapScaleFactor;
-  vtkWarpVector  *myWarpVector;
-  VISU_MergeFilter *myScalarsMergeFilter;
-  vtkSmartPointer<vtkUnstructuredGrid> myScalars;
-  vtkCellDataToPointData* myCellDataToPointData;
-  VISU_FieldTransform* myScalarsFieldTransform;
-  VISU_Extractor* myScalarsExtractor;
-};
-
-#endif
index f5a0285699322d7a0c410d75a6d38aa994466558..ae11d80c8dc93cf878d9f098b06bdd6c869cb90b 100644 (file)
@@ -63,7 +63,7 @@ dist_libVISU_la_SOURCES= \
        VisuGUI_StreamLinesDlg.cxx \
        VisuGUI_VectorsDlg.cxx \
        VisuGUI_Displayer.cxx \
-       VisuGUI_ScalarMapOnDeformedShapeDlg.cxx \
+       VisuGUI_DeformedShapeAndScalarMapDlg.cxx \
        VisuGUI_SetupPlot2dDlg.cxx \
        VisuGUI_BuildProgressDlg.cxx \
        VisuGUI_Table3dDlg.cxx \
@@ -96,7 +96,7 @@ MOC_FILES= \
        VisuGUI_CutPlanesDlg_moc.cxx \
        VisuGUI_StreamLinesDlg_moc.cxx \
        VisuGUI_VectorsDlg_moc.cxx \
-       VisuGUI_ScalarMapOnDeformedShapeDlg_moc.cxx \
+       VisuGUI_DeformedShapeAndScalarMapDlg_moc.cxx \
        VisuGUI_SetupPlot2dDlg_moc.cxx \
        VisuGUI_BuildProgressDlg_moc.cxx \
        VisuGUI_Table3dDlg_moc.cxx \
index c676492b939ae7575b08c2af65416c543f7502b3..c5035745114b78c6710fba4b4998459b29ec659f 100644 (file)
@@ -28,7 +28,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: 2005-05-10 15:20+0400\n"
+"PO-Revision-Date: 2008-05-04 15:01+0400\n"
 "Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 
index fabcb006f7ad08e839354ebfc18edec788148a48..002b8c62c2b5224a7ee39b0cc870d980e3accc0e 100644 (file)
@@ -21,7 +21,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "POT-Creation-Date: 2002-02-22 16:56:46 CET\n"
-"PO-Revision-Date: 2007-12-11 17:26+0300\n"
+"PO-Revision-Date: 2008-05-04 10:12+0400\n"
 "Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 
@@ -281,8 +281,8 @@ msgstr "Scalar Map"
 msgid "VisuGUI::MEN_DEFORMED_SHAPE"
 msgstr "Deformed Shape"
 
-msgid "VisuGUI::MEN_SCALAR_MAP_ON_DEFORMED_SHAPE"
-msgstr "Scalar Map on Deformed Shape"
+msgid "VisuGUI::MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"
+msgstr "Deformed Shape and Scalar Map"
 
 msgid "VisuGUI::MEN_VISUALIZATION"
 msgstr "Visualization"
@@ -690,33 +690,33 @@ msgid "VisuGUI_DeformedShapeDlg::SCALE_FACTOR"
 msgstr "Scale Factor:"
 
 
-#: VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
+#: VisuGUI_DeformedShapeAndScalarMapDlg.cxx
 
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::DLG_TITLE"
-msgstr "Scalar Map on Deformed Shape"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::DLG_TITLE"
+msgstr "Deformed Shape and Scalar Map"
 
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::&Cancel"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::&Cancel"
 msgstr ""
 
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::&OK"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::&OK"
 msgstr ""
 
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"
-msgstr "Scalar Map on Deformed Shape"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::DEFORMED_SHAPE_AND_SCALAR_MAP_TAB"
+msgstr "Deformed Shape and Scalar Map"
                                             
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALAR_BAR_TAB"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::SCALAR_BAR_TAB"
 msgstr "Scalar Bar"
 
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::INPUT_TAB"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::INPUT_TAB"
 msgstr "Input"
 
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::SCALE_FACTOR"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::SCALE_FACTOR"
 msgstr "Scale Factor:"
 
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::FIELD_ITEM"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::FIELD_ITEM"
 msgstr "Scalar Field:"
 
-msgid "VisuGUI_ScalarMapOnDeformedShapeDlg::TIMESTAMP_ITEM"
+msgid "VisuGUI_DeformedShapeAndScalarMapDlg::TIMESTAMP_ITEM"
 msgstr "Current Time Stamp:"
 
 #: VisuGUI_EditContainerDlg.cxx
@@ -2444,8 +2444,8 @@ msgstr "Stream Lines"
 msgid "VISU_PLOT3D"
 msgstr "Plot3D"
 
-msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE"
-msgstr "Scalar Map on Def. Shape"
+msgid "VISU_DEFORMED_SHAPE_AND_SCALAR_MAP"
+msgstr "Def. Shape and Scalar Map"
 
 # MULTIPR
 msgid "VisuGUI::MEN_MULTIPR_VIEW_FULL_RES"
index 66ba70cfc88772c03067750213bf60849d2a0369..cad01670b51cbcef3233b4ebc32495d3a5b3a081 100644 (file)
 #include "VISU_DeformedShape_i.hh"
 #include "VisuGUI_DeformedShapeDlg.h"
 
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
-#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
+#include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
 
 #include "VISU_IsoSurfaces_i.hh"
 #include "VisuGUI_IsoSurfacesDlg.h"
@@ -671,9 +671,9 @@ VisuGUI
 
 void
 VisuGUI
-::OnCreateScalarMapOnDeformedShape()
+::OnCreateDeformedShapeAndScalarMap()
 {
-  CreatePrs3d<VISU::ScalarMapOnDeformedShape_i,VisuGUI_ScalarMapOnDeformedShapeDlg,1>(this);
+  CreatePrs3d<VISU::DeformedShapeAndScalarMap_i,VisuGUI_DeformedShapeAndScalarMapDlg,1>(this);
 }
 
 void
@@ -879,11 +879,11 @@ VisuGUI
 //----------------------------------------------------------------------------
 void
 VisuGUI
-::OnEditScalarMapOnDeformedShape()
+::OnEditDeformedShapeAndScalarMap()
 {
   Handle(SALOME_InteractiveObject) anIO;
   if (VISU::Prs3d_i* aPrs3d = GetPrsToModify(this, anIO))
-    EditPrs3d<VISU::ScalarMapOnDeformedShape_i, VisuGUI_ScalarMapOnDeformedShapeDlg, 1>(this, anIO, aPrs3d);
+    EditPrs3d<VISU::DeformedShapeAndScalarMap_i, VisuGUI_DeformedShapeAndScalarMapDlg, 1>(this, anIO, aPrs3d);
 }
 
 //----------------------------------------------------------------------------
@@ -1917,7 +1917,8 @@ VisuGUI
       TSameAsFactory<VISU::TDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TSCALARMAPONDEFORMEDSHAPE:
-      TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
+    case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+      TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
       break;
     case VISU::TCUTPLANES:
       TSameAsFactory<VISU::TCUTPLANES>().Create(aColoredPrs3d, ColoredPrs3d_i::EPublishUnderTimeStamp, false);
@@ -2120,9 +2121,9 @@ VisuGUI
                 this, SLOT(OnCreateDeformedShape()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP_ON_DEFORMED_SHAPE"));
-  createAction( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE, tr("MEN_SCALAR_MAP_ON_DEFORMED_SHAPE"), QIconSet(aPixmap),
-                tr("MEN_SCALAR_MAP_ON_DEFORMED_SHAPE"), "", 0, aParent, false,
-                this, SLOT(OnCreateScalarMapOnDeformedShape()));
+  createAction( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), QIconSet(aPixmap),
+                tr("MEN_DEFORMED_SHAPE_AND_SCALAR_MAP"), "", 0, aParent, false,
+                this, SLOT(OnCreateDeformedShapeAndScalarMap()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
   createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap),
@@ -2358,9 +2359,9 @@ VisuGUI
                 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
                 this, SLOT(OnEditPlot3D()));
 
-  createAction( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIconSet(),
+  createAction( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP, tr("MEN_EDIT_PRS"), QIconSet(),
                 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
-                this, SLOT(OnEditScalarMapOnDeformedShape()));
+                this, SLOT(OnEditDeformedShapeAndScalarMap()));
 
 
   createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(),
@@ -2461,7 +2462,7 @@ VisuGUI
   createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
   createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
   createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
-  createMenu( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE, aMenuId, 10 ); // scalar map on deformed shape
+  createMenu( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aMenuId, 10 ); // scalar map on deformed shape
 
   aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
   createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
@@ -2493,7 +2494,7 @@ VisuGUI
   createTool( VISU_CUT_LINES, aToolId );
   createTool( VISU_STREAM_LINES, aToolId );
   createTool( VISU_PLOT_3D, aToolId );
-  createTool( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE, aToolId );
+  createTool( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aToolId );
 
   aToolId = createTool(tr("TOOL_REPRESENTATION"));
   createTool( VISU_POINTS, aToolId );
@@ -2527,7 +2528,7 @@ VisuGUI
   mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
   mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
   mgr->insert( action( VISU_PLOT_3D ), -1, -1, -1 ); // Plot3d
-  mgr->insert( action( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE ), -1, -1, -1 ); // scalar map on deformed shape
+  mgr->insert( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), -1, -1, -1 ); // scalar map on deformed shape
 
   mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
   mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
@@ -2543,7 +2544,7 @@ VisuGUI
   mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
   mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
   mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
-  mgr->insert( action( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ), -1, -1, -1 );
   mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
   mgr->insert( action( VISU_EDIT_POINTMAP3D ), -1, -1, -1 );
 
@@ -2624,7 +2625,7 @@ VisuGUI
 
   QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
                    "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
-                  "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TCOLOREDPRS3DHOLDER'");
+                  "'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
 
   // VISU root commands
   QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
@@ -2643,7 +2644,7 @@ VisuGUI
   mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule, true );
   mgr->setRule( action( VISU_VECTORS ), aRule, true );
   mgr->setRule( action( VISU_STREAM_LINES ), aRule, true );
-  mgr->setRule( action( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE ), aRule, true );
+  mgr->setRule( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), aRule, true );
 
   // display/erase commands
   QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
@@ -2687,13 +2688,13 @@ VisuGUI
   // 3D presentations commands
   QString aPrsType    = " and $type in {'VISU::TMESH'" + aPrsAll + "}";
   QString aPrsType2    = " and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}";
-  QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
-  QString aSurfFrameType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
+  QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
+  QString aSurfFrameType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
   QString aSurfType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
-                        " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
-  QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
+                        " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
+  QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
   QString aLineType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
-                        "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TPOINTMAP3D'}";
+                        "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
 
   aRule = "selcount=1";
   mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType, true );
@@ -2755,8 +2756,8 @@ VisuGUI
                "selcount=1 and type='VISU::TSCALARMAP'", true );
   mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
                "selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
-  mgr->setRule( action( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE ),
-               "selcount=1 and type='VISU::TSCALARMAPONDEFORMEDSHAPE'", true );
+  mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ),
+               "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}", true );
   mgr->setRule( action( VISU_EDIT_CUTPLANES ),
                "selcount=1 and type='VISU::TCUTPLANES'", true );
   mgr->setRule( action( VISU_EDIT_CUTLINES ),
@@ -3442,7 +3443,7 @@ void VisuGUI::createPreferences()
   setPreferenceProperty( plot3d_represent, "indexes", indices2 );
   addPreference( "", representGr, LightApp_Preferences::Space );
 
-  int scalar_def_represent = addPreference( tr( "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
+  int scalar_def_represent = addPreference( tr( "VISU_DEFORMED_SHAPE_AND_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" );
   setPreferenceProperty( scalar_def_represent, "strings", modes1 );
   setPreferenceProperty( scalar_def_represent, "indexes", indices1 );
   addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" );
index 2d6370b665e648982a0fea9db553a060b7713157..5d19813c805b8ee9d52398d1d9a8a5154b12789f 100644 (file)
@@ -104,7 +104,7 @@ protected slots:
   void OnCreatePlot3D();
   void OnCreateManyMesh();
   void OnCreatePlot2dView();
-  void OnCreateScalarMapOnDeformedShape();
+  void OnCreateDeformedShapeAndScalarMap();
 
   void OnEditScalarMap();
   void OnEditDeformedShape();
@@ -114,7 +114,7 @@ protected slots:
   void OnEditVectors();
   void OnEditStreamLines();
   void OnEditPlot3D();
-  void OnEditScalarMapOnDeformedShape();
+  void OnEditDeformedShapeAndScalarMap();
 
   virtual void OnDisplayPrs();
   virtual void OnDisplayOnlyPrs();
index f1115b74ab1ad9a949e2115759ddfebc203454bb..3e0b4bc44fbc3306158b73cd68618989a151c03a 100644 (file)
@@ -39,7 +39,7 @@
 #define VISU_CUT_LINES              4017
 #define VISU_PLOT2D                 4018
 #define VISU_PLOT_3D                4019
-#define VISU_SCALAR_MAP_ON_DEFORMED_SHAPE 40110
+#define VISU_DEFORMED_SHAPE_AND_SCALAR_MAP 40110
 
 //#define VISU_DELETE                 4021
 #define VISU_DELETE_OBJS            4022
@@ -92,7 +92,7 @@
 #define VISU_EDIT_VECTORS           40625
 #define VISU_EDIT_STREAMLINES       40626
 #define VISU_EDIT_PLOT3D            40627
-#define VISU_EDIT_SCALARMAPONDEFORMEDSHAPE     40628
+#define VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP     40628
 
 #define VISU_EDIT_PRS               4062
 #define VISU_CREATE_TABLE           4063
diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx
new file mode 100644 (file)
index 0000000..7fc9b20
--- /dev/null
@@ -0,0 +1,458 @@
+//  VISU VISUGUI : GUI of VISU component
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   : VisuGUI_DeformedShapeAndScalarMapDlg.cxx
+//  Author : Eugeny Nikolaev
+//  Module : VISU
+
+#include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
+
+#include "VisuGUI_Tools.h"
+#include "VisuGUI_InputPane.h"
+
+#include "VISU_Result_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
+
+#include "VISU_ScalarMapPL.hxx"
+#include "VISU_DeformedShapeAndScalarMapPL.hxx"
+
+#include "VISU_Convertor.hxx"
+
+#include "SalomeApp_Module.h"
+#include "LightApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SALOME_ListIO.hxx"
+
+#include "SALOMEDSClient_AttributeString.hxx"
+#include "SALOMEDSClient_AttributeName.hxx"
+
+#include <qlayout.h>
+#include <qtabwidget.h>
+
+using namespace std;
+
+#define MYDEBUG 0
+
+/*!
+ * Constructor
+ */
+VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule)
+  : VisuGUI_ScalarBarBaseDlg(theModule),
+    myIsAnimation(false),
+    myUpdateScalars(true),
+    myVisuGUI(theModule)
+{
+  setCaption(tr("DLG_TITLE"));
+  setSizeGripEnabled(TRUE);
+
+  QVBoxLayout* TopLayout = new QVBoxLayout (this);
+  TopLayout->setSpacing(6);
+  TopLayout->setMargin(11);
+
+  myTabBox = new QTabWidget (this);
+
+  // Scalar Map on Deformed shape pane
+  QVBox* aBox = new QVBox (this);
+  aBox->setMargin(11);
+  QFrame* TopGroup = new QFrame (aBox, "TopGroup");
+  TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken);
+  TopGroup->setLineWidth(1);
+  QGridLayout* TopGroupLayout = new QGridLayout (TopGroup);
+  TopGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+  TopGroupLayout->setSpacing(6);
+  TopGroupLayout->setMargin(11);
+
+  //   Scale factor
+  QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup, "ScaleLabel");
+  TopGroupLayout->addWidget(ScaleLabel, 0, 0);
+
+  ScalFact = new QtxDblSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
+  ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+  ScalFact->setPrecision(38);
+  ScalFact->setValue(0.1);
+  TopGroupLayout->addWidget(ScalFact, 0, 1);
+
+  // Fields combo box
+  QLabel* FieldLabel = new QLabel (tr("FIELD_ITEM"), TopGroup, "FieldLabel");
+  myFieldsCombo = new QComboBox (TopGroup,"Fields");
+
+  TopGroupLayout->addWidget(FieldLabel, 1, 0);
+  TopGroupLayout->addWidget(myFieldsCombo,1,1);
+
+  // TimeStamps combo box
+  QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel");
+  myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp");
+
+  TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
+  TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
+
+  //
+  myTabBox->addTab(aBox, tr("DEFORMED_SHAPE_AND_SCALAR_MAP_TAB"));
+
+  // Scalar bar pane
+  myInputPane = new VisuGUI_InputPane(VISU::TDEFORMEDSHAPEANDSCALARMAP, theModule, this);
+
+  myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
+  myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
+
+  // Buttons
+  QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons");
+  GroupButtons->setGeometry(QRect(10, 10, 281, 48));
+  GroupButtons->setColumnLayout(0, Qt::Vertical);
+  GroupButtons->layout()->setSpacing(0);
+  GroupButtons->layout()->setMargin(0);
+  QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
+  GroupButtonsLayout->setAlignment(Qt::AlignTop);
+  GroupButtonsLayout->setSpacing(6);
+  GroupButtonsLayout->setMargin(11);
+
+  QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons, "buttonOk");
+  buttonOk->setAutoDefault(TRUE);
+  buttonOk->setDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonOk, 0, 0);
+
+  GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding,
+                                               QSizePolicy::Minimum), 0, 1);
+
+  QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel");
+  buttonCancel->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+
+  QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+  buttonHelp->setAutoDefault(TRUE);
+  GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
+  // Add Tab box and Buttons to the top layout
+  TopLayout->addWidget(myTabBox);
+  TopLayout->addWidget(GroupButtons);
+
+  // signals and slots connections
+  connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
+  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
+  connect(myFieldsCombo,     SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
+  connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
+}
+
+VisuGUI_DeformedShapeAndScalarMapDlg::~VisuGUI_DeformedShapeAndScalarMapDlg()
+{}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+                                                            bool theInit )
+{
+  if( theInit )
+    myPrsCopy = VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
+  setFactor(myPrsCopy->GetScale());
+  myTimeStampsCombo->setDisabled(myIsAnimation);
+
+  CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
+  QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
+                                               aFieldName.in(),
+                                               myPrsCopy->GetScalarTimeStampNumber());
+  if (myEntity2Fields.size() == 0)
+  {
+    // find all fields and time stamps on it
+    _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
+    LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
+    SALOME_ListIO selected;
+    aSel->selectedObjects(selected);
+    if (selected.Extent() > 0) {
+      Handle(SALOME_InteractiveObject) aIO = selected.First();
+      if (aIO->hasEntry()) {
+       _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+       VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
+       switch(aType){
+       case VISU::TTIMESTAMP: {
+         aSObject = aSObject->GetFather();
+         aSObject = aSObject->GetFather();
+         break;
+       }
+       case VISU::TFIELD: {
+         _PTR(SObject) newSObject;
+         if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+         aSObject = aSObject->GetFather();
+         break;
+       }
+       case VISU::TANIMATION: {
+         _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+         for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+           _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+           _PTR(SObject) newSObject;
+           if(aTmpChildSObj->ReferencedObject(newSObject)){
+             aSObject = newSObject;
+             aSObject->GetFather();
+             break;
+           }
+         }
+         break;
+       }}
+       
+       aSObject = aSObject->GetFather();
+       aSObject = aSObject->GetFather();
+
+       mySelectionObj = aSObject;
+       CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
+       if (CORBA::is_nil(anObject)) {
+         mySelectionObj = mySelectionObj->GetFather();
+       }
+      }
+    }
+
+    if (mySelectionObj) {
+      _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+      for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+        _PTR(SObject) aChildSObj = aIter->Value();
+       VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
+        if (!aRestoringMap.empty()) {
+         VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
+         if (aType == VISU::TTIMESTAMP) {
+           QString aMeshName = aRestoringMap["myMeshName"];
+           CORBA::String_var aName = myPrsCopy->GetMeshName();
+           if (aMeshName != aName.in())
+             continue;
+           QString aFieldName = aRestoringMap["myFieldName"];
+           QString aTimeIter  = aRestoringMap["myTimeStampId"];
+           QString aEntity    = aRestoringMap["myEntityId"];
+           VISU::Entity anEntity;
+           switch (aEntity.toInt()) {
+           case 0: anEntity = VISU::NODE; break;
+           case 1: anEntity = VISU::EDGE; break;
+           case 2: anEntity = VISU::FACE; break;
+           case 3: anEntity = VISU::CELL; break;
+           }
+           TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
+           TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
+           aTimeStampNumber2Time[aTimeIter.toInt()] = 
+             GetFloatValueOfTimeStamp(anEntity,
+                                      aFieldName.latin1(),
+                                      aTimeIter.toInt());
+         }
+        }
+      }
+    }
+    AddAllFieldNames();
+  }
+  myFieldsCombo->setCurrentText(aFieldName.in());
+  AddAllTimes(myFieldsCombo->currentText());
+  myTimeStampsCombo->setCurrentText(aIteration);
+  SetScalarField( false );
+
+  VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
+  if( !theInit )
+    return;
+
+  myInputPane->initFromPrsObject( myPrsCopy );
+  myTabBox->setCurrentPage( 0 );
+}
+
+int
+VisuGUI_DeformedShapeAndScalarMapDlg
+::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
+{
+  if(!myInputPane->check() || !GetScalarPane()->check())
+    return 0;
+  
+  int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
+  anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
+  
+  myPrsCopy->SetScale(getFactor());
+
+  myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
+                           getCurrentScalarFieldName().latin1(),
+                           myTimeStampID[ myTimeStampsCombo->currentItem() ]);
+
+  if(myUpdateScalars) 
+    SetScalarField( false );
+
+  VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Copy(myPrsCopy, thePrs);
+
+  return anIsOk;
+}
+
+int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldNamePos(){
+  return myFieldsCombo->currentItem();
+}
+
+QString VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldName(){
+  return myFieldsCombo->currentText();
+}
+
+int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarNbIterations(){
+  return myTimeStampsCombo->count();
+}
+
+VISU::Entity
+VisuGUI_DeformedShapeAndScalarMapDlg
+::getCurrentScalarEntity()
+{
+  VISU::Entity anEntity = VISU::Entity(-1);
+  TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+  for(; anIter != myEntity2Fields.end(); anIter++){
+    const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+    TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+    for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+      const QString& aFieldName = aFieldIter->first;
+      if (aFieldName == myFieldsCombo->currentText()) {
+       anEntity = anIter->first;
+       break;
+      }
+    }
+  }
+  return anEntity;
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::SetScalarField( const bool save_scalar_pane ){
+  SetScalarField( myTimeStampID[ myTimeStampsCombo->currentItem() ], "", save_scalar_pane );
+}
+
+void
+VisuGUI_DeformedShapeAndScalarMapDlg
+::SetScalarField(int theIter,
+                QString theFieldName, 
+                const bool save_scalar_pane )
+{
+  QApplication::setOverrideCursor(Qt::waitCursor);
+
+  if( save_scalar_pane )
+    GetScalarPane()->storeToPrsObject(myPrsCopy);
+
+  QString aFieldName;
+
+  if(theFieldName.isEmpty())
+    aFieldName = myFieldsCombo->currentText();
+  else
+    aFieldName = theFieldName;
+
+  VISU::Entity anEntity = getCurrentScalarEntity();
+  
+  myPrsCopy->SetScalarField(anEntity,
+                           aFieldName.latin1(),
+                           theIter);
+  
+  if( save_scalar_pane )
+    UpdateScalarField();
+
+  QApplication::restoreOverrideCursor();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::accept()
+{
+  VisuGUI_ScalarBarBaseDlg::accept();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::reject()
+{
+  VisuGUI_ScalarBarBaseDlg::reject();
+}
+
+QString VisuGUI_DeformedShapeAndScalarMapDlg::GetContextHelpFilePath()
+{
+  return "scalar_map_on_deformed_shape_page.html";
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllFieldNames(){
+  TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+  for(; anIter != myEntity2Fields.end(); anIter++){
+    const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+    TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+    for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+      const QString& aFieldName = aFieldIter->first;
+      myFieldsCombo->insertItem(aFieldName);
+    }
+  }
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllTimes(const QString& theFieldName){
+  TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+  for(; anIter != myEntity2Fields.end(); anIter++){
+    const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+    TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+    for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+      const QString& aFieldName = aFieldIter->first;
+      if(theFieldName != aFieldName) 
+       continue;
+
+      myTimeStampID.clear();
+      myTimeStampsCombo->clear();
+
+      const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
+      TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
+      for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
+       int aTimeStampNumber = aTimeStampIter->first;
+       myTimeStampID.push_back(aTimeStampNumber);
+
+       QString aTimeStampTime = aTimeStampIter->second;
+       myTimeStampsCombo->insertItem(aTimeStampTime);
+      }
+      return;
+    }
+  }
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::onFieldChanged(int){
+  AddAllTimes(myFieldsCombo->currentText());
+  SetScalarField();
+  UpdateScalarField();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::onTimeStampChanged(int){
+  SetScalarField();
+  UpdateScalarField();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::UpdateScalarField(){
+  GetScalarPane()->initFromPrsObject(myPrsCopy);
+}
+
+QString 
+VisuGUI_DeformedShapeAndScalarMapDlg
+::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
+                          const std::string& theFieldName,
+                          int theTimeStampNumber)
+{
+  QString aTime("");
+  VISU::TEntity anEntity = VISU::TEntity(theEntity);
+  VISU::Result_i* theResult = myPrsCopy->GetCResult();
+  VISU::Result_i::PInput anInput = theResult->GetInput();
+  VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
+                                         anEntity,
+                                         theFieldName);
+  if(!aField) 
+    return aTime;
+
+  VISU::TValField& aValField = aField->myValField;
+  VISU::TValField::const_iterator aIter = aValField.find(theTimeStampNumber);
+  if(aIter != aValField.end()){
+    VISU::PValForTime aValForTime = aIter->second;
+    aTime = VISU_Convertor::GenerateName(aValForTime->myTime).c_str();
+  }
+  return aTime;
+}
diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h
new file mode 100644 (file)
index 0000000..c0dcdb9
--- /dev/null
@@ -0,0 +1,123 @@
+//  VISU VISUGUI : GUI of VISU component
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   : VisuGUI_DeformedShapeAndScalarMapDlg.h
+//  Author : Eugeny Nikolaev
+//  Module : VISU
+
+#ifndef VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
+#define VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
+
+#include "VisuGUI_Prs3dDlg.h"
+
+#include "VISUConfig.hh"
+
+#include "QtxDblSpinBox.h"
+
+#include <qdialog.h>
+#include <qgroupbox.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qtabwidget.h>
+
+#include <set>
+#include <vector>
+
+class SalomeApp_Module;
+class VisuGUI_InputPane;
+
+namespace VISU
+{
+  class DeformedShapeAndScalarMap_i;
+}
+
+class VisuGUI_DeformedShapeAndScalarMapDlg : public VisuGUI_ScalarBarBaseDlg
+{
+    Q_OBJECT
+
+public:
+    VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule);
+    ~VisuGUI_DeformedShapeAndScalarMapDlg();
+
+    double getFactor()
+      { return ScalFact->value(); }
+    void setFactor(double theFactor)
+      { ScalFact->setValue(theFactor); }
+    
+    virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+                                   bool theInit );
+
+    virtual int  storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
+
+    int getCurrentScalarFieldNamePos();
+    QString getCurrentScalarFieldName();
+    int getCurrentScalarNbIterations();
+    VISU::Entity getCurrentScalarEntity();
+    void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
+
+protected:
+  virtual QString GetContextHelpFilePath();
+
+protected slots:
+  void accept();
+  void reject();
+
+private slots:
+  void onFieldChanged(int i=0);
+  void onTimeStampChanged(int i=0);
+
+private:
+ QtxDblSpinBox* ScalFact;
+ QTabWidget* myTabBox;
+ VisuGUI_ScalarBarPane* myScalarPane;
+ VisuGUI_InputPane*     myInputPane;
+ QComboBox *myFieldsCombo;
+ QComboBox *myTimeStampsCombo;
+ typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
+ typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
+ typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
+ TEntity2Fields myEntity2Fields;
+ int myCurrScalarIter;
+ bool myIsAnimation;
+ bool myUpdateScalars;
+ std::vector<int> myTimeStampID;
+ _PTR(SObject) mySelectionObj;
+ SALOME::GenericObjPtr<VISU::DeformedShapeAndScalarMap_i> myPrsCopy;
+ SalomeApp_Module* myVisuGUI;
+protected:
+ void UpdateScalarField();
+ void SetScalarField( const bool = true );
+ void AddAllFieldNames();
+ void AddAllTimes(const QString& theFieldName);
+ QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
+                                 const std::string& theFieldName,
+                                 int theTimeStampNumber);
+};
+
+#endif // VISUGUI_DEFORMEDSHAPEDLS_H
index e20cf7c60e692e141d6c221b80657b6da44a5bcc..02af7e9881754136b73718508c1b5be48c87ed56 100644 (file)
@@ -112,6 +112,7 @@ QString VisuGUI_Selection::type( const int ind ) const
       ENUM2STRING( aResStr, VISU::TISOSURFACES );
       ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE );
       ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE );
+      ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPEANDSCALARMAP );
       ENUM2STRING( aResStr, VISU::TCUTPLANES );
       ENUM2STRING( aResStr, VISU::TCUTLINES );
       ENUM2STRING( aResStr, VISU::TVECTORS );
diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
deleted file mode 100644 (file)
index 98dcd68..0000000
+++ /dev/null
@@ -1,458 +0,0 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
-//  Author : Eugeny Nikolaev
-//  Module : VISU
-
-#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
-
-#include "VisuGUI_Tools.h"
-#include "VisuGUI_InputPane.h"
-
-#include "VISU_Result_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
-#include "VISU_ColoredPrs3dFactory.hh"
-
-#include "VISU_ScalarMapPL.hxx"
-#include "VISU_ScalarMapOnDeformedShapePL.hxx"
-
-#include "VISU_Convertor.hxx"
-
-#include "SalomeApp_Module.h"
-#include "LightApp_Application.h"
-#include "LightApp_SelectionMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-
-#include "SALOME_ListIO.hxx"
-
-#include "SALOMEDSClient_AttributeString.hxx"
-#include "SALOMEDSClient_AttributeName.hxx"
-
-#include <qlayout.h>
-#include <qtabwidget.h>
-
-using namespace std;
-
-#define MYDEBUG 0
-
-/*!
- * Constructor
- */
-VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule)
-  : VisuGUI_ScalarBarBaseDlg(theModule),
-    myIsAnimation(false),
-    myUpdateScalars(true),
-    myVisuGUI(theModule)
-{
-  setCaption(tr("DLG_TITLE"));
-  setSizeGripEnabled(TRUE);
-
-  QVBoxLayout* TopLayout = new QVBoxLayout (this);
-  TopLayout->setSpacing(6);
-  TopLayout->setMargin(11);
-
-  myTabBox = new QTabWidget (this);
-
-  // Scalar Map on Deformed shape pane
-  QVBox* aBox = new QVBox (this);
-  aBox->setMargin(11);
-  QFrame* TopGroup = new QFrame (aBox, "TopGroup");
-  TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken);
-  TopGroup->setLineWidth(1);
-  QGridLayout* TopGroupLayout = new QGridLayout (TopGroup);
-  TopGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
-  TopGroupLayout->setSpacing(6);
-  TopGroupLayout->setMargin(11);
-
-  //   Scale factor
-  QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup, "ScaleLabel");
-  TopGroupLayout->addWidget(ScaleLabel, 0, 0);
-
-  ScalFact = new QtxDblSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
-  ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  ScalFact->setPrecision(38);
-  ScalFact->setValue(0.1);
-  TopGroupLayout->addWidget(ScalFact, 0, 1);
-
-  // Fields combo box
-  QLabel* FieldLabel = new QLabel (tr("FIELD_ITEM"), TopGroup, "FieldLabel");
-  myFieldsCombo = new QComboBox (TopGroup,"Fields");
-
-  TopGroupLayout->addWidget(FieldLabel, 1, 0);
-  TopGroupLayout->addWidget(myFieldsCombo,1,1);
-
-  // TimeStamps combo box
-  QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel");
-  myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp");
-
-  TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
-  TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
-
-  //
-  myTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"));
-
-  // Scalar bar pane
-  myInputPane = new VisuGUI_InputPane(VISU::TSCALARMAPONDEFORMEDSHAPE, theModule, this);
-
-  myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
-  myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
-
-  // Buttons
-  QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons");
-  GroupButtons->setGeometry(QRect(10, 10, 281, 48));
-  GroupButtons->setColumnLayout(0, Qt::Vertical);
-  GroupButtons->layout()->setSpacing(0);
-  GroupButtons->layout()->setMargin(0);
-  QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
-  GroupButtonsLayout->setAlignment(Qt::AlignTop);
-  GroupButtonsLayout->setSpacing(6);
-  GroupButtonsLayout->setMargin(11);
-
-  QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons, "buttonOk");
-  buttonOk->setAutoDefault(TRUE);
-  buttonOk->setDefault(TRUE);
-  GroupButtonsLayout->addWidget(buttonOk, 0, 0);
-
-  GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding,
-                                               QSizePolicy::Minimum), 0, 1);
-
-  QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel");
-  buttonCancel->setAutoDefault(TRUE);
-  GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
-
-  QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
-  buttonHelp->setAutoDefault(TRUE);
-  GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
-
-  // Add Tab box and Buttons to the top layout
-  TopLayout->addWidget(myTabBox);
-  TopLayout->addWidget(GroupButtons);
-
-  // signals and slots connections
-  connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
-  connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
-  connect(myFieldsCombo,     SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
-  connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
-}
-
-VisuGUI_ScalarMapOnDeformedShapeDlg::~VisuGUI_ScalarMapOnDeformedShapeDlg()
-{}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
-                                                            bool theInit )
-{
-  if( theInit )
-    myPrsCopy = VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
-  setFactor(myPrsCopy->GetScale());
-  myTimeStampsCombo->setDisabled(myIsAnimation);
-
-  CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
-  QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
-                                               aFieldName.in(),
-                                               myPrsCopy->GetScalarTimeStampNumber());
-  if (myEntity2Fields.size() == 0)
-  {
-    // find all fields and time stamps on it
-    _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
-    LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
-    SALOME_ListIO selected;
-    aSel->selectedObjects(selected);
-    if (selected.Extent() > 0) {
-      Handle(SALOME_InteractiveObject) aIO = selected.First();
-      if (aIO->hasEntry()) {
-       _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
-       VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
-       switch(aType){
-       case VISU::TTIMESTAMP: {
-         aSObject = aSObject->GetFather();
-         aSObject = aSObject->GetFather();
-         break;
-       }
-       case VISU::TFIELD: {
-         _PTR(SObject) newSObject;
-         if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
-         aSObject = aSObject->GetFather();
-         break;
-       }
-       case VISU::TANIMATION: {
-         _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
-         for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
-           _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
-           _PTR(SObject) newSObject;
-           if(aTmpChildSObj->ReferencedObject(newSObject)){
-             aSObject = newSObject;
-             aSObject->GetFather();
-             break;
-           }
-         }
-         break;
-       }}
-       
-       aSObject = aSObject->GetFather();
-       aSObject = aSObject->GetFather();
-
-       mySelectionObj = aSObject;
-       CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
-       if (CORBA::is_nil(anObject)) {
-         mySelectionObj = mySelectionObj->GetFather();
-       }
-      }
-    }
-
-    if (mySelectionObj) {
-      _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
-      for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
-        _PTR(SObject) aChildSObj = aIter->Value();
-       VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
-        if (!aRestoringMap.empty()) {
-         VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
-         if (aType == VISU::TTIMESTAMP) {
-           QString aMeshName = aRestoringMap["myMeshName"];
-           CORBA::String_var aName = myPrsCopy->GetMeshName();
-           if (aMeshName != aName.in())
-             continue;
-           QString aFieldName = aRestoringMap["myFieldName"];
-           QString aTimeIter  = aRestoringMap["myTimeStampId"];
-           QString aEntity    = aRestoringMap["myEntityId"];
-           VISU::Entity anEntity;
-           switch (aEntity.toInt()) {
-           case 0: anEntity = VISU::NODE; break;
-           case 1: anEntity = VISU::EDGE; break;
-           case 2: anEntity = VISU::FACE; break;
-           case 3: anEntity = VISU::CELL; break;
-           }
-           TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
-           TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
-           aTimeStampNumber2Time[aTimeIter.toInt()] = 
-             GetFloatValueOfTimeStamp(anEntity,
-                                      aFieldName.latin1(),
-                                      aTimeIter.toInt());
-         }
-        }
-      }
-    }
-    AddAllFieldNames();
-  }
-  myFieldsCombo->setCurrentText(aFieldName.in());
-  AddAllTimes(myFieldsCombo->currentText());
-  myTimeStampsCombo->setCurrentText(aIteration);
-  SetScalarField( false );
-
-  VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
-
-  if( !theInit )
-    return;
-
-  myInputPane->initFromPrsObject( myPrsCopy );
-  myTabBox->setCurrentPage( 0 );
-}
-
-int
-VisuGUI_ScalarMapOnDeformedShapeDlg
-::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
-{
-  if(!myInputPane->check() || !GetScalarPane()->check())
-    return 0;
-  
-  int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
-  anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
-  
-  myPrsCopy->SetScale(getFactor());
-
-  myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
-                           getCurrentScalarFieldName().latin1(),
-                           myTimeStampID[ myTimeStampsCombo->currentItem() ]);
-
-  if(myUpdateScalars) 
-    SetScalarField( false );
-
-  VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Copy(myPrsCopy, thePrs);
-
-  return anIsOk;
-}
-
-int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldNamePos(){
-  return myFieldsCombo->currentItem();
-}
-
-QString VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldName(){
-  return myFieldsCombo->currentText();
-}
-
-int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarNbIterations(){
-  return myTimeStampsCombo->count();
-}
-
-VISU::Entity
-VisuGUI_ScalarMapOnDeformedShapeDlg
-::getCurrentScalarEntity()
-{
-  VISU::Entity anEntity = VISU::Entity(-1);
-  TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
-  for(; anIter != myEntity2Fields.end(); anIter++){
-    const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
-    TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
-    for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
-      const QString& aFieldName = aFieldIter->first;
-      if (aFieldName == myFieldsCombo->currentText()) {
-       anEntity = anIter->first;
-       break;
-      }
-    }
-  }
-  return anEntity;
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField( const bool save_scalar_pane ){
-  SetScalarField( myTimeStampID[ myTimeStampsCombo->currentItem() ], "", save_scalar_pane );
-}
-
-void
-VisuGUI_ScalarMapOnDeformedShapeDlg
-::SetScalarField(int theIter,
-                QString theFieldName, 
-                const bool save_scalar_pane )
-{
-  QApplication::setOverrideCursor(Qt::waitCursor);
-
-  if( save_scalar_pane )
-    GetScalarPane()->storeToPrsObject(myPrsCopy);
-
-  QString aFieldName;
-
-  if(theFieldName.isEmpty())
-    aFieldName = myFieldsCombo->currentText();
-  else
-    aFieldName = theFieldName;
-
-  VISU::Entity anEntity = getCurrentScalarEntity();
-  
-  myPrsCopy->SetScalarField(anEntity,
-                           aFieldName.latin1(),
-                           theIter);
-  
-  if( save_scalar_pane )
-    UpdateScalarField();
-
-  QApplication::restoreOverrideCursor();
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::accept()
-{
-  VisuGUI_ScalarBarBaseDlg::accept();
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::reject()
-{
-  VisuGUI_ScalarBarBaseDlg::reject();
-}
-
-QString VisuGUI_ScalarMapOnDeformedShapeDlg::GetContextHelpFilePath()
-{
-  return "scalar_map_on_deformed_shape_page.html";
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){
-  TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
-  for(; anIter != myEntity2Fields.end(); anIter++){
-    const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
-    TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
-    for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
-      const QString& aFieldName = aFieldIter->first;
-      myFieldsCombo->insertItem(aFieldName);
-    }
-  }
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllTimes(const QString& theFieldName){
-  TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
-  for(; anIter != myEntity2Fields.end(); anIter++){
-    const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
-    TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
-    for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
-      const QString& aFieldName = aFieldIter->first;
-      if(theFieldName != aFieldName) 
-       continue;
-
-      myTimeStampID.clear();
-      myTimeStampsCombo->clear();
-
-      const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
-      TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
-      for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
-       int aTimeStampNumber = aTimeStampIter->first;
-       myTimeStampID.push_back(aTimeStampNumber);
-
-       QString aTimeStampTime = aTimeStampIter->second;
-       myTimeStampsCombo->insertItem(aTimeStampTime);
-      }
-      return;
-    }
-  }
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::onFieldChanged(int){
-  AddAllTimes(myFieldsCombo->currentText());
-  SetScalarField();
-  UpdateScalarField();
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::onTimeStampChanged(int){
-  SetScalarField();
-  UpdateScalarField();
-}
-
-void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
-  GetScalarPane()->initFromPrsObject(myPrsCopy);
-}
-
-QString 
-VisuGUI_ScalarMapOnDeformedShapeDlg
-::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
-                          const std::string& theFieldName,
-                          int theTimeStampNumber)
-{
-  QString aTime("");
-  VISU::TEntity anEntity = VISU::TEntity(theEntity);
-  VISU::Result_i* theResult = myPrsCopy->GetCResult();
-  VISU::Result_i::PInput anInput = theResult->GetInput();
-  VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
-                                         anEntity,
-                                         theFieldName);
-  if(!aField) 
-    return aTime;
-
-  VISU::TValField& aValField = aField->myValField;
-  VISU::TValField::const_iterator aIter = aValField.find(theTimeStampNumber);
-  if(aIter != aValField.end()){
-    VISU::PValForTime aValForTime = aIter->second;
-    aTime = VISU_Convertor::GenerateName(aValForTime->myTime).c_str();
-  }
-  return aTime;
-}
diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h
deleted file mode 100644 (file)
index 6974d68..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : VisuGUI_ScalarMapOnDeformedShapeDlg.h
-//  Author : Eugeny Nikolaev
-//  Module : VISU
-
-#ifndef VISUGUI_SCALARMAPONDEFORMEDSHAPEDLS_H
-#define VISUGUI_SCALARMAPONDEFORMEDSHAPEDLS_H
-
-#include "VisuGUI_Prs3dDlg.h"
-
-#include "VISUConfig.hh"
-
-#include "QtxDblSpinBox.h"
-
-#include <qdialog.h>
-#include <qgroupbox.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qtabwidget.h>
-
-#include <set>
-#include <vector>
-
-class SalomeApp_Module;
-class VisuGUI_InputPane;
-
-namespace VISU
-{
-  class ScalarMapOnDeformedShape_i;
-}
-
-class VisuGUI_ScalarMapOnDeformedShapeDlg : public VisuGUI_ScalarBarBaseDlg
-{
-    Q_OBJECT
-
-public:
-    VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule);
-    ~VisuGUI_ScalarMapOnDeformedShapeDlg();
-
-    double getFactor()
-      { return ScalFact->value(); }
-    void setFactor(double theFactor)
-      { ScalFact->setValue(theFactor); }
-    
-    virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
-                                   bool theInit );
-
-    virtual int  storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
-
-    int getCurrentScalarFieldNamePos();
-    QString getCurrentScalarFieldName();
-    int getCurrentScalarNbIterations();
-    VISU::Entity getCurrentScalarEntity();
-    void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
-
-protected:
-  virtual QString GetContextHelpFilePath();
-
-protected slots:
-  void accept();
-  void reject();
-
-private slots:
-  void onFieldChanged(int i=0);
-  void onTimeStampChanged(int i=0);
-
-private:
- QtxDblSpinBox* ScalFact;
- QTabWidget* myTabBox;
- VisuGUI_ScalarBarPane* myScalarPane;
- VisuGUI_InputPane*     myInputPane;
- QComboBox *myFieldsCombo;
- QComboBox *myTimeStampsCombo;
- typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
- typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
- typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
- TEntity2Fields myEntity2Fields;
- int myCurrScalarIter;
- bool myIsAnimation;
- bool myUpdateScalars;
- std::vector<int> myTimeStampID;
- _PTR(SObject) mySelectionObj;
- SALOME::GenericObjPtr<VISU::ScalarMapOnDeformedShape_i> myPrsCopy;
- SalomeApp_Module* myVisuGUI;
-protected:
- void UpdateScalarField();
- void SetScalarField( const bool = true );
- void AddAllFieldNames();
- void AddAllTimes(const QString& theFieldName);
- QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
-                                 const std::string& theFieldName,
-                                 int theTimeStampNumber);
-};
-
-#endif // VISUGUI_DEFORMEDSHAPEDLS_H
index fd12611f93043c67d090497cf895813290dc74c1..e7a09f20754fcaaed30f6ebe16c1211443b292b2 100644 (file)
@@ -34,7 +34,7 @@
 #include "VisuGUI_VectorsDlg.h"
 #include "VisuGUI_IsoSurfacesDlg.h"
 #include "VisuGUI_StreamLinesDlg.h"
-#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+#include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
 #include "VisuGUI_GaussPointsDlg.h"
 
 #include "VISU_TimeAnimation.h"
@@ -47,7 +47,7 @@
 #include "VISU_CutLines_i.hh"
 #include "VISU_Vectors_i.hh"
 #include "VISU_StreamLines_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
 #include "VISU_GaussPoints_i.hh"
 
 #include "VISU_ViewManager_i.hh"
@@ -665,7 +665,7 @@ enum PrsComboItem {
   TVECTORS_ITEM       = 6, // VISU::TVECTORS
   TSTREAMLINES_ITEM   = 7, // VISU::TSTREAMLINES
   TGAUSSPOINTS_ITEM   = 8, // VISU::TGAUSSPOINTS
-  TSCALARMAPONDEFORMEDSHAPE_ITEM = 9 // VISU::TSCALARMAPONDEFORMEDSHAPE
+  TDEFORMEDSHAPEANDSCALARMAP_ITEM = 9 // VISU::TDEFORMEDSHAPEANDSCALARMAP
 };
 
 //------------------------------------------------------------------------
@@ -756,9 +756,9 @@ void SetupDlg::onFieldChange (int theIndex)
     myTypeId2ComboId[TSTREAMLINES_ITEM] = myComboId2TypeId.size();
     myComboId2TypeId.push_back(TSTREAMLINES_ITEM);;
 
-    myTypeCombo->insertItem("Scalar map on Deformed shape");   // item 9
-    myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
-    myComboId2TypeId.push_back(TSCALARMAPONDEFORMEDSHAPE_ITEM);;
+    myTypeCombo->insertItem("Deformed shape and Scalar map");   // item 9
+    myTypeId2ComboId[TDEFORMEDSHAPEANDSCALARMAP_ITEM] = myComboId2TypeId.size();
+    myComboId2TypeId.push_back(TDEFORMEDSHAPEANDSCALARMAP_ITEM);;
   }
 
   if(anEnableGP){
@@ -787,7 +787,8 @@ void SetupDlg::onFieldChange (int theIndex)
     myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]);
     break;
   case VISU::TSCALARMAPONDEFORMEDSHAPE: //Scalar Map on Deformed Shape
-    myTypeCombo->setCurrentItem(myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM]);
+  case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+    myTypeCombo->setCurrentItem(myTypeId2ComboId[TDEFORMEDSHAPEANDSCALARMAP_ITEM]);
     break;
   case VISU::TVECTORS: //Vectors
     myTypeCombo->setCurrentItem(myTypeId2ComboId[TVECTORS_ITEM]);
@@ -831,8 +832,8 @@ void SetupDlg::onTypeChanged (int theIndex)
     case TDEFORMEDSHAPE_ITEM: //Deformed Shape
       aData.myPrsType = VISU::TDEFORMEDSHAPE;
       break;
-    case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
-      aData.myPrsType = VISU::TSCALARMAPONDEFORMEDSHAPE;
+    case TDEFORMEDSHAPEANDSCALARMAP_ITEM: //Scalar Map on Deformed Shape
+      aData.myPrsType = VISU::TDEFORMEDSHAPEANDSCALARMAP;
       break;
     case TVECTORS_ITEM: //Vectors
       aData.myPrsType = VISU::TVECTORS;
@@ -942,11 +943,11 @@ void SetupDlg::onPreferencesDlg()
     c.suspend();
     EditPrs<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg>(myModule, aData, myAnimator);
     break;
-  case TSCALARMAPONDEFORMEDSHAPE_ITEM: //Scalar Map on Deformed Shape
+  case TDEFORMEDSHAPEANDSCALARMAP_ITEM: //Scalar Map on Deformed Shape
     c.suspend();
     {
-      typedef VisuGUI_ScalarMapOnDeformedShapeDlg DLG;
-      typedef VISU::ScalarMapOnDeformedShape_i TYPE;
+      typedef VisuGUI_DeformedShapeAndScalarMapDlg DLG;
+      typedef VISU::DeformedShapeAndScalarMap_i TYPE;
       DLG* aDlg = new DLG (myModule);
       TYPE* aPrs3d = dynamic_cast<TYPE*>(aData.myPrs[0]);
       aDlg->initFromPrsObject(aPrs3d, true);
index 878cfa2cc9d06801e7a2b474c57d3c97b61f350e..88e8ace08dd761b13a45d6bea55baece8bf5ac45 100644 (file)
@@ -1283,6 +1283,7 @@ namespace VISU
         case VISU::TSTREAMLINES:
         case VISU::TPLOT3D:
        case VISU::TSCALARMAPONDEFORMEDSHAPE:
+       case VISU::TDEFORMEDSHAPEANDSCALARMAP:
           {
             PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
             if (aServant.in()) {
index 542eab8c407107a7fd4d1a9123388e864d374a99..4e2d5ffb41be9e357db29c36c36831be1f9cfe54 100644 (file)
@@ -50,7 +50,7 @@ salomeinclude_HEADERS = \
        VISU_ViewManager_i.hh \
        VISU_View_i.hh \
        VISU_TimeAnimation.h \
-       VISU_ScalarMapOnDeformedShape_i.hh \
+       VISU_DeformedShapeAndScalarMap_i.hh \
        VISU_ColoredPrs3dFactory.hh \
        VISU_MonoColorPrs_i.hh \
        SALOME_GenericObjPointer.hh
@@ -75,7 +75,7 @@ libVISUEngineImpl_la_SOURCES = \
        VISU_CutLines_i.cc \
        VISU_Vectors_i.cc \
        VISU_StreamLines_i.cc \
-       VISU_ScalarMapOnDeformedShape_i.cc \
+       VISU_DeformedShapeAndScalarMap_i.cc \
        VISU_ColoredPrs3dCache_i.cc \
        VISU_ColoredPrs3dHolder_i.cc \
        VISU_ColoredPrs3dFactory.cc \
index f42b1ff91ca687785ab87cc6eae7595e4f5a812a..095c15930b0e76bc194463001aab7df128e688cb 100644 (file)
@@ -214,8 +214,8 @@ namespace VISU
       return VISU::TISOSURFACES;
     if ( theComment == "DEFORMEDSHAPE" ) 
       return VISU::TDEFORMEDSHAPE;
-    if ( theComment == "SCALARMAPONDEFORMEDSHAPE" ) 
-      return VISU::TSCALARMAPONDEFORMEDSHAPE;
+    if ( theComment == "DEFORMEDSHAPEANDSCALARMAP" ) 
+      return VISU::TDEFORMEDSHAPEANDSCALARMAP;
     if ( theComment == "GAUSSPOINTS" ) 
       return VISU::TGAUSSPOINTS;
     if ( theComment == "PLOT3D" ) 
index 6b1143a2cbbc47c83acf87a47c381d1dc0c0371d..348ff93b7d31c978118a7c25cb9f7661df7f0055 100644 (file)
@@ -653,8 +653,8 @@ VISU::ColoredPrs3dCache_i
     aPrs3d->SameAs(thePrs);
     
     // special case for deformed shape
-    VISU::ScalarMapOnDeformedShape_i* dShape =
-      dynamic_cast<VISU::ScalarMapOnDeformedShape_i*>( aPrs3d.get() );
+    VISU::DeformedShapeAndScalarMap_i* dShape =
+      dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>( aPrs3d.get() );
     if ( dShape && dShape->GetScalarTimeStampNumber() != theInput.myTimeStampNumber )
     {
       dShape->SetScalarField( dShape->GetScalarEntity(),
index cff778da6a6851ba8d6241340e742e113326750c..0aee75f247d1f5af53a019b22c26f816a43787bd 100644 (file)
@@ -97,7 +97,8 @@ namespace VISU
     case TDEFORMEDSHAPE:
       return VISU::CreatePrs3dByEnum<TDEFORMEDSHAPE>(theStudy, thePublishInStudyMode);
     case TSCALARMAPONDEFORMEDSHAPE:
-      return VISU::CreatePrs3dByEnum<TSCALARMAPONDEFORMEDSHAPE>(theStudy, thePublishInStudyMode);
+    case TDEFORMEDSHAPEANDSCALARMAP:
+      return VISU::CreatePrs3dByEnum<TDEFORMEDSHAPEANDSCALARMAP>(theStudy, thePublishInStudyMode);
     case TISOSURFACES:
       return VISU::CreatePrs3dByEnum<TISOSURFACES>(theStudy, thePublishInStudyMode);
     case TSTREAMLINES:
@@ -201,7 +202,8 @@ namespace VISU
       aMemory = CheckIsPossible<TDEFORMEDSHAPE>(theInput, theMemoryCheck);
       break;
     case TSCALARMAPONDEFORMEDSHAPE:
-      aMemory = CheckIsPossible<TSCALARMAPONDEFORMEDSHAPE>(theInput, theMemoryCheck);
+    case TDEFORMEDSHAPEANDSCALARMAP:
+      aMemory = CheckIsPossible<TDEFORMEDSHAPEANDSCALARMAP>(theInput, theMemoryCheck);
       break;
     case TISOSURFACES:
       aMemory = CheckIsPossible<TISOSURFACES>(theInput, theMemoryCheck);
index eae438dde6f3c32cd0e1d90887a1461728d257cc..98ee08f231f575fc63f88245a767ad771e133f01 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "VISU_I.hxx"
 #include "SALOME_GenericObjPointer.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
 #include "VISU_Plot3D_i.hh"
 #include "VISU_GaussPoints_i.hh"
 #include "VISU_StreamLines_i.hh"
@@ -52,7 +52,8 @@ namespace VISU
   namespace TL
   {
     //----------------------------------------------------------------------------
-    typedef TList<ScalarMapOnDeformedShape_i,
+    typedef TList<DeformedShapeAndScalarMap_i,
+                 TList<DeformedShapeAndScalarMap_i,
                  TList<DeformedShape_i,
                        TList<StreamLines_i,
                              TList<GaussPoints_i,
@@ -62,11 +63,12 @@ namespace VISU
                                                      TList<CutLines_i,
                                                            TList<Vectors_i,
                                                                  TList<Plot3D_i, 
-                                                                       TNullType> > > > > > > > > >
+                                                                       TNullType> > > > > > > > > > >
     TColoredPrs3dTypeList;
     
 
     typedef TList<TInt2Type<TSCALARMAPONDEFORMEDSHAPE>,
+                 TList<TInt2Type<TDEFORMEDSHAPEANDSCALARMAP>,
                  TList<TInt2Type<TDEFORMEDSHAPE>, 
                        TList<TInt2Type<TSTREAMLINES>,
                              TList<TInt2Type<TGAUSSPOINTS>,
@@ -76,7 +78,7 @@ namespace VISU
                                                      TList<TInt2Type<TCUTLINES>,
                                                            TList<TInt2Type<TVECTORS>,
                                                                  TList<TInt2Type<TPLOT3D>, 
-                                                                       TNullType> > > > > > > > > >
+                                                                       TNullType> > > > > > > > > > >
     TColoredPrs3dEnumList;
     
 
diff --git a/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.cc b/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.cc
new file mode 100644 (file)
index 0000000..f5b4316
--- /dev/null
@@ -0,0 +1,404 @@
+//  VISU OBJECT : interactive object for VISU entities implementation
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//  File   : VISU_DeformedShapeAndScalarMap_i.cc
+//  Author : Eugeny Nikolaev
+//  Module : VISU
+
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISU_Result_i.hh"
+
+#include "VISU_ScalarMapAct.h"
+#include "VISU_DeformedShapeAndScalarMapPL.hxx"
+#include "VISU_Convertor.hxx"
+
+#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
+
+#include <vtkUnstructuredGrid.h>
+#include <vtkProperty.h>
+#include <vtkMapper.h>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+static int INCMEMORY = 4+12;
+
+
+//---------------------------------------------------------------
+size_t
+VISU::DeformedShapeAndScalarMap_i
+::IsPossible(Result_i* theResult, 
+            const std::string& theMeshName, 
+            VISU::Entity theEntity,
+            const std::string& theFieldName, 
+            CORBA::Long theTimeStampNumber,
+            bool theIsMemoryCheck)
+{
+  size_t aResult = 0;
+  try{
+    aResult = TSuperClass::IsPossible(theResult,
+                                     theMeshName,
+                                     theEntity,
+                                     theFieldName,
+                                     theTimeStampNumber,
+                                     false);
+    if(theIsMemoryCheck && aResult){
+      VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+                                                          theEntity,
+                                                          theFieldName,
+                                                          theTimeStampNumber);
+      VISU::PField aField = anInput->GetField(theMeshName,
+                                             (VISU::TEntity)theEntity,
+                                             theFieldName);
+      if(aField->myNbComp <= 1)
+       return 0;
+
+      bool anIsEstimated = true;
+      size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
+                                                    (VISU::TEntity)theEntity,
+                                                    theFieldName,
+                                                    theTimeStampNumber,
+                                                    anIsEstimated);
+      if(anIsEstimated)
+       aSize *= INCMEMORY;
+      aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+      if(MYDEBUG) 
+       MESSAGE("DeformedShapeAndScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+    }
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
+  }catch(...){
+    INFOS("Unknown exception was occured!");
+  }
+  return aResult;
+}
+
+//---------------------------------------------------------------
+int VISU::DeformedShapeAndScalarMap_i::myNbPresent = 0;
+
+//---------------------------------------------------------------
+QString
+VISU::DeformedShapeAndScalarMap_i
+::GenerateName() 
+{
+  return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);
+}
+
+//---------------------------------------------------------------
+const string VISU::DeformedShapeAndScalarMap_i::myComment = "SCALARMAPONDEFORMEDSHAPE"; // It is obsolete. Use "DEFORMEDSHAPEANDSCALARMAP" instead.
+
+//---------------------------------------------------------------
+const char* 
+VISU::DeformedShapeAndScalarMap_i
+::GetComment() const
+{ 
+  return myComment.c_str();
+}
+
+//----------------------------------------------------------------------------
+const char*
+VISU::DeformedShapeAndScalarMap_i
+::GetIconName()
+{
+  if (!IsGroupsUsed())
+    return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE";
+  else
+    return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS";
+}
+
+//---------------------------------------------------------------
+VISU::DeformedShapeAndScalarMap_i
+::DeformedShapeAndScalarMap_i(EPublishInStudyMode thePublishInStudyMode) :
+  ColoredPrs3d_i(thePublishInStudyMode),
+  ScalarMap_i(thePublishInStudyMode),
+  myDeformedShapeAndScalarMapPL(NULL),
+  myScalarTimeStampNumber(1)
+{}
+
+
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::DeformedShapeAndScalarMap_i
+::Create(const std::string& theMeshName, 
+        VISU::Entity theEntity,
+        const std::string& theFieldName, 
+        CORBA::Long theTimeStampNumber)
+{
+  TSuperClass::Create(theMeshName,
+                            theEntity,
+                            theFieldName,
+                            theTimeStampNumber);
+  SetScalarField(theEntity,
+                theFieldName.c_str(),
+                theTimeStampNumber);
+  return this;
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::DeformedShapeAndScalarMap_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+         const Storable::TRestoringMap& theMap)
+{
+  if(!TSuperClass::Restore(theSObject, theMap))
+    return NULL;
+
+  QString aMeshName = VISU::Storable::FindValue(theMap,"myScalarMeshName");
+  VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt());
+
+  QString aFieldName = VISU::Storable::FindValue(theMap,"myScalarFieldName");
+  int aTimeStampNumber = VISU::Storable::FindValue(theMap,"myScalarIteration").toInt();
+
+  SetScalarField(anEntity,
+                aFieldName,
+                aTimeStampNumber);
+
+  SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
+  
+  return this;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::ToStream(std::ostringstream& theStr)
+{
+  TSuperClass::ToStream(theStr);
+  
+  Storable::DataToStream( theStr, "myScalarEntity",    int(myScalarEntity));
+  Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
+  Storable::DataToStream( theStr, "myScalarIteration", int(myScalarTimeStampNumber));
+
+  Storable::DataToStream( theStr, "myFactor", GetScale() );
+}
+
+
+//---------------------------------------------------------------
+VISU::DeformedShapeAndScalarMap_i
+::~DeformedShapeAndScalarMap_i()
+{
+  if(MYDEBUG) MESSAGE("DeformedShapeAndScalarMap_i::~DeformedShapeAndScalarMap_i()");
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+  TSuperClass::SameAs(theOrigin);
+  
+  if(const DeformedShapeAndScalarMap_i* aPrs3d = dynamic_cast<const DeformedShapeAndScalarMap_i*>(theOrigin)){
+    DeformedShapeAndScalarMap_i* anOrigin = const_cast<DeformedShapeAndScalarMap_i*>(aPrs3d);
+    CORBA::String_var aFieldName = anOrigin->GetScalarFieldName();
+    
+    SetScalarField(anOrigin->GetScalarEntity(),
+                  aFieldName,
+                  anOrigin->GetScalarTimeStampNumber());
+    Update();
+  }
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::SetScale(CORBA::Double theScale) 
+{ 
+  VISU::TSetModified aModified(this);
+
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapeAndScalarMapPL, vtkFloatingPointType>
+                  (GetSpecificPL(), &VISU_DeformedShapeAndScalarMapPL::SetScale, theScale));
+}
+
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::DeformedShapeAndScalarMap_i
+::GetScale()
+{
+  return myDeformedShapeAndScalarMapPL->GetScale();
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
+{
+  if(!thePipeLine){
+    myDeformedShapeAndScalarMapPL = VISU_DeformedShapeAndScalarMapPL::New();
+  }else
+    myDeformedShapeAndScalarMapPL = dynamic_cast<VISU_DeformedShapeAndScalarMapPL*>(thePipeLine);
+
+  myDeformedShapeAndScalarMapPL->GetMapper()->SetScalarVisibility(1);
+
+  TSuperClass::CreatePipeLine(myDeformedShapeAndScalarMapPL);
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::DeformedShapeAndScalarMap_i
+::CheckIsPossible() 
+{
+  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
+}
+
+
+//---------------------------------------------------------------
+VISU_Actor* 
+VISU::DeformedShapeAndScalarMap_i
+::CreateActor() 
+{
+  VISU_Actor* anActor = TSuperClass::CreateActor(true);
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int  aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
+  bool toShrink  = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
+  anActor->SetRepresentation(aDispMode);
+  if (toShrink) 
+    anActor->SetShrink();
+  anActor->SetVTKMapping(false);
+  return anActor;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::UpdateActor(VISU_Actor* theActor) 
+{
+  if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
+    anActor->SetBarVisibility(true);
+    GetPipeLine()->GetMapper()->SetScalarVisibility(1);
+  }
+  TSuperClass::UpdateActor(theActor);
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::SetField(VISU::PField theField)
+{
+  TSuperClass::SetField(theField);
+  
+  if(!myScalarField)
+    myScalarField = theField;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShapeAndScalarMap_i
+::SetScalarField(VISU::Entity theEntity,
+                const char* theFieldName,
+                CORBA::Long theTimeStampNumber)
+{
+  bool anIsModified = false;
+
+  if(!anIsModified)
+    anIsModified |= myScalarEntity != theEntity;
+
+  if(!anIsModified)
+    anIsModified |= myScalarFieldName != theFieldName;
+
+  if(!anIsModified)
+    anIsModified |= myScalarTimeStampNumber != theTimeStampNumber;
+  
+  if(!anIsModified)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  VISU::TEntity aEntity = VISU::TEntity(theEntity);
+  VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
+                                                         theEntity,
+                                                         theFieldName,
+                                                         theTimeStampNumber);
+  myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
+
+  VISU::PUnstructuredGridIDMapper anIDMapper = 
+    anInput->GetTimeStampOnMesh(GetCMeshName(),
+                               aEntity,
+                               theFieldName,
+                               theTimeStampNumber);
+
+  vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput();
+  if(myDeformedShapeAndScalarMapPL && anOutput)
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapeAndScalarMapPL, vtkDataSet*>
+                    (GetSpecificPL(), &VISU_DeformedShapeAndScalarMapPL::SetScalars, anOutput));
+  
+  myScalarEntity = theEntity;
+  myScalarFieldName = theFieldName;
+  myScalarTimeStampNumber = theTimeStampNumber;
+
+  SetTitle(theFieldName);
+  SetScalarMode(GetScalarMode());
+  if(!IsRangeFixed() && IsPipeLineExists())
+    SetSourceRange();
+
+  myParamsTime.Modified();
+}
+
+
+//---------------------------------------------------------------
+VISU::Entity 
+VISU::DeformedShapeAndScalarMap_i
+::GetScalarEntity()
+{
+  return myScalarEntity;
+}
+
+
+//---------------------------------------------------------------
+char* 
+VISU::DeformedShapeAndScalarMap_i
+::GetScalarFieldName()
+{
+  return CORBA::string_dup(myScalarFieldName.c_str());
+}
+
+
+//---------------------------------------------------------------
+CORBA::Long 
+VISU::DeformedShapeAndScalarMap_i
+::GetScalarTimeStampNumber()
+{
+  return myScalarTimeStampNumber;
+}
+
+
+//---------------------------------------------------------------
+VISU::PField
+VISU::DeformedShapeAndScalarMap_i
+::GetScalarField()
+{
+  return myScalarField;
+}
diff --git a/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.hh b/src/VISU_I/VISU_DeformedShapeAndScalarMap_i.hh
new file mode 100644 (file)
index 0000000..35827d1
--- /dev/null
@@ -0,0 +1,179 @@
+//  VISU OBJECT : interactive object for VISU entities implementation
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File:    VISU_DeformedShapeAndScalarMap_i.hh
+// Author:  Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_DeformedShapeAndScalarMap_i_HeaderFile
+#define VISU_DeformedShapeAndScalarMap_i_HeaderFile
+
+#include "VISU_ScalarMap_i.hh"
+
+class VISU_DeformedShapeAndScalarMapPL;
+
+namespace VISU
+{
+  //----------------------------------------------------------------------------  
+  //! Class of Scalar Map on Deformed Shape presentation.
+  class VISU_I_EXPORT DeformedShapeAndScalarMap_i : public virtual POA_VISU::DeformedShapeAndScalarMap,
+                                                   public virtual ScalarMap_i
+  {
+    static int myNbPresent;
+    DeformedShapeAndScalarMap_i(const DeformedShapeAndScalarMap_i&);
+    
+  public:
+    //----------------------------------------------------------------------------     
+    typedef ScalarMap_i TSuperClass;
+    typedef VISU::DeformedShapeAndScalarMap TInterface;
+        
+    explicit
+    DeformedShapeAndScalarMap_i(EPublishInStudyMode thePublishInStudyModep);
+    
+    virtual
+    ~DeformedShapeAndScalarMap_i();
+
+    virtual
+    VISU::VISUType
+    GetType()
+    { 
+      return VISU::TDEFORMEDSHAPEANDSCALARMAP;
+    }
+    
+    virtual 
+    void
+    SetScale(CORBA::Double theScale);
+
+    virtual
+    CORBA::Double 
+    GetScale();
+
+    virtual 
+    void
+    SameAs(const Prs3d_i* theOrigin);
+
+    VISU_DeformedShapeAndScalarMapPL* 
+    GetSpecificPL()
+    { 
+      return myDeformedShapeAndScalarMapPL;
+    }
+   
+  protected:
+    //! Redefines VISU_ColoredPrs3d_i::SetField
+    virtual
+    void
+    SetField(VISU::PField theField);
+
+    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+    virtual
+    void
+    CreatePipeLine(VISU_PipeLine* thePipeLine);
+
+    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+    virtual 
+    bool 
+    CheckIsPossible();
+
+  public:
+    //! Redefines VISU_ColoredPrs3d_i::IsPossible
+    static
+    size_t
+    IsPossible(Result_i* theResult, 
+              const std::string& theMeshName, 
+              VISU::Entity theEntity,
+              const std::string& theFieldName, 
+              CORBA::Long theTimeStampNumber,
+              bool theIsMemoryCheck);
+
+    //! Redefines VISU_ColoredPrs3d_i::IsPossible
+    virtual
+    Storable* 
+    Create(const std::string& theMeshName, 
+          VISU::Entity theEntity,
+          const std::string& theFieldName, 
+          CORBA::Long theTimeStampNumber);
+
+    //! Redefines VISU_ColoredPrs3d_i::ToStream
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
+
+    //! Redefines VISU_ColoredPrs3d_i::Restore
+    virtual
+    Storable* 
+    Restore(SALOMEDS::SObject_ptr theSObject,
+           const Storable::TRestoringMap& theMap);
+    
+    static const std::string myComment;
+
+    virtual
+    const char* 
+    GetComment() const;
+
+    virtual
+    QString 
+    GenerateName();
+
+    virtual
+    const char* 
+    GetIconName();
+    
+    virtual
+    VISU_Actor* 
+    CreateActor();
+
+    virtual
+    void
+    UpdateActor(VISU_Actor* theActor) ;
+
+    virtual 
+    void
+    SetScalarField(VISU::Entity theEntity,
+                  const char* theFieldName,
+                  CORBA::Long theTimeStampNumber);
+
+    virtual
+    VISU::Entity
+    GetScalarEntity();
+
+    virtual
+    char* 
+    GetScalarFieldName();
+
+    virtual
+    CORBA::Long
+    GetScalarTimeStampNumber();
+
+    virtual 
+    VISU::PField
+    GetScalarField();
+
+  private:
+    VISU_DeformedShapeAndScalarMapPL *myDeformedShapeAndScalarMapPL;
+
+    PField myScalarField;
+    VISU::Entity myScalarEntity;
+    std::string myScalarFieldName;
+    CORBA::Long myScalarTimeStampNumber;
+  };
+}
+#endif
index ce767a35b49cb8e8200d7d8716a5323091d2d812..84b03f05e72b253bf41bc1f7a0860608e63ea2bc 100644 (file)
@@ -41,7 +41,7 @@
 #include "VISU_Table_i.hh"
 #include "VISU_PointMap3d_i.hh"
 #include "VISU_GaussPoints_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
 #include "VISU_ColoredPrs3dCache_i.hh"
 #include "VISU_ColoredPrs3dHolder_i.hh"
 
@@ -507,12 +507,12 @@ namespace VISU
 
   //---------------------------------------------------------------------------
   std::string
-  ScalarMapOnDeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
-                                  VISU::ScalarMapOnDeformedShape_i* theServant,
-                                  std::ostream& theStr,
-                                  const std::string& theName,
-                                  TColoredPrs3dFactory& thePrsFactory,
-                                  std::string thePrefix)
+  DeformedShapeAndScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
+                                   VISU::DeformedShapeAndScalarMap_i* theServant,
+                                   std::ostream& theStr,
+                                   const std::string& theName,
+                                   TColoredPrs3dFactory& thePrsFactory,
+                                   std::string thePrefix)
   {
     thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
     theStr<<thePrefix<<endl;
@@ -1249,9 +1249,10 @@ namespace VISU
           }
           return;
         case VISU::TSCALARMAPONDEFORMEDSHAPE:
-          if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(GetServant(anObj).in())){
-           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "ScalarMapOnDeformedShapeOnField", theArgumentName);
-           thePrefix = ScalarMapOnDeformedShapeToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+       case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+          if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(GetServant(anObj).in())){
+           TCreateFromResult aPrsFactory(theSObject, aServant, aName, "DeformedShapeAndScalarMapOnField", theArgumentName);
+           thePrefix = DeformedShapeAndScalarMapToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
@@ -1810,8 +1811,9 @@ namespace VISU
                    break;
                  }
                case VISU::TSCALARMAPONDEFORMEDSHAPE:
-                 if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(aDevice)){
-                   ScalarMapOnDeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+               case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+                 if(DeformedShapeAndScalarMap_i* aServant = dynamic_cast<DeformedShapeAndScalarMap_i*>(aDevice)){
+                   DeformedShapeAndScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
                    break;
                  }
                case VISU::TVECTORS:
index c9b85b1bd1d563dd1c02c2e9d604cca075ddbb18..ec0c6d66abc97ec29b51ec9b665f6a3b49d63e5d 100644 (file)
@@ -210,7 +210,7 @@ namespace VISU
     Storable::RegistryStorableEngine(StreamLines_i::myComment.c_str(),&(StorableEngine<StreamLines_i>));
     Storable::RegistryStorableEngine(Plot3D_i::myComment.c_str(),&(StorableEngine<Plot3D_i>));
     Storable::RegistryStorableEngine(Vectors_i::myComment.c_str(),&(StorableEngine<Vectors_i>));
-    Storable::RegistryStorableEngine(ScalarMapOnDeformedShape_i::myComment.c_str(),&(StorableEngine<ScalarMapOnDeformedShape_i>));
+    Storable::RegistryStorableEngine(DeformedShapeAndScalarMap_i::myComment.c_str(),&(StorableEngine<DeformedShapeAndScalarMap_i>));
 
     Storable::RegistryStorableEngine(ColoredPrs3dHolder_i::myComment.c_str(),&(ColoredPrs3dHolder_i::StorableEngine));
     Storable::RegistryStorableEngine(ColoredPrs3dCache_i::myComment.c_str(),&(ColoredPrs3dCache_i::StorableEngine));
@@ -967,7 +967,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  ScalarMapOnDeformedShape_ptr 
+  DeformedShapeAndScalarMap_ptr 
   VISU_Gen_i
   ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
                                    const char* theMeshName,
@@ -975,11 +975,28 @@ namespace VISU
                                    const char* theFieldName,
                                    CORBA::Long theIteration)
   {
-    return Prs3dOnField<VISU::ScalarMapOnDeformedShape_i>(theResult,
-                                                         theMeshName,
-                                                         theEntity,
-                                                         theFieldName,
-                                                         theIteration)._retn();
+    return DeformedShapeAndScalarMapOnField(theResult,
+                                           theMeshName,
+                                           theEntity,
+                                           theFieldName,
+                                           theIteration);
+  }
+  
+
+//---------------------------------------------------------------
+  DeformedShapeAndScalarMap_ptr 
+  VISU_Gen_i
+  ::DeformedShapeAndScalarMapOnField(Result_ptr theResult,
+                                    const char* theMeshName,
+                                    VISU::Entity theEntity,
+                                    const char* theFieldName,
+                                    CORBA::Long theIteration)
+  {
+    return Prs3dOnField<VISU::DeformedShapeAndScalarMap_i>(theResult,
+                                                          theMeshName,
+                                                          theEntity,
+                                                          theFieldName,
+                                                          theIteration)._retn();
   }
   
 
index 1f38e06e556220f53c5539c9ef20f811b2922380..1043ed2a240ac5f2bad5f27f3f0f900d1a452df2 100644 (file)
@@ -177,13 +177,23 @@ namespace VISU
                         const char* theFieldName, 
                         CORBA::Long theIteration);
 
+    //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
     virtual
-    ScalarMapOnDeformedShape_ptr
+    DeformedShapeAndScalarMap_ptr
     ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
                                    const char* theMeshName, 
                                    VISU::Entity theEntity,
                                    const char* theFieldName, 
                                    CORBA::Long theIteration);
+
+    virtual
+    DeformedShapeAndScalarMap_ptr
+    DeformedShapeAndScalarMapOnField(Result_ptr theResult,
+                                    const char* theMeshName, 
+                                    VISU::Entity theEntity,
+                                    const char* theFieldName, 
+                                    CORBA::Long theIteration);
+
     virtual
     Vectors_ptr
     VectorsOnField(Result_ptr theResult,
index 6c8c3973d65372bfa63e809354d02d967d4507fb..27114c9ff1e772142a82c8019c133062208fb0ff 100644 (file)
@@ -43,7 +43,7 @@
 #include "VISU_Vectors_i.hh"
 #include "VISU_StreamLines_i.hh"
 #include "VISU_GaussPoints_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
 #include "VISU_ViewManager_i.hh"
 #include "VISU_View_i.hh"
 #include "VISU_TimeAnimation.h"
diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
deleted file mode 100644 (file)
index ac6a832..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-//  VISU OBJECT : interactive object for VISU entities implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//  File   : VISU_ScalarMapOnDeformedShape_i.cc
-//  Author : Eugeny Nikolaev
-//  Module : VISU
-
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
-#include "VISU_Prs3dUtils.hh"
-#include "VISU_Result_i.hh"
-
-#include "VISU_ScalarMapAct.h"
-#include "VISU_ScalarMapOnDeformedShapePL.hxx"
-#include "VISU_Convertor.hxx"
-
-#include "SUIT_ResourceMgr.h"
-#include "SALOME_Event.hxx"
-
-#include <vtkUnstructuredGrid.h>
-#include <vtkProperty.h>
-#include <vtkMapper.h>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-static int INCMEMORY = 4+12;
-
-
-//---------------------------------------------------------------
-size_t
-VISU::ScalarMapOnDeformedShape_i
-::IsPossible(Result_i* theResult, 
-            const std::string& theMeshName, 
-            VISU::Entity theEntity,
-            const std::string& theFieldName, 
-            CORBA::Long theTimeStampNumber,
-            bool theIsMemoryCheck)
-{
-  size_t aResult = 0;
-  try{
-    aResult = TSuperClass::IsPossible(theResult,
-                                     theMeshName,
-                                     theEntity,
-                                     theFieldName,
-                                     theTimeStampNumber,
-                                     false);
-    if(theIsMemoryCheck && aResult){
-      VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
-                                                          theEntity,
-                                                          theFieldName,
-                                                          theTimeStampNumber);
-      VISU::PField aField = anInput->GetField(theMeshName,
-                                             (VISU::TEntity)theEntity,
-                                             theFieldName);
-      if(aField->myNbComp <= 1)
-       return 0;
-
-      bool anIsEstimated = true;
-      size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
-                                                    (VISU::TEntity)theEntity,
-                                                    theFieldName,
-                                                    theTimeStampNumber,
-                                                    anIsEstimated);
-      if(anIsEstimated)
-       aSize *= INCMEMORY;
-      aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
-      if(MYDEBUG) 
-       MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
-    }
-  }catch(std::exception& exc){
-    INFOS("Follow exception was occured :\n"<<exc.what());
-  }catch(...){
-    INFOS("Unknown exception was occured!");
-  }
-  return aResult;
-}
-
-//---------------------------------------------------------------
-int VISU::ScalarMapOnDeformedShape_i::myNbPresent = 0;
-
-//---------------------------------------------------------------
-QString
-VISU::ScalarMapOnDeformedShape_i
-::GenerateName() 
-{
-  return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);
-}
-
-//---------------------------------------------------------------
-const string VISU::ScalarMapOnDeformedShape_i::myComment = "SCALARMAPONDEFORMEDSHAPE";
-
-//---------------------------------------------------------------
-const char* 
-VISU::ScalarMapOnDeformedShape_i
-::GetComment() const
-{ 
-  return myComment.c_str();
-}
-
-//----------------------------------------------------------------------------
-const char*
-VISU::ScalarMapOnDeformedShape_i
-::GetIconName()
-{
-  if (!IsGroupsUsed())
-    return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE";
-  else
-    return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS";
-}
-
-//---------------------------------------------------------------
-VISU::ScalarMapOnDeformedShape_i
-::ScalarMapOnDeformedShape_i(EPublishInStudyMode thePublishInStudyMode) :
-  ColoredPrs3d_i(thePublishInStudyMode),
-  ScalarMap_i(thePublishInStudyMode),
-  myScalarMapOnDeformedShapePL(NULL),
-  myScalarTimeStampNumber(1)
-{}
-
-
-//---------------------------------------------------------------
-VISU::Storable* 
-VISU::ScalarMapOnDeformedShape_i
-::Create(const std::string& theMeshName, 
-        VISU::Entity theEntity,
-        const std::string& theFieldName, 
-        CORBA::Long theTimeStampNumber)
-{
-  TSuperClass::Create(theMeshName,
-                            theEntity,
-                            theFieldName,
-                            theTimeStampNumber);
-  SetScalarField(theEntity,
-                theFieldName.c_str(),
-                theTimeStampNumber);
-  return this;
-}
-
-
-//---------------------------------------------------------------
-VISU::Storable*
-VISU::ScalarMapOnDeformedShape_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
-         const Storable::TRestoringMap& theMap)
-{
-  if(!TSuperClass::Restore(theSObject, theMap))
-    return NULL;
-
-  QString aMeshName = VISU::Storable::FindValue(theMap,"myScalarMeshName");
-  VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt());
-
-  QString aFieldName = VISU::Storable::FindValue(theMap,"myScalarFieldName");
-  int aTimeStampNumber = VISU::Storable::FindValue(theMap,"myScalarIteration").toInt();
-
-  SetScalarField(anEntity,
-                aFieldName,
-                aTimeStampNumber);
-
-  SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
-  
-  return this;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::ToStream(std::ostringstream& theStr)
-{
-  TSuperClass::ToStream(theStr);
-  
-  Storable::DataToStream( theStr, "myScalarEntity",    int(myScalarEntity));
-  Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
-  Storable::DataToStream( theStr, "myScalarIteration", int(myScalarTimeStampNumber));
-
-  Storable::DataToStream( theStr, "myFactor", GetScale() );
-}
-
-
-//---------------------------------------------------------------
-VISU::ScalarMapOnDeformedShape_i
-::~ScalarMapOnDeformedShape_i()
-{
-  if(MYDEBUG) MESSAGE("ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i()");
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SameAs(const Prs3d_i* theOrigin)
-{
-  TSuperClass::SameAs(theOrigin);
-  
-  if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
-    ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
-    CORBA::String_var aFieldName = anOrigin->GetScalarFieldName();
-    
-    SetScalarField(anOrigin->GetScalarEntity(),
-                  aFieldName,
-                  anOrigin->GetScalarTimeStampNumber());
-    Update();
-  }
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetScale(CORBA::Double theScale) 
-{ 
-  VISU::TSetModified aModified(this);
-
-  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkFloatingPointType>
-                  (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScale, theScale));
-}
-
-
-//---------------------------------------------------------------
-CORBA::Double
-VISU::ScalarMapOnDeformedShape_i
-::GetScale()
-{
-  return myScalarMapOnDeformedShapePL->GetScale();
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::CreatePipeLine(VISU_PipeLine* thePipeLine)
-{
-  if(!thePipeLine){
-    myScalarMapOnDeformedShapePL = VISU_ScalarMapOnDeformedShapePL::New();
-  }else
-    myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
-
-  myScalarMapOnDeformedShapePL->GetMapper()->SetScalarVisibility(1);
-
-  TSuperClass::CreatePipeLine(myScalarMapOnDeformedShapePL);
-}
-
-
-//---------------------------------------------------------------
-bool
-VISU::ScalarMapOnDeformedShape_i
-::CheckIsPossible() 
-{
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
-}
-
-
-//---------------------------------------------------------------
-VISU_Actor* 
-VISU::ScalarMapOnDeformedShape_i
-::CreateActor() 
-{
-  VISU_Actor* anActor = TSuperClass::CreateActor(true);
-  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
-  int  aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
-  bool toShrink  = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
-  anActor->SetRepresentation(aDispMode);
-  if (toShrink) 
-    anActor->SetShrink();
-  anActor->SetVTKMapping(false);
-  return anActor;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::UpdateActor(VISU_Actor* theActor) 
-{
-  if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
-    anActor->SetBarVisibility(true);
-    GetPipeLine()->GetMapper()->SetScalarVisibility(1);
-  }
-  TSuperClass::UpdateActor(theActor);
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetField(VISU::PField theField)
-{
-  TSuperClass::SetField(theField);
-  
-  if(!myScalarField)
-    myScalarField = theField;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetScalarField(VISU::Entity theEntity,
-                const char* theFieldName,
-                CORBA::Long theTimeStampNumber)
-{
-  bool anIsModified = false;
-
-  if(!anIsModified)
-    anIsModified |= myScalarEntity != theEntity;
-
-  if(!anIsModified)
-    anIsModified |= myScalarFieldName != theFieldName;
-
-  if(!anIsModified)
-    anIsModified |= myScalarTimeStampNumber != theTimeStampNumber;
-  
-  if(!anIsModified)
-    return;
-
-  VISU::TSetModified aModified(this);
-
-  VISU::TEntity aEntity = VISU::TEntity(theEntity);
-  VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
-                                                         theEntity,
-                                                         theFieldName,
-                                                         theTimeStampNumber);
-  myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
-
-  VISU::PUnstructuredGridIDMapper anIDMapper = 
-    anInput->GetTimeStampOnMesh(GetCMeshName(),
-                               aEntity,
-                               theFieldName,
-                               theTimeStampNumber);
-
-  vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput();
-  if(myScalarMapOnDeformedShapePL && anOutput)
-    ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkDataSet*>
-                    (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScalars, anOutput));
-  
-  myScalarEntity = theEntity;
-  myScalarFieldName = theFieldName;
-  myScalarTimeStampNumber = theTimeStampNumber;
-
-  SetTitle(theFieldName);
-  SetScalarMode(GetScalarMode());
-  if(!IsRangeFixed() && IsPipeLineExists())
-    SetSourceRange();
-
-  myParamsTime.Modified();
-}
-
-
-//---------------------------------------------------------------
-VISU::Entity 
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarEntity()
-{
-  return myScalarEntity;
-}
-
-
-//---------------------------------------------------------------
-char* 
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarFieldName()
-{
-  return CORBA::string_dup(myScalarFieldName.c_str());
-}
-
-
-//---------------------------------------------------------------
-CORBA::Long 
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarTimeStampNumber()
-{
-  return myScalarTimeStampNumber;
-}
-
-
-//---------------------------------------------------------------
-VISU::PField
-VISU::ScalarMapOnDeformedShape_i
-::GetScalarField()
-{
-  return myScalarField;
-}
diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
deleted file mode 100644 (file)
index 83f2e64..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-//  VISU OBJECT : interactive object for VISU entities implementation
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File:    VISU_ScalarMapOnDeformedShape_i.hh
-// Author:  Eugeny Nikolaev
-// Module : VISU
-
-#ifndef VISU_ScalarMapOnDeformedShape_i_HeaderFile
-#define VISU_ScalarMapOnDeformedShape_i_HeaderFile
-
-#include "VISU_ScalarMap_i.hh"
-
-class VISU_ScalarMapOnDeformedShapePL;
-
-namespace VISU
-{
-  //----------------------------------------------------------------------------  
-  //! Class of Scalar Map on Deformed Shape presentation.
-  class VISU_I_EXPORT ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape,
-                                                  public virtual ScalarMap_i
-  {
-    static int myNbPresent;
-    ScalarMapOnDeformedShape_i(const ScalarMapOnDeformedShape_i&);
-    
-  public:
-    //----------------------------------------------------------------------------     
-    typedef ScalarMap_i TSuperClass;
-    typedef VISU::ScalarMapOnDeformedShape TInterface;
-        
-    explicit
-    ScalarMapOnDeformedShape_i(EPublishInStudyMode thePublishInStudyModep);
-    
-    virtual
-    ~ScalarMapOnDeformedShape_i();
-
-    virtual
-    VISU::VISUType
-    GetType()
-    { 
-      return VISU::TSCALARMAPONDEFORMEDSHAPE;
-    }
-    
-    virtual 
-    void
-    SetScale(CORBA::Double theScale);
-
-    virtual
-    CORBA::Double 
-    GetScale();
-
-    virtual 
-    void
-    SameAs(const Prs3d_i* theOrigin);
-
-    VISU_ScalarMapOnDeformedShapePL* 
-    GetSpecificPL()
-    { 
-      return myScalarMapOnDeformedShapePL;
-    }
-   
-  protected:
-    //! Redefines VISU_ColoredPrs3d_i::SetField
-    virtual
-    void
-    SetField(VISU::PField theField);
-
-    //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
-    virtual
-    void
-    CreatePipeLine(VISU_PipeLine* thePipeLine);
-
-    //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
-    virtual 
-    bool 
-    CheckIsPossible();
-
-  public:
-    //! Redefines VISU_ColoredPrs3d_i::IsPossible
-    static
-    size_t
-    IsPossible(Result_i* theResult, 
-              const std::string& theMeshName, 
-              VISU::Entity theEntity,
-              const std::string& theFieldName, 
-              CORBA::Long theTimeStampNumber,
-              bool theIsMemoryCheck);
-
-    //! Redefines VISU_ColoredPrs3d_i::IsPossible
-    virtual
-    Storable* 
-    Create(const std::string& theMeshName, 
-          VISU::Entity theEntity,
-          const std::string& theFieldName, 
-          CORBA::Long theTimeStampNumber);
-
-    //! Redefines VISU_ColoredPrs3d_i::ToStream
-    virtual
-    void
-    ToStream(std::ostringstream& theStr);
-
-    //! Redefines VISU_ColoredPrs3d_i::Restore
-    virtual
-    Storable* 
-    Restore(SALOMEDS::SObject_ptr theSObject,
-           const Storable::TRestoringMap& theMap);
-    
-    static const std::string myComment;
-
-    virtual
-    const char* 
-    GetComment() const;
-
-    virtual
-    QString 
-    GenerateName();
-
-    virtual
-    const char* 
-    GetIconName();
-    
-    virtual
-    VISU_Actor* 
-    CreateActor();
-
-    virtual
-    void
-    UpdateActor(VISU_Actor* theActor) ;
-
-    virtual 
-    void
-    SetScalarField(VISU::Entity theEntity,
-                  const char* theFieldName,
-                  CORBA::Long theTimeStampNumber);
-
-    virtual
-    VISU::Entity
-    GetScalarEntity();
-
-    virtual
-    char* 
-    GetScalarFieldName();
-
-    virtual
-    CORBA::Long
-    GetScalarTimeStampNumber();
-
-    virtual 
-    VISU::PField
-    GetScalarField();
-
-  private:
-    VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
-
-    PField myScalarField;
-    VISU::Entity myScalarEntity;
-    std::string myScalarFieldName;
-    CORBA::Long myScalarTimeStampNumber;
-  };
-}
-#endif
index b73b168394ac4c7fda0949a7a70213d2daa24b65..c843845bf051d0ce75ab92f8e24006a25e9bd5a6 100644 (file)
@@ -36,7 +36,7 @@
 #include "VISU_Mesh_i.hh"
 #include "VISU_IsoSurfaces_i.hh"
 #include "VISU_DeformedShape_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_DeformedShapeAndScalarMap_i.hh"
 #include "VISU_CutPlanes_i.hh"
 #include "VISU_Plot3D_i.hh"
 #include "VISU_CutLines_i.hh"
@@ -595,13 +595,14 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                                         aSequence);
     break;
   case VISU::TSCALARMAPONDEFORMEDSHAPE: // Scalar map on deformed shape
-    GeneratePresentations<ScalarMapOnDeformedShape_i>(myStudy,
-                                                     aData,
-                                                     aResult,
-                                                     isRangeDefined(),
-                                                     myTimeMinVal,
-                                                     myTimeMaxVal,
-                                                     aSequence);
+  case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+    GeneratePresentations<DeformedShapeAndScalarMap_i>(myStudy,
+                                                      aData,
+                                                      aResult,
+                                                      isRangeDefined(),
+                                                      myTimeMinVal,
+                                                      myTimeMaxVal,
+                                                      aSequence);
     break;
   default:
     MESSAGE("Not implemented for this presentation type: " << aData.myPrsType);
@@ -1668,7 +1669,8 @@ std::string GetPresentationComment (VISU::VISUType thePrsType)
     aPrsCmt = VISU::GaussPoints_i::myComment;
     break;
   case VISU::TSCALARMAPONDEFORMEDSHAPE:
-    aPrsCmt = VISU::ScalarMapOnDeformedShape_i::myComment;
+  case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+    aPrsCmt = VISU::DeformedShapeAndScalarMap_i::myComment;
     break;
   default:
     aPrsCmt = "Unknown presentation";
@@ -1872,8 +1874,8 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
       aData.myPrsType = VISU::TSTREAMLINES;
     else if (strName == VISU::GaussPoints_i::myComment.c_str())
       aData.myPrsType = VISU::TGAUSSPOINTS;
-    else if (strName == VISU::ScalarMapOnDeformedShape_i::myComment.c_str())
-      aData.myPrsType = VISU::TSCALARMAPONDEFORMEDSHAPE;
+    else if (strName == VISU::DeformedShapeAndScalarMap_i::myComment.c_str())
+      aData.myPrsType = VISU::TDEFORMEDSHAPEANDSCALARMAP;
     else
       continue;
     generatePresentations(getNbFields()-1);
index 065953e87af5bff4e79a8d9820dceddab4fe6bb8..e39769ddbb6d3539a2b25a939a852580d819a1ff 100644 (file)
@@ -2378,7 +2378,8 @@ namespace VISU {
          VISU::VISUType aType = myPrs->GetType();
          if (aType != VISU::TSCALARMAP &&
              aType != VISU::TDEFORMEDSHAPE &&
-             aType != VISU::TSCALARMAPONDEFORMEDSHAPE) {
+             aType != VISU::TSCALARMAPONDEFORMEDSHAPE &&
+             aType != VISU::TDEFORMEDSHAPEANDSCALARMAP) {
            myResult = "Insideframe representation is not available for this type of presentations.";
            return;
          }
index 159ebdf4ccf6041fde62b92b99e960e284491bc7..a9e97fc3505292b784857737d3934d0edcff0e2f 100644 (file)
@@ -100,7 +100,7 @@ cutplanes.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
 myView.DisplayOnly(cutplanes)
 
 print "Creating Scalar Map On Deformed Shape.......",
-scalarmapondefshape = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
+scalarmapondefshape = myVisu.DeformedShapeAndScalarMapOnField(myResult,myMeshName,myNodeEntity,'vitesse',1);
 if scalarmapondefshape is None : print "Error"
 else : print "OK"
 scalarmapondefshape.SetScalarField(myCellEntity,'pression',2);
@@ -158,7 +158,7 @@ cutplanes1.SetOrientation(VISU.CutPlanes.YZ, 0, 0)
 myView1.DisplayOnly(cutplanes1)
 
 print "Creating Scalar Map On Deformed Shape.......",
-scalarmapondefshape1 = myVisu.ScalarMapOnDeformedShapeOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
+scalarmapondefshape1 = myVisu.DeformedShapeAndScalarMapOnField(myResult1,myMeshName1,myCellEntity,'vectoriel field',1);
 if scalarmapondefshape1 is None : print "Error"
 else : print "OK"
 myView1.DisplayOnly(scalarmapondefshape1)
index c676ddf52874271222db35960ae837665f3b324c..600f3225432d568536831acbc0a35c38f834f03a 100644 (file)
@@ -144,7 +144,7 @@ scmap = myVisu.CutPlanesOnField(myResult,myMeshName,VISU.NODE,myFieldName,1);
 ChangeRepresentation(scmap, VISU.SHADED, 1, 1, 0.5, 3)
 
 print "Creating Scalar Map On Deformed Shape.......",
-scmap = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,VISU.NODE,myFieldName,1);
+scmap = myVisu.DeformedShapeAndScalarMapOnField(myResult,myMeshName,VISU.NODE,myFieldName,1);
 ChangeRepresentation(scmap, VISU.SHADED, 1, 1, 0.5, 3)
 
 print "Creating Deformed Shape.......",
index abc7e83197cc036442c82040d16e0a29d3f5c32d..f9df33258893e3f089cb2a19cb96cba9ffe68423 100644 (file)
@@ -628,15 +628,15 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi
                                         else :
                                             aVISUObjList.append(aPrsObj)
 
-                                if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) :
-                                    print "          Creating ScalarMapOnDeformedShapeOnField",
-                                    aPrsObj = theVisu.ScalarMapOnDeformedShapeOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
+                                if HasValue(thePrsTypeList,VISU.TSCALARMAPONDEFORMEDSHAPE) or HasValue(thePrsTypeList,VISU.TDEFORMEDSHAPEANDSCALARMAP) :
+                                    print "          Creating DeformedShapeAndScalarMapOnField",
+                                    aPrsObj = theVisu.DeformedShapeAndScalarMapOnField(theResult,aMeshName,anEntity,aFieldName,aTimeStampId)
                                     if aPrsObj is None : print "Error"
                                     else :
                                         print ",OK"
                                         theView.DisplayOnly(aPrsObj)
                                         theView.FitAll()
-                                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TSCALARMAPONDEFORMEDSHAPE." + thePictureExt
+                                        aPictureName = thePictureDir + aMeshNamePic + "_" + anEntityId + "_" + aFieldName + "_" + str(aTimeStampId) + "_TDEFORMEDSHAPEANDSCALARMAP." + thePictureExt
                                         aPictureName = re.sub("\s+","_", aPictureName)
                                         theView.SavePicture(aPictureName)
                                         if theIsAutoDelete :
index bdd01bde5bc203a74da671c7165c3ab964c23562..d30ad9d5d4f94eca2b2126e0c22a77db55bef807 100644 (file)
@@ -56,6 +56,7 @@ PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPE)
 PRS3D_TYPE_LIST.append(VISU.TVECTORS)
 PRS3D_TYPE_LIST.append(VISU.TSTREAMLINES)
 PRS3D_TYPE_LIST.append(VISU.TSCALARMAPONDEFORMEDSHAPE)
+PRS3D_TYPE_LIST.append(VISU.TDEFORMEDSHAPEANDSCALARMAP)
 
 
 #---------------------------------------------------------------
@@ -83,4 +84,4 @@ anInput.myEntity = VISU.CELL;
 anInput.myFieldName = "pression";
 WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
 
-#execfile('/data/apo/a.py')
\ No newline at end of file
+#execfile('/data/apo/a.py')