]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev_08Jul08) before_mergefrom_V4_1_0_maintainance_29Jul08 mergefrom_V4_1_0_maintainance_08Jul08
authorvsr <vsr@opencascade.com>
Fri, 25 Jul 2008 12:25:54 +0000 (12:25 +0000)
committervsr <vsr@opencascade.com>
Fri, 25 Jul 2008 12:25:54 +0000 (12:25 +0000)
182 files changed:
doc/salome/gui/VISU/images/cutplanes.png
doc/salome/gui/VISU/images/deformedshape.png
doc/salome/gui/VISU/images/smds1.png
doc/salome/gui/VISU/images/table.png [new file with mode: 0644]
doc/salome/gui/VISU/images/table3d.png [new file with mode: 0644]
doc/salome/gui/VISU/images/tablesn1.png [new file with mode: 0644]
doc/salome/gui/VISU/images/tablesn2.png [new file with mode: 0644]
doc/salome/gui/VISU/input/calar_map_on_deformed_shape.doc
doc/salome/gui/VISU/input/cut_planes.doc
doc/salome/gui/VISU/input/index.doc
doc/salome/gui/VISU/input/table_3d.doc [new file with mode: 0644]
doc/salome/gui/VISU/input/table_presentations.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/CONVERTOR/Makefile.am
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_AppendFilter.cxx
src/CONVERTOR/VISU_AppendFilterUtilities.cxx
src/CONVERTOR/VISU_ConvertorUtils.cxx
src/CONVERTOR/VISU_ConvertorUtils.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/CONVERTOR/VISU_ElnoMeshValue.hxx [new file with mode: 0644]
src/CONVERTOR/VISU_IDMapper.cxx
src/CONVERTOR/VISU_IDMapper.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.hxx
src/CONVERTOR/VISU_MergeFilterUtilities.cxx
src/CONVERTOR/VISU_MeshValue.cxx
src/CONVERTOR/VISU_MeshValue.hxx
src/CONVERTOR/VISU_Structures.hxx
src/CONVERTOR/VISU_Structures_impl.cxx
src/CONVERTOR/VISU_Structures_impl.hxx
src/CONVERTOR/VISU_TypeList.hxx
src/CONVERTOR/VISU_VTKTypeList.hxx [new file with mode: 0644]
src/ENGINE/VISU_Engine_i.cc
src/ENGINE/VISU_Engine_i.hh
src/OBJECT/Makefile.am
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_ActorBase.cxx
src/OBJECT/VISU_ActorBase.h
src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsAct.h
src/OBJECT/VISU_GaussPtsSettings.cxx
src/OBJECT/VISU_GaussPtsSettings.h
src/OBJECT/VISU_IsoSurfActor.cxx [new file with mode: 0644]
src/OBJECT/VISU_IsoSurfActor.h [new file with mode: 0644]
src/OBJECT/VISU_PointMap3dActor.cxx
src/OBJECT/VISU_VectorsAct.cxx
src/PIPELINE/Makefile.am
src/PIPELINE/VISUPipeLine.cxx
src/PIPELINE/VISU_ColoredPL.cxx
src/PIPELINE/VISU_CutLinesPL.cxx
src/PIPELINE/VISU_CutLinesPL.hxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_CutPlanesPL.hxx
src/PIPELINE/VISU_DataSetMapperHolder.cxx
src/PIPELINE/VISU_DataSetMapperHolder.hxx
src/PIPELINE/VISU_DeformationPL.cxx [new file with mode: 0755]
src/PIPELINE/VISU_DeformationPL.hxx [new file with mode: 0755]
src/PIPELINE/VISU_DeformedGridPL.cxx
src/PIPELINE/VISU_DeformedGridPL.hxx
src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx [new file with mode: 0644]
src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.hxx [new file with mode: 0644]
src/PIPELINE/VISU_DeformedShapePL.cxx
src/PIPELINE/VISU_DeformedShapePL.hxx
src/PIPELINE/VISU_ElnoAssembleFilter.cxx [new file with mode: 0644]
src/PIPELINE/VISU_ElnoAssembleFilter.hxx [new file with mode: 0644]
src/PIPELINE/VISU_ElnoDisassembleFilter.cxx [new file with mode: 0644]
src/PIPELINE/VISU_ElnoDisassembleFilter.hxx [new file with mode: 0644]
src/PIPELINE/VISU_Extractor.cxx
src/PIPELINE/VISU_IsoSurfacesPL.cxx
src/PIPELINE/VISU_IsoSurfacesPL.hxx
src/PIPELINE/VISU_LabelPointsFilter.cxx [new file with mode: 0644]
src/PIPELINE/VISU_LabelPointsFilter.hxx [new file with mode: 0644]
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx
src/PIPELINE/VISU_OptionalDeformationPL.cxx [new file with mode: 0755]
src/PIPELINE/VISU_OptionalDeformationPL.hxx [new file with mode: 0755]
src/PIPELINE/VISU_PipeLineUtils.cxx
src/PIPELINE/VISU_Plot3DPL.cxx
src/PIPELINE/VISU_Plot3DPL.hxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx [deleted file]
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx [deleted file]
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_ScalarMapPL.hxx
src/PIPELINE/VISU_VectorsPL.cxx
src/PIPELINE/VISU_VectorsPL.hxx
src/VISUGUI/Makefile.am
src/VISUGUI/VISU_msg_en.ts
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_ActionsDef.h
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.h
src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx [new file with mode: 0644]
src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h [new file with mode: 0644]
src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_DeformedShapeDlg.h
src/VISUGUI/VisuGUI_Displayer.cxx
src/VISUGUI/VisuGUI_GaussPointsDlg.cxx
src/VISUGUI/VisuGUI_GaussPointsDlg.h
src/VISUGUI/VisuGUI_InputPane.cxx
src/VISUGUI/VisuGUI_InputPane.h
src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx
src/VISUGUI/VisuGUI_IsoSurfacesDlg.h
src/VISUGUI/VisuGUI_OffsetDlg.cxx
src/VISUGUI/VisuGUI_OffsetDlg.h
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_PopupTools.cxx
src/VISUGUI/VisuGUI_Prs3dDlg.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx [deleted file]
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h [deleted file]
src/VISUGUI/VisuGUI_Selection.cxx
src/VISUGUI/VisuGUI_Table3dDlg.cxx
src/VISUGUI/VisuGUI_Table3dDlg.h
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_TimeAnimation.h
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_Tools.h
src/VISUGUI/VisuGUI_TransparencyDlg.cxx
src/VISUGUI/VisuGUI_VectorsDlg.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_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_CutPlanes_i.hh
src/VISU_I/VISU_Deformation_i.cc [new file with mode: 0755]
src/VISU_I/VISU_Deformation_i.hh [new file with mode: 0755]
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_DeformedShape_i.cc
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_GaussPoints_i.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_IsoSurfaces_i.cc
src/VISU_I/VISU_IsoSurfaces_i.hh
src/VISU_I/VISU_MonoColorPrs_i.cc [new file with mode: 0644]
src/VISU_I/VISU_MonoColorPrs_i.hh [new file with mode: 0644]
src/VISU_I/VISU_OptionalDeformation_i.cc [new file with mode: 0755]
src/VISU_I/VISU_OptionalDeformation_i.hh [new file with mode: 0755]
src/VISU_I/VISU_PointMap3d_i.cc
src/VISU_I/VISU_PointMap3d_i.hh
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc [deleted file]
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh [deleted file]
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_StreamLines_i.hh
src/VISU_I/VISU_Table_i.cc
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.h
src/VISU_I/VISU_Vectors_i.cc
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
src/VISU_SWIG/visu_pointmap3d.py [new file with mode: 0755]
src/VVTK/VVTK_ImageWriter.cxx
src/VVTK/VVTK_ImageWriterMgr.cxx
src/VVTK/VVTK_PickingDlg.cxx
src/VVTK/VVTK_Recorder.cxx

index 579332ac1636616bb0d23db7a3cee842c1f08c98..03f972aa4fbe7195d375de55b126b8379fd5d4ec 100644 (file)
Binary files a/doc/salome/gui/VISU/images/cutplanes.png and b/doc/salome/gui/VISU/images/cutplanes.png differ
index aea062713810177aa42c006703c59dd0357a5ed6..e196d395833d09ce64aa04563b5490e227cecd30 100644 (file)
Binary files a/doc/salome/gui/VISU/images/deformedshape.png and b/doc/salome/gui/VISU/images/deformedshape.png differ
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
diff --git a/doc/salome/gui/VISU/images/table.png b/doc/salome/gui/VISU/images/table.png
new file mode 100644 (file)
index 0000000..473aeff
Binary files /dev/null and b/doc/salome/gui/VISU/images/table.png differ
diff --git a/doc/salome/gui/VISU/images/table3d.png b/doc/salome/gui/VISU/images/table3d.png
new file mode 100644 (file)
index 0000000..1b19990
Binary files /dev/null and b/doc/salome/gui/VISU/images/table3d.png differ
diff --git a/doc/salome/gui/VISU/images/tablesn1.png b/doc/salome/gui/VISU/images/tablesn1.png
new file mode 100644 (file)
index 0000000..4db643e
Binary files /dev/null and b/doc/salome/gui/VISU/images/tablesn1.png differ
diff --git a/doc/salome/gui/VISU/images/tablesn2.png b/doc/salome/gui/VISU/images/tablesn2.png
new file mode 100644 (file)
index 0000000..4b3b85d
Binary files /dev/null and b/doc/salome/gui/VISU/images/tablesn2.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 bb60f1fc8fd09237a49c65640a9f8800d2f6ee5c..44e6f256679b89fb03babcd98b9289800119a0fc 100644 (file)
@@ -39,6 +39,10 @@ displacement of the planes into one or another side.</li>
 <li><b>Show preview</b> check box allows to edit the parameters of the
 presentation and simultaneously observe the preview of this
 presentation in the viewer.</li>
+<li><b>Deformation</b> allows to switch on/off deformation of the
+planes.</li>
+<li><b>Vectors</b> allows to choose a vectorial field for deformation.</li>
+<li><b>Scale Factor</b> allows to set the scaling ratio for all vector values.</li>
 </ul>
 </ul>
 
@@ -48,4 +52,4 @@ the viewer:
 
 \image html cutplpresent.png
 
-*/
\ No newline at end of file
+*/
index e82b2bc7b971a6be032a33d913a254c71f4ad420..402f3a699b4de22d7ff4cd70d51e052277f922b0 100644 (file)
@@ -51,6 +51,7 @@
 <li>\ref importing_exporting_tables_page</li>
 <li>\ref displaying_tables_page</li>
 <li>\ref creating_tables_from_cut_lines_page</li>
+<li>\ref table_3d_page</li>
 </ul>
 <li>\subpage xy_plots_page</li>
 <ul>
diff --git a/doc/salome/gui/VISU/input/table_3d.doc b/doc/salome/gui/VISU/input/table_3d.doc
new file mode 100644 (file)
index 0000000..15a36d2
--- /dev/null
@@ -0,0 +1,49 @@
+/*!
+
+\page table_3d_page Table 3D presentation
+
+\n <b>Table 3D</b> is a 3D graphic presentation of data contained in the table. 
+The relief and coloring of the resulting
+presentation both correspond to the values contained in the table. The values from the first column of the 
+table define X-axis. The values from the second to the last columns define Z-axis. Y increases with a fixed step starting from Y=0. 
+To successfully produce a Table 3D presentation, the table should not contain empty fields. 
+
+<em>To create a Table 3D presentation:</em>
+\par
+&ndash; Right-click on an XLS table in the
+Object browser and from the context menu choose <b>Show</b>, or <b>Show only</b>
+
+\image html table.png
+
+The table will be immediately displayed in the Viewer.
+
+Choose <b>Edit</b> in the context menu if you wish to change the layout of the presentation.
+
+\image html table3d.png
+
+\par
+<ul>
+<li><b>Scale Factor</b> - visualization scaling of all values of the table.</li>
+<li><b>Presentation type:</b></li>
+<ul>
+<li>\b Surface - Plot 3D will be represented with a smooth surface.</li>
+
+\image html tablesn2.png
+
+<li>\b Contour - Plot 3D will be represented with a set of contours.</li>
+
+\image html tablesn1.png
+
+</ul>
+<li><b>Number of contours</b> - allows to define the number of
+contours (active when Contour presentation type is selected).</li>
+<li> <b>Scalar Bar</b> tab allows to define the parameters of the scalar
+bar displayed with this presentation (\ref scalar_map_page "see also").</li>
+</ul>
+
+It is also possible to choose \b Wireframe or \b Shading \b Representation type, change
+such properties as \b Opacity and <b> Line Width </b> and <b> Translate </b> presentation from the context menu.  
+
+
+
+*/
\ No newline at end of file
index 9e6dc79fe1e6bacc0baab15238f125ef00ba4df4..3b28d878b2fb540fd2ddbf5aa796a57a46115ceb 100644 (file)
@@ -7,6 +7,7 @@
 <li>\subpage importing_exporting_tables_page</li>
 <li>\subpage displaying_tables_page</li>
 <li>\subpage creating_tables_from_cut_lines_page</li>
+<li>\subpage table_3d_page</li> 
 </ul>
 
 */
\ No newline at end of file
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 d1b5c73e13c5fdc0a90626c7e1a10bb826fd5fd7..36b383b44d12a5a7ae49749a10b484e99ea12a83 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 */
@@ -824,22 +825,12 @@ module VISU {
     long GetFaceLimit();
   };
 
-  /*! \brief Deformed shape presentation interface
+
+  /*! \brief MonoColor presentation presentation interface
    *
-   * Presentation parameters of the deformed shape presentation.
+   * Presentation parameters of the MonoColor presentation.
    */
-  interface DeformedShape : ScalarMap 
-  {
-    /*!
-     * Sets the scale of the presentatable object.
-     * \param theScale Double value defining the scale of this presentable object.
-     */
-    void SetScale(in double theScale);
-
-    /*!
-     * Gets the scale of the presentatable object.
-     */
-    double GetScale();
+  interface MonoColorPrs : ScalarMap {
 
     /*! This boolean method returns True if this deformed shape presentation is colored.
      */
@@ -864,12 +855,87 @@ module VISU {
   };
 
 
+  /*! \brief Deformed shape presentation interface
+   *
+   * Presentation parameters of the deformed shape presentation.
+   */
+  interface DeformedShape : MonoColorPrs 
+  {
+    /*!
+     * Sets the scale of the presentatable object.
+     * \param theScale Double value defining the scale of this presentable object.
+     */
+    void SetScale(in double theScale);
+
+    /*!
+     * Gets the scale of the presentatable object.
+     */
+    double GetScale();
+
+  };
+
+  //-------------------------------------------------------
+  /*! \brief Deformation interface
+   *
+   * This is base interface for building of the deformed presentations
+   */
+  interface Deformation{
+    /*!
+     * Sets the scale of the presentatable object.
+     * \param theScale Double value defining the scale of this presentable object.
+     */
+    void SetScale(in double theScale);
+
+    /*!
+     * Gets the scale of the presentatable object.
+     */
+    double GetScale();
+
+    /*!
+     * Sets the vectorial field
+     * \param theEntity    - entity of vectorial field
+     * \param theFieldName - the name of vectorial field
+     */
+    void SetVectorialField(in Entity theEntity,
+                          in string theFieldName);
+
+    /*!
+     * Get vectorial entity
+     */
+    Entity GetVectorialFieldEntity();
+
+    /*!
+     * Get scalar field name
+     */
+    string GetVectorialFieldName();
+    
+  };
+
+  //-------------------------------------------------------
+  /*! \brief OptionalDeformation interface
+   *
+   * This is interface for switch on/off of the deformation of the presentation
+   */
+  interface OptionalDeformation : Deformation{
+
+    /*!
+     * Sets the deformation flag of the presentatable object.
+     * \param theFlag Boolean value defining the deformation flag of this presentable object.
+     */
+    void UseDeformation(in boolean theFlag);
+
+    /*!
+     * Gets the deformation flag of the presentatable object.
+     */
+    boolean IsDeformed();
+  };
+
   //-------------------------------------------------------
   /*! \brief Scalar Map on Deformed shape presentation interface
    *
    * Presentation parameters of the scalar map on deformed shape presentation.
    */
-  interface ScalarMapOnDeformedShape : ScalarMap {
+  interface DeformedShapeAndScalarMap : ScalarMap {
     
     /*!
      * Sets the scale of the presentatable object.
@@ -1079,7 +1145,7 @@ module VISU {
    * consists of cutting your initial mesh by a definite number of planes. As the
    * result you will see these planes which will be cutted by the borders of the mesh.
    */
-  interface CutPlanes : ScalarMap {
+  interface CutPlanes : ScalarMap, OptionalDeformation {
     /*!
      * This enumeration contains a set of elements defining the type of orientation in 3D space
      * of the cut planes.
@@ -1342,7 +1408,7 @@ module VISU {
    * Streamlines are used to convey the structure of a vector field.
    * Usually streamlines are created to explore the most interesting features in the field.
    */
-  interface StreamLines : DeformedShape {
+  interface StreamLines : MonoColorPrs {
     /*! This enumerations contains a set of elements necessary
      * for definition of direction of the stream lines.
      */
@@ -1412,7 +1478,7 @@ module VISU {
    * values on the cells and on the basis of them constructs
    * isobaric surfaces, which form this presentation.
    */
-  interface IsoSurfaces : ScalarMap {
+  interface IsoSurfaces : MonoColorPrs {
     /*!
      * Sets the number of isometric surfaces.
      * \param theNb A long value defining the number of isometric surfaces
@@ -1424,6 +1490,22 @@ module VISU {
      * Gets the number of isometric surfaces
      */
     long GetNbSurfaces();
+
+    /*!
+     * Returns TRUE if labels with values are shown
+     */
+    boolean IsLabeled();
+
+    /*!
+     * Set show or not value labels
+     */
+    void ShowLabels(in boolean theShow, in long theNb);
+
+    /*!
+     * Returns Nb of labels per surface
+     */
+   long GetNbLabels();
+
   };
 
   //-------------------------------------------------------
@@ -1986,6 +2068,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)
@@ -1994,9 +2088,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 1f377fb6da401c5a003096015c753739cdcefa04..3953664f9f38c7c85d63d848549c07fe7892a0eb 100644 (file)
@@ -28,6 +28,7 @@ lib_LTLIBRARIES = libVisuConvertor.la
 
 salomeinclude_HEADERS= \
        VISU_TypeList.hxx \
+       VISU_VTKTypeList.hxx \
        VISU_IDMapper.hxx \
        VISU_ConvertorDef.hxx \
        VISU_Structures.hxx \
@@ -35,6 +36,7 @@ salomeinclude_HEADERS= \
        VISU_ConvertorDef_impl.hxx \
        VISU_Structures_impl.hxx \
        VISU_MeshValue.hxx \
+       VISU_ElnoMeshValue.hxx \
        VISU_PointCoords.hxx \
        VISU_Convertor_impl.hxx \
        VISU_ConvertorUtils.hxx \
index db268df79aab3bd7c85ab48832ee7b418c14118c..c2b748e2fcbd7475aa5bfd9d9ac1d095fb877553 100644 (file)
@@ -42,6 +42,8 @@
 #include <QStringList>
 
 
+#include "utilities.h"
+
 using namespace std;
 
 #ifdef DEBUG
@@ -102,7 +104,7 @@ void ParseMEDFile(const char* theFileName)
              vtkDataSet* aDataSet = aGaussMesh->GetOutput();
              aDataSet->Update();
              int aNbCells = aDataSet->GetNumberOfCells();
-             cout<<"aNbCells = "<<aNbCells<<endl;
+             MESSAGE("aNbCells = "<<aNbCells);
              for(int anCellId = 0; anCellId < aNbCells; anCellId++){
                VISU::TGaussPointID anObjID = aGaussMesh->GetObjID(anCellId);
                cout<<anObjID.first<<"; "<<anObjID.second<<"; "<<aGaussMesh->GetNodeVTKID(anObjID.first)<<endl;
@@ -152,7 +154,7 @@ void ParseMEDFile(const char* theFileName)
        for(anCellId = 0; anCellId < aNbCells; anCellId++){
          anObjID = anIDMapper->GetElemObjID(anCellId);
          aVTKID  = anIDMapper->GetElemVTKID(anObjID);
-         cout<<anObjID<<"; "<<aVTKID<<endl;
+         MESSAGE(anObjID<<"; "<<aVTKID);
        }
 #endif
       }
index 604e38c161ddf702fedc321647b4642103afdc0e..c605d563f6357717514c2037295530963375162f 100644 (file)
@@ -56,14 +56,14 @@ VISU_AppendFilter
              vtkInformationVector *theOutputVector)
 {
   bool anIsExecuted = false;
-  if(GetNumberOfInputConnections(0) > 1 || IsMergingInputs() || IsMappingInputs())
+  if( IsMergingInputs() || IsMappingInputs() )
     anIsExecuted = VISU::UnstructuredGridRequestData(theInputVector,
-                                                    this->GetNumberOfInputConnections(0),
+                                                    GetNumberOfInputConnections( 0 ),
                                                     theOutputVector,
                                                     GetSharedPointSet(),
                                                     IsMergingInputs(),
                                                     IsMappingInputs());
-  if(!anIsExecuted)
+  if( !anIsExecuted )
     anIsExecuted = Superclass::RequestData(theRequest,
                                           theInputVector,
                                           theOutputVector);
index 3294684d233aeda763976d472402944b807608ff..4ff6233c2506328f50aa558ecbb949731d724d8a 100644 (file)
@@ -191,14 +191,33 @@ namespace
              bool theIsMergingInputs,
              bool theIsMappingInputs)
   {
-    if(theSharedPointSet){
+    if ( theNumberOfInputConnections == 1 ) {
+      // get the input and ouptut
+      vtkDataSet *anInput = VISU::GetInput( theInputVector, 0 );
+      vtkDataSet* anOutput = VISU::GetOutput( theOutputVector );
+
+      if ( anInput->GetDataObjectType() != anOutput->GetDataObjectType() )
+       return false;
+
+      // This has to be here because it initialized all field datas.
+      anOutput->CopyStructure( anInput );
+  
+      // Pass all. (data object's field data is passed by the
+      // superclass after this method)
+      anOutput->GetPointData()->PassData( anInput->GetPointData() );
+      anOutput->GetCellData()->PassData( anInput->GetCellData() );
+      
+      return true;
+    }
+
+    if ( theSharedPointSet ) {
       vtkPoints* aPoints = theSharedPointSet->GetPoints();
       if(aPoints->GetNumberOfPoints() < 1)
        return true;
   
       TDataSet* anOutput = TDataSet::SafeDownCast(VISU::GetOutput(theOutputVector));
       vtkIdType anNbInputs = theNumberOfInputConnections;
-      if(theIsMergingInputs){
+      if ( theIsMergingInputs ) {
        TCellIdMerger aFunctor(anNbInputs);
        ForEachInput<TCellIdMerger>(theInputVector, anNbInputs, aFunctor);
 
index a4cee79f990bb82bfbe4b74009b62b613584c184..9a2dd969199a7b88c0a008bcad139076e624a9f5 100644 (file)
@@ -233,6 +233,23 @@ namespace VISU
     return aDataSetAttributes->GetArray("VISU_FIELD") != NULL;
   }
 
+  //---------------------------------------------------------------
+  bool 
+  IsElnoData(vtkDataSet* theDataSet)
+  {
+    theDataSet->Update();
+
+    if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData() )
+      if ( aDataSetAttributes->GetArray( "ELNO_FIELD" )  != NULL )
+       return true;
+
+    if ( vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData() )
+      if ( aDataSetAttributes->GetArray( "ELNO_POINT_COORDS" )  != NULL )
+       return true;
+
+    return false;
+  }
+
 
   //---------------------------------------------------------------
   vtkIdType
index 17c12fde39f9c1dfdb3cb15dd70ded4ef90a7a20..2c1bff9222b259fe7fdef61d2c8ab81273306a56 100644 (file)
@@ -90,6 +90,11 @@ namespace VISU
   bool 
   IsDataOnCells(vtkDataSet* theDataSet);
 
+  //---------------------------------------------------------------
+  VISU_CONVERTOR_EXPORT
+  bool 
+  IsElnoData(vtkDataSet* theDataSet);
+
 
   //---------------------------------------------------------------
   VISU_CONVERTOR_EXPORT
index 0e8a49a140db0f1be919be26b5bafd184df0d17e..e35b3626d2b4597ab2b7c1821dddf03edad3afbc 100644 (file)
@@ -82,18 +82,12 @@ namespace
 
 
   //---------------------------------------------------------------
+  inline
   void
-  PrintCells(int& theStartId,
-            vtkCellArray* theConnectivity, 
-            const VISU::TConnect& theVector)
+  PrintCells( vtkCellArray* theConnectivity, 
+             const VISU::TConnect& theVector)
   {
-    vtkIdList *anIdList = vtkIdList::New();
-    int kEnd = theVector.size();
-    anIdList->SetNumberOfIds(kEnd);
-    for(int k = 0; k < kEnd; k++)
-      anIdList->SetId(k,theVector[k]);
-    theConnectivity->InsertNextCell(anIdList);
-    anIdList->Delete();
+    theConnectivity->InsertNextCell( theVector.size(), &theVector[ 0 ] );
   }
 
 
@@ -121,7 +115,7 @@ namespace
     aCellTypesArray->SetNumberOfTuples(aNbCells);
 
     for(vtkIdType anID = 0; anID < aNbCells; anID++){
-      PrintCells(anID,aConnectivity,anArray[anID]);
+      PrintCells( aConnectivity, anArray[ anID ] );
       aCellTypesArray->SetValue(anID,(unsigned char)theGeom);
     }
 
@@ -216,7 +210,7 @@ namespace
       VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
       for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, aCellId++){
        vtkIdType anID = *aSubMeshIDIter;
-       PrintCells(aCellId, aConnectivity, anArray[anID]);
+       PrintCells( aConnectivity, anArray[ anID ] );
        aCellTypesArray->SetValue(aCellId, (unsigned char)aVGeom);
        vtkIdType anObjID = aSubMesh.GetElemObjID(anID);
        anElemObj2VTKID[anObjID] = aCellId;
@@ -281,7 +275,7 @@ namespace
       VISU::TCell2Connect::const_iterator anIter = aCell2Connect.begin();
       for(vtkIdType anId = 0, aConnId = 0; anIter != aCell2Connect.end(); anIter++){
        const VISU::TConnect& anArray = aCell2Connect[anId];
-       PrintCells(aConnId,aConnectivity,anArray);
+       PrintCells( aConnectivity, anArray );
        aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
        aConnId += aNbNodes;
        anId++;
@@ -291,7 +285,7 @@ namespace
       for(vtkIdType anId = 0, aConnId = 0; anIter != aSubMeshID.end(); anIter++){
        vtkIdType aSubId = *anIter;
        const VISU::TConnect& anArray = aCell2Connect[aSubId];
-       PrintCells(aConnId,aConnectivity,anArray);
+       PrintCells( aConnectivity, anArray );
        aCellTypesArray->SetValue(anId,(unsigned char)aVGeom);
        aConnId += aNbNodes;
        anId++;
@@ -844,81 +838,63 @@ VISU_Convertor_impl
 //---------------------------------------------------------------
 vtkUnstructuredGrid*
 VISU_Convertor_impl
-::GetTimeStampOnProfile(const VISU::PMeshImpl& theMesh,
-                       const VISU::PMeshOnEntityImpl& theMeshOnEntity,
-                       const VISU::PFieldImpl& theField,
-                       const VISU::PValForTimeImpl& theValForTime,
-                       const VISU::PUnstructuredGridIDMapperImpl& theUnstructuredGridIDMapper,
-                       const VISU::PProfileImpl& theProfile,
-                       const VISU::TEntity& theEntity)
+::GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh,
+                        const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+                        const VISU::PFieldImpl& theField,
+                        const VISU::PValForTimeImpl& theValForTime,
+                        const VISU::PUnstructuredGridIDMapperImpl& theUnstructuredGridIDMapper,
+                        const VISU::PProfileImpl& theProfile,
+                        const VISU::TEntity& theEntity )
 {
-  vtkUnstructuredGrid* anOutput = NULL;
-  
-  LoadMeshOnEntity(theMesh, theMeshOnEntity);
-  GetMeshOnEntity(theMeshOnEntity->myMeshName, theMeshOnEntity->myEntity);
-  GetMeshOnProfile(theMesh, theMeshOnEntity, theProfile);
-  
-  bool isNeedInCells = false;
+  LoadMeshOnEntity( theMesh, theMeshOnEntity );
+  GetMeshOnEntity( theMeshOnEntity->myMeshName, theMeshOnEntity->myEntity );
+  GetMeshOnProfile( theMesh, theMeshOnEntity, theProfile );
   
   theUnstructuredGridIDMapper->myIDMapper = theProfile;
-  if(theMeshOnEntity->myEntity == VISU::NODE_ENTITY){
+
+  if ( theMeshOnEntity->myEntity == VISU::NODE_ENTITY ) {
     // add geometry elements to output,
     // if timestamp on NODE_ENTITY and
     // on profiles with status eAddPart
-    VISU::TGeom2SubProfile::const_iterator anIter = theProfile->myGeom2SubProfile.begin();
-    for(; anIter != (theProfile->myGeom2SubProfile).end(); anIter++){
-      const VISU::EGeometry aGeom = anIter->first;
-      const VISU::PSubProfileImpl aSubProfile = anIter->second;
-      if(aSubProfile->myStatus == VISU::eAddPart && aGeom == VISU::ePOINT1){
-       isNeedInCells = true;
-       break;
+    const VISU::TGeom2SubProfile& aGeom2SubProfile = theProfile->myGeom2SubProfile;
+    VISU::TGeom2SubProfile::const_iterator aSubProfileIter = aGeom2SubProfile.begin();
+    for ( ; aSubProfileIter != aGeom2SubProfile.end(); aSubProfileIter++ ) {
+      const VISU::EGeometry& aGeom = aSubProfileIter->first;
+      const VISU::PSubProfileImpl& aSubProfile = aSubProfileIter->second;
+      if ( aSubProfile->myStatus == VISU::eAddPart && aGeom == VISU::ePOINT1 ) {
+       const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
+       VISU::TMeshOnEntityMap::const_reverse_iterator aMeshOnEntityIter = aMeshOnEntityMap.rbegin();
+       for( ; aMeshOnEntityIter != aMeshOnEntityMap.rend(); aMeshOnEntityIter++ ) {
+         VISU::TEntity anEntity = aMeshOnEntityIter->first;
+         if ( anEntity == VISU::NODE_ENTITY )
+           continue;
+         VISU::PNamedIDMapper aNamedIDMapper = GetMeshOnEntity( theMesh->myName, anEntity );
+         if( aNamedIDMapper ) {
+           theUnstructuredGridIDMapper->SetReferencedMesh( aNamedIDMapper );
+           VISU::PUnstructuredGrid aSource = theUnstructuredGridIDMapper->GetSource();
+           VISU::GetTimeStampOnProfile( aSource, theField, theValForTime, theEntity );
+           
+           return theUnstructuredGridIDMapper->GetUnstructuredGridOutput();
+         }
+       }
       }
     }
-    if(isNeedInCells){
-      theUnstructuredGridIDMapper->myIsSpecialKey = true;
-      GetTimeStampOnNodalProfile(theMesh,theUnstructuredGridIDMapper,theField,theValForTime,theEntity);
-      anOutput = theUnstructuredGridIDMapper->GetUnstructuredGridOutput();
-    }
   }
-  if(!isNeedInCells){
-    vtkUnstructuredGrid* anOutput = theUnstructuredGridIDMapper->GetUnstructuredGridOutput();
-    const VISU::PUnstructuredGrid& aSource = theUnstructuredGridIDMapper->mySource.GetSource();
-    VISU::GetTimeStampOnProfile(aSource, theField, theValForTime, theEntity);
-  }
-  return anOutput;
-}
 
-void
-VISU_Convertor_impl
-::GetTimeStampOnNodalProfile(const VISU::PMeshImpl& theMesh,
-                             const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
-                             const VISU::PFieldImpl& theField, 
-                             const VISU::PValForTimeImpl& theValForTime,
-                             const VISU::TEntity& theEntity)
-{
-  const VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
-  VISU::TMeshOnEntityMap::const_iterator aIter = aMeshOnEntityMap.begin();
-  for(;aIter!=aMeshOnEntityMap.end();aIter++){
-    VISU::TEntity aEntity = aIter->first;
-    if(aEntity != VISU::NODE_ENTITY){
-      VISU::PNamedIDMapper aMapper = GetMeshOnEntity(theMesh->myName,aEntity);
-      if(aMapper)
-        theIDMapperFilter->myMappers[aEntity] = aMapper;
-    }
-  }
+  VISU::PUnstructuredGrid aSource = theUnstructuredGridIDMapper->GetSource();
+  VISU::GetTimeStampOnProfile( aSource, theField, theValForTime, theEntity );
 
-  theIDMapperFilter->GetUnstructuredGridOutput();
-  const VISU::PUnstructuredGrid& aSource = theIDMapperFilter->mySource.GetSource();
-  VISU::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+  return theUnstructuredGridIDMapper->GetUnstructuredGridOutput();
 }
 
+
 //---------------------------------------------------------------
 VISU::PUnstructuredGridIDMapper 
 VISU_Convertor_impl
-::GetTimeStampOnMesh(const std::string& theMeshName, 
-                    const VISU::TEntity& theEntity,
-                    const std::string& theFieldName,
-                    int theStampsNum)
+::GetTimeStampOnMesh( const std::string& theMeshName, 
+                     const VISU::TEntity& theEntity,
+                     const std::string& theFieldName,
+                     int theStampsNum )
 {
   INITMSG(MYDEBUG,"GetTimeStampOnMesh"<<
          "; theMeshName = '"<<theMeshName<<"'"<<
@@ -1055,9 +1031,9 @@ VISU_Convertor_impl
 
       aGaussPtsIDFilter->myIDMapper = aGaussMesh;
       aGaussPtsIDFilter->myGaussPtsIDMapper = aGaussMesh;
-      vtkPolyData* anOutput = aGaussPtsIDFilter->GetPolyDataOutput();
-      const VISU::PPolyData& aSource = aGaussPtsIDFilter->mySource.GetSource();
+      VISU::PPolyData aSource = aGaussPtsIDFilter->GetSource();
       VISU::GetTimeStampOnGaussMesh(aSource, aField, aValForTime);
+      vtkPolyData* anOutput = aGaussPtsIDFilter->GetPolyDataOutput();
 
       aGaussPtsIDFilter->myIsVTKDone = true;
 
@@ -1357,29 +1333,29 @@ VISU_Convertor_impl
 
   VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
   VISU::PMeshOnEntityImpl aVTKMeshOnEntity = aMeshOnEntity;
-  if(theEntity == VISU::NODE_ENTITY){
-    if(aMeshOnEntityMap.find(VISU::CELL_ENTITY) != aMeshOnEntityMap.end())
-      aVTKMeshOnEntity = aMeshOnEntityMap[VISU::CELL_ENTITY];
-    else if(aMeshOnEntityMap.find(VISU::FACE_ENTITY) != aMeshOnEntityMap.end())
-      aVTKMeshOnEntity = aMeshOnEntityMap[VISU::FACE_ENTITY];
-    else if(aMeshOnEntityMap.find(VISU::EDGE_ENTITY) != aMeshOnEntityMap.end())
-      aVTKMeshOnEntity = aMeshOnEntityMap[VISU::EDGE_ENTITY];
-    else if(aMeshOnEntityMap.find(VISU::NODE_ENTITY) != aMeshOnEntityMap.end())
-      aVTKMeshOnEntity = aMeshOnEntityMap[VISU::NODE_ENTITY];
+  if ( theEntity == VISU::NODE_ENTITY ) {
+    if(aMeshOnEntityMap.find( VISU::CELL_ENTITY ) != aMeshOnEntityMap.end())
+      aVTKMeshOnEntity = aMeshOnEntityMap[ VISU::CELL_ENTITY ];
+    else if (aMeshOnEntityMap.find( VISU::FACE_ENTITY ) != aMeshOnEntityMap.end() )
+      aVTKMeshOnEntity = aMeshOnEntityMap[ VISU::FACE_ENTITY ];
+    else if (aMeshOnEntityMap.find( VISU::EDGE_ENTITY ) != aMeshOnEntityMap.end() )
+      aVTKMeshOnEntity = aMeshOnEntityMap[ VISU::EDGE_ENTITY ];
+    else if ( aMeshOnEntityMap.find( VISU::NODE_ENTITY ) != aMeshOnEntityMap.end() )
+      aVTKMeshOnEntity = aMeshOnEntityMap[ VISU::NODE_ENTITY ];
   }else
     aVTKMeshOnEntity = aMeshOnEntity;
   
   VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
-  VISU::TFieldMap::const_iterator aFieldIter= aFieldMap.find(theFieldName);
+  VISU::TFieldMap::const_iterator aFieldIter= aFieldMap.find( theFieldName );
   if(aFieldIter == aFieldMap.end())
     EXCEPTION(std::runtime_error,"FindField >> There is no field on the mesh!!!");
   
   VISU::PFieldImpl aField = aFieldIter->second;
 
-  return TFindField(aMesh,
-                   aMeshOnEntity,
-                   aVTKMeshOnEntity,
-                   aField);
+  return TFindField( aMesh,
+                    aMeshOnEntity,
+                    aVTKMeshOnEntity,
+                    aField );
 }
 
 
index f6cffc0e99736c3b61e37c867ef605327d311c19..14beaf5ea3af7c0c09fdff48fe3442ed2a38caae 100644 (file)
@@ -120,10 +120,10 @@ public:
   //! Implemention of the VISU_Convertor::GetTimeStampOnMesh
   virtual
   VISU::PUnstructuredGridIDMapper 
-  GetTimeStampOnMesh(const std::string& theMeshName, 
-                    const VISU::TEntity& theEntity,
-                    const std::string& theFieldName,
-                    int theTimeStampNumber);
+  GetTimeStampOnMesh( const std::string& theMeshName, 
+                     const VISU::TEntity& theEntity,
+                     const std::string& theFieldName,
+                     int theTimeStampNumber );
 
   //! Get amount of memory to build vtkDataSet for corresponding MED TIMESTAMP on mesh
   virtual 
@@ -206,9 +206,9 @@ protected:
                       VISU::PMeshOnEntityImpl,
                       VISU::PFieldImpl> TFindField;
   TFindField
-  FindField(const std::string& theMeshName, 
-           const VISU::TEntity& theEntity, 
-           const std::string& theFieldName);
+  FindField( const std::string& theMeshName, 
+            const VISU::TEntity& theEntity, 
+            const std::string& theFieldName );
 
   //! An utility method to find TTimeStamp by name of its parent mesh, corresponding entity, field name and its number
   typedef boost::tuple<VISU::PMeshImpl,
@@ -223,21 +223,14 @@ protected:
                int theStampsNum);
 
   vtkUnstructuredGrid*
-  GetTimeStampOnProfile(const VISU::PMeshImpl& theMesh,
-                       const VISU::PMeshOnEntityImpl& theMeshOnEntity,
-                       const VISU::PFieldImpl& theField,
-                       const VISU::PValForTimeImpl& theValForTime,
-                       const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
-                       const VISU::PProfileImpl& theProfile,
-                       const VISU::TEntity& theEntity);
-
-  void
-  GetTimeStampOnNodalProfile(const VISU::PMeshImpl& theMesh,
-                             const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
-                             const VISU::PFieldImpl& theField, 
-                             const VISU::PValForTimeImpl& theValForTime,
-                             const VISU::TEntity& theEntity);
-  
+  GetTimeStampOnProfile( const VISU::PMeshImpl& theMesh,
+                        const VISU::PMeshOnEntityImpl& theMeshOnEntity,
+                        const VISU::PFieldImpl& theField,
+                        const VISU::PValForTimeImpl& theValForTime,
+                        const VISU::PUnstructuredGridIDMapperImpl& theIDMapperFilter,
+                        const VISU::PProfileImpl& theProfile,
+                        const VISU::TEntity& theEntity );
+
 protected:
   //! Implemention of the VISU_Convertor::GetTimeStampSize
   virtual 
diff --git a/src/CONVERTOR/VISU_ElnoMeshValue.hxx b/src/CONVERTOR/VISU_ElnoMeshValue.hxx
new file mode 100644 (file)
index 0000000..42e4699
--- /dev/null
@@ -0,0 +1,162 @@
+//  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_ElnoMeshValue.hxx
+//  Author : Alexey PETROV
+//  Module : VISU
+
+#ifndef VISU_ElnoMeshValue_HeaderFile
+#define VISU_ElnoMeshValue_HeaderFile
+
+#include "VISU_VTKTypeList.hxx"
+#include <vtkDataSetAttributes.h>
+
+
+/*! 
+  \file VISU_ElnoMeshValue.hxx
+  \brief The file contains declarations for the acess to the specific ELNO MED data
+*/
+
+namespace VISU
+{
+  //---------------------------------------------------------------
+  template< int elno_type >
+  struct TGetElnoNodeData
+  {
+    typedef typename TL::TEnum2VTKArrayType< elno_type >::TResult TVTKDataArray;
+    typedef typename TL::TEnum2VTKBasicType< elno_type >::TResult TDataType;
+    TVTKDataArray *myElnoDataArray;
+    vtkIntArray *myElnoDataMapper;
+    int myElemInfo[3];
+
+
+    //----------------------------------------------------------------------------
+    TGetElnoNodeData( vtkDataArray *theElnoDataArray,
+                     vtkDataArray *theElnoDataMapper )
+      : myElnoDataArray( TVTKDataArray::SafeDownCast( theElnoDataArray ) )
+      , myElnoDataMapper( vtkIntArray::SafeDownCast( theElnoDataMapper ) )
+    {}
+
+
+    //----------------------------------------------------------------------------
+    TDataType*
+    operator () ( vtkIdType theCellId, vtkIdType theLocalPntId )
+    {
+      myElnoDataMapper->GetTupleValue( theCellId, myElemInfo );
+
+      vtkIdType aPos = myElemInfo[ 0 ] + theLocalPntId * myElemInfo[ 1 ];
+
+      return myElnoDataArray->GetPointer( aPos );
+    }
+
+
+    //----------------------------------------------------------------------------
+    int
+    getNbComp()
+    {
+      myElnoDataMapper->GetTupleValue( 0, myElemInfo );
+
+      return myElemInfo[ 1 ];
+    }
+  };
+
+
+  //----------------------------------------------------------------------------------------------
+  template< int elno_type >
+  struct TSetElnoNodeData
+  {
+    typedef typename TL::TEnum2VTKArrayType< elno_type >::TResult TVTKDataArray;
+    typedef typename TL::TEnum2VTKBasicType< elno_type >::TResult TDataType;
+
+    //----------------------------------------------------------------------------------------------
+    TSetElnoNodeData( vtkIdType theEffectNbComp,
+                     vtkIdType theRealNbComp,
+                     vtkIdType theNbTuples,
+                     const char* theDataArrayName,
+                     const char* theMapperArrayName )
+      : myElnoDataArray( TVTKDataArray::New() )
+      , myElnoDataMapper( vtkIntArray::New() )
+    {
+      myElnoDataArray->SetNumberOfComponents( theEffectNbComp );
+      myElnoDataArray->SetNumberOfTuples( theNbTuples );
+      myElnoDataArray->SetName( theDataArrayName );
+
+      myElnoDataMapper->SetNumberOfComponents( 3 );
+      myElnoDataMapper->Allocate( theNbTuples * 3 );
+      myElnoDataMapper->SetName( theMapperArrayName );
+
+      myElemInfo[ 0 ] = 0;
+      myElemInfo[ 1 ] = theRealNbComp;
+      myElemInfo[ 2 ] = 0;
+    }
+
+
+    //----------------------------------------------------------------------------------------------
+    ~TSetElnoNodeData()
+    {
+      myElnoDataArray->Delete();
+      myElnoDataMapper->Delete();
+    }
+
+
+    //----------------------------------------------------------------------------------------------
+    int
+    AddNextPointData( TDataType* theDataPtr )
+    {
+      vtkIdType aPos = myElemInfo[ 0 ] + myElemInfo[ 2 ] * myElemInfo[ 1 ];
+
+      TDataType* aDataPtr = myElnoDataArray->GetPointer( aPos );
+
+      for ( vtkIdType aCompId = 0; aCompId < myElemInfo[ 1 ]; aCompId++ )
+       *aDataPtr++ = *theDataPtr++;
+
+      return myElemInfo[ 2 ]++;
+    }
+
+
+    //----------------------------------------------------------------------------------------------
+    void
+    InsertNextCellData()
+    {
+      myElnoDataMapper->InsertNextTupleValue( myElemInfo );
+      myElemInfo[ 0 ] += myElemInfo[ 2 ] * myElemInfo[ 1 ];
+      myElemInfo[ 2 ] = 0;
+    }
+
+
+    //----------------------------------------------------------------------------------------------
+    void
+    AddData( vtkDataSetAttributes* theDataSetAttributes )
+    {
+      theDataSetAttributes->AddArray( myElnoDataArray );
+      theDataSetAttributes->AddArray( myElnoDataMapper );
+    }
+
+  protected:
+    TVTKDataArray *myElnoDataArray;
+    vtkIntArray *myElnoDataMapper;
+    int myElemInfo[ 3 ];
+  };
+
+
+  //---------------------------------------------------------------
+}
+
+#endif
index bf1e8fcae8919a5d60302f4fa1391b81a7ff5551..55e2cc20bc936b99f2448cb0aa6d59869d502dd1 100644 (file)
@@ -103,8 +103,8 @@ namespace VISU
   ::GetIndexesOfNode(vtkIdType theNodeId)
   {
     if ( IsStructured() ) {
-      TObj2StructuredId::const_iterator aIter = myObj2StructuredId->find( theNodeId );
-      if ( aIter != myObj2StructuredId->end() )
+      TObj2StructuredId::const_iterator aIter = myObj2StructuredId.find( theNodeId );
+      if ( aIter != myObj2StructuredId.end() )
        return aIter->second;
     }
 
@@ -115,8 +115,8 @@ namespace VISU
   TStructured
   ::GetObjectIDByIndexes(TStructuredId theVec)
   {
-    TObj2StructuredId::const_iterator aIter = myObj2StructuredId->begin();
-    for (; aIter != myObj2StructuredId->end(); aIter++ ) {
+    TObj2StructuredId::const_iterator aIter = myObj2StructuredId.begin();
+    for (; aIter != myObj2StructuredId.end(); aIter++ ) {
       if ( theVec == aIter->second )
        return aIter->first;
     }
index 2657165ce2cd1c1fcbf8ad3d8d8a9a4702d49fb8..4ef68e307e23b0dd1a236f5c39b60d4ae0b85dda 100644 (file)
@@ -124,7 +124,7 @@ namespace VISU
      */
     TStructuredId myGrilleStructure;
     
-    PObj2StructuredId myObj2StructuredId;//!< map of object id to i,j,k ids of structured grid nodes    
+    TObj2StructuredId myObj2StructuredId;//!< map of object id to i,j,k ids of structured grid nodes    
   };
   
   //---------------------------------------------------------------
index df36b0c9d5379396f5cc82f1e0d8bd2d7aca60ce..e86e2e16a4662b0d3b7e3f059379978bd3e804df 100644 (file)
@@ -138,15 +138,29 @@ namespace
 
   //---------------------------------------------------------------
   VISU::TEntity
-  MEDEntityToVTK(MED::EEntiteMaillage theMEDEntity)
+  MEDEntityToVTK( MED::EEntiteMaillage theMEDEntity )
   {
+    VISU::TEntity anEntity = VISU::TEntity( -1 );
+
     switch(theMEDEntity){
-    case MED::eNOEUD: return VISU::NODE_ENTITY;
-    case MED::eARETE: return VISU::EDGE_ENTITY;
-    case MED::eFACE: return VISU::FACE_ENTITY;
-    case MED::eMAILLE: return VISU::CELL_ENTITY;
+    case MED::eNOEUD :
+      anEntity = VISU::NODE_ENTITY;
+      break;
+    case MED::eARETE : 
+      anEntity = VISU::EDGE_ENTITY;
+      break;
+    case MED::eFACE : 
+      anEntity = VISU::FACE_ENTITY;
+      break;
+    case MED::eMAILLE : 
+      anEntity = VISU::CELL_ENTITY;
+      break;
+    case MED::eNOEUD_ELEMENT :
+      anEntity = VISU::CELL_ENTITY;
+      break;
     }
-    return VISU::TEntity(-1);
+
+    return anEntity;
   }
 
 
@@ -200,7 +214,7 @@ namespace
          MED::PPolygoneInfo aPolygoneInfo = 
            theMEDWrapper->GetPPolygoneInfo(theMeshInfo,theMEntity,theMGeom);
          for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
-           TInt aNbConn = aPolygoneInfo->GetNbConn(anElemNum[anElemId]);
+           TInt aNbConn = aPolygoneInfo->GetNbConn( anElemNum[ anElemId ] - 1 );
            aSubProfile->myCellsSize += aNbConn;
          }
          break;
@@ -210,7 +224,7 @@ namespace
            theMEDWrapper->GetPPolyedreInfo(theMeshInfo,theMEntity,theMGeom);
          for(TInt anElemId = 0; anElemId < aNbElem ; anElemId++){
            MED::TCConnSliceArr aConnSliceArr = 
-             aPolyedreInfo->GetConnSliceArr(anElemNum[anElemId]);
+             aPolyedreInfo->GetConnSliceArr( anElemNum[ anElemId ] - 1 );
            TInt aNbFaces = aConnSliceArr.size();
            TInt aCellSize = 0;
            for(TInt iFace = 0; iFace < aNbFaces; iFace++){
@@ -754,9 +768,9 @@ namespace
       if(aNbTimeStamps < 1)
        continue;
       
-      VISU::TEntity aVEntity = MEDEntityToVTK(aMEntity);
+      VISU::TEntity aVEntity = MEDEntityToVTK( aMEntity );
       vtkIdType aDataType = VTK_DOUBLE;
-      if(aFieldInfo->GetType() != MED::eFLOAT64){
+      if ( aFieldInfo->GetType() != MED::eFLOAT64 ) {
 #if defined(HAVE_F77INT64)
        aDataType = VTK_LONG;
 #else  
@@ -772,7 +786,8 @@ namespace
       aField->myName = aFieldName;
       aField->myMeshName = aMeshName;
       aField->myDataSize = aMeshOnEntity->myNbCells * aNbComp;
-      
+      aField->myIsELNO = ( aMEntity == MED::eNOEUD_ELEMENT );
+
       INITMSG(MYDEBUG,"myName = '"<<aField->myName<<"'"<<
              "; myId = "<<aField->myId<<
              "; myEntity = "<<aField->myEntity<<
@@ -813,9 +828,13 @@ namespace
        MED::TGeom2NbGauss::const_iterator anIter = aMGeom2NbGauss.begin();
        for(; anIter != aMGeom2NbGauss.end(); anIter++){
          const MED::EGeometrieElement& aMGeom = anIter->first;
-         VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
+         VISU::EGeometry aEGeom = MEDGeom2VISU( aMGeom );
          TInt aNbGauss = anIter->second;
-         aVGeom2NbGauss[aEGeom] = aNbGauss;
+         aVGeom2NbGauss[ aEGeom ] = aNbGauss;
+
+         // ELNO data should satisfy the following condition ( implicitly )
+         vtkIdType aNbNodes = MEDGeom2NbNodes( aMGeom );
+         aField->myIsELNO &= ( aNbGauss == aNbNodes );
        }
       }
     }
@@ -1238,8 +1257,7 @@ namespace VISU
   //---------------------------------------------------------------
   vtkIdType
   TMEDGaussSubMesh
-  ::GetVTKID(const TGaussPointID& theID,
-            vtkIdType theStartID) const
+  ::GetVTKID( const TGaussPointID& theID ) const
   {
     vtkIdType aResult = -1;
 
@@ -1253,9 +1271,9 @@ namespace VISU
     if ( myIsElemNum ) {
       aCellID = GetElemVTKID( aCellID );
     } else
-      aCellID -= theStartID;
+      aCellID -= myStartID;
 
-    return aCellID * aNbPoints + aLocalPntID + theStartID;
+    return aCellID * aNbPoints + aLocalPntID + myStartID;
   }
 
 
@@ -1277,6 +1295,7 @@ namespace VISU
   ::Init(const MED::PElemInfo& theElemInfo,
         MED::EVersion theVersion)
   {
+    myVersion = theVersion;
     myIsElemNum = theElemInfo->IsElemNum();
     if(myIsElemNum)
       myElemNum = theElemInfo->myElemNum;
index 4529ecb379caba6dbf8e5b9756edc95473a47df4..ec1f3cee50b30bd0b16252b28324c6569221fe8d 100644 (file)
@@ -245,8 +245,7 @@ namespace VISU
     
     virtual
     vtkIdType
-    GetVTKID(const TGaussPointID& theID,
-            vtkIdType theStartID) const;  
+    GetVTKID( const TGaussPointID& theID ) const;  
 
     //! Gets memory size used by the instance (bytes).
     virtual
index 488463696a9adf42b87fd34be88e554c3e2f9f19..2d1eafc2f40da645af9d05b03c51a61cafddfa34 100644 (file)
@@ -81,6 +81,9 @@ namespace
       vtkCellData *anOutputCellData = theOutput->GetCellData();
       anOutputCellData->CopyAllocate(aCellData);
 
+      if(theVectorsDataSet && theVectorsDataSet != theScalarsDataSet)
+        anOutputCellData->CopyVectorsOff();
+
       vtkIdType aNbTuples = anIntersection.size();
       theOutput->Allocate(aNbTuples);
       vtkIdList *aCellIds = vtkIdList::New();
@@ -100,13 +103,68 @@ namespace
       aCellIds->Delete();
 
       theOutput->SetPoints(theInput->GetPoints());
+      
     }else{
       theOutput->CopyStructure(theInput);
       theOutput->GetCellData()->ShallowCopy(theScalarsDataSet->GetCellData());
     }
     theOutput->GetPointData()->ShallowCopy(theInput->GetPointData());
+    
+    //If need, copy vectors data.
+    if(theVectorsDataSet && theVectorsDataSet != theScalarsDataSet){
+      bool isVectorsOnCells = theVectorsDataSet->GetCellData()->GetVectors() != NULL;
+      bool isVectorsDataOnPoints = theVectorsDataSet->GetPointData()->GetVectors() != NULL;
+      if(isVectorsOnCells) {
+        CopyVectorsOnCells(theVectorsDataSet,theOutput);
+      }
+      else if(isVectorsDataOnPoints){
+        CopyVectorsOnPoints(theVectorsDataSet,theOutput);
+      }
+    }
   }
   
+  void CopyVectorsOnCells(vtkDataSet *theVectorsDataSet,
+                          vtkDataSet *theOutput)
+  {
+    vtkDataArray *anInputVectors = theVectorsDataSet->GetCellData()->GetVectors();
+    vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
+    
+    //Clear output vector data
+    theOutput->GetCellData()->SetVectors(NULL);
+    
+    //Copy vectors data
+    vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
+                                                TGetCellData(),
+                                                "VISU_CELLS_MAPPER");
+    
+    vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
+                                               TGetCellData(),
+                                               "VISU_CELLS_MAPPER");
+    
+    TObjectIdArray anIntersection;
+    GetIntersection(anOutputIDMapper,
+                    anInputIDMapper,
+                    anIntersection);
+
+    vtkIdType aNbTuples = anIntersection.size();
+    anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
+    anOutputVectors->SetNumberOfTuples(aNbTuples);
+    theOutput->GetCellData()->SetVectors(anOutputVectors);
+    anOutputVectors->Delete();
+    
+    TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
+    GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
+    
+    TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
+    GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
+
+    for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
+      TObjectId &anObjectId = anIntersection[iTupleId];
+      vtkIdType anOutputCellId  = anOutputObjectId2TupleIdMap[anObjectId];
+      vtkIdType anInputCellId = anInputObjectId2TupleIdMap[anObjectId];
+      anOutputVectors->SetTuple(anOutputCellId,anInputVectors->GetTuple(anInputCellId));
+    }
+  }
   
   //---------------------------------------------------------------
   template<class TDataSet>
@@ -200,7 +258,118 @@ namespace
       theOutput->GetCellData()->ShallowCopy(theInput->GetCellData());
     }
     theOutput->GetPointData()->ShallowCopy(theScalarsDataSet->GetPointData());
+    
+    //If need, copy vectors data.
+    if(theVectorsDataSet && theVectorsDataSet != theScalarsDataSet){
+      bool isVectorsOnCells = theVectorsDataSet->GetCellData()->GetVectors() != NULL;
+      bool isVectorsDataOnPoints = theVectorsDataSet->GetPointData()->GetVectors() != NULL;
+
+      //Merge cells if need
+      //rnv
+      if(!IsDifferent(theGeometryPointMapper, theDataPointMapper)){
+        vtkIntArray* theGeometryCellMapper = GetIDMapper(theVectorsDataSet,
+                                                         TGetCellData(),
+                                                         "VISU_CELLS_MAPPER");
+        
+        vtkIntArray* theDataCellMapper = GetIDMapper(theScalarsDataSet,
+                                                     TGetCellData(),
+                                                     "VISU_CELLS_MAPPER");
+        
+          
+        if(IsDifferent(theGeometryCellMapper, theDataCellMapper)){
+          TObjectIdArray anIntersection;
+          
+          GetIntersection(theGeometryCellMapper,
+                          theDataCellMapper,
+                          anIntersection);
+    
+          TObjectId2TupleIdMap aGeomObjectId2TupleIdMap;
+          GetObjectId2TupleIdMap(theGeometryCellMapper, aGeomObjectId2TupleIdMap);
+      
+          TObjectId2TupleIdMap aDataObjectId2TupleIdMap;
+          GetObjectId2TupleIdMap(theDataCellMapper, aDataObjectId2TupleIdMap);
+      
+          vtkCellData *aCellData = theScalarsDataSet->GetCellData();
+          vtkCellData *anOutputCellData = theOutput->GetCellData();
+          anOutputCellData->CopyAllocate(aCellData);
+
+          vtkIdType aNbTuples = anIntersection.size();
+          theOutput->Allocate(aNbTuples);
+          vtkIdList *aCellIds = vtkIdList::New();
+          for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+            TObjectId& anObjectId = anIntersection[aTupleId];
+            vtkIdType aCellId = aGeomObjectId2TupleIdMap[anObjectId];
+            vtkCell *aCell = theInput->GetCell(aCellId);
+            aCellIds->Reset();
+            vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
+            for(vtkIdType anId = 0; anId < aNbPointIds; anId++)
+              aCellIds->InsertNextId(aCell->GetPointIds()->GetId(anId));
+            vtkIdType aCellType = theInput->GetCellType(aCellId);
+            vtkIdType aNewCellId = theOutput->InsertNextCell(aCellType, aCellIds);
+            vtkIdType aDataCellId = aDataObjectId2TupleIdMap[anObjectId];
+            anOutputCellData->CopyData(aCellData, aDataCellId, aNewCellId);
+          }
+          aCellIds->Delete();
+          
+        }
+      }
+        
+      if(isVectorsOnCells) {
+        CopyVectorsOnCells(theVectorsDataSet,theOutput);
+      }
+      else if(isVectorsDataOnPoints){
+        CopyVectorsOnPoints(theVectorsDataSet,theOutput);
+      }
+    }
   }
+  
+  void CopyVectorsOnPoints(vtkDataSet *theVectorsDataSet,
+                          vtkDataSet *theOutput)
+  {
+    vtkDataArray *anInputVectors = theVectorsDataSet->GetPointData()->GetVectors();
+    
+    //Clear output vector data
+    theOutput->GetPointData()->SetVectors(NULL);
+    
+    vtkDataArray *anOutputVectors = vtkDataArray::CreateDataArray(anInputVectors->GetDataType());
+    
+    //Copy vectors data
+    vtkIntArray* anOutputIDMapper = GetIDMapper(theOutput,
+                                                TGetPointData(),
+                                                "VISU_POINTS_MAPPER");
+    
+    vtkIntArray* anInputIDMapper = GetIDMapper(theVectorsDataSet,
+                                               TGetPointData(),
+                                               "VISU_POINTS_MAPPER");
+    TObjectIdArray anIntersection;
+
+    GetIntersection(anOutputIDMapper,
+                    anInputIDMapper,
+                    anIntersection);
+    
+    vtkIdType aNbTuples = anIntersection.size();  
+    anOutputVectors->SetNumberOfComponents(anInputVectors->GetNumberOfComponents());
+    anOutputVectors->SetNumberOfTuples(aNbTuples);
+    
+    
+
+    TObjectId2TupleIdMap anOutputObjectId2TupleIdMap;
+    GetObjectId2TupleIdMap(anOutputIDMapper, anOutputObjectId2TupleIdMap);
+    
+    TObjectId2TupleIdMap anInputObjectId2TupleIdMap;
+    GetObjectId2TupleIdMap(anInputIDMapper, anInputObjectId2TupleIdMap);
+    
+    for(vtkIdType iTupleId = 0; iTupleId < aNbTuples; iTupleId++ ){
+      TObjectId& anObjectId = anIntersection[iTupleId];
+      vtkIdType anOutputPointId  = anOutputObjectId2TupleIdMap[anObjectId];
+      vtkIdType anInputPointId = anInputObjectId2TupleIdMap[anObjectId];
+      anOutputVectors->SetTuple(anOutputPointId,anInputVectors->GetTuple(anInputPointId));
+    }
+    
+    theOutput->GetPointData()->SetVectors(anOutputVectors);
+    anOutputVectors->Delete();
+  }
+  
 
   //---------------------------------------------------------------
   typedef vtkDataArray* (vtkDataSetAttributes::* TGetAttribute)();
index 4b7a27850707429468f61c9506cbb62c8f8d458d..b4b265ed640f429cbbf4d4554f9d8870fb97e06a 100644 (file)
 //  Module : VISU
 
 #include "VISU_MeshValue.hxx"
+#include "VISU_ElnoMeshValue.hxx"
 #include "VISU_Structures_impl.hxx"
 #include "VISU_ConvertorUtils.hxx"
 
 #include "VISU_PointCoords.hxx"
-#include "VISU_TypeList.hxx"
+#include "VISU_VTKTypeList.hxx"
 
 #include <vtkUnstructuredGrid.h>
 #include <vtkPolyData.h>
@@ -113,76 +114,6 @@ namespace VISU
   }
 
 
-  namespace TL
-  {
-    //----------------------------------------------------------------------------
-    typedef TList<char,
-                 TList<unsigned char,
-                       TList<short,
-                             TList<unsigned short,
-                                   TList<int,
-                                         TList<unsigned int,
-                                               TList<long,
-                                                     TList<unsigned long, 
-                                                           TList<float, 
-                                                                 TList<double, 
-                                                                       TNullType> > > > > > > > > >
-    TVTKBasicTypeList;
-    
-
-    //----------------------------------------------------------------------------
-    typedef TList<vtkCharArray,
-                 TList<vtkUnsignedCharArray,
-                       TList<vtkShortArray,
-                             TList<vtkUnsignedShortArray,
-                                   TList<vtkIntArray,
-                                         TList<vtkUnsignedIntArray,
-                                               TList<vtkLongArray,
-                                                     TList<vtkUnsignedLongArray, 
-                                                           TList<vtkFloatArray, 
-                                                                 TList<vtkDoubleArray, 
-                                                                             TNullType> > > > > > > > > >
-    TVTKArrayTypeList;
-    
-
-    typedef TList<TInt2Type<VTK_CHAR>,
-                 TList<TInt2Type<VTK_UNSIGNED_CHAR>,
-                       TList<TInt2Type<VTK_SHORT>,
-                             TList<TInt2Type<VTK_UNSIGNED_SHORT>,
-                                   TList<TInt2Type<VTK_INT>,
-                                         TList<TInt2Type<VTK_UNSIGNED_INT>,
-                                               TList<TInt2Type<VTK_LONG>,
-                                                     TList<TInt2Type<VTK_UNSIGNED_LONG>,
-                                                           TList<TInt2Type<VTK_FLOAT>, 
-                                                                 TList<TInt2Type<VTK_DOUBLE>, 
-                                                                       TNullType> > > > > > > > > >
-    TVTKBasicEnumList;
-    
-
-    //----------------------------------------------------------------------------
-    template <unsigned int type_enum>
-    struct TEnum2VTKBasicType
-    {
-      typedef typename TTypeAt<TVTKBasicTypeList, TIndexOf<TVTKBasicEnumList, TInt2Type<type_enum> >::value >::TResult TResult;
-    };
-    
-    //----------------------------------------------------------------------------
-    template <unsigned int type_enum>
-    struct TEnum2VTKArrayType
-    {
-      typedef typename TTypeAt<TVTKArrayTypeList, TIndexOf<TVTKBasicEnumList, TInt2Type<type_enum> >::value >::TResult TResult;
-    };
-    
-    //----------------------------------------------------------------------------
-    template <class T>
-    struct TVTKBasicType2Enum
-    {
-      typedef typename TTypeAt<TVTKBasicEnumList, TIndexOf<TVTKBasicTypeList, T>::value >::TResult TResult;
-    };
-    
-  }
-
-
   //----------------------------------------------------------------------------
   template<int EDataType>
   void 
@@ -349,7 +280,7 @@ namespace VISU
     std::string aFieldName = VISU::GenerateFieldName(theField, theValForTime);
     
     vtkDataSetAttributes* aDataSetAttributes;
-    switch(theEntity){
+    switch ( theEntity ) {
     case VISU::NODE_ENTITY : 
       aDataSetAttributes = theSource->GetPointData();
       break;
@@ -360,49 +291,51 @@ namespace VISU
     typedef typename TL::TEnum2VTKArrayType<EDataType>::TResult TVTKDataArray;
     TVTKDataArray *aSelectedDataArray = TVTKDataArray::New();
     vtkIdType aNbComp = theField->myNbComp;
-    switch(aNbComp) {
+
+    switch ( aNbComp ) {
     case 1:
-      aSelectedDataArray->SetNumberOfComponents(1);
-      aDataSetAttributes->SetScalars(aSelectedDataArray);
+      aSelectedDataArray->SetNumberOfComponents( 1 );
+      aDataSetAttributes->SetScalars( aSelectedDataArray );
       break;
     default:
-      aSelectedDataArray->SetNumberOfComponents(3);
-      aDataSetAttributes->SetVectors(aSelectedDataArray);
+      aSelectedDataArray->SetNumberOfComponents( 3 );
+      aDataSetAttributes->SetVectors( aSelectedDataArray );
     }
-    aSelectedDataArray->SetNumberOfTuples(aNbTuples);
-    aSelectedDataArray->SetName(aFieldName.c_str());
+    aSelectedDataArray->SetNumberOfTuples( aNbTuples );
+    aSelectedDataArray->SetName( aFieldName.c_str() );
 
     TVTKDataArray *aFullDataArray = TVTKDataArray::New();
-    aFullDataArray->SetNumberOfComponents(aNbComp);
-    aFullDataArray->SetNumberOfTuples(aNbTuples);
-    aFullDataArray->SetName("VISU_FIELD");
-    aDataSetAttributes->AddArray(aFullDataArray);
+    aFullDataArray->SetNumberOfComponents( aNbComp );
+    aFullDataArray->SetNumberOfTuples( aNbTuples );
+    aFullDataArray->SetName( "VISU_FIELD" );
+    aDataSetAttributes->AddArray( aFullDataArray );
 
     INITMSG(MYDEBUG,"InitTimeStampOnProfile "<<
            "- theEntity = "<<theEntity<<
            "; aNbTuples = "<<aNbTuples<<
            "; aNbComp = "<<aNbComp<<
            std::endl);
+
     TTimerLog aTimerLog(MYDEBUG,"InitTimeStampOnProfile");
     
     const TGeom2MeshValue& aGeom2MeshValue = theValForTime->GetGeom2MeshValue();
-    typedef typename TL::TEnum2VTKBasicType<EDataType>::TResult TVTKBasicType;
-    typedef TTMeshValue<TVTKBasicType> TMeshValue;
-    typedef MED::SharedPtr<TMeshValue> TMeshValuePtr;
+    typedef typename TL::TEnum2VTKBasicType< EDataType >::TResult TVTKBasicType;
+    typedef TTMeshValue< TVTKBasicType > TMeshValue;
+    typedef MED::SharedPtr< TMeshValue > TMeshValuePtr;
 
-    typedef TDataArrayHolder<EDataType> TTDataArrayHolder;
-    typedef MED::SharedPtr<TTDataArrayHolder> PDataArrayHolder;
+    typedef TDataArrayHolder< EDataType > TTDataArrayHolder;
+    typedef MED::SharedPtr< TTDataArrayHolder > PDataArrayHolder;
 
     TMeshValuePtr aMeshValue = theValForTime->GetFirstMeshValue();
-    if(aGeom2MeshValue.size() == 1 && aMeshValue->GetNbGauss() == 1){
+    if ( aGeom2MeshValue.size() == 1 && aMeshValue->GetNbGauss() == 1 ) {
       aFullDataArray->SetVoidArray(aMeshValue->GetPointer(),
                                   aMeshValue->size(),
                                   true);
       INITMSG(MYDEBUG,"InitTimeStampOnProfile - aFullDataArray->SetVoidArray()"<<std::endl);
-      if(aNbComp == 1){
-       aSelectedDataArray->SetVoidArray(aMeshValue->GetPointer(),
-                                        aMeshValue->size(),
-                                        true);
+      if ( aNbComp == 1 ) {
+       aSelectedDataArray->SetVoidArray( aMeshValue->GetPointer(),
+                                         aMeshValue->size(),
+                                         true );
        INITMSG(MYDEBUG,"InitTimeStampOnProfile - aSelectedDataArray->SetVoidArray()"<<std::endl);
       }else{
        PDataArrayHolder aDataArrayHolder(new TTDataArrayHolder(aSelectedDataArray));
@@ -416,6 +349,66 @@ namespace VISU
 
     aSelectedDataArray->Delete();
     aFullDataArray->Delete();
+
+    // Process the case for ELNO data
+    //-------------------------------
+    if ( theField->myIsELNO ) {
+      // To calculate effective number of components for the VTK compatibel ELNO data representation
+      vtkIdType aEffectNbTuples = 0;
+      TGeom2MeshValue::const_iterator anIter = aGeom2MeshValue.begin();
+      for ( ; anIter != aGeom2MeshValue.end(); anIter++ ) {
+       const PMeshValue& aMeshValue = anIter->second;
+       aEffectNbTuples += aMeshValue->GetNbElem() * aMeshValue->GetNbGauss();
+      }
+
+      vtkIdType anEffectNbComp = ( aEffectNbTuples * aNbComp ) / aNbTuples + 1;
+    
+      // To create corresponding VTK representation for the ELNO data
+      TSetElnoNodeData< EDataType > aSetElnoNodeData( anEffectNbComp,
+                                                     aNbComp,
+                                                     aNbTuples,
+                                                     "ELNO_FIELD",
+                                                     "ELNO_COMPONENT_MAPPER" );
+
+      std::vector< TVTKBasicType > aDataValues( aNbComp ); // To reserve a temproary value holder
+
+      // To initilize these VTK representation for the ELNO data from the MED
+      anIter = aGeom2MeshValue.begin();
+      for ( ; anIter != aGeom2MeshValue.end(); anIter++ ) {
+       EGeometry aEGeom = anIter->first;
+       const TMeshValuePtr aMeshValue = anIter->second;
+       
+       vtkIdType aNbElem = aMeshValue->GetNbElem();
+       vtkIdType aNbGauss = aMeshValue->GetNbGauss();
+       
+       INITMSG(MYDEBUG,
+               "- aEGeom = "<<aEGeom<<
+               "; aNbElem = "<<aNbElem<<
+               "; aNbGauss = "<<aNbGauss<<
+               std::endl);
+        std::vector<int> med2visu(aNbGauss);
+        InitMed2VisuArray(med2visu,aEGeom);
+       for ( vtkIdType iElem = 0; iElem < aNbElem; iElem++ ) {
+          const typename TMeshValue::TValueSliceArr& aValueSliceArr = aMeshValue->GetGaussValueSliceArr( iElem );          
+
+          for( vtkIdType iGauss = 0; iGauss < aNbGauss; iGauss++ ) {
+            const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[ med2visu[iGauss] ];
+
+            for( vtkIdType iComp = 0; iComp < aNbComp; iComp++ ) {
+              aDataValues[ iComp ] = aValueSlice[ iComp ];
+            }
+
+           aSetElnoNodeData.AddNextPointData( &aDataValues[ 0 ] );
+          }
+
+         aSetElnoNodeData.InsertNextCellData();
+       }
+      }
+      
+      // Assign the ELNO data on the corresponding VTK data set attribute 
+      aSetElnoNodeData.AddData( aDataSetAttributes );
+    }
+    //-------------------------------
   }
 
 
@@ -610,6 +603,98 @@ namespace VISU
     aFullDataArray->Delete();
   }
 
+  
+  //----------------------------------------------------------------------------
 
-  //---------------------------------------------------------------
+  void InitMed2VisuArray(std::vector<int>& anArray, EGeometry aEGeom){
+    switch(aEGeom){
+#if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eSEG3:
+      anArray[0] = 0;
+      anArray[2] = 1;  
+      anArray[1] = 2;
+      break;
+#endif
+
+#if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eTRIA6:
+      anArray[0] = 0;
+      anArray[2] = 1;  
+      anArray[4] = 2;  
+      
+      anArray[1] = 3;
+      anArray[3] = 4;  
+      anArray[5] = 5;
+      break;
+#endif
+
+#if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eQUAD8:
+      anArray[0] = 0;
+      anArray[2] = 1;  
+      anArray[4] = 2;  
+      anArray[6] = 3;  
+      
+      anArray[1] = 4;
+      anArray[3] = 5;  
+      anArray[5] = 6;  
+      anArray[7] = 7;
+      break;
+#endif
+    case eTETRA4:
+      anArray[0] = 0;
+      anArray[1] = 2;
+      anArray[2] = 1;  
+      anArray[3] = 3;
+      break;
+    case ePYRA5:
+      anArray[0] = 0;
+      anArray[1] = 3;  
+      anArray[2] = 2;
+      anArray[3] = 1;  
+      anArray[4] = 4;
+      break;
+#if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eTETRA10:
+      anArray[0] = 0;
+      anArray[1] = 2;
+      anArray[2] = 1;  
+      anArray[3] = 3;  
+      
+      anArray[4] = 6;
+      anArray[5] = 5;
+      anArray[6] = 4;  
+      
+      anArray[7] = 7;  
+      anArray[8] = 9;  
+      anArray[9] = 8;
+      break;
+#endif
+
+#if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case ePYRA13:
+      anArray[0] = 0;
+      anArray[1] = 3;
+      anArray[2] = 2;  
+      anArray[3] = 1;  
+      anArray[4] = 4;
+      
+      anArray[5] = 5;
+      anArray[6] = 8;  
+      anArray[7] = 7;  
+      anArray[8] = 6;  
+      
+      anArray[9] = 9;  
+      anArray[10] = 12;  
+      anArray[11] = 11;  
+      anArray[12] = 10;  
+      break;
+#endif
+    default:
+      for(int i=0;i<anArray.size();i++){
+        anArray[i] = i;
+      }
+      break;
+    }
+  }
 }
index f09fb783e36975d0effc28d7de7b717e4a0bd66a..220f53706667bb3b41bd1202b593a423d65d0be1 100644 (file)
@@ -212,6 +212,9 @@ namespace VISU
                          const PFieldImpl& theField, 
                          const PValForTimeImpl& theValForTime);
 
+  void 
+  InitMed2VisuArray(std::vector<int>& anArray, EGeometry aEGeom);
+
 
   //---------------------------------------------------------------
 }
index 06d2fadcc2a4c14d580c614424f6649ffef31c1a..31f3e626e191e056c86422c39dbe66de29dbf4fd 100644 (file)
@@ -90,8 +90,6 @@ namespace VISU
 
     std::string myGroupsEntry; //!< To simplify publication of the groups in a data tree
     std::string myFieldsEntry; //!< To simplify publication of the fiels in a data tree
-       
-    // MULTIPR
     std::string myPartsEntry; //!< To simplify publication of the parts in a data tree
 
     TMesh();
@@ -99,8 +97,6 @@ namespace VISU
   typedef std::map<std::string, PMesh> TMeshMap;
 
 
-  typedef std::map<VISU::TEntity,VISU::PNamedIDMapper> PNamedIDMapperMap;
-
   //---------------------------------------------------------------
   //! Define a basic class which corresponds to MED PROFILE entity
   struct VISU_CONVERTOR_EXPORT TSubProfile: virtual TBaseStructure
index 7c2692843d7d3a68419fb39ed65c4b603dd05283..1b69db6643a0c58c661773c432b6f7642a059486 100644 (file)
@@ -632,10 +632,9 @@ namespace VISU
 
   //---------------------------------------------------------------
   TUnstructuredGridIDMapperImpl
-  ::TUnstructuredGridIDMapperImpl():
-    myIsSpecialKey(false)
+  ::TUnstructuredGridIDMapperImpl()
   {
-    if(!myCommonCellsFilter.GetPointer()){
+    if ( !myCommonCellsFilter.GetPointer() ) {
       myCommonCellsFilter = VISU_CommonCellsFilter::New();
       myCommonCellsFilter->Delete();
     }
@@ -683,46 +682,44 @@ namespace VISU
     return myIDMapper->GetElemCell(theObjID);
   }
   
-  vtkUnstructuredGrid* 
+  void 
   TUnstructuredGridIDMapperImpl
-  ::GetUnstructuredGridOutput()
+  ::SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper )
   {
-    if(!myFilter.GetPointer()){
-      
+    myCommonCellsFilter->SetCellsUG( theNamedIDMapper->GetUnstructuredGridOutput() );
+  }
+
+  void 
+  TUnstructuredGridIDMapperImpl
+  ::Build()
+  {
+    if ( !myFilter.GetPointer() ) {
       const PAppendFilter& anAppendFilter = myIDMapper->GetFilter();
-      vtkUnstructuredGrid* aGeometry;
 
+      vtkUnstructuredGrid* aGeometry = anAppendFilter->GetOutput();
       const PUnstructuredGrid& aSource = mySource.GetSource();
-      vtkUnstructuredGrid* aDataSet;
-      
-      if(myIsSpecialKey){
-        PNamedIDMapperMap::iterator aIter;
-        aIter = myMappers.find(VISU::CELL_ENTITY);
-        if(aIter!=myMappers.end()) myCommonCellsFilter->SetCellsUG((aIter->second)->GetUnstructuredGridOutput());
-        else {
-          aIter = myMappers.find(VISU::FACE_ENTITY);
-          if(aIter!=myMappers.end()) myCommonCellsFilter->SetCellsUG((aIter->second)->GetUnstructuredGridOutput());
-          else {
-            aIter = myMappers.find(VISU::EDGE_ENTITY);
-            if(aIter!=myMappers.end()) myCommonCellsFilter->SetCellsUG((aIter->second)->GetUnstructuredGridOutput());
-          }
-        }
-      }
-      
-      aGeometry = anAppendFilter->GetOutput();
-      aDataSet = aSource.GetPointer();
-      aDataSet->ShallowCopy(aGeometry);
+      vtkUnstructuredGrid* aDataSet = aSource.GetPointer();
+      aDataSet->ShallowCopy( aGeometry );
 
       const PMergeFilter& aFilter = GetFilter();
-      aFilter->SetGeometry(aGeometry);
-      aFilter->SetScalars(aDataSet);
-      aFilter->SetVectors(aDataSet);
-      aFilter->AddField("VISU_FIELD",aDataSet);
-      aFilter->AddField("VISU_CELLS_MAPPER",aDataSet);
-      aFilter->AddField("VISU_POINTS_MAPPER",aDataSet);
-
-      myCommonCellsFilter->SetProfileUG(aFilter->GetUnstructuredGridOutput());
+      aFilter->SetGeometry( aGeometry );
+      aFilter->SetScalars( aDataSet );
+      aFilter->SetVectors( aDataSet );
+      aFilter->AddField( "VISU_FIELD", aDataSet );
+      aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
+      aFilter->AddField( "ELNO_FIELD", aDataSet );
+      aFilter->AddField( "ELNO_COMPONENT_MAPPER", aDataSet );
+      aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
+                                                     
+      myCommonCellsFilter->SetProfileUG( aFilter->GetUnstructuredGridOutput() );
     } 
+  }
+
+  vtkUnstructuredGrid* 
+  TUnstructuredGridIDMapperImpl
+  ::GetUnstructuredGridOutput()
+  {
+    Build();
     return myCommonCellsFilter->GetOutput();
   }
 
@@ -733,17 +730,25 @@ namespace VISU
     return GetUnstructuredGridOutput();
   }
 
+  PUnstructuredGrid 
+  TUnstructuredGridIDMapperImpl
+  ::GetSource()
+  {
+    Build();
+    return mySource.GetSource();
+  }
+
   unsigned long int
   TUnstructuredGridIDMapperImpl
   ::GetMemorySize()
   {
     size_t aSize = myIDMapper->GetMemorySize();
+
     aSize += mySource.GetMemorySize();
-    if(vtkUnstructuredGrid* anOutput = myCommonCellsFilter->GetOutput())
+
+    if ( vtkUnstructuredGrid* anOutput = myCommonCellsFilter->GetOutput() )
       aSize += anOutput->GetActualMemorySize() * 1024;
-    PNamedIDMapperMap::const_iterator aIter = myMappers.begin();
-    for(;aIter!=myMappers.end();aIter++)
-      aSize += (aIter->second)->GetMemorySize();
+
     return aSize;
   }
 
@@ -790,26 +795,33 @@ namespace VISU
     return myIDMapper->GetElemCell(theObjID);
   }
   
-  vtkPolyData* 
+  void 
   TPolyDataIDMapperImpl
-  ::GetPolyDataOutput()
+  ::Build()
   {
-    if(!myFilter.GetPointer()){
+    if ( !myFilter.GetPointer() ) {
       const PAppendPolyData& anAppendFilter = myIDMapper->GetFilter();
       vtkPolyData* aGeometry = anAppendFilter->GetOutput();
       
       const PPolyData& aSource = mySource.GetSource();
       vtkPolyData* aDataSet = aSource.GetPointer();
-      aDataSet->ShallowCopy(aGeometry);
+      aDataSet->ShallowCopy( aGeometry );
       
       const PMergeFilter& aFilter = GetFilter();
-      aFilter->SetGeometry(aGeometry);
-      aFilter->SetScalars(aDataSet);
-      aFilter->SetVectors(aDataSet);
-      aFilter->AddField("VISU_FIELD",aDataSet);
-      aFilter->AddField("VISU_CELLS_MAPPER",aDataSet);
-      aFilter->AddField("VISU_POINTS_MAPPER",aDataSet);
+      aFilter->SetGeometry( aGeometry );
+      aFilter->SetScalars( aDataSet );
+      aFilter->SetVectors( aDataSet );
+      aFilter->AddField( "VISU_FIELD", aDataSet );
+      aFilter->AddField( "VISU_CELLS_MAPPER", aDataSet );
+      aFilter->AddField( "VISU_POINTS_MAPPER", aDataSet );
     }
+  }
+
+  vtkPolyData* 
+  TPolyDataIDMapperImpl
+  ::GetPolyDataOutput()
+  {
+    Build();
     return myFilter->GetPolyDataOutput();
   }
 
@@ -820,6 +832,14 @@ namespace VISU
     return GetPolyDataOutput();
   }
 
+  PPolyData 
+  TPolyDataIDMapperImpl
+  ::GetSource()
+  {
+    Build();
+    return mySource.GetSource();
+  }
+
   unsigned long int
   TPolyDataIDMapperImpl
   ::GetMemorySize()
@@ -971,7 +991,6 @@ namespace VISU
       return aResult;
       
     size_t aSubMeshEnd = myGaussSubMeshArr.size();
-    const PAppendFilter& anAppendFilter = GetFilter();
     const PGaussSubMeshImpl& aGaussSubMesh = anIter->second;
     for ( size_t aSubMeshId = 0; aSubMeshId < aSubMeshEnd; aSubMeshId++ ) {
       const PGaussSubMeshImpl& aSubMesh = myGaussSubMeshArr[aSubMeshId];
@@ -1337,9 +1356,10 @@ namespace VISU
   
   //---------------------------------------------------------------
   TFieldImpl
-  ::TFieldImpl(): 
-    myDataSize(0),
-    myDataType(0)
+  ::TFieldImpl()
+    : myDataSize( 0 )
+    , myDataType( 0 )
+    , myIsELNO( false )
   {}
 
   void 
index fbcabfef8c7b112958f82558ec0805df0ee4e0ca..8819f492999a7e15f6abe918ac3d482c4bc5c385 100644 (file)
@@ -157,14 +157,6 @@ namespace VISU
     virtual
     unsigned long int
     GetMemorySize();
-
-    //! if false, TIDCommonCellsFilter - same as TIDMapperFilter
-    //! if true, TIDCommonCellsFilter - use VISU_CommonCellsFilter
-    bool myIsSpecialKey;
-
-    //! Vector of id mappers, which consist of meshonentity in next sequence:
-    //! CELL_ENTITY,FACE_ENTITY,EDGE_ENTITY
-    PNamedIDMapperMap myMappers;
   };
 
   //---------------------------------------------------------------
@@ -348,9 +340,8 @@ namespace VISU
   struct TUnstructuredGridIDMapperImpl: virtual TMergeFilterHolder,
                                        virtual TUnstructuredGridIDMapper
   {
-    PAppendFilterHolder       myIDMapper; //!< Responsible for numbering
-    PCommonCellsFilter        myCommonCellsFilter;
-    TUnstructuredGridHolder   mySource; //!< Keeps assigned data
+    PAppendFilterHolder myIDMapper; //!< Responsible for numbering
+    PCommonCellsFilter myCommonCellsFilter;
 
     TUnstructuredGridIDMapperImpl();
     
@@ -399,13 +390,16 @@ namespace VISU
     unsigned long int
     GetMemorySize();
     
-    //! if false, Not using CommonCellsFilter
-    //! if true,  Using CommonCellsFilter
-    bool myIsSpecialKey;
+    void 
+    SetReferencedMesh( const PNamedIDMapper& theNamedIDMapper );
+
+    PUnstructuredGrid 
+    GetSource();
+
+  protected:
+    void Build();
 
-    //! Vector of id mappers, which consist of meshonentity in next sequence:
-    //! CELL_ENTITY,FACE_ENTITY,EDGE_ENTITY
-    PNamedIDMapperMap myMappers;
+    TUnstructuredGridHolder mySource; //!< Keeps assigned data
   };
 
   //---------------------------------------------------------------
@@ -414,7 +408,6 @@ namespace VISU
                                virtual TPolyDataIDMapper
   {
     PAppendPolyDataHolder myIDMapper; //!< Responsible for numbering
-    TPolyDataHolder mySource; //!< Keeps assigned data
 
     //! Reimplement the TIDMapper::GetNodeObjID
     virtual 
@@ -460,6 +453,14 @@ namespace VISU
     virtual
     unsigned long int
     GetMemorySize();
+
+    PPolyData 
+    GetSource();
+
+  protected:
+    void Build();
+
+    TPolyDataHolder mySource; //!< Keeps assigned data
   };
 
 
@@ -830,6 +831,7 @@ namespace VISU
     vtkIdType myDataSize; //!< Keeps size of the assigned data
     vtkIdType myDataType; //!< Keeps type idetificator of the mesh data
     TMinMaxArr myMinMaxArr; //!< Keeps min/max values for each component of the MED FIELD
+    bool myIsELNO; //!< Defines whether this field contains specific "ELNO" data or not
   };
 
 
index 1a09efc3dff3438a122861c2adef421691e44ab3..a2eda5b7608620e3ded20007fad0eacd1ff29ae0 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
-//  File   : VISU_ColoredPrs3dCache_i.hh
+//  File   : VISU_TypeList.hxx
 //  Author : Oleg UVAROV
 //  Module : VISU
 
 #ifndef VISU_TypeList_HeaderFile
 #define VISU_TypeList_HeaderFile
 
+
+//----------------------------------------------------------------------------
 namespace VISU
 {
+  //----------------------------------------------------------------------------
   namespace TL
   {
     //----------------------------------------------------------------------------
-    template <class T, class U>
+    struct TNullType {};
+    
+
+    //----------------------------------------------------------------------------
+    template < class T, class U >
     struct TList
     {
       typedef T THead;
       typedef U TTail;
     };
     
-    template <int v>
+    template < int v >
     struct TInt2Type
     {
       enum { value = v };
     };
     
-    struct TNullType {};
-    
+
     //----------------------------------------------------------------------------
-    template <class TypeList, unsigned int index
+    template < class TypeList, unsigned int index 
     struct TTypeAt;
 
-    template <class THead, class TTail>
-    struct TTypeAt<TList<THead, TTail>, 0>
+    template < class THead, class TTail >
+    struct TTypeAt< TList< THead, TTail >, 0 >
     {
       typedef THead TResult;
     };
 
 
-    template <class THead, class TTail, unsigned int index>
-    struct TTypeAt<TList<THead, TTail>, index>
+    template < class THead, class TTail, unsigned int index >
+    struct TTypeAt< TList< THead, TTail >, index >
     {
-      typedef typename TTypeAt<TTail, index - 1>::TResult TResult;
+      typedef typename TTypeAt< TTail, index - 1 >::TResult TResult;
     };
 
+
     //----------------------------------------------------------------------------
-    template <class TypeList, class T
+    template < class TypeList, class T 
     struct TIndexOf;
 
-    template <class T>
-    struct TIndexOf<TNullType, T>
+    template < class T >
+    struct TIndexOf< TNullType, T >
     {
       enum { value = -1 };
     };
 
-    template <class T, class TTail>
-    struct TIndexOf<TList<T, TTail>, T>
+    template < class T, class TTail >
+    struct TIndexOf< TList< T, TTail >, T >
     {
       enum { value = 0 };
     };
 
-    template <class THead, class TTail, class T>
-    struct TIndexOf<TList<THead, TTail>, T>
+    template < class THead, class TTail, class T >
+    struct TIndexOf< TList< THead, TTail >, T >
     {
     private:
-      enum { temp = TIndexOf<TTail, T>::value };
+      enum { temp = TIndexOf< TTail, T >::value };
     public:
       enum { value = temp == -1? -1 : 1 + temp };
     };
     
+
+    //----------------------------------------------------------------------------
+    template
+    <
+      class T01 = TNullType, class T02 = TNullType, class T03 = TNullType, class T04 = TNullType, class T05 = TNullType,
+      class T06 = TNullType, class T07 = TNullType, class T08 = TNullType, class T09 = TNullType, class T10 = TNullType,
+      class T11 = TNullType, class T12 = TNullType, class T13 = TNullType, class T14 = TNullType, class T15 = TNullType,
+      class T16 = TNullType, class T17 = TNullType, class T18 = TNullType, class T19 = TNullType, class T20 = TNullType,
+      class T21 = TNullType, class T22 = TNullType, class T23 = TNullType, class T24 = TNullType, class T25 = TNullType,
+      class T26 = TNullType, class T27 = TNullType, class T28 = TNullType, class T29 = TNullType, class T30 = TNullType,
+      class T31 = TNullType, class T32 = TNullType, class T33 = TNullType, class T34 = TNullType, class T35 = TNullType,
+      class T36 = TNullType, class T37 = TNullType, class T38 = TNullType, class T39 = TNullType, class T40 = TNullType
+    >
+    struct TSequence
+    {
+    private:
+      typedef typename TSequence<      T02, T03, T04, T05, T06, T07, T08, T09, T10,
+                                  T11, T12, T13, T14, T15, T16, T17, T18, T19, T20,
+                                  T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+                                 T31, T32, T33, T34, T35, T36, T37, T38, T39, T40
+                                      >::TResult 
+                       TailResult;
+    public:
+      typedef TList< T01, TailResult > TResult;
+    };
+        
+
+    //----------------------------------------------------------------------------
+    template<>
+    struct TSequence<>
+    {
+      typedef TNullType TResult;
+    };
+
+
     //----------------------------------------------------------------------------
   }
+
+  
+  //----------------------------------------------------------------------------
 }
 
 #endif
diff --git a/src/CONVERTOR/VISU_VTKTypeList.hxx b/src/CONVERTOR/VISU_VTKTypeList.hxx
new file mode 100644 (file)
index 0000000..f210f65
--- /dev/null
@@ -0,0 +1,120 @@
+//  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_VTKTypeList.hxx
+//  Author : Oleg UVAROV
+//  Module : VISU
+
+#ifndef VISU_VTKTypeList_HeaderFile
+#define VISU_VTKTypeList_HeaderFile
+
+#include "VISU_TypeList.hxx"
+
+#include <vtkCharArray.h>
+#include <vtkUnsignedCharArray.h>
+#include <vtkShortArray.h>
+#include <vtkUnsignedShortArray.h>
+#include <vtkIntArray.h>
+#include <vtkUnsignedIntArray.h>
+#include <vtkLongArray.h>
+#include <vtkUnsignedLongArray.h> 
+#include <vtkFloatArray.h> 
+#include <vtkDoubleArray.h> 
+
+
+//----------------------------------------------------------------------------
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  namespace TL
+  {
+    //----------------------------------------------------------------------------
+    typedef TSequence< char, 
+                      unsigned char, 
+                      short, 
+                      unsigned short, 
+                      int, 
+                      unsigned int, 
+                      long, 
+                      unsigned long, 
+                      float, 
+                      double >::TResult TVTKBasicTypeList;
+
+
+    //----------------------------------------------------------------------------
+    typedef TSequence< vtkCharArray, 
+                      vtkUnsignedCharArray, 
+                      vtkShortArray, 
+                      vtkUnsignedShortArray, 
+                      vtkIntArray, 
+                      vtkUnsignedIntArray, 
+                      vtkLongArray, 
+                      vtkUnsignedLongArray, 
+                      vtkFloatArray, 
+                      vtkDoubleArray >::TResult TVTKArrayTypeList;
+
+
+    //----------------------------------------------------------------------------
+    typedef TSequence< TInt2Type< VTK_CHAR >, 
+                      TInt2Type< VTK_UNSIGNED_CHAR >, 
+                      TInt2Type< VTK_SHORT >, 
+                      TInt2Type< VTK_UNSIGNED_SHORT >, 
+                      TInt2Type< VTK_INT >, 
+                      TInt2Type< VTK_UNSIGNED_INT >, 
+                      TInt2Type< VTK_LONG >, 
+                      TInt2Type< VTK_UNSIGNED_LONG >, 
+                      TInt2Type< VTK_FLOAT >, 
+                      TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList;
+    
+    
+    //----------------------------------------------------------------------------
+    template< unsigned int type_enum >
+    struct TEnum2VTKBasicType
+    {
+      typedef typename TTypeAt< TVTKBasicTypeList, TIndexOf< TVTKBasicEnumList, TInt2Type< type_enum > >::value >::TResult TResult;
+    };
+
+    
+    //----------------------------------------------------------------------------
+    template< unsigned int type_enum >
+    struct TEnum2VTKArrayType
+    {
+      typedef typename TTypeAt< TVTKArrayTypeList, TIndexOf< TVTKBasicEnumList, TInt2Type< type_enum > >::value >::TResult TResult;
+    };
+    
+
+    //----------------------------------------------------------------------------
+    template< class T >
+    struct TVTKBasicType2Enum
+    {
+      typedef typename TTypeAt< TVTKBasicEnumList, TIndexOf< TVTKBasicTypeList, T >::value >::TResult TResult;
+    };
+    
+
+    //----------------------------------------------------------------------------
+  }
+
+
+  //----------------------------------------------------------------------------
+}
+
+#endif
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 0f022b75631183c0862035d016d5ebcc04d17b48..ff0a14715e03b4d63cdcfc2f68633b92b79ff77b 100644 (file)
@@ -41,7 +41,8 @@ salomeinclude_HEADERS = \
        VISU_GaussPtsAct.h \
        VISU_VectorsAct.h \
        VISU_PointMap3dActor.h \
-       VISU_ActorBase.h
+       VISU_ActorBase.h \
+       VISU_IsoSurfActor.h
 
 dist_libVisuObject_la_SOURCES = \
        VISU_Actor.cxx \
@@ -53,7 +54,8 @@ dist_libVisuObject_la_SOURCES = \
        VISU_GaussPtsAct.cxx \
        VISU_VectorsAct.cxx \
        VISU_PointMap3dActor.cxx \
-       VISU_ActorBase.cxx
+       VISU_ActorBase.cxx \
+       VISU_IsoSurfActor.cxx
 
 libVisuObject_la_CPPFLAGS= \
        $(QT_INCLUDES) \
index 43b6c761fa96cc005ddd37b9b60ed0b096288ac3..f4d26b4e3b2316e85f62ecde8e4123b2a56924c0 100644 (file)
@@ -167,43 +167,6 @@ VISU_Actor
   return myPrs3d;
 }
 
-//----------------------------------------------------------------------------
-/*VISU::TActorFactory* 
-VISU_Actor
-::GetFactory()
-{ 
-  return myActorFactory;
-}*/
-
-/*void
-VISU_Actor
-::SetFactory(VISU::TActorFactory* theActorFactory)
-{ 
-  using namespace VISU;
-
-  if(myActorFactory == theActorFactory)
-    return;
-  
-  if(theActorFactory)
-    myDestroySignal.connect(boost::bind(&TActorFactory::RemoveActor,
-                                       theActorFactory,
-                                       _1));
-
-  myActorFactory = theActorFactory;
-}*/
-
-//----------------------------------------------------------------------------
-/*void
-VISU_Actor
-::UpdateFromFactory()
-{
-  if(myUpdateFromFactoryTime.GetMTime() < myActorFactory->GetMTime()){
-    myUpdateFromFactoryTime.Modified();
-    myActorFactory->UpdateActor(this);
-    Update();
-  }
-}*/
-
 void
 VISU_Actor
 ::RemoveFromRender()
@@ -217,11 +180,11 @@ VISU_Actor
 ::SetPipeLine(VISU_PipeLine* thePipeLine) 
 {
   myPipeLine = thePipeLine;
-  if(thePipeLine){
-    if(vtkMapper *aMapper = myPipeLine->GetMapper()){
-      if(vtkDataSet *aDataSet = aMapper->GetInput()){
-       SetShrinkable(thePipeLine->IsShrinkable());
-       SetMapperInput(aDataSet);
+  if ( thePipeLine ) {
+    if ( vtkMapper *aMapper = myPipeLine->GetMapper() ) {
+      if ( vtkDataSet *aDataSet = aMapper->GetInput() ) {
+       SetShrinkable( thePipeLine->IsShrinkable() );
+       SetMapperInput( aDataSet );
       }
     }
   }
index 812f790d5f383b2794b75f9b6d25bc9e96d21217..c794a7d5f85268b11799a4c6df8b4ae4bd83e72a 100644 (file)
 
 #include "VISU_ActorBase.h"
 #include "VISU_ActorFactory.h"
+#include "VTKViewer_ShrinkFilter.h"
 
 #include <vtkObjectFactory.h>
+#include <vtkProperty.h>
+#include <vtkPassThroughFilter.h>
+#include <vtkShrinkFilter.h>
+#include <vtkDataSet.h>
+#include <vtkShrinkPolyData.h>
+#include <vtkUnstructuredGrid.h>
+
+#include "utilities.h"
+
 #include <boost/bind.hpp>
 
 VISU_ActorBase
-::VISU_ActorBase()
+::VISU_ActorBase() :
+  myIsShrinkable(true),
+  myIsShrunk(false),
+  myShrinkFilter(VTKViewer_ShrinkFilter::New())
 {
-
+  myShrinkFilter->Delete();
+  
+  myStoreMapping = true;
+  
+  myShrinkFilter->SetStoreMapping(true);
 }
 
 VISU_ActorBase
@@ -80,3 +97,67 @@ VISU_ActorBase
   }
 }
 
+//--------------------------------------------------------------------------
+
+void
+VISU_ActorBase
+::SetLineWidth(vtkFloatingPointType theLineWidth)
+{
+  GetProperty()->SetLineWidth(theLineWidth);
+}
+
+vtkFloatingPointType
+VISU_ActorBase
+::GetLineWidth()
+{
+  return GetProperty()->GetLineWidth();
+}
+
+//--------------------------------------------------------------------------
+void
+VISU_ActorBase
+::SetRepresentation(int theMode) 
+{ 
+  Superclass::SetRepresentation(theMode);
+  if(myRepresentation == VTK_POINTS)
+    UnShrink();
+}
+
+//----------------------------------------------------------------------------
+void VISU_ActorBase::SetShrink()
+{
+  if(!myIsShrinkable) 
+    return;
+  if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
+    myShrinkFilter->SetInput(aDataSet);
+    myPassFilter[1]->SetInput(myShrinkFilter->GetOutput());
+    myIsShrunk = true;
+  }
+}
+
+void VISU_ActorBase::UnShrink()
+{
+  if(!myIsShrunk) 
+    return;
+  if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
+    myPassFilter[1]->SetInput(aDataSet);
+    myPassFilter[1]->Modified();
+    myIsShrunk = false;
+    Modified();
+  }
+}
+
+bool VISU_ActorBase::IsShrunk()
+{
+  return myIsShrunk;
+}
+
+void VISU_ActorBase::SetShrinkable(bool theIsShrinkable)
+{
+  myIsShrinkable = theIsShrinkable;
+}
+
+bool VISU_ActorBase::IsShrunkable() 
+{ 
+  return myIsShrinkable;
+}
index 84909cbe07a6913b7dba48b4b360f5c0a9104d95..2b9e414d57dd1d907d4f7cec74ee6fefaf095ab5 100644 (file)
@@ -32,6 +32,8 @@
 #include "SALOME_Actor.h"
 #include "VISU_BoostSignals.h"
 
+class VTKViewer_ShrinkFilter;
+
 #ifdef _WIN32
 #define VTKOCC_EXPORT __declspec (dllexport)
 #else
@@ -54,18 +56,25 @@ class VTKOCC_EXPORT VISU_ActorBase: public SALOME_Actor,
   vtkTypeMacro(VISU_ActorBase, SALOME_Actor);
 
   //----------------------------------------------------------------------------
-  VISU::TActorFactory* 
-  GetFactory();
-
-  virtual
-  void
-  SetFactory(VISU::TActorFactory* theActorFactory);
+  VISU::TActorFactory* GetFactory();
+  virtual void SetFactory(VISU::TActorFactory* theActorFactory);
   
   //----------------------------------------------------------------------------
-  virtual
-  void
-  UpdateFromFactory();
+  virtual void UpdateFromFactory();
+
+  //----------------------------------------------------------------------------
+
+  virtual void SetLineWidth(vtkFloatingPointType theLineWidth);
+  virtual vtkFloatingPointType GetLineWidth();
+
+  virtual void SetShrink();
+  virtual void UnShrink(); 
+  virtual bool IsShrunkable();
+  virtual bool IsShrunk();
+  virtual void SetShrinkable(bool theIsShrinkable);
   
+  virtual void SetRepresentation(int theMode);
+
  protected:
   VISU_ActorBase();
   virtual  ~VISU_ActorBase();
@@ -73,6 +82,11 @@ class VTKOCC_EXPORT VISU_ActorBase: public SALOME_Actor,
   VISU::TActorFactory*                 myActorFactory;
   vtkTimeStamp                         myUpdateFromFactoryTime;
   boost::signal1<void,VISU_ActorBase*> myDestroySignal;
+
+  vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
+
+  bool myIsShrinkable;
+  bool myIsShrunk;
 };
 
 #endif //VISU_ACTOR_BASE_H
index 8ca84bc930aae89eb284c4675ed47110fa0e351c..04837dc4b4b9efc12905a57f6f5c5534632fafd2 100644 (file)
@@ -42,6 +42,7 @@
 #include <vtkCamera.h>
 #include <vtkRenderer.h>
 #include <vtkPointPicker.h>
+#include <vtkMatrix4x4.h>
 #include <vtkScalarBarWidget.h>
 #include <vtkTextMapper.h>
 #include <vtkTextProperty.h>
@@ -53,6 +54,7 @@
 #include <vtkPolyDataMapper.h>
 #include <vtkPolyData.h>
 #include <vtkActor.h>
+#include <vtkTransform.h>
 
 #include <vtkObjectFactory.h>
 #include <vtkCallbackCommand.h>
@@ -154,7 +156,10 @@ VISU_GaussPtsAct
   myEventCallbackCommand->SetClientData(this); 
   myEventCallbackCommand->SetCallback(VISU_GaussPtsAct::ProcessEvents);
 
+  vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
+
   myDeviceActor->SetProperty(GetProperty());
+  myDeviceActor->SetUserMatrix(aMatrix);
   myDeviceActor->SetVisibility(true);
   myDeviceActor->SetPickable(false);
 
@@ -174,6 +179,7 @@ VISU_GaussPtsAct
   myScalarBarCtrl->Delete();
 
   myMapper->Delete();
+  aMatrix->Delete();
 }
 
 VISU_GaussPtsAct
@@ -330,6 +336,7 @@ int
 VISU_GaussPtsAct
 ::RenderOpaqueGeometry(vtkViewport *viewport)
 {
+  GetMatrix(myDeviceActor->GetUserMatrix());
   return 1;
 }
 
@@ -337,6 +344,7 @@ int
 VISU_GaussPtsAct
 ::RenderTranslucentGeometry(vtkViewport *viewport)
 {
+  GetMatrix(myDeviceActor->GetUserMatrix());
   return 1;
 }
 
@@ -733,27 +741,47 @@ VISU_GaussPtsAct
       if(myIsPreselected){
        anIsChanged = (myLastPreHighlightObjID != anObjId);
        if(anIsChanged){
-         vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
+         vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);          
+          //Take into account translation
+          vtkFloatingPointType aLocalNodeCoord[3];
+          this->Transform->Push();
+          this->Transform->PostMultiply();
+          this->Transform->Identity();
+          
+          this->Transform->Translate(this->Position[0],
+                                     this->Position[1],
+                                     this->Position[2]);
+          double aPosition[3];
+          this->Transform->GetPosition(aPosition);
+
+          aLocalNodeCoord[0] = aNodeCoord[0] + aPosition[0]; 
+          aLocalNodeCoord[1] = aNodeCoord[1] + aPosition[1];
+          aLocalNodeCoord[2] = aNodeCoord[2] + aPosition[2];
+
          vtkDataSet* aDataSet = GetInput();
          vtkPointData* aPointData = aDataSet->GetPointData();
          if(vtkDataArray *aScalarArray = aPointData->GetScalars()){
-           vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
-           aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
-           //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
-           vtkFloatingPointType aColor[3];
-           theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
-           aColor[0] = 1. - aColor[0];
-           aColor[1] = 1. - aColor[1];
-           aColor[2] = 1. - aColor[2];
-
-           myCursorPyramid->Init(aPyramidHeight,
-                                 myPickingSettings->GetCursorSize(),
-                                 GetRadius(anObjId,aVtkId,aScalarArray),
-                                 GetMagnification(anObjId),
-                                 GetClamp(anObjId),
-                                 aNodeCoord,
-                                 aColor);
+           if ( myPickingSettings ){
+             vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
+             aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
+             //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
+             vtkFloatingPointType aColor[3];
+             theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
+             aColor[0] = 1. - aColor[0];
+             aColor[1] = 1. - aColor[1];
+             aColor[2] = 1. - aColor[2];
+
+             myCursorPyramid->Init(aPyramidHeight,
+                                   myPickingSettings->GetCursorSize(),
+                                   GetRadius(anObjId,aVtkId,aScalarArray),
+                                   GetMagnification(anObjId),
+                                   GetClamp(anObjId),
+                                   aLocalNodeCoord,
+                                   aColor);
+           }
+            
          }
+          this->Transform->Pop();
          myLastPreHighlightObjID = anObjId;
        }
        myCursorPyramid->SetVisibility(true);
@@ -776,7 +804,7 @@ ChangeZoom(VISU_PickingSettings *thePickingSettings,
           vtkIdType theInitialHasIndex,
           vtkIdType theCurrentHasIndex)
 {
-  if(theInitialHasIndex + theCurrentHasIndex == 1){
+  if( (theInitialHasIndex + theCurrentHasIndex == 1) && thePickingSettings){
     vtkCamera *aCamera = theRenderer->GetActiveCamera();
 
     vtkFloatingPointType aZoomFactor = thePickingSettings->GetZoomFactor();
@@ -901,6 +929,13 @@ VISU_GaussPtsAct
   return false;
 }
 
+
+
+void VISU_GaussPtsAct::SetPosition(double _arg[3]){
+  Superclass::SetPosition(_arg);
+  Highlight(isHighlighted());
+}
+
 //==================================================================
 // function : Highlight
 // purpose  :
@@ -912,6 +947,12 @@ VISU_GaussPtsAct
   if(!mySelector.GetPointer())
     return;
 
+  if ( !myPickingSettings )
+  {
+    Superclass::Highlight(theIsHighlight);
+    return;
+  }
+
   Selection_Mode aSelectionMode = mySelector->SelectionMode();
   
   bool anInitialHasIndex = isHighlighted() && mySelectionMode == GaussPointSelection;
@@ -923,20 +964,9 @@ VISU_GaussPtsAct
 
   myOutlineActor->SetVisibility(false);
   myCursorPyramid->SetVisibility(false);
-
-  myTextActor->SetVisibility(anIsVisible);
-  myCellActor->SetVisibility(anIsVisible);
-  GetScalarBarCtrl()->SetIsMarked(anIsVisible);
-  myCursorPyramidSelected->SetVisibility(anIsVisible);
-  //GetScalarBarCtrl()->Update();
-
-  myIsHighlighted = aCurrentHasIndex;
-
-  // Zoom if necessary
-  ChangeZoom(myPickingSettings,
-            GetRenderer(),
-            anInitialHasIndex,
-            aCurrentHasIndex);
+  myTextActor->SetVisibility(false);
+  myCellActor->SetVisibility(false);
+  myCursorPyramidSelected->SetVisibility(false);
 
   if(!theIsHighlight)
     return;
@@ -952,6 +982,20 @@ VISU_GaussPtsAct
   if ( !aCurrentHasIndex || !myBarVisibility )
     return;
 
+  myTextActor->SetVisibility(anIsVisible);
+  myCellActor->SetVisibility(anIsVisible && myPickingSettings->GetDisplayParentMesh());
+  GetScalarBarCtrl()->SetIsMarked(anIsVisible);
+  myCursorPyramidSelected->SetVisibility(anIsVisible);
+//GetScalarBarCtrl()->Update();
+
+  myIsHighlighted = aCurrentHasIndex;
+
+  // Zoom if necessary
+  ChangeZoom(myPickingSettings,
+            GetRenderer(),
+            anInitialHasIndex,
+            aCurrentHasIndex);
+
   //  TColStd_IndexedMapOfInteger aMapIndex;
   mySelector->GetIndex( getIO(), aMapIndex );
   if(aMapIndex.Extent() != 1 || !myBarVisibility) {
@@ -963,11 +1007,27 @@ VISU_GaussPtsAct
 
   int anObjId = aMapIndex(1);
   vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId);
+  if ( !aNodeCoord )
+    return;
+  //Take into account translation
+  vtkFloatingPointType aLocalNodeCoord[3];
+  this->Transform->Push();
+  this->Transform->PostMultiply();
+  this->Transform->Identity();
+  this->Transform->Translate(this->Position[0],
+                             this->Position[1],
+                             this->Position[2]);
+  double aPosition[3];
+  this->Transform->GetPosition(aPosition);
+  aLocalNodeCoord[0] = aNodeCoord[0] + aPosition[0]; 
+  aLocalNodeCoord[1] = aNodeCoord[1] + aPosition[1];
+  aLocalNodeCoord[2] = aNodeCoord[2] + aPosition[2];
+  this->Transform->Pop();
 
   vtkFloatingPointType aFocalPnt[3];
   aCamera->GetFocalPoint(aFocalPnt);
 
-  if ( !aNodeCoord || CheckIsSameVector( aNodeCoord, aFocalPnt, 3 ) ) 
+  if ( CheckIsSameVector(aLocalNodeCoord, aFocalPnt, 3 ) ) 
     return;
 
   // FlyTo
@@ -977,11 +1037,11 @@ VISU_GaussPtsAct
   
   anInteractor->SetDolly(0.0);
   anInteractor->SetNumberOfFlyFrames(myPickingSettings->GetStepNumber());
-  anInteractor->FlyTo(aRenderer, aNodeCoord);
+  anInteractor->FlyTo(aRenderer, aLocalNodeCoord);
   aRenderer->ResetCameraClippingRange();
   anInteractor->SetDolly(aDollyWas);
   anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
-  anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aNodeCoord);
+  anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aLocalNodeCoord);
   //
   std::ostringstream aStr;
   //  int anObjId = aMapIndex(1);
@@ -989,8 +1049,7 @@ VISU_GaussPtsAct
   //
   vtkIdType aVtkId = GetNodeVTKID(anObjId);
   if(aVtkId >= 0){
-    vtkFloatingPointType *aNodeCoord = GetNodeCoord(anObjId);
-    vtkFloatingPointType aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.};
+    vtkFloatingPointType aWorldCoord[4] = {aLocalNodeCoord[0], aLocalNodeCoord[1], aLocalNodeCoord[2], 1.};
     //
     vtkDataSet* aDataSet = GetInput();
     vtkPointData* aDataSetAttributes = aDataSet->GetPointData();
@@ -1009,7 +1068,7 @@ VISU_GaussPtsAct
                                    GetRadius(anObjId,aVtkId,aScalarArray),
                                    GetMagnification(anObjId),
                                    GetClamp(anObjId),
-                                   aNodeCoord,
+                                   aLocalNodeCoord,
                                    myHighlightActor->GetProperty()->GetColor());
       myCursorPyramidSelected->SetVisibility(anIsVisible && theIsHighlight);
       //
@@ -1071,6 +1130,8 @@ VISU_GaussPtsAct
       myCellActor->SetVisibility(anIsVisible && theIsHighlight);
       myCellActor->SetRepresentation(VTK_WIREFRAME);
     }
+    else
+      myCellActor->SetVisibility(false);
   }
 }
 
@@ -1101,7 +1162,7 @@ void
 VISU_GaussPtsAct
 ::UpdatePickingSettings()
 {
-  if(!myPickingSettings || myPickingSettings->GetInitial())
+  if(!myPickingSettings)
     return;
 
   myTextActor->SetModePosition(myPickingSettings->GetInfoWindowPosition());
@@ -1210,13 +1271,18 @@ VISU_GaussPtsAct1
 
   myEventCallbackCommand->SetCallback(VISU_GaussPtsAct1::ProcessEvents);
 
+  vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
+
   myInsideDeviceActor->SetVisibility(false);
   myInsideDeviceActor->SetPickable(false);
+  myInsideDeviceActor->SetUserMatrix(aMatrix);
   myInsideDeviceActor->Delete();
 
   myOutsideDeviceActor->SetVisibility(false);
   myOutsideDeviceActor->SetPickable(false);
+  myOutsideDeviceActor->SetUserMatrix(aMatrix);
   myOutsideDeviceActor->Delete();
+  aMatrix->Delete();
 }
 
 VISU_GaussPtsAct1
@@ -1273,6 +1339,28 @@ VISU_GaussPtsAct1
 }
 
 
+int
+VISU_GaussPtsAct1
+::RenderOpaqueGeometry(vtkViewport *viewport)
+{
+
+  Superclass::RenderOpaqueGeometry(viewport);
+  GetMatrix(myInsideDeviceActor->GetUserMatrix());
+  GetMatrix(myOutsideDeviceActor->GetUserMatrix());
+  return 1;
+}
+
+int
+VISU_GaussPtsAct1
+::RenderTranslucentGeometry(vtkViewport *viewport)
+{ 
+  Superclass::RenderTranslucentGeometry(viewport);
+  GetMatrix(myInsideDeviceActor->GetUserMatrix());
+  GetMatrix(myOutsideDeviceActor->GetUserMatrix());
+
+  return 1;
+}
+
 //----------------------------------------------------------------------------
 void
 VISU_GaussPtsAct1
@@ -1378,11 +1466,20 @@ VISU_GaussPtsAct1
 
 
 //----------------------------------------------------------------
+
+void 
+VISU_GaussPtsAct1::SetPosition(double _arg[3]){
+  if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct1::SetPosition - this = "<<this);              
+  Superclass::SetPosition(_arg);
+  myUpdatePositionSignal(_arg);
+}
+
 void 
 VISU_GaussPtsAct1
 ::Connect(VISU_GaussPtsAct2* theActor)
 {
   mySetVisibilitySignal.connect(boost::bind(&VISU_GaussPtsAct2::SetVisibility,theActor,_1));
+  myUpdatePositionSignal.connect(boost::bind(&VISU_GaussPtsAct2::SetPosition, theActor,_1));
 }
 
 void
@@ -1574,6 +1671,12 @@ VISU_GaussPtsAct2
   Superclass::ShallowCopyPL(thePipeLine);
 }
 
+//----------------------------------------------------------------------------
+void
+VISU_GaussPtsAct2::SetPosition(double _arg[3]){
+  if(MYDEBUG1) MESSAGE("VISU_GaussPtsAct2::SetPosition - this = "<<this);      
+  Superclass::SetPosition(_arg);
+}
 
 //----------------------------------------------------------------------------
 void
index 5cf5086f746597e2c12b61ffc52f4d49f35ed857..4685f60dc9b00464913aa8d14879ba8e96369f3e 100644 (file)
@@ -132,6 +132,10 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   VISU::TGaussPtsActorFactory*
   GetGaussPtsFactory();    
 
+  virtual
+  void 
+  SetPosition(double _arg[3]);
+
   //----------------------------------------------------------------------------
   //! Add actor to the renderer.
   virtual
@@ -399,6 +403,20 @@ class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct
   void
   SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
 
+  //! Redefined method of rendering the Opaque Geometry.
+  virtual
+  int
+  RenderOpaqueGeometry(vtkViewport *viewport);
+
+  //! Redefined method of rendering the Translucent Geometry.
+  virtual
+  int
+  RenderTranslucentGeometry(vtkViewport *viewport);
+                     
+  virtual
+  void 
+  SetPosition(double _arg[3]);
+
   //! Gets memory size used by the instance (bytes).
   virtual
   unsigned long int
@@ -448,6 +466,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct
   OnInteractorEvent(unsigned long theEvent);
 
   boost::signal1<void,int> mySetVisibilitySignal;
+  boost::signal1<void,double*> myUpdatePositionSignal;
   VISU_OutsideCursorSettings* myOutsideCursorSettings;
 
   //----------------------------------------------------------------------------
@@ -489,7 +508,11 @@ class VTKOCC_EXPORT VISU_GaussPtsAct2 : public VISU_GaussPtsAct
   virtual
   unsigned long int
   GetMemorySize();
+                     
+  virtual
+  void 
+  SetPosition(double _arg[3]);
+  
  protected:
   //----------------------------------------------------------------------------
   VISU_GaussPtsAct2();
index e1c592481080ec5d5b362df1dcd3b707bde2de84..7c04a8f02434759b52fa2dc1df9b85ab35ac7350 100644 (file)
 //  $Header$
 
 #include "VISU_GaussPtsSettings.h"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
 
 #include <vtkObjectFactory.h>
 #include <vtkImageData.h>
 
+#include <QColor>
+
 //----------------------------------------------------------------
 vtkStandardNewMacro( VISU_GaussPtsSettings );
 vtkStandardNewMacro( VISU_InsideCursorSettings );
@@ -86,19 +90,38 @@ VISU_OutsideCursorSettings::~VISU_OutsideCursorSettings()
 //----------------------------------------------------------------
 VISU_PickingSettings::VISU_PickingSettings()
 {
-  this->Initial                = true;
+  float aCursorSize = 0.5;
+  float aPyramidHeight = 10.0;
+  float aPointTolerance = 0.1;
+  QColor aColor = Qt::yellow;
+  int anInfoWindowTransparency = 50;
+  int anInfoWindowPosition = VISU_PickingSettings::BelowPoint;
+  float aZoomFactor = 1.5;
+  int aStepNumber = 10;
+  bool aDisplayParentMesh = false;
+  
+  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
 
-  this->PyramidHeight          = -1;
-  this->CursorSize             = -1;
-  this->PointTolerance         = -1;
-  this->Color[0]               = -1;
-  this->Color[1]               = -1;
-  this->Color[2]               = -1;
-  this->InfoWindowTransparency = -1;
-  this->InfoWindowPosition     = -1;
-  this->ZoomFactor             = -1;
-  this->StepNumber             = -1;
-  this->DisplayParentMesh      = false;
+  this->CursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize );
+
+  this->PyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight );
+
+  this->PointTolerance = aResourceMgr->doubleValue( "VISU", "picking_point_tolerance", aPointTolerance );
+
+  aColor = aResourceMgr->colorValue( "VISU", "picking_selection_color", aColor );
+  this->Color[0] = aColor.red() / 255.0;
+  this->Color[1] = aColor.green() / 255.0;
+  this->Color[2] = aColor.blue() / 255.0;
+
+  this->InfoWindowTransparency = aResourceMgr->integerValue( "VISU", "picking_transparency", anInfoWindowTransparency ) / 100.0;
+
+  this->InfoWindowPosition = aResourceMgr->integerValue( "VISU", "picking_position", anInfoWindowPosition );
+
+  this->ZoomFactor = aResourceMgr->doubleValue( "VISU", "picking_zoom_factor", aZoomFactor );
+  
+  this->StepNumber = aResourceMgr->integerValue( "VISU", "picking_step_number", aStepNumber );
+
+  this->DisplayParentMesh = aResourceMgr->booleanValue( "VISU", "picking_display_parent_mesh", aDisplayParentMesh );
 }
 
 VISU_PickingSettings::~VISU_PickingSettings()
index 473ddd103d5420e616005110bd3dffb77939a52f..a34dbca6cfeb72a67c2382c845305b608e9efd63 100644 (file)
@@ -186,9 +186,6 @@ class VTKOCC_EXPORT VISU_PickingSettings : public vtkObject
   VISU_PickingSettings*
   New();
 
-  vtkSetMacro( Initial, bool );
-  vtkGetMacro( Initial, bool );
-
   vtkSetMacro( PyramidHeight, vtkFloatingPointType );
   vtkGetMacro( PyramidHeight, vtkFloatingPointType );
 
@@ -217,8 +214,6 @@ class VTKOCC_EXPORT VISU_PickingSettings : public vtkObject
   vtkGetMacro( DisplayParentMesh, bool );
 
 private:
-  bool                Initial;
-
   vtkFloatingPointType PyramidHeight;
   vtkFloatingPointType CursorSize;
   vtkFloatingPointType PointTolerance;
diff --git a/src/OBJECT/VISU_IsoSurfActor.cxx b/src/OBJECT/VISU_IsoSurfActor.cxx
new file mode 100644 (file)
index 0000000..3c58fc4
--- /dev/null
@@ -0,0 +1,165 @@
+//  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_IsoSurfActor.cxx
+//  Author : Vitaly Smetannikov
+//  Module : VISU
+
+
+#include "VISU_IsoSurfActor.h"
+#include "VISU_PipeLine.hxx"
+#include "VISU_LabelPointsFilter.hxx"
+
+
+#include <vtkObjectFactory.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkPolyData.h>
+#include <vtkActor2D.h>
+//#include <vtkMaskPoints.h>
+#include <vtkLabeledDataMapper.h>
+#include <vtkProperty2D.h>
+#include <vtkRenderer.h>
+#include <vtkCellArray.h>
+#include <vtkPointData.h>
+
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VISU_IsoSurfActor);
+
+
+//----------------------------------------------------------------------------
+VISU_IsoSurfActor::VISU_IsoSurfActor():
+  VISU_ScalarMapAct(),
+  myIsLinesLabeled(true)
+{
+  myLabelsDataSet = vtkPolyData::New();
+
+//   myMaskPoints = vtkMaskPoints::New();
+//   myMaskPoints->SetInput(myLabelsDataSet);
+//   myMaskPoints->SetOnRatio(100);
+
+  myMaskPoints = VISU_LabelPointsFilter::New();
+  myMaskPoints->SetInput(myLabelsDataSet);
+
+  myLabeledDataMapper = vtkLabeledDataMapper::New();
+  myLabeledDataMapper->SetInput(myMaskPoints->GetOutput());
+  //myLabeledDataMapper->SetLabelFormat("%e");
+  myLabeledDataMapper->SetLabelModeToLabelScalars();
+    
+  myLabels = vtkActor2D::New();
+  myLabels->SetMapper(myLabeledDataMapper);
+  myLabels->GetProperty()->SetColor(1,1,1);
+  myLabels->SetVisibility(myIsLinesLabeled);
+}
+
+
+//----------------------------------------------------------------------------
+VISU_IsoSurfActor::~VISU_IsoSurfActor()
+{
+  myLabelsDataSet->Delete();
+  myMaskPoints->Delete();
+  myLabeledDataMapper->Delete();
+  myLabels->Delete();
+}
+
+//----------------------------------------------------------------------------
+void VISU_IsoSurfActor::SetLinesLabeled(bool theIsLinesLabeled, int theNbLbl)
+{
+  myIsLinesLabeled = theIsLinesLabeled;
+  myMaskPoints->SetPointsNb(theNbLbl);
+  Modified();
+}
+//----------------------------------------------------------------------------
+int VISU_IsoSurfActor::GetNbLabels() const 
+{ 
+  return myMaskPoints->GetPointsNb(); 
+}
+
+
+//----------------------------------------------------------------------------
+void VISU_IsoSurfActor::UpdateLabels()
+{
+  if (myIsLinesLabeled) {
+    vtkDataSet* aDataSet = GetPipeLine()->GetOutput();
+    if (aDataSet != NULL) {
+      unsigned long aTime = myLabelsDataSet->GetMTime();
+      unsigned long anObjTime = GetMTime();
+      if (aTime < anObjTime) {
+       myLabelsDataSet->ShallowCopy(aDataSet);
+       myLabelsDataSet->Modified();
+      }
+    }
+  }
+  myLabels->SetVisibility(myIsLinesLabeled);
+}
+
+
+//----------------------------------------------------------------------------
+void VISU_IsoSurfActor::AddToRender(vtkRenderer* theRenderer)
+{
+  VISU_ScalarMapAct::AddToRender(theRenderer);
+  theRenderer->AddActor2D(myLabels);
+}
+
+//----------------------------------------------------------------------------
+void VISU_IsoSurfActor::RemoveFromRender(vtkRenderer* theRenderer)
+{
+  VISU_ScalarMapAct::RemoveFromRender(theRenderer);
+  theRenderer->RemoveActor(myLabels);
+}
+
+//From vtkFollower
+int VISU_IsoSurfActor::RenderOpaqueGeometry(vtkViewport *vp)
+{
+  UpdateLabels();
+  return VISU_ScalarMapAct::RenderOpaqueGeometry(vp);
+}
+
+
+int VISU_IsoSurfActor::RenderTranslucentGeometry(vtkViewport *vp)
+{
+  UpdateLabels();
+  return VISU_ScalarMapAct::RenderTranslucentGeometry(vp);
+}
+
+void VISU_IsoSurfActor::SetVisibility(int theMode){
+  VISU_ScalarMapAct::SetVisibility(theMode);
+  if(GetVisibility())
+    myLabels->VisibilityOn();
+  else
+    myLabels->VisibilityOff();
+  Modified();
+}
+
+
+///!!!! For test purposes only
+// void VISU_IsoSurfActor::SetMapperInput(vtkDataSet* theDataSet)
+// {
+//   VISU_ScalarMapAct::SetMapperInput(theDataSet);
+
+//   vtkFeatureEdges* aFilter = vtkFeatureEdges::New();
+//   aFilter->SetInput(VISU_ScalarMapAct::GetInput());
+//   SetInput(aFilter->GetOutput());
+// }
diff --git a/src/OBJECT/VISU_IsoSurfActor.h b/src/OBJECT/VISU_IsoSurfActor.h
new file mode 100644 (file)
index 0000000..0377ae6
--- /dev/null
@@ -0,0 +1,88 @@
+//  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_IsoSurfActor.h
+//  Author : Vitaly Smetannikov
+//  Module : VISU
+
+
+#ifndef VISU_VectorsAct_HeaderFile
+#define VISU_VectorsAct_HeaderFile
+
+#include "VISU_ScalarMapAct.h"
+
+class vtkActor2D;
+//class vtkMaskPoints;
+class vtkLabeledDataMapper;
+class vtkPolyData;
+class VISU_LabelPointsFilter;
+
+
+class VTKOCC_EXPORT VISU_IsoSurfActor : public VISU_ScalarMapAct 
+{
+ public:
+  vtkTypeMacro(VISU_IsoSurfActor, VISU_ScalarMapAct);
+  
+  static VISU_IsoSurfActor* New();
+  
+  
+  //----------------------------------------------------------------------------
+  virtual void AddToRender( vtkRenderer* ); 
+  
+  virtual void RemoveFromRender( vtkRenderer* );
+
+  virtual int RenderOpaqueGeometry(vtkViewport *viewport);
+  virtual int RenderTranslucentGeometry(vtkViewport *viewport);
+  
+  //virtual void SetPipeLine(VISU_PipeLine* thePipeLine);
+
+  void SetLinesLabeled(bool theIsLinesLabeled, int theNbLbl);
+  bool GetLinesLabeled() const { return myIsLinesLabeled;}
+   
+  int GetNbLabels() const;
+
+
+  //----------------------------------------------------------------------------
+  //! Visibility management
+  virtual void SetVisibility( int );
+
+
+ protected:
+
+  VISU_IsoSurfActor();
+  ~VISU_IsoSurfActor();
+
+  void UpdateLabels();
+
+  vtkActor2D *myLabels;
+  vtkLabeledDataMapper* myLabeledDataMapper;
+  //vtkMaskPoints* myMaskPoints;
+  VISU_LabelPointsFilter* myMaskPoints;
+  vtkPolyData* myLabelsDataSet;
+
+  bool myIsLinesLabeled;
+  //int myNbLabels;
+};
+
+
+#endif
index 99e31230dc5de8c091dffb55328283e356742536..933cf60b267a4f05ba41c01e125d27beec638a2c 100644 (file)
 
 #include <SALOME_InteractiveObject.hxx>
 
+#include "utilities.h"
 #include <vtkRenderer.h>
 #include <vtkObjectFactory.h>
 
-//using namespace std;
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
 vtkStandardNewMacro(VISU_PointMap3dActor);
 
 //==================================================================
@@ -47,6 +53,7 @@ vtkStandardNewMacro(VISU_PointMap3dActor);
 VISU_PointMap3dActor
 ::VISU_PointMap3dActor()
 {
+  if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::VISU_PointMap3dActor - this = "<<this);
   myScalarBar = VISU_ScalarBarActor::New();
 }
 
@@ -58,6 +65,7 @@ VISU_PointMap3dActor
 VISU_PointMap3dActor
 ::~VISU_PointMap3dActor()
 {
+  if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::~VISU_PointMap3dActor - this = "<<this);
   myScalarBar->Delete();
 }
 
index 428cbb50e8f3bcd0fb1027c25599bf2fc6435ae7..7a157e232ad164694686f4be779f217a9533c8f2 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "VISU_VectorsAct.h"
 #include "VISU_VectorsPL.hxx"
+#include <SVTK_Actor.h>
  
 // VTK Includes
 #include <vtkObjectFactory.h>
@@ -58,8 +59,9 @@ void
 VISU_VectorsAct
 ::SetPipeLine(VISU_PipeLine* thePipeLine) 
 {
-  myVectorsPL = dynamic_cast<VISU_VectorsPL*>(thePipeLine);
-  VISU_Actor::SetPipeLine(myVectorsPL.GetPointer());
+  myVectorsPL = dynamic_cast<VISU_VectorsPL*>( thePipeLine );
+
+  Superclass::SetPipeLine( myVectorsPL.GetPointer() );
 }
 
 
@@ -77,8 +79,9 @@ void
 VISU_VectorsAct
 ::SetTransform(VTKViewer_Transform* theTransform)
 {
-  Superclass::SetTransform(theTransform);
-  myVectorsPL->SetTransform(theTransform);
+  // To perform only vector's specific action,
+  // there is nothing to be done for the Superclass
+  myVectorsPL->SetTransform( theTransform );
 }
 
 
@@ -101,6 +104,7 @@ VISU_VectorsAct
     else if(vtkPolyDataMapper* aMapper = dynamic_cast<vtkPolyDataMapper*>(theMapper))
       aMapper->SetInput(myPassFilter[3]->GetPolyDataOutput());
   }
+
   vtkLODActor::SetMapper(theMapper);
 }
 
index adb0d87b99190a0232de32b6d0732c552ce13641..425f955cf39f64d55aed1e00d963912dde6c0b37 100644 (file)
@@ -63,8 +63,13 @@ salomeinclude_HEADERS= \
        VISU_PlanesWidget.hxx \
        VISU_SphereWidget.hxx \
        VISU_WidgetCtrl.hxx \
-       VISU_ScalarMapOnDeformedShapePL.hxx \
-       VISUPipeline.hxx
+       VISU_DeformedShapeAndScalarMapPL.hxx \
+       VISUPipeline.hxx \
+       VISU_LabelPointsFilter.hxx \
+       VISU_ElnoDisassembleFilter.hxx \
+       VISU_ElnoAssembleFilter.hxx \
+       VISU_DeformationPL.hxx \
+       VISU_OptionalDeformationPL.hxx 
 
 dist_libVisuPipeLine_la_SOURCES= \
        VISU_MapperHolder.cxx \
@@ -101,7 +106,12 @@ dist_libVisuPipeLine_la_SOURCES= \
        VISU_SphereWidget.cxx \
        VISU_WidgetCtrl.cxx \
        VISU_ScalarBarCtrl.cxx \
-       VISU_ScalarMapOnDeformedShapePL.cxx
+       VISU_DeformedShapeAndScalarMapPL.cxx \
+       VISU_LabelPointsFilter.cxx \
+       VISU_ElnoDisassembleFilter.cxx \
+       VISU_ElnoAssembleFilter.cxx \
+       VISU_DeformationPL.cxx \
+       VISU_OptionalDeformationPL.cxx
 
 libVisuPipeLine_la_CPPFLAGS= \
        $(VTK_INCLUDES) \
index 4b658ba135a4c2261ce11c438efdd2b8c56b7251..291c457a1a936c9278dd1fa12baf3ec5adb58d01 100644 (file)
 // Author:  Alexey PETROV
 // Module : VISU
 
+
+// Salome includes
+#include "VISU_Convertor.hxx"
+#include "VISU_ConvertorUtils.hxx"
+
 #include "VISU_MeshPL.hxx"
 #include "VISU_ScalarMapPL.hxx"
 #include "VISU_IsoSurfacesPL.hxx"
 #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"
-
-#include "VISU_DeformedGridPL.hxx"
 
+#include "VISU_ScalarBarActor.hxx"
 #include "VISU_OpenGLPointSpriteMapper.hxx"
 #include "VTKViewer_GeometryFilter.h"
-#include <vtkMaskPoints.h>
 
-#include "VISU_Convertor.hxx"
-#include "VISU_TableReader.hxx"
-#include "VISU_ConvertorUtils.hxx"
+#include "VISU_ElnoDisassembleFilter.hxx"
+#include "VISU_ElnoAssembleFilter.hxx"
 
-typedef VISU_StreamLinesPL TPresent;
+typedef VISU_ScalarMapPL TPresent;
 
+// VTK includes
+#include <vtkShrinkFilter.h>
+#include <vtkPointLocator.h>
+#include <vtkCutter.h>
+#include <vtkPlane.h>
+#include <vtkWarpVector.h>
+#include <vtkScalarBarActor.h>
+#include <vtkScalarBarWidget.h>
+#include <vtkMaskPoints.h>
+#include <vtkUnstructuredGridReader.h>
 #include <vtkUnstructuredGrid.h>
 #include <vtkDataSetMapper.h>
-
 #include <vtkInteractorStyleTrackballCamera.h>
 #include <vtkRenderWindowInteractor.h>
 #include <vtkRenderWindow.h>
 #include <vtkImageData.h>
+#include <vtkCellData.h>
 #include <vtkRenderer.h>
 #include <vtkCamera.h>
 #include <vtkActor.h>
 #include <vtk3DWidget.h>
-
 #include <vtkProperty.h>
 
-#include <QFileInfo>
-
-#include <memory>
-
-//#define _DEBUG_ID_MAPPING_
-
-//----------------------------------------------------------------------------
-template<class TPipeLine>
-VISU_ColoredPL*
-CreateColoredPL(VISU_Convertor* theConvertor,
-               const std::string& theMeshName,
-               const VISU::TEntity& theEntity,
-               const std::string& theFieldName,
-               int theTimeStampNumber);
-
+#include "utilities.h"
 
-//----------------------------------------------------------------------------
-template<>
-VISU_ColoredPL*
-CreateColoredPL<VISU_GaussPointsPL>(VISU_Convertor* theConvertor,
-                                   const std::string& theMeshName,
-                                   const VISU::TEntity& theEntity,
-                                   const std::string& theFieldName,
-                                   int theTimeStampNumber)
-{
-  VISU_GaussPointsPL* aPresent = VISU_GaussPointsPL::New();
-  VISU::PGaussPtsIDMapper aGaussPtsIDMapper = 
-    theConvertor->GetTimeStampOnGaussPts(theMeshName,
-                                        theEntity,
-                                        theFieldName,
-                                        theTimeStampNumber);
-  aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper);
-
-  char aMainTexture[80];
-  strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
-  strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.bmp" );
-  
-  char anAlphaTexture[80];
-  strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
-  strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.bmp" );
-  
-  vtkSmartPointer<vtkImageData> aTextureValue = 
-    VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
-  aPresent->SetImageData( aTextureValue.GetPointer() );
-
-  aPresent->Update();
-
-#ifdef _DEBUG_ID_MAPPING_
-  vtkDataSet* aDataSet = aPresent->GetOutput();
-  aDataSet->Update();
-  int aNbCells = aDataSet->GetNumberOfCells();
-  cout<<"aNbCells = "<<aNbCells<<endl;
-  for(int anCellId = 0; anCellId < aNbCells; anCellId++){
-    vtkIdType anObjID = aPresent->GetNodeObjID(anCellId);
-    vtkIdType aVtkID = aPresent->GetNodeVTKID(anObjID);
-    cout<<anObjID<<"; "<<aVtkID<<"; - ";
-    vtkFloatingPointType* aCoord = aPresent->GetNodeCoord(anObjID);
-    cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
-  }
-#endif
-
-  return aPresent;
+void PrintMissing(){
+  MESSAGE(std::endl << "VISUPipeLine : missing operand after `VISUPipeLine'" <<
+          std::endl << "VISUPipeLine : Try `VISUPipeLine -h' for more information.");
 }
 
-
-//----------------------------------------------------------------------------
-template<class TPipeLine>
-VISU_ColoredPL*
-CreateColoredPL(VISU_Convertor* theConvertor,
-               const std::string& theMeshName,
-               const VISU::TEntity& theEntity,
-               const std::string& theFieldName,
-               int theTimeStampNumber)
-{
-  TPipeLine* aPresent = TPipeLine::New();
-  VISU::PUnstructuredGridIDMapper anUnstructuredGridIDMapper = 
-    theConvertor->GetTimeStampOnMesh(theMeshName,
-                                    theEntity,
-                                    theFieldName,
-                                    theTimeStampNumber);
-  aPresent->SetUnstructuredGridIDMapper(anUnstructuredGridIDMapper);
-
-  //aPresent->ClearGeometry();
-  //{
-  //  VISU::PUnstructuredGridIDMapper anIDMapper = 
-  //    theConvertor->GetMeshOnGroup(theMeshName,
-  //                              "groupe1");
-  //  aPresent->AddGeometry(anIDMapper->GetOutput());
-  //}
-  //{
-  //  VISU::PUnstructuredGridIDMapper anIDMapper = 
-  //    theConvertor->GetMeshOnGroup(theMeshName,
-  //                              "TUBEH                                                                           ");
-  //  aPresent->AddGeometry(anIDMapper->GetOutput());
-  //}
-  //{
-  //  VISU::PUnstructuredGridIDMapper anIDMapper = 
-  //    theConvertor->GetMeshOnGroup(theMeshName,
-  //                              "STRI                                                                            ");
-  //  aPresent->AddGeometry(anIDMapper->GetOutput());
-  //}
-  aPresent->Update();
-  return aPresent;
+void PrintHelp(){
+  MESSAGE_ADD(std::endl << " Usage: VISUPipeLine filename meshname fieldname [timestamp] [component] " <<
+              std::endl << "filename   - Name of the med file.                                       " <<
+              std::endl << "meshname   - Name of the mesh in the med file.                           " <<
+              std::endl << "fieldname  - Name of the mesh field.                                     " <<
+              std::endl << "timestamp  - Number of the time stamp in the field 1,2,3 ... (optionally)" <<
+              std::endl << "             by default used first time stamp.                           " <<
+              std::endl << "component  - Number of the component in the field 0,1,2,3 ...(optionally)" <<
+              std::endl << "             0 - modulus, 1 - first component, 2 - second component, ... " <<
+              std::endl << "             by default used modulus.                                    ");
 }
 
-
-//----------------------------------------------------------------------------
-struct TMEDSource
-{
-  std::auto_ptr<VISU_Convertor> myConvertor;
-
-  TMEDSource(char** argv): myConvertor(CreateConvertor(argv[1]))
-  {
-    myConvertor->BuildEntities();
-  }
-};
-
-
-//----------------------------------------------------------------------------
-struct TMeshBulder: TMEDSource
-{
-  TMeshBulder(char** argv): TMEDSource(argv)
-  {}
-
-  int Publish(vtkRenderer *theRenderer) const
-  {
-    const VISU::TMeshMap& aMeshMap = myConvertor->GetMeshMap();
-    VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
-    if(aMeshMapIter == aMeshMap.end()) 
-      return 0;
-
-    const std::string& aMeshName = aMeshMapIter->first;
-    const VISU::PMesh aMesh = aMeshMapIter->second;
-    const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
-    VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
-
-    VISU::TEntity anEntity = VISU::CELL_ENTITY;
-    aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
-
-    VISU::PNamedIDMapper anIDMapper = myConvertor->GetMeshOnEntity(aMeshName, anEntity);
-
-    VISU_MeshPL* aPresent = VISU_MeshPL::New();
-    aPresent->SetUnstructuredGridIDMapper(anIDMapper);
-
-    vtkActor* anActor = vtkActor::New();
-    anActor->SetMapper(aPresent->GetMapper());
-    anActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
-
-    theRenderer->AddActor(anActor);
-    anActor->Delete();
-
-    return 0;
-  }
-};
+void PrintErr(){
+  MESSAGE("***************************ERROR*****************************************");
+}
 
 
 //----------------------------------------------------------------------------
-struct TColoredPrsBulder: TMEDSource
+int
+main(int argc, char** argv)
 {
-  TColoredPrsBulder(char** argv): TMEDSource(argv)
-  {}
-
-  int Publish(vtkRenderer *theRenderer) const
-  {
-    myConvertor->BuildGroups();
-    myConvertor->BuildFields();
-    myConvertor->BuildMinMax();
-    const VISU::TMeshMap& aMeshMap = myConvertor->GetMeshMap();
-    VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
-    if(aMeshMapIter == aMeshMap.end()) 
-      return 0;
-
-    const std::string& aMeshName = aMeshMapIter->first;
-    const VISU::PMesh aMesh = aMeshMapIter->second;
-    const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
-    VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
-
-    //Import fields
-    aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
-    for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) {
-      const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
-      const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
-      const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
-      VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
-      for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
-       const VISU::PField aField = aFieldMapIter->second;
-       //if(aField->myNbComp == 1) 
-       //  continue;
-       const std::string& aFieldName = aFieldMapIter->first;
-       const VISU::TValField& aValField = aField->myValField;
-       VISU::TValField::const_reverse_iterator aValFieldIter = aValField.rbegin();
-       if(aValFieldIter == aValField.rend()) 
-         return 0;
-
-       int aTimeStamp = aValFieldIter->first;
-       
-       VISU_ColoredPL* aPresent = NULL;
-       if(anEntity != VISU::NODE_ENTITY){
-         aPresent = CreateColoredPL<TPresent>(myConvertor.get(),
-                                              aMeshName,
-                                              anEntity,
-                                              aFieldName,
-                                              aTimeStamp);
-         
-       }else{
-         continue;
-         aPresent = CreateColoredPL<TPresent>(myConvertor.get(),
-                                              aMeshName,
-                                              anEntity,
-                                              aFieldName,
-                                              aTimeStamp);
-       }
-
-       vtkActor* anActor = vtkActor::New();
-       anActor->SetMapper(aPresent->GetMapper());
-       
-       VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
-       aScalarBar->SetLookupTable(aPresent->GetBarTable());
-       
-       theRenderer->AddActor(anActor);
-       anActor->Delete();
-
-       theRenderer->AddActor2D(aScalarBar);
-       aScalarBar->Delete();
-     }
+  try{
+    if(argc == 1){
+      PrintMissing();
+      return 1;
+    }
+    if(argc == 2 && !strcmp(argv[1],"-h")) {
+      PrintHelp();
+      return 1;
     }
-    return 0;
-  }
-};
-
-
-//----------------------------------------------------------------------------
-struct TXLSSource
-{
-  VISU::TTableContainer myContainer;
-
-  TXLSSource(char** argv)
-  {
-    VISU::ImportTables( argv[1], myContainer );
-  }
-
-  int Publish(vtkRenderer *theRenderer) const
-  {
-    if ( myContainer.empty() )
-      return 0;
-
-    VISU::PPolyDataIDMapper anIDMapper = myContainer[0];
-
-    VISU_DeformedGridPL* aPresent = VISU_DeformedGridPL::New();
-    aPresent->SetPolyDataIDMapper(anIDMapper);
-    //aPresent->SetContourPrs( true );
-    aPresent->Update();
-
-    vtkActor* anActor = vtkActor::New();
-    anActor->SetMapper(aPresent->GetMapper());
-
-    theRenderer->AddActor(anActor);
-    anActor->Delete();
     
-    VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
-    aScalarBar->SetLookupTable(aPresent->GetBarTable());
+    char* aFileName =0;
+    char* aMeshName =0;
+    char* aFieldName =0;
+    int aTimeStampNumber = 1;
+    int aComponentNumber  = 0;
+    bool allInit = false;
+    bool isMeshOk = false;
+    bool isFieldOk = false;
+    bool isTimeStampOk = false;
+    bool isComponentOk = false;
+
+    if(argc == 4 ){
+      aFileName = new char[static_cast<int>(strlen(argv[1])) + 1];
+      aMeshName = new char[static_cast<int>(strlen(argv[2])) + 1];
+      aFieldName = new char[static_cast<int>(strlen(argv[3])) + 1];
+      
+      strcpy(aFileName,argv[1]);
+      strcpy(aMeshName,argv[2]);
+      strcpy(aFieldName,argv[3]);
+      
+      allInit = true;
+    }
+
+    if(argc == 5) {
+      aFileName = new char[static_cast<int>(strlen(argv[1])) + 1];
+      aMeshName = new char[static_cast<int>(strlen(argv[2])) + 1];
+      aFieldName = new char[static_cast<int>(strlen(argv[3])) + 1];
+      
+      strcpy(aFileName,argv[1]);
+      strcpy(aMeshName,argv[2]);
+      strcpy(aFieldName,argv[3]);
+
+      aTimeStampNumber = atoi(argv[4]);
+      allInit = true;
+    }
     
-    theRenderer->AddActor2D(aScalarBar);
-    aScalarBar->Delete();
+    if(argc == 6) {
+      aFileName = new char[static_cast<int>(strlen(argv[1])) + 1];
+      aMeshName = new char[static_cast<int>(strlen(argv[2])) + 1];
+      aFieldName = new char[static_cast<int>(strlen(argv[3])) + 1];
+      
+      strcpy(aFileName,argv[1]);
+      strcpy(aMeshName,argv[2]);
+      strcpy(aFieldName,argv[3]);
+
+      aTimeStampNumber = atoi(argv[4]);
+      aComponentNumber = atoi(argv[5]);
+      allInit = true;
+    }
     
-    return 0;
-  }
-};
-
 
-//----------------------------------------------------------------------------
-template<class TPrsBuilder>
-int RenderPresentation(const TPrsBuilder& thePrsBuilder)
-{
-  vtkRenderWindow *aWindow = vtkRenderWindow::New();
-  vtkRenderer *aRenderer = vtkRenderer::New();
-  
-  aWindow->AddRenderer(aRenderer);
-  aRenderer->GetActiveCamera()->ParallelProjectionOn();
-  
-  vtkRenderWindowInteractor *anInteractor = vtkRenderWindowInteractor::New();
-  anInteractor->SetRenderWindow(aWindow);
-  aWindow->Delete();
-  
-  vtkInteractorStyle* aStyle = vtkInteractorStyleTrackballCamera::New();
-  anInteractor->SetInteractorStyle(aStyle);
-  aStyle->Delete();
-  
-  int aRet = thePrsBuilder.Publish(aRenderer);
-  
-  aWindow->Render();
-  anInteractor->Start();
-
-  return aRet;
-}
 
-
-//----------------------------------------------------------------------------
-int
-main(int argc, char** argv)
-{
-  try{
-    if (argc > 1) {
-      QFileInfo aFileInfo( argv[1] );
-      if ( aFileInfo.isFile() ) {
-       QString anExtension = aFileInfo.suffix();
-       if ( anExtension == "med" ) {
-         //TMeshBulder aBuilder( argv );
-         TColoredPrsBulder aBuilder( argv );
-         return RenderPresentation( aBuilder );
-       } else if ( anExtension == "xls" || anExtension == "txt" )
-         return RenderPresentation( TXLSSource( argv ) );
+    if(allInit){
+            
+      vtkRenderWindow *aWindow = vtkRenderWindow::New();
+      vtkRenderer *aRenderer = vtkRenderer::New();
+
+      aWindow->AddRenderer(aRenderer);
+      aRenderer->GetActiveCamera()->ParallelProjectionOn();
+
+      vtkRenderWindowInteractor *anInteractor = vtkRenderWindowInteractor::New();
+      anInteractor->SetRenderWindow(aWindow);
+      aWindow->Delete();
+
+      vtkInteractorStyle* aStyle = vtkInteractorStyleTrackballCamera::New();
+      anInteractor->SetInteractorStyle(aStyle);
+      aStyle->Delete();
+
+      VISU_Convertor* aConvertor = CreateConvertor(aFileName);
+      aConvertor->BuildEntities();
+      aConvertor->BuildGroups();
+      aConvertor->BuildFields();
+      aConvertor->BuildMinMax();
+      const VISU::TMeshMap& aMeshMap = aConvertor->GetMeshMap();
+      VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+      if(aMeshMapIter == aMeshMap.end()) return 0;
+      //Iterate by meshes
+      for (;aMeshMapIter != aMeshMap.end();aMeshMapIter++) {
+        
+        const std::string& theMeshName = aMeshMapIter->first;
+        if( strcmp(aMeshName, theMeshName.c_str()) )
+          continue;
+        else
+          isMeshOk = true;
+
+        const VISU::PMesh aMesh = aMeshMapIter->second;
+        const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+        VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
+
+        aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+        //Iterate by meshes on entity
+        for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) {
+          const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+          const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+
+          const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+          VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+
+          //Iterate by field
+          for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
+            const VISU::PField aField = aFieldMapIter->second;
+            const std::string& theFieldName = aFieldMapIter->first;
+            
+            if( strcmp(aFieldName, theFieldName.c_str()) )
+              continue;
+            else
+              isFieldOk = true;
+            
+            if(aComponentNumber > aField->myNbComp)
+              continue;
+            else
+              isComponentOk = true;
+            
+            const VISU::TValField& aValField = aField->myValField;
+            VISU::TValField::const_iterator aValFieldIter = aValField.find(aTimeStampNumber);
+            if(aValFieldIter == aValField.end())
+              continue;
+            else
+              isTimeStampOk = true;
+            
+            int aTimeStamp = aValFieldIter->first;
+          
+            vtkActor* anActor = vtkActor::New();
+
+            if(anEntity != VISU::NODE_ENTITY){
+              VISU::PUnstructuredGridIDMapper anUnstructuredGridIDMapper = 
+                aConvertor->GetTimeStampOnMesh(theMeshName,
+                                               anEntity,
+                                               theFieldName,
+                                               aTimeStamp);
+
+             vtkUnstructuredGrid* anUnstructuredGrid = anUnstructuredGridIDMapper->GetUnstructuredGridOutput();
+             VISU::WriteToFile( anUnstructuredGrid, "/data/apo/elno_from_id_mapper.vtk" );
+             
+             VISU_ElnoDisassembleFilter* aDisassembleFilter = VISU_ElnoDisassembleFilter::New();
+             aDisassembleFilter->SetInput( anUnstructuredGrid );
+             aDisassembleFilter->SetShrinkFactor( 0.999 );
+             VISU::WriteToFile( aDisassembleFilter->GetOutput(), "/data/apo/elno_from_disassemble.vtk" );
+
+             vtkCutter *aCutter = vtkCutter::New();
+
+             vtkPointLocator* aPointLocator = vtkPointLocator::New();
+             aCutter->SetLocator( aPointLocator );
+             aPointLocator->Delete();
+             
+             TPresent* aPresent = TPresent::New();
+             aPresent->SetUnstructuredGridIDMapper( anUnstructuredGridIDMapper );
+             //aPresent->SetOrientation( VISU_CutPlanesPL::ZX, 0.0, 0.0, 0 );
+             aPresent->Update();
+
+             aPresent->GetMapper()->InterpolateScalarsBeforeMappingOn();
+             anActor->SetMapper( aPresent->GetMapper() );
+             
+              vtkScalarBarActor* aScalarBar = vtkScalarBarActor::New();
+              //aScalarBar->SetLookupTable( aMapperTable );
+              aScalarBar->SetLookupTable( aPresent->GetBarTable() );
+
+
+             vtkScalarBarWidget* aWidget = vtkScalarBarWidget::New();
+             aWidget->SetScalarBarActor( aScalarBar );
+             aWidget->SetInteractor( anInteractor );
+             aWidget->SetEnabled( true );
+
+              aRenderer->AddActor(anActor);
+              aRenderer->AddActor2D(aScalarBar);
+            }else{
+              continue;
+            }
+
+            aWindow->Render();
+            aRenderer->ResetCamera();
+            
+            anInteractor->Start();
+            return 0;
+          }
+        }
       }
     }
+    else{
+      PrintMissing();
+      return 1;
+    }
+
+    if(!isMeshOk) {
+      PrintErr();
+      MESSAGE("Can not find mesh with name `"<<aMeshName<<"' in the file `"<<aFileName<<"'");
+      PrintErr();
+      return 1;
+    }
+    if(!isFieldOk) {
+      PrintErr();
+      MESSAGE("Can not find field with name `"<<aFieldName<<"' on the mesh `"<<aMeshName<<"'");
+      PrintErr();
+      return 1; 
+    }
+    if(!isComponentOk) {
+      PrintErr();
+      MESSAGE("Field field with name `"<<aFieldName<<"' containt less then `"<<aComponentNumber<<"' component(s).");
+      PrintErr();
+      return 1;
+    }
+    if(!isTimeStampOk) {
+      PrintErr();
+      MESSAGE("Can not find time stamp with number `"<<aTimeStampNumber<<"' on the field `"<<aFieldName<<"'");
+      PrintErr();
+    }
   }catch(std::exception& exc){
     MSG(true, "Follow exception was occured :\n"<<exc.what());
   }catch(...){
-    MSG(true, "Unknown exception was occured!");
+    MSG(true, "Unknown exception was occured in VISU_Convertor_impl");
   }
   return 1;
 }
index 49600e845e7c9a7d0b2bf8a039fe72602e98fa18..0792a90c42647da0c40c169a57369f4aaa1a4a4a 100644 (file)
@@ -238,7 +238,8 @@ VISU_ColoredPL
   myFieldTransform->SetInput(myExtractor->GetOutput());
 
   GetMapperHolder()->SetLookupTable(GetMapperTable());
-  GetMapper()->SetUseLookupTableScalarRange(true);
+  //GetMapper()->InterpolateScalarsBeforeMappingOn();
+  GetMapper()->SetUseLookupTableScalarRange( true );
   GetMapper()->SetColorModeToMapScalars();
   GetMapper()->ScalarVisibilityOn();
 }
index 3bad32d187df31620c822023e025f48bab754d2a..dbd2243a9d6c187fcc665eccde8f4a881e5857d5 100644 (file)
@@ -100,6 +100,12 @@ VISU_CutLinesPL
   Modified();
 }
 
+vtkDataSet* 
+VISU_CutLinesPL
+::InsertCustomPL()
+{
+  return myAppendPolyData->GetOutput();
+}
 
 //----------------------------------------------------------------------------
 vtkFloatingPointType 
index 5811683414924df07c684056fe9484f6c03008cf..7ed0ecd83e5234791c692935f096c9d801a0a267 100644 (file)
@@ -64,6 +64,9 @@ public:
   void
   Init();
 
+  vtkDataSet*
+  InsertCustomPL();
+
   virtual
   void
   Update();
index 22493a104f8b33e3ceb508f0d4579ff7479ce4af..a8776eaf28dad097d9eb8041506c5f60c652d5cb 100644 (file)
 #include "VISU_FieldTransform.hxx"
 #include "VISU_PipeLineUtils.hxx"
 #include "VTKViewer_GeometryFilter.h"
+#include "VISU_MapperHolder.hxx"
+#include "VISU_DeformationPL.hxx"
 
 #include <vtkAppendPolyData.h>
 #include <vtkCutter.h>
 #include <vtkPlane.h>
 
+//#include <vtkUnstructuredGrid.h>
+
 static vtkFloatingPointType EPS = 1.0E-3;
 
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
 
 //----------------------------------------------------------------------------
 vtkStandardNewMacro(VISU_CutPlanesPL);
@@ -43,10 +53,15 @@ vtkStandardNewMacro(VISU_CutPlanesPL);
 
 //----------------------------------------------------------------------------
 VISU_CutPlanesPL
-::VISU_CutPlanesPL()
+::VISU_CutPlanesPL():
+  VISU_OptionalDeformationPL()
 {
+  if(MYDEBUG) MESSAGE("VISU_CutPlanesPL()::VISU_CutPlanesPL() - "<<this);
+  
   SetIsShrinkable(false);
 
+  SetElnoDisassembleState( true );
+
   myAppendPolyData = vtkAppendPolyData::New();
 
   myNbParts = 10;
@@ -58,6 +73,7 @@ VISU_CutPlanesPL
 
   myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0;
   myAng[1][0] = myAng[1][1] = myAng[1][2] = 0.0;
+  UseDeformation(false);
 }
 
 
@@ -65,6 +81,7 @@ VISU_CutPlanesPL
 VISU_CutPlanesPL
 ::~VISU_CutPlanesPL()
 {
+  if(MYDEBUG) MESSAGE("VISU_CutPlanesPL()::~VISU_CutPlanesPL() - "<<this);
   myAppendPolyData->Delete();
   myAppendPolyData = NULL;
 }
@@ -76,7 +93,11 @@ VISU_CutPlanesPL
 ::GetMTime()
 {
   unsigned long int aTime = Superclass::GetMTime();
-
+  
+  if(IsDeformed()) {
+    aTime = std::max(aTime, VISU_OptionalDeformationPL::GetMTime());
+  }
+  
   aTime = std::max(aTime, myAppendPolyData->GetMTime());
 
   return aTime;
@@ -113,11 +134,11 @@ VISU_CutPlanesPL
 ::Init()
 {
   Superclass::Init();
-
   SetNbParts(10);
   myBasePlane[0] = YZ;
   myDisplacement[0] = 0.5;
   myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0;
+  SetScale(VISU_DeformationPL::GetDefaultScaleFactor(this));
 }
 
 
@@ -126,7 +147,7 @@ vtkDataSet*
 VISU_CutPlanesPL
 ::InsertCustomPL()
 {
-  return myAppendPolyData->GetOutput();
+  return GetWarpVectorOutput();
 }
 
 
@@ -137,18 +158,32 @@ VISU_CutPlanesPL
 {
   ClearAppendPolyData(myAppendPolyData);
 
-  SetPartPosition();
 
+  if(!myVectorialField || !IsDeformed()){
+    SetMergeFilterInput(GetMergedInput(),GetMergedInput());
+  }
+  
+
+  if(VISU::IsDataOnCells(GetMergedInput()))
+    GetMapper()->SetScalarModeToUseCellData();
+  else
+    GetMapper()->SetScalarModeToUsePointData();
+
+  SetPartPosition();
+  
   vtkFloatingPointType aDir[3];
   GetDir(aDir, 
         myAng[0], 
         myBasePlane[0]);
-
+  
   vtkFloatingPointType aBounds[6];
-  GetMergedInput()->GetBounds(aBounds);
+
+  vtkDataSet* aFilterOutput = GetMergeFilterOutput();
+  
+  aFilterOutput->GetBounds(aBounds);
 
   CutWithPlanes(myAppendPolyData,
-               GetMergedInput(),
+                aFilterOutput,
                myNbParts,
                aDir,
                aBounds,
@@ -156,6 +191,9 @@ VISU_CutPlanesPL
                myPartCondition, 
                myDisplacement[0]);
 
+  
+
+  SetWarpVectorInput(myAppendPolyData->GetOutput());
   Superclass::Update();
 }
 
@@ -412,7 +450,11 @@ VISU_CutPlanesPL
   vtkFloatingPointType aPosition = myPartPosition[thePartNumber];
   if(myPartCondition[thePartNumber]){
       vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3];
-      GetMergedInput()->GetBounds(aBounds);
+      if(!IsDeformed()) 
+        GetMergedInput()->GetBounds(aBounds);
+      else
+        GetMergeFilterOutput()->GetBounds(aBounds);
+
 
       GetDir(aDir,
             myAng[theNum],
@@ -564,3 +606,33 @@ VISU_CutPlanesPL
 
 
 //----------------------------------------------------------------------------
+void
+VISU_CutPlanesPL::SetVectorialField(VISU::PUnstructuredGridIDMapper theMapper)
+{  
+  if(myVectorialField == theMapper)
+    return;
+
+  if(CheckCanDeformate(theMapper->GetOutput())){
+    myVectorialField = theMapper;
+    
+    SetMergeFilterInput(GetMergedInput(),theMapper->GetOutput());
+  }
+  else
+    UseDeformation(false);
+  
+  Modified();
+}
+
+//----------------------------------------------------------------------------
+VISU::PUnstructuredGridIDMapper VISU_CutPlanesPL::
+getVectorialField()
+{
+  return myVectorialField;
+}
+
+//----------------------------------------------------------------------------
+void VISU_CutPlanesPL::SetMapScale(vtkFloatingPointType theMapScale){
+  Superclass::SetMapScale(theMapScale);
+  if(IsDeformed())
+    VISU_OptionalDeformationPL::SetMapScale(theMapScale);
+}
index 27d377fd8971d3ecac67413a3a3f132c601d419f..054b8761deae1b9e8910131484264b8515b68d41 100644 (file)
@@ -29,6 +29,8 @@
 
 #include "VISUPipeline.hxx"
 #include "VISU_ScalarMapPL.hxx"
+#include "VISU_OptionalDeformationPL.hxx"
+#include "VISU_MapperHolder.hxx"
 
 #include <vector>
 
@@ -36,7 +38,8 @@ class vtkAppendPolyData;
 
 
 //----------------------------------------------------------------------------
-class VISU_PIPELINE_EXPORT VISU_CutPlanesPL : public VISU_ScalarMapPL
+class VISU_PIPELINE_EXPORT VISU_CutPlanesPL : public VISU_ScalarMapPL,
+                                              public VISU_OptionalDeformationPL
 {
 public:
   vtkTypeMacro(VISU_CutPlanesPL, VISU_ScalarMapPL);
@@ -182,6 +185,14 @@ public:
                const std::vector<int>& thePlaneCondition,
                vtkFloatingPointType theDisplacement);
 
+  virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper);
+  VISU::PUnstructuredGridIDMapper getVectorialField();
+
+  virtual
+  void
+  SetMapScale(vtkFloatingPointType theMapScale = 1.0);
+
+
 protected:
   VISU_CutPlanesPL();
 
index 313c6d683595e6f37b4d510adecc54123e2f4434..4a9adf0a8fe2a620628bc330ee340ee8b36d2aef 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "VISU_DataSetMapperHolder.hxx"
 #include "SALOME_ExtractGeometry.h"
+#include "VISU_ElnoDisassembleFilter.hxx"
 #include "VISU_LookupTable.hxx"
 
 #include "VISU_PipeLineUtils.hxx"
@@ -41,6 +42,8 @@
 #include <vtkImplicitFunctionCollection.h>
 #include <vtkMath.h>
 
+#include <cmath>
+
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
@@ -55,10 +58,13 @@ vtkStandardNewMacro(VISU_DataSetMapperHolder);
 //----------------------------------------------------------------------------
 VISU_DataSetMapperHolder
 ::VISU_DataSetMapperHolder():
-  myExtractGeometry(SALOME_ExtractGeometry::New())
+  myElnoDisassembleFilter( VISU_ElnoDisassembleFilter::New() ),
+  myExtractGeometry( SALOME_ExtractGeometry::New() )
 {
   if(MYDEBUG) MESSAGE("VISU_DataSetMapperHolder::VISU_DataSetMapperHolder - "<<this);
 
+  myElnoDisassembleFilter->Delete();
+
   // Clipping functionality
   myExtractGeometry->Delete();
   myExtractGeometry->SetStoreMapping(true);
@@ -96,6 +102,19 @@ VISU_DataSetMapperHolder
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU_DataSetMapperHolder
+::SetElnoDisassembleState( bool theIsShrunk )
+{
+  vtkFloatingPointType aShrinkFactor = std::abs( myElnoDisassembleFilter->GetShrinkFactor() );
+  if ( theIsShrunk )
+    myElnoDisassembleFilter->SetShrinkFactor( aShrinkFactor );
+  else
+    myElnoDisassembleFilter->SetShrinkFactor( -aShrinkFactor );
+}
+
+
 //----------------------------------------------------------------------------
 unsigned long int
 VISU_DataSetMapperHolder
@@ -116,9 +135,10 @@ void
 VISU_DataSetMapperHolder
 ::SetUnstructuredGridIDMapper(const VISU::PUnstructuredGridIDMapper& theIDMapper)
 {
-  myExtractGeometry->SetInput(theIDMapper->GetUnstructuredGridOutput());
+  myElnoDisassembleFilter->SetInput( theIDMapper->GetUnstructuredGridOutput() );
+  myExtractGeometry->SetInput( myElnoDisassembleFilter->GetOutput() );
   myUnstructuredGridIDMapper = theIDMapper;
-  SetIDMapper(theIDMapper);
+  SetIDMapper( theIDMapper );
 }
 
 
index 45fa07fe6d703347cb8f0a29d564f2ca1bc360a0..6588abd9b14b6987d3508b66d91fe7ba1ffb1924 100644 (file)
@@ -32,6 +32,7 @@
 class vtkDataSetMapper;
 class vtkUnstructuredGrid;
 class SALOME_ExtractGeometry;
+class VISU_ElnoDisassembleFilter;
 
 
 //----------------------------------------------------------------------------
@@ -50,6 +51,9 @@ public:
   ShallowCopy(VISU_MapperHolder *theMapperHolder,
              bool theIsCopyInput);
 
+  void
+  SetElnoDisassembleState( bool theIsShrunk );
+
   //! Gets memory size used by the instance (bytes).
   virtual
   unsigned long int
@@ -158,8 +162,9 @@ protected:
 private:
   //----------------------------------------------------------------------------
   VISU::PUnstructuredGridIDMapper myUnstructuredGridIDMapper;
-  vtkSmartPointer<vtkDataSetMapper> myDataSetMapper;
-  vtkSmartPointer<SALOME_ExtractGeometry> myExtractGeometry; //!< Clipping
+  vtkSmartPointer< VISU_ElnoDisassembleFilter > myElnoDisassembleFilter; //!< Handling ELNO data
+  vtkSmartPointer< SALOME_ExtractGeometry > myExtractGeometry; //!< Clipping
+  vtkSmartPointer< vtkDataSetMapper > myDataSetMapper;
 };
 
 #endif
diff --git a/src/PIPELINE/VISU_DeformationPL.cxx b/src/PIPELINE/VISU_DeformationPL.cxx
new file mode 100755 (executable)
index 0000000..2189b22
--- /dev/null
@@ -0,0 +1,163 @@
+//  Copyright (C) 2008  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_ScalarMapPL.cxx
+// Author:  Roman NIKOLAEV
+// Module : VISU
+
+//Salome includes
+#include "VISU_DeformationPL.hxx"
+#include "VISU_MergeFilter.hxx"
+#include "VISU_DeformedShapePL.hxx"
+#include "VISU_PipeLineUtils.hxx"
+
+//VTK includes
+#include <vtkDataSet.h>
+#include <vtkPassThroughFilter.h>
+#include <vtkWarpVector.h>
+#include <vtkCellDataToPointData.h>
+#include <vtkUnstructuredGrid.h>
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+
+//----------------------------------------------------------------------------
+VISU_DeformationPL::VISU_DeformationPL():
+  myScaleFactor(1.0),
+  myMapScaleFactor(1.0)
+{
+  if(MYDEBUG) MESSAGE("VISU_DeformationPL()::VISU_DeformationPL() - "<<this);
+  myWarpVector = vtkWarpVector::New();
+  myWarpVector->SetScaleFactor(myScaleFactor);
+  
+  myVectorMergeFilter = VISU_MergeFilter::New();
+  myVectorMergeFilter->SetMergingInputs(true);
+  myInputPassFilter = vtkPassThroughFilter::New();
+  myOutputPassFiler = vtkPassThroughFilter::New();
+  myCellDataToPointData = vtkCellDataToPointData::New();
+  myCellDataToPointData->PassCellDataOn();
+
+  myInputPassFilter->SetInput(vtkUnstructuredGrid::New());
+
+  myCellDataToPointData->SetInput(myInputPassFilter->GetOutput());
+
+  myWarpVector->SetInput(myCellDataToPointData->GetOutput());
+  
+  myOutputPassFiler->SetInput(myWarpVector->GetOutput());
+}
+
+//----------------------------------------------------------------------------
+VISU_DeformationPL::~VISU_DeformationPL()
+{
+  if(MYDEBUG) MESSAGE("VISU_DeformationPL()::~VISU_DeformationPL() - "<<this);
+  myWarpVector->Delete();
+  myVectorMergeFilter->Delete();
+  myInputPassFilter->Delete();
+  myOutputPassFiler->Delete();
+  myCellDataToPointData->Delete();
+}
+
+
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_DeformationPL::GetMTime(){
+  unsigned long int aTime = std::max(myWarpVector->GetMTime(), 
+                                     myVectorMergeFilter->GetMTime());
+
+  aTime = std::max(aTime,myInputPassFilter->GetMTime());
+  aTime = std::max(aTime,myOutputPassFiler->GetMTime());
+  aTime = std::max(aTime,myCellDataToPointData->GetMTime());
+}
+
+//----------------------------------------------------------------------------
+void VISU_DeformationPL::SetScale(vtkFloatingPointType theScaleFactor)
+{
+  if(myScaleFactor == theScaleFactor)
+    return;
+  myScaleFactor = theScaleFactor;
+  myWarpVector->SetScaleFactor(myScaleFactor*myMapScaleFactor);
+}
+
+void VISU_DeformationPL::SetMapScale(vtkFloatingPointType theMapScaleFactor)
+{
+  if(myMapScaleFactor == theMapScaleFactor)
+    return;
+  myMapScaleFactor = theMapScaleFactor;
+  
+  myWarpVector->SetScaleFactor(myScaleFactor*myMapScaleFactor);
+}
+
+
+vtkFloatingPointType VISU_DeformationPL::GetScale()
+{
+  return myScaleFactor;
+}
+
+//----------------------------------------------------------------------------
+void VISU_DeformationPL::SetWarpVectorInput(vtkDataSet *theInput)
+{
+  myInputPassFilter->SetInput(theInput);
+}
+
+//----------------------------------------------------------------------------
+vtkDataSet* VISU_DeformationPL::GetWarpVectorOutput()
+{
+  return myOutputPassFiler->GetOutput();
+}
+
+//----------------------------------------------------------------------------
+void VISU_DeformationPL::SetMergeFilterInput(vtkDataSet* ScalarInput,
+                         vtkDataSet* VectorialInput)
+{
+  myVectorMergeFilter->SetScalars(ScalarInput);
+  myVectorMergeFilter->AddField("VISU_CELLS_MAPPER",ScalarInput);
+  myVectorMergeFilter->AddField("VISU_POINTS_MAPPER",ScalarInput);
+  
+  myVectorMergeFilter->SetGeometry(VectorialInput);
+  myVectorMergeFilter->SetVectors(VectorialInput);
+}
+
+//----------------------------------------------------------------------------
+vtkDataSet* VISU_DeformationPL::GetMergeFilterOutput(){
+ return myVectorMergeFilter->GetOutput();
+}
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType VISU_DeformationPL::GetDefaultScaleFactor(VISU_DeformationPL *thePipeLine)
+{
+  if(!thePipeLine || !thePipeLine->GetMergeFilterOutput())
+    return 0.0;
+  
+  vtkFloatingPointType aSourceRange[2];
+  thePipeLine->GetMergeFilterOutput()->GetScalarRange(aSourceRange);
+  
+  static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT;
+  if(fabs(aSourceRange[1]) > EPS){
+    vtkDataSet* aDataSet = thePipeLine->GetMergeFilterOutput();
+    vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor(aDataSet);
+    return aScaleFactor / aSourceRange[1];
+  }
+  return 0.0;
+}
+
diff --git a/src/PIPELINE/VISU_DeformationPL.hxx b/src/PIPELINE/VISU_DeformationPL.hxx
new file mode 100755 (executable)
index 0000000..e18f43e
--- /dev/null
@@ -0,0 +1,87 @@
+//  Copyright (C) 2008  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_DeformationPL.hxx
+//  Author : 
+//  Module : SALOME
+
+#ifndef VISU_DeformationPL_HeaderFile
+#define VISU_DeformationPL_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include "VISU_MapperHolder.hxx"
+#include <vtkSmartPointer.h>
+
+class vtkDataSet;
+class VISU_MergeFilter;
+class vtkPassThroughFilter;
+class vtkWarpVector;
+class vtkCellDataToPointData;
+
+class VISU_PIPELINE_EXPORT VISU_DeformationPL {
+  
+public:
+  VISU_DeformationPL();
+  virtual ~VISU_DeformationPL();
+
+  //-----------------------------------------------------------
+  virtual void SetScale(vtkFloatingPointType theScaleFactor);
+  virtual void SetMapScale(vtkFloatingPointType theMapScaleFactor);
+  virtual vtkFloatingPointType GetScale();
+
+  //-----------------------------------------------------------
+  virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper theIdMapper) = 0;
+  virtual VISU::PUnstructuredGridIDMapper getVectorialField() = 0;
+
+
+  //-----------------------------------------------------------
+  virtual 
+  unsigned 
+  long int
+  GetMTime();
+
+  static vtkFloatingPointType GetDefaultScaleFactor(VISU_DeformationPL *thePipeLine);
+
+  void SetWarpVectorInput(vtkDataSet *theInput);
+  vtkDataSet* GetWarpVectorOutput();
+
+  //-----------------------------------------------------------
+  void SetMergeFilterInput(vtkDataSet* ScalarInput,
+                           vtkDataSet* VectorialInput);
+
+  vtkDataSet* GetMergeFilterOutput();
+
+protected:
+
+  VISU::PUnstructuredGridIDMapper myVectorialField;
+  vtkWarpVector *myWarpVector;
+  vtkSmartPointer<VISU_MergeFilter> myVectorMergeFilter;
+  vtkPassThroughFilter *myInputPassFilter;
+  vtkPassThroughFilter *myOutputPassFiler;
+  vtkCellDataToPointData *myCellDataToPointData;
+
+private:
+  vtkFloatingPointType myScaleFactor;
+  vtkFloatingPointType myMapScaleFactor;
+
+};
+
+#endif
index e9068b9a4a4b43531372c2ea362784ad46d6eafa..72f40c58585f42947d2082ee84311937178e5a82 100644 (file)
@@ -46,7 +46,8 @@ VISU_DeformedGridPL
   myContourFilter(vtkContourFilter::New()),
   myWarpScalar(vtkWarpScalar::New()),
   myIsContour(false),
-  myScaleFactor(1.0)
+  myScaleFactor(1.0),
+  myMapScaleFactor(1.0)
 {
   SetIsShrinkable(false);
   SetNumberOfContours(32);
@@ -180,8 +181,9 @@ VISU_DeformedGridPL
 {
   if ( VISU::CheckIsSameValue( myWarpScalar->GetScaleFactor(), theScaleFactor ) )
     return;
+
   myScaleFactor = theScaleFactor;
-  myWarpScalar->SetScaleFactor(theScaleFactor);
+  myWarpScalar->SetScaleFactor(theScaleFactor*myMapScaleFactor);
 }
 
 
@@ -222,6 +224,7 @@ VISU_DeformedGridPL
 ::SetMapScale(vtkFloatingPointType theMapScale)
 {
   Superclass::SetMapScale(theMapScale);
+  myMapScaleFactor = theMapScale;
 
   if ( myIsContour ) {
     vtkFloatingPointType aSourceRange[2];
index 840059a785e8a93e75efe9a11b18254402a8badf..4f3259492ed9abe51f191c9f7656406ea4b5ef48 100644 (file)
@@ -108,6 +108,7 @@ private:
   void operator=(const VISU_DeformedGridPL&);  // Not implemented.
 
   vtkFloatingPointType myScaleFactor;
+  vtkFloatingPointType myMapScaleFactor;
   vtkContourFilter* myContourFilter;
   vtkWarpScalar *myWarpScalar;
   bool myIsContour;
diff --git a/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx b/src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx
new file mode 100644 (file)
index 0000000..b807671
--- /dev/null
@@ -0,0 +1,372 @@
+//  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_ElnoDisassembleFilter.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(1.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();
+  myScalarsElnoDisassembleFilter = VISU_ElnoDisassembleFilter::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();
+  myScalarsElnoDisassembleFilter->SetInput(aScalars);
+  myScalarsExtractor->SetInput(myScalarsElnoDisassembleFilter->GetOutput());
+
+  if(VISU::IsDataOnCells(myScalarsElnoDisassembleFilter->GetOutput()))
+    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;
+
+  myScaleFactor = theScale;
+  myWarpVector->SetScaleFactor(theScale*myMapScaleFactor);
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets scale of deformed shape.
+ */
+vtkFloatingPointType
+VISU_DeformedShapeAndScalarMapPL
+::GetScale() 
+{
+  return myScaleFactor;
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Set scale factor of deformation.
+ */
+void
+VISU_DeformedShapeAndScalarMapPL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
+  myMapScaleFactor = 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..b3d454a
--- /dev/null
@@ -0,0 +1,149 @@
+//  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_ElnoDisassembleFilter;
+
+
+//----------------------------------------------------------------------------
+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;
+  vtkFloatingPointType myMapScaleFactor;
+  vtkWarpVector  *myWarpVector;
+  VISU_MergeFilter *myScalarsMergeFilter;
+  vtkSmartPointer<vtkUnstructuredGrid> myScalars;
+  vtkCellDataToPointData* myCellDataToPointData;
+  VISU_FieldTransform* myScalarsFieldTransform;
+  VISU_Extractor* myScalarsExtractor;
+  VISU_ElnoDisassembleFilter* myScalarsElnoDisassembleFilter;
+};
+
+#endif
index 6631af081dda168fcf1ec15b0334ffc25b797cec..2a7f2c6a8d58ca1896766755b0f2716a48499701 100644 (file)
@@ -39,7 +39,8 @@ vtkStandardNewMacro(VISU_DeformedShapePL);
 //----------------------------------------------------------------------------
 VISU_DeformedShapePL
 ::VISU_DeformedShapePL():
-  myScaleFactor(0.0)
+  myScaleFactor(0.0),
+  myMapScaleFactor(1.0)
 {
   SetIsShrinkable(true);
 
@@ -139,8 +140,8 @@ VISU_DeformedShapePL
 {
   if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), theScale))
     return;
-
-  myWarpVector->SetScaleFactor(theScale);
+  
+  myWarpVector->SetScaleFactor(theScale*myMapScaleFactor);
   myScaleFactor = theScale;
 }
 
@@ -215,9 +216,14 @@ void
 VISU_DeformedShapePL
 ::SetMapScale(vtkFloatingPointType theMapScale)
 {
+  myMapScaleFactor = theMapScale;
   Superclass::SetMapScale(theMapScale);
 
-  myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
+  vtkFloatingPointType aMapScale = myScaleFactor * theMapScale;
+  if(VISU::CheckIsSameValue(myWarpVector->GetScaleFactor(), aMapScale))
+    return;
+
+  myWarpVector->SetScaleFactor( aMapScale );
 }
 
 
index 6011e501175ce531c838a7011fb2883612867382..b3283bea6f929afffb00239c09e4d05aeed723e1 100644 (file)
@@ -99,6 +99,7 @@ protected:
                bool theIsCopyInput);
 
   vtkFloatingPointType myScaleFactor;
+  vtkFloatingPointType myMapScaleFactor;
   vtkWarpVector *myWarpVector;
   vtkCellDataToPointData* myCellDataToPointData;
 
diff --git a/src/PIPELINE/VISU_ElnoAssembleFilter.cxx b/src/PIPELINE/VISU_ElnoAssembleFilter.cxx
new file mode 100644 (file)
index 0000000..be843ed
--- /dev/null
@@ -0,0 +1,171 @@
+//  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
+
+#include "VISU_ElnoAssembleFilter.hxx"
+#include "VISU_PipeLineUtils.hxx"
+#include "VISU_ElnoMeshValue.hxx"
+
+#include <vtkCellData.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+#include <vtkObjectFactory.h>
+#include <vtkPointData.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkPoints.h>
+#include <vtkCellArray.h>
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro( VISU_ElnoAssembleFilter );
+
+
+//----------------------------------------------------------------------------
+VISU_ElnoAssembleFilter::VISU_ElnoAssembleFilter()
+{
+  this->SetInputArrayToProcess( 0, // idx
+                               0, // port
+                               0, // connection
+                               vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association
+                               "ELNO_POINT_COORDS" ); // name
+
+  this->myIsRestorePoints = false;
+}
+
+
+//----------------------------------------------------------------------------
+VISU_ElnoAssembleFilter::~VISU_ElnoAssembleFilter()
+{}
+
+
+//----------------------------------------------------------------------------
+void VISU_ElnoAssembleFilter::SetElnoAssembleState( bool theIsRestorePoints )
+{
+  if ( myIsRestorePoints == theIsRestorePoints )
+    return;
+    
+  myIsRestorePoints = theIsRestorePoints;
+  this->Modified();
+}
+
+//----------------------------------------------------------------------------
+namespace
+{
+  //----------------------------------------------------------------------------
+  template < int points_type, int elno_type >
+  int Execute2( vtkPointSet *theInput, 
+               vtkPointSet *theOutput,
+               vtkDataArray *theElnoPointCoords )
+  {
+    theOutput->CopyStructure( theInput );
+    
+    vtkCellData *aCellData = theOutput->GetCellData();
+    aCellData->PassData( theInput->GetCellData() );
+
+    vtkPointData *aPointData = theOutput->GetPointData();
+    aPointData->PassData( theInput->GetPointData() );
+
+    vtkPoints *anInputPoints = theInput->GetPoints();
+    vtkPoints *aPoints = anInputPoints->New( elno_type );
+    vtkIdType aNbPoints = theInput->GetNumberOfPoints();
+    aPoints->SetNumberOfPoints( aNbPoints );
+    
+    typedef typename VISU::TL::TEnum2VTKArrayType< elno_type >::TResult TPointsDataArray;
+    typedef typename VISU::TL::TEnum2VTKBasicType< elno_type >::TResult TPointsDataType;
+    TPointsDataArray* anOutputPointsArray = TPointsDataArray::SafeDownCast( aPoints->GetData() );
+
+    TPointsDataArray* anElnoPointCoords = TPointsDataArray::SafeDownCast( theElnoPointCoords );
+    
+    for ( vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++ ) {
+      TPointsDataType aCoords[ 3 ];
+      anElnoPointCoords->GetTupleValue( aPointId, aCoords );
+      anOutputPointsArray->SetTupleValue( aPointId, aCoords );
+    }
+    
+    theOutput->SetPoints( aPoints );
+
+    return 1;
+  } 
+
+
+  //----------------------------------------------------------------------------
+  template < int points_type >
+  int Execute( vtkPointSet *theInput, 
+              vtkPointSet *theOutput,
+              vtkDataArray *theElnoPointCoords )
+  {
+    switch( theElnoPointCoords->GetDataType() ){
+    case VTK_DOUBLE:
+      return Execute2< points_type, VTK_DOUBLE >( theInput, theOutput, theElnoPointCoords );
+    case VTK_FLOAT:
+      return Execute2< points_type, VTK_FLOAT >( theInput, theOutput, theElnoPointCoords );
+    case VTK_INT:
+      return Execute2< points_type, VTK_INT >( theInput, theOutput, theElnoPointCoords );
+    case VTK_LONG:
+      return Execute2< points_type, VTK_LONG >( theInput, theOutput, theElnoPointCoords );
+    default:
+      break;
+    }
+    
+    return 0;
+  } 
+
+
+  //----------------------------------------------------------------------------
+}
+
+
+//----------------------------------------------------------------------------
+int VISU_ElnoAssembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
+                                         vtkInformationVector **inputVector,
+                                         vtkInformationVector *outputVector )
+{
+  // get the info objects
+  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the input and ouptut
+  vtkPointSet *anInput = vtkPointSet::SafeDownCast( inInfo->Get( vtkDataObject::DATA_OBJECT() ) );
+  vtkPointSet *anOutput = vtkPointSet::SafeDownCast( outInfo->Get( vtkDataObject::DATA_OBJECT() ) );
+
+  vtkDataArray *anElnoPointCoords = this->GetInputArrayToProcess( 0, inputVector );
+
+  if ( !myIsRestorePoints || !anElnoPointCoords ) {
+    anOutput->ShallowCopy( anInput );
+    return 1;
+  }
+
+  vtkPoints *aPoints = anInput->GetPoints();
+  switch( aPoints->GetDataType() ){
+  case VTK_DOUBLE:
+    return ::Execute< VTK_DOUBLE >( anInput, anOutput, anElnoPointCoords );
+  case VTK_FLOAT:
+    return ::Execute< VTK_FLOAT >( anInput, anOutput, anElnoPointCoords );
+  case VTK_INT:
+    return ::Execute< VTK_INT >( anInput, anOutput, anElnoPointCoords );
+  case VTK_LONG:
+    return ::Execute< VTK_LONG >( anInput, anOutput, anElnoPointCoords );
+  default:
+    break;
+  }  
+  
+  return 0;
+}
+
+
+//----------------------------------------------------------------------------
diff --git a/src/PIPELINE/VISU_ElnoAssembleFilter.hxx b/src/PIPELINE/VISU_ElnoAssembleFilter.hxx
new file mode 100644 (file)
index 0000000..8f586c6
--- /dev/null
@@ -0,0 +1,47 @@
+//  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
+
+#ifndef VISU_ElnoAssembleFilter_H
+#define VISU_ElnoAssembleFilter_H
+
+#include <vtkPointSetAlgorithm.h>
+
+class VISU_ElnoAssembleFilter : public vtkPointSetAlgorithm
+{
+public:
+  typedef vtkPointSetAlgorithm Superclass;
+
+  static VISU_ElnoAssembleFilter *New();
+
+  void SetElnoAssembleState( bool theIsRestorePoints );
+
+protected:
+  VISU_ElnoAssembleFilter();
+  ~VISU_ElnoAssembleFilter();
+
+  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+  bool myIsRestorePoints;
+
+private:
+  VISU_ElnoAssembleFilter(const VISU_ElnoAssembleFilter&);  // Not implemented.
+  void operator=(const VISU_ElnoAssembleFilter&);  // Not implemented.
+};
+
+#endif
diff --git a/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx b/src/PIPELINE/VISU_ElnoDisassembleFilter.cxx
new file mode 100644 (file)
index 0000000..eb84ca4
--- /dev/null
@@ -0,0 +1,400 @@
+//  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
+
+#include "VISU_ElnoDisassembleFilter.hxx"
+#include "VISU_PipeLineUtils.hxx"
+#include "VISU_ElnoMeshValue.hxx"
+
+#include <vtkCellData.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+#include <vtkObjectFactory.h>
+#include <vtkPointData.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkPoints.h>
+#include <vtkCellArray.h>
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro( VISU_ElnoDisassembleFilter );
+
+
+//----------------------------------------------------------------------------
+VISU_ElnoDisassembleFilter::VISU_ElnoDisassembleFilter()
+{
+  this->SetInputArrayToProcess( 0, // idx
+                               0, // port
+                               0, // connection
+                               vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
+                               "ELNO_FIELD" ); // name
+
+  this->SetInputArrayToProcess( 1, // idx
+                               0, // port
+                               0, // connection
+                               vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
+                               "ELNO_COMPONENT_MAPPER" ); // name
+
+  this->myShrinkFactor = -0.999;
+}
+
+
+//----------------------------------------------------------------------------
+VISU_ElnoDisassembleFilter::~VISU_ElnoDisassembleFilter()
+{}
+
+
+//----------------------------------------------------------------------------
+void VISU_ElnoDisassembleFilter::SetShrinkFactor( vtkFloatingPointType theValue )
+{
+  if ( VISU::CheckIsSameValue( theValue, myShrinkFactor ) )
+    return;
+
+  myShrinkFactor = theValue;
+  this->Modified();
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType VISU_ElnoDisassembleFilter::GetShrinkFactor()
+{
+  return myShrinkFactor;
+}
+
+
+//----------------------------------------------------------------------------
+namespace
+{
+  //----------------------------------------------------------------------------
+  template < int points_type, int elno_type >
+  struct TExecute2
+  {
+    vtkUnstructuredGrid *myInput;
+    vtkUnstructuredGrid *myOutput;
+    vtkDataArray *myElnoDataArray;
+    vtkDataArray *myElnoDataMapper;
+    vtkFloatingPointType myShrinkFactor;
+
+    typedef typename VISU::TL::TEnum2VTKArrayType< points_type >::TResult TPointsDataArray;
+    typedef typename VISU::TL::TEnum2VTKBasicType< points_type >::TResult TPointsDataType;
+
+    typedef typename VISU::TL::TEnum2VTKArrayType< elno_type >::TResult TElnoDataArray;
+    typedef typename VISU::TL::TEnum2VTKBasicType< elno_type >::TResult TElnoDataType;
+
+    VISU::TGetElnoNodeData< elno_type > myGetElnoNodeData;
+    vtkCellArray *myConnectivity;
+    vtkPointData *myInputPointData;
+    vtkPointData *myOutputPointData;
+    TPointsDataArray *myInputPointsArray;
+    TPointsDataArray *myOutputPointsArray;
+    TElnoDataArray* myElnoFullDataArray;
+    TElnoDataArray* myElnoPartialDataArray;
+    TPointsDataArray *myElnoPointCoords;
+    vtkIntArray* myInputPointsMapper;
+    vtkIntArray* myOutputPointsMapper;
+
+    //----------------------------------------------------------------------------
+    TExecute2( vtkUnstructuredGrid *theInput, 
+              vtkUnstructuredGrid *theOutput, 
+              vtkDataArray *theElnoDataArray,
+              vtkDataArray *theElnoDataMapper,
+              vtkFloatingPointType theShrinkFactor )
+      : myGetElnoNodeData( theElnoDataArray, theElnoDataMapper )
+      , myInput( theInput )
+      , myOutput( theOutput )
+      , myElnoDataArray( theElnoDataArray )
+      , myElnoDataMapper( theElnoDataMapper )
+      , myShrinkFactor( theShrinkFactor )
+    {
+      myConnectivity = vtkCellArray::New();
+      myConnectivity->DeepCopy( theInput->GetCells() );
+    
+      vtkPoints *anInputPoints = theInput->GetPoints();
+      vtkPoints *aPoints = anInputPoints->New( anInputPoints->GetDataType() );
+      vtkIdType aNbCells = myConnectivity->GetNumberOfCells();
+      vtkIdType aNbPoints = myConnectivity->GetNumberOfConnectivityEntries() - aNbCells;
+      aPoints->Allocate( aNbPoints );
+    
+      myInputPointsArray = TPointsDataArray::SafeDownCast( anInputPoints->GetData() );
+      myOutputPointsArray = TPointsDataArray::SafeDownCast( aPoints->GetData() );
+    
+      myInputPointData = theInput->GetPointData();
+      myOutputPointData = theOutput->GetPointData();
+      myOutputPointData->Allocate( aNbPoints );
+    
+      vtkCellData *anInputCellData = theInput->GetCellData();
+
+      // To create a new copy of initial data for output
+      myElnoFullDataArray = TElnoDataArray::New();
+      myElnoFullDataArray->SetName( "VISU_FIELD" );
+      myElnoFullDataArray->SetNumberOfComponents( myGetElnoNodeData.getNbComp() );
+      myElnoFullDataArray->SetNumberOfTuples( aNbPoints );
+
+      // To create a new copy of partial initial data for output
+      myElnoPartialDataArray = TElnoDataArray::New();
+      // This partial data can be represented as in terms of vectors as scalars
+      if ( anInputCellData->GetVectors() != NULL ) 
+       myElnoPartialDataArray->SetNumberOfComponents( 3 );
+      else
+       myElnoPartialDataArray->SetNumberOfComponents( 1 );
+      myElnoPartialDataArray->SetNumberOfTuples( aNbPoints );
+
+      myElnoPointCoords = TPointsDataArray::New();
+      myElnoPointCoords->SetName( "ELNO_POINT_COORDS" );
+      myElnoPointCoords->SetNumberOfComponents( 3 );
+      myElnoPointCoords->SetNumberOfTuples( aNbPoints );
+
+      vtkDataArray* anArray = myInputPointData->GetArray( "VISU_POINTS_MAPPER" );
+      myInputPointsMapper = vtkIntArray::SafeDownCast( anArray );
+      
+      myOutputPointsMapper = vtkIntArray::New();
+      myOutputPointsMapper->SetName( myInputPointsMapper->GetName() );
+      myOutputPointsMapper->SetNumberOfComponents( myInputPointsMapper->GetNumberOfComponents() );
+      myOutputPointsMapper->SetNumberOfTuples( aNbPoints );
+
+      if ( theShrinkFactor > 0.0 )
+       this->ShrinkExecute();
+      else
+       this->SimpleExecute();
+
+      theOutput->SetPoints( aPoints );
+      
+      theOutput->SetCells( theInput->GetCellTypesArray(), 
+                          theInput->GetCellLocationsArray(),
+                          myConnectivity );
+
+      myConnectivity->Delete();
+      
+      vtkCellData *anOutputCellData = theOutput->GetCellData();
+      anOutputCellData->PassData( anInputCellData );
+      
+      anOutputCellData->RemoveArray( "ELNO_COMPONENT_MAPPER" );
+      anOutputCellData->RemoveArray( "ELNO_FIELD" );
+      anOutputCellData->RemoveArray( "VISU_FIELD" );
+      anOutputCellData->SetVectors( NULL );
+      
+      //anOutputPointData->PassData( anInputPointData );
+      
+      myOutputPointData->AddArray( myElnoFullDataArray );
+      myElnoFullDataArray->Delete();
+      
+      if ( anInputCellData->GetVectors() != NULL ) 
+       myOutputPointData->SetVectors( myElnoPartialDataArray );
+      else
+       myOutputPointData->SetScalars( myElnoPartialDataArray );
+      myElnoPartialDataArray->Delete();
+      
+      myOutputPointData->AddArray( myElnoPointCoords );
+      myElnoPointCoords->Delete();
+      
+      myOutputPointData->AddArray( myOutputPointsMapper );
+      myOutputPointsMapper->Delete();
+    }
+
+    //----------------------------------------------------------------------------
+    void SimpleExecute()
+    {
+      // To reserve a temproary value holder
+      vtkIdType aNbComp = std::max( 3, myGetElnoNodeData.getNbComp() );
+      std::vector< TElnoDataType > anElnoDataValues( aNbComp ); 
+
+      std::vector< int > anPointsMapperValues( myInputPointsMapper->GetNumberOfComponents() ); 
+   
+      myConnectivity->InitTraversal();
+      vtkIdType aNbPts = 0, *aPts = 0;
+      for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
+        for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
+         TPointsDataType aCoords[ 3 ];
+         vtkIdType aCurrentPntId = aPts[ aPntId ];
+         myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
+         
+         aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords );
+         vtkIdType aNewPntId = aPts[ aPntId ];
+         
+         myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
+         
+         myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
+         
+         TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
+         myElnoFullDataArray->SetTupleValue( aNewPntId,  anElnoData );
+         
+         myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+         myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+
+         myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
+         myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
+        }
+      }
+    }
+
+    //----------------------------------------------------------------------------
+    void ShrinkExecute()
+    {
+      // To reserve a temproary value holder
+      vtkIdType aNbComp = std::max( 3, myGetElnoNodeData.getNbComp() );
+      std::vector< TElnoDataType > anElnoDataValues( aNbComp ); 
+      
+      std::vector< int > anPointsMapperValues( myInputPointsMapper->GetNumberOfComponents() ); 
+   
+      myConnectivity->InitTraversal();
+      vtkIdType aNbPts = 0, *aPts = 0;
+      for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
+       
+       TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() };
+       
+       for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
+         TPointsDataType aCoords[ 3 ];
+         myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords );
+         
+         aCenter[ 0 ] += aCoords[ 0 ];
+         aCenter[ 1 ] += aCoords[ 1 ];
+         aCenter[ 2 ] += aCoords[ 2 ];
+       }
+       
+       aCenter[ 0 ] /= aNbPts;
+       aCenter[ 1 ] /= aNbPts;
+       aCenter[ 2 ] /= aNbPts;
+       
+       for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
+         TPointsDataType aCoords[ 3 ];
+         vtkIdType aCurrentPntId = aPts[ aPntId ];
+         myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
+         
+         TPointsDataType aNewCoords[ 3 ];
+         
+         aNewCoords[ 0 ] = aCenter[ 0 ]  + 
+           TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) );
+         aNewCoords[ 1 ] = aCenter[ 1 ]  + 
+           TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) );
+         aNewCoords[ 2 ] = aCenter[ 2 ]  + 
+           TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) );
+         
+         aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords );
+         vtkIdType aNewPntId = aPts[ aPntId ];
+         
+         myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
+         
+         myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
+         
+         TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
+         myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
+         
+         myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+         myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
+
+         myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
+         myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
+       }
+      }
+    }
+  };
+
+
+  //----------------------------------------------------------------------------
+  template < int points_type, int elno_type >
+  int Execute2( vtkUnstructuredGrid *theInput, 
+               vtkUnstructuredGrid *theOutput, 
+               vtkDataArray *theElnoDataArray,
+               vtkDataArray *theElnoDataMapper,
+               vtkFloatingPointType theShrinkFactor )
+  {
+    TExecute2< points_type, elno_type >( theInput, 
+                                        theOutput, 
+                                        theElnoDataArray, 
+                                        theElnoDataMapper, 
+                                        theShrinkFactor );
+        
+    return 1;
+  }
+          
+
+  //----------------------------------------------------------------------------
+  template < int points_type >
+  int Execute( vtkUnstructuredGrid *theInput, 
+              vtkUnstructuredGrid *theOutput, 
+              vtkDataArray *theElnoDataArray,
+              vtkDataArray *theElnoDataMapper,
+              vtkFloatingPointType theShrinkFactor )
+  {
+    switch( theElnoDataArray->GetDataType() ){
+    case VTK_DOUBLE:
+      return Execute2< points_type, VTK_DOUBLE >
+       ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+    case VTK_FLOAT:
+      return Execute2< points_type, VTK_FLOAT >
+       ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+    case VTK_INT:
+      return Execute2< points_type, VTK_INT >
+       ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+    case VTK_LONG:
+      return Execute2< points_type, VTK_LONG >
+       ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
+    default:
+      break;
+    }
+    
+    return 0;
+  } 
+
+
+  //----------------------------------------------------------------------------
+}
+
+
+//----------------------------------------------------------------------------
+int VISU_ElnoDisassembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
+                                            vtkInformationVector **inputVector,
+                                            vtkInformationVector *outputVector )
+{
+  // get the info objects
+  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the input and ouptut
+  vtkUnstructuredGrid *anInput =
+    vtkUnstructuredGrid::SafeDownCast( inInfo->Get( vtkDataObject::DATA_OBJECT() ) );
+  vtkUnstructuredGrid *anOutput = 
+    vtkUnstructuredGrid::SafeDownCast( outInfo->Get( vtkDataObject::DATA_OBJECT() ) );
+
+  vtkDataArray *anElnoDataArray = this->GetInputArrayToProcess( 0, inputVector );
+  vtkDataArray *anElnoDataMapper = this->GetInputArrayToProcess( 1, inputVector );
+
+  if ( !anElnoDataArray ) {
+    anOutput->ShallowCopy( anInput );
+    return 1;
+  }
+
+  vtkPoints *aPoints = anInput->GetPoints();
+  switch( aPoints->GetDataType() ){
+  case VTK_DOUBLE:
+    return ::Execute< VTK_DOUBLE >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor );
+  case VTK_FLOAT:
+    return ::Execute< VTK_FLOAT >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor );
+  case VTK_INT:
+    return ::Execute< VTK_INT >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor );
+  case VTK_LONG:
+    return ::Execute< VTK_LONG >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor );
+  default:
+    break;
+  }  
+  
+  return 0;
+}
+
+
+//----------------------------------------------------------------------------
diff --git a/src/PIPELINE/VISU_ElnoDisassembleFilter.hxx b/src/PIPELINE/VISU_ElnoDisassembleFilter.hxx
new file mode 100644 (file)
index 0000000..0053c13
--- /dev/null
@@ -0,0 +1,48 @@
+//  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
+
+#ifndef VISU_ElnoDisassembleFilter_H
+#define VISU_ElnoDisassembleFilter_H
+
+#include <vtkUnstructuredGridAlgorithm.h>
+
+class VISU_ElnoDisassembleFilter : public vtkUnstructuredGridAlgorithm
+{
+public:
+  typedef vtkUnstructuredGridAlgorithm Superclass;
+
+  static VISU_ElnoDisassembleFilter *New();
+
+  void SetShrinkFactor( vtkFloatingPointType theValue );
+  vtkFloatingPointType GetShrinkFactor();
+
+protected:
+  VISU_ElnoDisassembleFilter();
+  ~VISU_ElnoDisassembleFilter();
+
+  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+  vtkFloatingPointType myShrinkFactor;
+
+private:
+  VISU_ElnoDisassembleFilter(const VISU_ElnoDisassembleFilter&);  // Not implemented.
+  void operator=(const VISU_ElnoDisassembleFilter&);  // Not implemented.
+};
+
+#endif
index e44145e30dccbdaaa385401558b0beab5ad32c2a..eb078e3a5705a8580994fca872f9880c15e4985a 100644 (file)
@@ -168,27 +168,27 @@ VISU_Extractor
              vtkInformationVector **theInputVector,
              vtkInformationVector *theOutputVector)
 {
-  vtkDataSet *anInput = VISU::GetInput(theInputVector, 0);
-  vtkDataSet *anOutput = VISU::GetOutput(theOutputVector);
+  vtkDataSet *anInput = VISU::GetInput( theInputVector, 0 );
+  vtkDataSet *anOutput = VISU::GetOutput( theOutputVector );
 
-  anOutput->CopyStructure(anInput);
+  anOutput->CopyStructure( anInput );
 
   vtkPointData *anInputPointData = anInput->GetPointData();
   vtkPointData *anOutputPointData = anOutput->GetPointData();
-  anOutputPointData->PassData(anInputPointData); 
-  if(VISU::IsDataOnPoints(anInput)){
+  anOutputPointData->PassData( anInputPointData ); 
+  if ( VISU::IsDataOnPoints( anInput ) ) {
     int aNbElems = anInput->GetNumberOfPoints();
-    if(anInputPointData->GetAttribute(vtkDataSetAttributes::VECTORS))
-      ExecuteScalars(aNbElems, myScalarMode, anInputPointData, anOutputPointData);
+    if ( anInputPointData->GetAttribute( vtkDataSetAttributes::VECTORS ) )
+      ExecuteScalars( aNbElems, myScalarMode, anInputPointData, anOutputPointData );
   }
   
   vtkCellData *anInputCellData = anInput->GetCellData();
   vtkCellData *anOutputCellData = anOutput->GetCellData();
-  anOutputCellData->PassData(anInputCellData); 
-  if(VISU::IsDataOnCells(anInput)){
+  anOutputCellData->PassData( anInputCellData ); 
+  if ( VISU::IsDataOnCells( anInput ) ) {
     int aNbElems = anInput->GetNumberOfCells();
-    if(anInputCellData->GetAttribute(vtkDataSetAttributes::VECTORS))
-      ExecuteScalars(aNbElems, myScalarMode, anInputCellData, anOutputCellData);
+    if ( anInputCellData->GetAttribute( vtkDataSetAttributes::VECTORS ) )
+      ExecuteScalars( aNbElems, myScalarMode, anInputCellData, anOutputCellData );
   }
 
   return 1;
index bea9854f35cfe9ffd5ba52774d85447d5dcf67e6..883599632739e4a33ca372a82a7c116e3bcd7c43 100644 (file)
 #include "VISU_LookupTable.hxx"
 
 #include "VISU_PipeLineUtils.hxx"
+#include "VISU_LabelPointsFilter.hxx"
 
 #include <vtkContourFilter.h>
 
 
+
 //----------------------------------------------------------------------------
 vtkStandardNewMacro(VISU_IsoSurfacesPL);
 
@@ -44,6 +46,8 @@ VISU_IsoSurfacesPL
 {
   SetIsShrinkable(false);
 
+  SetElnoDisassembleState( true );
+
   myContourFilter = vtkContourFilter::New();
 
   myCellDataToPointData = vtkCellDataToPointData::New();
@@ -100,6 +104,14 @@ VISU_IsoSurfacesPL
   return myContourFilter->GetNumberOfContours();
 }
 
+//----------------------------------------------------------------------------
+vtkFloatingPointType
+VISU_IsoSurfacesPL
+::GetValue(int i) 
+{
+  return myContourFilter->GetValue(i);
+}
+
 
 //----------------------------------------------------------------------------
 void
@@ -181,6 +193,7 @@ VISU_IsoSurfacesPL
   VISU::CellDataToPoint(myContourFilter,
                        myCellDataToPointData,
                        GetMergedInput());
+
 }
 
 
index 83a646dd8d3623b6574854fe2696f8d4ffb4bf81..73aec61ed465368085d9d0c93e00ba64aeffe771 100644 (file)
@@ -53,6 +53,8 @@ public:
   int
   GetNbParts();
 
+  virtual vtkFloatingPointType GetValue(int i);
+
   virtual
   void
   SetNbParts(int theNb = 10);
diff --git a/src/PIPELINE/VISU_LabelPointsFilter.cxx b/src/PIPELINE/VISU_LabelPointsFilter.cxx
new file mode 100644 (file)
index 0000000..040d6a2
--- /dev/null
@@ -0,0 +1,296 @@
+//  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_LabelPointsFilter.cxx
+// Author:  Vitaly Smetannikov
+// Module : VISU
+
+
+
+#include "VISU_LabelPointsFilter.hxx"
+
+#include <vtkPolyData.h>
+#include <vtkObjectFactory.h>
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+#include <vtkFeatureEdges.h>
+#include <vtkCellArray.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
+#include <vtkDataArray.h>
+#include <vtkDoubleArray.h>
+#include <vtkGeometryFilter.h>
+#include <vtkPolyDataConnectivityFilter.h>
+#include <vtkMath.h>
+
+#include <set>
+#include <vector>
+
+
+#define CONTAINS(SET, PT) (SET.find(PT) != SET.end())
+
+struct ltIdType 
+{
+  bool operator()(const vtkIdType a1, const vtkIdType a2) const
+  {
+    return a1 < a2;
+  }
+};
+
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VISU_LabelPointsFilter);
+
+
+//----------------------------------------------------------------------------
+void VISU_LabelPointsFilter::SetPointsNb(int theNb)
+{
+  if (myPointsNb == theNb) return;
+  myPointsNb = (theNb < 1)? 1:theNb;
+  Modified();
+}
+
+//----------------------------------------------------------------------------
+VISU_LabelPointsFilter::VISU_LabelPointsFilter():
+  vtkPolyDataAlgorithm(),
+  myPointsNb(3)
+{
+}
+
+//----------------------------------------------------------------------------
+VISU_LabelPointsFilter::~VISU_LabelPointsFilter()
+{}
+
+
+
+//----------------------------------------------------------------------------
+int VISU_LabelPointsFilter::RequestData(vtkInformation* vtkNotUsed(request),
+                                       vtkInformationVector** inputVector,
+                                       vtkInformationVector* outputVector)
+{
+  // get the info objects
+  vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation* outInfo = outputVector->GetInformationObject(0);
+
+  // get the input and ouptut
+  vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
+  GetRegions(input, output);
+
+  return 1;
+}
+
+int VISU_LabelPointsFilter::RequestUpdateExtent(vtkInformation* vtkNotUsed(request),
+                                               vtkInformationVector** inputVector,
+                                               vtkInformationVector* outputVector)
+{
+  // get the info objects
+  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
+  vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
+  GetRegions(input, output);
+  return 1;
+}
+
+
+
+int VISU_LabelPointsFilter::GetRegions(vtkPolyData* theInput, 
+                                      vtkPolyData* theOutput)
+{
+  vtkIdType cellId, i;
+  vtkIdType numPts, numCells;
+  vtkPoints *inPts;
+
+  vtkPointData *aInpPD=theInput->GetPointData(), *aOutPD=theOutput->GetPointData();
+  vtkCellData *aInpCD=theInput->GetCellData(), *aOutCD=theOutput->GetCellData();
+  
+  //  Check input/allocate storage
+  //
+  inPts = theInput->GetPoints();
+
+  if (inPts == NULL)
+    return 1;
+
+  numPts = inPts->GetNumberOfPoints();
+  numCells = theInput->GetNumberOfCells();
+
+  if ( numPts < 1 || numCells < 1 )
+    return 1;
+
+  // Build cell structure
+  //
+  vtkPolyData* aMesh = vtkPolyData::New();
+  aMesh->CopyStructure(theInput);
+  aMesh->BuildLinks();
+
+  // Initialize.  Keep track of points and cells visited.
+  //
+  vtkIdTypeArray* aRegionSizes = vtkIdTypeArray::New();
+  int* aVisited = new int[numCells];
+  for ( i=0; i < numCells; i++ )
+     aVisited[i] = -1;
+
+  vtkIdType* aPointMap = new vtkIdType[numPts];  
+  for ( i=0; i < numPts; i++ )
+    aPointMap[i] = -1;
+
+  vtkPoints* newPts = vtkPoints::New();
+  newPts->Allocate(numPts);
+
+  // Traverse all cells marking those visited.  Each new search
+  // starts a new connected region. Connected region grows 
+  // using a connected wave propagation.
+  //
+  vtkIdList* aWave = vtkIdList::New();
+  aWave->Allocate(numPts/4+1,numPts);
+  vtkIdList* aWave2 = vtkIdList::New();
+  aWave2->Allocate(numPts/4+1,numPts);
+
+  vtkIdType aPointNumber = 0;
+  int aRegionNumber = 0;
+
+  vtkIdList* aCellIds = vtkIdList::New(); 
+  aCellIds->Allocate(8, VTK_CELL_SIZE);
+  vtkIdList* aPointIds = vtkIdList::New(); 
+  aPointIds->Allocate(8, VTK_CELL_SIZE);
+
+  //  vtkIdType aNumCellsInRegion;
+
+  aOutPD->CopyAllocate(aInpPD);
+  aOutCD->CopyAllocate(aInpCD);
+
+  //visit all cells marking with region number
+  for (cellId=0; cellId < numCells; cellId++) {
+    if ( aVisited[cellId] < 0 ) {
+      aWave->InsertNextId(cellId);
+      aPointNumber = 0;
+      TraverseAndMark(aWave, aWave2, aVisited, aPointMap, 
+                     aRegionNumber, aPointNumber, aMesh);
+      
+      if (aPointNumber >= myPointsNb) {
+       std::set<vtkIdType, ltIdType> aIdxSet;
+       for (i=0; i < numPts; i++) {
+         if ( aPointMap[i] > -1 ) {
+           aIdxSet.insert(i);
+           aPointMap[i] = -1;
+         }
+       }
+       std::vector<vtkIdType> aIdx(aIdxSet.begin(), aIdxSet.end());
+       int aActualPts = aIdx.size();
+       int aNewId;
+       if (myPointsNb > 2) {
+         int k = aActualPts/(myPointsNb - 1);
+         int count;
+         for (i=0, count = 0; i < aActualPts; i+=k, count++) {
+           aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i]));
+           aOutPD->CopyData(aInpPD, aIdx[i], aNewId);
+         }
+         if (count < myPointsNb) {
+           aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
+           aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
+         }
+       } else {          
+         aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0]));
+         aOutPD->CopyData(aInpPD, aIdx[0], aNewId);
+         if (myPointsNb == 2) {
+           aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
+           aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
+         }
+       }
+      }
+      aWave->Reset();
+      aWave2->Reset(); 
+    }
+  }
+
+  aWave->Delete();
+  aWave2->Delete();
+
+  theOutput->SetPoints(newPts);
+  newPts->Delete();
+
+
+  delete [] aVisited;
+  delete [] aPointMap;
+  aMesh->Delete();
+  theOutput->Squeeze();
+  aCellIds->Delete();
+  aPointIds->Delete();
+
+  return aRegionSizes->GetMaxId() + 1;
+}
+
+
+// Mark current cell as visited and assign region number.  Note:
+// traversal occurs across shared vertices.
+//
+void VISU_LabelPointsFilter::TraverseAndMark (vtkIdList* theWave, 
+                                             vtkIdList* theWave2, 
+                                             int* theVisited,
+                                             vtkIdType* thePointMap,
+                                             int& theRegionNumber,
+                                             vtkIdType& thePointNumber,
+                                             vtkPolyData* theMesh)
+{
+  vtkIdType cellId, ptId, numIds, i;
+  int j, k;
+  vtkIdType *pts, *cells, npts;
+  vtkIdList *tmpWave;
+  unsigned short ncells;
+  vtkIdList* aNeighborCellPointIds = vtkIdList::New();
+
+
+  while ( (numIds=theWave->GetNumberOfIds()) > 0 ) {
+    for ( i=0; i < numIds; i++ ) {
+      cellId = theWave->GetId(i);
+      if ( theVisited[cellId] < 0 ) {
+        theVisited[cellId] = theRegionNumber;
+        theMesh->GetCellPoints(cellId, npts, pts);
+       
+        for (j=0; j < npts; j++) {
+          if ( thePointMap[ptId=pts[j]] < 0 ) {
+            thePointMap[ptId] = thePointNumber++;
+         }       
+          theMesh->GetPointCells(ptId,ncells,cells);
+         
+          // check connectivity criterion (geometric + scalar)
+          for (k=0; k < ncells; k++) {
+            cellId = cells[k];
+           theWave2->InsertNextId(cellId);
+           //              }
+         }//for all cells using this point
+       }//for all points of this cell
+      }//if cell not yet visited
+    }//for all cells in this wave
+    
+    tmpWave = theWave;
+    theWave = theWave2;
+    theWave2 = tmpWave;
+    tmpWave->Reset();
+  } //while wave is not empty
+}
diff --git a/src/PIPELINE/VISU_LabelPointsFilter.hxx b/src/PIPELINE/VISU_LabelPointsFilter.hxx
new file mode 100644 (file)
index 0000000..46fa1c4
--- /dev/null
@@ -0,0 +1,76 @@
+//  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_LabelPointsFilter.hxx
+// Author:  Vitaly Smetannikov
+// Module : VISU
+
+#ifndef VISU_LabelPointsFilter_HeaderFile
+#define VISU_LabelPointsFilter_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include <vtkPolyDataAlgorithm.h>
+
+class vtkPolyData;
+
+class VISU_PIPELINE_EXPORT VISU_LabelPointsFilter : public vtkPolyDataAlgorithm
+{
+public:
+  vtkTypeMacro(VISU_LabelPointsFilter, vtkPolyDataAlgorithm);
+
+  static VISU_LabelPointsFilter* New();
+
+  void SetPointsNb(int theNb);
+
+  int GetPointsNb() const { return myPointsNb; }
+
+protected:
+  VISU_LabelPointsFilter();
+
+  virtual ~VISU_LabelPointsFilter();
+
+  virtual int RequestData(vtkInformation* request,
+                          vtkInformationVector** inputVector,
+                          vtkInformationVector* outputVector);
+
+  virtual int RequestUpdateExtent(vtkInformation*,
+                                  vtkInformationVector**,
+                                  vtkInformationVector*);
+
+
+  void TraverseAndMark (vtkIdList* theWave, 
+                       vtkIdList* theWave2, 
+                       int* theVisited,
+                       vtkIdType* thePointMap,
+                       int& theRegionNumber,
+                       vtkIdType& thePointNumber,
+                       vtkPolyData* theMesh);
+  
+  int GetRegions(vtkPolyData* theInput, 
+                vtkPolyData* theOutput);
+
+  int myPointsNb;
+
+};
+
+
+#endif
index 85184e7841154019982c556e192e5a1b026094c0..8713339ff43c92e3e8a37dbc76bcfcf32d2a3c72 100755 (executable)
@@ -49,6 +49,8 @@
 #include <cmath>
 #include <string>
 
+#include "utilities.h"
+
 #ifndef WNT
 # ifndef GLX_GLXEXT_LEGACY
 #  define GLX_GLXEXT_LEGACY
@@ -557,11 +559,10 @@ void VISU_OpenGLPointSpriteMapper::RenderPiece(vtkRenderer *ren, vtkActor *act)
   {
 #ifdef _DEBUG_RENDERING_PERFORMANCE_
     // To control when the mapper is recalculated
-    cout<<"VISU_OpenGLPointSpriteMapper::RenderPiece - "
-       <<(this->GetMTime() > this->BuildTime)<<"; "
-       <<(input->GetMTime() > this->BuildTime)<<"; "
-       <<(act->GetProperty()->GetMTime() > this->BuildTime)<<"; "
-       <<endl;
+    MESSAGE( "VISU_OpenGLPointSpriteMapper::RenderPiece - "
+             <<(this->GetMTime() > this->BuildTime)<<"; "
+             <<(input->GetMTime() > this->BuildTime)<<"; "
+             <<(act->GetProperty()->GetMTime() > this->BuildTime)<<"; ");
 #endif
     // sets this->Colors as side effect
     this->MapScalars( act->GetProperty()->GetOpacity() );
diff --git a/src/PIPELINE/VISU_OptionalDeformationPL.cxx b/src/PIPELINE/VISU_OptionalDeformationPL.cxx
new file mode 100755 (executable)
index 0000000..a4bc455
--- /dev/null
@@ -0,0 +1,101 @@
+//  Copyright (C) 2008  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_ScalarMapPL.cxx
+// Author:  Roman NIKOLAEV
+// Module : VISU
+
+//Salome includes
+#include "VISU_OptionalDeformationPL.hxx"
+#include "VISU_PipeLineUtils.hxx"
+
+//VTK includes
+#include <vtkDataSet.h>
+#include <vtkPassThroughFilter.h>
+#include <vtkWarpVector.h>
+#include <vtkCellDataToPointData.h>
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+//----------------------------------------------------------------------------
+VISU_OptionalDeformationPL::VISU_OptionalDeformationPL():
+  VISU_DeformationPL(),
+  myIsDeformed(true)
+{
+    if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::VISU_OptionalDeformationPL() - "<<this);
+}
+
+//----------------------------------------------------------------------------
+VISU_OptionalDeformationPL::~VISU_OptionalDeformationPL()
+{
+  if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::~VISU_OptionalDeformationPL() - "<<this);
+}
+
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_OptionalDeformationPL::GetMTime(){
+  return Superclass::GetMTime();
+}
+
+//----------------------------------------------------------------------------
+void VISU_OptionalDeformationPL::UseDeformation(bool flag){
+  if(myIsDeformed == flag)
+    return;
+
+  myIsDeformed = flag;
+  if(myIsDeformed)
+    OnDeformation();
+  else
+    OffDeformation();
+}
+
+//----------------------------------------------------------------------------
+bool VISU_OptionalDeformationPL::IsDeformed(){
+  return myIsDeformed;
+}
+
+//----------------------------------------------------------------------------
+void VISU_OptionalDeformationPL::OnDeformation(){
+
+  myCellDataToPointData->SetInput(myInputPassFilter->GetOutput());
+  myWarpVector->SetInput(myCellDataToPointData->GetOutput());
+  myOutputPassFiler->SetInput(myWarpVector->GetOutput());
+}
+
+//----------------------------------------------------------------------------
+void VISU_OptionalDeformationPL::OffDeformation(){
+  myOutputPassFiler->SetInput(myInputPassFilter->GetOutput());
+}
+
+
+
+bool VISU_OptionalDeformationPL::CheckCanDeformate(vtkDataSet* theInput){
+  if(theInput) {
+    if(VISU::IsDataOnCells(theInput))
+      return theInput->GetCellData()->GetVectors() != NULL;
+    else if(VISU::IsDataOnPoints(theInput))
+      return theInput->GetPointData()->GetVectors() != NULL;
+  }
+  return false;
+}
diff --git a/src/PIPELINE/VISU_OptionalDeformationPL.hxx b/src/PIPELINE/VISU_OptionalDeformationPL.hxx
new file mode 100755 (executable)
index 0000000..333da0c
--- /dev/null
@@ -0,0 +1,59 @@
+//  Copyright (C) 2008  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_OptionalDeformationPL.hxx
+//  Author : 
+//  Module : SALOME
+
+#ifndef VISU_OptionalDeformationPL_HeaderFile
+#define VISU_OptionalDeformationPL_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include "VISU_DeformationPL.hxx"
+
+class VISU_PIPELINE_EXPORT VISU_OptionalDeformationPL: public VISU_DeformationPL
+{
+public:
+  VISU_OptionalDeformationPL();
+  virtual ~VISU_OptionalDeformationPL();
+
+  typedef VISU_DeformationPL Superclass;
+
+  void UseDeformation(bool flag);
+  bool IsDeformed();
+
+  virtual 
+  unsigned 
+  long int
+  GetMTime();
+
+protected:
+  bool CheckCanDeformate(vtkDataSet* theInput);
+
+private:
+  void OnDeformation();
+  void OffDeformation();
+
+private:
+  bool myIsDeformed;
+};
+
+#endif
index 6c31a35605a2e5859be61840e2a5f4b987b905cb..26e7290e454ac52e6138965c2d8d4d9b8781ab18 100644 (file)
@@ -95,6 +95,7 @@ namespace VISU
     theTarget->SetScalarMode(theSource->GetScalarMode());
     theTarget->SetImmediateModeRendering(theSource->GetImmediateModeRendering());
     theTarget->SetUseLookupTableScalarRange(theSource->GetUseLookupTableScalarRange());
+    theTarget->SetInterpolateScalarsBeforeMapping(theSource->GetInterpolateScalarsBeforeMapping());
     if(theSource->GetArrayAccessMode() == VTK_GET_ARRAY_BY_ID)
       theTarget->ColorByArrayComponent(theSource->GetArrayId(), theSource->GetArrayComponent());
     else
index c53afe9d5bd1613343b0713f65555c8738c60a08..ed3750fc98da5e99604968c15c69e0d7ccc60fbe 100644 (file)
@@ -56,7 +56,8 @@ VISU_Plot3DPL
   myIsRelative(true),
   myIsContour(false),
   myPosition(0.5),
-  myScaleFactor(1.0)
+  myScaleFactor(1.0),
+  myMapScaleFactor(1.0)
 {
   SetIsShrinkable(false);
 
@@ -315,7 +316,7 @@ VISU_Plot3DPL
 ::SetScaleFactor(vtkFloatingPointType theScaleFactor)
 {
   myScaleFactor = theScaleFactor;
-  myWarpScalar->SetScaleFactor(theScaleFactor);
+  myWarpScalar->SetScaleFactor(theScaleFactor*myMapScaleFactor);
 }
 
 
@@ -524,6 +525,7 @@ void
 VISU_Plot3DPL
 ::SetMapScale(vtkFloatingPointType theMapScale)
 {
+  myMapScaleFactor = theMapScale;
   Superclass::SetMapScale(theMapScale);
 
   if ( myIsContour ) {
index 8585fb8ba2b4a36bba1cc79cfc84c1db2d9efaa2..7ec96d884bc7eb52ee8367e1f43ef00633533ac2 100644 (file)
@@ -146,7 +146,7 @@ protected:
 
   vtkFloatingPointType myAngle[3];
   bool myIsRelative, myIsContour;
-  vtkFloatingPointType myPosition, myScaleFactor;
+  vtkFloatingPointType myPosition, myScaleFactor, myMapScaleFactor;
   VISU_CutPlanesPL::PlaneOrientation myOrientation;
 
   vtkSmartPointer<vtkCellDataToPointData> myCellDataToPointData;
diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
deleted file mode 100644 (file)
index 54ff4f8..0000000
+++ /dev/null
@@ -1,368 +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)
-{
-  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);
-  myScaleFactor = theScale;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Gets scale of deformed shape.
- */
-vtkFloatingPointType
-VISU_ScalarMapOnDeformedShapePL
-::GetScale() 
-{
-  return myWarpVector->GetScaleFactor();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Set scale factor of deformation.
- */
-void
-VISU_ScalarMapOnDeformedShapePL
-::SetMapScale(vtkFloatingPointType theMapScale)
-{
-  Superclass::SetMapScale(theMapScale);
-  myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
-}
-
-//----------------------------------------------------------------------------
-/*!
- * 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 041a37d..0000000
+++ /dev/null
@@ -1,146 +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;
-  vtkWarpVector  *myWarpVector;
-  VISU_MergeFilter *myScalarsMergeFilter;
-  vtkSmartPointer<vtkUnstructuredGrid> myScalars;
-  vtkCellDataToPointData* myCellDataToPointData;
-  VISU_FieldTransform* myScalarsFieldTransform;
-  VISU_Extractor* myScalarsExtractor;
-};
-
-#endif
index d71491290c96e40b2a85e7d08bd72f08f82abe6a..ad7397733e0e64f0038668b2f26e0b8d80e957d6 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "VISU_ScalarMapPL.hxx"
 #include "VISU_DataSetMapperHolder.hxx"
+#include "VISU_ElnoAssembleFilter.hxx"
 #include "VISU_FieldTransform.hxx"
 
 #include "VISU_AppendFilter.hxx"
@@ -50,11 +51,16 @@ vtkStandardNewMacro(VISU_ScalarMapPL);
 VISU_ScalarMapPL
 ::VISU_ScalarMapPL():
   VISU_UnstructuredGridPL(this),
+  myElnoAssembleFilter( VISU_ElnoAssembleFilter::New() ),
   myAppendFilter(VISU_AppendFilter::New()),
   myMergeFilter(VISU_MergeFilter::New())
 {
   SetIsShrinkable(true);
 
+  SetElnoDisassembleState( false );
+
+  myElnoAssembleFilter->Delete();
+
   myAppendFilter->SetMergingInputs(true);
   myAppendFilter->Delete();
 
@@ -111,8 +117,11 @@ VISU_ScalarMapPL
   myMergeFilter->AddField("VISU_FIELD", aDataSet);
   myMergeFilter->AddField("VISU_CELLS_MAPPER", aDataSet);
   myMergeFilter->AddField("VISU_POINTS_MAPPER", aDataSet);
+  myMergeFilter->AddField("ELNO_POINT_COORDS", aDataSet);
+
+  myElnoAssembleFilter->SetInput( InsertCustomPL() );
 
-  GetDataSetMapper()->SetInput(InsertCustomPL());
+  GetDataSetMapper()->SetInput( myElnoAssembleFilter->GetOutput() );
 }
 
 
@@ -148,6 +157,15 @@ VISU_ScalarMapPL
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapPL
+::SetElnoDisassembleState( bool theIsShrunk )
+{
+  GetDataSetMapperHolder()->SetElnoDisassembleState( theIsShrunk );
+  myElnoAssembleFilter->SetElnoAssembleState( theIsShrunk );
+}
+
 //----------------------------------------------------------------------------
 void
 VISU_ScalarMapPL
index dff91d39335b2d410ba6df3f1594a51966ed45eb..fdb4ef9449caff9872e9ed6349221fe05790a795 100644 (file)
@@ -34,6 +34,7 @@
 #include "VISU_UnstructuredGridPL.hxx"
 
 class VISU_DataSetMapperHolder;
+class VISU_ElnoAssembleFilter;
 class VISU_AppendFilter;
 class VISU_MergeFilter;
 
@@ -111,12 +112,16 @@ protected:
   DoShallowCopy(VISU_PipeLine *thePipeLine,
                bool theIsCopyInput);
 
+  void
+  SetElnoDisassembleState( bool theIsShrunk );
+
 private:
   VISU_ScalarMapPL(const VISU_ScalarMapPL&);  // Not implemented.
   void operator=(const VISU_ScalarMapPL&);  // Not implemented.
 
-  vtkSmartPointer<VISU_AppendFilter> myAppendFilter;
-  vtkSmartPointer<VISU_MergeFilter> myMergeFilter;
+  vtkSmartPointer< VISU_ElnoAssembleFilter > myElnoAssembleFilter;
+  vtkSmartPointer< VISU_AppendFilter > myAppendFilter;
+  vtkSmartPointer< VISU_MergeFilter > myMergeFilter;
 };
   
 #endif
index 5192eefb9364d98ace4df4742eceac1571b35a0f..1c3257b929ff9345031121c9c93693a28c4d26de 100644 (file)
@@ -44,18 +44,18 @@ vtkStandardNewMacro(VISU_VectorsPL);
 
 //----------------------------------------------------------------------------
 template<class TOutputFilter>
-void ToCellCenters(TOutputFilter *theOutputFilter, 
-                  vtkCellCenters *theCellCenters,
-                  vtkDataSet* theDataSet,
-                  VISU_UsedPointsFilter* theUsedPointsFilter)
+void ToCellCenters( TOutputFilter *theOutputFilter, 
+                   vtkCellCenters *theCellCenters,
+                   vtkDataSet* theDataSet,
+                   VISU_UsedPointsFilter* theUsedPointsFilter )
 {
-  if(VISU::IsDataOnCells(theDataSet)){
-    theCellCenters->SetInput(theDataSet);
+  if ( VISU::IsDataOnCells( theDataSet ) ) {
+    theCellCenters->SetInput( theDataSet );
     theCellCenters->VertexCellsOn();
-    theOutputFilter->SetInput(theCellCenters->GetOutput());
+    theOutputFilter->SetInput( theCellCenters->GetOutput() );
   }else {
-    theUsedPointsFilter->SetInput(theDataSet);
-    theOutputFilter->SetInput(theUsedPointsFilter->GetOutput());
+    theUsedPointsFilter->SetInput( theDataSet );
+    theOutputFilter->SetInput( theUsedPointsFilter->GetOutput() );
   }
 }
 
@@ -63,10 +63,9 @@ void ToCellCenters(TOutputFilter *theOutputFilter,
 VISU_VectorsPL
 ::VISU_VectorsPL()
 {
-  SetIsShrinkable(false);
+  SetIsShrinkable( false );
 
-  myBaseGlyph = vtkGlyph3D::New();
-  myTransformedGlyph = vtkGlyph3D::New();
+  myGlyph = vtkGlyph3D::New();
 
   myGlyphSource = vtkGlyphSource2D::New();
   myConeSource = vtkConeSource::New();
@@ -83,8 +82,7 @@ VISU_VectorsPL
 VISU_VectorsPL
 ::~VISU_VectorsPL()
 {
-  myBaseGlyph->Delete();
-  myTransformedGlyph->Delete();
+  myGlyph->Delete();
 
   myCenters->Delete();
 
@@ -107,8 +105,7 @@ VISU_VectorsPL
 {
   unsigned long int aTime = Superclass::GetMTime();
 
-  aTime = std::max(aTime, myBaseGlyph->GetMTime());
-  aTime = std::max(aTime, myTransformedGlyph->GetMTime());
+  aTime = std::max(aTime, myGlyph->GetMTime());
   aTime = std::max(aTime, myCenters->GetMTime());
   aTime = std::max(aTime, myGlyphSource->GetMTime());
   aTime = std::max(aTime, myConeSource->GetMTime());
@@ -137,10 +134,9 @@ VISU_VectorsPL
 //----------------------------------------------------------------------------
 void
 VISU_VectorsPL
-::SetTransform(VTKViewer_Transform* theTransform)
+::SetTransform( VTKViewer_Transform* theTransform )
 {
-  GetFieldTransformFilter()->SetSpaceTransform(theTransform);
-  myTransformFilter->SetTransform(theTransform);
+  myTransformFilter->SetTransform( theTransform );
   myTransformFilter->Modified();
 }
 
@@ -150,7 +146,7 @@ VTKViewer_Transform*
 VISU_VectorsPL
 ::GetTransform()
 {
-  return GetFieldTransformFilter()->GetSpaceTransform();
+  return static_cast< VTKViewer_Transform* >( myTransformFilter->GetTransform() );
 }
 
 
@@ -159,13 +155,12 @@ void
 VISU_VectorsPL
 ::SetScale(vtkFloatingPointType theScale) 
 {
-  if(myScaleFactor == theScale) 
+  if ( VISU::CheckIsSameValue( myScaleFactor, theScale ) )
     return;
 
-  myScaleFactor = theScale;
+  myGlyph->SetScaleFactor( theScale );
 
-  myBaseGlyph->SetScaleFactor(myScaleFactor);
-  myTransformedGlyph->SetScaleFactor(myScaleFactor);
+  myScaleFactor = theScale;
 
   Modified();
 }
@@ -176,7 +171,7 @@ vtkFloatingPointType
 VISU_VectorsPL
 ::GetScale() 
 {
-  return myTransformedGlyph->GetScaleFactor();
+  return myGlyph->GetScaleFactor();
 }
 
 
@@ -243,22 +238,15 @@ VISU_VectorsPL
 {
   Superclass::Build();
   
-  ToCellCenters(myBaseGlyph,
-               myCenters,
-               GetMergedInput(),
-               myUsedPointsFilter);
-  myBaseGlyph->SetVectorModeToUseVector();
-  myBaseGlyph->SetScaleModeToScaleByVector();
-  myBaseGlyph->SetColorModeToColorByScalar();
-
-  ToCellCenters(myTransformFilter,
-               myCenters,
-               GetMergedInput(),
-               myUsedPointsFilter);
-  myTransformedGlyph->SetInput(myTransformFilter->GetOutput());
-  myTransformedGlyph->SetVectorModeToUseVector();
-  myTransformedGlyph->SetScaleModeToScaleByVector();
-  myTransformedGlyph->SetColorModeToColorByScalar();
+  ToCellCenters( myTransformFilter,
+                myCenters,
+                GetMergedInput(),
+                myUsedPointsFilter );
+
+  myGlyph->SetInput( myTransformFilter->GetOutput() );
+  myGlyph->SetVectorModeToUseVector();
+  myGlyph->SetScaleModeToScaleByVector();
+  myGlyph->SetColorModeToColorByScalar();
 }
 
 
@@ -267,7 +255,7 @@ vtkDataSet*
 VISU_VectorsPL
 ::InsertCustomPL()
 {
-  return myTransformedGlyph->GetOutput();
+  return myGlyph->GetOutput();
 }
 
 
@@ -290,8 +278,7 @@ VISU_VectorsPL
     case CENTER:
       myGlyphSource->SetCenter(0.0, 0.0, 0.0);
     }
-    myBaseGlyph->SetSource(myGlyphSource->GetOutput());
-    myTransformedGlyph->SetSource(myGlyphSource->GetOutput());
+    myGlyph->SetSource(myGlyphSource->GetOutput());
   }
     break;
   case CONE2:
@@ -313,14 +300,12 @@ VISU_VectorsPL
     case CENTER:
       myConeSource->SetCenter(0.0, 0.0, 0.0);
     }
-    myBaseGlyph->SetSource(myConeSource->GetOutput());
-    myTransformedGlyph->SetSource(myConeSource->GetOutput());
+    myGlyph->SetSource(myConeSource->GetOutput());
   }
     break;
   case NONE:
   default: {
-    myBaseGlyph->SetSource(myLineSource->GetOutput());
-    myTransformedGlyph->SetSource(myLineSource->GetOutput());
+    myGlyph->SetSource(myLineSource->GetOutput());
   }
   }
 
@@ -335,19 +320,12 @@ VISU_VectorsPL
 {
   unsigned long int aSize = Superclass::GetMemorySize();
 
-  if(vtkDataSet* aDataSet = myBaseGlyph->GetOutput())
-    aSize += aDataSet->GetActualMemorySize() * 1024;
-
-  if(vtkDataSet* aDataSet = myTransformedGlyph->GetOutput())
+  if(vtkDataSet* aDataSet = myGlyph->GetOutput())
     aSize += aDataSet->GetActualMemorySize() * 1024;
   
   if(vtkDataSet* aDataSet = myCenters->GetOutput())
     aSize += aDataSet->GetActualMemorySize() * 1024;
 
-  if(myCellDataToPointData->GetInput())
-    if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
-      aSize += aDataSet->GetActualMemorySize() * 1024;
-
   return aSize;
 }
 
@@ -357,8 +335,9 @@ vtkDataSet*
 VISU_VectorsPL
 ::GetOutput()
 {
-  myBaseGlyph->Update();
-  return myBaseGlyph->GetOutput();
+  myGlyph->Update();
+
+  return myGlyph->GetOutput();
 }
 
 
@@ -368,9 +347,9 @@ VISU_VectorsPL
 ::SetMapScale(vtkFloatingPointType theMapScale)
 {
   VISU_ScalarMapPL::SetMapScale(theMapScale);
+  myMapScaleFactor = theMapScale;
 
-  myBaseGlyph->SetScaleFactor(myScaleFactor*theMapScale);
-  myTransformedGlyph->SetScaleFactor(myScaleFactor*theMapScale);
+  myGlyph->SetScaleFactor( myScaleFactor*theMapScale );
 
   Modified();
 }
index 09fe54cb5c603f031fe4a4fa2471fde1f2df4b63..0befbd6ecc8a6f5fd721b806766fb897b71a45c1 100644 (file)
@@ -135,8 +135,7 @@ protected:
 
   GlyphType myTypeGlyph;
   GlyphPos myPosGlyph;
-  vtkGlyph3D *myBaseGlyph;
-  vtkGlyph3D *myTransformedGlyph;
+  vtkGlyph3D *myGlyph;
 
   vtkGlyphSource2D *myGlyphSource;
   vtkLineSource *myLineSource;
index 1f20a5b4fe36db41d9c5c1e2d77401fb9ddb3782..e3a8633633632edfa5bb4093e8ee77d372581320 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 \
@@ -97,7 +97,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 2125dcc03a6e507d4b1473419b30b81c23938622..b24996d2ca6dfcf05a148e57370ae558c36ce784 100644 (file)
@@ -397,6 +397,26 @@ Do you want to enlarge the cache?</translation>
             <source>VISU_BAR_HEIGHT</source>
             <translation>Bar height (%):</translation>
         </message>
+        <message>
+            <source>VISU_AUTOMATIC_FIT_ALL</source>
+            <translation>Automatic Fit All</translation>
+        </message>
+        <message>
+            <source>VISU_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
+            <translation>Def. Shape and Scalar Map</translation>
+        </message>
+        <message>
+            <source>VISU_FLOATING_POINT_PRECISION</source>
+            <translation>Floating Point Precision</translation>
+        </message>
+        <message>
+            <source>VISU_REALLY_DELETE</source>
+            <translation>Do you really want to delete this %1 object(s): %2</translation>
+        </message>
+        <message>
+            <source>WRN_NO_APPROPRIATE_SELECTION</source>
+            <translation>No appropriate objects selected</translation>
+        </message>
     </context>
     <context>
         <name>VVTK_MainWindow</name>
@@ -1105,8 +1125,8 @@ Please, refer to the documentation.</translation>
             <translation>Scalar Map</translation>
         </message>
         <message>
-            <source>MEN_SCALAR_MAP_ON_DEFORMED_SHAPE</source>
-            <translation>Scalar Map on Deformed Shape</translation>
+            <source>MEN_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
+            <translation>Deformed Shape and Scalar Map</translation>
         </message>
         <message>
             <source>MEN_SCALING</source>
@@ -1208,6 +1228,26 @@ Please, refer to the documentation.</translation>
             <source>MEN_FILE_INFO</source>
             <translation>MED File information</translation>
         </message>
+        <message>
+            <source>ERR_ERROR_IN_THE_FILE</source>
+            <translation>Error in the file</translation>
+        </message>
+        <message>
+            <source>ERR_FILE_NOT_EXISTS</source>
+            <translation>File does not exist</translation>
+        </message>
+        <message>
+            <source>IMPORT_ERRORS</source>
+            <translation>Import operation has finished with errors:</translation>
+        </message>
+        <message>
+            <source>TLT_IMPORT_TABLE</source>
+            <translation>Import table</translation>
+        </message>
+        <message>
+            <source>UNKNOWN_IMPORT_ERROR</source>
+            <translation>Unknown error</translation>
+        </message>
     </context>
     <context>
         <name>VisuGUI_AxisWg</name>
@@ -1664,6 +1704,18 @@ Please, provide non-empty resulting presentation.</translation>
             <source>TXT_ORIENTATION</source>
             <translation>Orientation</translation>
         </message>
+        <message>
+            <source>LBL_DEFORMATION</source>
+            <translation>Deformation</translation>
+        </message>
+        <message>
+            <source>LBL_DEFROMATION_SCALE</source>
+            <translation>Scale Factor :</translation>
+        </message>
+        <message>
+            <source>LBL_DEFROMATION_VECT</source>
+            <translation>Vectors :</translation>
+        </message>
     </context>
     <context>
         <name>VisuGUI_DeformedShapeDlg</name>
@@ -1980,6 +2032,18 @@ Please, provide non-empty resulting presentation.</translation>
             <source>NB_SURFACES</source>
             <translation>Number of surfaces:</translation>
         </message>
+        <message>
+            <source>MAGNITUDE_COLORING_CHK</source>
+            <translation>Magnitude coloring</translation>
+        </message>
+        <message>
+            <source>SEL_COLOR_BTN</source>
+            <translation>Select Color</translation>
+        </message>
+        <message>
+            <source>SHOW_VALUES_CHK</source>
+            <translation>Show values (nb per surface)</translation>
+        </message>
     </context>
     <context>
         <name>VisuGUI_IsoSurfacesDlg</name>
@@ -2717,7 +2781,7 @@ Please, provide non-empty resulting presentation.</translation>
         </message>
     </context>
     <context>
-        <name>VisuGUI_ScalarMapOnDeformedShapeDlg</name>
+        <name>VisuGUI_DeformedShapeAndScalarMapDlg</name>
         <message>
             <source>&amp;Cancel</source>
             <translation></translation>
@@ -2728,7 +2792,7 @@ Please, provide non-empty resulting presentation.</translation>
         </message>
         <message>
             <source>DLG_TITLE</source>
-            <translation>Scalar Map on Deformed Shape</translation>
+            <translation>Deformed Shape and Scalar Map</translation>
         </message>
         <message>
             <source>FIELD_ITEM</source>
@@ -2743,8 +2807,8 @@ Please, provide non-empty resulting presentation.</translation>
             <translation>Scalar Bar</translation>
         </message>
         <message>
-            <source>SCALAR_MAP_ON_DEFORMED_SHAPE_TAB</source>
-            <translation>Scalar Map on Deformed Shape</translation>
+            <source>DEFORMED_SHAPE_AND_SCALAR_MAP_TAB</source>
+            <translation>Deformed Shape and Scalar Map</translation>
         </message>
         <message>
             <source>SCALE_FACTOR</source>
index 810aeb274b38f92d0e5861fffacc7c70c7cee6b5..109c82428c47bc60f67aecc63cb199d5dadade67 100644 (file)
@@ -56,6 +56,7 @@
 #include "SUIT_ViewManager.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_DataBrowser.h"
+#include "SUIT_OverrideCursor.h"
 
 #include "CAM_Module.h"
 
 #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"
@@ -193,7 +194,7 @@ VisuGUI
 
   SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
 
-  // Get file name
+  // Get file name(s)
   QStringList aFilter;
   aFilter.append( tr( "FLT_MED_FILES" ) );
   aFilter.append( tr( "FLT_DISTRIBUTED_MED_FILES" ) );
@@ -201,57 +202,85 @@ VisuGUI
 
   bool toUseBuildProgress = aResourceMgr->booleanValue("VISU", "use_build_progress", false);
 
-  SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
-  fd->setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
-  fd->setFilters( aFilter );
-  fd->SetChecked( toUseBuildProgress );
-  if( !fd->exec() )
-    return;
+  SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
+  fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
+  fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );     
+  fd.setFilters( aFilter );
+  fd.SetChecked( toUseBuildProgress );
+  if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
+    fd.setDirectory( QDir::currentPath() );
 
-  QFileInfo aFileInfo( fd->selectedFile() );
-  toUseBuildProgress = fd->IsChecked();
-  delete fd;
+  QStringList fileNames;
+  if ( !fd.exec() )
+    return; // cancelled, return
 
-  // Check the file name
-  if ( !aFileInfo.exists() )
-    return;
+  fileNames = fd.selectedFiles();
+  toUseBuildProgress = fd.IsChecked();
 
-  if ( !toUseBuildProgress )
-    {
-      bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields", true );
-      bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max", true );
-      bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
-      bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
-      bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
-
-      QString anInfo("Importing From File " + aFileInfo.absoluteFilePath() + "..." );
-      application()->putInfo( anInfo );
-
-      QApplication::setOverrideCursor(Qt::WaitCursor);
-      VISU::Result_var aResult = GetVisuGen(this)->CreateResult( aFileInfo.filePath().toLatin1().data() );
-
-      if (CORBA::is_nil(aResult.in())) {
-       SUIT_MessageBox::warning(GetDesktop(this),
-                                tr("WRN_VISU"),
-                                VisuGUI_BuildProgressDlg::tr("ERR_ERROR_IN_THE_FILE") );
-       QApplication::restoreOverrideCursor();
-      }else{
-       aResult->SetBuildFields( toBuildFields, toBuildMinMax );
-       aResult->SetBuildGroups( toBuildGroups );
-       aResult->Build( toBuildAll, toBuildAtOnce );
-
-       UpdateObjBrowser(this);
-       application()->putInfo( anInfo + tr("INF_DONE"));
-       QApplication::restoreOverrideCursor();
-      }
-    }
-  else
-    {
-      VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
-      aBuildProgressDlg->setFileName( aFileInfo.filePath() );
-      aBuildProgressDlg->setGenerator( GetVisuGen(this) );
-      aBuildProgressDlg->show();
+  if ( fileNames.count() == 0 )
+    return; // nothing selected, return
+
+  SUIT_OverrideCursor wc;
+  QStringList errors;
+
+  for ( QStringList::ConstIterator it = fileNames.begin(); it != fileNames.end(); ++it ) {
+    QFileInfo aFileInfo( *it );
+  
+    if ( !aFileInfo.exists() ) {
+      // file not exist
+      errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+                    arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
     }
+    else {
+      try {
+       if ( !toUseBuildProgress ) {
+         // build progress is not used, use build flags from settings
+         bool toBuildFields = aResourceMgr->booleanValue( "VISU", "build_fields",     true );
+         bool toBuildMinMax = aResourceMgr->booleanValue( "VISU", "build_min_max",    true );
+         bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups",     true );
+         bool toBuildAll    = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
+         bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once",    false );
+         
+         QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " ); 
+         application()->putInfo( anInfo );
+         
+         VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
+         
+         if ( CORBA::is_nil( aResult.in() ) ) {
+           errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+                          arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+         }
+         else {
+           aResult->SetBuildFields( toBuildFields, toBuildMinMax );
+           aResult->SetBuildGroups( toBuildGroups );
+           aResult->Build( toBuildAll, toBuildAtOnce );
+           application()->putInfo( anInfo + tr("INF_DONE") );
+         }
+       } // if ( !toUseBuildProgress )
+       else {
+         // use build progress
+         wc.suspend();
+         VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) );
+         aBuildProgressDlg->setFileName( aFileInfo.filePath() );
+         aBuildProgressDlg->setGenerator( GetVisuGen(this) );
+         aBuildProgressDlg->exec();
+         wc.resume();
+       }
+      } // try
+      catch(...) {
+       errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+      }
+    } // else // if ( !aFileInfo.exists() )
+  } // for (...)
+
+  if ( errors.count() > 0 ) {
+    SUIT_MessageBox::critical( GetDesktop(this),
+                              tr("ERR_ERROR"),
+                              tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+  }
+  else {
+    UpdateObjBrowser(this);
+  }
 }
 
 void
@@ -266,26 +295,54 @@ VisuGUI
   aFilter.append( tr("FLT_TABLE_FILES") );
   aFilter.append( tr("FLT_ALL_FILES") );
 
-  QFileInfo aFileInfo =
-    SUIT_FileDlg::getFileName(GetDesktop(this),
-                              "",
-                              aFilter,
-                              tr("MEN_IMPORT_TABLE"),
-                              true);
-  if (aFileInfo.exists()) {
-    application()->putInfo( tr("MEN_IMPORT_TABLE") + " " + aFileInfo.absoluteFilePath() + " ..." );
-
-    CORBA::Object_var anObject = GetVisuGen(this)->ImportTables((const char*)aFileInfo.absoluteFilePath().toLatin1());
-
-    if (CORBA::is_nil(anObject.in())) {
-      SUIT_MessageBox::warning( GetDesktop(this),
-                                tr("WRN_VISU"),
-                                tr("ERR_ERROR_IN_THE_FILE") );
-    } else {
-      application()->putInfo(aFileInfo.absoluteFilePath()+tr("INF_DONE"));
-      UpdateObjBrowser(this);
+  QString anInitialPath = "";
+  if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
+    anInitialPath = QDir::currentPath();
+
+  QStringList aFiles = SUIT_FileDlg::getOpenFileNames(GetDesktop(this),
+                                                     anInitialPath,
+                                                     aFilter,
+                                                     tr("TLT_IMPORT_TABLE"));
+  if ( aFiles.count() == 0 )
+    return; // nothing selected
+
+  QStringList errors;
+  for ( QStringList::ConstIterator it = aFiles.begin(); it != aFiles.end(); ++it ) {
+    QFileInfo aFileInfo( *it );
+
+    if ( !aFileInfo.exists() ) {
+      errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+                    arg( tr( "ERR_FILE_NOT_EXISTS" ) ) );
+    }
+    else {
+      try {
+       QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." ); 
+       application()->putInfo( anInfo );
+       
+       CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath().toLatin1().constData());
+      
+       if (CORBA::is_nil(anObject.in())) {
+         errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
+                        arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
+       } 
+       else {
+         application()->putInfo( anInfo + tr("INF_DONE") );
+       }
+      }
+      catch(...) {
+       errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).arg( tr( "UNKNOWN_IMPORT_ERROR" ) ) );
+      }
     }
   }
+
+  if ( errors.count() > 0 ) {
+    SUIT_MessageBox::critical( GetDesktop(this),
+                              tr("ERR_ERROR"),
+                              tr("IMPORT_ERRORS" ) + "\n" + errors.join( "\n" ) );
+  }
+  else {
+    UpdateObjBrowser(this);
+  }
 }
 
 void
@@ -667,15 +724,14 @@ void
 VisuGUI
 ::OnCreateDeformedShape()
 {
-  //  CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
-  VisuGUI_DeformedShapeDlg::CreatePrs3d(this);
+  CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
 }
 
 void
 VisuGUI
-::OnCreateScalarMapOnDeformedShape()
+::OnCreateDeformedShapeAndScalarMap()
 {
-  CreatePrs3d<VISU::ScalarMapOnDeformedShape_i,VisuGUI_ScalarMapOnDeformedShapeDlg,1>(this);
+  CreatePrs3d<VISU::DeformedShapeAndScalarMap_i,VisuGUI_DeformedShapeAndScalarMapDlg,1>(this);
 }
 
 void
@@ -776,7 +832,8 @@ VisuGUI
          aViewWindow->getRenderer()->ResetCameraClippingRange();
          aViewWindow->Repaint();
        }
-      }}
+      }
+    }
     }
   }
 
@@ -880,11 +937,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);
 }
 
 //----------------------------------------------------------------------------
@@ -1142,12 +1199,6 @@ void
 VisuGUI
 ::OnChangeOpacity()
 {
-  VISU_Actor* anActor = NULL;
-  VISU::Prs3d_i* aPrs3d = NULL;
-  SVTK_ViewWindow* aViewWindow = NULL;
-  if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
-    return;
-
   VisuGUI_TransparencyDlg* aDialog = new VisuGUI_TransparencyDlg( this );
   aDialog->show();
 }
@@ -1158,10 +1209,24 @@ VisuGUI
 ::OnChangeLines()
 {
   VISU_Actor* anActor = NULL;
+  VISU_ActorBase* anActorBase = NULL;
   VISU::Prs3d_i* aPrs3d = NULL;
   SVTK_ViewWindow* aViewWindow = NULL;
-  if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
-    return;
+  float oldlwid;
+  bool isPrs3d = false;
+
+  if (GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor)) {
+    isPrs3d = true;
+  }
+  else {
+    aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
+    VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
+    VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
+    VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
+    anActorBase = VISU::FindActorBase(aViewWindow, aTable);
+    oldlwid = anActorBase->GetLineWidth();
+  }
+
 
   VisuGUI_CursorDlg* CursorDlg =
     new VisuGUI_CursorDlg (GetDesktop(this), (const char*)tr("DLG_LINEWIDTH_TITLE").toLatin1(), TRUE);
@@ -1172,7 +1237,6 @@ VisuGUI
   CursorDlg->SpinBox1->setMinimum(1);
   CursorDlg->SpinBox1->setMaximum(10);
 
-  float oldlwid = anActor->GetLineWidth();
   int intlwid = int(oldlwid);
   CursorDlg->SpinBox1->setValue(intlwid);
 
@@ -1180,7 +1244,10 @@ VisuGUI
   if (ret == 1) {
     intlwid  = CursorDlg->SpinBox1->value();
     float newlwid = intlwid;
-    anActor->SetLineWidth(newlwid);
+    if (isPrs3d)
+      anActor->SetLineWidth(newlwid);
+    else
+      anActorBase->SetLineWidth(newlwid);
   }
   delete CursorDlg;
 }
@@ -1272,15 +1339,30 @@ VisuGUI
   int i = 0, nbSelected = aList.Extent();
   if (nbSelected < 1) return;
 
-  std::vector<std::string> anEntries(nbSelected);
+  std::vector<std::string> anEntries (nbSelected);
+  QString aNameList;
   Handle(SALOME_InteractiveObject) anIO;
   for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
     anIO = it.Value();
-    if (anIO->hasEntry())
-      anEntries[i++] = anIO->getEntry();
+    aNameList.append("\n    - ");
+    aNameList.append(anIO->getName());
+    if (anIO->hasEntry()) {
+      if (IsRemovable(anIO->getEntry(), this))
+        anEntries[i++] = anIO->getEntry();
+    }
   }
   nbSelected = i;
-  if (nbSelected < 1) return;
+  if (nbSelected < 1) {
+    SUIT_MessageBox::warning(GetDesktop(this),
+                            QObject::tr("WRN_VISU"),
+                            QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
+  }
+
+  if ( SUIT_MessageBox::question( GetDesktop(this),
+                                 QObject::tr( "WRN_VISU" ),
+                                 QObject::tr( "VISU_REALLY_DELETE" ).arg( nbSelected ).arg( aNameList ),
+                                 SUIT_MessageBox::Yes | SUIT_MessageBox::No ) != SUIT_MessageBox::Yes )
+    return;
 
   // There is a transaction
   _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
@@ -1313,7 +1395,8 @@ VisuGUI
            }
          }
        }
-      }else{
+      }
+      else{
        DeleteSObject(this, aCStudy, aSObject);
        UpdateObjBrowser(this, true, aSObject);
       }
@@ -1621,68 +1704,97 @@ VisuGUI
     return;
 
   VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
-  if(aSelectionInfo.empty())
+  if (aSelectionInfo.empty())
     return;
 
-  VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
-  _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
-  if(!aSObject)
-    return;
+  VisuGUI_Selection aSel (this);
+  aSel.init("", getApp()->selectionMgr());
+  if (aSel.count() < 1) return;
 
-  //TEST DU PARENT == VISU
-  _PTR(StudyBuilder) aBuilder = aCStudy->NewBuilder();
-  _PTR(GenericAttribute) anAttr = aBuilder->FindOrCreateAttribute(aSObject, "AttributeName");
-  if (anAttr) {
-    _PTR(AttributeName) aName (anAttr);
-    QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
-    if (!Name.isEmpty()) {
-      QApplication::setOverrideCursor(Qt::WaitCursor);
-
-      // rename specific objects
-      if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
-       switch(aBase->GetType()){
-       case VISU::TCURVE: { // Curve object
-         if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase))
-           aCurve->SetName((const char*)Name.toLatin1(), true);
-         break;
-       }
-       case VISU::TTABLE: { // Table object
-         if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
-           aTable->SetName((const char*)Name.toLatin1(), true);
-         break;
-       }
-       case VISU::TCONTAINER: { // Container object
-         if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase))
-           aContainer->SetName((const char*)Name.toLatin1(), true);
-         break;
-       }
-       default: {
-       }}
-      }
-    }
+  bool isAny = false; // is there any appropriate object selected
+  for (int i = 0; i < aSelectionInfo.size(); i++) {
+    VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
+    VISU::TObjectInfo anObjectInfo = aSelectionItem.myObjectInfo;
 
-    if (!Name.isEmpty()) {
-      // rename the study object
-      Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
-      aName->SetValue((const char*)Name.toLatin1()); // rename the SObject
-      anIO->setName((const char*)Name.toLatin1()); // rename the InteractiveObject
-
-      ViewManagerList aViewManagerList;
-      ViewManagerList::Iterator anIt;
-      getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
-      anIt = aViewManagerList.begin();
-      for(; anIt != aViewManagerList.end(); anIt++ )
-      {
-       if(Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(*anIt)){
-         if(SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
-           aViewer->renameAll( anIO, (const char*)Name.toLatin1() );
-       }
-      }
+    _PTR(SObject) aSObject = anObjectInfo.mySObject;
+    if (!aSObject)
+      continue;
 
-      UpdateObjBrowser(this, false);
+    // Check, if the selected object can be renamed
+    QString aStr = aSel.parameter(i, "type" ).toString();
+    if (aStr == "VISU::TSCALARMAP" || aStr == "VISU::TISOSURFACES" ||
+        aStr == "VISU::TDEFORMEDSHAPE" || aStr == "VISU::TCUTPLANES" ||
+        aStr == "VISU::TCUTLINES" || aStr == "VISU::TVECTORS" ||
+        aStr == "VISU::TSTREAMLINES" || aStr == "VISU::TPLOT3D" ||
+        aStr == "VISU::TSCALARMAPONDEFORMEDSHAPE" || aStr == "VISU::TCOLOREDPRS3DHOLDER" ||
+        aStr == "VISU::TTABLE" || aStr == "VISU::TCURVE" || aStr == "VISU::TCONTAINER" ||
+        aStr == "VISU::POINTMAP3D" || aStr == "VISU::TVIEW3D" ||
+        aStr == "VISU::TMESH" || aStr == "VISU::TPOINTMAP3D")
+    {
+      _PTR(GenericAttribute) anAttr;
+      if (aSObject->FindAttribute(anAttr, "AttributeName")) {
+        isAny = true;
+        _PTR(AttributeName) aName (anAttr);
+        QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
+        if (!Name.isEmpty()) {
+          QApplication::setOverrideCursor(Qt::WaitCursor);
+
+          // rename specific objects
+          if (VISU::Base_i* aBase = anObjectInfo.myBase) {
+            switch (aBase->GetType()) {
+            case VISU::TCURVE: { // Curve object
+              if (VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(aBase))
+                aCurve->SetName(Name.toLatin1().constData(), true);
+              break;
+            }
+            case VISU::TTABLE: { // Table object
+              if (VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(aBase))
+                aTable->SetName(Name.toLatin1().constData(), true);
+              break;
+            }
+            case VISU::TPOINTMAP3D: { // Table object
+              if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
+                aTable3d->SetTitle(Name.toLatin1().constData());
+                aTable3d->UpdateActors(); 
+              }
+              break;
+            }
+            case VISU::TCONTAINER: { // Container object
+              if (VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aBase))
+                aContainer->SetName(Name.toLatin1().constData(), true);
+              break;
+            }
+            default: {
+            }}
+          }
+
+          // rename the study object
+          Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
+          aName->SetValue(Name.toLatin1().constData()); // rename the SObject
+          anIO->setName(Name.toLatin1().constData()); // rename the InteractiveObject
+
+          ViewManagerList aViewManagerList;
+          getApp()->viewManagers(SPlot2d_Viewer::Type(), aViewManagerList);
+          SUIT_ViewManager* aViewManager;
+         foreach( aViewManager, aViewManagerList ) {
+            if (Plot2d_ViewManager* aManager = dynamic_cast<Plot2d_ViewManager*>(aViewManager)) {
+              if (SPlot2d_Viewer* aViewer = dynamic_cast<SPlot2d_Viewer*>(aManager->getViewModel()))
+                aViewer->renameAll( anIO, Name.toLatin1().constData() );
+            }
+          }
+
+          UpdateObjBrowser(this, false);
+
+          QApplication::restoreOverrideCursor();
+        }
+      }
     }
+  } // for
 
-    QApplication::restoreOverrideCursor();
+  if (!isAny) {
+    SUIT_MessageBox::warning(GetDesktop(this),
+                            QObject::tr("WRN_VISU"),
+                            QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
   }
 }
 
@@ -1748,6 +1860,7 @@ VisuGUI
         aScalarMap->SetMapScale(aPercents);
         aScalarMap->UpdateActor(anActor);
         aViewWindow->getRenderWindow()->Render();
+        aViewWindow->Repaint();
         usleep(aTemp);
       } catch (std::exception& exc) {
         INFOS("Follow exception was occured :\n" << exc.what());
@@ -1869,7 +1982,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);
@@ -2014,26 +2128,7 @@ VisuGUI
 {
   if(MYDEBUG) MESSAGE("VisuGUI::OnTranslatePrs");
   VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this);
-
-  LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
-  SALOME_ListIO aListIO;
-  aSelectionMgr->selectedObjects(aListIO);
-
-  SalomeApp_Study* aStudy = GetAppStudy(this);
-  SALOME_ListIteratorOfListIO anIter(aListIO);
-  for (; anIter.More(); anIter.Next()) {
-    Handle(SALOME_InteractiveObject) anIO = anIter.Value();
-    if (anIO->hasEntry()) {
-      QString anEntry(anIO->getEntry());
-      VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)anEntry.toLatin1());
-      if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase))
-       aDlg->addPresentation(aPrsObject);
-    }
-  }
-  if (aDlg->getPrsCount() > 0)
-    aDlg->show();
-  else
-    delete aDlg;
+  aDlg->exec();
 }
 
 void
@@ -2069,9 +2164,6 @@ VisuGUI
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
   // Create actions
-  //createAction( VISU_IMPORT_FROM_FILE, "", QIcon(),
-  //              tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
-  //              this, SLOT(OnImportFromFile()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_IMPORT_MED"));
   createAction( VISU_IMPORT_FROM_FILE, tr("IMPORT_FROM_FILE"), QIcon(aPixmap),
@@ -2093,9 +2185,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"), QIcon(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"), QIcon(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"), QIcon(aPixmap),
@@ -2140,7 +2232,7 @@ VisuGUI
                 tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
                 this, SLOT(OnShowTable()));
 
-  createAction( VISU_SHOW_TABLE_PLOT, tr("MEN_EDIT_PRS"), QIcon(),
+  createAction( VISU_EDIT_POINTMAP3D, tr("MEN_EDIT_PRS"), QIcon(),
                 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
                 this, SLOT(OnShowTablePlot()));
 
@@ -2331,10 +2423,9 @@ VisuGUI
                 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
                 this, SLOT(OnEditPlot3D()));
 
-  createAction( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIcon(),
+  createAction( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP, tr("MEN_EDIT_PRS"), QIcon(),
                 tr("MEN_EDIT_PRS"), "", 0, aParent, false,
-                this, SLOT(OnEditScalarMapOnDeformedShape()));
-
+                this, SLOT(OnEditDeformedShapeAndScalarMap()));
 
   createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIcon(),
                 tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
@@ -2438,7 +2529,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
@@ -2470,7 +2561,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 );
@@ -2504,7 +2595,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
@@ -2520,8 +2611,9 @@ 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 );
 
   // rename
   mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
@@ -2533,9 +2625,9 @@ VisuGUI
   mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
 
   // table commands
-  //mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
-  //mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
-  //mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
+  mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
+  mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
+  mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
 
   mgr->insert( separator(), -1, -1, -1 );
 
@@ -2602,7 +2694,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'";
@@ -2621,24 +2713,24 @@ VisuGUI
   mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule );
   mgr->setRule( action( VISU_VECTORS ), aRule );
   mgr->setRule( action( VISU_STREAM_LINES ), aRule );
-  mgr->setRule( action( VISU_SCALAR_MAP_ON_DEFORMED_SHAPE ), aRule );
+  mgr->setRule( action( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP ), aRule );
 
   // display/erase commands
   QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
   QString aTableOrCont = "(type='VISU::TTABLE' and nbChildren>0) or type='VISU::TCONTAINER'";
   QString orCurveVisible   = "or (type='VISU::TCURVE' and isVisible)";
   QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
-  QString aPrsVisible   = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
-  QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
+  QString aPrsVisible   = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}) and isVisible)";
+  QString aPrsInvisible = "(($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})" + andInvisible + ")";
   QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )";
 
   QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible +
     " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + "))) ) or " + aComponent;
 
   QString aDisplayRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsInvisible +
-    " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + "))) ) or" + aComponent;
+    " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + "))) ) or " + aComponent;
 
-  QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' " + aPrsAll + "})"
+  QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "})"
     " or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
     " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'})))) ) or" + aComponent;
 
@@ -2646,7 +2738,7 @@ VisuGUI
   mgr->setRule( action( VISU_DISPLAY ), aDisplayRule );
   mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule );
 
-  aRule = "selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "}";
+  aRule = "selcount>0 and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}";
   mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule );
 
   aRule = "selcount>1 and $type in {'VISU::TMESH' " + aPrsAll + "}";
@@ -2663,14 +2755,15 @@ VisuGUI
   mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'VVTK'} and selcount=0" );
 
   // 3D presentations commands
-  QString aPrsType    = " and $type in {'VISU::TMESH' " + 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 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' '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'}";
-  QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
+                        " '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::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
 
   aRule = "selcount=1";
   mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType );
@@ -2683,7 +2776,7 @@ VisuGUI
   QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}";
 
   mgr->setRule( action( VISU_POINTS )      , aRule + aPrsType + aNotPoints );
-  mgr->setRule( action( VISU_WIREFRAME )   , aRule + aPrsType + aNotWirefr );
+  mgr->setRule( action( VISU_WIREFRAME )   , aRule + aPrsType2 + aNotWirefr );
   mgr->setRule( action( VISU_SURFACE )     , aRule + aSurfType + aNotSurfac );
   mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + anInsideType + aNotInside );
   mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr );
@@ -2704,19 +2797,25 @@ VisuGUI
   mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1" );
 
   // rename command
-  QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'";
+  QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::POINTMAP3D'";
 
-  aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' " + aCurveAll + " " + aPrsAll + "})";
+  aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' 'VISU::TPOINTMAP3D' " + aCurveAll + " " + aPrsAll + "})";
   mgr->setRule( action( VISU_RENAME ), aRule );
 
   // copy presentation command
   aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
   mgr->setRule( action( VISU_COPY_PRS ), aRule );
 
-  // curve commands
+  // Curve commands
   aRule = "selcount=1 and type='VISU::TCURVE'";
   mgr->setRule( action( VISU_CURVE_PROPS ), aRule );
 
+  // Table Commands
+  aRule = "selcount=1 and ( type='VISU::TPOINTMAP3D' or type='VISU::TTABLE')";
+  mgr->setRule( action( VISU_SHOW_TABLE ), aRule );
+  mgr->setRule( action( VISU_CREATE_CURVES ), aRule );
+  mgr->setRule( action( VISU_EXPORT_TABLE ), aRule );
+
   // curve container commands
   aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
   mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule );
@@ -2726,8 +2825,8 @@ VisuGUI
                "selcount=1 and type='VISU::TSCALARMAP'" );
   mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
                "selcount=1 and type='VISU::TDEFORMEDSHAPE'" );
-  mgr->setRule( action( VISU_EDIT_SCALARMAPONDEFORMEDSHAPE ),
-               "selcount=1 and type='VISU::TSCALARMAPONDEFORMEDSHAPE'" );
+  mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPEANDSCALARMAP ),
+               "selcount=1 and $type in {'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}" );
   mgr->setRule( action( VISU_EDIT_CUTPLANES ),
                "selcount=1 and type='VISU::TCUTPLANES'" );
   mgr->setRule( action( VISU_EDIT_CUTLINES ),
@@ -2740,6 +2839,8 @@ VisuGUI
                "selcount=1 and type='VISU::TSTREAMLINES'" );
   mgr->setRule( action( VISU_EDIT_PLOT3D ),
                "selcount=1 and type='VISU::TPLOT3D'" );
+  mgr->setRule( action( VISU_EDIT_POINTMAP3D ),
+               "selcount=1 and type='VISU::TPOINTMAP3D'" );
 
   aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
   mgr->setRule( action( VISU_CREATE_TABLE ), aRule );
@@ -2820,6 +2921,14 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QMenu* theMenu, QStrin
       _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
       if ( !aSObject )
        continue;
+
+      if ( !isOBClient ) {
+       QString aName = QString( aSObject->GetName().c_str() );
+       while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of popup
+         aName.remove( (aName.length() - 1), 1 );
+       theTitle = aName;
+      }
+
       CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
       if (CORBA::is_nil(aCORBAObject)) {
        VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
@@ -2916,21 +3025,11 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QMenu* theMenu, QStrin
     theMenu->addAction( action( VISU_SHOW_ANIMATION ) );
   } else if (isOBClient) {
     if (IsSObjectTable(aSObject)) {
-      theMenu->removeAction( action( VISU_DELETE_OBJS ) );
-      if (aType == VISU::TPOINTMAP3D) {
-       theMenu->addAction( action( VISU_SHOW_TABLE_PLOT ) );
-       theMenu->addSeparator();
-       theMenu->addAction( action( VISU_ERASE ) );
-       theMenu->addAction( action( myEraseAll ) );
-       theMenu->addAction( action( VISU_DISPLAY ) );
-       theMenu->addAction( action( VISU_DISPLAY_ONLY ) );
-       theMenu->addSeparator();
-      }
-      theMenu->addAction( action( VISU_SHOW_TABLE ) );
+      /*      action( VISU_SHOW_TABLE )->addTo(theMenu);
       theMenu->addAction( action( VISU_CREATE_CURVES ) );
       theMenu->addAction( action( VISU_EXPORT_TABLE ) );
       theMenu->addSeparator();
-      theMenu->addAction( action( VISU_DELETE_OBJS ) );
+      action( VISU_DELETE_OBJS )->addTo(theMenu);*/// dmv - code was moved up
     } else {
       if (!CORBA::is_nil(anObject)) {
         SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
@@ -2952,17 +3051,6 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QMenu* theMenu, QStrin
         }
       }
     }
-  } else {
-    if (aType == VISU::TPOINTMAP3D) {
-      theMenu->removeAction( action( myEraseAll ) );
-      theMenu->addAction( action( VISU_SHOW_TABLE_PLOT ) );
-      theMenu->addSeparator();
-      theMenu->addAction( action( VISU_ERASE ) );
-      theMenu->addAction( action( myEraseAll ) );
-      theMenu->addAction( action( VISU_DISPLAY ) );
-      theMenu->addAction( action( VISU_DISPLAY_ONLY ) );
-      theMenu->addSeparator();
-    }
   }
 }
 
@@ -3015,6 +3103,9 @@ VisuGUI
   shortcuts.append( QKeySequence(Qt::CTRL + Qt::Key_I) );
   action(VISU_IMPORT_FROM_FILE)->setShortcuts(shortcuts);
 
+  action(VISU_DELETE_OBJS)->setEnabled(true); // Delete: Key_Delete
+  action(VISU_RENAME     )->setEnabled(true); // Rename: Key_F2
+
   return true;
 }
 
@@ -3027,7 +3118,10 @@ VisuGUI
   setToolShown( false );
 
   // Unset actions accelerator keys
-  action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey);
+  action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); // Import: CTRL + Key_I
+
+  action(VISU_DELETE_OBJS)->setEnabled(false); // Delete: Key_Delete
+  action(VISU_RENAME     )->setEnabled(false); // Rename: Key_F2
 
   SalomeApp_Module::deactivateModule( theStudy );
   return true;
@@ -3452,17 +3546,28 @@ void VisuGUI::createPreferences()
   setPreferenceProperty( sp, "hstretch", 0 );
   setPreferenceProperty( sp, "vstretch", 0 );
 
-  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" );
 
+  int point_precision = addPreference( tr( "VISU_FLOATING_POINT_PRECISION" ), representGr,
+                                      LightApp_Preferences::IntSpin, "VISU", "floating_point_precision" );
+  setPreferenceProperty( point_precision, "min", 1 );
+  setPreferenceProperty( point_precision, "max", 16 );
+  setPreferenceProperty( point_precision, "step", 1 );
+  addPreference( "", representGr, LightApp_Preferences::Space );
+
   addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" );
   sp = addPreference( "", representGr, LightApp_Preferences::Space );
   setPreferenceProperty( sp, "hstretch", 0 );
   setPreferenceProperty( sp, "vstretch", 0 );
 
   addPreference( tr( "VISU_DISP_ONLY" ), representGr, LightApp_Preferences::Bool, "VISU", "display_only" );
+  addPreference( "", representGr, LightApp_Preferences::Space );
+
+  addPreference( tr( "VISU_AUTOMATIC_FIT_ALL" ), representGr,
+                 LightApp_Preferences::Bool, "VISU", "automatic_fit_all" );
 
   // TAB: 3D Cache ; group: "Cache properties"
   int cacheTab = addPreference( tr( "3D Cache" ) );
index a4f00aaceaf13e5e448312bfe2306f8a0418d32a..f2d18169fee17b90df6b5db9d4d8f675e40035e8 100644 (file)
@@ -106,7 +106,7 @@ protected slots:
   void OnCreatePlot3D();
   void OnCreateManyMesh();
   void OnCreatePlot2dView();
-  void OnCreateScalarMapOnDeformedShape();
+  void OnCreateDeformedShapeAndScalarMap();
 
   void OnEditScalarMap();
   void OnEditDeformedShape();
@@ -116,7 +116,7 @@ protected slots:
   void OnEditVectors();
   void OnEditStreamLines();
   void OnEditPlot3D();
-  void OnEditScalarMapOnDeformedShape();
+  void OnEditDeformedShapeAndScalarMap();
 
   virtual void OnDisplayPrs();
   virtual void OnDisplayOnlyPrs();
index aab3df5411e97d7d060cfba9f9625285a4f6d101..5c1083fa61515ed7d93081d48f400e82f0add301 100644 (file)
 #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
 
 #define VISU_SHOW_TABLE             4023
-#define VISU_SHOW_TABLE_PLOT        4029
+#define VISU_EDIT_POINTMAP3D        4029
 #define VISU_CREATE_CURVES          4024
 #define VISU_EXPORT_TABLE           4025
 
@@ -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
index e99b70e5e0e5d6b739928eb5ea776ec6d782b78b..6eef1a4964d824b0bc09f0b0c7edf18f57f1af09 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "VISU_ColoredPrs3dFactory.hh"
 #include "VISU_CutPlanes_i.hh"
+#include "VISU_Result_i.hh"
 #include "VISU_CutPlanesPL.hxx"
 
 //#include "OB_Browser.h"
 #include <QGroupBox>
 #include <QPushButton>
 #include <QHeaderView>
+#include <QComboBox>
 
 #include <vtkRenderer.h>
 #include <vtkPolyData.h>
 #include <vtkAppendPolyData.h>
 #include <vtkDataSetMapper.h>
+#include <vtkDataSet.h>
 
 using namespace std;
 
@@ -166,6 +169,34 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent)
   QLabel* aPosLbl = new QLabel(tr( "LBL_POS" ), this);
   myPosSpn = new QtxDoubleSpinBox( 0, 1, 0.1, this );
 
+  GDeformation = new QGroupBox(tr("LBL_DEFORMATION"), this);
+  GDeformation->setCheckable(true);
+  GDeformation->setChecked(false);
+  QGridLayout* GDeformationLayout = new QGridLayout( GDeformation );
+  GDeformationLayout->setSpacing( 6 );
+  GDeformationLayout->setMargin( 11 );
+  connect(GDeformation, SIGNAL(toggled(bool)), this, SLOT(onDeformationCheck(bool)));
+
+  QLabel* LabelDeformation1 = new QLabel (tr("LBL_DEFROMATION_VECT"), GDeformation);
+  GDeformationLayout->addWidget( LabelDeformation1, 0, 0 );
+
+  myVectorialFieldCombo = new QComboBox (GDeformation);
+  GDeformationLayout->addWidget( myVectorialFieldCombo, 0, 1 );
+
+  QLabel* LabelDeformation2 = new QLabel (tr("LBL_DEFROMATION_SCALE"), GDeformation);
+  GDeformationLayout->addWidget( LabelDeformation2, 1, 0 );
+  myScaleSpn = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, GDeformation);
+  myScaleSpn->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+  GDeformationLayout->addWidget( myScaleSpn, 1, 1 );
+  connect(myVectorialFieldCombo,     SIGNAL(activated(int)), this, SLOT(onVectorialFieldChanged(int)));
+  connect(myScaleSpn, SIGNAL(valueChanged(double)), this, SLOT(onScaleFactorChanged(double)));
+
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
+  
+  myScaleSpn->setDecimals( aPrecision*(-1) );
+  myScaleSpn->setValue(0.1);
+
   myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), this);
   myPreviewCheck->setChecked(false);
   connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) );
@@ -178,7 +209,8 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent)
   TopLayout->setRowStretch ( 3, 3 );
   TopLayout->addWidget(aPosLbl, 4, 0 );
   TopLayout->addWidget(myPosSpn, 4, 1 );
-  TopLayout->addWidget( myPreviewCheck, 5, 0, 1, 2 );
+  TopLayout->addWidget( GDeformation, 5, 0, 1, 2 );
+  TopLayout->addWidget( myPreviewCheck, 6, 0, 1, 2 );
 
   // signals and slots connections
   connect( SelPlane, SIGNAL( buttonClicked( int )), this, SLOT( orientationChanged( int ) ) );
@@ -208,6 +240,24 @@ void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
   setRotation(thePrs->GetRotateX()*180./PI, thePrs->GetRotateY()*180./PI);
   setPlanePos(thePrs->GetOrientationType());
   myPosSpn->setValue(thePrs->GetDisplacement());
+  InitEntity2VectorialFieldsMap(thePrs);
+  InsertAllVectorialFields();
+  setScaleFactor(thePrs->GetScale());
+  if(myEntity2VectorialFields.size() < 1)
+    GDeformation->setDisabled(true);
+  else{
+    if(thePrs->IsDeformed()){
+      GDeformation->setChecked(true);
+      int idx = myVectorialFieldCombo->findText(thePrs->GetVectorialFieldName());
+      if (idx >= 0)
+       myVectorialFieldCombo->setCurrentIndex(idx);
+      else {
+       myVectorialFieldCombo->addItem(thePrs->GetVectorialFieldName());
+       myVectorialFieldCombo->setCurrentIndex(myVectorialFieldCombo->count()-1);
+      }
+    }
+  }
+    
   hasInit = true;
   // init table
   myCutPlanes = VISU::TSameAsFactory<VISU::TCUTPLANES>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
@@ -220,19 +270,76 @@ void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
   }
 }
 
+void VisuGUI_CutPlanesPane::InitEntity2VectorialFieldsMap(VISU::ColoredPrs3d_i* thePrs){
+
+  VISU::Result_var theResult = thePrs->GetResultObject();
+  VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>(GetServant(theResult).in());
+  VISU::Result::Entities_var aEntities = aResult->GetEntities(thePrs->GetMeshName());
+  VISU::Result::TimeStampNumbers_var aScalarTimeStamp = aResult->GetTimeStampNumbers(thePrs->GetMeshName(),
+                                                                                     thePrs->GetEntity(),
+                                                                                     thePrs->GetFieldName());
+  CORBA::Long aTimeStampNumber = aScalarTimeStamp->length();
+  
+  for(size_t iEntity = 0; iEntity < aEntities->length(); iEntity++){
+    VISU::Entity aEntity = aEntities[iEntity];
+    VISU::Result::EntityNames_var aFields = aResult->GetFields(thePrs->GetMeshName(),aEntity);
+    for(size_t iField = 0; iField < aFields->length(); iField++){
+
+      TVectorialFieldsList aVectorialFields;
+      VISU::Result::TimeStampNumbers_var aTimeStamps =  aResult->GetTimeStampNumbers(thePrs->GetMeshName(),aEntity,aFields[iField] );
+      
+      if((aResult->GetNumberOfComponents(thePrs->GetMeshName(),aEntity,aFields[iField] ) > 1) &&
+         (aTimeStamps->length() >= aTimeStampNumber)){
+        aVectorialFields.push_back(QString(aFields[iField].in()));
+      }
+      if(aVectorialFields.size() > 0){
+        myEntity2VectorialFields.insert(TEntVectPair(aEntity,aVectorialFields));
+      }
+    }
+  }
+}
+
+void VisuGUI_CutPlanesPane::InsertAllVectorialFields(){
+  TEntity2VectorialFields::const_iterator aFieldIter = myEntity2VectorialFields.begin();
+  for( ;aFieldIter != myEntity2VectorialFields.end();aFieldIter++ ){
+    TVectorialFieldsList aVectorialFields = aFieldIter->second;
+    for(size_t iField = 0;iField < aVectorialFields.size(); iField++)
+      myVectorialFieldCombo->addItem(aVectorialFields[iField]);
+  }
+}
+
+double VisuGUI_CutPlanesPane::getScaleFactor(){
+  return myScaleSpn->value();
+}
+
+void VisuGUI_CutPlanesPane::setScaleFactor(double theFactor){
+  double i=0.1;
+  while (1) { // Calculate Step & Precission
+    if ( int (theFactor/i) >= 0)
+      break;
+    else {
+      i = i*0.1;
+    }
+  }
+
+  myScaleSpn->setSingleStep(i);
+  myScaleSpn->setValue(theFactor);
+  
+}
+
 void VisuGUI_CutPlanesPane::createPlanes()
 {
   if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
   if (!myCutPlanes) return;
   if (myPreviewActor != 0) return;
 
-  vtkAppendPolyData* aPolyData = myCutPlanes->GetSpecificPL()->GetAppendPolyData();
-  if (!aPolyData->GetOutput()->GetNumberOfCells()) {
+  vtkDataSet* aDataSet = myCutPlanes->GetSpecificPL()->GetWarpVectorOutput();
+  if (!aDataSet->GetNumberOfCells()) {
     onPreviewCheck(false);
     return;
   }
   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
-  aPlaneMapper->SetInput(aPolyData->GetOutput());
+  aPlaneMapper->SetInput(aDataSet);
   aPlaneMapper->ScalarVisibilityOff();
 
   myPreviewActor = SALOME_Actor::New();
@@ -256,6 +363,31 @@ int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
     else
       thePrs->SetDefault(i);
   }
+
+  thePrs->UseDeformation(GDeformation->isChecked());
+  
+  if(GDeformation->isChecked()){
+    TEntity2VectorialFields::const_iterator anIter = myEntity2VectorialFields.begin();
+    VISU::Entity anEntity;
+    QString aFieldName;
+    bool isInited = false;
+    for(;anIter != myEntity2VectorialFields.end();anIter++){
+      TVectorialFieldsList aFields = anIter->second;
+      for(int it = 0;it < aFields.size();it++)
+        if(!QString::compare(aFields[it], myVectorialFieldCombo->currentText ())){
+          anEntity = anIter->first;
+          aFieldName = aFields[it];
+          isInited = true;
+          break;
+        }
+      if(isInited)
+        break;
+    }
+    if(isInited)
+      thePrs->SetVectorialField(anEntity,aFieldName.toLatin1().constData());
+    
+    thePrs->SetScale(myScaleSpn->value());
+  }
   return 1;
 }
 
@@ -324,6 +456,45 @@ void VisuGUI_CutPlanesPane::setRotation (const double r1, const double r2)
   Rot2->setValue( r2 );
 }
 
+void VisuGUI_CutPlanesPane::onScaleFactorChanged(double theFactor){
+  DrawTable();
+}
+
+void VisuGUI_CutPlanesPane::onVectorialFieldChanged(int pos){
+  InitVectorialField();
+  DrawTable();
+}
+
+void VisuGUI_CutPlanesPane::onDeformationCheck(bool Flag){
+  if(!myCutPlanes || !hasInit) return;
+  myCutPlanes->UseDeformation(Flag);
+  InitVectorialField();
+  DrawTable();
+}
+
+void VisuGUI_CutPlanesPane::InitVectorialField(){
+  if(myCutPlanes->IsDeformed()){
+    TEntity2VectorialFields::const_iterator anIter = myEntity2VectorialFields.begin();
+    VISU::Entity anEntity;
+    QString aFieldName;
+    bool isInited = false;
+    for(;anIter != myEntity2VectorialFields.end();anIter++){
+      TVectorialFieldsList aFields = anIter->second;
+      for(int it = 0;it < aFields.size();it++)
+        if(!QString::compare(aFields[it], myVectorialFieldCombo->currentText ())){
+          anEntity = anIter->first;
+          aFieldName = aFields[it];
+          isInited = true;
+          break;
+        }
+      if(isInited)
+        break;
+    }
+    if(isInited)
+      myCutPlanes->SetVectorialField(anEntity,aFieldName.toLatin1().constData());
+  }
+}
+
 /*!
   Draw the table of planes positions
 */
@@ -338,6 +509,7 @@ void VisuGUI_CutPlanesPane::DrawTable()
   myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
   myCutPlanes->SetNbPlanes(aNbPlanes);
   myCutPlanes->SetDisplacement(myPosSpn->value());
+  myCutPlanes->SetScale(getScaleFactor());
   if (aNbRows>0)
     for (int i = 0; i < aNbRows; ++i) {
       QTableWidgetItem* aItem = myPosTable->item( i, 1 );
@@ -571,7 +743,9 @@ void VisuGUI_CutPlanesPane::onPreviewCheck (bool thePreview)
       storeToPrsObject(myCutPlanes);
       myCutPlanes->GetPipeLine()->Update();
       createPlanes();
-      vf->onFitAll();
+      if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) {
+       vf->onFitAll();
+      }
     } else {
       deletePlanes();
       vf->Repaint();
index 064a457da039f5f7857a4e38df9f15ca3f98d3f9..a3b0b7e584a0bd06e062e8b433bdef262e836b9f 100644 (file)
@@ -42,15 +42,18 @@ class QRadioButton;
 class QTabWidget;
 class QTableWidget;
 class QCheckBox;
-
-
+class QComboBox;
 
 #include "SALOMEconfig.h"
 #include CORBA_CLIENT_HEADER(VISU_Gen)
 
+#include <map>
+#include <vector>
+
 namespace VISU 
 {
   class CutPlanes_i;
+  class Result_i;
 };
 
 class SUIT_ViewWindow;
@@ -74,15 +77,28 @@ public:
     double getRotation1() {return Rot1->value();}
     double getRotation2() {return Rot2->value();}
 
-    void initFromPrsObject(VISU::CutPlanes_i* thePrs);
-    int storeToPrsObject(VISU::CutPlanes_i* thePrs);
+    double getScaleFactor();
+    void   setScaleFactor(double factor);
+
+    void   initFromPrsObject(VISU::CutPlanes_i* thePrs);
+    int    storeToPrsObject(VISU::CutPlanes_i* thePrs);
 
 private:
+    typedef std::vector<QString> TVectorialFieldsList;
+    typedef std::map<VISU::Entity, TVectorialFieldsList> TEntity2VectorialFields;
+    typedef std::pair<VISU::Entity,TVectorialFieldsList> TEntVectPair;
+    TEntity2VectorialFields myEntity2VectorialFields;
+
     void createPlanes();
     void deletePlanes();
 
+    void InitEntity2VectorialFieldsMap(VISU::ColoredPrs3d_i* thePrs);
+    void InsertAllVectorialFields();
+    void InitVectorialField();
+
     QLabel* LabelRot1;
     QLabel* LabelRot2;
+    QGroupBox* GDeformation;
     QSpinBox* nbPlan;
     QtxDoubleSpinBox* Rot1;
     QtxDoubleSpinBox* Rot2;
@@ -93,6 +109,8 @@ private:
     QTableWidget* myPosTable;
     SALOME::GenericObjPtr<VISU::CutPlanes_i> myCutPlanes;
     QCheckBox* myPreviewCheck;
+    QComboBox* myVectorialFieldCombo;
+    QtxDoubleSpinBox* myScaleSpn;
     double          X1, X2;
     double          Y1, Y2;
     double          Z1, Z2;
@@ -107,6 +125,9 @@ private slots:
     void onValueChanged(int theRow, int theCol);
     void onRotation(double theValue);
     void onPreviewCheck(bool thePreview);
+    void onScaleFactorChanged(double);
+    void onDeformationCheck(bool);
+    void onVectorialFieldChanged(int);
 };
 
 
diff --git a/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx
new file mode 100644 (file)
index 0000000..67c3871
--- /dev/null
@@ -0,0 +1,495 @@
+//  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 <QtxDoubleSpinBox.h>
+#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 <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QTabWidget>
+#include <QComboBox>
+#include <QPushButton>
+#include <QLabel>
+
+#define MYDEBUG 0
+
+/*!
+ * Constructor
+ */
+VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule)
+  : VisuGUI_ScalarBarBaseDlg(theModule),
+    myIsAnimation(false),
+    myUpdateScalars(true),
+    myVisuGUI(theModule)
+{
+  setWindowTitle(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
+  QWidget* aBox = new QWidget (this);
+  QVBoxLayout* aVBLay = new QVBoxLayout( aBox );
+  aVBLay->setMargin(11);
+  QFrame* TopGroup = new QFrame (aBox);
+  aVBLay->addWidget(TopGroup);
+  TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken);
+  TopGroup->setLineWidth(1);
+  QGridLayout* TopGroupLayout = new QGridLayout (TopGroup);
+  TopGroupLayout->setSpacing(6);
+  TopGroupLayout->setMargin(11);
+
+  //   Scale factor
+  QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup);
+  TopGroupLayout->addWidget(ScaleLabel, 0, 0);
+
+  ScalFact = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
+  ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
+
+  ScalFact->setDecimals( aPrecision*(-1) );
+  ScalFact->setValue(0.1);
+  TopGroupLayout->addWidget(ScalFact, 0, 1);
+
+  // Fields combo box
+  QLabel* FieldLabel = new QLabel (tr("FIELD_ITEM"), TopGroup);
+  myFieldsCombo = new QComboBox (TopGroup);
+
+  TopGroupLayout->addWidget(FieldLabel, 1, 0);
+  TopGroupLayout->addWidget(myFieldsCombo,1,1);
+
+  // TimeStamps combo box
+  QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup);
+  myTimeStampsCombo = new QComboBox (TopGroup);
+
+  TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
+  TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
+  TopGroupLayout->setRowStretch(3,5);
+
+  //
+  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);
+  QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+  GroupButtonsLayout->setSpacing(6);
+  GroupButtonsLayout->setMargin(11);
+
+  QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons);
+  buttonOk->setAutoDefault(true);
+  buttonOk->setDefault(true);
+  QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons);
+  buttonCancel->setAutoDefault(true);
+  QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons);
+  buttonHelp->setAutoDefault(true);
+
+  GroupButtonsLayout->addWidget(buttonOk);
+  GroupButtonsLayout->addSpacing(10);
+  GroupButtonsLayout->addStretch();
+  GroupButtonsLayout->addWidget(buttonCancel);
+  GroupButtonsLayout->addWidget(buttonHelp);
+
+  // 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.toLatin1().constData(),
+                                      aTimeIter.toInt());
+         }
+        }
+      }
+    }
+    AddAllFieldNames();
+  }
+  int idx = myFieldsCombo->findText(aFieldName.in());
+  if (idx >= 0)
+    myFieldsCombo->setCurrentIndex(idx);
+  else {
+    myFieldsCombo->addItem(aFieldName.in());
+    myFieldsCombo->setCurrentIndex(myFieldsCombo->count()-1);
+  }
+  AddAllTimes(myFieldsCombo->currentText());
+  idx = myTimeStampsCombo->findText(aIteration);
+  if (idx >= 0)
+    myTimeStampsCombo->setCurrentIndex(idx);
+  else {
+    myTimeStampsCombo->addItem(aIteration);
+    myTimeStampsCombo->setCurrentIndex(myTimeStampsCombo->count()-1);
+  }
+  SetScalarField( false );
+
+  VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
+  if( !theInit )
+    return;
+
+  myInputPane->initFromPrsObject( myPrsCopy );
+  myTabBox->setCurrentIndex( 0 );
+}
+
+double VisuGUI_DeformedShapeAndScalarMapDlg::getFactor() const
+{
+  return ScalFact->value();
+}
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::setFactor(double theFactor)
+{
+  double i=0.1;
+  while (1) { // Calculate Step & Precission
+    if ( int (theFactor/i) > 0)
+      break;
+    else {
+      i = i*0.1;
+    }
+  }
+
+  ScalFact->setSingleStep(i);
+
+  ScalFact->setValue(theFactor);
+}
+
+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().toLatin1().constData(),
+                           myTimeStampID[ myTimeStampsCombo->currentIndex() ]);
+
+  if(myUpdateScalars) 
+    SetScalarField( false );
+
+  VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Copy(myPrsCopy, thePrs);
+
+  return anIsOk;
+}
+
+int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldNamePos(){
+  return myFieldsCombo->currentIndex();
+}
+
+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->currentIndex() ], "", 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.toLatin1().constData(),
+                           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->addItem(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->addItem(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..9daf4a5
--- /dev/null
@@ -0,0 +1,116 @@
+//  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 <QDialog>
+
+#include <set>
+#include <vector>
+
+class SalomeApp_Module;
+class VisuGUI_InputPane;
+class QtxDoubleSpinBox;
+class QComboBox;
+class QTabWidget;
+
+namespace VISU
+{
+  class DeformedShapeAndScalarMap_i;
+}
+
+class VisuGUI_DeformedShapeAndScalarMapDlg : public VisuGUI_ScalarBarBaseDlg
+{
+    Q_OBJECT
+
+public:
+    VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule);
+    ~VisuGUI_DeformedShapeAndScalarMapDlg();
+
+    double getFactor() const;
+    void setFactor(double 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:
+ QtxDoubleSpinBox* 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 e9b26850170bf61dd0a6ff18e319a8c0b3f07185..6e677fc8c7692339f9a9f385a7beebb3d886f207 100644 (file)
@@ -91,7 +91,11 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule)
 
   ScalFact = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
   ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  ScalFact->setDecimals(38);
+
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
+
+  ScalFact->setDecimals( aPrecision*(-1) ); // ScalFact->setDecimals(38);
   ScalFact->setValue(0.1);
   TopGroupLayout->addWidget(ScalFact, 0, 1);
 
@@ -119,7 +123,7 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule)
   GroupButtonsLayout->setSpacing(6);
   GroupButtonsLayout->setMargin(11);
 
-  QPushButton* buttonOk = new QPushButton (tr("BUT_OK"), GroupButtons);
+  QPushButton* buttonOk = new QPushButton (tr("A&pply and Close"), GroupButtons);
   buttonOk->setAutoDefault(TRUE);
   buttonOk->setDefault(TRUE);
   GroupButtonsLayout->addWidget(buttonOk, 0, 0);
@@ -169,6 +173,22 @@ void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::ColoredPrs3d_i* thePrs,
   myTabBox->setCurrentIndex(0);
 }
 
+void VisuGUI_DeformedShapeDlg::setFactor(double theFactor)
+{
+  double i=0.1;
+  while (1) { // Calculate Step & Precission
+    if ( int (theFactor/i) > 0)
+      break;
+    else {
+      i = i*0.1;
+    }
+  }
+
+  ScalFact->setSingleStep(i);
+
+  ScalFact->setValue(theFactor);
+}
+
 int VisuGUI_DeformedShapeDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs) 
 {
   if( !isValid() )
@@ -191,7 +211,8 @@ void VisuGUI_DeformedShapeDlg::updatePrsCopy()
   VisuGUI* aVisuGUI = dynamic_cast <VisuGUI*>(myModule);
   if ( myPrsCopy->GetNumberOfActors() == 0 ) {
     PublishInView(aVisuGUI, myPrsCopy, aViewWindow);
-    aViewWindow->onFitAll();    
+    if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
+      aViewWindow->onFitAll();
     int aPos = VISU::GetFreePositionOfDefaultScalarBar(aVisuGUI, aViewWindow);
     VISU::AddScalarBarPosition(aVisuGUI, aViewWindow, myPrsCopy, aPos);
     } else {
@@ -270,26 +291,29 @@ void VisuGUI_DeformedShapeDlg::CreatePrs3d(VisuGUI* theModule)
                                                   aFieldName.toLatin1().data(),
                                                   aTimeStampId.toInt(),
                                                   aPublishInStudyMode);
-         
-         VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule);
-         aDlg->initFromPrsObject(aPrs3d, true);
-         aDlg->UseMagn->setChecked(true);
-         VisuGUI_DialogRunner r(aDlg);
-         int dlgResult = r.run( false );
-
-         if ( dlgResult == 0 )
-           aPrs3d->RemoveFromStudy();
-         else {
-           aDlg->storeToPrsObject( aPrs3d );
-           SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
-           PublishInView(theModule, aPrs3d, aViewWindow);
-           aViewWindow->onFitAll();
-           int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
-           VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+
+         if (aPrs3d) {
+           VisuGUI_DeformedShapeDlg* aDlg = new VisuGUI_DeformedShapeDlg (theModule);
+           aDlg->initFromPrsObject(aPrs3d, true);
+           aDlg->UseMagn->setChecked(true);
+           VisuGUI_DialogRunner r(aDlg);
+           int dlgResult = r.run( false );
+           
+           if ( dlgResult == 0 )
+             DeletePrs3d(theModule,aPrs3d);
+           else {
+             aDlg->storeToPrsObject( aPrs3d );
+             SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
+             PublishInView(theModule, aPrs3d, aViewWindow);
+             if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
+               aViewWindow->onFitAll();
+             int aPos = VISU::GetFreePositionOfDefaultScalarBar(theModule, aViewWindow);
+             VISU::AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
+           }
+           
+           VISU::UpdateObjBrowser(theModule, true, aTimeStamp);
+           delete aDlg;
          }
-         
-         VISU::UpdateObjBrowser(theModule, true, aTimeStamp);
-         delete aDlg;
        }
     }
 }
index 099fc006f355547e55f48e4f705032b781059499..1449af505b771ccc08ce27a9f7dc6711cf8864ad 100644 (file)
@@ -60,8 +60,7 @@ public:
 
     double getFactor()
       { return ScalFact->value(); }
-    void setFactor(double theFactor)
-      { ScalFact->setValue(theFactor); }
+    void setFactor(double theFactor);
 
     bool isColored()
       { return UseMagn->isChecked(); }
index 7b8daf943a61fa3099bbf30c37c365615c685a2c..62e7f6c7abffde3fcf1ae5806c594349336a2400 100644 (file)
@@ -94,11 +94,19 @@ SALOME_Prs* VisuGUI_Displayer::buildPresentation( const QString& theEntry, SALOM
            aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aColoredPrs3d).in());
          }else if (aType == VISU::TPOINTMAP3D) {
            VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBaseServant);
-           VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor();
-           if (aPointMap3dActor) {
-             aViewWindow->AddActor(aPointMap3dActor);
+           VISU_ActorBase* anActorBase = VISU::FindActorBase(aViewWindow, aTable3d);
+           if (anActorBase) {
+             anActorBase->SetVisibility(true);
              aViewWindow->Repaint();
            }
+           else {
+             VISU_PointMap3dActor* aPointMap3dActor = aTable3d->CreateActor();
+             if (aPointMap3dActor) {
+               aViewWindow->AddActor(aPointMap3dActor);
+               aPointMap3dActor->SetVisibility(true);
+               aViewWindow->Repaint();
+             }
+           }
          }
          else
            aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aBaseServant);
@@ -283,6 +291,9 @@ bool VisuGUI_Displayer::canBeDisplayed( const QString& entry, const QString& vie
     if(aBase->GetType() == VISU::TCOLOREDPRS3DHOLDER)
       return true;
 
+    if(aBase->GetType() == VISU::TPOINTMAP3D)
+      return dynamic_cast<VISU::PointMap3d_i*>(aBase);
+
     return dynamic_cast<VISU::Prs3d_i*>(aBase);
   }
   else if( viewer_type==SPlot2d_Viewer::Type() )
index c8fa4f7e75e49df7fd3d6352af4111bf04c8d80c..14826a2fb927c6a091ad428dc713985a897298f0 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "LightApp_Application.h"
 #include "SalomeApp_Module.h"
+#include "LightApp_SelectionMgr.h"
 #include "SUIT_Desktop.h"
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Session.h"
@@ -551,7 +552,7 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs,
   myTextDlg->setTitleText(QString(thePrs->GetTitle()));
 
   vtkFloatingPointType R, G, B;
-  thePrs->GetTitleColor(&R, &G, &B);
+  thePrs->GetTitleColor(R, G, B);
 
   myBarDlg->setLabelsFormat(thePrs->GetLabelsFormat());
   myBarDlg->setUnitsVisible(thePrs->IsUnitsVisible());
@@ -563,7 +564,7 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs,
                                   thePrs->IsShadowTitle());
 
   // "Labels"
-  thePrs->GetLabelColor(&R, &G, &B);
+  thePrs->GetLabelColor(R, G, B);
 
   myTextDlg->myLabelFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
                                   thePrs->GetLblFontType(),
@@ -772,6 +773,7 @@ void VisuGUI_GaussScalarBarPane::onBarPref()
  * Constructor
  */
 VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule):
+  myModule(theModule),
   VisuGUI_Prs3dDlg(theModule)
 {
   //setName("VisuGUI_GaussPointsDlg");
@@ -844,6 +846,7 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule):
 
   // Input pane
   myInputPane = new VisuGUI_InputPane(VISU::TGAUSSPOINTS, theModule, this);
+  myInputPane->SetRestoreInitialSelection(false);
 
   connect( myResultsButton,  SIGNAL( clicked() ),       mySizeBox,    SLOT( onToggleResults() ) );
   connect( myResultsButton,  SIGNAL( toggled( bool ) ), myScalarPane, SLOT( setEnabled( bool ) ) );
@@ -979,8 +982,22 @@ int VisuGUI_GaussPointsDlg::storeToPrsObject( VISU::ColoredPrs3d_i* thePrs )
   myPrsCopy->SetMagnification( mySizeBox->getMagnification() );
   myPrsCopy->SetMagnificationIncrement( mySizeBox->getIncrement() );
 
-  VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Copy(myPrsCopy, thePrs);
-
+  VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Copy(myPrsCopy, thePrs); 
+  
+  //Set created Gauss points presentation selected,
+  //Issue 0019874(EDF 746 VISU: Picking alphanumeric Gauss)
+  if(thePrs){
+    SALOME_ListIO aListIO;
+    LightApp_SelectionMgr* aSelectionMgr = VISU::GetSelectionMgr(myModule);
+    Handle(SALOME_InteractiveObject) anIO = thePrs->GetIO();
+    if(anIO && anIO->hasEntry()) {
+      aListIO.Append(anIO);
+      VISU::UpdateObjBrowser(myModule,true);
+      aSelectionMgr->setSelectedObjects(aListIO);
+    }
+    else
+      myInputPane->SetRestoreInitialSelection(true);
+  }
   return anIsOk;
 }
 
index 756e2decfc86a573f8e444bc3c1e3b61a3c50503..e23b9a1ee21b5d098a99b6682370753aeb31c5c4 100644 (file)
@@ -165,6 +165,7 @@ private:
   QtxDoubleSpinBox*           myScaleSpinBox;
 
   SALOME::GenericObjPtr<VISU::GaussPoints_i> myPrsCopy;
+  SalomeApp_Module*        myModule;
 };
 
 #endif // VISUGUI_GAUSSPOINTSDLS_H
index d1aafe528e84a63f1ca92cbd4d3eb7c1557a5c82..21bab6731e848ecd7585dc2e58972ff6a9927dad 100644 (file)
@@ -82,7 +82,8 @@ VisuGUI_InputPane::VisuGUI_InputPane( VISU::VISUType theType,
   QGroupBox( theDialog ),
   myModule( theModule ),
   myDialog( theDialog ),
-  myPrs( NULL )
+  myPrs( NULL ),
+  isRestoreInitialSelection(true)
 {
   //setFrameStyle( QFrame::NoFrame );
 
@@ -243,9 +244,17 @@ VisuGUI_InputPane::~VisuGUI_InputPane()
   }
 
   // Restore initial selection
-  aSelectionMgr->setSelectedObjects(mySavedSelection);
+  if(isRestoreInitialSelection)
+    aSelectionMgr->setSelectedObjects(mySavedSelection);
 }
 
+void VisuGUI_InputPane::SetRestoreInitialSelection(bool on){
+  isRestoreInitialSelection = on;
+}
+
+bool VisuGUI_InputPane::GetRestoreInitialSelection(){
+  return isRestoreInitialSelection;
+}
 
 //---------------------------------------------------------------
 /*!
index 9190dde83efc0bd80011233eaac792c7ba8ee239..408d257b2e16bf31e1cb71667c164578c0801b4f 100644 (file)
@@ -71,6 +71,8 @@ public:
   int                storeToPrsObject( VISU::ColoredPrs3d_i* );
 
   bool               eventFilter (QObject* object, QEvent* event);
+  void               SetRestoreInitialSelection(bool on);
+  bool               GetRestoreInitialSelection();
 
 public slots:
   virtual void       onSelectionChanged();
@@ -104,6 +106,7 @@ private:
 
   VISU::Result_var   myResult;
   int                myEntity;
+  bool               isRestoreInitialSelection;
 
   VisuGUI_FieldFilter* myFieldFilter;
   SALOME_ListIO        mySavedSelection;
index f0ebd54469870a3eac6c06af7da01a7c477d8706..fe3d30ba3f4932b84aaf069b93446a554575cb56 100644 (file)
 #include <QLineEdit>
 #include <QTabWidget>
 #include <QKeyEvent>
-
-
+#include <QColorDialog>
 
 using namespace std;
 
-
 VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent,
                                          VisuGUI_ScalarBarPane* theScalarPane)
   : QWidget(parent),
@@ -105,8 +103,32 @@ VisuGUI_IsoSurfPane::VisuGUI_IsoSurfPane (QWidget* parent,
   LabelMax->setBuddy(MaxIso);
   TopGroupLayout->addWidget( MaxIso, 2, 1 );
 
+  myUseMagnitude = new QCheckBox(tr("MAGNITUDE_COLORING_CHK"), TopGroup);
+  myUseMagnitude->setChecked(true);
+  TopGroupLayout->addWidget( myUseMagnitude, 3, 0 );
+  mySelColor = new QPushButton(tr("SEL_COLOR_BTN"), TopGroup);
+  QPalette pal = mySelColor->palette();
+  pal.setColor(mySelColor->backgroundRole(), Qt::black);
+  pal.setColor(mySelColor->foregroundRole(), Qt::gray);
+  mySelColor->setPalette(pal);
+  mySelColor->setDisabled(true);
+  TopGroupLayout->addWidget( mySelColor, 3, 1 );
+  connect( mySelColor, SIGNAL( clicked() ), this, SLOT( setColor() ) );
+  connect( myUseMagnitude, SIGNAL( toggled(bool) ), mySelColor, SLOT( setDisabled(bool) ) );
+
+  myUseLabels = new QCheckBox(tr("SHOW_VALUES_CHK"), TopGroup);
+  myUseLabels->setChecked(false);
+  TopGroupLayout->addWidget( myUseLabels, 4, 0 );
+  myNbLabels = new QSpinBox( TopGroup );
+  myNbLabels->setMinimum(1);
+  myNbLabels->setMaximum(100);
+  myNbLabels->setSingleStep(1);
+  myNbLabels->setEnabled(false);
+  TopGroupLayout->addWidget( myNbLabels, 4, 1 );
+  connect( myUseLabels, SIGNAL( toggled(bool) ), myNbLabels, SLOT( setEnabled(bool) ) );
+
   QPushButton* aUpdateBtn = new QPushButton( "Update scalar bar range with these values", TopGroup);
-  TopGroupLayout->addWidget( aUpdateBtn, 3, 0, 1, 2);
+  TopGroupLayout->addWidget( aUpdateBtn, 5, 0, 1, 2);
   connect( aUpdateBtn, SIGNAL( clicked() ), this, SLOT(onCBUpdate() ) );
 }
 
@@ -115,12 +137,29 @@ void VisuGUI_IsoSurfPane::initFromPrsObject (VISU::IsoSurfaces_i* thePrs)
   NbrIso->setValue(thePrs->GetNbSurfaces());
   MinIso->setText(QString::number(thePrs->GetSubMin()));
   MaxIso->setText(QString::number(thePrs->GetSubMax()));
+  myUseMagnitude->setChecked(thePrs->IsColored());
+  SALOMEDS::Color anOldColor = thePrs->GetColor();
+  QColor aColor = QColor(int(255*anOldColor.R),int(255*anOldColor.G),int(255*anOldColor.B));
+  setColor(aColor);
+
+  myUseLabels->setChecked(thePrs->IsLabeled());
+  myNbLabels->setValue(thePrs->GetNbLabels());
 }
 
 int VisuGUI_IsoSurfPane::storeToPrsObject (VISU::IsoSurfaces_i* thePrs)
 {
   thePrs->SetNbSurfaces(NbrIso->value());
   thePrs->SetSubRange(MinIso->text().toDouble(), MaxIso->text().toDouble());
+  thePrs->ShowLabels(myUseLabels->isChecked(), myNbLabels->value());
+  thePrs->ShowColored(myUseMagnitude->isChecked());
+  if(!thePrs->IsColored()){
+    QColor aQColor = color();
+    SALOMEDS::Color aColor;
+    aColor.R = aQColor.red()/255.;
+    aColor.G = aQColor.green()/255.;
+    aColor.B = aQColor.blue()/255.;
+    thePrs->SetColor(aColor);
+  }
   return 1;
 }
 
@@ -141,8 +180,24 @@ bool VisuGUI_IsoSurfPane::check()
   return true;
 }
 
+void VisuGUI_IsoSurfPane::setColor()
+{
+  QColor cnew = QColorDialog::getColor( color(), this );
+  if ( cnew.isValid() )
+    setColor(cnew);
+}
 
+void VisuGUI_IsoSurfPane::setColor(const QColor& theColor)
+{
+  QPalette pal = mySelColor->palette();
+  pal.setColor(mySelColor->backgroundRole(), theColor);
+  mySelColor->setPalette(pal);
+}
 
+QColor VisuGUI_IsoSurfPane::color() const
+{
+  return mySelColor->palette().color(mySelColor->backgroundRole());
+}
 
 
 /*!
index 94dc47e3a0c2aa20d5117ea7838ae753a3dbc752..4410e819c96c34dbcd31dbf02df77ce27b6849be 100644 (file)
@@ -47,7 +47,7 @@ class VisuGUI_IsoSurfPane : public QWidget
 {
   Q_OBJECT;
 
- public:
+public:
   VisuGUI_IsoSurfPane (QWidget* parent,
                       VisuGUI_ScalarBarPane* theScalarPane);
   ~VisuGUI_IsoSurfPane() {};
@@ -57,13 +57,21 @@ class VisuGUI_IsoSurfPane : public QWidget
 
   bool check();
 
- protected slots:
-  void onCBUpdate();
+  void setColor(const QColor& theColor);
+  QColor color() const;
 
- private:
-  QLineEdit* MinIso;
-  QLineEdit* MaxIso;
-  QSpinBox*  NbrIso;
+protected slots:
+  void onCBUpdate();
+  void setColor();
+
+private:
+  QLineEdit*      MinIso;
+  QLineEdit*      MaxIso;
+  QSpinBox*       NbrIso;
+  QCheckBox*      myUseMagnitude;
+  QPushButton*    mySelColor;
+  QCheckBox*      myUseLabels;
+  QSpinBox*       myNbLabels;
   VisuGUI_ScalarBarPane* myScalarPane;
 };
 
@@ -72,7 +80,7 @@ class VisuGUI_IsoSurfacesDlg : public VisuGUI_ScalarBarBaseDlg
 {
   Q_OBJECT;
 
- public:
+public:
   VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule);
   ~VisuGUI_IsoSurfacesDlg();
 
@@ -81,13 +89,13 @@ class VisuGUI_IsoSurfacesDlg : public VisuGUI_ScalarBarBaseDlg
 
   virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
 
- protected:
+protected:
   virtual QString  GetContextHelpFilePath();
 
  protected slots:
   void accept();
 
- private:
+private:
   QTabWidget*            myTabBox;
   VisuGUI_IsoSurfPane*   myIsoPane;
   VisuGUI_InputPane*     myInputPane;
index 04928275f7a7aae033cc3318a8f947cf42261104..b40b30d1fd6bb6f9f1077b47fdff2c6e76ab1984 100644 (file)
@@ -27,6 +27,8 @@
 #include "VISU_Actor.h"
 
 #include "LightApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "SALOME_ListIteratorOfListIO.hxx"
 #include "SalomeApp_Application.h"
 #include "SVTK_ViewWindow.h"
 #include "SVTK_ViewModel.h"
 
 VisuGUI_OffsetDlg::VisuGUI_OffsetDlg (VisuGUI* theModule)
 : QDialog(VISU::GetDesktop(theModule), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
-  myModule(theModule)
+  myModule(theModule),
+  mySelectionMgr(VISU::GetSelectionMgr(theModule))
 {
   //myPrsList.setAutoDelete(false);
+  //myPointMapList.setAutoDelete(false);
 
   setWindowTitle(tr("TIT_OFFSETDLG"));
   setSizeGripEnabled(TRUE);
@@ -132,6 +136,50 @@ VisuGUI_OffsetDlg::VisuGUI_OffsetDlg (VisuGUI* theModule)
   connect(buttonApply,  SIGNAL(clicked()), this, SLOT(onApply()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
+  connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
+  
+  onSelectionChanged();
+  show();
+}
+
+void VisuGUI_OffsetDlg::setVisible(bool show){
+  if ( show  && getPrsCount() > 0 )
+    QDialog::setVisible( show );
+  else
+    QDialog::setVisible( show );
+}
+
+void VisuGUI_OffsetDlg::onSelectionChanged(){
+  if(!mySelectionMgr)
+    return;
+  
+  //Clear old selection
+  clearPresentations();
+
+  SALOME_ListIO aListIO;
+  mySelectionMgr->selectedObjects(aListIO);
+
+  SalomeApp_Study* aStudy = VISU::GetAppStudy(myModule);
+  SALOME_ListIteratorOfListIO anIter(aListIO);
+  for (; anIter.More(); anIter.Next()) {
+    Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+    if (anIO->hasEntry()) {
+      QString anEntry(anIO->getEntry());
+      VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anEntry.toLatin1().constData());
+      if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase))
+       addPresentation(aPrsObject);
+      else if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase)) {
+       addPointMapPresentation(aPrs);
+      }
+    }
+  }
+}
+
+void VisuGUI_OffsetDlg::clearPresentations(){
+  myPrsList.clear();
+  myPointMapList.clear();
+  myOldOffsets.clear();
+  myOldPointMapOffsets.clear();
 }
 
 void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs)
@@ -149,6 +197,22 @@ void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs)
   }
 }
 
+void VisuGUI_OffsetDlg::addPointMapPresentation (VISU::PointMap3d_i* thePrs)
+{
+  myPointMapList.append(thePrs);
+
+  CORBA::Float anOffset[3];
+  thePrs->GetOffset(anOffset[0],anOffset[1],anOffset[2]);
+  OffsetStruct anOffs(anOffset[0],anOffset[1],anOffset[2]);
+  myOldPointMapOffsets.append(anOffs);
+  if (myPointMapList.count() == 1) {
+    setOffset(anOffs.myOffset);
+  } else if (myPointMapList.count() == 2) {
+    OffsetStruct anOffs;
+    setOffset(anOffs.myOffset);
+  }
+}
+
 void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset)
 {
   myDxEdt->setValue(theOffset[0]);
@@ -183,8 +247,11 @@ void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointTyp
   if (myPrsList.count() == 0) 
     return;
 
-  if (isToSave())
+  if (isToSave()) {
     thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]);
+    thePrs->UpdateActors();
+    return;
+  }
 
   ViewManagerList aViewManagerList;
   SalomeApp_Application* anApp = myModule->getApp();
@@ -195,8 +262,38 @@ void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointTyp
     for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
       if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
         if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
-         vw->onAdjustTrihedron();
           if (VISU_Actor* anActor = VISU::FindActor(vw, thePrs)) {
+               anActor->SetPosition(theOffset);
+            vw->onAdjustTrihedron();
+            vw->getRenderer()->ResetCameraClippingRange();
+            vw->Repaint();
+          }
+        }
+      }
+    }
+  }
+}
+
+void VisuGUI_OffsetDlg::updatePointMapOffset (VISU::PointMap3d_i* thePrs, vtkFloatingPointType* theOffset)
+{
+  if (myPointMapList.count() == 0) 
+    return;
+
+  if (isToSave())
+    thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]);
+
+  ViewManagerList aViewManagerList;
+  SalomeApp_Application* anApp = myModule->getApp();
+  anApp->viewManagers(aViewManagerList);
+  SUIT_ViewManager* aViewManager;
+  foreach( aViewManager, aViewManagerList ) {
+    QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+    for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
+      if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
+        if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
+         vw->onAdjustTrihedron();
+
+          if (VISU_ActorBase* anActor = VISU::FindActorBase(vw, thePrs)) {
             anActor->SetPosition(theOffset);
            vw->highlight(thePrs->GetIO(), 1);
             vw->getRenderer()->ResetCameraClippingRange();
@@ -215,6 +312,9 @@ void VisuGUI_OffsetDlg::accept()
   for (int i = 0; i < myPrsList.count(); i++) {
     updateOffset(myPrsList.at(i), anOffset);
   }
+  for (int i = 0; i < myPointMapList.count(); i++) {
+    updatePointMapOffset(myPointMapList.at(i), anOffset);
+  }
   QDialog::accept();
 }
 
@@ -223,6 +323,9 @@ void VisuGUI_OffsetDlg::reject()
   for (int i = 0; i < myPrsList.count(); i++) {
     updateOffset(myPrsList.at(i), myOldOffsets[i].myOffset);
   }
+  for (int i = 0; i < myPointMapList.count(); i++) {
+    updatePointMapOffset(myPointMapList.at(i), myOldOffsets[i].myOffset);
+  }
   QDialog::reject();
 }
 
@@ -230,9 +333,13 @@ void VisuGUI_OffsetDlg::onApply()
 {
   vtkFloatingPointType anOffset[3];
   getOffset(anOffset);
+
   for (int i = 0; i < myPrsList.count(); i++) {
     updateOffset(myPrsList.at(i), anOffset);
   }
+  for (int i = 0; i < myPointMapList.count(); i++) {
+    updatePointMapOffset(myPointMapList.at(i), anOffset);
+  }
 }
 
 void VisuGUI_OffsetDlg::onHelp()
index 217c83994d71ca32ad98b345d34214cff6058c70..f8dc7eecb36f5704a5d7be2a77e5ba2f022bfcba 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "VTKViewer.h"
 #include "VISU_Prs3d_i.hh"
+#include "VISU_PointMap3d_i.hh"
 
 // QT Includes
 #include <QDialog>
@@ -31,6 +32,7 @@
 class QCheckBox;
 class QtxDoubleSpinBox;
 class VisuGUI;
+class LightApp_SelectionMgr;
 
 struct OffsetStruct
 {
@@ -58,8 +60,12 @@ class VisuGUI_OffsetDlg: public QDialog
   VisuGUI_OffsetDlg (VisuGUI* theModule);
   ~VisuGUI_OffsetDlg() {};
 
+  virtual void setVisible(bool);
+
   void addPresentation (VISU::Prs3d_i* thePrs);
-  int getPrsCount() const { return myPrsList.count(); }
+  void addPointMapPresentation (VISU::PointMap3d_i* thePrs);
+  int  getPrsCount() const { return myPrsList.count() + myPointMapList.count(); }
+  void clearPresentations();
 
   void setOffset (const vtkFloatingPointType* theOffset);
   void getOffset (vtkFloatingPointType* theOffset) const;
@@ -76,11 +82,14 @@ class VisuGUI_OffsetDlg: public QDialog
   virtual void reject();
   void onApply();
   void onHelp();
+  void onSelectionChanged();
 
  private:
   void updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset);
+  void updatePointMapOffset (VISU::PointMap3d_i* thePrs, vtkFloatingPointType* theOffset);
 
   VisuGUI * myModule;
+  LightApp_SelectionMgr*  mySelectionMgr;
 
   QtxDoubleSpinBox * myDxEdt;
   QtxDoubleSpinBox * myDyEdt;
@@ -89,6 +98,9 @@ class VisuGUI_OffsetDlg: public QDialog
 
   QList<VISU::Prs3d_i*>  myPrsList;
   QList<OffsetStruct> myOldOffsets;
+
+  QList<VISU::PointMap3d_i*> myPointMapList;
+  QList<OffsetStruct>        myOldPointMapOffsets;
 };
 
 #endif // DIALOGBOX_OFFSET_H
index a4fcd7998b609947792cd7b161a9e0ede7c1c93a..263b40de2e4bc2352b037bcc261969128c1e04c8 100644 (file)
@@ -81,7 +81,7 @@ using namespace std;
 static void renderViewFrame (SVTK_ViewWindow* vw)
 {
   if (vw) {
-    vw->getRenderer()->ResetCameraClippingRange();
+//    vw->getRenderer()->ResetCameraClippingRange();
     vw->Repaint();
   }
 }
@@ -425,7 +425,7 @@ void VisuGUI_Plot3DPane::updatePreview()
 
   renderViewFrame(myViewWindow);
 
-  if (fitall) {
+  if (fitall && VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) {
     myPreviewActor->SetInfinitive(false);
     myViewWindow->onFitAll();
     myPreviewActor->SetInfinitive(true);
index 26105e76aeb7f61b50b875b12ce738a3732895fe..9fd9793d323c90e90321df7093b3cecd0e43b001 100644 (file)
@@ -111,12 +111,14 @@ 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 );
       ENUM2STRING( aResStr, VISU::TSTREAMLINES );
       ENUM2STRING( aResStr, VISU::TPLOT3D );
       ENUM2STRING( aResStr, VISU::TANIMATION );
+      ENUM2STRING( aResStr, VISU::TPOINTMAP3D );
     }
   }
 
@@ -381,11 +383,21 @@ struct TViewFunctor
   {
     VISU_Actor* anActor = NULL;
     VISU::Prs3d_i* aPrs3d = NULL;
+    VISU_ActorBase* anActorBase = NULL;
+    VISU::PointMap3d_i* aPointMap3d = NULL;
     SVTK_ViewWindow* aViewWindow = NULL;
-    if(!GetPrs3dSelectionInfo<TViewer>(theModule, theEntry, aPrs3d, aViewWindow, anActor))
-      return QString();
-    
-    return get(aPrs3d, aViewWindow, anActor);
+    if(GetPrs3dSelectionInfo<TViewer>(theModule, theEntry, aPrs3d, aViewWindow, anActor)) {
+      return get(aPrs3d, aViewWindow, anActor);      
+    } else {
+      aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
+      VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
+      if ( aSelectionInfo.empty() )
+       return QString();
+      VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
+      aPointMap3d = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);
+      anActorBase = VISU::FindActorBase(aViewWindow, aPointMap3d);
+      return getPointMap(aPointMap3d, aViewWindow, anActorBase);
+    }
   }
   
   QString
@@ -396,6 +408,15 @@ struct TViewFunctor
   {
     return QString();
   }
+
+  QString
+  virtual
+  getPointMap(VISU::PointMap3d_i* thePrs3d,
+             SVTK_ViewWindow* theViewWindow,
+             VISU_ActorBase* theActor)
+  {
+    return QString();
+  }
 };
 
 
@@ -418,6 +439,22 @@ struct TGetRepesentationFunctor: TViewFunctor
     }      
     return aResStr;
   }
+
+  QString
+  virtual
+  getPointMap(VISU::PointMap3d_i* thePrs3d,
+             SVTK_ViewWindow* theViewWindow,
+             VISU_ActorBase* theActorBase)
+  {
+    QString aResStr = "";
+    if (theActorBase) {
+      switch (theActorBase->GetRepresentation()) {
+       ENUM2STRING( aResStr, VISU::WIREFRAME ); // = 1
+       ENUM2STRING( aResStr, VISU::SHADED ); // = 2
+      }
+    }
+    return aResStr;
+  }
 };
 
 QString VisuGUI_Selection::representation( const int ind ) const
@@ -501,6 +538,17 @@ struct TIsShrunkFunctor: TViewFunctor
   {
     return theActor->IsShrunk() ? "1" : "0";
   }
+
+  QString
+  virtual
+  getPointMap(VISU::PointMap3d_i* thePointMap,
+             SVTK_ViewWindow* theViewWindow,
+             VISU_ActorBase* theActorBase)
+  {
+    if (theActorBase)
+      return theActorBase->IsShrunk() ? "1" : "0";
+    else return "0";
+  }
 };
 
 QString VisuGUI_Selection::isShrunk( const int ind ) const
index 3dcc438670c35d3997734b983b399a25b8bcd1fd..d8110578183490425a2b3a415651c1000e8f3b49 100644 (file)
@@ -1046,9 +1046,6 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs)
   myTextDlg->setTitleText(aTitle.in());
   myTitle = aTitle.in();
 
-  vtkFloatingPointType R, G, B;
-  myScalarMap->GetTitleColor(&R, &G, &B);
-
   setPosAndSize( myScalarMap->GetPosX(),
                 myScalarMap->GetPosY(),
                 myScalarMap->GetWidth(),
@@ -1076,16 +1073,23 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs)
   myBarDlg->setLabelsFormat(myScalarMap->GetLabelsFormat());
   myBarDlg->setUnitsVisible(myScalarMap->IsUnitsVisible());
 
-  myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
+  vtkFloatingPointType R, G, B;
+  myScalarMap->GetTitleColor(R, G, B);
+
+  QColor aTextColor = QColor((int)(R*255.), (int)(G*255.), (int)(B*255.));
+
+  myTextDlg->myTitleFont->SetData(aTextColor,
                                   myScalarMap->GetTitFontType(),
                                   myScalarMap->IsBoldTitle(),
                                   myScalarMap->IsItalicTitle(),
                                   myScalarMap->IsShadowTitle());
 
   // "Labels"
-  myScalarMap->GetLabelColor(&R, &G, &B);
+  myScalarMap->GetLabelColor(R, G, B);
+
+  QColor aLabelColor = QColor((int)(R*255.), (int)(G*255.), (int)(B*255.));
 
-  myTextDlg->myLabelFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
+  myTextDlg->myLabelFont->SetData(aLabelColor,
                                   myScalarMap->GetLblFontType(),
                                   myScalarMap->IsBoldLabel(),
                                   myScalarMap->IsItalicLabel(),
index 570a96e07eb0b12d281c5a928f06c779348c3362..f33d496d696be0cfbbf925dac22ce583c1f0bdff 100644 (file)
@@ -264,7 +264,9 @@ namespace VISU
       // Display created presentation.
       if (aViewWindow) {
        PublishInView(theModule, aPrs3d, aViewWindow);
-       aViewWindow->onFitAll();
+        if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
+         aViewWindow->onFitAll();
+       }
 
        AddScalarBarPosition(theModule, aViewWindow, aPrs3d, aPos);
       }
diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
deleted file mode 100644 (file)
index 069710e..0000000
+++ /dev/null
@@ -1,470 +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>
-#include <QTabWidget>
-#include <QGroupBox>
-#include <QCheckBox>
-#include <QComboBox>
-#include <QLabel>
-#include <QPushButton>
-#include <QFrame>
-#include <QKeyEvent>
-
-
-using namespace std;
-
-#define MYDEBUG 0
-
-/*!
- * Constructor
- */
-VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule)
-  : VisuGUI_ScalarBarBaseDlg(theModule),
-    myIsAnimation(false),
-    myUpdateScalars(true),
-    myVisuGUI(theModule)
-{
-  setWindowTitle(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
-  QWidget* aBox = new QWidget (this);
-  QVBoxLayout* aVBLay = new QVBoxLayout( aBox );
-  aVBLay->setMargin(11);
-  QFrame* TopGroup = new QFrame (aBox);
-  aVBLay->addWidget( 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);
-  TopGroupLayout->addWidget(ScaleLabel, 0, 0);
-
-  ScalFact = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
-  ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  ScalFact->setDecimals(38);
-  ScalFact->setValue(0.1);
-  TopGroupLayout->addWidget(ScalFact, 0, 1);
-
-  // Fields combo box
-  QLabel* FieldLabel = new QLabel (tr("FIELD_ITEM"), TopGroup);
-  myFieldsCombo = new QComboBox (TopGroup );
-
-  TopGroupLayout->addWidget(FieldLabel, 1, 0);
-  TopGroupLayout->addWidget(myFieldsCombo,1,1);
-
-  // TimeStamps combo box
-  QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup);
-  myTimeStampsCombo = new QComboBox (TopGroup);
-
-  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->setGeometry(QRect(10, 10, 281, 48));
-  //GroupButtons->setColumnLayout(0, Qt::Vertical);
-  //GroupButtons->layout()->setSpacing(0);
-  //GroupButtons->layout()->setMargin(0);
-  QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons);
-  GroupButtonsLayout->setAlignment(Qt::AlignTop);
-  GroupButtonsLayout->setSpacing(6);
-  GroupButtonsLayout->setMargin(11);
-
-  QPushButton* buttonOk = new QPushButton (tr("BUT_OK"), GroupButtons);
-  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("BUT_CANCEL") , GroupButtons);
-  buttonCancel->setAutoDefault(TRUE);
-  GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
-
-  QPushButton* buttonHelp = new QPushButton (tr("BUT_HELP") , GroupButtons);
-  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.toLatin1().data(),
-                                      aTimeIter.toInt());
-         }
-        }
-      }
-    }
-    AddAllFieldNames();
-  }
-  myFieldsCombo->setCurrentIndex(myFieldsCombo->findText(aFieldName.in()));
-  AddAllTimes(myFieldsCombo->currentText());
-  myTimeStampsCombo->setCurrentIndex(myTimeStampsCombo->findText(aIteration));
-  SetScalarField( false );
-
-  VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
-
-  if( !theInit )
-    return;
-
-  myInputPane->initFromPrsObject( myPrsCopy );
-  myTabBox->setCurrentIndex( 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().toLatin1().data(),
-                           myTimeStampID[ myTimeStampsCombo->currentIndex() ]);
-
-
-  if(myUpdateScalars) 
-    SetScalarField( false );
-
-  VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Copy(myPrsCopy, thePrs);
-
-  return anIsOk;
-}
-
-int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldNamePos(){
-  return myFieldsCombo->currentIndex();
-}
-
-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->currentIndex() ], "", 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.toLatin1().data(),
-                           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->addItem(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->addItem(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 6eec691..0000000
+++ /dev/null
@@ -1,118 +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 "QtxDoubleSpinBox.h"
-
-class QComboBox;
-class QTabWidget;
-
-#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:
- QtxDoubleSpinBox* 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 5d9bd5b4a3d323e0c4f2b9885f2e2c5c1e5ed524..c4b6d44e20b8a21ebe181d267c8964075c86e907 100644 (file)
@@ -55,6 +55,8 @@
 #include "SVTK_ViewWindow.h"
 #include "SVTK_Selector.h"
 
+#include "VISU_ConvertorUtils.hxx"
+
 #include "utilities.h"
 
 // OCCT Includes
@@ -499,21 +501,30 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
           {
            int aVTKID = anVISUActor->GetNodeVTKID(anID);
            if(aVTKID >= 0){
+           if ( aVTKID >= 0 ) {
              vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID);
              myXValLbl->setText( QString::number( aCoord[0] ) );
              myYValLbl->setText( QString::number( aCoord[1] ) );
              myZValLbl->setText( QString::number( aCoord[2] ) );
-             myIDValLbl->setText( QString::number(anID) );
-             myScalarValLbl->setText(getValue(aPntData, aVTKID));
-             myVectorValLbl->setText(getVector(aPntData, aVTKID));
+             myIDValLbl->setText( QString::number( anID ) );
+             
+              if ( !VISU::IsElnoData( aDataSet ) ) {
+               myScalarValLbl->setText( getValue( aPntData, aVTKID ) );
+               myVectorValLbl->setText( getVector( aPntData, aVTKID ) );
+             } else {
+               myScalarValLbl->setText( "< ELNO data >" );
+               myVectorValLbl->setText( "< ELNO data >" );
+             }
+
              const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper();
-             VISU::TStructuredId aStructuredId = aMapper->GetIndexesOfNode(anID);
+             VISU::TStructuredId aStructuredId = aMapper->GetIndexesOfNode( anID );
              myKValLbl->setText( GetNumber( aStructuredId, 2 ) );
              myJValLbl->setText( GetNumber( aStructuredId, 1 ) );
              myIValLbl->setText( GetNumber( aStructuredId, 0 ) );
-           }
+            }
           }
           break;
+         }
         case 1:
           {
             vtkCellData* aCellData = aDataSet->GetCellData();
index d76db59ba767d411a1ee4ebb8707ece03e5c2621..6c961fbf2c40acb4db28c354a1b2ccbf666c5eb1 100644 (file)
@@ -162,7 +162,10 @@ void VisuGUI_Table3DPane::initFromPrsObject( VISU::PointMap3d_i* thePrs )
   myPrs = thePrs;
 
   // scale
-  ScaleSpn->setValue( thePrs->GetScaleFactor() );
+  double aScale = thePrs->GetScaleFactor();
+  if (aScale<0)
+    aScale = 0;
+  ScaleSpn->setValue( aScale );
 
   // prs type
   int id = thePrs->GetIsContourPrs() ? CONTOUR_PRS_ID : SURFACE_PRS_ID;
@@ -418,7 +421,7 @@ void VisuGUI_TableScalarBarPane::initFromPrsObject( VISU::PointMap3d_i* thePrs )
   myTitle = aTitle.in();
 
   vtkFloatingPointType R, G, B;
-  myBarPrs->GetTitleColor( &R, &G, &B );
+  myBarPrs->GetTitleColor( R, G, B );
 
   setPosAndSize( myBarPrs->GetPosX(),
                 myBarPrs->GetPosY(),
@@ -444,7 +447,7 @@ void VisuGUI_TableScalarBarPane::initFromPrsObject( VISU::PointMap3d_i* thePrs )
                                   myBarPrs->IsShadowTitle() );
 
   // "Labels"
-  myBarPrs->GetLabelColor( &R, &G, &B );
+  myBarPrs->GetLabelColor( R, G, B );
 
   myTextDlg->myLabelFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ),
                                    myBarPrs->GetLblFontType(),
@@ -642,6 +645,47 @@ void VisuGUI_TableScalarBarPane::changeDefaults( int )
   }
 }
 
+//=======================================================================
+//function : Check
+//purpose  : Called when <OK> button is clicked, validates data and closes dialog
+//=======================================================================
+bool VisuGUI_TableScalarBarPane::check()
+{
+  double minVal = MinEdit->text().toDouble();
+  double maxVal = MaxEdit->text().toDouble();
+  if ( RBIrange->isChecked() ) {
+    if (minVal >= maxVal) {
+      SUIT_MessageBox::warning( this,tr("WRN_VISU"),
+                               tr("MSG_MINMAX_VALUES") );
+      return false;
+    }
+  }
+
+  // check if logarithmic mode is on and check imposed range to not contain negative values
+  if ( CBLog->isChecked() ) {
+    if ( minVal <= 0.0 ) {
+      if ( RBIrange->isChecked() ) {
+       SUIT_MessageBox::warning( this,
+                                 tr("WRN_VISU"),
+                                 tr("WRN_LOGARITHMIC_RANGE") );
+      } else {
+       if ( minVal == 0)
+         SUIT_MessageBox::warning( this,
+                                   tr("WRN_VISU"),
+                                   tr("WRN_LOGARITHMIC_RANGE") );
+       else
+         SUIT_MessageBox::warning( this,
+                                   tr("WRN_VISU"),
+                                   tr("WRN_LOGARITHMIC_FIELD_RANGE") );
+       RBIrange->setChecked(true);
+       changeRange(1);
+      }
+      return false;
+    }
+  }
+  return true;
+}
+
 //=======================================================================
 //function : Constructor
 //purpose  :
@@ -650,7 +694,7 @@ VisuGUI_Table3DDlg::VisuGUI_Table3DDlg ( SalomeApp_Module* theModule )
   : QDialog ( VISU::GetDesktop( theModule ) )
 {
   setModal( false );
-  setWindowTitle( tr( "TITLE" ) );
+  setWindowTitle( tr( "Point Map 3D Definition" ) );
   setSizeGripEnabled( true );
 
   QVBoxLayout* TopLayout = new QVBoxLayout( this );
@@ -704,14 +748,26 @@ VisuGUI_Table3DDlg::~VisuGUI_Table3DDlg()
 {
 }
 
+//=======================================================================
+//function : accept
+//purpose  :
+//=======================================================================
+void VisuGUI_Table3DDlg::accept()
+{
+  if (myScalarBarPane->check())
+    QDialog::accept();
+}
+
 //=======================================================================
 //function : onApply
 //purpose  :
 //=======================================================================
 void VisuGUI_Table3DDlg::onApply()
 {
-  storeToPrsObject( myPrsCopy );
-  myPrsCopy->UpdateActors();
+  if (myScalarBarPane->check()) {
+    storeToPrsObject( myPrsCopy );
+    myPrsCopy->UpdateActors();
+  }
 }
 
 //=======================================================================
@@ -720,7 +776,24 @@ void VisuGUI_Table3DDlg::onApply()
 //=======================================================================
 void VisuGUI_Table3DDlg::onHelp()
 {
-  // "table_3d_page.html";
+  QString aHelpFileName = "table_3d_page.html";
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) {
+    VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
+    app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
+  }
+  else {
+    QString platform;
+#ifdef WIN32
+    platform = "winapplication";
+#else
+    platform = "application";
+#endif
+    SUIT_MessageBox::warning( this, QObject::tr("WRN_WARNING"),
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+  }
+
 }
 
 //=======================================================================
@@ -745,4 +818,3 @@ void VisuGUI_Table3DDlg::initFromPrsObject( VISU::PointMap3d_i* thePrs )
   myIsoPane->initFromPrsObject( thePrs );
   myScalarBarPane->initFromPrsObject( thePrs );
 }
-
index 3945fb339b6695e8967f4e232267459431cec57f..2257b4839c80a065dbbdbafa5d372443abecd5d3 100644 (file)
@@ -173,6 +173,7 @@ public:
   virtual int  storeToPrsObject( VISU::PointMap3d_i* );
 
 protected slots:
+  void         accept();
   void         onHelp();
   void         onApply();
 
index 26b7ca6f6dba77a22d67b26438dd65e077e0c25c..86df91b64bae7a0c0aad7796af3077551451075c 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"
 #define  MAXVAL 1e10
 #define  VALPRECISION 8
 
+namespace {
+  void GeneratePresentations(int theFieldId, VISU_TimeAnimation* theAnimator)
+  {
+    theAnimator->generatePresentations(theFieldId);
+    FieldData& aFieldData = theAnimator->getFieldData(theFieldId);
+    
+    
+    int aRefFieldId = ( theAnimator->getAnimationMode() == VISU::Animation::PARALLEL ) ? theFieldId : 0;
+    if(VISU::ColoredPrs3d_i* aInitialPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(theAnimator->getFieldData(aRefFieldId).myPrs[0])){
+      for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
+        VISU::ColoredPrs3d_i* aColoredPrs3d = aFieldData.myPrs[aFrameId];
+        
+        // Special case for DeformedShape And ScalarMap presentation
+        // Restore time stamp number for all presentations
+        VISU::DeformedShapeAndScalarMap_i* aDeformedAndScalPrs = dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>(aColoredPrs3d);
+        int aTimeStampNum = -1;
+        if(aDeformedAndScalPrs){
+          aTimeStampNum = aDeformedAndScalPrs->GetScalarTimeStampNumber();
+        }  
+        aColoredPrs3d->SameAs(aInitialPrs3d);
+        
+        if(aDeformedAndScalPrs){
+          aDeformedAndScalPrs->SetScalarField(aDeformedAndScalPrs->GetScalarEntity(),
+                                              aDeformedAndScalPrs->GetScalarFieldName(),
+                                              aTimeStampNum);
+        }
+        
+        std::string aTitle = aColoredPrs3d->GetCTitle();
+        if ( aFrameId != 0 && theAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
+          aColoredPrs3d->SetTitle(aTitle.c_str());
+        }
+      }
+    }
+  }
+}
+
 ArrangeDlg::ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator)
   : QDialog(theParent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
     myAnimator(theAnimator),
@@ -130,7 +166,7 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent,
   vtkActorCollection *aCollection = myViewWindow->getRenderer()->GetActors();
   aCollection->InitTraversal();
   while(vtkActor* anActor = aCollection->GetNextActor()){
-    if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
+    if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor)) {
       if(anVISUActor->GetVisibility() != 0){
        if (VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d()){
          if(!myPrsMap.contains(aPrs)){
@@ -154,6 +190,31 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent,
          }
        }
       }
+    } else { //if PointMap3d Actor
+      if (VISU_ActorBase* anActorBase = dynamic_cast<VISU_ActorBase*>(anActor))
+       if(anActorBase->GetVisibility() != 0)
+         if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anActorBase->GetFactory())) {
+           if(!myPointMapPrsMap.contains(aPrs)){
+             Handle(SALOME_InteractiveObject) anIO = aPrs->GetIO();
+             if(!anIO->hasEntry())
+               continue;
+             SalomeApp_Study* aStudy = VISU::GetAppStudy(theModule);
+             VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anIO->getEntry());
+             if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+               _PTR(GenericAttribute) anAttr;
+               if (aSObject->FindAttribute(anAttr, "AttributeName")) {
+                 _PTR(AttributeName) aName(anAttr);
+                 QString strIn(aName->Value().c_str());
+                 aPrsNames.append(strIn);
+                 myPointMapPrsMap[aPrs] = myOffsets.count();
+                 Offset aOffs;
+                 anActorBase->GetPosition(aOffs.myOffset);
+                 myOffsets.append(aOffs);
+               }
+             }
+           }
+         }
+    }
   }
   myFieldLst->addItems(aPrsNames);
   myFieldLst->setCurrentRow(0);
@@ -345,7 +406,7 @@ void ArrangeDlg::acceptAnimation()
     QApplication::setOverrideCursor( Qt::WaitCursor );
     FieldData& aData = myAnimator->getFieldData(myFieldLst->currentRow());
     if (aData.myPrs.empty())
-      myAnimator->generatePresentations(myFieldLst->currentRow());
+      GeneratePresentations(myFieldLst->currentRow(),myAnimator);
     vtkFloatingPointType aBounds[6];
     aData.myPrs[0]->GetBounds(aBounds);
     vtkFloatingPointType aDist = 0;
@@ -409,14 +470,24 @@ void ArrangeDlg::acceptViewWindow()
        if (mySaveChk->isChecked())
          aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
     }
+    QMap<VISU::PointMap3d_i*, int>::Iterator itt;
+    for (itt = myPointMapPrsMap.begin(); itt != myPointMapPrsMap.end(); ++itt) {
+      VISU::PointMap3d_i* aPrs = itt.key();
+      Offset& aOffs = myOffsets[itt.value()];
+      if (VISU_ActorBase* anActor = VISU::FindActorBase(myViewWindow, aPrs))
+        anActor->SetPosition(aOffs.myOffset);
+      if (mySaveChk)
+       if (mySaveChk->isChecked())
+         aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]);
+    }
   } else {
     vtkFloatingPointType aDist = 0;
     vtkFloatingPointType aShift = 0;
     vtkFloatingPointType aPrevDist = 0;
     vtkFloatingPointType aPrevShift = 0;
-    int i;
+    int i = 0;
     QMap<VISU::Prs3d_i*, int>::Iterator it;
-    for (it = myPrsMap.begin(), i = 0; it != myPrsMap.end(); ++it, i++) {
+    for (it = myPrsMap.begin(); it != myPrsMap.end(); ++it, i++) {
       VISU::Prs3d_i* aPrs = it.key();
       if (VISU_Actor* aActor = VISU::FindActor(myViewWindow, aPrs)) {
        int aAxis = getAxis();
@@ -489,7 +560,69 @@ void ArrangeDlg::acceptViewWindow()
        aPrevDist = aDist;
        aPrevShift = aShift;
       }
-    }
+    } // end of myPrsMap loop
+    // Loop in PointMap3D the same as previous loop
+    QMap<VISU::PointMap3d_i*, int>::Iterator itt;
+    for (itt = myPointMapPrsMap.begin(); itt != myPointMapPrsMap.end(); ++itt, i++) {
+      VISU::PointMap3d_i* aPrs = itt.key();
+      if (VISU_ActorBase* aActor = VISU::FindActorBase(myViewWindow, aPrs)) {
+       int aAxis = getAxis();
+
+       vtkFloatingPointType aZeroOffset[3];
+       aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0;
+       aActor->SetPosition(aZeroOffset);
+        aActor->GetMapper()->Update();
+
+       vtkFloatingPointType aBounds[6];
+       aActor->GetBounds(aBounds);
+       switch (aAxis) {
+       case XAxis:
+         aDist = fabs(aBounds[1] - aBounds[0]);
+         break;
+       case YAxis:
+         aDist = fabs(aBounds[3] - aBounds[2]);
+         break;
+       case ZAxis:
+         aDist = fabs(aBounds[5] - aBounds[4]);
+       }
+       vtkFloatingPointType aOffset[3];
+        aOffset[0] = aOffset[1] = aOffset[2] = 0;
+        aOffset[aAxis] =
+          (aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis];
+
+        if (i > 0) {
+          vtkFloatingPointType aCCDist = (aDist + aPrevDist) / 2.0;
+
+          vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]);
+          vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]);
+          vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]);
+          vtkFloatingPointType max = (dx > dy) ? dx : dy;
+          max = (dz > max) ? dz : max;
+          max /= 100.0;
+
+          if (aCCDist < max) {
+            // set base distance between centers of bounding boxes
+            // to minimal (but big enough) size of current bounding box
+            if (dx < max) dx = FLT_MAX;
+            if (dy < max) dy = FLT_MAX;
+            if (dz < max) dz = FLT_MAX;
+
+            aCCDist = (dx < dy) ? dx : dy;
+            aCCDist = (dz < aCCDist) ? dz : aCCDist;
+          }
+          aShift = aPrevShift + aPrevDist/2.0 + aCCDist*getDistance() - aDist/2.0;
+        }
+
+       aOffset[aAxis] += aShift;
+       aActor->SetPosition(aOffset);
+       if (mySaveChk)
+         if (mySaveChk->isChecked())
+           aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]);
+
+       aPrevDist = aDist;
+       aPrevShift = aShift;
+      }
+    } // end of myPointMapPrsMap loop
   }
   myViewWindow->getRenderer()->ResetCameraClippingRange();
   myViewWindow->Repaint();
@@ -704,6 +837,8 @@ void SetupDlg::initialize()
   FieldData& aData = myAnimator->getFieldData( 0 );
   _PTR(SObject) aField = aData.myField;
 
+  if(!aField) return;
+
   _PTR(ChildIterator) anIter = aStudy->NewChildIterator(aField);
   anIter->Next(); // First is reference on support
   for(int index = 1; anIter->More(); anIter->Next(), index++)
@@ -729,7 +864,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
 };
 
 //------------------------------------------------------------------------
@@ -820,9 +955,9 @@ void SetupDlg::onFieldChange (int theIndex)
     myTypeId2ComboId[TSTREAMLINES_ITEM] = myComboId2TypeId.size();
     myComboId2TypeId.push_back(TSTREAMLINES_ITEM);;
 
-    myTypeCombo->addItem("Scalar map on Deformed shape");   // item 9
-    myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM] = myComboId2TypeId.size();
-    myComboId2TypeId.push_back(TSCALARMAPONDEFORMEDSHAPE_ITEM);;
+    myTypeCombo->addItem("Deformed shape and Scalar map");   // item 9
+    myTypeId2ComboId[TDEFORMEDSHAPEANDSCALARMAP_ITEM] = myComboId2TypeId.size();
+    myComboId2TypeId.push_back(TDEFORMEDSHAPEANDSCALARMAP_ITEM);;
   }
 
   if(anEnableGP){
@@ -851,7 +986,8 @@ void SetupDlg::onFieldChange (int theIndex)
     myTypeCombo->setCurrentIndex(myTypeId2ComboId[TDEFORMEDSHAPE_ITEM]);
     break;
   case VISU::TSCALARMAPONDEFORMEDSHAPE: //Scalar Map on Deformed Shape
-    myTypeCombo->setCurrentIndex(myTypeId2ComboId[TSCALARMAPONDEFORMEDSHAPE_ITEM]);
+  case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+    myTypeCombo->setCurrentIndex(myTypeId2ComboId[TDEFORMEDSHAPEANDSCALARMAP_ITEM]);
     break;
   case VISU::TVECTORS: //Vectors
     myTypeCombo->setCurrentIndex(myTypeId2ComboId[TVECTORS_ITEM]);
@@ -895,8 +1031,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;
@@ -971,7 +1107,7 @@ void SetupDlg::onPreferencesDlg()
     }
   }
 
-  if(!aData.myNbFrames || !aData.myPrs[0]){
+  if(!aData.myNbFrames || aData.myPrs.empty() || !aData.myPrs[0]){
     QApplication::restoreOverrideCursor();
     SUIT_MessageBox::warning(this,
                            tr("ERROR"),
@@ -1006,18 +1142,43 @@ 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);
-      if (aDlg->exec() && aDlg->storeToPrsObject(aData.myPrs[0])) { 
-       for (int i = 1; i < aData.myNbFrames; i++){
-         aData.myPrs[i]->SameAs(aData.myPrs[0]);
-       }
+      if (aDlg->exec() && aDlg->storeToPrsObject(aData.myPrs[0])) {
+        for (long aFrameId = 1; aFrameId < aData.myNbFrames; aFrameId++){
+          TYPE* aDeformedPrs3d = dynamic_cast<TYPE*>(aData.myPrs[aFrameId]);
+          //Set correct time stamp number
+          int aTimeStampNum = aDeformedPrs3d->GetScalarTimeStampNumber();
+          aDeformedPrs3d->SameAs(aPrs3d);
+          aDeformedPrs3d->SetScalarField(aDeformedPrs3d->GetScalarEntity(),
+                                         aDeformedPrs3d->GetScalarFieldName(),
+                                         aTimeStampNum);
+
+        }
+        
+        if ( myAnimator->getAnimationMode() == VISU::Animation::SUCCESSIVE ) {
+          for (int aFieldId = 1; aFieldId < myAnimator->getNbFields(); aFieldId++) {
+            FieldData& aFieldData = myAnimator->getFieldData(aFieldId);
+            for (long aFrameId = 0; aFrameId < aFieldData.myNbFrames; aFrameId++) {
+              TYPE* aDeformedPrs3d = dynamic_cast<TYPE*>(aFieldData.myPrs[aFrameId]);
+              std::string aTitle = aDeformedPrs3d->GetCTitle();
+              //Set correct time stamp number
+              int aTimeStampNum = aDeformedPrs3d->GetScalarTimeStampNumber();
+              aDeformedPrs3d->SameAs(aPrs3d);
+              aDeformedPrs3d->SetTitle(aTitle.c_str());
+              aDeformedPrs3d->SetScalarField(aDeformedPrs3d->GetScalarEntity(),
+                                             aDeformedPrs3d->GetScalarFieldName(),
+                                             aTimeStampNum);
+
+            }
+          }
+        }          
       }
       delete aDlg;
     }
@@ -1625,7 +1786,8 @@ void VisuGUI_TimeAnimationDlg::createFrames()
     FieldData& aFieldData = myAnimator->getFieldData(i);
     if( aFieldData.myPrs.empty() )
     {
-      myAnimator->generatePresentations(i);
+      //myAnimator->generatePresentations(i);
+      GeneratePresentations(i,myAnimator);
       continue;
     }
 
@@ -1634,6 +1796,8 @@ void VisuGUI_TimeAnimationDlg::createFrames()
     // when a range or a sequence of the animation has been changed
     if( isRegenerate )
     {
+      GeneratePresentations(i,myAnimator);
+      /*
       VISU::ColoredPrs3d_i* aPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(aFieldData.myPrs[0]);
       if( !aPrs3d )
        continue;
@@ -1649,6 +1813,7 @@ void VisuGUI_TimeAnimationDlg::createFrames()
          aColoredPrs3d->SetTitle(aTitle.c_str());
        }
       }
+      */
     }
   }
   if( isRegenerate )
index d472288d0b3d97f80a078ff320e3e578fead9356..400f8513728c7db9372beee8caab28deebbc9626 100644 (file)
@@ -48,6 +48,7 @@ class VISU_TimeAnimation;
 namespace VISU 
 {
   class Prs3d_i;
+  class PointMap3d_i;
 }
 
 class SVTK_ViewWindow;
@@ -114,6 +115,7 @@ class ArrangeDlg: public QDialog
 
   int               myCurrent;
   QMap<VISU::Prs3d_i*, int> myPrsMap;
+  QMap<VISU::PointMap3d_i*, int> myPointMapPrsMap;
 };
 
 
index ef30aef241f0a4937f69564e1468d09cc01f8d4f..6df04f65092323dc0e5d3a51220737a7fe6d4dca 100644 (file)
@@ -381,6 +381,79 @@ namespace VISU
     theSelectionMgr->setSelectedObjects(aNewListIO);
   }
 
+  /*!
+   * \brief Check, if the object can be deleted
+   *
+   * \param theEntry - entry of the object to check
+   * \param theModule - is used to access Study and VISU_Gen
+   * \retval bool - returns TRUE if the object is removable
+   */
+  bool
+  IsRemovable (const std::string theEntry,
+               const SalomeApp_Module* theModule)
+  {
+    // asv : if selected object is a Save Point object selected in object browser - return false
+    if ( QString( theEntry.c_str() ).startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) )
+      return false;
+
+    _PTR(Study) aStudy = GetCStudy(GetAppStudy(theModule));
+
+    _PTR(SObject) aSObject = aStudy->FindObjectID(theEntry);
+    VISU::Storable::TRestoringMap pMap;
+    if (aSObject) {
+      CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
+      if (!CORBA::is_nil(aCORBAObject)) {
+        VISU::RemovableObject_var aRemovableObj = VISU::RemovableObject::_narrow(aCORBAObject);
+        if (CORBA::is_nil(aRemovableObj)) {
+          // Not removable CORBA object
+          return false;
+        }
+      } else {
+        // Can be removed, if lays directly under VISU
+        // (first sub-level) or is a child of such an object
+        string aNAME, aVisuNAME = GetVisuGen(theModule)->ComponentDataType();
+        _PTR(GenericAttribute) anAttr;
+        _PTR(AttributeString) aComment;
+
+        bool isUnderVISU = false;
+        _PTR(SObject) aFatherSObject = aSObject->GetFather();
+        if (aFatherSObject->FindAttribute(anAttr, "AttributeName")) {
+          // mkr : 24.11.2006 : use AttributeName and module title for correct "Delete"
+          //                    popup item displaying in object browser popup
+          _PTR(AttributeName) aComment (anAttr);
+          aNAME = aComment->Value();
+          QString aVisuTITLE = theModule->getApp()->moduleTitle(aVisuNAME.c_str());
+          if (!aVisuTITLE.compare(aNAME.c_str())) {
+            isUnderVISU = true;
+          }
+        }
+        if (!isUnderVISU) {
+          // Not directly under VISU component, check father
+          aCORBAObject = VISU::ClientSObjectToObject(aFatherSObject);
+          if (!CORBA::is_nil(aCORBAObject)) {
+            // Father has IOR
+            return false;
+          }
+
+          isUnderVISU = false;
+          aFatherSObject = aFatherSObject->GetFather();
+          if (aFatherSObject->FindAttribute(anAttr, "AttributeString")) {
+            _PTR(AttributeString) aComment (anAttr);
+            aNAME = aComment->Value();
+            if (aNAME == aVisuNAME) {
+              isUnderVISU = true;
+            }
+          }
+          if (!isUnderVISU) {
+            // Father is not directly under VISU component
+            return false;
+          }
+        }
+      }
+    }
+    return true;
+  }
+
   /*!
    * \brief Check, if "Delete" popup-menu can be put on current selection
    *
@@ -404,64 +477,8 @@ namespace VISU
     for (; anIter.More(); anIter.Next()) {
       Handle(SALOME_InteractiveObject) anIO = anIter.Value();
       if (anIO->hasEntry()) {
-
-       // asv : if selected object is a Save Point object selected in object browser - return false
-       if ( QString( anIO->getEntry() ).startsWith( QObject::tr( "SAVE_POINT_DEF_NAME" ) ) )
-         return false;
-
-        _PTR(SObject) aSObject = aStudy->FindObjectID(anIO->getEntry());
-        VISU::Storable::TRestoringMap pMap;
-        if (aSObject) {
-          CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
-          if (!CORBA::is_nil(aCORBAObject)) {
-            VISU::RemovableObject_var aRemovableObj = VISU::RemovableObject::_narrow(aCORBAObject);
-            if (CORBA::is_nil(aRemovableObj)) {
-              // Not removable CORBA object
-              return false;
-            }
-          } else {
-            // Can be removed, if lays directly under VISU
-            // (first sub-level) or is a child of such an object
-            string aNAME, aVisuNAME = GetVisuGen(theModule)->ComponentDataType();
-            _PTR(GenericAttribute) anAttr;
-            _PTR(AttributeString) aComment;
-
-            bool isUnderVISU = false;
-            _PTR(SObject) aFatherSObject = aSObject->GetFather();
-            if (aFatherSObject->FindAttribute(anAttr, "AttributeName")) {
-             // mkr : 24.11.2006 : use AttributeName and module title for correct "Delete"
-             //                    popup item displaying in object browser popup
-              _PTR(AttributeName) aComment (anAttr);
-              aNAME = aComment->Value().c_str();
-             QString aVisuTITLE = theModule->getApp()->moduleTitle(QString(aVisuNAME.c_str()));
-              if (!aVisuTITLE.compare(QString(aNAME.c_str()))) {
-                isUnderVISU = true;
-              }
-            }
-            if (!isUnderVISU) {
-              // Not directly under VISU component, check father
-              aCORBAObject = VISU::ClientSObjectToObject(aFatherSObject);
-              if (!CORBA::is_nil(aCORBAObject)) {
-                // Father has IOR
-                return false;
-              }
-
-              isUnderVISU = false;
-              aFatherSObject = aFatherSObject->GetFather();
-              if (aFatherSObject->FindAttribute(anAttr, "AttributeString")) {
-                _PTR(AttributeString) aComment (anAttr);
-                aNAME = aComment->Value();
-                if (aNAME == aVisuNAME) {
-                  isUnderVISU = true;
-                }
-              }
-              if (!isUnderVISU) {
-                // Father is not directly under VISU component
-               return false;
-              }
-            }
-          }
-        }
+        if (!IsRemovable(anIO->getEntry(), theModule))
+          return false;
       }
     }
     return true;
@@ -540,32 +557,58 @@ namespace VISU
     if(aSelectionInfo.empty())
       return;
 
+    VISU::Prs3d_i* aPrs3d;
+    VISU::PointMap3d_i* aTable;
+    VISU_Actor* anActor;
+    VISU_ActorBase* anActorBase;
+
     TSelectionItem aSelectionItem = aSelectionInfo.front();
-    VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
-    if(!aPrs3d)
-      return;
+    aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
+    if(!aPrs3d) {
+      aTable = dynamic_cast<VISU::PointMap3d_i*>(aSelectionItem.myObjectInfo.myBase);      
+      if(!aTable)
+       return;
+    }
 
     SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
     if(!aViewWindow)
       return;
 
-    VISU_Actor* anActor = FindActor(aViewWindow, aPrs3d);
-    if(!anActor)
-      return;
+    if (aPrs3d) {
+      anActor = FindActor(aViewWindow, aPrs3d);
+      if(!anActor)
+       return;
+    } else {
+      anActorBase = VISU::FindActorBase(aViewWindow, aTable);
+      if(!anActorBase)
+       return;
+    }
 
     switch (theType) {
     case VISU::SHRINK:
+      if (aPrs3d) {
       if (anActor->IsShrunk())
        anActor->UnShrink();
       else
        anActor->SetShrink();
+      } else if (aTable) {
+       if (anActorBase->IsShrunk())
+         anActorBase->UnShrink();
+       else
+         anActorBase->SetShrink();
+      }
       break;
     default:
-      if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
-       aMesh->SetPresentationType(theType);
-       RecreateActor(theModule, aMesh);
-      } else {
-       anActor->SetRepresentation(theType);
+      if (aPrs3d) {
+       if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+         aMesh->SetPresentationType(theType);
+         RecreateActor(theModule, aMesh);
+       } else {
+         anActor->SetRepresentation(theType);
+       }
+      }
+      else if (aTable) {
+       anActorBase->SetRepresentation(theType);
       }
     }
     aViewWindow->Repaint();
@@ -730,6 +773,17 @@ namespace VISU
     return FindActor(theViewWindow, aPrs3d);
   }
 
+  //------------------------------------------------------------
+  VISU_ActorBase*
+  FindActorBase(const SalomeApp_Study* theStudy,
+               SVTK_ViewWindow* theViewWindow,
+               const QString& theEntry)
+  {
+    TObjectInfo anObjectInfo = GetObjectByEntry(theStudy, theEntry.toLatin1().constData());
+    VISU::PointMap3d_i* aTable = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase);
+    return FindActorBase(theViewWindow, aTable);
+  }
+
   //------------------------------------------------------------
   void
   RecreateActor (const SalomeApp_Module* theModule,
@@ -979,17 +1033,32 @@ namespace VISU
     aPlot->getCurves( clist );
     SPlot2d_Curve* plotCurve = 0;
     SPlot2d_Curve* tmpCurve;
-    for (int i = 0; i < clist.count(); i++) {
-      tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
-      if (tmpCurve && tmpCurve->hasIO() &&
-          theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
-        plotCurve = tmpCurve;
-      } else if (theDisplaying == VISU::eDisplayOnly) {
-        aPlot->eraseCurve(clist.at(i));
+    if(theDisplaying == VISU::eErase) {
+      // 23.06.2008 skl for IPAL17672
+      for (int i = 0; i < clist.count(); i++) {
+        tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+        if (tmpCurve && tmpCurve->hasIO() &&
+            theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
+          plotCurve = tmpCurve;
+          aPlot->eraseCurve(clist.at(i));
+          break;
+        }
       }
+      UpdateCurve(theCurve, aPlot, plotCurve, theDisplaying);
+    }
+    else {
+      for (int i = 0; i < clist.count(); i++) {
+        tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
+        if (tmpCurve && tmpCurve->hasIO() &&
+            theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
+          plotCurve = tmpCurve;
+        }
+        else if (theDisplaying == VISU::eDisplayOnly) {
+          aPlot->eraseCurve(clist.at(i));
+        }
+      }
+      UpdateCurve(theCurve, aPlot, plotCurve, theDisplaying);
     }
-
-    UpdateCurve(theCurve, aPlot, plotCurve, theDisplaying);
 
     aPlot->Repaint();
   }
@@ -1057,7 +1126,9 @@ namespace VISU
       }
     }
     aPlot->Repaint();
-    aPlot->fitAll();
+    if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
+      aPlot->fitAll();
+    }
     qApp->processEvents();
   }
 
@@ -1169,7 +1240,9 @@ namespace VISU
          if(av)(const_cast<VisuGUI*>(av))->OnEraseAll();
        }
         PublishMeshInView(theModule, pPresent, theViewWindow);
-        SetFitAll(theViewWindow);
+        if(GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)){
+         SetFitAll(theViewWindow);
+       }
 #ifdef CHECKTIME
         timer.Stop();
         MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
@@ -1228,6 +1301,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 8e69af3d4a5e81ff3daf00c76d8c2a3468aee254..e5d8510b97b03ae2b32d713aab757db9a1cc4e52 100644 (file)
@@ -127,6 +127,8 @@ namespace VISU
   void                                 Remove(LightApp_SelectionMgr* theSelectionMgr,
                                              const Handle(SALOME_InteractiveObject)& theIO);
 
+  bool                                 IsRemovable        (const std::string theEntry,
+                                                          const SalomeApp_Module* theModule);
   bool                                 IsRemovableSelected(const SalomeApp_Module* theModule);
 
   void                                 DeleteSObject(VisuGUI* theModule,
@@ -168,6 +170,9 @@ namespace VISU
   VISU_Actor*                          FindActor(const SalomeApp_Study* theStudy,
                                                 SVTK_ViewWindow* theViewWindow,
                                                 const QString& theEntry);
+  VISU_ActorBase*                      FindActorBase(const SalomeApp_Study* theStudy,
+                                                    SVTK_ViewWindow* theViewWindow,
+                                                    const QString& theEntry);
   void                                 RecreateActor(const SalomeApp_Module* theModule,
                                                     VISU::Prs3d_i* thePrs);
 
index b470b5a0b05ac87515e7fb3f47df5768550bdac4..ba83ec2d41efe2d7dd14338c9e67b7cb99412c75 100644 (file)
@@ -217,6 +217,11 @@ void VisuGUI_TransparencyDlg::SetTransparency()
       VISU_Actor* anActor = VISU::FindActor(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
       if (anActor)
        anActor->SetOpacity(opacity);
+      else {
+       VISU_ActorBase* anActor = VISU::FindActorBase(VISU::GetAppStudy(myModule), myViewWindow, anIO->getEntry());
+      if (anActor)
+        anActor->SetOpacity(opacity);
+      }
     }
     myViewWindow->Repaint();
   }
index b0f4bdcc0b74e2c7e7f6b880b93851d6bc7ebc86..ed7bcc57e8d93511551730e940ed3078fc9cd289 100644 (file)
@@ -91,7 +91,11 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule)
   ScaleLabel = new QLabel (tr("LBL_SCALE_FACTOR"), TopGroup );
 
   ScalFact = new QtxDoubleSpinBox( 1e-20, 1.0E+38, 0.1, TopGroup );
-  ScalFact->setDecimals( 5 );
+
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
+
+  ScalFact->setDecimals( aPrecision*(-1) ); // ScalFact->setDecimals( 5 );
   ScalFact->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   ScalFact->setValue( 0.1 );
 
@@ -322,9 +326,20 @@ void VisuGUI_VectorsDlg::enableSetColor()
 /*!
   Sets Scale factor
 */
-void VisuGUI_VectorsDlg::setScaleFactor( double sf )
+void VisuGUI_VectorsDlg::setScaleFactor( double theFactor )
 {
-  ScalFact->setValue( sf );
+  double i=0.1;
+  while (1) { // Calculate Step & Precission
+    if ( int (theFactor/i) > 0)
+      break;
+    else {
+      i = i*0.1;
+    }
+  }
+  
+  ScalFact->setSingleStep(i);
+
+  ScalFact->setValue( theFactor );
 }
 
 /*!
index a4ff436a38f4c25c9564b9331a979fe3b3d74025..0bc6b6ac445f88049b3f9c10aa000c2807d48361 100644 (file)
@@ -50,10 +50,14 @@ 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 \
+       VISU_Deformation_i.hh \
+       VISU_OptionalDeformation_i.hh \
        SALOME_GenericObjPointer.hh
 
+
 libVISUEngineImpl_la_SOURCES = \
        VISUConfig.cc \
        VISU_Result_i.cc \
@@ -74,7 +78,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 \
@@ -85,6 +89,9 @@ libVISUEngineImpl_la_SOURCES = \
        VISU_Table_i.cc \
        VISU_PointMap3d_i.cc \
        VISU_DumpPython.cc \
+       VISU_MonoColorPrs_i.cc \
+       VISU_Deformation_i.cc \
+       VISU_OptionalDeformation_i.cc \
        SALOME_GenericObjPointer.cc
 
 MOC_FILES = VISU_TimeAnimation_moc.cxx
index 2ff2fd7f4a61545601e3e9caeea682b436ebe014..073d07c895fef1e0f0119587355241f384d2ad0e 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 76fee4fba7b1f82fbd1d4843fb2cbe8c4404bdb9..9e833c82d6324beb75a27722a235efe4217107a7 100644 (file)
@@ -47,6 +47,8 @@
 
 #include <QtGlobal>
 
+#include "utilities.h"
+
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
@@ -390,7 +392,7 @@ VISU::ColoredPrs3dCache_i
 ::CreateHolder(VISU::VISUType theType,
               const VISU::ColoredPrs3dHolder::BasicInput& theInput)
 {
-  if(MYDEBUG) cout << "CreateHolder " << theType << endl;
+  if(MYDEBUG) MESSAGE ("CreateHolder "<<theType);
   CORBA::Float aRequiredMemory = 0.0;
   if(IsPossible(theType, theInput, aRequiredMemory, "")){
     if(VISU::ColoredPrs3d_i* aColoredPrs3d = CreateColoredPrs3d(theType, theInput)){
@@ -502,7 +504,7 @@ VISU::ColoredPrs3dCache_i
 ::RegisterInHolder(VISU::ColoredPrs3d_i* thePrs3d,
                   const std::string& theHolderEntry)
 {
-  if(MYDEBUG) cout << "RegisterInHolder " << theHolderEntry.c_str() << " " << thePrs3d << endl;
+  if(MYDEBUG) MESSAGE("RegisterInHolder "<<theHolderEntry.c_str()<<" "<<thePrs3d);
   if(thePrs3d){
     TPrs3dPtr aPrs3d(thePrs3d);
     myHolderMap[theHolderEntry].push_front(aPrs3d);  
@@ -540,7 +542,7 @@ VISU::ColoredPrs3dCache_i
 ::GetLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder)
 {
   const TLastVisitedPrsList& aList = GetLastVisitedPrsList(theHolder);
-  if(MYDEBUG) cout << "GetLastVisitedPrs " << theHolder->GetEntry().c_str() << " " << aList.size() << endl;
+  if(MYDEBUG) MESSAGE("GetLastVisitedPrs " << theHolder->GetEntry().c_str() << " " << aList.size() );
   if( !aList.empty() )
     return aList.front();
   return VISU::TPrs3dPtr();
@@ -622,7 +624,7 @@ VISU::ColoredPrs3dCache_i
                       const VISU::ColoredPrs3dHolder::BasicInput& theInput,
                       VISU::View3D_ptr theView3D)
 {
-  if(MYDEBUG) cout << "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" << endl;
+  if(MYDEBUG) MESSAGE( "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" );
   TPrs3dPtr aPrs3d;
   try{
     TPrs3dPtr aLastVisitedPrs3d = GetLastVisitedPrs(theHolder);
@@ -633,12 +635,12 @@ VISU::ColoredPrs3dCache_i
     CORBA::Float aRequiredMemory = 0.0;
     if(aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput)){
       aLastVisitedPrsList.push_front(aPrs3d);
-      if(MYDEBUG) cout << "FindPrsByInput " << aPrs3d << endl;
+      if(MYDEBUG) MESSAGE( "FindPrsByInput " << aPrs3d );
     }else if(anIsCheckPossible && IsPossible(aPrsType, theInput, aRequiredMemory, aHolderEntry)){
       if( aRequiredMemory > 1.0 / VTK_LARGE_FLOAT )
        ClearMemory(aRequiredMemory, aHolderEntry);
       aPrs3d = CreatePrs(aPrsType, theInput, theHolder);
-      if(MYDEBUG) cout << "Created " << aPrs3d << endl;
+      if(MYDEBUG) MESSAGE( "Created " << aPrs3d );
     }else{
       aPrs3d = aLastVisitedPrsList.back();
       aPrs3d->SetResultObject(theInput.myResult);
@@ -648,12 +650,21 @@ VISU::ColoredPrs3dCache_i
       aPrs3d->SetTimeStampNumber(theInput.myTimeStampNumber);
       aLastVisitedPrsList.pop_back();
       aLastVisitedPrsList.push_front(aPrs3d);
-      if(MYDEBUG) cout << "Move only " << aPrs3d << endl;
+      if(MYDEBUG) MESSAGE( "Move only " << aPrs3d );
     }
     //if(MYDEBUG) PrintCache();
     
     aPrs3d->SameAs(thePrs);
-    aPrs3d->UpdateActors();
+    
+    // special case for deformed shape
+    VISU::DeformedShapeAndScalarMap_i* dShape =
+      dynamic_cast<VISU::DeformedShapeAndScalarMap_i*>( aPrs3d.get() );
+    if ( dShape && dShape->GetScalarTimeStampNumber() != theInput.myTimeStampNumber )
+    {
+      dShape->SetScalarField( dShape->GetScalarEntity(),
+        dShape->GetScalarFieldName(), theInput.myTimeStampNumber );            
+    }                    
+
     if(CORBA::is_nil(theView3D))
       return false;
 
@@ -697,6 +708,8 @@ VISU::ColoredPrs3dCache_i
 
            aPrs3d->SetActiveState(true);
          }
+
+         aPrs3d->UpdateActors();
          ProcessVoidEvent(new TRenderEvent(aViewWindow));
          //aViewWindow->getRenderWindow()->Render();
          return true;
@@ -761,8 +774,8 @@ VISU::ColoredPrs3dCache_i
 {
   if(MYDEBUG)
   {
-    cout << "--------------CACHE-----------------" << endl;
-    cout << "Cache memory - " << GetMemorySize() << " Mb" << endl;
+    MESSAGE_BEGIN(std::endl << "--------------CACHE-----------------" );
+    MESSAGE_ADD(std::endl << "Cache memory - " << GetMemorySize() << " Mb" );
     TColoredPrs3dHolderMap::const_iterator aHolderIter = myHolderMap.begin();
     TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = myHolderMap.end();
     for(; aHolderIter != aHolderIterEnd; aHolderIter++){
@@ -770,19 +783,18 @@ VISU::ColoredPrs3dCache_i
       TLastVisitedPrsList::const_iterator aPrsIter = aPrsList.begin();
       TLastVisitedPrsList::const_iterator aPrsIterEnd = aPrsList.end();
 
-      cout << "--------------------------" << endl;
-      cout << "Holder - " << aHolderIter->first.c_str() << endl;
-      cout << "Size   - " << aPrsList.size() << endl;
+      MESSAGE_ADD(std::endl << "--------------------------" );
+      MESSAGE_ADD(std::endl <<  "Holder - " << aHolderIter->first.c_str() );
+      MESSAGE_ADD(std::endl <<  "Size   - " << aPrsList.size() );
       for(; aPrsIter != aPrsIterEnd; aPrsIter++)
        if(TPrs3dPtr aPrs3d = *aPrsIter)
        {
-         cout << aPrs3d << " (" << aPrs3d->GetMemorySize() << " Mb)";
+         MESSAGE_ADD(std::endl <<  aPrs3d << " (" << aPrs3d->GetMemorySize() << " Mb)");
          if(aPrsIter == aPrsList.begin())
-           cout << " (device)";
-         cout << endl;
+           MESSAGE_ADD( " (device)" );
        }
     }
-    cout << "------------------------------------" << endl;
+    MESSAGE_END(std::endl <<  "------------------------------------" );
   }
 }
 
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;
     
 
index 2bdb127f3236bd08f4efd7986a67065e32fe7db1..787eba58d4dfb0bafb68cdd58b62ca17f5714ec0 100644 (file)
@@ -170,6 +170,12 @@ VISU::ColoredPrs3d_i::
 ColoredPrs3d_i(EPublishInStudyMode thePublishInStudyMode) :
   myPublishInStudyMode(thePublishInStudyMode),
   myIsTimeStampFixed(thePublishInStudyMode == EPublishUnderTimeStamp),
+  myEntity( VISU::Entity( -1 ) ),
+  myPreviousEntity( VISU::Entity( -1 ) ),
+  myTimeStampNumber( -1 ),
+  myPreviousTimeStampNumber( -1 ),
+  myIsUnits( true ),
+  myOrientation( VISU::ColoredPrs3dBase::HORIZONTAL ),
   myColoredPL(NULL),
   myIsFixedRange(false),
   myIsRestored(true)
@@ -341,7 +347,7 @@ void
 VISU::ColoredPrs3d_i
 ::SetEntity(VISU::Entity theEntity)
 {
-  if(myEntity == theEntity)
+  if ( myEntity == theEntity )
     return;
 
   VISU::TSetModified aModified(this);
@@ -425,7 +431,7 @@ void
 VISU::ColoredPrs3d_i
 ::SetTimeStampNumber(CORBA::Long theTimeStampNumber)
 {
-  if(myTimeStampNumber == theTimeStampNumber)
+  if ( myTimeStampNumber == theTimeStampNumber )
     return;
 
   VISU::TSetModified aModified(this);
@@ -710,14 +716,14 @@ VISU::ColoredPrs3d_i
     SetShadowTitle(anOrigin->IsShadowTitle());
     SetTitFontType(anOrigin->GetTitFontType());
     vtkFloatingPointType r,g,b;
-    anOrigin->GetTitleColor(&r,&g,&b);
+    anOrigin->GetTitleColor(r,g,b);
     SetTitleColor(r,g,b);
     
     SetBoldLabel(anOrigin->IsBoldLabel());
     SetItalicLabel(anOrigin->IsItalicLabel());
     SetShadowLabel(anOrigin->IsShadowLabel());
     SetLblFontType(anOrigin->GetLblFontType());
-    anOrigin->GetLabelColor(&r,&g,&b);
+    anOrigin->GetLabelColor(r,g,b);
     SetLabelColor(r,g,b);
 
     myIsTimeStampFixed = anOrigin->IsTimeStampFixed();
@@ -931,7 +937,7 @@ void
 VISU::ColoredPrs3d_i
 ::SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theOrientation)
 {
-  if(myOrientation == theOrientation)
+  if ( myOrientation == theOrientation )
     return;
 
   VISU::TSetModified aModified(this);
@@ -1177,13 +1183,15 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::SetUnitsVisible(CORBA::Boolean isVisible)
+::SetUnitsVisible(CORBA::Boolean theIsVisible)
 {
-  if( myIsUnits != isVisible ){
-    VISU::TSetModified aModified(this);
-    myIsUnits = isVisible;
-    myParamsTime.Modified();
-  }
+  if ( myIsUnits == theIsVisible ) 
+    return;
+
+  VISU::TSetModified aModified( this );
+
+  myIsUnits = theIsVisible;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -1293,13 +1301,13 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::GetTitleColor(vtkFloatingPointType* theR, 
-               vtkFloatingPointType* theG, 
-               vtkFloatingPointType* theB)
+::GetTitleColor(vtkFloatingPointType& theR, 
+               vtkFloatingPointType& theG, 
+               vtkFloatingPointType& theB)
 {
-  *theR = myTitleColor[0]; 
-  *theG = myTitleColor[1]; 
-  *theB = myTitleColor[2];
+  theR = myTitleColor[0]; 
+  theG = myTitleColor[1]; 
+  theB = myTitleColor[2];
 }
 
 //----------------------------------------------------------------------------
@@ -1414,13 +1422,13 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::GetLabelColor(vtkFloatingPointType* theR, 
-               vtkFloatingPointType* theG, 
-               vtkFloatingPointType* theB)
+::GetLabelColor(vtkFloatingPointType& theR, 
+               vtkFloatingPointType& theG, 
+               vtkFloatingPointType& theB)
 {
-  *theR = myLabelColor[0]; 
-  *theG = myLabelColor[1]; 
-  *theB = myLabelColor[2];
+  theR = myLabelColor[0]; 
+  theG = myLabelColor[1]; 
+  theB = myLabelColor[2];
 }
 
 //----------------------------------------------------------------------------
@@ -1593,9 +1601,11 @@ VISU::ColoredPrs3d_i
 
   QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
 
-  myTitleColor[0] = aTextColor.red()   / 255;
-  myTitleColor[1] = aTextColor.green() / 255;
-  myTitleColor[2] = aTextColor.blue()  / 255;
+  SetTitleColor(aTextColor.red()/255., aTextColor.green()/255., aTextColor.blue()/255.);
+               
+  myTitleColor[0] = aTextColor.red()   / 255.;
+  myTitleColor[1] = aTextColor.green() / 255.;
+  myTitleColor[2] = aTextColor.blue()  / 255.;
 
   myIsBoldLabel = myIsItalicLabel = myIsShadowLabel = true;
   myLblFontType = VTK_ARIAL;
@@ -1616,9 +1626,11 @@ VISU::ColoredPrs3d_i
 
   QColor aLabelColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
 
-  myLabelColor[0] = aLabelColor.red()   / 255;
-  myLabelColor[1] = aLabelColor.green() / 255;
-  myLabelColor[2] = aLabelColor.blue()  / 255;
+  SetLabelColor(aLabelColor.red()/255., aLabelColor.green()/255., aLabelColor.blue()/255.);
+
+  myLabelColor[0] = aLabelColor.red()   / 255.;
+  myLabelColor[1] = aLabelColor.green() / 255.;
+  myLabelColor[2] = aLabelColor.blue()  / 255.;
 
   return this;
 }
index 501776938a416bf0d78cea5383a142684e70c435..9046637c40d5369683d74bf5c7fc7fb0ed6a5204 100644 (file)
@@ -483,9 +483,9 @@ namespace VISU
 
     virtual 
     void
-    GetTitleColor(vtkFloatingPointType* theR, 
-                 vtkFloatingPointType* theG, 
-                 vtkFloatingPointType* theB);
+    GetTitleColor(vtkFloatingPointType& theR, 
+                 vtkFloatingPointType& theG, 
+                 vtkFloatingPointType& theB);
     
     virtual
     void
@@ -527,9 +527,9 @@ namespace VISU
 
     virtual 
     void
-    GetLabelColor(vtkFloatingPointType* theR, 
-                 vtkFloatingPointType* theG, 
-                 vtkFloatingPointType* theB);
+    GetLabelColor(vtkFloatingPointType& theR, 
+                 vtkFloatingPointType& theG, 
+                 vtkFloatingPointType& theB);
 
     virtual
     void
index 385ca3f2ef96ee969d3f1f09ff89ef083c9d2a31..1bdcf0aee560b3ba0aafed51c8c8ed1a3961403a 100644 (file)
@@ -37,6 +37,8 @@
 #include "ReceiverFactory.hxx"
 #include "MED_SliceArray.hxx"
 
+#include "utilities.h"
+
 #define USER_INTERLACE MED_FULL_INTERLACE
 
 #ifdef _DEBUG_
@@ -588,13 +590,13 @@ namespace
          else
            aGeom2ProfileIds = aSupport->getNumberFromFile(aMGeom);
          int aLen = aGeom2ProfileIds->length();
-         if(MYDEBUG) MESSAGE(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
+         if(MYDEBUG) MESSAGE_BEGIN(" - aMGeom="<<aMGeom<<"; aNbCells="<<aLen);
          for(int i = 0; i < aLen; i++){
            int anId = aGeom2ProfileIds[i];
            aGeom2Profile.push_back(anId);
-           if(MYDEBUG) cout << "------------------------------->" << anId << endl;
+           if(MYDEBUG) MESSAGE_ADD(std::endl << "------------------------------->" << anId);
          }
-         if(MYDEBUG) cout << endl;
+         if(MYDEBUG) MESSAGE_END(" ");
        } catch(...) {
          continue;
        }
index cdb551773530dd146c0dad7b8e68cc63add70e5a..e329711ccbb78b8f87ea1835db776c6641a9fb0a 100644 (file)
@@ -102,6 +102,7 @@ VISU::CutLines_i::
 CutLines_i(EPublishInStudyMode thePublishInStudyMode) :
   ColoredPrs3d_i(thePublishInStudyMode),
   ScalarMap_i(thePublishInStudyMode),
+  myUseAbsLength( false ),
   myCutLinesPL(NULL)
 {}
 
@@ -551,7 +552,7 @@ void
 VISU::CutLines_i
 ::SetUseAbsoluteLength(CORBA::Boolean theAbsLength)
 {
-  if(myUseAbsLength == theAbsLength)
+  if ( myUseAbsLength == theAbsLength )
     return;
 
   VISU::TSetModified aModified(this);
index 55856310070aa61215f450060b7a13e4470c345e..4592dea6de4bfbb880dee0eb7d22542e1d2297de 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_CutPlanesPL.hxx"
+#include "VISU_Convertor.hxx"
 #include "VISU_Prs3dUtils.hh"
 #include "VISU_CutPlanes_i.hh"
 
@@ -41,6 +42,7 @@ static int MYDEBUG = 0;
 #endif
 
 
+
 //----------------------------------------------------------------------------
 size_t 
 VISU::CutPlanes_i
@@ -95,8 +97,12 @@ VISU::CutPlanes_i
 ::CutPlanes_i(EPublishInStudyMode thePublishInStudyMode):
   ColoredPrs3d_i(thePublishInStudyMode),
   ScalarMap_i(thePublishInStudyMode),
-  myCutPlanesPL(NULL)
-{}
+  myCutPlanesPL(NULL),
+  Deformation_i(this),
+  OptionalDeformation_i(this)
+{
+  if(MYDEBUG) MESSAGE("CutPlanes_i::CutPlanes_i()");
+}
 
 
 //----------------------------------------------------------------------------
@@ -131,6 +137,8 @@ VISU::CutPlanes_i
     if(aCondList[i].toInt() == 0)
       SetPlanePosition(i,aPosList[i].toDouble());
 
+  OptionalDeformation_i::RestoreDeformation(theSObject,theMap);
+  
   return this;
 }
 
@@ -152,6 +160,7 @@ void VISU::CutPlanes_i::ToStream(std::ostringstream& theStr){
   }
   Storable::DataToStream( theStr, "myPlanePosition",  (const char*)aStrPos.toLatin1());
   Storable::DataToStream( theStr, "myPlaneCondition", (const char*)aStrCon.toLatin1());
+  OptionalDeformation_i::DeformationToStream(theStr);
 }
 
 
@@ -321,6 +330,7 @@ VISU::CutPlanes_i
   }else
     myCutPlanesPL = dynamic_cast<VISU_CutPlanesPL*>(thePipeLine);
 
+  InitDeformedPipeLine(myCutPlanesPL);
   TSuperClass::CreatePipeLine(myCutPlanesPL);
 }
 
@@ -348,3 +358,10 @@ VISU::CutPlanes_i
   return NULL;
 }
 
+void
+VISU::CutPlanes_i::
+SameAs(const Prs3d_i* theOrigin){
+  if(MYDEBUG) MESSAGE("CutPlanes_i::SameAs()");
+  TSuperClass::SameAs(theOrigin);
+  OptionalDeformation_i::SameAsDeformation(dynamic_cast<const Deformation_i*>(theOrigin));
+}
index 9386f9f3ea241aef07e830b6d8aeeb9dbcdf86ab..8a5f9355d9510828ba3c478b92509e46fb287650 100644 (file)
@@ -28,6 +28,7 @@
 #define VISU_CutPlanes_i_HeaderFile
 
 #include "VISU_ScalarMap_i.hh"
+#include "VISU_OptionalDeformation_i.hh"
 
 class VISU_CutPlanesPL;
 
@@ -35,7 +36,8 @@ namespace VISU
 {
   //----------------------------------------------------------------------------
   class VISU_I_EXPORT CutPlanes_i : public virtual POA_VISU::CutPlanes,
-                                   public virtual ScalarMap_i
+                                   public virtual ScalarMap_i,
+                                   public virtual OptionalDeformation_i
   {
     static int myNbPresent;
     CutPlanes_i(const CutPlanes_i&);
@@ -157,6 +159,10 @@ namespace VISU
     Restore(SALOMEDS::SObject_ptr theSObject,
            const Storable::TRestoringMap& theMap);
 
+    virtual 
+    void
+    SameAs(const Prs3d_i* theOrigin);
+
     //! Redefines VISU_ColoredPrs3d_i::CreateActor
     virtual 
     VISU_Actor* 
diff --git a/src/VISU_I/VISU_Deformation_i.cc b/src/VISU_I/VISU_Deformation_i.cc
new file mode 100755 (executable)
index 0000000..507a947
--- /dev/null
@@ -0,0 +1,166 @@
+//  Copyright (C) 2008  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_Deformation_i.cc
+//  Author : 
+//  Module : VISU
+
+#include "VISU_Deformation_i.hh"
+#include "VISU_Result_i.hh"
+#include "VISU_Prs3dUtils.hh"
+
+#include "VISU_DeformationPL.hxx"
+#include "VISU_Convertor.hxx"
+#include "VISU_DeformationPL.hxx"
+#include "VISUConfig.hh"
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+//---------------------------------------------------------------
+VISU::Deformation_i::Deformation_i(VISU::ColoredPrs3d_i *thePrs3d):
+  myColoredPrs3d(thePrs3d)
+{
+  if(MYDEBUG) MESSAGE("Deformation_i::Deformation_i()");
+}
+
+//---------------------------------------------------------------
+VISU::Deformation_i::~Deformation_i()
+{
+  if(MYDEBUG) MESSAGE("Deformation_i::~Deformation_i()");
+}
+
+//---------------------------------------------------------------
+void VISU::Deformation_i::SetScale(CORBA::Double theScale)
+{
+  if(MYDEBUG) MESSAGE("Deformation_i::SetScale()");
+
+  VISU::TSetModified aModified(GetColoredPrs3d());
+
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformationPL, vtkFloatingPointType>
+                  (GetSpecificDeformedPL(), &VISU_DeformationPL::SetScale, theScale));
+}
+
+//---------------------------------------------------------------
+void VISU::Deformation_i::InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine){
+  
+  if(MYDEBUG) MESSAGE("Deformation_i::InitDeformedPipeLine()");
+  myDeformationPL = theDeformedPipeLine;
+}
+
+//---------------------------------------------------------------
+CORBA::Double 
+VISU::Deformation_i
+::GetScale()
+{
+  if(MYDEBUG) MESSAGE("Deformation_i::GetScale()");
+  return GetSpecificDeformedPL()->GetScale();
+}
+
+//---------------------------------------------------------------
+VISU::Entity VISU::Deformation_i::GetVectorialFieldEntity(){
+  return myVectorialEntity;
+}
+
+//---------------------------------------------------------------
+char* VISU::Deformation_i::GetVectorialFieldName(){
+  return CORBA::string_dup(myVectorialFieldName.c_str());
+}
+
+//---------------------------------------------------------------
+void VISU::Deformation_i::
+DeformationToStream(std::ostringstream& theStr)
+{
+  Storable::DataToStream(theStr,"myScaleFactor", GetScale());
+  Storable::DataToStream(theStr,"myVectorialField", GetVectorialFieldName());
+  Storable::DataToStream(theStr,"myVectorialEntiry", GetVectorialFieldEntity());
+
+}
+
+//---------------------------------------------------------------
+void
+VISU::Deformation_i::RestoreDeformation(SALOMEDS::SObject_ptr theSObject,
+                                       const Storable::TRestoringMap& theMap)
+{
+  SetScale(VISU::Storable::FindValue(theMap,"myScaleFactor").toDouble());
+  VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap, "myVectorialEntiry").toInt());
+  
+  SetVectorialField(anEntity,
+                   VISU::Storable::FindValue(theMap, "myVectorialField").toLatin1().constData()); 
+}
+
+//---------------------------------------------------------------
+void
+VISU::Deformation_i::SameAsDeformation(const Deformation_i *aDeformedPrs){
+  if(const Deformation_i* aPrs = dynamic_cast<const Deformation_i*>(aDeformedPrs)) {
+    Deformation_i* anOrigin = const_cast<Deformation_i*>(aPrs);
+    
+    CORBA::String_var aVectorialFieldName = anOrigin->GetVectorialFieldName();
+    VISU::Entity anEntity = anOrigin->GetVectorialFieldEntity();
+    this->SetVectorialField(anEntity,
+                           aVectorialFieldName);
+    this->SetScale(anOrigin->GetScale());
+  }
+}
+
+void VISU::Deformation_i::SetVectorialField(Entity theEntity, const char* theFieldName){
+  if(MYDEBUG) MESSAGE("CutPlanes_i::SetVectorialField()");
+
+  bool anIsModified = false;
+  if(!anIsModified)
+    anIsModified |= GetVectorialFieldEntity() != theEntity;
+  
+  if(!anIsModified)
+    anIsModified |= GetVectorialFieldName() != theFieldName;
+
+  if(!anIsModified)
+    return;
+
+  ColoredPrs3d_i *aColoredPrs = GetColoredPrs3d();
+  int aTimeStampNumber = aColoredPrs->GetTimeStampNumber();
+
+  VISU::TEntity aEntity = VISU::TEntity(theEntity);
+
+  VISU::Result_i::PInput anInput = aColoredPrs->GetCResult()->GetInput(aColoredPrs->GetCMeshName(),
+                                                                      theEntity,
+                                                                      theFieldName,
+                                                                      aTimeStampNumber);
+
+  PField aVectorialField = anInput->GetField(aColoredPrs->GetCMeshName(), aEntity, theFieldName);
+
+  VISU::PUnstructuredGridIDMapper anIDMapper = 
+    anInput->GetTimeStampOnMesh(aColoredPrs->GetCMeshName(),
+                               aEntity,
+                               theFieldName,
+                               aTimeStampNumber);
+  if(GetSpecificDeformedPL() && anIDMapper) {
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformationPL, VISU::PUnstructuredGridIDMapper>
+                    (GetSpecificDeformedPL(), &VISU_DeformationPL::SetVectorialField, anIDMapper));
+    
+    VISU::TSetModified aModified(GetColoredPrs3d());
+    
+    myVectorialEntity = theEntity;
+    myVectorialFieldName = theFieldName;
+    myVectorialField = anIDMapper;
+  }
+};
diff --git a/src/VISU_I/VISU_Deformation_i.hh b/src/VISU_I/VISU_Deformation_i.hh
new file mode 100755 (executable)
index 0000000..821b273
--- /dev/null
@@ -0,0 +1,103 @@
+//  Copyright (C) 2008  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_Deformation_i.hxx
+//  Author : 
+//  Module : VISU
+
+#ifndef VISU_Deformation_i_HeaderFile
+#define VISU_Deformation_i_HeaderFile
+
+#include "VISU_I.hxx"
+#include "VISU_ColoredPrs3d_i.hh"
+#include "VISU_DeformationPL.hxx"
+
+
+
+namespace VISU{
+
+  class VISU_I_EXPORT Deformation_i : public virtual POA_VISU::Deformation
+  {
+    Deformation_i(const Deformation_i&);
+  public:
+    typedef VISU::Deformation TInterface;
+
+    Deformation_i(VISU::ColoredPrs3d_i* theColoredPrs3d);
+    virtual ~Deformation_i();
+
+    virtual 
+    void
+    SetScale(CORBA::Double theScale);
+
+    virtual
+    CORBA::Double 
+    GetScale();
+
+    virtual
+    void
+    DeformationToStream(std::ostringstream& theStr);
+
+    virtual
+    void
+    RestoreDeformation(SALOMEDS::SObject_ptr theSObject,
+           const Storable::TRestoringMap& theMap);
+
+    virtual 
+    void 
+    SameAsDeformation(const Deformation_i *aDeformedPrs);
+
+    virtual
+    VISU::Entity
+    GetVectorialFieldEntity();
+
+    virtual
+    char* 
+    GetVectorialFieldName();
+
+    virtual void SetVectorialField(Entity theEntity, const char* theFieldName);
+
+  protected:
+    virtual
+    void
+    InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine);
+
+    VISU_DeformationPL*
+    GetSpecificDeformedPL() const
+    { 
+      return myDeformationPL; 
+    }
+
+    ColoredPrs3d_i* GetColoredPrs3d(){
+      return myColoredPrs3d;
+    }
+    
+    
+  private:
+    VISU_DeformationPL *myDeformationPL;
+
+    PField myVectorialField;
+    VISU::Entity myVectorialEntity;
+    std::string myVectorialFieldName;
+    ColoredPrs3d_i *myColoredPrs3d;
+    
+  };
+}
+
+#endif
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..9667e0c
--- /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.h"
+
+#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.toLatin1().constData(),
+                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 de8f43cf8e82bc0ff64e7c6899e427e38c08c56f..a481198252600b70fc719c6325e101070786d38d 100644 (file)
@@ -123,6 +123,7 @@ VISU::DeformedShape_i
 ::DeformedShape_i(EPublishInStudyMode thePublishInStudyMode):
   ColoredPrs3d_i(thePublishInStudyMode),
   ScalarMap_i(thePublishInStudyMode),
+  MonoColorPrs_i(thePublishInStudyMode),
   myDeformedShapePL(NULL)
 {
   if(MYDEBUG) MESSAGE("DeformedShape_i::DeformedShape_i");
@@ -151,8 +152,6 @@ VISU::DeformedShape_i
         const std::string& theFieldName, 
         CORBA::Long theTimeStampNumber)
 {
-  myIsColored = false;
-  myColor.R = myColor.G = myColor.B = 0.5;
   return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
 }
 
@@ -167,10 +166,6 @@ VISU::DeformedShape_i
     return NULL;
 
   SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
-  myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").toInt();
-  myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
-  myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
-  myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
 
   return this;
 }
@@ -184,11 +179,6 @@ VISU::DeformedShape_i
   TSuperClass::ToStream(theStr);
 
   Storable::DataToStream( theStr, "myFactor", GetScale() );
-
-  Storable::DataToStream( theStr, "myIsColored", myIsColored );
-  Storable::DataToStream( theStr, "myColor.R", myColor.R );
-  Storable::DataToStream( theStr, "myColor.G", myColor.G );
-  Storable::DataToStream( theStr, "myColor.B", myColor.B );
 }
 
 
@@ -220,54 +210,6 @@ VISU::DeformedShape_i
 }
 
 
-//---------------------------------------------------------------
-CORBA::Boolean 
-VISU::DeformedShape_i
-::IsColored()
-{
-  return myIsColored;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShape_i
-::ShowColored(CORBA::Boolean theColored)
-{
-  if(myIsColored == theColored)
-    return;
-
-  myIsColored = theColored; 
-  myParamsTime.Modified();
-}
-
-//---------------------------------------------------------------
-SALOMEDS::Color 
-VISU::DeformedShape_i
-::GetColor()
-{
-  return myColor;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShape_i
-::SetColor(const SALOMEDS::Color& theColor)
-{
-  bool anIsSameValue = VISU::CheckIsSameValue(myColor.R, theColor.R);
-  anIsSameValue &= VISU::CheckIsSameValue(myColor.G, theColor.G);
-  anIsSameValue &= VISU::CheckIsSameValue(myColor.B, theColor.B);
-  if(anIsSameValue)
-    return;
-
-  VISU::TSetModified aModified(this);
-  
-  myColor = theColor;
-  myParamsTime.Modified();
-}
-
-
 //---------------------------------------------------------------
 void
 VISU::DeformedShape_i
@@ -321,34 +263,7 @@ VISU::DeformedShape_i
   bool toShrink  = aResourceMgr->booleanValue("VISU", "deformed_shape_shrink", false);
   anActor->SetRepresentation(aDispMode);
   if (toShrink && !toSupressShrinking) anActor->SetShrink();
-  anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
   return anActor;
 }
 
 
-//---------------------------------------------------------------
-VISU_Actor* 
-VISU::DeformedShape_i
-::CreateActor() 
-{
-  return CreateActor(false);
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShape_i
-::UpdateActor(VISU_Actor* theActor) 
-{
-  if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
-    if(IsColored()){
-      anActor->SetBarVisibility(true);
-      GetPipeLine()->GetMapper()->SetScalarVisibility(1);
-    }else{
-      anActor->SetBarVisibility(false);
-      GetPipeLine()->GetMapper()->SetScalarVisibility(0);
-      anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
-    }
-    TSuperClass::UpdateActor(theActor);
-  }
-}
index 1f5d90c78c5cd6513dd043d5fa90739bb6b4cbe0..96487209ea5f68f2246555daa8590f1f2640fa68 100644 (file)
@@ -28,7 +28,7 @@
 #define VISU_DeformedShape_i_HeaderFile
 
 #include <VISU_I.hxx>
-#include "VISU_ScalarMap_i.hh"
+#include "VISU_MonoColorPrs_i.hh"
 
 class VISU_DeformedShapePL;
 
@@ -36,14 +36,14 @@ namespace VISU
 {
   //----------------------------------------------------------------------------
   class VISU_I_EXPORT DeformedShape_i : public virtual POA_VISU::DeformedShape,
-                         public virtual ScalarMap_i
+                                       public virtual MonoColorPrs_i
   {
     static int myNbPresent;
     DeformedShape_i(const DeformedShape_i&);
 
   public:
     //----------------------------------------------------------------------------
-    typedef ScalarMap_i TSuperClass;
+    typedef MonoColorPrs_i TSuperClass;
     typedef VISU::DeformedShape TInterface;
 
     explicit
@@ -71,22 +71,6 @@ namespace VISU
     CORBA::Double 
     GetScale();
 
-    virtual 
-    CORBA::Boolean 
-    IsColored();
-
-    virtual 
-    void
-    ShowColored(CORBA::Boolean theColored);
-
-    virtual 
-    SALOMEDS::Color 
-    GetColor();
-
-    virtual
-    void
-    SetColor(const SALOMEDS::Color& theColor);
-
     VISU_DeformedShapePL* 
     GetSpecificPL() const
     { 
@@ -105,8 +89,6 @@ namespace VISU
     CheckIsPossible();
 
     VISU_DeformedShapePL *myDeformedShapePL;
-    SALOMEDS::Color myColor;
-    bool myIsColored;
 
   public:
     static
@@ -152,17 +134,10 @@ namespace VISU
     void
     SetMapScale(double theMapScale = 1.0);
 
-    virtual 
-    VISU_Actor* 
-    CreateActor();
-
     virtual 
     VISU_Actor* 
     CreateActor(bool toSupressShrinking);
 
-    virtual 
-    void
-    UpdateActor(VISU_Actor* theActor) ;
   };
 }
 
index 8c4f613fe096ed536ea41ebb273084c82165d7d2..93da7d73de5e9c6ff0a6132542431448f491cd81 100644 (file)
@@ -39,8 +39,9 @@
 #include "VISU_StreamLines_i.hh"
 #include "VISU_Plot3D_i.hh"
 #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"
 
@@ -415,6 +416,21 @@ namespace VISU
     return thePrefix;
   }
 
+  //---------------------------------------------------------------------------
+  std::string
+  MonoColorPrsToPython(SALOMEDS::SObject_ptr theSObject,
+                      VISU::MonoColorPrs_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;
+    theStr<<thePrefix<<theName<<".ShowColored("<<GetBoolean(theServant->IsColored())<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
+    return thePrefix;
+  }
 
   //---------------------------------------------------------------------------
   std::string
@@ -425,12 +441,12 @@ namespace VISU
                        TColoredPrs3dFactory& thePrsFactory,
                        std::string thePrefix)
   {
-    thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    thePrefix = MonoColorPrsToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
     theStr<<thePrefix<<endl;
 
     theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
-    theStr<<thePrefix<<theName<<".ShowColored("<<GetBoolean(theServant->IsColored())<<")"<<endl;
-    theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
+//     theStr<<thePrefix<<theName<<".ShowColored("<<GetBoolean(theServant->IsColored())<<")"<<endl;
+//     theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
 
     return thePrefix;
   }
@@ -446,7 +462,8 @@ namespace VISU
                      TColoredPrs3dFactory& thePrsFactory,
                      std::string thePrefix)
   {
-    thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    thePrefix = MonoColorPrsToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    //    thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
     theStr<<thePrefix<<endl;
     
     std::string aParam;
@@ -490,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;
@@ -594,6 +611,7 @@ namespace VISU
     theStr<<thePrefix<<endl;
 
     theStr<<thePrefix<<theName<<".SetNbSurfaces("<<theServant->GetNbSurfaces()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".ShowLabels("<<theServant->IsLabeled()<<","<<theServant->GetNbLabels()<<")"<<endl;
 
     return thePrefix;
   }
@@ -634,6 +652,27 @@ namespace VISU
        theStr<<thePrefix<<theName<<".SetPlanePosition("<<anId<<", "<<theServant->GetPlanePosition(anId)<<")"<<endl;
     }
 
+    theStr<<thePrefix<<theName<<".UseDeformation("<<GetBoolean(theServant->IsDeformed())<<")"<<endl;
+    if(theServant->IsDeformed()){
+      theStr<< thePrefix << theName << ".SetScale(" << theServant->GetScale()<<")"<<endl;
+      std::string aStringEntity;
+      VISU::Entity anEntity = theServant->GetVectorialFieldEntity();
+      switch(anEntity){
+      case NODE:
+       aStringEntity = "VISU.NODE";
+       break;
+      case EDGE:
+       aStringEntity = "VISU.EDGE";
+       break;
+      case FACE:
+       aStringEntity = "VISU.FACE";
+       break;
+      case CELL:
+       aStringEntity = "VISU.CELL";
+       break;
+      }
+      theStr<< thePrefix << theName << ".SetVectorialField("<<aStringEntity<<", '" << theServant->GetVectorialFieldName() <<"')"<<endl;
+    }
     return thePrefix;
   }
 
@@ -731,7 +770,6 @@ namespace VISU
     return thePrefix;
   }
 
-
   //---------------------------------------------------------------------------
   // declaration
   void DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
@@ -1232,9 +1270,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;
@@ -1285,6 +1324,78 @@ namespace VISU
             theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
+        case VISU::TPOINTMAP3D:
+          if (PointMap3d_i* aServant = dynamic_cast<PointMap3d_i*>(GetServant(anObj).in())) {
+           CORBA::Short aTag = theSObject->Tag();
+           theStr<<thePrefix<<"anIsFound, aSObject = "<<theArgumentName<<".FindSubObject("<<aTag<<")"<<endl;
+           theStr<<thePrefix<<"if anIsFound:"<<endl;
+           thePrefix += PREFIX;
+           
+           theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
+           theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+           
+           // Set name (as this object could be renamed by user)
+           theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
+
+           // Set PointMap3D Properties
+
+           theStr<<thePrefix<<aName<<".SetScaleFactor("<<aServant->GetScaleFactor()<<")"<<endl;
+           theStr<<thePrefix<<aName<<".SetContourPrs("<<aServant->GetIsContourPrs()<<")"<<endl;
+           theStr<<thePrefix<<aName<<".SetNbOfContours("<<aServant->GetNbOfContours()<<")"<<endl;
+
+           std::string aParam;
+           switch(aServant->GetScaling()){
+           case LINEAR:
+             aParam = "VISU.LINEAR";
+             break;
+           case LOGARITHMIC:
+             aParam = "VISU.LOGARITHMIC";
+             break;
+           }
+           theStr<<thePrefix<<aName<<".SetScaling("<<aParam<<")"<<endl;
+
+           theStr<<thePrefix<<aName<<".SetNbColors("<<aServant->GetNbColors()<<")"<<endl;
+           theStr<<thePrefix<<aName<<".SetLabels("<<aServant->GetLabels()<<")"<<endl;
+
+           switch(aServant->GetBarOrientation()){
+           case ColoredPrs3dBase::HORIZONTAL:
+             aParam = "VISU.ColoredPrs3d.HORIZONTAL";
+             break;
+           case ColoredPrs3dBase::VERTICAL:
+             aParam = "VISU.ColoredPrs3d.VERTICAL";
+             break;
+           }
+           theStr<<thePrefix<<aName<<".SetBarOrientation("<<aParam<<")"<<endl;
+
+           if(aServant->IsRangeFixed())
+             theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<", "<<aServant->GetMax()<<")"<<endl;
+           else
+             theStr<<thePrefix<<aName<<".SetSourceRange()"<<endl;
+
+           theStr<<thePrefix<<aName<<".SetPosition("<<aServant->GetPosX()<<", "<<aServant->GetPosY()<<")"<<endl;
+           theStr<<thePrefix<<aName<<".SetSize("<<aServant->GetWidth()<<", "<<aServant->GetHeight()<<")"<<endl;
+
+           float dx, dy, dz;
+           aServant->GetOffset(dx, dy, dz);
+           theStr<<thePrefix<<aName<<".SetOffset("<<dx<<", "<<dy<<", "<<dz<<")"<<endl;
+
+           
+           theStr<<thePrefix<<endl;
+           
+           theArgumentName = aName;
+           DumpChildrenToPython(theStudy,
+                                theIsPublished,
+                                theIsValidScript,
+                                theSObject,
+                                theStr,
+                                theName2EntryMap,
+                                theEntry2NameMap,
+                                theArgumentName,
+                                thePrefix);
+
+           theStr<<thePrefix<<"pass"<<endl<<endl;
+          }
+          return;
         case VISU::TGAUSSPOINTS:
           if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
            TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
@@ -1721,8 +1832,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 d8f465cec9fad7eb20048c8c3d71f0ab2eef34bc..cbb1fe7fb8db2fb89bc93944194aaa66ebcf20ae 100644 (file)
@@ -892,7 +892,7 @@ VISU::GaussPoints_i
   vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty();
   aTitleProp->SetFontFamily(GetTitFontType());
 
-  GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+  GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
   aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
   IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
@@ -902,7 +902,7 @@ VISU::GaussPoints_i
   vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty();
   aLabelProp->SetFontFamily(GetLblFontType());
 
-  GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+  GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
   aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
   IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
index f4ccad96ded5e50cb1f6962f9e0c1bc1933ce349..0732d55896f97f31208498c2fb378c061f1522f2 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));
@@ -968,7 +968,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  ScalarMapOnDeformedShape_ptr 
+  DeformedShapeAndScalarMap_ptr 
   VISU_Gen_i
   ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
                                    const char* theMeshName,
@@ -976,11 +976,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();
   }
   
 
@@ -1150,7 +1167,9 @@ namespace VISU
   VISU_Gen_i
   ::CreateTable(const char* theTableEntry)
   {
-    if(myStudyDocument->GetProperties()->IsLocked())
+    TCollection_AsciiString tmp( (char*)theTableEntry ); // 11.06.2008 IPAL18844
+    if( myStudyDocument->GetProperties()->IsLocked() ||
+       tmp.Length()==0 )
       return Table::_nil();
 
     return ProcessEvent(new CreateTableEvent(myStudyDocument, theTableEntry));
@@ -1375,12 +1394,11 @@ namespace VISU
       SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
     if(MYDEBUG) MESSAGE("Result_i::PasteInto - aListOfFileNames->length() = "<<aListOfFileNames->length());
     
-    std::string aLocalPersistentID;
+    std::ostrstream aLocalPersistentID;
     {
       std::string aCopyPersist =  aTmpDir + "copy_persistent";
-      std::ifstream anInputFileStream(aCopyPersist.c_str());
-      anInputFileStream>>aLocalPersistentID;
-      anInputFileStream.close();
+      std::ifstream anInputFileStream( aCopyPersist.c_str() );
+      anInputFileStream >> aLocalPersistentID.rdbuf();
     }
     
     //Just for Result::Restore to find the Comment attribute :(
@@ -1389,7 +1407,7 @@ namespace VISU
     std::string aFileName(aTmpDir);
     if(aListOfFileNames->length() > 1)
       aFileName += aListOfFileNames[1].in();
-    Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID, aFileName, false);
+    Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID.str(), aFileName, false);
     
     SALOMEDS::ListOfFileNames_var aFilesToRemove = new SALOMEDS::ListOfFileNames;
     aFilesToRemove->length(1);
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"
index 30b0159266d1b8ab8076f8e37eefc9c226d708e2..90e3b18adfd5e156db05c6086fb120acd29d0ddb 100644 (file)
 #include "VISU_IsoSurfacesPL.hxx"
 #include "VISU_Result_i.hh"
 #include "VISU_Actor.h"
+#include "VISU_ScalarMapAct.h"
+#include "VISU_IsoSurfActor.h"
 
 #include "SUIT_ResourceMgr.h"
 #include "SALOME_Event.h"
+#include <vtkMapper.h>
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -94,7 +97,10 @@ VISU::IsoSurfaces_i
 ::IsoSurfaces_i(EPublishInStudyMode thePublishInStudyMode) :
   ColoredPrs3d_i(thePublishInStudyMode),
   ScalarMap_i(thePublishInStudyMode),
-  myIsoSurfacesPL(NULL)
+  MonoColorPrs_i(thePublishInStudyMode),
+  myIsoSurfacesPL(NULL),
+  myIsLabeled(false),
+  myNbLabels(3)
 {}
 
 
@@ -106,7 +112,12 @@ VISU::IsoSurfaces_i
         const std::string& theFieldName, 
         CORBA::Long theTimeStampNumber)
 {
-  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
+  VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
+  myIsColored = true;
+  myColor.R = myColor.G = myColor.B = 0.;
+  //myIsLabeled = false;
+  //myNbLabels = 3;
+  return aRes;
 }
 
 
@@ -122,6 +133,8 @@ VISU::IsoSurfaces_i
   SetNbSurfaces(VISU::Storable::FindValue(theMap,"myNbSurface").toInt());
   float aMin = VISU::Storable::FindValue(theMap,"myRange[0]").toDouble();
   float aMax = VISU::Storable::FindValue(theMap,"myRange[1]").toDouble();
+  myNbLabels = VISU::Storable::FindValue(theMap,"myNbLabels").toInt();
+  myIsLabeled = VISU::Storable::FindValue(theMap,"myIsLabeled").toInt();
   SetSubRange(aMin,aMax);
     
   return this;
@@ -138,8 +151,22 @@ VISU::IsoSurfaces_i
   Storable::DataToStream( theStr, "myNbSurface", int(GetNbSurfaces()) );
   Storable::DataToStream( theStr, "myRange[0]", GetSubMin() );
   Storable::DataToStream( theStr, "myRange[1]", GetSubMax() );
+  Storable::DataToStream( theStr, "myNbLabels", myNbLabels );
+  Storable::DataToStream( theStr, "myIsLabeled", myIsLabeled );
 }
 
+//---------------------------------------------------------------
+void VISU::IsoSurfaces_i::SameAs(const Prs3d_i* theOrigin)
+{
+  TSuperClass::SameAs(theOrigin);
+
+  if(const IsoSurfaces_i* aPrs3d = dynamic_cast<const IsoSurfaces_i*>(theOrigin)){
+    IsoSurfaces_i* anOrigin = const_cast<IsoSurfaces_i*>(aPrs3d);
+    ShowLabels(anOrigin->IsLabeled(), anOrigin->GetNbLabels());
+  }
+}
+
+
 
 //---------------------------------------------------------------
 VISU::IsoSurfaces_i
@@ -231,20 +258,33 @@ VISU::IsoSurfaces_i
 }
 
 //---------------------------------------------------------------
-VISU_Actor* 
-VISU::IsoSurfaces_i
-::CreateActor()
+VISU_Actor* VISU::IsoSurfaces_i::CreateActor()
 {
-  if(VISU_Actor* anActor = TSuperClass::CreateActor()){
+  VISU_IsoSurfActor* anActor = VISU_IsoSurfActor::New();
+  try{
+    VISU::Prs3d_i::CreateActor(anActor);
+    anActor->SetBarVisibility(true);
     anActor->SetVTKMapping(true);
     SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
     int  aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2);
     anActor->SetRepresentation(aDispMode);
-    return anActor;
+    UpdateActor(anActor);
+  }catch(...){
+    anActor->Delete();
+    throw ;
   }
-  return NULL;
+
+ return anActor;
 }
 
+//---------------------------------------------------------------
+void VISU::IsoSurfaces_i::UpdateActor(VISU_ActorBase* theActor) 
+{
+  if(VISU_IsoSurfActor* anActor = dynamic_cast<VISU_IsoSurfActor*>(theActor)){
+    anActor->SetLinesLabeled(myIsLabeled, myNbLabels);
+  }
+  TSuperClass::UpdateActor(theActor);
+}
 
 //---------------------------------------------------------------
 void
@@ -253,3 +293,26 @@ VISU::IsoSurfaces_i
 {
   myIsoSurfacesPL->SetMapScale(theMapScale);
 }
+
+//---------------------------------------------------------------
+CORBA::Boolean VISU::IsoSurfaces_i::IsLabeled()
+{
+  return myIsLabeled;
+}
+
+//---------------------------------------------------------------
+void VISU::IsoSurfaces_i::ShowLabels(CORBA::Boolean theShow, CORBA::Long theNb)
+{
+  if ((myIsLabeled == theShow) && (myNbLabels == theNb)) return;
+  VISU::TSetModified aModified(this);
+  myIsLabeled = theShow;
+  myNbLabels = theNb;
+  myParamsTime.Modified();
+}
+
+//---------------------------------------------------------------
+CORBA::Long VISU::IsoSurfaces_i::GetNbLabels()
+{
+  return myNbLabels;
+}
+
index 74cc1c3d3fd77e7c42104312f3fbd8359bf51863..1e5b6dd459ddfe2bb4496bde3b0e94d3c468af49 100644 (file)
@@ -28,7 +28,8 @@
 #define VISU_IsoSurfaces_i_HeaderFile
 
 #include "VISU_I.hxx"
-#include "VISU_ScalarMap_i.hh"
+//#include "VISU_ScalarMap_i.hh"
+#include "VISU_MonoColorPrs_i.hh"
 
 class VISU_IsoSurfacesPL;
 
@@ -36,19 +37,21 @@ namespace VISU
 {
   //----------------------------------------------------------------------------
   class VISU_I_EXPORT IsoSurfaces_i : public virtual POA_VISU::IsoSurfaces,
-                       public virtual ScalarMap_i
+                                     public virtual MonoColorPrs_i
   {
     static int myNbPresent;
     IsoSurfaces_i(const IsoSurfaces_i&);
 
   public:
     //----------------------------------------------------------------------------
-    typedef ScalarMap_i TSuperClass;
+    typedef MonoColorPrs_i TSuperClass;
     typedef VISU::IsoSurfaces TInterface;
 
     explicit
     IsoSurfaces_i(EPublishInStudyMode thePublishInStudyModep);
 
+    virtual void SameAs(const Prs3d_i* theOrigin);
+
     virtual 
     ~IsoSurfaces_i();
 
@@ -84,7 +87,14 @@ namespace VISU
     { 
       return myIsoSurfacesPL; 
     }
+
+
+    virtual CORBA::Boolean IsLabeled();
+    virtual void ShowLabels(CORBA::Boolean theShow, CORBA::Long theNb);
+
+    virtual CORBA::Long GetNbLabels();
     
+
   protected:
     //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
     virtual 
@@ -103,6 +113,9 @@ namespace VISU
 
     VISU_IsoSurfacesPL* myIsoSurfacesPL;
 
+    bool myIsLabeled;
+    CORBA::Long myNbLabels;
+
   public:
     static
     size_t
@@ -150,6 +163,9 @@ namespace VISU
     virtual 
     void 
     SetMapScale(double theMapScale = 1.0);
+
+    virtual void UpdateActor(VISU_ActorBase* theActor);
+    
   };
 }
 
diff --git a/src/VISU_I/VISU_MonoColorPrs_i.cc b/src/VISU_I/VISU_MonoColorPrs_i.cc
new file mode 100644 (file)
index 0000000..28afbc8
--- /dev/null
@@ -0,0 +1,186 @@
+//  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_MonoColorPrs_i.cxx
+//  Author : Vitaly Smetannikov
+//  Module : VISU
+
+
+#include "VISU_MonoColorPrs_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISU_PipeLineUtils.hxx"
+#include "VISU_ScalarMapAct.h"
+
+#include "VISU_PipeLine.hxx"
+
+#include <vtkDataSetMapper.h>
+#include <vtkProperty.h>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+//---------------------------------------------------------------
+VISU::MonoColorPrs_i
+::MonoColorPrs_i(EPublishInStudyMode thePublishInStudyMode):
+  ColoredPrs3d_i(thePublishInStudyMode),
+  ScalarMap_i(thePublishInStudyMode)
+{
+  if(MYDEBUG) MESSAGE("MonoColorPrs_i::MonoColorPrs_i");
+}
+
+//---------------------------------------------------------------
+void 
+VISU::MonoColorPrs_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+  TSuperClass::SameAs(theOrigin);
+
+  if(const MonoColorPrs_i* aPrs3d = dynamic_cast<const MonoColorPrs_i*>(theOrigin)){
+    MonoColorPrs_i* anOrigin = const_cast<MonoColorPrs_i*>(aPrs3d);
+    SetColor(anOrigin->GetColor());
+    ShowColored(anOrigin->IsColored());
+  }
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::MonoColorPrs_i
+::Create(const std::string& theMeshName, 
+        VISU::Entity theEntity,
+        const std::string& theFieldName, 
+        CORBA::Long theTimeStampNumber)
+{
+  myIsColored = false;
+  myColor.R = myColor.G = myColor.B = 0.5;
+  return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
+}
+
+//---------------------------------------------------------------
+VISU::Storable* 
+VISU::MonoColorPrs_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+         const Storable::TRestoringMap& theMap)
+{
+  if(!TSuperClass::Restore(theSObject, theMap))
+    return NULL;
+
+  myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").toInt();
+  myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
+  myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
+  myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
+
+  return this;
+}
+
+//---------------------------------------------------------------
+void
+VISU::MonoColorPrs_i
+::ToStream(std::ostringstream& theStr)
+{
+  TSuperClass::ToStream(theStr);
+
+  Storable::DataToStream( theStr, "myIsColored", myIsColored );
+  Storable::DataToStream( theStr, "myColor.R", myColor.R );
+  Storable::DataToStream( theStr, "myColor.G", myColor.G );
+  Storable::DataToStream( theStr, "myColor.B", myColor.B );
+}
+
+
+//---------------------------------------------------------------
+VISU::MonoColorPrs_i::~MonoColorPrs_i()
+{
+  if(MYDEBUG) MESSAGE("MonoColorPrs_i::~MonoColorPrs_i()");
+}
+
+//---------------------------------------------------------------
+CORBA::Boolean VISU::MonoColorPrs_i::IsColored()
+{
+  return myIsColored;
+}
+
+
+
+//---------------------------------------------------------------
+void
+VISU::MonoColorPrs_i::ShowColored(CORBA::Boolean theColored)
+{
+  if(myIsColored == theColored)
+    return;
+  myIsColored = theColored; 
+  myParamsTime.Modified();
+}
+
+//---------------------------------------------------------------
+SALOMEDS::Color VISU::MonoColorPrs_i::GetColor()
+{
+  return myColor;
+}
+
+//---------------------------------------------------------------
+void VISU::MonoColorPrs_i::SetColor(const SALOMEDS::Color& theColor)
+{
+  bool anIsSameValue = VISU::CheckIsSameValue(myColor.R, theColor.R);
+  anIsSameValue &= VISU::CheckIsSameValue(myColor.G, theColor.G);
+  anIsSameValue &= VISU::CheckIsSameValue(myColor.B, theColor.B);
+  if(anIsSameValue)
+    return;
+
+  VISU::TSetModified aModified(this);
+  
+  myColor = theColor;
+  myParamsTime.Modified();
+}
+
+//---------------------------------------------------------------
+VISU_Actor* VISU::MonoColorPrs_i::CreateActor(bool toSupressShrinking) 
+{
+  VISU_Actor* anActor = TSuperClass::CreateActor(toSupressShrinking);
+  anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
+  return anActor;
+}
+
+//---------------------------------------------------------------
+VISU_Actor* VISU::MonoColorPrs_i::CreateActor()
+{
+  return CreateActor(false);
+}
+
+//---------------------------------------------------------------
+void VISU::MonoColorPrs_i::UpdateActor(VISU_ActorBase* theActor) 
+{
+  if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
+    if(IsColored()){
+      anActor->SetBarVisibility(true);
+      GetPipeLine()->GetMapper()->SetScalarVisibility(1);
+    }else{
+      anActor->SetBarVisibility(false);
+      GetPipeLine()->GetMapper()->SetScalarVisibility(0);
+      anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
+    }
+    TSuperClass::UpdateActor(theActor);
+  }
+}
+
diff --git a/src/VISU_I/VISU_MonoColorPrs_i.hh b/src/VISU_I/VISU_MonoColorPrs_i.hh
new file mode 100644 (file)
index 0000000..50fff30
--- /dev/null
@@ -0,0 +1,83 @@
+//  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_MonoColorPrs_i.hxx
+//  Author : Vitaly Smetannikov
+//  Module : VISU
+
+
+#ifndef VISU_MonoColorPrs_i_HeaderFile
+#define VISU_MonoColorPrs_i_HeaderFile
+
+#include <VISU_I.hxx>
+#include "VISU_ScalarMap_i.hh"
+
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  class VISU_I_EXPORT MonoColorPrs_i : public virtual POA_VISU::MonoColorPrs,
+                                      public virtual ScalarMap_i
+  {
+    MonoColorPrs_i(const MonoColorPrs_i&);
+
+  public:
+    //----------------------------------------------------------------------------
+    typedef ScalarMap_i TSuperClass;
+    typedef VISU::MonoColorPrs TInterface;
+
+    explicit MonoColorPrs_i(EPublishInStudyMode thePublishInStudyModep);
+
+    virtual void SameAs(const Prs3d_i* theOrigin);
+
+    virtual ~MonoColorPrs_i();
+
+    virtual CORBA::Boolean IsColored();
+
+    virtual void ShowColored(CORBA::Boolean theColored);
+
+    virtual SALOMEDS::Color GetColor();
+
+    virtual void SetColor(const SALOMEDS::Color& theColor);
+
+  protected:
+    SALOMEDS::Color myColor;
+    bool myIsColored;
+
+  public:
+    virtual Storable* Create(const std::string& theMeshName, 
+                            VISU::Entity theEntity,
+                            const std::string& theFieldName, 
+                            CORBA::Long theTimeStampNumber);
+
+    virtual void ToStream(std::ostringstream& theStr);
+
+    virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject,
+                             const Storable::TRestoringMap& theMap);
+
+    virtual VISU_Actor* CreateActor();
+
+    virtual VISU_Actor* CreateActor(bool toSupressShrinking);
+
+    virtual void UpdateActor(VISU_ActorBase* theActor);
+  };
+};
+#endif
diff --git a/src/VISU_I/VISU_OptionalDeformation_i.cc b/src/VISU_I/VISU_OptionalDeformation_i.cc
new file mode 100755 (executable)
index 0000000..77a1229
--- /dev/null
@@ -0,0 +1,110 @@
+//  Copyright (C) 2008  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_OptionalDeformation_i.cc
+//  Author : 
+//  Module : VISU
+
+#include "VISU_OptionalDeformation_i.hh"
+#include "VISU_Result_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISUConfig.hh"
+
+#include "VISU_OptionalDeformationPL.hxx"
+
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+//---------------------------------------------------------------
+VISU::OptionalDeformation_i::OptionalDeformation_i(VISU::ColoredPrs3d_i *theColoredPrs3d):
+  Deformation_i(theColoredPrs3d)
+{
+  if(MYDEBUG) MESSAGE("OptionalDeformation_i::OptionalDeformation_i()");
+}
+
+//---------------------------------------------------------------
+VISU::OptionalDeformation_i::~OptionalDeformation_i()
+{
+  if(MYDEBUG) MESSAGE("OptionalDeformation_i::~OptionalDeformation_i()");
+}
+
+//---------------------------------------------------------------
+void VISU::OptionalDeformation_i::UseDeformation(CORBA::Boolean theFlag){
+  if(MYDEBUG) MESSAGE("OptionalDeformation_i::UseDeformation()");
+
+  VISU::TSetModified aModified(GetColoredPrs3d());
+
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_OptionalDeformationPL, bool>
+                  (GetSpecificDeformedPL(), &VISU_OptionalDeformationPL::UseDeformation, theFlag));
+}
+
+//---------------------------------------------------------------
+CORBA::Boolean VISU::OptionalDeformation_i::IsDeformed(){
+
+  if(MYDEBUG) MESSAGE("OptionalDeformation_i::IsDeformed()");
+  return GetSpecificDeformedPL()->IsDeformed();
+}
+
+
+void VISU::OptionalDeformation_i::InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine){
+
+  if(MYDEBUG) MESSAGE("OptionalDeformation_i::InitDeformedPipeLine()");
+  myOptionalDeformationPL = dynamic_cast<VISU_OptionalDeformationPL*>(theDeformedPipeLine);
+
+  TSuperClass::InitDeformedPipeLine(myOptionalDeformationPL);
+}
+
+//---------------------------------------------------------------
+void VISU::OptionalDeformation_i::
+DeformationToStream(std::ostringstream& theStr)
+{
+  Storable::DataToStream(theStr,"IsDeformed", IsDeformed());
+  if(IsDeformed())
+    TSuperClass::DeformationToStream(theStr);
+}
+
+//---------------------------------------------------------------
+void
+VISU::OptionalDeformation_i::RestoreDeformation(SALOMEDS::SObject_ptr theSObject,
+                                               const Storable::TRestoringMap& theMap)
+{
+  UseDeformation(Storable::FindValue(theMap,"IsDeformed").toInt());
+  if(IsDeformed())
+    TSuperClass::RestoreDeformation(theSObject,theMap);
+}
+
+
+
+void 
+VISU::OptionalDeformation_i::SameAsDeformation(const Deformation_i *aDeformedPrs){
+
+  if(const OptionalDeformation_i* aPrs3d = dynamic_cast<const OptionalDeformation_i*>(aDeformedPrs)){
+    OptionalDeformation_i* anOrigin = const_cast<OptionalDeformation_i*>(aPrs3d);
+    UseDeformation(anOrigin->IsDeformed());
+    
+    if(anOrigin->IsDeformed()){
+      TSuperClass::SameAsDeformation(aDeformedPrs);
+    }
+  }
+}
diff --git a/src/VISU_I/VISU_OptionalDeformation_i.hh b/src/VISU_I/VISU_OptionalDeformation_i.hh
new file mode 100755 (executable)
index 0000000..ac6a08f
--- /dev/null
@@ -0,0 +1,76 @@
+//  Copyright (C) 2008  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_Deformation_i.hxx
+//  Author : 
+//  Module : VISU
+
+#ifndef VISU_OptionalDeformation_i_HeaderFile
+#define VISU_OptionalDeformation_i_HeaderFile
+
+#include "VISU_I.hxx"
+#include "VISU_Deformation_i.hh"
+#include "VISU_OptionalDeformationPL.hxx"
+
+namespace VISU {
+  class VISU_I_EXPORT OptionalDeformation_i : public virtual POA_VISU::OptionalDeformation,
+                                             public virtual Deformation_i
+  {
+    OptionalDeformation_i(const OptionalDeformation_i&);
+  public:
+    typedef VISU::OptionalDeformation TInterface;
+    typedef Deformation_i TSuperClass;
+
+    OptionalDeformation_i(VISU::ColoredPrs3d_i* theModifiedEngine);
+    virtual ~OptionalDeformation_i();
+    
+    virtual void UseDeformation(CORBA::Boolean theFlag);
+    virtual CORBA::Boolean IsDeformed();
+
+
+    virtual
+    void
+    DeformationToStream(std::ostringstream& theStr);
+
+    virtual
+    void
+    RestoreDeformation(SALOMEDS::SObject_ptr theSObject,
+           const Storable::TRestoringMap& theMap);
+
+    virtual 
+    void 
+    SameAsDeformation(const Deformation_i *aDeformedPrs);
+
+  protected:
+    virtual
+    void InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine);
+
+    VISU_OptionalDeformationPL*
+    GetSpecificDeformedPL() const
+    { 
+      return myOptionalDeformationPL;
+    }
+    
+  private:
+    VISU_OptionalDeformationPL* myOptionalDeformationPL;
+    
+  };
+}
+#endif
index ed2c2c01eb49f682e36245f5dacdb66a025abf13..2885a351acd0eb6c9fa670a4d6650fda97018471 100644 (file)
@@ -21,7 +21,7 @@
 //
 //
 //  File   : VISU_PointMap3d_i.cc
-//  Author : Vadim SANDLER
+//  Author : Dmitry Matveitchev
 //  Module : VISU
 
 #include "VISU_PointMap3d_i.hh"
@@ -82,7 +82,7 @@ VISU::PointMap3d_i::PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theO
   myActorCollection(vtkActorCollection::New()),
   myIsActiveState(true)
 {
-  MESSAGE("PointMap3d_i::PointMap3d_i - "<<this);
+  if(MYDEBUG) MESSAGE("PointMap3d_i::PointMap3d_i - this = "<<this);
   SetStudyDocument(theStudy);
   mySObj = theStudy->FindObjectID(theObjectEntry);
   myOffset[0] = myOffset[1] = myOffset[2] = 0;
@@ -93,7 +93,7 @@ VISU::PointMap3d_i::PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theO
 */
 VISU::PointMap3d_i::~PointMap3d_i()
 {
-  MESSAGE("PointMap3d_i::~PointMap3d_i - "<<this);
+  if(MYDEBUG) MESSAGE("PointMap3d_i::~PointMap3d_i - this = "<<this);
 }
 
 //----------------------------------------------------------------------------
@@ -150,6 +150,17 @@ VISU::PointMap3d_i
   return anEntry.in(); 
 }
 
+//----------------------------------------------------------------------------
+Handle(SALOME_InteractiveObject)
+VISU::PointMap3d_i
+::GetIO()
+{
+  if( myIO.IsNull() )
+    myIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
+
+  return myIO;
+}
+
 //----------------------------------------------------------------------------
 /*!
   Creates table3d object
@@ -186,6 +197,24 @@ VISU::Storable* VISU::PointMap3d_i::Create()
   bool isUnits = aResourceMgr->booleanValue( "VISU", "scalar_bar_display_units", true );
   SetUnitsVisible(isUnits);
 
+  SetSourceRange();
+
+  if( aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false) )
+    SetScaling(VISU::LOGARITHMIC);
+  else
+    SetScaling(VISU::LINEAR);
+
+  int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 );
+  SetNbColors(aNumberOfColors);
+
+  int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
+  UseFixedRange(aRangeType == 1);
+  if(aRangeType == 1){
+    float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
+    float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
+    SetRange(aMin, aMax);
+  }
+
   QString aLabelsFormat = aResourceMgr->stringValue( "VISU", "scalar_bar_label_format", "%-#6.3g" );
   SetLabelsFormat(aLabelsFormat.toLatin1().constData());
 
@@ -338,6 +367,12 @@ VISU_PointMap3dActor* VISU::PointMap3d_i::CreateActor()
   anActor->SetPipeLine(myTablePL);
   anActor->SetFactory(this);
 
+  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+  int  aDispMode = aResourceMgr->integerValue("VISU", "point_map_represent", 2);
+  bool toShrink  = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false);
+  anActor->SetRepresentation(aDispMode);
+  if (toShrink) anActor->SetShrink();
+
   Handle (SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
   anActor->setIO(anIO);
 
@@ -357,6 +392,7 @@ VISU_PointMap3dActor* VISU::PointMap3d_i::CreateActor()
 void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor)
 {
   if(VISU_PointMap3dActor* anActor = dynamic_cast<VISU_PointMap3dActor*>(theActor)){
+    Update();
     VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
     aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable());
     aScalarBar->SetTitle(GetTitle());
@@ -377,7 +413,7 @@ void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor)
     vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
     aTitleProp->SetFontFamily(GetTitFontType());
 
-    GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
     aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
     IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
@@ -387,7 +423,7 @@ void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor)
     vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
     aLabelProp->SetFontFamily(GetLblFontType());
 
-    GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
     aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
     IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
@@ -410,6 +446,38 @@ VISU::PointMap3d_i
   ProcessVoidEvent(new VISU::TInvokeSignalEvent(myUpdateActorsSignal));
 }
 
+//----------------------------------------------------------------------------
+void
+VISU::PointMap3d_i
+::Update()
+{
+  if(GetMTime() < myUpdateTime.GetMTime())
+    return;
+
+  if(MYDEBUG) MESSAGE("PointMap3d_i::Update - this = "<<this);
+
+  try{
+    ProcessVoidEvent(new TVoidMemFunEvent<VISU_PipeLine>
+                    (GetSpecificPL(), &VISU_PipeLine::Update));
+    myUpdateTime.Modified();
+  }catch(std::exception&){
+    throw;
+  }catch(...){
+    throw std::runtime_error("PointMap3d_i::Update >> unexpected exception was caught!!!");
+  }
+}
+
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU::PointMap3d_i
+::GetMTime()
+{
+  unsigned long int aTime = myParamsTime.GetMTime();
+  if( GetSpecificPL() )
+    aTime = std::max(aTime, GetSpecificPL()->GetMTime());
+  return aTime;
+}
+
 /*!
   Builds presentation of table
 */
@@ -683,6 +751,40 @@ CORBA::Double VISU::PointMap3d_i::GetMin()
   return myTablePL->GetScalarRange()[0];
 }
 
+CORBA::Double VISU::PointMap3d_i::GetMinTableValue()
+{
+  SALOMEDS::GenericAttribute_var anAttr;
+  mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
+  SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
+  double aMin = aTableOfReal->GetValue(1, 1);
+  
+  for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
+    for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
+      double aVal = aTableOfReal->GetValue(j, i);
+      if (aVal < aMin)
+       aMin = aVal;
+    }
+  
+  return aMin;
+}
+
+CORBA::Double VISU::PointMap3d_i::GetMaxTableValue()
+{
+  SALOMEDS::GenericAttribute_var anAttr;
+  mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
+  SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
+  double aMax = aTableOfReal->GetValue(1, 1);
+
+  for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
+    for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
+      double aVal = aTableOfReal->GetValue(j, i);
+      if (aVal > aMax)
+       aMax = aVal;
+    }
+
+  return aMax;
+}
+
 CORBA::Double VISU::PointMap3d_i::GetMax()
 {
   return myTablePL->GetScalarRange()[1];
@@ -702,8 +804,6 @@ CORBA::Double VISU::PointMap3d_i::GetSourceMin()
   vtkFloatingPointType aRange[2];
   GetSpecificPL()->GetSourceRange(aRange);
   return aRange[0];
-
-  UseFixedRange(false);
 }
 
 CORBA::Double VISU::PointMap3d_i::GetSourceMax()
@@ -718,6 +818,8 @@ void VISU::PointMap3d_i::SetSourceRange()
   GetSpecificPL()->SetSourceRange();
   ProcessVoidEvent(new TVoidMemFunEvent<VISU_DeformedGridPL>
                   (GetSpecificPL(), &VISU_DeformedGridPL::SetSourceRange));
+
+  UseFixedRange(false);
 }
 
 CORBA::Boolean VISU::PointMap3d_i::IsRangeFixed()
@@ -825,6 +927,23 @@ VISU::Scaling VISU::PointMap3d_i::GetScaling()
   return VISU::Scaling(GetSpecificPL()->GetScaling());
 }
 
+//------------------- Check Table on Positive Values ------------
+bool VISU::PointMap3d_i::IsPositiveTable()
+{
+  SALOMEDS::GenericAttribute_var anAttr;
+  mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
+  SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
+
+  for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
+    for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
+      double aVal = aTableOfReal->GetValue(j, i);
+      if (aVal < 0)
+       return false;
+    }
+
+  return true;
+}
+
 //------------------- Plot3dBase Methods ------------------------
 
 void VISU::PointMap3d_i::SetScaleFactor (CORBA::Double theScaleFactor)
@@ -872,14 +991,6 @@ void VISU::PointMap3d_i::SetActiveState ( bool theState )
   myIsActiveState = theState;
 }
 
-unsigned long int VISU::PointMap3d_i::GetMTime ()
-{
-  unsigned long int aTime = myParamsTime.GetMTime();
-  if( GetSpecificPL() )
-    aTime = std::max(aTime, GetSpecificPL()->GetMTime());
-  return aTime;
-}
-
 void VISU::PointMap3d_i::RemoveActor (VISU_ActorBase* theActor)
 {
   myActorCollection->RemoveItem(theActor);
@@ -957,13 +1068,13 @@ void VISU::PointMap3d_i::SetTitFontType(int theTitFontType)
 }
 
 //----------------------------------------------------------------------------
-void VISU::PointMap3d_i::GetTitleColor(vtkFloatingPointType* theR, 
-                                        vtkFloatingPointType* theG, 
-                                        vtkFloatingPointType* theB)
+void VISU::PointMap3d_i::GetTitleColor(vtkFloatingPointType& theR, 
+                                        vtkFloatingPointType& theG, 
+                                        vtkFloatingPointType& theB)
 {
-  *theR = myTitleColor[0]; 
-  *theG = myTitleColor[1]; 
-  *theB = myTitleColor[2];
+  theR = myTitleColor[0]; 
+  theG = myTitleColor[1]; 
+  theB = myTitleColor[2];
 }
 
 //----------------------------------------------------------------------------
@@ -1048,13 +1159,13 @@ void VISU::PointMap3d_i::SetLblFontType(int theLblFontType)
 }
 
 //----------------------------------------------------------------------------
-void VISU::PointMap3d_i::GetLabelColor(vtkFloatingPointType* theR, 
-                                 vtkFloatingPointType* theG, 
-                                 vtkFloatingPointType* theB)
+void VISU::PointMap3d_i::GetLabelColor(vtkFloatingPointType& theR, 
+                                 vtkFloatingPointType& theG, 
+                                 vtkFloatingPointType& theB)
 {
-  *theR = myLabelColor[0]; 
-  *theG = myLabelColor[1]; 
-  *theB = myLabelColor[2];
+  theR = myLabelColor[0]; 
+  theG = myLabelColor[1]; 
+  theB = myLabelColor[2];
 }
 
 //----------------------------------------------------------------------------
index dfe6d125d56aae2a682022e1442cf7827b763e49..593721ec546bfc4a7f6cb1cd46274e851c29b1e0 100644 (file)
@@ -65,6 +65,10 @@ namespace VISU
     virtual void UpdateActor(VISU_ActorBase* thePointMap3dActor);
     virtual void UpdateActors();
 
+    virtual void Update();
+
+    virtual Handle(SALOME_InteractiveObject) GetIO();
+
     //----------- override Prs3d methods -----------------------------
 
     //! Move the 3D presentation according to the given offset parameters
@@ -80,6 +84,8 @@ namespace VISU
 
     virtual CORBA::Double GetMin();
     virtual CORBA::Double GetMax();
+    virtual CORBA::Double GetMinTableValue();
+    virtual CORBA::Double GetMaxTableValue();
     virtual void SetRange(CORBA::Double theMin, CORBA::Double theMax);
 
     virtual CORBA::Double GetSourceMin();
@@ -120,16 +126,18 @@ namespace VISU
     virtual VISU::Scaling GetScaling();
     virtual void SetScaling(VISU::Scaling theScaling);
 
+    bool IsPositiveTable();
+
     // Plot3dBase methods
 
     void SetScaleFactor (CORBA::Double theScaleFactor);
-    double GetScaleFactor();
+    CORBA::Double GetScaleFactor();
 
     void SetContourPrs (CORBA::Boolean theIsContourPrs );
-    bool GetIsContourPrs();
+    CORBA::Boolean GetIsContourPrs();
 
     void SetNbOfContours (CORBA::Long);
-    long GetNbOfContours();
+    CORBA::Long GetNbOfContours();
 
     VISU_DeformedGridPL* GetSpecificPL() const { return myTablePL; }
 
@@ -157,9 +165,9 @@ namespace VISU
     virtual void SetShadowTitle(bool isShadow);
     virtual int  GetTitFontType();
     virtual void SetTitFontType(int theType);
-    virtual void GetTitleColor(vtkFloatingPointType* theR, 
-                vtkFloatingPointType* theG, 
-                vtkFloatingPointType* theB);
+    virtual void GetTitleColor(vtkFloatingPointType& theR, 
+                vtkFloatingPointType& theG, 
+                vtkFloatingPointType& theB);
     virtual void SetTitleColor(vtkFloatingPointType theR, 
                 vtkFloatingPointType theG, 
                 vtkFloatingPointType theB);    
@@ -172,9 +180,9 @@ namespace VISU
     virtual void SetShadowLabel(bool isShadow);
     virtual int  GetLblFontType();
     virtual void SetLblFontType(int theType);
-    virtual void GetLabelColor(vtkFloatingPointType* theR, 
-                vtkFloatingPointType* theG, 
-                vtkFloatingPointType* theB);
+    virtual void GetLabelColor(vtkFloatingPointType& theR, 
+                vtkFloatingPointType& theG, 
+                vtkFloatingPointType& theB);
     virtual void SetLabelColor(vtkFloatingPointType theR, 
                 vtkFloatingPointType theG, 
                 vtkFloatingPointType theB);
@@ -212,6 +220,9 @@ namespace VISU
     CORBA::Float             myOffset[3];
     bool                     myIsActiveState;
     vtkTimeStamp             myParamsTime;
+    vtkTimeStamp             myUpdateTime;
+
+    Handle(SALOME_InteractiveObject) myIO;
 
 
     //Font management
index 9951cbbef6177c24b77d23137bbe698f698e692e..55e2bd1d28b7ec46c1bd113747b28a1a30c94299 100644 (file)
@@ -41,7 +41,7 @@
 #include <boost/bind.hpp>
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -99,6 +99,7 @@ VISU::Prs3d_i::~Prs3d_i()
 {
   if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
   ProcessVoidEvent(new TInvokeSignalEvent(myRemoveActorsFromRendererSignal));
+  if(myResult) myResult->Destroy();
 }
 
 
@@ -157,8 +158,13 @@ VISU::Prs3d_i
   if(GetCResult() == theResult)
     return;
 
-  if(theResult)
+  if(theResult) {
     SetStudyDocument(theResult->GetStudyDocument());
+    theResult->Register();
+  }
+  if(myResult) {
+    myResult->Destroy();
+  }
   
   VISU::TSetModified aModified(this);
   
index f250318da41edffb349276d45acc53baf7d393bd..a43015d952f21effc7ec1cd0a3de7f52c07d21fc 100644 (file)
@@ -62,7 +62,7 @@
 #include <Bnd_Box.hxx>
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -162,6 +162,7 @@ VISU::Result_i
   myIsBuildParts(false),
   myIsPartsDone(false)
 {
+  if(MYDEBUG) MESSAGE("Result_i::Result_i - this = "<<this);
   myStudy = VISU::GetStudy(myStudyDocument);
 }
 
@@ -176,7 +177,9 @@ VISU::Result_i
   myIsAllDone(false),
   myIsBuildParts(false),
   myIsPartsDone(false)
-{}
+{
+  if(MYDEBUG) MESSAGE("Result_i::Result_i - this = "<<this);
+}
 
 
 //---------------------------------------------------------------
@@ -643,7 +646,7 @@ VISU::Result_i
       aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
     }
 
-    std::string aFileName = aPrefix + "_" + GetFileName();
+    std::string aFileName = aPrefix + "_" + GetFileName().c_str();
     BEGMSG(MYDEBUG, "aFileName = '"<<aFileName<<"'\n");
 
     std::string aFile = GetFileInfo().filePath().toLatin1().data();
@@ -1000,7 +1003,7 @@ VISU::Result_i
 
   {
     anEntities->length(aMeshOnEntityMap.size());
-    VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.end();
+    VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.begin();
     for(size_t anId = 0; anIter != aMeshOnEntityMap.end(); anIter++, anId++){
       const VISU::TEntity& anEntity = anIter->first;
       anEntities[anId] = VISU::Entity(anEntity);
@@ -1044,7 +1047,7 @@ VISU::Result_i
     
     {
       aResult->length(aFamilyMap.size());
-      VISU::TFamilyMap::const_iterator anIter = aFamilyMap.end();
+      VISU::TFamilyMap::const_iterator anIter = aFamilyMap.begin();
       for(size_t anId = 0; anIter != aFamilyMap.end(); anIter++, anId++){
        const std::string& aName = anIter->first;
        aResult[anId] = aName.c_str();
@@ -1077,7 +1080,7 @@ VISU::Result_i
 
   {
     aResult->length(aGroupMap.size());
-    VISU::TGroupMap::const_iterator anIter = aGroupMap.end();
+    VISU::TGroupMap::const_iterator anIter = aGroupMap.begin();
     for(size_t anId = 0; anIter != aGroupMap.end(); anIter++, anId++){
       const std::string& aName = anIter->first;
       aResult[anId] = aName.c_str();
@@ -1121,7 +1124,7 @@ VISU::Result_i
     
     {
       aResult->length(aFieldMap.size());
-      VISU::TFieldMap::const_iterator anIter = aFieldMap.end();
+      VISU::TFieldMap::const_iterator anIter = aFieldMap.begin();
       for(size_t anId = 0; anIter != aFieldMap.end(); anIter++, anId++){
        const std::string& aName = anIter->first;
        aResult[anId] = aName.c_str();
@@ -1178,7 +1181,7 @@ VISU::Result_i
 
        {
          aResult->length(aValField.size());
-         VISU::TValField::const_iterator anIter = aValField.end();
+         VISU::TValField::const_iterator anIter = aValField.begin();
          for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){
            const vtkIdType& aTimeStampNumber = anIter->first;
            aResult[anId] = aTimeStampNumber;
@@ -1350,7 +1353,7 @@ std::string
 VISU::Result_i
 ::GetFileName() const
 {
-  if(GetSourceId() == eFile)
+  if(GetSourceId() == eRestoredFile)
     return VISU::MakeFileName(myFileName, this);
 
   return myFileName;
diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
deleted file mode 100644 (file)
index 1a5d638..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.h"
-
-#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.toLatin1().data(),
-                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 d974a4848b92f480db6d24f16497bf3f1a985aad..61edb836ac49793a302c61c97f250b725a38a4f0 100644 (file)
@@ -443,7 +443,7 @@ VISU::ScalarMap_i
     vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
     aTitleProp->SetFontFamily(GetTitFontType());
 
-    GetTitleColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
     aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
     IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
@@ -453,7 +453,7 @@ VISU::ScalarMap_i
     vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
     aLabelProp->SetFontFamily(GetLblFontType());
 
-    GetLabelColor(&anRGB[0],&anRGB[1],&anRGB[2]);
+    GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
     aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
 
     IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
index 8919fc3ec6a17a9893b1a24fb7eca404d8df6172..01ebfa16f8afb851b6ac250aa0feabaf1bb5fd40 100644 (file)
@@ -120,7 +120,7 @@ VISU::StreamLines_i
 ::StreamLines_i(EPublishInStudyMode thePublishInStudyMode) :
   ColoredPrs3d_i(thePublishInStudyMode),
   ScalarMap_i(thePublishInStudyMode),
-  DeformedShape_i(thePublishInStudyMode),
+  MonoColorPrs_i(thePublishInStudyMode),
   myStreamLinesPL(NULL),
   myAppendFilter(vtkAppendFilter::New())
 {}
index f0cee7572d828fe0108b5d10afdf90aa9acbe51f..a1ccf3b98aadcfee8ec0b63900a88bdd2415bcff 100644 (file)
@@ -27,7 +27,8 @@
 #ifndef VISU_StreamLines_i_HeaderFile
 #define VISU_StreamLines_i_HeaderFile
 
-#include "VISU_DeformedShape_i.hh"
+//#include "VISU_DeformedShape_i.hh"
+#include "VISU_MonoColorPrs_i.hh"
 
 class VISU_StreamLinesPL;
 class vtkAppendFilter;
@@ -36,14 +37,15 @@ namespace VISU
 {
   //----------------------------------------------------------------------------
   class VISU_I_EXPORT StreamLines_i : public virtual POA_VISU::StreamLines,
-                                     public virtual DeformedShape_i
+                                     public virtual MonoColorPrs_i
+    //public virtual DeformedShape_i
   {
     static int myNbPresent;
     StreamLines_i(const StreamLines_i&);
 
   public:
     //----------------------------------------------------------------------------
-    typedef DeformedShape_i TSuperClass;
+    typedef MonoColorPrs_i TSuperClass;
     typedef VISU::StreamLines TInterface;
 
     explicit
index 3abd1ecc326df61e9803f0baf700370bfb45bd91..0910d8dc60be4ede36309c0d81a7ab9145215b54 100644 (file)
@@ -36,6 +36,8 @@
 #include "VISU_TableReader.hxx"
 #include "VISU_ConvertorUtils.hxx"
 
+#include "utilities.h"
+
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
@@ -66,6 +68,7 @@ const char* VISU::Table_i::GetComment() const
 VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry )
      : PrsObject_i(theStudy)
 {
+  MESSAGE("Table_i::Table_i - "<<this);
   mySObj = theStudy->FindObjectID(theObjectEntry);
   myOrientation = VISU::Table::HORIZONTAL;
 }
@@ -74,7 +77,7 @@ VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry
 */
 VISU::Table_i::~Table_i()
 {
-  MESSAGE("Table_i::~Table_i");
+  MESSAGE("Table_i::~Table_i - "<<this);
 }
 
 //----------------------------------------------------------------------------
@@ -1198,7 +1201,7 @@ VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy)
     SALOMEDS::SObject_var aRealObject = aStudyBuilder->NewObject(aFileObject);
     anAttr = aStudyBuilder->FindOrCreateAttribute(aRealObject, "AttributeName");
     aName = SALOMEDS::AttributeName::_narrow(anAttr);
-    if(MYDEBUG) cout<<"aTable2D.myTitle = "<<aTable2D.myTitle<<endl;
+    if(MYDEBUG) MESSAGE("aTable2D.myTitle = "<<aTable2D.myTitle);
     if ( aTable2D.myTitle != "" ) {
       aName->SetValue(aTable2D.myTitle.c_str());
     } else {
@@ -1215,7 +1218,7 @@ VISU::ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy)
     int kEnd = aNewTable2D.myRows[0].myValues.size();
     aTableOfReal->SetNbColumns(kEnd);
     for(int j = 0, jEnd = aNewTable2D.myRows.size(); j < jEnd; j++){
-      if(MYDEBUG) cout<<"j = "<<j<<"; kEnd = "<<kEnd<<endl;
+      if(MYDEBUG) MESSAGE("j = "<<j<<"; kEnd = "<<kEnd);
 
       for(int k = 0; k < kEnd; k++){
        QString aVal = aNewTable2D.myRows[j].myValues[k].c_str();
index 448c6222ab36bd64069962b260c10645433db2ac..0fc2b12e073d89c1c44307f5ba47b3ac43e263f7 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"
@@ -261,6 +261,15 @@ bool VISU_TimeAnimation::addField (_PTR(SObject) theField)
   aNewData.myNbFrames = 0;
   aNewData.myPrsType = VISU::TSCALARMAP;
   aNewData.myOffset[0] = aNewData.myOffset[1] = aNewData.myOffset[2] = 0;
+
+  // initialize myResult in aNewData
+  _PTR(SObject) aSObj = theField->GetFather();
+  aSObj = aSObj->GetFather();
+  aSObj = aSObj->GetFather();
+  CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObj);
+  if (CORBA::is_nil(anObject)) return false;
+  aNewData.myResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
+
   VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(aNewData.myField);
   if(VISU::Storable::FindValue(aMap,"myComment") != "FIELD")
     return false;
@@ -490,7 +499,12 @@ double getMaxFieldsValue( QList<FieldData>& theFieldsLst )
   return aRes;
 }
 
-void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
+void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum)
+{
+  int nbf = myFieldsLst.size();
+  if( theFieldNum<0 || theFieldNum>nbf-1 )
+    return;
+
   FieldData& aData = myFieldsLst[theFieldNum];
 
   // Delete previous presentations
@@ -596,13 +610,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);
@@ -618,7 +633,7 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
       myFieldsAbsFrames.push_back(aData.myNbFrames);
 
     if (theFieldNum == getNbFields() - 1) {
-      if ( aData.myPrsType != VISU::TGAUSSPOINTS) {
+      if ( aData.myPrsType != VISU::TGAUSSPOINTS && aData.myPrsType != TDEFORMEDSHAPEANDSCALARMAP && aData.myPrsType != TSCALARMAPONDEFORMEDSHAPE) {
 
        // Initialize the MinMax controller
        VISU::PCompositeMinMaxController aMinMaxController(new VISU::TCompositeMinMaxController());
@@ -1369,11 +1384,17 @@ void VISU_TimeAnimation::saveImages( int theFieldId,
   if (myDumpFormat.compare("AVI") != 0) {
     QString aFile(myDumpPath);
 
+    int aFrameNb = myFrame; // parallel animation mode
+    if ( myAnimationMode == VISU::Animation::SUCCESSIVE ) // successive animation mode
+      aFrameNb = getRelativeFrameNumber(myFrame).second;
+
+    int aMaxNb = myFieldsLst[theFieldId].myTiming.size();
+    int nbDigits = QString("%1").arg(aMaxNb).length();
+    QString aFormat = QString("%.%1d_").arg(nbDigits);
+
     QString aName;
-    if ( myAnimationMode == VISU::Animation::PARALLEL ) // parallel animation mode
-      aName = QString("%1").arg(myFieldsLst[theFieldId].myTiming[myFrame]);
-    else // successive animation mode
-      aName = QString("%1").arg(myFieldsLst[theFieldId].myTiming[getRelativeFrameNumber(myFrame).second]);
+    aName.sprintf(aFormat.toLatin1().data(), aFrameNb);
+    aName += QString("%1").arg(myFieldsLst[theFieldId].myTiming[aFrameNb]);
 
     int aPos = -1;
     while ((aPos = aName.indexOf(".")) > -1 )
@@ -1678,7 +1699,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";
@@ -1842,9 +1864,15 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
   for (anIter->Init(); anIter->More(); anIter->Next()) {
     _PTR(SObject) aRefObj = anIter->Value();
     _PTR(SObject) aFieldObj;
+
     if (!aRefObj->ReferencedObject(aFieldObj) ) 
       continue;
 
+    int nbAttr = aFieldObj->GetAllAttributes().size();
+    //std::string name1 = aFieldObj->GetName();
+    if(nbAttr<1)
+      continue;
+
     addField(aFieldObj);
     if ( isRangeDefined() || isSequenceDefined() ) 
       myFieldsAbsFrames.pop_back();
@@ -1882,8 +1910,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 09221faad4bafc848d8946b7b3f53134fb8e109f..d3ed8fa74baaf91452de4bd45ffb269aeeb97268 100644 (file)
@@ -26,6 +26,9 @@
 
 #include "VISUConfig.hh"
 
+#include "VISU_Result_i.hh"
+#include "SALOME_GenericObjPointer.hh"
+
 #include <vector>
 
 #include <QObject>
@@ -37,7 +40,7 @@ class VISU_Actor;
 
 namespace VISU
 {
-  class Result_i;
+  //class Result_i;
   class ColoredPrs3d_i;
   class ExecutionState;
 }
@@ -52,6 +55,8 @@ struct FieldData
   std::vector<VISU_Actor*> myActors;         // Actors
   std::vector<double> myTiming;              // time values
   CORBA::Float myOffset[3];
+  typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
+  TResultPtr myResult;
 };
 
 
index 525ebc98d899ffceaf28950be75ee916b4825285..1ef9bab6198f9f80d19e28e2aef2d8fc8eaaad0a 100644 (file)
@@ -129,6 +129,7 @@ VISU::Vectors_i
 ::Vectors_i(EPublishInStudyMode thePublishInStudyMode) :
   ColoredPrs3d_i(thePublishInStudyMode),
   ScalarMap_i(thePublishInStudyMode),
+  MonoColorPrs_i(thePublishInStudyMode),
   DeformedShape_i(thePublishInStudyMode),
   myLineWidth(1.0),
   myVectorsPL(NULL)
index 22f813cd72f11bf069e040fe00c42ee210c07daa..a7bd144f0eb1016373f0bef6e38f90f817396d2f 100644 (file)
@@ -2382,7 +2382,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')
diff --git a/src/VISU_SWIG/visu_pointmap3d.py b/src/VISU_SWIG/visu_pointmap3d.py
new file mode 100755 (executable)
index 0000000..f16d6ee
--- /dev/null
@@ -0,0 +1,57 @@
+import os
+import VISU
+from visu_gui import *
+
+aTableFile = os.getenv('DATA_DIR') + '/Tables/table_test.xls'
+
+aTableSObject = myVisu.ImportTables(aTableFile)
+
+aTable = None
+if aTableSObject:
+  anIsFound, aSObject = aTableSObject.FindSubObject(1)
+  if anIsFound:
+    aTable = aSObject.GetObject()
+
+aViewManager = myVisu.GetViewManager();
+aView = aViewManager.Create3DView()
+if aView is None : print "Creating View Error"
+print aTable
+
+##########Get Values################
+aScaleFactor = aTable.GetScaleFactor();
+anIsContourPrs = aTable.GetIsContourPrs();
+aNbOfContours = aTable.GetNbOfContours();
+aScaling = aTable.GetScaling();
+aMin = aTable.GetMin();
+aMax = aTable.GetMax();
+aSourceMin = aTable.GetSourceMin();
+aSourceMax = aTable.GetSourceMax();
+aPosX = aTable.GetPosX();
+aPosY = aTable.GetPosY();
+aHeight = aTable.GetHeight();
+aWidth = aTable.GetWidth();
+aNbColors = aTable.GetNbColors();
+aLabels = aTable.GetLabels();
+aBarOrientation = aTable.GetBarOrientation();
+
+
+print "Get Values:"
+print "aScaleFactor = ", aScaleFactor
+print "anIsContourPrs = ", anIsContourPrs
+print "aNbOfContours = ", aNbOfContours
+print "aScaling = ", aScaling
+print "===== SCALAR BAR ======="
+print "aMin = ", aMin
+print "aMax = ", aMax
+print "aSourceMin = ", aSourceMin
+print "aSourceMax = ", aSourceMax
+print "aPosX = ", aPosX
+print "aPosY = ", aPosY
+print "aHeight = ", aHeight
+print "aWidth = ", aWidth
+print "aNbColors = ", aNbColors
+print "aLabels = ", aLabels
+print "aBarOrientation = ", aBarOrientation
+
+aView.DisplayOnly( aTable )
+aView.FitAll()
\ No newline at end of file
index 3085388724c94963468ffb647b4672c80aa010dc..6177a068bbd0797e61da309f8fbd5436988ce823 100755 (executable)
@@ -30,6 +30,8 @@
 
 #include <QSemaphore>
 
+#include "utilities.h"
+
 #include <vtkImageData.h>
 #include <vtkImageClip.h>
 #include <vtkJPEGWriter.h>
@@ -61,7 +63,7 @@ VVTK_ImageWriter
 VVTK_ImageWriter
 ::~VVTK_ImageWriter()
 {
-  if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this<<endl;
+  if(MYDEBUG) MESSAGE("VVTK_ImageWriter::~VVTK_ImageWriter - this = "<<this);
 }
 
 
@@ -104,10 +106,10 @@ VVTK_ImageWriter
   aWriter->Delete();
   myImageData->Delete();
 
-  if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<<
+  if(MYDEBUG) MESSAGE("VVTK_ImageWriter::run "<<
                "- this = "<<this<<
                //"; total = "<<mySemaphore->total()<<
-               "; available = "<<mySemaphore->available()<<endl;
+               "; available = "<<mySemaphore->available() );
   mySemaphore->release();
 }
 
index 9e3a2d918f615e60c72cf166ac5f851450f738b0..2f073b8fe306eab87295b788bcbbb329b6e020d5 100755 (executable)
@@ -33,8 +33,9 @@
 
 #include <QSemaphore>
 
-#include <limits>
+#include "utilities.h"
 
+#include <limits>
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -49,9 +50,9 @@ VVTK_ImageWriterMgr
   int aMax = std::numeric_limits<int>::max() / 2;
   mySemaphore = new QSemaphore(aMax);
   mySemaphore->acquire( aMax );
-  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<
+  if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<
                //"- total = "<<mySemaphore->total()<<
-               "; available = "<<mySemaphore->available()<<endl;
+               "; available = "<<mySemaphore->available() );
 }
 
 
@@ -90,10 +91,10 @@ void
 VVTK_ImageWriterMgr
 ::Stop()
 {
-  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<<
+  if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop "<<
                //"- total = "<<mySemaphore->total()<<
-               "; available = "<<mySemaphore->available()<<endl;
-  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;
+               "; available = "<<mySemaphore->available() );
+  if(MYDEBUG) MESSAGE("VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size() );
   mySemaphore->acquire( myThreads.size() );
 
   for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){
index 5e05ceac14c805cfc3dbd32260c8f07c7c479bb5..18b42feee1b79b9a69dcc3761cb3978262cac118 100644 (file)
@@ -464,74 +464,19 @@ void VVTK_PickingDlg::RemoveActor( VISU_GaussPtsAct* theActor )
 
 void VVTK_PickingDlg::Update()
 {
-  float aCursorSize = 0.5;
-  float aPyramidHeight = 10.0;
-  float aPointTolerance = 0.1;
-  QColor aColor = Qt::yellow;
-  int anInfoWindowTransparency = 50;
-  int anInfoWindowPosition = VISU_PickingSettings::BelowPoint;
-  float aZoomFactor = 1.5;
-  int aStepNumber = 10;
-  bool aDisplayParentMesh = false;
-
-  if( !myPickingSettings->GetInitial() )
-  {
-    myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() );
-    myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() );
-    myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() );
-    myTransparencySpinBox->setValue( int(myPickingSettings->GetInfoWindowTransparency() * 100.0) );
-    myPositionComboBox->setCurrentIndex( myPickingSettings->GetInfoWindowPosition() );
-    myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() );
-    myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
-    myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
-
-    vtkFloatingPointType* aColor = myPickingSettings->GetColor();
-   
-    //QPalette aPalette( mySelectionColorButton->palette() );
-    /*aPalette.setColor( mySelectionColorButton->backgroundRole(),
-                      QColor( ( int )( aColor[0] * 255.0 ),
-                              ( int )( aColor[1] * 255.0 ),
-                              ( int )( aColor[2] * 255.0 ) ) );
-                               mySelectionColorButton->setPalette( aPalette );*/
-    mySelectionColorButton->setColor(
-                 QColor( ( int )( aColor[0] * 255.0 ),
-                ( int )( aColor[1] * 255.0 ),
-                 ( int )( aColor[2] * 255.0 ) ) );
-    
-    return;
-  }
-
-  SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
-  aCursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize );
-  myCursorSizeSpinBox->setValue( aCursorSize );
-
-  aPyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight );
-  myPyramidHeightSpinBox->setValue( aPyramidHeight );
-
-  aPointTolerance = aResourceMgr->doubleValue( "VISU", "picking_point_tolerance", aPointTolerance );
-  myPointToleranceSpinBox->setValue( aPointTolerance );
-
-  aColor = aResourceMgr->colorValue( "VISU", "picking_selection_color", aColor );
-  //QPalette aPalette( mySelectionColorButton->palette() );
-  //aPalette.setColor( mySelectionColorButton->backgroundRole(), aColor );
-  mySelectionColorButton->setColor( aColor );
-
-  anInfoWindowTransparency = aResourceMgr->integerValue( "VISU", "picking_transparency", anInfoWindowTransparency );
-  myTransparencySpinBox->setValue( anInfoWindowTransparency );
-
-  anInfoWindowPosition = aResourceMgr->integerValue( "VISU", "picking_position", anInfoWindowPosition );
-  myPositionComboBox->setCurrentIndex( anInfoWindowPosition );
-
-  aZoomFactor = aResourceMgr->doubleValue( "VISU", "picking_zoom_factor", aZoomFactor );
-  myZoomFactorSpinBox->setValue( aZoomFactor );
-
-  aStepNumber = aResourceMgr->integerValue( "VISU", "picking_step_number", aStepNumber );
-  myStepNumberSpinBox->setValue( aStepNumber );
-
-  aDisplayParentMesh = aResourceMgr->booleanValue( "VISU", "picking_display_parent_mesh", aDisplayParentMesh );
-  myDisplayParentMeshCheckBox->setChecked( aDisplayParentMesh );
-
+  myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() );
+  myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() );
+  myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() );
+  myTransparencySpinBox->setValue( int(myPickingSettings->GetInfoWindowTransparency() * 100.0) );
+  myPositionComboBox->setCurrentIndex( myPickingSettings->GetInfoWindowPosition() );
+  myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() );
+  myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
+  myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
+
+  vtkFloatingPointType* aColor = myPickingSettings->GetColor();
+  mySelectionColorButton->setColor( QColor( ( int )( aColor[0] * 255.0 ),
+                                           ( int )( aColor[1] * 255.0 ),
+                                           ( int )( aColor[2] * 255.0 ) ) );
   onClickApply();
 }
 
@@ -621,8 +566,6 @@ void VVTK_PickingDlg::KeyPressed()
 
 void VVTK_PickingDlg::onClickApply()
 {
-  myPickingSettings->SetInitial( false );
-
   myPickingSettings->SetCursorSize( myCursorSizeSpinBox->value() );
   myPickingSettings->SetPyramidHeight( myPyramidHeightSpinBox->value() );
   myPickingSettings->SetPointTolerance( myPointToleranceSpinBox->value() );
index 4208ca7597465dc0d4bcf3880994550ab7017fe8..e9e173f7b2937077f43b5efa39a182371c052a0d 100755 (executable)
@@ -320,7 +320,7 @@ VVTK_Recorder
   myPaused = myPaused ? 0 : 1;
   if(myPaused && !myFrameIndexes.empty()){
     myFrameIndexes.back() *= -1;
-    if(MYDEBUG) cout<<"VVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back()<<endl;
+    if(MYDEBUG) MESSAGE("VVTK_Recorder::Pause - myFrameIndexes.back() = "<<myFrameIndexes.back());
   }
 }
 
@@ -357,8 +357,8 @@ VVTK_Recorder
       myFrameIndexes.back() = abs(myFrameIndexes.back());
       double aPauseTime = fabs((double)(aFrameIndex - myFrameIndex - 1)) / myNbFPS;
       if(MYDEBUG) 
-       cout<<"VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
-         "; aPauseTime = "<<aPauseTime<<endl;
+       MESSAGE("VVTK_Recorder::DoRecord - aFrameIndex = "<<aFrameIndex<<
+         "; aPauseTime = "<<aPauseTime);
       myTimeStart += aPauseTime;
     }
 
@@ -370,7 +370,7 @@ VVTK_Recorder
   }
 
   myFrameIndexes.push_back(myFrameIndex);
-  if(MYDEBUG) cout<<"VVTK_Recorder::DoRecord - myFrameIndex = "<<myFrameIndex<<endl;
+  if(MYDEBUG) MESSAGE("VVTK_Recorder::DoRecord - myFrameIndex = "<<myFrameIndex);
 
   myRenderWindow->RemoveObserver(myCommand);
   myFilter->Modified();
@@ -446,7 +446,7 @@ VVTK_Recorder
     }
     std::string aString(aStream.str());
     system(aString.c_str());
-    if(MYDEBUG) cout<<"VVTK_Recorder::AddSkippedFrames - "<<aString<<endl;
+    if(MYDEBUG) MESSAGE("VVTK_Recorder::AddSkippedFrames - "<<aString);
   }
 }
 
@@ -471,7 +471,7 @@ VVTK_Recorder
   std::string aString(aStream.str());
   myErrorStatus = system(aString.c_str());
 
-  if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<aString<<endl;
+  if(MYDEBUG) MESSAGE("VVTK_Recorder::MakeFileAVI - "<<aString);
 
   QFileInfo aFileInfo(myName.c_str());
   QString aDirPath = aFileInfo.absoluteDir().path();
@@ -486,6 +486,6 @@ VVTK_Recorder
   aCommand = 
     QString("rm ") + aDirPath + "/" + aBaseName + "*.jpeg";
 
-  if(MYDEBUG) cout<<"VVTK_Recorder::MakeFileAVI - "<<(const char*)aCommand.toLatin1()<<endl;
+  if(MYDEBUG) MESSAGE("VVTK_Recorder::MakeFileAVI - "<<aCommand.toLatin1().data() );
   system((const char*)aCommand.toLatin1());
 }