include $(top_srcdir)/adm_local/unix/make_common_starter.am
+ACLOCAL_AMFLAGS = -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
+
SUBDIRS = adm_local idl resources src doc bin
DISTCLEANFILES = a.out aclocal.m4 configure
-salomeinclude_DATA=VISU_version.h
+salomeinclude_DATA = VISU_version.h
-EXTRA_DIST+= \
- build_configure \
- clean_configure \
+EXTRA_DIST += \
+ build_configure \
+ clean_configure \
LICENCE
dist-hook:
usr_docs:
(cd doc && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
-docs:usr_docs
+docs: usr_docs
dev_docs:
(cd doc && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-SUBDIRS= unix
\ No newline at end of file
+SUBDIRS = unix
\ No newline at end of file
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-dist_admlocalm4_DATA= \
+dist_admlocalm4_DATA = \
check_VISU.m4
#
# Standard directory for installation
-salomeincludedir = $(includedir)/@PACKAGE@
-libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/@PACKAGE@
-bindir = $(prefix)/bin/@PACKAGE@
+salomeincludedir = $(includedir)/salome
+libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome
+bindir = $(prefix)/bin/salome
purebindir = $(prefix)/bin
salomescriptdir = $(bindir)
+salomepythondir = $(pythondir)/salome
+salomepyexecdir = $(pyexecdir)/salome
# Tests environment folders
testsenvirondir = $(prefix)/Tests/environ
testsenvironcshdir = $(prefix)/Tests/environ/csh
# Directory for installing idl files
-salomeidldir = $(prefix)/idl/@PACKAGE@
+salomeidldir = $(prefix)/idl/salome
# Directory for installing resource files
-salomeresdir = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@
+salomeresdir = $(prefix)/share/salome/resources/@MODULE_NAME@
# Directories for installing admin files
-admlocaldir = $(prefix)/adm_local
-admlocalunixdir = $(admlocaldir)/unix
-admlocalm4dir = $(admlocaldir)/unix/config_files
+admlocaldir = $(prefix)/adm_local
+admlocalunixdir = $(admlocaldir)/unix
+admlocalm4dir = $(admlocaldir)/unix/config_files
# Shared modules installation directory
-sharedpkgpythondir =$(pkgpythondir)/shared_modules
+sharedpkgpythondir = $(salomepythondir)/shared_modules
# Documentation directory
-docdir = $(datadir)/doc/@PACKAGE@
+docdir = $(datadir)/doc/salome
# common rules
-# moc-files generation
+# meta object implementation files generation (moc)
%_moc.cxx: %.h
$(MOC) $< -o $@
-# qm-files generation
+# translation (*.qm) files generation (lrelease)
%.qm: %.ts
$(LRELEASE) $< -qm $@
-EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.ts)
+# resource files generation (qrcc)
+qrc_%.cxx: %.qrc
+ $(QRCC) $< -o $@ -name $(*F)
+# qt forms files generation (uic)
+ui_%.h: %.ui
+ $(UIC) -o $@ $<
+
+# extra distributed files
+EXTRA_DIST = $(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cxx=%.qrc) \
+ $(UIC_FILES:ui_%.h=%.ui) $(nodist_salomeres_DATA:%.qm=%.ts)
+
+# customize clean operation
mostlyclean-local:
rm -f @builddir@/*_moc.cxx
rm -f @builddir@/*.qm
+ rm -f @builddir@/ui_*.h
+ rm -f @builddir@/qrc_*.cxx
# tests
tests: unittest
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-nodist_salomescript_DATA= VERSION
-EXTRA_DIST+= VERSION.in
+# non-distributed files
+nodist_salomescript_DATA = VERSION
+
+# distributed files
+dist_salomescript_SCRIPTS =
#
-AC_INIT([Salome2 Project VISU module], [5.0.0], [webmaster.salome@opencascade.com], [salome])
+AC_INIT([Salome2 Project VISU module], [5.1.0], [webmaster.salome@opencascade.com], [SalomeVISU])
AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
./doc/Makefile \
./doc/salome/Makefile \
./doc/salome/gui/Makefile \
+ ./doc/salome/gui/VISU/Makefile \
./doc/salome/gui/VISU/doxyfile \
./doc/salome/gui/VISU/doxyfile_idl \
./doc/salome/tui/Makefile \
- ./doc/salome/tui/VISU/doxyfile \
- ./doc/salome/tui/VISU/sources/static/tree.js \
+ ./doc/salome/tui/doxyfile \
./idl/Makefile \
./resources/VISUCatalog.xml \
./resources/Makefile \
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-SUBDIRS= salome
+SUBDIRS = salome
-EXTRA_DIST= html
\ No newline at end of file
+usr_docs:
+ (cd salome && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
+
+docs: usr_docs
+
+dev_docs:
+ (cd salome && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
#
# $Header$
-SUBDIRS= tui gui
-SUBDIRSTUI= tui
-SUBDIRSGUI= gui
+SUBDIRS = tui gui
+SUBDIRSTUI = tui
+SUBDIRSGUI = gui
usr_docs:
@@SETX@; for d in $(SUBDIRSGUI); do \
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST+=VISU
-
-doxygen=@DOXYGEN@
+SUBDIRS = VISU
usr_docs:
- cd ./VISU; \
- echo "Processing VISU_Gen.idl file: "; \
- $(doxygen) ./doxyfile_idl; \
- echo "Running doxygen in directory: "`pwd`; \
- $(doxygen) ./doxyfile;
+ (cd VISU && $(MAKE) $(AM_MAKEFLAGS) usr_docs)
docs: usr_docs
-
-clean-local:
- rm -fr `ls | grep -v "Makefile"`
- rm -fr VISU
-
-install-data-local: usr_docs
- mkdir -p $(docdir)/gui
- cp -rf VISU $(docdir)/gui
- -find $(PWD) -name CVS -prune -exec rm -rf {} \;
-
-uninstall-local:
- rm -rf $(docdir)/gui/VISU
-
-docguidir=$(docdir)/gui/VISU
-
-nodist_docgui_DATA= VISU/doxyfile
-nodist_docgui_DATA+= VISU/doxyfile_idl
-EXTRA_DIST+= VISU/doxyfile.in
-EXTRA_DIST+= VISU/doxyfile_idl.in
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Post-Pro Module Reference Manual v.@VERSION@"
-OUTPUT_DIRECTORY = ./
+OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
TAB_SIZE = 5
#---------------------------------------------------------------------------
INPUT = @srcdir@/input
FILE_PATTERNS = *.doc
+EXCLUDE =
IMAGE_PATH = @srcdir@/images
+EXAMPLE_PATH =
#---------------------------------------------------------------------------
#HTML related options
#---------------------------------------------------------------------------
GENERATE_HTML = YES
-HTML_OUTPUT = ./
+HTML_OUTPUT = .
HTML_HEADER = @srcdir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
#HTML_STYLESHEET = @srcdir@/static/doxygen.css
#---------------------------------------------------------------------------
#External reference options
#---------------------------------------------------------------------------
-TAGFILES = visugen_doc.tag=./visugen_doc
\ No newline at end of file
+TAGFILES = visugen_doc.tag=visugen_doc
# Project related configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Post-Pro Module Reference Manual v.@VERSION@"
-OUTPUT_DIRECTORY = ./
+OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
USE_WINDOWS_ENCODING = NO
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
+QUIET = NO
+WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
#HTML related options
#---------------------------------------------------------------------------
GENERATE_HTML = YES
-HTML_OUTPUT = ./visugen_doc
+HTML_OUTPUT = visugen_doc
HTML_HEADER = @srcdir@/static/header.html
HTML_FOOTER = @srcdir@/static/footer.html
#HTML_STYLESHEET = @srcdir@/static/doxygen.css
#---------------------------------------------------------------------------
#External reference options
#---------------------------------------------------------------------------
-GENERATE_TAGFILE = visugen_doc.tag
+GENERATE_TAGFILE = visugen_doc.tag
<li>\ref segmentation_page</li>
<li>\ref recording_in_gauss_viewer_page</li>
</ul>
+<li>\ref values_labeling_page</li>
</ul>
<li>\subpage viewing_3d_presentations_page</li>
<ul>
<li>\ref segmentation_page</li>
<li>\ref recording_in_gauss_viewer_page</li>
</ul>
+<li>\subpage values_labeling_page</li>
</ul>
*/
\ No newline at end of file
<li>\ref segmentation_page</li>
<li>\ref recording_in_gauss_viewer_page</li>
</ul>
+<li>\ref values_labeling_page</li>
</ul>
<li>\ref viewing_3d_presentations_page</li>
<ul>
<li><b>Origin:</b> you can enter X & Y coordinates of the origin of
the scalar bar.</li>
<li><b>Dimensions:</b> you can enter \b Width and \b Height of the
-scalar bar.</li>
+scalar bar specified in % of the size of view.</li>
<li><b>Text properties</b> button allows you to define from the
following dialog box:
\image html barproperty.png
<ul>
-<li>Relative \b width and \b height of \b Title (in percents),</li>
-<li>Relative \b width and \b height of \b Labels (in percents),</li>
-<li>Relative \b width and \b height of \b Bar (in percents),</li>
+<li>Relative \b size of \b Title (in percents of the width of scalar bar widget),</li>
+<li>Relative \b size of \b Labels (in percents of the width of scalar bar widget),</li>
+<li>Relative \b width and \b height of \b Bar (in percents of the width and height of scalar bar widget),</li>
<li>Visibility of \b Units in \b Title,</li>
-<li>Format of \b Labels.</li>
+<li>Precision of \b Labels which specifies the number of characters to be printed, the number of decimal places, or the number of significant digits</li>
</ul>
</li>
</ul>
+++ /dev/null
-/*!
-
-\page table_3d_page Table 3D presentation
-
-\n <b>Table 3D</b> is a 3D graphic presentation of data contained in the table.
-The relief and coloring of the resulting
-presentation both correspond to the values contained in the table. The values from the first column of the
-table define X-axis. The values from the second to the last columns define Z-axis. Y increases with a fixed step starting from Y=0.
-To successfully produce a Table 3D presentation, the table should not contain empty fields.
-
-<em>To create a Table 3D presentation:</em>
-\par
-– Right-click on an XLS table in the
-Object browser and from the context menu choose <b>Show</b>, or <b>Show only</b>
-
-\image html table.png
-
-The table will be immediately displayed in the Viewer.
-
-Choose <b>Edit</b> in the context menu if you wish to change the layout of the presentation.
-
-\image html table3d.png
-
-\par
-<ul>
-<li><b>Scale Factor</b> - visualization scaling of all values of the table.</li>
-<li><b>Presentation type:</b></li>
-<ul>
-<li>\b Surface - Plot 3D will be represented with a smooth surface.</li>
-
-\image html tablesn2.png
-
-<li>\b Contour - Plot 3D will be represented with a set of contours.</li>
-
-\image html tablesn1.png
-
-</ul>
-<li><b>Number of contours</b> - allows to define the number of
-contours (active when Contour presentation type is selected).</li>
-<li> <b>Scalar Bar</b> tab allows to define the parameters of the scalar
-bar displayed with this presentation (\ref scalar_map_page "see also").</li>
-</ul>
-
-It is also possible to choose \b Wireframe or \b Shading \b Representation type, change
-such properties as \b Opacity and <b> Line Width </b> and <b> Translate </b> presentation from the context menu.
-
-
-
-*/
\ No newline at end of file
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deformed shape presentation interface. <a href="interfaceVISU_1_1DeformedShape.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">interface </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">VISU.ScalarMapOnDeformedShape</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deformed shape and Scalar Map presentation interface. <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Scalar Map on Deformed shape presentation interface. <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">interface </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1Plot3D.html">VISU.Plot3D</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a> interface. <a href="interfaceVISU_1_1Plot3D.html#_details">More...</a><br></td></tr>
<!-- Generated by Doxygen 1.4.7 -->
<div class="nav">
<a class="el" href="namespaceVISU.html">VISU</a>.<a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">ScalarMapOnDeformedShape</a></div>
-<h1>VISU.ScalarMapOnDeformedShape Interface Reference</h1><!-- doxytag: class="VISU::ScalarMapOnDeformedShape" --><!-- doxytag: inherits="VISU::ScalarMap" -->Deformed shape and Scalar Map presentation interface.
+<h1>VISU.ScalarMapOnDeformedShape Interface Reference</h1><!-- doxytag: class="VISU::ScalarMapOnDeformedShape" --><!-- doxytag: inherits="VISU::ScalarMap" -->Scalar Map on Deformed shape presentation interface.
<a href="#_details">More...</a>
<p>
<code>import "VISU_Gen.idl";</code>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deformed shape presentation interface. <a href="interfaceVISU_1_1DeformedShape.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">interface </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1ScalarMapOnDeformedShape.html">ScalarMapOnDeformedShape</a></td></tr>
-<tr><td class="mdescLeft"> </td><td class="mdescRight">Deformed shape and Scalar Map presentation interface. <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
+<tr><td class="mdescLeft"> </td><td class="mdescRight">Scalar Map on Deformed shape presentation interface. <a href="interfaceVISU_1_1ScalarMapOnDeformedShape.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">interface </td><td class="memItemRight" valign="bottom"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="interfaceVISU_1_1Plot3D.html">Plot3D</a> interface. <a href="interfaceVISU_1_1Plot3D.html#_details">More...</a><br></td></tr>
aTE("Plot 3D presentation","plot_3d_presentation.htm");
aTE("Primitive Types","primitive_types.htm");
aTE("Scalar Bar","scalar_bar.htm");
-aTE("Deformed Shape and Scalar Map presentation","scalar_map_on_deformed_shape_presentation.htm");
+aTE("Scalar Map on Deformed Shape presentation","scalar_map_on_deformed_shape_presentation.htm");
aTE("Segmentation","segmentation.htm");
aTE("Types of Gauss Points Presentations","types_of_gauss_points_presentations.htm");
aTE("VTK 3D Viewer","vtk_3d_viewer.htm");
aTE(2,0,"Deformed Shape presentation","files/deformed_shape_presentation.htm");
aTE(2,0,"Vectors Presentation","files/vectors_presentation.htm");
aTE(2,0,"Stream Lines presentation","files/stream_lines_presentation.htm");
- aTE(2,0,"Deformed Shape and Scalar Map presentation","scalar_map_on_deformed_shape_presentation.htm");
+ aTE(2,0,"Scalar Map on Deformed Shape presentation","scalar_map_on_deformed_shape_presentation.htm");
aTE(2,0,"Plot 3D presentation","plot_3d_presentation.htm");
aTE(2,0,"Animating presentations","files/animating_presentations.htm");
aTE(1,9,"Gauss Points Presentations");
<nobr><a href="../files/deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape presentation</a></nobr><br>
<nobr><a href="../files/vectors_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Vectors Presentation</a></nobr><br>
<nobr><a href="../files/stream_lines_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Stream Lines presentation</a></nobr><br>
- <nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape and Scalar Map presentation</a></nobr><br>
+ <nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Scalar Map on Deformed Shape presentation</a></nobr><br>
<nobr><a href="../plot_3d_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Plot 3D presentation</a></nobr><br>
<nobr><a href="../files/animating_presentations.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Animating presentations</a></nobr><br>
<nobr><a name="4"></a><a href="whlstt4.htm#4" target="_self" title="closed book"><img src="../whd_toc1.gif" border="0" align="absmiddle"> Gauss Points Presentations</a></nobr><br>
<nobr><a href="../files/deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape presentation</a></nobr><br>
<nobr><a href="../files/vectors_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Vectors Presentation</a></nobr><br>
<nobr><a href="../files/stream_lines_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Stream Lines presentation</a></nobr><br>
- <nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Deformed Shape and Scalar Map presentation</a></nobr><br>
+ <nobr><a href="../scalar_map_on_deformed_shape_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Scalar Map on Deformed Shape presentation</a></nobr><br>
<nobr><a href="../plot_3d_presentation.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Plot 3D presentation</a></nobr><br>
<nobr><a href="../files/animating_presentations.htm"><img src="../whd_toc3.gif" border="0" align="absmiddle"> Animating presentations</a></nobr><br>
<nobr><a name="4"></a><a href="whlstt3.htm#4" target="_self"><img src="../whd_toc2.gif" border="0" align="absmiddle"> Gauss Points Presentations</a></nobr><br>
<topic name="Plot 3D presentation" url="plot_3d_presentation.htm" />
<topic name="Primitive Types" url="primitive_types.htm" />
<topic name="Scalar Bar" url="scalar_bar.htm" />
-<topic name="Deformed Shape and Scalar Map presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
+<topic name="Scalar Map on Deformed Shape presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
<topic name="Segmentation" url="segmentation.htm" />
<topic name="Types of Gauss Points Presentations" url="types_of_gauss_points_presentations.htm" />
<topic name="VTK 3D Viewer" url="vtk_3d_viewer.htm" />
<item name="Deformed Shape presentation" url="files/deformed_shape_presentation.htm" />
<item name="Vectors Presentation" url="files/vectors_presentation.htm" />
<item name="Stream Lines presentation" url="files/stream_lines_presentation.htm" />
- <item name="Deformed Shape and Scalar Map presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
+ <item name="Scalar Map on Deformed Shape presentation" url="scalar_map_on_deformed_shape_presentation.htm" />
<item name="Plot 3D presentation" url="plot_3d_presentation.htm" />
<item name="Animating presentations" url="files/animating_presentations.htm" />
<book name="Gauss Points Presentations" >
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST+=VISU
+EXTRA_DIST += images static
-dev_docs:
- cp -fr $(srcdir)/VISU ./INPUT; \
- cp -f ./VISU/doxyfile ./INPUT; \
- cd INPUT; \
- sed 's|../../../share/salome|$(top_srcdir)|' ./doxyfile > ./doxyfile1; \
- sed 's|../../build/salome|$(top_builddir)|' ./doxyfile1 > ./doxyfile2; \
- mv -f doxyfile2 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; \
- echo "Running doxygen in directory:"`pwd`; \
- $(DOXYGEN) ./doxyfile; \
- cd ../; \
- cp -fr $(srcdir)/VISU/sources/ VISU ; \
- rm -fr INPUT
+dev_docs: doxyfile
+ echo "Running doxygen in directory: "`pwd`; \
+ $(DOXYGEN) $<;
-doctuidir=$(docdir)/tui/VISU
+clean-local:
+ -rm -fr VISU doxygen.bak
-nodist_doctui_DATA= VISU/doxyfile
-EXTRA_DIST+= VISU/doxyfile.in
+install-data-local:
+ if test -d VISU; then \
+ $(INSTALL) -d $(DESTDIR)$(docdir)/tui ; \
+ cp -rp VISU $(DESTDIR)$(docdir)/tui ; \
+ fi;
+
+uninstall-local:
+ rm -rf $(DESTDIR)$(docdir)/tui/VISU
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-BASEIDL_FILES= VISU_Gen.idl
-
-EXTRA_DIST+= $(BASEIDL_FILES)
+BASEIDL_FILES = VISU_Gen.idl
# This variable defines the files to be installed
-salomeidl_DATA = $(BASEIDL_FILES)
+dist_salomeidl_DATA = $(BASEIDL_FILES)
# VISU idl common library
lib_LTLIBRARIES = libSalomeIDLVISU.la
# Sources built from idl files
-nodist_libSalomeIDLVISU_la_SOURCES= VISU_GenSK.cc
+nodist_libSalomeIDLVISU_la_SOURCES = VISU_GenSK.cc
# header files must be exported: other modules have to use this library
-nodist_salomeinclude_HEADERS= $(BASEIDL_FILES:%.idl=%.hh)
+nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
-libSalomeIDLVISU_la_CPPFLAGS =\
- -I$(top_builddir)/salome_adm/unix \
- -I$(top_builddir)/idl \
+libSalomeIDLVISU_la_CPPFLAGS = \
+ -I$(top_builddir)/salome_adm/unix \
+ -I$(top_builddir)/idl \
@CORBA_CXXFLAGS@ @CORBA_INCLUDES@ @KERNEL_CXXFLAGS@ @MED_CXXFLAGS@
libSalomeIDLVISU_la_LDFLAGS = -no-undefined -version-info=0:0:0
libSalomeIDLVISU_la_LIBADD = @CORBA_LIBS@ $(MED_LDFLAGS) -lSalomeIDLMED
$(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%)
- $(INSTALL) -d $(pkgpythondir)
+ $(INSTALL) -d $(DESTDIR)$(salomepythondir)
ls $^ | while read file; do \
- $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(pkgpythondir) $$file ; \
+ $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
done
# uninstall-local removes too much, but it works in distcheck
uninstall-local:
- rm -rf $(pkgpythondir)/*
+ rm -rf $(DESTDIR)$(salomepythondir)/*
mostlyclean-local: clean-idls
TALL
};
+ /* Clipping planes management */
+ struct ClippingPlane {
+ double X;
+ double Y;
+ double Z;
+ double dX;
+ double dY;
+ double dZ;
+ boolean isAuto;
+ string name;
+ };
+
interface Base {
/*!
* Returns ID of the object.
SHADED,
INSIDEFRAME,
SURFACEFRAME,
+ FEATURE_EDGES,
SHRINK
};
* \return The type of representation of the mesh.
*/
PresentationType GetPresentationType();
+
+ /*!
+ * Switches shrink mode of presentation
+ * Note: SetPresentationType(SHRINK) is same as SetShrink(True)
+ */
+ void SetShrink(in boolean toShrink);
+
+ /*!
+ * Returns current state of shrink mode
+ */
+ boolean IsShrank();
};
*/
long GetScalarMode();
+ /*!
+ * Set the visibility of a distribution curve.
+ * \param theIs is used to switch on/off the visibility of a distribution curve.
+ */
+ void SetIsDistributionVisible(in boolean theIs);
+
+ //! Gets current visibility of a distribution curve
+ boolean GetIsDistributionVisible();
+
+ //! Gets current filtering by scalars mode
+ boolean IsScalarFilterUsed();
+
+ void UseScalarFiltering( in boolean theUseScalarFilter );
+
+ /*!
+ * Sets scalar range - min and max boundaries of the scalar bar.
+ * \param theMin Min boundary of the scalar bar.
+ * \param theMax Max boundary of the scalar bar.
+ * \param theIsFilter if true then filter by scalars.
+ */
+ void SetScalarFilterRange( in double theMin, in double theMax );
+
+ double GetScalarFilterMin();
+
+ double GetScalarFilterMax();
+
/*!
* Add group as geometry of presentation.
* \param theMeshName - mesh name
interface ScalarMap : ColoredPrs3d, ScaledPrs3d {
+ /*!
+ * Returns visibility state of scalar bar
+ */
+ boolean IsBarVisible();
+
+ /*!
+ * Sets visibility state of scalar bar
+ */
+ void SetBarVisible(in boolean theVisible);
+
};
//-------------------------------------------------------
* Get or create %ColoredPrs3dCache object.
*/
ColoredPrs3dCache GetColoredPrs3dCache(in SALOMEDS::Study theStudy);
+
+
+ /* Clipping planes management */
+
+ /*Create a clipping plane and return its ID (position in corresponded array)
+ Id of clipping plane could be changed after deletion of other clipping plane
+ */
+ long CreateClippingPlane(in double X, in double Y, in double Z,
+ in double dX, in double dY, in double dZ,
+ in boolean auto, in string name);
+
+ void EditClippingPlane(in long id, in double X, in double Y, in double Z,
+ in double dX, in double dY, in double dZ,
+ in boolean auto, in string name);
+
+ /* Returns clipping plane by its Id */
+ ClippingPlane GetClippingPlane(in long id);
+
+ /* Deletes clipping plane by its Id */
+ boolean DeleteClippingPlane(in long id);
+
+ /* Applyes a clipping plane with Id to presentation thePrs */
+ boolean ApplyClippingPlane(in Prs3d thePrs, in long id);
+
+ /* Detaches a clipping plane with Id from presentation thePrs */
+ boolean DetachClippingPlane(in Prs3d thePrs, in long id);
+
+
+ /* Get number of clipping planes */
+ long GetClippingPlanesNb();
+
};
/*! \brief %View interface
* the following types: 3d, Table, XY plot.
* %View interface is a base for all types of %view interfaces.
*/
- interface View: Base {
-
+ interface View: Base, SALOME::GenericObj
+ {
/*! \brief %ViewRepresentation enumeration
*
* displaying part ("ALL" isn't setable)
*/
void Destroy(in View theView);
};
+
+
};
#endif
# ===============================================================
#
-dist_salomeres_DATA= \
+dist_salomeres_DATA = \
ModuleVisu.png \
SalomeApp.xml \
sprite_alpha.bmp \
sprite_texture.bmp \
Vertex_Program_ARB.txt \
+Visu_actor_selection.png \
Visu_add.png \
+Visu_apply.png \
Visu_anim.png \
+Visu_cell_selection.png \
+Visu_close.png \
VISU.config \
Visu_cutlines.png \
Visu_cutplanes.png \
VISU_en.xml \
Visu_eraseall.png \
VISU_fr.xml \
+Visu_gauss_point_selection.png \
Visu_gauss_points.png \
Visu_graduated_axes.png \
+Visu_help.png \
Visu_import_med.png \
Visu_isosurfaces.png \
Visu_load_texture.png \
+Visu_ok.png \
Visu_PlaneSegmentation.png \
Visu_plot2d.png \
Visu_plot3d.png \
+Visu_point_selection.png \
Visu_points.png \
Visu_recording_pause.png \
Visu_recording_play.png \
Visu_scalars.png \
Visu_scaling.png \
Visu_selectall.png \
+Visu_selection_panel.png \
+Visu_slider_panel.png \
+Visu_sweep_panel.png \
Visu_selectionactor.png \
Visu_selectioncell.png \
Visu_selectionedge.png \
Visu_slider_play.png \
Visu_slider_pause.png \
Visu_slider_next.png \
-Visu_slider_last.png
+Visu_holo_render.png \
+Visu_slider_last.png \
+Visu_DeactivatePlane.png \
+Visu_planemanager.png
-EXTRA_DIST+= VISUCatalog.xml.in
-nodist_salomeres_DATA=VISUCatalog.xml
+# VSR: little trick to avoid putting if VISUCatalog.xml to the distribution archive
+nodist_salomeres_SCRIPTS = VISUCatalog.xml
<parameter name="scalar_def_represent" value="2"/>
<parameter name="scalar_def_shrink" value="false"/>
<parameter name="represent_shading" value="false"/>
- <parameter name="scalar_bar_horizontal_height" value="0.05"/>
- <parameter name="scalar_bar_horizontal_width" value="0.5" />
- <parameter name="scalar_bar_horizontal_x" value="0.01"/>
+ <parameter name="feature_edges_angle" value="30.0"/>
+ <parameter name="show_feature_edges" value="true"/>
+ <parameter name="show_boundary_edges" value="false"/>
+ <parameter name="show_manifold_edges" value="false"/>
+ <parameter name="show_non_manifold_edges" value="false"/>
+ <parameter name="feature_edges_coloring" value="false"/>
+ <parameter name="scalar_bar_horizontal_height" value="0.08"/>
+ <parameter name="scalar_bar_horizontal_width" value="0.8" />
+ <parameter name="scalar_bar_horizontal_x" value="0.1"/>
<parameter name="scalar_bar_horizontal_y" value="0.01"/>
- <parameter name="scalar_bar_horizontal_title_height" value="0"/>
- <parameter name="scalar_bar_horizontal_title_width" value="0"/>
- <parameter name="scalar_bar_horizontal_label_height" value="0"/>
- <parameter name="scalar_bar_horizontal_label_width" value="0"/>
+ <parameter name="scalar_bar_horizontal_title_size" value="0"/>
+ <parameter name="scalar_bar_horizontal_label_size" value="0"/>
<parameter name="scalar_bar_horizontal_bar_height" value="0"/>
<parameter name="scalar_bar_horizontal_bar_width" value="0"/>
<parameter name="scalar_bar_label_color" value="255, 255, 255"/>
- <parameter name="scalar_bar_label_font" value="Arial,Bold,Italic,Underline,12"/>
- <parameter name="scalar_bar_label_format" value="%-#6.3g" />
+ <parameter name="scalar_bar_label_font" value="Arial,Bold,Italic,Shadow,12"/>
+ <parameter name="scalar_bar_label_precision" value="3" />
<parameter name="scalar_bar_logarithmic" value="false"/>
+ <!-- RKV : Begin -->
+ <!-- Do filter by scalars or don't -->
+ <parameter name="scalar_bar_filter_by_scalars" value="false"/>
+ <!-- Show distribution curve or don't -->
+ <parameter name="scalar_bar_show_distribution" value="false"/>
+ <!-- RKV : End -->
<parameter name="scalar_bar_mode" value="0" />
<parameter name="scalar_bar_num_colors" value="64"/>
<parameter name="scalar_bar_num_labels" value="5" />
<parameter name="scalar_bar_orientation" value="0" />
<parameter name="scalar_bar_title_color" value="255, 255, 255"/>
- <parameter name="scalar_bar_title_font" value="Arial,Bold,Italic,Underline,12"/>
+ <parameter name="scalar_bar_title_font" value="Arial,Bold,Italic,Shadow,12"/>
<parameter name="scalar_bar_display_units" value="true"/>
- <parameter name="scalar_bar_vertical_height" value="0.5" />
- <parameter name="scalar_bar_vertical_width" value="0.05"/>
+ <parameter name="scalar_bar_vertical_height" value="0.8" />
+ <parameter name="scalar_bar_vertical_width" value="0.08"/>
<parameter name="scalar_bar_vertical_x" value="0.01"/>
- <parameter name="scalar_bar_vertical_y" value="0.01"/>
+ <parameter name="scalar_bar_vertical_y" value="0.1"/>
<parameter name="scalar_bar_vertical_title_height" value="0"/>
<parameter name="scalar_bar_vertical_title_width" value="0"/>
<parameter name="scalar_bar_vertical_label_height" value="0"/>
<parameter name="picking_pyramid_height" value="1.0"/>
<parameter name="picking_selection_color" value="255, 255, 0"/>
<parameter name="picking_point_tolerance" value="0.01"/>
+ <parameter name="picking_info_window" value="true" />
<parameter name="picking_transparency" value="50" />
- <parameter name="picking_position" value="0" />
+ <parameter name="picking_position" value="1" />
+ <parameter name="picking_camera_movement" value="true" />
<parameter name="picking_zoom_factor" value="1.5"/>
<parameter name="picking_step_number" value="10" />
<parameter name="picking_display_parent_mesh" value="false" />
<parameter name="recorder_progressive" value="true" />
<parameter name="cache_memory_mode" value="1" />
<parameter name="cache_memory_limit" value="512" />
+ <parameter name="values_labeling_color" value="255, 255, 255"/>
+ <parameter name="values_labeling_font" value="Arial,Bold,Italic,Shadow,12"/>
</section>
<section name="resources">
<!-- Module resources -->
VISU_Convertor_impl.hxx \
VISU_ConvertorUtils.hxx \
VISU_MergeFilter.hxx \
+ VISU_MergeFilterUtilities.hxx \
VISU_AppendFilter.hxx \
VISU_AppendPolyData.hxx \
VISU_AppendFilterUtilities.hxx \
VISU_UsedPointsFilter.hxx \
VISU_CommonCellsFilter.hxx \
VISUConvertor.hxx \
+ VISU_MedConvertor.hxx \
VISU_GaussMergeFilter.hxx \
VISU_TableReader.hxx
const VISU::PMeshOnEntityImpl& theMeshOnEntity,
const VISU::PProfileImpl& theProfile)
{
+ // rnv fix for issue 19999:
+ // Throw exception in case if mesh on entity from profile is not equal
+ // input mesh on entity. This exception catch in tne VISU_Convertor_impl::GetTimeStampOnMesh
+ // function.
+ if(theProfile->myMeshOnEntity && theProfile->myMeshOnEntity != theMeshOnEntity.get())
+ EXCEPTION(std::runtime_error,"GetMeshOnProfile >> theProfile->myMeshOnEntity != theMeshOnEntity.get()");
+
if(theProfile->myIsVTKDone)
return true;
- if(theProfile->myMeshOnEntity && theProfile->myMeshOnEntity != theMeshOnEntity.get())
- return false;
+ // if(theProfile->myMeshOnEntity && theProfile->myMeshOnEntity != theMeshOnEntity.get())
+ // return false;
VISU::TTimerLog aTimerLog(MYDEBUG,"GetMeshOnProfile");
INITMSG(MYDEBUG,"GetMeshOnProfile - anEntity = "<<theMeshOnEntity->myEntity<<std::endl);
+++ /dev/null
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_ElnoMeshValue.hxx
-// Author : Alexey PETROV
-// Module : VISU
-
-#ifndef VISU_ElnoMeshValue_HeaderFile
-#define VISU_ElnoMeshValue_HeaderFile
-
-#include "VISU_VTKTypeList.hxx"
-#include <vtkDataSetAttributes.h>
-
-
-/*!
- \file VISU_ElnoMeshValue.hxx
- \brief The file contains declarations for the acess to the specific ELNO MED data
-*/
-
-namespace VISU
-{
- //---------------------------------------------------------------
- template< int elno_type >
- struct TGetElnoNodeData
- {
- typedef typename TL::TEnum2VTKArrayType< elno_type >::TResult TVTKDataArray;
- typedef typename TL::TEnum2VTKBasicType< elno_type >::TResult TDataType;
- TVTKDataArray *myElnoDataArray;
- vtkIntArray *myElnoDataMapper;
- int myElemInfo[3];
-
-
- //----------------------------------------------------------------------------
- TGetElnoNodeData( vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper )
- : myElnoDataArray( TVTKDataArray::SafeDownCast( theElnoDataArray ) )
- , myElnoDataMapper( vtkIntArray::SafeDownCast( theElnoDataMapper ) )
- {}
-
-
- //----------------------------------------------------------------------------
- TDataType*
- operator () ( vtkIdType theCellId, vtkIdType theLocalPntId )
- {
- myElnoDataMapper->GetTupleValue( theCellId, myElemInfo );
-
- vtkIdType aPos = myElemInfo[ 0 ] + theLocalPntId * myElemInfo[ 1 ];
-
- return myElnoDataArray->GetPointer( aPos );
- }
-
-
- //----------------------------------------------------------------------------
- int
- getNbComp()
- {
- myElnoDataMapper->GetTupleValue( 0, myElemInfo );
-
- return myElemInfo[ 1 ];
- }
- };
-
-
- //----------------------------------------------------------------------------------------------
- template< int elno_type >
- struct TSetElnoNodeData
- {
- typedef typename TL::TEnum2VTKArrayType< elno_type >::TResult TVTKDataArray;
- typedef typename TL::TEnum2VTKBasicType< elno_type >::TResult TDataType;
-
- //----------------------------------------------------------------------------------------------
- TSetElnoNodeData( vtkIdType theEffectNbComp,
- vtkIdType theRealNbComp,
- vtkIdType theNbTuples,
- const char* theDataArrayName,
- const char* theMapperArrayName )
- : myElnoDataArray( TVTKDataArray::New() )
- , myElnoDataMapper( vtkIntArray::New() )
- {
- myElnoDataArray->SetNumberOfComponents( theEffectNbComp );
- myElnoDataArray->SetNumberOfTuples( theNbTuples );
- myElnoDataArray->SetName( theDataArrayName );
-
- myElnoDataMapper->SetNumberOfComponents( 3 );
- myElnoDataMapper->Allocate( theNbTuples * 3 );
- myElnoDataMapper->SetName( theMapperArrayName );
-
- myElemInfo[ 0 ] = 0;
- myElemInfo[ 1 ] = theRealNbComp;
- myElemInfo[ 2 ] = 0;
- }
-
-
- //----------------------------------------------------------------------------------------------
- ~TSetElnoNodeData()
- {
- myElnoDataArray->Delete();
- myElnoDataMapper->Delete();
- }
-
-
- //----------------------------------------------------------------------------------------------
- int
- AddNextPointData( TDataType* theDataPtr )
- {
- vtkIdType aPos = myElemInfo[ 0 ] + myElemInfo[ 2 ] * myElemInfo[ 1 ];
-
- TDataType* aDataPtr = myElnoDataArray->GetPointer( aPos );
-
- for ( vtkIdType aCompId = 0; aCompId < myElemInfo[ 1 ]; aCompId++ )
- *aDataPtr++ = *theDataPtr++;
-
- return myElemInfo[ 2 ]++;
- }
-
-
- //----------------------------------------------------------------------------------------------
- void
- InsertNextCellData()
- {
- myElnoDataMapper->InsertNextTupleValue( myElemInfo );
- myElemInfo[ 0 ] += myElemInfo[ 2 ] * myElemInfo[ 1 ];
- myElemInfo[ 2 ] = 0;
- }
-
-
- //----------------------------------------------------------------------------------------------
- void
- AddData( vtkDataSetAttributes* theDataSetAttributes )
- {
- theDataSetAttributes->AddArray( myElnoDataArray );
- theDataSetAttributes->AddArray( myElnoDataMapper );
- }
-
- protected:
- TVTKDataArray *myElnoDataArray;
- vtkIntArray *myElnoDataMapper;
- int myElemInfo[ 3 ];
- };
-
-
- //---------------------------------------------------------------
-}
-
-#endif
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File:
-// Author:
-// Module : VISU
-
-#include "VISU_TableReader.hxx"
-
-#include <QFileInfo>
-#include <QString>
-#include <QRegExp>
-#include <QFile>
-#include <QStringList>
-
-#include <fstream>
-#include <iostream>
-#include <strstream>
-
-#include <vtkPoints.h>
-#include <vtkDoubleArray.h>
-#include <vtkPointData.h>
-#include <vtkCellData.h>
-#include <vtkPolyData.h>
-
-#include <vtkStructuredGrid.h>
-#include <vtkStructuredGridGeometryFilter.h>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-
-//---------------------------------------------------------------
-int
-VISU::TTable2D
-::Check()
-{
- if ( myRows.empty() )
- return 0;
-
- int iEnd = myRows[0].myValues.size();
- if ( iEnd == 0 )
- return 0;
-
- if ( myColumnTitles.size() != iEnd )
- myColumnTitles.resize( iEnd );
-
- if ( myColumnUnits.size() != iEnd )
- myColumnUnits.resize( iEnd );
-
- int jEnd = myRows.size();
- for ( int j = 0; j < jEnd; j++ )
- if ( myRows[j].myValues.size() != iEnd )
- return 0;
-
- return 1;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::TTable2D
-::getColumns(VISU::TTable2D& theTable2D) const
-{
- TRows& aRows = theTable2D.myRows;
- aRows.clear();
- if ( myRows.empty() )
- return;
-
- int jEnd = myRows.size();
-
- //Define Titles & Units
- theTable2D.myColumnTitles.resize(jEnd);
- theTable2D.myColumnUnits.resize(jEnd);
- for ( int j = 0; j < jEnd; j++ ) {
- theTable2D.myColumnTitles[j] = myRows[j].myTitle;
- theTable2D.myColumnUnits[j] = myRows[j].myUnit;
- }
-
- //Define Rows
- int iEnd = myRows[0].myValues.size();
- for ( int i = 0; i < iEnd; i++ ) {
- TRow aNewRow;
- aNewRow.myTitle = myColumnTitles[i];
- aNewRow.myUnit = myColumnUnits[i];
- aNewRow.myValues.resize(jEnd);
- for ( int j = 0; j < jEnd; j++ ) {
- aNewRow.myValues[j] = myRows[j].myValues[i];
- }
- aRows.push_back(aNewRow);
- }
-}
-
-
-//---------------------------------------------------------------
-namespace
-{
- int getLine( std::ifstream& theStmIn, QString& theString )
- {
- char tmp;
- std::ostrstream aStrOut;
-
- while ( theStmIn.get( tmp ) ) {
- aStrOut<<tmp;
- if ( tmp == '\n' )
- break;
- }
-
- aStrOut<<std::ends;
- theString = aStrOut.str();
-
- return !theStmIn.eof();
- }
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ImportTables( const char* theFileName, TTableContainer& theContainer )
-{
- std::ifstream aStmIn;
- QFileInfo aFileInfo( theFileName );
- if( !aFileInfo.isFile() || !aFileInfo.isReadable() || !aFileInfo.size() )
- return;
-
- aStmIn.open( theFileName );
- QString aTmp;
- do {
- // find beginning of table (tables are separated by empty lines)
- while( ::getLine( aStmIn, aTmp ) && aTmp.trimmed() == "");
-
- PTableIDMapper aTableIDMapper( new TTableIDMapper() );
- TTable2D& aTable2D = *aTableIDMapper;
- if(MYDEBUG) std::cout << "New table is found" << std::endl;
-
- while( !aStmIn.eof() && aTmp.trimmed() != "" ){
- QString data = aTmp.trimmed();
- QString cmt = "";
- QString keyword = "";
- // split string to data and comment (comment starts from '#' symbol)
- int index = aTmp.indexOf( "#" );
- if ( index >= 0 ) {
- data = aTmp.left( index ).trimmed();
- cmt = aTmp.mid( index+1 ).trimmed();
- }
- // if comment is not empty, try to get keyword from it (separated by ':' symbol)
- if ( !cmt.isEmpty() ) {
- int index1 = cmt.indexOf( ":" );
- if ( index1 >= 0 ) {
- QString tmpstr = cmt.left( index1 ).trimmed();
- if ( tmpstr == QString( "TITLE" ) ||
- tmpstr == QString( "COLUMN_TITLES" ) ||
- tmpstr == QString( "COLUMN_UNITS" ) ||
- tmpstr == QString( "COMMENT" ) ) {
- keyword = tmpstr;
- cmt = cmt.mid( index1+1 ).trimmed();
- }
- }
- }
- // if data is empty, process only comment
- if ( data.isEmpty() ) {
- // if keyword is found, try to process it
- // elsewise it is a simple comment, just ignore it
- if ( !keyword.isEmpty() ) {
- if ( keyword == QString( "TITLE" ) ) {
- QString title = cmt;
- if ( aTable2D.myTitle != "" )
- title = QString( aTable2D.myTitle.c_str() ) + QString( " " ) + title;
- if(MYDEBUG) std::cout << "...Table TITLE is: " << title.toLatin1().constData() << std::endl;
- aTable2D.myTitle = title.toLatin1().constData();
- }
- else if ( keyword == QString( "COLUMN_TITLES" ) ) {
- // comment may contain column headers
- QStringList aStrList = cmt.split( "|", QString::SkipEmptyParts );
- if(MYDEBUG) std::cout << "...Column TITLES are: ";
- for ( int i = 0; i < aStrList.count(); i++ ) {
- QString tmpstr = aStrList[ i ].trimmed();
- if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
- aTable2D.myColumnTitles.push_back( tmpstr.toLatin1().constData() );
- }
- if(MYDEBUG) std::cout << std::endl;
- }
- else if ( keyword == QString( "COLUMN_UNITS" ) ) {
- // comment may contain column units
- QStringList aStrList = cmt.split( " ", QString::SkipEmptyParts );
- if(MYDEBUG) std::cout << "...Column UNITS are: ";
- for ( int i = 0; i < aStrList.count(); i++ ) {
- QString tmpstr = aStrList[ i ].trimmed();
- if(MYDEBUG) std::cout << tmpstr.toLatin1().constData() << " ";
- aTable2D.myColumnUnits.push_back( tmpstr.toLatin1().constData() );
- }
- if(MYDEBUG) std::cout << std::endl;
- }
- else if ( keyword == QString( "COMMENT" ) ) {
- // keyword 'COMMENT' processing can be here
- // currently it is ignored
- if(MYDEBUG) std::cout << "...COMMENT: " << cmt.toLatin1().constData() << std::endl;
- }
- }
- else {
- if(MYDEBUG) std::cout << "...comment: " << cmt.toLatin1().constData() << std::endl;
- // simple comment processing can be here
- // currently it is ignored
- }
- }
- // if data is not empty, try to process it
- else {
- TTable2D::TRow aRow;
- if(MYDEBUG) std::cout << "...New row is found: " << std::endl;
- if ( !cmt.isEmpty() ) {
- aRow.myTitle = cmt.toLatin1().constData();
- if(MYDEBUG) std::cout << "......ROW TITLE is: " << cmt.toLatin1().constData() << std::endl;
- }
- QString datar1 = data.replace(QRegExp("\t"), " ");
- QStringList aValList = datar1.split( " ", QString::SkipEmptyParts );
- for ( int i = 0; i < aValList.count(); i++ ) {
- if ( aValList[i].trimmed() != "" ) {
- TTable2D::TValue aVal = aValList[i].trimmed().toLatin1().constData();
- aRow.myValues.push_back( aVal );
- }
- }
- if( aRow.myValues.size() > 0 )
- aTable2D.myRows.push_back( aRow );
- // ************** OLD CODE ******************
- /*
- TValue aVal;
- istrstream aStream( data );
- aStream.precision( STRPRECISION );
- while( aStream >> aVal ) {
- aRow.myValues.push_back( aVal );
- }
- if( aRow.myValues.size() > 0 )
- aTable2D.myRows.push_back( aRow );
- */
- // ************** OLD CODE ******************
- }
- ::getLine( aStmIn, aTmp );
- }
- if( aTable2D.Check() ) {
- if(MYDEBUG) std::cout << "aTable2D is checked OK " << aTable2D.myTitle << std::endl;
- theContainer.push_back( aTableIDMapper );
- }
- } while ( !aStmIn.eof() );
- aStmIn.close();
-
- if(MYDEBUG) std::cout << "After close" << std::endl;
-}
-
-
-//---------------------------------------------------------------
-VISU::TTableIDMapper
-::TTableIDMapper():
- myOutput( vtkPolyData::New() ),
- myXAxisPosition( -1 )
-{}
-
-VISU::TTableIDMapper
-::~TTableIDMapper()
-{
- myOutput->Delete();
-}
-
-vtkPolyData*
-VISU::TTableIDMapper
-::GetPolyDataOutput()
-{
- if ( myXAxisPosition == -1 )
- SetXAxisPosition( 0 );
-
- return myOutput;
-}
-
-long unsigned int
-VISU::TTableIDMapper
-::GetMemorySize()
-{
- return myOutput->GetActualMemorySize() * 1024;
-}
-
-void
-VISU::TTableIDMapper
-::SetXAxisPosition( vtkIdType theAxisPosition )
-{
- if ( myXAxisPosition == theAxisPosition || !Check() )
- return;
-
- myOutput->Initialize();
-
- if ( !Check() )
- return;
-
- TTable2D aTable2D;
- getColumns( aTable2D );
-
- vtkIdType aXSize = aTable2D.myRows[0].myValues.size();
-
- // It is necessary to decrease the size at 1 take intoa account X axis
- vtkIdType anYSize = aTable2D.myRows.size() - 1;
-
- vtkIdType aNbPoints = aXSize * anYSize;
-
- std::vector<double> anXAxis(aXSize);
- const TTable2D::TValues& aValues = aTable2D.myRows[theAxisPosition].myValues;
- for ( vtkIdType aX = 0; aX < aXSize; aX++ )
- anXAxis[aX] = atof( aValues[aX].c_str() );
-
- double aXRange = anXAxis[aXSize - 1] - anXAxis[0];
- double anYDelta = aXRange / anYSize;
- std::vector<double> anYAxis(anYSize);
- for ( vtkIdType anY = 0; anY < anYSize; anY++ )
- anYAxis[anY] = anY * anYDelta;
-
- vtkPoints* aPoints = vtkPoints::New();
- aPoints->SetNumberOfPoints( aNbPoints );
-
- vtkIntArray *aPointsIDMapper = vtkIntArray::New();
- aPointsIDMapper->SetName("VISU_POINTS_MAPPER");
- aPointsIDMapper->SetNumberOfComponents(2);
- aPointsIDMapper->SetNumberOfTuples(aNbPoints);
- int *aPointsIDMapperPtr = aPointsIDMapper->GetPointer(0);
-
- //vtkIntArray *aCellIDMapper = vtkIntArray::New();
- //aCellIDMapper->SetName("VISU_POINTS_MAPPER");
- //aCellIDMapper->SetNumberOfComponents(2);
- //aCellIDMapper->SetNumberOfTuples(aNbPoints);
- //int *aCellIDMapperPtr = aCellIDMapper->GetPointer(0);
-
- for ( vtkIdType aY = 0, aPntId = 0; aY < anYSize; aY++ ) {
- for ( vtkIdType aX = 0; aX < aXSize; aX++, aPntId++ ) {
- aPoints->SetPoint( aPntId, anXAxis[aX], anYAxis[aY], 0.0 );
-
- *aPointsIDMapperPtr++ = aPntId;
- *aPointsIDMapperPtr++ = 0;
-
- //*aCellIDMapperPtr++ = aPntId;
- //*aCellIDMapperPtr++ = 0;
- }
- }
-
- std::vector<TValues> anYData;
- for ( vtkIdType anY = 0; anY < anYSize + 1; anY++ ) {
- if ( anY == theAxisPosition )
- continue;
- anYData.push_back( aTable2D.myRows[anY].myValues );
- }
-
- vtkDoubleArray* aScalars = vtkDoubleArray::New();
- aScalars->SetNumberOfComponents( 1 );
- aScalars->SetNumberOfTuples( aNbPoints );
- double *aScalarsPtr = aScalars->GetPointer(0);
- for ( vtkIdType anY = 0; anY < anYSize; anY++ ) {
- const TTable2D::TValues& aValues = anYData[anY];
- for ( vtkIdType aX = 0; aX < aXSize; aX++ ) {
- double aValue = atof( aValues[aX].c_str() );
- *aScalarsPtr++ = aValue;
- }
- }
-
- vtkStructuredGrid* aStructuredGrid = vtkStructuredGrid::New();
- aStructuredGrid->SetPoints( aPoints );
- aPoints->Delete();
-
- aStructuredGrid->SetDimensions( aXSize, anYSize, 1 );
-
- aStructuredGrid->GetPointData()->AddArray( aPointsIDMapper );
- aPointsIDMapper->Delete();
-
- //aStructuredGrid->GetCellData()->AddArray( aCellIDMapper );
- //aCellIDMapper->Delete();
-
- aStructuredGrid->GetPointData()->SetScalars( aScalars );
- aScalars->Delete();
-
- vtkStructuredGridGeometryFilter* aFilter = vtkStructuredGridGeometryFilter::New();
- aFilter->SetInput( aStructuredGrid );
- aFilter->Update();
- myOutput->ShallowCopy( aFilter->GetOutput() );
- aFilter->Delete();
-}
+++ /dev/null
-// VISU CONVERTOR :
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_TableReader.hxx
-// Author : Alexey PETROV
-// Module : VISU
-
-#ifndef VISU_TableReader_HeaderFile
-#define VISU_TableReader_HeaderFile
-
-/*!
- \file VISU_TableReader.hxx
- \brief The file contains definition of the Table reading functionlity
-*/
-
-#include "VISUConvertor.hxx"
-
-#include "VISU_IDMapper.hxx"
-
-#include <string>
-#include <vector>
-
-namespace VISU
-{
- //---------------------------------------------------------------
- struct VISU_CONVERTOR_EXPORT TTable2D
- {
- typedef std::string TValue;
- typedef std::vector<TValue> TValues;
-
- struct TRow
- {
- std::string myTitle;
- std::string myUnit;
- TValues myValues;
- };
-
- std::string myTitle;
- std::vector<std::string> myColumnUnits;
- std::vector<std::string> myColumnTitles;
-
- typedef std::vector<TRow> TRows;
- TRows myRows;
-
- int
- Check();
-
- void
- getColumns( TTable2D& theTable2D ) const;
- };
-
-
- //---------------------------------------------------------------
- class VISU_CONVERTOR_EXPORT TTableIDMapper:
- public virtual TPolyDataIDMapper,
- public virtual TTable2D
- {
- public:
- TTableIDMapper();
- ~TTableIDMapper();
-
- virtual
- vtkPolyData*
- GetPolyDataOutput();
-
- virtual
- long unsigned int
- GetMemorySize();
-
- void
- SetXAxisPosition( vtkIdType theAxisPosition );
-
- vtkIdType
- GetXAxisPosition();
-
- protected:
- vtkIdType myXAxisPosition;
- vtkPolyData* myOutput;
- };
- typedef MED::SharedPtr<TTableIDMapper> PTableIDMapper;
-
-
- //---------------------------------------------------------------
- typedef std::vector<PTableIDMapper> TTableContainer;
- VISU_CONVERTOR_EXPORT
- void ImportTables( const char* theFileName, TTableContainer& theContainer );
-
-
- //---------------------------------------------------------------
-}
-
-#endif
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_VTKTypeList.hxx
-// Author : Oleg UVAROV
-// Module : VISU
-
-#ifndef VISU_VTKTypeList_HeaderFile
-#define VISU_VTKTypeList_HeaderFile
-
-#include "VISU_TypeList.hxx"
-
-#include <vtkCharArray.h>
-#include <vtkUnsignedCharArray.h>
-#include <vtkShortArray.h>
-#include <vtkUnsignedShortArray.h>
-#include <vtkIntArray.h>
-#include <vtkUnsignedIntArray.h>
-#include <vtkLongArray.h>
-#include <vtkUnsignedLongArray.h>
-#include <vtkFloatArray.h>
-#include <vtkDoubleArray.h>
-
-
-//----------------------------------------------------------------------------
-namespace VISU
-{
- //----------------------------------------------------------------------------
- namespace TL
- {
- //----------------------------------------------------------------------------
- typedef TSequence< char,
- unsigned char,
- short,
- unsigned short,
- int,
- unsigned int,
- long,
- unsigned long,
- float,
- double >::TResult TVTKBasicTypeList;
-
-
- //----------------------------------------------------------------------------
- typedef TSequence< vtkCharArray,
- vtkUnsignedCharArray,
- vtkShortArray,
- vtkUnsignedShortArray,
- vtkIntArray,
- vtkUnsignedIntArray,
- vtkLongArray,
- vtkUnsignedLongArray,
- vtkFloatArray,
- vtkDoubleArray >::TResult TVTKArrayTypeList;
-
-
- //----------------------------------------------------------------------------
- typedef TSequence< TInt2Type< VTK_CHAR >,
- TInt2Type< VTK_UNSIGNED_CHAR >,
- TInt2Type< VTK_SHORT >,
- TInt2Type< VTK_UNSIGNED_SHORT >,
- TInt2Type< VTK_INT >,
- TInt2Type< VTK_UNSIGNED_INT >,
- TInt2Type< VTK_LONG >,
- TInt2Type< VTK_UNSIGNED_LONG >,
- TInt2Type< VTK_FLOAT >,
- TInt2Type< VTK_DOUBLE > >::TResult TVTKBasicEnumList;
-
-
- //----------------------------------------------------------------------------
- template< unsigned int type_enum >
- struct TEnum2VTKBasicType
- {
- typedef typename TTypeAt< TVTKBasicTypeList, TIndexOf< TVTKBasicEnumList, TInt2Type< type_enum > >::value >::TResult TResult;
- };
-
-
- //----------------------------------------------------------------------------
- template< unsigned int type_enum >
- struct TEnum2VTKArrayType
- {
- typedef typename TTypeAt< TVTKArrayTypeList, TIndexOf< TVTKBasicEnumList, TInt2Type< type_enum > >::value >::TResult TResult;
- };
-
-
- //----------------------------------------------------------------------------
- template< class T >
- struct TVTKBasicType2Enum
- {
- typedef typename TTypeAt< TVTKBasicEnumList, TIndexOf< TVTKBasicTypeList, T >::value >::TResult TResult;
- };
-
-
- //----------------------------------------------------------------------------
- }
-
-
- //----------------------------------------------------------------------------
-}
-
-#endif
include $(top_srcdir)/adm_local/unix/make_common_starter.am
lib_LTLIBRARIES= libVISUEngine.la
+
+salomeinclude_HEADERS= VISU_Engine_i.hh
+
dist_libVISUEngine_la_SOURCES= VISU_Engine_i.cc
libVISUEngine_la_CPPFLAGS= $(KERNEL_CXXFLAGS) $(MED_CXXFLAGS) $(CORBA_CXXFLAGS) $(CORBA_INCLUDES) \
{
return myVisuGen->GetColoredPrs3dCache(theStudy);
}
+
+
+
+ CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name)
+ {
+ return myVisuGen->CreateClippingPlane(X, Y, Z, dX, dY, dZ, isAuto, name);
+ }
+
+
+ void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name)
+ {
+ myVisuGen->EditClippingPlane(id, X, Y, Z, dX, dY, dZ, isAuto, name);
+ }
+
+ /* Returns clipping plane by its Id */
+ VISU::ClippingPlane* VISU_Gen_i::GetClippingPlane(CORBA::Long id)
+ {
+ return myVisuGen->GetClippingPlane(id);
+ }
+
+ /* Deletes clipping plane by its Id */
+ CORBA::Boolean VISU_Gen_i::DeleteClippingPlane(CORBA::Long id)
+ {
+ return myVisuGen->DeleteClippingPlane(id);
+ }
+
+ /* Applyes a clipping plane with Id to presentation thePrs */
+ CORBA::Boolean VISU_Gen_i::ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id)
+ {
+ return myVisuGen->ApplyClippingPlane(thePrs, id);
+ }
+
+ CORBA::Boolean VISU_Gen_i::DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id)
+ {
+ return myVisuGen->DetachClippingPlane(thePrs, id);
+ }
+
+ /* Get number of clipping planes */
+ CORBA::Long VISU_Gen_i::GetClippingPlanesNb()
+ {
+ return myVisuGen->GetClippingPlanesNb();
+ }
};
virtual
VISU::ColoredPrs3dCache_ptr
GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
+
+
+
+ virtual CORBA::Long CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name);
+
+ virtual void EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name);
+
+ /* Returns clipping plane by its Id */
+ virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
+
+ /* Deletes clipping plane by its Id */
+ virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
+
+ /* Applyes a clipping plane with Id to presentation thePrs */
+ virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
+
+ /* Detaches a clipping plane with Id from presentation thePrs */
+ virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
+
+ /* Get number of clipping planes */
+ virtual CORBA::Long GetClippingPlanesNb();
};
};
salomeinclude_HEADERS = \
VISU_BoostSignals.h \
VISU_ActorFactory.h \
+ VISU_PickingSettings.h \
VISU_GaussPtsSettings.h \
VISU_GaussPtsActorFactory.h \
+ VISU_GaussPtsDeviceActor.h \
VISU_Event.h \
VISU_Actor.h \
VISU_DataSetActor.h \
VISU_DataSetActor.cxx \
VISU_MeshAct.cxx \
VISU_ScalarMapAct.cxx \
+ VISU_PickingSettings.cxx \
VISU_GaussPtsDeviceActor.cxx \
VISU_GaussPtsSettings.cxx \
VISU_GaussPtsAct.cxx \
// $Header$
#include "VISU_Actor.h"
+
+#include "VISU_PickingSettings.h"
+#include "VISU_GaussPtsDeviceActor.h"
+
#include "VISU_PipeLine.hxx"
+
+#include "SVTK_Event.h"
+
#include "VTKViewer_ShrinkFilter.h"
#include "VTKViewer_GeometryFilter.h"
#include "VISU_ActorFactory.h"
#include <vtkPolyData.h>
#include <vtkUnstructuredGrid.h>
#include <vtkPassThroughFilter.h>
+#include <vtkFeatureEdges.h>
+#include <vtkActor2D.h>
+#include <vtkMaskPoints.h>
+#include <vtkLabeledDataMapper.h>
+#include <vtkSelectVisiblePoints.h>
+#include <vtkTextProperty.h>
+#include <vtkProperty2D.h>
#include <vtkShrinkFilter.h>
#include <vtkShrinkPolyData.h>
#include <vtkGeometryFilter.h>
#include <vtkObjectFactory.h>
+#include <vtkCallbackCommand.h>
+#include <vtkCamera.h>
+#include <vtkRenderWindowInteractor.h>
+
#include <boost/bind.hpp>
#include "utilities.h"
//----------------------------------------------------------------------------
VISU_Actor
::VISU_Actor():
+ myEventCallbackCommand(vtkCallbackCommand::New()),
+ myPriority(0.0),
myIsVTKMapping(false),
myPrs3d(NULL),
myIsShrunk(false),
myIsShrinkable(false),
myShrinkFilter(VTKViewer_ShrinkFilter::New()),
myAnnotationMapper(vtkTextMapper::New()),
- myAnnotationActor(vtkTextActor::New())
+ myAnnotationActor(vtkTextActor::New()),
+ myTextActor(VISU_FramedTextActor::New()),
+ myIsFeatureEdgesAllowed(false),
+ myIsFeatureEdgesEnabled(false),
+ myFeatureEdges(vtkFeatureEdges::New()),
+ myLastSelectionMode(ActorSelection),
+ myIsSubElementsHighlighted(false)
{
if(MYDEBUG) MESSAGE("VISU_Actor::VISU_Actor - this = "<<this);
myAnnotationActor->Delete();
myAnnotationActor->SetVisibility(0);
+
+ myTextActor->Delete();
+ myTextActor->SetVisibility(false);
+ myTextActor->SetPickable(false);
+
+ myFeatureEdges->Delete();
+
+ myEventCallbackCommand->Delete();
+ myEventCallbackCommand->SetClientData(this);
+ myEventCallbackCommand->SetCallback(VISU_Actor::ProcessEvents);
+
+ if( VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get() )
+ aPickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
+
+ //Definition of values labeling pipeline
+
+ myValLblDataSet = vtkUnstructuredGrid::New();
+
+ myValCellCenters = vtkCellCenters::New();
+ myValCellCenters->SetInput(myValLblDataSet);
+
+ myValMaskPoints = vtkMaskPoints::New();
+ myValMaskPoints->SetInput(myValCellCenters->GetOutput());
+ myValMaskPoints->SetOnRatio(1);
+
+ myValSelectVisiblePoints = vtkSelectVisiblePoints::New();
+ myValSelectVisiblePoints->SetInput(myValMaskPoints->GetOutput());
+ myValSelectVisiblePoints->SelectInvisibleOff();
+ myValSelectVisiblePoints->SetTolerance(0.1);
+
+ myValLabeledDataMapper = vtkLabeledDataMapper::New();
+ myValLabeledDataMapper->SetInput(myValSelectVisiblePoints->GetOutput());
+ myValLabeledDataMapper->SetLabelFormat("%g");
+ myValLabeledDataMapper->SetLabelModeToLabelScalars();
+
+ vtkTextProperty* aClsTextProp = vtkTextProperty::New();
+ aClsTextProp->SetFontFamilyToTimes();
+ static int aCellsFontSize = 12;
+ aClsTextProp->SetFontSize(aCellsFontSize);
+ aClsTextProp->SetBold(1);
+ aClsTextProp->SetItalic(0);
+ aClsTextProp->SetShadow(0);
+ myValLabeledDataMapper->SetLabelTextProperty(aClsTextProp);
+ aClsTextProp->Delete();
+
+ myIsValLabeled = false;
+
+ myValLabels = vtkActor2D::New();
+ myValLabels->SetMapper(myValLabeledDataMapper);
+ myValLabels->GetProperty()->SetColor(0,1,0);
+ myValLabels->SetVisibility( myIsValLabeled );
}
//----------------------------------------------------------------------------
SetShrink();
else
UnShrink();
+
+ SetFeatureEdgesAllowed(theActor->IsFeatureEdgesAllowed());
+ SetFeatureEdgesEnabled(theActor->IsFeatureEdgesEnabled());
+ SetFeatureEdgesAngle(theActor->GetFeatureEdgesAngle());
+ bool aFeatureEdges = false, aBoundaryEdges = false, aManifoldEdges = false, aNonManifoldEdges = false;
+ theActor->GetFeatureEdgesFlags( aFeatureEdges, aBoundaryEdges, aManifoldEdges, aNonManifoldEdges );
+ SetFeatureEdgesFlags( aFeatureEdges, aBoundaryEdges, aManifoldEdges, aNonManifoldEdges );
+ SetFeatureEdgesColoring(theActor->GetFeatureEdgesColoring());
+
SetOpacity(theActor->GetOpacity());
SetLineWidth(theActor->GetLineWidth());
SetPosition(theActor->GetPosition());
VISU_Actor
::~VISU_Actor()
{
+ // Deleting of values labeling pipeline
+ myValLblDataSet->Delete();
+ myValLabeledDataMapper->RemoveAllInputs();
+ myValLabeledDataMapper->Delete();
+ myValSelectVisiblePoints->Delete();
+ myValMaskPoints->Delete();
+ myValCellCenters->Delete();
+ myValLabels->Delete();
+
if(MYDEBUG) MESSAGE("~VISU_Actor() - this = "<<this);
Superclass::SetProperty(NULL);
SetDebug(MYVTKDEBUG);
::SetPipeLine(VISU_PipeLine* thePipeLine)
{
myPipeLine = thePipeLine;
- if ( thePipeLine ) {
- if ( vtkMapper *aMapper = myPipeLine->GetMapper() ) {
- if ( vtkDataSet *aDataSet = aMapper->GetInput() ) {
- SetShrinkable( thePipeLine->IsShrinkable() );
- SetMapperInput( aDataSet );
+ if(thePipeLine){
+ if(vtkMapper *aMapper = myPipeLine->GetMapper()){
+ if(vtkDataSet *aDataSet = aMapper->GetInput()){
+ SetShrinkable(thePipeLine->IsShrinkable());
+ SetFeatureEdgesAllowed(thePipeLine->IsFeatureEdgesAllowed());
+ SetMapperInput(aDataSet);
}
}
}
{
Superclass::SetRepresentation(theMode);
if(myRepresentation == VTK_POINTS)
+ {
UnShrink();
+ }
+ SetFeatureEdgesEnabled( theMode == SVTK::Representation::FeatureEdges );
}
}
+//----------------------------------------------------------------------------
+bool
+VISU_Actor
+::IsFeatureEdgesAllowed()
+{
+ return myIsFeatureEdgesAllowed;
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+ myIsFeatureEdgesAllowed = theIsFeatureEdgesAllowed;
+}
+
+bool
+VISU_Actor
+::IsFeatureEdgesEnabled()
+{
+ return myIsFeatureEdgesEnabled;
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+ if ( !myIsFeatureEdgesAllowed || myIsFeatureEdgesEnabled == theIsFeatureEdgesEnabled )
+ return;
+
+ if ( vtkPolyData* aPolyData = myPassFilter[ 2 ]->GetPolyDataOutput() )
+ {
+ if( theIsFeatureEdgesEnabled )
+ {
+ myFeatureEdges->SetInput( aPolyData );
+ myPassFilter[ 3 ]->SetInput( myFeatureEdges->GetOutput() );
+ myIsFeatureEdgesEnabled = true;
+ }
+ else
+ {
+ myPassFilter[3]->SetInput( aPolyData );
+ myPassFilter[3]->Modified();
+ myIsFeatureEdgesEnabled = false;
+ Modified();
+ }
+ myIsFeatureEdgesEnabled = theIsFeatureEdgesEnabled;
+ }
+}
+
+vtkFloatingPointType
+VISU_Actor
+::GetFeatureEdgesAngle()
+{
+ return myFeatureEdges->GetFeatureAngle();
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
+{
+ myFeatureEdges->SetFeatureAngle(theValue);
+ Modified();
+}
+
+void
+VISU_Actor
+::GetFeatureEdgesFlags(bool& theIsFeatureEdges,
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges)
+{
+ theIsFeatureEdges = myFeatureEdges->GetFeatureEdges();
+ theIsBoundaryEdges = myFeatureEdges->GetBoundaryEdges();
+ theIsManifoldEdges = myFeatureEdges->GetManifoldEdges();
+ theIsNonManifoldEdges = myFeatureEdges->GetNonManifoldEdges();
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
+{
+ myFeatureEdges->SetFeatureEdges(theIsFeatureEdges);
+ myFeatureEdges->SetBoundaryEdges(theIsBoundaryEdges);
+ myFeatureEdges->SetManifoldEdges(theIsManifoldEdges);
+ myFeatureEdges->SetNonManifoldEdges(theIsNonManifoldEdges);
+ Modified();
+}
+
+bool
+VISU_Actor
+::GetFeatureEdgesColoring()
+{
+ return myFeatureEdges->GetColoring();
+}
+
+void
+VISU_Actor
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+ myFeatureEdges->SetColoring(theIsColoring);
+ Modified();
+}
+
//----------------------------------------------------------------------------
void
VISU_Actor
{
Superclass::AddToRender(theRenderer);
theRenderer->AddActor(myAnnotationActor.GetPointer());
+ theRenderer->AddActor(myTextActor.GetPointer());
+
+ myValSelectVisiblePoints->SetRenderer( theRenderer );
+ theRenderer->AddActor2D( myValLabels );
+
}
//==================================================================
::RemoveFromRender(vtkRenderer* theRenderer)
{
theRenderer->RemoveActor(myAnnotationActor.GetPointer());
+ theRenderer->RemoveActor(myTextActor.GetPointer());
+ theRenderer->RemoveActor(myValLabels);
Superclass::RemoveFromRender(theRenderer);
myDestroySignal(this);
}
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::SetVisibility(int theMode)
+{
+ Superclass::SetVisibility( theMode );
+ myValLabels->SetVisibility( myIsValLabeled && theMode );
+}
+
//----------------------------------------------------------------------------
void
VISU_Actor
aSize += aDataSet->GetActualMemorySize() * 1024;
}
+ if(IsFeatureEdgesEnabled()){
+ vtkPolyData* aPolyData = myFeatureEdges->GetOutput();
+ aSize += aPolyData->GetActualMemorySize() * 1024;
+ }
+
return aSize;
}
//----------------------------------------------------------------------------
bool
VISU_Actor
+::isSubElementsHighlighted()
+{
+ return myIsSubElementsHighlighted;
+}
+
+
+//----------------------------------------------------------------------------
+inline
+void
+ChangeZoom(vtkFloatingPointType theZoomFactor,
+ vtkRenderer* theRenderer,
+ vtkIdType theInitialHasIndex,
+ vtkIdType theCurrentHasIndex)
+{
+ //printf( "VISU_Actor::ChangeZoom( %d, %d )", theInitialHasIndex, theCurrentHasIndex );
+ if(theInitialHasIndex + theCurrentHasIndex == 1){
+ vtkCamera *aCamera = theRenderer->GetActiveCamera();
+
+ double aScale = aCamera->GetParallelScale();
+ if ( !theInitialHasIndex && theCurrentHasIndex ) {
+ //printf( " : +%f", theZoomFactor );
+ aCamera->SetParallelScale( aScale / theZoomFactor );
+ }
+ else {
+ //printf( " : -%f", theZoomFactor );
+ aCamera->SetParallelScale( aScale * theZoomFactor );
+ }
+ }
+ //printf( "\n" );
+}
+
+/*!
+ Updates visibility of the highlight devices
+*/
+void
+VISU_Actor
+::highlight(bool theIsHighlight)
+{
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+
+ bool aShowTextActor = aPickingSettings->GetInfoWindowEnabled();
+ if( theIsHighlight && mySelectionMode != myLastSelectionMode )
+ {
+ if( mySelectionMode == ActorSelection )
+ ResetTextActor();
+ else
+ aShowTextActor = false;
+ myLastSelectionMode = mySelectionMode;
+ }
+
+ myTextActor->SetVisibility( GetVisibility() && theIsHighlight && aShowTextActor );
+
+ bool anInitialHasIndex = isHighlighted();
+ bool aCurrentHasIndex = theIsHighlight;
+
+ if( !theIsHighlight && mySelectionMode == ActorSelection && isSubElementsHighlighted() )
+ {
+ myIsSubElementsHighlighted = false;
+
+ // Zoom
+ if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
+ {
+ vtkFloatingPointType aZoomFactor = aPickingSettings->GetZoomFactor();
+ ChangeZoom(aZoomFactor,
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
+ }
+ }
+
+ Superclass::highlight(theIsHighlight);
+}
+
+/*!
+ To process prehighlight (called from SVTK_InteractorStyle)
+*/
+bool
+VISU_Actor
::PreHighlight(vtkInteractorStyle* theInteractorStyle,
SVTK_SelectionEvent* theSelectionEvent,
bool theIsHighlight)
if(myCellPicker->GetActor() != this)
return false;
-
+
vtkIdType aVTKId = myCellPicker->GetCellId();
if(aVTKId >= 0 && mySelector->IsValid(this,aVTKId,true) && hasIO()){
vtkIdType anObjId = GetElemObjId(aVTKId);
theSelectionEvent->myY,
0.0,
aRenderer);
-
+
if(myPointPicker->GetActor() != this)
return false;
return aRet;
}
+
+void VISU_Actor::RemoveAllClippingPlanes()
+{
+}
+
+vtkIdType VISU_Actor::GetNumberOfClippingPlanes()
+{
+ return 0;
+}
+
+bool VISU_Actor::AddClippingPlane(vtkPlane* thePlane)
+{
+ return false;
+}
+
+vtkPlane* VISU_Actor::GetClippingPlane(vtkIdType theID)
+{
+ return NULL;
+}
+
+vtkImplicitFunctionCollection* VISU_Actor::GetClippingPlanes()
+{
+ return NULL;
+}
+
+//----------------------------------------------------------------------------
+template<class TData> std::string getScalar(TData* theData, int theId)
+{
+ std::ostringstream aStr;
+ if (vtkDataArray *aScalar = theData->GetScalars()){
+ vtkFloatingPointType aVal = aScalar->GetTuple1(theId);
+ aStr << "\nScalar: " << aVal;
+ }
+ return aStr.str();
+}
+
+template<class TData> std::string getVector(TData* theData, int theId)
+{
+ std::ostringstream aStr;
+ if (vtkDataArray *aVector = theData->GetVectors()) {
+ vtkFloatingPointType *aVal = aVector->GetTuple3(theId);
+ aStr << "\nVector: " << "{" << aVal[0] << "; " << aVal[1] << "; " << aVal[2] << "}";
+ }
+ return aStr.str();
+}
+
+/*!
+ To process highlight (called from SVTK_InteractorStyle)
+*/
+bool
+VISU_Actor
+::Highlight(vtkInteractorStyle* theInteractorStyle,
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight)
+{
+ return Superclass::Highlight(theInteractorStyle,
+ theSelectionEvent,
+ theIsHighlight);
+}
+
+//-------------------------------------------------------------------------
+void
+VISU_Actor
+::Highlight(bool theIsHighlight)
+{
+ Superclass::Highlight(theIsHighlight);
+
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+
+ bool anInitialHasIndex = isSubElementsHighlighted() && mySelectionMode != ActorSelection;
+
+ TColStd_IndexedMapOfInteger aMapIndex;
+ mySelector->GetIndex( getIO(), aMapIndex );
+ bool aCurrentHasIndex = aMapIndex.Extent() == 1;
+
+ myIsSubElementsHighlighted = aCurrentHasIndex;
+
+ bool aFlyTo = false;
+ vtkFloatingPointType aFlyToCoord[3] = { 0.0, 0.0, 0.0 };
+ vtkRenderer *aRenderer = GetRenderer();
+
+ if( theIsHighlight )
+ {
+ vtkDataSet* aDataSet = GetMapper()->GetInput();
+ switch(mySelectionMode)
+ {
+ case ActorSelection:
+ {
+ ResetTextActor();
+ break;
+ }
+ case CellSelection:
+ {
+ if( !aCurrentHasIndex )
+ {
+ myTextActor->SetVisibility(false);
+ break;
+ }
+
+ int anObjId = aMapIndex(1);
+ vtkCellData* aCellData = aDataSet->GetCellData();
+ if(vtkCell* aCell = GetElemCell(anObjId)){
+ vtkPoints* aPts = aCell->GetPoints();
+ if(int aNbPts = aCell->GetNumberOfPoints()){
+ vtkFloatingPointType aCoord[3] = {0.0, 0.0, 0.0};
+ for(int i = 0; i < aNbPts; i++){
+ vtkFloatingPointType *aPntCoord = aPts->GetPoint(i);
+ aCoord[0] += aPntCoord[0];
+ aCoord[1] += aPntCoord[1];
+ aCoord[2] += aPntCoord[2];
+ }
+
+ aFlyTo = true;
+ aFlyToCoord[0] = aCoord[0] / aNbPts;
+ aFlyToCoord[1] = aCoord[1] / aNbPts;
+ aFlyToCoord[2] = aCoord[2] / aNbPts;
+
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0]/aNbPts, aCoord[1]/aNbPts, aCoord[2]/aNbPts, 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myTextActor->SetPosition(aSelectionPoint);
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetWorldPoint(aWorldCoord);
+
+ std::ostringstream aStr;
+ aStr << "Cell ID: " << anObjId;
+
+ vtkCell* aCell = GetElemCell(anObjId);
+ int aVTKID = GetElemVTKID(anObjId);
+ if (aCell) {
+ int aNbOfPoints = aCell->GetNumberOfPoints();
+ if ( aNbOfPoints > 0 ) {
+ aStr << getScalar(aCellData, aVTKID);
+ aStr << getVector(aCellData, aVTKID);
+ }
+ }
+
+ std::string aString = aStr.str();
+ myTextActor->SetText(aString.c_str());
+ }
+ }
+ break;
+ }
+ case NodeSelection:
+ {
+ if( !aCurrentHasIndex )
+ {
+ myTextActor->SetVisibility(false);
+ break;
+ }
+
+ int anObjId = aMapIndex(1);
+ vtkPointData* aPntData = aDataSet->GetPointData();
+ if(vtkFloatingPointType* aCoord = GetNodeCoord(anObjId)){
+ aFlyTo = true;
+ aFlyToCoord[0] = aCoord[0];
+ aFlyToCoord[1] = aCoord[1];
+ aFlyToCoord[2] = aCoord[2];
+
+ vtkFloatingPointType aWorldCoord[4] = {aCoord[0], aCoord[1], aCoord[2], 1.0};
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myTextActor->SetPosition(aSelectionPoint);
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetWorldPoint(aWorldCoord);
+
+ std::ostringstream aStr;
+ aStr << "Point ID: " << anObjId;
+
+ int aVTKID = GetNodeVTKID(anObjId);
+ if(aVTKID >= 0) {
+ aStr << getScalar(aPntData, aVTKID);
+ aStr << getVector(aPntData, aVTKID);
+ }
+
+ const VISU::PIDMapper& aMapper = GetPipeLine()->GetIDMapper();
+ //VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(anObjId);
+ VISU::TStructuredId aVec = aMapper->GetIndexesOfNode(anObjId);
+
+ aStr << "\nCoordinates: " << "[";
+ aStr << aCoord[0];
+ //if( aVec.size() > 0 )
+ if (aVec[0] != -1)
+ aStr << " (" << aVec[0] << ")";
+ aStr << "; ";
+
+ aStr << aCoord[1];
+ //if( aVec.size() > 1 )
+ if (aVec[1] != -1)
+ aStr << " (" << aVec[1] << ")";
+ aStr << "; ";
+
+ aStr << aCoord[2];
+ //if( aVec.size() > 2 )
+ if (aVec[2] != -1)
+ aStr << " (" << aVec[2] << ")";
+ aStr << "]";
+
+ std::string aString = aStr.str();
+ myTextActor->SetText(aString.c_str());
+ }
+ break;
+ }
+ case EdgeOfCellSelection:
+ break;
+ default:
+ break;
+ }
+ }
+
+ // Zoom
+ if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
+ {
+ vtkFloatingPointType aZoomFactor = aPickingSettings->GetZoomFactor();
+ ChangeZoom(aZoomFactor,
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
+ }
+
+ // FlyTo
+ if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() && aFlyTo )
+ {
+ vtkRenderWindowInteractor* anInteractor = myInteractor;
+ vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
+ int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
+
+ anInteractor->SetDolly(0.0);
+ anInteractor->SetNumberOfFlyFrames(aPickingSettings->GetStepNumber());
+ anInteractor->FlyTo(aRenderer, aFlyToCoord);
+ aRenderer->ResetCameraClippingRange();
+ anInteractor->SetDolly(aDollyWas);
+ anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
+ anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aFlyToCoord);
+ }
+}
+
+//-------------------------------------------------------------------------
+void
+VISU_Actor
+::ResetTextActor()
+{
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+
+ vtkFloatingPointType aCoord[6];
+ GetBounds(aCoord);
+
+ vtkFloatingPointType aWorldCoord[4] = { ( aCoord[0] + aCoord[1] ) / 2,
+ ( aCoord[2] + aCoord[3] ) / 2,
+ ( aCoord[4] + aCoord[5] ) / 2, 1.0};
+ vtkRenderer* aRenderer = GetRenderer();
+ aRenderer->SetWorldPoint(aWorldCoord);
+ aRenderer->WorldToDisplay();
+ vtkFloatingPointType aSelectionPoint[3];
+ aRenderer->GetDisplayPoint(aSelectionPoint);
+ myTextActor->SetPosition(aSelectionPoint);
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetWorldPoint(aWorldCoord);
+
+ std::ostringstream aStr;
+ /*
+ if( const char* aName = getName() )
+ aStr << aName << "\n";
+ */
+ aStr << "Position: " << "[" << aCoord[0] << "; " << aCoord[2] << "; " << aCoord[4] << "]";
+ aStr << "\nSize: " << "[" <<
+ fabs(aCoord[1]-aCoord[0]) << "; " <<
+ fabs(aCoord[3]-aCoord[2]) << "; " <<
+ fabs(aCoord[5]-aCoord[4]) << "]";
+
+ std::string aString = aStr.str();
+ myTextActor->SetText(aString.c_str());
+}
+
+//-------------------------------------------------------------------------
+void
+VISU_Actor
+::ProcessEvents(vtkObject* vtkNotUsed(theObject),
+ unsigned long theEvent,
+ void* theClientData,
+ void* vtkNotUsed(theCallData))
+{
+ if(vtkObject* anObject = reinterpret_cast<vtkObject*>(theClientData))
+ if(VISU_Actor* self = dynamic_cast<VISU_Actor*>(anObject)) {
+ if(theEvent == VISU::UpdatePickingSettingsEvent)
+ self->UpdatePickingSettings();
+ }
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_Actor
+::UpdatePickingSettings()
+{
+ //printf( "VISU_Actor::UpdatePickingSettings()\n" );
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+ if( !aPickingSettings )
+ return;
+
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
+
+ Highlight(isHighlighted());
+
+ Update();
+}
+
+// ---------------------------------------------------------------
+
+void VISU_Actor::SetValuesLabeled( const bool theIsValLabeled )
+{
+ vtkDataSet* aGrid = GetValLabelsInput();
+ if ( !aGrid )
+ return;
+
+ bool isOnPnt = VISU::IsDataOnPoints( aGrid );
+ bool isOnCell = VISU::IsDataOnCells( aGrid );
+ if ( !isOnPnt && !isOnCell )
+ {
+ // try to specify location of scalars "manually"
+ vtkCellData* aCData = aGrid->GetCellData();
+ if ( aCData )
+ {
+ vtkDataArray* anArr = aCData->GetScalars();
+ if ( anArr && anArr->GetNumberOfTuples() )
+ isOnCell = true;
+ }
+
+ if ( !isOnCell )
+ {
+ vtkPointData* aPData = aGrid->GetPointData();
+ if ( aPData )
+ {
+ vtkDataArray* anArr = aPData->GetScalars();
+ if ( anArr && anArr->GetNumberOfTuples() )
+ isOnPnt = true;
+ }
+ }
+
+ if ( !isOnPnt && !isOnCell )
+ {
+ myValLabels->SetVisibility( false );
+ return;
+ }
+ }
+
+ myIsValLabeled = theIsValLabeled;
+
+ if ( myIsValLabeled )
+ {
+ vtkDataSet* aDataSet = aGrid;
+
+ if ( isOnCell )
+ {
+ myValCellCenters->SetInput( aDataSet );
+ myValMaskPoints->SetInput( myValCellCenters->GetOutput() );
+ }
+ else if ( isOnPnt )
+ myValMaskPoints->SetInput( aDataSet );
+
+ myValLabels->SetVisibility( GetVisibility() );
+ }
+ else
+ myValLabels->SetVisibility( false );
+
+ Modified();
+}
+
+//----------------------------------------------------------------------------
+
+bool VISU_Actor::GetValuesLabeled() const
+{
+ return myIsValLabeled;
+}
+
+//----------------------------------------------------------------------------
+
+vtkTextProperty* VISU_Actor::GetsValLabelsProps() const
+{
+ return myValLabeledDataMapper->GetLabelTextProperty();
+}
+
+//----------------------------------------------------------------------------
+
+vtkDataSet* VISU_Actor::GetValLabelsInput()
+{
+ vtkDataSet* aDataSet = 0;
+ VISU_PipeLine* aPL = GetPipeLine();
+ if ( aPL )
+ aDataSet = aPL->GetOutput();
+ if ( !aDataSet )
+ aDataSet = GetInput();
+ return aDataSet;
+}
+
class vtkTextMapper;
class vtkTextActor;
class vtkInteractorStyle;
+class vtkCallbackCommand;
class VTKViewer_ShrinkFilter;
class VISU_PipeLine;
+class vtkPlane;
+class vtkImplicitFunctionCollection;
+class vtkFeatureEdges;
+class vtkTextProperty;
+class vtkCellCenters;
+class vtkSelectVisiblePoints;
+class vtkLabeledDataMapper;
+class vtkMaskPoints;
+class vtkActor2D;
+
+class VISU_FramedTextActor;
#ifdef _WIN32
#define VTKOCC_EXPORT __declspec (dllexport)
namespace Representation
{
const Type Surfaceframe = Insideframe + 1;
+ const Type FeatureEdges = Insideframe + 2;
}
}
virtual
void
RemoveFromRender();
+
+ virtual
+ void
+ SetVisibility(int theMode);
//----------------------------------------------------------------------------
virtual
vtkFloatingPointType
GetShrinkFactor();
+ //----------------------------------------------------------------------------
+ virtual
+ bool
+ IsFeatureEdgesAllowed();
+
+ virtual
+ void
+ SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+ virtual
+ bool
+ IsFeatureEdgesEnabled();
+
+ virtual
+ void
+ SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
+
+ virtual
+ vtkFloatingPointType
+ GetFeatureEdgesAngle();
+
+ virtual
+ void
+ SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0);
+
+ virtual
+ void
+ GetFeatureEdgesFlags(bool& theIsFeatureEdges,
+ bool& theIsBoundaryEdges,
+ bool& theIsManifoldEdges,
+ bool& theIsNonManifoldEdges);
+
+ virtual
+ void
+ SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
+
+ virtual
+ bool
+ GetFeatureEdgesColoring();
+
+ virtual
+ void
+ SetFeatureEdgesColoring(bool theIsColoring);
+
//----------------------------------------------------------------------------
virtual
void
RemoveFromRender( vtkRenderer* );
//----------------------------------------------------------------------------
+ //! Just to update visibility of the highlight devices
+ virtual
+ void
+ highlight(bool theHighlight);
+
+ //! To process prehighlight (called from #SVTK_InteractorStyle)
virtual
bool
PreHighlight(vtkInteractorStyle* theInteractorStyle,
SVTK_SelectionEvent* theSelectionEvent,
bool theIsHighlight);
+ //! To process highlight (called from #SVTK_InteractorStyle)
+ virtual
+ bool
+ Highlight(vtkInteractorStyle* theInteractorStyle,
+ SVTK_SelectionEvent* theSelectionEvent,
+ bool theIsHighlight);
+
+ //! Internal highlight.
+ virtual
+ void
+ Highlight(bool theIsHighlight);
+
virtual
void
SetVTKMapping(bool theIsVTKMapping);
GetElemCell(vtkIdType theObjID);
//----------------------------------------------------------------------------
+ virtual void RemoveAllClippingPlanes();
+
+ virtual vtkIdType GetNumberOfClippingPlanes();
+
+ virtual bool AddClippingPlane(vtkPlane* thePlane);
+
+ virtual vtkPlane* GetClippingPlane(vtkIdType theID);
+
+ virtual vtkImplicitFunctionCollection* GetClippingPlanes();
+
+ //----------------------------------------------------------------------------
+ //! Apply the picking settings on the actor.
+ void
+ UpdatePickingSettings();
+
+ //----------------------------------------------------------------------------
+ //! Methods for values labeling
+ virtual
+ void
+ SetValuesLabeled( const bool theIsValLabeled );
+
+ virtual
+ bool
+ GetValuesLabeled() const;
+
+ virtual
+ vtkDataSet*
+ GetValLabelsInput();
+
+ vtkTextProperty*
+ GetsValLabelsProps() const;
+
protected:
VISU_Actor();
GetCurrentPL();
//----------------------------------------------------------------------------
+ bool
+ isSubElementsHighlighted();
+
+ //----------------------------------------------------------------------------
+ vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
+
+ //! Main process VTK event method
+ static
+ void
+ ProcessEvents(vtkObject* theObject,
+ unsigned long theEvent,
+ void* theClientData,
+ void* theCallData);
+
+ //----------------------------------------------------------------------------
+ private:
+ void
+ ResetTextActor();
+
+ //----------------------------------------------------------------------------
+ protected:
+ vtkFloatingPointType myPriority;
bool myIsVTKMapping;
VISU::Prs3d_i* myPrs3d;
vtkSmartPointer<VISU_PipeLine> myPipeLine;
vtkSmartPointer<vtkTextMapper> myAnnotationMapper;
vtkSmartPointer<vtkTextActor> myAnnotationActor;
+
+ vtkSmartPointer<VISU_FramedTextActor> myTextActor;
+
+ vtkSmartPointer<vtkFeatureEdges> myFeatureEdges;
+ bool myIsFeatureEdgesAllowed;
+ bool myIsFeatureEdgesEnabled;
+
+ Selection_Mode myLastSelectionMode;
+ bool myIsSubElementsHighlighted;
+
+ // fields for values labeling
+ bool myIsValLabeled;
+ vtkDataSet* myValLblDataSet;
+ vtkActor2D* myValLabels;
+ vtkMaskPoints* myValMaskPoints;
+ vtkCellCenters* myValCellCenters;
+ vtkLabeledDataMapper* myValLabeledDataMapper;
+ vtkSelectVisiblePoints* myValSelectVisiblePoints;
};
#endif //VISU_ACTOR_H
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File :
-// Author :
-// Module : VISU
-// $Header$
-
-#include "VISU_ActorBase.h"
-#include "VISU_ActorFactory.h"
-#include "VTKViewer_ShrinkFilter.h"
-
-#include <vtkObjectFactory.h>
-#include <vtkProperty.h>
-#include <vtkPassThroughFilter.h>
-#include <vtkShrinkFilter.h>
-#include <vtkDataSet.h>
-#include <vtkShrinkPolyData.h>
-#include <vtkUnstructuredGrid.h>
-
-#include "utilities.h"
-
-#include <boost/bind.hpp>
-
-VISU_ActorBase
-::VISU_ActorBase() :
- myIsShrinkable(true),
- myIsShrunk(false),
- myShrinkFilter(VTKViewer_ShrinkFilter::New())
-{
- myShrinkFilter->Delete();
-
- myStoreMapping = true;
-
- myShrinkFilter->SetStoreMapping(true);
-}
-
-VISU_ActorBase
-::~VISU_ActorBase()
-{
-
-}
-
-//----------------------------------------------------------------------------
-VISU::TActorFactory*
-VISU_ActorBase
-::GetFactory()
-{
- return myActorFactory;
-}
-
-void
-VISU_ActorBase
-::SetFactory(VISU::TActorFactory* theActorFactory)
-{
- using namespace VISU;
-
- if(myActorFactory == theActorFactory)
- return;
-
- if(theActorFactory)
- myDestroySignal.connect(boost::bind(&TActorFactory::RemoveActor,
- theActorFactory,
- _1));
-
- myActorFactory = theActorFactory;
-}
-
-void
-VISU_ActorBase
-::UpdateFromFactory()
-{
- if(myUpdateFromFactoryTime.GetMTime() < myActorFactory->GetMTime()){
- myUpdateFromFactoryTime.Modified();
- myActorFactory->UpdateActor(this);
- Update();
- }
-}
-
-//--------------------------------------------------------------------------
-
-void
-VISU_ActorBase
-::SetLineWidth(vtkFloatingPointType theLineWidth)
-{
- GetProperty()->SetLineWidth(theLineWidth);
-}
-
-vtkFloatingPointType
-VISU_ActorBase
-::GetLineWidth()
-{
- return GetProperty()->GetLineWidth();
-}
-
-//--------------------------------------------------------------------------
-void
-VISU_ActorBase
-::SetRepresentation(int theMode)
-{
- Superclass::SetRepresentation(theMode);
- if(myRepresentation == VTK_POINTS)
- UnShrink();
-}
-
-//----------------------------------------------------------------------------
-void VISU_ActorBase::SetShrink()
-{
- if(!myIsShrinkable)
- return;
- if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
- myShrinkFilter->SetInput(aDataSet);
- myPassFilter[1]->SetInput(myShrinkFilter->GetOutput());
- myIsShrunk = true;
- }
-}
-
-void VISU_ActorBase::UnShrink()
-{
- if(!myIsShrunk)
- return;
- if(vtkDataSet* aDataSet = myPassFilter[0]->GetOutput()){
- myPassFilter[1]->SetInput(aDataSet);
- myPassFilter[1]->Modified();
- myIsShrunk = false;
- Modified();
- }
-}
-
-bool VISU_ActorBase::IsShrunk()
-{
- return myIsShrunk;
-}
-
-void VISU_ActorBase::SetShrinkable(bool theIsShrinkable)
-{
- myIsShrinkable = theIsShrinkable;
-}
-
-bool VISU_ActorBase::IsShrunkable()
-{
- return myIsShrinkable;
-}
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File :
-// Author :
-// Module : VISU
-// $Header$
-
-#ifndef VISU_ACTOR_BASE_H
-#define VISU_ACTOR_BASE_H
-
-#include "SALOME_Actor.h"
-#include "VISU_BoostSignals.h"
-
-class VTKViewer_ShrinkFilter;
-
-#ifdef _WIN32
-#define VTKOCC_EXPORT __declspec (dllexport)
-#else
-#define VTKOCC_EXPORT VTK_EXPORT
-#endif
-
-
-//----------------------------------------------------------------------------
-namespace VISU
-{
- struct TActorFactory;
-}
-
-
-//! This class defines an abstaract interface to manage actors
-class VTKOCC_EXPORT VISU_ActorBase: public SALOME_Actor,
- public boost::signalslib::trackable
-{
- public:
- vtkTypeMacro(VISU_ActorBase, SALOME_Actor);
-
- //----------------------------------------------------------------------------
- VISU::TActorFactory* GetFactory();
- virtual void SetFactory(VISU::TActorFactory* theActorFactory);
-
- //----------------------------------------------------------------------------
- virtual void UpdateFromFactory();
-
- //----------------------------------------------------------------------------
-
- virtual void SetLineWidth(vtkFloatingPointType theLineWidth);
- virtual vtkFloatingPointType GetLineWidth();
-
- virtual void SetShrink();
- virtual void UnShrink();
- virtual bool IsShrunkable();
- virtual bool IsShrunk();
- virtual void SetShrinkable(bool theIsShrinkable);
-
- virtual void SetRepresentation(int theMode);
-
- protected:
- VISU_ActorBase();
- virtual ~VISU_ActorBase();
-
- VISU::TActorFactory* myActorFactory;
- vtkTimeStamp myUpdateFromFactoryTime;
- boost::signal1<void,VISU_ActorBase*> myDestroySignal;
-
- vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
-
- bool myIsShrinkable;
- bool myIsShrunk;
-};
-
-#endif //VISU_ACTOR_BASE_H
#include <vtkDataSetMapper.h>
#include <vtkObjectFactory.h>
+#include <vtkImplicitBoolean.h>
+#include <SALOME_ExtractGeometry.h>
+#include <SALOME_ExtractPolyDataGeometry.h>
+#include <vtkImplicitFunctionCollection.h>
+#include <vtkPlane.h>
#include <boost/bind.hpp>
//----------------------------------------------------------------------------
VISU_DataSetActor
::VISU_DataSetActor():
- myMapper(vtkDataSetMapper::New())
+ myMapper(vtkDataSetMapper::New()),
+ myExtractor(SALOME_ExtractGeometry::New()),
+ myPolyDataExtractor(SALOME_ExtractPolyDataGeometry::New()),
+ myFunction(vtkImplicitBoolean::New())
{
if(MYDEBUG) MESSAGE("VISU_DataSetActor::VISU_DataSetActor - this = "<<this);
+ myExtractor->SetImplicitFunction(myFunction);
+ myPolyDataExtractor->SetImplicitFunction(myFunction);
+ //myExtractor->ExtractBoundaryCellsOn();
+ //myPolyDataExtractor->ExtractBoundaryCellsOn();
+
+ myFunction->SetOperationTypeToIntersection();
+
myMapper->Delete();
+ myExtractor->Delete();
+ myPolyDataExtractor->Delete();
+ myFunction->Delete();
}
//----------------------------------------------------------------------------
if(VISU_UnstructuredGridPL* aPipeLine = dynamic_cast<VISU_UnstructuredGridPL*>(thePipeLine)){
vtkDataSetMapper* aTarget = GetDataSetMapper();
- vtkDataSetMapper* aSource = aPipeLine->GetDataSetMapper();
+ vtkDataSetMapper* aSource = aPipeLine->GetDataSetMapper();
VISU::CopyDataSetMapper(aTarget, aSource, true);
- aTarget->SetLookupTable(aSource->GetLookupTable());
}
}
VISU_DataSetActor
::SetMapperInput(vtkDataSet* theDataSet)
{
- myMapper->SetInput(theDataSet);
+ if (theDataSet->IsA("vtkPolyData")) {
+ myPolyDataExtractor->SetInput(theDataSet);
+ myMapper->SetInput(myPolyDataExtractor->GetOutput());
+ } else {
+ myExtractor->SetInput(theDataSet);
+ myMapper->SetInput(myExtractor->GetOutput());
+ }
+ // myMapper->SetInput(theDataSet);
SetMapper(myMapper.GetPointer());
}
//----------------------------------------------------------------------------
-vtkDataSetMapper*
-VISU_DataSetActor
-::GetDataSetMapper()
+vtkDataSetMapper* VISU_DataSetActor::GetDataSetMapper()
{
return myMapper.GetPointer();
}
+
+//----------------------------------------------------------------------------
+void VISU_DataSetActor::RemoveAllClippingPlanes()
+{
+ myFunction->GetFunction()->RemoveAllItems();
+ myFunction->Modified();
+}
+
+//----------------------------------------------------------------------------
+vtkIdType VISU_DataSetActor::GetNumberOfClippingPlanes()
+{
+ return myFunction->GetFunction()->GetNumberOfItems();
+}
+
+//----------------------------------------------------------------------------
+bool VISU_DataSetActor::AddClippingPlane(vtkPlane* thePlane)
+{
+ vtkImplicitFunctionCollection* aFunctions = GetClippingPlanes();
+ aFunctions->InitTraversal();
+ vtkImplicitFunction* aItem;
+ while ((aItem = aFunctions->GetNextItem())) {
+ if (thePlane == aItem)
+ return false;
+ }
+ myFunction->AddFunction(thePlane);
+ return true;
+}
+
+//----------------------------------------------------------------------------
+vtkPlane* VISU_DataSetActor::GetClippingPlane(vtkIdType theID)
+{
+ vtkPlane* aPlane = NULL;
+ if ((theID >= 0) && (theID < GetNumberOfClippingPlanes())) {
+ vtkImplicitFunctionCollection* aFunction = myFunction->GetFunction();
+ vtkImplicitFunction* aFun = NULL;
+ aFunction->InitTraversal();
+ for (vtkIdType i = 0; i <= theID; i++)
+ aFun = aFunction->GetNextItem();
+ aPlane = dynamic_cast<vtkPlane*>(aFun);
+ }
+ return aPlane;
+}
+
+//----------------------------------------------------------------------------
+vtkImplicitFunctionCollection* VISU_DataSetActor::GetClippingPlanes()
+{
+ return myFunction->GetFunction();
+}
#include "VISU_Actor.h"
class vtkDataSetMapper;
+class SALOME_ExtractGeometry;
+class SALOME_ExtractPolyDataGeometry;
+class vtkImplicitBoolean;
+class vtkImplicitFunctionCollection;
#ifdef _WIN_32
#define VTKOCC_EXPORT __declspec (dllexport)
vtkDataSetMapper*
GetDataSetMapper();
+ //----------------------------------------------------------------------------
+ virtual void RemoveAllClippingPlanes();
+
+ virtual vtkIdType GetNumberOfClippingPlanes();
+
+ virtual bool AddClippingPlane(vtkPlane* thePlane);
+
+ virtual vtkPlane* GetClippingPlane(vtkIdType theID);
+
+ virtual vtkImplicitFunctionCollection* GetClippingPlanes();
+
//----------------------------------------------------------------------------
protected:
VISU_DataSetActor();
//----------------------------------------------------------------------------
vtkSmartPointer<vtkDataSetMapper> myMapper;
+ vtkSmartPointer<SALOME_ExtractGeometry> myExtractor;
+ vtkSmartPointer<SALOME_ExtractPolyDataGeometry> myPolyDataExtractor;
+ vtkSmartPointer<vtkImplicitBoolean> myFunction;
};
#endif //VISU_DATASETACTOR_H
#include "VISU_GaussPointsPL.hxx"
#include "VISU_GaussPtsSettings.h"
#include "VISU_GaussPtsDeviceActor.h"
+#include "VISU_PickingSettings.h"
#include "VISU_WidgetCtrl.hxx"
#include "VISU_SphereWidget.hxx"
#include "VISU_OpenGLPointSpriteMapper.hxx"
#include "VISU_Event.h"
#include "SVTK_Actor.h"
+#include <SALOME_ExtractPolyDataGeometry.h>
#include <vtkCamera.h>
#include <vtkRenderer.h>
#include <vtkScalarBarWidget.h>
#include <vtkTextMapper.h>
#include <vtkTextProperty.h>
+#include <vtkImplicitBoolean.h>
+#include <vtkImplicitFunctionCollection.h>
+#include <vtkPlane.h>
#include <vtkPointData.h>
#include <vtkDataArray.h>
myWidgetCtrl(NULL),
myGaussPointsPL(NULL),
myLastPreHighlightObjID(-1),
- myTextActor(VISU_FramedTextActor::New()),
myCursorPyramid(VISU_CursorPyramid::New()),
myCursorPyramidSelected(VISU_CursorPyramid::New()),
myCellSource(vtkUnstructuredGrid::New()),
myCellActor(SVTK_Actor::New()),
myScalarBarCtrl(VISU_ScalarBarCtrl::New()),
myBarVisibility(true),
- myPickingSettings(NULL),
myInsideCursorSettings(NULL),
myCurrentPL(NULL),
- myMapper(vtkPolyDataMapper::New())
+ myMapper(vtkPolyDataMapper::New()),
+ myPolyDataExtractor(SALOME_ExtractPolyDataGeometry::New()),
+ myFunction(vtkImplicitBoolean::New())
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::VISU_GaussPtsAct - this = "<<this);
myEventCallbackCommand->Delete();
myDeviceActor->Delete();
- myTextActor->Delete();
myCursorPyramid->Delete();
myCursorPyramid->SetPickable(0);
myDeviceActor->SetVisibility(true);
myDeviceActor->SetPickable(false);
- myTextActor->SetVisibility(false);
- myTextActor->SetPickable(false);
-
myCellSource->Allocate();
myCellActor->Initialize();
myCellActor->SetRepresentation(VTK_WIREFRAME);
myMapper->Delete();
aMatrix->Delete();
+
+ myPolyDataExtractor->SetImplicitFunction(myFunction);
+ //myPolyDataExtractor->ExtractBoundaryCellsOn();
+
+ myFunction->SetOperationTypeToIntersection();
+ myPolyDataExtractor->Delete();
+ myFunction->Delete();
+
+ if( VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get() )
+ aPickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent,
+ myEventCallbackCommand.GetPointer(),
+ myPriority);
}
VISU_GaussPtsAct
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::~VISU_GaussPtsAct - this = "<<this);
SetWidgetCtrl(NULL);
SetInteractor(NULL);
- SetPickingSettings(NULL);
SetInsideCursorSettings(NULL);
}
myDeviceActor->AddToRender(theRenderer);
- theRenderer->AddActor(myTextActor.GetPointer());
theRenderer->AddActor(myCellActor.GetPointer());
myCursorPyramid->AddToRender(theRenderer);
myDeviceActor->RemoveFromRender(theRenderer);
- theRenderer->RemoveActor(myTextActor.GetPointer());
theRenderer->RemoveActor(myCellActor.GetPointer());
myCursorPyramid->RemoveFromRender(theRenderer);
{
if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::SetMapperInput - this = "<<this);
+ myDeviceActor->SetExtractor(myPolyDataExtractor);
myDeviceActor->SetPipeLine(GetGaussPointsPL());
myCurrentPL = myDeviceActor->GetPipeLine();
//SetMapper(myCurrentPL->GetPointSpriteMapper());
+ // myPolyDataExtractor->SetInput(myCurrentPL->GetPickableDataSet());
+ //myMapper->SetInput(myPolyDataExtractor->GetOutput());
myMapper->SetInput(myCurrentPL->GetPickableDataSet());
SetMapper(myMapper.GetPointer());
}
::SetVisibility(int theMode)
{
Superclass::SetVisibility(theMode);
+ myDeviceActor->SetVisibility(GetVisibility()); // VSV
myScalarBarCtrl->SetVisibility(theMode);
Highlight(isHighlighted());
}
bool anIsChanged = (mySelectionMode != aSelectionMode);
bool anIsPreselected = myIsPreselected;
myIsPreselected = false;
+
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
if(aSelectionMode == GaussPointSelection && theIsHighlight){
myPointPicker->Pick(theSelectionEvent->myX,
vtkDataSet* aDataSet = GetInput();
vtkPointData* aPointData = aDataSet->GetPointData();
if(vtkDataArray *aScalarArray = aPointData->GetScalars()){
- if ( myPickingSettings ){
- vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
- aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
- //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
- vtkFloatingPointType aColor[3];
- theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
- aColor[0] = 1. - aColor[0];
- aColor[1] = 1. - aColor[1];
- aColor[2] = 1. - aColor[2];
-
- myCursorPyramid->Init(aPyramidHeight,
- myPickingSettings->GetCursorSize(),
- GetRadius(anObjId,aVtkId,aScalarArray),
- GetMagnification(anObjId),
- GetClamp(anObjId),
- aLocalNodeCoord,
- aColor);
- }
-
+ vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight();
+ aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
+ //vtkFloatingPointType aColor[3] = myPreHighlightActor->GetProperty()->GetColor();
+ vtkFloatingPointType aColor[3];
+ theInteractorStyle->GetCurrentRenderer()->GetBackground( aColor );
+ aColor[0] = 1. - aColor[0];
+ aColor[1] = 1. - aColor[1];
+ aColor[2] = 1. - aColor[2];
+
+ myCursorPyramid->Init(aPyramidHeight,
+ aPickingSettings->GetCursorSize(),
+ GetRadius(anObjId,aVtkId,aScalarArray),
+ GetMagnification(anObjId),
+ GetClamp(anObjId),
+ aNodeCoord,
+ aColor);
}
this->Transform->Pop();
myLastPreHighlightObjID = anObjId;
if ( !GetPickable() )
return false;
- // int anInitialHasIndex = myIsHighlighted && mySelectionMode == GaussPointSelection;
+ // int anInitialHasIndex = myIsSubElementsHighlighted && mySelectionMode == GaussPointSelection;
Handle(SALOME_InteractiveObject) anIO = getIO();
- // myIsHighlighted = false;
+ // myIsSubElementsHighlighted = false;
Selection_Mode aSelectionMode = theSelectionEvent->mySelectionMode;
if(!mySelector.GetPointer())
return;
- if ( !myPickingSettings )
- {
- Superclass::Highlight(theIsHighlight);
- return;
- }
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
Selection_Mode aSelectionMode = mySelector->SelectionMode();
- bool anInitialHasIndex = isHighlighted() && mySelectionMode == GaussPointSelection;
+ bool anInitialHasIndex = isSubElementsHighlighted() && mySelectionMode == GaussPointSelection;
TColStd_IndexedMapOfInteger aMapIndex;
mySelector->GetIndex( getIO(), aMapIndex );
bool aCurrentHasIndex = aMapIndex.Extent() == 1;
bool anIsVisible = GetVisibility() && aCurrentHasIndex && theIsHighlight;
+ bool aShowTextActor = aPickingSettings->GetInfoWindowEnabled();
+ bool aShowCellActor = aPickingSettings->GetDisplayParentMesh();
myOutlineActor->SetVisibility(false);
myCursorPyramid->SetVisibility(false);
- myTextActor->SetVisibility(false);
- myCellActor->SetVisibility(false);
- myCursorPyramidSelected->SetVisibility(false);
+ myTextActor->SetVisibility(anIsVisible && aShowTextActor);
+ myCellActor->SetVisibility(anIsVisible && aShowCellActor);
+ GetScalarBarCtrl()->SetIsMarked(anIsVisible);
+ myCursorPyramidSelected->SetVisibility(anIsVisible);
+ //GetScalarBarCtrl()->Update();
- if(!theIsHighlight)
- return;
+ myIsSubElementsHighlighted = aCurrentHasIndex;
+
+ // Zoom if necessary
+ if( GetVisibility() && aPickingSettings->GetCameraMovementEnabled() )
+ {
+ ChangeZoom(aPickingSettings,
+ GetRenderer(),
+ anInitialHasIndex,
+ aCurrentHasIndex);
+ }
if( aSelectionMode == ActorSelection ) {
- Superclass::highlight(theIsHighlight);
+ Superclass::Highlight(theIsHighlight);
return;
}
+ if(!theIsHighlight)
+ return;
+
if( aSelectionMode != GaussPointSelection )
return;
if ( !aCurrentHasIndex || !myBarVisibility )
return;
- myTextActor->SetVisibility(anIsVisible);
- myCellActor->SetVisibility(anIsVisible && myPickingSettings->GetDisplayParentMesh());
- GetScalarBarCtrl()->SetIsMarked(anIsVisible);
- myCursorPyramidSelected->SetVisibility(anIsVisible);
+ // myTextActor->SetVisibility(anIsVisible);
+ // myCellActor->SetVisibility(anIsVisible && myPickingSettings->GetDisplayParentMesh());
+ // GetScalarBarCtrl()->SetIsMarked(anIsVisible);
+ // myCursorPyramidSelected->SetVisibility(anIsVisible);
//GetScalarBarCtrl()->Update();
- myIsHighlighted = aCurrentHasIndex;
+// myIsHighlighted = aCurrentHasIndex;
// Zoom if necessary
- ChangeZoom(myPickingSettings,
- GetRenderer(),
- anInitialHasIndex,
- aCurrentHasIndex);
+// ChangeZoom(myPickingSettings,
+// GetRenderer(),
+// anInitialHasIndex,
+// aCurrentHasIndex);
// TColStd_IndexedMapOfInteger aMapIndex;
mySelector->GetIndex( getIO(), aMapIndex );
return;
// FlyTo
- vtkRenderWindowInteractor* anInteractor = myInteractor;
- vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
- int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
+ if( anIsVisible && aPickingSettings->GetCameraMovementEnabled() )
+ {
+ vtkRenderWindowInteractor* anInteractor = myInteractor;
+ vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
+ int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
- anInteractor->SetDolly(0.0);
- anInteractor->SetNumberOfFlyFrames(myPickingSettings->GetStepNumber());
- anInteractor->FlyTo(aRenderer, aLocalNodeCoord);
- aRenderer->ResetCameraClippingRange();
- anInteractor->SetDolly(aDollyWas);
- anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
- anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aLocalNodeCoord);
+ anInteractor->SetDolly(0.0);
+ anInteractor->SetNumberOfFlyFrames(aPickingSettings->GetStepNumber());
+ anInteractor->FlyTo(aRenderer, aNodeCoord);
+ aRenderer->ResetCameraClippingRange();
+ anInteractor->SetDolly(aDollyWas);
+ anInteractor->SetNumberOfFlyFrames(aNumberOfFlyFramesWas);
+ anInteractor->InvokeEvent(SVTK::ChangeRotationPoint, aNodeCoord);
+ }
//
std::ostringstream aStr;
// int anObjId = aMapIndex(1);
GetScalarBarCtrl()->SetMarkValue(aVal);
GetScalarBarCtrl()->Update();
//
- vtkFloatingPointType aPyramidHeight = myPickingSettings->GetPyramidHeight();
+ vtkFloatingPointType aPyramidHeight = aPickingSettings->GetPyramidHeight();
aPyramidHeight = aPyramidHeight*myGaussPointsPL->GetMaxPointSize();
myCursorPyramidSelected->Init(aPyramidHeight,
- myPickingSettings->GetCursorSize(),
+ aPickingSettings->GetCursorSize(),
GetRadius(anObjId,aVtkId,aScalarArray),
GetMagnification(anObjId),
GetClamp(anObjId),
//
// myTextActor
std::string aString = aStr.str();
- myTextActor->SetModePosition(myPickingSettings->GetInfoWindowPosition());
- myTextActor->SetTransparency(myPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
myTextActor->SetWorldPoint(aWorldCoord);
myTextActor->SetText(aString.c_str());
- myTextActor->SetVisibility(anIsVisible && theIsHighlight);
+ myTextActor->SetVisibility(anIsVisible && theIsHighlight && aShowTextActor);
//
// myCellActor
- if(myPickingSettings->GetDisplayParentMesh()){
- const VISU::PGaussPtsIDMapper& aGaussPtsIDMapper =
- myGaussPointsPL->GetGaussPtsIDMapper();
- VISU::TNamedIDMapper* aParent = aGaussPtsIDMapper->GetParent();
-
- myCellSource->Reset();
- myCellSource->Modified(); // a VTK bug
- vtkUnstructuredGrid* aDataSet = aParent->GetUnstructuredGridOutput();
- myCellSource->SetPoints(aDataSet->GetPoints());
-
- VISU::TGaussPointID aGaussPointID = aGaussPtsIDMapper->GetObjID(anObjId);
- vtkIdType aCellID = aGaussPointID.first;
- vtkCell* aCell = aParent->GetElemCell(aCellID);
- myCellSource->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
- myCellActor->SetVisibility(anIsVisible && theIsHighlight);
- myCellActor->SetRepresentation(VTK_WIREFRAME);
- }
- else
- myCellActor->SetVisibility(false);
- }
-}
-
-
-//----------------------------------------------------------------
-void
-VISU_GaussPtsAct
-::SetPickingSettings(VISU_PickingSettings* thePickingSettings)
-{
- if(myPickingSettings == thePickingSettings)
- return;
-
- if(myPickingSettings)
- myPickingSettings->RemoveObserver(myEventCallbackCommand.GetPointer());
-
- myPickingSettings = thePickingSettings;
-
- if(thePickingSettings)
- {
- thePickingSettings->AddObserver(VISU::UpdatePickingSettingsEvent,
- myEventCallbackCommand.GetPointer(),
- myPriority);
- this->UpdatePickingSettings();
+ const VISU::PGaussPtsIDMapper& aGaussPtsIDMapper = myGaussPointsPL->GetGaussPtsIDMapper();
+ VISU::TNamedIDMapper* aParent = aGaussPtsIDMapper->GetParent();
+ //
+ myCellSource->Reset();
+ myCellSource->Modified(); // a VTK bug
+ vtkUnstructuredGrid* aCellDataSet = aParent->GetUnstructuredGridOutput();
+ myCellSource->SetPoints(aCellDataSet->GetPoints());
+ //
+ VISU::TGaussPointID aGaussPointID = aGaussPtsIDMapper->GetObjID(anObjId);
+ vtkIdType aCellID = aGaussPointID.first;
+ vtkCell* aCell = aParent->GetElemCell(aCellID);
+ myCellSource->InsertNextCell(aCell->GetCellType(),aCell->GetPointIds());
+ myCellActor->SetVisibility(anIsVisible && theIsHighlight && aShowCellActor);
}
}
VISU_GaussPtsAct
::UpdatePickingSettings()
{
- if(!myPickingSettings)
+ //printf( "VISU_GaussPtsAct::UpdatePickingSettings()\n" );
+ VISU_PickingSettings* aPickingSettings = VISU_PickingSettings::Get();
+ if(!aPickingSettings)
return;
- myTextActor->SetModePosition(myPickingSettings->GetInfoWindowPosition());
- myTextActor->SetTransparency(myPickingSettings->GetInfoWindowTransparency());
+ myTextActor->SetModePosition(aPickingSettings->GetInfoWindowPosition());
+ myTextActor->SetTransparency(aPickingSettings->GetInfoWindowTransparency());
- vtkFloatingPointType aHeight = myGaussPointsPL->GetMaxPointSize()*myPickingSettings->GetPyramidHeight();
- vtkFloatingPointType aCursorSize = myPickingSettings->GetCursorSize();
+ vtkFloatingPointType aHeight = myGaussPointsPL->GetMaxPointSize()*aPickingSettings->GetPyramidHeight();
+ vtkFloatingPointType aCursorSize = aPickingSettings->GetCursorSize();
myCursorPyramid->SetPreferences(aHeight,aCursorSize);
myCursorPyramidSelected->SetPreferences(aHeight,aCursorSize);
- myHighlightActor->GetProperty()->SetColor( myPickingSettings->GetColor() );
- myPointPicker->SetTolerance( myPickingSettings->GetPointTolerance() );
+ myHighlightActor->GetProperty()->SetColor( aPickingSettings->GetColor() );
+ myPointPicker->SetTolerance( aPickingSettings->GetPointTolerance() );
Highlight(isHighlighted());
return aTime;
}
+void VISU_GaussPtsAct::RemoveAllClippingPlanes()
+{
+ myFunction->GetFunction()->RemoveAllItems();
+ myFunction->Modified();
+}
+
+vtkIdType VISU_GaussPtsAct::GetNumberOfClippingPlanes()
+{
+ return myFunction->GetFunction()->GetNumberOfItems();
+}
+
+bool VISU_GaussPtsAct::AddClippingPlane(vtkPlane* thePlane)
+{
+ vtkImplicitFunctionCollection* aFunctions = GetClippingPlanes();
+ aFunctions->InitTraversal();
+ vtkImplicitFunction* aItem;
+ while ((aItem = aFunctions->GetNextItem())) {
+ if (thePlane == aItem)
+ return false;
+ }
+ myFunction->AddFunction(thePlane);
+ return true;
+}
+
+vtkPlane* VISU_GaussPtsAct::GetClippingPlane(vtkIdType theID)
+{
+ vtkPlane* aPlane = NULL;
+ if ((theID >= 0) && (theID < GetNumberOfClippingPlanes())) {
+ vtkImplicitFunctionCollection* aFunction = myFunction->GetFunction();
+ vtkImplicitFunction* aFun = NULL;
+ aFunction->InitTraversal();
+ for (vtkIdType i = 0; i <= theID; i++)
+ aFun = aFunction->GetNextItem();
+ aPlane = dynamic_cast<vtkPlane*>(aFun);
+ }
+ return aPlane;
+}
+
+vtkImplicitFunctionCollection* VISU_GaussPtsAct::GetClippingPlanes()
+{
+ return myFunction->GetFunction();
+}
+
+
+
//==============================================================================
vtkStandardNewMacro(VISU_GaussPtsAct1);
{
Superclass::AddToRender(theRenderer);
- myInsideDeviceActor->AddToRender(theRenderer);
- myOutsideDeviceActor->AddToRender(theRenderer);
+ //myInsideDeviceActor->AddToRender(theRenderer);
+ //myOutsideDeviceActor->AddToRender(theRenderer);
}
void
VISU_GaussPtsAct1
::RemoveFromRender(vtkRenderer* theRenderer)
{
- myInsideDeviceActor->RemoveFromRender(theRenderer);
- myOutsideDeviceActor->RemoveFromRender(theRenderer);
+ //myInsideDeviceActor->RemoveFromRender(theRenderer);
+ //myOutsideDeviceActor->RemoveFromRender(theRenderer);
Superclass::RemoveFromRender(theRenderer);
}
Superclass::SetMapperInput(theDataSet);
- if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
- myInsideDeviceActor->SetPipeLine(aPipeLine);
- aPipeLine->Delete();
- }
+// if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
+// myInsideDeviceActor->SetPipeLine(aPipeLine);
+// aPipeLine->Delete();
+// }
- if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
- myOutsideDeviceActor->SetPipeLine(aPipeLine);
- aPipeLine->Delete();
+// if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
+// myOutsideDeviceActor->SetPipeLine(aPipeLine);
+// aPipeLine->Delete();
- aPipeLine->SetExtractBoundaryCells(true);
- aPipeLine->SetExtractInside(true);
- }
+// aPipeLine->SetExtractBoundaryCells(true);
+// aPipeLine->SetExtractInside(true);
+// }
}
bool aVisisbility = GetVisibility();
bool anIsSegementation = IsSegmentationEnabled();
- myDeviceActor->SetVisibility(aVisisbility && !anIsSegementation);
+ myDeviceActor->SetVisibility(aVisisbility/* && !anIsSegementation*/);
myInsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation);
myOutsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation);
aPipeline->SetImplicitFunction(anImplicitFunction); // To restore
aPipeline->SetExtractBoundaryCells(true);
- aPipeline->SetExtractInside(true);
+ //aPipeline->SetExtractInside(true);
aPipeline->SetMagnification( aMagnification );
aPipeline->SetPrimitiveType( myOutsideCursorSettings->GetPrimitiveType() );
case vtkCommand::EndInteractionEvent: {
bool aVisisbility = GetVisibility();
bool anIsSegementation = IsSegmentationEnabled();
- myDeviceActor->SetVisibility(aVisisbility && !anIsSegementation);
+ myDeviceActor->SetVisibility(aVisisbility/* && !anIsSegementation*/);
myInsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation);
myOutsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation);
break;
::SetMapperInput(vtkDataSet* theDataSet)
{
if(MYDEBUG2) MESSAGE("VISU_GaussPtsAct2::SetMapperInput - this = "<<this);
-
- if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
- myDeviceActor->SetPipeLine(aPipeLine);
- myCurrentPL = aPipeLine;
- aPipeLine->Delete();
-
- myMapper->SetInput(myCurrentPL->GetPickableDataSet());
- SetMapper(myMapper.GetPointer());
- }
+ Superclass::SetMapperInput(theDataSet);
+// if(VISU_GaussPointsPL* aPipeLine = CreatePipeLine(GetGaussPointsPL())){
+// myDeviceActor->SetPipeLine(aPipeLine);
+// myCurrentPL = aPipeLine;
+// aPipeLine->Delete();
+
+// myMapper->SetInput(myCurrentPL->GetPickableDataSet());
+// SetMapper(myMapper.GetPointer());
+// }
}
//----------------------------------------------------------------------------
class vtkCallbackCommand;
class VISU_ScalarBarCtrl;
-class VISU_PickingSettings;
class VISU_InsideCursorSettings;
class VISU_OutsideCursorSettings;
+class SALOME_ExtractPolyDataGeometry;
+class vtkImplicitBoolean;
//============================================================================
//! Base class for Gauss Points Actors.
UpdateInsideCursorSettings( PDeviceActor );
//----------------------------------------------------------------------------
- void
- SetPickingSettings(VISU_PickingSettings* thePickingSettings);
-
//! Apply the picking settings on the actor.
void
UpdatePickingSettings();
unsigned long int
GetMTime();
+ //----------------------------------------------------------------------------
+ virtual void RemoveAllClippingPlanes();
+
+ virtual vtkIdType GetNumberOfClippingPlanes();
+
+ virtual bool AddClippingPlane(vtkPlane* thePlane);
+
+ virtual vtkPlane* GetClippingPlane(vtkIdType theID);
+
+ virtual vtkImplicitFunctionCollection* GetClippingPlanes();
+
protected:
//----------------------------------------------------------------------------
VISU_GaussPtsAct();
vtkSmartPointer<VISU_GaussPointsPL> myGaussPointsPL;
vtkSmartPointer<vtkPolyDataMapper> myMapper;
+ vtkSmartPointer<SALOME_ExtractPolyDataGeometry> myPolyDataExtractor;
+ vtkSmartPointer<vtkImplicitBoolean> myFunction;
vtkIdType myLastPreHighlightObjID;
- vtkSmartPointer<VISU_FramedTextActor> myTextActor;
-
vtkSmartPointer<VISU_CursorPyramid> myCursorPyramid;
vtkSmartPointer<VISU_CursorPyramid> myCursorPyramidSelected;
vtkSmartPointer<VISU_ScalarBarCtrl> myScalarBarCtrl;
VISU_InsideCursorSettings* myInsideCursorSettings;
- VISU_PickingSettings* myPickingSettings;
};
#include "VTKViewer_Transform.h"
#include "VTKViewer_TransformFilter.h"
+#include <SALOME_ExtractPolyDataGeometry.h>
#include <vtkObjectFactory.h>
#include <vtkPolyData.h>
VISU_GaussDeviceActorBase
::VISU_GaussDeviceActorBase():
- myTransformFilter(VTKViewer_TransformFilter::New())
+ myTransformFilter(VTKViewer_TransformFilter::New()),
+ myPolyDataExtractor(0)
{
if(MYDEBUG) MESSAGE("VISU_GaussDeviceActorBase - "<<this);
myMapper = theMapper;
int anId = 0;
- myPassFilter[ anId ]->SetInput( aDataSet );
+ if (myPolyDataExtractor) {
+ myPolyDataExtractor->SetInput(aDataSet);
+ myPassFilter[ anId ]->SetInput( myPolyDataExtractor->GetOutput() );
+ } else {
+ myPassFilter[ anId ]->SetInput( aDataSet );
+ }
myPassFilter[ anId + 1 ]->SetInput( myPassFilter[ anId ]->GetOutput() );
-
+
anId++;
myTransformFilter->SetInput( myPassFilter[ anId ]->GetPolyDataOutput() );
myTextProperty->SetFontFamilyToArial();
//
myTextMapper=vtkTextMapper::New();
- myTextMapper->SetInput("some text");
+ myTextMapper->SetInput("");
myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
myTextActor=vtkActor2D::New();
myTextActor->SetMapper(myTextMapper);
class vtkPassThroughFilter;
class vtkImageData;
+class SALOME_ExtractPolyDataGeometry;
//============================================================================
virtual
unsigned long int
GetMemorySize();
+
+ //----------------------------------------------------------------------------
+ void SetExtractor(SALOME_ExtractPolyDataGeometry* theExtractor)
+ { myPolyDataExtractor = theExtractor; }
+
+ SALOME_ExtractPolyDataGeometry* GetExtractor() const
+ { return myPolyDataExtractor; }
protected:
//----------------------------------------------------------------------------
typedef vtkSmartPointer<vtkPassThroughFilter> PPassThroughFilter;
std::vector<PPassThroughFilter> myPassFilter;
+ SALOME_ExtractPolyDataGeometry* myPolyDataExtractor;
+
VISU_GaussDeviceActorBase();
~VISU_GaussDeviceActorBase();
#include <SUIT_ResourceMgr.h>
#include <SUIT_Session.h>
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+
#include <vtkObjectFactory.h>
#include <vtkImageData.h>
vtkStandardNewMacro( VISU_GaussPtsSettings );
vtkStandardNewMacro( VISU_InsideCursorSettings );
vtkStandardNewMacro( VISU_OutsideCursorSettings );
-vtkStandardNewMacro( VISU_PickingSettings );
//----------------------------------------------------------------
VISU_GaussPtsSettings::VISU_GaussPtsSettings()
VISU_OutsideCursorSettings::~VISU_OutsideCursorSettings()
{
}
-
-//----------------------------------------------------------------
-VISU_PickingSettings::VISU_PickingSettings()
-{
- float aCursorSize = 0.5;
- float aPyramidHeight = 10.0;
- float aPointTolerance = 0.1;
- QColor aColor = Qt::yellow;
- int anInfoWindowTransparency = 50;
- int anInfoWindowPosition = VISU_PickingSettings::BelowPoint;
- float aZoomFactor = 1.5;
- int aStepNumber = 10;
- bool aDisplayParentMesh = false;
-
- SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
-
- this->CursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize );
-
- this->PyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight );
-
- this->PointTolerance = aResourceMgr->doubleValue( "VISU", "picking_point_tolerance", aPointTolerance );
-
- aColor = aResourceMgr->colorValue( "VISU", "picking_selection_color", aColor );
- this->Color[0] = aColor.red() / 255.0;
- this->Color[1] = aColor.green() / 255.0;
- this->Color[2] = aColor.blue() / 255.0;
-
- this->InfoWindowTransparency = aResourceMgr->integerValue( "VISU", "picking_transparency", anInfoWindowTransparency ) / 100.0;
-
- this->InfoWindowPosition = aResourceMgr->integerValue( "VISU", "picking_position", anInfoWindowPosition );
-
- this->ZoomFactor = aResourceMgr->doubleValue( "VISU", "picking_zoom_factor", aZoomFactor );
-
- this->StepNumber = aResourceMgr->integerValue( "VISU", "picking_step_number", aStepNumber );
-
- this->DisplayParentMesh = aResourceMgr->booleanValue( "VISU", "picking_display_parent_mesh", aDisplayParentMesh );
-}
-
-VISU_PickingSettings::~VISU_PickingSettings()
-{
-}
const vtkIdType UpdateFromSettingsEvent = vtkCommand::UserEvent + 100;
const vtkIdType UpdateInsideSettingsEvent = vtkCommand::UserEvent + 101;
const vtkIdType UpdateOutsideSettingsEvent = vtkCommand::UserEvent + 102;
- const vtkIdType UpdatePickingSettingsEvent = vtkCommand::UserEvent + 103;
}
vtkFloatingPointType Color[3];
};
-
-//! Class of Picking settings.
-/*!
- * Contains information about the following parameters:
- * Cursor Pyramid height, Info Window transparency,
- * Info Window position, Zoom factor on first selected point,
- * Camera movement steps number and Display parent mesh.
- * Used by Gauss Points Actor.
- */
-class VTKOCC_EXPORT VISU_PickingSettings : public vtkObject
-{
- public:
- enum { BelowPoint = 0, TopLeftCorner };
-
- public:
- vtkTypeMacro( VISU_PickingSettings, vtkObject );
-
- VISU_PickingSettings();
- virtual ~VISU_PickingSettings();
-
- static
- VISU_PickingSettings*
- New();
-
- vtkSetMacro( PyramidHeight, vtkFloatingPointType );
- vtkGetMacro( PyramidHeight, vtkFloatingPointType );
-
- vtkSetMacro( CursorSize, vtkFloatingPointType );
- vtkGetMacro( CursorSize, vtkFloatingPointType );
-
- vtkSetVector3Macro( Color, vtkFloatingPointType );
- vtkGetVector3Macro( Color, vtkFloatingPointType );
-
- vtkSetMacro( PointTolerance, vtkFloatingPointType );
- vtkGetMacro( PointTolerance, vtkFloatingPointType );
-
- vtkSetMacro( InfoWindowTransparency, vtkFloatingPointType );
- vtkGetMacro( InfoWindowTransparency, vtkFloatingPointType );
-
- vtkSetMacro( InfoWindowPosition, int );
- vtkGetMacro( InfoWindowPosition, int );
-
- vtkSetMacro( ZoomFactor, vtkFloatingPointType );
- vtkGetMacro( ZoomFactor, vtkFloatingPointType );
-
- vtkSetMacro( StepNumber, int );
- vtkGetMacro( StepNumber, int );
-
- vtkSetMacro( DisplayParentMesh, bool );
- vtkGetMacro( DisplayParentMesh, bool );
-
-private:
- vtkFloatingPointType PyramidHeight;
- vtkFloatingPointType CursorSize;
- vtkFloatingPointType PointTolerance;
- vtkFloatingPointType Color[3];
- vtkFloatingPointType InfoWindowTransparency;
- int InfoWindowPosition;
- vtkFloatingPointType ZoomFactor;
- int StepNumber;
- bool DisplayParentMesh;
-};
-
-
#endif
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VISU_IsoSurfActor.cxx
-// Author : Vitaly Smetannikov
-// Module : VISU
-
-
-#include "VISU_IsoSurfActor.h"
-#include "VISU_PipeLine.hxx"
-#include "VISU_LabelPointsFilter.hxx"
-
-
-#include <vtkObjectFactory.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkPolyData.h>
-#include <vtkActor2D.h>
-//#include <vtkMaskPoints.h>
-#include <vtkLabeledDataMapper.h>
-#include <vtkProperty2D.h>
-#include <vtkRenderer.h>
-#include <vtkCellArray.h>
-#include <vtkPointData.h>
-
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VISU_IsoSurfActor);
-
-
-//----------------------------------------------------------------------------
-VISU_IsoSurfActor::VISU_IsoSurfActor():
- VISU_ScalarMapAct(),
- myIsLinesLabeled(true)
-{
- myLabelsDataSet = vtkPolyData::New();
-
-// myMaskPoints = vtkMaskPoints::New();
-// myMaskPoints->SetInput(myLabelsDataSet);
-// myMaskPoints->SetOnRatio(100);
-
- myMaskPoints = VISU_LabelPointsFilter::New();
- myMaskPoints->SetInput(myLabelsDataSet);
-
- myLabeledDataMapper = vtkLabeledDataMapper::New();
- myLabeledDataMapper->SetInput(myMaskPoints->GetOutput());
- //myLabeledDataMapper->SetLabelFormat("%e");
- myLabeledDataMapper->SetLabelModeToLabelScalars();
-
- myLabels = vtkActor2D::New();
- myLabels->SetMapper(myLabeledDataMapper);
- myLabels->GetProperty()->SetColor(1,1,1);
- myLabels->SetVisibility(myIsLinesLabeled);
-}
-
-
-//----------------------------------------------------------------------------
-VISU_IsoSurfActor::~VISU_IsoSurfActor()
-{
- myLabelsDataSet->Delete();
- myMaskPoints->Delete();
- myLabeledDataMapper->Delete();
- myLabels->Delete();
-}
-
-//----------------------------------------------------------------------------
-void VISU_IsoSurfActor::SetLinesLabeled(bool theIsLinesLabeled, int theNbLbl)
-{
- myIsLinesLabeled = theIsLinesLabeled;
- myMaskPoints->SetPointsNb(theNbLbl);
- Modified();
-}
-
-//----------------------------------------------------------------------------
-int VISU_IsoSurfActor::GetNbLabels() const
-{
- return myMaskPoints->GetPointsNb();
-}
-
-
-//----------------------------------------------------------------------------
-void VISU_IsoSurfActor::UpdateLabels()
-{
- if (myIsLinesLabeled) {
- vtkDataSet* aDataSet = GetPipeLine()->GetOutput();
- if (aDataSet != NULL) {
- unsigned long aTime = myLabelsDataSet->GetMTime();
- unsigned long anObjTime = GetMTime();
- if (aTime < anObjTime) {
- myLabelsDataSet->ShallowCopy(aDataSet);
- myLabelsDataSet->Modified();
- }
- }
- }
- myLabels->SetVisibility(myIsLinesLabeled);
-}
-
-
-//----------------------------------------------------------------------------
-void VISU_IsoSurfActor::AddToRender(vtkRenderer* theRenderer)
-{
- VISU_ScalarMapAct::AddToRender(theRenderer);
- theRenderer->AddActor2D(myLabels);
-}
-
-//----------------------------------------------------------------------------
-void VISU_IsoSurfActor::RemoveFromRender(vtkRenderer* theRenderer)
-{
- VISU_ScalarMapAct::RemoveFromRender(theRenderer);
- theRenderer->RemoveActor(myLabels);
-}
-
-//From vtkFollower
-int VISU_IsoSurfActor::RenderOpaqueGeometry(vtkViewport *vp)
-{
- UpdateLabels();
- return VISU_ScalarMapAct::RenderOpaqueGeometry(vp);
-}
-
-
-int VISU_IsoSurfActor::RenderTranslucentGeometry(vtkViewport *vp)
-{
- UpdateLabels();
- return VISU_ScalarMapAct::RenderTranslucentGeometry(vp);
-}
-
-void VISU_IsoSurfActor::SetVisibility(int theMode){
- VISU_ScalarMapAct::SetVisibility(theMode);
- if(GetVisibility())
- myLabels->VisibilityOn();
- else
- myLabels->VisibilityOff();
- Modified();
-}
-
-
-///!!!! For test purposes only
-// void VISU_IsoSurfActor::SetMapperInput(vtkDataSet* theDataSet)
-// {
-// VISU_ScalarMapAct::SetMapperInput(theDataSet);
-
-// vtkFeatureEdges* aFilter = vtkFeatureEdges::New();
-// aFilter->SetInput(VISU_ScalarMapAct::GetInput());
-// SetInput(aFilter->GetOutput());
-// }
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VISU_IsoSurfActor.h
-// Author : Vitaly Smetannikov
-// Module : VISU
-
-
-#ifndef VISU_VectorsAct_HeaderFile
-#define VISU_VectorsAct_HeaderFile
-
-#include "VISU_ScalarMapAct.h"
-
-class vtkActor2D;
-//class vtkMaskPoints;
-class vtkLabeledDataMapper;
-class vtkPolyData;
-class VISU_LabelPointsFilter;
-
-
-class VTKOCC_EXPORT VISU_IsoSurfActor : public VISU_ScalarMapAct
-{
- public:
- vtkTypeMacro(VISU_IsoSurfActor, VISU_ScalarMapAct);
-
- static VISU_IsoSurfActor* New();
-
-
- //----------------------------------------------------------------------------
- virtual void AddToRender( vtkRenderer* );
-
- virtual void RemoveFromRender( vtkRenderer* );
-
- virtual int RenderOpaqueGeometry(vtkViewport *viewport);
- virtual int RenderTranslucentGeometry(vtkViewport *viewport);
-
- //virtual void SetPipeLine(VISU_PipeLine* thePipeLine);
-
- void SetLinesLabeled(bool theIsLinesLabeled, int theNbLbl);
- bool GetLinesLabeled() const { return myIsLinesLabeled;}
-
- int GetNbLabels() const;
-
-
- //----------------------------------------------------------------------------
- //! Visibility management
- virtual void SetVisibility( int );
-
-
- protected:
-
- VISU_IsoSurfActor();
- ~VISU_IsoSurfActor();
-
- void UpdateLabels();
-
- vtkActor2D *myLabels;
- vtkLabeledDataMapper* myLabeledDataMapper;
- //vtkMaskPoints* myMaskPoints;
- VISU_LabelPointsFilter* myMaskPoints;
- vtkPolyData* myLabelsDataSet;
-
- bool myIsLinesLabeled;
- //int myNbLabels;
-};
-
-
-#endif
myEdgeActor->UnShrink();
}
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+ Superclass::SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+
+ mySurfaceActor->SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
+{
+ Superclass::SetFeatureEdgesAngle(theValue);
+
+ mySurfaceActor->SetFeatureEdgesAngle(theValue);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
+{
+ Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
+
+ mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
+}
+
+void
+VISU_MeshAct
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+ Superclass::SetFeatureEdgesColoring(theIsColoring);
+
+ mySurfaceActor->SetFeatureEdgesColoring(theIsColoring);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_MeshAct
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+ if(theIsFeatureEdgesEnabled && myRepresentation == VTK_POINTS)
+ return;
+
+ Superclass::SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+
+ mySurfaceActor->SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+}
//----------------------------------------------------------------------------
void
myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
myEdgeActor->RenderOpaqueGeometry(ren);
break;
+ case FeatureEdges :
+ mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ mySurfaceActor->RenderOpaqueGeometry(ren);
+ break;
}
return 1;
}
myEdgeActor->SetAllocatedRenderTime(this->AllocatedRenderTime/2.0,ren);
myEdgeActor->RenderTranslucentGeometry(ren);
break;
+ case FeatureEdges :
+ mySurfaceActor->SetAllocatedRenderTime(this->AllocatedRenderTime,ren);
+ mySurfaceActor->RenderTranslucentGeometry(ren);
+ break;
}
return 1;
}
void
UnShrink();
+ virtual
+ void
+ SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+ virtual
+ void
+ SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
+
+ virtual
+ void
+ SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0);
+
+ virtual
+ void
+ SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
+
+ virtual
+ void
+ SetFeatureEdgesColoring(bool theIsColoring);
+
//! Gets memory size used by the instance (bytes).
virtual
unsigned long int
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File :
-// Author :
-// Module : VISU
-// $Header$
-
-#include "VISU_PointMap3dActor.h"
-#include "VISU_PipeLine.hxx"
-#include "VISU_ScalarBarActor.hxx"
-#include "VISU_DeformedGridPL.hxx"
-
-#include <SALOME_InteractiveObject.hxx>
-
-#include "utilities.h"
-#include <vtkRenderer.h>
-#include <vtkObjectFactory.h>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-vtkStandardNewMacro(VISU_PointMap3dActor);
-
-//==================================================================
-// function: Constructor
-// purpose :
-//==================================================================
-
-VISU_PointMap3dActor
-::VISU_PointMap3dActor()
-{
- if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::VISU_PointMap3dActor - this = "<<this);
- myScalarBar = VISU_ScalarBarActor::New();
-}
-
-//==================================================================
-// function: Destructor
-// purpose :
-//==================================================================
-
-VISU_PointMap3dActor
-::~VISU_PointMap3dActor()
-{
- if(MYDEBUG) MESSAGE("VISU_PointMap3dActor::~VISU_PointMap3dActor - this = "<<this);
- myScalarBar->Delete();
-}
-
-//==================================================================
-// function: AddToRender
-// purpose :
-//==================================================================
-void
-VISU_PointMap3dActor
-::AddToRender(vtkRenderer* theRenderer)
-{
- Superclass::AddToRender(theRenderer);
- theRenderer->AddActor2D(myScalarBar);
-}
-
-void
-VISU_PointMap3dActor
-::RemoveFromRender(vtkRenderer* theRenderer)
-{
- if(myScalarBar)
- theRenderer->RemoveActor(myScalarBar);
-
- Superclass::RemoveFromRender(theRenderer);
-}
-
-//==================================================================
-// function: Set & Get PipeLine
-// purpose :
-//==================================================================
-void
-VISU_PointMap3dActor
-::SetPipeLine(VISU_DeformedGridPL* thePipeLine)
-{
- myPipeLine = thePipeLine;
- SetMapper(thePipeLine->GetMapper());
- myScalarBar->SetLookupTable(thePipeLine->GetBarTable());
-}
-
-VISU_DeformedGridPL*
-VISU_PointMap3dActor
-::GetPipeLine()
-{
- return myPipeLine.GetPointer();
-}
-
-//==================================================================
-// function: Visibility
-// purpose :
-//==================================================================
-
-void
-VISU_PointMap3dActor
-::SetVisibility(int theMode)
-{
- Superclass::SetVisibility( theMode );
-
- // myPointsActor->SetVisibility( theMode );
-
- if(myScalarBar)
- myScalarBar->SetVisibility(theMode);
-}
-
-VISU_ScalarBarActor*
-VISU_PointMap3dActor
-::GetScalarBar()
-{
- return myScalarBar;
-}
-
-//==================================================================
-// function: SetIO
-// purpose :
-//==================================================================
-
-void
-VISU_PointMap3dActor
-::setIO(const Handle(SALOME_InteractiveObject)& theIO)
-{
- Superclass::setIO(theIO);
- myName = theIO->getName();
-}
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VISU_PointMap3dActor.h
-// Author : Dmitry MATVEICHEV with help of Alexey PETROV
-// Module : VISU
-// $Header$
-
-#ifndef VISU_PointMap3dActor_HeaderFile
-#define VISU_PointMap3dActor_HeaderFile
-
-#include "SALOME_Actor.h"
-#include "VISU_DataSetActor.h"
-#include "VISU_BoostSignals.h"
-
-class VISU_ScalarBarActor;
-
-#ifdef _WIN32
-#define VTKOCC_EXPORT __declspec (dllexport)
-#else
-#define VTKOCC_EXPORT VTK_EXPORT
-#endif
-
-class VISU_DeformedGridPL;
-
-class VTKOCC_EXPORT VISU_PointMap3dActor : public VISU_ActorBase
-{
- public:
- vtkTypeMacro(VISU_PointMap3dActor,SALOME_Actor);
-
- static
- VISU_PointMap3dActor*
- New();
-
- ~VISU_PointMap3dActor();
-
-//----------------------------------------------------------------------------
- virtual
- void
- AddToRender( vtkRenderer* );
-
- virtual
- void
- RemoveFromRender( vtkRenderer* );
-
- virtual
- void
- SetVisibility(int theMode);
-
- virtual
- VISU_ScalarBarActor*
- GetScalarBar();
-
-//----------------------------------------------------------------------------
- virtual
- void
- setIO(const Handle(SALOME_InteractiveObject)& theIO);
-
-//----------------------------------------------------------------------------
- virtual
- VISU_DeformedGridPL*
- GetPipeLine();
-
- virtual
- void
- SetPipeLine(VISU_DeformedGridPL* thePipeLine);
-
- protected:
- VISU_PointMap3dActor();
- vtkSmartPointer<VISU_DeformedGridPL> myPipeLine;
-
- VISU_ScalarBarActor* myScalarBar;
-};
-
-#endif
#include "VISU_DeformedShapePL.hxx"
#include "VISU_PipeLineUtils.hxx"
+#include <SALOME_ExtractGeometry.h>
+#include <SALOME_ExtractPolyDataGeometry.h>
+
#include <vtkObjectFactory.h>
#include <vtkRenderer.h>
#include <vtkProperty.h>
VISU_ScalarMapAct
::ShallowCopyPL(VISU_PipeLine* thePipeLine)
{
- VISU_Actor::ShallowCopyPL( thePipeLine );
+ VISU_DataSetActor::ShallowCopyPL( thePipeLine );
myEdgeActor->GetMapper()->ScalarVisibilityOff();
{
Superclass::SetMapperInput( theDataSet );
- myPointsActor->SetInput( theDataSet );
+// myPointsActor->SetInput( theDataSet );
+// mySurfaceActor->SetInput( theDataSet );
+// myEdgeActor->SetInput( theDataSet );
- mySurfaceActor->SetInput( theDataSet );
- myEdgeActor->SetInput( theDataSet );
+ if (theDataSet->IsA("vtkPolyData")) {
+ myPointsActor->SetInput( myPolyDataExtractor->GetOutput() );
+ mySurfaceActor->SetInput( myPolyDataExtractor->GetOutput() );
+ myEdgeActor->SetInput( myPolyDataExtractor->GetOutput() );
+ } else {
+ myPointsActor->SetInput( myExtractor->GetOutput() );
+ mySurfaceActor->SetInput( myExtractor->GetOutput() );
+ myEdgeActor->SetInput( myExtractor->GetOutput() );
+ }
}
//----------------------------------------------------------------------------
mySurfaceActor->UnShrink();
}
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+ Superclass::SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+
+ mySurfaceActor->SetFeatureEdgesAllowed(theIsFeatureEdgesAllowed);
+}
+
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesAngle(vtkFloatingPointType theValue)
+{
+ Superclass::SetFeatureEdgesAngle(theValue);
+
+ mySurfaceActor->SetFeatureEdgesAngle(theValue);
+}
+
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges)
+{
+ Superclass::SetFeatureEdgesFlags(theIsFeatureEdges,
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
+
+ mySurfaceActor->SetFeatureEdgesFlags(theIsFeatureEdges,
+ theIsBoundaryEdges,
+ theIsManifoldEdges,
+ theIsNonManifoldEdges);
+}
+
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesColoring(bool theIsColoring)
+{
+ Superclass::SetFeatureEdgesColoring(theIsColoring);
+
+ mySurfaceActor->SetFeatureEdgesColoring(theIsColoring);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapAct
+::SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled)
+{
+ if(theIsFeatureEdgesEnabled && myRepresentation == VTK_POINTS)
+ return;
+
+ Superclass::SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+
+ mySurfaceActor->SetFeatureEdgesEnabled(theIsFeatureEdgesEnabled);
+}
+
//----------------------------------------------------------------------------
void
VISU_ScalarMapAct
void
UnShrink();
+ virtual
+ void
+ SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
+ virtual
+ void
+ SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
+
+ virtual
+ void
+ SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0);
+
+ virtual
+ void
+ SetFeatureEdgesFlags(bool theIsFeatureEdges,
+ bool theIsBoundaryEdges,
+ bool theIsManifoldEdges,
+ bool theIsNonManifoldEdges);
+
+ virtual
+ void
+ SetFeatureEdgesColoring(bool theIsColoring);
+
virtual
void
SetOpacity(vtkFloatingPointType theValue);
#include <vtkPolyDataMapper.h>
#include <vtkPolyData.h>
#include <vtkPassThroughFilter.h>
+#include <VISU_UsedPointsFilter.hxx>
+#include <vtkUnstructuredGrid.h>
+#include <VISU_MergeFilter.hxx>
//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_VectorsAct);
return aSize;
}
+
+//----------------------------------------------------------------------------
+vtkDataSet*
+VISU_VectorsAct
+::GetValLabelsInput()
+{
+ VISU_VectorsPL* aPL = dynamic_cast<VISU_VectorsPL*>( GetPipeLine() );
+ if ( aPL )
+ {
+ return aPL->GetMergedInput();
+ /*VISU_UsedPointsFilter* aFilter = aPL->GetUsedPointsFilter();
+ vtkSmartPointer< VISU_MergeFilter > aFilter = aPL->myMergeFilter;
+ if ( aFilter )
+ {
+ aFilter->Update();
+ return aFilter->GetOutput();
+ }*/
+ }
+
+ return Superclass::GetValLabelsInput();
+}
virtual
unsigned long int
GetMemorySize();
+
+ virtual
+ vtkDataSet*
+ GetValLabelsInput();
protected:
VISU_VectorsAct();
VISU_ElnoDisassembleFilter.hxx \
VISU_ElnoAssembleFilter.hxx \
VISU_DeformationPL.hxx \
- VISU_OptionalDeformationPL.hxx
+ VISU_OptionalDeformationPL.hxx \
+ VISU_XYPlotActor.hxx
dist_libVisuPipeLine_la_SOURCES= \
VISU_MapperHolder.cxx \
VISU_ElnoDisassembleFilter.cxx \
VISU_ElnoAssembleFilter.cxx \
VISU_DeformationPL.cxx \
- VISU_OptionalDeformationPL.cxx
+ VISU_OptionalDeformationPL.cxx\
+ VISU_XYPlotActor.cxx
libVisuPipeLine_la_CPPFLAGS= \
$(VTK_INCLUDES) \
#ifndef SALOME_ExtractGeometry_H
#define SALOME_ExtractGeometry_H
+#include "VISUPipeline.hxx"
+
#include <vtkExtractGeometry.h>
#include <vtkSmartPointer.h>
class vtkImplicitBoolean;
-class SALOME_ExtractGeometry : public vtkExtractGeometry
+class VISU_PIPELINE_EXPORT SALOME_ExtractGeometry : public vtkExtractGeometry
{
public:
vtkTypeMacro(SALOME_ExtractGeometry, vtkExtractGeometry);
#ifndef SALOME_ExtractPolyDataGeometry_H
#define SALOME_ExtractPolyDataGeometry_H
+#include "VISUPipeline.hxx"
+
#include <vtkExtractPolyDataGeometry.h>
#include <vtkSmartPointer.h>
class vtkImplicitBoolean;
-class SALOME_ExtractPolyDataGeometry : public vtkExtractPolyDataGeometry
+class VISU_PIPELINE_EXPORT SALOME_ExtractPolyDataGeometry : public vtkExtractPolyDataGeometry
{
public:
vtkTypeMacro(SALOME_ExtractPolyDataGeometry, vtkExtractPolyDataGeometry);
#include "VISU_IsoSurfacesPL.hxx"
#include "VISU_CutPlanesPL.hxx"
#include "VISU_CutLinesPL.hxx"
+#include "VISU_ColoredPL.hxx"
#include "VISU_DeformedShapePL.hxx"
#include "VISU_VectorsPL.hxx"
#include "VISU_StreamLinesPL.hxx"
#include "VISU_ElnoDisassembleFilter.hxx"
#include "VISU_ElnoAssembleFilter.hxx"
-typedef VISU_ScalarMapPL TPresent;
+//typedef VISU_CutPlanesPL TPresent;
+//typedef VISU_ScalarMapPL TPresent;
+typedef VISU_CutLinesPL TPresent;
// VTK includes
#include <vtkShrinkFilter.h>
#include <vtk3DWidget.h>
#include <vtkProperty.h>
+//RKV:Begin
+#include <vtkLookupTable.h>
+#include <vtkIntArray.h>
+#include <vtkPointData.h>
+#include <vtkCellData.h>
+#include <vtkPointSet.h>
+#include <vtkPolyData.h>
+#include <vtkXYPlotActor.h>
+#include <vtkProperty2D.h>
+#include <vtkTextProperty.h>
+
+#include <vtkXYPlotWidget.h>
+#include <vtkScalarBarWidget.h>
+#include <vtkScalarBarActor.h>
+#include <vtkMatrix4x4.h>
+
+/*#include <vtkBarChartActor.h>
+#include <vtkFloatArray.h>
+#include <vtkDataObject.h>
+#include <vtkFieldData.h>
+#include <vtkMath.h>
+#include <vtkTextProperty.h>
+#include <vtkPolyData.h>
+#include <vtkPoints.h>
+#include <vtkIdList.h>
+#include <vtkProperty2D.h>
+#include <vtkLegendBoxActor.h>
+#include <vtkTestUtilities.h>
+#include <vtkRegressionTestImage.h>
+*/
+//RKV:End
+
#include "utilities.h"
+static int isOnlyMesh = false;
+
void PrintMissing(){
MESSAGE(std::endl << "VISUPipeLine : missing operand after `VISUPipeLine'" <<
std::endl << "VISUPipeLine : Try `VISUPipeLine -h' for more information.");
void PrintErr(){
MESSAGE("***************************ERROR*****************************************");
}
+//#define _DEBUG_ID_MAPPING_
+
+//RKV:Begin
+/*
+vtkActor* barChartActor()
+{
+ int numTuples = 6;
+
+ vtkFloatArray *bitter = vtkFloatArray::New();
+ bitter->SetNumberOfTuples(numTuples);
+
+ for (int i=0; i<numTuples; i++)
+ {
+ bitter->SetTuple1(i, vtkMath::Random(7,100));
+ }
+
+ vtkDataObject *dobj = vtkDataObject::New();
+ dobj->GetFieldData()->AddArray(bitter);
+
+ vtkBarChartActor *actor = vtkBarChartActor::New();
+ actor->SetInput(dobj);
+ actor->SetTitle("Bar Chart");
+ actor->GetPositionCoordinate()->SetValue(0.05,0.05,0.0);
+ actor->GetPosition2Coordinate()->SetValue(0.95,0.85,0.0);
+ actor->GetProperty()->SetColor(1,1,1);
+ actor->GetLegendActor()->SetNumberOfEntries(numTuples);
+ for (int i=0; i<numTuples; i++)
+ {
+ double red=vtkMath::Random(0,1);
+ double green=vtkMath::Random(0,1);
+ double blue=vtkMath::Random(0,1);
+ actor->SetBarColor(i,red,green,blue);
+ }
+ actor->SetBarLabel(0,"oil");
+ actor->SetBarLabel(1,"gas");
+ actor->SetBarLabel(2,"water");
+ actor->SetBarLabel(3,"snake oil");
+ actor->SetBarLabel(4,"tequila");
+ actor->SetBarLabel(5,"beer");
+ actor->LegendVisibilityOn();
+
+ // Set text colors (same as actor for backward compat with test)
+ actor->GetTitleTextProperty()->SetColor(1,1,0);
+ actor->GetLabelTextProperty()->SetColor(1,0,0);
+ return actor;
+}
+*/
+//RKV:End
+//----------------------------------------------------------------------------
+template<class TPipeLine>
+VISU_ColoredPL*
+CreateColoredPL(VISU_Convertor* theConvertor,
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber);
+
+
+//----------------------------------------------------------------------------
+template<>
+VISU_ColoredPL*
+CreateColoredPL<VISU_GaussPointsPL>(VISU_Convertor* theConvertor,
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
+{
+ VISU_GaussPointsPL* aPresent = VISU_GaussPointsPL::New();
+ VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
+ theConvertor->GetTimeStampOnGaussPts(theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ aPresent->SetGaussPtsIDMapper(aGaussPtsIDMapper);
+
+ char aMainTexture[80];
+ strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.bmp" );
+
+ char anAlphaTexture[80];
+ strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.bmp" );
+
+ vtkSmartPointer<vtkImageData> aTextureValue =
+ VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
+ aPresent->SetImageData( aTextureValue.GetPointer() );
+
+ aPresent->Update();
+
+#ifdef _DEBUG_ID_MAPPING_
+ vtkDataSet* aDataSet = aPresent->GetOutput();
+ aDataSet->Update();
+ int aNbCells = aDataSet->GetNumberOfCells();
+ cout<<"aNbCells = "<<aNbCells<<endl;
+ for(int anCellId = 0; anCellId < aNbCells; anCellId++){
+ vtkIdType anObjID = aPresent->GetNodeObjID(anCellId);
+ vtkIdType aVtkID = aPresent->GetNodeVTKID(anObjID);
+ cout<<anObjID<<"; "<<aVtkID<<"; - ";
+ vtkFloatingPointType* aCoord = aPresent->GetNodeCoord(anObjID);
+ cout<<aCoord[0]<<"; "<<aCoord[1]<<"; "<<aCoord[2]<<endl;
+ }
+#endif
+ return aPresent;
+}
+
+//----------------------------------------------------------------------------
+template<class TPipeLine>
+VISU_ColoredPL*
+CreateColoredPL(VISU_Convertor* theConvertor,
+ const std::string& theMeshName,
+ const VISU::TEntity& theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
+{
+ TPipeLine* aPresent = TPipeLine::New();
+ VISU::PUnstructuredGridIDMapper anUnstructuredGridIDMapper =
+ theConvertor->GetTimeStampOnMesh(theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ aPresent->SetUnstructuredGridIDMapper(anUnstructuredGridIDMapper);
+
+ vtkFloatingPointType aRange[] = { 4, 5 };
+cout << "before filter limits set" << endl;
+ vtkObject::GlobalWarningDisplayOn();
+ aPresent->DebugOn();
+ aPresent->SetScalarFilterRange( aRange );
+ aPresent->UseScalarFiltering( true );
+cout << "after filter set" << endl;
+
+ //aPresent->ClearGeometry();
+ //{
+ // VISU::PUnstructuredGridIDMapper anIDMapper =
+ // theConvertor->GetMeshOnGroup(theMeshName,
+ // "groupe1");
+ // aPresent->AddGeometry(anIDMapper->GetOutput());
+ //}
+ //{
+ // VISU::PUnstructuredGridIDMapper anIDMapper =
+ // theConvertor->GetMeshOnGroup(theMeshName,
+ // "TUBEH ");
+ // aPresent->AddGeometry(anIDMapper->GetOutput());
+ //}
+ //{
+ // VISU::PUnstructuredGridIDMapper anIDMapper =
+ // theConvertor->GetMeshOnGroup(theMeshName,
+ // "STRI ");
+ // aPresent->AddGeometry(anIDMapper->GetOutput());
+ //}
+ aPresent->Update();
+cout << "after update" << endl;
+ return aPresent;
+}
//----------------------------------------------------------------------------
const VISU::TMeshMap& aMeshMap = aConvertor->GetMeshMap();
VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
if(aMeshMapIter == aMeshMap.end()) return 0;
- //Iterate by meshes
- for (;aMeshMapIter != aMeshMap.end();aMeshMapIter++) {
-
- const std::string& theMeshName = aMeshMapIter->first;
- if( strcmp(aMeshName, theMeshName.c_str()) )
- continue;
- else
- isMeshOk = true;
-
- const VISU::PMesh aMesh = aMeshMapIter->second;
- const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
- VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
-
- aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
- //Iterate by meshes on entity
- for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) {
- const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
- const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
-
- const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
- VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
-
- //Iterate by field
- for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
- const VISU::PField aField = aFieldMapIter->second;
- const std::string& theFieldName = aFieldMapIter->first;
-
- if( strcmp(aFieldName, theFieldName.c_str()) )
- continue;
- else
- isFieldOk = true;
-
- if(aComponentNumber > aField->myNbComp)
- continue;
- else
- isComponentOk = true;
-
- const VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aValFieldIter = aValField.find(aTimeStampNumber);
- if(aValFieldIter == aValField.end())
- continue;
- else
- isTimeStampOk = true;
-
- int aTimeStamp = aValFieldIter->first;
-
- vtkActor* anActor = vtkActor::New();
-
- if(anEntity != VISU::NODE_ENTITY){
- VISU::PUnstructuredGridIDMapper anUnstructuredGridIDMapper =
- aConvertor->GetTimeStampOnMesh(theMeshName,
- anEntity,
- theFieldName,
- aTimeStamp);
-
- vtkUnstructuredGrid* anUnstructuredGrid = anUnstructuredGridIDMapper->GetUnstructuredGridOutput();
- VISU::WriteToFile( anUnstructuredGrid, "/data/apo/elno_from_id_mapper.vtk" );
-
- VISU_ElnoDisassembleFilter* aDisassembleFilter = VISU_ElnoDisassembleFilter::New();
- aDisassembleFilter->SetInput( anUnstructuredGrid );
- aDisassembleFilter->SetShrinkFactor( 0.999 );
- VISU::WriteToFile( aDisassembleFilter->GetOutput(), "/data/apo/elno_from_disassemble.vtk" );
-
- vtkCutter *aCutter = vtkCutter::New();
-
- vtkPointLocator* aPointLocator = vtkPointLocator::New();
- aCutter->SetLocator( aPointLocator );
- aPointLocator->Delete();
-
- TPresent* aPresent = TPresent::New();
- aPresent->SetUnstructuredGridIDMapper( anUnstructuredGridIDMapper );
- //aPresent->SetOrientation( VISU_CutPlanesPL::ZX, 0.0, 0.0, 0 );
- aPresent->Update();
-
- aPresent->GetMapper()->InterpolateScalarsBeforeMappingOn();
- anActor->SetMapper( aPresent->GetMapper() );
-
- vtkScalarBarActor* aScalarBar = vtkScalarBarActor::New();
- //aScalarBar->SetLookupTable( aMapperTable );
- aScalarBar->SetLookupTable( aPresent->GetBarTable() );
-
-
- vtkScalarBarWidget* aWidget = vtkScalarBarWidget::New();
- aWidget->SetScalarBarActor( aScalarBar );
- aWidget->SetInteractor( anInteractor );
- aWidget->SetEnabled( true );
-
- aRenderer->AddActor(anActor);
- aRenderer->AddActor2D(aScalarBar);
- }else{
- continue;
- }
-
- aWindow->Render();
- aRenderer->ResetCamera();
-
- anInteractor->Start();
- return 0;
- }
- }
+ const std::string& aMeshName = aMeshMapIter->first;
+ const VISU::PMesh aMesh = aMeshMapIter->second;
+ const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+ VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
+ if(isOnlyMesh){
+ const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
+ aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
+
+ VISU::PNamedIDMapper anIDMapper =
+ aConvertor->GetMeshOnEntity(aMeshName,anEntity);
+
+ VISU_MeshPL* aPresent = VISU_MeshPL::New();
+ aPresent->SetUnstructuredGridIDMapper(anIDMapper);
+
+ vtkActor* aActor = vtkActor::New();
+ aActor->SetMapper(aPresent->GetMapper());
+ aActor->GetProperty()->SetRepresentation(VTK_WIREFRAME);
+ //aRenderer->ResetCameraClippingRange();
+
+ aRenderer->AddActor(aActor);
+
+ aWindow->Render();
+ anInteractor->Start();
+ return 0;
+ }
+ //Import fields
+ aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+ for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++) {
+ const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
+ const VISU::PMeshOnEntity aMeshOnEntity = aMeshOnEntityMapIter->second;
+ const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+ VISU::TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+ for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++){
+ const VISU::PField aField = aFieldMapIter->second;
+// if(aField->myNbComp == 1)
+// continue;
+ const std::string& aFieldName = aFieldMapIter->first;
+ const VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_reverse_iterator aValFieldIter = aValField.rbegin();
+ if(aValFieldIter == aValField.rend()) return 0;
+ int aTimeStamp = aValFieldIter->first;
+
+ vtkActor* anActor = vtkActor::New();
+ VISU_ColoredPL* aPresent = NULL;
+ if(anEntity == VISU::NODE_ENTITY){
+ aPresent = CreateColoredPL<TPresent>(aConvertor,
+ aMeshName,
+ anEntity,
+ aFieldName,
+ aTimeStamp);
+
+ anActor->SetMapper(aPresent->GetMapper());
+ }else{
+ continue;
+ aPresent = CreateColoredPL<TPresent>(aConvertor,
+ aMeshName,
+ anEntity,
+ aFieldName,
+ aTimeStamp);
+
+ VTKViewer_GeometryFilter* aGeometryFilter = VTKViewer_GeometryFilter::New();
+ aGeometryFilter->SetInput(aPresent->GetOutput());
+ aGeometryFilter->SetInside(true);
+
+ vtkMaskPoints* aMaskPoints = vtkMaskPoints::New();
+ aMaskPoints->SetInput(aGeometryFilter->GetOutput());
+ aMaskPoints->SetGenerateVertices(true);
+ aMaskPoints->SetOnRatio(1);
+
+ VISU_OpenGLPointSpriteMapper* aMapper = VISU_OpenGLPointSpriteMapper::New();
+ aMapper->SetAverageCellSize( VISU_DeformedShapePL::GetScaleFactor( aPresent->GetOutput() ) );
+
+ char aMainTexture[80];
+ strcpy( aMainTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( aMainTexture, "/share/salome/resources/visu/sprite_texture.vti" );
+
+ char anAlphaTexture[80];
+ strcpy( anAlphaTexture, getenv( "VISU_ROOT_DIR" ) );
+ strcat( anAlphaTexture, "/share/salome/resources/visu/sprite_alpha.vti" );
+
+ vtkSmartPointer<vtkImageData> aTextureValue =
+ VISU_GaussPointsPL::MakeTexture( aMainTexture, anAlphaTexture );
+ aMapper->SetImageData( aTextureValue.GetPointer() );
+
+ //vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
+ aMapper->SetLookupTable(aPresent->GetMapperTable());
+ aMapper->SetUseLookupTableScalarRange(true);
+ aMapper->SetColorModeToMapScalars();
+ aMapper->SetScalarVisibility(true);
+
+ aMapper->SetInput(aMaskPoints->GetOutput());
+ aGeometryFilter->Delete();
+
+ anActor->SetMapper(aMapper);
+ aMapper->Delete();
+ }
+
+
+
+
+
+//RKV:Begin
+ vtkLookupTable* lut = vtkLookupTable::New();
+ int nbColors = aPresent->GetNbColors();
+ lut->SetNumberOfTableValues(nbColors);
+ vtkDataArray* dataArr;
+ if(VISU::IsDataOnCells(aPresent->GetInput())) {
+ dataArr = aPresent->GetInput()->GetCellData()->GetScalars();
+ } else {
+ dataArr = aPresent->GetInput()->GetPointData()->GetScalars();
+ }
+ vtkFloatingPointType aRange[2];
+ dataArr->GetRange(aRange);
+ MSG(true, "Range[0]: "<<aRange[0]);
+ MSG(true, "Range[1]: "<<aRange[1]);
+
+ lut->SetTableRange(aRange);
+ lut->Build();
+ MSG(true, "1\n");
+ vtkIntArray* distr = vtkIntArray::New();
+ distr->SetNumberOfValues(nbColors);
+ MSG(true, "Number of colors: "<<nbColors);
+ distr->FillComponent(0, 0.);
+ MSG(true, "2\n");
+ int aNbVals = dataArr->GetNumberOfTuples();
+ int idx = 0, cnt = 0;
+
+ MSG(true, "3\n");
+ for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
+// MSG(true, "Value: "<< *(dataArr->GetTuple(aValId)));
+ idx = lut->GetIndex(*(dataArr->GetTuple(aValId)));
+// MSG(true, "Value index "<<idx);
+ cnt = distr->GetValue(idx);
+ distr->SetValue(idx, cnt + 1);
+ }
+ MSG(true, "4\n");
+ distr->Modified();
+ double range[2];
+ distr->GetRange(range);
+ MSG(true, "DistrRange[0]: " << range[0]);
+ MSG(true, "DistrRange[1]: " << range[1]);
+ MSG(true, "5\n");
+// vtkPoints* points = vtkPoints::New();
+// aNbVals = distr->GetNumberOfTuples();
+// points->Allocate(aNbVals);
+// double x[3] = {0., 0., 0.};
+/* for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
+ x[0] = aValId;
+ points->InsertPoint(aValId, x);
+*/// MSG(true, "Inserted point "<<aValId);
+// MSG(true, ": "<<distr->GetValue(aValId));
+// }
+// points->SetData(distr);
+
+/* vtkPointSet* pset = vtkPolyData::New();
+ pset->SetPoints(points);
+ pset->GetPointData()->SetScalars(distr);
+*/
+ vtkDataObject *dobj = vtkDataObject::New();
+ dobj->GetFieldData()->AddArray(distr);
+
+ vtkXYPlotActor* xyplot = vtkXYPlotActor::New();
+// xyplot->AddInput(pset);
+ xyplot->AddDataObjectInput(dobj);
+ xyplot->GetPositionCoordinate()->SetValue(0.0, 0.67, 0);
+ xyplot->GetPosition2Coordinate()->SetValue(1.0, 0.33, 0); // #relative to Position
+ xyplot->SetXValuesToIndex();
+// xyplot->SetXValuesToNormalizedArcLength();
+// xyplot->SetXValuesToArcLength();
+// xyplot->SetNumberOfXLabels(0);
+ xyplot->SetTitle("");
+ xyplot->SetXTitle("");
+ xyplot->SetYTitle("Distribution");
+// xyplot->ReverseYAxisOn();
+// xyplot->SetDataObjectPlotModeToRows();
+ xyplot->SetLabelFormat("%.0f");
+ xyplot->SetXRange(0, nbColors-1);
+ xyplot->SetYRange(range[0], range[1]);
+/* int ny = floor(fabs(range[1] - range[0]));
+ MSG(true, "ny = "<<ny);
+ MSG(true, "nbYLabels = "<<xyplot->GetNumberOfYLabels());
+ if (ny < xyplot->GetNumberOfYLabels()) {
+ MSG(true, "5.1");
+ xyplot->SetNumberOfYLabels(ny);
+ MSG(true, "nbYLabels = "<<xyplot->GetNumberOfYLabels());
+ }
+*/ xyplot->GetProperty()->SetColor(1, 1, 1);
+ xyplot->GetProperty()->SetLineWidth(2);
+ xyplot->GetProperty()->SetDisplayLocationToForeground();
+/* vtkMatrix4x4 *m = vtkMatrix4x4::New();
+ MSG(true, "5.1\n");
+ m->Zero();
+ MSG(true, "5.2\n");
+ m->SetElement(0, 1, 1);
+ m->SetElement(1, 0, -1);
+ m->SetElement(2, 2, 1);
+ m->SetElement(3, 3, 1);
+ MSG(true, "5.3\n");
+ xyplot->PokeMatrix(m);
+*/ //# Set text prop color (same color for backward compat with test)
+ //# Assign same object to all text props
+ vtkTextProperty* tprop;
+ tprop = xyplot->GetTitleTextProperty();
+ tprop->SetColor(xyplot->GetProperty()->GetColor());
+ xyplot->SetAxisTitleTextProperty(tprop);
+ xyplot->SetAxisLabelTextProperty(tprop);
+
+//RKV:End
+
+
+ MSG(true, "6\n");
+
+/*{
+ vtkXYPlotWidget* aWidget = vtkXYPlotWidget::New();
+ aWidget->SetInteractor( anInteractor );
+ aWidget->SetXYPlotActor( xyplot );
+ aWidget->SetEnabled( 1 );
+}*/
+
+
+ vtkObject::GlobalWarningDisplayOn();
+
+ VISU_ScalarBarActor * aScalarBar = VISU_ScalarBarActor::New();
+ //vtkScalarBarActor * aScalarBar = vtkScalarBarActor::New();
+ aPresent->SetNbColors(5);
+ aPresent->DebugOn();
+ aPresent->Update();
+ aScalarBar->SetLookupTable(aPresent->GetBarTable());
+ aScalarBar->DebugOn();
+ aScalarBar->SetDistribution(aPresent->GetDistribution());
+ aScalarBar->DistributionVisibilityOn();
+// aScalarBar->SetOrientationToHorizontal();
+// aScalarBar->GetPositionCoordinate()->SetValue(.1, .6, 0);
+// aScalarBar->GetPosition2Coordinate()->SetValue(.8, .3, 0);
+
+/*{
+ vtkScalarBarWidget* aWidget = vtkScalarBarWidget::New();
+ aWidget->SetInteractor( anInteractor );
+ aWidget->SetScalarBarActor( aScalarBar );
+ aWidget->SetEnabled( 1 );
+}
+*/
+ aRenderer->AddActor(anActor);
+// aRenderer->AddActor2D(xyplot); //RKV
+ aRenderer->AddActor2D(aScalarBar);
+
+ //aRenderer->AddActor2D(barChartActor()); //RKV
+
+ aWindow->Render();
+ aRenderer->ResetCamera();
+
+ anInteractor->Start();
+ return 0;
+ }
}
}
else{
#include "VISU_PipeLineUtils.hxx"
+#include <vtkThreshold.h>
+#include <vtkPassThroughFilter.h>
+#include <vtkDoubleArray.h>
+
//----------------------------------------------------------------------------
VISU_ColoredPL
::VISU_ColoredPL():
- myMapperTable(VISU_LookupTable::New()),
- myBarTable(VISU_LookupTable::New()),
- myExtractor(VISU_Extractor::New()),
- myFieldTransform(VISU_FieldTransform::New())
+ myMapperTable( VISU_LookupTable::New() ),
+ myBarTable( VISU_LookupTable::New() ),
+ myExtractor( VISU_Extractor::New() ),
+ myFieldTransform( VISU_FieldTransform::New() ),
+ myThreshold ( vtkThreshold::New() ),
+ myPassFilter( vtkPassThroughFilter::New() ),
+ myDistribution( vtkDoubleArray::New() )
{
myMapperTable->Delete();
myMapperTable->SetScale(VTK_SCALE_LINEAR);
myExtractor->Delete();
myFieldTransform->Delete();
+
+ myThreshold->AllScalarsOn();
+ myThreshold->Delete();
+ myPassFilter->Delete();
+ myDistribution->Delete();
}
aTime = std::max(aTime, myBarTable->GetMTime());
aTime = std::max(aTime, myExtractor->GetMTime());
aTime = std::max(aTime, myFieldTransform->GetMTime());
+ aTime = std::max(aTime, myThreshold->GetMTime());
+ aTime = std::max(aTime, myPassFilter->GetMTime());
+ aTime = std::max(aTime, myDistribution->GetMTime());
return aTime;
}
Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
if(VISU_ColoredPL *aPipeLine = dynamic_cast<VISU_ColoredPL*>(thePipeLine)){
- if(theIsCopyInput)
- SetScalarRange(aPipeLine->GetScalarRange());
+ if ( theIsCopyInput ) {
+ SetScalarRange( aPipeLine->GetScalarRange() );
+ if ( this->IsScalarFilterUsed() )
+ SetScalarFilterRange( aPipeLine->GetScalarFilterRange() );
+ }
+
SetScalarMode(aPipeLine->GetScalarMode());
SetNbColors(aPipeLine->GetNbColors());
SetScaling(aPipeLine->GetScaling());
theExtractor->SetScalarMode(theScalarMode);
}
-
//----------------------------------------------------------------------------
void
VISU_ColoredPL
//----------------------------------------------------------------------------
void
VISU_ColoredPL
-::SetScalarRange(vtkFloatingPointType theRange[2])
+::SetScalarRange( vtkFloatingPointType theRange[2] )
{
- if(theRange[0] > theRange[1])
+ if ( theRange[0] > theRange[1] )
return;
- if(VISU::CheckIsSameRange(GetScalarRange(), theRange))
+ if (VISU::CheckIsSameRange( GetScalarRange(), theRange) )
+ return;
+
+ myFieldTransform->SetScalarRange( theRange );
+ myBarTable->SetRange( theRange );
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_ColoredPL
+::SetScalarFilterRange( vtkFloatingPointType theRange[2] )
+{
+ vtkFloatingPointType aRange[ 2 ];
+ this->GetScalarFilterRange( aRange );
+
+ if ( VISU::CheckIsSameRange( aRange, theRange) )
return;
- myFieldTransform->SetScalarRange(theRange);
- myBarTable->SetRange(theRange);
+ myThreshold->ThresholdBetween( theRange[0], theRange[1] );
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_ColoredPL
+::GetScalarFilterRange( vtkFloatingPointType theRange[2] )
+{
+ theRange[ 0 ] = myThreshold->GetLowerThreshold();
+ theRange[ 1 ] = myThreshold->GetUpperThreshold();
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType*
+VISU_ColoredPL
+::GetScalarFilterRange()
+{
+ static vtkFloatingPointType aRange[ 2 ];
+
+ this->GetScalarFilterRange( aRange );
+
+ return aRange;
}
+
+//----------------------------------------------------------------------------
+void
+VISU_ColoredPL
+::UseScalarFiltering( bool theUseScalarFilter )
+{
+ if ( theUseScalarFilter ) {
+ // Include threshold filter between the transform and the pass filters.
+ myPassFilter->SetInput( myThreshold->GetOutput() );
+ } else {
+ // Exclude threshold filter before the pass filter.
+ myPassFilter->SetInput( myFieldTransform->GetOutput() );
+ }
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU_ColoredPL
+::IsScalarFilterUsed()
+{
+ return myThreshold->GetOutput() == myPassFilter->GetInput();
+}
+
+
+//----------------------------------------------------------------------------
+vtkDoubleArray*
+VISU_ColoredPL
+::GetDistribution()
+{
+ unsigned long int aTime = this->GetMTime();
+ // If modified then update the distribution array
+ if (aTime > myDistribution->GetMTime()) {
+ // Set number of colors for the distribution
+ int nbColors = this->GetNbColors();
+ this->myDistribution->SetNumberOfValues(nbColors);
+ // Initialize numbers of colored cells with zero
+ this->myDistribution->FillComponent(0, 0);
+ // Create a lookup table to compute a color of a cell
+ VISU_LookupTable* lut = GetMapperTable();
+ vtkFloatingPointType aMapScale = lut->GetMapScale();
+ // Get scalar values from the input data to calculate their distribution within cells
+ vtkDataArray* dataArr;
+ // Dtermine where we have to take scalars from: cells data or points data.
+ if(VISU::IsDataOnCells(this->GetOutput())) {
+ dataArr = this->GetOutput()->GetCellData()->GetScalars();
+ } else {
+ dataArr = this->GetOutput()->GetPointData()->GetScalars();
+ }
+ // If scalars data array is not defined then create an empty one to avoid exceptions
+ if (dataArr == NULL) {
+ dataArr = vtkDoubleArray::New();
+ }
+
+ // Get range of scalars values
+// vtkFloatingPointType aRange[2];
+// dataArr->GetRange(aRange);
+
+ // Build the lookup table with the found range
+ // Get number of scalar values
+ int aNbVals = dataArr->GetNumberOfTuples();
+ if (aNbVals > 0) {
+ // Count the number of scalar values for each color in the input data
+ int idx = 0;
+ double cnt = 0;
+ // For each scalar value
+ for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
+ // Find the color index for this scalar value
+ idx = lut->GetIndex(*(dataArr->GetTuple(aValId)) * aMapScale);
+ // Increment the distribution value for this color index
+ cnt = this->myDistribution->GetValue(idx);
+ this->myDistribution->SetValue(idx, cnt + 1);
+ }
+ // Compute relative values when 1 is according to the total number of scalar values
+ for(vtkIdType aValId = 0; aValId < nbColors; aValId++){
+ cnt = this->myDistribution->GetValue(aValId);
+ this->myDistribution->SetValue(aValId, cnt / aNbVals);
+ }
+ }
+ this->myDistribution->Modified();
+
+ }
+
+ return myDistribution;
+}
+//----------------------------------------------------------------------------
+ // RKV : End
+
//----------------------------------------------------------------------------
vtkFloatingPointType*
VISU_ColoredPL
::Init()
{
SetScalarMode(0);
- SetSourceRange();
+
+ vtkFloatingPointType aRange[2];
+ GetSourceRange( aRange );
+
+ SetScalarRange( aRange );
+ SetScalarFilterRange( aRange );
}
//----------------------------------------------------------------------------
VISU_ColoredPL
::GetClippedInput()
{
- if(GetFieldTransformFilter()->GetInput())
- GetFieldTransformFilter()->Update();
- return GetFieldTransformFilter()->GetUnstructuredGridOutput();
+ if(myPassFilter->GetInput())
+ myPassFilter->Update();
+ return myPassFilter->GetUnstructuredGridOutput();
}
VISU_ColoredPL
::Build()
{
- myExtractor->SetInput(Superclass::GetClippedInput());
+ myExtractor->SetInput( Superclass::GetClippedInput() );
myFieldTransform->SetInput(myExtractor->GetOutput());
+ myThreshold->SetInput( myFieldTransform->GetOutput() );
+ // The pass filter is used here for possibility to include/exclude
+ // threshold filter before it.
+ myPassFilter->SetInput( myFieldTransform->GetOutput() );
+
GetMapperHolder()->SetLookupTable(GetMapperTable());
//GetMapper()->InterpolateScalarsBeforeMappingOn();
GetMapper()->SetUseLookupTableScalarRange( true );
::GetSourceRange(vtkFloatingPointType theRange[2])
{
myExtractor->Update();
- myExtractor->GetOutput()->GetScalarRange(theRange);
+ myExtractor->GetOutput()->GetScalarRange( theRange );
}
void
::SetSourceRange()
{
vtkFloatingPointType aRange[2];
- GetSourceRange(aRange);
- SetScalarRange(aRange);
+ GetSourceRange( aRange );
+ SetScalarRange( aRange );
}
class VISU_FieldTransform;
class VISU_LookupTable;
+class vtkPassThroughFilter;
+class vtkDoubleArray;
+class vtkThreshold;
+
//----------------------------------------------------------------------------
-class VISU_ColoredPL : public VISU_PipeLine
+class VISU_PIPELINE_EXPORT VISU_ColoredPL : public VISU_PipeLine
{
public:
vtkTypeMacro(VISU_ColoredPL, VISU_PipeLine);
virtual
void
- SetScalarRange(vtkFloatingPointType theRange[2]);
+ SetScalarRange( vtkFloatingPointType theRange[2] );
+
+ void
+ SetScalarFilterRange( vtkFloatingPointType theRange[2] );
+
+ void
+ GetScalarFilterRange( vtkFloatingPointType theRange[2] );
+
+ vtkFloatingPointType*
+ GetScalarFilterRange();
+
+ bool
+ IsScalarFilterUsed();
+
+ void
+ UseScalarFiltering( bool theUseScalarFilter );
virtual
void
int
GetNbColors();
- //----------------------------------------------------------------------------
+ vtkDoubleArray* GetDistribution();
+
+
public:
+ //----------------------------------------------------------------------------
virtual
void
Init();
VISU_Extractor* theExtractor);
private:
- vtkSmartPointer<VISU_LookupTable> myMapperTable;
- vtkSmartPointer<VISU_LookupTable> myBarTable;
- vtkSmartPointer<VISU_Extractor> myExtractor;
- vtkSmartPointer<VISU_FieldTransform> myFieldTransform;
-
+ vtkSmartPointer< VISU_LookupTable > myMapperTable;
+ vtkSmartPointer< VISU_LookupTable > myBarTable;
+ vtkSmartPointer< VISU_Extractor > myExtractor;
+ vtkSmartPointer< VISU_FieldTransform > myFieldTransform;
+ vtkSmartPointer< vtkThreshold > myThreshold;
+ vtkSmartPointer< vtkPassThroughFilter > myPassFilter;
+ vtkSmartPointer< vtkDoubleArray > myDistribution;
};
#endif
::VISU_CutLinesPL()
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myCondition = 1;
myPosition = 0;
if(MYDEBUG) MESSAGE("VISU_CutPlanesPL()::VISU_CutPlanesPL() - "<<this);
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
SetElnoDisassembleState( true );
VISU::CopyDataSetMapper(GetDataSetMapper(),
aMapperHolder->GetDataSetMapper(),
theIsCopyInput);
+ myExtractGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
if (vtkImplicitBoolean* aBoolean = myExtractGeometry->GetImplicitBoolean()) {
vtkImplicitFunctionCollection* aFunction = aBoolean->GetFunction();
aFunction->AddItem(thePlane);
+ aBoolean->Modified();
// Check, that at least one cell present after clipping.
// This check was introduced because of bug IPAL8849.
vtkDataSet* aClippedDataSet = GetClippedInput();
return aPlane;
}
+//----------------------------------------------------------------------------
+void VISU_DataSetMapperHolder::RemoveClippingPlane(vtkIdType theID)
+{
+ if(theID >= 0 && theID < GetNumberOfClippingPlanes()){
+ if(vtkImplicitBoolean* aBoolean = myExtractGeometry->GetImplicitBoolean()){
+ vtkImplicitFunctionCollection* aFunctions = aBoolean->GetFunction();
+ aFunctions->RemoveItem(theID);
+ aBoolean->Modified();
+ }
+ }
+}
+
+
//----------------------------------------------------------------------------
void
VISU_DataSetMapperHolder
vtkPlane*
GetClippingPlane(vtkIdType theID);
+ virtual void RemoveClippingPlane(vtkIdType theID);
+
protected:
//----------------------------------------------------------------------------
VISU_DataSetMapperHolder();
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File: VISU_ScalarMapPL.cxx
-// Author: Roman NIKOLAEV
-// Module : VISU
-
-//Salome includes
-#include "VISU_DeformationPL.hxx"
-#include "VISU_MergeFilter.hxx"
-#include "VISU_DeformedShapePL.hxx"
-#include "VISU_PipeLineUtils.hxx"
-
-//VTK includes
-#include <vtkDataSet.h>
-#include <vtkPassThroughFilter.h>
-#include <vtkWarpVector.h>
-#include <vtkCellDataToPointData.h>
-#include <vtkUnstructuredGrid.h>
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-
-//----------------------------------------------------------------------------
-VISU_DeformationPL::VISU_DeformationPL():
- myScaleFactor(1.0),
- myMapScaleFactor(1.0)
-{
- if(MYDEBUG) MESSAGE("VISU_DeformationPL()::VISU_DeformationPL() - "<<this);
- myWarpVector = vtkWarpVector::New();
- myWarpVector->SetScaleFactor(myScaleFactor);
-
- myVectorMergeFilter = VISU_MergeFilter::New();
- myVectorMergeFilter->SetMergingInputs(true);
- myInputPassFilter = vtkPassThroughFilter::New();
- myOutputPassFiler = vtkPassThroughFilter::New();
- myCellDataToPointData = vtkCellDataToPointData::New();
- myCellDataToPointData->PassCellDataOn();
-
- myInputPassFilter->SetInput(vtkUnstructuredGrid::New());
-
- myCellDataToPointData->SetInput(myInputPassFilter->GetOutput());
-
- myWarpVector->SetInput(myCellDataToPointData->GetOutput());
-
- myOutputPassFiler->SetInput(myWarpVector->GetOutput());
-}
-
-//----------------------------------------------------------------------------
-VISU_DeformationPL::~VISU_DeformationPL()
-{
- if(MYDEBUG) MESSAGE("VISU_DeformationPL()::~VISU_DeformationPL() - "<<this);
- myWarpVector->Delete();
- myVectorMergeFilter->Delete();
- myInputPassFilter->Delete();
- myOutputPassFiler->Delete();
- myCellDataToPointData->Delete();
-}
-
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU_DeformationPL::GetMTime(){
- unsigned long int aTime = std::max(myWarpVector->GetMTime(),
- myVectorMergeFilter->GetMTime());
-
- aTime = std::max(aTime,myInputPassFilter->GetMTime());
- aTime = std::max(aTime,myOutputPassFiler->GetMTime());
- aTime = std::max(aTime,myCellDataToPointData->GetMTime());
- return 0;
-}
-
-//----------------------------------------------------------------------------
-void VISU_DeformationPL::SetScale(vtkFloatingPointType theScaleFactor)
-{
- if(myScaleFactor == theScaleFactor)
- return;
- myScaleFactor = theScaleFactor;
- myWarpVector->SetScaleFactor(myScaleFactor*myMapScaleFactor);
-}
-
-void VISU_DeformationPL::SetMapScale(vtkFloatingPointType theMapScaleFactor)
-{
- if(myMapScaleFactor == theMapScaleFactor)
- return;
- myMapScaleFactor = theMapScaleFactor;
-
- myWarpVector->SetScaleFactor(myScaleFactor*myMapScaleFactor);
-}
-
-
-vtkFloatingPointType VISU_DeformationPL::GetScale()
-{
- return myScaleFactor;
-}
-
-//----------------------------------------------------------------------------
-void VISU_DeformationPL::SetWarpVectorInput(vtkDataSet *theInput)
-{
- myInputPassFilter->SetInput(theInput);
-}
-
-//----------------------------------------------------------------------------
-vtkDataSet* VISU_DeformationPL::GetWarpVectorOutput()
-{
- return myOutputPassFiler->GetOutput();
-}
-
-//----------------------------------------------------------------------------
-void VISU_DeformationPL::SetMergeFilterInput(vtkDataSet* ScalarInput,
- vtkDataSet* VectorialInput)
-{
- myVectorMergeFilter->SetScalars(ScalarInput);
- myVectorMergeFilter->AddField("VISU_CELLS_MAPPER",ScalarInput);
- myVectorMergeFilter->AddField("VISU_POINTS_MAPPER",ScalarInput);
-
- myVectorMergeFilter->SetGeometry(VectorialInput);
- myVectorMergeFilter->SetVectors(VectorialInput);
-}
-
-//----------------------------------------------------------------------------
-vtkDataSet* VISU_DeformationPL::GetMergeFilterOutput(){
- return myVectorMergeFilter->GetOutput();
-}
-
-//----------------------------------------------------------------------------
-vtkFloatingPointType VISU_DeformationPL::GetDefaultScaleFactor(VISU_DeformationPL *thePipeLine)
-{
- if(!thePipeLine || !thePipeLine->GetMergeFilterOutput())
- return 0.0;
-
- vtkFloatingPointType aSourceRange[2];
- thePipeLine->GetMergeFilterOutput()->GetScalarRange(aSourceRange);
-
- static vtkFloatingPointType EPS = 1.0 / VTK_LARGE_FLOAT;
- if(fabs(aSourceRange[1]) > EPS){
- vtkDataSet* aDataSet = thePipeLine->GetMergeFilterOutput();
- vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor(aDataSet);
- return aScaleFactor / aSourceRange[1];
- }
- return 0.0;
-}
-
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VISU_DeformationPL.hxx
-// Author :
-// Module : SALOME
-
-#ifndef VISU_DeformationPL_HeaderFile
-#define VISU_DeformationPL_HeaderFile
-
-#include "VISUPipeline.hxx"
-#include "VISU_MapperHolder.hxx"
-#include <vtkSmartPointer.h>
-
-class vtkDataSet;
-class VISU_MergeFilter;
-class vtkPassThroughFilter;
-class vtkWarpVector;
-class vtkCellDataToPointData;
-
-class VISU_PIPELINE_EXPORT VISU_DeformationPL {
-
-public:
- VISU_DeformationPL();
- virtual ~VISU_DeformationPL();
-
- //-----------------------------------------------------------
- virtual void SetScale(vtkFloatingPointType theScaleFactor);
- virtual void SetMapScale(vtkFloatingPointType theMapScaleFactor);
- virtual vtkFloatingPointType GetScale();
-
- //-----------------------------------------------------------
- virtual void SetVectorialField(VISU::PUnstructuredGridIDMapper theIdMapper) = 0;
- virtual VISU::PUnstructuredGridIDMapper getVectorialField() = 0;
-
-
- //-----------------------------------------------------------
- virtual
- unsigned
- long int
- GetMTime();
-
- static vtkFloatingPointType GetDefaultScaleFactor(VISU_DeformationPL *thePipeLine);
-
- void SetWarpVectorInput(vtkDataSet *theInput);
- vtkDataSet* GetWarpVectorOutput();
-
- //-----------------------------------------------------------
- void SetMergeFilterInput(vtkDataSet* ScalarInput,
- vtkDataSet* VectorialInput);
-
- vtkDataSet* GetMergeFilterOutput();
-
-protected:
-
- VISU::PUnstructuredGridIDMapper myVectorialField;
- vtkWarpVector *myWarpVector;
- vtkSmartPointer<VISU_MergeFilter> myVectorMergeFilter;
- vtkPassThroughFilter *myInputPassFilter;
- vtkPassThroughFilter *myOutputPassFiler;
- vtkCellDataToPointData *myCellDataToPointData;
-
-private:
- vtkFloatingPointType myScaleFactor;
- vtkFloatingPointType myMapScaleFactor;
-
-};
-
-#endif
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File: VISU_DeformedGridPL.cxx
-// Author: Alexey PETROV
-// Module : VISU
-
-
-#include "VISU_DeformedGridPL.hxx"
-#include "VISU_FieldTransform.hxx"
-#include "VISU_Plot3DPL.hxx"
-
-#include "VISU_PipeLineUtils.hxx"
-
-#include <vtkPolyDataMapper.h>
-#include <vtkContourFilter.h>
-#include <vtkWarpScalar.h>
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VISU_DeformedGridPL);
-
-
-//----------------------------------------------------------------------------
-VISU_DeformedGridPL
-::VISU_DeformedGridPL():
- myContourFilter(vtkContourFilter::New()),
- myWarpScalar(vtkWarpScalar::New()),
- myIsContour(false),
- myScaleFactor(1.0),
- myMapScaleFactor(1.0)
-{
- SetIsShrinkable(false);
- SetNumberOfContours(32);
-}
-
-
-//----------------------------------------------------------------------------
-VISU_DeformedGridPL
-::~VISU_DeformedGridPL()
-{}
-
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU_DeformedGridPL
-::GetMTime()
-{
- unsigned long int aTime = Superclass::GetMTime();
-
- aTime = std::max(aTime, myContourFilter->GetMTime());
- aTime = std::max(aTime, myWarpScalar->GetMTime());
-
- return aTime;
-}
-
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU_DeformedGridPL
-::GetMemorySize()
-{
- unsigned long int aSize = Superclass::GetMemorySize();
-
- if(vtkDataObject* aDataObject = myContourFilter->GetInput())
- aSize += aDataObject->GetActualMemorySize() * 1024;
-
- if(vtkDataObject* aDataObject = myWarpScalar->GetInput())
- aSize += aDataObject->GetActualMemorySize() * 1024;
-
- return aSize;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedGridPL
-::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
-{
- Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
-
- if(VISU_DeformedGridPL *aPipeLine = dynamic_cast<VISU_DeformedGridPL*>(thePipeLine)){
- SetScaleFactor( aPipeLine->GetScaleFactor() );
- SetContourPrs( aPipeLine->GetIsContourPrs() );
- SetNumberOfContours( aPipeLine->GetNumberOfContours() );
- }
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedGridPL
-::Init()
-{
- Superclass::Init();
-
- vtkPointSet* aPointSet = GetFieldTransformFilter()->GetPolyDataOutput();
- SetScaleFactor( VISU_Plot3DPL::GetScaleFactor( this, aPointSet ) );
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedGridPL
-::Build()
-{
- Superclass::Build();
-
- myWarpScalar->SetInput( GetFieldTransformFilter()->GetPolyDataOutput() );
- GetPolyDataMapper()->SetInput( myWarpScalar->GetPolyDataOutput() );
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedGridPL
-::Update()
-{
- vtkPointSet* aPointSet = GetFieldTransformFilter()->GetPolyDataOutput();
- if ( !myIsContour ) // surface prs
- {
- myWarpScalar->SetInput( aPointSet );
- }
- else // contour prs
- {
- myContourFilter->SetInput( aPointSet );
-
- vtkFloatingPointType aScalarRange[2];
- GetSourceRange( aScalarRange );
-
- myContourFilter->GenerateValues( GetNumberOfContours(), aScalarRange );
- myWarpScalar->SetInput( myContourFilter->GetOutput() );
- }
-
- Superclass::Update();
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedGridPL
-::SetNumberOfContours(int theNumber)
-{
- myContourFilter->SetNumberOfContours(theNumber);
-}
-
-
-//----------------------------------------------------------------------------
-int
-VISU_DeformedGridPL
-::GetNumberOfContours()
-{
- return myContourFilter->GetNumberOfContours();
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedGridPL
-::SetScaleFactor(vtkFloatingPointType theScaleFactor)
-{
- if ( VISU::CheckIsSameValue( myWarpScalar->GetScaleFactor(), theScaleFactor ) )
- return;
-
- myScaleFactor = theScaleFactor;
- myWarpScalar->SetScaleFactor(theScaleFactor*myMapScaleFactor);
-}
-
-
-//----------------------------------------------------------------------------
-vtkFloatingPointType
-VISU_DeformedGridPL
-::GetScaleFactor()
-{
- return myScaleFactor;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedGridPL
-::SetContourPrs(bool theIsContourPrs )
-{
- if(myIsContour == theIsContourPrs)
- return;
-
- myIsContour = theIsContourPrs;
- Modified();
-}
-
-
-//----------------------------------------------------------------------------
-bool
-VISU_DeformedGridPL
-::GetIsContourPrs()
-{
- return myIsContour;
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedGridPL
-::SetMapScale(vtkFloatingPointType theMapScale)
-{
- Superclass::SetMapScale(theMapScale);
- myMapScaleFactor = theMapScale;
-
- if ( myIsContour ) {
- vtkFloatingPointType aSourceRange[2];
- GetSourceRange( aSourceRange );
- vtkFloatingPointType aDeltaRange = aSourceRange[1] - aSourceRange[0];
- vtkFloatingPointType aNewRange[2] = { aSourceRange[1] - theMapScale*aDeltaRange, aSourceRange[1] };
- myContourFilter->GenerateValues( GetNumberOfContours(), aNewRange );
- }
-
- myWarpScalar->SetScaleFactor( myScaleFactor * theMapScale );
-}
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File: VISU_ScalarMapPL.hxx
-// Author: Alexey PETROV
-// Module : VISU
-
-#ifndef VISU_DeformedGridPL_HeaderFile
-#define VISU_DeformedGridPL_HeaderFile
-
-#include "VISUPipeline.hxx"
-#include "VISU_PolyDataPL.hxx"
-
-class vtkWarpScalar;
-class vtkContourFilter;
-
-
-//----------------------------------------------------------------------------
-class VISU_PIPELINE_EXPORT VISU_DeformedGridPL : public VISU_PolyDataPL
-{
-public:
- vtkTypeMacro(VISU_DeformedGridPL, VISU_PolyDataPL);
-
- static
- VISU_DeformedGridPL*
- New();
-
- //----------------------------------------------------------------------------
- virtual
- unsigned long int
- GetMTime();
-
- //! Gets memory size used by the instance (bytes).
- virtual
- unsigned long int
- GetMemorySize();
-
- //----------------------------------------------------------------------------
- void
- SetScaleFactor( vtkFloatingPointType theScaleFactor );
-
- vtkFloatingPointType
- GetScaleFactor();
-
- void
- SetContourPrs( bool theIsContourPrs );
-
- bool
- GetIsContourPrs();
-
- void
- SetNumberOfContours( int theNumber );
-
- int
- GetNumberOfContours();
-
- virtual
- void
- SetMapScale(vtkFloatingPointType theMapScale = 1.0);
-
- //----------------------------------------------------------------------------
- virtual
- void
- Init();
-
- virtual
- void
- Update();
-
-protected:
- //----------------------------------------------------------------------------
- VISU_DeformedGridPL();
-
- virtual
- ~VISU_DeformedGridPL();
-
- virtual
- void
- Build();
-
- virtual
- void
- DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
-
-private:
- VISU_DeformedGridPL(const VISU_DeformedGridPL&); // Not implemented.
- void operator=(const VISU_DeformedGridPL&); // Not implemented.
-
- vtkFloatingPointType myScaleFactor;
- vtkFloatingPointType myMapScaleFactor;
- vtkContourFilter* myContourFilter;
- vtkWarpScalar *myWarpScalar;
- bool myIsContour;
-};
-
-#endif
+++ /dev/null
-// VISU DeformedShapeAndScalarMapPL
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File: VISU_DeformedShapeAndScalarMapPL.cxx
-// Author: Eugeny Nikolaev
-// Module : VISU
-
-#include "VISU_DeformedShapeAndScalarMapPL.hxx"
-#include "VISU_FieldTransform.hxx"
-#include "VISU_Extractor.hxx"
-#include "VISU_LookupTable.hxx"
-#include "VISU_DeformedShapePL.hxx"
-#include "VTKViewer_TransformFilter.h"
-#include "VTKViewer_Transform.h"
-#include "VISU_MergeFilter.hxx"
-#include "VISU_ElnoDisassembleFilter.hxx"
-#include "VISU_PipeLineUtils.hxx"
-
-#include <vtkWarpVector.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkCellDataToPointData.h>
-#include <vtkPointDataToCellData.h>
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VISU_DeformedShapeAndScalarMapPL)
-
-//----------------------------------------------------------------------------
-/*!
- * Constructor. Creating new instances of vtkWarpVector,vtkMergeFilter,vtkUnstructuredGrid
- * Where:
- * \li myDeformVectors is vtkWarpVector - deformation vectors data
- * \li myScalarsMergeFilter is vtkMergeFilter - merge filter.
- * Merge filter which unify the deformation and scalars
- * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
-*/
-VISU_DeformedShapeAndScalarMapPL
-::VISU_DeformedShapeAndScalarMapPL():
- myScaleFactor(1.0),
- myMapScaleFactor(1.0)
-{
- myWarpVector = vtkWarpVector::New();
-
- myScalarsMergeFilter = VISU_MergeFilter::New();
- myScalarsMergeFilter->SetMergingInputs(true);
-
- myScalarsExtractor = VISU_Extractor::New();
-
- myScalarsFieldTransform = VISU_FieldTransform::New();
-
- myCellDataToPointData = vtkCellDataToPointData::New();
- myScalarsElnoDisassembleFilter = VISU_ElnoDisassembleFilter::New();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Destructor.
- * Delete all fields.
-*/
-VISU_DeformedShapeAndScalarMapPL
-::~VISU_DeformedShapeAndScalarMapPL()
-{
- myWarpVector->Delete();
-
- myScalarsMergeFilter->Delete();
-
- myScalarsExtractor->Delete();
-
- myScalarsFieldTransform->Delete();
-
- myCellDataToPointData->Delete();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Initial method
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::Init()
-{
- Superclass::Init();
-
- SetScale(VISU_DeformedShapePL::GetDefaultScale(this));
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Build method
- * Building of deformation and puts result to merge filter.
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::Build()
-{
- Superclass::Build();
-}
-
-
-//----------------------------------------------------------------------------
-vtkDataSet*
-VISU_DeformedShapeAndScalarMapPL
-::InsertCustomPL()
-{
- GetMapper()->SetColorModeToMapScalars();
- GetMapper()->ScalarVisibilityOn();
-
- VISU::CellDataToPoint(myWarpVector,
- myCellDataToPointData,
- GetMergedInput());
-
- myScalars = GetMergedInput();
-
- UpdateScalars();
-
- myScalarsFieldTransform->SetInput(myScalarsExtractor->GetOutput());
-
- // Sets geometry for merge filter
- myScalarsMergeFilter->SetGeometry(myWarpVector->GetUnstructuredGridOutput());
-
- vtkDataSet* aScalarsDataSet = myScalarsFieldTransform->GetOutput();
- myScalarsMergeFilter->SetScalars(aScalarsDataSet);
- myScalarsMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsDataSet);
- myScalarsMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsDataSet);
-
- return myScalarsMergeFilter->GetOutput();
-}
-
-
-//----------------------------------------------------------------------------
-/*!
- * Update method
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::Update()
-{
- Superclass::Update();
- //{
- // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsExtractor.vtk";
- // VISU::WriteToFile(myScalarsExtractor->GetUnstructuredGridOutput(), aFileName);
- //}
- //{
- // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk";
- // VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
- //}
- //{
- // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsMergeFilter.vtk";
- // VISU::WriteToFile(myScalarsMergeFilter->GetUnstructuredGridOutput(), aFileName);
- //}
-}
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU_DeformedShapeAndScalarMapPL
-::GetMemorySize()
-{
- unsigned long int aSize = Superclass::GetMemorySize();
-
- if(vtkDataSet* aDataSet = myWarpVector->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- if(vtkDataSet* aDataSet = myScalarsExtractor->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- if(vtkDataSet* aDataSet = myScalarsMergeFilter->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- if(myCellDataToPointData->GetInput())
- if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
- aSize += aDataSet->GetActualMemorySize() * 1024;
-
- return aSize;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Update scalars method.
- * Put scalars to merge filter.
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::UpdateScalars()
-{
- vtkDataSet* aScalars = GetScalars();
- myScalarsElnoDisassembleFilter->SetInput(aScalars);
- myScalarsExtractor->SetInput(myScalarsElnoDisassembleFilter->GetOutput());
-
- if(VISU::IsDataOnCells(myScalarsElnoDisassembleFilter->GetOutput()))
- GetMapper()->SetScalarModeToUseCellData();
- else
- GetMapper()->SetScalarModeToUsePointData();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Copy information about pipline.
- * Copy scale and scalars.
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
-{
- Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
-
- if(VISU_DeformedShapeAndScalarMapPL *aPipeLine = dynamic_cast<VISU_DeformedShapeAndScalarMapPL*>(thePipeLine)){
- SetScale(aPipeLine->GetScale());
- SetScalars(aPipeLine->GetScalars());
- }
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Set scalars.
- * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::SetScalars(vtkDataSet *theScalars)
-{
- if(GetScalars() == theScalars)
- return;
-
- myScalars = theScalars;
- UpdateScalars();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Get pointer to input scalars.
- */
-vtkDataSet*
-VISU_DeformedShapeAndScalarMapPL
-::GetScalars()
-{
- return myScalars.GetPointer();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Sets scale for deformed shape
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::SetScale(vtkFloatingPointType theScale)
-{
- if(VISU::CheckIsSameValue(myScaleFactor, theScale))
- return;
-
- myScaleFactor = theScale;
- myWarpVector->SetScaleFactor(theScale*myMapScaleFactor);
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Gets scale of deformed shape.
- */
-vtkFloatingPointType
-VISU_DeformedShapeAndScalarMapPL
-::GetScale()
-{
- return myScaleFactor;
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Set scale factor of deformation.
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::SetMapScale(vtkFloatingPointType theMapScale)
-{
- myMapScaleFactor = theMapScale;
- Superclass::SetMapScale(theMapScale);
- myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Gets scalar mode.
- */
-int
-VISU_DeformedShapeAndScalarMapPL
-::GetScalarMode()
-{
- return myScalarsExtractor->GetScalarMode();
-}
-
-//----------------------------------------------------------------------------
-/*!
- * Sets scalar mode.
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::SetScalarMode(int theScalarMode)
-{
- VISU_ScalarMapPL::SetScalarMode(theScalarMode, GetScalars(), myScalarsExtractor);
-}
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedShapeAndScalarMapPL
-::SetScaling(int theScaling)
-{
- if(GetScaling() == theScaling)
- return;
-
- GetBarTable()->SetScale(theScaling);
-
- if(theScaling == VTK_SCALE_LOG10)
- myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Log10));
- else
- myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Ident));
-}
-
-
-//----------------------------------------------------------------------------
-void
-VISU_DeformedShapeAndScalarMapPL
-::SetScalarRange(vtkFloatingPointType theRange[2])
-{
- if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
- return;
-
- myScalarsFieldTransform->SetScalarRange(theRange);
- GetBarTable()->SetRange(theRange);
-}
-
-
-//----------------------------------------------------------------------------
-vtkFloatingPointType*
-VISU_DeformedShapeAndScalarMapPL
-::GetScalarRange()
-{
- return myScalarsFieldTransform->GetScalarRange();
-}
-
-
-//----------------------------------------------------------------------------
-/*!
- * Gets ranges of extracted scalars
- * \param theRange[2] - output values
- * \li theRange[0] - minimum value
- * \li theRange[1] - maximum value
- */
-void
-VISU_DeformedShapeAndScalarMapPL
-::GetSourceRange(vtkFloatingPointType theRange[2])
-{
- myScalarsExtractor->Update();
- myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange);
-}
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File: VISU_DeformedShapeAndScalarMapPL.hxx
-// Author: Eugeny Nikolaev
-// Module : VISU
-
-#ifndef VISU_DeformedShapeAndScalarMapPL_HeaderFile
-#define VISU_DeformedShapeAndScalarMapPL_HeaderFile
-
-#include "VISUPipeline.hxx"
-#include "VISU_ScalarMapPL.hxx"
-
-class VISU_MergeFilter;
-class vtkWarpVector;
-class vtkUnstructuredGrid;
-class vtkCellDataToPointData;
-class vtkPointDataToCellData;
-class VISU_ElnoDisassembleFilter;
-
-
-//----------------------------------------------------------------------------
-class VISU_PIPELINE_EXPORT VISU_DeformedShapeAndScalarMapPL : public VISU_ScalarMapPL
-{
-public:
- vtkTypeMacro(VISU_DeformedShapeAndScalarMapPL, VISU_ScalarMapPL);
-
- static
- VISU_DeformedShapeAndScalarMapPL*
- New();
-
- virtual
- void
- SetScale(vtkFloatingPointType theScale);
-
- virtual
- vtkFloatingPointType
- GetScale();
-
- virtual
- int
- GetScalarMode();
-
- virtual
- void
- SetScalarMode(int theScalarMode = 0);
-
- virtual
- void
- SetScaling(int theScaling);
-
- virtual
- void
- SetScalarRange(vtkFloatingPointType theRange[2]);
-
- virtual
- vtkFloatingPointType*
- GetScalarRange();
-
- virtual
- void
- GetSourceRange(vtkFloatingPointType theRange[2]);
-
- virtual
- void
- SetScalars(vtkDataSet *theScalars);
-
- virtual
- vtkDataSet*
- GetScalars();
-
-public:
- //! Redefined method for initialization of the pipeline.
- virtual
- void
- Init();
-
- //! Redefined method for building the pipeline.
- virtual
- void
- Build();
-
- //! Redefined method for updating the pipeline.
- virtual
- void
- Update();
-
- //! Gets memory size used by the instance (bytes).
- virtual
- unsigned long int
- GetMemorySize();
-
- //! Update scalars.
- void
- UpdateScalars();
-
- virtual
- void
- SetMapScale(vtkFloatingPointType theMapScale = 1.0);
-
-protected:
- VISU_DeformedShapeAndScalarMapPL();
-
- virtual
- ~VISU_DeformedShapeAndScalarMapPL();
-
- virtual
- vtkDataSet*
- InsertCustomPL();
-
- virtual
- void
- DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
-
-private:
- VISU_DeformedShapeAndScalarMapPL(const VISU_DeformedShapeAndScalarMapPL&);
-
- vtkFloatingPointType myScaleFactor;
- vtkFloatingPointType myMapScaleFactor;
- vtkWarpVector *myWarpVector;
- VISU_MergeFilter *myScalarsMergeFilter;
- vtkSmartPointer<vtkUnstructuredGrid> myScalars;
- vtkCellDataToPointData* myCellDataToPointData;
- VISU_FieldTransform* myScalarsFieldTransform;
- VISU_Extractor* myScalarsExtractor;
- VISU_ElnoDisassembleFilter* myScalarsElnoDisassembleFilter;
-};
-
-#endif
myMapScaleFactor(1.0)
{
SetIsShrinkable(true);
+ SetIsFeatureEdgesAllowed(true);
myWarpVector = vtkWarpVector::New();
myCellDataToPointData = vtkCellDataToPointData::New();
aVolume *= aVol;
}
}
+ if( aNbElem == 0 || fabs(idim) < 1.0 / VTK_LARGE_FLOAT )
+ return 0.0; // to avoid division by zero
aVolume /= aNbElem;
return pow(aVolume, vtkFloatingPointType(1.0/idim));
}
+++ /dev/null
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
-#include "VISU_ElnoAssembleFilter.hxx"
-#include "VISU_PipeLineUtils.hxx"
-#include "VISU_ElnoMeshValue.hxx"
-
-#include <vtkCellData.h>
-#include <vtkInformation.h>
-#include <vtkInformationVector.h>
-#include <vtkObjectFactory.h>
-#include <vtkPointData.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkPoints.h>
-#include <vtkCellArray.h>
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro( VISU_ElnoAssembleFilter );
-
-
-//----------------------------------------------------------------------------
-VISU_ElnoAssembleFilter::VISU_ElnoAssembleFilter()
-{
- this->SetInputArrayToProcess( 0, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_POINTS, // field association
- "ELNO_POINT_COORDS" ); // name
-
- this->myIsRestorePoints = false;
-}
-
-
-//----------------------------------------------------------------------------
-VISU_ElnoAssembleFilter::~VISU_ElnoAssembleFilter()
-{}
-
-
-//----------------------------------------------------------------------------
-void VISU_ElnoAssembleFilter::SetElnoAssembleState( bool theIsRestorePoints )
-{
- if ( myIsRestorePoints == theIsRestorePoints )
- return;
-
- myIsRestorePoints = theIsRestorePoints;
- this->Modified();
-}
-
-//----------------------------------------------------------------------------
-namespace
-{
- //----------------------------------------------------------------------------
- template < int points_type, int elno_type >
- int Execute2( vtkPointSet *theInput,
- vtkPointSet *theOutput,
- vtkDataArray *theElnoPointCoords )
- {
- theOutput->CopyStructure( theInput );
-
- vtkCellData *aCellData = theOutput->GetCellData();
- aCellData->PassData( theInput->GetCellData() );
-
- vtkPointData *aPointData = theOutput->GetPointData();
- aPointData->PassData( theInput->GetPointData() );
-
- vtkPoints *anInputPoints = theInput->GetPoints();
- vtkPoints *aPoints = anInputPoints->New( elno_type );
- vtkIdType aNbPoints = theInput->GetNumberOfPoints();
- aPoints->SetNumberOfPoints( aNbPoints );
-
- typedef typename VISU::TL::TEnum2VTKArrayType< elno_type >::TResult TPointsDataArray;
- typedef typename VISU::TL::TEnum2VTKBasicType< elno_type >::TResult TPointsDataType;
- TPointsDataArray* anOutputPointsArray = TPointsDataArray::SafeDownCast( aPoints->GetData() );
-
- TPointsDataArray* anElnoPointCoords = TPointsDataArray::SafeDownCast( theElnoPointCoords );
-
- for ( vtkIdType aPointId = 0; aPointId < aNbPoints; aPointId++ ) {
- TPointsDataType aCoords[ 3 ];
- anElnoPointCoords->GetTupleValue( aPointId, aCoords );
- anOutputPointsArray->SetTupleValue( aPointId, aCoords );
- }
-
- theOutput->SetPoints( aPoints );
-
- return 1;
- }
-
-
- //----------------------------------------------------------------------------
- template < int points_type >
- int Execute( vtkPointSet *theInput,
- vtkPointSet *theOutput,
- vtkDataArray *theElnoPointCoords )
- {
- switch( theElnoPointCoords->GetDataType() ){
- case VTK_DOUBLE:
- return Execute2< points_type, VTK_DOUBLE >( theInput, theOutput, theElnoPointCoords );
- case VTK_FLOAT:
- return Execute2< points_type, VTK_FLOAT >( theInput, theOutput, theElnoPointCoords );
- case VTK_INT:
- return Execute2< points_type, VTK_INT >( theInput, theOutput, theElnoPointCoords );
- case VTK_LONG:
- return Execute2< points_type, VTK_LONG >( theInput, theOutput, theElnoPointCoords );
- default:
- break;
- }
-
- return 0;
- }
-
-
- //----------------------------------------------------------------------------
-}
-
-
-//----------------------------------------------------------------------------
-int VISU_ElnoAssembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector )
-{
- // get the info objects
- vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
- vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
- // get the input and ouptut
- vtkPointSet *anInput = vtkPointSet::SafeDownCast( inInfo->Get( vtkDataObject::DATA_OBJECT() ) );
- vtkPointSet *anOutput = vtkPointSet::SafeDownCast( outInfo->Get( vtkDataObject::DATA_OBJECT() ) );
-
- vtkDataArray *anElnoPointCoords = this->GetInputArrayToProcess( 0, inputVector );
-
- if ( !myIsRestorePoints || !anElnoPointCoords ) {
- anOutput->ShallowCopy( anInput );
- return 1;
- }
-
- vtkPoints *aPoints = anInput->GetPoints();
- switch( aPoints->GetDataType() ){
- case VTK_DOUBLE:
- return ::Execute< VTK_DOUBLE >( anInput, anOutput, anElnoPointCoords );
- case VTK_FLOAT:
- return ::Execute< VTK_FLOAT >( anInput, anOutput, anElnoPointCoords );
- case VTK_INT:
- return ::Execute< VTK_INT >( anInput, anOutput, anElnoPointCoords );
- case VTK_LONG:
- return ::Execute< VTK_LONG >( anInput, anOutput, anElnoPointCoords );
- default:
- break;
- }
-
- return 0;
-}
-
-
-//----------------------------------------------------------------------------
+++ /dev/null
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
-#ifndef VISU_ElnoAssembleFilter_H
-#define VISU_ElnoAssembleFilter_H
-
-#include <vtkPointSetAlgorithm.h>
-
-class VISU_ElnoAssembleFilter : public vtkPointSetAlgorithm
-{
-public:
- typedef vtkPointSetAlgorithm Superclass;
-
- static VISU_ElnoAssembleFilter *New();
-
- void SetElnoAssembleState( bool theIsRestorePoints );
-
-protected:
- VISU_ElnoAssembleFilter();
- ~VISU_ElnoAssembleFilter();
-
- int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
-
- bool myIsRestorePoints;
-
-private:
- VISU_ElnoAssembleFilter(const VISU_ElnoAssembleFilter&); // Not implemented.
- void operator=(const VISU_ElnoAssembleFilter&); // Not implemented.
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
-#include "VISU_ElnoDisassembleFilter.hxx"
-#include "VISU_PipeLineUtils.hxx"
-#include "VISU_ElnoMeshValue.hxx"
-
-#include <vtkCellData.h>
-#include <vtkInformation.h>
-#include <vtkInformationVector.h>
-#include <vtkObjectFactory.h>
-#include <vtkPointData.h>
-#include <vtkUnstructuredGrid.h>
-#include <vtkPoints.h>
-#include <vtkCellArray.h>
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro( VISU_ElnoDisassembleFilter );
-
-
-//----------------------------------------------------------------------------
-VISU_ElnoDisassembleFilter::VISU_ElnoDisassembleFilter()
-{
- this->SetInputArrayToProcess( 0, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
- "ELNO_FIELD" ); // name
-
- this->SetInputArrayToProcess( 1, // idx
- 0, // port
- 0, // connection
- vtkDataObject::FIELD_ASSOCIATION_CELLS, // field association
- "ELNO_COMPONENT_MAPPER" ); // name
-
- this->myShrinkFactor = -0.999;
-}
-
-
-//----------------------------------------------------------------------------
-VISU_ElnoDisassembleFilter::~VISU_ElnoDisassembleFilter()
-{}
-
-
-//----------------------------------------------------------------------------
-void VISU_ElnoDisassembleFilter::SetShrinkFactor( vtkFloatingPointType theValue )
-{
- if ( VISU::CheckIsSameValue( theValue, myShrinkFactor ) )
- return;
-
- myShrinkFactor = theValue;
- this->Modified();
-}
-
-
-//----------------------------------------------------------------------------
-vtkFloatingPointType VISU_ElnoDisassembleFilter::GetShrinkFactor()
-{
- return myShrinkFactor;
-}
-
-
-//----------------------------------------------------------------------------
-namespace
-{
- //----------------------------------------------------------------------------
- template < int points_type, int elno_type >
- struct TExecute2
- {
- vtkUnstructuredGrid *myInput;
- vtkUnstructuredGrid *myOutput;
- vtkDataArray *myElnoDataArray;
- vtkDataArray *myElnoDataMapper;
- vtkFloatingPointType myShrinkFactor;
-
- typedef typename VISU::TL::TEnum2VTKArrayType< points_type >::TResult TPointsDataArray;
- typedef typename VISU::TL::TEnum2VTKBasicType< points_type >::TResult TPointsDataType;
-
- typedef typename VISU::TL::TEnum2VTKArrayType< elno_type >::TResult TElnoDataArray;
- typedef typename VISU::TL::TEnum2VTKBasicType< elno_type >::TResult TElnoDataType;
-
- VISU::TGetElnoNodeData< elno_type > myGetElnoNodeData;
- vtkCellArray *myConnectivity;
- vtkPointData *myInputPointData;
- vtkPointData *myOutputPointData;
- TPointsDataArray *myInputPointsArray;
- TPointsDataArray *myOutputPointsArray;
- TElnoDataArray* myElnoFullDataArray;
- TElnoDataArray* myElnoPartialDataArray;
- TPointsDataArray *myElnoPointCoords;
- vtkIntArray* myInputPointsMapper;
- vtkIntArray* myOutputPointsMapper;
-
- //----------------------------------------------------------------------------
- TExecute2( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
- : myGetElnoNodeData( theElnoDataArray, theElnoDataMapper )
- , myInput( theInput )
- , myOutput( theOutput )
- , myElnoDataArray( theElnoDataArray )
- , myElnoDataMapper( theElnoDataMapper )
- , myShrinkFactor( theShrinkFactor )
- {
- myConnectivity = vtkCellArray::New();
- myConnectivity->DeepCopy( theInput->GetCells() );
-
- vtkPoints *anInputPoints = theInput->GetPoints();
- vtkPoints *aPoints = anInputPoints->New( anInputPoints->GetDataType() );
- vtkIdType aNbCells = myConnectivity->GetNumberOfCells();
- vtkIdType aNbPoints = myConnectivity->GetNumberOfConnectivityEntries() - aNbCells;
- aPoints->Allocate( aNbPoints );
-
- myInputPointsArray = TPointsDataArray::SafeDownCast( anInputPoints->GetData() );
- myOutputPointsArray = TPointsDataArray::SafeDownCast( aPoints->GetData() );
-
- myInputPointData = theInput->GetPointData();
- myOutputPointData = theOutput->GetPointData();
- myOutputPointData->Allocate( aNbPoints );
-
- vtkCellData *anInputCellData = theInput->GetCellData();
-
- // To create a new copy of initial data for output
- myElnoFullDataArray = TElnoDataArray::New();
- myElnoFullDataArray->SetName( "VISU_FIELD" );
- myElnoFullDataArray->SetNumberOfComponents( myGetElnoNodeData.getNbComp() );
- myElnoFullDataArray->SetNumberOfTuples( aNbPoints );
-
- // To create a new copy of partial initial data for output
- myElnoPartialDataArray = TElnoDataArray::New();
- // This partial data can be represented as in terms of vectors as scalars
- if ( anInputCellData->GetVectors() != NULL )
- myElnoPartialDataArray->SetNumberOfComponents( 3 );
- else
- myElnoPartialDataArray->SetNumberOfComponents( 1 );
- myElnoPartialDataArray->SetNumberOfTuples( aNbPoints );
-
- myElnoPointCoords = TPointsDataArray::New();
- myElnoPointCoords->SetName( "ELNO_POINT_COORDS" );
- myElnoPointCoords->SetNumberOfComponents( 3 );
- myElnoPointCoords->SetNumberOfTuples( aNbPoints );
-
- vtkDataArray* anArray = myInputPointData->GetArray( "VISU_POINTS_MAPPER" );
- myInputPointsMapper = vtkIntArray::SafeDownCast( anArray );
-
- myOutputPointsMapper = vtkIntArray::New();
- myOutputPointsMapper->SetName( myInputPointsMapper->GetName() );
- myOutputPointsMapper->SetNumberOfComponents( myInputPointsMapper->GetNumberOfComponents() );
- myOutputPointsMapper->SetNumberOfTuples( aNbPoints );
-
- if ( theShrinkFactor > 0.0 )
- this->ShrinkExecute();
- else
- this->SimpleExecute();
-
- theOutput->SetPoints( aPoints );
-
- theOutput->SetCells( theInput->GetCellTypesArray(),
- theInput->GetCellLocationsArray(),
- myConnectivity );
-
- myConnectivity->Delete();
-
- vtkCellData *anOutputCellData = theOutput->GetCellData();
- anOutputCellData->PassData( anInputCellData );
-
- anOutputCellData->RemoveArray( "ELNO_COMPONENT_MAPPER" );
- anOutputCellData->RemoveArray( "ELNO_FIELD" );
- anOutputCellData->RemoveArray( "VISU_FIELD" );
- anOutputCellData->SetVectors( NULL );
-
- //anOutputPointData->PassData( anInputPointData );
-
- myOutputPointData->AddArray( myElnoFullDataArray );
- myElnoFullDataArray->Delete();
-
- if ( anInputCellData->GetVectors() != NULL )
- myOutputPointData->SetVectors( myElnoPartialDataArray );
- else
- myOutputPointData->SetScalars( myElnoPartialDataArray );
- myElnoPartialDataArray->Delete();
-
- myOutputPointData->AddArray( myElnoPointCoords );
- myElnoPointCoords->Delete();
-
- myOutputPointData->AddArray( myOutputPointsMapper );
- myOutputPointsMapper->Delete();
- }
-
- //----------------------------------------------------------------------------
- void SimpleExecute()
- {
- // To reserve a temproary value holder
- vtkIdType aNbComp = std::max( 3, myGetElnoNodeData.getNbComp() );
- std::vector< TElnoDataType > anElnoDataValues( aNbComp );
-
- std::vector< int > anPointsMapperValues( myInputPointsMapper->GetNumberOfComponents() );
-
- myConnectivity->InitTraversal();
- vtkIdType aNbPts = 0, *aPts = 0;
- for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
- for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- vtkIdType aCurrentPntId = aPts[ aPntId ];
- myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
-
- aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aCoords );
- vtkIdType aNewPntId = aPts[ aPntId ];
-
- myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
-
- myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
-
- TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
- myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
-
- myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
- myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
-
- myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
- myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
- }
- }
- }
-
- //----------------------------------------------------------------------------
- void ShrinkExecute()
- {
- // To reserve a temproary value holder
- vtkIdType aNbComp = std::max( 3, myGetElnoNodeData.getNbComp() );
- std::vector< TElnoDataType > anElnoDataValues( aNbComp );
-
- std::vector< int > anPointsMapperValues( myInputPointsMapper->GetNumberOfComponents() );
-
- myConnectivity->InitTraversal();
- vtkIdType aNbPts = 0, *aPts = 0;
- for ( vtkIdType aCellId = 0; myConnectivity->GetNextCell( aNbPts, aPts ); aCellId++ ) {
-
- TPointsDataType aCenter[ 3 ] = { TPointsDataType(), TPointsDataType(), TPointsDataType() };
-
- for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- myInputPointsArray->GetTupleValue( aPts[ aPntId ], aCoords );
-
- aCenter[ 0 ] += aCoords[ 0 ];
- aCenter[ 1 ] += aCoords[ 1 ];
- aCenter[ 2 ] += aCoords[ 2 ];
- }
-
- aCenter[ 0 ] /= aNbPts;
- aCenter[ 1 ] /= aNbPts;
- aCenter[ 2 ] /= aNbPts;
-
- for ( vtkIdType aPntId = 0; aPntId < aNbPts; aPntId++ ) {
- TPointsDataType aCoords[ 3 ];
- vtkIdType aCurrentPntId = aPts[ aPntId ];
- myInputPointsArray->GetTupleValue( aCurrentPntId, aCoords );
-
- TPointsDataType aNewCoords[ 3 ];
-
- aNewCoords[ 0 ] = aCenter[ 0 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 0 ] - aCenter[ 0 ] ) );
- aNewCoords[ 1 ] = aCenter[ 1 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 1 ] - aCenter[ 1 ] ) );
- aNewCoords[ 2 ] = aCenter[ 2 ] +
- TPointsDataType( myShrinkFactor * ( aCoords[ 2 ] - aCenter[ 2 ] ) );
-
- aPts[ aPntId ] = myOutputPointsArray->InsertNextTupleValue( aNewCoords );
- vtkIdType aNewPntId = aPts[ aPntId ];
-
- myElnoPointCoords->SetTupleValue( aNewPntId, aCoords );
-
- myOutputPointData->CopyData( myInputPointData, aCurrentPntId, aNewPntId );
-
- TElnoDataType* anElnoData = myGetElnoNodeData( aCellId, aPntId );
- myElnoFullDataArray->SetTupleValue( aNewPntId, anElnoData );
-
- myElnoFullDataArray->GetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
- myElnoPartialDataArray->SetTupleValue( aNewPntId, &anElnoDataValues[ 0 ] );
-
- myInputPointsMapper->GetTupleValue( aCurrentPntId, &anPointsMapperValues[ 0 ] );
- myOutputPointsMapper->SetTupleValue( aNewPntId, &anPointsMapperValues[ 0 ] );
- }
- }
- }
- };
-
-
- //----------------------------------------------------------------------------
- template < int points_type, int elno_type >
- int Execute2( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
- {
- TExecute2< points_type, elno_type >( theInput,
- theOutput,
- theElnoDataArray,
- theElnoDataMapper,
- theShrinkFactor );
-
- return 1;
- }
-
-
- //----------------------------------------------------------------------------
- template < int points_type >
- int Execute( vtkUnstructuredGrid *theInput,
- vtkUnstructuredGrid *theOutput,
- vtkDataArray *theElnoDataArray,
- vtkDataArray *theElnoDataMapper,
- vtkFloatingPointType theShrinkFactor )
- {
- switch( theElnoDataArray->GetDataType() ){
- case VTK_DOUBLE:
- return Execute2< points_type, VTK_DOUBLE >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
- case VTK_FLOAT:
- return Execute2< points_type, VTK_FLOAT >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
- case VTK_INT:
- return Execute2< points_type, VTK_INT >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
- case VTK_LONG:
- return Execute2< points_type, VTK_LONG >
- ( theInput, theOutput, theElnoDataArray, theElnoDataMapper, theShrinkFactor );
- default:
- break;
- }
-
- return 0;
- }
-
-
- //----------------------------------------------------------------------------
-}
-
-
-//----------------------------------------------------------------------------
-int VISU_ElnoDisassembleFilter::RequestData( vtkInformation *vtkNotUsed(request),
- vtkInformationVector **inputVector,
- vtkInformationVector *outputVector )
-{
- // get the info objects
- vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
- vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
- // get the input and ouptut
- vtkUnstructuredGrid *anInput =
- vtkUnstructuredGrid::SafeDownCast( inInfo->Get( vtkDataObject::DATA_OBJECT() ) );
- vtkUnstructuredGrid *anOutput =
- vtkUnstructuredGrid::SafeDownCast( outInfo->Get( vtkDataObject::DATA_OBJECT() ) );
-
- vtkDataArray *anElnoDataArray = this->GetInputArrayToProcess( 0, inputVector );
- vtkDataArray *anElnoDataMapper = this->GetInputArrayToProcess( 1, inputVector );
-
- if ( !anElnoDataArray ) {
- anOutput->ShallowCopy( anInput );
- return 1;
- }
-
- vtkPoints *aPoints = anInput->GetPoints();
- switch( aPoints->GetDataType() ){
- case VTK_DOUBLE:
- return ::Execute< VTK_DOUBLE >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor );
- case VTK_FLOAT:
- return ::Execute< VTK_FLOAT >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor );
- case VTK_INT:
- return ::Execute< VTK_INT >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor );
- case VTK_LONG:
- return ::Execute< VTK_LONG >( anInput, anOutput, anElnoDataArray, anElnoDataMapper, myShrinkFactor );
- default:
- break;
- }
-
- return 0;
-}
-
-
-//----------------------------------------------------------------------------
+++ /dev/null
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
-#ifndef VISU_ElnoDisassembleFilter_H
-#define VISU_ElnoDisassembleFilter_H
-
-#include "VISUPipeline.hxx"
-
-#include <vtkUnstructuredGridAlgorithm.h>
-
-class VISU_PIPELINE_EXPORT VISU_ElnoDisassembleFilter : public vtkUnstructuredGridAlgorithm
-{
-public:
- typedef vtkUnstructuredGridAlgorithm Superclass;
-
- static VISU_ElnoDisassembleFilter *New();
-
- void SetShrinkFactor( vtkFloatingPointType theValue );
- vtkFloatingPointType GetShrinkFactor();
-
-protected:
- VISU_ElnoDisassembleFilter();
- ~VISU_ElnoDisassembleFilter();
-
- int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
-
- vtkFloatingPointType myShrinkFactor;
-
-private:
- VISU_ElnoDisassembleFilter(const VISU_ElnoDisassembleFilter&); // Not implemented.
- void operator=(const VISU_ElnoDisassembleFilter&); // Not implemented.
-};
-
-#endif
myMergeFilter(VISU_GaussMergeFilter::New())
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myWarpVector = vtkWarpVector::New();
{
Superclass::Init();
- SetExtractInside(false);
+ //SetExtractInside(false);
vtkDataSet* aDataSet = GetParentMesh();
vtkFloatingPointType aScaleFactor = VISU_DeformedShapePL::GetScaleFactor( aDataSet );
::VISU_IsoSurfacesPL()
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
SetElnoDisassembleState( true );
//----------------------------------------------------------------------------
void
VISU_IsoSurfacesPL
-::SetScalarRange(vtkFloatingPointType theRange[2])
+::SetScalarRange( vtkFloatingPointType theRange[2] )
{
- Superclass::SetScalarRange(theRange);
+ Superclass::SetScalarRange( theRange );
SetRange(myRange);
}
virtual
void
- SetScalarRange(vtkFloatingPointType theRange[2]);
+ SetScalarRange( vtkFloatingPointType theRange[2] );
virtual
void
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File: VISU_LabelPointsFilter.cxx
-// Author: Vitaly Smetannikov
-// Module : VISU
-
-
-
-#include "VISU_LabelPointsFilter.hxx"
-
-#include <vtkPolyData.h>
-#include <vtkObjectFactory.h>
-#include <vtkInformation.h>
-#include <vtkInformationVector.h>
-#include <vtkFeatureEdges.h>
-#include <vtkCellArray.h>
-#include <vtkPointData.h>
-#include <vtkCellData.h>
-#include <vtkDataArray.h>
-#include <vtkDoubleArray.h>
-#include <vtkGeometryFilter.h>
-#include <vtkPolyDataConnectivityFilter.h>
-#include <vtkMath.h>
-
-#include <set>
-#include <vector>
-
-
-#define CONTAINS(SET, PT) (SET.find(PT) != SET.end())
-
-struct ltIdType
-{
- bool operator()(const vtkIdType a1, const vtkIdType a2) const
- {
- return a1 < a2;
- }
-};
-
-
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(VISU_LabelPointsFilter);
-
-
-//----------------------------------------------------------------------------
-void VISU_LabelPointsFilter::SetPointsNb(int theNb)
-{
- if (myPointsNb == theNb) return;
- myPointsNb = (theNb < 1)? 1:theNb;
- Modified();
-}
-
-//----------------------------------------------------------------------------
-VISU_LabelPointsFilter::VISU_LabelPointsFilter():
- vtkPolyDataAlgorithm(),
- myPointsNb(3)
-{
-}
-
-//----------------------------------------------------------------------------
-VISU_LabelPointsFilter::~VISU_LabelPointsFilter()
-{}
-
-
-
-//----------------------------------------------------------------------------
-int VISU_LabelPointsFilter::RequestData(vtkInformation* vtkNotUsed(request),
- vtkInformationVector** inputVector,
- vtkInformationVector* outputVector)
-{
- // get the info objects
- vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
- vtkInformation* outInfo = outputVector->GetInformationObject(0);
-
- // get the input and ouptut
- vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
- vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
-
- GetRegions(input, output);
-
- return 1;
-}
-
-int VISU_LabelPointsFilter::RequestUpdateExtent(vtkInformation* vtkNotUsed(request),
- vtkInformationVector** inputVector,
- vtkInformationVector* outputVector)
-{
- // get the info objects
- vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
- vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
- vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
- vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
-
- GetRegions(input, output);
- return 1;
-}
-
-
-
-int VISU_LabelPointsFilter::GetRegions(vtkPolyData* theInput,
- vtkPolyData* theOutput)
-{
- vtkIdType cellId, i;
- vtkIdType numPts, numCells;
- vtkPoints *inPts;
-
- vtkPointData *aInpPD=theInput->GetPointData(), *aOutPD=theOutput->GetPointData();
- vtkCellData *aInpCD=theInput->GetCellData(), *aOutCD=theOutput->GetCellData();
-
- // Check input/allocate storage
- //
- inPts = theInput->GetPoints();
-
- if (inPts == NULL)
- return 1;
-
- numPts = inPts->GetNumberOfPoints();
- numCells = theInput->GetNumberOfCells();
-
- if ( numPts < 1 || numCells < 1 )
- return 1;
-
- // Build cell structure
- //
- vtkPolyData* aMesh = vtkPolyData::New();
- aMesh->CopyStructure(theInput);
- aMesh->BuildLinks();
-
- // Initialize. Keep track of points and cells visited.
- //
- vtkIdTypeArray* aRegionSizes = vtkIdTypeArray::New();
- int* aVisited = new int[numCells];
- for ( i=0; i < numCells; i++ )
- aVisited[i] = -1;
-
- vtkIdType* aPointMap = new vtkIdType[numPts];
- for ( i=0; i < numPts; i++ )
- aPointMap[i] = -1;
-
- vtkPoints* newPts = vtkPoints::New();
- newPts->Allocate(numPts);
-
- // Traverse all cells marking those visited. Each new search
- // starts a new connected region. Connected region grows
- // using a connected wave propagation.
- //
- vtkIdList* aWave = vtkIdList::New();
- aWave->Allocate(numPts/4+1,numPts);
- vtkIdList* aWave2 = vtkIdList::New();
- aWave2->Allocate(numPts/4+1,numPts);
-
- vtkIdType aPointNumber = 0;
- int aRegionNumber = 0;
-
- vtkIdList* aCellIds = vtkIdList::New();
- aCellIds->Allocate(8, VTK_CELL_SIZE);
- vtkIdList* aPointIds = vtkIdList::New();
- aPointIds->Allocate(8, VTK_CELL_SIZE);
-
- // vtkIdType aNumCellsInRegion;
-
- aOutPD->CopyAllocate(aInpPD);
- aOutCD->CopyAllocate(aInpCD);
-
- //visit all cells marking with region number
- for (cellId=0; cellId < numCells; cellId++) {
- if ( aVisited[cellId] < 0 ) {
- aWave->InsertNextId(cellId);
- aPointNumber = 0;
- TraverseAndMark(aWave, aWave2, aVisited, aPointMap,
- aRegionNumber, aPointNumber, aMesh);
-
- if (aPointNumber >= myPointsNb) {
- std::set<vtkIdType, ltIdType> aIdxSet;
- for (i=0; i < numPts; i++) {
- if ( aPointMap[i] > -1 ) {
- aIdxSet.insert(i);
- aPointMap[i] = -1;
- }
- }
- std::vector<vtkIdType> aIdx(aIdxSet.begin(), aIdxSet.end());
- int aActualPts = aIdx.size();
- int aNewId;
- if (myPointsNb > 2) {
- int k = aActualPts/(myPointsNb - 1);
- int count;
- for (i=0, count = 0; i < aActualPts; i+=k, count++) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[i]));
- aOutPD->CopyData(aInpPD, aIdx[i], aNewId);
- }
- if (count < myPointsNb) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
- aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
- }
- } else {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[0]));
- aOutPD->CopyData(aInpPD, aIdx[0], aNewId);
- if (myPointsNb == 2) {
- aNewId = newPts->InsertNextPoint(inPts->GetPoint(aIdx[aActualPts - 1]));
- aOutPD->CopyData(aInpPD, aIdx[aActualPts - 1], aNewId);
- }
- }
- }
- aWave->Reset();
- aWave2->Reset();
- }
- }
-
- aWave->Delete();
- aWave2->Delete();
-
- theOutput->SetPoints(newPts);
- newPts->Delete();
-
-
- delete [] aVisited;
- delete [] aPointMap;
- aMesh->Delete();
- theOutput->Squeeze();
- aCellIds->Delete();
- aPointIds->Delete();
-
- return aRegionSizes->GetMaxId() + 1;
-}
-
-
-// Mark current cell as visited and assign region number. Note:
-// traversal occurs across shared vertices.
-//
-void VISU_LabelPointsFilter::TraverseAndMark (vtkIdList* theWave,
- vtkIdList* theWave2,
- int* theVisited,
- vtkIdType* thePointMap,
- int& theRegionNumber,
- vtkIdType& thePointNumber,
- vtkPolyData* theMesh)
-{
- vtkIdType cellId, ptId, numIds, i;
- int j, k;
- vtkIdType *pts, *cells, npts;
- vtkIdList *tmpWave;
- unsigned short ncells;
- vtkIdList* aNeighborCellPointIds = vtkIdList::New();
-
-
- while ( (numIds=theWave->GetNumberOfIds()) > 0 ) {
- for ( i=0; i < numIds; i++ ) {
- cellId = theWave->GetId(i);
- if ( theVisited[cellId] < 0 ) {
- theVisited[cellId] = theRegionNumber;
- theMesh->GetCellPoints(cellId, npts, pts);
-
- for (j=0; j < npts; j++) {
- if ( thePointMap[ptId=pts[j]] < 0 ) {
- thePointMap[ptId] = thePointNumber++;
- }
- theMesh->GetPointCells(ptId,ncells,cells);
-
- // check connectivity criterion (geometric + scalar)
- for (k=0; k < ncells; k++) {
- cellId = cells[k];
- theWave2->InsertNextId(cellId);
- // }
- }//for all cells using this point
- }//for all points of this cell
- }//if cell not yet visited
- }//for all cells in this wave
-
- tmpWave = theWave;
- theWave = theWave2;
- theWave2 = tmpWave;
- tmpWave->Reset();
- } //while wave is not empty
-}
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File: VISU_LabelPointsFilter.hxx
-// Author: Vitaly Smetannikov
-// Module : VISU
-
-#ifndef VISU_LabelPointsFilter_HeaderFile
-#define VISU_LabelPointsFilter_HeaderFile
-
-#include "VISUPipeline.hxx"
-#include <vtkPolyDataAlgorithm.h>
-
-class vtkPolyData;
-
-class VISU_PIPELINE_EXPORT VISU_LabelPointsFilter : public vtkPolyDataAlgorithm
-{
-public:
- vtkTypeMacro(VISU_LabelPointsFilter, vtkPolyDataAlgorithm);
-
- static VISU_LabelPointsFilter* New();
-
- void SetPointsNb(int theNb);
-
- int GetPointsNb() const { return myPointsNb; }
-
-protected:
- VISU_LabelPointsFilter();
-
- virtual ~VISU_LabelPointsFilter();
-
- virtual int RequestData(vtkInformation* request,
- vtkInformationVector** inputVector,
- vtkInformationVector* outputVector);
-
- virtual int RequestUpdateExtent(vtkInformation*,
- vtkInformationVector**,
- vtkInformationVector*);
-
-
- void TraverseAndMark (vtkIdList* theWave,
- vtkIdList* theWave2,
- int* theVisited,
- vtkIdType* thePointMap,
- int& theRegionNumber,
- vtkIdType& thePointNumber,
- vtkPolyData* theMesh);
-
- int GetRegions(vtkPolyData* theInput,
- vtkPolyData* theOutput);
-
- int myPointsNb;
-
-};
-
-
-#endif
using namespace std;
+
+//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_LookupTable);
+
+//----------------------------------------------------------------------------
VISU_LookupTable
::VISU_LookupTable(int sze, int ext):
vtkLookupTable(sze, ext),
myBicolor(false)
{}
+//----------------------------------------------------------------------------
+namespace
+{
+ inline
+ void
+ CopyColor( unsigned char* theTaget, const unsigned char* theSource )
+ {
+ theTaget[0] = theSource[0];
+ theTaget[1] = theSource[1];
+ theTaget[2] = theSource[2];
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_LookupTable
+::MarkValueByColor( vtkFloatingPointType theValue,
+ unsigned char* theColor )
+{
+ vtkIdType anIndex = this->GetIndex( theValue );
+ unsigned char *aTablePtr = this->GetPointer( anIndex );
+ CopyColor( aTablePtr, theColor );
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_LookupTable
+::FillByColor( unsigned char* theColor )
+{
+ vtkIdType aNbColors = this->GetNumberOfColors();
+ for(int i = 0; i < aNbColors; i++){
+ unsigned char *aTablePtr = this->GetPointer(i);
+ CopyColor( aTablePtr, theColor );
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_LookupTable
+::MakeBiColor()
+{
+ unsigned char aRedPtr[3] = {255, 0, 0};
+ unsigned char aBluePtr[3] = {0, 0, 255};
+
+ vtkFloatingPointType aRange[2];
+ this->GetTableRange(aRange);
+ vtkIdType aNbColors = this->GetNumberOfColors();
+
+ vtkFloatingPointType aDelta = (aRange[1]-aRange[0])/aNbColors;
+ vtkFloatingPointType aValue = aRange[0]+0.5*aDelta;
+ for(int i = 0; i < aNbColors; i++){
+ vtkIdType anIndex = this->GetIndex(aValue);
+ unsigned char* aTablePtr = this->GetPointer(anIndex);
+ if(aValue > 0.0){
+ CopyColor(aTablePtr,aRedPtr);
+ }else{
+ CopyColor(aTablePtr,aBluePtr);
+ }
+ aValue += aDelta;
+ }
+}
+
+
+//----------------------------------------------------------------------------
void
VISU_LookupTable
::SetMapScale(vtkFloatingPointType theScale)
#ifndef VISU_LookupTable_H
#define VISU_LookupTable_H
+#include "VISUPipeline.hxx"
+
#include <vtkLookupTable.h>
#include "VTKViewer.h"
-class VISU_LookupTable: public vtkLookupTable
+class VISU_PIPELINE_EXPORT VISU_LookupTable: public vtkLookupTable
{
public:
vtkTypeMacro(VISU_LookupTable,vtkLookupTable);
bool GetBicolor() { return myBicolor; }
void SetBicolor( bool theBicolor );
- static int ComputeLogRange(vtkFloatingPointType inRange[2], vtkFloatingPointType outRange[2]);
- unsigned char *MapValue(vtkFloatingPointType v);
+ static int ComputeLogRange( vtkFloatingPointType inRange[2],
+ vtkFloatingPointType outRange[2] );
+
+ unsigned char *MapValue(vtkFloatingPointType v);
+
+ void MarkValueByColor( vtkFloatingPointType theValue,
+ unsigned char* theColor );
+
+ void FillByColor( unsigned char* theColor );
+
+ void MakeBiColor();
protected:
VISU_LookupTable(int sze=256, int ext=256);
vtkPlane*
GetClippingPlane(vtkIdType theID) = 0;
+ virtual void RemoveClippingPlane(vtkIdType theID) = 0;
+
//----------------------------------------------------------------------------
virtual
void
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File: VISU_MergedPL.cxx
-// Author: Alexey PETROV
-// Module : VISU
-
-
-#include "VISU_MergedPL.hxx"
-#include "VISU_PipeLine.hxx"
-
-
-//----------------------------------------------------------------------------
-void
-VISU_MergedPL
-::DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput)
-{
- if(VISU_MergedPL *aPipeLine = dynamic_cast<VISU_MergedPL*>(thePipeLine)){
- if ( this == aPipeLine )
- return;
-
- if ( aPipeLine->IsExternalGeometryUsed() ) {
- ClearGeometry();
- int aNbOfGeometry = aPipeLine->GetNumberOfGeometry();
- for ( int aGeomNumber = 0; aGeomNumber < aNbOfGeometry; aGeomNumber++ )
- AddGeometry( aPipeLine->GetGeometry( aGeomNumber ) );
- }else
- SetSourceGeometry();
- }
-}
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File: VISU_MergedPL.hxx
-// Author: Alexey PETROV
-// Module : VISU
-
-#ifndef VISU_MergedPL_HeaderFile
-#define VISU_MergedPL_HeaderFile
-
-#include "VISUPipeline.hxx"
-
-class vtkDataSet;
-class vtkPointSet;
-class VISU_PipeLine;
-
-
-//----------------------------------------------------------------------------
-struct VISU_PIPELINE_EXPORT VISU_MergedPL
-{
- virtual
- void
- SetSourceGeometry() = 0;
-
- virtual
- int
- AddGeometry( vtkDataSet* theGeometry ) = 0;
-
- virtual
- vtkDataSet*
- GetGeometry( int theGeomNumber ) = 0;
-
- virtual
- int
- GetNumberOfGeometry() = 0;
-
- virtual
- bool
- IsExternalGeometryUsed() = 0;
-
- virtual
- void
- ClearGeometry() = 0;
-
- virtual
- vtkPointSet*
- GetMergedInput() = 0;
-
- virtual
- void
- DoShallowCopy(VISU_PipeLine *thePipeLine,
- bool theIsCopyInput);
-};
-
-#endif
VISU_UnstructuredGridPL(this)
{
SetIsShrinkable(true);
+ SetIsFeatureEdgesAllowed(true);
}
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File: VISU_ScalarMapPL.cxx
-// Author: Roman NIKOLAEV
-// Module : VISU
-
-//Salome includes
-#include "VISU_OptionalDeformationPL.hxx"
-#include "VISU_PipeLineUtils.hxx"
-
-//VTK includes
-#include <vtkDataSet.h>
-#include <vtkPassThroughFilter.h>
-#include <vtkWarpVector.h>
-#include <vtkCellDataToPointData.h>
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-//----------------------------------------------------------------------------
-VISU_OptionalDeformationPL::VISU_OptionalDeformationPL():
- VISU_DeformationPL(),
- myIsDeformed(true)
-{
- if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::VISU_OptionalDeformationPL() - "<<this);
-}
-
-//----------------------------------------------------------------------------
-VISU_OptionalDeformationPL::~VISU_OptionalDeformationPL()
-{
- if(MYDEBUG) MESSAGE("VISU_OptionalDeformationPL()::~VISU_OptionalDeformationPL() - "<<this);
-}
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU_OptionalDeformationPL::GetMTime(){
- return Superclass::GetMTime();
-}
-
-//----------------------------------------------------------------------------
-void VISU_OptionalDeformationPL::UseDeformation(bool flag){
- if(myIsDeformed == flag)
- return;
-
- myIsDeformed = flag;
- if(myIsDeformed)
- OnDeformation();
- else
- OffDeformation();
-}
-
-//----------------------------------------------------------------------------
-bool VISU_OptionalDeformationPL::IsDeformed(){
- return myIsDeformed;
-}
-
-//----------------------------------------------------------------------------
-void VISU_OptionalDeformationPL::OnDeformation(){
-
- myCellDataToPointData->SetInput(myInputPassFilter->GetOutput());
- myWarpVector->SetInput(myCellDataToPointData->GetOutput());
- myOutputPassFiler->SetInput(myWarpVector->GetOutput());
-}
-
-//----------------------------------------------------------------------------
-void VISU_OptionalDeformationPL::OffDeformation(){
- myOutputPassFiler->SetInput(myInputPassFilter->GetOutput());
-}
-
-
-
-bool VISU_OptionalDeformationPL::CheckCanDeformate(vtkDataSet* theInput){
- if(theInput) {
- if(VISU::IsDataOnCells(theInput))
- return theInput->GetCellData()->GetVectors() != NULL;
- else if(VISU::IsDataOnPoints(theInput))
- return theInput->GetPointData()->GetVectors() != NULL;
- }
- return false;
-}
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VISU_OptionalDeformationPL.hxx
-// Author :
-// Module : SALOME
-
-#ifndef VISU_OptionalDeformationPL_HeaderFile
-#define VISU_OptionalDeformationPL_HeaderFile
-
-#include "VISUPipeline.hxx"
-#include "VISU_DeformationPL.hxx"
-
-class VISU_PIPELINE_EXPORT VISU_OptionalDeformationPL: public VISU_DeformationPL
-{
-public:
- VISU_OptionalDeformationPL();
- virtual ~VISU_OptionalDeformationPL();
-
- typedef VISU_DeformationPL Superclass;
-
- void UseDeformation(bool flag);
- bool IsDeformed();
-
- virtual
- unsigned
- long int
- GetMTime();
-
-protected:
- bool CheckCanDeformate(vtkDataSet* theInput);
-
-private:
- void OnDeformation();
- void OffDeformation();
-
-private:
- bool myIsDeformed;
-};
-
-#endif
//----------------------------------------------------------------------------
VISU_PipeLine
::VISU_PipeLine():
- myIsShrinkable(true)
+ myIsShrinkable(true),
+ myIsFeatureEdgesAllowed(true)
{
if(MYDEBUG) MESSAGE("VISU_PipeLine::VISU_PipeLine - "<<this);
}
}
+//----------------------------------------------------------------------------
+bool
+VISU_PipeLine
+::IsFeatureEdgesAllowed()
+{
+ return myIsFeatureEdgesAllowed;
+}
+
+void
+VISU_PipeLine
+::SetIsFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed)
+{
+ if(myIsFeatureEdgesAllowed == theIsFeatureEdgesAllowed)
+ return;
+
+ myIsFeatureEdgesAllowed = theIsFeatureEdgesAllowed;
+ Modified();
+}
+
+
//----------------------------------------------------------------------------
void
VISU_PipeLine
return GetMapperHolder()->GetClippingPlane(theID);
}
+//----------------------------------------------------------------------------
+void VISU_PipeLine::RemoveClippingPlane(vtkIdType theID)
+{
+ return GetMapperHolder()->RemoveClippingPlane(theID);
+}
+
//----------------------------------------------------------------------------
vtkDataSet*
VISU_PipeLine
bool
IsShrinkable();
+ bool
+ IsFeatureEdgesAllowed();
+
//----------------------------------------------------------------------------
void
SetImplicitFunction(vtkImplicitFunction *theFunction);
vtkPlane*
GetClippingPlane(vtkIdType theID);
+ virtual void RemoveClippingPlane(vtkIdType theID);
+
virtual
void
SetPlaneParam(vtkFloatingPointType theDir[3],
void
SetIsShrinkable(bool theIsShrinkable);
+ void
+ SetIsFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
+
private:
//----------------------------------------------------------------------------
vtkSmartPointer<VISU_MapperHolder> myMapperHolder;
bool myIsShrinkable;
+ bool myIsFeatureEdgesAllowed;
};
#endif
myMapScaleFactor(1.0)
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myCellDataToPointData->Delete();
myAppendPolyData->Delete();
#include "VISU_OpenGLPointSpriteMapper.hxx"
#include "VISU_PipeLineUtils.hxx"
+#include "SALOME_ExtractPolyDataGeometry.h"
#ifdef _DEBUG_
static int MYDEBUG = 0;
VISU::CopyPointSpriteDataMapper(GetPointSpriteMapper(),
aMapperHolder->GetPointSpriteMapper(),
theIsCopyInput);
+ myExtractPolyDataGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
#include <vtkImplicitFunction.h>
#include <vtkImplicitFunctionCollection.h>
#include <vtkMath.h>
+//#include <vtkExtractPolyDataGeometry.h>
#ifdef _DEBUG_
static int MYDEBUG = 0;
myExtractPolyDataGeometry->SetImplicitFunction(anImplicitBoolean);
anImplicitBoolean->SetOperationTypeToIntersection();
anImplicitBoolean->Delete();
+ //myExtractPolyDataGeometry->ExtractInsideOn();
}
VISU::CopyPolyDataMapper(GetPolyDataMapper(),
aMapperHolder->GetPolyDataMapper(),
theIsCopyInput);
+ myExtractPolyDataGeometry->SetImplicitFunction(aMapperHolder->GetImplicitFunction());
}
}
if (vtkImplicitBoolean* aBoolean = myExtractPolyDataGeometry->GetImplicitBoolean()) {
vtkImplicitFunctionCollection* aFunction = aBoolean->GetFunction();
aFunction->AddItem(thePlane);
+ aBoolean->Modified();
// Check, that at least one cell present after clipping.
// This check was introduced because of bug IPAL8849.
vtkDataSet* aClippedDataSet = GetClippedInput();
return aPlane;
}
+//----------------------------------------------------------------------------
+void VISU_PolyDataMapperHolder::RemoveClippingPlane(vtkIdType theID)
+{
+ if(theID >= 0 && theID < GetNumberOfClippingPlanes()){
+ if(vtkImplicitBoolean* aBoolean = myExtractPolyDataGeometry->GetImplicitBoolean()){
+ vtkImplicitFunctionCollection* aFunctions = aBoolean->GetFunction();
+ aFunctions->RemoveItem(theID);
+ aBoolean->Modified();
+ }
+ }
+}
+
//----------------------------------------------------------------------------
void
VISU_PolyDataMapperHolder
virtual
vtkPlane*
GetClippingPlane(vtkIdType theID);
+
+ void RemoveClippingPlane(vtkIdType theID);
protected:
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
VISU::PPolyDataIDMapper myPolyDataIDMapper;
vtkSmartPointer<vtkPolyDataMapper> myPolyDataMapper;
+
+protected:
vtkSmartPointer<SALOME_ExtractPolyDataGeometry> myExtractPolyDataGeometry; //!< Clipping
};
#include <vtkViewport.h>
#include <vtkWindow.h>
#include <vtkLogLookupTable.h>
+#include <vtkProperty2D.h> // RKV
+#include <vtkAxisActor2D.h> // RKV
using namespace std;
this->LastSize[0] = 0;
this->LastSize[1] = 0;
- this->TitleRatioWidth = 0;
+ this->TitleRatioSize = 0;
this->LabelRatioWidth = 0;
this->BarRatioWidth = 0;
- this->TitleRatioHeight = 0;
- this->LabelRatioHeight = 0;
this->BarRatioHeight = 0;
+
+ // RKV : Begin
+ this->Distribution = vtkDoubleArray::New();
+ this->DistributionObj = vtkDataObject::New();
+ this->DistributionActor = VISU_XYPlotActor::New();
+ this->DistributionActor->SetTitle("");
+ this->DistributionActor->SetXTitle("");
+ this->DistributionActor->SetYTitle("");
+ this->DistributionActor->GetXAxisActor2D()->LabelVisibilityOff();
+ this->DistributionActor->GetXAxisActor2D()->TitleVisibilityOff();
+ this->DistributionActor->GetXAxisActor2D()->TickVisibilityOff();
+// this->DistributionActor->GetXAxisActor2D()->SetFontFactor(0.);
+ this->DistributionActor->SetNumberOfYLabels(1);
+// this->DistributionActor->SetNumberOfXLabels(2);
+ this->DistributionActor->GetXAxisActor2D()->AdjustLabelsOff();
+ this->DistributionActor->GetYAxisActor2D()->AdjustLabelsOff();
+ this->DistributionActor->LegendOff();
+ this->DistributionActor->SetLabelFormat("%4.3f");
+ this->DistributionActor->SetXValuesToIndex();
+// this->DistributionActor->GetPositionCoordinate()->SetValue(0.0, 0.67, 0);
+// this->DistributionActor->GetPosition2Coordinate()->SetValue(1.0, 0.33, 0); // #relative to Position
+ this->DistributionActor->GetPositionCoordinate()->
+ SetReferenceCoordinate(this->PositionCoordinate);
+ this->DistributionVisibilityOff(); // Don't show the distribution curve by default
+
+ // RKV : End
}
void VISU_ScalarBarActor::ReleaseGraphicsResources(vtkWindow *win)
}
}
this->ScalarBarActor->ReleaseGraphicsResources(win);
+ this->DistributionActor->ReleaseGraphicsResources(win); // RKV
}
VISU_ScalarBarActor::~VISU_ScalarBarActor()
delete [] this->TextActors;
}
+ // RKV : Begin
+ this->DistributionActor->Delete();
+ this->DistributionObj->Delete();
+ this->SetDistribution(NULL);
+ // RKV : End
+
this->ScalarBar->Delete();
this->ScalarBarMapper->Delete();
this->ScalarBarActor->Delete();
-
+
if (this->Title)
{
delete [] this->Title;
renderedSomething += this->TitleActor->RenderOverlay(viewport);
}
this->ScalarBarActor->RenderOverlay(viewport);
+ // RKV : Begin
+ if (this->DistributionVisibility)
+ this->DistributionActor->RenderOverlay(viewport);
+ // RKV : End
if( this->TextActors == NULL)
{
vtkWarningMacro(<<"Need a mapper to render a scalar bar");
}
// Check to see whether we have to rebuild everything
+ // RKV : Begin
if (positionsHaveChanged ||
this->GetMTime() > this->BuildTime ||
this->LookupTable->GetMTime() > this->BuildTime ||
this->LabelTextProperty->GetMTime() > this->BuildTime ||
- this->TitleTextProperty->GetMTime() > this->BuildTime)
+ this->TitleTextProperty->GetMTime() > this->BuildTime ||
+ this->Distribution->GetMTime() > this->BuildTime)
+ // RKV : End
+/* RKV if (positionsHaveChanged ||
+ this->GetMTime() > this->BuildTime ||
+ this->LookupTable->GetMTime() > this->BuildTime ||
+ this->LabelTextProperty->GetMTime() > this->BuildTime ||
+ this->TitleTextProperty->GetMTime() > this->BuildTime)*/
{
// Delete previously constructed objects
colors->SetNumberOfComponents(3);
colors->SetNumberOfTuples(numColors);
+// RKV : Begin
+ // If the distribution is changed then recalculate the total
+ if (this->Distribution->GetMTime() > this->BuildTime) {
+ int aNbVals = this->Distribution->GetNumberOfTuples();
+ double range[2];
+ this->Distribution->GetRange(range);
+ this->DistributionActor->SetYRange(0, range[1]);
+/* int total = 0;
+ for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
+ total += this->Distribution->GetValue(aValId);
+ }
+ this->DistributionActor->SetYRange(0, total);
+*/
+ }
+
+ this->DistributionActor->SetProperty(this->GetProperty());
+ this->DistributionActor->GetProperty()->SetColor(1, 1, 1);
+ this->DistributionActor->GetProperty()->SetLineWidth(2);
+ this->DistributionActor->GetProperty()->SetDisplayLocationToForeground();
+ vtkTextProperty* tprop;
+ tprop = this->DistributionActor->GetTitleTextProperty();
+ tprop->SetColor(this->DistributionActor->GetProperty()->GetColor());
+// this->DistributionActor->SetAxisTitleTextProperty(tprop);
+// this->DistributionActor->SetAxisLabelTextProperty(tprop);
+
+// RKV : End
this->ScalarBarActor->SetProperty(this->GetProperty());
this->ScalarBar->Initialize();
this->ScalarBar->SetPoints(pts);
this->TextActors[i]->SetPosition(barWidth+3,
val - sizeTextData[1]/2);
}
+
}
else
{
val = (vtkFloatingPointType)i/(this->NumberOfLabels-1) * barWidth;
this->TextActors[i]->SetPosition(val, barHeight + 0.05*size[1]);
}
+
}
+
+ // Compute the position of the distribution curve
+ this->PlaceDistribution(viewport, barWidth, barHeight); // RKV
this->BuildTime.Modified();
}
renderedSomething += this->TitleActor->RenderOpaqueGeometry(viewport);
}
this->ScalarBarActor->RenderOpaqueGeometry(viewport);
+ // RKV : Begin
+ if (this->DistributionVisibility)
+ this->DistributionActor->RenderOpaqueGeometry(viewport);
+ // RKV : End
for (i=0; i<this->NumberOfLabels; i++)
{
renderedSomething += this->TextActors[i]->RenderOpaqueGeometry(viewport);
else
targetWidth = (int)(0.01*LabelRatioWidth*size[0]);
- if(LabelRatioHeight == 0)
- if ( this->Orientation == VTK_ORIENT_VERTICAL )
- targetHeight = (int)(0.86*size[1]/this->NumberOfLabels);
- else
- targetHeight = (int)(0.25*size[1]);
+ if ( this->Orientation == VTK_ORIENT_VERTICAL )
+ targetHeight = (int)(0.86*size[1]/this->NumberOfLabels);
else
- targetHeight = (int)(0.01*LabelRatioHeight*size[1]);
+ targetHeight = (int)(0.25*size[1]);
vtkTextMapper::SetMultipleConstrainedFontSize(viewport,
targetWidth,
int targetWidth, targetHeight;
- if(TitleRatioWidth == 0)
+ if(TitleRatioSize == 0)
targetWidth = size[0];
else
- targetWidth = (int)(0.01*TitleRatioWidth*size[0]);
+ targetWidth = (int)(0.01*TitleRatioSize*size[0]);
- if(TitleRatioHeight == 0)
- if ( this->Orientation == VTK_ORIENT_VERTICAL )
- targetHeight = (int)(0.1*size[1]);
- else
- targetHeight = (int)(0.25*size[1]);
+ if ( this->Orientation == VTK_ORIENT_VERTICAL )
+ targetHeight = (int)(0.1*size[1]);
else
- targetHeight = (int)(0.01*TitleRatioHeight*size[1]);
+ targetHeight = (int)(0.25*size[1]);
this->TitleMapper->SetConstrainedFontSize(
viewport, targetWidth, targetHeight);
this->TitleMapper->GetSize(viewport, titleSize);
}
-void VISU_ScalarBarActor::SetRatios(int titleRatioWidth, int titleRatioHeight,
- int labelRatioWidth, int labelRatioHeight,
+// RKV : Begin
+void VISU_ScalarBarActor::SetDistributionVisibility(int v)
+{
+ this->DistributionVisibility = v;
+ if (v) {
+ this->DistributionActor->VisibilityOn();
+ } else {
+ this->DistributionActor->VisibilityOff();
+ }
+}
+
+void VISU_ScalarBarActor::SetDistribution(vtkDoubleArray *distr)
+{
+ this->Distribution = distr;
+ if (distr == NULL) return;
+
+ this->DistributionObj->Initialize();
+ this->DistributionObj->GetFieldData()->AddArray(this->Distribution);
+ this->DistributionActor->AddDataObjectInput(this->DistributionObj);
+ // Set ranges of axes for the distribution curve
+ this->DistributionActor->SetXRange(0, this->Distribution->GetNumberOfTuples()-1);
+ double range[2];
+ this->Distribution->GetRange(range);
+ int aNbVals = this->Distribution->GetNumberOfTuples();
+// int total = 0;
+ if (this->GetDebug()) {
+ for(vtkIdType aValId = 0; aValId < aNbVals; aValId++){
+// if (this->GetDebug()) {
+ if (this->Distribution->GetValue(aValId) > 0)
+ vtkDebugMacro(<< "D(" << aValId << ") = " << this->Distribution->GetValue(aValId));
+// }
+// total += this->Distribution->GetValue(aValId);
+ }
+ }
+// this->DistributionActor->SetYRange(0, total);
+ this->DistributionActor->SetYRange(0, range[1]);
+ vtkDebugMacro(<< "max X = " << this->Distribution->GetNumberOfTuples());
+ vtkDebugMacro(<< "Y = (" << range[0] << ", " << range[1] << ")");
+// vtkDebugMacro(<< "total = " << total);
+}
+
+void VISU_ScalarBarActor::DebugOn() {
+ this->DistributionActor->DebugOn();
+ Superclass::DebugOn();
+}
+
+void VISU_ScalarBarActor::DebugOff() {
+ this->DistributionActor->DebugOff();
+ Superclass::DebugOff();
+}
+// RKV : End
+
+void VISU_ScalarBarActor::SetRatios(int titleRatioSize, int labelRatioWidth,
int barRatioWidth, int barRatioHeight)
{
- TitleRatioWidth=titleRatioWidth;
- if(TitleRatioWidth>100)
- TitleRatioWidth=100;
- else if(TitleRatioWidth<0)
- TitleRatioWidth=0;
-
- TitleRatioHeight=titleRatioHeight;
- if(TitleRatioHeight>100)
- TitleRatioHeight=100;
- else if(TitleRatioHeight<0)
- TitleRatioHeight=0;
+ TitleRatioSize=titleRatioSize;
+ if(TitleRatioSize>100)
+ TitleRatioSize=100;
+ else if(TitleRatioSize<0)
+ TitleRatioSize=0;
LabelRatioWidth=labelRatioWidth;
if(LabelRatioWidth>100)
else if(LabelRatioWidth<0)
LabelRatioWidth=0;
- LabelRatioHeight=labelRatioHeight;
- if(LabelRatioHeight>100)
- LabelRatioHeight=100;
- else if(LabelRatioHeight<0)
- LabelRatioHeight=0;
-
BarRatioWidth=barRatioWidth;
if(BarRatioWidth>100)
BarRatioWidth=100;
BarRatioHeight=0;
}
-void VISU_ScalarBarActor::GetRatios(int& titleRatioWidth, int& titleRatioHeight,
- int& labelRatioWidth, int& labelRatioHeight,
- int& barRatioWidth, int& barRatioHeight)
+void VISU_ScalarBarActor::GetRatios(int& titleRatioSize, int& labelRatioWidth,
+ int& barRatioWidth, int& barRatioHeight)
{
- titleRatioWidth=TitleRatioWidth;
- titleRatioHeight=TitleRatioHeight;
+ titleRatioSize=TitleRatioSize;
labelRatioWidth=LabelRatioWidth;
- labelRatioHeight=LabelRatioHeight;
barRatioWidth=BarRatioWidth;
barRatioHeight=BarRatioHeight;
}
else
barSizeHeight = (int)(0.01*BarRatioHeight*size[1]);
}
+// RKV : Begin
+//------------------------------------------------------------------------------
+/** Place the distribution plot actor in the viewport according to the
+ * scalar bar location and orientation */
+void VISU_ScalarBarActor::PlaceDistribution(vtkViewport *viewport, const int barWidth, const int barHeight) {
+ vtkDebugMacro(<< "barOrigin[0]=" << this->LastOrigin[0] << "; barOrigin[1]=" << this->LastOrigin[1]);
+ // Detect the side of the viewport where the curve should be placed by the bar origin.
+ double u = (double)(this->LastOrigin[0]), v = (double)(this->LastOrigin[1]), z=0;
+ viewport->ViewportToNormalizedViewport(u, v);
+
+ if ( this->Orientation == VTK_ORIENT_VERTICAL ) {
+ // Position the distribution curve vertically
+ if (u > 0.5) {
+ // X - UP, Y - TO THE LEFT
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_RIGHT);
+ // Curve to be placed on the left side of the bar
+ vtkDebugMacro(<< "Curve to be placed on the left side of the bar");
+ // relative to the bar origin
+ u = 0;
+ v = 0;
+ viewport->ViewportToNormalizedViewport(u, v);
+ vtkDebugMacro(<< "u=" << u << "; v=" << v);
+ this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
+ // relative to Position
+ u = - barWidth;
+ v = barHeight;
+ viewport->ViewportToNormalizedViewport(u, v);
+ vtkDebugMacro("u2=" << u << "; v2=" << v);
+ this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0);
+ } else {
+ // X - UP, Y - TO THE RIGHT
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_LEFT);
+ // Curve to be placed on the right side of the bar
+ vtkDebugMacro(<< "Curve to be placed on the right side of the bar");
+ // relative to the bar origin
+ u = barWidth;
+ v = 0;
+ viewport->ViewportToNormalizedViewport(u, v);
+ vtkDebugMacro(<< "u=" << u << "; v=" << v);
+ this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
+ // relative to Position
+ u = barWidth;
+ v = barHeight;
+ viewport->ViewportToNormalizedViewport(u, v);
+ vtkDebugMacro("u2=" << u << "; v2=" << v);
+ this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0);
+ }
+ } else {
+ // Position the distribution curve horizontally
+ if (v > 0.5) {
+ // X - TO THE LEFT, Y - DOWN
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_TOP);
+ // Curve to be placed below the bar
+ vtkDebugMacro(<< "Curve to be placed below the bar");
+ // relative to the bar origin
+ u = 0;
+ v = 0;
+ viewport->ViewportToNormalizedViewport(u, v);
+ vtkDebugMacro(<< "u=" << u << "; v=" << v);
+ this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
+ // relative to Position
+ u = barWidth;
+ v = - barHeight;
+ viewport->ViewportToNormalizedViewport(u, v);
+ vtkDebugMacro("u2=" << u << "; v2=" << v);
+ this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0);
+ } else {
+ // X - TO THE RIGHT, Y - UP
+ this->DistributionActor->SetPlotLocation(VISU_XYPLOT_BOTTOM);
+ // Curve to be placed on the top of the bar
+ vtkDebugMacro(<< "Curve to be placed on the top of the bar");
+ // relative to the bar origin
+ u = 0;
+ v = barHeight;
+ viewport->ViewportToNormalizedViewport(u, v);
+ vtkDebugMacro(<< "u=" << u << "; v=" << v);
+ this->DistributionActor->GetPositionCoordinate()->SetValue(u, v, 0);
+ // relative to Position
+ u = barWidth;
+ v = barHeight;
+ viewport->ViewportToNormalizedViewport(u, v);
+ vtkDebugMacro("u2=" << u << "; v2=" << v);
+ this->DistributionActor->GetPosition2Coordinate()->SetValue(u, v, 0);
+ }
+ }
+}
+// RKV : End
+
#include "VISUPipeline.hxx"
#include "VISU_LookupTable.hxx"
+#include "VISU_XYPlotActor.hxx"
#include <vtkActor2D.h>
+#include <vtkDoubleArray.h> // RKV
class vtkPolyData;
class vtkPolyDataMapper2D;
// Set/Get the labels text property.
virtual void SetLabelTextProperty(vtkTextProperty *p);
vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
+
+// RKV : Begin
+ // Description:
+ // Set/Get the values distribution array
+ virtual void SetDistribution(vtkDoubleArray *d);
+ vtkGetObjectMacro(Distribution,vtkDoubleArray);
+
+ // Description:
+ // Set/Get the flag of distribution plot visibility
+ void SetDistributionVisibility(int v);
+ vtkGetMacro(DistributionVisibility, int);
+ void DistributionVisibilityOn()
+ {this->SetDistributionVisibility(1);};
+ void DistributionVisibilityOff() {this->SetDistributionVisibility(0);};
+
+ void DebugOn();
+ void DebugOff();
+// RKV : End
// Description:
// Set/Get the scalar bar dimention properties in persents.
// 0 <= ration <= 100
- void SetRatios(int titleRatioWidth, int titleRatioHeight,
- int labelRatioWidth, int labelRatioHeight,
+ void SetRatios(int titleRatioSize,int labelRatioWidth,
int barRatioWidth, int barRatioHeight);
- void GetRatios(int& titleRatioWidth, int& titleRatioHeight,
- int& labelRatioWidth, int& labelRatioHeight,
+ void GetRatios(int& titleRatioSize, int& labelRatioWidth,
int& barRatioWidth, int& barRatioHeight);
// Description:
VISU_LookupTable *LookupTable;
vtkTextProperty *TitleTextProperty;
vtkTextProperty *LabelTextProperty;
+
+ /** Array for keeping the distribution of colors within cells.
+ * For each color index the appropriate element of the array contains
+ * a number of cells for this color.*/
+ vtkDoubleArray *Distribution; // RKV
+ /** Visibility flag for the distribution plot */
+ int DistributionVisibility; // RKV
int MaximumNumberOfColors;
int NumberOfLabels;
int Orientation;
char *Title;
char *LabelFormat;
- int TitleRatioWidth;
+ int TitleRatioSize;
int LabelRatioWidth;
int BarRatioWidth;
- int TitleRatioHeight;
- int LabelRatioHeight;
int BarRatioHeight;
vtkTextMapper **TextMappers;
vtkPolyDataMapper2D *ScalarBarMapper;
vtkActor2D *ScalarBarActor;
+ vtkDataObject *DistributionObj; // RKV
+ VISU_XYPlotActor *DistributionActor; // RKV
+
vtkTimeStamp BuildTime;
int LastSize[2];
int LastOrigin[2];
void SizeBar(int& barSizeWidth, int& barSizeHeight, int *size,
vtkViewport *viewport, vtkFloatingPointType *range);
+
+ /** Place the distribution plot actor in the viewport according to the
+ * scalar bar location and orientation */
+ void PlaceDistribution(vtkViewport *viewport, const int barWidth, const int barHeight);
private:
VISU_ScalarBarActor(const VISU_ScalarBarActor&); // Not implemented.
#include <string.h>
-//----------------------------------------------------------------------------
-namespace
-{
- inline
- void
- MarkValueByColor(VISU_LookupTable* theTable,
- vtkFloatingPointType theValue,
- unsigned char* theColor)
- {
- vtkIdType anIndex = theTable->GetIndex(theValue);
- unsigned char *aTablePtr = theTable->GetPointer(anIndex);
- aTablePtr[0] = theColor[0];
- aTablePtr[1] = theColor[1];
- aTablePtr[2] = theColor[2];
- }
-
- inline
- void
- CopyColor(unsigned char* theTaget, const unsigned char* theSource)
- {
- theTaget[0] = theSource[0];
- theTaget[1] = theSource[1];
- theTaget[2] = theSource[2];
- }
-
- void
- FillByColor(VISU_LookupTable* theTable,
- unsigned char* theColor)
- {
- vtkIdType aNbColors = theTable->GetNumberOfColors();
- for(int i = 0; i < aNbColors; i++){
- unsigned char *aTablePtr = theTable->GetPointer(i);
- CopyColor(aTablePtr,theColor);
- }
- }
-
- void
- MakeBiColor(VISU_LookupTable* theTable)
- {
- unsigned char aRedPtr[3] = {255, 0, 0};
- unsigned char aBluePtr[3] = {0, 0, 255};
-
- vtkFloatingPointType aRange[2];
- theTable->GetTableRange(aRange);
- vtkIdType aNbColors = theTable->GetNumberOfColors();
-
- 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);
- if(aValue > 0.0){
- CopyColor(aTablePtr,aRedPtr);
- }else{
- CopyColor(aTablePtr,aBluePtr);
- }
- aValue += aDelta;
- }
- }
-}
-
-
//----------------------------------------------------------------------------
vtkStandardNewMacro(VISU_ScalarBarCtrl);
{
if(myMarked){
if(myMode == eGlobal){
- MarkValueByColor(myGlobalLookupTable, myMarkedValue, myBlack);
+ myGlobalLookupTable->MarkValueByColor( myMarkedValue, myBlack );
}else{
- MarkValueByColor(myLocalLookupTable, myMarkedValue, myBlack);
+ myLocalLookupTable->MarkValueByColor( myMarkedValue, myBlack );
}
}
if(myGlobalRangeIsDefined){
vtkFloatingPointType aLocalRange[2];
myLocalLookupTable->GetTableRange(aLocalRange);
- MarkValueByColor(myGlobalLookupTable, aLocalRange[0], myBlack);
- MarkValueByColor(myGlobalLookupTable, aLocalRange[1], myBlack);
+ myGlobalLookupTable->MarkValueByColor( aLocalRange[0], myBlack );
+ myGlobalLookupTable->MarkValueByColor( aLocalRange[1], myBlack );
}
}
::UpdateForColor()
{
if(myMode == eGlobal){
- FillByColor(myLocalLookupTable,myGrey);
+ myLocalLookupTable->FillByColor( myGrey );
}else if(myMode == eLocal){
- FillByColor(myGlobalLookupTable,myGrey);
+ myGlobalLookupTable->FillByColor( myGrey );
}
}
myLocalLookupTable->Build();
if(myMode == eSimple){
- MakeBiColor(myLocalLookupTable);
+ myLocalLookupTable->MakeBiColor();
return;
}
if(myMode == eGlobal){
- MakeBiColor(myGlobalLookupTable);
- FillByColor(myLocalLookupTable,myGrey);
+ myGlobalLookupTable->MakeBiColor();
+ myLocalLookupTable->FillByColor( myGrey );
}else if(myMode == eLocal){
- MakeBiColor(myLocalLookupTable);
- FillByColor(myGlobalLookupTable,myGrey);
+ myLocalLookupTable->MakeBiColor();
+ myGlobalLookupTable->FillByColor( myGrey );
}
}
--- /dev/null
+// VISU ScalarMapOnDeformedShapePL
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File: VISU_ScalarMapOnDeformedShapePL.cxx
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+#include "VISU_FieldTransform.hxx"
+#include "VISU_Extractor.hxx"
+#include "VISU_LookupTable.hxx"
+#include "VISU_DeformedShapePL.hxx"
+#include "VTKViewer_TransformFilter.h"
+#include "VTKViewer_Transform.h"
+#include "VISU_MergeFilter.hxx"
+
+#include "VISU_PipeLineUtils.hxx"
+
+#include <vtkWarpVector.h>
+#include <vtkUnstructuredGrid.h>
+#include <vtkCellDataToPointData.h>
+#include <vtkPointDataToCellData.h>
+
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(VISU_ScalarMapOnDeformedShapePL)
+
+//----------------------------------------------------------------------------
+/*!
+ * Constructor. Creating new instances of vtkWarpVector,vtkMergeFilter,vtkUnstructuredGrid
+ * Where:
+ * \li myDeformVectors is vtkWarpVector - deformation vectors data
+ * \li myScalarsMergeFilter is vtkMergeFilter - merge filter.
+ * Merge filter which unify the deformation and scalars
+ * \li myScalars is vtk shared pointer to vtkUnstructuredGrid - scalars data
+*/
+VISU_ScalarMapOnDeformedShapePL
+::VISU_ScalarMapOnDeformedShapePL():
+ myScaleFactor(0.0)
+{
+ myWarpVector = vtkWarpVector::New();
+
+ myScalarsMergeFilter = VISU_MergeFilter::New();
+ myScalarsMergeFilter->SetMergingInputs(true);
+
+ myScalarsExtractor = VISU_Extractor::New();
+
+ myScalarsFieldTransform = VISU_FieldTransform::New();
+
+ myCellDataToPointData = vtkCellDataToPointData::New();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Destructor.
+ * Delete all fields.
+*/
+VISU_ScalarMapOnDeformedShapePL
+::~VISU_ScalarMapOnDeformedShapePL()
+{
+ myWarpVector->Delete();
+
+ myScalarsMergeFilter->Delete();
+
+ myScalarsExtractor->Delete();
+
+ myScalarsFieldTransform->Delete();
+
+ myCellDataToPointData->Delete();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Initial method
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::Init()
+{
+ Superclass::Init();
+
+ SetScale(VISU_DeformedShapePL::GetDefaultScale(this));
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Build method
+ * Building of deformation and puts result to merge filter.
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::Build()
+{
+ Superclass::Build();
+}
+
+
+//----------------------------------------------------------------------------
+vtkDataSet*
+VISU_ScalarMapOnDeformedShapePL
+::InsertCustomPL()
+{
+ GetMapper()->SetColorModeToMapScalars();
+ GetMapper()->ScalarVisibilityOn();
+
+ VISU::CellDataToPoint(myWarpVector,
+ myCellDataToPointData,
+ GetMergedInput());
+
+ myScalars = GetMergedInput();
+
+ UpdateScalars();
+
+ myScalarsFieldTransform->SetInput(myScalarsExtractor->GetOutput());
+
+ // Sets geometry for merge filter
+ myScalarsMergeFilter->SetGeometry(myWarpVector->GetUnstructuredGridOutput());
+
+ vtkDataSet* aScalarsDataSet = myScalarsFieldTransform->GetOutput();
+ myScalarsMergeFilter->SetScalars(aScalarsDataSet);
+ myScalarsMergeFilter->AddField("VISU_CELLS_MAPPER", aScalarsDataSet);
+ myScalarsMergeFilter->AddField("VISU_POINTS_MAPPER", aScalarsDataSet);
+
+ return myScalarsMergeFilter->GetOutput();
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ * Update method
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::Update()
+{
+ Superclass::Update();
+ //{
+ // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsExtractor.vtk";
+ // VISU::WriteToFile(myScalarsExtractor->GetUnstructuredGridOutput(), aFileName);
+ //}
+ //{
+ // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myWarpVector.vtk";
+ // VISU::WriteToFile(myWarpVector->GetUnstructuredGridOutput(), aFileName);
+ //}
+ //{
+ // std::string aFileName = std::string(getenv("HOME"))+"/"+getenv("USER")+"-myScalarsMergeFilter.vtk";
+ // VISU::WriteToFile(myScalarsMergeFilter->GetUnstructuredGridOutput(), aFileName);
+ //}
+}
+
+//----------------------------------------------------------------------------
+unsigned long int
+VISU_ScalarMapOnDeformedShapePL
+::GetMemorySize()
+{
+ unsigned long int aSize = Superclass::GetMemorySize();
+
+ if(vtkDataSet* aDataSet = myWarpVector->GetOutput())
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ if(vtkDataSet* aDataSet = myScalarsExtractor->GetOutput())
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ if(vtkDataSet* aDataSet = myScalarsMergeFilter->GetOutput())
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ if(myCellDataToPointData->GetInput())
+ if(vtkDataSet* aDataSet = myCellDataToPointData->GetOutput())
+ aSize += aDataSet->GetActualMemorySize() * 1024;
+
+ return aSize;
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Update scalars method.
+ * Put scalars to merge filter.
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::UpdateScalars()
+{
+ vtkDataSet* aScalars = GetScalars();
+ myScalarsExtractor->SetInput(aScalars);
+
+ if(VISU::IsDataOnCells(aScalars))
+ GetMapper()->SetScalarModeToUseCellData();
+ else
+ GetMapper()->SetScalarModeToUsePointData();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Copy information about pipline.
+ * Copy scale and scalars.
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::DoShallowCopy(VISU_PipeLine *thePipeLine,
+ bool theIsCopyInput)
+{
+ Superclass::DoShallowCopy(thePipeLine, theIsCopyInput);
+
+ if(VISU_ScalarMapOnDeformedShapePL *aPipeLine = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine)){
+ SetScale(aPipeLine->GetScale());
+ SetScalars(aPipeLine->GetScalars());
+ }
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Set scalars.
+ * Sets vtkDataSet with scalars values to VISU_Extractor filter for scalars extraction.
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalars(vtkDataSet *theScalars)
+{
+ if(GetScalars() == theScalars)
+ return;
+
+ myScalars = theScalars;
+ UpdateScalars();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Get pointer to input scalars.
+ */
+vtkDataSet*
+VISU_ScalarMapOnDeformedShapePL
+::GetScalars()
+{
+ return myScalars.GetPointer();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Sets scale for deformed shape
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScale(vtkFloatingPointType theScale)
+{
+ if(VISU::CheckIsSameValue(myScaleFactor, theScale))
+ return;
+
+ myWarpVector->SetScaleFactor(theScale);
+ myScaleFactor = theScale;
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets scale of deformed shape.
+ */
+vtkFloatingPointType
+VISU_ScalarMapOnDeformedShapePL
+::GetScale()
+{
+ return myWarpVector->GetScaleFactor();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Set scale factor of deformation.
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetMapScale(vtkFloatingPointType theMapScale)
+{
+ Superclass::SetMapScale(theMapScale);
+ myWarpVector->SetScaleFactor(myScaleFactor*theMapScale);
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets scalar mode.
+ */
+int
+VISU_ScalarMapOnDeformedShapePL
+::GetScalarMode()
+{
+ return myScalarsExtractor->GetScalarMode();
+}
+
+//----------------------------------------------------------------------------
+/*!
+ * Sets scalar mode.
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalarMode(int theScalarMode)
+{
+ VISU_ScalarMapPL::SetScalarMode(theScalarMode, GetScalars(), myScalarsExtractor);
+}
+
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScaling(int theScaling)
+{
+ if(GetScaling() == theScaling)
+ return;
+
+ GetBarTable()->SetScale(theScaling);
+
+ if(theScaling == VTK_SCALE_LOG10)
+ myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Log10));
+ else
+ myScalarsFieldTransform->SetScalarTransform(&(VISU_FieldTransform::Ident));
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU_ScalarMapOnDeformedShapePL
+::SetScalarRange(vtkFloatingPointType theRange[2])
+{
+ if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
+ return;
+
+ myScalarsFieldTransform->SetScalarRange(theRange);
+ GetBarTable()->SetRange(theRange);
+}
+
+
+//----------------------------------------------------------------------------
+vtkFloatingPointType*
+VISU_ScalarMapOnDeformedShapePL
+::GetScalarRange()
+{
+ return myScalarsFieldTransform->GetScalarRange();
+}
+
+
+//----------------------------------------------------------------------------
+/*!
+ * Gets ranges of extracted scalars
+ * \param theRange[2] - output values
+ * \li theRange[0] - minimum value
+ * \li theRange[1] - maximum value
+ */
+void
+VISU_ScalarMapOnDeformedShapePL
+::GetSourceRange(vtkFloatingPointType theRange[2])
+{
+ myScalarsExtractor->Update();
+ myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange);
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File: VISU_ScalarMapOnDeformedShapePL.hxx
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_ScalarMapOnDeformedShapePL_HeaderFile
+#define VISU_ScalarMapOnDeformedShapePL_HeaderFile
+
+#include "VISUPipeline.hxx"
+#include "VISU_ScalarMapPL.hxx"
+
+class VISU_MergeFilter;
+class vtkWarpVector;
+class vtkUnstructuredGrid;
+class vtkCellDataToPointData;
+class vtkPointDataToCellData;
+
+
+//----------------------------------------------------------------------------
+class VISU_PIPELINE_EXPORT VISU_ScalarMapOnDeformedShapePL : public VISU_ScalarMapPL
+{
+public:
+ vtkTypeMacro(VISU_ScalarMapOnDeformedShapePL, VISU_ScalarMapPL);
+
+ static
+ VISU_ScalarMapOnDeformedShapePL*
+ New();
+
+ virtual
+ void
+ SetScale(vtkFloatingPointType theScale);
+
+ virtual
+ vtkFloatingPointType
+ GetScale();
+
+ virtual
+ int
+ GetScalarMode();
+
+ virtual
+ void
+ SetScalarMode(int theScalarMode = 0);
+
+ virtual
+ void
+ SetScaling(int theScaling);
+
+ virtual
+ void
+ SetScalarRange(vtkFloatingPointType theRange[2]);
+
+ virtual
+ vtkFloatingPointType*
+ GetScalarRange();
+
+ virtual
+ void
+ GetSourceRange(vtkFloatingPointType theRange[2]);
+
+ virtual
+ void
+ SetScalars(vtkDataSet *theScalars);
+
+ virtual
+ vtkDataSet*
+ GetScalars();
+
+public:
+ //! Redefined method for initialization of the pipeline.
+ virtual
+ void
+ Init();
+
+ //! Redefined method for building the pipeline.
+ virtual
+ void
+ Build();
+
+ //! Redefined method for updating the pipeline.
+ virtual
+ void
+ Update();
+
+ //! Gets memory size used by the instance (bytes).
+ virtual
+ unsigned long int
+ GetMemorySize();
+
+ //! Update scalars.
+ void
+ UpdateScalars();
+
+ virtual
+ void
+ SetMapScale(vtkFloatingPointType theMapScale = 1.0);
+
+protected:
+ VISU_ScalarMapOnDeformedShapePL();
+
+ virtual
+ ~VISU_ScalarMapOnDeformedShapePL();
+
+ virtual
+ vtkDataSet*
+ InsertCustomPL();
+
+ virtual
+ void
+ DoShallowCopy(VISU_PipeLine *thePipeLine,
+ bool theIsCopyInput);
+
+private:
+ VISU_ScalarMapOnDeformedShapePL(const VISU_ScalarMapOnDeformedShapePL&);
+
+ vtkFloatingPointType myScaleFactor;
+ vtkWarpVector *myWarpVector;
+ VISU_MergeFilter *myScalarsMergeFilter;
+ vtkSmartPointer<vtkUnstructuredGrid> myScalars;
+ vtkCellDataToPointData* myCellDataToPointData;
+ VISU_FieldTransform* myScalarsFieldTransform;
+ VISU_Extractor* myScalarsExtractor;
+};
+
+#endif
myMergeFilter(VISU_MergeFilter::New())
{
SetIsShrinkable(true);
+ SetIsFeatureEdgesAllowed(true);
SetElnoDisassembleState( false );
::VISU_StreamLinesPL()
{
SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myStream = vtkStreamLine::New();
myCenters = vtkCellCenters::New();
VISU_VectorsPL
::VISU_VectorsPL()
{
- SetIsShrinkable( false );
+ SetIsShrinkable(false);
+ SetIsFeatureEdgesAllowed(false);
myGlyph = vtkGlyph3D::New();
lib_LTLIBRARIES= libVISU.la
-salomeinclude_HEADERS= VisuGUI_Tools.h
-
# .po files to transform in .qm
nodist_salomeres_DATA= \
VISU_msg_en.qm VISU_images.qm
+salomeinclude_HEADERS= \
+ VisuGUI_Tools.h \
+ VisuGUI_Prs3dTools.h \
+ VisuGUI_ActionsDef.h \
+ VisuGUI.h \
+ VisuGUI_Module.h \
+ VisuGUI_Selection.h \
+ VisuGUI_Tools.h \
+ VisuGUI_ViewTools.h \
+ VisuGUI_PopupTools.h \
+ VisuGUI_NameDlg.h \
+ VisuGUI_FileDlg.h \
+ VisuGUI_CursorDlg.h \
+ VisuGUI_TimeAnimation.h \
+ VisuGUI_EditContainerDlg.h \
+ VisuGUI_ClippingDlg.h \
+ VisuGUI_DialogRunner.h \
+ VisuGUI_OffsetDlg.h \
+ VisuGUI_Prs3dDlg.h \
+ VisuGUI_ScalarBarDlg.h \
+ VisuGUI_Plot3DDlg.h \
+ VisuGUI_GaussPointsDlg.h \
+ VisuGUI_DeformedShapeDlg.h \
+ VisuGUI_IsoSurfacesDlg.h \
+ VisuGUI_CutLinesDlg.h \
+ VisuGUI_CutPlanesDlg.h \
+ VisuGUI_StreamLinesDlg.h \
+ VisuGUI_VectorsDlg.h \
+ VisuGUI_Displayer.h \
+ VisuGUI_DeformedShapeAndScalarMapDlg.h \
+ VisuGUI_SetupPlot2dDlg.h \
+ VisuGUI_BuildProgressDlg.h \
+ VisuGUI_TransparencyDlg.h \
+ VisuGUI_Timer.h \
+ VisuGUI_Slider.h \
+ VisuGUI_InputPane.h \
+ VisuGUI_CacheDlg.h \
+ VisuGUI_FieldFilter.h \
+ VisuGUI_ValuesLabelingDlg.h
+
dist_libVISU_la_SOURCES= \
VisuGUI.cxx \
VisuGUI_Factory.cxx \
VisuGUI_Module.cxx \
- VisuGUI_Selection.cxx \
+ VisuGUI_InputPanel.cxx \
+ VisuGUI_BasePanel.cxx \
+ VisuGUI_Panel.cxx \
+ VisuGUI_SelectionPanel.cxx \
+ VisuGUI_SelectionPrefDlg.cxx \
+ VisuGUI_GaussPointsSelectionPane.cxx \
+ VisuGUI_FindPane.cxx \
+ VisuGUI_FeatureEdgesPanel.cxx \
VisuGUI_Tools.cxx \
VisuGUI_ViewTools.cxx \
- VisuGUI_PopupTools.cxx \
+ VisuGUI_Selection.cxx \
VisuGUI_NameDlg.cxx \
VisuGUI_FileDlg.cxx \
VisuGUI_CursorDlg.cxx \
VisuGUI_TransparencyDlg.cxx \
VisuGUI_Timer.cxx \
VisuGUI_Slider.cxx \
+ VisuGUI_Sweep.cxx \
VisuGUI_InputPane.cxx \
VisuGUI_CacheDlg.cxx \
+ VisuGUI_FileInfoDlg.cxx \
VisuGUI_FieldFilter.cxx \
- VisuGUI_FileInfoDlg.cxx
+ VisuGUI_ClippingPanel.cxx \
+ VisuGUI_ClippingPlaneDlg.cxx \
+ VisuGUI_FilterScalarsDlg.cxx \
+ VisuGUI_ValuesLabelingDlg.cxx
MOC_FILES= \
VisuGUI_moc.cxx \
VisuGUI_Module_moc.cxx \
- VisuGUI_Selection_moc.cxx \
+ VisuGUI_InputPanel_moc.cxx \
+ VisuGUI_BasePanel_moc.cxx \
+ VisuGUI_Panel_moc.cxx \
+ VisuGUI_SelectionPanel_moc.cxx \
+ VisuGUI_SelectionPrefDlg_moc.cxx \
+ VisuGUI_GaussPointsSelectionPane_moc.cxx \
+ VisuGUI_FindPane_moc.cxx \
+ VisuGUI_FeatureEdgesPanel_moc.cxx \
VisuGUI_NameDlg_moc.cxx \
VisuGUI_FileDlg_moc.cxx \
VisuGUI_CursorDlg_moc.cxx \
VisuGUI_Table3dDlg_moc.cxx \
VisuGUI_TransparencyDlg_moc.cxx \
VisuGUI_Slider_moc.cxx \
+ VisuGUI_Sweep_moc.cxx \
VisuGUI_InputPane_moc.cxx \
VisuGUI_CacheDlg_moc.cxx \
- VisuGUI_FileInfoDlg_moc.cxx
+ VisuGUI_FileInfoDlg_moc.cxx \
+ VisuGUI_ClippingPanel_moc.cxx \
+ VisuGUI_ClippingPlaneDlg_moc.cxx \
+ VisuGUI_FilterScalarsDlg_moc.cxx \
+ VisuGUI_ValuesLabelingDlg_moc.cxx
+
nodist_libVISU_la_SOURCES=$(MOC_FILES)
+++ /dev/null
-<!DOCTYPE TS>
-<TS version="1.1" >
- <context>
- <name>@default</name>
- <message>
- <source>ICON_ADD</source>
- <translation>Visu_add.png</translation>
- </message>
- <message>
- <source>ICON_CUBE_AXES</source>
- <translation>Visu_graduated_axes.png</translation>
- </message>
- <message>
- <source>ICON_CUT_LINES</source>
- <translation>Visu_cutlines.png</translation>
- </message>
- <message>
- <source>ICON_CUT_PLANES</source>
- <translation>Visu_cutplanes.png</translation>
- </message>
- <message>
- <source>ICON_DEFORMED_SHAPE</source>
- <translation>Visu_deformed.png</translation>
- </message>
- <message>
- <source>ICON_ERASE_ALL</source>
- <translation>Visu_eraseall.png</translation>
- </message>
- <message>
- <source>ICON_GAUSS_NEW_VIEWER</source>
- <translation>Visu_points.png</translation>
- </message>
- <message>
- <source>ICON_GAUSS_POINTS</source>
- <translation>Visu_gauss_points.png</translation>
- </message>
- <message>
- <source>ICON_GLOBAL_SELECTION</source>
- <translation>Visu_selectall.png</translation>
- </message>
- <message>
- <source>ICON_HOLO_RENDER</source>
- <translation>Visu_holo_render.png</translation>
- </message>
- <message>
- <source>ICON_IMPORT_MED</source>
- <translation>Visu_import_med.png</translation>
- </message>
- <message>
- <source>ICON_ISO_SURFACES</source>
- <translation>Visu_isosurfaces.png</translation>
- </message>
- <message>
- <source>ICON_LOAD_TEXTURE</source>
- <translation>Visu_load_texture.png</translation>
- </message>
- <message>
- <source>ICON_MULTIPR_VIEW_FULL</source>
- <translation>Visu_tree_multipr_full.png</translation>
- </message>
- <message>
- <source>ICON_MULTIPR_VIEW_HIDE</source>
- <translation>Visu_tree_multipr_hide.png</translation>
- </message>
- <message>
- <source>ICON_MULTIPR_VIEW_LOW</source>
- <translation>Visu_tree_multipr_low.png</translation>
- </message>
- <message>
- <source>ICON_MULTIPR_VIEW_MEDIUM</source>
- <translation>Visu_tree_multipr_medium.png</translation>
- </message>
- <message>
- <source>ICON_OBJBROWSER_Visu</source>
- <translation>Visu_tree_visu.png</translation>
- </message>
- <message>
- <source>ICON_PARTIAL_SELECTION</source>
- <translation>Visu_selectonly.png</translation>
- </message>
- <message>
- <source>ICON_PLOT2D</source>
- <translation>Visu_plot2d.png</translation>
- </message>
- <message>
- <source>ICON_PLOT_3D</source>
- <translation>Visu_plot3d.png</translation>
- </message>
- <message>
- <source>ICON_POINTS</source>
- <translation>Visu_points.png</translation>
- </message>
- <message>
- <source>ICON_REMOVE</source>
- <translation>Visu_remove.png</translation>
- </message>
- <message>
- <source>ICON_SCALAR_MAP</source>
- <translation>Visu_scalars.png</translation>
- </message>
- <message>
- <source>ICON_SCALAR_MAP_ON_DEFORMED_SHAPE</source>
- <translation>Visu_scalarmapondeformedshape.png</translation>
- </message>
- <message>
- <source>ICON_SCALING</source>
- <translation>Visu_scaling.png</translation>
- </message>
- <message>
- <source>ICON_SLIDER_AVI</source>
- <translation>Visu_slider_avi.png</translation>
- </message>
- <message>
- <source>ICON_SLIDER_FIRST</source>
- <translation>Visu_slider_first.png</translation>
- </message>
- <message>
- <source>ICON_SLIDER_LAST</source>
- <translation>Visu_slider_last.png</translation>
- </message>
- <message>
- <source>ICON_SLIDER_MORE</source>
- <translation>Visu_slider_more.png</translation>
- </message>
- <message>
- <source>ICON_SLIDER_NEXT</source>
- <translation>Visu_slider_next.png</translation>
- </message>
- <message>
- <source>ICON_SLIDER_PAUSE</source>
- <translation>Visu_slider_pause.png</translation>
- </message>
- <message>
- <source>ICON_SLIDER_PLAY</source>
- <translation>Visu_slider_play.png</translation>
- </message>
- <message>
- <source>ICON_SLIDER_PREVIOUS</source>
- <translation>Visu_slider_previous.png</translation>
- </message>
- <message>
- <source>ICON_STREAM_LINES</source>
- <translation>Visu_streamlines.png</translation>
- </message>
- <message>
- <source>ICON_SURFACE</source>
- <translation>Visu_surface.png</translation>
- </message>
- <message>
- <source>ICON_SWEEP</source>
- <translation>Visu_scalars_anim.png</translation>
- </message>
- <message>
- <source>ICON_TIMEANIMATION</source>
- <translation>Visu_anim.png</translation>
- </message>
- <message>
- <source>ICON_TREE_CONTAINER</source>
- <translation>Visu_tree_container.png</translation>
- </message>
- <message>
- <source>ICON_TREE_CURVE</source>
- <translation>Visu_tree_curve.png</translation>
- </message>
- <message>
- <source>ICON_TREE_CUT_LINES</source>
- <translation>Visu_tree_cutlines.png</translation>
- </message>
- <message>
- <source>ICON_TREE_CUT_LINES_GROUPS</source>
- <translation>Visu_tree_cutlines_gr.png</translation>
- </message>
- <message>
- <source>ICON_TREE_CUT_PLANES</source>
- <translation>Visu_tree_cutplanes.png</translation>
- </message>
- <message>
- <source>ICON_TREE_CUT_PLANES_GROUPS</source>
- <translation>Visu_tree_cutplanes_gr.png</translation>
- </message>
- <message>
- <source>ICON_TREE_DEFORMED_SHAPE</source>
- <translation>Visu_tree_deformed.png</translation>
- </message>
- <message>
- <source>ICON_TREE_DEFORMED_SHAPE_GROUPS</source>
- <translation>Visu_tree_deformed_gr.png</translation>
- </message>
- <message>
- <source>ICON_TREE_GAUSS_POINTS</source>
- <translation>Visu_tree_gauss_points.png</translation>
- </message>
- <message>
- <source>ICON_TREE_ISO_SURFACES</source>
- <translation>Visu_tree_isosurfaces.png</translation>
- </message>
- <message>
- <source>ICON_TREE_ISO_SURFACES_GROUPS</source>
- <translation>Visu_tree_isosurfaces_gr.png</translation>
- </message>
- <message>
- <source>ICON_TREE_MESH</source>
- <translation>Visu_tree_mesh.png</translation>
- </message>
- <message>
- <source>ICON_TREE_PLOT_3D</source>
- <translation>Visu_tree_plot3d.png</translation>
- </message>
- <message>
- <source>ICON_TREE_PLOT_3D_GROUPS</source>
- <translation>Visu_tree_plot3d_gr.png</translation>
- </message>
- <message>
- <source>ICON_TREE_RESULT</source>
- <translation>Visu_tree_result.png</translation>
- </message>
- <message>
- <source>ICON_TREE_SCALAR_MAP</source>
- <translation>Visu_tree_scalars.png</translation>
- </message>
- <message>
- <source>ICON_TREE_SCALAR_MAP_GROUPS</source>
- <translation>Visu_tree_scalars_gr.png</translation>
- </message>
- <message>
- <source>ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE</source>
- <translation>Visu_tree_scalarmapondeformedshape.png</translation>
- </message>
- <message>
- <source>ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS</source>
- <translation>Visu_tree_scalarmapondeformedshape_gr.png</translation>
- </message>
- <message>
- <source>ICON_TREE_STREAM_LINES</source>
- <translation>Visu_tree_streamlines.png</translation>
- </message>
- <message>
- <source>ICON_TREE_STREAM_LINES_GROUPS</source>
- <translation>Visu_tree_streamlines_gr.png</translation>
- </message>
- <message>
- <source>ICON_TREE_TABLE</source>
- <translation>Visu_tree_table.png</translation>
- </message>
- <message>
- <source>ICON_TREE_VECTORS</source>
- <translation>Visu_tree_vectors.png</translation>
- </message>
- <message>
- <source>ICON_TREE_VECTORS_GROUPS</source>
- <translation>Visu_tree_vectors_gr.png</translation>
- </message>
- <message>
- <source>ICON_VECTORS</source>
- <translation>Visu_vectors.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Visu_vvtk_switch.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Visu_PlaneSegmentation.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_PAUSE</source>
- <translation>Visu_recording_pause.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_PLAY</source>
- <translation>Visu_recording_play.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_START</source>
- <translation>Visu_recording_start.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_RECORDING_STOP</source>
- <translation>Visu_recording_stop.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Visu_points.png</translation>
- </message>
- <message>
- <source>ICON_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Visu_SphereSegmentation.png</translation>
- </message>
- <message>
- <source>ICON_WIREFRAME</source>
- <translation>Visu_wireframe.png</translation>
- </message>
- </context>
-</TS>
+++ /dev/null
-<!DOCTYPE TS>
-<TS version="1.1" >
- <context>
- <name>@default</name>
- <message>
- <source>ASSIGNED</source>
- <translation>Assigned</translation>
- </message>
- <message>
- <source>ATTRIBUTES_LBL</source>
- <translation>Attributes</translation>
- </message>
- <message>
- <source>AXIS_LBL</source>
- <translation>Axis</translation>
- </message>
- <message>
- <source>BTN_RESET</source>
- <translation>Reset</translation>
- </message>
- <message>
- <source>DATA_LBL</source>
- <translation>Data</translation>
- </message>
- <message>
- <source>ERR_CANT_BUILD_PRESENTATION</source>
- <translation>The object can't be built</translation>
- </message>
- <message>
- <source>ERR_CANT_CREATE_ACTOR</source>
- <translation>Can't create actor for this presentation</translation>
- </message>
- <message>
- <source>ERR_CANT_CREATE_ANIMATION</source>
- <translation>Can't create animation for these fields:
-number of time stamps or number of components is not the same!</translation>
- </message>
- <message>
- <source>ERR_CANT_FIND_MED_COMPONENT</source>
- <translation>Failed to activate MED engine!</translation>
- </message>
- <message>
- <source>ERR_CANT_FIND_VISU_COMPONENT</source>
- <translation>Failed to activate VISU engine!</translation>
- </message>
- <message>
- <source>ERR_NO_MEMORY_TO_BUILD</source>
- <translation>Please, free %1 Mb to make the cache enlarging possible
-(for example, try to delete some holders)</translation>
- </message>
- <message>
- <source>IMPORT_DONE</source>
- <translation>Importing is done</translation>
- </message>
- <message>
- <source>INF_DONE</source>
- <translation> done</translation>
- </message>
- <message>
- <source>INF_VISU</source>
- <translation>Post-Pro Info</translation>
- </message>
- <message>
- <source>NO_GROUPS</source>
- <translation>No groups in the mesh</translation>
- </message>
- <message>
- <source>PARALLEL_ANIMATION</source>
- <translation>Parallel Animation</translation>
- </message>
- <message>
- <source>PERIOD_2PI</source>
- <translation>From -PI to PI</translation>
- </message>
- <message>
- <source>PERIOD_PI</source>
- <translation>From 0 to PI</translation>
- </message>
- <message>
- <source>PRS_ON_GROUPS</source>
- <translation>Use Only Groups</translation>
- </message>
- <message>
- <source>SUCCESSIVE_ANIMATION</source>
- <translation>Successive Animation</translation>
- </message>
- <message>
- <source>TIT_OFFSETDLG</source>
- <translation>Translate Presentation</translation>
- </message>
- <message>
- <source>TLT_SETUP_PLOT2D</source>
- <translation>Setup Plot 2d</translation>
- </message>
- <message>
- <source>UNITS_LBL</source>
- <translation>Units</translation>
- </message>
- <message>
- <source>VISU_3DCACHE_PROPS</source>
- <translation>3D Cache properties</translation>
- </message>
- <message>
- <source>VISU_COLORS_AND_LABELS</source>
- <translation>Colors && Labels</translation>
- </message>
- <message>
- <source>VISU_COMPONENT</source>
- <translation>Component</translation>
- </message>
- <message>
- <source>VISU_COS_SWEEP</source>
- <translation>Cosinusoidal ( (1 - cos(t))/2 )</translation>
- </message>
- <message>
- <source>VISU_CUTLINE_PREF</source>
- <translation>CutLine preferences</translation>
- </message>
- <message>
- <source>VISU_CUT_LINES</source>
- <translation>Cut Lines</translation>
- </message>
- <message>
- <source>VISU_CUT_PLANES</source>
- <translation>Cut Planes</translation>
- </message>
- <message>
- <source>VISU_DEFORMED_SHAPE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>VISU_DISP_ONLY</source>
- <translation>Display only on creation</translation>
- </message>
- <message>
- <source>VISU_FIELD_RANGE</source>
- <translation>Field range</translation>
- </message>
- <message>
- <source>VISU_FONT</source>
- <translation>Font</translation>
- </message>
- <message>
- <source>VISU_FONT_ARIAL</source>
- <translation>Arial</translation>
- </message>
- <message>
- <source>VISU_FONT_COURIER</source>
- <translation>Courier</translation>
- </message>
- <message>
- <source>VISU_FONT_TIMES</source>
- <translation>Times</translation>
- </message>
- <message>
- <source>VISU_HEIGHT</source>
- <translation>Height:</translation>
- </message>
- <message>
- <source>VISU_HORIZONTAL</source>
- <translation>Horizontal</translation>
- </message>
- <message>
- <source>VISU_IMPOSED_RANGE</source>
- <translation>Imposed range</translation>
- </message>
- <message>
- <source>VISU_IS2PI</source>
- <translation>Parameter varies:</translation>
- </message>
- <message>
- <source>VISU_ISO_SURFACES</source>
- <translation>Iso Surfaces</translation>
- </message>
- <message>
- <source>VISU_LABELS</source>
- <translation>Labels</translation>
- </message>
- <message>
- <source>VISU_LIMITED</source>
- <translation>Limited</translation>
- </message>
- <message>
- <source>VISU_LINEAR_SWEEP</source>
- <translation>Linear</translation>
- </message>
- <message>
- <source>VISU_LOGARITHMIC_SCALING</source>
- <translation>Logarithmic scaling</translation>
- </message>
- <message>
- <source>VISU_MAX</source>
- <translation>Max:</translation>
- </message>
- <message>
- <source>VISU_MEMORY_LIMIT</source>
- <translation>Memory limit (Mb)</translation>
- </message>
- <message>
- <source>VISU_MEMORY_MODE</source>
- <translation>Memory mode</translation>
- </message>
- <message>
- <source>VISU_MESH</source>
- <translation>Mesh</translation>
- </message>
- <message>
- <source>VISU_MIN</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>VISU_MINIMAL</source>
- <translation>Minimal</translation>
- </message>
- <message>
- <source>VISU_MINMAX_IMPOSED_RANGE</source>
- <translation>Min and max for imposed range</translation>
- </message>
- <message>
- <source>VISU_MODULUS</source>
- <translation>Modulus</translation>
- </message>
- <message>
- <source>VISU_NB_COLORS</source>
- <translation>Nb. of colors</translation>
- </message>
- <message>
- <source>VISU_NB_CYCLES</source>
- <translation>Number of cycles</translation>
- </message>
- <message>
- <source>VISU_NB_LABELS</source>
- <translation>Nb. of labels</translation>
- </message>
- <message>
- <source>VISU_NB_STEPS</source>
- <translation>Number of steps</translation>
- </message>
- <message>
- <source>VISU_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>VISU_ORIGIN_AND_SIZE</source>
- <translation>Origin && Size</translation>
- </message>
- <message>
- <source>VISU_PLOT3D</source>
- <translation>Plot3D</translation>
- </message>
- <message>
- <source>VISU_PREF_MED_FULL_LOAD</source>
- <translation>Full MED loading</translation>
- </message>
- <message>
- <source>VISU_PREF_MED_IMPORT</source>
- <translation>MED files import</translation>
- </message>
- <message>
- <source>VISU_PREF_SECOND_TAB</source>
- <translation>Scalar range, Sweep, MED import, Shading</translation>
- </message>
- <message>
- <source>VISU_RANGE_TO_USE</source>
- <translation>Range to use</translation>
- </message>
- <message>
- <source>VISU_REPRESENT_PROPS</source>
- <translation>Representation properties</translation>
- </message>
- <message>
- <source>VISU_SCALAR_BAR</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>VISU_SCALAR_MAP</source>
- <translation>Scalar Map</translation>
- </message>
- <message>
- <source>VISU_SCALAR_MAP_ON_DEFORMED_SHAPE</source>
- <translation>Scalar Map on Def. Shape</translation>
- </message>
- <message>
- <source>VISU_SCALAR_MODE</source>
- <translation>Scalar mode</translation>
- </message>
- <message>
- <source>VISU_SCALAR_RANGE</source>
- <translation>Scalar range</translation>
- </message>
- <message>
- <source>VISU_SHRINK</source>
- <translation>Shrink</translation>
- </message>
- <message>
- <source>VISU_SIN_SWEEP</source>
- <translation>Sinusoidal ( sin( t - PI/2 ) )</translation>
- </message>
- <message>
- <source>VISU_STREAM_LINES</source>
- <translation>Stream Lines</translation>
- </message>
- <message>
- <source>VISU_SWEEPING_MODES</source>
- <translation>Mode of the sweeping </translation>
- </message>
- <message>
- <source>VISU_SWEEPING_PREF</source>
- <translation>Sweeping preferences</translation>
- </message>
- <message>
- <source>VISU_TIME_STEP</source>
- <translation>Time step(second)</translation>
- </message>
- <message>
- <source>VISU_TITLE</source>
- <translation>Title</translation>
- </message>
- <message>
- <source>VISU_USE_SHADING</source>
- <translation>Use Shading</translation>
- </message>
- <message>
- <source>VISU_VECTORS</source>
- <translation>Vectors</translation>
- </message>
- <message>
- <source>VISU_VERTICAL</source>
- <translation>Vertical</translation>
- </message>
- <message>
- <source>VISU_WIDTH</source>
- <translation>Width:</translation>
- </message>
- <message>
- <source>VISU_X</source>
- <translation>X:</translation>
- </message>
- <message>
- <source>VISU_Y</source>
- <translation>Y:</translation>
- </message>
- <message>
- <source>WRN_EXTRA_MEMORY_REQUIRED</source>
- <translation>Cache need more memory to build the presentation (%1 Mb).
-Do you want to enlarge the cache?</translation>
- </message>
- <message>
- <source>WRN_NO_AVAILABLE_DATA</source>
- <translation>No Available data in selection</translation>
- </message>
- <message>
- <source>WRN_STUDY_LOCKED</source>
- <translation>Current Study is locked</translation>
- </message>
- <message>
- <source>WRN_VISU</source>
- <translation>Post-Pro Warning</translation>
- </message>
- <message>
- <source>WRN_VISU_WARNING</source>
- <translation>Warning</translation>
- </message>
- <message>
- <source>INF_FAILED</source>
- <translation> failed!</translation>
- </message>
- <message>
- <source>VISU_IS_UNITS</source>
- <translation>Display units in title</translation>
- </message>
- <message>
- <source>VISU_LABELS_FORMAT</source>
- <translation>Labels format</translation>
- </message>
- <message>
- <source>VISU_TITLE_WIDTH</source>
- <translation>Title width (%):</translation>
- </message>
- <message>
- <source>VISU_TITLE_HEIGHT</source>
- <translation>Title height (%):</translation>
- </message>
- <message>
- <source>VISU_LABEL_WIDTH</source>
- <translation>Label width (%):</translation>
- </message>
- <message>
- <source>VISU_LABEL_HEIGHT</source>
- <translation>Label height (%):</translation>
- </message>
- <message>
- <source>VISU_BAR_WIDTH</source>
- <translation>Bar width (%):</translation>
- </message>
- <message>
- <source>VISU_BAR_HEIGHT</source>
- <translation>Bar height (%):</translation>
- </message>
- <message>
- <source>VISU_AUTOMATIC_FIT_ALL</source>
- <translation>Automatic Fit All</translation>
- </message>
- <message>
- <source>VISU_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
- <translation>Def. Shape and Scalar Map</translation>
- </message>
- <message>
- <source>VISU_FLOATING_POINT_PRECISION</source>
- <translation>Floating Point Precision</translation>
- </message>
- <message>
- <source>VISU_REALLY_DELETE</source>
- <translation>Do you really want to delete this %1 object(s): %2</translation>
- </message>
- <message>
- <source>WRN_NO_APPROPRIATE_SELECTION</source>
- <translation>No appropriate objects selected</translation>
- </message>
- </context>
- <context>
- <name>VVTK_MainWindow</name>
- <message>
- <source>DSC_VVTK_RECORDING_PAUSE</source>
- <translation>Pause recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_PLAY</source>
- <translation>Play recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_START</source>
- <translation>Start recording</translation>
- </message>
- <message>
- <source>DSC_VVTK_RECORDING_STOP</source>
- <translation>Stop recording</translation>
- </message>
- <message>
- <source>LBL_TOOLBAR_RECORD_LABEL</source>
- <translation>Recording Operations</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_PAUSE</source>
- <translation>Pause recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_PLAY</source>
- <translation>Play recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_START</source>
- <translation>Start recording</translation>
- </message>
- <message>
- <source>MNU_VVTK_RECORDING_STOP</source>
- <translation>Stop recording</translation>
- </message>
- <message>
- <source>MSG_NO_AVI_MAKER</source>
- <translation>Tool jpeg2yuv, necessary for AVI recording, is not available.
-Please, refer to the documentation.</translation>
- </message>
- </context>
- <context>
- <name>VVTK_MainWindow1</name>
- <message>
- <source>DSC_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Interaction Style Switch</translation>
- </message>
- <message>
- <source>DSC_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Plane Segmentation</translation>
- </message>
- <message>
- <source>DSC_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Selection Mode Switch</translation>
- </message>
- <message>
- <source>DSC_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Sphere Segmentation</translation>
- </message>
- <message>
- <source>LBL_TOOLBAR_GAUSS_LABEL</source>
- <translation>Gauss Viewer Tools</translation>
- </message>
- <message>
- <source>MNU_VVTK_INTERACTOR_STYLE_SWITCH</source>
- <translation>Interaction Style Switch</translation>
- </message>
- <message>
- <source>MNU_VVTK_PLANE_SEGMENTATION_SWITCH</source>
- <translation>Plane Segmentation</translation>
- </message>
- <message>
- <source>MNU_VVTK_SELECTION_MODE_SWITCH</source>
- <translation>Selection Mode Switch</translation>
- </message>
- <message>
- <source>MNU_VVTK_SPHERE_SEGMENTATION_SWITCH</source>
- <translation>Sphere Segmentation</translation>
- </message>
- </context>
- <context>
- <name>VVTK_PickingDlg</name>
- <message>
- <source>BELOW_POINT</source>
- <translation>Centered below the point</translation>
- </message>
- <message>
- <source>CAMERA_TITLE</source>
- <translation>Movement of the camera</translation>
- </message>
- <message>
- <source>CURSOR_SIZE</source>
- <translation>Size of the cursor :</translation>
- </message>
- <message>
- <source>CURSOR_TITLE</source>
- <translation>Cursor</translation>
- </message>
- <message>
- <source>DISPLAY_PARENT_MESH</source>
- <translation>Display parent mesh element</translation>
- </message>
- <message>
- <source>INFO_WINDOW_TITLE</source>
- <translation>Information window</translation>
- </message>
- <message>
- <source>PARENT_MESH_TITLE</source>
- <translation>Parent mesh element</translation>
- </message>
- <message>
- <source>PICKING_DLG_TITLE</source>
- <translation>Picking</translation>
- </message>
- <message>
- <source>POINT_TOLERANCE</source>
- <translation>Point tolerance :</translation>
- </message>
- <message>
- <source>POSITION</source>
- <translation>Position :</translation>
- </message>
- <message>
- <source>PYRAMID_HEIGHT</source>
- <translation>Height of the pyramids :</translation>
- </message>
- <message>
- <source>SELECTION_COLOR</source>
- <translation>Selection cursor color :</translation>
- </message>
- <message>
- <source>STEP_NUMBER</source>
- <translation>Number of steps between two positions :</translation>
- </message>
- <message>
- <source>TOLERANCE_TITLE</source>
- <translation>Tolerance</translation>
- </message>
- <message>
- <source>TOP_LEFT_CORNER</source>
- <translation>Top-left corner of the 3D view</translation>
- </message>
- <message>
- <source>TRANSPARENCY</source>
- <translation>Transparency :</translation>
- </message>
- <message>
- <source>ZOOM_FACTOR</source>
- <translation>Zoom at first selected point (ratio) :</translation>
- </message>
- <message>
- <source>DATA_POSITION</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>PARENT_ELEMENT</source>
- <translation>Parent mesh element ID:</translation>
- </message>
- <message>
- <source>LOCAL_POINT</source>
- <translation>Local Gauss Point ID:</translation>
- </message>
- </context>
- <context>
- <name>VVTK_PrimitiveBox</name>
- <message>
- <source>ALPHA_TEXTURE</source>
- <translation>Alpha Channel Texture (16x16) : </translation>
- </message>
- <message>
- <source>ALPHA_THRESHOLD</source>
- <translation>Alpha Channel Threshold : </translation>
- </message>
- <message>
- <source>CLAMP</source>
- <translation>Maximum Size (Clamp) : </translation>
- </message>
- <message>
- <source>FACE_LIMIT</source>
- <translation>Notify when number of faces exceeds : </translation>
- </message>
- <message>
- <source>FACE_NUMBER</source>
- <translation>Number of faces : </translation>
- </message>
- <message>
- <source>GEOMETRICAL_SPHERE</source>
- <translation>Geometrical Sphere</translation>
- </message>
- <message>
- <source>MAIN_TEXTURE</source>
- <translation>Main Texture (16x16) : </translation>
- </message>
- <message>
- <source>OPENGL_POINT</source>
- <translation>OpenGL Point</translation>
- </message>
- <message>
- <source>POINT_SPRITE</source>
- <translation>Point Sprite</translation>
- </message>
- <message>
- <source>PRIMITIVE_TITLE</source>
- <translation>Primitive</translation>
- </message>
- <message>
- <source>RESOLUTION</source>
- <translation>Resolution : </translation>
- </message>
- </context>
- <context>
- <name>VVTK_RecorderDlg</name>
- <message>
- <source>ALL_DISLPAYED_FRAMES</source>
- <translation>Recording all displayed frames</translation>
- </message>
- <message>
- <source>CLOSE</source>
- <translation>Close</translation>
- </message>
- <message>
- <source>DLG_RECORDER_TITLE</source>
- <translation>Recorder</translation>
- </message>
- <message>
- <source>FILE_NAME</source>
- <translation>Save to file : </translation>
- </message>
- <message>
- <source>FLT_ALL_FILES</source>
- <translation>All Files (*.*)</translation>
- </message>
- <message>
- <source>FLT_AVI_FILES</source>
- <translation>AVI Files (*.avi)</translation>
- </message>
- <message>
- <source>FPS</source>
- <translation>FPS : </translation>
- </message>
- <message>
- <source>PROGRESSIVE</source>
- <translation>Progressive</translation>
- </message>
- <message>
- <source>QUALITY</source>
- <translation>Quality : </translation>
- </message>
- <message>
- <source>RECORDING_MODE</source>
- <translation>Mode : </translation>
- </message>
- <message>
- <source>SETTINGS</source>
- <translation>Settings</translation>
- </message>
- <message>
- <source>SKIPPED_FRAMES</source>
- <translation>Recording at a given FPS</translation>
- </message>
- <message>
- <source>START</source>
- <translation>Start</translation>
- </message>
- </context>
- <context>
- <name>VVTK_SegmentationCursorDlg</name>
- <message>
- <source>DEPTH</source>
- <translation>Depth of the cursor: </translation>
- </message>
- <message>
- <source>DEPTH_TITLE</source>
- <translation>Depth</translation>
- </message>
- <message>
- <source>DIRECTION_DX</source>
- <translation>DX: </translation>
- </message>
- <message>
- <source>DIRECTION_DY</source>
- <translation>DY: </translation>
- </message>
- <message>
- <source>DIRECTION_DZ</source>
- <translation>DZ: </translation>
- </message>
- <message>
- <source>DIRECTION_TITLE</source>
- <translation>Direction</translation>
- </message>
- <message>
- <source>GAUSS_POINTS_TAB</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>INCREMENT</source>
- <translation>+/- Ratio : </translation>
- </message>
- <message>
- <source>INSIDE_GAUSS_POINTS</source>
- <translation>Inside Cursor Gauss Points Presentation</translation>
- </message>
- <message>
- <source>MAGNIFICATION</source>
- <translation>Magnification (%) : </translation>
- </message>
- <message>
- <source>MAGNIFICATION_TITLE</source>
- <translation>Magnification</translation>
- </message>
- <message>
- <source>ORIGIN_TITLE</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>ORIGIN_X</source>
- <translation>X: </translation>
- </message>
- <message>
- <source>ORIGIN_Y</source>
- <translation>Y: </translation>
- </message>
- <message>
- <source>ORIGIN_Z</source>
- <translation>Z: </translation>
- </message>
- <message>
- <source>OUTSIDE_GAUSS_POINTS</source>
- <translation>Outside Cursor Gauss Points Presentation</translation>
- </message>
- <message>
- <source>RADIUS</source>
- <translation>Radius of the cursor :</translation>
- </message>
- <message>
- <source>RADIUS_TITLE</source>
- <translation>Radius</translation>
- </message>
- <message>
- <source>RATIO</source>
- <translation>+/- Ratio :</translation>
- </message>
- <message>
- <source>SEGMENTATION_CURSOR_DLG_TITLE</source>
- <translation>Segmentation Cursor</translation>
- </message>
- <message>
- <source>SEGMENTATION_CURSOR_TAB</source>
- <translation>Segmentation Cursor</translation>
- </message>
- </context>
- <context>
- <name>VVTK_SizeBox</name>
- <message>
- <source>COLOR</source>
- <translation>Color : </translation>
- </message>
- <message>
- <source>COLOR_TITLE</source>
- <translation>Color</translation>
- </message>
- <message>
- <source>GEOM_SIZE</source>
- <translation>Size of points (%) : </translation>
- </message>
- <message>
- <source>INCREMENT</source>
- <translation>+/- Ratio : </translation>
- </message>
- <message>
- <source>MAGNIFICATION</source>
- <translation>Magnification (%) : </translation>
- </message>
- <message>
- <source>MAX_SIZE</source>
- <translation>max size (%) : </translation>
- </message>
- <message>
- <source>MIN_SIZE</source>
- <translation>Range values for min size (%) : </translation>
- </message>
- <message>
- <source>OUTSIDE_SIZE</source>
- <translation>Percentage of normal size(%) : </translation>
- </message>
- <message>
- <source>SIZE_TITLE</source>
- <translation>Size</translation>
- </message>
- <message>
- <source>UNIFORM_COLOR</source>
- <translation>Uniform Color</translation>
- </message>
- </context>
- <context>
- <name>VVTK_ViewManager</name>
- <message>
- <source>VTK_VIEW_TITLE</source>
- <translation>Gauss scene:%1 - viewer:%2</translation>
- </message>
- </context>
- <context>
- <name>VVTK_ViewWindow</name>
- <message>
- <source>LBL_TOOLBAR_LABEL</source>
- <translation>GAUSS viewer tools</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI</name>
- <message>
- <source>DLG_LINEWIDTH_CMT1</source>
- <translation>Set value between</translation>
- </message>
- <message>
- <source>DLG_LINEWIDTH_CMT2</source>
- <translation>1 (thin) and 10 (thick)</translation>
- </message>
- <message>
- <source>DLG_LINEWIDTH_TITLE</source>
- <translation>Line Width</translation>
- </message>
- <message>
- <source>DLG_OPACITY_CMT1</source>
- <translation>Set value between</translation>
- </message>
- <message>
- <source>DLG_OPACITY_CMT2</source>
- <translation>0 (transparent) and 100 (opaque)</translation>
- </message>
- <message>
- <source>DLG_OPACITY_TITLE</source>
- <translation>Opacity</translation>
- </message>
- <message>
- <source>ERR_ACTIVATE_VIEW3D</source>
- <translation>Please activate 3D view before</translation>
- </message>
- <message>
- <source>ERR_ERROR_DURING_EXPORT</source>
- <translation>Error has been occured during exporting to file</translation>
- </message>
- <message>
- <source>ERR_SCALARBAR_PARAMS</source>
- <translation>Warning! The parameters is incorrect</translation>
- </message>
- <message>
- <source>FLT_ALL_FILES</source>
- <translation>All Files (*.*)</translation>
- </message>
- <message>
- <source>FLT_MED_FILES</source>
- <translation>MED Files (*.med)</translation>
- </message>
- <message>
- <source>FLT_TABLE_FILES</source>
- <translation>Tables (*.xls *.txt *.tab)</translation>
- </message>
- <message>
- <source>IMPORT_FROM_FILE</source>
- <translation>Import from File</translation>
- </message>
- <message>
- <source>MEN_ARRANGE_ACTORS</source>
- <translation>Arrange Actors</translation>
- </message>
- <message>
- <source>MEN_CACHE_PROPERTIES</source>
- <translation>Properties</translation>
- </message>
- <message>
- <source>MEN_CELL_COLOR</source>
- <translation>Cell color</translation>
- </message>
- <message>
- <source>MEN_CLEAR_CONTAINER</source>
- <translation>Clear</translation>
- </message>
- <message>
- <source>MEN_CLIPPING</source>
- <translation>Clipping planes</translation>
- </message>
- <message>
- <source>MEN_COLOR</source>
- <translation>Color...</translation>
- </message>
- <message>
- <source>MEN_COPY_PRS</source>
- <translation>Copy</translation>
- </message>
- <message>
- <source>MEN_CREATE_CURVES</source>
- <translation>Create Curves</translation>
- </message>
- <message>
- <source>MEN_CREATE_MANY_PRS</source>
- <translation>Create Presentations</translation>
- </message>
- <message>
- <source>MEN_CREATE_PLOT2D</source>
- <translation>Create Plot2d View</translation>
- </message>
- <message>
- <source>MEN_CREATE_PRS</source>
- <translation>Create Presentation</translation>
- </message>
- <message>
- <source>MEN_CREATE_TABLE</source>
- <translation>Create Table</translation>
- </message>
- <message>
- <source>MEN_CUBE_AXES</source>
- <translation>Graduated axes</translation>
- </message>
- <message>
- <source>MEN_CURVE_PROPS</source>
- <translation>Properties...</translation>
- </message>
- <message>
- <source>MEN_CUT_LINES</source>
- <translation>Cut Lines</translation>
- </message>
- <message>
- <source>MEN_CUT_PLANES</source>
- <translation>Cut Planes</translation>
- </message>
- <message>
- <source>MEN_DEFORMED_SHAPE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>MEN_DELETE_OBJS</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>MEN_DELETE_VIEWPARAMS</source>
- <translation>Delete view parameters</translation>
- </message>
- <message>
- <source>MEN_SHOW</source>
- <translation>Show</translation>
- </message>
- <message>
- <source>MEN_DISPLAY_ONLY</source>
- <translation>Show Only</translation>
- </message>
- <message>
- <source>MEN_DISPLAY_SELECTION</source>
- <translation>Display Selection</translation>
- </message>
- <message>
- <source>MEN_EDGE_COLOR</source>
- <translation>Edge Color</translation>
- </message>
- <message>
- <source>MEN_EDIT_CONTAINER</source>
- <translation>Edit...</translation>
- </message>
- <message>
- <source>MEN_EDIT_PRS</source>
- <translation>Edit...</translation>
- </message>
- <message>
- <source>MEN_HIDE</source>
- <translation>Hide</translation>
- </message>
- <message>
- <source>MEN_ERASE_ALL</source>
- <translation>Hide All</translation>
- </message>
- <message>
- <source>MEN_EXPORT_TABLE</source>
- <translation>Export Table</translation>
- </message>
- <message>
- <source>MEN_FREE_SCALAR_BARS</source>
- <translation>Use Field Range</translation>
- </message>
- <message>
- <source>MEN_GLOBAL_SELECTION</source>
- <translation>Global Selection</translation>
- </message>
- <message>
- <source>MEN_HOLO_RENDER</source>
- <translation>Holo render</translation>
- </message>
- <message>
- <source>MEN_IMPORT</source>
- <translation>Import</translation>
- </message>
- <message>
- <source>MEN_IMPORT_FROM_FILE</source>
- <translation>MED file</translation>
- </message>
- <message>
- <source>MEN_IMPORT_MED_FIELD</source>
- <translation>Import Field</translation>
- </message>
- <message>
- <source>MEN_IMPORT_MED_STRUCTURE</source>
- <translation>Import Structure</translation>
- </message>
- <message>
- <source>MEN_IMPORT_MED_TIMESTAMP</source>
- <translation>Import TimeStamp</translation>
- </message>
- <message>
- <source>MEN_IMPORT_TABLE</source>
- <translation>Table from file</translation>
- </message>
- <message>
- <source>MEN_INSIDEFRAME</source>
- <translation>Insideframe</translation>
- </message>
- <message>
- <source>MEN_ISO_SURFACES</source>
- <translation>Iso Surfaces</translation>
- </message>
- <message>
- <source>MEN_LINE_WIDTH</source>
- <translation>Line Width</translation>
- </message>
- <message>
- <source>MEN_MERGE_SCALAR_BARS</source>
- <translation>Merge Scalar Range</translation>
- </message>
- <message>
- <source>MEN_MULTIPR_VIEW_FULL_RES</source>
- <translation>Display at full resolution</translation>
- </message>
- <message>
- <source>MEN_MULTIPR_VIEW_HIDE</source>
- <translation>Hide</translation>
- </message>
- <message>
- <source>MEN_MULTIPR_VIEW_LOW_RES</source>
- <translation>Display at low resolution</translation>
- </message>
- <message>
- <source>MEN_MULTIPR_VIEW_MEDIUM_RES</source>
- <translation>Display at medium resolution</translation>
- </message>
- <message>
- <source>MEN_NOSHADING</source>
- <translation>Shading Off</translation>
- </message>
- <message>
- <source>MEN_OPACITY</source>
- <translation>Opacity</translation>
- </message>
- <message>
- <source>MEN_PARALLEL_ANIMATION</source>
- <translation>Parallel Animation...</translation>
- </message>
- <message>
- <source>MEN_PARTIAL_SELECTION</source>
- <translation>Partial Selection</translation>
- </message>
- <message>
- <source>MEN_PLOT3D_FROM_CUTPLANE</source>
- <translation>Plot3d</translation>
- </message>
- <message>
- <source>MEN_PLOT_3D</source>
- <translation>Plot3D</translation>
- </message>
- <message>
- <source>MEN_POINTS</source>
- <translation>Points</translation>
- </message>
- <message>
- <source>MEN_PROPERTIES</source>
- <translation>Properties</translation>
- </message>
- <message>
- <source>MEN_RENAME</source>
- <translation>Rename...</translation>
- </message>
- <message>
- <source>MEN_RENAME_CONTAINER</source>
- <translation>Rename...</translation>
- </message>
- <message>
- <source>MEN_RENAME_TABLE</source>
- <translation>Rename...</translation>
- </message>
- <message>
- <source>MEN_REPRESENTATION</source>
- <translation>Representation</translation>
- </message>
- <message>
- <source>MEN_RESTORE_VIEWPARAMS</source>
- <translation>Restore view parameters</translation>
- </message>
- <message>
- <source>MEN_SAVE_VIEWPARAMS</source>
- <translation>Save view parameters</translation>
- </message>
- <message>
- <source>MEN_SCALAR_MAP</source>
- <translation>Scalar Map</translation>
- </message>
- <message>
- <source>MEN_DEFORMED_SHAPE_AND_SCALAR_MAP</source>
- <translation>Deformed Shape and Scalar Map</translation>
- </message>
- <message>
- <source>MEN_SCALING</source>
- <translation>Scaling</translation>
- </message>
- <message>
- <source>MEN_SELECTION</source>
- <translation>Selection</translation>
- </message>
- <message>
- <source>MEN_SELECTION_INFO</source>
- <translation>Selection Info...</translation>
- </message>
- <message>
- <source>MEN_SHADING</source>
- <translation>Shading On</translation>
- </message>
- <message>
- <source>MEN_SHOW_ANIMATION</source>
- <translation>Show...</translation>
- </message>
- <message>
- <source>MEN_SHOW_TABLE</source>
- <translation>Show Table</translation>
- </message>
- <message>
- <source>MEN_SHRINK</source>
- <translation>Shrink</translation>
- </message>
- <message>
- <source>MEN_STREAM_LINES</source>
- <translation>Stream Lines</translation>
- </message>
- <message>
- <source>MEN_SUCCCESSIVE_ANIMATION</source>
- <translation>Successive Animation...</translation>
- </message>
- <message>
- <source>MEN_SURFACE</source>
- <translation>Surface</translation>
- </message>
- <message>
- <source>MEN_SURFACEFRAME</source>
- <translation>Surfaceframe</translation>
- </message>
- <message>
- <source>MEN_SWEEP</source>
- <translation>Sweep</translation>
- </message>
- <message>
- <source>MEN_TRANSLATE_PRS</source>
- <translation>Translate Presentation</translation>
- </message>
- <message>
- <source>MEN_UNSHRINK</source>
- <translation>Unshrink</translation>
- </message>
- <message>
- <source>MEN_VECTORS</source>
- <translation>Vectors</translation>
- </message>
- <message>
- <source>MEN_VISUALIZATION</source>
- <translation>Visualization</translation>
- </message>
- <message>
- <source>MEN_WIREFRAME</source>
- <translation>Wireframe</translation>
- </message>
- <message>
- <source>TOOL_IMPORT</source>
- <translation>Import Toolbar</translation>
- </message>
- <message>
- <source>TOOL_REPRESENTATION</source>
- <translation>Representation Toolbar</translation>
- </message>
- <message>
- <source>TOOL_VISUALISATION</source>
- <translation>Visualization Toolbar</translation>
- </message>
- <message>
- <source>USE_BUILD_PROGRESS</source>
- <translation>Use build progress</translation>
- </message>
- <message>
- <source>MEN_LOAD_COMPONENT_DATA</source>
- <translation>Load Component Data</translation>
- </message>
- <message>
- <source>FLT_DISTRIBUTED_MED_FILES</source>
- <translation>Distributed MED Files (*_maitre.med)</translation>
- </message>
- <message>
- <source>SHOW_LEVEL_LABELS</source>
- <translation>Show level labels</translation>
- </message>
- <message>
- <source>MEN_FILE_INFO</source>
- <translation>MED File information</translation>
- </message>
- <message>
- <source>ERR_ERROR_IN_THE_FILE</source>
- <translation>Error in the file</translation>
- </message>
- <message>
- <source>ERR_FILE_NOT_EXISTS</source>
- <translation>File does not exist</translation>
- </message>
- <message>
- <source>IMPORT_ERRORS</source>
- <translation>Import operation has finished with errors:</translation>
- </message>
- <message>
- <source>TLT_IMPORT_TABLE</source>
- <translation>Import table</translation>
- </message>
- <message>
- <source>UNKNOWN_IMPORT_ERROR</source>
- <translation>Unknown error</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_AxisWg</name>
- <message>
- <source>AXIS_NAME</source>
- <translation>Axis name</translation>
- </message>
- <message>
- <source>FONT</source>
- <translation>Font</translation>
- </message>
- <message>
- <source>IS_VISIBLE</source>
- <translation>Is visible</translation>
- </message>
- <message>
- <source>LABELS</source>
- <translation>Labels</translation>
- </message>
- <message>
- <source>LENGTH</source>
- <translation>Length</translation>
- </message>
- <message>
- <source>NAME</source>
- <translation>Name</translation>
- </message>
- <message>
- <source>NUMBER</source>
- <translation>Number</translation>
- </message>
- <message>
- <source>OFFSET</source>
- <translation>Offset</translation>
- </message>
- <message>
- <source>TICK_MARKS</source>
- <translation>Tick marks</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_BuildProgressDlg</name>
- <message>
- <source>BUILD_ALL</source>
- <translation>Build all</translation>
- </message>
- <message>
- <source>BUILD_AT_ONCE</source>
- <translation>Build at once</translation>
- </message>
- <message>
- <source>BUILD_ENTITIES</source>
- <translation>Build entities</translation>
- </message>
- <message>
- <source>BUILD_FIELDS</source>
- <translation>Build fields</translation>
- </message>
- <message>
- <source>BUILD_GROUPS</source>
- <translation>Build groups</translation>
- </message>
- <message>
- <source>BUILD_MINMAX</source>
- <translation>Build min/max</translation>
- </message>
- <message>
- <source>CLOSE</source>
- <translation>Close</translation>
- </message>
- <message>
- <source>CLOSE_AT_FINISH</source>
- <translation>Close dialog at finish</translation>
- </message>
- <message>
- <source>DLG_BUILD_PROGRESS_TITLE</source>
- <translation>Build progress</translation>
- </message>
- <message>
- <source>ERR_ERROR_IN_THE_FILE</source>
- <translation>Error in the file</translation>
- </message>
- <message>
- <source>FILE_NAME</source>
- <translation>Import file : </translation>
- </message>
- <message>
- <source>FLT_ALL_FILES</source>
- <translation>All Files (*.*)</translation>
- </message>
- <message>
- <source>FLT_MED_FILES</source>
- <translation>MED Files (*.med)</translation>
- </message>
- <message>
- <source>HELP</source>
- <translation>Help</translation>
- </message>
- <message>
- <source>IMPORT_FROM_FILE</source>
- <translation>Import from File</translation>
- </message>
- <message>
- <source>IMPORT_PROGRESS</source>
- <translation>Import progress</translation>
- </message>
- <message>
- <source>IMPORT_SETTINGS</source>
- <translation>Settings</translation>
- </message>
- <message>
- <source>IMPORT_TIME</source>
- <translation>Time</translation>
- </message>
- <message>
- <source>START</source>
- <translation>Start</translation>
- </message>
- <message>
- <source>TIME</source>
- <translation>Elapsed time : </translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CacheDlg</name>
- <message>
- <source>CACHE_TITLE</source>
- <translation>Cache properties</translation>
- </message>
- <message>
- <source>FREE</source>
- <translation>Free</translation>
- </message>
- <message>
- <source>LIMITED_MEMORY</source>
- <translation>Limited memory</translation>
- </message>
- <message>
- <source>MEMORY STATE</source>
- <translation>Memory state</translation>
- </message>
- <message>
- <source>MEMORY_MODE</source>
- <translation>Memory mode</translation>
- </message>
- <message>
- <source>MINIMAL_MEMORY</source>
- <translation>Minimal memory</translation>
- </message>
- <message>
- <source>USED_BY_CACHE</source>
- <translation>Used by cache</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ClippingDlg</name>
- <message>
- <source>AUTO_APPLY_CHK</source>
- <translation>Auto Apply</translation>
- </message>
- <message>
- <source>BUT_DELETE</source>
- <translation>Delete</translation>
- </message>
- <message>
- <source>BUT_NEW</source>
- <translation>New</translation>
- </message>
- <message>
- <source>GRP_IJK_AXIS</source>
- <translation>Axis</translation>
- </message>
- <message>
- <source>GRP_PARAMETERS</source>
- <translation>Parameters</translation>
- </message>
- <message>
- <source>GRP_PLANES</source>
- <translation>Clipping planes</translation>
- </message>
- <message>
- <source>I_RADIO_BTN</source>
- <translation>I</translation>
- </message>
- <message>
- <source>J_RADIO_BTN</source>
- <translation>J</translation>
- </message>
- <message>
- <source>K_RADIO_BTN</source>
- <translation>K</translation>
- </message>
- <message>
- <source>LBL_DISTANCE</source>
- <translation>Distance</translation>
- </message>
- <message>
- <source>LBL_IJK_INDEX</source>
- <translation>Index (from 0 to ...)</translation>
- </message>
- <message>
- <source>LBL_IJK_INDEX_TO_arg</source>
- <translation>Index (from 0 to %1) </translation>
- </message>
- <message>
- <source>LBL_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>LBL_ROTATION_XY</source>
- <translation>Rotation around Z (X to Y):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_XZ</source>
- <translation>Rotation around Y (X to Z):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_YX</source>
- <translation>Rotation around Z (Y to X):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_YZ</source>
- <translation>Rotation around X (Y to Z):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_ZX</source>
- <translation>Rotation around Y (Z to X):</translation>
- </message>
- <message>
- <source>LBL_ROTATION_ZY</source>
- <translation>Rotation around X (Z to Y):</translation>
- </message>
- <message>
- <source>PARALLEL_XOY_COMBO_ITEM</source>
- <translation>|| X-Y</translation>
- </message>
- <message>
- <source>PARALLEL_YOZ_COMBO_ITEM</source>
- <translation>|| Y-Z</translation>
- </message>
- <message>
- <source>PARALLEL_ZOX_COMBO_ITEM</source>
- <translation>|| Z-X</translation>
- </message>
- <message>
- <source>PLANES_COMBO_ITEM_i</source>
- <translation>Plane# %1</translation>
- </message>
- <message>
- <source>PLANES_COMBO_ITEM_no</source>
- <translation>No planes</translation>
- </message>
- <message>
- <source>REVERSE_NORMAL_CHK</source>
- <translation>Reverse normal</translation>
- </message>
- <message>
- <source>SHOW_PREVIEW_CHK</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>TAB_IJK_STRUCTURED</source>
- <translation>IJK (Structured)</translation>
- </message>
- <message>
- <source>TAB_NON_STRUCTURED</source>
- <translation>Non structured</translation>
- </message>
- <message>
- <source>TITLE</source>
- <translation>Change Clipping</translation>
- </message>
- <message>
- <source>WRN_EMPTY_RESULTING_PRS</source>
- <translation>Impossible to use given clipping planes because of VTK restrictions.
-Please, provide non-empty resulting presentation.</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CubeAxesDlg</name>
- <message>
- <source>CAPTION</source>
- <translation>Graduated axes</translation>
- </message>
- <message>
- <source>IS_VISIBLE</source>
- <translation>Is visible</translation>
- </message>
- <message>
- <source>X_AXIS</source>
- <translation>X axis</translation>
- </message>
- <message>
- <source>Y_AXIS</source>
- <translation>Y axis</translation>
- </message>
- <message>
- <source>Z_AXIS</source>
- <translation>Z axis</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CursorDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>TextLabel1</source>
- <translation>Set value between</translation>
- </message>
- <message>
- <source>TextLabel2</source>
- <translation>minimal and maximal</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CutLinesDlg</name>
- <message>
- <source>BASE_PLANE_POS</source>
- <translation>Base plane position</translation>
- </message>
- <message>
- <source>LBL_ABSOLUTE_LENGTH</source>
- <translation>Use absolute length</translation>
- </message>
- <message>
- <source>LBL_GENERATE_CURVES</source>
- <translation>Generate Curves</translation>
- </message>
- <message>
- <source>LBL_GENERATE_TABLE</source>
- <translation>Generate Data Table</translation>
- </message>
- <message>
- <source>LBL_INVERT_CURVES</source>
- <translation>Invert all curves</translation>
- </message>
- <message>
- <source>LBL_LINES_CUT</source>
- <translation>Cut planes</translation>
- </message>
- <message>
- <source>LBL_LINES_PLANE</source>
- <translation>Plane of lines</translation>
- </message>
- <message>
- <source>LBL_NB_PLANS</source>
- <translation>Number of planes:</translation>
- </message>
- <message>
- <source>LBL_POS</source>
- <translation>Displacement (0...1):</translation>
- </message>
- <message>
- <source>LBL_ROTATION</source>
- <translation>Rotations</translation>
- </message>
- <message>
- <source>LBL_ROT_X</source>
- <translation>Rotation around X (Y to Z):</translation>
- </message>
- <message>
- <source>LBL_ROT_Y</source>
- <translation>Rotation around Y (Z to X):</translation>
- </message>
- <message>
- <source>LBL_ROT_Z</source>
- <translation>Rotation around Z (X to Y):</translation>
- </message>
- <message>
- <source>LBL_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>PARALLEL_XOY</source>
- <translation>|| X-Y</translation>
- </message>
- <message>
- <source>PARALLEL_YOZ</source>
- <translation>|| Y-Z</translation>
- </message>
- <message>
- <source>PARALLEL_ZOX</source>
- <translation>|| Z-X</translation>
- </message>
- <message>
- <source>SET_DEFAULT</source>
- <translation>Set default</translation>
- </message>
- <message>
- <source>TXT_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CutPlanesDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_CutPlanesPane</name>
- <message>
- <source>LBL_NB_PLANS</source>
- <translation>Number of planes:</translation>
- </message>
- <message>
- <source>LBL_POS</source>
- <translation>Displacement (0...1):</translation>
- </message>
- <message>
- <source>LBL_ROTATION</source>
- <translation>Rotations</translation>
- </message>
- <message>
- <source>LBL_ROT_X</source>
- <translation>Rotation around X (Y to Z):</translation>
- </message>
- <message>
- <source>LBL_ROT_Y</source>
- <translation>Rotation around Y (Z to X):</translation>
- </message>
- <message>
- <source>LBL_ROT_Z</source>
- <translation>Rotation around Z (X to Y):</translation>
- </message>
- <message>
- <source>LBL_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>PARALLEL_XOY</source>
- <translation>// X-Y</translation>
- </message>
- <message>
- <source>PARALLEL_YOZ</source>
- <translation>// Y-Z</translation>
- </message>
- <message>
- <source>PARALLEL_ZOX</source>
- <translation>// Z-X</translation>
- </message>
- <message>
- <source>TXT_ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>LBL_DEFORMATION</source>
- <translation>Deformation</translation>
- </message>
- <message>
- <source>LBL_DEFROMATION_SCALE</source>
- <translation>Scale Factor :</translation>
- </message>
- <message>
- <source>LBL_DEFROMATION_VECT</source>
- <translation>Vectors :</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_DeformedShapeDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DEFORMED_SHAPE_TAB</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>INPUT_TAB</source>
- <translation>Input</translation>
- </message>
- <message>
- <source>MAGNITUDE_COLORING</source>
- <translation>Magnitude coloring</translation>
- </message>
- <message>
- <source>SCALAR_BAR_TAB</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>SCALE_FACTOR</source>
- <translation>Scale Factor:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_EditContainerDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>LBL_CONTAINER</source>
- <translation>Container</translation>
- </message>
- <message>
- <source>LBL_STUDY</source>
- <translation>Study</translation>
- </message>
- <message>
- <source>TXT_CURVE</source>
- <translation>Curve</translation>
- </message>
- <message>
- <source>TXT_TABLE</source>
- <translation>Table</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FileDlg</name>
- <message>
- <source>FULL_LOAD</source>
- <translation>Full loading for current file</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FontWg</name>
- <message>
- <source>ARIAL</source>
- <translation>Arial</translation>
- </message>
- <message>
- <source>BOLD</source>
- <translation>Bold</translation>
- </message>
- <message>
- <source>COURIER</source>
- <translation>Courier</translation>
- </message>
- <message>
- <source>ITALIC</source>
- <translation>Italic</translation>
- </message>
- <message>
- <source>SHADOW</source>
- <translation>Shadow</translation>
- </message>
- <message>
- <source>TIMES</source>
- <translation>Times</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_GaussPointsDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DEFORMED_SHAPE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>DEFORMED_SHAPE_TITLE</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>DLG_PREF_TITLE</source>
- <translation>Gauss Points Preferences</translation>
- </message>
- <message>
- <source>DLG_PROP_TITLE</source>
- <translation>Gauss Points Properties</translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>GAUSS_POINTS_TAB</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>GEOMETRY</source>
- <translation>Geometry</translation>
- </message>
- <message>
- <source>INPUT_TAB</source>
- <translation>Input</translation>
- </message>
- <message>
- <source>PRS_TITLE</source>
- <translation>Presentation</translation>
- </message>
- <message>
- <source>RESULTS</source>
- <translation>Results</translation>
- </message>
- <message>
- <source>SCALAR_BAR_TAB</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>SCALE_FACTOR</source>
- <translation>Scale Factor :</translation>
- </message>
- <message>
- <source>WARNING</source>
- <translation>Warning</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_GaussScalarBarPane</name>
- <message>
- <source>ACTIVE_BAR_GRP</source>
- <translation>Active bar</translation>
- </message>
- <message>
- <source>BICOLOR</source>
- <translation>Bicolor</translation>
- </message>
- <message>
- <source>COLORS_LABELS_GRP</source>
- <translation>Colors and labels</translation>
- </message>
- <message>
- <source>DIMENSIONS_GRP</source>
- <translation>Dimensions</translation>
- </message>
- <message>
- <source>DISPLAYED</source>
- <translation>Displayed</translation>
- </message>
- <message>
- <source>FIELD_RANGE_BTN</source>
- <translation>Use field range</translation>
- </message>
- <message>
- <source>GLOBAL</source>
- <translation>Global</translation>
- </message>
- <message>
- <source>HORIZONTAL_BTN</source>
- <translation>Horizontal</translation>
- </message>
- <message>
- <source>IMPOSED_RANGE_BTN</source>
- <translation>Use imposed range</translation>
- </message>
- <message>
- <source>LBL_HEIGHT</source>
- <translation>Height:</translation>
- </message>
- <message>
- <source>LBL_MAX</source>
- <translation>Max:</translation>
- </message>
- <message>
- <source>LBL_MIN</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>LBL_NB_COLORS</source>
- <translation>Nb. of colors:</translation>
- </message>
- <message>
- <source>LBL_NB_LABELS</source>
- <translation>Nb. of labels:</translation>
- </message>
- <message>
- <source>LBL_SPACING</source>
- <translation>Spacing:</translation>
- </message>
- <message>
- <source>LBL_WIDTH</source>
- <translation>Width:</translation>
- </message>
- <message>
- <source>LBL_X</source>
- <translation>X:</translation>
- </message>
- <message>
- <source>LBL_Y</source>
- <translation>Y:</translation>
- </message>
- <message>
- <source>LOCAL</source>
- <translation>Local</translation>
- </message>
- <message>
- <source>LOGARITHMIC_SCALING</source>
- <translation>Logarithmic scaling</translation>
- </message>
- <message>
- <source>ORIENTATION_GRP</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>ORIGIN_GRP</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>RAINBOW</source>
- <translation>Rainbow</translation>
- </message>
- <message>
- <source>SAVE_DEFAULT_CHK</source>
- <translation>Save as default values</translation>
- </message>
- <message>
- <source>SCALAR_RANGE_GRP</source>
- <translation>Scalar range</translation>
- </message>
- <message>
- <source>VERTICAL_BTN</source>
- <translation>Vertical</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_InputPane</name>
- <message>
- <source>ENTITY</source>
- <translation>Entity :</translation>
- </message>
- <message>
- <source>FIELD</source>
- <translation>Field :</translation>
- </message>
- <message>
- <source>MED_FILE</source>
- <translation>Source File :</translation>
- </message>
- <message>
- <source>MESH</source>
- <translation>Mesh :</translation>
- </message>
- <message>
- <source>PRS_DATA_SOUIRCE</source>
- <translation>Data Source</translation>
- </message>
- <message>
- <source>REINITIALIZE</source>
- <translation>Auto Update</translation>
- </message>
- <message>
- <source>TIME_STAMP</source>
- <translation>Time Stamp :</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_IsoSurfPane</name>
- <message>
- <source>MAX_VALUE</source>
- <translation>Maximum value:</translation>
- </message>
- <message>
- <source>MIN_VALUE</source>
- <translation>Minimum value:</translation>
- </message>
- <message>
- <source>MSG_MINMAX_VALUES</source>
- <translation>Min value can not be higher or equal to Max value</translation>
- </message>
- <message>
- <source>NB_SURFACES</source>
- <translation>Number of surfaces:</translation>
- </message>
- <message>
- <source>MAGNITUDE_COLORING_CHK</source>
- <translation>Magnitude coloring</translation>
- </message>
- <message>
- <source>SEL_COLOR_BTN</source>
- <translation>Select Color</translation>
- </message>
- <message>
- <source>SHOW_VALUES_CHK</source>
- <translation>Show values (nb per surface)</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_IsoSurfacesDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DEFINE_ISOSURFACES</source>
- <translation>Iso Surfaces Definition</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ItemContainer</name>
- <message>
- <source>AUTO_CHECK_LBL</source>
- <translation>Auto assign</translation>
- </message>
- <message>
- <source>CIRCLE_MARKER_LBL</source>
- <translation>Circle</translation>
- </message>
- <message>
- <source>CROSS_MARKER_LBL</source>
- <translation>Cross</translation>
- </message>
- <message>
- <source>DAHSDOTDOT_LINE_LBL</source>
- <translation>DashDotDot</translation>
- </message>
- <message>
- <source>DASHDOT_LINE_LBL</source>
- <translation>DashDot</translation>
- </message>
- <message>
- <source>DASH_LINE_LBL</source>
- <translation>Dash</translation>
- </message>
- <message>
- <source>DIAMOND_MARKER_LBL</source>
- <translation>Diamond</translation>
- </message>
- <message>
- <source>DOT_LINE_LBL</source>
- <translation>Dot</translation>
- </message>
- <message>
- <source>DTRIANGLE_MARKER_LBL</source>
- <translation>Downward triangle</translation>
- </message>
- <message>
- <source>H</source>
- <translation> H </translation>
- </message>
- <message>
- <source>LTRIANGLE_MARKER_LBL</source>
- <translation>Leftward triangle</translation>
- </message>
- <message>
- <source>NONE_LINE_LBL</source>
- <translation>None</translation>
- </message>
- <message>
- <source>NONE_MARKER_LBL</source>
- <translation>None</translation>
- </message>
- <message>
- <source>RECTANGLE_MARKER_LBL</source>
- <translation>Rectangle</translation>
- </message>
- <message>
- <source>RTRIANGLE_MARKER_LBL</source>
- <translation>Rightward triangle</translation>
- </message>
- <message>
- <source>SOLID_LINE_LBL</source>
- <translation>Solid</translation>
- </message>
- <message>
- <source>UTRIANGLE_MARKER_LBL</source>
- <translation>Upward triangle</translation>
- </message>
- <message>
- <source>V</source>
- <translation> V </translation>
- </message>
- <message>
- <source>XCROSS_MARKER_LBL</source>
- <translation>Diagonal cross</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Module</name>
- <message>
- <source>MEN_DESK_FILE_SAVE_GUI_STATE</source>
- <translation>Save VISU state</translation>
- </message>
- <message>
- <source>MEN_GAUSS</source>
- <translation>Gauss</translation>
- </message>
- <message>
- <source>MEN_GAUSS_CREATE_PRS</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>MEN_GAUSS_NEW_VIEWER</source>
- <translation>Points view</translation>
- </message>
- <message>
- <source>MEN_OVERWRITE_CONFIGURATION</source>
- <translation>Overwrite current configuration</translation>
- </message>
- <message>
- <source>MEN_RESTORE_CONFIGURATION</source>
- <translation>Restore current configuration</translation>
- </message>
- <message>
- <source>MEN_SAVE_CONFIGURATION</source>
- <translation>Store current configuration</translation>
- </message>
- <message>
- <source>MEN_VISUALISATION</source>
- <translation>Visualization</translation>
- </message>
- <message>
- <source>PRP_DESK_FILE_SAVE_GUI_STATE</source>
- <translation>Saves current state of viewers, displayed objects, etc.</translation>
- </message>
- <message>
- <source>TOOL_IMPORT</source>
- <translation>Import Toolbar</translation>
- </message>
- <message>
- <source>TOOL_VISUALISATION</source>
- <translation>Visualization Toolbar</translation>
- </message>
- <message>
- <source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
- <translation>Save VISU state</translation>
- </message>
- <message>
- <source>VISU_CAMERA_MOVE_PREF</source>
- <translation>Number of steps between two positions</translation>
- </message>
- <message>
- <source>VISU_CAMERA_PREF_GROUP_TTL</source>
- <translation>Camera movements</translation>
- </message>
- <message>
- <source>VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL</source>
- <translation>Inside Cursor</translation>
- </message>
- <message>
- <source>VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL</source>
- <translation>Outside Cursor</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_ACTIVE_BAR</source>
- <translation>Active bar</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_ALPHA_TEXTURE</source>
- <translation>Alpha Channel Texture (16x16)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_ALPHA_THRESHOLD</source>
- <translation>Alpha Channel Threshold</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_BICOLOR</source>
- <translation>Bicolor</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_CLAMP</source>
- <translation>Maximum Size (Clamp)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_COLOR</source>
- <translation>Color</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_COLOR_GROUP_TTL</source>
- <translation>Color</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_DEFORMED_SHAPE_GROUP_TTL</source>
- <translation>Deformed Shape</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_DISPLAY_GLOBAL</source>
- <translation>Display global bar</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_FACE_LIMIT</source>
- <translation>Notify when number of faces exceeds</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_GEOMSPHERE</source>
- <translation>Geometrical sphere</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_GEOM_GROUP_TTL</source>
- <translation>Geometry</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_GLOBAL</source>
- <translation>Global</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_INCREMENT</source>
- <translation>+/- Ratio</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_LOCAL</source>
- <translation>Local</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MAGNIFICATION</source>
- <translation>Magnification (%)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MAGNIFICATION_GROUP_TTL</source>
- <translation>Magnification (Inside and Outside)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MAIN_TEXTURE</source>
- <translation>Main Texture (16x16)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MAX_SIZE</source>
- <translation>Range value for max size (%)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_MIN_SIZE</source>
- <translation>Range value for min size (%)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_OPENGLPOINT</source>
- <translation>OpenGL point</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_POINTSPRITE</source>
- <translation>Point sprite</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL</source>
- <translation>Primitive</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_PRIMITIVE_TYPE</source>
- <translation>Primitive Type</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_RAINBOW</source>
- <translation>Rainbow</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_RESOLUTION</source>
- <translation>Geometrical sphere resolution</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SCALAR_BAR_MODE</source>
- <translation>Scalar bar mode</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SCALE_FACTOR</source>
- <translation>Scale factor</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SIZE</source>
- <translation>Size of points (%)</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SIZE_GROUP_TTL</source>
- <translation>Size</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_SPACING</source>
- <translation>Spacing</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_TAB_TTL</source>
- <translation>Gauss Points</translation>
- </message>
- <message>
- <source>VISU_GAUSS_PREF_UNIFORM_COLOR</source>
- <translation>Uniform Color</translation>
- </message>
- <message>
- <source>VISU_GAUSS_SCALAR_BAR_PREF_GROUP_TTL</source>
- <translation>Gauss Points Scalar Bar</translation>
- </message>
- <message>
- <source>VISU_GAUSS_SCALAR_BAR_PREF_TAB_TTL</source>
- <translation>Gauss Points Scalar Bar</translation>
- </message>
- <message>
- <source>VISU_KEYBOARD_PREF</source>
- <translation>[+]/[-] Speed increment</translation>
- </message>
- <message>
- <source>VISU_KEYBOARD_PREF_GROUP_TTL</source>
- <translation>Keyboard</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF</source>
- <translation>Mouse behaviour</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF_GROUP_TLT</source>
- <translation>Mouse</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF_KEYBOARD_FREE</source>
- <translation>Keyboard free</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF_STANDARD</source>
- <translation>Salome standard controls</translation>
- </message>
- <message>
- <source>VISU_MOUSE_PREF_TAB_TLT</source>
- <translation>Navigation</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_BELOW_POINT</source>
- <translation>Centered below the point</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_CAMERA_GROUP_TTL</source>
- <translation>Movement of the camera</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_CURSOR_GROUP_TTL</source>
- <translation>Cursor</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_CURSOR_SIZE</source>
- <translation>Size of the cursor</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_DISPLAY_PARENT_MESH</source>
- <translation>Display parent mesh element</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL</source>
- <translation>Information window</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_PARENT_MESH_TTL</source>
- <translation>Parent mesh element</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_POINT_SELECTION_TOLERANCE</source>
- <translation>Point selection tolerance</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_POSITION</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_PYRAMID_HEIGHT</source>
- <translation>Height of the pyramids</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_SELECTION_COLOR</source>
- <translation>Selection cursor color</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_STEP_NUMBER</source>
- <translation>Number of steps between two positions</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_TAB_TTL</source>
- <translation>Picking</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_TOLERANCE_GROUP_TTL</source>
- <translation>Tolerance</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_TOP_LEFT_CORNER</source>
- <translation>Top-left corner of the 3D view</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_TRANSPARENCY</source>
- <translation>Transparency</translation>
- </message>
- <message>
- <source>VISU_PICKING_PREF_ZOOM_FACTOR</source>
- <translation>Zoom at first selected point (ratio)</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_ALL_DISLPAYED_FRAMES</source>
- <translation>Recording all displayed frames</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_FPS</source>
- <translation>FPS</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_GROUP_TTL</source>
- <translation>Settings</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_PROGRESSIVE</source>
- <translation>Progressive</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_QUALITY</source>
- <translation>Quality</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_RECORDING_MODE</source>
- <translation>Mode</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_SKIPPED_FRAMES</source>
- <translation>Recording at a given FPS</translation>
- </message>
- <message>
- <source>VISU_RECORDER_PREF_TAB_TTL</source>
- <translation>Recorder</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF</source>
- <translation>Spacemouse</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_1</source>
- <translation>Decrease speed increment</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_2</source>
- <translation>Increase speed increment</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_3</source>
- <translation>Decrease Gauss points magnification</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_4</source>
- <translation>Increase Gauss points magnification</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_5</source>
- <translation>Dominant / combined switch</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_*</source>
- <translation>Button *</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_1</source>
- <translation>Button 1</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_10</source>
- <translation>Button 10</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_11</source>
- <translation>Button 11</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_2</source>
- <translation>Button 2</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_3</source>
- <translation>Button 3</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_4</source>
- <translation>Button 4</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_5</source>
- <translation>Button 5</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_6</source>
- <translation>Button 6</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_7</source>
- <translation>Button 7</translation>
- </message>
- <message>
- <source>VISU_SPACEMOUSE_PREF_BTN_8</source>
- <translation>Button 8</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_NameDlg</name>
- <message>
- <source>NAME_LBL</source>
- <translation>Name: </translation>
- </message>
- <message>
- <source>TLT_RENAME</source>
- <translation>Rename</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_NonIsometricDlg</name>
- <message>
- <source>&Apply</source>
- <translation></translation>
- </message>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&Reset</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Scaling</translation>
- </message>
- <message>
- <source>LBL_X</source>
- <translation>X :</translation>
- </message>
- <message>
- <source>LBL_Y</source>
- <translation>Y :</translation>
- </message>
- <message>
- <source>LBL_Z</source>
- <translation>Z :</translation>
- </message>
- <message>
- <source>O&K</source>
- <translation></translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Plot3DDlg</name>
- <message>
- <source>INPUT_TAB_TITLE</source>
- <translation>Input</translation>
- </message>
- <message>
- <source>PLOT3D_TAB_TITLE</source>
- <translation>Plot 3D</translation>
- </message>
- <message>
- <source>SCALAR_BAR_TAB_TITLE</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>TITLE</source>
- <translation>Plot3D Definition</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Plot3DPane</name>
- <message>
- <source>CONTOUR</source>
- <translation>Contour</translation>
- </message>
- <message>
- <source>NUMBER_CONTOURS</source>
- <translation>Number of contours:</translation>
- </message>
- <message>
- <source>ORIENTATION</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>POSITION</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>POSITION_VALUE</source>
- <translation>Value: </translation>
- </message>
- <message>
- <source>PRESENTATION_TYPE</source>
- <translation>Presentation type</translation>
- </message>
- <message>
- <source>PREVIEW</source>
- <translation>Preview cutting plane</translation>
- </message>
- <message>
- <source>RELATIVE</source>
- <translation>Relative</translation>
- </message>
- <message>
- <source>ROTATIONS</source>
- <translation>Rotations</translation>
- </message>
- <message>
- <source>ROTATION_X</source>
- <translation>Rotation around X (Y to Z):</translation>
- </message>
- <message>
- <source>ROTATION_Y</source>
- <translation>Rotation around Y (Z to X):</translation>
- </message>
- <message>
- <source>ROTATION_Z</source>
- <translation>Rotation around Z (X to Y):</translation>
- </message>
- <message>
- <source>SCALE</source>
- <translation>Scale Factor:</translation>
- </message>
- <message>
- <source>SURFACE</source>
- <translation>Surface</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ScalarBarDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_PREF_TITLE</source>
- <translation>Scalar Bar Preferences</translation>
- </message>
- <message>
- <source>DLG_PROP_TITLE</source>
- <translation>Scalar Bar Properties</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_ScalarBarPane</name>
- <message>
- <source>COLORS_LABELS_GRP</source>
- <translation>Colors and labels</translation>
- </message>
- <message>
- <source>DIMENSIONS_GRP</source>
- <translation>Dimensions</translation>
- </message>
- <message>
- <source>FIELD_RANGE_BTN</source>
- <translation>Use field range</translation>
- </message>
- <message>
- <source>HORIZONTAL_BTN</source>
- <translation>Horizontal</translation>
- </message>
- <message>
- <source>IMPOSED_RANGE_BTN</source>
- <translation>Use imposed range</translation>
- </message>
- <message>
- <source>LBL_HEIGHT</source>
- <translation>Height:</translation>
- </message>
- <message>
- <source>LBL_MAX</source>
- <translation>Max:</translation>
- </message>
- <message>
- <source>LBL_MIN</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>LBL_NB_COLORS</source>
- <translation>Nb. of colors:</translation>
- </message>
- <message>
- <source>LBL_NB_LABELS</source>
- <translation>Nb. of labels:</translation>
- </message>
- <message>
- <source>LBL_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>LBL_WIDTH</source>
- <translation>Width:</translation>
- </message>
- <message>
- <source>LBL_X</source>
- <translation>X:</translation>
- </message>
- <message>
- <source>LBL_Y</source>
- <translation>Y:</translation>
- </message>
- <message>
- <source>LOGARITHMIC_SCALING</source>
- <translation>Logarithmic scaling</translation>
- </message>
- <message>
- <source>MSG_MINMAX_VALUES</source>
- <translation>Min value can not be higher or equal to Max value</translation>
- </message>
- <message>
- <source>ORIENTATION_GRP</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>ORIGIN_GRP</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>SAVE_DEFAULT_CHK</source>
- <translation>Save as default values</translation>
- </message>
- <message>
- <source>SCALAR_RANGE_GRP</source>
- <translation>Scalar range</translation>
- </message>
- <message>
- <source>VERTICAL_BTN</source>
- <translation>Vertical</translation>
- </message>
- <message>
- <source>WRN_LOGARITHMIC_FIELD_RANGE</source>
- <translation>Logarithmic scaling: field range contains negative values, use imposed range instead</translation>
- </message>
- <message>
- <source>WRN_LOGARITHMIC_RANGE</source>
- <translation>Logarithmic scaling: use imposed range values > 0</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_DeformedShapeAndScalarMapDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Deformed Shape and Scalar Map</translation>
- </message>
- <message>
- <source>FIELD_ITEM</source>
- <translation>Scalar Field:</translation>
- </message>
- <message>
- <source>INPUT_TAB</source>
- <translation>Input</translation>
- </message>
- <message>
- <source>SCALAR_BAR_TAB</source>
- <translation>Scalar Bar</translation>
- </message>
- <message>
- <source>DEFORMED_SHAPE_AND_SCALAR_MAP_TAB</source>
- <translation>Deformed Shape and Scalar Map</translation>
- </message>
- <message>
- <source>SCALE_FACTOR</source>
- <translation>Scale Factor:</translation>
- </message>
- <message>
- <source>TIMESTAMP_ITEM</source>
- <translation>Current Time Stamp:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_SetupPlot2dDlg</name>
- <message>
- <source>BUT_NO</source>
- <translation>No</translation>
- </message>
- <message>
- <source>BUT_YES</source>
- <translation>Yes</translation>
- </message>
- <message>
- <source>QUE_WANT_SAME_UNITS</source>
- <translation>Do you want to choose all items with the same units for vertical axis?</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Slider</name>
- <message>
- <source>AVI</source>
- <translation>AVI</translation>
- </message>
- <message>
- <source>CACHE_MEMORY</source>
- <translation>Cache:</translation>
- </message>
- <message>
- <source>FREE_MEMORY</source>
- <translation>Free:</translation>
- </message>
- <message>
- <source>MORE</source>
- <translation>More...</translation>
- </message>
- <message>
- <source>SPEED</source>
- <translation>Speed:</translation>
- </message>
- <message>
- <source>TOOLBAR_TITLE</source>
- <translation>Slider</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_StreamLinesDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Stream lines Preferences</translation>
- </message>
- <message>
- <source>LBL_DIRECTION</source>
- <translation>Direction</translation>
- </message>
- <message>
- <source>LBL_INTEGRATION_STEP</source>
- <translation>Integration Step</translation>
- </message>
- <message>
- <source>LBL_PROPAGATION_TIME</source>
- <translation>Propagation Time</translation>
- </message>
- <message>
- <source>LBL_SOURCE_TYPE</source>
- <translation>Source type</translation>
- </message>
- <message>
- <source>LBL_STEP_LENGTH</source>
- <translation>Step Length</translation>
- </message>
- <message>
- <source>LBL_USED_POINTS</source>
- <translation>Used points (0..1)</translation>
- </message>
- <message>
- <source>MAGNITUDE_COLORING_CHK</source>
- <translation>Magnitude coloring</translation>
- </message>
- <message>
- <source>SOURCE_GRP</source>
- <translation>Source</translation>
- </message>
- <message>
- <source>USE_COLOR_BTN</source>
- <translation>Use Color</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_SweepPrefDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Sweeping Preferences</translation>
- </message>
- <message>
- <source>LBL_NB_CYCLES</source>
- <translation>Number of cycles:</translation>
- </message>
- <message>
- <source>LBL_NB_STEPS</source>
- <translation>Number of steps:</translation>
- </message>
- <message>
- <source>LBL_TIME_STEP</source>
- <translation>Time step (second):</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TableDlg</name>
- <message>
- <source>EDIT_TABLE_TLT</source>
- <translation>Edit Table</translation>
- </message>
- <message>
- <source>ERR_TABLE_NOT_AVAILABLE</source>
- <translation>Table is not available</translation>
- </message>
- <message>
- <source>TABLE_OF_INTEGER_TLT</source>
- <translation>Table of integer</translation>
- </message>
- <message>
- <source>TABLE_OF_REAL_TLT</source>
- <translation>Table of real</translation>
- </message>
- <message>
- <source>VIEW_TABLE_TLT</source>
- <translation>View Table</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TableWidget</name>
- <message>
- <source>ADD_COLUMN_BTN</source>
- <translation>Add Column</translation>
- </message>
- <message>
- <source>ADD_ROW_BTN</source>
- <translation>Add Row</translation>
- </message>
- <message>
- <source>ADJUST_CELLS_BTN</source>
- <translation>Adjust Cells</translation>
- </message>
- <message>
- <source>CLEAR_BTN</source>
- <translation>Clear</translation>
- </message>
- <message>
- <source>REMOVE_COLUMN_BTN</source>
- <translation>Remove Column(s)</translation>
- </message>
- <message>
- <source>REMOVE_ROW_BTN</source>
- <translation>Remove Row(s)</translation>
- </message>
- <message>
- <source>SELECT_ALL_BTN</source>
- <translation>Select All</translation>
- </message>
- <message>
- <source>SET_TITLE_TLT</source>
- <translation>Set title</translation>
- </message>
- <message>
- <source>TITLE_LBL</source>
- <translation>Title:</translation>
- </message>
- <message>
- <source>UNITS_TLT</source>
- <translation>Units</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TextPrefDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>LBL_BOLD</source>
- <translation>Bold</translation>
- </message>
- <message>
- <source>LBL_ITALIC</source>
- <translation>Italic</translation>
- </message>
- <message>
- <source>LBL_LABELS</source>
- <translation>Labels</translation>
- </message>
- <message>
- <source>LBL_SHADOW</source>
- <translation>Shadow</translation>
- </message>
- <message>
- <source>LBL_TITLE</source>
- <translation>Title</translation>
- </message>
- <message>
- <source>TIT_TEXT_PREF</source>
- <translation>Text properties</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TimeAnimationDlg</name>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>ERROR</source>
- <translation>Error</translation>
- </message>
- <message>
- <source>MSG_NO_ANIMATIONDATA</source>
- <translation>There is no data for animation</translation>
- </message>
- <message>
- <source>MSG_NO_AVI_MAKER</source>
- <translation>Tool jpeg2yuv, necessary for AVI recording, is not available.
-Please, refer to the documentation.</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TransparencyDlg</name>
- <message>
- <source>BUT_CLOSE</source>
- <translation>Close</translation>
- </message>
- <message>
- <source>TRANSPARENCY_OPAQUE</source>
- <translation>Opaque</translation>
- </message>
- <message>
- <source>TRANSPARENCY_TITLE</source>
- <translation>Change Transparency</translation>
- </message>
- <message>
- <source>TRANSPARENCY_TRANSPARENT</source>
- <translation>Transparent</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_VectorsDlg</name>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>ARROWS_BTN</source>
- <translation>Arrows</translation>
- </message>
- <message>
- <source>CENTER_BTN</source>
- <translation>Center</translation>
- </message>
- <message>
- <source>CONES2_BTN</source>
- <translation>Cones (2)</translation>
- </message>
- <message>
- <source>CONES6_BTN</source>
- <translation>Cones (6)</translation>
- </message>
- <message>
- <source>DLG_TITLE</source>
- <translation>Vector Field Representation</translation>
- </message>
- <message>
- <source>GLYPH_POSITION_GRP</source>
- <translation>Glyph position</translation>
- </message>
- <message>
- <source>GLYPH_TYPE_GRP</source>
- <translation>Glyph type</translation>
- </message>
- <message>
- <source>HEAD_BTN</source>
- <translation>Head</translation>
- </message>
- <message>
- <source>LBL_LINE_WIDTH</source>
- <translation>Line width:</translation>
- </message>
- <message>
- <source>LBL_SCALE_FACTOR</source>
- <translation>Scale factor:</translation>
- </message>
- <message>
- <source>MAGNITUDE_COLORING_CHK</source>
- <translation>Magnitude coloring</translation>
- </message>
- <message>
- <source>SEL_COLOR_BTN</source>
- <translation>Select Color</translation>
- </message>
- <message>
- <source>TAIL_BTN</source>
- <translation>Tail</translation>
- </message>
- <message>
- <source>USE_GLYPHS_CHK</source>
- <translation>Use glyphs</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_SelectionDlg</name>
- <message>
- <source>WINDOW_TITLE</source>
- <translation>Data on elements</translation>
- </message>
- <message>
- <source>MODE_TITLE</source>
- <translation>Selection</translation>
- </message>
- <message>
- <source>MODE_POINT</source>
- <translation>Point</translation>
- </message>
- <message>
- <source>MODE_CELL</source>
- <translation>Cell</translation>
- </message>
- <message>
- <source>MODE_ACTOR</source>
- <translation>Actor</translation>
- </message>
- <message>
- <source>MESH_NAME_LBL</source>
- <translation>Mesh name:</translation>
- </message>
- <message>
- <source>FIELD_NAME_LBL</source>
- <translation>Field name:</translation>
- </message>
- <message>
- <source>POINT_DATA_TITLE</source>
- <translation>Data of Point</translation>
- </message>
- <message>
- <source>DATA_ID_LBL</source>
- <translation>ID:</translation>
- </message>
- <message>
- <source>DATA_SCALAR_LBL</source>
- <translation>Scalar Value:</translation>
- </message>
- <message>
- <source>DATA_VECTOR_LBL</source>
- <translation>Vector Value:</translation>
- </message>
- <message>
- <source>POINT_COORD_TITLE</source>
- <translation>Coordinates</translation>
- </message>
- <message>
- <source>CELL_DATA_TITLE</source>
- <translation>Data of Cell</translation>
- </message>
- <message>
- <source>CELL_DATA_ID_LBL</source>
- <translation>ID:</translation>
- </message>
- <message>
- <source>CELL_DATA_SCALAR_HDR</source>
- <translation>Scalar</translation>
- </message>
- <message>
- <source>CELL_DATA_VECTOR_HDR</source>
- <translation>Vector</translation>
- </message>
- <message>
- <source>ACTOR_DATA_POSITION_TITLE</source>
- <translation>Position</translation>
- </message>
- <message>
- <source>ACTOR_DATA_SIZE_TITLE</source>
- <translation>Size</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_BarPrefDlg</name>
- <message>
- <source>&OK</source>
- <translation></translation>
- </message>
- <message>
- <source>&Cancel</source>
- <translation></translation>
- </message>
- <message>
- <source>TIT_BAR_PREF</source>
- <translation>Bar properties</translation>
- </message>
- <message>
- <source>LBL_TITLE_W</source>
- <translation>Title width (%)</translation>
- </message>
- <message>
- <source>LBL_TITLE_H</source>
- <translation>Title height (%)</translation>
- </message>
- <message>
- <source>LBL_LABEL_W</source>
- <translation>Label width (%)</translation>
- </message>
- <message>
- <source>LBL_LABEL_H</source>
- <translation>Label height (%)</translation>
- </message>
- <message>
- <source>LBL_BAR_W</source>
- <translation>Bar width (%)</translation>
- </message>
- <message>
- <source>LBL_BAR_H</source>
- <translation>Bar height (%)</translation>
- </message>
- <message>
- <source>LBL_SHOW_UNITS</source>
- <translation>Show units</translation>
- </message>
- <message>
- <source>LBL_UNITS_FORMAT</source>
- <translation>Format:</translation>
- </message>
- <message>
- <source>MSG_LABEL_FORMAT</source>
- <translation>Labels format is invalid.</translation>
- </message>
- <message>
- <source>MSG_BIG_SCALE</source>
- <translation>The common (Title, Label, Bar) width or height should not be greater then 100%.</translation>
- </message>
- <message>
- <source>AUTO</source>
- <translation>auto</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Table3DDlg</name>
- <message>
- <source>DLG_PREF_TITLE</source>
- <translation>Table 3D Bar Preferences</translation>
- </message>
- <message>
- <source>DLG_PROP_TITLE</source>
- <translation>Scalar Bar Properties</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_TableScalarBarPane</name>
- <message>
- <source>SCALAR_RANGE_GRP</source>
- <translation>Scalar range</translation>
- </message>
- <message>
- <source>LOGARITHMIC_SCALING</source>
- <translation>Logarithmic scaling</translation>
- </message>
- <message>
- <source>FIELD_RANGE_BTN</source>
- <translation>Use field range</translation>
- </message>
- <message>
- <source>IMPOSED_RANGE_BTN</source>
- <translation>Use imposed range</translation>
- </message>
- <message>
- <source>LBL_MIN</source>
- <translation>Min:</translation>
- </message>
- <message>
- <source>LBL_MAX</source>
- <translation>Max:</translation>
- </message>
- <message>
- <source>COLORS_LABELS_GRP</source>
- <translation>Colors and labels</translation>
- </message>
- <message>
- <source>LBL_NB_COLORS</source>
- <translation>Nb. of colors:</translation>
- </message>
- <message>
- <source>LBL_NB_LABELS</source>
- <translation>Nb. of labels:</translation>
- </message>
- <message>
- <source>ORIENTATION_GRP</source>
- <translation>Orientation</translation>
- </message>
- <message>
- <source>VERTICAL_BTN</source>
- <translation>Vertical</translation>
- </message>
- <message>
- <source>HORIZONTAL_BTN</source>
- <translation>Horizontal</translation>
- </message>
- <message>
- <source>ORIGIN_GRP</source>
- <translation>Origin</translation>
- </message>
- <message>
- <source>LBL_X</source>
- <translation>X:</translation>
- </message>
- <message>
- <source>LBL_Y</source>
- <translation>Y:</translation>
- </message>
- <message>
- <source>LBL_SHOW_PREVIEW</source>
- <translation>Show preview</translation>
- </message>
- <message>
- <source>DIMENSIONS_GRP</source>
- <translation>Dimensions</translation>
- </message>
- <message>
- <source>LBL_WIDTH</source>
- <translation>Width:</translation>
- </message>
- <message>
- <source>LBL_HEIGHT</source>
- <translation>Height:</translation>
- </message>
- <message>
- <source>SAVE_DEFAULT_CHK</source>
- <translation>Save as default values</translation>
- </message>
- <message>
- <source>MSG_MINMAX_VALUES</source>
- <translation>Min value can not be higher or equal to Max value</translation>
- </message>
- <message>
- <source>WRN_LOGARITHMIC_RANGE</source>
- <translation>Logarithmic scaling: use imposed range values > 0</translation>
- </message>
- <message>
- <source>WRN_LOGARITHMIC_FIELD_RANGE</source>
- <translation>Logarithmic scaling: field range contains negative values, use imposed range instead</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_Table3DPane</name>
- <message>
- <source>SCALE</source>
- <translation>Scale Factor:</translation>
- </message>
- <message>
- <source>PRESENTATION_TYPE</source>
- <translation>Presentation type</translation>
- </message>
- <message>
- <source>SURFACE</source>
- <translation>Surface</translation>
- </message>
- <message>
- <source>CONTOUR</source>
- <translation>Contour</translation>
- </message>
- <message>
- <source>NUMBER_CONTOURS</source>
- <translation>Number of contours:</translation>
- </message>
- </context>
- <context>
- <name>VisuGUI_FileInfoDlg</name>
- <message>
- <source>CAPTION</source>
- <translation>File information</translation>
- </message>
- <message>
- <source>FILE_NAME</source>
- <translation>File name</translation>
- </message>
- <message>
- <source>FILE_SIZE</source>
- <translation>File size (bytes)</translation>
- </message>
- <message>
- <source>MED_VERSION</source>
- <translation>MED version</translation>
- </message>
- </context>
-</TS>
#include "SVTK_ViewWindow.h"
#include "SVTK_ViewModel.h"
#include "SVTK_Functor.h"
+//#include "SVTK_MainWindow.h"
#include "SPlot2d_ViewModel.h"
#include "VisuGUI_SetupPlot2dDlg.h"
#include "VisuGUI_Prs3dTools.h"
#include "VisuGUI_Tools.h"
-#include "VisuGUI_PopupTools.h"
+#include "VisuGUI_SelectionPanel.h"
+#include "VisuGUI_FeatureEdgesPanel.h"
#include "VisuGUI_NameDlg.h"
#include "VisuGUI_CursorDlg.h"
#include "VisuGUI_Selection.h"
#include "VisuGUI_TransparencyDlg.h"
#include "VisuGUI_CacheDlg.h"
#include "VisuGUI_Table3dDlg.h"
+#include "VisuGUI_ClippingPanel.h"
+#include "VisuGUI_FilterScalarsDlg.h"
#include "VISU_ScalarMap_i.hh"
#include "VisuGUI_ScalarBarDlg.h"
#include "VisuGUI_Timer.h"
-#include "VVTK_ViewModel.h"
+//#include "VVTK_ViewModel.h"
+
+#include "VisuGUI_Slider.h"
+#include "VisuGUI_Sweep.h"
+#include <VISU_ScalarMapAct.h>
+#include <VISU_GaussPtsAct.h>
+#include <VisuGUI_ValuesLabelingDlg.h>
using namespace VISU;
VisuGUI
::VisuGUI():
SalomeApp_Module( "VISU" ),
- myDisplayer( 0 )
+ myDisplayer( 0 ),
+ mySlider( NULL ),
+ mySweep( NULL )
{
}
-
VisuGUI
::~VisuGUI()
{
::OnImportFromFile()
{
if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()");
+
if ( CheckLock(GetCStudy(GetAppStudy(this)),GetDesktop(this)) )
return;
SalomeApp_CheckFileDlg fd( GetDesktop(this), true, tr("USE_BUILD_PROGRESS") );
fd.setWindowTitle( tr( "IMPORT_FROM_FILE" ) );
- fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
+ fd.setFileMode( SalomeApp_CheckFileDlg::ExistingFiles );
fd.setFilters( aFilter );
fd.SetChecked( toUseBuildProgress );
if ( SalomeApp_CheckFileDlg::getLastVisitedPath().isEmpty() )
for ( QStringList::ConstIterator it = fileNames.begin(); it != fileNames.end(); ++it ) {
QFileInfo aFileInfo( *it );
-
+
if ( !aFileInfo.exists() ) {
// file not exist
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
bool toBuildGroups = aResourceMgr->booleanValue( "VISU", "build_groups", true );
bool toBuildAll = aResourceMgr->booleanValue( "VISU", "full_med_loading", false );
bool toBuildAtOnce = aResourceMgr->booleanValue( "VISU", "build_at_once", false );
-
- QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
+
+ QString anInfo( tr( "IMPORT_FROM_FILE" ) + " " + aFileInfo.filePath() + " ... " );
application()->putInfo( anInfo );
-
+
VISU::Result_var aResult = GetVisuGen( this )->CreateResult( aFileInfo.filePath().toLatin1().constData() );
-
+
if ( CORBA::is_nil( aResult.in() ) ) {
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
}
else {
try {
- QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
+ QString anInfo( tr("TLT_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
application()->putInfo( anInfo );
-
+
CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath().toLatin1().constData());
-
+
if (CORBA::is_nil(anObject.in())) {
errors.append( QString( "%1 :\n\t%2" ).arg( aFileInfo.filePath() ).
arg( tr( "ERR_ERROR_IN_THE_FILE" ) ) );
- }
+ }
else {
application()->putInfo( anInfo + tr("INF_DONE") );
}
SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this);
// create mesh presentation and display it in aViewWindow
- CreateMesh(this, anIO, aViewWindow);
+ VISU::Mesh_i* aPrs = CreateMesh(this, anIO, aViewWindow);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
return;
// create mesh presentation and display it in aViewWindow
- CreateMesh(this, anIO, aViewWindow);
+ VISU::Mesh_i* aPrs = CreateMesh(this, anIO, aViewWindow);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
}
VisuGUI
::OnCreateScalarMap()
{
- CreatePrs3d<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg,1>(this);
+ Prs3d_i* aPrs = CreatePrs3d<VISU::ScalarMap_i,VisuGUI_ScalarBarDlg,1>(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
VisuGUI
::OnCreateDeformedShape()
{
- CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
+ // CreatePrs3d<VISU::DeformedShape_i,VisuGUI_DeformedShapeDlg,1>(this);
+ Prs3d_i* aPrs = VisuGUI_DeformedShapeDlg::CreatePrs3d(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
VisuGUI
::OnCreateDeformedShapeAndScalarMap()
{
- CreatePrs3d<VISU::DeformedShapeAndScalarMap_i,VisuGUI_DeformedShapeAndScalarMapDlg,1>(this);
+ Prs3d_i* aPrs = CreatePrs3d<VISU::DeformedShapeAndScalarMap_i,VisuGUI_DeformedShapeAndScalarMapDlg,1>(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
VisuGUI
::OnCreateVectors()
{
- CreatePrs3d<VISU::Vectors_i,VisuGUI_VectorsDlg,1>(this);
+ Prs3d_i* aPrs = CreatePrs3d<VISU::Vectors_i,VisuGUI_VectorsDlg,1>(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
VisuGUI
::OnCreateIsoSurfaces()
{
- CreatePrs3d<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg,1>(this);
+ Prs3d_i* aPrs = CreatePrs3d<VISU::IsoSurfaces_i,VisuGUI_IsoSurfacesDlg,1>(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
VisuGUI
::OnCreateCutPlanes()
{
- CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,0>(this);
+ Prs3d_i* aPrs = CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,0>(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
VisuGUI
::OnCreateCutLines()
{
- CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,0>(this);
+ Prs3d_i* aPrs = CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,0>(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
VisuGUI
::OnCreateStreamLines()
{
- CreatePrs3d<VISU::StreamLines_i,VisuGUI_StreamLinesDlg,1>(this);
+ Prs3d_i* aPrs = CreatePrs3d<VISU::StreamLines_i,VisuGUI_StreamLinesDlg,1>(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
VisuGUI
::OnCreatePlot3D()
{
- CreatePrs3d<VISU::Plot3D_i,VisuGUI_Plot3DDlg,0>(this);
+ Prs3d_i* aPrs = CreatePrs3d<VISU::Plot3D_i,VisuGUI_Plot3DDlg,0>(this);
+ if (aPrs)
+ emit presentationCreated(aPrs);
}
void
ChangeRepresentation(this, VISU::SHRINK);
}
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnMakeFeatureEdges()
+{
+ ChangeRepresentation(this, VISU::FEATURE_EDGES);
+}
+
//----------------------------------------------------------------------------
void
VisuGUI
}
-namespace
-{
- //----------------------------------------------------------------------------
- bool
- GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
- VISU::Prs3d_i*& thePrs3d,
- SVTK_ViewWindow*& theViewWindow,
- VISU_Actor*& thenActor)
- {
- VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
- if(aSelectionInfo.empty())
- return false;
-
- VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
- thePrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
- if(!thePrs3d)
- return false;
-
- theViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(theModule);
- if(!theViewWindow)
- return false;
-
- thenActor = FindActor(theViewWindow, thePrs3d);
- if(!thenActor)
- return false;
-
- return true;
- }
-}
-
//----------------------------------------------------------------------------
void
VisuGUI
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
return;
-
+
VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase;
Handle(SALOME_InteractiveObject) anIO;
for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
anIO = it.Value();
- aNameList.append("\n - ");
- aNameList.append(anIO->getName());
if (anIO->hasEntry()) {
- if (IsRemovable(anIO->getEntry(), this))
- anEntries[i++] = anIO->getEntry();
+ if (IsRemovable(anIO->getEntry(), this)) {
+ aNameList.append("\n - ");
+ // Get Name Of the Main Object if it's a referenced object
+ VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
+ if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ _PTR(SObject) aRefSObject;
+ if (aSObject->ReferencedObject(aRefSObject)) {
+ QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
+ aNameList.append( aRefName );
+ }
+ else
+ aNameList.append(anIO->getName());
+ }
+ anEntries[i++] = anIO->getEntry();
+ }
}
}
nbSelected = i;
SUIT_MessageBox::warning(GetDesktop(this),
QObject::tr("WRN_VISU"),
QObject::tr("WRN_NO_APPROPRIATE_SELECTION"));
+ return;
}
if ( SUIT_MessageBox::question( GetDesktop(this),
for (i = 0; i < nbSelected; i++) {
VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anEntries[i]);
if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+ emit beforeObjectDelete(QString(aSObject->GetID().c_str()));
_PTR(SObject) aRefSObject;
if (aSObject->ReferencedObject(aRefSObject)) {
// It can be a reference on curve, published under a container.
case VISU::TPOINTMAP3D: { // Table object
if (VISU::PointMap3d_i* aTable3d = dynamic_cast<VISU::PointMap3d_i*>(aBase)) {
aTable3d->SetTitle(Name.toLatin1().constData());
- aTable3d->UpdateActors();
+ aTable3d->UpdateActors();
}
break;
}
}
UpdateObjBrowser(this, false);
-
QApplication::restoreOverrideCursor();
}
}
VisuGUI
::OnSweep()
{
- VISU_Actor* anActor = NULL;
- VISU::Prs3d_i* aPrs3d = NULL;
- SVTK_ViewWindow* aViewWindow = NULL;
- if(!GetPrs3dSelectionInfo(this, aPrs3d, aViewWindow, anActor))
- return;
-
- VISU::ScalarMap_i* aScalarMap = dynamic_cast<VISU::ScalarMap_i*>(aPrs3d);
- if(!aScalarMap)
- return;
-
- if(!anActor->GetVisibility())
- anActor->VisibilityOn();
-
- // Get sweep parameters
- SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
-
- double aTempoDbl = aResourceMgr->doubleValue("VISU", "sweeping_time_step", 0.1);
- int aTemp = int(1.E6 * aTempoDbl);
-
- int aCycles = aResourceMgr->integerValue("VISU", "sweeping_number_cycles", 1);
- int aSteps = aResourceMgr->integerValue("VISU", "sweeping_number_steps", 40);
-
- int aMode = aResourceMgr->integerValue("VISU", "sweeping_modes", 0);
-
- int is2Pi = aResourceMgr->integerValue("VISU", "sweeping_is2PI", 0);
-
- // Sweep
- QApplication::setOverrideCursor(Qt::WaitCursor);
-
- for (int j = 0; j < aCycles; j++) {
- for (int i = 0; i <= aSteps; i++) {
- try {
- float aPercents;
- float aT;
- if( aMode >= 1 )
- aT = ( is2Pi == 1 ? -PI + 2. * PI * float(i)/aSteps : PI * float(i)/aSteps );
- if( aMode == 1 ){ //if selected Periodic cosinusoidal mode of sweeping
- //This is necessary in order for animation to return to the initial picture
- aPercents = (1.-cos( aT ))/2.;
- }
- else if( aMode == 2 ){ //if selected Periodic sinusoidal mode of sweeping
- //This is necessary in order for animation to return to the initial picture
- aPercents = sin( aT - PI/2 );
- }
- else //if selected Linear mode of sweeping
- aPercents = float(i)/aSteps;
- aScalarMap->SetMapScale(aPercents);
- aScalarMap->UpdateActor(anActor);
- aViewWindow->getRenderWindow()->Render();
- aViewWindow->Repaint();
- usleep(aTemp);
- } catch (std::exception& exc) {
- INFOS("Follow exception was occured :\n" << exc.what());
- } catch (...) {
- INFOS("Unknown exception was occured!");
- }
- }
- }
- QApplication::restoreOverrideCursor();
+ mySweep->toggleViewAction()->setChecked(true);
+ mySweep->onPlay(true);
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void
VisuGUI
-::OnSelectionInfo()
+::OnToggleSelectionPanel()
{
if (GetActiveViewWindow<SVTK_ViewWindow>(this))
- (new VisuGUI_SelectionDlg(this))->show();
+ {
+ if( myPanels.find( SelectionPanelId ) != myPanels.end() )
+ {
+ if( VisuGUI_SelectionPanel* aSelectionPanel =
+ dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
+ {
+ if( aSelectionPanel->isVisible() )
+ aSelectionPanel->hide();
+ else
+ aSelectionPanel->show();
+ }
+ }
+ }
else
SUIT_MessageBox::warning(GetDesktop(this),
tr("WRN_VISU"),
tr("ERR_ACTIVATE_VIEW3D") );
}
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnSwitchSelectionMode()
+{
+ QAction* anAction = dynamic_cast<QAction*>( sender() );
+ if( !anAction )
+ return;
+
+ bool isAnyChecked = false;
+ for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
+ {
+ QAction* aRefAction = action( anId );
+ isAnyChecked |= aRefAction->isChecked();
+ if( anAction != aRefAction )
+ aRefAction->setChecked( false );
+ else if( myPanels.find( SelectionPanelId ) != myPanels.end() )
+ {
+ if( VisuGUI_SelectionPanel* aSelectionPanel =
+ dynamic_cast<VisuGUI_SelectionPanel*>( myPanels[ SelectionPanelId ] ) )
+ aSelectionPanel->setSelectionMode( anId - VISU_ACTOR_SELECTION );
+ }
+ }
+ // At least one action must be checked
+ if( !isAnyChecked )
+ anAction->setChecked( true );
+}
+
+//----------------------------------------------------------------------------
+void
+VisuGUI
+::OnSwitchSelectionMode( int theId )
+{
+ for( int anId = VISU_ACTOR_SELECTION; anId <= VISU_GAUSS_POINT_SELECTION; anId++ )
+ {
+ QAction* aRefAction = action( anId );
+ aRefAction->setChecked( anId == VISU_ACTOR_SELECTION + theId );
+ }
+}
+
//----------------------------------------------------------------------------
void
VisuGUI
{
SalomeApp_Module::initialize( theApp );
+ mySlider = new VisuGUI_Slider( this, getApp()->desktop(), getApp()->selectionMgr() );
+
+ mySweep = new VisuGUI_Sweep( this, getApp()->desktop(), getApp()->selectionMgr() );
+
createActions();
createMenus();
createToolBars();
createPopupMenus();
+ createPanels();
+
+ // tmp
+ action( VISU_ACTOR_SELECTION )->setChecked( true );
}
void
tr("MEN_UNSHRINK"), "", 0, aParent, false,
this, SLOT(OnMakeShrink()));
+ createAction( VISU_FEATURE_EDGES, tr("MEN_FEATURE_EDGES"), QIcon(),
+ tr("MEN_FEATURE_EDGES"), "", 0, aParent, false,
+ this, SLOT(OnMakeFeatureEdges()));
+
createAction( VISU_SHADING, tr("MEN_SHADING"), QIcon(),
tr("MEN_SHADING"), "", 0, aParent, false,
this, SLOT(OnSetShadingOn()));
tr("MEN_CLIPPING"), "", 0, aParent, false,
this, SLOT(OnClippingPlanes()));
- createAction( VISU_SELECTION_INFO, tr("MEN_SELECTION_INFO"), QIcon(),
- tr("MEN_SELECTION_INFO"), "", 0, aParent, false,
- this, SLOT(OnSelectionInfo()));
-
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
createAction( VISU_PARALLELANIMATION, tr("MEN_PARALLEL_ANIMATION"), QIcon(aPixmap),
tr("MEN_PARALLEL_ANIMATION"), "", 0, aParent, false,
tr("MEN_ERASE_ALL"), "", 0, aParent, false,
this, SLOT(OnEraseAll()));
- aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION"));
- createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIcon(aPixmap),
- tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
- this);
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SELECTION_PANEL"));
+ createAction( VISU_SELECTION_PANEL, tr("MEN_SELECTION_PANEL"), QIcon(aPixmap),
+ tr("MEN_SELECTION_PANEL"), "", 0, aParent, false,
+ this, SLOT(OnToggleSelectionPanel()));
+
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ACTOR_SELECTION"));
+ createAction( VISU_ACTOR_SELECTION, tr("MEN_ACTOR_SELECTION"), QIcon(aPixmap),
+ tr("MEN_ACTOR_SELECTION"), "", 0, aParent, true,
+ this, SLOT(OnSwitchSelectionMode()));
+
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CELL_SELECTION"));
+ createAction( VISU_CELL_SELECTION, tr("MEN_CELL_SELECTION"), QIcon(aPixmap),
+ tr("MEN_CELL_SELECTION"), "", 0, aParent, true,
+ this, SLOT(OnSwitchSelectionMode()));
+
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINT_SELECTION"));
+ createAction( VISU_POINT_SELECTION, tr("MEN_POINT_SELECTION"), QIcon(aPixmap),
+ tr("MEN_POINT_SELECTION"), "", 0, aParent, true,
+ this, SLOT(OnSwitchSelectionMode()));
- aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION"));
- createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIcon(aPixmap),
- tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
- this);
+ aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_POINT_SELECTION"));
+ createAction( VISU_GAUSS_POINT_SELECTION, tr("MEN_GAUSS_POINT_SELECTION"), QIcon(aPixmap),
+ tr("MEN_GAUSS_POINT_SELECTION"), "", 0, aParent, true,
+ this, SLOT(OnSwitchSelectionMode()));
+
+ // Defenition of the actions for the "Navigation" tool bar
+ registerAction( VISU_SLIDER_PANEL, mySlider->toggleViewAction() );
+ registerAction( VISU_SWEEP_PANEL, mySweep->toggleViewAction() );
createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIcon(),
tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
this, SLOT(OnPlot3dFromCutPlane()));
- createAction( VISU_CACHE_PROPERTIES, tr("MEN_CACHE_PROPERTIES"), QIcon(),
- tr("MEN_CACHE_PROPERTIES"), "", 0, aParent, false,
- this, SLOT(OnCacheProperties()));
+ createAction( VISU_MANAGE_CACHE, tr("MEN_MANAGE_CACHE"), QIcon(),
+ tr("MEN_MANAGE_CACHE"), "", 0, aParent, false,
+ this, SLOT( OnManageCache() ) );
aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_FULL"));
createAction( VISU_MULTIPR_FULL_RES, tr("MEN_MULTIPR_VIEW_FULL_RES"), QIcon(aPixmap),
createAction( VISU_EXPORT_MED, tr("MEN_EXPORT_MED"), QIcon(),
tr("MEN_EXPORT_MED"), "", 0, aParent, false,
this, SLOT(OnExportMED()));
+
+ createAction( VISU_FILTERSCALARS, tr("MEN_FILTER_SCALARS"), QIcon(),
+ tr("MEN_FILTER_SCALARS"), "", 0, aParent, false,
+ this, SLOT(OnFilterScalars()));
+
+ createAction( VISU_VALUES_LABELING, tr("MEN_VALUES_LABELING"), QIcon(),
+ tr("MEN_VALUES_LABELING"), "", 0, aParent, true,
+ this, SLOT(OnValuesLabeling()));
+
+ createAction( VISU_VALUES_LABELING_PARAMS, tr("VISU_VALUES_LABELING_PARAMS"), QIcon(),
+ tr("VISU_VALUES_LABELING_PARAMS"), "", 0, aParent, false,
+ this, SLOT(OnValuesLabelingParams()));
+
}
void
createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
createMenu( VISU_DEFORMED_SHAPE_AND_SCALAR_MAP, aMenuId, 10 ); // scalar map on deformed shape
- aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
- createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
-
aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
int parentId =
createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection
createMenu( VISU_WIREFRAME, parentId, 10 ); // wireframe
createMenu( VISU_SURFACE, parentId, 10 ); // surface
createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
- createMenu( VISU_GLOBAL_SELECTION, aMenuId, 10 ); // global selection
- createMenu( VISU_PARTIAL_SELECTION, aMenuId, 10 ); // partial selection
}
void
createTool( VISU_WIREFRAME, aToolId );
createTool( VISU_SURFACE, aToolId );
createTool( VISU_ERASE_ALL, aToolId );
- createTool( VISU_GLOBAL_SELECTION, aToolId );
- createTool( VISU_PARTIAL_SELECTION, aToolId );
+
+ aToolId = createTool(tr("TOOL_SELECTION"));
+ createTool( VISU_SELECTION_PANEL, aToolId );
+ createTool( separator(), aToolId );
+ createTool( VISU_ACTOR_SELECTION, aToolId );
+ createTool( VISU_CELL_SELECTION, aToolId );
+ createTool( VISU_POINT_SELECTION, aToolId );
+ createTool( VISU_GAUSS_POINT_SELECTION, aToolId );
+
+ aToolId = createTool( tr( "TOOL_NAVIGATION" ) );
+ createTool( VISU_SLIDER_PANEL, aToolId );
+ createTool( separator(), aToolId );
+ createTool( VISU_SWEEP_PANEL, aToolId );
}
void
mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
mgr->insert( action( VISU_EDIT_POINTMAP3D ), -1, -1, -1 );
+ mgr->insert( action( VISU_FILTERSCALARS ), -1, -1, -1 );
+
// rename
mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
// delete
mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
+
+ // labeling
+ mgr->insert( separator(), -1, -1, -1 );
+ mgr->insert( action( VISU_VALUES_LABELING ), -1, -1, -1 );
+ mgr->insert( action( VISU_VALUES_LABELING_PARAMS ), -1, -1, -1 );
+ mgr->insert( separator(), -1, -1, -1 );
// table commands
mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
mgr->insert( action( VISU_SURFACE ) , parentId, -1, -1 ); // surface
mgr->insert( action( VISU_INSIDEFRAME ) , parentId, -1, -1 ); // insideframe
mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
+ mgr->insert( action( VISU_FEATURE_EDGES ), parentId, -1, -1 ); // feature edges
mgr->insert( action( VISU_SHRINK ) , parentId, -1, -1 ); // shrink
mgr->insert( action( VISU_UNSHRINK ) , parentId, -1, -1 ); // unshrink
mgr->insert( separator(), parentId, -1, -1 );
mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
- mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
-
mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
"'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
"'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCOLOREDPRS3DHOLDER'");
+ QString aSimplePrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
+ "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' "
+ "'VISU::TSCALARMAPONDEFORMEDSHAPE'");
// VISU root commands
QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule );
mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule );
+ aRule = "selcount=1 and $type in { " + aSimplePrsAll + "}";
+ mgr->setRule( action( VISU_FILTERSCALARS ), aRule );
+
+ // labeling
+
+ aRule = "hasActor=1 and selcount=1 and $type in { 'VISU::TGAUSSPOINTS'" + aPrsAll + " }";
+ mgr->setRule( action( VISU_VALUES_LABELING ), aRule, QtxPopupMgr::VisibleRule );
+ mgr->setRule( action( VISU_VALUES_LABELING ), "{true} in $isValuesLabeled", QtxPopupMgr::ToggleRule );
+ mgr->setRule( action( VISU_VALUES_LABELING_PARAMS ), aRule, QtxPopupMgr::VisibleRule );
+
// view parameters
aRule = "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'";
mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule );
mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D' and activeView='VTKViewer'" );
//mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
- mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'VVTK'} and selcount=0" );
+ mgr->setRule( action( VISU_ARRANGE_ACTORS ), "$client in {'VTKViewer' 'SVTK'} and selcount=0" );
// 3D presentations commands
- QString aPrsType = " and $type in {'VISU::TMESH'" + aPrsAll + "}";
+ QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TGAUSSPOINTS' " + aPrsAll + "}";
QString aPrsType2 = " and $type in {'VISU::TMESH' 'VISU::TPOINTMAP3D'" + aPrsAll + "}";
QString anInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
- QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
+ //QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP'}";
+ QString aSurfFrameType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TCUTPLANES' 'VISU::TISOSURFACES' 'VISU::TPLOT3D' }";
+ //QString aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
QString aSurfType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
" 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
QString aLineType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TSCALARMAP' 'VISU::TISOSURFACES' 'VISU::TDEFORMEDSHAPE' "
"'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D' 'VISU::TSCALARMAPONDEFORMEDSHAPE' 'VISU::TDEFORMEDSHAPEANDSCALARMAP' 'VISU::TPOINTMAP3D'}";
+ QString aFeatureEdgesType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP''VISU::TDEFORMEDSHAPE' 'VISU::TSCALARMAPONDEFORMEDSHAPE'}";
+
aRule = "selcount=1";
mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType );
+ aPrsType = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
// "Representation" submenu
- QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
- QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
- QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
- QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME'}";
- QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}";
+ QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
+ QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
+ QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
+ QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME' 'VISU::FEATURE_EDGES'}";
+ QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::FEATURE_EDGES'}";
+ QString aNotFeatureEdges = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
mgr->setRule( action( VISU_POINTS ) , aRule + aPrsType + aNotPoints );
mgr->setRule( action( VISU_WIREFRAME ) , aRule + aPrsType2 + aNotWirefr );
mgr->setRule( action( VISU_SURFACE ) , aRule + aSurfType + aNotSurfac );
mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + anInsideType + aNotInside );
mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfFrameType + aNotSurffr );
+ mgr->setRule( action( VISU_FEATURE_EDGES ), aRule + aFeatureEdgesType + aNotFeatureEdges );
mgr->setRule( action( VISU_SHRINK ) , aRule + aShrinkType + " and isShrunk=0" );
mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1" );
aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
mgr->setRule( action( VISU_CREATE_TABLE ), aRule );
- aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
+ aRule = "client='VTKViewer' and selcount=1 and ($type in {" + aSimplePrsAll + "})";
mgr->setRule( action( VISU_SWEEP ), aRule );
- // "Selection info" popup item
- aRule = "client='VTKViewer' and selcount=1" + anInsideType;
- mgr->setRule( action( VISU_SELECTION_INFO ), aRule );
-
aRule = "client='ObjectBrowser' and selcount>0";
aRule += " and $type in {'VISU::TFIELD'}";
aRule += " and nbTimeStamps>1";
- aRule += " and activeView in {'VTKViewer' 'VVTK'}";
+ aRule += " and activeView in {'VTKViewer' 'SVTK'}";
mgr->setRule( action( VISU_PARALLELANIMATION ), aRule );
- aRule = "client='ObjectBrowser' and selcount>0";
+ aRule = "client='ObjectBrowser'";
+ aRule += " and (selcount=1 and nbTimeStamps>1 or selcount>1 and nbTimeStamps>0)";
aRule += " and $type in {'VISU::TFIELD'}";
- aRule += " and nbTimeStamps>0";
- aRule += " and activeView in {'VTKViewer' 'VVTK'}";
+ aRule += " and activeView in {'VTKViewer' 'SVTK'}";
mgr->setRule( action( VISU_SUCCCESSIVEANIMATION ), aRule );
aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
mgr->setRule( action( VISU_EXPORT_MED ), "selcount=1 and type in {'VISU::TRESULT'}" );
}
+void VisuGUI::createPanels()
+{
+ myPanels.insert( SelectionPanelId, new VisuGUI_SelectionPanel( this ) );
+ myPanels.insert( FeatureEdgesPanelId, new VisuGUI_FeatureEdgesPanel( this ) );
+ myPanels.insert( ClippingPlanesPanelId, new VisuGUI_ClippingPanel( this ) );
+
+ QMap< PanelId, VisuGUI_Panel* >::iterator it = myPanels.begin(), itEnd = myPanels.end();
+ for( ; it != itEnd; ++it )
+ {
+ if( VisuGUI_Panel* aPanel = it.value() )
+ {
+ aPanel->hide();
+ GetDesktop(this)->addDockWidget( Qt::RightDockWidgetArea, aPanel );
+ }
+ }
+}
+
//***************************************************************************
void VisuGUI::contextMenuPopup( const QString& theClient, QMenu* theMenu, QString& theTitle )
{
if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
if(aBase->GetType() == VISU::TCOLOREDPRS3DCACHE)
- theMenu->addAction( action( VISU_CACHE_PROPERTIES ) );
+ theMenu->addAction( action( VISU_MANAGE_CACHE ) );
}
theMenu->addSeparator();
{
theList.clear();
// 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
+// 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() );
}
VisuGUI
::activateModule( SUIT_Study* theStudy )
{
- SalomeApp_Module::activateModule( theStudy );
+ bool aResult = SalomeApp_Module::activateModule( theStudy );
+
studyActivated();
setMenuShown( true );
setToolShown( true );
action(VISU_DELETE_OBJS)->setEnabled(true); // Delete: Key_Delete
action(VISU_RENAME )->setEnabled(true); // Rename: Key_F2
- return true;
+ ((VisuGUI_ClippingPanel*) myPanels[ClippingPlanesPanelId])->init();
+
+ emit moduleActivated();
+
+ return aResult;
}
setMenuShown( false );
setToolShown( false );
+ QMap< PanelId, VisuGUI_Panel* >::iterator it = myPanels.begin(), itEnd = myPanels.end();
+ for( ; it != itEnd; ++it )
+ {
+ if( VisuGUI_Panel* aPanel = it.value() )
+ aPanel->hide();
+ }
+
// Unset actions accelerator keys
action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); // Import: CTRL + Key_I
action(VISU_DELETE_OBJS)->setEnabled(false); // Delete: Key_Delete
action(VISU_RENAME )->setEnabled(false); // Rename: Key_F2
- SalomeApp_Module::deactivateModule( theStudy );
- return true;
+ bool aResult = SalomeApp_Module::deactivateModule( theStudy );
+
+ emit moduleDeactivated();
+
+ return aResult;
}
LightApp_Selection*
void VisuGUI::studyActivated()
{
GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
+
}
/*
int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
setPreferenceProperty( fontGr, "columns", 2 );
- int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
+ addVtkFontPref( tr( "VISU_TITLE" ), fontGr, "scalar_bar_title_font", false );
addPreference( tr( "VISU_TITLE" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
- int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
- addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
- QStringList fam;
- fam.append( tr( "VISU_FONT_ARIAL" ) );
- fam.append( tr( "VISU_FONT_COURIER" ) );
- fam.append( tr( "VISU_FONT_TIMES" ) );
- int wflag = ( QtxFontEdit::All & ( ~( QtxFontEdit::Size | QtxFontEdit::UserSize ) ) );
-
- setPreferenceProperty( tfont, "families", fam );
- setPreferenceProperty( tfont, "system", false );
- setPreferenceProperty( tfont, "widget_flags", wflag );
- setPreferenceProperty( lfont, "families", fam );
- setPreferenceProperty( lfont, "system", false );
- setPreferenceProperty( lfont, "widget_flags", wflag );
+ addVtkFontPref( tr( "VISU_LABELS" ), fontGr, "scalar_bar_label_font", false );
+ addPreference( tr( "VISU_LABELS" ), fontGr, LightApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
// group: "Colors & Labels"
int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
setPreferenceProperty( numlab, "min", 2 );
setPreferenceProperty( numlab, "max", 65 );
- addPreference( tr( "VISU_LABELS_FORMAT" ), colorsLabelsGr,
- LightApp_Preferences::String, "VISU", "scalar_bar_label_format" );
+ int lPrec = addPreference( tr( "PRECISION" ), colorsLabelsGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_label_precision" );
+
+ setPreferenceProperty( lPrec, "min", 1 );
+ setPreferenceProperty( lPrec, "max", 100 );
+
+ int frame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
+ setPreferenceProperty( frame, "orientation", "horizontal" );
// group: "Orientation"
- int orientGr = addPreference( tr( "VISU_ORIENTATION" ), sbarTab );
+ int orientGr = addPreference( tr( "VISU_ORIENTATION" ), frame, LightApp_Preferences::GroupBox );
setPreferenceProperty( orientGr, "columns", 2 );
int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr,
LightApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
setPreferenceProperty( orient, "strings", orients );
setPreferenceProperty( orient, "indexes", indices );
+ // group: "Scalar bars default position"
+ int scalarBarGr = addPreference( tr( "Scalar bars default position" ), frame, LightApp_Preferences::GroupBox );
+ addPreference( tr( "Arrange Scalar Bars" ), scalarBarGr, LightApp_Preferences::Bool, "VISU", "scalar_bars_default_position" );
+
+
// group: "Origin & Size Vertical"
- int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
+ int psSzFrame = addPreference( "", sbarTab, LightApp_Preferences::Frame, "", "" );
+ setPreferenceProperty( psSzFrame, "orientation", "horizontal" );
+
+ int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ),
+ psSzFrame, LightApp_Preferences::GroupBox );
setPreferenceProperty( posVSizeGr, "columns", 2 );
int xv = addPreference( tr( "VISU_X" ), posVSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
- int twv = addPreference( tr( "VISU_TITLE_WIDTH" ), posVSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_width" );
- int thv = addPreference( tr( "VISU_TITLE_HEIGHT" ), posVSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_height" );
-
- int lwv = addPreference( tr( "VISU_LABEL_WIDTH" ), posVSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_width" );
- int lhv = addPreference( tr( "VISU_LABEL_HEIGHT" ), posVSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_height" );
-
+ int twv = addPreference( tr( "VISU_TITLE_SIZE" ), posVSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_title_size" );
+
+ int lwv = addPreference( tr( "VISU_LABEL_SIZE" ), posVSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_label_size" );
+
int bwv = addPreference( tr( "VISU_BAR_WIDTH" ), posVSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_vertical_bar_width" );
int bhv = addPreference( tr( "VISU_BAR_HEIGHT" ), posVSizeGr,
setPreferenceProperty( hv, "min", 0.0 );
setPreferenceProperty( twv, "min", 0 );
setPreferenceProperty( twv, "special", "auto" );
- setPreferenceProperty( thv, "min", 0 );
- setPreferenceProperty( thv, "special", "auto" );
setPreferenceProperty( lwv, "min", 0 );
setPreferenceProperty( lwv, "special", "auto" );
- setPreferenceProperty( lhv, "min", 0 );
- setPreferenceProperty( lhv, "special", "auto" );
setPreferenceProperty( bwv, "min", 0 );
setPreferenceProperty( bwv, "special", "auto" );
setPreferenceProperty( bhv, "min", 0 );
setPreferenceProperty( wv, "max", 1.0 );
setPreferenceProperty( hv, "max", 1.0 );
setPreferenceProperty( twv, "max", 100 );
- setPreferenceProperty( thv, "max", 100 );
setPreferenceProperty( lwv, "max", 100 );
- setPreferenceProperty( lhv, "max", 100 );
setPreferenceProperty( bwv, "max", 100 );
setPreferenceProperty( bhv, "max", 100 );
// group: "Origin & Size Horizontal"
- int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab );
+ int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ),
+ psSzFrame, LightApp_Preferences::GroupBox );
setPreferenceProperty( posHSizeGr, "columns", 2 );
int xh = addPreference( tr( "VISU_X" ), posHSizeGr,
int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr,
LightApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
- int twh = addPreference( tr( "Title width (%)" ), posHSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_width" );
- int thh = addPreference( tr( "Title height (%)" ), posHSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_height" );
-
- int lwh = addPreference( tr( "Label width (%)" ), posHSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_width" );
- int lhh = addPreference( tr( "Label height (%)" ), posHSizeGr,
- LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_height" );
-
- int bwh = addPreference( tr( "Bar width (%)" ), posHSizeGr,
+ int twh = addPreference( tr( "VISU_TITLE_SIZE" ), posHSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_title_size" );
+
+ int lwh = addPreference( tr( "VISU_LABEL_SIZE" ), posHSizeGr,
+ LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_label_size" );
+
+ int bwh = addPreference( tr( "VISU_BAR_WIDTH" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_width" );
- int bhh = addPreference( tr( "Bar height (%)" ), posHSizeGr,
+ int bhh = addPreference( tr( "VISU_BAR_HEIGHT" ), posHSizeGr,
LightApp_Preferences::IntSpin, "VISU", "scalar_bar_horizontal_bar_height" );
setPreferenceProperty( xh, "step", 0.1 );
setPreferenceProperty( hh, "min", 0.0 );
setPreferenceProperty( twh, "min", 0 );
setPreferenceProperty( twh, "special", "auto" );
- setPreferenceProperty( thh, "min", 0 );
- setPreferenceProperty( thh, "special", "auto" );
setPreferenceProperty( lwh, "min", 0 );
setPreferenceProperty( lwh, "special", "auto" );
- setPreferenceProperty( lhh, "min", 0 );
- setPreferenceProperty( lhh, "special", "auto" );
setPreferenceProperty( bwh, "min", 0 );
setPreferenceProperty( bwh, "special", "auto" );
setPreferenceProperty( bhh, "min", 0 );
setPreferenceProperty( wh, "max", 1.0 );
setPreferenceProperty( hh, "max", 1.0 );
setPreferenceProperty( twh, "max", 100 );
- setPreferenceProperty( thh, "max", 100 );
setPreferenceProperty( lwh, "max", 100 );
- setPreferenceProperty( lhh, "max", 100 );
setPreferenceProperty( bwh, "max", 100 );
setPreferenceProperty( bhh, "max", 100 );
- // group: "Scalar bars default position"
- int scalarBarGr = addPreference( tr( "Scalar bars default position" ), sbarTab );
- addPreference( tr( "Arrange Scalar Bars" ), scalarBarGr, LightApp_Preferences::Bool, "VISU", "scalar_bars_default_position" );
-
// TAB: "CutLines"
int cutLineTab = addPreference( tr( "CutLines" ) );
addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
- // TAB: "Sweep, Animation"
- int srangeTab = addPreference( tr( "Sweep, Animation" ) );
-
- // group: "Sweeping preferences"
- int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
- setPreferenceProperty( sweepGr, "columns", 2 );
-
- int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
- QStringList sweep_modes;
- sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
- sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
- sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
- indices.clear();
- indices.append( 0 );
- indices.append( 1 );
- indices.append( 2 );
- setPreferenceProperty( modeSw, "strings", sweep_modes );
- setPreferenceProperty( modeSw, "indexes", indices );
-
- int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGr,
- LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
- int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr,
- LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
- int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGr,
- LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
- int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
- QStringList ranges;
- ranges.append( tr( "PERIOD_PI" ) );
- ranges.append( tr( "PERIOD_2PI" ) );
- indices.clear();
- indices.append( 0 );
- indices.append( 1 );
- setPreferenceProperty( rangeSw, "strings", ranges );
- setPreferenceProperty( rangeSw, "indexes", indices );
-
- setPreferenceProperty( timestep, "min", 0.1 );
- setPreferenceProperty( timestep, "step", 0.1 );
- setPreferenceProperty( timestep, "max", 1000 );
- setPreferenceProperty( nbcycles, "max", 100 );
- setPreferenceProperty( nbsteps, "max", 200 );
-
- // group: "Animation preferences"
- int animationGr = addPreference( tr( "Animation preferences" ), srangeTab );
- setPreferenceProperty( animationGr, "columns", 3 );
+ // TAB: "Sweep, Animation, 3D Cache"
+ int animationTab = addPreference( tr( "Animation" ) );
+ {
+ // group: "3D Cache System prefereces"
+ {
+ int cacheGroup = addPreference( tr( "VISU_3DCACHE_PREFERENCES" ), animationTab );
+ setPreferenceProperty( cacheGroup, "columns", 2 );
+
+ int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGroup,
+ LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
+
+ modes.clear();
+ modes.append( tr( "VISU_MINIMAL" ) );
+ modes.append( tr( "VISU_LIMITED" ) );
+ setPreferenceProperty( memory_mode, "strings", modes );
+
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ setPreferenceProperty( memory_mode, "indexes", indices );
+
+ int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGroup,
+ LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
+ setPreferenceProperty( memory_limit, "min", 1 );
+ setPreferenceProperty( memory_limit, "max", 5000 );
+ setPreferenceProperty( memory_limit, "step", 10 );
+ }
- int speed = addPreference( tr( "Speed" ), animationGr, LightApp_Preferences::IntSpin, "VISU", "speed" );
- addPreference( tr( "Cycled animation" ), animationGr, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
- addPreference( tr( "Use proportional timing" ), animationGr, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
- addPreference( tr( "Clean memory at each frame" ), animationGr, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
+ // group: "Animation preferences"
+ {
+ int animationGroup = addPreference( tr( "VISU_ANIMATION_PREFERENCES" ), animationTab );
+ setPreferenceProperty( animationGroup, "columns", 3 );
+
+ int speed = addPreference( tr( "Speed" ), animationGroup, LightApp_Preferences::IntSpin, "VISU", "speed" );
+ addPreference( tr( "Cycled animation" ), animationGroup, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
+ addPreference( tr( "Use proportional timing" ), animationGroup, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
+ addPreference( tr( "Clean memory at each frame" ), animationGroup, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
+
+ setPreferenceProperty( speed, "min", 1 );
+ setPreferenceProperty( speed, "max", 99 );
+ }
- setPreferenceProperty( speed, "min", 1 );
- setPreferenceProperty( speed, "max", 99 );
+ // group: "Sweeping preferences"
+ {
+ int sweepGroup = addPreference( tr( "VISU_SWEEPING_PREF" ), animationTab );
+ setPreferenceProperty( sweepGroup, "columns", 2 );
+
+ int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
+ QStringList sweep_modes;
+ sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
+ sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
+ sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ indices.append( 2 );
+ setPreferenceProperty( modeSw, "strings", sweep_modes );
+ setPreferenceProperty( modeSw, "indexes", indices );
+
+ int timestep = addPreference( tr( "VISU_TIME_STEP" ), sweepGroup,
+ LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
+ int nbcycles = addPreference( tr( "VISU_NB_CYCLES" ), sweepGroup,
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
+ int nbsteps = addPreference( tr( "VISU_NB_STEPS" ), sweepGroup,
+ LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+ int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
+ QStringList ranges;
+ ranges.append( tr( "PERIOD_PI" ) );
+ ranges.append( tr( "PERIOD_2PI" ) );
+ indices.clear();
+ indices.append( 0 );
+ indices.append( 1 );
+ setPreferenceProperty( rangeSw, "strings", ranges );
+ setPreferenceProperty( rangeSw, "indexes", indices );
+
+ setPreferenceProperty( timestep, "min", 0.1 );
+ setPreferenceProperty( timestep, "step", 0.1 );
+ setPreferenceProperty( timestep, "max", 1000 );
+ setPreferenceProperty( nbcycles, "max", 100 );
+ setPreferenceProperty( nbsteps, "max", 200 );
+ }
+ }
// TAB: Representation ; group: "Representation properties"
int representationTab = addPreference( tr( "Representation" ) );
mesh_modes.append( "Insideframe" );
mesh_modes.append( "Surfaceframe" );
mesh_modes.append( "Surface" );
+ mesh_modes.append( "Feature edges" );
QList<QVariant> mesh_indices;
mesh_indices.append( 0 );
mesh_indices.append( 1 );
mesh_indices.append( 3 );
mesh_indices.append( 4 );
mesh_indices.append( 2 );
+ mesh_indices.append( 5 );
+
+ QStringList modes0 = mesh_modes;
+ modes0.removeAll( "Feature edges" );
+ QList<QVariant> indices0 = mesh_indices;
+ indices0.removeAll( 5 );
- QStringList modes1 = mesh_modes;
+ QStringList modes1 = modes0;
modes1.removeAll( "Insideframe" );
- QList<QVariant> indices1 = mesh_indices;
+ QList<QVariant> indices1 = indices0;
indices1.removeAll( 3 );
QStringList modes2 = modes1;
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", mesh_modes );
- setPreferenceProperty( scalar_map_represent, "indexes", mesh_indices );
+ setPreferenceProperty( scalar_map_represent, "strings", modes0 );
+ setPreferenceProperty( scalar_map_represent, "indexes", indices0 );
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( sp, "vstretch", 0 );
int deformed_shape_represent = addPreference( tr( "VISU_DEFORMED_SHAPE" ), representGr, LightApp_Preferences::Selector, "VISU", "deformed_shape_represent" );
- setPreferenceProperty( deformed_shape_represent, "strings", mesh_modes );
- setPreferenceProperty( deformed_shape_represent, "indexes", mesh_indices );
+ setPreferenceProperty( deformed_shape_represent, "strings", modes0 );
+ setPreferenceProperty( deformed_shape_represent, "indexes", indices0 );
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" );
addPreference( tr( "VISU_AUTOMATIC_FIT_ALL" ), representGr,
LightApp_Preferences::Bool, "VISU", "automatic_fit_all" );
- // TAB: 3D Cache ; group: "Cache properties"
- int cacheTab = addPreference( tr( "3D Cache" ) );
+ // TAB: Feature edges ; group: "Feature edges properties"
+ int featureEdgesTab = addPreference( tr( "VISU_FEATURE_EDGES" ) );
- int cacheGr = addPreference( tr( "VISU_3DCACHE_PROPS" ), cacheTab );
- setPreferenceProperty( cacheGr, "columns", 2 );
+ int featureEdgesGr = addPreference( tr( "VISU_FEATURE_EDGES_PROPS" ), featureEdgesTab );
+ setPreferenceProperty( featureEdgesGr, "columns", 2 );
- int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGr,
- LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
+ int featureEdgesAnglePref = addPreference( tr( "VISU_FEATURE_EDGES_ANGLE" ), featureEdgesGr,
+ LightApp_Preferences::DblSpin, "VISU", "feature_edges_angle" );
+ setPreferenceProperty( featureEdgesAnglePref, "step", 10.0 );
+ setPreferenceProperty( featureEdgesAnglePref, "min", 0.0 );
+ setPreferenceProperty( featureEdgesAnglePref, "max", 90.0 );
+
+ addPreference( tr( "VISU_SHOW_FEATURE_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_feature_edges" );
+ addPreference( tr( "VISU_SHOW_BOUNDARY_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_boundary_edges" );
+ addPreference( tr( "VISU_SHOW_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_manifold_edges" );
+ addPreference( tr( "VISU_SHOW_NON_MANIFOLD_EDGES" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "show_non_manifold_edges" );
+ //addPreference( tr( "VISU_FEATURE_EDGES_COLORING" ), featureEdgesGr, LightApp_Preferences::Bool, "VISU", "feature_edges_coloring" );
+
+ // TAB: "Values labels"
+
+ int valLblTab = addPreference( tr( "VALUES_LABELING" ) );
- modes.clear();
- modes.append( tr( "VISU_MINIMAL" ) );
- modes.append( tr( "VISU_LIMITED" ) );
- setPreferenceProperty( memory_mode, "strings", modes );
+ // "Font" group
+ int valLblFontGr = addPreference( tr( "VISU_FONT" ), valLblTab );
+ setPreferenceProperty( valLblFontGr, "columns", 2 );
- indices.clear();
- indices.append( 0 );
- indices.append( 1 );
- setPreferenceProperty( memory_mode, "indexes", indices );
+ // font
+ addVtkFontPref( tr( "LABELS" ), valLblFontGr, "values_labeling_font", true );
+
+ // color
+ addPreference( tr( "COLOR" ), valLblFontGr,
+ LightApp_Preferences::Color, "VISU", "values_labeling_color" );
- int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGr,
- LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
- setPreferenceProperty( memory_limit, "min", 1 );
- setPreferenceProperty( memory_limit, "max", 5000 );
- setPreferenceProperty( memory_limit, "step", 10 );
}
void VisuGUI::preferencesChanged( const QString& a, const QString& b)
float aTol = 1.00000009999999;
QString aWarning;
if(b == QString("scalar_bar_vertical_x") || b == QString("scalar_bar_vertical_width")){
- sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", sbX1);
- sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", sbW);
+ sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_x", 0.01);
+ sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_width", 0.05);
if(sbX1+sbW > aTol){
aWarning = "Origin and Size Vertical: X+Width > 1\n";
sbX1=0.01;
}
}
else if(b == QString("scalar_bar_vertical_y") || b == QString("scalar_bar_vertical_height")){
- sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", sbY1);
- sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",sbH);
+ sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_y", 0.01);
+ sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_vertical_height",0.5);
if(sbY1+sbH > aTol){
aWarning = "Origin and Size Vertical: Y+Height > 1\n";
sbY1=0.01;
}
}
else if(b == QString("scalar_bar_horizontal_x") || b == QString("scalar_bar_horizontal_width")){
- sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", sbX1);
- sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", sbW);
+ sbX1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_x", 0.2);
+ sbW = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_width", 0.6);
if(sbX1+sbW > aTol){
aWarning = "Origin and Size Horizontal: X+Width > 1\n";
sbX1=0.2;
}
}
else if(b == QString("scalar_bar_horizontal_y") || b == QString("scalar_bar_horizontal_height")){
- sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", sbY1);
- sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",sbH);
+ sbY1 = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_y", 0.01);
+ sbH = aResourceMgr->doubleValue("VISU", "scalar_bar_horizontal_height",0.12);
if(sbY1+sbH > aTol){
aWarning = "Origin and Size Horizontal: Y+Height > 1\n";
sbY1=0.01;
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_y", sbY1);
aResourceMgr->setValue("VISU", "scalar_bar_horizontal_height",sbH);
}
- } else if(b == QString("scalar_bar_label_format")) {
- QString dVal;
- dVal.sprintf(aResourceMgr->stringValue("VISU", "scalar_bar_label_format",dVal).toLatin1().data(), 1.1);
- if(dVal.toDouble() == 0.) {
- aWarning = "Label format is incorrect ";
- aWarning += dVal;
- aWarning += "\n";
- dVal="%-#6.3g";
- aResourceMgr->setValue("VISU", "scalar_bar_label_format", dVal);
- }
- }
+ }
+
if ( !aWarning.isEmpty() ){
aWarning += "The default values are applied instead.";
SUIT_MessageBox::warning(GetDesktop(this),
_PTR(SObject) aTimeStampSObj = aSObject->GetFather();
if (SUIT_ViewManager* aViewManager = getApp()->activeViewManager()) {
QString aViewType = aViewManager->getType();
- bool anIsVVTK = (aViewType == VVTK_Viewer::Type());
+ //bool anIsVVTK = (aViewType == VVTK_Viewer::Type());
Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aTimeStampSObj);
VISU::VISUType aType = VISU::Storable::RestoringMap2Type( aRestoringMap );
int aPos;
SUIT_ViewWindow* aViewWindow = 0;
- if (anIsVVTK) {
- aViewWindow = GetViewWindow<VVTK_Viewer>(this);
- aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
- } else {
+// if (anIsVVTK) {
+// aViewWindow = GetViewWindow<VVTK_Viewer>(this);
+// aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<VVTK_ViewWindow*>(aViewWindow));
+// } else {
aViewWindow = GetViewWindow<SVTK_Viewer>(this);
aPos = GetFreePositionOfDefaultScalarBar(this, dynamic_cast<SVTK_ViewWindow*>(GetViewWindow<SVTK_Viewer>(this)));
- }
+ // }
GetResourceMgr()->setValue("VISU", "scalar_bar_position_num", aPos);
VISU::Plot3D_i* aPrs3d =
AddScalarBarPosition(this, aSVtkWindow, aPrs3d, aPos);
}
+ if (aPrs3d)
+ emit presentationCreated(aPrs3d);
}
}
application()->putInfo(QObject::tr("INF_DONE"));
}
}
-void VisuGUI::OnCacheProperties()
+void VisuGUI::OnManageCache()
{
- VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
- if(aSelectionInfo.empty())
- return;
-
- VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
- _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
-
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
- if( CORBA::is_nil( anObject ) )
- return;
-
- VISU::ColoredPrs3dCache_var aCache = VISU::GetInterface<VISU::ColoredPrs3dCache>(anObject);
- if( CORBA::is_nil( aCache ) )
- return;
-
- VisuGUI_CacheDlg* aDlg = new VisuGUI_CacheDlg( aCache, this );
- aDlg->exec();
+ mySlider->show();
}
SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
QString aDir = aResourceMgr->stringValue("VISU","OutputDir","");
-
+
// get name for the file
QStringList aFilter;
aFilter.append("MED Files (*.med)");
QString aBaseName = anInitFileInfo.fileName();
QString aPath = Qtx::addSlash(aDir) + aBaseName;
-
+
QFileInfo aFileInfo =
SUIT_FileDlg::getFileName(GetDesktop(this),
aPath,
aResult->ExportMED((const char*)aFile.toLatin1());
}
}
+
+void VisuGUI::OnFilterScalars()
+{
+ VisuGUI_FilterScalarsDlg* aDlg = new VisuGUI_FilterScalarsDlg( this );
+ aDlg->show();
+}
+
+/*!
+ \brief SLOT called when "Labeling" popup menu item of presentation is clicked
+ activates/deactivates labeling of results of the screen. This functionality works
+ to numbering in SMESH module but is intended for showing results on the screen
+ instead of elements numbers
+ \sa OnValuesLabelingParams()
+*/
+void VisuGUI::OnValuesLabeling()
+{
+ // to do: rewrite for several actors if necessary
+
+ VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects( this );
+ if ( aSelectionInfo.empty() )
+ return;
+
+ TSelectionItem aSelectionItem = GetSelectedObjects(this).front();
+ VISU::Prs3d_i* aPrs3d = GetPrs3dFromBase(aSelectionItem.myObjectInfo.myBase);
+ if(!aPrs3d)
+ return;
+
+ SVTK_ViewWindow* aViewWindow = GetActiveViewWindow<SVTK_ViewWindow>(this);
+ if(!aViewWindow)
+ return;
+
+ VISU_Actor* anActor = FindActor(aViewWindow, aPrs3d);
+ if(!anActor)
+ return;
+
+ if( VISU_ScalarMapAct* aScalarMapActor = dynamic_cast<VISU_ScalarMapAct*>(anActor) )
+ {
+ aScalarMapActor->SetValuesLabeled( !aScalarMapActor->GetValuesLabeled() );
+ aViewWindow->Repaint();
+ }
+ else if( VISU_GaussPtsAct* aGaussPtsAct = dynamic_cast<VISU_GaussPtsAct*>(anActor) )
+ {
+ aGaussPtsAct->SetValuesLabeled( !aGaussPtsAct->GetValuesLabeled() );
+ aViewWindow->Repaint();
+ }
+}
+
+/*!
+ \brief SLOT called when "Labeling parameters" popup menu item of presentation
+ is clicked launch dialog box for changing parameters of labeling
+ \sa OnValuesLabeling()
+*/
+void VisuGUI::OnValuesLabelingParams()
+{
+ Handle(SALOME_InteractiveObject) anIO;
+ if ( VISU::Prs3d_i* aPrs3d = GetPrsToModify( this, anIO ) )
+ EditPrs3d<VISU::ColoredPrs3d_i, VisuGUI_ValuesLabelingDlg, 1>(this, anIO, aPrs3d);
+}
+/*!
+ \brief Adds preferences for dfont of VTK viewer
+ \param label label
+ \param pIf group identifier
+ \param param parameter
+ \return identifier of preferences
+*/
+int VisuGUI::addVtkFontPref(
+ const QString& label,
+ const int pId,
+ const QString& param,
+ const bool useSize )
+{
+ int tfont = addPreference( label, pId, LightApp_Preferences::Font, "VISU", param );
+
+ setPreferenceProperty( tfont, "mode", QtxFontEdit::Custom );
+
+ QStringList fam;
+ fam.append( tr( "VISU_FONT_ARIAL" ) );
+ fam.append( tr( "VISU_FONT_COURIER" ) );
+ fam.append( tr( "VISU_FONT_TIMES" ) );
+
+ setPreferenceProperty( tfont, "fonts", fam );
+
+ int f = QtxFontEdit::Family | QtxFontEdit::Bold | QtxFontEdit::Italic | QtxFontEdit::Shadow;
+ if ( useSize )
+ f |= QtxFontEdit::UserSize | QtxFontEdit::Size;
+
+ setPreferenceProperty( tfont, "features", f );
+
+ return tfont;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#ifndef VisuGUI_HeaderFile
#define VisuGUI_HeaderFile
-#include <map>
-#include <set>
+#include <SalomeApp_Module.h>
-#include "SalomeApp_Module.h"
-
-#include "SALOME_ListIO.hxx"
-#include "VISU_Prs3d_i.hh"
-#include "SVTK_ViewWindow.h"
+#include <SVTK_ViewWindow.h>
+#include <VISU_Prs3d_i.hh>
+#include "VisuGUI_Panel.h"
+#include <map>
+#include <set>
class SUIT_ViewManager;
-class SVTK_ViewWindow;
-class Prs3d_i;
+class VisuGUI_Slider;
+class VisuGUI_Sweep;
namespace VISU
{
+ class Prs3d_i;
typedef std::pair<Prs3d_i*,int> TPrs3dToInd; // prs pointer and default index of scalar bar placement
typedef std::set<TPrs3dToInd> TSetPrs3d;
typedef std::map<SVTK_ViewWindow*,TSetPrs3d> TViewToPrs3d;
Q_OBJECT;
public:
+ enum PanelId { SelectionPanelId = 0,
+ FeatureEdgesPanelId,
+ ClippingPlanesPanelId };
+public:
VisuGUI();
virtual ~VisuGUI();
VISU::TViewToPrs3d&
getScalarBarsMap();
-
+
+signals:
+ void moduleDeactivated();
+ void moduleActivated();
+ void presentationCreated(VISU::Prs3d_i* thePrs);
+ void beforeObjectDelete(QString theEntry);
+
public slots:
virtual bool deactivateModule( SUIT_Study* );
virtual bool activateModule( SUIT_Study* );
virtual void OnErasePrs();
// virtual void OnEraseAll();
+ void OnToggleSelectionPanel();
+ void OnSwitchSelectionMode();
+ void OnSwitchSelectionMode( int );
+
void OnMakeSurfaceframe();
void OnMakeInsideframe();
void OnMakeWireframe();
void OnMakePoints();
void OnMakeShrink();
+ void OnMakeFeatureEdges();
+
void OnSetShadingOn();
void OnSetShadingOff();
void OnCopyPresentation();
- void OnSelectionInfo();
-
void OnTranslatePrs();
void OnArrangeActors();
void OnPlot3dFromCutPlane();
- void OnCacheProperties();
+ void OnManageCache();
+
+ void OnFilterScalars();
+
+ void OnValuesLabeling();
+ void OnValuesLabelingParams();
// MULTIPR
void OnMultiprViewFullRes();
void createMenus();
void createToolBars();
void createPopupMenus();
+ void createPanels();
+ int addVtkFontPref( const QString& label, const int pId, const QString& param, const bool useSize );
private:
- LightApp_Displayer* myDisplayer;
- VISU::TViewToPrs3d myScalarBarsMap;
+ QMap< PanelId, VisuGUI_Panel* > myPanels;
+ VisuGUI_Slider* mySlider;
+ VisuGUI_Sweep* mySweep;
+
+ LightApp_Displayer* myDisplayer;
+ VISU::TViewToPrs3d myScalarBarsMap;
};
#endif
#define VISU_SHRINK 4055
#define VISU_UNSHRINK 4056
+#define VISU_FEATURE_EDGES 4091
+#define VISU_FEATURE_EDGES_DISABLE 4092
+
#define VISU_SHADING 4083
#define VISU_NOSHADING 4084
#define VISU_PLOT3D_FROM_CUTPLANE 4085
-#define VISU_CACHE_PROPERTIES 4090
+#define VISU_MANAGE_CACHE 4090
// MULTIPR
#define VISU_MULTIPR_FULL_RES 4095
#define VISU_FILE_INFO 4100
#define VISU_EXPORT_MED 4101
+#define VISU_SELECTION_PANEL 4102
+#define VISU_ACTOR_SELECTION 4103
+#define VISU_CELL_SELECTION 4104
+#define VISU_POINT_SELECTION 4105
+#define VISU_GAUSS_POINT_SELECTION 4106
+
+#define VISU_SLIDER_PANEL 4200
+#define VISU_SWEEP_PANEL 4300
+#define VISU_FILTERSCALARS 4301
+
+#define VISU_VALUES_LABELING 4302
+#define VISU_VALUES_LABELING_PARAMS 4303
+
+
#endif
#include "VISU_Result_i.hh"
#include "VISU_PipeLine.hxx"
+#include "VISU_DataSetActor.h"
#include "LightApp_SelectionMgr.h"
#include "LightApp_Application.h"
#include "SVTK_ViewWindow.h"
+#include <VTKViewer_Utilities.h>
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_OverrideCursor.h"
#include "SALOME_Actor.h"
+#include "VISU_ViewManager_i.hh"
// QT Includes
#include <QLabel>
#include <QSpinBox>
#include <QKeyEvent>
#include <QPushButton>
+#include <QListWidget>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QStackedWidget>
// VTK Includes
#include <vtkMath.h>
#include <vtkPolyData.h>
#include <vtkUnstructuredGrid.h>
#include <vtkProperty.h>
+#include <vtkImplicitFunctionCollection.h>
// OCCT Includes
#include <gp_Dir.hxx>
mySelectionMgr(VISU::GetSelectionMgr(theModule)),
myVisuGUI(theModule),
myPrs3d(0),
- myIsSelectPlane(false)
+ myIsSelectPlane(false),
+ myDSActor(0)
{
setWindowTitle(tr("TITLE"));
setSizeGripEnabled(TRUE);
setAttribute( Qt::WA_DeleteOnClose, true );
- QGridLayout* VisuGUI_ClippingDlgLayout = new QGridLayout(this);
+ QVBoxLayout* VisuGUI_ClippingDlgLayout = new QVBoxLayout(this);
VisuGUI_ClippingDlgLayout->setSpacing(6);
VisuGUI_ClippingDlgLayout->setMargin(11);
+
+ QStackedWidget* aStackWidget = new QStackedWidget(this);
+ VisuGUI_ClippingDlgLayout->addWidget(aStackWidget);
+ // Local planes
+ QWidget* aLocalPlanes = new QWidget(aStackWidget);
+ QVBoxLayout* aLocalLayout = new QVBoxLayout(aLocalPlanes);
+ aStackWidget->addWidget(aLocalPlanes);
// Controls for selecting, creating, deleting planes
- QGroupBox* GroupPlanes = new QGroupBox (tr("GRP_PLANES"), this);
- //GroupPlanes->setColumnLayout(0, Qt::Vertical);
- //GroupPlanes->layout()->setSpacing(0);
- //GroupPlanes->layout()->setMargin(0);
+ QGroupBox* GroupPlanes = new QGroupBox (tr("GRP_PLANES"), aLocalPlanes);
QGridLayout* GroupPlanesLayout = new QGridLayout (GroupPlanes);
GroupPlanesLayout->setAlignment(Qt::AlignTop);
GroupPlanesLayout->setSpacing(6);
GroupPlanesLayout->setMargin(11);
+ aLocalLayout->addWidget(GroupPlanes);
ComboBoxPlanes = new QComboBox (GroupPlanes);
GroupPlanesLayout->addWidget(ComboBoxPlanes, 0, 0);
// Controls for defining plane parameters
// Tab pane
- QGroupBox* GroupParameters = new QGroupBox(tr("GRP_PARAMETERS"), this);
- //GroupParameters->setColumnLayout(0, Qt::Vertical);
- //GroupParameters->layout()->setSpacing(0);
- //GroupParameters->layout()->setMargin(0);
+ QGroupBox* GroupParameters = new QGroupBox(tr("GRP_PARAMETERS"), aLocalPlanes);
QGridLayout* GroupParametersLayout = new QGridLayout (GroupParameters);
GroupParametersLayout->setAlignment(Qt::AlignTop);
GroupParametersLayout->setSpacing(6);
GroupParametersLayout->setMargin(11);
+ aLocalLayout->addWidget(GroupParameters);
TabPane = new QTabWidget (GroupParameters);
TabPane->addTab(createParamsTab() , tr("TAB_NON_STRUCTURED"));
TabPane->addTab(createIJKParamsTab(), tr("TAB_IJK_STRUCTURED"));
GroupParametersLayout->addWidget(TabPane, 0, 0);
+
+
+
+
// "Show preview" and "Auto Apply" check boxes
+ QHBoxLayout* aCheckBoxLayout = new QHBoxLayout(this);
+ VisuGUI_ClippingDlgLayout->addLayout(aCheckBoxLayout);
PreviewCheckBox = new QCheckBox (tr("SHOW_PREVIEW_CHK"), this);
PreviewCheckBox->setChecked(true);
+ aCheckBoxLayout->addWidget(PreviewCheckBox);
+ aCheckBoxLayout->addStretch();
AutoApplyCheckBox = new QCheckBox (tr("AUTO_APPLY_CHK"), this);
AutoApplyCheckBox->setChecked(false);
+ aCheckBoxLayout->addWidget(AutoApplyCheckBox);
// Controls for "Ok", "Apply" and "Close" button
QGroupBox* GroupButtons = new QGroupBox (this);
+ VisuGUI_ClippingDlgLayout->addWidget(GroupButtons);
QSizePolicy aSizePolicy(QSizePolicy::Expanding,
QSizePolicy::Fixed );
aSizePolicy.setHeightForWidth( GroupButtons->sizePolicy().hasHeightForWidth() );
aSizePolicy.setVerticalStretch( 0 );
GroupButtons->setSizePolicy( aSizePolicy );
GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- //GroupButtons->setColumnLayout(0, Qt::Vertical);
- //GroupButtons->layout()->setSpacing(0);
- //GroupButtons->layout()->setMargin(0);
QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons);
GroupButtons->setLayout(GroupButtonsLayout);
GroupButtonsLayout->setAlignment(Qt::AlignTop);
buttonOk->setDefault(TRUE);
GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- VisuGUI_ClippingDlgLayout->addWidget(GroupPlanes, 0, 0, 1, 2);
- VisuGUI_ClippingDlgLayout->addWidget(GroupParameters, 1, 0, 1, 2);
- VisuGUI_ClippingDlgLayout->addWidget(PreviewCheckBox, 2, 0);
- VisuGUI_ClippingDlgLayout->addWidget(AutoApplyCheckBox, 2, 1);
- VisuGUI_ClippingDlgLayout->addWidget(GroupButtons, 3, 0, 3, 2);
-
// Initial state
VISU::RangeStepAndValidator(SpinBoxDistance, 0.0, 1.0, 0.01, 3);
VISU::RangeStepAndValidator(SpinBoxRot1, -180.0, 180.0, 1, 3);
// purpose :
//=================================================================================
void VisuGUI_ClippingDlg::ClickOnApply()
+{
+ applyLocalPlanes();
+}
+
+
+//=================================================================================
+// function : applyLocalPlanes()
+// purpose :
+//=================================================================================
+void VisuGUI_ClippingDlg::applyLocalPlanes()
{
if (!myPrs3d)
return;
}
// Try to apply new clipping
- myPrs3d->RemoveAllClippingPlanes();
+ //myPrs3d->RemoveAllClippingPlanes();
+ removeAllClippingPlanes(myPrs3d);
VISU::TPlanes::iterator anIter = myPlanes.begin();
for (; anIter != myPlanes.end(); anIter++) {
if (isFailed) {
// Restore previous clipping state because of failure.
- myPrs3d->RemoveAllClippingPlanes();
+ //myPrs3d->RemoveAllClippingPlanes();
+ removeAllClippingPlanes(myPrs3d);
TPlns::iterator anOldIter = anOldPlanes.begin();
for (; anOldIter != anOldPlanes.end(); anOldIter++) {
}
}
+
+
+
//=================================================================================
// function : ClickOnOk()
// purpose :
}
buttonDelete ->setEnabled(anIsControlsEnable);
- buttonApply ->setEnabled(anIsControlsEnable);
- PreviewCheckBox ->setEnabled(anIsControlsEnable);
- AutoApplyCheckBox ->setEnabled(anIsControlsEnable);
+ //buttonApply ->setEnabled(anIsControlsEnable);
+ // PreviewCheckBox ->setEnabled(anIsControlsEnable);
+ // AutoApplyCheckBox ->setEnabled(anIsControlsEnable);
ComboBoxOrientation ->setEnabled(anIsControlsEnable);
SpinBoxDistance ->setEnabled(anIsControlsEnable);
} else
return;
}
+
+
+void VisuGUI_ClippingDlg::removeAllClippingPlanes(VISU::Prs3d_i* thePrs)
+{
+ for (int i = thePrs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
+ OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(thePrs->GetClippingPlane(i));
+ if (aPlane)
+ thePrs->RemoveClippingPlane(i);
+ }
+}
+
+
class QButtonGroup;
class QSpinBox;
class QTabWidget;
+class QListWidget;
class SALOME_Actor;
class LightApp_SelectionMgr;
class VisuGUI;
-
class vtkPlaneSource;
class vtkDataSetMapper;
-
class OrientedPlane;
+class VISU_Actor;
+class PreviewPlane;
namespace VISU {
class Prs3d_i;
void SetPrs3d(VISU::Prs3d_i* thePrs);
+ VISU_Actor* getSelectedActor();
+
+ void applyLocalPlanes();
+
+ void removeAllClippingPlanes(VISU::Prs3d_i* thePrs);
private:
bool myIsSelectPlane;
+ VISU_Actor* myDSActor;
+ QList<PreviewPlane*> myPreviewList;
+
protected:
QWidget* createParamsTab();
QWidget* createIJKParamsTab();
};
#endif // DIALOGBOX_TRANSPARENCYDLG_H
+
+
myVectorialFieldCombo = new QComboBox (GDeformation);
GDeformationLayout->addWidget( myVectorialFieldCombo, 0, 1 );
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
+
QLabel* LabelDeformation2 = new QLabel (tr("LBL_DEFROMATION_SCALE"), GDeformation);
GDeformationLayout->addWidget( LabelDeformation2, 1, 0 );
- myScaleSpn = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, GDeformation);
+ myScaleSpn = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, GDeformation);
myScaleSpn->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
GDeformationLayout->addWidget( myScaleSpn, 1, 1 );
connect(myVectorialFieldCombo, SIGNAL(activated(int)), this, SLOT(onVectorialFieldChanged(int)));
connect(myScaleSpn, SIGNAL(valueChanged(double)), this, SLOT(onScaleFactorChanged(double)));
-
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
-
- myScaleSpn->setPrecision( aPrecision*(-1) );
- myScaleSpn->setDecimals(38);
myScaleSpn->setValue(0.1);
myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), this);
void VisuGUI_CutPlanesPane::setScaleFactor(double theFactor){
double i=0.1;
- while (1) { // Calculate Step & Precission
- if ( int (theFactor/i) >= 0)
- break;
- else {
- i = i*0.1;
+ if (theFactor > 0) {
+ while (1) { // Calculate Step & Precission
+ if ( int (theFactor/i) >= 0)
+ break;
+ else
+ i = i*0.1;
}
}
myScaleSpn->setSingleStep(i);
myScaleSpn->setValue(theFactor);
-
}
void VisuGUI_CutPlanesPane::createPlanes()
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VisuGUI_DeformedShapeAndScalarMapDlg.cxx
-// Author : Eugeny Nikolaev
-// Module : VISU
-
-#include "VisuGUI_DeformedShapeAndScalarMapDlg.h"
-
-#include "VisuGUI_Tools.h"
-#include "VisuGUI_InputPane.h"
-
-#include "VISU_Result_i.hh"
-#include "VISU_DeformedShapeAndScalarMap_i.hh"
-#include "VISU_ColoredPrs3dFactory.hh"
-
-#include "VISU_ScalarMapPL.hxx"
-#include "VISU_DeformedShapeAndScalarMapPL.hxx"
-
-#include "VISU_Convertor.hxx"
-
-#include <QtxDoubleSpinBox.h>
-#include <SalomeApp_Module.h>
-#include <LightApp_Application.h>
-#include <LightApp_SelectionMgr.h>
-#include <SUIT_Desktop.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_MessageBox.h>
-
-#include <SALOME_ListIO.hxx>
-
-#include <SALOMEDSClient_AttributeString.hxx>
-#include <SALOMEDSClient_AttributeName.hxx>
-
-#include <QVBoxLayout>
-#include <QHBoxLayout>
-#include <QGridLayout>
-#include <QTabWidget>
-#include <QComboBox>
-#include <QPushButton>
-#include <QLabel>
-
-#define MYDEBUG 0
-
-/*!
- * Constructor
- */
-VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule)
- : VisuGUI_ScalarBarBaseDlg(theModule),
- myIsAnimation(false),
- myUpdateScalars(true),
- myVisuGUI(theModule)
-{
- setWindowTitle(tr("DLG_TITLE"));
- setSizeGripEnabled(true);
-
- QVBoxLayout* TopLayout = new QVBoxLayout (this);
- TopLayout->setSpacing(6);
- TopLayout->setMargin(11);
-
- myTabBox = new QTabWidget (this);
-
- // Scalar Map on Deformed shape pane
- QWidget* aBox = new QWidget (this);
- QVBoxLayout* aVBLay = new QVBoxLayout( aBox );
- aVBLay->setMargin(11);
- QFrame* TopGroup = new QFrame (aBox);
- aVBLay->addWidget(TopGroup);
- TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken);
- TopGroup->setLineWidth(1);
- QGridLayout* TopGroupLayout = new QGridLayout (TopGroup);
- TopGroupLayout->setSpacing(6);
- TopGroupLayout->setMargin(11);
-
- // Scale factor
- QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup);
- TopGroupLayout->addWidget(ScaleLabel, 0, 0);
-
- ScalFact = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
- ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
-
- ScalFact->setPrecision( aPrecision*(-1) );
- ScalFact->setDecimals( 32 );
- ScalFact->setValue(0.1);
- TopGroupLayout->addWidget(ScalFact, 0, 1);
-
- // Fields combo box
- QLabel* FieldLabel = new QLabel (tr("FIELD_ITEM"), TopGroup);
- myFieldsCombo = new QComboBox (TopGroup);
-
- TopGroupLayout->addWidget(FieldLabel, 1, 0);
- TopGroupLayout->addWidget(myFieldsCombo,1,1);
-
- // TimeStamps combo box
- QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup);
- myTimeStampsCombo = new QComboBox (TopGroup);
-
- TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
- TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
- TopGroupLayout->setRowStretch(3,5);
-
- //
- myTabBox->addTab(aBox, tr("DEFORMED_SHAPE_AND_SCALAR_MAP_TAB"));
-
- // Scalar bar pane
- myInputPane = new VisuGUI_InputPane(VISU::TDEFORMEDSHAPEANDSCALARMAP, theModule, this);
-
- myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
- myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
-
- // Buttons
- QGroupBox* GroupButtons = new QGroupBox (this);
- QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
-
- QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons);
- buttonOk->setAutoDefault(true);
- buttonOk->setDefault(true);
- QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons);
- buttonCancel->setAutoDefault(true);
- QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons);
- buttonHelp->setAutoDefault(true);
-
- GroupButtonsLayout->addWidget(buttonOk);
- GroupButtonsLayout->addSpacing(10);
- GroupButtonsLayout->addStretch();
- GroupButtonsLayout->addWidget(buttonCancel);
- GroupButtonsLayout->addWidget(buttonHelp);
-
- // Add Tab box and Buttons to the top layout
- TopLayout->addWidget(myTabBox);
- TopLayout->addWidget(GroupButtons);
-
- // signals and slots connections
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
- connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
- connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
-}
-
-VisuGUI_DeformedShapeAndScalarMapDlg::~VisuGUI_DeformedShapeAndScalarMapDlg()
-{
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit )
-{
- if( theInit )
- myPrsCopy = VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
- setFactor(myPrsCopy->GetScale());
- myTimeStampsCombo->setDisabled(myIsAnimation);
-
- CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
- QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
- aFieldName.in(),
- myPrsCopy->GetScalarTimeStampNumber());
- if (myEntity2Fields.size() == 0)
- {
- // find all fields and time stamps on it
- _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
- LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
- SALOME_ListIO selected;
- aSel->selectedObjects(selected);
- if (selected.Extent() > 0) {
- Handle(SALOME_InteractiveObject) aIO = selected.First();
- if (aIO->hasEntry()) {
- _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
- VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
- switch(aType){
- case VISU::TTIMESTAMP: {
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
- break;
- }
- case VISU::TFIELD: {
- _PTR(SObject) newSObject;
- if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
- aSObject = aSObject->GetFather();
- break;
- }
- case VISU::TANIMATION: {
- _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
- for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
- _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
- _PTR(SObject) newSObject;
- if(aTmpChildSObj->ReferencedObject(newSObject)){
- aSObject = newSObject;
- aSObject->GetFather();
- break;
- }
- }
- break;
- }}
-
- aSObject = aSObject->GetFather();
- aSObject = aSObject->GetFather();
-
- mySelectionObj = aSObject;
- CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
- if (CORBA::is_nil(anObject)) {
- mySelectionObj = mySelectionObj->GetFather();
- }
- }
- }
-
- if (mySelectionObj) {
- _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
-
- for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
- _PTR(SObject) aChildSObj = aIter->Value();
- VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
- if (!aRestoringMap.empty()) {
- VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
- if (aType == VISU::TTIMESTAMP) {
- QString aMeshName = aRestoringMap["myMeshName"];
- CORBA::String_var aName = myPrsCopy->GetMeshName();
- if (aMeshName != aName.in())
- continue;
- QString aFieldName = aRestoringMap["myFieldName"];
- QString aTimeIter = aRestoringMap["myTimeStampId"];
- QString aEntity = aRestoringMap["myEntityId"];
- VISU::Entity anEntity;
- switch (aEntity.toInt()) {
- case 0: anEntity = VISU::NODE; break;
- case 1: anEntity = VISU::EDGE; break;
- case 2: anEntity = VISU::FACE; break;
- case 3: anEntity = VISU::CELL; break;
- }
- TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
- TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
- aTimeStampNumber2Time[aTimeIter.toInt()] =
- GetFloatValueOfTimeStamp(anEntity,
- aFieldName.toLatin1().constData(),
- aTimeIter.toInt());
- }
- }
- }
- }
- AddAllFieldNames();
- }
- int idx = myFieldsCombo->findText(aFieldName.in());
- if (idx >= 0)
- myFieldsCombo->setCurrentIndex(idx);
- else {
- myFieldsCombo->addItem(aFieldName.in());
- myFieldsCombo->setCurrentIndex(myFieldsCombo->count()-1);
- }
- AddAllTimes(myFieldsCombo->currentText());
- idx = myTimeStampsCombo->findText(aIteration);
- if (idx >= 0)
- myTimeStampsCombo->setCurrentIndex(idx);
- else {
- myTimeStampsCombo->addItem(aIteration);
- myTimeStampsCombo->setCurrentIndex(myTimeStampsCombo->count()-1);
- }
- SetScalarField( false );
-
- VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
-
- if( !theInit )
- return;
-
- myInputPane->initFromPrsObject( myPrsCopy );
- myTabBox->setCurrentIndex( 0 );
-}
-
-double VisuGUI_DeformedShapeAndScalarMapDlg::getFactor() const
-{
- return ScalFact->value();
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::setFactor(double theFactor)
-{
- double i=0.1;
- while (1) { // Calculate Step & Precission
- if ( int (theFactor/i) > 0)
- break;
- else {
- i = i*0.1;
- }
- }
-
- ScalFact->setSingleStep(i);
-
- ScalFact->setValue(theFactor);
-}
-
-int
-VisuGUI_DeformedShapeAndScalarMapDlg
-::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
-{
- if(!myInputPane->check() || !GetScalarPane()->check())
- return 0;
-
- int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
- anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
-
- myPrsCopy->SetScale(getFactor());
-
- myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
- getCurrentScalarFieldName().toLatin1().constData(),
- myTimeStampID[ myTimeStampsCombo->currentIndex() ]);
-
- if(myUpdateScalars)
- SetScalarField( false );
-
- VISU::TSameAsFactory<VISU::TDEFORMEDSHAPEANDSCALARMAP>().Copy(myPrsCopy, thePrs);
-
- return anIsOk;
-}
-
-int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldNamePos(){
- return myFieldsCombo->currentIndex();
-}
-
-QString VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarFieldName(){
- return myFieldsCombo->currentText();
-}
-
-int VisuGUI_DeformedShapeAndScalarMapDlg::getCurrentScalarNbIterations(){
- return myTimeStampsCombo->count();
-}
-
-VISU::Entity
-VisuGUI_DeformedShapeAndScalarMapDlg
-::getCurrentScalarEntity()
-{
- VISU::Entity anEntity = VISU::Entity(-1);
- TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
- for(; anIter != myEntity2Fields.end(); anIter++){
- const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
- TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
- for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
- const QString& aFieldName = aFieldIter->first;
- if (aFieldName == myFieldsCombo->currentText()) {
- anEntity = anIter->first;
- break;
- }
- }
- }
- return anEntity;
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::SetScalarField( const bool save_scalar_pane ){
- SetScalarField( myTimeStampID[ myTimeStampsCombo->currentIndex() ], "", save_scalar_pane );
-}
-
-void
-VisuGUI_DeformedShapeAndScalarMapDlg
-::SetScalarField(int theIter,
- QString theFieldName,
- const bool save_scalar_pane )
-{
- QApplication::setOverrideCursor(Qt::WaitCursor);
-
- if( save_scalar_pane )
- GetScalarPane()->storeToPrsObject(myPrsCopy);
-
- QString aFieldName;
-
- if(theFieldName.isEmpty())
- aFieldName = myFieldsCombo->currentText();
- else
- aFieldName = theFieldName;
-
- VISU::Entity anEntity = getCurrentScalarEntity();
-
- myPrsCopy->SetScalarField(anEntity,
- aFieldName.toLatin1().constData(),
- theIter);
-
- if( save_scalar_pane )
- UpdateScalarField();
-
- QApplication::restoreOverrideCursor();
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::accept()
-{
- VisuGUI_ScalarBarBaseDlg::accept();
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::reject()
-{
- VisuGUI_ScalarBarBaseDlg::reject();
-}
-
-QString VisuGUI_DeformedShapeAndScalarMapDlg::GetContextHelpFilePath()
-{
- return "scalar_map_on_deformed_shape_page.html";
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllFieldNames(){
- TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
- for(; anIter != myEntity2Fields.end(); anIter++){
- const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
- TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
- for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
- const QString& aFieldName = aFieldIter->first;
- myFieldsCombo->addItem(aFieldName);
- }
- }
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllTimes(const QString& theFieldName){
- TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
- for(; anIter != myEntity2Fields.end(); anIter++){
- const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
- TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
- for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
- const QString& aFieldName = aFieldIter->first;
- if(theFieldName != aFieldName)
- continue;
-
- myTimeStampID.clear();
- myTimeStampsCombo->clear();
-
- const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
- TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
- for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
- int aTimeStampNumber = aTimeStampIter->first;
- myTimeStampID.push_back(aTimeStampNumber);
-
- QString aTimeStampTime = aTimeStampIter->second;
- myTimeStampsCombo->addItem(aTimeStampTime);
- }
- return;
- }
- }
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::onFieldChanged(int){
- AddAllTimes(myFieldsCombo->currentText());
- SetScalarField();
- UpdateScalarField();
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::onTimeStampChanged(int){
- SetScalarField();
- UpdateScalarField();
-}
-
-void VisuGUI_DeformedShapeAndScalarMapDlg::UpdateScalarField(){
- GetScalarPane()->initFromPrsObject(myPrsCopy);
-}
-
-QString
-VisuGUI_DeformedShapeAndScalarMapDlg
-::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber)
-{
- QString aTime("");
- VISU::TEntity anEntity = VISU::TEntity(theEntity);
- VISU::Result_i* theResult = myPrsCopy->GetCResult();
- VISU::Result_i::PInput anInput = theResult->GetInput();
- VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
- anEntity,
- theFieldName);
- if(!aField)
- return aTime;
-
- VISU::TValField& aValField = aField->myValField;
- VISU::TValField::const_iterator aIter = aValField.find(theTimeStampNumber);
- if(aIter != aValField.end()){
- VISU::PValForTime aValForTime = aIter->second;
- aTime = VISU_Convertor::GenerateName(aValForTime->myTime).c_str();
- }
- return aTime;
-}
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-// File : VisuGUI_DeformedShapeAndScalarMapDlg.h
-// Author : Eugeny Nikolaev
-// Module : VISU
-
-#ifndef VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
-#define VISUGUI_DEFORMEDSHAPEANDSCALARMAPDLS_H
-
-#include "VisuGUI_Prs3dDlg.h"
-
-#include "VISUConfig.hh"
-
-#include <QDialog>
-
-#include <set>
-#include <vector>
-
-class SalomeApp_Module;
-class VisuGUI_InputPane;
-class QtxDoubleSpinBox;
-class QComboBox;
-class QTabWidget;
-
-namespace VISU
-{
- class DeformedShapeAndScalarMap_i;
-}
-
-class VisuGUI_DeformedShapeAndScalarMapDlg : public VisuGUI_ScalarBarBaseDlg
-{
- Q_OBJECT
-
-public:
- VisuGUI_DeformedShapeAndScalarMapDlg (SalomeApp_Module* theModule);
- ~VisuGUI_DeformedShapeAndScalarMapDlg();
-
- double getFactor() const;
- void setFactor(double theFactor);
-
- virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
- bool theInit );
-
- virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
-
- int getCurrentScalarFieldNamePos();
- QString getCurrentScalarFieldName();
- int getCurrentScalarNbIterations();
- VISU::Entity getCurrentScalarEntity();
- void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
-
-protected:
- virtual QString GetContextHelpFilePath();
-
-protected slots:
- void accept();
- void reject();
-
-private slots:
- void onFieldChanged(int i=0);
- void onTimeStampChanged(int i=0);
-
-private:
- QtxDoubleSpinBox* ScalFact;
- QTabWidget* myTabBox;
- VisuGUI_ScalarBarPane* myScalarPane;
- VisuGUI_InputPane* myInputPane;
- QComboBox *myFieldsCombo;
- QComboBox *myTimeStampsCombo;
-
- typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
- typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
- typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
-
- TEntity2Fields myEntity2Fields;
- int myCurrScalarIter;
- bool myIsAnimation;
- bool myUpdateScalars;
- std::vector<int> myTimeStampID;
-
- _PTR(SObject) mySelectionObj;
- SALOME::GenericObjPtr<VISU::DeformedShapeAndScalarMap_i> myPrsCopy;
- SalomeApp_Module* myVisuGUI;
-
-protected:
- void UpdateScalarField();
- void SetScalarField( const bool = true );
- void AddAllFieldNames();
- void AddAllTimes(const QString& theFieldName);
- QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
- const std::string& theFieldName,
- int theTimeStampNumber);
-};
-
-#endif // VISUGUI_DEFORMEDSHAPEDLS_H
QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup );
TopGroupLayout->addWidget(ScaleLabel, 0, 0);
- ScalFact = new QtxDoubleSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
- ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
-
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
- ScalFact->setPrecision( aPrecision*(-1) );
- ScalFact->setDecimals(38);
+ ScalFact = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, TopGroup);
+ ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
ScalFact->setValue(0.1);
TopGroupLayout->addWidget(ScalFact, 0, 1);
void VisuGUI_DeformedShapeDlg::setFactor(double theFactor)
{
double i=0.1;
- while (1) { // Calculate Step & Precission
- if ( int (theFactor/i) > 0)
- break;
- else {
- i = i*0.1;
+ if (theFactor > 0) {
+ while (1) { // Calculate Step & Precission
+ if ( int (theFactor/i) > 0)
+ break;
+ else
+ i = i*0.1;
}
}
ScalFact->setSingleStep(i);
-
ScalFact->setValue(theFactor);
}
// Create and Edit
////////////////////////////////////////////////////////////////////////////////
-void VisuGUI_DeformedShapeDlg::CreatePrs3d(VisuGUI* theModule)
+VISU::Prs3d_i* VisuGUI_DeformedShapeDlg::CreatePrs3d(VisuGUI* theModule)
{
+ VISU::DeformedShape_i* aPrs3d = NULL;
_PTR(SObject) aTimeStamp;
Handle(SALOME_InteractiveObject) anIO;
VISU::ColoredPrs3d_i::EPublishInStudyMode aPublishInStudyMode;
QString aFieldName = aRestoringMap["myFieldName"];
QString aTimeStampId = aRestoringMap["myTimeStampId"];
- typedef VISU::DeformedShape_i TPrs3d_i;
+ //typedef VISU::DeformedShape_i TPrs3d_i;
- TPrs3d_i* aPrs3d =
- VISU::CreatePrs3dFromFactory<TPrs3d_i>(theModule,
+ aPrs3d =
+ VISU::CreatePrs3dFromFactory<VISU::DeformedShape_i>(theModule,
aTimeStamp,
aMeshName.toLatin1().data(),
(VISU::Entity)anEntity.toInt(),
}
}
}
+ return aPrs3d;
}
////////////////////////////////////////////////////////////////////////////////
virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
- static void CreatePrs3d(VisuGUI* theModule);
+ static VISU::Prs3d_i* CreatePrs3d(VisuGUI* theModule);
static void EditPrs3d(VisuGUI* theModule, VISU::Prs3d_i* thePrs3d, Handle(SALOME_InteractiveObject)& theIO);
void updatePrsCopy();
#include "VISU_ViewManager_i.hh"
#include "VISU_Actor.h"
-#include "VVTK_ViewModel.h"
+//#include "VVTK_ViewModel.h"
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
SALOME_View* aView = theView ? theView : GetActiveView();
VISU::VISUType aType = aBase->GetType();
VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aBase);
- if( aView && (!CORBA::is_nil(aPrs3d) || aType == VISU::TCOLOREDPRS3DHOLDER) ){
- SVTK_Viewer* aViewer = dynamic_cast<VVTK_Viewer*>( aView );
- if (!aViewer)
- aViewer = dynamic_cast<SVTK_Viewer*>( aView );
+ if(!CORBA::is_nil(aPrs3d) || aType == VISU::TCOLOREDPRS3DHOLDER){
+ SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>( aView );
+ //if (!aViewer)
+ //aViewer = dynamic_cast<SVTK_Viewer*>( aView );
if( aViewer ){
SUIT_ViewManager* aViewManager = aViewer->getViewManager();
SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj ).in() ) )
return true;
- if( viewer_type==SVTK_Viewer::Type() || viewer_type==VVTK_Viewer::Type())
+ if( viewer_type==SVTK_Viewer::Type() /*|| viewer_type==VVTK_Viewer::Type()*/)
{
VISU::Base_i* aBase = dynamic_cast<VISU::Base_i*>(VISU::GetServant(anObj).in());
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VisuGUI_FileInfoDlg.cxx
-// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. ( alexander.solovyov@opencascade.com)
-// Module : VISU
-//
-
-#include <VisuGUI_FileInfoDlg.h>
-
-#include <MED_Common.hxx>
-
-#include <QGridLayout>
-#include <QLabel>
-#include <QLineEdit>
-
-VisuGUI_FileInfoDlg::VisuGUI_FileInfoDlg( QWidget* parent, SALOME_MED::MedFileInfo* inf )
- : QtxDialog( parent, true, true, QtxDialog::OK )
-{
- setWindowTitle( tr( "CAPTION" ) );
- setSizeGripEnabled( true );
-
- QLineEdit* fname = new QLineEdit( mainFrame() );
- fname->setReadOnly( true );
- QLineEdit* fsize = new QLineEdit( mainFrame() );
- fsize->setReadOnly( true );
- QLineEdit* medversion = new QLineEdit( mainFrame() );
- medversion->setReadOnly( true );
- fname->setMinimumWidth( 300 );
-
- QGridLayout* lay = new QGridLayout( mainFrame() );
- lay->setMargin( 5 ); lay->setSpacing( 5 );
- lay->addWidget( new QLabel( tr( "FILE_NAME" ), mainFrame() ), 0, 0 );
- lay->addWidget( fname, 0, 1 );
- lay->addWidget( new QLabel( tr( "FILE_SIZE" ), mainFrame() ), 1, 0 );
- lay->addWidget( fsize, 1, 1 );
- lay->addWidget( new QLabel( tr( "MED_VERSION" ), mainFrame() ), 2, 0 );
- lay->addWidget( medversion, 2, 1 );
-
- fname->setText( (char*)inf->fileName );
- fname->home( false );
- fsize->setText( QString::number( inf->fileSize ) );
-
- QString version;
- if( inf->major>=0 )
- {
- version = QString::number( inf->major );
- if( inf->minor>=0 )
- {
- version += "." + QString::number( inf->minor );
- if( inf->release>=0 )
- version += "." + QString::number( inf->release );
- }
- }
- medversion->setText( version );
-}
-
-VisuGUI_FileInfoDlg::~VisuGUI_FileInfoDlg()
-{
-}
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VisuGUI_FileInfoDlg.h
-// Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. ( alexander.solovyov@opencascade.com)
-//
-
-#ifndef VISUGUI_FILEINFODLG_H
-#define VISUGUI_FILEINFODLG_H
-
-#include <MED.hh>
-#include <QtxDialog.h>
-
-class VisuGUI_FileInfoDlg : public QtxDialog
-{
- Q_OBJECT
-
-public:
- VisuGUI_FileInfoDlg( QWidget*, SALOME_MED::MedFileInfo* );
- virtual ~VisuGUI_FileInfoDlg();
-};
-
-#endif // VISUGUI_FILEINFODLG_H
#include "VISU_ColoredPrs3dFactory.hh"
#include "VISU_GaussPoints_i.hh"
+#include "VISU_Prs3dUtils.hh"
#include "VISU_GaussPointsPL.hxx"
#include "VISU_OpenGLPointSpriteMapper.hxx"
#include "VISU_Convertor.hxx"
VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent):
QWidget(parent)
{
- myVerX = 0.01; myVerY = 0.10; myVerW = 0.10; myVerH = 0.80;
- myHorX = 0.20; myHorY = 0.01; myHorW = 0.60; myHorH = 0.12;
- myVerTW = myVerTH = myVerLW = myVerLH = myVerBW = myVerBH = 0;
- myHorTW = myHorTH = myHorLW = myHorLH = myHorBW = myHorBH = 0;
+ myVerX = 0.01; myVerY = 0.10; myVerW = 0.08; myVerH = 0.80;
+ myHorX = 0.10; myHorY = 0.01; myHorW = 0.80; myHorH = 0.08;
+ myVerTS = myVerLS = myVerBW = myVerBH = 0;
+ myHorTS = myHorLS = myHorBW = myHorBH = 0;
Imin = 0.0; Imax = 0.0;
myRangeMode = -1;
thePrs->GetBarOrientation());
if(RBvert->isChecked()) {
- myVerTW = thePrs->GetTitleWidth();
- myVerTH = thePrs->GetTitleHeight();
- myVerLW = thePrs->GetLabelWidth();
- myVerLH = thePrs->GetLabelHeight();
+ myVerTS = thePrs->GetTitleSize();
+ myVerLS = thePrs->GetLabelSize();
myVerBW = thePrs->GetBarWidth();
myVerBH = thePrs->GetBarHeight();
} else {
- myHorTW = thePrs->GetTitleWidth();
- myHorTH = thePrs->GetTitleHeight();
- myHorLW = thePrs->GetLabelWidth();
- myHorLH = thePrs->GetLabelHeight();
+ myHorTS = thePrs->GetTitleSize();
+ myHorLS = thePrs->GetLabelSize();
myHorBW = thePrs->GetBarWidth();
myHorBH = thePrs->GetBarHeight();
}
- myBarDlg->setLabelsFormat(thePrs->GetLabelsFormat());
+ myBarDlg->setLabelsPrecision( VISU::ToPrecision( thePrs->GetLabelsFormat() ) );
myBarDlg->setUnitsVisible(thePrs->IsUnitsVisible());
SpacingSpin->setValue(thePrs->GetSpacing());
vtkFloatingPointType R, G, B;
thePrs->GetTitleColor(R, G, B);
- myBarDlg->setLabelsFormat(thePrs->GetLabelsFormat());
+ int lp = VISU::ToPrecision( thePrs->GetLabelsFormat() );
+ myBarDlg->setLabelsPrecision( lp );
myBarDlg->setUnitsVisible(thePrs->IsUnitsVisible());
myTextDlg->myTitleFont->SetData(QColor((int)(R*255.), (int)(G*255.), (int)(B*255.)),
thePrs->SetLabels(LabelSpin->value());
if(RBvert->isChecked()) {
- thePrs->SetRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH);
+ thePrs->SetRatios(myVerTS, myVerLS, myVerBW, myVerBH);
} else {
- thePrs->SetRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH);
+ thePrs->SetRatios(myHorTS, myHorLS, myHorBW, myHorBH);
}
- thePrs->SetLabelsFormat(myBarDlg->getLabelsFormat().toLatin1().data());
+ std::string f = VISU::ToFormat( myBarDlg->getLabelsPrecision() );
+ thePrs->SetLabelsFormat( f.c_str() );
thePrs->SetUnitsVisible(myBarDlg->isUnitsVisible());
if (myIsStoreTextProp) {
void VisuGUI_GaussScalarBarPane::onBarPref()
{
if(RBvert->isChecked())
- myBarDlg->setRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH);
+ myBarDlg->setRatios(myVerTS, myVerLS, myVerBW, myVerBH);
else
- myBarDlg->setRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH);
+ myBarDlg->setRatios(myHorTS, myHorLS, myHorBW, myHorBH);
if(myBarDlg->exec()) {
if(RBvert->isChecked())
- myBarDlg->getRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH);
+ myBarDlg->getRatios(myVerTS, myVerLS, myVerBW, myVerBH);
else
- myBarDlg->getRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH);
+ myBarDlg->getRatios(myHorTS, myHorLS, myHorBW, myHorBH);
}
}
double Imin, Imax;
double myHorX, myHorY, myHorW, myHorH;
double myVerX, myVerY, myVerW, myVerH;
- int myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH;
- int myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH;
+ int myHorTS, myHorLS, myHorBW, myHorBH;
+ int myVerTS, myVerLS, myVerBW, myVerBH;
int myRangeMode;
bool myIsStoreTextProp;
#include "SALOMEDSClient_ClientFactory.hxx"
#include "SALOMEDSClient_IParameters.hxx"
-#include "VVTK_ViewManager.h"
-#include "VVTK_ViewWindow.h"
-#include "VVTK_ViewModel.h"
+//#include "VVTK_ViewManager.h"
+//#include "VVTK_ViewWindow.h"
+//#include "VVTK_ViewModel.h"
#include "SVTK_ViewModel.h"
#include "SVTK_ViewManager.h"
-#include "SVTK_MainWindow.h"
+#include "SVTK_ViewWindow.h"
#include "SVTK_RenderWindowInteractor.h"
#include "VISU_Event.h"
#include "VISU_GaussPtsAct.h"
#include "VisuGUI_GaussPointsDlg.h"
-#include "VisuGUI_Slider.h"
-
#include "VISU_Gen_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_CutLines_i.hh"
#include "VISU_SphereWidget.hxx"
#include "SalomeApp_Study.h"
-#include "VVTK_MainWindow.h"
+//#include "VVTK_MainWindow.h"
#include "VISU_View_i.hh"
#ifndef DISABLE_VTKVIEWER
#include <sstream>
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
#define GAUSS_RESTORE_CONFIGURATION 5702
#define GAUSS_RENAME_CONFIGURATION 5703
+using namespace std;
+
void
CreateCurves( SalomeApp_Module* theModule,
VISU::CutLines_i* thePrs,
{
//---------------------------------------------------------------
typedef void (SUIT_ViewWindow::* TViewVisibility)();
- void
- SetViewVisibility(SalomeApp_Application* app,
- TViewVisibility theViewVisibility)
+ void SetViewVisibility(SalomeApp_Application* app,
+ TViewVisibility theViewVisibility)
{
ViewManagerList l;
- app->viewManagers( VVTK_Viewer::Type(), l );
+ //app->viewManagers( VVTK_Viewer::Type(), l );
+ app->viewManagers( SVTK_Viewer::Type(), l );
ViewManagerList::const_iterator anIt = l.begin(), aLast = l.end();
for( ; anIt!=aLast; anIt++ )
if( SUIT_ViewManager* aViewManager = *anIt )
}
//---------------------------------------------------------------
-VisuGUI_Module::
-VisuGUI_Module() :
+VisuGUI_Module::VisuGUI_Module() :
VisuGUI()
{
}
//---------------------------------------------------------------
-VisuGUI_Module::
-~VisuGUI_Module()
+VisuGUI_Module::~VisuGUI_Module()
{
}
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-initialize( CAM_Application* theApp )
+void VisuGUI_Module::initialize( CAM_Application* theApp )
{
VisuGUI::initialize( theApp );
createMenu( SAVE_VISU_STATE, fileMenu, 9, -1 );
QPixmap aPixmap;
- aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER"));
- createAction( GAUSS_NEW_VIEWER,
- tr("MEN_GAUSS_NEW_VIEWER"),
+ /* aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GAUSS_NEW_VIEWER"));
+ createAction( GAUSS_NEW_VIEWER,
+ tr("MEN_GAUSS_NEW_VIEWER"),
aPixmap,
tr("MEN_GAUSS_NEW_VIEWER"),
tr("MEN_GAUSS_NEW_VIEWER"),
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 );
- QString aViewerType = VVTK_Viewer::Type();
+ QString aViewerType = SVTK_Viewer::Type();
SUIT_Accel* accel = getApp()->accel();
accel->setActionKey( SUIT_Accel::PanLeft, Qt::Key_Left, aViewerType );
accel->setActionKey( SUIT_Accel::PanRight, Qt::Key_Right, aViewerType );
accel->setActionKey( SUIT_Accel::RotateDown, Qt::CTRL+Qt::Key_Down, aViewerType );
accel->setActionKey( SVTK::PlusSpeedIncrementEvent, Qt::Key_Plus, aViewerType );
accel->setActionKey( SVTK::MinusSpeedIncrementEvent, Qt::Key_Minus, aViewerType );
-
+
connect( getApp(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
this, SLOT( OnViewManagerAdded (SUIT_ViewManager*) ) );
-
+
// Prepare popup menus
QtxPopupMgr* mgr = popupMgr();
QString aRule;
#ifndef DISABLE_VTKVIEWER
#ifndef DISABLE_SALOMEOBJECT
viewers.append( SVTK_Viewer::Type() );
- viewers.append( VVTK_Viewer::Type() );
+ //viewers.append( VVTK_Viewer::Type() );
#else
viewers.append( VTKViewer_Viewer::Type() );
#endif
this, SLOT(OnSaveConfiguration()));
mgr->insert( action( GAUSS_SAVE_CONFIGURATION ), -1, -1, -1 );
mgr->setRule( action( GAUSS_SAVE_CONFIGURATION ),
- "selcount>=0 and client='VVTK' and activeView='VVTK'" );
+ "selcount>=0 and client='SVTK' and activeView='SVTK'" );
createAction( GAUSS_OVERWRITE_CONFIGURATION, tr("MEN_OVERWRITE_CONFIGURATION"), QIcon(),
tr("MEN_OVERWRITE_CONFIGURATION"), "", 0, this, false,
this, SLOT(OnOverwriteConfiguration()));
mgr->insert( action( GAUSS_OVERWRITE_CONFIGURATION ), -1, -1, -1 );
mgr->setRule( action( GAUSS_OVERWRITE_CONFIGURATION ),
- "selcount>0 and type='VISU::TGAUSSVIEW' and activeView='VVTK'" );
+ "selcount>0 and type='VISU::TGAUSSVIEW' and activeView='SVTK'" );
createAction( GAUSS_RESTORE_CONFIGURATION, tr("MEN_RESTORE_CONFIGURATION"), QIcon(),
tr("MEN_RESTORE_CONFIGURATION"), "", 0, this, false,
"selcount=1 and type='VISU::TGAUSSVIEW'" );
}
-//---------------------------------------------------------------
-bool
-VisuGUI_Module::
-activateModule( SUIT_Study* theStudy )
-{
- VisuGUI::activateModule( theStudy );
+// //---------------------------------------------------------------
+// bool VisuGUI_Module::activateModule( SUIT_Study* theStudy )
+// {
+// VisuGUI::activateModule( theStudy );
- SetViewVisibility(getApp(),&SUIT_ViewWindow::show);
-
- return true;
-}
+// //SetViewVisibility(getApp(),&SUIT_ViewWindow::show);
+// return true;
+// }
//---------------------------------------------------------------
-bool
-VisuGUI_Module::
-deactivateModule( SUIT_Study* theStudy )
-{
- VisuGUI::deactivateModule( theStudy );
+// bool VisuGUI_Module::deactivateModule( SUIT_Study* theStudy )
+// {
+// return VisuGUI::deactivateModule( theStudy );
- SetViewVisibility(getApp(),&SUIT_ViewWindow::hide);
+// //SetViewVisibility(getApp(),&SUIT_ViewWindow::hide);
- return true;
-}
+// //return true;
+// }
//---------------------------------------------------------------
-SUIT_ViewManager*
-VisuGUI_Module::
-onCreateViewManager()
-{
- SalomeApp_Application* anApp = getApp();
- SUIT_ResourceMgr* aResourceMgr = anApp->resourceMgr();
- VVTK_ViewManager* aViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() );
- VVTK_Viewer* aViewer = (VVTK_Viewer*)aViewManager->getViewModel();
- aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) );
- aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ),
- aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
- new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
- anApp->addViewManager( aViewManager );
-
- VVTK_ViewWindow* aViewWindow = ( VVTK_ViewWindow* )aViewManager->createViewWindow();
- if( aViewWindow )
- {
- new VisuGUI_Slider( this, aViewWindow, anApp->selectionMgr() );
- }
-
- return aViewer->getViewManager();
-}
+// SUIT_ViewManager* VisuGUI_Module::onCreateViewManager()
+// {
+// SalomeApp_Application* anApp = getApp();
+// SUIT_ResourceMgr* aResourceMgr = anApp->resourceMgr();
+// VVTK_ViewManager* aViewManager = new VVTK_ViewManager( anApp->activeStudy(), anApp->desktop() );
+// VVTK_Viewer* aViewer = (VVTK_Viewer*)aViewManager->getViewModel();
+// aViewer->setBackgroundColor( aResourceMgr->colorValue( "VTKViewer", "background", aViewer->backgroundColor() ) );
+// aViewer->setProjectionMode( aResourceMgr->integerValue( "VTKViewer", "projection_mode", aViewer->projectionMode() ) );
+// aViewer->setTrihedronSize( aResourceMgr->integerValue( "VTKViewer", "trihedron_size", aViewer->trihedronSize() ),
+// aResourceMgr->booleanValue( "VTKViewer", "relative_size", aViewer->trihedronRelative() ) );
+// aViewer->setIncrementalSpeed( aResourceMgr->integerValue( "VTKViewer", "speed_value", aViewer->incrementalSpeed() ),
+// aResourceMgr->integerValue( "VTKViewer", "speed_mode", aViewer->incrementalSpeedMode() ) );
+// aViewer->setInteractionStyle( aResourceMgr->integerValue( "VTKViewer", "navigation_mode", aViewer->interactionStyle() ) );
+// aViewer->setSpacemouseButtons( aResourceMgr->integerValue( "VTKViewer", "spacemouse_func1_btn", aViewer->spacemouseBtn(1) ),
+// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func2_btn", aViewer->spacemouseBtn(1) ),
+// aResourceMgr->integerValue( "VTKViewer", "spacemouse_func5_btn", aViewer->spacemouseBtn(1) ) );
+
+// new LightApp_VTKSelector( aViewer, anApp->selectionMgr() );
+
+// anApp->addViewManager( aViewManager );
+
+// return aViewer->getViewManager();
+// }
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-createPreferences()
+void VisuGUI_Module::createPreferences()
{
VisuGUI::createPreferences();
createInsideCursorPreferences();
createOutsideCursorPreferences();
createPickingPreferences();
- createSpaceMousePreferences();
- createRecorderPreferences();
+ // createSpaceMousePreferences();
+ //createRecorderPreferences();
}
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-createGaussPointsPreferences()
+void VisuGUI_Module::createGaussPointsPreferences()
{
int gaussTab = addPreference( tr( "VISU_GAUSS_PREF_TAB_TTL" ) );
int primitiveGr = addPreference( tr( "VISU_GAUSS_PREF_PRIMITIVE_GROUP_TTL" ), gaussTab );
setPreferenceProperty( spacingPref, "min", 0.01 );
setPreferenceProperty( spacingPref, "max", 1.0 );
setPreferenceProperty( spacingPref, "step", 0.01 );
+
+ // spacemouse
+ int spacemouseGr = addPreference( tr( "VISU_SPACEMOUSE_PREF" ), gaussTab );
+ setPreferenceProperty( spacemouseGr, "columns", 2 );
+ int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func3_btn" ); //decrease_gauss_point_magnification
+ int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr,
+ LightApp_Preferences::Selector, "VISU",
+ "spacemouse_func4_btn" ); //increase_gauss_point_magnification
+ values.clear();
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_1" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_2" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_3" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_4" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_5" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_6" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_7" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_8" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_*" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_10" ) );
+ values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_11" ) );
+ indices.clear();
+ indices.append( 1 );
+ indices.append( 2 );
+ indices.append( 3 );
+ indices.append( 4 );
+ indices.append( 5 );
+ indices.append( 6 );
+ indices.append( 7 );
+ indices.append( 8 );
+ indices.append( 9 ); // == button_*
+ indices.append( 10 );
+ indices.append( 11 );
+ setPreferenceProperty( spacemousePref3, "strings", values );
+ setPreferenceProperty( spacemousePref3, "indexes", indices );
+ setPreferenceProperty( spacemousePref4, "strings", values );
+ setPreferenceProperty( spacemousePref4, "indexes", indices );
}
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-createInsideCursorPreferences()
+void VisuGUI_Module::createInsideCursorPreferences()
{
int insideCursorTab = addPreference( tr( "VISU_GAUSS_INSIDE_CURSOR_PREF_TAB_TTL" ) );
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-createOutsideCursorPreferences()
+void VisuGUI_Module::createOutsideCursorPreferences()
{
int outsideCursorTab = addPreference( tr( "VISU_GAUSS_OUTSIDE_CURSOR_PREF_TAB_TTL" ) );
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-createPickingPreferences()
+void VisuGUI_Module::createPickingPreferences()
{
int pickingTab = addPreference( tr( "VISU_PICKING_PREF_TAB_TTL" ) );
int infoWindowGr = addPreference( tr( "VISU_PICKING_PREF_INFO_WINDOW_GROUP_TTL" ), pickingTab );
setPreferenceProperty( infoWindowGr, "columns", 2 );
+ int infoWindowPref = addPreference( tr( "VISU_PICKING_PREF_INFO_WINDOW" ), infoWindowGr,
+ LightApp_Preferences::Bool, "VISU", "picking_info_window" );
+ setPreferenceProperty( infoWindowPref, "columns", 2 );
+
int transparencyPref = addPreference( tr( "VISU_PICKING_PREF_TRANSPARENCY" ), infoWindowGr,
LightApp_Preferences::IntSpin, "VISU", "picking_transparency" );
setPreferenceProperty( transparencyPref, "min", 0 );
int cameraGr = addPreference( tr( "VISU_PICKING_PREF_CAMERA_GROUP_TTL" ), pickingTab );
setPreferenceProperty( cameraGr, "columns", 2 );
+ int cameraPref = addPreference( tr( "VISU_PICKING_PREF_CAMERA_MOVEMENT" ), cameraGr,
+ LightApp_Preferences::Bool, "VISU", "picking_camera_movement" );
+ setPreferenceProperty( cameraPref, "columns", 2 );
+
int zoomFactorPref = addPreference( tr( "VISU_PICKING_PREF_ZOOM_FACTOR" ), cameraGr,
LightApp_Preferences::DblSpin, "VISU", "picking_zoom_factor" );
setPreferenceProperty( zoomFactorPref, "min", 0.1 );
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-createSpaceMousePreferences()
+void VisuGUI_Module::createSpaceMousePreferences()
{
int mouseTab = addPreference( tr( "VISU_MOUSE_PREF_TAB_TLT" ) );
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-createRecorderPreferences()
+void VisuGUI_Module::createRecorderPreferences()
{
int recorderTab = addPreference( tr( "VISU_RECORDER_PREF_TAB_TTL" ) );
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-OnCreateGaussPoints()
+void VisuGUI_Module::OnCreateGaussPoints()
{
double initialTime = vtkTimerLog::GetCPUTime();
- CreatePrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, VVTK_Viewer::Type());
+ //CreatePrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, VVTK_Viewer::Type());
+ Prs3d_i* aPrs = CreatePrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, SVTK_Viewer::Type());
+ if (aPrs)
+ emit presentationCreated(aPrs);
INFOS( "VisuGUI_Module::OnCreateGaussPoints() : Gauss Points created in " <<
vtkTimerLog::GetCPUTime() - initialTime << " seconds" );
}
-void
-VisuGUI_Module::
-OnViewManagerAdded(SUIT_ViewManager* viewMgr)
-{
- QString type = viewMgr->getViewModel()->getType();
- if ( type == VVTK_Viewer::Type() )
- connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
- this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
-}
+// void VisuGUI_Module::OnViewManagerAdded(SUIT_ViewManager* viewMgr)
+// {
+// QString type = viewMgr->getViewModel()->getType();
+// if ( type == VVTK_Viewer::Type() )
+// connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ),
+// this, SLOT( OnViewCreated( SUIT_ViewWindow* ) ) );
+// }
-void
-VisuGUI_Module::
-OnViewCreated(SUIT_ViewWindow* view)
+void VisuGUI_Module::OnViewCreated(SUIT_ViewWindow* view)
{
SVTK_ViewWindow* viewWindow = dynamic_cast<SVTK_ViewWindow*>( view );
if ( viewWindow ) {
}
}
-void
-VisuGUI_Module::
-setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
+void VisuGUI_Module::setProperty( SVTK_ViewWindow* viewWindow, const QString& pref )
{
if ( !viewWindow )
return;
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
- SVTK_MainWindow* aMainWindow = viewWindow->getMainWindow();
+ //SVTK_MainWindow* aMainWindow = viewWindow->getMainWindow();
int val;
if ( pref == "speed_increment" ) {
- val = resMgr->integerValue( "VISU", pref, 10 );
- aMainWindow->InvokeEvent( SVTK::SetSpeedIncrementEvent, &val );
+ val = resMgr->integerValue( "VTKViewer", pref, 10 );
+ viewWindow->InvokeEvent( SVTK::SetSpeedIncrementEvent, &val );
}
else if ( pref == "spacemouse_func1_btn" ) {
- val = resMgr->integerValue( "VISU", pref, 1 );
- aMainWindow->InvokeEvent( SVTK::SetSMDecreaseSpeedEvent, &val );
+ val = resMgr->integerValue( "VTKViewer", pref, 1 );
+ viewWindow->InvokeEvent( SVTK::SetSMDecreaseSpeedEvent, &val );
}
else if ( pref == "spacemouse_func2_btn" ) {
- val = resMgr->integerValue( "VISU", pref, 2 );
- aMainWindow->InvokeEvent( SVTK::SetSMIncreaseSpeedEvent, &val );
+ val = resMgr->integerValue( "VTKViewer", pref, 2 );
+ viewWindow->InvokeEvent( SVTK::SetSMIncreaseSpeedEvent, &val );
}
else if ( pref == "spacemouse_func3_btn" ) {
val = resMgr->integerValue( "VISU", pref, 10 );
- aMainWindow->InvokeEvent( VISU::SetSMDecreaseMagnificationEvent, &val );
+ viewWindow->InvokeEvent( VISU::SetSMDecreaseMagnificationEvent, &val );
}
else if ( pref == "spacemouse_func4_btn" ) {
val = resMgr->integerValue( "VISU", pref, 11 );
- aMainWindow->InvokeEvent( VISU::SetSMIncreaseMagnificationEvent, &val );
+ viewWindow->InvokeEvent( VISU::SetSMIncreaseMagnificationEvent, &val );
}
else if ( pref == "spacemouse_func5_btn" ) {
- val = resMgr->integerValue( "VISU", pref, 9 );
- aMainWindow->InvokeEvent( SVTK::SetSMDominantCombinedSwitchEvent, &val );
+ val = resMgr->integerValue( "VTKViewer", pref, 9 );
+ viewWindow->InvokeEvent( SVTK::SetSMDominantCombinedSwitchEvent, &val );
}
}
-void
-VisuGUI_Module::
-setProperty( SVTK_ViewManager* vm, const QString& prop )
+void VisuGUI_Module::setProperty( SVTK_ViewManager* vm, const QString& prop )
{
if ( !vm )
return;
setProperty( dynamic_cast<SVTK_ViewWindow*>( windows[i] ), prop );
}
-void
-VisuGUI_Module::
-preferencesChanged( const QString& group, const QString& pref )
+void VisuGUI_Module::preferencesChanged( const QString& group, const QString& pref )
{
VisuGUI::preferencesChanged(group,pref);
- if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" ||
- pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" ||
- pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) {
+// if ( group == "VISU" && ( pref == "speed_increment" || pref == "spacemouse_func1_btn" ||
+// pref == "spacemouse_func2_btn" || pref == "spacemouse_func3_btn" ||
+// pref == "spacemouse_func4_btn" || pref == "spacemouse_func5_btn" ) ) {
- // update properties of VVTK view windows
- SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
- if ( vm )
- setProperty( dynamic_cast<SVTK_ViewManager*>( vm ), pref );
- }
+// // update properties of VVTK view windows
+// SUIT_ViewManager* vm = getApp()->getViewManager( VVTK_Viewer::Type(), false );
+// if ( vm )
+// setProperty( dynamic_cast<SVTK_ViewManager*>( vm ), pref );
+// }
}
//---------------------------------------------------------------
-SUIT_ViewManager*
-VisuGUI_Module::
-getViewManager(const QString& theType,
+SUIT_ViewManager* VisuGUI_Module::getViewManager(const QString& theType,
const bool theIsCreate)
{
if (SUIT_ViewManager* aViewManager = VisuGUI::getViewManager(theType,theIsCreate))
return aViewManager;
- if (theIsCreate && theType == VVTK_Viewer::Type())
- return onCreateViewManager();
+// if (theIsCreate && theType == VVTK_Viewer::Type())
+// return onCreateViewManager();
return NULL;
}
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-OnEditGaussPoints()
+void VisuGUI_Module::OnEditGaussPoints()
{
VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
if(aSelectionInfo.empty())
Handle(SALOME_InteractiveObject) anIO = aSelectionItem.myIO;
if(VISU::Prs3d_i* aPrs3d = VISU::GetPrs3dToModify(this, aSelectionItem.myObjectInfo.myBase)){
- // Create VVTK_ViewWindow, if it does not exist
- if (VVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this)) {
+ if (SVTK_ViewWindow* aViewWindow = GetViewWindow<SVTK_Viewer>(this)) {
EditPrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, anIO, aPrs3d, aViewWindow);
}
+ // Create VVTK_ViewWindow, if it does not exist
+// if (VVTK_ViewWindow* aViewWindow = GetViewWindow<VVTK_Viewer>(this)) {
+// EditPrs3d<VISU::GaussPoints_i, VisuGUI_GaussPointsDlg, 1>(this, anIO, aPrs3d, aViewWindow);
+// }
}
}
//---------------------------------------------------------------
namespace
{
- void
- GetViewParams(VVTK_MainWindow* theViewWindow,
- const char* theSuffix,
- std::ostringstream& theStr)
+ /* void GetViewParams(VVTK_MainWindow* theViewWindow,
+ const char* theSuffix,
+ std::ostringstream& theStr)
{
vtkFloatingPointType aColor[3];
vtkRenderer* aRenderer = theViewWindow->getRenderer();
Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[1]").c_str(),aScaleFactor[1]);
Storable::DataToStream(theStr,(std::string("myScaleFactor") + theSuffix + "[2]").c_str(),aScaleFactor[2]);
}
-
+ */
//---------------------------------------------------------------
- void
- SetViewParams(VVTK_MainWindow* theViewWindow,
- const char* theSuffix,
- const Storable::TRestoringMap& theMap)
+ /* void SetViewParams(VVTK_MainWindow* theViewWindow,
+ const char* theSuffix,
+ const Storable::TRestoringMap& theMap)
{
vtkFloatingPointType aColor[3];
aColor[0] = Storable::FindValue(theMap,std::string("myColor") + theSuffix + ".R").toDouble();
aScaleFactor[2] = Storable::FindValue(theMap,std::string("myScaleFactor") + theSuffix + "[2]").toDouble();
theViewWindow->SetScale(aScaleFactor);
}
-
+ */
//---------------------------------------------------------------
- void
- GetViewParams(VVTK_MainWindow1* theViewWindow,
- std::ostringstream& theStr)
+ /* void GetViewParams(VVTK_MainWindow1* theViewWindow,
+ std::ostringstream& theStr)
{
GetViewParams(theViewWindow,"1",theStr);
Storable::DataToStream(theStr,"mySegmentationMode",aSegmentationMode.c_str());
}
}
-
+ */
//---------------------------------------------------------------
- void
- SetViewParams(VVTK_MainWindow1* theViewWindow,
- const Storable::TRestoringMap& theMap)
+ /*void SetViewParams(VVTK_MainWindow1* theViewWindow,
+ const Storable::TRestoringMap& theMap)
{
SetViewParams(theViewWindow,"1",theMap);
}
-
+ */
//---------------------------------------------------------------
- void
- GetViewParams(VVTK_MainWindow2* theViewWindow,
- std::ostringstream& theStr)
+ /*void GetViewParams(VVTK_MainWindow2* theViewWindow,
+ std::ostringstream& theStr)
{
GetViewParams(theViewWindow,"2",theStr);
}
- void
- SetViewParams(VVTK_MainWindow2* theViewWindow,
- const Storable::TRestoringMap& theMap)
+ void SetViewParams(VVTK_MainWindow2* theViewWindow,
+ const Storable::TRestoringMap& theMap)
{
SetViewParams(theViewWindow,"2",theMap);
}
-
+ */
//---------------------------------------------------------------
- std::string
- GetViewParams(VVTK_ViewWindow* theViewWindow)
+ /*std::string GetViewParams(VVTK_ViewWindow* theViewWindow)
{
std::ostringstream aStream;
return aStream.str();
}
-
+ */
//---------------------------------------------------------------
struct TSelection
{
myVisibleEntries(theVisibleEntries)
{}
- void
- operator()(VISU_GaussPtsAct* theActor)
+ void operator()(VISU_GaussPtsAct* theActor)
{
if(theActor->GetVisibility()){
const Handle(SALOME_InteractiveObject)& anIO = theActor->getIO();
}
};
- void
- GetGaussPointsSelection(VVTK_ViewWindow* theViewWindow,
- TVisibleEntries& theVisibleEntries)
+ /*void GetGaussPointsSelection(SVTK_ViewWindow* theViewWindow,
+ TVisibleEntries& theVisibleEntries)
{
// First find all visible Gauss Points presentations
vtkRenderer* aRenderer = theViewWindow->getRenderer();
}
}
}
-
+ */
//---------------------------------------------------------------
- inline
- void
- CreateReference(_PTR(Study) theStudyDocument,
- _PTR(StudyBuilder) theStudyBuilder,
- _PTR(SObject) theFatherSObject,
- const string& theRefEntry,
- const TSelection& theSelection)
+ inline void CreateReference(_PTR(Study) theStudyDocument,
+ _PTR(StudyBuilder) theStudyBuilder,
+ _PTR(SObject) theFatherSObject,
+ const string& theRefEntry,
+ const TSelection& theSelection)
{
_PTR(SObject) aNewObj = theStudyBuilder->NewObject(theFatherSObject);
_PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry);
//---------------------------------------------------------------
- void
- SetGaussPointsSelection(VisuGUI* theModule,
- VVTK_ViewWindow* theViewWindow,
- _PTR(Study) theCStudy,
- _PTR(SObject) theSObject)
+ /*void SetGaussPointsSelection(VisuGUI* theModule,
+ SVTK_ViewWindow* theViewWindow,
+ _PTR(Study) theCStudy,
+ _PTR(SObject) theSObject)
{
SVTK_Selector* aSelector = theViewWindow->GetSelector();
aSelector->ClearIObjects();
PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
if(VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in())){
// To set visiblity
- VISU::UpdateViewer(theModule, aPrs3d, /*disp_only = */anIsFirst, /*highlight = */false);
+ VISU::UpdateViewer(theModule, aPrs3d, anIsFirst, false);
anIsFirst = false;
// To update selection
aSelector->EndPickCallback(); // To invoke selection changed signal
}
-
+ */
//---------------------------------------------------------------
- void
- OnStoreConfiguration(SalomeApp_Module* theModule,
- bool theIsNew)
+ /*void OnStoreConfiguration(SalomeApp_Module* theModule,
+ bool theIsNew)
{
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
if (CheckLock(aCStudy,GetDesktop(theModule)))
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(theModule);
SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager();
- if(aViewManager->getType() == VVTK_Viewer::Type()){
+ if(aViewManager->getType() == VVTK_Viewer::Type()){
SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
//UpdateObjBrowser(theModule,true,aSObject);
UpdateObjBrowser(theModule,true);
}
- }
- }
+ }
+ }*/
//---------------------------------------------------------------
- template<class TMainWindow>
- void
- SetMainWindowParams(VisuGUI* theModule,
- _PTR(SObject) theSObject,
- VVTK_ViewWindow* theViewWindow,
- TMainWindow* theMainWindow)
+/* template<class TMainWindow>
+ void SetMainWindowParams(VisuGUI* theModule,
+ _PTR(SObject) theSObject,
+ VVTK_ViewWindow* theViewWindow,
+ TMainWindow* theMainWindow)
{
_PTR(Study) aCStudy = GetCStudy(GetAppStudy(theModule));
Storable::TRestoringMap aMap = Storable::GetStorableMap(theSObject);
if(!aMap.empty())
SetViewParams(theMainWindow, aMap);
- }
+ }*/
}
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-OnSaveConfiguration()
-{
- ::OnStoreConfiguration(this,true);
-}
+// void VisuGUI_Module::OnSaveConfiguration()
+// {
+// ::OnStoreConfiguration(this,true);
+// }
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-OnOverwriteConfiguration()
-{
- ::OnStoreConfiguration(this,false);
-}
+// void VisuGUI_Module::OnOverwriteConfiguration()
+// {
+// ::OnStoreConfiguration(this,false);
+// }
//---------------------------------------------------------------
-void
-VisuGUI_Module::
-OnRestoreConfiguration()
+/*void VisuGUI_Module::OnRestoreConfiguration()
{
LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
myConfigSObject = aSObject;
Storable::TRestoringMap aMap = Storable::GetStorableMap(aSObject);
if(!aMap.empty()){
- SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
- VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
-
+ SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView();
+
Selection_Mode aSelectionMode = Storable::FindValue(aMap,"mySelectionMode").toInt();
SVTK_Selector* aSelector = aViewWindow->GetSelector();
aSelector->SetSelectionMode(aSelectionMode);
SetGaussPointsSelection(this,aViewWindow,aCStudy,aSObject);
}
}
-}
+}*/
//---------------------------------------------------------------
-bool
-VisuGUI_Module::
-eventFilter( QObject * theWatched, QEvent * theEvent )
-{
- bool aRet = VisuGUI::eventFilter(theWatched,theEvent);
- if(theEvent->type() == QEvent::Show){
- if(SUIT_ViewManager* aViewManager = getViewManager(VVTK_Viewer::Type(),false)){
- SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
- VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
- if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
- SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
- if(theWatched == anInteractor){
- SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
- anInteractor->removeEventFilter(this);
- }
- }
- if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
- SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
- if(theWatched == aMainWindow->GetInteractor()){
- SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
- anInteractor->removeEventFilter(this);
- }
- }
- }
- }
- return aRet;
-}
+//bool VisuGUI_Module::eventFilter( QObject * theWatched, QEvent * theEvent )
+//{
+// bool aRet = VisuGUI::eventFilter(theWatched,theEvent);
+// if(theEvent->type() == QEvent::Show){
+// if(SUIT_ViewManager* aViewManager = getViewManager(VVTK_Viewer::Type(),false)){
+// SUIT_ViewWindow* aWindow = aViewManager->getActiveView();
+// VVTK_ViewWindow* aViewWindow = dynamic_cast<VVTK_ViewWindow*>(aWindow);
+// if(VVTK_MainWindow1* aMainWindow = aViewWindow->getMainWindow1()){
+// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+// if(theWatched == anInteractor){
+// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+// anInteractor->removeEventFilter(this);
+// }
+// }
+// if(VVTK_MainWindow2* aMainWindow = aViewWindow->getMainWindow2()){
+// SVTK_RenderWindowInteractor* anInteractor = aMainWindow->GetInteractor();
+// if(theWatched == aMainWindow->GetInteractor()){
+// SetMainWindowParams(this,myConfigSObject,aViewWindow,aMainWindow);
+// anInteractor->removeEventFilter(this);
+// }
+// }
+// }
+// }
+// return aRet;
+//}
const char gSeparator = '_'; // character used to separate parameter names
_PTR(IParameters) ip = ClientFactory::getIParameters(ap);
// viewers counters are used for storing view_numbers in IParameters
- int svtkViewers( 0 ), vvtkViewers( 0 ), plotViewers( 0 );
+ int svtkViewers( 0 ), /*vvtkViewers( 0 ),*/ plotViewers( 0 );
// componentName is used for encoding of entries when storing them in IParameters
_PTR(SComponent) visuEng = ClientFindOrCreateVisuComponent( studyDS );
// 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 ( it = lst.begin(); it != lst.end(); it++ ) {
if ( SUIT_ViewWindow* vwin = (*it)->getActiveView() ) {
vvtkViewers++;
}
}
-
+ */
// VISU module opens one SVTK viewer in activateModule(). This causes a bug in save-restore visual
// parameters: it no SVTK view was saved, we need NOT any SVTK on restore. Here we store if any is open..
/*
// main cycle to store parameters of displayed objects
lst.clear();
getApp()->viewManagers( lst );
- vvtkViewers = svtkViewers = plotViewers = 0;
+ /*vvtkViewers = */svtkViewers = plotViewers = 0;
for ( it = lst.begin(); it != lst.end(); it++ ) {
SUIT_ViewManager* vman = *it;
QString vType = vman->getType();
int* viewsCounter = vType == SVTK_Viewer::Type() ? &svtkViewers :
- vType == VVTK_Viewer::Type() ? &vvtkViewers :
+ //vType == VVTK_Viewer::Type() ? &vvtkViewers :
vType == SPlot2d_Viewer::Type() ? &plotViewers : 0;
// saving VTK actors' properties
- if ( vType == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers in the same
- vType == VVTK_Viewer::Type() ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
+ if ( vType == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers in the same
+ vType == VVTK_Viewer::Type()*/ ) { // way (VVTK_ViewWindow inherits SVTK_ViewWindow)
QVector<SUIT_ViewWindow*> views = vman->getViews();
for ( int i = 0, iEnd = vman->getViewsCount(); i < iEnd; i++ ) {
QList<Plot2d_Curve*> curves;
QList<Plot2d_Curve*>::Iterator itCurve;
plotVF->getCurves( curves );
-
- Plot2d_Curve* curve;
+
+ //Plot2d_Curve* curve;
for ( itCurve = curves.begin(); itCurve != curves.end(); itCurve++ ) {
if ( SPlot2d_Curve* sCurve = dynamic_cast<SPlot2d_Curve*>( *itCurve ) ) {
if ( sCurve->hasIO() ) {
std::vector<std::string> paramValues = ip->getAllParameterValues( *entIt );
std::vector<std::string>::iterator namesIt = paramNames.begin();
std::vector<std::string>::iterator valuesIt = paramValues.begin();
-
- if ( *entIt == "GaussViewer" ) {
- // parameter names are view window's captions, values - visual parameters.
- for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
- SUIT_ViewManager* vman = onCreateViewManager();
- SUIT_ViewWindow* vwin = vman->getActiveView();
- vwin->setWindowTitle( (*namesIt).c_str() );
-
- // wait untill the window is really shown. This step fixes MANY bugs..
- while ( !vwin->isVisible() )
- qApp->processEvents();
-
- vwin->setVisualParameters( (*valuesIt).c_str() );
- }
- continue; // skip to next entry
- }
-
- // entry is a normal entry - it should be "decoded" (setting base adress of component)
+
+// if ( *entIt == "GaussViewer" ) {
+// // parameter names are view window's captions, values - visual parameters.
+// for ( ; namesIt != paramNames.end(); ++namesIt, ++valuesIt ) {
+// SUIT_ViewManager* vman = onCreateViewManager();
+// SUIT_ViewWindow* vwin = vman->getActiveView();
+// vwin->setWindowTitle( (*namesIt).c_str() );
+
+// // wait untill the window is really shown. This step fixes MANY bugs..
+// while ( !vwin->isVisible() )
+// qApp->processEvents();
+
+// vwin->setVisualParameters( (*valuesIt).c_str() );
+// }
+// continue; // skip to next entry
+// }
+
+ // entry is a normal entry - it should be "decoded" (setting base adress of component)
QString entry( ip->decodeEntry( *entIt ).c_str() );
//SRN: Added a check that the entry corresponds to Standard_Real object in the Study
// cout << " -- " << viewerType << ": entry = " << entry.latin1() << ", paramName = " << paramName << endl;
- if ( viewerType == SVTK_Viewer::Type().toLatin1().data() ||
- viewerType == VVTK_Viewer::Type().toLatin1().data() ) {
+ if ( viewerType == SVTK_Viewer::Type().toLatin1().data() /*||
+ viewerType == VVTK_Viewer::Type().toLatin1().data()*/ ) {
// used as inner map key for locating the actor.
QString viewerTypeIndex = QString( viewerType.c_str() ) + QString::number( viewIndex );
if ( !prs )
continue;
- prs->RemoveAllClippingPlanes();
+ //prs->RemoveAllClippingPlanes();
+ for (int i = prs->GetNumberOfClippingPlanes() - 1; i >= 0 ; i--) {
+ OrientedPlane* aPlane = dynamic_cast<OrientedPlane*>(prs->GetClippingPlane(i));
+ if (aPlane)
+ prs->RemoveClippingPlane(i);
+ }
if ( val != "Off" ) {
QStringList vals = val.split( gDigitsSep, QString::SkipEmptyParts );
if ( vals.count() == 6 ) { // format check: 6 float values
SUIT_ViewModel* vmodel = (*it)->getViewModel();
if ( !vmodel )
continue;
- if ( vmodel->getType() == SVTK_Viewer::Type() || // processing SVTK and VVTK viewers
- vmodel->getType() == VVTK_Viewer::Type() ) { // in the same way
+ if ( vmodel->getType() == SVTK_Viewer::Type() /*|| // processing SVTK and VVTK viewers
+ vmodel->getType() == VVTK_Viewer::Type()*/ ) { // in the same way
SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) (*it)->getActiveView();
vtkView->getRenderer()->ResetCameraClippingRange();
vtkView->Repaint();
*/
// if active Gauss Viewer is set ( != -1) then raise the gauss view window.
- bool ok;
- QString activeGaussViewerStr = ip->getProperty( "ActiveGaussViewer" ).c_str();
- int activeGaussViewer = activeGaussViewerStr.toInt( &ok );
- if ( ok && activeGaussViewer != -1 ) {
- lst.clear();
- getApp()->viewManagers( VVTK_Viewer::Type(), lst );
- if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
- SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
- if ( activeView ) {
- activeView->activateWindow();
- //activeView->setFocus();
- }
- }
- }
+// bool ok;
+// QString activeGaussViewerStr = ip->getProperty( "ActiveGaussViewer" ).c_str();
+// int activeGaussViewer = activeGaussViewerStr.toInt( &ok );
+// if ( ok && activeGaussViewer != -1 ) {
+// lst.clear();
+// getApp()->viewManagers( VVTK_Viewer::Type(), lst );
+// if ( activeGaussViewer >= 0 && activeGaussViewer < lst.count() ) {
+// SUIT_ViewWindow* activeView = lst.at( activeGaussViewer )->getActiveView();
+// if ( activeView ) {
+// activeView->activateWindow();
+// //activeView->setFocus();
+// }
+// }
+// }
}
virtual
~VisuGUI_Module();
- virtual
- bool
- eventFilter( QObject * theWatched, QEvent * theEvent );
+ // virtual
+ // bool
+ // eventFilter( QObject * theWatched, QEvent * theEvent );
//! Redifined method of the module initializing.
virtual
void
restoreVisualParameters(int savePoint);
-public slots:
+ //public slots:
//! Reimplemented method of the module deactivation.
- virtual
- bool
- deactivateModule( SUIT_Study* );
+ // virtual bool deactivateModule( SUIT_Study* );
//! Reimplemented method of the module activation.
- virtual
- bool
- activateModule( SUIT_Study* );
+ // virtual bool activateModule( SUIT_Study* );
protected:
//! Create preferences for Gauss Points presentation.
createRecorderPreferences();
protected slots:
- SUIT_ViewManager*
- onCreateViewManager();
+ // SUIT_ViewManager*
+ // onCreateViewManager();
void
OnCreateGaussPoints();
void
OnViewCreated(SUIT_ViewWindow*);
- void
- OnViewManagerAdded(SUIT_ViewManager*);
+ // void
+ //OnViewManagerAdded(SUIT_ViewManager*);
//! Reimplemented method of the Gauss Points edition.
virtual
OnEditGaussPoints();
//! Virtual method of saving configuration.
- virtual
- void
- OnSaveConfiguration();
+ // virtual
+ // void
+ // OnSaveConfiguration();
//! Virtual method of overwriting configuration.
- virtual
- void
- OnOverwriteConfiguration();
+ // virtual
+ // void
+ // OnOverwriteConfiguration();
//! Virtual method of restoring configuration.
- virtual
- void
- OnRestoreConfiguration();
+ // virtual
+ // void
+ // OnRestoreConfiguration();
protected:
_PTR(SObject) myConfigSObject;
void setProperty( SVTK_ViewWindow*, const QString& ); // set a property (speed_increment, etc ) for SVTK ViewWindow
void setProperty( SVTK_ViewManager*, const QString& ); // set a property for SVTK ViewWindow // set only 1 property for all ViewWindows of given view manager
+
};
#endif
#include "VISU_ScalarMapAct.h"
#include "VISU_ScalarMap_i.hh"
#include "VISU_Result_i.hh"
+#include "VISU_Prs3dUtils.hh"
#include "LightApp_Application.h"
setWindowTitle(tr("TIT_TEXT_PREF"));
setSizeGripEnabled(TRUE);
- QVBoxLayout* TopLayout = new QVBoxLayout(this);
- TopLayout->setSpacing(6);
- TopLayout->setMargin(11);
+ QVBoxLayout* aMainLay = new QVBoxLayout(this);
+ aMainLay->setSpacing(6);
+ aMainLay->setMargin(11);
// "Title" grp
QGroupBox* aTitleGrp = new QGroupBox ( tr("LBL_TITLE"), this);
myTitleFont = new SVTK_FontWidget (aHBox);
aHBLay->addWidget( myTitleFont );
- TopLayout->addWidget(aTitleGrp);
+ aMainLay->addWidget(aTitleGrp);
// "Labels" grp
QGroupBox* aLabelsGrp = new QGroupBox (tr("LBL_LABELS"), this);
myLabelFont = new SVTK_FontWidget (aHBox);
aHBLay->addWidget( myLabelFont );
- TopLayout->addWidget(aLabelsGrp);
+ aMainLay->addWidget(aLabelsGrp);
// Common buttons ===========================================================
QGroupBox* GroupButtons = new QGroupBox( this );
buttonHelp->setAutoDefault( TRUE );
GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
- TopLayout->addWidget( GroupButtons );
+ aMainLay->addWidget( GroupButtons );
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
Constructor
*/
VisuGUI_BarPrefDlg::VisuGUI_BarPrefDlg( QWidget* parent )
- : QDialog( parent )
+ : QDialog( parent ),
+ myOrientation( 1 )
{
setModal( true );
setWindowTitle( tr( "TIT_BAR_PREF" ) );
QString propertyName = QString( "scalar_bar_vertical_" );
- myTitleWidth = myTitleHeight = myLabelWidth = myLabelHeight = myBarWidth = myBarHeight = 0;
+ myTitleSize = myLabelSize = myBarWidth = myBarHeight = 0;
myUnits = true;
- myUnitsFormat = "%-#6.3g";
+ myPrecision = 3;
- QVBoxLayout* TopLayout = new QVBoxLayout( this );
- TopLayout->setSpacing( 6 );
- TopLayout->setMargin( 11 );
+ QVBoxLayout* aMainLay = new QVBoxLayout( this );
+ aMainLay->setSpacing( 5 );
+ aMainLay->setMargin( 5 );
+
+ // dimensions
+
+ QGroupBox* aDimGrp = new QGroupBox( this );
+ QGridLayout* aDimGrpLay = new QGridLayout( aDimGrp );
+ aDimGrpLay->setSpacing( 5 );
+ aDimGrpLay->setMargin( 5 );
+
+ myTitleSizeSpin = new QSpinBox( aDimGrp );
+ myTitleSizeSpin->setRange( 0, 100 );
+ myTitleSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myTitleSizeSpin->setMinimumWidth( 70 );
+ myTitleSizeSpin->setValue( 0 );
+ myTitleSizeSpin->setSpecialValueText( tr( "AUTO" ) );
+ QLabel* aTitleSizeLbl = new QLabel( tr( "LBL_TITLE_W" ), aDimGrp );
+
+ myLabelSizeSpin = new QSpinBox( aDimGrp );
+ myLabelSizeSpin->setRange( 0, 100 );
+ myLabelSizeSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myLabelSizeSpin->setMinimumWidth( 70 );
+ myLabelSizeSpin->setValue( 0 );
+ myLabelSizeSpin->setSpecialValueText( tr( "AUTO" ) );
+ QLabel* aLabelSizeLbl = new QLabel( tr( "LBL_LABEL_W" ), aDimGrp );
+
+ myBarWidthSpin = new QSpinBox( aDimGrp );
+ myBarWidthSpin->setRange( 0, 100 );
+ myBarWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myBarWidthSpin->setMinimumWidth( 70 );
+ myBarWidthSpin->setValue( 0 );
+ myBarWidthSpin->setSpecialValueText( tr( "AUTO" ) );
+ QLabel* aBarWidthLbl = new QLabel( tr( "LBL_BAR_W" ), aDimGrp );
+
+ myBarHeightSpin = new QSpinBox( aDimGrp );
+ myBarHeightSpin->setRange( 0, 100 );
+ myBarHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ myBarHeightSpin->setMinimumWidth( 70 );
+ myBarHeightSpin->setValue( 0 );
+ myBarHeightSpin->setSpecialValueText( tr( "AUTO" ) );
+ QLabel* aBarHeightLbl = new QLabel( tr( "LBL_BAR_H" ), aDimGrp );
+
+ // format and units
+
+ QLabel* aPrecLbl = new QLabel( tr( "PRECISION" ), aDimGrp );
+ myPrecisionSpin = new QSpinBox( aDimGrp );
+ myPrecisionSpin->setRange( 1, 100 );
+
+ myUnitsChk = new QCheckBox( tr( "LBL_SHOW_UNITS" ), aDimGrp );
+
+ // layout
+
+ aDimGrpLay->addWidget( aTitleSizeLbl, 0, 0 );
+ aDimGrpLay->addWidget( myTitleSizeSpin, 0, 1 );
+ aDimGrpLay->addWidget( aLabelSizeLbl, 0, 2 );
+ aDimGrpLay->addWidget( myLabelSizeSpin, 0, 3 );
+ aDimGrpLay->addWidget( aBarWidthLbl, 1, 0 );
+ aDimGrpLay->addWidget( myBarWidthSpin, 1, 1 );
+ aDimGrpLay->addWidget( aBarHeightLbl, 1, 2 );
+ aDimGrpLay->addWidget( myBarHeightSpin, 1, 3 );
+ aDimGrpLay->addWidget( aPrecLbl, 2, 0 );
+ aDimGrpLay->addWidget( myPrecisionSpin, 2, 1 );
+ aDimGrpLay->addWidget( myUnitsChk, 2, 2, 1, 2 );
- QGroupBox* WidthHeightGroup = new QGroupBox ( this );
- QGridLayout* WidthHeightGroupLayout = new QGridLayout( WidthHeightGroup );
- WidthHeightGroupLayout->setAlignment( Qt::AlignTop );
- WidthHeightGroupLayout->setSpacing( 6 );
- WidthHeightGroupLayout->setMargin( 11 );
-
- TitleWidthSpin = new QSpinBox( WidthHeightGroup );
- TitleWidthSpin->setRange( 0, 100 );
- TitleWidthSpin->setSingleStep( 1 );
- TitleWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- TitleWidthSpin->setMinimumWidth( 70 );
- TitleWidthSpin->setValue( 0 );
- TitleWidthSpin->setSpecialValueText( tr( "AUTO" ) );
- QLabel* LabelTitleWidth = new QLabel( tr( "LBL_TITLE_W" ), WidthHeightGroup );
- LabelTitleWidth->setBuddy( TitleWidthSpin );
-
- TitleHeightSpin = new QSpinBox( WidthHeightGroup );
- TitleHeightSpin->setRange( 0, 100 );
- TitleHeightSpin->setSingleStep( 1 );
- TitleHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- TitleHeightSpin->setMinimumWidth( 70 );
- TitleHeightSpin->setValue( 0 );
- TitleHeightSpin->setSpecialValueText( tr( "AUTO" ) );
- QLabel* LabelTitleHeight = new QLabel( tr( "LBL_TITLE_H" ), WidthHeightGroup );
- LabelTitleHeight->setBuddy( TitleHeightSpin );
-
- CBUnits = new QCheckBox( tr( "LBL_SHOW_UNITS" ), WidthHeightGroup );
- CBUnits->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
-
- LabelWidthSpin = new QSpinBox( WidthHeightGroup );
- LabelWidthSpin->setRange( 0, 100 );
- LabelWidthSpin->setSingleStep( 1 );
- LabelWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- LabelWidthSpin->setMinimumWidth( 70 );
- LabelWidthSpin->setValue( 0 );
- LabelWidthSpin->setSpecialValueText( tr( "AUTO" ) );
- QLabel* LabelLabelWidth = new QLabel( tr( "LBL_LABEL_W" ), WidthHeightGroup );
- LabelLabelWidth->setBuddy( LabelWidthSpin );
-
- LabelHeightSpin = new QSpinBox( WidthHeightGroup );
- LabelHeightSpin->setRange( 0, 100 );
- LabelHeightSpin->setSingleStep( 1 );
- LabelHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- LabelHeightSpin->setMinimumWidth( 70 );
- LabelHeightSpin->setValue( 0 );
- LabelHeightSpin->setSpecialValueText( tr( "AUTO" ) );
- QLabel* LabelLabelHeight = new QLabel( tr( "LBL_LABEL_H" ), WidthHeightGroup );
- LabelLabelHeight->setBuddy( LabelHeightSpin );
-
- UnitsEdit = new QLineEdit( WidthHeightGroup );
- UnitsEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- UnitsEdit->setMinimumWidth( 35 );
- UnitsEdit->setText( myUnitsFormat );
- QLabel* UnitsLabel = new QLabel( tr( "LBL_UNITS_FORMAT" ), WidthHeightGroup );
- UnitsLabel->setBuddy( UnitsEdit );
-
- BarWidthSpin = new QSpinBox( WidthHeightGroup );
- BarWidthSpin->setRange( 0, 100 );
- BarWidthSpin->setSingleStep( 1 );
- BarWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- BarWidthSpin->setMinimumWidth( 70 );
- BarWidthSpin->setValue( 0 );
- BarWidthSpin->setSpecialValueText( tr( "AUTO" ) );
- QLabel* LabelBarWidth = new QLabel( tr( "LBL_BAR_W" ), WidthHeightGroup );
- LabelBarWidth->setBuddy( BarWidthSpin );
-
- BarHeightSpin = new QSpinBox( WidthHeightGroup );
- BarHeightSpin->setRange( 0, 100 );
- BarHeightSpin->setSingleStep( 1 );
- BarHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- BarHeightSpin->setMinimumWidth( 70 );
- BarHeightSpin->setValue( 0 );
- BarHeightSpin->setSpecialValueText( tr( "AUTO" ) );
- QLabel* LabelBarHeight = new QLabel( tr( "LBL_BAR_H" ), WidthHeightGroup );
- LabelBarHeight->setBuddy( BarHeightSpin );
-
- WidthHeightGroupLayout->addWidget( LabelTitleWidth, 0, 0 );
- WidthHeightGroupLayout->addWidget( TitleWidthSpin, 0, 1 );
- WidthHeightGroupLayout->addWidget( LabelTitleHeight, 0, 2 );
- WidthHeightGroupLayout->addWidget( TitleHeightSpin, 0, 3 );
- WidthHeightGroupLayout->addWidget( CBUnits, 0, 4, 1, 2 );
- WidthHeightGroupLayout->addWidget( LabelLabelWidth, 1, 0 );
- WidthHeightGroupLayout->addWidget( LabelWidthSpin, 1, 1 );
- WidthHeightGroupLayout->addWidget( LabelLabelHeight, 1, 2 );
- WidthHeightGroupLayout->addWidget( LabelHeightSpin, 1, 3 );
- WidthHeightGroupLayout->addWidget( UnitsLabel, 1, 4 );
- WidthHeightGroupLayout->addWidget( UnitsEdit, 1, 5 );
- WidthHeightGroupLayout->addWidget( LabelBarWidth, 2, 0 );
- WidthHeightGroupLayout->addWidget( BarWidthSpin, 2, 1 );
- WidthHeightGroupLayout->addWidget( LabelBarHeight, 2, 2 );
- WidthHeightGroupLayout->addWidget( BarHeightSpin, 2, 3 );
-
- TopLayout->addWidget( WidthHeightGroup );
+ aMainLay->addWidget( aDimGrp );
// Common buttons ===========================================================
+
QGroupBox* GroupButtons = new QGroupBox( this );
QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
GroupButtonsLayout->setAlignment( Qt::AlignTop );
GroupButtonsLayout->addWidget( buttonCancel );
GroupButtonsLayout->addWidget( buttonHelp );
- TopLayout->addWidget( GroupButtons );
+ aMainLay->addWidget( GroupButtons );
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
- connect( TitleWidthSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
- connect( TitleHeightSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
- connect( LabelWidthSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
- connect( LabelHeightSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
- connect( BarWidthSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
- connect( BarHeightSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
- connect( CBUnits, SIGNAL( toggled( bool ) ), this, SIGNAL( updatePreview() ) );
- connect( UnitsEdit, SIGNAL( editingFinished() ), this, SIGNAL( updatePreview() ) );
+ connect( myTitleSizeSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
+ connect( myLabelSizeSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
+ connect( myBarWidthSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
+ connect( myBarHeightSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
+ connect( myUnitsChk, SIGNAL( toggled( bool ) ), this, SIGNAL( updatePreview() ) );
+ connect( myPrecisionSpin, SIGNAL( valueChanged( int ) ), this, SIGNAL( updatePreview() ) );
}
//----------------------------------------------------------------------------
-void VisuGUI_BarPrefDlg::setRatios( int titleRatioWidth, int titleRatioHeight,
- int labelRatioWidth, int labelRatioHeight,
- int barRatioWidth, int barRatioHeight )
+void VisuGUI_BarPrefDlg::setRatios( int titleRatioSize, int labelRatioWidth,
+ int barRatioWidth, int barRatioHeight )
{
- TitleWidthSpin->setValue( myTitleWidth = titleRatioWidth );
- TitleHeightSpin->setValue( myTitleHeight = titleRatioHeight );
- LabelWidthSpin->setValue( myLabelWidth = labelRatioWidth );
- LabelHeightSpin->setValue( myLabelHeight = labelRatioHeight );
- BarWidthSpin->setValue( myBarWidth = barRatioWidth );
- BarHeightSpin->setValue( myBarHeight = barRatioHeight );
+ myTitleSizeSpin->setValue( myTitleSize = titleRatioSize );
+ myLabelSizeSpin->setValue( myLabelSize = labelRatioWidth );
+ myBarWidthSpin->setValue( myBarWidth = barRatioWidth );
+ myBarHeightSpin->setValue( myBarHeight = barRatioHeight );
}
//----------------------------------------------------------------------------
-void VisuGUI_BarPrefDlg::getRatios( int& titleRatioWidth, int& titleRatioHeight,
- int& labelRatioWidth, int& labelRatioHeight,
- int& barRatioWidth, int& barRatioHeight )
+void VisuGUI_BarPrefDlg::getRatios( int& titleRatioSize, int& labelRatioWidth,
+ int& barRatioWidth, int& barRatioHeight )
{
- titleRatioWidth = TitleWidthSpin->value();
- titleRatioHeight = TitleHeightSpin->value();
- labelRatioWidth = LabelWidthSpin->value();
- labelRatioHeight = LabelHeightSpin->value();
- barRatioWidth = BarWidthSpin->value();
- barRatioHeight = BarHeightSpin->value();
+ titleRatioSize = myTitleSizeSpin->value();
+ labelRatioWidth = myLabelSizeSpin->value();
+ barRatioWidth = myBarWidthSpin->value();
+ barRatioHeight = myBarHeightSpin->value();
}
//----------------------------------------------------------------------------
-void VisuGUI_BarPrefDlg::setLabelsFormat( const QString& format )
+void VisuGUI_BarPrefDlg::setLabelsPrecision( const int p )
{
- UnitsEdit->setText( myUnitsFormat = format );
+ myPrecisionSpin->setValue( p );
}
+//----------------------------------------------------------------------------
+int VisuGUI_BarPrefDlg::getLabelsPrecision() const
+{
+ return myPrecisionSpin->value();
+}
//----------------------------------------------------------------------------
-QString VisuGUI_BarPrefDlg::getLabelsFormat()
+void VisuGUI_BarPrefDlg::setOrientation( const int ori )
{
- return UnitsEdit->text();
+ myOrientation = ori;
}
+//----------------------------------------------------------------------------
+
+int VisuGUI_BarPrefDlg::getOrientation() const
+{
+ return myOrientation;
+}
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::onHelp()
//----------------------------------------------------------------------------
void VisuGUI_BarPrefDlg::setUnitsVisible(bool isVisible)
{
- CBUnits->setChecked( myUnits = isVisible );
+ myUnitsChk->setChecked( myUnits = isVisible );
}
//----------------------------------------------------------------------------
bool VisuGUI_BarPrefDlg::isUnitsVisible()
{
- return CBUnits->isChecked();
+ return myUnitsChk->isChecked();
}
*/
void VisuGUI_BarPrefDlg::reject()
{
- TitleWidthSpin->setValue( myTitleWidth );
- TitleHeightSpin->setValue( myTitleHeight );
- LabelWidthSpin->setValue( myLabelWidth );
- LabelHeightSpin->setValue( myLabelHeight );
- BarWidthSpin->setValue( myBarWidth );
- BarHeightSpin->setValue( myBarHeight );
- CBUnits->setChecked( myUnits );
- UnitsEdit->setText( myUnitsFormat );
+ myTitleSizeSpin->setValue( myTitleSize );
+ myLabelSizeSpin->setValue( myLabelSize );
+ myBarWidthSpin->setValue( myBarWidth );
+ myBarHeightSpin->setValue( myBarHeight );
+ myUnitsChk->setChecked( myUnits );
+ myPrecisionSpin->setValue( myPrecision );
QDialog::reject();
}
void VisuGUI_BarPrefDlg::accept()
{
QString dVal;
- dVal.sprintf( UnitsEdit->text().toLatin1().data(), 1.1 );
- if ( dVal.toDouble() == 0. ) {
- SUIT_MessageBox::warning( this, tr( "WRN_VISU" ), tr ( "MSG_LABEL_FORMAT" ) );
+ int aBWH = myOrientation == 1 ? myBarWidthSpin->value() : myBarHeightSpin->value();
+ if( ( myLabelSizeSpin->value()+ aBWH ) > 100 )
+ {
+ SUIT_MessageBox::warning( this, tr( "WRN_VISU" ), tr( "MSG_BIG_SCALE" ) );
+ return;
}
- else {
- if(
- (
- TitleWidthSpin->value()+
- LabelWidthSpin->value()+
- BarWidthSpin->value()
- > 100
- ) ||
- (
- TitleHeightSpin->value()+
- LabelHeightSpin->value()+
- BarHeightSpin->value()
- > 100
- )
- ) {
- SUIT_MessageBox::warning( this, tr( "WRN_VISU" ), tr( "MSG_BIG_SCALE" ) );
- }
- else {
- myTitleWidth = TitleWidthSpin->value();
- myTitleHeight = TitleHeightSpin->value();
- myLabelWidth = LabelWidthSpin->value();
- myLabelHeight = LabelHeightSpin->value();
- myBarWidth = BarWidthSpin->value();
- myBarHeight = BarHeightSpin->value();
- myUnits = CBUnits->isChecked();
- myUnitsFormat = UnitsEdit->text();
- QDialog::accept();
- }
+
+ if ( myTitleSizeSpin->value() > 100 )
+ {
+ SUIT_MessageBox::warning( this, tr( "WRN_VISU" ), tr( "MSG_BIG_SCALE_TLT" ) );
+ return;
}
+
+ myTitleSize = myTitleSizeSpin->value();
+ myLabelSize = myLabelSizeSpin->value();
+ myBarWidth = myBarWidthSpin->value();
+ myBarHeight = myBarHeightSpin->value();
+ myUnits = myUnitsChk->isChecked();
+ myPrecision = myPrecisionSpin->value();
+ QDialog::accept();
}
myVerY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
myVerW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.);
myVerH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.);
- myVerTW = aResourceMgr->integerValue("VISU", propertyName + "title_width", 0);
- myVerTH = aResourceMgr->integerValue("VISU", propertyName + "title_height",0);
- myVerLW = aResourceMgr->integerValue("VISU", propertyName + "label_width", 0);
- myVerLH = aResourceMgr->integerValue("VISU", propertyName + "label_height",0);
+ myVerTS = aResourceMgr->integerValue("VISU", propertyName + "title_size", 0);
+ myVerLS = aResourceMgr->integerValue("VISU", propertyName + "label_size", 0);
myVerBW = aResourceMgr->integerValue("VISU", propertyName + "bar_width", 0);
myVerBH = aResourceMgr->integerValue("VISU", propertyName + "bar_height",0);
myHorY = aResourceMgr->doubleValue("VISU", propertyName + "y", 0.);
myHorW = aResourceMgr->doubleValue("VISU", propertyName + "width", 0.);
myHorH = aResourceMgr->doubleValue("VISU", propertyName + "height",0.);
- myHorTW = aResourceMgr->integerValue("VISU", propertyName + "title_width", 0);
- myHorTH = aResourceMgr->integerValue("VISU", propertyName + "title_height",0);
- myHorLW = aResourceMgr->integerValue("VISU", propertyName + "label_width", 0);
- myHorLH = aResourceMgr->integerValue("VISU", propertyName + "label_height",0);
+ myHorTS = aResourceMgr->integerValue("VISU", propertyName + "title_size", 0);
+ myHorLS = aResourceMgr->integerValue("VISU", propertyName + "label_size", 0);
myHorBW = aResourceMgr->integerValue("VISU", propertyName + "bar_width", 0);
myHorBH = aResourceMgr->integerValue("VISU", propertyName + "bar_height",0);
- aMainLayout->setSpacing(6);
- //setMargin(11);
+ //aMainLayout->setSpacing(6);
// Range ============================================================
RangeGroup = new QButtonGroup ( this );
QGroupBox* aGB = new QGroupBox( tr("SCALAR_RANGE_GRP"),this );
aMainLayout->addWidget( aGB );
- //RangeGroup->setColumnLayout(0, Qt::Vertical );
- //RangeGroup->layout()->setSpacing( 0 );
- //RangeGroup->layout()->setMargin( 0 );
QGridLayout* RangeGroupLayout = new QGridLayout( aGB );
RangeGroupLayout->setAlignment( Qt::AlignTop );
- RangeGroupLayout->setSpacing( 6 );
- RangeGroupLayout->setMargin( 11 );
+ //RangeGroupLayout->setSpacing( 6 );
+ //RangeGroupLayout->setMargin( 11 );
myModeLbl = new QLabel("Scalar Mode", aGB);
MinEdit = new QLineEdit( aGB );
MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- MinEdit->setMinimumWidth( 70 );
+ //MinEdit->setMinimumWidth( 70 );
MinEdit->setValidator( new QDoubleValidator(this) );
MinEdit->setText( "0.0" );
QLabel* MinLabel = new QLabel (tr("LBL_MIN"), aGB);
+ MinLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
MinLabel->setBuddy(MinEdit);
MaxEdit = new QLineEdit( aGB );
MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- MaxEdit->setMinimumWidth( 70 );
+ //MaxEdit->setMinimumWidth( 70 );
MaxEdit->setValidator( new QDoubleValidator(this) );
MaxEdit->setText( "0.0" );
QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), aGB);
+ MaxLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
MaxLabel->setBuddy(MaxEdit);
- RangeGroupLayout->addWidget( myModeLbl, 0, 0 );
- RangeGroupLayout->addWidget( myModeCombo, 0, 1, 1, 4);
- RangeGroupLayout->addWidget( CBLog, 1, 0, 1, 4);
- RangeGroupLayout->addWidget( RBFrange, 2, 0, 1, 2);
- RangeGroupLayout->addWidget( RBIrange, 2, 2, 1, 2);
- RangeGroupLayout->addWidget( MinLabel, 3, 0 );
- RangeGroupLayout->addWidget( MinEdit, 3, 1 );
- RangeGroupLayout->addWidget( MaxLabel, 3, 2 );
- RangeGroupLayout->addWidget( MaxEdit, 3, 3 );
-
- //TopLayout->addWidget( RangeGroup );
+ RangeGroupLayout->addWidget( myModeLbl, 0, 0, 1, 1 );
+ RangeGroupLayout->addWidget( myModeCombo, 0, 1, 1, 2);
+ RangeGroupLayout->addWidget( CBLog, 0, 3, 1, 1);
+ RangeGroupLayout->addWidget( RBFrange, 1, 0, 1, 2);
+ RangeGroupLayout->addWidget( RBIrange, 1, 2, 1, 2);
+ RangeGroupLayout->addWidget( MinLabel, 2, 0 );
+ RangeGroupLayout->addWidget( MinEdit, 2, 1 );
+ RangeGroupLayout->addWidget( MaxLabel, 2, 2 );
+ RangeGroupLayout->addWidget( MaxEdit, 2, 3 );
// Colors and Labels ========================================================
QGroupBox* ColLabGroup = new QGroupBox (tr("COLORS_LABELS_GRP"), this);
aMainLayout->addWidget( ColLabGroup );
- //ColLabGroup->setColumnLayout(0, Qt::Vertical );
- //ColLabGroup->layout()->setSpacing( 0 );
- //ColLabGroup->layout()->setMargin( 0 );
QGridLayout* ColLabGroupLayout = new QGridLayout( ColLabGroup );
ColLabGroupLayout->setAlignment( Qt::AlignTop );
- ColLabGroupLayout->setSpacing( 6 );
- ColLabGroupLayout->setMargin( 11 );
+ //ColLabGroupLayout->setSpacing( 6 );
+ //ColLabGroupLayout->setMargin( 11 );
QLabel* ColorLabel = new QLabel (tr("LBL_NB_COLORS"), ColLabGroup);
ColorSpin = new QSpinBox( ColLabGroup );
ColorSpin->setMaximum( 256 );
ColorSpin->setSingleStep( 1 );
ColorSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- ColorSpin->setMinimumWidth( 70 );
+ //ColorSpin->setMinimumWidth( 70 );
ColorSpin->setValue( 64 );
QLabel* LabelLabel = new QLabel (tr("LBL_NB_LABELS"), ColLabGroup);
LabelSpin->setSingleStep( 1 );
LabelSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- LabelSpin->setMinimumWidth( 70 );
+ //LabelSpin->setMinimumWidth( 70 );
LabelSpin->setValue( 5 );
ColLabGroupLayout->addWidget( ColorLabel, 0, 0);
ColLabGroupLayout->addWidget( LabelLabel, 0, 2);
ColLabGroupLayout->addWidget( LabelSpin, 0, 3);
- //TopLayout->addWidget( ColLabGroup );
-
// Orientation ==========================================================
QButtonGroup* OrientGroup = new QButtonGroup ( this );
QGroupBox* OrientGB = new QGroupBox( tr("ORIENTATION_GRP"),this );
aMainLayout->addWidget( OrientGB );
- //OrientGroup->setColumnLayout(0, Qt::Vertical );
- //OrientGroup->layout()->setSpacing( 0 );
- //OrientGroup->layout()->setMargin( 0 );
QGridLayout* OrientGroupLayout = new QGridLayout( OrientGB );
OrientGroupLayout->setAlignment( Qt::AlignTop );
- OrientGroupLayout->setSpacing( 6 );
- OrientGroupLayout->setMargin( 11 );
+ //OrientGroupLayout->setSpacing( 6 );
+ //OrientGroupLayout->setMargin( 11 );
RBvert = new QRadioButton (tr("VERTICAL_BTN"), OrientGB);
RBvert->setChecked( true );
OrientGroupLayout->addWidget( RBvert, 0, 0 );
OrientGroupLayout->addWidget( RBhori, 0, 1 );
- // TopLayout->addWidget( OrientGroup );
-
// Origin ===============================================================
QGroupBox* OriginGroup = new QGroupBox (tr("ORIGIN_GRP"), this);
aMainLayout->addWidget( OriginGroup );
- //OriginGroup->setColumnLayout(0, Qt::Vertical );
- //OriginGroup->layout()->setSpacing( 0 );
- // OriginGroup->layout()->setMargin( 0 );
QGridLayout* OriginGroupLayout = new QGridLayout( OriginGroup );
OriginGroupLayout->setAlignment( Qt::AlignTop );
- OriginGroupLayout->setSpacing( 6 );
- OriginGroupLayout->setMargin( 11 );
+ //OriginGroupLayout->setSpacing( 6 );
+ //OriginGroupLayout->setMargin( 11 );
QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup);
XSpin = new QtxDoubleSpinBox( OriginGroup );
VISU::initSpinBox(XSpin, 0.0, +1.0);
XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- XSpin->setMinimumWidth( 70 );
+ //XSpin->setMinimumWidth( 70 );
XSpin->setValue( 0.01 );
QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup);
YSpin = new QtxDoubleSpinBox( OriginGroup );
VISU::initSpinBox(YSpin, 0.0, +1.0);
YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- YSpin->setMinimumWidth( 70 );
- YSpin->setValue( 0.01 );
+ //YSpin->setMinimumWidth( 70 );
+ YSpin->setValue( 0.1 );
OriginGroupLayout->addWidget( XLabel, 0, 0);
OriginGroupLayout->addWidget( XSpin, 0, 1);
OriginGroupLayout->addWidget( YLabel, 0, 2);
OriginGroupLayout->addWidget( YSpin, 0, 3);
- //TopLayout->addWidget( OriginGroup );
-
// Dimensions =========================================================
QGroupBox* DimGroup = new QGroupBox (tr("DIMENSIONS_GRP"), this );
aMainLayout->addWidget( DimGroup );
- //DimGroup->setColumnLayout(0, Qt::Vertical );
- //DimGroup->layout()->setSpacing( 0 );
- //DimGroup->layout()->setMargin( 0 );
QGridLayout* DimGroupLayout = new QGridLayout( DimGroup );
DimGroupLayout->setAlignment( Qt::AlignTop );
- DimGroupLayout->setSpacing( 6 );
- DimGroupLayout->setMargin( 11 );
+ //DimGroupLayout->setSpacing( 6 );
+ //DimGroupLayout->setMargin( 11 );
QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup);
WidthSpin = new QtxDoubleSpinBox( DimGroup );
VISU::initSpinBox(WidthSpin, 0.0, +1.0);
WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- WidthSpin->setMinimumWidth( 70 );
+ //WidthSpin->setMinimumWidth( 70 );
WidthSpin->setValue( 0.1 );
QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup);
HeightSpin = new QtxDoubleSpinBox( DimGroup );
VISU::initSpinBox(HeightSpin, 0.0, +1.0);
HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- HeightSpin->setMinimumWidth( 70 );
+ //HeightSpin->setMinimumWidth( 70 );
HeightSpin->setValue( 0.8 );
DimGroupLayout->addWidget( WidthLabel, 0, 0);
DimGroupLayout->addWidget( HeightLabel, 0, 2);
DimGroupLayout->addWidget( HeightSpin, 0, 3);
- //TopLayout->addWidget( DimGroup );
-
// Save check box ===========================================================
QWidget* aSaveBox = new QWidget(this);
aMainLayout->addWidget( aSaveBox );
- QVBoxLayout* aVBLay = new QVBoxLayout( aSaveBox );
- if (!thePreview) {
- CBSave = new QCheckBox (tr("SAVE_DEFAULT_CHK"), aSaveBox);
- aVBLay->addWidget( CBSave );
- }
- else {
- CBSave = 0;
- }
+ QHBoxLayout* aVBLay = new QHBoxLayout( aSaveBox );
aVBLay->addWidget( myTextBtn = new QPushButton("Text properties...", aSaveBox) );
aVBLay->addWidget( myBarBtn = new QPushButton("Bar properties...", aSaveBox) );
QGroupBox* CheckGroup = new QGroupBox("", this );
aMainLayout->addWidget( CheckGroup );
+ //QHBoxLayout* CheckGroupLayout = new QHBoxLayout( CheckGroup );
QGridLayout* CheckGroupLayout = new QGridLayout( CheckGroup );
myPreviewCheck = new QCheckBox(tr("LBL_SHOW_PREVIEW"), CheckGroup);
myPreviewCheck->setChecked(false);
- CheckGroupLayout->addWidget(myPreviewCheck , 0, 0 );
-
- if ( thePreview ) {
+ CheckGroupLayout->addWidget(myPreviewCheck, 0, 0);
+
+ myHideBar = new QCheckBox(tr("HIDE_SCALAR_BAR"), CheckGroup);
+ myHideBar->setChecked(false);
+ CheckGroupLayout->addWidget(myHideBar, 0, 1);
+
+// RKV : Begin
+ CBDistr = new QCheckBox (tr("SHOW_DISTRIBUTION"), CheckGroup);
+ CheckGroupLayout->addWidget(CBDistr, 1, 0);
+// RKV : End
+ if (!thePreview) {
+ CBSave = new QCheckBox (tr("SAVE_DEFAULT_CHK"), CheckGroup);
+ CheckGroupLayout->addWidget( CBSave, 1, 1 );
+ }
+ else {
+ CBSave = 0;
myPreviewCheck->hide();
CheckGroup->hide();
}
if(RBvert->isChecked()) {
- myBarDlg->setRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH);
+ myBarDlg->setRatios(myVerTS, myVerLS, myVerBW, myVerBH);
} else {
- myBarDlg->setRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH);
+ myBarDlg->setRatios(myHorTS, myHorLS, myHorBW, myHorBH);
}
- myBarDlg->setLabelsFormat(aResourceMgr->stringValue("VISU", propertyName + "label_format", "%-#6.3g"));
+ int lp = aResourceMgr->integerValue( "VISU", propertyName + "scalar_bar_label_precision", 3 );
+ myBarDlg->setLabelsPrecision( lp );
+
myBarDlg->setUnitsVisible(aResourceMgr->booleanValue("VISU", propertyName + "display_units", true));
// signals and slots connections ===========================================
- // connect( RangeGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( changeRange( int ) ) );
connect( RBFrange, SIGNAL( toggled( bool ) ), this, SLOT( onFieldRange( bool ) ) );
connect( RBIrange, SIGNAL( toggled( bool ) ), this, SLOT( onImposedRange( bool ) ) );
connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) );
connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) );
connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) );
+
+ connect( CBDistr, SIGNAL( toggled( bool ) ), this, SLOT( onShowDistribution( bool ) )); // RKV
+
connect( ColorSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( LabelSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() ));
connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() ));
if(orient == 0) {
sbX1=0.01;
sbY1=0.1;
- sbW=0.17;
+ sbW=0.1;
sbH=0.8;
} else {
- sbX1=0.2;
+ sbX1=0.1;
sbY1=0.01;
- sbW=0.6;
- sbH=0.12;
+ sbW=0.8;
+ sbH=0.08;
}
}
aResourceMgr->setValue("VISU", "scalar_range_type", 0);
aResourceMgr->setValue("VISU", "scalar_bar_logarithmic", isLogarithmic());
+ aResourceMgr->setValue("VISU", "scalar_bar_show_distribution", isShowDistribution()); // RKV
////
aTitleFont.setBold(isTitleBold);
aTitleFont.setItalic(isTitleItalic);
- aTitleFont.setUnderline(isTitleShadow);
+ aTitleFont.setOverline(isTitleShadow);
QString titleFontFamily;
switch (aTitleFontFamily) {
aLabelFont.setBold(isLabelBold);
aLabelFont.setItalic(isLabelItalic);
- aLabelFont.setUnderline(isLabelShadow);
+ aLabelFont.setOverline(isLabelShadow);
QString labelFontFamily;
switch (aLabelFontFamily) {
setRange( myScalarMap->GetMin(), myScalarMap->GetMax(), myScalarMap->IsRangeFixed() );
setScalarBarData( myScalarMap->GetNbColors(), myScalarMap->GetLabels() );
+ setShowDistribution( myScalarMap->GetIsDistributionVisible() );
// "Title"
CORBA::String_var aTitle = myScalarMap->GetTitle();
myScalarMap->GetBarOrientation());
if(RBvert->isChecked()) {
- myVerTW = myScalarMap->GetTitleWidth();
- myVerTH = myScalarMap->GetTitleHeight();
- myVerLW = myScalarMap->GetLabelWidth();
- myVerLH = myScalarMap->GetLabelHeight();
+ myVerTS = myScalarMap->GetTitleSize();
+ myVerLS = myScalarMap->GetLabelSize();
myVerBW = myScalarMap->GetBarWidth();
myVerBH = myScalarMap->GetBarHeight();
- myBarDlg->setRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH);
+ myBarDlg->setRatios(myVerTS, myVerLS, myVerBW, myVerBH);
} else {
- myHorTW = myScalarMap->GetTitleWidth();
- myHorTH = myScalarMap->GetTitleHeight();
- myHorLW = myScalarMap->GetLabelWidth();
- myHorLH = myScalarMap->GetLabelHeight();
+ myHorTS = myScalarMap->GetTitleSize();
+ myHorLS = myScalarMap->GetLabelSize();
myHorBW = myScalarMap->GetBarWidth();
myHorBH = myScalarMap->GetBarHeight();
- myBarDlg->setRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH);
+ myBarDlg->setRatios(myHorTS, myHorLS, myHorBW, myHorBH);
}
- myBarDlg->setLabelsFormat(myScalarMap->GetLabelsFormat());
+ myBarDlg->setLabelsPrecision( VISU::ToPrecision( myScalarMap->GetLabelsFormat() ) );
myBarDlg->setUnitsVisible(myScalarMap->IsUnitsVisible());
vtkFloatingPointType R, G, B;
myScalarMap->IsItalicLabel(),
myScalarMap->IsShadowLabel());
+ myHideBar->setChecked(!myScalarMap->IsBarVisible());
+
// Draw Preview
if (myPreviewCheck->isChecked()) {
createScalarBar();
VISU_ScalarBarActor* aScalarBarActor = myPreviewActor->GetScalarBar();
myPreviewActor->GetScalarBar()->VisibilityOn();
myPreviewActor->PickableOff();
+ //myPreviewActor->SetBarVisibility(!myHideBar->isChecked());
myScalarMapPL->SetScalarMode(myModeCombo->currentIndex());
if(isLogarithmic())
myScalarMapPL->SetScaling(VISU::LOGARITHMIC);
else
myScalarMapPL->SetScaling(VISU::LINEAR);
- vtkFloatingPointType theRange[2];
- if(RBFrange->isChecked()) {
- theRange[0] = myScalarMap->GetSourceMin();
- theRange[1] = myScalarMap->GetSourceMax();
+
+ if ( RBFrange->isChecked() ) {
+ myScalarMapPL->SetSourceRange();
} else {
- theRange[0] = (vtkFloatingPointType)MinEdit->text().toDouble();
- theRange[1] = (vtkFloatingPointType)MaxEdit->text().toDouble();
+ vtkFloatingPointType aRange[2];
+ aRange[0] = (vtkFloatingPointType)MinEdit->text().toDouble();
+ aRange[1] = (vtkFloatingPointType)MaxEdit->text().toDouble();
+ myScalarMapPL->SetScalarRange( aRange );
}
- myScalarMapPL->SetScalarRange(theRange);
- myScalarMapPL->SetNbColors(sbCol);
-
+
+ myScalarMapPL->SetNbColors(sbCol);
myScalarMapPL->Update();
aScalarBarActor->SetLookupTable(myScalarMapPL->GetBarTable());
+ aScalarBarActor->SetDistribution( myScalarMapPL->GetDistribution() );
+ aScalarBarActor->SetDistributionVisibility( isShowDistribution() );
if (!myTextDlg->getTitleText().isEmpty()) {
VISU::PValForTime aValForTime;
(isLabelItalic)? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
(isLabelShadow)? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
- int VerTW, VerTH, VerLW, VerLH, VerBW, VerBH;
- myBarDlg->getRatios(VerTW, VerTH, VerLW, VerLH, VerBW, VerBH);
- aScalarBarActor->SetRatios(VerTW, VerTH, VerLW, VerLH, VerBW, VerBH);
+ int VerTS, VerTH, VerLS, VerBW, VerBH;
+ myBarDlg->getRatios(VerTS, VerLS, VerBW, VerBH);
+ aScalarBarActor->SetRatios(VerTS, VerLS, VerBW, VerBH);
- aScalarBarActor->SetLabelFormat(myBarDlg->getLabelsFormat().toLatin1().data());
+ std::string f = VISU::ToFormat( myBarDlg->getLabelsPrecision() );
+ aScalarBarActor->SetLabelFormat( f.c_str() );
aScalarBarActor->Modified();
myScalarMap->SetPosition(XSpin->value(), YSpin->value());
myScalarMap->SetSize(WidthSpin->value(), HeightSpin->value());
if(RBvert->isChecked()) {
- myScalarMap->SetRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH);
+ myScalarMap->SetRatios(myVerTS, myVerLS, myVerBW, myVerBH);
} else {
- myScalarMap->SetRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH);
+ myScalarMap->SetRatios(myHorTS, myHorLS, myHorBW, myHorBH);
}
- myScalarMap->SetLabelsFormat(myBarDlg->getLabelsFormat().toLatin1().data());
+ std::string f = VISU::ToFormat( myBarDlg->getLabelsPrecision() );
+ myScalarMap->SetLabelsFormat( f.c_str() );
myScalarMap->SetUnitsVisible(myBarDlg->isUnitsVisible());
myScalarMap->SetBarOrientation((RBvert->isChecked())? VISU::ColoredPrs3dBase::VERTICAL : VISU::ColoredPrs3dBase::HORIZONTAL);
else
myScalarMap->SetScaling(VISU::LINEAR);
- if (RBFrange->isChecked()) {
+ if ( RBFrange->isChecked() ) {
myScalarMap->SetSourceRange();
} else {
- myScalarMap->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
+ myScalarMap->SetRange( MinEdit->text().toDouble(), MaxEdit->text().toDouble() );
}
myScalarMap->SetNbColors(ColorSpin->value());
myScalarMap->SetLabels(LabelSpin->value());
+ myScalarMap->SetIsDistributionVisible(isShowDistribution()); // RKV
+
+ myScalarMap->SetBarVisible(!myHideBar->isChecked());
if (isToSave()) storeToResources();
void VisuGUI_ScalarBarPane::onImposedRange( bool isOn )
{
if (isOn) {
- myScalarMap->SetRange(myScalarMap->GetMin(), myScalarMap->GetMax());
+ myScalarMap->SetRange( myScalarMap->GetMin(), myScalarMap->GetMax() );
MinEdit->setEnabled( true );
MaxEdit->setEnabled( true );
changeScalarMode(myModeCombo->currentIndex());
}
}
+void VisuGUI_ScalarBarPane::onShowDistribution( bool isOn )
+{
+ myScalarMap->SetIsDistributionVisible(isOn);
+ updatePreview();
+}
+
void VisuGUI_ScalarBarPane::changeRange( int )
{
if ( RBFrange->isChecked() ) {
MinEdit->setEnabled( false );
MaxEdit->setEnabled( false );
} else {
- myScalarMap->SetRange(myScalarMap->GetMin(), myScalarMap->GetMax());
+ myScalarMap->SetRange( myScalarMap->GetMin(), myScalarMap->GetMax() );
MinEdit->setEnabled( true );
MaxEdit->setEnabled( true );
}
CBLog->setChecked( on );
}
+//----------------------------------------------------------------------------
+bool VisuGUI_ScalarBarPane::isShowDistribution() {
+ return CBDistr->isChecked();
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_ScalarBarPane::setShowDistribution( bool on ) {
+ CBDistr->setChecked( on );
+}
+
+// RKV : End
//----------------------------------------------------------------------------
bool VisuGUI_ScalarBarPane::isToSave() {
return CBSave ? CBSave->isChecked() : false;
void VisuGUI_ScalarBarPane::onBarPref()
{
if(RBvert->isChecked())
- myBarDlg->setRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH);
+ myBarDlg->setRatios(myVerTS, myVerLS, myVerBW, myVerBH);
else
- myBarDlg->setRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH);
+ myBarDlg->setRatios(myHorTS, myHorLS, myHorBW, myHorBH);
+ myBarDlg->setOrientation( getOrientation() );
if(myBarDlg->exec()) {
if(RBvert->isChecked())
- myBarDlg->getRatios(myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH);
+ myBarDlg->getRatios(myVerTS, myVerLS, myVerBW, myVerBH);
else
- myBarDlg->getRatios(myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH);
+ myBarDlg->getRatios(myHorTS, myHorLS, myHorBW, myHorBH);
updatePreview();
}
}
VisuGUI_BarPrefDlg (QWidget* parent);
~VisuGUI_BarPrefDlg() {};
- void setRatios(int titleRatioWidth, int titleRatioHeight,
- int labelRatioWidth, int labelRatioHeight,
+ void setRatios(int titleRatioSize, int labelRatioWidth,
int barRatioWidth, int barRatioHeight);
- void getRatios(int& titleRatioWidth, int& titleRatioHeight,
- int& labelRatioWidth, int& labelRatioHeight,
+ void getRatios(int& titleRatioSize, int& labelRatioWidth,
int& barRatioWidth, int& barRatioHeight);
void setUnitsVisible(bool isVisible);
bool isUnitsVisible();
- void setLabelsFormat( const QString& format);
- QString getLabelsFormat();
+ void setLabelsPrecision( const int p );
+ int getLabelsPrecision() const;
+
+ void setOrientation( const int ori );
+ int getOrientation() const;
+
private:
void keyPressEvent( QKeyEvent* e );
void onHelp();
protected:
- QSpinBox* TitleWidthSpin;
- QSpinBox* TitleHeightSpin;
- QSpinBox* LabelWidthSpin;
- QSpinBox* LabelHeightSpin;
- QSpinBox* BarWidthSpin;
- QSpinBox* BarHeightSpin;
- QCheckBox* CBUnits;
- QLineEdit* UnitsEdit;
-
- int myTitleWidth;
- int myTitleHeight;
- int myLabelWidth;
- int myLabelHeight;
+ QSpinBox* myTitleSizeSpin;
+ QSpinBox* myLabelSizeSpin;
+ QSpinBox* myBarWidthSpin;
+ QSpinBox* myBarHeightSpin;
+ QCheckBox* myUnitsChk;
+ QSpinBox* myPrecisionSpin;
+
+ int myTitleSize;
+ int myLabelSize;
int myBarWidth;
int myBarHeight;
bool myUnits;
- QString myUnitsFormat;
+ int myPrecision;
+ int myOrientation;
};
int getNbLabels();
bool isLogarithmic();
void setLogarithmic( bool on );
+ bool isShowDistribution();
+ void setShowDistribution( bool on );
bool isToSave();
void storeToResources();
QCheckBox* CBSave;
QCheckBox* CBLog;
+ QCheckBox* CBDistr;
+ QCheckBox* myHideBar;
+
QLabel* myModeLbl;
QComboBox* myModeCombo;
QPushButton* myTextBtn;
double myHorX, myHorY, myHorW, myHorH;
double myVerX, myVerY, myVerW, myVerH;
- int myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH;
- int myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH;
+ int myHorTS, myHorLS, myHorBW, myHorBH;
+ int myVerTS, myVerTH, myVerLS, myVerBW, myVerBH;
bool myIsStoreTextProp;
private slots:
void onTextPref();
void onBarPref();
void onPreviewCheck(bool thePreview);
- void updatePreview();
+ void updatePreview();
+ void onShowDistribution(bool);
private:
void createScalarBar();
//---------------------------------------------------------------
template<class TPrs3d_i, class TViewer, class TDlg, int IsDlgModal>
- void
+ TPrs3d_i*
CreatePrs3dInViewer(VisuGUI* theModule,
_PTR(SObject) theTimeStampSObj,
ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
{
+ TPrs3d_i* aPrs = 0;
// Create new TViewWindow instance, if it does not exist.
typedef typename TViewer::TViewWindow TViewWindow;
if (!GetViewWindow<TViewer>(theModule))
- return;
+ return aPrs;
- CreateAndEditPrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>
- (theModule,theTimeStampSObj,thePublishInStudyMode);
+ aPrs = CreateAndEditPrs3d<TPrs3d_i,TViewer,TDlg,IsDlgModal>
+ (theModule,theTimeStampSObj,thePublishInStudyMode);
theModule->application()->putInfo(QObject::tr("INF_DONE"));
+ return aPrs;
}
//----------------------------------------------------------------------------
template<class TPrs3d_i, class TDlg, int IsDlgModal>
- void
+ TPrs3d_i*
CreatePrs3d(VisuGUI* theModule,
const QString& theDesiredViewerType = QString())
{
+ TPrs3d_i* aPrs = 0;
if (CheckLock(GetCStudy(GetAppStudy(theModule)),GetDesktop(theModule)))
- return;
+ return aPrs;
_PTR(SObject) aTimeStampSObj;
Handle(SALOME_InteractiveObject) anIO;
ColoredPrs3d_i::EPublishInStudyMode aPublishInStudyMode;
if (!CheckTimeStamp(theModule,aTimeStampSObj,anIO,aPublishInStudyMode))
- return;
-
- if(aPublishInStudyMode == VISU::ColoredPrs3d_i::EPublishIndependently){
- CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,0>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- return;
+ return aPrs;
+
+ if(/*aPublishInStudyMode == */VISU::ColoredPrs3d_i::EPublishIndependently){
+ // CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,0>
+ // (theModule,aTimeStampSObj,aPublishInStudyMode);
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,0>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ return aPrs;
}else{
if(theDesiredViewerType.isNull()){
- if (SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager())
- if (aViewManager->getType() == VVTK_Viewer::Type()){
- CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- return;
- }
- CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
+ if (/*SUIT_ViewManager* aViewManager = */theModule->getApp()->activeViewManager())
+ /*if (aViewManager->getType() == VVTK_Viewer::Type()){
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ return aPrs;
+ }*/
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
}else{
- if(theDesiredViewerType == VVTK_Viewer::Type())
- CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
- else
- CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
- (theModule,aTimeStampSObj,aPublishInStudyMode);
+ /*if(theDesiredViewerType == VVTK_Viewer::Type()) {
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,VVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ } else {*/
+ aPrs = CreatePrs3dInViewer<TPrs3d_i,SVTK_Viewer,TDlg,IsDlgModal>
+ (theModule,aTimeStampSObj,aPublishInStudyMode);
+ //}
}
}
+ return aPrs;
}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#include "VisuGUI_ScalarMapOnDeformedShapeDlg.h"
+
+#include "VisuGUI_Tools.h"
+#include "VisuGUI_InputPane.h"
+
+#include "VISU_Result_i.hh"
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
+
+#include "VISU_ScalarMapPL.hxx"
+#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+
+#include "VISU_Convertor.hxx"
+
+#include "SalomeApp_Module.h"
+#include "LightApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_ResourceMgr.h"
+#include "SUIT_Session.h"
+#include "SUIT_MessageBox.h"
+
+#include "SALOME_ListIO.hxx"
+
+#include "SALOMEDSClient_AttributeString.hxx"
+#include "SALOMEDSClient_AttributeName.hxx"
+
+#include <qlayout.h>
+#include <qtabwidget.h>
+
+using namespace std;
+
+#define MYDEBUG 0
+
+/*!
+ * Constructor
+ */
+VisuGUI_ScalarMapOnDeformedShapeDlg::VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule)
+ : VisuGUI_ScalarBarBaseDlg(theModule),
+ myIsAnimation(false),
+ myUpdateScalars(true),
+ myVisuGUI(theModule)
+{
+ setCaption(tr("DLG_TITLE"));
+ setSizeGripEnabled(TRUE);
+
+ QVBoxLayout* TopLayout = new QVBoxLayout (this);
+ TopLayout->setSpacing(6);
+ TopLayout->setMargin(11);
+
+ myTabBox = new QTabWidget (this);
+
+ // Scalar Map on Deformed shape pane
+ QVBox* aBox = new QVBox (this);
+ aBox->setMargin(11);
+ QFrame* TopGroup = new QFrame (aBox, "TopGroup");
+ TopGroup->setFrameStyle(QFrame::Box | QFrame::Sunken);
+ TopGroup->setLineWidth(1);
+ QGridLayout* TopGroupLayout = new QGridLayout (TopGroup);
+ TopGroupLayout->setAlignment(Qt::AlignTop | Qt::AlignCenter);
+ TopGroupLayout->setSpacing(6);
+ TopGroupLayout->setMargin(11);
+
+ // Scale factor
+ QLabel* ScaleLabel = new QLabel (tr("SCALE_FACTOR"), TopGroup, "ScaleLabel");
+ TopGroupLayout->addWidget(ScaleLabel, 0, 0);
+
+ ScalFact = new QtxDblSpinBox (0.0, 1.0E+38, 0.1, TopGroup);
+ ScalFact->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+ ScalFact->setPrecision(38);
+ ScalFact->setValue(0.1);
+ TopGroupLayout->addWidget(ScalFact, 0, 1);
+
+ // Fields combo box
+ QLabel* FieldLabel = new QLabel (tr("FIELD_ITEM"), TopGroup, "FieldLabel");
+ myFieldsCombo = new QComboBox (TopGroup,"Fields");
+
+ TopGroupLayout->addWidget(FieldLabel, 1, 0);
+ TopGroupLayout->addWidget(myFieldsCombo,1,1);
+
+ // TimeStamps combo box
+ QLabel* TimeStampLabel = new QLabel (tr("TIMESTAMP_ITEM"), TopGroup, "TimeStampLabel");
+ myTimeStampsCombo = new QComboBox (TopGroup,"TimeStamp");
+
+ TopGroupLayout->addWidget(TimeStampLabel, 2, 0);
+ TopGroupLayout->addWidget(myTimeStampsCombo,2,1);
+
+ //
+ myTabBox->addTab(aBox, tr("SCALAR_MAP_ON_DEFORMED_SHAPE_TAB"));
+
+ // Scalar bar pane
+ myInputPane = new VisuGUI_InputPane(VISU::TSCALARMAPONDEFORMEDSHAPE, theModule, this);
+
+ myTabBox->addTab(GetScalarPane(), tr("SCALAR_BAR_TAB"));
+ myTabBox->addTab(myInputPane, tr("INPUT_TAB"));
+
+ // Buttons
+ QGroupBox* GroupButtons = new QGroupBox (this, "GroupButtons");
+ GroupButtons->setGeometry(QRect(10, 10, 281, 48));
+ GroupButtons->setColumnLayout(0, Qt::Vertical);
+ GroupButtons->layout()->setSpacing(0);
+ GroupButtons->layout()->setMargin(0);
+ QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
+ GroupButtonsLayout->setAlignment(Qt::AlignTop);
+ GroupButtonsLayout->setSpacing(6);
+ GroupButtonsLayout->setMargin(11);
+
+ QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons, "buttonOk");
+ buttonOk->setAutoDefault(TRUE);
+ buttonOk->setDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonOk, 0, 0);
+
+ GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding,
+ QSizePolicy::Minimum), 0, 1);
+
+ QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons, "buttonCancel");
+ buttonCancel->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
+
+ QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons, "buttonHelp");
+ buttonHelp->setAutoDefault(TRUE);
+ GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
+
+ // Add Tab box and Buttons to the top layout
+ TopLayout->addWidget(myTabBox);
+ TopLayout->addWidget(GroupButtons);
+
+ // signals and slots connections
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
+ connect(myFieldsCombo, SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
+ connect(myTimeStampsCombo, SIGNAL(activated(int)), this, SLOT(onTimeStampChanged(int)));
+}
+
+VisuGUI_ScalarMapOnDeformedShapeDlg::~VisuGUI_ScalarMapOnDeformedShapeDlg()
+{}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit )
+{
+ if( theInit )
+ myPrsCopy = VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
+ setFactor(myPrsCopy->GetScale());
+ myTimeStampsCombo->setDisabled(myIsAnimation);
+
+ CORBA::String_var aFieldName(myPrsCopy->GetScalarFieldName());
+ QString aIteration = GetFloatValueOfTimeStamp(myPrsCopy->GetScalarEntity(),
+ aFieldName.in(),
+ myPrsCopy->GetScalarTimeStampNumber());
+ if (myEntity2Fields.size() == 0)
+ {
+ // find all fields and time stamps on it
+ _PTR(Study) aActiveStudy = VISU::GetCStudy(VISU::GetAppStudy(myVisuGUI));
+ LightApp_SelectionMgr* aSel = VISU::GetSelectionMgr(myVisuGUI);
+ SALOME_ListIO selected;
+ aSel->selectedObjects(selected);
+ if (selected.Extent() > 0) {
+ Handle(SALOME_InteractiveObject) aIO = selected.First();
+ if (aIO->hasEntry()) {
+ _PTR(SObject) aSObject = aActiveStudy->FindObjectID(aIO->getEntry());
+ VISU::VISUType aType = VISU::Storable::SObject2Type( aSObject );
+ switch(aType){
+ case VISU::TTIMESTAMP: {
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TFIELD: {
+ _PTR(SObject) newSObject;
+ if(aSObject->ReferencedObject(newSObject)) aSObject = newSObject;
+ aSObject = aSObject->GetFather();
+ break;
+ }
+ case VISU::TANIMATION: {
+ _PTR(ChildIterator) aTmpIter = aActiveStudy->NewChildIterator(aSObject);
+ for (aTmpIter->InitEx(true); aTmpIter->More(); aTmpIter->Next()) {
+ _PTR(SObject) aTmpChildSObj = aTmpIter->Value();
+ _PTR(SObject) newSObject;
+ if(aTmpChildSObj->ReferencedObject(newSObject)){
+ aSObject = newSObject;
+ aSObject->GetFather();
+ break;
+ }
+ }
+ break;
+ }}
+
+ aSObject = aSObject->GetFather();
+ aSObject = aSObject->GetFather();
+
+ mySelectionObj = aSObject;
+ CORBA::Object_var anObject = VISU::ClientSObjectToObject(mySelectionObj);
+ if (CORBA::is_nil(anObject)) {
+ mySelectionObj = mySelectionObj->GetFather();
+ }
+ }
+ }
+
+ if (mySelectionObj) {
+ _PTR(ChildIterator) aIter = aActiveStudy->NewChildIterator(mySelectionObj);
+
+ for (aIter->InitEx(true); aIter->More(); aIter->Next()) {
+ _PTR(SObject) aChildSObj = aIter->Value();
+ VISU::Storable::TRestoringMap aRestoringMap = VISU::Storable::GetStorableMap(aChildSObj);
+ if (!aRestoringMap.empty()) {
+ VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aRestoringMap);
+ if (aType == VISU::TTIMESTAMP) {
+ QString aMeshName = aRestoringMap["myMeshName"];
+ CORBA::String_var aName = myPrsCopy->GetMeshName();
+ if (aMeshName != aName.in())
+ continue;
+ QString aFieldName = aRestoringMap["myFieldName"];
+ QString aTimeIter = aRestoringMap["myTimeStampId"];
+ QString aEntity = aRestoringMap["myEntityId"];
+ VISU::Entity anEntity;
+ switch (aEntity.toInt()) {
+ case 0: anEntity = VISU::NODE; break;
+ case 1: anEntity = VISU::EDGE; break;
+ case 2: anEntity = VISU::FACE; break;
+ case 3: anEntity = VISU::CELL; break;
+ }
+ TFieldName2TimeStamps& aFieldName2TimeStamps = myEntity2Fields[anEntity];
+ TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldName2TimeStamps[aFieldName];
+ aTimeStampNumber2Time[aTimeIter.toInt()] =
+ GetFloatValueOfTimeStamp(anEntity,
+ aFieldName.latin1(),
+ aTimeIter.toInt());
+ }
+ }
+ }
+ }
+ AddAllFieldNames();
+ }
+ myFieldsCombo->setCurrentText(aFieldName.in());
+ AddAllTimes(myFieldsCombo->currentText());
+ myTimeStampsCombo->setCurrentText(aIteration);
+ SetScalarField( false );
+
+ VisuGUI_ScalarBarBaseDlg::initFromPrsObject(myPrsCopy, theInit);
+
+ if( !theInit )
+ return;
+
+ myInputPane->initFromPrsObject( myPrsCopy );
+ myTabBox->setCurrentPage( 0 );
+}
+
+int
+VisuGUI_ScalarMapOnDeformedShapeDlg
+::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
+{
+ if(!myInputPane->check() || !GetScalarPane()->check())
+ return 0;
+
+ int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
+ anIsOk &= GetScalarPane()->storeToPrsObject( myPrsCopy );
+
+ myPrsCopy->SetScale(getFactor());
+
+ myPrsCopy->SetScalarField(myPrsCopy->GetScalarEntity(),
+ getCurrentScalarFieldName().latin1(),
+ myTimeStampID[ myTimeStampsCombo->currentItem() ]);
+
+ if(myUpdateScalars)
+ SetScalarField( false );
+
+ VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Copy(myPrsCopy, thePrs);
+
+ return anIsOk;
+}
+
+int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldNamePos(){
+ return myFieldsCombo->currentItem();
+}
+
+QString VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarFieldName(){
+ return myFieldsCombo->currentText();
+}
+
+int VisuGUI_ScalarMapOnDeformedShapeDlg::getCurrentScalarNbIterations(){
+ return myTimeStampsCombo->count();
+}
+
+VISU::Entity
+VisuGUI_ScalarMapOnDeformedShapeDlg
+::getCurrentScalarEntity()
+{
+ VISU::Entity anEntity = VISU::Entity(-1);
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
+ if (aFieldName == myFieldsCombo->currentText()) {
+ anEntity = anIter->first;
+ break;
+ }
+ }
+ }
+ return anEntity;
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::SetScalarField( const bool save_scalar_pane ){
+ SetScalarField( myTimeStampID[ myTimeStampsCombo->currentItem() ], "", save_scalar_pane );
+}
+
+void
+VisuGUI_ScalarMapOnDeformedShapeDlg
+::SetScalarField(int theIter,
+ QString theFieldName,
+ const bool save_scalar_pane )
+{
+ QApplication::setOverrideCursor(Qt::waitCursor);
+
+ if( save_scalar_pane )
+ GetScalarPane()->storeToPrsObject(myPrsCopy);
+
+ QString aFieldName;
+
+ if(theFieldName.isEmpty())
+ aFieldName = myFieldsCombo->currentText();
+ else
+ aFieldName = theFieldName;
+
+ VISU::Entity anEntity = getCurrentScalarEntity();
+
+ myPrsCopy->SetScalarField(anEntity,
+ aFieldName.latin1(),
+ theIter);
+
+ if( save_scalar_pane )
+ UpdateScalarField();
+
+ QApplication::restoreOverrideCursor();
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::accept()
+{
+ VisuGUI_ScalarBarBaseDlg::accept();
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::reject()
+{
+ VisuGUI_ScalarBarBaseDlg::reject();
+}
+
+QString VisuGUI_ScalarMapOnDeformedShapeDlg::GetContextHelpFilePath()
+{
+ return "scalar_map_on_deformed_shape_page.html";
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllFieldNames(){
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
+ myFieldsCombo->insertItem(aFieldName);
+ }
+ }
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::AddAllTimes(const QString& theFieldName){
+ TEntity2Fields::const_iterator anIter = myEntity2Fields.begin();
+ for(; anIter != myEntity2Fields.end(); anIter++){
+ const TFieldName2TimeStamps& aFieldName2TimeStamps = anIter->second;
+ TFieldName2TimeStamps::const_iterator aFieldIter = aFieldName2TimeStamps.begin();
+ for(; aFieldIter != aFieldName2TimeStamps.end(); aFieldIter++){
+ const QString& aFieldName = aFieldIter->first;
+ if(theFieldName != aFieldName)
+ continue;
+
+ myTimeStampID.clear();
+ myTimeStampsCombo->clear();
+
+ const TTimeStampNumber2Time& aTimeStampNumber2Time = aFieldIter->second;
+ TTimeStampNumber2Time::const_iterator aTimeStampIter = aTimeStampNumber2Time.begin();
+ for(; aTimeStampIter != aTimeStampNumber2Time.end(); aTimeStampIter++){
+ int aTimeStampNumber = aTimeStampIter->first;
+ myTimeStampID.push_back(aTimeStampNumber);
+
+ QString aTimeStampTime = aTimeStampIter->second;
+ myTimeStampsCombo->insertItem(aTimeStampTime);
+ }
+ return;
+ }
+ }
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::onFieldChanged(int){
+ AddAllTimes(myFieldsCombo->currentText());
+ SetScalarField();
+ UpdateScalarField();
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::onTimeStampChanged(int){
+ SetScalarField();
+ UpdateScalarField();
+}
+
+void VisuGUI_ScalarMapOnDeformedShapeDlg::UpdateScalarField(){
+ GetScalarPane()->initFromPrsObject(myPrsCopy);
+}
+
+QString
+VisuGUI_ScalarMapOnDeformedShapeDlg
+::GetFloatValueOfTimeStamp(VISU::Entity theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber)
+{
+ QString aTime("");
+ VISU::TEntity anEntity = VISU::TEntity(theEntity);
+ VISU::Result_i* theResult = myPrsCopy->GetCResult();
+ VISU::Result_i::PInput anInput = theResult->GetInput();
+ VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
+ anEntity,
+ theFieldName);
+ if(!aField)
+ return aTime;
+
+ VISU::TValField& aValField = aField->myValField;
+ VISU::TValField::const_iterator aIter = aValField.find(theTimeStampNumber);
+ if(aIter != aValField.end()){
+ VISU::PValForTime aValForTime = aIter->second;
+ aTime = VISU_Convertor::GenerateName(aValForTime->myTime).c_str();
+ }
+ return aTime;
+}
--- /dev/null
+// VISU VISUGUI : GUI of VISU component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+// File : VisuGUI_ScalarMapOnDeformedShapeDlg.h
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISUGUI_SCALARMAPONDEFORMEDSHAPEDLS_H
+#define VISUGUI_SCALARMAPONDEFORMEDSHAPEDLS_H
+
+#include "VisuGUI_Prs3dDlg.h"
+
+#include "VISUConfig.hh"
+
+#include "QtxDblSpinBox.h"
+
+#include <qdialog.h>
+#include <qgroupbox.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qtabwidget.h>
+
+#include <set>
+#include <vector>
+
+class SalomeApp_Module;
+class VisuGUI_InputPane;
+
+namespace VISU
+{
+ class ScalarMapOnDeformedShape_i;
+}
+
+class VisuGUI_ScalarMapOnDeformedShapeDlg : public VisuGUI_ScalarBarBaseDlg
+{
+ Q_OBJECT
+
+public:
+ VisuGUI_ScalarMapOnDeformedShapeDlg (SalomeApp_Module* theModule);
+ ~VisuGUI_ScalarMapOnDeformedShapeDlg();
+
+ double getFactor()
+ { return ScalFact->value(); }
+ void setFactor(double theFactor)
+ { ScalFact->setValue(theFactor); }
+
+ virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
+ bool theInit );
+
+ virtual int storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
+
+ int getCurrentScalarFieldNamePos();
+ QString getCurrentScalarFieldName();
+ int getCurrentScalarNbIterations();
+ VISU::Entity getCurrentScalarEntity();
+ void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
+
+protected:
+ virtual QString GetContextHelpFilePath();
+
+protected slots:
+ void accept();
+ void reject();
+
+private slots:
+ void onFieldChanged(int i=0);
+ void onTimeStampChanged(int i=0);
+
+private:
+ QtxDblSpinBox* ScalFact;
+ QTabWidget* myTabBox;
+ VisuGUI_ScalarBarPane* myScalarPane;
+ VisuGUI_InputPane* myInputPane;
+ QComboBox *myFieldsCombo;
+ QComboBox *myTimeStampsCombo;
+
+ typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
+ typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
+ typedef std::map<VISU::Entity, TFieldName2TimeStamps> TEntity2Fields; // Mesh to fields map
+
+ TEntity2Fields myEntity2Fields;
+ int myCurrScalarIter;
+ bool myIsAnimation;
+ bool myUpdateScalars;
+ std::vector<int> myTimeStampID;
+
+ _PTR(SObject) mySelectionObj;
+ SALOME::GenericObjPtr<VISU::ScalarMapOnDeformedShape_i> myPrsCopy;
+ SalomeApp_Module* myVisuGUI;
+
+protected:
+ void UpdateScalarField();
+ void SetScalarField( const bool = true );
+ void AddAllFieldNames();
+ void AddAllTimes(const QString& theFieldName);
+ QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
+ const std::string& theFieldName,
+ int theTimeStampNumber);
+};
+
+#endif // VISUGUI_DEFORMEDSHAPEDLS_H
// VISU VISUGUI : GUI of VISU component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+// 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/ or email : webmaster.salome@opencascade.com
//
//
//
// File : VisuGUI_Selection.cxx
-// Author : Laurent CORNABE & Hubert ROLLAND
+// Author : Sergey Anikin
// Module : VISU
-// $Header$
#include "VisuGUI_Selection.h"
-#include "VisuGUI.h"
-#include "VisuGUI_Tools.h"
#include "VisuGUI_ViewTools.h"
+#include "VisuGUI_Tools.h"
+
+#include "VISU_Result_i.hh"
+#include "VISU_Gen_i.hh"
#include "VISU_Actor.h"
-#include "VISU_PrsObject_i.hh"
-#include "VISU_Prs3d_i.hh"
-#include "VISU_PipeLine.hxx"
+#include "VISU_ScalarMapAct.h"
#include "SalomeApp_Study.h"
-#include "SalomeApp_Application.h"
-#include "LightApp_Application.h"
-#include "LightApp_SelectionMgr.h"
-#include "LightApp_VTKSelector.h"
-
-#include "SUIT_Desktop.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"
-
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-
-#include "VISU_ConvertorUtils.hxx"
-
-#include "utilities.h"
-
-// OCCT Includes
-#include <TColStd_IndexedMapOfInteger.hxx>
-#include <TColStd_MapOfInteger.hxx>
-
-// QT Includes
-#include <QLabel>
-#include <QSpinBox>
-#include <QListWidget>
-#include <QLayout>
-#include <QButtonGroup>
-#include <QRadioButton>
-#include <QValidator>
-#include <QPushButton>
-#include <QStackedWidget>
-#include <QGroupBox>
-#include <QLineEdit>
-#include <QValidator>
-#include <QTableWidget>
-#include <QVBoxLayout>
-#include <QHBoxLayout>
-#include <QKeyEvent>
-#include <QHeaderView>
-
-// VTK Includes
-#include <vtkDataSetMapper.h>
-#include <vtkDataSet.h>
-#include <vtkPointData.h>
-#include <vtkCellData.h>
-#include <vtkCell.h>
-
-// STL Includes
-#include <map>
-
-using namespace std;
-
-
-inline
-QString
-GetNumber( const VISU::TStructuredId& theStructuredId,
- size_t theId )
-{
- if ( theStructuredId[theId] < 0 )
- return "-";
-
- return QString::number( theStructuredId[theId] );
+#include "LightApp_Study.h"
+
+using namespace VISU;
+
+//////////////////////////////////////////////////
+// Class: VisuGUI_Selection
+//////////////////////////////////////////////////
+
+
+//---------------------------------------------------------------
+QVariant VisuGUI_Selection::parameter( const int ind, const QString& p ) const
+{
+ QVariant val( LightApp_Selection::parameter( ind, p ) );
+ if ( !val.isValid() ) {
+ if ( p == "type" ) val = QVariant( type( ind ) );
+ else if ( p == "nbComponents" ) val = QVariant( nbComponents( ind ) );
+ else if ( p == "medEntity" ) val = QVariant( medEntity( ind ) );
+ else if ( p == "medSource" ) val = QVariant( medSource( ind ) );
+ else if ( p == "representation" ) val = QVariant( representation( ind ) );
+ else if ( p == "nbTimeStamps" ) val = QVariant( nbTimeStamps( ind ) );
+ else if ( p == "nbChildren" ) val = QVariant( nbChildren( ind ) );
+ else if ( p == "nbNamedChildren") val = QVariant( nbNamedChildren( ind ) );
+ else if ( p == "isVisible" ) val = QVariant( isVisible( ind ) );
+ else if ( p == "isShrunk" ) val = QVariant( isShrunk( ind ) );
+ else if ( p == "hasActor" ) val = QVariant( hasActor( ind ) );
+ else if ( p == "isShading" ) val = QVariant( isShading( ind ) );
+ else if ( p == "isScalarMapAct" ) val = QVariant( isScalarMapAct( ind ) );
+ else if ( p == "isVisuComponent") val = QVariant( isVisuComponent( ind ) );
+ else if ( p == "fullResolution" ) val = QVariant( fullResolution( ind ) );
+ else if ( p == "mediumResolution" ) val = QVariant( mediumResolution( ind ) );
+ else if ( p == "lowResolution" ) val = QVariant( lowResolution( ind ) );
+ else if ( p == "resolutionState" ) val = QVariant( resolutionState( ind ) );
+ else if ( p == "isValuesLabeled" ) val = QVariant( isValuesLabeled( ind ) );
+ }
+
+ return val;
}
-VisuGUI_SelectionDlg::VisuGUI_SelectionDlg (const SalomeApp_Module* theModule):
- QDialog(VISU::GetDesktop(theModule),
- Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),//WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
- mySelectionMgr(NULL),
- myModule(theModule)
-{
- setModal( false );
- setAttribute( Qt::WA_DeleteOnClose, true );
- setWindowTitle( tr("WINDOW_TITLE" ) );
- setSizeGripEnabled(true);
-
- QGridLayout* TopLayout = new QGridLayout (this);
- TopLayout->setSpacing(6);
- TopLayout->setMargin(11);
- TopLayout->setRowStretch(0, 0);
- TopLayout->setRowStretch(1, 0);
- TopLayout->setRowStretch(2, 1);
- TopLayout->setRowStretch(3, 0);
-
- QGroupBox* aTypeBox = new QGroupBox (tr("MODE_TITLE"), this);
- QHBoxLayout* aHBox = new QHBoxLayout();
- QButtonGroup* aBtnGroup = new QButtonGroup();
-
- QRadioButton* aBtn = new QRadioButton (tr("MODE_POINT"), aTypeBox);
- aHBox->addWidget( aBtn );
- aBtnGroup->addButton( aBtn, 0 );
-
- aBtn = new QRadioButton (tr("MODE_CELL"), aTypeBox);
- aHBox->addWidget( aBtn );
- aBtnGroup->addButton( aBtn, 1 );
-
- aBtn = new QRadioButton (tr("MODE_ACTOR"), aTypeBox);
- aHBox->addWidget( aBtn );
- aBtnGroup->addButton( aBtn, 2 );
-
- aBtnGroup->button(0)->setChecked(true);
+//---------------------------------------------------------------
+// Macro for converting VISU enumeration items into corresponding strings
+#define ENUM2STRING( x, y ) \
+ case y: \
+ x = QString( #y ); \
+ break
- connect(aBtnGroup, SIGNAL(buttonClicked(int)), this, SLOT(onSelectionChange(int)));
+QString VisuGUI_Selection::type( const int ind ) const
+{
+ QString aResStr;
+ SalomeApp_Study* aStudy = GetStudy();
+ if ( !aStudy )
+ return aResStr;
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+
+ VISU::Base_i* aBase = anObjectInfo.myBase;
+ if(aBase){
+ VISU::VISUType aType = aBase->GetType();
+ if(aType == VISU::TCOLOREDPRS3DHOLDER){
+ CORBA::Object_var anObject = ClientSObjectToObject(anObjectInfo.mySObject);
+ VISU::ColoredPrs3dHolder_var aHolder = VISU::ColoredPrs3dHolder::_narrow(anObject);
+ aType = aHolder->GetPrsType();
+ }
+ switch (aType) {
+ ENUM2STRING( aResStr, VISU::TVISUGEN );
+ ENUM2STRING( aResStr, VISU::TRESULT );
+ ENUM2STRING( aResStr, VISU::TTABLE );
+ ENUM2STRING( aResStr, VISU::TCURVE );
+ ENUM2STRING( aResStr, VISU::TCONTAINER );
+ ENUM2STRING( aResStr, VISU::TMESH );
+ ENUM2STRING( aResStr, VISU::TSCALARMAP );
+ ENUM2STRING( aResStr, VISU::TISOSURFACES );
+ ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE );
+ ENUM2STRING( aResStr, VISU::TSCALARMAPONDEFORMEDSHAPE );
+ ENUM2STRING( aResStr, VISU::TCUTPLANES );
+ ENUM2STRING( aResStr, VISU::TCUTLINES );
+ ENUM2STRING( aResStr, VISU::TVECTORS );
+ ENUM2STRING( aResStr, VISU::TSTREAMLINES );
+ ENUM2STRING( aResStr, VISU::TPLOT3D );
+ ENUM2STRING( aResStr, VISU::TANIMATION );
+ }
+ }
- aTypeBox->setLayout(aHBox);
- TopLayout->addWidget(aTypeBox, 0, 0);
+ if(aResStr.isNull()){
+ VISU::VISUType aType = VISU::Storable::RestoringMap2Type(aMap);
+ switch (aType) {
+ ENUM2STRING( aResStr, VISU::TENTITY );
+ ENUM2STRING( aResStr, VISU::TFAMILY );
+ ENUM2STRING( aResStr, VISU::TGROUP );
+ ENUM2STRING( aResStr, VISU::TVIEW3D );
+ ENUM2STRING( aResStr, VISU::TFIELD );
+ ENUM2STRING( aResStr, VISU::TTIMESTAMP );
+ }
+ }
- QWidget* aNamePane = new QWidget (this);
- QGridLayout* aNameLay = new QGridLayout (aNamePane);
+ if(aResStr.isNull()){
+ bool anIsExist;
+ QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist);
+ if ( anIsExist && aVal != "MESH" )
+ aResStr = "VISU::T" + aVal;
+ }
- QLabel* aMeshLbl = new QLabel (tr("MESH_NAME_LBL"), aNamePane);
- myMeshName = new QLabel (aNamePane);
+ return aResStr;
+}
- QLabel* aFieldLbl = new QLabel (tr("FIELD_NAME_LBL"), aNamePane);
- myFieldName = new QLabel (aNamePane);
- aNameLay->addWidget(aMeshLbl, 0, 0);
- aNameLay->addWidget(myMeshName, 0, 1);
- aNameLay->addWidget(aFieldLbl, 1, 0);
- aNameLay->addWidget(myFieldName, 1, 1);
+//---------------------------------------------------------------
+QString VisuGUI_Selection::nbComponents( const int ind ) const
+{
+ QString aResStr;
+ SalomeApp_Study* aStudy = GetStudy();
+ if ( !aStudy )
+ return aResStr;
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+
+ bool isExist;
+ QString aVal = VISU::Storable::FindValue(aMap,"myNumComponent",&isExist);
+ if ( isExist )
+ aResStr = aVal;
+ return aResStr;
+}
- TopLayout->addWidget(aNamePane, 1, 0);
- myWidgetStack = new QStackedWidget (this);
+//---------------------------------------------------------------
+QString VisuGUI_Selection::resolutions( const int ind ) const
+{
+ QString aResStr;
+ SalomeApp_Study* aStudy = GetStudy();
+ if ( !aStudy )
+ return aResStr;
- // Create Points pane
- myPointsPane = new QWidget (myWidgetStack);
- QVBoxLayout* aVBoxLayout = new QVBoxLayout(myPointsPane);
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ).toLatin1().data());
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
- QGroupBox* aDataGrp = new QGroupBox ( tr("POINT_DATA_TITLE"), myPointsPane);
- QGridLayout* aGridLay = new QGridLayout (aDataGrp);
- aGridLay->setSpacing(6);
+ bool isExist;
+ QString aVal = VISU::Storable::FindValue(aMap,"myResolutions",&isExist);
+ if ( isExist )
+ aResStr = aVal;
- aGridLay->addWidget( new QLabel (tr("DATA_ID_LBL"), aDataGrp) , 0, 0 );
- aGridLay->addWidget( new QLabel (tr("DATA_SCALAR_LBL"), aDataGrp), 1, 0 );
- aGridLay->addWidget( new QLabel (tr("DATA_VECTOR_LBL"), aDataGrp), 2, 0 );
-
- myIDValLbl = new QLineEdit ("", aDataGrp);
- aGridLay->addWidget( myIDValLbl, 0, 1 );
- QIntValidator* aIntValidator = new QIntValidator (myIDValLbl);
- aIntValidator->setBottom(0);
- myIDValLbl->setValidator(aIntValidator);
- connect(myIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onPointIdEdit(const QString&)));
-
- myScalarValLbl = new QLabel ("", aDataGrp);
- aGridLay->addWidget( myScalarValLbl, 1, 1 );
-
- myVectorValLbl = new QLabel ("", aDataGrp);
- myVectorValLbl->setMinimumWidth(150);
- aGridLay->addWidget( myVectorValLbl, 2, 1 );
-
- aVBoxLayout->addWidget( aDataGrp );
-
- QGroupBox* aCoordGrp = new QGroupBox ( tr("POINT_COORD_TITLE"), myPointsPane);
- aGridLay = new QGridLayout (aCoordGrp);
- aGridLay->setSpacing(6);
-
- aGridLay->addWidget( new QLabel ("X:", aCoordGrp), 0, 0 );
- myXValLbl = new QLabel ("", aCoordGrp);
- aGridLay->addWidget( myXValLbl, 0, 1 );
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aGridLay->addWidget( new QLabel ("I:", aCoordGrp), 0, 2 );
- myIValLbl = new QLabel ("-", aCoordGrp);
- aGridLay->addWidget( myIValLbl, 0, 3 );
- //ENK: 23.11.2006
- aGridLay->addWidget( new QLabel ("Y:", aCoordGrp), 1, 0 );
- myYValLbl = new QLabel ("", aCoordGrp);
- aGridLay->addWidget( myYValLbl, 1, 1 );
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aGridLay->addWidget( new QLabel ("J:", aCoordGrp), 1, 2 );
- myJValLbl = new QLabel ("-", aCoordGrp);
- aGridLay->addWidget( myJValLbl, 1, 3 );
- //ENK: 23.11.2006
- aGridLay->addWidget( new QLabel ("Z:",aCoordGrp ), 2, 0 );
- myZValLbl = new QLabel ("", aCoordGrp);
- aGridLay->addWidget( myZValLbl, 2, 1 );
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aGridLay->addWidget( new QLabel ("K:", aCoordGrp), 2, 2 );
- myKValLbl = new QLabel ("-", aCoordGrp);
- aGridLay->addWidget( myKValLbl, 2, 3 );
- //ENK: 23.11.2006
-
- aVBoxLayout->addWidget( aCoordGrp );
-
- myWidgetStack->addWidget(myPointsPane);
-
- // Create Cells pane
- myCellsPane = new QWidget (myWidgetStack);
- QGridLayout* aCellLayout = new QGridLayout (myCellsPane);
- aCellLayout->setSpacing(6);
- aCellLayout->setRowStretch(0, 0);
- aCellLayout->setRowStretch(1, 1);
-
- QGroupBox* aCellGrp = new QGroupBox( tr("CELL_DATA_TITLE"), myCellsPane);
- aGridLay = new QGridLayout (aCellGrp);
-
- aGridLay->addWidget( new QLabel (tr("DATA_ID_LBL"), aCellGrp), 0, 0);
- myCellIDValLbl = new QLineEdit ("", aCellGrp);
- myCellIDValLbl->setValidator(aIntValidator);
- aGridLay->addWidget( myCellIDValLbl, 0, 1);
- connect(myCellIDValLbl, SIGNAL(textChanged(const QString&)), this, SLOT(onCellIdEdit(const QString&)));
-
- aGridLay->addWidget( new QLabel (tr("DATA_SCALAR_LBL"), aCellGrp), 1, 0);
- myCellScalarValLbl = new QLabel ("", aCellGrp);
- aGridLay->addWidget( myCellScalarValLbl, 1, 1);
- aGridLay->addWidget( new QLabel (tr("DATA_VECTOR_LBL"), aCellGrp), 2, 0);
- myCellVectorValLbl = new QLabel ("", aCellGrp);
- aGridLay->addWidget(myCellVectorValLbl , 2, 1);
-
- aCellLayout->addWidget(aCellGrp, 0, 0);
-
- myListPoints = new QTableWidget (myCellsPane);
- myListPoints->setEditTriggers( QAbstractItemView::NoEditTriggers );
- myListPoints->setColumnCount(9);
- myListPoints->setRowCount(0);
- myListPoints->setColumnWidth(0, 40);
- myListPoints->setColumnWidth(1, 40);
- myListPoints->setColumnWidth(2, 40);
- myListPoints->setColumnWidth(3, 40);
- myListPoints->setColumnWidth(4, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- myListPoints->setColumnWidth(5, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- myListPoints->setColumnWidth(6, 40);//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- myListPoints->setSelectionMode(QAbstractItemView::NoSelection);
-
- QStringList aLabels;
- aLabels.append( "ID" );
- aLabels.append( "X" );
- aLabels.append( "Y" );
- aLabels.append( "Z" );
- aLabels.append( "I" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aLabels.append( "J" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aLabels.append( "K" );//ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- aLabels.append( tr("CELL_DATA_SCALAR_HDR") );
- aLabels.append( tr("CELL_DATA_VECTOR_HDR") );
- myListPoints->setHorizontalHeaderLabels( aLabels );
-
- aCellLayout->addWidget(myListPoints, 1, 0);
-
- myWidgetStack->addWidget(myCellsPane);
-
- // Actor Pane
- myActorsPane = new QWidget (myWidgetStack);
- aVBoxLayout = new QVBoxLayout(myActorsPane);
- aVBoxLayout->setSpacing(6);
-
- QGroupBox* aPosGrp = new QGroupBox (tr("ACTOR_DATA_POSITION_TITLE"), myActorsPane);
- aGridLay = new QGridLayout (aPosGrp);
- aGridLay->setSpacing(6);
- aGridLay->addWidget( new QLabel ("X:", aPosGrp), 0, 0);
- myXPosLbl = new QLabel ("0", aPosGrp);
- aGridLay->addWidget( myXPosLbl, 0, 1);
- aGridLay->addWidget( new QLabel ("Y:", aPosGrp), 1, 0);
- myYPosLbl = new QLabel ("0", aPosGrp);
- aGridLay->addWidget( myYPosLbl, 1, 1);
- aGridLay->addWidget( new QLabel ("Z:", aPosGrp), 2, 0);
- myZPosLbl = new QLabel ("0", aPosGrp);
- aGridLay->addWidget( myZPosLbl, 2, 1);
-
- aVBoxLayout->addWidget( aPosGrp );
-
- QGroupBox* aSizeGrp = new QGroupBox ( tr("ACTOR_DATA_SIZE_TITLE"), myActorsPane);
- aGridLay = new QGridLayout (aSizeGrp);
- aGridLay->setSpacing(6);
- aGridLay->addWidget( new QLabel ("dX:", aSizeGrp ), 0, 0);
- myDXLbl = new QLabel ("0", aSizeGrp);
- aGridLay->addWidget( myDXLbl, 0, 1);
- aGridLay->addWidget( new QLabel ("dY:", aSizeGrp ), 1, 0);
- myDYLbl = new QLabel ("0", aSizeGrp);
- aGridLay->addWidget( myDYLbl, 1, 1);
- aGridLay->addWidget( new QLabel ("dZ:", aSizeGrp ), 2, 0);
- myDZLbl = new QLabel ("0", aSizeGrp);
- aGridLay->addWidget( myDZLbl, 2, 1);
-
- aVBoxLayout->addWidget( aSizeGrp );
-
- myWidgetStack->addWidget(myActorsPane);
-
-
- TopLayout->addWidget(myWidgetStack, 2, 0);
-
- // Create buttons group
- QWidget* aBtnBox = new QWidget (this);
- QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox);
- aBtnLayout->addStretch();
-
- QPushButton* aCloseBtn = new QPushButton (tr("BUT_CLOSE"), aBtnBox);
- aBtnLayout->addWidget(aCloseBtn);
- connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(close()));
-
- QPushButton* aHelpBtn = new QPushButton (tr("BUT_HELP"), aBtnBox);
- aBtnLayout->addWidget(aHelpBtn);
- connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
-
- TopLayout->addWidget(aBtnBox, 3, 0);
-
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
- (SUIT_Session::session()->activeApplication());
- mySelectionMgr = anApp->selectionMgr();
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionEvent()));
-
- //connect(visuGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close()));
-
- myFl = false;
-
- // Activate Points pane
- myWidgetStack->setCurrentWidget(myPointsPane);
- if (SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule))
- aViewWindow->SetSelectionMode(NodeSelection);
- onSelectionEvent();
+ return aResStr;
}
-VisuGUI_SelectionDlg::~VisuGUI_SelectionDlg()
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::resolution( const int ind, char theResoltuion ) const
{
- SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
- if ( !aViewWindow )
- return;
+ QString aResStr;
- switch ( aViewWindow->SelectionMode() ) {
- case NodeSelection:
- case CellSelection:
- aViewWindow->SetSelectionMode(ActorSelection);
- break;
- }
+ QString aResolutions = resolutions( ind );
+ if(aResolutions.isEmpty())
+ return aResStr;
+
+ if(aResolutions.indexOf(theResoltuion) != -1)
+ aResStr = "1";
+ else
+ aResStr = "0";
+
+ return aResStr;
}
-void VisuGUI_SelectionDlg::onSelectionChange (int theId)
-{
- SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
- if (!aViewWindow) return;
-
- switch (theId) {
- case 0: // Points
- myWidgetStack->setCurrentWidget(myPointsPane);
- aViewWindow->SetSelectionMode(NodeSelection);
- onPointIdEdit(myIDValLbl->text());
- break;
- case 1: // Cells
- myWidgetStack->setCurrentWidget(myCellsPane);
- aViewWindow->SetSelectionMode(CellSelection);
- onCellIdEdit(myCellIDValLbl->text());
- break;
- case 2: // Actor
- myWidgetStack->setCurrentWidget(myActorsPane);
- aViewWindow->SetSelectionMode(ActorSelection);
- onSelectionEvent();
- }
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::fullResolution( const int ind ) const
+{
+ return resolution( ind, 'F');
}
-void VisuGUI_SelectionDlg::closeEvent (QCloseEvent* theEvent)
+//---------------------------------------------------------------
+QString VisuGUI_Selection::mediumResolution( const int ind ) const
{
- QDialog::closeEvent(theEvent);
+ return resolution( ind, 'M');
}
-template<class TData> QString getValue(TData* theData, int theId){
- if (vtkDataArray *aScalar = theData->GetScalars()){
- vtkFloatingPointType aVal = aScalar->GetTuple1(theId);
- return QString::number(aVal);
- } else {
- return QString("No data");
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::lowResolution( const int ind ) const
+{
+ return resolution( ind, 'L');
+}
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::resolutionState( const int ind ) const
+{
+ QString aResStr;
+ SalomeApp_Study* aStudy = GetStudy();
+ if ( !aStudy )
+ return aResStr;
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ).toLatin1().data());
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+
+ bool isExist;
+ QString aVal = VISU::Storable::FindValue(aMap,"myState",&isExist);
+ if ( isExist ) {
+ if ( aVal.toInt() == VISU::Result::FULL )
+ aResStr = "F";
+ if ( aVal.toInt() == VISU::Result::MEDIUM )
+ aResStr = "M";
+ if ( aVal.toInt() == VISU::Result::LOW )
+ aResStr = "L";
+ if ( aVal.toInt() == VISU::Result::HIDDEN )
+ aResStr = "H";
}
+
+ return aResStr;
}
-template<class TData> QString getVector(TData* theData, int theId){
- if (vtkDataArray *aVector = theData->GetVectors()) {
- vtkFloatingPointType *aVal = aVector->GetTuple3(theId);
- return QString("%1; %2; %3").arg(aVal[0]).arg(aVal[1]).arg(aVal[2]);
- } else {
- return QString("No data");
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::medEntity( const int ind ) const
+{
+ SalomeApp_Study* aStudy = GetStudy();
+ if ( !aStudy )
+ return QString();
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+
+ bool isExist;
+ QString aVal = VISU::Storable::FindValue(aMap,"myEntityId",&isExist);
+ if ( isExist ) {
+ using namespace VISU;
+ TEntity anEntityId = TEntity(aVal.toInt());
+ switch(anEntityId){
+ case NODE_ENTITY :
+ return "NODE_ENTITY";
+ case EDGE_ENTITY :
+ return "EDGE_ENTITY";
+ case FACE_ENTITY :
+ return "FACE_ENTITY";
+ case CELL_ENTITY :
+ return "CELL_ENTITY";
+ default:
+ return QString();
+ }
}
+ return QString();
}
-#define ABS(a) (a>=0)?a:-a
-
-void VisuGUI_SelectionDlg::onSelectionEvent() {
- SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(myModule);
- if (!aViewWindow)
- return;
-
- switch (aViewWindow->SelectionMode()) {
- case NodeSelection:
- case CellSelection:
- case ActorSelection:
- break;
- default:
- close();
- delete this;
- return;
+QString VisuGUI_Selection::medSource( const int ind ) const
+{
+ _PTR(Study) aStudyDS = GetStudy()->studyDS();
+ if(_PTR(SObject) aSObject = aStudyDS->FindObjectID((const char*)entry(ind).toLatin1())){
+ VISU::Result_var aRes;
+ if(VISU::Result_i* aResult = CheckResult(myModule,aSObject,aRes)){
+ using namespace VISU;
+ Result_i::ECreationId aCreationId = aResult->GetCreationId();
+ switch(aCreationId){
+ case Result_i::eImportFile :
+ return "eImportFile";
+ case Result_i::eCopyAndImportFile :
+ return "eCopyAndImportFile";
+ case Result_i::eImportMed :
+ return "eImportMed";
+ case Result_i::eImportMedField :
+ return "eImportMedField";
+ default:
+ return QString();
+ }
+ }
}
+ return QString();
+}
- if (myFl)
- return;
- myFl = true;
+QString VisuGUI_Selection::nbTimeStamps( const int ind ) const
+{
+ QString aResStr;
+ SalomeApp_Study* aStudy = GetStudy();
+ if ( !aStudy )
+ return aResStr;
+
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, (const char*)entry( ind ).toLatin1());
+ VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+
+ bool isExist;
+ const QString& aVal = VISU::Storable::FindValue(aMap,"myNbTimeStamps",&isExist);
+ if ( isExist )
+ aResStr = aVal;
+ return aResStr;
+}
- int aType = myWidgetStack->indexOf(myWidgetStack->currentWidget());
- SVTK_Selector* aSelector = aViewWindow->GetSelector();
+//----------------------------------------------------------------------------
+template<class TPopupFunctor>
+struct TPopupDispatcher
+{
+ QString
+ operator()(const SalomeApp_Module* theModule,
+ const QString& theEntry)
+ {
+ if(SUIT_ViewManager* aViewManager = theModule->getApp()->activeViewManager()){
+ QString aType = aViewManager->getType();
+ TPopupFunctor aFunctor;
+ if(aType == SVTK_Viewer::Type())
+ return aFunctor.template Get<SVTK_Viewer>(theModule, theEntry);
+ //else if(aType == VVTK_Viewer::Type())
+ //return aFunctor.template Get<VVTK_Viewer>(theModule, theEntry);
+ }
+ return QString();
+ }
+};
+
+
+//----------------------------------------------------------------------------
+template<class TViewer>
+bool
+GetPrs3dSelectionInfo(const SalomeApp_Module* theModule,
+ const QString& theEntry,
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor)
+{
+ VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(GetAppStudy(theModule), (const char*)theEntry.toLatin1());
+ thePrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
+ if(!thePrs3d)
+ return false;
+
+ typedef typename TViewer::TViewWindow TViewWindow;
+ theViewWindow = GetActiveViewWindow<TViewWindow>(theModule);
+ if(!theViewWindow)
+ return false;
+
+ thenActor = FindActor(theViewWindow, thePrs3d);
+ if(!thenActor)
+ return false;
+
+ return true;
+}
- _PTR(SObject) aSObject;
- VISU::Prs3d_i* aPrs3d = NULL;
- Handle(SALOME_InteractiveObject) anIO;
- VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(myModule);
- if(aSelectionInfo.size() == 1){
- // Get selected SObject
- VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
- VISU::TObjectInfo anObjectInfo = aSelectionItem.myObjectInfo;
- aPrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
- if(aPrs3d){
- anIO = aSelectionItem.myIO;
- aSObject = anObjectInfo.mySObject;
- }
+//----------------------------------------------------------------------------
+struct TViewFunctor
+{
+ template<class TViewer>
+ QString
+ Get(const SalomeApp_Module* theModule,
+ const QString& theEntry)
+ {
+ VISU_Actor* anActor = NULL;
+ VISU::Prs3d_i* aPrs3d = NULL;
+ SVTK_ViewWindow* aViewWindow = NULL;
+ if(!GetPrs3dSelectionInfo<TViewer>(theModule, theEntry, aPrs3d, aViewWindow, anActor))
+ return QString();
+
+ return get(aPrs3d, aViewWindow, anActor);
}
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ return QString();
+ }
+};
- if (aPrs3d) {
- QString aMeshName("NULL"), aFieldName("NULL");
- if (aSObject) {
- VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(aSObject);
- if (!aMap.empty()) {
- aMeshName = VISU::Storable::FindValue(aMap, "myMeshName");
- aFieldName = VISU::Storable::FindValue(aMap, "myFieldName");
- }
- }
- myMeshName ->setText((aMeshName == "NULL") ? QString("No name") : aMeshName);
- myFieldName->setText((aFieldName == "NULL") ? QString("No name") : aFieldName);
-
- VISU_Actor* anVISUActor =
- VISU::FindActor(VISU::GetAppStudy(myModule), aViewWindow, aSObject->GetID().c_str());
- if (anVISUActor) {
- vtkFloatingPointType aCoord[6];
- anVISUActor->GetBounds(aCoord);
- myXPosLbl->setText(QString::number( aCoord[0] ));
- myYPosLbl->setText(QString::number( aCoord[2] ));
- myZPosLbl->setText(QString::number( aCoord[4] ));
-
- myDXLbl->setText(QString::number( ABS(aCoord[1]-aCoord[0]) ));
- myDYLbl->setText(QString::number( ABS(aCoord[3]-aCoord[2]) ));
- myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
-
- TColStd_IndexedMapOfInteger aMapIndex;
- typedef std::vector<vtkFloatingPointType> TCoordArray;
- typedef map<int, TCoordArray> TPointCoordsMap;
- TPointCoordsMap aPointCoordsMap;
-
- aSelector->GetIndex(anIO, aMapIndex);
-
- vtkDataSet* aDataSet = anVISUActor->GetMapper()->GetInput();
- vtkPointData* aPntData = aDataSet->GetPointData();
-
- for (int ind = 1; ind <= aMapIndex.Extent(); ind++) {
- int anID = aMapIndex(ind);
-
- switch (aType) {
- case 0:
- {
- int aVTKID = anVISUActor->GetNodeVTKID(anID);
- if(aVTKID >= 0){
- if ( aVTKID >= 0 ) {
- vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID);
- myXValLbl->setText( QString::number( aCoord[0] ) );
- myYValLbl->setText( QString::number( aCoord[1] ) );
- myZValLbl->setText( QString::number( aCoord[2] ) );
- myIDValLbl->setText( QString::number( anID ) );
-
- if ( !VISU::IsElnoData( aDataSet ) ) {
- myScalarValLbl->setText( getValue( aPntData, aVTKID ) );
- myVectorValLbl->setText( getVector( aPntData, aVTKID ) );
- } else {
- myScalarValLbl->setText( "< ELNO data >" );
- myVectorValLbl->setText( "< ELNO data >" );
- }
-
- const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper();
- VISU::TStructuredId aStructuredId = aMapper->GetIndexesOfNode( anID );
- myKValLbl->setText( GetNumber( aStructuredId, 2 ) );
- myJValLbl->setText( GetNumber( aStructuredId, 1 ) );
- myIValLbl->setText( GetNumber( aStructuredId, 0 ) );
- }
- }
- break;
- }
- case 1:
- {
- vtkCellData* aCellData = aDataSet->GetCellData();
- vtkCell* aCell = anVISUActor->GetElemCell(anID);
- int aVTKID = anVISUActor->GetElemVTKID(anID);
- if (aCell != NULL) {
- int aNbOfPoints = aCell->GetNumberOfPoints();
- if ( aNbOfPoints > 0 ) {
- myCellIDValLbl->setText( QString::number(anID) );
- myCellScalarValLbl->setText(getValue(aCellData, aVTKID));
- myCellVectorValLbl->setText(getVector(aCellData, aVTKID));
-
- vtkIdList *aPointList = aCell->GetPointIds();
- for (int i = 0; i < aNbOfPoints; i++) {
- int aNodeVTKId = aPointList->GetId(i);
- vtkFloatingPointType* aCoord = aDataSet->GetPoint(aNodeVTKId);
- vtkIdType aNodeObjId = anVISUActor->GetNodeObjId(aNodeVTKId);
- TCoordArray aCoordArray(aCoord, aCoord + 3);
- aPointCoordsMap[aNodeObjId] = aCoordArray;
- }
- }
- }
- }
- break;
- }
- }
+//----------------------------------------------------------------------------
+struct TGetRepesentationFunctor: TViewFunctor
+{
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ QString aResStr;
+ switch (theActor->GetRepresentation()) {
+ ENUM2STRING( aResStr, VISU::POINT );
+ ENUM2STRING( aResStr, VISU::WIREFRAME );
+ ENUM2STRING( aResStr, VISU::SHADED );
+ ENUM2STRING( aResStr, VISU::INSIDEFRAME );
+ ENUM2STRING( aResStr, VISU::SURFACEFRAME );
+ ENUM2STRING( aResStr, VISU::FEATURE_EDGES );
+ }
+ return aResStr;
+ }
+};
+
+QString VisuGUI_Selection::representation( const int ind ) const
+{
+ return TPopupDispatcher<TGetRepesentationFunctor>()(myModule, entry(ind));
+}
+
+//----------------------------------------------------------------------------
+SalomeApp_Study* VisuGUI_Selection::GetStudy() const
+
+{
+ LightApp_Study* aLightStudy = const_cast<LightApp_Study*>( study() );
+ return dynamic_cast<SalomeApp_Study*>( aLightStudy );
+}
- myListPoints->setRowCount(aPointCoordsMap.size());
- TPointCoordsMap::const_iterator anIter = aPointCoordsMap.begin();
-
- const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper();
- for (int i = 0; anIter != aPointCoordsMap.end() && i < myListPoints->rowCount(); anIter++, i++) {
- myListPoints->model()->setHeaderData( i, Qt::Vertical, QVariant(QString::number( i )), Qt::DisplayRole );
- vtkIdType aNodeObjId = anIter->first;
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- VISU::TStructuredId aStructuredId = aMapper->GetIndexesOfNode(aNodeObjId);
- QString aI = GetNumber(aStructuredId, 0);
- QString aJ = GetNumber(aStructuredId, 1);
- QString aK = GetNumber(aStructuredId, 2);
- //ENK: 23.11.2006
-
- QAbstractItemModel* aModel = myListPoints->model();
- aModel->setData( aModel->index(i,0), QVariant(QString::number( aNodeObjId )), Qt::DisplayRole );
- const TCoordArray& aCoordArray = anIter->second;
- aModel->setData( aModel->index(i,1), QVariant(QString::number( aCoordArray[0] )), Qt::DisplayRole );
- aModel->setData( aModel->index(i,2), QVariant(QString::number( aCoordArray[1] )), Qt::DisplayRole );
- aModel->setData( aModel->index(i,3), QVariant(QString::number( aCoordArray[2] )), Qt::DisplayRole );
- aModel->setData( aModel->index(i,4), QVariant( aI ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176
- aModel->setData( aModel->index(i,5), QVariant( aJ ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176
- aModel->setData( aModel->index(i,6), QVariant( aK ), Qt::DisplayRole );//ENK: 23.11.2006 - PAL13176
-
- vtkIdType aNodeVTKId = anVISUActor->GetNodeVTKID(aNodeObjId);
- aModel->setData( aModel->index(i,7), QVariant(getValue(aPntData, aNodeVTKId)), Qt::DisplayRole );
- aModel->setData( aModel->index(i,8), QVariant(getVector(aPntData, aNodeVTKId)), Qt::DisplayRole );
+//----------------------------------------------------------------------------
+int VisuGUI_Selection::nbChild( const int ind, const bool named ) const
+{
+ int cnt = 0;
+ SalomeApp_Study* aSStudy = GetStudy();
+ if ( !aSStudy )
+ return cnt;
+ _PTR(Study) aStudy = GetCStudy( aSStudy );
+ if ( aStudy ){
+ _PTR(SObject) SO = aStudy->FindObjectID( (const char*)entry( ind ).toLatin1() );
+ if ( SO ){
+ for ( _PTR(ChildIterator) Iter = aStudy->NewChildIterator( SO ); Iter->More(); Iter->Next() ) {
+ _PTR(SObject) refSO;
+ if ( !Iter->Value()->ReferencedObject( refSO ) && ( !named || Iter->Value()->GetName().size() ) )
+ cnt++;
}
- //for(int aColumnId = 0; aColumnId < 9; aColumnId++)
- myListPoints->resizeColumnsToContents();
}
- } else {
- clearFields();
}
- myFl = false;
+ return cnt;
}
-#undef ABS
-
-
-void VisuGUI_SelectionDlg::clearFields() {
- int aType = myWidgetStack->indexOf(myWidgetStack->currentWidget());
- switch (aType) {
- case 0:
- myXValLbl->setText( "" );
- myYValLbl->setText( "" );
- myZValLbl->setText( "" );
- myIValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
- myJValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
- myKValLbl->setText( "-" );//ENK: 23.11.2006 - PAL13176
- myScalarValLbl->setText("");
- myVectorValLbl->setText("");
- break;
- case 1:
- myCellScalarValLbl->setText("");
- myCellVectorValLbl->setText("");
- myListPoints->setRowCount(0);
- break;
- case 2:
- myXPosLbl->setText("");
- myYPosLbl->setText("");
- myZPosLbl->setText("");
- myDXLbl->setText("");
- myDYLbl->setText("");
- myDZLbl->setText("");
- }
+
+//----------------------------------------------------------------------------
+QString VisuGUI_Selection::nbChildren( const int ind ) const
+{
+ QString aResStr;
+ aResStr.setNum( nbChild( ind, false ) );
+ return aResStr;
+}
+
+//----------------------------------------------------------------------------
+QString VisuGUI_Selection::nbNamedChildren( const int ind ) const
+{
+ QString aResStr;
+ aResStr.setNum( nbChild( ind, true ) );
+ return aResStr;
}
-typedef vtkIdType (VISU_PipeLine::* TGetVTKIdMethod)(vtkIdType theID);
-bool onIdEdit (const QString& theText,
- TGetVTKIdMethod theMethod,
- bool theIsCell,
- const SalomeApp_Module* theModule,
- QLabel* theMeshName,
- QString theValue,
- QLabel* theFieldName)
+//----------------------------------------------------------------------------
+struct TIsVisibleFunctor: TViewFunctor
{
- SVTK_ViewWindow* aViewWindow = VISU::GetActiveViewWindow<SVTK_ViewWindow>(theModule);
- if (!aViewWindow)
- return false;
- SVTK_Selector* aSelector = aViewWindow->GetSelector();
-
- _PTR(SObject) aSObject;
- VISU::Prs3d_i* aPrs3d = NULL;
- Handle(SALOME_InteractiveObject) anIO;
-
- VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(theModule);
- if(aSelectionInfo.size() == 1){
- // Get selected SObject
- VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
- VISU::TObjectInfo anObjectInfo = aSelectionItem.myObjectInfo;
- aPrs3d = GetPrs3dFromBase(anObjectInfo.myBase);
- if(aPrs3d){
- anIO = aSelectionItem.myIO;
- aSObject = anObjectInfo.mySObject;
- }
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ return theActor->GetVisibility() ? "true" : "false";
}
- if (aPrs3d) {
- int anObjId = theText.toInt();
- VISU_PipeLine* aPipeLine = aPrs3d->GetPipeLine();
- int aVTKId = (aPipeLine->*theMethod)(anObjId);
- if(aVTKId < 0)
- return false;
-
- TColStd_MapOfInteger newIndices;
- newIndices.Add(anObjId);
- aSelector->AddOrRemoveIndex(anIO, newIndices, false);
- aViewWindow->highlight(anIO, true, true);
-
- return true;
-
- } else {
- theMeshName->setText(theValue);
- theFieldName->setText("");
+};
+
+QString VisuGUI_Selection::isVisible( const int ind ) const
+{
+ return TPopupDispatcher<TIsVisibleFunctor>()(myModule, entry(ind));
+}
+
+
+//----------------------------------------------------------------------------
+struct TIsShrunkFunctor: TViewFunctor
+{
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ return theActor->IsShrunk() ? "1" : "0";
}
- return false;
+};
+
+QString VisuGUI_Selection::isShrunk( const int ind ) const
+{
+ return TPopupDispatcher<TIsShrunkFunctor>()(myModule, entry(ind));
}
-void VisuGUI_SelectionDlg::onPointIdEdit (const QString& theText)
-{
- if (myFl) return;
- TGetVTKIdMethod aMethod = &VISU_PipeLine::GetNodeVTKID;
- bool anIsSelected = onIdEdit(theText,
- aMethod,
- false,
- myModule,
- myMeshName,
- tr("WRN_NO_AVAILABLE_DATA"),
- myFieldName);
- if (anIsSelected)
- // as selection manager doesn't send signal currentSelectionChanged()
- onSelectionEvent();
- else
- clearFields();
+
+//----------------------------------------------------------------------------
+QString VisuGUI_Selection::hasActor( const int ind ) const
+{
+ return representation( ind ).isEmpty() ? "0" : "1";
}
-void VisuGUI_SelectionDlg::onCellIdEdit (const QString& theText)
-{
- if (myFl) return;
- TGetVTKIdMethod aMethod = &VISU_PipeLine::GetElemVTKID;
- bool anIsSelected = onIdEdit(theText,
- aMethod,
- true,
- myModule,
- myMeshName,
- tr("WRN_NO_AVAILABLE_DATA"),
- myFieldName);
- if (anIsSelected)
- // as selection manager doesn't send signal currentSelectionChanged()
- onSelectionEvent();
- else
- clearFields();
+
+//----------------------------------------------------------------------------
+struct TIsShadingFunctor: TViewFunctor
+{
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor))
+ return anActor->IsShading() ? "1" : "0";
+ return QString();
+ }
+};
+
+QString VisuGUI_Selection::isShading( const int ind ) const
+{
+ return TPopupDispatcher<TIsShadingFunctor>()(myModule, entry(ind));
}
-void VisuGUI_SelectionDlg::onHelp()
-{
- QString aHelpFileName = "selection_info_page.html";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(myModule ? app->moduleName(myModule->moduleName()) : QString(""), aHelpFileName);
- else {
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
+
+//----------------------------------------------------------------------------
+struct TIsScalarMapActFunctor: TViewFunctor
+{
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ return dynamic_cast<VISU_ScalarMapAct*>(theActor)? "1" : "0";
}
+};
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::isScalarMapAct( const int ind ) const
+{
+ return TPopupDispatcher<TIsScalarMapActFunctor>()(myModule, entry(ind));
}
-void VisuGUI_SelectionDlg::keyPressEvent( QKeyEvent* e )
+
+//----------------------------------------------------------------------------
+bool VisuGUI_Selection::isVisuComponent( const int ind ) const
{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
+ SalomeApp_Study* study = GetStudy();
+ if ( !study )
+ return false;
+
+ _PTR(SObject) obj = study->studyDS()->FindObjectID( (const char*)entry( ind ).toLatin1() );
+ if ( !obj )
+ return false;
+ CORBA::Object_var anObj = VISU::ClientSObjectToObject( obj );
+ if( CORBA::is_nil( anObj ) )
+ return false;
- if ( e->key() == Qt::Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ return dynamic_cast<VISU::VISU_Gen_i*>( VISU::GetServant( anObj ).in() );
}
+
+//----------------------------------------------------------------------------
+struct TIsValuesLabeled : TViewFunctor
+{
+ QString
+ virtual
+ get(VISU::Prs3d_i* thePrs3d,
+ SVTK_ViewWindow* theViewWindow,
+ VISU_Actor* theActor)
+ {
+ return theActor && theActor->GetValuesLabeled() ? "true" : "false";
+ }
+};
+
+QString VisuGUI_Selection::isValuesLabeled( const int ind ) const
+{
+ return TPopupDispatcher<TIsValuesLabeled>()(myModule, entry(ind));
+}
+
// VISU VISUGUI : GUI of VISU component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// 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
//
//
// File : VisuGUI_Selection.h
-// Author : Laurent CORNABE & Hubert ROLLAND
+// Author : Sergey Anikin
// Module : VISU
-// $Header$
#ifndef VisuGUI_Selection_HeaderFile
#define VisuGUI_Selection_HeaderFile
-#include <QDialog>
+#include <LightApp_Selection.h>
-class QLabel;
-class QStackedWidget;
-//class QVBox;
-class QLineEdit;
-class QTableWidget;
-class LightApp_SelectionMgr;
-class SalomeApp_Application;
-class SalomeApp_Module;
+//////////////////////////////////////////////////
+// Class: VisuGUI_Selection
+//////////////////////////////////////////////////
-class VisuGUI_SelectionDlg: public QDialog {
- Q_OBJECT
+class SalomeApp_Module;
+class SalomeApp_Study;
+class VisuGUI_Selection : public LightApp_Selection
+{
public:
- VisuGUI_SelectionDlg (const SalomeApp_Module* theModule);
- virtual ~VisuGUI_SelectionDlg ();
-
-private:
- void keyPressEvent( QKeyEvent* e );
-
-protected:
- void closeEvent (QCloseEvent* theEvent);
-
-private slots:
- void onSelectionChange (int theId);
- void onSelectionEvent ();
- void onPointIdEdit (const QString& theText);
- void onCellIdEdit (const QString& theText);
- void onHelp();
+ VisuGUI_Selection( SalomeApp_Module* theModule )
+ : LightApp_Selection(), myModule( theModule ) {};
+ virtual ~VisuGUI_Selection() {};
- private:
- void clearFields ();
+ virtual QVariant parameter( const int, const QString& ) const;
- QLabel* myMeshName;
- QLabel* myFieldName;
-
- QStackedWidget* myWidgetStack;
- QWidget* myPointsPane;
- QWidget* myCellsPane;
- QLabel* myXValLbl;
- QLabel* myYValLbl;
- QLabel* myZValLbl;
- //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
- QLabel* myIValLbl; //!< used for structured mesh selection
- QLabel* myJValLbl; //!< used for structured mesh selection
- QLabel* myKValLbl; //!< used for structured mesh selection
- //ENK: 23.11.2006
-
- QLineEdit* myIDValLbl;
- QLabel* myScalarValLbl;
- QLabel* myVectorValLbl;
+private:
+ QString type( const int ) const;
+ QString nbComponents( const int ) const;
+ QString medEntity( const int ) const;
+ QString medSource( const int ) const;
+ QString nbTimeStamps( const int ) const;
+ QString representation( const int ) const;
+ QString nbChildren( const int ) const;
+ QString nbNamedChildren( const int ) const;
+ QString isVisible( const int ) const;
+ QString isShrunk( const int ) const;
+ QString hasActor( const int ) const;
+ QString isShading( const int ) const;
+ QString isScalarMapAct( const int ) const;
+ bool isVisuComponent( const int ) const;
+ QString isValuesLabeled( const int ) const;
+
+ QString fullResolution( const int ) const;
+ QString mediumResolution( const int ) const;
+ QString lowResolution( const int ) const;
+ QString resolutionState( const int ) const;
- QTableWidget* myListPoints;
- QLineEdit* myCellIDValLbl;
- QLabel* myCellScalarValLbl;
- QLabel* myCellVectorValLbl;
+private:
+ int nbChild( const int, const bool ) const;
+ SalomeApp_Study* GetStudy() const;
- QWidget* myActorsPane;
- QLabel* myXPosLbl;
- QLabel* myYPosLbl;
- QLabel* myZPosLbl;
- QLabel* myDXLbl;
- QLabel* myDYLbl;
- QLabel* myDZLbl;
+ QString resolutions( const int ) const;
+ QString resolution( const int, char theResoltuion ) const;
- const SalomeApp_Module* myModule;
- LightApp_SelectionMgr* mySelectionMgr;
- bool myFl;
+private:
+ SalomeApp_Module* myModule;
};
#endif
#include "VISU_Actor.h"
-#include "VVTK_MainWindow.h"
-#include "VVTK_ViewWindow.h"
-
#include "VISU_Gen_i.hh"
-#include "VisuGUI_Module.h"
+#include "VisuGUI.h"
#include "VisuGUI_Tools.h"
#include "VisuGUI_Prs3dTools.h"
#include "VTKViewer_Algorithm.h"
#include "SVTK_Functor.h"
+#include "QtxDockWidget.h"
+#include "QtxDoubleSpinBox.h"
+
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
+#include <QMainWindow>
#include <QComboBox>
#include <QFont>
#include <QLabel>
#include <QToolTip>
#include <QSlider>
#include <QSpinBox>
+#include <QGroupBox>
+#include <QCheckBox>
+#include <QRadioButton>
#include <QTimer>
+#include <QAction>
+
+using namespace std;
/*!
Constructor
*/
-VisuGUI_Slider::VisuGUI_Slider( VisuGUI_Module* theModule,
- VVTK_ViewWindow* theViewWindow,
+VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
+ QMainWindow* theParent,
LightApp_SelectionMgr* theSelectionMgr )
- : QtxToolBar( tr("TOOLBAR_TITLE"), theViewWindow->getMainWindow1() ),
- myModule( theModule ),
- myMainWindow( theViewWindow->getMainWindow1() ),
- mySelectionMgr( theSelectionMgr )
+ : QWidget( theParent )
+ , myViewManager( VISU::GetVisuGen( theModule )->GetViewManager() )
+ , mySelectionMgr( theSelectionMgr )
+ , myModule( theModule )
{
- //setLabel();
- //setCloseMode(QDockWindow::Undocked);
- setMovable( true );
-
- VISU::ViewManager_var aViewManager = VISU::GetVisuGen( myModule )->GetViewManager();
- VISU::View_var aView = aViewManager->GetCurrentView();
- if(!CORBA::is_nil(aView.in()))
- myView3D = VISU::View3D::_narrow(aView);
+ setWindowTitle( tr("TITLE") );
+ setObjectName( tr("TITLE") );
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- //setHorizontallyStretchable( true );
-
- QWidget* aWidget = new QWidget( this );
- aWidget->setFocusPolicy(Qt::StrongFocus);
- myWidgetAction = addWidget( aWidget );
-
- QGridLayout* aLayout = new QGridLayout( aWidget );
- aLayout->setMargin( 11 );
- aLayout->setSpacing( 6 );
-
- // Slider and time stamps
- myFirstTimeStamp = new QLabel( aWidget );
- myFirstTimeStamp->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- aLayout->addWidget( myFirstTimeStamp, 0, 0, Qt::AlignHCenter );
-
- mySlider = new QSlider( aWidget );
- mySlider->setMinimum( 0 );
- mySlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- mySlider->setOrientation( Qt::Horizontal );
- mySlider->setTracking( false );
- mySlider->setFocusPolicy(Qt::StrongFocus);
- aLayout->addWidget( mySlider, 0, 1, 1, 8 );
-
- myLastTimeStamp = new QLabel( aWidget );
- myLastTimeStamp->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- aLayout->addWidget( myLastTimeStamp, 0, 9, Qt::AlignHCenter );
-
- myTimeStampsNumber = new QLabel( aWidget );
- myTimeStampsNumber->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- aLayout->addWidget( myTimeStampsNumber, 0, 10, Qt::AlignHCenter );
-
- QLabel* aCacheMemoryLabel = new QLabel( tr( "CACHE_MEMORY" ), aWidget );
- aCacheMemoryLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- aLayout->addWidget( aCacheMemoryLabel, 0, 11 );
-
- myCacheMemory = new QLabel( aWidget );
- myCacheMemory->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- QFontMetrics fm( myCacheMemory->font() );
- myCacheMemory->setFixedWidth( fm.width( "9.99E+99 Mb" ) );
-
- aLayout->addWidget( myCacheMemory, 0, 12 );
-
- // Buttons
-#ifdef ENABLE_AVI_AND_MORE_BUTTONS
- myMoreButton = new QToolButton( aWidget );
- myMoreButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- myMoreButton->setEnabled( false );
- myMoreButton->setCheckble( true );
- myMoreButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_MORE" ) ) );
- QToolTip::add( myMoreButton, tr( "MORE" ) );
- aLayout->addWidget( myMoreButton, 1, 0 );
-
- myAVIButton = new QToolButton( aWidget );
- myAVIButton->setEnabled( false );
- myAVIButton->setCheckble( true );
- myAVIButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_AVI" ) ) );
- QToolTip::add( myAVIButton, tr( "AVI" ) );
- aLayout->addWidget( myAVIButton, 1, 1 );
-#endif
-
- aLayout->addItem( new QSpacerItem( 24, 24, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 2 );
-
- myFirstButton = new QToolButton( aWidget );
- myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
- aLayout->addWidget( myFirstButton, 1, 3 );
-
- myPreviousButton = new QToolButton( aWidget );
- myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
- aLayout->addWidget( myPreviousButton, 1, 4 );
-
- myPlayButton = new QToolButton( aWidget );
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
- myPlayButton->setCheckable( true );
- aLayout->addWidget( myPlayButton, 1, 5 );
-
- myNextButton = new QToolButton( aWidget );
- myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
- aLayout->addWidget( myNextButton, 1, 6 );
-
- myLastButton = new QToolButton( aWidget );
- myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
- aLayout->addWidget( myLastButton, 1, 7 );
-
- aLayout->addItem( new QSpacerItem( 24, 24, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 8 );
-
- myTimeStampStrings = new QComboBox( aWidget );
- myTimeStampStrings->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- myTimeStampStrings->setFocusPolicy(Qt::StrongFocus);
- aLayout->addWidget( myTimeStampStrings, 1, 9 );
-
- myTimeStampIndices = new QComboBox( aWidget );
- myTimeStampIndices->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- myTimeStampIndices->setFocusPolicy(Qt::StrongFocus);
- aLayout->addWidget( myTimeStampIndices, 1, 10 );
-
- // Speed
- QLabel* aSpeedLabel = new QLabel( tr( "SPEED" ), aWidget );
- aSpeedLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- aLayout->addWidget( aSpeedLabel, 1, 11 );
-
- mySpeedBox = new QSpinBox( aWidget );
- mySpeedBox->setMinimum( 1 );
- mySpeedBox->setMaximum( 100 );
- mySpeedBox->setSingleStep( 1 );
- mySpeedBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
- mySpeedBox->setFocusPolicy(Qt::StrongFocus);
- mySpeedBox->setValue( 50 );
- aLayout->addWidget( mySpeedBox, 1, 12 );
+ //----------------------------------------------------------------------------
+ QVBoxLayout* aVBoxLayout = new QVBoxLayout( this );
+
+ QTabWidget* aTabWidget = new QTabWidget( this );
+ aTabWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+
+ aVBoxLayout->addWidget( aTabWidget );
+
+ {
+ QWidget* aParent = new QWidget();
+ {
+ QGridLayout* aGridLayout = new QGridLayout( aParent );
+ {
+ myFirstTimeStamp = new QLabel( aParent );
+ myFirstTimeStamp->setAlignment( Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter );
+ myFirstTimeStamp->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myFirstTimeStamp, 0, 0, 1, 1 );
+
+ mySlider = new QSlider( aParent );
+ mySlider->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ mySlider->setFocusPolicy( Qt::StrongFocus );
+ mySlider->setOrientation( Qt::Horizontal );
+ mySlider->setTracking( false );
+ mySlider->setMinimum( 0 );
+ aGridLayout->addWidget( mySlider, 0, 1, 1, 3 );
+
+ myLastTimeStamp = new QLabel( aParent );
+ aGridLayout->addWidget( myLastTimeStamp, 0, 4, 1, 1 );
+ }
+ {
+ myFirstButton = new QToolButton( aParent );
+ myFirstButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_FIRST" ) ) );
+ myFirstButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myFirstButton, 1, 0, 1, 1 );
+
+ myPreviousButton = new QToolButton( aParent );
+ myPreviousButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PREVIOUS" ) ) );
+ myPreviousButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myPreviousButton, 1, 1, 1, 1 );
+
+ myPlayButton = new QToolButton( aParent );
+ myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+ myPlayButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myPlayButton->setCheckable( true );
+ aGridLayout->addWidget( myPlayButton, 1, 2, 1, 1 );
+
+ myNextButton = new QToolButton( aParent );
+ myNextButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_NEXT" ) ) );
+ myNextButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myNextButton, 1, 3, 1, 1 );
+
+ myLastButton = new QToolButton( aParent );
+ myLastButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_LAST" ) ) );
+ myLastButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ aGridLayout->addWidget( myLastButton, 1, 4, 1, 1 );
+ }
+ {
+ myTimeStampIndexes = new QComboBox( aParent );
+ myTimeStampIndexes->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myTimeStampIndexes->setFocusPolicy( Qt::StrongFocus );
+ aGridLayout->addWidget( myTimeStampIndexes, 2, 0, 1, 2 );
+
+ myIsCycled = new QToolButton( aParent );
+ myIsCycled->setText( tr( "IS_CYCLED" ) );
+ myIsCycled->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myIsCycled->setLayoutDirection( Qt::LeftToRight );
+ myIsCycled->setCheckable( true );
+ //myIsCycled->setEnabled( false );
+ aGridLayout->addWidget( myIsCycled, 2, 2, 1, 1 );
+
+ myTimeStampStrings = new QComboBox( aParent );
+ myTimeStampStrings->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
+ myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
+ aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
+ }
+ }
+
+ aTabWidget->addTab( aParent, tr( "NAVIGATION_TAB" ) );
+ myPlayTab = aParent;
+ }
+
+ {
+ QWidget* aParent = new QWidget();
+ {
+ QVBoxLayout* aVBoxLayout = new QVBoxLayout( aParent );
+ {
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ myMinimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aParent );
+ aHBoxLayout->addWidget( myMinimalMemoryButton );
+
+ QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ aHBoxLayout->addItem( aSpacerItem );
+
+ myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aParent );
+ myLimitedMemoryButton->setChecked( true );
+ aHBoxLayout->addWidget( myLimitedMemoryButton );
+
+ myLimitedMemory = new QtxDoubleSpinBox( aParent );
+ myLimitedMemory->setMaximum( 10000 );
+ myLimitedMemory->setValue( 512 );
+ aHBoxLayout->addWidget( myLimitedMemory );
+
+ QLabel* aMemoryDimensionLabel = new QLabel( aParent );
+ aMemoryDimensionLabel->setText( tr( "MEMORY_UNITS" ) );
+ aHBoxLayout->addWidget( aMemoryDimensionLabel );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
+ }
+ {
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aParent );
+ aUsedMemoryLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aHBoxLayout->addWidget( aUsedMemoryLabel );
+
+ myUsedMemory = new QLineEdit( aParent );
+ myUsedMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+ //myUsedMemory->setEnabled( false );
+ aHBoxLayout->addWidget( myUsedMemory );
+
+ QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ aHBoxLayout->addItem( aSpacerItem );
+
+ QLabel* aFreeMemoryLabel = new QLabel( tr( "AVAILABLE_MEMORY" ), aParent );
+ aHBoxLayout->addWidget( aFreeMemoryLabel );
+
+ myFreeMemory = new QLineEdit( aParent );
+ myFreeMemory->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+ //myFreeMemory->setEnabled( false );
+ aHBoxLayout->addWidget( myFreeMemory );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
+ }
+ {
+ QHBoxLayout* aHBoxLayout = new QHBoxLayout();
+
+ QLabel* aLabel = new QLabel( tr( "SPEED" ), aParent );
+ aLabel->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ aHBoxLayout->addWidget( aLabel );
+
+ mySpeedSlider = new QSlider( aParent );
+ mySpeedSlider->setMinimum( 1 );
+ mySpeedSlider->setMaximum( 100 );
+ mySpeedSlider->setValue( mySpeedSlider->maximum() / 2 );
+ mySpeedSlider->setPageStep( mySpeedSlider->maximum() / 5 );
+ mySpeedSlider->setTickInterval( mySpeedSlider->pageStep() );
+ mySpeedSlider->setOrientation( Qt::Horizontal );
+ mySpeedSlider->setTickPosition( QSlider::TicksBelow );
+ aHBoxLayout->addWidget( mySpeedSlider );
+
+ aVBoxLayout->addLayout( aHBoxLayout );
+ }
+
+ aTabWidget->addTab( aParent, tr( "PROPERTIES_TAB" ) );
+ }
+ }
+
+ {
+ QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ aVBoxLayout->addItem( aSpacerItem );
+ }
+
+
+ //----------------------------------------------------------------------------
+ myPlayPixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) );
+ myPausePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) );
myTimer = new QTimer( this );
// Common
+ connect( theModule, SIGNAL( moduleDeactivated() ), SLOT( onModuleDeactivated() ) );
+
+ connect( theModule, SIGNAL( moduleActivated() ), SLOT( onModuleActivated() ) );
+
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( onSelectionChanged() ) );
connect( myTimeStampStrings, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
- connect( myTimeStampIndices, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
+ connect( myTimeStampIndexes, SIGNAL( activated( int ) ), SLOT( onTimeStampActivated( int ) ) );
connect( myFirstButton, SIGNAL( clicked() ), SLOT( onFirst() ) );
connect( myPreviousButton, SIGNAL( clicked() ), SLOT( onPrevious() ) );
connect( mySlider, SIGNAL( valueChanged( int ) ), SLOT( onValueChanged( int ) ) );
- connect( mySpeedBox, SIGNAL( valueChanged( int ) ), SLOT( onSpeedChanged( int ) ) );
+ connect( mySpeedSlider, SIGNAL( valueChanged( int ) ), SLOT( onSpeedChanged( int ) ) );
connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) );
+ //----------------------------------------------------------------------------
+ connect( myLimitedMemoryButton, SIGNAL( toggled( bool ) ), this, SLOT( onMemoryModeChanged( bool ) ) );
+ connect( myLimitedMemory, SIGNAL( valueChanged( double ) ), this, SLOT( onMemorySizeChanged( double ) ) );
+
+ //----------------------------------------------------------------------------
enableControls( false );
- myMainWindow->addToolBar( Qt::BottomToolBarArea, this );
+ QtxDockWidget* aQtxDockWidget = new QtxDockWidget( true, theParent );
+ theParent->addDockWidget( Qt::BottomDockWidgetArea , aQtxDockWidget );
+ aQtxDockWidget->setObjectName( objectName() );
+ aQtxDockWidget->setWidget( this );
+
+ myToggleViewAction = aQtxDockWidget->toggleViewAction();
+ myToggleViewAction->setIcon( QIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PANEL" ) ) ) );
+ myToggleViewAction->setToolTip( tr( "MEN_SLIDER_PANE" ) );
+ myToggleViewAction->setText( tr( "MEN_SLIDER_PANE" ) );
+ myToggleViewAction->setCheckable( true );
+ aQtxDockWidget->setVisible( false );
+
+ connect( myToggleViewAction, SIGNAL( toggled( bool ) ), this, SLOT( onToggleView( bool ) ) );
}
-/*!
- Destructor
-*/
+
+//----------------------------------------------------------------------------
VisuGUI_Slider::~VisuGUI_Slider()
{
}
+
+//----------------------------------------------------------------------------
+QAction* VisuGUI_Slider::toggleViewAction()
+{
+ return myToggleViewAction;
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Slider::onModuleDeactivated()
+{
+ setHidden( true );
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Slider::onModuleActivated()
+{
+ setHidden( false );
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Slider::onMemoryModeChanged( bool )
+{
+ using namespace VISU;
+ SALOMEDS::Study_var aStudy = GetDSStudy( GetCStudy( GetAppStudy( myModule ) ) );
+ VISU::ColoredPrs3dCache_var aCache = GetVisuGen( myModule )->GetColoredPrs3dCache( aStudy );
+
+ if ( myLimitedMemoryButton->isChecked() ) {
+ aCache->SetMemoryMode( VISU::ColoredPrs3dCache::LIMITED );
+ aCache->SetLimitedMemory( myLimitedMemory->value() );
+ } else
+ aCache->SetMemoryMode( VISU::ColoredPrs3dCache::MINIMAL );
+
+ myLimitedMemory->setEnabled( myLimitedMemoryButton->isChecked() );
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Slider::onMemorySizeChanged( double )
+{
+ onMemoryModeChanged( myLimitedMemoryButton->isChecked() );
+}
+
+
+//----------------------------------------------------------------------------
bool VisuGUI_Slider::checkHolderList()
{
THolderList aHolderList;
return myHolderList.empty();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::enableControls( bool on )
{
- widgetForAction( myWidgetAction )->setEnabled( on );
+ myPlayTab->setEnabled( on );
+
if( on )
{
if( checkHolderList() )
return;
myTimeStampStrings->clear();
- myTimeStampIndices->clear();
+ myTimeStampIndexes->clear();
VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
myFirstTimeStamp->setText( aTimeStampsRange[0].myTime.in() );
myLastTimeStamp->setText( aTimeStampsRange[aLength-1].myTime.in() );
- myTimeStampsNumber->setText( QString("(") + QString::number( aLength ) + ")" );
int aPageStep = aLength / 10;
aPageStep = std::max(aPageStep, 1);
QString aTime = anInfo.myTime.in();
myTimeStampStrings->addItem( aTime );
- myTimeStampIndices->addItem( QString::number( aNumber ) );
+ myTimeStampIndexes->addItem( QString::number( aNumber ) );
if( aNumber == aTimeStampNumber )
a_current_index = an_index;
myTimeStampStrings->setFont(myTimeStampStrings->font());
myTimeStampStrings->updateGeometry();
- myTimeStampIndices->setFont(myTimeStampStrings->font());
- myTimeStampIndices->updateGeometry();
+ myTimeStampIndexes->setFont(myTimeStampStrings->font());
+ myTimeStampIndexes->updateGeometry();
if( a_current_index > mySlider->maximum() )
mySlider->setMaximum( aLength-1 );
myTimeStampStrings->setCurrentIndex( a_current_index );
- myTimeStampIndices->setCurrentIndex( a_current_index );
+ myTimeStampIndexes->setCurrentIndex( a_current_index );
mySlider->setValue( a_current_index );
if( a_current_index <= mySlider->maximum() )
mySlider->setMaximum( aLength-1 );
+
+ using namespace VISU;
+ SALOMEDS::Study_var aStudy = GetDSStudy( GetCStudy( GetAppStudy( myModule ) ) );
+ VISU::ColoredPrs3dCache_var aCache = GetVisuGen( myModule )->GetColoredPrs3dCache( aStudy );
+
+ long aMb = 1024 * 1024;
+ double aLimitedMemory = aCache->GetLimitedMemory();
+ myLimitedMemory->setValue( aLimitedMemory );
+
+ double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
+ double anUsedMemory = aCache->GetMemorySize();
+ double aLimitedMemoryMax = max( anUsedMemory + aFreeMemory, aLimitedMemory );
+ myLimitedMemory->setMaximum( aLimitedMemoryMax );
}
else
{
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::updateMemoryState()
{
if( checkHolderList() )
return;
VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
-
VISU::ColoredPrs3dCache_var aCache = aHolder->GetCache();
+
CORBA::Float aCacheMemory = aCache->GetMemorySize();
- myCacheMemory->setText( QString::number( double( aCacheMemory ), 'E', 2 ) + " Mb" );
+ myUsedMemory->setText( QString::number( double( aCacheMemory ), 'E', 2 ) + " Mb" );
+ myUsedMemory->setFont( myUsedMemory->font() );
+ myUsedMemory->updateGeometry();
+
+
+ long aMb = 1024 * 1024;
+ double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
+ myFreeMemory->setText( QString::number( double( aFreeMemory ), 'E', 2 ) + " Mb" );
+ myFreeMemory->setFont( myFreeMemory->font() );
+ myFreeMemory->updateGeometry();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onSelectionChanged()
{
//cout << "VisuGUI_Slider::onSelectionChanged()" << endl;
}
}
- enableControls( !checkHolderList() );
+ VISU::View_var aView = myViewManager->GetCurrentView();
+
+ enableControls( !checkHolderList() && !CORBA::is_nil( aView.in() ) );
+
updateMemoryState();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onTimeStampActivated( int value )
{
mySlider->setValue( value );
onValueChanged( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onFirst()
{
int value = mySlider->minimum();
mySlider->setValue( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onPrevious()
{
int value = mySlider->value() - 1;
mySlider->setValue( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onPlay( bool on )
{
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
if( on )
{
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) ) );
+ myPlayButton->setIcon( myPausePixmap );
- int delay = int(5000.0 / double(mySpeedBox->value()));
+ int delay = int( 50.0 * mySpeedSlider->maximum() / mySpeedSlider->value() );
myTimer->start( delay );
}
else
{
myTimer->stop();
- myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+ myPlayButton->setIcon( myPlayPixmap );
+ }
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Slider::onToggleView( bool on )
+{
+ if ( !on ) {
+ onPlay( on );
}
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onNext()
{
int value = mySlider->value() + 1;
mySlider->setValue( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onLast()
{
int value = mySlider->maximum();
mySlider->setValue( value );
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onValueChanged( int value )
{
- if( checkHolderList() ){
+ if ( checkHolderList() ) {
enableControls( false );
return;
}
myTimeStampStrings->setCurrentIndex( value );
- myTimeStampIndices->setCurrentIndex( value );
+ myTimeStampIndexes->setCurrentIndex( value );
VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front();
VISU::ColoredPrs3dHolder::TimeStampsRange_var aTimeStampsRange = aHolder->GetTimeStampsRange();
CORBA::Long aLength = aTimeStampsRange->length();
- if(value < 0 || aLength <= value)
+ if ( value < 0 || aLength <= value )
return;
VISU::ColoredPrs3dHolder::BasicInput_var anInput = aHolder->GetBasicInput();
CORBA::Long aTimeStampNumber = anInput->myTimeStampNumber;
CORBA::Long aNumber = aTimeStampsRange[ value ].myNumber;
- if(aNumber == aTimeStampNumber)
+ if ( aNumber == aTimeStampNumber )
+ return;
+
+ VISU::View_var aView = myViewManager->GetCurrentView();
+ if ( CORBA::is_nil( aView.in() ) ) {
+ enableControls( false );
return;
+ }
+
+ VISU::View3D_var aView3D = VISU::View3D::_narrow( aView );
THolderList::const_iterator anIter = myHolderList.begin();
THolderList::const_iterator anIterEnd = myHolderList.end();
QApplication::setOverrideCursor(Qt::WaitCursor);
- aHolder->Apply( aPrs3d, anInput, myView3D );
+ aHolder->Apply( aPrs3d, anInput, aView3D );
QApplication::restoreOverrideCursor();
}
+ aView3D->Destroy();
+
updateMemoryState();
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onSpeedChanged( int value )
{
if(myPlayButton->isChecked()){
- int delay = int(5000.0 / double(mySpeedBox->value()));
+ int delay = int( 50.0 * mySpeedSlider->maximum() / mySpeedSlider->value() );
myTimer->start( delay );
}
}
+
+//----------------------------------------------------------------------------
void VisuGUI_Slider::onTimeout()
{
int value = mySlider->value();
- if( value < mySlider->maximum() )
+ if ( value < mySlider->maximum() ) {
onNext();
- else
- myPlayButton->setChecked( false );
+ } else {
+ if ( myIsCycled->isChecked() )
+ onFirst();
+ else
+ myPlayButton->setChecked( false );
+ }
}
+
+
+//----------------------------------------------------------------------------
#ifndef VisuGUI_Slider_HeaderFile
#define VisuGUI_Slider_HeaderFile
-#include "QtxToolBar.h"
+#include <QWidget>
+#include <QPixmap>
+
#include <vector>
#include "SALOMEconfig.h"
class QToolButton;
class QSlider;
class QSpinBox;
+class QCheckBox;
+class QRadioButton;
+class QMainWindow;
class QTimer;
class QAction;
-class VVTK_ViewWindow;
-class VVTK_MainWindow;
+class QtxDoubleSpinBox;
class LightApp_SelectionMgr;
+class VisuGUI;
-class VisuGUI_Module;
-
-class VisuGUI_Slider : public QtxToolBar
+class VisuGUI_Slider : public QWidget
{
- Q_OBJECT
+ Q_OBJECT;
public:
- VisuGUI_Slider( VisuGUI_Module* theModule,
- VVTK_ViewWindow* theViewWindow,
+ VisuGUI_Slider( VisuGUI* theModule,
+ QMainWindow* theParent,
LightApp_SelectionMgr* theSelectionMgr );
+
virtual ~VisuGUI_Slider();
+
+ QAction* toggleViewAction();
public slots:
virtual void onSelectionChanged();
virtual void onTimeout();
+ virtual void onToggleView( bool );
+
+ void onMemoryModeChanged( bool );
+ void onMemorySizeChanged( double );
+
+protected slots:
+ void onModuleDeactivated();
+ void onModuleActivated();
+
protected:
virtual void enableControls( bool );
virtual void updateMemoryState();
virtual bool checkHolderList();
private:
- VisuGUI_Module* myModule;
- VVTK_MainWindow* myMainWindow;
LightApp_SelectionMgr* mySelectionMgr;
- VISU::View3D_var myView3D;
+ VISU::ViewManager_var myViewManager;
+ VisuGUI* myModule;
QSlider* mySlider;
QLabel* myFirstTimeStamp;
QLabel* myLastTimeStamp;
- QLabel* myTimeStampsNumber;
- QLabel* myCacheMemory;
-
-#ifdef ENABLE_AVI_AND_MORE_BUTTONS
- QToolButton* myMoreButton;
- QToolButton* myAVIButton;
-#endif
+ QWidget* myPlayTab;
+ QToolButton* myIsCycled;
QToolButton* myFirstButton;
QToolButton* myPreviousButton;
QToolButton* myPlayButton;
QToolButton* myLastButton;
QComboBox* myTimeStampStrings;
- QComboBox* myTimeStampIndices;
+ QComboBox* myTimeStampIndexes;
+
+ QSlider* mySpeedSlider;
- QSpinBox* mySpeedBox;
+ QRadioButton* myMinimalMemoryButton;
+ QRadioButton* myLimitedMemoryButton;
+ QtxDoubleSpinBox* myLimitedMemory;
- QTimer* myTimer;
+ QLineEdit* myUsedMemory;
+ QLineEdit* myFreeMemory;
typedef std::vector<VISU::ColoredPrs3dHolder_var> THolderList;
- THolderList myHolderList;
+ THolderList myHolderList;
- QAction* myWidgetAction;
+ QTimer* myTimer;
+ QPixmap myPlayPixmap;
+ QPixmap myPausePixmap;
+ QAction* myToggleViewAction;
};
#endif
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VisuGUI_Table3dDlg.cxx
-// Author : Laurent CORNABE & Hubert ROLLAND
-//
-
-#include "VisuGUI_Table3dDlg.h"
-
-#include "VisuGUI.h"
-#include "VisuGUI_Tools.h"
-#include "VisuGUI_ViewTools.h"
-#include "VisuGUI_InputPane.h"
-
-#include "VISU_ColoredPrs3dFactory.hh"
-#include "VISU_ViewManager_i.hh"
-
-#include <SVTK_ViewWindow.h>
-#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 <SVTK_FontWidget.h>
-#include <QtxDoubleSpinBox.h>
-
-#include <QGridLayout>
-#include <QHBoxLayout>
-#include <QVBoxLayout>
-#include <QTabWidget>
-#include <QRadioButton>
-#include <QSpinBox>
-#include <QCheckBox>
-#include <QLabel>
-#include <QPushButton>
-#include <QButtonGroup>
-#include <QGroupBox>
-#include <QLineEdit>
-
-#define SURFACE_PRS_ID 0
-#define CONTOUR_PRS_ID 1
-
-//=======================================================================
-//function : VisuGUI_Table3DPane
-//purpose :
-//=======================================================================
-VisuGUI_Table3DPane::VisuGUI_Table3DPane( QWidget* parent )
- : QWidget( parent ),
- myViewWindow( VISU::GetActiveViewWindow<SVTK_ViewWindow>() ),
- myPrs( 0 ),
- myInitFromPrs( false )
-{
- QGridLayout* topLayout = new QGridLayout( this );
- topLayout->setMargin( 11 );
- topLayout->setSpacing( 6 );
-
- // scale
- QLabel* scaleLabel = new QLabel( tr( "SCALE" ), this );
- ScaleSpn = new QtxDoubleSpinBox( -1.e6, 1.e6, 0.1, this );
- // Presentation type
- GBPrsTypeBox = new QGroupBox( tr( "PRESENTATION_TYPE" ), this );
- GBPrsType = new QButtonGroup( GBPrsTypeBox );
- QRadioButton* rb1 = new QRadioButton( tr( "SURFACE" ), GBPrsTypeBox );
- QRadioButton* rb2 = new QRadioButton( tr( "CONTOUR" ), GBPrsTypeBox );
- GBPrsType->addButton( rb1, SURFACE_PRS_ID );
- GBPrsType->addButton( rb2, CONTOUR_PRS_ID );
- QHBoxLayout* GBPrsTypeBoxLayout = new QHBoxLayout( GBPrsTypeBox );
- GBPrsTypeBoxLayout->setMargin( 11 );
- GBPrsTypeBoxLayout->setSpacing( 6 );
- GBPrsTypeBoxLayout->addWidget( rb1 );
- GBPrsTypeBoxLayout->addWidget( rb2 );
-
- // nb Contours
- QLabel* nbContLabel = new QLabel( tr( "NUMBER_CONTOURS" ), this );
- NbContoursSpn = new QSpinBox( this );
- NbContoursSpn->setMinimum( 1 );
- NbContoursSpn->setMaximum( 999 );
- NbContoursSpn->setSingleStep( 1 );
-
- topLayout->addWidget( scaleLabel, 0, 0 );
- topLayout->addWidget( ScaleSpn, 0, 1 );
- topLayout->addWidget( GBPrsTypeBox, 1, 0, 1, 2 );
- topLayout->addWidget( nbContLabel, 2, 0 );
- topLayout->addWidget( NbContoursSpn, 2, 1 );
- topLayout->setRowStretch( 3, 5 );
-
- // signals and slots connections
-
- connect( GBPrsType, SIGNAL( buttonClicked( int ) ), this, SLOT( onPrsType( int ) ) );
-}
-
-//=======================================================================
-//function : destructor
-//purpose :
-//=======================================================================
-VisuGUI_Table3DPane::~VisuGUI_Table3DPane()
-{
-}
-
-//=======================================================================
-//function : onPrsType
-//purpose :
-//=======================================================================
-void VisuGUI_Table3DPane::onPrsType( int id )
-{
- NbContoursSpn->setEnabled( id == CONTOUR_PRS_ID );
-}
-
-//=======================================================================
-//function : storeToPrsObject
-//purpose :
-//=======================================================================
-int VisuGUI_Table3DPane::storeToPrsObject( VISU::PointMap3d_i* thePrs )
-{
- // scale
- thePrs->SetScaleFactor( ScaleSpn->value() );
-
- // prs type
- thePrs->SetContourPrs( GBPrsType->checkedId() == CONTOUR_PRS_ID );
-
- // nb contours
- thePrs->SetNbOfContours( NbContoursSpn->value() );
-
- return 1;
-}
-
-//=======================================================================
-//function : GetPrs
-//purpose :
-//=======================================================================
-VISU::PointMap3d_i* VisuGUI_Table3DPane::GetPrs()
-{
- return myPrs;
-}
-
-//=======================================================================
-//function : initFromPrsObject
-//purpose :
-//=======================================================================
-void VisuGUI_Table3DPane::initFromPrsObject( VISU::PointMap3d_i* thePrs )
-{
- myInitFromPrs = true;
- myPrs = thePrs;
-
- // scale
- double aScale = thePrs->GetScaleFactor();
- if (aScale<0)
- aScale = 0;
- ScaleSpn->setValue( aScale );
-
- // prs type
- int id = thePrs->GetIsContourPrs() ? CONTOUR_PRS_ID : SURFACE_PRS_ID;
- GBPrsType->button( id )->setChecked( true );
- onPrsType( id );
-
- // nb contours
- NbContoursSpn->setValue( thePrs->GetNbOfContours() );
-}
-
-//=======================================================================
-//function : Table Scalar Bar
-//purpose :
-//=======================================================================
-
-VisuGUI_TableScalarBarPane::VisuGUI_TableScalarBarPane( QWidget* parent )
- : QWidget( parent ),
- myBarPrs( 0 )
-{
- QGridLayout* topLayout = new QGridLayout( this );
- topLayout->setSpacing( 6 );
- topLayout->setMargin( 11 );
-
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- QString propertyName;
- propertyName = QString( "scalar_bar_vertical_" );
- 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. );
- myVerTW = aResourceMgr->integerValue( "VISU", propertyName + "title_width", 0 );
- myVerTH = aResourceMgr->integerValue( "VISU", propertyName + "title_height", 0 );
- myVerLW = aResourceMgr->integerValue( "VISU", propertyName + "label_width", 0 );
- myVerLH = aResourceMgr->integerValue( "VISU", propertyName + "label_height", 0 );
- myVerBW = aResourceMgr->integerValue( "VISU", propertyName + "bar_width", 0 );
- myVerBH = aResourceMgr->integerValue( "VISU", propertyName + "bar_height", 0 );
-
- propertyName = QString( "scalar_bar_horizontal_" );
- 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. );
- myHorTW = aResourceMgr->integerValue( "VISU", propertyName + "title_width", 0 );
- myHorTH = aResourceMgr->integerValue( "VISU", propertyName + "title_height", 0 );
- myHorLW = aResourceMgr->integerValue( "VISU", propertyName + "label_width", 0 );
- myHorLH = aResourceMgr->integerValue( "VISU", propertyName + "label_height", 0 );
- myHorBW = aResourceMgr->integerValue( "VISU", propertyName + "bar_width", 0 );
- myHorBH = aResourceMgr->integerValue( "VISU", propertyName + "bar_height", 0 );
-
- // Range ============================================================
- RangeGroup = new QGroupBox( tr( "SCALAR_RANGE_GRP" ), this );
- QButtonGroup* RangeRB = new QButtonGroup( RangeGroup );
- QGridLayout* RangeGroupLayout = new QGridLayout( RangeGroup );
- RangeGroupLayout->setSpacing( 6 );
- RangeGroupLayout->setMargin( 11 );
-
- CBLog = new QCheckBox( tr( "LOGARITHMIC_SCALING" ), RangeGroup );
-
- RBFrange = new QRadioButton( tr( "FIELD_RANGE_BTN" ), RangeGroup );
- RBIrange = new QRadioButton( tr( "IMPOSED_RANGE_BTN" ), RangeGroup );
- RangeRB->addButton( RBFrange, 0 );
- RangeRB->addButton( RBIrange, 1 );
- RBFrange->setChecked( true );
-
- MinEdit = new QLineEdit( RangeGroup );
- MinEdit->setMinimumWidth( 70 );
- MinEdit->setValidator( new QDoubleValidator( this ) );
- MinEdit->setText( "0.0" );
- QLabel* MinLabel = new QLabel( tr( "LBL_MIN" ), RangeGroup );
- MinLabel->setBuddy( MinEdit );
-
- MaxEdit = new QLineEdit( RangeGroup );
- MaxEdit->setMinimumWidth( 70 );
- MaxEdit->setValidator( new QDoubleValidator( this ) );
- MaxEdit->setText( "0.0" );
- QLabel* MaxLabel = new QLabel( tr( "LBL_MAX" ), RangeGroup );
- MaxLabel->setBuddy( MaxEdit );
-
- RangeGroupLayout->addWidget( CBLog, 1, 0, 1, 4 );
- RangeGroupLayout->addWidget( RBFrange, 2, 0, 1, 2 );
- RangeGroupLayout->addWidget( RBIrange, 2, 2, 1, 2 );
- RangeGroupLayout->addWidget( MinLabel, 3, 0 );
- RangeGroupLayout->addWidget( MinEdit, 3, 1 );
- RangeGroupLayout->addWidget( MaxLabel, 3, 2 );
- RangeGroupLayout->addWidget( MaxEdit, 3, 3 );
-
- // Colors and Labels ========================================================
- QGroupBox* ColLabGroup = new QGroupBox( tr( "COLORS_LABELS_GRP" ), this );
- QHBoxLayout* ColLabGroupLayout = new QHBoxLayout( ColLabGroup );
- ColLabGroupLayout->setSpacing( 6 );
- ColLabGroupLayout->setMargin( 11 );
-
- QLabel* ColorLabel = new QLabel( tr( "LBL_NB_COLORS" ), ColLabGroup );
- ColorSpin = new QSpinBox( ColLabGroup );
- ColorSpin->setMinimum( 2 );
- ColorSpin->setMaximum( 256 );
- ColorSpin->setSingleStep( 1 );
- ColorSpin->setMinimumWidth( 70 );
- ColorSpin->setValue( 64 );
-
- QLabel* LabelLabel = new QLabel( tr( "LBL_NB_LABELS" ), ColLabGroup );
- LabelSpin = new QSpinBox( ColLabGroup );
- LabelSpin->setMinimum( 2 );
- LabelSpin->setMaximum( 65 );
- LabelSpin->setSingleStep( 1 );
- LabelSpin->setMinimumWidth( 70 );
- LabelSpin->setValue( 5 );
-
- ColLabGroupLayout->addWidget( ColorLabel );
- ColLabGroupLayout->addWidget( ColorSpin );
- ColLabGroupLayout->addWidget( LabelLabel );
- ColLabGroupLayout->addWidget( LabelSpin );
-
- // Orientation ==========================================================
- QGroupBox* OrientGroup = new QGroupBox( tr( "ORIENTATION_GRP" ), this );
- QButtonGroup* OrientRB = new QButtonGroup( OrientGroup );
- QHBoxLayout* OrientGroupLayout = new QHBoxLayout( OrientGroup );
- OrientGroupLayout->setSpacing( 6 );
- OrientGroupLayout->setMargin( 11 );
-
- RBvert = new QRadioButton( tr( "VERTICAL_BTN" ), OrientGroup );
- RBhori = new QRadioButton( tr( "HORIZONTAL_BTN" ), OrientGroup );
- OrientRB->addButton( RBvert, 0 );
- OrientRB->addButton( RBhori, 1 );
- RBvert->setChecked( true );
- OrientGroupLayout->addWidget( RBvert );
- OrientGroupLayout->addWidget( RBhori );
-
- // Origin ===============================================================
- QGroupBox* OriginGroup = new QGroupBox( tr( "ORIGIN_GRP" ), this );
- QHBoxLayout* OriginGroupLayout = new QHBoxLayout( OriginGroup );
- OriginGroupLayout->setSpacing( 6 );
- OriginGroupLayout->setMargin( 11 );
-
- QLabel* XLabel = new QLabel( tr( "LBL_X" ), OriginGroup );
- XSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup );
- XSpin->setMinimumWidth( 70 );
- XSpin->setValue( 0.01 );
-
- QLabel* YLabel = new QLabel( tr( "LBL_Y" ), OriginGroup );
- YSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup );
- YSpin->setMinimumWidth( 70 );
- YSpin->setValue( 0.01 );
-
- OriginGroupLayout->addWidget( XLabel );
- OriginGroupLayout->addWidget( XSpin );
- OriginGroupLayout->addWidget( YLabel );
- OriginGroupLayout->addWidget( YSpin );
-
- // Dimensions =========================================================
- QGroupBox* DimGroup = new QGroupBox( tr( "DIMENSIONS_GRP" ), this );
- QHBoxLayout* DimGroupLayout = new QHBoxLayout( DimGroup );
- DimGroupLayout->setSpacing( 6 );
- DimGroupLayout->setMargin( 11 );
-
- QLabel* WidthLabel = new QLabel( tr( "LBL_WIDTH" ), DimGroup );
- WidthSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup );
- WidthSpin->setMinimumWidth( 70 );
- WidthSpin->setValue( 0.1 );
-
- QLabel* HeightLabel = new QLabel( tr( "LBL_HEIGHT" ), DimGroup );
- HeightSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup );
- HeightSpin->setMinimumWidth( 70 );
- HeightSpin->setValue( 0.8 );
-
- DimGroupLayout->addWidget( WidthLabel );
- DimGroupLayout->addWidget( WidthSpin );
- DimGroupLayout->addWidget( HeightLabel );
- DimGroupLayout->addWidget( HeightSpin );
-
- myTextBtn = new QPushButton( tr( "Text properties..." ), this );
- myBarBtn = new QPushButton( tr( "Bar properties..." ), this );
-
- // main layout =========================================================
-
- topLayout->addWidget( RangeGroup, 0, 0, 1, 2 );
- topLayout->addWidget( ColLabGroup, 1, 0, 1, 2 );
- topLayout->addWidget( OrientGroup, 2, 0, 1, 2 );
- topLayout->addWidget( OriginGroup, 3, 0, 1, 2 );
- topLayout->addWidget( DimGroup, 4, 0, 1, 2 );
- topLayout->addWidget( myTextBtn, 5, 0 );
- topLayout->addWidget( myBarBtn, 5, 1 );
-
- // init ================================================================
-
- myTextDlg = new VisuGUI_TextPrefDlg( this );
- myTextDlg->setTitleVisible( true );
- myBarDlg = new VisuGUI_BarPrefDlg( this );
-
- if ( RBvert->isChecked() ) {
- myBarDlg->setRatios( myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH );
- } else {
- myBarDlg->setRatios( myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH );
- }
-
- myBarDlg->setLabelsFormat( aResourceMgr->stringValue( "VISU", propertyName + "label_format", "%-#6.3g" ) );
- myBarDlg->setUnitsVisible( aResourceMgr->booleanValue( "VISU", propertyName + "display_units", true ) );
-
- // signals and slots connections ===========================================
- connect( RangeRB, SIGNAL( buttonClicked( int ) ), this, SLOT( changeRange( int ) ) );
- connect( OrientRB, SIGNAL( buttonClicked( int ) ), this, SLOT( changeDefaults( int ) ) );
- connect( XSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) );
- connect( YSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) );
- connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) );
- connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) );
- changeDefaults( 0 );
- myIsStoreTextProp = true;
- myBusy = false;
-}
-
-//----------------------------------------------------------------------------
-
-void VisuGUI_TableScalarBarPane::onBarPref()
-{
- if ( RBvert->isChecked() )
- myBarDlg->setRatios( myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH );
- else
- myBarDlg->setRatios( myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH );
- if ( myBarDlg->exec() ) {
- if ( RBvert->isChecked() )
- myBarDlg->getRatios( myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH );
- else
- myBarDlg->getRatios( myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH );
- }
-}
-
-//----------------------------------------------------------------------------
-/**
- * Initialise dialog box from presentation object
- */
-void VisuGUI_TableScalarBarPane::initFromPrsObject( VISU::PointMap3d_i* thePrs )
-{
- myBarPrs = dynamic_cast<VISU::PointMap3d_i*>( thePrs );
-
- if ( !myBarPrs )
- return;
-
- switch ( myBarPrs->GetScaling() ) {
- case VISU::LOGARITHMIC:
- CBLog->setChecked( true );
- break;
- default:
- CBLog->setChecked( false );
- }
-
- setRange( myBarPrs->GetMin(), myBarPrs->GetMax(), myBarPrs->IsRangeFixed() );
-
- setScalarBarData( myBarPrs->GetNbColors(), myBarPrs->GetLabels() );
-
- // "Title"
- CORBA::String_var aTitle = myBarPrs->GetTitle();
- myTextDlg->setTitleText( aTitle.in() );
- myTitle = aTitle.in();
-
- vtkFloatingPointType R, G, B;
- myBarPrs->GetTitleColor( R, G, B );
-
- setPosAndSize( myBarPrs->GetPosX(),
- myBarPrs->GetPosY(),
- myBarPrs->GetWidth(),
- myBarPrs->GetHeight(),
- myBarPrs->GetBarOrientation() );
-
- myVerTW = myBarPrs->GetTitleWidth();
- myVerTH = myBarPrs->GetTitleHeight();
- myVerLW = myBarPrs->GetLabelWidth();
- myVerLH = myBarPrs->GetLabelHeight();
- myVerBW = myBarPrs->GetBarWidth();
- myVerBH = myBarPrs->GetBarHeight();
- myBarDlg->setRatios( myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH );
-
- myBarDlg->setLabelsFormat( myBarPrs->GetLabelsFormat() );
- myBarDlg->setUnitsVisible( myBarPrs->IsUnitsVisible() );
-
- myTextDlg->myTitleFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ),
- myBarPrs->GetTitFontType(),
- myBarPrs->IsBoldTitle(),
- myBarPrs->IsItalicTitle(),
- myBarPrs->IsShadowTitle() );
-
- // "Labels"
- myBarPrs->GetLabelColor( R, G, B );
-
- myTextDlg->myLabelFont->SetData( QColor( (int)(R*255.), (int)(G*255.), (int)(B*255.) ),
- myBarPrs->GetLblFontType(),
- myBarPrs->IsBoldLabel(),
- myBarPrs->IsItalicLabel(),
- myBarPrs->IsShadowLabel() );
-}
-
-//----------------------------------------------------------------------------
-/**
- * Store values to presentation object
- */
-int VisuGUI_TableScalarBarPane::storeToPrsObject( VISU::PointMap3d_i* thePrs ) {
- if( !myBarPrs )
- return 0;
-
- myBarPrs->SetPosition( XSpin->value(), YSpin->value() );
- myBarPrs->SetSize( WidthSpin->value(), HeightSpin->value() );
-
- myBarPrs->SetRatios( myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH );
-
- myBarPrs->SetLabelsFormat( myBarDlg->getLabelsFormat().toLatin1().constData() );
- myBarPrs->SetUnitsVisible( myBarDlg->isUnitsVisible() );
-
- myBarPrs->SetBarOrientation( ( RBvert->isChecked() )? VISU::ColoredPrs3dBase::VERTICAL : VISU::ColoredPrs3dBase::HORIZONTAL );
- if ( CBLog->isChecked() )
- myBarPrs->SetScaling( VISU::LOGARITHMIC );
- else
- myBarPrs->SetScaling( VISU::LINEAR );
-
- if ( RBFrange->isChecked() ) {
- myBarPrs->SetSourceRange();
- } else {
- myBarPrs->SetRange( MinEdit->text().toDouble(), MaxEdit->text().toDouble() );
- }
- myBarPrs->SetNbColors( ColorSpin->value() );
- myBarPrs->SetLabels( LabelSpin->value() );
-
- if ( myIsStoreTextProp ) {
- // "Title"
- myBarPrs->SetTitle( myTextDlg->getTitleText().toLatin1().constData() );
-
- QColor aTitColor( 255, 255, 255 );
- int aTitleFontFamily = VTK_ARIAL;
- bool isTitleBold = false;
- bool isTitleItalic = false;
- bool isTitleShadow = false;
-
- myTextDlg->myTitleFont->GetData( aTitColor, aTitleFontFamily, isTitleBold, isTitleItalic, isTitleShadow );
-
- myBarPrs->SetBoldTitle( isTitleBold );
- myBarPrs->SetItalicTitle( isTitleItalic );
- myBarPrs->SetShadowTitle( isTitleShadow );
- myBarPrs->SetTitFontType( aTitleFontFamily );
- myBarPrs->SetTitleColor( aTitColor.red()/255.,
- aTitColor.green()/255.,
- aTitColor.blue()/255. );
-
- // "Label"
- QColor aLblColor( 255, 255, 255 );
- int aLabelFontFamily = VTK_ARIAL;
- bool isLabelBold = false;
- bool isLabelItalic = false;
- bool isLabelShadow = false;
-
- myTextDlg->myLabelFont->GetData( aLblColor, aLabelFontFamily, isLabelBold, isLabelItalic, isLabelShadow );
-
- myBarPrs->SetBoldLabel( isLabelBold);
- myBarPrs->SetItalicLabel( isLabelItalic );
- myBarPrs->SetShadowLabel( isLabelShadow );
- myBarPrs->SetLblFontType( aLabelFontFamily );
- myBarPrs->SetLabelColor( aLblColor.red()/255.,
- aLblColor.green()/255.,
- aLblColor.blue()/255. );
- // myIsStoreTextProp = false;
- }
- return 1;
-}
-
-//----------------------------------------------------------------------------
-/*!
- Sets default values and range mode
-*/
-void VisuGUI_TableScalarBarPane::setRange( double imin, double imax, bool sbRange )
-{
- MinEdit->setText( QString::number( imin ) );
- MaxEdit->setText( QString::number( imax ) );
-
- if ( sbRange )
- RBIrange->setChecked( true );
- else
- RBFrange->setChecked( true );
-
- changeRange( sbRange );
-}
-
-//----------------------------------------------------------------------------
-/*!
- Called when Range mode is changed
-*/
-void VisuGUI_TableScalarBarPane::changeRange( int )
-{
- if ( RBFrange->isChecked() ) {
- myBarPrs->SetSourceRange();
- MinEdit->setEnabled( false );
- MaxEdit->setEnabled( false );
- } else {
- myBarPrs->SetRange( myBarPrs->GetMin(), myBarPrs->GetMax() );
- myBarPrs->SetRange( MinEdit->text().toDouble(), MaxEdit->text().toDouble() );
- MinEdit->setEnabled( true );
- MaxEdit->setEnabled( true );
- }
-
- MinEdit->setText( QString::number( myBarPrs->GetMin() ) );
- MaxEdit->setText( QString::number( myBarPrs->GetMax() ) );
-}
-
-//----------------------------------------------------------------------------
-/*!
- Called when X,Y position is changed
-*/
-void VisuGUI_TableScalarBarPane::XYChanged( double )
-{
- QtxDoubleSpinBox* snd = (QtxDoubleSpinBox*)sender();
- if ( snd == XSpin ) {
- WidthSpin->setMaximum( 1.0 - XSpin->value() );
- }
- if ( snd == YSpin ) {
- HeightSpin->setMaximum( 1.0 - YSpin->value() );
- }
-}
-
-//----------------------------------------------------------------------------
-/*!
-
-*/
-void VisuGUI_TableScalarBarPane::changeScalarMode( int )
-{
-//do nothing
-}
-
-//----------------------------------------------------------------------------
-/*!
- Sets size and position
-*/
-void VisuGUI_TableScalarBarPane::setPosAndSize( double x, double y, double w, double h, bool vert )
-{
- if ( vert ) {
- myVerX = x;
- myVerY = y;
- myVerW = w;
- myVerH = h;
- RBvert->setChecked( true );
- }
- else {
- myHorX = x;
- myHorY = y;
- myHorW = w;
- myHorH = h;
- RBhori->setChecked( true );
- }
- changeDefaults( 0 );
-}
-
-//----------------------------------------------------------------------------
-/*!
- Sets colors and labels number
-*/
-void VisuGUI_TableScalarBarPane::setScalarBarData( int colors, int labels )
-{
- ColorSpin->setValue( colors );
- LabelSpin->setValue( labels );
-}
-
-//----------------------------------------------------------------------------
-void VisuGUI_TableScalarBarPane::onTextPref()
-{
- myTextDlg->storeBeginValues();
- myIsStoreTextProp = myTextDlg->exec() || myIsStoreTextProp;
-}
-
-//----------------------------------------------------------------------------
-VisuGUI_TableScalarBarPane::~VisuGUI_TableScalarBarPane()
-{
-}
-
-//----------------------------------------------------------------------------
-/*!
- Called when orientation is changed
-*/
-void VisuGUI_TableScalarBarPane::changeDefaults( int )
-{
- if ( RBvert->isChecked() ) {
- XSpin->setValue( myVerX );
- YSpin->setValue( myVerY );
- WidthSpin->setValue( myVerW );
- HeightSpin->setValue( myVerH );
- }
- else {
- XSpin->setValue( myHorX );
- YSpin->setValue( myHorY );
- WidthSpin->setValue( myHorW );
- HeightSpin->setValue( myHorH );
- }
-}
-
-//=======================================================================
-//function : Check
-//purpose : Called when <OK> button is clicked, validates data and closes dialog
-//=======================================================================
-bool VisuGUI_TableScalarBarPane::check()
-{
- double minVal = MinEdit->text().toDouble();
- double maxVal = MaxEdit->text().toDouble();
- if ( RBIrange->isChecked() ) {
- if (minVal >= maxVal) {
- SUIT_MessageBox::warning( this,tr("WRN_VISU"),
- tr("MSG_MINMAX_VALUES") );
- return false;
- }
- }
-
- // check if logarithmic mode is on and check imposed range to not contain negative values
- if ( CBLog->isChecked() ) {
- if ( minVal <= 0.0 ) {
- if ( RBIrange->isChecked() ) {
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE") );
- } else {
- if ( minVal == 0)
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_RANGE") );
- else
- SUIT_MessageBox::warning( this,
- tr("WRN_VISU"),
- tr("WRN_LOGARITHMIC_FIELD_RANGE") );
- RBIrange->setChecked(true);
- changeRange(1);
- }
- return false;
- }
- }
- return true;
-}
-
-//=======================================================================
-//function : Constructor
-//purpose :
-//=======================================================================
-VisuGUI_Table3DDlg::VisuGUI_Table3DDlg ( SalomeApp_Module* theModule )
- : QDialog ( VISU::GetDesktop( theModule ) )
-{
- setModal( false );
- setWindowTitle( tr( "Point Map 3D Definition" ) );
- setSizeGripEnabled( true );
-
- QVBoxLayout* TopLayout = new QVBoxLayout( this );
- TopLayout->setSpacing( 6 );
- TopLayout->setMargin( 11 );
-
- myTabBox = new QTabWidget( this );
- myIsoPane = new VisuGUI_Table3DPane( this );
- myScalarBarPane = new VisuGUI_TableScalarBarPane( this );
-
- myTabBox->addTab( myIsoPane, tr( "DLG_PREF_TITLE" ) );
- myTabBox->addTab( myScalarBarPane, tr( "DLG_PROP_TITLE" ) );
-
- QGroupBox* GroupButtons = new QGroupBox( this );
- QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
-
- QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons );
- buttonOk->setAutoDefault( true );
- buttonOk->setDefault( true );
- QPushButton* buttonApply = new QPushButton( tr( "&Apply" ), GroupButtons );
- buttonApply->setAutoDefault( true );
- QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ), GroupButtons );
- buttonCancel->setAutoDefault( true );
- QPushButton* buttonHelp = new QPushButton( tr( "&Help" ), GroupButtons );
- buttonHelp->setAutoDefault( true );
-
- GroupButtonsLayout->addWidget( buttonOk );
- GroupButtonsLayout->addWidget( buttonApply );
- GroupButtonsLayout->addSpacing( 10 );
- GroupButtonsLayout->addStretch();
- GroupButtonsLayout->addWidget( buttonCancel );
- GroupButtonsLayout->addWidget( buttonHelp );
-
- TopLayout->addWidget( myTabBox );
- TopLayout->addWidget( GroupButtons );
-
- // signals and slots connections
- connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
- connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
- connect( buttonApply, SIGNAL( clicked() ), this, SLOT( onApply() ) );
-}
-
-//=======================================================================
-//function : Destructor
-//purpose :
-//=======================================================================
-VisuGUI_Table3DDlg::~VisuGUI_Table3DDlg()
-{
-}
-
-//=======================================================================
-//function : accept
-//purpose :
-//=======================================================================
-void VisuGUI_Table3DDlg::accept()
-{
- if (myScalarBarPane->check())
- QDialog::accept();
-}
-
-//=======================================================================
-//function : onApply
-//purpose :
-//=======================================================================
-void VisuGUI_Table3DDlg::onApply()
-{
- if (myScalarBarPane->check()) {
- storeToPrsObject( myPrsCopy );
- myPrsCopy->UpdateActors();
- }
-}
-
-//=======================================================================
-//function : onHelp
-//purpose :
-//=======================================================================
-void VisuGUI_Table3DDlg::onHelp()
-{
- QString aHelpFileName = "table_3d_page.html";
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app) {
- VisuGUI* aVisuGUI = dynamic_cast<VisuGUI*>( app->activeModule() );
- app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
- }
- else {
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- SUIT_MessageBox::warning( this, QObject::tr("WRN_WARNING"),
- tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(aHelpFileName) );
- }
-
-}
-
-//=======================================================================
-//function : storeToPrsObject
-//purpose :
-//=======================================================================
-int VisuGUI_Table3DDlg::storeToPrsObject( VISU::PointMap3d_i* thePrs )
-{
- int anIsOk = myIsoPane->storeToPrsObject( thePrs );
- anIsOk &= myScalarBarPane->storeToPrsObject( thePrs );
-
- return anIsOk;
-}
-
-//=======================================================================
-//function : initFromPrsObject
-//purpose :
-//=======================================================================
-void VisuGUI_Table3DDlg::initFromPrsObject( VISU::PointMap3d_i* thePrs )
-{
- myPrsCopy = thePrs;
- myIsoPane->initFromPrsObject( thePrs );
- myScalarBarPane->initFromPrsObject( thePrs );
-}
+++ /dev/null
-// VISU VISUGUI : GUI of VISU component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : VisuGUI_Table3dDlg.h
-// Author : Laurent CORNABE & Hubert ROLLAND
-//
-
-#ifndef VISUGUI_TABLE3D_H
-#define VISUGUI_TABLE3D_H
-
-#include "VisuGUI_Prs3dDlg.h"
-
-#include <QWidget>
-#include <string>
-
-class QTabWidget;
-class QButtonGroup;
-class QGroupBox;
-class QComboBox;
-class QCheckBox;
-class QLineEdit;
-class QRadioButton;
-class QPushButton;
-class QSpinBox;
-class QtxDoubleSpinBox;
-class VisuGUI_TextPrefDlg;
-class VisuGUI_BarPrefDlg;
-class SVTK_ViewWindow;
-class SalomeApp_Module;
-
-namespace VISU
-{
- class PointMap3d_i;
-};
-
-class VisuGUI_Table3DPane : public QWidget
-{
- Q_OBJECT
-
-public:
- VisuGUI_Table3DPane( QWidget* );
- ~VisuGUI_Table3DPane();
-
- void initFromPrsObject( VISU::PointMap3d_i* );
- int storeToPrsObject( VISU::PointMap3d_i* );
-
- VISU::PointMap3d_i* GetPrs();
-
-private slots:
- void onPrsType( int );
-
-private:
- bool myInitFromPrs;
-
- SVTK_ViewWindow* myViewWindow;
- VISU::PointMap3d_i* myPrs;
-
- QtxDoubleSpinBox* ScaleSpn;
- QGroupBox* GBPrsTypeBox;
- QButtonGroup* GBPrsType;
- QSpinBox* NbContoursSpn;
-};
-
-class VisuGUI_TableScalarBarPane : public QWidget
-{
- Q_OBJECT
-
-public:
- VisuGUI_TableScalarBarPane( QWidget* );
- ~VisuGUI_TableScalarBarPane();
-
- void setRange( double, double, bool );
- void setDefaultRange( double, double );
- int getOrientation();
- void setPosAndSize( double, double, double, double, bool );
- void setScalarBarData( int, int );
- bool isIRange();
- double getMin();
- double getMax();
- double getX();
- double getY();
- double getWidth();
- double getHeight();
- int getNbColors();
- int getNbLabels();
- bool isLogarithmic();
- void setLogarithmic( bool on );
- // bool isToSave() {return CBSave ? CBSave->isChecked() : false;}
-
- void storeToResources();
-
- void initFromPrsObject( VISU::PointMap3d_i* );
- int storeToPrsObject( VISU::PointMap3d_i* );
-
- bool check();
-
-private slots:
- void changeDefaults( int );
- void changeRange( int );
- void XYChanged( double );
- void changeScalarMode( int );
- void onTextPref();
- void onBarPref();
-
-private:
- QGroupBox* RangeGroup;
- QRadioButton* RBFrange;
- QRadioButton* RBIrange;
- QLineEdit* MinEdit;
- QLineEdit* MaxEdit;
-
- QRadioButton* RBhori;
- QRadioButton* RBvert;
-
- QtxDoubleSpinBox* XSpin;
- QtxDoubleSpinBox* YSpin;
-
- QtxDoubleSpinBox* WidthSpin;
- QtxDoubleSpinBox* HeightSpin;
-
- QSpinBox* ColorSpin;
- QSpinBox* LabelSpin;
-
- QCheckBox* CBSave;
- QCheckBox* CBLog;
- QComboBox* myModeCombo;
- QPushButton* myTextBtn;
- QPushButton* myBarBtn;
- VisuGUI_TextPrefDlg* myTextDlg;
- VisuGUI_BarPrefDlg* myBarDlg;
-
- double myHorX, myHorY, myHorW, myHorH;
- double myVerX, myVerY, myVerW, myVerH;
- int myHorTW, myHorTH, myHorLW, myHorLH, myHorBW, myHorBH;
- int myVerTW, myVerTH, myVerLW, myVerLH, myVerBW, myVerBH;
- bool myIsStoreTextProp;
-
- std::string myTitle;
- VISU::PointMap3d_i* myBarPrs;
-
- bool myBusy;
-};
-
-///////////////////////////////////////////////////////
-
-class VisuGUI_Table3DDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- VisuGUI_Table3DDlg( SalomeApp_Module* );
- ~VisuGUI_Table3DDlg();
-
- virtual void initFromPrsObject( VISU::PointMap3d_i* );
- virtual int storeToPrsObject( VISU::PointMap3d_i* );
-
-protected slots:
- void accept();
- void onHelp();
- void onApply();
-
-private:
- QTabWidget* myTabBox;
- VisuGUI_Table3DPane* myIsoPane;
- VisuGUI_TableScalarBarPane* myScalarBarPane;
-
- SALOME::GenericObjPtr<VISU::PointMap3d_i> myPrsCopy;
-};
-
-#endif // VISUGUI_TABLE3D_H
#include "VISU_Prs3d_i.hh"
#include "VISU_Result_i.hh"
#include "VISU_Table_i.hh"
-#include "VISU_Mesh_i.hh"
+//#include "VISU_Mesh_i.hh"
#include "VISU_ViewManager_i.hh"
#include "VISU_Actor.h"
#include <QSpinBox>
#include <QDoubleSpinBox>
+using namespace std;
//=============================================================================
namespace VISU
_PTR(GenericAttribute) anAttr;
_PTR(AttributeString) aComment;
+ _PTR(SObject) aRefSObject;
+ if (aSObject->ReferencedObject(aRefSObject)) {
+ // It can be a reference on curve, published under a container. IPAL 20317
+ VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(theModule), aRefSObject->GetID());
+ VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
+ if( (aRefBase && aRefBase->GetType() == VISU::TCURVE) || (aRefBase && aRefBase->GetType() == VISU::TMESH) )
+ return true;
+ }
+
bool isUnderVISU = false;
_PTR(SObject) aFatherSObject = aSObject->GetFather();
if (aFatherSObject->FindAttribute(anAttr, "AttributeName")) {
switch (theType) {
case VISU::SHRINK:
if (aPrs3d) {
- if (anActor->IsShrunk())
- anActor->UnShrink();
- else
- anActor->SetShrink();
+ if (anActor->IsShrunk())
+ anActor->UnShrink();
+ else
+ anActor->SetShrink();
+ if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
+ aMesh->SetShrink(true);
+ }
} else if (aTable) {
if (anActorBase->IsShrunk())
anActorBase->UnShrink();
for (int i = 0; i < clist.count(); i++) {
tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
if (tmpCurve && tmpCurve->hasIO() &&
- theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
+ theCurve->GetEntry() == tmpCurve->getIO()->getEntry()) {
plotCurve = tmpCurve;
}
else if (theDisplaying == VISU::eDisplayOnly) {
//************************************************************
// Others
-
- void
+ VISU::Mesh_i*
CreateMesh(VisuGUI* theModule,
const Handle(SALOME_InteractiveObject)& theIO,
SVTK_ViewWindow* theViewWindow)
VISU::Result_var aResult;
VISU::Result_i* pResult = CheckResult(theModule, aResultSObj, aResult);
if (pResult == NULL)
- return;
+ return NULL;
Storable::TRestoringMap aMap = Storable::GetStorableMap(aResultSObj);
if (aMap.empty())
- return;
+ return NULL;
CORBA::Object_var aMesh;
string aComment = Storable::FindValue(aMap,"myComment").toLatin1().data();
SUIT_MessageBox::warning (GetDesktop(theModule),
QObject::tr("WRN_VISU"),
QObject::tr("ERR_CANT_BUILD_PRESENTATION") );
- return;
+ return NULL;
}
if (theViewWindow) {
theModule->application()->putInfo(QObject::tr("INF_DONE"));
// Make "Save" button active
theModule->getApp()->updateActions();
+ return pPresent;
}
// ========================================================================================
case VISU::TPLOT3D:
case VISU::TSCALARMAPONDEFORMEDSHAPE:
case VISU::TDEFORMEDSHAPEANDSCALARMAP:
+ case VISU::TMESH:
{
PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
if (aServant.in()) {
spinBox->setDecimals( decimals );
}
//------------------------------------------------------------
+ bool getClippingPlanesFolder(_PTR(Study) theStudy, _PTR(SObject)& theSObject)
+ {
+ _PTR(SComponent) aVisuSO = theStudy->FindComponent("VISU");
+ if (!aVisuSO) return false;
+ _PTR(SObject) aFolder = theStudy->FindObject(CLIP_PLANES_FOLDER);
+ if (!aFolder) {
+ _PTR(StudyBuilder) aBuilder = theStudy->NewBuilder();
+ aFolder = aBuilder->NewObject(aVisuSO);
+
+ _PTR(GenericAttribute) anAttr;
+ anAttr = aBuilder->FindOrCreateAttribute(aFolder,"AttributeName");
+ _PTR(AttributeName) aName(anAttr);
+ aName->SetValue(CLIP_PLANES_FOLDER);
+ }
+ theSObject = aFolder;
+ return true;
+ }
}
#include <vector>
#include <utility>
+#include "VISU_Mesh_i.hh"
namespace VISU
{
VISU::Prs3d_i* GetPrs3dFromBase(Base_i* theBase);
+ bool GetPrs3dSelectionInfo( const SalomeApp_Module* theModule,
+ VISU::Prs3d_i*& thePrs3d,
+ SVTK_ViewWindow*& theViewWindow,
+ VISU_Actor*& thenActor );
+
//----------------------------------------------------------------------------
void Add(LightApp_SelectionMgr* theSelectionMgr,
const Handle(SALOME_InteractiveObject)& theIO);
/*! Create mesh presentation and display it in \a theViewWindow.
* If \a theViewWindow is NULL, no displaying will be done.
*/
- void CreateMesh(VisuGUI* theModule,
- const Handle(SALOME_InteractiveObject)& theIO,
- SVTK_ViewWindow* theViewWindow);
+ VISU::Mesh_i* CreateMesh(VisuGUI* theModule,
+ const Handle(SALOME_InteractiveObject)& theIO,
+ SVTK_ViewWindow* theViewWindow);
// Others
std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
VISU::Prs3d_i* thePrs3d);
void initSpinBox( QSpinBox*, int, int, int = 1 );
void initSpinBox( QDoubleSpinBox*, double, double, double = 0.1, int = 6 );
+
+#define CLIP_PLANES_FOLDER "Clipping Planes"
+
+ bool getClippingPlanesFolder(_PTR(Study) theStudy, _PTR(SObject)& theSObject);
}
#endif
// Scale factor
ScaleLabel = new QLabel (tr("LBL_SCALE_FACTOR"), TopGroup );
- ScalFact = new QtxDoubleSpinBox( 1e-20, 1.0E+38, 0.1, TopGroup );
-
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
- ScalFact->setPrecision( aPrecision*(-1) );
- ScalFact->setDecimals( 32 );
+ ScalFact = new QtxDoubleSpinBox( 0, 1.0E+38, 0.1, aPrecision*(-1), 32, TopGroup );
ScalFact->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
ScalFact->setValue( 0.1 );
void VisuGUI_VectorsDlg::setScaleFactor( double theFactor )
{
double i=0.1;
- while (1) { // Calculate Step & Precission
- if ( int (theFactor/i) > 0)
- break;
- else {
- i = i*0.1;
+ if (theFactor > 0) { // Calculate Step & Precission
+ while (1) {
+ if ( int (theFactor/i) > 0)
+ break;
+ else
+ i = i*0.1;
}
}
ScalFact->setSingleStep(i);
-
ScalFact->setValue( theFactor );
}
#include "SalomeApp_Module.h"
#include "SalomeApp_Application.h"
-#include "VVTK_ViewModel.h"
-#include "VVTK_ViewWindow.h"
+//#include "VVTK_ViewModel.h"
+//#include "VVTK_ViewWindow.h"
#include "SVTK_Functor.h"
#include "SVTK_ViewModel.h"
#include <vtkActorCollection.h>
#include <vtkRenderer.h>
-class VVTK_Viewer;
+//class VVTK_Viewer;
namespace VISU
{
VISU_MultiResult_i.hh \
VISU_PrsObject_i.hh \
VISU_Table_i.hh \
+ VISU_ResultUtils.hh \
VISU_PointMap3d_i.hh \
VISU_Prs3d_i.hh \
VISU_Mesh_i.hh \
VISU_ColoredPrs3d_i.hh \
+ VISU_CorbaMedConvertor.hxx \
VISU_ScalarMap_i.hh \
VISU_IsoSurfaces_i.hh \
VISU_DeformedShape_i.hh \
VISU_Plot3D_i.hh \
VISU_CutPlanes_i.hh \
VISU_CutLines_i.hh \
+ VISU_Prs3dUtils.hh \
VISU_Vectors_i.hh \
VISU_StreamLines_i.hh \
VISU_GaussPoints_i.hh \
VISU_View_i.hh \
VISU_TimeAnimation.h \
VISU_DeformedShapeAndScalarMap_i.hh \
+ VISU_ColoredPrs3dCache_i.hh \
+ VISU_ColoredPrs3dHolder_i.hh \
VISU_ColoredPrs3dFactory.hh \
VISU_MonoColorPrs_i.hh \
VISU_Deformation_i.hh \
VISU_OptionalDeformation_i.hh \
- SALOME_GenericObjPointer.hh
+ SALOME_GenericObjPointer.hh \
+ VISU_ClippingPlaneMgr.hxx
libVISUEngineImpl_la_SOURCES = \
VISU_MonoColorPrs_i.cc \
VISU_Deformation_i.cc \
VISU_OptionalDeformation_i.cc \
- SALOME_GenericObjPointer.cc
+ SALOME_GenericObjPointer.cc \
+ VISU_ClippingPlaneMgr.cxx
MOC_FILES = VISU_TimeAnimation_moc.cxx
nodist_libVISUEngineImpl_la_SOURCES= $(MOC_FILES)
-I$(srcdir)/../CONVERTOR \
-I$(srcdir)/../PIPELINE \
-I$(srcdir)/../OBJECT \
- -I$(srcdir)/../VVTK \
-I$(srcdir)/../GUITOOLS \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix
../CONVERTOR/libVisuConvertor.la \
../PIPELINE/libVisuPipeLine.la \
../OBJECT/libVisuObject.la \
- ../VVTK/libVVTK.la \
../GUITOOLS/libVISUGUITOOLS.la
if MED_ENABLE_MULTIPR
static int MYDEBUG = 0;
#endif
+using namespace std;
namespace VISU
{
#include "VTKViewer_Algorithm.h"
#include "SVTK_Functor.h"
+#include "SVTK_ViewWindow.h"
-#include "VVTK_ViewWindow.h"
#include "SUIT_ResourceMgr.h"
#include <vtkRenderWindow.h>
static int MYDEBUG = 0;
#endif
+using namespace std;
+
namespace
{
//----------------------------------------------------------------------------
{
std::string aFolderName = VISU::ColoredPrs3dCache_i::GetFolderName();
SALOMEDS::SObject_var aSObject = theStudy->FindObject(aFolderName.c_str());
+ if (CORBA::is_nil(aSObject)) {
+ aSObject = theStudy->FindObject("3D Cache System");
+ if (!CORBA::is_nil(aSObject)) {
+ SALOMEDS::StudyBuilder_var aBuilder = theStudy->NewBuilder();
+ SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( aSObject, "AttributeName" );
+ SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr );
+ aNameAttr->SetValue( GetFolderName().c_str() );
+ }
+ }
if(!CORBA::is_nil(aSObject)){
CORBA::Object_var anObject = aSObject->GetObject();
VISU::ColoredPrs3dCache_var aCache = VISU::ColoredPrs3dCache::_narrow(anObject);
VISU::ColoredPrs3dCache_i
::GetFolderName()
{
- return "3D Cache System";
+ //return "3D Cache System";
+ return "Presentations";
}
//----------------------------------------------------------------------------
#ifndef VISU_ColoredPrs3dCache_i_HeaderFile
#define VISU_ColoredPrs3dCache_i_HeaderFile
+#include "VISU_I.hxx"
+
#include "VISU_ColoredPrs3dFactory.hh"
#include "SALOME_GenericObjPointer.hh"
* This interface is responsible for memory management of 3d presentations.
* One cache corresponds to one study.
*/
- class ColoredPrs3dCache_i : public virtual POA_VISU::ColoredPrs3dCache,
+ class VISU_I_EXPORT ColoredPrs3dCache_i : public virtual POA_VISU::ColoredPrs3dCache,
public virtual SALOME::GenericObj_i,
public virtual RemovableObject_i
{
//static int MYDEBUG = 0;
#endif
+using namespace std;
namespace VISU
{
static int MYDEBUG = 0;
#endif
+using namespace std;
+
//---------------------------------------------------------------
int VISU::ColoredPrs3dHolder_i::myNbHolders = 0;
#ifndef VISU_ColoredPrs3dHolder_i_HeaderFile
#define VISU_ColoredPrs3dHolder_i_HeaderFile
+#include "VISU_I.hxx"
#include "VISU_PrsObject_i.hh"
#include "SALOME_GenericObj_i.hh"
* created on fields. It is publishing in the object browser in a separate folder
* and can be controled by viewer's slider.
*/
- class ColoredPrs3dHolder_i : public virtual POA_VISU::ColoredPrs3dHolder,
+ class VISU_I_EXPORT ColoredPrs3dHolder_i : public virtual POA_VISU::ColoredPrs3dHolder,
public virtual SALOME::GenericObj_i,
public virtual PrsObject_i
{
static int MYDEBUG = 0;
#endif
+using namespace std;
//---------------------------------------------------------------
namespace
myOrientation( VISU::ColoredPrs3dBase::HORIZONTAL ),
myColoredPL(NULL),
myIsFixedRange(false),
- myIsRestored(true)
+ myIsRestored(true)/* RKV : Begin*/,
+ myIsDistributionVisible(false)/* RKV : End*/
{}
//---------------------------------------------------------------
SetNbColors(anOrigin->GetNbColors());
SetUnitsVisible(anOrigin->IsUnitsVisible());
- SetLabelsFormat(anOrigin->GetLabelsFormat());
-
+ SetIsDistributionVisible(anOrigin->GetIsDistributionVisible());
+ SetLabelsFormat( anOrigin->GetLabelsFormat() );
+
SetBarOrientation(anOrigin->GetBarOrientation());
SetMinMaxController( anOrigin );
- if(anOrigin->IsRangeFixed())
- SetRange(anOrigin->GetMin(), anOrigin->GetMax());
+ if ( anOrigin->IsRangeFixed() )
+ SetRange( anOrigin->GetMin(), anOrigin->GetMax() );
else
SetSourceRange();
+ SetScalarFilterRange( anOrigin->GetScalarFilterMin(), anOrigin->GetScalarFilterMax() );
+ UseScalarFiltering( anOrigin->IsScalarFilterUsed() );
+
SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
- SetRatios(anOrigin->GetTitleWidth(), anOrigin->GetTitleHeight(),
- anOrigin->GetLabelWidth(), anOrigin->GetLabelHeight(),
+ SetRatios(anOrigin->GetTitleSize(), anOrigin->GetLabelSize(),
anOrigin->GetBarWidth(), anOrigin->GetBarHeight());
SetLabels(anOrigin->GetLabels());
return myColoredPL->GetScalarRange()[1];
}
+
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
-::SetRange(CORBA::Double theMin, CORBA::Double theMax)
+::SetRange( CORBA::Double theMin, CORBA::Double theMax )
{
VISU::TSetModified aModified(this);
vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
(GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
-
UseFixedRange(true);
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetScalarFilterRange( CORBA::Double theMin, CORBA::Double theMax )
+{
+ VISU::TSetModified aModified(this);
+
+ vtkFloatingPointType aScalarRange[ 2 ] = { theMin, theMax };
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+ (GetSpecificPL(), &VISU_ColoredPL::SetScalarFilterRange, aScalarRange) );
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetScalarFilterMin()
+{
+ vtkFloatingPointType aScalarRange[ 2 ];
+ GetSpecificPL()->GetScalarFilterRange( aScalarRange );
+
+ return aScalarRange[ 0 ];
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::ColoredPrs3d_i
+::GetScalarFilterMax()
+{
+ vtkFloatingPointType aScalarRange[ 2 ];
+ GetSpecificPL()->GetScalarFilterRange( aScalarRange );
+
+ return aScalarRange[ 1 ];
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Boolean
+VISU::ColoredPrs3d_i
+::IsScalarFilterUsed()
+{
+ return myColoredPL->IsScalarFilterUsed();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::UseScalarFiltering( CORBA::Boolean theUseScalarFilter )
+{
+ return myColoredPL->UseScalarFiltering( theUseScalarFilter );
+}
+
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
(GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
}else{
- vtkFloatingPointType aScalarRange[2] = {GetSourceMin(), GetSourceMax()};
+ vtkFloatingPointType aScalarRange[ 2 ] = {GetSourceMin(), GetSourceMax()};
ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
(GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
}
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
-::SetRatios(CORBA::Long theTitleWidth, CORBA::Long theTitleHeight,
- CORBA::Long theLabelWidth, CORBA::Long theLabelHeight,
+::SetRatios(CORBA::Long theTitleSize, CORBA::Long theLabelSize,
CORBA::Long theBarWidth, CORBA::Long theBarHeight)
{
- bool anIsSameValue = VISU::CheckIsSameValue(myTitleWidth, theTitleWidth);
- anIsSameValue &= VISU::CheckIsSameValue(myTitleHeight, theTitleHeight);
- anIsSameValue &= VISU::CheckIsSameValue(myLabelWidth, theLabelWidth);
- anIsSameValue &= VISU::CheckIsSameValue(myLabelHeight, theLabelHeight);
+ bool anIsSameValue = VISU::CheckIsSameValue(myTitleSize, theTitleSize);
+ anIsSameValue &= VISU::CheckIsSameValue(myLabelSize, theLabelSize);
anIsSameValue &= VISU::CheckIsSameValue(myBarWidth, theBarWidth);
anIsSameValue &= VISU::CheckIsSameValue(myBarHeight, theBarHeight);
if(anIsSameValue)
VISU::TSetModified aModified(this);
- myTitleWidth = theTitleWidth;
- myTitleHeight = theTitleHeight;
- myLabelWidth = theLabelWidth;
- myLabelHeight = theLabelHeight;
+ myTitleSize = theTitleSize;
+ myLabelSize = theLabelSize;
myBarWidth = theBarWidth;
myBarHeight = theBarHeight;
myParamsTime.Modified();
//----------------------------------------------------------------------------
CORBA::Long
VISU::ColoredPrs3d_i
-::GetTitleWidth()
+::GetTitleSize()
{
- return myTitleWidth;
-}
-
-//----------------------------------------------------------------------------
-CORBA::Long
-VISU::ColoredPrs3d_i
-::GetTitleHeight()
-{
- return myTitleHeight;
+ return myTitleSize;
}
//----------------------------------------------------------------------------
CORBA::Long
VISU::ColoredPrs3d_i
-::GetLabelWidth()
+::GetLabelSize()
{
- return myLabelWidth;
-}
-
-//----------------------------------------------------------------------------
-CORBA::Long
-VISU::ColoredPrs3d_i
-::GetLabelHeight()
-{
- return myLabelHeight;
+ return myLabelSize;
}
//----------------------------------------------------------------------------
return myNumberOfLabels;
}
+//----------------------------------------------------------------------------
+
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
// Scalar Range
int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
- if(aRangeType == 1){
+ if ( aRangeType == 1 ) {
float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
- SetRange(aMin, aMax);
+ SetRange( aMin, aMax );
}
- UseFixedRange(aRangeType == 1);
+ UseFixedRange( aRangeType == 1 );
+
+ bool isFiltered = aResourceMgr->booleanValue("VISU", "scalar_bar_filter_by_scalars", false);
+ UseScalarFiltering( isFiltered );
int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 );
SetNbColors(aNumberOfColors);
bool isUnits = aResourceMgr->booleanValue( "VISU", "scalar_bar_display_units", true );
SetUnitsVisible(isUnits);
- QString aLabelsFormat = aResourceMgr->stringValue( "VISU", "scalar_bar_label_format", "%-#6.3g" );
- SetLabelsFormat(aLabelsFormat.toLatin1().data());
+ SetIsDistributionVisible( aResourceMgr->booleanValue("VISU", "scalar_bar_show_distribution", false) ); // RKV
+
+ int lp = aResourceMgr->integerValue( "VISU", "scalar_bar_label_precision", 3 );
+ SetLabelsFormat( VISU::ToFormat( lp ).c_str() );
// Orientation
int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0);
// Scalar Bar origin
QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
- vtkFloatingPointType aXorigin = (myOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.01 : 0.2;
+ vtkFloatingPointType aXorigin = (myOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.01 : 0.1;
aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
myPosition[0] = aXorigin;
- vtkFloatingPointType aYorigin = (myOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.1 : 0.012;
+ vtkFloatingPointType aYorigin = (myOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.1 : 0.01;
aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
myPosition[1] = aYorigin;
// Scalar Bar size
- myWidth = (myOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.1 : 0.6;
+ myWidth = (myOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.08 : 0.8;
myWidth = aResourceMgr->doubleValue("VISU", propertyName + "width", myWidth);
- myHeight = (myOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.8:0.12;
+ myHeight = (myOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.8:0.08;
myHeight = aResourceMgr->doubleValue("VISU", propertyName + "height", myHeight);
- myTitleWidth = 0;
- myTitleWidth = aResourceMgr->integerValue("VISU", propertyName + "title_width", myTitleWidth);
+ myTitleSize = 0;
+ myTitleSize = aResourceMgr->integerValue("VISU", propertyName + "title_size", myTitleSize);
- myTitleHeight = 0;
- myTitleHeight = aResourceMgr->integerValue("VISU", propertyName + "title_height", myTitleHeight);
-
- myLabelWidth = 0;
- myLabelWidth = aResourceMgr->integerValue("VISU", propertyName + "label_width", myLabelWidth);
-
- myLabelHeight = 0;
- myLabelHeight = aResourceMgr->integerValue("VISU", propertyName + "label_height", myLabelHeight);
+ myLabelSize = 0;
+ myLabelSize = aResourceMgr->integerValue("VISU", propertyName + "label_size", myLabelSize);
myBarWidth = 0;
myBarWidth = aResourceMgr->integerValue("VISU", propertyName + "bar_width", myBarWidth);
myIsBoldTitle = f.bold();
myIsItalicTitle = f.italic();
- myIsShadowTitle = f.underline();
+ myIsShadowTitle = f.overline();
}
QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
myIsBoldLabel = f.bold();
myIsItalicLabel = f.italic();
- myIsShadowLabel = f.underline();
+ myIsShadowLabel = f.overline();
}
QColor aLabelColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
myLabelColor[0] = aLabelColor.red() / 255.;
myLabelColor[1] = aLabelColor.green() / 255.;
myLabelColor[2] = aLabelColor.blue() / 255.;
+
+ // Parameters of labels displaed field values
+ myValLblFontType = VTK_ARIAL;
+ myIsBoldValLbl = true;
+ myIsItalicValLbl = myIsShadowValLbl = false;
+ myValLblFontSize = 12;
+ if( aResourceMgr->hasValue( "VISU", "values_labeling_font" ) )
+ {
+ // family
+ QFont f = aResourceMgr->fontValue( "VISU", "values_labeling_font" );
+ if ( f.family() == "Arial" )
+ myValLblFontType = VTK_ARIAL;
+ else if ( f.family() == "Courier" )
+ myValLblFontType = VTK_COURIER;
+ else if ( f.family() == "Times" )
+ myValLblFontType = VTK_TIMES;
+
+ // size
+ if ( f.pointSize() > -1 )
+ myValLblFontSize = f.pointSize();
+
+ // color
+ QColor aColor = aResourceMgr->colorValue(
+ "VISU", "values_labeling_color", QColor( 255, 255, 255 ) );
+ myValLblFontColor[ 0 ] = aColor.red() / 255.;
+ myValLblFontColor[ 1 ] = aColor.green() / 255.;
+ myValLblFontColor[ 2 ] = aColor.blue()/ 255.;
+
+ // bold, italic, shadow
+ myIsBoldValLbl = f.bold();
+ myIsItalicValLbl = f.italic();
+ myIsShadowValLbl = f.overline();
+ }
+
return this;
}
Build(ERestore);
- SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
- float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
- float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
- SetRange(aMin, aMax);
+ SetScalarMode(VISU::Storable::FindValue( theMap,"myScalarMode" ).toInt() );
+ {
+ float aMin = VISU::Storable::FindValue( theMap, "myScalarRange[0]" ).toDouble();
+ float aMax = VISU::Storable::FindValue( theMap, "myScalarRange[1]" ).toDouble();
+ SetRange( aMin, aMax );
+ }
+ {
+ bool isFiltered = VISU::Storable::FindValue( theMap, "myIsFilteredByScalars", "0" ).toInt();
+ float aMin = VISU::Storable::FindValue( theMap, "myScalarFilterRange[0]" ).toDouble();
+ float aMax = VISU::Storable::FindValue( theMap, "myScalarFilterRange[1]" ).toDouble();
+ SetScalarFilterRange( aMin, aMax );
+ UseScalarFiltering( isFiltered );
+ }
+ SetIsDistributionVisible(VISU::Storable::FindValue(theMap,"myIsDistributionVisible", "0").toInt());
UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange", "0").toInt());
myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
- myTitleWidth = VISU::Storable::FindValue(theMap,"myTitleWidth").toInt();
- myTitleHeight = VISU::Storable::FindValue(theMap,"myTitleHeight").toInt();
- myLabelWidth = VISU::Storable::FindValue(theMap,"myLabelWidth").toInt();
- myLabelHeight = VISU::Storable::FindValue(theMap,"myLabelHeight").toInt();
+ myTitleSize = VISU::Storable::FindValue(theMap,"myTitleSize").toInt();
+ myLabelSize = VISU::Storable::FindValue(theMap,"myLabelSize").toInt();
myBarWidth = VISU::Storable::FindValue(theMap,"myBarWidth").toInt();
myBarHeight = VISU::Storable::FindValue(theMap,"myBarHeight").toInt();
}
}
}
+
+ // Parameters of labels displayed field values
+
+ myValLblFontType = VISU::Storable::FindValue( theMap, "myValLblFontType", "0" ).toInt();
+ myIsBoldValLbl = VISU::Storable::FindValue( theMap, "myIsBoldValLbl", "1" ).toInt();
+ myIsItalicValLbl = VISU::Storable::FindValue( theMap, "myIsItalicValLbl", "0" ).toInt();
+ myIsShadowValLbl = VISU::Storable::FindValue( theMap, "myIsShadowValLbl", "0" ).toInt();
+ myValLblFontSize = VISU::Storable::FindValue( theMap, "myValLblFontSize", "12" ).toDouble();
+ myValLblFontColor[ 0 ] = VISU::Storable::FindValue( theMap, "myValLblFontColor[0]", "1" ).toFloat();
+ myValLblFontColor[ 1 ] = VISU::Storable::FindValue( theMap, "myValLblFontColor[1]", "1" ).toFloat();
+ myValLblFontColor[ 2 ] = VISU::Storable::FindValue( theMap, "myValLblFontColor[2]", "1" ).toFloat();
+
return this;
}
Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
Storable::DataToStream( theStr, "myIsFixedRange", IsRangeFixed() );
+
+ Storable::DataToStream( theStr, "myIsFilteredByScalars", IsScalarFilterUsed() );
+ Storable::DataToStream( theStr, "myScalarFilterRange[0]", GetScalarFilterMin() );
+ Storable::DataToStream( theStr, "myScalarFilterRange[1]", GetScalarFilterMax() );
+
+ Storable::DataToStream( theStr, "myIsDistributionVisible", GetIsDistributionVisible() ); // RKV
Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
Storable::DataToStream( theStr, "myOrientation", myOrientation );
Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
Storable::DataToStream( theStr, "myUnitsVisible", myIsUnits );
Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
+
Storable::DataToStream( theStr, "myLabelsFormat", myLabelsFormat.c_str() );
+
Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] );
Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] );
Storable::DataToStream( theStr, "myWidth", myWidth );
Storable::DataToStream( theStr, "myHeight", myHeight );
- Storable::DataToStream( theStr, "myTitleWidth", myTitleWidth );
- Storable::DataToStream( theStr, "myTitleHeight", myTitleHeight );
- Storable::DataToStream( theStr, "myLabelWidth", myLabelWidth );
- Storable::DataToStream( theStr, "myLabelHeight", myLabelHeight );
+ Storable::DataToStream( theStr, "myTitleSize", myTitleSize );
+ Storable::DataToStream( theStr, "myLabelSize", myLabelSize );
Storable::DataToStream( theStr, "myBarWidth", myBarWidth );
Storable::DataToStream( theStr, "myBarHeight", myBarHeight );
Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
+
+ // Parameters of labels displayed field values
+
+ Storable::DataToStream( theStr, "myValLblFontType", myValLblFontType );
+ Storable::DataToStream( theStr, "myIsBoldValLbl", myIsBoldValLbl );
+ Storable::DataToStream( theStr, "myIsItalicValLbl", myIsItalicValLbl );
+ Storable::DataToStream( theStr, "myIsShadowValLbl", myIsShadowValLbl );
+ Storable::DataToStream( theStr, "myValLblFontSize", myValLblFontSize );
+ Storable::DataToStream( theStr, "myValLblFontColor[0]", myValLblFontColor[ 0 ] );
+ Storable::DataToStream( theStr, "myValLblFontColor[1]", myValLblFontColor[ 1 ] );
+ Storable::DataToStream( theStr, "myValLblFontColor[2]", myValLblFontColor[ 2 ] );
+
std::ostringstream aGeomNameList;
std::string aMeshName = GetCMeshName();
}
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetMapScale(double theMapScale)
+{
+ GetSpecificPL()->SetMapScale(theMapScale);
+}
+
+
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
aStudyBuilder->CommitCommand();
return this;
}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetIsDistributionVisible(CORBA::Boolean isVisible)
+{
+ if( myIsDistributionVisible != isVisible ){
+ VISU::TSetModified aModified(this);
+ myIsDistributionVisible = isVisible;
+ myParamsTime.Modified();
+ }
+}
+
+//----------------------------------------------------------------------------
+CORBA::Boolean
+VISU::ColoredPrs3d_i
+::GetIsDistributionVisible()
+{
+ return myIsDistributionVisible;
+}
+
+//----------------------------------------------------------------------------
+
+
+int
+VISU::ColoredPrs3d_i
+::GetValLblFontType() const
+{
+ return myValLblFontType;
+}
+
+//----------------------------------------------------------------------------
+
+void
+VISU::ColoredPrs3d_i
+::SetValLblFontType( const int theType )
+{
+ if ( myValLblFontType == theType )
+ return;
+
+ VISU::TSetModified aModified( this );
+
+ myValLblFontType = theType;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+
+double
+VISU::ColoredPrs3d_i
+::GetValLblFontSize() const
+{
+ return myValLblFontSize;
+}
+
+//----------------------------------------------------------------------------
+
+void
+VISU::ColoredPrs3d_i
+::SetValLblFontSize( const double theSize )
+{
+ if ( VISU::CheckIsSameValue( myValLblFontSize, theSize ) )
+ return;
+
+ VISU::TSetModified aModified( this );
+
+ myValLblFontSize = theSize;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+
+void
+VISU::ColoredPrs3d_i
+::GetValLblFontColor( vtkFloatingPointType& theR,
+ vtkFloatingPointType& theG,
+ vtkFloatingPointType& theB ) const
+{
+ theR = myValLblFontColor[ 0 ];
+ theG = myValLblFontColor[ 1 ];
+ theB = myValLblFontColor[ 2 ];
+}
+
+//----------------------------------------------------------------------------
+
+void
+VISU::ColoredPrs3d_i
+::SetValLblFontColor( const vtkFloatingPointType theR,
+ const vtkFloatingPointType theG,
+ const vtkFloatingPointType theB )
+{
+ if ( VISU::CheckIsSameValue( myValLblFontColor[ 0 ], theR ) &&
+ VISU::CheckIsSameValue( myValLblFontColor[ 1 ], theG ) &&
+ VISU::CheckIsSameValue (myValLblFontColor[ 2 ], theB ) )
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ myValLblFontColor[ 0 ] = theR;
+ myValLblFontColor[ 1 ] = theG;
+ myValLblFontColor[ 2 ] = theB;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+
+bool
+VISU::ColoredPrs3d_i
+::IsBoldValLbl() const
+{
+ return myIsBoldValLbl;
+}
+
+//----------------------------------------------------------------------------
+
+void
+VISU::ColoredPrs3d_i
+::SetBoldValLbl( const bool theVal )
+{
+ if ( myIsBoldValLbl == theVal )
+ return;
+
+ VISU::TSetModified aModified( this );
+
+ myIsBoldValLbl = theVal;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+
+bool
+VISU::ColoredPrs3d_i
+::IsItalicValLbl() const
+{
+ return myIsItalicValLbl;
+}
+
+//----------------------------------------------------------------------------
+
+void
+VISU::ColoredPrs3d_i
+::SetItalicValLbl( const bool theVal )
+{
+ if ( myIsItalicValLbl == theVal )
+ return;
+
+ VISU::TSetModified aModified( this );
+
+ myIsItalicValLbl = theVal;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+
+bool
+VISU::ColoredPrs3d_i
+::IsShadowValLbl() const
+{
+ return myIsShadowValLbl;
+}
+
+//----------------------------------------------------------------------------
+
+void
+VISU::ColoredPrs3d_i
+::SetShadowValLbl( const bool theVal )
+{
+ if ( myIsShadowValLbl == theVal )
+ return;
+
+ VISU::TSetModified aModified( this );
+
+ myIsShadowValLbl = theVal;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+
virtual
void
- SetRatios(CORBA::Long theTitleWidth, CORBA::Long theTitleHeight,
- CORBA::Long theLabelWidth, CORBA::Long theLabelHeight,
+ SetRatios(CORBA::Long theTitleSize, CORBA::Long theLabelSize,
CORBA::Long theBarWidth, CORBA::Long theBarHeight);
virtual
virtual
CORBA::Long
- GetTitleWidth();
-
- virtual
- CORBA::Long
- GetTitleHeight();
+ GetTitleSize();
virtual
CORBA::Long
- GetLabelWidth();
-
- virtual
- CORBA::Long
- GetLabelHeight();
+ GetLabelSize();
virtual
CORBA::Long
CORBA::Boolean
IsUnitsVisible();
+ /*!
+ * Set the visibility of a distribution curve.
+ * \param theIs is used to switch on/off the visibility of a distribution curve.
+ */
+ virtual void SetIsDistributionVisible(CORBA::Boolean theIs);
+
+ //! Gets current visibility of a distribution curve
+ virtual CORBA::Boolean GetIsDistributionVisible();
+
+ //! Gets current filtering by scalars mode
+ virtual CORBA::Boolean IsScalarFilterUsed();
+
+ virtual void UseScalarFiltering( CORBA::Boolean theUseScalarFilter );
+
+ /*!
+ * Sets scalar range - min and max boundaries of the scalar bar.
+ * \param theMin Min boundary of the scalar bar.
+ * \param theMax Max boundary of the scalar bar.
+ * \param theIsFilter if true then filter by scalars.
+ */
+ virtual
+ void
+ SetScalarFilterRange( CORBA::Double theMin, CORBA::Double theMax );
+
+ //----------------------------------------------------------------------------
+ virtual
+ CORBA::Double
+ GetScalarFilterMin();
+
+ //----------------------------------------------------------------------------
+ virtual
+ CORBA::Double
+ GetScalarFilterMax();
+
//----------------------------------------------------------------------------
//! Gets memory size actually used by the presentation (Mb).
virtual
vtkFloatingPointType theG,
vtkFloatingPointType theB);
+ virtual
+ void
+ SetMapScale(double theMapScale = 1.0);
+
VISU_ColoredPL*
GetSpecificPL() const
{
return myColoredPL;
}
+ virtual
+ int
+ GetValLblFontType() const;
+
+ virtual
+ void
+ SetValLblFontType( const int theType );
+
+ virtual
+ double
+ GetValLblFontSize() const;
+
+ virtual
+ void
+ SetValLblFontSize( const double theSize );
+
+ virtual
+ bool
+ IsBoldValLbl() const;
+
+ virtual
+ void
+ SetBoldValLbl( const bool theVal );
+
+ virtual
+ bool
+ IsItalicValLbl() const;
+
+ virtual
+ void
+ SetItalicValLbl( const bool theVal );
+
+ virtual
+ bool
+ IsShadowValLbl() const;
+
+ virtual
+ void
+ SetShadowValLbl( const bool theVal );
+
+ virtual
+ void
+ GetValLblFontColor( vtkFloatingPointType& theR,
+ vtkFloatingPointType& theG,
+ vtkFloatingPointType& theB ) const;
+
+ virtual
+ void
+ SetValLblFontColor( const vtkFloatingPointType theR,
+ const vtkFloatingPointType theG,
+ const vtkFloatingPointType theB );
+
//----------------------------------------------------------------------------
protected:
/*!
int myNumberOfLabels;
std::string myLabelsFormat;
+
VISU::ColoredPrs3dBase::Orientation myOrientation;
vtkFloatingPointType myPosition[2],
myWidth, myHeight,
- myTitleWidth, myTitleHeight,
- myLabelWidth, myLabelHeight,
+ myTitleSize, myLabelSize,
myBarWidth, myBarHeight;
//Font management
VISU_ColoredPL* myColoredPL;
bool myIsFixedRange;
+ bool myIsDistributionVisible; // RKV
+
+ // Result labels
+ int myValLblFontType;
+ double myValLblFontSize;
+ bool myIsBoldValLbl;
+ bool myIsItalicValLbl;
+ bool myIsShadowValLbl;
+ vtkFloatingPointType myValLblFontColor[ 3 ];
};
vtkIdType aDataType = VTK_DOUBLE;
SALOME_MED::FIELDDOUBLE_ptr aFieldDouble = SALOME_MED::FIELDDOUBLE::_narrow(aMEDField);
- if(aFieldDouble->_is_nil())
- aDataType = VTK_LONG;
+ if(aFieldDouble->_is_nil()){
+ if (sizeof(long) == 4 ) // Size of CORBA::Long is always 4 (see CORBA_basetypes.h)
+ //Fix for IPAL20325 Crash on create presentation for imported field
+ aDataType = VTK_LONG;
+ else if (sizeof(int) == 4)
+ aDataType = VTK_INT;
+ else {
+ throw std::runtime_error("Can't map CORBA::Long to a VTK type");
+ }
+ }
aField->Init(aMEDField->getNumberOfComponents(), aDataType);
aFieldMap[aFieldName.in()] = aField;
static int MYDEBUG = 0;
#endif
+using namespace std;
//---------------------------------------------------------------
size_t
static int MYDEBUG = 0;
#endif
-
+using namespace std;
//----------------------------------------------------------------------------
size_t
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_Deformation_i.cc
-// Author :
-// Module : VISU
-
-#include "VISU_Deformation_i.hh"
-#include "VISU_Result_i.hh"
-#include "VISU_Prs3dUtils.hh"
-
-#include "VISU_DeformationPL.hxx"
-#include "VISU_Convertor.hxx"
-#include "VISU_DeformationPL.hxx"
-#include "VISUConfig.hh"
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-//---------------------------------------------------------------
-VISU::Deformation_i::Deformation_i(VISU::ColoredPrs3d_i *thePrs3d):
- myColoredPrs3d(thePrs3d)
-{
- if(MYDEBUG) MESSAGE("Deformation_i::Deformation_i()");
-}
-
-//---------------------------------------------------------------
-VISU::Deformation_i::~Deformation_i()
-{
- if(MYDEBUG) MESSAGE("Deformation_i::~Deformation_i()");
-}
-
-//---------------------------------------------------------------
-void VISU::Deformation_i::SetScale(CORBA::Double theScale)
-{
- if(MYDEBUG) MESSAGE("Deformation_i::SetScale()");
-
- VISU::TSetModified aModified(GetColoredPrs3d());
-
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformationPL, vtkFloatingPointType>
- (GetSpecificDeformedPL(), &VISU_DeformationPL::SetScale, theScale));
-}
-
-//---------------------------------------------------------------
-void VISU::Deformation_i::InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine){
-
- if(MYDEBUG) MESSAGE("Deformation_i::InitDeformedPipeLine()");
- myDeformationPL = theDeformedPipeLine;
-}
-
-//---------------------------------------------------------------
-CORBA::Double
-VISU::Deformation_i
-::GetScale()
-{
- if(MYDEBUG) MESSAGE("Deformation_i::GetScale()");
- return GetSpecificDeformedPL()->GetScale();
-}
-
-//---------------------------------------------------------------
-VISU::Entity VISU::Deformation_i::GetVectorialFieldEntity(){
- return myVectorialEntity;
-}
-
-//---------------------------------------------------------------
-char* VISU::Deformation_i::GetVectorialFieldName(){
- return CORBA::string_dup(myVectorialFieldName.c_str());
-}
-
-//---------------------------------------------------------------
-void VISU::Deformation_i::
-DeformationToStream(std::ostringstream& theStr)
-{
- Storable::DataToStream(theStr,"myScaleFactor", GetScale());
- Storable::DataToStream(theStr,"myVectorialField", GetVectorialFieldName());
- Storable::DataToStream(theStr,"myVectorialEntiry", GetVectorialFieldEntity());
-
-}
-
-//---------------------------------------------------------------
-void
-VISU::Deformation_i::RestoreDeformation(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap)
-{
- SetScale(VISU::Storable::FindValue(theMap,"myScaleFactor").toDouble());
- VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap, "myVectorialEntiry").toInt());
-
- SetVectorialField(anEntity,
- VISU::Storable::FindValue(theMap, "myVectorialField").toLatin1().constData());
-}
-
-//---------------------------------------------------------------
-void
-VISU::Deformation_i::SameAsDeformation(const Deformation_i *aDeformedPrs){
- if(const Deformation_i* aPrs = dynamic_cast<const Deformation_i*>(aDeformedPrs)) {
- Deformation_i* anOrigin = const_cast<Deformation_i*>(aPrs);
-
- CORBA::String_var aVectorialFieldName = anOrigin->GetVectorialFieldName();
- VISU::Entity anEntity = anOrigin->GetVectorialFieldEntity();
- this->SetVectorialField(anEntity,
- aVectorialFieldName);
- this->SetScale(anOrigin->GetScale());
- }
-}
-
-void VISU::Deformation_i::SetVectorialField(Entity theEntity, const char* theFieldName){
- if(MYDEBUG) MESSAGE("CutPlanes_i::SetVectorialField()");
-
- bool anIsModified = false;
- if(!anIsModified)
- anIsModified |= GetVectorialFieldEntity() != theEntity;
-
- if(!anIsModified)
- anIsModified |= GetVectorialFieldName() != theFieldName;
-
- if(!anIsModified)
- return;
-
- ColoredPrs3d_i *aColoredPrs = GetColoredPrs3d();
- int aTimeStampNumber = aColoredPrs->GetTimeStampNumber();
-
- VISU::TEntity aEntity = VISU::TEntity(theEntity);
-
- VISU::Result_i::PInput anInput = aColoredPrs->GetCResult()->GetInput(aColoredPrs->GetCMeshName(),
- theEntity,
- theFieldName,
- aTimeStampNumber);
-
- PField aVectorialField = anInput->GetField(aColoredPrs->GetCMeshName(), aEntity, theFieldName);
-
- VISU::PUnstructuredGridIDMapper anIDMapper =
- anInput->GetTimeStampOnMesh(aColoredPrs->GetCMeshName(),
- aEntity,
- theFieldName,
- aTimeStampNumber);
- if(GetSpecificDeformedPL() && anIDMapper) {
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformationPL, VISU::PUnstructuredGridIDMapper>
- (GetSpecificDeformedPL(), &VISU_DeformationPL::SetVectorialField, anIDMapper));
-
- VISU::TSetModified aModified(GetColoredPrs3d());
-
- myVectorialEntity = theEntity;
- myVectorialFieldName = theFieldName;
- myVectorialField = anIDMapper;
- }
-};
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_Deformation_i.hxx
-// Author :
-// Module : VISU
-
-#ifndef VISU_Deformation_i_HeaderFile
-#define VISU_Deformation_i_HeaderFile
-
-#include "VISU_I.hxx"
-#include "VISU_ColoredPrs3d_i.hh"
-#include "VISU_DeformationPL.hxx"
-
-
-
-namespace VISU{
-
- class VISU_I_EXPORT Deformation_i : public virtual POA_VISU::Deformation
- {
- Deformation_i(const Deformation_i&);
- public:
- typedef VISU::Deformation TInterface;
-
- Deformation_i(VISU::ColoredPrs3d_i* theColoredPrs3d);
- virtual ~Deformation_i();
-
- virtual
- void
- SetScale(CORBA::Double theScale);
-
- virtual
- CORBA::Double
- GetScale();
-
- virtual
- void
- DeformationToStream(std::ostringstream& theStr);
-
- virtual
- void
- RestoreDeformation(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap);
-
- virtual
- void
- SameAsDeformation(const Deformation_i *aDeformedPrs);
-
- virtual
- VISU::Entity
- GetVectorialFieldEntity();
-
- virtual
- char*
- GetVectorialFieldName();
-
- virtual void SetVectorialField(Entity theEntity, const char* theFieldName);
-
- protected:
- virtual
- void
- InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine);
-
- VISU_DeformationPL*
- GetSpecificDeformedPL() const
- {
- return myDeformationPL;
- }
-
- ColoredPrs3d_i* GetColoredPrs3d(){
- return myColoredPrs3d;
- }
-
-
- private:
- VISU_DeformationPL *myDeformationPL;
-
- PField myVectorialField;
- VISU::Entity myVectorialEntity;
- std::string myVectorialFieldName;
- ColoredPrs3d_i *myColoredPrs3d;
-
- };
-}
-
-#endif
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_DeformedShapeAndScalarMap_i.cc
-// Author : Eugeny Nikolaev
-// Module : VISU
-
-#include "VISU_DeformedShapeAndScalarMap_i.hh"
-#include "VISU_Prs3dUtils.hh"
-#include "VISU_Result_i.hh"
-
-#include "VISU_ScalarMapAct.h"
-#include "VISU_DeformedShapeAndScalarMapPL.hxx"
-#include "VISU_Convertor.hxx"
-
-#include "SUIT_ResourceMgr.h"
-#include "SALOME_Event.h"
-
-#include <vtkUnstructuredGrid.h>
-#include <vtkProperty.h>
-#include <vtkMapper.h>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-static int INCMEMORY = 4+12;
-
-
-//---------------------------------------------------------------
-size_t
-VISU::DeformedShapeAndScalarMap_i
-::IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber,
- bool theIsMemoryCheck)
-{
- size_t aResult = 0;
- try{
- aResult = TSuperClass::IsPossible(theResult,
- theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber,
- false);
- if(theIsMemoryCheck && aResult){
- VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
- VISU::PField aField = anInput->GetField(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName);
- if(aField->myNbComp <= 1)
- return 0;
-
- bool anIsEstimated = true;
- size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
- (VISU::TEntity)theEntity,
- theFieldName,
- theTimeStampNumber,
- anIsEstimated);
- if(anIsEstimated)
- aSize *= INCMEMORY;
- aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- if(MYDEBUG)
- MESSAGE("DeformedShapeAndScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
- }
- }catch(std::exception& exc){
- INFOS("Follow exception was occured :\n"<<exc.what());
- }catch(...){
- INFOS("Unknown exception was occured!");
- }
- return aResult;
-}
-
-//---------------------------------------------------------------
-int VISU::DeformedShapeAndScalarMap_i::myNbPresent = 0;
-
-//---------------------------------------------------------------
-QString
-VISU::DeformedShapeAndScalarMap_i
-::GenerateName()
-{
- return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);
-}
-
-//---------------------------------------------------------------
-const string VISU::DeformedShapeAndScalarMap_i::myComment = "SCALARMAPONDEFORMEDSHAPE"; // It is obsolete. Use "DEFORMEDSHAPEANDSCALARMAP" instead.
-
-//---------------------------------------------------------------
-const char*
-VISU::DeformedShapeAndScalarMap_i
-::GetComment() const
-{
- return myComment.c_str();
-}
-
-//----------------------------------------------------------------------------
-const char*
-VISU::DeformedShapeAndScalarMap_i
-::GetIconName()
-{
- if (!IsGroupsUsed())
- return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE";
- else
- return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS";
-}
-
-//---------------------------------------------------------------
-VISU::DeformedShapeAndScalarMap_i
-::DeformedShapeAndScalarMap_i(EPublishInStudyMode thePublishInStudyMode) :
- ColoredPrs3d_i(thePublishInStudyMode),
- ScalarMap_i(thePublishInStudyMode),
- myDeformedShapeAndScalarMapPL(NULL),
- myScalarTimeStampNumber(1)
-{}
-
-
-//---------------------------------------------------------------
-VISU::Storable*
-VISU::DeformedShapeAndScalarMap_i
-::Create(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber)
-{
- TSuperClass::Create(theMeshName,
- theEntity,
- theFieldName,
- theTimeStampNumber);
- SetScalarField(theEntity,
- theFieldName.c_str(),
- theTimeStampNumber);
- return this;
-}
-
-
-//---------------------------------------------------------------
-VISU::Storable*
-VISU::DeformedShapeAndScalarMap_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap)
-{
- if(!TSuperClass::Restore(theSObject, theMap))
- return NULL;
-
- QString aMeshName = VISU::Storable::FindValue(theMap,"myScalarMeshName");
- VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt());
-
- QString aFieldName = VISU::Storable::FindValue(theMap,"myScalarFieldName");
- int aTimeStampNumber = VISU::Storable::FindValue(theMap,"myScalarIteration").toInt();
-
- SetScalarField(anEntity,
- aFieldName.toLatin1().constData(),
- aTimeStampNumber);
-
- SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
-
- return this;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShapeAndScalarMap_i
-::ToStream(std::ostringstream& theStr)
-{
- TSuperClass::ToStream(theStr);
-
- Storable::DataToStream( theStr, "myScalarEntity", int(myScalarEntity));
- Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
- Storable::DataToStream( theStr, "myScalarIteration", int(myScalarTimeStampNumber));
-
- Storable::DataToStream( theStr, "myFactor", GetScale() );
-}
-
-
-//---------------------------------------------------------------
-VISU::DeformedShapeAndScalarMap_i
-::~DeformedShapeAndScalarMap_i()
-{
- if(MYDEBUG) MESSAGE("DeformedShapeAndScalarMap_i::~DeformedShapeAndScalarMap_i()");
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShapeAndScalarMap_i
-::SameAs(const Prs3d_i* theOrigin)
-{
- TSuperClass::SameAs(theOrigin);
-
- if(const DeformedShapeAndScalarMap_i* aPrs3d = dynamic_cast<const DeformedShapeAndScalarMap_i*>(theOrigin)){
- DeformedShapeAndScalarMap_i* anOrigin = const_cast<DeformedShapeAndScalarMap_i*>(aPrs3d);
- CORBA::String_var aFieldName = anOrigin->GetScalarFieldName();
-
- SetScalarField(anOrigin->GetScalarEntity(),
- aFieldName,
- anOrigin->GetScalarTimeStampNumber());
- Update();
- }
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShapeAndScalarMap_i
-::SetScale(CORBA::Double theScale)
-{
- VISU::TSetModified aModified(this);
-
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapeAndScalarMapPL, vtkFloatingPointType>
- (GetSpecificPL(), &VISU_DeformedShapeAndScalarMapPL::SetScale, theScale));
-}
-
-
-//---------------------------------------------------------------
-CORBA::Double
-VISU::DeformedShapeAndScalarMap_i
-::GetScale()
-{
- return myDeformedShapeAndScalarMapPL->GetScale();
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShapeAndScalarMap_i
-::CreatePipeLine(VISU_PipeLine* thePipeLine)
-{
- if(!thePipeLine){
- myDeformedShapeAndScalarMapPL = VISU_DeformedShapeAndScalarMapPL::New();
- }else
- myDeformedShapeAndScalarMapPL = dynamic_cast<VISU_DeformedShapeAndScalarMapPL*>(thePipeLine);
-
- myDeformedShapeAndScalarMapPL->GetMapper()->SetScalarVisibility(1);
-
- TSuperClass::CreatePipeLine(myDeformedShapeAndScalarMapPL);
-}
-
-
-//---------------------------------------------------------------
-bool
-VISU::DeformedShapeAndScalarMap_i
-::CheckIsPossible()
-{
- return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
-}
-
-
-//---------------------------------------------------------------
-VISU_Actor*
-VISU::DeformedShapeAndScalarMap_i
-::CreateActor()
-{
- VISU_Actor* anActor = TSuperClass::CreateActor(true);
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
- bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
- anActor->SetRepresentation(aDispMode);
- if (toShrink)
- anActor->SetShrink();
- anActor->SetVTKMapping(false);
- return anActor;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShapeAndScalarMap_i
-::UpdateActor(VISU_Actor* theActor)
-{
- if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
- anActor->SetBarVisibility(true);
- GetPipeLine()->GetMapper()->SetScalarVisibility(1);
- }
- TSuperClass::UpdateActor(theActor);
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShapeAndScalarMap_i
-::SetField(VISU::PField theField)
-{
- TSuperClass::SetField(theField);
-
- if(!myScalarField)
- myScalarField = theField;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::DeformedShapeAndScalarMap_i
-::SetScalarField(VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theTimeStampNumber)
-{
- bool anIsModified = false;
-
- if(!anIsModified)
- anIsModified |= myScalarEntity != theEntity;
-
- if(!anIsModified)
- anIsModified |= myScalarFieldName != theFieldName;
-
- if(!anIsModified)
- anIsModified |= myScalarTimeStampNumber != theTimeStampNumber;
-
- if(!anIsModified)
- return;
-
- VISU::TSetModified aModified(this);
-
- VISU::TEntity aEntity = VISU::TEntity(theEntity);
- VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
- theEntity,
- theFieldName,
- theTimeStampNumber);
- myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
-
- VISU::PUnstructuredGridIDMapper anIDMapper =
- anInput->GetTimeStampOnMesh(GetCMeshName(),
- aEntity,
- theFieldName,
- theTimeStampNumber);
-
- vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput();
- if(myDeformedShapeAndScalarMapPL && anOutput)
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapeAndScalarMapPL, vtkDataSet*>
- (GetSpecificPL(), &VISU_DeformedShapeAndScalarMapPL::SetScalars, anOutput));
-
- myScalarEntity = theEntity;
- myScalarFieldName = theFieldName;
- myScalarTimeStampNumber = theTimeStampNumber;
-
- SetTitle(theFieldName);
- SetScalarMode(GetScalarMode());
- if(!IsRangeFixed() && IsPipeLineExists())
- SetSourceRange();
-
- myParamsTime.Modified();
-}
-
-
-//---------------------------------------------------------------
-VISU::Entity
-VISU::DeformedShapeAndScalarMap_i
-::GetScalarEntity()
-{
- return myScalarEntity;
-}
-
-
-//---------------------------------------------------------------
-char*
-VISU::DeformedShapeAndScalarMap_i
-::GetScalarFieldName()
-{
- return CORBA::string_dup(myScalarFieldName.c_str());
-}
-
-
-//---------------------------------------------------------------
-CORBA::Long
-VISU::DeformedShapeAndScalarMap_i
-::GetScalarTimeStampNumber()
-{
- return myScalarTimeStampNumber;
-}
-
-
-//---------------------------------------------------------------
-VISU::PField
-VISU::DeformedShapeAndScalarMap_i
-::GetScalarField()
-{
- return myScalarField;
-}
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File: VISU_DeformedShapeAndScalarMap_i.hh
-// Author: Eugeny Nikolaev
-// Module : VISU
-
-#ifndef VISU_DeformedShapeAndScalarMap_i_HeaderFile
-#define VISU_DeformedShapeAndScalarMap_i_HeaderFile
-
-#include "VISU_ScalarMap_i.hh"
-
-class VISU_DeformedShapeAndScalarMapPL;
-
-namespace VISU
-{
- //----------------------------------------------------------------------------
- //! Class of Scalar Map on Deformed Shape presentation.
- class VISU_I_EXPORT DeformedShapeAndScalarMap_i : public virtual POA_VISU::DeformedShapeAndScalarMap,
- public virtual ScalarMap_i
- {
- static int myNbPresent;
- DeformedShapeAndScalarMap_i(const DeformedShapeAndScalarMap_i&);
-
- public:
- //----------------------------------------------------------------------------
- typedef ScalarMap_i TSuperClass;
- typedef VISU::DeformedShapeAndScalarMap TInterface;
-
- explicit
- DeformedShapeAndScalarMap_i(EPublishInStudyMode thePublishInStudyModep);
-
- virtual
- ~DeformedShapeAndScalarMap_i();
-
- virtual
- VISU::VISUType
- GetType()
- {
- return VISU::TDEFORMEDSHAPEANDSCALARMAP;
- }
-
- virtual
- void
- SetScale(CORBA::Double theScale);
-
- virtual
- CORBA::Double
- GetScale();
-
- virtual
- void
- SameAs(const Prs3d_i* theOrigin);
-
- VISU_DeformedShapeAndScalarMapPL*
- GetSpecificPL()
- {
- return myDeformedShapeAndScalarMapPL;
- }
-
- protected:
- //! Redefines VISU_ColoredPrs3d_i::SetField
- virtual
- void
- SetField(VISU::PField theField);
-
- //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
- virtual
- void
- CreatePipeLine(VISU_PipeLine* thePipeLine);
-
- //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
- virtual
- bool
- CheckIsPossible();
-
- public:
- //! Redefines VISU_ColoredPrs3d_i::IsPossible
- static
- size_t
- IsPossible(Result_i* theResult,
- const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber,
- bool theIsMemoryCheck);
-
- //! Redefines VISU_ColoredPrs3d_i::IsPossible
- virtual
- Storable*
- Create(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber);
-
- //! Redefines VISU_ColoredPrs3d_i::ToStream
- virtual
- void
- ToStream(std::ostringstream& theStr);
-
- //! Redefines VISU_ColoredPrs3d_i::Restore
- virtual
- Storable*
- Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap);
-
- static const std::string myComment;
-
- virtual
- const char*
- GetComment() const;
-
- virtual
- QString
- GenerateName();
-
- virtual
- const char*
- GetIconName();
-
- virtual
- VISU_Actor*
- CreateActor();
-
- virtual
- void
- UpdateActor(VISU_Actor* theActor) ;
-
- virtual
- void
- SetScalarField(VISU::Entity theEntity,
- const char* theFieldName,
- CORBA::Long theTimeStampNumber);
-
- virtual
- VISU::Entity
- GetScalarEntity();
-
- virtual
- char*
- GetScalarFieldName();
-
- virtual
- CORBA::Long
- GetScalarTimeStampNumber();
-
- virtual
- VISU::PField
- GetScalarField();
-
- private:
- VISU_DeformedShapeAndScalarMapPL *myDeformedShapeAndScalarMapPL;
-
- PField myScalarField;
- VISU::Entity myScalarEntity;
- std::string myScalarFieldName;
- CORBA::Long myScalarTimeStampNumber;
- };
-}
-#endif
static int MYDEBUG = 0;
#endif
+using namespace std;
//---------------------------------------------------------------
size_t
//---------------------------------------------------------------------------
+ void SetClippingPlane(Prs3d_i* thePrs, string theName,
+ std::ostream& theStr,
+ std::string thePrefix)
+ {
+ VISU_CutPlaneFunction* aPlane;
+ VISU_Gen_i* aGen = VISU_Gen_i::GetVisuGenImpl();
+ VISU_ClippingPlaneMgr& aMgr = aGen->GetClippingPlaneMgr();
+ int aId;
+ for (int i = 0; i < thePrs->GetNumberOfClippingPlanes(); i++) {
+ aPlane = dynamic_cast<VISU_CutPlaneFunction*>(thePrs->GetClippingPlane(i));
+ if (aPlane) {
+ if (!aPlane->isAuto()) {
+ aId = aMgr.GetPlaneId(aPlane);
+ if (aId > -1) {
+ theStr<<thePrefix<<"aVisu.ApplyClippingPlane("<<theName<<", "<<aId<<")"<<endl;
+ }
+ }
+ }
+ }
+ }
+
+
void
Prs3dToPython(VISU::Prs3d_i* theServant,
std::ostream& theStr,
float x, y, z;
theServant->GetOffset(x,y,z);
theStr<<thePrefix<<theName<<".SetOffset("<<x<<", "<<y<<", "<<z<<")"<<endl;
+ SetClippingPlane(theServant, theName, theStr, thePrefix);
}
//---------------------------------------------------------------------------
aParam = "VISU.LOGARITHMIC";
break;
}
+ std::string aVisible = theServant->IsBarVisible()? "True" : "False";
theStr<<thePrefix<<theName<<".SetScaling("<<aParam<<")"<<endl;
+ theStr<<thePrefix<<theName<<".SetBarVisible("<<aVisible<<")"<<endl;
return thePrefix;
}
}
}
-
+
//---------------------------------------------------------------------------
void
break;
}
theStr<<thePrefix<<aName<<".SetPresentationType("<<aParam<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetShrink("<<(aServant->IsShrank()? "True" : "False")<<")"<<endl;
theStr<<thePrefix<<endl;
DumpChildrenToPython(theStudy,
theStr<<thePrefix<<endl;
}
+
+ void
+ DumpClippingPlanesToPython(SALOMEDS::Study_ptr theStudy,
+ CORBA::Boolean theIsPublished,
+ CORBA::Boolean& theIsValidScript,
+ SALOMEDS::SObject_ptr theSObject,
+ std::ostream& theStr,
+ std::string thePrefix,
+ VISU_ClippingPlaneMgr& thePlaneMgr)
+ {
+
+ if(!theIsPublished) return;
+
+ VISU_CutPlaneFunction* aPlane;
+ double aOrigin[3], aDir[3];
+ for (int i = 0; i < thePlaneMgr.GetClippingPlanesNb(); i++) {
+ aPlane = thePlaneMgr.GetClippingPlane(i);
+ aPlane->GetOrigin(aOrigin);
+ aPlane->GetNormal(aDir);
+
+ theStr<<thePrefix<<"aVisu.CreateClippingPlane("<<
+ aOrigin[0]<<","<<aOrigin[1]<<","<<aOrigin[2]<<","<<
+ aDir[0]<<","<<aDir[1]<<","<<aDir[2]<<","<<
+ aPlane->isAuto()<<",\""<<aPlane->getName()<<"\")"<<endl;
+ }
+ theStr<<endl;
+ }
+
+
//---------------------------------------------------------------------------
Engines::TMPFile*
VISU_Gen_i::
aStr<<endl;
SALOMEDS::SComponent_var aComponent = FindOrCreateVisuComponent(aStudy);
+
+ VISU::DumpClippingPlanesToPython(aStudy,
+ theIsPublished,
+ theIsValidScript,
+ aComponent.in(),
+ aStr,
+ aPrefix,
+ myClippingPlaneMgr);
+
+
VISU::DumpChildrenToPython(aStudy,
theIsPublished,
theIsValidScript,
aStr,
aPrefix);
+
//Output the script that sets up the visul parameters.
if(theIsPublished) {
char* script = aStudy->GetDefaultScript("Post-Pro", aPrefix.c_str());
static int INCMEMORY = 10;
+using namespace std;
+
//----------------------------------------------------------------------------
size_t
VISU::GaussPoints_i
VISU::GaussPoints_i
::CreateActor()
{
- return OnCreateActor1();
+ VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
+ if(OnCreateActor(anActor))
+ return anActor;
+ return NULL;
+ // return OnCreateActor1();
}
//----------------------------------------------------------------------------
theScalarBar->SetTitle(GetScalarBarTitle().c_str());
theScalarBar->SetOrientation(GetBarOrientation());
theScalarBar->SetNumberOfLabels(GetLabels());
- theScalarBar->SetRatios(GetTitleWidth(), GetTitleHeight(),
- GetLabelWidth(), GetLabelHeight(),
+ theScalarBar->SetRatios(GetTitleSize(), GetLabelSize(),
GetBarWidth(), GetBarHeight());
theScalarBar->SetLabelFormat(GetLabelsFormat());
theActor->SetRepresentation( VTK_POINTS );
else
theActor->SetRepresentation( VTK_SURFACE );
+
+ // Update values labels
+
+ vtkTextProperty* aProp = anActor->GetsValLabelsProps();
+ if ( aProp )
+ {
+ aProp->SetFontFamily( GetValLblFontType() );
+ aProp->SetFontSize( GetValLblFontSize() );
+ aProp->SetBold( IsBoldValLbl() );
+ aProp->SetItalic( IsItalicValLbl() );
+ aProp->SetShadow( IsShadowValLbl() );
+
+ vtkFloatingPointType anRGB[ 3 ];
+ GetValLblFontColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
+ aProp->SetColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
+ }
}
+
TSuperClass::UpdateActor(theActor);
}
static int MYDEBUG = 0;
#endif
+using namespace std;
+
extern "C"
VISU_I_EXPORT VISU::VISU_Gen_ptr
GetImpl(CORBA::ORB_ptr theORB,
Storable::RegistryStorableEngine(ColoredPrs3dHolder_i::myComment.c_str(),&(ColoredPrs3dHolder_i::StorableEngine));
Storable::RegistryStorableEngine(ColoredPrs3dCache_i::myComment.c_str(),&(ColoredPrs3dCache_i::StorableEngine));
+ Storable::RegistryStorableEngine(PointMap3d_i::myComment.c_str(),&(PointMap3d_i::StorableEngine));
Storable::RegistryStorableEngine(Table_i::myComment.c_str(),&(Table_i::StorableEngine));
Storable::RegistryStorableEngine(Curve_i::myComment.c_str(),&(Curve_i::StorableEngine));
Storable::RegistryStorableEngine(Container_i::myComment.c_str(),&(Container_i::StorableEngine));
CORBA::String_var aStudyName = aListOfOpenStudies[0];
//aFileInfo.setFile(aStudyName.in());
myStudyDocument = aStudyManager->GetStudyByName(aStudyName/*aFileInfo.baseName()*/);
+ myClippingPlaneMgr.SetStudy(GetStudy(myStudyDocument));
}else
if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : there is no opened study in StudyManager !!!");
}
std::string aStudyName (aName.in());
if(MYDEBUG) MESSAGE("StudyId = " << theStudy->StudyId() << "; Name = '" << aName.in() << "'");
myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
+ myClippingPlaneMgr.SetStudy(GetStudy(myStudyDocument));
ProcessVoidEvent(new TEvent(aStudyName));
{
return ColoredPrs3dCache_i::GetInstance(theStudy);
}
+
+
+ CORBA::Long VISU_Gen_i::CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name)
+ {
+ return myClippingPlaneMgr.CreateClippingPlane(X, Y, Z, dX, dY, dZ, isAuto, name);
+ }
+
+
+ void VISU_Gen_i::EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name)
+ {
+ myClippingPlaneMgr.EditClippingPlane(id, X, Y, Z, dX, dY, dZ, isAuto, name);
+ }
+
+ /* Returns clipping plane by its Id */
+ VISU::ClippingPlane* VISU_Gen_i::GetClippingPlane(CORBA::Long id)
+ {
+ VISU_CutPlaneFunction* aPlane = myClippingPlaneMgr.GetClippingPlane(id);
+
+ if (aPlane != NULL) {
+ double aOrigin[3];
+ double aDir[3];
+ aPlane->GetOrigin(aOrigin);
+ aPlane->GetNormal(aDir);
+
+ VISU::ClippingPlane* aRetPlane = new VISU::ClippingPlane;
+ aRetPlane->X = aOrigin[0];
+ aRetPlane->Y = aOrigin[1];
+ aRetPlane->Z = aOrigin[2];
+ aRetPlane->dX = aDir[0];
+ aRetPlane->dY = aDir[1];
+ aRetPlane->dZ = aDir[2];
+ aRetPlane->isAuto = aPlane->isAuto();
+
+ aRetPlane->name = aPlane->getName().c_str();
+ return aRetPlane;
+ }
+ return NULL;
+ }
+
+ /* Deletes clipping plane by its Id */
+ CORBA::Boolean VISU_Gen_i::DeleteClippingPlane(CORBA::Long id)
+ {
+ return myClippingPlaneMgr.DeleteClippingPlane(id);
+ }
+
+ /* Applyes a clipping plane with Id to presentation thePrs */
+ CORBA::Boolean VISU_Gen_i::ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id)
+ {
+ VISU::Prs3d_i* aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs).in());
+ return myClippingPlaneMgr.ApplyClippingPlane(aPrs, id);
+ }
+
+ /* Detaches a clipping plane with Id from presentation thePrs */
+ CORBA::Boolean VISU_Gen_i::DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id)
+ {
+ VISU::Prs3d_i* aPrs = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs).in());
+ return myClippingPlaneMgr.DetachClippingPlane(aPrs, id);
+ }
+
+ /* Get number of clipping planes */
+ CORBA::Long VISU_Gen_i::GetClippingPlanesNb()
+ {
+ return myClippingPlaneMgr.GetClippingPlanesNb();
+ }
+
+
}
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
#include "VISU_ColoredPrs3d_i.hh"
+#include "VISU_ClippingPlaneMgr.hxx"
#include <string>
public virtual Base_i
{
SALOMEDS::Study_var myStudyDocument;
+ VISU_ClippingPlaneMgr myClippingPlaneMgr;
+
VISU_Gen_i(const VISU::VISU_Gen_i &);
public:
VISU_Gen_i(CORBA::ORB_ptr theORB,
virtual
VISU::ColoredPrs3dCache_ptr
GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
+
+
+ virtual CORBA::Long CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name);
+
+ virtual void EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
+ CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
+ CORBA::Boolean isAuto, const char* name);
+
+ /* Returns clipping plane by its Id */
+ virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
+
+ /* Deletes clipping plane by its Id */
+ virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
+
+ /* Applyes a clipping plane with Id to presentation thePrs */
+ virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
+
+ /* Detaches a clipping plane with Id from presentation thePrs */
+ virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
+
+ /* Get number of clipping planes */
+ virtual CORBA::Long GetClippingPlanesNb();
+
+ VISU_ClippingPlaneMgr& GetClippingPlaneMgr() { return myClippingPlaneMgr; }
+
};
}
static int MYDEBUG = 0;
#endif
+using namespace std;
+
//---------------------------------------------------------------
size_t
VISU::IsoSurfaces_i
static int INCMEMORY = 4;
+using namespace std;
+
//----------------------------------------------------------------------------
namespace
{
SetMeshName(theMeshName.c_str());
myEntity = int(theEntity);//jfa IPAL9284
mySubMeshName = theFamilyName;
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ myIsShrank = aResourceMgr->booleanValue("VISU", "mesh_shrink", false);
return Build(false);
}
throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
if (!theRestoring) {
myPresentType = VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
+ myIsShrank = (myPresentType == VISU::SHRINK);
+
if(myEntity == VISU::NODE_ENTITY)
myPresentType = VISU::POINT;
SetName((const char*)GenerateName().toLatin1(), false);
return;
VISU::TSetModified aModified(this);
-
+ if (theType == VISU::SHRINK) {
+ myIsShrank = true;
+ }
myPresentType = theType;
myParamsTime.Modified();
}
myPresentType = VISU::PresentationType(VISU::Storable::FindValue(theMap,"myPresentType").toInt());
+ myIsShrank = (VISU::Storable::FindValue(theMap,"myIsShrank", "0").toInt() == 1)? true: false;
+
myCellColor.R = VISU::Storable::FindValue(theMap,"myCellColor.R").toDouble();
myCellColor.G = VISU::Storable::FindValue(theMap,"myCellColor.G").toDouble();
myCellColor.B = VISU::Storable::FindValue(theMap,"myCellColor.B").toDouble();
Storable::DataToStream( theStr, "myPresentType", int(myPresentType) );
+ Storable::DataToStream( theStr, "myIsShrank", (myIsShrank? "1":"0"));
+
Storable::DataToStream( theStr, "myCellColor.R", myCellColor.R );
Storable::DataToStream( theStr, "myCellColor.G", myCellColor.G );
Storable::DataToStream( theStr, "myCellColor.B", myCellColor.B );
try{
VISU::Prs3d_i::CreateActor(anActor);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- bool toShrink = aResourceMgr->booleanValue("VISU", "mesh_shrink", false);
- if (toShrink) anActor->SetShrink();
+ //bool toShrink = aResourceMgr->booleanValue("VISU", "mesh_shrink", false);
+ //if (toShrink) anActor->SetShrink();
+ if (anActor->IsShrunkable()) {
+ if (myIsShrank)
+ anActor->SetShrink();
+ else
+ anActor->UnShrink();
+ }
+ anActor->SetFeatureEdgesAngle( aResourceMgr->doubleValue("VISU", "feature_edges_angle", 0.0) );
+ anActor->SetFeatureEdgesFlags( aResourceMgr->booleanValue("VISU", "show_feature_edges", false),
+ aResourceMgr->booleanValue("VISU", "show_boundary_edges", false),
+ aResourceMgr->booleanValue("VISU", "show_manifold_edges", false),
+ aResourceMgr->booleanValue("VISU", "show_non_manifold_edges", false) );
+ anActor->SetFeatureEdgesColoring( aResourceMgr->booleanValue("VISU", "feature_edges_coloring", false) );
+
UpdateActor(anActor);
}catch (...) {
anActor->Delete();
if(MYDEBUG) MESSAGE("Mesh_i::UpdateActor");
VISU::Prs3d_i::UpdateActor(anActor);
anActor->SetRepresentation(myPresentType);
+ if (anActor->IsShrunkable()) {
+ if (myIsShrank)
+ anActor->SetShrink();
+ else
+ anActor->UnShrink();
+ }
anActor->GetSurfaceProperty()->SetColor(myCellColor.R, myCellColor.G, myCellColor.B);
anActor->GetEdgeProperty()->SetColor(myLinkColor.R, myLinkColor.G, myLinkColor.B);
anActor->GetNodeProperty()->SetColor(myNodeColor.R, myNodeColor.G, myNodeColor.B);
}
//----------------------------------------------------------------------------
+
+
+void VISU::Mesh_i::SetShrink(CORBA::Boolean toShrink)
+{
+ if(toShrink == myIsShrank)
+ return;
+ VISU::TSetModified aModified(this);
+ myIsShrank = toShrink;
+ myParamsTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+CORBA::Boolean VISU::Mesh_i::IsShrank()
+{
+ return myIsShrank;
+}
+
VISU::PresentationType
GetPresentationType();
+
+ virtual void SetShrink(CORBA::Boolean toShrink);
+
+ virtual CORBA::Boolean IsShrank();
+
VISU_MeshPL* GetSpecificPL() const
{
return myMeshPL;
SALOMEDS::Color myCellColor;
SALOMEDS::Color myNodeColor;
SALOMEDS::Color myLinkColor;
+ bool myIsShrank;
public:
static
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_MonoColorPrs_i.cxx
-// Author : Vitaly Smetannikov
-// Module : VISU
-
-
-#include "VISU_MonoColorPrs_i.hh"
-#include "VISU_Prs3dUtils.hh"
-#include "VISU_PipeLineUtils.hxx"
-#include "VISU_ScalarMapAct.h"
-
-#include "VISU_PipeLine.hxx"
-
-#include <vtkDataSetMapper.h>
-#include <vtkProperty.h>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-//---------------------------------------------------------------
-VISU::MonoColorPrs_i
-::MonoColorPrs_i(EPublishInStudyMode thePublishInStudyMode):
- ColoredPrs3d_i(thePublishInStudyMode),
- ScalarMap_i(thePublishInStudyMode)
-{
- if(MYDEBUG) MESSAGE("MonoColorPrs_i::MonoColorPrs_i");
-}
-
-//---------------------------------------------------------------
-void
-VISU::MonoColorPrs_i
-::SameAs(const Prs3d_i* theOrigin)
-{
- TSuperClass::SameAs(theOrigin);
-
- if(const MonoColorPrs_i* aPrs3d = dynamic_cast<const MonoColorPrs_i*>(theOrigin)){
- MonoColorPrs_i* anOrigin = const_cast<MonoColorPrs_i*>(aPrs3d);
- SetColor(anOrigin->GetColor());
- ShowColored(anOrigin->IsColored());
- }
-}
-
-
-//---------------------------------------------------------------
-VISU::Storable*
-VISU::MonoColorPrs_i
-::Create(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber)
-{
- myIsColored = false;
- myColor.R = myColor.G = myColor.B = 0.5;
- return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
-}
-
-//---------------------------------------------------------------
-VISU::Storable*
-VISU::MonoColorPrs_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap)
-{
- if(!TSuperClass::Restore(theSObject, theMap))
- return NULL;
-
- myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").toInt();
- myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
- myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
- myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
-
- return this;
-}
-
-//---------------------------------------------------------------
-void
-VISU::MonoColorPrs_i
-::ToStream(std::ostringstream& theStr)
-{
- TSuperClass::ToStream(theStr);
-
- Storable::DataToStream( theStr, "myIsColored", myIsColored );
- Storable::DataToStream( theStr, "myColor.R", myColor.R );
- Storable::DataToStream( theStr, "myColor.G", myColor.G );
- Storable::DataToStream( theStr, "myColor.B", myColor.B );
-}
-
-
-//---------------------------------------------------------------
-VISU::MonoColorPrs_i::~MonoColorPrs_i()
-{
- if(MYDEBUG) MESSAGE("MonoColorPrs_i::~MonoColorPrs_i()");
-}
-
-//---------------------------------------------------------------
-CORBA::Boolean VISU::MonoColorPrs_i::IsColored()
-{
- return myIsColored;
-}
-
-
-
-//---------------------------------------------------------------
-void
-VISU::MonoColorPrs_i::ShowColored(CORBA::Boolean theColored)
-{
- if(myIsColored == theColored)
- return;
- myIsColored = theColored;
- myParamsTime.Modified();
-}
-
-//---------------------------------------------------------------
-SALOMEDS::Color VISU::MonoColorPrs_i::GetColor()
-{
- return myColor;
-}
-
-//---------------------------------------------------------------
-void VISU::MonoColorPrs_i::SetColor(const SALOMEDS::Color& theColor)
-{
- bool anIsSameValue = VISU::CheckIsSameValue(myColor.R, theColor.R);
- anIsSameValue &= VISU::CheckIsSameValue(myColor.G, theColor.G);
- anIsSameValue &= VISU::CheckIsSameValue(myColor.B, theColor.B);
- if(anIsSameValue)
- return;
-
- VISU::TSetModified aModified(this);
-
- myColor = theColor;
- myParamsTime.Modified();
-}
-
-//---------------------------------------------------------------
-VISU_Actor* VISU::MonoColorPrs_i::CreateActor(bool toSupressShrinking)
-{
- VISU_Actor* anActor = TSuperClass::CreateActor(toSupressShrinking);
- anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
- return anActor;
-}
-
-//---------------------------------------------------------------
-VISU_Actor* VISU::MonoColorPrs_i::CreateActor()
-{
- return CreateActor(false);
-}
-
-//---------------------------------------------------------------
-void VISU::MonoColorPrs_i::UpdateActor(VISU_ActorBase* theActor)
-{
- if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
- if(IsColored()){
- anActor->SetBarVisibility(true);
- GetPipeLine()->GetMapper()->SetScalarVisibility(1);
- }else{
- anActor->SetBarVisibility(false);
- GetPipeLine()->GetMapper()->SetScalarVisibility(0);
- anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
- }
- TSuperClass::UpdateActor(theActor);
- }
-}
-
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_MonoColorPrs_i.hxx
-// Author : Vitaly Smetannikov
-// Module : VISU
-
-
-#ifndef VISU_MonoColorPrs_i_HeaderFile
-#define VISU_MonoColorPrs_i_HeaderFile
-
-#include <VISU_I.hxx>
-#include "VISU_ScalarMap_i.hh"
-
-namespace VISU
-{
- //----------------------------------------------------------------------------
- class VISU_I_EXPORT MonoColorPrs_i : public virtual POA_VISU::MonoColorPrs,
- public virtual ScalarMap_i
- {
- MonoColorPrs_i(const MonoColorPrs_i&);
-
- public:
- //----------------------------------------------------------------------------
- typedef ScalarMap_i TSuperClass;
- typedef VISU::MonoColorPrs TInterface;
-
- explicit MonoColorPrs_i(EPublishInStudyMode thePublishInStudyModep);
-
- virtual void SameAs(const Prs3d_i* theOrigin);
-
- virtual ~MonoColorPrs_i();
-
- virtual CORBA::Boolean IsColored();
-
- virtual void ShowColored(CORBA::Boolean theColored);
-
- virtual SALOMEDS::Color GetColor();
-
- virtual void SetColor(const SALOMEDS::Color& theColor);
-
- protected:
- SALOMEDS::Color myColor;
- bool myIsColored;
-
- public:
- virtual Storable* Create(const std::string& theMeshName,
- VISU::Entity theEntity,
- const std::string& theFieldName,
- CORBA::Long theTimeStampNumber);
-
- virtual void ToStream(std::ostringstream& theStr);
-
- virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap);
-
- virtual VISU_Actor* CreateActor();
-
- virtual VISU_Actor* CreateActor(bool toSupressShrinking);
-
- virtual void UpdateActor(VISU_ActorBase* theActor);
- };
-};
-#endif
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_OptionalDeformation_i.cc
-// Author :
-// Module : VISU
-
-#include "VISU_OptionalDeformation_i.hh"
-#include "VISU_Result_i.hh"
-#include "VISU_Prs3dUtils.hh"
-#include "VISUConfig.hh"
-
-#include "VISU_OptionalDeformationPL.hxx"
-
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-//---------------------------------------------------------------
-VISU::OptionalDeformation_i::OptionalDeformation_i(VISU::ColoredPrs3d_i *theColoredPrs3d):
- Deformation_i(theColoredPrs3d)
-{
- if(MYDEBUG) MESSAGE("OptionalDeformation_i::OptionalDeformation_i()");
-}
-
-//---------------------------------------------------------------
-VISU::OptionalDeformation_i::~OptionalDeformation_i()
-{
- if(MYDEBUG) MESSAGE("OptionalDeformation_i::~OptionalDeformation_i()");
-}
-
-//---------------------------------------------------------------
-void VISU::OptionalDeformation_i::UseDeformation(CORBA::Boolean theFlag){
- if(MYDEBUG) MESSAGE("OptionalDeformation_i::UseDeformation()");
-
- VISU::TSetModified aModified(GetColoredPrs3d());
-
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_OptionalDeformationPL, bool>
- (GetSpecificDeformedPL(), &VISU_OptionalDeformationPL::UseDeformation, theFlag));
-}
-
-//---------------------------------------------------------------
-CORBA::Boolean VISU::OptionalDeformation_i::IsDeformed(){
-
- if(MYDEBUG) MESSAGE("OptionalDeformation_i::IsDeformed()");
- return GetSpecificDeformedPL()->IsDeformed();
-}
-
-
-void VISU::OptionalDeformation_i::InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine){
-
- if(MYDEBUG) MESSAGE("OptionalDeformation_i::InitDeformedPipeLine()");
- myOptionalDeformationPL = dynamic_cast<VISU_OptionalDeformationPL*>(theDeformedPipeLine);
-
- TSuperClass::InitDeformedPipeLine(myOptionalDeformationPL);
-}
-
-//---------------------------------------------------------------
-void VISU::OptionalDeformation_i::
-DeformationToStream(std::ostringstream& theStr)
-{
- Storable::DataToStream(theStr,"IsDeformed", IsDeformed());
- if(IsDeformed())
- TSuperClass::DeformationToStream(theStr);
-}
-
-//---------------------------------------------------------------
-void
-VISU::OptionalDeformation_i::RestoreDeformation(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap)
-{
- UseDeformation(Storable::FindValue(theMap,"IsDeformed").toInt());
- if(IsDeformed())
- TSuperClass::RestoreDeformation(theSObject,theMap);
-}
-
-
-
-void
-VISU::OptionalDeformation_i::SameAsDeformation(const Deformation_i *aDeformedPrs){
-
- if(const OptionalDeformation_i* aPrs3d = dynamic_cast<const OptionalDeformation_i*>(aDeformedPrs)){
- OptionalDeformation_i* anOrigin = const_cast<OptionalDeformation_i*>(aPrs3d);
- UseDeformation(anOrigin->IsDeformed());
-
- if(anOrigin->IsDeformed()){
- TSuperClass::SameAsDeformation(aDeformedPrs);
- }
- }
-}
+++ /dev/null
-// Copyright (C) 2008 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_Deformation_i.hxx
-// Author :
-// Module : VISU
-
-#ifndef VISU_OptionalDeformation_i_HeaderFile
-#define VISU_OptionalDeformation_i_HeaderFile
-
-#include "VISU_I.hxx"
-#include "VISU_Deformation_i.hh"
-#include "VISU_OptionalDeformationPL.hxx"
-
-namespace VISU {
- class VISU_I_EXPORT OptionalDeformation_i : public virtual POA_VISU::OptionalDeformation,
- public virtual Deformation_i
- {
- OptionalDeformation_i(const OptionalDeformation_i&);
- public:
- typedef VISU::OptionalDeformation TInterface;
- typedef Deformation_i TSuperClass;
-
- OptionalDeformation_i(VISU::ColoredPrs3d_i* theModifiedEngine);
- virtual ~OptionalDeformation_i();
-
- virtual void UseDeformation(CORBA::Boolean theFlag);
- virtual CORBA::Boolean IsDeformed();
-
-
- virtual
- void
- DeformationToStream(std::ostringstream& theStr);
-
- virtual
- void
- RestoreDeformation(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap);
-
- virtual
- void
- SameAsDeformation(const Deformation_i *aDeformedPrs);
-
- protected:
- virtual
- void InitDeformedPipeLine(VISU_DeformationPL* theDeformedPipeLine);
-
- VISU_OptionalDeformationPL*
- GetSpecificDeformedPL() const
- {
- return myOptionalDeformationPL;
- }
-
- private:
- VISU_OptionalDeformationPL* myOptionalDeformationPL;
-
- };
-}
-#endif
static int MYDEBUG = 0;
#endif
+using namespace std;
//---------------------------------------------------------------
size_t
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_PointMap3d_i.cc
-// Author : Dmitry Matveitchev
-// Module : VISU
-
-#include "VISU_PointMap3d_i.hh"
-
-#include "VISU_CutLines_i.hh"
-#include "VISU_Result_i.hh"
-#include "VISU_ViewManager_i.hh"
-#include "VISU_ScalarBarActor.hxx"
-#include "SUIT_ResourceMgr.h"
-
-#include "SALOME_Event.h"
-#include "VISU_Prs3dUtils.hh"
-#include "SPlot2d_Curve.h"
-#include "VISU_PipeLineUtils.hxx"
-
-#include "VISU_TableReader.hxx"
-#include "VISU_ConvertorUtils.hxx"
-#include "VISU_DeformedGridPL.hxx"
-
-#include "SALOME_InteractiveObject.hxx"
-#include "VISU_Gen_i.hh"
-
-#include <vtkTextProperty.h>
-#include <vtkActorCollection.h>
-
-#include <boost/bind.hpp>
-
-#ifdef _DEBUG_
-static int MYDEBUG = 0;
-#else
-static int MYDEBUG = 0;
-#endif
-
-//----------------------------------------------------------------
-// PointMap3d Object
-//----------------------------------------------------------------
-int VISU::PointMap3d_i::myNbPresent = 0;
-const string VISU::PointMap3d_i::myComment = "POINTMAP3D";
-/*!
- Generate unique name
-*/
-QString VISU::PointMap3d_i::GenerateName()
-{
- return VISU::GenerateName( "Table3D - ", ++myNbPresent );
-}
-/*!
- Gets comment string
-*/
-const char* VISU::PointMap3d_i::GetComment() const
-{
- return myComment.c_str();
-}
-/*!
- Constructor
-*/
-VISU::PointMap3d_i::PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry )
- : Table_i(theStudy, theObjectEntry),
- myActorCollection(vtkActorCollection::New()),
- myIsActiveState(true)
-{
- if(MYDEBUG) MESSAGE("PointMap3d_i::PointMap3d_i - this = "<<this);
- SetStudyDocument(theStudy);
- mySObj = theStudy->FindObjectID(theObjectEntry);
- myOffset[0] = myOffset[1] = myOffset[2] = 0;
- myActorCollection->Delete();
-}
-/*!
- Destructor
-*/
-VISU::PointMap3d_i::~PointMap3d_i()
-{
- if(MYDEBUG) MESSAGE("PointMap3d_i::~PointMap3d_i - this = "<<this);
-}
-
-//----------------------------------------------------------------------------
-namespace VISU
-{
- struct TInvokeSignalEvent: public SALOME_Event
- {
- typedef boost::signal0<void> TSignal;
- const TSignal& mySignal;
-
- TInvokeSignalEvent(const TSignal& theSignal):
- mySignal(theSignal)
- {}
-
- virtual
- void
- Execute()
- {
- mySignal();
- }
- };
-}
-
-//----------------------------------------------------------------------------
-void
-VISU::PointMap3d_i
-::SetTitle( const char* theTitle )
-{
- SetName( theTitle, true );
-}
-
-//----------------------------------------------------------------------------
-char*
-VISU::PointMap3d_i
-::GetTitle()
-{
- return CORBA::string_dup( GetName().c_str() );
-}
-
-//----------------------------------------------------------------------------
-SALOMEDS::SObject_var
-VISU::PointMap3d_i
-::GetSObject() const
-{
- return mySObj;
-}
-
-//----------------------------------------------------------------------------
-std::string
-VISU::PointMap3d_i
-::GetObjectEntry()
-{
- CORBA::String_var anEntry = mySObj->GetID();
- return anEntry.in();
-}
-
-//----------------------------------------------------------------------------
-Handle(SALOME_InteractiveObject)
-VISU::PointMap3d_i
-::GetIO()
-{
- if( myIO.IsNull() )
- myIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
-
- return myIO;
-}
-
-//----------------------------------------------------------------------------
-/*!
- Creates table3d object
-*/
-VISU::Storable* VISU::PointMap3d_i::Create()
-{
- // generate name ...
- SetName(GetTableTitle().toLatin1().constData(), false);
-
- if ( GetName() == "" ) {
- if ( !mySObj->_is_nil() ) {
- CutLines_i* pCutLines = NULL;
- CORBA::Object_var anObj = SObjectToObject(mySObj);
- if(!CORBA::is_nil(anObj)){
- VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
- if(!aCutLines->_is_nil())
- pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
- }
- if (!pCutLines)
- if (mySObj->GetName()) SetName(mySObj->GetName(), false);
- }
- }
-
- if ( GetName() == "" )
- SetName(GenerateName().toLatin1().constData(), false);
-
- // Create Pipeline
- myTablePL = VISU_DeformedGridPL::New();
- myTablePL->SetPolyDataIDMapper(GetTableIDMapper());
- myTablePL->Update();
-
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
-
- bool isUnits = aResourceMgr->booleanValue( "VISU", "scalar_bar_display_units", true );
- SetUnitsVisible(isUnits);
-
- SetSourceRange();
-
- if( aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false) )
- SetScaling(VISU::LOGARITHMIC);
- else
- SetScaling(VISU::LINEAR);
-
- int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 );
- SetNbColors(aNumberOfColors);
-
- int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
- UseFixedRange(aRangeType == 1);
- if(aRangeType == 1){
- float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
- float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
- SetRange(aMin, aMax);
- }
-
- QString aLabelsFormat = aResourceMgr->stringValue( "VISU", "scalar_bar_label_format", "%-#6.3g" );
- SetLabelsFormat(aLabelsFormat.toLatin1().constData());
-
- // Orientation
- int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0);
- if(anOrientation == 1)
- SetBarOrientation(VISU::ColoredPrs3dBase::HORIZONTAL);
- else
- SetBarOrientation(VISU::ColoredPrs3dBase::VERTICAL);
-
- // Scalar Bar origin
- QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
-
- vtkFloatingPointType aXorigin = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.01 : 0.2;
- aXorigin = aResourceMgr->doubleValue("VISU", propertyName + "x", aXorigin);
- myPosition[0] = aXorigin;
-
- vtkFloatingPointType aYorigin = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL) ? 0.1 : 0.012;
- aYorigin = aResourceMgr->doubleValue("VISU", propertyName + "y", aYorigin);
- myPosition[1] = aYorigin;
-
- // Scalar Bar size
- myWidth = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.1 : 0.6;
- myWidth = aResourceMgr->doubleValue("VISU", propertyName + "width", myWidth);
-
- myHeight = (myBarOrientation == VISU::ColoredPrs3dBase::VERTICAL)? 0.8:0.12;
- myHeight = aResourceMgr->doubleValue("VISU", propertyName + "height", myHeight);
-
- myTitleWidth = aResourceMgr->doubleValue("VISU", propertyName + "title_width", 0);
- myTitleHeight = aResourceMgr->doubleValue("VISU", propertyName + "title_height", 0);
- myLabelWidth = aResourceMgr->doubleValue("VISU", propertyName + "label_width", 0);
- myLabelHeight = aResourceMgr->doubleValue("VISU", propertyName + "label_height", 0);
- myBarWidth = aResourceMgr->doubleValue("VISU", propertyName + "bar_width", 0);
- myBarHeight = aResourceMgr->doubleValue("VISU", propertyName + "bar_height", 0);
-
- // Nb of Labels
- myNumberOfLabels = aResourceMgr->integerValue( "VISU", "scalar_bar_num_labels", 5 );
-
- // Fonts properties definition
- myIsBoldTitle = myIsItalicTitle = myIsShadowTitle = true;
- myTitFontType = VTK_ARIAL;
-
- if(aResourceMgr->hasValue( "VISU", "scalar_bar_title_font" )){
- QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_title_font" );
- if ( f.family() == "Arial" )
- myTitFontType = VTK_ARIAL;
- else if ( f.family() == "Courier" )
- myTitFontType = VTK_COURIER;
- else if ( f.family() == "Times" )
- myTitFontType = VTK_TIMES;
-
- myIsBoldTitle = f.bold();
- myIsItalicTitle = f.italic();
- myIsShadowTitle = f.underline();
- }
-
- QColor aTextColor = aResourceMgr->colorValue( "VISU", "scalar_bar_title_color", QColor( 255, 255, 255 ) );
-
- myTitleColor[0] = aTextColor.red() / 255;
- myTitleColor[1] = aTextColor.green() / 255;
- myTitleColor[2] = aTextColor.blue() / 255;
-
- myIsBoldLabel = myIsItalicLabel = myIsShadowLabel = true;
- myLblFontType = VTK_ARIAL;
-
- if( aResourceMgr->hasValue( "VISU", "scalar_bar_label_font" )){
- QFont f = aResourceMgr->fontValue( "VISU", "scalar_bar_label_font" );
- if ( f.family() == "Arial" )
- myLblFontType = VTK_ARIAL;
- else if ( f.family() == "Courier" )
- myLblFontType = VTK_COURIER;
- else if ( f.family() == "Times" )
- myLblFontType = VTK_TIMES;
-
- myIsBoldLabel = f.bold();
- myIsItalicLabel = f.italic();
- myIsShadowLabel = f.underline();
- }
-
- QColor aLabelColor = aResourceMgr->colorValue( "VISU", "scalar_bar_label_color", QColor( 255, 255, 255 ) );
-
- myLabelColor[0] = aLabelColor.red() / 255;
- myLabelColor[1] = aLabelColor.green() / 255;
- myLabelColor[2] = aLabelColor.blue() / 255;
-
- // scalar bar default position
- bool anIsArrangeBar = aResourceMgr->booleanValue("VISU", "scalar_bars_default_position", 0);
- int aPlace = 1;
- if (anIsArrangeBar){
- aPlace = aResourceMgr->integerValue("VISU", "scalar_bar_position_num",0);
- }
- if(myBarOrientation == VISU::ColoredPrs3dBase::HORIZONTAL){
- myPosition[1] += myHeight*(aPlace-1);
- } else {
- myPosition[0] += myWidth*(aPlace-1);
- }
-
- return Build( false );
-}
-
-/*
- GetIDMapper
-*/
-
-VISU::PTableIDMapper
-VISU::PointMap3d_i
-::GetTableIDMapper()
-{
- //Initialisate table mapper
- SALOMEDS::GenericAttribute_var anAttr;
- mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
- SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
-
- PTableIDMapper aTableIDMapper( new TTableIDMapper() );
- TTable2D& aTable2D = *aTableIDMapper;
-
- aTable2D.myTitle = aTableOfReal->GetTitle();
-
- SALOMEDS::StringSeq_var aColStrList = aTableOfReal->GetColumnTitles();
- SALOMEDS::StringSeq_var aRowStrList = aTableOfReal->GetRowTitles();
-
- for ( int i = 0; i < aRowStrList->length(); i++ ) {
- aTable2D.myColumnTitles.push_back( aRowStrList[ i ].in() );
- }
-
- int aCols = aTableOfReal->GetNbColumns();
- int aRows = aTableOfReal->GetNbRows();
-
- for (int i=1; i<=aCols; i++) {
- TTable2D::TRow aRow;
- aRow.myTitle = aColStrList[ i-1 ].in();
- for (int j=1; j<=aRows; j++) {
- double aVal = aTableOfReal->GetValue(j, i);
- QString aValStr = QString::number(aVal);
- aRow.myValues.push_back( aValStr.toLatin1().constData() );
- }
- if( aRow.myValues.size() > 0 )
- aTable2D.myRows.push_back( aRow );
- }
-
- return aTableIDMapper;
-}
-
-/*
- Create Actor
-*/
-VISU_PointMap3dActor* VISU::PointMap3d_i::CreateActor()
-{
- VISU_PointMap3dActor* anActor = VISU_PointMap3dActor::New();
- anActor->SetPipeLine(myTablePL);
- anActor->SetFactory(this);
-
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aDispMode = aResourceMgr->integerValue("VISU", "point_map_represent", 2);
- bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false);
- anActor->SetRepresentation(aDispMode);
- if (toShrink) anActor->SetShrink();
-
- Handle (SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
- anActor->setIO(anIO);
-
- myUpdateActorsSignal.connect(boost::bind(&VISU_Actor::UpdateFromFactory,anActor));
- // myRemoveActorsFromRendererSignal.connect(boost::bind(&VISU_Actor::RemoveFromRender,anActor));
-
- myActorCollection->AddItem(anActor);
-
- UpdateActor( anActor );
-
- return anActor;
-}
-
-/*
- Update Actor
-*/
-void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor)
-{
- if(VISU_PointMap3dActor* anActor = dynamic_cast<VISU_PointMap3dActor*>(theActor)){
- Update();
- VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
- aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable());
- aScalarBar->SetTitle(GetTitle());
- aScalarBar->SetOrientation(GetBarOrientation());
- aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
- aScalarBar->GetPositionCoordinate()->SetValue(GetPosX(),GetPosY());
- aScalarBar->SetWidth(GetWidth());
- aScalarBar->SetHeight(GetHeight());
- aScalarBar->SetNumberOfLabels(GetLabels());
- aScalarBar->SetRatios(myTitleWidth, myTitleHeight,
- myLabelWidth, myLabelHeight,
- myBarWidth, myBarHeight);
- aScalarBar->SetNumberOfLabels(GetLabels());
- aScalarBar->SetLabelFormat(GetLabelsFormat());
-
- vtkFloatingPointType anRGB[3];
-
- vtkTextProperty* aTitleProp = aScalarBar->GetTitleTextProperty();
- aTitleProp->SetFontFamily(GetTitFontType());
-
- GetTitleColor(anRGB[0],anRGB[1],anRGB[2]);
- aTitleProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-
- IsBoldTitle()? aTitleProp->BoldOn() : aTitleProp->BoldOff();
- IsItalicTitle()? aTitleProp->ItalicOn() : aTitleProp->ItalicOff();
- IsShadowTitle()? aTitleProp->ShadowOn() : aTitleProp->ShadowOff();
-
- vtkTextProperty* aLabelProp = aScalarBar->GetLabelTextProperty();
- aLabelProp->SetFontFamily(GetLblFontType());
-
- GetLabelColor(anRGB[0],anRGB[1],anRGB[2]);
- aLabelProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-
- IsBoldLabel()? aLabelProp->BoldOn() : aLabelProp->BoldOff();
- IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
- IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
-
- aScalarBar->Modified();
- }
- theActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
-}
-
-void
-VISU::PointMap3d_i
-::UpdateActors()
-{
- if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors - this = "<<this);
- ProcessVoidEvent(new TVoidMemFunEvent<VISU_PipeLine>
- (GetSpecificPL(), &VISU_PipeLine::Update));
-
- ProcessVoidEvent(new VISU::TInvokeSignalEvent(myUpdateActorsSignal));
-}
-
-//----------------------------------------------------------------------------
-void
-VISU::PointMap3d_i
-::Update()
-{
- if(GetMTime() < myUpdateTime.GetMTime())
- return;
-
- if(MYDEBUG) MESSAGE("PointMap3d_i::Update - this = "<<this);
-
- try{
- ProcessVoidEvent(new TVoidMemFunEvent<VISU_PipeLine>
- (GetSpecificPL(), &VISU_PipeLine::Update));
- myUpdateTime.Modified();
- }catch(std::exception&){
- throw;
- }catch(...){
- throw std::runtime_error("PointMap3d_i::Update >> unexpected exception was caught!!!");
- }
-}
-
-//----------------------------------------------------------------------------
-unsigned long int
-VISU::PointMap3d_i
-::GetMTime()
-{
- unsigned long int aTime = myParamsTime.GetMTime();
- if( GetSpecificPL() )
- aTime = std::max(aTime, GetSpecificPL()->GetMTime());
- return aTime;
-}
-
-/*!
- Builds presentation of table
-*/
-VISU::Storable* VISU::PointMap3d_i::Build( int theRestoring )
-{
-
- // look for reference SObject with table attribute
- SALOMEDS::SObject_var SO = mySObj;
-
- if ( !SO->_is_nil() ) {
- CutLines_i* pCutLines = NULL;
- CORBA::Object_var anObj = SObjectToObject(SO);
- if(!CORBA::is_nil(anObj)){
- VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
- if(!aCutLines->_is_nil())
- pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
- }
- SALOMEDS::Study_var aStudy = GetStudyDocument();
- SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
- SALOMEDS::GenericAttribute_var anAttr;
- // look for component
- if ( !theRestoring ) {
- SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
- // create SObject and set attributes
- QString aComment;
- if(pCutLines)
- aComment.sprintf("myComment=%s;mySourceId=CutLines",GetComment());
- else{
- aComment.sprintf("myComment=%s;mySourceId=TableAttr",GetComment());
- SALOMEDS::SObject_var aFatherSObject = SO->GetFather();
- if(aFatherSObject->FindAttribute(anAttr,"AttributeString")){
- SALOMEDS::AttributeString_var aCommentAttr =
- SALOMEDS::AttributeString::_narrow(anAttr);
- CORBA::String_var aValue = aCommentAttr->Value();
- Storable::TRestoringMap aMap;
- Storable::StringToMap(aValue.in(),aMap);
- bool anIsExist;
- QString aMethodName = VISU::Storable::FindValue(aMap,"myComment",&anIsExist);
- if(anIsExist){
- if(aMethodName == "ImportTables"){
- aComment.sprintf("myComment=%s;mySourceId=TableFile",GetComment());
- }
- }
- }
- }
-
- string anEntry = CreateAttributes( GetStudyDocument(),
- SO->GetID(),//SComponent->GetID(),
- "ICON_TREE_TABLE",
- GetID(),
- GetName(),
- "",
- aComment.toLatin1().constData(),
- pCutLines );
- // create SObject referenced to real table object
- mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
- if(pCutLines) {
- pCutLines->BuildTableOfReal(mySObj);
- }
- // mpv (PAL5357): reference attributes are unnecessary now
- //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
- //Builder->Addreference( refSO, SO );
- }
-
- return this;
- }
- return NULL;
-}
-/*!
- Restores table object from stream
-*/
-VISU::Storable* VISU::PointMap3d_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
-{
- if(MYDEBUG) MESSAGE(GetComment());
- SetName(VISU::Storable::FindValue(theMap,"myName").toLatin1().constData(), false);
- myTitle = VISU::Storable::FindValue(theMap,"myTitle").toLatin1().constData();
- myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() );
- mySObj = SALOMEDS::SObject::_duplicate(SO);
-
- //Create PipeLine
- myTablePL = VISU_DeformedGridPL::New();
- myTablePL->SetPolyDataIDMapper(GetTableIDMapper());
- myTablePL->Update();
-
- //Restore Other Values
-
- float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
- float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
- SetRange(aMin, aMax);
-
- UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange", "0").toInt());
-
- SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
- SetUnitsVisible(VISU::Storable::FindValue(theMap,"myUnitsVisible", "1").toInt());
- SetLabelsFormat(VISU::Storable::FindValue(theMap,"myLabelsFormat", "%-#6.3g").toLatin1().constData());
- SetBarOrientation((VISU::ColoredPrs3dBase::Orientation)VISU::Storable::FindValue(theMap,"myBarOrientation").toInt());
-
- SetTitle(VISU::Storable::FindValue(theMap,"myTitle").toLatin1().constData());
- myNumberOfLabels = VISU::Storable::FindValue(theMap,"myNumberOfLabels").toInt();
- myPosition[0] = VISU::Storable::FindValue(theMap,"myPosition[0]").toDouble();
- myPosition[1] = VISU::Storable::FindValue(theMap,"myPosition[1]").toDouble();
- myWidth = VISU::Storable::FindValue(theMap,"myWidth").toDouble();
- myHeight = VISU::Storable::FindValue(theMap,"myHeight").toDouble();
- myTitleWidth = VISU::Storable::FindValue(theMap,"myTitleWidth").toInt();
- myTitleHeight = VISU::Storable::FindValue(theMap,"myTitleHeight").toInt();
- myLabelWidth = VISU::Storable::FindValue(theMap,"myLabelWidth").toInt();
- myLabelHeight = VISU::Storable::FindValue(theMap,"myLabelHeight").toInt();
- myBarWidth = VISU::Storable::FindValue(theMap,"myBarWidth").toInt();
- myBarHeight = VISU::Storable::FindValue(theMap,"myBarHeight").toInt();
-
- myTitFontType = VISU::Storable::FindValue(theMap,"myTitFontType").toInt();
- myIsBoldTitle = VISU::Storable::FindValue(theMap,"myIsBoldTitle").toInt();
- myIsItalicTitle = VISU::Storable::FindValue(theMap,"myIsItalicTitle").toInt();
- myIsShadowTitle = VISU::Storable::FindValue(theMap,"myIsShadowTitle").toInt();
- myTitleColor[0] = VISU::Storable::FindValue(theMap,"myTitleColor[0]").toFloat();
- myTitleColor[1] = VISU::Storable::FindValue(theMap,"myTitleColor[1]").toFloat();
- myTitleColor[2] = VISU::Storable::FindValue(theMap,"myTitleColor[2]").toFloat();
-
- myLblFontType = VISU::Storable::FindValue(theMap,"myLblFontType").toInt();
- myIsBoldLabel = VISU::Storable::FindValue(theMap,"myIsBoldLabel").toInt();
- myIsItalicLabel = VISU::Storable::FindValue(theMap,"myIsItalicLabel").toInt();
- myIsShadowLabel = VISU::Storable::FindValue(theMap,"myIsShadowLabel").toInt();
- myLabelColor[0] = VISU::Storable::FindValue(theMap,"myLabelColor[0]").toFloat();
- myLabelColor[1] = VISU::Storable::FindValue(theMap,"myLabelColor[1]").toFloat();
- myLabelColor[2] = VISU::Storable::FindValue(theMap,"myLabelColor[2]").toFloat();
-
- myParamsTime.Modified();
- return Build( true );
-}
-/*!
- Flushes table data into stream
-*/
-void VISU::PointMap3d_i::ToStream( std::ostringstream& theStr )
-{
- Storable::DataToStream( theStr, "myName", GetName().c_str() );
- Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
- Storable::DataToStream( theStr, "myOrientation", myOrientation );
-
- Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
- Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
- Storable::DataToStream( theStr, "myIsFixedRange", IsRangeFixed() );
-
- Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
- Storable::DataToStream( theStr, "myBarOrientation", myBarOrientation );
-
- Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
- Storable::DataToStream( theStr, "myUnitsVisible", myIsUnits );
- Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
- Storable::DataToStream( theStr, "myLabelsFormat", myLabelsFormat.c_str() );
- Storable::DataToStream( theStr, "myPosition[0]", myPosition[0] );
- Storable::DataToStream( theStr, "myPosition[1]", myPosition[1] );
- Storable::DataToStream( theStr, "myWidth", myWidth );
- Storable::DataToStream( theStr, "myHeight", myHeight );
- Storable::DataToStream( theStr, "myTitleWidth", myTitleWidth );
- Storable::DataToStream( theStr, "myTitleHeight", myTitleHeight );
- Storable::DataToStream( theStr, "myLabelWidth", myLabelWidth );
- Storable::DataToStream( theStr, "myLabelHeight", myLabelHeight );
- Storable::DataToStream( theStr, "myBarWidth", myBarWidth );
- Storable::DataToStream( theStr, "myBarHeight", myBarHeight );
-
- Storable::DataToStream( theStr, "myTitFontType", myTitFontType );
- Storable::DataToStream( theStr, "myIsBoldTitle", myIsBoldTitle );
- Storable::DataToStream( theStr, "myIsItalicTitle", myIsItalicTitle );
- Storable::DataToStream( theStr, "myIsShadowTitle", myIsShadowTitle );
- Storable::DataToStream( theStr, "myTitleColor[0]", myTitleColor[0] );
- Storable::DataToStream( theStr, "myTitleColor[1]", myTitleColor[1] );
- Storable::DataToStream( theStr, "myTitleColor[2]", myTitleColor[2] );
-
- Storable::DataToStream( theStr, "myLblFontType", myLblFontType );
- Storable::DataToStream( theStr, "myIsBoldLabel", myIsBoldLabel );
- Storable::DataToStream( theStr, "myIsItalicLabel", myIsItalicLabel );
- Storable::DataToStream( theStr, "myIsShadowLabel", myIsShadowLabel );
- Storable::DataToStream( theStr, "myLabelColor[0]", myLabelColor[0] );
- Storable::DataToStream( theStr, "myLabelColor[1]", myLabelColor[1] );
- Storable::DataToStream( theStr, "myLabelColor[2]", myLabelColor[2] );
-}
-/*!
- Called from engine to restore table from the file
-*/
-VISU::Storable* VISU::PointMap3d_i::StorableEngine(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap,
- const std::string& thePrefix,
- CORBA::Boolean theIsMultiFile)
-{
- SALOMEDS::Study_var aStudy = theSObject->GetStudy();
- VISU::PointMap3d_i* pResent = new VISU::PointMap3d_i( aStudy, "" );
- return pResent->Restore( theMap, theSObject);
-}
-/*!
- Gets title for the original table object
-*/
-QString VISU::PointMap3d_i::GetTableTitle()
-{
- SALOMEDS::SObject_var SO = mySObj;
- SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeTableOfInteger_var anInt;
- SALOMEDS::AttributeTableOfReal_var aReal;
- if ( !SO->_is_nil() ) {
- if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
- anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
- CORBA::String_var aString = anInt->GetTitle();
- return aString.in();
- }
- else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
- aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
- CORBA::String_var aString = aReal->GetTitle();
- return aString.in();
- }
- }
- return "";
-}
-
-//---------------------------------------------------------------
-void VISU::PointMap3d_i::RemoveFromStudy()
-{
- struct TRemoveFromStudy: public SALOME_Event
- {
- VISU::PointMap3d_i* myRemovable;
- TRemoveFromStudy(VISU::PointMap3d_i* theRemovable):
- myRemovable(theRemovable)
- {}
-
- virtual
- void
- Execute()
- {
- VISU::RemoveFromStudy(myRemovable->GetSObject(),false);
- }
- };
-
- // Remove the table with all curves
- ProcessVoidEvent(new TRemoveFromStudy(this));
-}
-
-//----------------------------------------------------------------
-void VISU::PointMap3d_i::SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz)
-{
- myOffset[0] = theDx;
- myOffset[1] = theDy;
- myOffset[2] = theDz;
- myParamsTime.Modified();
-}
-
-void VISU::PointMap3d_i::GetOffset(CORBA::Float& theDx, CORBA::Float& theDy, CORBA::Float& theDz)
-{
- theDx = myOffset[0];
- theDy = myOffset[1];
- theDz = myOffset[2];
-}
-
-CORBA::Float VISU::PointMap3d_i::GetMemorySize()
-{
- CORBA::Float aSize = GetSpecificPL()->GetMemorySize();
-
- int anEnd = myActorCollection->GetNumberOfItems();
- for(int anId = 0; anId < anEnd; anId++)
- if(vtkObject* anObject = myActorCollection->GetItemAsObject(anId))
- if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anObject)){
- aSize += anActor->GetMemorySize();
- //cout<<"Prs3d_i::GetMemorySize - "<<this<<"; anActor = "<<aSize / (1024.0 * 1024.0)<<endl;
- }
-
- // Convert to mega bytes
- return aSize / (1024.0 * 1024.0);
-}
-
-//------------------ ColoredPrs3dBase Methods --------------------
-CORBA::Double VISU::PointMap3d_i::GetMin()
-{
- return myTablePL->GetScalarRange()[0];
-}
-
-CORBA::Double VISU::PointMap3d_i::GetMinTableValue()
-{
- SALOMEDS::GenericAttribute_var anAttr;
- mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
- SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
- double aMin = aTableOfReal->GetValue(1, 1);
-
- for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
- for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
- double aVal = aTableOfReal->GetValue(j, i);
- if (aVal < aMin)
- aMin = aVal;
- }
-
- return aMin;
-}
-
-CORBA::Double VISU::PointMap3d_i::GetMaxTableValue()
-{
- SALOMEDS::GenericAttribute_var anAttr;
- mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
- SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
- double aMax = aTableOfReal->GetValue(1, 1);
-
- for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
- for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
- double aVal = aTableOfReal->GetValue(j, i);
- if (aVal > aMax)
- aMax = aVal;
- }
-
- return aMax;
-}
-
-CORBA::Double VISU::PointMap3d_i::GetMax()
-{
- return myTablePL->GetScalarRange()[1];
-}
-
-void VISU::PointMap3d_i::SetRange(CORBA::Double theMin, CORBA::Double theMax)
-{
- vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, vtkFloatingPointType*>
- (GetSpecificPL(), &VISU_DeformedGridPL::SetScalarRange, aScalarRange));
-
- UseFixedRange(true);
-}
-
-CORBA::Double VISU::PointMap3d_i::GetSourceMin()
-{
- vtkFloatingPointType aRange[2];
- GetSpecificPL()->GetSourceRange(aRange);
- return aRange[0];
-}
-
-CORBA::Double VISU::PointMap3d_i::GetSourceMax()
-{
- vtkFloatingPointType aRange[2];
- GetSpecificPL()->GetSourceRange(aRange);
- return aRange[1];
-}
-
-void VISU::PointMap3d_i::SetSourceRange()
-{
- GetSpecificPL()->SetSourceRange();
- ProcessVoidEvent(new TVoidMemFunEvent<VISU_DeformedGridPL>
- (GetSpecificPL(), &VISU_DeformedGridPL::SetSourceRange));
-
- UseFixedRange(false);
-}
-
-CORBA::Boolean VISU::PointMap3d_i::IsRangeFixed()
-{
- return myIsFixedRange;
-}
-
-void VISU::PointMap3d_i::UseFixedRange(bool theRange)
-{
- if(myIsFixedRange == theRange)
- return;
-
- myIsFixedRange = theRange;
-}
-
-void VISU::PointMap3d_i::SetPosition(CORBA::Double theX, CORBA::Double theY)
-{
- bool anIsSameValue = VISU::CheckIsSameValue(myPosition[0], theX);
- anIsSameValue &= VISU::CheckIsSameValue(myPosition[1], theY);
- if(anIsSameValue)
- return;
-
- myPosition[0] = theX;
- myPosition[1] = theY;
-}
-
-CORBA::Double VISU::PointMap3d_i::GetPosX()
-{
- return myPosition[0];
-}
-
-CORBA::Double VISU::PointMap3d_i::GetPosY()
-{
- return myPosition[1];
-}
-
-void VISU::PointMap3d_i::SetSize(CORBA::Double theWidth, CORBA::Double theHeight)
-{
- bool anIsSameValue = VISU::CheckIsSameValue(myWidth, theWidth);
- anIsSameValue &= VISU::CheckIsSameValue(myHeight, theHeight);
- if(anIsSameValue)
- return;
-
- myWidth = theWidth;
- myHeight = theHeight;
-}
-
-CORBA::Double VISU::PointMap3d_i::GetHeight()
-{
- return myHeight;
-}
-
-CORBA::Double VISU::PointMap3d_i::GetWidth()
-{
- return myWidth;
-}
-
-void VISU::PointMap3d_i::SetNbColors(CORBA::Long theNbColors)
-{
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
- (GetSpecificPL(), &VISU_DeformedGridPL::SetNbColors, theNbColors));
-}
-
-CORBA::Long VISU::PointMap3d_i::GetNbColors()
-{
- return GetSpecificPL()->GetNbColors();
-}
-
-void VISU::PointMap3d_i::SetLabels(CORBA::Long theNbLabels)
-{
- if(myNumberOfLabels == theNbLabels)
- return;
-
- myNumberOfLabels = theNbLabels;
-}
-
-CORBA::Long VISU::PointMap3d_i::GetLabels()
-{
- return myNumberOfLabels;
-}
-
-void VISU::PointMap3d_i::SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theBarOrientation)
-{
- if(myBarOrientation == theBarOrientation)
- return;
-
- myBarOrientation = theBarOrientation;
-}
-
-VISU::ColoredPrs3dBase::Orientation VISU::PointMap3d_i::GetBarOrientation()
-{
- return myBarOrientation;
-}
-
-//------------------- ScaledPrs3d Methods -----------------------
-
-void VISU::PointMap3d_i::SetScaling(VISU::Scaling theScaling)
-{
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
- (GetSpecificPL(), &VISU_DeformedGridPL::SetScaling, theScaling));
-}
-
-VISU::Scaling VISU::PointMap3d_i::GetScaling()
-{
- return VISU::Scaling(GetSpecificPL()->GetScaling());
-}
-
-//------------------- Check Table on Positive Values ------------
-bool VISU::PointMap3d_i::IsPositiveTable()
-{
- SALOMEDS::GenericAttribute_var anAttr;
- mySObj->FindAttribute(anAttr, "AttributeTableOfReal");
- SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
-
- for (int i=1; i<=aTableOfReal->GetNbColumns(); i++)
- for (int j=1; j<=aTableOfReal->GetNbRows(); j++) {
- double aVal = aTableOfReal->GetValue(j, i);
- if (aVal < 0)
- return false;
- }
-
- return true;
-}
-
-//------------------- Plot3dBase Methods ------------------------
-
-void VISU::PointMap3d_i::SetScaleFactor (CORBA::Double theScaleFactor)
-{
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, vtkFloatingPointType>
- (GetSpecificPL(), &VISU_DeformedGridPL::SetScaleFactor, theScaleFactor));
-}
-
-CORBA::Double VISU::PointMap3d_i::GetScaleFactor ()
-{
- return myTablePL->GetScaleFactor();
-}
-
-void VISU::PointMap3d_i::SetContourPrs (CORBA::Boolean theIsContourPrs )
-{
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, bool>
- (GetSpecificPL(), &VISU_DeformedGridPL::SetContourPrs, theIsContourPrs));
-}
-
-CORBA::Boolean VISU::PointMap3d_i::GetIsContourPrs()
-{
- return myTablePL->GetIsContourPrs();
-}
-
-void VISU::PointMap3d_i::SetNbOfContours (CORBA::Long theNb)
-{
- ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedGridPL, int>
- (GetSpecificPL(), &VISU_DeformedGridPL::SetNumberOfContours, theNb));
-}
-
-CORBA::Long VISU::PointMap3d_i::GetNbOfContours ()
-{
- return myTablePL->GetNumberOfContours();
-}
-
-//-------------------- Actor Factory Methods --------------------
-
-bool VISU::PointMap3d_i::GetActiveState ()
-{
- return myIsActiveState;
-}
-
-void VISU::PointMap3d_i::SetActiveState ( bool theState )
-{
- myIsActiveState = theState;
-}
-
-void VISU::PointMap3d_i::RemoveActor (VISU_ActorBase* theActor)
-{
- myActorCollection->RemoveItem(theActor);
-}
-
-void VISU::PointMap3d_i::RemoveActors ()
-{
- ProcessVoidEvent(new TInvokeSignalEvent(myRemoveActorsFromRendererSignal));
- myActorCollection->RemoveAllItems();
-}
-
-
-//-----------------------Text Properties & Label Properties------------------
-bool VISU::PointMap3d_i::IsBoldTitle()
-{
- return myIsBoldTitle;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetBoldTitle(bool theIsBoldTitle)
-{
- if(myIsBoldTitle == theIsBoldTitle)
- return;
-
- myIsBoldTitle = theIsBoldTitle;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-bool VISU::PointMap3d_i::IsItalicTitle()
-{
- return myIsItalicTitle;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetItalicTitle(bool theIsItalicTitle)
-{
- if(myIsItalicTitle == theIsItalicTitle)
- return;
-
- myIsItalicTitle = theIsItalicTitle;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-bool VISU::PointMap3d_i::IsShadowTitle()
-{
- return myIsShadowTitle;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetShadowTitle(bool theIsShadowTitle)
-{
- if(myIsShadowTitle == theIsShadowTitle)
- return;
-
- myIsShadowTitle = theIsShadowTitle;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-int VISU::PointMap3d_i::GetTitFontType()
-{
- return myTitFontType;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetTitFontType(int theTitFontType)
-{
- if(myTitFontType == theTitFontType)
- return;
-
- myTitFontType = theTitFontType;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::GetTitleColor(vtkFloatingPointType& theR,
- vtkFloatingPointType& theG,
- vtkFloatingPointType& theB)
-{
- theR = myTitleColor[0];
- theG = myTitleColor[1];
- theB = myTitleColor[2];
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetTitleColor(vtkFloatingPointType theR,
- vtkFloatingPointType theG,
- vtkFloatingPointType theB)
-{
- bool anIsSameValue = VISU::CheckIsSameValue(myTitleColor[0], theR);
- anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[1], theG);
- anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[2], theB);
- if(anIsSameValue)
- return;
-
- myTitleColor[0] = theR;
- myTitleColor[1] = theG;
- myTitleColor[2] = theB;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-bool VISU::PointMap3d_i::IsBoldLabel()
-{
- return myIsBoldLabel;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetBoldLabel(bool theIsBoldLabel)
-{
- if(myIsBoldLabel == theIsBoldLabel)
- return;
-
- myIsBoldLabel = theIsBoldLabel;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-bool VISU::PointMap3d_i::IsItalicLabel()
-{
- return myIsItalicLabel;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetItalicLabel(bool theIsItalicLabel)
-{
- if(myIsItalicLabel == theIsItalicLabel)
- return;
-
- myIsItalicLabel = theIsItalicLabel;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-bool VISU::PointMap3d_i::IsShadowLabel()
-{
- return myIsShadowLabel;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetShadowLabel(bool theIsShadowLabel)
-{
- if(myIsShadowLabel == theIsShadowLabel)
- return;
-
- myIsShadowLabel = theIsShadowLabel;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-int VISU::PointMap3d_i::GetLblFontType()
-{
- return myLblFontType;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetLblFontType(int theLblFontType)
-{
- if(myLblFontType == theLblFontType)
- return;
-
- myLblFontType = theLblFontType;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::GetLabelColor(vtkFloatingPointType& theR,
- vtkFloatingPointType& theG,
- vtkFloatingPointType& theB)
-{
- theR = myLabelColor[0];
- theG = myLabelColor[1];
- theB = myLabelColor[2];
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetLabelColor(vtkFloatingPointType theR,
- vtkFloatingPointType theG,
- vtkFloatingPointType theB)
-{
- bool anIsSameValue = VISU::CheckIsSameValue(myLabelColor[0], theR);
- anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[1], theG);
- anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[2], theB);
- if(anIsSameValue)
- return;
-
- myLabelColor[0] = theR;
- myLabelColor[1] = theG;
- myLabelColor[2] = theB;
- myParamsTime.Modified();
-}
-
-//----------------------------------------------------------------------------
-CORBA::Long VISU::PointMap3d_i::GetTitleWidth()
-{
- return myTitleWidth;
-}
-
-//----------------------------------------------------------------------------
-CORBA::Long VISU::PointMap3d_i::GetTitleHeight()
-{
- return myTitleHeight;
-}
-
-//----------------------------------------------------------------------------
-CORBA::Long VISU::PointMap3d_i::GetLabelWidth()
-{
- return myLabelWidth;
-}
-
-//----------------------------------------------------------------------------
-CORBA::Long VISU::PointMap3d_i::GetLabelHeight()
-{
- return myLabelHeight;
-}
-
-//----------------------------------------------------------------------------
-CORBA::Long VISU::PointMap3d_i::GetBarWidth()
-{
- return myBarWidth;
-}
-
-//----------------------------------------------------------------------------
-CORBA::Long VISU::PointMap3d_i::GetBarHeight()
-{
- return myBarHeight;
-}
-
-//----------------------------------------------------------------------------
-void
-VISU::PointMap3d_i::SetLabelsFormat(const char* theFormat)
-{
- if( myLabelsFormat != theFormat ){
- myLabelsFormat = theFormat;
- myParamsTime.Modified();
- }
-}
-
-//----------------------------------------------------------------------------
-char* VISU::PointMap3d_i::GetLabelsFormat()
-{
- return CORBA::string_dup(myLabelsFormat.c_str());
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetUnitsVisible(CORBA::Boolean isVisible)
-{
- if( myIsUnits != isVisible ){
- myIsUnits = isVisible;
- myParamsTime.Modified();
- }
-}
-
-//----------------------------------------------------------------------------
-CORBA::Boolean VISU::PointMap3d_i::IsUnitsVisible()
-{
- return myIsUnits;
-}
-
-//----------------------------------------------------------------------------
-void VISU::PointMap3d_i::SetRatios(CORBA::Long theTitleWidth, CORBA::Long theTitleHeight,
- CORBA::Long theLabelWidth, CORBA::Long theLabelHeight,
- CORBA::Long theBarWidth, CORBA::Long theBarHeight)
-{
- bool anIsSameValue = VISU::CheckIsSameValue(myTitleWidth, theTitleWidth);
- anIsSameValue &= VISU::CheckIsSameValue(myTitleHeight, theTitleHeight);
- anIsSameValue &= VISU::CheckIsSameValue(myLabelWidth, theLabelWidth);
- anIsSameValue &= VISU::CheckIsSameValue(myLabelHeight, theLabelHeight);
- anIsSameValue &= VISU::CheckIsSameValue(myBarWidth, theBarWidth);
- anIsSameValue &= VISU::CheckIsSameValue(myBarHeight, theBarHeight);
- if(anIsSameValue)
- return;
-
- myTitleWidth = theTitleWidth;
- myTitleHeight = theTitleHeight;
- myLabelWidth = theLabelWidth;
- myLabelHeight = theLabelHeight;
- myBarWidth = theBarWidth;
- myBarHeight = theBarHeight;
- myParamsTime.Modified();
-}
+++ /dev/null
-// VISU OBJECT : interactive object for VISU entities implementation
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-// File : VISU_PointMap3d_i.hh
-// Author :
-// Module : VISU
-
-#ifndef VISU_PointMap3d_i_HeaderFile
-#define VISU_PointMap3d_i_HeaderFile
-
-#include "VISU_PrsObject_i.hh"
-#include "SALOME_GenericObj_i.hh"
-
-#include "VISU_TableReader.hxx"
-#include "VISU_PointMap3dActor.h"
-#include "VISU_Table_i.hh"
-#include "VISU_ActorFactory.h"
-#include "VISU_DeformedGridPL.hxx"
-
-#include <vtkTimeStamp.h>
-#include <vtkSmartPointer.h>
-
-namespace VISU
-{
-
- struct TActorFactory;
-
- //==============================================================================
- class VISU_I_EXPORT PointMap3d_i : public virtual POA_VISU::PointMap3d,
- public virtual SALOME::GenericObj_i,
- public virtual TActorFactory,
- public virtual Table_i
- {
- static int myNbPresent;
- PointMap3d_i( const PointMap3d_i& );
- public:
- PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry);
-
- virtual ~PointMap3d_i();
- virtual VISU::VISUType GetType() { return VISU::TPOINTMAP3D;};
-
- virtual void SetTitle( const char* theTitle );
- virtual char* GetTitle();
-
- virtual void RemoveFromStudy();
- virtual void UpdateActor(VISU_ActorBase* thePointMap3dActor);
- virtual void UpdateActors();
-
- virtual void Update();
-
- virtual Handle(SALOME_InteractiveObject) GetIO();
-
- //----------- override Prs3d methods -----------------------------
-
- //! Move the 3D presentation according to the given offset parameters
- virtual void SetOffset(CORBA::Float theDx, CORBA::Float theDy, CORBA::Float theDz);
-
- //! Gets offset parameters for the 3D presentation
- virtual void GetOffset(CORBA::Float& theDx, CORBA::Float& theDy, CORBA::Float& theDz);
-
- //! Gets memory size actually used by the presentation (Mb).
- virtual CORBA::Float GetMemorySize();
-
- //----------- override ColoredPrs3dBase methods ------------------
-
- virtual CORBA::Double GetMin();
- virtual CORBA::Double GetMax();
- virtual CORBA::Double GetMinTableValue();
- virtual CORBA::Double GetMaxTableValue();
- virtual void SetRange(CORBA::Double theMin, CORBA::Double theMax);
-
- virtual CORBA::Double GetSourceMin();
- virtual CORBA::Double GetSourceMax();
- virtual void SetSourceRange();
-
- virtual CORBA::Boolean IsRangeFixed();
-
- virtual void SetPosition(CORBA::Double X, CORBA::Double Y);
- virtual CORBA::Double GetPosX();
- virtual CORBA::Double GetPosY();
-
- virtual void SetSize(CORBA::Double theWidth, CORBA::Double theHeight);
-
- virtual void SetRatios(CORBA::Long theTitleWidth, CORBA::Long theTitleHeight,
- CORBA::Long theLabelWidth, CORBA::Long theLabelHeight,
- CORBA::Long theBarWidth, CORBA::Long theBarHeight);
-
- virtual CORBA::Double GetWidth();
- virtual CORBA::Double GetHeight();
-
- virtual void SetNbColors(CORBA::Long theNbColors);
- virtual CORBA::Long GetNbColors();
-
- virtual void SetLabels(CORBA::Long theNbLabels);
- virtual CORBA::Long GetLabels();
-
- virtual void SetLabelsFormat(const char* theFormat);
- virtual char* GetLabelsFormat();
-
- virtual void SetBarOrientation(VISU::ColoredPrs3dBase::Orientation theOrientation);
- virtual VISU::ColoredPrs3dBase::Orientation GetBarOrientation();
-
- void UseFixedRange(bool theUseFixedRange);
-
- // ScaledMap Methods
-
- virtual VISU::Scaling GetScaling();
- virtual void SetScaling(VISU::Scaling theScaling);
-
- bool IsPositiveTable();
-
- // Plot3dBase methods
-
- void SetScaleFactor (CORBA::Double theScaleFactor);
- CORBA::Double GetScaleFactor();
-
- void SetContourPrs (CORBA::Boolean theIsContourPrs );
- CORBA::Boolean GetIsContourPrs();
-
- void SetNbOfContours (CORBA::Long);
- CORBA::Long GetNbOfContours();
-
- VISU_DeformedGridPL* GetSpecificPL() const { return myTablePL; }
-
- // TActorFactory Methods
-
- //! Gets know whether the factory instance can be used for actor management or not
- virtual bool GetActiveState();
-
- virtual void SetActiveState(bool theState);
-
- //! Return modified time of the factory
- virtual unsigned long int GetMTime();
-
- //! To unregister the actor
- virtual void RemoveActor(VISU_ActorBase* theActor);
- virtual void RemoveActors();
-
- //------ Text Properties & Label Properties ------------------------
-
- virtual bool IsBoldTitle();
- virtual void SetBoldTitle(bool isBold);
- virtual bool IsItalicTitle();
- virtual void SetItalicTitle(bool isItalic);
- virtual bool IsShadowTitle();
- virtual void SetShadowTitle(bool isShadow);
- virtual int GetTitFontType();
- virtual void SetTitFontType(int theType);
- virtual void GetTitleColor(vtkFloatingPointType& theR,
- vtkFloatingPointType& theG,
- vtkFloatingPointType& theB);
- virtual void SetTitleColor(vtkFloatingPointType theR,
- vtkFloatingPointType theG,
- vtkFloatingPointType theB);
-
- virtual bool IsBoldLabel();
- virtual void SetBoldLabel(bool isBold);
- virtual bool IsItalicLabel();
- virtual void SetItalicLabel(bool isItalic);
- virtual bool IsShadowLabel();
- virtual void SetShadowLabel(bool isShadow);
- virtual int GetLblFontType();
- virtual void SetLblFontType(int theType);
- virtual void GetLabelColor(vtkFloatingPointType& theR,
- vtkFloatingPointType& theG,
- vtkFloatingPointType& theB);
- virtual void SetLabelColor(vtkFloatingPointType theR,
- vtkFloatingPointType theG,
- vtkFloatingPointType theB);
-
- //-------------------------------------------------------------------
- virtual CORBA::Long GetTitleWidth();
- virtual CORBA::Long GetTitleHeight();
- virtual CORBA::Long GetLabelWidth();
- virtual CORBA::Long GetLabelHeight();
- virtual CORBA::Long GetBarWidth();
- virtual CORBA::Long GetBarHeight();
-
- virtual void SetUnitsVisible(CORBA::Boolean isVisible);
- virtual CORBA::Boolean IsUnitsVisible();
-
- //-------------------------------------------------------------------
-
- protected:
- Storable* Build(int theRestoring);
-
- VISU::Table::Orientation myOrientation;
- VISU::ColoredPrs3dBase::Orientation myBarOrientation;
- std::string myTitle;
- std::string myScalarBarTitle;
- bool myIsUnits;
- SALOMEDS::SObject_var mySObj;
- int myNumberOfLabels;
- std::string myLabelsFormat;
- vtkFloatingPointType myPosition[2],
- myWidth, myHeight,
- myTitleWidth, myTitleHeight,
- myLabelWidth, myLabelHeight,
- myBarWidth, myBarHeight;
- bool myIsFixedRange;
- CORBA::Float myOffset[3];
- bool myIsActiveState;
- vtkTimeStamp myParamsTime;
- vtkTimeStamp myUpdateTime;
-
- Handle(SALOME_InteractiveObject) myIO;
-
-
- //Font management
- bool myIsBoldTitle;
- bool myIsItalicTitle;
- bool myIsShadowTitle;
- int myTitFontType;
- vtkFloatingPointType myTitleColor[3];
-
- bool myIsBoldLabel;
- bool myIsItalicLabel;
- bool myIsShadowLabel;
- int myLblFontType;
- vtkFloatingPointType myLabelColor[3];
-
- boost::signal0<void> myUpdateActorsSignal;
- boost::signal0<void> myRemoveActorsFromRendererSignal;
- vtkSmartPointer<vtkActorCollection> myActorCollection;
-
- public:
- // virtual Storable* Create( const VISU::PTableIDMapper& theTableIDMapper );
- virtual Storable* Create();
- VISU_PointMap3dActor* CreateActor();
- VISU::PTableIDMapper GetTableIDMapper();
-
- SALOMEDS::SObject_var GetSObject() const;
- VISU_DeformedGridPL* myTablePL;
-
- virtual Storable* Restore( const Storable::TRestoringMap& theMap,
- SALOMEDS::SObject_ptr SO);
-
- static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
- const Storable::TRestoringMap& theMap,
- const std::string& thePrefix,
- CORBA::Boolean theIsMultiFile);
-
- virtual void ToStream( std::ostringstream& theStr );
- static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
- virtual QString GetTableTitle();
-
- virtual std::string GetObjectEntry();
- };
-}
-
-#endif
ProcessVoidEvent(new TEvent(this));
}
+ //----------------------------------------------------------------------------
+
+ std::string ToFormat( const int thePrec )
+ {
+ // "%-#6.3g"
+ char str[ 255 ];
+ sprintf( str, "%%-#.%dg", thePrec );
+ return str;
+ }
//----------------------------------------------------------------------------
+
+ int ToPrecision( const char* theFormat )
+ {
+ int N = strlen( theFormat );
+ int k = -1;
+ char str[ 255 ];
+ bool isOk = false;
+ for ( int i = 0; i < N; i++ )
+ {
+ if ( theFormat[ i ] == '.' )
+ k = 0;
+ else if ( theFormat[ i ] == 'g' )
+ {
+ str[ k ] = 0;
+ isOk = true;
+ break;
+ }
+ else if ( k >= 0 )
+ str[ k++ ] = theFormat[ i ];
+ }
+
+ int res = 0;
+ if ( isOk )
+ res = atoi( str );
+
+ return res;
+ }
};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#include <vtkTimeStamp.h>
-
namespace VISU
{
//----------------------------------------------------------------------------
~TSetModified();
};
+ Standard_EXPORT std::string ToFormat( const int thePrec );
+ Standard_EXPORT int ToPrecision( const char* theFormat );
+
//----------------------------------------------------------------------------
}
return GetPipeLine()->GetClippingPlane(theID);
}
+//----------------------------------------------------------------------------
+void VISU::Prs3d_i::RemoveClippingPlane(vtkIdType theID)
+{
+ GetPipeLine()->RemoveClippingPlane(theID);
+}
+
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
vtkPlane*
GetClippingPlane(vtkIdType theID) const;
+ void RemoveClippingPlane(vtkIdType theID);
+
void
SetPlaneParam(vtkFloatingPointType theDir[3],
vtkFloatingPointType theDist,
static int MYTIMEDEBUG = 0;
#endif
+using namespace std;
+
namespace VISU
{
//----------------------------------------------------------------------------
static int MYDEBUG = 0;
#endif
+using namespace std;
namespace VISU
{
if(MYDEBUG)
MESSAGE("Result_i::Restore - aFileName = " << myFileInfo.filePath().toLatin1().data() << "; " << myFileInfo.isFile());
- const char* aPathLatin = myFileInfo.filePath().toLatin1().data();
- if (HDFascii::isASCII(aPathLatin)) {
- MESSAGE("ConvertFromASCIIToHDF(" << aPathLatin << ")");
- char* aResultPath = HDFascii::ConvertFromASCIIToHDF(aPathLatin);
+ if (HDFascii::isASCII(myFileInfo.filePath().toLatin1().data())) {
+ MESSAGE("ConvertFromASCIIToHDF(" << myFileInfo.filePath().toLatin1().data() << ")");
+ char* aResultPath = HDFascii::ConvertFromASCIIToHDF(myFileInfo.filePath().toLatin1().data());
MESSAGE("ConvertFromASCIIToHDF() DONE : " << aResultPath);
char* aHDFFileName = new char[strlen(aResultPath) + 19];
sprintf(aHDFFileName, "%shdf_from_ascii.hdf", aResultPath);
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File : VISU_ScalarMapOnDeformedShape_i.cc
+// Author : Eugeny Nikolaev
+// Module : VISU
+
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISU_Result_i.hh"
+
+#include "VISU_ScalarMapAct.h"
+#include "VISU_ScalarMapOnDeformedShapePL.hxx"
+#include "VISU_Convertor.hxx"
+
+#include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
+
+#include <vtkUnstructuredGrid.h>
+#include <vtkProperty.h>
+#include <vtkMapper.h>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+#endif
+
+static int INCMEMORY = 4+12;
+
+
+//---------------------------------------------------------------
+size_t
+VISU::ScalarMapOnDeformedShape_i
+::IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck)
+{
+ size_t aResult = 0;
+ try{
+ aResult = TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ false);
+ if(theIsMemoryCheck && aResult){
+ VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ VISU::PField aField = anInput->GetField(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName);
+ if(aField->myNbComp <= 1)
+ return 0;
+
+ bool anIsEstimated = true;
+ size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ anIsEstimated);
+ if(anIsEstimated)
+ aSize *= INCMEMORY;
+ aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ if(MYDEBUG)
+ MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ }
+ }catch(std::exception& exc){
+ INFOS("Follow exception was occured :\n"<<exc.what());
+ }catch(...){
+ INFOS("Unknown exception was occured!");
+ }
+ return aResult;
+}
+
+//---------------------------------------------------------------
+int VISU::ScalarMapOnDeformedShape_i::myNbPresent = 0;
+
+//---------------------------------------------------------------
+QString
+VISU::ScalarMapOnDeformedShape_i
+::GenerateName()
+{
+ return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);
+}
+
+//---------------------------------------------------------------
+const string VISU::ScalarMapOnDeformedShape_i::myComment = "SCALARMAPONDEFORMEDSHAPE";
+
+//---------------------------------------------------------------
+const char*
+VISU::ScalarMapOnDeformedShape_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
+
+//----------------------------------------------------------------------------
+const char*
+VISU::ScalarMapOnDeformedShape_i
+::GetIconName()
+{
+ if (!IsGroupsUsed())
+ return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE";
+ else
+ return "ICON_TREE_SCALAR_MAP_ON_DEFORMED_SHAPE_GROUPS";
+}
+
+//---------------------------------------------------------------
+VISU::ScalarMapOnDeformedShape_i
+::ScalarMapOnDeformedShape_i(EPublishInStudyMode thePublishInStudyMode) :
+ ColoredPrs3d_i(thePublishInStudyMode),
+ ScalarMap_i(thePublishInStudyMode),
+ myScalarMapOnDeformedShapePL(NULL),
+ myScalarTimeStampNumber(1)
+{}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::ScalarMapOnDeformedShape_i
+::Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber)
+{
+ TSuperClass::Create(theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ SetScalarField(theEntity,
+ theFieldName.c_str(),
+ theTimeStampNumber);
+ return this;
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::ScalarMapOnDeformedShape_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap)
+{
+ if(!TSuperClass::Restore(theSObject, theMap))
+ return NULL;
+
+ QString aMeshName = VISU::Storable::FindValue(theMap,"myScalarMeshName");
+ VISU::Entity anEntity = VISU::Entity(VISU::Storable::FindValue(theMap,"myScalarEntity").toInt());
+
+ QString aFieldName = VISU::Storable::FindValue(theMap,"myScalarFieldName");
+ int aTimeStampNumber = VISU::Storable::FindValue(theMap,"myScalarIteration").toInt();
+
+ SetScalarField(anEntity,
+ aFieldName,
+ aTimeStampNumber);
+
+ SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
+
+ return this;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
+
+ Storable::DataToStream( theStr, "myScalarEntity", int(myScalarEntity));
+ Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
+ Storable::DataToStream( theStr, "myScalarIteration", int(myScalarTimeStampNumber));
+
+ Storable::DataToStream( theStr, "myFactor", GetScale() );
+}
+
+
+//---------------------------------------------------------------
+VISU::ScalarMapOnDeformedShape_i
+::~ScalarMapOnDeformedShape_i()
+{
+ if(MYDEBUG) MESSAGE("ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i()");
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SameAs(const Prs3d_i* theOrigin)
+{
+ TSuperClass::SameAs(theOrigin);
+
+ if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
+ ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
+ CORBA::String_var aFieldName = anOrigin->GetScalarFieldName();
+
+ SetScalarField(anOrigin->GetScalarEntity(),
+ aFieldName,
+ anOrigin->GetScalarTimeStampNumber());
+ Update();
+ }
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScale(CORBA::Double theScale)
+{
+ VISU::TSetModified aModified(this);
+
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkFloatingPointType>
+ (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScale, theScale));
+}
+
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::ScalarMapOnDeformedShape_i
+::GetScale()
+{
+ return myScalarMapOnDeformedShapePL->GetScale();
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::CreatePipeLine(VISU_PipeLine* thePipeLine)
+{
+ if(!thePipeLine){
+ myScalarMapOnDeformedShapePL = VISU_ScalarMapOnDeformedShapePL::New();
+ }else
+ myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
+
+ myScalarMapOnDeformedShapePL->GetMapper()->SetScalarVisibility(1);
+
+ TSuperClass::CreatePipeLine(myScalarMapOnDeformedShapePL);
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::ScalarMapOnDeformedShape_i
+::CheckIsPossible()
+{
+ return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
+}
+
+
+//---------------------------------------------------------------
+VISU_Actor*
+VISU::ScalarMapOnDeformedShape_i
+::CreateActor()
+{
+ VISU_Actor* anActor = TSuperClass::CreateActor(true);
+ SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
+ int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
+ bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
+ anActor->SetRepresentation(aDispMode);
+ if (toShrink)
+ anActor->SetShrink();
+ anActor->SetVTKMapping(false);
+ return anActor;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::UpdateActor(VISU_Actor* theActor)
+{
+ if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
+ anActor->SetBarVisibility(true);
+ GetPipeLine()->GetMapper()->SetScalarVisibility(1);
+ }
+ TSuperClass::UpdateActor(theActor);
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetField(VISU::PField theField)
+{
+ TSuperClass::SetField(theField);
+
+ if(!myScalarField)
+ myScalarField = theField;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarField(VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theTimeStampNumber)
+{
+ bool anIsModified = false;
+
+ if(!anIsModified)
+ anIsModified |= myScalarEntity != theEntity;
+
+ if(!anIsModified)
+ anIsModified |= myScalarFieldName != theFieldName;
+
+ if(!anIsModified)
+ anIsModified |= myScalarTimeStampNumber != theTimeStampNumber;
+
+ if(!anIsModified)
+ return;
+
+ VISU::TSetModified aModified(this);
+
+ VISU::TEntity aEntity = VISU::TEntity(theEntity);
+ VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
+ theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
+
+ VISU::PUnstructuredGridIDMapper anIDMapper =
+ anInput->GetTimeStampOnMesh(GetCMeshName(),
+ aEntity,
+ theFieldName,
+ theTimeStampNumber);
+
+ vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput();
+ if(myScalarMapOnDeformedShapePL && anOutput)
+ ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkDataSet*>
+ (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScalars, anOutput));
+
+ myScalarEntity = theEntity;
+ myScalarFieldName = theFieldName;
+ myScalarTimeStampNumber = theTimeStampNumber;
+
+ SetTitle(theFieldName);
+ SetScalarMode(GetScalarMode());
+ if(!IsRangeFixed() && IsPipeLineExists())
+ SetSourceRange();
+
+ myParamsTime.Modified();
+}
+
+
+//---------------------------------------------------------------
+VISU::Entity
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarEntity()
+{
+ return myScalarEntity;
+}
+
+
+//---------------------------------------------------------------
+char*
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarFieldName()
+{
+ return CORBA::string_dup(myScalarFieldName.c_str());
+}
+
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarTimeStampNumber()
+{
+ return myScalarTimeStampNumber;
+}
+
+
+//---------------------------------------------------------------
+VISU::PField
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarField()
+{
+ return myScalarField;
+}
--- /dev/null
+// VISU OBJECT : interactive object for VISU entities implementation
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+// File: VISU_ScalarMapOnDeformedShape_i.hh
+// Author: Eugeny Nikolaev
+// Module : VISU
+
+#ifndef VISU_ScalarMapOnDeformedShape_i_HeaderFile
+#define VISU_ScalarMapOnDeformedShape_i_HeaderFile
+
+#include "VISU_ScalarMap_i.hh"
+
+class VISU_ScalarMapOnDeformedShapePL;
+
+namespace VISU
+{
+ //----------------------------------------------------------------------------
+ //! Class of Scalar Map on Deformed Shape presentation.
+ class VISU_I_EXPORT ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape,
+ public virtual ScalarMap_i
+ {
+ static int myNbPresent;
+ ScalarMapOnDeformedShape_i(const ScalarMapOnDeformedShape_i&);
+
+ public:
+ //----------------------------------------------------------------------------
+ typedef ScalarMap_i TSuperClass;
+ typedef VISU::ScalarMapOnDeformedShape TInterface;
+
+ explicit
+ ScalarMapOnDeformedShape_i(EPublishInStudyMode thePublishInStudyModep);
+
+ virtual
+ ~ScalarMapOnDeformedShape_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TSCALARMAPONDEFORMEDSHAPE;
+ }
+
+ virtual
+ void
+ SetScale(CORBA::Double theScale);
+
+ virtual
+ CORBA::Double
+ GetScale();
+
+ virtual
+ void
+ SameAs(const Prs3d_i* theOrigin);
+
+ VISU_ScalarMapOnDeformedShapePL*
+ GetSpecificPL()
+ {
+ return myScalarMapOnDeformedShapePL;
+ }
+
+ protected:
+ //! Redefines VISU_ColoredPrs3d_i::SetField
+ virtual
+ void
+ SetField(VISU::PField theField);
+
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine(VISU_PipeLine* thePipeLine);
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
+
+ public:
+ //! Redefines VISU_ColoredPrs3d_i::IsPossible
+ static
+ size_t
+ IsPossible(Result_i* theResult,
+ const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber,
+ bool theIsMemoryCheck);
+
+ //! Redefines VISU_ColoredPrs3d_i::IsPossible
+ virtual
+ Storable*
+ Create(const std::string& theMeshName,
+ VISU::Entity theEntity,
+ const std::string& theFieldName,
+ CORBA::Long theTimeStampNumber);
+
+ //! Redefines VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ //! Redefines VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const Storable::TRestoringMap& theMap);
+
+ static const std::string myComment;
+
+ virtual
+ const char*
+ GetComment() const;
+
+ virtual
+ QString
+ GenerateName();
+
+ virtual
+ const char*
+ GetIconName();
+
+ virtual
+ VISU_Actor*
+ CreateActor();
+
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor) ;
+
+ virtual
+ void
+ SetScalarField(VISU::Entity theEntity,
+ const char* theFieldName,
+ CORBA::Long theTimeStampNumber);
+
+ virtual
+ VISU::Entity
+ GetScalarEntity();
+
+ virtual
+ char*
+ GetScalarFieldName();
+
+ virtual
+ CORBA::Long
+ GetScalarTimeStampNumber();
+
+ virtual
+ VISU::PField
+ GetScalarField();
+
+ private:
+ VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
+
+ PField myScalarField;
+ VISU::Entity myScalarEntity;
+ std::string myScalarFieldName;
+ CORBA::Long myScalarTimeStampNumber;
+ };
+}
+#endif
static int INCMEMORY = 4;
+using namespace std;
//----------------------------------------------------------------------------
size_t
//----------------------------------------------------------------------------
VISU::ScalarMap_i::
ScalarMap_i(EPublishInStudyMode thePublishInStudyMode) :
- ColoredPrs3d_i(thePublishInStudyMode)
+ ColoredPrs3d_i(thePublishInStudyMode),
+ myShowBar(true)
{}
//----------------------------------------------------------------------------
ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(aPrs3d);
SetScaling(anOrigin->GetScaling());
-
+ SetBarVisible(anOrigin->IsBarVisible());
Update();
}
}
else
SetScaling(VISU::LINEAR);
+ myShowBar = true;
return this;
}
SetScaling(VISU::Scaling(VISU::Storable::FindValue(theMap,"myScaling").toInt()));
+ QString aVal = VISU::Storable::FindValue(theMap,"myShowBar", "1");
+ SetBarVisible((aVal.toInt() == 1)? true : false);
+
// Check if the icon needs to be updated, update if necessary
SALOMEDS::Study_var aStudy = theSObject->GetStudy();
SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myScaling", GetScaling() );
+ Storable::DataToStream( theStr, "myShowBar", (IsBarVisible()? 1:0) );
}
return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
}
+void VISU::ScalarMap_i::SetBarVisible(CORBA::Boolean theVisible)
+{
+ if (myShowBar == theVisible)
+ return;
+ VISU::TSetModified aModified(this);
+ myShowBar = theVisible;
+ myParamsTime.Modified();
+}
//----------------------------------------------------------------------------
void
TSuperClass::CreatePipeLine(myScalarMapPL);
}
-//----------------------------------------------------------------------------
-void
-VISU::ScalarMap_i
-::SetMapScale(double theMapScale)
-{
- GetSpecificPL()->SetMapScale(theMapScale);
-}
-
//----------------------------------------------------------------------------
VISU_Actor*
VISU::ScalarMap_i
VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
try{
TSuperClass::CreateActor(anActor);
- anActor->SetBarVisibility(true);
+ anActor->SetBarVisibility(myShowBar);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "scalar_map_represent", 2);
bool toShrink = aResourceMgr->booleanValue("VISU", "scalar_map_shrink", false);
anActor->SetRepresentation(aDispMode);
if (toShrink && !toSupressShrinking) anActor->SetShrink();
anActor->SetShading(toUseShading);
+
+ anActor->SetFeatureEdgesAngle( aResourceMgr->doubleValue("VISU", "feature_edges_angle", 0.0) );
+ anActor->SetFeatureEdgesFlags( aResourceMgr->booleanValue("VISU", "show_feature_edges", false),
+ aResourceMgr->booleanValue("VISU", "show_boundary_edges", false),
+ aResourceMgr->booleanValue("VISU", "show_manifold_edges", false),
+ aResourceMgr->booleanValue("VISU", "show_non_manifold_edges", false) );
+ anActor->SetFeatureEdgesColoring( aResourceMgr->booleanValue("VISU", "feature_edges_coloring", false) );
+
UpdateActor(anActor);
}catch(...){
anActor->Delete();
::UpdateActor(VISU_ActorBase* theActor)
{
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
+ VISU_LookupTable * aLookupTable = GetSpecificPL()->GetBarTable();
+
+ if ( IsScalarFilterUsed() ) {
+ aLookupTable->ForceBuild();
+ static unsigned char MARK_COLOR[] = { 255, 255, 255 };
+ aLookupTable->MarkValueByColor( GetScalarFilterMin(), MARK_COLOR );
+ aLookupTable->MarkValueByColor( GetScalarFilterMax(), MARK_COLOR );
+ }
+
VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
- aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable());
+ aScalarBar->SetLookupTable( aLookupTable );
+
+ aScalarBar->SetDistribution( GetSpecificPL()->GetDistribution() );
+ aScalarBar->SetDistributionVisibility( GetIsDistributionVisible() );
+
aScalarBar->SetTitle(GetScalarBarTitle().c_str());
aScalarBar->SetOrientation(GetBarOrientation());
aScalarBar->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
aScalarBar->GetPositionCoordinate()->SetValue(GetPosX(),GetPosY());
aScalarBar->SetWidth(GetWidth());
aScalarBar->SetHeight(GetHeight());
- aScalarBar->SetRatios(GetTitleWidth(), GetTitleHeight(),
- GetLabelWidth(), GetLabelHeight(),
+ aScalarBar->SetRatios(GetTitleSize(), GetLabelSize(),
GetBarWidth(), GetBarHeight());
aScalarBar->SetNumberOfLabels(GetLabels());
aScalarBar->SetLabelFormat(GetLabelsFormat());
IsItalicLabel()? aLabelProp->ItalicOn() : aLabelProp->ItalicOff();
IsShadowLabel()? aLabelProp->ShadowOn() : aLabelProp->ShadowOff();
+ anActor->SetBarVisibility(myShowBar);
+
aScalarBar->Modified();
+
+ // Update values labels
+
+ vtkTextProperty* aProp = anActor->GetsValLabelsProps();
+ if ( aProp )
+ {
+ aProp->SetFontFamily( GetValLblFontType() );
+ aProp->SetFontSize( GetValLblFontSize() );
+ aProp->SetBold( IsBoldValLbl() );
+ aProp->SetItalic( IsItalicValLbl() );
+ aProp->SetShadow( IsShadowValLbl() );
+
+ vtkFloatingPointType anRGB[ 3 ];
+ GetValLblFontColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
+ aProp->SetColor( anRGB[ 0 ], anRGB[ 1 ], anRGB[ 2 ] );
+ }
}
TSuperClass::UpdateActor(theActor);
}
{
return myScalarMapPL;
}
+
+ virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
+
+ virtual void SetBarVisible(CORBA::Boolean theVisible);
protected:
//! Redefines VISU_ColoredPrs3d_i::DoSetInput
Restore(SALOMEDS::SObject_ptr theSObject,
const Storable::TRestoringMap& theMap);
- virtual
- void
- SetMapScale(double theMapScale = 1.0);
-
virtual
void
SameAs(const Prs3d_i* theOrigin);
private:
VISU_ScalarMapPL* myScalarMapPL;
+ bool myShowBar;
};
}
static int MYDEBUG = 0;
#endif
+using namespace std;
//---------------------------------------------------------------
size_t
#include "utilities.h"
+using namespace std;
+
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
true );
// create SObject referenced to real table object
mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID(anEntry.c_str()));
+
+ // Set icon
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributePixMap_var aPixmap;
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObj, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+ aPixmap ->SetPixMap("ICON_TREE_CURVE");
}
return this;
}
aComment.toLatin1().data(),
true );
mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID(anEntry.c_str()));
+
+ // Set icon
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributePixMap_var aPixmap;
+ anAttr = aStudyBuilder->FindOrCreateAttribute( mySObj, "AttributePixMap" );
+ aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
+ aPixmap ->SetPixMap("ICON_TREE_CONTAINER");
}
return this;
}
#include <Standard_ErrorHandler.hxx>
#endif
+using namespace std;
//------------------------------------------------------------------------
namespace VISU
static int INCMEMORY = 4+12;
+using namespace std;
//---------------------------------------------------------------
size_t
#define VISU_View_i_HeaderFile
#include "VISUConfig.hh"
+#include "SALOME_GenericObj_i.hh"
class QWidget;
class Curve_i;
class VISU_I_EXPORT View_i : public virtual POA_VISU::View,
- public virtual Storable
+ public virtual SALOME::GenericObj_i,
+ public virtual Storable
{
public:
View_i (SalomeApp_Application *theApplication,
//===========================================================================
class VISU_I_EXPORT XYPlot_i : public virtual POA_VISU::XYPlot,
- public virtual View_i
+ public virtual View_i
{
public:
typedef VISU::XYPlot TInterface;
//===========================================================================
class VISU_I_EXPORT View3D_i : public virtual POA_VISU::View3D,
- public virtual View_i
+ public virtual View_i
{
public:
typedef VISU::View3D TInterface;
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-lib_LTLIBRARIES= libVISU_Swigcmodule.la
-dist_libVISU_Swigcmodule_la_SOURCES= VISU_Gen_s.cc
-nodist_libVISU_Swigcmodule_la_SOURCES= libVISU_Swig_wrap.cxx
+SWIG_FLAGS = @SWIG_FLAGS@ -I$(srcdir)
+SWIG_DEF = libVISU_Swig.i
-SWIG_DEF = libVISU_Swig.i
-SWIG_FLAGS= @SWIG_FLAGS@ -I$(srcdir)
+salomeinclude_HEADERS = $(SWIG_DEF) VISU_Gen_s.hh
+
+# Libraries targets
+lib_LTLIBRARIES = _libVISU_Swig.la
+dist__libVISU_Swig_la_SOURCES = $(SWIG_DEF) VISU_Gen_s.hh VISU_Gen_s.cc
+nodist__libVISU_Swig_la_SOURCES = libVISU_Swig_wrap.cxx
libVISU_Swig.py: libVISU_Swig_wrap.cxx
+
libVISU_Swig_wrap.cxx: $(SWIG_DEF)
$(SWIG) $(SWIG_FLAGS) -o $@ $<
-libVISU_Swigcmodule_la_CPPFLAGS= \
+_libVISU_Swig_la_CPPFLAGS = \
-ftemplate-depth-32 \
$(PYTHON_INCLUDES) \
$(HDF5_INCLUDES) \
$(BOOST_CPPFLAGS) \
-I$(srcdir)/../CONVERTOR -I$(srcdir)/../PIPELINE
-libVISU_Swigcmodule_la_LDFLAGS= $(PYTHON_LIBS) ../CONVERTOR/libVisuConvertor.la ../PIPELINE/libVisuPipeLine.la
+_libVISU_Swig_la_LDFLAGS = -module
+_libVISU_Swig_la_LIBADD = $(PYTHON_LIBS) ../CONVERTOR/libVisuConvertor.la ../PIPELINE/libVisuPipeLine.la
-dist_salomescript_DATA= libVISU_Swig.py batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
+dist_salomescript_DATA = batchmode_visu.py batchmode_visu_table.py batchmode_visu_view3d.py \
visu_med.py visu_view3d.py visu.py visu_gui.py visu_prs_example.py \
visu_table.py visu_big_table.py visu_view.py visu_delete.py \
visu_swig_test.py visu_split_views.py \
visu_succcessive_animation.py visu_apply_properties.py visu_apply_properties_successive.py \
+ batch_test_events.py batchmode_visu_view.py test_events.py visu_cache.py visu_pointmap3d.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
-dist_sharedpkgpython_DATA= VISU_shared_modules.py
-CLEANFILES= libVISU_Swig.py libVISU_Swig_wrap.cxx
+nodist_salomescript_DATA = libVISU_Swig.py
-install-exec-hook: $(libdir)/_libVISU_Swig.so
+dist_sharedpkgpython_DATA = VISU_shared_modules.py
-$(libdir)/_libVISU_Swig.so:
- ( cd $(libdir); ln -sf libVISU_Swigcmodule.so _libVISU_Swig.so; )
+CLEANFILES = libVISU_Swig.py libVISU_Swig_wrap.cxx
+++ /dev/null
-import os
-import VISU
-from visu_gui import *
-
-aTableFile = os.getenv('DATA_DIR') + '/Tables/table_test.xls'
-
-aTableSObject = myVisu.ImportTables(aTableFile)
-
-aTable = None
-if aTableSObject:
- anIsFound, aSObject = aTableSObject.FindSubObject(1)
- if anIsFound:
- aTable = aSObject.GetObject()
-
-aViewManager = myVisu.GetViewManager();
-aView = aViewManager.Create3DView()
-if aView is None : print "Creating View Error"
-print aTable
-
-##########Get Values################
-aScaleFactor = aTable.GetScaleFactor();
-anIsContourPrs = aTable.GetIsContourPrs();
-aNbOfContours = aTable.GetNbOfContours();
-aScaling = aTable.GetScaling();
-aMin = aTable.GetMin();
-aMax = aTable.GetMax();
-aSourceMin = aTable.GetSourceMin();
-aSourceMax = aTable.GetSourceMax();
-aPosX = aTable.GetPosX();
-aPosY = aTable.GetPosY();
-aHeight = aTable.GetHeight();
-aWidth = aTable.GetWidth();
-aNbColors = aTable.GetNbColors();
-aLabels = aTable.GetLabels();
-aBarOrientation = aTable.GetBarOrientation();
-
-
-print "Get Values:"
-print "aScaleFactor = ", aScaleFactor
-print "anIsContourPrs = ", anIsContourPrs
-print "aNbOfContours = ", aNbOfContours
-print "aScaling = ", aScaling
-print "===== SCALAR BAR ======="
-print "aMin = ", aMin
-print "aMax = ", aMax
-print "aSourceMin = ", aSourceMin
-print "aSourceMax = ", aSourceMax
-print "aPosX = ", aPosX
-print "aPosY = ", aPosY
-print "aHeight = ", aHeight
-print "aWidth = ", aWidth
-print "aNbColors = ", aNbColors
-print "aLabels = ", aLabels
-print "aBarOrientation = ", aBarOrientation
-
-aView.DisplayOnly( aTable )
-aView.FitAll()
\ No newline at end of file
# header files
salomeinclude_HEADERS= \
VVTK.h \
- VVTK_ViewManager.h \
- VVTK_ViewModel.h \
- VVTK_InteractorStyle.h \
- VVTK_PickingDlg.h \
- VVTK_SegmentationCursorDlg.h \
VVTK_PrimitiveBox.h \
- VVTK_SizeBox.h \
- VVTK_ViewWindow.h \
- VVTK_MainWindow.h \
- VVTK_ImageWriter.h \
- VVTK_ImageWriterMgr.h \
- VVTK_RecorderDlg.h \
- VVTK_Recorder.h
+ VVTK_SizeBox.h
dist_libVVTK_la_SOURCES= \
- VVTK_ViewManager.cxx \
- VVTK_ViewModel.cxx \
- VVTK_InteractorStyle.cxx \
- VVTK_PickingDlg.cxx \
- VVTK_SegmentationCursorDlg.cxx \
VVTK_PrimitiveBox.cxx \
- VVTK_SizeBox.cxx \
- VVTK_ViewWindow.cxx \
- VVTK_Renderer.cxx \
- VVTK_MainWindow.cxx \
- VVTK_ImageWriter.cxx \
- VVTK_ImageWriterMgr.cxx \
- VVTK_RecorderDlg.cxx \
- VVTK_Recorder.cxx
+ VVTK_SizeBox.cxx
MOC_FILES= \
- VVTK_ViewWindow_moc.cxx \
- VVTK_ViewModel_moc.cxx \
- VVTK_ViewManager_moc.cxx \
- VVTK_PickingDlg_moc.cxx \
- VVTK_SegmentationCursorDlg_moc.cxx \
- VVTK_RecorderDlg_moc.cxx \
VVTK_PrimitiveBox_moc.cxx \
- VVTK_SizeBox_moc.cxx \
- VVTK_MainWindow_moc.cxx
+ VVTK_SizeBox_moc.cxx
+
nodist_libVVTK_la_SOURCES=$(MOC_FILES)
libVVTK_la_CPPFLAGS= \
#include <QApplication>
//----------------------------------------------------------------------------
-VVTK_MainWindow
-::VVTK_MainWindow(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow):
+VVTK_MainWindow::VVTK_MainWindow(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow):
SVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow),
- myInteractorStyle(VVTK_InteractorStyle::New()),
myControllerIncrement(VVTK_ControllerIncrement::New()),
myControllerOnKeyDown(VVTK_ControllerOnKeyDown::New())
{
myToolMgr = new QtxActionToolMgr( this );
- myInteractorStyle->SetControllerIncrement(myControllerIncrement.GetPointer());
- myControllerIncrement->Delete();
- myInteractorStyle->SetControllerOnKeyDown(myControllerOnKeyDown.GetPointer());
+ myControllerIncrement->Delete();
myControllerOnKeyDown->Delete();
- myInteractorStyle->Delete();
-
// Recording
myRecordingToolBar = new QToolBar(tr("LBL_TOOLBAR_RECORD_LABEL"), this);
addToolBar(Qt::LeftToolBarArea, myRecordingToolBar );
}
//----------------------------------------------------------------------------
-void
-VVTK_MainWindow
-::Initialize(SVTK_RenderWindowInteractor* theInteractor)
+void VVTK_MainWindow::Initialize(SVTK_RenderWindowInteractor* theInteractor)
{
vtkInteractorStyle* aStyle = theInteractor->GetInteractorStyle();
if(SVTK_InteractorStyle *anInteractorStyle = dynamic_cast<SVTK_InteractorStyle*>(aStyle)){
QApplication::restoreOverrideCursor();
}
-//----------------------------------------------------------------------------
-void
-VVTK_MainWindow
-::OnInteractorStyleSwitch(bool theIsGaussStyleOn)
-{
- if ( theIsGaussStyleOn )
- this->PushInteractorStyle(myInteractorStyle.GetPointer());
- else
- this->PopInteractorStyle();
-}
-
//----------------------------------------------------------------------------
void VVTK_MainWindow::OnStartRecording()
{
}
//----------------------------------------------------------------------------
-void
-VVTK_MainWindow
-::action( const int accelAction )
+void VVTK_MainWindow::action( const int accelAction )
{
if ( accelAction == SUIT_Accel::ZoomFit )
onFitAll();
}
//----------------------------------------------------------------------------
-VVTK_MainWindow1
-::VVTK_MainWindow1(QSplitter* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow):
+VVTK_MainWindow1::VVTK_MainWindow1(QSplitter* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow):
VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow),
- myStyleSwitchAction(NULL),
mySplitter(theParent),
myPickingDlg(NULL)
{
QPixmap aPixmap;
QtxAction* anAction;
- aPixmap = theResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_INTERACTOR_STYLE_SWITCH" ) );
- anAction = new QtxAction(tr("MNU_VVTK_INTERACTOR_STYLE_SWITCH"),
- aPixmap,
- tr( "MNU_VVTK_INTERACTOR_STYLE_SWITCH" ),
- 0,
- this,
- //"VVTK/SVTK StyleSwitch",
- true);
- anAction->setCheckable(true);
- anAction->setStatusTip(tr("DSC_VVTK_INTERACTOR_STYLE_SWITCH"));
-
- myPtsToolBar->addAction( anAction );
- myStyleSwitchAction = anAction;
-
- if( theResourceMgr->integerValue( "VISU", "mouse_behaviour", true ) == 1 )
- myStyleSwitchAction->toggle();
-
aPixmap = theResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SELECTION_MODE_SWITCH"));
myPickingAction = new QtxAction(tr("MNU_VVTK_SELECTION_MODE_SWITCH"),
aPixmap,
myPtsToolBar->addAction( aSegmentationAction );
}
-void
-VVTK_MainWindow1
-::Initialize(SVTK_RenderWindowInteractor* theInteractor,
- VVTK_Renderer1* theRenderer)
+void VVTK_MainWindow1::Initialize(SVTK_RenderWindowInteractor* theInteractor,
+ VVTK_Renderer1* theRenderer)
{
myRenderer = theRenderer;
VVTK_MainWindow::Initialize(theInteractor);
- if( myStyleSwitchAction->isChecked() )
- PushInteractorStyle(myInteractorStyle.GetPointer());
- connect(myStyleSwitchAction, SIGNAL(toggled(bool)), this, SLOT(OnInteractorStyleSwitch(bool)));
-
mySegmentationCursorDlg->SetWidgetCtrl( theRenderer->GetWidgetCtrl() );
mySegmentationCursorDlg->SetInteractor( theInteractor );
myPickingDlg->SetInteractor( theInteractor );
}
-VVTK_MainWindow1
-::~VVTK_MainWindow1()
+VVTK_MainWindow1::~VVTK_MainWindow1()
{}
//----------------------------------------------------------------------------
-VVTK_MainWindow2*
-VVTK_MainWindow1
-::CreateMainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow)
+VVTK_MainWindow2* VVTK_MainWindow1::CreateMainWindow2(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow)
{
myMainWindow2 = new VVTK_MainWindow2(theParent,
theName,
theResourceMgr,
- theViewWindow,
- myStyleSwitchAction);
+ theViewWindow);
return myMainWindow2;
}
//----------------------------------------------------------------------------
-void
-VVTK_MainWindow1
-::OnSelectionModeSwitch(bool theIsSelectionOn)
+void VVTK_MainWindow1::OnSelectionModeSwitch(bool theIsSelectionOn)
{
if ( theIsSelectionOn && !isVisible() )
return;
myPickingDlg->hide();
}
-void
-VVTK_MainWindow1
-::OnSelectionChanged()
+void VVTK_MainWindow1::OnSelectionChanged()
{
Selection_Mode aSelectionMode = SelectionMode();
if(myPickingAction->isChecked() && aSelectionMode != GaussPointSelection)
//----------------------------------------------------------------------------
-VISU_WidgetCtrl*
-VVTK_MainWindow1
-::GetWidgetCtrl()
+VISU_WidgetCtrl* VVTK_MainWindow1::GetWidgetCtrl()
{
return myRenderer->GetWidgetCtrl();
}
-VISU_InsideCursorSettings*
-VVTK_MainWindow1
-::GetInsideCursorSettings()
+VISU_InsideCursorSettings* VVTK_MainWindow1::GetInsideCursorSettings()
{
return mySegmentationCursorDlg->GetInsideCursorSettings();
}
-VISU_OutsideCursorSettings*
-VVTK_MainWindow1
-::GetOutsideCursorSettings()
+VISU_OutsideCursorSettings* VVTK_MainWindow1::GetOutsideCursorSettings()
{
return mySegmentationCursorDlg->GetOutsideCursorSettings();
}
-VISU_PickingSettings*
-VVTK_MainWindow1
-::GetPickingSettings()
+VISU_PickingSettings* VVTK_MainWindow1::GetPickingSettings()
{
return myPickingDlg->GetPickingSettings();
}
//----------------------------------------------------------------------------
-void
-VVTK_MainWindow1
-::SetPlanesSegementation(bool theIsOn)
+void VVTK_MainWindow1::SetPlanesSegementation(bool theIsOn)
{
myPlaneSegmentationAction->setChecked( theIsOn );
OnSegmentationSwitch(myPlaneSegmentationAction);
}
-void
-VVTK_MainWindow1
-::SetSphereSegementation(bool theIsOn)
+void VVTK_MainWindow1::SetSphereSegementation(bool theIsOn)
{
mySphereSegmentationAction->setChecked( theIsOn );
OnSegmentationSwitch(mySphereSegmentationAction);
}
-void
-VVTK_MainWindow1
-::OnSegmentationSwitch(QtxAction* theAction)
+void VVTK_MainWindow1::OnSegmentationSwitch(QtxAction* theAction)
{
bool anIsSegmentationOn = myPlaneSegmentationAction->isChecked() ||
mySphereSegmentationAction->isChecked();
}
}
-void
-VVTK_MainWindow1
-::OnSegmentationSwitch()
+void VVTK_MainWindow1::OnSegmentationSwitch()
{
QtxAction* anAction = ( QtxAction* )sender();
OnSegmentationSwitch(anAction);
//----------------------------------------------------------------------------
-VVTK_MainWindow2
-::VVTK_MainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow,
- QtxAction* theStyleSwitchAction):
- VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow),
- myStyleSwitchAction(theStyleSwitchAction)
+VVTK_MainWindow2::VVTK_MainWindow2(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow):
+ VVTK_MainWindow(theParent,theName,theResourceMgr,theViewWindow)
{}
-VVTK_MainWindow2
-::~VVTK_MainWindow2()
+VVTK_MainWindow2::~VVTK_MainWindow2()
{}
//----------------------------------------------------------------------------
-void
-VVTK_MainWindow2
-::Initialize(SVTK_RenderWindowInteractor* theInteractor)
+void VVTK_MainWindow2::Initialize(SVTK_RenderWindowInteractor* theInteractor)
{
VVTK_MainWindow::Initialize(theInteractor);
-
- if( myStyleSwitchAction->isChecked() )
- PushInteractorStyle(myInteractorStyle.GetPointer());
- connect(myStyleSwitchAction, SIGNAL(toggled(bool)), this, SLOT(OnInteractorStyleSwitch(bool)));
}
SUIT_ViewWindow* theViewWindow);
//! Reimplement SVTK_MainWindow::Initialize
- virtual
- void
- Initialize(SVTK_RenderWindowInteractor* theInteractor);
+ virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor);
//! Destroy instance of the class
- virtual
- ~VVTK_MainWindow();
+ virtual ~VVTK_MainWindow();
public slots:
- virtual
- void
- onDumpView();
+ virtual void onDumpView();
- //! To change active interactor style at run-time
- virtual
- void
- OnInteractorStyleSwitch(bool theIsGaussStyleOn);
+ virtual void action( const int );
- virtual
- void
- action( const int );
+ virtual void OnStartRecording();
- virtual
- void
- OnStartRecording();
+ virtual void OnPlayRecording();
- virtual
- void
- OnPlayRecording();
+ virtual void OnPauseRecording();
- virtual
- void
- OnPauseRecording();
-
- virtual
- void
- OnStopRecording();
+ virtual void OnStopRecording();
protected:
virtual QtxActionToolMgr* toolMgr() const;
- vtkSmartPointer<VVTK_InteractorStyle> myInteractorStyle;
vtkSmartPointer<VVTK_ControllerIncrement> myControllerIncrement;
vtkSmartPointer<VVTK_ControllerOnKeyDown> myControllerOnKeyDown;
SUIT_ViewWindow* theViewWindow);
//! Reimplement VVTK_MainWindow::Initialize
- virtual
- void
- Initialize(SVTK_RenderWindowInteractor* theInteractor,
- VVTK_Renderer1* theRenderer);
+ virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor,
+ VVTK_Renderer1* theRenderer);
//! Destroy instance of the class
- virtual
- ~VVTK_MainWindow1();
+ virtual ~VVTK_MainWindow1();
//! Create instance of the segmented VVTK_MainWindow
/*!
The two views (VVTK_MainWindow1 and VVTK_MainWindow2) should change its behaviour in the same time.
So, it is necessary to synhronize them through sharing some common pointers.
*/
- VVTK_MainWindow2*
- CreateMainWindow2(QWidget* theParent,
- const char* theName,
- SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow);
+ VVTK_MainWindow2* CreateMainWindow2(QWidget* theParent,
+ const char* theName,
+ SUIT_ResourceMgr* theResourceMgr,
+ SUIT_ViewWindow* theViewWindow);
VISU_WidgetCtrl* GetWidgetCtrl();
- void
- SetPlanesSegementation(bool theIsOn);
+ void SetPlanesSegementation(bool theIsOn);
- void
- SetSphereSegementation(bool theIsOn);
+ void SetSphereSegementation(bool theIsOn);
- VISU_InsideCursorSettings*
- GetInsideCursorSettings();
+ VISU_InsideCursorSettings* GetInsideCursorSettings();
//! Get contained VISU_OutsideCursorSettings
- VISU_OutsideCursorSettings*
- GetOutsideCursorSettings();
+ VISU_OutsideCursorSettings* GetOutsideCursorSettings();
//! Get contained VISU_PickingSettings
- VISU_PickingSettings*
- GetPickingSettings();
+ VISU_PickingSettings* GetPickingSettings();
public slots:
//! To activate/ deactivate the segementation cursor at run-time
- void
- OnSegmentationSwitch();//bool theIsSegmentationOn);
+ void OnSegmentationSwitch();//bool theIsSegmentationOn);
- void
- OnSegmentationSwitch(QtxAction* theAction);//bool theIsSegmentationOn);
+ void OnSegmentationSwitch(QtxAction* theAction);//bool theIsSegmentationOn);
//! To change active selection mode at run-time
- virtual
- void
- OnSelectionModeSwitch(bool theIsSelectionOn);
+ virtual void OnSelectionModeSwitch(bool theIsSelectionOn);
//! To adjust to the current selection mode
- virtual
- void
- OnSelectionChanged();
+ virtual void OnSelectionChanged();
protected:
VVTK_Renderer1* myRenderer; //!< Keeps extended version of SVTK_Renderer
VVTK_MainWindow2* myMainWindow2; //!< Refer to segmented view
- QtxAction* myStyleSwitchAction; //!< Action for switch interactor style
QToolBar* myPtsToolBar; //!< Additional tool bar
//! To implement show/hide segmented view on acttivate/ deactivate segementation cursor
VVTK_MainWindow2(QWidget* theParent,
const char* theName,
SUIT_ResourceMgr* theResourceMgr,
- SUIT_ViewWindow* theViewWindow,
- QtxAction* theStyleSwitchAction);
+ SUIT_ViewWindow* theViewWindow);
public:
//! Destroy instance of the class
- virtual
- ~VVTK_MainWindow2();
+ virtual ~VVTK_MainWindow2();
//! Reimplement SVTK_MainWindow::Initialize
- virtual
- void
- Initialize(SVTK_RenderWindowInteractor* theInteractor);
-
- protected:
- // Refer to the VVTK_MainWindow1::myStyleSwitchAction instance
- QtxAction* myStyleSwitchAction;
+ virtual void Initialize(SVTK_RenderWindowInteractor* theInteractor);
};
#include "VVTK_PickingDlg.h"
#include "VISU_GaussPtsAct.h"
-#include "VISU_GaussPtsSettings.h"
+#include "VISU_PickingSettings.h"
#include "VISU_GaussPointsPL.hxx"
#include "SUIT_MessageBox.h"
void VVTK_PickingDlg::AddActor( VISU_GaussPtsAct* theActor )
{
- theActor->SetPickingSettings( myPickingSettings.GetPointer() );
+ //theActor->SetPickingSettings( myPickingSettings.GetPointer() );
}
void VVTK_PickingDlg::RemoveActor( VISU_GaussPtsAct* theActor )
{
- theActor->SetPickingSettings( NULL );
+ //theActor->SetPickingSettings( NULL );
}
void VVTK_PickingDlg::Update()
{
- myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() );
- myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() );
- myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() );
- myTransparencySpinBox->setValue( int(myPickingSettings->GetInfoWindowTransparency() * 100.0) );
- myPositionComboBox->setCurrentIndex( myPickingSettings->GetInfoWindowPosition() );
- myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() );
- myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
- myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
-
- vtkFloatingPointType* aColor = myPickingSettings->GetColor();
- mySelectionColorButton->setColor( QColor( ( int )( aColor[0] * 255.0 ),
- ( int )( aColor[1] * 255.0 ),
- ( int )( aColor[2] * 255.0 ) ) );
+ float aCursorSize = 0.5;
+ float aPyramidHeight = 10.0;
+ float aPointTolerance = 0.1;
+ QColor aColor = Qt::yellow;
+ int anInfoWindowTransparency = 50;
+ int anInfoWindowPosition = VISU_PickingSettings::BelowPoint;
+ float aZoomFactor = 1.5;
+ int aStepNumber = 10;
+ bool aDisplayParentMesh = false;
+
+ //if( !myPickingSettings->GetInitial() )
+ {
+ myCursorSizeSpinBox->setValue( myPickingSettings->GetCursorSize() );
+ myPyramidHeightSpinBox->setValue( myPickingSettings->GetPyramidHeight() );
+ myPointToleranceSpinBox->setValue( myPickingSettings->GetPointTolerance() );
+ myTransparencySpinBox->setValue( int(myPickingSettings->GetInfoWindowTransparency() * 100.0) );
+ myPositionComboBox->setCurrentIndex( myPickingSettings->GetInfoWindowPosition() );
+ myZoomFactorSpinBox->setValue( myPickingSettings->GetZoomFactor() );
+ myStepNumberSpinBox->setValue( myPickingSettings->GetStepNumber() );
+ myDisplayParentMeshCheckBox->setChecked( myPickingSettings->GetDisplayParentMesh() );
+
+ vtkFloatingPointType* aColor = myPickingSettings->GetColor();
+
+ //QPalette aPalette( mySelectionColorButton->palette() );
+ /*aPalette.setColor( mySelectionColorButton->backgroundRole(),
+ QColor( ( int )( aColor[0] * 255.0 ),
+ ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[2] * 255.0 ) ) );
+ mySelectionColorButton->setPalette( aPalette );*/
+ mySelectionColorButton->setColor(
+ QColor( ( int )( aColor[0] * 255.0 ),
+ ( int )( aColor[1] * 255.0 ),
+ ( int )( aColor[2] * 255.0 ) ) );
+
+ return;
+ }
+
+ SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr();
+
+ aCursorSize = aResourceMgr->doubleValue( "VISU", "picking_cursor_size", aCursorSize );
+ myCursorSizeSpinBox->setValue( aCursorSize );
+
+ aPyramidHeight = aResourceMgr->doubleValue( "VISU", "picking_pyramid_height", aPyramidHeight );
+ myPyramidHeightSpinBox->setValue( aPyramidHeight );
+
+ aPointTolerance = aResourceMgr->doubleValue( "VISU", "picking_point_tolerance", aPointTolerance );
+ myPointToleranceSpinBox->setValue( aPointTolerance );
+
+ aColor = aResourceMgr->colorValue( "VISU", "picking_selection_color", aColor );
+ //QPalette aPalette( mySelectionColorButton->palette() );
+ //aPalette.setColor( mySelectionColorButton->backgroundRole(), aColor );
+ mySelectionColorButton->setColor( aColor );
+
+ anInfoWindowTransparency = aResourceMgr->integerValue( "VISU", "picking_transparency", anInfoWindowTransparency );
+ myTransparencySpinBox->setValue( anInfoWindowTransparency );
+
+ anInfoWindowPosition = aResourceMgr->integerValue( "VISU", "picking_position", anInfoWindowPosition );
+ myPositionComboBox->setCurrentIndex( anInfoWindowPosition );
+
+ aZoomFactor = aResourceMgr->doubleValue( "VISU", "picking_zoom_factor", aZoomFactor );
+ myZoomFactorSpinBox->setValue( aZoomFactor );
+
+ aStepNumber = aResourceMgr->integerValue( "VISU", "picking_step_number", aStepNumber );
+ myStepNumberSpinBox->setValue( aStepNumber );
+
+ aDisplayParentMesh = aResourceMgr->booleanValue( "VISU", "picking_display_parent_mesh", aDisplayParentMesh );
+ myDisplayParentMeshCheckBox->setChecked( aDisplayParentMesh );
+
onClickApply();
}
void VVTK_PickingDlg::onClickApply()
{
+ //myPickingSettings->SetInitial( false );
+
myPickingSettings->SetCursorSize( myCursorSizeSpinBox->value() );
myPickingSettings->SetPyramidHeight( myPyramidHeightSpinBox->value() );
myPickingSettings->SetPointTolerance( myPointToleranceSpinBox->value() );
anActor->SetHighlightProperty(myGaussHighlightProperty.GetPointer());
anActor->SetInsideCursorSettings(myInsideCursorSettings);
- anActor->SetPickingSettings(myPickingSettings);
+ //anActor->SetPickingSettings(myPickingSettings);
}
}
anActor->SetHighlightProperty(NULL);
anActor->SetInsideCursorSettings(NULL);
- anActor->SetPickingSettings(NULL);
+ //anActor->SetPickingSettings(NULL);
}
}
#include <vtkRenderer.h>
//---------------------------------------------------------------
-VVTK_Viewer
-::VVTK_Viewer()
+VVTK_Viewer::VVTK_Viewer()
{
}
//---------------------------------------------------------------
-VVTK_Viewer
-::~VVTK_Viewer()
+VVTK_Viewer::~VVTK_Viewer()
{
}
//---------------------------------------------------------------
-SUIT_ViewWindow*
-VVTK_Viewer
-::createView( SUIT_Desktop* theDesktop )
+SUIT_ViewWindow* VVTK_Viewer::createView( SUIT_Desktop* theDesktop )
{
TViewWindow* aViewWindow = new TViewWindow (theDesktop);
aViewWindow->Initialize(this);
aViewWindow->setBackgroundColor( backgroundColor() );
aViewWindow->SetTrihedronSize( trihedronSize() );
+ aViewWindow->SetProjectionMode( projectionMode() );
+ aViewWindow->SetInteractionStyle( interactionStyle() );
+ aViewWindow->SetIncrementalSpeed( incrementalSpeed(), incrementalSpeedMode() );
+ aViewWindow->SetSpacemouseButtons( spacemouseBtn(1), spacemouseBtn(2), spacemouseBtn(3) );
return aViewWindow;
}
//---------------------------------------------------------------
-void
-VVTK_Viewer
-::Display(const SALOME_VTKPrs* thePrs)
+void VVTK_Viewer::Display(const SALOME_VTKPrs* thePrs)
{
// try do downcast object
if(const SVTK_Prs* aPrs = dynamic_cast<const SVTK_Prs*>(thePrs)){
}
//---------------------------------------------------------------
-bool
-VVTK_Viewer
-::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
+bool VVTK_Viewer::isVisible( const Handle(SALOME_InteractiveObject)& theIO )
{
QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)