]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merging from V3_2_6pre4 and BR40_WP_1_2_2
authorabd <abd@opencascade.com>
Wed, 18 Apr 2007 15:43:39 +0000 (15:43 +0000)
committerabd <abd@opencascade.com>
Wed, 18 Apr 2007 15:43:39 +0000 (15:43 +0000)
60 files changed:
doc/salome/gui/VISU/files/changing_visualization_parameters_of_the_presenetation.htm
doc/salome/gui/VISU/gauss_viewer.htm
doc/salome/gui/VISU/visu.log
doc/salome/gui/VISU/vtk_3d_viewer.htm [deleted file]
doc/salome/gui/VISU/whdata/whfwdata0.htm
doc/salome/gui/VISU/whdata/whtdata0.htm
doc/salome/gui/VISU/whxdata/whfwdata0.xml
doc/salome/gui/VISU/whxdata/whtdata0.xml
src/CONVERTOR/Makefile.am
src/CONVERTOR/VISU_AppendFilter.cxx [new file with mode: 0644]
src/CONVERTOR/VISU_AppendFilter.hxx [new file with mode: 0644]
src/CONVERTOR/VISU_CommonCellsFilter.cxx [new file with mode: 0644]
src/CONVERTOR/VISU_CommonCellsFilter.hxx [new file with mode: 0644]
src/CONVERTOR/VISU_Convertor.hxx
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_MedConvertor.cxx
src/CONVERTOR/VISU_MergeFilter.cxx
src/CONVERTOR/VISU_MergeFilter.hxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_CutPlanesPL.hxx
src/PIPELINE/VISU_Extractor.cxx
src/PIPELINE/VISU_FieldTransform.cxx
src/PIPELINE/VISU_PipeLineUtils.hxx
src/PIPELINE/VISU_Plot3DPL.cxx
src/PIPELINE/VISU_PrsMergerPL.cxx
src/PIPELINE/VISU_PrsMergerPL.hxx
src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_StreamLinesPL.cxx
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_ClippingDlg.cxx
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_TimeAnimation.h
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_PrsMerger_i.cc
src/VISU_I/VISU_PrsMerger_i.hh
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.h
src/VISU_I/VISU_View_i.cc
src/VISU_I/VISU_View_i.hh
src/VISU_SWIG/VISU_shared_modules.py

index c356156632c883f42504abd58da3bd84c6ba7cbf..5df43c6b7bada639913805ee0a9d1159c991297a 100755 (executable)
@@ -124,9 +124,13 @@ if (window.writeIntopicBar)
  </h1>
 
 <p>Each &nbsp;newly 
- created presentation is displayed in VTK viewer. To display an existing 
- presentation, right-click on it in the Object Browser and select <span 
- style="font-weight: bold;"><B>Display</B></span>. &nbsp;</p>
+ created presentation is displayed in the <span style="font-weight: bold;"><B>VTK 
+ 3D Viewer</B></span>. <span style="font-weight: bold;"><B>VTK 3D Viewer</B></span> 
+ is detailly described in the documentation on<span style="font-weight: bold;"><B> 
+ GUI module.</B></span> </p>
+
+<p>To display an existing presentation, right-click on it in the Object 
+ Browser and select <span style="font-weight: bold;"><B>Display</B></span>. &nbsp;</p>
 
 <p>&nbsp;</p>
 
index fd77a2476498636b0db674ab3f83637272ab68d5..8fcb09ca3add475b18af9a876baebd2432a6b4d9 100755 (executable)
@@ -151,9 +151,13 @@ if (window.writeIntopicBar)
 
 <p>&nbsp;</p>
 
-<p>Most operations available via Viewer Toolbar are common with <a href="vtk_3d_viewer.htm" style="font-weight: bold;">VTK 3D Viewer</a>. </p>
+<p>Most operations available via Viewer Toolbar are common with <span style="font-weight: bold;"><B>VTK 
+ 3D Viewer</B></span>. <span style="font-weight: bold;"><B>VTK 3D Viewer</B></span> 
+ is detailly described in the documentation on<span style="font-weight: bold;"><B> 
+ GUI module.</B></span> </p>
 
-<p>However, some of them are used only in Gauss Points Viewer.</p>
+<p>However, some functionalities are used only in <span style="font-weight: bold;"><B>Gauss 
+ Points Viewer</B></span>.</p>
 
 <p>&nbsp;</p>
 
index a655daa9db083625e7e250a6fad4c2a778b3768a..6ad71319cc67a3a041c02520628a6ab46c4eb9c9 100755 (executable)
@@ -213,6 +213,7 @@ pics\image88.gif
 pics\warning.png
 pics\importtablefromfile.png
 pics\surface.jpg
+pics\view_rotation_point.png
 image11.gif
 pics\image89.gif
 image44.gif
@@ -221,6 +222,7 @@ pics\animation.png
 pics\fitdatarange.png
 image22.gif
 pics\begining.jpg
+pics\set_rotation_point_dialog1.png
 pics\image46.gif
 image23.gif
 image1.jpg
@@ -229,6 +231,7 @@ image37.jpg
 image34.gif
 pics\cutplanes.png
 pics\cutlinesicon.jpg
+pics\set_rotation_point_dialog2.png
 pics\image69.gif
 pics\image47.gif
 image2.jpg
@@ -254,6 +257,7 @@ more.jpg
 pics\speed.jpg
 pics\next.jpg
 pics\run.jpg
+pics\image157.gif
 pics\image49.gif
 image26.gif
 image4.jpg
@@ -278,7 +282,6 @@ image16.gif
 image19.jpg
 pics\blue_up.jpg
 pics\blue_left.jpg
-image3.gif
 image39.gif
 image17.gif
 pics\vectorsprsnt.png
@@ -379,6 +382,7 @@ whgdata\whlstfl21.htm
 whgdata\whlstfl22.htm
 whgdata\whlstfl23.htm
 whgdata\whlstfl24.htm
+whgdata\whlstfl25.htm
 whgdata\whlstf0.htm
 whgdata\whlstf1.htm
 whgdata\whlstf2.htm
@@ -389,6 +393,7 @@ whgdata\whlstf6.htm
 whgdata\whlstf7.htm
 whgdata\whlstf8.htm
 whgdata\whlstf9.htm
+whgdata\whlstf10.htm
 whgdata\whlstg0.htm
 index.htm
 index_csh.htm
diff --git a/doc/salome/gui/VISU/vtk_3d_viewer.htm b/doc/salome/gui/VISU/vtk_3d_viewer.htm
deleted file mode 100755 (executable)
index 06ca6be..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-<!doctype HTML public "-//W3C//DTD HTML 4.0 Frameset//EN">
-
-<html>
-
-<head>
-<title>VTK 3D Viewer</title>
-<meta http-equiv="content-type" content="text/html; charset=windows-1252">
-<meta name="generator" content="RoboHelp by eHelp Corporation www.ehelp.com">
-<link rel="stylesheet" href="default_ns.css"><script type="text/javascript" language="JavaScript" title="WebHelpSplitCss">
-<!--
-if (navigator.appName !="Netscape")
-{   document.write("<link rel='stylesheet' href='default.css'>");}
-//-->
-</script>
-<style type="text/css">
-<!--
-p.whs1 { margin-top:0pt; margin-bottom:0pt; }
-img_whs2 { border:none; width:301px; height:26px; float:none; }
-ul.whs3 { list-style:disc; }
-img_whs4 { border:none; width:25px; height:23px; border-style:none; }
-img_whs5 { border:none; width:23px; height:24px; border-style:none; }
-img_whs6 { border:none; width:24px; height:23px; float:none; border-style:none; }
-img_whs7 { border:none; width:24px; height:24px; float:none; border-style:none; }
-img_whs8 { border:none; width:25px; height:24px; float:none; border-style:none; }
-img_whs9 { border:none; width:23px; height:23px; float:none; border-style:none; }
-p.whs10 { margin-left:0px; }
-img_whs11 { border:none; width:20px; height:20px; float:none; }
-p.whs12 { margin-top:0pt; margin-bottom:0pt; margin-left:80px; }
-img_whs13 { border:none; width:410px; height:255px; float:none; }
-img_whs14 { border:none; width:26px; height:26px; float:none; border-style:none; }
-img_whs15 { border:none; width:78px; height:147px; float:none; border-style:none; }
-img_whs16 { border:none; width:27px; height:27px; float:none; border-style:none; }
-p.whs17 { font-weight:bold; margin-left:80px; }
-img_whs18 { border:none; width:350px; height:453px; float:none; border-style:none; }
-p.whs19 { font-weight:bold; margin-left:40px; }
-p.whs20 { font-weight:bold; }
-p.whs21 { font-weight:bold; margin-left:36px; }
-p.whs22 { font-weight:bold; margin-left:0px; }
-p.whs23 { margin-left:0px; font-weight:bold; }
--->
-</style><script type="text/javascript" language="JavaScript">
-<!--
-if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
-{
-  var strNSS = "<style type='text/css'>";
-  strNSS += "p.whs1 {margin-top:1pt;margin-bottom:1pt; }";
-  strNSS += "p.whs10 {margin-left:1pt; }";
-  strNSS += "p.whs12 {margin-top:1pt;margin-bottom:1pt; }";
-  strNSS += "p.whs22 {margin-left:1pt; }";
-  strNSS += "p.whs23 {margin-left:1pt; }";
-  strNSS +="</style>";
-  document.write(strNSS);
-}
-//-->
-</script>
-<script type="text/javascript" language="JavaScript" title="WebHelpInlineScript">
-<!--
-function reDo() {
-  if (innerWidth != origWidth || innerHeight != origHeight)
-     location.reload();
-}
-if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
-       origWidth = innerWidth;
-       origHeight = innerHeight;
-       onresize = reDo;
-}
-onerror = null; 
-//-->
-</script>
-<style type="text/css">
-<!--
-div.WebHelpPopupMenu { position:absolute; left:0px; top:0px; z-index:4; visibility:hidden; }
-p.WebHelpNavBar { text-align:right; }
--->
-</style><script type="text/javascript" language="javascript1.2" src="whmsg.js"></script>
-<script type="text/javascript" language="javascript" src="whver.js"></script>
-<script type="text/javascript" language="javascript1.2" src="whproxy.js"></script>
-<script type="text/javascript" language="javascript1.2" src="whutils.js"></script>
-<script type="text/javascript" language="javascript1.2" src="whtopic.js"></script>
-<script type="text/javascript" language="javascript1.2">
-<!--
-if (window.gbWhTopic)
-{
-       if (window.setRelStartPage)
-       {
-       addTocInfo("Post-Pro module\n3D presentations\nViewing 3D presentations\nVTK 3D Viewer");
-addButton("show",BTN_IMG,"Show","","","","",0,0,"whd_show0.gif","whd_show2.gif","whd_show1.gif");
-addButton("hide",BTN_IMG,"Hide","","","","",0,0,"whd_hide0.gif","whd_hide2.gif","whd_hide1.gif");
-
-       }
-
-
-       if (window.setRelStartPage)
-       {
-       setRelStartPage("index.htm");
-
-               autoSync(1);
-               sendSyncInfo();
-               sendAveInfoOut();
-       }
-
-}
-else
-       if (window.gbIE4)
-               document.location.reload();
-//-->
-</script>
-</head>
-<body><script type="text/javascript" language="javascript1.2">
-<!--
-if (window.writeIntopicBar)
-       writeIntopicBar(4);
-//-->
-</script>
-<h1>VTK 3D Viewer</h1>
-
-<p class="whs1"><span style="font-weight: bold;"><B>VTK 
- 3D viewer</B></span> &nbsp;is 
- used in Post-Pro module for visualization of all 3D Presentations except 
- for Gauss Points Presentations.</p>
-
-<p class="whs1">&nbsp;</p>
-
-<p>The functionalities of VTK viewer are available via its Viewer Toolbar. 
- Buttons marked with small downward triangles have extended functionality 
- which can be accessed by locking on them with left mouse button. &nbsp;</p>
-
-<p>&nbsp;</p>
-
-<p><img src="pics/image157.gif" x-maintain-ratio="TRUE" width="301px" height="26px" border="0" class="img_whs2"></p>
-
-<p>&nbsp;</p>
-
-<ul type="disc" class="whs3">
-       
-       <li class=kadov-p><p><img src="image10.gif" width="25px" height="23px" border="0" class="img_whs4"><span style="font-weight: bold;"><B>Dump 
- View</B></span> - exports an object from the viewer in bmp, png, jpg or jpeg 
- image format. </p></li>
-       
-       <li class=kadov-p><p><img src="image5.gif" width="23px" height="24px" border="0" class="img_whs5"> <span style="font-weight: bold;"><B>Show/Hide 
- Trihedron</B></span> - shows or hides coordinate axes.<span style="font-weight: bold;"> 
- <B></B></span></p></li>
-       
-       <li class=kadov-p><p><img src="pics/image96.gif" x-maintain-ratio="TRUE" width="24px" height="23px" border="0" class="img_whs6"> <span style="font-weight: bold;"><B>Fit 
- all - </B></span>allows to select a point to be the center of a scene representing 
- all displayed objects in the visible area.<span style="font-weight: bold;"> 
- <B></B></span></p></li>
-       
-       <li class=kadov-p><p><img src="pics/image97.gif" x-maintain-ratio="TRUE" width="24px" height="24px" border="0" class="img_whs7"> <span style="font-weight: bold;"><B>Fit 
- area</B></span> - resizes the view to place in the visible area only the contents 
- of a frame drawn with pressed left mouse button.</p></li>
-       
-       <li class=kadov-p><p><span style="font-weight: bold;"><B><img src="pics/image98.gif" x-maintain-ratio="TRUE" width="25px" height="24px" border="0" class="img_whs8">Zoom -</B></span> &nbsp;allows 
- to zoom in and out.<span style="font-weight: bold;"> <B></B></span></p></li>
-       
-       <li class=kadov-p><p><img src="pics/image99.gif" x-maintain-ratio="TRUE" width="23px" height="23px" border="0" class="img_whs9"> <span style="font-weight: bold;"><B>Panning</B></span> 
- - if the represented objects are greater that the visible area and you 
- don't wish to use <span style="font-weight: bold;"><B>Fit all</B></span> functionality, 
- click on this button and you'll be able to drag the scene to see its remote 
- parts. </p></li>
-       
-       <li class=kadov-p><p class="whs10"><img src="pics/image100.gif" x-maintain-ratio="TRUE" width="24px" height="24px" border="0" class="img_whs7"> <span 
- style="font-weight: bold;"><B>Global panning</B></span> - represents all displayed 
- objects in the visible area. </p></li>
-       
-       <li class=kadov-p><p class="whs1"><img src="pics/view_rotation_point.png" x-maintain-ratio="TRUE" width="20px" height="20px" border="0" class="img_whs11"> <span style="font-weight: bold;"><B>Change rotation point</B></span> 
- - allows to to choose the point around which the rotation is performed</p></li>
-</ul>
-
-<p class="whs1">&nbsp;</p>
-
-<p class="whs12"><img src="pics/set_rotation_point_dialog1.png" x-maintain-ratio="TRUE" width="410px" height="255px" border="0" class="img_whs13"></p>
-
-<p class="whs12">&nbsp;</p>
-
-<p class="whs12">By default the rotation point is located 
- in the Center of the bounding box of an object. </p>
-
-<p class="whs12">&nbsp;</p>
-
-<p class="whs12"><img src="pics/set_rotation_point_dialog2.png" x-maintain-ratio="TRUE" width="410px" height="255px" border="0" class="img_whs13"></p>
-
-<p class="whs12">&nbsp;</p>
-
-<p class="whs12">Unchecking <span style="font-weight: bold;"><B>Use 
- Bounding Box Center</B></span> box allows you to define the coordinates of 
- the rotation point manually. </p>
-
-<p class="whs12">&nbsp;</p>
-
-<p class="whs12"><span style="font-weight: bold;"><B>Set to 
- Origin</B></span> button restores the default rotation point coordinates.</p>
-
-<p class="whs12"><span style="font-weight: bold;"><B>Select 
- Point from View</B></span> button allows to select the rotation point in the 
- 3D Viewer</p>
-
-<ul type="disc" class="whs3">
-       
-       <li class=kadov-p><p class="whs10"><img src="pics/image89.gif" x-maintain-ratio="TRUE" width="26px" height="26px" border="0" class="img_whs14"> <span 
- style="font-weight: bold;"><B>Rotation</B></span> - allows to rotate the selected 
- object using the mouse. </p></li>
-       
-       <li class=kadov-p><p class="whs10"><img src="pics/image90.gif" x-maintain-ratio="TRUE" width="78px" height="147px" border="0" class="img_whs15"> These 
- buttons orientate the scene strictly about coordinate axes.</p></li>
-       
-       <li class=kadov-p><p class="whs10"><img src="pics/image91.gif" x-maintain-ratio="TRUE" width="26px" height="26px" border="0" class="img_whs14"> <span 
- style="font-weight: bold;"><B>Reset</B></span> - restores the default position 
- (isometric) of objects in the scene.</p></li>
-       
-       <li class=kadov-p><p class="whs10"><img src="pics/image109.gif" x-maintain-ratio="TRUE" width="27px" height="27px" border="0" class="img_whs16"> <span 
- style="font-weight: bold;"><B>Graduated axes - </B></span>allows to define parameters 
- of axes and graduate them.</p></li>
-</ul>
-
-<p class="whs10">&nbsp;</p>
-
-<p class="whs17"><img src="pics/graduatedaxes1.png" x-maintain-ratio="TRUE" width="350px" height="453px" border="0" class="img_whs18"></p>
-
-<p class="whs19">&nbsp;</p>
-
-<ul type="disc" class="whs3">
-       
-       <li class=kadov-p><p class="whs20">Axis name </p></li>
-       
-       <li class=kadov-p><p class="whs21">Is 
- visible - <span style="font-weight: normal;">if checked the axis name 
- is displayed in the viewer.</span></p></li>
-       
-       <li class=kadov-p><p class="whs21">Name<span 
- style="font-weight: normal;"> - allows to redefine the name of the axis.</span></p></li>
-       
-       <li class=kadov-p><p class="whs21">Font<span 
- style="font-weight: normal;"> - allows to define color and properties 
- of the font of axis name. </span></p></li>
-       
-       <li class=kadov-p><p class="whs22">Labels<span 
- style="font-weight: normal;"> </span></p></li>
-       
-       <li class=kadov-p><p class="whs21">Is 
- visible - <span style="font-weight: normal;">if checked the labels are 
- displayed in the viewer.</span></p></li>
-       
-       <li class=kadov-p><p class="whs21">Number<span 
- style="font-weight: normal;"> - allows to define the number of labels.</span></p></li>
-       
-       <li class=kadov-p><p class="whs21">Offset<span 
- style="font-weight: normal;"> - allows to define the distance between 
- labels.</span></p></li>
-       
-       <li class=kadov-p><p class="whs21">Font<span 
- style="font-weight: normal;"> - allows to define color and properties 
- of the font of labels names.</span></p></li>
-       
-       <li class=kadov-p><p class="whs23">Tick 
- marks </p></li>
-       
-       <li class=kadov-p><p class="whs21">Is 
- visible - <span style="font-weight: normal;">if checked the tick marks 
- are displayed in the viewer.</span></p></li>
-       
-       <li class=kadov-p><p class="whs21">Length<span 
- style="font-weight: normal;"> - allows to define the length of tick marks</span></p></li>
-       
-       <li class=kadov-p><p class="whs23">Is 
- visible <span style="font-weight: normal;">if checked the axis is displayed 
- in the viewer.</span></p></li>
-</ul>
-
-<p class="whs23">&nbsp;</p>
-
-<script type="text/javascript" language="javascript1.2">
-<!--
-if (window.writeIntopicBar)
-       writeIntopicBar(0);
-//-->
-</script>
-</body>
-</html>
index 68805eb0e498c9b014b826f3f3d1898173054f13..3307ee339fdafa691f1c1f448584a37df4491ad1 100755 (executable)
 </script>
 <script language="javascript">
 <!--
-aWE("0",0,1,32,34,35,38,6,26,39);
+aWE("0",5,0,1,11,32,34,35,38,6,26,39);
 aWE("001",32);
 aWE("01",39);
-aWE("1",4,5,7,2,10,15,14,19,31,32,34,33,35,6,27);
+aWE("1",4,5,0,7,2,10,11,15,14,19,31,32,34,33,35,6,27);
 aWE("10",31,32,39);
 aWE("100",0,32,6,26,39);
 aWE("10n",33);
@@ -33,11 +33,11 @@ aWE("5",5,1,34,33);
 aWE("50",39);
 aWE("512",35);
 aWE("6",31,35);
-aWE("8",35);
+aWE("8",5,0,35);
 aWE("abl",18,33,40);
 aWE("abov",38);
 aWE("abscissa",36);
-aWE("absolut",39);
+aWE("absolut",11,39);
 aWE("acceptabl",27,39);
 aWE("acces",30,33,6,25,39,40);
 aWE("accessibl",14);
@@ -46,15 +46,18 @@ aWE("accordanc",3);
 aWE("accuracy",26);
 aWE("action",0,31,24);
 aWE("activ",32,34,36,39);
-aWE("activat",30,32,38);
+aWE("activat",5,0,30,32,38);
 aWE("activity",0);
 aWE("actor",16,6);
 aWE("actual",38);
+aWE("ad",5,0);
+aWE("add",23);
 aWE("addition",0,32);
 aWE("additional",5,12,13,14,21,34,22,37,23,26,28);
 aWE("adjust",5,1,32,25);
 aWE("advanc",31,33);
 aWE("again",5);
+aWE("aimation",5);
 aWE("algorithm",11);
 aWE("allow",4,5,0,1,7,11,12,13,14,30,18,21,31,32,34,33,36,37,23,24,38,6,25,26,27,39,28,40);
 aWE("along",16,33,24,38,6);
@@ -67,7 +70,7 @@ aWE("angl",1,11,12,34);
 aWE("animat",5,17);
 aWE("animation",5,0,6,27);
 aWE("anoth",5,12,26,27);
-aWE("any",3,4,0,30,16,18,31,35);
+aWE("any",3,4,0,7,30,16,18,31,35);
 aWE("ap",1,29,23,24);
 aWE("apex",32);
 aWE("api",0);
@@ -75,7 +78,7 @@ aWE("appear",5,7,10,14,23,25);
 aWE("appli",3,8,2,11,12,13,16,21,34,35,37,23,26,27,39,28);
 aWE("application",18,22);
 aWE("area",33,26,40);
-aWE("around",11,12,32,34,38);
+aWE("around",11,12,32,34,38,40);
 aWE("arrang",6);
 aWE("array",11);
 aWE("arrow",28);
@@ -87,7 +90,7 @@ aWE("auto",1,7,6);
 aWE("automatical",1,7,11,14,30,18,38,27);
 aWE("availabl",0,30,16,31,6,40);
 aWE("averag",39);
-aWE("avi",0);
+aWE("avi",5,0);
 aWE("avoid",6);
 aWE("ax",1,11,12,34,33,24,6,25,40);
 aWE("axi",7,11,12,31,34,33,38,6,40);
@@ -107,25 +110,26 @@ aWE("below",32,38);
 aWE("bet",0);
 aWE("bicolor",36,39);
 aWE("big",35,28);
+aWE("bin",5,0);
 aWE("black",32,36);
 aWE("blu",18,36);
 aWE("bmp",30,33,35,6,40);
 aWE("both",8,30,34,36,25,26,39);
 aWE("bottom",33,36,38);
-aWE("bound",26);
+aWE("bound",26,40);
 aWE("boundari",38);
 aWE("boundary",3,32);
-aWE("box",5,0,7,10,11,12,13,14,16,18,19,34,33,23,24,38,26,39,28);
-aWE("brows",3,5,0,7,8,9,2,10,11,12,13,15,14,29,30,18,19,21,34,35,37,23,24,6,26,27,28);
-aWE("build",18);
-aWE("built",18,37);
+aWE("box",5,0,7,10,11,12,13,14,16,18,19,34,33,23,24,38,26,39,28,40);
+aWE("brows",3,5,0,7,8,9,2,10,11,12,13,15,14,29,30,18,19,21,34,35,37,23,24,6,25,26,27,28);
+aWE("build",18,23);
+aWE("built",18,37,23);
 aWE("button",5,0,1,10,14,29,30,19,21,31,32,34,33,23,24,38,6,26,39,28,40);
 aWE("cal",33,38);
 aWE("calculation",3,35,23);
 aWE("camera",32,35);
 aWE("cancel",29,35,24);
 aWE("cannot",35);
-aWE("cas",30,32,23,39);
+aWE("cas",5,30,32,23,39);
 aWE("caus",6);
 aWE("cel",3,4,8,2,11,12,13,16,21,34,37,23,26,27,39,28);
 aWE("cell",16);
@@ -134,27 +138,29 @@ aWE("center",32);
 aWE("centr",32);
 aWE("central",30,31);
 aWE("certain",6);
-aWE("chang",5,0,14,29,30,31,33,24,38,6,25,39);
+aWE("chang",5,0,14,29,30,31,33,24,38,6,25,39,40);
 aWE("channel",35);
 aWE("characteristic",16,36,38);
-aWE("check",5,7,11,12,13,18,34,33,36,23,6,26,28,40);
+aWE("check",5,0,7,11,12,13,18,34,33,36,23,6,26,28,40);
 aWE("checkbox",34);
 aWE("checkmark",7);
 aWE("choic",1,14,29,18);
-aWE("choos",0,1,7,8,9,10,11,12,13,15,14,29,30,16,18,19,21,34,36,37,23,26,28);
+aWE("choos",0,1,7,8,9,10,11,12,13,15,14,29,30,16,18,19,21,34,36,37,23,26,28,40);
 aWE("chosen",3,0,10,16,24,26);
 aWE("circl",7);
 aWE("clamp",35);
+aWE("clean",5);
 aWE("click",5,0,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,32,34,33,22,37,23,24,38,6,25,26,27,28,40);
 aWE("clip",0,1,38,6);
 aWE("clockwis",31);
 aWE("clon",33);
 aWE("clos",18,35);
+aWE("coincid",7);
 aWE("color",7,11,12,13,32,34,33,35,36,23,26,39,28,40);
 aWE("colour",18);
 aWE("column",4,7);
 aWE("combin",3,21,31);
-aWE("command",31,38);
+aWE("command",5,0,31,38);
 aWE("common",30,6);
 aWE("compar",37);
 aWE("comparison",5,27);
@@ -162,9 +168,9 @@ aWE("compatibl",3);
 aWE("complet",18);
 aWE("complete",1);
 aWE("complicat",26);
-aWE("component",4,20,32,35,22,36,23);
+aWE("component",4,5,20,32,35,22,36,23);
 aWE("compos",3,5,2,10,27);
-aWE("comput",35,39);
+aWE("comput",5,0,35,39);
 aWE("computation",26);
 aWE("con",28);
 aWE("concept",3);
@@ -198,7 +204,7 @@ aWE("creat",3,4,5,1,7,8,9,2,10,11,12,13,29,30,17,19,21,34,22,37,23,38,6,26,27,39
 aWE("creation",10,11,14,22,23,27);
 aWE("cros",1,7,6);
 aWE("ctrl",14,30,31);
-aWE("current",30,31,32,35,36,25);
+aWE("current",7,30,31,32,35,36,25);
 aWE("cursor",32,35,38);
 aWE("curv",7,10,11,33,25);
 aWE("customiz",32);
@@ -219,32 +225,35 @@ aWE("degre",1,11,12,31,34);
 aWE("delet",1,14);
 aWE("depend",5,31,35,38,39);
 aWE("depth",38);
-aWE("describ",4);
+aWE("describ",4,30,6);
 aWE("description",31,33);
 aWE("design",36);
 aWE("desktop",22);
 aWE("destin",5,20,33);
+aWE("detail",30,6);
 aWE("develop",30);
 aWE("diagonal",7);
 aWE("dialog",5,0,7,10,11,14,29,16,18,19,35,36,23,24,38,39);
 aWE("diamond",7);
-aWE("different",3,30,36,38,39);
+aWE("different",3,5,30,36,38,39);
 aWE("dimension",36,23);
 aWE("direct",38);
 aWE("direction",30,31,38,26);
 aWE("directory",5);
-aWE("disabl",34,36,39);
+aWE("disabl",0,34,36,39);
 aWE("displacement",11,12);
 aWE("display",4,5,0,1,7,8,9,2,10,11,12,13,15,14,30,16,18,21,32,34,33,35,36,37,23,38,6,25,26,27,28,40);
 aWE("distanc",1,32,35,24,6,40);
 aWE("divid",3,31,39);
 aWE("division",33);
 aWE("do",31);
+aWE("documentation",30,6);
 aWE("doesn",33);
 aWE("dominant",31);
 aWE("don",33,35,40);
 aWE("dot",7);
 aWE("down",5,14,31);
+aWE("download",5,0);
 aWE("downward",7,40);
 aWE("drag",33,38,40);
 aWE("draw",33);
@@ -263,7 +272,7 @@ aWE("eith",1);
 aWE("elaps",18);
 aWE("element",3,16,32,38,6);
 aWE("els",36);
-aWE("empty",4);
+aWE("empty",4,7);
 aWE("end",5,32,35,38,27);
 aWE("ent",14,16,19,21,23);
 aWE("enter",11,12);
@@ -272,6 +281,7 @@ aWE("entity",26);
 aWE("equal",21,35,23);
 aWE("eras",14,30,38,6,25);
 aWE("etc",30);
+aWE("even",7);
 aWE("every",3,5);
 aWE("everyth",18);
 aWE("exact",0,18);
@@ -282,7 +292,7 @@ aWE("except",39,40);
 aWE("exist",14,34,6,39);
 aWE("exit",29,38);
 aWE("explor",26);
-aWE("export",30,19,33,6,40);
+aWE("export",5,0,30,19,33,6,40);
 aWE("expres",16);
 aWE("extend",40);
 aWE("extent",16);
@@ -294,7 +304,7 @@ aWE("famili",3,18);
 aWE("fast",33);
 aWE("featur",36,24,26);
 aWE("field",3,5,8,11,12,13,14,29,16,17,18,20,21,34,37,23,24,6,26,27,28);
-aWE("fil",3,4,0,17,18,19,35,23,25);
+aWE("fil",3,4,5,0,17,18,19,35,23,25);
 aWE("find",18);
 aWE("finish",0,11,12,13,18,21,34,37,23,26,28);
 aWE("first",5,32,38);
@@ -303,7 +313,7 @@ aWE("fix",32,39);
 aWE("focal",31,32);
 aWE("fold",3,19);
 aWE("folder",3);
-aWE("follow",3,5,1,7,8,10,14,30,16,19,31,32,33,22,23,6,25);
+aWE("follow",3,5,0,1,7,8,10,14,30,16,19,31,32,33,22,23,6,25);
 aWE("font",36,23,40);
 aWE("form",2,16,20,33);
 aWE("format",30,33,6,40);
@@ -318,7 +328,7 @@ aWE("fre",30);
 aWE("freedom",31);
 aWE("ful",18);
 aWE("function",38);
-aWE("functionaliti",40);
+aWE("functionaliti",30,40);
 aWE("functionality",4,0,7,34,33,38,40);
 aWE("g",35);
 aWE("gaus",0,29,30,31,32,35,36,38,39,40);
@@ -342,7 +352,8 @@ aWE("graphical",28);
 aWE("great",0,32,33,35,40);
 aWE("grey",36);
 aWE("grid",33);
-aWE("group",3,18,26);
+aWE("group",3,18,23,26);
+aWE("gui",30,6);
 aWE("h",7);
 aWE("half",39);
 aWE("halv",1,34);
@@ -358,9 +369,11 @@ aWE("high",35);
 aWE("highest",18);
 aWE("highlight",16,32);
 aWE("hold",14);
+aWE("horisontal",7);
 aWE("horizontal",1,33,36,23);
 aWE("how",17,18);
-aWE("i",36);
+aWE("http",5,0);
+aWE("i",16,36);
 aWE("icon",11,12,13,29,21,34,22,37,23,26,28);
 aWE("id",16,32);
 aWE("if",5,0,1,7,11,14,16,18,32,34,33,35,36,23,26,28,40);
@@ -375,8 +388,8 @@ aWE("includ",3,0,20,26,39);
 aWE("increas",5,30,31,34);
 aWE("increment",31);
 aWE("independent",3,31);
-aWE("index",1);
-aWE("indicat",3,23);
+aWE("index",1,16);
+aWE("indicat",3,5,0,7,23);
 aWE("individual",32);
 aWE("info",16,6);
 aWE("information",3,16,32,33,35,6,39);
@@ -385,12 +398,15 @@ aWE("input",0);
 aWE("insid",11,38);
 aWE("insidefram",6);
 aWE("inspect",32,36,38);
+aWE("instal",5,0);
+aWE("install_root",5,0);
+aWE("instead",11);
 aWE("integration",26);
 aWE("intend",5);
 aWE("interaction",30,31);
 aWE("interest",26);
 aWE("interpolation",3);
-aWE("interval",0,33,35);
+aWE("interval",0,11,33,35);
 aWE("introduc",31);
 aWE("introduction",20);
 aWE("invert",11);
@@ -399,37 +415,41 @@ aWE("isobaric",21);
 aWE("isometric",40);
 aWE("item",10,18,19);
 aWE("iteration",32);
+aWE("j",16);
 aWE("jpeg",30,33,6,40);
+aWE("jpeg2yuv",5,0);
 aWE("jpg",30,33,35,6,40);
 aWE("just",0);
+aWE("k",16);
 aWE("key",31,32,39);
 aWE("keyboard",30,31,32,39);
+aWE("kind",5);
 aWE("label",36,23,25,40);
 aWE("larg",23);
 aWE("largest",39);
 aWE("last",5);
 aWE("latest",0);
 aWE("latitud",35);
-aWE("launch",5,17,22);
+aWE("launch",17,22);
 aWE("layout",30,16);
 aWE("learn",38);
 aWE("least",7);
-aWE("left",10,30,31,32,33,36,40);
+aWE("left",10,30,31,32,33,36,23,40);
 aWE("leftward",7);
 aWE("legend",33,25);
-aWE("length",26,39,40);
+aWE("length",11,26,39,40);
 aWE("les",0,23);
 aWE("level",35);
 aWE("lik",3,22);
 aWE("limit",35,36);
 aWE("lin",4,7,2,10,11,32,33,36,6,26,28);
 aWE("linear",33,36,25);
-aWE("list",3,5,1,10,26);
+aWE("list",3,5,1,10,23,26);
 aWE("ll",0,33,40);
 aWE("load",18);
 aWE("local",31,36);
-aWE("locat",8,11,12,19,32,34,36,38,6,26,39);
-aWE("location",0,35,38);
+aWE("locat",8,11,12,19,32,34,36,38,6,26,39,40);
+aWE("location",5,0,35,38);
 aWE("lock",30,31,40);
 aWE("logarithmic",33,23,25);
 aWE("longitud",35);
@@ -449,7 +469,7 @@ aWE("management",5);
 aWE("manipulat",30,31);
 aWE("manipulation",30,31);
 aWE("manipulator",31);
-aWE("manual",4,11,12,38,6);
+aWE("manual",4,11,12,38,6,40);
 aWE("map",37,23);
 aWE("mark",7,11,33,40);
 aWE("marker",32,33,36);
@@ -458,18 +478,22 @@ aWE("matrix",35,36);
 aWE("max",18,36,39);
 aWE("maximal",23);
 aWE("maximum",21,33,35,36,26,39);
-aWE("mean",32,39);
+aWE("mean",5,32,39);
 aWE("measur",35,26);
+aWE("memory",5);
 aWE("menu",5,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,34,33,35,22,37,23,38,6,25,26,27,39,28);
 aWE("merg",6);
-aWE("mesh",3,11,12,13,16,17,32,34,37,38,26,39,28);
+aWE("mesh",3,11,12,13,16,17,32,34,37,23,38,26,39,28);
 aWE("method",4);
 aWE("might",6);
 aWE("min",18,36,39);
 aWE("minimal",23);
 aWE("minimum",21,36,38,27,39);
 aWE("minor",33);
+aWE("mis",5,0);
 aWE("mix",37);
+aWE("mjpeg",5,0);
+aWE("mjpegtool",5,0);
 aWE("mod",0,1,30,31,32,33,36,23,6,28);
 aWE("model",31);
 aWE("modify",14,39);
@@ -490,9 +514,10 @@ aWE("natural",33);
 aWE("navigation",31);
 aWE("nb",36,23);
 aWE("nbrfac",35);
-aWE("ne",1);
-aWE("necessary",16,18,19);
+aWE("ne",5,0,1);
+aWE("necessary",5,16,18,19);
 aWE("negativ",36,39);
+aWE("net",5,0);
 aWE("new",1,8,2,10,17,19,33,22,38,6);
 aWE("next",5,32);
 aWE("nod",3);
@@ -503,10 +528,10 @@ aWE("notify",35);
 aWE("now",1,29,32);
 aWE("nth",36);
 aWE("null",39);
-aWE("numb",12,16,21,32,34,33,35,36,23,26,27,39,40);
+aWE("numb",5,12,16,21,32,34,33,35,36,23,26,27,39,40);
 aWE("number",32);
 aWE("numerical",33);
-aWE("object",3,5,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,31,34,33,37,23,24,6,26,27,28,40);
+aWE("object",3,5,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,31,34,33,37,23,24,6,25,26,27,28,40);
 aWE("observ",11,12);
 aWE("obtain",35);
 aWE("offset",40);
@@ -520,10 +545,11 @@ aWE("onfac",3);
 aWE("onnod",3);
 aWE("opacity",6);
 aWE("opaqu",32,6);
-aWE("open",5,18,19,33,35);
+aWE("open",18,19,33,35);
 aWE("opengl",35);
-aWE("operation",11,14,30,18,31,33,35);
+aWE("operation",5,11,14,30,18,31,33,35);
 aWE("opposit",1);
+aWE("optimiz",5);
 aWE("optimization",26);
 aWE("option",5,7,13,15,14,30,18,31,33,36,6,25,26,27,28);
 aWE("ordinary",37);
@@ -531,28 +557,32 @@ aWE("ordinat",36);
 aWE("orient",1);
 aWE("orientat",40);
 aWE("orientation",1,11,12,34,36,23,38);
-aWE("origin",36,23,38);
+aWE("origin",36,23,38,40);
 aWE("otherwis",18);
 aWE("out",33,23,40);
 aWE("output",26);
 aWE("outsid",38);
 aWE("overview",17);
 aWE("own",3,23);
+aWE("packag",5,0);
 aWE("pagedn",31);
 aWE("pageup",31);
 aWE("palet",36);
 aWE("pan",31,33,40);
+aWE("parallel",5);
 aWE("paramet",11,12,35,26);
 aWE("parameter",5,1,7,11,12,13,14,30,17,21,34,35,36,37,23,38,6,26,28,40);
 aWE("parent",32);
 aWE("pars",18);
-aWE("part",3,1,7,33,38,40);
+aWE("part",3,5,0,1,7,33,38,40);
 aWE("particl",26);
 aWE("particular",3,10,26);
-aWE("path",5,26);
+aWE("party",5,0);
+aWE("path",5,0,26);
 aWE("paus",0);
 aWE("per",0);
-aWE("perform",3,0,18);
+aWE("perform",3,0,18,40);
+aWE("performanc",5);
 aWE("period",3,5);
 aWE("perpendicular",1);
 aWE("personal",14);
@@ -570,7 +600,7 @@ aWE("plot",7,10,11,17,20,34,33,25);
 aWE("plot2d",7,10);
 aWE("plot2dview",7);
 aWE("png",30,33,35,6,40);
-aWE("point",3,29,30,16,31,32,33,35,36,38,6,26,39,40);
+aWE("point",3,7,29,30,16,31,32,33,35,36,38,6,26,39,40);
 aWE("pointer",28);
 aWE("polylin",26);
 aWE("pop",5,7,8,9,2,10,11,12,13,15,14,29,21,34,37,23,6,26,27,28);
@@ -578,7 +608,7 @@ aWE("position",1,11,12,30,32,34,33,39,28,40);
 aWE("positiv",36);
 aWE("posses",16,31);
 aWE("possibility",0,25);
-aWE("possibl",1,8,31,38,39);
+aWE("possibl",5,1,7,8,31,38,39);
 aWE("post",3,4,5,0,7,8,2,10,11,30,17,18,19,20,33,22,23,6,26,27,40);
 aWE("preferenc",18,31,32,35,22,23,6);
 aWE("pres",5,0,29,30,32,33,40);
@@ -594,11 +624,13 @@ aWE("problem",6);
 aWE("procedur",11);
 aWE("proces",18,20,27,39);
 aWE("produc",0,20);
+aWE("product",5,0);
 aWE("progres",18,35);
 aWE("progression",36);
 aWE("progressiv",0);
 aWE("prompt",35);
 aWE("propagation",26);
+aWE("proper",5,0);
 aWE("properti",5,0,13,29,30,33,36,23,6,25,28,40);
 aWE("proportional",5);
 aWE("provid",20,31,6);
@@ -620,7 +652,7 @@ aWE("rang",4,5,13,21,32,34,35,36,23,6,25,39,28);
 aWE("rarefi",4);
 aWE("rat",0,18);
 aWE("ratio",30,31,32,39);
-aWE("real",5,33,38,39);
+aWE("real",5,11,33,38,39);
 aWE("record",0,30);
 aWE("rectangl",7,18);
 aWE("red",36);
@@ -643,7 +675,7 @@ aWE("render",35,36,39);
 aWE("represent",3,4,7,34,33,23,6,25,26,28,40);
 aWE("representation",3,14,33,6,25);
 aWE("representativ",39);
-aWE("requir",0,7,8,15,16,26);
+aWE("requir",5,0,7,8,15,16,26);
 aWE("reset",24,40);
 aWE("resiz",33,40);
 aWE("resolution",35);
@@ -661,10 +693,10 @@ aWE("rightward",7);
 aWE("rotat",1,30,31,38,40);
 aWE("rotation",1,11,12,30,31,34,40);
 aWE("row",4,7);
-aWE("run",5,22);
-aWE("s",3,32);
+aWE("run",5,0,22);
+aWE("s",3,32,23);
 aWE("salom",7,30,20,31,35,22,23,24);
-aWE("sam",7,11,14,30,31,23,38,6,39);
+aWE("sam",5,7,11,14,30,31,23,38,6,39);
 aWE("sav",5,0,30,33,36,23,25);
 aWE("scal",13,34,33,36,37,23,24,6,25,39,28);
 aWE("scalar",3,5,8,2,11,12,13,29,16,21,32,34,35,36,37,23,38,6,26,39,28);
@@ -680,7 +712,7 @@ aWE("seen",36);
 aWE("segment",3,26);
 aWE("segmentation",0,30,35,38);
 aWE("select",5,1,7,8,2,10,11,12,13,14,29,30,16,18,19,21,32,34,33,36,37,23,24,6,25,26,27,39,28,40);
-aWE("selectabl",1);
+aWE("selectabl",5,1);
 aWE("selection",30,16,32,6);
 aWE("semi",32,38);
 aWE("sensitiv",6);
@@ -688,20 +720,19 @@ aWE("separat",15,6);
 aWE("separate",33,6);
 aWE("serv",26);
 aWE("session",0,23);
-aWE("set",5,0,1,11,12,13,14,29,17,18,21,32,34,35,22,37,23,6,25,26,39,28);
+aWE("set",5,0,1,11,12,13,14,29,17,18,21,32,34,35,22,37,23,6,25,26,39,28,40);
 aWE("setting",0,30,18,33,25);
 aWE("setup",5);
 aWE("shad",35,6);
 aWE("shap",12,13,35,37,39);
 aWE("shift",13);
-aWE("should",3,1,7,11,12,16,18,34,22,6,27);
+aWE("should",3,5,0,1,7,11,12,16,18,34,22,6,27);
 aWE("show",5,1,11,12,15,18,32,33,36,38,25,39,40);
 aWE("shrink",6);
 aWE("sid",12,36);
 aWE("similar",38,26);
 aWE("simpl",35);
-aWE("simultaneou",5);
-aWE("simultaneous",11,12,36,6);
+aWE("simultaneous",5,11,12,36,6);
 aWE("siz",0,16,32,33,35,26,39);
 aWE("slow",32);
 aWE("smal",35,26);
@@ -714,6 +745,7 @@ aWE("solid",7);
 aWE("solv",6);
 aWE("sometim",26);
 aWE("sourc",26);
+aWE("sourceforg",5,0);
 aWE("spac",11,12,16,34,36,39);
 aWE("spacemous",31);
 aWE("spe",5,31);
@@ -736,7 +768,7 @@ aWE("stor",3,30);
 aWE("stream",26);
 aWE("streamlin",26);
 aWE("strict",40);
-aWE("structur",3,1,7,11,18,26);
+aWE("structur",3,1,7,11,16,18,26);
 aWE("study",5,7,10,11,17,22);
 aWE("styl",30,31);
 aWE("subfold",3,8,14,30,6);
@@ -744,6 +776,7 @@ aWE("subfolder",3);
 aWE("submenu",8);
 aWE("submesh",3,8,9,16,17,20,24);
 aWE("substitut",0);
+aWE("successiv",5);
 aWE("suggest",35);
 aWE("superposition",6);
 aWE("support",31);
@@ -751,11 +784,12 @@ aWE("surfac",12,21,34,6);
 aWE("suspend",0);
 aWE("sweep",5,17,18,6,27);
 aWE("switch",30,31,6);
+aWE("syntax",5,0);
 aWE("system",0,31,35,39);
 aWE("systematical",36);
 aWE("t",18,33,35,40);
 aWE("tab",4,11,12,13,19,21,34,37,23,38,26,28);
-aWE("tabl",3,4,7,2,11,15,16,17,19,20,33);
+aWE("tabl",3,4,7,2,11,15,16,17,19,20,33,25);
 aWE("tail",28);
 aWE("tak",26,27);
 aWE("taken",7,11,13,36);
@@ -763,20 +797,23 @@ aWE("technical",35);
 aWE("tensor",35,36);
 aWE("text",36,23);
 aWE("textur",35);
-aWE("them",4,1,7,30,21,31,32,35,6,40);
+aWE("them",4,5,1,7,21,31,32,35,23,6,40);
 aWE("therefor",35);
 aWE("thick",6);
 aWE("thin",6);
+aWE("third",5,0);
 aWE("thought",35,26);
 aWE("thre",3,4,11,12,34,35,23,39);
 aWE("threshold",35);
 aWE("tick",40);
 aWE("tilt",31);
 aWE("tim",3,5,0,8,11,12,13,14,29,30,18,21,34,36,37,23,38,6,26,27,28);
+aWE("tip",7);
 aWE("titl",4,33,23);
 aWE("togeth",3);
 aWE("toggl",31);
 aWE("toleranc",32);
+aWE("tool",5,0,7);
 aWE("toolbar",8,11,12,13,14,29,30,21,31,32,34,33,22,37,23,38,26,28,40);
 aWE("top",32,33,38);
 aWE("total",35);
@@ -797,7 +834,7 @@ aWE("twic",39);
 aWE("two",0,1,7,10,11,12,30,32,34,35,36,37,38);
 aWE("txt",4,19);
 aWE("typ",3,5,7,8,11,12,13,29,16,34,33,35,37,23,6,25,26,27,39,28);
-aWE("uncheck",18);
+aWE("uncheck",18,40);
 aWE("uniqu",39);
 aWE("unit",4,7,26);
 aWE("unwant",1);
@@ -807,17 +844,18 @@ aWE("upward",7);
 aWE("us",3,5,0,1,7,10,11,13,29,30,16,31,32,35,36,23,38,26,27,39,28,40);
 aWE("usag",17);
 aWE("usual",26);
+aWE("utility",5,0);
 aWE("v",7,38);
 aWE("validat",5);
 aWE("valu",3,4,0,7,8,2,11,12,13,16,18,21,32,34,35,36,37,23,6,26,27,39,28);
-aWE("variabl",36,38);
+aWE("variabl",5,0,36,38);
 aWE("variou",20);
 aWE("vary",39);
 aWE("ve",0);
 aWE("vector",3,8,13,16,21,34,35,36,37,23,26,28);
 aWE("verbal",33);
 aWE("vertex",35);
-aWE("vertical",1,33,36,23);
+aWE("vertical",1,7,33,36,23);
 aWE("very",32,26);
 aWE("via",30,25,40);
 aWE("video",0);
@@ -834,8 +872,9 @@ aWE("well",8,23);
 aWE("what",18);
 aWE("whatev",35);
 aWE("wheel",5);
-aWE("whil",34);
-aWE("whol",3,35);
+aWE("wheth",5,0);
+aWE("whil",5,34);
+aWE("whol",3,35,23);
 aWE("why",3);
 aWE("width",7,36,23,6,28);
 aWE("will",3,5,0,1,7,8,9,2,10,11,12,13,15,14,16,18,19,21,32,34,33,35,22,36,37,23,24,6,25,26,27,39,28);
@@ -845,6 +884,7 @@ aWE("wirefram",6);
 aWE("wish",33,6,40);
 aWE("within",32,35,36,6);
 aWE("without",4,30,31);
+aWE("work",5,0);
 aWE("would",0,35);
 aWE("written",36);
 aWE("x",1,7,31,33,35,36,23,24);
index 03b69286a798e077fe6e097e4d31e3ba03631fb4..fe3b5c793b370bfc25b247e040ae5520868f5c92 100755 (executable)
@@ -8,12 +8,12 @@
 <script language="javascript" src="whtdata.js"></script>
 <script language="javascript">
 <!--
- aTE(1,45,"Post-Pro module");
+ aTE(1,44,"Post-Pro module");
    aTE(2,0,"Introduction to Post-Pro","files/introduction.htm");
    aTE(2,0,"Running Post-Pro","files/running_visu.htm");
    aTE(2,0,"Importing MED files","files/importing_med_objects.htm");
    aTE(2,0,"Structure of MED objects","files/about_structure_of_med_object.htm");
-   aTE(1,30,"3D presentations");
+   aTE(1,29,"3D presentations");
      aTE(2,0,"Presentation of a submesh","files/creating_presentations.htm");
      aTE(1,21,"Field presentations");
        aTE(2,0,"Creating field presentations","files/creating_field_presentations.htm");
@@ -37,9 +37,8 @@
          aTE(2,0,"Picking","picking.htm");
          aTE(2,0,"Segmentation","segmentation.htm");
          aTE(2,0,"Recording in Gauss Viewer","animation_in_gauss_viewer.htm");
-     aTE(1,6,"Viewing 3D presentations");
+     aTE(1,5,"Viewing 3D presentations");
        aTE(2,0,"Viewing 3D Presentations","files/changing_visualization_parameters_of_the_presenetation.htm");
-       aTE(2,0,"VTK 3D Viewer","vtk_3d_viewer.htm");
        aTE(2,0,"Translate Presentation","files/scaling_presentations.htm");
        aTE(2,0,"Clipping ","clipping.htm");
        aTE(2,0,"Sweeping","files/sweeping.htm");
index 07ff04f968be121f11f963119cda2a94c8fbb329..49225222a9b1c33ffcf3088d84540013dfd9b1fe 100755 (executable)
@@ -1,9 +1,9 @@
 <?xml version='1.0' encoding='windows-1252' ?>
 <ftswdata>
-<key name="0"> 0,1,32,34,35,38,6,26,39, </key>
+<key name="0"> 5,0,1,11,32,34,35,38,6,26,39, </key>
 <key name="001"> 32, </key>
 <key name="01"> 39, </key>
-<key name="1"> 4,5,7,2,10,15,14,19,31,32,34,33,35,6,27, </key>
+<key name="1"> 4,5,0,7,2,10,11,15,14,19,31,32,34,33,35,6,27, </key>
 <key name="10"> 31,32,39, </key>
 <key name="100"> 0,32,6,26,39, </key>
 <key name="10n"> 33, </key>
 <key name="50"> 39, </key>
 <key name="512"> 35, </key>
 <key name="6"> 31,35, </key>
-<key name="8"> 35, </key>
+<key name="8"> 5,0,35, </key>
 <key name="abl"> 18,33,40, </key>
 <key name="abov"> 38, </key>
 <key name="abscissa"> 36, </key>
-<key name="absolut"> 39, </key>
+<key name="absolut"> 11,39, </key>
 <key name="acceptabl"> 27,39, </key>
 <key name="acces"> 30,33,6,25,39,40, </key>
 <key name="accessibl"> 14, </key>
 <key name="accuracy"> 26, </key>
 <key name="action"> 0,31,24, </key>
 <key name="activ"> 32,34,36,39, </key>
-<key name="activat"> 30,32,38, </key>
+<key name="activat"> 5,0,30,32,38, </key>
 <key name="activity"> 0, </key>
 <key name="actor"> 16,6, </key>
 <key name="actual"> 38, </key>
+<key name="ad"> 5,0, </key>
+<key name="add"> 23, </key>
 <key name="addition"> 0,32, </key>
 <key name="additional"> 5,12,13,14,21,34,22,37,23,26,28, </key>
 <key name="adjust"> 5,1,32,25, </key>
 <key name="advanc"> 31,33, </key>
 <key name="again"> 5, </key>
+<key name="aimation"> 5, </key>
 <key name="algorithm"> 11, </key>
 <key name="allow"> 4,5,0,1,7,11,12,13,14,30,18,21,31,32,34,33,36,37,23,24,38,6,25,26,27,39,28,40, </key>
 <key name="along"> 16,33,24,38,6, </key>
@@ -55,7 +58,7 @@
 <key name="animat"> 5,17, </key>
 <key name="animation"> 5,0,6,27, </key>
 <key name="anoth"> 5,12,26,27, </key>
-<key name="any"> 3,4,0,30,16,18,31,35, </key>
+<key name="any"> 3,4,0,7,30,16,18,31,35, </key>
 <key name="ap"> 1,29,23,24, </key>
 <key name="apex"> 32, </key>
 <key name="api"> 0, </key>
@@ -63,7 +66,7 @@
 <key name="appli"> 3,8,2,11,12,13,16,21,34,35,37,23,26,27,39,28, </key>
 <key name="application"> 18,22, </key>
 <key name="area"> 33,26,40, </key>
-<key name="around"> 11,12,32,34,38, </key>
+<key name="around"> 11,12,32,34,38,40, </key>
 <key name="arrang"> 6, </key>
 <key name="array"> 11, </key>
 <key name="arrow"> 28, </key>
@@ -75,7 +78,7 @@
 <key name="automatical"> 1,7,11,14,30,18,38,27, </key>
 <key name="availabl"> 0,30,16,31,6,40, </key>
 <key name="averag"> 39, </key>
-<key name="avi"> 0, </key>
+<key name="avi"> 5,0, </key>
 <key name="avoid"> 6, </key>
 <key name="ax"> 1,11,12,34,33,24,6,25,40, </key>
 <key name="axi"> 7,11,12,31,34,33,38,6,40, </key>
 <key name="bet"> 0, </key>
 <key name="bicolor"> 36,39, </key>
 <key name="big"> 35,28, </key>
+<key name="bin"> 5,0, </key>
 <key name="black"> 32,36, </key>
 <key name="blu"> 18,36, </key>
 <key name="bmp"> 30,33,35,6,40, </key>
 <key name="both"> 8,30,34,36,25,26,39, </key>
 <key name="bottom"> 33,36,38, </key>
-<key name="bound"> 26, </key>
+<key name="bound"> 26,40, </key>
 <key name="boundari"> 38, </key>
 <key name="boundary"> 3,32, </key>
-<key name="box"> 5,0,7,10,11,12,13,14,16,18,19,34,33,23,24,38,26,39,28, </key>
-<key name="brows"> 3,5,0,7,8,9,2,10,11,12,13,15,14,29,30,18,19,21,34,35,37,23,24,6,26,27,28, </key>
-<key name="build"> 18, </key>
-<key name="built"> 18,37, </key>
+<key name="box"> 5,0,7,10,11,12,13,14,16,18,19,34,33,23,24,38,26,39,28,40, </key>
+<key name="brows"> 3,5,0,7,8,9,2,10,11,12,13,15,14,29,30,18,19,21,34,35,37,23,24,6,25,26,27,28, </key>
+<key name="build"> 18,23, </key>
+<key name="built"> 18,37,23, </key>
 <key name="button"> 5,0,1,10,14,29,30,19,21,31,32,34,33,23,24,38,6,26,39,28,40, </key>
 <key name="cal"> 33,38, </key>
 <key name="calculation"> 3,35,23, </key>
 <key name="camera"> 32,35, </key>
 <key name="cancel"> 29,35,24, </key>
 <key name="cannot"> 35, </key>
-<key name="cas"> 30,32,23,39, </key>
+<key name="cas"> 5,30,32,23,39, </key>
 <key name="caus"> 6, </key>
 <key name="cel"> 3,4,8,2,11,12,13,16,21,34,37,23,26,27,39,28, </key>
 <key name="cell"> 16, </key>
 <key name="centr"> 32, </key>
 <key name="central"> 30,31, </key>
 <key name="certain"> 6, </key>
-<key name="chang"> 5,0,14,29,30,31,33,24,38,6,25,39, </key>
+<key name="chang"> 5,0,14,29,30,31,33,24,38,6,25,39,40, </key>
 <key name="channel"> 35, </key>
 <key name="characteristic"> 16,36,38, </key>
-<key name="check"> 5,7,11,12,13,18,34,33,36,23,6,26,28,40, </key>
+<key name="check"> 5,0,7,11,12,13,18,34,33,36,23,6,26,28,40, </key>
 <key name="checkbox"> 34, </key>
 <key name="checkmark"> 7, </key>
 <key name="choic"> 1,14,29,18, </key>
-<key name="choos"> 0,1,7,8,9,10,11,12,13,15,14,29,30,16,18,19,21,34,36,37,23,26,28, </key>
+<key name="choos"> 0,1,7,8,9,10,11,12,13,15,14,29,30,16,18,19,21,34,36,37,23,26,28,40, </key>
 <key name="chosen"> 3,0,10,16,24,26, </key>
 <key name="circl"> 7, </key>
 <key name="clamp"> 35, </key>
+<key name="clean"> 5, </key>
 <key name="click"> 5,0,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,32,34,33,22,37,23,24,38,6,25,26,27,28,40, </key>
 <key name="clip"> 0,1,38,6, </key>
 <key name="clockwis"> 31, </key>
 <key name="clon"> 33, </key>
 <key name="clos"> 18,35, </key>
+<key name="coincid"> 7, </key>
 <key name="color"> 7,11,12,13,32,34,33,35,36,23,26,39,28,40, </key>
 <key name="colour"> 18, </key>
 <key name="column"> 4,7, </key>
 <key name="combin"> 3,21,31, </key>
-<key name="command"> 31,38, </key>
+<key name="command"> 5,0,31,38, </key>
 <key name="common"> 30,6, </key>
 <key name="compar"> 37, </key>
 <key name="comparison"> 5,27, </key>
 <key name="complet"> 18, </key>
 <key name="complete"> 1, </key>
 <key name="complicat"> 26, </key>
-<key name="component"> 4,20,32,35,22,36,23, </key>
+<key name="component"> 4,5,20,32,35,22,36,23, </key>
 <key name="compos"> 3,5,2,10,27, </key>
-<key name="comput"> 35,39, </key>
+<key name="comput"> 5,0,35,39, </key>
 <key name="computation"> 26, </key>
 <key name="con"> 28, </key>
 <key name="concept"> 3, </key>
 <key name="creation"> 10,11,14,22,23,27, </key>
 <key name="cros"> 1,7,6, </key>
 <key name="ctrl"> 14,30,31, </key>
-<key name="current"> 30,31,32,35,36,25, </key>
+<key name="current"> 7,30,31,32,35,36,25, </key>
 <key name="cursor"> 32,35,38, </key>
 <key name="curv"> 7,10,11,33,25, </key>
 <key name="customiz"> 32, </key>
 <key name="delet"> 1,14, </key>
 <key name="depend"> 5,31,35,38,39, </key>
 <key name="depth"> 38, </key>
-<key name="describ"> 4, </key>
+<key name="describ"> 4,30,6, </key>
 <key name="description"> 31,33, </key>
 <key name="design"> 36, </key>
 <key name="desktop"> 22, </key>
 <key name="destin"> 5,20,33, </key>
+<key name="detail"> 30,6, </key>
 <key name="develop"> 30, </key>
 <key name="diagonal"> 7, </key>
 <key name="dialog"> 5,0,7,10,11,14,29,16,18,19,35,36,23,24,38,39, </key>
 <key name="diamond"> 7, </key>
-<key name="different"> 3,30,36,38,39, </key>
+<key name="different"> 3,5,30,36,38,39, </key>
 <key name="dimension"> 36,23, </key>
 <key name="direct"> 38, </key>
 <key name="direction"> 30,31,38,26, </key>
 <key name="directory"> 5, </key>
-<key name="disabl"> 34,36,39, </key>
+<key name="disabl"> 0,34,36,39, </key>
 <key name="displacement"> 11,12, </key>
 <key name="display"> 4,5,0,1,7,8,9,2,10,11,12,13,15,14,30,16,18,21,32,34,33,35,36,37,23,38,6,25,26,27,28,40, </key>
 <key name="distanc"> 1,32,35,24,6,40, </key>
 <key name="divid"> 3,31,39, </key>
 <key name="division"> 33, </key>
 <key name="do"> 31, </key>
+<key name="documentation"> 30,6, </key>
 <key name="doesn"> 33, </key>
 <key name="dominant"> 31, </key>
 <key name="don"> 33,35,40, </key>
 <key name="dot"> 7, </key>
 <key name="down"> 5,14,31, </key>
+<key name="download"> 5,0, </key>
 <key name="downward"> 7,40, </key>
 <key name="drag"> 33,38,40, </key>
 <key name="draw"> 33, </key>
 <key name="elaps"> 18, </key>
 <key name="element"> 3,16,32,38,6, </key>
 <key name="els"> 36, </key>
-<key name="empty"> 4, </key>
+<key name="empty"> 4,7, </key>
 <key name="end"> 5,32,35,38,27, </key>
 <key name="ent"> 14,16,19,21,23, </key>
 <key name="enter"> 11,12, </key>
 <key name="equal"> 21,35,23, </key>
 <key name="eras"> 14,30,38,6,25, </key>
 <key name="etc"> 30, </key>
+<key name="even"> 7, </key>
 <key name="every"> 3,5, </key>
 <key name="everyth"> 18, </key>
 <key name="exact"> 0,18, </key>
 <key name="exist"> 14,34,6,39, </key>
 <key name="exit"> 29,38, </key>
 <key name="explor"> 26, </key>
-<key name="export"> 30,19,33,6,40, </key>
+<key name="export"> 5,0,30,19,33,6,40, </key>
 <key name="expres"> 16, </key>
 <key name="extend"> 40, </key>
 <key name="extent"> 16, </key>
 <key name="fast"> 33, </key>
 <key name="featur"> 36,24,26, </key>
 <key name="field"> 3,5,8,11,12,13,14,29,16,17,18,20,21,34,37,23,24,6,26,27,28, </key>
-<key name="fil"> 3,4,0,17,18,19,35,23,25, </key>
+<key name="fil"> 3,4,5,0,17,18,19,35,23,25, </key>
 <key name="find"> 18, </key>
 <key name="finish"> 0,11,12,13,18,21,34,37,23,26,28, </key>
 <key name="first"> 5,32,38, </key>
 <key name="focal"> 31,32, </key>
 <key name="fold"> 3,19, </key>
 <key name="folder"> 3, </key>
-<key name="follow"> 3,5,1,7,8,10,14,30,16,19,31,32,33,22,23,6,25, </key>
+<key name="follow"> 3,5,0,1,7,8,10,14,30,16,19,31,32,33,22,23,6,25, </key>
 <key name="font"> 36,23,40, </key>
 <key name="form"> 2,16,20,33, </key>
 <key name="format"> 30,33,6,40, </key>
 <key name="freedom"> 31, </key>
 <key name="ful"> 18, </key>
 <key name="function"> 38, </key>
-<key name="functionaliti"> 40, </key>
+<key name="functionaliti"> 30,40, </key>
 <key name="functionality"> 4,0,7,34,33,38,40, </key>
 <key name="g"> 35, </key>
 <key name="gaus"> 0,29,30,31,32,35,36,38,39,40, </key>
 <key name="great"> 0,32,33,35,40, </key>
 <key name="grey"> 36, </key>
 <key name="grid"> 33, </key>
-<key name="group"> 3,18,26, </key>
+<key name="group"> 3,18,23,26, </key>
+<key name="gui"> 30,6, </key>
 <key name="h"> 7, </key>
 <key name="half"> 39, </key>
 <key name="halv"> 1,34, </key>
 <key name="highest"> 18, </key>
 <key name="highlight"> 16,32, </key>
 <key name="hold"> 14, </key>
+<key name="horisontal"> 7, </key>
 <key name="horizontal"> 1,33,36,23, </key>
 <key name="how"> 17,18, </key>
-<key name="i"> 36, </key>
+<key name="http"> 5,0, </key>
+<key name="i"> 16,36, </key>
 <key name="icon"> 11,12,13,29,21,34,22,37,23,26,28, </key>
 <key name="id"> 16,32, </key>
 <key name="if"> 5,0,1,7,11,14,16,18,32,34,33,35,36,23,26,28,40, </key>
 <key name="increas"> 5,30,31,34, </key>
 <key name="increment"> 31, </key>
 <key name="independent"> 3,31, </key>
-<key name="index"> 1, </key>
-<key name="indicat"> 3,23, </key>
+<key name="index"> 1,16, </key>
+<key name="indicat"> 3,5,0,7,23, </key>
 <key name="individual"> 32, </key>
 <key name="info"> 16,6, </key>
 <key name="information"> 3,16,32,33,35,6,39, </key>
 <key name="insid"> 11,38, </key>
 <key name="insidefram"> 6, </key>
 <key name="inspect"> 32,36,38, </key>
+<key name="instal"> 5,0, </key>
+<key name="install_root"> 5,0, </key>
+<key name="instead"> 11, </key>
 <key name="integration"> 26, </key>
 <key name="intend"> 5, </key>
 <key name="interaction"> 30,31, </key>
 <key name="interest"> 26, </key>
 <key name="interpolation"> 3, </key>
-<key name="interval"> 0,33,35, </key>
+<key name="interval"> 0,11,33,35, </key>
 <key name="introduc"> 31, </key>
 <key name="introduction"> 20, </key>
 <key name="invert"> 11, </key>
 <key name="isometric"> 40, </key>
 <key name="item"> 10,18,19, </key>
 <key name="iteration"> 32, </key>
+<key name="j"> 16, </key>
 <key name="jpeg"> 30,33,6,40, </key>
+<key name="jpeg2yuv"> 5,0, </key>
 <key name="jpg"> 30,33,35,6,40, </key>
 <key name="just"> 0, </key>
+<key name="k"> 16, </key>
 <key name="key"> 31,32,39, </key>
 <key name="keyboard"> 30,31,32,39, </key>
+<key name="kind"> 5, </key>
 <key name="label"> 36,23,25,40, </key>
 <key name="larg"> 23, </key>
 <key name="largest"> 39, </key>
 <key name="last"> 5, </key>
 <key name="latest"> 0, </key>
 <key name="latitud"> 35, </key>
-<key name="launch"> 5,17,22, </key>
+<key name="launch"> 17,22, </key>
 <key name="layout"> 30,16, </key>
 <key name="learn"> 38, </key>
 <key name="least"> 7, </key>
-<key name="left"> 10,30,31,32,33,36,40, </key>
+<key name="left"> 10,30,31,32,33,36,23,40, </key>
 <key name="leftward"> 7, </key>
 <key name="legend"> 33,25, </key>
-<key name="length"> 26,39,40, </key>
+<key name="length"> 11,26,39,40, </key>
 <key name="les"> 0,23, </key>
 <key name="level"> 35, </key>
 <key name="lik"> 3,22, </key>
 <key name="limit"> 35,36, </key>
 <key name="lin"> 4,7,2,10,11,32,33,36,6,26,28, </key>
 <key name="linear"> 33,36,25, </key>
-<key name="list"> 3,5,1,10,26, </key>
+<key name="list"> 3,5,1,10,23,26, </key>
 <key name="ll"> 0,33,40, </key>
 <key name="load"> 18, </key>
 <key name="local"> 31,36, </key>
-<key name="locat"> 8,11,12,19,32,34,36,38,6,26,39, </key>
-<key name="location"> 0,35,38, </key>
+<key name="locat"> 8,11,12,19,32,34,36,38,6,26,39,40, </key>
+<key name="location"> 5,0,35,38, </key>
 <key name="lock"> 30,31,40, </key>
 <key name="logarithmic"> 33,23,25, </key>
 <key name="longitud"> 35, </key>
 <key name="manipulat"> 30,31, </key>
 <key name="manipulation"> 30,31, </key>
 <key name="manipulator"> 31, </key>
-<key name="manual"> 4,11,12,38,6, </key>
+<key name="manual"> 4,11,12,38,6,40, </key>
 <key name="map"> 37,23, </key>
 <key name="mark"> 7,11,33,40, </key>
 <key name="marker"> 32,33,36, </key>
 <key name="max"> 18,36,39, </key>
 <key name="maximal"> 23, </key>
 <key name="maximum"> 21,33,35,36,26,39, </key>
-<key name="mean"> 32,39, </key>
+<key name="mean"> 5,32,39, </key>
 <key name="measur"> 35,26, </key>
+<key name="memory"> 5, </key>
 <key name="menu"> 5,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,34,33,35,22,37,23,38,6,25,26,27,39,28, </key>
 <key name="merg"> 6, </key>
-<key name="mesh"> 3,11,12,13,16,17,32,34,37,38,26,39,28, </key>
+<key name="mesh"> 3,11,12,13,16,17,32,34,37,23,38,26,39,28, </key>
 <key name="method"> 4, </key>
 <key name="might"> 6, </key>
 <key name="min"> 18,36,39, </key>
 <key name="minimal"> 23, </key>
 <key name="minimum"> 21,36,38,27,39, </key>
 <key name="minor"> 33, </key>
+<key name="mis"> 5,0, </key>
 <key name="mix"> 37, </key>
+<key name="mjpeg"> 5,0, </key>
+<key name="mjpegtool"> 5,0, </key>
 <key name="mod"> 0,1,30,31,32,33,36,23,6,28, </key>
 <key name="model"> 31, </key>
 <key name="modify"> 14,39, </key>
 <key name="navigation"> 31, </key>
 <key name="nb"> 36,23, </key>
 <key name="nbrfac"> 35, </key>
-<key name="ne"> 1, </key>
-<key name="necessary"> 16,18,19, </key>
+<key name="ne"> 5,0,1, </key>
+<key name="necessary"> 5,16,18,19, </key>
 <key name="negativ"> 36,39, </key>
+<key name="net"> 5,0, </key>
 <key name="new"> 1,8,2,10,17,19,33,22,38,6, </key>
 <key name="next"> 5,32, </key>
 <key name="nod"> 3, </key>
 <key name="now"> 1,29,32, </key>
 <key name="nth"> 36, </key>
 <key name="null"> 39, </key>
-<key name="numb"> 12,16,21,32,34,33,35,36,23,26,27,39,40, </key>
+<key name="numb"> 5,12,16,21,32,34,33,35,36,23,26,27,39,40, </key>
 <key name="number"> 32, </key>
 <key name="numerical"> 33, </key>
-<key name="object"> 3,5,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,31,34,33,37,23,24,6,26,27,28,40, </key>
+<key name="object"> 3,5,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,31,34,33,37,23,24,6,25,26,27,28,40, </key>
 <key name="observ"> 11,12, </key>
 <key name="obtain"> 35, </key>
 <key name="offset"> 40, </key>
 <key name="onnod"> 3, </key>
 <key name="opacity"> 6, </key>
 <key name="opaqu"> 32,6, </key>
-<key name="open"> 5,18,19,33,35, </key>
+<key name="open"> 18,19,33,35, </key>
 <key name="opengl"> 35, </key>
-<key name="operation"> 11,14,30,18,31,33,35, </key>
+<key name="operation"> 5,11,14,30,18,31,33,35, </key>
 <key name="opposit"> 1, </key>
+<key name="optimiz"> 5, </key>
 <key name="optimization"> 26, </key>
 <key name="option"> 5,7,13,15,14,30,18,31,33,36,6,25,26,27,28, </key>
 <key name="ordinary"> 37, </key>
 <key name="orient"> 1, </key>
 <key name="orientat"> 40, </key>
 <key name="orientation"> 1,11,12,34,36,23,38, </key>
-<key name="origin"> 36,23,38, </key>
+<key name="origin"> 36,23,38,40, </key>
 <key name="otherwis"> 18, </key>
 <key name="out"> 33,23,40, </key>
 <key name="output"> 26, </key>
 <key name="outsid"> 38, </key>
 <key name="overview"> 17, </key>
 <key name="own"> 3,23, </key>
+<key name="packag"> 5,0, </key>
 <key name="pagedn"> 31, </key>
 <key name="pageup"> 31, </key>
 <key name="palet"> 36, </key>
 <key name="pan"> 31,33,40, </key>
+<key name="parallel"> 5, </key>
 <key name="paramet"> 11,12,35,26, </key>
 <key name="parameter"> 5,1,7,11,12,13,14,30,17,21,34,35,36,37,23,38,6,26,28,40, </key>
 <key name="parent"> 32, </key>
 <key name="pars"> 18, </key>
-<key name="part"> 3,1,7,33,38,40, </key>
+<key name="part"> 3,5,0,1,7,33,38,40, </key>
 <key name="particl"> 26, </key>
 <key name="particular"> 3,10,26, </key>
-<key name="path"> 5,26, </key>
+<key name="party"> 5,0, </key>
+<key name="path"> 5,0,26, </key>
 <key name="paus"> 0, </key>
 <key name="per"> 0, </key>
-<key name="perform"> 3,0,18, </key>
+<key name="perform"> 3,0,18,40, </key>
+<key name="performanc"> 5, </key>
 <key name="period"> 3,5, </key>
 <key name="perpendicular"> 1, </key>
 <key name="personal"> 14, </key>
 <key name="plot2d"> 7,10, </key>
 <key name="plot2dview"> 7, </key>
 <key name="png"> 30,33,35,6,40, </key>
-<key name="point"> 3,29,30,16,31,32,33,35,36,38,6,26,39,40, </key>
+<key name="point"> 3,7,29,30,16,31,32,33,35,36,38,6,26,39,40, </key>
 <key name="pointer"> 28, </key>
 <key name="polylin"> 26, </key>
 <key name="pop"> 5,7,8,9,2,10,11,12,13,15,14,29,21,34,37,23,6,26,27,28, </key>
 <key name="positiv"> 36, </key>
 <key name="posses"> 16,31, </key>
 <key name="possibility"> 0,25, </key>
-<key name="possibl"> 1,8,31,38,39, </key>
+<key name="possibl"> 5,1,7,8,31,38,39, </key>
 <key name="post"> 3,4,5,0,7,8,2,10,11,30,17,18,19,20,33,22,23,6,26,27,40, </key>
 <key name="preferenc"> 18,31,32,35,22,23,6, </key>
 <key name="pres"> 5,0,29,30,32,33,40, </key>
 <key name="procedur"> 11, </key>
 <key name="proces"> 18,20,27,39, </key>
 <key name="produc"> 0,20, </key>
+<key name="product"> 5,0, </key>
 <key name="progres"> 18,35, </key>
 <key name="progression"> 36, </key>
 <key name="progressiv"> 0, </key>
 <key name="prompt"> 35, </key>
 <key name="propagation"> 26, </key>
+<key name="proper"> 5,0, </key>
 <key name="properti"> 5,0,13,29,30,33,36,23,6,25,28,40, </key>
 <key name="proportional"> 5, </key>
 <key name="provid"> 20,31,6, </key>
 <key name="rarefi"> 4, </key>
 <key name="rat"> 0,18, </key>
 <key name="ratio"> 30,31,32,39, </key>
-<key name="real"> 5,33,38,39, </key>
+<key name="real"> 5,11,33,38,39, </key>
 <key name="record"> 0,30, </key>
 <key name="rectangl"> 7,18, </key>
 <key name="red"> 36, </key>
 <key name="represent"> 3,4,7,34,33,23,6,25,26,28,40, </key>
 <key name="representation"> 3,14,33,6,25, </key>
 <key name="representativ"> 39, </key>
-<key name="requir"> 0,7,8,15,16,26, </key>
+<key name="requir"> 5,0,7,8,15,16,26, </key>
 <key name="reset"> 24,40, </key>
 <key name="resiz"> 33,40, </key>
 <key name="resolution"> 35, </key>
 <key name="rotat"> 1,30,31,38,40, </key>
 <key name="rotation"> 1,11,12,30,31,34,40, </key>
 <key name="row"> 4,7, </key>
-<key name="run"> 5,22, </key>
-<key name="s"> 3,32, </key>
+<key name="run"> 5,0,22, </key>
+<key name="s"> 3,32,23, </key>
 <key name="salom"> 7,30,20,31,35,22,23,24, </key>
-<key name="sam"> 7,11,14,30,31,23,38,6,39, </key>
+<key name="sam"> 5,7,11,14,30,31,23,38,6,39, </key>
 <key name="sav"> 5,0,30,33,36,23,25, </key>
 <key name="scal"> 13,34,33,36,37,23,24,6,25,39,28, </key>
 <key name="scalar"> 3,5,8,2,11,12,13,29,16,21,32,34,35,36,37,23,38,6,26,39,28, </key>
 <key name="segment"> 3,26, </key>
 <key name="segmentation"> 0,30,35,38, </key>
 <key name="select"> 5,1,7,8,2,10,11,12,13,14,29,30,16,18,19,21,32,34,33,36,37,23,24,6,25,26,27,39,28,40, </key>
-<key name="selectabl"> 1, </key>
+<key name="selectabl"> 5,1, </key>
 <key name="selection"> 30,16,32,6, </key>
 <key name="semi"> 32,38, </key>
 <key name="sensitiv"> 6, </key>
 <key name="separate"> 33,6, </key>
 <key name="serv"> 26, </key>
 <key name="session"> 0,23, </key>
-<key name="set"> 5,0,1,11,12,13,14,29,17,18,21,32,34,35,22,37,23,6,25,26,39,28, </key>
+<key name="set"> 5,0,1,11,12,13,14,29,17,18,21,32,34,35,22,37,23,6,25,26,39,28,40, </key>
 <key name="setting"> 0,30,18,33,25, </key>
 <key name="setup"> 5, </key>
 <key name="shad"> 35,6, </key>
 <key name="shap"> 12,13,35,37,39, </key>
 <key name="shift"> 13, </key>
-<key name="should"> 3,1,7,11,12,16,18,34,22,6,27, </key>
+<key name="should"> 3,5,0,1,7,11,12,16,18,34,22,6,27, </key>
 <key name="show"> 5,1,11,12,15,18,32,33,36,38,25,39,40, </key>
 <key name="shrink"> 6, </key>
 <key name="sid"> 12,36, </key>
 <key name="similar"> 38,26, </key>
 <key name="simpl"> 35, </key>
-<key name="simultaneou"> 5, </key>
-<key name="simultaneous"> 11,12,36,6, </key>
+<key name="simultaneous"> 5,11,12,36,6, </key>
 <key name="siz"> 0,16,32,33,35,26,39, </key>
 <key name="slow"> 32, </key>
 <key name="smal"> 35,26, </key>
 <key name="solv"> 6, </key>
 <key name="sometim"> 26, </key>
 <key name="sourc"> 26, </key>
+<key name="sourceforg"> 5,0, </key>
 <key name="spac"> 11,12,16,34,36,39, </key>
 <key name="spacemous"> 31, </key>
 <key name="spe"> 5,31, </key>
 <key name="stream"> 26, </key>
 <key name="streamlin"> 26, </key>
 <key name="strict"> 40, </key>
-<key name="structur"> 3,1,7,11,18,26, </key>
+<key name="structur"> 3,1,7,11,16,18,26, </key>
 <key name="study"> 5,7,10,11,17,22, </key>
 <key name="styl"> 30,31, </key>
 <key name="subfold"> 3,8,14,30,6, </key>
 <key name="submenu"> 8, </key>
 <key name="submesh"> 3,8,9,16,17,20,24, </key>
 <key name="substitut"> 0, </key>
+<key name="successiv"> 5, </key>
 <key name="suggest"> 35, </key>
 <key name="superposition"> 6, </key>
 <key name="support"> 31, </key>
 <key name="suspend"> 0, </key>
 <key name="sweep"> 5,17,18,6,27, </key>
 <key name="switch"> 30,31,6, </key>
+<key name="syntax"> 5,0, </key>
 <key name="system"> 0,31,35,39, </key>
 <key name="systematical"> 36, </key>
 <key name="t"> 18,33,35,40, </key>
 <key name="tab"> 4,11,12,13,19,21,34,37,23,38,26,28, </key>
-<key name="tabl"> 3,4,7,2,11,15,16,17,19,20,33, </key>
+<key name="tabl"> 3,4,7,2,11,15,16,17,19,20,33,25, </key>
 <key name="tail"> 28, </key>
 <key name="tak"> 26,27, </key>
 <key name="taken"> 7,11,13,36, </key>
 <key name="tensor"> 35,36, </key>
 <key name="text"> 36,23, </key>
 <key name="textur"> 35, </key>
-<key name="them"> 4,1,7,30,21,31,32,35,6,40, </key>
+<key name="them"> 4,5,1,7,21,31,32,35,23,6,40, </key>
 <key name="therefor"> 35, </key>
 <key name="thick"> 6, </key>
 <key name="thin"> 6, </key>
+<key name="third"> 5,0, </key>
 <key name="thought"> 35,26, </key>
 <key name="thre"> 3,4,11,12,34,35,23,39, </key>
 <key name="threshold"> 35, </key>
 <key name="tick"> 40, </key>
 <key name="tilt"> 31, </key>
 <key name="tim"> 3,5,0,8,11,12,13,14,29,30,18,21,34,36,37,23,38,6,26,27,28, </key>
+<key name="tip"> 7, </key>
 <key name="titl"> 4,33,23, </key>
 <key name="togeth"> 3, </key>
 <key name="toggl"> 31, </key>
 <key name="toleranc"> 32, </key>
+<key name="tool"> 5,0,7, </key>
 <key name="toolbar"> 8,11,12,13,14,29,30,21,31,32,34,33,22,37,23,38,26,28,40, </key>
 <key name="top"> 32,33,38, </key>
 <key name="total"> 35, </key>
 <key name="two"> 0,1,7,10,11,12,30,32,34,35,36,37,38, </key>
 <key name="txt"> 4,19, </key>
 <key name="typ"> 3,5,7,8,11,12,13,29,16,34,33,35,37,23,6,25,26,27,39,28, </key>
-<key name="uncheck"> 18, </key>
+<key name="uncheck"> 18,40, </key>
 <key name="uniqu"> 39, </key>
 <key name="unit"> 4,7,26, </key>
 <key name="unwant"> 1, </key>
 <key name="us"> 3,5,0,1,7,10,11,13,29,30,16,31,32,35,36,23,38,26,27,39,28,40, </key>
 <key name="usag"> 17, </key>
 <key name="usual"> 26, </key>
+<key name="utility"> 5,0, </key>
 <key name="v"> 7,38, </key>
 <key name="validat"> 5, </key>
 <key name="valu"> 3,4,0,7,8,2,11,12,13,16,18,21,32,34,35,36,37,23,6,26,27,39,28, </key>
-<key name="variabl"> 36,38, </key>
+<key name="variabl"> 5,0,36,38, </key>
 <key name="variou"> 20, </key>
 <key name="vary"> 39, </key>
 <key name="ve"> 0, </key>
 <key name="vector"> 3,8,13,16,21,34,35,36,37,23,26,28, </key>
 <key name="verbal"> 33, </key>
 <key name="vertex"> 35, </key>
-<key name="vertical"> 1,33,36,23, </key>
+<key name="vertical"> 1,7,33,36,23, </key>
 <key name="very"> 32,26, </key>
 <key name="via"> 30,25,40, </key>
 <key name="video"> 0, </key>
 <key name="what"> 18, </key>
 <key name="whatev"> 35, </key>
 <key name="wheel"> 5, </key>
-<key name="whil"> 34, </key>
-<key name="whol"> 3,35, </key>
+<key name="wheth"> 5,0, </key>
+<key name="whil"> 5,34, </key>
+<key name="whol"> 3,35,23, </key>
 <key name="why"> 3, </key>
 <key name="width"> 7,36,23,6,28, </key>
 <key name="will"> 3,5,0,1,7,8,9,2,10,11,12,13,15,14,16,18,19,21,32,34,33,35,22,36,37,23,24,6,25,26,27,39,28, </key>
 <key name="wish"> 33,6,40, </key>
 <key name="within"> 32,35,36,6, </key>
 <key name="without"> 4,30,31, </key>
+<key name="work"> 5,0, </key>
 <key name="would"> 0,35, </key>
 <key name="written"> 36, </key>
 <key name="x"> 1,7,31,33,35,36,23,24, </key>
index 4e9b495ddf337019cb2b13b4cc2ad2f751e34dde..14a0dff2ade979f20858261be2735c7024800ec9 100755 (executable)
@@ -33,7 +33,6 @@
     </book>
     <book name="Viewing 3D presentations" >
       <item name="Viewing 3D Presentations" url="files/changing_visualization_parameters_of_the_presenetation.htm" />
-      <item name="VTK 3D Viewer" url="vtk_3d_viewer.htm" />
       <item name="Translate Presentation" url="files/scaling_presentations.htm" />
       <item name="Clipping " url="clipping.htm" />
       <item name="Sweeping" url="files/sweeping.htm" />
@@ -52,8 +51,7 @@
     <item name="Plot2D Viewer" url="plot2d_viewer.htm" />
     <item name="Setting properties of XY plots" url="files/setting_properties_of_xy_plots.htm" />
   </book>
-<item name="Access to Post-Pro module functionality from Python (using VISU_Gen.idl)" url="visugenidl_doc/VISU__Gen_8idl.html" />
-
+<item name="Access to Post-Pro module functionality from Python (using VISU_Gen.idl)" url="visugenidl_doc/VISU__Gen_8idl.html" /> 
 </book>
 
 </tocdata>
index 92044b8a5ee909e20ab53a7e4601ce8c33b77672..72e58c180d0cda41c8c8052a9995efd1e6243586 100644 (file)
@@ -34,6 +34,8 @@ salomeinclude_HEADERS= \
        VISU_ConvertorUtils.hxx  \
        VISU_MergeFilter.hxx \
        VISU_ExtractUnstructuredGrid.hxx \
+       VISU_AppendFilter.hxx \
+       VISU_CommonCellsFilter.hxx \
        VISUConvertor.hxx
 
 dist_libVisuConvertor_la_SOURCES= \
@@ -43,7 +45,9 @@ dist_libVisuConvertor_la_SOURCES= \
        VISU_ConvertorUtils.cxx \
        VISU_ExtractUnstructuredGrid.cxx \
        VISU_MergeFilter.cxx \
-       VISU_MedConvertor.cxx
+       VISU_MedConvertor.cxx \
+       VISU_AppendFilter.cxx \
+       VISU_CommonCellsFilter.cxx
 
 libVisuConvertor_la_CPPFLAGS= \
        -ftemplate-depth-32 \
diff --git a/src/CONVERTOR/VISU_AppendFilter.cxx b/src/CONVERTOR/VISU_AppendFilter.cxx
new file mode 100644 (file)
index 0000000..70fac47
--- /dev/null
@@ -0,0 +1,308 @@
+//  SALOME OBJECT : kernel of SALOME 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   : VISU_GeometryFilter.cxx
+//  Author : 
+//  Module : SALOME
+//  $Header$
+
+#include "VISU_AppendFilter.hxx"
+
+#include <vtkCell.h>
+#include <vtkCellData.h>
+#include <vtkDataSetAttributes.h>
+#include <vtkDataSetCollection.h>
+#include <vtkObjectFactory.h>
+#include <vtkPointData.h>
+#include <vtkUnstructuredGrid.h>
+
+#include <vtkPoints.h>
+#include <vtkIntArray.h>
+
+#include <algorithm>
+#include <vector>
+#include <map>
+
+vtkCxxRevisionMacro(VISU_AppendFilter, "$Revision$");
+vtkStandardNewMacro(VISU_AppendFilter);
+
+VISU_AppendFilter
+::VISU_AppendFilter():
+  myIsMergingInputs(false)
+{}
+
+VISU_AppendFilter
+::~VISU_AppendFilter()
+{}
+
+void
+VISU_AppendFilter
+::SetSharedPointsDataSet(vtkPointSet* thePointsDataSet)
+{
+  if(GetSharedPointsDataSet() == thePointsDataSet)
+    return;
+
+  mySharedPointsDataSet = thePointsDataSet;
+
+  Modified();
+}
+
+vtkPointSet*
+VISU_AppendFilter
+::GetSharedPointsDataSet()
+{
+  return mySharedPointsDataSet.GetPointer();
+}
+
+void
+VISU_AppendFilter
+::SetMergingInputs(bool theIsMergingInputs)
+{
+  if(myIsMergingInputs == theIsMergingInputs)
+    return;
+
+  myIsMergingInputs = theIsMergingInputs;
+  Modified();
+}
+  
+bool
+VISU_AppendFilter
+::IsMergingInputs()
+{
+  return myIsMergingInputs;
+}
+  
+
+namespace
+{
+  typedef vtkIdType TCellId;
+  typedef vtkIdType TInputId;
+  typedef std::pair<TInputId, TCellId> TInputCellId;
+
+  typedef vtkIdType TObjectId;
+  typedef std::map<TObjectId, TInputCellId> TObject2InputIdMap;
+  
+  void
+  DoMergingInputs(vtkCellData *theCellData, 
+                 TInputId theInputId,
+                 TObject2InputIdMap& theResult)
+  {
+    if(vtkDataArray *aDataArray = theCellData->GetArray("VISU_CELLS_MAPPER")){
+      if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
+       int aMaxId = anIntArray->GetMaxId();
+       int* aPointer = anIntArray->GetPointer(0);
+       int* anEndPointer = anIntArray->GetPointer(aMaxId + 1);
+       for(vtkIdType aCellId = 0; aPointer != anEndPointer; aPointer++, aCellId++){
+         TObjectId anObjectId = *aPointer;
+         TObject2InputIdMap::iterator anIter = theResult.find(anObjectId);
+         if(anIter != theResult.end())
+           continue;
+         TInputCellId anInputCellId(theInputId, aCellId);
+         theResult.insert(anIter, TObject2InputIdMap::value_type(anObjectId, anInputCellId));
+       }
+      }
+    }
+  }
+
+  struct TFillFieldList
+  {
+    vtkDataSetAttributes::FieldList myFieldList;
+    bool myIsFirstCellData;
+
+    TFillFieldList(vtkIdType theNbInputs):
+      myFieldList(theNbInputs),
+      myIsFirstCellData(true)
+    {}
+
+    void
+    operator()(TInputId theInputId, vtkDataSet* theDataSet)
+    {
+      vtkCellData *aCellData = theDataSet->GetCellData();
+      if(myIsFirstCellData){
+       myFieldList.InitializeFieldList(aCellData);
+       myIsFirstCellData = false;
+      }else{
+       myFieldList.IntersectFieldList(aCellData);
+      }
+    }
+    
+    virtual
+    vtkIdType
+    GetNbCells() const = 0;
+  };
+  
+  struct TCellCounter: TFillFieldList
+  {
+    vtkIdType myNbCells;
+    
+    TCellCounter(vtkIdType theNbInputs):
+      TFillFieldList(theNbInputs),
+      myNbCells(0)
+    {}
+
+    void
+    operator()(TInputId theInputId, vtkDataSet* theDataSet)
+    {
+      TFillFieldList::operator()(theInputId, theDataSet);
+      myNbCells += theDataSet->GetNumberOfCells();
+    }
+
+    virtual
+    vtkIdType
+    GetNbCells() const
+    {
+      return myNbCells;
+    }
+  };
+
+  struct TCellIdMerger: TFillFieldList
+  {
+    TObject2InputIdMap myObject2InputIdMap;
+
+    TCellIdMerger(vtkIdType theNbInputs):
+      TFillFieldList(theNbInputs)
+    {}
+
+    void
+    operator()(TInputId theInputId, vtkDataSet* theDataSet)
+    {
+      TFillFieldList::operator()(theInputId, theDataSet);
+      vtkCellData *aCellData = theDataSet->GetCellData();
+      DoMergingInputs(aCellData, theInputId, myObject2InputIdMap);
+    }
+
+    virtual
+    vtkIdType
+    GetNbCells() const
+    {
+      return myObject2InputIdMap.size();
+    }
+  };
+
+  template<class TFunctor>
+  void
+  ForEachInput(vtkAppendFilter* theFilter, TFunctor& theFunctor)
+  {
+    for(vtkIdType anInputId = 0; anInputId < theFilter->GetNumberOfInputPorts(); anInputId++){
+      if(vtkDataSet *aDataSet = theFilter->GetInput(anInputId)){
+        if(aDataSet->GetNumberOfPoints() <= 0 && aDataSet->GetNumberOfCells() <= 0){
+          continue; //no input, just skip
+        }
+       theFunctor(anInputId, aDataSet);
+      }//if non-empty dataset
+    }//for all inputs
+  }
+}
+
+
+void
+VISU_AppendFilter
+::Execute()
+{
+  if(GetSharedPointsDataSet()){
+    vtkPoints* aPoints = GetSharedPointsDataSet()->GetPoints();
+    if(aPoints->GetNumberOfPoints() < 1)
+      return;
+  
+    vtkUnstructuredGrid *anOutput = this->GetOutput(); 
+    if(IsMergingInputs()){
+      TCellIdMerger aFunctor(this->GetNumberOfInputPorts());
+      ForEachInput<TCellIdMerger>(this, aFunctor);
+
+      vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
+      TObject2InputIdMap& anObject2InputIdMap = aFunctor.myObject2InputIdMap;
+      vtkIdType aNbCells = aFunctor.GetNbCells();
+      if(aNbCells < 1)
+       return;
+    
+      // Now can allocate memory
+      anOutput->Allocate(aNbCells); 
+      vtkCellData *anOutputCellData = anOutput->GetCellData();
+      anOutputCellData->CopyAllocate(aFieldList, aNbCells);
+      
+      // Append each input dataset together
+      // 1.points
+      anOutput->SetPoints(GetSharedPointsDataSet()->GetPoints());
+      anOutput->GetPointData()->PassData(GetSharedPointsDataSet()->GetPointData());
+      
+      // 2.cells
+      vtkIdList *anIdList = vtkIdList::New(); 
+      anIdList->Allocate(VTK_CELL_SIZE);
+      TObject2InputIdMap::const_iterator anIter = anObject2InputIdMap.begin();
+      TObject2InputIdMap::const_iterator anEndIter = anObject2InputIdMap.end();
+      for(; anIter != anEndIter; anIter++){
+       //TObjectId anObjectId = anIter->first;
+       const TInputCellId& anInputCellId = anIter->second;
+       TInputId anInputId = anInputCellId.first;
+       if(vtkDataSet *aDataSet = this->GetInput(anInputId)){
+         TCellId aCellId = anInputCellId.second;
+         aDataSet->GetCellPoints(aCellId, anIdList);
+         
+         vtkIdType aCellType = aDataSet->GetCellType(aCellId);
+         vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
+         
+         vtkCellData *aCellData = aDataSet->GetCellData();
+         anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
+       }
+      }
+      anIdList->Delete();
+    }else{
+      TCellCounter aFunctor(this->GetNumberOfInputPorts());
+      ForEachInput<TCellCounter>(this, aFunctor);
+
+      vtkDataSetAttributes::FieldList& aFieldList = aFunctor.myFieldList;
+      vtkIdType aNbCells = aFunctor.GetNbCells();
+      if(aNbCells < 1)
+       return;
+    
+      // Now can allocate memory
+      anOutput->Allocate(aNbCells); 
+      vtkCellData *anOutputCellData = anOutput->GetCellData();
+      anOutputCellData->CopyAllocate(aFieldList, aNbCells);
+      
+      // Append each input dataset together
+      // 1.points
+      anOutput->SetPoints(GetSharedPointsDataSet()->GetPoints());
+      anOutput->GetPointData()->PassData(GetSharedPointsDataSet()->GetPointData());
+      
+      // 2.cells
+      vtkIdList *anIdList = vtkIdList::New(); 
+      anIdList->Allocate(VTK_CELL_SIZE);
+      for(vtkIdType anInputId = 0; anInputId < this->GetNumberOfInputPorts(); anInputId++) {
+       if(vtkDataSet *aDataSet = this->GetInput(anInputId)){
+         vtkIdType aNbCells = aDataSet->GetNumberOfCells(); 
+         vtkCellData *aCellData = aDataSet->GetCellData();
+         // copy cell and cell data
+         for(vtkIdType aCellId = 0; aCellId < aNbCells; aCellId++){
+           aDataSet->GetCellPoints(aCellId, anIdList);
+           vtkIdType aCellType = aDataSet->GetCellType(aCellId);
+           vtkIdType aNewCellId = anOutput->InsertNextCell(aCellType, anIdList);
+           anOutputCellData->CopyData(aFieldList, aCellData, anInputId, aCellId, aNewCellId);
+         }
+       }
+      }
+      anIdList->Delete();
+    }
+  }else
+    Superclass::Execute();
+}
diff --git a/src/CONVERTOR/VISU_AppendFilter.hxx b/src/CONVERTOR/VISU_AppendFilter.hxx
new file mode 100644 (file)
index 0000000..fd9a827
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+//
+// 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_APPENDFILTER_H
+#define VISU_APPENDFILTER_H
+
+#include <vtkAppendFilter.h>
+#include <vtkSmartPointer.h>
+
+class vtkPointSet;
+
+/*! \brief This class used same as vtkAppendFilter. See documentation on VTK for more information.
+ */
+class VISU_AppendFilter : public vtkAppendFilter 
+{
+public:
+  /*! \fn static VISU_AppendFilter *New()
+   */
+  static VISU_AppendFilter *New();
+  
+  /*! \fn vtkTypeRevisionMacro(VISU_AppendFilter, vtkAppendFilter)
+   *  \brief VTK type revision macros.
+   */
+  vtkTypeRevisionMacro(VISU_AppendFilter, vtkAppendFilter);
+
+  void
+  SetSharedPointsDataSet(vtkPointSet* thePointsDataSet);
+
+  vtkPointSet*
+  GetSharedPointsDataSet();
+
+  void
+  SetMergingInputs(bool theIsMergingInputs);
+  
+  bool
+  IsMergingInputs();
+  
+protected:
+  /*! \fn VISU_AppendFilter();
+   * \brief Constructor
+   */
+  VISU_AppendFilter();
+  /*! \fn ~VISU_AppendFilter();
+   * \brief Destructor.
+   */
+  ~VISU_AppendFilter();
+  /*! \fn void Execute();
+   * \brief Filter culculation method.
+   */
+  virtual void Execute();
+
+  bool myIsMergingInputs;
+  vtkSmartPointer<vtkPointSet> mySharedPointsDataSet;
+};
+
+#endif
diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.cxx b/src/CONVERTOR/VISU_CommonCellsFilter.cxx
new file mode 100644 (file)
index 0000000..6ca4275
--- /dev/null
@@ -0,0 +1,269 @@
+// File      : VISU_CommonCellsFilter.cxx
+// Created   : Wed Apr  4 08:45:07 2007
+// Author    : Eugeny NIKOLAEV (enk)
+// Copyright : Open CASCADE
+
+#include "VISU_CommonCellsFilter.hxx"
+
+// VTK product headers
+#include <vtkUnstructuredGrid.h>
+#include <vtkSetGet.h>
+#include <vtkObjectFactory.h>
+#include <vtkDataSet.h>
+#include <vtkCellTypes.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
+#include <vtkIdList.h>
+#include <vtkFloatArray.h>
+#include <vtkCell.h>
+
+// STL
+#include <algorithm>
+#include <vector>
+#include <map>
+
+namespace
+{
+  typedef std::vector<int> TSortedArray;
+  typedef std::map<int,int> TId2IdMap;
+
+  inline
+  void
+  GetSortedArray(vtkIntArray *theArray, 
+                TSortedArray& theSortedArray)
+  {
+    int aMaxId = theArray->GetMaxId();
+    int* aPointer = theArray->GetPointer(0);
+    int* anEndPointer = theArray->GetPointer(aMaxId + 1);
+    TSortedArray aSortedArray(aPointer, anEndPointer);
+    std::sort(aSortedArray.begin(), aSortedArray.end());
+    theSortedArray.swap(aSortedArray);
+  }
+
+  inline
+  void
+  GetIdsForCopy(vtkUnstructuredGrid *inputUGrid, 
+                vtkIntArray* inputPointIds,
+                TSortedArray& outputSortedArray)
+  {
+    if(inputUGrid){
+      TSortedArray aSortedPointIds;
+      TSortedArray aOutputCellIds;
+      GetSortedArray(inputPointIds,aSortedPointIds);
+      
+      int nbInputCells = inputUGrid->GetNumberOfCells();
+
+      TSortedArray aPointCellIds;
+      for(int idCell=0;idCell<nbInputCells;idCell++){
+        aPointCellIds.clear();
+        vtkCell*   aCell = inputUGrid->GetCell(idCell);
+        vtkIdList* ptIds = aCell->GetPointIds();
+        int aMaxId = ptIds->GetNumberOfIds();
+        int* aPointer = ptIds->GetPointer(0);
+        int* anEndPointer = ptIds->GetPointer(aMaxId + 1);
+        TSortedArray aSortedArray(aPointer, anEndPointer);
+        std::sort(aSortedArray.begin(), aSortedArray.end());
+
+        int aMaxLength = std::max(aSortedArray.size(), aSortedPointIds.size());
+        TSortedArray anIntersectionArray(aMaxLength);
+        TSortedArray::iterator anArrayIter = anIntersectionArray.begin();
+        anArrayIter = std::set_intersection(aSortedArray.begin(),
+                                            aSortedArray.end(),
+                                            aSortedPointIds.begin(),
+                                            aSortedPointIds.end(),
+                                            anArrayIter);
+        anIntersectionArray.erase(anArrayIter, anIntersectionArray.end());
+        if(anIntersectionArray.size() == aSortedArray.size())
+          aOutputCellIds.push_back(idCell);
+      }
+
+      outputSortedArray.swap(aOutputCellIds);
+    }
+  }
+
+  inline
+  void
+  CopyElementsToOutput(vtkUnstructuredGrid* theInputUG,
+                       int& theNbElements,
+                       TSortedArray& theElementIdsForCopy,
+                       TId2IdMap& theOldId2NewIdPointsMap,
+                       vtkIntArray* theOuputIDSArray,
+                       vtkUnstructuredGrid* theOutputUG)
+  {
+    vtkIntArray* aInputCellsMapper =
+      dynamic_cast<vtkIntArray*>(theInputUG->GetCellData()->GetArray("VISU_CELLS_MAPPER"));
+    int* aInputCellsMapperPointer = aInputCellsMapper->GetPointer(0);
+    for(int aCellIndex=0;aCellIndex<theNbElements;aCellIndex++){
+      int aCellId = theElementIdsForCopy[aCellIndex];
+      vtkIdList* aOldPointIds = theInputUG->GetCell(aCellId)->GetPointIds();
+      vtkIdList* aNewPointIds = vtkIdList::New();
+      int nbPointIds = aOldPointIds->GetNumberOfIds();
+      aNewPointIds->SetNumberOfIds(nbPointIds);
+      for(int j=0;j<nbPointIds;j++){
+        int aOldId = aOldPointIds->GetId(j);
+        int aNewId = theOldId2NewIdPointsMap[aOldId];
+        aNewPointIds->SetId(j,aNewId);
+      }
+      const int aOldCellId = theElementIdsForCopy[aCellIndex];
+      theOutputUG->InsertNextCell(theInputUG->GetCellType(aOldCellId),
+                                  aNewPointIds);
+      if(aInputCellsMapperPointer)
+        theOuputIDSArray->InsertNextValue(aInputCellsMapperPointer[aOldCellId]);
+      else
+        theOuputIDSArray->InsertNextValue(aOldCellId);
+      
+      aNewPointIds->Delete();
+    }
+  }
+}
+
+vtkStandardNewMacro(VISU_CommonCellsFilter);
+
+VISU_CommonCellsFilter
+::VISU_CommonCellsFilter()
+{}
+
+VISU_CommonCellsFilter
+::~VISU_CommonCellsFilter()
+{}
+
+void
+VISU_CommonCellsFilter
+::SetProfileUG(vtkUnstructuredGrid *input)
+{
+  this->SetInput(input);
+}
+
+vtkUnstructuredGrid*
+VISU_CommonCellsFilter
+::GetProfileUG()
+{
+  return dynamic_cast<vtkUnstructuredGrid*>(this->GetInput());
+}
+
+void
+VISU_CommonCellsFilter
+::SetCellsUG(vtkUnstructuredGrid *input)
+{
+  this->vtkProcessObject::SetNthInput(1, input);
+}
+
+vtkUnstructuredGrid*
+VISU_CommonCellsFilter
+::GetCellsUG()
+{
+  if (this->NumberOfInputs < 2)
+  {
+    return NULL;
+  }
+  return dynamic_cast<vtkUnstructuredGrid*>(this->Inputs[1]);
+}
+
+void
+VISU_CommonCellsFilter
+::Execute()
+{
+  vtkUnstructuredGrid* anInputProfileUG = this->GetProfileUG();
+  vtkUnstructuredGrid* anInputCellsUG   = this->GetCellsUG();
+
+  vtkUnstructuredGrid* anOutput         = this->GetOutput();
+  
+  if(anInputCellsUG == NULL){
+    anOutput->ShallowCopy(anInputProfileUG);
+  }
+  else{
+    // check if anInputProfileUG already have cells types not equal VTK_VERTEX
+    vtkCellTypes* aCellTypes = vtkCellTypes::New();
+
+    anInputProfileUG->GetCellTypes(aCellTypes);
+    if(aCellTypes){
+      if (aCellTypes->GetNumberOfTypes()!=1 )
+        anOutput->ShallowCopy(anInputProfileUG);
+      else{
+        if(aCellTypes->GetCellType(0) != VTK_VERTEX)
+          anOutput->DeepCopy(anInputProfileUG);
+        else{
+
+          vtkCellData* aInputCellData = anInputProfileUG->GetCellData();
+
+          //
+          // Calculate output points
+          //
+          vtkIdList* aPointIdsForCopy = vtkIdList::New();
+          vtkPoints* aOutputPointSet = vtkPoints::New();
+          TId2IdMap  aOldId2NewIdPointsMap;
+          
+          aOutputPointSet->Reset();
+          
+          vtkIntArray* aPointIDS =
+            dynamic_cast<vtkIntArray*>(aInputCellData->GetArray("VISU_CELLS_MAPPER"));
+          if(aPointIDS){
+            aPointIdsForCopy->SetNumberOfIds(aPointIDS->GetNumberOfTuples());
+            for(int i=0;i<aPointIDS->GetNumberOfTuples();i++){
+              aPointIdsForCopy->SetId(i,aPointIDS->GetValue(i));
+            }
+            aOutputPointSet->SetNumberOfPoints(aPointIdsForCopy->GetNumberOfIds());
+            // aOutputPointSet copy points from anInputProfileUG to aOutputPointSet, which
+            // in aPointIdsForCopy ids list
+            anInputProfileUG->GetPoints()->GetPoints(aPointIdsForCopy,aOutputPointSet);
+            for(int i=0;i<aPointIdsForCopy->GetNumberOfIds();i++)
+              aOldId2NewIdPointsMap[aPointIdsForCopy->GetId(i)] = i;
+            anOutput->SetPoints(aOutputPointSet);
+          }
+          aOutputPointSet->Delete();
+          // applay scalar,vector,normal,tensor ... values
+          anOutput->GetPointData()->CopyFieldOff("VISU_CELLS_MAPPER");
+          anOutput->GetPointData()->CopyFieldOff("VISU_POINTS_MAPPER");
+          anOutput->GetPointData()->PassData(aInputCellData);
+          //anOutput->GetPointData()->GetArray("VISU_CELLS_MAPPER")->SetName("VISU_POINTS_MAPPER");
+
+          // apply VISU_POINTS_MAPPER
+          vtkIntArray*  aNewPointsIdsArray = vtkIntArray::New();
+          aNewPointsIdsArray->SetName("VISU_POINTS_MAPPER");
+          aNewPointsIdsArray->SetNumberOfComponents(1);
+          aNewPointsIdsArray->SetNumberOfTuples(aPointIdsForCopy->GetNumberOfIds());
+          for(int i=0;i<aPointIdsForCopy->GetNumberOfIds();i++)
+            aNewPointsIdsArray->SetValue(i,aPointIdsForCopy->GetId(i));
+          anOutput->GetPointData()->AddArray(aNewPointsIdsArray);
+
+          
+            
+          aNewPointsIdsArray->Delete();
+          
+          
+          // Calculate output cells
+          int nbCells=0;
+
+          TSortedArray aCellIdsForCopy;
+          
+          GetIdsForCopy(anInputCellsUG,aPointIDS,aCellIdsForCopy);
+          nbCells = aCellIdsForCopy.size();
+
+          // copy cells to output
+          int aAllocMem = nbCells;
+          anOutput->Allocate(aAllocMem);
+          vtkIntArray* theOuputIDSArray = vtkIntArray::New();
+          theOuputIDSArray->SetName("VISU_CELLS_MAPPER");
+          theOuputIDSArray->SetNumberOfComponents(1);
+          theOuputIDSArray->SetNumberOfTuples(aAllocMem);
+          
+          if(nbCells>0 && anInputCellsUG)
+            CopyElementsToOutput(anInputCellsUG,
+                                 nbCells,
+                                 aCellIdsForCopy,
+                                 aOldId2NewIdPointsMap,
+                                 theOuputIDSArray,
+                                 anOutput);
+          
+          anOutput->GetCellData()->AddArray(theOuputIDSArray);
+
+          theOuputIDSArray->Delete();
+          aPointIdsForCopy->Delete();
+        }
+      }
+      
+    }
+    else
+      anOutput->ShallowCopy(anInputProfileUG);
+  }
+}
diff --git a/src/CONVERTOR/VISU_CommonCellsFilter.hxx b/src/CONVERTOR/VISU_CommonCellsFilter.hxx
new file mode 100644 (file)
index 0000000..1113ea4
--- /dev/null
@@ -0,0 +1,41 @@
+// File      : VISU_CommonCellsFilter.hxx
+// Created   : Tue Apr  3 16:16:53 2007
+// Author    : Eugeny NIKOLAEV (enk)
+// Copyright : Open CASCADE
+
+
+#ifndef VISU_CommonCellsFilter_HeaderFile
+#define VISU_CommonCellsFilter_HeaderFile
+
+#include <vtkUnstructuredGridToUnstructuredGridFilter.h>
+
+class VISU_CommonCellsFilter: public vtkUnstructuredGridToUnstructuredGridFilter
+{
+public:
+  static VISU_CommonCellsFilter *New();
+  vtkTypeMacro(VISU_CommonCellsFilter,vtkUnstructuredGridToUnstructuredGridFilter);
+
+  // Description:
+  // Specify the Unstructured Grid which overview
+  // nodal profile.
+  void SetProfileUG(vtkUnstructuredGrid *input);
+  vtkUnstructuredGrid* GetProfileUG();
+
+  // Description:
+  // Specify the Unstructured Grid which overview
+  // cells data on CELL_ENTITY.
+  void SetCellsUG(vtkUnstructuredGrid *input);
+  vtkUnstructuredGrid* GetCellsUG();
+
+protected:
+  VISU_CommonCellsFilter();
+  ~VISU_CommonCellsFilter();
+
+  void Execute(); //generate output data
+
+private:
+  VISU_CommonCellsFilter(const VISU_CommonCellsFilter&); // Lock copy
+  void operator=(const VISU_CommonCellsFilter&); // Lock copy
+};
+
+#endif
index 6b556b74c27c47678174f1d98d2bb9f38b1a4ee9..450321cc98024e2680c7e47e15c6ae46b0328096 100644 (file)
@@ -173,7 +173,15 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  typedef std::set<PFamily> TFamilySet;
+
+  class FamilyCmp {
+   public:
+    bool operator() (const PFamily& theFamily1, const PFamily& theFamily2) const {
+       return (theFamily1->myName < theFamily2->myName);
+    }
+  };
+
+  typedef std::set<PFamily, FamilyCmp> TFamilySet;
 
   //! Define a basic class for MED GROUP entity
   struct TGroup: virtual TIDMapper
index 1d7782c67aab0b359069c4849aafd7af55b56ab4..3a5abfafedc4cba9aae0773dbfa05206e81bd6cf 100644 (file)
 #include "VISU_ConvertorUtils.hxx"
 
 #include <vtkUnstructuredGridWriter.h>
-#include <vtkTimerLog.h>
 #include <vtkUnstructuredGrid.h>
+#include <vtkTimerLog.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
+#include <vtkDataSet.h>
+
+#include <vtkIntArray.h>
+#include <algorithm>
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -39,6 +45,7 @@ static int MYDEBUG = 0;
 namespace VISU
 {
 
+  //---------------------------------------------------------------
   void 
   WriteToFile(vtkUnstructuredGrid* theDataSet, const std::string& theFileName)
   {
@@ -51,6 +58,99 @@ namespace VISU
   }
 
 
+  //---------------------------------------------------------------
+  bool 
+  IsDataOnPoints(vtkDataSet* theDataSet)
+  {
+    theDataSet->Update();
+    vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData();
+    if(aDataSetAttributes->GetArray("VISU_POINTS_MAPPER"))
+      return aDataSetAttributes->GetNumberOfArrays() > 1;
+    return aDataSetAttributes->GetNumberOfArrays() > 0;
+  }
+
+
+  //---------------------------------------------------------------
+  bool 
+  IsDataOnCells(vtkDataSet* theDataSet)
+  {
+    theDataSet->Update();
+    vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
+    if(aDataSetAttributes->GetArray("VISU_CELLS_MAPPER"))
+      return aDataSetAttributes->GetNumberOfArrays() > 1;
+    return aDataSetAttributes->GetNumberOfArrays() > 0;
+  }
+
+
+  //---------------------------------------------------------------
+  vtkIdType
+  GetElemVTKID(vtkDataSet *theDataSet, vtkIdType theID)
+  {
+    theDataSet->Update();
+    vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
+    if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){
+      if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
+       int aMaxId = anIntArray->GetMaxId();
+       int* aPointer = anIntArray->GetPointer(0);
+       int* anEndPointer = anIntArray->GetPointer(aMaxId + 1);
+       int* aPtr = std::find(aPointer, anEndPointer, theID);
+       return aPtr - aPointer;
+      }
+    }
+    return -1;
+  }
+
+
+  //---------------------------------------------------------------
+  vtkIdType
+  GetElemObjID(vtkDataSet *theDataSet, vtkIdType theID)
+  {
+    theDataSet->Update();
+    vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetCellData();
+    if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_CELLS_MAPPER")){
+      if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
+       return anIntArray->GetValue(theID);
+      }
+    }
+    return -1;
+  }
+
+
+  //---------------------------------------------------------------
+  vtkIdType
+  GetNodeVTKID(vtkDataSet *theDataSet, vtkIdType theID)
+  {
+    theDataSet->Update();
+    vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData();
+    if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_POINTS_MAPPER")){
+      if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
+       int aMaxId = anIntArray->GetMaxId();
+       int* aPointer = anIntArray->GetPointer(0);
+       int* anEndPointer = anIntArray->GetPointer(aMaxId + 1);
+       int* aPtr = std::find(aPointer, anEndPointer, theID);
+       return aPtr - aPointer;
+      }
+    }
+    return -1;
+  }
+
+
+  //---------------------------------------------------------------
+  vtkIdType
+  GetNodeObjID(vtkDataSet *theDataSet, vtkIdType theID)
+  {
+    theDataSet->Update();
+    vtkDataSetAttributes *aDataSetAttributes = theDataSet->GetPointData();
+    if(vtkDataArray *aDataArray = aDataSetAttributes->GetArray("VISU_POINTS_MAPPER")){
+      if(vtkIntArray *anIntArray = dynamic_cast<vtkIntArray*>(aDataArray)){
+       return anIntArray->GetValue(theID);
+      }
+    }
+    return -1;
+  }
+
+
+  //---------------------------------------------------------------
   TTimerLog
   ::TTimerLog(int theIsDebug,
              const std::string& theName):
@@ -63,6 +163,7 @@ namespace VISU
     BEGMSG(myIsDebug > 1,"{\n");
   }
 
+  //---------------------------------------------------------------
   TTimerLog
   ::~TTimerLog()
   {
index 0c4664ad0003d61baff4909c42599a80c31c6333..6133fe7d677e05a7d10c229bef1634475ae2c01b 100644 (file)
@@ -30,6 +30,7 @@
 #include <string>
 
 #include <vtkCellType.h>
+#include <vtkSystemIncludes.h>
 
 #include "VISUConvertor.hxx"
 
 
 class vtkUnstructuredGrid;
 class vtkTimerLog;
+class vtkDataSet;
 
 namespace MED
 {
   class PrefixPrinter;
 }
 
-namespace VISU{
-
+namespace VISU
+{
+VISU_CONVERTOR_EXPORT
   void 
   WriteToFile(vtkUnstructuredGrid* theDataSet, const std::string& theFileName);
+VISU_CONVERTOR_EXPORT
+  bool 
+  IsDataOnCells(vtkDataSet* theDataSet);
+VISU_CONVERTOR_EXPORT
+  bool 
+  IsDataOnPoints(vtkDataSet* theDataSet);
+VISU_CONVERTOR_EXPORT
+  vtkIdType
+  GetElemVTKID(vtkDataSet *theDataSet, vtkIdType theID);
+VISU_CONVERTOR_EXPORT
+  vtkIdType
+  GetElemObjID(vtkDataSet *theDataSet, vtkIdType theID);
+VISU_CONVERTOR_EXPORT
+  vtkIdType
+  GetNodeVTKID(vtkDataSet *theDataSet, vtkIdType theID);
+VISU_CONVERTOR_EXPORT
+  vtkIdType
+  GetNodeObjID(vtkDataSet *theDataSet, vtkIdType theID);
 
   class VISU_CONVERTOR_EXPORT TTimerLog
   {
index 89cd54786df532436d07d18e48fb31726361b28e..9bb6fe8471b6006c501f8b75e1cfea005f677c09 100644 (file)
@@ -29,6 +29,8 @@
 #include "VTKViewer_AppendFilter.h"
 #include "VTKViewer_CellLocationsArray.h"
 #include "VISU_MergeFilter.hxx"
+#include "VTKViewer_CellLocationsArray.h"
+#include "VISU_CommonCellsFilter.hxx"
 
 #include <vtkPoints.h>
 #include <vtkUnstructuredGrid.h>
@@ -37,6 +39,7 @@
 #include <vtkCellType.h>
 #include <vtkCellArray.h>
 #include <vtkFloatArray.h>
+#include <vtkIntArray.h>
 #include <vtkUnsignedCharArray.h>
 #include <vtkPointData.h>
 #include <vtkCellData.h>
@@ -148,7 +151,7 @@ namespace VISU
   ::GetVTKOutput()
   {
     GetFilter()->Update();
-    return GetFilter()->GetUnstructuredGridOutput();
+    return GetFilter()->GetOutput();
   }
 
 
@@ -249,10 +252,14 @@ namespace VISU
 
   //---------------------------------------------------------------
   TMeshImpl::TMeshImpl():
-    myPoints(vtkPoints::New()),
+    myPointsSource(vtkUnstructuredGrid::New()),
     myNbPoints(0) 
   {
-    myPoints->Delete();
+    vtkPoints* aPoints = vtkPoints::New();
+    myPointsSource->SetPoints(aPoints);
+    aPoints->Delete();
+
+    myPointsSource->Delete();
   }
 
 
@@ -409,8 +416,10 @@ namespace VISU
       aFilter->SetScalars(aDataSet);
       aFilter->SetVectors(aDataSet);
       aFilter->AddField("VISU_FIELD",aDataSet);
+      aFilter->AddField("VISU_CELLS_MAPPER",aDataSet);
+      aFilter->AddField("VISU_POINTS_MAPPER",aDataSet);
     }
-    return myFilter->GetUnstructuredGridOutput();
+    return myFilter->GetOutput();
   }
 
   vtkIdType
@@ -455,6 +464,66 @@ namespace VISU
     return myIDMapper->GetElemCell(theObjID);
   }
   
+  //---------------------------------------------------------------
+  TIDCommonCellsFilter
+  ::TIDCommonCellsFilter():
+    myIsSpecialKey(false)
+  {}
+  
+  const TVTKCommonCellsFilter&
+  TIDCommonCellsFilter
+  ::GetFilter() const
+  {
+    if(!myFilter.GetPointer()){
+      myFilter = VISU_CommonCellsFilter::New();
+      myFilter->Delete();
+      myMergeFilter = VISU_MergeFilter::New();
+      myMergeFilter->Delete();
+    }
+    return myFilter;
+  }
+
+  TVTKOutput* 
+  TIDCommonCellsFilter
+  ::GetVTKOutput()
+  {
+    if(!myFilter.GetPointer()){
+      const TVTKAppendFilter& anAppendFilter = myIDMapper->GetFilter();
+      TVTKOutput* aGeometry;
+
+      const TVTKSource& aSource = mySource.GetSource();
+      TDataSet* aDataSet;
+      const TVTKCommonCellsFilter& aFilter = GetFilter();
+      
+      if(myIsSpecialKey){
+        PNamedIDMapperMap::iterator aIter;
+        aIter = myMappers.find(VISU::CELL_ENTITY);
+        if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput());
+        else {
+          aIter = myMappers.find(VISU::FACE_ENTITY);
+          if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput());
+          else {
+            aIter = myMappers.find(VISU::EDGE_ENTITY);
+            if(aIter!=myMappers.end()) aFilter->SetCellsUG((aIter->second)->GetVTKOutput());
+          }
+        }
+      }
+      
+      aGeometry = anAppendFilter->GetOutput();
+      aDataSet = aSource.GetPointer();
+      aDataSet->ShallowCopy(aGeometry);
+      
+      myMergeFilter->SetGeometry(aGeometry);
+      myMergeFilter->SetScalars(aDataSet);
+      myMergeFilter->SetVectors(aDataSet);
+      myMergeFilter->AddField("VISU_FIELD",aDataSet);
+      myMergeFilter->AddField("VISU_CELLS_MAPPER",aDataSet);
+      myMergeFilter->AddField("VISU_POINTS_MAPPER",aDataSet);
+
+      aFilter->SetProfileUG(myMergeFilter->GetOutput());
+    } 
+    return myFilter->GetOutput();
+  }
 
   //---------------------------------------------------------------
   void
@@ -586,25 +655,16 @@ namespace VISU
   TMeshOnEntityImpl
   ::GetElemVTKID(vtkIdType theID) const
   {
-    if(myElemObj2VTKID.empty())
-      return theID;
-    else{
-      TID2ID::const_iterator anIter = myElemObj2VTKID.find(theID);
-      if(anIter != myElemObj2VTKID.end())
-       return anIter->second;
-    }
-    return -1;
+    VISU::TVTKOutput* anOutput = GetFilter()->GetOutput();
+    return VISU::GetElemVTKID(anOutput, theID);
   }
 
   vtkIdType
   TMeshOnEntityImpl
   ::GetElemObjID(vtkIdType theID) const
   {
-    vtkIdType anInputID, aStartId, anInputDataSetID;
-    const TVTKAppendFilter& anAppendFilter = GetFilter();
-    anAppendFilter->GetCellInputID(theID,anInputID,aStartId,anInputDataSetID);
-    const PSubMeshImpl& aSubMesh = mySubMeshArr[anInputDataSetID];
-    return aSubMesh->GetElemObjID(anInputID);
+    VISU::TVTKOutput* anOutput = GetFilter()->GetOutput();
+    return VISU::GetElemObjID(anOutput, theID);
   }
 
   std::string 
@@ -831,7 +891,7 @@ namespace VISU
   TValForTimeImpl
   ::TValForTimeImpl():
     myGaussPtsIDFilter(new TGaussPtsIDFilter()),
-    myIDMapperFilter(new TIDMapperFilter())
+    myIDMapperFilter(new TIDCommonCellsFilter())
   {}
 
   const TMeshValue& 
@@ -1094,13 +1154,12 @@ namespace
   
 
   //---------------------------------------------------------------
-  vtkPoints*
-  GetPoints(const PMeshImpl& theMesh) 
+  vtkUnstructuredGrid*
+  GetPointsSource(const PMeshImpl& theMesh) 
   {
-    TVTKPoints& aPoints = theMesh->myPoints;
-    const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
-
+    TVTKSource& aPointSource = theMesh->myPointsSource;
     if(!theMesh->myIsVTKDone){
+      const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
       TCoordHelperPtr aCoordHelperPtr;
       {
        int aMeshDimension = theMesh->myDim;
@@ -1140,10 +1199,11 @@ namespace
        }
       }
 
+      vtkPoints* aPoints = aPointSource->GetPoints();
       vtkIdType aNbPoints = aCoords.GetNbPoints();
       aPoints->SetNumberOfPoints(aNbPoints);
       
-      INITMSG(MYDEBUG,"GetPoints - aNbPoints = "<<aNbPoints<<
+      INITMSG(MYDEBUG,"GetPointsSource - aNbPoints = "<<aNbPoints<<
              "; aDim = "<<theMesh->myDim<<
              endl);
 
@@ -1154,13 +1214,25 @@ namespace
                          aCoordHelperPtr->GetCoord(aCoordSlice,eY),
                          aCoordHelperPtr->GetCoord(aCoordSlice,eZ));
       }
-      
+
+      vtkIdType aNbTuples = aNbPoints;
+      vtkIntArray *aDataArray = vtkIntArray::New();
+      aDataArray->SetName("VISU_POINTS_MAPPER");
+      aDataArray->SetNumberOfComponents(1);
+      aDataArray->SetNumberOfTuples(aNbTuples);
+      for(vtkIdType aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+       vtkIdType anObjID = aCoords.GetObjID(aTupleId);
+       aDataArray->SetValue(aTupleId, anObjID);
+       }
+      aPointSource->GetPointData()->AddArray(aDataArray);
+      aDataArray->Delete();
+
       theMesh->myIsVTKDone = true;
 
       if(MYVTKDEBUG) aPoints->DebugOn();
     }
 
-    return aPoints.GetPointer();
+    return aPointSource.GetPointer();
   }
   
   
@@ -1207,6 +1279,20 @@ namespace
       aCellTypesArray->SetValue(anID,(unsigned char)theGeom);
     }
 
+    {
+      int aNbTuples = aNbCells;
+      vtkIntArray *aDataArray = vtkIntArray::New();
+      aDataArray->SetName("VISU_CELLS_MAPPER");
+      aDataArray->SetNumberOfComponents(1);
+      aDataArray->SetNumberOfTuples(aNbTuples);
+      for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+       int anObjID = theSubMesh->GetElemObjID(aTupleId);
+       aDataArray->SetValue(aTupleId, anObjID);
+      }
+      theSource->GetCellData()->AddArray(aDataArray);
+      aDataArray->Delete();
+    }
+
     vtkIdType *pts = 0, npts = 0;
     VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
     aCellLocationsArray->SetNumberOfComponents(1);
@@ -1244,11 +1330,16 @@ namespace
     TSubMeshID& aMeshID = theFamily->myMeshID;
     aMeshID.resize(aNbCells);
 
+    vtkIntArray *aDataArray = vtkIntArray::New();
+    aDataArray->SetName("VISU_CELLS_MAPPER");
+    aDataArray->SetNumberOfComponents(1);
+    aDataArray->SetNumberOfTuples(aNbCells);
+
     VISU::TID2ID& anElemObj2VTKID = theFamily->myElemObj2VTKID;
 
     const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
     VISU::TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
-    for(vtkIdType i = 0, j = 0; anIter != aGeom2SubMesh.end(); anIter++){
+    for(vtkIdType aCellId = 0; anIter != aGeom2SubMesh.end(); anIter++){
       VISU::EGeometry aEGeom = anIter->first;
       vtkIdType aVGeom = VISUGeom2VTK(aEGeom);
 
@@ -1272,15 +1363,20 @@ namespace
              endl);
 
       VISU::TSubMeshID::const_iterator aSubMeshIDIter = aSubMeshID.begin();
-      for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, i++){
+      for(; aSubMeshIDIter != aSubMeshID.end(); aSubMeshIDIter++, aCellId++){
        vtkIdType anID = *aSubMeshIDIter;
-       PrintCells(i,aConnectivity,anArray[anID]);
-       aCellTypesArray->SetValue(j++,(unsigned char)aVGeom);
+       PrintCells(aCellId, aConnectivity, anArray[anID]);
+       aCellTypesArray->SetValue(aCellId, (unsigned char)aVGeom);
        vtkIdType anObjID = aSubMesh.GetElemObjID(anID);
-       anElemObj2VTKID[anObjID] = i;
-       aMeshID[i] = anObjID;
+       aDataArray->SetValue(aCellId, anObjID);
+       anElemObj2VTKID[anObjID] = aCellId;
+       aMeshID[aCellId] = anObjID;
       }
     }
+
+    theSource->GetCellData()->AddArray(aDataArray);
+    aDataArray->Delete();
+
     vtkIdType *pts = 0, npts = 0;
     VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
     aCellLocationsArray->SetNumberOfComponents(1);
@@ -1319,17 +1415,29 @@ namespace
   {
     int aNbTuples = theField->myDataSize/theField->myNbComp;
     std::string aFieldName = GenerateFieldName(theField,theValForTime);
-    
-    int aNbComp = theField->myNbComp;
 
+    vtkDataSetAttributes* aDataSetAttributes;
+    switch(theEntity){
+    case VISU::NODE_ENTITY : 
+      aDataSetAttributes = theSource->GetPointData();
+      break;
+    default: 
+      aDataSetAttributes = theSource->GetCellData();
+    }
+
+    int aNbComp = theField->myNbComp;
     vtkFloatArray *aFloatArray = vtkFloatArray::New();
-    switch(aNbComp){
+
+    switch(aNbComp) {
     case 1:
       aFloatArray->SetNumberOfComponents(1);
+      aDataSetAttributes->SetScalars(aFloatArray);
       break;
     default:
       aFloatArray->SetNumberOfComponents(3);
+      aDataSetAttributes->SetVectors(aFloatArray);
     }
+
     aFloatArray->SetNumberOfTuples(aNbTuples);
     aFloatArray->SetName(aFieldName.c_str());
 
@@ -1337,6 +1445,7 @@ namespace
     aDataArray->SetNumberOfComponents(aNbComp);
     aDataArray->SetNumberOfTuples(aNbTuples);
     aDataArray->SetName("VISU_FIELD");
+    aDataSetAttributes->AddArray(aDataArray);
 
     INITMSG(MYDEBUG,"GetTimeStampOnProfile "<<
            "- theEntity = "<<theEntity<<
@@ -1376,25 +1485,6 @@ namespace
       }
     }
     
-    vtkDataSetAttributes* aDataSetAttributes;
-    switch(theEntity){
-    case VISU::NODE_ENTITY : 
-      aDataSetAttributes = theSource->GetPointData();
-      break;
-    default: 
-      aDataSetAttributes = theSource->GetCellData();
-    }
-
-    switch(aNbComp) {
-    case 1:
-      aDataSetAttributes->SetScalars(aFloatArray);
-      break;
-    default:
-      aDataSetAttributes->SetVectors(aFloatArray);
-    }
-
-    aDataSetAttributes->AddArray(aDataArray);
-
     aFloatArray->Delete();
     aDataArray->Delete();
     
@@ -1463,6 +1553,20 @@ namespace
       aCellLocationsArray->SetValue(i,aConnectivity->GetTraversalLocation(npts));
     theSource->SetCells(aCellTypesArray,aCellLocationsArray,aConnectivity);
     
+    {
+      int aNbTuples = aNbCells;
+      vtkIntArray *aDataArray = vtkIntArray::New();
+      aDataArray->SetName("VISU_CELLS_MAPPER");
+      aDataArray->SetNumberOfComponents(1);
+      aDataArray->SetNumberOfTuples(aNbTuples);
+      for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+       int anObjID = theSubProfile->GetElemObjID(aTupleId);
+       aDataArray->SetValue(aTupleId, anObjID);
+      }
+      theSource->GetCellData()->AddArray(aDataArray);
+      aDataArray->Delete();
+    }
+    
     aCellLocationsArray->Delete();
     aCellTypesArray->Delete();
     aConnectivity->Delete();
@@ -1482,7 +1586,7 @@ namespace
     if(theSubProfile->myIsVTKDone)
       return;
     
-    aSource->SetPoints(GetPoints(theMesh));
+    aSource->ShallowCopy(GetPointsSource(theMesh));
     INITMSGA(MYDEBUG,0,"GetNumberOfPoints - "<<aSource->GetNumberOfPoints()<<endl);
     GetCells(aSource,theSubProfile,theProfile,theMeshOnEntity);
     BEGMSG(MYDEBUG,"GetNumberOfCells - "<<aSource->GetNumberOfCells()<<endl);
@@ -1506,7 +1610,7 @@ namespace
       return true;
    
     const TVTKAppendFilter& anAppendFilter = theProfile->GetFilter();
-    anAppendFilter->SetPoints(GetPoints(theMesh));
+    anAppendFilter->SetSharedPointsDataSet(GetPointsSource(theMesh));
 
     if(theProfile->myIsAll){
       TVTKOutput* aDataSet = theMeshOnEntity->GetVTKOutput();
@@ -1887,37 +1991,30 @@ VISU_Convertor_impl
       if(MYVTKDEBUG) anAppendFilter->DebugOn();
 
       LoadMeshOnEntity(aMesh,aMeshOnEntity);
-      anAppendFilter->SetPoints(GetPoints(aMesh));
+      anAppendFilter->SetSharedPointsDataSet(GetPointsSource(aMesh));
       
       const TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh;
       TGeom2SubMesh::const_iterator anIter = aGeom2SubMesh.begin();
 
-      TID2ID& anElemObj2VTKID = aMeshOnEntity->myElemObj2VTKID;
-      TSubMeshArr& aSubMeshArr = aMeshOnEntity->mySubMeshArr;
-      aSubMeshArr.resize(aGeom2SubMesh.size());
-
       for(vtkIdType anID = 0, aCellID = 0; anIter != aGeom2SubMesh.end(); anIter++, anID++){
        EGeometry aEGeom = anIter->first;
        vtkIdType aVGeom = VISUGeom2VTK(aEGeom);
        PSubMeshImpl aSubMesh = anIter->second;
+
        //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
        aSubMesh->myIsStructured = aMesh->myIsStructured;
        aSubMesh->myType = aMesh->myType;
        aSubMesh->myGrilleStructure = aMesh->myGrilleStructure;
        aSubMesh->myObjID2StructureID = aMesh->myObjID2StructureID;
        //ENK: 23.11.2006
+
        const TVTKSource& aSource = aSubMesh->GetSource();
-       aSource->SetPoints(GetPoints(aMesh));
-       GetCellsOnSubMesh(aSource,aMeshOnEntity,aSubMesh,aVGeom);
-       anAppendFilter->AddInput(aSource.GetPointer());
+       aSource->ShallowCopy(GetPointsSource(aMesh));
 
        aSubMesh->myStartID = aCellID;
-       vtkIdType aNbCells = aSource->GetNumberOfCells();
-       for(vtkIdType aCell = 0; aCell < aNbCells; aCell++, aCellID++){
-         vtkIdType anObjID = aSubMesh->GetElemObjID(aCell);
-         anElemObj2VTKID[anObjID] = aCellID;
-       }
-       aSubMeshArr[anID] = aSubMesh;
+       GetCellsOnSubMesh(aSource, aMeshOnEntity, aSubMesh, aVGeom);
+       anAppendFilter->AddInput(aSource.GetPointer());
+       aCellID += aSource->GetNumberOfCells();
       }
       aMeshOnEntity->myNamedPointCoords = aMesh->myNamedPointCoords;
       //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
@@ -1983,7 +2080,7 @@ VISU_Convertor_impl
       GetMeshOnEntity(theMeshName,theEntity);
 
       LoadFamilyOnEntity(aMesh,aMeshOnEntity,aFamily);
-      aSource->SetPoints(GetPoints(aMesh));
+      aSource->ShallowCopy(GetPointsSource(aMesh));
       GetCellsOnFamily(aSource,aMeshOnEntity,aFamily);
 
       aFamily->myNamedPointCoords = aMesh->myNamedPointCoords;
@@ -2045,7 +2142,7 @@ VISU_Convertor_impl
       const VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
 
       LoadMeshOnGroup(aMesh,aFamilySet);
-      anAppendFilter->SetPoints(GetPoints(aMesh));
+      anAppendFilter->SetSharedPointsDataSet(GetPointsSource(aMesh));
 
       TFamilySet::const_iterator anIter = aFamilySet.begin();
 
@@ -2103,27 +2200,85 @@ VISU_Convertor_impl
                        const VISU::PMeshOnEntityImpl& theMeshOnEntity,
                        const VISU::PFieldImpl& theField,
                        const VISU::PValForTimeImpl& theValForTime,
-                       const VISU::PIDMapperFilter& theIDMapperFilter,
+                       const VISU::PIDCommonCellsFilter& theIDMapperFilter,
                        const VISU::PProfileImpl& theProfile,
                        const VISU::TEntity& theEntity)
 {
   TVTKOutput* anOutput = NULL;
+#ifndef _DEXCEPT_
   try{
+#endif
+    // load points if theMeshOnEntity->myEntity == NODE_ENTITY
+    // load all coordinates itc.
+    
     LoadMeshOnEntity(theMesh,theMeshOnEntity);
     GetMeshOnEntity(theMeshOnEntity->myMeshName,theMeshOnEntity->myEntity);
     if(GetMeshOnProfile(theMesh,theMeshOnEntity,theProfile)){
+
+      bool isNeedInCells = false;
       theIDMapperFilter->myIDMapper = theProfile;
-      anOutput = theIDMapperFilter->GetVTKOutput();
-      const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
-      ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+      
+      if(theMeshOnEntity->myEntity == VISU::NODE_ENTITY){
+
+        // add geometry elements to output,
+        // if timestamp on NODE_ENTITY and
+        // on profiles with status eAddPart
+        TGeom2SubProfile::const_iterator anIter = theProfile->myGeom2SubProfile.begin();
+        for(; anIter != (theProfile->myGeom2SubProfile).end(); anIter++){
+          const EGeometry aGeom = anIter->first;
+          const PSubProfileImpl aSubProfile = anIter->second;
+          if(aSubProfile->myStatus == VISU::eAddPart && aGeom == VISU::ePOINT1){
+            isNeedInCells = true;
+            break;
+          }
+        }
+        if(isNeedInCells){
+          theIDMapperFilter->myIsSpecialKey = true;
+          GetTimeStampOnNodalProfile(theMesh,theIDMapperFilter,theField,theValForTime,theEntity);
+          anOutput = theIDMapperFilter->GetVTKOutput();
+        }
+      }
+
+      if(!isNeedInCells){
+        anOutput = theIDMapperFilter->GetVTKOutput();
+        const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
+        ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+      }
     }
+#ifndef _DEXCEPT_
   }catch(std::exception& exc){
     MSG(MYDEBUG,"Follow exception was occured :\n"<<exc.what());
     return NULL;
   }
+#endif  
   return anOutput;
 }
 
+void
+VISU_Convertor_impl
+::GetTimeStampOnNodalProfile(const VISU::PMeshImpl& theMesh,
+                             const VISU::PIDCommonCellsFilter& theIDMapperFilter,
+                             const VISU::PFieldImpl& theField, 
+                             const VISU::PValForTimeImpl& theValForTime,
+                             const VISU::TEntity& theEntity)
+{
+  INITMSG(MYDEBUG,"GetTimeStampOnNodalProfile");
+  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 != NODE_ENTITY){
+      VISU::PNamedIDMapper aMapper = GetMeshOnEntity(theMesh->myName,aEntity);
+      if(aMapper)
+        theIDMapperFilter->myMappers[aEntity] = aMapper;
+    }
+  }
+
+  theIDMapperFilter->GetVTKOutput();
+  const TVTKSource& aSource = theIDMapperFilter->mySource.GetSource();
+  ::GetTimeStampOnProfile(aSource,theField,theValForTime,theEntity);
+
+}
 
 //---------------------------------------------------------------
 VISU::PIDMapper 
@@ -2153,7 +2308,7 @@ VISU_Convertor_impl
   PFieldImpl aField = boost::get<3>(aFindTimeStamp);
 
   //Main part of code
-  PIDMapperFilter anIDMapperFilter = aValForTime->myIDMapperFilter;
+  PIDCommonCellsFilter anIDMapperFilter = aValForTime->myIDMapperFilter;
 #ifndef _DEXCEPT_
   try{
 #endif
@@ -2318,15 +2473,22 @@ VISU_Convertor_impl
 VISU_Convertor_impl::TFindMeshOnEntity
 VISU_Convertor_impl
 ::FindMeshOnEntity(const string& theMeshName,
-                  const VISU::TEntity& theEntity)
+                  const VISU::TEntity& theEntity,
+                   bool checkExists)
 {
+  PMeshOnEntityImpl aMeshOnEntity;
   PMeshImpl aMesh = FindMesh(theMeshName);
   VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
   VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.find(theEntity);
-  if(aMeshOnEntityMapIter == aMeshOnEntityMap.end())
-    EXCEPTION(runtime_error,"FindMeshOnEntity >> There is no mesh on the entity - "<<theEntity<<"!!!");
+  if(aMeshOnEntityMapIter == aMeshOnEntityMap.end()){
+    if(!checkExists){
+      EXCEPTION(runtime_error,"FindMeshOnEntity >> There is no mesh on the entity - "<<theEntity<<"!!!");
+    } else {
+      return TFindMeshOnEntity(aMesh,aMeshOnEntity);
+    }
+  }
 
-  PMeshOnEntityImpl aMeshOnEntity = aMeshOnEntityMapIter->second;
+  aMeshOnEntity = aMeshOnEntityMapIter->second;
   
   return TFindMeshOnEntity(aMesh,
                           aMeshOnEntity);
index 6acbaadf47d69e31b132989f8fe82632ed874e18..bfeab911a65773b6c1f1028f97fc68610f10cca4 100644 (file)
@@ -38,6 +38,7 @@ class vtkPoints;
 class vtkUnstructuredGrid;
 class VTKViewer_AppendFilter;
 class VISU_MergeFilter;
+class VISU_CommonCellsFilter;
 
 #include "VISUConvertor.hxx"
 #include "VISU_Convertor.hxx"
@@ -74,6 +75,7 @@ namespace VISU
   typedef vtkSmartPointer<TDataSet> TVTKSource;
   typedef vtkSmartPointer<vtkPoints> TVTKPoints;
   typedef vtkSmartPointer<VISU_MergeFilter> TVTKMergeFilter;
+  typedef vtkSmartPointer<VISU_CommonCellsFilter> TVTKCommonCellsFilter;
 
   typedef vtkSmartPointer<VTKViewer_AppendFilter> TVTKAppendFilter;
 
@@ -166,7 +168,7 @@ namespace VISU
     TVTKOutput* 
     GetVTKOutput();
   };
-  typedef SharedPtr<TAppendFilter> PAppendFilter;
+  typedef SharedPtr<TMergeFilter> PMergeFilter;
 
 
   //---------------------------------------------------------------
@@ -278,7 +280,7 @@ namespace VISU
   {
     PNamedPointCoords myNamedPointCoords; //!< Keeps intermediate representation of the nodes
 
-    TVTKPoints myPoints; //!< Keeps VTK representation of the nodes
+    TVTKSource myPointsSource; //!< Keeps VTK representation of the nodes
     vtkIdType myNbPoints; //!< Keeps number of the nodes
 
     TMeshImpl();
@@ -429,7 +431,37 @@ namespace VISU
   };
   typedef SharedPtr<TIDMapperFilter> PIDMapperFilter;
 
+  typedef std::map<VISU::TEntity,VISU::PNamedIDMapper> PNamedIDMapperMap;
+  //---------------------------------------------------------------
+  //! Specialize TIDMapper to provide VTK mapping for MED TIMESTAMP mesh
+  struct TIDCommonCellsFilter: virtual TIDMapperFilter
+  {
+  protected:
+    mutable TVTKCommonCellsFilter myFilter;
+    mutable TVTKMergeFilter myMergeFilter;
+  public:
+    
+    TIDCommonCellsFilter();
+
+    //! This method allow to create corresponding VTK filter by demand (not at once)
+    const TVTKCommonCellsFilter& 
+    GetFilter() const;
+
+    //! 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;
+    //! Reimplement the TIDMapperFilter::GetVTKOutput
+    virtual
+    TVTKOutput* 
+    GetVTKOutput();
+  };
+  typedef SharedPtr<TIDCommonCellsFilter> PIDCommonCellsFilter;
 
+  
   //---------------------------------------------------------------
   struct TGaussImpl;
   typedef SharedPtr<TGaussImpl> PGaussImpl;
@@ -755,7 +787,7 @@ namespace VISU
   struct VISU_CONVERTOR_EXPORT TValForTimeImpl: virtual TValForTime
   {
     PGaussPtsIDFilter myGaussPtsIDFilter; //!< Keep VTK representation for mesh and data on Gauss Points
-    PIDMapperFilter myIDMapperFilter; //!< Keep VTK representation for ordinary mesh and data
+    PIDCommonCellsFilter myIDMapperFilter; //!< Keep VTK representation for ordinary mesh and data
     TGeom2Value myGeom2Value; //!< Keep value that is assigned to the mesh
     TGeom2NbGauss myGeom2NbGauss; //!< Keep number of Gauss Points
    
@@ -914,7 +946,8 @@ protected:
   typedef boost::tuple<VISU::PMeshImpl,VISU::PMeshOnEntityImpl> TFindMeshOnEntity;
   TFindMeshOnEntity
   FindMeshOnEntity(const std::string& theMeshName,
-                  const VISU::TEntity& theEntity);
+                  const VISU::TEntity& theEntity,
+                   bool checkExists=false);
 
   //! An utility method to find TFamily by name of its parent mesh, corresponding entity and its name
   typedef boost::tuple<VISU::PMeshImpl,VISU::PMeshOnEntityImpl,VISU::PFamilyImpl> TFindFamilyOnEntity;
@@ -956,9 +989,17 @@ protected:
                        const VISU::PMeshOnEntityImpl& theMeshOnEntity,
                        const VISU::PFieldImpl& theField,
                        const VISU::PValForTimeImpl& theValForTime,
-                       const VISU::PIDMapperFilter& theIDMapperFilter,
+                       const VISU::PIDCommonCellsFilter& theIDMapperFilter,
                        const VISU::PProfileImpl& theProfile,
                        const VISU::TEntity& theEntity);
+
+  void
+  GetTimeStampOnNodalProfile(const VISU::PMeshImpl& theMesh,
+                             const VISU::PIDCommonCellsFilter& theIDMapperFilter,
+                             const VISU::PFieldImpl& theField, 
+                             const VISU::PValForTimeImpl& theValForTime,
+                             const VISU::TEntity& theEntity);
+  
   
 protected:
   //! To fill intermeiate representation of TMeshOnEntity from a MED source
index d614e5234c06a6fa19e130509c44c5abb849de6e..e59667b81636988d8fb4b01283863e007d2615ae 100644 (file)
@@ -736,7 +736,7 @@ static int MY_GROUP_DEBUG = 0;
          const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first;
          VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
          vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
-         TInt aNbElem = theGrilleInfo->GetNbCells();
+         TInt aNbElem = aGeom2SizeIter->second;//theGrilleInfo->GetNbCells();
          aMeshOnEntity->myNbCells += aNbElem;
          aMeshOnEntity->myCellsSize += aNbElem*(aVNbNodes+1);
          
@@ -1022,8 +1022,8 @@ static int MY_GROUP_DEBUG = 0;
          TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
          for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
            const std::string& aName = aFamilyMapIter->first;
-           aFamily = aFamilyMapIter->second;
            if(aName == aFamilyName){
+              aFamily = aFamilyMapIter->second;
              aVEntity = aFamily->myEntity;
              goto exit_lable;
            }
@@ -1083,10 +1083,12 @@ static int MY_GROUP_DEBUG = 0;
   TMEDSubProfile
   ::GetElemObjID(vtkIdType theID) const
   {
-    if(myIsElemNum)
-      return myElemNum[theID];
-    else
-      return theID;
+    if(mySubMeshID.empty())
+      if(myIsElemNum)
+        return myElemNum[theID];
+      else
+        return theID;
+    return mySubMeshID[theID];
   }
   
 
@@ -1978,7 +1980,7 @@ VISU_MedConvertor
          vtkIdType aVNbNodes = VISUGeom2NbNodes(aEGeom);
          INITMSG(MYDEBUG,"aVNbNodes = "<<aVNbNodes<<"\n");
        
-         TInt aNbElem = aGrilleInfo->GetNbCells();
+         TInt aNbElem = aGeom2SizeIter->second;//aGrilleInfo->GetNbCells();
          
          if(aNbElem > 0){
            PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh());
index 4cabc7fbe1bf39518abdc0076fb913eb5b901656..ec2d61f3dae4e60b28e30325df229ac610ae0ca3 100644 (file)
 #include <vtkStructuredPoints.h>
 #include <vtkUnstructuredGrid.h>
 
+#include <vtkIdList.h>
+#include <vtkCell.h>
+
+#include <algorithm>
+#include <vector>
+#include <map>
+
 namespace VISU
 {
 
@@ -151,7 +158,8 @@ vtkStandardNewMacro(VISU_MergeFilter);
 //------------------------------------------------------------------------------
 
 // Create object with no input or output.
-VISU_MergeFilter::VISU_MergeFilter()
+VISU_MergeFilter::VISU_MergeFilter():
+  myIsMergingInputs(false)
 {
   this->FieldList = new VISU::TFieldList;
 }
@@ -231,188 +239,657 @@ void VISU_MergeFilter::AddField(const char* name, vtkDataSet* input)
   this->FieldList->Add(name, input);
 }
 
-void VISU_MergeFilter::Execute()
+void VISU_MergeFilter::RemoveFields()
 {
-  vtkIdType numPts, numScalars=0, numVectors=0, numNormals=0, numTCoords=0;
-  vtkIdType numTensors=0;
-  vtkIdType numCells, numCellScalars=0, numCellVectors=0, numCellNormals=0;
-  vtkIdType numCellTCoords=0, numCellTensors=0;
-  vtkPointData *pd;
-  vtkDataArray *scalars = NULL;
-  vtkDataArray *vectors = NULL;
-  vtkDataArray *normals = NULL;
-  vtkDataArray *tcoords = NULL;
-  vtkDataArray *tensors = NULL;
-  vtkCellData *cd;
-  vtkDataArray *cellScalars = NULL;
-  vtkDataArray *cellVectors = NULL;
-  vtkDataArray *cellNormals = NULL;
-  vtkDataArray *cellTCoords = NULL;
-  vtkDataArray *cellTensors = NULL;
-  vtkDataSet *output = this->GetOutput();
-  vtkPointData *outputPD = output->GetPointData();
-  vtkCellData *outputCD = output->GetCellData();
-  
-  vtkDebugMacro(<<"Merging data!");
+  delete this->FieldList;
+  this->FieldList = new VISU::TFieldList;
+}
 
-  // geometry needs to be copied
-  output->CopyStructure(this->GetInput());
-  if ( (numPts = this->GetInput()->GetNumberOfPoints()) < 1 )
-    {
-    vtkWarningMacro(<<"Nothing to merge!");
-    }
-  numCells = this->GetInput()->GetNumberOfCells();
-  
-  if ( this->GetScalars() ) 
-    {
-    pd = this->GetScalars()->GetPointData();
-    scalars = pd->GetScalars();
-    if ( scalars != NULL )
-      {
-      numScalars = scalars->GetNumberOfTuples();
-      }
-    cd = this->GetScalars()->GetCellData();
-    cellScalars = cd->GetScalars();
-    if ( cellScalars != NULL )
-      {
-      numCellScalars = cellScalars->GetNumberOfTuples();
+namespace
+{
+  typedef std::vector<int> TSortedArray;
+
+  inline
+  void
+  GetSortedArray(vtkIntArray *theArray, 
+                TSortedArray& theSortedArray)
+  {
+    int aMaxId = theArray->GetMaxId();
+    int* aPointer = theArray->GetPointer(0);
+    int* anEndPointer = theArray->GetPointer(aMaxId + 1);
+    TSortedArray aSortedArray(aPointer, anEndPointer);
+    std::sort(aSortedArray.begin(), aSortedArray.end());
+    theSortedArray.swap(aSortedArray);
+  }
+
+  typedef std::map<int,int> TId2IdMap;
+
+  template <class TNumericType>
+  void DeepCopySwitchOnOutput(TNumericType *theInputPtr, 
+                             TNumericType *theOutputPtr,
+                             const TSortedArray& theIntersection,
+                             const TId2IdMap& theObj2VTKMap,
+                             vtkIdType theNbComp)
+  {
+    vtkIdType aNbIds = theIntersection.size();
+    for(vtkIdType aTargetTupleId = 0; aTargetTupleId < aNbIds; aTargetTupleId++){
+      vtkIdType aTargetId = aTargetTupleId*theNbComp;
+      vtkIdType anObjId = theIntersection[aTargetTupleId];
+      TId2IdMap::const_iterator anIter = theObj2VTKMap.find(anObjId);
+      vtkIdType aSourceTupleId = anIter->second;
+      vtkIdType aSourceId = aSourceTupleId*theNbComp;
+      for(vtkIdType aComp = 0; aComp < theNbComp; aComp++){
+       theOutputPtr[aTargetId++] = theInputPtr[aSourceId++];
       }
     }
+  }
 
-  if ( this->GetVectors() ) 
-    {
-    pd = this->GetVectors()->GetPointData();
-    vectors = pd->GetVectors();
-    if ( vectors != NULL )
-      {
-      numVectors= vectors->GetNumberOfTuples();
-      }
-    cd = this->GetVectors()->GetCellData();
-    cellVectors = cd->GetVectors();
-    if ( cellVectors != NULL )
-      {
-      numCellVectors = cellVectors->GetNumberOfTuples();
-      }
+  typedef vtkDataArray* (vtkDataSetAttributes::* TGetAttribute)();
+  typedef int (vtkDataSetAttributes::* TSetAttribute)(vtkDataArray*);
+
+  inline
+  void
+  CopyArray(vtkDataArray* theDataArray,
+           vtkDataSetAttributes* theOutput, 
+           TSetAttribute theSetAttribute,
+           vtkIdType theFixedNbTuples)
+  {
+    if(theDataArray){
+      vtkIdType aNbTuples = theDataArray->GetNumberOfTuples();
+      if(theFixedNbTuples == aNbTuples)
+       (theOutput->*theSetAttribute)(theDataArray);
     }
+  }
 
-  if ( this->GetNormals() ) 
-    {
-    pd = this->GetNormals()->GetPointData();
-    normals = pd->GetNormals();
-    if ( normals != NULL )
-      {
-      numNormals= normals->GetNumberOfTuples();
-      }
-    cd = this->GetNormals()->GetCellData();
-    cellNormals = cd->GetNormals();
-    if ( cellNormals != NULL )
-      {
-      numCellNormals = cellNormals->GetNumberOfTuples();
+  inline
+  void
+  CopyAttribute(vtkDataSetAttributes* theInput, 
+               TGetAttribute theGetAttribute,
+               vtkDataSetAttributes* theOutput, 
+               TSetAttribute theSetAttribute,
+               vtkIdType theFixedNbTuples)
+  {
+    CopyArray((theInput->*theGetAttribute)(),
+             theOutput, theSetAttribute,
+             theFixedNbTuples);
+  }
+
+  vtkDataArray*
+  DeepCopyArray(vtkDataArray* theDataArray,
+               vtkDataSetAttributes* theOutput, 
+               TSetAttribute theSetAttribute,
+               const TSortedArray& theIntersection, 
+               const TId2IdMap& theObj2VTKMap)
+  {
+    vtkDataArray *aDataArray = NULL;
+    if(theDataArray){
+      void *anInputPtr = theDataArray->GetVoidPointer(0);
+      vtkIdType aNbTuples = theIntersection.size();
+      vtkIdType aNbComp = theDataArray->GetNumberOfComponents();
+
+      aDataArray = vtkDataArray::CreateDataArray(theDataArray->GetDataType());
+      aDataArray->SetNumberOfComponents(aNbComp);
+      aDataArray->SetNumberOfTuples(aNbTuples);
+      void *anOutputPtr = aDataArray->GetVoidPointer(0);       
+
+      switch(theDataArray->GetDataType()){
+       vtkTemplateMacro5(DeepCopySwitchOnOutput, 
+                         (VTK_TT*)anInputPtr, 
+                         (VTK_TT*)anOutputPtr, 
+                         theIntersection, 
+                         theObj2VTKMap,
+                         aNbComp);
+      default:
+        vtkGenericWarningMacro(<<"Unsupported data type!");
       }
+
+      (theOutput->*theSetAttribute)(aDataArray);
+      aDataArray->Delete();
     }
+    return aDataArray;
+  }
 
-  if ( this->GetTCoords() ) 
-    {
-    pd = this->GetTCoords()->GetPointData();
-    tcoords = pd->GetTCoords();
-    if ( tcoords != NULL )
-      {
-      numTCoords= tcoords->GetNumberOfTuples();
-      }
-    cd = this->GetTCoords()->GetCellData();
-    cellTCoords = cd->GetTCoords();
-    if ( cellTCoords != NULL )
-      {
-      numCellTCoords = cellTCoords->GetNumberOfTuples();
+  void
+  DeepCopyAttribute(vtkDataSetAttributes* theInput, 
+                   TGetAttribute theGetAttribute,
+                   vtkDataSetAttributes* theOutput, 
+                   TSetAttribute theSetAttribute,
+                   const TSortedArray& theIntersection, 
+                   const TId2IdMap& theObj2VTKMap)
+  {
+    DeepCopyArray((theInput->*theGetAttribute)(),
+                 theOutput, 
+                 theSetAttribute,
+                 theIntersection, 
+                 theObj2VTKMap);
+  }
+
+  inline
+  void
+  DeepCopyDataSetAttribute(vtkDataSet* theInput,
+                          TGetAttribute theGetAttribute,
+                          vtkDataSet* theOutput, 
+                          TSetAttribute theSetAttribute,
+                          const TSortedArray& theIntersection, 
+                          const TId2IdMap& theObj2VTKMap)
+  {
+    CopyAttribute(theInput->GetPointData(), 
+                 theGetAttribute,
+                 theOutput->GetPointData(), 
+                 theSetAttribute,
+                 theInput->GetNumberOfPoints());
+    DeepCopyAttribute(theInput->GetCellData(), 
+                     theGetAttribute,
+                     theOutput->GetCellData(), 
+                     theSetAttribute,
+                     theIntersection, 
+                     theObj2VTKMap);
+  }
+
+  inline
+  void
+  DeepCopyField(vtkDataSetAttributes* theInput, 
+               const char* theFieldName, 
+               vtkDataSetAttributes* theOutput, 
+               const TSortedArray& theIntersection,
+               const TId2IdMap& theObj2VTKMap)
+  {
+    vtkDataArray* aDataArray = 
+      DeepCopyArray(theInput->GetArray(theFieldName), 
+                   theOutput, 
+                   &vtkFieldData::AddArray,
+                   theIntersection,
+                   theObj2VTKMap);
+    if(aDataArray)
+      aDataArray->SetName(theFieldName);
+  }
+
+  inline
+  void
+  CopyField(vtkDataSetAttributes* theInput, 
+           const char* theFieldName, 
+           vtkDataSetAttributes* theOutput,
+           vtkIdType theFixedNbTuples)
+  {
+    CopyArray(theInput->GetArray(theFieldName),
+             theOutput,
+             &vtkDataSetAttributes::AddArray,
+             theFixedNbTuples);
+  }
+
+  inline
+  void
+  DeepCopyDataSetField(vtkDataSet* theInput, 
+                      const char* theFieldName, 
+                      vtkDataSet* theOutput,
+                      const TSortedArray& theIntersection, 
+                      const TId2IdMap& theObj2VTKMap)
+  {
+    CopyField(theInput->GetPointData(), theFieldName, 
+             theOutput->GetPointData(), 
+             theInput->GetNumberOfPoints());
+    DeepCopyField(theInput->GetCellData(), theFieldName, 
+                 theOutput->GetCellData(), 
+                 theIntersection, theObj2VTKMap);
+  }
+
+  inline
+  void
+  DeepCopyDataSetAttributes(VISU_MergeFilter *theFilter, 
+                           vtkDataSet *theFilterOutput, 
+                           VISU::TFieldList* theFieldList,
+                           const TSortedArray& theIntersection, 
+                           const TId2IdMap& theObj2VTKMap)
+  {
+    if(vtkDataSet* aDataSet = theFilter->GetScalars())
+      DeepCopyDataSetAttribute(aDataSet, 
+                              &vtkDataSetAttributes::GetScalars,
+                              theFilterOutput, 
+                              &vtkDataSetAttributes::SetScalars,
+                              theIntersection, 
+                              theObj2VTKMap);
+    
+    if(vtkDataSet* aDataSet = theFilter->GetVectors())
+      DeepCopyDataSetAttribute(aDataSet, 
+                              &vtkDataSetAttributes::GetVectors,
+                              theFilterOutput, 
+                              &vtkDataSetAttributes::SetVectors,
+                              theIntersection, 
+                              theObj2VTKMap);
+    
+    if(vtkDataSet* aDataSet = theFilter->GetNormals())
+      DeepCopyDataSetAttribute(aDataSet, 
+                              &vtkDataSetAttributes::GetNormals,
+                              theFilterOutput, 
+                              &vtkDataSetAttributes::SetNormals,
+                              theIntersection, 
+                              theObj2VTKMap);
+    
+    if(vtkDataSet* aDataSet = theFilter->GetTCoords())
+      DeepCopyDataSetAttribute(aDataSet, 
+                              &vtkDataSetAttributes::GetTCoords,
+                              theFilterOutput, 
+                              &vtkDataSetAttributes::SetTCoords,
+                              theIntersection, 
+                              theObj2VTKMap);
+    
+    if(vtkDataSet* aDataSet = theFilter->GetTensors())
+      DeepCopyDataSetAttribute(aDataSet, 
+                              &vtkDataSetAttributes::GetTensors,
+                              theFilterOutput, 
+                              &vtkDataSetAttributes::SetTensors,
+                              theIntersection, 
+                              theObj2VTKMap);
+
+    VISU::TFieldListIterator anIter(theFieldList);
+    for(anIter.Begin(); !anIter.End() ; anIter.Next()){
+      vtkDataSet *aDataSet = anIter.Get()->Ptr;
+      const char* aFieldName = anIter.Get()->GetName();
+      DeepCopyDataSetField(aDataSet, 
+                          aFieldName, 
+                          theFilterOutput, 
+                          theIntersection, 
+                          theObj2VTKMap);
+    }
+  }
+
+  inline
+  void
+  GetIdsForCopy(vtkUnstructuredGrid *inputUGrid, 
+                vtkIntArray* inputPointIds,
+                TSortedArray& outputSortedArray)
+  {
+    if(inputUGrid){
+      TSortedArray aSortedPointIds;
+      TSortedArray aOutputCellIds;
+      GetSortedArray(inputPointIds,aSortedPointIds);
+      
+      int nbInputCells = inputUGrid->GetNumberOfCells();
+
+      TSortedArray aPointCellIds;
+      for(int idCell=0;idCell<nbInputCells;idCell++){
+        aPointCellIds.clear();
+        vtkCell*   aCell = inputUGrid->GetCell(idCell);
+        vtkIdList* ptIds = aCell->GetPointIds();
+        int aMaxId = ptIds->GetNumberOfIds();
+        int* aPointer = ptIds->GetPointer(0);
+        int* anEndPointer = ptIds->GetPointer(aMaxId + 1);
+        TSortedArray aSortedArray(aPointer, anEndPointer);
+        std::sort(aSortedArray.begin(), aSortedArray.end());
+
+        int aMaxLength = std::max(aSortedArray.size(), aSortedPointIds.size());
+        TSortedArray anIntersectionArray(aMaxLength);
+        TSortedArray::iterator anArrayIter = anIntersectionArray.begin();
+        anArrayIter = std::set_intersection(aSortedArray.begin(),
+                                            aSortedArray.end(),
+                                            aSortedPointIds.begin(),
+                                            aSortedPointIds.end(),
+                                            anArrayIter);
+        anIntersectionArray.erase(anArrayIter, anIntersectionArray.end());
+        if(anIntersectionArray.size() == aSortedArray.size())
+          aOutputCellIds.push_back(idCell);
       }
+
+      outputSortedArray.swap(aOutputCellIds);
     }
+  }
 
-  if ( this->GetTensors() ) 
-    {
-    pd = this->GetTensors()->GetPointData();
-    tensors = pd->GetTensors();
-    if ( tensors != NULL )
-      {
-      numTensors = tensors->GetNumberOfTuples();
-      }
-    cd = this->GetTensors()->GetCellData();
-    cellTensors = cd->GetTensors();
-    if ( cellTensors != NULL )
-      {
-      numCellTensors = cellTensors->GetNumberOfTuples();
+  inline
+  void
+  CopyElementsToOutput(vtkUnstructuredGrid* theInputUG,
+                       int& theNbElements,
+                       TSortedArray& theElementIdsForCopy,
+                       TId2IdMap& theOldId2NewIdPointsMap,
+                       vtkIntArray* theOuputIDSArray,
+                       vtkUnstructuredGrid* theOutputUG)
+  {
+    vtkIntArray* aInputCellsMapper =
+      dynamic_cast<vtkIntArray*>(theInputUG->GetCellData()->GetArray("VISU_CELLS_MAPPER"));
+    
+    int* aInputCellsMapperPointer = aInputCellsMapper->GetPointer(0);
+    
+    for(int aCellIndex=0;aCellIndex<theNbElements;aCellIndex++){
+      int aCellId = theElementIdsForCopy[aCellIndex];
+      vtkIdList* aOldPointIds = theInputUG->GetCell(aCellId)->GetPointIds();
+      vtkIdList* aNewPointIds = vtkIdList::New();
+      int nbPointIds = aOldPointIds->GetNumberOfIds();
+      aNewPointIds->SetNumberOfIds(nbPointIds);
+      for(int j=0;j<nbPointIds;j++){
+        int aOldId = aOldPointIds->GetId(j);
+        int aNewId = theOldId2NewIdPointsMap[aOldId];
+        aNewPointIds->SetId(j,aNewId);
       }
-    }
+      const int aOldCellId = theElementIdsForCopy[aCellIndex];
+      theOutputUG->InsertNextCell(theInputUG->GetCellType(aOldCellId),
+                                  aNewPointIds);
+      if(aInputCellsMapperPointer)
+        theOuputIDSArray->InsertNextValue(aInputCellsMapperPointer[aOldCellId]);
+      else
+        theOuputIDSArray->InsertNextValue(aOldCellId);
+      
+      aNewPointIds->Delete();
+    }
+    theOutputUG->GetCellData()->AddArray(theOuputIDSArray);
+  }
+  
+  
+}
 
-  // merge data only if it is consistent
-  if ( numPts == numScalars )
-    {
-    outputPD->SetScalars(scalars);
-    }
-  if ( numCells == numCellScalars )
-    {
-    outputCD->SetScalars(cellScalars);
-    }
+void
+VISU_MergeFilter
+::SetMergingInputs(bool theIsMergingInputs)
+{
+  if(myIsMergingInputs == theIsMergingInputs)
+    return;
 
-  if ( numPts == numVectors )
-    {
-    outputPD->SetVectors(vectors);
-    }
-  if ( numCells == numCellVectors )
-    {
-    outputCD->SetVectors(cellVectors);
+  myIsMergingInputs = theIsMergingInputs;
+  Modified();
+}
+  
+bool
+VISU_MergeFilter
+::IsMergingInputs()
+{
+  return myIsMergingInputs;
+}
+  
+
+void VISU_MergeFilter::Execute()
+{
+  vtkUnstructuredGrid *anInput = this->GetInput();
+  vtkUnstructuredGrid *anOutput = this->GetOutput();
+
+  vtkPointData *aPointData   = anInput->GetPointData();
+  vtkDataSet*  aInputScalars = this->GetScalars();
+  int nbPointsInScalars = aInputScalars->GetNumberOfPoints();
+  int nbPointsInGeometr = anInput->GetNumberOfPoints();
+  vtkCellData *aCellData = anInput->GetCellData();
+  
+  vtkDataArray *aPointMapper = aPointData->GetArray("VISU_POINTS_MAPPER");
+  vtkIntArray *aGeometryPointMapper = dynamic_cast<vtkIntArray*>(aPointMapper);
+  vtkDataArray *aCellMapper = aCellData->GetArray("VISU_CELLS_MAPPER");
+  vtkIntArray *aGeometryCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper);
+  if(aGeometryCellMapper && (nbPointsInScalars == nbPointsInGeometr)){
+    vtkIntArray* aDataCellMapper = NULL;
+    VISU::TFieldListIterator anIter(this->FieldList);
+    for(anIter.Begin(); !anIter.End() ; anIter.Next()){
+      vtkCellData *aCellData = anIter.Get()->Ptr->GetCellData();
+      const char* aFieldName = anIter.Get()->GetName();
+      if(strcmp(aFieldName, "VISU_CELLS_MAPPER") == 0){
+       vtkDataArray *aCellMapper_tmp = aCellData->GetArray(aFieldName);
+       aDataCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper_tmp);
+       break;
+      }
     }
+
+    bool anIsDifferent = aDataCellMapper &&
+      aDataCellMapper->GetNumberOfTuples() != aGeometryCellMapper->GetNumberOfTuples();
+    if(anIsDifferent || IsMergingInputs()){
+      TSortedArray aGeometryCellArray;
+      GetSortedArray(aGeometryCellMapper, aGeometryCellArray);
     
-  if ( numPts == numNormals )
-    {
-    outputPD->SetNormals(normals);
-    }
-  if ( numCells == numCellNormals )
-    {
-    outputCD->SetNormals(cellNormals);
-    }
+      TSortedArray aDataCellArray;
+      GetSortedArray(aDataCellMapper, aDataCellArray);
+      
+      int aMaxLength = std::max(aGeometryCellArray.size(), aDataCellArray.size());
+      TSortedArray anIntersectionArray(aMaxLength);
+      TSortedArray::iterator anArrayIter = anIntersectionArray.begin();
+      anArrayIter = std::set_intersection(aGeometryCellArray.begin(),
+                                         aGeometryCellArray.end(),
+                                         aDataCellArray.begin(),
+                                         aDataCellArray.end(),
+                                         anArrayIter);
+      
+      anIntersectionArray.erase(anArrayIter, anIntersectionArray.end());
+      
+      bool anIsCompletelyCoincide = 
+       anIntersectionArray.size() == aGeometryCellArray.size() && 
+       anIntersectionArray.size() == aDataCellArray.size();
 
-  if ( numPts == numTCoords )
-    {
-    outputPD->SetTCoords(tcoords);
-    }
-  if ( numCells == numCellTCoords )
-    {
-    outputCD->SetTCoords(cellTCoords);
+      if(!anIsCompletelyCoincide || IsMergingInputs()){
+       {
+         TId2IdMap anObj2VTKGeometryMap;
+         vtkIdType aNbCells = aGeometryCellMapper->GetNumberOfTuples();
+         for(int aCellId = 0; aCellId < aNbCells; aCellId++){
+           vtkIdType anObjID = aGeometryCellMapper->GetValue(aCellId);
+           anObj2VTKGeometryMap[anObjID] = aCellId;
+         }
+         
+         vtkIdType aNbTuples = anIntersectionArray.size();
+         anOutput->Allocate(aNbTuples);
+         vtkIdList *aCellIds = vtkIdList::New();
+         for(int aTupleId = 0; aTupleId < aNbTuples; aTupleId++){
+           vtkIdType anObjID = anIntersectionArray[aTupleId];
+           vtkIdType aCellId = anObj2VTKGeometryMap[anObjID];
+           vtkCell *aCell = anInput->GetCell(aCellId);
+           aCellIds->Reset();
+           vtkIdType aNbPointIds = aCell->PointIds->GetNumberOfIds();
+           for(vtkIdType aPointId = 0; aPointId < aNbPointIds; aPointId++)
+             aCellIds->InsertNextId(aCell->GetPointIds()->GetId(aPointId));
+           anOutput->InsertNextCell(anInput->GetCellType(aCellId), aCellIds);
+         }
+         aCellIds->Delete();
+         anOutput->SetPoints(anInput->GetPoints());
+       }
+       {
+         TId2IdMap anObj2VTKDataMap;
+         vtkIdType aNbCells = aDataCellMapper->GetNumberOfTuples();
+         for(int aCellId = 0; aCellId < aNbCells; aCellId++){
+           vtkIdType anObjID = aDataCellMapper->GetValue(aCellId);
+           anObj2VTKDataMap[anObjID] = aCellId;
+         }
+       
+         DeepCopyDataSetAttributes(this, 
+                                   anOutput, 
+                                   this->FieldList,
+                                   anIntersectionArray, 
+                                   anObj2VTKDataMap);
+       }
+       return;
+      }
     }
+  } else if (aGeometryCellMapper && (nbPointsInScalars < nbPointsInGeometr)) {
 
-  if ( numPts == numTensors )
-    {
-    outputPD->SetTensors(tensors);
+    vtkPointData* aInputScalarsPointData = aInputScalars->GetPointData();
+    
+    vtkIntArray* aDataPointMapper = NULL;
+    VISU::TFieldListIterator anIter(this->FieldList);
+    for(anIter.Begin(); !anIter.End() ; anIter.Next()){
+      const char* aFieldName = anIter.Get()->GetName();
+      if(strcmp(aFieldName, "VISU_POINTS_MAPPER") == 0){
+       vtkDataArray *aPointMapper = aInputScalarsPointData->GetArray(aFieldName);
+       aDataPointMapper = dynamic_cast<vtkIntArray*>(aPointMapper);
+       break;
+      }
     }
-  if ( numCells == numCellTensors )
-    {
-    outputCD->SetTensors(cellTensors);
+    vtkIntArray* aDataCellMapper = NULL;
+    VISU::TFieldListIterator anIter2(this->FieldList);
+    for(anIter2.Begin(); !anIter2.End() ; anIter2.Next()){
+      vtkCellData *aCellData = anIter2.Get()->Ptr->GetCellData();
+      const char* aFieldName = anIter2.Get()->GetName();
+      if(strcmp(aFieldName, "VISU_CELLS_MAPPER") == 0){
+       vtkDataArray *aCellMapper_tmp = aInputScalarsPointData->GetArray(aFieldName);
+       aDataCellMapper = dynamic_cast<vtkIntArray*>(aCellMapper_tmp);
+       break;
+      }
     }
 
-  VISU::TFieldListIterator it(this->FieldList);
-  vtkDataArray* da;
-  const char* name;
-  vtkIdType num;
-  for(it.Begin(); !it.End() ; it.Next())
-    {
-    pd = it.Get()->Ptr->GetPointData();
-    cd = it.Get()->Ptr->GetCellData();
-    name = it.Get()->GetName();
-    if ( (da=pd->GetArray(name)) )
+    bool anIsDifferent = aDataPointMapper &&
+      aDataPointMapper->GetNumberOfTuples() != aGeometryPointMapper->GetNumberOfTuples();
+    if(anIsDifferent){
+      TSortedArray aGeometryPointArray;
+      GetSortedArray(aGeometryPointMapper, aGeometryPointArray);
+      
+      TSortedArray aDataPointArray;
+      GetSortedArray(aDataPointMapper, aDataPointArray);
+
+      int aMaxLength = std::max(aGeometryPointArray.size(), aDataPointArray.size());
+      TSortedArray anIntersectionArray(aMaxLength);
+      TSortedArray::iterator anArrayIter = anIntersectionArray.begin();
+      anArrayIter = std::set_intersection(aGeometryPointArray.begin(),
+                                         aGeometryPointArray.end(),
+                                         aDataPointArray.begin(),
+                                         aDataPointArray.end(),
+                                         anArrayIter);
+      
+      anIntersectionArray.erase(anArrayIter, anIntersectionArray.end());
+      
       {
-      num = da->GetNumberOfTuples();
-      if (num == numPts)
-        {
-        outputPD->AddArray(da);
+        TId2IdMap anObj2VTKGeometryMap;
+        vtkIdType aNbCells = aDataPointMapper/*aGeometryPointMapper*/->GetNumberOfTuples();
+        for(int aCellId = 0; aCellId < aNbCells; aCellId++){
+          vtkIdType anObjID = aDataPointMapper/*aGeometryPointMapper*/->GetValue(aCellId);
+          anObj2VTKGeometryMap[anObjID] = aCellId;
         }
-      }
-    if ( (da=cd->GetArray(name)) )
-      {
-      num = da->GetNumberOfTuples();
-      if (num == numCells) // To fix a VTK bug
-        {
-        outputCD->AddArray(da);
+        
+        vtkIdType aNbTuples = anIntersectionArray.size();
+        
+        if ( aNbTuples == nbPointsInScalars ){
+          vtkUnstructuredGrid* aUnstructuredScalars = dynamic_cast<vtkUnstructuredGrid*>(aInputScalars);
+          if(aUnstructuredScalars)
+            anOutput->SetPoints(aUnstructuredScalars->GetPoints());
+          anOutput->GetPointData()->ShallowCopy(aInputScalars->GetPointData());
+          
+          // Calculate output cells
+          int nbCells=0;
+          TSortedArray aCellIdsForCopy;
+          GetIdsForCopy(anInput,aDataPointMapper,aCellIdsForCopy);
+          nbCells = aCellIdsForCopy.size();
+
+          // copy cells to output
+          anOutput->Allocate(nbCells);
+          vtkIntArray* theOuputIDSArray = vtkIntArray::New();
+          theOuputIDSArray->SetName("VISU_CELLS_MAPPER");
+          theOuputIDSArray->SetNumberOfComponents(1);
+          theOuputIDSArray->SetNumberOfTuples(nbCells);
+          
+          if(nbCells>0)
+            CopyElementsToOutput(anInput,
+                                 nbCells,
+                                 aCellIdsForCopy,
+                                 anObj2VTKGeometryMap,
+                                 theOuputIDSArray,
+                                 anOutput);
+          theOuputIDSArray->Delete();
+          return;
+          
+        } else {
+          // not implemented yet
         }
+        
+        
+        
       }
+      
+    }
+  }
+
+  anOutput->CopyStructure(anInput);
+  this->BasicExecute(anOutput);
+}
+
+namespace
+{
+  inline
+  void
+  CopyDataSetAttribute(vtkDataSet *theInput,
+                      TGetAttribute theGetAttribute,
+                      vtkDataSet *theOutput, 
+                      TSetAttribute theSetAttribute,
+                      vtkIdType theNbPoints, 
+                      vtkIdType theNbCells)
+  {
+    CopyAttribute(theInput->GetPointData(), 
+                 theGetAttribute,
+                 theOutput->GetPointData(), 
+                 theSetAttribute,
+                 theNbPoints);
+    CopyAttribute(theInput->GetCellData(), 
+                 theGetAttribute,
+                 theOutput->GetCellData(), 
+                 theSetAttribute,
+                 theNbCells);
+  }
+
+  inline
+  void
+  CopyDataSetField(vtkDataSet* theInput, 
+                  const char* theFieldName, 
+                  vtkDataSet* theOutput,
+                  vtkIdType theNbPoints, 
+                  vtkIdType theNbCells)
+  {
+    CopyField(theInput->GetPointData(), theFieldName, 
+             theOutput->GetPointData(), 
+             theNbPoints);
+    CopyField(theInput->GetCellData(), theFieldName, 
+             theOutput->GetCellData(), 
+             theNbCells);
+  }
+
+}
+
+void VISU_MergeFilter::BasicExecute(vtkDataSet *output)
+{
+  vtkIdType numPts, numCells;
+  
+  vtkDebugMacro(<<"Merging data!");
+
+  if ( (numPts = output->GetNumberOfPoints()) < 1 )
+    {
+    vtkWarningMacro(<<"Nothing to merge!");
     }
+  numCells = output->GetNumberOfCells();
+  
+  // merge data only if it is consistent
+  if(vtkDataSet* aDataSet = this->GetScalars())
+    CopyDataSetAttribute(aDataSet, 
+                        &vtkDataSetAttributes::GetScalars,
+                        output,
+                        &vtkDataSetAttributes::SetScalars,
+                        numPts,
+                        numCells);
+
+  if(vtkDataSet* aDataSet = this->GetVectors())
+    CopyDataSetAttribute(aDataSet, 
+                        &vtkDataSetAttributes::GetVectors,
+                        output, 
+                        &vtkDataSetAttributes::SetVectors,
+                        numPts, 
+                        numCells);
+
+  if(vtkDataSet* aDataSet = this->GetNormals())
+    CopyDataSetAttribute(aDataSet,
+                        &vtkDataSetAttributes::GetNormals,
+                        output,
+                        &vtkDataSetAttributes::SetNormals,
+                        numPts,
+                        numCells);
+
+  if(vtkDataSet* aDataSet = this->GetTCoords())
+    CopyDataSetAttribute(aDataSet,
+                        &vtkDataSetAttributes::GetTCoords,
+                        output,
+                        &vtkDataSetAttributes::SetTCoords,
+                        numPts, 
+                        numCells);
+
+  if(vtkDataSet* aDataSet = this->GetTensors())
+    CopyDataSetAttribute(aDataSet, 
+                        &vtkDataSetAttributes::GetTensors,
+                        output, 
+                        &vtkDataSetAttributes::SetTensors,
+                        numPts, 
+                        numCells);
+
+  VISU::TFieldListIterator anIter(this->FieldList);
+  for(anIter.Begin(); !anIter.End() ; anIter.Next()){
+    vtkDataSet *aDataSet = anIter.Get()->Ptr;
+    const char* aFieldName = anIter.Get()->GetName();
+    CopyDataSetField(aDataSet, 
+                    aFieldName, 
+                    output, 
+                    numPts, 
+                    numCells);
+  }
 }
index 29c4b701534b5978f30d430e66b94864693a4b72..3379f5d6388a1460e125d9afbfcb9c240966ddaf 100644 (file)
@@ -29,7 +29,9 @@
 #ifndef VISU_MergeFilter_H
 #define VISU_MergeFilter_H
 
-#include <vtkDataSetToDataSetFilter.h>
+#include <vtkUnstructuredGridToUnstructuredGridFilter.h>
+
+class vtkDataSet;
 
 namespace VISU
 {
@@ -39,16 +41,16 @@ namespace VISU
 // Following class was redefined in order to fix VTK bug 
 //  (see code for more details)
 
-class VISU_MergeFilter : public vtkDataSetToDataSetFilter
+class VISU_MergeFilter : public vtkUnstructuredGridToUnstructuredGridFilter
 {
 public:
   static VISU_MergeFilter *New();
-  vtkTypeMacro(VISU_MergeFilter,vtkDataSetToDataSetFilter);
+  vtkTypeMacro(VISU_MergeFilter,vtkUnstructuredGridToUnstructuredGridFilter);
 
   // Description:
   // Specify object from which to extract geometry information.
-  void SetGeometry(vtkDataSet *input) {this->SetInput(input);};
-  vtkDataSet *GetGeometry() {return this->GetInput();};
+  void SetGeometry(vtkUnstructuredGrid *input) {this->SetInput(input);};
+  vtkUnstructuredGrid *GetGeometry() {return this->GetInput();};
 
   // Description:
   // Specify object from which to extract scalar information.
@@ -81,14 +83,30 @@ public:
   // of the field
   void AddField(const char* name, vtkDataSet* input);
 
+  // Description:
+  // Removes all previously added fields
+  void RemoveFields();
+
+  // Description:
+  // Defines whether to perform merging of data with the geometry according to
+  // the ids of the cell or not
+  void
+  SetMergingInputs(bool theIsMergingInputs);
+  
+  bool
+  IsMergingInputs();
+  
 protected:
   VISU_MergeFilter();
   ~VISU_MergeFilter();
 
   // Usual data generation method
+  void BasicExecute(vtkDataSet *output);
   void Execute();
 
   VISU::TFieldList* FieldList;
+  bool myIsMergingInputs;
+
 private:
   VISU_MergeFilter(const VISU_MergeFilter&);  // Not implemented.
   void operator=(const VISU_MergeFilter&);  // Not implemented.
index a6629c7c6c2cfd89102cd46811172857dfd04c3f..b929e1d8f039ec8a362655fe332adf4184ca88df 100644 (file)
@@ -36,6 +36,8 @@
 using namespace std;
 
 static vtkFloatingPointType EPS = 1.0E-3;
+static int MIN_NB_PLANES = 1;
+static int MAX_NB_PLANES = 100;
 
 vtkStandardNewMacro(VISU_CutPlanesPL);
 
@@ -259,7 +261,7 @@ void
 VISU_CutPlanesPL
 ::SetNbParts(int theNb) 
 {
-  myNbParts = theNb;
+  myNbParts = (theNb<MIN_NB_PLANES?MIN_NB_PLANES:(theNb>MAX_NB_PLANES?MAX_NB_PLANES:theNb));
   myPartPosition.resize(myNbParts);
   myPartCondition.resize(myNbParts,1);
   Modified();
index e92e4ac8792080546e4347c3021971458ce293e5..36013fc3b1344a4248cfb7a0fe124caace565bb6 100644 (file)
@@ -103,6 +103,11 @@ public:
   int
   IsPartDefault(int thePartNumber);
 
+  /*!
+   * The number of cut planes can be defined under existing conditions [1,100].
+   * If setting value less than 1, the number of planes wil be setted to 1,
+   * and if value more than 100, the number of planes wil be setted to 100.
+   */
   virtual
   void
   SetNbParts(int theNb);
index 03a20ae8c7ea9529f3271f33c5fc6adf9a779317..9ed61c0e619e217186a067e20148fcd78e237393 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "VISU_Extractor.hxx"
 #include "VISU_PipeLineUtils.hxx"
+#include "VISU_ConvertorUtils.hxx"
 
 #include <sstream>
 
@@ -121,10 +122,10 @@ void VISU_Extractor::Execute()
   vtkDataSet *input = this->GetInput();
   vtkDataSet *output = this->GetOutput();
   output->CopyStructure(input);
-  output->GetPointData()->CopyAllOff();
-  output->GetCellData()->CopyAllOff();
-  if(input->GetPointData()->GetNumberOfArrays()){
+  if(VISU::IsDataOnPoints(input)){
     output->GetPointData()->CopyVectorsOn();
+    output->GetPointData()->CopyScalarsOff();
+
     int aNbElems = input->GetNumberOfPoints();
     vtkPointData *inData = input->GetPointData(), *outData = output->GetPointData();
     if(!inData->GetAttribute(vtkDataSetAttributes::SCALARS))
@@ -135,6 +136,8 @@ void VISU_Extractor::Execute()
     outData->AddArray(inData->GetArray("VISU_FIELD"));
   }else{
     output->GetCellData()->CopyVectorsOn();
+    output->GetCellData()->CopyScalarsOff();
+
     int aNbElems = input->GetNumberOfCells();
     vtkCellData *inData = input->GetCellData(), *outData = output->GetCellData();
     if(inData->GetAttribute(vtkDataSetAttributes::VECTORS))
@@ -144,6 +147,10 @@ void VISU_Extractor::Execute()
     outData->PassData(inData);
     outData->AddArray(inData->GetArray("VISU_FIELD"));
   }
-  
-  //  return aRet;
+
+  if(vtkDataArray *aDataArray = input->GetCellData()->GetArray("VISU_CELLS_MAPPER"))
+    output->GetCellData()->AddArray(aDataArray);
+
+  if(vtkDataArray *aDataArray = input->GetPointData()->GetArray("VISU_POINTS_MAPPER"))
+    output->GetPointData()->AddArray(aDataArray);
 }
index e0f1516c36aecbc2d2422bcbe2a9964e3d3d6935..d8a3a281ea44a91471a9979643ff02792ffe7ee9 100644 (file)
@@ -248,21 +248,18 @@ VISU_FieldTransform
 
   output->CopyStructure(input);
   if(myFunction != &Ident || (myTransform && !myTransform->IsIdentity())){
-    output->GetPointData()->CopyAllOff();
-    output->GetCellData()->CopyAllOff();
+    output->GetPointData()->CopyScalarsOff();
+    output->GetPointData()->CopyVectorsOff();
+
+    output->GetCellData()->CopyScalarsOff();
+    output->GetCellData()->CopyVectorsOff();
 
     ExecScalars(myFunction,myScalarRange,input->GetNumberOfPoints(),input->GetPointData(),output->GetPointData());
     ExecVectors(myFunction,myTransform,myScalarRange,input->GetNumberOfPoints(),input->GetPointData(),output->GetPointData());
 
     ExecScalars(myFunction,myScalarRange,input->GetNumberOfCells(),input->GetCellData(),output->GetCellData());
     ExecVectors(myFunction,myTransform,myScalarRange,input->GetNumberOfCells(),input->GetCellData(),output->GetCellData());
-  }else{
-    output->GetPointData()->CopyAllOn();
-    output->GetCellData()->CopyAllOn();
-
-    output->GetPointData()->PassData(input->GetPointData());
-    output->GetCellData()->PassData(input->GetCellData());
   }
-  
-  return 1;
+  output->GetPointData()->PassData(input->GetPointData());
+  output->GetCellData()->PassData(input->GetCellData());
 }
index 4f87eaea64dc7ee0f7cbd7e0d5a0885ad82124e5..f84adcbf02e03d314f5bc21544db8207552b5912 100644 (file)
@@ -31,6 +31,7 @@
 #include "VISU_FieldTransform.hxx"
 #include "VISU_LookupTable.hxx"
 #include "VISU_Extractor.hxx"
+#include "VISU_ConvertorUtils.hxx"
 
 #include <vtkProperty.h>
 #include <vtkObjectFactory.h>
@@ -75,7 +76,7 @@ namespace VISU
                  vtkDataSet* theDataSet,
                  VISU_FieldTransform *theFieldTransform)
   {
-    if(theDataSet->GetCellData()->GetNumberOfArrays()){
+    if(VISU::IsDataOnCells(theDataSet)){
       theFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput());
       theFilter->PassCellDataOn();
       theTItem->SetInput(theFilter->GetUnstructuredGridOutput());
@@ -90,7 +91,7 @@ namespace VISU
                vtkDataSet* theDataSet,
                VISU_FieldTransform *theFieldTransform)
   {
-    if(theDataSet->GetCellData()->GetNumberOfArrays()){
+    if(VISU::IsDataOnCells(theDataSet)){
       theFilter->SetInput(theFieldTransform->GetUnstructuredGridOutput());
       theFilter->VertexCellsOn();
       theTItem->SetInput(theFilter->GetOutput());
index e5de36c4356c48f243145fb98dc10021b95a2a2c..4d0ebf651fab0b1152743233f41dd1257523127f 100644 (file)
@@ -182,7 +182,7 @@ Update()
   }
   if ( !myIsContour ) // surface prs
   {
-    if(aPolyData->GetCellData()->GetNumberOfArrays()) {
+    if(VISU::IsDataOnCells(aPolyData)) {
       myCellDataToPointData->SetInput(aPolyData);
       myCellDataToPointData->PassCellDataOn();
       myWarpScalar->SetInput(myCellDataToPointData->GetPolyDataOutput());
@@ -191,7 +191,7 @@ Update()
   }
   else // contour prs
   {
-    if(aPolyData->GetCellData()->GetNumberOfArrays()) {
+    if(VISU::IsDataOnCells(aPolyData)) {
       myCellDataToPointData->SetInput(aPolyData);
       myCellDataToPointData->PassCellDataOn();
       myContourFilter->SetInput(myCellDataToPointData->GetOutput());
index 8701c47f0ec8aea47cdf74444ec5d2c1b1d08b9d..c5c6ccd42f5d3a0b019c3332945a1abe7379d516 100644 (file)
@@ -30,6 +30,9 @@
 #include "VISU_IDMapper.hxx"
 #include "VTKViewer_AppendFilter.h"
 
+#include "VISU_AppendFilter.hxx"
+#include "VISU_MergeFilter.hxx"
+
 #include "VISU_PipeLineUtils.hxx"
 
 #include <vtkMapper.h>
@@ -60,18 +63,21 @@ using namespace std;
 vtkStandardNewMacro(VISU_PrsMergerPL);
 
 VISU_PrsMergerPL
-::VISU_PrsMergerPL()
+::VISU_PrsMergerPL():
+  myAppendFilter(VISU_AppendFilter::New()),
+  myMergeFilter(VISU_MergeFilter::New()),
+  myScalars(NULL)
 {
-  myScalars = NULL;
-  
-  myMeshGeometryList.clear();
+  myAppendFilter->SetMergingInputs(true);
+  myAppendFilter->Delete();
+
+  myMergeFilter->SetMergingInputs(true);
+  myMergeFilter->Delete();
 }
 
 VISU_PrsMergerPL
 ::~VISU_PrsMergerPL()
-{
-  myMeshGeometryList.clear();
-}
+{}
 
 void
 VISU_PrsMergerPL
@@ -107,7 +113,9 @@ bool
 VISU_PrsMergerPL
 ::SetGeometry(VISU_PipeLine* theGeometry,bool theUpdate)
 {
+  if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::SetGeometry()");
   myMeshGeometryList.clear();
+  
   if(this->checkGeometry(theGeometry)){
     myMeshGeometryList.push_back(theGeometry);
     if (MYDEBUG) MESSAGE("this->GetGeometry(0)->GetIDMapper()="<<this->GetGeometry(0)->GetIDMapper());
@@ -125,6 +133,7 @@ int
 VISU_PrsMergerPL
 ::AddBackGeometry(VISU_PipeLine* theGeometry,bool theUpdate)
 {
+  if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::AddBackGeometry() "<<theGeometry);
   if(theGeometry == NULL) return -1;
   int aGeomNum = this->GetGeometryNumber(theGeometry);
   if(aGeomNum == -1){
@@ -254,17 +263,19 @@ VISU_PrsMergerPL
 {
   const VISU::PIDMapper& aMapper  = thePipeLine->GetIDMapper();
   int aNbPoints = aMapper->GetVTKOutput()->GetNumberOfPoints();
-  if (this->GetNbGeometry() > 0){
-    const VISU::PIDMapper& aMapper2 = this->GetGeometry(0)->GetIDMapper();
-    int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
-    if(aNbPoints2 != aNbPoints)
-      return false;
-  } else if (this->GetScalars()) {
-    const VISU::PIDMapper& aMapper2 = this->GetScalars()->GetIDMapper();
-    int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
-    if(aNbPoints2 != aNbPoints)
-      return false;
-  }
+//   if (this->GetNbGeometry() > 0){
+//     const VISU::PIDMapper& aMapper2 = this->GetGeometry(0)->GetIDMapper();
+//     int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
+//     if(aNbPoints2 != aNbPoints)
+//       return false;
+//   } else if (this->GetScalars()) {
+//     const VISU::PIDMapper& aMapper2 = this->GetScalars()->GetIDMapper();
+//     int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
+//     if(aNbPoints2 != aNbPoints)
+//       return false;
+//   }
+  if(aNbPoints < 1)
+    return false;
   return true;
 }
 
@@ -274,12 +285,14 @@ VISU_PrsMergerPL
 {
   const VISU::PIDMapper& aMapper  = thePipeLine->GetIDMapper();
   int aNbPoints = aMapper->GetVTKOutput()->GetNumberOfPoints();
-  if (this->GetNbGeometry() > 0){
-    const VISU::PIDMapper& aMapper2 = this->GetGeometry(0)->GetIDMapper();
-    int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
-    if(aNbPoints2 != aNbPoints)
-      return false;
-  }
+//   if (this->GetNbGeometry() > 0){
+//     const VISU::PIDMapper& aMapper2 = this->GetGeometry(0)->GetIDMapper();
+//     int aNbPoints2 = aMapper2->GetVTKOutput()->GetNumberOfPoints();
+//     if(aNbPoints2 != aNbPoints)
+//       return false;
+//   }
+  if(aNbPoints < 1)
+    return false;
   return true;
 }
 
@@ -295,107 +308,50 @@ VISU_PrsMergerPL
    * 2.1 Group Cell         - OK
    * 2.2 Group Point        - ERR (remove points groups)
    */
-
-
-
   if(MYDEBUG) MESSAGE("VISU_PrsMergerPL::Execute()");
 
-  if(myMeshGeometryList.size() != 0)
-    {
-      
-      typedef std::vector<int> TVec;
+  myAppendFilter->RemoveAllInputs();
+  if(!myMeshGeometryList.empty()){
+    const VISU::PIDMapper& aScalarsIDMapper = myScalars->GetIDMapper();
+    VISU::TVTKOutput* aScalarsOutput = aScalarsIDMapper->GetVTKOutput();
+
+    // copy points to output from input first geometry
+
+    VISU::TVTKOutput* aGeomOutput = NULL;
+    vtkIdType aNbGeoms = this->GetNbGeometry();
+    for(vtkIdType aGeomId = 0; aGeomId < aNbGeoms; aGeomId++){
+      VISU_PipeLine* aGeomPipeLine  = this->GetGeometry(aGeomId);
+      const VISU::PIDMapper& aGeomIDMapper = aGeomPipeLine->GetIDMapper();
+      aGeomOutput = aGeomIDMapper->GetVTKOutput();
+      vtkIdType aNbCells = aGeomOutput->GetNumberOfCells();
+//       if(aNbCells > 0)
+//     if(aGeomOutput->GetCell(0)->GetCellType() == VTK_VERTEX )
+//       continue;
       
-      vtkUnstructuredGrid* output = vtkUnstructuredGrid::New();
-      TVec aObjIds; // vector with object ids
-      vtkFloatArray* newArray = vtkFloatArray::New();
+      myAppendFilter->AddInput(aGeomOutput);
+    }
+    
+    myAppendFilter->SetSharedPointsDataSet(aGeomOutput);
+    myAppendFilter->Update();
 
-      VISU_ScalarMapPL* aScalarMap = dynamic_cast<VISU_ScalarMapPL*>(this->GetScalars());
-      const VISU::PIDMapper& aScalarMapper  = myScalars->GetIDMapper();
-      
-      // copy points to output from input scalar map
-      output->SetPoints(aScalarMapper->GetVTKOutput()->GetPoints());
-      
-      int newCellId;
-      int anbGeoms = this->GetNbGeometry();
-      for(int i=0; i < anbGeoms; i++) {
-       VISU_PipeLine* aCurrGeometry  = this->GetGeometry(i);
-       const VISU::PIDMapper& aGM  = aCurrGeometry->GetIDMapper();
-       int aNbCells = aGM->GetVTKOutput()->GetNumberOfCells();
-       if (aNbCells >0 )
-         if (aGM->GetVTKOutput()->GetCell(0)->GetCellType() == VTK_VERTEX )
-           continue;
-
-       vtkIdList* ptIds = vtkIdList::New(); 
-       ptIds->Allocate(VTK_CELL_SIZE);
-
-       for(int j=0; j < aNbCells; j++){
-
-         int anObjID = aGM->GetElemObjID(j);
-         aObjIds.push_back(anObjID);
-         
-         // copy cells to output from input geoms
-         aGM->GetVTKOutput()->GetCellPoints(j, ptIds);
-         newCellId = output->InsertNextCell(aGM->GetVTKOutput()->GetCellType(j),ptIds);
-       }
-       ptIds->Delete();
-      }      
-      
-
-      //copy array values
-      vtkDataArray* da;
-      if((da = aScalarMapper->GetVTKOutput()->GetPointData()->GetArray("VISU_FIELD"))){
-       output->GetPointData()->AddArray(da);
-       vtkDataArray* vc = aScalarMapper->GetVTKOutput()->GetPointData()->GetVectors();
-       if(vc)
-         output->GetPointData()->SetVectors(vc);
-      }
-      if((da = aScalarMapper->GetVTKOutput()->GetCellData()->GetArray("VISU_FIELD"))){
-       if(MYDEBUG){
-         MESSAGE("aScalarMapper NumberOfComponents="<<da->GetNumberOfComponents());
-         MESSAGE("aScalarMapper NumberOfTuples    ="<<da->GetNumberOfTuples());
-       }
-
-       newArray->SetNumberOfComponents(da->GetNumberOfComponents());
-       newArray->SetNumberOfTuples(aObjIds.size());
-       newArray->SetName("VISU_FIELD");
-       
-       TVec::const_iterator aIdsIter = aObjIds.begin();
-       for(int i=0; aIdsIter != aObjIds.end(); aIdsIter++){
-         int anObjID = *aIdsIter;
-         int aVTKID  = aScalarMapper->GetElemVTKID(anObjID);
-         newArray->SetTuple(i,da->GetTuple(aVTKID));
-         i++;
-       }
-       output->GetCellData()->AddArray(newArray);
-
-       // need in vectors array and scalars array
-       if(vtkDataArray* vc = aScalarMapper->GetVTKOutput()->GetCellData()->GetVectors()){
-         output->GetCellData()->SetVectors(newArray);
-       }
-       else if(vtkDataArray* sc = aScalarMapper->GetVTKOutput()->GetCellData()->GetScalars())
-         output->GetCellData()->SetScalars(newArray);
-      }
-      
-      if(MYDEBUG){
-       MESSAGE("output:");
-       output->Print(cout);
-      }
+    vtkUnstructuredGrid* aGeomDataSet = myAppendFilter->GetOutput();
+    myMergeFilter->SetGeometry(aGeomDataSet);
 
+    //copy array values
+    myMergeFilter->SetScalars(aScalarsOutput);
+    myMergeFilter->SetVectors(aScalarsOutput);
 
-      SetInput(output);
-      
-      output->Delete();
-      newArray->Delete();
-    }
-  else
-    {
-      if(myScalars != NULL)
-       {
-         VISU_ScalarMapPL* aScalarMap = dynamic_cast<VISU_ScalarMapPL*>(this->GetScalars());
-         VISU_PrsMergerPL* aPrsMerger = dynamic_cast<VISU_PrsMergerPL*>(this->GetScalars());
-         if(aScalarMap != NULL){
-           SetInput(aScalarMap->GetInput());
-         }
-       }
+    myMergeFilter->RemoveFields();
+    myMergeFilter->AddField("VISU_FIELD", aScalarsOutput);
+    myMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsOutput);
+    myMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsOutput);
+    
+    myMergeFilter->Update();
+    SetInput(myMergeFilter->GetOutput());
+  }else{
+    if(myScalars != NULL){
+      if(VISU_ScalarMapPL* aScalarMap = dynamic_cast<VISU_ScalarMapPL*>(this->GetScalars()))
+       SetInput(aScalarMap->GetInput());
     }
+  }
 }
index 572c0839bd8c49293da82e475ca173b0ec52b1cd..7dc0dac8a7a7580a5be807943b274cb266b2cb7e 100644 (file)
 
 #include "VISU_ScalarMapPL.hxx"
 
+class VISU_AppendFilter;
+class VISU_MergeFilter;
+
+
 class VISU_PIPELINE_EXPORT VISU_PrsMergerPL : public VISU_ScalarMapPL
 {
   typedef VISU_ScalarMapPL TSupperClass;
@@ -156,11 +160,12 @@ public:
   void SetInitialRange();
 
 protected:
-  TPipeLines     myMeshGeometryList;
+  TPipeLines myMeshGeometryList;
+  vtkSmartPointer<VISU_AppendFilter> myAppendFilter;
+  vtkSmartPointer<VISU_MergeFilter> myMergeFilter;
   
-  TPipeLine      myScalars;
-
   vtkFloatingPointType* myScalarRanges;
+  TPipeLine myScalars;
 
 private:
   
@@ -184,7 +189,6 @@ private:
 
   void
   Execute();
-
 };
 
 #endif
index a2aa2938304ddfd7ff7b47ec5015f12744614dc5..1a31a8b21ae3f950bd0abb6fe1d518f462386e50 100644 (file)
 
 #include "VISU_ScalarMapOnDeformedShapePL.hxx"
 #include "VISU_DeformedShapePL.hxx"
+#include "VISU_MergeFilter.hxx"
+
 #include "VISU_PipeLineUtils.hxx"
 #include "VTKViewer_TransformFilter.h"
 #include "VTKViewer_Transform.h"
 #include "VISU_MergeFilter.hxx"
 
 #include <vtkWarpVector.h>
-
 #include <vtkUnstructuredGrid.h>
 #include <vtkCellDataToPointData.h>
 #include <vtkPointDataToCellData.h>
 
-#include <VISU_Convertor.hxx>
+#include "VISU_Convertor.hxx"
+#include "VISU_ConvertorUtils.hxx"
 
 vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL)
 
@@ -124,8 +126,11 @@ VISU_ScalarMapOnDeformedShapePL
                        GetInput2(),myFieldTransform);
   
   // Sets geometry for merge filter
-  myMergeFilter->SetGeometry(myDeformVectors->GetOutput());
+  myMergeFilter->SetGeometry(myDeformVectors->GetUnstructuredGridOutput());
   myMergeFilter->SetScalars(myExtractorScalars->GetOutput());
+  myMergeFilter->AddField("VISU_CELLS_MAPPER", myExtractorScalars->GetOutput());
+  myMergeFilter->Update();
+
   // Sets data to mapper
   myMapper->SetInput(myMergeFilter->GetOutput());
 }
@@ -194,6 +199,8 @@ VISU_ScalarMapOnDeformedShapePL
   vtkUnstructuredGrid* aScalars = GetScalarsUnstructuredGrid();
   vtkCellData *aInCellData = GetInput()->GetCellData();
 
+  std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-SetScalars.vtk";
+  VISU::WriteToFile(aScalars, aFileName);
   if(aScalars->GetPointData()->GetScalars())
     myExtractorScalars->SetInput(aScalars);
   else if(aScalars->GetCellData()->GetScalars() &&
index 0c6b990328b57d3bff5dabf721b35ae914757bd5..0fa68d13e5fbb0be732175c76d324918ef08ed99 100644 (file)
@@ -95,10 +95,10 @@ void
 VISU_ScalarMapPL
 ::SetScalarMode(int theScalarMode)
 {
-  vtkDataSet *input = GetInput();
-  if (input){
-    if(input->GetPointData()->GetNumberOfArrays()){
-      vtkPointData *inData = input->GetPointData();
+  vtkDataSet *anInput = GetInput();
+  if(anInput){
+    if(VISU::IsDataOnPoints(anInput)){
+      vtkPointData *inData = anInput->GetPointData();
       if(!inData->GetAttribute(vtkDataSetAttributes::VECTORS)) {
        if (theScalarMode==0){
          return;
@@ -106,7 +106,7 @@ VISU_ScalarMapPL
       }
     }
     else {
-      vtkCellData *inData = input->GetCellData();
+      vtkCellData *inData = anInput->GetCellData();
       if(!inData->GetAttribute(vtkDataSetAttributes::VECTORS)){
        if (theScalarMode==0){
          return;
index e64f40f9300b21a7091addf0d2477cdb960767d1..a106c884a1d34e3508e14e8d3c082a59f1d90a8d 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <vtkCell.h>
 #include <vtkPointSet.h>
+#include <vtkDataSet.h>
 #include <vtkStreamLine.h>
 
 #ifdef _DEBUG_
@@ -86,7 +87,7 @@ void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){
              aPipeLine->GetUsedPoints(),
              aPipeLine->GetDirection());
   }
-  VISU_DeformedShapePL::ShallowCopy(thePipeLine);
+  Superclass::ShallowCopy(thePipeLine);
 }
 
 
@@ -180,7 +181,7 @@ VISU_StreamLinesPL
   if((!isOnlyTry && isAccepted) || (isOnlyTry && isAccepted == 1)){
     mySource = theSource;
     myPercents = thePercents;
-    if(GetInput2()->GetCellData()->GetNumberOfArrays()){
+    if(VISU::IsDataOnCells(GetInput2())){
       myCenters->SetInput(aDataSet);
       myCenters->VertexCellsOn();
       aDataSet = myCenters->GetOutput();
@@ -234,7 +235,11 @@ VISU_StreamLinesPL
 ::GetVelocityCoeff(vtkPointSet* theDataSet)
 {
   vtkFloatingPointType* aScalarRange = theDataSet->GetScalarRange();
-  return (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0;
+  vtkFloatingPointType aVelocity = (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0;
+  if (aVelocity < EPS)
+    return EPS;
+
+  return aVelocity;
 }
 
 
@@ -498,7 +503,7 @@ void
 VISU_StreamLinesPL
 ::Init()
 {
-  VISU_PrsMergerPL::Init();
+  Superclass::Init();
   vtkPointSet* aDataSet = myExtractor->GetOutput();
   vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet);
   vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet);
@@ -523,12 +528,14 @@ void
 VISU_StreamLinesPL
 ::Update()
 {
-  VISU_PrsMergerPL::Update();
+  try{
+    Superclass::Update();
+  } catch(...){}
 }
 
 void
 VISU_StreamLinesPL
 ::SetMapScale(vtkFloatingPointType theMapScale)
 {
-  VISU_ScalarMapPL::SetMapScale(theMapScale);
+  Superclass::SetMapScale(theMapScale);
 }
index b59b4e4f5c7190cce73d0a36b6801a55e5a73cf1..75c27f2741fea5824ab5b4d57150df46670ce19b 100644 (file)
@@ -159,8 +159,11 @@ msgstr "Sweeping preferences"
 msgid "VISU_LINEAR_SWEEP"
 msgstr "Linear" 
 
-msgid "VISU_U_SWEEP"
-msgstr "Cosinusoidal"
+msgid "VISU_COS_SWEEP"
+msgstr "Cosinusoidal ( (1 - cos(t))/2 )"
+
+msgid "VISU_SIN_SWEEP"
+msgstr "Sinusoidal ( sin( t - PI/2 ) )"
 
 msgid "VISU_SWEEPING_MODES"
 msgstr "Mode of the sweeping "
index 46252b0d98edb1947a0ed5aac4cd8a830b5a7792..d7f5d3006e4ea9c4a7ce95c9ec29cea72c780995 100644 (file)
@@ -397,6 +397,44 @@ OnImportMedField()
     Handle(SALOME_InteractiveObject) anIO = It.Value();
     SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
     if (!aSObject->_is_nil()) {
+
+      // try to load a component data from an opened (presumably) study
+      // The same in SUPERVISION: NPAL14522
+      {
+        SALOMEDS::SComponent_ptr aSComp = aSObject->GetFatherComponent();
+        //std::string aCompIOR;
+        CORBA::String_var aCompIOR;
+        if (!aSComp->ComponentIOR(aCompIOR)) { // not loaded
+          CORBA::String_var aCompDataType = aSComp->ComponentDataType();
+          //std::string aCompDataType = aSComp->ComponentDataType();
+
+          // obtain a driver by a component data type
+          // like it is done in SALOMEDS_DriverFactory_i::GetDriverByType
+          SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_nil();
+          SALOME_LifeCycleCORBA * LCC = getApp()->lcc();
+          try {
+            CORBA::Object_var
+              //anEngineObj = LCC->FindOrLoad_Component("FactoryServer", aCompDataType.c_str());
+              anEngineObj = LCC->FindOrLoad_Component("FactoryServer", aCompDataType);
+            if (CORBA::is_nil(anEngineObj))
+              //anEngineObj = LCC->FindOrLoad_Component("FactoryServerPy", aCompDataType.c_str());
+              anEngineObj = LCC->FindOrLoad_Component("FactoryServerPy", aCompDataType);
+
+            if (!CORBA::is_nil(anEngineObj))
+              anEngine = SALOMEDS::Driver::_narrow(anEngineObj);
+
+            if (!CORBA::is_nil(anEngine)) {
+              // try to load
+              SALOMEDS::StudyBuilder_ptr aStudyBuilder = aStudy->NewBuilder();
+              //aStudyBuilder->LoadWith(aSComp, aDriverIOR.in());
+              aStudyBuilder->LoadWith(aSComp, anEngine);
+            }
+          }
+          catch (...) {
+          }
+        }
+      }
+
       CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
       if (!CORBA::is_nil(anObject)) {
         SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
@@ -1625,11 +1663,17 @@ OnSweep()
     for (int i = 0; i <= aSteps; i++) {
       try {
         float aPercents;
-        if( aMode == 1 ){  //if selected Periodic mode of sweeping
-         float aT = ( is2Pi == 1 ? -PI + 2. * PI * float(i)/aSteps : PI * float(i)/aSteps );
-          //This is necessary in order for animation to retrun to the initial picture
+       float aT;
+       if( aMode >= 1 )
+         aT = ( is2Pi == 1 ? -PI + 2. * PI * float(i)/aSteps : PI * float(i)/aSteps );
+        if( aMode == 1 ){  //if selected Periodic cosinusoidal mode of sweeping
+          //This is necessary in order for animation to return to the initial picture
          aPercents = (1.-cos( aT ))/2.;
         }
+        else if( aMode == 2 ){  //if selected Periodic sinusoidal mode of sweeping
+          //This is necessary in order for animation to return to the initial picture
+         aPercents = sin( aT - PI/2 );
+        }
         else //if selected Linear mode of sweeping
           aPercents = float(i)/aSteps;
         aPrsObject->SetMapScale(aPercents);
@@ -3095,10 +3139,12 @@ void VisuGUI::createPreferences()
   int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
   QStringList sweep_modes;
   sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
-  sweep_modes.append( tr( "VISU_U_SWEEP" ) );
+  sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
+  sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
   indices.clear();
   indices.append( 0 );
   indices.append( 1 );
+  indices.append( 2 );
   setPreferenceProperty( modeSw, "strings", sweep_modes );
   setPreferenceProperty( modeSw, "indexes", indices );
 
index 498d6e901d6a0cdf3bd197876faf8ea6bff932ca..3800c95cbe510be19d212ba7c38e40729e0b0698 100644 (file)
@@ -349,17 +349,16 @@ VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule,
   VISU::RangeStepAndValidator(SpinBoxRot1, -180.0, 180.0, 1, 3);
   VISU::RangeStepAndValidator(SpinBoxRot2, -180.0, 180.0, 1, 3);
 
+  ComboBoxOrientation->insertItem(tr("PARALLEL_XOY_COMBO_ITEM"));
+  ComboBoxOrientation->insertItem(tr("PARALLEL_YOZ_COMBO_ITEM"));
+  ComboBoxOrientation->insertItem(tr("PARALLEL_ZOX_COMBO_ITEM"));
+
   SpinBoxDistance->setValue(0.5);
 
   myPrs3d = 0;
   myIsSelectPlane = false;
   onSelectionChanged();
 
-  ComboBoxOrientation->insertItem(tr("PARALLEL_XOY_COMBO_ITEM"));
-  ComboBoxOrientation->insertItem(tr("PARALLEL_YOZ_COMBO_ITEM"));
-  ComboBoxOrientation->insertItem(tr("PARALLEL_ZOX_COMBO_ITEM"));
-
-
   // signals and slots connections :
   connect(ComboBoxPlanes         , SIGNAL(activated(int))           , this, SLOT(onSelectPlane(int)));
   connect(buttonNew              , SIGNAL(clicked())                , this, SLOT(ClickOnNew()));
@@ -1021,18 +1020,18 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam()
   static double aCoeff = 180.0/vtkMath::Pi();
   for (i = 0; i < 2; ++i) {
     vtkFloatingPointType cosin = cos[ rotId[ i ]];
-    if (maxCos < 0)
-      cosin = -cosin;
+//     if (maxCos < 0)
+//       cosin = -cosin;
     angle[ i ] = asin(cosin) * aCoeff;
-    if (maxCos < 0)
-      angle[ i ] += 180. * (angle[ i ] < 0 ? 1. : -1.);
+//     if (maxCos < 0)
+//       angle[ i ] += 180. * (angle[ i ] < 0 ? 1. : -1.);
   }
   if (CheckBoxIJKPlaneReverse->isChecked()) {
     angle[ 0 ] += 180. * (angle[ 0 ] < 0 ? 1. : -1.);
     distance = 1. - distance;
   }
-  if (maxCos < 0)
-    distance = 1. - distance;
+//   if (maxCos < 0)
+//     distance = 1. - distance;
 
   // set paramerets
   myIsSelectPlane = true;
@@ -1099,11 +1098,11 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured()
   // find index value
   double v = SpinBoxDistance->value();
   // reverse value?
-  bool reverse = (normal * axDir < 0); // normal and axis are opposite
-  if (gridDir * axDir < 0) // grid dir and axis are opposite
-    reverse = !reverse;
-  if (reverse)
-    v = 1. - v;
+//   bool reverse = (normal * axDir < 0); // normal and axis are opposite
+//   if (gridDir * axDir < 0) // grid dir and axis are opposite
+//     reverse = !reverse;
+//   if (reverse)
+//     v = 1. - v;
   for (i = 0; i < values->size(); ++i)
     if ((*values)[ i ] > v)
       break;
index 5a1b4e660207531355afd48ffcafba495689d1e8..6bebdce5f3885c236b5d65da968f69e42c17193c 100644 (file)
@@ -485,6 +485,7 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate)
     /*    float aPos = myCutLines->GetBasePlanePosition();
     myBasePlanePos->setText( QString::number(aPos) );
     myBasePlanePos->setEnabled(false);*/
+    myCutLines->SetDisplacement(myPosSpn->value());
     SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
     if (aView) {
       if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
index 5bbe4c8914a3f7723561830b3fa0660cf5d59f93..9a87d98c71a3eb77e1185ba9220d10717d63e8b8 100644 (file)
@@ -78,7 +78,7 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule)
 
   ScalFact = new QtxDblSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
   ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  ScalFact->setPrecision(5);
+  ScalFact->setPrecision(38);
   ScalFact->setValue(0.1);
   TopGroupLayout->addWidget(ScalFact, 0, 1);
 
index 0fcffa5227d75633c8eec9376ba11aee200501f5..f4847b68f30b66d7edda2afaf9c6cf78f5f2d3e4 100644 (file)
@@ -93,7 +93,7 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome
 
   ScalFact = new QtxDblSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
   ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-  ScalFact->setPrecision(5);
+  ScalFact->setPrecision(38);
   ScalFact->setValue(0.1);
   TopGroupLayout->addWidget(ScalFact, 0, 1);
 
@@ -311,7 +311,8 @@ int VisuGUI_ScalarMapOnDeformedShapeDlg::storeToPrsObject
   else
     thePrs->SetScalarField(myPrs->GetScalarMeshName().c_str(),
                           getCurrentScalarFieldName().latin1(),
-                          myTimeStampsCombo->currentItem() + 1,
+                          // PAL12928 myTimeStampsCombo->currentItem() + 1,
+                           myTimeStampID[ myTimeStampsCombo->currentItem() ],
                           myPrs->GetScalarEntity());
 
   if (theUpdateScalars) SetScalarField( false );
@@ -350,7 +351,8 @@ VISU::TEntity VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarEntity(){
 }
 
 void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField( const bool save_scalar_pane ){
-  SetScalarField( myTimeStampsCombo->currentItem()+1, "", save_scalar_pane );
+  // PAL12928 SetScalarField( myTimeStampsCombo->currentItem()+1, "", save_scalar_pane );
+  SetScalarField( myTimeStampID[ myTimeStampsCombo->currentItem() ], "", save_scalar_pane );
 }
 
 void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField(int theIter,QString theFieldName, const bool save_scalar_pane ){
@@ -431,9 +433,13 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllTimes(const QString& theFieldNam
       QString aFieldName = aIterField->first.first;
       if(theFieldName != aFieldName) continue;
       myTimeStampsCombo->clear();
+      myTimeStampID.clear();
+      myTimeStampID.reserve( (aIterField->second).size() );
       TTL::const_iterator aTimeIter = (aIterField->second).begin();
-      for(;aTimeIter != (aIterField->second).end(); aTimeIter++)
+      for(;aTimeIter != (aIterField->second).end(); aTimeIter++) {
        myTimeStampsCombo->insertItem(QString("%1").arg(aTimeIter->second));
+        myTimeStampID.push_back(aTimeIter->first);
+      }
       return;
     }
   }
index 3151bd934c0a93859c38bb09e140c8ef9788f9a7..694c2c55d762d63dbbabd18d95436c377fae5173 100644 (file)
@@ -39,6 +39,7 @@
 #include <qpushbutton.h>
 
 #include <set>
+#include <vector>
 
 class SalomeApp_Module;
 class QComboBox;
@@ -98,6 +99,7 @@ private:
  QString myCurrMeshName;
  int myCurrScalarIter;
  bool myIsAnimation;
+ std::vector<int> myTimeStampID;
  
  _PTR(SObject) mySelectionObj;
  VISU::ScalarMapOnDeformedShape_i* myPrs;
index 18a4ce073e19694f4b2da0fc686f481269d77532..5b9924370b97016e9894300250498fe086f8024f 100644 (file)
@@ -1072,7 +1072,6 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
          false, 
          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
   myModule(theModule),
-  myStudy(theStudy),
   mySetupDlg(NULL)
 {
   if ( theMode == 0 )
@@ -1080,8 +1079,6 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
   else if ( theMode == 1 )
     setCaption(tr("SUCCESSIVE_ANIMATION"));
   setSizeGripEnabled( TRUE );
-  isClosing = false;
-  myCloseBtnClicked = false;
 
   myAnimator = new VISU_TimeAnimation (theStudy);
   myAnimator->setViewer(VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule));
@@ -1297,7 +1294,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
   aBtnLayout->addStretch();
 
   QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox);
-  connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
+  connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
 
   QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox);
   connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
@@ -1316,7 +1313,7 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu
 //------------------------------------------------------------------------
 VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg()
 {
-  if(myAnimator != NULL){
+  if (myAnimator != NULL) {
     delete myAnimator;
     myAnimator = NULL;
     if ( VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule) )
@@ -1437,35 +1434,16 @@ void VisuGUI_TimeAnimationDlg::showEvent(QShowEvent* theEvent)
   mySetupDlg = new SetupDlg(this,myModule, myAnimator);
 }
 
-void VisuGUI_TimeAnimationDlg::reject()
-{
-  close();
-  QDialog::reject();
-}
-
-void VisuGUI_TimeAnimationDlg::onClose()
-{
-  myCloseBtnClicked = true;
-  close();
-}
-
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent)
 {
-  if(myAnimator != NULL){
+  if (myAnimator != NULL) {
     myAnimator->stopAnimation();
     myAnimator->wait(500);
     if (myAnimator->running() && (! myAnimator->finished())) {
-      isClosing = true;
-      myEvent = theEvent;
-      //        * Destroing data in myAnimator before study closed.
-      //        * It needed for correcting destroing of myAnimator, which 
-      //        * depend from SVTK_RenderWindowInteractor() e.t.c.
-      if(theEvent->type() == QEvent::Close && !myCloseBtnClicked){
-       for (int i = 0; (myAnimator != NULL) && (i < myAnimator->getNbFields()); i++)
-         myAnimator->clearData(myAnimator->getFieldData(i));
-       myAnimator->clearFieldData();
-      }
+      theEvent->ignore();
+      QCloseEvent* aNewCloseEvent = new QCloseEvent;
+      QApplication::postEvent( this, aNewCloseEvent );
     } else {
       QDialog::closeEvent(theEvent);
     }
@@ -1595,14 +1573,10 @@ void VisuGUI_TimeAnimationDlg::onCheckDump(bool)
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::onStop()
 {
-  if (isClosing) {
-    QDialog::closeEvent(myEvent);
-  } else {
-    myPlayBtn->setOn(false);
-    myPlayBtn->setIconSet(MYplayPixmap);
-    mySetupBtn->setEnabled(true);
-    myGenBtn->setEnabled(true);
-  }
+  myPlayBtn->setOn(false);
+  myPlayBtn->setIconSet(MYplayPixmap);
+  mySetupBtn->setEnabled(true);
+  myGenBtn->setEnabled(true);
 }
 
 //------------------------------------------------------------------------
@@ -1676,4 +1650,3 @@ void VisuGUI_TimeAnimationDlg::keyPressEvent( QKeyEvent* e )
       onHelp();
     }
 }
-
index 9b18330d3df55d7872ad4766bc671746a846463b..4aee58e0595c485b4b7381ea6c68f5879cdb12b9 100644 (file)
@@ -155,7 +155,6 @@ class VisuGUI_TimeAnimationDlg: public QDialog
     virtual void closeEvent(QCloseEvent* theEvent);
     virtual void showEvent(QShowEvent* theEvent);
     virtual void keyPressEvent(QKeyEvent* theEvent);
-    virtual void reject();
     void stopAnimation();
     
  private slots:
@@ -181,9 +180,13 @@ class VisuGUI_TimeAnimationDlg: public QDialog
    void onPicsFormatChanged();
    /*!Sets path for myAnimator (dumpTo(...)), from myPathEdit.*/
    void onPathChanged();
-   void onClose();
 
  private:
+    // Data
+    VisuGUI* myModule;
+    VISU_TimeAnimation* myAnimator;
+
+    // widgets
     QSlider* mySlider;
     QComboBox* myTypeCombo;
     QPushButton* myPropBtn;
@@ -194,16 +197,10 @@ class VisuGUI_TimeAnimationDlg: public QDialog
 
     QFrame* myPlayFrame;
     SetupDlg* mySetupDlg;
-    _PTR(Study) myStudy;
-    VisuGUI* myModule;
 
-    VISU_TimeAnimation* myAnimator;
     QCheckBox* mySaveCheck;
     QComboBox* myPicsFormat;
     QLineEdit* myPathEdit;
-    bool isClosing;
-    bool myCloseBtnClicked;
-    QCloseEvent* myEvent;
 
     QCheckBox*   mySaveAVICheck;
     QLineEdit*   myPathAVIEdit;
index 08657c70532f9a2bd21659394b75e7ceb390b24c..309473f11ab124f00bfcf67aa93ca3a4597eb0ff 100644 (file)
@@ -199,7 +199,22 @@ void
 VISU::ColoredPrs3d_i
 ::SetNbColors(CORBA::Long theNbColors)
 {
-  myScalarMapPL->SetNbColors(theNbColors);
+  struct TEvent: public SALOME_Event {
+    VISU_ScalarMapPL* myMap;
+    int myNbColors;
+    TEvent( VISU_ScalarMapPL* theMap, int theNbColors)
+      :myMap(theMap), myNbColors(theNbColors)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myMap->SetNbColors(myNbColors);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myScalarMapPL, theNbColors));
 }
 
 CORBA::Long 
index 0713b49674d08d6150a01c641c42bd741c474244..95720303285656c792c3ef588d8592355f4a8364 100644 (file)
@@ -33,6 +33,9 @@
 
 #include <boost/tuple/tuple.hpp>
 
+#include "ReceiverFactory.hxx"
+#include "MED_SliceArray.hxx"
+
 using namespace std;
 using namespace VISU;
 
@@ -62,7 +65,7 @@ namespace
 {
   using namespace SALOME_MED;
   
-  const int MED_NBR_GEOMETRIE_MAILLE = 15;
+  const int MED_NBR_GEOMETRIE_MAILLE = 17;
   
   medGeometryElement 
   CELLGEOM[MED_NBR_GEOMETRIE_MAILLE] = {
@@ -80,17 +83,20 @@ namespace
     MED_TETRA10,
     MED_PYRA13,
     MED_PENTA15,
-    MED_HEXA20
+    MED_HEXA20,
+    MED_POLYGON,
+    MED_POLYHEDRA
   };
   
-  const int MED_NBR_GEOMETRIE_FACE = 4;
+  const int MED_NBR_GEOMETRIE_FACE = 5;
   
   medGeometryElement
   FACEGEOM[MED_NBR_GEOMETRIE_FACE] = {
     MED_TRIA3,
     MED_QUAD4,
     MED_TRIA6,
-    MED_QUAD8
+    MED_QUAD8,
+    MED_POLYGON
   };
   
   const int MED_NBR_GEOMETRIE_ARETE = 2;
@@ -169,6 +175,8 @@ namespace
     case MED_PENTA15: return VISU::ePENTA15;
     case MED_PYRA5: return VISU::ePYRA5;
     case MED_PYRA13: return VISU::ePYRA13;
+    case MED_POLYGON: return VISU::ePOLYGONE;
+    case MED_POLYHEDRA: return VISU::ePOLYEDRE;
     }
     return VISU::eNONE;
   }
@@ -194,6 +202,8 @@ namespace
     case VISU::eHEXA20: return MED_HEXA20;
     case VISU::ePENTA15: return MED_PENTA15;
     case VISU::ePYRA13: return MED_PYRA13;
+    case VISU::ePOLYGONE: return MED_POLYGON;
+    case VISU::ePOLYEDRE: return  MED_POLYHEDRA;
     }
     return medGeometryElement(-1);
   }
@@ -211,6 +221,7 @@ namespace
     case VTK_HEXAHEDRON: return MED_HEXA8;
     case VTK_WEDGE: return MED_PENTA6;
     case VTK_PYRAMID: return MED_PYRA5;
+    case VTK_POLYGON: return MED_POLYGON;
     }
     return medGeometryElement(-1);
   }
@@ -263,17 +274,16 @@ namespace
               SALOME_MED::MESH_ptr theMEDMesh,
               const VISU::TEntity& theVEntity)
   {
-    medGeometryElement* aGeomElems;
     theNbCells = theCellsSize = 0;
-    int iGeomEnd = GetEntity2Geom(theVEntity,aGeomElems);
-    const medEntityMesh& aMEntity = VTKEntityToMED(theVEntity);
     if(MYDEBUG) MESSAGE("GetCellsSize - theVEntity = "<<theVEntity);
+    const medEntityMesh& aMEntity = VTKEntityToMED(theVEntity);
+    SALOME_MED::MESH::connectivityInfos_var connInfo=theMEDMesh->getConnectGlobal(aMEntity);
+    int iGeomEnd = connInfo->meshTypes.length();
     for(int iGeom = 0; iGeom < iGeomEnd; iGeom++){
-      medGeometryElement aMEDGeom = aGeomElems[iGeom];
-      int iNumElemEnd = theMEDMesh->getNumberOfElements(aMEntity,aMEDGeom);
+      int iNumElemEnd = connInfo->numberOfElements[iGeom];
       if(iNumElemEnd > 0){
        if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
-       theCellsSize += iNumElemEnd*(MEDGeom2NbNodes(aMEDGeom) + 1);
+       theCellsSize += iNumElemEnd + connInfo->nodalConnectivityLength[iGeom];
        theNbCells += iNumElemEnd;
       }
     }
@@ -286,18 +296,16 @@ namespace
               vtkIdType& theCellsSize,
               SALOME_MED::FAMILY_ptr theMEDFamily)
   {
-    medGeometryElement_array_var aGeom = theMEDFamily->getTypes();
-    int iGeomEnd = aGeom->length();
     theNbCells = theCellsSize = 0;
+    SALOME_MED::SUPPORT::supportInfos_var suppInfo=theMEDFamily->getSupportGlobal();
+    int iGeomEnd = suppInfo->types.length();
     if(MYDEBUG) MESSAGE("GetCellsSize - iGeomEnd = "<<iGeomEnd);
     for(int iGeom = 0; iGeom < iGeomEnd; iGeom++) {
-      medGeometryElement aMEDGeom = aGeom[iGeom];
-      long_array_var aCellNumForType = theMEDFamily->getNumber(aMEDGeom);
-      int iNumElemEnd = aCellNumForType->length();
+      int iNumElemEnd = suppInfo->nbEltTypes[iGeom];
       if(iNumElemEnd > 0){
        if(MYDEBUG) MESSAGE("GetCellsSize - iNumElemEnd = "<<iNumElemEnd);
        theNbCells += iNumElemEnd;
-       theCellsSize += iNumElemEnd*(MEDGeom2NbNodes(aMEDGeom) + 1);
+       theCellsSize += iNumElemEnd + suppInfo->nodalConnectivityLength[iGeom];
       }
     }
   }
@@ -1295,6 +1303,76 @@ VISU_MEDConvertor
 }
 
 
+//---------------------------------------------------------------
+namespace {
+
+  using namespace MED;
+
+  typedef vector< int >         TCIntArray;
+  typedef TCSlice< TCIntArray > TConnSlice;
+  //---------------------------------------------------------------
+  class MEDPolygonConnectivity { //! retriver of polygon connectivity
+    TCIntArray myConn, myConnIndex;
+  public:
+    MEDPolygonConnectivity(SALOME_MED::MESH_var      theMesh,
+                           SALOME_MED::medEntityMesh theEntity) {
+      SALOME::SenderInt_var connSender, connIndexSender;
+      connSender      = theMesh->getSenderForPolygonsConnectivity (MED_NODAL, theEntity);
+      connIndexSender = theMesh->getSenderForPolygonsConnectivityIndex (MED_NODAL, theEntity);
+      long connSize, connIndexSize;
+      int* conn  = ReceiverFactory::getValue(connSender,connSize);
+      int* index = ReceiverFactory::getValue(connIndexSender,connIndexSize);
+      myConn.assign( conn, & conn[connSize] );
+      myConnIndex.assign( index, &index[connIndexSize] );
+      // should we delete arrays got via ReceiverFactory? nobody knows
+    }
+    TConnSlice GetConn(int theId) const {
+      int offset = myConnIndex[ theId ] - 1;
+      int size = myConnIndex[ theId + 1 ] - myConnIndex[ theId ];
+      return TConnSlice(myConn,std::slice(offset,size,1));
+    }
+    int GetNbElem() const {
+      return myConnIndex.size() - 1;
+    }
+    int GetCellSize() const {
+      return myConn.size() + GetNbElem();
+    }
+  };
+  //---------------------------------------------------------------
+  class MEDPolyhedraConnectivity {//! retriver of polyhedron connectivity
+    TCIntArray myConn, myConnIndex, myFaceIndex;
+  public:
+    MEDPolyhedraConnectivity(SALOME_MED::MESH_var theMesh) {
+      SALOME::SenderInt_var connSender, connIndexSender, faceIndexSender;
+      connSender      = theMesh->getSenderForPolyhedronConnectivity (MED_NODAL);
+      connIndexSender = theMesh->getSenderForPolyhedronIndex (MED_NODAL);
+      faceIndexSender = theMesh->getSenderForPolyhedronFacesIndex ();
+      long connSize, connIndexSize, facesSize;
+      int* conn  = ReceiverFactory::getValue(connSender,connSize);
+      int* index = ReceiverFactory::getValue(connIndexSender,connIndexSize);
+      int* faces = ReceiverFactory::getValue(faceIndexSender,facesSize);
+      myConn.assign( conn, & conn[connSize] );
+      myConnIndex.assign( index, &index[connIndexSize] );
+      myFaceIndex.assign( faces, &faces[facesSize] );
+      // should we delete arrays got via ReceiverFactory? nobody knows
+    }
+    int GetUniqueConn(int id, std::set<int>& connSet) const {
+      connSet.clear();
+      int f1 = myConnIndex[ id ]-1, f2 = myConnIndex[ id+1 ]-2;
+      int i1 = myFaceIndex[ f1 ]-1, i2 = myFaceIndex[ f2+1 ]-1;
+      for ( int i = i1; i < i2; ++i )
+        connSet.insert( myConn[ i ]);
+      return connSet.size();
+    }
+    int GetNbElem() const {
+      return myConnIndex.size() - 1;
+    }
+    int GetCellSize() const {
+      return myConn.size();//???? + GetNbElem();
+    }
+  };
+}
+
 //---------------------------------------------------------------
 int 
 VISU_MEDConvertor
@@ -1308,115 +1386,192 @@ VISU_MEDConvertor
   SALOME_MED::MESH_var aMedMesh = aMedSupport->getMesh();
 
   //Main part of code
-  SALOME_MED::medGeometryElement* aGeomElems;
   const TEntity& aVEntity = theMeshOnEntity->myEntity;
-  int iGeomEnd = GetEntity2Geom(aVEntity,aGeomElems);
   const SALOME_MED::medEntityMesh& aMEntity = VTKEntityToMED(aVEntity);
+  SALOME_MED::MESH::connectivityInfos_var connInfo;
+  try {
+    connInfo= aMedMesh->getConnectGlobal(aMEntity);
+  }
+  catch (const std::exception & ex) {
+    return 0;
+  }
+  int iGeomEnd = connInfo->meshTypes.length();
   const TNamedPointCoords& aCoords = theMesh->myNamedPointCoords;
   TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh;
   int aNbPoints = aCoords.GetNbPoints();
 
-  for(int iGeom = 0, aCounter = 0; iGeom < iGeomEnd; iGeom++){
-    SALOME_MED::medGeometryElement aMGeom = aGeomElems[iGeom];
-    int aMNbNodes = MEDGeom2NbNodes(aMGeom);
+  for(int iGeom = 0, aCounter = 0; iGeom < iGeomEnd; iGeom++) {
+    SALOME_MED::medGeometryElement aMGeom = connInfo->meshTypes[iGeom];
     VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom);
-    int aVNbNodes = VISUGeom2NbNodes(aEGeom);
-    int aNbElem = aMedMesh->getNumberOfElements(aMEntity,aMGeom);
-    if (aNbElem > 0) {
-      using namespace SALOME_MED;
-      SALOME_MED::long_array_var conn = 
-       aMedMesh->getConnectivity(MED_FULL_INTERLACE,MED_NODAL,aMEntity,aMGeom);
-      PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new TCSubMesh());
-
-      aSubMesh->myNbCells = aNbElem;      
-      aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
-
-      TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
-      std::vector<int> aConnect(aMNbNodes);
-      int aNbConnForElem = conn->length()/aNbElem;
-
-      if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aMGeom = "<<aMGeom<<
-                         "; aNbElem = "<<aNbElem<<
-                         "; aMNbNodes = "<<aMNbNodes<<
-                         "; aVNbNodes = "<<aVNbNodes<<
-                         "; aNbConnForElem = "<<aNbConnForElem);
-
-      for(int iElem = 0; iElem < aNbElem; iElem++){
-       VISU::TConnect anArray(aVNbNodes);
-       for(int k = 0, kj = iElem*aNbConnForElem; k < aMNbNodes; k++)
-         aConnect[k] = conn[kj+k] - 1;
-
-       switch(aMGeom){
+    int aNbElem = connInfo->numberOfElements[ iGeom ];
+    switch (aMGeom) {
+    case SALOME_MED::MED_POLYGON:
+    {
+      MEDPolygonConnectivity conn(aMedMesh, aMEntity);
+      aNbElem = conn.GetNbElem();
+      if (aNbElem) {
+        PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new TCSubMesh());
+        aSubMesh->myNbCells   = aNbElem;
+        aSubMesh->myCellsSize = conn.GetCellSize();
+
+        TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+        aCell2Connect.resize(aNbElem);
+
+        for(int iElem = 0; iElem < aNbElem; iElem++) {
+          TConnSlice aConnSlice = conn.GetConn(iElem);
+          TConnect& anArray = aCell2Connect[iElem];
+          anArray.resize(aConnSlice.size());
+          for(int iConn = 0; iConn < aConnSlice.size(); iConn++)
+            anArray[iConn] = aConnSlice[iConn] - 1;
+        }
+      }
+    }
+    break;
+    case SALOME_MED::MED_POLYHEDRA:
+    {
+      MEDPolyhedraConnectivity conn( aMedMesh );
+      aNbElem = conn.GetNbElem();
+      if (aNbElem) {
+        PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new TCSubMesh());
+        aSubMesh->myNbCells   = aNbElem;
+        aSubMesh->myCellsSize = conn.GetCellSize();
+
+        TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+        aCell2Connect.resize(aNbElem);
+
+        std::set< int > aConnectSet;
+        for(int iElem = 0; iElem < aNbElem; iElem++) {
+          if ( conn.GetUniqueConn( iElem, aConnectSet )) {
+            int aNbConn = aConnectSet.size();
+            TConnect& anArray = aCell2Connect[iElem];
+            anArray.resize(aNbConn);
+            std::set<int>::iterator anIter = aConnectSet.begin();
+            for(int i = 0; anIter != aConnectSet.end(); anIter++, i++)
+              anArray[i] = *anIter - 1;
+          }
+        }
+      }
+    }
+    break;
+    default:
+    {        
+      int aMNbNodes = MEDGeom2NbNodes(aMGeom);
+      int aVNbNodes = VISUGeom2NbNodes(aEGeom);
+      if (aNbElem > 0) {
+        using namespace SALOME_MED;
+        SALOME_MED::long_array_var conn = 
+          aMedMesh->getConnectivity(MED_FULL_INTERLACE,MED_NODAL,aMEntity,aMGeom);
+        PSubMeshImpl aSubMesh = aGeom2SubMesh[aEGeom](new TCSubMesh());
+
+        aSubMesh->myNbCells = aNbElem;
+        aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1);
+
+        TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+        std::vector<int> aConnect(aMNbNodes);
+        int aNbConnForElem = conn->length()/aNbElem;
+
+        if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aMGeom = "<<aMGeom<<
+                            "; aNbElem = "<<aNbElem<<
+                            "; aMNbNodes = "<<aMNbNodes<<
+                            "; aVNbNodes = "<<aVNbNodes<<
+                            "; aNbConnForElem = "<<aNbConnForElem);
+
+        for(int iElem = 0; iElem < aNbElem; iElem++) {
+          VISU::TConnect anArray(aVNbNodes);
+          for(int k = 0, kj = iElem*aNbConnForElem; k < aMNbNodes; k++)
+            aConnect[k] = conn[kj+k] - 1;
+
+          switch(aMGeom){
 #if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
-       case SALOME_MED::MED_SEG3:
-         anArray[0] = aConnect[0];
-         anArray[2] = aConnect[1];  
-         
-         anArray[1] = aConnect[2];
-         break;
+          case SALOME_MED::MED_SEG3:
+            anArray[0] = aConnect[0];
+            anArray[2] = aConnect[1];  
+
+            anArray[1] = aConnect[2];
+            break;
 #endif
 #if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
-       case SALOME_MED::MED_TRIA6:
-         anArray[0] = aConnect[0];
-         anArray[2] = aConnect[1];  
-         anArray[4] = aConnect[2];  
-         
-         anArray[1] = aConnect[3];
-         anArray[3] = aConnect[4];  
-         anArray[5] = aConnect[5];  
-         break;
+          case SALOME_MED::MED_TRIA6:
+            anArray[0] = aConnect[0];
+            anArray[2] = aConnect[1];  
+            anArray[4] = aConnect[2];  
+
+            anArray[1] = aConnect[3];
+            anArray[3] = aConnect[4];  
+            anArray[5] = aConnect[5];  
+            break;
 #endif
 #if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
-       case SALOME_MED::MED_QUAD8:
-         anArray[0] = aConnect[0];
-         anArray[2] = aConnect[1];  
-         anArray[4] = aConnect[2];  
-         anArray[6] = aConnect[3];  
-         
-         anArray[1] = aConnect[4];
-         anArray[3] = aConnect[5];  
-         anArray[5] = aConnect[6];  
-         anArray[7] = aConnect[7];  
-         break;
+          case SALOME_MED::MED_QUAD8:
+            anArray[0] = aConnect[0];
+            anArray[2] = aConnect[1];  
+            anArray[4] = aConnect[2];  
+            anArray[6] = aConnect[3];  
+
+            anArray[1] = aConnect[4];
+            anArray[3] = aConnect[5];  
+            anArray[5] = aConnect[6];  
+            anArray[7] = aConnect[7];  
+            break;
 #endif
 #if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
-       case SALOME_MED::MED_TETRA10 :
+          case SALOME_MED::MED_TETRA10 :
 #endif
-       case SALOME_MED::MED_TETRA4 :
-         anArray[0] = aConnect[0];
-         anArray[1] = aConnect[1];
-         anArray[2] = aConnect[3];  
-         anArray[3] = aConnect[2];  
-         break;
+          case SALOME_MED::MED_TETRA4 :
+            anArray[0] = aConnect[0];
+            anArray[1] = aConnect[1];
+            anArray[2] = aConnect[3];  
+            anArray[3] = aConnect[2];  
+            break;
 #if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
-       case SALOME_MED::MED_PYRA13:
+          case SALOME_MED::MED_PYRA13:
 #endif
-       case SALOME_MED::MED_PYRA5 :
-         anArray[0] = aConnect[0];
-         anArray[1] = aConnect[3];  
-         anArray[2] = aConnect[2];
-         anArray[3] = aConnect[1];  
-         anArray[4] = aConnect[4];
-         break;
-       default:
-         for (int k = 0; k < aVNbNodes; k++) 
-           anArray[k] = aConnect[k];
-       }
-       for (int k = 0; k < aVNbNodes; k++) 
-         if(anArray[k] < 0 || aNbPoints <= anArray[k]){
-           static QString aString;
-           aString.sprintf("LoadCellsOnEntity >> aNbPoints(%d) <= anArray[%d][%d]=%d < 0 !!!",aNbPoints,iElem,k,anArray[k]);
-           throw std::runtime_error(aString.latin1());
-         }
-       aCell2Connect.push_back(anArray);
+          case SALOME_MED::MED_PYRA5 :
+            anArray[0] = aConnect[0];
+            anArray[1] = aConnect[3];  
+            anArray[2] = aConnect[2];
+            anArray[3] = aConnect[1];  
+            anArray[4] = aConnect[4];
+            break;
+          default:
+            for (int k = 0; k < aVNbNodes; k++) 
+              anArray[k] = aConnect[k];
+          }
+          for (int k = 0; k < aVNbNodes; k++) 
+            if(anArray[k] < 0 || aNbPoints <= anArray[k]){
+              static QString aString;
+              aString.sprintf("LoadCellsOnEntity >> aNbPoints(%d) <= anArray[%d][%d]=%d < 0 !!!",aNbPoints,iElem,k,anArray[k]);
+              throw std::runtime_error(aString.latin1());
+            }
+          aCell2Connect.push_back(anArray);
+        } // loop on elements
       }
-      //Workaround for MED Component data structure
-      int aSize = aCell2Connect.size();
-      if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aCounter = "<<aCounter<<"; aSize = "<<aSize<<"; aMGeom = "<<aMGeom);
-      theMeshOnEntity->myCellsFirstIndex[aMGeom] = TIndexAndSize(aCounter,aSize);
-      aCounter += aSize;
-    }
-  }
+    }} // switch( aMGeom )
+    //Workaround for MED Component data structure
+    int aSize = aNbElem; //aCell2Connect.size();
+    if(MYDEBUG) MESSAGE("LoadCellsOnEntity - aCounter = "<<aCounter<<"; aSize = "<<aSize<<"; aMGeom = "<<aMGeom);
+    theMeshOnEntity->myCellsFirstIndex[aMGeom] = TIndexAndSize(aCounter,aSize);
+    aCounter += aSize;
+  } //loop on types
+
+  // Dump result connectivity
+// #ifdef _DEBUG_
+//   TGeom2SubMesh::iterator geom_sm = aGeom2SubMesh.begin();
+//   for ( ; geom_sm!=aGeom2SubMesh.end(); ++geom_sm ) {
+//     cout << "TYPE: " << geom_sm->first << endl;
+//     PSubMeshImpl aSubMesh = geom_sm->second;
+//     TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect;
+//     TCell2Connect::iterator id_conn = aCell2Connect.begin();
+//     for ( int i = 0; id_conn !=aCell2Connect.end(); ++id_conn ) {
+//       cout << "\t" << i++ << ": [";
+//       TConnect& anArray = *id_conn;
+//       TConnect::iterator n = anArray.begin();
+//       for ( ; n != anArray.end(); ++n )
+//         cout << " " << *n + 1;
+//       cout << " ]"<< endl;
+//     }
+//   }
+// #endif
 
   theMeshOnEntity->myIsDone = true;
 
index f5a6e243ff260b667c6097289fbf5a5b4d98fbea..fd51691bb605505a81c340eb9235370f72e130c4 100644 (file)
@@ -33,6 +33,7 @@
 #include "VISU_PipeLineUtils.hxx"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 #include <vtkAppendPolyData.h>
 
@@ -192,14 +193,52 @@ VISU::CutLines_i::~CutLines_i(){
 void VISU::CutLines_i::SetOrientation(VISU::CutPlanes::Orientation theOrient,
                                      CORBA::Double theXAngle, CORBA::Double theYAngle)
 {
-  myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                              theXAngle,theYAngle);
+
+  struct TEvent: public SALOME_Event {
+    VISU_CutLinesPL* myCutLinesPL;
+    CORBA::Double myXAngle, myYAngle;
+    VISU::CutPlanes::Orientation myOrient;
+    TEvent( VISU_CutLinesPL* theCutLines, VISU::CutPlanes::Orientation theOrient,
+           CORBA::Double theXAngle, CORBA::Double theYAngle)
+      :myCutLinesPL(theCutLines), myOrient(theOrient), myXAngle(theXAngle), myYAngle(theYAngle)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(myOrient),
+                                 myXAngle, myYAngle);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myCutLinesPL, theOrient, theXAngle, theYAngle));
+
 }
+
 void VISU::CutLines_i::SetOrientation2(VISU::CutPlanes::Orientation theOrient,
                                       CORBA::Double theXAngle, CORBA::Double theYAngle)
 {
-  myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                              theXAngle,theYAngle,1);
+  struct TEvent: public SALOME_Event {
+    VISU_CutLinesPL* myCutLinesPL;
+    CORBA::Double myXAngle, myYAngle;
+    VISU::CutPlanes::Orientation myOrient;
+    TEvent( VISU_CutLinesPL* theCutLines, VISU::CutPlanes::Orientation theOrient,
+           CORBA::Double theXAngle, CORBA::Double theYAngle)
+      :myCutLinesPL(theCutLines), myOrient(theOrient), myXAngle(theXAngle), myYAngle(theYAngle)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(myOrient),
+                                 myXAngle, myYAngle, 1);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myCutLinesPL, theOrient, theXAngle, theYAngle));
+
 }
 
 VISU::CutPlanes::Orientation VISU::CutLines_i::GetOrientationType() { 
index 300957a4af4078151c6c5a8e688ea9421af44737..a23d15bfc6da15a6dcfb7fd6cbf4a27d5ce953e2 100644 (file)
@@ -30,6 +30,7 @@
 #include "VISU_Actor.h"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 using namespace VISU;
 using namespace std;
@@ -133,8 +134,25 @@ VISU::CutPlanes_i::~CutPlanes_i(){
 void VISU::CutPlanes_i::SetOrientation(VISU::CutPlanes::Orientation theOrient,
                                       CORBA::Double theXAngle, CORBA::Double theYAngle)
 {
-  myCutPlanesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                               theXAngle,theYAngle);
+  struct TEvent: public SALOME_Event {
+    VISU_CutPlanesPL* myCutPlanes;
+    CORBA::Double myXAngle, myYAngle;
+    VISU::CutPlanes::Orientation myOrient;
+    TEvent( VISU_CutPlanesPL* theCutPlanes, VISU::CutPlanes::Orientation theOrient,
+           CORBA::Double theXAngle, CORBA::Double theYAngle)
+      :myCutPlanes(theCutPlanes), myOrient(theOrient), myXAngle(theXAngle), myYAngle(theYAngle)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myCutPlanes->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(myOrient),
+                                 myXAngle, myYAngle);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myCutPlanesPL, theOrient, theXAngle, theYAngle));
 }
 
 VISU::CutPlanes::Orientation VISU::CutPlanes_i::GetOrientationType() { 
@@ -173,8 +191,25 @@ CORBA::Boolean VISU::CutPlanes_i::IsDefault(CORBA::Long thePlaneNumber){
 
 
 void VISU::CutPlanes_i::SetNbPlanes(CORBA::Long theNb) { 
-  myCutPlanesPL->SetNbParts(theNb);
+
+  struct TEvent: public SALOME_Event {
+    VISU_CutPlanesPL* myCutPlanes;
+    CORBA::Long myNbPlanes;
+    TEvent( VISU_CutPlanesPL* theCutPlanes, int theNbPlanes)
+      :myCutPlanes(theCutPlanes), myNbPlanes(theNbPlanes)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myCutPlanes->SetNbParts(myNbPlanes);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myCutPlanesPL, theNb));
 }
+
 CORBA::Long VISU::CutPlanes_i::GetNbPlanes() { 
   return myCutPlanesPL->GetNbParts();
 }
index eea7502853829d3e4c6c65aa5c0b671b2220112a..dacdb69dfb1e2907de1c2283d4cf31ebc749e2be 100644 (file)
@@ -106,6 +106,10 @@ void VISU::DeformedShape_i::SameAs(const Prs3d_i* theOrigin)
   }
 }
 
+void VISU::DeformedShape_i::Update()
+{
+  TSuperClass::Update();
+}
 
 VISU::Storable* VISU::DeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity, 
                                              const char* theFieldName, int theIteration)
index e27a0e8b0c10e849f122e7f613bca55609cc25e4..e8120ae0d9c56b4fd74f7bd2e8ee892f38ad6bfe 100644 (file)
@@ -64,6 +64,8 @@ namespace VISU{
     typedef VISU::DeformedShape TInterface;
     VISU_DeformedShapePL* GetDeformedShapePL(){ return myDeformedShapePL;}
 
+    virtual void Update();
+
   protected:
     virtual void DoHook();
     
index 64ac9f50f372946a86cb9c3d430adb669401e3b1..9b5af88c38a9e0c695034d81e513d6c696443f9d 100644 (file)
@@ -340,6 +340,7 @@ namespace VISU
     theStr<<thePrefix<<"if "<<aSObjectName<<":"<<endl;
     thePrefix += PREFIX;
 
+    theStr<<thePrefix<<"aBuilder.SetName("<<aSObjectName<<", \""<<theSObject->GetName()<<"\")"<<endl; // Fix for IPAL13165
     std::string aName = "aTableAttr";
     theStr<<thePrefix<<aName<<" = aBuilder.FindOrCreateAttribute("<<
       aSObjectName<<",'"<<theAttrName<<"')"<<endl;
@@ -1310,6 +1311,92 @@ namespace VISU
     }
   }
 
+  //===========================================================================
+  void
+  DumpAnimationsToPython(SALOMEDS::Study_ptr theStudy,
+                        CORBA::Boolean theIsPublished,
+                        CORBA::Boolean& theIsValidScript,
+                        SALOMEDS::SObject_ptr theSObject,
+                        std::ostream& theStr,
+                        std::string thePrefix)
+  {
+
+    if(!theIsPublished) return;
+
+    SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(theSObject);
+    for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
+      SALOMEDS::SObject_var aSObject = aChildItet->Value();
+          
+      SALOMEDS::GenericAttribute_var anAttr;
+      if (!aSObject->FindAttribute(anAttr, "AttributeString")) continue;
+      
+      SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+      QString value (aStringAttr->Value());
+      if(value.isEmpty()) continue;
+
+      VISU::Storable::TRestoringMap aMap;
+      VISU::Storable::StrToMap(value, aMap);
+      bool isExist;
+      
+      QString aTypeName = VISU::Storable::FindValue(aMap,"myComment",&isExist);
+      if(!isExist || aTypeName != "ANIMATION") continue;
+
+      //ANIMATION
+      theStr<<endl;
+      QString animName = aSObject->GetName();
+      theStr<<thePrefix<<"#Animation: "<<animName<<endl;
+      theStr<<endl;
+      theStr<<thePrefix<<"animSO = aBuilder.NewObject(aSComponent)"<<endl;
+      theStr<<thePrefix<<"aBuilder.SetName(animSO, '"<<animName<<"')"<< endl;
+      theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(animSO, 'AttributeString')"<< endl;
+      theStr<<thePrefix<<"strAttr.SetValue('"<<value<<"')"<< endl;
+
+
+    
+      SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator(aSObject);
+      for (anIter->Init(); anIter->More(); anIter->Next()) {
+       SALOMEDS::SObject_var anObj = anIter->Value();
+
+       //FIELD
+       theStr<<thePrefix<<"fieldSO = aBuilder.NewObject(animSO)"<<endl;
+       if (anObj->FindAttribute(anAttr, "AttributeString")) {
+         aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+         theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(fieldSO, 'AttributeString')"<< endl;
+         theStr<<thePrefix<<"strAttr.SetValue('"<<aStringAttr->Value()<<"')"<< endl;
+       }
+       
+       SALOMEDS::SObject_var refObj;
+       if(anObj->ReferencedObject(refObj)) {
+         SALOMEDS::SObject_var father = refObj->GetFather();
+         value = refObj->GetName();
+         QString path(theStudy->GetObjectPath(father));
+         //The following code requierd as a field name can contain '/' character
+         theStr<<thePrefix<<"aBuilder.Addreference(fieldSO,getSObjectByFatherPathAndName(theStudy,'"<<path<<"','"<<value<<"'))"<<endl;
+       }
+       value = anObj->GetName();
+       if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(fieldSO, '"<<value<<"')"<< endl;
+
+       //SCALARMAP,...
+       SALOMEDS::ChildIterator_var aSubIter = theStudy->NewChildIterator(anObj);
+       for (aSubIter->Init(); aSubIter->More(); aSubIter->Next()) {
+         SALOMEDS::SObject_var aSubObj = aSubIter->Value();
+         
+         theStr<<thePrefix<<"subSO = aBuilder.NewObject(fieldSO)"<<endl;
+         value = aSubObj->GetName();
+         if(!value.isEmpty()) theStr<<thePrefix<<"aBuilder.SetName(subSO, '"<<value<<"')"<< endl;
+         if (aSubObj->FindAttribute(anAttr, "AttributeString")) {
+           aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr);
+           theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(subSO, 'AttributeString')"<< endl;
+           theStr<<thePrefix<<"strAttr.SetValue('"<<aStringAttr->Value()<<"')"<< endl;
+         }
+       }
+
+      }
+      
+    }
+
+    theStr<<endl;
+  }
 
   //===========================================================================
   Engines::TMPFile*
@@ -1353,6 +1440,7 @@ namespace VISU
     SALOMEDS::SComponent_var aComponent = FindOrCreateVisuComponent(aStudy);
     VISU::DumpChildrenToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
     VISU::DumpContainersToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
+    VISU::DumpAnimationsToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aPrefix);
 
     //Output the script that sets up the visul parameters.
     if(theIsPublished) {
@@ -1364,6 +1452,26 @@ namespace VISU
     }
 
     aStr<<aPrefix<<"pass"<<endl;
+
+    if(theIsPublished) { //SRN: define function for Animation
+
+      //Define a function that find a SObject by its father's path and its name
+      aStr<<endl;
+      aStr<<endl;
+
+      aStr<<"def getSObjectByFatherPathAndName(theStudy, thePath, theName):"<<endl;
+      aStr<<aPrefix<<"father = theStudy.FindObjectByPath(thePath)"<<endl;
+      aStr<<aPrefix<<"itr = theStudy.NewChildIterator(father)"<<endl;
+      aStr<<aPrefix<<"while itr.More():"<<endl;
+      aStr<<aPrefix<<aPrefix<<"so = itr.Value()"<<endl;
+      aStr<<aPrefix<<aPrefix<<"if so.GetName()==theName: return so"<<endl;
+      aStr<<aPrefix<<aPrefix<<"itr.Next()"<<endl;
+      aStr<<aPrefix<<aPrefix<<"pass"<<endl;
+      aStr<<aPrefix<<"return None"<<endl;
+
+      aStr<<endl;
+    }
+
     // theIsValidScript currently is not used by internal dump methods (DumpChildrenToPython(), etc.)
     // If the situation changes, then the following line should be removed, and theIsValidScript
     // should be set properly by those internal methods
index ed1649272ca60d748ca7ab5865748687d6cab20f..3d53824468b174ea7fec46c6206711f1fd11a3f1 100644 (file)
@@ -627,7 +627,13 @@ namespace VISU
          if(!CORBA::is_nil(aMedEngine))
            {
              SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
-             aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine );
+             try {
+               aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine );
+             }
+             catch( const SALOME::SALOME_Exception& ) {
+               // Oops, something went wrong while loading
+               // See also SalomeApp_Study::openDataModel()
+             }
            }
        }
     } else {
@@ -963,17 +969,41 @@ namespace VISU
     return Prs3dOnField<VISU::CutLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
-  Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry){
+  struct CreateTableEvent: public SALOME_Event
+  {
+    SALOMEDS::Study_var myStudyDocument;
+    const char* myTableEntry;
+    typedef Table_ptr TResult;
+    TResult myResult;
+    
+    CreateTableEvent(const SALOMEDS::Study_var& theStudy, const char* theTableEntry)
+    {
+      myStudyDocument = theStudy;
+      myTableEntry = theTableEntry;
+      myResult = Table::_nil();
+    }
+    
+    virtual
+    void
+    Execute()
+    {
+      Table_i* pPresent = new Table_i(myStudyDocument,myTableEntry);
+      if(pPresent->Create() != NULL)
+       myResult = pPresent->_this();
+      else{
+       pPresent->_remove_ref();
+       myResult = VISU::Table::_nil();
+      }
+    }
+  };
+
+
+  Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry)
+  {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Table::_nil();
     Mutex mt(myMutex);
-    Table_i* pPresent = new Table_i(myStudyDocument,theTableEntry);
-    if(pPresent->Create() != NULL)
-      return pPresent->_this();
-    else{
-      pPresent->_remove_ref();
-      return VISU::Table::_nil();
-    }
+    return ProcessEvent(new CreateTableEvent(myStudyDocument, theTableEntry));
   }
 
   Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable,
index 03559ba3e75ea02604117a7e9b34e7375dd6abd0..0f8b392b75229e067cda2649e03c18d15292ca76 100644 (file)
@@ -30,6 +30,7 @@
 #include "VISU_Actor.h"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 using namespace VISU;
 using namespace std;
@@ -112,8 +113,25 @@ VISU::IsoSurfaces_i::~IsoSurfaces_i(){
 
 
 void VISU::IsoSurfaces_i::SetNbSurfaces(CORBA::Long theNb){
-  myIsoSurfacesPL->SetNbParts(theNb);
+
+  struct TEvent: public SALOME_Event {
+    VISU_IsoSurfacesPL* myIsoSurfacesPL;
+    CORBA::Long myNb;
+    TEvent( VISU_IsoSurfacesPL* theIsoSurfacesPL, int theNb)
+      :myIsoSurfacesPL(theIsoSurfacesPL), myNb(theNb)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myIsoSurfacesPL->SetNbParts(myNb);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myIsoSurfacesPL, theNb));
 }
+
 CORBA::Long VISU::IsoSurfaces_i::GetNbSurfaces(){
   return myIsoSurfacesPL->GetNbParts();
 }
index 7602c1035a42ad656b7b34e9e82185e96c9da6d4..c021c9d34f9c41f67e0035d12afffc6d19637d6b 100644 (file)
@@ -238,6 +238,11 @@ VISU::PrsMerger_i
   }
 }
 
+void VISU::PrsMerger_i::Update()
+{
+  TSuperClass::Update();
+}
+
 VISU_Actor* 
 VISU::PrsMerger_i
 ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking) 
@@ -538,11 +543,15 @@ VISU::PrsMerger_i
   if(!anIDMapper) return false;
   
   bool aAllPoints = true;
-  if(anIDMapper->GetVTKOutput()->GetNumberOfCells()>0){
+  int aNbCellsInGeom     = anIDMapper->GetVTKOutput()->GetNumberOfCells();
+  if(aNbCellsInGeom>0){
     int aVtkCellType = anIDMapper->GetVTKOutput()->GetCellType(0);
     if (MYDEBUG) MESSAGE("CellType="<<aVtkCellType);
     switch(myEntity){
     case NODE_ENTITY:
+      // Warning. May be unstable. Created for NPAL15200
+      aAllPoints = false;
+      break;
     case CELL_ENTITY:
       if(aVtkCellType != VTK_LINE &&
         aVtkCellType != VTK_POLY_LINE && 
index 9adca83fd8b617458d5a5c0a351803b5b04b99f4..b70d7ff41bb3ab354d95792ffa8e0ec0d7514ef6 100644 (file)
@@ -78,6 +78,8 @@ namespace VISU{
 
     VISU_PrsMergerPL* GetPrsMergerPL(){ return myPrsMergerPL;}
 
+    virtual void Update();
+    
   protected:
     virtual void DoHook();
     virtual const char* GetIconName();
index 908ab06a2065fa29b61ea28a51b8b8623fe4d222..54103eb8f017706046c351ab8ee4c0f29bae93cc 100644 (file)
@@ -65,7 +65,7 @@ using namespace VISU;
 using namespace std;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 static int MYTIMEDEBUG = 0;
 #else
 static int MYDEBUG = 0;
@@ -1296,6 +1296,7 @@ Restore(SALOMEDS::SObject_ptr theSObject,
       SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
       SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aEngComp);
       aStudyBuilder->LoadWith(aCompRefSObj, aDriver);
+      /*
       if (strcmp(aDataType, "MED") == 0){
         // create field or MED converter
         CORBA::Object_var aMedObject = VISU::SObjectToObject(aTargetRefSObj);
@@ -1307,6 +1308,24 @@ Restore(SALOMEDS::SObject_ptr theSObject,
        myInput->Build();
       }else
        throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!");
+      //*/
+
+      // create field or MED converter
+      CORBA::Object_var aMedObject = VISU::SObjectToObject(aTargetRefSObj);
+      SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject);
+      if (!CORBA::is_nil(aField)) {
+        // create field converter
+       myInput = CreateMEDFieldConvertor(aField);
+       myInput->Build();
+      }
+      else if (strcmp(aDataType, "MED") == 0) {
+        // create MED converter
+       myInput = CreateMEDConvertor(aTargetRefSObj);
+       myInput->Build();
+      }
+      else {
+       throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!");
+      }
     } else {
       myFileInfo.setFile(thePrefix.c_str());
 
index 5e1f83c6b72d2eb66afb9908f9bc21fb634acf37..27e98bc2bcb4f2a16b0e11d5f96c7543168a4356 100644 (file)
@@ -38,6 +38,8 @@
 #include <vtkDataSetMapper.h>
 #include <vtkTextProperty.h>
 
+#include "SALOME_Event.hxx"
+
 using namespace VISU;
 using namespace std;
 
@@ -240,8 +242,26 @@ VISU::ScalarMap_i
 {
   if(theMin > theMax) 
     return;
-  vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
-  myScalarMapPL->SetScalarRange(aScalarRange);
+
+  struct TEvent: public SALOME_Event {
+    VISU_ScalarMapPL* myMap;
+    vtkFloatingPointType myRange[2];
+    TEvent( VISU_ScalarMapPL* theMap, const vtkFloatingPointType&  theMin , const vtkFloatingPointType& theMax)
+      :myMap(theMap)
+    {
+      myRange[0] = theMin;
+      myRange[1] = theMax;
+    }
+
+    virtual
+    void
+    Execute()
+    {
+      myMap->SetScalarRange(myRange);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myScalarMapPL, theMin, theMax));
   myIsFixedRange = true;
 }
 
index 4e622a539c58b5856ba894292cf3570d2c33067c..798897de719a8f78754308a775839414f41070f6 100644 (file)
@@ -191,7 +191,8 @@ VISU::StreamLines_i::SetParams(CORBA::Double theIntStep,
                                              thePercents,
                                              theDirection,
                                              1);
-  if(isAccepted == 1) SetSource(aPrs3di);
+  if(isAccepted == 1) 
+    SetSource(aPrs3di);
   return isAccepted == 1;
 }
 
index da93d9586681275e1df0ffa5ac79116ae6158e9b..cb8505dee67091996720b117e98ab7cbd98ad35a 100644 (file)
 
 using namespace std;
 
+namespace VISU {
+  class ExecutionState {
+    bool myIsActive;
+    QMutex myIsActiveMutex;
+  public:
+    ExecutionState(bool isActive = false)
+      : myIsActive(isActive) {}
+
+    bool IsActive() {
+      bool state;
+      myIsActiveMutex.lock();
+      state = myIsActive;
+      myIsActiveMutex.unlock();
+      return state;
+    }
+    bool SetActive(bool isActive) {
+      bool state;
+      myIsActiveMutex.lock();
+      state = myIsActive;
+      myIsActive = isActive;
+      myIsActiveMutex.unlock();
+      return state;
+    }
+  };
+}
 
 //------------------------------------------------------------------------
 VISU_TimeAnimation::VISU_TimeAnimation (_PTR(Study) theStudy,
                                         VISU::View3D_ptr theView3D)
 {
   myStudy = theStudy;
-  myIsActive = false;
+  myExecutionState = new VISU::ExecutionState(false);
   myFrame = 0;
   mySpeed = VISU::GetResourceMgr()->integerValue("VISU", "speed", 1);
   myProportional = VISU::GetResourceMgr()->booleanValue("VISU", "use_proportional_timing", false);
@@ -127,10 +152,24 @@ VISU_TimeAnimation::~VISU_TimeAnimation()
     return;
   }
 
+  if (QThread::running() && !QThread::finished()) {
+    //myExecutionState->SetActive(false);
+    stopAnimation();
+    QThread::wait(500);
+    if (QThread::running() && !QThread::finished()) {
+      QThread::terminate();
+    }
+  }
+
   for (int i = 0; i < getNbFields(); i++) {
     clearData(myFieldsLst[i]);
   }
   clearFieldData();
+
+  delete myExecutionState;
+
+  myDumpPath = "";
+
   /* Terminates the execution of the thread. 
    * The thread may or may not be terminated immediately, 
    * depending on the operating system's scheduling policies. 
@@ -145,10 +184,9 @@ VISU_TimeAnimation::~VISU_TimeAnimation()
    * There is no chance for the thread to cleanup after itself, 
    * unlock any held mutexes, etc. In short, use this function only if absolutely necessary. 
    */
-  myDumpPath = "";
-  QThread::wait(100);
-  QThread::terminate();
-  QThread::wait(400);
+  //QThread::wait(100);
+  //QThread::terminate();
+  //QThread::wait(400);
 }
 
 
@@ -630,22 +668,16 @@ void VISU_TimeAnimation::visibilityOff(int num_field, int num_frame)
                    (this,&VISU_TimeAnimation::_visibilityOff,num_field,num_frame));
 }
 
-//------------------------------------------------------------------------
-void VISU_TimeAnimation::_stopAnimation() {
-  myIsActive = false;
-}
-
 //------------------------------------------------------------------------
 void VISU_TimeAnimation::stopAnimation()
 {
-  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>
-                   (this,&VISU_TimeAnimation::_stopAnimation));
+  myExecutionState->SetActive(false);
 }
 
 //------------------------------------------------------------------------
 void VISU_TimeAnimation::_startAnimation() {
-  if (!myIsActive) {
-    myIsActive = true;
+  if (!myExecutionState->IsActive()) {
+    myExecutionState->SetActive(true);
     QThread::start();
   }
 }
@@ -657,6 +689,11 @@ void VISU_TimeAnimation::startAnimation()
                    (this,&VISU_TimeAnimation::_startAnimation));
 }
 
+//------------------------------------------------------------------------
+CORBA::Boolean VISU_TimeAnimation::isRunning()
+{
+  return myExecutionState->IsActive();
+}
 
 //------------------------------------------------------------------------
 void VISU_TimeAnimation::_nextFrame() {
@@ -1021,31 +1058,33 @@ void VISU_TimeAnimation::parallelAnimation( bool& theIsDumping, QValueList<int>&
   if (myFieldsLst[0].myNbFrames > 2)
     aOneVal = ( myTimeMax - myTimeMin ) / getNbFrames();
   int aNbFiles = 0;
-  
-  while (myIsActive) {
-    ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
-                                                                             myFrame, myFieldsLst[0].myTiming[myFrame]));
-    if (myIsActive) {
-    if(!(myFieldsLst[0].myField))
-      break;
-    for (int i = 0; i < getNbFields(); i++) {
-      FieldData& aData = myFieldsLst[i];
-      if (myFrame > 0) {
-       if (aData.myActors[myFrame-1] != 0)
-         visibilityOff(i, myFrame-1);
-      } else {
-       if (aData.myActors[aData.myNbFrames-1] != 0)
-         visibilityOff(i, aData.myNbFrames-1);
-      }
-      if (aData.myActors[myFrame] != 0) {
-       ProcessVoidEvent(new TVoidMemFunEvent<VISU_Actor>(aData.myActors[myFrame],
-                                                         &VISU_Actor::VisibilityOn));
+
+  bool hasHextFrame = true;
+  while (hasHextFrame && myExecutionState->IsActive()) {
+    ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>
+                     (this, &VISU_TimeAnimation::_emitFrameChanged,
+                      myFrame, myFieldsLst[0].myTiming[myFrame]));
+    if (myExecutionState->IsActive()) {
+      if (!(myFieldsLst[0].myField))
+        break;
+      for (int i = 0; i < getNbFields(); i++) {
+        FieldData& aData = myFieldsLst[i];
+        if (myFrame > 0) {
+          if (aData.myActors[myFrame-1] != 0)
+            visibilityOff(i, myFrame-1);
+        } else {
+          if (aData.myActors[aData.myNbFrames-1] != 0)
+            visibilityOff(i, aData.myNbFrames-1);
+        }
+        if (aData.myActors[myFrame] != 0) {
+          ProcessVoidEvent(new TVoidMemFunEvent<VISU_Actor>(aData.myActors[myFrame],
+                                                            &VISU_Actor::VisibilityOn));
+        }
       }
-    }
-    bool repainArg = false;
-    ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
-                                                                   &SVTK_ViewWindow::Repaint,
-                                                                   repainArg));
+      bool repainArg = false;
+      ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
+                                                                      &SVTK_ViewWindow::Repaint,
+                                                                      repainArg));
     }
 
     k = 1;
@@ -1071,96 +1110,39 @@ void VISU_TimeAnimation::parallelAnimation( bool& theIsDumping, QValueList<int>&
       delay = 1;
     }
     msleep(delay);
-    if (!myIsActive) {
-      ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
-      return;
-    }
+    if (!myExecutionState->IsActive()) return;
 
     if (theIsDumping) {
       // We must unlock mutex for some time before grabbing to allow view updating
       msleep(delay);
-      if (!myIsActive) { // this check was taken from WP_DEB branch
-       ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
-       return;
-      }
-      if(!(myFieldsLst[0].myField)) // break, if field was deleted.
+      if (!myExecutionState->IsActive()) return;
+
+      if (!(myFieldsLst[0].myField)) // break, if field was deleted.
        break;
+
       saveImages( 0, aOneVal, aNbFiles, theIndexList );
     }
 
-    if (!myIsActive) break;
+    if (!myExecutionState->IsActive()) break;
 
     myFrame++;
     if (myFrame == myFieldsLst[0].myNbFrames) {
       if (!myCycling) {
-             myIsActive = false;
-             myFrame--;
-             break;
+        hasHextFrame = false;
+       myFrame--;
       }
       else
-             myFrame = 0;
-    }
-  }
-
-  // make AVI file if need
-  if (theIsDumping && myDumpFormat.compare("AVI") == 0) {
-    double aFPS = 17.3 * mySpeed;
-
-    QFileInfo aFileInfo(myDumpPath);
-    QString aDirPath = aFileInfo.dirPath(true);
-    QString aBaseName = aFileInfo.fileName();
-
-    // add missing files
-    if (theIndexList.count() > 1) {
-      QString aFFile = aDirPath + QDir::separator() + aBaseName;
-      aFFile += QString("_%1.jpeg");
-      int aStartIndex = theIndexList[0], anEndIndex;
-      for (int i = 1; i < theIndexList.count(); i++) {
-       anEndIndex = theIndexList[i];
-       QString aCurFile = aFFile.arg(QString::number(aStartIndex).rightJustify(8, '0'));
-       QStringList aCommands;
-       for (int j = aStartIndex+1; j < anEndIndex; j++) {
-         QString aFile = aFFile.arg(QString::number(j).rightJustify(8, '0'));
-         aCommands.append(QString("ln -s %1 %2").arg(aCurFile).arg(aFile));
-       }
-       system(aCommands.join(" ; \\\n").latin1());
-       aStartIndex = anEndIndex;
-      }
+       myFrame = 0;
     }
-
-    // make AVI file
-    QString aPattern = aDirPath + QDir::separator() + aBaseName;
-    aPattern += "_\%08d.jpeg";
-
-    QString aCmd = myAVIMaker;
-    aCmd += " -I p";
-    aCmd += " -v 0";
-    aCmd += QString(" -f %1").arg(aFPS);
-    // aCmd += QString(" -n %1").arg(aNbFiles);
-    aCmd += QString(" -n %1").arg(myFileIndex+1);
-    aCmd += QString(" -j %1").arg(aPattern);
-    aCmd += " | yuv2lav";
-    aCmd += QString(" -o %1").arg(myDumpPath);
-    system(aCmd.latin1());
-
-    // remove temporary jpeg files
-    aCmd = "( ";
-    aCmd += QString("cd %1").arg(aDirPath);
-    aCmd += "; ls";
-    aCmd += QString(" | egrep '%1_[0-9]*.jpeg'").arg(aBaseName);
-    aCmd += " | xargs rm";
-    aCmd += " )";
-    system(aCmd.latin1());
-  }
+  } // while (hasHextFrame && myExecutionState->IsActive())
 }
 
 //------------------------------------------------------------------------
 void VISU_TimeAnimation::succcessiveAnimation( bool& theIsDumping, QValueList<int>& theIndexList )
 {
-  if ( myFrame >= getNbFrames() - 1 )
+  if (myFrame >= getNbFrames() - 1)
   {
-    myIsActive = false;
-    ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
+    myExecutionState->SetActive(false);
     return;
   }
 
@@ -1171,40 +1153,46 @@ void VISU_TimeAnimation::succcessiveAnimation( bool& theIsDumping, QValueList<in
   int aNbFiles = 0;
   long aFrame = myFrame;
 
-  while (myIsActive) {
-
-    for (int aFieldId = 0; (aFieldId < getNbFields()) && (myFieldsLst[aFieldId].myField); aFieldId++) {
+  bool hasHextFrame = true;
+  while (hasHextFrame && myExecutionState->IsActive())
+  {
+    for (int aFieldId = 0;
+         (aFieldId < getNbFields()) && (myFieldsLst[aFieldId].myField);
+         aFieldId++, aFrame = 0)
+    {
+      if (!myExecutionState->IsActive()) break;
 
       FieldData& aData = myFieldsLst[aFieldId];
       if ( !aData.myPrs[0] ) continue;
-      while (aFrame < aData.myNbFrames) {
-      
-       ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>(this, &VISU_TimeAnimation::_emitFrameChanged,
-                                                                                 myFrame, myFieldsLst[aFieldId].myTiming[aFrame]));
-    
-       if (myIsActive) {
-       if (aFrame > 0) {
-         if (aData.myActors[aFrame-1] != 0)
-           visibilityOff(aFieldId, aFrame-1);
-       } else if ( myFrame > 0) {
-         if (myFieldsLst[aFieldId-1].myActors[myFieldsLst[aFieldId-1].myNbFrames-1] != 0)
-           visibilityOff(aFieldId-1, myFieldsLst[aFieldId-1].myNbFrames-1);
-       } else if ( myCycling ) {
-         if (myFieldsLst[getNbFields()-1].myActors[myFieldsLst[getNbFields()-1].myNbFrames-1] != 0)
-           visibilityOff(getNbFields()-1, myFieldsLst[getNbFields()-1].myNbFrames-1);
-       } else {
-         if (aData.myActors[aData.myNbFrames-1] != 0)
-           visibilityOff(aFieldId, aData.myNbFrames-1);
-       }
-       if (aData.myActors[aFrame] != 0) {
-         ProcessVoidEvent(new TVoidMemFunEvent<VISU_Actor>(aData.myActors[aFrame],
-                                                           &VISU_Actor::VisibilityOn));
-       }
+      for (; aFrame < aData.myNbFrames && myExecutionState->IsActive(); aFrame++, myFrame++)
+      {
+       ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_TimeAnimation,long,double>
+                         (this, &VISU_TimeAnimation::_emitFrameChanged,
+                          myFrame, myFieldsLst[aFieldId].myTiming[aFrame]));
+
+       if (myExecutionState->IsActive()) {
+          if (aFrame > 0) {
+            if (aData.myActors[aFrame-1] != 0)
+              visibilityOff(aFieldId, aFrame-1);
+          } else if ( myFrame > 0) {
+            if (myFieldsLst[aFieldId-1].myActors[myFieldsLst[aFieldId-1].myNbFrames-1] != 0)
+              visibilityOff(aFieldId-1, myFieldsLst[aFieldId-1].myNbFrames-1);
+          } else if ( myCycling ) {
+            if (myFieldsLst[getNbFields()-1].myActors[myFieldsLst[getNbFields()-1].myNbFrames-1] != 0)
+              visibilityOff(getNbFields()-1, myFieldsLst[getNbFields()-1].myNbFrames-1);
+          } else {
+            if (aData.myActors[aData.myNbFrames-1] != 0)
+              visibilityOff(aFieldId, aData.myNbFrames-1);
+          }
+          if (aData.myActors[aFrame] != 0) {
+            ProcessVoidEvent(new TVoidMemFunEvent<VISU_Actor>(aData.myActors[aFrame],
+                                                              &VISU_Actor::VisibilityOn));
+          }
 
-       bool repainArg = false;
-       ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
-                                                                       &SVTK_ViewWindow::Repaint,
-                                                                       repainArg));
+          bool repainArg = false;
+          ProcessVoidEvent(new TVoidMemFun1ArgEvent<SVTK_ViewWindow,bool>(myView,
+                                                                          &SVTK_ViewWindow::Repaint,
+                                                                          repainArg));
        }
 
        k = 1;
@@ -1230,44 +1218,31 @@ void VISU_TimeAnimation::succcessiveAnimation( bool& theIsDumping, QValueList<in
          delay = 1;
        }
        msleep(delay);
-       if (!myIsActive) {
-         ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
-         return;
-       }
+
+       if (!myExecutionState->IsActive()) return;
 
        if (theIsDumping) {
          // We must unlock mutex for some time before grabbing to allow view updating
          msleep(delay);
-         if (!myIsActive) { // this check was taken from WP_DEB branch
-           ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
-           return;
-         }
+         if (!myExecutionState->IsActive()) return;
 
-         if(!(myFieldsLst[aFieldId].myField)) // break, if field was deleted.
+         if (!(myFieldsLst[aFieldId].myField)) // break, if field was deleted.
            break;
 
          saveImages( aFieldId, aOneVal, aNbFiles, theIndexList );
        }
-       
-       if (!myIsActive) break;
-       
-       aFrame++;
-       myFrame++;
-      }
-
-      aFrame = 0;
-    }
+      } // for (; aFrame < aData.myNbFrames && myExecutionState->IsActive(); aFrame++, myFrame++)
+    } // for (int aFieldId = 0;
 
     if (!myCycling) {
-      myIsActive = false;
+      hasHextFrame = false;
       myFrame--;
-      break;
-    else {
+    }
+    else {
       myFrame = 0;
       aFrame = myFrame;
     }
-  }
-
+  } // while (hasHextFrame && myExecutionState->IsActive())
 }
 
 //------------------------------------------------------------------------
@@ -1356,7 +1331,7 @@ void VISU_TimeAnimation::run()
     succcessiveAnimation( isDumping, anIndexList );
 
   // make AVI file if need
-  if (isDumping && myDumpFormat.compare("AVI") == 0) {
+  if (isDumping && myDumpFormat.compare("AVI") == 0 && myExecutionState->IsActive()) {
     double aFPS = 17.3 * mySpeed;
 
     QFileInfo aFileInfo(myDumpPath);
@@ -1406,8 +1381,9 @@ void VISU_TimeAnimation::run()
     system(aCmd.latin1());
   }
 
-  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
-  QThread::exit();
+  if (myExecutionState->IsActive())
+    ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(this,&VISU_TimeAnimation::_emitStopped));
+  myExecutionState->SetActive(false);
 }
 
 //------------------------------------------------------------------------
index 3c443a1e2dc959ac668f833b530df1d0306550de..1cee7a313eb3081588ce6d4d40f6377c74154716 100644 (file)
@@ -39,6 +39,7 @@ namespace VISU
 {
   class Result_i;
   class ColoredPrs3d_i;
+  class ExecutionState;
 }
 
 struct FieldData
@@ -63,7 +64,6 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread
   void _visibilityOff(int num_field, int num_frame);
   void _clearView();
   void _clearData(FieldData& theData);
-  void _stopAnimation();
   void _startAnimation();
   void _nextFrame();
   void _prevFrame();
@@ -116,7 +116,7 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread
 
   CORBA::Long getNbFields() { return myFieldsLst.size(); }
   CORBA::Long getNbFrames();
-  CORBA::Boolean isRunning() { return myIsActive; }
+  CORBA::Boolean isRunning();
   CORBA::Long getCurrentFrame() { return myFrame; }
 
   long getAbsoluteFrameNumber(std::pair<int,long> theFieldTimeStamp);
@@ -188,7 +188,7 @@ class VISU_I_EXPORT VISU_TimeAnimation: public QObject, public QThread
   QString myLastError;
 
   QValueList<FieldData> myFieldsLst;
-  bool myIsActive;
+  VISU::ExecutionState* myExecutionState;
   long myFrame;
   std::vector<long> myFieldsAbsFrames;
   int mySpeed;
index 134d8f72a54a0a032aaedc5fafcad7c51a65deb9..2548faafe6f2f5d4cda9ea01b8a1cf5df58370c9 100644 (file)
@@ -201,8 +201,16 @@ namespace VISU {
        break;
       case VISU::View::VIEWER:{
        ViewManagerList aViewManagerList = myApplication->viewManagers();
-       // to do something
-       // ...
+       ViewManagerList::const_iterator anIt = aViewManagerList.begin();
+       for( ; anIt != aViewManagerList.end(); anIt++ )
+       {
+         const QPtrVector<SUIT_ViewWindow>& views = (*anIt)->getViews();
+         for( int i=0; i<views.count(); i++ ) {
+           myResult = views[i]->isShown();
+           return;
+         }
+       }
+       myResult = false;
        break;
       }}
     }
@@ -1135,18 +1143,25 @@ namespace VISU {
                              CORBA::Boolean theMinor, CORBA::Long theNumMinor)
   {
     if (GetViewWindow())
-      ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setXGrid,
-                                           theMajor,theNumMajor,theMinor,theNumMinor));
+      myView->setXGrid(theMajor,theNumMajor,theMinor,theNumMinor);
   }
   void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor,
                             CORBA::Boolean theMinor, CORBA::Long theNumMinor)
   {
-    //asl: Plot2d_ViewFrame::setYGrid has more parameters
-    //if (GetViewWindow())
-    //  ProcessVoidEvent(new TEnableGridEvent(myView,&Plot2d_ViewFrame::setYGrid,
-    //                  theMajor,theNumMajor,theMinor,theNumMinor));
+    this->EnableYGrid(theMajor,theNumMajor,theMinor,theNumMinor,
+                     false,0,false,0);
   }
 
+  void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor,
+                            CORBA::Boolean theMinor, CORBA::Long theNumMinor,
+                            CORBA::Boolean the2Major, CORBA::Long the2NumMajor,
+                            CORBA::Boolean the2Minor, CORBA::Long the2NumMinor)
+  {
+    if (GetViewWindow())
+      myView->setYGrid(theMajor,theNumMajor,theMinor,theNumMinor,
+                       the2Major,the2NumMajor,the2Minor,the2NumMinor);
+  }
+  
   class TSetScaleModeEvent: public SALOME_Event
   {
   public:
index d57c29651e2d6cb29b857033cf1cd2ac9e36c81d..dd42996d58c99a9e2352c6ab38dda1ceb4f7729a 100644 (file)
@@ -152,6 +152,11 @@ namespace VISU
     virtual void EnableYGrid (CORBA::Boolean theMajor, CORBA::Long theNumMajor,
                               CORBA::Boolean theMinor, CORBA::Long theNumMinor);
 
+    virtual void EnableYGrid (CORBA::Boolean theMajor, CORBA::Long theNumMajor,
+                              CORBA::Boolean theMinor, CORBA::Long theNumMinor,
+                             CORBA::Boolean the2Major, CORBA::Long the2NumMajor,
+                              CORBA::Boolean the2Minor, CORBA::Long the2NumMinor);
+                             
     virtual void SetHorScaling (VISU::Scaling theScaling);
     virtual VISU::Scaling GetHorScaling();
     virtual void SetVerScaling (VISU::Scaling theScaling);
index f802f0ac43b9e45ffa196e53c6986ff7d810475e..e7d7f4548290c82f0dfa8b78f7dbc519cb863a22 100644 (file)
@@ -25,7 +25,9 @@
 # see salome_shared_modules.py
 # (avoids incomplete import at run time)
 
-print "============== import VISU ======================="
+from launchConfigureParser import verbose
+
+if verbose(): print "============== import VISU ======================="
 
 import VISU