From: jfa Date: Sat, 6 May 2006 08:48:29 +0000 (+0000) Subject: Join modifications from branch OCC_debug_for_3_2_0b1 X-Git-Tag: mergefrom_OCC_debug_for_3_2_0b1_06May06~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3f4152dedc1ae968267cfb8a079f261ec0088ed0;p=modules%2Fvisu.git Join modifications from branch OCC_debug_for_3_2_0b1 --- diff --git a/INSTALL b/INSTALL index cf64a3b6..f68cc558 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ -This is the version 3.2.0a2 of VISU +This is the version 3.2.0b1 of VISU Compatible with : - - KERNEL 3.2.0a2 - - SALOMEGUI 3.2.0a2 - - MED 3.2.0a2 + - KERNEL 3.2.0b1 + - SALOMEGUI 3.2.0b1 + - MED 3.2.0b1 diff --git a/Makefile.in b/Makefile.in index a2d20a32..685c2c85 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # -* Makefile *- # # Author : Patrick GOLDBRONN (CEA) diff --git a/adm_local/Makefile.in b/adm_local/Makefile.in index 9b5e810d..734bc820 100644 --- a/adm_local/Makefile.in +++ b/adm_local/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # source path top_srcdir=@top_srcdir@ top_builddir=.. diff --git a/adm_local/unix/make_commence.in b/adm_local/unix/make_commence.in index e28295ad..dc975568 100644 --- a/adm_local/unix/make_commence.in +++ b/adm_local/unix/make_commence.in @@ -10,7 +10,7 @@ HAVE_SSTREAM=@HAVE_SSTREAM@ LIBS=@LIBS@ -LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker $(top_builddir)/lib/salome +LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome # add libstdc++ to link c++ library with libtool ! LDFLAGS+= -lstdc++ @@ -53,8 +53,8 @@ PYTHONHOME = @PYTHONHOME@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_VERSION = @PYTHON_VERSION@ -PYTHON_SITE = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages -PYTHON_SITE_INSTALL = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome +PYTHON_SITE = $(prefix)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages +PYTHON_SITE_INSTALL = $(prefix)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome # QT QT_ROOT = @QT_ROOT@ @@ -103,12 +103,6 @@ HDF5_MT_LIBS=@HDF5_MT_LIBS@ OCC_INCLUDES=@CAS_CPPFLAGS@ OCC_CXXFLAGS=@CAS_CXXFLAGS@ -#OCC_KERNEL_LIBS=@CAS_KERNEL@ -#OCC_OCAF_LIBS=@CAS_OCAF@ -#OCC_VIEWER_LIBS=@CAS_VIEWER@ -#OCC_MODELER_LIBS=@CAS_MODELER@ -#OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@ -#OCC_LIBS=@CAS_LDFLAGS@ CAS_KERNEL=@CAS_KERNEL@ CAS_OCAF=@CAS_OCAF@ CAS_VIEWER=@CAS_VIEWER@ @@ -174,6 +168,8 @@ CXXFLAGS+= $(CORBA_CXXFLAGS) LIBS+=$(CORBA_LIBS) DOXYGEN = @DOXYGEN@ +DOXYGEN_WITH_PYTHON = @DOXYGEN_WITH_PYTHON@ +DOXYGEN_WITH_STL = @DOXYGEN_WITH_STL@ ## Shared libraries LT_STATIC_EXEC=@LT_STATIC_EXEC@ @@ -195,16 +191,30 @@ INSTALL_DATA=@INSTALL_DATA@ # create a symbolic link (or a copie ?) LN_S=@LN_S@ +KERNEL_ROOT_DIR=@KERNEL_ROOT_DIR@ +KERNEL_SITE_DIR=@KERNEL_SITE_DIR@ + +KERNEL_LDFLAGS=@KERNEL_LDFLAGS@ +KERNEL_CXXFLAGS=@KERNEL_CXXFLAGS@ + +GUI_ROOT_DIR=@GUI_ROOT_DIR@ +GUI_LDFLAGS=@GUI_LDFLAGS@ +GUI_CXXFLAGS=@GUI_CXXFLAGS@ + +MED_ROOT_DIR=@MED_ROOT_DIR@ +MED_LDFLAGS=@MED_LDFLAGS@ +MED_CXXFLAGS=@MED_CXXFLAGS@ + ## Installation points prefix=@prefix@ exec_prefix=@exec_prefix@ -bindir=@bindir@/salome -libdir=@libdir@/salome +bindir=@exec_prefix@/bin/salome +libdir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/salome # warning : if user give this path in configure we could have salome/salome :-( includedir=@includedir@/salome datadir=@datadir@/salome idldir=${prefix}/idl/salome -sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules +sharedpydir=@exec_prefix@/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules incmakedir=${prefix}/salome_adm/unix docdir=${prefix}/doc/salome @@ -233,7 +243,13 @@ all: Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in cd $(top_builddir) ; ./config.status -$(top_builddir)/config.status: $(top_srcdir)/configure +LOCAL_MAKE = make_commence make_omniorb + +KERNEL_MAKE = make_module make_conclude depend SALOMEconfig.h F77config.h sstream envScript + +$(top_builddir)/config.status: $(top_srcdir)/configure \ + $(LOCAL_MAKE:%=$(top_srcdir)/adm_local/unix/%.in) \ + $(KERNEL_MAKE:%=$(KERNEL_ROOT_DIR)/salome_adm/unix/%.in) cd $(top_builddir) ; ./config.status --recheck # VPATH contain $(srcdir), so make configure is good in top_srcdir and we must add target configure otherwise :-) @@ -248,7 +264,7 @@ $(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base cd $(top_srcdir) && ./build_configure -ACLOCAL_SRC = \ +ACLOCAL_KERNEL = \ ac_cxx_bool.m4 check_corba.m4 \ ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \ ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \ @@ -263,9 +279,9 @@ check_GUI.m4 check_corba_in_GUI.m4 ACLOCAL_MED = check_Med.m4 -$(top_srcdir)/aclocal.m4: $(ACLOCAL_SRC:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \ +$(top_srcdir)/aclocal.m4: $(ACLOCAL_KERNEL:%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \ $(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \ $(ACLOCAL_MED:%=@MED_ROOT_DIR@/adm_local/unix/config_files/%) - cd $(top_srcdir) ; aclocal --acdir=adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \ + cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \ -I @GUI_ROOT_DIR@/adm_local/unix/config_files \ -I @MED_ROOT_DIR@/adm_local/unix/config_files diff --git a/bin/VERSION b/bin/VERSION index b073ab73..9df5f668 100755 --- a/bin/VERSION +++ b/bin/VERSION @@ -1 +1 @@ -THIS IS SALOME - VISU VERSION: 3.2.0a2 +THIS IS SALOME - VISU VERSION: 3.2.0b1 diff --git a/build_configure b/build_configure index 4cc454a9..212e7d8b 100755 --- a/build_configure +++ b/build_configure @@ -142,9 +142,9 @@ echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_omniorb \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_omniorb:${ABS_CONF_DIR}/adm_local/unix/make_omniorb.in \\" >> configure.in_tmp1 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1 -echo " ./adm_local/unix/make_commence \\" >> configure.in_tmp1 +echo " ./adm_local/unix/make_commence:${ABS_CONF_DIR}/adm_local/unix/make_commence.in \\" >> configure.in_tmp1 echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1 diff --git a/configure.in.base b/configure.in.base index e4b35d6e..37aa5994 100644 --- a/configure.in.base +++ b/configure.in.base @@ -339,7 +339,7 @@ else fi # make other build directories -for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl +for rep in salome_adm adm_local doc bin/salome include/salome lib${LIB_LOCATION_SUFFIX}/salome share/salome/resources idl do # if test ! -d $rep ; then # eval mkdir $rep diff --git a/doc/Makefile.in b/doc/Makefile.in index 7295ede7..59e6c596 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # -* Makefile *- # diff --git a/doc/salome/Makefile.in b/doc/salome/Makefile.in index 8642b22b..635b8470 100644 --- a/doc/salome/Makefile.in +++ b/doc/salome/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # -* Makefile *- # # Author : Patrick GOLDBRONN (CEA) diff --git a/doc/salome/gui/VISU/animation_in_gauss_viewer.htm b/doc/salome/gui/VISU/animation_in_gauss_viewer.htm new file mode 100755 index 00000000..027e3bd6 --- /dev/null +++ b/doc/salome/gui/VISU/animation_in_gauss_viewer.htm @@ -0,0 +1,178 @@ + + + + + +Animation in Gauss Viewer + + + + + + + + + + + +

Recording in Gauss Viewer

+ +

In the addition + to the Animation at Time stamps available + for all Post-Pro presentations, Gauss + Viewer gives the possibility to record AVI clips of user actions. + This functionality is available at any time for all contents of the 3D + Viewer, including Animation or Segmentation.

+ +

 

+ +

To start the video recording session click Start +  button. + After it you will see a standard dialog box allowing input the file name + for AVI clip and browse for the location.

+ +

 

+ +

+ +

 

+ +

Then you'll be asked to define Recording + Properties:

+ +

 

+ +

+ +

 

+ + + + + +

 

+ +

After you click OK, the recording will start and all your actions in + the viewer will be recorded.

+ +

Note that if you change the size of the 3D viewer window, the avi file + would be corrupt.

+ +

 

+ +

Press Stop button + to finish video recording or Pause + button to suspend it. If the recording is just paused, + you can always continue it by clicking Play + button.

+ +

 

+ + + + diff --git a/doc/salome/gui/VISU/clipping.htm b/doc/salome/gui/VISU/clipping.htm index 048794c1..53a294f0 100755 --- a/doc/salome/gui/VISU/clipping.htm +++ b/doc/salome/gui/VISU/clipping.htm @@ -14,7 +14,9 @@ if (navigator.appName !="Netscape") - - - - - - - - -

Creating Plot2D Presentations from Tables

- -

To create a Plot2D presentation from the table, right-click on it, then - select Create Curves in the pop-up - menu.

- -

 

- -

- -

 

- -

By unchecking Auto Assign you - can set attributes for your Plot2D Presentation. -

- -

In the - first column - the type of line (None, Solid, Dash, Dot, Dash - - Dot, Dash - Dot - Dot).

- -

In the - second column - the size of markers.

- -

In the - third column - the type of markers (Circle, Rectangle, Diamond, - Rightward, Leftward, Downward & Upward Triangle, Cross or Diagonal - Cross).

- -

 

- -

 

- -

 

- - - - diff --git a/doc/salome/gui/VISU/creating_tables.htm b/doc/salome/gui/VISU/creating_tables.htm index 4fe02076..3fc106e2 100755 --- a/doc/salome/gui/VISU/creating_tables.htm +++ b/doc/salome/gui/VISU/creating_tables.htm @@ -17,23 +17,19 @@ if (navigator.appName !="Netscape") h1.whs1 { font-family:'Times New Roman' , serif; } p.whs2 { font-family:'Times New Roman' , serif; } img_whs3 { border:none; width:30px; height:30px; float:none; border-style:none; } -p.whs4 { font-family:'Times New Roman' , serif; font-style:italic; color:#ff0000; } -p.whs5 { font-family:'Times New Roman' , serif; margin-left:40px; } -p.whs6 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:normal; color:#000000; } -p.whs7 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:italic; color:#ff0000; } -p.whs8 { font-family:'Times New Roman' , serif; margin-left:0px; font-weight:normal; } -p.whs9 { font-family:'Times New Roman' , serif; font-weight:bold; margin-left:0px; } -p.whs10 { font-family:'Times New Roman' , serif; font-weight:bold; margin-left:0px; background-image:url('texture_horiz_ltbluebubbles.jpg'); } -img_whs11 { border:none; float:none; width:36px; height:38px; border-style:none; } +p.whs4 { font-family:'Times New Roman' , serif; margin-left:40px; } +p.whs5 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:normal; color:#000000; } +p.whs6 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:italic; color:#ff0000; } +p.whs7 { font-family:'Times New Roman' , serif; margin-left:0px; font-weight:normal; } +p.whs8 { font-family:'Times New Roman' , serif; font-weight:bold; margin-left:0px; } --> - +

Viewing 3D presentations. +

+

Each  newly + created presentation is displayed in VTK viewer. To display an existing + presentation, right-click on it in the Object Browser and select Display.  

-

Setting presentation - view parameters

+

 

-

To change view parameters of the presentation:

+

Right mouse-click on the Presentation gives access to the following + options:

-

 

+

 

-

Right-click on the submesh (for which you - have already created a presentation) in the Object Browser or right-click - on this presentation in the viewer. From the associated pop-up menu choose - Representation or Properties - submenus.

+

-

 

+

 

-

All these view parameters are context-sensitive: NOT all - types of visualization and NOT all properties can be set for a definite - 3D presentation.                            

+

All parameters are context-sensitive: + NOT all types of visualization and NOT all properties can be set for a + certain 3D presentation.                            

-

 

- -

The main options for - changing  view - parameters of presentations are the following:

- -

 

+

 

-

 

+

 

+ + ++++ + + + + + + + + + + + + + + + + + + + +
+

Points

+

Surface

+

Wireframe

+

+

+

+

Insideframe (displays the wires + lying within the object)

+

Shrink

+

Shading on

+

+

+

+ +

 

-

 

+

 

- +

-

 

+

 

-

 

- -

 

+

 

-

 

+

When you create several presentations of the same + object, you may wish to see them simultaneously,  which + might be impossible, because they all are located at the same place. To + solve this problem, right-click in the viewer and select Arrange + Actors in the pop-up menu.    

-

  

+

 

-

 

+

-

To - change the type of visualization of a particular presentation:

+

 

-

 

+

In Auto + mode you specify along which Axis + and at which Relative Distance + the presentations should be lined up.

-

Choose - one of the available types of visualization of the presentation from Representation submenu of the pop-up - menu:

+

 

-

 

+

-

- Points

+

 

-

 

+

In Manual + mode you set the coordinates for each presentation separately.

-

- Wireframe

+

 

-

 

+

 

-

- Surface +

Displaying several presentations at the same time + may cause superposition of their scalar bars. To avoid this, check Arrange Scalar Bars radio button  in + the Preferences - > Post-Pro - > + Scalar Bar. A separate scalar bar will be displayed for each presentation.

-

 

- -

- Insideframe

- -

 

- -

-Surfaceframe

- -

 

- -

To change the type of visualization of all presentations, - currently displayed in the viewer:

- -

 

- -

- - Choose one of the available types of visualization of the presentation - in the main menu: Representation > - Display Selection

- -

 

- -

- - Click on one of the icons, representing the types of visualization in - the Representation toolbar:

- -

- -

     Points -  Wireframe - Surface

- -

 

- -

 

- -

 Shrinking/unshrinking - the presentation:

- -

 

- -

From the submenu Representation - you can choose Shrink option, - which will display a shrinked image of the presentation: all cells of - the presentation of the mesh will be visually compressed:

- -

 

- -

                      

- -

 

- -

 To - return the presentation back to normal, unshrinked mode of visualization, - choose the same submenu Representation, - and select Unshrink option.

- -

 

- -

 

- -

To change the color of the presentation: +

Alternatively you may wish to merge the + scalar bars to have a common scalar bar for all presentations. To do this, + select several presentations or fields in the object browser, right-click + and from the pop-up menu select  Merge Scalar Range.

-

 

- -

From the submenu Properties - choose Color. From the - standard Select Color dialog box -  choose - the required color for the presentation of your submesh.

- -

 

- -

 

- -

                  

- -

 

- -

 Changing - opacity of the presentation:

- -

 

- -

 From - the submenu Properties choose - Opacity. The following dialog - box will appear:

- -

 

- -

 

- -

                        

- -

 

- -

In this dialog box you - can set the value (between 0 and 100) of opacity of the presentation. -  To validate - your choice click OK button.

- -

 

- -

 

- -

  Changing - the width of the lines:

- -

 

- -

From the submenu Properties - choose Line Width. The - following dialog box will appear:

- -

 

- -

                       

- -

 

- -

To validate your choice - click OK button.

- -

 

- -

 

+

To restore separate bars and scales for + each module select Use Field Range + from the same menu.

-

 

+

 

-

 

+

 

-

Creating presentations

+

Presentation of a submesh

To create a presentation of a submesh:

 

In the Object Browser right-click on a submesh - contained in an imported  MED - object and from the pop-up menu choose Create + of an imported MED object and from the pop-up menu choose Create Presentation:

 

@@ -103,14 +102,14 @@ else

 

-

            

+

            

 

 

-Related Topics +Related Topics

diff --git a/doc/salome/gui/VISU/files/creating_xy_plot.htm b/doc/salome/gui/VISU/files/creating_xy_plot.htm index 51ae5bb4..4f799462 100755 --- a/doc/salome/gui/VISU/files/creating_xy_plot.htm +++ b/doc/salome/gui/VISU/files/creating_xy_plot.htm @@ -20,16 +20,14 @@ p.whs3 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:nor p.whs4 { font-family:'Times New Roman' , serif; font-style:italic; color:#ff0000; margin-left:40px; } p.whs5 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:normal; color:#000000; font-weight:normal; } p.whs6 { font-family:'Times New Roman' , serif; margin-left:40px; font-style:normal; color:#000000; font-weight:bold; } -img_whs7 { border:none; border-style:none; width:444px; height:310px; float:none; } +img_whs7 { border:none; width:444px; height:310px; float:none; border-style:none; } p.whs8 { font-weight:bold; margin-left:0px; } p.whs9 { margin-left:40px; } p.whs10 { margin-left:0px; } img_whs11 { border:none; width:20px; height:20px; border-style:none; } -img_whs12 { border:none; width:252px; height:96px; border-style:none; } -p.whs13 { font-weight:bold; margin-left:40px; } -img_whs14 { border:none; width:600px; height:431px; border-style:none; } -p.whs15 { font-family:'Times New Roman' , serif; font-weight:bold; margin-left:0px; background-image:url('../texture_horiz_ltbluebubbles.jpg'); } -img_whs16 { border:none; width:35px; height:37px; float:none; border-style:none; } +p.whs12 { font-weight:bold; margin-left:40px; } +p.whs13 { margin-left:40px; font-weight:normal; } +img_whs14 { border:none; width:590px; height:310px; } -->

Operations with presentations

-

To display a presentation:

+

 

-

Right-click on it in the Object Browser and +

To display a presentation:

+ +

 

+ +

Right-click on it in the Object Browser and from the pop-up menu choose Display.

-

 

- -

                       

- -

 

+

                       

To display several presentations:

 

-

Hold down Ctrl +

Hold down Ctrl button and select in the Object Browser the presentations for displaying. Right-click with the mouse and from the pop-up menu select Display.

-

 

+

 

To display only one presentation:

-

 

+

 

-

 Choose +

 Choose Display only option. The other presentations will be immediately  hidden.

-

 

+

 

To hide this presentation:

-

 

+

 

-

From the same pop-up menu choose Erase. +

From the same pop-up menu choose Erase. (This option will automatically appear in this pop-up menu if this presentation have been displayed)

 

-

 

+

 

To hide all presentations:

 

-

From the main menu choose Representation - > Erase All or click this button   in the Representation toolbar -   

+

From the main menu choose Representation + > Erase All, click button   in the Representation toolbar + or right-click in the 3D Viewer and select Erase + All in the pop-up menu.   

-

                                

+

                                

-

 

+

 

To delete an existing presentation:

 

-

Right-click on it in the Object Browser and +

Right-click on it in the Object Browser and from the pop-up menu choose Delete.

@@ -209,9 +210,31 @@ else option allows to set or modify additional parameters of field presentations after its creation.

-

 

+

 

-

 

+

To rename a field presentation

+ +

 

+ +

1. Right-click on this + presentation in the Object Browser or in the viewer.

+ +

 

+ +

2. From the pop-up menu select Rename + option, the following dialog box will appear:

+ +

 

+ +

                       

+ +

 

+ +

In the field Name + enter your personal name of the presentation and click OK + button to confirm your choice. The name of the presentation will + change in the Object Browser.

- - - - - - - - -

Editing field presentations

- -

 In - Post-Pro all options allowing - Changing view parameters, - Renaming, Displaying/Hiding, - Scaling, Selecting are ALSO functional in case of management - of field presentations. But there are some additional options specific - ONLY to field presentations.   

- -

 

- -

To delete a field presentation:

- -

 

- -

1. - Right-click on this presentation in the Object Browser or in the viewer.

- -

 

- -

2. - From the pop-up menu select Delete option.

- -

 

- -

 

- -

-Related Topics - - -

- -

 

- - - - diff --git a/doc/salome/gui/VISU/files/exploring_med_files.htm b/doc/salome/gui/VISU/files/exploring_med_files.htm deleted file mode 100755 index 8af189a3..00000000 --- a/doc/salome/gui/VISU/files/exploring_med_files.htm +++ /dev/null @@ -1,141 +0,0 @@ - - - - - -Exploring MED files - - - - - - - - - - - - -

Exploring MED files

- -

In VISU you - can explore MED files. This option automatically launches MED component of SALOME platform and imports - MED files using the algorithm of exploring integrated in this component.

- -

 

- -

To explore a MED file:

- -

 

- -

1.  From - the main menu choose File > Explore - MED file

- -

 

- -

2.  Using - a standard Search Files dialog - box choose the required MED file.

- -

 

- -

The - structure of the explored MED file will be displayed in the Object Browser. -

- -

 

- -

 

- -

 

- -

-Related Topics - - -

- - - - diff --git a/doc/salome/gui/VISU/files/getting_elements_attributes.htm b/doc/salome/gui/VISU/files/getting_elements_attributes.htm index 949e996f..cc94cc3e 100755 --- a/doc/salome/gui/VISU/files/getting_elements_attributes.htm +++ b/doc/salome/gui/VISU/files/getting_elements_attributes.htm @@ -15,28 +15,31 @@ if (navigator.appName !="Netscape") -

Getting elements attributes

+

Selection Info

-

To view the attributes of the elements (cells, points, meshes) +

To view the attributes of elements (cells, points, meshes) displayed in the viewer:

-

 

+

 

-

1. In the main menu choose  Selection >Selection - info...,  choose - the necessary type of elements (Point, - Cell, or Actor) in the - dialog box and click on the element of the required type in the viewer. - The chosen element will be highlighted and its attributes will be displayed - in this dialog box:

+

 

 

-

- -

 

- -

- -

You can - get the following information about Points:

- -

- Mesh - name

- -

- Field - name

- -

- - ID Number of the point

- -

- - Scalar value applied to the point (if any)

- -

- Vector value applied - to the point (if any)

- -

- Coordinates of the - point in 3d space

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

- -

The following - information about Cells is available:

- -

- Mesh - name

- -

- Field - name

- -

- - ID Number of the cell

- -

- - Scalar value applied to the cell (if any)

- -

- Vector value applied - to the cell (if any)

- -

- Attributes of the - points forming this cell (in table layout)

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

- -

 

+

In the main menu choose  Selection > + Selection info...,  choose + the necessary type of elements (Point, + Cell, or Actor) in the + dialog box and click on the element of the required type in the viewer. + The chosen element will be highlighted and its attributes will be displayed + in this dialog box:

-

An +

+ +

You can get the following information + about Points:

+ + + +

 

+ +

+ +

The following information about + Cells is available:

+ + + +

 

+ +

+ +

 

+ +

An Actor (any 3D object (presentation of a submesh, field presentation) displayed in the viewer) possesses the following characteristics

- -

 

- -

- Mesh - name

- -

- Field - name

- -

- Coordinates of the - object in 3d space

- -

- Size of the object - (expressed as the extent along the coordinates)

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

Using this dialog box, you can examine the attributes of a + style="font-weight: normal;">possesses the following characteristics:

+ + + +

 

+ +

Using this dialog box, you can examine the attributes of a definite point or cell, selected by its ID number. For that, you should only enter an ID number of a definite point or cell in the ID field, the attributes of this point or cell will be immediately diff --git a/doc/salome/gui/VISU/files/getting_started.htm b/doc/salome/gui/VISU/files/getting_started.htm index ec8e0360..35810ce2 100755 --- a/doc/salome/gui/VISU/files/getting_started.htm +++ b/doc/salome/gui/VISU/files/getting_started.htm @@ -51,8 +51,7 @@ if (window.gbWhTopic) { if (window.addTocInfo) { - addTocInfo("Post-Pro module\nUsage overview"); -addButton("show",BTN_TEXT,"Show","","","","",0,0,"","",""); + addButton("show",BTN_TEXT,"Show","","","","",0,0,"","",""); } if (window.writeBtnStyle) diff --git a/doc/salome/gui/VISU/files/importing_med_objects.htm b/doc/salome/gui/VISU/files/importing_med_objects.htm index dfc00ddf..727ea55f 100755 --- a/doc/salome/gui/VISU/files/importing_med_objects.htm +++ b/doc/salome/gui/VISU/files/importing_med_objects.htm @@ -17,24 +17,14 @@ if (navigator.appName !="Netscape") h1.whs1 { font-family:'Times New Roman' , serif; } p.whs2 { font-family:'Times New Roman' , serif; } p.whs3 { font-family:'Times New Roman' , serif; margin-left:40px; } -img_whs4 { border:none; border-style:none; width:453px; height:256px; float:none; } -p.whs5 { font-family:'Times New Roman' , serif; background-image:url('../texture_horiz_ltbluebubbles.jpg'); } -img_whs6 { border:none; float:none; width:36px; height:38px; border-style:none; } -p.whs7 { background-image:url('../texture_horiz_ltbluebubbles.jpg'); } -p.whs8 { background-image:url('../texture_horiz_ltbluebubbles.jpg'); margin-left:0px; } +p.whs4 { margin-left:40px; } +img_whs5 { border:none; width:453px; height:256px; float:none; border-style:none; } +p.whs6 { margin-left:120px; } +img_whs7 { border:none; width:294px; height:486px; float:none; border-style:none; } +p.whs8 { font-family:'Times New Roman' , serif; margin-left:40px; font-weight:bold; } +ul.whs9 { list-style:disc; } --> - - - + + + + + + + + + +

Introduction to Post-Pro

+ +

Post-processing module Post-Pro +  for + SALOME  is + destined for visualization of data produced by the other components of + the platform. Post-Pro provides +  various + forms of data visualization including:

+ +

 

+ + + +

 

+ + + +

 

+ + + +

 

+ + + +

                

+ +

 

+ +

+Related Topics + + +

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/VISU/files/introduction_to_visu.htm b/doc/salome/gui/VISU/files/introduction_to_visu.htm deleted file mode 100755 index e4d9dcd0..00000000 --- a/doc/salome/gui/VISU/files/introduction_to_visu.htm +++ /dev/null @@ -1,154 +0,0 @@ - - - - - -Introduction to VISU - - - - - - - - - - - - -

Introduction to VISU

- -

Post-processing - module Post-Pro  for - SALOME  is - destined for visualization of data produced by the other components of - the platform. Post-Pro provides -  various - forms of data visualization including:

- -

 

- - - -

 

- - - -

 

- - - -

 

- - - -

                

- -

 

- -

 

- -

-Related Topics - - -

- -

 

- -

 

- -

 

- - - - diff --git a/doc/salome/gui/VISU/files/iso_surfaces_presentation.htm b/doc/salome/gui/VISU/files/iso_surfaces_presentation.htm index 40b7e370..9eb743b6 100755 --- a/doc/salome/gui/VISU/files/iso_surfaces_presentation.htm +++ b/doc/salome/gui/VISU/files/iso_surfaces_presentation.htm @@ -22,13 +22,13 @@ p.whs5 { margin-left:40px; } img_whs6 { border:none; width:26px; height:27px; float:none; border-style:none; } p.whs7 { margin-left:0px; } p.whs8 { margin-left:80px; } -img_whs9 { border:none; width:348px; height:533px; border-style:none; float:none; } +img_whs9 { border:none; width:348px; height:533px; float:none; border-style:none; } ul.whs10 { list-style:disc; } p.whs11 { margin-left:24px; } p.whs12 { font-family:'Times New Roman' , serif; margin-left:40px; } p.whs13 { margin-left:60px; } p.whs14 { font-family:'Times New Roman' , serif; margin-left:0px; } -img_whs15 { border:none; width:574px; height:411px; float:none; border-style:none; } +img_whs15 { border:none; border-style:none; width:634px; height:577px; float:none; } --> - - - - - - - - -

Renaming presentations

- -

To rename your presentation:

- -

 

- -

Right-click on the submesh (for which you - have already created a presentation) in the Object Browser or right-click - on this presentation in the viewer. From the pop-up menu choose Rename, the following dialog box will - appear:

- -

 

- -

                       

- -

 

- -

In the field Name - enter your personal name of the presentation and click OK - button to confirm your choice. The name of the presentation will - change in the Object Browser.

- -

 

- - - - diff --git a/doc/salome/gui/VISU/files/running_visu.htm b/doc/salome/gui/VISU/files/running_visu.htm index f2b05f41..1fae7f5a 100755 --- a/doc/salome/gui/VISU/files/running_visu.htm +++ b/doc/salome/gui/VISU/files/running_visu.htm @@ -20,7 +20,7 @@ p.whs3 { font-family:'Times New Roman' , serif; } p.whs4 { font-family:'Times New Roman' , serif; background-image:url('../texture_horiz_ltbluebubbles.jpg'); } img_whs5 { border:none; float:none; width:36px; height:38px; border-style:none; } p.whs6 { margin-left:40px; } -img_whs7 { border:none; border-style:none; width:702px; height:509px; float:none; } +img_whs7 { border:none; width:702px; height:509px; float:none; border-style:none; } -->

Scalar Map presentation

-

Scalar Map is the - basic type of visualization of calculation data in Post-Pro - module. This presentation consists of the following:

+

Scalar Map is the basic type of visualization of calculation + data in Post-Pro module. This + presentation consists of the following:

-

 

+

 

-

- creating of a 3D presentation on the basis - of a field;

+

- creating of a 3D presentation on the + basis of a field;

-

- coloring of the cells of this presentation, +

- coloring of the cells of this presentation, according the scalar or vector values applied to this cells;

-

- creating of a scalar bar: a scale, representing +

- creating of a scalar bar: a scale, representing the correspondence  between the scalar values of the field and the used colors.

-

 

+

 

-

All other types of field presentation are based on the Scalar +

All other types of field + presentation are based on the Scalar Map.

-

 

+

 

To create a Scalar Map presentation:

+ style="margin-top: 0px; margin-bottom: 0px;">To create a Scalar Map + presentation:

 

-

- Right-click on one of the time stamps of - the field in the Object browser and from the pop-up menu choose - Right-click on one of the time stamps + of the field in the Object browser and from the pop-up menu choose Scalar Map, or

-

 

+

 

-

- Click on one of the time stamps of the field - in the Object browser and select from the main menu Visualization - > Scalar Map, or click icon +

- Click on one of the time stamps of the + field in the Object browser and select from the main menu Visualization + > Scalar Map, or click icon in the Visualization Toolbar

-

 

+

 

-

The following dialog box will appear:

+

The following dialog box will appear:

-

 

+

 

-

This dialog box is equal for all types of field presentations - and it will be present as an additional tab in all dialog boxes allowing - to create the other types of presentations. It allows to set the parameters - of Scalar range, as well as the - parameters of the Scalar Bar. - You can also set these parameters as preferences which will be used in - all SALOME sessions: in the main menu select Preferences - > Visu > Scalar Bar.    

+

This dialog box is equal + for all types of field presentations and it will be present as an additional + tab in all dialog boxes allowing to create the other types of presentations. + It allows to set the parameters of Scalar + range, as well as the parameters of the Scalar + Bar. You can also set these parameters as preferences which will + be used in all SALOME sessions: in the main menu select File + > Preferences > Post Pro + > Scalar Bar.    

-

 

+

 

-

        

+

        

-

 

+

 

-
    +
      -
    • Scalar +

    • Scalar range parameters:

    -

     

    +

     

    -
      +
        -
          +
            -
          • Scalar - Mode field: This field allows to choose - the mode of transformation of vector values into scalar values for creation - of the presentation. It can be module of the vector or one of three components +

          • Scalar Mode field: This field allows to choose the mode + of transformation of vector values into scalar values for creation of + the presentation. It can be module of the vector or one of three components of the vector. (Note: This choose box is relevant only for fields containing vector values, in other cases it will be inactive).  

        -

         

        +

         

        -
          +
            -
              +
                -
              • Logarithmic - scaling check box: You can apply logarithmic +

              • Logarithmic scaling + check box: You can apply logarithmic scaling to the color scale of the presentation.

            -

             

            +

             

            -
              +
                -
                  +
                    -
                  • Use +

                  • Use field range: if this check box is selected, all cells of the field presentation will be colored according the values applied to these cells.  

                -

                 

                +

                 

                -
                  +
                    -
                      +
                        -
                      • Use - imposed range: here you can define - your own range of scalar values of the field, on the basis of which this - presentation will be constructed. The cells of the field presentation - with applied scalar or vector values belonging to this imposed range will - be colored according to these values. The other cells of the field presentation - (with applied scalar or vector values out of this imposed range) will - be displayed using one color. For the cells with applied scalar or vector - values, which are less than the minimal value of the imposed range, the - color will be the same as for the cells with applied minimal values. For - the cells with applied scalar or vector values, which are larger than - the maximal value of the imposed range the color will be the same as for - the cells with applied minimal values.  

                      • +
                      • Use imposed range: + here you can define your own range + of scalar values of the field, on the basis of which this presentation + will be constructed. The cells of the field presentation with applied + scalar or vector values belonging to this imposed range will be colored + according to these values. The other cells of the field presentation (with + applied scalar or vector values out of this imposed range) will be displayed + using one color. For the cells with applied scalar or vector values, which + are less than the minimal value of the imposed range, the color will be + the same as for the cells with applied minimal values. For the cells with + applied scalar or vector values, which are larger than the maximal value + of the imposed range the color will be the same as for the cells with + applied minimal values.  

                    -

                     

                    +

                     

                    -
                      +
                        -
                      • Colors - and Labels

                      • +
                      • Colors and Labels

                      • -
                      • Nb. +

                      • Nb. of colors field: In this field you can enter the number of colors, which will be used for coloring of cells containing scalar values.

                      • -
                      • Nb. +

                      • Nb. of labels field: In this field you can enter the number of labels, indicating graduation of the scalar bar.

                      -

                       

                      +

                       

                      -
                        +
                          -
                        • Orientation: +

                        • Orientation: You can select Vertical or Horizontal orientation of the scalar bar.  

                        -

                         

                        +

                         

                        -
                          +
                            -
                          • Origin: +

                          • Origin: you can enter X & Y coordinates of the origin of the scalar bar.

                          -

                           

                          +

                           

                          -
                            +
                              -
                            •  

                               Dimensions: you can enter Width and Height of the scalar bar.

                            -

                             

                            +

                             

                            -
                              +
                                -
                              • Save as default values check box allows - to save this parameters for all presentations, which will be constructed - later.

                              • +
                              • Save + as default values check box allows to save this parameters for + all presentations, which will be constructed later.

                              -

                               

                              +

                               

                              -
                                +
                                  -
                                • Text properties

                                  Text properties button allows you to define from the following dialog box:

                                -

                                 

                                +

                                 

                                -

                                +

                                -

                                 

                                +

                                 

                                -
                                  +
                                    -
                                  • Title +

                                  • Title of the field, on the basis of which this presentation is created,

                                  • -
                                  • Font - properties of the this Title, - displayed in the Object Browser,

                                  • +
                                  • Font + properties of the Title, + displayed in the Viewer

                                  • -
                                  • Font +

                                  • Font properties of the Labels, - displayed new the scalar bar, created with this presentation.  

                                  • + displayed in the Viewer.  

                                  -

                                   

                                  +

                                   

                                  -

                                  After you have finished with setting these +

                                  After you have finished with setting these parameters, click OK. Your presentation with scalar bar will be immediately displayed in the viewer:

                                  -

                                   

                                  - -

                                   

                                  - -

                                   

                                  - -

                                   

                                  +

                                   

                                  -

                                                          

                                  +

                                                          

                                  -

                                   

                                  +

                                   

                                  -

                                  -Related Topics +

                                  +Related Topics

                                  -

                                   

                                  +

                                   

                                  -

                                   

                                  +

                                   

                                  -

                                   

                                  +

                                   

                                  -

                                   

                                  +

                                   

                                  -

                                  Scaling presentations

                                  +

                                  Translate Presentation

                                  In SALOME - there is a feature allowing to scale presentations of submeshes and field - presentations along one of the axes (X, Y, Z).

                                  + there is a feature allowing to translate presentations of submeshes and + field presentations along axes (X, Y, Z).

                                   

                                  -

                                  To  scale - a presentation:

                                  +

                                  To translate a presentation right-click on it in the Object Browser + or 3D Viewer and select Translate Presentation. +

                                   

                                  -

                                  1. Choose in the main - menu Representation > Scaling, - or

                                  +

                                                

                                  -

                                       click - on the icon in - the Representation Toolbar.

                                  +

                                   

                                  -

                                   

                                  +

                                  The presentation will be moved by the specified + distance along axes.

                                  -

                                  2. In the Scaling - dialog box set the parameters of the scaling:

                                  +

                                  To cancel all changes, click Reset + button.

                                  -

                                   

                                  +

                                   

                                  -

                                                

                                  - -

                                   

                                  - -

                                  To cancel all changes, - click Reset button.

                                  - -

                                   

                                  - -

                                  3. Click Apply +

                                  3. Click Apply button, to apply your scaling on the chosen presentation.

                                  -

                                   

                                  +

                                   

                                  -

                                  4. +

                                  4. To confirm all actions and quit Scaling - dialog box, click - OK. + font-weight: bold;">Translate + Presentation dialog + box, click OK.   

                                  -

                                   

                                  +

                                   

                                  -

                                   

                                  +

                                   

                                  - - - - - - - - - -

                                  Selection in VISU

                                  - -

                                  VISU module allows to make selection of the whole presentation, - as well as of its elements: cells, edges, points.

                                  - -

                                   

                                  - -

                                  To make selection of the whole - presentation, (if it has been displayed)  click - on it in the viewer or in the Object Browser.

                                  - -

                                   

                                  - -

                                                          

                                  - -

                                   

                                  - -

                                  Your presentation will - be displayed with white outline automatically generated by the viewer - according the borders of the presentation in 3d space.

                                  - -

                                   

                                  - -

                                  To - make selection of several presentations, hold down Shift - button and click on them one after another in the viewer or in - the Object Browser or hold down left mouse button and outline the desired - presentations in the viewer window.

                                  - -

                                   

                                  - -

                                  To make selection of - the elements of the presentation (cells, edges, points):

                                  - -

                                   

                                  - -

                                  1. - Choose from Selection Toolbar the - mode of selection:

                                  - -

                                   

                                  - -

                                   

                                  - - - ----- - - - - - - -
                                  -

                                    Points -

                                  -

                                     Selection -  

                                  -

                                  Edges

                                  -

                                   Selection -          

                                  -

                                  Cells

                                  -

                                  Selection -           

                                  -

                                  Actor

                                  -

                                  Selection -

                                  - -

                                                 

                                  - -

                                   

                                  - -

                                  2. - Click on the element of the presentation in the viewer. The color of the - selected element will automatically change.

                                  - -

                                  To - make selection of several elements of the presentation, with pressed Shift button click on them one after - another in the viewer.

                                  - -

                                   

                                  - -

                                  Actor selection mode is initial mode - of selection of the whole presentation.

                                  - -

                                   

                                  - -

                                  To make selection of - an element of the presentation (cell, point) with a definite number, you - can:

                                  - -

                                   

                                  - -

                                   1. - Choose from the main menu Selection > - Cell (Point) > Select by number or

                                  - -

                                   

                                  - -

                                   2. - Select from Selection Toolbar a mode of selection (Cells selection - or Points selection),

                                  - -

                                  right-click on the - presentation displayed in the viewer and from the pop-up menu choose (according - the chosen mode of selection)  Select a Point - or Select a Cell option.

                                  - -

                                   

                                  - -

                                  The - following dialog box will appear:

                                  - -

                                   

                                  - -

                                                        

                                  - -

                                   

                                  - -

                                  Or in case of cell - selection:

                                  - -

                                   

                                  - -

                                                        

                                  - -

                                   

                                  - -

                                  In the field Point number (Cell number) enter the - number of the Point (Cell), you want to select and press OK. - The selected element of your presentation will be highlighted:

                                  - -

                                   

                                  - -

                                     

                                  - - - - diff --git a/doc/salome/gui/VISU/files/setting_properties_of_xy_plots.htm b/doc/salome/gui/VISU/files/setting_properties_of_xy_plots.htm index cf772b0c..adce3d38 100755 --- a/doc/salome/gui/VISU/files/setting_properties_of_xy_plots.htm +++ b/doc/salome/gui/VISU/files/setting_properties_of_xy_plots.htm @@ -15,25 +15,19 @@ if (navigator.appName !="Netscape") -

                                  Vector Field Presentation

                                  +

                                  Vectors Presentation

                                  Vector Field  presentation visualizes vectors of the corresponding cells of the mesh in graphical @@ -171,7 +171,7 @@ else

                                • Scalar Bar tab allows to define the parameters of the scalar bar displayed - along with this presentation (see + with this presentation (see also).

                                @@ -184,14 +184,14 @@ else

                                 

                                -

                                                        

                                +

                                          

                                 

                                 

                                -Related Topics +Related Topics

                                diff --git a/doc/salome/gui/VISU/gauss_points_presentation.htm b/doc/salome/gui/VISU/gauss_points_presentation.htm new file mode 100755 index 00000000..40b89f2d --- /dev/null +++ b/doc/salome/gui/VISU/gauss_points_presentation.htm @@ -0,0 +1,132 @@ + + + + + +Gauss Points Presentation + + + + + + + + + + + + +

                                Creating a Gauss Points Presentation

                                + +

                                To create a Gauss Points  presentation:

                                + +

                                 

                                + +

                                - Right-click on one of the time stamps of + the field in the Object browser and from the pop-up menu choose Gauss Points, or

                                + +

                                - Click on one of the time stamps of the field + in the Object browser and select from the main menu Visualization + > Gauss Points, or click icon + in the Visualization Toolbar.

                                + +

                                 

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Now you can choose the Type + of your Gauss Points presentation and Primitives + used for visualisation of the points and set their properties.

                                + +

                                You can also change the Scalar + Bar properties

                                + +

                                 

                                + +

                                To exit the dialog and apply choices press + OK button, or press CANCEL + button to quit.

                                + + + + diff --git a/doc/salome/gui/VISU/gauss_viewer.htm b/doc/salome/gui/VISU/gauss_viewer.htm new file mode 100755 index 00000000..076016bd --- /dev/null +++ b/doc/salome/gui/VISU/gauss_viewer.htm @@ -0,0 +1,192 @@ + + + + + +Gauss Viewer + + + + + + + + + + + + +

                                Gauss Viewer

                                + +

                                Gauss Points Viewer is the viewer + specially developed to display Gauss + Points Presentations in Post-Pro + Module.

                                + +

                                 

                                + +

                                The viewer is activated automatically when you choose to create a Gauss + Points Presentation.

                                + +

                                Right mouse-click on the Presentation gives access to the following + options:

                                + +

                                 

                                + +

                                + +

                                 

                                + +
                                  + +
                                • Rename + - allows to rename the presentation.

                                • + +
                                • Edit - + allows to return to Gauss + Points Properties menu and change the parameters of a presentation +

                                • + +
                                • Copy - + allows to create a copy of the presentation in the same subfolder (time + stamp) in the Object Browser.

                                • + +
                                • Erase + - allows to hide the selected presentation from the viewer.

                                • + +
                                • Display Only + - allows to display only the selected presentation, hiding all other from + the viewer.

                                • + +
                                • Store current configuration + - allows to save the current layout + of the viewer (settings, position of windows, etc).

                                • + +
                                • Dump view - exports + an object from the viewer in bmp, png, jpg or jpeg image format.

                                • + +
                                • Change + Background - allows to change the properties of the background.

                                • +
                                + +

                                 

                                + +

                                Most operations available via Viewer Toolbar are common with VTK 3D Viewer.

                                + +

                                However, some of them are used only in Gauss Points Viewer.

                                + +

                                 

                                + +
                                  + +
                                •   These buttons are used for Recording.

                                • + +
                                • Interaction + Style Switch - allows to switch between two the modes of mouse + manipulation.

                                • + +
                                • Salome Standard Controls + - allows to manipulate objects in the + viewer with the mouse and locked Ctrl button: increase or decrease the + zoom ratio with the left mouse button, translate object in any direction + with the central mouse button or rotate it with the right mouse button. +

                                • + +
                                • Keyboard Free - allows to manipulate objects in the viewer + with the mouse without locking Ctrl button. In + this case the operations are assigned to the buttons differently: rotation + is made with the left button, translation with the right and zoom with + both pressed in the same time.   

                                • + +
                                • Selection + Mode Switch - activates Picking. +

                                • + +
                                • Plane + Segmentation - activates Segmentation.

                                • +
                                + + + + diff --git a/doc/salome/gui/VISU/image1.gif b/doc/salome/gui/VISU/image1.gif new file mode 100755 index 00000000..28aeb027 Binary files /dev/null and b/doc/salome/gui/VISU/image1.gif differ diff --git a/doc/salome/gui/VISU/image1.jpg b/doc/salome/gui/VISU/image1.jpg new file mode 100755 index 00000000..b510c206 Binary files /dev/null and b/doc/salome/gui/VISU/image1.jpg differ diff --git a/doc/salome/gui/VISU/image10.gif b/doc/salome/gui/VISU/image10.gif new file mode 100755 index 00000000..44d57654 Binary files /dev/null and b/doc/salome/gui/VISU/image10.gif differ diff --git a/doc/salome/gui/VISU/image11.gif b/doc/salome/gui/VISU/image11.gif new file mode 100755 index 00000000..e90f424f Binary files /dev/null and b/doc/salome/gui/VISU/image11.gif differ diff --git a/doc/salome/gui/VISU/image12.gif b/doc/salome/gui/VISU/image12.gif new file mode 100755 index 00000000..202ae2f0 Binary files /dev/null and b/doc/salome/gui/VISU/image12.gif differ diff --git a/doc/salome/gui/VISU/image13.gif b/doc/salome/gui/VISU/image13.gif new file mode 100755 index 00000000..dc926bc2 Binary files /dev/null and b/doc/salome/gui/VISU/image13.gif differ diff --git a/doc/salome/gui/VISU/image14.gif b/doc/salome/gui/VISU/image14.gif new file mode 100755 index 00000000..55df4b72 Binary files /dev/null and b/doc/salome/gui/VISU/image14.gif differ diff --git a/doc/salome/gui/VISU/image17.gif b/doc/salome/gui/VISU/image17.gif index 6c6272e6..310835c6 100755 Binary files a/doc/salome/gui/VISU/image17.gif and b/doc/salome/gui/VISU/image17.gif differ diff --git a/doc/salome/gui/VISU/image18.gif b/doc/salome/gui/VISU/image18.gif new file mode 100755 index 00000000..5ac78adf Binary files /dev/null and b/doc/salome/gui/VISU/image18.gif differ diff --git a/doc/salome/gui/VISU/image19.gif b/doc/salome/gui/VISU/image19.gif new file mode 100755 index 00000000..ba85ee1d Binary files /dev/null and b/doc/salome/gui/VISU/image19.gif differ diff --git a/doc/salome/gui/VISU/image2.jpg b/doc/salome/gui/VISU/image2.jpg new file mode 100755 index 00000000..14d0076c Binary files /dev/null and b/doc/salome/gui/VISU/image2.jpg differ diff --git a/doc/salome/gui/VISU/image20.gif b/doc/salome/gui/VISU/image20.gif index c1f66983..ce95d953 100755 Binary files a/doc/salome/gui/VISU/image20.gif and b/doc/salome/gui/VISU/image20.gif differ diff --git a/doc/salome/gui/VISU/image21.gif b/doc/salome/gui/VISU/image21.gif deleted file mode 100755 index 096940e6..00000000 Binary files a/doc/salome/gui/VISU/image21.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/image21.jpg b/doc/salome/gui/VISU/image21.jpg deleted file mode 100755 index c1bc42f8..00000000 Binary files a/doc/salome/gui/VISU/image21.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/image23.gif b/doc/salome/gui/VISU/image23.gif new file mode 100755 index 00000000..2340bc7d Binary files /dev/null and b/doc/salome/gui/VISU/image23.gif differ diff --git a/doc/salome/gui/VISU/image24.gif b/doc/salome/gui/VISU/image24.gif deleted file mode 100755 index 8be6303f..00000000 Binary files a/doc/salome/gui/VISU/image24.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/image25.gif b/doc/salome/gui/VISU/image25.gif deleted file mode 100755 index e9a5315b..00000000 Binary files a/doc/salome/gui/VISU/image25.gif and /dev/null differ diff --git a/doc/salome/gui/VISU/image26.gif b/doc/salome/gui/VISU/image26.gif new file mode 100755 index 00000000..0ce51b89 Binary files /dev/null and b/doc/salome/gui/VISU/image26.gif differ diff --git a/doc/salome/gui/VISU/image29.gif b/doc/salome/gui/VISU/image29.gif new file mode 100755 index 00000000..dfd5efca Binary files /dev/null and b/doc/salome/gui/VISU/image29.gif differ diff --git a/doc/salome/gui/VISU/image3.gif b/doc/salome/gui/VISU/image3.gif new file mode 100755 index 00000000..beb0d8ae Binary files /dev/null and b/doc/salome/gui/VISU/image3.gif differ diff --git a/doc/salome/gui/VISU/image3.jpg b/doc/salome/gui/VISU/image3.jpg new file mode 100755 index 00000000..ba114477 Binary files /dev/null and b/doc/salome/gui/VISU/image3.jpg differ diff --git a/doc/salome/gui/VISU/image30.gif b/doc/salome/gui/VISU/image30.gif new file mode 100755 index 00000000..6fd06b28 Binary files /dev/null and b/doc/salome/gui/VISU/image30.gif differ diff --git a/doc/salome/gui/VISU/image30.jpg b/doc/salome/gui/VISU/image30.jpg deleted file mode 100755 index 669cd35d..00000000 Binary files a/doc/salome/gui/VISU/image30.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/image31.gif b/doc/salome/gui/VISU/image31.gif new file mode 100755 index 00000000..4194350e Binary files /dev/null and b/doc/salome/gui/VISU/image31.gif differ diff --git a/doc/salome/gui/VISU/image31.jpg b/doc/salome/gui/VISU/image31.jpg new file mode 100755 index 00000000..8c20450c Binary files /dev/null and b/doc/salome/gui/VISU/image31.jpg differ diff --git a/doc/salome/gui/VISU/image33.jpg b/doc/salome/gui/VISU/image33.jpg new file mode 100755 index 00000000..5d7498c8 Binary files /dev/null and b/doc/salome/gui/VISU/image33.jpg differ diff --git a/doc/salome/gui/VISU/image34.gif b/doc/salome/gui/VISU/image34.gif new file mode 100755 index 00000000..d7e08607 Binary files /dev/null and b/doc/salome/gui/VISU/image34.gif differ diff --git a/doc/salome/gui/VISU/image34.jpg b/doc/salome/gui/VISU/image34.jpg new file mode 100755 index 00000000..066d6481 Binary files /dev/null and b/doc/salome/gui/VISU/image34.jpg differ diff --git a/doc/salome/gui/VISU/image35.gif b/doc/salome/gui/VISU/image35.gif new file mode 100755 index 00000000..e589eecf Binary files /dev/null and b/doc/salome/gui/VISU/image35.gif differ diff --git a/doc/salome/gui/VISU/image37.jpg b/doc/salome/gui/VISU/image37.jpg new file mode 100755 index 00000000..0ecec10c Binary files /dev/null and b/doc/salome/gui/VISU/image37.jpg differ diff --git a/doc/salome/gui/VISU/image38.gif b/doc/salome/gui/VISU/image38.gif new file mode 100755 index 00000000..c35ebd59 Binary files /dev/null and b/doc/salome/gui/VISU/image38.gif differ diff --git a/doc/salome/gui/VISU/image38.jpg b/doc/salome/gui/VISU/image38.jpg new file mode 100755 index 00000000..25d799e4 Binary files /dev/null and b/doc/salome/gui/VISU/image38.jpg differ diff --git a/doc/salome/gui/VISU/image39.gif b/doc/salome/gui/VISU/image39.gif new file mode 100755 index 00000000..b819977a Binary files /dev/null and b/doc/salome/gui/VISU/image39.gif differ diff --git a/doc/salome/gui/VISU/image4.jpg b/doc/salome/gui/VISU/image4.jpg new file mode 100755 index 00000000..1f2bec22 Binary files /dev/null and b/doc/salome/gui/VISU/image4.jpg differ diff --git a/doc/salome/gui/VISU/image40.gif b/doc/salome/gui/VISU/image40.gif new file mode 100755 index 00000000..e41e4a84 Binary files /dev/null and b/doc/salome/gui/VISU/image40.gif differ diff --git a/doc/salome/gui/VISU/image41.gif b/doc/salome/gui/VISU/image41.gif new file mode 100755 index 00000000..b70777a4 Binary files /dev/null and b/doc/salome/gui/VISU/image41.gif differ diff --git a/doc/salome/gui/VISU/image43.gif b/doc/salome/gui/VISU/image43.gif new file mode 100755 index 00000000..6700f007 Binary files /dev/null and b/doc/salome/gui/VISU/image43.gif differ diff --git a/doc/salome/gui/VISU/image44.gif b/doc/salome/gui/VISU/image44.gif new file mode 100755 index 00000000..8d1dc231 Binary files /dev/null and b/doc/salome/gui/VISU/image44.gif differ diff --git a/doc/salome/gui/VISU/image47.gif b/doc/salome/gui/VISU/image47.gif new file mode 100755 index 00000000..1d50b209 Binary files /dev/null and b/doc/salome/gui/VISU/image47.gif differ diff --git a/doc/salome/gui/VISU/image48.gif b/doc/salome/gui/VISU/image48.gif new file mode 100755 index 00000000..f980a5dd Binary files /dev/null and b/doc/salome/gui/VISU/image48.gif differ diff --git a/doc/salome/gui/VISU/image5.gif b/doc/salome/gui/VISU/image5.gif new file mode 100755 index 00000000..f04aa8a8 Binary files /dev/null and b/doc/salome/gui/VISU/image5.gif differ diff --git a/doc/salome/gui/VISU/image5.jpg b/doc/salome/gui/VISU/image5.jpg new file mode 100755 index 00000000..94f30a80 Binary files /dev/null and b/doc/salome/gui/VISU/image5.jpg differ diff --git a/doc/salome/gui/VISU/image6.gif b/doc/salome/gui/VISU/image6.gif new file mode 100755 index 00000000..e51bf5f4 Binary files /dev/null and b/doc/salome/gui/VISU/image6.gif differ diff --git a/doc/salome/gui/VISU/image7.gif b/doc/salome/gui/VISU/image7.gif new file mode 100755 index 00000000..13176c35 Binary files /dev/null and b/doc/salome/gui/VISU/image7.gif differ diff --git a/doc/salome/gui/VISU/image8.gif b/doc/salome/gui/VISU/image8.gif new file mode 100755 index 00000000..d47abd6d Binary files /dev/null and b/doc/salome/gui/VISU/image8.gif differ diff --git a/doc/salome/gui/VISU/new_topic.htm b/doc/salome/gui/VISU/new_topic.htm deleted file mode 100755 index 66b7afb7..00000000 --- a/doc/salome/gui/VISU/new_topic.htm +++ /dev/null @@ -1,155 +0,0 @@ - - - - - -New Topic - - - - - - - - - - - - -

                                Creating - tables from Cut Lines presentations

                                - -

                                In VISU you can create a table, which will - be composed of the scalar values applied to the cells forming a Cut Lines presentation.

                                - -

                                 

                                - -

                                To create a table from Cut Lines presentation:

                                - -

                                 

                                - -

                                1.  Create - a Cut Lines presentation.

                                - -

                                 

                                - -

                                2.  In - the Object Browser or in the viewer right-click on your presentation and - from the pop-up menu select Create or - Update Table

                                - -

                                 

                                - -

                                Your new table will be created and displayed - in the Object Browser.

                                - -

                                 

                                - -

                                This option also allows to - update your table after modifying the base Cut Lines presentation.   

                                - -

                                 

                                - -

                                 

                                - -

                                 

                                - -

                                - -Related Topics - - -

                                - -

                                 

                                - - - - diff --git a/doc/salome/gui/VISU/picking.htm b/doc/salome/gui/VISU/picking.htm new file mode 100755 index 00000000..ae7f82a0 --- /dev/null +++ b/doc/salome/gui/VISU/picking.htm @@ -0,0 +1,200 @@ + + + + + +Picking + + + + + + + + + + + + +

                                Picking

                                + +

                                Picking is a special + way of viewing Gauss Points presentations

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Picking mode is activated by selecting   button in the Gauss Viewer toolbar.

                                + +

                                Now if the cursor touches a point it is highlighted  with + triangular markers (pyramids). The cursor is dynamically generated so + that apexes of each pyramid touch the point sprite boundary, and the height + of the pyramid is fixed.

                                + +

                                To get information about the point click the left mouse button or press + S (or s) key of the keyboard.

                                + +

                                Once a point is selected, the presentation is centered around this point + and a semi-transparent window is displayed next to the selected point + and shows the following information:

                                + +
                                  + +
                                • The ID of the point within its parent mesh element

                                • + +
                                • Coordinates of the Gauss point

                                • + +
                                • In the case of a result at Gauss point: Scalar + value being inspected + all components individually

                                • + +
                                • Name of its parent mesh element

                                • +
                                + +

                                In addition, the active scalar bar is updated to highlight the corresponding + value of the selected scalar value by a black line.

                                + +

                                 

                                + +

                                All Picking preferences can be defined using Preferences, however, you + can customize them for the current presentation.

                                + +

                                 

                                + +

                                + +

                                 

                                + +
                                  + +
                                • Cursor + - allows to adjust the Size of + the cursor used for Picking (ranging from 0.1 to 1), the Height + of the pyramids (ranging from 0 to 10) and the Selection + cursor color.

                                • + +
                                • Tolerance + - defines at which distance of the cursor from the point it becomes selected + (ranges from 0.001 to 10).

                                • + +
                                • Information window + - allows to define the Transparency + (from 0% = opaque to 100% = transparent) and Position + of the window, which can be:

                                • + +
                                • Centred + below the point, or

                                • + +
                                • located at Top-left + corner of the 3D view

                                • + +
                                • Movement + of the Camera can also be define by + the user.

                                • + +
                                • Zoom + at first selected point - This value is used to define the focal + distance at the first selected point (at the end of the movement of the + camera). This value is a ratio that will be multiplied by the current + zoom value.

                                • + +
                                • Number + of steps between two positions - defines + the smoothness of camera movement at selection by the number of iterations. + If set to 1 the camera is zoomed and centered at the point momentarily. + Greater numbers mean very slow camera movement.   

                                • + +
                                • Display + parent mesh element - allows to visualize + or hide the parent mesh element of the selected gauss point.

                                • +
                                + +

                                 

                                + +

                                 

                                + + + + diff --git a/doc/salome/gui/VISU/pics/animation.jpg b/doc/salome/gui/VISU/pics/animation.jpg deleted file mode 100755 index eac0b736..00000000 Binary files a/doc/salome/gui/VISU/pics/animation.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/animation.png b/doc/salome/gui/VISU/pics/animation.png new file mode 100755 index 00000000..888fbf05 Binary files /dev/null and b/doc/salome/gui/VISU/pics/animation.png differ diff --git a/doc/salome/gui/VISU/pics/animationparam.jpg b/doc/salome/gui/VISU/pics/animationparam.jpg deleted file mode 100755 index 06da5a36..00000000 Binary files a/doc/salome/gui/VISU/pics/animationparam.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/arrangeactors.png b/doc/salome/gui/VISU/pics/arrangeactors.png new file mode 100755 index 00000000..8424e602 Binary files /dev/null and b/doc/salome/gui/VISU/pics/arrangeactors.png differ diff --git a/doc/salome/gui/VISU/pics/arrangeactors1.png b/doc/salome/gui/VISU/pics/arrangeactors1.png new file mode 100755 index 00000000..560272fa Binary files /dev/null and b/doc/salome/gui/VISU/pics/arrangeactors1.png differ diff --git a/doc/salome/gui/VISU/pics/buildprogress.png b/doc/salome/gui/VISU/pics/buildprogress.png new file mode 100755 index 00000000..8d1b1858 Binary files /dev/null and b/doc/salome/gui/VISU/pics/buildprogress.png differ diff --git a/doc/salome/gui/VISU/pics/cellselection.jpg b/doc/salome/gui/VISU/pics/cellselection.jpg deleted file mode 100755 index 26c83e5d..00000000 Binary files a/doc/salome/gui/VISU/pics/cellselection.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/creatingcurves.png b/doc/salome/gui/VISU/pics/creatingcurves.png deleted file mode 100755 index afa025e6..00000000 Binary files a/doc/salome/gui/VISU/pics/creatingcurves.png and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cutlines.png b/doc/salome/gui/VISU/pics/cutlines.png index ac7346f1..22c9f964 100755 Binary files a/doc/salome/gui/VISU/pics/cutlines.png and b/doc/salome/gui/VISU/pics/cutlines.png differ diff --git a/doc/salome/gui/VISU/pics/cutlinesprsnt.jpg b/doc/salome/gui/VISU/pics/cutlinesprsnt.jpg deleted file mode 100755 index 22191fa9..00000000 Binary files a/doc/salome/gui/VISU/pics/cutlinesprsnt.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cutlinesprsnt.png b/doc/salome/gui/VISU/pics/cutlinesprsnt.png new file mode 100755 index 00000000..63b4fb04 Binary files /dev/null and b/doc/salome/gui/VISU/pics/cutlinesprsnt.png differ diff --git a/doc/salome/gui/VISU/pics/cutplanes.png b/doc/salome/gui/VISU/pics/cutplanes.png index 3ed63c93..579332ac 100755 Binary files a/doc/salome/gui/VISU/pics/cutplanes.png and b/doc/salome/gui/VISU/pics/cutplanes.png differ diff --git a/doc/salome/gui/VISU/pics/cutplpresent.jpg b/doc/salome/gui/VISU/pics/cutplpresent.jpg deleted file mode 100755 index c318c2ec..00000000 Binary files a/doc/salome/gui/VISU/pics/cutplpresent.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/cutplpresent.png b/doc/salome/gui/VISU/pics/cutplpresent.png new file mode 100755 index 00000000..e97ff562 Binary files /dev/null and b/doc/salome/gui/VISU/pics/cutplpresent.png differ diff --git a/doc/salome/gui/VISU/pics/display.jpg b/doc/salome/gui/VISU/pics/display.jpg deleted file mode 100755 index 2b8f9c21..00000000 Binary files a/doc/salome/gui/VISU/pics/display.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/display1.jpg b/doc/salome/gui/VISU/pics/display1.jpg deleted file mode 100755 index 19c9e364..00000000 Binary files a/doc/salome/gui/VISU/pics/display1.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/gpp2.png b/doc/salome/gui/VISU/pics/gpp2.png new file mode 100755 index 00000000..1562d03f Binary files /dev/null and b/doc/salome/gui/VISU/pics/gpp2.png differ diff --git a/doc/salome/gui/VISU/pics/gpp3.png b/doc/salome/gui/VISU/pics/gpp3.png new file mode 100755 index 00000000..128e22bb Binary files /dev/null and b/doc/salome/gui/VISU/pics/gpp3.png differ diff --git a/doc/salome/gui/VISU/pics/gpp6.png b/doc/salome/gui/VISU/pics/gpp6.png new file mode 100755 index 00000000..9408b33c Binary files /dev/null and b/doc/salome/gui/VISU/pics/gpp6.png differ diff --git a/doc/salome/gui/VISU/pics/graduatedaxes1.png b/doc/salome/gui/VISU/pics/graduatedaxes1.png new file mode 100755 index 00000000..cf021ba4 Binary files /dev/null and b/doc/salome/gui/VISU/pics/graduatedaxes1.png differ diff --git a/doc/salome/gui/VISU/pics/image100.gif b/doc/salome/gui/VISU/pics/image100.gif new file mode 100755 index 00000000..c44d68ff Binary files /dev/null and b/doc/salome/gui/VISU/pics/image100.gif differ diff --git a/doc/salome/gui/VISU/pics/image102.gif b/doc/salome/gui/VISU/pics/image102.gif new file mode 100755 index 00000000..4a4900fe Binary files /dev/null and b/doc/salome/gui/VISU/pics/image102.gif differ diff --git a/doc/salome/gui/VISU/pics/image103.gif b/doc/salome/gui/VISU/pics/image103.gif new file mode 100755 index 00000000..147612dc Binary files /dev/null and b/doc/salome/gui/VISU/pics/image103.gif differ diff --git a/doc/salome/gui/VISU/pics/image104.gif b/doc/salome/gui/VISU/pics/image104.gif new file mode 100755 index 00000000..584b367e Binary files /dev/null and b/doc/salome/gui/VISU/pics/image104.gif differ diff --git a/doc/salome/gui/VISU/pics/image105.gif b/doc/salome/gui/VISU/pics/image105.gif new file mode 100755 index 00000000..9d747861 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image105.gif differ diff --git a/doc/salome/gui/VISU/pics/image109.gif b/doc/salome/gui/VISU/pics/image109.gif new file mode 100755 index 00000000..5dbba464 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image109.gif differ diff --git a/doc/salome/gui/VISU/pics/image20.png b/doc/salome/gui/VISU/pics/image20.png new file mode 100755 index 00000000..2658973f Binary files /dev/null and b/doc/salome/gui/VISU/pics/image20.png differ diff --git a/doc/salome/gui/VISU/pics/image21.png b/doc/salome/gui/VISU/pics/image21.png new file mode 100755 index 00000000..6d7f7151 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image21.png differ diff --git a/doc/salome/gui/VISU/pics/image39.gif b/doc/salome/gui/VISU/pics/image39.gif new file mode 100755 index 00000000..0a7acc21 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image39.gif differ diff --git a/doc/salome/gui/VISU/pics/image81.gif b/doc/salome/gui/VISU/pics/image81.gif new file mode 100755 index 00000000..3473ad94 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image81.gif differ diff --git a/doc/salome/gui/VISU/pics/image82.gif b/doc/salome/gui/VISU/pics/image82.gif new file mode 100755 index 00000000..0d3b25ef Binary files /dev/null and b/doc/salome/gui/VISU/pics/image82.gif differ diff --git a/doc/salome/gui/VISU/pics/image83.gif b/doc/salome/gui/VISU/pics/image83.gif new file mode 100755 index 00000000..a40211e8 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image83.gif differ diff --git a/doc/salome/gui/VISU/pics/image84.gif b/doc/salome/gui/VISU/pics/image84.gif new file mode 100755 index 00000000..87e1105c Binary files /dev/null and b/doc/salome/gui/VISU/pics/image84.gif differ diff --git a/doc/salome/gui/VISU/pics/image87.gif b/doc/salome/gui/VISU/pics/image87.gif new file mode 100755 index 00000000..61e26b23 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image87.gif differ diff --git a/doc/salome/gui/VISU/pics/image88.gif b/doc/salome/gui/VISU/pics/image88.gif new file mode 100755 index 00000000..16cdbf73 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image88.gif differ diff --git a/doc/salome/gui/VISU/pics/image89.gif b/doc/salome/gui/VISU/pics/image89.gif new file mode 100755 index 00000000..373a6c02 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image89.gif differ diff --git a/doc/salome/gui/VISU/pics/image90.gif b/doc/salome/gui/VISU/pics/image90.gif new file mode 100755 index 00000000..3507814b Binary files /dev/null and b/doc/salome/gui/VISU/pics/image90.gif differ diff --git a/doc/salome/gui/VISU/pics/image91.gif b/doc/salome/gui/VISU/pics/image91.gif new file mode 100755 index 00000000..9e93c1c7 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image91.gif differ diff --git a/doc/salome/gui/VISU/pics/image96.gif b/doc/salome/gui/VISU/pics/image96.gif new file mode 100755 index 00000000..4580d5b5 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image96.gif differ diff --git a/doc/salome/gui/VISU/pics/image97.gif b/doc/salome/gui/VISU/pics/image97.gif new file mode 100755 index 00000000..1d78de1b Binary files /dev/null and b/doc/salome/gui/VISU/pics/image97.gif differ diff --git a/doc/salome/gui/VISU/pics/image98.gif b/doc/salome/gui/VISU/pics/image98.gif new file mode 100755 index 00000000..6519dbb6 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image98.gif differ diff --git a/doc/salome/gui/VISU/pics/image99.gif b/doc/salome/gui/VISU/pics/image99.gif new file mode 100755 index 00000000..3711be81 Binary files /dev/null and b/doc/salome/gui/VISU/pics/image99.gif differ diff --git a/doc/salome/gui/VISU/pics/iso.jpg b/doc/salome/gui/VISU/pics/iso.jpg deleted file mode 100755 index 0c1d46f2..00000000 Binary files a/doc/salome/gui/VISU/pics/iso.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/iso.png b/doc/salome/gui/VISU/pics/iso.png new file mode 100755 index 00000000..880ccb13 Binary files /dev/null and b/doc/salome/gui/VISU/pics/iso.png differ diff --git a/doc/salome/gui/VISU/pics/linewidth.png b/doc/salome/gui/VISU/pics/linewidth.png deleted file mode 100755 index e04538e8..00000000 Binary files a/doc/salome/gui/VISU/pics/linewidth.png and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/neo-transparency.png b/doc/salome/gui/VISU/pics/neo-transparency.png new file mode 100755 index 00000000..ec1fb7f7 Binary files /dev/null and b/doc/salome/gui/VISU/pics/neo-transparency.png differ diff --git a/doc/salome/gui/VISU/pics/opacity.png b/doc/salome/gui/VISU/pics/opacity.png deleted file mode 100755 index 273bd8c6..00000000 Binary files a/doc/salome/gui/VISU/pics/opacity.png and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/picking.png b/doc/salome/gui/VISU/pics/picking.png new file mode 100755 index 00000000..cea1a56c Binary files /dev/null and b/doc/salome/gui/VISU/pics/picking.png differ diff --git a/doc/salome/gui/VISU/pics/planes.png b/doc/salome/gui/VISU/pics/planes.png new file mode 100755 index 00000000..23fdc942 Binary files /dev/null and b/doc/salome/gui/VISU/pics/planes.png differ diff --git a/doc/salome/gui/VISU/pics/plot3d-example.png b/doc/salome/gui/VISU/pics/plot3d-example.png new file mode 100755 index 00000000..e2711dd0 Binary files /dev/null and b/doc/salome/gui/VISU/pics/plot3d-example.png differ diff --git a/doc/salome/gui/VISU/pics/plot3d.png b/doc/salome/gui/VISU/pics/plot3d.png new file mode 100755 index 00000000..f04ce94c Binary files /dev/null and b/doc/salome/gui/VISU/pics/plot3d.png differ diff --git a/doc/salome/gui/VISU/pics/pointselection.jpg b/doc/salome/gui/VISU/pics/pointselection.jpg deleted file mode 100755 index fd227511..00000000 Binary files a/doc/salome/gui/VISU/pics/pointselection.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/recording.png b/doc/salome/gui/VISU/pics/recording.png new file mode 100755 index 00000000..272386ae Binary files /dev/null and b/doc/salome/gui/VISU/pics/recording.png differ diff --git a/doc/salome/gui/VISU/pics/recordingsaveas.png b/doc/salome/gui/VISU/pics/recordingsaveas.png new file mode 100755 index 00000000..28dac73c Binary files /dev/null and b/doc/salome/gui/VISU/pics/recordingsaveas.png differ diff --git a/doc/salome/gui/VISU/pics/scaling.png b/doc/salome/gui/VISU/pics/scaling.png deleted file mode 100755 index 1b13a9c8..00000000 Binary files a/doc/salome/gui/VISU/pics/scaling.png and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/scalingicon.jpg b/doc/salome/gui/VISU/pics/scalingicon.jpg deleted file mode 100755 index 5acd2f57..00000000 Binary files a/doc/salome/gui/VISU/pics/scalingicon.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/selection1.jpg b/doc/salome/gui/VISU/pics/selection1.jpg deleted file mode 100755 index c93668ce..00000000 Binary files a/doc/salome/gui/VISU/pics/selection1.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/selmode.jpg b/doc/salome/gui/VISU/pics/selmode.jpg deleted file mode 100755 index c74a3c35..00000000 Binary files a/doc/salome/gui/VISU/pics/selmode.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/setupanimation.png b/doc/salome/gui/VISU/pics/setupanimation.png new file mode 100755 index 00000000..a7121fd4 Binary files /dev/null and b/doc/salome/gui/VISU/pics/setupanimation.png differ diff --git a/doc/salome/gui/VISU/pics/smds-example.png b/doc/salome/gui/VISU/pics/smds-example.png new file mode 100755 index 00000000..84d3a3d9 Binary files /dev/null and b/doc/salome/gui/VISU/pics/smds-example.png differ diff --git a/doc/salome/gui/VISU/pics/smds-example1.png b/doc/salome/gui/VISU/pics/smds-example1.png new file mode 100755 index 00000000..8085fea8 Binary files /dev/null and b/doc/salome/gui/VISU/pics/smds-example1.png differ diff --git a/doc/salome/gui/VISU/pics/smds1.png b/doc/salome/gui/VISU/pics/smds1.png new file mode 100755 index 00000000..24c5feda Binary files /dev/null and b/doc/salome/gui/VISU/pics/smds1.png differ diff --git a/doc/salome/gui/VISU/pics/spheroid.png b/doc/salome/gui/VISU/pics/spheroid.png new file mode 100755 index 00000000..162700b7 Binary files /dev/null and b/doc/salome/gui/VISU/pics/spheroid.png differ diff --git a/doc/salome/gui/VISU/pics/streamlinesprsnt.jpg b/doc/salome/gui/VISU/pics/streamlinesprsnt.jpg deleted file mode 100755 index 08846927..00000000 Binary files a/doc/salome/gui/VISU/pics/streamlinesprsnt.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/streamlinesprsnt.png b/doc/salome/gui/VISU/pics/streamlinesprsnt.png new file mode 100755 index 00000000..b04a0022 Binary files /dev/null and b/doc/salome/gui/VISU/pics/streamlinesprsnt.png differ diff --git a/doc/salome/gui/VISU/pics/translatepres.png b/doc/salome/gui/VISU/pics/translatepres.png new file mode 100755 index 00000000..f68ac955 Binary files /dev/null and b/doc/salome/gui/VISU/pics/translatepres.png differ diff --git a/doc/salome/gui/VISU/pics/vectorsprsnt.jpg b/doc/salome/gui/VISU/pics/vectorsprsnt.jpg deleted file mode 100755 index f8b359ed..00000000 Binary files a/doc/salome/gui/VISU/pics/vectorsprsnt.jpg and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/vectorsprsnt.png b/doc/salome/gui/VISU/pics/vectorsprsnt.png new file mode 100755 index 00000000..698a1e8c Binary files /dev/null and b/doc/salome/gui/VISU/pics/vectorsprsnt.png differ diff --git a/doc/salome/gui/VISU/pics/visucreatepresentation.png b/doc/salome/gui/VISU/pics/visucreatepresentation.png deleted file mode 100755 index 499359b5..00000000 Binary files a/doc/salome/gui/VISU/pics/visucreatepresentation.png and /dev/null differ diff --git a/doc/salome/gui/VISU/pics/warning.png b/doc/salome/gui/VISU/pics/warning.png new file mode 100755 index 00000000..55e06d36 Binary files /dev/null and b/doc/salome/gui/VISU/pics/warning.png differ diff --git a/doc/salome/gui/VISU/plot2d_viewer.htm b/doc/salome/gui/VISU/plot2d_viewer.htm new file mode 100755 index 00000000..0fe9c4d9 --- /dev/null +++ b/doc/salome/gui/VISU/plot2d_viewer.htm @@ -0,0 +1,243 @@ + + + + + +Plot2D Viewer + + + + + + + + + + + + +

                                Plot 2D viewer

                                + +

                                Plot 2d viewer is destined to + the representation of  2d + plots and graphs in Post-Pro module.

                                + +

                                Its viewer toolbar gives you fast access to the following operations:

                                + +

                                 

                                + +
                                  + +
                                • Dump + View - exports an object from the viewer in bmp, png, jpg or jpeg + image format.

                                • + +
                                •  Fit all - allows + to select a point to be the center of a scene. +

                                • + +
                                • Fit + area - resizes the view to place in the visible area only the contents + of a frame drawn with pressed left mouse button.

                                • + +
                                • Zoom + -  allows + to zoom in and out.

                                • + +
                                • Panning + - if the represented objects are greater that the visible area and you + don't wish to use Fit all functionality, + click on this button and you'll be able to drag the scene to see its remote + parts.

                                • + +
                                • Global + panning - represents all displayed objects in the visible area. +  

                                • + +
                                • Draw + Points - represents points on the graph.

                                • + +
                                • Draw + Lines - represents lines on the graph.

                                • + +
                                • Draw + Splines - represents splines on the graph.

                                • + +
                                • & Horizontal + axis logarithmic & Vertical axis logarithmic - changes the + scaling on axes to logarithmic.

                                • + +
                                • Show + Legend - reveals all verbal and numerical information on the graphs.

                                • + +
                                • Settings + - calls a menu, in which you can specify advanced settings for your Plot 2d Viewer.  

                                • + +
                                •  Clone view + - opens a new duplicate scene.

                                • +
                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                The options are as follows:

                                + +

                                 

                                + +
                                  + +
                                • Main + title: the title of the XY plot. By default, it will consist of + the names of the tables, on the basis of which the curve lines have been + constructed.

                                • + +
                                • Curve + type: you can select from Points, + Lines and Spline.

                                • + +
                                • Show + legend: Here you can define the position + of the description table on the XY plot (to the Left, + to the Right, on Top or on Bottom). +

                                • + +
                                • Marker + size - size of the points (markers) forming curve lines.

                                • + +
                                • Background + color of the XY plot

                                • + +
                                • Scale + mode: here you can select the type + of scaling (Linear or Logarithmic) along + X (Horizontal) or Y (Vertical) axes.

                                • +
                                + +

                                 

                                + +

                                You can define settings + for each axis separately:

                                + +

                                 

                                + +
                                  + +
                                • Horizontal + or Vertical axis title

                                • + +
                                • Grid/Axes + marks:  here + you can define the maximum number of major and minor scale divisions for + a specified axis. The real number of intervals fits to {1,2,5}*10N,  where + N is a natural number, and doesn't exceed the maximum.

                                • + +
                                • Save + settings as default: If this check box is marked, all XY plots + will be displayed with these defined properties.

                                • +
                                + +

                                 

                                + +

                                 

                                + + + + diff --git a/doc/salome/gui/VISU/plot_3d_presentation.htm b/doc/salome/gui/VISU/plot_3d_presentation.htm new file mode 100755 index 00000000..55f48032 --- /dev/null +++ b/doc/salome/gui/VISU/plot_3d_presentation.htm @@ -0,0 +1,198 @@ + + + + + +Plot 3D presentation + + + + + + + + + + + + +

                                Plot 3D presentation

                                + +

                                Plot 3D is a presentation + of scalar values of meshes lying on a cutting plane. The relief and coloring + of the resulting presentation both correspond to the values applied to + the cells of the mesh.

                                + +

                                 

                                + +

                                To + create a Plot 3D presentation:

                                + +

                                 

                                + +

                                - Right-click on one + of the time stamps of the field in the Object browser and from the pop-up + menu choose Plot 3D, or

                                + +

                                - Click on one of the + time stamps of the field in the Object browser and select from the main + menu Visualization > Plot 3D, + or click icon in + the Visualization Toolbar.

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Plot + 3D Definition tab allows you to set additional parameters of your + Plot 3D presentation:

                                + +

                                 

                                + +
                                  + +
                                • Orientation + radio buttons allow to set the orientation of cut plane in 3D space. You + should select two of three axis (XY, YZ, or ZX) in which the plane will + be located in 3D space. If the mesh is 2D this functionality is disable, + as there exist only one plane for a Plot 3D.  

                                • + +
                                • Rotations + of the planes in 3d space around the axes of the selected orientation. + (The angle of rotation is set in degrees.)

                                • + +
                                • Position + - allows to select the position of the plane in the object (ranging from + 0 to 1). The value 0.5 corresponds to cutting by halves.

                                • + +
                                • Relative + check box allows to increase / decrease the value by decimal steps.  

                                • + +
                                • Scale + Factor - visualization + scaling of all vector values applied to the cells of the mesh.

                                • + +
                                • Presentation + type:

                                • + +
                                • Surface + - Plot 3D will be represented with a smooth surface.

                                • + +
                                • Contour + - Plot 3D will be represented with a set of contours

                                • + +
                                • Number + of contours - allows to define the number of contours (active when + Contour presentation type is selected).

                                • + +
                                • Preview + cutting plane checkbox allows to see the position of the cutting + plate in the Viewer while defining the presentation.

                                • +
                                + +

                                 

                                + +

                                Scalar Bar + tab allows to define the parameters of the scalar bar displayed + with this presentation (see + also).

                                + +

                                 

                                + +

                                After you have finished with setting these + parameters, click OK. Your presentation +  will be + immediately displayed in the viewer:

                                + +

                                 

                                + +

                                + + + + diff --git a/doc/salome/gui/VISU/primitive_types.htm b/doc/salome/gui/VISU/primitive_types.htm new file mode 100755 index 00000000..c2e39266 --- /dev/null +++ b/doc/salome/gui/VISU/primitive_types.htm @@ -0,0 +1,216 @@ + + + + + +Primitive Types + + + + + + + + + + + + +

                                Primitive Types

                                + +

                                Gauss Point presentations + use primitives to visualize the value of the results obtained during calculations + so that the color and relative size of the points depend on each component + of a vector, tensor or matrix (e.g. scalar and module for vectors). Of + course, the size of primitives in the Viewer also depends on their location + within the 3D scene. At a given computed size, a primitive will be bigger + when it is close to the camera and smaller at a distance.  

                                + +

                                There are three Basic primitive types which can be used in Gauss Points + presentations: Point Sprites, Open GL + Points and Geometrical Spheres.

                                + +

                                 

                                + +

                                Point Sprites

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Each Point Sprite is visualised + in 3D Viewer with two 16*16 textures: Main + texture which defines the shape of the point sprite and Alpha + Channel Texture which defines the transparency of the point sprite. + By default Salome suggests textures defined in the Preferences, however + you can browse for other .bmp, .png or .jpg files to be used as textures. +

                                + +

                                Alpha Channel Threshold defines + the level of transparency ranging from 0 to 1.

                                + +

                                The default sizes of point sprites are computed by the system, therefore, + these parameters cannot be defined in the preferences, however, the Maximum Size of the point sprite is + limited (Clamp) so that the whole scene would remain visible if the user + applies a high zoom factor. Maximum Size + corresponds to the maximum size of a point sprite during rendering whatever + is the magnification of the point or the zoom of the view. Technically, + it corresponds to setting up a clamp in the vertex shader. The Size is + measured in pixels and belongs to the interval from 1 to 512.

                                + +

                                 

                                + +

                                OpenGL Points

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + +

                                OpenGL Points don't use any + files as textures, displaying results as simple OpenGL points, so the + only parameter relevant to them is the Maximum + Size.

                                + +

                                 

                                + +

                                Geometrical Spheres

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Geometrical Spheres display results using a standard sphere with + a number of faces be defined thought a Resolution + parameter. By default the Resolution + is set to 8. This number corresponds to the Latitude and Longitude definitions + of a VTK sphere. The Number of Faces + parameter is equal to the total number of points in the scene when no + segmentation cursor is used or number of points within the cursor when + a segmentation is in progress, multiplied by the number of faces of one + Sphere in the current resolution. This value computed by the system using + the formula: NbrFaces = 2*Resolution x  [Resolution-2] + and displayed to the end-user for information purpose.

                                + +

                                in + the pictures you can see the spheres with Resolution + of 8  and + 6

                                + +

                                 

                                + +

                                Notify + when number of faces exceeds prompts the user by a dialog to continue + or to cancel the display operation if the number of faces is greater than + the number defined in the menu.

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + + + + diff --git a/doc/salome/gui/VISU/scalar_bar.htm b/doc/salome/gui/VISU/scalar_bar.htm new file mode 100755 index 00000000..a2f0a99d --- /dev/null +++ b/doc/salome/gui/VISU/scalar_bar.htm @@ -0,0 +1,230 @@ + + + + + +Scalar Bar + + + + + + + + + + + + +

                                Scalar Bar

                                + +

                                Gauss Points Presentations + presume that two different scalar bars are displayed simultaneously:

                                + +

                                The Global scale corresponds to the minimum and maximum values founded + for the variable at all time stamps (located on the left side). When active, + the second is displayed in grey and disabled. The Local scale defines + the minimum and maximum values at the current time stamp for the variable + (located on the right side). When the Local scale is active, the Global + scale shows its limits 2 black lines.

                                + +

                                 

                                + +

                                The dialog allows user to define the characteristics of the scalar bars + displayed within the scene.

                                + +

                                 

                                + +

                                + +

                                 

                                + +
                                  + +
                                • Active bar

                                • + +
                                • Local: + when selected, the Local bar will + be active and colors used for rendering of the results will be taken from + this bar. If displayed, the Global + bar will be displayed in grey and 2 markers will define the limits of + the local min/max range.

                                • + +
                                • Global: + when selected, the Global bar + will be active and colors used for rendering of the results will be taken + from this bar (i.e.: not all colors may be used to display results at + a given time stamp). Local bar + will be displayed in grey  and + inactive.

                                • + +
                                • Displayed: + when checked, the Global bar is + displayed, else it is not seen. This control is systematically checked + and disabled when the Global bar + is defined as active.

                                • + +
                                • Scalar range

                                • + +
                                • Scalar + Mode: this feature allows refining + the value to be inspected:

                                • + +
                                • Modulus: value + of a scalar or modulus of a vector.

                                • + +
                                • Component N: Nth + component of a vector, a tensor or a matrix.

                                • + +
                                • Colors and labels

                                • + +
                                • Bicolor: + only 2 colors are used for the active + bar:

                                • + +
                                • Red + for positive values

                                • + +
                                • Blue for negative values

                                • +
                                + +

                                These colors also correspond + to the colors associated to min/max values of the palette option.

                                + +
                                  + +
                                • Rainbow: + A palette of several colors will be used to render the results. A regular + and linear progression is considered from min to max.

                                • + +
                                • Nb. + of colors: defines the number of color to design the palette (up + to 256 colors can be used).

                                • + +
                                • Nb. + of labels: defines the number of labels to be written in the bar + as text markers.

                                • + +
                                • Orientation - allows to choose between Vertical + and Horizontal + orientation.

                                • + +
                                • Origin + - allows to define placement and lookout + of Scalar Bars

                                • + +
                                • X: + abscissa of the point of origin (from + the left side)

                                • + +
                                • Y: + ordinate of the origin of the bar (from + the bottom)

                                • + +
                                • Dimensions + - allows to define Width and Height + of each bar.

                                • + +
                                • Spacing + -  space + between the bars (only if both are displayed).

                                • + +
                                • Text + properties: allows to define properties + of font and text associated to the active bar.

                                • + +
                                • Save + as default values - allows to save + the parameters defined by the user as default.

                                • +
                                + +

                                 

                                + + + + diff --git a/doc/salome/gui/VISU/scalar_map_on_deformed_shape_presentation.htm b/doc/salome/gui/VISU/scalar_map_on_deformed_shape_presentation.htm new file mode 100755 index 00000000..43253209 --- /dev/null +++ b/doc/salome/gui/VISU/scalar_map_on_deformed_shape_presentation.htm @@ -0,0 +1,186 @@ + + + + + +Scalar Map on Deformed Shape presentation + + + + + + + + + + + + +

                                Scalar Map on Deformed Shape presentation

                                + +

                                Scalar Map on Deformed + Shape presentation is a mix of the two: Scalar Map and Deformed + Shape. In this presentation the Scalar Map is built on a Deformed + Shape.

                                + +

                                 

                                + +

                                To + create a Scalar Map on Deformed Shape presentation:

                                + +

                                 

                                + +

                                - Right-click on one + of the time stamps of the field in the Object browser and from the pop-up + menu choose Scalar Map on Deformed Shape, + or

                                + +

                                - Click on one of the + time stamps of the field in the Object browser and select from the main + menu Visualization > Scalar Map on + Deformed Shape, or click icon + in the Visualization Toolbar.

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Scalar + Map on Deformed Shape tab allows you to set additional parameters + of your Scalar Map on Deformed Shape presentation:

                                + +

                                 

                                + +
                                  + +
                                • Scale + Factor: visualization scaling of all vector values applied to the + cells of the mesh.

                                • + +
                                • Fields: + allows to choose type of fields on which the presentation will be built. +

                                • + +
                                • Time + Stamp:  allows + to choose the time stamp on which the presentation will be built.

                                • +
                                + +

                                  

                                + +

                                Scalar Bar + tab allows to define the parameters of the scalar bar displayed + with this presentation (see + also).

                                + +

                                 

                                + +

                                After you have finished with setting these + parameters, click OK. Your presentation + will be immediately displayed in the viewer.

                                + +

                                 

                                + +

                                Compare ordinary Scalar Map presentation

                                + +

                                with Scalar Map on Deformed Shape presentation +

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + + + + diff --git a/doc/salome/gui/VISU/segmentation.htm b/doc/salome/gui/VISU/segmentation.htm new file mode 100755 index 00000000..c79399a2 --- /dev/null +++ b/doc/salome/gui/VISU/segmentation.htm @@ -0,0 +1,203 @@ + + + + + +Segmentation + + + + + + + + + + + +

                                Segmentation

                                + +

                                Segmentation is + a functionality similar to Clipping + in Mesh and Geom + modules.

                                + +

                                Segmentation can be activated + by clicking (Plane Segmentation) + or (Sphere Segmentation) + button in the Gauss Viewer toolbar.

                                + +

                                Once the command is activated, a new window, below the main 3D view + is created to display the content of the segmentation cursor. A dialog + box is also displayed to manually configure the segmentation cursor parameters.

                                + +

                                The Main view (top) shows the + results at Gauss points with scalar bars. A semi-transparent Segmentation + Cursor defines the part of the variables to be inspected.  Two + different presentations for Gauss points are used, depending on location + of the points: Inside or Outside the segmentation cursor.

                                + +

                                The Secondary view (bottom) + is also called Segmentation Viewer. + It shows, in real time, the results at Gauss points only (no mesh elements) + that are located inside the segmentation cursor. Gauss points are displayed + in the same way as Inside points + in the first view. This view is automatically updated when the cursor + is changed in the first view.

                                + +

                                Gauss Points tab of the Segmentation + menu allows to define visualization parameters for Inside and Outside + cursor Gauss Points.  See + Primitives + and Presentations + to learn about parameters definable in this tab.

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Plane segmentation  is + characteristic for its Segmentation Cursor in the form of a box with an + axis to define its orientation and two planes defining its upper and lower + boundaries.

                                + +

                                It can be defined in Segmentation Cursor tab, which allows to define + coordinates of origin, direction and depth of the segmentation plane. +

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Actually it is also possible to edit these parameters directly with + the mouse in the main 3D view :

                                + +

                                • Translation (dragging) of the lower plane along the V axis changes + the Origin of the cursor

                                + +

                                • Rotating the V axis around its origin defines a new Direction + for the cursor

                                + +

                                • Dragging the upper plane along its axis changes the Depth + of the cursor. It is not possible to move the lower above the upper plane + (minimum depth is 0).

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                Sphere segmentation  is + characteristic for its Segmentation Cursor in the form of a sphere with + an axis to define its orientation.

                                + +

                                It can be defined in Segmentation Cursor tab, which allows to define + coordinates of origin, and radius of the segmentation plane.

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                The Origin can also be changed + in the 3D Viewer by dragging the Sphere with the mouse .

                                + +

                                 

                                + +

                                When the user exits the Segmentation + menu, the function is ended and the second view (segmentation cursor viewer) + is erased.

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + +

                                  

                                + +

                                 

                                + +

                                 

                                + +

                                 

                                + + + + diff --git a/doc/salome/gui/VISU/types_of_gauss_points_presentations.htm b/doc/salome/gui/VISU/types_of_gauss_points_presentations.htm new file mode 100755 index 00000000..7ec8dea8 --- /dev/null +++ b/doc/salome/gui/VISU/types_of_gauss_points_presentations.htm @@ -0,0 +1,216 @@ + + + + + +Types of Gauss Points Presentations + + + + + + + + + + + + +

                                Types of Gauss Points Presentations

                                + +

                                There exist three + different types of Gauss Points Presentations: Results + at Gauss Points,  Gauss + Points on Geometry and Gauss Points + on Deformed Shape. They all can be accessed from the same menu.

                                + +

                                 

                                + +

                                Results at Gauss Points

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                To create a Results at Gauss Points + presentation, select Results radio + button. This presentation gives most information as the points here vary + in color and size depending on the value.

                                + +

                                As for the size, the minimum and maximum Range + values for the rendering can be defined in the configuration dialog. + These values are multiplied by a reference length (representative of the + average size of cells of the mesh) to define the range for minimum and + maximum size of a point during rendering (at magnification = 100%). Default + values are:

                                + +
                                  + +
                                • For the Rainbow + scale: min = 10%, max = 33%

                                • + +
                                • Min. size will be associated + to the smallest real value (included negative values) among the results.

                                • + +
                                • Max size will be associated + to the largest real values among the results.

                                • + +
                                • For the bicolor scale: + min = 0 (not editable), max = 33%

                                • + +
                                • Null size will be associated + to the 0 scalar value of a result.

                                • + +
                                • Max size will be associated + to the largest absolute values of results

                                • +
                                + +

                                Both values are dynamically updated by the system according to the selected + scalar bar. In the case of a Bicolor + scale, the minimum value is set to 0 in the dialog and the control is + disabled.

                                + +

                                Magnification (%) corresponds + to the change of size of results at Gauss point primitives in 2D space. + Acceptable values range from 0 to N; 100% means no magnification, 50% + means half of its size, 200% mean twice its size and so forth. By default + this value is set to 100%.

                                + +

                                +/- Ratio corresponds to the + number by which the magnification will be respectively multiplied or divided + at edition, ranging from 0.01 to 10. By default this value is set to 2.

                                + +

                                During rendering of the scene, it is possible to modify the magnification + (multiply/divide by the magnification ratio) by using ‘M’ and ‘m’ keys + of the keyboard when the 3D view is active. The effect is applied immediately. + The ratio is only defined through the dialog box.

                                + +

                                 

                                + +

                                 

                                + +

                                Gauss Points on Geometry

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                To create a Geometry presentation, + select the respective + radio button. This presentation shows only geometrical position + of Gauss Points as their size and color are fixed (because the results + are not computed).

                                + +

                                Size defines a value that will + be multiplied by a reference length (representative of the average size + of cells of the mesh) to define the size of points during rendering (at + magnification = 100%). Default values 10%.

                                + +

                                Magnification and Ratio + have the same meaning as for Results at Gauss points presentation.

                                + +

                                Color allows to define the unique + color for Gauss Points in a  standard + color configuration dialog.

                                + +

                                 

                                + +

                                Gauss Points on Deformed Shape

                                + +

                                 

                                + +

                                + +

                                 

                                + +

                                To create a Deformed Shape presentation, + select the respective + radio button. This presentation is analog to Results + at Gauss Points except that the shape on which the points are located + is deformed using the Scale Factor + and the Gauss Points are processed only after that.

                                + + + + diff --git a/doc/salome/gui/VISU/visu.log b/doc/salome/gui/VISU/visu.log index 1bd36f31..fd3080bf 100755 --- a/doc/salome/gui/VISU/visu.log +++ b/doc/salome/gui/VISU/visu.log @@ -131,8 +131,8 @@ whskin_frmset01.htm visu_hha.hhk visu.hhc visu.hhk +animation_in_gauss_viewer.htm clipping.htm -creating_plot2d_presentations_from_tables.htm creating_tables.htm files\about_structure_of_med_object.htm files\about_tables.htm @@ -147,21 +147,17 @@ files\cut_lines_resentation.htm files\deformed_shape_presentation.htm files\displaying_hiding_presentations.htm files\displaying_tables.htm -files\editing_field_presentations.htm -files\exploring_med_files.htm files\getting_elements_attributes.htm files\getting_started.htm files\importing_med_objects.htm files\importing_tables.htm files\insideframe.htm -files\introduction_to_visu.htm +files\introduction.htm files\iso_surfaces_presentation.htm files\points.htm -files\renaming_presentations.htm files\running_visu.htm files\scalar_map_presentation.htm files\scaling_presentations.htm -files\selection_in_visu.htm files\setting_properties_of_xy_plots.htm files\shrink.htm files\stream_lines_presentation.htm @@ -170,97 +166,170 @@ files\surfaceframe.htm files\sweeping.htm files\vectors_presentation.htm files\wireframe.htm -new_topic.htm +gauss_points_presentation.htm +gauss_viewer.htm +picking.htm +plot2d_viewer.htm +plot_3d_presentation.htm +primitive_types.htm +scalar_bar.htm +scalar_map_on_deformed_shape_presentation.htm +segmentation.htm +types_of_gauss_points_presentations.htm +vtk_3d_viewer.htm ehelp.xml robohhre.lng texture_horiz_ltbluebubbles.jpg visu.glo default.css +pics\smds-example.png +pics\image84.gif +pics\cutlinesprsnt.png +pics\smds1.png +image31.jpg pics\isosurfaces.png image20.jpg tip1.gif pics\scalarmapicon.jpg -image21.jpg +pics\arrangeactors1.png +pics\image96.gif +pics\cutplpresent.png +image40.gif note1.gif pics\wireframe.jpg pics\visuicon.jpg -pics\streamlines.png +pics\image97.gif +image41.gif +pics\plot3d.png +image30.gif +image33.jpg image20.gif +pics\image98.gif +pics\image87.gif +image34.jpg +image31.gif +pics\streamlines.png bgbaby.gif q_blue.jpg pics\cellsel.jpg -pics\vectorsprsnt.jpg pics\isosurf.jpg +pics\plot3d-example.png +pics\image99.gif +image43.gif +image10.gif +pics\image88.gif +pics\warning.png pics\setupplot2d.png pics\importtablefromfile.png -image21.gif pics\surface.jpg +image11.gif +pics\image89.gif +image44.gif +pics\buildprogress.png +pics\animation.png pics\fitdatarange.png image22.gif pics\begining.jpg -pics\iso.jpg -pics\linewidth.png +image23.gif +image1.jpg +image12.gif +image37.jpg +image34.gif pics\cutplanes.png pics\cutlinesicon.jpg -image24.gif +image2.jpg +pics\smds-example1.png +image13.gif +pics\image100.gif +pics\streamlinesprsnt.png +pics\image20.png +image38.jpg +image35.gif pics\clipping1.png pics\scalarrangesn.png -pics\opacity.png pics\streamlinesicon.jpg pics\defshapeicon.jpg -image25.gif +image3.jpg +image47.gif +image14.gif +pics\image21.png +pics\recording.png pics\clipping2.png more.jpg pics\speed.jpg pics\next.jpg pics\run.jpg -pics\selection1.jpg +image26.gif +image4.jpg +image1.gif pics\viewsettings.png +image48.gif +pics\image102.gif +pics\gpp2.png pics\textproperty.png image15.gif -pics\cutlinesprsnt.jpg pics\previous.jpg +image5.jpg +pics\image39.gif +pics\image103.gif +image38.gif +pics\gpp3.png pics\dumpviewtofile.png image27.gif pics\rename.png pics\deformedshape.png image16.gif image19.jpg -pics\cutplpresent.jpg -pics\pointselection.jpg -pics\scalingicon.jpg -pics\creatingcurves.png -pics\vectorfield.png +image3.gif +image39.gif image17.gif +pics\vectorsprsnt.png +pics\image104.gif +pics\vectorfield.png pics\points.jpg +image18.gif +pics\image90.gif +pics\image105.gif +pics\recordingsaveas.png +image29.gif pics\dataonelements1.png pics\snapfgf.png pics\visufullscreen.png pics\editplot2dpresentation.png pics\cutlines.png pics\importfromfile.png -pics\animationparam.jpg -pics\display.jpg +pics\arrangeactors.png +pics\graduatedaxes1.png +pics\image91.gif +image5.gif +image19.gif +pics\translatepres.png +pics\iso.png +pics\planes.png +pics\gpp6.png pics\dataonelements2.png pics\animatdef.jpg pics\end.jpg -pics\display1.jpg +pics\neo-transparency.png +pics\image81.gif +image6.gif +pics\picking.png pics\dataonelements3.png -pics\scaling.png pics\scalarbarproperties.png pics\cutlinesicn.jpg -pics\animation.jpg -pics\cellselection.jpg -pics\selmode.jpg -pics\visucreatepresentation.png +pics\image82.gif +image7.gif +pics\spheroid.png pics\viewtable.png pics\vecticon.jpg pics\shrink.jpg i_blue.jpg -image30.jpg +pics\image83.gif +pics\image109.gif +image8.gif +pics\setupanimation.png pics\exporttable.png pics\deformedshapesn.png -pics\streamlinesprsnt.jpg ehlpdhtm.js visu.ppf ss_btn_related_topics.gif @@ -280,6 +349,7 @@ whgdata\whlstt3.htm whgdata\whlstt4.htm whgdata\whlstt5.htm whgdata\whlstt6.htm +whgdata\whlstt7.htm whgdata\whlsti0.htm whgdata\whlstfl0.htm whgdata\whlstfl1.htm @@ -305,6 +375,7 @@ whgdata\whlstfl20.htm whgdata\whlstfl21.htm whgdata\whlstfl22.htm whgdata\whlstfl23.htm +whgdata\whlstfl24.htm whgdata\whlstf0.htm whgdata\whlstf1.htm whgdata\whlstf2.htm @@ -312,6 +383,9 @@ whgdata\whlstf3.htm whgdata\whlstf4.htm whgdata\whlstf5.htm whgdata\whlstf6.htm +whgdata\whlstf7.htm +whgdata\whlstf8.htm +whgdata\whlstf9.htm whgdata\whlstg0.htm visu.htm visu_csh.htm diff --git a/doc/salome/gui/VISU/vtk_3d_viewer.htm b/doc/salome/gui/VISU/vtk_3d_viewer.htm new file mode 100755 index 00000000..b0d69fed --- /dev/null +++ b/doc/salome/gui/VISU/vtk_3d_viewer.htm @@ -0,0 +1,235 @@ + + + + + +VTK 3D Viewer + + + + + + + + + + + + +

                                VTK 3D Viewer

                                + +

                                VTK + 3D viewer  is + used in Post-Pro module for visualization of all 3D Presentations except + for Gauss Points Presentations.

                                + +

                                 

                                + +

                                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.  

                                + +

                                 

                                + +

                                + +

                                 

                                + +
                                  + +
                                • Dump + View - exports an object from the viewer in bmp, png, jpg or jpeg + image format.

                                • + +
                                • Show/Hide + Trihedron - shows or hides coordinate axes. +

                                • + +
                                • Fit + all - allows to select a point to be the center of a scene representing + all displayed objects in the visible area. +

                                • + +
                                • Fit + area - resizes the view to place in the visible area only the contents + of a frame drawn with pressed left mouse button.

                                • + +
                                • Zoom -  allows + to zoom in and out.

                                • + +
                                • Panning + - if the represented objects are greater that the visible area and you + don't wish to use Fit all functionality, + click on this button and you'll be able to drag the scene to see its remote + parts.

                                • + +
                                • Global panning - represents all displayed + objects in the visible area.

                                • + +
                                • Rotation - allows to rotate the selected + object using the mouse.

                                • + +
                                • These + buttons orientate the scene strictly about coordinate axes.

                                • + +
                                • Reset - restores the default position + (isometric) of objects in the scene.

                                • + +
                                • Graduated axes - allows to define parameters + of axes and graduate them.

                                • +
                                + +

                                 

                                + +

                                + +

                                 

                                + +
                                  + +
                                • Axis name

                                • + +
                                • Is + visible - if checked the axis name + is displayed in the viewer.

                                • + +
                                • Name - allows to redefine the name of the axis.

                                • + +
                                • Font - allows to define color and properties + of the font of axis name.

                                • + +
                                • Labels

                                • + +
                                • Is + visible - if checked the labels are + displayed in the viewer.

                                • + +
                                • Number - allows to define the number of labels.

                                • + +
                                • Offset - allows to define the distance between + labels.

                                • + +
                                • Font - allows to define color and properties + of the font of labels names.

                                • + +
                                • Tick + marks

                                • + +
                                • Is + visible - if checked the tick marks + are displayed in the viewer.

                                • + +
                                • Length - allows to define the length of tick marks

                                • + +
                                • Is + visible if checked the axis is displayed + in the viewer.

                                • +
                                + +

                                 

                                + + + + diff --git a/doc/salome/gui/VISU/whdata/whftdata0.htm b/doc/salome/gui/VISU/whdata/whftdata0.htm index fc5b8b29..585498d1 100755 --- a/doc/salome/gui/VISU/whdata/whftdata0.htm +++ b/doc/salome/gui/VISU/whdata/whftdata0.htm @@ -12,8 +12,8 @@ diff --git a/doc/salome/gui/VISU/whdata/whfts.htm b/doc/salome/gui/VISU/whdata/whfts.htm index 2af843eb..83e0bfdc 100755 --- a/doc/salome/gui/VISU/whdata/whfts.htm +++ b/doc/salome/gui/VISU/whdata/whfts.htm @@ -10,7 +10,7 @@ diff --git a/doc/salome/gui/VISU/whdata/whfwdata0.htm b/doc/salome/gui/VISU/whdata/whfwdata0.htm index 293865bc..627d37dd 100755 --- a/doc/salome/gui/VISU/whdata/whfwdata0.htm +++ b/doc/salome/gui/VISU/whdata/whfwdata0.htm @@ -12,555 +12,828 @@ diff --git a/doc/salome/gui/VISU/whdata/whtdata0.htm b/doc/salome/gui/VISU/whdata/whtdata0.htm index 74d92dbc..13ef96d8 100755 --- a/doc/salome/gui/VISU/whdata/whtdata0.htm +++ b/doc/salome/gui/VISU/whdata/whtdata0.htm @@ -8,41 +8,50 @@ -<p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p> +<p>Your browser does not support frames. We recommend that you update your browser to a version that supports frames.</p><p>To view the Help system without frames click on this<a href="whgdata/whnvp30.htm">hyperlink.</a></p> \ No newline at end of file diff --git a/doc/salome/gui/VISU/whskin_info.htm b/doc/salome/gui/VISU/whskin_info.htm index 81097e6c..a83e95ca 100755 --- a/doc/salome/gui/VISU/whskin_info.htm +++ b/doc/salome/gui/VISU/whskin_info.htm @@ -9,7 +9,7 @@ - + diff --git a/doc/salome/gui/VISU/whstart.js b/doc/salome/gui/VISU/whstart.js index f6b8ef88..e7b94c46 100755 --- a/doc/salome/gui/VISU/whstart.js +++ b/doc/salome/gui/VISU/whstart.js @@ -34,7 +34,7 @@ function delayReload() var gsToolbarOrder = "toc|fts|glo|blankblock|searchform|banner"; var gsMinibarOrder = "blankblock|hide2|"; -var gsTopic = "files/introduction_to_visu.htm"; +var gsTopic = "files/introduction.htm"; var PANE_OPT_SEARCH = 1; var PANE_OPT_BROWSESEQ = 2; var gnOpts=-1; diff --git a/doc/salome/gui/VISU/whxdata/whftdata0.xml b/doc/salome/gui/VISU/whxdata/whftdata0.xml index 97051fc5..a1cf4e3e 100755 --- a/doc/salome/gui/VISU/whxdata/whftdata0.xml +++ b/doc/salome/gui/VISU/whxdata/whftdata0.xml @@ -1,7 +1,7 @@ + - @@ -16,23 +16,29 @@ - - - + - - - + + + + + + + + + + + diff --git a/doc/salome/gui/VISU/whxdata/whfts.xml b/doc/salome/gui/VISU/whxdata/whfts.xml index b2405547..e506161a 100755 --- a/doc/salome/gui/VISU/whxdata/whfts.xml +++ b/doc/salome/gui/VISU/whxdata/whfts.xml @@ -2,6 +2,6 @@ - + diff --git a/doc/salome/gui/VISU/whxdata/whfwdata0.xml b/doc/salome/gui/VISU/whxdata/whfwdata0.xml index 83b6beda..7fc7939d 100755 --- a/doc/salome/gui/VISU/whxdata/whfwdata0.xml +++ b/doc/salome/gui/VISU/whxdata/whfwdata0.xml @@ -1,553 +1,826 @@ - 0,6,30, - 4,5,7,2,10,15,14,16,17,18,21,33,27,28,29,31, - 6,30, - 29, - 4,5,7,2,10,15,14,16,17,21,33,27,28,29,31, - 7,10, - 7,11,19,29, - 4,5,7,10,21,27,31, - 3,11,12,18,20,22,26,28,6, - 5,7,10,27,31, - 5,0,29, - 31, - 29, + 0,1,31,33,34,37,6,26,38, + 31, + 38, + 4,5,7,2,10,15,14,19,31,33,32,34,6,27, + 31,38, + 0,31,6,26,38, + 32, + 34, + 4,5,7,2,10,15,14,19,32,34,35,27,38, + 7,38, + 35, + 7,11,17,33,32,25,38, + 4,5,7,10,19,24,27, + 38, + 3,0,1,11,12,14,30,16,20,31,33,34,23,24,37,6,38,39, + 5,7,10,24,27, + 5,1,33,32, + 38, + 34, + 34, + 34, + 18,32,39, + 37, + 35, + 38, + 27,38, + 30,32,6,25,38,39, 14, - 12,13,26,28,30,32, + 12,13,23,26,38,28, 3, - 30, - 27, - 18,28, - 5,12,13,14,16,23,25,26,30,32, - 5,0,29, - 11,17, - 4,5,7,2,11,12,13,14,16,20,23,33,26,27,28,29,30,31,32, - 11,13,18,23,27,29,30,32, - 24,6,30, - 0,11,12, - 5,19, - 5,31, - 5,12,28,30,31, - 3,4,18, - 26,27, - 5,7,10,14,24,26,28,6,29, - 3,8,2,11,12,13,18,23,33,26,30,31,32, - 20,25, - 30, - 0,11,12, + 26, + 0,24, + 31,33,35,38, + 30,31,37, + 0, + 16,6, + 37, + 0,31, + 5,12,13,14,21,33,22,36,23,26,28, + 5,1,31,25, + 32, + 5, + 11, + 4,5,0,1,7,11,12,13,14,30,18,21,31,33,32,35,36,23,24,37,6,25,26,27,38,28,39, + 16,32,24,37,6, + 34, + 5,26, + 6, + 0, + 38, + 1,11,12,33, + 5,17, + 5,0,6,27, + 5,12,26,27, + 3,4,0,30,16,18,34, + 1,29,23,24, + 31, + 0, + 5,7,10,14,23,25, + 3,8,2,11,12,13,16,21,33,34,36,23,26,27,38,28, + 18,22, + 32,26,39, + 11,12,31,33,37, + 6, 11, - 32, - 7,1, - 6, - 7,1,18, - 7,1, - 7,11,14,17,20,28,31, - 18,6,31, - 0,11,12,27,29, - 7,11,12,29, - 5,10,6, - 29, - 30, - 5,11,12,13,23,26,30,32, - 3,5,2,10,11,19,22,33,26,30,31, - 3,4,7,11,20,23,26,29,30, - 26,31, - 4, - 25, + 28, + 0, + 7,30, + 35,38, + 7,16,6, + 1,7,6, + 1,7,11,14,30,18,37,27, + 0,30,16,6,39, + 38, + 0, + 6, + 1,11,12,33,32,24,6,25,39, + 7,11,12,33,32,37,6,39, + 5,10, + 30,32,6,25, + 26, + 5,11,12,13,29,21,31,33,35,36,23,37,6,26,38,28, + 3,5,10,11,17,20,23,26,27, + 3,4,7,11,21,32,23,26, + 34,23,27, + 31, + 18,31, + 22, 5, - 11,26, - 32, - 28, - 8,29,30, - 29, - 30, - 3, - 5,7,10,11,12,13,17,18,20,21,24,26,27,28,6,29,30,32, - 3,5,7,8,9,2,10,11,12,13,15,14,16,17,20,21,23,33,24,26,28,6,30,31,32, - 5,0,10,14,21,23,24,26,27,28,6,30,32, - 3,26, - 27, - 16,20,26,28, - 3,4,8,2,11,12,13,18,23,33,26,28,6,30,31,32, - 18,28, - 32, - 16,24,27,28,6,29, - 18, - 5,7,11,12,13,26,29,30,32, - 7, + 11,34,23, + 31,37, + 0, + 35,38, + 34,28, + 31,35, + 18,35, + 30,32,34,6,39, + 8,30,33,35,25,26,38, + 32,35,37, + 26, + 37, + 3,31, + 5,0,7,10,11,12,13,14,16,18,19,33,32,23,24,37,26,38,28, + 3,5,0,7,8,9,2,10,11,12,13,15,14,29,30,18,19,21,33,34,36,23,24,6,26,27,28, + 18, + 18,36, + 5,0,1,10,14,29,30,19,21,31,33,32,23,24,37,6,26,38,28,39, + 32,37, + 3,34,23, + 31,34, + 29,34,24, + 34, + 30,31,23,38, + 6, + 3,4,8,2,11,12,13,16,21,33,36,23,26,27,38,28, + 16, + 32,28,39, + 31, + 31, + 30, + 6, + 5,0,14,29,30,32,24,37,6,25,38, + 34, + 16,35,37, + 5,7,11,12,13,18,33,32,35,23,6,26,28,39, + 33, 7, - 0,20,24,6, - 0,7,8,9,10,11,12,13,15,14,17,18,20,21,23,24,26,27,28,6,30,32, - 3,7,10,18,27,28,30, - 7,1, - 5,0,7,8,1,9,2,10,11,12,13,15,14,16,18,20,21,23,33,24,25,26,27,28,6,29,30,31,32, - 0, - 5, - 7,11,12,13,26,28,6,29,30,32, - 4,7,1, - 3,23, - 5,31, + 1,14,29,18, + 0,1,7,8,9,10,11,12,13,15,14,29,30,16,18,19,21,33,35,36,23,26,28, + 3,0,10,16,24,26, + 7, + 34, + 5,0,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,31,33,32,22,36,23,24,37,6,25,26,27,28,39, + 0,1,37,6, + 32, + 18,34, + 7,11,12,13,31,33,32,34,35,23,26,38,28,39, + 18, + 4,7, + 3,21, + 37, + 30,6, + 36, + 5,27, 3, - 0, - 30, - 4,17,20,22,25,26, - 3,5,2,10,33,31, - 6, - 30, - 32, + 18, + 1, + 26, + 4,20,31,34,22,35,23, + 3,5,2,10,27, + 34,38, + 26, + 28, 3, 3, - 20,24,27, - 10,11,26,29, - 3,11,23,26,29,30, - 7,11,30, - 30, - 3,7,8,9,10,11,21,26, + 37, + 30,38, + 14,18,24, + 35, + 10,11,32,23, + 3,7,11,21,32,23,26, + 11,26, + 26, + 3,7,8,10,11,18,19,23, + 0,32,37,39, 6, - 30, - 30, - 7,18,26, - 14, - 3,7,13,32, - 3,26, - 30, - 3,4,5,0,7,8,1,9,2,10,11,12,13,19,21,23,33,24,25,26,6,30,31,32, - 10,11,14,20,25,26,31, - 0,7,1, - 14, - 6,29, - 7,1,10,11,29, - 4,2,11,12,33,31, + 0,34, + 33, + 30,35,26,38, + 26, + 7,16,31,23,37,6,39, + 0, + 14,30,6, + 31, + 3,7,13,31,33,34,35,38,28, + 3,23, + 0, + 26, + 34, + 3,4,5,1,7,8,9,2,10,11,12,13,29,30,17,19,21,33,22,36,23,37,6,26,27,38,28, + 10,11,14,22,23,27, + 1,7,6, + 14,30, + 30,31,34,35,25, + 31,34,37, + 7,10,11,32,25, + 31, + 4,2,11,12,33, 5, - 7,1, - 3,4,7,11,19,20,22,26, - 5, - 7,11,12,13,25,26,29, - 3,0,11,12,13,23,26,29,30,31,32, - 3,5,10,12,18,28,6, - 13,31, + 7, + 3,4,7,11,17,18,20,23, + 33, + 5,30,33, + 7,11,12,13,18,32,34,22,35,23,38,39, + 3,0,1,7,11,12,13,21,31,33,32,34,35,36,23,37,25,26,27,38,28,39, + 37, + 3,5,10,12,16, + 33,34, + 13,36,38, 5, - 0,11,12, - 14,16, - 5, + 1,11,12,33, + 1,14, + 5,34,37,38, + 37, 4, - 29, - 28, - 25, - 5,22, - 7,1, - 5,7,10,11,17,18,20,21,24,26,27,28,6, - 7,1, - 3, - 26, - 30, + 32, + 35, + 22, + 5,20,32, + 30, + 7, + 5,0,7,10,11,14,29,16,18,19,34,35,23,24,37,38, + 7, + 3,30,35,37,38, + 35,23, + 37, + 30,37,26, 5, - 20, + 33,35,38, 11,12, - 4,5,7,8,9,2,10,11,12,13,15,14,16,17,18,20,23,33,26,28,6,29,30,31,32, - 0, - 3, - 29, - 29, - 7,1, - 5,14,28, - 7,1, - 29, - 14, - 3,28, - 10,11,12,14,16, - 0, - 3,18,28, + 4,5,0,1,7,8,9,2,10,11,12,13,15,14,30,16,18,21,31,33,32,34,35,36,23,37,6,25,26,27,28,39, + 1,31,34,24,6,39, + 3,38, + 32, + 32, + 32,34,39, + 7, + 5,14, + 7,39, + 32,37,39, + 32, + 32,39, + 30,32,6,25,39, + 14,32, + 31,38, + 34,35, + 3,6, + 10,11,12,14,30,37,6, + 38, + 38, + 38, + 1, + 18, + 3,16,31,37,6, + 35, 4, - 20, - 5,31, - 31, - 18,21,23,24,26,28, + 5,31,34,37,27, + 27, + 14,16,19,21,23, 11,12, - 3, - 30, - 23,26, - 14, + 3,18, + 26, + 21,34,23, + 14,30,37,6,25, + 30, 3,5, - 18, - 29, - 14, - 17,20,30, - 21, - 18, - 18, - 0, - 3, - 13,32, - 3,30, - 3, - 27,30, - 3,5,8,11,12,13,14,16,18,19,20,22,23,24,26,27,28,30,31,32, - 3,4,17,19,20,21,29, - 11,12,13,23,26,30,32, - 5,1, - 29, - 3,20,21, + 18, + 0,18, + 16, + 32, + 34, + 38,39, + 14,33,6,38, + 29,37, + 26, + 30,19,32,6,39, + 16, + 39, + 16, + 1, + 3,34, + 13,33,34,36,38,28, + 3,26, + 3,18, + 32, + 35,24,26, + 3,5,8,11,12,13,14,29,16,17,18,20,21,33,36,23,24,6,26,27,28, + 3,4,0,17,18,19,34,23,25, + 18, + 0,11,12,13,18,21,33,36,23,26,28, + 5,31,37, + 32,25,39, + 31,38, + 31, + 3,19, 3, - 3,5,7,8,10,18,21,24,25,26,28,6,29, - 26, - 2,18,22,33,29, - 30, - 5,31, - 23, - 20, - 16, - 4,7, + 3,5,1,7,8,10,14,30,16,19,31,32,22,23,6,25, + 35,23,39, + 2,16,20,32, + 30,32,6,39, + 34, + 38, + 26, + 35, + 0, + 5,0,32,27,39, + 21, + 30, + 18, + 37, + 39, + 4,0,7,33,32,37,39, + 34, + 0,29,30,31,34,35,37,38,39, 3, - 5,11,23,28,30,31, - 5,30, - 3, - 18, - 0,29, - 7,12, - 32, - 26, - 29, - 29, - 32, - 29, - 3,30, + 5,11,21,31,26,27, + 5,26, + 37, + 3,18,34,38, + 38, + 5,16,31, + 0,1,30,32,6,25,38, + 0,7,12,34,35, + 34, + 32,35,39, + 28, + 39, + 23, + 32,25, + 25, + 28, + 0,31,32,34,39, + 35, + 32, + 3,18,26, 7, - 0, - 30, - 10,11,21,30, - 32, - 26, + 38, + 1,33, + 26, + 10,11,19,26, + 28, + 31,35,23, 4, - 5,7,11,26,29, - 14,16, + 5,11,32,23,38, + 1,14,30,31,6,25,39, 14, - 18,28, - 14,28, - 26,29, - 19, - 11,12,13,23,25,26,27,6,30,32, - 18, - 0,7,11,14,18,26,28,29,30,32, - 0, - 6, - 11,12,13,14,18,20,23,26,30,32, - 4,7,9,17,19,20,21, - 26, - 26, - 3,22,30, - 5, + 34, + 18, + 16,31, + 14, + 1,32,35,23, + 17,18, + 35, + 11,12,13,29,21,33,22,36,23,26,28, + 16,31, + 5,0,1,7,11,14,16,18,31,33,32,34,35,23,26,28,39, + 1, + 0,30,32,6,39, + 1,11,12,13,14,16,18,21,33,36,23,26,38,28, + 4,7,9,17,18,19, + 23, + 6, + 35,23, + 3,0,20,26,38, + 5,30,33, 3, - 0, - 3,26, - 18, - 3,18, - 3,25,28,31, - 11, + 1, + 3,23, + 31, + 16,6, + 3,16,31,32,34,6,38, + 3,22,27, + 0, + 11,37, 6, - 17, - 30, + 31,35,37, + 26, 5, - 30, + 30, + 26, 3, - 29, - 22, - 23,31, - 23, - 10,20,21, - 26,29, - 26, + 0,32,34, + 20, + 11, + 21, + 21, + 39, + 10,18,19, + 31, + 30,32,6,39, + 30,32,34,6,39, + 0, + 31,38, + 30,31,38, + 35,23,25,39, + 23, + 38, 5, - 5,17,19,25, - 18, + 0, + 34, + 5,17,22, + 30,16, + 37, 7, - 10,28,29, - 7,1, - 29, - 30, - 26, - 3,25, - 4,7,1,2,10,11,33,6,29,30,32, - 29, - 3,5,10,30, - 20, - 11,12,21,30, - 26,29, - 25, - 30, - 13,30,32, - 3,5,8,10,11,12,13,14,17,18,21,23,26,27,28,6,29,30,32, - 29, - 8,28,30, - 5,16, - 4,11,12, - 26,31, - 7,11,29, - 1,29, - 30, - 26, - 23,29,30, - 30, - 5,0,7,8,1,9,2,10,11,12,13,15,14,16,17,18,20,21,23,33,24,25,26,27,28,6,29,30,31,32, - 3,11,12,13,18,19,6,30,32, + 10,30,31,32,35,39, + 7, + 32,25, + 26,38,39, + 0,23, + 34, + 3,22, + 34,35, + 4,7,2,10,11,31,32,35,6,26,28, + 32,35,25, + 3,5,1,10,26, + 0,32,39, + 18, + 35, + 8,11,12,19,31,33,35,37,6,26,38, + 0,34,37, + 30,39, + 32,23,25, + 34, + 22, + 35, + 26, + 0,37, + 18, + 33,6, + 38, + 34,38, + 13,26,28, + 3,5,8,10,11,12,13,14,29,16,19,21,33,32,34,36,23,37,26,28, + 32, + 8,26, + 5, + 30, + 30, + 4,11,12,37,6, + 36,23, + 7,11,32,39, + 31,32,35, + 26, + 34,35, + 18,35,38, + 23, + 21,32,34,35,26,38, + 31,38, + 34,26, + 5,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,33,32,34,22,36,23,37,6,25,26,27,38,28, + 6, + 3,11,12,13,16,17,31,33,36,37,26,38,28, 4, - 26, - 23,31, - 29, - 4,0,26,28,6,29,32, - 2,14,33, - 3,5,19,22,25,26,28, + 6, + 18,35,38, + 23, + 21,35,37,27,38, + 32, + 36, + 0,1,30,31,32,35,23,6,28, + 14,38, + 3,5,30,17,20,32,34,22,23,37,6,39, + 35, 3, - 14,28, - 5,10, - 30, - 29, - 7,10,18,21,24,29, - 29, - 26, - 18,21, - 0,8,2,10,19,21,33,25,26, - 5, + 31, + 18, + 14,30,31,32,37,6,39, + 5,10,24,37, + 31, + 38, + 26, + 31,34,38, + 32,35,38, + 0,10,14,16,19,31,32,39, + 32, + 35,23, + 34, + 1, + 16,18,19, + 35,38, + 1,8,2,10,17,19,32,22,37,6, + 5,31, 3, - 7,1,30, - 6, - 26, - 0, - 12,18,23,26,28,29,30,31, - 3,5,0,7,8,9,2,10,11,12,13,15,14,16,17,18,20,21,23,33,24,26,28,6,30,31,32, + 7,26, + 1, + 0,18,23, + 34, + 1,29,31, + 35, + 38, + 12,16,21,31,33,32,34,35,23,26,27,38,39, + 31, + 32, + 3,5,1,7,8,9,2,10,11,12,13,15,14,29,30,16,18,19,21,33,32,36,23,24,6,26,27,28,39, 11,12, + 34, + 39, 3, - 7,10,11,12,13,21,23,24,26,27,28,6,30,32, - 3,5,0,7,8,10,11,12,13,14,21,23,26,27,28,6,30,31,32, - 7, + 5,0,7,10,11,12,13,14,29,19,21,33,36,23,24,26,28, + 3,5,1,7,8,10,11,12,13,14,29,19,21,33,34,36,23,26,27,28, + 7,18,31,37, 3, 3, 3, 3, 6, - 5,20,21, - 11,14, - 0, - 30, - 5,7,2,13,15,14,16,17,20,33,28,6,29,30,31,32, - 0, - 0,11,12,26, - 26, - 26, - 28, - 30, - 19, - 3,26, - 11,12,30, - 5,0,7,11,12,13,14,16,19,23,26,27,6,30,32, - 3, - 30, - 3,10,6,30, - 5,30, - 3, + 31,6, + 5,18,19,32,34, + 34, + 11,14,30,18,32,34, + 1, + 26, + 5,7,13,15,14,30,18,32,35,6,25,26,27,28, + 36, + 35, + 1, + 39, + 1,11,12,33,35,23,37, + 35,23,37, + 18, + 32,23,39, + 26, + 37, + 17, + 3,23, + 35, + 32,39, + 11,12,34,26, + 5,1,7,11,12,13,14,30,17,21,33,34,35,36,23,37,6,26,28,39, + 31, + 18, + 3,1,7,32,37,39, + 26, + 3,10,26, + 5,26, + 0, + 0, + 3,0,18, 3,5, - 0, - 24, + 1, + 14, 3, - 5, - 7,11, - 0,11,12,31, - 17,22,25, - 7,10,11,19,22,29, - 7,1,10, + 30,31, + 5,34, + 34, + 11,32,6,39, + 35, + 1,11,12,30,33,37,6, + 33, + 20,22, + 0, + 7,10,11,17,20,33,32,25, + 7,10, 7, - 3,18,28,6,29,30, - 32, - 30, - 5,7,8,1,9,2,10,11,12,13,15,14,16,23,33,24,26,28,6,30,31,32, - 0,11,12,29,32, - 18, - 29, - 0,8, - 3,4,5,7,8,10,16,19,20,21,22,25,26,30,31, - 20,25,26, - 28, - 26, - 3,4,5,0,8,1,9,2,11,12,13,14,16,18,19,20,22,23,33,24,25,26,27,28,6,30,31,32, - 0,11,12, + 30,32,34,6,39, + 3,29,30,16,31,32,34,35,37,6,26,38,39, + 28, + 26, + 5,7,8,9,2,10,11,12,13,15,14,29,21,33,36,23,6,26,27,28, + 1,11,12,30,31,33,32,38,28,39, + 35, + 16, + 0,25, + 1,8,37,38, + 3,4,5,0,7,8,2,10,11,30,17,18,19,20,32,22,23,6,26,27,39, + 18,31,34,22,23,6, + 5,0,29,30,31,32,39, + 5,23, + 3,4,5,0,1,8,9,2,11,12,13,14,29,30,16,17,20,21,31,33,34,22,35,36,23,24,37,6,26,27,38,28,39, + 35, + 1,11,12,33, 5, - 4,10,21,23, - 3,4,5,7,8,10,16,19,20,21,22,25,26,30,31, + 4,10,21,25, + 29,34,37,38, + 3,4,5,0,7,8,2,10,11,30,17,18,19,20,32,22,23,6,26,27,39, + 6, 11, - 22,31, - 22, - 30, - 5,13,26,6,29,32, + 18,20,27,38, + 0,20, + 18,34, + 35, + 0, + 34, + 26, + 5,0,13,29,30,32,35,23,6,25,28,39, 5, - 22, - 31, - 30, + 20,6, + 6,27, + 5, + 34,26, 3, + 31, 4, 3, - 10,27, - 4,5,13,23,26,29,32, + 0, + 10,29,24, + 33,6,38, + 37, + 35,38, + 4,5,13,21,31,33,34,35,23,6,25,38,28, 4, - 5,29, - 7,1, - 4,10, - 31, - 11, - 25, - 12, - 26, + 0,18, + 30,31,38, + 5,32,37,38, + 0,30, + 7,18, + 35, + 39, + 4,10,38, + 35, + 27, + 0, + 11,35, + 22, + 12,33,34,6, + 34,23, + 33, + 34, + 32,39, 7, - 16,24, - 5, - 3,4,7,26,6,29,30,32, - 3,14,27,6,29, - 7,8,15,17,18,6,30, - 27, - 30, - 3,11, - 5,6, + 14,30,6,25, + 5,35, + 34,35,38, + 3,4,7,33,32,23,6,25,26,28,39, + 3,14,32,6,25, + 38, + 0,7,8,15,16,26, + 24,39, + 32,39, + 34, + 0,26, + 18,38, + 38, + 6,39, + 3,11,31,33,34,35,37,38, + 5,30,6, 11, - 5,7,8,1,9,2,10,11,12,13,15,14,16,20,21,23,33,24,26,28,6,29,30,31,32, - 7,1, - 0,11,12, + 32, + 1, + 5,7,8,9,2,10,11,12,13,15,14,29,30,18,19,21,33,32,35,36,23,24,6,25,26,27,28, + 7, + 1,30,37,39, + 1,11,12,30,33,39, 4,7, - 5,25, - 3, - 4,7,17,20,22,25,26,27, - 7,11,14,20,26,6, - 5,26,29, - 13,16,26,27,29,32, - 3,5,8,2,11,12,13,18,23,33,26,30,31,32, + 5,22, + 3,31, + 7,30,20,34,22,23,24, + 7,11,14,30,23,37,6,38, + 5,0,30,32,35,23,25, + 13,33,32,35,36,23,24,6,25,38,28, + 3,5,8,2,11,12,13,29,16,21,31,33,34,35,36,23,37,6,26,38,28, + 32,34,35,38,39, 4, - 3,4,5,0,8,11,13,20,23,25,30,32, - 17,20, - 1, - 0, - 3,30, - 5,0,7,8,1,2,10,11,12,13,14,16,18,20,21,23,33,26,28,6,29,30,31,32, - 18,28,6, + 3,4,5,0,8,11,13,18,21,33,32,34,22,36,37,6,26,28,39, + 18, + 0,35,37, + 37, + 1,6, + 35, + 3,26, + 0,30,34,37, + 5,1,7,8,2,10,11,12,13,14,29,30,16,18,19,21,31,33,32,35,36,23,24,6,25,26,27,38,28,39, + 1, + 30,16,31,6, + 31,37, 6, - 15, - 29, - 30, - 26, - 5,0,7,1,11,12,13,14,19,20,23,25,26,27,6,29,30,32, - 29, + 15,6, + 32,6, + 26, + 0,23, + 5,0,1,11,12,13,14,29,17,18,21,31,33,34,22,36,23,6,25,26,38,28, + 0,30,18,32,25, 5, - 12,13,31, - 13,28, - 3,7,11,12,18,25,31, - 5,0,11,12,15,29, + 34,6, + 12,13,34,36,38, + 13, + 3,1,7,11,12,16,18,33,22,6,27, + 5,1,11,12,15,18,31,32,35,37,25,38,39, 6, - 12, - 30, + 12,35, + 37,26, + 34, 5, - 11,12,20, - 1,18,29,30, - 30, - 32, - 30, - 30, - 5, - 7,1, - 30, - 30, - 11,12,18,28, + 11,12,35,6, + 0,16,31,32,34,26,38, + 31, + 34,26, + 28,39, + 38, + 33,26, + 31,26, + 5,31,34,38, + 7, + 6, + 26, + 26, + 11,12,16,33,35,38, 5, - 4, - 5,29, - 16, - 30, - 29, - 0, - 3,5,8,11,12,13,14,23,26,30,32, - 7,17,20,21,6, - 5,0,25,30,31, - 31, - 5,11,30,31, - 3,20, - 30, - 30, - 3,0,7,11,17,20,30, - 7,10,11,19,20,21,25, - 3,8,14, + 4,30,31, + 5,0,32,24, + 32,6,26, + 18, + 34,37, + 32, + 1, + 31,34, + 3,5,0,8,11,12,13,14,29,30,18,21,33,35,36,23,6,26,28, + 0,7,30,18,19,34,38, + 5,0,1,22,26,27, + 27, + 5,11,18,31,33,26,27, + 0, + 3,30, + 26, + 26, + 39, + 3,1,7,11,18,26, + 5,7,10,11,17,22, + 30, + 3,8,14,30,6, 3, - 8,6, - 3,8,9,18,19,22,24,27,6, - 20, - 12,23,6,31, - 6, - 5,19,31, - 29, - 4,0,11,12,13,21,23,26,30,32, - 3,4,7,1,2,11,15,18,19,21,22,33,29, - 32, - 30,31, - 7,11,13, - 26, - 4,0,20,23,28, - 1, - 30, - 3,4,11,12,26, - 3,5,8,11,12,13,14,20,23,26,30,31,32, - 4,26,29, + 8, + 3,8,9,16,17,20,24, + 0, + 34, + 6, + 12,21,33,6, + 0, + 5,17,18,6,27, + 30,6, + 0,34,38, + 35, + 18,32,34,39, + 4,11,12,13,19,21,33,36,23,37,26,28, + 3,4,7,2,11,15,16,17,19,20,32, + 28, + 26,27, + 7,11,13,35, + 34, + 34,35, + 35,23, + 34, + 4,1,7,30,21,31,34,6,39, + 34, + 6, + 6, + 34,26, + 3,4,11,12,33,34,23,38, + 34, + 39, + 3,5,0,8,11,12,13,14,29,30,18,21,33,35,36,23,37,6,26,27,28, + 4,32,23, 3, - 8,11,12,13,14,23,25,26,27,28,6,30,32, - 29, - 30, - 26,31, + 31, + 8,11,12,13,14,29,30,21,31,33,32,22,36,23,37,26,28,39, + 31,32,37, + 34, + 31, + 26, + 23,27, + 30,24,6, + 30,37, + 31,34, + 31,37,6, 3, - 3,7,1, - 29, - 0,7,10,11,12,20, - 4,21, - 3,5,7,8,1,11,12,13,18,26,6,29,30,31,32, - 1, - 4,7,30, - 6, - 5,7,8,1,9,2,10,11,12,13,15,14,16,23,33,24,26,28,6,30,31,32, - 2,23,33,25, - 20, - 7,1, - 3,5,0,7,10,11,13,17,18,26,30,31,32, - 19, - 30, - 7, - 5,6, - 3,4,7,8,2,11,12,13,18,23,33,26,6,30,31,32, - 22, - 3,8,13,18,23,26,30,32, - 26,29, - 30, - 29, - 3,4,0,7,9,2,10,11,12,13,15,14,16,18,19,23,33,24,25,26,28,6,29,30,31,32, - 2,11,17,22,33,26,28, - 6, - 11,13,32, - 8,11,12,13,22,23,26,6,30,32, - 25, - 28, - 0, - 8,26,28, + 3,7,39, + 31, + 25, + 39, + 1, + 38, + 0,1,7,10,11,12,30,31,33,34,35,36,37, + 4,19, + 3,5,7,8,11,12,13,29,16,33,32,34,36,23,6,25,26,27,38,28, + 18, + 38, + 4,7,26, + 1, + 5,7,8,9,2,10,11,12,13,15,14,29,21,33,34,35,36,23,37,6,26,27,28, + 21,31,22,37,38, + 7, + 3,5,0,1,7,10,11,13,29,30,16,31,34,35,23,37,26,27,38,28,39, + 17, + 26, + 7,37, + 5, + 3,4,0,7,8,2,11,12,13,16,18,21,31,33,34,35,36,23,6,26,27,38,28, + 35,37, + 20, + 38, + 0, + 3,8,13,16,21,33,34,35,36,23,26,28, + 32, + 34, + 1,32,35,23, + 31,26, + 30,25,39, + 0, + 3,4,0,1,7,9,2,10,11,12,13,15,14,30,16,17,21,31,33,32,34,22,36,23,24,37,6,25,26,27,38,28,39, + 32,34,39, + 34, + 29, + 11,13,31,34,28, + 8,11,12,13,29,20,21,33,36,23,37,6,26,28,39, + 30,34,22,6,39, + 1,31,37, + 8,23, + 18, + 34, 5, - 28, - 3,28, + 33, + 3,34, 3, - 7,26,6,32, - 3,5,0,7,8,9,2,10,11,12,13,15,14,17,18,20,21,23,33,24,25,26,28,6,29,30,31,32, - 0,10,15,25,28, + 7,35,23,6,28, + 3,5,0,1,7,8,9,2,10,11,12,13,15,14,16,18,19,21,31,33,32,34,22,35,36,23,24,6,25,26,27,38,28, + 0,10,15,30,31,22,37, + 6, 6, - 4, - 20, - 0,7,26,27,29, - 4,21, - 21, - 7,10,11,12,22,29, - 0,7,26,27,29, - 5,0,7,1,2,10,11,12,13,15,14,20,21,23,33,24,26,27,28,6,29,30,32, - 11,12, - 0,27, - 11,12, + 32,6,39, + 31,34,35,6, + 4,30, + 0,34, + 35, + 1,7,32,34,35,23,24, + 4,19, + 10,11,12,20,33,32,25, + 1,7,32,35,23,24, + 5,0,1,7,2,10,11,12,13,15,14,29,18,19,21,33,32,36,23,24,25,26,28, + 11,12,33, + 1,24, + 30,31,32,34,39, + 11,12,33, diff --git a/doc/salome/gui/VISU/whxdata/whtdata0.xml b/doc/salome/gui/VISU/whxdata/whtdata0.xml index b55a2d2a..2a971e46 100755 --- a/doc/salome/gui/VISU/whxdata/whtdata0.xml +++ b/doc/salome/gui/VISU/whxdata/whtdata0.xml @@ -1,13 +1,12 @@ - - + - + @@ -15,19 +14,29 @@ - + - - + + + + + + + + + + + + - - - - - - - + + + + + + + @@ -39,6 +48,7 @@ + diff --git a/doc/salome/tui/Makefile.in b/doc/salome/tui/Makefile.in index 44faf46d..88349340 100644 --- a/doc/salome/tui/Makefile.in +++ b/doc/salome/tui/Makefile.in @@ -20,6 +20,22 @@ docs: cp -fr $(srcdir)/VISU ./INPUT; \ cd INPUT; \ sed 's|../../../share/salome|$(root_srcdir)|' ./doxyfile > ./doxyfile1; \ + sed 's|../../build/salome|$(top_builddir)|' ./doxyfile1 > ./doxyfile2; \ + sed "s|version|`cut -d: -f2 $(root_srcdir)/bin/VERSION`|" ./doxyfile2 > ./doxyfile3; \ + mv -f doxyfile3 doxyfile1; \ + echo "DOXYGEN SUPPORT PYTHON - @DOXYGEN_WITH_PYTHON@"; \ + if( test "x@DOXYGEN_WITH_PYTHON@" = "xyes"); then \ + sed 's|python_extension_must_be_here|*.py|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + $(doxygen) -u ./doxyfile1; \ + else \ + sed 's|python_extension_must_be_here||' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + fi; \ + if( test "x@DOXYGEN_WITH_STL@" = "xyes"); then \ + sed -e 's|BUILTIN_STL_SUPPORT = NO|BUILTIN_STL_SUPPORT = YES|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ + fi; \ mv -f doxyfile1 doxyfile; \ $(doxygen) ./doxyfile; \ cd ..; \ diff --git a/doc/salome/tui/VISU/doxyfile b/doc/salome/tui/VISU/doxyfile index 87ec9871..13fad980 100755 --- a/doc/salome/tui/VISU/doxyfile +++ b/doc/salome/tui/VISU/doxyfile @@ -1,32 +1,35 @@ -# Doxyfile 1.3.7 +# Doxyfile 1.4.6 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -PROJECT_NAME = "SALOME - VISU - v.3.2.0a2" -PROJECT_NUMBER = id#1.1 +PROJECT_NAME = "SALOME - VISU - v.version" +PROJECT_NUMBER = OUTPUT_DIRECTORY = ../ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES +REPEAT_BRIEF = NO ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = ../../../share/salome \ + ../../../build/salome STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = YES MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO -INHERIT_DOCS = NO -DISTRIBUTE_GROUP_DOC = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 5 ALIASES = OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_JAVA = YES +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO SUBGROUPING = YES #--------------------------------------------------------------------------- @@ -37,8 +40,8 @@ EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = YES @@ -56,6 +59,8 @@ GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 25 SHOW_USED_FILES = NO +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages @@ -64,6 +69,7 @@ QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = log.txt @@ -71,17 +77,19 @@ WARN_LOGFILE = log.txt # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ../../../share/salome/src \ - ../../../share/salome/idl -FILE_PATTERNS = *.idl *.h *.hh *.hxx *.c *.cc *.cxx *.ixx *.jxx + ../../../share/salome/idl \ + ../../../build/salome/bin +FILE_PATTERNS = *.idl *.h *.hh *.hxx *.c *.cc *.cxx *.ixx *.jxx python_extension_must_be_here RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXAMPLE_PATH = EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = YES +EXAMPLE_RECURSIVE = NO IMAGE_PATH = sources/ INPUT_FILTER = +FILTER_PATTERNS = FILTER_SOURCE_FILES = YES #--------------------------------------------------------------------------- @@ -92,13 +100,14 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = NO REFERENCES_RELATION = YES +USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 3 IGNORE_PREFIX = #--------------------------------------------------------------------------- @@ -108,8 +117,8 @@ GENERATE_HTML = YES HTML_OUTPUT = VISU HTML_FILE_EXTENSION = .html HTML_HEADER = sources/myheader.html -HTML_FOOTER = -HTML_STYLESHEET = +HTML_FOOTER = sources/footer.html +HTML_STYLESHEET = sources/static/doxygen.css HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = @@ -117,9 +126,9 @@ HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = YES TOC_EXPAND = YES -DISABLE_INDEX = YES +DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES +GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- @@ -182,7 +191,7 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES +MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = @@ -208,18 +217,22 @@ HIDE_UNDOC_RELATIONS = NO HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = NO +GROUP_GRAPHS = NO UML_LOOK = NO TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = NO CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = jpg DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1200 MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO GENERATE_LEGEND = NO DOT_CLEANUP = YES diff --git a/doc/salome/tui/VISU/sources/footer.html b/doc/salome/tui/VISU/sources/footer.html new file mode 100755 index 00000000..cb55f397 --- /dev/null +++ b/doc/salome/tui/VISU/sources/footer.html @@ -0,0 +1,5 @@ + + + + diff --git a/doc/salome/tui/VISU/sources/myheader.html b/doc/salome/tui/VISU/sources/myheader.html index 83ca543c..1dc1ce7a 100755 --- a/doc/salome/tui/VISU/sources/myheader.html +++ b/doc/salome/tui/VISU/sources/myheader.html @@ -8,17 +8,5 @@   -
                                Start Page visu.htm
                                Skin Name Default
                                Generating Time 18:09 01/10/2006
                                Generating Time 16:03 04/20/2006
                                Language ID 1033
                                Compile Script webhelp5_compile_script.xml
                                Compile Build Version 13.10.606
                                - - - - - - -
                                -
                                -
                                - - diff --git a/doc/salome/tui/VISU/sources/static/doxygen.css b/doc/salome/tui/VISU/sources/static/doxygen.css index 0a8e93d5..88e613d2 100755 --- a/doc/salome/tui/VISU/sources/static/doxygen.css +++ b/doc/salome/tui/VISU/sources/static/doxygen.css @@ -1,21 +1,139 @@ -H1 { text-align: center; } -CAPTION { font-weight: bold } +H1 { + text-align: center; +} + +CAPTION { + font-weight: bold +} + +/* Link in the top navbar */ A.qindex {} + A.qindexRef {} -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #4444ee } -A.codeRef { font-weight: normal; color: #4444ee } -A:hover { text-decoration: none; background-color: lightblue } -DL.el { margin-left: -1cm } -DIV.fragment { width: 100%; border: none; background-color: #CCCCCC } -DIV.ah { background-color: #CCCCCC; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: lightblue; font-weight: bold; } -TD.mdname1 { background-color: lightblue; font-weight: bold; color: #602020; } -TD.mdname { background-color: lightblue; font-weight: bold; color: #602020; width: 600px; } -DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } -DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } -BODY { background: url(sources/bg_salome.gif) } + +/* Link to any cross-referenced Doxygen element */ +A.el { + text-decoration: none; + font-weight: bold +} + +A.elRef { + font-weight: bold +} + +/* Link to any cross-referenced Doxygen element inside a code section + (ex: header) +*/ +A.code { + text-decoration: none; + font-weight: normal; + color: #4444ee +} + +A.codeRef { + font-weight: normal; + color: #4444ee +} + +A:hover { + text-decoration: none; + background-color: lightblue +} + +DL.el { + margin-left: -1cm +} + +/* A code fragment (ex: header) */ +DIV.fragment { + width: 100%; + border: none; + background-color: #CCCCCC +} + +/* In the alpha list (coumpound index), style of an alphabetical index letter */ +DIV.ah { + background-color: #CCCCCC; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px +} + +/* Method name (+ type) */ +TD.md { + background-color: lightblue; + font-weight: bold; +} + +/* Method parameter (some of them) */ +TD.mdname1 { + background-color: lightblue; + font-weight: bold; color: #602020; +} + +/* Method parameter (some of them) */ +TD.mdname { + background-color: lightblue; + font-weight: bold; + color: #602020; + width: 600px; +} + +/* Separator between methods group (usually empty, seems not supported by IE) */ +DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold +} + +DIV.groupText { + margin-left: 16px; + font-style: italic; + font-size: smaller +} + +BODY { + background: #FFFFFF; +} + +/*div.div-page { + background-color: #FFFFFF; + margin-left: 1em; + margin-right: 1em; + margin-top: 1em; + margin-bottom: 0.1em; + + padding-left: 1em; + padding-right: 1em; + padding-top: 0.5em; + padding-bottom: 0.5em; + + border: 2px solid #0D299A; + border-width: 2px; + border-color: #0D299A; +}*/ + +div.tabs { + text-align: justify; + margin-left : 2px; + margin-right : 2px; + margin-top : 2px; + margin-bottom : 2px + font-weight: bold; + color: #FFFFFF; +} + +DIV.div-footer { + margin-left: 1em; + margin-right: 1em; + margin-bottom: 0.2em; + text-align: right; + font-size: 9pt; +} + +/* In File List, Coumpound List, etc, 1st column of the index */ TD.indexkey { background-color: #CCCCCC; font-weight: bold; @@ -28,6 +146,8 @@ TD.indexkey { margin-top : 2px; margin-bottom : 2px } + +/* In File List, Coumpound List, etc, 2nd column of the index */ TD.indexvalue { background-color: #CCCCCC; font-style: italic; @@ -40,6 +160,7 @@ TD.indexvalue { margin-top : 2px; margin-bottom : 2px } + span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } diff --git a/doc/salome/tui/VISU/sources/static/tree.js b/doc/salome/tui/VISU/sources/static/tree.js index 69a2295f..25fd55a3 100755 --- a/doc/salome/tui/VISU/sources/static/tree.js +++ b/doc/salome/tui/VISU/sources/static/tree.js @@ -1,4 +1,4 @@ -foldersTree = gFld("SALOME v.3.2.0a2 ", "", "") +foldersTree = gFld("SALOME v.3.2.0b1 ", "", "") insDoc(foldersTree, gLnk("Main Page", "", "main.html")) aux1 = insFld(foldersTree, gFld("TUI Reference Guide", "")) diff --git a/idl/Makefile.in b/idl/Makefile.in index b032d41d..071fee71 100644 --- a/idl/Makefile.in +++ b/idl/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # # generate dependencies for idl file : # @@ -28,7 +47,7 @@ $(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%) lib: pyidl -PYTHON_BUILD_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/@PACKAGE@ +PYTHON_BUILD_SITE=$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/python$(PYTHON_VERSION)/site-packages/@PACKAGE@ pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py) diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index af87ae1c..722b086c 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -1398,6 +1398,28 @@ module VISU { */ Result ImportMedField(in SALOME_MED::FIELD theField); + /*! + * Rename a study object, representing a mesh, specified by given values. + * \param theResult Data generated in other sources (MED object or file). + * \param theMeshName One of the meshes presented in MED file. + * \param theEntity Type of entity where the field is defined. + * \param theSubMeshName Name of sub-mesh (group or family). + * \param theNewName Name to be given to the study object. + */ + void RenameEntityInStudy(in Result theResult, + in string theMeshName, + in Entity theEntity, + in string theNewName); + void RenameFamilyInStudy(in Result theResult, + in string theMeshName, + in Entity theEntity, + in string theSubMeshName, + in string theNewName); + void RenameGroupInStudy(in Result theResult, + in string theMeshName, + in string theSubMeshName, + in string theNewName); + /*! * Creates a mesh on the basis of the data generated in other sources (MED object or file). * \param theResult Data generated in other sources. (MED object or file) @@ -1879,6 +1901,72 @@ module VISU { * \param theName The name of the view parameters which will be restored. */ boolean RestoreViewParams(in string theName); + + + /*! Get representation type of the given presentation in this view. + * \param thePrs Object to get a representation type of. + * \return PresentationType Representation type of object in this view. + */ + PresentationType GetPresentationType(in ScalarMap thePrs); + + /*! Set representation type of the given presentation in this view. + * \param thePrs Object to set a representation type of. + * \param thePrsType Representation type to be set to the given object. + * \return Empty string in case of success, error description in case of failure. + */ + string SetPresentationType(in ScalarMap thePrs, in PresentationType thePrsType); + + /*! Get shrink state of the given presentation in this view. + * \param thePrs Object to get a shrink state of. + * \return TRUE if \a thePrs is shrinked in this view, FALSE overwise. + */ + boolean IsShrinked(in ScalarMap thePrs); + + /*! Make the given presentation shrinked or not shrinked in this view. + * \param thePrs Object to change a shrink state of. + * \param isShrinked Pass TRUE to make \a thePrs shrinked, FALSE overwise. + * \return Empty string in case of success, error description in case of failure. + */ + string SetShrinked(in ScalarMap thePrs, in boolean isShrinked); + + /*! Get shading state of the given presentation in this view. + * \param thePrs Object to get a shading state of. + * \return TRUE if \a thePrs is shaded in this view, FALSE overwise. + */ + boolean IsShaded(in ScalarMap thePrs); + + /*! Make the given presentation shaded or not shaded in this view. + * \param thePrs Object to set a shading state of. + * \param isShaded Pass TRUE to make \a thePrs shaded, FALSE overwise. + * \return Empty string in case of success, error description in case of failure. + */ + string SetShaded(in ScalarMap thePrs, in boolean isShaded); + + /*! Get opacity of the given presentation in this view. + * \param thePrs Object to get an opacity of. + * \return Opacity value in range [0, 1], 0 - transparent, 1 - opaque. + */ + double GetOpacity(in ScalarMap thePrs); + + /*! Set opacity of the given presentation in this view. + * \param thePrs Object to set an opacity of. + * \param theOpacity Opacity value [0, 1]. 0 - transparent, 1 - opaque. + * \return Empty string in case of success, error description in case of failure. + */ + string SetOpacity(in ScalarMap thePrs, in double theOpacity); + + /*! Get line width of the given presentation in this view. + * \param thePrs Object to get a line width of. + * \return Line width of \a thePrs in this view. + */ + double GetLineWidth(in ScalarMap thePrs); + + /*! Set line width of the given presentation in this view. + * \param thePrs Object to set a line width of. + * \param theLineWidth Line width value. Recommended values are in range [1, 10]. + * \return Empty string in case of success, error description in case of failure. + */ + string SetLineWidth(in ScalarMap thePrs, in double theLineWidth); }; //------------------------------------------------------- diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml new file mode 100644 index 00000000..8fa38a99 --- /dev/null +++ b/resources/SalomeApp.xml @@ -0,0 +1,117 @@ + +
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                +
                                + + +
                                +
                                diff --git a/resources/VISUCatalog.xml b/resources/VISUCatalog.xml index 6e400e8c..c9a60baa 100644 --- a/resources/VISUCatalog.xml +++ b/resources/VISUCatalog.xml @@ -16,7 +16,7 @@ Post-Pro VISU NRI - 3.2.0a2 + 3.2.0b1 Post-Pro component 1 ModuleVisu.png diff --git a/resources/VISU_en.xml b/resources/VISU_en.xml index d2c013d9..52034252 100644 --- a/resources/VISU_en.xml +++ b/resources/VISU_en.xml @@ -71,6 +71,9 @@ + + + diff --git a/resources/VISU_fr.xml b/resources/VISU_fr.xml index 7a3230b9..e2831bad 100644 --- a/resources/VISU_fr.xml +++ b/resources/VISU_fr.xml @@ -16,7 +16,7 @@ - + @@ -70,6 +70,9 @@ + + + diff --git a/resources/Visu_import_med.png b/resources/Visu_import_med.png new file mode 100644 index 00000000..73ade296 Binary files /dev/null and b/resources/Visu_import_med.png differ diff --git a/src/CONVERTOR/Makefile.in b/src/CONVERTOR/Makefile.in index b3bf4147..56481d84 100644 --- a/src/CONVERTOR/Makefile.in +++ b/src/CONVERTOR/Makefile.in @@ -63,9 +63,9 @@ CPPFLAGS+= -ftemplate-depth-32 \ $(QT_INCLUDES) \ $(OCC_INCLUDES) \ $(OCC_CXXFLAGS) \ - -I${KERNEL_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome \ - -I${GUI_ROOT_DIR}/include/salome \ + $(KERNEL_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ $(BOOST_CPPFLAGS) LDFLAGS+= $(VTK_LIBS) \ @@ -73,8 +73,8 @@ LDFLAGS+= $(VTK_LIBS) \ $(CAS_KERNEL) \ $(CAS_MATH) \ $(BOOST_LIBS) -lboost_thread${BOOST_LIBSUFFIX} \ - -L${MED_ROOT_DIR}/lib/salome -lMEDWrapper \ - -L${GUI_ROOT_DIR}/lib/salome -lVTKViewer + $(MED_LDFLAGS) -lMEDWrapper \ + $(GUI_LDFLAGS) -lVTKViewer LDFLAGSFORBIN=$(LDFLAGS) -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lmed_V2_1 -lVTKViewer -lsuit -lqtx diff --git a/src/CONVERTOR/VISU_Convertor.hxx b/src/CONVERTOR/VISU_Convertor.hxx index 4a5ac993..4dc7b49c 100644 --- a/src/CONVERTOR/VISU_Convertor.hxx +++ b/src/CONVERTOR/VISU_Convertor.hxx @@ -79,6 +79,9 @@ namespace VISU TName myName; //! Name of the corresponding MED MESH int myDim; //! Dimension of the corresponding MED MESH + std::string myGroupsEntry; //!< To simplify publication of the groups in a data tree + std::string myFieldsEntry; //!< To simplify publication of the fiels in a data tree + TMesh(): myDim(0) {} }; @@ -178,7 +181,7 @@ namespace VISU //--------------------------------------------------------------- typedef std::map TValField; - typedef std::pair TMinMax; + typedef std::pair TMinMax; //! Define a basic class for MED FIELD entity struct TField: virtual TIntId @@ -305,7 +308,7 @@ public: //! Get amount of memory to build VTK representations for all existing MED entities virtual - float + vtkFloatingPointType GetSize() = 0; //! Get mesh for corresponding MED ENTITY @@ -316,7 +319,7 @@ public: //! Get amount of memory to build mesh for corresponding MED ENTITY virtual - float + vtkFloatingPointType GetMeshOnEntitySize(const std::string& theMeshName, const VISU::TEntity& theEntity) = 0; @@ -329,7 +332,7 @@ public: //! Get amount of memory to build mesh for corresponding MED FAMILY virtual - float + vtkFloatingPointType GetFamilyOnEntitySize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFamilyName) = 0; @@ -342,7 +345,7 @@ public: //! Get amount of memory to build mesh for corresponding MED GROUP virtual - float + vtkFloatingPointType GetMeshOnGroupSize(const std::string& theMeshName, const std::string& theGroupName) = 0; @@ -364,7 +367,7 @@ public: //! Get amount of memory to build mesh for corresponding MED TIMESTAMP virtual - float + vtkFloatingPointType GetTimeStampSize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFieldName, @@ -372,7 +375,7 @@ public: //! Get amount of memory to build all MED TIMESTAMPS for corresponding MED FIELD virtual - float + vtkFloatingPointType GetFieldOnMeshSize(const std::string& theMeshName, const VISU::TEntity& theEntity, const std::string& theFieldName) = 0; diff --git a/src/CONVERTOR/VISU_ConvertorDef.hxx b/src/CONVERTOR/VISU_ConvertorDef.hxx index 0fedadc5..69ec195d 100644 --- a/src/CONVERTOR/VISU_ConvertorDef.hxx +++ b/src/CONVERTOR/VISU_ConvertorDef.hxx @@ -73,6 +73,9 @@ namespace VISU struct TValForTime; typedef SharedPtr PValForTime; + + struct TGrille; + typedef SharedPtr PGrille; } #endif diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 8d1fe336..a5ceb931 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -28,13 +28,13 @@ #include "VISU_ConvertorUtils.hxx" #include "VTKViewer_AppendFilter.h" #include "VISU_MergeFilter.hxx" +#include "VTKViewer_CellLocationsArray.h" #include #include #include #include -#include #include #include #include @@ -52,7 +52,7 @@ using namespace std; using namespace VISU; -static float ERR_SIZE_CALC = 1.00; +static vtkFloatingPointType ERR_SIZE_CALC = 1.00; static int MYVTKDEBUG = 0; @@ -308,7 +308,7 @@ namespace VISU return myNamedPointCoords->GetVTKID(theID); } - float* + vtkFloatingPointType* TProfileImpl ::GetNodeCoord(vtkIdType theObjID) { @@ -429,7 +429,7 @@ namespace VISU return myIDMapper.GetNodeVTKID(theID); } - float* + vtkFloatingPointType* TIDMapperFilter ::GetNodeCoord(vtkIdType theObjID) { @@ -1208,7 +1208,7 @@ namespace } vtkIdType *pts = 0, npts = 0; - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); aConnectivity->InitTraversal(); @@ -1282,7 +1282,7 @@ namespace } } vtkIdType *pts = 0, npts = 0; - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); aConnectivity->InitTraversal(); @@ -1445,7 +1445,7 @@ namespace } vtkIdType *pts = 0, npts = 0; - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); @@ -1581,7 +1581,7 @@ namespace endl); int aSize = max(3,aNbComp); - TVector aDataValues(aSize,0.0); + TVector aDataValues(aSize,0.0); const TGeom2Value& aGeom2Value = theValForTime->myGeom2Value; @@ -1674,7 +1674,7 @@ namespace for(vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++){ TCCoordSlice aSlice = aCoords.GetCoordSlice(aPointId); - float aCoords[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aCoords[3] = {0.0, 0.0, 0.0}; for(vtkIdType aDimId = 0; aDimId < aDim; aDimId++) aCoords[aDimId] = aSlice[aDimId]; @@ -1686,7 +1686,7 @@ namespace } anIdList->Delete(); - vtkIntArray* aCellLocationsArray = vtkIntArray::New(); + VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); @@ -1774,15 +1774,15 @@ namespace PrintMemorySize(vtkUnstructuredGrid* theDataSet) { theDataSet->Update(); - BEGMSG(1,"GetPoints() = "<GetPoints()->GetActualMemorySize()*1000)<myNbPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(vtkCellLinks::Link)); aLinksSize = 0; vtkIdType aResult = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize + aLinksSize; MSG(MYDEBUG,"GetFamilyOnEntitySize "<< - "- aResult = "<myNbPoints * (vtkIdType(sizeof(vtkIdType)*aNbCellsPerPoint) + sizeof(short)); aLinksSize = 0; vtkIdType aResult = aPointsSize + aConnectivityAndTypesSize + aLocationsSize + aLinksSize; if(MYDEBUG){ - MSG(MYVTKDEBUG,"GetMeshOnGroupSize - aPointsSize = "<(aFindField); PFieldImpl aField = boost::get<3>(aFindField); - float aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); - float aFieldOnMeshSize = float(aField->myDataSize*sizeof(float)*aField->myValField.size()*ERR_SIZE_CALC); - float aResult = aMeshSize + aFieldOnMeshSize; + vtkFloatingPointType aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); + vtkFloatingPointType aFieldOnMeshSize = vtkFloatingPointType(aField->myDataSize*sizeof(vtkFloatingPointType)*aField->myValField.size()*ERR_SIZE_CALC); + vtkFloatingPointType aResult = aMeshSize + aFieldOnMeshSize; if(MYDEBUG) - MSG(MYVTKDEBUG,"GetFieldOnMeshSize - aFieldOnMeshSize = "<(aFindTimeStamp); PFieldImpl aField = boost::get<3>(aFindTimeStamp); - float aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); - float aTimeStampSize = float(aField->myDataSize*sizeof(float) * ERR_SIZE_CALC); - float aResult = aMeshSize + aTimeStampSize; + vtkFloatingPointType aMeshSize = GetMeshOnEntitySize(theMeshName,aVTKMeshOnEntity->myEntity); + vtkFloatingPointType aTimeStampSize = vtkFloatingPointType(aField->myDataSize*sizeof(vtkFloatingPointType) * ERR_SIZE_CALC); + vtkFloatingPointType aResult = aMeshSize + aTimeStampSize; - MSG(MYDEBUG && MYVTKDEBUG,"GetTimeStampSize - aTimeStampSize = "< #include class vtkUnstructuredGrid; @@ -78,7 +78,7 @@ namespace VISU //! Get coordinates of node for corresponding object ID virtual - float* + vtkFloatingPointType* GetNodeCoord(vtkIdType theObjID); //! Get cell object ID for corresponding VTK ID diff --git a/src/CONVERTOR/VISU_MedConvertor.cxx b/src/CONVERTOR/VISU_MedConvertor.cxx index c905b9ee..9f678c4e 100644 --- a/src/CONVERTOR/VISU_MedConvertor.cxx +++ b/src/CONVERTOR/VISU_MedConvertor.cxx @@ -622,6 +622,85 @@ namespace } } + //--------------------------------------------------------------- + void + BuildMeshGrilleOnEntityMap(PMEDMesh theMesh, + const MED::TEntityInfo& theEntityInfo, + const MED::PGrilleInfo& theGrilleInfo, + const MED::PWrapper& theMEDWrapper) + { + TTimerLog aTimerLog(MYDEBUG,"BuildMeshGrilleOnEntityMap"); + INITMSG(MYDEBUG,"BuildMeshGrilleOnEntityMap"<myMeshInfo; + const std::string& aMeshName = theMesh->myName; + TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap; + MED::TEntityInfo::const_iterator anEntityIter = theEntityInfo.begin(); + for(; anEntityIter != theEntityInfo.end(); anEntityIter++){ + const MED::EEntiteMaillage& aMEntity = anEntityIter->first; + const MED::TGeom2Size& aGeom2Size = anEntityIter->second; + + TEntity aVEntity = MEDEntityToVTK(aMEntity); + PMEDMeshOnEntity aMeshOnEntity = aMeshOnEntityMap[aVEntity](new TMEDMeshOnEntity()); + aMeshOnEntity->myEntity = aVEntity; + aMeshOnEntity->myMeshName = aMeshName; + aMeshOnEntity->myGeom2Size = aGeom2Size; +// TFamilyID2CellsSize& aFamilyID2CellsSize = aMeshOnEntity->myFamilyID2CellsSize; + + INITMSG(MYDEBUG, + "- aMEntity = "<GetPNodeInfo(aMeshInfo)){ + MED::TEntityInfo anEntityInfo = aMed->GetEntityInfo(aMeshInfo); + + aMesh->myNbPoints = aNodeInfo->GetNbElem(); + aMesh->myEntityInfo = anEntityInfo; + + #ifndef _DEXCEPT_ - try{ + try{ #endif - BEGMSG(MYDEBUG,"anEntityInfo.size() = "<GetPGrilleInfo(aMeshInfo); + + MED::TEntityInfo anEntityInfo; + anEntityInfo[MED::eNOEUD][MED::ePOINT1] = aGrilleInfo->GetNbNodes(); + anEntityInfo[aGrilleInfo->GetEntity()][aGrilleInfo->GetGeom()] = aGrilleInfo->GetNbCells(); + aMesh->myNbPoints = aGrilleInfo->GetNbNodes(); + aMesh->myEntityInfo = anEntityInfo; + #ifndef _DEXCEPT_ - }catch(std::exception& exc){ - MSG(MYDEBUG,"Follow exception was occured in:\n"<myEntity; const PMEDMeshOnEntity aMeshOnEntity = theMesh->myMeshOnEntityMap[anEntity]; + isPointsUpdated += LoadPoints(aMed,theMesh); if(anEntity == NODE_ENTITY){ isPointsUpdated += LoadPointsOnFamily(aMed,theMesh,aFamily); }else{ - isPointsUpdated += LoadPoints(aMed,theMesh); isCellsOnEntityUpdated += LoadCellsOnFamily(aMed,theMesh,aMeshOnEntity,aFamily); } } @@ -1517,37 +1651,75 @@ VISU_MedConvertor if(theMesh->myIsDone) return 0; - //Main part of code - MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo); - TInt aNbElem = aNodeInfo->GetNbElem(); - TInt aDim = theMesh->myDim; - - PMEDNamedPointCoords aNamedPointCoords = theMesh->myNamedPointCoords; - TMEDNamedPointCoords& aCoords = aNamedPointCoords; - aCoords.Init(aNbElem,aDim,aNodeInfo); + MED::EMaillage aType = theMesh->myMeshInfo->GetType(); - for(int iDim = 0; iDim < aDim; iDim++) - aCoords.GetName(iDim) = aNodeInfo->GetCoordName(iDim); - - for(int iElem = 0; iElem < aNbElem; iElem++){ - TCoordSlice aVCoordSlice = aCoords.GetCoordSlice(iElem); - MED::TCCoordSlice aMCoordSlice = aNodeInfo->GetCoordSlice(iElem); + if(aType == MED::eNON_STRUCTURE){ + //Main part of code + MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(theMesh->myMeshInfo); + TInt aNbElem = aNodeInfo->GetNbElem(); + TInt aDim = theMesh->myDim; + + PMEDNamedPointCoords aNamedPointCoords = theMesh->myNamedPointCoords; + TMEDNamedPointCoords& aCoords = aNamedPointCoords; + aCoords.Init(aNbElem,aDim,aNodeInfo); + + for(int iDim = 0; iDim < aDim; iDim++) + aCoords.GetName(iDim) = aNodeInfo->GetCoordName(iDim); + + for(int iElem = 0; iElem < aNbElem; iElem++){ + TCoordSlice aVCoordSlice = aCoords.GetCoordSlice(iElem); + MED::TCCoordSlice aMCoordSlice = aNodeInfo->GetCoordSlice(iElem); + for(int iDim = 0; iDim < aDim; iDim++) + aVCoordSlice[iDim] = aMCoordSlice[iDim]; + } + + TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh; + PMEDSubMesh aSubMesh = aGeom2SubMesh[VISU::ePOINT1](new TMEDSubMesh()); + + aSubMesh->Init(MED::PElemInfo(aNodeInfo)); + aSubMesh->myNbCells = theMesh->myNbPoints; + aSubMesh->myCellsSize = 2*theMesh->myNbPoints; + + TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + for (int iElem = 0; iElem < aNbElem; iElem++) + aCell2Connect[iElem] = VISU::TConnect(1,iElem); + } // END NON_STRUCTURED + else { // STRUCTURED + //Main part of code + MED::PGrilleInfo aGrilleInfo = theMed->GetPGrilleInfo(theMesh->myMeshInfo); + TInt aNbElem = aGrilleInfo->GetNbNodes(); + TInt aDim = theMesh->myDim; + + PMEDNamedPointCoords aNamedPointCoords = theMesh->myNamedPointCoords; + TMEDNamedPointCoords& aCoords = aNamedPointCoords; + aCoords.Init(aNbElem,aDim,aGrilleInfo); + for(int iDim = 0; iDim < aDim; iDim++) - aVCoordSlice[iDim] = aMCoordSlice[iDim]; + aCoords.GetName(iDim) = aGrilleInfo->GetCoordName(iDim); + + for(int iElem = 0; iElem < aNbElem; iElem++){ + TCoordSlice aVCoordSlice = aCoords.GetCoordSlice(iElem); + MED::TNodeCoord aMCoord = aGrilleInfo->GetCoord(iElem); + for(int iDim = 0; iDim < aDim; iDim++){ + aVCoordSlice[iDim] = aMCoord[iDim]; + } + } + + TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh; + PMEDSubMesh aSubMesh = aGeom2SubMesh[VISU::ePOINT1](new TMEDSubMesh()); + + aSubMesh->Init(aGrilleInfo); + aSubMesh->myNbCells = theMesh->myNbPoints; + aSubMesh->myCellsSize = 2*theMesh->myNbPoints; + + TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + for (int iElem = 0; iElem < aNbElem; iElem++) + aCell2Connect[iElem] = VISU::TConnect(1,iElem); + } - TGeom2SubMesh& aGeom2SubMesh = aMeshOnEntity->myGeom2SubMesh; - PMEDSubMesh aSubMesh = aGeom2SubMesh[VISU::ePOINT1](new TMEDSubMesh()); - - aSubMesh->Init(aNodeInfo); - aSubMesh->myNbCells = theMesh->myNbPoints; - aSubMesh->myCellsSize = 2*theMesh->myNbPoints; - - TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; - aCell2Connect.resize(aNbElem); - for (int iElem = 0; iElem < aNbElem; iElem++) - aCell2Connect[iElem] = VISU::TConnect(1,iElem); - theMesh->myIsDone = true; return 1; @@ -1620,6 +1792,99 @@ VISU_MedConvertor return 0; const MED::PMeshInfo& aMeshInfo = theMesh->myMeshInfo; + + MED::EMaillage aType = aMeshInfo->GetType(); + + if(aType == MED::eSTRUCTURE){ + + MED::PGrilleInfo aGrilleInfo = theMed->GetPGrilleInfo(aMeshInfo); + TInt aNbPoints = aGrilleInfo->GetNbNodes(); + + std::map aNodeIdMap; + EBooleen anIsNodeNum = MED::eFAUX; + + const MED::TGeom2Size& aGeom2Size = theMeshOnEntity->myGeom2Size; + MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin(); + TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh; + + for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){ + const MED::EGeometrieElement& aMGeom = aGeom2SizeIter->first; + VISU::EGeometry aEGeom = MEDGeom2VISU(aMGeom); + INITMSG(MYDEBUG,"aMGeom = "<GetNbCells(); + + if(aNbElem > 0){ + PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh()); + + aSubMesh->Init(aGrilleInfo); + aSubMesh->myNbCells = aNbElem; + aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); + + TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; + aCell2Connect.resize(aNbElem); + + TInt aMNbNodes = MEDGeom2NbNodes(aMGeom); + TVector aConnect(aMNbNodes); + + for(TInt iElem = 0; iElem < aNbElem; iElem++) { + MED::TIntVector aConn = aGrilleInfo->GetConn(iElem); + TConnect& anArray = aCell2Connect[iElem]; + anArray.resize(aVNbNodes); + + if(anIsNodeNum){ + for(TInt iConn = 0; iConn < aMNbNodes; iConn++){ + aConnect[iConn] = aNodeIdMap[aConn[iConn] - 1]; + } + }else{ + for(int iConn = 0; iConn < aMNbNodes; ++iConn){ + aConnect[iConn] = aConn[iConn]; + } + } + + switch(aMGeom){ + case MED::eQUAD4: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[3]; + anArray[3] = aConnect[1]; + break; + case MED::eHEXA8: + anArray[0] = aConnect[0]; + anArray[1] = aConnect[2]; + anArray[2] = aConnect[3]; + anArray[3] = aConnect[1]; + anArray[4] = aConnect[4]; + anArray[5] = aConnect[6]; + anArray[6] = aConnect[7]; + anArray[7] = aConnect[5]; + break; + default: + for(int iNode = 0; iNode < aVNbNodes; iNode++) + anArray[iNode] = aConnect[iNode]; + } + + for(int iNode = 0; iNode < aVNbNodes; iNode++) + if(anArray[iNode] < 0 || aNbPoints <= anArray[iNode]) + EXCEPTION(runtime_error,"LoadCellsOnEntity - "<< + " aNbPoints("<myIsDone = true; + + return 1; + + } + MED::PNodeInfo aNodeInfo = theMed->GetPNodeInfo(aMeshInfo); TInt aNbPoints = aNodeInfo->GetNbElem(); @@ -1650,7 +1915,7 @@ VISU_MedConvertor if(aNbElem > 0){ PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh()); - aSubMesh->Init(aPolygoneInfo); + aSubMesh->Init(MED::PElemInfo(aPolygoneInfo)); aSubMesh->myNbCells = aNbElem; TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; @@ -1675,7 +1940,7 @@ VISU_MedConvertor if(aNbElem > 0){ PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh()); - aSubMesh->Init(aPolyedreInfo); + aSubMesh->Init((MED::PElemInfo)aPolyedreInfo); aSubMesh->myNbCells = aNbElem; TCell2Connect& aCell2Connect = aSubMesh->myCell2Connect; @@ -1718,7 +1983,7 @@ VISU_MedConvertor if(aNbElem > 0){ PMEDSubMesh aSubMesh = aGeom2SubMesh[aEGeom](new TMEDSubMesh()); - aSubMesh->Init(aCellInfo); + aSubMesh->Init((MED::PElemInfo)aCellInfo); aSubMesh->myNbCells = aNbElem; aSubMesh->myCellsSize = aNbElem*(aVNbNodes+1); @@ -1840,6 +2105,8 @@ VISU_MedConvertor }} } + // END NON_STRUCTURED + theMeshOnEntity->myIsDone = true; return 1; @@ -1984,23 +2251,7 @@ LoadProfile(const MED::PWrapper& theMed, const PMEDSubProfile& aSubProfile = anIter->second; MED::EGeometrieElement aMGeom = aSubProfile->myMGeom; MED::PElemInfo anElemInfo; - if(aMEntity == MED::eNOEUD) - anElemInfo = theMed->GetPNodeInfo(aMeshInfo); - else{ - switch(aMGeom){ - case MED::ePOLYGONE: { - anElemInfo = theMed->GetPPolygoneInfo(aMeshInfo,aMEntity,aMGeom); - break; - } - case MED::ePOLYEDRE: { - anElemInfo = theMed->GetPPolyedreInfo(aMeshInfo,aMEntity,aMGeom); - break; - } - default: { - anElemInfo = theMed->GetPCellInfo(aMeshInfo,aMEntity,aMGeom); - break; - }} - } + anElemInfo = theMed->GetPElemInfo(aMeshInfo,aMEntity,aMGeom); aSubProfile->myIsElemNum = anElemInfo->IsElemNum(); aSubProfile->myElemNum = anElemInfo->myElemNum; } @@ -2021,6 +2272,10 @@ LoadGaussMesh(const MED::PWrapper& theMed, TTimerLog aTimerLog(MYDEBUG,"LoadGaussMesh"); INITMSG(MYDEBUG,"LoadGaussMesh"<myMeshInfo->GetType() == MED::eSTRUCTURE) + EXCEPTION(runtime_error,"LoadGaussMesh - Gauss Points localization error!!!"); + PMEDGaussMesh aGaussMesh = theValForTime.myGaussMesh; if(!aGaussMesh || aGaussMesh->myIsDone) return; diff --git a/src/CONVERTOR/VISU_MedConvertor.hxx b/src/CONVERTOR/VISU_MedConvertor.hxx index 0ce3377a..76010e8f 100644 --- a/src/CONVERTOR/VISU_MedConvertor.hxx +++ b/src/CONVERTOR/VISU_MedConvertor.hxx @@ -32,6 +32,11 @@ namespace VISU vtkIdType theDim, const MED::PNodeInfo& theNodeInfo); + void + Init(vtkIdType theNbPoints, + vtkIdType theDim, + const MED::PGrilleInfo& theGrilleInfo); + virtual std::string GetNodeName(vtkIdType theObjID) const; @@ -125,6 +130,9 @@ namespace VISU void Init(const MED::PElemInfo& theElemInfo); + void + Init(const MED::PGrilleInfo& theGrilleInfo); + virtual vtkIdType GetElemObjID(vtkIdType theID) const; diff --git a/src/ENGINE/Makefile.in b/src/ENGINE/Makefile.in index d26a08ba..8aff0aad 100644 --- a/src/ENGINE/Makefile.in +++ b/src/ENGINE/Makefile.in @@ -36,9 +36,9 @@ BIN_SERVER_IDL = EXPORT_HEADERS = # additionnal information to compil and link file -CPPFLAGS += -I${KERNEL_ROOT_DIR}/include/salome +CPPFLAGS += $(KERNEL_CXXFLAGS) -LDFLAGS += -L${KERNEL_ROOT_DIR}/lib/salome -lSalomeContainer +LDFLAGS += $(KERNEL_LDFLAGS) -lSalomeContainer LIBS+= diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index b1a29e01..c6c73c1d 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -189,7 +189,6 @@ namespace VISU{ return myVisuGen->MeshOnEntity(theResult,theMeshName,theEntity); } - Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, @@ -198,7 +197,6 @@ namespace VISU{ return myVisuGen->FamilyMeshOnEntity(theResult,theMeshName,theEntity,theFamilyName); } - Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName) @@ -207,6 +205,26 @@ namespace VISU{ } + void VISU_Gen_i::RenameEntityInStudy(Result_ptr theResult, const char* theMeshName, + VISU::Entity theEntity, const char* theNewName) + { + myVisuGen->RenameEntityInStudy(theResult,theMeshName,theEntity,theNewName); + } + + void VISU_Gen_i::RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName, + VISU::Entity theEntity, const char* theFamilyName, + const char* theNewName) + { + myVisuGen->RenameFamilyInStudy(theResult,theMeshName,theEntity,theFamilyName,theNewName); + } + + void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult, const char* theMeshName, + const char* theGroupName, const char* theNewName) + { + myVisuGen->RenameGroupInStudy(theResult,theMeshName,theGroupName,theNewName); + } + + ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, diff --git a/src/ENGINE/VISU_Engine_i.hh b/src/ENGINE/VISU_Engine_i.hh index b56e216c..21892f5e 100644 --- a/src/ENGINE/VISU_Engine_i.hh +++ b/src/ENGINE/VISU_Engine_i.hh @@ -53,7 +53,7 @@ namespace VISU{ virtual ViewManager_ptr GetViewManager(); virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName); - virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName ); + virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName); //Create Result virtual Result_ptr ImportFile(const char* theFileName); @@ -64,30 +64,47 @@ namespace VISU{ //Create Presentation Of Submeshes virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity); - virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName, + virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFamilyName); virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName); - virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual GaussPoints_ptr GaussPointsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + //Rename Presentation Of Submeshes + virtual void RenameEntityInStudy(Result_ptr theResult, const char* theMeshName, + VISU::Entity theEntity, const char* theNewName); + virtual void RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFamilyName, const char* theNewName); + virtual void RenameGroupInStudy (Result_ptr theResult, const char* theMeshName, + const char* theGroupName, const char* theNewName); + + //Create Presentation Of Results + virtual ScalarMap_ptr ScalarMapOnField + (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual GaussPoints_ptr GaussPointsOnField + (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual DeformedShape_ptr DeformedShapeOnField + (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual IsoSurfaces_ptr IsoSurfacesOnField + (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual CutPlanes_ptr CutPlanesOnField + (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual CutLines_ptr CutLinesOnField + (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual StreamLines_ptr StreamLinesOnField + (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual Plot3D_ptr Plot3DOnField (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, + const char* theFieldName, CORBA::Double theIteration); + virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField + (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, const char* theFieldName, CORBA::Double theIteration); - virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual CutLines_ptr CutLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual Plot3D_ptr Plot3DOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); - virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, CORBA::Double theIteration); //Create Digital Presentation virtual Table_ptr CreateTable(const char* theTableEntry); virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow); @@ -125,7 +142,7 @@ namespace VISU{ const char* aLocalPersistentID, CORBA::Boolean isMultiFile, CORBA::Boolean isASCII); - + virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR); virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject, @@ -143,9 +160,8 @@ namespace VISU{ virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean theIsPublished, CORBA::Boolean& theIsValidScript); - }; }; -#endif +#endif diff --git a/src/GUITOOLS/Makefile.in b/src/GUITOOLS/Makefile.in index eb8eeac4..da363fe5 100644 --- a/src/GUITOOLS/Makefile.in +++ b/src/GUITOOLS/Makefile.in @@ -56,11 +56,11 @@ LIB_SERVER_IDL = CPPFLAGS += -ftemplate-depth-32 $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) \ $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QWT_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome $(BOOST_CPPFLAGS) + $(KERNEL_CXXFLAGS) $(BOOST_CPPFLAGS) CXXFLAGS += -ftemplate-depth-32 $(OCC_CXXFLAGS) \ - -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome + $(KERNEL_CXXFLAGS) $(GUI_CXXFLAGS) -LDFLAGS += $(QWT_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome +LDFLAGS += $(QWT_LIBS) $(KERNEL_LDFLAGS) $(GUI_LDFLAGS) @CONCLUDE@ diff --git a/src/GUITOOLS/VisuGUI_TableDlg.cxx b/src/GUITOOLS/VisuGUI_TableDlg.cxx index 24443ef7..3ff5726a 100644 --- a/src/GUITOOLS/VisuGUI_TableDlg.cxx +++ b/src/GUITOOLS/VisuGUI_TableDlg.cxx @@ -12,6 +12,10 @@ #include "SUIT_Tools.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" + +#include "LightApp_Application.h" #include "SALOMEDSClient_Study.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" @@ -130,20 +134,23 @@ VisuGUI_TableDlg::VisuGUI_TableDlg( QWidget* parent, btnLayout->setMargin( 0 ); btnLayout->setSpacing( SPACING_SIZE ); myOKBtn = new QPushButton( tr( "BUT_OK" ), this ); + myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this ); if ( edit ) { myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this ); btnLayout->addWidget( myOKBtn ); btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); btnLayout->addWidget( myCancelBtn ); + btnLayout->addWidget( myHelpBtn ); connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( onOK() ) ); connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); } else { - btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); btnLayout->addWidget( myOKBtn ); btnLayout->addItem( new QSpacerItem( SPACER_SIZE, SPACER_SIZE, QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + btnLayout->addWidget( myHelpBtn ); connect( myOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); } + connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); mainLayout->addWidget( top ); mainLayout->addLayout( btnLayout ); @@ -283,6 +290,23 @@ void VisuGUI_TableDlg::onOK() accept(); } +/*! + button slot, shows corresponding help page +*/ +void VisuGUI_TableDlg::onHelp() +{ + QString aHelpFileName = "/files/displaying_tables.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + /*! Populates table with data */ diff --git a/src/GUITOOLS/VisuGUI_TableDlg.h b/src/GUITOOLS/VisuGUI_TableDlg.h index 82481f9e..5d98a002 100644 --- a/src/GUITOOLS/VisuGUI_TableDlg.h +++ b/src/GUITOOLS/VisuGUI_TableDlg.h @@ -38,6 +38,7 @@ public: public slots: void onOK(); + void onHelp(); private: void initDlg(); @@ -47,6 +48,7 @@ private: VisuGUI_TableWidget* myRealTable; QPushButton* myOKBtn; QPushButton* myCancelBtn; + QPushButton* myHelpBtn; _PTR(SObject) myObject; }; diff --git a/src/OBJECT/Makefile.in b/src/OBJECT/Makefile.in index 0a5cbee8..2ff5af64 100644 --- a/src/OBJECT/Makefile.in +++ b/src/OBJECT/Makefile.in @@ -66,15 +66,15 @@ CPPFLAGS+= \ $(OCC_INCLUDES) \ $(VTK_INCLUDES) \ $(BOOST_CPPFLAGS) \ - -I${MED_ROOT_DIR}/include/salome \ - -I${GUI_ROOT_DIR}/include/salome \ - -I${KERNEL_ROOT_DIR}/include/salome + $(MED_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(KERNEL_CXXFLAGS) LDFLAGS+= \ $(VTK_LIBS) \ $(BOOST_LIBS) \ - -L${GUI_ROOT_DIR}/lib/salome \ - -L${KERNEL_ROOT_DIR}/lib/salome + $(GUI_LDFLAGS) \ + $(KERNEL_LDFLAGS) LIBS+= \ -lboost_signals${BOOST_LIBSUFFIX} \ diff --git a/src/OBJECT/VISU_Actor.cxx b/src/OBJECT/VISU_Actor.cxx index 42591ab3..02eaeb3f 100644 --- a/src/OBJECT/VISU_Actor.cxx +++ b/src/OBJECT/VISU_Actor.cxx @@ -309,13 +309,13 @@ VISU_Actor void VISU_Actor -::SetShrinkFactor(float theValue) +::SetShrinkFactor(vtkFloatingPointType theValue) { myShrinkFilter->SetShrinkFactor(theValue); Modified(); } -float +vtkFloatingPointType VISU_Actor ::GetShrinkFactor() { @@ -326,12 +326,12 @@ VISU_Actor //---------------------------------------------------------------------------- void VISU_Actor -::SetOpacity(float theValue) +::SetOpacity(vtkFloatingPointType theValue) { GetProperty()->SetOpacity(theValue); } -float +vtkFloatingPointType VISU_Actor ::GetOpacity() { @@ -340,12 +340,12 @@ VISU_Actor void VISU_Actor -::SetLineWidth(float theLineWidth) +::SetLineWidth(vtkFloatingPointType theLineWidth) { GetProperty()->SetLineWidth(theLineWidth); } -float +vtkFloatingPointType VISU_Actor ::GetLineWidth() { @@ -429,7 +429,7 @@ VISU_Actor return GetCurrentPL()->GetNodeVTKID(theID); } -float* +vtkFloatingPointType* VISU_Actor ::GetNodeCoord(int theObjID) { @@ -510,18 +510,18 @@ VISU_Actor if(vtkCell* aCell = GetElemCell(anObjId)){ vtkPoints* aPts = aCell->GetPoints(); if(int aNbPts = aCell->GetNumberOfPoints()){ - float aCoord[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0}; for(int i = 0; i < aNbPts; i++){ - float *aPntCoord = aPts->GetPoint(i); + vtkFloatingPointType *aPntCoord = aPts->GetPoint(i); aCoord[0] += aPntCoord[0]; aCoord[1] += aPntCoord[1]; aCoord[2] += aPntCoord[2]; } // Display coordinates - float aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0}; + vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0}; aRenderer->SetWorldPoint(aWorldCoord); aRenderer->WorldToDisplay(); - float aSelectionPoint[3]; + vtkFloatingPointType aSelectionPoint[3]; aRenderer->GetDisplayPoint(aSelectionPoint); myAnnotationActor->SetPosition(aSelectionPoint); // @@ -551,12 +551,12 @@ VISU_Actor vtkIdType aVtkId = myPointPicker->GetPointId(); if(aVtkId >= 0 && mySelector->IsValid(this,aVtkId,true) && hasIO()){ vtkIdType anObjId = GetNodeObjId( aVtkId ); - if(float* aCoord = GetNodeCoord(anObjId)){ + if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){ // Display coordinates - float aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0}; + vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0}; aRenderer->SetWorldPoint(aWorldCoord); aRenderer->WorldToDisplay(); - float aSelectionPoint[3]; + vtkFloatingPointType aSelectionPoint[3]; aRenderer->GetDisplayPoint(aSelectionPoint); myAnnotationActor->SetPosition(aSelectionPoint); // diff --git a/src/OBJECT/VISU_Actor.h b/src/OBJECT/VISU_Actor.h index 09d4d4bb..947624cf 100644 --- a/src/OBJECT/VISU_Actor.h +++ b/src/OBJECT/VISU_Actor.h @@ -142,27 +142,27 @@ class VTKOCC_EXPORT VISU_Actor : virtual void - SetShrinkFactor(float theFactor = 0.8); + SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); virtual - float + vtkFloatingPointType GetShrinkFactor(); //---------------------------------------------------------------------------- virtual void - SetOpacity(float theValue); + SetOpacity(vtkFloatingPointType theValue); virtual - float + vtkFloatingPointType GetOpacity(); virtual void - SetLineWidth(float theLineWidth); + SetLineWidth(vtkFloatingPointType theLineWidth); virtual - float + vtkFloatingPointType GetLineWidth(); //---------------------------------------------------------------------------- @@ -203,7 +203,7 @@ class VTKOCC_EXPORT VISU_Actor : GetNodeVTKID(vtkIdType theID); virtual - float* + vtkFloatingPointType* GetNodeCoord(vtkIdType theObjID); virtual diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 8c06e2fc..026be68a 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -207,7 +207,7 @@ VISU_GaussPtsAct return Superclass::GetMapper(); } -float* +vtkFloatingPointType* VISU_GaussPtsAct ::GetBounds() { @@ -335,9 +335,9 @@ VISU_GaussPtsAct { myEventCallbackCommand->SetAbortFlag(1); - float aMagnification = myInsideCursorSettings->GetMagnification(); - float anIncrement = myInsideCursorSettings->GetIncrement(); - float coefficient = up ? anIncrement : 1 / anIncrement; + vtkFloatingPointType aMagnification = myInsideCursorSettings->GetMagnification(); + vtkFloatingPointType anIncrement = myInsideCursorSettings->GetIncrement(); + vtkFloatingPointType coefficient = up ? anIncrement : 1 / anIncrement; myInsideCursorSettings->SetMagnification( aMagnification * coefficient ); myInsideCursorSettings->InvokeEvent(VISU::UpdateFromSettingsEvent,NULL); @@ -377,16 +377,16 @@ VISU_GaussPtsAct namespace { inline - float + vtkFloatingPointType GetRadius(vtkIdType theVTKID, vtkDataArray *theScalarArray, VISU_GaussPointsPL* theGaussPointsPL) { - float aRadius = 0.5; + vtkFloatingPointType aRadius = 0.5; if(theGaussPointsPL->GetPSMapper()->GetPointSpriteMode() == 1) // Geometry mode aRadius *= theGaussPointsPL->GetSize() * theGaussPointsPL->GetAverageCellSize(); else if(theGaussPointsPL->GetBicolor()){ - float aVal = theScalarArray->GetTuple1(theVTKID); + vtkFloatingPointType aVal = theScalarArray->GetTuple1(theVTKID); if(aVal > 0.0) aRadius *= theGaussPointsPL->GetMaxSize(); else @@ -399,7 +399,7 @@ namespace } } -float +vtkFloatingPointType VISU_GaussPtsAct ::GetRadius(vtkIdType theObjID, vtkIdType theVTKID, @@ -409,7 +409,7 @@ VISU_GaussPtsAct } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPtsAct ::GetMagnification(vtkIdType theObjID) { @@ -421,17 +421,17 @@ VISU_GaussPtsAct namespace { inline - float + vtkFloatingPointType GetClamp(VISU_GaussPointsPL* theGaussPointsPL) { - float aClamp = theGaussPointsPL->GetClamp(); + vtkFloatingPointType aClamp = theGaussPointsPL->GetClamp(); if(theGaussPointsPL->GetPrimitiveType() == VISU_OpenGLPointSpriteMapper::GeomSphere) return -aClamp; return aClamp; } } -float +vtkFloatingPointType VISU_GaussPtsAct ::GetClamp(vtkIdType theObjID) { @@ -603,7 +603,9 @@ VISU_GaussPtsAct } //---------------------------------------------------------------------------- -bool VISU_GaussPtsAct::IsInfinitive() +bool +VISU_GaussPtsAct +::IsInfinitive() { if(vtkMapper* aMapper = myDeviceActor->GetMapper()){ if(vtkDataSet* aDataSet= aMapper->GetInput()){ @@ -614,6 +616,23 @@ bool VISU_GaussPtsAct::IsInfinitive() return myIsInfinite; } +//---------------------------------------------------------------------------- +int +VISU_GaussPtsAct +::GetPickable() +{ + if(Superclass::GetPickable()){ + if(vtkMapper* aMapper = GetMapper()){ + if(vtkDataSet* aDataSet= aMapper->GetInput()){ + aDataSet->Update(); + return aDataSet->GetNumberOfCells() > 0; + } + } + } + + return false; +} + //---------------------------------------------------------------------------- bool VISU_GaussPtsAct @@ -621,12 +640,15 @@ VISU_GaussPtsAct SVTK_SelectionEvent* theSelectionEvent, bool theIsHighlight) { + if ( !GetPickable() ) + return false; + myPreHighlightActor->SetVisibility(false); myCursorPyramid->SetVisibility(false); - if (!myBarVisibility) { + if (!myBarVisibility) return false; - } + if(!theIsHighlight) myLastObjPointID = -1; @@ -659,14 +681,14 @@ VISU_GaussPtsAct if(myIsPreselected){ anIsChanged = (myLastObjPointID != anObjId); if(anIsChanged){ - float* aNodeCoord = GetNodeCoord(anObjId); + vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId); vtkDataSet* aDataSet = GetInput(); vtkCellData* aCellData = aDataSet->GetCellData(); if(vtkDataArray *aScalarArray = aCellData->GetScalars()){ - float aPyramidHeight = myPickingSettings->GetPyramidHeight(); + vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight(); aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); - //float aColor[3] = myPreHighlightActor->GetProperty()->GetColor(); - float aColor[3]; + //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor(); + vtkFloatingPointType aColor[3]; theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor ); aColor[0] = 1. - aColor[0]; aColor[1] = 1. - aColor[1]; @@ -700,17 +722,15 @@ void ChangeZoom(VISU_PickingSettings *thePickingSettings, vtkInteractorStyle* theInteractorStyle, int theInitialHasIndex, - SVTK_Selector* theSelector, + int theCurrentHasIndex, const Handle(SALOME_InteractiveObject)& theIO) { - int aCurrentHasIndex = theSelector->HasIndex(theIO); - - if(theInitialHasIndex + aCurrentHasIndex == 1){ + if(theInitialHasIndex + theCurrentHasIndex == 1){ vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer(); vtkCamera *aCamera = aRenderer->GetActiveCamera(); - float aZoomFactor = thePickingSettings->GetZoomFactor(); + vtkFloatingPointType aZoomFactor = thePickingSettings->GetZoomFactor(); double aScale = aCamera->GetParallelScale(); - if (!theInitialHasIndex && aCurrentHasIndex) { + if (!theInitialHasIndex && theCurrentHasIndex) { aCamera->SetParallelScale(aScale/aZoomFactor); } else { @@ -726,34 +746,36 @@ VISU_GaussPtsAct SVTK_SelectionEvent* theSelectionEvent, bool theIsHighlight) { - myIsHighlighted = false; + if ( !GetPickable() ) + return false; + + int anInitialHasIndex = myIsHighlighted && mySelectionMode == GaussPointSelection; Handle(SALOME_InteractiveObject) anIO = getIO(); - int anInitialHasIndex = mySelector->HasIndex(anIO); + myIsHighlighted = false; Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode; - // + if(!theIsHighlight && aSelectionMode == GaussPointSelection){ mySelector->RemoveIObject(anIO); ChangeZoom(myPickingSettings, theInteractorStyle, anInitialHasIndex, - mySelector.GetPointer(), + false, anIO); return true; } - if (!myBarVisibility) { + if (!myBarVisibility) return false; - } - // - if(aSelectionMode == ActorSelection){ + + + if(aSelectionMode == ActorSelection) return Superclass::Highlight(theInteractorStyle, theSelectionEvent, theIsHighlight); - } - // + if(aSelectionMode == GaussPointSelection && !theSelectionEvent->myIsRectangle){ vtkRenderer *aRenderer = theInteractorStyle->GetCurrentRenderer(); @@ -768,7 +790,7 @@ VISU_GaussPtsAct ChangeZoom(myPickingSettings, theInteractorStyle, anInitialHasIndex, - mySelector.GetPointer(), + false, anIO); return true; @@ -790,11 +812,11 @@ VISU_GaussPtsAct mySelector->AddIObject(this); } // - float* aNodeCoord = GetNodeCoord(anObjId); + vtkFloatingPointType* aNodeCoord = GetNodeCoord(anObjId); // // FlyTo vtkRenderWindowInteractor* anInteractor = theInteractorStyle->GetInteractor(); - float aDollyWas = anInteractor->GetDolly(); + vtkFloatingPointType aDollyWas = anInteractor->GetDolly(); int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames(); anInteractor->SetDolly(0.); @@ -809,7 +831,7 @@ VISU_GaussPtsAct ChangeZoom(myPickingSettings, theInteractorStyle, anInitialHasIndex, - mySelector.GetPointer(), + true, anIO); return true; @@ -821,7 +843,7 @@ VISU_GaussPtsAct ChangeZoom(myPickingSettings, theInteractorStyle, anInitialHasIndex, - mySelector.GetPointer(), + false, anIO); return false; @@ -870,20 +892,20 @@ VISU_GaussPtsAct // vtkIdType aVtkId = GetNodeVTKID(anObjId); if(aVtkId >= 0){ - float *aNodeCoord = GetNodeCoord(anObjId); - float aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.}; + vtkFloatingPointType *aNodeCoord = GetNodeCoord(anObjId); + vtkFloatingPointType aWorldCoord[4] = {aNodeCoord[0], aNodeCoord[1], aNodeCoord[2], 1.}; // vtkDataSet* aDataSet = GetInput(); vtkCellData* aDataSetAttributes = aDataSet->GetCellData(); // if(vtkDataArray* aScalarArray = aDataSetAttributes->GetScalars()){ - float aVal = aScalarArray->GetTuple1(aVtkId); + vtkFloatingPointType aVal = aScalarArray->GetTuple1(aVtkId); // GetScalarBarCtrl()->SetIsMarked(true); GetScalarBarCtrl()->SetMarkValue(aVal); GetScalarBarCtrl()->Update(); // - float aPyramidHeight = myPickingSettings->GetPyramidHeight(); + vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight(); aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize(); myCursorPyramidSelected->Init(aPyramidHeight, myPickingSettings->GetCursorSize(), @@ -916,7 +938,7 @@ VISU_GaussPtsAct aStr<<"\nData: {"; int anId = 0; while(anId < aNbComp){ - float aComp = aFloatArray->GetComponent(aVtkId,anId++); + vtkFloatingPointType aComp = aFloatArray->GetComponent(aVtkId,anId++); aStr<SetModePosition(myPickingSettings->GetInfoWindowPosition()); myTextActor->SetTransparency(myPickingSettings->GetInfoWindowTransparency()); - float aHeight = myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight(); - float aCursorSize = myPickingSettings->GetCursorSize(); + vtkFloatingPointType aHeight = myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight(); + vtkFloatingPointType aCursorSize = myPickingSettings->GetCursorSize(); myCursorPyramid->SetPreferences(aHeight,aCursorSize); myCursorPyramidSelected->SetPreferences(aHeight,aCursorSize); @@ -1200,7 +1222,7 @@ VISU_GaussPtsAct1 //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPtsAct1 ::GetRadius(vtkIdType theObjID, vtkIdType theVTKID, @@ -1218,7 +1240,7 @@ VISU_GaussPtsAct1 //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPtsAct1 ::GetMagnification(vtkIdType theObjID) { @@ -1234,7 +1256,7 @@ VISU_GaussPtsAct1 //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPtsAct1 ::GetClamp(vtkIdType theObjID) { @@ -1314,7 +1336,7 @@ VISU_GaussPtsAct1 SALOME_ExtractGeometry* anExtractGeometry = aPipeline->GetExtractGeometryFilter(); vtkImplicitFunction* anImplicitFunction = anExtractGeometry->GetImplicitFunction(); - float aMagnification = aPipeline->GetMagnification(); + vtkFloatingPointType aMagnification = aPipeline->GetMagnification(); aPipeline->ShallowCopy(GetGaussPointsPL()); diff --git a/src/OBJECT/VISU_GaussPtsAct.h b/src/OBJECT/VISU_GaussPtsAct.h index 4e7094b9..ef7279c6 100644 --- a/src/OBJECT/VISU_GaussPtsAct.h +++ b/src/OBJECT/VISU_GaussPtsAct.h @@ -106,7 +106,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor //! Redefined method of getting an actor bounds. virtual - float* + vtkFloatingPointType* GetBounds(); //! Redefined method of getting an actor input. @@ -231,6 +231,10 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor bool IsInfinitive(); + virtual + int + GetPickable(); + protected: //---------------------------------------------------------------------------- VISU_GaussPtsAct(); @@ -249,19 +253,19 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor //! To get current value of the radius of the Point Sprite virtual - float + vtkFloatingPointType GetRadius(vtkIdType theObjID, vtkIdType theVTKID, vtkDataArray *theScalarArray); //! To get current value of the magnification virtual - float + vtkFloatingPointType GetMagnification(vtkIdType theObjID); //! To get current value of the clamp virtual - float + vtkFloatingPointType GetClamp(vtkIdType theObjID); //---------------------------------------------------------------------------- @@ -280,7 +284,7 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor void OnInteractorEvent(unsigned long theEvent); - float myPriority; + vtkFloatingPointType myPriority; bool myChangeMagnification; VISU::TGaussPtsActorFactory* myGaussPtsActorFactory; boost::signal1 myUpdatePrs3dSignal; @@ -388,19 +392,19 @@ class VTKOCC_EXPORT VISU_GaussPtsAct1 : public VISU_GaussPtsAct //! To get current value of the radius of the Point Sprite virtual - float + vtkFloatingPointType GetRadius(vtkIdType theObjID, vtkIdType theVTKID, vtkDataArray *theScalarArray); //! To get current value of the magnification virtual - float + vtkFloatingPointType GetMagnification(vtkIdType theObjID); //! To get current value of the clamp virtual - float + vtkFloatingPointType GetClamp(vtkIdType theObjID); //---------------------------------------------------------------------------- diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx index a59f4f20..0b72f021 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.cxx +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.cxx @@ -152,6 +152,22 @@ VISU_GaussPtsDeviceActor return myMapper.GetPointer(); } +int +VISU_GaussPtsDeviceActor +::GetPickable() +{ + if(Superclass::GetPickable()){ + if(vtkMapper* aMapper = GetMapper()){ + if(vtkDataSet* aDataSet= aMapper->GetInput()){ + aDataSet->Update(); + return aDataSet->GetNumberOfCells() > 0; + } + } + } + + return false; +} + //---------------------------------------------------------------------------- void @@ -241,28 +257,28 @@ VISU_CursorPyramid } this->SetScale(1.0); - float aMRadius = myRadius*myMagnification; + vtkFloatingPointType aMRadius = myRadius*myMagnification; Init(myHeight,aMRadius*myCursorSize); if(myClamp > 0.0f){ - float aPoint1[3] = {0.0, 0.0, 0.0}; + vtkFloatingPointType aPoint1[3] = {0.0, 0.0, 0.0}; ren->SetDisplayPoint(aPoint1); ren->DisplayToWorld(); ren->GetWorldPoint(aPoint1); - float aPoint2[3] = {0.0, myClamp, 0.0}; + vtkFloatingPointType aPoint2[3] = {0.0, myClamp, 0.0}; ren->SetDisplayPoint(aPoint2); ren->DisplayToWorld(); ren->GetWorldPoint(aPoint2); - float aWorldClamp = + vtkFloatingPointType aWorldClamp = (aPoint2[0] - aPoint1[0])*(aPoint2[0] - aPoint1[0]) + (aPoint2[1] - aPoint1[1])*(aPoint2[1] - aPoint1[1]) + (aPoint2[2] - aPoint1[2])*(aPoint2[2] - aPoint1[2]); aWorldClamp = sqrt(aWorldClamp); - float aMDiameter = 2.0 * aMRadius; - float aCoeff = aWorldClamp / aMDiameter; + vtkFloatingPointType aMDiameter = 2.0 * aMRadius; + vtkFloatingPointType aCoeff = aWorldClamp / aMDiameter; if(aCoeff < 1.0){ this->SetScale(aCoeff); @@ -323,8 +339,8 @@ VISU_CursorPyramid //---------------------------------------------------------------------------- void VISU_CursorPyramid -::SetPreferences(float theHeight, - float theCursorSize) +::SetPreferences(vtkFloatingPointType theHeight, + vtkFloatingPointType theCursorSize) { Init(theHeight, theCursorSize, myRadius, myMagnification, myClamp, GetPosition(), GetProperty()->GetColor()); } @@ -332,13 +348,13 @@ VISU_CursorPyramid //---------------------------------------------------------------------------- void VISU_CursorPyramid -::Init(float theHeight, - float theCursorSize, - float theRadius, - float theMagnification, - float theClamp, - float thePos[3], - float theColor[3]) +::Init(vtkFloatingPointType theHeight, + vtkFloatingPointType theCursorSize, + vtkFloatingPointType theRadius, + vtkFloatingPointType theMagnification, + vtkFloatingPointType theClamp, + vtkFloatingPointType thePos[3], + vtkFloatingPointType theColor[3]) { Init(theHeight,theRadius*theMagnification*theCursorSize); SetPosition(thePos[0],thePos[1],thePos[2]); @@ -357,8 +373,8 @@ VISU_CursorPyramid void VISU_CursorPyramid -::Init(float theHeight, - float theRadius) +::Init(vtkFloatingPointType theHeight, + vtkFloatingPointType theRadius) { for(int i = 0; i < myNbCones; ++i){ vtkConeSource* aSource = mySources[i].GetPointer(); @@ -368,7 +384,7 @@ VISU_CursorPyramid aSource->SetAngle(20.0); } - float aDisplacement = -0.5*theHeight - theRadius; + vtkFloatingPointType aDisplacement = -0.5*theHeight - theRadius; // X mySources[0]->SetDirection(1.0, 0.0, 0.0); @@ -507,7 +523,7 @@ int VISU_FramedTextActor::GetPickable() // function : SetTransparency // purpose : //================================================================== -void VISU_FramedTextActor::SetTransparency(const float theTransparency) +void VISU_FramedTextActor::SetTransparency(const vtkFloatingPointType theTransparency) { if (theTransparency>=0. && theTransparency<=1.){ myTransparency=theTransparency; @@ -519,7 +535,7 @@ void VISU_FramedTextActor::SetTransparency(const float theTransparency) // function : GetTransparency // purpose : //================================================================== -float VISU_FramedTextActor::GetTransparency()const +vtkFloatingPointType VISU_FramedTextActor::GetTransparency()const { return myTransparency; } @@ -561,7 +577,7 @@ int VISU_FramedTextActor::GetModePosition()const // function : SetWorldPoint // purpose : //================================================================== -void VISU_FramedTextActor::SetWorldPoint(const float theWorldPoint[4]) +void VISU_FramedTextActor::SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]) { for(int i = 0; i<4; ++i) { myWorldPoint[i] = theWorldPoint[i]; @@ -572,7 +588,7 @@ void VISU_FramedTextActor::SetWorldPoint(const float theWorldPoint[4]) // function : GetWorldPoint // purpose : //================================================================== -const float* VISU_FramedTextActor::GetWorldPoint()const +const vtkFloatingPointType* VISU_FramedTextActor::GetWorldPoint()const { return myWorldPoint; } @@ -580,7 +596,7 @@ const float* VISU_FramedTextActor::GetWorldPoint()const // function : SetDistance // purpose : //================================================================== -void VISU_FramedTextActor::SetDistance(const float theDistance) +void VISU_FramedTextActor::SetDistance(const vtkFloatingPointType theDistance) { myDistance=theDistance; } @@ -588,7 +604,7 @@ void VISU_FramedTextActor::SetDistance(const float theDistance) // function : GetDistance // purpose : //================================================================== -float VISU_FramedTextActor::GetDistance()const +vtkFloatingPointType VISU_FramedTextActor::GetDistance()const { return myDistance; } @@ -649,10 +665,10 @@ VISU_FramedTextActor theViewport->SetWorldPoint(myWorldPoint); theViewport->WorldToDisplay(); - float aSelectionPoint[3]; + vtkFloatingPointType aSelectionPoint[3]; theViewport->GetDisplayPoint(aSelectionPoint); - float u = aSelectionPoint[0]; - float v = aSelectionPoint[1] - myDistance; + vtkFloatingPointType u = aSelectionPoint[0]; + vtkFloatingPointType v = aSelectionPoint[1] - myDistance; theViewport->ViewportToNormalizedViewport(u, v); PositionCoordinate->SetValue(u, v); // diff --git a/src/OBJECT/VISU_GaussPtsDeviceActor.h b/src/OBJECT/VISU_GaussPtsDeviceActor.h index e25e9256..c03d736c 100644 --- a/src/OBJECT/VISU_GaussPtsDeviceActor.h +++ b/src/OBJECT/VISU_GaussPtsDeviceActor.h @@ -79,6 +79,10 @@ class VISU_GaussPtsDeviceActor: public vtkLODActor VISU_OpenGLPointSpriteMapper* GetPSMapper(); + virtual + int + GetPickable(); + protected: //---------------------------------------------------------------------------- vtkSmartPointer myPipeLine; @@ -126,34 +130,34 @@ public: RemoveFromRender(vtkRenderer* theRenderer); void - Init(float theHeight, - float theCursorSize, - float theRadius, - float theMagnification, - float theClamp, - float thePos[3], - float theColor[3]); + Init(vtkFloatingPointType theHeight, + vtkFloatingPointType theCursorSize, + vtkFloatingPointType theRadius, + vtkFloatingPointType theMagnification, + vtkFloatingPointType theClamp, + vtkFloatingPointType thePos[3], + vtkFloatingPointType theColor[3]); - void SetPreferences(float theHeight, - float theCursorSize); + void SetPreferences(vtkFloatingPointType theHeight, + vtkFloatingPointType theCursorSize); protected: VISU_CursorPyramid(); void - Init(float theHeight, - float theRadius); + Init(vtkFloatingPointType theHeight, + vtkFloatingPointType theRadius); int myNbCones; vtkSmartPointer mySources[6]; vtkSmartPointer myAppendFilter; vtkSmartPointer myMapper; // - float myHeight; - float myCursorSize; - float myRadius; - float myMagnification; - float myClamp; + vtkFloatingPointType myHeight; + vtkFloatingPointType myCursorSize; + vtkFloatingPointType myRadius; + vtkFloatingPointType myMagnification; + vtkFloatingPointType myClamp; private: VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented @@ -199,14 +203,14 @@ public: void SetModePosition(const int theMode); int GetModePosition()const; // - void SetWorldPoint(const float theWorldPoint[4]); - const float* GetWorldPoint()const; + void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]); + const vtkFloatingPointType* GetWorldPoint()const; // - void SetDistance(const float theDistance); - float GetDistance()const; + void SetDistance(const vtkFloatingPointType theDistance); + vtkFloatingPointType GetDistance()const; // - void SetTransparency(const float theTransparency); - float GetTransparency()const; + void SetTransparency(const vtkFloatingPointType theTransparency); + vtkFloatingPointType GetTransparency()const; // protected: VISU_FramedTextActor(); @@ -224,9 +228,9 @@ protected: vtkTimeStamp myBuildTime; // int myModePosition; - float myWorldPoint[4]; - float myDistance; - float myTransparency; + vtkFloatingPointType myWorldPoint[4]; + vtkFloatingPointType myDistance; + vtkFloatingPointType myTransparency; private: VISU_FramedTextActor(const VISU_FramedTextActor&); // Not implemented. diff --git a/src/OBJECT/VISU_GaussPtsSettings.h b/src/OBJECT/VISU_GaussPtsSettings.h index 1778521d..82da6ed1 100644 --- a/src/OBJECT/VISU_GaussPtsSettings.h +++ b/src/OBJECT/VISU_GaussPtsSettings.h @@ -32,6 +32,8 @@ #include #include +#include "VTKViewer.h" + class vtkImageData; @@ -64,34 +66,34 @@ class VISU_GaussPtsSettings : public vtkObject vtkSetMacro( PrimitiveType, int ); vtkGetMacro( PrimitiveType, int ); - vtkSetMacro( Clamp, float ); - vtkGetMacro( Clamp, float ); + vtkSetMacro( Clamp, vtkFloatingPointType ); + vtkGetMacro( Clamp, vtkFloatingPointType ); vtkSetMacro( Texture, vtkImageData* ); vtkGetMacro( Texture, vtkImageData* ); - vtkSetMacro( AlphaThreshold, float ); - vtkGetMacro( AlphaThreshold, float ); + vtkSetMacro( AlphaThreshold, vtkFloatingPointType ); + vtkGetMacro( AlphaThreshold, vtkFloatingPointType ); vtkSetMacro( Resolution, int ); vtkGetMacro( Resolution, int ); - vtkSetMacro( Magnification, float ); - vtkGetMacro( Magnification, float ); + vtkSetMacro( Magnification, vtkFloatingPointType ); + vtkGetMacro( Magnification, vtkFloatingPointType ); - vtkSetMacro( Increment, float ); - vtkGetMacro( Increment, float ); + vtkSetMacro( Increment, vtkFloatingPointType ); + vtkGetMacro( Increment, vtkFloatingPointType ); protected: bool Initial; int PrimitiveType; - float Clamp; + vtkFloatingPointType Clamp; vtkImageData* Texture; - float AlphaThreshold; + vtkFloatingPointType AlphaThreshold; int Resolution; - float Magnification; - float Increment; + vtkFloatingPointType Magnification; + vtkFloatingPointType Increment; }; @@ -113,15 +115,15 @@ class VISU_InsideCursorSettings : public VISU_GaussPtsSettings VISU_InsideCursorSettings* New(); - vtkSetMacro( MinSize, float ); - vtkGetMacro( MinSize, float ); + vtkSetMacro( MinSize, vtkFloatingPointType ); + vtkGetMacro( MinSize, vtkFloatingPointType ); - vtkSetMacro( MaxSize, float ); - vtkGetMacro( MaxSize, float ); + vtkSetMacro( MaxSize, vtkFloatingPointType ); + vtkGetMacro( MaxSize, vtkFloatingPointType ); protected: - float MinSize; - float MaxSize; + vtkFloatingPointType MinSize; + vtkFloatingPointType MaxSize; }; @@ -144,19 +146,19 @@ class VISU_OutsideCursorSettings : public VISU_GaussPtsSettings VISU_OutsideCursorSettings* New(); - vtkSetMacro( Size, float ); - vtkGetMacro( Size, float ); + vtkSetMacro( Size, vtkFloatingPointType ); + vtkGetMacro( Size, vtkFloatingPointType ); vtkSetMacro( Uniform, bool ); vtkGetMacro( Uniform, bool ); - vtkSetVector3Macro( Color, float ); - vtkGetVector3Macro( Color, float ); + vtkSetVector3Macro( Color, vtkFloatingPointType ); + vtkGetVector3Macro( Color, vtkFloatingPointType ); protected: - float Size; + vtkFloatingPointType Size; bool Uniform; - float Color[3]; + vtkFloatingPointType Color[3]; }; @@ -186,26 +188,26 @@ class VISU_PickingSettings : public vtkObject vtkSetMacro( Initial, bool ); vtkGetMacro( Initial, bool ); - vtkSetMacro( PyramidHeight, float ); - vtkGetMacro( PyramidHeight, float ); + vtkSetMacro( PyramidHeight, vtkFloatingPointType ); + vtkGetMacro( PyramidHeight, vtkFloatingPointType ); - vtkSetMacro( CursorSize, float ); - vtkGetMacro( CursorSize, float ); + vtkSetMacro( CursorSize, vtkFloatingPointType ); + vtkGetMacro( CursorSize, vtkFloatingPointType ); - vtkSetVector3Macro( Color, float ); - vtkGetVector3Macro( Color, float ); + vtkSetVector3Macro( Color, vtkFloatingPointType ); + vtkGetVector3Macro( Color, vtkFloatingPointType ); - vtkSetMacro( PointTolerance, float ); - vtkGetMacro( PointTolerance, float ); + vtkSetMacro( PointTolerance, vtkFloatingPointType ); + vtkGetMacro( PointTolerance, vtkFloatingPointType ); - vtkSetMacro( InfoWindowTransparency, float ); - vtkGetMacro( InfoWindowTransparency, float ); + vtkSetMacro( InfoWindowTransparency, vtkFloatingPointType ); + vtkGetMacro( InfoWindowTransparency, vtkFloatingPointType ); vtkSetMacro( InfoWindowPosition, int ); vtkGetMacro( InfoWindowPosition, int ); - vtkSetMacro( ZoomFactor, float ); - vtkGetMacro( ZoomFactor, float ); + vtkSetMacro( ZoomFactor, vtkFloatingPointType ); + vtkGetMacro( ZoomFactor, vtkFloatingPointType ); vtkSetMacro( StepNumber, int ); vtkGetMacro( StepNumber, int ); @@ -216,13 +218,13 @@ class VISU_PickingSettings : public vtkObject private: bool Initial; - float PyramidHeight; - float CursorSize; - float PointTolerance; - float Color[3]; - float InfoWindowTransparency; + vtkFloatingPointType PyramidHeight; + vtkFloatingPointType CursorSize; + vtkFloatingPointType PointTolerance; + vtkFloatingPointType Color[3]; + vtkFloatingPointType InfoWindowTransparency; int InfoWindowPosition; - float ZoomFactor; + vtkFloatingPointType ZoomFactor; int StepNumber; bool DisplayParentMesh; }; diff --git a/src/OBJECT/VISU_MeshAct.cxx b/src/OBJECT/VISU_MeshAct.cxx index b6b812d9..f93f9c6b 100644 --- a/src/OBJECT/VISU_MeshAct.cxx +++ b/src/OBJECT/VISU_MeshAct.cxx @@ -115,7 +115,7 @@ VISU_MeshAct void VISU_MeshAct -::SetShrinkFactor(float theValue) +::SetShrinkFactor(vtkFloatingPointType theValue) { Superclass::SetShrinkFactor(theValue); @@ -149,12 +149,12 @@ VISU_MeshAct //---------------------------------------------------------------------------- void VISU_MeshAct -::SetOpacity(float theValue) +::SetOpacity(vtkFloatingPointType theValue) { GetSurfaceProperty()->SetOpacity(theValue); } -float +vtkFloatingPointType VISU_MeshAct ::GetOpacity() { @@ -164,12 +164,12 @@ VISU_MeshAct //---------------------------------------------------------------------------- void VISU_MeshAct -::SetLineWidth(float theLineWidth) +::SetLineWidth(vtkFloatingPointType theLineWidth) { GetEdgeProperty()->SetLineWidth(theLineWidth); } -float +vtkFloatingPointType VISU_MeshAct::GetLineWidth() { return GetEdgeProperty()->GetLineWidth(); @@ -225,17 +225,23 @@ VISU_MeshAct using namespace SVTK::Representation; switch(GetRepresentation()){ case Points : + myNodeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); myNodeActor->RenderOpaqueGeometry(ren); break; case Wireframe : case Insideframe : + myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); myEdgeActor->RenderOpaqueGeometry(ren); break; case Surface : + mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); mySurfaceActor->RenderOpaqueGeometry(ren); break; case Surfaceframe : + mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren); mySurfaceActor->RenderOpaqueGeometry(ren); + + myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren); myEdgeActor->RenderOpaqueGeometry(ren); break; } @@ -253,17 +259,23 @@ VISU_MeshAct using namespace SVTK::Representation; switch(GetRepresentation()){ case Points : + myNodeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); myNodeActor->RenderTranslucentGeometry(ren); break; case Wireframe : case Insideframe : + myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); myEdgeActor->RenderTranslucentGeometry(ren); break; case Surface : + mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); mySurfaceActor->RenderTranslucentGeometry(ren); break; case Surfaceframe : + mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren); mySurfaceActor->RenderTranslucentGeometry(ren); + + myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren); myEdgeActor->RenderTranslucentGeometry(ren); break; } diff --git a/src/OBJECT/VISU_MeshAct.h b/src/OBJECT/VISU_MeshAct.h index 9dafb348..80735f23 100644 --- a/src/OBJECT/VISU_MeshAct.h +++ b/src/OBJECT/VISU_MeshAct.h @@ -65,18 +65,18 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor virtual void - SetOpacity(float theValue); + SetOpacity(vtkFloatingPointType theValue); virtual - float + vtkFloatingPointType GetOpacity(); virtual void - SetLineWidth(float theLineWidth); + SetLineWidth(vtkFloatingPointType theLineWidth); virtual - float + vtkFloatingPointType GetLineWidth(); virtual @@ -89,7 +89,7 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor virtual void - SetShrinkFactor(float theFactor = 0.8); + SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); virtual void diff --git a/src/PIPELINE/Makefile.in b/src/PIPELINE/Makefile.in index 8f775a80..935c8525 100644 --- a/src/PIPELINE/Makefile.in +++ b/src/PIPELINE/Makefile.in @@ -96,16 +96,16 @@ BIN_SRC = CPPFLAGS+= \ $(VTK_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome \ - -I${GUI_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(MED_CXXFLAGS) \ $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) LDFLAGS+= \ $(VTK_LIBS) -lVTKViewer -lVisuConvertor \ - -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace \ - -L${GUI_ROOT_DIR}/lib/salome \ - -L${MED_ROOT_DIR}/lib/salome + $(KERNEL_LDFLAGS) -lSALOMELocalTrace \ + $(GUI_LDFLAGS) \ + $(MED_LDFLAGS) LDFLAGSFORBIN=$(LDFLAGS) -lOpUtil -lMEDWrapper -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lmed_V2_1 -lsuit -lqtx -lSALOMEBasics diff --git a/src/PIPELINE/SALOME_ExtractGeometry.cxx b/src/PIPELINE/SALOME_ExtractGeometry.cxx index 5a1762e8..e4c986c3 100755 --- a/src/PIPELINE/SALOME_ExtractGeometry.cxx +++ b/src/PIPELINE/SALOME_ExtractGeometry.cxx @@ -198,8 +198,8 @@ SALOME_ExtractGeometry vtkIdList *cellPts; vtkCell *cell; int numCellPts; - float *x; - float multiplier; + vtkFloatingPointType *x; + vtkFloatingPointType multiplier; vtkPoints *newPts; vtkIdList *newCellPts; vtkDataSet *input = this->GetInput(); @@ -271,7 +271,7 @@ SALOME_ExtractGeometry // To extract boundary cells, we have to create supplemental information if ( this->ExtractBoundaryCells ) { - float val; + vtkFloatingPointType val; newScalars = vtkFloatArray::New(); newScalars->SetNumberOfValues(numPts); diff --git a/src/PIPELINE/SALOME_ExtractGeometry.h b/src/PIPELINE/SALOME_ExtractGeometry.h index b225434f..14b8718a 100755 --- a/src/PIPELINE/SALOME_ExtractGeometry.h +++ b/src/PIPELINE/SALOME_ExtractGeometry.h @@ -20,6 +20,8 @@ #ifndef SALOME_ExtractGeometry_H #define SALOME_ExtractGeometry_H +#include "VTKViewer.h" + #include #include diff --git a/src/PIPELINE/VISU_CutLinesPL.cxx b/src/PIPELINE/VISU_CutLinesPL.cxx index e2cfe567..f3849887 100644 --- a/src/PIPELINE/VISU_CutLinesPL.cxx +++ b/src/PIPELINE/VISU_CutLinesPL.cxx @@ -34,12 +34,17 @@ using namespace std; vtkStandardNewMacro(VISU_CutLinesPL); -VISU_CutLinesPL::VISU_CutLinesPL(){ +VISU_CutLinesPL +::VISU_CutLinesPL() +{ myCondition = 1; myPosition = 0; } -void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_CutLinesPL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ if(VISU_CutLinesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(1), aPipeLine->GetRotateX(1),aPipeLine->GetRotateY(1),1); @@ -50,7 +55,10 @@ void VISU_CutLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ VISU_CutPlanesPL::ShallowCopy(thePipeLine); } -void VISU_CutLinesPL::Init(){ +void +VISU_CutLinesPL +::Init() +{ VISU_CutPlanesPL::Init(); myBasePlane[0] = XY; @@ -64,15 +72,21 @@ void VISU_CutLinesPL::Init(){ } -void VISU_CutLinesPL::SetPosition(float thePosition){ +void +VISU_CutLinesPL +::SetPosition(vtkFloatingPointType thePosition) +{ myPosition = thePosition; myCondition = 0; Modified(); } -float VISU_CutLinesPL::GetPosition(){ - float aPosition = myPosition; +vtkFloatingPointType +VISU_CutLinesPL +::GetPosition() +{ + vtkFloatingPointType aPosition = myPosition; if(myCondition){ - float aDir[3], aBounds[6], aBoundPrj[3]; + vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3]; GetInput2()->GetBounds(aBounds); GetDir(aDir,myAng[0],myBasePlane[0]); GetBoundProject(aBoundPrj,aBounds,aDir); @@ -81,21 +95,30 @@ float VISU_CutLinesPL::GetPosition(){ return aPosition; } -void VISU_CutLinesPL::SetDefault(){ +void +VISU_CutLinesPL +::SetDefault() +{ myCondition = 1; Modified(); } -int VISU_CutLinesPL::IsDefault(){ +int +VISU_CutLinesPL +::IsDefault() +{ return myCondition; } -void VISU_CutLinesPL::Update(){ +void +VISU_CutLinesPL +::Update() +{ ClearAppendPolyData(myAppendPolyData); SetPartPosition(1); vtkAppendPolyData *anAppendPolyData = vtkAppendPolyData::New(); //Build base plane - float aDir[2][3], aBaseBounds[6]; + vtkFloatingPointType aDir[2][3], aBaseBounds[6]; GetInput2()->GetBounds(aBaseBounds); GetDir(aDir[0],myAng[0],myBasePlane[0]); vtkUnstructuredGrid* anUnstructuredGrid = @@ -103,7 +126,7 @@ void VISU_CutLinesPL::Update(){ CutWithPlanes(anAppendPolyData,anUnstructuredGrid,1,aDir[0],aBaseBounds, myPosition,myCondition,myDisplacement[0]); //Build lines - float aBounds[6]; + vtkFloatingPointType aBounds[6]; vtkDataSet *aDataSet = anAppendPolyData->GetOutput(); aDataSet->Update(); if(aDataSet->GetNumberOfCells() == 0) @@ -116,21 +139,31 @@ void VISU_CutLinesPL::Update(){ anAppendPolyData->Delete(); //Calculate values for building of table vtkMath::Cross(aDir[0],aDir[1],myDirLn); - for (int i=0; i<3 ; i++) if(myDirLn[i]<0) myDirLn[i] = (-1)*myDirLn[i];//enk:: correction of bug Bug PAL10401 + for (int i=0; i<3 ; i++) { + myRealDirLn[i] = myDirLn[i]; + if(myDirLn[i]<0) myDirLn[i] = (-1)*myDirLn[i];//enk:: correction of bug Bug PAL10401 + } GetBoundProject(myBoundPrjLn, aBaseBounds, myDirLn); VISU::Mul(myDirLn,myBoundPrjLn[0],myBasePnt); + CorrectPnt(myBasePnt,aBaseBounds); VISU_ScalarMapPL::Update(); } -void VISU_CutLinesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - float thePartPosition, int thePartCondition, - float theDisplacement) +void +VISU_CutLinesPL +::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + vtkFloatingPointType thePartPosition, + int thePartCondition, + vtkFloatingPointType theDisplacement) { - vector aPartPosition(1,thePartPosition); + vector aPartPosition(1,thePartPosition); vector aPartCondition(1,thePartCondition); VISU_CutPlanesPL::CutWithPlanes(theAppendPolyData,theDataSet,theNbPlanes,theDir,theBounds, aPartPosition,aPartCondition,theDisplacement); diff --git a/src/PIPELINE/VISU_CutLinesPL.hxx b/src/PIPELINE/VISU_CutLinesPL.hxx index cc316781..05fb29a0 100644 --- a/src/PIPELINE/VISU_CutLinesPL.hxx +++ b/src/PIPELINE/VISU_CutLinesPL.hxx @@ -37,31 +37,81 @@ protected: VISU_CutLinesPL(const VISU_CutLinesPL&); public: vtkTypeMacro(VISU_CutLinesPL,VISU_CutPlanesPL); - static VISU_CutLinesPL* New(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SetPosition(float thePosition); - virtual float GetPosition(); + static + VISU_CutLinesPL* + New(); - virtual void SetDefault(); - virtual int IsDefault(); + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + void + SetPosition(vtkFloatingPointType thePosition); + + virtual + vtkFloatingPointType + GetPosition(); + + virtual + void + SetDefault(); + + virtual + int + IsDefault(); public: - virtual void Init(); - virtual void Update(); + virtual + void + Init(); + + virtual + void + Update(); + + static + void + CutWithPlanes(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + vtkFloatingPointType thePlanePosition, + int thePlaneCondition, + vtkFloatingPointType theDisplacement); + + const vtkFloatingPointType* + GetDirLn() + { + return myDirLn; + } + + const vtkFloatingPointType* + GetRealDirLn() + { + return myRealDirLn; + } - static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - float thePlanePosition, int thePlaneCondition, - float theDisplacement); + const vtkFloatingPointType* + GetBoundPrjLn() + { + return myBoundPrjLn; + } - const float* GetDirLn(){ return myDirLn;} - const float* GetBoundPrjLn(){ return myBoundPrjLn;} - const float* GetBasePnt(){ return myBasePnt;} + const vtkFloatingPointType* + GetBasePnt() + { + return myBasePnt; + } protected: - float myDirLn[3], myBoundPrjLn[3], myBasePnt[3]; - float myPosition; + vtkFloatingPointType myDirLn[3]; + vtkFloatingPointType myRealDirLn[3]; + vtkFloatingPointType myBoundPrjLn[3]; + vtkFloatingPointType myBasePnt[3]; + vtkFloatingPointType myPosition; int myCondition; }; diff --git a/src/PIPELINE/VISU_CutPlanesPL.cxx b/src/PIPELINE/VISU_CutPlanesPL.cxx index 2a547971..8bd5837f 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.cxx +++ b/src/PIPELINE/VISU_CutPlanesPL.cxx @@ -35,11 +35,13 @@ using namespace std; -static float EPS = 1.0E-3; +static vtkFloatingPointType EPS = 1.0E-3; vtkStandardNewMacro(VISU_CutPlanesPL); -VISU_CutPlanesPL::VISU_CutPlanesPL(){ +VISU_CutPlanesPL +::VISU_CutPlanesPL() +{ myAppendPolyData = vtkAppendPolyData::New(); myIsShrinkable = false; @@ -54,11 +56,16 @@ VISU_CutPlanesPL::VISU_CutPlanesPL(){ myAng[1][0] = myAng[1][1] = myAng[1][2] = 0.0; } -VISU_CutPlanesPL::~VISU_CutPlanesPL(){ +VISU_CutPlanesPL +::~VISU_CutPlanesPL() +{ myAppendPolyData->Delete(); } -void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_CutPlanesPL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ if(VISU_CutPlanesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetOrientation(aPipeLine->GetPlaneOrientation(), aPipeLine->GetRotateX(),aPipeLine->GetRotateY()); @@ -70,7 +77,10 @@ void VISU_CutPlanesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ VISU_ScalarMapPL::ShallowCopy(thePipeLine); } -void VISU_CutPlanesPL::Init(){ +void +VISU_CutPlanesPL +::Init() +{ VISU_ScalarMapPL::Init(); SetNbParts(10); @@ -79,16 +89,22 @@ void VISU_CutPlanesPL::Init(){ myAng[0][0] = myAng[0][1] = myAng[0][2] = 0.0; } -VISU_ScalarMapPL::THook* VISU_CutPlanesPL::DoHook(){ +VISU_ScalarMapPL::THook* +VISU_CutPlanesPL +::DoHook() +{ return myAppendPolyData->GetOutput(); } -void VISU_CutPlanesPL::Update(){ +void +VISU_CutPlanesPL +::Update() +{ ClearAppendPolyData(myAppendPolyData); SetPartPosition(); - float aDir[3]; + vtkFloatingPointType aDir[3]; GetDir(aDir,myAng[0],myBasePlane[0]); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; GetInput2()->GetBounds(aBounds); vtkDataSet* aDataSet = myFieldTransform->GetUnstructuredGridOutput(); CutWithPlanes(myAppendPolyData,aDataSet,myNbParts,aDir,aBounds, @@ -97,18 +113,28 @@ void VISU_CutPlanesPL::Update(){ VISU_ScalarMapPL::Update(); } -void VISU_CutPlanesPL::SetPartPosition(int theNum){ +void +VISU_CutPlanesPL +::SetPartPosition(int theNum) +{ for(int i = 0; i < myNbParts; i++) myPartPosition[i] = GetPartPosition(i,theNum); } -void VISU_CutPlanesPL::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData){ +void +VISU_CutPlanesPL +::ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData) +{ int iEnd = theAppendPolyData->GetNumberOfInputs(); for(int i = iEnd-1; i >= 0; i--) theAppendPolyData->RemoveInput(theAppendPolyData->GetInput(i)); } -float* VISU_CutPlanesPL::GetRx(float theRx[3][3], float thaAng){ +vtkFloatingPointType* +VISU_CutPlanesPL:: +GetRx(vtkFloatingPointType theRx[3][3], + vtkFloatingPointType thaAng) +{ theRx[0][0] = 1.0; theRx[0][1] = 0.0; theRx[0][2] = 0.0; theRx[1][0] = 0.0; theRx[1][1] = cos(thaAng); theRx[1][2] = -sin(thaAng); theRx[2][0] = 0.0; theRx[2][1] = sin(thaAng); theRx[2][2] = cos(thaAng); @@ -116,7 +142,11 @@ float* VISU_CutPlanesPL::GetRx(float theRx[3][3], float thaAng){ } -float* VISU_CutPlanesPL::GetRy(float theRy[3][3], float thaAng){ +vtkFloatingPointType* +VISU_CutPlanesPL +::GetRy(vtkFloatingPointType theRy[3][3], + vtkFloatingPointType thaAng) +{ theRy[0][0] = cos(thaAng); theRy[0][1] = 0.0; theRy[0][2] = sin(thaAng); theRy[1][0] = 0.0; theRy[1][1] = 1.0; theRy[1][2] = 0.0; theRy[2][0] = -sin(thaAng); theRy[2][1] = 0.0; theRy[2][2] = cos(thaAng); @@ -124,7 +154,11 @@ float* VISU_CutPlanesPL::GetRy(float theRy[3][3], float thaAng){ } -float* VISU_CutPlanesPL::GetRz(float theRz[3][3], float thaAng){ +vtkFloatingPointType* +VISU_CutPlanesPL +::GetRz(vtkFloatingPointType theRz[3][3], + vtkFloatingPointType thaAng) +{ theRz[0][0] = cos(thaAng); theRz[0][1] = -sin(thaAng); theRz[0][2] = 0.0; theRz[1][0] = sin(thaAng); theRz[1][1] = cos(thaAng); theRz[1][2] = 0.0; theRz[2][0] = 0.0; theRz[2][1] = 0.0; theRz[2][2] = 1.0; @@ -132,25 +166,34 @@ float* VISU_CutPlanesPL::GetRz(float theRz[3][3], float thaAng){ } -void VISU_CutPlanesPL::CorrectPnt(float thePnt[3], const float BoundPrj[6]){ +void +VISU_CutPlanesPL +::CorrectPnt(vtkFloatingPointType thePnt[3], + const vtkFloatingPointType BoundPrj[6]) +{ for(int i = 0, j = 0; i < 3; ++i, j=2*i){ if(thePnt[i] < BoundPrj[j]) thePnt[i] = BoundPrj[j]; if(thePnt[i] > BoundPrj[j+1]) thePnt[i] = BoundPrj[j+1]; } } -void VISU_CutPlanesPL::GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]){ - float BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]}, - {BoundBox[1],BoundBox[2],BoundBox[4]}, - {BoundBox[0],BoundBox[3],BoundBox[4]}, - {BoundBox[1],BoundBox[3],BoundBox[4]}, - {BoundBox[0],BoundBox[2],BoundBox[5]}, - {BoundBox[1],BoundBox[2],BoundBox[5]}, - {BoundBox[0],BoundBox[3],BoundBox[5]}, - {BoundBox[1],BoundBox[3],BoundBox[5]}}; +void +VISU_CutPlanesPL +::GetBoundProject(vtkFloatingPointType BoundPrj[3], + const vtkFloatingPointType BoundBox[6], + const vtkFloatingPointType Dir[3]) +{ + vtkFloatingPointType BoundPoints[8][3] = { {BoundBox[0],BoundBox[2],BoundBox[4]}, + {BoundBox[1],BoundBox[2],BoundBox[4]}, + {BoundBox[0],BoundBox[3],BoundBox[4]}, + {BoundBox[1],BoundBox[3],BoundBox[4]}, + {BoundBox[0],BoundBox[2],BoundBox[5]}, + {BoundBox[1],BoundBox[2],BoundBox[5]}, + {BoundBox[0],BoundBox[3],BoundBox[5]}, + {BoundBox[1],BoundBox[3],BoundBox[5]}}; BoundPrj[0] = vtkMath::Dot(Dir,BoundPoints[0]), BoundPrj[1] = BoundPrj[0]; for(int i = 1; i < 8; i++){ - float tmp = vtkMath::Dot(Dir,BoundPoints[i]); + vtkFloatingPointType tmp = vtkMath::Dot(Dir,BoundPoints[i]); if(BoundPrj[1] < tmp) BoundPrj[1] = tmp; if(BoundPrj[0] > tmp) BoundPrj[0] = tmp; } @@ -161,8 +204,12 @@ void VISU_CutPlanesPL::GetBoundProject(float BoundPrj[3], const float BoundBox[6 } -void VISU_CutPlanesPL::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, - float theXAng, float theYAng, int theNum) +void +VISU_CutPlanesPL +::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, + vtkFloatingPointType theXAng, + vtkFloatingPointType theYAng, + int theNum) { myBasePlane[theNum] = theOrient; switch(myBasePlane[theNum]){ @@ -178,11 +225,17 @@ void VISU_CutPlanesPL::SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& } -const VISU_CutPlanesPL::PlaneOrientation& VISU_CutPlanesPL::GetPlaneOrientation(int theNum){ +const VISU_CutPlanesPL::PlaneOrientation& +VISU_CutPlanesPL +::GetPlaneOrientation(int theNum) +{ return myBasePlane[theNum]; } -float VISU_CutPlanesPL::GetRotateX(int theNum){ +vtkFloatingPointType +VISU_CutPlanesPL +::GetRotateX(int theNum) +{ switch(myBasePlane[theNum]){ case XY: return myAng[theNum][0]; case YZ: return myAng[theNum][1]; @@ -191,7 +244,10 @@ float VISU_CutPlanesPL::GetRotateX(int theNum){ return 0; } -float VISU_CutPlanesPL::GetRotateY(int theNum){ +vtkFloatingPointType +VISU_CutPlanesPL +::GetRotateY(int theNum) +{ switch(myBasePlane[theNum]){ case XY: return myAng[theNum][1]; case YZ: return myAng[theNum][2]; @@ -201,7 +257,10 @@ float VISU_CutPlanesPL::GetRotateY(int theNum){ } -void VISU_CutPlanesPL::SetNbParts(int theNb) { +void +VISU_CutPlanesPL +::SetNbParts(int theNb) +{ myNbParts = theNb; myPartPosition.resize(myNbParts); myPartCondition.resize(myNbParts,1); @@ -209,24 +268,33 @@ void VISU_CutPlanesPL::SetNbParts(int theNb) { } -void VISU_CutPlanesPL::SetPartPosition(int thePartNumber, float thePartPosition){ +void +VISU_CutPlanesPL +::SetPartPosition(int thePartNumber, + vtkFloatingPointType thePartPosition) +{ if(thePartNumber >= myNbParts) return; myPartPosition[thePartNumber] = thePartPosition; myPartCondition[thePartNumber] = 0; Modified(); } -float VISU_CutPlanesPL::GetPartPosition(int thePartNumber, int theNum){ + +vtkFloatingPointType +VISU_CutPlanesPL +::GetPartPosition(int thePartNumber, + int theNum) +{ if(thePartNumber >= myNbParts) return 0; - float aPosition = myPartPosition[thePartNumber]; + vtkFloatingPointType aPosition = myPartPosition[thePartNumber]; if(myPartCondition[thePartNumber]){ - float aDir[3], aBounds[6], aBoundPrj[3]; + vtkFloatingPointType aDir[3], aBounds[6], aBoundPrj[3]; GetInput2()->GetBounds(aBounds); GetDir(aDir,myAng[theNum],myBasePlane[theNum]); GetBoundProject(aBoundPrj,aBounds,aDir); if (myNbParts > 1){ - float aDBoundPrj = aBoundPrj[2]/(myNbParts - 1); - float aDisplacement = aDBoundPrj * myDisplacement[theNum]; - float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; + vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(myNbParts - 1); + vtkFloatingPointType aDisplacement = aDBoundPrj * myDisplacement[theNum]; + vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; aPosition = aStartPosition + thePartNumber*aDBoundPrj; }else aPosition = aBoundPrj[0] + aBoundPrj[2]*myDisplacement[theNum]; @@ -235,24 +303,32 @@ float VISU_CutPlanesPL::GetPartPosition(int thePartNumber, int theNum){ } -void VISU_CutPlanesPL::SetPartDefault(int thePartNumber){ +void +VISU_CutPlanesPL +::SetPartDefault(int thePartNumber) +{ if(thePartNumber >= myNbParts) return; myPartPosition[thePartNumber] = GetPartPosition(thePartNumber); myPartCondition[thePartNumber] = 1; Modified(); } -int VISU_CutPlanesPL::IsPartDefault(int thePartNumber){ +int +VISU_CutPlanesPL +::IsPartDefault(int thePartNumber) +{ if(thePartNumber >= myNbParts) return 1; return myPartCondition[thePartNumber]; } -void VISU_CutPlanesPL::GetDir(float theDir[3], - const float theAng[3], - const PlaneOrientation& theBasePlane) +void +VISU_CutPlanesPL +::GetDir(vtkFloatingPointType theDir[3], + const vtkFloatingPointType theAng[3], + const PlaneOrientation& theBasePlane) { int iPlane = 0; - float aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3]; + vtkFloatingPointType aRx[3][3], aRy[3][3], aRz[3][3], aRotation[3][3]; switch(theBasePlane){ case XY: if(fabs(theAng[0]) > EPS) GetRx(aRx,theAng[0]); else vtkMath::Identity3x3(aRx); @@ -278,9 +354,12 @@ void VISU_CutPlanesPL::GetDir(float theDir[3], } -void VISU_CutPlanesPL::CutWithPlane(vtkAppendPolyData* theAppendPolyData, - vtkDataSet* theDataSet, - float theDir[3], float theOrig[3]) +void +VISU_CutPlanesPL +::CutWithPlane(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theOrig[3]) { vtkCutter *aCutPlane = vtkCutter::New(); aCutPlane->SetInput(theDataSet); @@ -296,18 +375,23 @@ void VISU_CutPlanesPL::CutWithPlane(vtkAppendPolyData* theAppendPolyData, } -void VISU_CutPlanesPL::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - const vector& thePlanePosition, - const vector& thePlaneCondition, - float theDisplacement) +void +VISU_CutPlanesPL +::CutWithPlanes(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + const vector& thePlanePosition, + const vector& thePlaneCondition, + vtkFloatingPointType theDisplacement) { - float aBoundPrj[3], aOrig[3], aPosition; + vtkFloatingPointType aBoundPrj[3], aOrig[3], aPosition; GetBoundProject(aBoundPrj, theBounds, theDir); if(theNbPlanes > 1){ - float aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1); - float aDisplacement = aDBoundPrj*theDisplacement; - float aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; + vtkFloatingPointType aDBoundPrj = aBoundPrj[2]/(theNbPlanes - 1); + vtkFloatingPointType aDisplacement = aDBoundPrj*theDisplacement; + vtkFloatingPointType aStartPosition = aBoundPrj[0] - 0.5*aDBoundPrj + aDisplacement; for (int i = 0; i < theNbPlanes; i++){ aPosition = aStartPosition + i*aDBoundPrj; if(thePlaneCondition[i]){ diff --git a/src/PIPELINE/VISU_CutPlanesPL.hxx b/src/PIPELINE/VISU_CutPlanesPL.hxx index b561f512..bd2c977a 100644 --- a/src/PIPELINE/VISU_CutPlanesPL.hxx +++ b/src/PIPELINE/VISU_CutPlanesPL.hxx @@ -40,64 +40,162 @@ protected: public: vtkTypeMacro(VISU_CutPlanesPL,VISU_ScalarMapPL); static VISU_CutPlanesPL* New(); - virtual ~VISU_CutPlanesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - enum PlaneOrientation {XY, YZ, ZX}; - virtual void SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, - float theXAng, float theYAng, int theNum = 0); + virtual + ~VISU_CutPlanesPL(); - virtual const PlaneOrientation& GetPlaneOrientation(int theNum = 0); - virtual float GetRotateX(int theNum = 0); - virtual float GetRotateY(int theNum = 0); + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); - virtual float GetDisplacement(int theNum = 0) { return myDisplacement[theNum];} - virtual void SetDisplacement(float theDisp, int theNum = 0) { myDisplacement[theNum] = theDisp;} + enum PlaneOrientation {XY, YZ, ZX}; - virtual void SetPartPosition(int thePartNumber, float thePartPosition); - virtual float GetPartPosition(int thePartNumber, int theNum = 0); + virtual + void + SetOrientation(const VISU_CutPlanesPL::PlaneOrientation& theOrient, + vtkFloatingPointType theXAng, + vtkFloatingPointType theYAng, + int theNum = 0); + + virtual + const PlaneOrientation& + GetPlaneOrientation(int theNum = 0); + + virtual + vtkFloatingPointType + GetRotateX(int theNum = 0); + + virtual + vtkFloatingPointType + GetRotateY(int theNum = 0); + + virtual + vtkFloatingPointType + GetDisplacement(int theNum = 0) + { + return myDisplacement[theNum]; + } + + virtual + void + SetDisplacement(vtkFloatingPointType theDisp, + int theNum = 0) + { + myDisplacement[theNum] = theDisp; + } + + virtual + void + SetPartPosition(int thePartNumber, + vtkFloatingPointType thePartPosition); + + virtual + vtkFloatingPointType + GetPartPosition(int thePartNumber, + int theNum = 0); + + virtual + void + SetPartDefault(int thePartNumber); + + virtual + int + IsPartDefault(int thePartNumber); + + virtual + void + SetNbParts(int theNb); + + virtual + int + GetNbParts() + { + return myNbParts; + } - virtual void SetPartDefault(int thePartNumber); - virtual int IsPartDefault(int thePartNumber); +public: + virtual + void + Init(); - virtual void SetNbParts(int theNb); - virtual int GetNbParts(){ return myNbParts;} + virtual + void + Update(); -public: - virtual void Init(); - virtual void Update(); - virtual vtkAppendPolyData* GetAppendPolyData() { return myAppendPolyData; } + virtual + vtkAppendPolyData* + GetAppendPolyData() + { + return myAppendPolyData; + } public: - static float* GetRx(float theRx[3][3], float thaAng); - static float* GetRy(float theRy[3][3], float thaAng); - static float* GetRz(float theRz[3][3], float thaAng); - - static void CorrectPnt(float thePnt[3], const float BoundPrj[6]); - static void GetBoundProject(float BoundPrj[3], const float BoundBox[6], const float Dir[3]); - - static void GetDir(float theDir[3], - const float theAng[3], - const PlaneOrientation& theBasePlane); - - static void ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData); - - static void CutWithPlane(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - float theDir[3], float theOrig[3]); - static void CutWithPlanes(vtkAppendPolyData* theAppendPolyData, vtkDataSet* theDataSet, - int theNbPlanes, float theDir[3], float theBounds[6], - const std::vector& thePlanePosition, - const std::vector& thePlaneCondition, - float theDisplacement); + static + vtkFloatingPointType* + GetRx(vtkFloatingPointType theRx[3][3], + vtkFloatingPointType thaAng); + + static + vtkFloatingPointType* + GetRy(vtkFloatingPointType theRy[3][3], + vtkFloatingPointType thaAng); + + static + vtkFloatingPointType* + GetRz(vtkFloatingPointType theRz[3][3], + vtkFloatingPointType thaAng); + + static + void + CorrectPnt(vtkFloatingPointType thePnt[3], + const vtkFloatingPointType BoundPrj[6]); + + static + void + GetBoundProject(vtkFloatingPointType BoundPrj[3], + const vtkFloatingPointType BoundBox[6], + const vtkFloatingPointType Dir[3]); + + static + void + GetDir(vtkFloatingPointType theDir[3], + const vtkFloatingPointType theAng[3], + const PlaneOrientation& theBasePlane); + + static + void + ClearAppendPolyData(vtkAppendPolyData *theAppendPolyData); + + static + void + CutWithPlane(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theOrig[3]); + + static + void + CutWithPlanes(vtkAppendPolyData* theAppendPolyData, + vtkDataSet* theDataSet, + int theNbPlanes, + vtkFloatingPointType theDir[3], + vtkFloatingPointType theBounds[6], + const std::vector& thePlanePosition, + const std::vector& thePlaneCondition, + vtkFloatingPointType theDisplacement); protected: - virtual THook* DoHook(); - void SetPartPosition(int theNum = 0); + virtual + THook* + DoHook(); + + void + SetPartPosition(int theNum = 0); int myNbParts; PlaneOrientation myBasePlane[2]; - float myAng[2][3], myDisplacement[2]; + vtkFloatingPointType myAng[2][3], myDisplacement[2]; vtkAppendPolyData *myAppendPolyData; - std::vector myPartPosition; + std::vector myPartPosition; std::vector myPartCondition; }; diff --git a/src/PIPELINE/VISU_DeformedShapePL.cxx b/src/PIPELINE/VISU_DeformedShapePL.cxx index 0b8e3462..c8b2133e 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.cxx +++ b/src/PIPELINE/VISU_DeformedShapePL.cxx @@ -33,12 +33,16 @@ vtkStandardNewMacro(VISU_DeformedShapePL); -VISU_DeformedShapePL::VISU_DeformedShapePL(){ +VISU_DeformedShapePL +::VISU_DeformedShapePL() +{ myWarpVector = vtkWarpVector::New(); myCellDataToPointData = vtkCellDataToPointData::New(); } -VISU_DeformedShapePL::~VISU_DeformedShapePL(){ +VISU_DeformedShapePL +::~VISU_DeformedShapePL() +{ myWarpVector->UnRegisterAllOutputs(); myWarpVector->Delete(); @@ -46,21 +50,27 @@ VISU_DeformedShapePL::~VISU_DeformedShapePL(){ myCellDataToPointData->Delete(); } -void VISU_DeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_DeformedShapePL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ if(VISU_DeformedShapePL *aPipeLine = dynamic_cast(thePipeLine)){ SetScale(aPipeLine->GetScale()); } VISU_ScalarMapPL::ShallowCopy(thePipeLine); } -float VISU_DeformedShapePL::GetScaleFactor(vtkDataSet* theDataSet){ +vtkFloatingPointType +VISU_DeformedShapePL +::GetScaleFactor(vtkDataSet* theDataSet) +{ if(!theDataSet) return 0.0; theDataSet->Update(); int aNbCells = theDataSet->GetNumberOfCells(); int aNbPoints = theDataSet->GetNumberOfPoints(); int aNbElem = aNbCells? aNbCells: aNbPoints; - float* aBounds = theDataSet->GetBounds(); - float aVolume = 1, aVol, idim = 0; + vtkFloatingPointType* aBounds = theDataSet->GetBounds(); + vtkFloatingPointType aVolume = 1, aVol, idim = 0; for(int i = 0; i < 6; i += 2){ aVol = fabs(aBounds[i+1] - aBounds[i]); if(aVol > 0) { @@ -69,26 +79,36 @@ float VISU_DeformedShapePL::GetScaleFactor(vtkDataSet* theDataSet){ } } aVolume /= aNbElem; - return pow(aVolume,float(1.0/idim)); + return pow(aVolume,vtkFloatingPointType(1.0/idim)); } -void VISU_DeformedShapePL::SetScale(float theScale) { +void +VISU_DeformedShapePL +::SetScale(vtkFloatingPointType theScale) +{ myWarpVector->SetScaleFactor(theScale); myScaleFactor = theScale; Modified(); } -float VISU_DeformedShapePL::GetScale() { + +vtkFloatingPointType +VISU_DeformedShapePL +::GetScale() +{ return myScaleFactor; } -void VISU_DeformedShapePL::Init(){ +void +VISU_DeformedShapePL +::Init() +{ VISU_ScalarMapPL::Init(); - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); vtkDataSet* aDataSet = GetInput2(); - float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); + vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); static double EPS = 1.0 / VTK_LARGE_FLOAT; if(fabs(aScalarRange[1]) > EPS) @@ -97,16 +117,25 @@ void VISU_DeformedShapePL::Init(){ SetScale(0.0); } -VISU_ScalarMapPL::THook* VISU_DeformedShapePL::DoHook(){ +VISU_ScalarMapPL::THook* +VISU_DeformedShapePL +::DoHook() +{ VISU::CellDataToPoint(myWarpVector,myCellDataToPointData,GetInput2(),myFieldTransform); return myWarpVector->GetOutput(); } -void VISU_DeformedShapePL::Update(){ +void +VISU_DeformedShapePL +::Update() +{ VISU_ScalarMapPL::Update(); } -void VISU_DeformedShapePL::SetMapScale(float theMapScale){ +void +VISU_DeformedShapePL +::SetMapScale(vtkFloatingPointType theMapScale) +{ VISU_ScalarMapPL::SetMapScale(theMapScale); myWarpVector->SetScaleFactor(myScaleFactor*theMapScale); diff --git a/src/PIPELINE/VISU_DeformedShapePL.hxx b/src/PIPELINE/VISU_DeformedShapePL.hxx index 9c2f95a7..fb8d7145 100644 --- a/src/PIPELINE/VISU_DeformedShapePL.hxx +++ b/src/PIPELINE/VISU_DeformedShapePL.hxx @@ -33,30 +33,57 @@ class vtkCellDataToPointData; class SALOME_Transform; class vtkWarpVector; -class VISU_DeformedShapePL : public VISU_ScalarMapPL{ +class VISU_DeformedShapePL : public VISU_ScalarMapPL +{ protected: VISU_DeformedShapePL(); VISU_DeformedShapePL(const VISU_DeformedShapePL&); + + virtual + ~VISU_DeformedShapePL(); + public: vtkTypeMacro(VISU_DeformedShapePL,VISU_ScalarMapPL); - static VISU_DeformedShapePL* New(); - virtual ~VISU_DeformedShapePL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SetScale(float theScale); - virtual float GetScale(); + static + VISU_DeformedShapePL* + New(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + void + SetScale(vtkFloatingPointType theScale); + + virtual + vtkFloatingPointType + GetScale(); public: - virtual void Init(); - virtual void Update(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual + void + Init(); + + virtual + void + Update(); + + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); - static float GetScaleFactor(vtkDataSet* theDataSet); + static + vtkFloatingPointType + GetScaleFactor(vtkDataSet* theDataSet); protected: - virtual THook* DoHook(); + virtual + THook* + DoHook(); - float myScaleFactor; + vtkFloatingPointType myScaleFactor; vtkWarpVector *myWarpVector; vtkCellDataToPointData* myCellDataToPointData; }; diff --git a/src/PIPELINE/VISU_Extractor.cxx b/src/PIPELINE/VISU_Extractor.cxx index b6423a39..ead86acd 100644 --- a/src/PIPELINE/VISU_Extractor.cxx +++ b/src/PIPELINE/VISU_Extractor.cxx @@ -67,7 +67,7 @@ execute(int theNbElems, vtkDataArray* aFieldArray = theInputData->GetArray("VISU_FIELD"); if(vtkFloatArray *aFloatArray = dynamic_cast(aFieldArray)){ int aNbComp = aFloatArray->GetNumberOfComponents(); - std::vector anArray(aNbComp < 3? 3: aNbComp); + std::vector anArray(aNbComp < 3? 3: aNbComp); // vtkFloatArray *aScalars = vtkFloatArray::New(); aScalars->SetNumberOfTuples(theNbElems); @@ -76,8 +76,8 @@ execute(int theNbElems, if(!theScalarMode){ for(int anId = 0; anId < theNbElems; anId++){ aFloatArray->GetTuple(anId,&anArray[0]); - float aVector[3] = {anArray[0], anArray[1], anArray[2]}; - float aScalar = sqrt(aVector[0]*aVector[0] + aVector[1]*aVector[1] + aVector[2]*aVector[2]); + vtkFloatingPointType aVector[3] = {anArray[0], anArray[1], anArray[2]}; + vtkFloatingPointType aScalar = sqrt(aVector[0]*aVector[0] + aVector[1]*aVector[1] + aVector[2]*aVector[2]); aScalars->SetTuple1(anId,aScalar); } }else{ diff --git a/src/PIPELINE/VISU_FieldTransform.cxx b/src/PIPELINE/VISU_FieldTransform.cxx index 82081859..b29adb0b 100644 --- a/src/PIPELINE/VISU_FieldTransform.cxx +++ b/src/PIPELINE/VISU_FieldTransform.cxx @@ -15,7 +15,7 @@ #include #include -static float Tolerance = 1.0 / VTK_LARGE_FLOAT; +static vtkFloatingPointType Tolerance = 1.0 / VTK_LARGE_FLOAT; using namespace std; @@ -107,9 +107,9 @@ void VISU_FieldTransform::SetSpaceTransform(VTKViewer_Transform* theTransform){ void VISU_FieldTransform -::SetScalarRange(float theScalarRange[2]) +::SetScalarRange(vtkFloatingPointType theScalarRange[2]) { - float aDelta = + vtkFloatingPointType aDelta = fabs(myScalarRange[0] - theScalarRange[0]) + fabs(myScalarRange[1] - theScalarRange[1]); if(aDelta < Tolerance) @@ -123,17 +123,17 @@ VISU_FieldTransform void VISU_FieldTransform -::SetScalarMin(float theValue) +::SetScalarMin(vtkFloatingPointType theValue) { - float aScalarRange[2] = {theValue, GetScalarRange()[1]}; + vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]}; SetScalarRange(aScalarRange); } void VISU_FieldTransform -::SetScalarMax(float theValue) +::SetScalarMax(vtkFloatingPointType theValue) { - float aScalarRange[2] = {GetScalarRange()[0], theValue}; + vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue}; SetScalarRange(aScalarRange); } @@ -141,7 +141,7 @@ VISU_FieldTransform template void ExecVectors(VISU_FieldTransform::TTransformFun theFunction, VTKViewer_Transform* theTransform, - float theScalarRange[2], + vtkFloatingPointType theScalarRange[2], int theNbOfTuples, TypeData* theInputData, TypeData* theOutputData) @@ -152,10 +152,10 @@ ExecVectors(VISU_FieldTransform::TTransformFun theFunction, vtkFloatArray *aNewVectors = vtkFloatArray::New(); aNewVectors->SetNumberOfComponents(3); aNewVectors->SetNumberOfTuples(theNbOfTuples); - float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; - float aDelta = aScalarRange[1] - aScalarRange[0]; - float aScale[3] = {1.0, 1.0, 1.0}; - static float EPS = 1.0 / VTK_LARGE_FLOAT; + vtkFloatingPointType aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; + vtkFloatingPointType aDelta = aScalarRange[1] - aScalarRange[0]; + vtkFloatingPointType aScale[3] = {1.0, 1.0, 1.0}; + static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT; if(theTransform){ aScale[0] = theTransform->GetScale()[0]; aScale[1] = theTransform->GetScale()[1]; @@ -163,9 +163,9 @@ ExecVectors(VISU_FieldTransform::TTransformFun theFunction, } if(theFunction == &(VISU_FieldTransform::Ident)){ for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) { - float anInVec[3]; + vtkFloatingPointType anInVec[3]; anInVectors->GetTuple(aTupleId,anInVec); - float anNewVec[3]; + vtkFloatingPointType anNewVec[3]; anNewVec[0] = anInVec[0]*aScale[0]; anNewVec[1] = anInVec[1]*aScale[1]; anNewVec[2] = anInVec[2]*aScale[2]; @@ -173,14 +173,14 @@ ExecVectors(VISU_FieldTransform::TTransformFun theFunction, } }else{ for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) { - float anInVec[3]; + vtkFloatingPointType anInVec[3]; anInVectors->GetTuple(aTupleId,anInVec); - float aMagn = vtkMath::Norm(anInVec); + vtkFloatingPointType aMagn = vtkMath::Norm(anInVec); if(aMagn > EPS) aMagn = ((*theFunction)(aMagn) - aScalarRange[0]) / aDelta * theScalarRange[1] / aMagn; if(aMagn < 0.0) aMagn = 0.0; - float anNewVec[3]; + vtkFloatingPointType anNewVec[3]; anNewVec[0] = anInVec[0]*aMagn*aScale[0]; anNewVec[1] = anInVec[1]*aMagn*aScale[1]; anNewVec[2] = anInVec[2]*aMagn*aScale[2]; @@ -193,7 +193,7 @@ ExecVectors(VISU_FieldTransform::TTransformFun theFunction, template void ExecScalars(VISU_FieldTransform::TTransformFun theFunction, - float theScalarRange[2], + vtkFloatingPointType theScalarRange[2], int theNbOfTuples, TypeData* theInputData, TypeData* theOutputData) @@ -204,9 +204,9 @@ ExecScalars(VISU_FieldTransform::TTransformFun theFunction, vtkFloatArray *aNewScalars = vtkFloatArray::New(); aNewScalars->SetNumberOfComponents(1); aNewScalars->SetNumberOfTuples(theNbOfTuples); - float aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; + vtkFloatingPointType aScalarRange[2] = {(*theFunction)(theScalarRange[0]),(*theFunction)(theScalarRange[1])}; for (int aTupleId = 0; aTupleId < theNbOfTuples; aTupleId++) { - float aScalar = (*theFunction)(anInScalars->GetTuple1(aTupleId)); + vtkFloatingPointType aScalar = (*theFunction)(anInScalars->GetTuple1(aTupleId)); if(aScalar < aScalarRange[0]) aScalar = aScalarRange[0]; aNewScalars->SetTuple1(aTupleId,aScalar); diff --git a/src/PIPELINE/VISU_FieldTransform.hxx b/src/PIPELINE/VISU_FieldTransform.hxx index 1a22f59a..589f213a 100644 --- a/src/PIPELINE/VISU_FieldTransform.hxx +++ b/src/PIPELINE/VISU_FieldTransform.hxx @@ -29,9 +29,12 @@ #include +#include "VTKViewer.h" + class VTKViewer_Transform; -class VTK_EXPORT VISU_FieldTransform : public vtkDataSetToDataSetFilter{ +class VTK_EXPORT VISU_FieldTransform : public vtkDataSetToDataSetFilter +{ public: vtkTypeMacro(VISU_FieldTransform,vtkDataSetToDataSetFilter); static VISU_FieldTransform *New(); @@ -48,10 +51,10 @@ public: void SetSpaceTransform(VTKViewer_Transform* theTransform); VTKViewer_Transform* GetSpaceTransform() { return myTransform;} - float* GetScalarRange(){ return myScalarRange; } - void SetScalarRange(float theScalarRange[2]); - void SetScalarMin(float theValue); - void SetScalarMax(float theValue); + vtkFloatingPointType* GetScalarRange(){ return myScalarRange; } + void SetScalarRange(vtkFloatingPointType theScalarRange[2]); + void SetScalarMin(vtkFloatingPointType theValue); + void SetScalarMax(vtkFloatingPointType theValue); protected: VISU_FieldTransform(); @@ -62,7 +65,7 @@ protected: VTKViewer_Transform *myTransform; TTransformFun myFunction; - float myScalarRange[2]; + vtkFloatingPointType myScalarRange[2]; }; #endif diff --git a/src/PIPELINE/VISU_GaussPointsPL.cxx b/src/PIPELINE/VISU_GaussPointsPL.cxx index 8d1d0dff..c8827e9f 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.cxx +++ b/src/PIPELINE/VISU_GaussPointsPL.cxx @@ -196,9 +196,9 @@ VISU_GaussPointsPL Superclass::Init(); vtkDataSet* aDataSet = GetParentMesh(); - float aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); + vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet ); - float* aScalarRange = GetScalarRange(); + vtkFloatingPointType* aScalarRange = GetScalarRange(); static double EPS = 1.0 / VTK_LARGE_FLOAT; if(fabs(aScalarRange[1]) > EPS) SetScale( aScaleFactor / aScalarRange[1] ); @@ -229,7 +229,7 @@ VISU_GaussPointsPL ::Update() { //cout << "VISU_GaussPointsPL::Update()" << endl; - float* aScalarRange = GetScalarRange(); + vtkFloatingPointType* aScalarRange = GetScalarRange(); mySourceScalarRange[0] = aScalarRange[0]; mySourceScalarRange[1] = aScalarRange[1]; myDeltaScalarRange = aScalarRange[1] - aScalarRange[0]; @@ -256,7 +256,7 @@ VISU_GaussPointsPL { //cout << "VISU_GaussPointsPL::UpdateGlyph()" << endl; - float* aScalarRange = GetScalarRange(); + vtkFloatingPointType* aScalarRange = GetScalarRange(); if( myPSMapper->GetPointSpriteMode() == 0 ) // Results { @@ -265,13 +265,13 @@ VISU_GaussPointsPL myGlyph->SetScaleModeToScaleByScalar(); myGlyph->SetColorModeToColorByScalar(); - float aRange = 0; - float aMinSize = GetMinSize(); - float aMaxSize = GetMaxSize(); + vtkFloatingPointType aRange = 0; + vtkFloatingPointType aMinSize = GetMinSize(); + vtkFloatingPointType aMaxSize = GetMaxSize(); if( fabs( aMaxSize - aMinSize ) > 0.0001 ) aRange = ( aScalarRange[1] - aScalarRange[0] ) / ( aMaxSize - aMinSize ); - float aMinRange = aScalarRange[0] - aMinSize * aRange; - float aMaxRange = aMinRange + aRange; + vtkFloatingPointType aMinRange = aScalarRange[0] - aMinSize * aRange; + vtkFloatingPointType aMaxRange = aMinRange + aRange; myGlyph->SetRange( aMinRange, aMaxRange ); myGlyph->SetScaleFactor( 1.0 ); @@ -306,7 +306,7 @@ VISU_GaussPointsPL return myGaussPtsIDMapper->GetObjID(theID); } -float* +vtkFloatingPointType* VISU_GaussPointsPL ::GetNodeCoord(int theObjID) { @@ -422,7 +422,7 @@ VISU_GaussPointsPL } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMaximumSupportedSize() { @@ -432,14 +432,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetClamp(float theClamp) +::SetClamp(vtkFloatingPointType theClamp) { myPSMapper->SetPointSpriteClamp( theClamp ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetClamp() { @@ -449,14 +449,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetSize(float theSize) +::SetSize(vtkFloatingPointType theSize) { myPSMapper->SetPointSpriteSize( theSize ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetSize() { @@ -466,14 +466,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetMinSize(float theMinSize) +::SetMinSize(vtkFloatingPointType theMinSize) { myPSMapper->SetPointSpriteMinSize( theMinSize ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMinSize() { @@ -483,14 +483,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetMaxSize(float theMaxSize) +::SetMaxSize(vtkFloatingPointType theMaxSize) { myPSMapper->SetPointSpriteMaxSize( theMaxSize ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMaxSize() { @@ -500,14 +500,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetMagnification(float theMagnification) +::SetMagnification(vtkFloatingPointType theMagnification) { myPSMapper->SetPointSpriteMagnification( theMagnification ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMagnification() { @@ -517,7 +517,7 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetMagnificationIncrement(float theIncrement) +::SetMagnificationIncrement(vtkFloatingPointType theIncrement) { myMagnificationIncrement = theIncrement; } @@ -525,14 +525,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetAlphaThreshold(float theAlphaThreshold) +::SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold) { myPSMapper->SetPointSpriteAlphaThreshold( theAlphaThreshold ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetAlphaThreshold() { @@ -554,25 +554,25 @@ void VISU_GaussPointsPL ::ChangeMagnification( bool up ) { - float anIncrement = up ? myMagnificationIncrement : 1.0 / myMagnificationIncrement; + vtkFloatingPointType anIncrement = up ? myMagnificationIncrement : 1.0 / myMagnificationIncrement; SetMagnification( GetMagnification() * anIncrement ); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray) { - float aMaxSize = GetAverageCellSize() * GetMaxSize(); - float aMinSize = GetAverageCellSize() * GetMinSize(); - float aDelta = aMaxSize - aMinSize; - float aVal = theScalarArray->GetTuple1(theID); + vtkFloatingPointType aMaxSize = GetAverageCellSize() * GetMaxSize(); + vtkFloatingPointType aMinSize = GetAverageCellSize() * GetMinSize(); + vtkFloatingPointType aDelta = aMaxSize - aMinSize; + vtkFloatingPointType aVal = theScalarArray->GetTuple1(theID); return aMinSize + aDelta*(aVal - mySourceScalarRange[0])/myDeltaScalarRange; } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetMaxPointSize() { @@ -580,7 +580,7 @@ VISU_GaussPointsPL } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetPointSize(vtkIdType theID) { @@ -594,14 +594,14 @@ VISU_GaussPointsPL //---------------------------------------------------------------------------- void VISU_GaussPointsPL -::SetAverageCellSize(float theAverageCellSize) +::SetAverageCellSize(vtkFloatingPointType theAverageCellSize) { myPSMapper->SetAverageCellSize( theAverageCellSize ); Modified(); } //---------------------------------------------------------------------------- -float +vtkFloatingPointType VISU_GaussPointsPL ::GetAverageCellSize() { @@ -678,19 +678,19 @@ VISU_GaussPointsPL return aCompositeImageData; } -void VISU_GaussPointsPL::SetScale( float theScale ) +void VISU_GaussPointsPL::SetScale( vtkFloatingPointType theScale ) { myWarpVector->SetScaleFactor( theScale ); myScaleFactor = GetScale(); Modified(); } -float VISU_GaussPointsPL::GetScale() +vtkFloatingPointType VISU_GaussPointsPL::GetScale() { return myWarpVector->GetScaleFactor(); } -void VISU_GaussPointsPL::SetMapScale( float theMapScale ) +void VISU_GaussPointsPL::SetMapScale( vtkFloatingPointType theMapScale ) { VISU_ScalarMapPL::SetMapScale( theMapScale ); diff --git a/src/PIPELINE/VISU_GaussPointsPL.hxx b/src/PIPELINE/VISU_GaussPointsPL.hxx index b342ab56..e8b47fc4 100644 --- a/src/PIPELINE/VISU_GaussPointsPL.hxx +++ b/src/PIPELINE/VISU_GaussPointsPL.hxx @@ -107,7 +107,7 @@ public: GetObjID(vtkIdType theID) const; virtual - float* + vtkFloatingPointType* GetNodeCoord(vtkIdType theObjID); void @@ -150,63 +150,63 @@ public: GetPrimitiveType(); //! Get the maximum Point Sprite size, which is supported by hardware. - float + vtkFloatingPointType GetMaximumSupportedSize(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp. void - SetClamp(float theClamp); + SetClamp(vtkFloatingPointType theClamp); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, vtkFloatingPointType). + vtkFloatingPointType GetClamp(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteSize. void - SetSize(float theSize); + SetSize(vtkFloatingPointType theSize); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, vtkFloatingPointType). + vtkFloatingPointType GetSize(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize. void - SetMinSize(float theMinSize); + SetMinSize(vtkFloatingPointType theMinSize); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, vtkFloatingPointType). + vtkFloatingPointType GetMinSize(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize. void - SetMaxSize(float theMaxSize); + SetMaxSize(vtkFloatingPointType theMaxSize); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, vtkFloatingPointType). + vtkFloatingPointType GetMaxSize(); //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification. void - SetMagnification(float theMagnification); + SetMagnification(vtkFloatingPointType theMagnification); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, vtkFloatingPointType). + vtkFloatingPointType GetMagnification(); //! Set the increment of changing Magnification parameter. void - SetMagnificationIncrement(float theIncrement); + SetMagnificationIncrement(vtkFloatingPointType theIncrement); //! Get the increment of changing Magnification parameter. - float + vtkFloatingPointType GetMagnificationIncrement() { return myMagnificationIncrement; } //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold. void - SetAlphaThreshold(float theAlphaThreshold); + SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, vtkFloatingPointType). + vtkFloatingPointType GetAlphaThreshold(); //! Set resolution of the Geometrical Sphere. @@ -222,23 +222,23 @@ public: ChangeMagnification( bool up ); //! Get the maximum size of Point Sprites in the presentation. - float + vtkFloatingPointType GetMaxPointSize(); //! Get point size by element's Id. - float + vtkFloatingPointType GetPointSize(vtkIdType theID); //! Get point size by element's Id using the specified scalar array. - float + vtkFloatingPointType GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, float). + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, vtkFloatingPointType). void - SetAverageCellSize(float AverageCellSize); + SetAverageCellSize(vtkFloatingPointType AverageCellSize); - //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, float). - float + //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, vtkFloatingPointType). + vtkFloatingPointType GetAverageCellSize(); //! Set image data for the Point Sprite texture. @@ -259,13 +259,13 @@ public: virtual void SetIsDeformed( bool theIsDeformed ); virtual bool GetIsDeformed() const; - virtual void SetScale( float theScale ); - virtual float GetScale(); - virtual void SetMapScale( float theMapScale = 1.0 ); + virtual void SetScale( vtkFloatingPointType theScale ); + virtual vtkFloatingPointType GetScale(); + virtual void SetMapScale( vtkFloatingPointType theMapScale = 1.0 ); protected: bool myIsDeformed; - float myScaleFactor; + vtkFloatingPointType myScaleFactor; vtkWarpVector *myWarpVector; vtkCellDataToPointData* myCellDataToPointData; std::vector myPassFilter; @@ -281,11 +281,11 @@ protected: vtkGeometryFilter* myGeomFilter; vtkDataArray *myScalarArray; - float mySourceScalarRange[2]; - float myDeltaScalarRange; + vtkFloatingPointType mySourceScalarRange[2]; + vtkFloatingPointType myDeltaScalarRange; int myPrimitiveType; - float myMagnificationIncrement; + vtkFloatingPointType myMagnificationIncrement; }; #endif diff --git a/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx b/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx index 3a3c21a8..08a8dbba 100644 --- a/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx +++ b/src/PIPELINE/VISU_ImplicitFunctionWidget.cxx @@ -54,7 +54,7 @@ VISU_UnScaledActor::VISU_UnScaledActor() // function: SetCenter // purpose: //==================================================================== -void VISU_UnScaledActor::SetCenter(float *pC) +void VISU_UnScaledActor::SetCenter(vtkFloatingPointType *pC) { for (int i=0; i<3; ++i){ myCenter[i]=pC[i]; @@ -64,7 +64,7 @@ void VISU_UnScaledActor::SetCenter(float *pC) // function:GetBounds // purpose: //==================================================================== -float* VISU_UnScaledActor::GetBounds() +vtkFloatingPointType* VISU_UnScaledActor::GetBounds() { Superclass::GetBounds(); // @@ -81,20 +81,20 @@ float* VISU_UnScaledActor::GetBounds() void VISU_UnScaledActor::Render(vtkRenderer *theRenderer) { if(theRenderer){ - float P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; + vtkFloatingPointType P[2][3] = {{-1.0, -1.0, 0.0},{+1.0, +1.0, 0.0}}; theRenderer->ViewToWorld(P[0][0],P[0][1],P[0][2]); theRenderer->ViewToWorld(P[1][0],P[1][1],P[1][2]); - float aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+ - (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+ - (P[1][2]-P[0][2])*(P[1][2]-P[0][2])); + vtkFloatingPointType aWorldDiag = sqrt((P[1][0]-P[0][0])*(P[1][0]-P[0][0])+ + (P[1][1]-P[0][1])*(P[1][1]-P[0][1])+ + (P[1][2]-P[0][2])*(P[1][2]-P[0][2])); int* aSize = theRenderer->GetRenderWindow()->GetSize(); - float aWinDiag = sqrt(float(aSize[0]*aSize[0]+aSize[1]*aSize[1])); + vtkFloatingPointType aWinDiag = sqrt(vtkFloatingPointType(aSize[0]*aSize[0]+aSize[1]*aSize[1])); vtkDataSet* aDataSet = GetMapper()->GetInput(); - float aLength = aDataSet->GetLength(); - float aPrecision = 1.e-3; - float anOldScale = GetScale()[0]; - float aScale = - mySize*aWorldDiag/aWinDiag/aLength*sqrt(float(aSize[0])/float(aSize[1])); + vtkFloatingPointType aLength = aDataSet->GetLength(); + vtkFloatingPointType aPrecision = 1.e-3; + vtkFloatingPointType anOldScale = GetScale()[0]; + vtkFloatingPointType aScale = + mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(aSize[0])/vtkFloatingPointType(aSize[1])); SetOrigin(myCenter); // diff --git a/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx b/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx index 8f46e43b..81094cc9 100644 --- a/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx +++ b/src/PIPELINE/VISU_ImplicitFunctionWidget.hxx @@ -28,12 +28,11 @@ #ifndef __VISU_ImplicitFunctionWidget_h #define __VISU_ImplicitFunctionWidget_h -//// -//================================================================== -// class : VISU_UnScaledActor -// purpose : -//================================================================== + #include + +#include "VTKViewer.h" + class VISU_UnScaledActor: public vtkFollower { @@ -42,17 +41,16 @@ public: vtkTypeMacro(VISU_UnScaledActor,vtkFollower); static VISU_UnScaledActor *New(); - - void SetCenter(float *); + void SetCenter(vtkFloatingPointType *); virtual void SetSize(int theSize); virtual void Render(vtkRenderer *theRenderer); - virtual float *GetBounds(); + virtual vtkFloatingPointType *GetBounds(); protected: VISU_UnScaledActor(); ~VISU_UnScaledActor(){} - float myCenter[3]; + vtkFloatingPointType myCenter[3]; int mySize; }; diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.cxx b/src/PIPELINE/VISU_IsoSurfacesPL.cxx index 8e14bca9..13941e70 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.cxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.cxx @@ -33,13 +33,17 @@ vtkStandardNewMacro(VISU_IsoSurfacesPL); -VISU_IsoSurfacesPL::VISU_IsoSurfacesPL(){ +VISU_IsoSurfacesPL +::VISU_IsoSurfacesPL() +{ myContourFilter = vtkContourFilter::New(); myCellDataToPointData = vtkCellDataToPointData::New(); myIsShrinkable = false; } -VISU_IsoSurfacesPL::~VISU_IsoSurfacesPL(){ +VISU_IsoSurfacesPL +::~VISU_IsoSurfacesPL() +{ myContourFilter->UnRegisterAllOutputs(); myContourFilter->Delete(); @@ -47,71 +51,105 @@ VISU_IsoSurfacesPL::~VISU_IsoSurfacesPL(){ myCellDataToPointData->Delete(); } -void VISU_IsoSurfacesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_IsoSurfacesPL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ if(VISU_IsoSurfacesPL *aPipeLine = dynamic_cast(thePipeLine)){ SetNbParts(aPipeLine->GetNbParts()); - float aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()}; + vtkFloatingPointType aRange[2] = {aPipeLine->GetMin(), aPipeLine->GetMax()}; SetRange(aRange); } VISU_ScalarMapPL::ShallowCopy(thePipeLine); } -int VISU_IsoSurfacesPL::GetNbParts() { +int +VISU_IsoSurfacesPL +::GetNbParts() +{ return myContourFilter->GetNumberOfContours(); } -void VISU_IsoSurfacesPL::SetNbParts(int theNb) { +void +VISU_IsoSurfacesPL +::SetNbParts(int theNb) +{ myContourFilter->SetNumberOfContours(theNb); Modified(); } -void VISU_IsoSurfacesPL::SetScaling(int theScaling) { +void +VISU_IsoSurfacesPL +::SetScaling(int theScaling) +{ VISU_ScalarMapPL::SetScaling(theScaling); SetRange(myRange); } -void VISU_IsoSurfacesPL::SetRange(float theRange[2]){ +void +VISU_IsoSurfacesPL +::SetRange(vtkFloatingPointType theRange[2]) +{ if(theRange[0] <= theRange[1]){ myRange[0] = theRange[0]; myRange[1] = theRange[1]; - float aRange[2] = {myRange[0], myRange[1]}; + vtkFloatingPointType aRange[2] = {myRange[0], myRange[1]}; if(GetScaling() == VTK_SCALE_LOG10) VISU_LookupTable::ComputeLogRange(theRange,aRange); myContourFilter->GenerateValues(GetNbParts(),aRange); Modified(); } } -float VISU_IsoSurfacesPL::GetMin() { + +vtkFloatingPointType +VISU_IsoSurfacesPL +::GetMin() +{ return myRange[0]; } -float VISU_IsoSurfacesPL::GetMax() { + +vtkFloatingPointType +VISU_IsoSurfacesPL +::GetMax() +{ return myRange[1]; } -void VISU_IsoSurfacesPL::Init(){ +void +VISU_IsoSurfacesPL +::Init() +{ VISU_ScalarMapPL::Init(); SetNbParts(10); - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); SetRange(aScalarRange); } -VISU_ScalarMapPL::THook* VISU_IsoSurfacesPL::DoHook(){ +VISU_ScalarMapPL::THook* +VISU_IsoSurfacesPL +::DoHook() +{ VISU::CellDataToPoint(myContourFilter,myCellDataToPointData,GetInput2(),myFieldTransform); return myContourFilter->GetOutput(); } -void VISU_IsoSurfacesPL::Update() +void +VISU_IsoSurfacesPL +::Update() { VISU_ScalarMapPL::Update(); } -void VISU_IsoSurfacesPL::SetMapScale(float theMapScale){ +void +VISU_IsoSurfacesPL +::SetMapScale(vtkFloatingPointType theMapScale) +{ VISU_ScalarMapPL::SetMapScale(theMapScale); - float aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()}; - float aNewRange[2] = {aRange[0], aRange[1]}; + vtkFloatingPointType aRange[2] = {GetMax() - theMapScale*(GetMax()-GetMin()), GetMax()}; + vtkFloatingPointType aNewRange[2] = {aRange[0], aRange[1]}; if(GetScaling() == VTK_SCALE_LOG10) VISU_LookupTable::ComputeLogRange(aRange,aNewRange); myContourFilter->GenerateValues(GetNbParts(),aNewRange); diff --git a/src/PIPELINE/VISU_IsoSurfacesPL.hxx b/src/PIPELINE/VISU_IsoSurfacesPL.hxx index 68732e37..2b62fb18 100644 --- a/src/PIPELINE/VISU_IsoSurfacesPL.hxx +++ b/src/PIPELINE/VISU_IsoSurfacesPL.hxx @@ -32,33 +32,70 @@ class vtkContourFilter; class vtkCellDataToPointData; -class VISU_IsoSurfacesPL : public VISU_ScalarMapPL{ +class VISU_IsoSurfacesPL : public VISU_ScalarMapPL +{ protected: VISU_IsoSurfacesPL(); VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&); + + virtual + ~VISU_IsoSurfacesPL(); + public: vtkTypeMacro(VISU_IsoSurfacesPL,VISU_ScalarMapPL); - static VISU_IsoSurfacesPL* New(); - virtual ~VISU_IsoSurfacesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual int GetNbParts(); - virtual void SetNbParts(int theNb = 10); + static + VISU_IsoSurfacesPL* + New(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + int + GetNbParts(); + + virtual + void + SetNbParts(int theNb = 10); + + virtual + void + SetScaling(int theScaling = VTK_SCALE_LINEAR); - virtual void SetScaling(int theScaling = VTK_SCALE_LINEAR); - virtual void SetRange(float theRange[2]); - virtual float GetMin(); - virtual float GetMax(); + virtual + void + SetRange(vtkFloatingPointType theRange[2]); + + virtual + vtkFloatingPointType + GetMin(); + + virtual + vtkFloatingPointType + GetMax(); public: - virtual void Init(); - virtual void Update(); - virtual THook* DoHook(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual + void + Init(); + + virtual + void + Update(); + + virtual + THook* + DoHook(); + + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); protected: int myNbParts; - float myRange[2]; + vtkFloatingPointType myRange[2]; vtkCellDataToPointData* myCellDataToPointData; vtkContourFilter *myContourFilter; }; diff --git a/src/PIPELINE/VISU_LookupTable.cxx b/src/PIPELINE/VISU_LookupTable.cxx index c15fdd27..e0d7440c 100644 --- a/src/PIPELINE/VISU_LookupTable.cxx +++ b/src/PIPELINE/VISU_LookupTable.cxx @@ -32,17 +32,18 @@ using namespace std; -VISU_LookupTable *VISU_LookupTable::New() { - vtkObject* ret = vtkObjectFactory::CreateInstance("VISU_LookupTable"); - if(ret) - return (VISU_LookupTable*)ret; - return new VISU_LookupTable; -} +vtkStandardNewMacro(VISU_LookupTable); -VISU_LookupTable::VISU_LookupTable(int sze, int ext) - : vtkLookupTable(sze, ext), myScale(1.0), myBicolor(false) {} +VISU_LookupTable +::VISU_LookupTable(int sze, int ext): + vtkLookupTable(sze, ext), + myScale(1.0), + myBicolor(false) +{} -void VISU_LookupTable::SetMapScale(float theScale) +void +VISU_LookupTable +::SetMapScale(vtkFloatingPointType theScale) { if( myScale != theScale ) { @@ -61,7 +62,11 @@ void VISU_LookupTable::SetBicolor( bool theBicolor ) } -int VISU_LookupTable::ComputeLogRange(float inRange[2], float outRange[2]){ +int +VISU_LookupTable +::ComputeLogRange(vtkFloatingPointType inRange[2], + vtkFloatingPointType outRange[2]) +{ if(inRange[0] >= inRange[1]) return -1; if(0.0 <= inRange[0] && 0.0 < inRange[1]){ @@ -79,10 +84,13 @@ int VISU_LookupTable::ComputeLogRange(float inRange[2], float outRange[2]){ return -1; } -unsigned char* VISU_LookupTable::MapValue(float v) { +unsigned char* +VISU_LookupTable +::MapValue(vtkFloatingPointType v) +{ if(GetScale() == VTK_SCALE_LOG10) { - float aLowBound = log10(this->TableRange[0]); - v = pow(10.0f,aLowBound + (v - aLowBound)*myScale); + vtkFloatingPointType aLowBound = log10(this->TableRange[0]); + v = pow(vtkFloatingPointType(10.0), aLowBound + (v - aLowBound)*myScale); return vtkLookupTable::MapValue(v); } else if (!myBicolor) { v = this->TableRange[0] + (v - this->TableRange[0])*myScale; @@ -95,8 +103,11 @@ unsigned char* VISU_LookupTable::MapValue(float v) { } // Apply log to value, with appropriate constraints. -inline float VISU_ApplyLogScale(float v, float range[2], - float logRange[2]) +inline +vtkFloatingPointType +VISU_ApplyLogScale(vtkFloatingPointType v, + vtkFloatingPointType range[2], + vtkFloatingPointType logRange[2]) { // is the range set for negative numbers? if (range[0] < 0) @@ -133,15 +144,18 @@ inline float VISU_ApplyLogScale(float v, float range[2], } // Apply shift/scale to the scalar value v and do table lookup. -inline unsigned char *VISU_LinearLookup(float v, - unsigned char *table, - float maxIndex, - float shift, float scale, - bool bicolor) +inline +unsigned char * +VISU_LinearLookup(vtkFloatingPointType v, + unsigned char *table, + vtkFloatingPointType maxIndex, + vtkFloatingPointType shift, + vtkFloatingPointType scale, + bool bicolor) { if( !bicolor ) { - float findx = (v + shift)*scale; + vtkFloatingPointType findx = (v + shift)*scale; if (findx < 0) findx = 0; if (findx > maxIndex) @@ -161,25 +175,30 @@ inline unsigned char *VISU_LinearLookup(float v, // accelerate the mapping by copying the data in 32-bit chunks instead // of 8-bit chunks template -void VISU_LookupTableMapData(vtkLookupTable *self, T *input, - unsigned char *output, int length, - int inIncr, int outFormat, - float theMapScale, bool bicolor) +void +VISU_LookupTableMapData(vtkLookupTable *self, + T *input, + unsigned char *output, + int length, + int inIncr, + int outFormat, + vtkFloatingPointType theMapScale, + bool bicolor) { int i = length; - float *range = self->GetTableRange(); - float maxIndex = self->GetNumberOfColors() - 1; - float shift, scale; + vtkFloatingPointType *range = self->GetTableRange(); + vtkFloatingPointType maxIndex = self->GetNumberOfColors() - 1; + vtkFloatingPointType shift, scale; unsigned char *table = self->GetPointer(0); unsigned char *cptr; - float alpha; + vtkFloatingPointType alpha; if ( (alpha=self->GetAlpha()) >= 1.0 ) //no blending required { if (self->GetScale() == VTK_SCALE_LOG10) { - float val; - float logRange[2]; + vtkFloatingPointType val; + vtkFloatingPointType logRange[2]; VISU_LookupTable::ComputeLogRange(range, logRange); shift = -logRange[0]; if (logRange[1] <= logRange[0]) @@ -309,8 +328,8 @@ void VISU_LookupTableMapData(vtkLookupTable *self, T *input, { if (self->GetScale() == VTK_SCALE_LOG10) { - float val; - float logRange[2]; + vtkFloatingPointType val; + vtkFloatingPointType logRange[2]; VISU_LookupTable::ComputeLogRange(range, logRange); shift = -logRange[0]; if (logRange[1] <= logRange[0]) @@ -441,10 +460,15 @@ void VISU_LookupTableMapData(vtkLookupTable *self, T *input, // it is only done on the first render. Colors are cached // for subsequent renders. template -void VISU_LookupTableMapMag(vtkLookupTable *self, T *input, - unsigned char *output, int length, - int inIncr, int outFormat, - float theMapScale, bool bicolor) +void +VISU_LookupTableMapMag(vtkLookupTable *self, + T *input, + unsigned char *output, + int length, + int inIncr, + int outFormat, + vtkFloatingPointType theMapScale, + bool bicolor) { double tmp, sum; double *mag; diff --git a/src/PIPELINE/VISU_LookupTable.hxx b/src/PIPELINE/VISU_LookupTable.hxx index 20f7c23e..93d4b48e 100644 --- a/src/PIPELINE/VISU_LookupTable.hxx +++ b/src/PIPELINE/VISU_LookupTable.hxx @@ -11,7 +11,10 @@ #include -class VISU_LookupTable: public vtkLookupTable { +#include "VTKViewer.h" + +class VISU_LookupTable: public vtkLookupTable +{ public: vtkTypeMacro(VISU_LookupTable,vtkLookupTable); static VISU_LookupTable *New(); @@ -20,20 +23,20 @@ class VISU_LookupTable: public vtkLookupTable { int inputDataType, int numberOfValues, int inputIncrement, int outputIncrement); - float GetMapScale() { return myScale; } - void SetMapScale(float theScale = 1.0); + vtkFloatingPointType GetMapScale() { return myScale; } + void SetMapScale(vtkFloatingPointType theScale = 1.0); - float GetBicolor() { return myBicolor; } + bool GetBicolor() { return myBicolor; } void SetBicolor( bool theBicolor ); - static int ComputeLogRange(float inRange[2], float outRange[2]); - unsigned char *MapValue(float v); + static int ComputeLogRange(vtkFloatingPointType inRange[2], vtkFloatingPointType outRange[2]); + unsigned char *MapValue(vtkFloatingPointType v); protected: VISU_LookupTable(int sze=256, int ext=256); ~VISU_LookupTable() {}; - float myScale; + vtkFloatingPointType myScale; bool myBicolor; }; diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx index d8eb9e8a..9edaf2e9 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx @@ -406,7 +406,7 @@ bool VISU_OpenGLPointSpriteMapper::InitExtensions() //----------------------------------------------------------------------------- float ViewToDisplay( vtkRenderer* theRenderer ) { - float p1[3], p2[3]; + vtkFloatingPointType p1[3], p2[3]; theRenderer->SetViewPoint( 0.0, 0.0, 0.0 ); theRenderer->ViewToDisplay(); @@ -416,7 +416,7 @@ float ViewToDisplay( vtkRenderer* theRenderer ) theRenderer->ViewToDisplay(); theRenderer->GetDisplayPoint( p2 ); - float coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 ); + vtkFloatingPointType coefficient = sqrt( pow( p2[0] - p1[0], 2 ) + pow( p2[1] - p1[1], 2 ) ) / sqrt( 2 ); //cout << p1[0] << " " << p1[1] << " " << p1[2] << endl; //cout << p2[0] << " " << p2[1] << " " << p2[2] << endl; //cout << "ZOOM : " << coefficient << endl; @@ -753,7 +753,7 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(vtkPoints *thePoints, TVertex* aVertexArr = new TVertex[ this->TotalCells ]; - float* aPropertyColor = theActor->GetProperty()->GetColor(); + vtkFloatingPointType* aPropertyColor = theActor->GetProperty()->GetColor(); float aColor[3] = {aPropertyColor[0], aPropertyColor[1], aPropertyColor[2]}; unsigned long i = 0; @@ -763,7 +763,7 @@ void VISU_OpenGLPointSpriteMapper::DrawPoints(vtkPoints *thePoints, { TVertex& aVertex = aVertexArr[i]; vtkIdType aPointId = pts[0]; - float* aCoords = thePoints->GetPoint( aPointId ); + vtkFloatingPointType* aCoords = thePoints->GetPoint( aPointId ); aVertex.vx = aCoords[0]; aVertex.vy = aCoords[1]; aVertex.vz = aCoords[2]; diff --git a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx index 1ddb55ff..7d8f8e1b 100755 --- a/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx +++ b/src/PIPELINE/VISU_OpenGLPointSpriteMapper.hxx @@ -37,6 +37,8 @@ #include #include +#include "VTKViewer.h" + class vtkCellArray; class vtkPoints; class vtkProperty; diff --git a/src/PIPELINE/VISU_PipeLine.cxx b/src/PIPELINE/VISU_PipeLine.cxx index 9fcd66fd..34ba2a61 100644 --- a/src/PIPELINE/VISU_PipeLine.cxx +++ b/src/PIPELINE/VISU_PipeLine.cxx @@ -181,7 +181,7 @@ VISU_PipeLine int VISU_PipeLine -::CheckAvailableMemory(const float& theSize) +::CheckAvailableMemory(const vtkFloatingPointType& theSize) { try{ if(theSize > ULONG_MAX) return 0; @@ -202,10 +202,10 @@ VISU_PipeLine return 0; } -float +vtkFloatingPointType VISU_PipeLine -::GetAvailableMemory(float theSize, - float theMinSize) +::GetAvailableMemory(vtkFloatingPointType theSize, + vtkFloatingPointType theMinSize) { while(!CheckAvailableMemory(theSize)) if(theSize > theMinSize) @@ -279,36 +279,36 @@ VISU_PipeLine static void ComputeBoundsParam (vtkDataSet* theDataSet, - float theDirection[3], - float theMinPnt[3], - float& theMaxBoundPrj, - float& theMinBoundPrj) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType theMinPnt[3], + vtkFloatingPointType& theMaxBoundPrj, + vtkFloatingPointType& theMinBoundPrj) { - float aBounds[6]; + vtkFloatingPointType aBounds[6]; theDataSet->GetBounds(aBounds); //Enlarge bounds in order to avoid conflicts of precision for(int i = 0; i < 6; i += 2){ static double EPS = 1.0E-3; - float aDelta = (aBounds[i+1] - aBounds[i])*EPS; + vtkFloatingPointType aDelta = (aBounds[i+1] - aBounds[i])*EPS; aBounds[i] -= aDelta; aBounds[i+1] += aDelta; } - float aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, - {aBounds[1],aBounds[2],aBounds[4]}, - {aBounds[0],aBounds[3],aBounds[4]}, - {aBounds[1],aBounds[3],aBounds[4]}, - {aBounds[0],aBounds[2],aBounds[5]}, - {aBounds[1],aBounds[2],aBounds[5]}, - {aBounds[0],aBounds[3],aBounds[5]}, - {aBounds[1],aBounds[3],aBounds[5]}}; + vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, + {aBounds[1],aBounds[2],aBounds[4]}, + {aBounds[0],aBounds[3],aBounds[4]}, + {aBounds[1],aBounds[3],aBounds[4]}, + {aBounds[0],aBounds[2],aBounds[5]}, + {aBounds[1],aBounds[2],aBounds[5]}, + {aBounds[0],aBounds[3],aBounds[5]}, + {aBounds[1],aBounds[3],aBounds[5]}}; int aMaxId = 0, aMinId = aMaxId; theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]); theMinBoundPrj = theMaxBoundPrj; for(int i = 1; i < 8; i++){ - float aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]); + vtkFloatingPointType aTmp = vtkMath::Dot(theDirection,aBoundPoints[i]); if(theMaxBoundPrj < aTmp){ theMaxBoundPrj = aTmp; aMaxId = i; @@ -318,7 +318,7 @@ ComputeBoundsParam (vtkDataSet* theDataSet, aMinId = i; } } - float *aMinPnt = aBoundPoints[aMaxId]; + vtkFloatingPointType *aMinPnt = aBoundPoints[aMaxId]; theMinPnt[0] = aMinPnt[0]; theMinPnt[1] = aMinPnt[1]; theMinPnt[2] = aMinPnt[2]; @@ -327,13 +327,13 @@ ComputeBoundsParam (vtkDataSet* theDataSet, static void DistanceToPosition(vtkDataSet* theDataSet, - float theDirection[3], - float theDist, - float thePos[3]) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType theDist, + vtkFloatingPointType thePos[3]) { - float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; + vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj); - float aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist; + vtkFloatingPointType aLength = (aMaxBoundPrj-aMinBoundPrj)*theDist; thePos[0] = aMinPnt[0]-theDirection[0]*aLength; thePos[1] = aMinPnt[1]-theDirection[1]*aLength; thePos[2] = aMinPnt[2]-theDirection[2]*aLength; @@ -342,37 +342,37 @@ DistanceToPosition(vtkDataSet* theDataSet, static void PositionToDistance (vtkDataSet* theDataSet, - float theDirection[3], - float thePos[3], - float& theDist) + vtkFloatingPointType theDirection[3], + vtkFloatingPointType thePos[3], + vtkFloatingPointType& theDist) { - float aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; + vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3]; ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj); - float aPrj = vtkMath::Dot(theDirection,thePos); + vtkFloatingPointType aPrj = vtkMath::Dot(theDirection,thePos); theDist = (aPrj-aMinBoundPrj)/(aMaxBoundPrj-aMinBoundPrj); } void VISU_PipeLine -::SetPlaneParam(float theDir[3], - float theDist, +::SetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType theDist, vtkPlane* thePlane) { thePlane->SetNormal(theDir); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; ::DistanceToPosition(GetInput(),theDir,theDist,anOrigin); thePlane->SetOrigin(anOrigin); } void VISU_PipeLine -::GetPlaneParam(float theDir[3], - float& theDist, +::GetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType& theDist, vtkPlane* thePlane) { thePlane->GetNormal(theDir); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; thePlane->GetOrigin(anOrigin); ::PositionToDistance(GetInput(),theDir,anOrigin,theDist); } @@ -385,7 +385,7 @@ bool VISU_PipeLine ::IsPlanarInput() const { - float aBounds[6]; + vtkFloatingPointType aBounds[6]; GetInput()->GetBounds( aBounds ); // xmin,xmax, ymin,ymax, zmin,zmax if (fabs( aBounds[0] - aBounds[1] ) <= FLT_MIN || fabs( aBounds[2] - aBounds[3] ) <= FLT_MIN || @@ -412,7 +412,7 @@ VISU_PipeLine return myExtractGeometry->GetNodeVTKId(anID); } -float* +vtkFloatingPointType* VISU_PipeLine ::GetNodeCoord(int theObjID) { diff --git a/src/PIPELINE/VISU_PipeLine.hxx b/src/PIPELINE/VISU_PipeLine.hxx index 5e2a1ed8..76d3d2bc 100644 --- a/src/PIPELINE/VISU_PipeLine.hxx +++ b/src/PIPELINE/VISU_PipeLine.hxx @@ -135,12 +135,12 @@ public: static int - CheckAvailableMemory(const float& theSize); + CheckAvailableMemory(const vtkFloatingPointType& theSize); static - float - GetAvailableMemory(float theSize = 16*1024*1024.0, - float theMinSize = 1024*1024.0); + vtkFloatingPointType + GetAvailableMemory(vtkFloatingPointType theSize = 16*1024*1024.0, + vtkFloatingPointType theMinSize = 1024*1024.0); // Clipping planes void @@ -156,13 +156,13 @@ public: GetClippingPlane(vtkIdType theID) const; void - SetPlaneParam(float theDir[3], - float theDist, + SetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType theDist, vtkPlane* thePlane); void - GetPlaneParam(float theDir[3], - float& theDist, + GetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType& theDist, vtkPlane* thePlane); bool @@ -177,7 +177,7 @@ public: GetNodeVTKID(vtkIdType theID); virtual - float* + vtkFloatingPointType* GetNodeCoord(vtkIdType theObjID); virtual diff --git a/src/PIPELINE/VISU_PipeLineUtils.cxx b/src/PIPELINE/VISU_PipeLineUtils.cxx index f60c2cca..404baf1e 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.cxx +++ b/src/PIPELINE/VISU_PipeLineUtils.cxx @@ -26,11 +26,19 @@ #include "VISU_PipeLineUtils.hxx" -void VISU::Mul(const float A[3], float b, float C[3]){ // A*b; +void +VISU::Mul(const vtkFloatingPointType A[3], + vtkFloatingPointType b, + vtkFloatingPointType C[3]) +{ // A*b; for(int i = 0; i < 3; i++) C[i] = A[i]*b; } -void VISU::Sub(const float A[3], const float B[3], float C[3]){ //A-B +void +VISU::Sub(const vtkFloatingPointType A[3], + const vtkFloatingPointType B[3], + vtkFloatingPointType C[3]) +{ //A-B for(int i = 0; i < 3; i++) C[i] = A[i] - B[i]; } diff --git a/src/PIPELINE/VISU_PipeLineUtils.hxx b/src/PIPELINE/VISU_PipeLineUtils.hxx index 7b252350..af67ea96 100644 --- a/src/PIPELINE/VISU_PipeLineUtils.hxx +++ b/src/PIPELINE/VISU_PipeLineUtils.hxx @@ -55,9 +55,17 @@ #endif -namespace VISU{ - void Mul(const float A[3], float b, float C[3]); // C = A * b - void Sub(const float A[3], const float B[3], float C[3]); // C = A - B +namespace VISU +{ + void + Mul(const vtkFloatingPointType A[3], + vtkFloatingPointType b, + vtkFloatingPointType C[3]); // C = A * b + + void + Sub(const vtkFloatingPointType A[3], + const vtkFloatingPointType B[3], + vtkFloatingPointType C[3]); // C = A - B template void diff --git a/src/PIPELINE/VISU_PlanesWidget.cxx b/src/PIPELINE/VISU_PlanesWidget.cxx index 93efa07b..dff6b274 100644 --- a/src/PIPELINE/VISU_PlanesWidget.cxx +++ b/src/PIPELINE/VISU_PlanesWidget.cxx @@ -61,16 +61,19 @@ #include static - bool IsValidPlane2Position(vtkPlane *pPx, - vtkDataSet *pDataSet, - float aTol=0.003); +bool +IsValidPlane2Position(vtkPlane *pPx, + vtkDataSet *pDataSet, + vtkFloatingPointType aTol=0.003); static - void GetBndPoints(vtkDataSet *pDataSet, - float aPnts[24]); +void +GetBndPoints(vtkDataSet *pDataSet, + vtkFloatingPointType aPnts[24]); static - float DistanceToPlane(const float x[3], - const float n[3], - const float p0[3]); +vtkFloatingPointType +DistanceToPlane(const vtkFloatingPointType x[3], + const vtkFloatingPointType n[3], + const vtkFloatingPointType p0[3]); vtkCxxRevisionMacro(VISU_PlanesWidget, "$Revision$"); vtkStandardNewMacro(VISU_PlanesWidget); @@ -207,7 +210,7 @@ VISU_PlanesWidget::VISU_PlanesWidget() this->Transform = vtkTransform::New(); // Define the point coordinates - float bounds[6]; + vtkFloatingPointType bounds[6]; bounds[0] = -0.5; bounds[1] = 0.5; bounds[2] = -0.5; @@ -311,14 +314,16 @@ vtkImplicitFunction* VISU_PlanesWidget::ImplicitFunction() // function: SetDistance // purpose : //================================================================== -void VISU_PlanesWidget::SetDistance(const float theDistance) +void +VISU_PlanesWidget +::SetDistance(const vtkFloatingPointType theDistance) { if( theDistance <= 0.0 || theDistance == myDistance ) return; myDistance=theDistance; // - float *origin, *normal, oNew[3], aN2[3]; + vtkFloatingPointType *origin, *normal, oNew[3], aN2[3]; origin = myPlane1->GetOrigin(); normal = myPlane1->GetNormal(); vtkMath::Normalize(normal); @@ -335,7 +340,9 @@ void VISU_PlanesWidget::SetDistance(const float theDistance) // function: Distance // purpose : //================================================================== -float VISU_PlanesWidget::Distance()const +vtkFloatingPointType +VISU_PlanesWidget +::Distance() const { return myDistance; } @@ -853,13 +860,13 @@ void VISU_PlanesWidget::Push(double *p1, double *p2) { //Get the motion vector int i; - float v[3]; + vtkFloatingPointType v[3]; // for (i=0; i<3; ++i){ v[i] = p2[i] - p1[i]; } // - float aOr1[3], aNr1[3], aNr2[3], aD, z1; + vtkFloatingPointType aOr1[3], aNr1[3], aNr2[3], aD, z1; // myPlane1->GetOrigin(aOr1); myPlane1->GetNormal(aNr1); @@ -893,9 +900,9 @@ void VISU_PlanesWidget::TranslateOrigin(double *p1, double *p2) } // //Add to the current point, project back down onto plane - float *o = myPlane1->GetOrigin(); - float *n = myPlane1->GetNormal(); - float newOrigin[3]; + vtkFloatingPointType *o = myPlane1->GetOrigin(); + vtkFloatingPointType *n = myPlane1->GetNormal(); + vtkFloatingPointType newOrigin[3]; // for (i=0; i<3; ++i){ newOrigin[i]=o[i] + v[i]; @@ -908,9 +915,9 @@ void VISU_PlanesWidget::TranslateOrigin(double *p1, double *p2) // function: SetOriginInternal // purpose : Set the origin of the plane.(for Internal calls) //================================================================== -void VISU_PlanesWidget::SetOriginInternal(float x[3]) +void VISU_PlanesWidget::SetOriginInternal(vtkFloatingPointType x[3]) { - float *bounds = this->myOutline->GetOutput()->GetBounds(); + vtkFloatingPointType *bounds = this->myOutline->GetOutput()->GetBounds(); int i, j; for (i=0; i<3; ++i) { j=2*i; @@ -923,7 +930,7 @@ void VISU_PlanesWidget::SetOriginInternal(float x[3]) } // bool bFlag; - float aOr2[3], aNr2[3], aNr1[3]; + vtkFloatingPointType aOr2[3], aNr2[3], aNr1[3]; vtkPlane *pPx; // myPlane1->GetNormal(aNr1); @@ -959,8 +966,8 @@ void VISU_PlanesWidget::Rotate(int X, int Y, v[i] = p2[i] - p1[i]; } // - float *origin = myPlane1->GetOrigin(); - float *normal = myPlane1->GetNormal(); + vtkFloatingPointType *origin = myPlane1->GetOrigin(); + vtkFloatingPointType *normal = myPlane1->GetNormal(); // Create axis of rotation and angle of rotation vtkMath::Cross(vpn,v,axis); @@ -982,7 +989,7 @@ void VISU_PlanesWidget::Rotate(int X, int Y, this->Transform->Translate(-origin[0],-origin[1],-origin[2]); //Set the new normal - float nNew[3], aN2[3], oNew[3]; + vtkFloatingPointType nNew[3], aN2[3], oNew[3]; this->Transform->TransformNormal(normal,nNew); // for (i=0; i<3; ++i){ @@ -1013,7 +1020,7 @@ void VISU_PlanesWidget::Rotate(int X, int Y, void VISU_PlanesWidget::PushDistance(double *p1, double *p2) { int i; - float v[3], *anOrigin1, *aN1, *anOrigin2, *aN2, aD; + vtkFloatingPointType v[3], *anOrigin1, *aN1, *anOrigin2, *aN2, aD; //Get the motion vector for (i=0; i<3; ++i){ v[i] = p2[i] - p1[i]; @@ -1026,17 +1033,17 @@ void VISU_PlanesWidget::PushDistance(double *p1, double *p2) vtkMath::Normalize(aN1); - float origin[3]; + vtkFloatingPointType origin[3]; double distance = vtkMath::Dot( v, aN2 ); for(i=0; i<3; ++i) { origin[i] = anOrigin2[i] + distance * aN2[i]; } - float d = DistanceToPlane(origin, aN1, anOrigin1); + vtkFloatingPointType d = DistanceToPlane(origin, aN1, anOrigin1); if( d <= 0.0 ) return; // bool bFlag; - float aOr2[3], aNr2[3]; + vtkFloatingPointType aOr2[3], aNr2[3]; vtkPlane *pPx; // myPlane2->GetOrigin(aOr2); @@ -1073,8 +1080,8 @@ void VISU_PlanesWidget::TranslatePlane(double *p1, double *p2) v[2] = p2[2] - p1[2]; //Translate the plane - float oNew[3]; - float *origin = myPlane1->GetOrigin(); + vtkFloatingPointType oNew[3]; + vtkFloatingPointType *origin = myPlane1->GetOrigin(); oNew[0] = origin[0] + v[0]; oNew[1] = origin[1] + v[1]; oNew[2] = origin[2] + v[2]; @@ -1101,8 +1108,8 @@ void VISU_PlanesWidget::TranslateOutline(double *p1, double *p2) v[2] = p2[2] - p1[2]; //Translate the bounding box - float *origin = myBox->GetOrigin(); - float oNew[3]; + vtkFloatingPointType *origin = myBox->GetOrigin(); + vtkFloatingPointType oNew[3]; oNew[0] = origin[0] + v[0]; oNew[1] = origin[1] + v[1]; oNew[2] = origin[2] + v[2]; @@ -1138,10 +1145,10 @@ void VISU_PlanesWidget::Scale(double *p1, double *p2, v[2] = p2[2] - p1[2]; //int res = this->PlaneSource->GetXResolution(); - float *o = myPlane1->GetOrigin(); + vtkFloatingPointType *o = myPlane1->GetOrigin(); // Compute the scale factor - float sf = vtkMath::Norm(v) / this->myOutline->GetOutput()->GetLength(); + vtkFloatingPointType sf = vtkMath::Norm(v) / this->myOutline->GetOutput()->GetLength(); if ( Y > this->Interactor->GetLastEventPosition()[1] ) { sf = 1.0 + sf; } @@ -1154,9 +1161,9 @@ void VISU_PlanesWidget::Scale(double *p1, double *p2, this->Transform->Scale(sf,sf,sf); this->Transform->Translate(-o[0],-o[1],-o[2]); - float *origin = myBox->GetOrigin(); - float *spacing = myBox->GetSpacing(); - float oNew[3], p[3], pNew[3]; + vtkFloatingPointType *origin = myBox->GetOrigin(); + vtkFloatingPointType *spacing = myBox->GetSpacing(); + vtkFloatingPointType oNew[3], p[3], pNew[3]; p[0] = origin[0] + spacing[0]; p[1] = origin[1] + spacing[1]; p[2] = origin[2] + spacing[2]; @@ -1215,9 +1222,9 @@ void VISU_PlanesWidget::CreateDefaultProperties() // function: InitialPlaceWidget // purpose : //================================================================== -void VISU_PlanesWidget::InitialPlaceWidget(float bds[6]) +void VISU_PlanesWidget::InitialPlaceWidget(vtkFloatingPointType bds[6]) { - float bounds[6], origin[3]; + vtkFloatingPointType bounds[6], origin[3]; PlaceWidget(bds); // @@ -1226,7 +1233,7 @@ void VISU_PlanesWidget::InitialPlaceWidget(float bds[6]) (bounds[3]+bounds[2])/2.0, (bounds[5]+bounds[4])/2.0); - static float DIST_COEFF = 0.1; + static vtkFloatingPointType DIST_COEFF = 0.1; SetDistance(this->InitialLength*DIST_COEFF); // this->UpdateRepresentation(); @@ -1235,10 +1242,10 @@ void VISU_PlanesWidget::InitialPlaceWidget(float bds[6]) // function: PlaceWidget // purpose : //================================================================== -void VISU_PlanesWidget::PlaceWidget(float bds[6]) +void VISU_PlanesWidget::PlaceWidget(vtkFloatingPointType bds[6]) { int i; - float bounds[6], origin[3]; + vtkFloatingPointType bounds[6], origin[3]; this->AdjustBounds(bds, bounds, origin); @@ -1281,9 +1288,9 @@ void VISU_PlanesWidget::PlaceWidget(float bds[6]) // function: SetOrigin // purpose :Set the origin of the plane.(for external calls) //================================================================== -void VISU_PlanesWidget::SetOrigin(float x, float y, float z) +void VISU_PlanesWidget::SetOrigin(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z) { - float origin[3]; + vtkFloatingPointType origin[3]; origin[0] = x; origin[1] = y; origin[2] = z; @@ -1293,9 +1300,9 @@ void VISU_PlanesWidget::SetOrigin(float x, float y, float z) // function: SetOrigin // purpose : Set the origin of the plane.(for external calls) //================================================================== -void VISU_PlanesWidget::SetOrigin(float x[3]) +void VISU_PlanesWidget::SetOrigin(vtkFloatingPointType x[3]) { - float *bounds = this->myOutline->GetOutput()->GetBounds(); + vtkFloatingPointType *bounds = this->myOutline->GetOutput()->GetBounds(); for (int i=0; i<3; i++) { if ( x[i] < bounds[2*i] ) { x[i] = bounds[2*i]; @@ -1305,7 +1312,7 @@ void VISU_PlanesWidget::SetOrigin(float x[3]) } } myPlane1->SetOrigin(x); - float *origin, *normal, oNew[3]; + vtkFloatingPointType *origin, *normal, oNew[3]; origin = myPlane1->GetOrigin(); normal = myPlane1->GetNormal(); vtkMath::Normalize(normal); @@ -1319,12 +1326,12 @@ void VISU_PlanesWidget::SetOrigin(float x[3]) // function: GetOrigin // purpose :Get the origin of the plane. //================================================================== -float* VISU_PlanesWidget::GetOrigin() +vtkFloatingPointType* VISU_PlanesWidget::GetOrigin() { return myPlane1->GetOrigin(); } -void VISU_PlanesWidget::GetOrigin(float xyz[3]) +void VISU_PlanesWidget::GetOrigin(vtkFloatingPointType xyz[3]) { myPlane1->GetOrigin(xyz); } @@ -1332,9 +1339,9 @@ void VISU_PlanesWidget::GetOrigin(float xyz[3]) // function: SetNormal // purpose :Set the normal to the plane. //================================================================== -void VISU_PlanesWidget::SetNormal(float x, float y, float z) +void VISU_PlanesWidget::SetNormal(vtkFloatingPointType x, vtkFloatingPointType y, vtkFloatingPointType z) { - float n[3]; + vtkFloatingPointType n[3]; n[0] = x; n[1] = y; n[2] = z; @@ -1352,7 +1359,7 @@ void VISU_PlanesWidget::SetNormal(float x, float y, float z) // function: SetNormal // purpose :Set the normal to the plane. //================================================================== -void VISU_PlanesWidget::SetNormal(float n[3]) +void VISU_PlanesWidget::SetNormal(vtkFloatingPointType n[3]) { this->SetNormal(n[0], n[1], n[2]); } @@ -1360,7 +1367,7 @@ void VISU_PlanesWidget::SetNormal(float n[3]) // function: GetNormal // purpose :Get the normal to the plane. //================================================================== -float* VISU_PlanesWidget::GetNormal() +vtkFloatingPointType* VISU_PlanesWidget::GetNormal() { return myPlane1->GetNormal(); } @@ -1368,7 +1375,7 @@ float* VISU_PlanesWidget::GetNormal() // function: GetNormal // purpose :Get the normal to the plane. //================================================================== -void VISU_PlanesWidget::GetNormal(float xyz[3]) +void VISU_PlanesWidget::GetNormal(vtkFloatingPointType xyz[3]) { myPlane1->GetNormal(xyz); } @@ -1492,12 +1499,12 @@ void VISU_PlanesWidget::UpdateRepresentation() return; } - float *origin = myPlane1->GetOrigin(); - float *normal = myPlane1->GetNormal(); - float p2[3]; + vtkFloatingPointType *origin = myPlane1->GetOrigin(); + vtkFloatingPointType *normal = myPlane1->GetNormal(); + vtkFloatingPointType p2[3]; // Setup the plane normal - float d = this->myOutline->GetOutput()->GetLength(); + vtkFloatingPointType d = this->myOutline->GetOutput()->GetLength(); p2[0] = origin[0] + 0.30 * d * normal[0]; p2[1] = origin[1] + 0.30 * d * normal[1]; @@ -1540,12 +1547,12 @@ void VISU_PlanesWidget::PrintSelf(ostream& os, vtkIndent indent) //================================================================== bool IsValidPlane2Position(vtkPlane *pPx, vtkDataSet *pDataSet, - float aTol) + vtkFloatingPointType aTol) { bool bRet; int i, iFound; - float aD, aDmax, aPnts[24], aDiagonal; - float aTol1, aOr[3], aN[3]; + vtkFloatingPointType aD, aDmax, aPnts[24], aDiagonal; + vtkFloatingPointType aTol1, aOr[3], aN[3]; // bRet=false; aDiagonal=pDataSet->GetLength(); @@ -1575,15 +1582,16 @@ bool IsValidPlane2Position(vtkPlane *pPx, // function: GetBndPoints // purpose : //================================================================== -void GetBndPoints(vtkDataSet *pDataSet, - float aPnts[24]) +void +GetBndPoints(vtkDataSet *pDataSet, + vtkFloatingPointType aPnts[24]) { - int aIndx[24]={ + int aIndx[24] = { 0,2,4,1,2,4,1,3,4,0,3,4, 0,2,5,1,2,5,1,3,5,0,3,5 }; int i; - float *pBounds=pDataSet->GetBounds(); + vtkFloatingPointType *pBounds=pDataSet->GetBounds(); // for (i=0; i<24; ++i){ aPnts[i]=pBounds[aIndx[i]]; @@ -1593,13 +1601,14 @@ void GetBndPoints(vtkDataSet *pDataSet, // function: DistanceToPlane // purpose : //================================================================== -float DistanceToPlane(const float x[3], - const float n[3], - const float p0[3]) +vtkFloatingPointType +DistanceToPlane(const vtkFloatingPointType x[3], + const vtkFloatingPointType n[3], + const vtkFloatingPointType p0[3]) { - return ((float) (n[0]*(x[0]-p0[0]) + - n[1]*(x[1]-p0[1]) + - n[2]*(x[2]-p0[2]))); + return ((n[0]*(x[0]-p0[0]) + + n[1]*(x[1]-p0[1]) + + n[2]*(x[2]-p0[2]))); } /* //================================================================== @@ -1608,7 +1617,7 @@ float DistanceToPlane(const float x[3], //================================================================== void VISU_PlanesWidget::SizeHandles() { - // float radius = + // vtkFloatingPointType radius = this->vtk3DWidget::SizeHandles(1.35); } */ diff --git a/src/PIPELINE/VISU_PlanesWidget.hxx b/src/PIPELINE/VISU_PlanesWidget.hxx index fdf45367..2b4370d0 100644 --- a/src/PIPELINE/VISU_PlanesWidget.hxx +++ b/src/PIPELINE/VISU_PlanesWidget.hxx @@ -59,31 +59,59 @@ public: vtkTypeRevisionMacro(VISU_PlanesWidget,VISU_ImplicitFunctionWidget); void PrintSelf(ostream& os, vtkIndent indent); - void SetDistance (const float theDistance); - float Distance()const; + void + SetDistance(const vtkFloatingPointType theDistance); - vtkGetMacro(InitialLength,float); + vtkFloatingPointType + Distance() const; - virtual vtkImplicitFunction* ImplicitFunction(); + vtkGetMacro(InitialLength,vtkFloatingPointType); + + virtual + vtkImplicitFunction* + ImplicitFunction(); // Description: // Methods that satisfy the superclass' API. - virtual void SetEnabled(int); - virtual void PlaceWidget(float bounds[6]); + virtual + void + SetEnabled(int); + + virtual + void + PlaceWidget(vtkFloatingPointType bounds[6]); // Description: // Get the origin of the plane. - void SetOrigin(float x, float y, float z); - void SetOrigin(float x[3]); - float* GetOrigin(); - void GetOrigin(float xyz[3]); + void + SetOrigin(vtkFloatingPointType x, + vtkFloatingPointType y, + vtkFloatingPointType z); + + void + SetOrigin(vtkFloatingPointType x[3]); + + vtkFloatingPointType* + GetOrigin(); + + void + GetOrigin(vtkFloatingPointType xyz[3]); // Description: // Get the normal to the plane. - void SetNormal(float x, float y, float z); - void SetNormal(float x[3]); - float* GetNormal(); - void GetNormal(float xyz[3]); + void + SetNormal(vtkFloatingPointType x, + vtkFloatingPointType y, + vtkFloatingPointType z); + + void + SetNormal(vtkFloatingPointType x[3]); + + vtkFloatingPointType* + GetNormal(); + + void + GetNormal(vtkFloatingPointType xyz[3]); // Description: // Force the plane widget to be aligned with one of the x-y-z axes. @@ -91,13 +119,20 @@ public: // Remember that when the state changes, a ModifiedEvent is invoked. // This can be used to snap the plane to the axes if it is orginally // not aligned. - void SetNormalToXAxis(int); + void + SetNormalToXAxis(int); + vtkGetMacro(NormalToXAxis,int); vtkBooleanMacro(NormalToXAxis,int); - void SetNormalToYAxis(int); + + void + SetNormalToYAxis(int); + vtkGetMacro(NormalToYAxis,int); vtkBooleanMacro(NormalToYAxis,int); - void SetNormalToZAxis(int); + + void + SetNormalToZAxis(int); vtkGetMacro(NormalToZAxis,int); vtkBooleanMacro(NormalToZAxis,int); @@ -113,8 +148,12 @@ public: // interferes with the object that it is operating on (i.e., the // plane interferes with the cut surface it produces producing // z-buffer artifacts.) - void SetDrawPlane(int plane); - int GetDrawPlane(){ + void + SetDrawPlane(int plane); + + int + GetDrawPlane() + { return myDrawPlane; } @@ -128,7 +167,8 @@ public: // Description: // Grab the polydata that defines the plane. The polydata contains a single // polygon that is clipped by the bounding box. - void GetPolyData(vtkPolyData *pd); + void + GetPolyData(vtkPolyData *pd); // Description: // Satisfies superclass API. This returns a pointer to the underlying @@ -140,12 +180,14 @@ public: // instance of the class vtkPlane. Note that vtkPlane is a subclass of // vtkImplicitFunction, meaning that it can be used by a variety of filters // to perform clipping, cutting, and selection of data. - void GetPlane(vtkPlane *plane); + void + GetPlane(vtkPlane *plane); // Description: // Satisfies the superclass API. This will change the state of the widget // to match changes that have been made to the underlying PolyDataSource - void UpdatePlacement(void); + void + UpdatePlacement(void); // Description: // Get the properties on the normal (line and cone). @@ -168,7 +210,8 @@ public: // applies to the edges when tubed.) vtkGetObjectMacro(EdgesProperty,vtkProperty); - void InitialPlaceWidget(float bds[6]); + void + InitialPlaceWidget(vtkFloatingPointType bds[6]); protected: VISU_PlanesWidget(); @@ -191,8 +234,10 @@ protected: //ETX //handles the events - static void ProcessEvents(vtkObject* object, unsigned long event, - void* clientdata, void* calldata); + static + void + ProcessEvents(vtkObject* object, unsigned long event, + void* clientdata, void* calldata); // ProcessEvents() dispatches to these methods. void OnLeftButtonDown(); @@ -204,7 +249,7 @@ protected: void OnMouseMove(); // // Methods to manipulate the plane - void ConstrainOrigin(float x[3]); + void ConstrainOrigin(vtkFloatingPointType x[3]); void Rotate(int X, int Y, double *p1, double *p2, double *vpn); void TranslatePlane(double *p1, double *p2); void TranslateOutline(double *p1, double *p2); @@ -221,7 +266,7 @@ protected: void HighlightNormal(int highlight); void HighlightOutline(int highlight); void UpdateRepresentation(); - void SetOriginInternal(float x[3]); + void SetOriginInternal(vtkFloatingPointType x[3]); // Controlling ivars int NormalToXAxis; @@ -238,7 +283,7 @@ protected: vtkPlane *myPlane1; vtkPlane *myPlane2; - float myDistance; + vtkFloatingPointType myDistance; vtkImplicitBoolean *myImplicitFunction; // The bounding box is represented by a single voxel image data diff --git a/src/PIPELINE/VISU_Plot3DPL.cxx b/src/PIPELINE/VISU_Plot3DPL.cxx index 164d9a7a..928accc0 100644 --- a/src/PIPELINE/VISU_Plot3DPL.cxx +++ b/src/PIPELINE/VISU_Plot3DPL.cxx @@ -86,9 +86,9 @@ GetOrientation(vtkDataSet* theDataSet) { theDataSet->Update(); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; theDataSet->GetBounds(aBounds); - float aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]}; + vtkFloatingPointType aDelta[3] = {aBounds[1] - aBounds[0], aBounds[3] - aBounds[2], aBounds[5] - aBounds[4]}; if(aDelta[0] >= aDelta[1] && aDelta[0] >= aDelta[2]) if(aDelta[1] >= aDelta[2]) @@ -111,18 +111,18 @@ GetOrientation(vtkDataSet* theDataSet) return VISU_CutPlanesPL::XY; } -float +vtkFloatingPointType VISU_Plot3DPL:: GetScaleFactor(vtkDataSet* theDataSet) { theDataSet->Update(); - float aLength = theDataSet->GetLength(); // diagonal length + vtkFloatingPointType aLength = theDataSet->GetLength(); // diagonal length - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); - static float EPS = 0.3; - float aRange = aScalarRange[1]; + static vtkFloatingPointType EPS = 0.3; + vtkFloatingPointType aRange = aScalarRange[1]; if(aRange > 0.0) return aLength / aRange * EPS; @@ -150,8 +150,8 @@ void VISU_Plot3DPL:: Update() { - float aPlaneNormal[3]; - float anOrigin[3]; + vtkFloatingPointType aPlaneNormal[3]; + vtkFloatingPointType anOrigin[3]; GetBasePlane( anOrigin, aPlaneNormal ); vtkPolyData* aPolyData = 0; @@ -198,7 +198,7 @@ Update() }else myContourFilter->SetInput(aPolyData); - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); myContourFilter->GenerateValues(GetNumberOfContours(),aScalarRange); @@ -232,13 +232,13 @@ GetNumberOfContours() const void VISU_Plot3DPL:: -SetScaleFactor(float theScaleFactor) +SetScaleFactor(vtkFloatingPointType theScaleFactor) { myScaleFactor = theScaleFactor; myWarpScalar->SetScaleFactor(theScaleFactor); } -float +vtkFloatingPointType VISU_Plot3DPL:: GetScaleFactor() const { @@ -247,7 +247,7 @@ GetScaleFactor() const void VISU_Plot3DPL:: -SetPlanePosition(float thePosition, +SetPlanePosition(vtkFloatingPointType thePosition, bool theIsRelative) { myIsRelative = theIsRelative; @@ -269,7 +269,7 @@ GetPlaneOrientation() const } -float +vtkFloatingPointType VISU_Plot3DPL:: GetRotateX() { @@ -281,7 +281,7 @@ GetRotateX() return 0; } -float +vtkFloatingPointType VISU_Plot3DPL:: GetRotateY(){ switch(myOrientation){ @@ -295,8 +295,8 @@ GetRotateY(){ void VISU_Plot3DPL:: SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, - float theXAngle, - float theYAngle) + vtkFloatingPointType theXAngle, + vtkFloatingPointType theYAngle) { switch(theOrientation){ case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break; @@ -311,7 +311,7 @@ SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, myOrientation = theOrientation; } -float +vtkFloatingPointType VISU_Plot3DPL:: GetPlanePosition() const { @@ -323,14 +323,14 @@ GetPlanePosition() const //purpose : //======================================================================= -void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], - float theNormal[3], +void VISU_Plot3DPL::GetBasePlane(vtkFloatingPointType theOrigin[3], + vtkFloatingPointType theNormal[3], bool theCenterOrigine ) const { VISU_CutPlanesPL::GetDir(theNormal,myAngle,myOrientation); - float aPosition = myPosition; - float aBounds[6], aBoundPrj[3]; + vtkFloatingPointType aPosition = myPosition; + vtkFloatingPointType aBounds[6], aBoundPrj[3]; if ( myIsRelative ) { GetInput()->GetBounds(aBounds); @@ -342,7 +342,7 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], if ( theCenterOrigine ) { // move theOrigin to the center of aBounds projections to the plane GetInput2()->GetBounds(aBounds); - float boundPoints[8][3] = { + vtkFloatingPointType boundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]}, {aBounds[1],aBounds[2],aBounds[4]}, {aBounds[0],aBounds[3],aBounds[4]}, @@ -351,9 +351,9 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], {aBounds[1],aBounds[2],aBounds[5]}, {aBounds[0],aBounds[3],aBounds[5]}, {aBounds[1],aBounds[3],aBounds[5]}}; - float newOrigin[3] = { 0,0,0 }; + vtkFloatingPointType newOrigin[3] = { 0,0,0 }; for(int i = 0; i < 8; i++) { - float proj[3]; + vtkFloatingPointType proj[3]; vtkPlane::ProjectPoint( boundPoints[i], theOrigin, theNormal, proj ); newOrigin[0] += proj[0]; newOrigin[1] += proj[1]; @@ -370,9 +370,10 @@ void VISU_Plot3DPL::GetBasePlane(float theOrigin[3], //purpose : return absolute position range //======================================================================= -void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const +void VISU_Plot3DPL::GetMinMaxPosition( vtkFloatingPointType& minPos, + vtkFloatingPointType& maxPos ) const { - float aBounds[6], aBoundPrj[3], aNormal[3]; + vtkFloatingPointType aBounds[6], aBoundPrj[3], aNormal[3]; VISU_CutPlanesPL::GetDir(aNormal,myAngle,myOrientation); GetInput()->GetBounds(aBounds); VISU_CutPlanesPL::GetBoundProject(aBoundPrj,aBounds,aNormal); @@ -385,14 +386,14 @@ void VISU_Plot3DPL::GetMinMaxPosition( float& minPos, float& maxPos ) const //purpose : //======================================================================= -void VISU_Plot3DPL::SetMapScale(float theMapScale) +void VISU_Plot3DPL::SetMapScale(vtkFloatingPointType theMapScale) { VISU_ScalarMapPL::SetMapScale(theMapScale); if ( myIsContour ) { - float aRange[2]; + vtkFloatingPointType aRange[2]; GetSourceRange(aRange); - float aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] }; + vtkFloatingPointType aNewRange[] = { aRange[1] - theMapScale*(aRange[1]-aRange[0]), aRange[1] }; myContourFilter->GenerateValues(GetNumberOfContours(),aNewRange); } myWarpScalar->SetScaleFactor(myScaleFactor*theMapScale); diff --git a/src/PIPELINE/VISU_Plot3DPL.hxx b/src/PIPELINE/VISU_Plot3DPL.hxx index 9df47b2d..4b60e226 100644 --- a/src/PIPELINE/VISU_Plot3DPL.hxx +++ b/src/PIPELINE/VISU_Plot3DPL.hxx @@ -52,31 +52,31 @@ public: VISU_CutPlanesPL::PlaneOrientation GetPlaneOrientation() const; - float + vtkFloatingPointType GetRotateX(); - float + vtkFloatingPointType GetRotateY(); void SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation, - float theXAngle = 0.0, - float theYAngle = 0.0); + vtkFloatingPointType theXAngle = 0.0, + vtkFloatingPointType theYAngle = 0.0); - float + vtkFloatingPointType GetPlanePosition() const; bool IsPositionRelative() const; void - SetPlanePosition(float thePosition, + SetPlanePosition(vtkFloatingPointType thePosition, bool theIsRelative); void - SetScaleFactor(float theScaleFactor); + SetScaleFactor(vtkFloatingPointType theScaleFactor); - float + vtkFloatingPointType GetScaleFactor() const; void @@ -91,11 +91,12 @@ public: int GetNumberOfContours() const; - void GetBasePlane (float theOrigin[3], - float theNormal[3], + void GetBasePlane (vtkFloatingPointType theOrigin[3], + vtkFloatingPointType theNormal[3], bool theCenterOrigine = false ) const; - void GetMinMaxPosition( float& minPos, float& maxPos ) const; + void GetMinMaxPosition( vtkFloatingPointType& minPos, + vtkFloatingPointType& maxPos ) const; public: virtual void Init(); @@ -105,17 +106,17 @@ public: VISU_CutPlanesPL::PlaneOrientation GetOrientation(vtkDataSet* theDataSet); - float + vtkFloatingPointType GetScaleFactor(vtkDataSet* theDataSet); - void SetMapScale(float theMapScale); + void SetMapScale(vtkFloatingPointType theMapScale); protected: virtual THook* DoHook(); - float myAngle[3]; + vtkFloatingPointType myAngle[3]; bool myIsRelative, myIsContour; - float myPosition, myScaleFactor; + vtkFloatingPointType myPosition, myScaleFactor; VISU_CutPlanesPL::PlaneOrientation myOrientation; TVTKSmartPtr myCellDataToPointData; diff --git a/src/PIPELINE/VISU_ScalarBarActor.cxx b/src/PIPELINE/VISU_ScalarBarActor.cxx index afa44bd7..b6625853 100644 --- a/src/PIPELINE/VISU_ScalarBarActor.cxx +++ b/src/PIPELINE/VISU_ScalarBarActor.cxx @@ -258,7 +258,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) // we hard code how many steps to display int numColors = this->MaximumNumberOfColors; - float *range = lut->GetRange(); + vtkFloatingPointType *range = lut->GetRange(); int numPts = 2*(numColors + 1); vtkPoints *pts = vtkPoints::New(); @@ -315,13 +315,13 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) this->NumberOfLabelsBuilt = this->NumberOfLabels; // generate points - float x[3]; x[2] = 0.0; - float delta, val; + vtkFloatingPointType x[3]; x[2] = 0.0; + vtkFloatingPointType delta, val; if ( this->Orientation == VTK_ORIENT_VERTICAL ) { barWidth = size[0] - 4 - labelSize[0]; barHeight = (int)(0.86*size[1]); - delta=(float)barHeight/numColors; + delta=(vtkFloatingPointType)barHeight/numColors; for (i=0; iInsertNextCell(4,ptIds); if ( isLogTable ){ //SALOME specific - float rgbval = log10(range[0]) + + vtkFloatingPointType rgbval = log10(range[0]) + i*(log10(range[1])-log10(range[0]))/(numColors -1); rgba = lut->MapValue(rgbval); }else{ rgba = lut->MapValue(range[0] + (range[1] - range[0])* - ((float)i /(numColors-1.0))); + ((vtkFloatingPointType)i /(numColors-1.0))); } rgb = colors->GetPointer(3*i); //write into array directly @@ -383,7 +383,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) for (i=0; i < this->NumberOfLabels; i++) { - val = (float)i/(this->NumberOfLabels-1) *barHeight; + val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) *barHeight; this->TextMappers[i]->GetSize(viewport,sizeTextData); this->TextMappers[i]->GetTextProperty()->SetJustificationToLeft(); this->TextActors[i]->SetPosition(barWidth+3, @@ -397,7 +397,7 @@ int VISU_ScalarBarActor::RenderOpaqueGeometry(vtkViewport *viewport) for (i=0; i < this->NumberOfLabels; i++) { this->TextMappers[i]->GetTextProperty()->SetJustificationToCentered(); - val = (float)i/(this->NumberOfLabels-1) * barWidth; + val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) * barWidth; this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]); } } @@ -503,7 +503,7 @@ void VISU_ScalarBarActor::ShallowCopy(vtkProp *prop) void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, vtkViewport *viewport, - float *range) + vtkFloatingPointType *range) { labelSize[0] = labelSize[1] = 0; @@ -512,7 +512,7 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, char string[512]; - float val; + vtkFloatingPointType val; int i; // TODO: this should be optimized, maybe by keeping a list of @@ -529,11 +529,11 @@ void VISU_ScalarBarActor::AllocateAndSizeLabels(int *labelSize, int *size, this->TextMappers[i] = vtkTextMapper::New(); if(isLogTable && 0 < i && i < this->NumberOfLabels - 1){ // SALOME specific - float lval = log10(range[0]) + (float)i/(this->NumberOfLabels-1) * + vtkFloatingPointType lval = log10(range[0]) + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (log10(range[1])-log10(range[0])); val = pow(10,lval); }else{ - val = range[0] + (float)i/(this->NumberOfLabels-1) * (range[1]-range[0]); + val = range[0] + (vtkFloatingPointType)i/(this->NumberOfLabels-1) * (range[1]-range[0]); } sprintf(string, this->LabelFormat, val); this->TextMappers[i]->SetInput(string); diff --git a/src/PIPELINE/VISU_ScalarBarActor.hxx b/src/PIPELINE/VISU_ScalarBarActor.hxx index be2f62ce..7db60d5a 100644 --- a/src/PIPELINE/VISU_ScalarBarActor.hxx +++ b/src/PIPELINE/VISU_ScalarBarActor.hxx @@ -138,7 +138,7 @@ protected: vtkTextMapper **TextMappers; virtual void AllocateAndSizeLabels(int *labelSize, int *size, - vtkViewport *viewport, float *range); + vtkViewport *viewport, vtkFloatingPointType *range); private: vtkTextMapper *TitleMapper; diff --git a/src/PIPELINE/VISU_ScalarBarCtrl.cxx b/src/PIPELINE/VISU_ScalarBarCtrl.cxx index 561b2432..8f24c298 100644 --- a/src/PIPELINE/VISU_ScalarBarCtrl.cxx +++ b/src/PIPELINE/VISU_ScalarBarCtrl.cxx @@ -45,7 +45,7 @@ namespace inline void MarkValueByColor(vtkLookupTable* theTable, - float theValue, + vtkFloatingPointType theValue, unsigned char* theColor) { vtkIdType anIndex = theTable->GetIndex(theValue); @@ -81,12 +81,12 @@ namespace unsigned char aRedPtr[3] = {255, 0, 0}; unsigned char aBluePtr[3] = {0, 0, 255}; - float aRange[2]; + vtkFloatingPointType aRange[2]; theTable->GetTableRange(aRange); vtkIdType aNbColors = theTable->GetNumberOfColors(); - float aDelta = (aRange[1]-aRange[0])/aNbColors; - float aValue = aRange[0]+0.5*aDelta; + vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors; + vtkFloatingPointType aValue = aRange[0]+0.5*aDelta; for(int i = 0; i < aNbColors; i++){ vtkIdType anIndex = theTable->GetIndex(aValue); unsigned char* aTablePtr = theTable->GetPointer(anIndex); @@ -206,15 +206,15 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetRangeLocal(float *theRange) +::SetRangeLocal(vtkFloatingPointType *theRange) { myLocalLookupTable->SetTableRange(theRange); } void VISU_ScalarBarCtrl -::SetRangeLocal(float theMin, - float theMax) +::SetRangeLocal(vtkFloatingPointType theMin, + vtkFloatingPointType theMax) { myLocalLookupTable->SetTableRange(theMin,theMax); } @@ -223,15 +223,15 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetRangeGlobal(float *theRange) +::SetRangeGlobal(vtkFloatingPointType *theRange) { myGlobalLookupTable->SetTableRange(theRange); } void VISU_ScalarBarCtrl -::SetRangeGlobal(float theMin, - float theMax) +::SetRangeGlobal(vtkFloatingPointType theMin, + vtkFloatingPointType theMax) { myGlobalLookupTable->SetTableRange(theMin,theMax); } @@ -298,13 +298,13 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetWidth(float theWidth) +::SetWidth(vtkFloatingPointType theWidth) { myGlobalScalarBar->SetWidth(theWidth); myLocalScalarBar->SetWidth(theWidth); } -float +vtkFloatingPointType VISU_ScalarBarCtrl ::GetWidth() const { @@ -315,14 +315,14 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetHeight(float theHeight) +::SetHeight(vtkFloatingPointType theHeight) { myGlobalScalarBar->SetHeight(theHeight); myLocalScalarBar->SetHeight(theHeight); } -float +vtkFloatingPointType VISU_ScalarBarCtrl ::GetHeight() const { @@ -333,13 +333,13 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetPosition(const float* thePosition) +::SetPosition(const vtkFloatingPointType* thePosition) { myPosition[0] = thePosition[0]; myPosition[1] = thePosition[1]; } -const float* +const vtkFloatingPointType* VISU_ScalarBarCtrl::GetPosition() const { return myPosition; @@ -349,12 +349,12 @@ VISU_ScalarBarCtrl::GetPosition() const //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetSpacing(const float theSpacing) +::SetSpacing(const vtkFloatingPointType theSpacing) { myDistance = theSpacing; } -float +vtkFloatingPointType VISU_ScalarBarCtrl ::GetSpacing() const { @@ -381,12 +381,12 @@ VISU_ScalarBarCtrl //---------------------------------------------------------------------------- void VISU_ScalarBarCtrl -::SetMarkValue(const float theValue) +::SetMarkValue(const vtkFloatingPointType theValue) { myMarkedValue = theValue; } -float +vtkFloatingPointType VISU_ScalarBarCtrl ::GetMarkValue() const { @@ -441,7 +441,7 @@ VISU_ScalarBarCtrl } } if(myGlobalRangeIsDefined){ - float aLocalRange[2]; + vtkFloatingPointType aLocalRange[2]; myLocalLookupTable->GetTableRange(aLocalRange); MarkValueByColor(myGlobalLookupTable, aLocalRange[0], myBlack); MarkValueByColor(myGlobalLookupTable, aLocalRange[1], myBlack); @@ -459,10 +459,10 @@ VISU_ScalarBarCtrl vtkCoordinate * aCoordinate = theScalarBarActor->GetPositionCoordinate(); aCoordinate->SetCoordinateSystemToNormalizedViewport(); if(theScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL){ - float aWidth = theScalarBarActor->GetWidth(); + vtkFloatingPointType aWidth = theScalarBarActor->GetWidth(); aCoordinate->SetValue(myPosition[0]+theId*(aWidth+myDistance), myPosition[1]); }else{ - float aHeight = theScalarBarActor->GetHeight(); + vtkFloatingPointType aHeight = theScalarBarActor->GetHeight(); aCoordinate->SetValue(myPosition[0], myPosition[1]+theId*(aHeight+myDistance)); } // Initialize Lookup Tables and Scalar Bars diff --git a/src/PIPELINE/VISU_ScalarBarCtrl.hxx b/src/PIPELINE/VISU_ScalarBarCtrl.hxx index c1a2f958..96686885 100644 --- a/src/PIPELINE/VISU_ScalarBarCtrl.hxx +++ b/src/PIPELINE/VISU_ScalarBarCtrl.hxx @@ -29,6 +29,8 @@ #include +#include "VTKViewer.h" + class vtkRenderer; class vtkLookupTable; class vtkScalarBarActor; @@ -37,88 +39,147 @@ class VISU_ScalarBarCtrl : public vtkObject { public: vtkTypeMacro(VISU_ScalarBarCtrl, vtkObject); - static VISU_ScalarBarCtrl* New(); + static + VISU_ScalarBarCtrl* + New(); enum EMode {eSimple, eGlobal, eLocal}; // Mode - void SetMode(EMode theMode); - EMode GetMode() const; + void + SetMode(EMode theMode); + + EMode + GetMode() const; // Ranges - void SetRangeGlobal(float theMin, - float theMax); - void SetRangeGlobal(float *theRange); + void + SetRangeGlobal(vtkFloatingPointType theMin, + vtkFloatingPointType theMax); + void + SetRangeGlobal(vtkFloatingPointType *theRange); - void SetGlobalRangeIsDefined(bool theIsDefined); + void + SetGlobalRangeIsDefined(bool theIsDefined); - void SetRangeLocal(float theMin, - float theMax); - void SetRangeLocal(float *theRange); + void + SetRangeLocal(vtkFloatingPointType theMin, + vtkFloatingPointType theMax); + void + SetRangeLocal(vtkFloatingPointType *theRange); // Selectors - vtkScalarBarActor* GetLocalBar(); - vtkLookupTable* GetLocalTable(); + vtkScalarBarActor* + GetLocalBar(); + + vtkLookupTable* + GetLocalTable(); + + vtkScalarBarActor* + GetGlobalBar(); - vtkScalarBarActor* GetGlobalBar(); - vtkLookupTable* GetGlobalTable(); + vtkLookupTable* + GetGlobalTable(); // // Renderer - void AddToRender(vtkRenderer* theRenderer); - void RemoveFromRender(vtkRenderer* theRenderer); + void + AddToRender(vtkRenderer* theRenderer); + + void + RemoveFromRender(vtkRenderer* theRenderer); // // Visibility - void SetVisibility(int theFlag); - int GetVisibility() const; - // + void + SetVisibility(int theFlag); + + int + GetVisibility() const; + // Visibility - void SetCtrlVisibility(int theFlag); - int GetCtrlVisibility() const; - // + void + SetCtrlVisibility(int theFlag); + + int + GetCtrlVisibility() const; + // Build void Update(); - // + // Position - void SetWidth(const float theWidth); - float GetWidth()const; - void SetHeight(const float theHeight); - float GetHeight()const; - void SetPosition(const float* thePosition); - const float* GetPosition()const; + void + SetWidth(const vtkFloatingPointType theWidth); + + vtkFloatingPointType + GetWidth() const; + + void + SetHeight(const vtkFloatingPointType theHeight); + + vtkFloatingPointType + GetHeight() const; + + void + SetPosition(const vtkFloatingPointType* thePosition); + + const vtkFloatingPointType* + GetPosition() const; // // Spacing - void SetSpacing(const float theSpacing); - float GetSpacing()const; + void + SetSpacing(const vtkFloatingPointType theSpacing); + + vtkFloatingPointType + GetSpacing() const; // // Rainbow/bicolor - bool GetBicolor() const; - void SetBicolor(const bool theBicolor); + bool + GetBicolor() const; + + void + SetBicolor(const bool theBicolor); // // Misc - void SetMarkValue (const float theValue); - float GetMarkValue ()const; - void SetIsMarked(const bool theFlag); - bool GetIsMarked()const; + void + SetMarkValue(const vtkFloatingPointType theValue); + + vtkFloatingPointType + GetMarkValue() const; + + void + SetIsMarked(const bool theFlag); + + bool + GetIsMarked()const; // protected: VISU_ScalarBarCtrl(); - virtual ~VISU_ScalarBarCtrl(); + + virtual + ~VISU_ScalarBarCtrl(); - void UpdateForBicolor(); - void UpdateForColor(); - void UpdateMarkValue(); - void PrepareTables(); + void + UpdateForBicolor(); + + void + UpdateForColor(); + + void + UpdateMarkValue(); + + void + PrepareTables(); - void PrepareTables(vtkScalarBarActor* theScalarBarActor, - vtkLookupTable *theLookupTable, - vtkIdType theId); + void + PrepareTables(vtkScalarBarActor* theScalarBarActor, + vtkLookupTable *theLookupTable, + vtkIdType theId); protected: EMode myMode; bool myGlobalRangeIsDefined; - float myDistance; - float myPosition[2]; + vtkFloatingPointType myDistance; + vtkFloatingPointType myPosition[2]; bool myBicolor; int myCtrlVisibility; @@ -126,7 +187,7 @@ protected: unsigned char myGrey[3]; // bool myMarked; - float myMarkedValue; + vtkFloatingPointType myMarkedValue; // vtkScalarBarActor *myGlobalScalarBar; vtkLookupTable *myGlobalLookupTable; diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx index 0d0ccad5..d911cffc 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.cxx @@ -48,7 +48,9 @@ vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL) * Merge filter which unify the deformation and scalars * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data */ -VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){ +VISU_ScalarMapOnDeformedShapePL +::VISU_ScalarMapOnDeformedShapePL() +{ myDeformVectors = vtkWarpVector::New(); myMergeFilter = vtkMergeFilter::New(); myExtractorScalars = VISU_Extractor::New(); @@ -59,7 +61,9 @@ VISU_ScalarMapOnDeformedShapePL::VISU_ScalarMapOnDeformedShapePL(){ * Destructor. * Delete all fields. */ -VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){ +VISU_ScalarMapOnDeformedShapePL +::~VISU_ScalarMapOnDeformedShapePL() +{ myDeformVectors->UnRegisterAllOutputs(); myDeformVectors->Delete(); @@ -76,13 +80,15 @@ VISU_ScalarMapOnDeformedShapePL::~VISU_ScalarMapOnDeformedShapePL(){ /*! * Initial method */ -void VISU_ScalarMapOnDeformedShapePL::Init(){ - +void +VISU_ScalarMapOnDeformedShapePL +::Init() +{ if (GetScalars() == NULL) SetScalars(GetInput2()); Superclass::Init(); - float aScalarRange[2]; + vtkFloatingPointType aScalarRange[2]; GetSourceRange(aScalarRange); static double EPS = 1.0 / VTK_LARGE_FLOAT; if(aScalarRange[1] > EPS) @@ -102,7 +108,9 @@ void VISU_ScalarMapOnDeformedShapePL::Init(){ * Build method * Building of deformation and puts result to merge filter. */ -void VISU_ScalarMapOnDeformedShapePL::Build() +void +VISU_ScalarMapOnDeformedShapePL +::Build() { // Set input for extractor myExtractor->SetInput(GetInput2()); @@ -119,12 +127,15 @@ void VISU_ScalarMapOnDeformedShapePL::Build() /*! * Update method */ -void VISU_ScalarMapOnDeformedShapePL::Update(){ +void +VISU_ScalarMapOnDeformedShapePL +::Update() +{ this->UpdateScalars(); - float aRange[2]; + vtkFloatingPointType aRange[2]; GetSourceRange(aRange); - float aScalarRange[2] = {aRange[0], aRange[1]}; + vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]}; if(myBarTable->GetScale() == VTK_SCALE_LOG10) VISU_LookupTable::ComputeLogRange(aRange,aScalarRange); @@ -143,7 +154,10 @@ void VISU_ScalarMapOnDeformedShapePL::Update(){ * Update scalars method. * Put scalars to merge filter. */ -void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){ +void +VISU_ScalarMapOnDeformedShapePL +::UpdateScalars() +{ if(myScalars->GetCellData()->GetVectors() != NULL || myScalars->GetPointData()->GetVectors() != NULL) myMergeFilter->SetScalars(myExtractorScalars->GetOutput()); @@ -155,12 +169,15 @@ void VISU_ScalarMapOnDeformedShapePL::UpdateScalars(){ * Copy information about pipline. * Copy scale and scalars. */ -void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){ +void +VISU_ScalarMapOnDeformedShapePL +::ShallowCopy(VISU_PipeLine *thePipeLine) +{ VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast(thePipeLine); if(aPipeLine){ SetScale(aPipeLine->GetScale()); SetScalars(aPipeLine->GetScalars()); - float aRange[2]; + vtkFloatingPointType aRange[2]; aPipeLine->GetSourceRange(aRange); SetScalarRange(aRange); } @@ -171,7 +188,10 @@ void VISU_ScalarMapOnDeformedShapePL::ShallowCopy(VISU_PipeLine *thePipeLine){ * Set scalars. * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction. */ -void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){ +void +VISU_ScalarMapOnDeformedShapePL +::SetScalars(vtkDataSet *theScalars) +{ myScalars = theScalars; vtkUnstructuredGrid* aScalars = GetScalars(); myExtractorScalars->SetInput(aScalars); @@ -181,14 +201,20 @@ void VISU_ScalarMapOnDeformedShapePL::SetScalars(vtkDataSet *theScalars){ /*! * Get pointer to input scalars. */ -vtkUnstructuredGrid* VISU_ScalarMapOnDeformedShapePL::GetScalars(){ +vtkUnstructuredGrid* +VISU_ScalarMapOnDeformedShapePL +::GetScalars() +{ return myScalars.GetPointer(); } /*! * Sets scale for deformed shape */ -void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) { +void +VISU_ScalarMapOnDeformedShapePL +::SetScale(vtkFloatingPointType theScale) +{ if(myScaleFactor == theScale) return; myScaleFactor = theScale; myDeformVectors->SetScaleFactor(myScaleFactor); @@ -198,15 +224,21 @@ void VISU_ScalarMapOnDeformedShapePL::SetScale(float theScale) { /*! * Gets scale of deformed shape. */ -float VISU_ScalarMapOnDeformedShapePL::GetScale() { - float aScale=myDeformVectors->GetScaleFactor(); +vtkFloatingPointType +VISU_ScalarMapOnDeformedShapePL +::GetScale() +{ + vtkFloatingPointType aScale=myDeformVectors->GetScaleFactor(); return aScale; } /*! * Set scale factor of deformation. */ -void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){ +void +VISU_ScalarMapOnDeformedShapePL +::SetMapScale(vtkFloatingPointType theMapScale) +{ myDeformVectors->SetScaleFactor(myScaleFactor*theMapScale); Modified(); } @@ -214,7 +246,10 @@ void VISU_ScalarMapOnDeformedShapePL::SetMapScale(float theMapScale){ /*! * Gets scalar mode. */ -int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){ +int +VISU_ScalarMapOnDeformedShapePL +::GetScalarMode() +{ int aMode=myExtractorScalars->GetScalarMode(); return aMode; } @@ -222,7 +257,10 @@ int VISU_ScalarMapOnDeformedShapePL::GetScalarMode(){ /*! * Sets scalar mode. */ -void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){ +void +VISU_ScalarMapOnDeformedShapePL +::SetScalarMode(int theScalarMode) +{ myExtractorScalars->SetScalarMode(theScalarMode); Modified(); } @@ -233,7 +271,10 @@ void VISU_ScalarMapOnDeformedShapePL::SetScalarMode(int theScalarMode){ * \li theRange[0] - minimum value * \li theRange[1] - maximum value */ -void VISU_ScalarMapOnDeformedShapePL::GetSourceRange(float theRange[2]){ +void +VISU_ScalarMapOnDeformedShapePL +::GetSourceRange(vtkFloatingPointType theRange[2]) +{ myExtractorScalars->Update(); myExtractorScalars->GetUnstructuredGridOutput()->GetScalarRange(theRange); } diff --git a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx index 6d1ccf9a..4105c413 100644 --- a/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx +++ b/src/PIPELINE/VISU_ScalarMapOnDeformedShapePL.hxx @@ -50,13 +50,13 @@ public: virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SetScale(float theScale); - virtual float GetScale(); + virtual void SetScale(vtkFloatingPointType theScale); + virtual vtkFloatingPointType GetScale(); virtual int GetScalarMode(); virtual void SetScalarMode(int theScalarMode = 0); - virtual void GetSourceRange(float theRange[2]); + virtual void GetSourceRange(vtkFloatingPointType theRange[2]); virtual void SetScalars(vtkDataSet *theScalars); virtual vtkUnstructuredGrid* GetScalars(); @@ -81,10 +81,10 @@ public: void UpdateScalars(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual void SetMapScale(vtkFloatingPointType theMapScale = 1.0); protected: - float myScaleFactor; + vtkFloatingPointType myScaleFactor; vtkWarpVector *myDeformVectors; vtkMergeFilter *myMergeFilter; vtkSmartPointer myScalars; diff --git a/src/PIPELINE/VISU_ScalarMapPL.cxx b/src/PIPELINE/VISU_ScalarMapPL.cxx index daaa24e6..0d854a16 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.cxx +++ b/src/PIPELINE/VISU_ScalarMapPL.cxx @@ -142,7 +142,7 @@ VISU_ScalarMapPL //---------------------------------------------------------------------------- -float* +vtkFloatingPointType* VISU_ScalarMapPL ::GetScalarRange() { @@ -151,7 +151,7 @@ VISU_ScalarMapPL void VISU_ScalarMapPL -::SetScalarRange(float theRange[2]) +::SetScalarRange(vtkFloatingPointType theRange[2]) { myFieldTransform->SetScalarRange(theRange); myBarTable->SetRange(theRange); @@ -160,17 +160,17 @@ VISU_ScalarMapPL void VISU_ScalarMapPL -::SetScalarMin(float theValue) +::SetScalarMin(vtkFloatingPointType theValue) { - float aScalarRange[2] = {theValue, GetScalarRange()[1]}; + vtkFloatingPointType aScalarRange[2] = {theValue, GetScalarRange()[1]}; SetScalarRange(aScalarRange); } void VISU_ScalarMapPL -::SetScalarMax(float theValue) +::SetScalarMax(vtkFloatingPointType theValue) { - float aScalarRange[2] = {GetScalarRange()[0], theValue}; + vtkFloatingPointType aScalarRange[2] = {GetScalarRange()[0], theValue}; SetScalarRange(aScalarRange); } @@ -224,8 +224,8 @@ void VISU_ScalarMapPL ::Update() { - float *aRange = myFieldTransform->GetScalarRange(); - float aScalarRange[2] = {aRange[0], aRange[1]}; + vtkFloatingPointType *aRange = myFieldTransform->GetScalarRange(); + vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]}; if(myBarTable->GetScale() == VTK_SCALE_LOG10) VISU_LookupTable::ComputeLogRange(aRange,aScalarRange); myMapperTable->SetRange(aScalarRange); @@ -259,13 +259,13 @@ VISU_ScalarMapPL //---------------------------------------------------------------------------- void VISU_ScalarMapPL -::SetMapScale(float theMapScale) +::SetMapScale(vtkFloatingPointType theMapScale) { myMapperTable->SetMapScale(theMapScale); myMapperTable->Build(); } -float +vtkFloatingPointType VISU_ScalarMapPL::GetMapScale() { return myMapperTable->GetMapScale(); @@ -275,7 +275,7 @@ VISU_ScalarMapPL::GetMapScale() //---------------------------------------------------------------------------- void VISU_ScalarMapPL -::GetSourceRange(float theRange[2]) +::GetSourceRange(vtkFloatingPointType theRange[2]) { myExtractor->Update(); myExtractor->GetOutput()->GetScalarRange(theRange); @@ -285,7 +285,7 @@ void VISU_ScalarMapPL ::SetSourceRange() { - float aRange[2]; + vtkFloatingPointType aRange[2]; GetSourceRange(aRange); SetScalarRange(aRange); } diff --git a/src/PIPELINE/VISU_ScalarMapPL.hxx b/src/PIPELINE/VISU_ScalarMapPL.hxx index 1d810fb9..526b2dae 100644 --- a/src/PIPELINE/VISU_ScalarMapPL.hxx +++ b/src/PIPELINE/VISU_ScalarMapPL.hxx @@ -77,20 +77,20 @@ public: SetScaling(int theScaling = VTK_SCALE_LINEAR); virtual - float* + vtkFloatingPointType* GetScalarRange(); virtual void - SetScalarRange(float theRange[2]); + SetScalarRange(vtkFloatingPointType theRange[2]); virtual void - SetScalarMin(float theValue); + SetScalarMin(vtkFloatingPointType theValue); virtual void - SetScalarMax(float theValue); + SetScalarMax(vtkFloatingPointType theValue); virtual void @@ -124,15 +124,15 @@ public: virtual void - SetMapScale(float theMapScale = 1.0); + SetMapScale(vtkFloatingPointType theMapScale = 1.0); virtual - float + vtkFloatingPointType GetMapScale(); virtual void - GetSourceRange(float theRange[2]); + GetSourceRange(vtkFloatingPointType theRange[2]); virtual void diff --git a/src/PIPELINE/VISU_SphereWidget.cxx b/src/PIPELINE/VISU_SphereWidget.cxx index 2134aeb7..82c8e8e8 100755 --- a/src/PIPELINE/VISU_SphereWidget.cxx +++ b/src/PIPELINE/VISU_SphereWidget.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 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/ +// #include "VISU_SphereWidget.hxx" #include @@ -43,7 +62,7 @@ VISU_SphereWidget::VISU_SphereWidget() mySphereActor->SetMapper(mySphereMapper); // // Define the point coordinates - float bounds[6]; + vtkFloatingPointType bounds[6]; for(int i = 0; i < 6; i += 2){ bounds[i]=-.5; bounds[i+1]=-bounds[i]; @@ -126,7 +145,7 @@ int VISU_SphereWidget::GetPhiResolution() // function: SetRadius // purpose : //==================================================================== -void VISU_SphereWidget::SetRadius(float theRadius) +void VISU_SphereWidget::SetRadius(vtkFloatingPointType theRadius) { if ( theRadius <= myRmin ) { theRadius = myRmin; @@ -138,7 +157,7 @@ void VISU_SphereWidget::SetRadius(float theRadius) // function: GetRadius // purpose : //==================================================================== -float VISU_SphereWidget::GetRadius() +vtkFloatingPointType VISU_SphereWidget::GetRadius() { return mySphereSource->GetRadius(); } @@ -146,7 +165,7 @@ float VISU_SphereWidget::GetRadius() // function: SetCenter // purpose : //==================================================================== -void VISU_SphereWidget::SetCenter(float theCenter[3]) +void VISU_SphereWidget::SetCenter(vtkFloatingPointType theCenter[3]) { mySphereSource->SetCenter(theCenter); mySphere->SetCenter(theCenter); @@ -155,9 +174,9 @@ void VISU_SphereWidget::SetCenter(float theCenter[3]) // function: SetCenter // purpose : //==================================================================== -void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ) +void VISU_SphereWidget::SetCenter(vtkFloatingPointType theX, vtkFloatingPointType theY, vtkFloatingPointType theZ) { - float aCenter[3] = {theX, theY, theZ}; + vtkFloatingPointType aCenter[3] = {theX, theY, theZ}; SetCenter(aCenter); } @@ -165,7 +184,7 @@ void VISU_SphereWidget::SetCenter(float theX, float theY, float theZ) // function: GetCenter // purpose : //==================================================================== -float* VISU_SphereWidget::GetCenter() +vtkFloatingPointType* VISU_SphereWidget::GetCenter() { return mySphereSource->GetCenter(); } @@ -173,7 +192,7 @@ float* VISU_SphereWidget::GetCenter() // function: GetCenter // purpose : //==================================================================== -void VISU_SphereWidget::GetCenter(float theCenter[3]) +void VISU_SphereWidget::GetCenter(vtkFloatingPointType theCenter[3]) { mySphereSource->GetCenter(theCenter); } @@ -469,7 +488,7 @@ void VISU_SphereWidget::OnMiddleButtonUp() //==================================================================== void VISU_SphereWidget::Translate(double *p1, double *p2) { - float v[3], aC[3], aC1[3]; + vtkFloatingPointType v[3], aC[3], aC1[3]; // v[0] = p2[0] - p1[0]; v[1] = p2[1] - p1[1]; @@ -495,7 +514,7 @@ void VISU_SphereWidget::Scale(double *p1, double *p2, v[1] = p2[1] - p1[1]; v[2] = p2[2] - p1[2]; // - float aC[3], aR, sf, aR1; + vtkFloatingPointType aC[3], aR, sf, aR1; aR=mySphereSource->GetRadius(); mySphereSource->GetCenter(aC); sf=vtkMath::Norm(v)/aR; @@ -561,12 +580,12 @@ void VISU_SphereWidget::CreateDefaultProperties() // function:PlaceWidget // purpose: //==================================================================== -void VISU_SphereWidget::PlaceWidget(float bds[6]) +void VISU_SphereWidget::PlaceWidget(vtkFloatingPointType bds[6]) { - float bounds[6], center[3], radius; + vtkFloatingPointType bounds[6], center[3], radius; this->AdjustBounds(bds, bounds, center); - float dX, dY, dZ; + vtkFloatingPointType dX, dY, dZ; // dX=bounds[1]-bounds[0]; dY=bounds[3]-bounds[2]; @@ -591,7 +610,7 @@ void VISU_SphereWidget::PlaceWidget(float bds[6]) (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) + (bounds[5]-bounds[4])*(bounds[5]-bounds[4])); - static float EPS = 1.0E-1; + static vtkFloatingPointType EPS = 1.0E-1; myRmin = EPS*InitialLength; } diff --git a/src/PIPELINE/VISU_SphereWidget.hxx b/src/PIPELINE/VISU_SphereWidget.hxx index 040a4180..6dcba37f 100755 --- a/src/PIPELINE/VISU_SphereWidget.hxx +++ b/src/PIPELINE/VISU_SphereWidget.hxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 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/ +// #ifndef __VISU_SphereWidget_h #define __VISU_SphereWidget_h @@ -33,7 +52,7 @@ public: virtual void SetEnabled(int); // //PlaceWidget - virtual void PlaceWidget(float bounds[6]); + virtual void PlaceWidget(vtkFloatingPointType bounds[6]); // // Description: // Set/Get the resolution of the sphere in the Theta direction. @@ -46,22 +65,24 @@ public: // Description: // Set/Get the radius of sphere. Default is .5. - void SetRadius(float r); - float GetRadius(); + void SetRadius(vtkFloatingPointType r); + vtkFloatingPointType GetRadius(); // Description: // Set/Get the center of the sphere. - void SetCenter(float x, float y, float z); - void SetCenter(float x[3]); + void SetCenter(vtkFloatingPointType x, + vtkFloatingPointType y, + vtkFloatingPointType z); + void SetCenter(vtkFloatingPointType x[3]); - float* GetCenter(); - void GetCenter(float xyz[3]); + vtkFloatingPointType* GetCenter(); + void GetCenter(vtkFloatingPointType xyz[3]); // Description: // Set the ratio of the radius changing. - void SetRatio(float r) { myRatio = r; } - float GetRatio() { return myRatio; } + void SetRatio(vtkFloatingPointType r) { myRatio = r; } + vtkFloatingPointType GetRatio() { return myRatio; } void ChangeRadius(bool up); @@ -122,10 +143,10 @@ protected: // the manipulator in general. vtkProperty *mySphereProperty; vtkProperty *mySelectedSphereProperty; - float myRmin; + vtkFloatingPointType myRmin; vtkSphere *mySphere; vtkImplicitSum* myImplicitSum; - float myRatio; + vtkFloatingPointType myRatio; private: VISU_SphereWidget(const VISU_SphereWidget&); //Not implemented void operator=(const VISU_SphereWidget&); //Not implemented diff --git a/src/PIPELINE/VISU_StreamLinesPL.cxx b/src/PIPELINE/VISU_StreamLinesPL.cxx index 509074a9..834db9de 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.cxx +++ b/src/PIPELINE/VISU_StreamLinesPL.cxx @@ -42,10 +42,10 @@ static int MYDEBUG = 0; static int MYDEBUG = 0; #endif -static float EPS = 1.0e-7; -static float aMinNbOfSteps = 1.0E+2; -//static float aMaxNbOfSteps = 1.0E+3; -static float aCoeffOfIntStep = 1.0E+1; +static vtkFloatingPointType EPS = 1.0e-7; +static vtkFloatingPointType aMinNbOfSteps = 1.0E+2; +//static vtkFloatingPointType aMaxNbOfSteps = 1.0E+3; +static vtkFloatingPointType aCoeffOfIntStep = 1.0E+1; vtkStandardNewMacro(VISU_StreamLinesPL); @@ -86,49 +86,57 @@ void VISU_StreamLinesPL::ShallowCopy(VISU_PipeLine *thePipeLine){ } -float VISU_StreamLinesPL::GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, - float thePropogationTime, float thePercents) +vtkFloatingPointType +VISU_StreamLinesPL +::GetNecasseryMemorySize(vtkIdType theNbOfPoints, + vtkFloatingPointType theStepLength, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType thePercents) { - static float aStreamPointSize = sizeof(float)*15 + sizeof(vtkIdType)*2; - static float aStreamArraySize = aStreamPointSize*1024; // == 69632 + static vtkFloatingPointType aStreamPointSize = sizeof(vtkFloatingPointType)*15 + sizeof(vtkIdType)*2; + static vtkFloatingPointType aStreamArraySize = aStreamPointSize*1024; // == 69632 - float aNbCells = thePercents*theNbOfPoints*2.0; - float aNbPointsPerCell = thePropogationTime/theStepLength; - float aCellsSize = aNbCells*(1+aNbPointsPerCell); - float aPointsSize = aCellsSize*3.0*sizeof(float); + vtkFloatingPointType aNbCells = thePercents*theNbOfPoints*2.0; + vtkFloatingPointType aNbPointsPerCell = thePropogationTime/theStepLength; + vtkFloatingPointType aCellsSize = aNbCells*(1+aNbPointsPerCell); + vtkFloatingPointType aPointsSize = aCellsSize*3.0*sizeof(vtkFloatingPointType); - float aConnectivitySize = aCellsSize*sizeof(vtkIdType); - float aTypesSize = aNbCells*sizeof(char); - float aLocationsSize = aNbCells*sizeof(int); - //float aNbCellsPerPoint = aCellsSize / aNbCells - 1; - float aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize; + vtkFloatingPointType aConnectivitySize = aCellsSize*sizeof(vtkIdType); + vtkFloatingPointType aTypesSize = aNbCells*sizeof(char); + vtkFloatingPointType aLocationsSize = aNbCells*sizeof(int); + //vtkFloatingPointType aNbCellsPerPoint = aCellsSize / aNbCells - 1; + vtkFloatingPointType aMeshSize = aPointsSize + aConnectivitySize + aTypesSize + aLocationsSize; - float anAssignedDataSize = aCellsSize*4.0*sizeof(float); - float anOutputDataSetSize = aMeshSize + anAssignedDataSize; + vtkFloatingPointType anAssignedDataSize = aCellsSize*4.0*sizeof(vtkFloatingPointType); + vtkFloatingPointType anOutputDataSetSize = aMeshSize + anAssignedDataSize; - float aResult = aStreamArraySize*aNbCells + anOutputDataSetSize; + vtkFloatingPointType aResult = aStreamArraySize*aNbCells + anOutputDataSetSize; return aResult; } -int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, - float& thePropogationTime, float& thePercents) +int +VISU_StreamLinesPL +::FindPossibleParams(vtkPointSet* theDataSet, + vtkFloatingPointType& theStepLength, + vtkFloatingPointType& thePropogationTime, + vtkFloatingPointType& thePercents) { - static float aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0; + static vtkFloatingPointType aPercentsDecrease = 3.0, aStepLengthIncrease = 9.0; vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints(); - float aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents); + vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,theStepLength,thePropogationTime,thePercents); int isPoss = CheckAvailableMemory(aSize); if(!isPoss){ - float aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime); - float aMinStepLength = GetMinStepLength(theDataSet); - float aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease; + vtkFloatingPointType aMaxStepLength = max(GetMaxStepLength(theDataSet),thePropogationTime); + vtkFloatingPointType aMinStepLength = GetMinStepLength(theDataSet); + vtkFloatingPointType aDeltaStepLength = (aMaxStepLength - aMinStepLength)/aStepLengthIncrease; for(int i = 2, aStepChanged = 1, aPerecentsChanged = 1; aStepChanged || aPerecentsChanged; i++){ - float aStepLength = theStepLength + aDeltaStepLength; + vtkFloatingPointType aStepLength = theStepLength + aDeltaStepLength; if(aStepLength < aMaxStepLength) theStepLength = aStepLength; else if(aStepChanged){ aStepLength = aMaxStepLength; aStepChanged = 0; } - float aPercents = thePercents /= aPercentsDecrease; + vtkFloatingPointType aPercents = thePercents /= aPercentsDecrease; if(aPercents*aNbOfPoints > 1) thePercents = aPercents; else if(aPerecentsChanged) { thePercents = 1.1 / aNbOfPoints; @@ -146,13 +154,15 @@ int VISU_StreamLinesPL::FindPossibleParams(vtkPointSet* theDataSet, float& theSt } -int VISU_StreamLinesPL::SetParams(float theIntStep, - float thePropogationTime, - float theStepLength, - vtkPointSet* theSource, - float thePercents, - int theDirection, - int isOnlyTry) +int +VISU_StreamLinesPL +::SetParams(vtkFloatingPointType theIntStep, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType theStepLength, + vtkPointSet* theSource, + vtkFloatingPointType thePercents, + int theDirection, + int isOnlyTry) { vtkPointSet* aDataSet = theSource? theSource: myFieldTransform->GetUnstructuredGridOutput(); aDataSet->Update(); @@ -187,31 +197,50 @@ int VISU_StreamLinesPL::SetParams(float theIntStep, } -vtkPointSet* VISU_StreamLinesPL::GetSource() { +vtkPointSet* +VISU_StreamLinesPL +::GetSource() +{ return mySource; } -float VISU_StreamLinesPL::GetUsedPoints() { +vtkFloatingPointType +VISU_StreamLinesPL +::GetUsedPoints() +{ return myPercents; } -vtkDataSet* VISU_StreamLinesPL::GetStreamerSource(){ +vtkDataSet* +VISU_StreamLinesPL +::GetStreamerSource() +{ return myStream->GetSource(); } -float VISU_StreamLinesPL::GetVelocityCoeff(){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetVelocityCoeff() +{ return GetVelocityCoeff(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetVelocityCoeff(vtkPointSet* theDataSet){ - float* aScalarRange = theDataSet->GetScalarRange(); +vtkFloatingPointType +VISU_StreamLinesPL +::GetVelocityCoeff(vtkPointSet* theDataSet) +{ + vtkFloatingPointType* aScalarRange = theDataSet->GetScalarRange(); return (fabs(aScalarRange[1]) + fabs(aScalarRange[0]))/2.0; } -int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){ - float aStepLength = GetBaseStepLength(theDataSet); - float aBasePropTime = GetBasePropagationTime(theDataSet); +int +VISU_StreamLinesPL +::IsPossible(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents) +{ + vtkFloatingPointType aStepLength = GetBaseStepLength(theDataSet); + vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet); VISU_UsedPointsFilter *aPointsFilter = VISU_UsedPointsFilter::New(); aPointsFilter->SetInput(theDataSet); vtkPointSet* aDataSet = aPointsFilter->GetOutput(); @@ -223,71 +252,105 @@ int VISU_StreamLinesPL::IsPossible(vtkPointSet* theDataSet, float thePercents){ } -float VISU_StreamLinesPL::GetIntegrationStep(){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetIntegrationStep() +{ return myStream->GetIntegrationStepLength(); } -float VISU_StreamLinesPL::GetStepLength() { + +vtkFloatingPointType +VISU_StreamLinesPL +::GetStepLength() +{ return myStream->GetStepLength(); } -float VISU_StreamLinesPL::GetPropagationTime() { + +vtkFloatingPointType +VISU_StreamLinesPL +::GetPropagationTime() +{ return myStream->GetMaximumPropagationTime(); } -int VISU_StreamLinesPL::GetDirection(){ + +int +VISU_StreamLinesPL +::GetDirection() +{ return myStream->GetIntegrationDirection(); } -float VISU_StreamLinesPL::GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents) { +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinIntegrationStep(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents) +{ if(!theDataSet) return -1.0; - float aVolume = 1.0; + vtkFloatingPointType aVolume = 1.0; int degree = 0; theDataSet->Update(); - float* aBounds = theDataSet->GetBounds(); + vtkFloatingPointType* aBounds = theDataSet->GetBounds(); for(int i = 0, j = 0; i < 3; ++i, j = 2*i){ - float tmp = aBounds[j+1] - aBounds[j]; + vtkFloatingPointType tmp = aBounds[j+1] - aBounds[j]; if (tmp > EPS ) { aVolume *= tmp; degree += 1; } } if (degree < 1) return 0.0; // absolutely empty object - float anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep; - float aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet); + vtkFloatingPointType anStepLength = GetMaxIntegrationStep(theDataSet)/aCoeffOfIntStep; + vtkFloatingPointType aBasePropTime = GetBasePropagationTime(theDataSet)/GetVelocityCoeff(theDataSet); thePercents = 1.0; vtkIdType aNbOfPoints = theDataSet->GetNumberOfPoints(); - float aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents); - float aRealSize = GetAvailableMemory(aSize); - float anAverageVolume = aVolume / aRealSize; - float aStep = pow(double(anAverageVolume), double(1.0/double(degree))); + vtkFloatingPointType aSize = GetNecasseryMemorySize(aNbOfPoints,anStepLength,aBasePropTime,thePercents); + vtkFloatingPointType aRealSize = GetAvailableMemory(aSize); + vtkFloatingPointType anAverageVolume = aVolume / aRealSize; + vtkFloatingPointType aStep = pow(double(anAverageVolume), double(1.0/double(degree))); return aStep; } -float VISU_StreamLinesPL::GetMinIntegrationStep(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinIntegrationStep() +{ return GetMinIntegrationStep(myExtractor->GetOutput(),GetUsedPoints()); } -float VISU_StreamLinesPL::GetMaxIntegrationStep(vtkPointSet* theDataSet) { +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxIntegrationStep(vtkPointSet* theDataSet) +{ if(!theDataSet) return -1.0; theDataSet->Update(); - float aLength = theDataSet->GetLength(); - float* aBounds = theDataSet->GetBounds(); - float aMaxSizeY = (aBounds[3]-aBounds[2])/aLength; - float aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength; - float aMinMax = (aBounds[1] - aBounds[0])/aLength; + vtkFloatingPointType aLength = theDataSet->GetLength(); + vtkFloatingPointType* aBounds = theDataSet->GetBounds(); + vtkFloatingPointType aMaxSizeY = (aBounds[3]-aBounds[2])/aLength; + vtkFloatingPointType aMaxSizeZ = (aBounds[5]-aBounds[4])/aLength; + vtkFloatingPointType aMinMax = (aBounds[1] - aBounds[0])/aLength; if (aMinMax < EPS || (aMaxSizeY < aMinMax && aMaxSizeY > EPS)) aMinMax = aMaxSizeY; if (aMinMax < EPS || (aMaxSizeZ < aMinMax && aMaxSizeZ > EPS)) aMinMax = aMaxSizeZ; return aMinMax*aLength/2.0; } -float VISU_StreamLinesPL::GetMaxIntegrationStep(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxIntegrationStep() +{ return GetMaxIntegrationStep(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetBaseIntegrationStep(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents) +{ theDataSet->Update(); - float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents); - float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); - float anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep; - float aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints(); + vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents); + vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); + vtkFloatingPointType anIntegrationStep = aMaxIntegrationStep / aCoeffOfIntStep; + vtkFloatingPointType aMinMax = theDataSet->GetLength()/theDataSet->GetNumberOfPoints(); if(aMinMax > anIntegrationStep) anIntegrationStep = (anIntegrationStep*aCoeffOfIntStep*0.9+aMinMax)/aCoeffOfIntStep; if(aMinIntegrationStep > anIntegrationStep) @@ -295,10 +358,15 @@ float VISU_StreamLinesPL::GetBaseIntegrationStep(vtkPointSet* theDataSet, float return anIntegrationStep; } -float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents){ +vtkFloatingPointType +VISU_StreamLinesPL +::CorrectIntegrationStep(vtkFloatingPointType theStep, + vtkPointSet* theDataSet, + vtkFloatingPointType thePercents) +{ theDataSet->Update(); - float aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents); - float aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); + vtkFloatingPointType aMinIntegrationStep = GetMinIntegrationStep(theDataSet,thePercents); + vtkFloatingPointType aMaxIntegrationStep = GetMaxIntegrationStep(theDataSet); if(aMinIntegrationStep > theStep) theStep = aMinIntegrationStep; if(aMaxIntegrationStep < theStep) @@ -307,99 +375,156 @@ float VISU_StreamLinesPL::CorrectIntegrationStep(float theStep, vtkPointSet* the } -float VISU_StreamLinesPL::GetMinPropagationTime(vtkPointSet* theDataSet){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinPropagationTime(vtkPointSet* theDataSet) +{ if(!theDataSet) return -1.0; return GetMinStepLength(theDataSet); } -float VISU_StreamLinesPL::GetMinPropagationTime(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinPropagationTime() +{ return GetMinPropagationTime(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetMaxPropagationTime(vtkPointSet* theDataSet){ +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxPropagationTime(vtkPointSet* theDataSet) +{ if(!theDataSet) return -1.0; return GetBasePropagationTime(theDataSet)*aMinNbOfSteps; } -float VISU_StreamLinesPL::GetMaxPropagationTime(){ + +vtkFloatingPointType VISU_StreamLinesPL::GetMaxPropagationTime(){ return GetMaxPropagationTime(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet){ - float aMinPropagationTime = GetMinPropagationTime(theDataSet); - float aMaxPropagationTime = GetMaxPropagationTime(theDataSet); +vtkFloatingPointType +VISU_StreamLinesPL +::CorrectPropagationTime(vtkFloatingPointType thePropagationTime, + vtkPointSet* theDataSet) +{ + vtkFloatingPointType aMinPropagationTime = GetMinPropagationTime(theDataSet); + vtkFloatingPointType aMaxPropagationTime = GetMaxPropagationTime(theDataSet); if(aMinPropagationTime > thePropagationTime) thePropagationTime = aMinPropagationTime; if(aMaxPropagationTime < thePropagationTime) thePropagationTime = aMaxPropagationTime; return thePropagationTime; } -float VISU_StreamLinesPL::GetBasePropagationTime(vtkPointSet* theDataSet){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetBasePropagationTime(vtkPointSet* theDataSet) +{ if(!theDataSet) return -1.0; theDataSet->Update(); - float aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet); + vtkFloatingPointType aPropagationTime = theDataSet->GetLength()/GetVelocityCoeff(theDataSet); return aPropagationTime; } -float VISU_StreamLinesPL::GetBasePropagationTime(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetBasePropagationTime() +{ return GetBasePropagationTime(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetMinStepLength(vtkPointSet* theDataSet){ - static float aNbOfStepsOfIntStep = 1.0E+1; - float anIntStep = GetMinIntegrationStep(theDataSet); - float aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet); +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinStepLength(vtkPointSet* theDataSet) +{ + static vtkFloatingPointType aNbOfStepsOfIntStep = 1.0E+1; + vtkFloatingPointType anIntStep = GetMinIntegrationStep(theDataSet); + vtkFloatingPointType aStepLength = anIntStep*aNbOfStepsOfIntStep/GetVelocityCoeff(theDataSet); return aStepLength; } -float VISU_StreamLinesPL::GetMinStepLength(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMinStepLength() +{ return GetMinStepLength(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::GetMaxStepLength(vtkPointSet* theDataSet){ - float aStepLength = GetBasePropagationTime(theDataSet); +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxStepLength(vtkPointSet* theDataSet) +{ + vtkFloatingPointType aStepLength = GetBasePropagationTime(theDataSet); return aStepLength; } -float VISU_StreamLinesPL::GetMaxStepLength(){ + +vtkFloatingPointType +VISU_StreamLinesPL +::GetMaxStepLength() +{ return GetMaxStepLength(myExtractor->GetOutput()); } -float VISU_StreamLinesPL::CorrectStepLength(float theStep, vtkPointSet* theDataSet){ - float aMinStep = GetMinStepLength(theDataSet); +vtkFloatingPointType +VISU_StreamLinesPL +::CorrectStepLength(vtkFloatingPointType theStep, + vtkPointSet* theDataSet) +{ + vtkFloatingPointType aMinStep = GetMinStepLength(theDataSet); if(theStep < aMinStep) theStep = aMinStep; - float aMaxStep = GetMaxStepLength(theDataSet); + vtkFloatingPointType aMaxStep = GetMaxStepLength(theDataSet); if(theStep > aMaxStep) theStep = aMaxStep; return theStep; } -float VISU_StreamLinesPL::GetBaseStepLength(vtkPointSet* theDataSet){ - static float anAvgNbOfSteps = 1.0E+2; - float aPropagationTime = GetBasePropagationTime(theDataSet); - float aStepLength = aPropagationTime/anAvgNbOfSteps; + +vtkFloatingPointType +VISU_StreamLinesPL +::GetBaseStepLength(vtkPointSet* theDataSet) +{ + static vtkFloatingPointType anAvgNbOfSteps = 1.0E+2; + vtkFloatingPointType aPropagationTime = GetBasePropagationTime(theDataSet); + vtkFloatingPointType aStepLength = aPropagationTime/anAvgNbOfSteps; aStepLength = CorrectStepLength(aStepLength,theDataSet); return aStepLength; } -void VISU_StreamLinesPL::Init(){ +void +VISU_StreamLinesPL +::Init() +{ VISU_ScalarMapPL::Init(); vtkPointSet* aDataSet = myExtractor->GetOutput(); - float anIntStep = GetBaseIntegrationStep(aDataSet); - float aPropagationTime = GetBasePropagationTime(aDataSet); - float aStepLength = GetBaseStepLength(aDataSet); + vtkFloatingPointType anIntStep = GetBaseIntegrationStep(aDataSet); + vtkFloatingPointType aPropagationTime = GetBasePropagationTime(aDataSet); + vtkFloatingPointType aStepLength = GetBaseStepLength(aDataSet); SetParams(anIntStep,aPropagationTime,aStepLength); } -VISU_ScalarMapPL::THook* VISU_StreamLinesPL::DoHook(){ +VISU_ScalarMapPL::THook* +VISU_StreamLinesPL +::DoHook() +{ GetInput2()->Update(); VISU::CellDataToPoint(myStream,myCellDataToPointData,GetInput2(),myFieldTransform); - float *aBounds = GetInput2()->GetBounds(); + vtkFloatingPointType *aBounds = GetInput2()->GetBounds(); myGeomFilter->SetExtent(aBounds); myGeomFilter->ExtentClippingOn(); myGeomFilter->SetInput(myStream->GetOutput()); return myGeomFilter->GetOutput(); } -void VISU_StreamLinesPL::Update(){ +void +VISU_StreamLinesPL +::Update() +{ VISU_ScalarMapPL::Update(); } -void VISU_StreamLinesPL::SetMapScale(float theMapScale){ +void +VISU_StreamLinesPL +::SetMapScale(vtkFloatingPointType theMapScale) +{ VISU_ScalarMapPL::SetMapScale(theMapScale); } diff --git a/src/PIPELINE/VISU_StreamLinesPL.hxx b/src/PIPELINE/VISU_StreamLinesPL.hxx index b360f974..448c63ca 100644 --- a/src/PIPELINE/VISU_StreamLinesPL.hxx +++ b/src/PIPELINE/VISU_StreamLinesPL.hxx @@ -37,82 +37,197 @@ class vtkCellCenters; class VTKViewer_GeometryFilter; class VISU_UsedPointsFilter; -class VISU_StreamLinesPL : public VISU_DeformedShapePL{ +class VISU_StreamLinesPL : public VISU_DeformedShapePL +{ protected: VISU_StreamLinesPL(); VISU_StreamLinesPL(const VISU_StreamLinesPL&); + + virtual + ~VISU_StreamLinesPL(); + public: vtkTypeMacro(VISU_StreamLinesPL,VISU_DeformedShapePL); - static VISU_StreamLinesPL* New(); - virtual ~VISU_StreamLinesPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - - virtual int SetParams(float theIntStep, - float thePropogationTime, - float theStepLength, - vtkPointSet* theSource = NULL, - float thePercents = 0.3, - int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS, - int isOnlyTry = false); - virtual vtkPointSet* GetSource(); - virtual float GetUsedPoints(); - virtual float GetIntegrationStep(); - virtual float GetPropagationTime(); - virtual float GetStepLength(); - virtual int GetDirection(); - - virtual vtkDataSet* GetStreamerSource(); - virtual float GetVelocityCoeff(); - - virtual float GetMaxIntegrationStep(); - virtual float GetMinIntegrationStep(); - - virtual float GetMinStepLength(); - virtual float GetMaxStepLength(); - - virtual float GetMinPropagationTime(); - virtual float GetMaxPropagationTime(); - virtual float GetBasePropagationTime(); + + static + VISU_StreamLinesPL* + New(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + int + SetParams(vtkFloatingPointType theIntStep, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType theStepLength, + vtkPointSet* theSource = NULL, + vtkFloatingPointType thePercents = 0.3, + int theDirection = VTK_INTEGRATE_BOTH_DIRECTIONS, + int isOnlyTry = false); + + virtual + vtkPointSet* + GetSource(); + + virtual + vtkFloatingPointType + GetUsedPoints(); + + virtual + vtkFloatingPointType + GetIntegrationStep(); + + virtual + vtkFloatingPointType + GetPropagationTime(); + + virtual + vtkFloatingPointType + GetStepLength(); + + virtual + int + GetDirection(); + + virtual + vtkDataSet* + GetStreamerSource(); + + virtual + vtkFloatingPointType + GetVelocityCoeff(); + + virtual + vtkFloatingPointType + GetMaxIntegrationStep(); + + virtual + vtkFloatingPointType + GetMinIntegrationStep(); + + virtual + vtkFloatingPointType + GetMinStepLength(); + + virtual + vtkFloatingPointType + GetMaxStepLength(); + + virtual + vtkFloatingPointType + GetMinPropagationTime(); + + virtual + vtkFloatingPointType + GetMaxPropagationTime(); + + virtual + vtkFloatingPointType + GetBasePropagationTime(); public: - virtual THook* DoHook(); - virtual void Init(); - virtual void Update(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual + THook* + DoHook(); + + virtual + void + Init(); + + virtual + void + Update(); + + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); public: - static float GetMaxIntegrationStep(vtkPointSet* theDataSet); - static float GetMinIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3); - static float GetBaseIntegrationStep(vtkPointSet* theDataSet, float thePercents = 0.3); + static + vtkFloatingPointType + GetMaxIntegrationStep(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetMinIntegrationStep(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); + static + vtkFloatingPointType + GetBaseIntegrationStep(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); - static float GetMinPropagationTime(vtkPointSet* theDataSet); - static float GetMaxPropagationTime(vtkPointSet* theDataSet); - static float GetBasePropagationTime(vtkPointSet* theDataSet); + static + vtkFloatingPointType + GetMinPropagationTime(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetMaxPropagationTime(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetBasePropagationTime(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetMinStepLength(vtkPointSet* theDataSet); + + static + vtkFloatingPointType + GetMaxStepLength(vtkPointSet* theDataSet); - static float GetMinStepLength(vtkPointSet* theDataSet); - static float GetMaxStepLength(vtkPointSet* theDataSet); - static float GetBaseStepLength(vtkPointSet* theDataSet); + static + vtkFloatingPointType + GetBaseStepLength(vtkPointSet* theDataSet); - static float GetVelocityCoeff(vtkPointSet* theDataSet); + static + vtkFloatingPointType + GetVelocityCoeff(vtkPointSet* theDataSet); - static int IsPossible(vtkPointSet* theDataSet, float thePercents = 0.3); + static + int + IsPossible(vtkPointSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); protected: - static float GetNecasseryMemorySize(vtkIdType theNbOfPoints, float theStepLength, - float thePropogationTime, float thePercents = 0.3); - static int FindPossibleParams(vtkPointSet* theDataSet, float& theStepLength, - float& thePropogationTime, float& thePercents); + static + vtkFloatingPointType + GetNecasseryMemorySize(vtkIdType theNbOfPoints, + vtkFloatingPointType theStepLength, + vtkFloatingPointType thePropogationTime, + vtkFloatingPointType thePercents = 0.3); + + static + int + FindPossibleParams(vtkPointSet* theDataSet, + vtkFloatingPointType& theStepLength, + vtkFloatingPointType& thePropogationTime, + vtkFloatingPointType& thePercents); - static float CorrectIntegrationStep(float theStep, vtkPointSet* theDataSet, float thePercents = 0.3); - static float CorrectPropagationTime(float thePropagationTime, vtkPointSet* theDataSet); - static float CorrectStepLength(float theStep, vtkPointSet* theDataSet); + static + vtkFloatingPointType + CorrectIntegrationStep(vtkFloatingPointType theStep, + vtkPointSet* theDataSet, + vtkFloatingPointType thePercents = 0.3); + + static + vtkFloatingPointType + CorrectPropagationTime(vtkFloatingPointType thePropagationTime, + vtkPointSet* theDataSet); + + static + vtkFloatingPointType + CorrectStepLength(vtkFloatingPointType theStep, + vtkPointSet* theDataSet); vtkStreamLine* myStream; vtkPointSet* mySource; vtkCellCenters* myCenters; VTKViewer_GeometryFilter *myGeomFilter; VISU_UsedPointsFilter *myPointsFilter; - float myPercents; + vtkFloatingPointType myPercents; }; diff --git a/src/PIPELINE/VISU_VectorsPL.cxx b/src/PIPELINE/VISU_VectorsPL.cxx index 92a5e575..d37324f6 100644 --- a/src/PIPELINE/VISU_VectorsPL.cxx +++ b/src/PIPELINE/VISU_VectorsPL.cxx @@ -101,7 +101,7 @@ VISU_VectorsPL void VISU_VectorsPL -::SetScale(float theScale) +::SetScale(vtkFloatingPointType theScale) { if(myScaleFactor == theScale) return; @@ -114,7 +114,7 @@ VISU_VectorsPL Modified(); } -float +vtkFloatingPointType VISU_VectorsPL ::GetScale() { @@ -219,7 +219,7 @@ VISU_VectorsPL void VISU_VectorsPL -::SetMapScale(float theMapScale) +::SetMapScale(vtkFloatingPointType theMapScale) { VISU_ScalarMapPL::SetMapScale(theMapScale); diff --git a/src/PIPELINE/VISU_VectorsPL.hxx b/src/PIPELINE/VISU_VectorsPL.hxx index 312d56fc..9f3e6db4 100644 --- a/src/PIPELINE/VISU_VectorsPL.hxx +++ b/src/PIPELINE/VISU_VectorsPL.hxx @@ -39,41 +39,94 @@ class vtkLineSource; class vtkGlyph3D; -class VISU_VectorsPL : public VISU_DeformedShapePL{ +class VISU_VectorsPL : public VISU_DeformedShapePL +{ protected: VISU_VectorsPL(); VISU_VectorsPL(const VISU_VectorsPL&); + + virtual + ~VISU_VectorsPL(); + public: vtkTypeMacro(VISU_VectorsPL,VISU_DeformedShapePL); - static VISU_VectorsPL* New(); - virtual ~VISU_VectorsPL(); - virtual void ShallowCopy(VISU_PipeLine *thePipeLine); - virtual void SetScale(float theScale); - virtual float GetScale(); + static + VISU_VectorsPL* + New(); + + virtual + void + ShallowCopy(VISU_PipeLine *thePipeLine); + + virtual + void + SetScale(vtkFloatingPointType theScale); + + virtual + vtkFloatingPointType + GetScale(); enum GlyphType{ ARROW, CONE2, CONE6, NONE}; - virtual void SetGlyphType(GlyphType theType) { myTypeGlyph = theType;} - virtual GlyphType GetGlyphType() { return myTypeGlyph;} + + virtual + void + SetGlyphType(GlyphType theType) + { + myTypeGlyph = theType; + } + + virtual + GlyphType + GetGlyphType() + { + return myTypeGlyph; + } enum GlyphPos{ CENTER, TAIL,HEAD}; - virtual void SetGlyphPos(GlyphPos thePos) { myPosGlyph = thePos;} - virtual GlyphPos GetGlyphPos() { return myPosGlyph;} + + virtual + void + SetGlyphPos(GlyphPos thePos) + { + myPosGlyph = thePos; + } + + virtual + GlyphPos + GetGlyphPos() + { + return myPosGlyph; + } public: - virtual void Init(); - virtual void Update(); + virtual + void + Init(); + + virtual + void + Update(); vtkDataSet* GetOutput(); - virtual void SetTransform(VTKViewer_Transform* theTransform); - virtual VTKViewer_Transform* GetTransform(); + virtual + void + SetTransform(VTKViewer_Transform* theTransform); + + virtual + VTKViewer_Transform* + GetTransform(); - virtual void SetMapScale(float theMapScale = 1.0); + virtual + void + SetMapScale(vtkFloatingPointType theMapScale = 1.0); protected: - virtual THook* DoHook(); + virtual + THook* + DoHook(); GlyphType myTypeGlyph; GlyphPos myPosGlyph; diff --git a/src/PIPELINE/VISU_WidgetCtrl.cxx b/src/PIPELINE/VISU_WidgetCtrl.cxx index bb62dc63..3e970a52 100644 --- a/src/PIPELINE/VISU_WidgetCtrl.cxx +++ b/src/PIPELINE/VISU_WidgetCtrl.cxx @@ -268,7 +268,7 @@ VISU_SphereWidget* VISU_WidgetCtrl::GetSphereWidget() // function: PlaceWidget // purpose : //================================================================== -void VISU_WidgetCtrl::PlaceWidget(float theBounds[6]) +void VISU_WidgetCtrl::PlaceWidget(vtkFloatingPointType theBounds[6]) { for (int i=0; iPlaceWidget(theBounds); @@ -298,7 +298,7 @@ vtkRenderWindowInteractor* VISU_WidgetCtrl::GetInteractor() // function: SetPlaceFactor // purpose : //================================================================== -void VISU_WidgetCtrl::SetPlaceFactor(float theFactor) +void VISU_WidgetCtrl::SetPlaceFactor(vtkFloatingPointType theFactor) { for (int i=0; iSetPlaceFactor(theFactor); @@ -310,7 +310,7 @@ void VISU_WidgetCtrl::SetPlaceFactor(float theFactor) // function: GetPlaceFactor // purpose : //================================================================== -float VISU_WidgetCtrl::GetPlaceFactor() +vtkFloatingPointType VISU_WidgetCtrl::GetPlaceFactor() { return myWidgets[0]->GetPlaceFactor(); } @@ -324,9 +324,9 @@ vtkImplicitFunction* VISU_WidgetCtrl::ImplicitFunction() } //================================================================== -float +vtkFloatingPointType VISU_WidgetCtrl -::EvaluateFunction(float theX[3]) +::EvaluateFunction(vtkFloatingPointType theX[3]) { if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){ if(vtkImplicitFunction* aFunction = aWidget->ImplicitFunction()) @@ -338,7 +338,8 @@ VISU_WidgetCtrl //================================================================== void VISU_WidgetCtrl -::EvaluateGradient(float theX[3], float theG[3]) +::EvaluateGradient(vtkFloatingPointType theX[3], + vtkFloatingPointType theG[3]) { theG[0] = theG[1] = theG[2] = 0.0; if(VISU_ImplicitFunctionWidget* aWidget = GetActiveWidget()){ diff --git a/src/PIPELINE/VISU_WidgetCtrl.hxx b/src/PIPELINE/VISU_WidgetCtrl.hxx index 8737b5dc..00447923 100644 --- a/src/PIPELINE/VISU_WidgetCtrl.hxx +++ b/src/PIPELINE/VISU_WidgetCtrl.hxx @@ -29,9 +29,10 @@ #ifndef __VISU_WidgetCtrl_hxx #define __VISU_WidgetCtrl_hxx - #include +#include "VTKViewer.h" + class vtkImplicitFunction; class vtkObject; class vtkRenderWindowInteractor; @@ -51,18 +52,19 @@ public: vtkImplicitFunction* ImplicitFunction(); virtual - float - EvaluateFunction(float theX[3]); + vtkFloatingPointType + EvaluateFunction(vtkFloatingPointType theX[3]); virtual void - EvaluateGradient(float theX[3], float theG[3]); + EvaluateGradient(vtkFloatingPointType theX[3], + vtkFloatingPointType theG[3]); virtual unsigned long GetMTime(); - void PlaceWidget(float theBounds[6]); + void PlaceWidget(vtkFloatingPointType theBounds[6]); void SetEnabled(int theFlag); int GetEnabled(); void On() {SetEnabled(1);} @@ -71,8 +73,11 @@ public: void SetInteractor(vtkRenderWindowInteractor* theRWI); vtkRenderWindowInteractor* GetInteractor(); // - void SetPlaceFactor(float theFactor); - float GetPlaceFactor(); + void + SetPlaceFactor(vtkFloatingPointType theFactor); + + vtkFloatingPointType + GetPlaceFactor(); // void SetActiveIndex(const int theFlag); int GetActiveIndex()const; @@ -105,7 +110,7 @@ protected: int myActiveIndex; int myCounter; int myDisableAll; - float myPriority; + vtkFloatingPointType myPriority; VISU_ImplicitFunctionWidget *myWidgets[2]; VISU_ImplicitFunctionWidget *myDummyWidget; VISU_PlanesWidget *myPlanesWidget; diff --git a/src/VISUGUI/Makefile.in b/src/VISUGUI/Makefile.in index 3ecc0aef..f5772732 100644 --- a/src/VISUGUI/Makefile.in +++ b/src/VISUGUI/Makefile.in @@ -119,17 +119,17 @@ LIB_SERVER_IDL = CPPFLAGS += -ftemplate-depth-32 $(QT_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) \ $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QWT_INCLUDES) \ - -I${KERNEL_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome \ + $(KERNEL_CXXFLAGS) \ + $(MED_CXXFLAGS) \ $(BOOST_CPPFLAGS) CXXFLAGS += -ftemplate-depth-32 $(OCC_CXXFLAGS) \ - -I${KERNEL_ROOT_DIR}/include/salome \ - -I${GUI_ROOT_DIR}/include/salome + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) LDFLAGS += $(QWT_LIBS) -lSalomeNS \ -lSVTK -lVVTK -lSPlot2d -lVisuObject -lVISUEngineImpl -lVISUGUITOOLS \ - -L${KERNEL_ROOT_DIR}/lib/salome \ - -L${GUI_ROOT_DIR}/lib/salome + $(KERNEL_LDFLAGS) \ + $(GUI_LDFLAGS) @CONCLUDE@ diff --git a/src/VISUGUI/VISU_images.po b/src/VISUGUI/VISU_images.po index ccc10ccc..de2ca71f 100644 --- a/src/VISUGUI/VISU_images.po +++ b/src/VISUGUI/VISU_images.po @@ -32,6 +32,8 @@ msgstr "" "Last-Translator: FULLNAME \n" "Content-Type: text/plain; charset=iso-8859-1\n" +msgid "ICON_IMPORT_MED" +msgstr "Visu_import_med.png" msgid "ICON_OBJBROWSER_Visu" msgstr "Visu_tree_visu.png" diff --git a/src/VISUGUI/VISU_msg_en.po b/src/VISUGUI/VISU_msg_en.po index 0511fa4f..c434f12c 100644 --- a/src/VISUGUI/VISU_msg_en.po +++ b/src/VISUGUI/VISU_msg_en.po @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" @@ -6,18 +25,6 @@ msgstr "" "Last-Translator: FULLNAME \n" "Content-Type: text/plain; charset=iso-8859-1\n" -msgid "BUT_OK" -msgstr "OK" - -msgid "BUT_APPLY" -msgstr "Apply" - -msgid "BUT_CLOSE" -msgstr "Close" - -msgid "BUT_CANCEL" -msgstr "Cancel" - msgid "WRN_VISU" msgstr "Post-Pro Warning" @@ -155,12 +162,15 @@ msgstr "MED files import" msgid "VISU_PREF_MED_FULL_LOAD" msgstr "Full MED loading" -msgid "VISU_PREF_REPRESENT_PROPS" +msgid "VISU_REPRESENT_PROPS" msgstr "Representation properties" -msgid "VISU_PREF_SHADING" +msgid "VISU_USE_SHADING" msgstr "Use Shading" +msgid "VISU_SHRINK" +msgstr "Shrink" + #: VisuGUI.cxx msgid "VisuGUI::MEN_IMPORT" @@ -190,6 +200,9 @@ msgstr "Scalar Map on Deformed Shape" msgid "VisuGUI::MEN_VISUALIZATION" msgstr "Visualization" +msgid "VisuGUI::TOOL_IMPORT" +msgstr "Import Toolbar" + msgid "VisuGUI::TOOL_VISUALISATION" msgstr "Visualization Toolbar" @@ -1290,6 +1303,9 @@ msgstr "Importing is done" msgid "VisuGUI_Module::MEN_VISUALISATION" msgstr "Visualization" +msgid "VisuGUI_Module::TOOL_IMPORT" +msgstr "Import Toolbar" + msgid "VisuGUI_Module::TOOL_VISUALISATION" msgstr "Visualization Toolbar" @@ -1635,6 +1651,9 @@ msgstr "Start" msgid "VisuGUI_BuildProgressDlg::CLOSE" msgstr "Close" +msgid "VisuGUI_BuildProgressDlg::HELP" +msgstr "Help" + msgid "VisuGUI_BuildProgressDlg::ERR_ERROR_IN_THE_FILE" msgstr "Error in the file" @@ -2038,4 +2057,43 @@ msgid "VVTK_PickingDlg::PARENT_MESH_TITLE" msgstr "Parent mesh element" msgid "VVTK_PickingDlg::DISPLAY_PARENT_MESH" -msgstr "Display parent mesh element" \ No newline at end of file +msgstr "Display parent mesh element" + +msgid "VisuGUI_Module::TOT_DESK_FILE_SAVE_GUI_STATE" +msgstr "Save VISU state" + +msgid "VisuGUI_Module::MEN_DESK_FILE_SAVE_GUI_STATE" +msgstr "Save VISU state" + +msgid "VisuGUI_Module::PRP_DESK_FILE_SAVE_GUI_STATE" +msgstr "Saves current state of viewers, displayed objects, etc." + +msgid "VISU_MESH" +msgstr "Mesh" + +msgid "VISU_SCALAR_MAP" +msgstr "Scalar Map" + +msgid "VISU_ISO_SURFACES" +msgstr "Iso Surfaces" + +msgid "VISU_CUT_PLANES" +msgstr "Cut Planes" + +msgid "VISU_CUT_LINES" +msgstr "Cut Lines" + +msgid "VISU_DEFORMED_SHAPE" +msgstr "Deformed Shape" + +msgid "VISU_VECTORS" +msgstr "Vectors" + +msgid "VISU_STREAM_LINES" +msgstr "Stream Lines" + +msgid "VISU_PLOT3D" +msgstr "Plot3D" + +msgid "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE" +msgstr "Scalar Map on Def. Shape" \ No newline at end of file diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 46a5fef9..264c03bc 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -437,11 +437,33 @@ CreateCurves( SalomeApp_Module* theModule, _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject); for (; aIter->More(); aIter->Next()) { _PTR(SObject) aTblObj = aIter->Value(); - if ( aTblObj ) { + if( aTblObj ) { _PTR(GenericAttribute) anAttr; if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) { + + _PTR(ChildIterator) aChildIter = aStudy->NewChildIterator( aTblObj ); + SalomeApp_Study* salome_study = GetAppStudy( theModule ); + for( aChildIter->InitEx( false ); aChildIter->More(); aChildIter->Next() ){ + salome_study->deleteReferencesTo( aChildIter->Value() ); + _PTR(SObject) aSO = aChildIter->Value(); + if(aSO){ + if (getValue(aSO, "myComment") == QString("CURVE")) { + CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSO); + if(!CORBA::is_nil(aCORBAObject)){ + PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject); + VISU::Curve_i* pCrv = dynamic_cast(aServant.in()); + if(pCrv){ + PlotRemoveCurve(theModule,pCrv); + } + } + } + } + + } + aBuilder->RemoveObjectWithChildren( aTblObj ); // We should have only one child - UpdateObjBrowser(theModule,true,aTblObj); + + //UpdateObjBrowser(theModule,true,aTblObj); break; } } @@ -1085,7 +1107,8 @@ void VisuGUI:: OnDeleteObjects() { - _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this)); + SalomeApp_Study* anAppStudy = GetAppStudy(this); + _PTR(Study) aCStudy = GetCStudy(anAppStudy); if (CheckLock(aCStudy,GetDesktop(this))) return; @@ -1112,13 +1135,50 @@ OnDeleteObjects() for (i = 0; i < nbSelected; i++) { _PTR(SObject) aSObject = aCStudy->FindObjectID(entries[i]); if (aSObject) { - DeleteSObject(this, aCStudy, aSObject); - UpdateObjBrowser(this, true, aSObject); + _PTR(SObject) aRefObj; + if (aSObject->ReferencedObject(aRefObj)) { + // It can be a reference on curve, published under a container. + // In this case the curve should be removed from the container. + // See bug 10441. + CORBA::Object_var aCorbaObj = VISU::GetSelectedObj(anAppStudy, aRefObj->GetID().c_str()); + if (!CORBA::is_nil(aCorbaObj)) { + VISU::Base_var aVisuObj = VISU::Base::_narrow(aCorbaObj); + if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TMESH) + { + DeleteSObject(this, aCStudy, aRefObj); + UpdateObjBrowser(this, true, aRefObj); + } + else if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCURVE) { + VISU::Curve_ptr aCurve = VISU::Curve::_narrow(aVisuObj); + _PTR(SObject) aParentSO = aSObject->GetFather(); + aCorbaObj = VISU::GetSelectedObj(anAppStudy, aParentSO->GetID().c_str()); + if (!CORBA::is_nil(aCorbaObj) && !CORBA::is_nil(aCurve)) { + aVisuObj = VISU::Base::_narrow(aCorbaObj); + if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCONTAINER) { + // Container object + CORBA::Object_ptr aCnt = VISU::Container::_narrow(aVisuObj); + if (!CORBA::is_nil(aCnt)) { + VISU::Container_i* aContainer = + dynamic_cast(VISU::GetServant(aCnt).in()); + if (aContainer && aContainer->GetNbCurves() > 0) { + aContainer->RemoveCurve(aCurve); + UpdateObjBrowser(this, true, aParentSO); + } + } + } + } + } + } + } else { + DeleteSObject(this, aCStudy, aSObject); + UpdateObjBrowser(this, true, aSObject); + } } } // Finish transaction aStudyBuilder->CommitCommand(); + mgr->clearSelected(); } void @@ -1920,7 +1980,12 @@ createActions() SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); // Create actions - createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(), + //createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(), + // tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false, + // this, SLOT(OnImportFromFile())); + + aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_IMPORT_MED")); + createAction( VISU_IMPORT_FROM_FILE, tr("IMPORT_FROM_FILE"), QIconSet(aPixmap), tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false, this, SLOT(OnImportFromFile())); @@ -2262,7 +2327,10 @@ void VisuGUI:: createToolBars() { - int aToolId = createTool(tr("TOOL_VISUALISATION")); + int aToolId = createTool( tr("TOOL_IMPORT") ); + createTool( VISU_IMPORT_FROM_FILE, aToolId ); + + aToolId = createTool(tr("TOOL_VISUALISATION")); createTool( VISU_SCALAR_MAP, aToolId ); createTool( VISU_DEFORMED_SHAPE, aToolId ); createTool( VISU_VECTORS, aToolId ); @@ -2422,7 +2490,7 @@ createPopupMenus() QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")"; QString aPrsVisible = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)"; QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")"; - QString aComponent = "( selcount=1 and canBeDisplayed and isComponent )"; + QString aComponent = "( selcount=1 and canBeDisplayed and isVisuComponent )"; QString anEraseRule = "( selcount>0 and ({true} in $canBeDisplayed) and (" + aPrsVisible + " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + "))) ) or " + aComponent; @@ -2457,7 +2525,9 @@ createPopupMenus() // 3D presentations commands QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}"; QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}"; - QString aSurfType = " and $type in {'VISU::TMESH'}"; + QString aSurfFrameType = " and $type in {'VISU::TMESH'}"; + QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' " + " 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}"; QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' " "'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}"; QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' " @@ -2475,9 +2545,9 @@ createPopupMenus() mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints, true ); mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType + aNotWirefr, true ); - mgr->setRule( action( VISU_SURFACE ) , aRule + aPrsType + aNotSurfac, true ); + mgr->setRule( action( VISU_SURFACE ) , aRule + aSurfType + aNotSurfac, true ); mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + aInsideType + aNotInside, true ); - mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfType + aNotSurffr, true ); + mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr, true ); mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0", true ); mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true ); @@ -2735,15 +2805,12 @@ VisuGUI:: viewManagers( QStringList& theList ) const { theList.clear(); - // append SVTK viewer only if there is neither SVTK nor VVTK is open - QPtrList lst; - getApp()->viewManagers( SVTK_Viewer::Type(), lst ); - if ( !lst.count() ) { - lst.clear(); - getApp()->viewManagers( VVTK_Viewer::Type(), lst ); - if ( !lst.count() ) - theList.append( SVTK_Viewer::Type() ); - } + // append SVTK viewer only if there is no opened VVTK + SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false ); + if( vm && vm->getViewsCount()>0 ) + theList.append( VVTK_Viewer::Type() ); + else + theList.append( SVTK_Viewer::Type() ); } @@ -2974,9 +3041,91 @@ void VisuGUI::createPreferences() addPreference( tr( "Build groups" ), importGr, LightApp_Preferences::Bool, "VISU", "build_groups" ); addPreference( tr( "Close dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" ); - // group: "Representation properties" - int representGr = addPreference( tr( "VISU_PREF_REPRESENT_PROPS" ), srangeTab ); - addPreference( tr( "VISU_PREF_SHADING" ), representGr, + // TAB: Representation ; group: "Representation properties" + int representationTab = addPreference( tr( "Representation" ) ); + + int representGr = addPreference( tr( "VISU_REPRESENT_PROPS" ), representationTab ); + + QStringList mesh_modes; + mesh_modes.append( "Points" ); + mesh_modes.append( "Wireframe" ); + mesh_modes.append( "Insideframe" ); + mesh_modes.append( "Surfaceframe" ); + mesh_modes.append( "Surface" ); + QValueList mesh_indices; + mesh_indices.append( 0 ); + mesh_indices.append( 1 ); + mesh_indices.append( 3 ); + mesh_indices.append( 4 ); + mesh_indices.append( 2 ); + + QStringList modes1 = mesh_modes; + modes1.remove( "Surfaceframe" ); + QValueList indices1 = mesh_indices; + indices1.remove( 4 ); + + QStringList modes2 = modes1; + modes2.remove( "Insideframe" ); + QValueList indices2 = indices1; + indices2.remove( 3 ); + + QStringList modes3 = modes2; + modes3.remove( "Surface" ); + QValueList indices3 = indices2; + indices3.remove( 2 ); + + + int mesh_represent = addPreference( tr( "VISU_MESH" ), representGr, LightApp_Preferences::Selector, "VISU", "mesh_represent" ); + setPreferenceProperty( mesh_represent, "strings", mesh_modes ); + setPreferenceProperty( mesh_represent, "indexes", mesh_indices ); + addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "mesh_shrink" ); + + int scalar_map_represent = addPreference( tr( "VISU_SCALAR_MAP" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_map_represent" ); + setPreferenceProperty( scalar_map_represent, "strings", modes1 ); + setPreferenceProperty( scalar_map_represent, "indexes", indices1 ); + addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_map_shrink" ); + + int iso_surfaces_represent = addPreference( tr( "VISU_ISO_SURFACES" ), representGr, LightApp_Preferences::Selector, "VISU", "iso_surfaces_represent" ); + setPreferenceProperty( iso_surfaces_represent, "strings", modes2 ); + setPreferenceProperty( iso_surfaces_represent, "indexes", indices2 ); + addPreference( "", representGr, LightApp_Preferences::Space ); + + int cut_planes_represent = addPreference( tr( "VISU_CUT_PLANES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_planes_represent" ); + setPreferenceProperty( cut_planes_represent, "strings", modes2 ); + setPreferenceProperty( cut_planes_represent, "indexes", indices2 ); + addPreference( "", representGr, LightApp_Preferences::Space ); + + int cut_lines_represent = addPreference( tr( "VISU_CUT_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "cut_lines_represent" ); + setPreferenceProperty( cut_lines_represent, "strings", modes3 ); + setPreferenceProperty( cut_lines_represent, "indexes", indices3 ); + addPreference( "", representGr, LightApp_Preferences::Space ); + + int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" ); + setPreferenceProperty( deformed_shape_represent, "strings", modes1 ); + setPreferenceProperty( deformed_shape_represent, "indexes", indices1 ); + addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "deformed_shape_shrink" ); + + int vectors_represent = addPreference( tr( "VISU_VECTORS" ), representGr, LightApp_Preferences::Selector, "VISU", "vectors_represent" ); + setPreferenceProperty( vectors_represent, "strings", modes3 ); + setPreferenceProperty( vectors_represent, "indexes", indices3 ); + addPreference( "", representGr, LightApp_Preferences::Space ); + + int stream_lines_represent = addPreference( tr( "VISU_STREAM_LINES" ), representGr, LightApp_Preferences::Selector, "VISU", "stream_lines_represent" ); + setPreferenceProperty( stream_lines_represent, "strings", modes3 ); + setPreferenceProperty( stream_lines_represent, "indexes", indices3 ); + addPreference( "", representGr, LightApp_Preferences::Space ); + + int plot3d_represent = addPreference( tr( "VISU_PLOT3D" ), representGr, LightApp_Preferences::Selector, "VISU", "plot3d_represent" ); + setPreferenceProperty( plot3d_represent, "strings", modes2 ); + setPreferenceProperty( plot3d_represent, "indexes", indices2 ); + addPreference( "", representGr, LightApp_Preferences::Space ); + + int scalar_def_represent = addPreference( tr( "VISU_SCALAR_MAP_ON_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "scalar_def_represent" ); + setPreferenceProperty( scalar_def_represent, "strings", modes2 ); + setPreferenceProperty( scalar_def_represent, "indexes", indices2 ); + addPreference( tr( "VISU_SHRINK" ), representGr, LightApp_Preferences::Bool, "VISU", "scalar_def_shrink" ); + + addPreference( tr( "VISU_USE_SHADING" ), representGr, LightApp_Preferences::Bool, "VISU", "represent_shading" ); } diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx index 0d8cf8c3..fc6b9f18 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx @@ -27,12 +27,16 @@ #include "VisuGUI_BuildProgressDlg.h" +#include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "SUIT_FileDlg.h" +#include "SUIT_Session.h" #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" +#include "LightApp_Application.h" + #include #include @@ -111,14 +115,11 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): aProgressLayout->setSpacing( 6 ); aProgressLayout->setMargin( 11 ); - myBuildEntitiesCheckBox = new QCheckBox( tr( "BUILD_ENTITIES" ), myProgressBox ); - myBuildEntitiesCheckBox->setChecked( true ); - myBuildEntitiesCheckBox->setEnabled( false ); + QLabel* aBuildEntitiesLabel = new QLabel( tr( "BUILD_ENTITIES" ), myProgressBox ); myBuildEntitiesButton = new QPushButton( myProgressBox ); myBuildEntitiesButton->setEnabled( false ); myBuildEntitiesButton->setFixedSize( 30, 30 ); myBuildEntitiesButton->setPaletteBackgroundColor( Qt::red ); - connect( myBuildEntitiesCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); myBuildFieldsCheckBox = new QCheckBox( tr( "BUILD_FIELDS" ), myProgressBox ); myBuildFieldsCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_fields", true ) ); @@ -144,7 +145,7 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): myBuildGroupsButton->setPaletteBackgroundColor( Qt::red ); connect( myBuildGroupsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); - aProgressLayout->addWidget( myBuildEntitiesCheckBox, 0, 0 ); + aProgressLayout->addWidget( aBuildEntitiesLabel, 0, 0 ); aProgressLayout->addWidget( myBuildEntitiesButton, 0, 1 ); aProgressLayout->addWidget( myBuildFieldsCheckBox, 1, 0 ); aProgressLayout->addWidget( myBuildFieldsButton, 1, 1 ); @@ -195,8 +196,13 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): aCloseButton->setAutoDefault( true ); CommonGroupLayout->addWidget( aCloseButton, 0, 2 ); + QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup ); + aHelpButton->setAutoDefault( true ); + CommonGroupLayout->addWidget( aHelpButton, 0, 3 ); + connect( myStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) ); connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) ); + connect( aHelpButton, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); myTimer = new QTimer( this ); connect( myTimer, SIGNAL( timeout() ), this, SLOT( onTimer() ) ); @@ -231,15 +237,6 @@ void VisuGUI_BuildProgressDlg::onStart() //setModal( false ); myFileNameLineEdit->setReadOnly( true ); - /* - myBuildAllCheckBox->setNoChange(); - myBuildAtOnceCheckBox->setNoChange(); - myBuildEntitiesCheckBox->setNoChange(); - myBuildFieldsCheckBox->setNoChange(); - myBuildMinMaxCheckBox->setNoChange(); - myBuildGroupsCheckBox->setNoChange(); - */ - myStartButton->setEnabled( false ); bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked(); @@ -262,6 +259,22 @@ void VisuGUI_BuildProgressDlg::onClose() done( 0 ); } +void VisuGUI_BuildProgressDlg::onHelp() +{ + QString aHelpFileName = "/files/importing_med_objects.htm"; // ? + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + bool VisuGUI_BuildProgressDlg::onBrowseFile() { QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ); diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.h b/src/VISUGUI/VisuGUI_BuildProgressDlg.h index d0db5912..eed85b22 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.h +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.h @@ -61,6 +61,7 @@ protected slots: void onStart(); void onClose(); + void onHelp(); bool onBrowseFile(); void onTimer(); @@ -86,7 +87,6 @@ private: QGroupBox* myProgressBox; - QCheckBox* myBuildEntitiesCheckBox; QPushButton* myBuildEntitiesButton; QCheckBox* myBuildFieldsCheckBox; diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.cxx b/src/VISUGUI/VisuGUI_ClippingDlg.cxx index d0ff6847..bb1359ce 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.cxx +++ b/src/VISUGUI/VisuGUI_ClippingDlg.cxx @@ -30,6 +30,7 @@ #include "VISU_PipeLine.hxx" #include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SVTK_ViewWindow.h" @@ -102,128 +103,124 @@ namespace VISU { //class : OrientedPlane //purpose : //================================================================================= -class OrientedPlane: public vtkPlane +OrientedPlane* OrientedPlane::New() { - SVTK_ViewWindow* myViewWindow; - - vtkDataSetMapper* myMapper; - -public: - static OrientedPlane * New() { - return new OrientedPlane(); - } - static OrientedPlane * New (SVTK_ViewWindow* vw) { - return new OrientedPlane(vw); - } - vtkTypeMacro(OrientedPlane, vtkPlane); - - - VISU::Orientation myOrientation; - float myDistance; - double myAngle[2]; - - vtkPlaneSource* myPlaneSource; - SALOME_Actor *myActor; - - void SetOrientation(VISU::Orientation theOrientation) {myOrientation = theOrientation;} - VISU::Orientation GetOrientation() {return myOrientation;} - - void SetDistance(float theDistance) {myDistance = theDistance;} - float GetDistance() {return myDistance;} - - void ShallowCopy(OrientedPlane* theOrientedPlane){ - SetNormal(theOrientedPlane->GetNormal()); - SetOrigin(theOrientedPlane->GetOrigin()); - - myOrientation = theOrientedPlane->GetOrientation(); - myDistance = theOrientedPlane->GetDistance(); - - myAngle[0] = theOrientedPlane->myAngle[0]; - myAngle[1] = theOrientedPlane->myAngle[1]; - - myPlaneSource->SetNormal(theOrientedPlane->myPlaneSource->GetNormal()); - myPlaneSource->SetOrigin(theOrientedPlane->myPlaneSource->GetOrigin()); - myPlaneSource->SetPoint1(theOrientedPlane->myPlaneSource->GetPoint1()); - myPlaneSource->SetPoint2(theOrientedPlane->myPlaneSource->GetPoint2()); - } - -protected: - OrientedPlane(SVTK_ViewWindow* vw): - myOrientation(VISU::XY), - myDistance(0.5), - myViewWindow(vw) - { - Init(); - myViewWindow->AddActor(myActor); - } - - OrientedPlane(): - myOrientation(VISU::XY), - myDistance(0.5), - myViewWindow(NULL) - { - Init(); - } + return new OrientedPlane(); +} - void Init(){ - myPlaneSource = vtkPlaneSource::New(); +OrientedPlane* OrientedPlane::New (SVTK_ViewWindow* vw) +{ + return new OrientedPlane(vw); +} - myAngle[0] = myAngle[1] = 0.0; +void OrientedPlane::SetOrientation(VISU::Orientation theOrientation) +{ + myOrientation = theOrientation; +} - // Create and display actor - myMapper = vtkDataSetMapper::New(); - myMapper->SetInput(myPlaneSource->GetOutput()); +VISU::Orientation OrientedPlane::GetOrientation() +{ + return myOrientation; +} - myActor = SALOME_Actor::New(); - myActor->VisibilityOff(); - myActor->PickableOff(); - myActor->SetInfinitive(true); - myActor->SetMapper(myMapper); +void OrientedPlane::SetDistance(float theDistance) +{ + myDistance = theDistance; +} - vtkProperty* aProp = vtkProperty::New(); - float anRGB[3]; +float OrientedPlane::GetDistance() +{ + return myDistance; +} - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); +void OrientedPlane::ShallowCopy(OrientedPlane* theOrientedPlane) +{ + SetNormal(theOrientedPlane->GetNormal()); + SetOrigin(theOrientedPlane->GetOrigin()); + + myOrientation = theOrientedPlane->GetOrientation(); + myDistance = theOrientedPlane->GetDistance(); + + myAngle[0] = theOrientedPlane->myAngle[0]; + myAngle[1] = theOrientedPlane->myAngle[1]; + + myPlaneSource->SetNormal(theOrientedPlane->myPlaneSource->GetNormal()); + myPlaneSource->SetOrigin(theOrientedPlane->myPlaneSource->GetOrigin()); + myPlaneSource->SetPoint1(theOrientedPlane->myPlaneSource->GetPoint1()); + myPlaneSource->SetPoint2(theOrientedPlane->myPlaneSource->GetPoint2()); +} - QColor aFillColor = aResourceMgr->colorValue("SMESH", "fill_color", QColor(0, 170, 255)); - anRGB[0] = aFillColor.red()/255.; - anRGB[1] = aFillColor.green()/255.; - anRGB[2] = aFillColor.blue()/255.; - aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); - aProp->SetOpacity(0.75); - myActor->SetProperty(aProp); - aProp->Delete(); - - vtkProperty* aBackProp = vtkProperty::New(); - QColor aBackFaceColor = aResourceMgr->colorValue("SMESH", "backface_color", QColor(0, 0, 255));//@ - anRGB[0] = aBackFaceColor.red()/255.; - anRGB[1] = aBackFaceColor.green()/255.; - anRGB[2] = aBackFaceColor.blue()/255.; - aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); - aBackProp->SetOpacity(0.75); - myActor->SetBackfaceProperty(aBackProp); - aBackProp->Delete(); - } +OrientedPlane::OrientedPlane(SVTK_ViewWindow* vw): + myOrientation(VISU::XY), + myDistance(0.5), + myViewWindow(vw) +{ + Init(); + myViewWindow->AddActor(myActor); +} - ~OrientedPlane() - { - if (myViewWindow) - myViewWindow->RemoveActor(myActor); +OrientedPlane::OrientedPlane(): + myOrientation(VISU::XY), + myDistance(0.5), + myViewWindow(NULL) +{ + Init(); +} - myActor->Delete(); +void OrientedPlane::Init() +{ + myPlaneSource = vtkPlaneSource::New(); + + myAngle[0] = myAngle[1] = 0.0; + + // Create and display actor + myMapper = vtkDataSetMapper::New(); + myMapper->SetInput(myPlaneSource->GetOutput()); + + myActor = SALOME_Actor::New(); + myActor->VisibilityOff(); + myActor->PickableOff(); + myActor->SetInfinitive(true); + myActor->SetMapper(myMapper); + + vtkProperty* aProp = vtkProperty::New(); + float anRGB[3]; + + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + + QColor aFillColor = aResourceMgr->colorValue("SMESH", "fill_color", QColor(0, 170, 255)); + anRGB[0] = aFillColor.red()/255.; + anRGB[1] = aFillColor.green()/255.; + anRGB[2] = aFillColor.blue()/255.; + aProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); + aProp->SetOpacity(0.75); + myActor->SetProperty(aProp); + aProp->Delete(); + + vtkProperty* aBackProp = vtkProperty::New(); + QColor aBackFaceColor = aResourceMgr->colorValue("SMESH", "backface_color", QColor(0, 0, 255));//@ + anRGB[0] = aBackFaceColor.red()/255.; + anRGB[1] = aBackFaceColor.green()/255.; + anRGB[2] = aBackFaceColor.blue()/255.; + aBackProp->SetColor(anRGB[0],anRGB[1],anRGB[2]); + aBackProp->SetOpacity(0.75); + myActor->SetBackfaceProperty(aBackProp); + aBackProp->Delete(); +} - myMapper->RemoveAllInputs(); - myMapper->Delete(); +OrientedPlane::~OrientedPlane() +{ + if (myViewWindow) + myViewWindow->RemoveActor(myActor); - myPlaneSource->UnRegisterAllOutputs(); - myPlaneSource->Delete(); - }; + myActor->Delete(); -private: - // Not implemented. - OrientedPlane(const OrientedPlane&); - void operator=(const OrientedPlane&); -}; + myMapper->RemoveAllInputs(); + myMapper->Delete(); + + myPlaneSource->UnRegisterAllOutputs(); + myPlaneSource->Delete(); +} struct TSetVisiblity { TSetVisiblity(int theIsVisible): myIsVisible(theIsVisible){} @@ -320,6 +317,10 @@ VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule, GroupButtonsLayout->setAlignment(Qt::AlignTop); GroupButtonsLayout->setSpacing(6); GroupButtonsLayout->setMargin(11); + buttonHelp = new QPushButton (GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("BUT_HELP")); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 4); buttonCancel = new QPushButton (GroupButtons, "buttonCancel"); buttonCancel->setText(tr("BUT_CLOSE")); buttonCancel->setAutoDefault(TRUE); @@ -376,6 +377,7 @@ VisuGUI_ClippingDlg::VisuGUI_ClippingDlg (VisuGUI* theModule, connect(buttonOk , SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel())); + connect(buttonHelp , SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); @@ -564,6 +566,24 @@ void VisuGUI_ClippingDlg::ClickOnCancel() close(); } +//================================================================================= +// function : ClickOnHelp() +// purpose : +//================================================================================= +void VisuGUI_ClippingDlg::ClickOnHelp() +{ + QString aHelpFileName = "clipping.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : onSelectionChanged() // purpose : Called when selection is changed @@ -583,8 +603,8 @@ void VisuGUI_ClippingDlg::onSelectionChanged() std::for_each(myPlanes.begin(),myPlanes.end(),TSetVisiblity(false)); myPlanes.clear(); - float anOffset [3]; - myPrs3d->GetOffset(anOffset); + CORBA::Float anOffset[3]; + myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]); vtkIdType anId = 0, anEnd = myPrs3d->GetNumberOfClippingPlanes(); for (; anId < anEnd; anId++) { @@ -594,7 +614,7 @@ void VisuGUI_ClippingDlg::onSelectionChanged() VISU::TVTKPlane aTVTKPlane(anOrientedPlane); anOrientedPlane->Delete(); aTVTKPlane->ShallowCopy(aPlane); - aTVTKPlane->myActor->SetPosition(anOffset); + aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]); myPlanes.push_back(aTVTKPlane); } } @@ -655,6 +675,9 @@ void VisuGUI_ClippingDlg::onSelectPlane(int theIndex) //================================================================================= void VisuGUI_ClippingDlg::ClickOnNew() { + if(!AutoApplyCheckBox->isChecked()) + ClickOnApply(); + if (!myPrs3d) return; @@ -663,9 +686,9 @@ void VisuGUI_ClippingDlg::ClickOnNew() VISU::TVTKPlane aTVTKPlane(aPlane); myPlanes.push_back(aTVTKPlane); - float anOffset [3]; - myPrs3d->GetOffset(anOffset); - aTVTKPlane->myActor->SetPosition(anOffset); + CORBA::Float anOffset[3]; + myPrs3d->GetOffset(anOffset[0],anOffset[1],anOffset[2]); + aTVTKPlane->myActor->SetPosition(anOffset[0],anOffset[1],anOffset[2]); if (PreviewCheckBox->isChecked()) aTVTKPlane->myActor->VisibilityOn(); @@ -790,18 +813,18 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam() OrientedPlane* aPlane = myPlanes[aCurPlaneIndex].GetPointer(); - float aNormal[3]; + vtkFloatingPointType aNormal[3]; VISU::Orientation anOrientation; - float aDir[3][3] = {{0, 0, 0}, {0, 0, 0}}; + vtkFloatingPointType aDir[3][3] = {{0, 0, 0}, {0, 0, 0}}; { static double aCoeff = vtkMath::Pi()/180.0; - float aRot[2] = {getRotation1(), getRotation2()}; + vtkFloatingPointType aRot[2] = {getRotation1(), getRotation2()}; aPlane->myAngle[0] = aRot[0]; aPlane->myAngle[1] = aRot[1]; - float anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])}; - float aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])}; + vtkFloatingPointType anU[2] = {cos(aCoeff*aRot[0]), cos(aCoeff*aRot[1])}; + vtkFloatingPointType aV[2] = {sqrt(1.0-anU[0]*anU[0]), sqrt(1.0-anU[1]*anU[1])}; aV[0] = aRot[0] > 0? aV[0]: -aV[0]; aV[1] = aRot[1] > 0? aV[1]: -aV[1]; @@ -849,37 +872,37 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneParam() myPrs3d->SetPlaneParam(aNormal, 1. - getDistance(), aPlane); vtkDataSet* aDataSet = myPrs3d->GetInput(); - float *aPnt = aDataSet->GetCenter(); + vtkFloatingPointType *aPnt = aDataSet->GetCenter(); - float* anOrigin = aPlane->GetOrigin(); - float aDel = aDataSet->GetLength()/2.0; + vtkFloatingPointType* anOrigin = aPlane->GetOrigin(); + vtkFloatingPointType aDel = aDataSet->GetLength()/2.0; - float aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel}, - {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; - float aParam, aPnt0[3], aPnt1[3], aPnt2[3]; + vtkFloatingPointType aDelta[2][3] = {{aDir[0][0]*aDel, aDir[0][1]*aDel, aDir[0][2]*aDel}, + {aDir[1][0]*aDel, aDir[1][1]*aDel, aDir[1][2]*aDel}}; + vtkFloatingPointType aParam, aPnt0[3], aPnt1[3], aPnt2[3]; - float aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0], - aPnt[1] - aDelta[0][1] - aDelta[1][1], - aPnt[2] - aDelta[0][2] - aDelta[1][2]}; - float aPnt02[3] = {aPnt01[0] + aNormal[0], - aPnt01[1] + aNormal[1], - aPnt01[2] + aNormal[2]}; + vtkFloatingPointType aPnt01[3] = {aPnt[0] - aDelta[0][0] - aDelta[1][0], + aPnt[1] - aDelta[0][1] - aDelta[1][1], + aPnt[2] - aDelta[0][2] - aDelta[1][2]}; + vtkFloatingPointType aPnt02[3] = {aPnt01[0] + aNormal[0], + aPnt01[1] + aNormal[1], + aPnt01[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt01,aPnt02,aNormal,anOrigin,aParam,aPnt0); - float aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0], - aPnt[1] - aDelta[0][1] + aDelta[1][1], - aPnt[2] - aDelta[0][2] + aDelta[1][2]}; - float aPnt12[3] = {aPnt11[0] + aNormal[0], - aPnt11[1] + aNormal[1], - aPnt11[2] + aNormal[2]}; + vtkFloatingPointType aPnt11[3] = {aPnt[0] - aDelta[0][0] + aDelta[1][0], + aPnt[1] - aDelta[0][1] + aDelta[1][1], + aPnt[2] - aDelta[0][2] + aDelta[1][2]}; + vtkFloatingPointType aPnt12[3] = {aPnt11[0] + aNormal[0], + aPnt11[1] + aNormal[1], + aPnt11[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt11,aPnt12,aNormal,anOrigin,aParam,aPnt1); - float aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0], - aPnt[1] + aDelta[0][1] - aDelta[1][1], - aPnt[2] + aDelta[0][2] - aDelta[1][2]}; - float aPnt22[3] = {aPnt21[0] + aNormal[0], - aPnt21[1] + aNormal[1], - aPnt21[2] + aNormal[2]}; + vtkFloatingPointType aPnt21[3] = {aPnt[0] + aDelta[0][0] - aDelta[1][0], + aPnt[1] + aDelta[0][1] - aDelta[1][1], + aPnt[2] + aDelta[0][2] - aDelta[1][2]}; + vtkFloatingPointType aPnt22[3] = {aPnt21[0] + aNormal[0], + aPnt21[1] + aNormal[1], + aPnt21[2] + aNormal[2]}; vtkPlane::IntersectWithLine(aPnt21,aPnt22,aNormal,anOrigin,aParam,aPnt2); vtkPlaneSource* aPlaneSource = aPlane->myPlaneSource; @@ -926,14 +949,14 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam() int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->selected()); VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axId; gp_Dir dir; - const vector * values = + const vector * values = result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir); if (!values) return; // find distance; int index = SpinBoxIJKIndex->value(); - float distance = 0; + vtkFloatingPointType distance = 0; if (index < values->size()) distance = (*values)[ index ]; @@ -950,14 +973,14 @@ void VisuGUI_ClippingDlg::SetCurrentPlaneIJKParam() } } // find rotation angles - float angle[2]; + vtkFloatingPointType angle[2]; int rotId[2] = { (axId == 0) ? 2 : axId - 1, (axId == 2) ? 0 : axId + 1 }; static double aCoeff = 180.0/vtkMath::Pi(); for (i = 0; i < 2; ++i) { - float cosin = cos[ rotId[ i ]]; + vtkFloatingPointType cosin = cos[ rotId[ i ]]; if (maxCos < 0) cosin = -cosin; angle[ i ] = asin(cosin) * aCoeff; @@ -994,7 +1017,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured() int planeIndex = ComboBoxPlanes->currentItem(); OrientedPlane* plane = myPlanes[ planeIndex ].GetPointer(); vtkPlaneSource* planeSource = plane->myPlaneSource; - float * planeNormal = planeSource->GetNormal(); + vtkFloatingPointType * planeNormal = planeSource->GetNormal(); gp_Dir normal(planeNormal[0], planeNormal[1], planeNormal[2]); // find a grid axis most co-directed with plane normal @@ -1002,7 +1025,7 @@ void VisuGUI_ClippingDlg::setIJKByNonStructured() int i, maxAx = 0, gridAxId = 0; gp_Dir dir, gridDir; double maxDot = 0; - const vector *curValues, *values = 0; + const vector *curValues, *values = 0; VISU::Result_i* result = myPrs3d->GetResult(); for (i = 0; i < 3; ++i) { VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i; @@ -1077,8 +1100,8 @@ void VisuGUI_ClippingDlg::onIJKAxisChanged(int axisId) if (result) { VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId; gp_Dir dir; - const vector * indices = result->GetAxisInfo(myPrs3d->GetMeshName(), - axis, dir); + const vector * indices = result->GetAxisInfo(myPrs3d->GetMeshName(), + axis, dir); if (indices) maxIndex = indices->size() - 1; } diff --git a/src/VISUGUI/VisuGUI_ClippingDlg.h b/src/VISUGUI/VisuGUI_ClippingDlg.h index 0a2b61b6..1be49179 100644 --- a/src/VISUGUI/VisuGUI_ClippingDlg.h +++ b/src/VISUGUI/VisuGUI_ClippingDlg.h @@ -45,12 +45,19 @@ class QHButtonGroup; class QSpinBox; class QTabWidget; +class SALOME_Actor; + class QtxDblSpinBox; +class SVTK_ViewWindow; + class LightApp_SelectionMgr; class VisuGUI; +class vtkPlaneSource; +class vtkDataSetMapper; + class OrientedPlane; namespace VISU { @@ -61,6 +68,47 @@ namespace VISU { enum Orientation {XY, YZ, ZX}; }; +//================================================================================= +//class : OrientedPlane +//purpose : +//================================================================================= +class OrientedPlane: public vtkPlane +{ + SVTK_ViewWindow* myViewWindow; + vtkDataSetMapper* myMapper; + +public: + static OrientedPlane* New(); + static OrientedPlane* New (SVTK_ViewWindow* vw); + + vtkTypeMacro(OrientedPlane, vtkPlane); + + VISU::Orientation myOrientation; + float myDistance; + double myAngle[2]; + + vtkPlaneSource* myPlaneSource; + SALOME_Actor* myActor; + + void SetOrientation(VISU::Orientation theOrientation); + VISU::Orientation GetOrientation(); + + void SetDistance(float theDistance); + float GetDistance(); + + void ShallowCopy(OrientedPlane* theOrientedPlane); + +protected: + OrientedPlane(); + OrientedPlane(SVTK_ViewWindow* vw); + ~OrientedPlane(); + + void Init(); + +private: + OrientedPlane(const OrientedPlane&); + void operator=(const OrientedPlane&); +}; //================================================================================= // class : VisuGUI_ClippingDlg @@ -122,6 +170,7 @@ private: QPushButton* buttonOk; QPushButton* buttonCancel; QPushButton* buttonApply; + QPushButton* buttonHelp; bool myIsSelectPlane; @@ -146,6 +195,7 @@ public slots: void ClickOnOk(); void ClickOnCancel(); void ClickOnApply(); + void ClickOnHelp(); }; #endif // DIALOGBOX_TRANSPARENCYDLG_H diff --git a/src/VISUGUI/VisuGUI_CursorDlg.cxx b/src/VISUGUI/VisuGUI_CursorDlg.cxx index e1adefcf..8fb21497 100644 --- a/src/VISUGUI/VisuGUI_CursorDlg.cxx +++ b/src/VISUGUI/VisuGUI_CursorDlg.cxx @@ -27,7 +27,16 @@ // $Header$ using namespace std; + +#include "VisuGUI.h" #include "VisuGUI_CursorDlg.h" + +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" + +#include "LightApp_Application.h" + #include /*! @@ -93,12 +102,17 @@ VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent, const char* name, bool m buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + TopLayout->addWidget(TopGroupBox, 0, 0); TopLayout->addWidget(GroupButtons, 1, 0); // signals and slots connections connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } /*! @@ -107,3 +121,23 @@ VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent, const char* name, bool m VisuGUI_CursorDlg::~VisuGUI_CursorDlg() { } + +/*! + function : onHelp() + purpose : +*/ +void VisuGUI_CursorDlg::onHelp() +{ + QString aHelpFileName = "/files/changing_visualization_parameters_of_the_presenetation.htm#Width"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_CursorDlg.h b/src/VISUGUI/VisuGUI_CursorDlg.h index 018709cf..f3afd0da 100644 --- a/src/VISUGUI/VisuGUI_CursorDlg.h +++ b/src/VISUGUI/VisuGUI_CursorDlg.h @@ -50,6 +50,11 @@ public: QGroupBox* GroupButtons; QPushButton* buttonOk; QPushButton* buttonCancel; + QPushButton* buttonHelp; + +private slots: + void onHelp(); + }; #endif // VISUGUI_CURSORDLG_H diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx index 545e8c81..7b6c49a7 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.cxx @@ -23,10 +23,13 @@ #include "SVTK_ViewWindow.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SalomeApp_Study.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include "OB_Browser.h" @@ -220,6 +223,9 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) QPushButton* aCloseBtn = new QPushButton(tr("BUT_CANCEL"), aBtnBox); aBtnLayout->addWidget(aCloseBtn); + QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox); + aBtnLayout->addWidget(aHelpBtn); + aMainLayout->addWidget(aBtnBox); myCutLines = NULL; @@ -244,6 +250,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule) connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept())); connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject())); + connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject())); //connect(VisuGUI::application()->desktop(), // SIGNAL(windowActivated(SUIT_ViewWindow*)), @@ -340,7 +347,7 @@ void VisuGUI_CutLinesDlg::createPlanes() aPlaneMapper->SetInput(aPolyData->GetOutput()); aPlaneMapper->ScalarVisibilityOff(); - myPreviewActorGlyphs = myPreviewActorGlyphs = SALOME_Actor::New(); + myPreviewActorGlyphs = SALOME_Actor::New(); myPreviewActorGlyphs->PickableOff(); updateGlyphs(false); @@ -358,10 +365,20 @@ void VisuGUI_CutLinesDlg::createPlanes() void VisuGUI_CutLinesDlg::deletePlanes() { if (myPreviewActor == 0) return; - if (SVTK_ViewWindow* aView = VISU::GetActiveViewWindow()){ - aView->RemoveActor(myPreviewActor); - aView->RemoveActor(myPreviewActorGlyphs); - } + SVTK_ViewWindow* aView; + vtkRenderer* aRend = myPreviewActor->GetRenderer(); + vtkRenderer* aRendGlyphs = myPreviewActorGlyphs->GetRenderer(); + if(aRend) + myPreviewActor->RemoveFromRender(aRend); + if(aRendGlyphs) + myPreviewActorGlyphs->RemoveFromRender(aRendGlyphs); + +// Bug IPAL11962: preview is still in the viewer, if viewer not active. +// if (aView = VISU::GetActiveViewWindow()){ +// aView->RemoveActor(myPreviewActor); +// aView->RemoveActor(myPreviewActorGlyphs); +// } + myPreviewActor->Delete(); myPreviewActorGlyphs->Delete(); myPreviewActor = 0; @@ -454,7 +471,7 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate) //aView->Repaint(); } } - float aPos = myCutLines->GetBasePlanePosition(); + vtkFloatingPointType aPos = myCutLines->GetBasePlanePosition(); myBasePlanePos->setText( QString::number(aPos) ); myBasePlanePos->setEnabled(false); } else { @@ -529,15 +546,15 @@ void VisuGUI_CutLinesDlg::DrawTable() void VisuGUI_CutLinesDlg::updateGlyphs(bool update){ if (myPreviewActorGlyphs == 0 ) return; - const float *aDirLn = myCutLines->GetCutLinesPL()->GetDirLn(); - const float *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt(); - float aSecondPnt[3]; - float aBoundCenter[3]; + const vtkFloatingPointType *aDirLn = myCutLines->GetCutLinesPL()->GetRealDirLn(); + const vtkFloatingPointType *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt(); + vtkFloatingPointType aSecondPnt[3]; + vtkFloatingPointType aBoundCenter[3]; vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData(); vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New(); aPlaneMapper->SetInput(aPolyData->GetOutput()); - float bounds[6]; + vtkFloatingPointType bounds[6]; aPlaneMapper->GetBounds(bounds); for(int i=0; i<3; i++) aBoundCenter[i] = (bounds[i*2] + bounds[i*2+1])/2.0; @@ -548,7 +565,7 @@ void VisuGUI_CutLinesDlg::updateGlyphs(bool update){ aSecondPnt[i] = -aBasePnt[i] - aDirLn[i]; } - float max_bound = 0; + vtkFloatingPointType max_bound = 0; max_bound < bounds[1]-bounds[0] ? max_bound = bounds[1] - bounds[0] : max_bound = max_bound; max_bound < bounds[3]-bounds[2] ? max_bound = bounds[3] - bounds[2] : max_bound = max_bound; max_bound < bounds[5]-bounds[4] ? max_bound = bounds[5] - bounds[4] : max_bound = max_bound; @@ -560,10 +577,9 @@ void VisuGUI_CutLinesDlg::updateGlyphs(bool update){ vtkGlyphSource2D* source = vtkGlyphSource2D::New(); source->FilledOn(); - source->SetCenter(aBoundCenter); source->SetGlyphTypeToArrow(); - aPoints->InsertNextPoint(aBasePnt); + aPoints->InsertNextPoint(aBoundCenter); profile->SetPoints(aPoints); aFloatArray->SetNumberOfComponents(3); @@ -885,6 +901,22 @@ void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue) } } +void VisuGUI_CutLinesDlg::onHelp() +{ + QString aHelpFileName = "/files/cut_lines_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //jfa tmp:void VisuGUI_CutLinesDlg::onWindowActivated (SUIT_ViewWindow* theWnd) //jfa tmp:{ //jfa tmp: if (theWnd != myStudyWnd) diff --git a/src/VISUGUI/VisuGUI_CutLinesDlg.h b/src/VISUGUI/VisuGUI_CutLinesDlg.h index f196660e..8a74804e 100644 --- a/src/VISUGUI/VisuGUI_CutLinesDlg.h +++ b/src/VISUGUI/VisuGUI_CutLinesDlg.h @@ -52,6 +52,7 @@ private slots: void onAllCurvesInvertedCheck(bool theInvert); void onRotation (double theValue); void onPlanePos (const QString& theValue); + void onHelp(); //jfa tmp:void onWindowActivated (SUIT_ViewWindow*); private: diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx index 486a475d..85bc997f 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.cxx @@ -39,12 +39,15 @@ #include "SVTK_ViewWindow.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SUIT_Application.h" #include "SUIT_Desktop.h" #include "SUIT_ViewWindow.h" #include "SUIT_ViewManager.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include #include @@ -417,8 +420,12 @@ void VisuGUI_CutPlanesPane::onValueChanged (int theRow, int theCol) void VisuGUI_CutPlanesPane::deletePlanes() { if (myPreviewActor == 0) return; - if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) - vf->RemoveActor(myPreviewActor); + vtkRenderer* aRend = myPreviewActor->GetRenderer(); + if(aRend) + myPreviewActor->RemoveFromRender(aRend); +// Bug IPAL11962: preview is still in the viewer, if viewer not active. +// if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) +// vf->RemoveActor(myPreviewActor); myPreviewActor->Delete(); myPreviewActor = 0; } @@ -500,10 +507,15 @@ VisuGUI_CutPlanesDlg::VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule) buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton(tr("&Help"), GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + TopLayout->addWidget(GroupButtons); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject())); //connect(VisuGUI::application()->desktop(), // SIGNAL(windowActivated(SUIT_ViewWindow*)), @@ -541,6 +553,22 @@ void VisuGUI_CutPlanesDlg::reject() { QDialog::reject(); } +void VisuGUI_CutPlanesDlg::onHelp() +{ + QString aHelpFileName = "/files/cut_lines_resentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //void VisuGUI_CutPlanesDlg::onWindowActivated (SUIT_ViewWindow* theWnd) //{ // if (theWnd != myStudyWnd) diff --git a/src/VISUGUI/VisuGUI_CutPlanesDlg.h b/src/VISUGUI/VisuGUI_CutPlanesDlg.h index e5ccea9f..c7b61fce 100644 --- a/src/VISUGUI/VisuGUI_CutPlanesDlg.h +++ b/src/VISUGUI/VisuGUI_CutPlanesDlg.h @@ -115,6 +115,7 @@ protected slots: void accept(); void reject(); void onWindowActivated (SUIT_ViewWindow*); + void onHelp(); private: VisuGUI_CutPlanesPane* myCutPane; diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx index da99973c..30dd4443 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx @@ -28,12 +28,17 @@ #include "VisuGUI_DeformedShapeDlg.h" +#include "VisuGUI.h" #include "VisuGUI_Tools.h" #include "VISU_DeformedShape_i.hh" #include "SalomeApp_Module.h" +#include "LightApp_Application.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include #include @@ -113,6 +118,10 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + // Add Tab box and Buttons to the top layout TopLayout->addWidget(aTabBox); TopLayout->addWidget(GroupButtons); @@ -120,6 +129,7 @@ VisuGUI_DeformedShapeDlg::VisuGUI_DeformedShapeDlg (SalomeApp_Module* theModule) // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); } void VisuGUI_DeformedShapeDlg::initFromPrsObject (VISU::DeformedShape_i* thePrs) @@ -149,3 +159,19 @@ void VisuGUI_DeformedShapeDlg::reject() myScalarPane->deletePreview(); QDialog::reject(); } + +void VisuGUI_DeformedShapeDlg::onHelp() +{ + QString aHelpFileName = "/files/deformed_shape_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h index 573c439a..5a907e9a 100644 --- a/src/VISUGUI/VisuGUI_DeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_DeformedShapeDlg.h @@ -67,6 +67,7 @@ public: protected slots: void accept(); void reject(); + void onHelp(); private: QtxDblSpinBox* ScalFact; diff --git a/src/VISUGUI/VisuGUI_EditContainerDlg.cxx b/src/VISUGUI/VisuGUI_EditContainerDlg.cxx index eed32a53..89203f9a 100644 --- a/src/VISUGUI/VisuGUI_EditContainerDlg.cxx +++ b/src/VISUGUI/VisuGUI_EditContainerDlg.cxx @@ -18,6 +18,9 @@ #include "SalomeApp_Application.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include #include @@ -280,10 +283,15 @@ VisuGUI_EditContainerDlg::VisuGUI_EditContainerDlg (VisuGUI* theModule, bool the buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + TopLayout->addWidget(GroupButtons); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); } void VisuGUI_EditContainerDlg::initFromPrsObject (VISU::Container_i* theContainer) @@ -427,3 +435,17 @@ void VisuGUI_EditContainerDlg::onRightSelected() } myLeftBtn->setEnabled(isSelected); } + +void VisuGUI_EditContainerDlg::onHelp() +{ + QString aHelpFileName = "/files/creating_xy_plot.htm"; + SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_EditContainerDlg.h b/src/VISUGUI/VisuGUI_EditContainerDlg.h index 8493d0ff..7aa9034d 100644 --- a/src/VISUGUI/VisuGUI_EditContainerDlg.h +++ b/src/VISUGUI/VisuGUI_EditContainerDlg.h @@ -48,6 +48,7 @@ class VisuGUI_EditContainerDlg: public QDialog void onRightClicked(); void onLeftSelected(); void onRightSelected(); + void onHelp(); private: QString getSObjectName (_PTR(SObject) theSObject); diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx index 7492c7f5..c88b47e3 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.cxx @@ -39,7 +39,7 @@ #include "VVTK_PrimitiveBox.h" #include "VVTK_SizeBox.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SalomeApp_Module.h" #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" @@ -314,13 +314,13 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs) const VISU::TNames& aCompNames = aField->myCompNames; const VISU::TNames& aUnitNames = aField->myUnitNames; for(int i = 0; i < aNbComp; i++){ - QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace(); + QString aComponent = QString(aCompNames[i].c_str()).simplifyWhiteSpace(); if(aComponent.isNull() || aComponent == "") aComponent = "Component " + QString::number(i+1); else aComponent = "[" + QString::number(i+1) + "] " + aComponent; - QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace(); + QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace(); if(anUnit.isNull() || anUnit == "") anUnit = "-"; @@ -340,7 +340,7 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs) // "Title" myTextDlg->setTitleText(QString(thePrs->GetTitle())); - float R, G, B; + vtkFloatingPointType R, G, B; thePrs->GetTitleColor(&R, &G, &B); myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)), @@ -594,12 +594,17 @@ VisuGUI_GaussPointsDlg::VisuGUI_GaussPointsDlg(SalomeApp_Module* theModule, bool buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( PrsGroup ); TopLayout->addWidget( aTabBox ); TopLayout->addWidget( GroupButtons ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } void VisuGUI_GaussPointsDlg::initFromPrsObject( VISU::GaussPoints_i* thePrs ) @@ -731,3 +736,17 @@ void VisuGUI_GaussPointsDlg::accept() //if( myScalarPane->check() ) QDialog::accept(); } + +void VisuGUI_GaussPointsDlg::onHelp() +{ + QString aHelpFileName = "types_of_gauss_points_presentations.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_GaussPointsDlg.h b/src/VISUGUI/VisuGUI_GaussPointsDlg.h index c845d013..64bcc7fa 100644 --- a/src/VISUGUI/VisuGUI_GaussPointsDlg.h +++ b/src/VISUGUI/VisuGUI_GaussPointsDlg.h @@ -141,6 +141,7 @@ public: protected slots: void onToggleDefShape( bool ); + void onHelp(); void accept(); diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx index 34d170b9..e80ff194 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx @@ -31,10 +31,12 @@ #include "VisuGUI.h" #include "VisuGUI_Tools.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include @@ -201,12 +203,16 @@ VisuGUI_IsoSurfacesDlg::VisuGUI_IsoSurfacesDlg (SalomeApp_Module* theModule) QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); TopLayout->addWidget(GroupButtons); // signals and slots connections connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } void VisuGUI_IsoSurfacesDlg::accept() @@ -223,3 +229,19 @@ void VisuGUI_IsoSurfacesDlg::reject() myScalarPane->deletePreview(); QDialog::reject(); } + +void VisuGUI_IsoSurfacesDlg::onHelp() +{ + QString aHelpFileName = "/files/iso_surfaces_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h index dc0547f1..dbe12991 100644 --- a/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h +++ b/src/VISUGUI/VisuGUI_IsoSurfacesDlg.h @@ -86,6 +86,7 @@ class VisuGUI_IsoSurfacesDlg : public QDialog protected slots: void accept(); void reject(); + void onHelp(); private: VisuGUI_IsoSurfPane* myIsoPane; diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 4a441242..e8ce11e7 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -45,7 +45,8 @@ #include "LightApp_Preferences.h" #include "LightApp_Displayer.h" -#include "SALOMEDS_IParameters.hxx" +#include "SALOMEDSClient_ClientFactory.hxx" +#include "SALOMEDSClient_IParameters.hxx" #include "VVTK_ViewManager.h" #include "VVTK_ViewWindow.h" @@ -58,6 +59,7 @@ #include "VISU_Event.h" #include "VisuGUI_Prs3dTools.h" +#include "VisuGUI_ClippingDlg.h" #include "VISU_GaussPoints_i.hh" #include "VISU_GaussPtsAct.h" @@ -95,6 +97,8 @@ static int MYDEBUG = 0; static int MYDEBUG = 0; #endif +#define SAVE_VISU_STATE 5090 + #define GAUSS_NEW_VIEWER 5100 #define GAUSS_CREATE_PRS 5200 #define GAUSS_RENAME 5210 @@ -119,61 +123,27 @@ using namespace VISU; namespace VISU { - //--------------------------------------------------------------- - class Viewer - { - VVTK_ViewManager* myViewManager; - LightApp_VTKSelector* mySelector; - public: - - Viewer(VisuGUI_Module* theModule, TViewerMap& theViewerMap) - { - SalomeApp_Application* anApp = theModule->getApp(); - myViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() ); - VVTK_Viewer* aViewer = (VVTK_Viewer*)myViewManager->getViewModel(); - mySelector = new LightApp_VTKSelector( aViewer, anApp->selectionMgr() ); - anApp->addViewManager( myViewManager ); - - theViewerMap.insert(TViewerMap::value_type(myViewManager,PViewer(this))); - QObject::connect( myViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ), - theModule, SLOT( onLastViewClosed( SUIT_ViewManager* ) ) ); - - //aViewer->setBackgroundColor( Qt::darkGreen ); - myViewManager->createViewWindow(); - } - - VVTK_ViewManager* getViewManager() - { - return myViewManager; - } - - virtual - ~Viewer() - { - } - }; - - //--------------------------------------------------------------- typedef void (SUIT_ViewWindow::* TViewVisibility)(); void - SetViewVisibility(const TViewerMap& theViewerMap, + SetViewVisibility(SalomeApp_Application* app, TViewVisibility theViewVisibility) { - TViewerMap::const_iterator anIter = theViewerMap.begin(); - for(; anIter != theViewerMap.end(); anIter++){ - if(SUIT_ViewManager* aViewManager = anIter->first){ + ViewManagerList l; + app->viewManagers( VVTK_Viewer::Type(), l ); + ViewManagerList::const_iterator anIt = l.begin(), aLast = l.end(); + for( ; anIt!=aLast; anIt++ ) + if( SUIT_ViewManager* aViewManager = *anIt ) + { QPtrVector aViews = aViewManager->getViews(); int aSize = aViews.size(); - for(int anId = 0; anId < aSize; anId++){ - if(SUIT_ViewWindow* aView = aViews[anId]){ + for(int anId = 0; anId < aSize; anId++) + { + if(SUIT_ViewWindow* aView = aViews[anId]) (aView->* theViewVisibility)(); - } } } - } } - } //--------------------------------------------------------------- @@ -200,6 +170,13 @@ initialize( CAM_Application* theApp ) SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + // "Save VISU State" command is moved from SalomeApp_Applicaiton + createAction( SAVE_VISU_STATE, tr( "TOT_DESK_FILE_SAVE_GUI_STATE" ), QIconSet(), + tr( "MEN_DESK_FILE_SAVE_GUI_STATE" ), tr( "PRP_DESK_FILE_SAVE_GUI_STATE" ), + 0, getApp()->desktop(), false, getApp(), SLOT( onSaveGUIState() ) ); + int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 ); + createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 ); + QPixmap aPixmap; aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER")); createAction( GAUSS_NEW_VIEWER, @@ -215,7 +192,7 @@ initialize( CAM_Application* theApp ) int windowMenu = createMenu( tr( "MEN_DESK_WINDOW" ), -1, 100 ); int newWinMenu = createMenu( tr( "MEN_DESK_NEWWINDOW" ), windowMenu, -1, 0 ); createMenu( action( GAUSS_NEW_VIEWER ), newWinMenu, -1 ); - + // Add actions to menus createMenu( tr( "MEN_GAUSS" ), -1, -1, 30 ); //createMenu( GAUSS_CREATE_PRS, aMenuId, 10 ); @@ -340,7 +317,7 @@ activateModule( SUIT_Study* theStudy ) { VisuGUI::activateModule( theStudy ); - SetViewVisibility(myViewerMap,&SUIT_ViewWindow::show); + SetViewVisibility(getApp(),&SUIT_ViewWindow::show); return true; } @@ -353,7 +330,7 @@ deactivateModule( SUIT_Study* theStudy ) { VisuGUI::deactivateModule( theStudy ); - SetViewVisibility(myViewerMap,&SUIT_ViewWindow::hide); + SetViewVisibility(getApp(),&SUIT_ViewWindow::hide); return true; } @@ -364,17 +341,16 @@ SUIT_ViewManager* VisuGUI_Module:: onCreateViewManager() { - Viewer* aViewer = new Viewer( this, myViewerMap ); - return aViewer->getViewManager(); -} - + SalomeApp_Application* anApp = getApp(); + VVTK_ViewManager* aViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() ); + VVTK_Viewer* aViewer = (VVTK_Viewer*)aViewManager->getViewModel(); + new LightApp_VTKSelector( aViewer, anApp->selectionMgr() ); + anApp->addViewManager( aViewManager ); + + //aViewer->setBackgroundColor( Qt::darkGreen ); + aViewManager->createViewWindow(); -//--------------------------------------------------------------- -void -VisuGUI_Module:: -onLastViewClosed(SUIT_ViewManager* theViewManager) -{ - myViewerMap.erase(theViewManager); + return aViewer->getViewManager(); } @@ -1016,40 +992,40 @@ namespace const char* theSuffix, std::ostringstream& theStr) { - float aColor[3]; + vtkFloatingPointType aColor[3]; vtkRenderer* aRenderer = theViewWindow->getRenderer(); aRenderer->GetBackground(aColor); - Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".R",aColor[0]); - Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".G",aColor[1]); - Storable::DataToStream(theStr,std::string("myColor") + theSuffix + ".B",aColor[2]); + Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".R").c_str(),aColor[0]); + Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".G").c_str(),aColor[1]); + Storable::DataToStream(theStr,(std::string("myColor") + theSuffix + ".B").c_str(),aColor[2]); double aPosition[3]; vtkCamera* aCamera = aRenderer->GetActiveCamera(); aCamera->GetPosition(aPosition); - Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[0]",aPosition[0]); - Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[1]",aPosition[1]); - Storable::DataToStream(theStr,std::string("myPosition") + theSuffix + "[2]",aPosition[2]); + Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[0]").c_str(),aPosition[0]); + Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[1]").c_str(),aPosition[1]); + Storable::DataToStream(theStr,(std::string("myPosition") + theSuffix + "[2]").c_str(),aPosition[2]); double aFocalPnt[3]; aCamera->GetFocalPoint(aFocalPnt); - Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[0]",aFocalPnt[0]); - Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[1]",aFocalPnt[1]); - Storable::DataToStream(theStr,std::string("myFocalPnt") + theSuffix + "[2]",aFocalPnt[2]); + Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[0]").c_str(),aFocalPnt[0]); + Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[1]").c_str(),aFocalPnt[1]); + Storable::DataToStream(theStr,(std::string("myFocalPnt") + theSuffix + "[2]").c_str(),aFocalPnt[2]); double aViewUp[3]; aCamera->GetViewUp(aViewUp); - Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[0]",aViewUp[0]); - Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[1]",aViewUp[1]); - Storable::DataToStream(theStr,std::string("myViewUp") + theSuffix + "[2]",aViewUp[2]); + Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[0]").c_str(),aViewUp[0]); + Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[1]").c_str(),aViewUp[1]); + Storable::DataToStream(theStr,(std::string("myViewUp") + theSuffix + "[2]").c_str(),aViewUp[2]); - float aParallelScale = aCamera->GetParallelScale(); - Storable::DataToStream(theStr,std::string("myParallelScale") + theSuffix,aParallelScale); + vtkFloatingPointType aParallelScale = aCamera->GetParallelScale(); + Storable::DataToStream(theStr,(std::string("myParallelScale") + theSuffix).c_str(),aParallelScale); double aScaleFactor[3]; theViewWindow->GetScale(aScaleFactor); - Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[0]",aScaleFactor[0]); - Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[1]",aScaleFactor[1]); - Storable::DataToStream(theStr,std::string("myScaleFactor") + theSuffix + "[2]",aScaleFactor[2]); + Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[0]").c_str(),aScaleFactor[0]); + Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[1]").c_str(),aScaleFactor[1]); + Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[2]").c_str(),aScaleFactor[2]); } //--------------------------------------------------------------- @@ -1058,7 +1034,7 @@ namespace const char* theSuffix, const Storable::TRestoringMap& theMap) { - float aColor[3]; + vtkFloatingPointType aColor[3]; aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble(); aColor[1] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".G").toDouble(); aColor[2] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".B").toDouble(); @@ -1084,7 +1060,7 @@ namespace aViewUp[2] = Storable::FindValue(theMap,std::string("myViewUp") + theSuffix + "[2]").toDouble(); aCamera->SetViewUp(aViewUp); - float aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble(); + vtkFloatingPointType aParallelScale = Storable::FindValue(theMap,std::string("myParallelScale") + theSuffix).toDouble(); aCamera->SetParallelScale(aParallelScale); double aScaleFactor[3]; @@ -1106,37 +1082,37 @@ namespace std::string aSegmentationMode; if(aWidgetCtrl->IsPlanesActive()){ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget(); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; aPlanesWidget->GetOrigin(anOrigin); Storable::DataToStream(theStr,"myCursorOrigin[0]",anOrigin[0]); Storable::DataToStream(theStr,"myCursorOrigin[1]",anOrigin[1]); Storable::DataToStream(theStr,"myCursorOrigin[2]",anOrigin[2]); - float aNormal[3]; + vtkFloatingPointType aNormal[3]; aPlanesWidget->GetNormal(aNormal); Storable::DataToStream(theStr,"myCursorNormal[0]",aNormal[0]); Storable::DataToStream(theStr,"myCursorNormal[1]",aNormal[1]); Storable::DataToStream(theStr,"myCursorNormal[2]",aNormal[2]); - float aDepth = aPlanesWidget->Distance(); + vtkFloatingPointType aDepth = aPlanesWidget->Distance(); Storable::DataToStream(theStr,"myCursorDepth",aDepth); aSegmentationMode = "Planes"; }else if(aWidgetCtrl->IsSphereActive()){ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget(); - float aCenter[3]; + vtkFloatingPointType aCenter[3]; aSphereWidget->GetCenter(aCenter); Storable::DataToStream(theStr,"mySphereCursorCenter[0]",aCenter[0]); Storable::DataToStream(theStr,"mySphereCursorCenter[1]",aCenter[1]); Storable::DataToStream(theStr,"mySphereCursorCenter[2]",aCenter[2]); - float aRadius = aSphereWidget->GetRadius(); + vtkFloatingPointType aRadius = aSphereWidget->GetRadius(); Storable::DataToStream(theStr,"mySphereCursorRaduis",aRadius); aSegmentationMode = "Sphere"; } - Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode); + Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str()); } } @@ -1498,31 +1474,31 @@ OnRestoreConfiguration() if(aSegmentationMode == "Planes"){ VISU_PlanesWidget *aPlanesWidget = aWidgetCtrl->GetPlanesWidget(); - float anOrigin[3]; + vtkFloatingPointType anOrigin[3]; anOrigin[0] = Storable::FindValue(aMap,"myCursorOrigin[0]").toDouble(); anOrigin[1] = Storable::FindValue(aMap,"myCursorOrigin[1]").toDouble(); anOrigin[2] = Storable::FindValue(aMap,"myCursorOrigin[2]").toDouble(); aPlanesWidget->SetOrigin(anOrigin); - float aNormal[3]; + vtkFloatingPointType aNormal[3]; aNormal[0] = Storable::FindValue(aMap,"myCursorNormal[0]").toDouble(); aNormal[1] = Storable::FindValue(aMap,"myCursorNormal[1]").toDouble(); aNormal[2] = Storable::FindValue(aMap,"myCursorNormal[2]").toDouble(); aPlanesWidget->SetNormal(aNormal); - float aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble(); + vtkFloatingPointType aDepth = Storable::FindValue(aMap,"myCursorDepth").toDouble(); aPlanesWidget->SetDistance(aDepth); aMainWindow->SetPlanesSegementation(true); }else if(aSegmentationMode == "Sphere"){ VISU_SphereWidget *aSphereWidget = aWidgetCtrl->GetSphereWidget(); - float aCenter[3]; + vtkFloatingPointType aCenter[3]; aCenter[0] = Storable::FindValue(aMap,"mySphereCursorCenter[0]").toDouble(); aCenter[1] = Storable::FindValue(aMap,"mySphereCursorCenter[1]").toDouble(); aCenter[2] = Storable::FindValue(aMap,"mySphereCursorCenter[2]").toDouble(); aSphereWidget->SetCenter(aCenter); - float aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble(); + vtkFloatingPointType aRadius = Storable::FindValue(aMap,"mySphereCursorRaduis").toDouble(); aSphereWidget->SetRadius(aRadius); aMainWindow->SetSphereSegementation(true); @@ -1598,7 +1574,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) return; _PTR(Study) studyDS = study->studyDS(); _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint); - SALOMEDS_IParameters ip(ap); + _PTR(IParameters) ip = ClientFactory::getIParameters(ap); // viewers counters are used for storing view_numbers in IParameters int svtkViewers( 0 ), vvtkViewers( 0 ), plotViewers( 0 ); @@ -1612,7 +1588,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) // saving VVTK viewer parameters. VVTK (Gauss Viewers) are NOT created by SalomeApp since // VVTK is declared in VISU, so here we store VVTK view window parameters. // VisuGUI_Module::restoreVisualParameters() creates VVTK_Views and restores its parameters. - ip.setProperty( "ActiveGaussViewer", "-1" ); + ip->setProperty( "ActiveGaussViewer", "-1" ); getApp()->viewManagers( VVTK_Viewer::Type(), lst ); for ( QPtrListIterator it( lst ); it.current(); ++it ) { SUIT_ViewManager* vman = it.current(); @@ -1621,10 +1597,10 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) // gauss viewer parameters are retrieved using this "entry" string. // name of parameter = caption of gauss ViewWindow // value of parameter = ViewWindow's visual parameters - ip.setParameter( "GaussViewer", vwin->caption().latin1(), vwin->getVisualParameters().latin1() ); + ip->setParameter( "GaussViewer", vwin->caption().latin1(), vwin->getVisualParameters().latin1() ); if ( application()->desktop()->activeWindow() == vwin ) - ip.setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).latin1() ); + ip->setProperty( "ActiveGaussViewer", QString::number( vvtkViewers ).latin1() ); vvtkViewers++; } } @@ -1634,7 +1610,7 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) /* lst.clear(); getApp()->viewManagers( SVTK_Viewer::Type(), lst ); - ip.setProperty( "VtkViewersCount", QString::number( lst.count() ).latin1() ); + ip->setProperty( "VtkViewersCount", QString::number( lst.count() ).latin1() ); */ // main cycle to store parameters of displayed objects @@ -1665,44 +1641,47 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) Handle(SALOME_InteractiveObject) io = vActor->getIO(); // entry is "ecoded" = it does NOT contain component adress, since it is a // subject to change on next component loading - std::string entry = ip.encodeEntry( io->getEntry(), componentName ); + std::string entry = ip->encodeEntry( io->getEntry(), componentName ); std::string param, vtkParam = vType.latin1(); vtkParam += gSeparator; vtkParam += QString::number( *viewsCounter ).latin1(); vtkParam += gSeparator; param = vtkParam + "Visibility"; - ip.setParameter( entry, param, "On" ); + ip->setParameter( entry, param, "On" ); param = vtkParam + "Name"; - ip.setParameter( entry, param, vActor->getName() ); + ip->setParameter( entry, param, vActor->getName() ); param = vtkParam + "RepresentationMode"; - ip.setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() ); + ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).latin1() ); param = vtkParam + "Opacity"; - ip.setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() ); - float r, g, b; + ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).latin1() ); + vtkFloatingPointType r, g, b; vActor->GetColor(r, g, b); QString colorStr = QString::number( r ); colorStr += gDigitsSep; colorStr += QString::number( g ); colorStr += gDigitsSep; colorStr += QString::number( b ); param = vtkParam + "Color"; - ip.setParameter( entry, param, colorStr.latin1() ); + ip->setParameter( entry, param, colorStr.latin1() ); param = vtkParam + "LineWidth"; - ip.setParameter( entry, param, QString::number( vActor->GetLineWidth() ).latin1() ); + ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).latin1() ); if ( vActor->IsShrunkable() && vActor->IsShrunk() ) { param = vtkParam + "ShrinkMode"; - ip.setParameter( entry, param, "On" ); + ip->setParameter( entry, param, "On" ); param = vtkParam + "ShrinkFactor"; - ip.setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).latin1() ); + ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).latin1() ); } VISU_ScalarMapAct* scalarMapActor = dynamic_cast( vActor ); if ( scalarMapActor && scalarMapActor->IsShading() ) { param = vtkParam + "Shading"; - ip.setParameter( entry, param, "On" ); + ip->setParameter( entry, param, "On" ); } if ( const VISU::Prs3d_i* vPrs = vActor->GetPrs3d() ) { - param = vtkParam + "ClippingPlane_"; - for ( int p = 0, nPlanes = vPrs->GetNumberOfClippingPlanes(); p < nPlanes; p++ ) { + param = vtkParam + "ClippingPlane"; + int nPlanes = vPrs->GetNumberOfClippingPlanes(); + if ( !nPlanes ) + ip->setParameter( entry, param, "Off" ); + for ( int p = 0; p < nPlanes; p++ ) { vtkPlane* plane = vPrs->GetClippingPlane( p ); - float normal[3], origin[3]; + vtkFloatingPointType normal[3], origin[3]; plane->GetNormal( normal ); plane->GetOrigin( origin ); std::string planeValue = QString::number( normal[0] ).latin1(); planeValue += gDigitsSep; @@ -1711,8 +1690,8 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) planeValue += QString::number( origin[0] ).latin1(); planeValue += gDigitsSep; planeValue += QString::number( origin[1] ).latin1(); planeValue += gDigitsSep; planeValue += QString::number( origin[2] ).latin1(); - param += QString::number( p+1 ).latin1(); - ip.setParameter( entry, param, planeValue ); + param = QString( "%1ClippingPlane_%2" ).arg( vtkParam.c_str() ).arg( p+1 ).latin1(); + ip->setParameter( entry, param, planeValue ); } } @@ -1740,13 +1719,13 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) Handle(SALOME_InteractiveObject) io = sCurve->getIO(); // entry is "ecoded" = it does NOT contain component adress, since it is a // subject to change on next component loading - std::string entry = ip.encodeEntry( io->getEntry(), componentName ); + std::string entry = ip->encodeEntry( io->getEntry(), componentName ); std::string param, plotParam = vType.latin1(); plotParam += gSeparator; plotParam += QString::number( *viewsCounter ).latin1(); plotParam += gSeparator; param = plotParam + "Visibility"; - ip.setParameter( entry, param, "On" ); + ip->setParameter( entry, param, "On" ); } } } // for curves @@ -1788,7 +1767,7 @@ std::string getParam( const std::string& paramName, const int index ) { QStringList lst = QStringList::split( gSeparator, QString( paramName.c_str() ) ); if ( !lst.isEmpty() && index < lst.size() ) - return lst[index]; + return lst[index].latin1(); return ""; } @@ -1806,17 +1785,17 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) return; _PTR(Study) studyDS = study->studyDS(); _PTR(AttributeParameter) ap = studyDS->GetModuleParameters("Interface Applicative", moduleName().latin1(), savePoint); - SALOMEDS_IParameters ip(ap); + _PTR(IParameters) ip = ClientFactory::getIParameters(ap); // actors are stored in a map after displaying of them for quicker access in future QMap > vtkActors; // map: entry to map: ViewType_ to actor (SVTK/VVTK) - std::vector entries = ip.getEntries(); + std::vector entries = ip->getEntries(); for ( std::vector::iterator entIt = entries.begin(); entIt != entries.end(); ++entIt ) { - std::vector paramNames = ip.getAllParameterNames( *entIt ); - std::vector paramValues = ip.getAllParameterValues( *entIt ); + std::vector paramNames = ip->getAllParameterNames( *entIt ); + std::vector paramValues = ip->getAllParameterValues( *entIt ); std::vector::iterator namesIt = paramNames.begin(); std::vector::iterator valuesIt = paramValues.begin(); @@ -1837,7 +1816,12 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) } // entry is a normal entry - it should be "decoded" (setting base adress of component) - QString entry( ip.decodeEntry( *entIt ).c_str() ); + QString entry( ip->decodeEntry( *entIt ).c_str() ); + + //SRN: Added a check that the entry corresponds to Standard_Real object in the Study + // as the object may be deleted or modified after the visual state is saved. + _PTR(SObject) so = studyDS->FindObjectID(entry.latin1()); + if(!so) continue; //Skip the not existent entry for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) { std::string viewerType = ::getParam( *namesIt, ViewerType ); @@ -1855,25 +1839,23 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) viewerType == VVTK_Viewer::Type().latin1() ) { // used as inner map key for locating the actor. - QString viewerTypeIndex = viewerType + QString::number( viewIndex ); + QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex ); if ( paramName == "Visibility" && displayer() ) { // if VVTK, then we must create viewer first, because QPtrList lst; - getApp()->viewManagers( viewerType, lst ); + getApp()->viewManagers( viewerType.c_str(), lst ); // SVTK/VVTK ViewManager always has 1 ViewWindow, so view index is index of view manager if ( viewIndex >= 0 && viewIndex < lst.count() ) { SUIT_ViewManager* vman = lst.at( viewIndex ); SUIT_ViewModel* vmodel = vman->getViewModel(); - // SVTK and VVTK view models can be casted to SALOME_View - displayer()->Display( entry, true, dynamic_cast( vmodel ) ); - SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView(); - // vtkView->getRenderer()->ResetCameraClippingRange(); - // vtkView->Repaint(); + // both SVTK and VVTK view models can be casted to SALOME_View + displayer()->Display( entry, true, dynamic_cast( vmodel ) ); - // store displayed actor so setting of color, opacity, etc. will be much faster + // store displayed actor in a temporary map for quicker access later when restoring other parameters + SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView(); QMap viewActorMap; if ( vtkActors.contains( entry ) ) viewActorMap = vtkActors[ entry ]; @@ -1925,17 +1907,25 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) } else if ( paramName.find( "ClippingPlane" ) != std::string::npos ) { - QStringList vals = QStringList::split( gDigitsSep, val ); - if ( vals.count() == 6 && vActor->GetPrs3d() ) { - float normal[3], origin[3]; - for (int x = 0; x < 3; x++ ) { - normal[x] = vals[x].toFloat(); - origin[x] = vals[x+3].toFloat(); + VISU::Prs3d_i* prs = vActor->GetPrs3d(); + if ( !prs ) + continue; + + prs->RemoveAllClippingPlanes(); + if ( val != "Off" ) { + QStringList vals = QStringList::split( gDigitsSep, val ); + if ( vals.count() == 6 ) { // format check: 6 float values + vtkFloatingPointType normal[3], origin[3]; + for (int x = 0; x < 3; x++ ) { + normal[x] = vals[x].toFloat(); + origin[x] = vals[x+3].toFloat(); + } + OrientedPlane* plane = OrientedPlane::New(); + plane->SetNormal( normal ); + plane->SetOrigin( origin ); + prs->AddClippingPlane( plane ); + plane->Delete(); } - vtkPlane* plane = vtkPlane::New(); - plane->SetNormal( normal ); - plane->SetOrigin( origin ); - vActor->GetPrs3d()->AddClippingPlane( plane ); } } } // else .. @@ -1945,7 +1935,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) if ( paramName == "Visibility" && displayer() ) { QPtrList lst; - getApp()->viewManagers( viewerType, lst ); + getApp()->viewManagers( viewerType.c_str(), lst ); if ( viewIndex >= 0 && viewIndex < lst.count() ) { SUIT_ViewManager* vman = lst.at( viewIndex ); @@ -1960,7 +1950,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) } // for names/parameters iterator } // for entries iterator - // [ update all SVTK/VVTK views + // [ update all SVTK/VVTK/Plot2D views QPtrList lst; getApp()->viewManagers( lst ); for ( QPtrListIterator it( lst ); it.current(); ++it ) { @@ -1984,7 +1974,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) // parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we close one // default SVTK if needed. /* - QString openedSvtkViewerStr = ip.getProperty( "VtkViewersCount" ).c_str(); + QString openedSvtkViewerStr = ip->getProperty( "VtkViewersCount" ).c_str(); int openedSvtkViewer = openedSvtkViewerStr.toInt( &ok ); if ( ok && openedSvtkViewer == 0 ) { lst.clear(); @@ -1996,7 +1986,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint) // if active Gauss Viewer is set ( != -1) then raise the gauss view window. bool ok; - QString activeGaussViewerStr = ip.getProperty( "ActiveGaussViewer" ).c_str(); + QString activeGaussViewerStr = ip->getProperty( "ActiveGaussViewer" ).c_str(); int activeGaussViewer = activeGaussViewerStr.toInt( &ok ); if ( ok && activeGaussViewer != -1 ) { lst.clear(); diff --git a/src/VISUGUI/VisuGUI_Module.h b/src/VISUGUI/VisuGUI_Module.h index d0c371b4..af02c8b7 100644 --- a/src/VISUGUI/VisuGUI_Module.h +++ b/src/VISUGUI/VisuGUI_Module.h @@ -38,22 +38,12 @@ class SVTK_ViewWindow; #include "MED_SharedPtr.hxx" -namespace VISU -{ - class Viewer; - typedef MED::SharedPtr PViewer; - - typedef std::map TViewerMap; -} - //! This class inherits base VisuGUI. /*! Used to display, erase end edit presentations in the VVTK viewer. */ class VisuGUI_Module: public VisuGUI { Q_OBJECT; - friend class VISU::Viewer; - public: VisuGUI_Module(); @@ -136,9 +126,6 @@ protected slots: SUIT_ViewManager* onCreateViewManager(); - void - onLastViewClosed(SUIT_ViewManager*); - void OnCreateGaussPoints(); @@ -169,7 +156,6 @@ protected slots: OnRestoreConfiguration(); protected: - VISU::TViewerMap myViewerMap; _PTR(SObject) myConfigSObject; void setProperty( SVTK_ViewWindow*, const QString& ); // set a property (speed_increment, etc ) for SVTK ViewWindow diff --git a/src/VISUGUI/VisuGUI_NameDlg.cxx b/src/VISUGUI/VisuGUI_NameDlg.cxx index c847861f..deecabdc 100644 --- a/src/VISUGUI/VisuGUI_NameDlg.cxx +++ b/src/VISUGUI/VisuGUI_NameDlg.cxx @@ -10,11 +10,16 @@ // $Header$ #include "VisuGUI_NameDlg.h" +#include "VisuGUI.h" #include #include #include #include +#include +#include + +#include #include #include @@ -73,6 +78,11 @@ VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent ) myButtonCancel->setText( tr( "BUT_CANCEL" ) ); myButtonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( myButtonCancel ); + + myButtonHelp = new QPushButton( GroupButtons, "buttonHelp" ); + myButtonHelp->setText( tr( "BUT_HELP" ) ); + myButtonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( myButtonHelp ); /***************************************************************/ topLayout->addWidget( GroupC1 ); @@ -81,6 +91,7 @@ VisuGUI_NameDlg::VisuGUI_NameDlg( QWidget* parent ) // signals and slots connections connect( myButtonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( myButtonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( myButtonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); /* Move widget on the botton right corner of main widget */ SUIT_Tools::centerWidget( this, parent ); @@ -118,6 +129,22 @@ void VisuGUI_NameDlg::accept() QDialog::accept(); } +void VisuGUI_NameDlg::onHelp() +{ + QString aHelpFileName = "/files/renaming_presentations.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + /*! Creates modal dialog and returns name entered [ static ] */ diff --git a/src/VISUGUI/VisuGUI_NameDlg.h b/src/VISUGUI/VisuGUI_NameDlg.h index 56a9819b..b12231db 100644 --- a/src/VISUGUI/VisuGUI_NameDlg.h +++ b/src/VISUGUI/VisuGUI_NameDlg.h @@ -36,10 +36,12 @@ public: protected slots: void accept(); + void onHelp(); private: QPushButton* myButtonOk; QPushButton* myButtonCancel; + QPushButton* myButtonHelp; QLineEdit* myLineEdit; }; diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.cxx b/src/VISUGUI/VisuGUI_OffsetDlg.cxx index 3fca41a1..7a28b3dc 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.cxx +++ b/src/VISUGUI/VisuGUI_OffsetDlg.cxx @@ -26,10 +26,14 @@ #include "VISU_ViewManager_i.hh" #include "VISU_Actor.h" +#include "LightApp_Application.h" #include "SalomeApp_Application.h" #include "SVTK_ViewWindow.h" #include "SVTK_ViewModel.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include "QtxDblSpinBox.h" @@ -63,25 +67,25 @@ myModule(theModule) TopLayout->setSpacing(6); TopLayout->setMargin(11); - QHBox* aOffsetsPane = new QHBox (this); - aOffsetsPane->setSpacing(6); + QHBox* anOffsetsPane = new QHBox (this); + anOffsetsPane->setSpacing(6); - new QLabel ("dX:", aOffsetsPane); - myDxEdt = new QtxDblSpinBox (aOffsetsPane, "myDxEdt"); + new QLabel ("dX:", anOffsetsPane); + myDxEdt = new QtxDblSpinBox (anOffsetsPane, "myDxEdt"); myDxEdt->setRange(-MAXVAL, MAXVAL); - new QLabel("dY:", aOffsetsPane); - myDyEdt = new QtxDblSpinBox (aOffsetsPane, "myDyEdt"); + new QLabel("dY:", anOffsetsPane); + myDyEdt = new QtxDblSpinBox (anOffsetsPane, "myDyEdt"); myDyEdt->setRange(-MAXVAL, MAXVAL); - new QLabel("dZ:", aOffsetsPane); - myDzEdt = new QtxDblSpinBox (aOffsetsPane, "myDzEdt"); + new QLabel("dZ:", anOffsetsPane); + myDzEdt = new QtxDblSpinBox (anOffsetsPane, "myDzEdt"); myDzEdt->setRange(-MAXVAL, MAXVAL); - QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), aOffsetsPane); + QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane); connect(aResetBtn, SIGNAL(clicked()), this, SLOT(onReset())); - TopLayout->addWidget(aOffsetsPane); + TopLayout->addWidget(anOffsetsPane); if (!VISU::GetCStudy(VISU::GetAppStudy(theModule))->GetProperties()->IsLocked()) { mySaveChk = new QCheckBox ("Save to presentation", this); @@ -115,37 +119,43 @@ myModule(theModule) QPushButton* buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel"); buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 4); + GroupButtonsLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 5); + + QPushButton* buttonHelp = new QPushButton(tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 6); TopLayout->addWidget(GroupButtons); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonApply, SIGNAL(clicked()), this, SLOT(onApply())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); } void VisuGUI_OffsetDlg::addPresentation (VISU::Prs3d_i* thePrs) { myPrsList.append(thePrs); - OffsetStruct aOffs; - thePrs->GetOffset(aOffs.myOffset); - myOldOffsets.append(aOffs); + CORBA::Float anOffset[3]; + thePrs->GetOffset(anOffset[0],anOffset[1],anOffset[2]); + OffsetStruct anOffs(anOffset[0],anOffset[1],anOffset[2]); + myOldOffsets.append(anOffs); if (myPrsList.count() == 1) { - setOffset(aOffs.myOffset); + setOffset(anOffs.myOffset); } else if (myPrsList.count() == 2) { - float aOffset[3]; - aOffset[0] = aOffset[1] = aOffset[2] = 0; - setOffset(aOffset); + OffsetStruct anOffs; + setOffset(anOffs.myOffset); } } -void VisuGUI_OffsetDlg::setOffset (const float* theOffset) +void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset) { myDxEdt->setValue(theOffset[0]); myDyEdt->setValue(theOffset[1]); myDzEdt->setValue(theOffset[2]); } -void VisuGUI_OffsetDlg::getOffset (float* theOffset) const +void VisuGUI_OffsetDlg::getOffset (vtkFloatingPointType* theOffset) const { theOffset[0] = myDxEdt->value(); theOffset[1] = myDyEdt->value(); @@ -167,11 +177,11 @@ bool VisuGUI_OffsetDlg::isToSave() const return false; } -void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset) +void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset) { if (myPrsList.count() == 0) return; - if (isToSave()) thePrs->SetOffset(theOffset); + if (isToSave()) thePrs->SetOffset(theOffset[0],theOffset[1],theOffset[2]); ViewManagerList aViewManagerList; SalomeApp_Application* anApp = myModule->getApp(); @@ -203,10 +213,10 @@ void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, float* theOffset) void VisuGUI_OffsetDlg::accept() { - float aOffset[3]; - getOffset(aOffset); + vtkFloatingPointType anOffset[3]; + getOffset(anOffset); for (int i = 0; i < myPrsList.count(); i++) { - updateOffset(myPrsList.at(i), aOffset); + updateOffset(myPrsList.at(i), anOffset); } QDialog::accept(); } @@ -221,9 +231,23 @@ void VisuGUI_OffsetDlg::reject() void VisuGUI_OffsetDlg::onApply() { - float aOffset[3]; - getOffset(aOffset); + vtkFloatingPointType anOffset[3]; + getOffset(anOffset); for (int i = 0; i < myPrsList.count(); i++) { - updateOffset(myPrsList.at(i), aOffset); + updateOffset(myPrsList.at(i), anOffset); + } +} + +void VisuGUI_OffsetDlg::onHelp() +{ + QString aHelpFileName = "/files/scaling_presentations.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); } } diff --git a/src/VISUGUI/VisuGUI_OffsetDlg.h b/src/VISUGUI/VisuGUI_OffsetDlg.h index b06092f9..81a86bbb 100644 --- a/src/VISUGUI/VisuGUI_OffsetDlg.h +++ b/src/VISUGUI/VisuGUI_OffsetDlg.h @@ -21,6 +21,7 @@ #ifndef DIALOGBOX_OFFSET_H #define DIALOGBOX_OFFSET_H +#include "VTKViewer.h" #include "VISU_Prs3d_i.hh" // QT Includes @@ -31,8 +32,23 @@ class QCheckBox; class QtxDblSpinBox; class VisuGUI; -struct OffsetStruct { - float myOffset[3]; +struct OffsetStruct +{ + vtkFloatingPointType myOffset[3]; + + OffsetStruct() + { + myOffset[0] = myOffset[1] = myOffset[2] = 0; + } + + OffsetStruct(vtkFloatingPointType theX, + vtkFloatingPointType theY, + vtkFloatingPointType theZ) + { + myOffset[0] = theX; + myOffset[1] = theY; + myOffset[2] = theZ; + } }; class VisuGUI_OffsetDlg: public QDialog @@ -45,8 +61,8 @@ class VisuGUI_OffsetDlg: public QDialog void addPresentation (VISU::Prs3d_i* thePrs); int getPrsCount() const { return myPrsList.count(); } - void setOffset (const float* theOffset); - void getOffset (float* theOffset) const; + void setOffset (const vtkFloatingPointType* theOffset); + void getOffset (vtkFloatingPointType* theOffset) const; bool isToSave() const; public slots: @@ -56,9 +72,10 @@ class VisuGUI_OffsetDlg: public QDialog virtual void accept(); virtual void reject(); void onApply(); + void onHelp(); private: - void updateOffset (VISU::Prs3d_i* thePrs, float* theOffset); + void updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset); VisuGUI * myModule; diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx index 04ba4334..b80b5417 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.cxx +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.cxx @@ -39,6 +39,10 @@ #include "SALOME_Actor.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "LightApp_Application.h" #include #include @@ -74,20 +78,20 @@ static void renderViewFrame (SVTK_ViewWindow* vw) //======================================================================= class TPlane : public SALOME_Actor { - float mySize; + vtkFloatingPointType mySize; vtkDataSetMapper* myMapper; vtkPlaneSource* myPlaneSource; public: // constructor - TPlane(float planeSize): mySize(planeSize) + TPlane(vtkFloatingPointType planeSize): mySize(planeSize) { Init(); } // set plane parameters - void Set(float origin[3], float normal[3]) + void Set(vtkFloatingPointType origin[3], vtkFloatingPointType normal[3]) { - float point2[3], point1[3]; + vtkFloatingPointType point2[3], point1[3]; vtkMath::Perpendiculars(normal, point1, point2, 0.); for (int i = 0; i < 3; ++i) { point1[ i ] = point1[ i ] * mySize + origin[ i ]; @@ -281,7 +285,7 @@ void VisuGUI_Plot3DPane::restorePrsParams() void VisuGUI_Plot3DPane::onPositionSpn() { if (myPrs && !RelativeChkB->isChecked()) { - float minPos, maxPos; + vtkFloatingPointType minPos, maxPos; storePrsParams(); myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos); restorePrsParams(); @@ -319,7 +323,7 @@ void VisuGUI_Plot3DPane::orientationChanged(int Id) //======================================================================= void VisuGUI_Plot3DPane::onRelativePos(bool isRelativePos) { - float minPos = 0., maxPos = 1., pos = PositionSpn->value(); + vtkFloatingPointType minPos = 0., maxPos = 1., pos = PositionSpn->value(); if (myPrs) { storePrsParams(); myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos); @@ -372,7 +376,7 @@ void VisuGUI_Plot3DPane::updatePreview() } // set plane parameters corresponding to control values storePrsParams(); - float normal[3], origin[3]; + vtkFloatingPointType normal[3], origin[3]; myPrs->GetPlot3DPL()->GetBasePlane(origin, normal, true); planePreview->Set(origin, normal); restorePrsParams(); @@ -539,12 +543,16 @@ VisuGUI_Plot3DDlg::VisuGUI_Plot3DDlg (SalomeApp_Module* theModule) QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel"); buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); TopLayout->addWidget(GroupButtons); // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); } //======================================================================= @@ -571,3 +579,23 @@ void VisuGUI_Plot3DDlg::reject() QDialog::reject(); } + +//======================================================================= +//function : onHelp +//purpose : +//======================================================================= +void VisuGUI_Plot3DDlg::onHelp() +{ + QString aHelpFileName = "plot_3d_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_Plot3DDlg.h b/src/VISUGUI/VisuGUI_Plot3DDlg.h index a1e59f90..325441f5 100644 --- a/src/VISUGUI/VisuGUI_Plot3DDlg.h +++ b/src/VISUGUI/VisuGUI_Plot3DDlg.h @@ -110,6 +110,7 @@ class VisuGUI_Plot3DDlg : public QDialog protected slots: void accept(); void reject(); + void onHelp(); private: VisuGUI_Plot3DPane* myIsoPane; diff --git a/src/VISUGUI/VisuGUI_PopupTools.cxx b/src/VISUGUI/VisuGUI_PopupTools.cxx index 68299777..0f5c8c8b 100644 --- a/src/VISUGUI/VisuGUI_PopupTools.cxx +++ b/src/VISUGUI/VisuGUI_PopupTools.cxx @@ -31,6 +31,7 @@ #include "VisuGUI_Tools.h" #include "VISU_Result_i.hh" +#include "VISU_Gen_i.hh" #include "VISU_Actor.h" #include "VISU_ScalarMapAct.h" @@ -61,6 +62,7 @@ QtxValue VisuGUI_Selection::param( const int ind, const QString& p ) const else if ( p == "hasActor" ) val = QtxValue( hasActor( ind ) ); else if ( p == "isShading" ) val = QtxValue( isShading( ind ) ); else if ( p == "isScalarMapAct" ) val = QtxValue( isScalarMapAct( ind ) ); + else if ( p == "isVisuComponent") val = QtxValue( isVisuComponent( ind ) ); } return val; @@ -172,7 +174,7 @@ QString VisuGUI_Selection::medEntity( const int ind ) const QString VisuGUI_Selection::medSource( const int ind ) const { _PTR(Study) aStudyDS = GetStudy()->studyDS(); - if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind))){ + if(_PTR(SObject) aSObject = aStudyDS->FindObjectID(entry(ind).latin1())){ VISU::Result_var aRes; if(VISU::Result_i* aResult = CheckResult(myModule,aSObject,aRes)){ using namespace VISU; @@ -355,3 +357,19 @@ QString VisuGUI_Selection::isScalarMapAct( const int ind ) const return aResStr; } + +bool VisuGUI_Selection::isVisuComponent( const int ind ) const +{ + SalomeApp_Study* study = GetStudy(); + if ( !study ) + return false; + + _PTR(SObject) obj = study->studyDS()->FindObjectID( entry( ind ).latin1() ); + if ( !obj ) + return false; + CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj ); + if( CORBA::is_nil( anObj ) ) + return false; + + return dynamic_cast( VISU::GetServant( anObj ).in() ); +} diff --git a/src/VISUGUI/VisuGUI_PopupTools.h b/src/VISUGUI/VisuGUI_PopupTools.h index 1a7ae957..9476353d 100644 --- a/src/VISUGUI/VisuGUI_PopupTools.h +++ b/src/VISUGUI/VisuGUI_PopupTools.h @@ -59,6 +59,7 @@ private: QString hasActor( const int ) const; QString isShading( const int ) const; QString isScalarMapAct( const int ) const; + bool isVisuComponent( const int ) const; private: int nbChild( const int, const bool ) const; diff --git a/src/VISUGUI/VisuGUI_Prs3dTools.h b/src/VISUGUI/VisuGUI_Prs3dTools.h index 3fc626bb..7b55eefc 100644 --- a/src/VISUGUI/VisuGUI_Prs3dTools.h +++ b/src/VISUGUI/VisuGUI_Prs3dTools.h @@ -245,13 +245,11 @@ namespace VISU void CreatePrs3d(VisuGUI* theModule) { - if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()) { - QString aType = aViewManager->getType(); - if (aType == VVTK_Viewer::Type()) - CreatePrs3d(theModule); - else - CreatePrs3d(theModule); - } + if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()) + if (aViewManager->getType() == VVTK_Viewer::Type()) + return CreatePrs3d(theModule); + + CreatePrs3d(theModule); } } diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx index 54c96b88..d26d9940 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.cxx @@ -42,8 +42,9 @@ #include "VISU_ScalarMap_i.hh" #include "VISU_ScalarMapAct.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" +#include "SUIT_Session.h" #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" @@ -63,16 +64,16 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane (QWidget * parent, bool SetPref): SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); QString propertyName; propertyName = QString("scalar_bar_vertical_"); - myVerX = aResourceMgr->doubleValue("VISU", propertyName + "x", myVerX); - myVerY = aResourceMgr->doubleValue("VISU", propertyName + "y", myVerY); - myVerW = aResourceMgr->doubleValue("VISU", propertyName + "width", myVerW); - myVerH = aResourceMgr->doubleValue("VISU", propertyName + "height",myVerH); + myVerX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.); + myVerY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.); + myVerW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.); + myVerH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.); propertyName = QString("scalar_bar_horizontal_"); - myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", myHorX); - myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", myHorY); - myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", myHorW); - myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",myHorH); + myHorX = aResourceMgr->doubleValue("VISU", propertyName + "x", 0.); + myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.); + myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.); + myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.); Imin = 0.0; Imax = 0.0; /*Fmin = 0.0; Fmax = 0.0;*/ Rmin = 0.0; Rmax = 0.0; myRangeMode = -1; @@ -548,6 +549,7 @@ void VisuGUI_ScalarBarPane::storeToResources() { void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { initFromResources(); myScalarMap = thePrs; + myTitle = thePrs->GetTitle(); setPosAndSize( thePrs->GetPosX(), thePrs->GetPosY(), thePrs->GetWidth(), @@ -560,7 +562,7 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { default: setLogarithmic(false); } - float aRange[2]; + vtkFloatingPointType aRange[2]; thePrs->GetScalarMapPL()->GetSourceRange(aRange); Rmin = aRange[0]; Rmax = aRange[1]; setRange( thePrs->GetMin(), thePrs->GetMax(), @@ -576,13 +578,13 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { const VISU::TNames& aCompNames = aField->myCompNames; const VISU::TNames& aUnitNames = aField->myUnitNames; for(int i = 0; i < aNbComp; i++){ - QString aComponent = QString(aCompNames[i]).simplifyWhiteSpace(); + QString aComponent = QString(aCompNames[i].c_str()).simplifyWhiteSpace(); if(aComponent.isNull() || aComponent == "") aComponent = "Component " + QString::number(i+1); else aComponent = "[" + QString::number(i+1) + "] " + aComponent; - QString anUnit = QString(aUnitNames[i]).simplifyWhiteSpace(); + QString anUnit = QString(aUnitNames[i].c_str()).simplifyWhiteSpace(); if(anUnit.isNull() || anUnit == "") anUnit = "-"; @@ -602,7 +604,7 @@ void VisuGUI_ScalarBarPane::initFromPrsObject(VISU::ScalarMap_i* thePrs) { // "Title" myTextDlg->setTitleText(QString(thePrs->GetTitle())); - float R, G, B; + vtkFloatingPointType R, G, B; thePrs->GetTitleColor(&R, &G, &B); myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)), @@ -649,7 +651,10 @@ void VisuGUI_ScalarBarPane::createScalarBar() if (myScalarMap == NULL) return; if (!check()) return; - + myScalarMapPL = VISU_ScalarMapPL::New(); + if(myScalarMap->GetScalarMapPL()) + myScalarMapPL->ShallowCopy(myScalarMap->GetScalarMapPL()); + if ( myBusy ) return; myBusy = true; @@ -666,31 +671,25 @@ void VisuGUI_ScalarBarPane::createScalarBar() myPreviewActor->GetScalarBar()->VisibilityOn(); myPreviewActor->PickableOff(); - myScalarMap->SetScalarMode(myModeCombo->currentItem()); - myScalarMap->SetPosition(getX(),getY()); - myScalarMap->SetSize(getWidth(),getHeight()); - myScalarMap->SetBarOrientation((RBvert->isChecked())? VISU::ScalarMap::VERTICAL : VISU::ScalarMap::HORIZONTAL); + myScalarMapPL->SetScalarMode(myModeCombo->currentItem()); if(isLogarithmic()) - myScalarMap->SetScaling(VISU::LOGARITHMIC); + myScalarMapPL->SetScaling(VISU::LOGARITHMIC); else - myScalarMap->SetScaling(VISU::LINEAR); - if (RBFrange->isChecked()) { - myScalarMap->SetSourceRange(); - } else { - myScalarMap->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble()); - } - myScalarMap->SetNbColors(sbCol); - myScalarMap->SetLabels(sbLab); + myScalarMapPL->SetScaling(VISU::LINEAR); + vtkFloatingPointType theRange[2]; + theRange[0] = (vtkFloatingPointType)MinEdit->text().toDouble(); + theRange[1] = (vtkFloatingPointType)MaxEdit->text().toDouble(); + myScalarMapPL->SetScalarRange(theRange); + myScalarMapPL->SetNbColors(sbCol); - myScalarMap->GetScalarMapPL()->SetNbColors(sbCol); - myScalarMap->GetScalarMapPL()->Update(); - - aScalarBarActor->SetLookupTable(myScalarMap->GetScalarMapPL()->GetBarTable()); + myScalarMapPL->Update(); + + aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable()); if (myTextDlg->getTitleText().latin1() != "") aScalarBarActor->SetTitle(myTextDlg->getTitleText().latin1()); else - aScalarBarActor->SetTitle(myScalarMap->GetTitle()); + aScalarBarActor->SetTitle(myTitle.c_str()); aScalarBarActor->SetOrientation(getOrientation()); aScalarBarActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport(); aScalarBarActor->GetPositionCoordinate()->SetValue(getX(),getY()); @@ -709,9 +708,9 @@ void VisuGUI_ScalarBarPane::createScalarBar() isTitleBold,isTitleItalic,isTitleShadow); vtkTextProperty* aTitleProp = aScalarBarActor->GetTitleTextProperty(); aTitleProp->SetFontFamily(aTitleFontFamily); - aTitleProp->SetColor(float(aTitleColor.red())/255., - float(aTitleColor.green())/255., - float(aTitleColor.blue())/255.); + aTitleProp->SetColor(vtkFloatingPointType(aTitleColor.red())/255., + vtkFloatingPointType(aTitleColor.green())/255., + vtkFloatingPointType(aTitleColor.blue())/255.); (isTitleBold)? aTitleProp->BoldOn() : aTitleProp->BoldOff(); (isTitleItalic)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff(); (isTitleShadow)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff(); @@ -726,9 +725,9 @@ void VisuGUI_ScalarBarPane::createScalarBar() isLabelBold, isLabelItalic, isLabelShadow); vtkTextProperty* aLabelProp = aScalarBarActor->GetLabelTextProperty(); aLabelProp->SetFontFamily(aLabelFontFamily); - aLabelProp->SetColor(float(aLabelColor.red())/255., - float(aLabelColor.green())/255., - float(aLabelColor.blue())/255.); + aLabelProp->SetColor(vtkFloatingPointType(aLabelColor.red())/255., + vtkFloatingPointType(aLabelColor.green())/255., + vtkFloatingPointType(aLabelColor.blue())/255.); (isLabelBold)? aLabelProp->BoldOn() : aLabelProp->BoldOff(); (isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff(); (isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff(); @@ -746,18 +745,25 @@ void VisuGUI_ScalarBarPane::deleteScalarBar() if ( myBusy ) return; if (myPreviewActor == 0) return; - if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()){ - vf->RemoveActor(myPreviewActor); - myPreviewActor->GetScalarBar()->VisibilityOff(); - } + vtkRenderer* aRend = myPreviewActor->GetRenderer(); + if(aRend) + myPreviewActor->RemoveFromRender(aRend); + myPreviewActor->GetScalarBar()->VisibilityOff(); myPreviewActor->Delete(); myPreviewActor = 0; + + if (myScalarMapPL){ + myScalarMapPL->Delete(); + myScalarMapPL = 0; + } } /*! public: Deleting preview scalar bar */ void VisuGUI_ScalarBarPane::deletePreview() { deleteScalarBar(); + if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow()) + vf->Repaint(); } /** * Store values to presentation object @@ -820,6 +826,7 @@ int VisuGUI_ScalarBarPane::storeToPrsObject(VISU::ScalarMap_i* thePrs) { thePrs->SetLabelColor(aLblColor.red()/255., aLblColor.green()/255., aLblColor.blue()/255.); + myIsStoreTextProp = false; } return 1; @@ -905,13 +912,16 @@ void VisuGUI_ScalarBarPane::changeScalarMode( int theMode ) { if ( myScalarMap ) { if ( RBFrange->isChecked() ) { - float aRange[2]; + vtkFloatingPointType aRange[2]; + int aMode = myScalarMap->GetScalarMode(); myScalarMap->SetScalarMode(theMode); myScalarMap->GetScalarMapPL()->GetSourceRange(aRange); MinEdit->setText( QString::number( aRange[0] ) ); MaxEdit->setText( QString::number( aRange[1] ) ); + myScalarMap->SetScalarMode(aMode); } } + updatePreview(); } /*! @@ -1037,7 +1047,8 @@ bool VisuGUI_ScalarBarPane::check() void VisuGUI_ScalarBarPane::onTextPref() { - myIsStoreTextProp = myTextDlg->exec(); + myTextDlg->storeBeginValues(); + myIsStoreTextProp = myTextDlg->exec() || myIsStoreTextProp; updatePreview(); } @@ -1093,10 +1104,15 @@ VisuGUI_ScalarBarDlg::VisuGUI_ScalarBarDlg (SalomeApp_Module* theModule, bool Se buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( GroupButtons ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } /*! @@ -1120,6 +1136,25 @@ void VisuGUI_ScalarBarDlg::reject() QDialog::reject(); } +/*! + Called when button is clicked, shows the corresponding help page in defined browser +*/ +void VisuGUI_ScalarBarDlg::onHelp() +{ + QString aHelpFileName = "/files/scalar_map_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //####################################################################################### VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent) @@ -1176,8 +1211,57 @@ VisuGUI_TextPrefDlg::VisuGUI_TextPrefDlg (QWidget* parent) buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( GroupButtons ); connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); +} + +void VisuGUI_TextPrefDlg::onHelp() +{ + QString aHelpFileName = "/files/scalar_map_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + +void VisuGUI_TextPrefDlg::storeBeginValues() +{ + myTitle = myTitleEdt->text(); + myTitleFont->GetData(myColors[0], myComboVals[0], myCheckVals[0], myCheckVals[1], myCheckVals[2]); + myLabelFont->GetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]); +} + +/*! + Called when button is clicked, restore begin values +*/ +void VisuGUI_TextPrefDlg::reject() +{ + myTitleEdt->setText(myTitle); + myTitleFont->SetData(myColors[0], myComboVals[0], myCheckVals[0], myCheckVals[1], myCheckVals[2]); + myLabelFont->SetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]); + + QDialog::reject(); +} +/*! + Called when button is clicked, store begin values +*/ +void VisuGUI_TextPrefDlg::accept() +{ + storeBeginValues(); + + QDialog::accept(); } diff --git a/src/VISUGUI/VisuGUI_ScalarBarDlg.h b/src/VISUGUI/VisuGUI_ScalarBarDlg.h index 4f53a39b..63284e83 100644 --- a/src/VISUGUI/VisuGUI_ScalarBarDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarBarDlg.h @@ -77,12 +77,23 @@ class VisuGUI_TextPrefDlg: public QDialog void setTitleVisible (bool isVisible) { (isVisible)? myTitleEdt->show() : myTitleEdt->hide(); } + void storeBeginValues(); + public: SVTK_FontWidget* myTitleFont; SVTK_FontWidget* myLabelFont; + protected slots: + void accept(); + void reject(); + void onHelp(); + private: QLineEdit* myTitleEdt; + QString myTitle; + QColor myColors[2]; + int myComboVals[2]; + bool myCheckVals[6]; }; @@ -169,6 +180,8 @@ class VisuGUI_ScalarBarPane : public QVBox QCheckBox* myPreviewCheck; VISU_ScalarMapAct* myPreviewActor; VISU::ScalarMap_i* myScalarMap; + VISU_ScalarMapPL* myScalarMapPL; + std::string myTitle; bool myBusy; }; @@ -193,6 +206,7 @@ class VisuGUI_ScalarBarDlg : public QDialog protected slots: void accept(); void reject(); + void onHelp(); protected: VisuGUI_ScalarBarPane* myScalarPane; diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx index 54f79c9c..cc87ab69 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx @@ -38,8 +38,12 @@ #include "VISU_Convertor.hxx" #include "SalomeApp_Module.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SUIT_Desktop.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" #include "SALOME_ListIO.hxx" @@ -139,6 +143,10 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome buttonCancel->setAutoDefault(TRUE); GroupButtonsLayout->addWidget(buttonCancel, 0, 2); + QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp"); + buttonHelp->setAutoDefault(TRUE); + GroupButtonsLayout->addWidget(buttonHelp, 0, 3); + // Add Tab box and Buttons to the top layout TopLayout->addWidget(aTabBox); TopLayout->addWidget(GroupButtons); @@ -146,6 +154,7 @@ VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (Salome // signals and slots connections connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp())); connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int))); connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int))); } @@ -159,7 +168,7 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject setFactor(myPrs->GetScale()); myTimeStampsCombo->setDisabled(isAnim); - QString aFieldName(myPrs->GetScalarFieldName()); + QString aFieldName(myPrs->GetScalarFieldName().c_str()); float aIterFloat = GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(), myPrs->GetScalarFieldName().c_str(), myPrs->GetScalarIteration(), @@ -379,6 +388,20 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::reject() QDialog::reject(); } +void VisuGUI_ScalarMapOnDeformedShapeDlg::onHelp() +{ + QString aHelpFileName = "scalar_map_on_deformed_shape_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){ TMF::const_iterator aIterMesh = myMeshFieldsTimes.begin(); for(;aIterMesh != myMeshFieldsTimes.end();aIterMesh++){ @@ -421,7 +444,7 @@ void VisuGUI_ScalarMapOnDeformedShapeDlg::onTimeStampChanged(int){ void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){ myPrs->SetScale(getFactor()); - float aRange[2]; + vtkFloatingPointType aRange[2]; myPrs->GetScalarMapOnDeformedShapePL()->Build(); myPrs->GetScalarMapOnDeformedShapePL()->Update(); myPrs->GetScalarMapOnDeformedShapePL()->GetSourceRange(aRange); diff --git a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h index 6bc817c6..720a470e 100644 --- a/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h +++ b/src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.h @@ -74,6 +74,7 @@ public: protected slots: void accept(); void reject(); + void onHelp(); private slots: void onFieldChanged(int i=0); diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index 371d50a5..46549cc5 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -39,12 +39,14 @@ #include "SalomeApp_Study.h" #include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "LightApp_VTKSelector.h" #include "SUIT_MessageBox.h" #include "SUIT_ViewWindow.h" #include "SUIT_Session.h" +#include "SUIT_ResourceMgr.h" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" @@ -250,6 +252,9 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule): QPushButton* aCloseBtn = new QPushButton (tr("BUT_CLOSE"), aBtnBox); connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close())); + QPushButton* aHelpBtn = new QPushButton (tr("BUT_HELP"), aBtnBox); + connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); + TopLayout->addWidget(aBtnBox, 3, 0); SalomeApp_Application* anApp = dynamic_cast @@ -317,7 +322,7 @@ void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent) template QString getValue(TData* theData, int theId){ if (vtkDataArray *aScalar = theData->GetScalars()){ - float aVal = aScalar->GetTuple1(theId); + vtkFloatingPointType aVal = aScalar->GetTuple1(theId); return QString::number(aVal); } else { return QString("No data"); @@ -326,7 +331,7 @@ template QString getValue(TData* theData, int theId){ template QString getVector(TData* theData, int theId){ if (vtkDataArray *aVector = theData->GetVectors()) { - float *aVal = aVector->GetTuple3(theId); + vtkFloatingPointType *aVal = aVector->GetTuple3(theId); return QString("%1; %2; %3").arg(aVal[0]).arg(aVal[1]).arg(aVal[2]); } else { return QString("No data"); @@ -412,7 +417,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { VISU_Actor* anVISUActor = VISU::FindActor(aViewWindow, aSObject->GetID().c_str()); if (anVISUActor) { - float aCoord[6]; + vtkFloatingPointType aCoord[6]; anVISUActor->GetBounds(aCoord); myXPosLbl->setText(QString::number( aCoord[0] )); myYPosLbl->setText(QString::number( aCoord[2] )); @@ -423,7 +428,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) )); TColStd_IndexedMapOfInteger aMapIndex; - typedef map PointsMap; + typedef map PointsMap; PointsMap aPointsMap; aSelector->GetIndex(anIO, aMapIndex); @@ -437,7 +442,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { switch (aType) { case 0: { - float* aCoord = anVISUActor->GetNodeCoord(anID); + vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID); int aVTKID = anVISUActor->GetNodeVTKID(anID); myXValLbl->setText( QString::number( aCoord[0] ) ); myYValLbl->setText( QString::number( aCoord[1] ) ); @@ -461,7 +466,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { myCellScalarValLbl->setText(getValue(aCellData, aVTKID)); myCellVectorValLbl->setText(getVector(aCellData, aVTKID)); - float* aCoord; + vtkFloatingPointType* aCoord; vtkIdList *aPointList = aCell->GetPointIds(); for (int i = 0; i < aNbOfPoints; i++) { @@ -482,7 +487,7 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { myListPoints->verticalHeader()->setLabel(i, QString::number( i )); int id = It->first; myListPoints->setText(i, 0, QString::number( id )); - float* aCoord = It->second; + vtkFloatingPointType* aCoord = It->second; myListPoints->setText(i, 1, QString::number( aCoord[0] )); myListPoints->setText(i, 2, QString::number( aCoord[1] )); myListPoints->setText(i, 3, QString::number( aCoord[2] )); @@ -617,3 +622,17 @@ void VisuGUI_SelectionDlg::onCellIdEdit (const QString& theText) else clearFields(); } + +void VisuGUI_SelectionDlg::onHelp() +{ + QString aHelpFileName = "/files/getting_elements_attributes.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_Selection.h b/src/VISUGUI/VisuGUI_Selection.h index 467e9c18..0e1f873d 100644 --- a/src/VISUGUI/VisuGUI_Selection.h +++ b/src/VISUGUI/VisuGUI_Selection.h @@ -55,6 +55,7 @@ private slots: void onSelectionEvent (); void onPointIdEdit (const QString& theText); void onCellIdEdit (const QString& theText); + void onHelp(); private: void clearFields (); diff --git a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx index 120785fa..1d85acf0 100644 --- a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx +++ b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.cxx @@ -8,10 +8,15 @@ // $Header$ #include "VisuGUI_SetupPlot2dDlg.h" +#include "VisuGUI.h" #include "SPlot2d_Curve.h" #include "SUIT_Tools.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" + +#include "LightApp_Application.h" #include #include @@ -183,20 +188,24 @@ VisuGUI_SetupPlot2dDlg::VisuGUI_SetupPlot2dDlg( _PTR(SObject) object, QWidget* p myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 ); - /* OK/Cancel buttons */ + /* OK/Cancel/Help buttons */ myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" ); myOkBtn->setAutoDefault( TRUE ); myOkBtn->setDefault( TRUE ); myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" ); myCancelBtn->setAutoDefault( TRUE ); + myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this, "buttonHelp" ); + myHelpBtn->setAutoDefault( TRUE ); - topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 ); + topLayout->addMultiCellWidget( myView, 0, 0, 0, 3 ); topLayout->addWidget( myOkBtn, 1, 0 ); topLayout->setColStretch( 1, 5 ); topLayout->addWidget( myCancelBtn, 1, 2 ); + topLayout->addWidget( myHelpBtn, 1, 3 ); connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); enableControls(); @@ -426,6 +435,24 @@ void VisuGUI_SetupPlot2dDlg::onVBtnToggled( bool on ) } enableControls(); } +/*! + Slot, called when button is clicked +*/ +void VisuGUI_SetupPlot2dDlg::onHelp() +{ + QString aHelpFileName = "/files/creating_curves.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} /*! Enables/disables buttons */ diff --git a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h index 1ce1e2aa..616fc1ad 100644 --- a/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h +++ b/src/VISUGUI/VisuGUI_SetupPlot2dDlg.h @@ -46,12 +46,14 @@ public: private slots: void onHBtnToggled( bool ); void onVBtnToggled( bool ); + void onHelp(); void enableControls(); private: QScrollView* myView; QPushButton* myOkBtn; QPushButton* myCancelBtn; + QPushButton* myHelpBtn; QPtrList myItems; _PTR(SObject) myObject; diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx index e6fa3cc2..6d4196ba 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.cxx @@ -20,11 +20,13 @@ #include "VISU_Actor.h" #include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "LightApp_SelectionMgr.h" #include "SVTK_ViewWindow.h" #include "SUIT_Desktop.h" +#include "SUIT_Session.h" #include "SUIT_ResourceMgr.h" #include "SUIT_MessageBox.h" @@ -277,8 +279,14 @@ VisuGUI_StreamLinesDlg::VisuGUI_StreamLinesDlg (SalomeApp_Module* theModule) QPushButton* aCancelBtn = new QPushButton( tr( "&Cancel" ) , aGroupButtons, "buttonCancel" ); aCancelBtn->setAutoDefault( TRUE ); aGroupButtonsLayout->addWidget( aCancelBtn, 0, 2 ); + + QPushButton* aHelpBtn = new QPushButton( tr( "&Help" ) , aGroupButtons, "buttonHelp" ); + aHelpBtn->setAutoDefault( TRUE ); + aGroupButtonsLayout->addWidget( aHelpBtn, 0, 3 ); + connect( aOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( aHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); aBoxLayout->addWidget(aGroupButtons); @@ -593,3 +601,17 @@ void VisuGUI_StreamLinesDlg::reject() myScalarPane->deletePreview(); QDialog::reject(); } + +void VisuGUI_StreamLinesDlg::onHelp() +{ + QString aHelpFileName = "/files/stream_lines_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myVisuGUI ? app->moduleName(myVisuGUI->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_StreamLinesDlg.h b/src/VISUGUI/VisuGUI_StreamLinesDlg.h index c5f45e20..1c5a336f 100644 --- a/src/VISUGUI/VisuGUI_StreamLinesDlg.h +++ b/src/VISUGUI/VisuGUI_StreamLinesDlg.h @@ -40,6 +40,7 @@ public: protected slots: void accept(); void reject(); + void onHelp(); private slots: void onSelectionActive(bool theActive); diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.cxx b/src/VISUGUI/VisuGUI_TimeAnimation.cxx index de4de17e..895d10fb 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.cxx +++ b/src/VISUGUI/VisuGUI_TimeAnimation.cxx @@ -42,12 +42,14 @@ #include "VISU_Actor.h" #include "SalomeApp_Study.h" -#include "SalomeApp_Application.h" +#include "LightApp_Application.h" #include "SVTK_ViewWindow.h" #include "SUIT_OverrideCursor.h" #include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" #include "SUIT_Desktop.h" #include "SUIT_FileDlg.h" @@ -285,14 +287,12 @@ void ArrangeDlg::acceptAnimation() } } else { QApplication::setOverrideCursor( Qt::waitCursor ); - FieldData& aData = myAnimator->getFieldData(0); + FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem()); if (aData.myPrs.empty()) - myAnimator->generatePresentations(0); - VISU_Actor* aActor = aData.myPrs[0]->CreateActor(); - float aBounds[6]; - aActor->GetBounds(aBounds); - aActor->Delete(); - float aDist = 0; + myAnimator->generatePresentations(myFieldLst->currentItem()); + vtkFloatingPointType aBounds[6]; + aData.myPrs[0]->GetBounds(aBounds); + vtkFloatingPointType aDist = 0; int aAxis = getAxis(); switch (aAxis) { case XAxis: @@ -305,10 +305,10 @@ void ArrangeDlg::acceptAnimation() aDist = fabs(aBounds[5] - aBounds[4]); } - float dx = fabs(aBounds[1] - aBounds[0]); - float dy = fabs(aBounds[3] - aBounds[2]); - float dz = fabs(aBounds[5] - aBounds[4]); - float max = (dx > dy) ? dx : dy; + vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]); + vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]); + vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]); + vtkFloatingPointType max = (dx > dy) ? dx : dy; max = (dz > max) ? dz : max; max /= 100.0; @@ -351,13 +351,13 @@ void ArrangeDlg::acceptViewWindow() anActor->SetPosition(aOffs.myOffset); if (mySaveChk) if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffs.myOffset); + aPrs->SetOffset(aOffs.myOffset[0],aOffs.myOffset[1],aOffs.myOffset[2]); } } else { - float aDist = 0; - float aShift = 0; - float aPrevDist = 0; - float aPrevShift = 0; + vtkFloatingPointType aDist = 0; + vtkFloatingPointType aShift = 0; + vtkFloatingPointType aPrevDist = 0; + vtkFloatingPointType aPrevShift = 0; int i; QMap::Iterator it; for (it = myPrsMap.begin(), i = 0; it != myPrsMap.end(); ++it, i++) { @@ -365,12 +365,12 @@ void ArrangeDlg::acceptViewWindow() if (VISU_Actor* aActor = VISU::GetActor(aPrs, myViewWindow)) { int aAxis = getAxis(); - float aZeroOffset[3]; + vtkFloatingPointType aZeroOffset[3]; aZeroOffset[0] = aZeroOffset[1] = aZeroOffset[2] = 0; aActor->SetPosition(aZeroOffset); aActor->GetMapper()->Update(); - float aBounds[6]; + vtkFloatingPointType aBounds[6]; aActor->GetBounds(aBounds); switch (aAxis) { case XAxis: @@ -382,18 +382,18 @@ void ArrangeDlg::acceptViewWindow() case ZAxis: aDist = fabs(aBounds[5] - aBounds[4]); } - float aOffset[3]; + vtkFloatingPointType aOffset[3]; aOffset[0] = aOffset[1] = aOffset[2] = 0; aOffset[aAxis] = (aBounds[2*aAxis+1] < aBounds[2*aAxis]) ? -aBounds[2*aAxis+1] : -aBounds[2*aAxis]; if (i > 0) { - float aCCDist = (aDist + aPrevDist) / 2.0; + vtkFloatingPointType aCCDist = (aDist + aPrevDist) / 2.0; - float dx = fabs(aBounds[1] - aBounds[0]); - float dy = fabs(aBounds[3] - aBounds[2]); - float dz = fabs(aBounds[5] - aBounds[4]); - float max = (dx > dy) ? dx : dy; + vtkFloatingPointType dx = fabs(aBounds[1] - aBounds[0]); + vtkFloatingPointType dy = fabs(aBounds[3] - aBounds[2]); + vtkFloatingPointType dz = fabs(aBounds[5] - aBounds[4]); + vtkFloatingPointType max = (dx > dy) ? dx : dy; max = (dz > max) ? dz : max; max /= 100.0; @@ -428,7 +428,7 @@ void ArrangeDlg::acceptViewWindow() aActor->SetPosition(aOffset); if (mySaveChk) if (mySaveChk->isChecked()) - aPrs->SetOffset(aOffset); + aPrs->SetOffset(aOffset[0],aOffset[1],aOffset[2]); aPrevDist = aDist; aPrevShift = aShift; @@ -738,6 +738,15 @@ void SetupDlg::onPreferencesDlg() if (aData.myPrs.empty()) myAnimator->generatePresentations(myFieldLst->currentItem()); + if(!aData.myNbFrames || !aData.myPrs[0]){ + QApplication::restoreOverrideCursor(); + SUIT_MessageBox::warn1(this, + tr("ERROR"), + VisuGUI_TimeAnimationDlg::tr("MSG_NO_ANIMATIONDATA"), + tr("&OK")); + return; + } + int aType = myComboId2TypeId[myTypeCombo->currentItem()]; switch (aType) { case TSCALARMAP_ITEM: //Scalar Map @@ -1084,6 +1093,8 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu aSaveLay->setMargin( 5 ); mySaveCheck = new QCheckBox("Save pictures to directory", aSaveBox); + connect(mySaveCheck, SIGNAL( toggled(bool)), + this, SLOT( onCheckDump(bool) )); aSaveLay->addMultiCellWidget(mySaveCheck, 0, 0, 0, 2); QLabel* aFormatLbl = new QLabel("Saving format:", aSaveBox); @@ -1105,6 +1116,8 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu aSaveLay->addWidget(myPicsFormat, 1, 2); connect(mySaveCheck, SIGNAL( toggled(bool)), myPicsFormat, SLOT( setEnabled(bool) )); + connect(myPicsFormat, SIGNAL( activated (int)), + this, SLOT( onPicsFormatChanged())); QLabel* aPathLbl = new QLabel("Path:", aSaveBox); aPathLbl->setEnabled(false); @@ -1128,6 +1141,35 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu mySaveCheck->setChecked(false); aSaveLay->addWidget(aBrowseBtn, 2, 2); + mySaveAVICheck = new QCheckBox("Save animation to AVI file", aSaveBox); + connect(mySaveAVICheck, SIGNAL( toggled(bool)), + this, SLOT( onCheckDump(bool) )); + aSaveLay->addMultiCellWidget(mySaveAVICheck, 3, 3, 0, 2); + + QLabel* aPathAVILbl = new QLabel("Path:", aSaveBox); + aPathAVILbl->setEnabled(false); + connect(mySaveAVICheck, SIGNAL( toggled(bool)), + aPathAVILbl, SLOT( setEnabled(bool) )); + aSaveLay->addWidget(aPathAVILbl, 4, 0); + + myPathAVIEdit = new QLineEdit(aSaveBox); + myPathAVIEdit->setReadOnly(true); + myPathAVIEdit->setEnabled(false); + connect(mySaveAVICheck, SIGNAL( toggled(bool)), + myPathAVIEdit, SLOT( setEnabled(bool) )); + aSaveLay->addWidget(myPathAVIEdit, 4, 1); + + QPushButton* aBrowseAVIBtn = new QPushButton("Browse...", aSaveBox); + aBrowseAVIBtn->setEnabled(false); + connect(mySaveAVICheck, SIGNAL( toggled(bool)), + aBrowseAVIBtn, SLOT( setEnabled(bool) )); + connect(aBrowseAVIBtn, SIGNAL( clicked()), + this, SLOT( onBrowseAVI() )); + aSaveLay->addWidget(aBrowseAVIBtn, 4, 2); + + mySaveAVICheck->setChecked(false); + mySaveAVICheck->setEnabled(myAnimator->checkAVIMaker()); + TopLayout->addMultiCellWidget(aSaveBox, 7, 7, 0, 3); aMainLayout->addWidget(myPlayFrame); @@ -1153,6 +1195,9 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg (VisuGUI* theModule, _PTR(Stu QPushButton* aCloseBtn = new QPushButton(tr("BUT_CLOSE"), aBtnBox); connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close())); + QPushButton* aHelpBtn = new QPushButton(tr("BUT_HELP"), aBtnBox); + connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp())); + SUIT_Study* aStudy = VISU::GetAppStudy(myModule); connect(aStudy, SIGNAL(destroyed()), this, SLOT(close())); @@ -1170,6 +1215,7 @@ VisuGUI_TimeAnimationDlg::~VisuGUI_TimeAnimationDlg() if(myAnimator != NULL){ delete myAnimator; myAnimator = NULL; + VISU::GetActiveViewWindow(myModule)->Repaint(); } } @@ -1229,9 +1275,12 @@ void VisuGUI_TimeAnimationDlg::onPlayPressed() if (myPlayBtn->isOn() && (!myAnimator->running())) { myPlayBtn->setIconSet(MYpausePixmap); if (mySaveCheck->isChecked()) { - QStrList aDumpFormats = QImageIO::outputFormats(); - myAnimator->setDumpFormat(aDumpFormats.at(myPicsFormat->currentItem())); - myAnimator->dumpTo(myPathEdit->text()); + onPicsFormatChanged(); + onPathChanged(); + + } else if (mySaveAVICheck->isChecked()) { + myAnimator->setDumpFormat("AVI"); + myAnimator->dumpTo(myPathAVIEdit->text()); } else { myAnimator->dumpTo(""); } @@ -1283,6 +1332,12 @@ void VisuGUI_TimeAnimationDlg::showEvent(QShowEvent* theEvent) mySetupDlg = new SetupDlg(this,myModule, myAnimator); } +void VisuGUI_TimeAnimationDlg::reject() +{ + close(); + QDialog::reject(); +} + //------------------------------------------------------------------------ void VisuGUI_TimeAnimationDlg::closeEvent (QCloseEvent* theEvent) { @@ -1350,9 +1405,59 @@ void VisuGUI_TimeAnimationDlg::onSetupDlg() //------------------------------------------------------------------------ void VisuGUI_TimeAnimationDlg::onBrowse() { - QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/", "Select path"); + // QString aPath = SUIT_FileDlg::getExistingDirectory(this, "/", "Select path"); + QString aDir; + if (myPathEdit->text().isEmpty()) + aDir = getenv("HOME"); + else + aDir = myPathEdit->text(); + QString aPath = SUIT_FileDlg::getExistingDirectory(this, aDir, "Select path"); if (!aPath.isEmpty()) myPathEdit->setText(Qtx::addSlash(aPath)); + onPathChanged(); +} + +//------------------------------------------------------------------------ +void VisuGUI_TimeAnimationDlg::onBrowseAVI() +{ + QStringList aFilter; + aFilter.append( "AVI Files (*.avi)" ); + aFilter.append( "All Files (*.*)" ); + + QString aDir; + if (myPathAVIEdit->text().isEmpty()) + aDir = getenv("HOME"); + else { + QFileInfo aFile(myPathAVIEdit->text()); + aDir = aFile.dirPath(true); + } + QString aPath = SUIT_FileDlg::getFileName(this, aDir, aFilter, "Select file", false); + if (!aPath.isEmpty()) + myPathAVIEdit->setText(aPath); +} + +//------------------------------------------------------------------------ +void VisuGUI_TimeAnimationDlg::onCheckDump(bool) +{ + const QObject* source = sender(); + if (source == mySaveCheck) { + if (mySaveCheck->isChecked()) { + onPicsFormatChanged(); + onPathChanged(); + if (mySaveAVICheck->isChecked()) + mySaveAVICheck->setChecked(false); + } else { + myAnimator->dumpTo(""); + } + mySaveAVICheck->setEnabled(!mySaveCheck->isChecked() && myAnimator->checkAVIMaker()); + } + else if (source == mySaveAVICheck) { + if (mySaveAVICheck->isChecked()) { + if (mySaveCheck->isChecked()) + mySaveCheck->setChecked(false); + } + mySaveCheck->setEnabled(!mySaveAVICheck->isChecked()); + } } //------------------------------------------------------------------------ @@ -1368,6 +1473,21 @@ void VisuGUI_TimeAnimationDlg::onStop() } } +//------------------------------------------------------------------------ +void VisuGUI_TimeAnimationDlg::onHelp() +{ + QString aHelpFileName = "/files/animating_presentations.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //------------------------------------------------------------------------ void VisuGUI_TimeAnimationDlg::saveToStudy() { @@ -1389,3 +1509,16 @@ void VisuGUI_TimeAnimationDlg::restoreFromStudy(_PTR(SObject) theAnimation) myAnimator->restoreFromStudy(theAnimation); mySaveBtn->setEnabled(myAnimator->isSavedInStudy()); } + +//------------------------------------------------------------------------ +void VisuGUI_TimeAnimationDlg::onPicsFormatChanged() +{ + QStrList aDumpFormats = QImageIO::outputFormats(); + myAnimator->setDumpFormat(aDumpFormats.at(myPicsFormat->currentItem())); +} + +//------------------------------------------------------------------------ +void VisuGUI_TimeAnimationDlg::onPathChanged() +{ + myAnimator->dumpTo(myPathEdit->text()); +} diff --git a/src/VISUGUI/VisuGUI_TimeAnimation.h b/src/VISUGUI/VisuGUI_TimeAnimation.h index 53191604..a96a6f2e 100644 --- a/src/VISUGUI/VisuGUI_TimeAnimation.h +++ b/src/VISUGUI/VisuGUI_TimeAnimation.h @@ -12,13 +12,17 @@ #define VISUGUI_TIMEANIMATION_H #include "QtxDblSpinBox.h" - #include "SALOMEDSClient_Study.hxx" +#include "VTKViewer.h" + #include #include #include +#include +#include + class VisuGUI; class VISU_TimeAnimation; @@ -61,7 +65,7 @@ class ArrangeDlg: public QDialog private: struct Offset { - float myOffset[3]; + vtkFloatingPointType myOffset[3]; }; @@ -137,6 +141,7 @@ class VisuGUI_TimeAnimationDlg: public QDialog protected: virtual void closeEvent(QCloseEvent* theEvent); virtual void showEvent(QShowEvent* theEvent); + virtual void reject(); void stopAnimation(); private slots: @@ -152,9 +157,16 @@ class VisuGUI_TimeAnimationDlg: public QDialog void onSpeedChange(double theSpeed); void onExecution(long theNewFrame, double theTime); void onBrowse(); + void onBrowseAVI(); + void onCheckDump(bool); void onStop(); + void onHelp(); void saveToStudy(); void publishToStudy(); + /*!Sets dump format for myAnimator (setDumpFormat(...)), from myPicsFormat.*/ + void onPicsFormatChanged(); + /*!Sets path for myAnimator (dumpTo(...)), from myPathEdit.*/ + void onPathChanged(); private: QSlider* mySlider; @@ -177,6 +189,9 @@ class VisuGUI_TimeAnimationDlg: public QDialog bool isClosing; QCloseEvent* myEvent; + QCheckBox* mySaveAVICheck; + QLineEdit* myPathAVIEdit; + QPushButton* myPublishBtn; QPushButton* mySaveBtn; }; diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 757b1749..4427982a 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -60,6 +60,7 @@ #include "SPlot2d_ViewModel.h" #include "Plot2d_ViewFrame.h" +#include "Plot2d_ViewManager.h" #include "SUIT_Session.h" #include "SUIT_MessageBox.h" @@ -616,7 +617,7 @@ namespace VISU QApplication::setOverrideCursor( Qt::waitCursor ); try { - if (aActor = thePrs->CreateActor()) + if ((aActor = thePrs->CreateActor())) theViewWindow->AddActor(aActor); } catch(std::exception& exc) { SUIT_MessageBox::warn1 @@ -705,15 +706,17 @@ namespace VISU QApplication::restoreOverrideCursor(); } - static bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow, - float allBounds[6], - const char* theActorClassName = "VISU_Actor") + static + bool + ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow, + vtkFloatingPointType allBounds[6], + const char* theActorClassName = "VISU_Actor") { vtkRenderer *aRen = theViewWindow->getRenderer(); vtkActorCollection *anActColl = aRen->GetActors(); vtkProp *prop; - float *bounds; - int somethingVisible = false; + vtkFloatingPointType *bounds; + int somethingVisible = false; allBounds[0] = allBounds[2] = allBounds[4] = VTK_LARGE_FLOAT; allBounds[1] = allBounds[3] = allBounds[5] = -VTK_LARGE_FLOAT; @@ -743,14 +746,14 @@ namespace VISU void SetFitAll(SVTK_ViewWindow* theViewWindow) { - static float PRECISION = 0.000001; - static float DEVIATION = 600; - float XYZ_Bnd[6]; + static vtkFloatingPointType PRECISION = 0.000001; + static vtkFloatingPointType DEVIATION = 600; + vtkFloatingPointType XYZ_Bnd[6]; if (!ComputeVisiblePropBounds(theViewWindow, XYZ_Bnd)) return; - float absX = XYZ_Bnd[1] - XYZ_Bnd[0]; - float absY = XYZ_Bnd[3] - XYZ_Bnd[2]; - float absZ = XYZ_Bnd[5] - XYZ_Bnd[4]; + vtkFloatingPointType absX = XYZ_Bnd[1] - XYZ_Bnd[0]; + vtkFloatingPointType absY = XYZ_Bnd[3] - XYZ_Bnd[2]; + vtkFloatingPointType absZ = XYZ_Bnd[5] - XYZ_Bnd[4]; enum CameraOrient {e3D, eFront, eLeft, eTop}; CameraOrient aCameraOrient = e3D; @@ -761,9 +764,9 @@ namespace VISU if (absZ <= PRECISION) aCameraOrient = eTop; else { // all the three dimensions exceeds precision - float dev_abs_XY = absX / absY; - float dev_abs_YZ = absY / absZ; - float dev_abs_XZ = absX / absZ; + vtkFloatingPointType dev_abs_XY = absX / absY; + vtkFloatingPointType dev_abs_YZ = absY / absZ; + vtkFloatingPointType dev_abs_XZ = absX / absZ; if (dev_abs_XY >= DEVIATION || 1./dev_abs_YZ >= DEVIATION) aCameraOrient = eLeft; else { @@ -936,6 +939,33 @@ namespace VISU aPlot->Repaint(); } + void + PlotRemoveCurve(const SalomeApp_Module* theModule, + VISU::Curve_i* pCrv) + { + QString anEntry = pCrv->GetEntry(); + ViewManagerList pvm_list; + theModule->getApp()->viewManagers( SPlot2d_Viewer::Type(), pvm_list ); + for( SUIT_ViewManager* mgr = pvm_list.first(); mgr; mgr = pvm_list.next() ){ + Plot2d_ViewManager* pvm = dynamic_cast( mgr ); + if( pvm ){ + SPlot2d_Viewer* aSPlot2d = dynamic_cast( pvm->getViewModel() ); + if( aSPlot2d ){ + Plot2d_ViewFrame* aPlot = aSPlot2d->getActiveViewFrame(); + if(aPlot){ + QList clist; + aPlot->getCurves( clist ); + for (int i = 0; i < clist.count(); i++) { + if(SPlot2d_Curve* plotCurve = dynamic_cast(clist.at(i))) + if(plotCurve->hasIO() && (plotCurve->getIO()->getEntry() == anEntry)) + aPlot->eraseCurve(clist.at(i)); + } + } + } + } + } + } + void PlotContainer(const SalomeApp_Module* theModule, VISU::Container_i* container, diff --git a/src/VISUGUI/VisuGUI_Tools.h b/src/VISUGUI/VisuGUI_Tools.h index af166ad6..1d1418e8 100644 --- a/src/VISUGUI/VisuGUI_Tools.h +++ b/src/VISUGUI/VisuGUI_Tools.h @@ -161,6 +161,8 @@ namespace VISU { void PlotCurve( const SalomeApp_Module* theModule, VISU::Curve_i* curve, int theDisplaying ); + void PlotRemoveCurve(const SalomeApp_Module* theModule, + VISU::Curve_i* curve); void PlotContainer( const SalomeApp_Module* theModule, VISU::Container_i* container, int theDisplaying ); diff --git a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx index b9556c4c..9c093759 100644 --- a/src/VISUGUI/VisuGUI_TransparencyDlg.cxx +++ b/src/VISUGUI/VisuGUI_TransparencyDlg.cxx @@ -35,6 +35,9 @@ #include "SUIT_Desktop.h" #include "SUIT_OverrideCursor.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" @@ -42,6 +45,7 @@ #include "LightApp_Study.h" #include "LightApp_SelectionMgr.h" +#include "LightApp_Application.h" #include "SVTK_ViewWindow.h" @@ -128,9 +132,14 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule, buttonOk->setText(tr("BUT_CLOSE")); buttonOk->setAutoDefault(TRUE); buttonOk->setDefault(TRUE); - GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0); - GroupButtonsLayout->addWidget(buttonOk, 0, 1); - GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2); + + buttonHelp = new QPushButton(GroupButtons, "buttonHelp"); + buttonHelp->setText(tr("BUT_HELP")); + buttonHelp->setAutoDefault(TRUE); + + GroupButtonsLayout->addWidget(buttonOk, 0, 0); + GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1); + GroupButtonsLayout->addWidget(buttonHelp, 0, 2); VisuGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0); VisuGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0); @@ -140,6 +149,7 @@ VisuGUI_TransparencyDlg::VisuGUI_TransparencyDlg( VisuGUI* theModule, // signals and slots connections : after ValueHasChanged() connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp())); connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency())); connect(Slider1, SIGNAL(sliderMoved(int)), this, SLOT(ValueHasChanged())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged())); @@ -163,6 +173,26 @@ void VisuGUI_TransparencyDlg::ClickOnOk() close(); } +//======================================================================= +// function : ClickOnHelp() +// purpose : +//======================================================================= +void VisuGUI_TransparencyDlg::ClickOnHelp() +{ + QString aHelpFileName = "/files/changing_visualization_parameters_of_the_presenetation.htm#Changing3"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + //================================================================================= // function : SetTransparency() // purpose : Called when value of slider change diff --git a/src/VISUGUI/VisuGUI_TransparencyDlg.h b/src/VISUGUI/VisuGUI_TransparencyDlg.h index 6dbc9437..7787d70b 100644 --- a/src/VISUGUI/VisuGUI_TransparencyDlg.h +++ b/src/VISUGUI/VisuGUI_TransparencyDlg.h @@ -61,6 +61,7 @@ private : SVTK_ViewWindow* myViewWindow; QPushButton* buttonOk; + QPushButton* buttonHelp; QLabel* TextLabelOpaque; QLabel* ValueLab; QLabel* TextLabelTransparent; @@ -68,6 +69,7 @@ private : public slots: void ClickOnOk(); + void ClickOnHelp(); void ValueHasChanged(); void SetTransparency(); void onSelectionChanged(); diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.cxx b/src/VISUGUI/VisuGUI_VectorsDlg.cxx index a5e2f2c5..e16e94bc 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.cxx +++ b/src/VISUGUI/VisuGUI_VectorsDlg.cxx @@ -33,9 +33,13 @@ #include "VisuGUI_Tools.h" #include "VISU_Vectors_i.hh" - +#include "LightApp_Application.h" #include "SalomeApp_Module.h" + #include "SUIT_Desktop.h" +#include "SUIT_MessageBox.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_Session.h" #include #include @@ -162,6 +166,9 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" ); buttonCancel->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonCancel, 0, 2 ); + buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); // top layout aTabBox->addTab(aBox, "Vectors"); @@ -178,6 +185,7 @@ VisuGUI_VectorsDlg::VisuGUI_VectorsDlg (SalomeApp_Module* theModule) connect( UseMagn, SIGNAL( clicked() ), this, SLOT( enableSetColor() ) ); connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) ); connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); // default values UseMagn->setChecked( TRUE ); @@ -420,3 +428,19 @@ void VisuGUI_VectorsDlg::reject() myScalarPane->deletePreview(); QDialog::reject(); } + +void VisuGUI_VectorsDlg::onHelp() +{ + QString aHelpFileName = "/files/vectors_presentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) { + VisuGUI* aVisuGUI = dynamic_cast( app->activeModule() ); + app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName); + } + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} diff --git a/src/VISUGUI/VisuGUI_VectorsDlg.h b/src/VISUGUI/VisuGUI_VectorsDlg.h index 2abdf591..5d6d9f3b 100644 --- a/src/VISUGUI/VisuGUI_VectorsDlg.h +++ b/src/VISUGUI/VisuGUI_VectorsDlg.h @@ -82,6 +82,7 @@ public: protected slots: void accept(); void reject(); + void onHelp(); private: QGroupBox* TopGroup; @@ -104,6 +105,7 @@ private: QGroupBox* GroupButtons; QPushButton* buttonOk; QPushButton* buttonCancel; + QPushButton* buttonHelp; QColor myColor; VisuGUI_ScalarBarPane* myScalarPane; diff --git a/src/VISU_I/Makefile.in b/src/VISU_I/Makefile.in index 0879dd8c..7924835c 100644 --- a/src/VISU_I/Makefile.in +++ b/src/VISU_I/Makefile.in @@ -98,9 +98,9 @@ CPPFLAGS += \ $(HDF5_INCLUDES) \ $(QWT_INCLUDES) \ $(BOOST_CPPFLAGS)\ - -I${KERNEL_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome \ - -I${GUI_ROOT_DIR}/include/salome + $(KERNEL_CXXFLAGS) \ + $(MED_CXXFLAGS) \ + $(GUI_CXXFLAGS) LDFLAGS += \ $(PYTHON_LIBS) \ @@ -108,9 +108,9 @@ LDFLAGS += \ $(VTK_LIBS) \ $(QWT_LIBS) \ $(BOOST_LIBS) \ - -L${KERNEL_ROOT_DIR}/lib/salome \ - -L${GUI_ROOT_DIR}/lib/salome \ - -L${MED_ROOT_DIR}/lib/salome + $(KERNEL_LDFLAGS) \ + $(GUI_LDFLAGS) \ + $(MED_LDFLAGS) LIBS+= -lboost_signals${BOOST_LIBSUFFIX} \ -lSalomeHDFPersist \ @@ -132,7 +132,7 @@ LIBS+= -lboost_signals${BOOST_LIBSUFFIX} \ -lVISUGUITOOLS LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \ - -L${KERNEL_ROOT_DIR}/lib/salome \ + $(KERNEL_LDFLAGS) \ -lSALOMEBasics \ -lSalomeCatalog \ -lwith_loggerTraceCollector \ @@ -142,8 +142,6 @@ LDFLAGSFORBIN=$(LDFLAGS) $(LIBS) \ -lSALOMELocalTrace \ -lSalomeResourcesManager \ -lSalomeDSClient \ - -lSalomeDSImpl \ - -lSalomeDS \ -lSalomeObject \ -lqtx \ -lsuit \ diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 5501a17a..22977d67 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -128,7 +128,7 @@ VISU::ColoredPrs3d_i SetItalicTitle(anOrigin->IsItalicTitle()); SetShadowTitle(anOrigin->IsShadowTitle()); SetTitFontType(anOrigin->GetTitFontType()); - float r,g,b; + vtkFloatingPointType r,g,b; anOrigin->GetTitleColor(&r,&g,&b); SetTitleColor(r,g,b); @@ -341,7 +341,9 @@ VISU::ColoredPrs3d_i void VISU::ColoredPrs3d_i -::GetTitleColor(float* theR, float* theG, float* theB) +::GetTitleColor(vtkFloatingPointType* theR, + vtkFloatingPointType* theG, + vtkFloatingPointType* theB) { *theR = myTitleColor[0]; *theG = myTitleColor[1]; @@ -350,7 +352,9 @@ VISU::ColoredPrs3d_i void VISU::ColoredPrs3d_i -::SetTitleColor(float theR, float theG, float theB) +::SetTitleColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB) { myTitleColor[0] = theR; myTitleColor[1] = theG; @@ -415,7 +419,9 @@ VISU::ColoredPrs3d_i void VISU::ColoredPrs3d_i -::GetLabelColor(float* theR, float* theG, float* theB) +::GetLabelColor(vtkFloatingPointType* theR, + vtkFloatingPointType* theG, + vtkFloatingPointType* theB) { *theR = myLabelColor[0]; *theG = myLabelColor[1]; @@ -424,7 +430,9 @@ VISU::ColoredPrs3d_i void VISU::ColoredPrs3d_i -::SetLabelColor(float theR, float theG, float theB) +::SetLabelColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB) { myLabelColor[0] = theR; myLabelColor[1] = theG; @@ -470,11 +478,11 @@ VISU::ColoredPrs3d_i // Scalar Bar origin QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" ); - float aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2; + vtkFloatingPointType aXorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.01 : 0.2; aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin); myPosition[0] = aXorigin; - float aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012; + vtkFloatingPointType aYorigin = (myOrientation == VISU::ScalarMap::VERTICAL) ? 0.1 : 0.012; aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin); myPosition[1] = aYorigin; diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index 9e277a47..6e2a5fd9 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -135,7 +135,7 @@ namespace VISU VISU::ScalarMap::Orientation myOrientation; std::string myTitle; int myNumberOfLabels; - float myPosition[2], myWidth, myHeight; + vtkFloatingPointType myPosition[2], myWidth, myHeight; public: //---------------------------------------------------------------------------- @@ -218,11 +218,15 @@ namespace VISU virtual void - GetTitleColor(float* theR, float* theG, float* theB); + GetTitleColor(vtkFloatingPointType* theR, + vtkFloatingPointType* theG, + vtkFloatingPointType* theB); virtual void - SetTitleColor(float theR, float theG, float theB); + SetTitleColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB); virtual bool @@ -258,11 +262,15 @@ namespace VISU virtual void - GetLabelColor(float* theR, float* theG, float* theB); + GetLabelColor(vtkFloatingPointType* theR, + vtkFloatingPointType* theG, + vtkFloatingPointType* theB); virtual void - SetLabelColor(float theR, float theG, float theB); + SetLabelColor(vtkFloatingPointType theR, + vtkFloatingPointType theG, + vtkFloatingPointType theB); //---------------------------------------------------------------------------- protected: @@ -276,13 +284,13 @@ namespace VISU bool myIsItalicTitle; bool myIsShadowTitle; int myTitFontType; - float myTitleColor[3]; + vtkFloatingPointType myTitleColor[3]; bool myIsBoldLabel; bool myIsItalicLabel; bool myIsShadowLabel; int myLblFontType; - float myLabelColor[3]; + vtkFloatingPointType myLabelColor[3]; VISU_ScalarMapPL* myScalarMapPL; bool myIsFixedRange; diff --git a/src/VISU_I/VISU_CorbaMedConvertor.cxx b/src/VISU_I/VISU_CorbaMedConvertor.cxx index b1dc814b..e69db1a8 100644 --- a/src/VISU_I/VISU_CorbaMedConvertor.cxx +++ b/src/VISU_I/VISU_CorbaMedConvertor.cxx @@ -1206,7 +1206,6 @@ VISU_MEDConvertor if(theFamily->myIsDone) return 0; - const VISU::TGeom2SubMesh& aGeom2SubMesh = theMeshOnEntity->myGeom2SubMesh; SALOME_MED::FAMILY_var aMedFamily = theFamily->myFamily; CORBA::Boolean anIsOnAllElements = aMedFamily->isOnAllElements(); if(!anIsOnAllElements){ diff --git a/src/VISU_I/VISU_CutLines_i.cc b/src/VISU_I/VISU_CutLines_i.cc index 879b0531..9b181be3 100644 --- a/src/VISU_I/VISU_CutLines_i.cc +++ b/src/VISU_I/VISU_CutLines_i.cc @@ -32,12 +32,14 @@ #include "VISU_Convertor.hxx" #include "VISU_PipeLineUtils.hxx" +#include "SUIT_ResourceMgr.h" + #include using namespace VISU; using namespace std; -static float EPS_machine = 1.0E-7; +static vtkFloatingPointType EPS_machine = 1.0E-7; #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -311,6 +313,9 @@ VISU::CutLines_i { if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU" , "cut_lines_represent", 2); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; @@ -325,8 +330,8 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal"); SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr); - typedef set TXCont; - typedef map TXYMap; + typedef set TXCont; + typedef map TXYMap; typedef map TXYMapCont; typedef map TLineIdCont; @@ -340,9 +345,9 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ TXCont aXCont; TXYMapCont aXYMapCont; TLineIdCont aLineIdCont; // Define internal numeration of lines - const float *aDirLn = myCutLinesPL->GetDirLn(); - const float *aBasePnt = myCutLinesPL->GetBasePnt(); - const float *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn(); + const vtkFloatingPointType *aDirLn = myCutLinesPL->GetDirLn(); + const vtkFloatingPointType *aBasePnt = myCutLinesPL->GetBasePnt(); + const vtkFloatingPointType *aBoundPrjLn = myCutLinesPL->GetBoundPrjLn(); for(int iLine = 0, jLine = 0; iLine < iLineEnd; iLine++){ vtkDataSet *aDataSet = myCutLinesPL->GetAppendPolyData()->GetInput(iLine); aDataSet->Update(); @@ -364,7 +369,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal iLine = "<SetColumnTitle(i+1,aString.latin1()); @@ -467,7 +472,7 @@ void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){ TXYMap::const_iterator aXYMapIter = aXYMap.find(aDist); // Can we find some value that belong to the line and have the same X coordinate? if(aXYMapIter == aXYMap.end()) continue; - float aVal = aXYMapIter->second; + vtkFloatingPointType aVal = aXYMapIter->second; aTableOfReal->PutValue(aVal,iLineId+2,i+1); } } diff --git a/src/VISU_I/VISU_CutPlanes_i.cc b/src/VISU_I/VISU_CutPlanes_i.cc index d5c0ea04..38f9a0e9 100644 --- a/src/VISU_I/VISU_CutPlanes_i.cc +++ b/src/VISU_I/VISU_CutPlanes_i.cc @@ -29,6 +29,8 @@ #include "VISU_CutPlanes_i.hh" #include "VISU_Actor.h" +#include "SUIT_ResourceMgr.h" + using namespace VISU; using namespace std; @@ -189,6 +191,9 @@ VISU::CutPlanes_i { if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU" , "cut_planes_represent", 1); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_DeformedShape_i.cc b/src/VISU_I/VISU_DeformedShape_i.cc index 83f679ce..46cc36dc 100644 --- a/src/VISU_I/VISU_DeformedShape_i.cc +++ b/src/VISU_I/VISU_DeformedShape_i.cc @@ -31,6 +31,8 @@ #include "VISU_DeformedShapePL.hxx" #include "VISU_Convertor.hxx" +#include "SUIT_ResourceMgr.h" + #include #include @@ -170,9 +172,13 @@ VISU::DeformedShape_i ::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) { VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO); - anActor->SetRepresentation(1); - anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); anActor->SetVTKMapping(false); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "deformed_shape_represent", 1); + bool toShrink = aResourceMgr->booleanValue("VISU", "deformed_shape_shrink", false); + anActor->SetRepresentation(aDispMode); + if (toShrink) anActor->SetShrink(); + anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); return anActor; } diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index f3d809ed..cb2d5b52 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -39,6 +39,8 @@ #include "VISU_StreamLines_i.hh" #include "VISU_Plot3D_i.hh" #include "VISU_Table_i.hh" +#include "VISU_GaussPoints_i.hh" +#include "VISU_ScalarMapOnDeformedShape_i.hh" #include "utilities.h" @@ -53,7 +55,8 @@ using namespace std; -namespace VISU{ +namespace VISU +{ static std::string PREFIX(" "); typedef std::map TName2EntryMap; @@ -139,15 +142,27 @@ namespace VISU{ std::string thePrefix); + //=========================================================================== + void + Prs3dToPython(VISU::Prs3d_i* theServant, + std::ostream& theStr, + std::string& theName, + std::string thePrefix) + { + float x, y, z; + theServant->GetOffset(x,y,z); + theStr<GetEntity()){ @@ -182,9 +197,34 @@ namespace VISU{ CORBA::String_var aNameInStudy = theSObject->GetName(); theStr<GetScalarMode()<<")"<GetPosX()<<","<GetPosY()<<")"<GetWidth()<<","<GetHeight()<<")"<GetNbColors()<<")"<GetLabels()<<")"<GetTitle()<<"')"<GetScaling()){ case LINEAR: aParam = "VISU.LINEAR"; @@ -206,12 +246,6 @@ namespace VISU{ } theStr<GetPosX()<<","<GetPosY()<<")"<GetWidth()<<","<GetHeight()<<")"<GetNbColors()<<")"<GetLabels()<<")"<GetTitle()<<"')"<GetID(); + CORBA::String_var aNameInStudy = theSObject->GetName(); + CORBA::Object_var anObj = SObjectToObject(theSObject); - if(!CORBA::is_nil(anObj)){ + if (!CORBA::is_nil(anObj)) { VISU::Base_var aBase = VISU::Base::_narrow(anObj); if(!CORBA::is_nil(aBase)){ std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap); - CORBA::String_var anID = theSObject->GetID(); VISU::VISUType aType = aBase->GetType(); switch(aType){ @@ -495,14 +531,28 @@ namespace VISU{ if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){ switch(anId){ case Result_i::eImportFile: - theStr<IsGroupsDone()<<")"<< + endl; + + theStr<IsFieldsDone()<<","<< + aServant->IsMinMaxDone()<<")"<< + endl; + + theStr<(GetServant(anObj).in())){ + if(Mesh_i* aServant = dynamic_cast(GetServant(anObj).in())){ VISU::Entity anEntity = aServant->GetEntity(); const std::string& aSubMeshName = aServant->GetSubMeshName(); if(anEntity >= 0){ @@ -608,9 +658,11 @@ namespace VISU{ theStr<GetName(); theStr<GetCellColor(); @@ -717,6 +769,40 @@ namespace VISU{ theStr<(GetServant(anObj).in())){ + thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnDeformedShapeOnField",theArgumentName,thePrefix); + + theStr<GetSourceRangeMin()<<","<GetSourceRangeMax()<<")"<GetScale()<<")"<GetScalarEEntity(); + switch(anEntity){ + case NODE: + aParam = "VISU.NODE"; + break; + case EDGE: + aParam = "VISU.EDGE"; + break; + case FACE: + aParam = "VISU.FACE"; + break; + case CELL: + aParam = "VISU.CELL"; + break; + } + + theStr<GetScalarMeshName()<<"',"<< + "'"<GetScalarFieldName()<<"',"<< + aServant->GetScalarIteration()<<","<< + aParam<< + ")"<(GetServant(anObj).in())){ thePrefix = DeformedShapeToPython(theSObject,aServant,theStr,aName,"VectorsOnField",theArgumentName,thePrefix); @@ -855,8 +941,7 @@ namespace VISU{ return; case VISU::TPLOT3D: if (Plot3D_i* aServant = dynamic_cast(GetServant(anObj).in())) { - thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName, - "Plot3DOnField", theArgumentName, thePrefix); + thePrefix = ScalarMapToPython(theSObject, aServant, theStr, aName,"Plot3DOnField", theArgumentName, thePrefix); std::string aParam; switch(aServant->GetOrientationType()){ @@ -873,6 +958,12 @@ namespace VISU{ theStr<(GetServant(anObj).in())){ + thePrefix = ColoredPrs3dToPython(theSObject,aServant,theStr,aName,"GaussPointsOnField",theArgumentName,thePrefix); + theStr<(GetServant(anObj).in())) { @@ -912,7 +1003,7 @@ namespace VISU{ } return; case VISU::TTABLE: - if(Table_i* aServant = dynamic_cast(GetServant(anObj).in())){ + if(dynamic_cast(GetServant(anObj).in())){ SALOMEDS::GenericAttribute_var anAttr; if(theSObject->FindAttribute(anAttr,"AttributeComment")){ using namespace SALOMEDS; @@ -938,7 +1029,6 @@ namespace VISU{ theStr<GetName(); theStr<GetName(); theStr<FindAttribute(anAttr,"AttributeComment")){ + if (theSObject->FindAttribute(anAttr,"AttributeComment")) { SALOMEDS::AttributeComment_var aComment = SALOMEDS::AttributeComment::_narrow(anAttr); CORBA::String_var aValue = aComment->Value(); @@ -1011,8 +1100,8 @@ namespace VISU{ Storable::StrToMap(aValue.in(),aMap); bool anIsExist; QString aTypeName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist); - if(anIsExist){ - if(strcmp(aTypeName.latin1(),"ImportTables") == 0){ + if (anIsExist) { + if (strcmp(aTypeName.latin1(),"ImportTables") == 0) { QString aFileName = VISU::Storable::FindValue(aMap,"myFileName",&anIsExist); if(anIsExist){ std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap); @@ -1034,7 +1123,7 @@ namespace VISU{ theStr<GetDefaultScript("Post-Pro", aPrefix.c_str()); + if(script && strlen(script) > 0) { + aStr << script; + CORBA::string_free(script); + } + } + aStr<integerValue( "VISU", "scalar_bar_bicolor", GetBiColor() ); SetBiColor( aBicolor == 0 ); - float aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() ); + vtkFloatingPointType aSpacing = aResourceMgr->doubleValue( "VISU", "scalar_bar_spacing", GetSpacing() ); SetSpacing( aSpacing ); - float aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() ); + vtkFloatingPointType aScaleFactor = aResourceMgr->doubleValue( "VISU", "deformed_shape_scale_factor", GetScaleFactor() ); SetScaleFactor( aScaleFactor ); int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() ); SetPrimitiveType( aPrimitiveType ); - float aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() ); + vtkFloatingPointType aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() ); SetClamp( aClamp ); int aMinSize = aResourceMgr->integerValue( "VISU", "point_sprite_min_size", ( int )( GetMinSize() * 100.0 ) ); @@ -178,7 +178,7 @@ VISU::GaussPoints_i int aMagnification = aResourceMgr->integerValue( "VISU", "point_sprite_magnification", ( int )( GetMagnification() * 100.0 ) ); SetMagnification( aMagnification / 100.0 ); - float anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() ); + vtkFloatingPointType anIncrement = aResourceMgr->doubleValue( "VISU", "point_sprite_increment", GetMagnificationIncrement() ); SetMagnificationIncrement( anIncrement ); bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() ); @@ -187,7 +187,7 @@ VISU::GaussPoints_i QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetColor() ); SetColor( aColor ); - float anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() ); + vtkFloatingPointType anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() ); SetAlphaThreshold( anAlphaThreshold ); int aResolution = aResourceMgr->integerValue( "VISU", "geom_sphere_resolution", GetResolution() ); @@ -322,12 +322,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetScaleFactor( float theScaleFactor ) +::SetScaleFactor( vtkFloatingPointType theScaleFactor ) { myGaussPointsPL->SetScale( theScaleFactor ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetScaleFactor() { @@ -376,12 +376,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetAlphaThreshold( float theAlphaThreshold ) +::SetAlphaThreshold( vtkFloatingPointType theAlphaThreshold ) { myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetAlphaThreshold() { @@ -416,7 +416,7 @@ VISU::GaussPoints_i return myGaussPointsPL->GetPrimitiveType(); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMaximumSupportedSize() { @@ -425,12 +425,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetClamp(float theClamp) +::SetClamp(vtkFloatingPointType theClamp) { myGaussPointsPL->SetClamp( theClamp ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetClamp() { @@ -439,12 +439,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetGeomSize( float theGeomSize ) +::SetGeomSize( vtkFloatingPointType theGeomSize ) { myGaussPointsPL->SetSize( theGeomSize ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetGeomSize() { @@ -453,12 +453,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetMinSize( float theMinSize ) +::SetMinSize( vtkFloatingPointType theMinSize ) { myGaussPointsPL->SetMinSize( theMinSize ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMinSize() { @@ -467,12 +467,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetMaxSize( float theMaxSize ) +::SetMaxSize( vtkFloatingPointType theMaxSize ) { myGaussPointsPL->SetMaxSize( theMaxSize ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMaxSize() { @@ -481,12 +481,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetMagnification( float theMagnification ) +::SetMagnification( vtkFloatingPointType theMagnification ) { myGaussPointsPL->SetMagnification( theMagnification ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMagnification() { @@ -495,12 +495,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetMagnificationIncrement( float theIncrement ) +::SetMagnificationIncrement( vtkFloatingPointType theIncrement ) { myGaussPointsPL->SetMagnificationIncrement( theIncrement ); } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetMagnificationIncrement() { @@ -639,14 +639,14 @@ VISU::GaussPoints_i vtkTextProperty* aTitleProp = theScalarBar->GetTitleTextProperty(); aTitleProp->SetFontFamily(myTitFontType); - aTitleProp->SetColor(myTitleColor); + aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]); (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff(); (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff(); (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff(); vtkTextProperty* aLabelProp = theScalarBar->GetLabelTextProperty(); aLabelProp->SetFontFamily(myLblFontType); - aLabelProp->SetColor(myLabelColor); + aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]); (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff(); (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff(); (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff(); @@ -666,7 +666,7 @@ VISU::GaussPoints_i anActor->SetBarVisibility(true); myPipeLine->GetMapper()->SetScalarVisibility(1); - float aRange[2]; + vtkFloatingPointType aRange[2]; myScalarMapPL->GetSourceRange(aRange); aScalarBarCtrl->SetRangeLocal(aRange); @@ -687,7 +687,7 @@ VISU::GaussPoints_i } if(aScalarBarMode == VISU_ScalarBarCtrl::eGlobal){ - float aRangeGlobal[2]; + vtkFloatingPointType aRangeGlobal[2]; // aRangeGlobal[0] = aTMinMax.first; aRangeGlobal[1] = aTMinMax.second; @@ -813,12 +813,12 @@ VISU::GaussPoints_i void VISU::GaussPoints_i -::SetSpacing(const float theSpacing) +::SetSpacing(const vtkFloatingPointType theSpacing) { mySpacing = theSpacing; } -float +vtkFloatingPointType VISU::GaussPoints_i ::GetSpacing() const { diff --git a/src/VISU_I/VISU_GaussPoints_i.hh b/src/VISU_I/VISU_GaussPoints_i.hh index 5a0fe102..71c49c72 100644 --- a/src/VISU_I/VISU_GaussPoints_i.hh +++ b/src/VISU_I/VISU_GaussPoints_i.hh @@ -87,11 +87,11 @@ namespace VISU void SetIsDeformed( bool theIsDeformed ); - float + vtkFloatingPointType GetScaleFactor(); void - SetScaleFactor( float theScaleFactor ); + SetScaleFactor( vtkFloatingPointType theScaleFactor ); //! Get color for Geometry mode of the presentation. QColor @@ -133,10 +133,10 @@ namespace VISU //! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold. void - SetAlphaThreshold(float theAlphaThreshold); + SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold); //! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold. - float + vtkFloatingPointType GetAlphaThreshold(); //! Redirect the request to VISU_GaussPointsPL::SetResolution. @@ -154,55 +154,55 @@ namespace VISU GetPrimitiveType(); //! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize. - float + vtkFloatingPointType GetMaximumSupportedSize(); //! Redirect the request to VISU_GaussPointsPL::SetClamp. void - SetClamp(float theClamp); + SetClamp(vtkFloatingPointType theClamp); //! Redirect the request to VISU_GaussPointsPL::GetClamp. - float + vtkFloatingPointType GetClamp(); //! Redirect the request to VISU_GaussPointsPL::SetSize. void - SetGeomSize(float theGeomSize); + SetGeomSize(vtkFloatingPointType theGeomSize); //! Redirect the request to VISU_GaussPointsPL::GetSize. - float + vtkFloatingPointType GetGeomSize(); //! Redirect the request to VISU_GaussPointsPL::SetMinSize. void - SetMinSize(float theMinSize); + SetMinSize(vtkFloatingPointType theMinSize); //! Redirect the request to VISU_GaussPointsPL::GetMinSize. - float + vtkFloatingPointType GetMinSize(); //! Redirect the request to VISU_GaussPointsPL::SetMaxSize. void - SetMaxSize(float theMaxSize); + SetMaxSize(vtkFloatingPointType theMaxSize); //! Redirect the request to VISU_GaussPointsPL::GetMaxSize. - float + vtkFloatingPointType GetMaxSize(); //! Redirect the request to VISU_GaussPointsPL::SetMagnification. void - SetMagnification(float theMagnification); + SetMagnification(vtkFloatingPointType theMagnification); //! Redirect the request to VISU_GaussPointsPL::GetMagnification. - float + vtkFloatingPointType GetMagnification(); //! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement. void - SetMagnificationIncrement(float theIncrement); + SetMagnificationIncrement(vtkFloatingPointType theIncrement); //! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement. - float + vtkFloatingPointType GetMagnificationIncrement(); //! Set flag indicating which scalar bar is active. @@ -231,10 +231,10 @@ namespace VISU //! Set value of the distance between global and local scalar bars. void - SetSpacing(const float theSpacing); + SetSpacing(const vtkFloatingPointType theSpacing); //! Get value of the distance between global and local scalar bars. - float + vtkFloatingPointType GetSpacing() const; //! Let know is the global range is already calculated @@ -280,7 +280,7 @@ namespace VISU bool myIsDispGlobalScalarBar; bool myIsActiveLocalScalarBar; QColor myColor; - float mySpacing; + vtkFloatingPointType mySpacing; int myFaceLimit; QString myMainTexture; diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index c5a950cc..d225b3d0 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -605,6 +605,85 @@ namespace VISU } } + void VISU_Gen_i::RenameMeshInStudy(Result_ptr theResult, + string theMeshName, + int theEntity, // -1 for group indication + string theSubMeshName, // Family or Group name + string theNewName) + { + if (myStudyDocument->GetProperties()->IsLocked()) return; + Mutex mt(myMutex); + + Result_i* pResult = dynamic_cast(GetServant(theResult).in()); + if (!pResult) return; + + QString aComment; + VISU::VISUType aType; + if (theEntity >= 0) + if (theSubMeshName == "") + aType = VISU::TENTITY; + else + aType = VISU::TFAMILY; + else + aType = VISU::TGROUP; + + switch (aType) { + case VISU::TENTITY: + aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d", + VISU::TENTITY, theMeshName.c_str(), theEntity); + break; + case VISU::TFAMILY: + aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s", + VISU::TFAMILY, theMeshName.c_str(), theEntity, theSubMeshName.c_str()); + break; + case VISU::TGROUP: + aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s", + VISU::TGROUP, theMeshName.c_str(), theSubMeshName.c_str()); + break; + } + + string aResultEntry = pResult->GetEntry(); + string anEntry = pResult->GetEntry(aComment.latin1()); + if (anEntry == "") return; + + SALOMEDS::SObject_ptr aSObject = myStudyDocument->FindObjectID(anEntry.c_str()); + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder(); + aStudyBuilder->NewCommand(); // There is a transaction + + SALOMEDS::GenericAttribute_var anAttr = + aStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeName"); + SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow(anAttr); + aNameAttr->SetValue(theNewName.c_str()); + + aStudyBuilder->CommitCommand(); + } + + void VISU_Gen_i::RenameEntityInStudy(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theNewName) + { + RenameMeshInStudy(theResult, theMeshName, (int)theEntity, "", theNewName); + } + + void VISU_Gen_i::RenameFamilyInStudy(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFamilyName, + const char* theNewName) + { + RenameMeshInStudy(theResult, theMeshName, (int)theEntity, theFamilyName, theNewName); + } + + void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult, + const char* theMeshName, + const char* theGroupName, + const char* theNewName) + { + RenameMeshInStudy(theResult, theMeshName, -1, theGroupName, theNewName); + } + Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity) diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index 1f4f9212..5590e898 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -15,6 +15,8 @@ #include "SALOME_Component_i.hxx" #include "SALOME_NamingService.hxx" +#include + namespace VISU { class Result_i; @@ -92,6 +94,33 @@ namespace VISU ImportMedField(SALOME_MED::FIELD_ptr theField); + //Rename Presentation Of Submeshes + void + RenameMeshInStudy(Result_ptr theResult, + std::string theMeshName, + int theEntity, // -1 for group indication + std::string theSubMeshName, // Family or Group name + std::string theNewName); + virtual + void + RenameEntityInStudy(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theNewName); + virtual + void + RenameFamilyInStudy(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFamilyName, + const char* theNewName); + virtual + void + RenameGroupInStudy(Result_ptr theResult, + const char* theMeshName, + const char* theGroupName, + const char* theNewName); + //Create Presentation Of Submeshes virtual Mesh_ptr diff --git a/src/VISU_I/VISU_IsoSurfaces_i.cc b/src/VISU_I/VISU_IsoSurfaces_i.cc index 4198c8a6..712c9ede 100644 --- a/src/VISU_I/VISU_IsoSurfaces_i.cc +++ b/src/VISU_I/VISU_IsoSurfaces_i.cc @@ -29,6 +29,8 @@ #include "VISU_IsoSurfaces_i.hh" #include "VISU_Actor.h" +#include "SUIT_ResourceMgr.h" + using namespace VISU; using namespace std; @@ -115,8 +117,9 @@ CORBA::Long VISU::IsoSurfaces_i::GetNbSurfaces(){ } -void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax){ - float aRange[2] = {theMin, theMax}; +void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax) +{ + vtkFloatingPointType aRange[2] = {theMin, theMax}; myIsoSurfacesPL->SetRange(aRange); } CORBA::Double VISU::IsoSurfaces_i::GetSubMin(){ @@ -142,6 +145,9 @@ VISU::IsoSurfaces_i { if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_Mesh_i.cc b/src/VISU_I/VISU_Mesh_i.cc index a38ea37b..bc5013fb 100644 --- a/src/VISU_I/VISU_Mesh_i.cc +++ b/src/VISU_I/VISU_Mesh_i.cc @@ -35,6 +35,8 @@ #include "SALOME_Event.hxx" +#include "SUIT_ResourceMgr.h" + using namespace VISU; using namespace std; @@ -227,7 +229,7 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring) if (myResult->GetInput() == NULL) throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!"); if (!theRestoring) { - myPresentType = VISU::SHADED; + myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2)); if(myEntity == VISU::NODE_ENTITY) myPresentType = VISU::POINT; myName = GenerateName().latin1(); @@ -301,6 +303,9 @@ VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& th VISU_MeshAct* anActor = VISU_MeshAct::New(); try{ VISU::Prs3d_i::CreateActor(anActor,theIO); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + bool toShrink = aResourceMgr->booleanValue("VISU", "mesh_shrink", false); + if (toShrink) anActor->SetShrink(); UpdateActor(anActor); }catch (...) { anActor->Delete(); diff --git a/src/VISU_I/VISU_Plot3D_i.cc b/src/VISU_I/VISU_Plot3D_i.cc index 0cc631b2..43cbe79f 100644 --- a/src/VISU_I/VISU_Plot3D_i.cc +++ b/src/VISU_I/VISU_Plot3D_i.cc @@ -26,6 +26,8 @@ #include "VISU_Actor.h" +#include "SUIT_ResourceMgr.h" + using namespace VISU; using namespace std; @@ -190,6 +192,9 @@ VISU::Plot3D_i { if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "plot3d_represent", 2); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index 1bdd88b8..c0046384 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -252,7 +252,7 @@ VISU::Prs3d_i theActor->SetPrs3d(this); theActor->SetShrinkFactor(); - theActor->SetPosition(myOffset); + theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]); theActor->SetPipeLine(GetPipeLine()); theActor->SetFactory(this); @@ -295,7 +295,7 @@ VISU::Prs3d_i { if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "< class VISU_PipeLine; @@ -184,25 +186,31 @@ namespace VISU GetClippingPlane(vtkIdType theID) const; void - SetPlaneParam(float theDir[3], float theDist, vtkPlane* thePlane); + SetPlaneParam(vtkFloatingPointType theDir[3], + vtkFloatingPointType theDist, + vtkPlane* thePlane); //---------------------------------------------------------------------------- void - GetBounds(float aBounds[6]); + GetBounds(vtkFloatingPointType aBounds[6]); void - SetOffset(const float* theOffsets); + SetOffset(const CORBA::Float* theOffsets); virtual void - SetOffset(float theDx, float theDy, float theDz); + SetOffset(CORBA::Float theDx, + CORBA::Float theDy, + CORBA::Float theDz); void - GetOffset(float* theOffsets); + GetOffset(CORBA::Float* theOffsets); virtual void - GetOffset(float& theDx, float& theDy, float& theDz); + GetOffset(CORBA::Float& theDx, + CORBA::Float& theDy, + CORBA::Float& theDz); //---------------------------------------------------------------------------- protected: @@ -220,7 +228,7 @@ namespace VISU CheckDataSet(); bool myAddToStudy; - float myOffset[3]; + CORBA::Float myOffset[3]; Result_i *myResult; VISU_PipeLine *myPipeLine; SALOMEDS::SObject_var mySObject; diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index 9745df01..0ce2588c 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -213,12 +213,14 @@ namespace VISU aStudyBuilder->Addreference(aNewObj,aRefSObj); } - string + + //--------------------------------------------------------------- + inline + std::string CreateAttributes(_PTR(Study) theStudyDocument, const string& theFatherEntry, const string& theIOR, const string& theName, - const string& thePersistentRef, const string& theComment, CORBA::Boolean theCreateNew) { @@ -244,11 +246,6 @@ namespace VISU _PTR(AttributeName) aName (anAttr); aName->SetValue(theName); } - if (thePersistentRef != "") { - anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributePersistentRef"); - _PTR(AttributePersistentRef) aPRef (anAttr); - aPRef->SetValue(thePersistentRef); - } if (theComment != "") { anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeComment"); _PTR(AttributeComment) aCmnt (anAttr); @@ -257,6 +254,54 @@ namespace VISU return aNewObj->GetID(); } + + //--------------------------------------------------------------- + inline + void + UpdateAttributes(_PTR(Study) theStudyDocument, + const string& theEntry, + const string& theIOR, + const string& theName, + const string& theComment) + { + TLock aLock(myMutex); + + _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder(); + _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry); + + _PTR(GenericAttribute) anAttr; + if (theIOR != "") { + anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR"); + _PTR(AttributeIOR) anIOR (anAttr); + anIOR->SetValue(theIOR); + } + if (theName != "") { + anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeName"); + _PTR(AttributeName) aName (anAttr); + aName->SetValue(theName); + } + if (theComment != "") { + anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeComment"); + _PTR(AttributeComment) aCmnt (anAttr); + aCmnt->SetValue(theComment); + } + } + + + //--------------------------------------------------------------- + inline + void + RemoveSObject(_PTR(Study) theStudyDocument, + const string& theEntry) + { + TLock aLock(myMutex); + + _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder(); + _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry); + aStudyBuilder->RemoveObject(aSObject); + } + + //--------------------------------------------------------------- struct TResultManager { @@ -339,6 +384,9 @@ namespace VISU VISU_Convertor* theInput, CORBA::Boolean* theIsDone, std::string theResultEntry, + CORBA::Boolean theIsAtOnce, + CORBA::Boolean theIsBuildGroups, + CORBA::Boolean theIsBuildFields, _PTR(Study) theStudy) { if(*theIsDone) @@ -371,7 +419,6 @@ namespace VISU theResultEntry, "", aMeshName, - "", aComment.latin1(), true); @@ -382,9 +429,29 @@ namespace VISU aMesh->myEntry, "", "Families", - "", aComment.latin1(), true); + + if(theIsBuildGroups){ + aMesh->myGroupsEntry = + CreateAttributes(theStudy, + aMesh->myEntry, + "", + "", + "", + true); + } + + if(theIsBuildFields){ + aMesh->myFieldsEntry = + CreateAttributes(theStudy, + aMesh->myEntry, + "", + "", + "", + true); + } + //Import entities TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin(); for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){ @@ -419,7 +486,6 @@ namespace VISU aSubMeshesEntry, "", anEntityName.c_str(), - "", aComment.latin1(), true); } @@ -434,6 +500,7 @@ namespace VISU VISU_Convertor* theInput, CORBA::Boolean* theIsDone, CORBA::Boolean theIsBuild, + CORBA::Boolean theIsAtOnce, _PTR(Study) theStudy) { if(!theIsBuild || *theIsDone) @@ -479,7 +546,6 @@ namespace VISU aMeshOnEntity->myEntry, "", aFamilyName, - "", aComment.latin1(), true); } @@ -489,14 +555,13 @@ namespace VISU if(!aGroupMap.empty()){ aComment.sprintf("myComment=GROUPS;myMeshName=%s", aMeshName.c_str()); - string aGroupsEntry = - CreateAttributes(theStudy, - aMesh->myEntry, - "", - "Groups", - "", - aComment.latin1(), - true); + + UpdateAttributes(theStudy, + aMesh->myGroupsEntry, + "", + "Groups", + aComment.latin1()); + TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin(); for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){ const string& aGroupName = aGroupMapIter->first; @@ -505,10 +570,9 @@ namespace VISU TGROUP,aMeshName.c_str(),aGroupName.c_str()); aGroup->myEntry = CreateAttributes(theStudy, - aGroupsEntry, + aMesh->myGroupsEntry, "", aGroupName, - "", aComment.latin1(), true); const TFamilySet& aFamilySet = aGroup->myFamilySet; @@ -520,7 +584,9 @@ namespace VISU aFamily->myEntry); } } - } + }else if(!theIsAtOnce) + RemoveSObject(theStudy, + aMesh->myGroupsEntry); } ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone)); @@ -533,6 +599,7 @@ namespace VISU VISU_Convertor* theInput, CORBA::Boolean* theIsDone, CORBA::Boolean theIsBuild, + CORBA::Boolean theIsAtOnce, _PTR(Study) theStudy) { if(!theIsBuild || *theIsDone) @@ -559,9 +626,7 @@ namespace VISU continue; //Import fields - string aFieldsEntry; - bool anIsFieldsEntryCreated = false; - + bool anIsFieldsEntryUpdated = false; TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin(); for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){ const TEntity& anEntity = aMeshOnEntityMapIter->first; @@ -569,18 +634,17 @@ namespace VISU const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin(); for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){ - if(!anIsFieldsEntryCreated){ + if(!anIsFieldsEntryUpdated){ aComment.sprintf("myComment=FIELDS;myMeshName=%s", aMeshName.c_str()); - aFieldsEntry = - CreateAttributes(theStudy, - aMesh->myEntry, - "", - "Fields", - "", - aComment.latin1(), - true); - anIsFieldsEntryCreated = true; + + UpdateAttributes(theStudy, + aMesh->myFieldsEntry, + "", + "Fields", + aComment.latin1()); + + anIsFieldsEntryUpdated = true; } const string& aFieldName = aFieldMapIter->first; const PField& aField = aFieldMapIter->second; @@ -595,10 +659,9 @@ namespace VISU aField->myNbComp); aField->myEntry = CreateAttributes(theStudy, - aFieldsEntry, + aMesh->myFieldsEntry, "", aFieldNameWithUnit.latin1(), - "", aComment.latin1(), true); CreateReference(theStudy, @@ -621,12 +684,15 @@ namespace VISU aField->myEntry, "", aTimeStampId, - "", aComment.latin1(), true); } } } + + if(!anIsFieldsEntryUpdated && !theIsAtOnce) + RemoveSObject(theStudy, + aMesh->myFieldsEntry); } ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone)); @@ -670,6 +736,7 @@ namespace VISU theInput, theIsFieldsDone, theIsBuildFields, + false, theStudy); BuildMinMax(theResult, @@ -732,6 +799,9 @@ namespace VISU theBuildArgs.myInput, theBuildArgs.myIsEntitiesDone, theBuildArgs.myResultEntry, + false, + theBuildArgs.myIsBuildGroups, + theBuildArgs.myIsBuildFields, theBuildArgs.myStudy); { boost::thread aThread(boost::bind(&BuildGroups, @@ -739,6 +809,7 @@ namespace VISU theBuildArgs.myInput, theBuildArgs.myIsGroupsDone, theBuildArgs.myIsBuildGroups, + false, theBuildArgs.myStudy)); } { @@ -995,7 +1066,6 @@ VISU::Result_i aSComponentEntry.in(), anIOR.in(), myName, - "", aComment.latin1(), true); mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str()); @@ -1009,18 +1079,23 @@ VISU::Result_i myInput, &myIsEntitiesDone, aResultEntry, + theIsAtOnce, + myIsBuildGroups, + myIsBuildFields, myStudy); BuildGroups(this, myInput, &myIsGroupsDone, myIsBuildGroups, + theIsAtOnce, myStudy); BuildFields(this, myInput, &myIsFieldsDone, myIsBuildFields, + theIsAtOnce, myStudy); BuildMinMax(this, @@ -1476,11 +1551,13 @@ VISU::Result_i //function : GetAxisInfo //purpose : //======================================================================= -const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, - TAxis theAxis, - gp_Dir& thePlaneNormal) +const Result_i::TAxisInfo* +Result_i +::GetAxisInfo(const string& theMeshName, + TAxis theAxis, + gp_Dir& thePlaneNormal) { - const vector< float >* components = NULL; + const TAxisInfo* components = NULL; if ( theAxis < AXIS_X || theAxis > AXIS_Z ) { MESSAGE(" Bad axis index " << theAxis ); @@ -1526,7 +1603,7 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, if ( nbPnt != 8 ) continue; vtkPoints * points = cell->GetPoints(); - float* coords[ 4 ]; + vtkFloatingPointType* coords[ 4 ]; coords[0] = points->GetPoint( 0 ); coords[1] = points->GetPoint( 1 ); coords[2] = points->GetPoint( 3 ); @@ -1534,10 +1611,10 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, gp_Pnt p0( coords[0][0], coords[0][1], coords[0][2] ); for ( iAx = 0; iAx < nbAxes; ++iAx ) { - float* coo = coords[ iAx + 1 ]; + vtkFloatingPointType* coo = coords[ iAx + 1 ]; gp_Pnt p( coo[0], coo[1], coo[2] ); // min size - float size = p0.SquareDistance( p ); + vtkFloatingPointType size = p0.SquareDistance( p ); if ( size > FLT_MIN && size < minSize[ iAx ] ) minSize[ iAx ] = size; // axis direction @@ -1567,34 +1644,34 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, // get and sort intermediate component values - projections of nodes // on axis direction; define bnd box - set< float > comps[ 3 ]; + set< vtkFloatingPointType > comps[ 3 ]; Bnd_Box box; vtkPoints * points = aMesh->GetPoints(); vtkIdType iP, nbP = aMesh->GetNumberOfPoints(); for ( iP = 0; iP < nbP; ++iP ) { - float* coo = points->GetPoint( iP ); + vtkFloatingPointType* coo = points->GetPoint( iP ); gp_Pnt p( coo[0], coo[1], coo[2] ); box.Add( p ); for ( iAx = 0; iAx < nbAxes; ++iAx ) { const gp_Dir& dir = gInfo->myAxis[ iAx ]; - float dot = dir.XYZ() * p.XYZ(); + vtkFloatingPointType dot = dir.XYZ() * p.XYZ(); comps[ iAx ].insert( dot ); } } // find a range of projections of bnd box corners on each axis - float range[3], firstValue[3]; + vtkFloatingPointType range[3], firstValue[3]; double x[2],y[2],z[2]; box.Get(x[0],y[0],z[0],x[1],y[1],z[1]); for ( iAx = 0; iAx < nbAxes; ++iAx ) { - set< float > bndComps; + set< vtkFloatingPointType > bndComps; const gp_Dir& dir = gInfo->myAxis[ iAx ]; for ( int iX = 0; iX < 2; ++iX ) { for ( int iY = 0; iY < 2; ++iY ) { for ( int iZ = 0; iZ < 2; ++iZ ) { gp_Pnt p( x[ iX ], y[ iY ], z[ iZ ] ); - float dot = dir.XYZ() * p.XYZ(); + vtkFloatingPointType dot = dir.XYZ() * p.XYZ(); bndComps.insert( dot ); } } @@ -1606,14 +1683,14 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, // compute component values for ( iAx = 0; iAx < nbAxes; ++iAx ) { - list< float > values; + list< vtkFloatingPointType > values; int nbVals = 0; - set< float >& comp = comps[ iAx ]; - set< float >::iterator val = comp.begin(); - float bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ]; - float tol = 0.1 * sqrt( minSize[ iAx ]) / rng; + set< vtkFloatingPointType >& comp = comps[ iAx ]; + set< vtkFloatingPointType >::iterator val = comp.begin(); + vtkFloatingPointType bnd = -1., rng = range[ iAx ], first = firstValue[ iAx ]; + vtkFloatingPointType tol = 0.1 * sqrt( minSize[ iAx ]) / rng; for ( ; val != comp.end(); ++val ) { - float value = ( *val - first ) / rng; + vtkFloatingPointType value = ( *val - first ) / rng; if ( value > bnd ) { values.push_back( value ); bnd = value + tol; @@ -1621,9 +1698,9 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName, } } // store values in gInfo - vector< float >& myComp = gInfo->myComponets[ iAx ]; + vector< vtkFloatingPointType >& myComp = gInfo->myComponets[ iAx ]; myComp.resize( nbVals ); - list< float >::iterator v = values.begin(); + list< vtkFloatingPointType >::iterator v = values.begin(); for ( int i = 0; v != values.end(); ++v ) myComp[ i++ ] = *v; } diff --git a/src/VISU_I/VISU_Result_i.hh b/src/VISU_I/VISU_Result_i.hh index 27ec5e08..35fac0fc 100644 --- a/src/VISU_I/VISU_Result_i.hh +++ b/src/VISU_I/VISU_Result_i.hh @@ -31,6 +31,8 @@ #include "VISU_BoostSignals.h" #include "SALOME_GenericObj_i.hh" +#include "VTKViewer.h" + #include #include @@ -175,17 +177,18 @@ namespace VISU // Info on structured mesh contained in TInput public: typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis; - const std::vector< float >* GetAxisInfo(const std::string& theMeshName, - TAxis theAxis, - gp_Dir& thePlaneNormal); + typedef std::vector< vtkFloatingPointType > TAxisInfo; + const TAxisInfo* GetAxisInfo(const std::string& theMeshName, + TAxis theAxis, + gp_Dir& thePlaneNormal); // Return i,j or k values and cutting plane normal for theAxis. // In the case of any problems, return NULL pointer private: struct TGridInfo { - std::vector< float > myComponets[ 3 ]; - gp_Dir myAxis [ 3 ]; + TAxisInfo myComponets[ 3 ]; + gp_Dir myAxis [ 3 ]; }; - map< string, TGridInfo > myMeshName2GridInfoMap; + std::map< std::string, TGridInfo > myMeshName2GridInfoMap; }; Result_var FindResult(SALOMEDS::SObject_ptr theSObject); diff --git a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc index c9ee0e66..f1fae442 100644 --- a/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc +++ b/src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc @@ -31,6 +31,8 @@ #include "VISU_Convertor.hxx" #include "VISU_ScalarMapAct.h" +#include "SUIT_ResourceMgr.h" + #include #include #include @@ -193,20 +195,20 @@ CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetScale(){ } void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){ - float aRange[2]; - aRange[0] = float(theMinRange); - aRange[1] = float(theMaxRange); + vtkFloatingPointType aRange[2]; + aRange[0] = vtkFloatingPointType(theMinRange); + aRange[1] = vtkFloatingPointType(theMaxRange); myScalarMapOnDeformedShapePL->SetScalarRange(aRange); } CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){ - float aRange[2]; + vtkFloatingPointType aRange[2]; myScalarMapOnDeformedShapePL->GetSourceRange(aRange); return aRange[0]; } CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){ - float aRange[2]; + vtkFloatingPointType aRange[2]; myScalarMapOnDeformedShapePL->GetSourceRange(aRange); return aRange[1]; } @@ -227,7 +229,11 @@ VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_In { if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<SetRepresentation(2); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2); + bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false); + anActor->SetRepresentation(aDispMode); + if (toShrink) anActor->SetShrink(); anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); anActor->SetVTKMapping(false); return anActor; @@ -251,8 +257,8 @@ void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) { void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName, const char* theFieldName, - const int theIteration, - const VISU::TEntity theEntity) + int theIteration, + VISU::TEntity theEntity) { if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<booleanValue("VISU", "scalar_map_shrink", false); bool toUseShading = aResourceMgr->booleanValue("VISU", "represent_shading", false); + anActor->SetRepresentation(aDispMode); + if (toShrink) anActor->SetShrink(); anActor->SetShading(toUseShading); UpdateActor(anActor); }catch(...){ @@ -339,14 +342,14 @@ VISU::ScalarMap_i vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty(); aTitleProp->SetFontFamily(myTitFontType); - aTitleProp->SetColor(myTitleColor); + aTitleProp->SetColor(myTitleColor[0],myTitleColor[1],myTitleColor[2]); (myIsBoldTitle)? aTitleProp->BoldOn() : aTitleProp->BoldOff(); (myIsItalicTitle)? aTitleProp->ItalicOn() : aTitleProp->ItalicOff(); (myIsShadowTitle)? aTitleProp->ShadowOn() : aTitleProp->ShadowOff(); vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty(); aLabelProp->SetFontFamily(myLblFontType); - aLabelProp->SetColor(myLabelColor); + aLabelProp->SetColor(myLabelColor[0],myLabelColor[1],myLabelColor[2]); (myIsBoldLabel)? aLabelProp->BoldOn() : aLabelProp->BoldOff(); (myIsItalicLabel)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff(); (myIsShadowLabel)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff(); diff --git a/src/VISU_I/VISU_StreamLines_i.cc b/src/VISU_I/VISU_StreamLines_i.cc index fbeeb75f..b5439316 100644 --- a/src/VISU_I/VISU_StreamLines_i.cc +++ b/src/VISU_I/VISU_StreamLines_i.cc @@ -31,6 +31,8 @@ #include "VISU_StreamLinesPL.hxx" #include "VISU_Convertor.hxx" +#include "SUIT_ResourceMgr.h" + #include #include #include @@ -271,6 +273,9 @@ VISU::StreamLines_i { if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO)){ anActor->SetVTKMapping(true); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "stream_lines_represent", 1); + anActor->SetRepresentation(aDispMode); return anActor; } return NULL; diff --git a/src/VISU_I/VISU_TimeAnimation.cxx b/src/VISU_I/VISU_TimeAnimation.cxx index fa5befe5..66b97cd5 100644 --- a/src/VISU_I/VISU_TimeAnimation.cxx +++ b/src/VISU_I/VISU_TimeAnimation.cxx @@ -42,10 +42,12 @@ #include "SALOMEDSClient_AttributeComment.hxx" #include "SALOMEDSClient_AttributeName.hxx" +#include "CASCatch.hxx" #include #include #include +#include using namespace std; @@ -76,6 +78,9 @@ VISU_TimeAnimation::VISU_TimeAnimation (_PTR(Study) theStudy, myCycling = false; myAnimEntry = ""; + + myDumpPath = ""; + myAVIMaker = "jpeg2yuv"; } @@ -90,6 +95,25 @@ VISU_TimeAnimation::~VISU_TimeAnimation() for (int i = 0; i < getNbFields(); i++) { clearData(myFieldsLst[i]); } + + /* Terminates the execution of the thread. + * The thread may or may not be terminated immediately, + * depending on the operating system's scheduling policies. + * + * Use QThread::wait() after terminate() for synchronous termination. + * + * When the thread is terminated, all threads waiting for the the thread to finish will be woken up. + * + * Warning: This function is dangerous, and its use is discouraged. + * The thread can be terminated at any point in its code path. + * Threads can be terminated while modifying data. + * 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); } @@ -194,13 +218,27 @@ namespace QString aFieldName = VISU::Storable::FindValue(aTimeMap,"myFieldName"); int aTimeStampId = VISU::Storable::FindValue(aTimeMap,"myTimeStampId").toInt(); + bool anIsCreated = false; TPrs3d* aPresent = new TPrs3d(theResult, false); - aPresent->Create(aMeshName.latin1(), anEntity, - aFieldName.latin1(), aTimeStampId); - theData.myPrs[aFrameId++] = aPresent; - - aMin = std::min(aPresent->GetMin(), aMin); - aMax = std::max(aPresent->GetMax(), aMax); + CASCatch_TRY{ + try{ + if(aPresent->Create(aMeshName.latin1(),anEntity,aFieldName.latin1(),aTimeStampId)){ + anIsCreated = true; + theData.myPrs[aFrameId++] = aPresent; + aMin = std::min(aPresent->GetMin(), aMin); + aMax = std::max(aPresent->GetMax(), aMax); + } + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<GetMessageString()); + } + if(!anIsCreated) + aPresent->_remove_ref(); } theData.myNbFrames = aFrameId; @@ -547,9 +585,15 @@ void VISU_TimeAnimation::run() double aOneVal = 1; if (myFieldsLst[0].myNbFrames > 2) aOneVal = myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0]; + myFileIndex = 0; + int aNbFiles = 0; + QValueList anIndexList; + qApp->lock(); while (myIsActive) { emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]); + if(!(myFieldsLst[0].myField)) + break; for (int i = 0; i < getNbFields(); i++) { FieldData& aData = myFieldsLst[i]; if (myFrame > 0) { @@ -582,6 +626,7 @@ void VISU_TimeAnimation::run() } } int delay = (int)(1000. * k / mySpeed); + isDumping = !myDumpPath.isEmpty(); if (delay < 1 && isDumping) { // We must unlock mutex for some time before grabbing to allow view updating delay = 1; @@ -593,17 +638,61 @@ void VISU_TimeAnimation::run() if (isDumping) { // We must unlock mutex for some time before grabbing to allow view updating qApp->unlock(); - msleep(100); + msleep(delay); qApp->lock(); - QString aFile(myDumpPath); - QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]); - int aPos = -1; - while ((aPos = aName.find(".")) > -1 ) - aName.replace(aPos, 1, "_"); - aFile += aName; - aFile += "."; - aFile += myDumpFormat.lower(); - myView->dumpViewToFormat(aFile,myDumpFormat); + if(!(myFieldsLst[0].myField)) // break, if field was deleted. + break; + if (myDumpFormat.compare("AVI") != 0) { + QString aFile(myDumpPath); + QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]); + int aPos = -1; + while ((aPos = aName.find(".")) > -1 ) + aName.replace(aPos, 1, "_"); + aFile += aName; + aFile += "."; + aFile += myDumpFormat.lower(); + myView->dumpViewToFormat(aFile,myDumpFormat); + } else { + QFileInfo aFileInfo(myDumpPath); + QString aDirPath = aFileInfo.dirPath(true); + QString aBaseName = aFileInfo.fileName(); + + switch (myFrame) { + case 0: + break; + case 1: + myFileIndex += 5; + break; + default: + if (myProportional) { + double p = (myFieldsLst[0].myTiming[myFrame] - + myFieldsLst[0].myTiming[myFrame-1]) / aOneVal; + myFileIndex += (long) (5*p); + } else { + myFileIndex += 5; + } + } + + QString aFile = aDirPath + QDir::separator() + aBaseName; + aFile += "_"; + aFile += QString("%1").arg(myFileIndex).rightJustify(8, '0'); + aFile += ".jpeg"; + + /* check image size is divisable 16 + myView->dumpViewToFormat(aFile,"JPEG"); + */ + SUIT_ViewWindow* aView = myView; + QImage img = aView->dumpView(); + if (!img.isNull()) { + int width = img.width(); width = (width/16)*16; + int height = img.height(); height = (height/16)*16; + QImage copy = img.copy(0, 0, width, height); + if (copy.save(aFile, "JPEG")) { + anIndexList.append(myFileIndex); + aNbFiles++; + } + } + } } if (!myIsActive) break; @@ -618,6 +707,58 @@ void VISU_TimeAnimation::run() myFrame = 0; } } + + // make AVI file if need + if (isDumping && 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 (anIndexList.count() > 1) { + QString aFFile = aDirPath + QDir::separator() + aBaseName; + aFFile += QString("_%1.jpeg"); + int aStartIndex = anIndexList[0], anEndIndex; + for (int i = 1; i < anIndexList.count(); i++) { + anEndIndex = anIndexList[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; + } + } + + // 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()); + } + emit stopped(); qApp->unlock(); QThread::exit(); @@ -676,7 +817,8 @@ std::string VISU_TimeAnimation::setDumpFormat(const char* theFormat) { myDumpFormat = theFormat; QStrList aDumpFormats = QImageIO::outputFormats(); - if (myDumpFormat.isEmpty() || aDumpFormats.find(theFormat) < 0) { + if (myDumpFormat.isEmpty() || + (aDumpFormats.find(theFormat) < 0 && myDumpFormat.compare("AVI") != 0)) { if (aDumpFormats.find("JPEG")) myDumpFormat = "JPEG"; else @@ -685,6 +827,19 @@ std::string VISU_TimeAnimation::setDumpFormat(const char* theFormat) return myDumpFormat.latin1(); } +//------------------------------------------------------------------------ +bool VISU_TimeAnimation::checkAVIMaker() const +{ + QStrList aDumpFormats = QImageIO::outputFormats(); + if (aDumpFormats.find("JPEG") < 0) return false; + + QString aCmd("which "); + aCmd += myAVIMaker; + aCmd += " >& /dev/null"; + int iErr = system(aCmd.latin1()); + return (iErr == 0); +} + //************************************************************************ int VISU_TimeAnimation::myNBAnimations = 0; QString VISU_TimeAnimation::GenerateName() diff --git a/src/VISU_I/VISU_TimeAnimation.h b/src/VISU_I/VISU_TimeAnimation.h index bb1925a8..ea14a17a 100644 --- a/src/VISU_I/VISU_TimeAnimation.h +++ b/src/VISU_I/VISU_TimeAnimation.h @@ -20,7 +20,8 @@ class SVTK_ViewWindow; class VISU_Actor; -namespace VISU{ +namespace VISU +{ class Result_i; class ColoredPrs3d_i; } @@ -34,7 +35,7 @@ struct FieldData std::vector myPrs; // Presentations std::vector myActors; // Actors std::vector myTiming; // time values - float myOffset[3]; + CORBA::Float myOffset[3]; }; @@ -102,6 +103,7 @@ class VISU_TimeAnimation: public QObject, public QThread void dumpTo(const char* thePath) { myDumpPath = thePath; } std::string setDumpFormat(const char* theFormat); + bool checkAVIMaker() const; QString getLastErrorMsg() { return myLastError; } @@ -149,6 +151,8 @@ class VISU_TimeAnimation: public QObject, public QThread double myTimeMin , myTimeMax ; //!< Range of time stams, available for animation QString myDumpPath; QString myDumpFormat; + QString myAVIMaker; + long myFileIndex; SVTK_ViewWindow* myView; QString myAnimEntry; diff --git a/src/VISU_I/VISU_Vectors_i.cc b/src/VISU_I/VISU_Vectors_i.cc index 071ba811..878f25e8 100644 --- a/src/VISU_I/VISU_Vectors_i.cc +++ b/src/VISU_I/VISU_Vectors_i.cc @@ -31,6 +31,8 @@ #include "VISU_VectorsPL.hxx" #include "VISU_Convertor.hxx" +#include "SUIT_ResourceMgr.h" + #include using namespace VISU; @@ -194,6 +196,9 @@ VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)& anActor->SetBarVisibility(true); anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B); anActor->GetProperty()->SetLineWidth(GetLineWidth()); + SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); + int aDispMode = aResourceMgr->integerValue("VISU", "vectors_represent", 1); + anActor->SetRepresentation(aDispMode); UpdateActor(anActor); }catch(...){ anActor->Delete(); diff --git a/src/VISU_I/VISU_View_i.cc b/src/VISU_I/VISU_View_i.cc index 57a37098..ae5bf27c 100644 --- a/src/VISU_I/VISU_View_i.cc +++ b/src/VISU_I/VISU_View_i.cc @@ -29,11 +29,13 @@ #include "VISU_Gen_i.hh" #include "VISU_Prs3d_i.hh" #include "VISU_Table_i.hh" +#include "VISU_ScalarMap_i.hh" #include "VISU_ViewManager_i.hh" #include "VisuGUI_TableDlg.h" #include "VISU_Actor.h" +#include "VISU_ScalarMapAct.h" #include "SALOME_Event.hxx" @@ -1520,7 +1522,7 @@ namespace VISU { }else{ if(SUIT_ViewManager* aViewManager = myApplication->activeViewManager()){ if(SUIT_ViewWindow* aView = aViewManager->getActiveView()){ - if(SVTK_ViewWindow* aViewWindow = dynamic_cast(aView)){ + if(dynamic_cast(aView)){ myView3D->myViewManager = aViewManager; myResult = aViewManager->getActiveView(); } @@ -1759,7 +1761,7 @@ namespace VISU { { Storable::DataToStream(theStr,"myType",VISU::TVIEW3D); - float backint[3]; + vtkFloatingPointType backint[3]; GetRenderer(theViewWindow)->GetBackground(backint); Storable::DataToStream(theStr,"myColor.R",backint[0]); Storable::DataToStream(theStr,"myColor.G",backint[1]); @@ -1847,7 +1849,7 @@ namespace VISU { SALOMEDS::Color View3D_i::GetBackground (SUIT_ViewWindow* theViewWindow) { SALOMEDS::Color aColor; - float backint[3]; + vtkFloatingPointType backint[3]; GetRenderer(theViewWindow)->GetBackground(backint); aColor.R = backint[0]; aColor.G = backint[1]; aColor.B = backint[2]; return aColor; @@ -2160,4 +2162,316 @@ namespace VISU { ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,aVW,aScale)); } } + + //================================================ + // Certain presentation view parameters management + //================================================ + class TPrsManageEvent: public SALOME_Event + { + protected: + View3D_i* myView3D; + ScalarMap_ptr myPrs; + string myError; + + TPrsManageEvent(View3D_i* theView3D, ScalarMap_ptr thePrs): + myView3D(theView3D), + myPrs(ScalarMap::_duplicate(thePrs)), + myError("Unknown error occured") + {} + VISU_Actor* GetMyActor() + { + SUIT_ViewWindow* aVW = myView3D->GetViewWindow(); + SVTK_ViewWindow* vw = dynamic_cast(aVW); + if (!aVW) { + myError = "Corrupted view window"; + } else { + ScalarMap_i* aPrs = dynamic_cast(VISU::GetServant(myPrs).in()); + if (!aPrs) { + myError = "Corrupted presentation"; + } else { + VISU_Actor* anActor = VISU::GetActor(aPrs, vw); + if (!anActor) { + myError = "No actor found. Display the presentation at first."; + } else { + myError = ""; + return anActor; + } + } + } + return NULL; + } + }; + + // Get + class TGetPrsTypeEvent: public TPrsManageEvent { + public: + typedef VISU::PresentationType TResult; + TResult myResult; + TGetPrsTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs): + TPrsManageEvent(theView3D, thePrs), myResult(VISU::SHRINK) {} + virtual void Execute() { + if (VISU_Actor* anActor = GetMyActor()) + myResult = (VISU::PresentationType)anActor->GetRepresentation(); + } + }; + + class TGetShrinkedEvent: public TPrsManageEvent { + public: + typedef bool TResult; + TResult myResult; + TGetShrinkedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs): + TPrsManageEvent(theView3D, thePrs), myResult(false) {} + virtual void Execute() { + if (VISU_Actor* anActor = GetMyActor()) { + if (anActor->IsShrunkable()) + myResult = anActor->IsShrunk(); + else + myResult = false; + } + } + }; + + class TGetShadedEvent: public TPrsManageEvent { + public: + typedef bool TResult; + TResult myResult; + TGetShadedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs): + TPrsManageEvent(theView3D, thePrs), myResult(false) {} + virtual void Execute() { + if (VISU_Actor* anActor = GetMyActor()) + if (VISU_ScalarMapAct* aScalarMapActor = dynamic_cast(anActor)) + myResult = aScalarMapActor->IsShading(); + } + }; + + class TGetOpacityEvent: public TPrsManageEvent { + public: + typedef double TResult; + TResult myResult; + TGetOpacityEvent(View3D_i* theView3D, ScalarMap_ptr thePrs): + TPrsManageEvent(theView3D, thePrs), myResult(-1.0) {} + virtual void Execute() { + if (VISU_Actor* anActor = GetMyActor()) { + vtkFloatingPointType oldvalue = anActor->GetOpacity(); + myResult = (double)oldvalue; + } + } + }; + + class TGetLineWidthEvent: public TPrsManageEvent { + public: + typedef double TResult; + TResult myResult; + TGetLineWidthEvent(View3D_i* theView3D, ScalarMap_ptr thePrs): + TPrsManageEvent(theView3D, thePrs), myResult(-1.0) {} + virtual void Execute() { + if (VISU_Actor* anActor = GetMyActor()) { + vtkFloatingPointType oldvalue = anActor->GetLineWidth(); + myResult = (double)oldvalue; + } + } + }; + + // Set + class TSetPrsTypeEvent: public TPrsManageEvent { + private: + PresentationType myPrsType; + public: + typedef string TResult; + TResult myResult; + TSetPrsTypeEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, PresentationType thePrsType): + TPrsManageEvent(theView3D, thePrs), myPrsType(thePrsType), + myResult("Unknown error occured") + {} + virtual void Execute() { + switch (myPrsType) { + case VISU::INSIDEFRAME: + { + VISU::VISUType aType = myPrs->GetType(); + if (aType != VISU::TSCALARMAP && + aType != VISU::TDEFORMEDSHAPE && + aType != VISU::TSCALARMAPONDEFORMEDSHAPE) { + myResult = "Insideframe representation is not available for this type of presentations."; + return; + } + } + break; + case VISU::SURFACEFRAME: + myResult = "Surfaceframe representation is available only for mesh presentation."; + return; + case VISU::SHRINK: + myResult = "Use SetShrinked() method to shrink/unshrink presentation."; + return; + default: + break; + } + if (VISU_Actor* anActor = GetMyActor()) { + anActor->SetRepresentation((int)myPrsType); + SVTK_ViewWindow* vw = dynamic_cast(myView3D->GetViewWindow()); + vw->Repaint(); + myResult = ""; + } else { + myResult = myError; + } + } + }; + + class TSetShrinkedEvent: public TPrsManageEvent { + private: + bool myIsOn; + public: + typedef string TResult; + TResult myResult; + TSetShrinkedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, bool isOn): + TPrsManageEvent(theView3D, thePrs), myIsOn(isOn), + myResult("Unknown error occured") + {} + virtual void Execute() { + VISU::VISUType aType = myPrs->GetType(); + if (aType == VISU::TVECTORS || aType == VISU::TSTREAMLINES) { + myResult = "Shrinked representation is not available for this type of presentations."; + } else { + if (VISU_Actor* anActor = GetMyActor()) { + if (anActor->IsShrunkable()) { + if (myIsOn) anActor->SetShrink(); + else anActor->UnShrink(); + SVTK_ViewWindow* vw = dynamic_cast(myView3D->GetViewWindow()); + vw->Repaint(); + myResult = ""; + } else { + myResult = "This presentation is not shrunkable."; + } + } else { + myResult = myError; + } + } + } + }; + + class TSetShadedEvent: public TPrsManageEvent { + private: + bool myIsOn; + public: + typedef string TResult; + TResult myResult; + TSetShadedEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, bool isOn): + TPrsManageEvent(theView3D, thePrs), myIsOn(isOn), + myResult("Unknown error occured") + {} + virtual void Execute() { + if (VISU_Actor* anActor = GetMyActor()) { + if (VISU_ScalarMapAct* aScalarMapActor = + dynamic_cast(anActor)) { + aScalarMapActor->SetShading(myIsOn); + SVTK_ViewWindow* vw = dynamic_cast(myView3D->GetViewWindow()); + vw->Repaint(); + myResult = ""; + } else { + myResult = "Corrupted actor"; + } + } else { + myResult = myError; + } + } + }; + + class TSetOpacityEvent: public TPrsManageEvent { + private: + double myOpacity; + public: + typedef string TResult; + TResult myResult; + TSetOpacityEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, double theOpacity): + TPrsManageEvent(theView3D, thePrs), myOpacity(theOpacity), + myResult("Unknown error occured") + {} + virtual void Execute() { + VISU::VISUType aType = myPrs->GetType(); + if (aType == VISU::TVECTORS || aType == VISU::TSTREAMLINES) { + myResult = "Opacity is meaningless for this type of presentations."; + return; + } + if (VISU_Actor* anActor = GetMyActor()) { + anActor->SetOpacity((vtkFloatingPointType)myOpacity); + SVTK_ViewWindow* vw = dynamic_cast(myView3D->GetViewWindow()); + vw->Repaint(); + myResult = ""; + } else { + myResult = myError; + } + } + }; + + class TSetLineWidthEvent: public TPrsManageEvent { + private: + double myLineWidth; + public: + typedef string TResult; + TResult myResult; + TSetLineWidthEvent(View3D_i* theView3D, ScalarMap_ptr thePrs, double theLineWidth): + TPrsManageEvent(theView3D, thePrs), myLineWidth(theLineWidth), + myResult("Unknown error occured") + {} + virtual void Execute() { + if (myPrs->GetType() == VISU::TVECTORS) { + myResult = "Line Width is meaningless for Vectors presentation."; + return; + } + if (VISU_Actor* anActor = GetMyActor()) { + anActor->SetLineWidth((vtkFloatingPointType)myLineWidth); + SVTK_ViewWindow* vw = dynamic_cast(myView3D->GetViewWindow()); + vw->Repaint(); + myResult = ""; + } else { + myResult = myError; + } + } + }; + + PresentationType View3D_i::GetPresentationType(ScalarMap_ptr thePrs) + { + return ProcessEvent(new TGetPrsTypeEvent(this,thePrs)); + } + CORBA::Boolean View3D_i::IsShrinked(ScalarMap_ptr thePrs) + { + return ProcessEvent(new TGetShrinkedEvent(this,thePrs)); + } + CORBA::Boolean View3D_i::IsShaded(ScalarMap_ptr thePrs) + { + return ProcessEvent(new TGetShadedEvent(this,thePrs)); + } + CORBA::Double View3D_i::GetOpacity(ScalarMap_ptr thePrs) + { + return ProcessEvent(new TGetOpacityEvent(this,thePrs)); + } + CORBA::Double View3D_i::GetLineWidth(ScalarMap_ptr thePrs) + { + return ProcessEvent(new TGetLineWidthEvent(this,thePrs)); + } + + char* View3D_i::SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType) + { + string aRet = ProcessEvent(new TSetPrsTypeEvent(this,thePrs,thePrsType)); + return CORBA::string_dup(aRet.c_str()); + } + char* View3D_i::SetShrinked(ScalarMap_ptr thePrs, CORBA::Boolean isShrinked) + { + string aRet = ProcessEvent(new TSetShrinkedEvent(this,thePrs,isShrinked)); + return CORBA::string_dup(aRet.c_str()); + } + char* View3D_i::SetShaded(ScalarMap_ptr thePrs, CORBA::Boolean isShaded) + { + string aRet = ProcessEvent(new TSetShadedEvent(this,thePrs,isShaded)); + return CORBA::string_dup(aRet.c_str()); + } + char* View3D_i::SetOpacity(ScalarMap_ptr thePrs, CORBA::Double theOpacity) + { + string aRet = ProcessEvent(new TSetOpacityEvent(this,thePrs,theOpacity)); + return CORBA::string_dup(aRet.c_str()); + } + char* View3D_i::SetLineWidth(ScalarMap_ptr thePrs, CORBA::Double theLineWidth) + { + string aRet = ProcessEvent(new TSetLineWidthEvent(this,thePrs,theLineWidth)); + return CORBA::string_dup(aRet.c_str()); + } } diff --git a/src/VISU_I/VISU_View_i.hh b/src/VISU_I/VISU_View_i.hh index 76b44da5..72ebb313 100644 --- a/src/VISU_I/VISU_View_i.hh +++ b/src/VISU_I/VISU_View_i.hh @@ -292,6 +292,19 @@ namespace VISU virtual void Close(); + // Certain presentation view parameters management + virtual PresentationType GetPresentationType(ScalarMap_ptr thePrs); + virtual CORBA::Boolean IsShrinked (ScalarMap_ptr thePrs); + virtual CORBA::Boolean IsShaded (ScalarMap_ptr thePrs); + virtual CORBA::Double GetOpacity (ScalarMap_ptr thePrs); + virtual CORBA::Double GetLineWidth (ScalarMap_ptr thePrs); + + virtual char* SetPresentationType(ScalarMap_ptr thePrs, PresentationType thePrsType); + virtual char* SetShrinked (ScalarMap_ptr thePrs, CORBA::Boolean isShrinked); + virtual char* SetShaded (ScalarMap_ptr thePrs, CORBA::Boolean isShaded); + virtual char* SetOpacity (ScalarMap_ptr thePrs, CORBA::Double theOpacity); + virtual char* SetLineWidth (ScalarMap_ptr thePrs, CORBA::Double theLineWidth); + protected: static int myNbViewParams; diff --git a/src/VISU_SWIG/Makefile.in b/src/VISU_SWIG/Makefile.in index 93d34b31..753d607f 100644 --- a/src/VISU_SWIG/Makefile.in +++ b/src/VISU_SWIG/Makefile.in @@ -45,14 +45,20 @@ EXPORT_PYSCRIPTS = libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py bat visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py \ visu_table.py visu_big_table.py visu_view.py visu_delete.py \ visu_swig_test.py test_events.py batch_test_events.py visu_split_views.py \ - VISU_Example_01.py VISU_Example_02.py VISU_Example_03.py VISU_Example_04.py VISU_Example_05.py VISU_Example_06.py + VISU_Example_01.py VISU_Example_02.py VISU_Example_03.py VISU_Example_04.py \ + VISU_Example_05.py VISU_Example_06.py VISU_Example_07.py EXPORT_SHAREDPYSCRIPTS = VISU_shared_modules.py LIB_CLIENT_IDL = -CPPFLAGS += -ftemplate-depth-32 $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \ - $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome \ - -I${MED_ROOT_DIR}/include/salome \ +CPPFLAGS += -ftemplate-depth-32 \ + $(PYTHON_INCLUDES) \ + $(HDF5_INCLUDES) \ + $(QT_INCLUDES) \ + $(VTK_INCLUDES) \ + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(MED_CXXFLAGS) \ $(BOOST_CPPFLAGS) LDFLAGS += $(PYTHON_LIBS) -lVisuConvertor -lVisuPipeLine diff --git a/src/VISU_SWIG/VISU_Example_01.py b/src/VISU_SWIG/VISU_Example_01.py index e9727b81..ebc0ee76 100644 --- a/src/VISU_SWIG/VISU_Example_01.py +++ b/src/VISU_SWIG/VISU_Example_01.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # T 2.23, 28: Displaying fields (scalar and vectorial) on nodes, change presentation options. # Uses MED files ResOK_0000.med and Fields_group3D.med # diff --git a/src/VISU_SWIG/VISU_Example_02.py b/src/VISU_SWIG/VISU_Example_02.py index 38f2b6b6..22444536 100644 --- a/src/VISU_SWIG/VISU_Example_02.py +++ b/src/VISU_SWIG/VISU_Example_02.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # T 2.24: Save/retrieve view parameters. # Uses MED file fra.med from ${DATA_DIR}/MedFiles directory. # diff --git a/src/VISU_SWIG/VISU_Example_03.py b/src/VISU_SWIG/VISU_Example_03.py index dfa066cc..4bb09217 100644 --- a/src/VISU_SWIG/VISU_Example_03.py +++ b/src/VISU_SWIG/VISU_Example_03.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # Animation of "vitesse" field, stored in file TimeStamps.med # # This script is equivalent to non-regression test script 003/A5 diff --git a/src/VISU_SWIG/VISU_Example_04.py b/src/VISU_SWIG/VISU_Example_04.py index 9ae4d110..d7723f8e 100644 --- a/src/VISU_SWIG/VISU_Example_04.py +++ b/src/VISU_SWIG/VISU_Example_04.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # Show some results presentations in different 3D and 2D viewers # with different options (view parameters and display modes). # Uses MED files fra.med and TimeStamps.med from ${DATA_DIR}/MedFiles directory. @@ -236,7 +255,7 @@ myResult = myVisu.ImportFile(medFile) anAnim = myVisu.CreateAnimation(myView); aSObj = myStudy.FindObjectIOR(myResult.GetID()) aSObj = aSObj.FindSubObject(1)[1] -aSObj = aSObj.FindSubObject(2)[1] +aSObj = aSObj.FindSubObject(3)[1] aSObj = aSObj.FindSubObject(2)[1] anAnim.addField(aSObj) anAnim.setPresentationType(0,VISU.TISOSURFACE) diff --git a/src/VISU_SWIG/VISU_Example_05.py b/src/VISU_SWIG/VISU_Example_05.py index a70943e4..65b5a006 100644 --- a/src/VISU_SWIG/VISU_Example_05.py +++ b/src/VISU_SWIG/VISU_Example_05.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # Create a table and show it in Plot2d viewer # # This script is equivalent to script VISU_SWIG/visu_big_table.py diff --git a/src/VISU_SWIG/VISU_Example_06.py b/src/VISU_SWIG/VISU_Example_06.py index 622b6cb4..35cf052f 100644 --- a/src/VISU_SWIG/VISU_Example_06.py +++ b/src/VISU_SWIG/VISU_Example_06.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # Import a table from file and show it in Plot2d viewer import salome diff --git a/src/VISU_SWIG/VISU_Example_07.py b/src/VISU_SWIG/VISU_Example_07.py new file mode 100644 index 00000000..9a43133a --- /dev/null +++ b/src/VISU_SWIG/VISU_Example_07.py @@ -0,0 +1,161 @@ +# Copyright (C) 2005 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/ +# +# Manage view parameters of presentations: +# Representation Mode, Shrink, Shading, Opacity, Line Width + +import salome + +import VISU +import visu_gui + +import os +import time + +datadir = os.getenv("DATA_DIR") + "/MedFiles/" + +myVisu = visu_gui.myVisu +myVisu.SetCurrentStudy(salome.myStudy) +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +sleep_delay = 1 + +def AfterSet(error_string, method_name, old_value, new_value): + print method_name, "(): old_value = ", old_value, "new_value = ", new_value + if error_string == "": + time.sleep(sleep_delay) + else: + print method_name, "() error = ", error_string + pass + pass + +def ChangeRepresentation(scalarmap,repres,shrink,shading,opacity,linew): + if scalarmap is None : print "Error" + else : print "OK" + + myView.DisplayOnly(scalarmap) + myView.FitAll() + + time.sleep(sleep_delay) + + # enum PresentationType{ POINT, WIREFRAME, SHADED, INSIDEFRAME, SURFACEFRAME, SHRINK } + old_prs_type = myView.GetPresentationType(scalarmap) + if old_prs_type != repres: + err_str = myView.SetPresentationType(scalarmap, repres) + AfterSet(err_str, "SetPresentationType", old_prs_type, repres) + pass + + old_is_shrinked = myView.IsShrinked(scalarmap) + if old_is_shrinked != shrink: + err_str = myView.SetShrinked(scalarmap, shrink) # 1 - shrinked, 0 - not shrinked + AfterSet(err_str, "SetShrinked", old_is_shrinked, shrink) + pass + + old_is_shaded = myView.IsShaded(scalarmap) + if old_is_shaded != shading: + err_str = myView.SetShaded(scalarmap, shading) # 1 - shaded, 0 - not shaded + AfterSet(err_str, "SetShaded", old_is_shaded, shading) + pass + + old_opacity = myView.GetOpacity(scalarmap) + if old_opacity != opacity: + err_str = myView.SetOpacity(scalarmap, opacity) # double value [0, 1] + AfterSet(err_str, "SetOpacity", old_opacity, opacity) + pass + + old_linew = myView.GetLineWidth(scalarmap) + if old_linew != linew: + err_str = myView.SetLineWidth(scalarmap, linew) # double value, recommended round [1, 10] + AfterSet(err_str, "SetLineWidth", old_linew, linew) + pass + + print "" + pass + +# ResOK_0000.med + +print 'Import "ResOK_0000.med"...............', +medFile = datadir + "ResOK_0000.med" +myMeshName = 'dom' +myFieldName = 'vitesse' + +myResult = myVisu.ImportFile(medFile) +if myResult is None : print "Error" +else : print "OK" + +print "Creating Scalar Map.......", +scmap = myVisu.ScalarMapOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.INSIDEFRAME, 1, 0, 0.3, 5) + +print "Creating Stream Lines.......", +scmap = myVisu.StreamLinesOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.WIREFRAME, 1, 1, 0.5, 3) + +print "Creating Vectors..........", +scmap = myVisu.VectorsOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.WIREFRAME, 1, 1, 0.7, 2) + +print "Creating Iso Surfaces.....", +scmap = myVisu.IsoSurfacesOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.SHADED, 1, 0, 0.4, 8) + +print "Creating Cut Planes.......", +scmap = myVisu.CutPlanesOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.POINT, 0, 0, 0.6, 4) + +# fra.med + +print 'Import "fra.med"...............', +medFile = datadir + "fra.med" +myMeshName = 'LE VOLUME' +myFieldName = 'VITESSE' + +myResult = myVisu.ImportFile(medFile) +if myResult is None : print "Error" +else : print "OK" + +print "Creating Scalar Map.......", +scmap = myVisu.ScalarMapOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.WIREFRAME, 1, 1, 0.5, 3) + +print "Creating Iso Surfaces.....", +scmap = myVisu.IsoSurfacesOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.WIREFRAME, 1, 1, 0.5, 3) + +print "Creating Cut Planes.......", +scmap = myVisu.CutPlanesOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.SHADED, 1, 1, 0.5, 3) + +print "Creating Scalar Map On Deformed Shape.......", +scmap = myVisu.ScalarMapOnDeformedShapeOnField(myResult,myMeshName,VISU.NODE,myFieldName,1); +ChangeRepresentation(scmap, VISU.SHADED, 1, 1, 0.5, 3) + +print "Creating Deformed Shape.......", +scmap = myVisu.DeformedShapeOnField(myResult,myMeshName,VISU.NODE,myFieldName,1) +scmap.ShowColored(1) +ChangeRepresentation(scmap, VISU.WIREFRAME, 1, 1, 0.5, 3) + +print "Creating Cut Lines.......", +scmap = myVisu.CutLinesOnField(myResult,myMeshName,VISU.NODE,myFieldName,1) +ChangeRepresentation(scmap, VISU.WIREFRAME, 1, 1, 0.5, 3) + +print "Creating Plot 3D.......", +scmap = myVisu.Plot3DOnField(myResult,myMeshName,VISU.NODE,myFieldName,1) +ChangeRepresentation(scmap, VISU.SHADED, 1, 1, 0.5, 3) diff --git a/src/VISU_SWIG/VISU_shared_modules.py b/src/VISU_SWIG/VISU_shared_modules.py index afd4231f..1401ffce 100644 --- a/src/VISU_SWIG/VISU_shared_modules.py +++ b/src/VISU_SWIG/VISU_shared_modules.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# """ """ diff --git a/src/VISU_SWIG/batch_test_events.py b/src/VISU_SWIG/batch_test_events.py index df7f3c3c..e59ca1ab 100644 --- a/src/VISU_SWIG/batch_test_events.py +++ b/src/VISU_SWIG/batch_test_events.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# ############################################################### # # File : batch_test_events.py diff --git a/src/VISU_SWIG/batchmode_visu_view3d.py b/src/VISU_SWIG/batchmode_visu_view3d.py index f5154355..cc4778d5 100644 --- a/src/VISU_SWIG/batchmode_visu_view3d.py +++ b/src/VISU_SWIG/batchmode_visu_view3d.py @@ -246,7 +246,7 @@ myResult = myVisu.ImportFile(medFile) anAnim = myVisu.CreateAnimation(myView); aSObj = myStudy.FindObjectIOR(myResult.GetID()) aSObj = aSObj.FindSubObject(1)[1] -aSObj = aSObj.FindSubObject(2)[1] +aSObj = aSObj.FindSubObject(3)[1] aSObj = aSObj.FindSubObject(2)[1] anAnim.addField(aSObj) anAnim.setPresentationType(0,VISU.TISOSURFACE) diff --git a/src/VISU_SWIG/test_events.py b/src/VISU_SWIG/test_events.py index df53a3e8..f13ca006 100755 --- a/src/VISU_SWIG/test_events.py +++ b/src/VISU_SWIG/test_events.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# ############################################################### # # File : test_events.py diff --git a/src/VISU_SWIG/visu.py b/src/VISU_SWIG/visu.py index ea05e2bf..c287e79a 100644 --- a/src/VISU_SWIG/visu.py +++ b/src/VISU_SWIG/visu.py @@ -345,7 +345,9 @@ def CreatePrsForResult(theVisu, theResult, theView, thePrsTypeList, thePictureDi while aFolderIter.More() : aFolderSObj = aFolderIter.Value() aFolderIter.Next() - anAttr = aFolderSObj.FindAttribute("AttributeName")[1] + anIsFound, anAttr = aFolderSObj.FindAttribute("AttributeName") + if not anIsFound : + continue anAttr = anAttr._narrow(SALOMEDS.AttributeName); aFolderName = anAttr.Value() print " ", aFolderName diff --git a/src/VISU_SWIG/visu_delete.py b/src/VISU_SWIG/visu_delete.py index d001d601..42fe0bef 100644 --- a/src/VISU_SWIG/visu_delete.py +++ b/src/VISU_SWIG/visu_delete.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# import VISU import SALOMEDS from visu_gui import * diff --git a/src/VISU_SWIG/visu_med.py b/src/VISU_SWIG/visu_med.py index 04715e52..33d05a73 100644 --- a/src/VISU_SWIG/visu_med.py +++ b/src/VISU_SWIG/visu_med.py @@ -13,8 +13,9 @@ import SALOMEDS import SALOME_MED import VISU -from libSALOME_Swig import * -sg = SALOMEGUI_Swig() +if salome.hasDesktop(): + from libSALOME_Swig import * + sg = SALOMEGUI_Swig() def getMedObjectFromStudy(): mySO = salome.myStudy.FindObject("Objet MED") @@ -47,7 +48,8 @@ medDir = os.getenv('DATA_DIR') + '/MedFiles/' def importMedFrom(medDir,medFile): medFile = medDir + medFile med_comp.readStructFileWithFieldType(medFile,salome.myStudyName) - sg.updateObjBrowser(1) + if salome.hasDesktop(): + sg.updateObjBrowser(1) def importMed(medFile): importMedFrom(medDir,medFile) diff --git a/src/VISU_SWIG/visu_prs_example.py b/src/VISU_SWIG/visu_prs_example.py index 1453c5ad..c16e5413 100644 --- a/src/VISU_SWIG/visu_prs_example.py +++ b/src/VISU_SWIG/visu_prs_example.py @@ -15,9 +15,9 @@ import SALOME import SALOME_MED import VISU -from libSALOME_Swig import * -sg = SALOMEGUI_Swig() - +if salome.hasDesktop(): + from libSALOME_Swig import * + sg = SALOMEGUI_Swig() import visu_gui myVisu = visu_gui.myVisu @@ -57,8 +57,8 @@ try: aScalarMap2 = myVisu.ScalarMapOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId) if(myField.getNumberOfComponents() > 1) : aCutPlanes = myVisu.CutPlanesOnField(myResult2, aMeshName, anEntity, myField.getName(), aTimeStampId) - - sg.updateObjBrowser(0) + if salome.hasDesktop(): + sg.updateObjBrowser(0) else : print "We have no permission to rewrite medFile, so readStructFileWithFieldType can't open this file"; else : print "We have no permission to read medFile, it will not be opened"; except: diff --git a/src/VISU_SWIG/visu_split_views.py b/src/VISU_SWIG/visu_split_views.py index 545ed7a3..bb15f009 100644 --- a/src/VISU_SWIG/visu_split_views.py +++ b/src/VISU_SWIG/visu_split_views.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# import VISU import SALOMEDS diff --git a/src/VISU_SWIG/visu_swig_test.py b/src/VISU_SWIG/visu_swig_test.py index 411e532e..b8ced541 100644 --- a/src/VISU_SWIG/visu_swig_test.py +++ b/src/VISU_SWIG/visu_swig_test.py @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# from libVISU_Swig import * medFile = os.getenv('DATA_DIR') + '/MedFiles/fra.med' myCon=Convertor(medFile) diff --git a/src/VISU_SWIG/visu_view3d.py b/src/VISU_SWIG/visu_view3d.py index d1bf0721..0c847037 100644 --- a/src/VISU_SWIG/visu_view3d.py +++ b/src/VISU_SWIG/visu_view3d.py @@ -253,7 +253,7 @@ myResult = myVisu.ImportFile(medFile) anAnim = myVisu.CreateAnimation(myView); aSObj = myStudy.FindObjectIOR(myResult.GetID()) aSObj = aSObj.FindSubObject(1)[1] -aSObj = aSObj.FindSubObject(2)[1] +aSObj = aSObj.FindSubObject(3)[1] aSObj = aSObj.FindSubObject(2)[1] anAnim.addField(aSObj) anAnim.setPresentationType(0,VISU.TISOSURFACE) diff --git a/src/VVTK/Makefile.in b/src/VVTK/Makefile.in index 66b48653..7ed03ae7 100755 --- a/src/VVTK/Makefile.in +++ b/src/VVTK/Makefile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2005 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/ +# # File : Makefile.in # Author : Alexander Solovyov(OCN) # Module : VVTK @@ -63,16 +82,16 @@ CPPFLAGS += \ $(OCC_INCLUDES) \ $(VTK_INCLUDES) \ $(BOOST_CPPFLAGS) \ - -I$(KERNEL_ROOT_DIR)/include/salome \ - -I$(GUI_ROOT_DIR)/include/salome \ - -I${MED_ROOT_DIR}/include/salome + $(KERNEL_CXXFLAGS) \ + $(GUI_CXXFLAGS) \ + $(MED_CXXFLAGS) LDFLAGS += \ $(QT_MT_LIBS) \ $(OCC_LIBS) \ $(VTK_LIBS) \ - -L$(KERNEL_ROOT_DIR)/lib/salome \ - -L$(GUI_ROOT_DIR)/lib/salome + $(KERNEL_LDFLAGS) \ + $(GUI_LDFLAGS) LIBS+= -lsuit -lCAM -lSalomeObject -lSVTK -lOpUtil diff --git a/src/VVTK/VVTK.h b/src/VVTK/VVTK.h index d6dd0648..d9db1a20 100755 --- a/src/VVTK/VVTK.h +++ b/src/VVTK/VVTK.h @@ -1,3 +1,22 @@ +// Copyright (C) 2005 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/ +// #ifdef WNT #ifdef SVTK_EXPORTS #define VVTK_EXPORT __declspec(dllexport) diff --git a/src/VVTK/VVTK_ImageWriter.cxx b/src/VVTK/VVTK_ImageWriter.cxx index 9d047598..079557b1 100755 --- a/src/VVTK/VVTK_ImageWriter.cxx +++ b/src/VVTK/VVTK_ImageWriter.cxx @@ -1,112 +1,112 @@ -// SALOME VTKViewer : build VTK viewer into Salome desktop -// -// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : -// Author : -// Module : -// $Header$ - -#include "VVTK_ImageWriter.h" - -#include - -#include -#include -#include -#include - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - - -//---------------------------------------------------------------------------- -VVTK_ImageWriter -::VVTK_ImageWriter(QSemaphore* theSemaphore, - vtkImageData* theImageData, - const std::string& theName, - int theProgressive, - int theQuality): - mySemaphore(theSemaphore), - myImageData(theImageData), - myName(theName), - myProgressive(theProgressive), - myQuality(theQuality), - myConstraint16Flag(true) -{} - -//---------------------------------------------------------------------------- -VVTK_ImageWriter -::~VVTK_ImageWriter() -{ - if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "< anImageClip; - // - if(myConstraint16Flag){ - int uExtent[6]; - myImageData->GetUpdateExtent(uExtent); - unsigned int width = uExtent[1] - uExtent[0] + 1; - unsigned int height = uExtent[3] - uExtent[2] + 1; - width = (width / 16) * 16; - height= (height / 16) * 16; - uExtent[1] = uExtent[0] + width - 1; - uExtent[3] = uExtent[2] + height - 1; - // - anImageClip = vtkImageClip::New(); - anImageClip->Delete(); - - anImageClip->SetInput(myImageData); - anImageClip->SetOutputWholeExtent(uExtent); - anImageClip->ClipDataOn(); - anImageData = anImageClip->GetOutput(); - } - // - aWriter->WriteToMemoryOff(); - aWriter->SetFileName(myName.c_str()); - aWriter->SetQuality(myQuality); - aWriter->SetProgressive(myProgressive); - aWriter->SetInput(anImageData); - aWriter->Write(); - - aWriter->Delete(); - myImageData->Delete(); - - if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<< - "- this = "< + +#include +#include +#include +#include + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + + +//---------------------------------------------------------------------------- +VVTK_ImageWriter +::VVTK_ImageWriter(QSemaphore* theSemaphore, + vtkImageData* theImageData, + const std::string& theName, + int theProgressive, + int theQuality): + mySemaphore(theSemaphore), + myImageData(theImageData), + myName(theName), + myProgressive(theProgressive), + myQuality(theQuality), + myConstraint16Flag(true) +{} + +//---------------------------------------------------------------------------- +VVTK_ImageWriter +::~VVTK_ImageWriter() +{ + if(MYDEBUG) cout<<"VVTK_ImageWriter::~VVTK_ImageWriter - this = "< anImageClip; + // + if(myConstraint16Flag){ + int uExtent[6]; + myImageData->GetUpdateExtent(uExtent); + unsigned int width = uExtent[1] - uExtent[0] + 1; + unsigned int height = uExtent[3] - uExtent[2] + 1; + width = (width / 16) * 16; + height= (height / 16) * 16; + uExtent[1] = uExtent[0] + width - 1; + uExtent[3] = uExtent[2] + height - 1; + // + anImageClip = vtkImageClip::New(); + anImageClip->Delete(); + + anImageClip->SetInput(myImageData); + anImageClip->SetOutputWholeExtent(uExtent); + anImageClip->ClipDataOn(); + anImageData = anImageClip->GetOutput(); + } + // + aWriter->WriteToMemoryOff(); + aWriter->SetFileName(myName.c_str()); + aWriter->SetQuality(myQuality); + aWriter->SetProgressive(myProgressive); + aWriter->SetInput(anImageData); + aWriter->Write(); + + aWriter->Delete(); + myImageData->Delete(); + + if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<< + "- this = "< - -#include - -#include - - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - -//---------------------------------------------------------------------------- -VVTK_ImageWriterMgr -::VVTK_ImageWriterMgr() -{ - int aMax = std::numeric_limits::max() / 2; - mySemaphore = new QSemaphore(aMax); - *mySemaphore += aMax; - if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<< - "- total = "<total()<< - "; available = "<available()<start(); - -} - - -//---------------------------------------------------------------------------- -void -VVTK_ImageWriterMgr -::Stop() -{ - if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<< - "- total = "<total()<< - "; available = "<available()< + +#include + +#include + + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + +//---------------------------------------------------------------------------- +VVTK_ImageWriterMgr +::VVTK_ImageWriterMgr() +{ + int aMax = std::numeric_limits::max() / 2; + mySemaphore = new QSemaphore(aMax); + *mySemaphore += aMax; + if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<< + "- total = "<total()<< + "; available = "<available()<start(); + +} + + +//---------------------------------------------------------------------------- +void +VVTK_ImageWriterMgr +::Stop() +{ + if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<< + "- total = "<total()<< + "; available = "<available()<addTo( myPtsToolBar ); connect(myPickingAction, SIGNAL(toggled(bool)), this, SLOT(OnSelectionModeSwitch(bool))); - myPickingDlg = new VVTK_PickingDlg( this, "PickingDlg" ); - myPickingDlg->SetAction( myPickingAction ); + myPickingDlg = new VVTK_PickingDlg( myPickingAction, this, "PickingDlg" ); // Plane/Sphere Segmentation aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_PLANE_SEGMENTATION_SWITCH")); @@ -386,6 +385,9 @@ void VVTK_MainWindow1 ::OnSelectionModeSwitch(bool theIsSelectionOn) { + if ( theIsSelectionOn && !isVisible() ) + return; + Selection_Mode aSelectionMode = SelectionMode(); if(theIsSelectionOn && aSelectionMode != GaussPointSelection) SetSelectionMode(GaussPointSelection); diff --git a/src/VVTK/VVTK_MainWindow.h b/src/VVTK/VVTK_MainWindow.h index 1d0b0bc3..ffbe0864 100644 --- a/src/VVTK/VVTK_MainWindow.h +++ b/src/VVTK/VVTK_MainWindow.h @@ -1,3 +1,22 @@ +// Copyright (C) 2005 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/ +// #ifndef VVTK_MAINWINDOW_H #define VVTK_MAINWINDOW_H diff --git a/src/VVTK/VVTK_PickingDlg.cxx b/src/VVTK/VVTK_PickingDlg.cxx index 06e1dabb..fe8e2871 100644 --- a/src/VVTK/VVTK_PickingDlg.cxx +++ b/src/VVTK/VVTK_PickingDlg.cxx @@ -13,9 +13,11 @@ #include "VISU_GaussPtsAct.h" #include "VISU_GaussPtsSettings.h" +#include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" +#include "SVTK_MainWindow.h" #include "SVTK_RenderWindowInteractor.h" #include @@ -40,20 +42,24 @@ #include "QtxDblSpinBox.h" #include "QtxIntSpinBox.h" +#include "LightApp_Application.h" + using namespace std; -VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name ) - :QDialog( parent, name, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), - myEventCallbackCommand( vtkCallbackCommand::New() ), - myPickingSettings( VISU_PickingSettings::New() ) +VVTK_PickingDlg::VVTK_PickingDlg(QtxAction* theAction, + SVTK_MainWindow* theParent, + const char* theName): + SVTK_DialogBase(theAction, + theParent, + theName), + myEventCallbackCommand( vtkCallbackCommand::New() ), + myPickingSettings( VISU_PickingSettings::New() ) { myPriority = 0.0; myEventCallbackCommand->Delete(); myEventCallbackCommand->SetClientData(this); myEventCallbackCommand->SetCallback(VVTK_PickingDlg::ProcessEvents); - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - setCaption( tr( "PICKING_DLG_TITLE" ) ); setSizeGripEnabled(TRUE); @@ -206,11 +212,16 @@ VVTK_PickingDlg::VVTK_PickingDlg( QWidget* parent, const char* name ) buttonClose->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonClose, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( aBox ); TopLayout->addWidget( GroupButtons ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) ); connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) ); } VVTK_PickingDlg::~VVTK_PickingDlg() @@ -250,7 +261,7 @@ void VVTK_PickingDlg::Update() myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() ); myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() ); - float* aColor = myPickingSettings->GetColor(); + vtkFloatingPointType* aColor = myPickingSettings->GetColor(); mySelectionColorButton->setPaletteBackgroundColor( QColor( ( int )( aColor[0] * 255.0 ), ( int )( aColor[1] * 255.0 ), ( int )( aColor[2] * 255.0 ) ) ); @@ -349,7 +360,7 @@ void VVTK_PickingDlg::onClickApply() myPickingSettings->SetDisplayParentMesh( myDisplayParentMeshCheckBox->isChecked() ); QColor aButtonColor = mySelectionColorButton->paletteBackgroundColor(); - float aColor[3]; + vtkFloatingPointType aColor[3]; aColor[0] = aButtonColor.red() / 255.0; aColor[1] = aButtonColor.green() / 255.0; aColor[2] = aButtonColor.blue() / 255.0; @@ -360,14 +371,21 @@ void VVTK_PickingDlg::onClickApply() void VVTK_PickingDlg::onClickClose() { - myAction->setOn( false ); reject(); } -void VVTK_PickingDlg::done( int r ) +void VVTK_PickingDlg::onClickHelp() { - myAction->setOn( false ); - QDialog::done( r ); + QString aHelpFileName = "picking.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } } void VVTK_PickingDlg::onColorButtonPressed() diff --git a/src/VVTK/VVTK_PickingDlg.h b/src/VVTK/VVTK_PickingDlg.h index 72d3a4ec..ccff0cea 100644 --- a/src/VVTK/VVTK_PickingDlg.h +++ b/src/VVTK/VVTK_PickingDlg.h @@ -11,7 +11,7 @@ #ifndef VVTK_PICKINGDLG_H #define VVTK_PICKINGDLG_H -#include +#include "SVTK_DialogBase.h" #include #include @@ -32,6 +32,7 @@ class QtxIntSpinBox; class VISU_GaussPtsAct; class VISU_PickingSettings; +class SVTK_MainWindow; class SVTK_RenderWindowInteractor; //! Picking Dialog. @@ -39,16 +40,16 @@ class SVTK_RenderWindowInteractor; * Uses for set up picking preferenses and apply * them to all actors in the current renderer. */ -class VVTK_PickingDlg : public QDialog +class VVTK_PickingDlg : public SVTK_DialogBase { Q_OBJECT public: - VVTK_PickingDlg( QWidget* parent = 0, const char* name = 0 ); - ~VVTK_PickingDlg(); + VVTK_PickingDlg(QtxAction* theAction, + SVTK_MainWindow* theParent, + const char* theName); - //! Used to switch toggle state of the Picking action. - void SetAction( QtxAction* theAction ) { myAction = theAction; } + ~VVTK_PickingDlg(); //! Make an actor to listen the event of Update Picking Settings event. void AddActor( VISU_GaussPtsAct* ); @@ -62,10 +63,9 @@ public: void SetInteractor( SVTK_RenderWindowInteractor* ); protected slots: - virtual void done( int ); - void onClickApply(); void onClickClose(); + void onClickHelp(); void onColorButtonPressed(); diff --git a/src/VVTK/VVTK_Recorder.cxx b/src/VVTK/VVTK_Recorder.cxx index e9c734e9..bc44cb1d 100755 --- a/src/VVTK/VVTK_Recorder.cxx +++ b/src/VVTK/VVTK_Recorder.cxx @@ -1,464 +1,487 @@ -// SALOME VTKViewer : build VTK viewer into Salome desktop -// -// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -// -// -// -// File : -// Author : -// Module : -// $Header$ - -#include "VVTK_Recorder.h" - -#include "VVTK_ImageWriter.h" -#include "VVTK_ImageWriterMgr.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include "utilities.h" - -#ifdef _DEBUG_ -static int MYDEBUG = 0; -#else -static int MYDEBUG = 0; -#endif - - -namespace -{ - //---------------------------------------------------------------------------- - inline - void - GetNameJPEG(const std::string& thePreffix, - const int theIndex, - std::string& theName) - { - using namespace std; - ostringstream aStream; - aStream<SetClientData(this); - myCommand->SetCallback(VVTK_Recorder::ProcessEvents); -} - - -//---------------------------------------------------------------------------- -VVTK_Recorder -::~VVTK_Recorder() -{ - myCommand->Delete(); - myFilter->Delete(); - delete myWriterMgr; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::CheckExistAVIMaker() -{ - myErrorStatus = 0; - using namespace std; - ostringstream aStream; - aStream<<"which "<& /dev/null"; - std::string anAVIMakeCheck = aStream.str(); - int iErr = system(anAVIMakeCheck.c_str()); - if(iErr != 0) - myErrorStatus = 127; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetName(const char* theName) -{ - myName = theName; -} - -const char* -VVTK_Recorder::Name() const -{ - return myName.c_str(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetNbFPS(const double theNbFPS) -{ - myNbFPS = theNbFPS; -} - -double -VVTK_Recorder -::NbFPS() const -{ - return myNbFPS; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetQuality(int theQuality) -{ - myQuality = theQuality; -} - -int -VVTK_Recorder -::GetQuality() const -{ - return myQuality; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetRenderWindow(vtkRenderWindow* theRenderWindow) -{ - myRenderWindow = theRenderWindow; -} - -vtkRenderWindow* -VVTK_Recorder -::RenderWindow() -{ - return myRenderWindow; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetProgressiveMode(bool theProgressiveMode) -{ - myProgressiveMode = theProgressiveMode; -} - -bool -VVTK_Recorder -::GetProgressiveMode() const -{ - return myProgressiveMode; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::SetUseSkippedFrames(bool theUseSkippedFrames) -{ - myUseSkippedFrames = theUseSkippedFrames; -} - -bool -VVTK_Recorder -::UseSkippedFrames() const -{ - return myUseSkippedFrames; -} - - -//---------------------------------------------------------------------------- -int -VVTK_Recorder -::ErrorStatus() const -{ - return myErrorStatus; -} - -int -VVTK_Recorder -::State() const -{ - return myState; -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, - void* theClientData, - void* vtkNotUsed(theCallData)) -{ - if(vtkObject* anObj = reinterpret_cast(theClientData)){ - if(VVTK_Recorder* aSelf = dynamic_cast(anObj)){ - if(theEvent==vtkCommand::EndEvent){ - if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){ - aSelf->DoRecord(); - } - } - } - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Record() -{ - if(myState == VVTK_Recorder_Stop){ - if(myRenderWindow){ - myState = VVTK_Recorder_Record; - myFilter->SetInput(myRenderWindow); - myFrameIndex = -1; - myNbWrittenFrames = 0; - myRenderWindow->RemoveObserver(myCommand); - myRenderWindow->AddObserver(vtkCommand::EndEvent, - myCommand, - myPriority); - myRenderWindow->Render(); - } - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Stop() -{ - QApplication::setOverrideCursor( Qt::waitCursor ); - - if(myState == VVTK_Recorder_Record){ - if(!myPaused) - DoRecord(); - - myWriterMgr->Stop(); - - if(myUseSkippedFrames) - AddSkippedFrames(); - - myFrameIndexes.clear(); - - MakeFileAVI(); - } - myState = VVTK_Recorder_Stop; - myPaused = 0; - - QApplication::restoreOverrideCursor(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::Pause() -{ - myPaused = myPaused ? 0 : 1; - if(myPaused && !myFrameIndexes.empty()){ - size_t aLastId = myFrameIndexes.size() - 1; - myFrameIndexes[aLastId] *= -1; - } -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::DoRecord() -{ - if(myPaused) - return; - - if(myFrameIndex < 0){ - myFrameIndex = 0; - myTimeStart = vtkTimerLog::GetCurrentTime(); - }else{ - double aTimeNow = vtkTimerLog::GetCurrentTime(); - double aDelta = aTimeNow - myTimeStart; - if(aDelta < 0.0) - return; - - int aFrameIndex = int(aDelta*myNbFPS); - if(aFrameIndex == myFrameIndex) - return; - - myFrameIndex = aFrameIndex; - } - - myFrameIndexes.push_back(myFrameIndex); - if(MYDEBUG) cout<<"VVTK_Recorder::DoRecord - myFrameIndex = "<RemoveObserver(myCommand); - myFilter->Modified(); - - std::string aName; - GetNameJPEG(myName,myFrameIndex,aName); - - PreWrite(); - - vtkImageData *anImageData = vtkImageData::New(); - anImageData->DeepCopy(myFilter->GetOutput()); - - myWriterMgr->StartImageWriter(anImageData,aName,myProgressiveMode,myQuality); - myNbWrittenFrames++; - - myRenderWindow->AddObserver(vtkCommand::EndEvent, - myCommand, - myPriority); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::PreWrite() -{ - vtkImageData *anImageData = myFilter->GetOutput(); - // - if(!anImageData){ - myErrorStatus = 20; - return; - } - anImageData->UpdateInformation(); - int *anExtent = anImageData->GetWholeExtent(); - anImageData->SetUpdateExtent(anExtent[0], anExtent[1], - anExtent[2], anExtent[3], - 0,0); - anImageData->UpdateData(); -} - - -//---------------------------------------------------------------------------- -void -VVTK_Recorder -::AddSkippedFrames() -{ - myErrorStatus = 0; - - if(myFrameIndexes.size() < 2) - return; - - size_t anId = 0, anEnd = myFrameIndexes.size() - 1; - for(; anId < anEnd; anId++){ - int aStartIndex = myFrameIndexes[anId]; - if(aStartIndex < 0) - continue; - - int aFinishIndex = abs(myFrameIndexes[anId + 1]); - if(aStartIndex + 1 == aFinishIndex) - continue; - - std::string anInitialName; - std::ostringstream aStream; - GetNameJPEG(myName,aStartIndex,anInitialName); - for(int anIndex = aStartIndex + 1; anIndex < aFinishIndex; anIndex++){ - myNbWrittenFrames++; - std::string anCurrentName; - GetNameJPEG(myName,anIndex,anCurrentName); - aStream<<"ln -s "<< anInitialName<<" "< +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "utilities.h" + +#ifdef _DEBUG_ +static int MYDEBUG = 0; +#else +static int MYDEBUG = 0; +#endif + + +namespace +{ + //---------------------------------------------------------------------------- + inline + void + GetNameJPEG(const std::string& thePreffix, + const int theIndex, + std::string& theName) + { + using namespace std; + ostringstream aStream; + aStream<SetClientData(this); + myCommand->SetCallback(VVTK_Recorder::ProcessEvents); +} + + +//---------------------------------------------------------------------------- +VVTK_Recorder +::~VVTK_Recorder() +{ + myCommand->Delete(); + myFilter->Delete(); + delete myWriterMgr; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::CheckExistAVIMaker() +{ + myErrorStatus = 0; + using namespace std; + ostringstream aStream; + aStream<<"which "<& /dev/null"; + std::string anAVIMakeCheck = aStream.str(); + int iErr = system(anAVIMakeCheck.c_str()); + if(iErr != 0) + myErrorStatus = 127; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetName(const char* theName) +{ + myName = theName; +} + +const char* +VVTK_Recorder::Name() const +{ + return myName.c_str(); +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetNbFPS(const double theNbFPS) +{ + myNbFPS = theNbFPS; +} + +double +VVTK_Recorder +::NbFPS() const +{ + return myNbFPS; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetQuality(int theQuality) +{ + myQuality = theQuality; +} + +int +VVTK_Recorder +::GetQuality() const +{ + return myQuality; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetRenderWindow(vtkRenderWindow* theRenderWindow) +{ + myRenderWindow = theRenderWindow; +} + +vtkRenderWindow* +VVTK_Recorder +::RenderWindow() +{ + return myRenderWindow; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetProgressiveMode(bool theProgressiveMode) +{ + myProgressiveMode = theProgressiveMode; +} + +bool +VVTK_Recorder +::GetProgressiveMode() const +{ + return myProgressiveMode; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::SetUseSkippedFrames(bool theUseSkippedFrames) +{ + myUseSkippedFrames = theUseSkippedFrames; +} + +bool +VVTK_Recorder +::UseSkippedFrames() const +{ + return myUseSkippedFrames; +} + + +//---------------------------------------------------------------------------- +int +VVTK_Recorder +::ErrorStatus() const +{ + return myErrorStatus; +} + +int +VVTK_Recorder +::State() const +{ + return myState; +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::ProcessEvents(vtkObject* vtkNotUsed(theObject), + unsigned long theEvent, + void* theClientData, + void* vtkNotUsed(theCallData)) +{ + if(vtkObject* anObj = reinterpret_cast(theClientData)){ + if(VVTK_Recorder* aSelf = dynamic_cast(anObj)){ + if(theEvent==vtkCommand::EndEvent){ + if(aSelf->State() == VVTK_Recorder::VVTK_Recorder_Record){ + aSelf->DoRecord(); + } + } + } + } +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::Record() +{ + if(myState == VVTK_Recorder_Stop){ + if(myRenderWindow){ + myState = VVTK_Recorder_Record; + myFilter->SetInput(myRenderWindow); + myFrameIndex = -1; + myNbWrittenFrames = 0; + myRenderWindow->RemoveObserver(myCommand); + myRenderWindow->AddObserver(vtkCommand::EndEvent, + myCommand, + myPriority); + myRenderWindow->Render(); + } + } +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::Stop() +{ + QApplication::setOverrideCursor( Qt::waitCursor ); + + if(myState == VVTK_Recorder_Record){ + if(!myPaused) + DoRecord(); + + myWriterMgr->Stop(); + + if(myUseSkippedFrames) + AddSkippedFrames(); + + myFrameIndexes.clear(); + + MakeFileAVI(); + } + myState = VVTK_Recorder_Stop; + myPaused = 0; + + QApplication::restoreOverrideCursor(); +} + + +//---------------------------------------------------------------------------- +void +VVTK_Recorder +::Pause() +{ + myPaused = myPaused ? 0 : 1; + if(myPaused && !myFrameIndexes.empty()){ + myFrameIndexes.back() *= -1; + if(MYDEBUG) cout<<"VVTK_Recorder::Pause - myFrameIndexes.back() = "< -#include -#include - -#include - -class vtkRenderWindow; -class vtkCallbackCommand; -class vtkWindowToImageFilter; -class VVTK_ImageWriterMgr; -// -class VVTK_Recorder : public vtkObject -{ - protected: - enum State { - VVTK_Recorder_Unknown=0, - VVTK_Recorder_Record, - VVTK_Recorder_Stop - }; - - public: - static VVTK_Recorder *New(); - vtkTypeRevisionMacro(VVTK_Recorder,vtkObject); - - void - SetRenderWindow(vtkRenderWindow* theRenderWindow); - - vtkRenderWindow* - RenderWindow(); - - void - SetName(const char *theName); - - const char* - Name() const; - - void - SetNbFPS(const double theNbFPS); - - double - NbFPS() const; - - void - SetQuality(int theQuality); - - int - GetQuality() const; - - void - SetProgressiveMode(bool theProgressiveMode); - - bool - GetProgressiveMode() const; - - void - SetUseSkippedFrames(bool theUseSkippedFrames); - - bool - UseSkippedFrames() const; - - void - Record(); - - void - Pause(); - - void - Stop(); - - int - State() const; - - int - ErrorStatus() const; - - void - CheckExistAVIMaker(); - -protected : - VVTK_Recorder(); - - ~VVTK_Recorder(); - - void - DoRecord(); - - void - MakeFileAVI(); - - void - AddSkippedFrames(); - - void - PreWrite(); - - static - void - ProcessEvents(vtkObject* theObject, - unsigned long theEvent, - void* theClientData, - void* theCallData); - -protected : - int myState; - int myPaused; - int myErrorStatus; - - float myPriority; - double myTimeStart; - - int myFrameIndex; - int myNbWrittenFrames; - - double myNbFPS; - int myQuality; - bool myProgressiveMode; - - typedef std::vector TFrameIndexes; - TFrameIndexes myFrameIndexes; - bool myUseSkippedFrames; - - std::string myName; - std::string myNameAVIMaker; - - vtkCallbackCommand *myCommand; - vtkRenderWindow *myRenderWindow; - vtkWindowToImageFilter *myFilter; - VVTK_ImageWriterMgr *myWriterMgr; - - -private: - VVTK_Recorder(const VVTK_Recorder&); //Not implemented - void operator=(const VVTK_Recorder&); //Not implemented -}; -#endif +// SALOME VTKViewer : build VTK viewer into Salome desktop +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : +// Author : +// Module : SALOME +// $Header$ + +#ifndef _VVTK_Recorder_Header_File_ +#define _VVTK_Recorder_Header_File_ + +#include +#include +#include + +#include + +class vtkRenderWindow; +class vtkCallbackCommand; +class vtkWindowToImageFilter; +class VVTK_ImageWriterMgr; +// +class VVTK_Recorder : public vtkObject +{ + protected: + enum State { + VVTK_Recorder_Unknown=0, + VVTK_Recorder_Record, + VVTK_Recorder_Stop + }; + + public: + static VVTK_Recorder *New(); + vtkTypeRevisionMacro(VVTK_Recorder,vtkObject); + + void + SetRenderWindow(vtkRenderWindow* theRenderWindow); + + vtkRenderWindow* + RenderWindow(); + + void + SetName(const char *theName); + + const char* + Name() const; + + void + SetNbFPS(const double theNbFPS); + + double + NbFPS() const; + + void + SetQuality(int theQuality); + + int + GetQuality() const; + + void + SetProgressiveMode(bool theProgressiveMode); + + bool + GetProgressiveMode() const; + + void + SetUseSkippedFrames(bool theUseSkippedFrames); + + bool + UseSkippedFrames() const; + + void + Record(); + + void + Pause(); + + void + Stop(); + + int + State() const; + + int + ErrorStatus() const; + + void + CheckExistAVIMaker(); + +protected : + VVTK_Recorder(); + + ~VVTK_Recorder(); + + void + DoRecord(); + + void + MakeFileAVI(); + + void + AddSkippedFrames(); + + void + PreWrite(); + + static + void + ProcessEvents(vtkObject* theObject, + unsigned long theEvent, + void* theClientData, + void* theCallData); + +protected : + int myState; + int myPaused; + int myErrorStatus; + + float myPriority; + double myTimeStart; + + int myFrameIndex; + int myNbWrittenFrames; + + double myNbFPS; + int myQuality; + bool myProgressiveMode; + + typedef std::vector TFrameIndexes; + TFrameIndexes myFrameIndexes; + bool myUseSkippedFrames; + + std::string myName; + std::string myNameAVIMaker; + + vtkCallbackCommand *myCommand; + vtkRenderWindow *myRenderWindow; + vtkWindowToImageFilter *myFilter; + VVTK_ImageWriterMgr *myWriterMgr; + + +private: + VVTK_Recorder(const VVTK_Recorder&); //Not implemented + void operator=(const VVTK_Recorder&); //Not implemented +}; +#endif diff --git a/src/VVTK/VVTK_RecorderDlg.cxx b/src/VVTK/VVTK_RecorderDlg.cxx index b188c99e..98624038 100644 --- a/src/VVTK/VVTK_RecorderDlg.cxx +++ b/src/VVTK/VVTK_RecorderDlg.cxx @@ -29,12 +29,15 @@ #include "VVTK_Recorder.h" #include "SUIT_FileDlg.h" +#include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" #include "QtxDblSpinBox.h" #include "QtxIntSpinBox.h" +#include "LightApp_Application.h" + #include #include #include @@ -127,8 +130,13 @@ VVTK_RecorderDlg::VVTK_RecorderDlg( QWidget* theParent, VVTK_Recorder* theRecord aCloseButton->setAutoDefault( true ); CommonGroupLayout->addWidget( aCloseButton, 0, 2 ); + QPushButton* aHelpButton = new QPushButton( tr( "HELP" ), CommonGroup ); + aHelpButton->setAutoDefault( true ); + CommonGroupLayout->addWidget( aHelpButton, 0, 3 ); + connect( aStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) ); connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) ); + connect( aHelpButton, SIGNAL( clicked() ), this, SLOT( onHelp() ) ); } VVTK_RecorderDlg::~VVTK_RecorderDlg() @@ -162,6 +170,20 @@ void VVTK_RecorderDlg::onClose() reject(); } +void VVTK_RecorderDlg::onHelp() +{ + QString aHelpFileName = "animation_in_gauss_viewer.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + bool VVTK_RecorderDlg::onBrowseFile() { QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ); diff --git a/src/VVTK/VVTK_RecorderDlg.h b/src/VVTK/VVTK_RecorderDlg.h index f46ef1b1..ee31cf1d 100644 --- a/src/VVTK/VVTK_RecorderDlg.h +++ b/src/VVTK/VVTK_RecorderDlg.h @@ -61,6 +61,7 @@ public: protected slots: void onStart(); void onClose(); + void onHelp(); bool onBrowseFile(); diff --git a/src/VVTK/VVTK_Renderer.cxx b/src/VVTK/VVTK_Renderer.cxx index 8a171986..a67a386e 100644 --- a/src/VVTK/VVTK_Renderer.cxx +++ b/src/VVTK/VVTK_Renderer.cxx @@ -125,7 +125,7 @@ VISU_FPSActor } std::ostringstream aStr; float aFPS = 1.0 / aLastRenderTimeInSeconds; - aStr<<"FPS: "<SetMapper(aTextMapper); aTextMapper->Delete(); - GetDevice()->AddActor2D(myFPSActor.GetPointer()); + //GetDevice()->AddActor2D(myFPSActor.GetPointer()); myGaussPointPicker->Delete(); diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.cxx b/src/VVTK/VVTK_SegmentationCursorDlg.cxx index 63487fed..4f4d4e39 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.cxx +++ b/src/VVTK/VVTK_SegmentationCursorDlg.cxx @@ -22,6 +22,7 @@ #include "VISU_GaussPointsPL.hxx" #include "VISU_OpenGLPointSpriteMapper.hxx" +#include "LightApp_Application.h" #include "SUIT_MessageBox.h" #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" @@ -96,7 +97,7 @@ namespace VISU static TTextureMap aTextureMap; TTextureValue aTextureValue; - TTextureKey aTextureKey(theMainTexture,theAlphaTexture); + TTextureKey aTextureKey(theMainTexture.latin1(),theAlphaTexture.latin1()); TTextureMap::const_iterator anIter = aTextureMap.find(aTextureKey); if(anIter != aTextureMap.end()){ aTextureValue = anIter->second; @@ -141,8 +142,6 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c myEventCallbackCommand.GetPointer(), myPriority); - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - setCaption( tr( "SEGMENTATION_CURSOR_DLG_TITLE" ) ); setSizeGripEnabled(TRUE); @@ -183,9 +182,9 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c QLabel* ZOriginLabel = new QLabel( tr( "ORIGIN_Z" ), myOriginGroup ); myZOriginSpinBox = new QtxDblSpinBox( -1000.0, 1000.0, 0.1, myOriginGroup ); - myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); + //myZOriginSpinBox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); myZOriginSpinBox->setMinimumWidth( 100 ); - myZOriginSpinBox->setValue( 0.0 ); + myZOriginSpinBox->setValue( 1.0 ); OriginGroupLayout->addWidget( XOriginLabel, 0, 0 ); OriginGroupLayout->addWidget( myXOriginSpinBox, 0, 1 ); @@ -381,11 +380,19 @@ VVTK_SegmentationCursorDlg::VVTK_SegmentationCursorDlg( QWidget* parent, const c buttonClose->setAutoDefault( TRUE ); GroupButtonsLayout->addWidget( buttonClose, 0, 2 ); + QPushButton* buttonHelp = new QPushButton( tr( "&Help" ) , GroupButtons, "buttonHelp" ); + buttonHelp->setAutoDefault( TRUE ); + GroupButtonsLayout->addWidget( buttonHelp, 0, 3 ); + TopLayout->addWidget( myTabBox ); TopLayout->addWidget( GroupButtons ); connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onClickApply() ) ); connect( buttonClose, SIGNAL( clicked() ), this, SLOT( onClickClose() ) ); + connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onClickHelp() ) ); + + connect(parent, SIGNAL(Show( QShowEvent * )), this, SLOT(onParentShow())); + connect(parent, SIGNAL(Hide( QHideEvent * )), this, SLOT(onParentHide())); } VVTK_SegmentationCursorDlg::~VVTK_SegmentationCursorDlg() @@ -463,13 +470,13 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation() myRadiusGroup->hide(); VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - float origin[3]; + vtkFloatingPointType origin[3]; pPlanesWidget->GetOrigin( origin ); myXOriginSpinBox->setValue( origin[0] ); myYOriginSpinBox->setValue( origin[1] ); myZOriginSpinBox->setValue( origin[2] ); - float normal[3]; + vtkFloatingPointType normal[3]; pPlanesWidget->GetNormal( normal ); myDXDirectionSpinBox->setValue( normal[0] ); myDYDirectionSpinBox->setValue( normal[1] ); @@ -484,7 +491,7 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation() myRadiusGroup->show(); VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget(); - float origin[3], aRadius; + vtkFloatingPointType origin[3], aRadius; pSphereWidget->GetCenter(origin); myXOriginSpinBox->setValue( origin[0] ); myYOriginSpinBox->setValue( origin[1] ); @@ -498,15 +505,15 @@ void VVTK_SegmentationCursorDlg::UpdateSegmentation() void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints() { int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite; - float aClamp = 200.0; + vtkFloatingPointType aClamp = 200.0; QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp"; QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp"; - float anAlphaThreshold = 0.1; + vtkFloatingPointType anAlphaThreshold = 0.1; int aResolution = 8; int aMinSize = 3; int aMaxSize = 33; int aMagnification = 100; - float anIncrement = 2.0; + vtkFloatingPointType anIncrement = 2.0; if( !myInsideCursorSettings->GetInitial() ) { @@ -565,11 +572,11 @@ void VVTK_SegmentationCursorDlg::UpdateInsideGaussPoints() void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints() { - float aClamp = 256.0; + vtkFloatingPointType aClamp = 256.0; int aPrimitiveType = VISU_OpenGLPointSpriteMapper::PointSprite; QString aMainTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_texture.bmp"; QString anAlphaTexture = QString( getenv( "VISU_ROOT_DIR") ) + "/share/salome/resources/sprite_alpha.bmp"; - float anAlphaThreshold = 0.1; + vtkFloatingPointType anAlphaThreshold = 0.1; int aResolution = 8; int aSize = 25; bool aUniform = false; @@ -587,7 +594,7 @@ void VVTK_SegmentationCursorDlg::UpdateOutsideGaussPoints() myOutsideSizeBox->setOutsideSize( myOutsideCursorSettings->GetSize() ); myOutsideSizeBox->setUniform( myOutsideCursorSettings->GetUniform() ); - float* aColor = myOutsideCursorSettings->GetColor(); + vtkFloatingPointType* aColor = myOutsideCursorSettings->GetColor(); myOutsideSizeBox->setColor( QColor( ( int )( aColor[0] * 255.0 ), ( int )( aColor[1] * 255.0 ), ( int )( aColor[2] * 255.0 ) ) ); @@ -696,13 +703,13 @@ void VVTK_SegmentationCursorDlg::ApplySegmentationCursor() if( myIsPlaneSegmentation ) { VISU_PlanesWidget *pPlanesWidget=myWidgetCtrl->GetPlanesWidget(); - float origin[3]; + vtkFloatingPointType origin[3]; origin[0] = myXOriginSpinBox->value(); origin[1] = myYOriginSpinBox->value(); origin[2] = myZOriginSpinBox->value(); pPlanesWidget->SetOrigin( origin ); - float normal[3]; + vtkFloatingPointType normal[3]; normal[0] = myDXDirectionSpinBox->value(); normal[1] = myDYDirectionSpinBox->value(); normal[2] = myDZDirectionSpinBox->value(); @@ -722,7 +729,7 @@ void VVTK_SegmentationCursorDlg::ApplySegmentationCursor() else { VISU_SphereWidget *pSphereWidget=myWidgetCtrl->GetSphereWidget(); - float origin[3], aRadius; + vtkFloatingPointType origin[3], aRadius; origin[0] = myXOriginSpinBox->value(); origin[1] = myYOriginSpinBox->value(); origin[2] = myZOriginSpinBox->value(); @@ -781,7 +788,7 @@ void VVTK_SegmentationCursorDlg::ApplyOutsideGaussPoints() myOutsideCursorSettings->SetUniform( myOutsideSizeBox->getUniform() ); QColor aButtonColor = myOutsideSizeBox->getColor(); - float aColor[3]; + vtkFloatingPointType aColor[3]; aColor[0] = aButtonColor.red() / 255.0; aColor[1] = aButtonColor.green() / 255.0; aColor[2] = aButtonColor.blue() / 255.0; @@ -803,6 +810,20 @@ void VVTK_SegmentationCursorDlg::onClickClose() reject(); } +void VVTK_SegmentationCursorDlg::onClickHelp() +{ + QString aHelpFileName = "segmentation.htm"; + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(app->activeModule() ? app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName); + else { + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName), + QObject::tr("BUT_OK")); + } +} + void VVTK_SegmentationCursorDlg::done( int r ) { myPlaneAction->setOn( false ); @@ -813,6 +834,19 @@ void VVTK_SegmentationCursorDlg::done( int r ) QDialog::done( r ); } +void VVTK_SegmentationCursorDlg::onParentShow() +{ + if(myPlaneAction->isOn() || mySphereAction->isOn()) + show(); + else + hide(); +} + +void VVTK_SegmentationCursorDlg::onParentHide() +{ + hide(); +} + bool VVTK_SegmentationCursorDlg::CheckNumberOfFaces() { if( !myInteractor ) diff --git a/src/VVTK/VVTK_SegmentationCursorDlg.h b/src/VVTK/VVTK_SegmentationCursorDlg.h index edac2165..087f60b6 100644 --- a/src/VVTK/VVTK_SegmentationCursorDlg.h +++ b/src/VVTK/VVTK_SegmentationCursorDlg.h @@ -113,9 +113,12 @@ private: protected slots: virtual void done( int ); + void onParentShow(); + void onParentHide(); void onClickApply(); void onClickClose(); + void onClickHelp(); signals: void scgClose(); diff --git a/src/VVTK/VVTK_SizeBox.cxx b/src/VVTK/VVTK_SizeBox.cxx index 654b69a7..5adfe3be 100644 --- a/src/VVTK/VVTK_SizeBox.cxx +++ b/src/VVTK/VVTK_SizeBox.cxx @@ -48,8 +48,6 @@ using namespace std; VVTK_SizeBox::VVTK_SizeBox( QWidget* parent ) : QVBox( parent ) { - SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); - layout()->setSpacing( 0 ); layout()->setMargin( 0 ); diff --git a/src/VVTK/VVTK_ViewManager.cxx b/src/VVTK/VVTK_ViewManager.cxx index 8c3cb03b..26bb4256 100644 --- a/src/VVTK/VVTK_ViewManager.cxx +++ b/src/VVTK/VVTK_ViewManager.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 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/ +// #include "VVTK_ViewManager.h" #include "VVTK_ViewModel.h" @@ -7,7 +26,7 @@ int VVTK_ViewManager::_VVTKViewMgr_Id = 0; VVTK_ViewManager ::VVTK_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop ) -: SUIT_ViewManager( study, theDesktop ) +: SVTK_ViewManager( study, theDesktop ) { myId = ++_VVTKViewMgr_Id; setViewModel( new VVTK_Viewer() ); diff --git a/src/VVTK/VVTK_ViewManager.h b/src/VVTK/VVTK_ViewManager.h index 101fa583..b52ec533 100644 --- a/src/VVTK/VVTK_ViewManager.h +++ b/src/VVTK/VVTK_ViewManager.h @@ -1,13 +1,32 @@ +// Copyright (C) 2005 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/ +// #ifndef VVTK_VIEWMANAGER_H #define VVTK_VIEWMANAGER_H -#include "SUIT_ViewManager.h" +#include "SVTK_ViewManager.h" #include "VVTK.h" class SUIT_Desktop; //! Extend SUIT_ViewManager to deal with VVTK_Viewer -class VVTK_EXPORT VVTK_ViewManager : public SUIT_ViewManager +class VVTK_EXPORT VVTK_ViewManager : public SVTK_ViewManager { Q_OBJECT; public: diff --git a/src/VVTK/VVTK_ViewModel.cxx b/src/VVTK/VVTK_ViewModel.cxx index 5fcc06f9..0ece1e05 100644 --- a/src/VVTK/VVTK_ViewModel.cxx +++ b/src/VVTK/VVTK_ViewModel.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2005 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/ +// #include "VVTK_ViewModel.h" #include "VVTK_ViewWindow.h" diff --git a/src/VVTK/VVTK_ViewModel.h b/src/VVTK/VVTK_ViewModel.h index 5f343dc9..49d1183c 100644 --- a/src/VVTK/VVTK_ViewModel.h +++ b/src/VVTK/VVTK_ViewModel.h @@ -1,3 +1,22 @@ +// Copyright (C) 2005 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/ +// #ifndef VVTK_VIEWMODEL_H #define VVTK_VIEWMODEL_H diff --git a/src/VVTK/VVTK_ViewWindow.cxx b/src/VVTK/VVTK_ViewWindow.cxx index a181ad6a..0b012ab2 100755 --- a/src/VVTK/VVTK_ViewWindow.cxx +++ b/src/VVTK/VVTK_ViewWindow.cxx @@ -258,14 +258,17 @@ VVTK_ViewWindow } //---------------------------------------------------------------------------- -void +bool VVTK_ViewWindow ::action( const int accelAction ) { - if(myMainWindow1->hasFocus()) - myMainWindow1->action(accelAction); - if(myMainWindow2->hasFocus()) - myMainWindow2->action(accelAction); + if ( myMainWindow1->hasFocus() ) + myMainWindow1->action( accelAction ); + else if ( myMainWindow2->hasFocus() ) + myMainWindow2->action( accelAction ); + else + return false; + return true; } //---------------------------------------------------------------------------- diff --git a/src/VVTK/VVTK_ViewWindow.h b/src/VVTK/VVTK_ViewWindow.h index 54e4745d..7b711fcb 100755 --- a/src/VVTK/VVTK_ViewWindow.h +++ b/src/VVTK/VVTK_ViewWindow.h @@ -1,3 +1,22 @@ +// Copyright (C) 2005 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/ +// #ifndef VVTK_VIEWWINDOW_H #define VVTK_VIEWWINDOW_H @@ -105,7 +124,7 @@ public slots: //---------------------------------------------------------------------------- protected: virtual - void + bool action( const int ); virtual QImage dumpView();