salomeresdir = $(prefix)/share/@PACKAGE@/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 = $(pkgpythondir)/shared_modules
# Documentation directory
docdir = $(datadir)/doc/@PACKAGE@
$(MOC) $< -o $@
# qm-files generation
-%.qm: %.po
- $(MSG2QM) $< $@
+%.qm: %.ts
+ $(LRELEASE) $< -qm $@
EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.po)
#
-AC_INIT([Salome2 Project SMESH module], [4.1.1], [webmaster.salome@opencascade.com], [salome])
+AC_INIT([Salome2 Project SMESH module], [5.0.0], [webmaster.salome@opencascade.com], [salome])
AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_CONDITIONAL(SMESH_ENABLE_GUI, [test "${SMESH_WITH_GUI}" = "yes"])
-if test "${SMESH_WITH_GUI}" = "yes"; then
-
-echo
-echo ---------------------------------------------
-echo testing msg2qm
-echo ---------------------------------------------
-echo
-
-CHECK_MSG2QM
-
-fi
-
if test "x${GUI_DISABLE_CORBA}" != "xyes" ; then
echo
echo ---------------------------------------------
echo Configure
if test "${SMESH_WITH_GUI}" = "yes"; then
-variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok qwt_ok Kernel_ok Geom_ok Med_ok"
+variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok qwt_ok Kernel_ok Geom_ok Med_ok SalomeGUI_ok"
fi
if test "${SMESH_WITH_GUI}" = "no"; then
+++ /dev/null
-# 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
-#
-# -* Makefile *-
-#
-# Author : Nadir Bouhamou (CEA)
-# Module : SMESH
-# Date : 10/10/2003
-#
-#
-
-# source path
-top_srcdir=@top_srcdir@
-top_builddir=../..
-srcdir=@srcdir@
-VPATH=.:@srcdir@
-
-@COMMENCE@
-
-# Libraries targets
-LIB = libNETGEN.la
-
-# additionnal information to compil and link file
-CPPFLAGS += -DSOLIDGEOM -DLINUX $(OCC_INCLUDES)
-CXXFLAGS += -DSOLIDGEOM -DLINUX $(OCC_CXXFLAGS)
-
-LDFLAGS += $(OCC_KERNEL_LIBS) $(OCC_MODELER_LIBS) -lg2c
-
-NETGEN_LIBS_DIR=@NETGEN_LIBS_DIR@
-
-LIB_OBJ_O = linopt.o \
- bfgs.o \
- linsearch.o \
- global.o \
- bisect.o \
- meshtool.o \
- refine.o \
- ruler3.o \
- improve3.o \
- adfront3.o \
- tetrarls.o \
- prism2rls.o \
- pyramidrls.o \
- pyramid2rls.o \
- netrule3.o \
- ruler2.o \
- meshclass.o \
- improve2.o \
- adfront2.o \
- netrule2.o \
- triarls.o \
- geomsearch.o \
- secondorder.o \
- meshtype.o \
- parser3.o \
- quadrls.o \
- specials.o \
- parser2.o \
- meshing2.o \
- meshing3.o \
- meshfunc.o \
- localh.o \
- improve2gen.o \
- delaunay.o \
- boundarylayer.o \
- msghandler.o \
- meshfunc2d.o \
- smoothing2.o \
- smoothing3.o \
- topology.o \
- curvedelems.o \
- clusters.o \
- zrefine.o \
- ngexception.o \
- geomtest3d.o \
- geom2d.o \
- geom3d.o \
- adtree.o \
- transform3d.o \
- geomfuncs.o \
- polynomial.o \
- densemat.o \
- vector.o \
- basemat.o \
- sparsmat.o \
- algprim.o \
- brick.o \
- manifold.o \
- bspline2d.o \
- meshsurf.o \
- csgeom.o \
- polyhedra.o \
- curve2d.o \
- singularref.o \
- edgeflw.o \
- solid.o \
- explicitcurve2d.o \
- specpoin.o \
- gencyl.o \
- revolution.o \
- genmesh.o \
- spline3d.o \
- surface.o \
- identify.o \
- triapprox.o \
- meshstlsurface.o \
- stlline.o \
- stltopology.o \
- stltool.o \
- stlgeom.o \
- stlgeomchart.o \
- stlgeommesh.o \
- table.o \
- optmem.o \
- spbita2d.o \
- hashtabl.o \
- sort.o \
- flags.o \
- seti.o \
- bitarray.o \
- array.o \
- symbolta.o \
- mystring.o \
- moveablemem.o \
- spline2d.o \
- splinegeometry2.o \
- ngnewdelete.o \
- nglib.o
-
-$(LIB_OBJ_O):
- ar x $(NETGEN_LIBS_DIR)/libnginterface.a
- ar x $(NETGEN_LIBS_DIR)/libcsg.a
- ar x $(NETGEN_LIBS_DIR)/libgprim.a
- ar x $(NETGEN_LIBS_DIR)/libmesh.a
- ar x $(NETGEN_LIBS_DIR)/libopti.a
- ar x $(NETGEN_LIBS_DIR)/libgen.a
- ar x $(NETGEN_LIBS_DIR)/libla.a
- ar x $(NETGEN_LIBS_DIR)/libstlgeom.a
- ar x $(NETGEN_LIBS_DIR)/libgeom2d.a
- rm -rf sgparser.o hprefinement.o parthreads.o writediffpack.o writepermas.o writeuser.o dynamicmem.o importsolution.o readuser.o writefeap.o writetecplot.o wuchemnitz.o extrusion.o writeabaqus.o writefluent.o writetochnog.o csgparser.o geom2dmesh.o
-
-LIB_OBJ_LO = $(LIB_OBJ_O:%.o=%.lo)
-
-#implicits rules
-
-.o.lo:
- ln -s $< $@ || true
-
-@CONCLUDE@
-
-$(LIB): $(LIB_OBJ_O) $(LIB_OBJ_LO)
- @$(LT) --mode=link $(CXX) -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ_LO) $(LDFLAGS) $(LIBS)
-
-mostlyclean: cleandep
- -$(RM) $(LIB_OBJ_O) $(LIB_OBJ_LO)
+++ /dev/null
-The Netgen 4.3 from the web location : http://www.hpfem.jku.at/netgen/ is used
-in the SMESH Module of Salome2 distribution.
-
-How to build Netgen for Salome
-------------------------------
-
-Patch the official netgen 4.3 distribution:
-
-$ cd netgen43
-$ patch -p1 < patch_directory/netgen43ForSalome.patch
-
-Then run makeForSalome.sh:
-$ sh makeForSalome.sh
-
-
-Additional information for maintainers
---------------------------------------
-
-The SMESH Engine of SALOME2 (particularly the m4 file check_Netgen.m4) assume
-that Netgen is installed in the directory <netgen_installation_path> as follow:
-
-prompt> ls <netgen_installation_path>
-
-bin/ cshrc_for_netgen doc/ include/ lib/ tutorials/
-
-prompt> ls <netgen_installation_path>/bin
-
-LINUX/
-
-prompt> ls <netgen_installation_path>/bin/LINUX/
-
-demoapp/ ng ng.tcl ngtcltk/ startup.tcl
-
-prompt> ls <netgen_installation_path>/bin/LINUX/demoapp/
-
-demoapp.tcl
-
-prompt> ls <netgen_installation_path>/bin/LINUX/ngtcltk/
-
-dialog.tcl menustat.tcl ngicon.tcl parameters.tcl
-drawing.tcl nghelp.tcl ngvisual.tcl variables.tcl
-
-prompt> ls <netgen_installation_path>/doc/
-
-ng4.pdf usenetgen.ps
-
-prompt> ls <netgen_installation_path>/include/
-
-nglib.h
-
-prompt> ls <netgen_installation_path>/lib/
-
-LINUX/
-
-prompt> ls <netgen_installation_path>/lib/LINUX/
-
-libcsg.a libgeom2d.a libla.a libnginterface.a libstlgeom.a
-libgen.a libgprim.a libmesh.a libopti.a libvis.a
-
-prompt> ls <netgen_installation_path>/tutorials/
-
-boxcyl.geo cylinder.geo ficherea.geo part1.stl square.in2d
-cone.geo cylsphere.geo hinge.stl sculpture.geo trafo.geo
-cubeandspheres.geo demo2d.in2d lshape3d.geo shaft.geo twobricks.geo
-cube.geo ellipsoid.geo manyholes.geo sphere.geo twocubes.geo
-cubemcyl.geo ellipticcyl.geo matrix.geo sphereincube.geo twocyl.geo
-cubemsphere.geo
-
-All *.tcl files are needed to control and initiate the Netgen mesher throughout its
-MHI (Machine Human Interface).<netgen_installation_path>/bin/LINUX/ng is the Netgen
-executable with its embarked MHI. All the libraries *.a should be compiled without
-the option -DOPENGL which is only needed for the Netgen MHI. netgen43 is assumed to
-be the directory downloaded from the above web location archive of Netgen. The library
-<netgen_installation_path>/lib/LINUX/libnginterface.a should contain the objects
-nglib.o (from netgen43/libsrc/interface/nglib.cpp) and ngnewdelete.o
-(from netgen43/ngtcltk/ngnewdelete.cpp).
-
-To have that kind of distribution from the version in the above web location you
-should first compile Netgen as suggested in the netgen43/README.INSTALL file. It will
-then produce the executable ng linked statically with the libraries *.a. Then modify
-the Makefiles to remove -DOPENGL from compiler flags list, add the objects nglib.o
-and ngnewdelete.o to the library libnginterface.a and recompile the libraries only.
-
-From the above web location perhaps, you will have to alter some Netgen sources to
-compile them; if you find any difficulties to do that, just ask me.
-
-Nadir
-
-********************************
-* Dr Nadir Bouhamou *
-* Ingénieur-chercheur *
-* Engineer-Researcher *
-* *
-* CEA Saclay *
-* DEN/DM2S/SFME/LGLS *
-* Bat 454 Pièce 5A *
-* 91191 Gif-Sur-Yvette cédex *
-* *
-* Tél: +33 (0)1 69 08 73 07 *
-* Fax: +33 (0)1 69 08 96 96 *
-* email: nadir.bouhamou@cea.fr *
-********************************
+++ /dev/null
-diff -N -r -u netgen43/libsrc/include/spline2d.hpp /tmp/netgen43/libsrc/include/spline2d.hpp
---- netgen43/libsrc/include/spline2d.hpp 1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/netgen43/libsrc/include/spline2d.hpp 2003-12-10 16:28:12.000000000 +0100
-@@ -0,0 +1 @@
-+#include "../geom2d/spline2d.hpp"
-diff -N -r -u netgen43/libsrc/include/splinegeometry2.hpp /tmp/netgen43/libsrc/include/splinegeometry2.hpp
---- netgen43/libsrc/include/splinegeometry2.hpp 1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/netgen43/libsrc/include/splinegeometry2.hpp 2003-12-10 16:28:23.000000000 +0100
-@@ -0,0 +1 @@
-+#include "../geom2d/splinegeometry2.hpp"
-diff -N -r -u netgen43/libsrc/interface/Makefile /tmp/netgen43/libsrc/interface/Makefile
---- netgen43/libsrc/interface/Makefile 2003-05-07 16:01:43.000000000 +0200
-+++ /tmp/netgen43/libsrc/interface/Makefile 2003-12-10 15:59:47.000000000 +0100
-@@ -1,4 +1,4 @@
--src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp readuser.cpp importsolution.cpp
-+src = writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp readuser.cpp importsolution.cpp nglib.cpp ngnewdelete.cpp
- #
- lib = nginterface
- libpath = libsrc/interface
-diff -N -r -u netgen43/libsrc/interface/nglib.cpp /tmp/netgen43/libsrc/interface/nglib.cpp
---- netgen43/libsrc/interface/nglib.cpp 2003-05-07 16:01:43.000000000 +0200
-+++ /tmp/netgen43/libsrc/interface/nglib.cpp 2003-12-10 16:32:54.000000000 +0100
-@@ -23,6 +23,20 @@
-
- #include "nglib.h"
-
-+namespace netgen
-+{
-+ char geomfilename [100];
-+
-+ //Destination for messages, errors, ...
-+ void Ng_PrintDest(const char * s)
-+ {
-+ (*mycout) << s << flush;
-+ }
-+
-+#include <spline2d.hpp>
-+#include <splinegeometry2.hpp>
-+}
-+
- using namespace netgen;
-
- // constants and types:
-@@ -171,8 +185,6 @@
- // CSG Geometry
-
- // FlexLexer * lexer;
--char geomfilename [100];
--
-
- // 2D Meshing Functions:
-
-@@ -362,7 +374,18 @@
- cout << "e(" << readedges.Get(i) << "," << readedges.Get(i+1) << ")" << endl;
- }
- */
-- geo->AddEdges(readedges);
-+
-+ ARRAY< Point<3> > readedges1;
-+
-+ for (i = 1; i <= readedges.Size(); i++)
-+ {
-+ Point3d readedgesData = readedges.Get(i);
-+ Point <3> readedges1Data = Point<3>(readedgesData.X(),readedgesData.Y(),readedgesData.Z());
-+
-+ readedges1.Append(readedges1Data);
-+ }
-+
-+ geo->AddEdges(readedges1);
- }
-
- if (geo->GetStatus() == STLTopology::STL_GOOD || geo->GetStatus() == STLTopology::STL_WARNING) return NG_OK;
-@@ -472,7 +495,14 @@
- n = Vec3d(nv[0],nv[1],nv[2]);
- }
-
-- readtrias.Append(STLReadTriangle(apts,n));
-+ Point<3> apts1[3];
-+ apts1[0] = Point<3>(p1[0],p1[1],p1[2]);
-+ apts1[1] = Point<3>(p2[0],p2[1],p2[2]);
-+ apts1[2] = Point<3>(p3[0],p3[1],p3[2]);
-+
-+ Vec<3> n1 = Vec<3>(n.X(),n.Y(),n.Z());
-+
-+ readtrias.Append(STLReadTriangle(apts1,n1));
- }
-
- // add (optional) edges:
-@@ -487,30 +517,29 @@
-
- // compatibility functions:
-
--void MyError (const char * ch)
-+void netgen::MyError (const char * ch)
- {
- cerr << ch;
- }
-
--//Destination for messages, errors, ...
--void Ng_PrintDest(const char * s)
--{
-- (*mycout) << s << flush;
--}
--
--
--double GetTime ()
-+double netgen::GetTime ()
- {
- return 0;
- }
-
--void ResetTime ()
-+void netgen::ResetTime ()
- {
- ;
- }
-
--void MyBeep (int i)
-+void netgen::MyBeep (int i)
- {
- ;
- }
-
-+void MeshFromSpline2D (SplineGeometry2d & geometry,
-+ Mesh *& mesh,
-+ MeshingParameters & mp)
-+{
-+ MeshFromSpline2D (geometry, mesh, mp);
-+}
-diff -N -r -u netgen43/libsrc/makefile.mach.LINUX /tmp/netgen43/libsrc/makefile.mach.LINUX
---- netgen43/libsrc/makefile.mach.LINUX 2003-05-07 16:01:43.000000000 +0200
-+++ /tmp/netgen43/libsrc/makefile.mach.LINUX 2003-12-10 15:12:18.000000000 +0100
-@@ -14,7 +14,8 @@
- #
- CFLAGS2 =
- # pg stands for profiling - also in linkflags2
--CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX -DOPENGL
-+#CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX -DOPENGL
-+CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX
- # -fomit-frame-pointer
- # -ffast-math
- #
-diff -N -r -u netgen43/libsrc/meshing/improve2.cpp /tmp/netgen43/libsrc/meshing/improve2.cpp
---- netgen43/libsrc/meshing/improve2.cpp 2003-05-07 16:01:43.000000000 +0200
-+++ /tmp/netgen43/libsrc/meshing/improve2.cpp 2003-12-10 15:42:00.000000000 +0100
-@@ -3,7 +3,7 @@
- #include "meshing.hpp"
- #include <opti.hpp>
-
--#include <visual.hpp>
-+/*#include <visual.hpp>*/
-
-
- namespace netgen
-diff -N -r -u netgen43/libsrc/meshing/meshing2.cpp /tmp/netgen43/libsrc/meshing/meshing2.cpp
---- netgen43/libsrc/meshing/meshing2.cpp 2003-05-07 16:01:43.000000000 +0200
-+++ /tmp/netgen43/libsrc/meshing/meshing2.cpp 2003-12-10 15:34:35.000000000 +0100
-@@ -1785,7 +1785,7 @@
-
-
- #else
--void glrender (int wait)
-+void netgen::glrender (int wait)
- {
- ;
- }
-diff -N -r -u netgen43/libsrc/visualization/stlmeshing.cpp /tmp/netgen43/libsrc/visualization/stlmeshing.cpp
---- netgen43/libsrc/visualization/stlmeshing.cpp 2003-05-07 16:01:43.000000000 +0200
-+++ /tmp/netgen43/libsrc/visualization/stlmeshing.cpp 2003-12-10 15:52:53.000000000 +0100
-@@ -5,7 +5,7 @@
- #include <stlgeom.hpp>
-
- #include <meshing.hpp>
--#include <visual.hpp>
-+/*#include <visual.hpp>*/
-
- namespace netgen
- {
-diff -N -r -u netgen43/Makefile /tmp/netgen43/Makefile
---- netgen43/Makefile 2003-05-07 16:01:43.000000000 +0200
-+++ /tmp/netgen43/Makefile 2003-12-10 15:11:41.000000000 +0100
-@@ -35,7 +35,8 @@
- .SUFFIXES: .cpp .o
- #
- #
--CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL
-+#CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL
-+CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include
- LINKFLAGS1 = -lGL -lGLU -lX11 -lXext -lXmu
- #
- CPLUSPLUSFLAGS = $(CPLUSPLUSFLAGS1) $(CPLUSPLUSFLAGS2) $(CPLUSPLUSFLAGS3)
-diff -N -r -u netgen43/makeForSalome.sh /tmp/netgen43/makeForSalome.sh
---- netgen43/makeForSalome.sh 1970-01-01 01:00:00.000000000 +0100
-+++ /tmp/netgen43/makeForSalome.sh 2004-01-05 12:33:59.000000000 +0100
-@@ -0,0 +1,26 @@
-+#! /bin/sh
-+cp ngtcltk/ngnewdelete.* libsrc/interface/
-+
-+MACHINE=LINUX
-+export MACHINE
-+make -C libsrc/csg
-+make -C libsrc/general
-+make -C libsrc/geom2d
-+make -C libsrc/gprim
-+make -C libsrc/interface
-+make -C libsrc/linalg
-+make -C libsrc/meshing
-+make -C libsrc/opti
-+make -C libsrc/stlgeom
-+
-+if [ ! -d install ] ; then
-+ mkdir install
-+fi
-+
-+cp -r lib install/
-+
-+if [ ! -d install/include ] ; then
-+ mkdir install/include
-+fi
-+
-+cp libsrc/interface/nglib.h install/include
+++ /dev/null
-# SMESH NETGENPlugin : implementaion of SMESH idl descriptions
-#
-# Copyright (C) 2004 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 : Makefile.in
-# Author : Julia DOROVSKIKH
-# Module : SMESH
-# $Header$
-
-top_srcdir=@top_srcdir@
-top_builddir=../..
-srcdir=@srcdir@
-VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:
-
-
-@COMMENCE@
-
-EXPORT_PYSCRIPTS =
-
-# .po files to transform in .qm
-PO_FILES = NETGENPlugin_icons.po
-
-# Libraries targets
-LIB = libNETGENEngine.la
-LIB_SRC = \
- NETGENPlugin_NETGEN_3D.cxx \
- NETGENPlugin_NETGEN_3D_i.cxx \
- NETGENPlugin_i.cxx
-
-LIB_SERVER_IDL = SMESH_NetgenAlgorithm.idl
-
-LIB_CLIENT_IDL = SMESH_Gen.idl SMESH_Mesh.idl SMESH_Group.idl
-
-# Executables targets
-BIN =
-BIN_SRC =
-
-# additionnal information to compil and link file
-NETGEN_INCLUDES=@NETGEN_INCLUDES@
-
-CPPFLAGS+= $(OCC_INCLUDES) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) \
- $(GEOM_CXXFLAGS) $(NETGEN_INCLUDES) $(BOOST_CPPFLAGS)
-CXXFLAGS+= $(OCC_CXXFLAGS) $(HDF5_INCLUDES) $(KERNEL_CXXFLAGS) \
- $(GEOM_CXXFLAGS) $(NETGEN_INCLUDES)
-
-LDFLAGS+= $(HDF5_LIBS) -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -lNETGEN $(KERNEL_LDFLAGS) $(GEOM_LDFLAGS) -lSalomeGenericObj
-
-@CONCLUDE@
+++ /dev/null
-// 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 : NETGENPlugin_NETGEN_3D.cxx
-// Moved here from SMESH_NETGEN_3D.cxx
-// Created : lundi 27 Janvier 2003
-// Author : Nadir BOUHAMOU (CEA)
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-using namespace std;
-
-#include "NETGENPlugin_NETGEN_3D.hxx"
-#include "SMESH_Gen.hxx"
-#include "SMESH_Mesh.hxx"
-
-#include "SMDS_MeshElement.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMDS_FacePosition.hxx"
-
-#include <TopExp.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
-#include <BRep_Tool.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom2d_Curve.hxx>
-
-#include "utilities.h"
-
-/*
- Netgen include files
-*/
-
-#include "nglib.h"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, int studyId,
- SMESH_Gen* gen)
- : SMESH_3D_Algo(hypId, studyId, gen)
-{
- MESSAGE("NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D");
- _name = "NETGEN_3D";
-// _shapeType = TopAbs_SOLID;
- _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
-// MESSAGE("_shapeType octal " << oct << _shapeType);
- _compatibleHypothesis.push_back("MaxElementVolume");
-
- _maxElementVolume = 0.;
-
- _hypMaxElementVolume = NULL;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-NETGENPlugin_NETGEN_3D::~NETGENPlugin_NETGEN_3D()
-{
- MESSAGE("NETGENPlugin_NETGEN_3D::~NETGENPlugin_NETGEN_3D");
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-bool NETGENPlugin_NETGEN_3D::CheckHypothesis
- (SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- SMESH_Hypothesis::Hypothesis_Status& aStatus)
-{
- MESSAGE("NETGENPlugin_NETGEN_3D::CheckHypothesis");
-
- _hypMaxElementVolume = NULL;
-
- list<const SMESHDS_Hypothesis*>::const_iterator itl;
- const SMESHDS_Hypothesis* theHyp;
-
- const list<const SMESHDS_Hypothesis*>& hyps = GetUsedHypothesis(aMesh, aShape);
- int nbHyp = hyps.size();
- if (!nbHyp)
- {
- aStatus = SMESH_Hypothesis::HYP_MISSING;
- return false; // can't work with no hypothesis
- }
-
- itl = hyps.begin();
- theHyp = (*itl); // use only the first hypothesis
-
- string hypName = theHyp->GetName();
- int hypId = theHyp->GetID();
- SCRUTE(hypName);
-
- bool isOk = false;
-
- if (hypName == "MaxElementVolume")
- {
- _hypMaxElementVolume = static_cast<const StdMeshers_MaxElementVolume*> (theHyp);
- ASSERT(_hypMaxElementVolume);
- _maxElementVolume = _hypMaxElementVolume->GetMaxVolume();
- isOk =true;
- aStatus = SMESH_Hypothesis::HYP_OK;
- }
- else
- aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE;
-
- return isOk;
-}
-
-//=============================================================================
-/*!
- *Here we are going to use the NETGEN mesher
- */
-//=============================================================================
-
-bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
-{
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute with maxElmentsize = " << _maxElementVolume);
-
- bool isOk = false;
- SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
- SMESH_subMesh* theSubMesh = aMesh.GetSubMesh(aShape);
- //const Handle(SMESHDS_SubMesh)& subMeshDS = theSubMesh->GetSubMeshDS();
-
- map<int, const SMDS_MeshNode*> netgenToDS;
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Checking the mesh Faces");
-
- // check if all faces were meshed by a triangle mesher (here MESFISTO_2D)
-
- vector<SMESH_subMesh*> meshFaces;
- vector<TopoDS_Shape> shapeFaces;
-
- for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
- {
- TopoDS_Shape aShapeFace = exp.Current();
- SMESH_subMesh* aSubMesh = aMesh.GetSubMeshContaining(exp.Current());
- ASSERT (aSubMesh);
- int internal_size = meshFaces.size();
- int index = 0;
- for (int i = 0;i<internal_size;i++)
- {
- if (aSubMesh == meshFaces[i]) index = 1;
- }
- if (index == 0) meshFaces.push_back(aSubMesh);
-
- internal_size = shapeFaces.size();
- index = 0;
- for (int i = 0;i<internal_size;i++)
- {
- if (aShapeFace == shapeFaces[i]) index = 1;
- }
- if (index == 0) shapeFaces.push_back(aShapeFace);
- }
-
- int numberOfFaces = meshFaces.size();
- int numberOfShapeFaces = shapeFaces.size();
-
- SCRUTE(numberOfFaces);
- SCRUTE(numberOfShapeFaces);
-
- MESSAGE("---");
-
- int NbTotOfTria = 0;
- int NbTotOfNodesFaces = 0;
-
- for (int i=0; i<numberOfFaces; i++)
- {
- TopoDS_Shape aShapeFace = meshFaces[i]->GetSubShape();
- TopoDS_Shape aFace = shapeFaces[i];
- SMESH_Algo* algoFace = _gen->GetAlgo(aMesh, aShapeFace);
- string algoFaceName = algoFace->GetName();
- SCRUTE(algoFaceName);
- if (algoFaceName != "MEFISTO_2D")
- {
- SCRUTE(algoFaceName);
- ASSERT(0);
- return false;
- }
-
- bool orientationMeshFace = (aFace.Orientation() == aShapeFace.Orientation());
-
- const SMESHDS_SubMesh* aSubMeshDSFace = meshFaces[i]->GetSubMeshDS();
- SCRUTE(aSubMeshDSFace);
-
- int nbNodes = aSubMeshDSFace->NbNodes();
- NbTotOfNodesFaces += nbNodes;
- int nbTria = aSubMeshDSFace->NbElements();
- NbTotOfTria += nbTria;
- int index = 0;
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute The mesh Face " << (i+1) << " has " << nbNodes << " face internal Nodes, " << nbTria << " triangles");
-
- SCRUTE(orientationMeshFace);
-
- if (orientationMeshFace)
- {
- MESSAGE("The mesh and face have the same orientation");
- }
- else
- {
- MESSAGE("The mesh and face have different orientations");
- }
-
- SMDS_NodeIteratorPtr iteratorNodes = aSubMeshDSFace->GetNodes();
- SCRUTE(nbNodes);
- index = 0;
- while(iteratorNodes->more())
- {
- index++;
- const SMDS_MeshNode * node = iteratorNodes->next();
-// int nodeId = node->GetID();
-// double nodeX = node->X();
-// double nodeY = node->Y();
-// double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- }
-
- SCRUTE(index);
-
- SMDS_ElemIteratorPtr iteratorTriangle = aSubMeshDSFace->GetElements();
-
- SCRUTE(nbTria);
- index = 0;
- int numberOfDegeneratedTriangle = 0;
- while(iteratorTriangle->more())
- {
- index++;
- const SMDS_MeshElement * triangle = iteratorTriangle->next();
- int triangleId = triangle->GetID();
-
- SMDS_ElemIteratorPtr triangleNodesIt = triangle->nodesIterator();
-
- const SMDS_MeshNode * node1 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
- double node1X = node1->X();
- double node1Y = node1->Y();
- double node1Z = node1->Z();
-
- const SMDS_MeshNode * node2 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
- double node2X = node2->X();
- double node2Y = node2->Y();
- double node2Z = node2->Z();
-
- const SMDS_MeshNode * node3 = static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
- double node3X = node3->X();
- double node3Y = node3->Y();
- double node3Z = node3->Z();
-
- int triangleNode1 = node1->GetID();
- int triangleNode2 = node2->GetID();
- int triangleNode3 = node3->GetID();
-
- // Compute the triangle surface
-
- double vect1 = ((node2Y - node1Y)*(node3Z - node1Z) - (node2Z - node1Z)*(node3Y - node1Y));
- double vect2 = - ((node2X - node1X)*(node3Z - node1Z) - (node2Z - node1Z)*(node3X - node1X));
- double vect3 = ((node2X - node1X)*(node3Y - node1Y) - (node2Y - node1Y)*(node3X - node1X));
- double epsilon = 1.0e-6;
-
- bool triangleIsDegenerated = ((abs(vect1)<epsilon) && (abs(vect2)<epsilon) && (abs(vect3)<epsilon));
-
- if (triangleIsDegenerated)
- {
-// MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3 << " is degenerated");
-// MESSAGE("NODE -> ID = " << triangleNode1 << " X = " << node1X << " Y = " << node1Y << " Z = " << node1Z);
-// MESSAGE("NODE -> ID = " << triangleNode2 << " X = " << node2X << " Y = " << node2Y << " Z = " << node2Z);
-// MESSAGE("NODE -> ID = " << triangleNode3 << " X = " << node3X << " Y = " << node3Y << " Z = " << node3Z);
- numberOfDegeneratedTriangle++;
- }
- else
- {
-// MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3 << " is normal");
- }
- }
-
- if (numberOfDegeneratedTriangle > 0)
- MESSAGE("WARNING THERE IS(ARE) " << numberOfDegeneratedTriangle << " degenerated triangle on this face");
-
- SCRUTE(index);
- }
-
-
-
- SCRUTE(NbTotOfTria);
- SCRUTE(NbTotOfNodesFaces);
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Checking the mesh Edges");
-
- // check if all edges were meshed by a edge mesher (here Regular_1D)
-
- vector<SMESH_subMesh*> meshEdges;
- for (TopExp_Explorer exp(aShape,TopAbs_EDGE);exp.More();exp.Next())
- {
- SMESH_subMesh* aSubMesh = aMesh.GetSubMeshContaining(exp.Current());
- ASSERT (aSubMesh);
- int internal_size = meshEdges.size();
- int index = 0;
- for (int i = 0;i<internal_size;i++)
- {
- if (aSubMesh == meshEdges[i]) index = 1;
- }
- if (index == 0) meshEdges.push_back(aSubMesh);
- }
-
- int numberOfEdges = meshEdges.size();
- SCRUTE(numberOfEdges);
-
- MESSAGE("---");
-
- int NbTotOfNodesEdges = 0;
- int NbTotOfSegs = 0;
-
- for (int i=0; i<numberOfEdges; i++)
- {
- TopoDS_Shape aShapeEdge = meshEdges[i]->GetSubShape();
- SMESH_Algo* algoEdge = _gen->GetAlgo(aMesh, aShapeEdge);
- string algoEdgeName = algoEdge->GetName();
- SCRUTE(algoEdgeName);
- if (algoEdgeName != "Regular_1D")
- {
- SCRUTE(algoEdgeName);
- ASSERT(0);
- return false;
- }
-
- const SMESHDS_SubMesh* aSubMeshDSEdge = meshEdges[i]->GetSubMeshDS();
- SCRUTE(aSubMeshDSEdge);
-
- int nbNodes = aSubMeshDSEdge->NbNodes();
- NbTotOfNodesEdges += nbNodes;
- int nbSegs = aSubMeshDSEdge->NbElements();
- NbTotOfSegs += nbSegs;
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute The mesh Edge " << (i+1) << " has " << nbNodes << " edge internal Nodes, " << nbSegs << " segments");
-
- SMDS_NodeIteratorPtr iteratorNodes = aSubMeshDSEdge->GetNodes();
- SCRUTE(nbNodes);
- int index = 0;
- while(iteratorNodes->more())
- {
- index++;
- const SMDS_MeshNode * node = iteratorNodes->next();
-// int nodeId = node->GetID();
-// double nodeX = node->X();
-// double nodeY = node->Y();
-// double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- }
-
- SCRUTE(index);
- }
-
- SCRUTE(NbTotOfNodesEdges);
- SCRUTE(NbTotOfSegs);
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Checking the mesh Vertices");
-
- vector<SMESH_subMesh*> meshVertices;
- for (TopExp_Explorer exp(aShape,TopAbs_VERTEX);exp.More();exp.Next())
- {
- SMESH_subMesh* aSubMesh = aMesh.GetSubMeshContaining(exp.Current());
- ASSERT (aSubMesh);
- int internal_size = meshVertices.size();
- int index = 0;
- for (int i = 0;i<internal_size;i++)
- {
- if (aSubMesh == meshVertices[i]) index = 1;
- }
- if (index == 0) meshVertices.push_back(aSubMesh);
- }
-
- int numberOfVertices = meshVertices.size();
- SCRUTE(numberOfVertices);
-
- MESSAGE("---");
-
- int NbTotOfNodesVertices = 0;
-
- for (int i=0; i<numberOfVertices; i++)
- {
- TopoDS_Shape aShapeVertex = meshVertices[i]->GetSubShape();
-
- const SMESHDS_SubMesh * aSubMeshDSVertex = meshVertices[i]->GetSubMeshDS();
- SCRUTE(aSubMeshDSVertex);
-
- int nbNodes = aSubMeshDSVertex->NbNodes();
- NbTotOfNodesVertices += nbNodes;
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute The mesh Vertex " << (i+1) << " has " << nbNodes << " Nodes");
-
- SMDS_NodeIteratorPtr iteratorNodes = aSubMeshDSVertex->GetNodes();
- SCRUTE(nbNodes);
- int index = 0;
- while(iteratorNodes->more())
- {
- index++;
- const SMDS_MeshNode * node = iteratorNodes->next();
-// int nodeId = node->GetID();
-// double nodeX = node->X();
-// double nodeY = node->Y();
-// double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- }
-
- SCRUTE(index);
- }
-
- SCRUTE(NbTotOfNodesVertices);
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute --> Analysis of all shell mesh");
-
- vector<SMESH_subMesh*> meshShells;
- TopoDS_Shell aShell;
-
- for (TopExp_Explorer exp(aShape,TopAbs_SHELL);exp.More();exp.Next())
- {
- SMESH_subMesh* aSubMesh = aMesh.GetSubMesh(exp.Current());
- ASSERT(aSubMesh);
- SCRUTE(aSubMesh);
- aShell = TopoDS::Shell(exp.Current());
- meshShells.push_back(aSubMesh);
- }
-
- int numberOfShells = meshShells.size();
- SCRUTE(numberOfShells);
-
- if (numberOfShells == 1)
- {
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Only one shell --> generation of the mesh using directly Netgen");
-
- /*
- Prepare the Netgen surface mesh from the SMESHDS
- */
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Prepare the Netgen surface mesh from the SMESHDS");
-
- int spaceDimension = 3;
- int nbNodesByTri = 3;
- int nbNodesByTetra = 4;
-
- int Netgen_NbOfNodes = NbTotOfNodesFaces +
- NbTotOfNodesEdges +
- NbTotOfNodesVertices;
- int Netgen_NbOfTria = NbTotOfTria;
- int Netgen_param2ndOrder = 0;
- double Netgen_paramFine = 1.;
- double Netgen_paramSize = _maxElementVolume;
-
- SCRUTE(Netgen_NbOfNodes);
- SCRUTE(Netgen_NbOfTria);
-
- double * Netgen_Coordinates = new double [spaceDimension*
- Netgen_NbOfNodes];
- int * listNodeCoresNetgenSmesh = new int [Netgen_NbOfNodes];
- int * Netgen_Connectivity = new int [nbNodesByTri*Netgen_NbOfTria];
- double * Netgen_point = new double [spaceDimension];
- int * Netgen_triangle = new int [nbNodesByTri];
- int * Netgen_tetrahedron = new int [nbNodesByTetra];
-
- for (int i=0; i<Netgen_NbOfTria; i++)
- {
- for (int j=0; j<nbNodesByTri; j++)
- Netgen_Connectivity[i*nbNodesByTri+j] = 0;
- }
-
- double bigNumber = 1.e20;
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- {
- listNodeCoresNetgenSmesh[i] = 0;
- for (int j=0; j<spaceDimension; j++)
- Netgen_Coordinates[i*spaceDimension+j] = bigNumber;
- }
-
- int indexNodes = 0;
- for (int i=0; i<numberOfVertices; i++)
- {
- const SMESHDS_SubMesh * aSubMeshDSVertex =
- meshVertices[i]->GetSubMeshDS();
-
- SMDS_NodeIteratorPtr iteratorNodes = aSubMeshDSVertex->GetNodes();
-
- while(iteratorNodes->more())
- {
- const SMDS_MeshNode * node = iteratorNodes->next();
- int nodeId = node->GetID();
- double nodeX = node->X();
- double nodeY = node->Y();
- double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- listNodeCoresNetgenSmesh[indexNodes] = nodeId;
- int index = indexNodes*spaceDimension;
- Netgen_Coordinates[index] = nodeX;
- Netgen_Coordinates[index+1] = nodeY;
- Netgen_Coordinates[index+2] = nodeZ;
- netgenToDS[indexNodes] = node;
- indexNodes++;
- }
- }
-
- for (int i=0; i<numberOfEdges; i++)
- {
- const SMESHDS_SubMesh * aSubMeshDSEdge =
- meshEdges[i]->GetSubMeshDS();
-
- SMDS_NodeIteratorPtr iteratorNodes = aSubMeshDSEdge->GetNodes();
-
- while(iteratorNodes->more())
- {
- const SMDS_MeshNode * node = iteratorNodes->next();
- int nodeId = node->GetID();
- double nodeX = node->X();
- double nodeY = node->Y();
- double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- listNodeCoresNetgenSmesh[indexNodes] = node->GetID();
- int index = indexNodes*spaceDimension;
- Netgen_Coordinates[index] = node->X();
- Netgen_Coordinates[index+1] = node->Y();
- Netgen_Coordinates[index+2] = node->Z();
- netgenToDS[indexNodes] = node;
- indexNodes++;
- }
- }
-
- for (int i=0; i<numberOfFaces; i++)
- {
- const SMESHDS_SubMesh * aSubMeshDSFace =
- meshFaces[i]->GetSubMeshDS();
-
- SMDS_NodeIteratorPtr iteratorNodes = aSubMeshDSFace->GetNodes();
-
- while(iteratorNodes->more())
- {
- const SMDS_MeshNode * node = iteratorNodes->next();
- int nodeId = node->GetID();
- double nodeX = node->X();
- double nodeY = node->Y();
- double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- listNodeCoresNetgenSmesh[indexNodes] = nodeId;
- int index = indexNodes*spaceDimension;
- Netgen_Coordinates[index] = nodeX;
- Netgen_Coordinates[index+1] = nodeY;
- Netgen_Coordinates[index+2] = nodeZ;
- netgenToDS[indexNodes] = node;
- indexNodes++;
- }
- }
-
- SCRUTE(indexNodes);
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- {
- ASSERT(listNodeCoresNetgenSmesh[i] != 0);
-
- for (int j=0; j<Netgen_NbOfNodes && j!=i; j++)
- ASSERT(listNodeCoresNetgenSmesh[i] != listNodeCoresNetgenSmesh[j]);
-
- for (int j=0; j<spaceDimension; j++)
- ASSERT(Netgen_Coordinates[i*spaceDimension+j] != bigNumber);
- }
-
- int indexTrias = 0;
- for (int i=0; i<numberOfFaces; i++)
- {
- const SMESHDS_SubMesh * aSubMeshDSFace =
- meshFaces[i]->GetSubMeshDS();
-
- TopoDS_Shape aFace = shapeFaces[i];
-
- SMDS_ElemIteratorPtr iteratorTriangle = aSubMeshDSFace->GetElements();
-
- TopoDS_Shape aShapeFace = meshFaces[i]->GetSubShape();
-
- bool orientationMeshFace = (aFace.Orientation() == aShapeFace.Orientation());
-
- SCRUTE(orientationMeshFace);
-
- if (orientationMeshFace)
- {
- MESSAGE("The mesh and face have the same orientation");
-
- while(iteratorTriangle->more())
- {
- const SMDS_MeshElement * triangle = iteratorTriangle->next();
- int triangleId = triangle->GetID();
-
- SMDS_ElemIteratorPtr triangleNodesIt = triangle->nodesIterator();
-
- int triangleNode1 = (triangleNodesIt->next())->GetID();
- int triangleNode2 = (triangleNodesIt->next())->GetID();
- int triangleNode3 = (triangleNodesIt->next())->GetID();
-
-// MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
-
- int N1New = 0;
- int N2New = 0;
- int N3New = 0;
- int index = indexTrias*nbNodesByTri;
-
- for (int j=0; j<Netgen_NbOfNodes; j++)
- {
- int jp1 = j+1;
-
- if (triangleNode1 == listNodeCoresNetgenSmesh[j])
- N1New = jp1;
- else if (triangleNode2 == listNodeCoresNetgenSmesh[j])
- N2New = jp1;
- else if (triangleNode3 == listNodeCoresNetgenSmesh[j])
- N3New = jp1;
- }
-
- triangleNode1 = N1New;
- triangleNode2 = N2New;
- triangleNode3 = N3New;
-
- Netgen_Connectivity[index] = triangleNode1;
- Netgen_Connectivity[index+1] = triangleNode2;
- Netgen_Connectivity[index+2] = triangleNode3;
-
- indexTrias++;
- }
- }
- else
- {
- MESSAGE("The mesh and face have different orientations");
-
- while(iteratorTriangle->more())
- {
- const SMDS_MeshElement * triangle = iteratorTriangle->next();
- int triangleId = triangle->GetID();
-
- SMDS_ElemIteratorPtr triangleNodesIt = triangle->nodesIterator();
-
- int triangleNode1 = (triangleNodesIt->next())->GetID();
- int triangleNode3 = (triangleNodesIt->next())->GetID();
- int triangleNode2 = (triangleNodesIt->next())->GetID();
-
-// MESSAGE("TRIANGLE -> ID = " << triangleId << " N1 = " << triangleNode1 << " N2 = " << triangleNode2 << " N3 = " << triangleNode3);
-
- int N1New = 0;
- int N2New = 0;
- int N3New = 0;
- int index = indexTrias*nbNodesByTri;
-
- for (int j=0; j<Netgen_NbOfNodes; j++)
- {
- int jp1 = j+1;
-
- if (triangleNode1 == listNodeCoresNetgenSmesh[j])
- N1New = jp1;
- else if (triangleNode2 == listNodeCoresNetgenSmesh[j])
- N2New = jp1;
- else if (triangleNode3 == listNodeCoresNetgenSmesh[j])
- N3New = jp1;
- }
-
- triangleNode1 = N1New;
- triangleNode2 = N2New;
- triangleNode3 = N3New;
-
- Netgen_Connectivity[index] = triangleNode1;
- Netgen_Connectivity[index+1] = triangleNode2;
- Netgen_Connectivity[index+2] = triangleNode3;
-
- indexTrias++;
- }
- }
- }
-
- SCRUTE(indexTrias);
-
- int * nodesUsed = new int[Netgen_NbOfNodes];
-
- for (int i=0; i<Netgen_NbOfNodes; i++) nodesUsed[i] = 0;
-
- for (int i=0; i<Netgen_NbOfTria; i++)
- for (int j=0; j<nbNodesByTri; j++)
- {
- int Nij = Netgen_Connectivity[i*nbNodesByTri+j];
-
- ASSERT((Nij>=1) && (Nij<=Netgen_NbOfNodes));
-
- nodesUsed[Nij-1] = 1;
- Netgen_Connectivity[i*nbNodesByTri+j] = Nij;
- }
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- {
- ASSERT(nodesUsed[i] != 0);
- }
-
- delete [] nodesUsed;
-
- /*
- Feed the Netgen surface mesh
- */
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Feed the Netgen surface mesh");
-
- Ng_Mesh * Netgen_mesh;
-
- Ng_Init();
-
- Netgen_mesh = Ng_NewMesh();
-
- Ng_Meshing_Parameters Netgen_param;
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- {
- for (int j=0; j<spaceDimension; j++)
- Netgen_point[j] = Netgen_Coordinates[i*spaceDimension+j];
-
- Ng_AddPoint(Netgen_mesh, Netgen_point);
- }
-
- for (int i=0; i<Netgen_NbOfTria; i++)
- {
- for (int j=0; j<nbNodesByTri; j++)
- Netgen_triangle[j] = Netgen_Connectivity[i*nbNodesByTri+j];
-
- Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle);
- }
-
- SCRUTE(Netgen_paramSize);
-
- Netgen_param.secondorder = Netgen_param2ndOrder;
- Netgen_param.fineness = Netgen_paramFine;
- Netgen_param.maxh = Netgen_paramSize;
-
- /*
- Generate the volume mesh
- */
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Generate the volume mesh");
-
- SCRUTE(Netgen_NbOfNodes);
- SCRUTE(Netgen_NbOfTria);
-
- SCRUTE(Ng_GetNP(Netgen_mesh));
- SCRUTE(Ng_GetNE(Netgen_mesh));
- SCRUTE(Ng_GetNSE(Netgen_mesh));
-
- ASSERT(Netgen_NbOfNodes == Ng_GetNP(Netgen_mesh));
- ASSERT(Ng_GetNE(Netgen_mesh) == 0);
- ASSERT(Netgen_NbOfTria == Ng_GetNSE(Netgen_mesh));
-
- Ng_Result status;
-
- status = Ng_GenerateVolumeMesh(Netgen_mesh, &Netgen_param);
-
- SCRUTE(status);
-
- int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh);
-
- int Netgen_NbOfTetra = Ng_GetNE(Netgen_mesh);
-
- SCRUTE(Netgen_NbOfNodesNew);
-
- SCRUTE(Netgen_NbOfTetra);
-
- if ((status != NG_OK) ||
- (Netgen_NbOfNodesNew <= Netgen_NbOfNodes) ||
- (Netgen_NbOfTetra <= 0))
- {
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute The Volume Mesh Generation has failed ...");
- SCRUTE(status);
-
- /*
- Free the memory needed by to generate the Netgen Mesh
- */
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Free the memory needed by to generate the Netgen Mesh");
-
- delete [] Netgen_Coordinates;
- delete [] Netgen_Connectivity;
- delete [] Netgen_point;
- delete [] Netgen_triangle;
- delete [] Netgen_tetrahedron;
-
- delete [] listNodeCoresNetgenSmesh;
-
- Ng_DeleteMesh(Netgen_mesh);
- Ng_Exit();
-
- return false;
- }
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute End of Volume Mesh Generation");
- SCRUTE(status);
-
- double * Netgen_CoordinatesNew = new double [spaceDimension*Netgen_NbOfNodesNew];
- int * Netgen_ConnectivityNew = new int [nbNodesByTetra*Netgen_NbOfTetra];
-
- for (int i=0; i<Netgen_NbOfNodesNew; i++)
- {
- Ng_GetPoint(Netgen_mesh, (i+1), Netgen_point);
-
- for (int j=0; j<spaceDimension; j++)
- Netgen_CoordinatesNew[i*spaceDimension+j] = Netgen_point[j];
- }
-
- for (int i=0; i<Netgen_NbOfNodes; i++)
- for (int j=0; j<spaceDimension; j++)
- ASSERT(Netgen_CoordinatesNew[i*spaceDimension+j] == Netgen_Coordinates[i*spaceDimension+j])
-
- for (int i=0; i<Netgen_NbOfTetra; i++)
- {
- Ng_GetVolumeElement(Netgen_mesh, (i+1), Netgen_tetrahedron);
-
- for (int j=0; j<nbNodesByTetra; j++)
- Netgen_ConnectivityNew[i*nbNodesByTetra+j] = Netgen_tetrahedron[j];
- }
-
- /*
- Feed back the SMESHDS with the generated Nodes and Volume Elements
- */
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Feed back the SMESHDS with the generated Nodes and Volume Elements");
-
- int NbTotOfNodesShell = Netgen_NbOfNodesNew - Netgen_NbOfNodes;
-
- SCRUTE(NbTotOfNodesShell);
-
- int * listNodeShellCoresNetgenSmesh = new int [NbTotOfNodesShell];
-
- for (int i=0; i<NbTotOfNodesShell; i++)
- listNodeShellCoresNetgenSmesh[i] = 0;
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute --> Adding the New Nodes to SMESHDS");
-
- for (int i=0; i<NbTotOfNodesShell; i++)
- {
- int index = (i+Netgen_NbOfNodes)*spaceDimension;
-
- SMDS_MeshNode * node =
- meshDS->AddNode(Netgen_CoordinatesNew[index],
- Netgen_CoordinatesNew[index+1],
- Netgen_CoordinatesNew[index+2]);
-
- meshDS->SetNodeInVolume(node, aShell);
-
- index = i+Netgen_NbOfNodes;
- netgenToDS[index] = node;
-
- listNodeShellCoresNetgenSmesh[i] = node->GetID();
- }
-
- SCRUTE(Netgen_NbOfNodesNew);
-
- SCRUTE(netgenToDS.size());
-
- for (int i=0; i<NbTotOfNodesShell; i++)
- {
- ASSERT(listNodeShellCoresNetgenSmesh[i] != 0);
-
- for (int j=0; j<NbTotOfNodesShell && j!=i; j++)
- ASSERT(listNodeShellCoresNetgenSmesh[i] != listNodeShellCoresNetgenSmesh[j]);
- }
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute --> Adding the New elements (Tetrahedrons) to the SMESHDS");
-
- for (int i=0; i<Netgen_NbOfTetra; i++)
- {
- int index = i*nbNodesByTetra;
- int tetraNode1 = Netgen_ConnectivityNew[index];
- int tetraNode2 = Netgen_ConnectivityNew[index+1];
- int tetraNode3 = Netgen_ConnectivityNew[index+2];
- int tetraNode4 = Netgen_ConnectivityNew[index+3];
-
- const SMDS_MeshNode * node1 = netgenToDS[tetraNode1-1];
- const SMDS_MeshNode * node2 = netgenToDS[tetraNode2-1];
- const SMDS_MeshNode * node3 = netgenToDS[tetraNode3-1];
- const SMDS_MeshNode * node4 = netgenToDS[tetraNode4-1];
-
- index = tetraNode1;
- if (index <= Netgen_NbOfNodes)
- tetraNode1 = listNodeCoresNetgenSmesh[index-1];
- else
- tetraNode1 = listNodeShellCoresNetgenSmesh[index-Netgen_NbOfNodes-1];
-
- index = tetraNode2;
- if (index <= Netgen_NbOfNodes)
- tetraNode2 = listNodeCoresNetgenSmesh[index-1];
- else
- tetraNode2 = listNodeShellCoresNetgenSmesh[index-Netgen_NbOfNodes-1];
-
- index = tetraNode3;
- if (index <= Netgen_NbOfNodes)
- tetraNode3 = listNodeCoresNetgenSmesh[index-1];
- else
- tetraNode3 = listNodeShellCoresNetgenSmesh[index-Netgen_NbOfNodes-1];
-
- index = tetraNode4;
- if (index <= Netgen_NbOfNodes)
- tetraNode4 = listNodeCoresNetgenSmesh[index-1];
- else
- tetraNode4 = listNodeShellCoresNetgenSmesh[index-Netgen_NbOfNodes-1];
-
- SMDS_MeshVolume * elt =
- meshDS->AddVolume(node1,node2,node3,node4);
-
- meshDS->SetMeshElementOnShape(elt, aShell);
- }
-
- /*
- Free the memory needed by to generate the Netgen Mesh
- */
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Free the memory needed by to generate the Netgen Mesh");
-
- delete [] Netgen_Coordinates;
- delete [] Netgen_Connectivity;
- delete [] Netgen_CoordinatesNew;
- delete [] Netgen_ConnectivityNew;
- delete [] Netgen_point;
- delete [] Netgen_triangle;
- delete [] Netgen_tetrahedron;
-
- delete [] listNodeCoresNetgenSmesh;
- delete [] listNodeShellCoresNetgenSmesh;
-
- Ng_DeleteMesh(Netgen_mesh);
- Ng_Exit();
-
- /*
- Verification
- */
-
- {
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute Verification of the Shell mesh");
-
- TopoDS_Shape aShapeShell = meshShells[0]->GetSubShape();
- SMESH_Algo* algoShell = _gen->GetAlgo(aMesh, aShapeShell);
- string algoShellName = algoShell->GetName();
- SCRUTE(algoShellName);
- if (algoShellName != "NETGEN_3D")
- {
- SCRUTE(algoShellName);
- ASSERT(0);
- return false;
- }
-
- const SMESHDS_SubMesh * aSubMeshDSShell = meshShells[0]->GetSubMeshDS();
- SCRUTE(&aSubMeshDSShell);
-
- int nbNodes = aSubMeshDSShell->NbNodes();
- int nbTetra = aSubMeshDSShell->NbElements();
-
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute The mesh Shell has " << nbNodes << " shell internal Nodes, " << nbTetra << " tetrahedrons");
-
- SMDS_NodeIteratorPtr iteratorNodes = aSubMeshDSShell->GetNodes();
-
- SCRUTE(nbNodes);
-
- int index;
-
- index = 0;
-
- while(iteratorNodes->more())
- {
- index++;
- const SMDS_MeshNode * node = iteratorNodes->next();
- int nodeId = node->GetID();
- double nodeX = node->X();
- double nodeY = node->Y();
- double nodeZ = node->Z();
-// MESSAGE("NODE -> ID = " << nodeId << " X = " << nodeX << " Y = " << nodeY << " Z = " << nodeZ);
- }
-
- SCRUTE(index);
-
- SMDS_ElemIteratorPtr iteratorTetra = aSubMeshDSShell->GetElements();
-
- SCRUTE(nbTetra);
-
- index = 0;
- while(iteratorTetra->more())
- {
- index++;
- const SMDS_MeshElement * tetra = iteratorTetra->next();
- int tetraId = tetra->GetID();
-
- SMDS_ElemIteratorPtr tetraNodesIt = tetra->nodesIterator();
-
- int tetraNode1 = (tetraNodesIt->next())->GetID();
- int tetraNode2 = (tetraNodesIt->next())->GetID();
- int tetraNode3 = (tetraNodesIt->next())->GetID();
- int tetraNode4 = (tetraNodesIt->next())->GetID();
-
-// MESSAGE("TETRAHEDRON -> ID = " << tetraId << " N1 = " << tetraNode1 << " N2 = " << tetraNode2 << " N3 = " << tetraNode3 << " N4 = " << tetraNode4);
-
- }
-
- SCRUTE(index);
- }
- }
- else
- {
- SCRUTE(numberOfShells);
- MESSAGE("NETGENPlugin_NETGEN_3D::Compute ERROR More than one shell ????? ");
- return false;
- }
-
- return true;
-}
-
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & NETGENPlugin_NETGEN_3D::SaveTo(ostream & save)
-{
- return save;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & NETGENPlugin_NETGEN_3D::LoadFrom(istream & load)
-{
- return load;
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-ostream & operator << (ostream & save, NETGENPlugin_NETGEN_3D & hyp)
-{
- return hyp.SaveTo( save );
-}
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-istream & operator >> (istream & load, NETGENPlugin_NETGEN_3D & hyp)
-{
- return hyp.LoadFrom( load );
-}
+++ /dev/null
-// 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 : NETGENPlugin_NETGEN_3D.hxx
-// Moved here from SMESH_NETGEN_3D.hxx
-// Created : lundi 27 Janvier 2003
-// Author : Nadir BOUHAMOU (CEA)
-// Project : SALOME
-// Copyright : CEA 2003
-// $Header$
-//=============================================================================
-
-#ifndef _NETGENPlugin_NETGEN_3D_HXX_
-#define _NETGENPlugin_NETGEN_3D_HXX_
-
-#include "SMESH_3D_Algo.hxx"
-#include "SMESH_Mesh.hxx"
-#include "StdMeshers_MaxElementVolume.hxx"
-#include "Utils_SALOME_Exception.hxx"
-
-class NETGENPlugin_NETGEN_3D: public SMESH_3D_Algo
-{
-public:
- NETGENPlugin_NETGEN_3D(int hypId, int studyId, SMESH_Gen* gen);
- virtual ~NETGENPlugin_NETGEN_3D();
-
- virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape,
- SMESH_Hypothesis::Hypothesis_Status& aStatus);
-
- virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape);
-
- ostream & SaveTo(ostream & save);
- istream & LoadFrom(istream & load);
- friend ostream & operator << (ostream & save, NETGENPlugin_NETGEN_3D & hyp);
- friend istream & operator >> (istream & load, NETGENPlugin_NETGEN_3D & hyp);
-
-protected:
- double _maxElementVolume;
-
- const StdMeshers_MaxElementVolume* _hypMaxElementVolume;
-};
-
-#endif
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// 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 : NETGENPlugin_NETGEN_3D_i.cxx
-// Moved here from SMESH_NETGEN_3D_i.cxx
-// Author : Nadir Bouhamou CEA
-// Module : SMESH
-// $Header$
-
-using namespace std;
-#include "NETGENPlugin_NETGEN_3D_i.hxx"
-#include "SMESH_Gen.hxx"
-
-#include "Utils_CorbaException.hxx"
-#include "utilities.h"
-
-//=============================================================================
-/*!
- * NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i
- *
- * Constructor
- */
-//=============================================================================
-
-NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl )
- : SALOME::GenericObj_i( thePOA ),
- SMESH_Hypothesis_i( thePOA ),
- SMESH_Algo_i( thePOA ),
- SMESH_3D_Algo_i( thePOA )
-{
- MESSAGE( "NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i" );
- myBaseImpl = new ::NETGENPlugin_NETGEN_3D( theGenImpl->GetANewId(),
- theStudyId,
- theGenImpl );
-}
-
-//=============================================================================
-/*!
- * NETGENPlugin_NETGEN_3D_i::~NETGENPlugin_NETGEN_3D_i
- *
- * Destructor
- */
-//=============================================================================
-
-NETGENPlugin_NETGEN_3D_i::~NETGENPlugin_NETGEN_3D_i()
-{
- MESSAGE( "NETGENPlugin_NETGEN_3D_i::~NETGENPlugin_NETGEN_3D_i" );
-}
-
-//=============================================================================
-/*!
- * NETGENPlugin_NETGEN_3D_i::GetImpl
- *
- * Get implementation
- */
-//=============================================================================
-
-::NETGENPlugin_NETGEN_3D* NETGENPlugin_NETGEN_3D_i::GetImpl()
-{
- MESSAGE( "NETGENPlugin_NETGEN_3D_i::GetImpl" );
- return ( ::NETGENPlugin_NETGEN_3D* )myBaseImpl;
-}
-
+++ /dev/null
-// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-//
-// 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 : NETGENPlugin_NETGEN_3D_i.hxx
-// Moved here from SMESH_NETGEN_3D_i.hxx
-// Author : Nadir Bouhamou CEA
-// Module : SMESH
-// $Header$
-
-#ifndef _NETGENPlugin_NETGEN_3D_I_HXX_
-#define _NETGENPlugin_NETGEN_3D_I_HXX_
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_NetgenAlgorithm)
-
-#include "SMESH_3D_Algo_i.hxx"
-#include "NETGENPlugin_NETGEN_3D.hxx"
-
-// ======================================================
-// NETGEN 3d algorithm
-// ======================================================
-class NETGENPlugin_NETGEN_3D_i:
- public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_3D,
- public virtual SMESH_3D_Algo_i
-{
-public:
- // Constructor
- NETGENPlugin_NETGEN_3D_i( PortableServer::POA_ptr thePOA,
- int theStudyId,
- ::SMESH_Gen* theGenImpl );
- // Destructor
- virtual ~NETGENPlugin_NETGEN_3D_i();
-
- // Get implementation
- ::NETGENPlugin_NETGEN_3D* GetImpl();
-};
-
-#endif
+++ /dev/null
-// SMESH NETGENPlugin : implementaion of SMESH idl descriptions
-//
-// 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 : NETGENPlugin.cxx
-// Author : Julia DOROVSKIKH
-// Module : SMESH
-// $Header$
-
-using namespace std;
-#include "SMESH_Hypothesis_i.hxx"
-#include "SMESH_Gen_i.hxx"
-
-#include "utilities.h"
-
-#include "NETGENPlugin_NETGEN_3D_i.hxx"
-
-//=============================================================================
-/*!
- *
- */
-//=============================================================================
-
-extern "C"
-{
- GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
- {
- MESSAGE("GetHypothesisCreator " << aHypName);
-
- GenericHypothesisCreator_i* aCreator = 0;
-
- // Hypotheses
-
- // Algorithms
- if (strcmp(aHypName, "NETGEN_3D") == 0)
- aCreator = new HypothesisCreator_i<NETGENPlugin_NETGEN_3D_i>;
- else ;
-
- return aCreator;
- }
-}
+++ /dev/null
-# 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
-#
-# This is a Qt message file in .po format. Each msgid starts with
-# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
-# would be translated to "Pub", not "Foo::Pub".
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
-"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
-
-#-----------------------------------------------------------
-# ObjectBrowser
-#-----------------------------------------------------------
-
-#mesh_tree_algo_netgen
-msgid "ICON_SMESH_TREE_ALGO_NETGEN_3D"
-msgstr "mesh_tree_algo_tetra.png"
-#msgstr "mesh_tree_algo_netgen.png"
#include "SMESH_DeviceActor.h"
#include "SMESH_ControlsDef.hxx"
#include "VTKViewer_ExtractUnstructuredGrid.h"
-
-#include <SALOME_InteractiveObject.hxx>
+#include "SALOME_InteractiveObject.hxx"
#include "SUIT_Session.h"
#include "SUIT_ResourceMgr.h"
-#include <qstringlist.h>
-
#include <vtkProperty.h>
#include <vtkTimeStamp.h>
#include <vtkObjectFactory.h>
#include "SMESH_Object.h"
-#include <qcolor.h>
-#include <qstring.h>
-
-#include "VTKViewer.h"
+#include <QColor>
class vtkUnstructuredGrid;
QColor
GetColor( const QString& theSect,
const QString& theName,
- const QColor&t = QColor() );
+ const QColor& = QColor() );
SMESHOBJECT_EXPORT
void
int&,
int&,
int&,
- const QColor&t = QColor() );
+ const QColor& = QColor() );
SMESHOBJECT_EXPORT
void
vtkFloatingPointType&,
vtkFloatingPointType&,
vtkFloatingPointType&,
- const QColor&t = QColor() );
+ const QColor& = QColor() );
SMESHOBJECT_EXPORT
void
// Purpose : Constructor
//=======================================================================
SMESH_LogicalFilter::SMESH_LogicalFilter (const QList<SUIT_SelectionFilter*>& theFilters,
- const int theLogOp)
+ const int theLogOp)
{
setFilters(theFilters);
setOperation(theLogOp);
//=======================================================================
bool SMESH_LogicalFilter::isOk (const SUIT_DataOwner* owner) const
{
- bool res = true;
- for ( QList<SUIT_SelectionFilter*>::const_iterator it = myFilters.begin(); it != myFilters.end() && res; ++it )
+ SUIT_SelectionFilter* filter;
+ foreach( filter, myFilters )
{
- SUIT_SelectionFilter* filter = *it;
if (myOperation == LO_OR && filter->isOk(owner))
return true;
if (myOperation == LO_AND && !filter->isOk(owner))
_PTR(Study) study = appStudy->studyDS();
QString entry = owner->entry();
- _PTR(SObject) aSO( study->FindObjectID( (const char*)entry.toLatin1() ) ), aRefSO;
+ _PTR(SObject) aSO( study->FindObjectID( entry.toLatin1().data() ) ), aRefSO;
if( extractReference && aSO && aSO->ReferencedObject( aRefSO ) )
aSO = aRefSO;
_PTR(Study) study = appStudy->studyDS();
QString entry = owner->entry();
- _PTR(SObject) obj (study->FindObjectID((const char*)entry.toLatin1())), aRefSO;
+ _PTR(SObject) obj (study->FindObjectID(entry.toLatin1().data())), aRefSO;
if( extractReference && obj && obj->ReferencedObject( aRefSO ) )
obj = aRefSO;
if (!obj) return false;
-# SMESH SMESHGUI : GUI for SMESH component
+# SMESH SMESHGUI : GUI for SMESH 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
+# 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 : Makefile.am
+# Author : Alexander BORODIN, Open CASCADE S.A.S.
#
-# File : Makefile.in
-# Author : Nicolas REJNERI
-# Modified by : Alexander BORODIN (OCN) - autotools usage
-# Module : SMESH
-# $Header$
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# header files
salomeinclude_HEADERS = \
- SMESHGUI_Swig.hxx \
- SMESHGUI_Swig.i \
SMESHGUI.h \
SMESHGUI_Utils.h \
SMESHGUI_Hypotheses.h \
SMESHGUI_WhatIsDlg.cxx \
SMESHGUI_Preferences_ColorDlg.cxx \
SMESHGUI_Preferences_ScalarBarDlg.cxx \
- SMESHGUI_Preferences_SelectionDlg.cxx \
- SMESHGUI_Swig.cxx \
SMESHGUI_MoveNodesDlg.cxx \
SMESHGUI_AddMeshElementDlg.cxx \
SMESHGUI_XmlHandler.cxx \
SMESHGUI_TranslationDlg.cxx \
SMESHGUI_SymmetryDlg.cxx \
SMESHGUI_SewingDlg.cxx \
- SMESHGUI_MergeNodesDlg.cxx \
SMESHGUI_EditMeshDlg.cxx \
SMESHGUI_Utils.cxx \
SMESHGUI_GEOMGenUtils.cxx \
SMESHGUI_WhatIsDlg_moc.cxx \
SMESHGUI_Preferences_ColorDlg_moc.cxx \
SMESHGUI_Preferences_ScalarBarDlg_moc.cxx \
- SMESHGUI_Preferences_SelectionDlg_moc.cxx \
SMESHGUI_MoveNodesDlg_moc.cxx \
SMESHGUI_AddMeshElementDlg_moc.cxx \
SMESHGUI_FilterDlg_moc.cxx \
SMESHGUI_TranslationDlg_moc.cxx \
SMESHGUI_SymmetryDlg_moc.cxx \
SMESHGUI_SewingDlg_moc.cxx \
- SMESHGUI_MergeNodesDlg_moc.cxx \
SMESHGUI_EditMeshDlg_moc.cxx \
SMESHGUI_CreatePolyhedralVolumeDlg_moc.cxx \
SMESHGUI_Operation_moc.cxx \
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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
//
-// 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.
+// File : SMESHGUI.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-// 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 : SMESHGUI.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI.h"
-
-#include "SMESH_Client.hxx"
#include "SMESHGUI_NodesDlg.h"
#include "SMESHGUI_TransparencyDlg.h"
#include "SMESHGUI_ClippingDlg.h"
#include "SMESHGUI_WhatIsDlg.h"
#include "SMESHGUI_Preferences_ColorDlg.h"
#include "SMESHGUI_Preferences_ScalarBarDlg.h"
-#include "SMESHGUI_Preferences_SelectionDlg.h"
#include "SMESHGUI_Hypotheses.h"
#include "SMESHGUI_MoveNodesDlg.h"
#include "SMESHGUI_AddMeshElementDlg.h"
#include "SMESHGUI_ComputeDlg.h"
#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_GEOMGenUtils.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_GroupUtils.h"
#include "SMESHGUI_FilterUtils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_HypothesesUtils.h"
-#include "SMESH_Actor.h"
-#include "SMESH_Object.h"
-#include "SMESH_TypeFilter.hxx"
+#include <SMESH_Client.hxx>
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
-#include "SalomeApp_Tools.h"
-#include "SalomeApp_Study.h"
-#include "SalomeApp_Application.h"
-#include "SalomeApp_CheckFileDlg.h"
-#include "SalomeApp_ImportOperation.h"
+// SALOME GUI includes
+#include <SalomeApp_Tools.h>
+#include <SalomeApp_Study.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_CheckFileDlg.h>
-#include "LightApp_DataOwner.h"
-#include "LightApp_Preferences.h"
-#include "LightApp_VTKSelector.h"
-#include "LightApp_Operation.h"
-#include "LightApp_UpdateFlags.h"
-#include "LightApp_NameDlg.h"
+#include <LightApp_DataOwner.h>
+#include <LightApp_Preferences.h>
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_UpdateFlags.h>
+#include <LightApp_NameDlg.h>
#include <SVTK_ViewWindow.h>
#include <SVTK_ViewModel.h>
-#include <SVTK_InteractorStyle.h>
-#include <SVTK_RenderWindowInteractor.h>
#include <SVTK_ViewManager.h>
-#include "OB_Browser.h"
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Session.h>
-#include "SUIT_Tools.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_FileDlg.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_Study.h"
-#include "SUIT_Session.h"
+#include <QtxPopupMgr.h>
+#include <QtxFontEdit.h>
-#include "QtxPopupMgr.h"
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SALOME_InteractiveObject.hxx"
-#include "SALOME_NamingService.hxx"
-#include "SALOME_LifeCycleCORBA.hxx"
-
-#include "SALOMEconfig.h"
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-// QT Includes
-#define INCLUDE_MENUITEM_DEF
-#include <qpopupmenu.h>
-#include <qstring.h>
-#include <qwidget.h>
-#include <qaction.h>
+// Qt includes
+// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
+#include <QMenu>
-// BOOST Includes
+// BOOST includes
#include <boost/shared_ptr.hpp>
-// VTK Includes
-#include <vtkRenderer.h>
-#include <vtkRenderWindow.h>
-#include <vtkActorCollection.h>
+// VTK includes
#include <vtkScalarBarActor.h>
-#include <vtkUnstructuredGrid.h>
-
-#include "utilities.h"
-#include "SALOMEDS_Study.hxx"
-#include "SALOMEDSClient_StudyBuilder.hxx"
-#include "SALOMEDSClient_SComponent.hxx"
+// SALOME KERNEL includes
+#include <SALOMEDS_Study.hxx>
+#include <SALOMEDSClient_StudyBuilder.hxx>
+#include <SALOMEDSClient_SComponent.hxx>
+// OCCT includes
#include <Standard_ErrorHandler.hxx>
-using namespace std;
-
//namespace{
// Declarations
//=============================================================
case 112:
{
aMeshes->length( 1 );
- aMeshes[0] = theComponentMesh->CreateMeshesFromUNV(filename.latin1());
+ aMeshes[0] = theComponentMesh->CreateMeshesFromUNV(filename.toLatin1().data());
break;
}
case 113:
{
SMESH::DriverMED_ReadStatus res;
- aMeshes = theComponentMesh->CreateMeshesFromMED(filename.latin1(),res);
+ aMeshes = theComponentMesh->CreateMeshesFromMED(filename.toLatin1().data(),res);
if ( res != SMESH::DRS_OK ) {
wc.suspend();
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr(QString("SMESH_DRS_%1").arg(res)),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr(QString("SMESH_DRS_%1").arg(res).
+ toLatin1().data()));
aMeshes->length( 0 );
wc.resume();
}
if ( isEmpty ) {
wc.suspend();
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_DRS_EMPTY"),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_DRS_EMPTY"));
wc.resume();
}
case 122:
{
if (aMesh->HasDuplicatedGroupNamesMED()) {
- int aRet = SUIT_MessageBox::warn2
+ int aRet = SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_EXPORT_MED_DUPLICATED_GRP").arg(anIObject->getName()),
- QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"),
- 0, 1, 0);
- if (aRet)
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::Yes);
+ if (aRet != SUIT_MessageBox::Yes)
return;
}
// PAL18696
case 123:
{
if (aMesh->NbPyramids()) {
- int aRet = SUIT_MessageBox::warn2
+ int aRet = SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_EXPORT_UNV").arg(anIObject->getName()),
- QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"),
- 0, 1, 0);
- if (aRet)
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::Yes);
+ if (aRet != SUIT_MessageBox::Yes)
return;
}
aFilter = QObject::tr("IDEAS files (*.unv)");
there must be check on others mesh elements not equal triangles
*/
if (aMesh->NbTriangles() < 1) {
- SUIT_MessageBox::warn1
+ SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_STL1").arg(anIObject->getName()),
- QObject::tr("SMESH_BUT_OK"));
+ QObject::tr("SMESH_EXPORT_STL1").arg(anIObject->getName()));
return;
}
if (!(aMesh->NbElements() - aMesh->NbTriangles())) {
- int aRet = SUIT_MessageBox::warn2
+ int aRet = SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_EXPORT_STL2").arg(anIObject->getName()),
- QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"),
- 0, 1, 0);
- if (aRet)
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::Yes);
+ if (aRet != SUIT_MessageBox::Yes)
return;
}
filters.push_back( it.key() );
SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
- fd->setCaption( aTitle );
+ fd->setWindowTitle( aTitle );
fd->setFilters( filters );
- fd->setSelectedFilter( QObject::tr("STL ASCII (*.stl)") );
+ fd->selectFilter( QObject::tr("STL ASCII (*.stl)") );
bool is_ok = false;
while (!is_ok) {
fd->exec();
//SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg
- ( SMESHGUI::desktop(), false, QObject::tr("SMESH_AUTO_GROUPS") ,true, true );
- fd->setCaption( aTitle );
+ ( SMESHGUI::desktop(), false, QObject::tr("SMESH_AUTO_GROUPS"), true, true );
+ fd->setWindowTitle( aTitle );
fd->setFilters( filters );
- fd->setSelectedFilter( QObject::tr("MED 2.2 (*.med)") );
+ fd->selectFilter( QObject::tr("MED 2.2 (*.med)") );
fd->SetChecked(toCreateGroups);
bool is_ok = false;
while (!is_ok) {
if ( !aFilename.isEmpty()
&& (aMesh->NbPolygons()>0 || aMesh->NbPolyhedrons()>0)
&& aFormat==SMESH::MED_V2_1) {
- int aRet = SUIT_MessageBox::warn2(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_MED_V2_1").arg(anIObject->getName()),
- QObject::tr("SMESH_BUT_YES"),
- QObject::tr("SMESH_BUT_NO"),
- 0,1,0);
- if (aRet) {
+ int aRet = SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_MED_V2_1").arg(anIObject->getName()),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::Yes);
+ if (aRet != SUIT_MessageBox::Yes) {
is_ok = false;
}
}
SUIT_OverrideCursor wc;
try {
- bool Renumber = false ;
+ bool Renumber = false;
// PAL 14172 : Check of we have to renumber or not from the preferences before export
if (resMgr)
Renumber= resMgr->booleanValue("SMESH","renumbering");
switch ( theCommandID ) {
case 125:
case 122:
- aMesh->ExportToMED( aFilename.latin1(), toCreateGroups, aFormat );
+ aMesh->ExportToMED( aFilename.toLatin1().data(), toCreateGroups, aFormat );
break;
case 124:
case 121:
- aMesh->ExportDAT( aFilename.latin1() );
+ aMesh->ExportDAT( aFilename.toLatin1().data() );
break;
case 126:
case 123:
- aMesh->ExportUNV( aFilename.latin1() );
+ aMesh->ExportUNV( aFilename.toLatin1().data() );
break;
case 140:
case 141:
- aMesh->ExportSTL( aFilename.latin1(), aIsASCII_STL );
+ aMesh->ExportSTL( aFilename.toLatin1().data(), aIsASCII_STL );
break;
default:
break;
}
catch (const SALOME::SALOME_Exception& S_ex){
wc.suspend();
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_EXPORT_FAILED"),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_EXPORT_FAILED"));
wc.resume();
}
}
if(selected.Extent() >= 1){
SALOME_ListIteratorOfListIO It( selected );
- for(; It.More(); It.Next()){
+ for( ; It.More(); It.Next()){
Handle(SALOME_InteractiveObject) IObject = It.Value();
if(IObject->hasEntry()){
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
aMainObject->SetAutoColor( true );
- QValueList<SALOMEDS::Color> aReservedColors;
+ QList<SALOMEDS::Color> aReservedColors;
SMESH::ListOfGroups aListOfGroups = *aMainObject->GetGroups();
for( int i = 0, n = aListOfGroups.length(); i < n; i++ )
switch(theCommandID){
case 1134:{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
- new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI(), "", false );
+ (new SMESHGUI_ClippingDlg( SMESHGUI::GetSMESHGUI() ))->show();
return;
}
case 1133:{
SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog();
- new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI(), "", false );
+ (new SMESHGUI_TransparencyDlg( SMESHGUI::GetSMESHGUI() ))->show();
return;
}}
SALOME_ListIteratorOfListIO It( selected );
- for(; It.More(); It.Next()){
+ for( ; It.More(); It.Next()){
Handle(SALOME_InteractiveObject) IObject = It.Value();
if(IObject->hasEntry()){
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(IObject->getEntry())){
vtkFloatingPointType Shrink = anActor->GetShrinkFactor();
SMESHGUI_Preferences_ColorDlg *aDlg =
- new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI(), "" );
+ new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI() );
aDlg->SetColor(1, c);
aDlg->SetColor(2, e);
aDlg->SetColor(3, n);
break;
}
anActor->SetControlMode(aControl);
- anActor->GetScalarBarActor()->SetTitle(aTitle.latin1());
+ anActor->GetScalarBarActor()->SetTitle(aTitle.toLatin1().data());
SMESH::RepaintCurrentView();
}
}
QString RefType = CheckTypeObject(selected.First());
SALOME_ListIteratorOfListIO It(selected);
- for (; It.More(); It.Next())
+ for ( ; It.More(); It.Next())
{
Handle(SALOME_InteractiveObject) IObject = It.Value();
QString Type = CheckTypeObject(IObject);
}
if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() ) {
- SUIT_MessageBox::warn1 ( SMESHGUI::desktop(),
- QObject::tr("ERR_ERROR"),
- QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ),
- QObject::tr("BUT_OK") );
+ SUIT_MessageBox::warning( SMESHGUI::desktop(),
+ QObject::tr("ERR_ERROR"),
+ QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
return;
}
// VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
- if (SUIT_MessageBox::warn2
+ if (SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_REALLY_DELETE"),
- QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"), 1, 0, 0) != 1)
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
return;
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
SALOME_ListIteratorOfListIO It(selected);
aStudyBuilder->NewCommand(); // There is a transaction
- for(; It.More(); It.Next()){ // loop on selected IO's
+ for( ; It.More(); It.Next()){ // loop on selected IO's
Handle(SALOME_InteractiveObject) IObject = It.Value();
if(IObject->hasEntry()) {
_PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
// disable removal of "SMESH" component object
if(aSO->FindAttribute(anAttr, "AttributeIOR")){
anIOR = anAttr;
- if ( !strcmp( (char*)anIOR->Value().c_str(), engineIOR().latin1() ) )
+ if ( engineIOR() == anIOR->Value().c_str() )
continue;
}
/** Erase graphical object **/
if(SO->FindAttribute(anAttr, "AttributeIOR")){
- QPtrVector<SUIT_ViewWindow> aViews = vm->getViews();
+ QVector<SUIT_ViewWindow*> aViews = vm->getViews();
for(int i = 0; i < nbSf; i++){
SUIT_ViewWindow *sf = aViews[i];
if(SMESH_Actor* anActor = SMESH::FindActorByEntry(sf,anEntry.c_str())){
}
else {
IObject = new SALOME_InteractiveObject
- ( anEntry.c_str(), engineIOR().latin1(), SO->GetName().c_str() );
+ ( anEntry.c_str(), engineIOR().toLatin1().data(), SO->GetName().c_str() );
QString objType = CheckTypeObject(IObject);
if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS
SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
static bool checkLock(_PTR(Study) theStudy) {
if (isStudyLocked(theStudy)) {
- SUIT_MessageBox::warn1 ( SMESHGUI::desktop(),
- QObject::tr("WRN_WARNING"),
- QObject::tr("WRN_STUDY_LOCKED"),
- QObject::tr("BUT_OK") );
+ SUIT_MessageBox::warning( SMESHGUI::desktop(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED") );
return true;
}
return false;
#endif
if (vtkwnd) {
SALOME_ListIteratorOfListIO It( to_process );
- for (; It.More(); It.Next()) {
+ for ( ; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject) IOS = It.Value();
if (IOS->hasEntry()) {
if (!SMESH::UpdateView(anAction, IOS->getEntry()))
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_NodesDlg(this);
+ ( new SMESHGUI_NodesDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if ( vtkwnd )
{
EmitSignalDeactivateDialog();
- new SMESHGUI_FilterDlg( this, SMESH::EDGE );
+ ( new SMESHGUI_FilterDlg( this, SMESH::EDGE ) )->show();
}
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
if(checkLock(aStudy)) break;
- new SMESHGUI_MoveNodesDlg(this);
+ ( new SMESHGUI_MoveNodesDlg( this ) )->show();
break;
}
{
if (checkLock(aStudy)) break;
EmitSignalDeactivateDialog();
- new SMESHGUI_BuildCompoundDlg( this );
+ ( new SMESHGUI_BuildCompoundDlg( this ) )->show();
}
break;
case 407: // DIAGONAL INVERSION
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(IObject);
if ( aMesh->_is_nil() )
{
- SUIT_MessageBox::warn1(GetDesktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "SMESH_BAD_SELECTION" ), tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning(GetDesktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "SMESH_BAD_SELECTION" ) );
break;
}
*/
EmitSignalDeactivateDialog();
if ( theCommandID == 407 )
- new SMESHGUI_TrianglesInversionDlg(this);
+ ( new SMESHGUI_TrianglesInversionDlg( this ) )->show();
else
- new SMESHGUI_UnionOfTwoTrianglesDlg(this);
+ ( new SMESHGUI_UnionOfTwoTrianglesDlg( this ) )->show();
break;
}
case 409: // Change orientation
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
if(checkLock(aStudy)) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_SmoothingDlg( this );
+ ( new SMESHGUI_SmoothingDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if (checkLock(aStudy)) break;
if (vtkwnd) {
EmitSignalDeactivateDialog();
- new SMESHGUI_ExtrusionDlg ( this );
+ ( new SMESHGUI_ExtrusionDlg ( this ) )->show();
} else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_RevolutionDlg( this );
+ ( new SMESHGUI_RevolutionDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if ( vtkwnd )
{
EmitSignalDeactivateDialog();
- new SMESHGUI_MeshPatternDlg( this );
+ ( new SMESHGUI_MeshPatternDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if (checkLock(aStudy)) break;
if (vtkwnd) {
EmitSignalDeactivateDialog();
- new SMESHGUI_ExtrusionAlongPathDlg( this );
+ ( new SMESHGUI_ExtrusionAlongPathDlg( this ) )->show();
} else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
EmitSignalDeactivateDialog();
new SMESHGUI_ConvToQuadDlg();
} else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}*/
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
// check if mesh is selected
aMesh = SMESH::GetMeshByIO( selected.First() );
}
- SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", aMesh);
+ SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aMesh);
aDlg->show();
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
}
}
else if(nbSel==0) {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_NO_AVAILABLE_DATA"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NO_AVAILABLE_DATA"));
}
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(It.Value());
if (!aGroup->_is_nil()) {
nbSelectedGroups++;
- SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", aGroup);
+ SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, aGroup);
aDlg->show();
}
}
if (nbSelectedGroups == 0)
{
- SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, "", SMESH::SMESH_GroupBase::_nil());
+ SMESHGUI_GroupDlg *aDlg = new SMESHGUI_GroupDlg( this, SMESH::SMESH_GroupBase::_nil());
aDlg->show();
}
break;
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
{
if ( !vtkwnd )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
break;
}
EmitSignalDeactivateDialog();
- new SMESHGUI_DeleteGroupDlg( this );
+ ( new SMESHGUI_DeleteGroupDlg( this ) )->show();
break;
}
for ( ; It.More(); It.Next() ) {
IOs.Clear(); IOs.Append( It.Value() );
aSel->setSelectedObjects( IOs );
- new SMESHGUI_MeshInfosDlg(this, "", false);
+ ( new SMESHGUI_MeshInfosDlg( this ) )->show();
}
// restore selection
aSel->setSelectedObjects( selected );
}
else
- new SMESHGUI_MeshInfosDlg(this, "", false);
+ ( new SMESHGUI_MeshInfosDlg( this ) )->show();
break;
}
IOs.Clear();
IOs.Append( It.Value() );
aSel->setSelectedObjects( IOs );
- new SMESHGUI_StandardMeshInfosDlg( this, "", false);
+ ( new SMESHGUI_StandardMeshInfosDlg( this ) )->show();
}
// restore selection
aSel->setSelectedObjects( selected );
}
else
- new SMESHGUI_StandardMeshInfosDlg( this, "", false);
+ ( new SMESHGUI_StandardMeshInfosDlg( this ) )->show();
break;
}
case 903: // WHAT IS
{
EmitSignalDeactivateDialog();
- new SMESHGUI_WhatIsDlg( this, "", false);
+ ( new SMESHGUI_WhatIsDlg( this ) )->show();
break;
}
/* Warning : however by internal mechanism all subMeshes icons are changed ! */
if ( !aHypothesis->_is_nil() )
{
- CORBA::String_var aHypType = aHypothesis->GetName();
- SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypType);
+ SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName());
if (aCreator)
aCreator->edit( aHypothesis.in(), anIObject->getName(), desktop() );
else
if ( !newName.isEmpty() )
{
//old source: aStudy->renameIObject( IObject, newName );
- aName->SetValue( newName.latin1() );
+ aName->SetValue( newName.toLatin1().data() );
// if current object is group update group's name
SMESH::SMESH_GroupBase_var aGroup =
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IObject);
if (!aGroup->_is_nil() )
- aGroup->SetName( newName.latin1() );
+ aGroup->SetName( newName.toLatin1().data() );
updateObjBrowser();
}
type = SMDSAbs_Volume; nbNodes = 9; break; // 9 - identificator for POLYHEDRE
default:;
}
- new SMESHGUI_AddMeshElementDlg( this, "", type, nbNodes);
+ ( new SMESHGUI_AddMeshElementDlg( this, type, nbNodes ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_CreatePolyhedralVolumeDlg(this, "", FALSE );
+ ( new SMESHGUI_CreatePolyhedralVolumeDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
break;
default:;
}
- new SMESHGUI_AddQuadraticElementDlg( this, type );
+ ( new SMESHGUI_AddQuadraticElementDlg( this, type ) )->show();
}
else {
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_RemoveNodesDlg(this);
+ ( new SMESHGUI_RemoveNodesDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_RemoveElementsDlg(this);
+ ( new SMESHGUI_RemoveElementsDlg( this ) )->show();
}
else
{
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_RenumberingDlg( this, "", 0);
+ ( new SMESHGUI_RenumberingDlg( this, 0 ) )->show();
}
else
{
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_RenumberingDlg( this, "", 1);
+ ( new SMESHGUI_RenumberingDlg( this, 1 ) )->show();
}
else
{
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if ( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_TranslationDlg( this );
+ ( new SMESHGUI_TranslationDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if( vtkwnd ) {
EmitSignalDeactivateDialog();
- new SMESHGUI_RotationDlg( this );
+ ( new SMESHGUI_RotationDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if(vtkwnd) {
EmitSignalDeactivateDialog();
- new SMESHGUI_SymmetryDlg( this );
+ ( new SMESHGUI_SymmetryDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if(vtkwnd) {
EmitSignalDeactivateDialog();
- new SMESHGUI_SewingDlg( this );
+ ( new SMESHGUI_SewingDlg( this ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if(checkLock(aStudy)) break;
if(vtkwnd) {
EmitSignalDeactivateDialog();
- new SMESHGUI_EditMeshDlg( this, 0 );
+ ( new SMESHGUI_EditMeshDlg( this, 0 ) )->show();
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
if (checkLock(aStudy)) break;
if (vtkwnd) {
EmitSignalDeactivateDialog();
- new SMESHGUI_EditMeshDlg( this, 1 );
+ ( new SMESHGUI_EditMeshDlg( this, 1 ) )->show();
} else {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
}
break;
}
case 5105: // Library of selection filters
{
- static QValueList<int> aTypes;
+ static QList<int> aTypes;
if ( aTypes.isEmpty() )
{
aTypes.append( SMESH::NODE );
}
}
}
- SUIT_MessageBox::warn1(desktop(),
- tr( "SMESH_WRN_WARNING" ),
- tr( "SMESH_BAD_SELECTION" ),
- tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning(desktop(),
+ tr( "SMESH_WRN_WARNING" ),
+ tr( "SMESH_BAD_SELECTION" ) );
break;
}
else {
- SUIT_MessageBox::warn1(desktop(),
- tr( "SMESH_WRN_WARNING" ),
- tr( "NOT_A_VTK_VIEWER" ),
- tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning(desktop(),
+ tr( "SMESH_WRN_WARNING" ),
+ tr( "NOT_A_VTK_VIEWER" ) );
}
break;
case 9010:
SALOME_ListIO selected; mgr->selectedObjects( selected );
SALOME_ListIteratorOfListIO it(selected);
- for(; it.More(); it.Next()) {
+ for( ; it.More(); it.Next()) {
Handle(SALOME_InteractiveObject) anIObject = it.Value();
if(anIObject->hasEntry()) {
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){
//=======================================================================
void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QString& icon_id, const int key, const bool toggle )
{
- QIconSet icon;
+ QIcon icon;
QWidget* parent = application()->desktop();
SUIT_ResourceMgr* resMgr = resourceMgr();
QPixmap pix;
- if ( icon_id.length() )
- pix = resMgr->loadPixmap( "SMESH", tr( icon_id ) );
+ if ( !icon_id.isEmpty() )
+ pix = resMgr->loadPixmap( "SMESH", tr( icon_id.toLatin1().data() ) );
else
- pix = resMgr->loadPixmap( "SMESH", tr( QString( "ICO_" )+po_id ), false );
+ pix = resMgr->loadPixmap( "SMESH", tr( QString( "ICO_%1" ).arg( po_id ).toLatin1().data() ), false );
if ( !pix.isNull() )
- icon = QIconSet( pix );
+ icon = QIcon( pix );
- QString tooltip = tr( QString( "TOP_" )+po_id ),
- menu = tr( QString( "MEN_" )+po_id ),
- status_bar = tr( QString( "STB_" )+po_id );
+ QString tooltip = tr( QString( "TOP_%1" ).arg( po_id ).toLatin1().data() ),
+ menu = tr( QString( "MEN_%1" ).arg( po_id ).toLatin1().data() ),
+ status_bar = tr( QString( "STB_%1" ).arg( po_id ).toLatin1().data() );
createAction( id, tooltip, icon, menu, status_bar, key, parent, toggle, this, SLOT( OnGUIEvent() ) );
}
if( !popupMgr()->contains( popupMgr()->actionId( action( id ) ) ) )
popupMgr()->insert( action( id ), parentId, 0 );
- QChar lc = QtxPopupMgr::Selection::defEquality();
+ QString lc = "$"; // VSR : instead of QtxPopupSelection::defEquality();
+ QString dc = "selcount"; // VSR : insetad of QtxPopupSelection::defSelCountParam()
QString rule = "(%1) and (%2) and (%3)";
- rule = rule.arg( QString( "%1>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() ) );
+ rule = rule.arg( QString( "%1>0" ).arg( dc ) );
if( clients.isEmpty() )
rule = rule.arg( QString( "true" ) );
else
if( cont )
rule = QString( "%1 or (%2)" ).arg( myRules[ id ] ).arg( rule );
- popupMgr()->setRule( action( id ), rule, true );
+ popupMgr()->setRule( action( id ), rule, QtxPopupMgr::VisibleRule );
myRules[ id ] = QString( cont ? "%1" : "(%1)" ).arg( rule );
}
// ----- create actions --------------
- createSMESHAction( 111, "DAT", "", (CTRL+Key_B) );
- createSMESHAction( 112, "UNV", "", (CTRL+Key_U) );
- createSMESHAction( 113, "MED", "", (CTRL+Key_M) );
+ createSMESHAction( 111, "DAT", "", (Qt::CTRL+Qt::Key_B) );
+ createSMESHAction( 112, "UNV", "", (Qt::CTRL+Qt::Key_U) );
+ createSMESHAction( 113, "MED", "", (Qt::CTRL+Qt::Key_M) );
createSMESHAction( 114, "NUM" );
createSMESHAction( 121, "DAT" );
createSMESHAction( 122, "MED" );
createSMESHAction( 125, "EXPORT_MED" );
createSMESHAction( 126, "EXPORT_UNV" );
createSMESHAction( 141, "EXPORT_STL" );
- createSMESHAction( 33, "DELETE", "ICON_DELETE", Key_Delete );
+ createSMESHAction( 33, "DELETE", "ICON_DELETE", Qt::Key_Delete );
createSMESHAction( 5105, "SEL_FILTER_LIB" );
createSMESHAction( 701, "COMPUTE", "ICON_COMPUTE" );
createSMESHAction( 702, "CREATE_MESH", "ICON_DLG_INIT_MESH" );
createSMESHAction( 900, "ADV_INFO", "ICON_ADV_INFO" );
createSMESHAction( 902, "STD_INFO", "ICON_STD_INFO" );
createSMESHAction( 903, "WHAT_IS", "ICON_WHAT_IS" );
- createSMESHAction( 6001, "LENGTH", "ICON_LENGTH" , 0, true );
- createSMESHAction( 6002, "FREE_EDGE", "ICON_FREE_EDGE" , 0, true );
- createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D" , 0, true );
- createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION" , 0, true );
- createSMESHAction( 6011, "AREA", "ICON_AREA" , 0, true );
- createSMESHAction( 6012, "TAPER", "ICON_TAPER" , 0, true );
- createSMESHAction( 6013, "ASPECT", "ICON_ASPECT" , 0, true );
- createSMESHAction( 6014, "MIN_ANG", "ICON_ANGLE" , 0, true );
- createSMESHAction( 6015, "WARP", "ICON_WARP" , 0, true );
+ createSMESHAction( 6001, "LENGTH", "ICON_LENGTH", 0, true );
+ createSMESHAction( 6002, "FREE_EDGE", "ICON_FREE_EDGE", 0, true );
+ createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D", 0, true );
+ createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION", 0, true );
+ createSMESHAction( 6011, "AREA", "ICON_AREA", 0, true );
+ createSMESHAction( 6012, "TAPER", "ICON_TAPER", 0, true );
+ createSMESHAction( 6013, "ASPECT", "ICON_ASPECT", 0, true );
+ createSMESHAction( 6014, "MIN_ANG", "ICON_ANGLE", 0, true );
+ createSMESHAction( 6015, "WARP", "ICON_WARP", 0, true );
createSMESHAction( 6016, "SKEW", "ICON_SKEW", 0, true );
createSMESHAction( 6017, "ASPECT_3D", "ICON_ASPECT_3D", 0, true );
createSMESHAction( 6018, "LENGTH_2D", "ICON_LENGTH_2D", 0, true );
createSMESHAction( 219, "VOLUMES", "ICON_DLG_TETRAS", 0, true );
createSMESHAction( 220, "ALL" );
createSMESHAction( 1100, "EDIT_HYPO" );
- createSMESHAction( 1101, "RENAME", "", Key_F2 );
+ createSMESHAction( 1101, "RENAME", "", Qt::Key_F2 );
createSMESHAction( 1102, "UNASSIGN" );
createSMESHAction( 9010, "NUM_NODES", "", 0, true );
createSMESHAction( 9011, "NUM_ELEMENTS", "", 0, true );
createTool( 214, dispModeTb );
+ QString lc = "$"; // VSR : instead of QtxPopupSelection::defEquality();
+ QString dc = "selcount"; // VSR : insetad of QtxPopupSelection::defSelCountParam()
myRules.clear();
QString OB = "'ObjectBrowser'",
createPopupItem( 1101, OB, mesh_group + " " + hyp_alg, "" /*"&& $hasReference={false}"*/ ); // RENAME
popupMgr()->insert( separator(), -1, 0 );
- QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() );
+ QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
createPopupItem( 125, OB, mesh, only_one_non_empty ); // EXPORT_MED
createPopupItem( 126, OB, mesh, only_one_non_empty ); // EXPORT_UNV
createPopupItem( 141, OB, mesh, only_one_non_empty ); // EXPORT_STL
hasFaces("({'Face'} in elemTypes)"),
hasVolumes("({'Volume'} in elemTypes)");
- QString lc = QtxPopupMgr::Selection::defEquality();
QString aClient = QString( "%1client in {%2}" ).arg( lc ).arg( "'VTKViewer'" );
- QString aType = QString( "%1type in {%2}" ).arg( QtxPopupMgr::Selection::defEquality() );
+ QString aType = QString( "%1type in {%2}" ).arg( lc );
aType = aType.arg( mesh_group );
QString aMeshInVTK = aClient + "&&" + aType;
aClient = "($client in {'VTKViewer' 'ObjectBrowser'})";
QString anActiveVTK = QString("activeView = '%1'").arg(SVTK_Viewer::Type());
- QString aSelCount = QString( "%1 > 0" ).arg( QtxPopupMgr::Selection::defSelCountParam() );
+ QString aSelCount = QString( "%1 > 0" ).arg( dc );
//-------------------------------------------------
// Numbering
anId = popupMgr()->insert( tr( "MEN_NUM" ), -1, -1 );
popupMgr()->insert( action( 9010 ), anId, -1 );
- popupMgr()->setRule( action( 9010 ), aMeshInVTK + "&& isVisible &&" + hasNodes, true );
- popupMgr()->setRule( action( 9010 ), "{'Point'} in labeledTypes", false );
+ popupMgr()->setRule( action( 9010 ), aMeshInVTK + "&& isVisible &&" + hasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 9010 ), "{'Point'} in labeledTypes", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 9011 ), anId, -1 );
- popupMgr()->setRule( action( 9011 ), aMeshInVTK + "&& isVisible &&" + hasElems, true );
- popupMgr()->setRule( action( 9011 ), "{'Cell'} in labeledTypes", false );
+ popupMgr()->setRule( action( 9011 ), aMeshInVTK + "&& isVisible &&" + hasElems, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 9011 ), "{'Cell'} in labeledTypes", QtxPopupMgr::ToggleRule );
popupMgr()->insert( separator(), -1, -1 );
anId = popupMgr()->insert( tr( "MEN_DISPMODE" ), -1, -1 );
popupMgr()->insert( action( 211 ), anId, -1 ); // WIRE
- popupMgr()->setRule( action( 211 ), aMeshInVTK + "&&" + hasElems, true );
- popupMgr()->setRule( action( 211 ), "displayMode = 'eEdge'", false );
+ popupMgr()->setRule( action( 211 ), aMeshInVTK + "&&" + hasElems, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 211 ), "displayMode = 'eEdge'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 212 ), anId, -1 ); // SHADE
- popupMgr()->setRule( action( 212 ),aMeshInVTK+ "&& (" + hasFaces + "||" + hasVolumes + ")",true);
- popupMgr()->setRule( action( 212 ), "displayMode = 'eSurface'", false );
+ popupMgr()->setRule( action( 212 ),aMeshInVTK+ "&& (" + hasFaces + "||" + hasVolumes + ")", QtxPopupMgr::VisibleRule);
+ popupMgr()->setRule( action( 212 ), "displayMode = 'eSurface'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 215 ), anId, -1 ); // POINTS
- popupMgr()->setRule( action( 215 ), aMeshInVTK + "&&" + hasNodes, true );
- popupMgr()->setRule( action( 215 ), "displayMode = 'ePoint'", false );
+ popupMgr()->setRule( action( 215 ), aMeshInVTK + "&&" + hasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 215 ), "displayMode = 'ePoint'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 213 ), anId, -1 ); // SHRINK
- popupMgr()->setRule( action( 213 ), aMeshInVTK + "&& shrinkMode <> 'IsNotShrinkable' && displayMode <> 'ePoint'",true);
- popupMgr()->setRule( action( 213 ), "shrinkMode = 'IsShrunk'", false );
+ popupMgr()->setRule( action( 213 ), aMeshInVTK + "&& shrinkMode <> 'IsNotShrinkable' && displayMode <> 'ePoint'", QtxPopupMgr::VisibleRule);
+ popupMgr()->setRule( action( 213 ), "shrinkMode = 'IsShrunk'", QtxPopupMgr::ToggleRule );
//-------------------------------------------------
// Display Entity
anId = popupMgr()->insert( tr( "MEN_DISP_ENT" ), -1, -1 );
popupMgr()->insert( action( 217 ), anId, -1 ); // EDGES
- popupMgr()->setRule( action( 217 ), aDiffElemsInVTK + "&& isVisible &&" + hasEdges, true );
- popupMgr()->setRule( action( 217 ), "{'Edge'} in entityMode", false );
+ popupMgr()->setRule( action( 217 ), aDiffElemsInVTK + "&& isVisible &&" + hasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 217 ), "{'Edge'} in entityMode", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 218 ), anId, -1 ); // FACES
- popupMgr()->setRule( action( 218 ), aDiffElemsInVTK + "&& isVisible &&" + hasFaces, true );
- popupMgr()->setRule( action( 218 ), "{'Face'} in entityMode", false );
+ popupMgr()->setRule( action( 218 ), aDiffElemsInVTK + "&& isVisible &&" + hasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 218 ), "{'Face'} in entityMode", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 219 ), anId, -1 ); // VOLUMES
- popupMgr()->setRule( action( 219 ), aDiffElemsInVTK + "&& isVisible &&" + hasVolumes, true );
- popupMgr()->setRule( action( 219 ), "{'Volume'} in entityMode", false );
+ popupMgr()->setRule( action( 219 ), aDiffElemsInVTK + "&& isVisible &&" + hasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 219 ), "{'Volume'} in entityMode", QtxPopupMgr::ToggleRule );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 220 ), anId, -1 ); // ALL
- popupMgr()->setRule( action( 220 ), aDiffElemsInVTK + "&& isVisible && not( elemTypes in entityMode )", true );
+ popupMgr()->setRule( action( 220 ), aDiffElemsInVTK + "&& isVisible && not( elemTypes in entityMode )", QtxPopupMgr::VisibleRule );
//-------------------------------------------------
// Color / Size
//-------------------------------------------------
popupMgr()->insert( action( 1132 ), -1, -1 );
- popupMgr()->setRule( action( 1132 ), aMeshInVTK + "&& isVisible", true );
+ popupMgr()->setRule( action( 1132 ), aMeshInVTK + "&& isVisible", QtxPopupMgr::VisibleRule );
//-------------------------------------------------
// Transparency
//-------------------------------------------------
popupMgr()->insert( action( 1133 ), -1, -1 );
- popupMgr()->setRule( action( 1133 ), aMeshInVTK + "&& isVisible", true );
+ popupMgr()->setRule( action( 1133 ), aMeshInVTK + "&& isVisible", QtxPopupMgr::VisibleRule );
//-------------------------------------------------
// Clipping
//-------------------------------------------------
popupMgr()->insert( action( 1134 ), -1, -1 );
- popupMgr()->setRule( action( 1134 ), aMeshInVTK + "&& isVisible", true );
+ popupMgr()->setRule( action( 1134 ), aMeshInVTK + "&& isVisible", QtxPopupMgr::VisibleRule );
popupMgr()->insert( separator(), -1, -1 );
anId = popupMgr()->insert( tr( "MEN_CTRL" ), -1, -1 );
popupMgr()->insert( action( 200 ), anId, -1 ); // RESET
- popupMgr()->setRule( action( 200 ), aMeshInVTK + "&& controlMode <> 'eNone'", true );
+ popupMgr()->setRule( action( 200 ), aMeshInVTK + "&& controlMode <> 'eNone'", QtxPopupMgr::VisibleRule );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 6003 ), anId, -1 ); // FREE_BORDER
- popupMgr()->setRule( action( 6003 ), aMeshInVtkHasEdges, true );
- popupMgr()->setRule( action( 6003 ), "controlMode = 'eFreeBorders'", false );
+ popupMgr()->setRule( action( 6003 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6003 ), "controlMode = 'eFreeBorders'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6001 ), anId, -1 ); // LENGTH
- popupMgr()->setRule( action( 6001 ), aMeshInVtkHasEdges, true );
- popupMgr()->setRule( action( 6001 ), "controlMode = 'eLength'", false );
+ popupMgr()->setRule( action( 6001 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6001 ), "controlMode = 'eLength'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6004 ), anId, -1 ); // CONNECTION
- popupMgr()->setRule( action( 6004 ), aMeshInVtkHasEdges, true );
- popupMgr()->setRule( action( 6004 ), "controlMode = 'eMultiConnection'", false );
+ popupMgr()->setRule( action( 6004 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6004 ), "controlMode = 'eMultiConnection'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 6002 ), anId, -1 ); // FREE_EDGE
- popupMgr()->setRule( action( 6002 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeEdges'", false );
+ popupMgr()->setRule( action( 6002 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeEdges'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6018 ), anId, -1 ); // LENGTH_2D
- popupMgr()->setRule( action( 6018 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6018 ), "controlMode = 'eLength2D'", false );
+ popupMgr()->setRule( action( 6018 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6018 ), "controlMode = 'eLength2D'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6019 ), anId, -1 ); // CONNECTION_2D
- popupMgr()->setRule( action( 6019 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6019 ), "controlMode = 'eMultiConnection2D'", false );
+ popupMgr()->setRule( action( 6019 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6019 ), "controlMode = 'eMultiConnection2D'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6011 ), anId, -1 ); // AREA
- popupMgr()->setRule( action( 6011 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6011 ), "controlMode = 'eArea'", false );
+ popupMgr()->setRule( action( 6011 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6011 ), "controlMode = 'eArea'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6012 ), anId, -1 ); // TAPER
- popupMgr()->setRule( action( 6012 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6012 ), "controlMode = 'eTaper'", false );
+ popupMgr()->setRule( action( 6012 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6012 ), "controlMode = 'eTaper'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6013 ), anId, -1 ); // ASPECT
- popupMgr()->setRule( action( 6013 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6013 ), "controlMode = 'eAspectRatio'", false );
+ popupMgr()->setRule( action( 6013 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6013 ), "controlMode = 'eAspectRatio'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6014 ), anId, -1 ); // MIN_ANG
- popupMgr()->setRule( action( 6014 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6014 ), "controlMode = 'eMinimumAngle'", false );
+ popupMgr()->setRule( action( 6014 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6014 ), "controlMode = 'eMinimumAngle'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6015 ), anId, -1 ); // WARP
- popupMgr()->setRule( action( 6015 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6015 ), "controlMode = 'eWarping'", false );
+ popupMgr()->setRule( action( 6015 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6015 ), "controlMode = 'eWarping'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( action( 6016 ), anId, -1 ); // SKEW
- popupMgr()->setRule( action( 6016 ), aMeshInVtkHasFaces, true );
- popupMgr()->setRule( action( 6016 ), "controlMode = 'eSkew'", false );
+ popupMgr()->setRule( action( 6016 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6016 ), "controlMode = 'eSkew'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 6017 ), anId, -1 ); // ASPECT_3D
- popupMgr()->setRule( action( 6017 ), aMeshInVtkHasVolumes, true );
- popupMgr()->setRule( action( 6017 ), "controlMode = 'eAspectRatio3D'", false );
+ popupMgr()->setRule( action( 6017 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6017 ), "controlMode = 'eAspectRatio3D'", QtxPopupMgr::ToggleRule );
popupMgr()->insert ( action( 6009 ), anId, -1 ); // VOLUME_3D
- popupMgr()->setRule( action( 6009 ), aMeshInVtkHasVolumes, true );
- popupMgr()->setRule( action( 6009 ), "controlMode = 'eVolume3D'", false );
+ popupMgr()->setRule( action( 6009 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6009 ), "controlMode = 'eVolume3D'", QtxPopupMgr::ToggleRule );
popupMgr()->insert( separator(), anId, -1 );
popupMgr()->insert( action( 201 ), anId, -1 ); // SCALAR_BAR_PROP
- popupMgr()->setRule( action( 201 ), aMeshInVTK + "&& controlMode <> 'eNone'", true );
+ popupMgr()->setRule( action( 201 ), aMeshInVTK + "&& controlMode <> 'eNone'", QtxPopupMgr::VisibleRule );
popupMgr()->insert( separator(), -1, -1 );
QString aRule = "$component={'SMESH'} and ( type='Component' or (" + aClient + " and " +
aType + " and " + aSelCount + " and " + anActiveVTK + " and " + isNotEmpty + " %1 ) )";
popupMgr()->insert( action( 301 ), -1, -1 ); // DISPLAY
- popupMgr()->setRule( action( 301 ), aRule.arg( "and (not isVisible)" ), true);
+ popupMgr()->setRule( action( 301 ), aRule.arg( "and (not isVisible)" ), QtxPopupMgr::VisibleRule );
popupMgr()->insert( action( 300 ), -1, -1 ); // ERASE
- popupMgr()->setRule( action( 300 ), aRule.arg( "and isVisible" ), true );
+ popupMgr()->setRule( action( 300 ), aRule.arg( "and isVisible" ), QtxPopupMgr::VisibleRule );
popupMgr()->insert( action( 302 ), -1, -1 ); // DISPLAY_ONLY
- popupMgr()->setRule( action( 302 ), aRule.arg( "" ), true );
+ popupMgr()->setRule( action( 302 ), aRule.arg( "" ), QtxPopupMgr::VisibleRule );
popupMgr()->insert( separator(), -1, -1 );
setToolShown( true );
// Reset actions accelerator keys
- action(111)->setAccel(QKeySequence(CTRL + Key_B)); // Import DAT
- action(112)->setAccel(QKeySequence(CTRL + Key_U)); // Import UNV
- action(113)->setAccel(QKeySequence(CTRL + Key_M)); // Import MED
+ action(111)->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B)); // Import DAT
+ action(112)->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_U)); // Import UNV
+ action(113)->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M)); // Import MED
return res;
}
EmitSignalCloseAllDialogs();
// Unset actions accelerator keys
- action(111)->setAccel(QKeySequence()); // Import DAT
- action(112)->setAccel(QKeySequence()); // Import UNV
- action(113)->setAccel(QKeySequence()); // Import MED
+ action(111)->setShortcut(QKeySequence()); // Import DAT
+ action(112)->setShortcut(QKeySequence()); // Import UNV
+ action(113)->setShortcut(QKeySequence()); // Import MED
return SalomeApp_Module::deactivateModule( study );
}
return QString( anIOR.in() );
}
-void SMESHGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& /*title*/ )
+LightApp_Selection* SMESHGUI::createSelection( const QString& client, LightApp_SelectionMgr* mgr ) const
{
- SMESHGUI_Selection sel;
- sel.init( client, selectionMgr() );
- popupMgr()->updatePopup( menu, &sel );
+ return new SMESHGUI_Selection( client, mgr );
}
void SMESHGUI::windows( QMap<int, int>& aMap ) const
{
- aMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft );
- aMap.insert( SalomeApp_Application::WT_PyConsole, Qt::DockBottom );
+ aMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+ aMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
}
void SMESHGUI::viewManagers( QStringList& list ) const
modes.append( "Shading" );
modes.append( "Nodes" );
modes.append( "Shrink" );
- QValueList<QVariant> indices;
+ QList<QVariant> indices;
indices.append( 0 );
indices.append( 1 );
indices.append( 2 );
fam.append( tr( "SMESH_FONT_ARIAL" ) );
fam.append( tr( "SMESH_FONT_COURIER" ) );
fam.append( tr( "SMESH_FONT_TIMES" ) );
- int wflag = ( QtxListResourceEdit::FontItem::All & ( ~( QtxListResourceEdit::FontItem::Size | QtxListResourceEdit::FontItem::UserSize ) ) );
+ int wflag = ( QtxFontEdit::Family | QtxFontEdit::Scripting );
setPreferenceProperty( tfont, "families", fam );
setPreferenceProperty( tfont, "system", false );
if(aWarning.size() != 0){
aWarning += "The default values are applied instead.";
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
- QObject::tr(aWarning.c_str()),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_ERR_SCALARBAR_PARAMS"),
+ QObject::tr(aWarning.c_str()));
}
}
}
return myDisplayer;
}
-SALOMEDS::Color SMESHGUI::getUniqueColor( const QValueList<SALOMEDS::Color>& theReservedColors )
+SALOMEDS::Color SMESHGUI::getUniqueColor( const QList<SALOMEDS::Color>& theReservedColors )
{
int aHue = -1;
int aTolerance = 64;
//cout << "Auto colors : ";
bool ok = true;
- QValueList<SALOMEDS::Color>::const_iterator it = theReservedColors.constBegin();
- QValueList<SALOMEDS::Color>::const_iterator itEnd = theReservedColors.constEnd();
+ QList<SALOMEDS::Color>::const_iterator it = theReservedColors.constBegin();
+ QList<SALOMEDS::Color>::const_iterator itEnd = theReservedColors.constEnd();
for( ; it != itEnd; ++it )
{
SALOMEDS::Color anAutoColor = *it;
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-#ifndef SMESHGUI_HeaderFile
-#define SMESHGUI_HeaderFile
+#ifndef SMESHGUI_H
+#define SMESHGUI_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-// SALOME Includes
+// SALOME GUI includes
#include <SalomeApp_Module.h>
#include <SALOME_InteractiveObject.hxx>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Gen)
class LightApp_Operation;
class SalomeApp_Study;
+class LightApp_Selection;
class LightApp_SelectionMgr;
class SMESHGUI_FilterLibraryDlg;
-
//=================================================================================
// class : SMESHGUI
// purpose :
static SMESHGUI* GetSMESHGUI();
static LightApp_SelectionMgr* selectionMgr();
static SUIT_ResourceMgr* resourceMgr();
- static SUIT_Desktop* desktop() ;
+ static SUIT_Desktop* desktop();
static SalomeApp_Study* activeStudy();
bool isActiveStudyLocked();
static bool automaticUpdate();
virtual LightApp_Displayer* displayer();
- virtual QString engineIOR() const;
- virtual void initialize( CAM_Application* );
- virtual void windows( QMap<int, int>& ) const;
- virtual void viewManagers( QStringList& ) const;
+ virtual QString engineIOR() const;
+ virtual void initialize( CAM_Application* );
+ virtual void windows( QMap<int, int>& ) const;
+ virtual void viewManagers( QStringList& ) const;
- QDialog* GetActiveDialogBox() ;
- void SetActiveDialogBox(QDialog* aDlg) ;
+ QDialog* GetActiveDialogBox();
+ void SetActiveDialogBox( QDialog* );
- void ResetState() ;
- void SetState(int aState) ;
- bool DefineDlgPosition(QWidget* aDlg, int& x, int& y) ;
- void switchToOperation(int id) ;
+ void ResetState();
+ void SetState( int );
+ bool DefineDlgPosition( QWidget*, int&, int& );
+ void switchToOperation( int );
- virtual bool OnGUIEvent ( int id );
- virtual bool OnMousePress ( QMouseEvent*, SUIT_ViewWindow* );
- virtual bool OnMouseMove ( QMouseEvent*, SUIT_ViewWindow* );
- virtual bool OnKeyPress ( QKeyEvent*, SUIT_ViewWindow* );
+ virtual bool OnGUIEvent( int );
+ virtual bool OnMousePress( QMouseEvent*, SUIT_ViewWindow* );
+ virtual bool OnMouseMove( QMouseEvent*, SUIT_ViewWindow* );
+ virtual bool OnKeyPress( QKeyEvent*, SUIT_ViewWindow* );
- virtual void contextMenuPopup( const QString&, QPopupMenu*, QString& );
+ virtual LightApp_Selection* createSelection( const QString&, LightApp_SelectionMgr* ) const;
- virtual void BuildPresentation ( const Handle(SALOME_InteractiveObject)&,
- SUIT_ViewWindow* = 0 );
+ virtual void BuildPresentation ( const Handle(SALOME_InteractiveObject)&,
+ SUIT_ViewWindow* = 0 );
/* Non modal dialog boxes management */
- void EmitSignalDeactivateDialog() ;
- void EmitSignalStudyFrameChanged() ;
- void EmitSignalCloseAllDialogs() ;
+ void EmitSignalDeactivateDialog();
+ void EmitSignalStudyFrameChanged();
+ void EmitSignalCloseAllDialogs();
- virtual void createPreferences();
- virtual void preferencesChanged( const QString&, const QString& );
+ virtual void createPreferences();
+ virtual void preferencesChanged( const QString&, const QString& );
- virtual void update( const int );
+ virtual void update( const int );
- static SALOMEDS::Color getUniqueColor( const QValueList<SALOMEDS::Color>& );
+ static SALOMEDS::Color getUniqueColor( const QList<SALOMEDS::Color>& );
public slots:
- virtual bool deactivateModule( SUIT_Study* );
- virtual bool activateModule( SUIT_Study* );
- virtual void studyClosed( SUIT_Study* );
+ virtual bool deactivateModule( SUIT_Study* );
+ virtual bool activateModule( SUIT_Study* );
+ virtual void studyClosed( SUIT_Study* );
private slots:
- void OnGUIEvent();
- void onViewManagerActivated( SUIT_ViewManager* );
- void onOperationCommited( SUIT_Operation* );
- void onOperationAborted( SUIT_Operation* );
+ void OnGUIEvent();
+ void onViewManagerActivated( SUIT_ViewManager* );
+ void onOperationCommited( SUIT_Operation* );
+ void onOperationAborted( SUIT_Operation* );
signals:
- void SignalDeactivateActiveDialog() ;
- void SignalStudyFrameChanged() ;
- void SignalCloseAllDialogs() ;
+ void SignalDeactivateActiveDialog();
+ void SignalStudyFrameChanged();
+ void SignalCloseAllDialogs();
protected:
- void createSMESHAction( const int, const QString&, const QString& = QString(""),
- const int = 0, const bool = false );
- void createPopupItem( const int, const QString&, const QString&,
- const QString& = QString::null, const int = -1 );
+ void createSMESHAction( const int,
+ const QString&,
+ const QString& = QString(),
+ const int = 0,
+ const bool = false );
+ void createPopupItem( const int,
+ const QString&,
+ const QString&,
+ const QString& = QString(),
+ const int = -1 );
- virtual LightApp_Operation* createOperation( const int ) const;
+ virtual LightApp_Operation* createOperation( const int ) const;
private:
- void OnEditDelete();
+ void OnEditDelete();
private :
- static SMESH::SMESH_Gen_var myComponentSMESH;
- QDialog* myActiveDialogBox;
- int myState;
- QMap<int,QString> myRules;
- LightApp_Displayer* myDisplayer;
+ static SMESH::SMESH_Gen_var myComponentSMESH;
+ QDialog* myActiveDialogBox;
+ int myState;
+ QMap<int, QString> myRules;
+ LightApp_Displayer* myDisplayer;
- SMESHGUI_FilterLibraryDlg* myFilterLibraryDlg;
+ SMESHGUI_FilterLibraryDlg* myFilterLibraryDlg;
};
-#endif
+#endif // SMESHGUI_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_AddMeshElementDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_AddMeshElementDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_AddMeshElementDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_ActorUtils.h"
-
-#include "SMDS_Mesh.hxx"
-#include "SMESH_Actor.h"
-
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-#include "LightApp_Application.h"
-
-#include "SVTK_Selection.h"
-#include "SVTK_Selector.h"
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
-
-#include "SalomeApp_Study.h"
-#include "SalomeApp_Application.h"
-
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-
-#include "utilities.h"
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+#include <SMDS_Mesh.hxx>
+
+// SALOME GUI inclues
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ViewManager.h>
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+#include <SalomeApp_Application.h>
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+
+// IDL incldues
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-// VTK Includes
+// VTK includes
#include <vtkCell.h>
#include <vtkIdList.h>
-#include <vtkIntArray.h>
-#include <vtkCellArray.h>
-#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
-// QT Includes
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
#include <qvariant.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qcheckbox.h>
-#include <qregexp.h>
+#include <QCheckBox>
+#include <QKeyEvent>
-// STL includes
-#include <list>
+#define SPACING 6
+#define MARGIN 11
-using namespace std;
-
-namespace SMESH {
-
- class TElementSimulation {
+namespace SMESH
+{
+ class TElementSimulation
+ {
SalomeApp_Application* myApplication;
SUIT_ViewWindow* myViewWindow;
SVTK_ViewWindow* myVTKViewWindow;
// purpose : constructor
//=================================================================================
SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
- const char* name,
- SMDSAbs_ElementType ElementType, int nbNodes,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+ SMDSAbs_ElementType ElementType,
+ int nbNodes )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
myIsPoly = false;
myElementType = ElementType;
switch (ElementType) {
case SMDSAbs_Face:
-// if (myNbNodes != 3 && myNbNodes != 4)
-// myNbNodes = 3;
-// break;
+ // if (myNbNodes != 3 && myNbNodes != 4)
+ // myNbNodes = 3;
+ // break;
case SMDSAbs_Volume:
-// if (myNbNodes != 4 && myNbNodes != 8) //(nbNodes < 4 || nbNodes > 8 || nbNodes == 7)
-// myNbNodes = 4;
+ // if (myNbNodes != 4 && myNbNodes != 8) //(nbNodes < 4 || nbNodes > 8 || nbNodes == 7)
+ // myNbNodes = 4;
break;
default:
myElementType = SMDSAbs_Edge;
myHelpFileName = "adding_nodes_and_elements_page.html#adding_polyhedrons_anchor";
}
- QString iconName = tr(QString("ICON_DLG_%1").arg(elemName));
- QString buttonGrTitle = tr(QString("SMESH_%1").arg(elemName));
- QString caption = tr(QString("SMESH_ADD_%1_TITLE").arg(elemName));
- QString grBoxTitle = tr(QString("SMESH_ADD_%1").arg(elemName));
+ QString iconName = tr(QString("ICON_DLG_%1").arg(elemName).toLatin1().data());
+ QString buttonGrTitle = tr(QString("SMESH_%1").arg(elemName).toLatin1().data());
+ QString caption = tr(QString("SMESH_ADD_%1_TITLE").arg(elemName).toLatin1().data());
+ QString grBoxTitle = tr(QString("SMESH_ADD_%1").arg(elemName).toLatin1().data());
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", iconName));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_AddMeshElementDlg");
- resize(303, 185);
- setCaption(caption);
+ setWindowTitle(caption);
+ setSizeGripEnabled(true);
- setSizeGripEnabled(TRUE);
- SMESHGUI_AddMeshElementDlgLayout = new QGridLayout(this);
- SMESHGUI_AddMeshElementDlgLayout->setSpacing(6);
- SMESHGUI_AddMeshElementDlgLayout->setMargin(11);
+ QVBoxLayout* aTopLayout = new QVBoxLayout(this);
+ aTopLayout->setSpacing(SPACING);
+ aTopLayout->setMargin(MARGIN);
/***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setTitle(buttonGrTitle);
-
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- Constructor1 = new QRadioButton(GroupConstructors, "Constructor1");
- Constructor1->setText(tr("" ));
- Constructor1->setPixmap(image0);
- Constructor1->setChecked(TRUE);
- Constructor1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth()));
- Constructor1->setMinimumSize(QSize(50, 0));
- GroupConstructorsLayout->addWidget(Constructor1, 0, 0);
- QSpacerItem* spacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupConstructorsLayout->addItem(spacer, 0, 1);
- SMESHGUI_AddMeshElementDlgLayout->addWidget(GroupConstructors, 0, 0);
+ GroupConstructors = new QGroupBox(buttonGrTitle, this);
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ GroupConstructorsLayout->setSpacing(SPACING);
+ GroupConstructorsLayout->setMargin(MARGIN);
- /***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
-
- SMESHGUI_AddMeshElementDlgLayout->addWidget(GroupButtons, 2, 0);
+ Constructor1 = new QRadioButton(GroupConstructors);
+ Constructor1->setIcon(image0);
+ Constructor1->setChecked(true);
+
+ GroupConstructorsLayout->addWidget(Constructor1);
+ GroupConstructorsLayout->addStretch();
/***************************************************************/
- GroupC1 = new QGroupBox(this, "GroupC1");
- GroupC1->setTitle(grBoxTitle);
-
- GroupC1->setMinimumSize(QSize(0, 0));
- GroupC1->setFrameShape(QGroupBox::Box);
- GroupC1->setFrameShadow(QGroupBox::Sunken);
- GroupC1->setColumnLayout(0, Qt::Vertical);
- GroupC1->layout()->setSpacing(0);
- GroupC1->layout()->setMargin(0);
- GroupC1Layout = new QGridLayout(GroupC1->layout());
- GroupC1Layout->setAlignment(Qt::AlignTop);
- GroupC1Layout->setSpacing(6);
- GroupC1Layout->setMargin(11);
- TextLabelC1A1 = new QLabel(GroupC1, "TextLabelC1A1");
- TextLabelC1A1->setText(tr("SMESH_ID_NODES" ));
- TextLabelC1A1->setMinimumSize(QSize(50, 0));
- TextLabelC1A1->setFrameShape(QLabel::NoFrame);
- TextLabelC1A1->setFrameShadow(QLabel::Plain);
- GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
- SelectButtonC1A1 = new QPushButton(GroupC1, "SelectButtonC1A1");
- SelectButtonC1A1->setText(tr("" ));
- SelectButtonC1A1->setPixmap(image1);
- SelectButtonC1A1->setToggleButton(FALSE);
- GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
- LineEditC1A1 = new QLineEdit(GroupC1, "LineEditC1A1");
-// LineEditC1A1->setReadOnly(TRUE);
+ GroupC1 = new QGroupBox(grBoxTitle, this);
+ QGridLayout* GroupC1Layout = new QGridLayout(GroupC1);
+ GroupC1Layout->setSpacing(SPACING);
+ GroupC1Layout->setMargin(MARGIN);
+
+ TextLabelC1A1 = new QLabel(tr("SMESH_ID_NODES"), GroupC1);
+ SelectButtonC1A1 = new QPushButton(GroupC1);
+ SelectButtonC1A1->setIcon(image1);
+ LineEditC1A1 = new QLineEdit(GroupC1);
+ // LineEditC1A1->setReadOnly(true);
if (!myIsPoly)
- LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this, "validator", myNbNodes));
- GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
+ LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this, myNbNodes));
- if (myElementType == SMDSAbs_Face) {
- Reverse = new QCheckBox(GroupC1, "Reverse");
- Reverse->setText(tr("SMESH_REVERSE" ));
- GroupC1Layout->addWidget(Reverse, 1, 0);
- }
- else
- Reverse = 0;
+ Reverse = myElementType == SMDSAbs_Face ? new QCheckBox(tr("SMESH_REVERSE"), GroupC1) : 0;
+
+ GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
+ GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
+ GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
+ if ( Reverse ) GroupC1Layout->addWidget(Reverse, 1, 0, 1, 3);
- SMESHGUI_AddMeshElementDlgLayout->addWidget(GroupC1, 1, 0);
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ aTopLayout->addWidget(GroupConstructors);
+ aTopLayout->addWidget(GroupC1);
+ aTopLayout->addWidget(GroupButtons);
Init(); /* Initialisations */
}
//=================================================================================
SMESHGUI_AddMeshElementDlg::~SMESHGUI_AddMeshElementDlg()
{
- // no need to delete child widgets, Qt does it all for us
delete mySimulation;
}
void SMESHGUI_AddMeshElementDlg::Init()
{
GroupC1->show();
- Constructor1->setChecked(TRUE);
+ Constructor1->setChecked(true);
myEditCurrentArgument = LineEditC1A1;
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
if (Reverse)
connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int)));
- this->show(); // displays Dialog
-
// set selection mode
SMESH::SetPointRepresentation(true);
SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
anArrayOfIdeces->length(myNbNodes);
bool reverse = (Reverse && Reverse->isChecked());
- QStringList aListId = QStringList::split(" ", myEditCurrentArgument->text(), false);
+ QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++)
if (reverse)
anArrayOfIdeces[i] = aListId[ myNbNodes - i - 1 ].toInt();
//=================================================================================
void SMESHGUI_AddMeshElementDlg::ClickOnOk()
{
- this->ClickOnApply();
- this->ClickOnCancel();
- return;
+ ClickOnApply();
+ ClickOnCancel();
}
//=================================================================================
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
reject();
- return;
}
//=================================================================================
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (aMesh) {
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool allOk = true;
for (int i = 0; i < aListId.count(); i++) {
if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
- {
- newIndices.Add( n->GetID() );
- myNbOkNodes++;
- }
+ {
+ newIndices.Add( n->GetID() );
+ myNbOkNodes++;
+ }
else
allOk = false;
}
buttonApply->setEnabled(false);
mySimulation->SetVisibility(false);
-// SMESH::SetPointRepresentation(true);
+ // SMESH::SetPointRepresentation(true);
// get selected mesh
SALOME_ListIO aList;
{
if (myNbOkNodes && GroupButtons->isEnabled()) {
SMESH::TElementSimulation::TVTKIds anIds;
- QStringList aListId = QStringList::split(" ", myEditCurrentArgument->text(), false);
+ QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++)
anIds.push_back(myActor->GetObject()->GetNodeVTKId(aListId[ i ].toInt()));
if (GroupConstructors->isEnabled())
return;
ActivateThisDialog();
- return;
}
//=================================================================================
void SMESHGUI_AddMeshElementDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
- return;
+ ClickOnCancel();
}
//=================================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_AddMeshElementDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-// File : SMESHGUI_AddMeshElementDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-#ifndef DIALOGBOX_ADD_FACE_H
-#define DIALOGBOX_ADD_FACE_H
+#ifndef SMESHGUI_ADDMESHELEMENTDLG_H
+#define SMESHGUI_ADDMESHELEMENTDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-
-#include "SMDSAbs_ElementType.hxx"
+#include <SMDSAbs_ElementType.hxx>
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qvariant.h>
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class QCheckBox;
class SMESHGUI;
class SMESH_Actor;
-class SMDS_Mesh;
-class SVTK_ViewWindow;
class SVTK_Selector;
+class LightApp_SelectionMgr;
-namespace SMESH{
+namespace SMESH
+{
struct TElementSimulation;
}
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
//=================================================================================
// class : SMESHGUI_AddMeshElementDlg
// purpose :
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_AddMeshElementDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_AddMeshElementDlg( SMESHGUI*,
- const char* = 0,
- SMDSAbs_ElementType ElementType = SMDSAbs_Edge,
- int nbNodes = 2, bool modal = FALSE, WFlags fl = 0 );
- ~SMESHGUI_AddMeshElementDlg();
-
+ SMESHGUI_AddMeshElementDlg( SMESHGUI*, SMDSAbs_ElementType = SMDSAbs_Edge, int = 2 );
+ ~SMESHGUI_AddMeshElementDlg();
+
private:
- void Init ();
- void closeEvent (QCloseEvent*);
- void hideEvent (QHideEvent*); /* ESC key */
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void keyPressEvent(QKeyEvent*);
- void displaySimulation();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- int myNbOkNodes; /* to check when arguments is defined */
- bool myBusy;
- SVTK_Selector* mySelector;
-
- QLineEdit* myEditCurrentArgument; /* Current LineEdit */
-
- int myElementType;
- int myNbNodes;
- bool myIsPoly;
-
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
- SMESH::TElementSimulation* mySimulation;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
- QGroupBox * GroupButtons;
- QPushButton * buttonOk;
- QPushButton * buttonCancel;
- QPushButton * buttonApply;
- QPushButton * buttonHelp;
- QGroupBox * GroupC1;
- QLabel * TextLabelC1A1;
- QPushButton * SelectButtonC1A1;
- QLineEdit * LineEditC1A1;
-
- QCheckBox * Reverse;
-
- QString myHelpFileName;
-
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void keyPressEvent( QKeyEvent* );
+ void displaySimulation();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ int myNbOkNodes; /* to check when arguments is defined */
+ bool myBusy;
+ SVTK_Selector* mySelector;
+
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+
+ int myElementType;
+ int myNbNodes;
+ bool myIsPoly;
+
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH::TElementSimulation* mySimulation;
+
+ QGroupBox* GroupConstructors;
+ QRadioButton* Constructor1;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupC1;
+ QLabel* TextLabelC1A1;
+ QPushButton* SelectButtonC1A1;
+ QLineEdit* LineEditC1A1;
+ QCheckBox* Reverse;
+
+ QString myHelpFileName;
+
private slots:
-
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void CheckBox( int );
- void onTextChange(const QString&);
-
-protected:
- QGridLayout* SMESHGUI_AddMeshElementDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupC1Layout;
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void CheckBox( int );
+ void onTextChange( const QString& );
};
-#endif // DIALOGBOX_ADD_FACE_H
+#endif // SMESHGUI_ADDMESHELEMENTDLG_H
+// SMESH SMESHGUI : GUI for SMESH component
+//
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_AddMeshElementDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
+//
+
+// SMESH includes
#include "SMESHGUI_AddQuadraticElementDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_ActorUtils.h"
-#include "SMDS_Mesh.hxx"
-#include "SMESH_Actor.h"
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+#include <SMDS_Mesh.hxx>
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_ViewManager.h>
-#include "SVTK_Selection.h"
-#include "SVTK_Selector.h"
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
+#include <LightApp_SelectionMgr.h>
-#include "SalomeApp_Study.h"
-#include "SalomeApp_Application.h"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
+#include <SALOME_ListIO.hxx>
-#include "utilities.h"
+#include <SalomeApp_Application.h>
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-// VTK Includes
-#include <vtkCell.h>
+// VTK includes
#include <vtkIdList.h>
-#include <vtkIntArray.h>
-#include <vtkCellArray.h>
-#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
-
-#include <vtkQuadraticEdge.h>
-#include <vtkQuadraticTriangle.h>
-#include <vtkQuadraticQuad.h>
-#include <vtkQuadraticHexahedron.h>
-#include <vtkQuadraticTetra.h>
-
-// QT Includes
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qcheckbox.h>
+#include <vtkCellType.h>
+
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QCheckBox>
+#include <QTableWidget>
+#include <QKeyEvent>
// STL includes
-#include <list>
-
-using namespace std;
+#include <vector>
-namespace SMESH {
+#define SPACING 6
+#define MARGIN 11
- void ReverseConnectivity( vector<int> & ids, int type )
+namespace SMESH
+{
+ void ReverseConnectivity( std::vector<int> & ids, int type )
{
// for reverse connectivity of other types keeping the first id, see
// void SMESH_VisualObjDef::buildElemPrs() in SMESH_Object.cxx:900
reverse( ids.begin(), ids.end() );
}
else {
- vector<int> aRevIds( ids.size() );
+ std::vector<int> aRevIds( ids.size() );
for ( int i = 0; i < ids.size(); i++)
aRevIds[ i ] = ids[ conn[ i ]];
ids = aRevIds;
+class SMESHGUI_IdEditItem: public QTableWidgetItem
+{
+public:
+ SMESHGUI_IdEditItem(const QString& text ):
+ QTableWidgetItem(text, QTableWidgetItem::UserType+100) {};
+ ~SMESHGUI_IdEditItem() {};
+
+ QWidget* createEditor() const;
+};
+
+QWidget* SMESHGUI_IdEditItem::createEditor() const
+{
+ QLineEdit *aLineEdit = new QLineEdit(text(), tableWidget());
+ aLineEdit->setValidator( new SMESHGUI_IdValidator(tableWidget(), 1) );
+ return aLineEdit;
+}
+
//=================================================================================
// function : SMESHGUI_AddQuadraticElementDlg()
// purpose : constructor
//=================================================================================
SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
- const int theType,
- const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myType( theType )
+ const int theType )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ myType( theType )
{
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+
SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
anElementName = QString("QUADRATIC_EDGE");
}
- QString iconName = tr(QString("ICON_DLG_%1").arg(anElementName));
- QString caption = tr(QString("SMESH_ADD_%1_TITLE").arg(anElementName));
- QString argumentsGrTitle = tr(QString("SMESH_ADD_%1").arg(anElementName));
- QString constructorGrTitle = tr(QString("SMESH_%1").arg(anElementName));
+ QString iconName = tr(QString("ICON_DLG_%1").arg(anElementName).toLatin1().data());
+ QString caption = tr(QString("SMESH_ADD_%1_TITLE").arg(anElementName).toLatin1().data());
+ QString argumentsGrTitle = tr(QString("SMESH_ADD_%1").arg(anElementName).toLatin1().data());
+ QString constructorGrTitle = tr(QString("SMESH_%1").arg(anElementName).toLatin1().data());
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", iconName));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_AddQuadraticElementDlg");
- setCaption(caption);
+ setWindowTitle(caption);
- setSizeGripEnabled(TRUE);
- QGridLayout* aDialogLayout = new QGridLayout(this);
- aDialogLayout->setSpacing(6);
- aDialogLayout->setMargin(11);
+ setSizeGripEnabled(true);
+
+ QVBoxLayout* aDialogLayout = new QVBoxLayout(this);
+ aDialogLayout->setSpacing(SPACING);
+ aDialogLayout->setMargin(MARGIN);
/***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setTitle(constructorGrTitle);
-
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructors->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
- QGridLayout* aGroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- aGroupConstructorsLayout->setAlignment(Qt::AlignTop);
- aGroupConstructorsLayout->setSpacing(6);
- aGroupConstructorsLayout->setMargin(11);
- myRadioButton1 = new QRadioButton(GroupConstructors, "myRadioButton1");
- myRadioButton1->setText(tr("" ));
- myRadioButton1->setPixmap(image0);
- myRadioButton1->setChecked(TRUE);
- myRadioButton1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, myRadioButton1->sizePolicy().hasHeightForWidth()));
- aGroupConstructorsLayout->addWidget(myRadioButton1, 0, 0);
- aGroupConstructorsLayout->addItem( new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
- aDialogLayout->addWidget(GroupConstructors, 0, 0);
+ GroupConstructors = new QGroupBox(constructorGrTitle, this);
+ QHBoxLayout* aGroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ aGroupConstructorsLayout->setSpacing(SPACING);
+ aGroupConstructorsLayout->setMargin(MARGIN);
+
+ myRadioButton1 = new QRadioButton(GroupConstructors);
+ myRadioButton1->setIcon(image0);
+ aGroupConstructorsLayout->addWidget(myRadioButton1);
+ aGroupConstructorsLayout->addStretch();
/***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setTitle(argumentsGrTitle);
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- GroupArguments->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding));
- QGridLayout* aGroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- aGroupArgumentsLayout->setAlignment(Qt::AlignTop);
- aGroupArgumentsLayout->setSpacing(6);
- aGroupArgumentsLayout->setMargin(11);
- QLabel* aCornerNodesLabel = new QLabel(GroupArguments, "aCornerNodesLabel");
- aCornerNodesLabel->setText(tr("SMESH_CORNER_NODES" ));
- aGroupArgumentsLayout->addWidget(aCornerNodesLabel, 0, 0);
- mySelectButton = new QPushButton(GroupArguments, "mySelectButton");
- mySelectButton->setPixmap(image1);
- aGroupArgumentsLayout->addWidget(mySelectButton, 0, 1);
- myCornerNodes = new QLineEdit(GroupArguments, "myCornerNodes");
- aGroupArgumentsLayout->addWidget(myCornerNodes, 0, 2);
-
- myTable = new QTable(GroupArguments);
- aGroupArgumentsLayout->addMultiCellWidget(myTable, 1, 1, 0, 2);
-
- myReverseCB = new QCheckBox(GroupArguments, "myReverseCB");
- myReverseCB->setText(tr("SMESH_REVERSE" ));
- aGroupArgumentsLayout->addWidget(myReverseCB, 2, 0);
-
- aDialogLayout->addWidget(GroupArguments, 1, 0);
+ GroupArguments = new QGroupBox(argumentsGrTitle, this);
+ QGridLayout* aGroupArgumentsLayout = new QGridLayout(GroupArguments);
+ aGroupArgumentsLayout->setSpacing(SPACING);
+ aGroupArgumentsLayout->setMargin(MARGIN);
+
+ QLabel* aCornerNodesLabel = new QLabel(tr("SMESH_CORNER_NODES"), GroupArguments);
+ mySelectButton = new QPushButton(GroupArguments);
+ mySelectButton->setIcon(image1);
+ myCornerNodes = new QLineEdit(GroupArguments);
+ myTable = new QTableWidget(GroupArguments);
+
+ myReverseCB = new QCheckBox(tr("SMESH_REVERSE"), GroupArguments);
+
+ aGroupArgumentsLayout->addWidget(aCornerNodesLabel, 0, 0);
+ aGroupArgumentsLayout->addWidget(mySelectButton, 0, 1);
+ aGroupArgumentsLayout->addWidget(myCornerNodes, 0, 2);
+ aGroupArgumentsLayout->addWidget(myTable, 1, 0, 1, 3);
+ aGroupArgumentsLayout->addWidget(myReverseCB, 2, 0, 1, 3);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtons->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- QGridLayout* aGroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- aGroupButtonsLayout->setAlignment(Qt::AlignTop);
- aGroupButtonsLayout->setSpacing(6);
- aGroupButtonsLayout->setMargin(11);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- aGroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- aGroupButtonsLayout->addWidget(buttonApply, 0, 1);
- aGroupButtonsLayout->addItem( new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- aGroupButtonsLayout->addWidget(buttonOk, 0, 0);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- aGroupButtonsLayout->addWidget(buttonHelp, 0, 4);
-
- aDialogLayout->addWidget(GroupButtons, 2, 0);
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* aGroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ aGroupButtonsLayout->setSpacing(SPACING);
+ aGroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ aGroupButtonsLayout->addWidget(buttonOk);
+ aGroupButtonsLayout->addSpacing(10);
+ aGroupButtonsLayout->addWidget(buttonApply);
+ aGroupButtonsLayout->addSpacing(10);
+ aGroupButtonsLayout->addStretch();
+ aGroupButtonsLayout->addWidget(buttonCancel);
+ aGroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ aDialogLayout->addWidget(GroupConstructors);
+ aDialogLayout->addWidget(GroupArguments);
+ aDialogLayout->addWidget(GroupButtons);
Init(); /* Initialisations */
}
//=================================================================================
SMESHGUI_AddQuadraticElementDlg::~SMESHGUI_AddQuadraticElementDlg()
{
- // no need to delete child widgets, Qt does it all for us
delete mySimulation;
}
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::Init()
{
- GroupArguments->show();
- myRadioButton1->setChecked(TRUE);
+ myRadioButton1->setChecked(true);
myIsEditCorners = true;
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
break;
}
- myCornerNodes->setValidator(new SMESHGUI_IdValidator(this, "validator", myNbCorners));
+ myCornerNodes->setValidator(new SMESHGUI_IdValidator(this, myNbCorners));
/* initialize table */
- myTable->setNumCols(3);
- myTable->setNumRows(aNumRows);
+ myTable->setColumnCount(3);
+ myTable->setRowCount(aNumRows);
QStringList aColLabels;
aColLabels.append(tr("SMESH_FIRST"));
aColLabels.append(tr("SMESH_MIDDLE"));
aColLabels.append(tr("SMESH_LAST"));
- myTable->setColumnLabels(aColLabels);
+ myTable->setHorizontalHeaderLabels(aColLabels);
- for ( int col = 0; col < myTable->numCols(); col++ )
+ for ( int col = 0; col < myTable->columnCount(); col++ )
myTable->setColumnWidth(col, 80);
- myTable->setColumnReadOnly(0, true);
- myTable->setColumnReadOnly(2, true);
+ //myTable->setColumnReadOnly(0, true); // VSR: TODO
+ //myTable->setColumnReadOnly(2, true); // VSR: TODO
myTable->setEnabled( false );
- for ( int row = 0; row < myTable->numRows(); row++ )
- {
- SMESHGUI_IdEditItem* anEditItem = new SMESHGUI_IdEditItem( myTable, QTableItem::OnTyping, "" );
- anEditItem->setReplaceable(false);
- myTable->setItem(row, 1, anEditItem);
- }
+ for ( int row = 0; row < myTable->rowCount(); row++ )
+ {
+ SMESHGUI_IdEditItem* anEditItem = new SMESHGUI_IdEditItem( "" );
+ anEditItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled);
+ myTable->setItem(row, 1, anEditItem);
+ }
/* signals and slots connections */
connect(mySelectButton, SIGNAL(clicked()), SLOT(SetEditCorners()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
- connect(myTable, SIGNAL(doubleClicked(int, int, int, const QPoint&)), SLOT(onCellDoubleClicked(int, int, int, const QPoint&)));
- connect(myTable, SIGNAL(valueChanged (int, int)), SLOT(onCellTextChange(int, int)));
+ connect(myTable, SIGNAL(cellDoubleClicked(int, int)), SLOT(onCellDoubleClicked(int, int)));
+ connect(myTable, SIGNAL(cellChanged (int, int)), SLOT(onCellTextChange(int, int)));
connect(myCornerNodes, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(myReverseCB, SIGNAL(stateChanged(int)), SLOT(onReverse(int)));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
- this->show(); // displays Dialog
-
// set selection mode
SMESH::SetPointRepresentation(true);
if (IsValid() && !mySMESHGUI->isActiveStudyLocked()) {
myBusy = true;
- vector<int> anIds;
+ std::vector<int> anIds;
switch (myType) {
case QUAD_EDGE:
- anIds.push_back(myTable->text(0, 0).toInt());
- anIds.push_back(myTable->text(0, 2).toInt());
- anIds.push_back(myTable->text(0, 1).toInt());
+ anIds.push_back(myTable->item(0, 0)->text().toInt());
+ anIds.push_back(myTable->item(0, 2)->text().toInt());
+ anIds.push_back(myTable->item(0, 1)->text().toInt());
break;
case QUAD_TRIANGLE:
case QUAD_QUADRANGLE:
case QUAD_PENTAHEDRON:
case QUAD_HEXAHEDRON:
for ( int row = 0; row < myNbCorners; row++ )
- anIds.push_back(myTable->text(row, 0).toInt());
- for ( int row = 0; row < myTable->numRows(); row++ )
- anIds.push_back(myTable->text(row, 1).toInt());
+ anIds.push_back(myTable->item(row, 0)->text().toInt());
+ for ( int row = 0; row < myTable->rowCount(); row++ )
+ anIds.push_back(myTable->item(row, 1)->text().toInt());
break;
}
if ( myReverseCB->isChecked())
{
ClickOnApply();
ClickOnCancel();
- return;
}
//=================================================================================
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
reject();
- return;
}
//=================================================================================
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (aMesh) {
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool allOk = true;
for (int i = 0; i < aListId.count(); i++) {
if( const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() ) )
myBusy = true;
int theRow = myTable->currentRow(), theCol = myTable->currentColumn();
if ( theCol == 1 )
- myTable->setText(theRow, 1, aString);
+ myTable->item(theRow, 1)->setText(aString);
myBusy = false;
}
if ( myType == QUAD_EDGE )
{
- anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->text(0, 0).toInt() ) );
- anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->text(0, 2).toInt() ) );
- anID = (myTable->text(0, 1)).toInt(&ok);
- if (!ok) anID = (myTable->text(0, 0)).toInt();
+ anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(0, 0)->text().toInt() ) );
+ anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(0, 2)->text().toInt() ) );
+ anID = myTable->item(0, 1)->text().toInt(&ok);
+ if (!ok) anID = myTable->item(0, 0)->text().toInt();
anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
aDisplayMode = VTK_WIREFRAME;
}
else
{
for ( int row = 0; row < myNbCorners; row++ )
- anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->text(row, 0).toInt() ) );
+ anIds.push_back( myActor->GetObject()->GetNodeVTKId( myTable->item(row, 0)->text().toInt() ) );
- for ( int row = 0; row < myTable->numRows(); row++ )
+ for ( int row = 0; row < myTable->rowCount(); row++ )
{
- anID = (myTable->text(row, 1)).toInt(&ok);
+ anID = myTable->item(row, 1)->text().toInt(&ok);
if (!ok) {
- anID = (myTable->text(row, 0)).toInt();
+ anID = myTable->item(row, 0)->text().toInt();
aDisplayMode = VTK_WIREFRAME;
}
anIds.push_back( myActor->GetObject()->GetNodeVTKId(anID) );
if (GroupConstructors->isEnabled())
return;
ActivateThisDialog();
- return;
}
//=================================================================================
{
/* same than click on cancel button */
ClickOnCancel();
- return;
}
//=================================================================================
bool ok;
- for ( int row = 0; row < myTable->numRows(); row++ )
+ for ( int row = 0; row < myTable->rowCount(); row++ )
{
- int anID = (myTable->text(row, 1)).toInt(&ok);
+ int anID = myTable->item(row, 1)->text().toInt(&ok);
if ( !ok )
return false;
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
{
- QStringList aListCorners = QStringList::split(" ", myCornerNodes->text(), false);
+ QStringList aListCorners = myCornerNodes->text().split(" ", QString::SkipEmptyParts);
if ( aListCorners.count() == myNbCorners && theConersValidity )
{
myTable->setEnabled( true );
// clear the Middle column
- for ( int row = 0; row < myTable->numRows(); row++ )
- myTable->setText( row, 1, "");
+ for ( int row = 0; row < myTable->rowCount(); row++ )
+ myTable->item( row, 1 )->setText("");
int* aFirstColIds;
int* aLastColIds;
}
// fill the First and the Last columns
- for (int i = 0, iEnd = myTable->numRows(); i < iEnd; i++)
- myTable->setText( i, 0, aListCorners[ aFirstColIds[i] ] );
+ for (int i = 0, iEnd = myTable->rowCount(); i < iEnd; i++)
+ myTable->item( i, 0 )->setText( aListCorners[ aFirstColIds[i] ] );
- for (int i = 0, iEnd = myTable->numRows(); i < iEnd; i++)
- myTable->setText( i, 2, aListCorners[ aLastColIds[i] ] );
+ for (int i = 0, iEnd = myTable->rowCount(); i < iEnd; i++)
+ myTable->item( i, 2 )->setText( aListCorners[ aLastColIds[i] ] );
}
else
{
// clear table
- for ( int row = 0; row < myTable->numRows(); row++ )
- for ( int col = 0; col < myTable->numCols(); col++ )
- myTable->setText(row, col, "");
+ for ( int row = 0; row < myTable->rowCount(); row++ )
+ for ( int col = 0; col < myTable->columnCount(); col++ )
+ myTable->item(row, col)->setText("");
myTable->setEnabled( false );
}
// function : onTableActivate()
// purpose :
//=================================================================================
-void SMESHGUI_AddQuadraticElementDlg::onCellDoubleClicked( int theRow, int theCol, int theButton, const QPoint& theMousePos )
+void SMESHGUI_AddQuadraticElementDlg::onCellDoubleClicked( int theRow, int theCol )
{
- if ( theButton == 1 && theCol == 1 )
+ if ( theCol == 1 )
myIsEditCorners = false;
displaySimulation();
- return;
}
//=================================================================================
void SMESHGUI_AddQuadraticElementDlg::onCellTextChange(int theRow, int theCol)
{
- onTextChange( myTable->text(theRow, theCol) );
-}
-
-
-QWidget* SMESHGUI_IdEditItem::createEditor() const
-{
- QLineEdit *aLineEdit = new QLineEdit(text(), table()->viewport());
- aLineEdit->setValidator( new SMESHGUI_IdValidator(table()->viewport(), "validator", 1) );
- return aLineEdit;
+ onTextChange( myTable->item(theRow, theCol)->text() );
}
//=================================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
+// SMESH SMESHGUI : GUI for SMESH component
+//
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
-#define DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
+// File : SMESHGUI_AddMeshElementDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
+//
+
+#ifndef SMESHGUI_ADDQUADRATICELEMENTDLG_H
+#define SMESHGUI_ADDQUADRATICELEMENTDLG_H
-#include "LightApp_SelectionMgr.h"
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
-// QT Includes
-#include <qdialog.h>
-#include <qtable.h>
+// Qt includes
+#include <QDialog>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QButtonGroup;
class QGroupBox;
class QLineEdit;
class QPushButton;
class QRadioButton;
class QCheckBox;
-class QTable;
+class QTableWidget;
class SMESHGUI;
class SMESH_Actor;
class SVTK_Selector;
+class LightApp_SelectionMgr;
-namespace SMESH{
+namespace SMESH
+{
struct TElementSimulation;
}
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
-enum { QUAD_EDGE, QUAD_TRIANGLE, QUAD_QUADRANGLE, QUAD_TETRAHEDRON, QUAD_PYRAMID, QUAD_PENTAHEDRON, QUAD_HEXAHEDRON };
+enum { QUAD_EDGE, QUAD_TRIANGLE, QUAD_QUADRANGLE, QUAD_TETRAHEDRON,
+ QUAD_PYRAMID, QUAD_PENTAHEDRON, QUAD_HEXAHEDRON };
//=================================================================================
// class : SMESHGUI_AddQuadraticElementDlg
// purpose :
//=================================================================================
-class SMESHGUI_AddQuadraticElementDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_AddQuadraticElementDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theModule,
- const int theType,
- const char* = 0,
- bool modal = FALSE, WFlags fl = 0 );
- ~SMESHGUI_AddQuadraticElementDlg();
-
+ SMESHGUI_AddQuadraticElementDlg( SMESHGUI*, const int );
+ ~SMESHGUI_AddQuadraticElementDlg();
+
private:
- void Init ();
- void closeEvent (QCloseEvent*);
- void hideEvent (QHideEvent*); /* ESC key */
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void keyPressEvent(QKeyEvent*);
- void displaySimulation();
- void UpdateTable( bool theConersValidity = true );
- bool IsValid();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- int myNbCorners; /* The required number of corners */
- bool myBusy;
- SVTK_Selector* mySelector;
-
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
- SMESH::TElementSimulation* mySimulation;
-
- int myType;
- bool myIsEditCorners;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* myRadioButton1;
-
- QGroupBox* GroupArguments;
- QLineEdit* myCornerNodes;
- QPushButton* mySelectButton;
- QTable* myTable;
- QCheckBox* myReverseCB;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton * buttonHelp;
-
- QString myHelpFileName;
-
-private slots:
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void keyPressEvent( QKeyEvent* );
+ void displaySimulation();
+ void UpdateTable( bool = true );
+ bool IsValid();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ int myNbCorners; /* The required number of corners */
+ bool myBusy;
+ SVTK_Selector* mySelector;
- void onTextChange(const QString&);
- void onCellTextChange(int, int);
- void onReverse( int );
- void onCellDoubleClicked(int, int, int, const QPoint&);
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH::TElementSimulation* mySimulation;
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCorners() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
-};
-
-class SMESHGUI_IdEditItem: public QTableItem
-{
-public:
- SMESHGUI_IdEditItem(QTable* table, EditType et, const QString& text ):
- QTableItem(table, et, text) {};
- ~SMESHGUI_IdEditItem() {};
-
- QWidget* createEditor() const;
+ int myType;
+ bool myIsEditCorners;
+
+ QGroupBox* GroupConstructors;
+ QRadioButton* myRadioButton1;
+
+ QGroupBox* GroupArguments;
+ QLineEdit* myCornerNodes;
+ QPushButton* mySelectButton;
+ QTableWidget* myTable;
+ QCheckBox* myReverseCB;
+
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+
+ QString myHelpFileName;
+
+private slots:
+ void onTextChange( const QString& );
+ void onCellTextChange( int, int );
+ void onReverse( int );
+ void onCellDoubleClicked( int, int );
+
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCorners();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
};
-
-#endif // DIALOGBOX_ADD_QUADRATIC_ELEMENT_H
+#endif // SMESHGUI_ADDQUADRATICELEMENTDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_BuildCompoundDlg.cxx
+// Author : Alexander KOVALEV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_BuildCompoundDlg.cxx
-// Author : Alexander KOVALEV
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_BuildCompoundDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_VTKUtils.h"
-#include "SMESH_TypeFilter.hxx"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-#include "SalomeApp_Study.h"
-
-#include "LightApp_Application.h"
-
-#include "SALOME_ListIO.hxx"
-
-#include "utilities.h"
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qsizepolicy.h>
-#include <qstring.h>
-
-#include <vector>
+#include <SMESH_TypeFilter.hxx>
+
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_Study.h>
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+
+// Qt includes
+#include <QApplication>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QKeyEvent>
+
+// STL includes
#include <set>
+#define SPACING 6
+#define MARGIN 11
+
//=================================================================================
// name : SMESHGUI_BuildCompoundDlg
// Purpose :
//=================================================================================
-SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule)
- : QDialog(SMESH::GetDesktop(theModule), "SMESHGUI_BuildCompoundDlg", false, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
+SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
+ : QDialog(SMESH::GetDesktop(theModule)),
mySMESHGUI(theModule),
mySelectionMgr(SMESH::GetSelectionMgr(theModule))
{
- setCaption(tr("SMESH_BUILD_COMPOUND_TITLE"));
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("SMESH_BUILD_COMPOUND_TITLE"));
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
QPixmap image0 (aResMgr->loadPixmap("SMESH", tr("ICON_DLG_BUILD_COMPOUND_MESH")));
QPixmap image1 (aResMgr->loadPixmap("SMESH", tr("ICON_SELECT")));
- setSizeGripEnabled(TRUE);
- SMESHGUI_BuildCompoundDlgLayout = new QGridLayout (this);
- SMESHGUI_BuildCompoundDlgLayout->setSpacing(6);
- SMESHGUI_BuildCompoundDlgLayout->setMargin(11);
+ setSizeGripEnabled(true);
+
+ QVBoxLayout* aTopLayout = new QVBoxLayout(this);
+ aTopLayout->setSpacing(SPACING);
+ aTopLayout->setMargin(MARGIN);
/***************************************************************/
- GroupConstructors = new QButtonGroup (this, "GroupConstructors");
- GroupConstructors->setTitle(tr("COMPOUND" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout (GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- Constructor1 = new QRadioButton (GroupConstructors, "Constructor1");
- Constructor1->setText(tr(""));
- Constructor1->setPixmap(image0);
- Constructor1->setChecked(TRUE);
- GroupConstructorsLayout->addWidget(Constructor1, 0, 0);
- SMESHGUI_BuildCompoundDlgLayout->addWidget(GroupConstructors, 0, 0);
+ GroupConstructors = new QGroupBox(tr("COMPOUND"), this);
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ GroupConstructorsLayout->setSpacing(SPACING);
+ GroupConstructorsLayout->setMargin(MARGIN);
+
+ Constructor1 = new QRadioButton(GroupConstructors);
+ Constructor1->setIcon(image0);
+ Constructor1->setChecked(true);
+ GroupConstructorsLayout->addWidget(Constructor1);
+ GroupConstructorsLayout->addStretch();
/***************************************************************/
- GroupName = new QGroupBox (this, "GroupName");
- GroupName->setTitle(tr("RESULT_NAME" ));
- GroupName->setColumnLayout(0, Qt::Vertical);
- GroupName->layout()->setSpacing(0);
- GroupName->layout()->setMargin(0);
- GroupNameLayout = new QGridLayout (GroupName->layout());
- GroupNameLayout->setAlignment(Qt::AlignTop);
- GroupNameLayout->setSpacing(6);
- GroupNameLayout->setMargin(11);
- TextLabelName = new QLabel (GroupName, "TextLabelName");
- TextLabelName->setText(tr("SMESH_NAME"));
- GroupNameLayout->addWidget(TextLabelName, 0, 0);
- LineEditName = new QLineEdit (GroupName, "LineEditName");
- GroupNameLayout->addWidget(LineEditName, 0, 1);
- SMESHGUI_BuildCompoundDlgLayout->addWidget(GroupName, 1, 0);
+ GroupName = new QGroupBox(tr("RESULT_NAME"), this);
+ QHBoxLayout* GroupNameLayout = new QHBoxLayout(GroupName);
+ GroupNameLayout->setSpacing(SPACING);
+ GroupNameLayout->setMargin(MARGIN);
+
+ TextLabelName = new QLabel(tr("SMESH_NAME"), GroupName);
+ LineEditName = new QLineEdit(GroupName);
+
+ GroupNameLayout->addWidget(TextLabelName);
+ GroupNameLayout->addWidget(LineEditName);
/***************************************************************/
- GroupArgs = new QGroupBox (this, "GroupArgs");
- GroupArgs->setTitle(tr("SMESH_ARGUMENTS" ));
- GroupArgs->setColumnLayout(0, Qt::Vertical);
- GroupArgs->layout()->setSpacing(0);
- GroupArgs->layout()->setMargin(0);
- GroupArgsLayout = new QGridLayout (GroupArgs->layout());
- GroupArgsLayout->setAlignment(Qt::AlignTop);
- GroupArgsLayout->setSpacing(6);
- GroupArgsLayout->setMargin(11);
-
- TextLabelMeshes = new QLabel (GroupArgs, "TextLabelMeshes");
- TextLabelMeshes->setText(tr("MESHES"));
- TextLabelMeshes->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
- GroupArgsLayout->addWidget(TextLabelMeshes, 0, 0);
- SelectButton = new QPushButton (GroupArgs, "SelectButton");
- SelectButton->setText(tr(""));
- SelectButton->setPixmap(image1);
- SelectButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
- GroupArgsLayout->addWidget(SelectButton, 0, 1);
- LineEditMeshes = new QLineEdit (GroupArgs, "LineEditMeshes");
+ GroupArgs = new QGroupBox(tr("SMESH_ARGUMENTS"), this);
+ QGridLayout* GroupArgsLayout = new QGridLayout(GroupArgs);
+ GroupArgsLayout->setSpacing(SPACING);
+ GroupArgsLayout->setMargin(MARGIN);
+
+ TextLabelMeshes = new QLabel(tr("MESHES"), GroupArgs);
+ SelectButton = new QPushButton(GroupArgs);
+ SelectButton->setIcon(image1);
+ LineEditMeshes = new QLineEdit(GroupArgs);
LineEditMeshes->setReadOnly(true);
- GroupArgsLayout->addMultiCellWidget(LineEditMeshes, 0, 0, 2, 3);
- TextLabelUnion = new QLabel (GroupArgs, "TextLabelUnion");
- TextLabelUnion->setText(tr("PROCESSING_IDENTICAL_GROUPS"));
- TextLabelUnion->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
- GroupArgsLayout->addMultiCellWidget(TextLabelUnion, 1, 1, 0, 2);
- ComboBoxUnion = new QComboBox(GroupArgs, "ComboBoxUnion");
- GroupArgsLayout->addMultiCellWidget(ComboBoxUnion, 1, 1, 3, 3);
+ TextLabelUnion = new QLabel(tr("PROCESSING_IDENTICAL_GROUPS"), GroupArgs);
+ ComboBoxUnion = new QComboBox(GroupArgs);
- CheckBoxMerge = new QCheckBox(GroupArgs, "CheckBoxMerge");
- CheckBoxMerge->setText(tr("MERGE_NODES_AND_ELEMENTS" ));
- GroupArgsLayout->addMultiCellWidget(CheckBoxMerge, 2, 2, 0, 3);
+ CheckBoxMerge = new QCheckBox(tr("MERGE_NODES_AND_ELEMENTS"), GroupArgs);
- TextLabelTol = new QLabel (GroupArgs, "TextLabelTol");
- TextLabelTol->setText(tr("SMESH_TOLERANCE"));
+ TextLabelTol = new QLabel(tr("SMESH_TOLERANCE"), GroupArgs);
TextLabelTol->setAlignment(Qt::AlignCenter);
- GroupArgsLayout->addMultiCellWidget(TextLabelTol, 3, 3, 0, 1);
- SpinBoxTol = new SMESHGUI_SpinBox (GroupArgs, "SpinBoxTol");
+ SpinBoxTol = new SMESHGUI_SpinBox(GroupArgs);
SpinBoxTol->RangeStepAndValidator(0.0, COORD_MAX, 0.1, 6);
- GroupArgsLayout->addMultiCellWidget(SpinBoxTol, 3, 3, 2, 3);
- SMESHGUI_BuildCompoundDlgLayout->addWidget(GroupArgs, 2, 0);
+ GroupArgsLayout->addWidget(TextLabelMeshes, 0, 0);
+ GroupArgsLayout->addWidget(SelectButton, 0, 1);
+ GroupArgsLayout->addWidget(LineEditMeshes, 0, 2, 1, 2);
+ GroupArgsLayout->addWidget(TextLabelUnion, 1, 0, 1, 3);
+ GroupArgsLayout->addWidget(ComboBoxUnion, 1, 3);
+ GroupArgsLayout->addWidget(CheckBoxMerge, 2, 0, 1, 4);
+ GroupArgsLayout->addWidget(TextLabelTol, 3, 0, 1, 2);
+ GroupArgsLayout->addWidget(SpinBoxTol, 3, 2, 1, 2);
/***************************************************************/
- GroupButtons = new QGroupBox (this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton (GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton (GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem (20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton (GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_BuildCompoundDlgLayout->addWidget(GroupButtons, 3, 0);
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ aTopLayout->addWidget(GroupConstructors);
+ aTopLayout->addWidget(GroupName);
+ aTopLayout->addWidget(GroupArgs);
+ aTopLayout->addWidget(GroupButtons);
myHelpFileName = "building_compounds_page.html";
//=================================================================================
SMESHGUI_BuildCompoundDlg::~SMESHGUI_BuildCompoundDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
//=================================================================================
void SMESHGUI_BuildCompoundDlg::Init()
{
- GroupName->show();
- GroupArgs->show();
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myMesh = SMESH::SMESH_Mesh::_nil();
myMeshArray = new SMESH::mesh_array();
// signals and slots connections
- connect(buttonOk , SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply , SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(SelectButton, SIGNAL(clicked()), this, SLOT(SelectionIntoArgument()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()) , this, SLOT(ClickOnCancel()));
-
- this->show(); // displays Dialog
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH")));
LineEditMeshes->setFocus();
- ComboBoxUnion->insertItem(tr("UNITE"));
- ComboBoxUnion->insertItem(tr("RENAME"));
- ComboBoxUnion->setCurrentItem(0);
+ ComboBoxUnion->addItem(tr("UNITE"));
+ ComboBoxUnion->addItem(tr("RENAME"));
+ ComboBoxUnion->setCurrentIndex(0);
CheckBoxMerge->setChecked(false);
bool isUnique = false;
while (!isUnique) {
aName = theOperation + "_" + QString::number(++aNumber);
- isUnique = (aSet.count(aName.latin1()) == 0);
+ isUnique = (aSet.count(aName.toLatin1().data()) == 0);
}
return aName;
return false;
if (!myMesh->_is_nil()) {
try {
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
// concatenate meshes
SMESH::SMESH_Mesh_var aCompoundMesh =
aSMESHGen->Concatenate(myMeshArray,
- !(ComboBoxUnion->currentItem()),
+ !(ComboBoxUnion->currentIndex()),
CheckBoxMerge->isChecked(),
SpinBoxTol->GetValue());
- SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text().latin1() );
+ SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() );
QApplication::restoreOverrideCursor();
mySMESHGUI->updateObjBrowser();
} catch(...) {
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ "application")).
+ arg(myHelpFileName));
}
}
// function : enterEvent()
// purpose :
//=================================================================================
-void SMESHGUI_BuildCompoundDlg::enterEvent(QEvent* e)
+void SMESHGUI_BuildCompoundDlg::enterEvent( QEvent* )
{
if (GroupConstructors->isEnabled())
return;
// function : closeEvent()
// purpose :
//=================================================================================
-void SMESHGUI_BuildCompoundDlg::closeEvent(QCloseEvent* e)
+void SMESHGUI_BuildCompoundDlg::closeEvent( QCloseEvent* )
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
//function : hideEvent
//purpose : caused by ESC key
//=======================================================================
-void SMESHGUI_BuildCompoundDlg::hideEvent (QHideEvent * e)
+void SMESHGUI_BuildCompoundDlg::hideEvent( QHideEvent* )
{
if (!isMinimized())
ClickOnCancel();
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
{
TextLabelTol->setEnabled(toMerge);
SpinBoxTol->setEnabled(toMerge);
-
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_BuildCompoundDlg.h
+// Author : Alexander KOVALEV, Open CASCADE S.A.S.
//
-// File : SMESHGUI_BuildCompoundDlg.h
-// Author : Alexander KOVALEV
-// Module : SMESH
-
-#ifndef SMESHGUI_BuildCompoundDlg_H
-#define SMESHGUI_BuildCompoundDlg_H
-#include "LightApp_SelectionMgr.h"
-#include "SUIT_SelectionFilter.h"
+#ifndef SMESHGUI_BUILDCOMPOUNDDLG_H
+#define SMESHGUI_BUILDCOMPOUNDDLG_H
-// QT Includes
-#include <qdialog.h>
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
-#include <vector>
+// Qt includes
+#include <QDialog>
-// Open CASCADE Includes
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Gen)
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
-class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
-class SMESHGUI;
class QCheckBox;
-class SMESHGUI_SpinBox;
class QComboBox;
-class QSizePolicy;
-class QString;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-#include CORBA_SERVER_HEADER(SMESH_Gen)
+class SMESHGUI;
+class SMESHGUI_SpinBox;
+class LightApp_SelectionMgr;
+class SUIT_SelectionFilter;
//=================================================================================
// class : SMESHGUI_BuildCompoundDlg
// purpose :
//=================================================================================
-class SMESHGUI_BuildCompoundDlg : public QDialog
+class SMESHGUI_EXPORT SMESHGUI_BuildCompoundDlg : public QDialog
{
Q_OBJECT;
- public:
+public:
- SMESHGUI_BuildCompoundDlg (SMESHGUI * theModule);
+ SMESHGUI_BuildCompoundDlg( SMESHGUI* );
~SMESHGUI_BuildCompoundDlg();
-public :
- static QString GetDefaultName(const QString& theOperation);
+public:
+ static QString GetDefaultName( const QString& );
- private:
- void Init();
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
+private:
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
- private:
+private:
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
SMESH::mesh_array_var myMeshArray;
// Widgets
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
-
- QGroupBox* GroupName;
- QLabel* TextLabelName;
- QLineEdit* LineEditName;
-
- QGroupBox* GroupArgs;
- QLabel* TextLabelMeshes;
- QPushButton* SelectButton;
- QLineEdit* LineEditMeshes;
- QLabel* TextLabelUnion;
- QComboBox* ComboBoxUnion;
- QCheckBox* CheckBoxMerge;
- QLabel* TextLabelTol;
- SMESHGUI_SpinBox* SpinBoxTol;
-
- //protected:
- QGridLayout* SMESHGUI_BuildCompoundDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupNameLayout;
- QGridLayout* GroupArgsLayout;
-
- QString myHelpFileName;
-
- private slots:
- void ClickOnOk();
- void ClickOnCancel();
- bool ClickOnApply();
- void ClickOnHelp();
- void SelectionIntoArgument();
- void DeactivateActiveDialog();
- void ActivateThisDialog();
- void onSelectMerge(bool);
+ QGroupBox* GroupConstructors;
+ QRadioButton* Constructor1;
+
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+
+ QGroupBox* GroupName;
+ QLabel* TextLabelName;
+ QLineEdit* LineEditName;
+
+ QGroupBox* GroupArgs;
+ QLabel* TextLabelMeshes;
+ QPushButton* SelectButton;
+ QLineEdit* LineEditMeshes;
+ QLabel* TextLabelUnion;
+ QComboBox* ComboBoxUnion;
+ QCheckBox* CheckBoxMerge;
+ QLabel* TextLabelTol;
+ SMESHGUI_SpinBox* SpinBoxTol;
+
+ QString myHelpFileName;
+
+private slots:
+ void ClickOnOk();
+ void ClickOnCancel();
+ bool ClickOnApply();
+ void ClickOnHelp();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onSelectMerge( bool );
};
-#endif // SMESHGUI_BuildCompoundDlg_H
+#endif // SMESHGUI_BUILDCOMPOUNDDLG_H
-// SMESH SMESHGUI : GUI for SMESH 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
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_ClippingDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_ClippingDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_ClippingDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_SpinBox.h"
-#include "SMESH_Actor.h"
-#include "SMESH_ActorUtils.h"
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
-#include "SUIT_Session.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
-#include "SALOME_ListIO.hxx"
-#include "SALOME_InteractiveObject.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
+#include <SALOME_ListIO.hxx>
-#include "LightApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "SVTK_Selector.h"
-#include "SVTK_ViewWindow.h"
+#include <SVTK_ViewWindow.h>
-// QT Includes
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
+// Qt includes
+#include <QLabel>
+#include <QPushButton>
+#include <QComboBox>
+#include <QCheckBox>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QKeyEvent>
-// VTK Includes
+// VTK includes
#include <vtkMath.h>
-#include <vtkCamera.h>
-#include <vtkRenderer.h>
-#include <vtkImplicitBoolean.h>
-#include <vtkImplicitFunctionCollection.h>
-#include <vtkObjectFactory.h>
-
+#include <vtkPlane.h>
#include <vtkDataSet.h>
#include <vtkDataSetMapper.h>
#include <vtkPlaneSource.h>
-#include <vtkPolyData.h>
-#include <vtkRenderer.h>
#include <vtkProperty.h>
-// STL includes
-#include <algorithm>
-
-using namespace std;
-
+#define SPACING 6
+#define MARGIN 11
class OrientedPlane: public vtkPlane
{
// purpose :
//
//=================================================================================
-SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg (SMESHGUI* theModule,
- const char* name,
- bool modal,
- WFlags fl):
- QDialog(SMESH::GetDesktop(theModule),
- name,
- modal,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
+SMESHGUI_ClippingDlg::SMESHGUI_ClippingDlg( SMESHGUI* theModule ):
+ QDialog( SMESH::GetDesktop(theModule) ),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule)
{
- if (!name)
- setName("SMESHGUI_ClippingDlg");
- setCaption(tr("SMESH_CLIPPING_TITLE"));
- setSizeGripEnabled(TRUE);
- QGridLayout* SMESHGUI_ClippingDlgLayout = new QGridLayout(this);
- SMESHGUI_ClippingDlgLayout->setSpacing(6);
- SMESHGUI_ClippingDlgLayout->setMargin(11);
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle(tr("SMESH_CLIPPING_TITLE"));
+ setSizeGripEnabled(true);
+
+ QVBoxLayout* SMESHGUI_ClippingDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_ClippingDlgLayout->setSpacing(SPACING);
+ SMESHGUI_ClippingDlgLayout->setMargin(MARGIN);
// Controls for selecting, creating, deleting planes
- QGroupBox* GroupPlanes = new QGroupBox (this, "GroupPlanes");
- GroupPlanes->setTitle(tr("Clipping planes"));
- GroupPlanes->setColumnLayout(0, Qt::Vertical);
- GroupPlanes->layout()->setSpacing(0);
- GroupPlanes->layout()->setMargin(0);
- QGridLayout* GroupPlanesLayout = new QGridLayout (GroupPlanes->layout());
- GroupPlanesLayout->setAlignment(Qt::AlignTop);
- GroupPlanesLayout->setSpacing(6);
- GroupPlanesLayout->setMargin(11);
-
- ComboBoxPlanes = new QComboBox(GroupPlanes, "ComboBoxPlanes");
- GroupPlanesLayout->addWidget(ComboBoxPlanes, 0, 0);
-
- QSpacerItem* spacerGP = new QSpacerItem (20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupPlanesLayout->addItem(spacerGP, 0, 1);
-
- buttonNew = new QPushButton (GroupPlanes, "buttonNew");
- buttonNew->setText(tr("SMESH_BUT_NEW"));
- GroupPlanesLayout->addWidget(buttonNew, 0, 2);
-
- buttonDelete = new QPushButton (GroupPlanes, "buttonDelete");
- buttonDelete->setText(tr("SMESH_BUT_DELETE"));
- GroupPlanesLayout->addWidget(buttonDelete, 0, 3);
+ QGroupBox* GroupPlanes = new QGroupBox(tr("Clipping planes"), this);
+ QHBoxLayout* GroupPlanesLayout = new QHBoxLayout(GroupPlanes);
+ GroupPlanesLayout->setSpacing(SPACING);
+ GroupPlanesLayout->setMargin(MARGIN);
+
+ ComboBoxPlanes = new QComboBox(GroupPlanes);
+
+ buttonNew = new QPushButton(tr("SMESH_BUT_NEW"), GroupPlanes);
+
+ buttonDelete = new QPushButton(tr("SMESH_BUT_DELETE"), GroupPlanes);
+
+ GroupPlanesLayout->addWidget(ComboBoxPlanes);
+ GroupPlanesLayout->addStretch();
+ GroupPlanesLayout->addWidget(buttonNew);
+ GroupPlanesLayout->addWidget(buttonDelete);
// Controls for defining plane parameters
- QGroupBox* GroupParameters = new QGroupBox (this, "GroupParameters");
- GroupParameters->setTitle(tr("SMESH_PARAMETERS"));
- GroupParameters->setColumnLayout(0, Qt::Vertical);
- GroupParameters->layout()->setSpacing(0);
- GroupParameters->layout()->setMargin(0);
- QGridLayout* GroupParametersLayout = new QGridLayout (GroupParameters->layout());
- GroupParametersLayout->setAlignment(Qt::AlignTop);
- GroupParametersLayout->setSpacing(6);
- GroupParametersLayout->setMargin(11);
-
- TextLabelOrientation = new QLabel(GroupParameters, "TextLabelOrientation");
- TextLabelOrientation->setText(tr("SMESH_ORIENTATION"));
- GroupParametersLayout->addWidget(TextLabelOrientation, 0, 0);
+ QGroupBox* GroupParameters = new QGroupBox(tr("SMESH_PARAMETERS"), this);
+ QGridLayout* GroupParametersLayout = new QGridLayout(GroupParameters);
+ GroupParametersLayout->setSpacing(SPACING);
+ GroupParametersLayout->setMargin(MARGIN);
- ComboBoxOrientation = new QComboBox(GroupParameters, "ComboBoxOrientation");
- GroupParametersLayout->addWidget(ComboBoxOrientation, 0, 1);
+ TextLabelOrientation = new QLabel(tr("SMESH_ORIENTATION"), GroupParameters);
- TextLabelDistance = new QLabel(GroupParameters, "TextLabelDistance");
- TextLabelDistance->setText(tr("SMESH_DISTANCE"));
- GroupParametersLayout->addWidget(TextLabelDistance, 1, 0);
+ ComboBoxOrientation = new QComboBox(GroupParameters);
- SpinBoxDistance = new SMESHGUI_SpinBox(GroupParameters, "SpinBoxDistance");
- GroupParametersLayout->addWidget(SpinBoxDistance, 1, 1);
+ TextLabelDistance = new QLabel(tr("SMESH_DISTANCE"), GroupParameters);
- TextLabelRot1 = new QLabel(GroupParameters, "TextLabelRot1");
- TextLabelRot1->setText(tr("Rotation around X (Y to Z):"));
- GroupParametersLayout->addWidget(TextLabelRot1, 2, 0);
+ SpinBoxDistance = new SMESHGUI_SpinBox(GroupParameters);
- SpinBoxRot1 = new SMESHGUI_SpinBox(GroupParameters, "SpinBoxRot1");
- GroupParametersLayout->addWidget(SpinBoxRot1, 2, 1);
+ TextLabelRot1 = new QLabel(tr("Rotation around X (Y to Z):"), GroupParameters);
- TextLabelRot2 = new QLabel(GroupParameters, "TextLabelRot2");
- TextLabelRot2->setText(tr("Rotation around Y (X to Z):"));
- GroupParametersLayout->addWidget(TextLabelRot2, 3, 0);
+ SpinBoxRot1 = new SMESHGUI_SpinBox(GroupParameters);
- SpinBoxRot2 = new SMESHGUI_SpinBox(GroupParameters, "SpinBoxRot2");
- GroupParametersLayout->addWidget(SpinBoxRot2, 3, 1);
+ TextLabelRot2 = new QLabel(tr("Rotation around Y (X to Z):"), GroupParameters);
+
+ SpinBoxRot2 = new SMESHGUI_SpinBox(GroupParameters);
PreviewCheckBox = new QCheckBox(tr("Show preview"), GroupParameters);
PreviewCheckBox->setChecked(true);
- GroupParametersLayout->addWidget(PreviewCheckBox, 4, 0);
AutoApplyCheckBox = new QCheckBox(tr("Auto Apply"), GroupParameters);
AutoApplyCheckBox->setChecked(false);
- GroupParametersLayout->addWidget(AutoApplyCheckBox, 4, 1);
+
+ GroupParametersLayout->addWidget(TextLabelOrientation, 0, 0);
+ GroupParametersLayout->addWidget(ComboBoxOrientation, 0, 1);
+ GroupParametersLayout->addWidget(TextLabelDistance, 1, 0);
+ GroupParametersLayout->addWidget(SpinBoxDistance, 1, 1);
+ GroupParametersLayout->addWidget(TextLabelRot1, 2, 0);
+ GroupParametersLayout->addWidget(SpinBoxRot1, 2, 1);
+ GroupParametersLayout->addWidget(TextLabelRot2, 3, 0);
+ GroupParametersLayout->addWidget(SpinBoxRot2, 3, 1);
+ GroupParametersLayout->addWidget(PreviewCheckBox, 4, 0);
+ GroupParametersLayout->addWidget(AutoApplyCheckBox, 4, 1);
// Controls for "Ok", "Apply" and "Close" button
- QGroupBox* GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth()));
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- 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);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
-
- SMESHGUI_ClippingDlgLayout->addWidget(GroupPlanes, 0, 0);
- SMESHGUI_ClippingDlgLayout->addWidget(GroupParameters, 1, 0);
- SMESHGUI_ClippingDlgLayout->addWidget(GroupButtons, 2, 0);
+ QGroupBox* GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ SMESHGUI_ClippingDlgLayout->addWidget(GroupPlanes);
+ SMESHGUI_ClippingDlgLayout->addWidget(GroupParameters);
+ SMESHGUI_ClippingDlgLayout->addWidget(GroupButtons);
// Initial state
SpinBoxDistance->RangeStepAndValidator(0.0, 1.0, 0.01, 3);
SpinBoxRot1->RangeStepAndValidator(-180.0, 180.0, 1, 3);
SpinBoxRot2->RangeStepAndValidator(-180.0, 180.0, 1, 3);
- ComboBoxOrientation->insertItem(tr("|| X-Y"));
- ComboBoxOrientation->insertItem(tr("|| Y-Z"));
- ComboBoxOrientation->insertItem(tr("|| Z-X"));
+ ComboBoxOrientation->addItem(tr("|| X-Y"));
+ ComboBoxOrientation->addItem(tr("|| Y-Z"));
+ ComboBoxOrientation->addItem(tr("|| Z-X"));
SpinBoxDistance->SetValue(0.5);
SMESH::RenderViewWindow(SMESH::GetViewWindow(mySMESHGUI));
}
+double SMESHGUI_ClippingDlg::getDistance() const
+{
+ return SpinBoxDistance->GetValue();
+}
+
+void SMESHGUI_ClippingDlg::setDistance( const double theDistance )
+{
+ SpinBoxDistance->SetValue( theDistance );
+}
+
+double SMESHGUI_ClippingDlg::getRotation1() const
+{
+ return SpinBoxRot1->GetValue();
+}
+
+double SMESHGUI_ClippingDlg::getRotation2() const
+{
+ return SpinBoxRot2->GetValue();
+}
+
//=======================================================================
// function : ClickOnApply()
// purpose :
myActor->RemoveAllClippingPlanes();
SMESH::TPlanes::iterator anIter = myPlanes.begin();
- for (; anIter != myPlanes.end(); anIter++) {
+ for ( ; anIter != myPlanes.end(); anIter++) {
OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
anOrientedPlane->ShallowCopy(anIter->GetPointer());
myActor->AddClippingPlane(anOrientedPlane);
#else
platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
myPlanes.clear();
vtkIdType anId = 0, anEnd = myActor->GetNumberOfClippingPlanes();
- for (; anId < anEnd; anId++) {
+ for ( ; anId < anEnd; anId++) {
if (vtkImplicitFunction* aFunction = myActor->GetClippingPlane(anId)) {
if(OrientedPlane* aPlane = OrientedPlane::SafeDownCast(aFunction)){
OrientedPlane* anOrientedPlane = OrientedPlane::New(aViewWindow);
setRotation(aRot[0], aRot[1]);
switch (anOrientation) {
case SMESH::XY:
- ComboBoxOrientation->setCurrentItem(0);
+ ComboBoxOrientation->setCurrentIndex(0);
onSelectOrientation(0);
break;
case SMESH::YZ:
- ComboBoxOrientation->setCurrentItem(1);
+ ComboBoxOrientation->setCurrentIndex(1);
onSelectOrientation(1);
break;
case SMESH::ZX:
- ComboBoxOrientation->setCurrentItem(2);
+ ComboBoxOrientation->setCurrentIndex(2);
onSelectOrientation(2);
break;
}
if (!myActor || myPlanes.empty())
return;
- int aPlaneIndex = ComboBoxPlanes->currentItem();
+ int aPlaneIndex = ComboBoxPlanes->currentIndex();
SMESH::TPlanes::iterator anIter = myPlanes.begin() + aPlaneIndex;
anIter->GetPointer()->myActor->SetVisibility(false);
QString aName;
for(int i = 1; i<=aNbPlanes; i++) {
aName = QString(tr("Plane# %1")).arg(i);
- ComboBoxPlanes->insertItem(aName);
+ ComboBoxPlanes->addItem(aName);
}
int aPos = ComboBoxPlanes->count() - 1;
- ComboBoxPlanes->setCurrentItem(aPos);
+ ComboBoxPlanes->setCurrentIndex(aPos);
bool anIsControlsEnable = (aPos >= 0);
if (anIsControlsEnable) {
onSelectPlane(aPos);
} else {
- ComboBoxPlanes->insertItem(tr("No planes"));
+ ComboBoxPlanes->addItem(tr("No planes"));
SpinBoxRot1->SetValue(0.0);
SpinBoxRot2->SetValue(0.0);
SpinBoxDistance->SetValue(0.5);
if (myPlanes.empty() || myIsSelectPlane)
return;
- int aCurPlaneIndex = ComboBoxPlanes->currentItem();
+ int aCurPlaneIndex = ComboBoxPlanes->currentIndex();
OrientedPlane* aPlane = myPlanes[aCurPlaneIndex].GetPointer();
aV[0] = aRot[0] > 0? aV[0]: -aV[0];
aV[1] = aRot[1] > 0? aV[1]: -aV[1];
- switch (ComboBoxOrientation->currentItem()) {
+ switch (ComboBoxOrientation->currentIndex()) {
case 0:
anOrientation = SMESH::XY;
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_ClippingDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_TransparencyDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-#ifndef DIALOGBOX_CLIPPING_H
-#define DIALOGBOX_CLIPPING_H
+#ifndef SMESHGUI_CLIPPINGDLG_H
+#define SMESHGUI_CLIPPINGDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <SMESHGUI_SpinBox.h>
+// Qt includes
+#include <QDialog>
+// VTK includes
#include <vtkSmartPointer.h>
-#include <vtkPlane.h>
+// STL includes
#include <vector>
-// QT Includes
-#include <qdialog.h>
-#include <qtable.h>
-
class QLabel;
class QPushButton;
-class QTable;
class QCheckBox;
class QComboBox;
-
class LightApp_SelectionMgr;
class SVTK_Selector;
-
class SMESHGUI;
class SMESH_Actor;
-
class OrientedPlane;
+class SMESHGUI_SpinBox;
-
-namespace SMESH {
-
+namespace SMESH
+{
typedef vtkSmartPointer<OrientedPlane> TVTKPlane;
typedef std::vector<TVTKPlane> TPlanes;
- enum Orientation {XY, YZ, ZX};
-
+ enum Orientation { XY, YZ, ZX };
};
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_ClippingDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_ClippingDlg (SMESHGUI* theModule,
- const char* name = 0,
- bool modal = false,
- WFlags fl = 0);
-
- float getDistance() { return (float)SpinBoxDistance->GetValue(); }
- void setDistance (const float theDistance) { SpinBoxDistance->SetValue(theDistance); }
- double getRotation1() { return SpinBoxRot1->GetValue(); }
- double getRotation2() { return SpinBoxRot2->GetValue(); }
- void setRotation (const double theRot1, const double theRot2);
- void Sinchronize();
-
- void keyPressEvent(QKeyEvent*);
-
- ~SMESHGUI_ClippingDlg();
+ SMESHGUI_ClippingDlg( SMESHGUI* );
+ ~SMESHGUI_ClippingDlg();
+
+ double getDistance() const;
+ void setDistance( const double );
+ double getRotation1() const;
+ double getRotation2() const;
+ void setRotation( const double, const double );
+ void Sinchronize();
+
+protected:
+ void keyPressEvent( QKeyEvent* );
private:
-
- LightApp_SelectionMgr* mySelectionMgr;
- SVTK_Selector* mySelector;
- SMESHGUI* mySMESHGUI;
- SMESH_Actor* myActor;
- SMESH::TPlanes myPlanes;
-
- QComboBox* ComboBoxPlanes;
- QPushButton* buttonNew;
- QPushButton* buttonDelete;
- QLabel* TextLabelOrientation;
- QComboBox* ComboBoxOrientation;
- QLabel* TextLabelDistance;
- SMESHGUI_SpinBox* SpinBoxDistance;
- QLabel* TextLabelRot1;
- SMESHGUI_SpinBox* SpinBoxRot1;
- QLabel* TextLabelRot2;
- SMESHGUI_SpinBox* SpinBoxRot2;
- QCheckBox* PreviewCheckBox;
- QCheckBox* AutoApplyCheckBox;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
-
- bool myIsSelectPlane;
- QString myHelpFileName;
+ LightApp_SelectionMgr* mySelectionMgr;
+ SVTK_Selector* mySelector;
+ SMESHGUI* mySMESHGUI;
+ SMESH_Actor* myActor;
+ SMESH::TPlanes myPlanes;
+
+ QComboBox* ComboBoxPlanes;
+ QPushButton* buttonNew;
+ QPushButton* buttonDelete;
+ QLabel* TextLabelOrientation;
+ QComboBox* ComboBoxOrientation;
+ QLabel* TextLabelDistance;
+ SMESHGUI_SpinBox* SpinBoxDistance;
+ QLabel* TextLabelRot1;
+ SMESHGUI_SpinBox* SpinBoxRot1;
+ QLabel* TextLabelRot2;
+ SMESHGUI_SpinBox* SpinBoxRot2;
+ QCheckBox* PreviewCheckBox;
+ QCheckBox* AutoApplyCheckBox;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+
+ bool myIsSelectPlane;
+ QString myHelpFileName;
public slots:
-
- void onSelectPlane (int theIndex);
- void ClickOnNew();
- void ClickOnDelete();
- void onSelectOrientation (int theItem);
- void SetCurrentPlaneParam();
- void onSelectionChanged();
- void OnPreviewToggle (bool theIsToggled);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
+ void onSelectPlane( int );
+ void ClickOnNew();
+ void ClickOnDelete();
+ void onSelectOrientation( int );
+ void SetCurrentPlaneParam();
+ void onSelectionChanged();
+ void OnPreviewToggle( bool );
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
};
-#endif // DIALOGBOX_TRANSPARENCYDLG_H
+#endif // SMESHGUI_CLIPPINGDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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 : SMESHGUI_ComputeDlg.cxx
+// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_ComputeDlg.cxx
-// Author : Edward AGAPOV
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_ComputeDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_GEOMGenUtils.h"
#include "SMESHGUI_MeshUtils.h"
-#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_HypothesesUtils.h"
-#include "SMDS_SetIterator.hxx"
+#include <SMDS_SetIterator.hxx>
#include <SMDS_Mesh.hxx>
-#include "GEOMBase.h"
-#include "GEOM_Actor.h"
-
-#include "LightApp_SelectionMgr.h"
-#include "LightApp_UpdateFlags.h"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOME_ListIO.hxx"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
-#include "SalomeApp_Tools.h"
-#include "SalomeApp_Application.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_Study.h"
-#include "OB_Browser.h"
-
-// OCCT Includes
+// SALOME GEOM includes
+#include <GEOMBase.h>
+#include <GEOM_Actor.h>
+
+// SALOME GUI includes
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_UpdateFlags.h>
+#include <SALOME_ListIO.hxx>
+#include <SVTK_ViewWindow.h>
+#include <SVTK_ViewModel.h>
+#include <SalomeApp_Application.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
+
+// SALOME KERNEL includes
+#include <SALOMEDSClient_SObject.hxx>
+
+// OCCT includes
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <Standard_ErrorHandler.hxx>
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qtable.h>
-#include <qhbox.h>
-#include <qhgroupbox.h>
-#include <qvgroupbox.h>
-
+// Qt includes
+#include <QFrame>
+#include <QPushButton>
+#include <QLabel>
+#include <QRadioButton>
+#include <QTableWidget>
+#include <QHeaderView>
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+
+// VTK includes
#include <vtkProperty.h>
-// IDL Headers
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Gen)
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
+// STL includes
#include <vector>
#include <set>
-
-#define SPACING 5
-#define MARGIN 10
+#define SPACING 6
+#define MARGIN 11
#define COLONIZE(str) (QString(str).contains(":") > 0 ? QString(str) : QString(str) + " :" )
-#define _SEPARATOR(father) \
-{\
- /*new QLabel(father); new QLabel(father); new QLabel(father)*/;\
- (new QFrame(father))->setFrameStyle(QFrame::HLine | QFrame::Sunken);\
- (new QFrame(father))->setFrameStyle(QFrame::HLine | QFrame::Sunken);\
- (new QFrame(father))->setFrameStyle(QFrame::HLine | QFrame::Sunken);\
- (new QFrame(father))->setFrameStyle(QFrame::HLine | QFrame::Sunken);\
+static void addSeparator( QWidget* parent )
+{
+ QGridLayout* l = qobject_cast<QGridLayout*>( parent->layout() );
+ int row = l->rowCount();
+ int cols = l->columnCount();
+ for ( int i = 0; i < cols; i++ ) {
+ QFrame* hline = new QFrame( parent );
+ hline->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ l->addWidget( hline, row, i );
+ }
}
enum TCol { COL_ALGO = 0, COL_SHAPE, COL_ERROR, COL_SHAPEID, COL_PUBLISHED, NB_COLUMNS };
-using namespace SMESH;
+//using namespace SMESH;
-namespace SMESH {
-
+namespace SMESH
+{
//=============================================================================
/*!
* \brief Allocate some memory at construction and release it at destruction.
Standard_Boolean alreadymesh = Standard_True;
TopExp_Explorer ex(shape, TopAbs_FACE);
if ( ex.More() )
- for (; ex.More(); ex.Next()) {
+ for ( ; ex.More(); ex.Next()) {
const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
if(aPoly.IsNull()) { alreadymesh = Standard_False; break; }
BRepBndLib::Add(shape, B);
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
- double deflection = Max( aXmax-aXmin , Max ( aYmax-aYmin , aZmax-aZmin)) * 0.01 *4;
+ double deflection = Max( aXmax-aXmin, Max ( aYmax-aYmin, aZmax-aZmin)) * 0.01 *4;
BRepMesh_IncrementalMesh MESH(shape,deflection);
}
// -----------------------------------------------------------------------
{
QString text;
if ( _PTR(SObject) aSO = getSubShapeSO( subShapeID, aMainShape ))
- text = aSO->GetName();
+ text = aSO->GetName().c_str();
else {
text = QString("#%1").arg( subShapeID );
QString typeName = shapeTypeName( getSubShape( subShapeID, aMainShape ));
/*!
* \brief Return a list of selected rows
*/
- bool getSelectedRows(QTable* table, list< int > & rows)
+ bool getSelectedRows(QTableWidget* table, QList<int>& rows)
{
rows.clear();
- int nbSel = table->numSelections();
- for ( int i = 0; i < nbSel; ++i )
+ QList<QTableWidgetSelectionRange> selRanges = table->selectedRanges();
+ QTableWidgetSelectionRange range;
+ foreach( range, selRanges )
{
- QTableSelection selected = table->selection(i);
- if ( !selected.isActive() ) continue;
- for ( int row = selected.topRow(); row <= selected.bottomRow(); ++row )
- rows.push_back( row );
+ for ( int row = range.topRow(); row <= range.bottomRow(); ++row )
+ rows.append( row );
}
- if (rows.empty() && table->currentRow() > -1 )
- rows.push_back( table->currentRow() );
+ if ( rows.isEmpty() && table->currentRow() > -1 )
+ rows.append( table->currentRow() );
- return !rows.empty();
+ return !rows.isEmpty();
}
} // namespace SMESH
// =========================================================================================
SMESHGUI_MeshInfosBox::SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent)
- :QGroupBox( 4, Qt::Horizontal, tr("SMESH_MESHINFO_TITLE"), theParent ), myFull( full )
+ : QGroupBox( tr("SMESH_MESHINFO_TITLE"), theParent ), myFull( full )
{
- // title
- QLabel* lab1 = new QLabel(this);
- QLabel* lab2 = new QLabel(tr("SMESH_MESHINFO_ORDER0"), this );
- QLabel* lab3 = new QLabel(tr("SMESH_MESHINFO_ORDER1"), this );
- QLabel* lab4 = new QLabel(tr("SMESH_MESHINFO_ORDER2"), this );
+ QGridLayout* l = new QGridLayout(this);
+ l->setMargin( 0 );
+ l->setSpacing( 0 );
+
+ QFont italic = font(); italic.setItalic(true);
+ QFont bold = font(); bold.setBold(true);
- QFont italic = lab1->font(); italic.setItalic(true);
- QFont bold = lab1->font(); bold.setBold(true);
+ QLabel* lab;
+ int row = 0;
- lab1->setMinimumWidth(100); lab1->setFont( italic );
- lab2->setMinimumWidth(100); lab2->setFont( italic );
- lab3->setMinimumWidth(100); lab3->setFont( italic );
- lab4->setMinimumWidth(100); lab4->setFont( italic );
+ // title
+ lab = new QLabel( this );
+ lab->setMinimumWidth(100); lab->setFont( italic );
+ l->addWidget( lab, row, 0 );
+ // --
+ lab = new QLabel(tr("SMESH_MESHINFO_ORDER0"), this );
+ lab->setMinimumWidth(100); lab->setFont( italic );
+ l->addWidget( lab, row, 1 );
+ // --
+ lab = new QLabel(tr("SMESH_MESHINFO_ORDER1"), this );
+ lab->setMinimumWidth(100); lab->setFont( italic );
+ l->addWidget( lab, row, 2 );
+ // --
+ lab = new QLabel(tr("SMESH_MESHINFO_ORDER2"), this );
+ lab->setMinimumWidth(100); lab->setFont( italic );
+ l->addWidget( lab, row, 3 );
if ( myFull )
{
// nodes
- (new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), this ))->setFont( bold );
+ row = l->rowCount(); // retrieve current row count
+ // --
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), this );
+ lab->setFont( bold );
+ l->addWidget( lab, row, 0 );
+ // --
myNbNode = new QLabel( this );
- new QLabel(this);
- new QLabel(this);
+ l->addWidget( myNbNode, row, 1 );
- _SEPARATOR(this);
+ addSeparator(this); // add separator
// edges
- (new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), this ))->setFont( bold );
+ row = l->rowCount(); // retrieve current row count
+ // --
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), this );
+ lab->setFont( bold );
+ l->addWidget( lab, row, 0 );
+ // --
myNbEdge = new QLabel( this );
+ l->addWidget( myNbEdge, row, 1 );
+ // --
myNbLinEdge = new QLabel( this );
+ l->addWidget( myNbLinEdge, row, 2 );
+ // --
myNbQuadEdge = new QLabel( this );
+ l->addWidget( myNbQuadEdge, row, 3 );
- _SEPARATOR(this);
+ addSeparator(this); // add separator
// faces
- (new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), this))->setFont( bold );
+ row = l->rowCount(); // retrieve current row count
+ // --
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), this);
+ lab->setFont( bold );
+ l->addWidget( lab, row, 0 );
+ // --
myNbFace = new QLabel( this );
+ l->addWidget( myNbFace, row, 1 );
+ // --
myNbLinFace = new QLabel( this );
+ l->addWidget( myNbLinFace, row, 2 );
+ // --
myNbQuadFace = new QLabel( this );
- // triangles
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), this );
+ l->addWidget( myNbQuadFace, row, 3 );
+ // --
+ row++; // increment row count
+ // ... triangles
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbTrai = new QLabel( this );
+ l->addWidget( myNbTrai, row, 1 );
+ // --
myNbLinTrai = new QLabel( this );
+ l->addWidget( myNbLinTrai, row, 2 );
+ // --
myNbQuadTrai = new QLabel( this );
- // quadrangles
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), this );
+ l->addWidget( myNbQuadTrai, row, 3 );
+ // --
+ row++; // increment row count
+ // ... quadrangles
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbQuad = new QLabel( this );
+ l->addWidget( myNbQuad, row, 1 );
+ // --
myNbLinQuad = new QLabel( this );
+ l->addWidget( myNbLinQuad, row, 2 );
+ // --
myNbQuadQuad = new QLabel( this );
- // poligones
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_POLYGONES")), this );
+ l->addWidget( myNbQuadQuad, row, 3 );
+ // --
+ row++; // increment row count
+ // ... poligones
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_POLYGONES")), this );
+ l->addWidget( lab, row, 0 );
myNbPolyg = new QLabel( this );
- new QLabel("",this );
- new QLabel("", this );
+ l->addWidget( myNbPolyg, row, 1 );
- _SEPARATOR(this);
+ addSeparator(this); // add separator
// volumes
- (new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), this))->setFont( bold );
+ row = l->rowCount(); // retrieve current row count
+ // --
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), this);
+ lab->setFont( bold );
+ l->addWidget( lab, row, 0 );
+ // --
myNbVolum = new QLabel( this );
+ l->addWidget( myNbVolum, row, 1 );
+ // --
myNbLinVolum = new QLabel( this );
+ l->addWidget( myNbLinVolum, row, 2 );
+ // --
myNbQuadVolum = new QLabel( this );
- // tetras
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_TETRAS")), this );
+ l->addWidget( myNbQuadVolum, row, 3 );
+ // --
+ row++; // increment row count
+ // ... tetras
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TETRAS")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbTetra = new QLabel( this );
+ l->addWidget( myNbTetra, row, 1 );
+ // --
myNbLinTetra = new QLabel( this );
+ l->addWidget( myNbLinTetra, row, 2 );
+ // --
myNbQuadTetra = new QLabel( this );
- // hexas
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), this );
+ l->addWidget( myNbQuadTetra, row, 3 );
+ // --
+ row++; // increment row count
+ // ... hexas
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbHexa = new QLabel( this );
+ l->addWidget( myNbHexa, row, 1 );
+ // --
myNbLinHexa = new QLabel( this );
+ l->addWidget( myNbLinHexa, row, 2 );
+ // --
myNbQuadHexa = new QLabel( this );
- // pyras
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_PYRAS")), this );
+ l->addWidget( myNbQuadHexa, row, 3 );
+ // --
+ row++; // increment row count
+ // ... pyras
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PYRAS")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbPyra = new QLabel( this );
+ l->addWidget( myNbPyra, row, 1 );
+ // --
myNbLinPyra = new QLabel( this );
+ l->addWidget( myNbLinPyra, row, 2 );
+ // --
myNbQuadPyra = new QLabel( this );
- // prisms
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_PRISMS")), this );
+ l->addWidget( myNbQuadPyra, row, 3 );
+ // --
+ row++; // increment row count
+ // ... prisms
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PRISMS")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbPrism = new QLabel( this );
+ l->addWidget( myNbPrism, row, 1 );
+ // --
myNbLinPrism = new QLabel( this );
+ l->addWidget( myNbLinPrism, row, 2 );
+ // --
myNbQuadPrism = new QLabel( this );
- // polyedres
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_POLYEDRES")), this );
+ l->addWidget( myNbQuadPrism, row, 3 );
+ // --
+ row++; // increment row count
+ // ... polyedres
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_POLYEDRES")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbPolyh = new QLabel( this );
- new QLabel("", this );
- new QLabel("", this );
+ l->addWidget( myNbPolyh, row, 1 );
}
else
{
// nodes
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), this );
+ row = l->rowCount(); // retrieve current row count
+ // --
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbNode = new QLabel( this );
- new QLabel(this);
- new QLabel(this);
+ l->addWidget( myNbNode, row, 1 );
// edges
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), this );
+ row = l->rowCount(); // retrieve current row count
+ // --
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), this );
+ l->addWidget( lab, row, 0 );
+ // --
myNbEdge = new QLabel( this );
+ l->addWidget( myNbEdge, row, 1 );
+ // --
myNbLinEdge = new QLabel( this );
+ l->addWidget( myNbLinEdge, row, 2 );
+ // --
myNbQuadEdge = new QLabel( this );
+ l->addWidget( myNbQuadEdge, row, 3 );
// faces
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), this);
+ row = l->rowCount(); // retrieve current row count
+ // --
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), this);
+ l->addWidget( lab, row, 0 );
+ // --
myNbFace = new QLabel( this );
+ l->addWidget( myNbFace, row, 1 );
+ // --
myNbLinFace = new QLabel( this );
+ l->addWidget( myNbLinFace, row, 2 );
+ // --
myNbQuadFace = new QLabel( this );
+ l->addWidget( myNbQuadFace, row, 3 );
// volumes
- new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), this);
+ row = l->rowCount(); // retrieve current row count
+ // --
+ lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), this);
+ l->addWidget( lab, row, 0 );
+ // --
myNbVolum = new QLabel( this );
+ l->addWidget( myNbVolum, row, 1 );
+ // --
myNbLinVolum = new QLabel( this );
+ l->addWidget( myNbLinVolum, row, 2 );
+ // --
myNbQuadVolum = new QLabel( this );
+ l->addWidget( myNbQuadVolum, row, 3 );
}
}
// faces
nbTot = mesh->NbFaces(), nbLin = mesh->NbFacesOfOrder(lin);
myNbFace ->setText( QString("%1").arg( nbTot ));
- myNbLinFace ->setText( QString("%1").arg( nbLin ));
+ myNbLinFace ->setText( QString("%1").arg( nbLin ));
myNbQuadFace ->setText( QString("%1").arg( nbTot - nbLin ));
// volumes
SMESHGUI_ComputeDlg::SMESHGUI_ComputeDlg(): SMESHGUI_Dialog( 0, false, true, OK/* | Help*/ )
{
- QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame(), 0, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
+ aDlgLay->setMargin( 0 );
+ aDlgLay->setSpacing( SPACING );
QFrame* aMainFrame = createMainFrame (mainFrame());
// purpose : Create frame containing dialog's fields
//=======================================================================
-#define CASE2HEADER(enum) case enum: header = QObject::tr( #enum "_HEADER" ); break;
-
QFrame* SMESHGUI_ComputeDlg::createMainFrame (QWidget* theParent)
{
QFrame* aFrame = new QFrame(theParent);
// constructor
- QButtonGroup* aPixGrp = new QButtonGroup(1, Qt::Vertical, tr("CONSTRUCTOR"), aFrame);
- aPixGrp->setExclusive(TRUE);
+ QGroupBox* aPixGrp = new QGroupBox(tr("CONSTRUCTOR"), aFrame);
+ QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
+ aPixGrpLayout->setMargin(MARGIN); aPixGrpLayout->setSpacing(SPACING);
+
QRadioButton* aRBut = new QRadioButton(aPixGrp);
- aRBut->setPixmap(iconCompute);
- aRBut->setChecked(TRUE);
+ aRBut->setIcon(iconCompute);
+ aRBut->setChecked(true);
+ aPixGrpLayout->addWidget(aRBut);
+ aPixGrpLayout->addStretch();
// Mesh name
- QHGroupBox* nameBox = new QHGroupBox(tr("SMESH_MESHINFO_NAME"), aFrame );
+ QGroupBox* nameBox = new QGroupBox(tr("SMESH_MESHINFO_NAME"), aFrame );
+ QHBoxLayout* nameBoxLayout = new QHBoxLayout(nameBox);
+ nameBoxLayout->setMargin(MARGIN); nameBoxLayout->setSpacing(SPACING);
myMeshName = new QLabel(nameBox);
+ nameBoxLayout->addWidget(myMeshName);
// Mesh Info
// Computation errors
- myCompErrorGroup = new QGroupBox(tr("ERRORS"), aFrame, "myCompErrorGroup");
- myTable = new QTable( 1, NB_COLUMNS, myCompErrorGroup, "myTable");
- myShowBtn = new QPushButton(tr("SHOW_SHAPE"), myCompErrorGroup, "myShowBtn");
- myPublishBtn = new QPushButton(tr("PUBLISH_SHAPE"), myCompErrorGroup, "myPublishBtn");
+ myCompErrorGroup = new QGroupBox(tr("ERRORS"), aFrame);
+ myTable = new QTableWidget( 1, NB_COLUMNS, myCompErrorGroup);
+ myShowBtn = new QPushButton(tr("SHOW_SHAPE"), myCompErrorGroup);
+ myPublishBtn = new QPushButton(tr("PUBLISH_SHAPE"), myCompErrorGroup);
- myTable->setReadOnly( TRUE );
+ //myTable->setReadOnly( true ); // VSR: check
+ myTable->setEditTriggers( QAbstractItemView::NoEditTriggers );
myTable->hideColumn( COL_PUBLISHED );
myTable->hideColumn( COL_SHAPEID );
- myTable->setColumnStretchable( COL_ERROR, 1 );
- for ( int col = 0; col < NB_COLUMNS; ++col ) {
- QString header;
- switch ( col ) {
- CASE2HEADER( COL_ALGO );
- CASE2HEADER( COL_SHAPE );
- CASE2HEADER( COL_ERROR );
- CASE2HEADER( COL_SHAPEID );
- CASE2HEADER( COL_PUBLISHED);
- }
- myTable->horizontalHeader()->setLabel( col, header );
- }
+ myTable->horizontalHeader()->setResizeMode( COL_ERROR, QHeaderView::Interactive );
+
+ QStringList headers;
+ headers << tr( "COL_ALGO_HEADER" );
+ headers << tr( "COL_SHAPE_HEADER" );
+ headers << tr( "COL_ERROR_HEADER" );
+ headers << tr( "COL_SHAPEID_HEADER" );
+ headers << tr( "COL_PUBLISHED_HEADER" );
+
+ myTable->setHorizontalHeaderLabels( headers );
+
// layouting
- myCompErrorGroup->setColumnLayout(0, Qt::Vertical);
- myCompErrorGroup->layout()->setSpacing(0);
- myCompErrorGroup->layout()->setMargin(0);
- QGridLayout* grpLayout = new QGridLayout(myCompErrorGroup->layout());
- grpLayout->setAlignment(Qt::AlignTop);
+ QGridLayout* grpLayout = new QGridLayout(myCompErrorGroup);
grpLayout->setSpacing(SPACING);
grpLayout->setMargin(MARGIN);
- grpLayout->addMultiCellWidget( myTable, 0, 2, 0, 0 );
- grpLayout->addWidget ( myShowBtn, 0, 1 );
- grpLayout->addWidget ( myPublishBtn, 1, 1 );
+ grpLayout->addWidget( myTable, 0, 0, 3, 1 );
+ grpLayout->addWidget( myShowBtn, 0, 1 );
+ grpLayout->addWidget( myPublishBtn, 1, 1 );
grpLayout->setRowStretch( 2, 1 );
// Hypothesis definition errors
- myHypErrorGroup = new QGroupBox(1,Qt::Vertical, tr("SMESH_WRN_MISSING_PARAMETERS"),aFrame);
+ myHypErrorGroup = new QGroupBox(tr("SMESH_WRN_MISSING_PARAMETERS"), aFrame);
+ QHBoxLayout* myHypErrorGroupLayout = new QHBoxLayout(myHypErrorGroup);
+ myHypErrorGroupLayout->setMargin(MARGIN);
+ myHypErrorGroupLayout->setSpacing(SPACING);
myHypErrorLabel = new QLabel(myHypErrorGroup);
+ myHypErrorGroupLayout->addWidget(myHypErrorLabel);
// Memory Lack Label
- myMemoryLackGroup = new QVGroupBox(tr("ERRORS"), aFrame, "memlackGrBox");
+ myMemoryLackGroup = new QGroupBox(tr("ERRORS"), aFrame);
+ QVBoxLayout* myMemoryLackGroupLayout = new QVBoxLayout(myMemoryLackGroup);
+ myMemoryLackGroupLayout->setMargin(MARGIN);
+ myMemoryLackGroupLayout->setSpacing(SPACING);
QLabel* memLackLabel = new QLabel(tr("MEMORY_LACK"), myMemoryLackGroup);
QFont bold = memLackLabel->font(); bold.setBold(true);
memLackLabel->setFont( bold );
memLackLabel->setMinimumWidth(300);
+ myMemoryLackGroupLayout->addWidget(memLackLabel);
// add all widgets to aFrame
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
+ aLay->setMargin( 0 );
+ aLay->setSpacing( 0 );
aLay->addWidget( aPixGrp );
aLay->addWidget( nameBox );
aLay->addWidget( myBriefInfo );
SMESHGUI_ComputeOp::SMESHGUI_ComputeOp()
{
myDlg = new SMESHGUI_ComputeDlg;
- myTShapeDisplayer = new TShapeDisplayer();
+ myTShapeDisplayer = new SMESH::TShapeDisplayer();
//myHelpFileName = "/files/about_meshes.htm"; // V3
myHelpFileName = "about_meshes_page.html"; // V4
// connect signals and slots
connect(myDlg->myShowBtn, SIGNAL (clicked()), SLOT(onPreviewShape()));
connect(myDlg->myPublishBtn, SIGNAL (clicked()), SLOT(onPublishShape()));
- connect(table(),SIGNAL(selectionChanged()), SLOT(currentCellChanged()));
- connect(table(),SIGNAL(currentChanged(int,int)), SLOT(currentCellChanged()));
+ connect(table(), SIGNAL(itemSelectionChanged()), SLOT(currentCellChanged()));
+ connect(table(), SIGNAL(currentCellChanged(int,int,int,int)), SLOT(currentCellChanged()));
}
//=======================================================================
int nbSel = selected.Extent();
if (nbSel != 1) {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_NO_AVAILABLE_DATA"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NO_AVAILABLE_DATA"));
onCancel();
return;
}
Handle(SALOME_InteractiveObject) IObject = selected.First();
aMesh = SMESH::GetMeshByIO(IObject);
if (aMesh->_is_nil()) {
- SUIT_MessageBox::warn1(desktop(),
- tr("SMESH_WRN_WARNING"),
- tr("SMESH_WRN_NO_AVAILABLE_DATA"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(desktop(),
+ tr("SMESH_WRN_WARNING"),
+ tr("SMESH_WRN_NO_AVAILABLE_DATA"));
onCancel();
return;
}
// COMPUTE MESH
- MemoryReserve aMemoryReserve;
+ SMESH::MemoryReserve aMemoryReserve;
SMESH::compute_error_array_var aCompErrors;
QString aHypErrors;
bool shapeOK = myMainShape->_is_nil() ? !hasShape : hasShape;
if ( shapeOK && aMeshSObj )
{
- myDlg->myMeshName->setText( aMeshSObj->GetName() );
+ myDlg->myMeshName->setText( aMeshSObj->GetName().c_str() );
SMESH::SMESH_Gen_var gen = getSMESHGUI()->GetSMESHGen();
SMESH::algo_error_array_var errors = gen->GetAlgoState(aMesh,myMainShape);
if ( errors->length() > 0 ) {
Sel->setSelectedObjects( selected );
}
}
- myDlg->setCaption(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
+ myDlg->setWindowTitle(tr( computeFailed ? "SMESH_WRN_COMPUTE_FAILED" : "SMESH_COMPUTE_SUCCEED"));
myDlg->myMemoryLackGroup->hide();
// SHOW ERRORS
}
else
{
- QTable* tbl = myDlg->myTable;
+ QTableWidget* tbl = myDlg->myTable;
myDlg->myBriefInfo->SetInfoByMesh( aMesh );
myDlg->myBriefInfo->show();
myDlg->myFullInfo->hide();
}
// fill table of errors
- tbl->setNumRows( aCompErrors->length() );
+ tbl->setRowCount( aCompErrors->length() );
if ( !hasShape ) tbl->hideColumn( COL_SHAPE );
else tbl->showColumn( COL_SHAPE );
tbl->setColumnWidth( COL_ERROR, 200 );
for ( int row = 0; row < aCompErrors->length(); ++row )
{
SMESH::ComputeError & err = aCompErrors[ row ];
- tbl->setText( row, COL_ALGO, err.algoName.in() );
- tbl->setText( row, COL_ERROR, errorText( err.code, err.comment.in() ));
- tbl->setText( row, COL_SHAPEID, QString("%1").arg( err.subShapeID ));
+ tbl->item( row, COL_ALGO )->setText( err.algoName.in() );
+ tbl->item( row, COL_ERROR )->setText( SMESH::errorText( err.code, err.comment.in() ));
+ tbl->item( row, COL_SHAPEID )->setText( QString("%1").arg( err.subShapeID ));
- QString text = hasShape ? shapeText( err.subShapeID, myMainShape ) : QString("");
- tbl->setText( row, COL_SHAPE, text );
+ QString text = hasShape ? SMESH::shapeText( err.subShapeID, myMainShape ) : QString("");
+ tbl->item( row, COL_SHAPE )->setText( text );
- text = ( !hasShape || getSubShapeSO( err.subShapeID, myMainShape )) ? "PUBLISHED" : "";
- tbl->setText( row, COL_PUBLISHED, text ); // if text=="", "PUBLISH" button enabled
+ text = ( !hasShape || SMESH::getSubShapeSO( err.subShapeID, myMainShape )) ? "PUBLISHED" : "";
+ tbl->item( row, COL_PUBLISHED )->setText( text ); // if text=="", "PUBLISH" button enabled
- tbl->item( row, COL_ERROR )->setWordWrap( TRUE );
- tbl->adjustRow( row );
+ //tbl->item( row, COL_ERROR )->setWordWrap( true ); // VSR: TODO ???
+ tbl->resizeRowToContents( row );
}
- tbl->adjustColumn( COL_ALGO );
- tbl->adjustColumn( COL_SHAPE );
+ tbl->resizeColumnToContents( COL_ALGO );
+ tbl->resizeColumnToContents( COL_SHAPE );
tbl->setCurrentCell(0,0);
currentCellChanged(); // to update buttons
GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen();
SALOMEDS::Study_var study = SMESHGUI::GetSMESHGen()->GetCurrentStudy();
- list< int > rows;
- list< int >::iterator row;
- getSelectedRows( table(), rows );
- for ( row = rows.begin(); row != rows.end(); ++row )
+ QList<int> rows;
+ SMESH::getSelectedRows( table(), rows );
+ int row;
+ foreach ( row, rows )
{
- int curSub = table()->text(*row, COL_SHAPEID).toInt();
- GEOM::GEOM_Object_var shape = getSubShape( curSub, myMainShape );
- if ( !shape->_is_nil() && ! getSubShapeSO( curSub, myMainShape ))
+ int curSub = table()->item(row, COL_SHAPEID)->text().toInt();
+ GEOM::GEOM_Object_var shape = SMESH::getSubShape( curSub, myMainShape );
+ if ( !shape->_is_nil() && ! SMESH::getSubShapeSO( curSub, myMainShape ))
{
- if ( !getSubShapeSO( 1, myMainShape )) // the main shape not published
+ if ( !SMESH::getSubShapeSO( 1, myMainShape )) // the main shape not published
{
- QString name = GEOMBase::GetDefaultName( shapeTypeName( myMainShape, "MAIN_SHAPE" ));
+ QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( myMainShape, "MAIN_SHAPE" ));
SALOMEDS::SObject_var so =
- geomGen->AddInStudy( study, myMainShape, name, GEOM::GEOM_Object::_nil());
+ geomGen->AddInStudy( study, myMainShape, name.toLatin1().data(), GEOM::GEOM_Object::_nil());
// look for myMainShape in the table
- for ( int r = 0, nr = table()->numRows(); r < nr; ++r ) {
- if ( table()->text(r, COL_SHAPEID) == "1" ) {
+ for ( int r = 0, nr = table()->rowCount(); r < nr; ++r ) {
+ if ( table()->item( r, COL_SHAPEID )->text() == "1" ) {
if ( so->_is_nil() ) {
- table()->setText( r, COL_SHAPE, so->GetName() );
- table()->setText( r, COL_PUBLISHED, so->GetID() );
+ table()->item( r, COL_SHAPE )->setText( so->GetName() );
+ table()->item( r, COL_PUBLISHED )->setText( so->GetID() );
}
break;
}
}
if ( curSub == 1 ) continue;
}
- QString name = GEOMBase::GetDefaultName( shapeTypeName( shape, "ERROR_SHAPE" ));
- SALOMEDS::SObject_var so = geomGen->AddInStudy( study, shape, name, myMainShape);
+ QString name = GEOMBase::GetDefaultName( SMESH::shapeTypeName( shape, "ERROR_SHAPE" ));
+ SALOMEDS::SObject_var so = geomGen->AddInStudy( study, shape, name.toLatin1().data(), myMainShape);
if ( !so->_is_nil() ) {
- table()->setText( *row, COL_SHAPE, so->GetName() );
- table()->setText( *row, COL_PUBLISHED, so->GetID() );
+ table()->item( row, COL_SHAPE )->setText( so->GetName() );
+ table()->item( row, COL_PUBLISHED )->setText( so->GetID() );
}
}
}
myTShapeDisplayer->SetVisibility( false );
bool publishEnable = 0, showEnable = 0, showOnly = 1;
- list< int > rows;
- list< int >::iterator row;
- getSelectedRows( table(), rows );
- for ( row = rows.begin(); row != rows.end(); ++row )
+ QList<int> rows;
+ SMESH::getSelectedRows( table(), rows );
+ int row;
+ foreach ( row, rows )
{
- bool hasData = ( !table()->text(*row, COL_SHAPE).isEmpty() );
- bool isPublished = ( !table()->text(*row, COL_PUBLISHED).isEmpty() );
+ bool hasData = ( !table()->item( row, COL_SHAPE )->text().isEmpty() );
+ bool isPublished = ( !table()->item( row, COL_PUBLISHED )->text().isEmpty() );
if ( hasData && !isPublished )
publishEnable = true;
- int curSub = table()->text(*row, COL_SHAPEID).toInt();
+ int curSub = table()->item( row, COL_SHAPEID )->text().toInt();
bool prsReady = myTShapeDisplayer->HasReadyActorsFor( curSub, myMainShape );
if ( prsReady ) {
myTShapeDisplayer->Show( curSub, myMainShape, showOnly );
if ( myTShapeDisplayer )
{
SUIT_OverrideCursor aWaitCursor;
- list< int > rows;
- list< int >::iterator row;
- getSelectedRows( table(), rows );
+ QList<int> rows;
+ SMESH::getSelectedRows( table(), rows );
bool showOnly = true;
- for ( row = rows.begin(); row != rows.end(); ++row )
+ int row;
+ foreach ( row, rows )
{
- int curSub = table()->text(*row, COL_SHAPEID).toInt();
+ int curSub = table()->item( row, COL_SHAPEID )->text().toInt();
if ( curSub > 0 ) {
myTShapeDisplayer->Show( curSub, myMainShape, showOnly );
showOnly = false;
*/
//================================================================================
-QTable* SMESHGUI_ComputeOp::table()
+QTableWidget* SMESHGUI_ComputeOp::table()
{
return myDlg->myTable;
}
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_ComputeDlg.h
+// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_ComputeDlg.h
-// Author : Edward AGAPOV
-// Module : SMESH
+#ifndef SMESHGUI_COMPUTEDLG_H
+#define SMESHGUI_COMPUTEDLG_H
-#ifndef SMESHGUI_ComputeDlg_H
-#define SMESHGUI_ComputeDlg_H
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Dialog.h"
-#include "SMESHGUI_SelectionOp.h"
-
-#include "VTKViewer.h"
+#include "SMESHGUI_Operation.h"
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(GEOM_Gen)
+// Qt includes
+#include <QGroupBox>
-#include <qgroupbox.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
class QFrame;
class QPushButton;
-class QTable;
+class QTableWidget;
class QLabel;
class SMESHGUI_ComputeDlg;
-class GEOM_Actor;
-namespace SMESH {
+namespace SMESH
+{
class TShapeDisplayer;
}
/*!
* \brief Operation to compute a mesh and show computation errors
*/
-class SMESHGUI_ComputeOp: public SMESHGUI_Operation
+class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_Operation
{
Q_OBJECT
virtual LightApp_Dialog* dlg() const;
protected:
-
virtual void startOperation();
virtual void stopOperation();
virtual bool onApply();
private slots:
-
void onPreviewShape();
void onPublishShape();
void currentCellChanged();
private:
+ QTableWidget* table();
- QTable* table();
+ SMESHGUI_ComputeDlg* myDlg;
- SMESHGUI_ComputeDlg* myDlg;
-
- GEOM::GEOM_Object_var myMainShape;
- SMESH::TShapeDisplayer* myTShapeDisplayer;
+ GEOM::GEOM_Object_var myMainShape;
+ SMESH::TShapeDisplayer* myTShapeDisplayer;
};
/*!
* \brief Box showing mesh info
*/
-class SMESHGUI_MeshInfosBox : public QGroupBox
+class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox
{
Q_OBJECT
+
public:
+ SMESHGUI_MeshInfosBox( const bool, QWidget* );
- SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent);
- void SetInfoByMesh(SMESH::SMESH_Mesh_var mesh);
+ void SetInfoByMesh( SMESH::SMESH_Mesh_var );
private:
-
bool myFull;
QLabel* myNbNode;
- QLabel* myNbEdge, *myNbLinEdge, *myNbQuadEdge;
- QLabel* myNbTrai, *myNbLinTrai, *myNbQuadTrai;
- QLabel* myNbQuad, *myNbLinQuad, *myNbQuadQuad;
- QLabel* myNbFace, *myNbLinFace, *myNbQuadFace;
+ QLabel* myNbEdge;
+ QLabel* myNbLinEdge;
+ QLabel* myNbQuadEdge;
+ QLabel* myNbTrai;
+ QLabel* myNbLinTrai;
+ QLabel* myNbQuadTrai;
+ QLabel* myNbQuad;
+ QLabel* myNbLinQuad;
+ QLabel* myNbQuadQuad;
+ QLabel* myNbFace;
+ QLabel* myNbLinFace;
+ QLabel* myNbQuadFace;
QLabel* myNbPolyg;
- QLabel* myNbHexa, *myNbLinHexa, *myNbQuadHexa;
- QLabel* myNbTetra, *myNbLinTetra, *myNbQuadTetra;
- QLabel* myNbPyra, *myNbLinPyra, *myNbQuadPyra;
- QLabel* myNbPrism, *myNbLinPrism, *myNbQuadPrism;
- QLabel* myNbVolum, *myNbLinVolum, *myNbQuadVolum;
+ QLabel* myNbHexa;
+ QLabel* myNbLinHexa;
+ QLabel* myNbQuadHexa;
+ QLabel* myNbTetra;
+ QLabel* myNbLinTetra;
+ QLabel* myNbQuadTetra;
+ QLabel* myNbPyra;
+ QLabel* myNbLinPyra;
+ QLabel* myNbQuadPyra;
+ QLabel* myNbPrism;
+ QLabel* myNbLinPrism;
+ QLabel* myNbQuadPrism;
+ QLabel* myNbVolum;
+ QLabel* myNbLinVolum;
+ QLabel* myNbQuadVolum;
QLabel* myNbPolyh;
};
* \brief Dialog to compute a mesh and show computation errors
*/
-class SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
+class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
{
Q_OBJECT
public:
- SMESHGUI_ComputeDlg();
+ SMESHGUI_ComputeDlg();
private:
-
- QFrame* createMainFrame (QWidget*);
+ QFrame* createMainFrame( QWidget* );
QLabel* myMeshName;
QGroupBox* myMemoryLackGroup;
QGroupBox* myCompErrorGroup;
QGroupBox* myHypErrorGroup;
QLabel* myHypErrorLabel;
- QTable* myTable;
+ QTableWidget* myTable;
QPushButton* myShowBtn;
QPushButton* myPublishBtn;
SMESHGUI_MeshInfosBox* myFullInfo;
friend class SMESHGUI_ComputeOp;
-
};
-#endif
+#endif // SMESHGUI_COMPUTEDLG_H
+// SMESH SMESHGUI : GUI for SMESH component
+//
// 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
+// 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/**
-* SMESH SMESHGUI
-*
-* Copyright (C) 2005 CEA/DEN, EDF R&D
-*
-*
-*
-* File : SMESHGUI_ConvToQuadDlg.cxx
-* Module : SMESH
-*/
-
-#include <SMESHGUI_ConvToQuadDlg.h>
-#include <SUIT_Session.h>
-
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qcheckbox.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
+// File : SMESHGUI_ConvToQuadDlg.cxx
+// Author : Open CASCADE S.A.S.
+//
+
+// SMESH includes
+#include "SMESHGUI_ConvToQuadDlg.h"
+
+// Qt includes
+#include <QGroupBox>
+#include <QCheckBox>
+#include <QRadioButton>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QFrame>
+#include <QHBoxLayout>
+#include <QGridLayout>
+
+#define SPACING 6
+#define MARGIN 11
SMESHGUI_ConvToQuadDlg::SMESHGUI_ConvToQuadDlg()
-: SMESHGUI_Dialog( 0, false, true )
+ : SMESHGUI_Dialog( 0, false, true )
{
-
- setCaption( tr( "CAPTION" ) );
+ setWindowTitle( tr( "CAPTION" ) );
// Create top controls
- QGroupBox* aGrp = new QGroupBox( 3, Qt::Horizontal, mainFrame() );
- aGrp->setFrameStyle( QFrame::NoFrame );
- aGrp->setInsideMargin( 0 );
// mesh
- createObject( tr( "MESH" ), aGrp, 0 );
+ createObject( tr( "MESH" ), mainFrame(), 0 );
//Create check box
- myMedNdsOnGeom = new QCheckBox( tr( "MEDIUMNDS" ), mainFrame() );
+ myMedNdsOnGeom = new QCheckBox( tr( "MEDIUMNDS" ), mainFrame() );
//Create RadioButtons
- myBG = new QButtonGroup( 2, Qt::Vertical, "", mainFrame() );
- myBG->setExclusive( true );
+ myBGBox = new QGroupBox( mainFrame() );
+ myBG = new QButtonGroup( mainFrame() );
+ QHBoxLayout* aBGLayout = new QHBoxLayout( myBGBox );
+ aBGLayout->setMargin(MARGIN);
+ aBGLayout->setSpacing(SPACING);
- myRB1 = new QRadioButton( myBG );
- myRB1->setText( tr( "RADIOBTN_1" ) );
- myRB1->setChecked( true );
+ myRB1 = new QRadioButton( tr( "RADIOBTN_1" ), myBGBox );
+ myRB2 = new QRadioButton( tr( "RADIOBTN_2" ), myBGBox );
- myRB2 = new QRadioButton( myBG );
- myRB2->setText( tr( "RADIOBTN_2" ) );
+ aBGLayout->addWidget(myRB1);
+ aBGLayout->addWidget(myRB2);
+ myBG->addButton(myRB1, 0);
+ myBG->addButton(myRB2, 1);
+ myRB1->setChecked( true );
// Fill layout
- QVBoxLayout* aLay = new QVBoxLayout( mainFrame(), 5, 5 );
- aLay->addWidget( aGrp );
- aLay->addWidget( myMedNdsOnGeom );
- aLay->addWidget( myBG );
+ QGridLayout* aLay = new QGridLayout( mainFrame() );
+ aLay->setMargin( 0 );
+ aLay->setSpacing( SPACING );
+
+ aLay->addWidget( objectWg( 0, Label ), 0, 0 );
+ aLay->addWidget( objectWg( 0, Btn ), 0, 1 );
+ aLay->addWidget( objectWg( 0, Control ), 0, 2 );
+ aLay->addWidget( myMedNdsOnGeom, 1, 0, 1, 3 );
+ aLay->addWidget( myBGBox, 2, 0, 1, 3 );
- connect(myBG, SIGNAL( clicked( int ) ), this, SIGNAL( onClicked( int ) ) );
+ connect(myBG, SIGNAL( buttonClicked( int ) ), this, SIGNAL( onClicked( int ) ) );
}
SMESHGUI_ConvToQuadDlg::~SMESHGUI_ConvToQuadDlg()
int SMESHGUI_ConvToQuadDlg::CurrentRB( )
{
- return myBG->selectedId();
+ return myBG->checkedId();
}
void SMESHGUI_ConvToQuadDlg::SetEnabledControls( const bool theCheck )
{
- myBG->setEnabled( theCheck );
+ myBGBox->setEnabled( theCheck );
myMedNdsOnGeom->setEnabled( theCheck );
setButtonEnabled( theCheck, QtxDialog::OK | QtxDialog::Apply );
}
myRB2->setEnabled( !theCheck );
myRB2->setChecked( true );
}
- emit onClicked( myBG->selectedId() );
+ emit onClicked( myBG->checkedId() );
}
+// SMESH SMESHGUI : GUI for SMESH component
+//
// 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
+// 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/**
-* SMESH SMESHGUI
-*
-* Copyright (C) 2005 CEA/DEN, EDF R&D
-*
-*
-*
-* File : SMESHGUI_ConvToQuadDlg.h
-* Module : SMESH
-*/
+// File : SMESHGUI_ConvToQuadDlg.h
+// Author : Open CASCADE S.A.S.
+//
+#ifndef SMESHGUI_CONVTOQUADDLG_H
+#define SMESHGUI_CONVTOQUADDLG_H
-#ifndef SMESHGUI_ConvToQuadDlg_H
-#define SMESHGUI_ConvToQuadDlg_H
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Dialog.h"
-/*#include <qframe.h>
-#include <qstringlist.h>
-#include <qmap.h>*/
-
-//idl headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
class QCheckBox;
class QRadioButton;
class QButtonGroup;
+class QGroupBox;
-class SMESHGUI_ConvToQuadDlg : public SMESHGUI_Dialog
+class SMESHGUI_EXPORT SMESHGUI_ConvToQuadDlg : public SMESHGUI_Dialog
{
Q_OBJECT
public:
- SMESHGUI_ConvToQuadDlg();
+ SMESHGUI_ConvToQuadDlg();
virtual ~SMESHGUI_ConvToQuadDlg();
- bool IsMediumNdsOnGeom() const;
- void SetMediumNdsOnGeom(const bool theCheck);
- bool IsEnabledCheck() const;
- void SetEnabledCheck( const bool theCheck );
- void SetEnabledGroup( const bool theCheck );
- void SetEnabledControls( const bool theCheck );
- void SetEnabledRB( const int idx, const bool theCheck );
- int CurrentRB();//returns the ID of the selected toggle button
+ bool IsMediumNdsOnGeom() const;
+ void SetMediumNdsOnGeom( const bool );
+ bool IsEnabledCheck() const;
+ void SetEnabledCheck( const bool );
+ void SetEnabledGroup( const bool );
+ void SetEnabledControls( const bool );
+ void SetEnabledRB( const int, const bool );
+ int CurrentRB(); //returns the ID of the selected toggle button
signals:
- void onClicked( int );
+ void onClicked( int );
private:
-
- QCheckBox* myMedNdsOnGeom;
+ QCheckBox* myMedNdsOnGeom;
+ QGroupBox* myBGBox;
QButtonGroup* myBG;
QRadioButton* myRB1;
QRadioButton* myRB2;
-
};
-#endif
-
-
-
-
+#endif // SMESHGUI_CONVTOQUADDLG_H
+// SMESH SMESHGUI : GUI for SMESH component
+//
// 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
+// 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/**
-* SMESH SMESHGUI
-*
-* Copyright (C) 2005 CEA/DEN, EDF R&D
-*
-*
-*
-* File : SMESHGUI_ConvToQuadOp.h
-* Module : SMESHGUI
-*/
+// File : SMESHGUI_ConvToQuadOp.cxx
+// Author : Open CASCADE S.A.S.
+//
+// SMESH includes
#include "SMESHGUI_ConvToQuadOp.h"
-#include "SMESHGUI_ConvToQuadDlg.h"
-#include "SMESHGUI.h"
+#include "SMESHGUI_ConvToQuadDlg.h"
#include "SMESHGUI_Utils.h"
-#include "SMESH_TypeFilter.hxx"
-
-#include "SalomeApp_Tools.h"
+#include <SMESH_TypeFilter.hxx>
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SalomeApp_Tools.h>
+#include <SUIT_MessageBox.h>
+#include <LightApp_UpdateFlags.h>
-#include "LightApp_UpdateFlags.h"
-
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
//================================================================================
//================================================================================
void SMESHGUI_ConvToQuadOp::selectionDone()
{
- if ( !dlg()->isShown() )
+ if ( !dlg()->isVisible() )
return;
SMESHGUI_SelectionOp::selectionDone();
try
{
QString anMeshEntry = myDlg->selectedObject( 0 );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( anMeshEntry.latin1() );
+ _PTR(SObject) pMesh = studyDS()->FindObjectID( anMeshEntry.toLatin1().data() );
if ( !pMesh ) return;
SMESH::SMESH_Mesh_var mesh =
QString aMess;
QString anMeshEntry = myDlg->selectedObject( 0 );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( anMeshEntry.latin1() );
+ _PTR(SObject) pMesh = studyDS()->FindObjectID( anMeshEntry.toLatin1().data() );
if ( !pMesh )
{
dlg()->show();
- SUIT_MessageBox::warn1( myDlg,
- tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED"), tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( myDlg,
+ tr( "SMESH_WRN_WARNING" ), tr("MESH_IS_NOT_SELECTED") );
return false;
}
if( CORBA::is_nil(mesh) )
{
- SUIT_MessageBox::warn1( myDlg,
- tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL"), tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( myDlg,
+ tr( "SMESH_WRN_WARNING" ), tr("REF_IS_NULL") );
return false;
}
void SMESHGUI_ConvToQuadOp::ConnectRadioButtons( int id )
{
QString anMeshEntry = myDlg->selectedObject( 0 );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( anMeshEntry.latin1() );
+ _PTR(SObject) pMesh = studyDS()->FindObjectID( anMeshEntry.toLatin1().data() );
if ( !pMesh ) return;
SMESH::SMESH_Mesh_var mesh =
else
myDlg->SetEnabledCheck( true );
}
-
-
+// SMESH SMESHGUI : GUI for SMESH component
+//
// 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
+// 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/**
-* SMESH SMESHGUI
-*
-* Copyright (C) 2005 CEA/DEN, EDF R&D
-*
-*
-*
-* File : SMESHGUI_ConvToQuadOp.h
-* Module : SMESHGUI
-*/
+// File : SMESHGUI_ConvToQuadOp.h
+// Author : Open CASCADE S.A.S.
+//
+
+#ifndef SMESHGUI_CONVTOQUADOP_H
+#define SMESHGUI_CONVTOQUADOP_H
-#ifndef SMESHGUI_ConvToQuadOp_H
-#define SMESHGUI_ConvToQuadOp_H
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
-#include <SMESHGUI_SelectionOp.h>
-//#include <qstringlist.h>
+#include "SMESHGUI_SelectionOp.h"
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
class SMESHGUI_ConvToQuadDlg;
-class SMESHGUI_ConvToQuadOp : public SMESHGUI_SelectionOp
+class SMESHGUI_EXPORT SMESHGUI_ConvToQuadOp : public SMESHGUI_SelectionOp
{
Q_OBJECT
public:
-enum MeshType{ Comp = 0, Linear, Quadratic };
+ enum MeshType{ Comp = 0, Linear, Quadratic };
public:
SMESHGUI_ConvToQuadOp();
protected slots:
virtual bool onApply();
- void ConnectRadioButtons( int);
+ void ConnectRadioButtons( int );
private:
SMESHGUI_ConvToQuadDlg* myDlg;
};
-#endif
-
+#endif // SMESHGUI_CONVTOQUADOP_H
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH component
-//
-// Copyright (C) 2003 CEA
-//
-// 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.org
-//
-//
-//
-// File : SMESHGUI_CreateHypothesesDlg.h
-// Author : Julia DOROVSKIKH
-// Module : SMESH
-// $Header$
-
-#ifndef DIALOGBOX_CREATE_HYPOTHESES_H
-#define DIALOGBOX_CREATE_HYPOTHESES_H
-
-#include "SMESH_SMESHGUI.hxx"
-
-// QT Includes
-#include <qvariant.h>
-#include <qdialog.h>
-#include <qstringlist.h>
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
-#include <map>
-#include <string>
-
-class QButtonGroup;
-class QGroupBox;
-class QPushButton;
-class QListView;
-class QListViewItem;
-class SMESHGUI;
-
-//=================================================================================
-// class : SMESHGUI_CreateHypothesesDlg
-// purpose :
-//=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_CreateHypothesesDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- SMESHGUI_CreateHypothesesDlg (SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- bool isAlgo = FALSE);
- ~SMESHGUI_CreateHypothesesDlg ();
-
-private:
-
- void Init() ;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
-
- void InitAlgoDefinition();
-
- SMESHGUI* mySMESHGUI;
- bool myIsAlgo;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
-
- QGroupBox* GroupAlgorithms;
- QListView* ListAlgoDefinition;
-
-private slots:
-
- void ClickOnCancel();
- void ClickOnApply();
- void ActivateThisDialog() ;
-
- void onSelectionChanged();
- void onDoubleClicked(QListViewItem*);
-};
-
-#endif // DIALOGBOX_CREATE_HYPOTHESES_H
-// SMESH SMESHGUI : GUI for SMESH component
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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 : SMESHGUI_CreatePatternDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_CreatePatternDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_CreatePatternDlg.h"
#include "SMESHGUI.h"
-#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_PatternWidget.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_PatternUtils.h"
#include "SMESHGUI_GEOMGenUtils.h"
-#include "SMESH_NumberFilter.hxx"
+#include <SMESH_NumberFilter.hxx>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_FileDlg.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SalomeApp_Study.h"
-#include "LightApp_Application.h"
-#include "LightApp_DataOwner.h"
-#include "LightApp_SelectionMgr.h"
-#include "SalomeApp_Tools.h"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Tools.h>
-#include "SALOMEDS_SObject.hxx"
+#include <SALOME_ListIO.hxx>
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
-#include "SALOME_ListIO.hxx"
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
+// SALOME KERNEL includes
+#include <SALOMEDS_SObject.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qbuttongroup.h>
-#include <qmessagebox.h>
-#include <qapplication.h>
-
-#define SPACING 5
-#define MARGIN 10
+// Qt includes
+#include <QFrame>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QLabel>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QButtonGroup>
+#include <QApplication>
+#include <QKeyEvent>
+#include <QFile>
+#include <QDir>
+
+#define SPACING 6
+#define MARGIN 11
/*!
* Class : SMESHGUI_CreatePatternDlg
// purpose : Constructor
//=======================================================================
SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule,
- const int theType,
- const char* theName)
- : QDialog( SMESH::GetDesktop( theModule ), theName, false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+ const int theType )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
- setCaption(tr("CAPTION"));
+ setModal( false );
+ setWindowTitle( tr( "CAPTION" ) );
- QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout( this );
+ aDlgLay->setMargin( MARGIN );
+ aDlgLay->setSpacing( SPACING );
- QFrame* aMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
+ QWidget* aMainFrame = createMainFrame( this );
+ QWidget* aBtnFrame = createButtonFrame( this );
- aDlgLay->addWidget(aMainFrame);
- aDlgLay->addWidget(aBtnFrame);
+ aDlgLay->addWidget( aMainFrame );
+ aDlgLay->addWidget( aBtnFrame );
- aDlgLay->setStretchFactor(aMainFrame, 1);
+ aDlgLay->setStretchFactor( aMainFrame, 1 );
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
mySelector = aViewWindow->GetSelector();
myHelpFileName = "pattern_mapping_page.html";
- Init(theType);
+ Init( theType );
}
//=======================================================================
// function : createMainFrame()
// purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_CreatePatternDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_CreatePatternDlg::createMainFrame( QWidget* theParent )
{
- QPixmap iconSlct (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- QPixmap icon2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_2d")));
- QPixmap icon3d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_3d")));
- QPixmap iconSample2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D")));
+ QPixmap iconSlct ( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
+ QPixmap icon2d ( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_PATTERN_2d" ) ) );
+ QPixmap icon3d ( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_PATTERN_3d" ) ) );
+ QPixmap iconSample2d( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH", tr( "ICON_PATTERN_SAMPLE_2D" ) ) );
- QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, theParent);
- aMainGrp->setFrameStyle(QFrame::NoFrame);
- aMainGrp->setInsideMargin(0);
+ QWidget* aMainGrp = new QWidget( theParent );
+ QVBoxLayout* aMainGrpLayout = new QVBoxLayout( aMainGrp );
+ aMainGrpLayout->setMargin( 0 );
+ aMainGrpLayout->setSpacing( SPACING );
// Pattern type group
- myTypeGrp = new QButtonGroup (1, Qt::Vertical, tr("PATTERN_TYPE"), aMainGrp);
- mySwitch2d = new QRadioButton (myTypeGrp);
- mySwitch3d = new QRadioButton (myTypeGrp);
- mySwitch2d->setPixmap(icon2d);
- mySwitch3d->setPixmap(icon3d);
- myTypeGrp->insert(mySwitch2d, Type_2d);
- myTypeGrp->insert(mySwitch3d, Type_3d);
+ QGroupBox* aTypeGrp = new QGroupBox( tr( "PATTERN_TYPE" ), aMainGrp );
+ QHBoxLayout* aTypeGrpLayout = new QHBoxLayout( aTypeGrp );
+ aTypeGrpLayout->setMargin( MARGIN );
+ aTypeGrpLayout->setSpacing( SPACING );
- QGroupBox* aPatternGrp = new QGroupBox(1, Qt::Horizontal, tr("PATTERN"), aMainGrp);
+ mySwitch2d = new QRadioButton( aTypeGrp );
+ mySwitch3d = new QRadioButton( aTypeGrp );
+ mySwitch2d->setIcon( icon2d );
+ mySwitch3d->setIcon( icon3d );
- // Mesh and pattern name group
+ myTypeGrp = new QButtonGroup( aMainGrp );
+ myTypeGrp->addButton( mySwitch2d, Type_2d );
+ myTypeGrp->addButton( mySwitch3d, Type_3d );
- QGroupBox* aMeshGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp);
- aMeshGrp->setFrameStyle(QFrame::NoFrame);
- aMeshGrp->setInsideMargin(0);
+ // ... layout widgets
+
+ aTypeGrpLayout->addWidget( mySwitch2d );
+ aTypeGrpLayout->addWidget( mySwitch3d );
+
+ // Mesh and pattern name group
- new QLabel(tr("MESH_OR_SUBMESH"), aMeshGrp);
+ QGroupBox* aPatternGrp = new QGroupBox( tr( "PATTERN" ), aMainGrp );
+ QGridLayout* aPatternGrpLayout = new QGridLayout( aPatternGrp );
+ aPatternGrpLayout->setMargin( MARGIN );
+ aPatternGrpLayout->setSpacing( SPACING );
- QPushButton* aSelBtn = new QPushButton(aMeshGrp);
- aSelBtn->setPixmap(iconSlct);
- myMeshEdit = new QLineEdit(aMeshGrp);
- myMeshEdit->setReadOnly(true);
+ QLabel* aMeshLab = new QLabel( tr( "MESH_OR_SUBMESH" ), aPatternGrp );
- QGroupBox* aPattGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp);
- aPattGrp->setFrameStyle(QFrame::NoFrame);
- aPattGrp->setInsideMargin(0);
+ QPushButton* aSelBtn = new QPushButton( aPatternGrp );
+ aSelBtn->setIcon( iconSlct );
+ myMeshEdit = new QLineEdit( aPatternGrp );
+ myMeshEdit->setReadOnly( true );
- new QLabel(tr("PATTERN_NAME"), aPattGrp);
- myName = new QLineEdit(aPattGrp);
+ QLabel* aNameLab = new QLabel( tr( "PATTERN_NAME" ), aPatternGrp );
+ myName = new QLineEdit( aPatternGrp );
// Picture 2d
- myPicture2d = new SMESHGUI_PatternWidget(aPatternGrp),
- myPicture2d->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+ myPicture2d = new SMESHGUI_PatternWidget( aPatternGrp ),
+ myPicture2d->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
// Project check box
- myProjectChk = new QCheckBox(tr("PROJECT"), aPatternGrp);
+ myProjectChk = new QCheckBox( tr( "PROJECT" ), aPatternGrp );
+
+ // ... layout widgets
+
+ aPatternGrpLayout->addWidget( aMeshLab, 0, 0 );
+ aPatternGrpLayout->addWidget( aSelBtn, 0, 1 );
+ aPatternGrpLayout->addWidget( myMeshEdit, 0, 2 );
+ aPatternGrpLayout->addWidget( aNameLab, 1, 0 );
+ aPatternGrpLayout->addWidget( myName, 1, 2 );
+ aPatternGrpLayout->addWidget( myPicture2d, 2, 0, 1, 3 );
+ aPatternGrpLayout->addWidget( myProjectChk, 3, 0, 1, 3 );
+
+ // main layout
+
+ aMainGrpLayout->addWidget( aTypeGrp );
+ aMainGrpLayout->addWidget( aPatternGrp );
// Connect signals and slots
- connect(myTypeGrp, SIGNAL(clicked(int) ), SLOT(onTypeChanged(int)));
- connect(myProjectChk, SIGNAL(toggled(bool)), SLOT(onProject(bool) ));
- connect(aSelBtn, SIGNAL(clicked() ), SLOT(onSelBtnClicked()));
+ connect( myTypeGrp, SIGNAL( buttonClicked( int ) ),
+ this, SLOT( onTypeChanged( int ) ) );
+ connect( myProjectChk, SIGNAL( toggled( bool ) ),
+ this, SLOT( onProject( bool ) ) );
+ connect( aSelBtn, SIGNAL( clicked() ),
+ this, SLOT( onSelBtnClicked() ) );
return aMainGrp;
}
// function : createButtonFrame()
// purpose : Create frame containing buttons
//=======================================================================
-QFrame* SMESHGUI_CreatePatternDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_CreatePatternDlg::createButtonFrame( QWidget* theParent )
{
- QFrame* aFrame = new QFrame(theParent);
- aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
-
- myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
- mySaveBtn = new QPushButton(tr("SAVE" ), aFrame);
- myCloseBtn = new QPushButton(tr("SMESH_BUT_CANCEL"), aFrame);
- myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
-
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING);
-
- aLay->addWidget(myOkBtn);
- aLay->addWidget(mySaveBtn);
- aLay->addItem(aSpacer);
- aLay->addWidget(myCloseBtn);
- aLay->addWidget(myHelpBtn);
-
- connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
- connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
- connect(mySaveBtn, SIGNAL(clicked()), SLOT(onSave()));
- connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
+ QFrame* aFrame = new QFrame( theParent );
+ aFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
+
+ QPushButton* myOkBtn = new QPushButton( tr( "SMESH_BUT_OK" ), aFrame );
+ QPushButton* mySaveBtn = new QPushButton( tr( "SAVE" ), aFrame );
+ QPushButton* myCloseBtn = new QPushButton( tr( "SMESH_BUT_CANCEL"), aFrame );
+ QPushButton* myHelpBtn = new QPushButton( tr( "SMESH_BUT_HELP"), aFrame );
+
+ QHBoxLayout* aLay = new QHBoxLayout( aFrame );
+ aLay->setMargin( MARGIN );
+ aLay->setSpacing( SPACING );
+
+ aLay->addWidget( myOkBtn );
+ aLay->addSpacing( 10 );
+ aLay->addWidget( mySaveBtn );
+ aLay->addSpacing( 10 );
+ aLay->addStretch();
+ aLay->addWidget( myCloseBtn );
+ aLay->addWidget( myHelpBtn );
+
+ connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) );
+ connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+ connect( mySaveBtn, SIGNAL( clicked() ), this, SLOT( onSave() ) );
+ connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
return aFrame;
}
//=======================================================================
SMESHGUI_CreatePatternDlg::~SMESHGUI_CreatePatternDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=======================================================================
// purpose : SLOT. Called when state of "Project nodes on ther face"
// checkbox is changed
//=======================================================================
-void SMESHGUI_CreatePatternDlg::onProject (bool)
+void SMESHGUI_CreatePatternDlg::onProject( bool )
{
- loadFromObject(false);
+ loadFromObject( false );
displayPreview();
}
{
myIsLoaded = false;
myType = -1;
- myNbPoints = -1;
mySubMesh = SMESH::SMESH_subMesh::_nil();
myMesh = SMESH::SMESH_Mesh::_nil();
myGeomObj = GEOM::GEOM_Object::_nil();
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
// selection and SMESHGUI
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
- connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ),
+ this, SLOT( onSelectionDone() ) );
+ connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ),
+ this, SLOT( onDeactivate() ) );
+ connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ),
+ this, SLOT( onClose() ) );
- mySwitch2d->setEnabled(theType == Type_2d);
- mySwitch3d->setEnabled(theType == Type_3d);
+ mySwitch2d->setEnabled( theType == Type_2d );
+ mySwitch3d->setEnabled( theType == Type_3d );
- if (theType == Type_2d)
- myProjectChk->show();
- else
- myProjectChk->hide();
+ myTypeGrp->button( theType )->setChecked( true );
+ onTypeChanged( theType );
- myTypeGrp->setButton(theType);
- onTypeChanged(theType);
+ myName->setText( getDefaultName() );
+ myMeshEdit->setText( "" );
- myName->setText(getDefaultName());
- myMeshEdit->setText("");
-
- setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
- qApp->processEvents();
+ QApplication::instance()->processEvents();
updateGeometry();
- myPicture2d->updateGeometry();
- adjustSize();
- resize(minimumSize());
+ resize( minimumSize() );
activateSelection();
onSelectionDone();
- this->show();
+ //show();
}
//=======================================================================
// function : SetMesh()
// purpose : Set mesh to dialog
//=======================================================================
-void SMESHGUI_CreatePatternDlg::SetMesh (SMESH::SMESH_Mesh_ptr thePtr)
+void SMESHGUI_CreatePatternDlg::SetMesh( SMESH::SMESH_Mesh_ptr thePtr )
{
- myMesh = SMESH::SMESH_Mesh::_duplicate(thePtr);
+ myMesh = SMESH::SMESH_Mesh::_duplicate( thePtr );
mySubMesh = SMESH::SMESH_subMesh::_nil();
bool isValidMesh = false;
- if (!myMesh->_is_nil())
- {
- _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in());
+ if ( !myMesh->_is_nil() ) {
+ _PTR(SObject) aSobj = SMESH::FindSObject( myMesh.in() );
//Handle(SALOME_InteractiveObject) anIObj =
// new SALOME_InteractiveObject(aSobj->GetID().c_str(), "SMESH");
- SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str()));
+ SUIT_DataOwnerPtr anIObj( new LightApp_DataOwner( aSobj->GetID().c_str() ) );
- isValidMesh = mySelectionMgr->isOk(anIObj);
+ isValidMesh = mySelectionMgr->isOk( anIObj );
}
- if (isValidMesh) {
- _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
- myMeshEdit->setText(aSO->GetName().c_str());
- myGeomObj = SMESH::GetGeom(aSO);
- } else {
- myMeshEdit->setText("");
+ if ( isValidMesh ) {
+ _PTR(SObject) aSO = SMESH::FindSObject( myMesh.in() );
+ myMeshEdit->setText( aSO->GetName().c_str() );
+ myGeomObj = SMESH::GetGeom( aSO );
+ }
+ else {
+ myMeshEdit->setText( "" );
myGeomObj = GEOM::GEOM_Object::_nil();
}
- if (myType == Type_2d) {
- loadFromObject(false);
+ if ( myType == Type_2d ) {
+ loadFromObject( false );
displayPreview();
}
}
//=======================================================================
bool SMESHGUI_CreatePatternDlg::isValid()
{
- if (myGeomObj->_is_nil()) {
- QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ),
- tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"),
- QMessageBox::Ok);
+ if ( myGeomObj->_is_nil() ) {
+ SUIT_MessageBox::information( this,
+ tr( "SMESH_INSUFFICIENT_DATA" ),
+ tr( "SMESHGUI_INVALID_PARAMETERS" ) );
return false;
}
- else
- return true;
+ return true;
}
//=======================================================================
//=======================================================================
QString SMESHGUI_CreatePatternDlg::getDefaultName() const
{
- return myType == Type_2d ? tr("DEFAULT_2D") : tr("DEFAULT_3D");
+ return myType == Type_2d ? tr( "DEFAULT_2D" ) : tr( "DEFAULT_3D" );
}
//=======================================================================
void SMESHGUI_CreatePatternDlg::onSave()
{
try {
- if (!isValid())
+ if ( !isValid() )
return;
- if (!myIsLoaded)
- loadFromObject(true);
+ if ( !myIsLoaded )
+ loadFromObject( true );
// Load pattern from object
- if (!myIsLoaded)
+ if ( !myIsLoaded )
return;
///////////////////////////////////////////////////////
- SUIT_FileDlg* aDlg = new SUIT_FileDlg (this, false);
- aDlg->setCaption(tr("SAVE_PATTERN"));
- aDlg->setMode(QFileDialog::AnyFile);
- aDlg->setFilters(tr("PATTERN_FILT"));
- if (myName->text() != "")
- aDlg->setSelection(myName->text());
-
- if (aDlg->exec() != Accepted)
+ SUIT_FileDlg* aDlg = new SUIT_FileDlg( this, false );
+ aDlg->setWindowTitle( tr( "SAVE_PATTERN" ) );
+ aDlg->setFileMode( QFileDialog::AnyFile );
+ aDlg->setFilter( tr( "PATTERN_FILT" ) );
+ if ( myName->text() != "" )
+ aDlg->selectFile( myName->text() );
+
+ if ( aDlg->exec() != Accepted )
return;
QString fName = aDlg->selectedFile();
- if (fName.isEmpty())
+ if ( fName.isEmpty() )
return;
- if (QFileInfo(fName).extension().isEmpty())
- fName = autoExtension(fName);
+ if ( QFileInfo( fName ).suffix().isEmpty() )
+ fName = autoExtension( fName );
- fName = QDir::convertSeparators(fName);
+ fName = QDir::convertSeparators( fName );
- QString aData (myPattern->GetString());
+ QString aData( myPattern->GetString() );
long aLen = aData.length();
- QFile aFile (fName);
- aFile.open(IO_WriteOnly);
- long aWritten = aFile.writeBlock(aData, aLen);
+ QFile aFile( fName );
+ aFile.open( QIODevice::WriteOnly );
+ long aWritten = aFile.write( aData.toLatin1(), aLen );
aFile.close();
- if (aWritten != aLen) {
- QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), tr("SMESH_ERROR"),
- tr("ERROR_OF_SAVING"), QMessageBox::Ok);
- } else {
+ if ( aWritten != aLen ) {
+ SUIT_MessageBox::information( this,
+ tr( "SMESH_ERROR" ),
+ tr( "ERROR_OF_SAVING" ) );
+ }
+ else {
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- disconnect(mySelectionMgr, 0, this, 0);
- disconnect(mySMESHGUI, 0, this, 0);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
+ aViewWindow->SetSelectionMode( ActorSelection );
+ disconnect( mySelectionMgr, 0, this, 0 );
+ disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState();
accept();
emit NewPattern();
}
- } catch (const SALOME::SALOME_Exception& S_ex) {
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- } catch (...) {
+ }
+ catch ( const SALOME::SALOME_Exception& S_ex ) {
+ SalomeApp_Tools::QtCatchCorbaException( S_ex );
+ }
+ catch (...) {
}
}
void SMESHGUI_CreatePatternDlg::onOk()
{
try {
- if (!isValid())
+ if ( !isValid() )
return;
- if (!myIsLoaded)
- loadFromObject(true);
+ if ( !myIsLoaded )
+ loadFromObject( true );
// Load pattern from object
- if (!myIsLoaded) {
+ if ( !myIsLoaded ) {
return;
- } else {
+ }
+ else {
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- disconnect(mySelectionMgr, 0, this, 0);
- disconnect(mySMESHGUI, 0, this, 0);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
+ aViewWindow->SetSelectionMode( ActorSelection );
+ disconnect( mySelectionMgr, 0, this, 0 );
+ disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState();
accept();
emit NewPattern();
}
- } catch (const SALOME::SALOME_Exception& S_ex) {
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- } catch (...) {
+ }
+ catch ( const SALOME::SALOME_Exception& S_ex ) {
+ SalomeApp_Tools::QtCatchCorbaException( S_ex );
+ }
+ catch (...) {
}
}
//=======================================================================
void SMESHGUI_CreatePatternDlg::onClose()
{
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- disconnect(mySelectionMgr, 0, this, 0);
- disconnect(mySMESHGUI, 0, this, 0);
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
+ aViewWindow->SetSelectionMode( ActorSelection );
+ disconnect( mySelectionMgr, 0, this, 0 );
+ disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState();
reject();
emit Close();
//=================================================================================
void SMESHGUI_CreatePatternDlg::onHelp()
{
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
+ LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
+ if ( app )
+ app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) : QString( "" ), myHelpFileName );
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning( this,
+ tr( "WRN_WARNING" ),
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ platform ) ).
+ arg( myHelpFileName ) );
}
}
// function : loadFromObject()
// purpose : Load pattern from geom object corresponding to the mesh/submesh
//=======================================================================
-bool SMESHGUI_CreatePatternDlg::loadFromObject (const bool theMess)
+bool SMESHGUI_CreatePatternDlg::loadFromObject( const bool theMess )
{
try {
myIsLoaded = false;
- if (myPattern->_is_nil())
+ if ( myPattern->_is_nil() )
myPattern = SMESH::GetPattern();
- if (myMesh->_is_nil() && mySubMesh->_is_nil() || myGeomObj->_is_nil())
+ if ( myMesh->_is_nil() && mySubMesh->_is_nil() || myGeomObj->_is_nil() )
return false;
SMESH::SMESH_Mesh_ptr aMesh = mySubMesh->_is_nil() ? myMesh.in() : mySubMesh->GetFather();
myIsLoaded = myType == Type_2d
- ? myPattern->LoadFromFace(aMesh, myGeomObj, myProjectChk->isChecked())
- : myPattern->LoadFrom3DBlock(aMesh, myGeomObj);
+ ? myPattern->LoadFromFace( aMesh, myGeomObj, myProjectChk->isChecked() )
+ : myPattern->LoadFrom3DBlock( aMesh, myGeomObj );
- if (!myIsLoaded && theMess) {
+ if ( !myIsLoaded && theMess ) {
QString aMess;
SMESH::SMESH_Pattern::ErrorCode aCode = myPattern->GetErrorCode();
- if (aCode == SMESH::SMESH_Pattern::ERR_LOAD_EMPTY_SUBMESH ) aMess = tr("ERR_LOAD_EMPTY_SUBMESH");
- else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_NARROW_FACE ) aMess = tr("ERR_LOADF_NARROW_FACE");
- else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CLOSED_FACE ) aMess = tr("ERR_LOADF_CLOSED_FACE");
- else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CANT_PROJECT ) aMess = tr("ERR_LOADF_CANT_PROJECT");
- else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_BAD_SHAPE ) aMess = tr("ERR_LOADV_BAD_SHAPE");
- else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_COMPUTE_PARAMS) aMess = tr("ERR_LOADV_COMPUTE_PARAMS");
- else aMess = tr("ERROR_OF_CREATION");
+ if ( aCode == SMESH::SMESH_Pattern::ERR_LOAD_EMPTY_SUBMESH ) aMess = tr( "ERR_LOAD_EMPTY_SUBMESH" );
+ else if ( aCode == SMESH::SMESH_Pattern::ERR_LOADF_NARROW_FACE ) aMess = tr( "ERR_LOADF_NARROW_FACE" );
+ else if ( aCode == SMESH::SMESH_Pattern::ERR_LOADF_CLOSED_FACE ) aMess = tr( "ERR_LOADF_CLOSED_FACE" );
+ else if ( aCode == SMESH::SMESH_Pattern::ERR_LOADF_CANT_PROJECT ) aMess = tr( "ERR_LOADF_CANT_PROJECT" );
+ else if ( aCode == SMESH::SMESH_Pattern::ERR_LOADV_BAD_SHAPE ) aMess = tr( "ERR_LOADV_BAD_SHAPE" );
+ else if ( aCode == SMESH::SMESH_Pattern::ERR_LOADV_COMPUTE_PARAMS ) aMess = tr( "ERR_LOADV_COMPUTE_PARAMS" );
+ else aMess = tr( "ERROR_OF_CREATION" );
- QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ),
- tr("SMESH_ERROR"), aMess, QMessageBox::Ok);
+ SUIT_MessageBox::information( this, tr( "SMESH_ERROR" ), aMess );
}
- } catch (const SALOME::SALOME_Exception& S_ex) {
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ }
+ catch ( const SALOME::SALOME_Exception& S_ex ) {
+ SalomeApp_Tools::QtCatchCorbaException( S_ex );
}
return myIsLoaded;
{
try {
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type());
- if (aList.Extent() != 1)
+ mySelectionMgr->selectedObjects( aList, SVTK_Viewer::Type() );
+ if ( aList.Extent() != 1 )
return;
// Get mesh or sub-mesh from selection
Handle(SALOME_InteractiveObject) anIO = aList.First();
- SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(anIO);
- SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIO);
- if (aMesh->_is_nil() && aSubMesh->_is_nil())
+ SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface<SMESH::SMESH_Mesh>( anIO );
+ SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>( anIO );
+ if ( aMesh->_is_nil() && aSubMesh->_is_nil() )
return;
// Get geom object corresponding to the mesh
_PTR(SObject) aSO;
- if (!aMesh->_is_nil())
- aSO = SMESH::FindSObject(aMesh.in());
+ if ( !aMesh->_is_nil() )
+ aSO = SMESH::FindSObject( aMesh.in() );
else
- aSO = SMESH::FindSObject(aSubMesh.in());
+ aSO = SMESH::FindSObject( aSubMesh.in() );
- GEOM::GEOM_Object_var aGeomObj = SMESH::GetGeom(aSO);
- if (aGeomObj->_is_nil())
+ GEOM::GEOM_Object_var aGeomObj = SMESH::GetGeom( aSO );
+ if ( aGeomObj->_is_nil() )
return;
myGeomObj = aGeomObj;
// init class fields
- if (!aMesh->_is_nil()) {
+ if ( !aMesh->_is_nil() ) {
myMesh = aMesh;
mySubMesh = SMESH::SMESH_subMesh::_nil();
- } else {
+ }
+ else {
mySubMesh = aSubMesh;
myMesh = SMESH::SMESH_Mesh::_nil();
}
QString aName;
- SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aName);
- myMeshEdit->setText(aName);
+ SMESH::GetNameOfSelectedIObjects( mySelectionMgr, aName );
+ myMeshEdit->setText( aName );
- if (myType == Type_2d) {
- loadFromObject(true);
+ if ( myType == Type_2d ) {
+ loadFromObject( true );
displayPreview();
}
- } catch (...) {
+ }
+ catch (...) {
myMesh = SMESH::SMESH_Mesh::_nil();
mySubMesh = SMESH::SMESH_subMesh::_nil();
myGeomObj = GEOM::GEOM_Object::_nil();
//=======================================================================
void SMESHGUI_CreatePatternDlg::onDeactivate()
{
- disconnect(mySelectionMgr, 0, this, 0);
- setEnabled(false);
+ disconnect( mySelectionMgr, 0, this, 0 );
+ setEnabled( false );
}
//=======================================================================
// function : enterEvent()
// purpose : Event filter
//=======================================================================
-void SMESHGUI_CreatePatternDlg::enterEvent (QEvent*)
+void SMESHGUI_CreatePatternDlg::enterEvent( QEvent* )
{
// there is a stange problem that enterEvent() comes after onSave()
if ( isVisible () ) {
mySMESHGUI->EmitSignalDeactivateDialog();
- setEnabled(true);
+ setEnabled( true );
activateSelection();
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
+ connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
}
}
// function : closeEvent()
// purpose : Close dialog box
//=================================================================================
-void SMESHGUI_CreatePatternDlg::closeEvent (QCloseEvent*)
+void SMESHGUI_CreatePatternDlg::closeEvent( QCloseEvent* )
{
onClose();
}
// function : autoExtension()
// purpose : Append extension to the file name
//================================================================
-QString SMESHGUI_CreatePatternDlg::autoExtension (const QString& theFileName) const
+QString SMESHGUI_CreatePatternDlg::autoExtension( const QString& theFileName ) const
{
QString anExt = theFileName.section('.', -1);
return anExt != "smp" && anExt != "SMP" ? theFileName + ".smp" : theFileName;
{
// Redisplay preview in dialog
try {
- if (!myIsLoaded) {
+ if ( !myIsLoaded ) {
erasePreview();
- } else {
+ }
+ else {
SMESH::point_array_var pnts = myPattern->GetPoints();
SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
- SMESH::array_of_long_array_var elemPoints = myPattern->GetElementPoints(false);
+ SMESH::array_of_long_array_var elemPoints = myPattern->GetElementPoints( false );
- if (pnts->length() == 0 ||
- keyPoints->length() == 0 ||
- elemPoints->length() == 0) {
+ if ( pnts->length() == 0 ||
+ keyPoints->length() == 0 ||
+ elemPoints->length() == 0 ) {
myIsLoaded = false;
erasePreview();
return;
}
- PointVector aPoints (pnts->length());
- QValueVector<int> aKeyPoints (keyPoints->length());
- ConnectivityVector anElemPoints (elemPoints->length());
+ PointVector aPoints( pnts->length() );
+ QVector<int> aKeyPoints( keyPoints->length() );
+ ConnectivityVector anElemPoints( elemPoints->length() );
- for (int i = 0, n = pnts->length(); i < n; i++)
+ for ( int i = 0, n = pnts->length(); i < n; i++ )
aPoints[ i ] = pnts[ i ];
- for (int i2 = 0, n2 = keyPoints->length(); i2 < n2; i2++)
+ for ( int i2 = 0, n2 = keyPoints->length(); i2 < n2; i2++ )
aKeyPoints[ i2 ] = keyPoints[ i2 ];
for (int i3 = 0, n3 = elemPoints->length(); i3 < n3; i3++) {
- QValueVector<int> aVec (elemPoints[ i3 ].length());
+ QVector<int> aVec (elemPoints[ i3 ].length());
for (int i4 = 0, n4 = elemPoints[ i3 ].length(); i4 < n4; i4++)
aVec[ i4 ] = elemPoints[ i3 ][ i4 ];
anElemPoints[ i3 ] = aVec;
}
- myPicture2d->SetPoints(aPoints, aKeyPoints, anElemPoints);
+ myPicture2d->SetPoints( aPoints, aKeyPoints, anElemPoints );
}
return;
- } catch (const SALOME::SALOME_Exception& S_ex) {
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- } catch (...) {
+ }
+ catch ( const SALOME::SALOME_Exception& S_ex ) {
+ SalomeApp_Tools::QtCatchCorbaException( S_ex );
+ }
+ catch (...) {
}
erasePreview();
}
void SMESHGUI_CreatePatternDlg::erasePreview()
{
// Erase preview in 2D viewer
- myPicture2d->SetPoints(PointVector(), QValueVector<int>(), ConnectivityVector());
+ myPicture2d->SetPoints( PointVector(), QVector<int>(), ConnectivityVector() );
}
//=======================================================================
{
mySelectionMgr->clearFilters();
//SUIT_Application::getDesktop()->setSelectionModes(ActorSelection);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
-
- if (myType == Type_2d) {
- mySelectionMgr->installFilter(new SMESH_NumberFilter
- ("SMESH", TopAbs_SHAPE, -1, TopAbs_FACE));
- } else {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
+ aViewWindow->SetSelectionMode( ActorSelection );
+
+ if ( myType == Type_2d ) {
+ mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
+ TopAbs_SHAPE,
+ -1,
+ TopAbs_FACE ) );
+ }
+ else {
TColStd_MapOfInteger aTypes;
- aTypes.Add(TopAbs_SHELL);
- aTypes.Add(TopAbs_SOLID);
- mySelectionMgr->installFilter(new SMESH_NumberFilter
- ("SMESH", TopAbs_FACE, 6, aTypes, GEOM::GEOM_Object::_nil(), true));
+ aTypes.Add( TopAbs_SHELL );
+ aTypes.Add( TopAbs_SOLID );
+ mySelectionMgr->installFilter( new SMESH_NumberFilter( "SMESH",
+ TopAbs_FACE,
+ 6,
+ aTypes,
+ GEOM::GEOM_Object::_nil(),
+ true ) );
}
}
// purpose : SLOT. Called when pattern type changed.
// Change dialog's look and feel
//=======================================================================
-void SMESHGUI_CreatePatternDlg::onTypeChanged (int theType)
+void SMESHGUI_CreatePatternDlg::onTypeChanged( int theType )
{
- if (myType == theType)
+ if ( myType == theType )
return;
myType = theType;
- if (theType == Type_2d)
- myPicture2d->show();
- else
- myPicture2d->hide();
+ myPicture2d->setVisible( theType == Type_2d );
+ myProjectChk->setVisible( theType == Type_2d );
}
//=================================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ){
+ e->accept();
+ onHelp();
+ }
}
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_CreatePatternDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_CreatePatternDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-#ifndef SMESHGUI_CreatePatternDlg_H
-#define SMESHGUI_CreatePatternDlg_H
+#ifndef SMESHGUI_CREATEPATTERNDLG_H
+#define SMESHGUI_CREATEPATTERNDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
-// IDL Headers
+// IDL includes
#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Pattern)
class SMESHGUI_PatternWidget;
class SALOMEDSClient_SObject;
-class QCloseEvent;
-class QFrame;
class QLineEdit;
-class SMESHGUI_SpinBox;
-class QPushButton;
-class LightApp_SelectionMgr;
class QRadioButton;
class QCheckBox;
class QButtonGroup;
-class QLabel;
-class SVTK_ViewWindow;
class SVTK_Selector;
+class LightApp_SelectionMgr;
class SMESHGUI;
/*!
enum { Type_2d, Type_3d };
public:
- SMESHGUI_CreatePatternDlg( SMESHGUI*,
- const int,
- const char* = 0);
- virtual ~SMESHGUI_CreatePatternDlg();
+ SMESHGUI_CreatePatternDlg( SMESHGUI*, const int );
+ virtual ~SMESHGUI_CreatePatternDlg();
- void Init(const int);
+ void Init( const int );
QString GetPatternName() const;
SMESH::SMESH_Pattern_ptr GetPattern();
- void SetMesh (SMESH::SMESH_Mesh_ptr);
+ void SetMesh( SMESH::SMESH_Mesh_ptr );
signals:
-
void NewPattern();
void Close();
private:
-
- void closeEvent (QCloseEvent* e);
- void enterEvent (QEvent*);
- void keyPressEvent(QKeyEvent*);
-
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void keyPressEvent( QKeyEvent* );
+
private slots:
-
void onOk();
void onSave();
void onClose();
void onDeactivate();
void onSelectionDone();
- void onTypeChanged (int);
- void onProject (bool);
+ void onTypeChanged( int );
+ void onProject( bool );
void onSelBtnClicked();
private:
-
- QFrame* createButtonFrame (QWidget*);
- QFrame* createMainFrame (QWidget*);
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame( QWidget* );
void displayPreview();
void erasePreview();
void activateSelection();
- QString autoExtension (const QString& theFileName) const;
+ QString autoExtension( const QString& ) const;
bool isValid();
- bool loadFromObject (const bool = true);
+ bool loadFromObject( const bool = true );
QString getDefaultName() const;
- GEOM::GEOM_Object_ptr getGeom (SALOMEDSClient_SObject*) const;
+ GEOM::GEOM_Object_ptr getGeom( SALOMEDSClient_SObject* ) const;
private:
-
- QPushButton* myOkBtn;
- QPushButton* mySaveBtn;
- QPushButton* myCloseBtn;
- QPushButton* myHelpBtn;
-
QButtonGroup* myTypeGrp;
QRadioButton* mySwitch2d;
QRadioButton* mySwitch3d;
- QRadioButton* mySwitchSMESH_Pattern3d;
QLineEdit* myMeshEdit;
QLineEdit* myName;
SMESHGUI* mySMESHGUI;
SVTK_Selector* mySelector;
LightApp_SelectionMgr* mySelectionMgr;
- int myNbPoints;
int myType;
SMESH::SMESH_Mesh_var myMesh;
QString myHelpFileName;
};
-#endif
+#endif // SMESHGUI_CREATEPATTERNDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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) 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 : SMESHGUI_CreatePolyhedralVolumeDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_CreatePolyhedralVolumeDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_CreatePolyhedralVolumeDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_ActorUtils.h"
-#include "SMESHGUI_SpinBox.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMDS_Mesh.hxx"
-
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-
-#include "SalomeApp_Application.h"
-#include "SalomeApp_Study.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
-#include "LightApp_Application.h"
-#include "LightApp_SelectionMgr.h"
-#include "utilities.h"
-
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-
-#include <TColStd_MapIteratorOfMapOfInteger.hxx>
+
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+#include <SMDS_Mesh.hxx>
+
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ViewManager.h>
+
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <SVTK_ViewWindow.h>
+
+// OCCT includes
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
+// VTK includes
#include <vtkCell.h>
#include <vtkIdList.h>
-#include <vtkIntArray.h>
-#include <vtkCellArray.h>
-#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qspinbox.h>
-#include <qpixmap.h>
-#include <qlistbox.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SMESH_Group)
+// Qt includes
+#include <QApplication>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QListWidget>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
-
-namespace SMESH{
+#define SPACING 6
+#define MARGIN 11
-class TPolySimulation{
+namespace SMESH
+{
+ class TPolySimulation
+ {
SVTK_ViewWindow* myViewWindow;
SALOME_Actor *myPreviewActor;
~TPolySimulation(){
- if( myViewWindow )
- myViewWindow->RemoveActor(myPreviewActor);
+ if( myViewWindow )
+ myViewWindow->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
// class : SMESHGUI_CreatePolyhedralVolumeDlgDlg()
// purpose :
//=================================================================================
-SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl )
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
+SMESHGUI_CreatePolyhedralVolumeDlg::SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH",tr("ICON_SELECT")));
- if ( !name )
- setName( "SMESHGUI_CreatePolyhedralVolumeDlg" );
- resize( 300, 185 );
- setCaption( tr( "SMESH_CREATE_POLYHEDRAL_VOLUME_TITLE" ) );
- setSizeGripEnabled( TRUE );
- SMESHGUI_CreatePolyhedralVolumeDlgLayout = new QGridLayout( this );
- SMESHGUI_CreatePolyhedralVolumeDlgLayout->setSpacing( 6 );
- SMESHGUI_CreatePolyhedralVolumeDlgLayout->setMargin( 11 );
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle( tr( "SMESH_CREATE_POLYHEDRAL_VOLUME_TITLE" ) );
+ setSizeGripEnabled( true );
- /***************************************************************/
- GroupConstructors = new QButtonGroup( this, "GroupConstructors" );
- GroupConstructors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth() ) );
- GroupConstructors->setTitle( tr( "SMESH_ELEMENTS_TYPE" ) );
- GroupConstructors->setExclusive( TRUE );
- GroupConstructors->setColumnLayout(0, Qt::Vertical );
- GroupConstructors->layout()->setSpacing( 0 );
- GroupConstructors->layout()->setMargin( 0 );
- GroupConstructorsLayout = new QGridLayout( GroupConstructors->layout() );
- GroupConstructorsLayout->setAlignment( Qt::AlignTop );
- GroupConstructorsLayout->setSpacing( 6 );
- GroupConstructorsLayout->setMargin( 11 );
- RadioButton1= new QRadioButton( GroupConstructors, "RadioButton1" );
- RadioButton1->setText( tr( "MESH_NODE" ) );
- GroupConstructorsLayout->addWidget( RadioButton1, 0, 0 );
- RadioButton2= new QRadioButton( GroupConstructors, "RadioButton2" );
- RadioButton2->setText( tr( "SMESH_FACE" ) );
- GroupConstructorsLayout->addWidget( RadioButton2, 0, 2 );
- SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupConstructors, 0, 0 );
-
- /***************************************************************/
- GroupButtons = new QGroupBox( this, "GroupButtons" );
- GroupButtons->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth() ) );
- GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
- GroupButtons->setTitle( tr( "" ) );
- GroupButtons->setColumnLayout(0, Qt::Vertical );
- GroupButtons->layout()->setSpacing( 0 );
- GroupButtons->layout()->setMargin( 0 );
- GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( 6 );
- GroupButtonsLayout->setMargin( 11 );
- buttonCancel = new QPushButton( GroupButtons, "cancel" );
- buttonCancel->setText( tr( "SMESH_BUT_CLOSE" ) );
- buttonCancel->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonCancel, 0, 3 );
- buttonApply = new QPushButton( GroupButtons, "apply" );
- buttonApply->setText( tr( "SMESH_BUT_APPLY" ) );
- buttonApply->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonApply, 0, 1 );
- QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- GroupButtonsLayout->addItem( spacer_9, 0, 2 );
- buttonOk = new QPushButton( GroupButtons, "ok" );
- buttonOk->setText( tr( "SMESH_BUT_OK" ) );
- buttonOk->setAutoDefault( TRUE );
- buttonOk->setDefault( TRUE );
- GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
-
- SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupButtons, 2, 0 );
+ QVBoxLayout* topLayout = new QVBoxLayout( this );
+ topLayout->setSpacing( SPACING );
+ topLayout->setMargin( MARGIN );
/***************************************************************/
- GroupContent = new QGroupBox( this, "GroupContent" );
- GroupContent->setTitle( tr( "SMESH_CONTENT" ) );
- GroupContent->setColumnLayout(0, Qt::Vertical );
- GroupContent->layout()->setSpacing( 0 );
- GroupContent->layout()->setMargin( 0 );
- GroupContentLayout = new QGridLayout( GroupContent->layout() );
- GroupContentLayout->setAlignment( Qt::AlignTop );
- GroupContentLayout->setSpacing( 6 );
- GroupContentLayout->setMargin( 11 );
-
- QFrame* anIds = new QFrame(GroupContent, "anIds");
- QGridLayout* aLayout = new QGridLayout(anIds, 1, 3);
- aLayout->setSpacing(6);
- aLayout->setAutoAdd(false);
+ ConstructorsBox = new QGroupBox(tr( "SMESH_ELEMENTS_TYPE" ), this);
+ GroupConstructors = new QButtonGroup(this);
+ QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout( ConstructorsBox );
+ ConstructorsBoxLayout->setSpacing( SPACING );
+ ConstructorsBoxLayout->setMargin( MARGIN );
+
+ RadioButton1 = new QRadioButton( tr( "MESH_NODE" ), ConstructorsBox );
+ RadioButton2 = new QRadioButton( tr( "SMESH_FACE" ), ConstructorsBox );
+
+ ConstructorsBoxLayout->addWidget( RadioButton1 );
+ ConstructorsBoxLayout->addWidget( RadioButton2 );
+ GroupConstructors->addButton(RadioButton1, 0);
+ GroupConstructors->addButton(RadioButton2, 1);
- TextLabelIds = new QLabel( anIds, "TextLabelIds" );
- TextLabelIds->setText( tr( "SMESH_ID_NODES" ) );
- TextLabelIds->setFixedWidth(74);
- aLayout->addWidget( TextLabelIds, 0, 0 );
-
- SelectElementsButton = new QPushButton( anIds, "SelectElementsButton" );
- SelectElementsButton->setText( tr( "" ) );
- SelectElementsButton->setPixmap( image0 );
- SelectElementsButton->setToggleButton( FALSE );
- aLayout->addWidget( SelectElementsButton, 0, 1 );
-
- LineEditElements = new QLineEdit( anIds, "LineEditElements" );
- LineEditElements->setValidator( new SMESHGUI_IdValidator( this, "validator" ));
- aLayout->addWidget( LineEditElements, 0, 2 );
+ /***************************************************************/
+ GroupContent = new QGroupBox( tr( "SMESH_CONTENT" ), this );
+ QGridLayout* GroupContentLayout = new QGridLayout( GroupContent );
+ GroupContentLayout->setSpacing( SPACING );
+ GroupContentLayout->setMargin( MARGIN );
- GroupContentLayout->addMultiCellWidget(anIds, 0, 0, 0, 1);
-
- myFacesByNodesLabel = new QLabel(GroupContent, "faces by nodes label");
- myFacesByNodesLabel->setText(tr("FACES_BY_NODES"));
- GroupContentLayout->addWidget( myFacesByNodesLabel, 1, 0 );
-
- myFacesByNodes = new QListBox(GroupContent, "faces by nodes list");
- myFacesByNodes->setSelectionMode(QListBox::Extended);
- myFacesByNodes->setMinimumHeight(150);
- GroupContentLayout->addMultiCellWidget( myFacesByNodes, 2, 4, 0, 0 );
+ TextLabelIds = new QLabel( tr( "SMESH_ID_NODES" ), GroupContent );
+ SelectElementsButton = new QPushButton( GroupContent );
+ SelectElementsButton->setIcon( image0 );
+ LineEditElements = new QLineEdit( GroupContent );
+ LineEditElements->setValidator( new SMESHGUI_IdValidator( this ) );
+
+ myFacesByNodesLabel = new QLabel( tr( "FACES_BY_NODES" ), GroupContent );
+ myFacesByNodes = new QListWidget( GroupContent);
+ myFacesByNodes->setSelectionMode( QListWidget::ExtendedSelection );
+ myFacesByNodes->setMinimumHeight( 150);
+
+ AddButton = new QPushButton( tr( "SMESH_BUT_ADD" ), GroupContent );
+ RemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), GroupContent );
+
+ Preview = new QCheckBox( tr( "SMESH_POLYEDRE_PREVIEW" ), GroupContent );
+
+ GroupContentLayout->addWidget( TextLabelIds, 0, 0 );
+ GroupContentLayout->addWidget( SelectElementsButton, 0, 1 );
+ GroupContentLayout->addWidget( LineEditElements, 0, 2, 1, 2 );
+ GroupContentLayout->addWidget( myFacesByNodesLabel, 1, 0 );
+ GroupContentLayout->addWidget( myFacesByNodes, 2, 0, 3, 3 );
+ GroupContentLayout->addWidget( AddButton, 2, 3 );
+ GroupContentLayout->addWidget( RemoveButton, 3, 3 );
+ GroupContentLayout->addWidget( Preview, 5, 0, 1, 4 );
- AddButton = new QPushButton(GroupContent, "add");
- AddButton->setText(tr("SMESH_BUT_ADD"));
- AddButton->setMaximumWidth(85);
- GroupContentLayout->addWidget( AddButton, 2, 1 );
-
- RemoveButton = new QPushButton(GroupContent, "remove");
- RemoveButton->setText(tr("SMESH_BUT_REMOVE"));
- RemoveButton->setMaximumWidth(85);
- GroupContentLayout->addWidget( RemoveButton, 3, 1 );
-
- Preview = new QCheckBox( GroupContent, "Preview" );
- Preview->setText( tr( "SMESH_POLYEDRE_PREVIEW" ) );
- GroupContentLayout->addWidget( Preview , 5, 0 );
+ /***************************************************************/
+ GroupButtons = new QGroupBox( this );
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
+ GroupButtonsLayout->setSpacing( SPACING );
+ GroupButtonsLayout->setMargin( MARGIN );
+
+ buttonOk = new QPushButton( tr( "SMESH_BUT_OK" ), GroupButtons );
+ buttonOk->setAutoDefault( true );
+ buttonOk->setDefault( true );
+ buttonApply = new QPushButton( tr( "SMESH_BUT_APPLY" ), GroupButtons );
+ buttonApply->setAutoDefault( true );
+ buttonCancel = new QPushButton( tr( "SMESH_BUT_CLOSE" ), GroupButtons );
+ buttonCancel->setAutoDefault( true );
+ buttonHelp = new QPushButton( tr("SMESH_BUT_HELP" ), GroupButtons );
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget( buttonOk );
+ GroupButtonsLayout->addSpacing( 10 );
+ GroupButtonsLayout->addWidget( buttonApply );
+ GroupButtonsLayout->addSpacing( 10 );
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget( buttonCancel );
+ GroupButtonsLayout->addWidget( buttonHelp);
- mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
+ /***************************************************************/
+ topLayout->addWidget( ConstructorsBox );
+ topLayout->addWidget( GroupContent );
+ topLayout->addWidget( GroupButtons );
- SMESHGUI_CreatePolyhedralVolumeDlgLayout->addWidget( GroupContent, 1, 0 );
+ mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
- GroupContent->show();
- RadioButton1->setChecked( TRUE );
+ RadioButton1->setChecked( true );
- mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
+ mySMESHGUI->SetActiveDialogBox( (QDialog*)this );
myHelpFileName = "adding_nodes_and_elements_page.html#adding_polyhedrons_anchor";
//=================================================================================
SMESHGUI_CreatePolyhedralVolumeDlg::~SMESHGUI_CreatePolyhedralVolumeDlg()
{
- // no need to delete child widgets, Qt does it all for us
delete mySimulation;
}
static bool busy = false;
+
//=================================================================================
// function : Init()
// purpose :
void SMESHGUI_CreatePolyhedralVolumeDlg::Init()
{
myEditCurrentArgument = LineEditElements;
- mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
+ mySMESHGUI->SetActiveDialogBox( (QDialog*)this );
myNbOkElements = 0;
myActor = 0;
mySimulation = new SMESH::TPolySimulation( dynamic_cast<SalomeApp_Application*>( mySMESHGUI->application() ) );
/* signals and slots connections */
- connect(buttonOk, SIGNAL( clicked() ), SLOT( ClickOnOk() ) );
- connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) ) ;
- connect(buttonApply, SIGNAL( clicked() ), SLOT(ClickOnApply() ) );
- connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp() ) );
+ connect(buttonOk, SIGNAL( clicked() ), SLOT( ClickOnOk() ) );
+ connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) );
+ connect(buttonApply, SIGNAL( clicked() ), SLOT( ClickOnApply() ) );
+ connect(buttonHelp, SIGNAL( clicked() ), SLOT( ClickOnHelp() ) );
- connect( GroupConstructors, SIGNAL(clicked(int) ), SLOT( ConstructorsClicked(int) ) );
- connect(SelectElementsButton, SIGNAL( clicked() ), SLOT( SetEditCurrentArgument() ) ) ;
+ connect(GroupConstructors, SIGNAL(buttonClicked(int) ), SLOT( ConstructorsClicked(int) ) );
+ connect(SelectElementsButton, SIGNAL( clicked() ), SLOT( SetEditCurrentArgument() ) );
connect(LineEditElements, SIGNAL( textChanged(const QString&) ), SLOT(onTextChange(const QString&)));
connect(myFacesByNodes, SIGNAL(selectionChanged()), this, SLOT(onListSelectionChanged()));
connect(AddButton, SIGNAL(clicked()), this, SLOT(onAdd()));
connect(RemoveButton, SIGNAL(clicked()), this, SLOT(onRemove()));
- connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ) ;
+ connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
/* to close dialog if study change */
- connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ) ;
+ connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
- this->show() ; /* displays Dialog */
-
ConstructorsClicked(0);
SelectionIntoArgument();
}
//connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
mySelectionMgr->setSelectedObjects( io );
+
+ QApplication::instance()->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
}
//=================================================================================
TColStd_ListOfInteger aNodesIds;
- QListBoxItem* anItem;
int aNbQuantities = 0;
- for (anItem = myFacesByNodes->firstItem(); anItem != 0; anItem = anItem->next()) {
- QStringList anIds = QStringList::split(" ", anItem->text());
- int aNbNodesInFace = 0;
- for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it, ++aNbNodesInFace)
+ for (int i = 0; i < myFacesByNodes->count(); i++ ) {
+ QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
+ for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
aNodesIds.Append( (*it).toInt() );
- aQuantities[aNbQuantities++] = aNbNodesInFace;
+ aQuantities[aNbQuantities++] = anIds.count();
}
anIdsOfNodes->length(aNodesIds.Extent());
int aNbIdsOfNodes = 0;
TColStd_ListIteratorOfListOfInteger It;
It.Initialize(aNodesIds);
- for(;It.More();It.Next())
+ for( ;It.More();It.Next())
anIdsOfNodes[aNbIdsOfNodes++] = It.Value();
try{
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
aMeshEditor->AddPolyhedralVolume(anIdsOfNodes, aQuantities);
QApplication::restoreOverrideCursor();
}catch(SALOME::SALOME_Exception& exc){
{
SMESH::long_array_var anIdsOfFaces = new SMESH::long_array;
- QStringList aListId = QStringList::split( " ", myEditCurrentArgument->text() );
+ QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
anIdsOfFaces->length(aListId.count());
for ( int i = 0; i < aListId.count(); i++ )
anIdsOfFaces[i] = aListId[i].toInt();
try{
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
aMeshEditor->AddPolyhedralVolumeByFaces(anIdsOfFaces);
QApplication::restoreOverrideCursor();
}catch(SALOME::SALOME_Exception& exc){
void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnOk()
{
if(checkEditLine(false) == -1) {return;}
- ClickOnApply() ;
- ClickOnCancel() ;
+ ClickOnApply();
+ ClickOnCancel();
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 );
- mySMESHGUI->ResetState() ;
- reject() ;
+ mySMESHGUI->ResetState();
+ reject();
}
//=================================================================================
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
aMesh = myActor->GetObject()->GetMesh();
if (GetConstructorId() == 0)
- {
- if ( aMesh ) {
- TColStd_MapOfInteger newIndices;
+ {
+ if ( aMesh ) {
+ TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split( " ", theNewText, false);
- for ( int i = 0; i < aListId.count(); i++ ) {
- const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
- if ( n ) {
- newIndices.Add(n->GetID());
- myNbOkElements++;
- }
- }
+ QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts );
+ for ( int i = 0; i < aListId.count(); i++ ) {
+ const SMDS_MeshNode * n = aMesh->FindNode( aListId[ i ].toInt() );
+ if ( n ) {
+ newIndices.Add(n->GetID());
+ myNbOkElements++;
+ }
+ }
- mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+ mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( myActor->getIO(), true, true );
- if ( myNbOkElements>0 && aListId.count()>=3)
- AddButton->setEnabled(true);
- else
- AddButton->setEnabled(false);
+ if ( myNbOkElements>0 && aListId.count()>=3)
+ AddButton->setEnabled(true);
+ else
+ AddButton->setEnabled(false);
- displaySimulation();
- }
- } else if (GetConstructorId() == 1)
- {
- myNbOkElements = 0;
- buttonOk->setEnabled( false );
- buttonApply->setEnabled( false );
+ displaySimulation();
+ }
+ } else if (GetConstructorId() == 1)
+ {
+ myNbOkElements = 0;
+ buttonOk->setEnabled( false );
+ buttonApply->setEnabled( false );
- // check entered ids of faces and hilight them
- QStringList aListId;
- if ( aMesh ) {
- TColStd_MapOfInteger newIndices;
+ // check entered ids of faces and hilight them
+ QStringList aListId;
+ if ( aMesh ) {
+ TColStd_MapOfInteger newIndices;
- aListId = QStringList::split( " ", theNewText, false);
+ aListId = theNewText.split( " ", QString::SkipEmptyParts );
- for ( int i = 0; i < aListId.count(); i++ ) {
- const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
- if ( e ) {
- newIndices.Add(e->GetID());
- myNbOkElements++;
- }
- }
+ for ( int i = 0; i < aListId.count(); i++ ) {
+ const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() );
+ if ( e ) {
+ newIndices.Add(e->GetID());
+ myNbOkElements++;
+ }
+ }
- mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->highlight( myActor->getIO(), true, true );
+ mySelector->AddOrRemoveIndex( myActor->getIO(), newIndices, false );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->highlight( myActor->getIO(), true, true );
- if ( myNbOkElements ) {
- if (aListId.count()>1){
- buttonOk->setEnabled( true );
- buttonApply->setEnabled( true );
- }
- else{
- buttonOk->setEnabled( false );
- buttonApply->setEnabled( false );
+ if ( myNbOkElements ) {
+ if (aListId.count()>1){
+ buttonOk->setEnabled( true );
+ buttonApply->setEnabled( true );
+ }
+ else{
+ buttonOk->setEnabled( false );
+ buttonApply->setEnabled( false );
+ }
+ if(aListId.count()>1)
+ displaySimulation();
+ }
}
- if(aListId.count()>1)
- displaySimulation();
}
- }
- }
busy = false;
}
// checking for nodes
if (checkLast && myEditCurrentArgument->text().right(1) != QString(" ") ) return 1;
- QStringList aListId = QStringList::split( " ", myEditCurrentArgument->text() );
+ QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < aListId.count(); i++ ){
switch (GetConstructorId()){
case 0:{ // nodes
const SMDS_MeshNode * aNode = aMesh->FindNode( aListId[ i ].toInt() );
if( !aNode ){
- std::string aWarning;
- aWarning = "The incorrect indices of nodes!";
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- QObject::tr("SMESH_POLYEDRE_CREATE_ERROR"),
- QObject::tr(aWarning.c_str()),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_POLYEDRE_CREATE_ERROR"),
+ tr("The incorrect indices of nodes!"));
myEditCurrentArgument->clear();
myEditCurrentArgument->setText( aString );
}
}
if (!aElemIsOK){
- std::string aWarning;
- aWarning = "The incorrect indices of faces!";
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- QObject::tr("SMESH_POLYEDRE_CREATE_ERROR"),
- QObject::tr(aWarning.c_str()),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_POLYEDRE_CREATE_ERROR"),
+ tr("The incorrect indices of faces!"));
myEditCurrentArgument->clear();
myEditCurrentArgument->setText( aString );
if ( (myNbOkElements || AddButton->isEnabled()) && GroupButtons->isEnabled() && myActor)
{
SMESH::TPolySimulation::TVTKIds aVTKIds;
- vtkIdType aType = VTK_CONVEX_POINT_SET ;
+ vtkIdType aType = VTK_CONVEX_POINT_SET;
SMDS_Mesh* aMesh = 0;
if ( myActor ){
aMesh = myActor->GetObject()->GetMesh();
}
if (GetConstructorId() == 0 && aMesh){
if (!AddButton->isEnabled()){
- QListBoxItem* anItem;
mySimulation->ResetGrid(true);
- for (anItem = myFacesByNodes->firstItem(); anItem != 0; anItem = anItem->next()) {
- QStringList anIds = QStringList::split(" ", anItem->text());
+ for (int i = 0; i < myFacesByNodes->count(); i++) {
+ QStringList anIds = myFacesByNodes->item(i)->text().split( " ", QString::SkipEmptyParts );
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it){
- const SMDS_MeshNode * aNode = aMesh->FindNode( (*it).toInt() );
+ const SMDS_MeshNode* aNode = aMesh->FindNode( (*it).toInt() );
if (!aNode) continue;
- vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() ) ;
+ vtkIdType aId = myActor->GetObject()->GetNodeVTKId( (*it).toInt() );
aVTKIds.push_back(aId);
aVTKIds_faces.push_back(aId);
}
}
} else {
// add ids from edit line
- QStringList anEditIds = QStringList::split( " ", myEditCurrentArgument->text(), false);
+ QStringList anEditIds = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < anEditIds.count(); i++ )
aVTKIds.push_back( myActor->GetObject()->GetNodeVTKId( anEditIds[ i ].toInt() ));
aType = VTK_POLYGON;
mySimulation->SetPosition(myActor, aType, aVTKIds);
}
}else if(GetConstructorId() == 1 && aMesh){
- QStringList aListId = QStringList::split( " ", myEditCurrentArgument->text(), false);
+ QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts );
for ( int i = 0; i < aListId.count(); i++ )
{
const SMDS_MeshElement * anElem = aMesh->FindElement( aListId[ i ].toInt() );
SMDS_ElemIteratorPtr anIter = anElem->nodesIterator();
SMESH::TPolySimulation::TVTKIds aVTKIds_faces;
while( anIter->more() )
- if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
- vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() ) ;
- aVTKIds.push_back(aId);
- aVTKIds_faces.push_back(aId);
- }
+ if ( const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next() ){
+ vtkIdType aId = myActor->GetObject()->GetNodeVTKId( aNode->GetID() );
+ aVTKIds.push_back(aId);
+ aVTKIds_faces.push_back(aId);
+ }
if(!Preview->isChecked()){
aType = VTK_POLYGON;
mySimulation->SetPosition(myActor, aType, aVTKIds_faces);
{
QPushButton* send = (QPushButton*)sender();
if(send == SelectElementsButton) {
- LineEditElements->setFocus() ;
+ LineEditElements->setFocus();
myEditCurrentArgument = LineEditElements;
}
SelectionIntoArgument();
//=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::DeactivateActiveDialog()
{
- if ( GroupConstructors->isEnabled() ) {
- GroupConstructors->setEnabled(false) ;
- GroupContent->setEnabled(false) ;
- GroupButtons->setEnabled(false) ;
+ if ( ConstructorsBox->isEnabled() ) {
+ ConstructorsBox->setEnabled(false);
+ GroupContent->setEnabled(false);
+ GroupButtons->setEnabled(false);
mySimulation->SetVisibility(false);
- mySMESHGUI->ResetState() ;
- mySMESHGUI->SetActiveDialogBox(0) ;
+ mySMESHGUI->ResetState();
+ mySMESHGUI->SetActiveDialogBox(0);
}
}
void SMESHGUI_CreatePolyhedralVolumeDlg::ActivateThisDialog()
{
/* Emit a signal to deactivate the active dialog */
- mySMESHGUI->EmitSignalDeactivateDialog() ;
- GroupConstructors->setEnabled(true) ;
- GroupContent->setEnabled(true) ;
- GroupButtons->setEnabled(true) ;
+ mySMESHGUI->EmitSignalDeactivateDialog();
+ ConstructorsBox->setEnabled(true);
+ GroupContent->setEnabled(true);
+ GroupButtons->setEnabled(true);
- mySMESHGUI->SetActiveDialogBox( (QDialog*)this ) ;
+ mySMESHGUI->SetActiveDialogBox( (QDialog*)this );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( FaceSelection );
//=================================================================================
void SMESHGUI_CreatePolyhedralVolumeDlg::enterEvent(QEvent* e)
{
- if ( GroupConstructors->isEnabled() )
- return ;
- ActivateThisDialog() ;
+ if ( ConstructorsBox->isEnabled() )
+ return;
+ ActivateThisDialog();
}
void SMESHGUI_CreatePolyhedralVolumeDlg::closeEvent( QCloseEvent* e )
{
/* same than click on cancel button */
- this->ClickOnCancel() ;
+ ClickOnCancel();
}
//=================================================================================
int SMESHGUI_CreatePolyhedralVolumeDlg::GetConstructorId()
{
- if ( GroupConstructors != NULL && GroupConstructors->selected() != NULL )
- return GroupConstructors->id( GroupConstructors->selected() );
- return -1;
+ return GroupConstructors->checkedId();
}
//=================================================================================
int aNbSel = selected.Extent();
if (aNbSel == 0 || !myActor || myMesh->_is_nil()) return;
- if (this->checkEditLine(false) == -1) return;
+ if (checkEditLine(false) == -1) return;
busy = true;
if ( !(myEditCurrentArgument->text().isEmpty()) )
{
- myFacesByNodes->insertItem(myEditCurrentArgument->text());
+ myFacesByNodes->addItem(myEditCurrentArgument->text());
//myFacesByNodes->setSelected(myFacesByNodes->count() - 1, true);
myNbOkElements = 1;
myEditCurrentArgument->clear();
void SMESHGUI_CreatePolyhedralVolumeDlg::onRemove()
{
busy = true;
- for (int i = myFacesByNodes->count(); i > 0; i--) {
- if (myFacesByNodes->isSelected(i-1)) {
- myFacesByNodes->removeItem(i-1);
- myNbOkElements = 1;
- }
- }
- if (myFacesByNodes->count() < 1){
- RemoveButton->setEnabled(false);
- buttonOk->setEnabled( false );
- buttonApply->setEnabled( false );
- }
- else if (myFacesByNodes->count() == 1){
- buttonOk->setEnabled( false );
- buttonApply->setEnabled( false );
- }
+ QList<QListWidgetItem*> selItems = myFacesByNodes->selectedItems();
+ QListWidgetItem* anItem;
+
+ if ( selItems.count() > 0 ) myNbOkElements = 1;
+
+ foreach( anItem, selItems )
+ delete anItem;
+
+ RemoveButton->setEnabled( myFacesByNodes->count() > 0 );
+ buttonOk->setEnabled( myFacesByNodes->count() > 1 );
+ buttonApply->setEnabled( myFacesByNodes->count() > 1 );
+
busy = false;
displaySimulation();
}
{
if (busy || !myActor) return;
busy = true;
- bool isSelected=false;
+
SALOME_ListIO aList;
mySelectionMgr->setSelectedObjects( aList );
TColStd_MapOfInteger aIndexes;
- QListBoxItem* anItem;
- for (anItem = myFacesByNodes->firstItem(); anItem != 0; anItem = anItem->next()) {
- if (anItem->isSelected()) {
- isSelected = true;
- QStringList anIds = QStringList::split(" ", anItem->text());
- for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
- aIndexes.Add((*it).toInt());
- }
+
+ QList<QListWidgetItem*> selItems = myFacesByNodes->selectedItems();
+ QListWidgetItem* anItem;
+ foreach( anItem, selItems ) {
+ QStringList anIds = anItem->text().split( " ", QString::SkipEmptyParts );
+ for (QStringList::iterator it = anIds.begin(); it != anIds.end(); ++it)
+ aIndexes.Add((*it).toInt());
}
- if(isSelected) RemoveButton->setEnabled(true);
- else RemoveButton->setEnabled(false);
+ RemoveButton->setEnabled(selItems.count() > 0);
mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, true );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->highlight( myActor->getIO(), true, true );
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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) 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 : SMESHGUI_CreatePolyhedralVolumeDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_CreatePolyhedralVolumeDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_CREATEPOLYHEDRAL_H
-#define DIALOGBOX_CREATEPOLYHEDRAL_H
+#ifndef SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H
+#define SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-// QT Includes
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
class QButtonGroup;
class QGroupBox;
-class QListBox;
+class QListWidget;
class QLabel;
class QLineEdit;
class QPushButton;
class SMESHGUI;
class SMESH_Actor;
class SVTK_Selector;
-class SVTK_ViewWindow;
class LightApp_SelectionMgr;
-namespace SMESH{
+namespace SMESH
+{
struct TPolySimulation;
}
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
//=================================================================================
// class : SMESHGUI_CreatePolyhedralVolumeDlg
// purpose :
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_CreatePolyhedralVolumeDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI*, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~SMESHGUI_CreatePolyhedralVolumeDlg();
+ SMESHGUI_CreatePolyhedralVolumeDlg( SMESHGUI* );
+ ~SMESHGUI_CreatePolyhedralVolumeDlg();
private:
-
- void Init() ;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
- void hideEvent ( QHideEvent * ); /* ESC key */
- void keyPressEvent( QKeyEvent* e );
- int GetConstructorId();
- void displaySimulation();
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ int GetConstructorId();
+ void displaySimulation();
- int checkEditLine(bool checkLast=true); /*! Checking for indices, return 1 if all ok, esle -1*/
+ int checkEditLine( bool = true ); /*! Checking for indices, return 1 if all ok, esle -1*/
- SMESHGUI* mySMESHGUI ; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr ; /* User shape selection */
- SVTK_Selector* mySelector;
- QString myIDs;
- int myNbOkElements ; /* to check when elements are defined */
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ SVTK_Selector* mySelector;
+ QString myIDs;
+ int myNbOkElements; /* to check when elements are defined */
- QLineEdit* myEditCurrentArgument;
+ QLineEdit* myEditCurrentArgument;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
- SMESH::TPolySimulation* mySimulation;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton1;
- QRadioButton* RadioButton2;
- QCheckBox* Preview;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupContent;
- QLabel* TextLabelIds;
- QPushButton* SelectElementsButton;
- QLineEdit* LineEditElements;
- QListBox* myFacesByNodes;
- QLabel* myFacesByNodesLabel;
- QPushButton* AddButton;
- QPushButton* RemoveButton;
-
- QString myHelpFileName;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH::TPolySimulation* mySimulation;
+
+ QGroupBox* ConstructorsBox;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QCheckBox* Preview;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupContent;
+ QLabel* TextLabelIds;
+ QPushButton* SelectElementsButton;
+ QLineEdit* LineEditElements;
+ QListWidget* myFacesByNodes;
+ QLabel* myFacesByNodesLabel;
+ QPushButton* AddButton;
+ QPushButton* RemoveButton;
+
+ QString myHelpFileName;
- public slots:
-
- void onAdd();
- void onRemove();
-
- private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnPreview(bool theToggled);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void onTextChange(const QString&);
- void onListSelectionChanged();
-
-protected:
- QGridLayout* SMESHGUI_CreatePolyhedralVolumeDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupContentLayout;
+public slots:
+ void onAdd();
+ void onRemove();
+
+private slots:
+ void ConstructorsClicked( int );
+ void ClickOnPreview( bool );
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onListSelectionChanged();
};
-#endif // DIALOGBOX_CREATEPOLYHEDRAL_H
+#endif // SMESHGUI_CREATEPOLYHEDRALVOLUMEDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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 : SMESHGUI_DeleteGroupDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_DeleteGroupDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_DeleteGroupDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
-#include "SMESH_TypeFilter.hxx"
+#include <SMESH_TypeFilter.hxx>
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
-#include "SalomeApp_Study.h"
-#include "LightApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <SalomeApp_Study.h>
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
-#include "SVTK_Selection.h"
-#include "SVTK_ViewWindow.h"
+#include <SVTK_Selection.h>
+#include <SVTK_ViewWindow.h>
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlistbox.h>
-#include <qlist.h>
-#include <qmessagebox.h>
+// Qt includes
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QListWidget>
+#include <QKeyEvent>
-// IDL Headers
-#include "SALOMEconfig.h"
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
-#define SPACING 5
-#define MARGIN 10
+#define SPACING 6
+#define MARGIN 11
/*!
* Class : SMESHGUI_DeleteGroupDlg
// purpose : Constructor
//=================================================================================
SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule):
- QDialog(SMESH::GetDesktop(theModule),
- "SMESHGUI_DeleteGroupDlg",
- false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ QDialog(SMESH::GetDesktop(theModule)),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule)
{
- setCaption(tr("CAPTION"));
+ setModal(false);
+ setWindowTitle(tr("CAPTION"));
- QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout(this);
+ aDlgLay->setMargin(MARGIN);
+ aDlgLay->setSpacing(SPACING);
- QFrame* aMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
+ QWidget* aMainFrame = createMainFrame (this);
+ QWidget* aBtnFrame = createButtonFrame(this);
aDlgLay->addWidget(aMainFrame);
aDlgLay->addWidget(aBtnFrame);
- aDlgLay->setStretchFactor(aMainFrame, 1);
-
myHelpFileName = "deleting_groups_page.html";
Init();
// function : createMainFrame()
// purpose : Create frame containing dialog's input fields
//=================================================================================
-QFrame* SMESHGUI_DeleteGroupDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_DeleteGroupDlg::createMainFrame (QWidget* theParent)
{
QGroupBox* aMainGrp =
- new QGroupBox(1, Qt::Horizontal, tr("SELECTED_GROUPS"), theParent);
-
- myListBox = new QListBox(aMainGrp);
- myListBox->setMinimumHeight(100);
- myListBox->setSelectionMode(QListBox::NoSelection);
- myListBox->setRowMode(QListBox::FitToWidth);
-
+ new QGroupBox(tr("SELECTED_GROUPS"), theParent);
+ QVBoxLayout* aLay = new QVBoxLayout(aMainGrp);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
+
+ myListBox = new QListWidget(aMainGrp);
+ myListBox->setMinimumSize(150, 100);
+ myListBox->setSelectionMode(QListWidget::NoSelection);
+ //myListBox->setRowMode(QListBox::FitToWidth);
+ myListBox->setFlow(QListWidget::LeftToRight);
+ myListBox->setWrapping(true);
+
+ aLay->addWidget(myListBox);
+
return aMainGrp;
}
// function : createButtonFrame()
// purpose : Create frame containing buttons
//=================================================================================
-QFrame* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_DeleteGroupDlg::createButtonFrame (QWidget* theParent)
{
- QFrame* aFrame = new QFrame(theParent);
- aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
+ QGroupBox* aFrame = new QGroupBox(theParent);
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
- myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING);
+ QHBoxLayout* aLay = new QHBoxLayout(aFrame);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
aLay->addWidget(myOkBtn);
+ aLay->addSpacing(10);
aLay->addWidget(myApplyBtn);
- aLay->addItem(aSpacer);
+ aLay->addSpacing(10);
+ aLay->addStretch();
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
- this->show();
-
// set selection mode
mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP));
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
onSelectionDone();
-
- return;
}
//=================================================================================
bool SMESHGUI_DeleteGroupDlg::isValid()
{
if (myListBox->count() == 0) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("NO_SELECTED_GROUPS"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("NO_SELECTED_GROUPS"));
return false;
}
myBlockSelection = true;
- QValueList<SMESH::SMESH_GroupBase_var>::iterator anIter;
+ QList<SMESH::SMESH_GroupBase_var>::iterator anIter;
for (anIter = myListGrp.begin(); anIter != myListGrp.end(); ++anIter) {
SMESH::SMESH_Mesh_ptr aMesh = (*anIter)->GetMesh();
if (!aMesh->_is_nil())
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
SALOME_ListIO aListIO;
mySelectionMgr->selectedObjects(aListIO);
SALOME_ListIteratorOfListIO anIter (aListIO);
- for (; anIter.More(); anIter.Next()) {
+ for ( ; anIter.More(); anIter.Next()) {
SMESH::SMESH_GroupBase_var aGroup =
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIter.Value());
if (!aGroup->_is_nil()) {
}
myListBox->clear();
- myListBox->insertStringList(aNames);
+ myListBox->addItems(aNames);
}
//=================================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
-// 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
+// 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 : SMESHGUI_DeleteGroupDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_DeleteGroupDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
#ifndef SMESHGUI_DELETEGROUPDLG_H
#define SMESHGUI_DELETEGROUPDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
-#include <qlist.h>
+// Qt includes
+#include <QDialog>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
-class QCloseEvent;
-class QFrame;
class QPushButton;
-class QListBox;
-
+class QListWidget;
class SMESHGUI;
-class SVTK_ViewWindow;
class LightApp_SelectionMgr;
/*!
Q_OBJECT
public:
- SMESHGUI_DeleteGroupDlg( SMESHGUI* );
- virtual ~SMESHGUI_DeleteGroupDlg();
+ SMESHGUI_DeleteGroupDlg( SMESHGUI* );
+ virtual ~SMESHGUI_DeleteGroupDlg();
void Init ();
private:
-
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*);
- void keyPressEvent(QKeyEvent*);
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void keyPressEvent( QKeyEvent* );
private slots:
-
void onOk();
bool onApply();
void onClose();
void onSelectionDone();
private:
-
- QFrame* createButtonFrame (QWidget*);
- QFrame* createMainFrame (QWidget*);
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame( QWidget* );
bool isValid();
private:
-
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QPushButton* myHelpBtn;
- QListBox* myListBox;
+ QListWidget* myListBox;
SMESHGUI* mySMESHGUI;
LightApp_SelectionMgr* mySelectionMgr;
- QValueList<SMESH::SMESH_GroupBase_var> myListGrp;
- bool myBlockSelection;
+ QList<SMESH::SMESH_GroupBase_var> myListGrp;
+ bool myBlockSelection;
QString myHelpFileName;
};
-#endif
+#endif // SMESHGUI_DELETEGROUPDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_Dialog.cxx
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_Dialog.cxx
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-// $Header$
-#include <SMESHGUI_Dialog.h>
+// SMESH includes
+#include "SMESHGUI_Dialog.h"
+
#include <SMESH_Type.h>
+
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
#include <SalomeApp_Application.h>
+// Qt includes
+#include <QFrame>
+
//=================================================================================
// function : SMESHGUI_Dialog
// purpose : Constructor
// name : resourceMgr
// Purpose : Gets resource manager
//=======================================================================
-SUIT_ResourceMgr* SMESHGUI_Dialog::resourceMgr()
+SUIT_ResourceMgr* SMESHGUI_Dialog::resourceMgr() const
{
return SUIT_Session::session()->resourceMgr();
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_Dialog.h
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_Dialog.h
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-// $Header$
-
#ifndef SMESHGUI_DIALOG_H
#define SMESHGUI_DIALOG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+// SALOME GUI includes
#include <LightApp_Dialog.h>
class SUIT_Desktop;
Q_OBJECT
public:
- SMESHGUI_Dialog( QWidget* = 0, const bool = false, const bool = false, const int = OK | Close | Apply | Help );
+ SMESHGUI_Dialog( QWidget* = 0, const bool = false, const bool = false,
+ const int = OK | Close | Apply | Help );
virtual ~SMESHGUI_Dialog();
- virtual void show();
+ virtual void show();
//! set all content to enable (parameter is true) or disable state
- virtual void setContentActive( const bool ) const;
+ virtual void setContentActive( const bool ) const;
//! Return hard-coded prefix using to differ overlapping types
- static int prefix( const QString& );
+ static int prefix( const QString& );
protected:
//! find desktop of active application
- SUIT_Desktop* desktop() const;
+ SUIT_Desktop* desktop() const;
//! gets resource manager
- SUIT_ResourceMgr* resourceMgr();
+ SUIT_ResourceMgr* resourceMgr() const;
};
-#endif
+#endif // SMESHGUI_DIALOG_H
-// SMESH SMESHGUI : Displayer for SMESH module
+// SMESH SMESHGUI : Displayer for SMESH module
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_Displayer.cxx
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_Displayer.cxx
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-// $Header: /home/server/cvs/SMESH/SMESH_SRC/src/SMESHGUI/SMESHGUI_Displayer.cxx
+// SMESH includes
#include "SMESHGUI_Displayer.h"
+
#include "SMESHGUI_VTKUtils.h"
+// SALOME GUI includes
#include <SalomeApp_Study.h>
#include <SalomeApp_Application.h>
+#include <SUIT_ViewManager.h>
#include <SVTK_ViewModel.h>
#include <SVTK_ViewWindow.h>
if( vtk_viewer )
{
SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView();
- SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.latin1() );
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() );
if( !anActor )
- anActor = SMESH::CreateActor( study()->studyDS(), entry.latin1(), true );
+ anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true );
if( anActor )
{
SMESH::DisplayActor( wnd, anActor );
- prs = LightApp_Displayer::buildPresentation( entry.latin1(), aViewFrame );
+ prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame );
}
if( prs )
UpdatePrs( prs );
-// SMESH SMESHGUI : Displayer for SMESH module
+// SMESH SMESHGUI : Displayer for SMESH module
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_Displayer.h
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_Displayer.h
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-// $Header: /home/server/cvs/SMESH/SMESH_SRC/src/SMESHGUI/SMESHGUI_Displayer.h
-#ifndef SMESHGUI_DISPLAYER_HEADER
-#define SMESHGUI_DISPLAYER_HEADER
+#ifndef SMESHGUI_DISPLAYER_H
+#define SMESHGUI_DISPLAYER_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+// SALOME GUI includes
#include <LightApp_Displayer.h>
class SalomeApp_Application;
SMESHGUI_Displayer( SalomeApp_Application* );
~SMESHGUI_Displayer();
- virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
- virtual bool canBeDisplayed( const QString& /*entry*/, const QString& /*viewer_type*/ ) const;
+ virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 );
+ virtual bool canBeDisplayed( const QString&, const QString& ) const;
protected:
- SalomeApp_Study* study() const;
+ SalomeApp_Study* study() const;
private:
SalomeApp_Application* myApp;
};
-#endif
+#endif // SMESHGUI_DISPLAYER_H
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESHGUI_EditHypothesesDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-
-#ifndef DIALOGBOX_EDIT_HYPOTHESES_H
-#define DIALOGBOX_EDIT_HYPOTHESES_H
-
-#include "SMESH_SMESHGUI.hxx"
-
-//#include "SMESH_TypeFilter.hxx"
-#include "SUIT_SelectionFilter.h"
-#include "LightApp_SelectionMgr.h"
-
-// QT Includes
-#include <qdialog.h>
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
-#include <map>
-#include <string>
-
-class QGroupBox;
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QListBox;
-class QListBoxItem;
-class SMESHGUI;
-
-typedef map<std::string, int> MapIOR;
-
-//=================================================================================
-// class : SMESHGUI_EditHypothesesDlg
-// purpose :
-//=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_EditHypothesesDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- SMESHGUI_EditHypothesesDlg (SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_EditHypothesesDlg();
-
-protected:
- virtual void closeEvent (QCloseEvent*);
- virtual void enterEvent (QEvent*);
-
-private:
- void Init();
-
- void InitHypDefinition();
- void InitAlgoDefinition();
- void InitHypAssignation();
- void InitAlgoAssignation();
-
- void InitGeom();
-
- void UpdateControlState();
-
- bool StoreMesh();
- bool StoreSubMesh();
-
- bool IsOld(QListBoxItem* hypItem);
-
-private:
- SMESHGUI* mySMESHGUI;
- LightApp_SelectionMgr* mySelectionMgr;
-
- GEOM::GEOM_Object_var myGeomShape;
- QLineEdit* myEditCurrentArgument;
-
- SMESH::SMESH_Mesh_var myMesh;
- SMESH::SMESH_subMesh_var mySubMesh;
-
- //Handle(SALOME_TypeFilter) myGeomFilter;
- //Handle(SMESH_TypeFilter) myMeshOrSubMeshFilter;
- SUIT_SelectionFilter* myGeomFilter;
- SUIT_SelectionFilter* myMeshOrSubMeshFilter;
-
- MapIOR myMapOldHypos, myMapOldAlgos;
- int myNbModification;
-
- bool myImportedMesh;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonApply;
- QPushButton* buttonCancel;
-
- QGroupBox* GroupC1;
- QLabel* TextLabelC1A1;
- QPushButton* SelectButtonC1A1;
- QLineEdit* LineEditC1A1;
- QLabel* TextLabelC1A2;
- QPushButton* SelectButtonC1A2;
- QLineEdit* LineEditC1A2;
-
- QGroupBox* GroupHypotheses;
- QLabel* TextHypDefinition;
- QListBox* ListHypDefinition;
- QLabel* TextHypAssignation;
- QListBox* ListHypAssignation;
-
- QGroupBox* GroupAlgorithms;
- QLabel* TextAlgoDefinition;
- QListBox* ListAlgoDefinition;
- QLabel* TextAlgoAssignation;
- QListBox* ListAlgoAssignation;
-
-private slots:
- void ClickOnOk();
- bool ClickOnApply();
- void ClickOnCancel();
- void SetEditCurrentArgument();
- void SelectionIntoArgument();
- void DeactivateActiveDialog();
- void ActivateThisDialog();
-
- void removeItem(QListBoxItem*);
- void addItem(QListBoxItem*);
-};
-
-#endif // DIALOGBOX_EDIT_HYPOTHESES_H
+// SMESH SMESHGUI : GUI for SMESH component
+//
// 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
+// 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// 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 : SMESHGUI_EditMeshDlg.cxx
+// Author : Open CASCADE S.A.S.
+//
+// SMESH includes
#include "SMESHGUI_EditMeshDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
-#include "SMESHGUI_IdValidator.h"
-#include "SMESHGUI_SpinBox.h"
-
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
#include "SMESHGUI_MeshUtils.h"
-#include "SMDS_Mesh.hxx"
-
-#include "GEOMBase.h"
+#include "SMESHGUI_SpinBox.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
+#include <SMDS_Mesh.hxx>
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-// OCCT Includes
-#include <gp_XYZ.hxx>
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-//IDL Headers
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
+#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-// VTK Includes
+// VTK includes
#include <vtkUnstructuredGrid.h>
#include <vtkRenderer.h>
#include <vtkActor2D.h>
#include <vtkLabeledDataMapper.h>
#include <vtkTextProperty.h>
#include <vtkIntArray.h>
-#include <vtkPolyData.h>
#include <vtkProperty2D.h>
#include <vtkPointData.h>
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qlistbox.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qheader.h>
-
-using namespace std;
-
-namespace SMESH {
- class TIdPreview { // to display in the viewer IDs of the selected elements
+// Qt includes
+#include <QApplication>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QListWidget>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QKeyEvent>
+
+#define SPACING 6
+#define MARGIN 11
+
+namespace SMESH
+{
+ class TIdPreview
+ { // to display in the viewer IDs of the selected elements
SVTK_ViewWindow* myViewWindow;
vtkUnstructuredGrid* myIdGrid;
//=================================================================================
SMESHGUI_EditMeshDlg::SMESHGUI_EditMeshDlg (SMESHGUI* theModule,
int theAction)
- : QDialog(SMESH::GetDesktop(theModule), "SMESHGUI_EditMeshDlg", false, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
+ : QDialog(SMESH::GetDesktop(theModule)),
mySMESHGUI(theModule),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
myAction(theAction)
{
- setCaption(tr("SMESH_MERGE_NODES"));
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(myAction == 1 ? tr("SMESH_MERGE_ELEMENTS") : tr("SMESH_MERGE_NODES"));
myIdPreview = new SMESH::TIdPreview(SMESH::GetViewWindow( mySMESHGUI ));
QPixmap IconAdd (aResMgr->loadPixmap("SMESH", tr("ICON_APPEND")));
QPixmap IconRemove (aResMgr->loadPixmap("SMESH", tr("ICON_REMOVE")));
- setSizeGripEnabled(TRUE);
- DlgLayout = new QGridLayout (this);
- DlgLayout->setSpacing(6);
- DlgLayout->setMargin(11);
+ setSizeGripEnabled(true);
- /***************************************************************/
- GroupConstructors = new QButtonGroup (this, "GroupConstructors");
- GroupConstructors->setTitle(tr("SMESH_MERGE_NODES"));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- RadioButton = new QRadioButton(GroupConstructors, "RadioButton");
- RadioButton->setPixmap(IconMergeNodes);
- if (myAction == 1) RadioButton->setPixmap(IconMergeElems);
- RadioButton->setChecked(TRUE);
- GroupConstructorsLayout->addWidget(RadioButton, 0, 0);
- DlgLayout->addWidget(GroupConstructors, 0, 0);
+ QVBoxLayout* DlgLayout = new QVBoxLayout(this);
+ DlgLayout->setSpacing(SPACING);
+ DlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupButtons = new QGroupBox (this, "GroupButtons");
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer3 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer3, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- DlgLayout->addWidget(GroupButtons, 4, 0);
+ GroupConstructors = new QGroupBox(myAction == 1 ?
+ tr("SMESH_MERGE_ELEMENTS") :
+ tr("SMESH_MERGE_NODES"),
+ this);
- /***************************************************************/
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ GroupConstructorsLayout->setSpacing(SPACING);
+ GroupConstructorsLayout->setMargin(MARGIN);
+
+ RadioButton = new QRadioButton(GroupConstructors);
+ RadioButton->setIcon(myAction == 1 ? IconMergeElems : IconMergeNodes);
+ RadioButton->setChecked(true);
+ GroupConstructorsLayout->addWidget(RadioButton);
+ GroupConstructorsLayout->addStretch();
+ /***************************************************************/
// Controls for mesh defining
- GroupMesh = new QGroupBox(this, "GroupMesh");
- GroupMesh->setTitle(tr("SMESH_SELECT_WHOLE_MESH"));
- GroupMesh->setColumnLayout(0, Qt::Vertical);
- GroupMesh->layout()->setSpacing(0);
- GroupMesh->layout()->setMargin(0);
- GroupMeshLayout = new QGridLayout(GroupMesh->layout());
- GroupMeshLayout->setAlignment(Qt::AlignTop);
- GroupMeshLayout->setSpacing(6);
- GroupMeshLayout->setMargin(11);
-
- TextLabelName = new QLabel(GroupMesh, "TextLabelName");
- TextLabelName->setText(tr("SMESH_NAME"));
- GroupMeshLayout->addWidget(TextLabelName, 0, 0);
-
- SelectMeshButton = new QPushButton(GroupMesh, "SelectMeshButton");
- SelectMeshButton->setPixmap(IconSelect);
- GroupMeshLayout->addWidget(SelectMeshButton, 0, 1);
-
- LineEditMesh = new QLineEdit(GroupMesh, "LineEditMesh");
+ GroupMesh = new QGroupBox(tr("SMESH_SELECT_WHOLE_MESH"), this);
+ QHBoxLayout* GroupMeshLayout = new QHBoxLayout(GroupMesh);
+ GroupMeshLayout->setSpacing(SPACING);
+ GroupMeshLayout->setMargin(MARGIN);
+
+ TextLabelName = new QLabel(tr("SMESH_NAME"), GroupMesh);
+ SelectMeshButton = new QPushButton(GroupMesh);
+ SelectMeshButton->setIcon(IconSelect);
+ LineEditMesh = new QLineEdit(GroupMesh);
LineEditMesh->setReadOnly(true);
- GroupMeshLayout->addWidget(LineEditMesh, 0, 2);
- DlgLayout->addWidget(GroupMesh, 1, 0);
+ GroupMeshLayout->addWidget(TextLabelName);
+ GroupMeshLayout->addWidget(SelectMeshButton);
+ GroupMeshLayout->addWidget(LineEditMesh);
/***************************************************************/
-
// Controls for coincident elements detecting
- GroupCoincident = new QGroupBox(this, "GroupCoincident");
- GroupCoincident->setTitle(tr("COINCIDENT_NODES"));
- GroupCoincident->setColumnLayout(0, Qt::Vertical);
- GroupCoincident->layout()->setSpacing(0);
- GroupCoincident->layout()->setMargin(0);
- GroupCoincidentLayout = new QGridLayout(GroupCoincident->layout());
- GroupCoincidentLayout->setAlignment(Qt::AlignTop);
- GroupCoincidentLayout->setSpacing(6);
- GroupCoincidentLayout->setMargin(11);
+ GroupCoincident = new QGroupBox(myAction == 1 ?
+ tr("COINCIDENT_ELEMENTS") :
+ tr("COINCIDENT_NODES"),
+ this);
+
+ QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident);
+ GroupCoincidentLayout->setSpacing(SPACING);
+ GroupCoincidentLayout->setMargin(MARGIN);
if (myAction == 0) { // case merge nodes
- TextLabelTolerance = new QLabel(GroupCoincident, "TextLabelTolerance");
- TextLabelTolerance->setText(tr("SMESH_TOLERANCE"));
- TextLabelTolerance->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred));
- GroupCoincidentLayout->addWidget(TextLabelTolerance, 0, 0);
+ TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupCoincident);
+ SpinBoxTolerance = new SMESHGUI_SpinBox(GroupCoincident);
+ SpinBoxTolerance->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- SpinBoxTolerance = new SMESHGUI_SpinBox(GroupCoincident, "SpinBoxTolerance");
- GroupCoincidentLayout->addWidget(SpinBoxTolerance, 0, 1);
+ GroupCoincidentLayout->addWidget(TextLabelTolerance, 0, 0);
+ GroupCoincidentLayout->addWidget(SpinBoxTolerance, 0, 1);
+ }
+ else {
+ TextLabelTolerance = 0;
+ SpinBoxTolerance = 0;
}
- DetectButton = new QPushButton(GroupCoincident, "DetectButton");
- DetectButton->setText(tr("DETECT"));
- DetectButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum));
- GroupCoincidentLayout->addWidget(DetectButton, 0, 2);
-
- ListCoincident = new QListBox(GroupCoincident, "ListCoincident");
- ListCoincident->setSelectionMode(QListBox::Extended);
- if (myAction == 0) // case merge nodes
- GroupCoincidentLayout->addMultiCellWidget(ListCoincident, 1, 3, 0, 1);
- else // case merge elements
- GroupCoincidentLayout->addMultiCellWidget(ListCoincident, 0, 3, 0, 1);
-
- QSpacerItem* spacer1 = new QSpacerItem(20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding);
- GroupCoincidentLayout->addItem(spacer1, 1, 2);
+ int row = GroupCoincidentLayout->rowCount();
- AddGroupButton = new QPushButton(GroupCoincident, "AddGroupButton");
- AddGroupButton->setText(tr("SMESH_BUT_ADD"));
- GroupCoincidentLayout->addWidget(AddGroupButton, 2, 2);
+ ListCoincident = new QListWidget(GroupCoincident);
+ ListCoincident->setSelectionMode(QListWidget::ExtendedSelection);
- RemoveGroupButton = new QPushButton(GroupCoincident, "RemoveGroupButton");
- RemoveGroupButton->setText(tr("SMESH_BUT_REMOVE"));
- GroupCoincidentLayout->addWidget(RemoveGroupButton, 3, 2);
+ DetectButton = new QPushButton(tr("DETECT"), GroupCoincident);
+ AddGroupButton = new QPushButton(tr("SMESH_BUT_ADD"), GroupCoincident);
+ RemoveGroupButton = new QPushButton(tr("SMESH_BUT_REMOVE"), GroupCoincident);
- SelectAllCB = new QCheckBox(GroupCoincident, "SelectAllCB");
- SelectAllCB->setText(tr("SELECT_ALL"));
- GroupCoincidentLayout->addWidget(SelectAllCB, 4, 0);
+ SelectAllCB = new QCheckBox(tr("SELECT_ALL"), GroupCoincident);
- DlgLayout->addWidget(GroupCoincident, 2, 0);
+ GroupCoincidentLayout->addWidget(ListCoincident, row, 0, 4, 2);
+ GroupCoincidentLayout->addWidget(DetectButton, row, 2);
+ GroupCoincidentLayout->addWidget(AddGroupButton, row+2, 2);
+ GroupCoincidentLayout->addWidget(RemoveGroupButton, row+3, 2);
+ GroupCoincidentLayout->addWidget(SelectAllCB, row+4, 0, 1, 3);
+ GroupCoincidentLayout->setRowMinimumHeight(row+1, 10);
+ GroupCoincidentLayout->setRowStretch(row+1, 5);
/***************************************************************/
-
// Controls for editing the selected group
- GroupEdit = new QGroupBox(this, "GroupEdit");
- GroupEdit->setTitle(tr("EDIT_SELECTED_GROUP"));
- GroupEdit->setColumnLayout(0, Qt::Vertical);
- GroupEdit->layout()->setSpacing(0);
- GroupEdit->layout()->setMargin(0);
- GroupEditLayout = new QGridLayout(GroupEdit->layout());
- GroupEditLayout->setAlignment(Qt::AlignTop);
- GroupEditLayout->setSpacing(6);
- GroupEditLayout->setMargin(11);
-
- ListEdit = new QListBox(GroupEdit, "ListEdit");
- ListEdit->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred));
- ListEdit->setRowMode(QListBox::FixedNumber);
- ListEdit->setMinimumHeight(ListEdit->sizeHint().height());
- ListEdit->setHScrollBarMode(QScrollView::AlwaysOn);
- ListEdit->setVScrollBarMode(QScrollView::AlwaysOff);
- ListEdit->setSelectionMode(QListBox::Extended);
- GroupEditLayout->addMultiCellWidget(ListEdit, 0, 1, 0, 0);
-
- AddElemButton = new QPushButton(GroupEdit, "AddElemButton");
- AddElemButton->setPixmap(IconAdd);
- GroupEditLayout->addWidget(AddElemButton, 0, 1);
-
- RemoveElemButton = new QPushButton(GroupEdit, "RemoveElemButton");
- RemoveElemButton->setPixmap(IconRemove);
+ GroupEdit = new QGroupBox(tr("EDIT_SELECTED_GROUP"), this);
+ QGridLayout* GroupEditLayout = new QGridLayout(GroupEdit);
+ GroupEditLayout->setSpacing(SPACING);
+ GroupEditLayout->setMargin(MARGIN);
+
+ ListEdit = new QListWidget(GroupEdit);
+ //ListEdit->setRowMode(QListBox::FixedNumber);
+ //ListEdit->setHScrollBarMode(QScrollView::AlwaysOn);
+ //ListEdit->setVScrollBarMode(QScrollView::AlwaysOff);
+ ListEdit->setSelectionMode(QListWidget::ExtendedSelection);
+
+ AddElemButton = new QPushButton(GroupEdit);
+ AddElemButton->setIcon(IconAdd);
+ RemoveElemButton = new QPushButton(GroupEdit);
+ RemoveElemButton->setIcon(IconRemove);
+ SetFirstButton = new QPushButton(GroupEdit);
+ SetFirstButton->setIcon(QPixmap(IconFirst));
+
+ GroupEditLayout->addWidget(ListEdit, 0, 0, 2, 1);
+ GroupEditLayout->addWidget(AddElemButton, 0, 1);
GroupEditLayout->addWidget(RemoveElemButton, 0, 2);
+ GroupEditLayout->addWidget(SetFirstButton, 1, 1, 1, 2);
- SetFirstButton = new QPushButton(GroupEdit, "SetFirstButton");
- SetFirstButton->setIconSet(QPixmap(IconFirst));
- SetFirstButton->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
- GroupEditLayout->addMultiCellWidget(SetFirstButton, 1, 1, 1, 2);
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
- DlgLayout->addWidget(GroupEdit, 3, 0);
+ /***************************************************************/
+ DlgLayout->addWidget(GroupConstructors);
+ DlgLayout->addWidget(GroupMesh);
+ DlgLayout->addWidget(GroupCoincident);
+ DlgLayout->addWidget(GroupEdit);
+ DlgLayout->addWidget(GroupButtons);
Init(); // Initialisations
}
//=================================================================================
SMESHGUI_EditMeshDlg::~SMESHGUI_EditMeshDlg()
{
- // no need to delete child widgets, Qt does it all for us
delete myIdPreview;
}
SpinBoxTolerance->SetValue(1e-05);
}
- RadioButton->setChecked(TRUE);
+ RadioButton->setChecked(true);
myEditCurrentArgument = (QWidget*)LineEditMesh;
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
/* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
- this->show(); /* displays Dialog */
-
SetFirstButton->setEnabled(false);
buttonOk->setEnabled(false);
buttonApply->setEnabled(false);
// Init Mesh field from selection
SelectionIntoArgument();
- // dialog customization
- if (myAction == 1) {
- setCaption(tr("SMESH_MERGE_ELEMENTS"));
- GroupConstructors->setTitle(tr("SMESH_MERGE_ELEMENTS"));
- GroupCoincident->setTitle(tr("COINCIDENT_ELEMENTS"));
- }
-
myHelpFileName = "merging_elements_page.html";
}
// purpose :
//=================================================================================
void SMESHGUI_EditMeshDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap,
- list< gp_XYZ > & theGrCentersXYZ)
+ std::list< gp_XYZ > & theGrCentersXYZ)
{
if (!myActor)
return;
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
SMESH::long_array_var anIds = new SMESH::long_array;
SMESH::array_of_long_array_var aGroupsOfElements = new SMESH::array_of_long_array;
aGroupsOfElements->length(ListCoincident->count());
- QListBoxItem* item = ListCoincident->firstItem();
int anArrayNum = 0;
- while (item) {
- QStringList aListIds = QStringList("");
- aListIds = QStringList::split(" ", item->text(), false);
+ for (int i = 0; i < ListCoincident->count(); i++) {
+ QStringList aListIds = ListCoincident->item(i)->text().split(" ", QString::SkipEmptyParts);
anIds->length(aListIds.count());
for (int i = 0; i < aListIds.count(); i++)
anIds[i] = aListIds[i].toInt();
aGroupsOfElements[anArrayNum++] = anIds.inout();
- item = item->next();
}
if( myAction == 0 )
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
//=================================================================================
void SMESHGUI_EditMeshDlg::onEditGroup()
{
- int nbSel = 0;
- for (int i = 0; i < ListCoincident->count(); i++) {
- if (ListCoincident->isSelected(i))
- nbSel++;
- if (nbSel > 1) {
- ListEdit->clear();
- return;
- }
- }
- if (nbSel == 0) {
+ QList<QListWidgetItem*> selItems = ListCoincident->selectedItems();
+ if ( selItems.count() != 1 ) {
ListEdit->clear();
return;
}
- QString aNewIds = "";
+ QStringList aNewIds;
- QListBoxItem* anItem;
- for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next())
- aNewIds+=QString(" %1").arg(anItem->text());
+ for (int i = 0; i < ListEdit->count(); i++ )
+ aNewIds.append(ListEdit->item(i)->text());
- ListCoincident->changeItem(aNewIds, ListCoincident->currentItem());
- ListCoincident->setSelected(ListCoincident->currentItem(), true);
-
+ ListCoincident->currentItem()->setText(aNewIds.join(" "));
+ ListCoincident->currentItem()->setSelected(true);
}
//=================================================================================
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
ListCoincident->clear();
ListEdit->clear();
break;
}
- QListBoxItem* anItem = 0;
for (int i = 0; i < aGroupsArray->length(); i++) {
SMESH::long_array& aGroup = aGroupsArray[i];
- QString anIDs;
+ QStringList anIDs;
for (int j = 0; j < aGroup.length(); j++)
- anIDs+=QString(" %1").arg(aGroup[j]);
+ anIDs.append(QString::number(aGroup[j]));
- anItem = new QListBoxText(anIDs);
- ListCoincident->insertItem(anItem);
+ ListCoincident->addItem(anIDs.join(" "));
}
QApplication::restoreOverrideCursor();
} catch(...) {
}
- ListCoincident->selectAll(true);
+ ListCoincident->selectAll();
updateControls();
}
ListEdit->clear();
TColStd_MapOfInteger anIndices;
- QListBoxItem* anItem;
- int NbOfSelected = 0;
- for (anItem = ListCoincident->firstItem(); anItem != 0; anItem = anItem->next()) {
- if (anItem->isSelected()) {
- QStringList aListIds = QStringList("");
- aListIds = QStringList::split(" ", anItem->text(), false);
- for (int i = 0; i < aListIds.count(); i++)
- anIndices.Add(aListIds[i].toInt());
- NbOfSelected++;
- ListEdit->clear();
- if (NbOfSelected == 1) {
- ListEdit->insertStringList(aListIds);
- ListEdit->selectAll(true);
- }
- }
+ QList<QListWidgetItem*> selItems = ListCoincident->selectedItems();
+ QListWidgetItem* anItem;
+ QStringList aListIds;
+
+ ListEdit->clear();
+
+ foreach(anItem, selItems) {
+ aListIds = anItem->text().split(" ", QString::SkipEmptyParts);
+ for (int i = 0; i < aListIds.count(); i++)
+ anIndices.Add(aListIds[i].toInt());
}
+
+ if (selItems.count() == 1) {
+ ListEdit->addItems(aListIds);
+ ListEdit->selectAll();
+ }
+
mySelector->AddOrRemoveIndex(myActor->getIO(), anIndices, false);
SALOME_ListIO aList;
aList.Append(myActor->getIO());
//=================================================================================
void SMESHGUI_EditMeshDlg::onSelectAll (bool isToggled)
{
- ListCoincident->selectAll(isToggled);
+ if ( isToggled )
+ ListCoincident->selectAll();
+ else
+ ListCoincident->clearSelection();
}
//=================================================================================
if (myIsBusy || !myActor)
return;
- int nbSel = 0;
TColStd_MapOfInteger anIndices;
- QListBoxItem* anItem;
- for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next()) {
- if (anItem->isSelected()) {
- int anId = anItem->text().toInt();
- anIndices.Add(anId);
- nbSel++;
- if (nbSel == 1)
- SetFirstButton->setEnabled(true);
- }
- }
- if (nbSel == 0 || nbSel > 1)
- SetFirstButton->setEnabled(false);
+ QList<QListWidgetItem*> selItems = ListEdit->selectedItems();
+ QListWidgetItem* anItem;
+
+ foreach(anItem, selItems)
+ anIndices.Add(anItem->text().toInt());
+
+ SetFirstButton->setEnabled(selItems.count() == 1);
mySelector->AddOrRemoveIndex(myActor->getIO(), anIndices, false);
SALOME_ListIO aList;
SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), anIDs);
ListCoincident->clearSelection();
- QListBoxItem* anItem = new QListBoxText(anIDs);
- ListCoincident->insertItem(anItem);
+ ListCoincident->addItem(anIDs);
int nbGroups = ListCoincident->count();
if (nbGroups) {
- ListCoincident->setCurrentItem(nbGroups-1);
- ListCoincident->setSelected(nbGroups-1, true);
+ ListCoincident->setCurrentRow(nbGroups-1);
+ ListCoincident->item(nbGroups-1)->setSelected(true);
}
else {
- ListCoincident->setCurrentItem(0);
- ListCoincident->setSelected(0, true);
+ // VSR ? this code seems to be never executed!!!
+ ListCoincident->setCurrentRow(0);
+ //ListCoincident->setSelected(0, true); // VSR: no items - no selection
}
updateControls();
return;
myIsBusy = true;
- for (int i = ListCoincident->count(); i > 0; i--)
- if (ListCoincident->isSelected(i-1))
- ListCoincident->removeItem(i-1);
+ QList<QListWidgetItem*> selItems = ListCoincident->selectedItems();
+ QListWidgetItem* anItem;
+
+ foreach(anItem, selItems)
+ delete anItem;
ListEdit->clear();
updateControls();
if (aNbNnodes < 1)
return;
- QStringList aNodes = QStringList::split(" ", aListStr);
- QListBoxItem* anItem = 0;
+ QStringList aNodes = aListStr.split(" ", QString::SkipEmptyParts);
for (QStringList::iterator it = aNodes.begin(); it != aNodes.end(); ++it) {
- anItem = ListEdit->findItem(*it, Qt::ExactMatch);
- if (!anItem) {
- anItem = new QListBoxText(*it);
- ListEdit->insertItem(anItem);
+ QList<QListWidgetItem*> found = ListEdit->findItems(*it, Qt::MatchExactly);
+ if ( found.count() == 0 ) {
+ QListWidgetItem* anItem = new QListWidgetItem(*it);
+ ListEdit->addItem(anItem);
+ anItem->setSelected(true);
+ }
+ else {
+ QListWidgetItem* anItem;
+ foreach(anItem, found) anItem->setSelected(true);
}
- ListEdit->setSelected(anItem, true);
}
myIsBusy = false;
return;
myIsBusy = true;
- for (int i = ListEdit->count(); i > 0; i--)
- if (ListEdit->isSelected(i-1))
- ListEdit->removeItem(i-1);
+ QList<QListWidgetItem*> selItems = ListEdit->selectedItems();
+ QListWidgetItem* anItem;
+ foreach(anItem, selItems)
+ delete anItem;
+
myIsBusy = false;
onEditGroup();
}
return;
myIsBusy = true;
- QListBoxItem* anItem;
- for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next()) {
- if (anItem->isSelected()) {
- ListEdit->takeItem(anItem);
- ListEdit->insertItem(anItem, 0);
- }
+ QList<QListWidgetItem*> selItems = ListEdit->selectedItems();
+ QListWidgetItem* anItem;
+
+ foreach(anItem, selItems) {
+ ListEdit->takeItem(ListEdit->row(anItem));
+ ListEdit->insertItem(0, anItem);
}
myIsBusy = false;
void SMESHGUI_EditMeshDlg::closeEvent(QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
+// SMESH SMESHGUI : GUI for SMESH component
+//
// 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
+// 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// 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 : SMESHGUI_EditMeshDlg.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_EditMeshDlg_H
-#define SMESHGUI_EditMeshDlg_H
+#ifndef SMESHGUI_EDITMESHDLG_H
+#define SMESHGUI_EDITMESHDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-#include "SUIT_SelectionFilter.h"
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qdialog.h>
-
-// Open CASCADE Includes
+// OCCT includes
#include <gp_XYZ.hxx>
-class QGridLayout;
-class QButtonGroup;
+// STL includes
+#include <list>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
+
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
class QCheckBox;
-class QListBox;
+class QListWidget;
class SMESHGUI;
class SMESHGUI_SpinBox;
class SMESH_Actor;
-class SALOME_Actor;
-class SVTK_ViewWindow;
class SVTK_Selector;
+class LightApp_SelectionMgr;
+class SUIT_SelectionFilter;
+class TColStd_MapOfInteger;
-namespace SMESH{
+namespace SMESH
+{
struct TIdPreview;
}
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-
//=================================================================================
// class : SMESHGUI_EditMeshDlg
// purpose :
{
Q_OBJECT;
- public:
- SMESHGUI_EditMeshDlg (SMESHGUI * theModule,
- int theAction);
+public:
+ SMESHGUI_EditMeshDlg( SMESHGUI*, int );
~SMESHGUI_EditMeshDlg();
- private:
- void Init();
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
- void onEditGroup();
+private:
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ void onEditGroup();
- void FindGravityCenter(TColStd_MapOfInteger & ElemsIdMap,
- list< gp_XYZ > & GrCentersXYZ);
+ void FindGravityCenter( TColStd_MapOfInteger&,
+ std::list<gp_XYZ>& );
// add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list
- private:
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- SVTK_Selector* mySelector;
+private:
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ SVTK_Selector* mySelector;
- QWidget* myEditCurrentArgument;
+ QWidget* myEditCurrentArgument;
SMESH::SMESH_Mesh_var myMesh;
SMESH::SMESH_IDSource_var mySubMeshOrGroup;
SMESH::TIdPreview* myIdPreview;
- int myAction;
- bool myIsBusy;
+ int myAction;
+ bool myIsBusy;
// Widgets
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
-
- QGroupBox* GroupMesh;
- QLabel* TextLabelName;
- QPushButton* SelectMeshButton;
- QLineEdit* LineEditMesh;
-
- QGroupBox* GroupCoincident;
- QLabel* TextLabelTolerance;
- SMESHGUI_SpinBox* SpinBoxTolerance;
- QPushButton* DetectButton;
- QListBox* ListCoincident;
- QPushButton* AddGroupButton;
- QPushButton* RemoveGroupButton;
- QCheckBox* SelectAllCB;
-
- QGroupBox* GroupEdit;
- QListBox* ListEdit;
- QPushButton* AddElemButton;
- QPushButton* RemoveElemButton;
- QPushButton* SetFirstButton;
+ QGroupBox* GroupConstructors;
+ QRadioButton* RadioButton;
+
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+
+ QGroupBox* GroupMesh;
+ QLabel* TextLabelName;
+ QPushButton* SelectMeshButton;
+ QLineEdit* LineEditMesh;
+
+ QGroupBox* GroupCoincident;
+ QLabel* TextLabelTolerance;
+ SMESHGUI_SpinBox* SpinBoxTolerance;
+ QPushButton* DetectButton;
+ QListWidget* ListCoincident;
+ QPushButton* AddGroupButton;
+ QPushButton* RemoveGroupButton;
+ QCheckBox* SelectAllCB;
+
+ QGroupBox* GroupEdit;
+ QListWidget* ListEdit;
+ QPushButton* AddElemButton;
+ QPushButton* RemoveElemButton;
+ QPushButton* SetFirstButton;
- //protected:
- QGridLayout* DlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupMeshLayout;
- QGridLayout* GroupCoincidentLayout;
- QGridLayout* GroupEditLayout;
-
- QString myHelpFileName;
+ QString myHelpFileName;
private slots:
- void ClickOnOk();
- void ClickOnCancel();
- bool ClickOnApply();
- void ClickOnHelp();
- void updateControls();
- void onDetect();
- void onAddGroup();
- void onRemoveGroup();
- void onSelectGroup();
- void onSelectAll(bool isToggled);
- void onSelectElementFromGroup();
- void onAddElement();
- void onRemoveElement();
- void onSetFirst();
- void SetEditCurrentArgument();
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
-
+ void ClickOnOk();
+ void ClickOnCancel();
+ bool ClickOnApply();
+ void ClickOnHelp();
+ void updateControls();
+ void onDetect();
+ void onAddGroup();
+ void onRemoveGroup();
+ void onSelectGroup();
+ void onSelectAll( bool );
+ void onSelectElementFromGroup();
+ void onAddElement();
+ void onRemoveElement();
+ void onSetFirst();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
};
-#endif // SMESHGUI_EditMeshDlg_H
+#endif // SMESHGUI_EDITMESHDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_ExtrusionAlongPathDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_ExtrusionAlongPathDlg.cxx
-// Author : Vadim SANDLER
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_ExtrusionAlongPathDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_NumberFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-
-#include "SMDS_Mesh.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_NumberFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
-#include "GEOMBase.h"
+#include <SMDS_Mesh.hxx>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_Session.h"
+// SALOME GEOM includes
+#include <GEOMBase.h>
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SVTK_ViewWindow.h>
-// OCCT Includes
+// OCCT includes
#include <BRep_Tool.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx>
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qtoolbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlistbox.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qptrlist.h>
-#include <qpixmap.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+
+// Qt includes
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QToolButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QListWidget>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
+
+class SMESHGUI_ExtrusionAlongPathDlg::SetBusy
+{
+public:
+ SetBusy( SMESHGUI_ExtrusionAlongPathDlg* _dlg )
+ {
+ myDlg = _dlg;
+ myDlg->myBusy = true;
+ }
+
+ ~SetBusy()
+ {
+ myDlg->myBusy = false;
+ }
+
+private:
+ SMESHGUI_ExtrusionAlongPathDlg* myDlg;
+};
//=================================================================================
// function : SMESHGUI_ExtrusionAlongPathDlg()
// purpose : constructor
//=================================================================================
-SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule,
- bool modal )
- : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionAlongPathDlg", modal,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_ExtrusionAlongPathDlg::SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap edgeImage ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
myType = -1;
- setCaption(tr("EXTRUSION_ALONG_PATH"));
- setSizeGripEnabled(TRUE);
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle(tr("EXTRUSION_ALONG_PATH"));
+ setSizeGripEnabled(true);
- QGridLayout* topLayout = new QGridLayout(this);
- topLayout->setSpacing(6);
- topLayout->setMargin(11);
+ QVBoxLayout* topLayout = new QVBoxLayout(this);
+ topLayout->setSpacing(SPACING);
+ topLayout->setMargin(MARGIN);
/***************************************************************/
// Elements type group box (1d / 2d elements)
- GroupConstructors = new QButtonGroup(tr("SMESH_EXTRUSION"), this);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- QGridLayout* GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6); GroupConstructorsLayout->setMargin(11);
-
- Elements1dRB = new QRadioButton(GroupConstructors);
- Elements1dRB->setPixmap(edgeImage);
- Elements2dRB = new QRadioButton(GroupConstructors);
- Elements2dRB->setPixmap(faceImage);
+ ConstructorsBox = new QGroupBox(tr("SMESH_EXTRUSION"), this);
+ GroupConstructors = new QButtonGroup(this);
+ QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
+ ConstructorsBoxLayout->setSpacing(SPACING); ConstructorsBoxLayout->setMargin(MARGIN);
+
+ Elements1dRB = new QRadioButton(ConstructorsBox);
+ Elements1dRB->setIcon(edgeImage);
+ Elements2dRB = new QRadioButton(ConstructorsBox);
+ Elements2dRB->setIcon(faceImage);
Elements1dRB->setChecked(true);
// layouting
- GroupConstructorsLayout->addWidget(Elements1dRB, 0, 0);
- GroupConstructorsLayout->addWidget(Elements2dRB, 0, 2);
+ ConstructorsBoxLayout->addWidget(Elements1dRB);
+ ConstructorsBoxLayout->addWidget(Elements2dRB);
+ GroupConstructors->addButton(Elements1dRB, 0);
+ GroupConstructors->addButton(Elements2dRB, 1);
/***************************************************************/
// Arguments group box
GroupArguments = new QGroupBox(tr("EXTRUSION_1D"), this);
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0); GroupArguments->layout()->setMargin(0);
- QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6); GroupArgumentsLayout->setMargin(11);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING); GroupArgumentsLayout->setMargin(MARGIN);
// Controls for elements selection
ElementsLab = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
SelectElementsButton = new QToolButton(GroupArguments);
- SelectElementsButton->setPixmap(selectImage);
+ SelectElementsButton->setIcon(selectImage);
ElementsLineEdit = new QLineEdit(GroupArguments);
ElementsLineEdit->setValidator(new SMESHGUI_IdValidator(this));
// Controls for path selection
PathGrp = new QGroupBox(tr("SMESH_PATH"), GroupArguments);
- PathGrp->setColumnLayout(0, Qt::Vertical);
- PathGrp->layout()->setSpacing(0); PathGrp->layout()->setMargin(0);
- QGridLayout* PathGrpLayout = new QGridLayout(PathGrp->layout());
- PathGrpLayout->setAlignment(Qt::AlignTop);
- PathGrpLayout->setSpacing(6); PathGrpLayout->setMargin(11);
+ QGridLayout* PathGrpLayout = new QGridLayout(PathGrp);
+ PathGrpLayout->setSpacing(SPACING); PathGrpLayout->setMargin(MARGIN);
// Controls for path mesh selection
- PathMeshLab = new QLabel(tr("SMESH_PATH_MESH"), PathGrp);
+ QLabel* PathMeshLab = new QLabel(tr("SMESH_PATH_MESH"), PathGrp);
SelectPathMeshButton = new QToolButton(PathGrp);
- SelectPathMeshButton->setPixmap(selectImage);
+ SelectPathMeshButton->setIcon(selectImage);
PathMeshLineEdit = new QLineEdit(PathGrp);
PathMeshLineEdit->setReadOnly(true);
// Controls for path shape selection
- PathShapeLab = new QLabel(tr("SMESH_PATH_SHAPE"), PathGrp);
+ QLabel* PathShapeLab = new QLabel(tr("SMESH_PATH_SHAPE"), PathGrp);
SelectPathShapeButton = new QToolButton(PathGrp);
- SelectPathShapeButton->setPixmap(selectImage);
+ SelectPathShapeButton->setIcon(selectImage);
PathShapeLineEdit = new QLineEdit(PathGrp);
PathShapeLineEdit->setReadOnly(true);
// Controls for path starting point selection
- StartPointLab = new QLabel(tr("SMESH_PATH_START"), PathGrp);
+ QLabel* StartPointLab = new QLabel(tr("SMESH_PATH_START"), PathGrp);
SelectStartPointButton = new QToolButton(PathGrp);
- SelectStartPointButton->setPixmap(selectImage);
+ SelectStartPointButton->setIcon(selectImage);
StartPointLineEdit = new QLineEdit(PathGrp);
StartPointLineEdit->setValidator(new QIntValidator(this));
PathGrpLayout->addWidget(SelectStartPointButton, 2, 1);
PathGrpLayout->addWidget(StartPointLineEdit, 2, 2);
- // Controls for base point defining
- BasePointCheck = new QCheckBox(tr("SMESH_USE_BASE_POINT"), GroupArguments);
-
BasePointGrp = new QGroupBox(tr("SMESH_BASE_POINT"), GroupArguments);
- BasePointGrp->setColumnLayout(0, Qt::Vertical);
- BasePointGrp->layout()->setSpacing(0); BasePointGrp->layout()->setMargin(0);
- QGridLayout* BasePointGrpLayout = new QGridLayout(BasePointGrp->layout());
- BasePointGrpLayout->setAlignment(Qt::AlignTop);
- BasePointGrpLayout->setSpacing(6); BasePointGrpLayout->setMargin(11);
+ BasePointGrp->setCheckable(true);
+ BasePointGrp->setChecked(false);
+ QHBoxLayout* BasePointGrpLayout = new QHBoxLayout(BasePointGrp);
+ BasePointGrpLayout->setSpacing(SPACING); BasePointGrpLayout->setMargin(MARGIN);
SelectBasePointButton = new QToolButton(BasePointGrp);
- SelectBasePointButton->setPixmap(selectImage);
+ SelectBasePointButton->setIcon(selectImage);
- XLab = new QLabel(tr("SMESH_X"), BasePointGrp);
- XLab->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
+ QLabel* XLab = new QLabel(tr("SMESH_X"), BasePointGrp);
XSpin = new SMESHGUI_SpinBox(BasePointGrp);
- YLab = new QLabel(tr("SMESH_Y"), BasePointGrp);
- YLab->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
+ QLabel* YLab = new QLabel(tr("SMESH_Y"), BasePointGrp);
YSpin = new SMESHGUI_SpinBox(BasePointGrp);
- ZLab = new QLabel(tr("SMESH_Z"), BasePointGrp);
- ZLab->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
+ QLabel* ZLab = new QLabel(tr("SMESH_Z"), BasePointGrp);
ZSpin = new SMESHGUI_SpinBox(BasePointGrp);
// layouting
- BasePointGrpLayout->addWidget(SelectBasePointButton, 0, 0);
- BasePointGrpLayout->addWidget(XLab, 0, 1);
- BasePointGrpLayout->addWidget(XSpin, 0, 2);
- BasePointGrpLayout->addWidget(YLab, 0, 3);
- BasePointGrpLayout->addWidget(YSpin, 0, 4);
- BasePointGrpLayout->addWidget(ZLab, 0, 5);
- BasePointGrpLayout->addWidget(ZSpin, 0, 6);
-
- // Controls for angles defining
- AnglesCheck = new QCheckBox(tr("SMESH_USE_ANGLES"), GroupArguments);
+ BasePointGrpLayout->addWidget(SelectBasePointButton);
+ BasePointGrpLayout->addWidget(XLab);
+ BasePointGrpLayout->addWidget(XSpin);
+ BasePointGrpLayout->addWidget(YLab);
+ BasePointGrpLayout->addWidget(YSpin);
+ BasePointGrpLayout->addWidget(ZLab);
+ BasePointGrpLayout->addWidget(ZSpin);
AnglesGrp = new QGroupBox(tr("SMESH_ANGLES"), GroupArguments);
- AnglesGrp->setColumnLayout(0, Qt::Vertical);
- AnglesGrp->layout()->setSpacing(0); AnglesGrp->layout()->setMargin(0);
- QGridLayout* AnglesGrpLayout = new QGridLayout(AnglesGrp->layout());
- AnglesGrpLayout->setAlignment(Qt::AlignTop);
- AnglesGrpLayout->setSpacing(6); AnglesGrpLayout->setMargin(11);
+ AnglesGrp->setCheckable(true);
+ AnglesGrp->setChecked(false);
+ QGridLayout* AnglesGrpLayout = new QGridLayout(AnglesGrp);
+ AnglesGrpLayout->setSpacing(SPACING); AnglesGrpLayout->setMargin(MARGIN);
- AnglesList = new QListBox(AnglesGrp);
- AnglesList->setSelectionMode(QListBox::Extended);
+ AnglesList = new QListWidget(AnglesGrp);
+ AnglesList->setSelectionMode(QListWidget::ExtendedSelection);
AddAngleButton = new QToolButton(AnglesGrp);
- AddAngleButton->setPixmap(addImage);
+ AddAngleButton->setIcon(addImage);
RemoveAngleButton = new QToolButton(AnglesGrp);
- RemoveAngleButton->setPixmap(removeImage);
+ RemoveAngleButton->setIcon(removeImage);
AngleSpin = new SMESHGUI_SpinBox(AnglesGrp);
// layouting
- QVBoxLayout* bLayout = new QVBoxLayout();
- bLayout->addWidget(AddAngleButton);
- bLayout->addSpacing(6);
- bLayout->addWidget(RemoveAngleButton);
- bLayout->addStretch();
- AnglesGrpLayout->addMultiCellWidget(AnglesList, 0, 1, 0, 0);
- AnglesGrpLayout->addMultiCellLayout(bLayout, 0, 1, 1, 1);
- AnglesGrpLayout->addWidget( AngleSpin, 0, 2 );
- AnglesGrpLayout->setRowStretch(1, 10);
+ AnglesGrpLayout->addWidget(AnglesList, 0, 0, 4, 1);
+ AnglesGrpLayout->addWidget(AddAngleButton, 0, 1);
+ AnglesGrpLayout->addWidget(RemoveAngleButton, 2, 1);
+ AnglesGrpLayout->addWidget(AngleSpin, 0, 2);
+ AnglesGrpLayout->setRowMinimumHeight(1, 10);
+ AnglesGrpLayout->setRowStretch(3, 10);
// CheckBox for groups generation
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
MakeGroupsCheck->setChecked(true);
// layouting
- GroupArgumentsLayout->addWidget( ElementsLab, 0, 0 );
- GroupArgumentsLayout->addWidget( SelectElementsButton, 0, 1 );
- GroupArgumentsLayout->addWidget( ElementsLineEdit, 0, 2 );
- GroupArgumentsLayout->addMultiCellWidget(MeshCheck, 1, 1, 0, 2);
- GroupArgumentsLayout->addMultiCellWidget(PathGrp, 2, 2, 0, 2);
- GroupArgumentsLayout->addWidget( BasePointCheck, 3, 0 );
- GroupArgumentsLayout->addMultiCellWidget(BasePointGrp, 3, 4, 1, 2);
- GroupArgumentsLayout->addWidget( AnglesCheck, 5, 0 );
- GroupArgumentsLayout->addMultiCellWidget(AnglesGrp, 5, 6, 1, 2);
- GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 7, 7, 0, 2);
- GroupArgumentsLayout->setRowStretch(6, 10);
+ GroupArgumentsLayout->addWidget(ElementsLab, 0, 0);
+ GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ GroupArgumentsLayout->addWidget(ElementsLineEdit, 0, 2);
+ GroupArgumentsLayout->addWidget(MeshCheck, 1, 0, 1, 3);
+ GroupArgumentsLayout->addWidget(PathGrp, 2, 0, 1, 3);
+ GroupArgumentsLayout->addWidget(BasePointGrp, 3, 0, 1, 3);
+ GroupArgumentsLayout->addWidget(AnglesGrp, 4, 0, 1, 3);
+ GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 0, 1, 3);
/***************************************************************/
// common buttons group box
GroupButtons = new QGroupBox(this);
- 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);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING); GroupButtonsLayout->setMargin(MARGIN);
OkButton = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
OkButton->setAutoDefault(true);
HelpButton->setAutoDefault(true);
// layouting
- GroupButtonsLayout->addWidget(OkButton, 0, 0);
- GroupButtonsLayout->addWidget(ApplyButton, 0, 1);
- GroupButtonsLayout->addWidget(CloseButton, 0, 3);
- GroupButtonsLayout->addWidget(HelpButton, 0, 4);
- GroupButtonsLayout->addColSpacing(2, 10);
- GroupButtonsLayout->setColStretch(2, 10);
+ GroupButtonsLayout->addWidget(OkButton);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(ApplyButton);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(CloseButton);
+ GroupButtonsLayout->addWidget(HelpButton);
/***************************************************************/
// layouting
- topLayout->addWidget(GroupConstructors, 0, 0);
- topLayout->addWidget(GroupArguments, 1, 0);
- topLayout->addWidget(GroupButtons, 2, 0);
+ topLayout->addWidget(ConstructorsBox);
+ topLayout->addWidget(GroupArguments);
+ topLayout->addWidget(GroupButtons);
/***************************************************************/
// Initialisations
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
connect(AddAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleAdded()));
connect(RemoveAngleButton, SIGNAL(clicked()), this, SLOT(OnAngleRemoved()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SelectPathMeshButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(ElementsLineEdit, SIGNAL(textChanged(const QString&)),
- SLOT(onTextChange(const QString&)));
+ SLOT(onTextChange(const QString&)));
connect(StartPointLineEdit, SIGNAL(textChanged(const QString&)),
- SLOT(onTextChange(const QString&)));
+ SLOT(onTextChange(const QString&)));
connect(MeshCheck, SIGNAL(toggled(bool)), SLOT(onSelectMesh()));
- connect(AnglesCheck, SIGNAL(toggled(bool)), SLOT(onAnglesCheck()));
- connect(BasePointCheck, SIGNAL(toggled(bool)), SLOT(onBasePointCheck()));
AnglesList->installEventFilter(this);
ElementsLineEdit->installEventFilter(this);
XSpin->editor()->installEventFilter(this);
YSpin->editor()->installEventFilter(this);
ZSpin->editor()->installEventFilter(this);
-
- /***************************************************************/
-
- this->show(); // displays Dialog
}
//=================================================================================
MeshCheck->setChecked(false);
ConstructorsClicked(0);
onSelectMesh();
- onAnglesCheck();
- onBasePointCheck();
}
SetEditCurrentArgument(0);
}
// get IDs from group
// 1d elements or 2d elements
if (Elements1dRB->isChecked() && aGroup->GetType() == SMESH::EDGE ||
- Elements2dRB->isChecked() && aGroup->GetType() == SMESH::FACE)
+ Elements2dRB->isChecked() && aGroup->GetType() == SMESH::FACE)
anElementsId = aGroup->GetListOfID();
}
} else {
SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh();
if (aMesh) {
- QStringList aListElementsId = QStringList::split(" ", ElementsLineEdit->text(), false);
+ QStringList aListElementsId = ElementsLineEdit->text().split(" ", QString::SkipEmptyParts);
anElementsId = new SMESH::long_array;
anElementsId->length(aListElementsId.count());
bool bOk;
return false;
}
- if (StartPointLineEdit->text().stripWhiteSpace().isEmpty()) {
+ if (StartPointLineEdit->text().trimmed().isEmpty()) {
return false;
}
// get angles
SMESH::double_array_var anAngles = new SMESH::double_array;
- if (AnglesCheck->isChecked()) {
+ if (AnglesGrp->isChecked()) {
anAngles->length(AnglesList->count());
int j = 0;
bool bOk;
for (int i = 0; i < AnglesList->count(); i++) {
- double angle = AnglesList->text(i).toDouble(&bOk);
+ double angle = AnglesList->item(i)->text().toDouble(&bOk);
if (bOk)
anAngles[ j++ ] = angle*PI/180;
}
// get base point
SMESH::PointStruct aBasePoint;
- if (BasePointCheck->isChecked()) {
+ if (BasePointGrp->isChecked()) {
aBasePoint.x = XSpin->GetValue();
aBasePoint.y = YSpin->GetValue();
aBasePoint.z = ZSpin->GetValue();
SMESH::ListOfGroups_var groups =
aMeshEditor->ExtrusionAlongPathMakeGroups(anElementsId.inout(), myPathMesh,
myPathShape, aNodeStart,
- AnglesCheck->isChecked(), anAngles.inout(),
- BasePointCheck->isChecked(), aBasePoint, retVal);
+ AnglesGrp->isChecked(), anAngles.inout(),
+ BasePointGrp->isChecked(), aBasePoint, retVal);
else
retVal = aMeshEditor->ExtrusionAlongPath(anElementsId.inout(), myPathMesh,
myPathShape, aNodeStart,
- AnglesCheck->isChecked(), anAngles.inout(),
- BasePointCheck->isChecked(), aBasePoint);
+ AnglesGrp->isChecked(), anAngles.inout(),
+ BasePointGrp->isChecked(), aBasePoint);
//wc.stop();
wc.suspend();
switch (retVal) {
case SMESH::SMESH_MeshEditor::EXTR_NO_ELEMENTS:
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- tr("SMESH_ERROR"),
- tr("NO_ELEMENTS_SELECTED"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("NO_ELEMENTS_SELECTED"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_PATH_NOT_EDGE:
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- tr("SMESH_ERROR"),
- tr("SELECTED_PATH_IS_NOT_EDGE"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("SELECTED_PATH_IS_NOT_EDGE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_PATH_SHAPE:
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- tr("SMESH_ERROR"),
- tr("BAD_SHAPE_TYPE"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("BAD_SHAPE_TYPE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_STARTING_NODE:
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- tr("SMESH_ERROR"),
- tr("EXTR_BAD_STARTING_NODE"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("EXTR_BAD_STARTING_NODE"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_BAD_ANGLES_NUMBER:
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- tr("SMESH_ERROR"),
- tr("WRONG_ANGLES_NUMBER"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("WRONG_ANGLES_NUMBER"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_CANT_GET_TANGENT:
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- tr("SMESH_ERROR"),
- tr("CANT_GET_TANGENT"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(this,
+ tr("SMESH_ERROR"),
+ tr("CANT_GET_TANGENT"));
return false; break;
case SMESH::SMESH_MeshEditor::EXTR_OK:
break;
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
aList.Append(myMeshActor->getIO());
mySelectionMgr->setSelectedObjects(aList, false);
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool bOk;
const Handle(SALOME_InteractiveObject)& anIO = myMeshActor->getIO();
TColStd_MapOfInteger newIndices;
QString aString;
int aNbUnits = SMESH::GetNameOfSelectedElements(mySelector, aPathActor->getIO(), aString);
if (aNbUnits == 1)
- StartPointLineEdit->setText(aString.stripWhiteSpace());
+ StartPointLineEdit->setText(aString.trimmed());
} else if (myEditCurrentArgument == XSpin) {
// we are now selecting base point
// reset is not performed here!
// return if is not enabled
- if (!BasePointGrp->isEnabled())
+ if (!BasePointGrp->isChecked())
return;
// try to get shape from selection
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter(GROUP);
SMESH_NumberFilter* aVertexFilter = new SMESH_NumberFilter ("GEOM", TopAbs_SHAPE,
-1, TopAbs_VERTEX);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
if (aVertexFilter) aListOfFilters.append(aVertexFilter);
//=================================================================================
void SMESHGUI_ExtrusionAlongPathDlg::DeactivateActiveDialog()
{
- if (GroupConstructors->isEnabled()) {
- GroupConstructors->setEnabled(false);
+ if (ConstructorsBox->isEnabled()) {
+ ConstructorsBox->setEnabled(false);
GroupArguments->setEnabled(false);
GroupButtons->setEnabled(false);
mySMESHGUI->ResetState();
{
// Emit a signal to deactivate the active dialog
mySMESHGUI->EmitSignalDeactivateDialog();
- GroupConstructors->setEnabled(true);
+ ConstructorsBox->setEnabled(true);
GroupArguments->setEnabled(true);
GroupButtons->setEnabled(true);
//=================================================================================
void SMESHGUI_ExtrusionAlongPathDlg::enterEvent (QEvent*)
{
- if (!GroupConstructors->isEnabled())
+ if (!ConstructorsBox->isEnabled())
ActivateThisDialog();
}
//=================================================================================
int SMESHGUI_ExtrusionAlongPathDlg::GetConstructorId()
{
- if (GroupConstructors != NULL && GroupConstructors->selected() != NULL)
- return GroupConstructors->id(GroupConstructors->selected());
- return -1;
-}
-
-//=======================================================================
-// function : onAnglesCheck()
-// purpose : called when "Use Angles" check box is switched
-//=======================================================================
-void SMESHGUI_ExtrusionAlongPathDlg::onAnglesCheck()
-{
- AnglesGrp->setEnabled(AnglesCheck->isChecked());
-}
-
-//=======================================================================
-// function : onBasePointCheck()
-// purpose : called when "Use Base Point" check box is switched
-//=======================================================================
-void SMESHGUI_ExtrusionAlongPathDlg::onBasePointCheck()
-{
- BasePointGrp->setEnabled(BasePointCheck->isChecked());
+ return GroupConstructors->checkedId();
}
//=======================================================================
//=======================================================================
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleAdded()
{
- AnglesList->insertItem(QString::number(AngleSpin->GetValue()));
+ AnglesList->addItem(QString::number(AngleSpin->GetValue()));
}
//=======================================================================
//=======================================================================
void SMESHGUI_ExtrusionAlongPathDlg::OnAngleRemoved()
{
- QList<QListBoxItem> aList;
- aList.setAutoDelete(false);
- for (int i = 0; i < AnglesList->count(); i++)
- if (AnglesList->isSelected(i))
- aList.append(AnglesList->item(i));
-
- for (int i = 0; i < aList.count(); i++)
- delete aList.at(i);
+ QList<QListWidgetItem*> aList = AnglesList->selectedItems();
+ QListWidgetItem* anItem;
+ foreach(anItem, aList) delete anItem;
}
//=================================================================================
if (event->type() == QEvent::KeyPress) {
QKeyEvent* ke = (QKeyEvent*)event;
if (object == AnglesList) {
- if (ke->key() == Key_Delete)
+ if (ke->key() == Qt::Key_Delete)
OnAngleRemoved();
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_ExtrusionAlongPathDlg.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S.
//
-// File : SMESHGUI_ExtrusionAlongPathDlg.h
-// Author : Vadim SANDLER
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_EXTRUSION_PATH_H
-#define DIALOGBOX_EXTRUSION_PATH_H
+#ifndef SMESHGUI_EXTRUSIONALONGPATHDLG_H
+#define SMESHGUI_EXTRUSIONALONGPATHDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-#include "SUIT_SelectionFilter.h"
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
class QButtonGroup;
class QRadioButton;
class QToolButton;
class QLineEdit;
class QCheckBox;
-class QListBox;
+class QListWidget;
class QPushButton;
class SMESHGUI;
class SMESH_Actor;
class SMESHGUI_SpinBox;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class LightApp_SelectionMgr;
+class SUIT_SelectionFilter;
//=================================================================================
// class : SMESHGUI_ExtrusionAlongPathDlg
{
Q_OBJECT
- class SetBusy {
- public:
- SetBusy (SMESHGUI_ExtrusionAlongPathDlg* _dlg) { myDlg = _dlg; myDlg->myBusy = true; }
- ~SetBusy() { myDlg->myBusy = false; }
- private:
- SMESHGUI_ExtrusionAlongPathDlg* myDlg;
- };
+ class SetBusy;
friend class SetBusy;
public:
- SMESHGUI_ExtrusionAlongPathDlg (SMESHGUI*,
- bool modal = FALSE);
+ SMESHGUI_ExtrusionAlongPathDlg( SMESHGUI* );
~SMESHGUI_ExtrusionAlongPathDlg();
- bool eventFilter (QObject* object, QEvent* event);
+ bool eventFilter( QObject*, QEvent* );
private:
- void Init (bool ResetControls = true);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void keyPressEvent(QKeyEvent*);
- int GetConstructorId();
- void SetEditCurrentArgument (QToolButton* button);
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- SVTK_Selector* mySelector;
-
- QWidget* myEditCurrentArgument; /* Current argument */
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myMeshActor;
- SMESH::SMESH_IDSource_var myIDSource;
- SMESH::SMESH_Mesh_var myPathMesh;
- GEOM::GEOM_Object_var myPathShape;
- SUIT_SelectionFilter* myElementsFilter;
- SUIT_SelectionFilter* myPathMeshFilter;
- int myType;
+ void Init( bool = true );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void keyPressEvent( QKeyEvent* );
+ int GetConstructorId();
+ void SetEditCurrentArgument( QToolButton* );
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ SVTK_Selector* mySelector;
+
+ QWidget* myEditCurrentArgument; /* Current argument */
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myMeshActor;
+ SMESH::SMESH_IDSource_var myIDSource;
+ SMESH::SMESH_Mesh_var myPathMesh;
+ GEOM::GEOM_Object_var myPathShape;
+ SUIT_SelectionFilter* myElementsFilter;
+ SUIT_SelectionFilter* myPathMeshFilter;
+ int myType;
// widgets
- QButtonGroup* GroupConstructors;
- QRadioButton* Elements1dRB;
- QRadioButton* Elements2dRB;
-
- QGroupBox* GroupArguments;
- QLabel* ElementsLab;
- QToolButton* SelectElementsButton;
- QLineEdit* ElementsLineEdit;
- QCheckBox* MeshCheck;
- QGroupBox* PathGrp;
- QLabel* PathMeshLab;
- QToolButton* SelectPathMeshButton;
- QLineEdit* PathMeshLineEdit;
- QLabel* PathShapeLab;
- QToolButton* SelectPathShapeButton;
- QLineEdit* PathShapeLineEdit;
- QLabel* StartPointLab;
- QToolButton* SelectStartPointButton;
- QLineEdit* StartPointLineEdit;
- QCheckBox* LinearAnglesCheck;
- QCheckBox* AnglesCheck;
- QGroupBox* AnglesGrp;
- QListBox* AnglesList;
- QToolButton* AddAngleButton;
- QToolButton* RemoveAngleButton;
- SMESHGUI_SpinBox* AngleSpin;
- QCheckBox* BasePointCheck;
- QGroupBox* BasePointGrp;
- QToolButton* SelectBasePointButton;
- QLabel* XLab;
- SMESHGUI_SpinBox* XSpin;
- QLabel* YLab;
- SMESHGUI_SpinBox* YSpin;
- QLabel* ZLab;
- SMESHGUI_SpinBox* ZSpin;
- QCheckBox* MakeGroupsCheck;
-
- QGroupBox* GroupButtons;
- QPushButton* OkButton;
- QPushButton* ApplyButton;
- QPushButton* CloseButton;
- QPushButton* HelpButton;
-
- QString myHelpFileName;
+ QGroupBox* ConstructorsBox;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* Elements1dRB;
+ QRadioButton* Elements2dRB;
+
+ QGroupBox* GroupArguments;
+ QLabel* ElementsLab;
+ QToolButton* SelectElementsButton;
+ QLineEdit* ElementsLineEdit;
+ QCheckBox* MeshCheck;
+ QGroupBox* PathGrp;
+ QToolButton* SelectPathMeshButton;
+ QLineEdit* PathMeshLineEdit;
+ QToolButton* SelectPathShapeButton;
+ QLineEdit* PathShapeLineEdit;
+ QToolButton* SelectStartPointButton;
+ QLineEdit* StartPointLineEdit;
+ QGroupBox* AnglesGrp;
+ QListWidget* AnglesList;
+ QToolButton* AddAngleButton;
+ QToolButton* RemoveAngleButton;
+ SMESHGUI_SpinBox* AngleSpin;
+ QGroupBox* BasePointGrp;
+ QToolButton* SelectBasePointButton;
+ SMESHGUI_SpinBox* XSpin;
+ SMESHGUI_SpinBox* YSpin;
+ SMESHGUI_SpinBox* ZSpin;
+ QCheckBox* MakeGroupsCheck;
+
+ QGroupBox* GroupButtons;
+ QPushButton* OkButton;
+ QPushButton* ApplyButton;
+ QPushButton* CloseButton;
+ QPushButton* HelpButton;
+
+ QString myHelpFileName;
protected slots:
- void reject();
+ void reject();
private slots:
- void ConstructorsClicked (int);
- void ClickOnOk();
- bool ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument();
- void SelectionIntoArgument();
- void DeactivateActiveDialog();
- void ActivateThisDialog();
- void onTextChange (const QString&);
- void onSelectMesh();
- void onAnglesCheck();
- void onBasePointCheck();
- void OnAngleAdded();
- void OnAngleRemoved();
+ void ConstructorsClicked( int );
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onSelectMesh();
+ void OnAngleAdded();
+ void OnAngleRemoved();
};
-#endif // DIALOGBOX_EXTRUSION_PATH_H
+#endif // SMESHGUI_EXTRUSIONALONGPATHDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_ExtrusionDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_ExtrusionDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_ExtrusionDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_NumberFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-
-#include "SMDS_Mesh.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_Session.h"
+#include <SMDS_Mesh.hxx>
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qpixmap.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+// Qt includes
+#include <QApplication>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QSpinBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// function : SMESHGUI_ExtrusionDlg()
// purpose : constructor
//=================================================================================
-SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule,
- bool modal)
- : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_ExtrusionDlg", modal, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_ExtrusionDlg::SMESHGUI_ExtrusionDlg (SMESHGUI* theModule)
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- resize(303, 185);
- setCaption(tr("EXTRUSION_ALONG_LINE"));
- setSizeGripEnabled(TRUE);
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle(tr("EXTRUSION_ALONG_LINE"));
+ setSizeGripEnabled(true);
- QGridLayout* SMESHGUI_ExtrusionDlgLayout = new QGridLayout(this);
- SMESHGUI_ExtrusionDlgLayout->setSpacing(6);
- SMESHGUI_ExtrusionDlgLayout->setMargin(11);
+ QVBoxLayout* SMESHGUI_ExtrusionDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_ExtrusionDlgLayout->setSpacing(SPACING);
+ SMESHGUI_ExtrusionDlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupConstructors = new QButtonGroup("GroupConstructors", this);
- GroupConstructors->setTitle(tr("SMESH_EXTRUSION"));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- QGridLayout* GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- RadioButton1= new QRadioButton(GroupConstructors, "RadioButton1");
- RadioButton1->setText(tr(""));
- RadioButton1->setPixmap(image0);
- GroupConstructorsLayout->addWidget(RadioButton1, 0, 0);
- RadioButton2= new QRadioButton(GroupConstructors, "RadioButton2");
- RadioButton2->setText(tr(""));
- RadioButton2->setPixmap(image1);
- GroupConstructorsLayout->addWidget(RadioButton2, 0, 2);
- SMESHGUI_ExtrusionDlgLayout->addWidget(GroupConstructors, 0, 0);
+ ConstructorsBox = new QGroupBox(tr("SMESH_EXTRUSION"), this);
+ GroupConstructors = new QButtonGroup(this);
+ QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
+ ConstructorsBoxLayout->setSpacing(SPACING);
+ ConstructorsBoxLayout->setMargin(MARGIN);
+
+ RadioButton1= new QRadioButton(ConstructorsBox);
+ RadioButton1->setIcon(image0);
+ RadioButton2= new QRadioButton(ConstructorsBox);
+ RadioButton2->setIcon(image1);
+
+ ConstructorsBoxLayout->addWidget(RadioButton1);
+ ConstructorsBoxLayout->addWidget(RadioButton2);
+
+ GroupConstructors->addButton(RadioButton1, 0);
+ GroupConstructors->addButton(RadioButton2, 1);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr(""));
- 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);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_ExtrusionDlgLayout->addWidget(GroupButtons, 2, 0);
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
/***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setTitle(tr("EXTRUSION_1D"));
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6);
- GroupArgumentsLayout->setMargin(11);
+ GroupArguments = new QGroupBox(tr("EXTRUSION_1D"), this);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
// Controls for elements selection
- TextLabelElements = new QLabel(GroupArguments, "TextLabelElements");
- TextLabelElements->setText(tr("SMESH_ID_ELEMENTS" ));
- TextLabelElements->setFixedWidth(74);
- GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
-
- SelectElementsButton = new QPushButton(GroupArguments, "SelectElementsButton");
- SelectElementsButton->setText(tr("" ));
- SelectElementsButton->setPixmap(image2);
- SelectElementsButton->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
+
+ SelectElementsButton = new QPushButton(GroupArguments);
+ SelectElementsButton->setIcon(image2);
- LineEditElements = new QLineEdit(GroupArguments, "LineEditElements");
- LineEditElements->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupArgumentsLayout->addMultiCellWidget(LineEditElements, 0, 0, 2, 7);
+ LineEditElements = new QLineEdit(GroupArguments);
+ LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
// Control for the whole mesh selection
- CheckBoxMesh = new QCheckBox(GroupArguments, "CheckBoxMesh");
- CheckBoxMesh->setText(tr("SMESH_SELECT_WHOLE_MESH" ));
- GroupArgumentsLayout->addMultiCellWidget(CheckBoxMesh, 1, 1, 0, 7);
+ CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
// Controls for vector selection
- TextLabelVector = new QLabel(GroupArguments, "TextLabelVector");
- TextLabelVector->setText(tr("SMESH_VECTOR"));
- GroupArgumentsLayout->addWidget(TextLabelVector, 2, 0);
+ TextLabelVector = new QLabel(tr("SMESH_VECTOR"), GroupArguments);
- TextLabelDx = new QLabel(GroupArguments, "TextLabelDx");
- TextLabelDx->setText(tr("SMESH_DX"));
- GroupArgumentsLayout->addWidget(TextLabelDx, 2, 2);
+ TextLabelDx = new QLabel(tr("SMESH_DX"), GroupArguments);
+ SpinBox_Dx = new SMESHGUI_SpinBox(GroupArguments);
- SpinBox_Dx = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Dx");
- GroupArgumentsLayout->addWidget(SpinBox_Dx, 2, 3);
+ TextLabelDy = new QLabel(tr("SMESH_DY"), GroupArguments);
+ SpinBox_Dy = new SMESHGUI_SpinBox(GroupArguments);
- TextLabelDy = new QLabel(GroupArguments, "TextLabelDy");
- TextLabelDy->setText(tr("SMESH_DY"));
- GroupArgumentsLayout->addWidget(TextLabelDy, 2, 4);
-
- SpinBox_Dy = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Dy");
- GroupArgumentsLayout->addWidget(SpinBox_Dy, 2, 5);
-
- TextLabelDz = new QLabel(GroupArguments, "TextLabelDz");
- TextLabelDz->setText(tr("SMESH_DZ"));
- GroupArgumentsLayout->addWidget(TextLabelDz, 2, 6);
-
- SpinBox_Dz = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Dz");
- GroupArgumentsLayout->addWidget(SpinBox_Dz, 2, 7);
+ TextLabelDz = new QLabel(tr("SMESH_DZ"), GroupArguments);
+ SpinBox_Dz = new SMESHGUI_SpinBox(GroupArguments);
// Controls for nb. steps defining
- TextLabelNbSteps = new QLabel(GroupArguments, "TextLabelNbSteps");
- TextLabelNbSteps->setText(tr("SMESH_NUMBEROFSTEPS" ));
- GroupArgumentsLayout->addMultiCellWidget(TextLabelNbSteps, 3, 3, 0, 1);
-
- SpinBox_NbSteps = new QSpinBox(GroupArguments, "SpinBox_NbSteps");
- GroupArgumentsLayout->addMultiCellWidget(SpinBox_NbSteps, 3, 3, 2, 7);
+ TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupArguments);
+ SpinBox_NbSteps = new QSpinBox(GroupArguments);
// CheckBox for groups generation
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
- MakeGroupsCheck->setChecked(true);
- GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 4, 4, 0, 7);
+ GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
+ GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 6);
+ GroupArgumentsLayout->addWidget(CheckBoxMesh, 0, 0, 1, 8);
+ GroupArgumentsLayout->addWidget(TextLabelVector, 2, 0);
+ GroupArgumentsLayout->addWidget(TextLabelDx, 2, 2);
+ GroupArgumentsLayout->addWidget(SpinBox_Dx, 2, 3);
+ GroupArgumentsLayout->addWidget(TextLabelDy, 2, 4);
+ GroupArgumentsLayout->addWidget(SpinBox_Dy, 2, 5);
+ GroupArgumentsLayout->addWidget(TextLabelDz, 2, 6);
+ GroupArgumentsLayout->addWidget(SpinBox_Dz, 2, 7);
+ GroupArgumentsLayout->addWidget(TextLabelNbSteps, 3, 0);
+ GroupArgumentsLayout->addWidget(SpinBox_NbSteps, 3, 2, 1, 6);
+ GroupArgumentsLayout->addWidget(MakeGroupsCheck, 4, 0, 1, 8);
- SMESHGUI_ExtrusionDlgLayout->addWidget(GroupArguments, 1, 0);
+ /***************************************************************/
+ SMESHGUI_ExtrusionDlgLayout->addWidget(ConstructorsBox);
+ SMESHGUI_ExtrusionDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_ExtrusionDlgLayout->addWidget(GroupButtons);
/* Initialisations */
SpinBox_Dx->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_Dy->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_Dz->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- QIntValidator* anIntValidator = new QIntValidator(SpinBox_NbSteps);
- SpinBox_NbSteps->setValidator(anIntValidator);
SpinBox_NbSteps->setRange(1, 999999);
- GroupArguments->show();
- RadioButton1->setChecked(TRUE);
+ RadioButton1->setChecked(true);
+ MakeGroupsCheck->setChecked(true);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
/***************************************************************/
// signals and slots connections
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
// to update state of the Ok & Apply buttons
connect(SpinBox_Dx, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable()));
connect(SpinBox_Dy, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable()));
connect(SpinBox_Dz, SIGNAL(valueChanged(double)), SLOT(CheckIsEnable()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
- connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
- connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
- connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
+ connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
/***************************************************************/
- this->show(); // displays Dialog
-
ConstructorsClicked(0);
SelectionIntoArgument();
}
//=================================================================================
SMESHGUI_ExtrusionDlg::~SMESHGUI_ExtrusionDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
SMESH::ListOfGroups_var groups =
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
// hilight entered elements/nodes
if (!myIO.IsNull()) {
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
if (send == LineEditElements)
{
//=================================================================================
void SMESHGUI_ExtrusionDlg::DeactivateActiveDialog()
{
- if (GroupConstructors->isEnabled()) {
- GroupConstructors->setEnabled(false);
+ if (ConstructorsBox->isEnabled()) {
+ ConstructorsBox->setEnabled(false);
GroupArguments->setEnabled(false);
GroupButtons->setEnabled(false);
mySMESHGUI->ResetState();
{
// Emit a signal to deactivate the active dialog
mySMESHGUI->EmitSignalDeactivateDialog();
- GroupConstructors->setEnabled(true);
+ ConstructorsBox->setEnabled(true);
GroupArguments->setEnabled(true);
GroupButtons->setEnabled(true);
//=================================================================================
void SMESHGUI_ExtrusionDlg::enterEvent (QEvent*)
{
- if (!GroupConstructors->isEnabled())
+ if (!ConstructorsBox->isEnabled())
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-//void SMESHGUI_ExtrusionDlg::closeEvent (QCloseEvent*)
-//{
-// /* same than click on cancel button */
-// this->ClickOnCancel();
-//}
-//
-//=================================================================================
-// function : hideEvent()
-// purpose : caused by ESC key
-//=================================================================================
-//void SMESHGUI_ExtrusionDlg::hideEvent (QHideEvent*)
-//{
-// if (!isMinimized())
-// ClickOnCancel();
-//}
-
//=================================================================================
// function : onSelectMesh()
// purpose :
//=================================================================================
int SMESHGUI_ExtrusionDlg::GetConstructorId()
{
- if (GroupConstructors != NULL && GroupConstructors->selected() != NULL)
- return GroupConstructors->id(GroupConstructors->selected());
- return -1;
+ return GroupConstructors->checkedId();
}
//=================================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_ExtrusionDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_ExtrusionDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_EXTRUSION_H
-#define DIALOGBOX_EXTRUSION_H
+#ifndef SMESHGUI_EXTRUSIONDLG_H
+#define SMESHGUI_EXTRUSIONDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-#include "SUIT_SelectionFilter.h"
-#include "Handle_SALOME_InteractiveObject.hxx"
+// SALOME GUI includes
+#include <SALOME_InteractiveObject.hxx>
-// QT Includes
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
class QButtonGroup;
class QRadioButton;
class QGroupBox;
class SMESHGUI;
class SMESH_Actor;
class SMESHGUI_SpinBox;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class LightApp_SelectionMgr;
+class SUIT_SelectionFilter;
//=================================================================================
// class : SMESHGUI_ExtrusionDlg
Q_OBJECT
public:
- SMESHGUI_ExtrusionDlg (SMESHGUI*,
- bool modal = FALSE);
+ SMESHGUI_ExtrusionDlg( SMESHGUI* );
~SMESHGUI_ExtrusionDlg();
private:
- void Init (bool ResetControls = true);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void keyPressEvent(QKeyEvent*);
- int GetConstructorId();
- //void closeEvent (QCloseEvent*);
- //void hideEvent (QHideEvent*); /* ESC key */
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- QLineEdit* myEditCurrentArgument; /* Current LineEdit */
- //QString myElementsId;
- int myNbOkElements; /* to check when elements are defined */
- SVTK_Selector* mySelector;
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH::long_array_var myElementsId;
- SMESH_Actor* myActor;
+ void Init( bool = true );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void keyPressEvent( QKeyEvent* );
+ int GetConstructorId();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+ int myNbOkElements; /* to check when elements are defined */
+ SVTK_Selector* mySelector;
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH::long_array_var myElementsId;
+ SMESH_Actor* myActor;
Handle(SALOME_InteractiveObject) myIO;
- SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter;
+ SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter;
// widgets
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton1;
- QRadioButton* RadioButton2;
-
- QGroupBox* GroupArguments;
- QLabel* TextLabelElements;
- QPushButton* SelectElementsButton;
- QLineEdit* LineEditElements;
- QCheckBox* CheckBoxMesh;
- QLabel* TextLabelVector;
- QLabel* TextLabelDx;
- SMESHGUI_SpinBox* SpinBox_Dx;
- QLabel* TextLabelDy;
- SMESHGUI_SpinBox* SpinBox_Dy;
- QLabel* TextLabelDz;
- SMESHGUI_SpinBox* SpinBox_Dz;
- QLabel* TextLabelNbSteps;
- QSpinBox* SpinBox_NbSteps;
- QCheckBox* MakeGroupsCheck;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
-
- QString myHelpFileName;
+ QGroupBox* ConstructorsBox;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+
+ QGroupBox* GroupArguments;
+ QLabel* TextLabelElements;
+ QPushButton* SelectElementsButton;
+ QLineEdit* LineEditElements;
+ QCheckBox* CheckBoxMesh;
+ QLabel* TextLabelVector;
+ QLabel* TextLabelDx;
+ SMESHGUI_SpinBox* SpinBox_Dx;
+ QLabel* TextLabelDy;
+ SMESHGUI_SpinBox* SpinBox_Dy;
+ QLabel* TextLabelDz;
+ SMESHGUI_SpinBox* SpinBox_Dz;
+ QLabel* TextLabelNbSteps;
+ QSpinBox* SpinBox_NbSteps;
+ QCheckBox* MakeGroupsCheck;
+
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+
+ QString myHelpFileName;
private slots:
- void ConstructorsClicked (int);
- void CheckIsEnable();
- void ClickOnOk();
- bool ClickOnApply();
- void ClickOnCancel();
- void ClickOnHelp();
- void SetEditCurrentArgument();
- void SelectionIntoArgument();
- void DeactivateActiveDialog();
- void ActivateThisDialog();
- void onTextChange (const QString&);
- void onSelectMesh (bool toSelectMesh);
+ void ConstructorsClicked( int );
+ void CheckIsEnable();
+ void ClickOnOk();
+ bool ClickOnApply();
+ void ClickOnCancel();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onSelectMesh( bool );
};
-#endif // DIALOGBOX_EXTRUSION_H
+#endif // SMESHGUI_EXTRUSIONDLG_H
-// SMESHGUI_PredicateFilter : Filters for VTK viewer
+// SMESHGUI_Filter : Filters for VTK viewer
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_Filter.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_Filter.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_Filter.h"
-#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
-#include "SMESH_Actor.h"
-#include "SMDS_Mesh.hxx"
-#include "SMDS_MeshElement.hxx"
-#include "SMDSAbs_ElementType.hxx"
-
-// OCCT Includes
-#include <gp_Vec.hxx>
-#include <Precision.hxx>
-
-// VTK Includes
-#include <vtkCell.h>
+#include <SMESH_Actor.h>
+#include <SMDS_Mesh.hxx>
+#include <SMDSAbs_ElementType.hxx>
IMPLEMENT_STANDARD_HANDLE(SMESHGUI_Filter, VTKViewer_Filter)
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_Filter, VTKViewer_Filter)
//=======================================================================
bool SMESHGUI_PredicateFilter::IsNodeFilter() const
{
- return GetId() == SMESHGUI_NodeFilter;
+ return GetId() == SMESH::NodeFilter;
}
//=======================================================================
//=======================================================================
int SMESHGUI_PredicateFilter::GetId() const
{
- if ( myPred->GetElementType() == SMESH::NODE ) return SMESHGUI_NodeFilter;
- else if ( myPred->GetElementType() == SMESH::EDGE ) return SMESHGUI_EdgeFilter;
- else if ( myPred->GetElementType() == SMESH::FACE ) return SMESHGUI_FaceFilter;
- else if ( myPred->GetElementType() == SMESH::VOLUME ) return SMESHGUI_VolumeFilter;
- else if ( myPred->GetElementType() == SMESH::ALL ) return SMESHGUI_AllElementsFilter;
- else return SMESHGUI_UnknownFilter;
+ if ( myPred->GetElementType() == SMESH::NODE ) return SMESH::NodeFilter;
+ else if ( myPred->GetElementType() == SMESH::EDGE ) return SMESH::EdgeFilter;
+ else if ( myPred->GetElementType() == SMESH::FACE ) return SMESH::FaceFilter;
+ else if ( myPred->GetElementType() == SMESH::VOLUME ) return SMESH::VolumeFilter;
+ else if ( myPred->GetElementType() == SMESH::ALL ) return SMESH::AllElementsFilter;
+ else return SMESH::UnknownFilter;
}
//=======================================================================
int SMESHGUI_QuadrangleFilter::GetId() const
{
- return SMESHGUI_QuadFilter;
+ return SMESH::QuadFilter;
}
//=======================================================================
//=======================================================================
int SMESHGUI_TriangleFilter::GetId() const
{
- return SMESHGUI_TriaFilter;
+ return SMESH::TriaFilter;
}
//=======================================================================
//=======================================================================
int SMESHGUI_FacesFilter::GetId() const
{
- return SMESHGUI_FaceFilter;
+ return SMESH::FaceFilter;
}
//=======================================================================
//=======================================================================
int SMESHGUI_VolumesFilter::GetId() const
{
- return SMESHGUI_VolumeFilter;
+ return SMESH::VolumeFilter;
}
//=======================================================================
-// SMESHGUI_Filter : Filters for VTK viewer
+// SMESHGUI_Filter : Filters for VTK viewer
//
-// 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) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// 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 : SMESHGUI_Filter.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_Filter.h
-// Author : Sergey LITONIN
-// Module : SMESH
-#ifndef SMESHGUI_Filter_HeaderFile
-#define SMESHGUI_Filter_HeaderFile
+#ifndef SMESHGUI_FILTER_H
+#define SMESHGUI_FILTER_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "VTKViewer_Filter.h"
+// SALOME GUI includes
+#include <VTKViewer_Filter.h>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Filter)
class SALOME_Actor;
-enum SMESHGUI_FilterType
+namespace SMESH
{
- SMESHGUI_UnknownFilter = -1,
- SMESHGUI_NodeFilter = 0,
- SMESHGUI_EdgeFilter = 1,
- SMESHGUI_FaceFilter = 2,
- SMESHGUI_VolumeFilter = 3,
- SMESHGUI_AllElementsFilter = 4,
- SMESHGUI_QuadFilter = 5,
- SMESHGUI_TriaFilter = 6,
- SMESHGUI_LastFilter
+ enum SMESHGUI_FilterType {
+ UnknownFilter = -1,
+ NodeFilter = 0,
+ EdgeFilter = 1,
+ FaceFilter = 2,
+ VolumeFilter = 3,
+ AllElementsFilter = 4,
+ QuadFilter = 5,
+ TriaFilter = 6,
+ LastFilter
+ };
};
/*
DEFINE_STANDARD_HANDLE(SMESHGUI_Filter, VTKViewer_Filter)
-class SMESHGUI_Filter : public VTKViewer_Filter
+class SMESHGUI_EXPORT SMESHGUI_Filter : public VTKViewer_Filter
{
-
public:
+ virtual bool IsObjValid( const int ) const = 0;
- virtual bool IsObjValid( const int theObjId ) const = 0;
public:
DEFINE_STANDARD_RTTI(SMESHGUI_Filter)
};
DEFINE_STANDARD_HANDLE(SMESHGUI_PredicateFilter, SMESHGUI_Filter)
-class SMESHGUI_PredicateFilter : public SMESHGUI_Filter
+class SMESHGUI_EXPORT SMESHGUI_PredicateFilter : public SMESHGUI_Filter
{
-
public:
- SMESHGUI_PredicateFilter();
- virtual ~SMESHGUI_PredicateFilter();
+ SMESHGUI_PredicateFilter();
+ virtual ~SMESHGUI_PredicateFilter();
- virtual bool IsValid( const int theCellId ) const;
- virtual bool IsObjValid( const int theObjId ) const;
+ virtual bool IsValid( const int ) const;
+ virtual bool IsObjValid( const int ) const;
virtual int GetId() const;
virtual bool IsNodeFilter() const;
void SetPredicate( SMESH::Predicate_ptr );
void SetActor( SALOME_Actor* );
private:
-
SMESH::Predicate_var myPred;
public:
DEFINE_STANDARD_HANDLE(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter)
-class SMESHGUI_QuadrangleFilter : public SMESHGUI_Filter
+class SMESHGUI_EXPORT SMESHGUI_QuadrangleFilter : public SMESHGUI_Filter
{
-
public:
- SMESHGUI_QuadrangleFilter();
- virtual ~SMESHGUI_QuadrangleFilter();
+ SMESHGUI_QuadrangleFilter();
+ virtual ~SMESHGUI_QuadrangleFilter();
- virtual bool IsValid( const int theCellId ) const;
- virtual bool IsObjValid( const int theObjId ) const;
+ virtual bool IsValid( const int ) const;
+ virtual bool IsObjValid( const int ) const;
virtual int GetId() const;
virtual bool IsNodeFilter() const;
DEFINE_STANDARD_HANDLE(SMESHGUI_TriangleFilter, SMESHGUI_Filter)
-class SMESHGUI_TriangleFilter : public SMESHGUI_Filter
+class SMESHGUI_EXPORT SMESHGUI_TriangleFilter : public SMESHGUI_Filter
{
-
public:
- SMESHGUI_TriangleFilter();
- virtual ~SMESHGUI_TriangleFilter();
+ SMESHGUI_TriangleFilter();
+ virtual ~SMESHGUI_TriangleFilter();
- virtual bool IsValid( const int theCellId ) const;
- virtual bool IsObjValid( const int theObjId ) const;
+ virtual bool IsValid( const int ) const;
+ virtual bool IsObjValid( const int ) const;
virtual int GetId() const;
virtual bool IsNodeFilter() const;
DEFINE_STANDARD_HANDLE(SMESHGUI_FacesFilter, SMESHGUI_Filter)
-class SMESHGUI_FacesFilter : public SMESHGUI_Filter
+class SMESHGUI_EXPORT SMESHGUI_FacesFilter : public SMESHGUI_Filter
{
-
public:
- SMESHGUI_FacesFilter();
- virtual ~SMESHGUI_FacesFilter();
+ SMESHGUI_FacesFilter();
+ virtual ~SMESHGUI_FacesFilter();
- virtual bool IsValid( const int theCellId ) const;
- virtual bool IsObjValid( const int theObjId ) const;
+ virtual bool IsValid( const int ) const;
+ virtual bool IsObjValid( const int ) const;
virtual int GetId() const;
virtual bool IsNodeFilter() const;
DEFINE_STANDARD_HANDLE(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
-class SMESHGUI_VolumesFilter : public SMESHGUI_Filter
+class SMESHGUI_EXPORT SMESHGUI_VolumesFilter : public SMESHGUI_Filter
{
-
public:
- SMESHGUI_VolumesFilter();
- virtual ~SMESHGUI_VolumesFilter();
+ SMESHGUI_VolumesFilter();
+ virtual ~SMESHGUI_VolumesFilter();
- virtual bool IsValid( const int theCellId ) const;
- virtual bool IsObjValid( const int theObjId ) const;
+ virtual bool IsValid( const int ) const;
+ virtual bool IsObjValid( const int ) const;
virtual int GetId() const;
virtual bool IsNodeFilter() const;
DEFINE_STANDARD_RTTI(SMESHGUI_VolumesFilter)
};
-#endif
+#endif // SMESHGUI_FILTER_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_FilterDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_FilterDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_FilterDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_FilterUtils.h"
#include "SMESHGUI_FilterLibraryDlg.h"
-#include "SMESH_Actor.h"
-#include "SMESH_NumberFilter.hxx"
-#include "SMESH_TypeFilter.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_NumberFilter.hxx>
+#include <SMESH_TypeFilter.hxx>
+
+// SALOME GEOM includes
+#include <GEOMBase.h>
+#include <GEOM_FaceFilter.h>
+#include <GEOM_TypeFilter.h>
-#include "GEOMBase.h"
-#include "GEOM_FaceFilter.h"
-#include "GEOM_TypeFilter.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Tools.h>
+#include <SalomeApp_Study.h>
-#include "LightApp_Application.h"
-#include "SalomeApp_Tools.h"
-#include "SalomeApp_Study.h"
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
+#include <SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx>
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger.hxx"
-#include "SALOMEDSClient_Study.hxx"
+#include <SVTK_ViewWindow.h>
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_Study.hxx>
-// OCCT Includes
+// OCCT includes
#include <StdSelect_TypeOfFace.hxx>
#include <BRep_Tool.hxx>
#include <TopoDS.hxx>
-#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <Geom_Plane.hxx>
#include <Geom_CylindricalSurface.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qtable.h>
-#include <qstringlist.h>
-#include <qlayout.h>
-#include <qwidgetstack.h>
-#include <qapplication.h>
-#include <qcombobox.h>
-#include <qfontmetrics.h>
-#include <qmessagebox.h>
-#include <qlabel.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qregexp.h>
-#include <qlistbox.h>
-#include <qcheckbox.h>
-#include <qobjectlist.h>
-#include <qvalidator.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+// Qt includes
+#include <QFrame>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QTableWidget>
+#include <QStringList>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QStackedWidget>
+#include <QApplication>
+#include <QComboBox>
+#include <QFontMetrics>
+#include <QLabel>
+#include <QButtonGroup>
+#include <QRadioButton>
+#include <QRegExp>
+#include <QListWidget>
+#include <QCheckBox>
+#include <QItemDelegate>
+#include <QDoubleValidator>
+#include <QKeyEvent>
+#include <QHeaderView>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
-#define SPACING 5
-#define MARGIN 10
-
-using namespace SMESH;
+#define SPACING 6
+#define MARGIN 11
+//---------------------------------------
+// maxLength
+//---------------------------------------
static int maxLength (const QMap<int, QString> theMap, const QFontMetrics& theMetrics)
{
int aRes = 0;
QMap<int, QString>::const_iterator anIter;
for (anIter = theMap.begin(); anIter != theMap.end(); ++anIter)
- aRes = Max(aRes, theMetrics.width(anIter.data()));
+ aRes = qMax(aRes, theMetrics.width(anIter.value()));
return aRes;
}
+//---------------------------------------
+// getFilterId
+//---------------------------------------
static int getFilterId (SMESH::ElementType theType)
{
switch (theType)
{
- case SMESH::NODE : return SMESHGUI_NodeFilter;
- case SMESH::EDGE : return SMESHGUI_EdgeFilter;
- case SMESH::FACE : return SMESHGUI_FaceFilter;
- case SMESH::VOLUME : return SMESHGUI_VolumeFilter;
- case SMESH::ALL : return SMESHGUI_AllElementsFilter;
- default : return SMESHGUI_UnknownFilter;
+ case SMESH::NODE : return SMESH::NodeFilter;
+ case SMESH::EDGE : return SMESH::EdgeFilter;
+ case SMESH::FACE : return SMESH::FaceFilter;
+ case SMESH::VOLUME : return SMESH::VolumeFilter;
+ case SMESH::ALL : return SMESH::AllElementsFilter;
+ default : return SMESH::UnknownFilter;
}
}
Description : Class for storing additional parameters of criterion
*/
-class SMESHGUI_FilterTable::AdditionalWidget : public QFrame
+class SMESHGUI_FilterTable::AdditionalWidget : public QWidget
{
public:
enum { Tolerance };
public:
-
- AdditionalWidget(QWidget* theParent);
- virtual ~AdditionalWidget();
-
- virtual void GetParameters(QValueList<int>&) const;
- virtual bool IsValid(const bool theMsg = true) const;
- virtual double GetDouble(const int theId) const;
- virtual int GetInteger(const int theId) const;
- virtual QString GetString(const int theId) const;
- virtual void SetDouble(const int theId, const double theVal);
- virtual void SetInteger(const int theId, const int theVal);
- virtual void SetString(const int theId, const QString& theVal);
- void SetEditable(const int theId, const bool isEditable);
- void SetEditable(const bool isEditable);
+ AdditionalWidget(QWidget* theParent);
+ virtual ~AdditionalWidget();
+
+ virtual QList<int> GetParameters() const;
+ virtual bool IsValid(const bool = true) const;
+ virtual double GetDouble(const int) const;
+ virtual int GetInteger(const int) const;
+ virtual QString GetString(const int) const;
+ virtual void SetDouble(const int, const double);
+ virtual void SetInteger(const int, const int);
+ virtual void SetString(const int, const QString&);
+ void SetEditable(const int, const bool);
+ void SetEditable(const bool);
private:
QMap< int, QLineEdit* > myLineEdits;
};
SMESHGUI_FilterTable::AdditionalWidget::AdditionalWidget (QWidget* theParent)
- : QFrame(theParent)
+ : QWidget(theParent)
{
QLabel* aLabel = new QLabel(tr("SMESH_TOLERANCE"), this);
myLineEdits[ Tolerance ] = new QLineEdit(this);
aValidator->setBottom(0);
myLineEdits[ Tolerance ]->setValidator(aValidator);
- QHBoxLayout* aLay = new QHBoxLayout(this, 0, SPACING);
+ QHBoxLayout* aLay = new QHBoxLayout(this);
+ aLay->setSpacing(SPACING);
+ aLay->setMargin(0);
+
aLay->addWidget(aLabel);
aLay->addWidget(myLineEdits[ Tolerance ]);
-
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
- aLay->addItem(aSpacer);
+ aLay->addStretch();
QString aText = QString("%1").arg(Precision::Confusion());
myLineEdits[ Tolerance ]->setText(aText);
}
- SMESHGUI_FilterTable::AdditionalWidget::~AdditionalWidget()
+SMESHGUI_FilterTable::AdditionalWidget::~AdditionalWidget()
{
}
-void SMESHGUI_FilterTable::AdditionalWidget::GetParameters (QValueList<int>& theList) const
+QList<int> SMESHGUI_FilterTable::AdditionalWidget::GetParameters() const
{
- theList.clear();
+ QList<int> theList;
theList.append(Tolerance);
+ return theList;
}
bool SMESHGUI_FilterTable::AdditionalWidget::IsValid (const bool theMsg) const
if (!isEnabled())
return true;
- QValueList<int> aParams;
- GetParameters(aParams);
- QValueList<int>::const_iterator anIter;
+ QList<int> aParams = GetParameters();
+ QList<int>::const_iterator anIter;
for (anIter = aParams.begin(); anIter != aParams.end(); ++anIter) {
const QLineEdit* aWg = myLineEdits[ *anIter ];
int p = 0;
QString aText = aWg->text();
if (aWg->isEnabled() && aWg->validator()->validate(aText, p) != QValidator::Acceptable) {
if (theMsg)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
}
void SMESHGUI_FilterTable::AdditionalWidget::SetEditable (const int theId, const bool isEditable)
{
if (myLineEdits.contains(theId))
- myLineEdits[ theId ]->setEdited(isEditable);
+ myLineEdits[ theId ]->setReadOnly(!isEditable);
}
void SMESHGUI_FilterTable::AdditionalWidget::SetEditable (const bool isEditable)
{
- QValueList<int> aParams;
- GetParameters(aParams);
- QValueList<int>::const_iterator anIter;
+ QList<int> aParams = GetParameters();
+ QList<int>::const_iterator anIter;
for (anIter = aParams.begin(); anIter != aParams.end(); ++anIter)
- myLineEdits[ *anIter ]->setEdited(isEditable);
+ SetEditable( *anIter, isEditable );
}
/*
Description : Combo table item. Identificator corresponding to string may be assigned
*/
-class SMESHGUI_FilterTable::ComboItem : public QComboTableItem
+class SMESHGUI_FilterTable::ComboItem : public QTableWidgetItem
{
public:
- ComboItem(QTable*, const QMap<int, QString>&);
- virtual ~ComboItem();
+ static int Type();
+
+ ComboItem( const QMap<int, QString>& );
- virtual void setStringList (const QStringList & l);
- void setStringList(const QMap<int, QString>& theIds);
+ void setItems( const QMap<int, QString>& );
+ void clear();
+ int count() const;
- int GetValue() const;
- void SetValue(const int);
+ int value() const;
+ void setValue( const int );
private:
+ int id( int ) const;
+ int index( int ) const;
- QMap<int, int> myNumToId;
- QMap<int, int> myIdToNum;
+private:
+ QMap<int, int> myIdToIdx;
};
-SMESHGUI_FilterTable::ComboItem::ComboItem (QTable* theParent,
- const QMap<int, QString>& theIds)
-: QComboTableItem(theParent, QStringList())
+int SMESHGUI_FilterTable::ComboItem::Type()
{
- setStringList(theIds);
+ return QTableWidgetItem::UserType + 1;
}
-void SMESHGUI_FilterTable::ComboItem::setStringList (const QStringList & l)
+SMESHGUI_FilterTable::ComboItem::ComboItem( const QMap<int, QString>& theIds )
+ : QTableWidgetItem( Type() )
{
- QComboTableItem::setStringList(l);
+ setItems( theIds );
}
-void SMESHGUI_FilterTable::ComboItem::setStringList (const QMap<int, QString>& theIds)
+void SMESHGUI_FilterTable::ComboItem::setItems( const QMap<int, QString>& theIds )
{
- int i = 0;
- QStringList aList;
- QMap<int, QString>::const_iterator anIter;
- for (anIter = theIds.begin(); anIter != theIds.end(); ++anIter) {
- myNumToId[ i ] = anIter.key();
- myIdToNum[ anIter.key() ] = i;
- aList.append(anIter.data());
- i++;
+ myIdToIdx.clear();
+ QMap<int, QString>::const_iterator it;
+ QStringList items;
+ for ( it = theIds.begin(); it != theIds.end(); ++it ) {
+ myIdToIdx[it.key()] = items.count();
+ items.append( it.value() );
}
+ setData( Qt::UserRole, items );
+ setValue( id( 0 ) );
+}
+
+void SMESHGUI_FilterTable::ComboItem::clear()
+{
+ QMap<int, QString> empty;
+ setItems( empty );
+}
+
+int SMESHGUI_FilterTable::ComboItem::count() const
+{
+ return myIdToIdx.count();
+}
+
+int SMESHGUI_FilterTable::ComboItem::value() const
+{
+ return( id( data( Qt::UserRole ).toStringList().indexOf( text() ) ) );
+}
+
+void SMESHGUI_FilterTable::ComboItem::setValue( const int theId )
+{
+ int idx = index( theId );
+ QStringList items = data( Qt::UserRole ).toStringList();
+ setText( idx >= 0 && idx < items.count() ? items[idx] : "" );
+}
- setStringList(aList);
+int SMESHGUI_FilterTable::ComboItem::id( int idx ) const
+{
+ QMap<int,int>::const_iterator it;
+ for ( it = myIdToIdx.begin(); it != myIdToIdx.end(); ++it )
+ if ( it.value() == idx ) return it.key();
+ return -1;
}
-SMESHGUI_FilterTable::ComboItem::~ComboItem()
+int SMESHGUI_FilterTable::ComboItem::index( int i ) const
{
+ return myIdToIdx.contains( i ) ? myIdToIdx[i] : -1;
}
+/*
+ Class : SMESHGUI_FilterTable::CheckItem
+ Description : Check table item.
+*/
-int SMESHGUI_FilterTable::ComboItem::GetValue() const
+class SMESHGUI_FilterTable::CheckItem : public QTableWidgetItem
{
- return myNumToId[ currentItem() ];
+public:
+ static int Type();
+
+ CheckItem( bool = false );
+ CheckItem( const QString&, bool = false );
+ ~CheckItem();
+
+ void setChecked( bool );
+ bool checked() const;
+};
+
+int SMESHGUI_FilterTable::CheckItem::Type()
+{
+ return QTableWidgetItem::UserType + 2;
+}
+
+SMESHGUI_FilterTable::CheckItem::CheckItem( bool value )
+ : QTableWidgetItem( Type() )
+{
+ Qt::ItemFlags f = flags();
+ f = f | Qt::ItemIsUserCheckable;
+ f = f & ~Qt::ItemIsTristate;
+ setFlags( f );
+ setChecked(value);
+}
+
+SMESHGUI_FilterTable::CheckItem::CheckItem( const QString& text, bool value )
+ : QTableWidgetItem( Type() )
+{
+ Qt::ItemFlags f = flags();
+ f = f | Qt::ItemIsUserCheckable;
+ f = f & ~Qt::ItemIsTristate;
+ setFlags( f );
+ setChecked( value );
+ setText( text );
+}
+
+SMESHGUI_FilterTable::CheckItem::~CheckItem()
+{
+}
+
+void SMESHGUI_FilterTable::CheckItem::setChecked( bool value )
+{
+ setCheckState( value ? Qt::Checked : Qt::Unchecked );
+}
+
+bool SMESHGUI_FilterTable::CheckItem::checked() const
+{
+ return checkState() == Qt::Checked;
+}
+
+/*
+ Class : SMESHGUI_FilterTable::ComboDelegate
+ Description : Table used by this widget
+*/
+
+class SMESHGUI_FilterTable::ComboDelegate : public QItemDelegate
+{
+public:
+ ComboDelegate( QObject* = 0 );
+ ~ComboDelegate();
+
+ QWidget* createEditor( QWidget*, const QStyleOptionViewItem&,
+ const QModelIndex& ) const;
+
+ void setEditorData( QWidget*, const QModelIndex& ) const;
+ void setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const;
+
+ void updateEditorGeometry( QWidget*, const QStyleOptionViewItem&,
+ const QModelIndex& ) const;
+private:
+ QTableWidget* myTable;
+};
+
+SMESHGUI_FilterTable::ComboDelegate::ComboDelegate( QObject* parent )
+ : QItemDelegate( parent ),
+ myTable( qobject_cast<QTableWidget*>( parent ) )
+{
+}
+
+SMESHGUI_FilterTable::ComboDelegate::~ComboDelegate()
+{
+}
+
+QWidget* SMESHGUI_FilterTable::ComboDelegate::createEditor( QWidget* parent,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
+{
+ QStringList l = index.data( Qt::UserRole ).toStringList();
+ if ( !l.isEmpty() ) {
+ QComboBox* cb = new QComboBox( parent );
+ cb->setFrame( false );
+ cb->addItems( l );
+ return cb;
+ }
+ return QItemDelegate::createEditor( parent, option, index );
+}
+
+void SMESHGUI_FilterTable::ComboDelegate::setEditorData( QWidget* editor,
+ const QModelIndex& index ) const
+{
+ QString value = index.model()->data( index, Qt::DisplayRole ).toString();
+ QComboBox* cb = static_cast<QComboBox*>( editor );
+ bool bOk = false;
+ if ( cb ) {
+ int i = cb->findText( value );
+ if ( i >= 0 ) {
+ cb->setCurrentIndex( i );
+ bOk = true;
+ }
+ }
+ if ( !bOk ) QItemDelegate::setEditorData( editor, index );
}
-void SMESHGUI_FilterTable::ComboItem::SetValue (const int theVal)
+void SMESHGUI_FilterTable::ComboDelegate::setModelData( QWidget* editor,
+ QAbstractItemModel* model,
+ const QModelIndex& index) const
{
- setCurrentItem(myIdToNum[ theVal ]);
+ QComboBox* cb = static_cast<QComboBox*>( editor );
+ if ( cb ) model->setData( index, cb->currentText(), Qt::DisplayRole );
+ else QItemDelegate::setModelData( editor, model, index );
}
+void SMESHGUI_FilterTable::ComboDelegate::updateEditorGeometry( QWidget* editor,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& index ) const
+{
+ editor->setGeometry( option.rect );
+}
/*
Class : SMESHGUI_FilterTable::Table
Description : Table used by this widget
*/
-class SMESHGUI_FilterTable::Table : public QTable
+class SMESHGUI_FilterTable::Table : public QTableWidget
{
public:
- Table(QWidget* parent);
- Table(int numRows, int numCols, QWidget* parent = 0);
- virtual ~Table();
+ Table( QWidget* = 0 );
+ Table( int, int, QWidget* = 0 );
+ virtual ~Table();
+
+ void setEditable( bool, int, int );
+ bool isEditable( int, int ) const;
- void SetEditable(const bool state, const int row, const int col);
- bool IsEditable(const int row, const int col) const;
+ void setReadOnly( bool );
+ bool isReadOnly() const;
- virtual void insertRows(int row, int count = 1);
- virtual QString text(int row, int col) const;
+ void insertRows( int, int = 1 );
+ QString text( int, int );
+
+ QList<int> selectedRows();
};
//=======================================================================
// Purpose : Constructor
//=======================================================================
SMESHGUI_FilterTable::Table::Table (QWidget* parent)
-: QTable(parent, "SMESHGUI_FilterTable::Table")
+: QTableWidget(parent)
{
+ // set custom item delegate
+ setItemDelegate( new ComboDelegate(this) );
+ // set edit triggers by default
+ setReadOnly( false );
}
SMESHGUI_FilterTable::Table::Table (int numRows, int numCols, QWidget* parent)
-: QTable(numRows, numCols, parent, "SMESHGUI_FilterTable::Table")
+: QTableWidget(numRows, numCols, parent)
{
+ // set custom item delegate
+ setItemDelegate( new ComboDelegate(this) );
+ // set edit triggers by default
+ setReadOnly( false );
}
SMESHGUI_FilterTable::Table::~Table()
}
//=======================================================================
-// name : SMESHGUI_FilterTable::Table::SetEditable
+// name : SMESHGUI_FilterTable::Table::setEditable
// Purpose : Set editable of specified cell
//=======================================================================
-void SMESHGUI_FilterTable::Table::SetEditable (const bool isEditable,
- const int row, const int col)
+void SMESHGUI_FilterTable::Table::setEditable (bool isEditable,
+ int row, int col)
{
- QTableItem* anItem = item(row, col);
- if(anItem)
- takeItem(anItem);
-
- if (!isEditable)
- setItem(row, col, new QTableItem(this, QTableItem::Never, ""));
- else
- setItem(row, col, new QTableItem(this, QTableItem::OnTyping, ""));
+ QTableWidgetItem* anItem = item( row, col );
+ if ( anItem ) {
+ Qt::ItemFlags f = anItem->flags();
+ if ( !isEditable ) f = f & ~Qt::ItemIsEditable;
+ else f = f | Qt::ItemIsEditable;
+ anItem->setFlags( f );
+ }
}
//=======================================================================
-// name : SMESHGUI_FilterTable::Table::IsEditable
+// name : SMESHGUI_FilterTable::Table::isEditable
// Purpose : Verify wheter cell is editable
//=======================================================================
-bool SMESHGUI_FilterTable::Table::IsEditable (const int row, const int col) const
+bool SMESHGUI_FilterTable::Table::isEditable (int row, int col) const
+{
+ QTableWidgetItem* anItem = item( row, col );
+ return anItem == 0 || anItem->flags() & Qt::ItemIsEditable;
+}
+
+void SMESHGUI_FilterTable::Table::setReadOnly( bool on )
{
- QTableItem* anItem = item(row, col);
- return anItem == 0 || anItem->editType() != QTableItem::Never;
+ setEditTriggers( on ?
+ QAbstractItemView::DoubleClicked |
+ QAbstractItemView::SelectedClicked |
+ QAbstractItemView::EditKeyPressed |
+ QAbstractItemView::AnyKeyPressed :
+ QAbstractItemView::NoEditTriggers );
+}
+
+bool SMESHGUI_FilterTable::Table::isReadOnly() const
+{
+ return editTriggers() != QAbstractItemView::NoEditTriggers;
}
//=======================================================================
//=======================================================================
void SMESHGUI_FilterTable::Table::insertRows (int row, int count)
{
- int anEditRow = currEditRow();
- int anEditCol = currEditCol();
-
- if (anEditRow >= 0 && anEditCol >= 0)
- endEdit(anEditRow, anEditCol, true, false);
-
- QTable::insertRows( row, count );
+ closePersistentEditor( currentItem() );
+ while ( count-- ) insertRow( row );
}
//=======================================================================
// name : SMESHGUI_FilterTable::Table::text
// Purpose : Get text from cell (virtual redefined)
//=======================================================================
-QString SMESHGUI_FilterTable::Table::text (int row, int col) const
+QString SMESHGUI_FilterTable::Table::text (int row, int col)
{
- int anEditRow = currEditRow();
- int anEditCol = currEditCol();
+ closePersistentEditor( currentItem() );
+ QTableWidgetItem* anItem = item( row, col );
+ return anItem ? anItem->text() : QString();
+}
- if (anEditRow >= 0 && anEditCol >= 0 && anEditRow == row && anEditCol == col)
- ((Table*)this)->endEdit(row, col, true, false);
+QList<int> SMESHGUI_FilterTable::Table::selectedRows()
+{
+ QList<QTableWidgetItem*> selItems = selectedItems();
+ QTableWidgetItem* anItem;
+ QList<int> rows;
- return QTable::text(row, col);
-}
+ foreach( anItem, selItems ) {
+ int r = row( anItem );
+ if ( !rows.contains( r ) ) rows.append( r );
+ }
+ qSort( rows );
+ return rows;
+}
/*
Class : SMESHGUI_FilterTable
//=======================================================================
SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule,
QWidget* parent,
- const int type)
-: QFrame(parent),
+ const int type )
+: QWidget( parent ),
myIsLocked( false ),
mySMESHGUI( theModule )
{
myEntityType = -1;
- Init(type);
+
+ QList<int> aTypes;
+ aTypes.append(type);
+ Init(aTypes);
}
//=======================================================================
//=======================================================================
SMESHGUI_FilterTable::SMESHGUI_FilterTable( SMESHGUI* theModule,
QWidget* parent,
- const QValueList<int>& types)
-: QFrame(parent),
+ const QList<int>& types )
+: QWidget( parent ),
myIsLocked( false ),
mySMESHGUI( theModule )
{
// name : SMESHGUI_FilterTable::Init
// Purpose : Create table corresponding to the specified type
//=======================================================================
-void SMESHGUI_FilterTable::Init (const int type)
-{
- QValueList<int> aTypes;
- aTypes.append(type);
- Init(aTypes);
-}
-
-//=======================================================================
-// name : SMESHGUI_FilterTable::Init
-// Purpose : Create table corresponding to the specified type
-//=======================================================================
-void SMESHGUI_FilterTable::Init (const QValueList<int>& theTypes)
+void SMESHGUI_FilterTable::Init (const QList<int>& theTypes)
{
if (theTypes.isEmpty())
return;
// create main layout
QVBoxLayout* aMainLay = new QVBoxLayout(this);
- QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, this);
- aMainGrp->setFrameStyle(QFrame::NoFrame);
- aMainGrp->setInsideMargin(0);
- aMainLay->addWidget(aMainGrp);
+ aMainLay->setMargin( 0 );
+ aMainLay->setSpacing( SPACING );
// create switch of entity types
- myEntityTypeGrp = new QButtonGroup(1, Qt::Vertical, tr("ENTITY_TYPE"), aMainGrp);
+ myEntityTypeBox = new QGroupBox(tr("ENTITY_TYPE"), this);
+ QHBoxLayout* myEntityTypeBoxLayout = new QHBoxLayout(myEntityTypeBox);
+ myEntityTypeBoxLayout->setMargin( MARGIN );
+ myEntityTypeBoxLayout->setSpacing( SPACING );
+ myEntityTypeGrp = new QButtonGroup(this);
+
const QMap<int, QString>& aSupportedTypes = getSupportedTypes();
QMap<int, QString>::const_iterator anIter;
for (anIter = aSupportedTypes.begin(); anIter != aSupportedTypes.end(); ++anIter)
{
- QRadioButton* aBtn = new QRadioButton(anIter.data(), myEntityTypeGrp);
- myEntityTypeGrp->insert(aBtn, anIter.key());
+ QRadioButton* aBtn = new QRadioButton(anIter.value(), myEntityTypeBox);
+ myEntityTypeGrp->addButton(aBtn, anIter.key());
+ myEntityTypeBoxLayout->addWidget(aBtn);
}
- myTableGrp = new QGroupBox(1, Qt::Horizontal, tr("FILTER"), aMainGrp );
- QFrame* aTableFrame = new QFrame(myTableGrp);
+ myTableGrp = new QGroupBox(tr("FILTER"), this );
// create table
- mySwitchTableGrp = new QGroupBox(1, Qt::Horizontal, aTableFrame);
- mySwitchTableGrp->setFrameStyle(QFrame::NoFrame);
- mySwitchTableGrp->setInsideMargin(0);
+ mySwitchTableGrp = new QWidget(myTableGrp);
+ QVBoxLayout* mySwitchTableGrpLayout = new QVBoxLayout(mySwitchTableGrp);
+ mySwitchTableGrpLayout->setMargin(0);
+ mySwitchTableGrpLayout->setSpacing(0);
myTables[ aType ] = createTable(mySwitchTableGrp, aType);
+ mySwitchTableGrpLayout->addWidget(myTables[ aType ]);
// create buttons
- myAddBtn = new QPushButton(tr("ADD"), aTableFrame);
- myRemoveBtn = new QPushButton(tr("REMOVE"), aTableFrame);
- myClearBtn = new QPushButton(tr("CLEAR"), aTableFrame);
- myInsertBtn = new QPushButton(tr("INSERT"), aTableFrame);
- myCopyFromBtn = new QPushButton(tr("COPY_FROM"), aTableFrame);
- myAddToBtn = new QPushButton(tr("ADD_TO"), aTableFrame);
+ myAddBtn = new QPushButton(tr("ADD"), myTableGrp);
+ myRemoveBtn = new QPushButton(tr("REMOVE"), myTableGrp);
+ myClearBtn = new QPushButton(tr("CLEAR"), myTableGrp);
+ myInsertBtn = new QPushButton(tr("INSERT"), myTableGrp);
+ myCopyFromBtn = new QPushButton(tr("COPY_FROM"), myTableGrp);
+ myAddToBtn = new QPushButton(tr("ADD_TO"), myTableGrp);
myAddBtn->setAutoDefault(false);
myRemoveBtn->setAutoDefault(false);
myAddToBtn->hide();
// layout widgets
- QGridLayout* aLay = new QGridLayout(aTableFrame, 8, 2, 0, SPACING);
-
- aLay->addMultiCellWidget(mySwitchTableGrp, 0, 6, 0, 0);
- aLay->addWidget(myAddBtn, 0, 1);
- aLay->addWidget(myInsertBtn, 1, 1);
- aLay->addWidget(myRemoveBtn, 2, 1);
- aLay->addWidget(myClearBtn, 3, 1);
- aLay->addWidget(myCopyFromBtn, 5, 1);
- aLay->addWidget(myAddToBtn, 6, 1);
- aLay->addMultiCellWidget(createAdditionalFrame(aTableFrame), 7, 7, 0, 1 );
-
- aLay->setColStretch(0, 1);
- aLay->setColStretch(1, 0);
-
- QSpacerItem* aVSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
- aLay->addItem(aVSpacer, 4, 1);
-
+ QGridLayout* aLay = new QGridLayout(myTableGrp);
+ aLay->setMargin(0);
+ aLay->setSpacing(SPACING);
+
+ aLay->addWidget(mySwitchTableGrp, 0, 0, 7, 1);
+ aLay->addWidget(myAddBtn, 0, 1);
+ aLay->addWidget(myInsertBtn, 1, 1);
+ aLay->addWidget(myRemoveBtn, 2, 1);
+ aLay->addWidget(myClearBtn, 3, 1);
+ aLay->addWidget(myCopyFromBtn, 5, 1);
+ aLay->addWidget(myAddToBtn, 6, 1);
+ aLay->addWidget(createAdditionalFrame(myTableGrp), 7, 0, 1, 2 );
+
+ aLay->setRowMinimumHeight(4, 10);
+ aLay->setRowStretch(4, 1);
+ aLay->setColumnStretch(0, 1);
+ aLay->setColumnStretch(1, 0);
+
+ // layout
+ aMainLay->addWidget(myEntityTypeBox);
+ aMainLay->addWidget(myTableGrp);
+
// signals and slots
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtn()));
connect(myInsertBtn, SIGNAL(clicked()), this, SLOT(onInsertBtn()));
connect(myCopyFromBtn, SIGNAL(clicked()), this, SLOT(onCopyFromBtn()));
connect(myAddToBtn, SIGNAL(clicked()), this, SLOT(onAddToBtn()));
- connect(myEntityTypeGrp, SIGNAL(clicked(int)), this, SLOT(onEntityType(int)));
+ connect(myEntityTypeGrp, SIGNAL(buttonClicked(int)), this, SLOT(onEntityType(int)));
myLibDlg = 0;
}
QMap<int, QString>::const_iterator anIt;
for (anIt = aSupportedTypes.begin(); anIt != aSupportedTypes.end(); ++anIt)
{
- QButton* aBtn = myEntityTypeGrp->find(anIt.key());
- theTypes.contains(anIt.key()) ? aBtn->show() : aBtn->hide();
+ QAbstractButton* aBtn = myEntityTypeGrp->button(anIt.key());
+ if ( aBtn ) aBtn->setVisible( theTypes.contains(anIt.key()) );
}
// select first button if there is no selected buttons or it is hidden
- QButton* aBtn = myEntityTypeGrp->selected();
- if ( aBtn == 0 || theTypes.find(myEntityTypeGrp->id(aBtn)) == theTypes.end())
- myEntityTypeGrp->setButton(theTypes.first());
+ int aBtnId = myEntityTypeGrp->checkedId();
+ if ( aBtnId == -1 || !theTypes.contains(aBtnId) ) {
+ QAbstractButton* aBtn = myEntityTypeGrp->button(theTypes.first());
+ if ( aBtn ) aBtn->setChecked(true);
+ }
- if (theTypes.count() == 1)
- myEntityTypeGrp->hide();
- else
- myEntityTypeGrp->show();
+ myEntityTypeBox->setVisible(theTypes.count() > 1);
myTableGrp->updateGeometry();
- int aType = myEntityTypeGrp->id(myEntityTypeGrp->selected());
- onEntityType(aType);
+ int cType = myEntityTypeGrp->checkedId();
+ onEntityType(cType);
}
//=======================================================================
-// name : SMESHGUI_FilterTable::GetTableGrp
+// name : SMESHGUI_FilterTable::createAdditionalFrame
// Purpose : Get group box containing table. May be used for adding new widgets in it
//=======================================================================
QWidget* SMESHGUI_FilterTable::createAdditionalFrame (QWidget* theParent)
{
- QFrame* aFrame = new QFrame(theParent);
+ QWidget* aFrame = new QWidget(theParent);
QFrame* aLine1 = new QFrame(aFrame);
QFrame* aLine2 = new QFrame(aFrame);
QLabel* aLabel = new QLabel(tr("ADDITIONAL_PARAMETERS"), aFrame);
- myWgStack = new QWidgetStack(aFrame);
+ myWgStack = new QStackedWidget(aFrame);
- QGridLayout* aLay = new QGridLayout(aFrame, 2, 3, 0, SPACING);
- aLay->addWidget(aLine1, 0, 0);
- aLay->addWidget(aLabel, 0, 1);
- aLay->addWidget(aLine2, 0, 2);
- aLay->addMultiCellWidget(myWgStack, 1, 1, 0, 2);
+ QGridLayout* aLay = new QGridLayout(aFrame);
+ aLay->setMargin(0);
+ aLay->setSpacing(SPACING);
+ aLay->addWidget(aLine1, 0, 0);
+ aLay->addWidget(aLabel, 0, 1);
+ aLay->addWidget(aLine2, 0, 2);
+ aLay->addWidget(myWgStack, 1, 0, 1, 3);
return aFrame;
}
emit NeedValidation();
if (!myIsValid)
{
- myEntityTypeGrp->setButton(myEntityType);
+ myEntityTypeGrp->button(myEntityType)->setChecked(true);
return;
}
myEntityType = theType;
- if (!myTables.contains(theType))
+ if (!myTables.contains(theType)) {
myTables[ theType ] = createTable(mySwitchTableGrp, theType);
+ ((QVBoxLayout*)mySwitchTableGrp->layout())->addWidget(myTables[ theType ]);
+ }
TableMap::iterator anIter;
for (anIter = myTables.begin(); anIter != myTables.end(); ++anIter)
- myEntityType == anIter.key() ? anIter.data()->show() : anIter.data()->hide();
+ anIter.value()->setVisible( myEntityType == anIter.key() );
updateBtnState();
qApp->processEvents();
adjustSize();
emit EntityTypeChanged(theType);
-
}
//=======================================================================
int aType = theEntityType == -1 ? GetType() : theEntityType;
Table* aTable = myTables[ aType ];
- for (int i = 0, n = aTable->numRows(); i < n; i++)
+ for (int i = 0, n = aTable->rowCount(); i < n; i++)
{
int aCriterion = GetCriterionType(i, aType);
- if (aCriterion == FT_RangeOfIds ||
- aCriterion == FT_BelongToGeom ||
- aCriterion == FT_BelongToPlane ||
- aCriterion == FT_BelongToCylinder ||
- aCriterion == FT_BelongToGenSurface ||
- aCriterion == FT_LyingOnGeom) {
+ if (aCriterion == SMESH::FT_RangeOfIds ||
+ aCriterion == SMESH::FT_BelongToGeom ||
+ aCriterion == SMESH::FT_BelongToPlane ||
+ aCriterion == SMESH::FT_BelongToCylinder ||
+ aCriterion == SMESH::FT_BelongToGenSurface ||
+ aCriterion == SMESH::FT_LyingOnGeom) {
if (aTable->text(i, 2).isEmpty()) {
if (theMess)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("ERROR"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("ERROR"));
return false;
}
} else {
double aThreshold = (int)aTable->text(i, 2).toDouble(&aRes);
aTable->blockSignals(false);
- if (!aRes && aTable->IsEditable(i, 2)) {
+ if (!aRes && aTable->isEditable(i, 2)) {
if (theMess)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("ERROR"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("ERROR"));
return false;
}
else if (aType == SMESH::EDGE &&
aThreshold == 1)
{
if (theMess)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("MULTIEDGES_ERROR"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("MULTIEDGES_ERROR"));
return false;
}
}
- QTableItem* anItem = aTable->item(i, 0);
+ QTableWidgetItem* anItem = aTable->item(i, 0);
if (myAddWidgets.contains(anItem) && !myAddWidgets[ anItem ]->IsValid())
return false;
}
//=======================================================================
void SMESHGUI_FilterTable::SetType (const int type)
{
- myEntityTypeGrp->setButton(type);
+ myEntityTypeGrp->button(type)->setChecked(true);
onEntityType(type);
}
int aType = theType == -1 ? GetType() : theType;
Table* aTable = myTables[ aType ];
ComboItem* anItem = (ComboItem*)aTable->item(theRow, 0);
- return anItem != 0 ? anItem->GetValue() : FT_Undefined;
+ return anItem != 0 ? anItem->value() : SMESH::FT_Undefined;
}
//=======================================================================
int aType = theEntityType == -1 ? GetType() : theEntityType;
Table* aTable = myTables[ aType ];
- theCriterion.Type = ((ComboItem*)aTable->item(theRow, 0))->GetValue();
- theCriterion.UnaryOp = ((QCheckTableItem*)aTable->item(theRow, 3))->isChecked() ? FT_LogicalNOT : FT_Undefined;
- theCriterion.BinaryOp = theRow != aTable->numRows() - 1 ?
- ((ComboItem*)aTable->item(theRow, 4))->GetValue() : FT_Undefined;
- theCriterion.TypeOfElement = (ElementType)aType;
+ theCriterion.Type = ((ComboItem*)aTable->item(theRow, 0))->value();
+ theCriterion.UnaryOp = ((CheckItem*)aTable->item(theRow, 3))->checked() ? SMESH::FT_LogicalNOT : SMESH::FT_Undefined;
+ theCriterion.BinaryOp = theRow != aTable->rowCount() - 1 ?
+ ((ComboItem*)aTable->item(theRow, 4))->value() : SMESH::FT_Undefined;
+ theCriterion.TypeOfElement = (SMESH::ElementType)aType;
int aCriterionType = GetCriterionType(theRow, aType);
- if (aCriterionType != FT_RangeOfIds &&
- aCriterionType != FT_BelongToGeom &&
- aCriterionType != FT_BelongToPlane &&
- aCriterionType != FT_BelongToCylinder &&
- aCriterionType != FT_BelongToGenSurface &&
- aCriterionType != FT_LyingOnGeom)
+ if ( aCriterionType != SMESH::FT_RangeOfIds &&
+ aCriterionType != SMESH::FT_BelongToGeom &&
+ aCriterionType != SMESH::FT_BelongToPlane &&
+ aCriterionType != SMESH::FT_BelongToCylinder &&
+ aCriterionType != SMESH::FT_BelongToGenSurface &&
+ aCriterionType != SMESH::FT_LyingOnGeom)
{
- theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->GetValue();
+ theCriterion.Compare = ((ComboItem*)aTable->item(theRow, 1))->value();
theCriterion.Threshold = aTable->item(theRow, 2)->text().toDouble();
}
else
- {
- theCriterion.ThresholdStr = aTable->text(theRow, 2).latin1();
- if ( aCriterionType != FT_RangeOfIds )
- theCriterion.ThresholdID = aTable->text( theRow, 5 ).latin1();
- }
+ {
+ theCriterion.ThresholdStr = aTable->text(theRow, 2).toLatin1().data();
+ if ( aCriterionType != SMESH::FT_RangeOfIds )
+ theCriterion.ThresholdID = aTable->text( theRow, 5 ).toLatin1().data();
+ }
- QTableItem* anItem = aTable->item(theRow, 0);
+ QTableWidgetItem* anItem = aTable->item(theRow, 0);
if (myAddWidgets.contains(anItem))
theCriterion.Tolerance = myAddWidgets[ anItem ]->GetDouble(AdditionalWidget::Tolerance);
}
Table* aTable = myTables[ aType ];
- if (theRow > aTable->numRows() - 1)
+ if (theRow > aTable->rowCount() - 1)
return;
- ((ComboItem*)aTable->item(theRow, 0))->SetValue(theCriterion.Type);
+ ((ComboItem*)aTable->item(theRow, 0))->setValue(theCriterion.Type);
onCriterionChanged(theRow, 0, aType);
- ((ComboItem*)aTable->item(theRow, 1))->SetValue(theCriterion.Compare);
- ((QCheckTableItem*)aTable->item(theRow, 3))->setChecked(theCriterion.UnaryOp == FT_LogicalNOT);
+ ((ComboItem*)aTable->item(theRow, 1))->setValue(theCriterion.Compare);
+ ((CheckItem*)aTable->item(theRow, 3))->setChecked(theCriterion.UnaryOp == SMESH::FT_LogicalNOT);
- if (theCriterion.BinaryOp != FT_Undefined)
+ if (theCriterion.BinaryOp != SMESH::FT_Undefined)
{
- if (!aTable->IsEditable(theRow, 4))
- aTable->setItem(theRow, 4, getBinaryItem(aTable));
- ((ComboItem*)aTable->item(theRow, 4))->SetValue(theCriterion.BinaryOp);
+ if (!aTable->isEditable(theRow, 4))
+ aTable->setItem(theRow, 4, getBinaryItem());
+ ((ComboItem*)aTable->item(theRow, 4))->setValue(theCriterion.BinaryOp);
}
else
- aTable->SetEditable(false, theRow, 4);
-
- if (theCriterion.Type != FT_RangeOfIds &&
- theCriterion.Type != FT_BelongToGeom &&
- theCriterion.Type != FT_BelongToPlane &&
- theCriterion.Type != FT_BelongToCylinder &&
- theCriterion.Type != FT_BelongToGenSurface &&
- theCriterion.Type != FT_LyingOnGeom &&
- theCriterion.Type != FT_FreeBorders &&
- theCriterion.Type != FT_FreeEdges &&
- theCriterion.Type != FT_BadOrientedVolume)
- aTable->setText(theRow, 2, QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
+ aTable->setEditable(false, theRow, 4);
+
+ if (theCriterion.Type != SMESH::FT_RangeOfIds &&
+ theCriterion.Type != SMESH::FT_BelongToGeom &&
+ theCriterion.Type != SMESH::FT_BelongToPlane &&
+ theCriterion.Type != SMESH::FT_BelongToCylinder &&
+ theCriterion.Type != SMESH::FT_BelongToGenSurface &&
+ theCriterion.Type != SMESH::FT_LyingOnGeom &&
+ theCriterion.Type != SMESH::FT_FreeBorders &&
+ theCriterion.Type != SMESH::FT_FreeEdges &&
+ theCriterion.Type != SMESH::FT_BadOrientedVolume)
+ aTable->item( theRow, 2 )->setText(QString("%1").arg(theCriterion.Threshold, 0, 'g', 15));
else
- {
- aTable->setText(theRow, 2, QString(theCriterion.ThresholdStr));
- if ( theCriterion.Type != FT_RangeOfIds )
- aTable->setText( theRow, 5, QString( theCriterion.ThresholdID ) );
- }
+ {
+ aTable->item( theRow, 2 )->setText(QString(theCriterion.ThresholdStr));
+ if ( theCriterion.Type != SMESH::FT_RangeOfIds )
+ aTable->item( theRow, 5 )->setText( QString( theCriterion.ThresholdID ) );
+ }
- if (theCriterion.Compare == FT_EqualTo ||
- theCriterion.Type == FT_BelongToPlane ||
- theCriterion.Type == FT_BelongToCylinder ||
- theCriterion.Type == FT_BelongToGenSurface)
+ if (theCriterion.Compare == SMESH::FT_EqualTo ||
+ theCriterion.Type == SMESH::FT_BelongToPlane ||
+ theCriterion.Type == SMESH::FT_BelongToCylinder ||
+ theCriterion.Type == SMESH::FT_BelongToGenSurface)
{
- QTableItem* anItem = aTable->item(theRow, 0);
+ QTableWidgetItem* anItem = aTable->item(theRow, 0);
if (!myAddWidgets.contains(anItem))
{
myAddWidgets[ anItem ] = new AdditionalWidget(myWgStack);
{
Table* aTable = myTables[ GetType() ];
int aCurrRow = aTable->currentRow();
- int numRows = aTable->numRows();
+ int numRows = aTable->rowCount();
if ((aCurrRow < 0 || aCurrRow >= numRows) && numRows > 0)
aTable->setCurrentCell(0, 0);
updateAdditionalWidget();
int aType = theEntityType == -1 ? GetType() : theEntityType;
Table* aTable = myTables[ aType ];
addRow(aTable, aType);
- SetCriterion(aTable->numRows() - 1, theCriterion);
+ SetCriterion(aTable->rowCount() - 1, theCriterion);
}
//=======================================================================
//=======================================================================
int SMESHGUI_FilterTable::NumRows (const int theEntityType) const
{
- return myTables[ theEntityType == -1 ? GetType() : theEntityType ]->numRows();
+ return myTables[ theEntityType == -1 ? GetType() : theEntityType ]->rowCount();
}
//=======================================================================
void SMESHGUI_FilterTable::Clear (const int theType)
{
int aType = theType == -1 ? GetType() : theType;
- QTable* aTable = myTables[ aType ];
+ Table* aTable = myTables[ aType ];
- if (aTable->numRows() == 0)
+ if (aTable->rowCount() == 0)
return;
- while (aTable->numRows() > 0)
+ while (aTable->rowCount() > 0)
{
removeAdditionalWidget(aTable, 0);
aTable->removeRow(0);
{
Table* aTable = myTables[ GetType() ];
- if (aTable->numRows() == 0)
+ if (aTable->rowCount() == 0)
return;
- QMemArray<int> aRows;
- for (int i = 0, n = aTable->numRows(); i < n; i++)
+ QList<QTableWidgetItem*> items = aTable->selectedItems();
+
+ QList<int> aRows = aTable->selectedRows(); // already sorted
+ int i;
+ foreach( i, aRows )
{
- if (aTable->isRowSelected(i))
- {
- aRows.resize(aRows.size() + 1);
- aRows[ (int)(aRows.size() - 1) ] = i;
- removeAdditionalWidget(aTable, i);
- }
+ removeAdditionalWidget(aTable, i);
+ aTable->removeRow(i);
}
- aTable->removeRows(aRows);
-
// remove control of binary logical operation from last row
- if (aTable->numRows() > 0)
- aTable->SetEditable(false, aTable->numRows() - 1, 4);
+ if (aTable->rowCount() > 0)
+ aTable->setEditable(false, aTable->rowCount() - 1, 4);
updateBtnState();
}
{
Table* aTable = myTables[ GetType() ];
int aRow = aTable->currentRow();
- if (aRow < 0 || aRow >= aTable->numRows())
+ if (aRow < 0 || aRow >= aTable->rowCount())
{
myWgStack->setEnabled(false);
return;
}
ComboItem* anItem = ((ComboItem*)aTable->item(aRow, 0));
- bool toEnable = ((ComboItem*)aTable->item(aRow, 1))->GetValue() == FT_EqualTo &&
- GetCriterionType(aRow) != FT_BelongToGeom &&
- GetCriterionType(aRow) != FT_LyingOnGeom &&
- GetCriterionType(aRow) != FT_RangeOfIds &&
- GetCriterionType(aRow) != FT_FreeEdges &&
- GetCriterionType(aRow) != FT_BadOrientedVolume;
+ bool toEnable = ((ComboItem*)aTable->item(aRow, 1))->value() == SMESH::FT_EqualTo &&
+ GetCriterionType(aRow) != SMESH::FT_BelongToGeom &&
+ GetCriterionType(aRow) != SMESH::FT_LyingOnGeom &&
+ GetCriterionType(aRow) != SMESH::FT_RangeOfIds &&
+ GetCriterionType(aRow) != SMESH::FT_FreeEdges &&
+ GetCriterionType(aRow) != SMESH::FT_BadOrientedVolume;
if (!myAddWidgets.contains(anItem))
{
myAddWidgets[ anItem ] = new AdditionalWidget(myWgStack);
myWgStack->addWidget(myAddWidgets[ anItem ]);
}
- myWgStack->raiseWidget(myWgStack->id(myAddWidgets[ anItem ]));
+ myWgStack->setCurrentWidget(myAddWidgets[ anItem ]);
myWgStack->setEnabled(toEnable);
}
// Purpose : Remove widgets containing additional parameters from widget
// stack and internal map
//=======================================================================
-void SMESHGUI_FilterTable::removeAdditionalWidget (QTable* theTable, const int theRow)
+void SMESHGUI_FilterTable::removeAdditionalWidget (QTableWidget* theTable, const int theRow)
{
- QTableItem* anItem = theTable->item(theRow, 0);
+ QTableWidgetItem* anItem = theTable->item(theRow, 0);
if (myAddWidgets.contains(anItem))
{
myWgStack->removeWidget(myAddWidgets[ anItem ]);
- myAddWidgets[ anItem ]->reparent(0, QPoint());
+ myAddWidgets[ anItem ]->setParent(0);
delete myAddWidgets[ anItem ];
myAddWidgets.remove(anItem);
}
//=======================================================================
void SMESHGUI_FilterTable::onClearBtn()
{
- QTable* aTable = myTables[ GetType() ];
+ Table* aTable = myTables[ GetType() ];
- if (aTable->numRows() == 0)
+ if (aTable->rowCount() == 0)
return;
- while (aTable->numRows() > 0)
+ while (aTable->rowCount() > 0)
{
removeAdditionalWidget(aTable, 0);
aTable->removeRow(0);
aType == SMESH::VOLUME && aCriterionType == SMESH::FT_BadOrientedVolume)
{
if (aCompareItem->count() > 0)
- aCompareItem->setStringList(QStringList());
- aTable->SetEditable(false, row, 2);
+ aCompareItem->clear();
+ aTable->setEditable(false, row, 2);
}
else if (aCriterionType == SMESH::FT_RangeOfIds ||
aCriterionType == SMESH::FT_BelongToGeom ||
aCriterionType == SMESH::FT_LyingOnGeom)
{
QMap<int, QString> aMap;
- aMap[ FT_EqualTo ] = tr("EQUAL_TO");
- aCompareItem->setStringList(aMap);
- if (!aTable->IsEditable(row, 2))
- aTable->SetEditable(true, row, 2);
+ aMap[ SMESH::FT_EqualTo ] = tr("EQUAL_TO");
+ aCompareItem->setItems(aMap);
+ if (!aTable->isEditable(row, 2))
+ aTable->setEditable(true, row, 2);
}
else
{
if (aCompareItem->count() != 3)
{
- aCompareItem->setStringList(QStringList());
- aCompareItem->setStringList(getCompare());
+ aCompareItem->setItems(getCompare());
}
QString aText = aTable->text(row, 2);
bool isOk = false;
aText.toDouble(&isOk);
- aTable->setText(row, 2, isOk ? aText : QString(""));
- if (!aTable->IsEditable(row, 2))
- aTable->SetEditable(true, row, 2);
+ aTable->item( row, 2 )->setText(isOk ? aText : QString(""));
+ if (!aTable->isEditable(row, 2))
+ aTable->setEditable(true, row, 2);
}
updateAdditionalWidget();
//=======================================================================
int SMESHGUI_FilterTable::getFirstSelectedRow() const
{
- QTable* aTable = myTables[ GetType() ];
- for (int i = 0, n = aTable->numRows(); i < n; i++)
- if (aTable->isRowSelected(i))
- return i;
+ Table* aTable = myTables[ GetType() ];
- int aRow = aTable->currentRow();
- return aRow >= 0 && aRow < aTable->numRows() ? aRow : -1;
+ QList<int> selRows = aTable->selectedRows(); // already sorted
+ int aRow = selRows.count() > 0 ? selRows[0] : aTable->currentRow();
+
+ return aRow >= 0 && aRow < aTable->rowCount() ? aRow : -1;
}
//=======================================================================
myIsLocked = true;
if (toTheEnd || aSelectedRow == -1)
{
- theTable->insertRows(theTable->numRows());
- aCurrRow = theTable->numRows() - 1;
+ theTable->insertRows(theTable->rowCount());
+ aCurrRow = theTable->rowCount() - 1;
}
else
{
myIsLocked = false;
// Criteria
- theTable->setItem(aCurrRow, 0, getCriterionItem(theTable, theType));
+ theTable->setItem(aCurrRow, 0, getCriterionItem(theType));
// Compare
- theTable->setItem(aCurrRow, 1, getCompareItem(theTable));
+ theTable->setItem(aCurrRow, 1, getCompareItem());
// Threshold
- //theTable->setItem(aCurrRow, 2, new QTableItem(theTable));
+ //theTable->setItem(aCurrRow, 2, new QTableWidgetItem());
//Logical operation NOT
- theTable->setItem(aCurrRow, 3, getUnaryItem(theTable));
+ theTable->setItem(aCurrRow, 3, getUnaryItem());
// Logical binary operation for previous value
int anAddBinOpStr = -1;
- if (aCurrRow == theTable->numRows() - 1)
+ if (aCurrRow == theTable->rowCount() - 1)
anAddBinOpStr = aCurrRow - 1;
else if (aCurrRow >= 0 )
anAddBinOpStr = aCurrRow;
if (theTable->item(aCurrRow, 4) == 0 ||
- theTable->item(aCurrRow, 4)->rtti() != 1)
+ theTable->item(aCurrRow, 4)->type() != ComboItem::Type())
{
if (anAddBinOpStr >= 0 &&
(theTable->item(anAddBinOpStr, 4) == 0 ||
- theTable->item(anAddBinOpStr, 4)->rtti() != 1))
- theTable->setItem(anAddBinOpStr, 4, getBinaryItem(theTable));
+ theTable->item(anAddBinOpStr, 4)->type() != ComboItem::Type()))
+ theTable->setItem(anAddBinOpStr, 4, getBinaryItem());
}
- theTable->SetEditable(false, theTable->numRows() - 1, 4);
+ theTable->setEditable(false, theTable->rowCount() - 1, 4);
- if (aCurrRow >=0 && aCurrRow < theTable->numRows() &&
- aCurrCol >=0 && aCurrCol < theTable->numRows())
+ if (aCurrRow >=0 && aCurrRow < theTable->rowCount() &&
+ aCurrCol >=0 && aCurrCol < theTable->rowCount())
theTable->setCurrentCell(aCurrRow, aCurrCol);
onCriterionChanged(aCurrRow, 0);
// name : SMESHGUI_FilterTable::getCriterionItem
// Purpose : Get combo table item for criteria of specified type
//=======================================================================
-QTableItem* SMESHGUI_FilterTable::getCriterionItem (QTable* theParent , const int theType)
+QTableWidgetItem* SMESHGUI_FilterTable::getCriterionItem (const int theType) const
{
- return new ComboItem(theParent, getCriteria(theType));
+ return new ComboItem(getCriteria(theType));
}
//=======================================================================
// name : SMESHGUI_FilterTable::getCompareItem
// Purpose : Get combo table item for operation of comparision
//=======================================================================
-QTableItem* SMESHGUI_FilterTable::getCompareItem (QTable* theParent)
+QTableWidgetItem* SMESHGUI_FilterTable::getCompareItem () const
{
- return new ComboItem(theParent, getCompare());
+ return new ComboItem(getCompare());
}
//=======================================================================
// name : SMESHGUI_FilterTable::getBinaryItem
// Purpose :
//=======================================================================
-QTableItem* SMESHGUI_FilterTable::getBinaryItem (QTable* theParent)
+QTableWidgetItem* SMESHGUI_FilterTable::getBinaryItem () const
{
static QMap<int, QString> aMap;
if (aMap.isEmpty())
aMap[ SMESH::FT_LogicalOR ] = tr("OR");
}
- return new ComboItem(theParent, aMap);
+ return new ComboItem(aMap);
}
//=======================================================================
// name : SMESHGUI_FilterTable::getUnaryItem
// Purpose : Get check table item
//=======================================================================
-QTableItem* SMESHGUI_FilterTable::getUnaryItem (QTable* theParent)
+QTableWidgetItem* SMESHGUI_FilterTable::getUnaryItem () const
{
- return new QCheckTableItem(theParent, tr("NOT"));
+ return new CheckItem(tr("NOT"));
}
//=======================================================================
static QMap<int, QString> aCriteria;
if (aCriteria.isEmpty())
{
- aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
- aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
- aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
- aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
- aCriteria[ SMESH::FT_BelongToGenSurface]= tr("BELONG_TO_GENSURFACE");
- aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
+ aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
+ aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
+ aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
+ aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
+ aCriteria[ SMESH::FT_BelongToGenSurface ] = tr("BELONG_TO_GENSURFACE");
+ aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
}
return aCriteria;
}
static QMap<int, QString> aCriteria;
if (aCriteria.isEmpty())
{
- aCriteria[ SMESH::FT_FreeBorders ] = tr("FREE_BORDERS");
- aCriteria[ SMESH::FT_MultiConnection ] = tr("MULTI_BORDERS");
- aCriteria[ SMESH::FT_Length ] = tr("LENGTH");
- aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
- aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
- aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
- aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
- aCriteria[ SMESH::FT_BelongToGenSurface]= tr("BELONG_TO_GENSURFACE");
- aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
+ aCriteria[ SMESH::FT_FreeBorders ] = tr("FREE_BORDERS");
+ aCriteria[ SMESH::FT_MultiConnection ] = tr("MULTI_BORDERS");
+ aCriteria[ SMESH::FT_Length ] = tr("LENGTH");
+ aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
+ aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
+ aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
+ aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
+ aCriteria[ SMESH::FT_BelongToGenSurface ] = tr("BELONG_TO_GENSURFACE");
+ aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
}
return aCriteria;
}
static QMap<int, QString> aCriteria;
if (aCriteria.isEmpty())
{
- aCriteria[ SMESH::FT_AspectRatio ] = tr("ASPECT_RATIO");
- aCriteria[ SMESH::FT_Warping ] = tr("WARPING");
- aCriteria[ SMESH::FT_MinimumAngle ] = tr("MINIMUM_ANGLE");
- aCriteria[ SMESH::FT_Taper ] = tr("TAPER");
- aCriteria[ SMESH::FT_Skew ] = tr("SKEW");
- aCriteria[ SMESH::FT_Area ] = tr("AREA");
- aCriteria[ SMESH::FT_FreeEdges ] = tr("FREE_EDGES");
- aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
- aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
- aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
- aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
- aCriteria[ SMESH::FT_BelongToGenSurface]= tr("BELONG_TO_GENSURFACE");
- aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
- aCriteria[ SMESH::FT_Length2D ] = tr("LENGTH2D");
- aCriteria[ SMESH::FT_MultiConnection2D] = tr("MULTI2D_BORDERS");
+ aCriteria[ SMESH::FT_AspectRatio ] = tr("ASPECT_RATIO");
+ aCriteria[ SMESH::FT_Warping ] = tr("WARPING");
+ aCriteria[ SMESH::FT_MinimumAngle ] = tr("MINIMUM_ANGLE");
+ aCriteria[ SMESH::FT_Taper ] = tr("TAPER");
+ aCriteria[ SMESH::FT_Skew ] = tr("SKEW");
+ aCriteria[ SMESH::FT_Area ] = tr("AREA");
+ aCriteria[ SMESH::FT_FreeEdges ] = tr("FREE_EDGES");
+ aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
+ aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
+ aCriteria[ SMESH::FT_BelongToPlane ] = tr("BELONG_TO_PLANE");
+ aCriteria[ SMESH::FT_BelongToCylinder ] = tr("BELONG_TO_CYLINDER");
+ aCriteria[ SMESH::FT_BelongToGenSurface ] = tr("BELONG_TO_GENSURFACE");
+ aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
+ aCriteria[ SMESH::FT_Length2D ] = tr("LENGTH2D");
+ aCriteria[ SMESH::FT_MultiConnection2D ] = tr("MULTI2D_BORDERS");
}
return aCriteria;
}
static QMap<int, QString> aCriteria;
if (aCriteria.isEmpty())
{
- aCriteria[ SMESH::FT_AspectRatio3D] = tr("ASPECT_RATIO_3D");
- aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
- aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
- aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
+ aCriteria[ SMESH::FT_AspectRatio3D ] = tr("ASPECT_RATIO_3D");
+ aCriteria[ SMESH::FT_RangeOfIds ] = tr("RANGE_OF_IDS");
+ aCriteria[ SMESH::FT_BelongToGeom ] = tr("BELONG_TO_GEOM");
+ aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
aCriteria[ SMESH::FT_BadOrientedVolume ] = tr("BAD_ORIENTED_VOLUME");
- aCriteria[ SMESH::FT_Volume3D ] = tr("VOLUME_3D");
+ aCriteria[ SMESH::FT_Volume3D ] = tr("VOLUME_3D");
}
return aCriteria;
}
// create table
Table* aTable= new Table(0, 6, theParent);
- QHeader* aHeaders = aTable->horizontalHeader();
+ QHeaderView* aHeaders = aTable->horizontalHeader();
QFontMetrics aMetrics(aHeaders->font());
const QMap<int, QString>& aSupportedTypes = getSupportedTypes();
QMap<int, QString>::const_iterator anIter;
for (anIter = aSupportedTypes.begin(); anIter != aSupportedTypes.end(); ++anIter)
- aMaxLenCr = Max(maxLength(getCriteria(anIter.key()), aMetrics), aMaxLenCr);
+ aMaxLenCr = qMax(maxLength(getCriteria(anIter.key()), aMetrics), aMaxLenCr);
}
- static int aLenCr = abs( aMaxLenCr -
- aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
+ static int aLenCr = qAbs( aMaxLenCr -
+ aMetrics.width(tr("CRITERION"))) / aMetrics.width(' ') + 5;
QString aCrStr;
aCrStr.fill(' ', aLenCr);
QString aCoStr;
aCoStr.fill(' ', 10);
- aHeaders->setLabel(0, tr("CRITERION") + aCrStr);
- aHeaders->setLabel(1, tr("COMPARE") + aCoStr);
- aHeaders->setLabel(2, tr("THRESHOLD_VALUE"));
- aHeaders->setLabel(3, tr("UNARY"));
- aHeaders->setLabel(4, tr("BINARY") + " ");
- aHeaders->setLabel( 5, tr( "ID" ) );
+ aTable->horizontalHeaderItem(0)->setText(tr("CRITERION") + aCrStr);
+ aTable->horizontalHeaderItem(1)->setText(tr("COMPARE") + aCoStr);
+ aTable->horizontalHeaderItem(2)->setText(tr("THRESHOLD_VALUE"));
+ aTable->horizontalHeaderItem(3)->setText(tr("UNARY"));
+ aTable->horizontalHeaderItem(4)->setText(tr("BINARY") + " ");
+ aTable->horizontalHeaderItem(5)->setText(tr("ID"));
// set geometry of the table
for (int i = 0; i <= 4; i++)
- aTable->adjustColumn(i);
+ aTable->resizeColumnToContents(i);
// set the ID column invisible
aTable->hideColumn( 5 );
aTable->setMinimumSize(QSize(aWidth, aWidth / 2));
aTable->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
- connect(aTable, SIGNAL(valueChanged(int, int)),
- this, SLOT(onCriterionChanged(int, int)));
-
- connect(aTable, SIGNAL(currentChanged(int, int)),
- this, SLOT(onCurrentChanged(int, int)));
+ connect(aTable, SIGNAL(cellChanged(int, int)),
+ this, SLOT(onCriterionChanged(int, int)));
+ connect(aTable, SIGNAL(currentCellChanged(int, int, int, int)),
+ this, SLOT(onCurrentChanged(int, int)));
+
return aTable;
}
//=======================================================================
void SMESHGUI_FilterTable::updateBtnState()
{
- myRemoveBtn->setEnabled(myTables[ GetType() ]->numRows() > 0);
- myClearBtn->setEnabled(myTables[ GetType() ]->numRows() > 0);
+ myRemoveBtn->setEnabled(myTables[ GetType() ]->rowCount() > 0);
+ myClearBtn->setEnabled(myTables[ GetType() ]->rowCount() > 0);
}
//=======================================================================
TableMap::iterator anIter;
for (anIter = myTables.begin(); anIter != myTables.end(); ++anIter)
{
- anIter.data()->setReadOnly(!isEditable);
+ anIter.value()->setReadOnly(!isEditable);
if (isEditable)
{
}
}
- QMap<QTableItem*, AdditionalWidget*>::iterator anIter2;
+ QMap<QTableWidgetItem*, AdditionalWidget*>::iterator anIter2;
for (anIter2 = myAddWidgets.begin(); anIter2 != myAddWidgets.end(); ++anIter2)
- anIter2.data()->SetEditable(isEditable);
+ anIter2.value()->SetEditable(isEditable);
}
//=======================================================================
if (isEnabled)
updateBtnState();
- QMap<QTableItem*, AdditionalWidget*>::iterator anIter2;
+ QMap<QTableWidgetItem*, AdditionalWidget*>::iterator anIter2;
for (anIter2 = myAddWidgets.begin(); anIter2 != myAddWidgets.end(); ++anIter2)
- anIter2.data()->setEnabled(isEnabled);
+ anIter2.value()->setEnabled(isEnabled);
}
//=======================================================================
const int theEntityType)
{
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
- aTable->setText(theRow, 2, theText);
+ aTable->item( theRow, 2 )->setText(theText);
}
//=======================================================================
const int theEntityType)
{
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
- QTableItem* anItem = aTable->item(theRow, 2);
+ QTableWidgetItem* anItem = aTable->item(theRow, 2);
if (anItem != 0)
{
theText = anItem->text();
const int theEntityType )
{
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
- aTable->setText( theRow, 5, theText );
+ aTable->item( theRow, 5 )->setText( theText );
}
//=======================================================================
const int theEntityType )
{
Table* aTable = myTables[ theEntityType == -1 ? GetType() : theEntityType ];
- QTableItem* anItem = aTable->item( theRow, 5 );
+ QTableWidgetItem* anItem = aTable->item( theRow, 5 );
if ( anItem != 0 )
{
theText = anItem->text();
// name : SMESHGUI_FilterDlg::SMESHGUI_FilterDlg
// Purpose : Constructor
//=======================================================================
-SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule,
- const QValueList<int>& theTypes,
- const char* theName)
-: QDialog( SMESH::GetDesktop( theModule ), theName, false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule,
+ const QList<int>& theTypes )
+: QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
mySelector = aViewWindow->GetSelector();
// Purpose : Constructor
//=======================================================================
SMESHGUI_FilterDlg::SMESHGUI_FilterDlg( SMESHGUI* theModule,
- const int theType,
- const char* theName)
-: QDialog( SMESH::GetDesktop( theModule ), theName, false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+ const int theType )
+: QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
mySelector = aViewWindow->GetSelector();
- QValueList<int> aTypes;
+ QList<int> aTypes;
aTypes.append(theType);
construct(aTypes);
}
// name : SMESHGUI_FilterDlg::construct
// Purpose : Construct dialog (called by constructor)
//=======================================================================
-void SMESHGUI_FilterDlg::construct (const QValueList<int>& theTypes)
+void SMESHGUI_FilterDlg::construct (const QList<int>& theTypes)
{
myTypes = theTypes;
- setCaption(tr("CAPTION"));
+ setModal(false);
+ //setAttribute(Qt::WA_DeleteOnClose, true); // VSR ??? is it required?
+ setWindowTitle(tr("CAPTION"));
- QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout (this);
+ aDlgLay->setMargin(MARGIN);
+ aDlgLay->setSpacing(SPACING);
- myMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
+ myMainFrame = createMainFrame (this);
+ QWidget* aBtnFrame = createButtonFrame(this);
aDlgLay->addWidget(myMainFrame);
aDlgLay->addWidget(aBtnFrame);
// name : SMESHGUI_FilterDlg::createMainFrame
// Purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_FilterDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_FilterDlg::createMainFrame (QWidget* theParent)
{
- QGroupBox* aMainFrame = new QGroupBox(1, Qt::Horizontal, theParent);
- aMainFrame->setFrameStyle(QFrame::NoFrame);
- aMainFrame->setInsideMargin(0);
+ QWidget* aMainFrame = new QWidget(theParent);
+ QVBoxLayout* aMainLay = new QVBoxLayout(aMainFrame);
+ aMainLay->setMargin(0);
+ aMainLay->setSpacing(SPACING);
// filter frame
myTable = new SMESHGUI_FilterTable( mySMESHGUI, aMainFrame, myTypes );
myTable->SetLibsEnabled(true);
- QFrame* aLine = new QFrame(myTable->GetTableGrp());
+ QGroupBox* aGrp = myTable->GetTableGrp();
+ QGridLayout* aLay = qobject_cast<QGridLayout*>( aGrp->layout() );
+ int rows = aLay->rowCount();
+ int cols = aLay->columnCount();
+
+ QFrame* aLine = new QFrame(aGrp);
aLine->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ aLay->addWidget(aLine, rows++, 0, 1, cols);
- mySetInViewer = new QCheckBox(tr("SET_IN_VIEWER"), myTable->GetTableGrp());
+ mySetInViewer = new QCheckBox(tr("SET_IN_VIEWER"), aGrp);
mySetInViewer->setChecked(true);
+ aLay->addWidget(mySetInViewer, rows++, 0, 1, cols);
// other controls
- mySourceGrp = createSourceGroup(aMainFrame);
+ QWidget* aSourceGrp = createSourceGroup(aMainFrame);
connect(myTable, SIGNAL(CriterionChanged(const int, const int)),
SLOT(onCriterionChanged(const int, const int)));
connect(myTable, SIGNAL(CurrentChanged(int, int)),
SLOT(onCurrentChanged(int, int)));
+ aMainLay->addWidget(myTable);
+ aMainLay->addWidget(aSourceGrp);
+
return aMainFrame;
}
// name : SMESHGUI_FilterDlg::createSourceFrame
// Purpose : Create frame containing source radio button
//=======================================================================
-QButtonGroup* SMESHGUI_FilterDlg::createSourceGroup (QWidget* theParent)
+QWidget* SMESHGUI_FilterDlg::createSourceGroup (QWidget* theParent)
{
- QButtonGroup* aGrp = new QButtonGroup(1, Qt::Vertical, tr("SOURCE"), theParent);
+ QGroupBox* aBox = new QGroupBox(tr("SOURCE"), theParent);
+ QHBoxLayout* aLay = new QHBoxLayout(aBox);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
- QRadioButton* aMeshBtn = new QRadioButton(tr("MESH"), aGrp);
- QRadioButton* aSelBtn = new QRadioButton(tr("SELECTION"), aGrp);
- QRadioButton* aGrpBtn = new QRadioButton(tr("CURRENT_GROUP"), aGrp);
+ mySourceGrp = new QButtonGroup(theParent);
- aGrp->insert(aMeshBtn, Mesh);
- aGrp->insert(aSelBtn, Selection);
- aGrp->insert(aGrpBtn, Dialog);
+ QRadioButton* aMeshBtn = new QRadioButton(tr("MESH"), aBox);
+ QRadioButton* aSelBtn = new QRadioButton(tr("SELECTION"), aBox);
+ QRadioButton* aGrpBtn = new QRadioButton(tr("CURRENT_GROUP"), aBox);
- aGrp->setButton(Selection);
+ aLay->addWidget(aMeshBtn);
+ aLay->addWidget(aSelBtn);
+ aLay->addWidget(aGrpBtn);
- return aGrp;
+ mySourceGrp->addButton(aMeshBtn, Mesh);
+ mySourceGrp->addButton(aSelBtn, Selection);
+ mySourceGrp->addButton(aGrpBtn, Dialog);
+
+ aSelBtn->setChecked(true);
+
+ return aBox;
}
//=======================================================================
// name : SMESHGUI_FilterDlg::createButtonFrame
// Purpose : Create frame containing buttons
//=======================================================================
-QFrame* SMESHGUI_FilterDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_FilterDlg::createButtonFrame (QWidget* theParent)
{
- QGroupBox* aGrp = new QGroupBox(1, Qt::Vertical, theParent);
-
- myButtons[ BTN_OK ] = new QPushButton(tr("SMESH_BUT_OK" ), aGrp);
- myButtons[ BTN_Apply ] = new QPushButton(tr("SMESH_BUT_APPLY"), aGrp);
-
- QLabel* aLbl = new QLabel(aGrp);
- aLbl->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+ QGroupBox* aGrp = new QGroupBox(theParent);
+ QHBoxLayout* aLay = new QHBoxLayout(aGrp);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
+ myButtons[ BTN_OK ] = new QPushButton(tr("SMESH_BUT_OK" ), aGrp);
+ myButtons[ BTN_Apply ] = new QPushButton(tr("SMESH_BUT_APPLY"), aGrp);
myButtons[ BTN_Cancel ] = new QPushButton(tr("SMESH_BUT_CANCEL"), aGrp);
- myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp);
- myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp);
+ myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp);
+ myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp);
+
+ aLay->addWidget(myButtons[ BTN_OK ]);
+ aLay->addSpacing(10);
+ aLay->addWidget(myButtons[ BTN_Apply ]);
+ aLay->addSpacing(10);
+ aLay->addStretch();
+ aLay->addWidget(myButtons[ BTN_Cancel ]);
+ aLay->addWidget(myButtons[ BTN_Close ]);
+ aLay->addWidget(myButtons[ BTN_Help ]);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk()));
connect(myButtons[ BTN_Cancel ], SIGNAL(clicked()), SLOT(onClose()));
//=======================================================================
void SMESHGUI_FilterDlg::Init (const int type)
{
- QValueList<int> aTypes;
+ QList<int> aTypes;
aTypes.append(type);
Init(aTypes);
}
// name : SMESHGUI_FilterDlg::Init
// Purpose : Init dialog fields, connect signals and slots, show dialog
//=======================================================================
-void SMESHGUI_FilterDlg::Init (const QValueList<int>& theTypes)
+void SMESHGUI_FilterDlg::Init (const QList<int>& theTypes)
{
mySourceWg = 0;
myTypes = theTypes;
if (theTypes.count() == 1)
{
int aType = theTypes.first();
- if (aType == SMESH::NODE ) setCaption(tr("NODES_TLT"));
- else if (aType == SMESH::EDGE ) setCaption(tr("EDGES_TLT"));
- else if (aType == SMESH::FACE ) setCaption(tr("FACES_TLT"));
- else if (aType == SMESH::VOLUME) setCaption(tr("VOLUMES_TLT"));
+ if (aType == SMESH::NODE ) setWindowTitle(tr("NODES_TLT"));
+ else if (aType == SMESH::EDGE ) setWindowTitle(tr("EDGES_TLT"));
+ else if (aType == SMESH::FACE ) setWindowTitle(tr("FACES_TLT"));
+ else if (aType == SMESH::VOLUME) setWindowTitle(tr("VOLUMES_TLT"));
}
else
- setCaption(tr("TLT"));
+ setWindowTitle(tr("TLT"));
qApp->processEvents();
updateGeometry();
updateSelection();
// Initialise filter table with values of previous filter
- QValueList<int>::const_iterator anIter;
+ QList<int>::const_iterator anIter;
for (anIter = theTypes.begin(); anIter != theTypes.end(); ++anIter)
{
myTable->Clear(*anIter);
mySetInViewer->setChecked(myInsertState[ theTypes.first() ]);
else
mySetInViewer->setChecked(true);
- if (myApplyToState.contains(theTypes.first()))
- mySourceGrp->setButton(myApplyToState[ theTypes.first() ]);
- else
- mySourceGrp->setButton(Selection);
+
+ mySourceGrp->button(myApplyToState.contains(theTypes.first()) ?
+ myApplyToState[ theTypes.first() ] :
+ Selection)->setChecked(true);
}
//=======================================================================
mySelectionMgr->clearFilters();
mySelectionMgr->clearSelected();
SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter (myIObjects);
- for (; anIter.More(); anIter.Next())
+ for ( ; anIter.More(); anIter.Next())
{
aList.Append(anIter.Key());
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
// name : SMESHGUI_FilterDlg::getIdsFromWg
// Purpose : Retrieve list of ids from given widget
//=======================================================================
-void SMESHGUI_FilterDlg::getIdsFromWg (const QWidget* theWg, QValueList<int>& theRes) const
+void SMESHGUI_FilterDlg::getIdsFromWg (const QWidget* theWg, QList<int>& theRes) const
{
theRes.clear();
if (theWg == 0)
return;
- if (theWg->inherits("QListBox"))
+ if (theWg->inherits("QListWidget"))
{
- QListBox* aListBox = (QListBox*)theWg;
+ const QListWidget* aListBox = qobject_cast<const QListWidget*>( theWg );
bool b;
for (int i = 0, n = aListBox->count(); i < n; i++)
{
- int anId = aListBox->text(i).toInt(&b);
+ int anId = aListBox->item(i)->text().toInt(&b);
if (b)
theRes.append(anId);
}
}
else if (theWg->inherits("QLineEdit"))
{
- QLineEdit* aLineEdit = (QLineEdit*)theWg;
+ const QLineEdit* aLineEdit = qobject_cast<const QLineEdit*>( theWg );
QString aStr = aLineEdit->text();
QRegExp aRegExp("(\\d+)");
bool b;
int aPos = 0;
while (aPos >= 0)
{
- aPos = aRegExp.search(aStr, aPos);
+ aPos = aRegExp.indexIn(aStr, aPos);
if (aPos > -1)
{
int anId = aRegExp.cap(1).toInt(&b);
// name : SMESHGUI_FilterDlg::setIdsToWg
// Purpose : Insert identifiers in specified widgets
//=======================================================================
-void SMESHGUI_FilterDlg::setIdsToWg (QWidget* theWg, const QValueList<int>& theIds)
+void SMESHGUI_FilterDlg::setIdsToWg (QWidget* theWg, const QList<int>& theIds)
{
if (theWg == 0)
return;
- if (theWg->inherits("QListBox"))
+ if (theWg->inherits("QListWidget"))
{
- QListBox* aListBox = (QListBox*)theWg;
+ QListWidget* aListBox = qobject_cast<QListWidget*>( theWg );
aListBox->clear();
QStringList aStrList;
- QValueList<int>::const_iterator anIter;
+ QList<int>::const_iterator anIter;
for (anIter = theIds.begin(); anIter != theIds.end(); ++anIter)
aStrList.append(QString("%1").arg(*anIter));
- aListBox->insertStringList(aStrList);
+ aListBox->addItems(aStrList);
}
else if (theWg->inherits("QLineEdit"))
{
- QLineEdit* aLineEdit = (QLineEdit*)theWg;
+ QLineEdit* aLineEdit = qobject_cast<QLineEdit*>( theWg );
QString aStr;
- QValueList<int>::const_iterator anIter;
+ QList<int>::const_iterator anIter;
for (anIter = theIds.begin(); anIter != theIds.end(); ++ anIter)
aStr += QString("%1 ").arg(*anIter);
for (int i = 0, n = myTable->NumRows(); i < n; i++)
{
int aType = myTable->GetCriterionType(i);
- if (aType == FT_BelongToGeom ||
- aType == FT_BelongToPlane ||
- aType == FT_BelongToCylinder ||
- aType == FT_BelongToGenSurface ||
- aType == FT_LyingOnGeom) {
+ if (aType == SMESH::FT_BelongToGeom ||
+ aType == SMESH::FT_BelongToPlane ||
+ aType == SMESH::FT_BelongToCylinder ||
+ aType == SMESH::FT_BelongToGenSurface ||
+ aType == SMESH::FT_LyingOnGeom) {
QString aName;
myTable->GetThreshold(i, aName);
std::vector<_PTR(SObject)> aList =
- SMESH::GetActiveStudyDocument()->FindObjectByName(aName.latin1(), "GEOM");
+ SMESH::GetActiveStudyDocument()->FindObjectByName(aName.toLatin1().data(), "GEOM");
if (aList.size() == 0) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("BAD_SHAPE_NAME").arg(aName), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("BAD_SHAPE_NAME").arg(aName));
return false;
}
- if (aType == FT_BelongToCylinder ||
- aType == FT_BelongToPlane ||
- aType == FT_BelongToGenSurface ) {
+ if (aType == SMESH::FT_BelongToCylinder ||
+ aType == SMESH::FT_BelongToPlane ||
+ aType == SMESH::FT_BelongToGenSurface ) {
CORBA::Object_var anObject = SMESH::SObjectToObject(aList[ 0 ]);
//GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(aList[ 0 ]->GetObject());
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(anObject);
if (!GEOMBase::GetShape(aGeomObj, aFace) ||
aFace.IsNull() ||
aFace.ShapeType() != TopAbs_FACE) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SHAPE_IS_NOT_A_FACE").arg(aName), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("SHAPE_IS_NOT_A_FACE").arg(aName));
return false;
}
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(TopoDS::Face(aFace));
if (aSurf.IsNull()) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SHAPE_IS_NOT_A_FACE").arg(aName), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("SHAPE_IS_NOT_A_FACE").arg(aName));
return false;
}
- if (aType == FT_BelongToPlane && !aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SHAPE_IS_NOT_A_PLANE").arg(aName), QMessageBox::Ok);
+ if (aType == SMESH::FT_BelongToPlane && !aSurf->IsKind(STANDARD_TYPE(Geom_Plane))) {
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("SHAPE_IS_NOT_A_PLANE").arg(aName));
return false;
}
- if (aType == FT_BelongToCylinder && !aSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName), QMessageBox::Ok);
+ if (aType == SMESH::FT_BelongToCylinder && !aSurf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface))) {
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("SHAPE_IS_NOT_A_CYLINDER").arg(aName));
return false;
}
}
myIObjects.Clear();
const SALOME_ListIO& anObjs = mySelector->StoredIObjects();
SALOME_ListIteratorOfListIO anIter (anObjs);
- for (; anIter.More(); anIter.Next()) {
+ for ( ; anIter.More(); anIter.Next()) {
TColStd_IndexedMapOfInteger aMap;
mySelector->GetIndex(anIter.Value(), aMap);
myIObjects.Bind(anIter.Value(), aMap);
insertFilterInViewer();
if (!myFilter[ aCurrType ]->GetPredicate()->_is_nil()) {
- QValueList<int> aResultIds;
+ QList<int> aResultIds;
filterSource(aCurrType, aResultIds);
selectInViewer(aCurrType, aResultIds);
}
myInsertState[ aCurrType ] = mySetInViewer->isChecked();
- myApplyToState[ aCurrType ] = mySourceGrp->id(mySourceGrp->selected());
+ myApplyToState[ aCurrType ] = mySourceGrp->checkedId();
}
catch(const SALOME::SALOME_Exception& S_ex)
{
// Purpose : Filter source ids
//=======================================================================
void SMESHGUI_FilterDlg::filterSource (const int theType,
- QValueList<int>& theResIds)
+ QList<int>& theResIds)
{
theResIds.clear();
if (myFilter[ theType ]->_is_nil())
return;
- int aSourceId = mySourceGrp->id(mySourceGrp->selected());
+ int aSourceId = mySourceGrp->checkedId();
if (aSourceId == Mesh)
{
else if (aSourceId == Dialog)
{
// retrieve ids from dialog
- QValueList<int> aDialogIds;
+ QList<int> aDialogIds;
getIdsFromWg(mySourceWg, aDialogIds);
if (myMesh->_is_nil())
// filter ids
SMESH::Predicate_ptr aPred = myFilter[ theType ]->GetPredicate();
aPred->SetMesh(myMesh);
- QValueList<int>::const_iterator anIter;
+ QList<int>::const_iterator anIter;
for (anIter = aDialogIds.begin(); anIter != aDialogIds.end(); ++ anIter)
if (aPred->IsSatisfy(*anIter))
theResIds.append(*anIter);
// Purpose : Filter source selection
//=======================================================================
void SMESHGUI_FilterDlg::filterSelectionSource (const int theType,
- QValueList<int>& theResIds)
+ QList<int>& theResIds)
{
theResIds.clear();
if (myMesh->_is_nil() || mySelectionMgr == 0)
TColStd_MapOfInteger aToBeFiltered;
SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter(myIObjects);
- for (; anIter.More(); anIter.Next())
+ for ( ; anIter.More(); anIter.Next())
{
// process sub mesh
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIter.Key());
SMESH::Predicate_ptr aPred = myFilter[ theType ]->GetPredicate();
aPred->SetMesh(myMesh);
TColStd_MapIteratorOfMapOfInteger aResIter(aToBeFiltered);
- for (; aResIter.More(); aResIter.Next())
+ for ( ; aResIter.More(); aResIter.Next())
if (aPred->IsSatisfy(aResIter.Key()))
theResIds.append(aResIter.Key());
}
// name : SMESHGUI_FilterDlg::selectInViewer
// Purpose : Select given entities in viewer
//=======================================================================
-void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QValueList<int>& theIds)
+void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList<int>& theIds)
{
if (mySelectionMgr == 0 || myMesh->_is_nil())
return;
// Remove filter corresponding to the current type from viewer
int aType = myTable->GetType();
- int aFilterId = SMESHGUI_UnknownFilter;
- if (aType == SMESH::EDGE ) aFilterId = SMESHGUI_EdgeFilter;
- else if (aType == SMESH::FACE ) aFilterId = SMESHGUI_FaceFilter;
- else if (aType == SMESH::VOLUME) aFilterId = SMESHGUI_VolumeFilter;
+ int aFilterId = SMESH::UnknownFilter;
+ if (aType == SMESH::EDGE ) aFilterId = SMESH::EdgeFilter;
+ else if (aType == SMESH::FACE ) aFilterId = SMESH::FaceFilter;
+ else if (aType == SMESH::VOLUME) aFilterId = SMESH::VolumeFilter;
Handle(VTKViewer_Filter) aFilter = SMESH::GetFilter(aFilterId);
SMESH::RemoveFilter(aFilterId);
// get vtk ids
TColStd_MapOfInteger aMap;
- QValueList<int>::const_iterator anIter;
+ QList<int>::const_iterator anIter;
for (anIter = theIds.begin(); anIter != theIds.end(); ++anIter) {
aMap.Add(*anIter);
}
{
SMESH::Filter::Criterion aCriterion;
- aCriterion.Type = FT_Undefined;
- aCriterion.Compare = FT_Undefined;
+ aCriterion.Type = SMESH::FT_Undefined;
+ aCriterion.Compare = SMESH::FT_Undefined;
aCriterion.Threshold = 0;
- aCriterion.UnaryOp = FT_Undefined;
- aCriterion.BinaryOp = FT_Undefined;
+ aCriterion.UnaryOp = SMESH::FT_Undefined;
+ aCriterion.BinaryOp = SMESH::FT_Undefined;
aCriterion.ThresholdStr = "";
aCriterion.ThresholdID = "";
aCriterion.TypeOfElement = SMESH::ALL;
if (aList.Extent() != 1 ||
!myTable->CurrentCell(aRow, aCol) ||
- myTable->GetCriterionType(aRow) != FT_BelongToGeom &&
- myTable->GetCriterionType(aRow) != FT_BelongToPlane &&
- myTable->GetCriterionType(aRow) != FT_BelongToCylinder &&
- myTable->GetCriterionType(aRow) != FT_BelongToGenSurface &&
- myTable->GetCriterionType(aRow) != FT_LyingOnGeom)
+ myTable->GetCriterionType(aRow) != SMESH::FT_BelongToGeom &&
+ myTable->GetCriterionType(aRow) != SMESH::FT_BelongToPlane &&
+ myTable->GetCriterionType(aRow) != SMESH::FT_BelongToCylinder &&
+ myTable->GetCriterionType(aRow) != SMESH::FT_BelongToGenSurface &&
+ myTable->GetCriterionType(aRow) != SMESH::FT_LyingOnGeom)
return;
Handle(SALOME_InteractiveObject) anIO = aList.First();
// name : SMESHGUI_FilterDlg::onCriterionChanged
// Purpose : SLOT called when cretarion of current row changed. Update selection
//=======================================================================
-void SMESHGUI_FilterDlg::onCriterionChanged (const int , const int)
+void SMESHGUI_FilterDlg::onCriterionChanged (const int, const int)
{
updateSelection();
}
int aRow, aCol;
if (myTable->CurrentCell(aRow, aCol) &&
- (myTable->GetCriterionType(aRow) == FT_BelongToGeom ||
- myTable->GetCriterionType(aRow) == FT_BelongToPlane ||
- myTable->GetCriterionType(aRow) == FT_BelongToCylinder ||
- myTable->GetCriterionType(aRow) == FT_BelongToGenSurface ||
- myTable->GetCriterionType(aRow) == FT_LyingOnGeom)) {
+ (myTable->GetCriterionType(aRow) == SMESH::FT_BelongToGeom ||
+ myTable->GetCriterionType(aRow) == SMESH::FT_BelongToPlane ||
+ myTable->GetCriterionType(aRow) == SMESH::FT_BelongToCylinder ||
+ myTable->GetCriterionType(aRow) == SMESH::FT_BelongToGenSurface ||
+ myTable->GetCriterionType(aRow) == SMESH::FT_LyingOnGeom)) {
- if (myTable->GetCriterionType(aRow) == FT_BelongToGeom ||
- myTable->GetCriterionType(aRow) == FT_BelongToGenSurface ||
- myTable->GetCriterionType(aRow) == FT_LyingOnGeom) {
+ if (myTable->GetCriterionType(aRow) == SMESH::FT_BelongToGeom ||
+ myTable->GetCriterionType(aRow) == SMESH::FT_BelongToGenSurface ||
+ myTable->GetCriterionType(aRow) == SMESH::FT_LyingOnGeom) {
mySelectionMgr->installFilter(new GEOM_SelectionFilter( aStudy, true ));
- } else if (myTable->GetCriterionType(aRow) == FT_BelongToPlane) {
+ } else if (myTable->GetCriterionType(aRow) == SMESH::FT_BelongToPlane) {
mySelectionMgr->installFilter(new GEOM_FaceFilter( aStudy, StdSelect_Plane ) );
- } else if (myTable->GetCriterionType(aRow) == FT_BelongToCylinder) {
+ } else if (myTable->GetCriterionType(aRow) == SMESH::FT_BelongToCylinder) {
mySelectionMgr->installFilter(new GEOM_FaceFilter( aStudy, StdSelect_Cylinder ) );
}
myIsSelectionChanged = true;
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
-
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_FilterDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_FilterDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-#ifndef SMESHGUI_FilterDlg_H
-#define SMESHGUI_FilterDlg_H
+#ifndef SMESHGUI_FILTERDLG_H
+#define SMESHGUI_FILTERDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
-#include <qframe.h>
-#include <qmap.h>
-#include <qvaluelist.h>
+// Qt includes
+#include <QWidget>
+#include <QDialog>
+#include <QMap>
+#include <QList>
-#include "LightApp_SelectionMgr.h"
-#include "SALOME_InteractiveObject.hxx"
-#include "SALOME_DataMapOfIOMapOfInteger.hxx"
-#include "SVTK_Selection.h"
-
-#include <TColStd_IndexedMapOfInteger.hxx>
+// SALOME GUI includes
+#include <SALOME_DataMapOfIOMapOfInteger.hxx>
+#include <SVTK_Selection.h>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Filter)
#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class QFrame;
class QButtonGroup;
class QCheckBox;
-class QCloseEvent;
-class QComboBox;
-class QEvent;
class QGroupBox;
class QPushButton;
-class QStringList;
-class QTable;
-class QTableItem;
-class QWidgetStack;
+class QTableWidget;
+class QTableWidgetItem;
+class QStackedWidget;
class LightApp_SelectionMgr;
class SMESHGUI;
class SMESHGUI_FilterLibraryDlg;
class SVTK_Selector;
-class SVTK_ViewWindow;
/*!
* Class : SMESHGUI_FilterTable
* - Buttons for editing table
*/
-class SMESHGUI_EXPORT SMESHGUI_FilterTable : public QFrame
+class SMESHGUI_EXPORT SMESHGUI_FilterTable : public QWidget
{
Q_OBJECT
class Table;
class ComboItem;
+ class CheckItem;
class AdditionalWidget;
+ class ComboDelegate;
typedef QMap<int, Table*> TableMap;
public:
- SMESHGUI_FilterTable( SMESHGUI*,
- QWidget* parent,
- const int type);
- SMESHGUI_FilterTable( SMESHGUI*,
- QWidget* parent,
- const QValueList<int>& type);
- virtual ~SMESHGUI_FilterTable();
+ SMESHGUI_FilterTable( SMESHGUI*, QWidget*, const int );
+ SMESHGUI_FilterTable( SMESHGUI*, QWidget*, const QList<int>& );
+ virtual ~SMESHGUI_FilterTable();
- void Init (const int type);
- void Init (const QValueList<int>& types);
+ void Init( const QList<int>& );
QGroupBox* GetTableGrp();
- bool IsValid (const bool = true, const int theEntityType = -1) const;
+ bool IsValid( const bool = true, const int = -1 ) const;
int GetType() const;
- void SetType (const int);
+ void SetType(const int);
void RestorePreviousEntityType();
- int NumRows (const int theEntityType = -1) const;
- void Clear (const int theEntityType = -1);
- void SetEditable (const bool);
- void SetEnabled (const bool);
- void SetLibsEnabled (const bool);
+ int NumRows( const int = -1 ) const;
+ void Clear( const int = -1 );
+ void SetEditable( const bool );
+ void SetEnabled( const bool );
+ void SetLibsEnabled( const bool );
bool IsEditable() const;
- int GetCriterionType (const int theRow, const int theType = -1) const;
+ int GetCriterionType( const int, const int = -1 ) const;
- void GetCriterion (const int theRow,
- SMESH::Filter::Criterion& theCriterion,
- const int theEntityType = -1) const;
+ void GetCriterion( const int,
+ SMESH::Filter::Criterion&,
+ const int = -1 ) const;
- void SetCriterion (const int theRow,
- const SMESH::Filter::Criterion& theCriterion,
- const int theEntityType = -1);
+ void SetCriterion( const int,
+ const SMESH::Filter::Criterion&,
+ const int = -1 );
- void AddCriterion (const SMESH::Filter::Criterion& theCriterion,
- const int theEntityType = -1);
+ void AddCriterion( const SMESH::Filter::Criterion&,
+ const int = -1 );
- void Copy (const SMESHGUI_FilterTable*);
- void SetValidity (const bool);
+ void Copy( const SMESHGUI_FilterTable* );
+ void SetValidity( const bool );
- bool CurrentCell (int& theRow, int& theCol) const;
- void SetThreshold (const int theRow,
- const QString& theText,
- const int theEntityType = -1);
+ bool CurrentCell( int&, int& ) const;
+ void SetThreshold( const int,
+ const QString&,
+ const int = -1 );
- bool GetThreshold (const int theRow,
- QString& theText,
- const int theEntityType = -1);
+ bool GetThreshold( const int,
+ QString&,
+ const int = -1 );
- void SetID( const int theRow,
- const QString& theText,
- const int theEntityType = -1 );
+ void SetID( const int,
+ const QString&,
+ const int = -1 );
- bool GetID( const int theRow,
- QString& theText,
- const int theEntityType = -1 );
+ bool GetID( const int,
+ QString&,
+ const int = -1 );
void Update();
signals:
-
void CopyFromClicked();
void AddToClicked();
- void EntityTypeChanged (const int);
+ void EntityTypeChanged( const int );
void NeedValidation();
- void CriterionChanged (const int theRow, const int theEntityType);
- void CurrentChanged (int, int);
+ void CriterionChanged( const int, const int );
+ void CurrentChanged( int, int );
private slots:
-
void onAddBtn();
void onInsertBtn();
void onRemoveBtn();
void onClearBtn();
void onCopyFromBtn();
void onAddToBtn();
- void onCriterionChanged (int, int);
- void onEntityType (int);
- void onCurrentChanged (int, int);
+ void onCriterionChanged( int, int );
+ void onEntityType( int );
+ void onCurrentChanged( int, int );
private:
-
- void addRow (Table*, const int, const bool toTheEnd = true);
- QTableItem* getCriterionItem (QTable*, const int);
- QTableItem* getCompareItem (QTable*);
- QTableItem* getUnaryItem (QTable*);
- QTableItem* getBinaryItem (QTable*);
- const QMap<int, QString>& getCriteria (const int theType) const;
+ void addRow( Table*, const int, const bool = true );
+ QTableWidgetItem* getCriterionItem( const int ) const;
+ QTableWidgetItem* getCompareItem() const;
+ QTableWidgetItem* getUnaryItem() const;
+ QTableWidgetItem* getBinaryItem() const;
+ const QMap<int, QString>& getCriteria( const int ) const;
const QMap<int, QString>& getCompare() const;
- Table* createTable (QWidget*, const int);
- QWidget* createAdditionalFrame (QWidget* theParent);
+ Table* createTable( QWidget*, const int );
+ QWidget* createAdditionalFrame( QWidget* );
int getFirstSelectedRow() const;
- void onCriterionChanged (const int, const int, const int);
+ void onCriterionChanged( const int, const int, const int );
void updateBtnState();
- void removeAdditionalWidget (QTable* theTable, const int theRow);
+ void removeAdditionalWidget( QTableWidget*, const int );
void updateAdditionalWidget();
const QMap<int, QString>& getSupportedTypes() const;
SMESHGUI* mySMESHGUI;
QGroupBox* myTableGrp;
- QGroupBox* mySwitchTableGrp;
+ QWidget* mySwitchTableGrp;
TableMap myTables;
QPushButton* myAddBtn;
QPushButton* myCopyFromBtn;
QPushButton* myAddToBtn;
+ QGroupBox* myEntityTypeBox;
QButtonGroup* myEntityTypeGrp;
int myEntityType;
int myIsValid;
SMESHGUI_FilterLibraryDlg* myLibDlg;
- QWidgetStack* myWgStack;
+ QStackedWidget* myWgStack;
- QMap<QTableItem*, AdditionalWidget*> myAddWidgets;
+ QMap<QTableWidgetItem*, AdditionalWidget*> myAddWidgets;
};
enum { BTN_OK, BTN_Cancel, BTN_Apply, BTN_Close, BTN_Help };
public:
- SMESHGUI_FilterDlg( SMESHGUI*,
- const QValueList<int>& types,
- const char* name = 0);
-
- SMESHGUI_FilterDlg( SMESHGUI*,
- const int type,
- const char* name = 0);
- virtual ~SMESHGUI_FilterDlg();
+ SMESHGUI_FilterDlg( SMESHGUI*, const QList<int>& );
+ SMESHGUI_FilterDlg( SMESHGUI*, const int );
+ virtual ~SMESHGUI_FilterDlg();
- void Init (const QValueList<int>& types);
- void Init (const int type);
+ void Init( const QList<int>& );
+ void Init( const int );
void SetSelection();
- void SetMesh (SMESH::SMESH_Mesh_ptr);
- void SetSourceWg (QWidget*);
+ void SetMesh( SMESH::SMESH_Mesh_ptr );
+ void SetSourceWg( QWidget* );
static SMESH::Filter::Criterion createCriterion();
void onHelp();
void onDeactivate();
void onSelectionDone();
- void onCriterionChanged (const int, const int);
- void onCurrentChanged (int, int);
+ void onCriterionChanged( const int, const int );
+ void onCurrentChanged( int, int );
private:
- void construct (const QValueList<int>& types);
+ void construct( const QList<int>& );
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*);
- void keyPressEvent(QKeyEvent*);
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void keyPressEvent( QKeyEvent* );
// dialog creation
- QFrame* createButtonFrame (QWidget*);
- QFrame* createMainFrame (QWidget*);
- QButtonGroup* createSourceGroup (QWidget*);
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame( QWidget* );
+ QWidget* createSourceGroup( QWidget* );
void updateMainButtons();
// execution
bool isValid() const;
- bool createFilter (const int theType);
+ bool createFilter( const int );
void insertFilterInViewer();
- void selectInViewer (const int theType,
- const QValueList<int>& theIds);
- void filterSource (const int theType,
- QValueList<int>& theResIds);
- void filterSelectionSource (const int theType,
- QValueList<int>& theResIds);
- void getIdsFromWg (const QWidget*, QValueList<int>&) const;
- void setIdsToWg (QWidget*, const QValueList<int>&);
- Selection_Mode getSelMode (const int) const;
+ void selectInViewer( const int, const QList<int>& );
+ void filterSource( const int, QList<int>& );
+ void filterSelectionSource( const int, QList<int>& );
+ void getIdsFromWg( const QWidget*, QList<int>& ) const;
+ void setIdsToWg( QWidget*, const QList<int>& );
+ Selection_Mode getSelMode( const int ) const;
void updateSelection();
private:
-
// widgets
- QFrame* myMainFrame;
+ QWidget* myMainFrame;
QButtonGroup* mySourceGrp;
QCheckBox* mySetInViewer;
SMESHGUI_FilterTable* myTable;
// initial fields
- QValueList<int> myTypes;
+ QList<int> myTypes;
SMESHGUI* mySMESHGUI;
LightApp_SelectionMgr* mySelectionMgr;
SVTK_Selector* mySelector;
QString myHelpFileName;
};
-#endif
+#endif // SMESHGUI_FILTERDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_FilterLibraryDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_FilterLibraryDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_FilterLibraryDlg.h"
#include "SMESHGUI.h"
-#include "SMESHGUI_Utils.h"
#include "SMESHGUI_FilterUtils.h"
-
-#include "SUIT_Session.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_FileDlg.h"
-#include "SUIT_MessageBox.h"
-
-#include "LightApp_Application.h"
-
-// QT Includes
-#include <qapplication.h>
-#include <qmessagebox.h>
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlistbox.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qdir.h>
-
-#define SPACING 5
-#define MARGIN 10
+#include "SMESHGUI_FilterDlg.h"
+
+// SALOME GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <LightApp_Application.h>
+
+// Qt includes
+#include <QApplication>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QLabel>
+#include <QListWidget>
+#include <QFileInfo>
+#include <QDir>
+#include <QKeyEvent>
+
+#define SPACING 6
+#define MARGIN 11
/*!
* Class : SMESHGUI_FilterLibraryDlg::Dialog
class SMESHGUI_FilterLibraryDlg::Dialog : public SUIT_FileDlg
{
- public:
+public:
Dialog(QWidget* theParent, const bool theToOpen);
virtual ~Dialog();
- protected:
+protected:
virtual bool acceptData();
};
SMESHGUI_FilterLibraryDlg::Dialog::Dialog (QWidget* theParent,
const bool theToOpen)
- : SUIT_FileDlg(theParent, theToOpen)
+ : SUIT_FileDlg(theParent, theToOpen)
{
}
//=======================================================================
SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (SMESHGUI* theModule,
QWidget* parent,
- const QValueList<int>& theTypes,
- const int theMode,
- const char* theName)
- : QDialog( parent, theName, false, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
- mySMESHGUI( theModule )
+ const QList<int>& theTypes,
+ const int theMode)
+ : QDialog( parent ),
+ mySMESHGUI( theModule )
{
+ setModal(false);
construct(theTypes, theMode);
}
SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (SMESHGUI* theModule,
QWidget* parent,
const int theType,
- const int theMode,
- const char* theName)
- : QDialog( parent, theName, true, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
- mySMESHGUI( theModule )
+ const int theMode)
+ : QDialog( parent ),
+ mySMESHGUI( theModule )
{
- QValueList<int> aTypes;
+ setModal(true);
+ QList<int> aTypes;
aTypes.append(theType);
construct(aTypes, theMode);
}
// name : SMESHGUI_FilterLibraryDlg::construct
// Purpose : Construct dialog (called by constructor)
//=======================================================================
-void SMESHGUI_FilterLibraryDlg::construct (const QValueList<int>& theTypes,
+void SMESHGUI_FilterLibraryDlg::construct (const QList<int>& theTypes,
const int theMode)
{
myTypes = theTypes;
myMode = theMode;
- QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout(this);
+ aDlgLay->setMargin(MARGIN);
+ aDlgLay->setSpacing(SPACING);
myMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
+ QWidget* aBtnFrame = createButtonFrame(this);
aDlgLay->addWidget(myMainFrame);
aDlgLay->addWidget(aBtnFrame);
// name : SMESHGUI_FilterLibraryDlg::createMainFrame
// Purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_FilterLibraryDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_FilterLibraryDlg::createMainFrame (QWidget* theParent)
{
- QGroupBox* aMainFrame = new QGroupBox(1, Qt::Horizontal, theParent);
- aMainFrame->setFrameStyle(QFrame::NoFrame);
- aMainFrame->setInsideMargin(0);
+ QWidget* aMainFrame = new QWidget(theParent);
+ QGridLayout* aMainLay = new QGridLayout(aMainFrame);
+ aMainLay->setMargin(0);
+ aMainLay->setSpacing(SPACING);
// library name
- QGroupBox* aGrp = new QGroupBox(1, Qt::Vertical, aMainFrame);
- aGrp->setFrameStyle(QFrame::NoFrame);
- aGrp->setInsideMargin(0);
-
- new QLabel(tr("LIBRARY_FILE"), aGrp);
- myFileName = new QLineEdit(aGrp);
- myOpenBtn = new QPushButton(aGrp);
- myOpenBtn->setPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap(
+ QLabel* aFileLab = new QLabel(tr("LIBRARY_FILE"), aMainFrame);
+ myFileName = new QLineEdit(aMainFrame);
+ myOpenBtn = new QPushButton(aMainFrame);
+ myOpenBtn->setIcon(SUIT_Session::session()->resourceMgr()->loadPixmap(
"SUIT", tr("ICON_FILE_OPEN")));
// filters list box
- aGrp = new QGroupBox(1, Qt::Vertical, tr("FILTER_NAMES"), aMainFrame);
- QFrame* aFrame = new QFrame(aGrp);
- myListBox = new QListBox(aFrame);
- myAddBtn = new QPushButton(tr("ADD"), aFrame);
- myDeleteBtn = new QPushButton(tr("DELETE"), aFrame);
+ QGroupBox* aFiltersGrp = new QGroupBox(tr("FILTER_NAMES"), aMainFrame);
+ QGridLayout* aLay = new QGridLayout(aFiltersGrp);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
+
+ myListBox = new QListWidget(aFiltersGrp);
+
+ myAddBtn = new QPushButton(tr("ADD"), aFiltersGrp);
+ myDeleteBtn = new QPushButton(tr("DELETE"), aFiltersGrp);
- QGridLayout* aLay = new QGridLayout(aFrame, 3, 2, 0, 5);
- aLay->addMultiCellWidget(myListBox, 0, 2, 0, 0);
- aLay->addWidget(myAddBtn, 0, 1);
+ aLay->addWidget(myListBox, 0, 0, 3, 1);
+ aLay->addWidget(myAddBtn, 0, 1);
aLay->addWidget(myDeleteBtn, 1, 1);
- QSpacerItem* aVSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
- aLay->addItem(aVSpacer, 2, 1);
+ aLay->setRowStretch(2, 5);
// filter name
- myNameGrp = new QGroupBox(1, Qt::Vertical, aMainFrame);
- myNameGrp->setFrameStyle(QFrame::NoFrame);
- myNameGrp->setInsideMargin(0);
- new QLabel(tr("FILTER_NAME"), myNameGrp);
- myName = new QLineEdit(myNameGrp);
+ myNameGrp = new QWidget(aMainFrame);
+ QHBoxLayout* myNameGrpLayout = new QHBoxLayout(myNameGrp);
+ myNameGrpLayout->setMargin(0);
+ myNameGrpLayout->setSpacing(SPACING);
+
+ myNameGrpLayout->addWidget( new QLabel(tr("FILTER_NAME"), myNameGrp) );
+ myNameGrpLayout->addWidget( myName = new QLineEdit(myNameGrp) );
// table
myTable->SetLibsEnabled(false);
myListBox->setMinimumHeight((int)(myTable->sizeHint().height() * 0.5));
- myListBox->setRowMode(QListBox::FitToWidth);
- myListBox->setSelectionMode(QListBox::Single);
+ //myListBox->setRowMode(QListWidget::FitToWidth); //VSR : TODO ???
+ myListBox->setSelectionMode(QListWidget::SingleSelection);
myOpenBtn->setAutoDefault(false);
myAddBtn->setAutoDefault(false);
myDeleteBtn->setAutoDefault(false);
+ aMainLay->addWidget(aFileLab, 0, 0);
+ aMainLay->addWidget(myFileName, 0, 1);
+ aMainLay->addWidget(myOpenBtn, 0, 2);
+ aMainLay->addWidget(aFiltersGrp, 1, 0, 1, 3);
+ aMainLay->addWidget(myNameGrp, 2, 0, 1, 3);
+ aMainLay->addWidget(myTable, 3, 0, 1, 3);
+
// connect signals and slots
connect(myFileName, SIGNAL(returnPressed()), this, SLOT(onReturnPressed()));
- connect(myOpenBtn , SIGNAL(clicked()), this, SLOT(onBrowse()));
+ connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse()));
- connect(myListBox, SIGNAL(highlighted(const QString&)),
- this, SLOT(onFilterChanged(const QString&)));
+ connect(myListBox, SIGNAL(currentTextChanged(const QString&)),
+ this, SLOT(onFilterChanged(const QString&)));
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed()));
connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed()));
// name : SMESHGUI_FilterLibraryDlg::createButtonFrame
// Purpose : Create frame containing buttons
//=======================================================================
-QFrame* SMESHGUI_FilterLibraryDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_FilterLibraryDlg::createButtonFrame (QWidget* theParent)
{
- QGroupBox* aGrp = new QGroupBox(1, Qt::Vertical, theParent);
+ QGroupBox* aGrp = new QGroupBox(theParent);
+ QHBoxLayout* aLay = new QHBoxLayout(aGrp);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
myButtons[ BTN_OK ] = new QPushButton(tr("SMESH_BUT_OK" ), aGrp);
myButtons[ BTN_Apply ] = new QPushButton(tr("SMESH_BUT_APPLY"), aGrp);
aLbl->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
myButtons[ BTN_Cancel ] = new QPushButton(tr("SMESH_BUT_CANCEL"), aGrp);
- myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp);
- myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp);
+ myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp);
+ myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp);
+
+ aLay->addWidget(myButtons[ BTN_OK ]);
+ aLay->addSpacing(10);
+ aLay->addWidget(myButtons[ BTN_Apply ]);
+ aLay->addSpacing(10);
+ aLay->addStretch();
+ aLay->addWidget(myButtons[ BTN_Cancel ]);
+ aLay->addWidget(myButtons[ BTN_Close ]);
+ aLay->addWidget(myButtons[ BTN_Help ]);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk()));
connect(myButtons[ BTN_Cancel ], SIGNAL(clicked()), SLOT(onClose()));
QMap<int, QPushButton*>::iterator anIter;
for (anIter = myButtons.begin(); anIter != myButtons.end(); ++anIter)
- anIter.data()->setAutoDefault(false);
+ anIter.value()->setAutoDefault(false);
updateMainButtons();
//=======================================================================
void SMESHGUI_FilterLibraryDlg::Init (const int type, const int theMode)
{
- QValueList<int> aTypes;
+ QList<int> aTypes;
aTypes.append(type);
Init(aTypes, theMode);
}
// name : SMESHGUI_FilterLibraryDlg::Init
// Purpose : Init dialog fields, connect signals and slots, show dialog
//=======================================================================
-void SMESHGUI_FilterLibraryDlg::Init (const QValueList<int>& theTypes,
+void SMESHGUI_FilterLibraryDlg::Init (const QList<int>& theTypes,
const int theMode)
{
myMode = theMode;
if (myMode == ADD_TO)
{
- setCaption(tr("ADD_TO_TLT"));
+ setWindowTitle(tr("ADD_TO_TLT"));
if (myFileName->text().isEmpty())
myFileName->setText(getDefaultLibraryName());
processNewLibrary();
}
else if (myMode == COPY_FROM)
{
- setCaption(tr("COPY_FROM_TLT"));
+ setWindowTitle(tr("COPY_FROM_TLT"));
if (myFileName->text().isEmpty())
myFileName->setText(getDefaultLibraryName());
processNewLibrary();
}
else
{
- setCaption(tr("EDIT_LIB_TLT"));
+ setWindowTitle(tr("EDIT_LIB_TLT"));
if (myFileName->text().isEmpty())
myFileName->setText(getDefaultLibraryName());
processNewLibrary();
return false;
if (myLibrary->_is_nil()) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("LIBRARY_IS_NOT_LOADED"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
+ tr("LIBRARY_IS_NOT_LOADED"));
return false;
}
- const char* aName = myFileName->text().latin1();
- if (strcmp(myLibrary->GetFileName(), aName) != 0)
- myLibrary->SetFileName(aName);
+ if (myFileName->text() != myLibrary->GetFileName())
+ myLibrary->SetFileName(myFileName->text().toLatin1().data());
bool aResult = false;
aResult = true;
} else if (myMode == EDIT || myMode == ADD_TO) {
SMESH::Filter_var aFilter = createFilter();
- if (!myLibrary->Replace(myCurrFilterName, myName->text(), aFilter.in())) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_EDITING"), QMessageBox::Ok);
+ if (!myLibrary->Replace(myCurrFilterName.toLatin1().data(),
+ myName->text().toLatin1().data(),
+ aFilter.in())) {
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
+ tr("ERROR_OF_EDITING"));
aResult = false;
}
else
getDefaultLibraryName() = QString(aFileName);
delete aFileName;
} else if (myMode != COPY_FROM) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_SAVING"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
+ tr("ERROR_OF_SAVING"));
} else {
}
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
{
QStringList res;
- int b = theFilter.findRev("(");
- int e = theFilter.findRev(")");
+ int b = theFilter.lastIndexOf("(");
+ int e = theFilter.lastIndexOf(")");
if (b != -1 && e != -1)
{
- QString content = theFilter.mid(b + 1, e - b - 1).stripWhiteSpace();
- QStringList lst = QStringList::split(" ", content);
+ QString content = theFilter.mid(b + 1, e - b - 1).trimmed();
+ QStringList lst = content.split(" ", QString::SkipEmptyParts);
for (QStringList::const_iterator it = lst.begin(); it != lst.end(); ++it)
- if ((*it).find(".") != -1)
- res.append((*it).stripWhiteSpace());
+ if ((*it).indexOf(".") != -1)
+ res.append((*it).trimmed());
}
return res;
}
void SMESHGUI_FilterLibraryDlg::onBrowse()
{
Dialog* aDlg = new Dialog(this, true);
- aDlg->setCaption(tr("OPEN_LIBRARY"));
+ aDlg->setWindowTitle(tr("OPEN_LIBRARY"));
//aDlg->setMode(myMode == COPY_FROM ? QFileDialogP::ExistingFile : QFileDialogP::AnyFile);
- aDlg->setMode(myMode == COPY_FROM ? QFileDialog::ExistingFile : QFileDialog::AnyFile);
+ aDlg->setFileMode(myMode == COPY_FROM ? QFileDialog::ExistingFile : QFileDialog::AnyFile);
aDlg->setFilters(prepareFilters());
- aDlg->setSelection(getFileName());
+ aDlg->selectFile(getFileName());
- QPushButton* anOkBtn = (QPushButton*)aDlg->child("OK", "QPushButton");
+ QPushButton* anOkBtn = (QPushButton*)aDlg->findChild<QPushButton*>("OK");
if (anOkBtn != 0)
anOkBtn->setText(tr("SMESH_BUT_OK"));
if (fName.isEmpty())
return;
- if (QFileInfo(fName).extension().isEmpty())
+ if (QFileInfo(fName).suffix().isEmpty())
fName = autoExtension(fName);
fName = QDir::convertSeparators(fName);
setFileName(fName);
- QString aName = myListBox->text(myListBox->count() - 1);
+ QString aName = myListBox->item(myListBox->count() - 1)->text();
processNewLibrary();
if (myMode == ADD_TO)
if (aFilterMgr->_is_nil())
return;
- myLibrary = aFilterMgr->LoadLibrary(autoExtension(getFileName()));
+ myLibrary = aFilterMgr->LoadLibrary(autoExtension(getFileName()).toLatin1().data());
if (myLibrary->_is_nil()) {
if (myMode == COPY_FROM) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_LOAD"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
+ tr("ERROR_LOAD"));
return;
} else {
myLibrary = aFilterMgr->CreateLibrary();
- myLibrary->SetFileName(getFileName().latin1());
+ myLibrary->SetFileName(getFileName().toLatin1().data());
}
}
for (int i = 0, n = aNames->length(); i < n; i++)
aList.append(QString(aNames[ i ]));
myListBox->clear();
- myListBox->insertStringList(aList);
+ myListBox->addItems(aList);
if (myListBox->count() == 0)
{
myTable->Clear(myTable->GetType());
QString aCurrName = myName->text();
if (aCurrName.isEmpty()) {
if (theMess)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("EMPTY_FILTER_NAME"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("EMPTY_FILTER_NAME"));
return false;
}
for (int f = 0, n = aNames->length(); f < n; f++) {
if (aNames[ f ] == aCurrName && aNames[ f ] != myCurrFilterName) {
if (theMess)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("ERROR_FILTER_NAME"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+ tr("ERROR_FILTER_NAME"));
return false;
}
}
bool isWritable = false;
QString fName(myFileName->text());
- if (QFileInfo(fName).extension().isEmpty())
+ if (QFileInfo(fName).suffix().isEmpty())
fName = autoExtension(fName);
fName = QDir::convertSeparators(fName);
if (QFileInfo(fName).exists()) {
isWritable = QFileInfo(fName).isWritable();
} else if (!theIsExistingOnly) {
- QFileInfo aDirInfo(QFileInfo(fName).dirPath(true));
+ QFileInfo aDirInfo(QFileInfo(fName).absolutePath());
isWritable = aDirInfo.isWritable();
/*if (QDir(QFileInfo(fName).dirPath(true)).exists() ||
QDir().mkdir(QFileInfo(fName).dirPath(true)))
}
if (!isWritable) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("NO_PERMISSION"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
+ tr("NO_PERMISSION"));
return false;
}
if (!isValid(true))
{
myListBox->blockSignals(true);
- myListBox->setCurrentItem(myCurrFilter);
+ myListBox->setCurrentRow(myCurrFilter);
myListBox->blockSignals(false);
return;
}
SMESH::Filter_var aFilter = createFilter();
- myLibrary->Replace(myCurrFilterName.latin1(), myName->text().latin1(), aFilter);
+ myLibrary->Replace(myCurrFilterName.toLatin1().data(),
+ myName->text().toLatin1().data(),
+ aFilter);
}
// Fill table with filter parameters
- SMESH::Filter_var aFilter = myLibrary->Copy(theName);
+ SMESH::Filter_var aFilter = myLibrary->Copy(theName.toLatin1().data());
myCurrFilterName = theName;
- myCurrFilter = myListBox->currentItem();
+ myCurrFilter = myListBox->currentRow();
myName->setText(theName);
//=======================================================================
void SMESHGUI_FilterLibraryDlg::onReturnPressed()
{
- QString aName = myListBox->text(myListBox->count() - 1);
+ QString aName = myListBox->item(myListBox->count() - 1)->text();
processNewLibrary();
return;
SMESH::Filter_var aFilter = createFilter();
- myLibrary->Replace(myCurrFilterName.latin1(), myName->text().latin1(), aFilter);
+ myLibrary->Replace(myCurrFilterName.toLatin1().data(),
+ myName->text().toLatin1().data(),
+ aFilter);
}
addFilterToLib(getDefaultFilterName());
void SMESHGUI_FilterLibraryDlg::addFilterToLib (const QString& theName)
{
if (myLibrary->_is_nil()) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("LIBRARY_IS_NOT_LOADED"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
+ tr("LIBRARY_IS_NOT_LOADED"));
return;
}
// add new filter in library
bool aResult = !aFilter->GetPredicate()->_is_nil()
- ? myLibrary->Add(aName.latin1(), aFilter)
- : myLibrary->AddEmpty(aName.latin1(), (SMESH::ElementType)myTable->GetType());
+ ? myLibrary->Add(aName.toLatin1().data(), aFilter)
+ : myLibrary->AddEmpty(aName.toLatin1().data(), (SMESH::ElementType)myTable->GetType());
if (!aResult) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_ADDING"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
+ tr("ERROR_OF_ADDING"));
}
updateList();
setSelected(aName);
if (theName != aName)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"),
- tr("ASSIGN_NEW_NAME").arg(theName).arg(aName), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"),
+ tr("ASSIGN_NEW_NAME").arg(theName).arg(aName));
}
//=======================================================================
static QString aName;
if (aName.isEmpty())
{
- QString aHomeDir = QDir(QDir::home()).absPath();
+ QString aHomeDir = QDir(QDir::home()).absolutePath();
aName = aHomeDir + "/" + tr ("LIB_NAME");
}
return aName;
int anIndex = getIndex(theName);
if (anIndex != -1)
{
- myListBox->setCurrentItem(anIndex);
+ myListBox->setCurrentRow(anIndex);
myCurrFilterName = theName;
myCurrFilter = anIndex;
}
int SMESHGUI_FilterLibraryDlg::getIndex(const QString& theName) const
{
for (int i = 0, n = myListBox->count(); i < n; i++)
- if (myListBox->text(i) == theName)
+ if (myListBox->item(i)->text() == theName)
return i;
return -1;
}
void SMESHGUI_FilterLibraryDlg::onDeleteBtnPressed()
{
if (myLibrary->_is_nil()) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("LIBRARY_IS_NOT_LOADED"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
+ tr("LIBRARY_IS_NOT_LOADED"));
return;
}
int anIndex = getIndex(myCurrFilterName);
- if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.latin1())) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_DELETING"), QMessageBox::Ok);
+ if (anIndex == -1 || !myLibrary->Delete(myCurrFilterName.toLatin1().data())) {
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
+ tr("ERROR_OF_DELETING"));
} else {
myCurrFilterName = "";
myCurrFilter = -1;
- myListBox->removeItem(anIndex);
+ delete myListBox->item(anIndex);
if (anIndex >= 1)
- myListBox->setSelected(anIndex - 1, true);
+ myListBox->item(anIndex - 1)->setSelected(true);
else if (anIndex == 0 && myListBox->count() > 0)
- myListBox->setSelected(0, true);
+ myListBox->item(0)->setSelected(true);
else
myTable->Clear();
}
//=======================================================================
void SMESHGUI_FilterLibraryDlg::onFilterNameChanged (const QString& theName)
{
- int aCurrItem = myListBox->currentItem();
+ int aCurrItem = myListBox->currentRow();
if (aCurrItem == -1)
return;
myListBox->blockSignals(true);
- myListBox->changeItem(theName, aCurrItem);
+ myListBox->item(aCurrItem)->setText(theName);
myListBox->blockSignals(false);
}
if (valid)
{
SMESH::Filter_var aFilter = createFilter(myTable->GetType());
- myLibrary->Replace(myCurrFilterName.latin1(), myName->text().latin1(), aFilter);
+ myLibrary->Replace(myCurrFilterName.toLatin1().data(),
+ myName->text().toLatin1().data(),
+ aFilter);
}
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_FilterLibraryDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_FilterLibraryDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-#ifndef SMESHGUI_FilterLibraryDlg_H
-#define SMESHGUI_FilterLibraryDlg_H
+#ifndef SMESHGUI_FILTERLIBRARYDLG_H
+#define SMESHGUI_FILTERLIBRARYDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
-#include <SMESHGUI_FilterDlg.h>
+// Qt includes
+#include <QDialog>
+#include <QList>
+#include <QMap>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Filter)
-class QCloseEvent;
-class QListBox;
-class QFrame;
-class QEvent;
+class QListWidget;
class QLineEdit;
class QPushButton;
-class QGroupBox;
+class SMESHGUI;
+class SMESHGUI_FilterTable;
/*
Class : SMESHGUI_FilterLibraryDlg
enum { ADD_TO, COPY_FROM, EDIT };
public:
-
- SMESHGUI_FilterLibraryDlg( SMESHGUI*,
- QWidget*,
- const QValueList<int>& types,
- const int mode,
- const char* name = 0 );
-
- SMESHGUI_FilterLibraryDlg( SMESHGUI*,
- QWidget*,
- const int type,
- const int mode,
- const char* name = 0 );
-
- virtual ~SMESHGUI_FilterLibraryDlg();
+ SMESHGUI_FilterLibraryDlg( SMESHGUI*, QWidget*, const QList<int>&, const int );
+ SMESHGUI_FilterLibraryDlg( SMESHGUI*, QWidget*, const int, const int );
+ virtual ~SMESHGUI_FilterLibraryDlg();
- void Init( const QValueList<int>& types, const int theMode );
- void Init( const int type, const int theMode );
+ void Init( const QList<int>&, const int );
+ void Init( const int, const int );
const SMESHGUI_FilterTable* GetTable() const;
void SetTable( const SMESHGUI_FilterTable* );
private:
-
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
- void keyPressEvent( QKeyEvent* e );
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void keyPressEvent( QKeyEvent* );
private slots:
-
void onOk();
bool onApply();
void onClose();
void onNeedValidation();
private:
-
- void construct( const QValueList<int>& types, const int mode );
- QFrame* createButtonFrame( QWidget* );
- QFrame* createMainFrame ( QWidget* );
- bool isValid( const bool theMess = true ) const;
- bool isNameValid( const bool theMess = true ) const;
- SMESH::Filter_ptr createFilter( const int theType = -1 );
+ void construct( const QList<int>&, const int );
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame( QWidget* );
+ bool isValid( const bool = true ) const;
+ bool isNameValid( const bool = true ) const;
+ SMESH::Filter_ptr createFilter( const int = -1 );
QStringList prepareFilters() const;
QString autoExtension( const QString& ) const;
bool setSelected( const QString& );
void enableMainButtons();
void processNewLibrary();
QString getFileName() const;
- void setFileName( const QString& txt, const bool autoExtension = true );
- QStringList filterWildCards( const QString& theFilter ) const;
+ void setFileName( const QString&, const bool = true );
+ QStringList filterWildCards( const QString& ) const;
QString& getDefaultLibraryName() const;
QString getDefaultFilterName() const;
- void addFilterToLib( const QString& name );
+ void addFilterToLib( const QString& );
void updateList();
- bool isPermissionValid( const bool theIsExistingOnly );
+ bool isPermissionValid( const bool );
private:
- QFrame* myMainFrame;
+ QWidget* myMainFrame;
QMap<int, QPushButton*> myButtons;
SMESHGUI_FilterTable* myTable;
QLineEdit* myFileName;
QPushButton* myOpenBtn;
- QListBox* myListBox;
+ QListWidget* myListBox;
QPushButton* myAddBtn;
QPushButton* myDeleteBtn;
- QGroupBox* myNameGrp;
+ QWidget* myNameGrp;
QLineEdit* myName;
SMESHGUI* mySMESHGUI;
- QValueList<int> myTypes;
+ QList<int> myTypes;
int myMode;
SMESH::FilterLibrary_var myLibrary;
QString myHelpFileName;
};
-#endif
+#endif // SMESHGUI_FILTERLIBRARYDLG_H
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_FilterUtils.cxx
+// Author : Open CASCADE S.A.S.
+//
-
+// SMESH includes
#include "SMESHGUI_FilterUtils.h"
#include "SMESHGUI.h"
-#include "utilities.h"
-
namespace SMESH
{
SMESH::FilterManager_var& GetFilterManager()
}
return aFilterManager;
}
-}
+} // end of namespace SMESH
-// 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
-//
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_FilterUtils.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_FilterUtils_HeaderFile
-#define SMESHGUI_FilterUtils_HeaderFile
+#ifndef SMESHGUI_FILTERUTILS_H
+#define SMESHGUI_FILTERUTILS_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "SALOMEconfig.h"
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Filter)
-
-namespace SMESH{
-
+namespace SMESH
+{
SMESHGUI_EXPORT SMESH::FilterManager_var& GetFilterManager();
-
}
-
-#endif
+#endif // SMESHGUI_FILTERUTILS_H
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_GEOMGenUtils.cxx
+// Author : Open CASCADE S.A.S.
+//
-#include <boost/shared_ptr.hpp>
-
+// SMESH includes
#include "SMESHGUI_GEOMGenUtils.h"
#include "SMESHGUI_Utils.h"
+// SALOME GEOM includes
#include <GeometryGUI.h>
-#include <SALOMEDSClient_SObject.hxx>
-#include <SALOMEDSClient_ChildIterator.hxx>
+// SALOME KERNEL includes
#include <SALOMEDS_SObject.hxx>
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
-
-namespace SMESH {
-
+namespace SMESH
+{
GEOM::GEOM_Gen_var GetGEOMGen()
{
static GEOM::GEOM_Gen_var aGEOMGen;
return GEOM::GEOM_Object::_nil();
_PTR(ChildIterator) anIter (aStudy->NewChildIterator(theSO));
- for (; anIter->More(); anIter->Next()) {
+ for ( ; anIter->More(); anIter->Next()) {
_PTR(SObject) aSObject = anIter->Value();
_PTR(SObject) aRefSOClient;
GEOM::GEOM_Object_var aMeshShape;
GEOM::GEOM_Object_var subShape = aShapesOp->GetSubShape (theMainShape,theID);
return subShape._retn();
}
-}
+} // end of namespace SMESH
-// 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.
+// SMESH SMESHGUI : GUI for SMESH 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
//
-// 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 : SMESHGUI_GEOMGenUtils.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_GEOMGenUtils_HeaderFile
-#define SMESHGUI_GEOMGenUtils_HeaderFile
+#ifndef SMESHGUI_GEOMGENUTILS_H
+#define SMESHGUI_GEOMGENUTILS_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(GEOM_Gen)
+// SALOME KERNEL includes
+#include <SALOMEDSClient_definitions.hxx>
-#include "SALOMEDSClient_definitions.hxx"
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(GEOM_Gen)
class SALOMEDSClient_SObject;
namespace SMESH
{
- SMESHGUI_EXPORT GEOM::GEOM_Gen_var GetGEOMGen();
+ SMESHGUI_EXPORT GEOM::GEOM_Gen_var GetGEOMGen();
- SMESHGUI_EXPORT GEOM::GEOM_Object_var GetShapeOnMeshOrSubMesh (_PTR(SObject) theSObject);
+ SMESHGUI_EXPORT GEOM::GEOM_Object_var GetShapeOnMeshOrSubMesh( _PTR(SObject) );
- SMESHGUI_EXPORT GEOM::GEOM_Object_ptr GetGeom (_PTR(SObject) theSO);
+ SMESHGUI_EXPORT GEOM::GEOM_Object_ptr GetGeom( _PTR(SObject) );
- SMESHGUI_EXPORT GEOM::GEOM_Object_ptr GetSubShape (GEOM::GEOM_Object_ptr theMainShape,
- long theID);
+ SMESHGUI_EXPORT GEOM::GEOM_Object_ptr GetSubShape( GEOM::GEOM_Object_ptr, long );
}
-#endif
+#endif // SMESHGUI_GEOMGENUTILS_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003 CEA
//
-// 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 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.
+// 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
+// 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 : SMESHGUI_GroupDlg.cxx
+// Author : Natalia KOPNOVA, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_GroupDlg.cxx
-// Author : Natalia KOPNOVA
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_GroupDlg.h"
-#include "SMESHGUI_FilterDlg.h"
-#include "SMESHGUI_ShapeByMeshDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
-#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_GroupUtils.h"
#include "SMESHGUI_FilterUtils.h"
#include "SMESHGUI_GEOMGenUtils.h"
+#include "SMESHGUI_FilterDlg.h"
+#include "SMESHGUI_ShapeByMeshDlg.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_Actor.h"
-#include "SMESH_ActorUtils.h"
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
-#include "GEOMBase.h"
-#include "GEOM_SelectionFilter.h"
+// SALOME GEOM includes
+#include <GEOMBase.h>
+#include <GEOM_SelectionFilter.h>
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <QtxColorButton.h>
-#include "SalomeApp_Tools.h"
-#include "SalomeApp_Application.h"
-#include "SalomeApp_Study.h"
-#include "LightApp_Application.h"
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
+#include <SalomeApp_Tools.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
-// OCCT Includes
+#include <SVTK_ViewWindow.h>
+
+// SALOME KERNEL includes
+#include <SALOMEDSClient_Study.hxx>
+
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-// QT Includes
-#include <qbuttongroup.h>
-#include <qcursor.h>
-#include <qgroupbox.h>
-#include <qhbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qtoolbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qmemarray.h>
-#include <qwidgetstack.h>
-#include <qcolordialog.h>
-
-#include <QtxIntSpinBox.h>
+// Qt includes
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QToolButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QListWidget>
+#include <QStackedWidget>
+#include <QKeyEvent>
+#include <QMenu>
// STL includes
#include <vector>
#include <algorithm>
#include <set>
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// function : SMESHGUI_GroupDlg()
// purpose :
//=================================================================================
-SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
- SMESH::SMESH_Mesh_ptr theMesh, bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- mySelector(SMESH::GetViewWindow( theModule )->GetSelector()),
- myIsBusy( false ),
- myActor( 0 )
+SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
+ SMESH::SMESH_Mesh_ptr theMesh )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ mySelector(SMESH::GetViewWindow( theModule )->GetSelector()),
+ myIsBusy( false ),
+ myActor( 0 )
{
- if (!name) setName("SMESHGUI_GroupDlg");
initDialog(true);
if (!theMesh->_is_nil())
init(theMesh);
// function : SMESHGUI_GroupDlg()
// purpose :
//=================================================================================
-SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule, const char* name,
- SMESH::SMESH_GroupBase_ptr theGroup, bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- mySelector(SMESH::GetViewWindow( theModule )->GetSelector()),
- myIsBusy( false )
+SMESHGUI_GroupDlg::SMESHGUI_GroupDlg( SMESHGUI* theModule,
+ SMESH::SMESH_GroupBase_ptr theGroup )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ mySelector(SMESH::GetViewWindow( theModule )->GetSelector()),
+ myIsBusy( false )
{
- if (!name) setName("SMESHGUI_GroupDlg");
-
initDialog(false);
if (!theGroup->_is_nil())
init(theGroup);
//=================================================================================
void SMESHGUI_GroupDlg::initDialog(bool create)
{
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+
myFilterDlg = 0;
myCreate = create;
myCurrentLineEdit = 0;
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (create) {
- setCaption(tr("SMESH_CREATE_GROUP_TITLE"));
- myHelpFileName = "creating_groups_page.html";
- }
- else {
- setCaption(tr("SMESH_EDIT_GROUP_TITLE"));
- myHelpFileName = "editing_groups_page.html";
- }
+ setWindowTitle(create ? tr("SMESH_CREATE_GROUP_TITLE") : tr("SMESH_EDIT_GROUP_TITLE"));
+ myHelpFileName = create ? "creating_groups_page.html" : "editing_groups_page.html";
- setSizeGripEnabled(TRUE);
+ setSizeGripEnabled(true);
- QGridLayout* aMainLayout = new QGridLayout(this, 7, 3, 11, 6);
+ QGridLayout* aMainLayout = new QGridLayout(this);
+ aMainLayout->setMargin( MARGIN );
+ aMainLayout->setSpacing( SPACING );
/***************************************************************/
- QLabel* meshGroupLab = new QLabel(this, "mesh/group label");
- if (create)
- meshGroupLab->setText(tr("SMESH_MESH"));
- else
- meshGroupLab->setText(tr("SMESH_GROUP"));
- myMeshGroupBtn = new QPushButton(this, "mesh/group button");
- myMeshGroupBtn->setPixmap(image0);
- myMeshGroupLine = new QLineEdit(this, "mesh/group line");
+ QLabel* meshGroupLab = new QLabel(create ? tr("SMESH_MESH") : tr("SMESH_GROUP"), this);
+ myMeshGroupBtn = new QPushButton(this);
+ myMeshGroupBtn->setIcon(image0);
+ myMeshGroupLine = new QLineEdit(this);
myMeshGroupLine->setReadOnly(true);
/***************************************************************/
- myTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Group types");
- myTypeGroup->setTitle(tr("SMESH_ELEMENTS_TYPE"));
- myTypeGroup->setExclusive(true);
+ QGroupBox* aTypeBox = new QGroupBox(tr("SMESH_ELEMENTS_TYPE"), this);
+ myTypeGroup = new QButtonGroup(this);
+ QHBoxLayout* aTypeBoxLayout = new QHBoxLayout( aTypeBox );
+ aTypeBoxLayout->setMargin( MARGIN );
+ aTypeBoxLayout->setSpacing( SPACING );
QStringList types;
types.append(tr("MESH_NODE"));
types.append(tr("SMESH_VOLUME"));
QRadioButton* rb;
for (int i = 0; i < types.count(); i++) {
- rb = new QRadioButton(types[i], myTypeGroup);
+ rb = new QRadioButton(types[i], aTypeBox);
+ myTypeGroup->addButton(rb, i);
+ aTypeBoxLayout->addWidget( rb );
}
- myTypeGroup->setEnabled(create);
+ aTypeBox->setEnabled(create);
myTypeId = -1;
/***************************************************************/
- QLabel* aName = new QLabel(this, "name label");
- aName->setText(tr("SMESH_NAME"));
- aName->setMinimumSize(50,0);
- myName = new QLineEdit(this, "name");
+ QLabel* aName = new QLabel(tr("SMESH_NAME"), this);
+ aName->setMinimumWidth(50);
+ myName = new QLineEdit(this);
/***************************************************************/
- myGrpTypeGroup = new QButtonGroup(1, Qt::Vertical, this, "Type of group");
- myGrpTypeGroup->setTitle(tr("SMESH_GROUP_TYPE"));
- myGrpTypeGroup->setExclusive(true);
- QRadioButton* rb1 = new QRadioButton( tr("SMESH_GROUP_STANDALONE"), myGrpTypeGroup);
- QRadioButton* rb2 = new QRadioButton( tr("SMESH_GROUP_GEOMETRY"), myGrpTypeGroup);
- myGrpTypeGroup->setEnabled(create);
+ QGroupBox* aGrpTypeBox = new QGroupBox(tr("SMESH_GROUP_TYPE"), this);
+ myGrpTypeGroup = new QButtonGroup(this);
+ QHBoxLayout* aGrpTypeBoxLayout = new QHBoxLayout( aGrpTypeBox );
+ aGrpTypeBoxLayout->setMargin( MARGIN );
+ aGrpTypeBoxLayout->setSpacing( SPACING );
+
+ QRadioButton* rb1 = new QRadioButton( tr("SMESH_GROUP_STANDALONE"), aGrpTypeBox);
+ QRadioButton* rb2 = new QRadioButton( tr("SMESH_GROUP_GEOMETRY"), aGrpTypeBox);
+ myGrpTypeGroup->addButton(rb1, 0);
+ myGrpTypeGroup->addButton(rb2, 1);
+ aGrpTypeBoxLayout->addWidget(rb1);
+ aGrpTypeBoxLayout->addWidget(rb2);
+ aGrpTypeBox->setEnabled(create);
myGrpTypeId = -1;
/***************************************************************/
- myWGStack = new QWidgetStack( this, "widget stack");
- QWidget* wg1 = new QFrame( myWGStack, "first widget" );
- QWidget* wg2 = new QFrame( myWGStack, "second widget" );
+ myWGStack = new QStackedWidget(this);
+ QWidget* wg1 = new QWidget( myWGStack );
+ QWidget* wg2 = new QWidget( myWGStack );
/***************************************************************/
- QGroupBox* aContentBox = new QGroupBox(1, Qt::Horizontal, wg1, "content box");
- aContentBox->setTitle(tr("SMESH_CONTENT"));
- QFrame* aContent = new QFrame(aContentBox, "content");
- QGridLayout* aLayout = new QGridLayout(aContent, 7, 4);
- aLayout->setSpacing(6);
- aLayout->setAutoAdd(false);
-
- QLabel* aLabel = new QLabel(aContent, "elements label");
- aLabel->setText(tr("SMESH_ID_ELEMENTS"));
- myElements = new QListBox(aContent, "elements list");
- myElements->setSelectionMode(QListBox::Extended);
-
- myFilter = new QPushButton(aContent, "filter");
- myFilter->setText(tr("SMESH_BUT_FILTER"));
- QPushButton* aAddBtn = new QPushButton(aContent, "add");
- aAddBtn->setText(tr("SMESH_BUT_ADD"));
- QPushButton* aRemoveBtn = new QPushButton(aContent, "remove");
- aRemoveBtn->setText(tr("SMESH_BUT_REMOVE"));
- QPushButton* aSortBtn = new QPushButton(aContent, "sort");
- aSortBtn->setText(tr("SMESH_BUT_SORT"));
-
- aLayout->addWidget(aLabel, 0, 0);
- aLayout->addMultiCellWidget(myElements, 1, 6, 0, 0);
- aLayout->addWidget(myFilter, 1, 2);
- aLayout->addWidget(aAddBtn, 3, 2);
- aLayout->addWidget(aRemoveBtn, 4, 2);
- aLayout->addWidget(aSortBtn, 6, 2);
-
- aLayout->setColStretch(0, 1);
- aLayout->addColSpacing(1, 20);
- aLayout->addColSpacing(3, 20);
- aLayout->setRowStretch(2, 1);
- aLayout->setRowStretch(5, 1);
+ QGroupBox* aContentBox = new QGroupBox(tr("SMESH_CONTENT"), wg1);
+ QGridLayout* aContentBoxLayout = new QGridLayout(aContentBox);
+ aContentBoxLayout->setMargin(MARGIN);
+ aContentBoxLayout->setSpacing(SPACING);
+
+ QLabel* aLabel = new QLabel(tr("SMESH_ID_ELEMENTS"), aContentBox);
+ myElements = new QListWidget(aContentBox);
+ myElements->setSelectionMode(QListWidget::ExtendedSelection);
+
+ myFilter = new QPushButton(tr("SMESH_BUT_FILTER"), aContentBox);
+ QPushButton* aAddBtn = new QPushButton(tr("SMESH_BUT_ADD"), aContentBox);
+ QPushButton* aRemoveBtn = new QPushButton(tr("SMESH_BUT_REMOVE"), aContentBox);
+ QPushButton* aSortBtn = new QPushButton(tr("SMESH_BUT_SORT"), aContentBox);
+
+ aContentBoxLayout->addWidget(aLabel, 0, 0);
+ aContentBoxLayout->addWidget(myElements, 1, 0, 6, 1);
+ aContentBoxLayout->addWidget(myFilter, 1, 1);
+ aContentBoxLayout->addWidget(aAddBtn, 3, 1);
+ aContentBoxLayout->addWidget(aRemoveBtn, 4, 1);
+ aContentBoxLayout->addWidget(aSortBtn, 6, 1);
+
+ aContentBoxLayout->setColumnStretch(0, 1);
+ aContentBoxLayout->setRowStretch(2, 1);
+ aContentBoxLayout->setRowStretch(5, 1);
/***************************************************************/
- QGroupBox* aSelectBox = new QGroupBox(3, Qt::Horizontal, wg1, "select box");
- aSelectBox->setTitle(tr("SMESH_SELECT_FROM"));
-
- mySelectSubMesh = new QCheckBox(aSelectBox, "submesh checkbox");
- mySelectSubMesh->setText(tr("SMESH_SUBMESH"));
- mySelectSubMesh->setMinimumSize(50, 0);
- mySubMeshBtn = new QPushButton(aSelectBox, "submesh button");
- mySubMeshBtn->setText("");
- mySubMeshBtn->setPixmap(image0);
- mySubMeshLine = new QLineEdit(aSelectBox, "submesh line");
+ QGroupBox* aSelectBox = new QGroupBox(tr("SMESH_SELECT_FROM"), wg1);
+ QGridLayout* aSelectBoxLayout = new QGridLayout(aSelectBox);
+ aSelectBoxLayout->setMargin(MARGIN);
+ aSelectBoxLayout->setSpacing(SPACING);
+
+ mySelectSubMesh = new QCheckBox(tr("SMESH_SUBMESH"), aSelectBox);
+ mySubMeshBtn = new QPushButton(aSelectBox);
+ mySubMeshBtn->setIcon(image0);
+ mySubMeshLine = new QLineEdit(aSelectBox);
mySubMeshLine->setReadOnly(true);
onSelectSubMesh(false);
- mySelectGroup = new QCheckBox(aSelectBox, "group checkbox");
- mySelectGroup->setText(tr("SMESH_GROUP"));
- mySelectGroup->setMinimumSize(50, 0);
- myGroupBtn = new QPushButton(aSelectBox, "group button");
- myGroupBtn->setText("");
- myGroupBtn->setPixmap(image0);
- myGroupLine = new QLineEdit(aSelectBox, "group line");
+ mySelectGroup = new QCheckBox(tr("SMESH_GROUP"), aSelectBox);
+ myGroupBtn = new QPushButton(aSelectBox);
+ myGroupBtn->setIcon(image0);
+ myGroupLine = new QLineEdit(aSelectBox);
myGroupLine->setReadOnly(true);
onSelectGroup(false);
-
+
+ aSelectBoxLayout->addWidget(mySelectSubMesh, 0, 0);
+ aSelectBoxLayout->addWidget(mySubMeshBtn, 0, 1);
+ aSelectBoxLayout->addWidget(mySubMeshLine, 0, 2);
+ aSelectBoxLayout->addWidget(mySelectGroup, 1, 0);
+ aSelectBoxLayout->addWidget(myGroupBtn, 1, 1);
+ aSelectBoxLayout->addWidget(myGroupLine, 1, 2);
+
/***************************************************************/
- QGridLayout* wg1Layout = new QGridLayout( wg1, 3, 1, 0, 6 );
- wg1Layout->addWidget(aContentBox, 0, 0);
- wg1Layout->addWidget(aSelectBox, 1, 0);
- wg1Layout->setRowStretch(2, 5);
+ QVBoxLayout* wg1Layout = new QVBoxLayout(wg1);
+ wg1Layout->setMargin(0);
+ wg1Layout->setSpacing(SPACING);
+ wg1Layout->addWidget(aContentBox);
+ wg1Layout->addWidget(aSelectBox);
+ wg1Layout->setStretchFactor(aContentBox, 10);
/***************************************************************/
- QLabel* geomObject = new QLabel(wg2, "geometry object label");
- geomObject->setText(tr("SMESH_OBJECT_GEOM"));
- myGeomGroupBtn = new QToolButton(wg2, "geometry group button");
- myGeomGroupBtn->setIconSet( QIconSet(image0) );
- myGeomGroupBtn->setToggleButton(true);
- myGeomGroupLine = new QLineEdit(wg2, "geometry group line");
+ QLabel* geomObject = new QLabel(tr("SMESH_OBJECT_GEOM"), wg2);
+ myGeomGroupBtn = new QToolButton(wg2);
+ myGeomGroupBtn->setIcon(image0);
+ myGeomGroupBtn->setCheckable(true);
+ myGeomGroupLine = new QLineEdit(wg2);
myGeomGroupLine->setReadOnly(true); //VSR ???
onSelectGeomGroup(false);
-
- if (!create)
- {
- myGeomGroupBtn->setEnabled(false);
- myGeomGroupLine->setEnabled(false);
- }
-
+
+ myGeomGroupBtn->setEnabled(create);
+ myGeomGroupLine->setEnabled(create);
+
/***************************************************************/
- QGridLayout* wg2Layout = new QGridLayout( wg2, 2, 3, 0, 6 );
+ QGridLayout* wg2Layout = new QGridLayout( wg2 );
+ wg2Layout->setMargin(0);
+ wg1Layout->setSpacing(SPACING);
wg2Layout->addWidget(geomObject, 0, 0);
wg2Layout->addWidget(myGeomGroupBtn, 0, 1);
wg2Layout->addWidget(myGeomGroupLine,0, 2);
wg2Layout->setRowStretch(1, 5);
/***************************************************************/
- QVBoxLayout* dumb = new QVBoxLayout(myWGStack);
- dumb->addWidget(wg1);
- dumb->addWidget(wg2);
- myWGStack->addWidget( wg1, myGrpTypeGroup->id(rb1) );
- myWGStack->addWidget( wg2, myGrpTypeGroup->id(rb2) );
+ myWGStack->insertWidget( 0, wg1 );
+ myWGStack->insertWidget( 1, wg2 );
/***************************************************************/
- QGroupBox* aColorBox = new QGroupBox(2, Qt::Horizontal, this, "color box");
- aColorBox->setTitle(tr("SMESH_SET_COLOR"));
+ QGroupBox* aColorBox = new QGroupBox(tr("SMESH_SET_COLOR"), this);
+ QHBoxLayout* aColorBoxLayout = new QHBoxLayout(aColorBox);
+ aColorBoxLayout->setMargin(MARGIN);
+ aColorBoxLayout->setSpacing(SPACING);
+
+ QLabel* aColorLab = new QLabel(tr("SMESH_CHECK_COLOR"), aColorBox );
+ myColorBtn = new QtxColorButton(aColorBox);
- new QLabel( tr("SMESH_CHECK_COLOR"), aColorBox, "color label" );
- myColorBtn = new QPushButton(aColorBox, "color button");
- myColorBtn->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
+ aColorBoxLayout->addWidget(aColorLab);
+ aColorBoxLayout->addWidget(myColorBtn);
/***************************************************************/
-
- QFrame* aButtons = new QFrame(this, "button box");
- aButtons->setFrameStyle(QFrame::Box | QFrame::Sunken);
- QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons, 11, 6);
- aBtnLayout->setAutoAdd(false);
-
- QPushButton* aOKBtn = new QPushButton(aButtons, "ok");
- aOKBtn->setText(tr("SMESH_BUT_OK"));
- aOKBtn->setAutoDefault(true);
- aOKBtn->setDefault(true);
- QPushButton* aApplyBtn = new QPushButton(aButtons, "apply");
- aApplyBtn->setText(tr("SMESH_BUT_APPLY"));
- aApplyBtn->setAutoDefault(true);
- QPushButton* aCloseBtn = new QPushButton(aButtons, "close");
- aCloseBtn->setText(tr("SMESH_BUT_CLOSE"));
- aCloseBtn->setAutoDefault(true);
- QPushButton* aHelpBtn = new QPushButton(aButtons, "help");
- aHelpBtn->setText(tr("SMESH_BUT_HELP"));
- aHelpBtn->setAutoDefault(true);
-
- aBtnLayout->addWidget(aOKBtn);
- aBtnLayout->addWidget(aApplyBtn);
+
+ QFrame* aButtons = new QFrame(this);
+ aButtons->setFrameStyle( QFrame::Box | QFrame::Sunken );
+ QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons);
+ aBtnLayout->setMargin(MARGIN);
+ aBtnLayout->setSpacing(SPACING);
+
+ myOKBtn = new QPushButton(tr("SMESH_BUT_OK"), aButtons);
+ myOKBtn->setAutoDefault(true);
+ myOKBtn->setDefault(true);
+ myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aButtons);
+ myApplyBtn->setAutoDefault(true);
+ myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aButtons);
+ myCloseBtn->setAutoDefault(true);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aButtons);
+ myHelpBtn->setAutoDefault(true);
+
+ aBtnLayout->addWidget(myOKBtn);
+ aBtnLayout->addSpacing(10);
+ aBtnLayout->addWidget(myApplyBtn);
+ aBtnLayout->addSpacing(10);
aBtnLayout->addStretch();
- aBtnLayout->addWidget(aCloseBtn);
- aBtnLayout->addWidget(aHelpBtn);
+ aBtnLayout->addWidget(myCloseBtn);
+ aBtnLayout->addWidget(myHelpBtn);
/***************************************************************/
aMainLayout->addWidget(meshGroupLab, 0, 0);
aMainLayout->addWidget(myMeshGroupBtn, 0, 1);
aMainLayout->addWidget(myMeshGroupLine, 0, 2);
- aMainLayout->addMultiCellWidget(myTypeGroup, 1, 1, 0, 2);
- aMainLayout->addWidget(aName, 2, 0);
- aMainLayout->addWidget(myName, 2, 2);
- aMainLayout->addMultiCellWidget(myGrpTypeGroup, 3, 3, 0, 2);
- aMainLayout->addMultiCellWidget(myWGStack, 4, 4, 0, 2);
- aMainLayout->setRowStretch( 5, 5 );
- aMainLayout->addMultiCellWidget(aColorBox, 6, 6, 0, 2);
- aMainLayout->addMultiCellWidget(aButtons, 7, 7, 0, 2);
+ aMainLayout->addWidget(aTypeBox, 1, 0, 1, 3);
+ aMainLayout->addWidget(aName, 2, 0);
+ aMainLayout->addWidget(myName, 2, 2);
+ aMainLayout->addWidget(aGrpTypeBox, 3, 0, 1, 3);
+ aMainLayout->addWidget(myWGStack, 4, 0, 1, 3);
+ aMainLayout->addWidget(aColorBox, 5, 0, 1, 3);
+ aMainLayout->addWidget(aButtons, 6, 0, 1, 3);
/* signals and slots connections */
- connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
-
- connect(myGrpTypeGroup, SIGNAL(clicked(int)), this, SLOT(onGrpTypeChanged(int)));
+ connect(myMeshGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
+ connect(myGrpTypeGroup, SIGNAL(buttonClicked(int)), this, SLOT(onGrpTypeChanged(int)));
+ connect(myTypeGroup, SIGNAL(buttonClicked(int)), this, SLOT(onTypeChanged(int)));
- connect(myTypeGroup, SIGNAL(clicked(int)), this, SLOT(onTypeChanged(int)));
+ connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
+ connect(myElements, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
- connect(myName, SIGNAL(textChanged(const QString&)), this, SLOT(onNameChanged(const QString&)));
- connect(myElements, SIGNAL(selectionChanged()), this, SLOT(onListSelectionChanged()));
-
- connect(myFilter, SIGNAL(clicked()), this, SLOT(setFilters()));
- connect(aAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
+ connect(myFilter, SIGNAL(clicked()), this, SLOT(setFilters()));
+ connect(aAddBtn, SIGNAL(clicked()), this, SLOT(onAdd()));
connect(aRemoveBtn, SIGNAL(clicked()), this, SLOT(onRemove()));
- connect(aSortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
+ connect(aSortBtn, SIGNAL(clicked()), this, SLOT(onSort()));
connect(mySelectSubMesh, SIGNAL(toggled(bool)), this, SLOT(onSelectSubMesh(bool)));
- connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool)));
- connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
- connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
- connect(myGeomGroupBtn, SIGNAL(toggled(bool)), this, SLOT(onGeomSelectionButton(bool)));
- connect(myColorBtn, SIGNAL(clicked()), this, SLOT(onSelectColor()));
-
- connect(aOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
- connect(aApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
- connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
- connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
+ connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool)));
+ connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
+ connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection()));
+ connect(myGeomGroupBtn, SIGNAL(toggled(bool)), this, SLOT(onGeomSelectionButton(bool)));
+
+ connect(myOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
+ connect(myApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
+ connect(myCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
+ connect(myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
/* Init selection */
mySMESHGUI->SetActiveDialogBox(this);
myGroupFilter = new SMESH_TypeFilter(GROUP);
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() );
myGeomFilter = new GEOM_SelectionFilter( aStudy, true );
-
+
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose()));
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose()));
+ connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
- myGrpTypeGroup->setButton(myGrpTypeGroup->id(rb1)); // VSR !!!
- onGrpTypeChanged(myGrpTypeGroup->id(rb1)); // VSR!!!
+ rb1->setChecked(true); // VSR !!!
+ onGrpTypeChanged(0); // VSR!!!
if (myMesh->_is_nil() )
- myTypeGroup->setButton(0);
+ myTypeGroup->button(0)->setChecked(true);
updateButtons();
//myName->setText(GetDefaultName(tr("SMESH_GROUP")));
SMESHGUI_GroupDlg::~SMESHGUI_GroupDlg()
{
// no need to delete child widgets, Qt does it all for us
- if ( myFilterDlg != 0 )
- {
- myFilterDlg->reparent( 0, QPoint() );
+ if ( myFilterDlg != 0 ) {
+ myFilterDlg->setParent( 0 );
delete myFilterDlg;
}
}
//=================================================================================
QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
{
- QString aName = "";
-
- // collect all object names of SMESH component
- SalomeApp_Study* appStudy =
- dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
- if ( !appStudy ) return aName;
- _PTR(Study) aStudy = appStudy->studyDS();
-
- std::set<std::string> aSet;
- _PTR(SComponent) aMeshCompo (aStudy->FindComponent("SMESH"));
- if (aMeshCompo) {
- _PTR(ChildIterator) it (aStudy->NewChildIterator(aMeshCompo));
- _PTR(SObject) obj;
- for (it->InitEx(true); it->More(); it->Next()) {
- obj = it->Value();
- aSet.insert(obj->GetName());
- }
+ QString aName = "";
+
+ // collect all object names of SMESH component
+ SalomeApp_Study* appStudy =
+ dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+ if ( !appStudy ) return aName;
+ _PTR(Study) aStudy = appStudy->studyDS();
+
+ std::set<std::string> aSet;
+ _PTR(SComponent) aMeshCompo (aStudy->FindComponent("SMESH"));
+ if (aMeshCompo) {
+ _PTR(ChildIterator) it (aStudy->NewChildIterator(aMeshCompo));
+ _PTR(SObject) obj;
+ for (it->InitEx(true); it->More(); it->Next()) {
+ obj = it->Value();
+ aSet.insert(obj->GetName());
}
+ }
- // build a unique name
- int aNumber = 0;
- bool isUnique = false;
- while (!isUnique) {
- aName = theOperation + "_" + QString::number(++aNumber);
- isUnique = (aSet.count(aName.latin1()) == 0);
- }
+ // build a unique name
+ int aNumber = 0;
+ bool isUnique = false;
+ while (!isUnique) {
+ aName = theOperation + "_" + QString::number(++aNumber);
+ isUnique = (aSet.count(aName.toLatin1().data()) == 0);
+ }
- return aName;
+ return aName;
}
//=================================================================================
if( !aList.IsEmpty() )
{
QString aName = aList.First()->getName();
- myMeshGroupLine->setText(aName) ;
+ myMeshGroupLine->setText(aName);
myMeshGroupLine->home( false );
}
myCurrentLineEdit = 0;
- myTypeGroup->setButton(0);
+ myTypeGroup->button(0)->setChecked(true);
onTypeChanged(0);
}
void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup)
{
myMesh = theGroup->GetMesh();
-
+
myName->setText(theGroup->GetName());
myName->home(false);
myOldName = myName->text();
SALOMEDS::Color aColor = theGroup->GetColor();
setGroupColor( aColor );
-
+
myMeshGroupLine->setText(theGroup->GetName());
int aType = 0;
case SMESH::FACE: aType = 2; break;
case SMESH::VOLUME: aType = 3; break;
}
- myTypeGroup->setButton(aType);
-
+ myTypeGroup->button(aType)->setChecked(true);
+
myGroup = SMESH::SMESH_Group::_narrow( theGroup );
if ( !myGroup->_is_nil() )
myActor = SMESH::FindActorByObject(myGroup);
SMESH::SetPickable(myActor);
- myGrpTypeGroup->setButton(0);
+ myGrpTypeGroup->button(0)->setChecked(true);
onGrpTypeChanged(0);
-
+
myCurrentLineEdit = 0;
myElements->clear();
setSelectionMode(aType);
myTypeId = aType;
-
+
myIdList.clear();
if (!myGroup->IsEmpty()) {
SMESH::long_array_var anElements = myGroup->GetListOfID();
int k = anElements->length();
for (int i = 0; i < k; i++) {
myIdList.append(anElements[i]);
- myElements->insertItem(QString::number(anElements[i]));
+ myElements->addItem(QString::number(anElements[i]));
}
- myElements->selectAll(true);
+ myElements->selectAll();
}
}
else
{
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_narrow( theGroup );
-
+
if ( !myGroupOnGeom->_is_nil() )
{
myActor = SMESH::FindActorByObject(myMesh);
myActor = SMESH::FindActorByObject(myGroup);
SMESH::SetPickable(myActor);
- myGrpTypeGroup->setButton(1);
+ myGrpTypeGroup->button(1)->setChecked(true);
onGrpTypeChanged(1);
-
+
QString aShapeName("");
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
GEOM::GEOM_Object_var aGroupShape = myGroupOnGeom->GetShape();
//=================================================================================
void SMESHGUI_GroupDlg::updateButtons()
{
- bool enable = !myName->text().stripWhiteSpace().isEmpty();
+ bool enable = !myName->text().trimmed().isEmpty();
if (myGrpTypeId == 0) {
enable = enable && myElements->count() > 0;
}
}
- QPushButton* aBtn;
- aBtn = (QPushButton*) child("ok", "QPushButton");
- if (aBtn) aBtn->setEnabled(enable);
- aBtn = (QPushButton*) child("apply", "QPushButton");
- if (aBtn) aBtn->setEnabled(enable);
+ myOKBtn->setEnabled(enable);
+ myApplyBtn->setEnabled(enable);
}
//=================================================================================
void SMESHGUI_GroupDlg::onGrpTypeChanged (int id)
{
if (myGrpTypeId != id) {
- myWGStack->raiseWidget( id );
+ myWGStack->setCurrentIndex( id );
if (id == 0)
myName->setText(myOldName);
onSelectGeomGroup(id == 1);
myGrpTypeId = id;
}
-//=================================================================================
-// function : onSelectColor()
-// purpose :
-//=================================================================================
-void SMESHGUI_GroupDlg::onSelectColor()
-{
- QColor color = getGroupQColor();
- color = QColorDialog::getColor( color );
- setGroupQColor( color );
-
- updateButtons();
-}
-
//=================================================================================
// function : setSelectionMode()
// purpose : Radio button management
mySelectionMgr->installFilter(myMeshFilter);
else if (theMode == 7)
mySelectionMgr->installFilter(myGeomFilter);
-
+
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
}
mySelectionMode = theMode;
- }
+ }
}
//=================================================================================
if (mySMESHGUI->isActiveStudyLocked())
return false;
- if (myName->text().stripWhiteSpace().isEmpty())
+ if (myName->text().trimmed().isEmpty())
return false;
if (myGrpTypeId == 0) { // on mesh elements
SMESH::long_array_var anIdList = new SMESH::long_array;
int i, k = myElements->count();
anIdList->length(k);
- QListBoxItem* anItem;
- for (i = 0, anItem = myElements->firstItem(); anItem != 0; i++, anItem = anItem->next()) {
- anIdList[i] = anItem->text().toInt();
+ for (i = 0; i < k; i++) {
+ anIdList[i] = myElements->item(i)->text().toInt();
}
myGroup = SMESH::AddGroup(myMesh, aType, myName->text());
myGroup = SMESH::SMESH_Group::_nil();
} else { // edition
- myGroup->SetName(myName->text());
-
+ myGroup->SetName(myName->text().toLatin1().data());
+
SALOMEDS::Color aColor = getGroupColor();
myGroup->SetColor(aColor);
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aMeshGroupSO->GetID().c_str()))
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
- QValueList<int> aAddList;
- QValueList<int>::iterator anIt;
- QListBoxItem* anItem;
+ QList<int> aAddList;
- for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
- int anId = anItem->text().toInt();
- if ((anIt = myIdList.find(anId)) == myIdList.end())
+ int i, total = myElements->count();
+ for (i = 0; i < total; i++) {
+ int anId = myElements->item(i)->text().toInt();
+ int idx = myIdList.indexOf(anId);
+ if ( idx == -1 )
aAddList.append(anId);
else
- myIdList.remove(anIt);
+ myIdList.removeAt(idx);
}
if (!aAddList.empty()) {
SMESH::long_array_var anIdList = new SMESH::long_array;
- anIdList->length(aAddList.count());
- int i;
- for (i = 0, anIt = aAddList.begin(); anIt != aAddList.end(); anIt++, i++)
- anIdList[i] = *anIt;
+ int added = aAddList.count();
+ anIdList->length(added);
+ for (i = 0; i < added; i++)
+ anIdList[i] = aAddList[i];
myGroup->Add(anIdList.inout());
}
if (!myIdList.empty()) {
SMESH::long_array_var anIdList = new SMESH::long_array;
- anIdList->length(myIdList.count());
- int i;
- for (i = 0, anIt = myIdList.begin(); anIt != myIdList.end(); anIt++, i++)
- anIdList[i] = *anIt;
+ int removed = myIdList.count();
+ anIdList->length(removed);
+ for (i = 0; i < removed; i++)
+ anIdList[i] = myIdList[i];
myGroup->Remove(anIdList.inout());
}
/* init for next operation */
myIdList.clear();
- for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next())
- myIdList.append(anItem->text().toInt());
+ for (i = 0; i < total; i++) {
+ myIdList.append(myElements->item(i)->text().toInt());
+ }
}
mySMESHGUI->updateObjBrowser(true);
SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId());
if (myGeomObjects->length() == 1) {
- myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomObjects[0]);
+ myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
+ myName->text().toLatin1().data(),
+ myGeomObjects[0]);
}
else {
SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
QString aNewGeomGroupName ("Auto_group_for_");
aNewGeomGroupName += myName->text();
SALOMEDS::SObject_var aNewGroupSO =
- geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar, aNewGeomGroupName, aMeshShape);
+ geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
+ aNewGeomGroupName.toLatin1().data(), aMeshShape);
}
- myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, myName->text(), aGroupVar);
+ myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
+ myName->text().toLatin1().data(),
+ aGroupVar);
}
SALOMEDS::Color aColor = getGroupColor();
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
}
else { // edition
- myGroupOnGeom->SetName(myName->text());
+ myGroupOnGeom->SetName(myName->text().toLatin1().data());
SALOMEDS::Color aColor = getGroupColor();
myGroupOnGeom->SetColor(aColor);
if (myCurrentLineEdit == 0) {
mySelectionMgr->clearSelected();
TColStd_MapOfInteger aIndexes;
- QListBoxItem* anItem;
- for (anItem = myElements->firstItem(); anItem != 0; anItem = anItem->next()) {
- if (anItem->isSelected()) {
- int anId = anItem->text().toInt();
- aIndexes.Add(anId);
- }
- }
+ QList<QListWidgetItem*> selItems = myElements->selectedItems();
+ QListWidgetItem* anItem;
+ foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt());
mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
SALOME_ListIO aList;
aList.Append(myActor->getIO());
void SMESHGUI_GroupDlg::onObjectSelectionChanged()
{
if ( myIsBusy || !isEnabled()) return;
- if (myCurrentLineEdit == myGeomGroupLine && !myGeomGroupBtn->isOn()) return;
+ if (myCurrentLineEdit == myGeomGroupLine && !myGeomGroupBtn->isDown()) return;
myIsBusy = true;
SALOME_ListIO aList;
mySelectionMgr->selectedObjects( aList );
-
+
int aNbSel = aList.Extent();
myElements->clearSelection();
myGeomObjects = new GEOM::ListOfGO();
myGeomObjects->length(0);
- if (myGeomGroupBtn->isOn())
- myGeomGroupBtn->setOn(false);
+ if (myGeomGroupBtn->isDown())
+ myGeomGroupBtn->setDown(false);
if (!myCreate)
myName->setText("");
if (aNbSel != 1 ) {
myGroup = SMESH::SMESH_Group::_nil();
- myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
+ myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
myMesh = SMESH::SMESH_Mesh::_nil();
updateGeomPopup();
updateButtons();
SMESH::SetPickable(myActor);
aString = aList.First()->getName();
- myMeshGroupLine->setText(aString) ;
+ myMeshGroupLine->setText(aString);
myMeshGroupLine->home( false );
mySelectSubMesh->setEnabled(true);
myGroup = SMESH::SMESH_Group::_nil();
myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil();
-
+
init(aGroup);
myIsBusy = true;
mySelectSubMesh->setEnabled(true);
GEOM::GEOM_Object_var aGeomGroup;
Standard_Boolean testResult;
int i = 0;
-
+
SALOME_ListIteratorOfListIO anIt (aList);
- for (; anIt.More(); anIt.Next()) {
-
+ for ( ; anIt.More(); anIt.Next()) {
+
testResult = Standard_False;
aGeomGroup = GEOMBase::ConvertIOinGEOMObject(anIt.Value(), testResult);
// Check if the object is a geometry group
if (!testResult || CORBA::is_nil(aGeomGroup))
continue;
-
+
// Check if group constructed on the same shape as a mesh or on its child
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
_PTR(SObject) aGroupMainShapeSO =
//aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape));
aStudy->FindObjectID(aGroupMainShape->GetStudyEntry());
-
+
_PTR(SObject) anObj, aRef;
bool isRefOrSubShape = false;
if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) {
if (isRefOrSubShape)
myGeomObjects[i++] = aGeomGroup;
}
-
+
myGeomObjects->length(i);
if ( i == 0 )
{
myIsBusy = false;
return;
}
-
+
aNbSel = i;
}
aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
}
if (aNbItems > 0) {
- QStringList anElements = QStringList::split(" ", aListStr);
- QListBoxItem* anItem = 0;
+ QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
- anItem = myElements->findItem(*it, Qt::ExactMatch);
- if (anItem) myElements->setSelected(anItem, true);
+ QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, found) anItem->setSelected(true);
}
}
}
setSelectionMode(8);
}
else {
- myGeomGroupBtn->setOn(false);
+ myGeomGroupBtn->setDown(false);
myGeomObjects->length(0);
myGeomGroupLine->setText("");
myCurrentLineEdit = 0;
SMESH::ElementType aType = SMESH::ALL;
switch(myTypeId) {
- case 0:
- aType = SMESH::NODE;
+ case 0:
+ aType = SMESH::NODE;
mySelector->SetSelectionMode(NodeSelection);
break;
- case 1:
- aType = SMESH::EDGE;
+ case 1:
+ aType = SMESH::EDGE;
mySelector->SetSelectionMode(EdgeSelection);
break;
- case 2:
- aType = SMESH::FACE;
+ case 2:
+ aType = SMESH::FACE;
mySelector->SetSelectionMode(FaceSelection);
break;
- case 3:
- aType = SMESH::VOLUME;
+ case 3:
+ aType = SMESH::VOLUME;
mySelector->SetSelectionMode(VolumeSelection);
break;
default:
aNbItems = SMESH::GetNameOfSelectedElements(mySelector, myActor->getIO(), aListStr);
}
if (aNbItems > 0) {
- QStringList anElements = QStringList::split(" ", aListStr);
- QListBoxItem* anItem = 0;
+ QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
- anItem = myElements->findItem(*it, Qt::ExactMatch);
- if (!anItem) {
- anItem = new QListBoxText(*it);
- myElements->insertItem(anItem);
+ QList<QListWidgetItem*> found = myElements->findItems(*it, Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ if (found.count() == 0) {
+ anItem = new QListWidgetItem(*it);
+ myElements->addItem(anItem);
+ anItem->setSelected(true);
+ }
+ else {
+ foreach(anItem, found) anItem->setSelected(true);
}
- myElements->setSelected(anItem, true);
}
}
} else if (myCurrentLineEdit == mySubMeshLine) {
//SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
-
+
SALOME_ListIO aList;
mySelectionMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO anIt (aList);
- for (; anIt.More(); anIt.Next()) {
+ for ( ; anIt.More(); anIt.Next()) {
SMESH::SMESH_subMesh_var aSubMesh =
SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
if (!aSubMesh->_is_nil()) {
try {
SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType);
int k = anElements->length();
- QListBoxItem* anItem = 0;
for (int i = 0; i < k; i++) {
QString aText = QString::number(anElements[i]);
- anItem = myElements->findItem(aText, Qt::ExactMatch);
- if (!anItem) {
- anItem = new QListBoxText(aText);
- myElements->insertItem(anItem);
+ QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
+ QListWidgetItem* anItem = 0;
+ if (found.count() == 0) {
+ anItem = new QListWidgetItem(aText);
+ myElements->addItem(anItem);
+ anItem->setSelected(true);
}
- myElements->setSelected(anItem, true);
+ else {
+ foreach(anItem, found) anItem->setSelected(true);
+ }
}
}
catch (const SALOME::SALOME_Exception& ex) {
//SALOME_ListIteratorOfListIO anIt (mySelectionMgr->StoredIObjects());
SALOME_ListIO aList;
mySelectionMgr->selectedObjects( aList );
-
+
SALOME_ListIteratorOfListIO anIt (aList);
- for (; anIt.More(); anIt.Next()) {
+ for ( ; anIt.More(); anIt.Next()) {
SMESH::SMESH_Group_var aGroup =
SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
if (!aGroup->_is_nil()) {
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
SMESH::long_array_var anElements = aGroup->GetListOfID();
int k = anElements->length();
- QListBoxItem* anItem = 0;
for (int i = 0; i < k; i++) {
QString aText = QString::number(anElements[i]);
- anItem = myElements->findItem(aText, Qt::ExactMatch);
- if (!anItem) {
- anItem = new QListBoxText(aText);
- myElements->insertItem(anItem);
+ QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
+ QListWidgetItem* anItem = 0;
+ if (found.count() == 0) {
+ anItem = new QListWidgetItem(aText);
+ myElements->addItem(anItem);
+ anItem->setSelected(true);
+ }
+ else {
+ foreach(anItem, found) anItem->setSelected(true);
}
- myElements->setSelected(anItem, true);
}
}
}
SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh);
int k = anElements->length();
- QListBoxItem* anItem = 0;
for (int i = 0; i < k; i++) {
QString aText = QString::number(anElements[i]);
- anItem = myElements->findItem(aText, Qt::ExactMatch);
- if (!anItem) {
- anItem = new QListBoxText(aText);
- myElements->insertItem(anItem);
+ QList<QListWidgetItem*> found = myElements->findItems(aText, Qt::MatchExactly);
+ QListWidgetItem* anItem = 0;
+ if (found.count() == 0) {
+ anItem = new QListWidgetItem(aText);
+ myElements->addItem(anItem);
+ anItem->setSelected(true);
+ }
+ else {
+ foreach(anItem, found) anItem->setSelected(true);
}
- myElements->setSelected(anItem, true);
}
}
{
myIsBusy = true;
if (myCurrentLineEdit == 0) {
- for (int i = myElements->count(); i > 0; i--) {
- if (myElements->isSelected(i-1)) {
- myElements->removeItem(i-1);
- }
- }
+ QList<QListWidgetItem*> selItems = myElements->selectedItems();
+ QListWidgetItem* item;
+ foreach(item, selItems) delete item;
} else {
SALOME_ListIO aList;
mySelectionMgr->selectedObjects( aList );
mySelectionMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO anIt (aList);
- for (; anIt.More(); anIt.Next()) {
+ for ( ; anIt.More(); anIt.Next()) {
SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIt.Value());
if (!aSubMesh->_is_nil()) {
// check if mesh is the same
try {
SMESH::long_array_var anElements = aSubMesh->GetNodesId();
int k = anElements->length();
- QListBoxItem* anItem = 0;
for (int i = 0; i < k; i++) {
- anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
- if (anItem) delete anItem;
+ QList<QListWidgetItem*> found =
+ myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, found) delete anItem;
}
}
catch (const SALOME::SALOME_Exception& ex) {
try {
SMESH::long_array_var anElements = aSubMesh->GetElementsId();
int k = anElements->length();
- QListBoxItem* anItem = 0;
for (int i = 0; i < k; i++) {
- anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
- if (anItem) delete anItem;
+ QList<QListWidgetItem*> found =
+ myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, found) delete anItem;
}
}
catch (const SALOME::SALOME_Exception& ex) {
mySelectionMgr->selectedObjects( aList );
SALOME_ListIteratorOfListIO anIt (aList);
- for (; anIt.More(); anIt.Next()) {
+ for ( ; anIt.More(); anIt.Next()) {
SMESH::SMESH_Group_var aGroup = SMESH::IObjectToInterface<SMESH::SMESH_Group>(anIt.Value());
if (aRes && !aGroup->_is_nil()) {
// check if mesh is the same
if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) {
SMESH::long_array_var anElements = aGroup->GetListOfID();
int k = anElements->length();
- QListBoxItem* anItem = 0;
for (int i = 0; i < k; i++) {
- anItem = myElements->findItem(QString::number(anElements[i]), Qt::ExactMatch);
- if (anItem) delete anItem;
+ QList<QListWidgetItem*> found =
+ myElements->findItems(QString::number(anElements[i]), Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, found) delete anItem;
}
}
}
int i, k = myElements->count();
if (k > 0) {
myIsBusy = true;
- QStringList aSelected;
+ QList<int> aSelected;
std::vector<int> anArray(k);
// QMemArray<int> anArray(k);
- QListBoxItem* anItem;
// fill the array
- for (anItem = myElements->firstItem(), i = 0; anItem != 0; anItem = anItem->next(), i++) {
- anArray[i] = anItem->text().toInt();
- if (anItem->isSelected())
- aSelected.append(anItem->text());
+ for (i = 0; i < k; i++) {
+ int id = myElements->item(i)->text().toInt();
+ anArray[i] = id;
+ if (myElements->item(i)->isSelected())
+ aSelected.append(id);
}
// sort & update list
std::sort(anArray.begin(), anArray.end());
// anArray.sort();
myElements->clear();
for (i = 0; i < k; i++) {
- myElements->insertItem(QString::number(anArray[i]));
- }
- for (QStringList::iterator it = aSelected.begin(); it != aSelected.end(); ++it) {
- anItem = myElements->findItem(*it, Qt::ExactMatch);
- if (anItem) myElements->setSelected(anItem, true);
+ QListWidgetItem* anItem = new QListWidgetItem(QString::number(anArray[i]));
+ myElements->addItem(anItem);
+ anItem->setSelected(aSelected.contains(anArray[i]));
}
myIsBusy = false;
}
void SMESHGUI_GroupDlg::onHelp()
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
+ if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
+ if ( e->key() == Qt::Key_F1 )
{
e->accept();
onHelp();
disconnect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
if ( enable ) {
if ( !myGeomPopup ) {
- myGeomPopup = new QPopupMenu();
- myGeomPopup->insertItem( tr("DIRECT_GEOM_SELECTION"), DIRECT_GEOM_INDEX );
- myGeomPopup->insertItem( tr("GEOM_BY_MESH_ELEM_SELECTION"), GEOM_BY_MESH_INDEX );
- connect( myGeomPopup, SIGNAL( activated( int ) ), SLOT( onGeomPopup( int ) ) );
+ myGeomPopup = new QMenu(this);
+ myActions[myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )] = DIRECT_GEOM_INDEX;
+ myActions[myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )] = GEOM_BY_MESH_INDEX;
+ connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
}
connect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
}
if ( myGeomPopup && isBtnOn )
{
myCurrentLineEdit = myGeomGroupLine;
- int id = myGeomPopup->exec( QCursor::pos() );
- if (id == DIRECT_GEOM_INDEX || id == -1)
+ QAction* a = myGeomPopup->exec( QCursor::pos() );
+ if (!a || myActions[a] == DIRECT_GEOM_INDEX)
setSelectionMode(7);
}
else if (!isBtnOn)
// function : onGeomPopup()
// purpose :
//=================================================================================
-void SMESHGUI_GroupDlg::onGeomPopup( int index )
+void SMESHGUI_GroupDlg::onGeomPopup( QAction* a )
{
+ int index = myActions[a];
if ( index == GEOM_BY_MESH_INDEX )
{
mySelectionMode = -1;
{
QString ID = aGeomVar->GetStudyEntry();
_PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
- if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.latin1() )) {
+ if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.toLatin1().data() )) {
SALOME_ListIO anIOList;
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject
( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() );
void SMESHGUI_GroupDlg::setGroupQColor( const QColor& theColor )
{
if( theColor.isValid() )
- {
- QPalette pal = myColorBtn->palette();
- pal.setColor(QColorGroup::Button, theColor);
- myColorBtn->setPalette(pal);
- }
+ myColorBtn->setColor( theColor );
}
//=================================================================================
//=================================================================================
QColor SMESHGUI_GroupDlg::getGroupQColor() const
{
- QColor aColor = myColorBtn->palette().active().button();
- return aColor;
+ return myColorBtn->color();
}
//=================================================================================
{
SMESH::ListOfGroups aListOfGroups = *myMesh->GetGroups();
- QValueList<SALOMEDS::Color> aReservedColors;
+ QList<SALOMEDS::Color> aReservedColors;
for( int i = 0, n = aListOfGroups.length(); i < n; i++ )
{
SMESH::SMESH_GroupBase_var aGroupObject = aListOfGroups[i];
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 CEA
+// Copyright (C) 2003 CEA
//
-// 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 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.
+// 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
+// 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 : SMESHGUI_GroupDlg.h
+// Author : Natalia KOPNOVA, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_GroupDlg.h
-// Author : Natalia KOPNOVA
-// Module : SMESH
-// $Header$
-#ifndef DIALOGBOX_GROUP_H
-#define DIALOGBOX_GROUP_H
+#ifndef SMESHGUI_GROUPDLG_H
+#define SMESHGUI_GROUPDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-//#include "SMESH_TypeFilter.hxx"
-#include "SUIT_SelectionFilter.h"
-
-// QT Includes
-#include <qdialog.h>
-#include <qvaluelist.h>
+// Qt includes
+#include <QDialog>
+#include <QList>
+#include <QMap>
-// IDL Headers
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Group)
class QLineEdit;
class QButtonGroup;
-class QGroupBox;
-class QListBox;
-class QPopupMenu;
+class QListWidget;
+class QMenu;
class QPushButton;
class QToolButton;
class QCheckBox;
-class QWidgetStack;
-class QtxIntSpinBox;
+class QStackedWidget;
+class QAction;
class SMESHGUI;
class SMESH_Actor;
class SMESHGUI_FilterDlg;
class SMESHGUI_ShapeByMeshOp;
+class QtxColorButton;
class SUIT_Operation;
class SVTK_Selector;
-class SVTK_ViewWindow;
+class SUIT_SelectionFilter;
+class LightApp_SelectionMgr;
//=================================================================================
// class : SMESHGUI_GroupDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_GroupDlg( SMESHGUI*,
- const char* name = 0,
- SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(),
- bool modal = FALSE, WFlags fl = 0 );
- SMESHGUI_GroupDlg( SMESHGUI*,
- const char* name,
- SMESH::SMESH_GroupBase_ptr theGroup,
- bool modal = FALSE, WFlags fl = 0 );
- ~SMESHGUI_GroupDlg();
-
- static QString GetDefaultName(const QString& theOperation);
-
+ SMESHGUI_GroupDlg( SMESHGUI*,
+ SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
+ SMESHGUI_GroupDlg( SMESHGUI*,
+ SMESH::SMESH_GroupBase_ptr );
+ ~SMESHGUI_GroupDlg();
+
+ static QString GetDefaultName( const QString& );
+
public slots:
-
- void onAdd();
- void onRemove();
-
+ void onAdd();
+ void onRemove();
private slots:
-
- void onTypeChanged(int id);
- void onGrpTypeChanged(int id);
-
- void onOK();
- void onClose();
- bool onApply();
- void onHelp();
- void onDeactivate();
-
- void onListSelectionChanged();
- void onObjectSelectionChanged();
-
- void onSelectSubMesh(bool on);
- void onSelectGroup(bool on);
- void onSelectGeomGroup(bool on);
- void setCurrentSelection();
-
- void setFilters();
- void onSort();
-
- void onNameChanged(const QString& text);
- void onFilterAccepted();
-
- void onSelectColor();
-
- void onGeomPopup( int );
- void onGeomSelectionButton( bool );
-
- void onPublishShapeByMeshDlg(SUIT_Operation*);
- void onCloseShapeByMeshDlg(SUIT_Operation*);
+ void onTypeChanged( int );
+ void onGrpTypeChanged( int );
+
+ void onOK();
+ void onClose();
+ bool onApply();
+ void onHelp();
+ void onDeactivate();
+
+ void onListSelectionChanged();
+ void onObjectSelectionChanged();
+
+ void onSelectSubMesh( bool );
+ void onSelectGroup( bool );
+ void onSelectGeomGroup( bool );
+ void setCurrentSelection();
+
+ void setFilters();
+ void onSort();
+
+ void onNameChanged( const QString& );
+ void onFilterAccepted();
+
+ void onGeomPopup( QAction* );
+ void onGeomSelectionButton( bool );
+
+ void onPublishShapeByMeshDlg( SUIT_Operation* );
+ void onCloseShapeByMeshDlg( SUIT_Operation* );
private:
- void initDialog(bool create);
- void init(SMESH::SMESH_Mesh_ptr theMesh);
- void init(SMESH::SMESH_GroupBase_ptr theGroup);
- void closeEvent(QCloseEvent* e);
- void enterEvent (QEvent*);
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
- void setSelectionMode(int theMode);
- void updateButtons();
- void updateGeomPopup();
-
- void setGroupColor( const SALOMEDS::Color& );
- SALOMEDS::Color getGroupColor() const;
-
- void setGroupQColor( const QColor& );
- QColor getGroupQColor() const;
-
- void setDefaultGroupColor();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- SMESH_Actor* myActor; /* Current mesh actor */
- int myGrpTypeId; /* Current group type id : standalone or group on geometry */
- int myTypeId; /* Current type id = radio button id */
- QLineEdit* myCurrentLineEdit; /* Current LineEdit */
- SVTK_Selector* mySelector;
-
- QPushButton* myMeshGroupBtn;
- QLineEdit* myMeshGroupLine;
-
- QButtonGroup* myTypeGroup;
- QLineEdit* myName;
- QString myOldName;
-
- QButtonGroup* myGrpTypeGroup;
-
- QWidgetStack* myWGStack;
- QListBox* myElements;
- QPushButton* myFilter;
-
- QCheckBox* mySelectSubMesh;
- QPushButton* mySubMeshBtn;
- QLineEdit* mySubMeshLine;
-
- QCheckBox* mySelectGroup;
- QPushButton* myGroupBtn;
- QLineEdit* myGroupLine;
-
- QPushButton* myColorBtn;
-
- QCheckBox* mySelectGeomGroup;
- QToolButton* myGeomGroupBtn;
- QLineEdit* myGeomGroupLine;
- QPopupMenu* myGeomPopup;
-
- SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
-
- SMESH::SMESH_Mesh_var myMesh;
- SMESH::SMESH_Group_var myGroup;
- SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
- QValueList<int> myIdList;
- GEOM::ListOfGO_var myGeomObjects;
-
- int mySelectionMode;
- //Handle(SMESH_TypeFilter) myMeshFilter;
- //Handle(SMESH_TypeFilter) mySubMeshFilter;
- //Handle(SMESH_TypeFilter) myGroupFilter;
- SUIT_SelectionFilter* myMeshFilter;
- SUIT_SelectionFilter* mySubMeshFilter;
- SUIT_SelectionFilter* myGroupFilter;
- SUIT_SelectionFilter* myGeomFilter;
-
- SMESHGUI_FilterDlg* myFilterDlg;
-
- bool myCreate, myIsBusy;
-
- QString myHelpFileName;
+ void initDialog( bool );
+ void init( SMESH::SMESH_Mesh_ptr );
+ void init( SMESH::SMESH_GroupBase_ptr );
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ void setSelectionMode( int );
+ void updateButtons();
+ void updateGeomPopup();
+
+ void setGroupColor( const SALOMEDS::Color& );
+ SALOMEDS::Color getGroupColor() const;
+
+ void setGroupQColor( const QColor& );
+ QColor getGroupQColor() const;
+
+ void setDefaultGroupColor();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ SMESH_Actor* myActor; /* Current mesh actor */
+ int myGrpTypeId; /* Current group type id : standalone or group on geometry */
+ int myTypeId; /* Current type id = radio button id */
+ QLineEdit* myCurrentLineEdit; /* Current LineEdit */
+ SVTK_Selector* mySelector;
+
+ QPushButton* myMeshGroupBtn;
+ QLineEdit* myMeshGroupLine;
+
+ QButtonGroup* myTypeGroup;
+ QLineEdit* myName;
+ QString myOldName;
+
+ QButtonGroup* myGrpTypeGroup;
+
+ QStackedWidget* myWGStack;
+ QListWidget* myElements;
+ QPushButton* myFilter;
+
+ QCheckBox* mySelectSubMesh;
+ QPushButton* mySubMeshBtn;
+ QLineEdit* mySubMeshLine;
+
+ QCheckBox* mySelectGroup;
+ QPushButton* myGroupBtn;
+ QLineEdit* myGroupLine;
+
+ QtxColorButton* myColorBtn;
+
+ QCheckBox* mySelectGeomGroup;
+ QToolButton* myGeomGroupBtn;
+ QLineEdit* myGeomGroupLine;
+ QMenu* myGeomPopup;
+
+ QPushButton* myOKBtn;
+ QPushButton* myApplyBtn;
+ QPushButton* myCloseBtn;
+ QPushButton* myHelpBtn;
+
+ SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
+
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH::SMESH_Group_var myGroup;
+ SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
+ QList<int> myIdList;
+ GEOM::ListOfGO_var myGeomObjects;
+
+ int mySelectionMode;
+ //Handle(SMESH_TypeFilter) myMeshFilter;
+ //Handle(SMESH_TypeFilter) mySubMeshFilter;
+ //Handle(SMESH_TypeFilter) myGroupFilter;
+ SUIT_SelectionFilter* myMeshFilter;
+ SUIT_SelectionFilter* mySubMeshFilter;
+ SUIT_SelectionFilter* myGroupFilter;
+ SUIT_SelectionFilter* myGeomFilter;
+
+ SMESHGUI_FilterDlg* myFilterDlg;
+
+ bool myCreate, myIsBusy;
+
+ QString myHelpFileName;
+
+ QMap<QAction*, int> myActions;
};
-#endif // DIALOGBOX_GROUP_H
+#endif // SMESHGUI_GROUPDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_GroupOpDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_GroupOpDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_GroupOpDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
-#include "SMESH_TypeFilter.hxx"
-
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-
-#include "LightApp_Application.h"
-
-#include "LightApp_SelectionMgr.h"
-#include "SVTK_Selection.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SALOME_ListIO.hxx"
-
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlistbox.h>
-#include <qlineedit.h>
-#include <qmessagebox.h>
-
-#define SPACING 5
-#define MARGIN 10
+#include <SMESH_TypeFilter.hxx>
+
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <SVTK_Selection.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
+
+// Qt includes
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QKeyEvent>
+
+#define SPACING 6
+#define MARGIN 11
/*!
* Class : SMESHGUI_GroupOpDlg
// Purpose : Constructor
//=======================================================================
SMESHGUI_GroupOpDlg::SMESHGUI_GroupOpDlg( SMESHGUI* theModule, const int theMode )
- : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_GroupOpDlg", false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
+ setModal(false);
+
myMode = theMode;
if (myMode == UNION) {
- setCaption(tr("UNION_OF_TWO_GROUPS"));
+ setWindowTitle(tr("UNION_OF_TWO_GROUPS"));
myHelpFileName = "using_operations_on_groups_page.html#union_anchor";
}
else if (myMode == INTERSECT) {
- setCaption(tr("INTERSECTION_OF_TWO_GROUPS"));
+ setWindowTitle(tr("INTERSECTION_OF_TWO_GROUPS"));
myHelpFileName = "using_operations_on_groups_page.html#intersection_anchor";
}
else {
- setCaption(tr("CUT_OF_TWO_GROUPS"));
+ setWindowTitle(tr("CUT_OF_TWO_GROUPS"));
myHelpFileName = "using_operations_on_groups_page.html#cut_anchor";
}
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
- QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout (this);
+ aDlgLay->setMargin(MARGIN);
+ aDlgLay->setSpacing(SPACING);
- QFrame* aMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
+ QWidget* aMainFrame = createMainFrame (this);
+ QWidget* aBtnFrame = createButtonFrame(this);
aDlgLay->addWidget(aMainFrame);
aDlgLay->addWidget(aBtnFrame);
- aDlgLay->setStretchFactor(aMainFrame, 1);
-
Init();
}
// name : SMESHGUI_GroupOpDlg::createMainFrame
// Purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_GroupOpDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_GroupOpDlg::createMainFrame (QWidget* theParent)
{
- QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, theParent);
- aMainGrp->setFrameStyle(QFrame::NoFrame);
- aMainGrp->setInsideMargin(0);
-
- QGroupBox* aNameGrp = new QGroupBox(1, Qt::Vertical, tr("NAME"), aMainGrp);
- new QLabel(tr("RESULT_NAME"), aNameGrp);
+ QWidget* aMainGrp = new QWidget(theParent);
+ QVBoxLayout* aLay = new QVBoxLayout(aMainGrp);
+ aLay->setMargin(0);
+ aLay->setSpacing(SPACING);
+
+ // ------------------------------------------------------
+ QGroupBox* aNameGrp = new QGroupBox(tr("NAME"), aMainGrp);
+ QHBoxLayout* aNameGrpLayout = new QHBoxLayout(aNameGrp);
+ aNameGrpLayout->setMargin(MARGIN);
+ aNameGrpLayout->setSpacing(SPACING);
+
+ QLabel* aNameLab = new QLabel(tr("RESULT_NAME"), aNameGrp);
myNameEdit = new QLineEdit(aNameGrp);
- QGroupBox* anArgGrp = new QGroupBox(3, Qt::Horizontal, tr("ARGUMENTS"), aMainGrp);
+ aNameGrpLayout->addWidget(aNameLab);
+ aNameGrpLayout->addWidget(aNameGrp);
- new QLabel(myMode == CUT ? tr("MAIN_OBJECT") :tr("OBJECT_1"), anArgGrp);
+ // ------------------------------------------------------
+ QGroupBox* anArgGrp = new QGroupBox(tr("ARGUMENTS"), aMainGrp);
+ QGridLayout* anArgGrpLayout = new QGridLayout(anArgGrp);
+ anArgGrpLayout->setMargin(MARGIN);
+ anArgGrpLayout->setSpacing(SPACING);
+
+ QLabel* aObj1Lab = new QLabel(myMode == CUT ? tr("MAIN_OBJECT") :tr("OBJECT_1"), anArgGrp);
myBtn1 = new QPushButton(anArgGrp);
myEdit1 = new QLineEdit(anArgGrp);
myEdit1->setAlignment( Qt::AlignLeft );
- new QLabel(myMode == CUT ? tr("TOOL_OBJECT") :tr("OBJECT_2"), anArgGrp);
+ QLabel* aObj2Lab = new QLabel(myMode == CUT ? tr("TOOL_OBJECT") :tr("OBJECT_2"), anArgGrp);
myBtn2 = new QPushButton(anArgGrp);
myEdit2 = new QLineEdit(anArgGrp);
myEdit2->setAlignment( Qt::AlignLeft );
myEdit2->setReadOnly(true);
QPixmap aPix (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- myBtn1->setPixmap(aPix);
- myBtn2->setPixmap(aPix);
+ myBtn1->setIcon(aPix);
+ myBtn2->setIcon(aPix);
+
+ anArgGrpLayout->addWidget(aObj1Lab);
+ anArgGrpLayout->addWidget(myBtn1);
+ anArgGrpLayout->addWidget(myEdit1);
+ anArgGrpLayout->addWidget(aObj2Lab);
+ anArgGrpLayout->addWidget(myBtn2);
+ anArgGrpLayout->addWidget(myEdit2);
+
+ // ------------------------------------------------------
+ aLay->addWidget(aNameGrp);
+ aLay->addWidget(anArgGrp);
return aMainGrp;
}
// name : SMESHGUI_GroupOpDlg::createButtonFrame
// Purpose : Create frame containing buttons
//=======================================================================
-QFrame* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_GroupOpDlg::createButtonFrame (QWidget* theParent)
{
- QFrame* aFrame = new QFrame(theParent);
- aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
+ QGroupBox* aFrame = new QGroupBox(theParent);
- myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
- myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
- myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
- myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
+ myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
+ myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
+ myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING);
+ QHBoxLayout* aLay = new QHBoxLayout(aFrame);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
aLay->addWidget(myOkBtn);
+ aLay->addSpacing(10);
aLay->addWidget(myApplyBtn);
- aLay->addItem(aSpacer);
+ aLay->addSpacing(10);
+ aLay->addStretch();
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
- connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
+ connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
return aFrame;
}
connect(myBtn1, SIGNAL(clicked()), this, SLOT(onFocusChanged()));
connect(myBtn2, SIGNAL(clicked()), this, SLOT(onFocusChanged()));
- this->show();
-
// set selection mode
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP));
-
- return;
}
//=======================================================================
{
// Verify validity of group name
if (myNameEdit->text() == "") {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("EMPTY_NAME"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
+ tr("EMPTY_NAME"));
return false;
}
// Verufy wheter arguments speciffiyed
if (myGroup1->_is_nil() || myGroup2->_is_nil()) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("INCORRECT_ARGUMENTS"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
+ tr("INCORRECT_ARGUMENTS"));
return false;
}
int aMeshId2 = !aMesh2->_is_nil() ? aMesh2->GetId() : -1;
if (aMeshId1 != aMeshId2 || aMeshId1 == -1) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("DIFF_MESHES"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
+ tr("DIFF_MESHES"));
return false;
}
// Verify whether groups have same types of entities
if (myGroup1->GetType() != myGroup2->GetType()) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("DIFF_TYPES"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
+ tr("DIFF_TYPES"));
return false;
}
QString aName = myNameEdit->text();
SMESH::SMESH_Group_ptr aNewGrp = SMESH::SMESH_Group::_nil();
- if (myMode == UNION) aNewGrp = aMesh->UnionGroups(myGroup1, myGroup2, aName.latin1());
- else if (myMode == INTERSECT) aNewGrp = aMesh->IntersectGroups(myGroup1, myGroup2, aName.latin1());
- else aNewGrp = aMesh->CutGroups(myGroup1, myGroup2, aName.latin1());
+ if (myMode == UNION) aNewGrp = aMesh->UnionGroups(myGroup1, myGroup2, aName.toLatin1().data());
+ else if (myMode == INTERSECT) aNewGrp = aMesh->IntersectGroups(myGroup1, myGroup2, aName.toLatin1().data());
+ else aNewGrp = aMesh->CutGroups(myGroup1, myGroup2, aName.toLatin1().data());
if (!aNewGrp->_is_nil()) {
mySMESHGUI->updateObjBrowser(true);
reset();
return true;
} else {
- QMessageBox::critical(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("SMESH_OPERATION_FAILED"), "OK");
+ SUIT_MessageBox::critical(this, tr("SMESH_ERROR"),
+ tr("SMESH_OPERATION_FAILED"));
return false;
}
}
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
-// 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
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_GroupOpDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_GroupOpDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-#ifndef SMESHGUI_GroupOpDlg_H
-#define SMESHGUI_GroupOpDlg_H
+#ifndef SMESHGUI_GROUPOPDLG_H
+#define SMESHGUI_GROUPOPDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
-class QCloseEvent;
-class QLabel;
-class QFrame;
class QPushButton;
-class LightApp_SelectionMgr;
class QLineEdit;
class SMESHGUI;
-class SVTK_ViewWindow;
+class LightApp_SelectionMgr;
class SVTK_Selector;
/*
enum { UNION, INTERSECT, CUT };
public:
- SMESHGUI_GroupOpDlg( SMESHGUI*, const int );
- virtual ~SMESHGUI_GroupOpDlg();
+ SMESHGUI_GroupOpDlg( SMESHGUI*, const int );
+ virtual ~SMESHGUI_GroupOpDlg();
void Init();
private:
-
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
- void keyPressEvent(QKeyEvent*);
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void keyPressEvent( QKeyEvent* );
private slots:
-
void onOk();
bool onApply();
void onClose();
void onFocusChanged();
private:
-
- QFrame* createButtonFrame( QWidget* );
- QFrame* createMainFrame ( QWidget* );
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame ( QWidget* );
bool isValid();
void reset();
private:
-
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
SMESH::SMESH_GroupBase_var myGroup2;
QString myHelpFileName;
-
};
-#endif
+#endif // SMESHGUI_GROUPOPDLG_H
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_GroupUtils.cxx
+// Author : Open CASCADE S.A.S.
+//
-
+// SMESH includes
#include "SMESHGUI_GroupUtils.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
-#include "SUIT_Session.h"
-#include "SalomeApp_Application.h"
-#include "SalomeApp_Tools.h"
-
-#include "OB_Browser.h"
+// SALOME GUI includes
+#include <SalomeApp_Tools.h>
namespace SMESH
{
-
SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr theMesh,
SMESH::ElementType theType,
- const char* theGroupName )
+ const QString& theGroupName )
{
SMESH::SMESH_Group_var aGroup;
try {
if ( !theMesh->_is_nil() )
- aGroup = theMesh->CreateGroup( theType, theGroupName );
+ aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() );
}
catch( const SALOME::SALOME_Exception& S_ex ) {
SalomeApp_Tools::QtCatchCorbaException( S_ex );
}
- //SalomeApp_Application* app =
- // dynamic_cast<SalomeApp_Application*>(SUIT_Session::session()->activeApplication());
- //if (app) app->objectBrowser()->updateTree();
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
return aGroup._retn();
}
-}
+} // end of namespace SMESH
-// 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
-//
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_GroupUtils.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_GroupUtils_HeaderFile
-#define SMESHGUI_GroupUtils_HeaderFile
+#ifndef SMESHGUI_GROUPUTILS_H
+#define SMESHGUI_GROUPUTILS_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "SALOMEconfig.h"
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Group)
+class QString;
-namespace SMESH{
-
-SMESHGUI_EXPORT
- SMESH::SMESH_Group_var AddGroup(SMESH::SMESH_Mesh_ptr theMesh,
- SMESH::ElementType theType,
- const char* theGroupName);
+namespace SMESH
+{
+ SMESHGUI_EXPORT
+ SMESH::SMESH_Group_var AddGroup( SMESH::SMESH_Mesh_ptr,
+ SMESH::ElementType,
+ const QString& );
}
-
-#endif
+#endif // SMESHGUI_GROUPUTILS_H
-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 CEA
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_Hypotheses.cxx
+// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
+//
+// SMESH includes
#include "SMESHGUI_Hypotheses.h"
+
#include "SMESHGUI.h"
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_SpinBox.h"
+// SALOME KERNEL includes
#include <SALOMEDSClient_Study.hxx>
#include <utilities.h>
-#include <SMESHGUI.h>
-
+// SALOME GUI includes
#include <QtxIntSpinBox.h>
-
#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
-
+#include <SUIT_ResourceMgr.h>
#include <LightApp_Application.h>
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qlabel.h>
-#include <qpixmap.h>
-#include <qgroupbox.h>
+// Qt includes
+#include <QFrame>
+#include <QLineEdit>
+#include <QLabel>
+#include <QGroupBox>
+#include <QVBoxLayout>
+#include <QEventLoop>
-#include <qapplication.h>
+#define SPACING 6
+#define MARGIN 11
SMESHGUI_GenericHypothesisCreator::SMESHGUI_GenericHypothesisCreator( const QString& theHypType )
- : myHypType( theHypType ), myIsCreate( false ), myDlg( 0 )
+ : myHypType( theHypType ), myIsCreate( false ), myDlg( 0 ), myEventLoop( 0 )
{
}
myHypo = SMESH::SMESH_Hypothesis::_duplicate( h );
SMESHGUI_HypothesisDlg* Dlg = new SMESHGUI_HypothesisDlg( this, theParent );
+ connect( Dlg, SIGNAL( finished( int ) ), this, SLOT( onDialogFinished( int ) ) );
myDlg = Dlg;
QFrame* fr = buildFrame();
if( fr )
{
Dlg->setCustomFrame( fr );
- Dlg->setCaption( caption() );
- Dlg->setName( theHypName );
+ Dlg->setWindowTitle( caption() );
+ Dlg->setObjectName( theHypName );
Dlg->setHIcon( icon() );
Dlg->setType( type() );
retrieveParams();
Dlg->show();
- qApp->enter_loop(); // make myDlg not modal
+ if ( !myEventLoop )
+ myEventLoop = new QEventLoop( this );
+ myEventLoop->exec(); // make myDlg not modal
res = myDlg->result();
if( res ) {
QString paramValues = storeParams();
if( !stdParams( params ) || params.isEmpty() )
return 0;
- QFrame* fr = new QFrame( 0, "myframe" );
- QVBoxLayout* lay = new QVBoxLayout( fr, 5, 0 );
+ QFrame* fr = new QFrame( 0 );
+ QVBoxLayout* lay = new QVBoxLayout( fr );
+ lay->setMargin( 5 );
+ lay->setSpacing( 0 );
- QGroupBox* GroupC1 = new QGroupBox( fr, "GroupC1" );
+ QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
lay->addWidget( GroupC1 );
- GroupC1->setTitle( tr( "SMESH_ARGUMENTS" ) );
- GroupC1->setColumnLayout(0, Qt::Vertical );
- GroupC1->layout()->setSpacing( 0 );
- GroupC1->layout()->setMargin( 0 );
- QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() );
- GroupC1Layout->setAlignment( Qt::AlignTop );
- GroupC1Layout->setSpacing( 6 );
- GroupC1Layout->setMargin( 11 );
+ QGridLayout* GroupC1Layout = new QGridLayout( GroupC1 );
+ GroupC1Layout->setSpacing( SPACING );
+ GroupC1Layout->setMargin( MARGIN );
ListOfStdParams::const_iterator anIt = params.begin(), aLast = params.end();
for( int i=0; anIt!=aLast; anIt++, i++ )
{
case QVariant::Int:
{
- QtxIntSpinBox* sb = new QtxIntSpinBox( GroupC1, (*anIt).myName.latin1() );
+ QtxIntSpinBox* sb = new QtxIntSpinBox( GroupC1 );
+ sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toInt() );
connect( sb, SIGNAL( valueChanged( int ) ), this, SLOT( onValueChanged() ) );
break;
case QVariant::Double:
{
- QtxDblSpinBox* sb = new SMESHGUI_SpinBox( GroupC1, (*anIt).myName.latin1() );
+ QtxDoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
+ sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toDouble() );
connect( sb, SIGNAL( valueChanged( double ) ), this, SLOT( onValueChanged() ) );
break;
case QVariant::String:
{
- QLineEdit* le = new QLineEdit( GroupC1, (*anIt).myName.latin1() );
+ QLineEdit* le = new QLineEdit( GroupC1 );
+ le->setObjectName( (*anIt).myName );
attuneStdWidget( le, i );
le->setText( (*anIt).myValue.toString() );
connect( le, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
{
}
+void SMESHGUI_GenericHypothesisCreator::onDialogFinished( int /*result*/ )
+{
+ if ( myEventLoop )
+ myEventLoop->exit();
+}
+
bool SMESHGUI_GenericHypothesisCreator::stdParams( ListOfStdParams& ) const
{
return false;
ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
for( ; anIt!=aLast; anIt++ )
{
- item.myName = (*anIt)->name();
+ item.myName = (*anIt)->objectName();
if( (*anIt)->inherits( "QtxIntSpinBox" ) )
{
QtxIntSpinBox* sb = ( QtxIntSpinBox* )( *anIt );
params.append( item );
}
- else if( (*anIt)->inherits( "QtxDblSpinBox" ) )
+ else if( (*anIt)->inherits( "QtxDoubleSpinBox" ) )
{
- QtxDblSpinBox* sb = ( QtxDblSpinBox* )( *anIt );
+ QtxDoubleSpinBox* sb = ( QtxDoubleSpinBox* )( *anIt );
item.myValue = sb->value();
params.append( item );
}
break;
default:
QVariant valCopy = (*param).myValue;
- valueStr += valCopy.asString();
+ valueStr += valCopy.toString();
}
}
return valueStr;
return myParamWidgets;
}
+QtxDialog* SMESHGUI_GenericHypothesisCreator:: dlg() const
+{
+ return myDlg;
+}
+
bool SMESHGUI_GenericHypothesisCreator::isCreation() const
{
return myIsCreate;
{
return 0;
}
-bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam& , QWidget* ) const
+bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam&, QWidget* ) const
{
return false;
}
SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator* creator, QWidget* parent )
-: QtxDialog( parent, "", false, true ),
+: QtxDialog( parent, false, true ),
myCreator( creator )
{
setMinimumSize( 300, height() );
// setFixedSize( 300, height() );
- myLayout = new QVBoxLayout( mainFrame(), 0, 0 );
+ QVBoxLayout* topLayout = new QVBoxLayout( mainFrame() );
+ topLayout->setMargin( 0 );
+ topLayout->setSpacing( 0 );
QFrame* titFrame = new QFrame( mainFrame() );
- QHBoxLayout* titLay = new QHBoxLayout( titFrame, 0, 5 );
+ QHBoxLayout* titLay = new QHBoxLayout( titFrame );
+ titLay->setMargin( 0 );
+ titLay->setSpacing( SPACING );
myIconLabel = new QLabel( titFrame );
myIconLabel->setScaledContents( false );
titLay->addWidget( myTypeLabel, 0 );
titLay->addStretch( 1 );
- myLayout->addWidget( titFrame, 0 );
+ topLayout->addWidget( titFrame, 0 );
QString aHypType = creator->hypType();
if ( aHypType == "LocalLength" )
{
if( f )
{
- f->reparent( mainFrame(), QPoint( 0, 0 ) );
- myLayout->insertWidget( 1, f, 1 );
+ f->setParent( mainFrame() );
+ qobject_cast<QVBoxLayout*>( layout() )->insertWidget( 1, f, 1 );
}
}
if ( myCreator && !myCreator->checkParams() )
return;
QtxDialog::accept();
- qApp->exit_loop();
}
void SMESHGUI_HypothesisDlg::reject()
{
if ( myCreator ) myCreator->onReject();
QtxDialog::reject();
- qApp->exit_loop();
}
void SMESHGUI_HypothesisDlg::onHelp()
app->onHelpContextModule(aSMESHGUI ? app->moduleName(aSMESHGUI->moduleName()) : QString(""), myHelpFileName);
}
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
{
myTypeLabel->setText( t );
}
+
+HypothesisData::HypothesisData( const QString& theTypeName,
+ const QString& thePluginName,
+ const QString& theServerLibName,
+ const QString& theClientLibName,
+ const QString& theLabel,
+ const QString& theIconId,
+ const QList<int>& theDim,
+ const bool theIsAux,
+ const QStringList& theNeededHypos,
+ const QStringList& theOptionalHypos,
+ const QStringList& theInputTypes,
+ const QStringList& theOutputTypes,
+ const bool theIsNeedGeometry )
+ : TypeName( theTypeName ),
+ PluginName( thePluginName ),
+ ServerLibName( theServerLibName ),
+ ClientLibName( theClientLibName ),
+ Label( theLabel ),
+ IconId( theIconId ),
+ Dim( theDim ),
+ IsAux( theIsAux ),
+ NeededHypos( theNeededHypos ),
+ OptionalHypos( theOptionalHypos ),
+ InputTypes( theInputTypes ),
+ OutputTypes( theOutputTypes ),
+ IsNeedGeometry( theIsNeedGeometry )
+{
+}
+
+HypothesesSet::HypothesesSet( const QString& theSetName )
+ : HypoSetName( theSetName )
+{
+}
+
+HypothesesSet::HypothesesSet( const QString& theSetName,
+ const QStringList& theHypoList,
+ const QStringList& theAlgoList )
+ : HypoSetName( theSetName ),
+ HypoList( theHypoList ),
+ AlgoList( theAlgoList )
+{
+}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 CEA
-//
-// 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
+// Copyright (C) 2003 CEA
+//
+// 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 : SMESHGUI_Hypotheses.h
+// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
//
-// File : SMESHGUI_Hypotheses.h
-// Author : Julia DOROVSKIKH
-// Module : SMESH
-// $Header$
-#ifndef SMESHGUI_Hypotheses_HeaderFile
-#define SMESHGUI_Hypotheses_HeaderFile
+#ifndef SMESHGUI_HYPOTHESES_H
+#define SMESHGUI_HYPOTHESES_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+// Qt includes
+#include <QtxDialog.h>
+#include <QVariant>
+
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Hypothesis)
-#include <QtxDialog.h>
-#include <qvariant.h>
-
-class QVBoxLayout;
-class QPixmap;
+class QEventLoop;
/*!
* \brief Auxiliary class for creation of hypotheses
Q_OBJECT
public:
- SMESHGUI_GenericHypothesisCreator( const QString& theHypType );
+ SMESHGUI_GenericHypothesisCreator( const QString& );
virtual ~SMESHGUI_GenericHypothesisCreator();
- void create( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*);
- void create( bool isAlgo, const QString&, QWidget*);
- void edit( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget*);
+ void create( SMESH::SMESH_Hypothesis_ptr,
+ const QString&, QWidget* );
+ void create( bool, const QString&, QWidget* );
+ void edit( SMESH::SMESH_Hypothesis_ptr,
+ const QString&, QWidget* );
- virtual bool checkParams() const = 0;
- virtual void onReject();
+ virtual bool checkParams() const = 0;
+ virtual void onReject();
- QString hypType() const;
- QString hypName() const;
- bool isCreation() const;
+ QString hypType() const;
+ QString hypName() const;
+ bool isCreation() const;
protected:
typedef struct
} StdParam;
- typedef QValueList<StdParam> ListOfStdParams;
- typedef QPtrList<QWidget> ListOfWidgets;
-
- SMESH::SMESH_Hypothesis_var hypothesis() const;
- SMESH::SMESH_Hypothesis_var initParamsHypothesis() const;
- const ListOfWidgets& widgets() const;
- ListOfWidgets& changeWidgets();
- QtxDialog* dlg() const { return myDlg; }
-
- virtual QFrame* buildFrame () = 0;
- QFrame* buildStdFrame ();
- virtual void retrieveParams() const = 0;
- virtual QString storeParams () const = 0;
- virtual bool stdParams ( ListOfStdParams& ) const;
- bool getStdParamFromDlg( ListOfStdParams& ) const;
- static QString stdParamValues( const ListOfStdParams& );
- virtual void attuneStdWidget( QWidget*, const int ) const;
- virtual QWidget* getCustomWidget( const StdParam &, QWidget*, const int ) const;
- virtual bool getParamFromCustomWidget( StdParam& , QWidget* ) const;
- virtual QString caption() const;
- virtual QPixmap icon() const;
- virtual QString type() const;
+ typedef QList<StdParam> ListOfStdParams;
+ typedef QList<QWidget*> ListOfWidgets;
+
+ SMESH::SMESH_Hypothesis_var hypothesis() const;
+ SMESH::SMESH_Hypothesis_var initParamsHypothesis() const;
+ const ListOfWidgets& widgets() const;
+ ListOfWidgets& changeWidgets();
+ QtxDialog* dlg() const;
+
+ virtual QFrame* buildFrame() = 0;
+ QFrame* buildStdFrame();
+ virtual void retrieveParams() const = 0;
+ virtual QString storeParams() const = 0;
+ virtual bool stdParams( ListOfStdParams& ) const;
+ bool getStdParamFromDlg( ListOfStdParams& ) const;
+ static QString stdParamValues( const ListOfStdParams& );
+ virtual void attuneStdWidget( QWidget*, const int ) const;
+ virtual QWidget* getCustomWidget( const StdParam&,
+ QWidget*, const int ) const;
+ virtual bool getParamFromCustomWidget( StdParam&, QWidget* ) const;
+ virtual QString caption() const;
+ virtual QPixmap icon() const;
+ virtual QString type() const;
protected slots:
- virtual void onValueChanged();
+ virtual void onValueChanged();
+
+private slots:
+ virtual void onDialogFinished( int );
private:
- bool editHypothesis( SMESH::SMESH_Hypothesis_ptr, const QString&, QWidget* );
+ bool editHypothesis( SMESH::SMESH_Hypothesis_ptr,
+ const QString&, QWidget* );
private:
SMESH::SMESH_Hypothesis_var myHypo, myInitParamsHypo;
ListOfWidgets myParamWidgets;
bool myIsCreate;
QtxDialog* myDlg;
+ QEventLoop* myEventLoop;
};
class SMESHGUI_HypothesisDlg : public QtxDialog
SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator*, QWidget* );
virtual ~SMESHGUI_HypothesisDlg();
- void setHIcon( const QPixmap& );
- void setCustomFrame( QFrame* );
- void setType( const QString& );
+ void setHIcon( const QPixmap& );
+ void setCustomFrame( QFrame* );
+ void setType( const QString& );
protected slots:
- virtual void accept();
- virtual void reject();
- void onHelp();
+ virtual void accept();
+ virtual void reject();
+ void onHelp();
private:
SMESHGUI_GenericHypothesisCreator* myCreator;
- QVBoxLayout* myLayout;
QLabel* myIconLabel;
QLabel* myTypeLabel;
QString myHelpFileName;
*/
class HypothesisData
{
- public:
- HypothesisData( const QString& theTypeName,
- const QString& thePluginName,
- const QString& theServerLibName,
- const QString& theClientLibName,
- const QString& theLabel,
- const QString& theIconId,
- const QValueList<int>& theDim,
- const bool theIsAux,
- const QStringList& theNeededHypos,
- const QStringList& theOptionalHypos,
- const QStringList& theInputTypes,
- const QStringList& theOutputTypes,
- const bool theIsNeedGeometry = true)
- : TypeName( theTypeName ),
- PluginName( thePluginName ),
- ServerLibName( theServerLibName ),
- ClientLibName( theClientLibName ),
- Label( theLabel ),
- IconId( theIconId ),
- Dim( theDim ),
- IsAux( theIsAux ),
- NeededHypos( theNeededHypos ), OptionalHypos( theOptionalHypos ),
- InputTypes( theInputTypes ), OutputTypes( theOutputTypes ),
- IsNeedGeometry( theIsNeedGeometry )
- {};
-
- QString TypeName; //!< hypothesis type name
- QString PluginName; //!< plugin name
- QString ServerLibName; //!< server library name
- QString ClientLibName; //!< client library name
- QString Label; //!< label
- QString IconId; //!< icon identifier
- QValueList<int> Dim; //!< list of supported dimensions (see SMESH::Dimension enumeration)
- bool IsAux; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise
- bool IsNeedGeometry; //!< TRUE if for given hypothesis need shape, FALSE otherwise
-
- // for algorithm only: dependencies algo <-> algo and algo -> hypos
- QStringList NeededHypos; //!< list of obligatory hypotheses
- QStringList OptionalHypos;//!< list of optional hypotheses
- QStringList InputTypes; //!< list of element types required as a prerequisite
- QStringList OutputTypes; //!< list of types of generated elements
+public:
+ HypothesisData( const QString&, const QString&, const QString&,
+ const QString&, const QString&, const QString&,
+ const QList<int>&, const bool,
+ const QStringList&, const QStringList&,
+ const QStringList&, const QStringList&,
+ const bool = true );
+
+ QString TypeName; //!< hypothesis type name
+ QString PluginName; //!< plugin name
+ QString ServerLibName; //!< server library name
+ QString ClientLibName; //!< client library name
+ QString Label; //!< label
+ QString IconId; //!< icon identifier
+ QList<int> Dim; //!< list of supported dimensions (see SMESH::Dimension enumeration)
+ bool IsAux; //!< TRUE if given hypothesis is auxiliary one, FALSE otherwise
+ bool IsNeedGeometry; //!< TRUE if for given hypothesis need shape, FALSE otherwise
+
+ // for algorithm only: dependencies algo <-> algo and algo -> hypos
+ QStringList NeededHypos; //!< list of obligatory hypotheses
+ QStringList OptionalHypos;//!< list of optional hypotheses
+ QStringList InputTypes; //!< list of element types required as a prerequisite
+ QStringList OutputTypes; //!< list of types of generated elements
};
/*!
*/
class HypothesesSet
{
- public:
- HypothesesSet( const QString& theSetName )
- : HypoSetName( theSetName ) {};
- HypothesesSet( const QString& theSetName,
- const QStringList& theHypoList,
- const QStringList& theAlgoList )
- : HypoSetName( theSetName ), HypoList(theHypoList), AlgoList(theAlgoList) {};
+public:
+ HypothesesSet( const QString& );
+ HypothesesSet( const QString&, const QStringList&, const QStringList& );
+
QString HypoSetName;
QStringList HypoList, AlgoList;
};
-#endif
+
+#endif // SMESHGUI_HYPOTHESES_H
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 CEA
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_HypothesesUtils.cxx
+// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
+//
+// SMESH includes
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_GEOMGenUtils.h"
-#include "SUIT_Tools.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-
-#include "OB_Browser.h"
-
-#include "SalomeApp_Study.h"
-#include "SalomeApp_Tools.h"
-#include "SalomeApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_ResourceMgr.h>
-#include <SALOMEDSClient_Study.hxx>
-#include <SALOMEDSClient_SObject.hxx>
+#include <SalomeApp_Study.h>
+#include <SalomeApp_Tools.h>
-#include "SALOMEconfig.h"
-#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
+// SALOME KERNEL includes
+#include <utilities.h>
+// STL includes
#include <map>
#include <string>
+// Other includes
#ifdef WNT
- #include <windows.h>
+#include <windows.h>
#else
- #include <dlfcn.h>
+#include <dlfcn.h>
#endif
#ifdef WNT
- #define LibHandle HMODULE
- #define LoadLib( name ) LoadLibrary( name )
- #define GetProc GetProcAddress
- #define UnLoadLib( handle ) FreeLibrary( handle );
+#define LibHandle HMODULE
+#define LoadLib( name ) LoadLibrary( name )
+#define GetProc GetProcAddress
+#define UnLoadLib( handle ) FreeLibrary( handle );
#else
- #define LibHandle void*
- #define LoadLib( name ) dlopen( name, RTLD_LAZY )
- #define GetProc dlsym
- #define UnLoadLib( handle ) dlclose( handle );
+#define LibHandle void*
+#define LoadLib( name ) dlopen( name, RTLD_LAZY )
+#define GetProc dlsym
+#define UnLoadLib( handle ) dlclose( handle );
#endif
#ifdef _DEBUG_
static int MYDEBUG = 0;
#endif
-namespace SMESH{
-
- using namespace std;
-
- typedef map<string,HypothesisData*> THypothesisDataMap;
+namespace SMESH
+{
+ typedef std::map<std::string,HypothesisData*> THypothesisDataMap;
THypothesisDataMap myHypothesesMap;
THypothesisDataMap myAlgorithmsMap;
- typedef map<string,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
+ typedef std::map<std::string,SMESHGUI_GenericHypothesisCreator*> THypCreatorMap;
THypCreatorMap myHypCreatorMap;
- list<HypothesesSet*> myListOfHypothesesSets;
+ std::list<HypothesesSet*> myListOfHypothesesSets;
void processHypothesisStatus(const int theHypStatus,
SMESH::SMESH_Hypothesis_ptr theHyp,
else
aMsg = (isFatal ? "SMESH_CANT_RM_HYP" : "SMESH_RM_HYP_WRN");
- aMsg = QObject::tr(aMsg).arg(aHypName) +
- QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus));
+ aMsg = QObject::tr(aMsg.toLatin1().data()).arg(aHypName) +
+ QObject::tr(QString("SMESH_HYP_%1").arg(theHypStatus).toLatin1().data());
if ( theHypStatus == SMESH::HYP_HIDDEN_ALGO ) // PAL18501
aMsg = aMsg.arg( GetHypothesisData(theHyp->GetName())->Dim[0] );
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- aMsg,
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ aMsg);
}
}
if (cenv)
HypsXml.sprintf("%s", cenv);
- QStringList HypsXmlList = QStringList::split(":", HypsXml, false);
+ QStringList HypsXmlList = HypsXml.split(":", QString::SkipEmptyParts);
if (HypsXmlList.count() == 0)
{
- SUIT_MessageBox::error1(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("MESHERS_FILE_NO_VARIABLE"),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::critical(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("MESHERS_FILE_NO_VARIABLE"));
return;
}
xmlFile = resMgr->path("resources", HypsXml, HypsXml + ".xml");
QFile file (xmlFile);
- if (file.exists() && file.open(IO_ReadOnly)) {
+ if (file.exists() && file.open(QIODevice::ReadOnly)) {
file.close();
SMESHGUI_XmlHandler* aXmlHandler = new SMESHGUI_XmlHandler();
ASSERT(aXmlHandler);
- QXmlInputSource source (file);
+ QXmlInputSource source (&file);
QXmlSimpleReader reader;
reader.setContentHandler(aXmlHandler);
reader.setErrorHandler(aXmlHandler);
aXmlHandler->myListOfHypothesesSets );
}
else {
- SUIT_MessageBox::error1(SMESHGUI::desktop(),
- QObject::tr("INF_PARSE_ERROR"),
- QObject::tr(aXmlHandler->errorProtocol()),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::critical(SMESHGUI::desktop(),
+ QObject::tr("INF_PARSE_ERROR"),
+ QObject::tr(aXmlHandler->errorProtocol().toLatin1().data()));
}
}
else {
QString aMess = QObject::tr("MESHERS_FILE_CANT_OPEN") + " " + aNoAccessFiles + "\n";
aMess += QObject::tr("MESHERS_FILE_CHECK_VARIABLE");
wc.suspend();
- SUIT_MessageBox::warn1(SMESHGUI::desktop(),
- QObject::tr("SMESH_WRN_WARNING"),
- aMess,
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(),
+ QObject::tr("SMESH_WRN_WARNING"),
+ aMess);
wc.resume();
}
}
THypothesisDataMap* pMap = isAlgo ? &myAlgorithmsMap : &myHypothesesMap;
THypothesisDataMap::iterator anIter;
for ( anIter = pMap->begin(); anIter != pMap->end(); anIter++ )
- {
- HypothesisData* aData = (*anIter).second;
- if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux)
- if (checkGeometry){
- if (aData->IsNeedGeometry == isNeedGeometry)
- aHypList.append(((*anIter).first).c_str());
- }
- else
- aHypList.append(((*anIter).first).c_str());
- }
+ {
+ HypothesisData* aData = (*anIter).second;
+ if ( ( theDim < 0 || aData->Dim.contains( theDim ) ) && aData->IsAux == isAux)
+ if (checkGeometry){
+ if (aData->IsNeedGeometry == isNeedGeometry)
+ aHypList.append(((*anIter).first).c_str());
+ }
+ else
+ aHypList.append(((*anIter).first).c_str());
+ }
return aHypList;
}
list<HypothesesSet*>::iterator hypoSet = myListOfHypothesesSets.begin();
for ( ; hypoSet != myListOfHypothesesSets.end(); ++hypoSet )
- {
- HypothesesSet* aSet = *hypoSet;
- if ( aSet && aSet->AlgoList.count() ) {
- aSetNameList.append( aSet->HypoSetName );
+ {
+ HypothesesSet* aSet = *hypoSet;
+ if ( aSet && aSet->AlgoList.count() ) {
+ aSetNameList.append( aSet->HypoSetName );
+ }
}
- }
return aSetNameList;
}
- HypothesesSet* GetHypothesesSet(const QString theSetName)
+ HypothesesSet* GetHypothesesSet(const QString& theSetName)
{
list<HypothesesSet*>::iterator hypoSet = myListOfHypothesesSets.begin();
for ( ; hypoSet != myListOfHypothesesSets.end(); ++hypoSet )
- {
- HypothesesSet* aSet = *hypoSet;
- if ( aSet && aSet->HypoSetName == theSetName )
- return aSet;
- }
+ {
+ HypothesesSet* aSet = *hypoSet;
+ if ( aSet && aSet->HypoSetName == theSetName )
+ return aSet;
+ }
return 0;
}
- HypothesisData* GetHypothesisData (const char* aHypType)
+ HypothesisData* GetHypothesisData (const QString& aHypType)
{
HypothesisData* aHypData = 0;
// Init list of available hypotheses, if needed
InitAvailableHypotheses();
- THypothesisDataMap::iterator type_data = myHypothesesMap.find(aHypType);
+ THypothesisDataMap::iterator type_data = myHypothesesMap.find(aHypType.toLatin1().data());
if (type_data != myHypothesesMap.end()) {
aHypData = type_data->second;
}
else {
- type_data = myAlgorithmsMap.find(aHypType);
+ type_data = myAlgorithmsMap.find(aHypType.toLatin1().data());
if (type_data != myAlgorithmsMap.end())
aHypData = type_data->second;
}
return false;
}
- SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const char* aHypType)
+ SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const QString& aHypType)
{
- if(MYDEBUG) MESSAGE("Get HypothesisCreator for " << aHypType);
+ if(MYDEBUG) MESSAGE("Get HypothesisCreator for " << aHypType.toLatin1().data());
SMESHGUI_GenericHypothesisCreator* aCreator = 0;
// check, if creator for this hypothesis type already exists
- if (myHypCreatorMap.find(aHypType) != myHypCreatorMap.end()) {
- aCreator = myHypCreatorMap[aHypType];
+ if (myHypCreatorMap.find(aHypType.toLatin1().data()) != myHypCreatorMap.end()) {
+ aCreator = myHypCreatorMap[aHypType.toLatin1().data()];
}
else {
// 1. Init list of available hypotheses, if needed
try {
// load plugin library
if(MYDEBUG) MESSAGE("Loading client meshers plugin library ...");
- LibHandle libHandle = LoadLib( aClientLibName );
+ LibHandle libHandle = LoadLib( aClientLibName.toLatin1().data() );
if (!libHandle) {
// report any error, if occured
- if ( MYDEBUG )
- {
+ if ( MYDEBUG )
+ {
#ifdef WIN32
- const char* anError = "Can't load client meshers plugin library";
+ const char* anError = "Can't load client meshers plugin library";
#else
- const char* anError = dlerror();
+ const char* anError = dlerror();
#endif
- MESSAGE(anError);
- }
+ MESSAGE(anError);
+ }
}
else {
// get method, returning hypothesis creator
}
else {
// get hypothesis creator
- if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType);
+ if(MYDEBUG) MESSAGE("Get Hypothesis Creator for " << aHypType.toLatin1().data());
aCreator = procHandle( aHypType );
if (!aCreator) {
if(MYDEBUG) MESSAGE("no such a hypothesis in this plugin");
}
else {
// map hypothesis creator to a hypothesis name
- myHypCreatorMap[aHypType] = aCreator;
+ myHypCreatorMap[aHypType.toLatin1().data()] = aCreator;
}
}
}
}
- SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const char* aHypType,
- const char* aHypName,
+ SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const QString& aHypType,
+ const QString& aHypName,
const bool isAlgo)
{
- if(MYDEBUG) MESSAGE("Create " << aHypType << " with name " << aHypName);
+ if(MYDEBUG) MESSAGE("Create " << aHypType.toLatin1().data() <<
+ " with name " << aHypName.toLatin1().data());
HypothesisData* aHypData = GetHypothesisData(aHypType);
QString aServLib = aHypData->ServerLibName;
try {
SMESH::SMESH_Hypothesis_var aHypothesis;
- aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType, aServLib);
+ aHypothesis = SMESHGUI::GetSMESHGen()->CreateHypothesis(aHypType.toLatin1().data(),
+ aServLib.toLatin1().data());
if (!aHypothesis->_is_nil()) {
_PTR(SObject) aHypSObject = SMESH::FindSObject(aHypothesis.in());
if (aHypSObject) {
- if (strlen(aHypName) > 0)
+ if (!aHypName.isEmpty())
SMESH::SetName(aHypSObject, aHypName);
SMESHGUI::GetSMESHGUI()->updateObjBrowser();
return aHypothesis._retn();
_PTR(Study) aStudy = GetActiveStudyDocument();
_PTR(SObject) aHypObj = aStudy->FindObjectID( IObject->getEntry() );
if( aHypObj )
- {
- _PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
- _PTR(SObject) aRealHypo;
- if( aHypObj->ReferencedObject( aRealHypo ) )
- {
- SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
- RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
- }
- else
{
- SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
- SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
- for( int i = 0; i < meshList.size(); i++ )
- RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
+ _PTR(SObject) MorSM = SMESH::GetMeshOrSubmesh( aHypObj );
+ _PTR(SObject) aRealHypo;
+ if( aHypObj->ReferencedObject( aRealHypo ) )
+ {
+ SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aRealHypo ) );
+ RemoveHypothesisOrAlgorithmOnMesh( MorSM, hypo );
+ }
+ else
+ {
+ SMESH_Hypothesis_var hypo = SMESH_Hypothesis::_narrow( SObjectToObject( aHypObj ) );
+ SObjectList meshList = GetMeshesUsingAlgoOrHypothesis( hypo );
+ for( int i = 0; i < meshList.size(); i++ )
+ RemoveHypothesisOrAlgorithmOnMesh( meshList[ i ], hypo );
+ }
}
- }
}
catch(const SALOME::SALOME_Exception& S_ex)
- {
- wc.suspend();
- SalomeApp_Tools::QtCatchCorbaException(S_ex);
- res = SMESH::HYP_UNKNOWN_FATAL;
- }
+ {
+ wc.suspend();
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ res = SMESH::HYP_UNKNOWN_FATAL;
+ }
return res < SMESH::HYP_UNKNOWN_FATAL;
}
}
return resMsg;
}
-
-}
+} // end of namespace SMESH
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 CEA
-//
-// 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
+// Copyright (C) 2003 CEA
+//
+// 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 : SMESHGUI_HypothesesUtils.h
+// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
//
-// File : SMESHGUI_HypothesesUtils.h
-// Author : Julia DOROVSKIKH
-// Module : SMESH
-// $Header$
-#ifndef SMESHGUI_HypothesesUtils_HeaderFile
-#define SMESHGUI_HypothesesUtils_HeaderFile
+#ifndef SMESHGUI_HYPOTHESESUTILS_H
+#define SMESHGUI_HYPOTHESESUTILS_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qstring.h>
-#include <qstringlist.h>
+// Qt includes
+#include <QString>
+#include <QStringList>
+
+// SALOME GUI includes
+#include <SALOME_InteractiveObject.hxx>
-#include "SALOME_InteractiveObject.hxx"
-#include "SALOMEDSClient_definitions.hxx"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_definitions.hxx>
-#include "SALOMEconfig.h"
-#include CORBA_CLIENT_HEADER(SALOMEDS)
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Hypothesis)
+// STL includes
#include <vector>
class HypothesisData;
class SALOMEDSClient_SObject;
class algo_error_array;
-namespace SMESH{
-
+namespace SMESH
+{
SMESHGUI_EXPORT
void InitAvailableHypotheses();
SMESHGUI_EXPORT
- QStringList GetAvailableHypotheses( const bool isAlgo,
- const int theDim = -1,
- const bool isAux = false,
- const bool isNeedGeometry = true);
+ QStringList GetAvailableHypotheses( const bool,
+ const int = -1,
+ const bool = false,
+ const bool = true);
SMESHGUI_EXPORT
QStringList GetHypothesesSets();
SMESHGUI_EXPORT
- HypothesesSet* GetHypothesesSet(const QString theSetName);
+ HypothesesSet* GetHypothesesSet( const QString& );
SMESHGUI_EXPORT
- HypothesisData* GetHypothesisData(const char* aHypType);
+ HypothesisData* GetHypothesisData( const QString& );
SMESHGUI_EXPORT
- bool IsAvailableHypothesis(const HypothesisData* algoData,
- const QString& hypType,
- bool& isOptional);
+ bool IsAvailableHypothesis( const HypothesisData*,
+ const QString&,
+ bool& );
SMESHGUI_EXPORT
- bool IsCompatibleAlgorithm(const HypothesisData* algo1Data,
- const HypothesisData* algo2Data);
+ bool IsCompatibleAlgorithm( const HypothesisData*,
+ const HypothesisData* );
SMESHGUI_EXPORT
- SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const char* aHypType);
+ SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& );
SMESHGUI_EXPORT
- SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const char* aHypType,
- const char* aHypName,
- const bool isAlgo = false);
+ SMESH::SMESH_Hypothesis_ptr CreateHypothesis( const QString&,
+ const QString&,
+ const bool = false);
SMESHGUI_EXPORT
- bool AddHypothesisOnMesh(SMESH::SMESH_Mesh_ptr aMesh, SMESH::SMESH_Hypothesis_ptr aHyp);
+ bool AddHypothesisOnMesh( SMESH::SMESH_Mesh_ptr, SMESH::SMESH_Hypothesis_ptr );
SMESHGUI_EXPORT
- bool AddHypothesisOnSubMesh(SMESH::SMESH_subMesh_ptr aSubMesh, SMESH::SMESH_Hypothesis_ptr aHyp);
+ bool AddHypothesisOnSubMesh( SMESH::SMESH_subMesh_ptr, SMESH::SMESH_Hypothesis_ptr );
SMESHGUI_EXPORT
- bool RemoveHypothesisOrAlgorithmOnMesh(const Handle(SALOME_InteractiveObject)& IObject);
+ bool RemoveHypothesisOrAlgorithmOnMesh( const Handle(SALOME_InteractiveObject)& );
SMESHGUI_EXPORT
- bool RemoveHypothesisOrAlgorithmOnMesh(_PTR(SObject) MorSM,
- SMESH::SMESH_Hypothesis_ptr anHyp);
+ bool RemoveHypothesisOrAlgorithmOnMesh( _PTR(SObject),
+ SMESH::SMESH_Hypothesis_ptr );
typedef std::vector<_PTR(SObject)> SObjectList;
- SObjectList GetMeshesUsingAlgoOrHypothesis(SMESH::SMESH_Hypothesis_ptr AlgoOrHyp ) ;
+ SObjectList GetMeshesUsingAlgoOrHypothesis( SMESH::SMESH_Hypothesis_ptr );
SMESHGUI_EXPORT
- QString GetMessageOnAlgoStateErrors(const algo_error_array& errors);
+ QString GetMessageOnAlgoStateErrors( const algo_error_array& );
}
-#endif
+#endif // SMESHGUI_HYPOTHESESUTILS_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 CEA
-//
-// 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
+// Copyright (C) 2003 CEA
+//
+// 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 : SMESHGUI_IdValidator.h
+// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-// File : SMESHGUI_IdValidator.h
-// Author : Edward AGAPOV
-// Module : SMESH
-// $Header: /dn05/salome/PAL/SMESH/SMESH_SRC/src/SMESHGUI/SMESHGUI_IdValidator.h
-#ifndef SMESHGUI_IdValidator_HeaderFile
-#define SMESHGUI_IdValidator_HeaderFile
+#ifndef SMESHGUI_IDVALIDATOR_H
+#define SMESHGUI_IDVALIDATOR_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qvalidator.h>
+// Qt includes
+#include <QValidator>
// validator for manual input of Ids
-class SMESHGUI_EXPORT SMESHGUI_IdValidator: public QValidator
+class SMESHGUI_EXPORT SMESHGUI_IdValidator : public QValidator
{
- public:
-
- SMESHGUI_IdValidator(QWidget * parent, const char * name = 0, const int maxNbId = 0):
- QValidator(parent,name), myMaxNbId(maxNbId) {}
+public:
+ SMESHGUI_IdValidator( QWidget* parent, const int maxNbId = 0 ) :
+ QValidator( parent ), myMaxNbId( maxNbId ) {}
- State validate ( QString & text, int & pos) const
+ State validate( QString& input, int& pos ) const
{
- text.replace( QRegExp(" *[^0-9]+ *"), " " );
- if ( myMaxNbId && text.length() > myMaxNbId) { // truncate extra ids
+ input.replace( QRegExp(" *[^0-9]+ *"), " " );
+ if ( myMaxNbId && input.length() > myMaxNbId ) {
+ // truncate extra ids
int ind = 0, nbId = 0;
- while ( ind < text.length() ) {
- if ( text.at( ind ) != ' ' ) {
+ while ( ind < input.length() ) {
+ if ( input.at( ind ) != ' ' ) {
if ( ++nbId > myMaxNbId ) {
- text.truncate( ind );
+ input.truncate( ind );
break;
}
- ind = text.find( ' ', ind );
+ ind = input.indexOf( ' ', ind );
if ( ind < 0 ) break;
}
ind++;
}
}
- if ( pos > text.length() )
- pos = text.length();
+ if ( pos > input.length() )
+ pos = input.length();
return Acceptable;
}
- private:
+private:
int myMaxNbId;
};
-#endif
+#endif // SMESHGUI_IDVALIDATOR_H
-// SMESH SMESHGUI : GUI for SMESH component
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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 : SMESHGUI_MakeNodeAtPointDlg.cxx
+// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_MakeNodeAtPointDlg.cxx
-// Author : Edward AGAPOV
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_MakeNodeAtPointDlg.h"
#include "SMESHGUI.h"
-#include "SMESHGUI_GEOMGenUtils.h"
#include "SMESHGUI_IdValidator.h"
#include "SMESHGUI_MeshUtils.h"
-#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_MeshEditPreview.h"
-#include "SMDS_Mesh.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMESH_Actor.h"
-#include "SMESH_ActorUtils.h"
-#include "SMESH_NumberFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-
-#include "GEOMBase.h"
-#include "GeometryGUI.h"
-
-#include "LightApp_DataOwner.h"
-#include "LightApp_SelectionMgr.h"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOME_ListIO.hxx"
-#include "SUIT_Desktop.h"
-#include "SVTK_Selector.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
-#include "SalomeApp_Tools.h"
-#include "SalomeApp_TypeFilter.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_MessageBox.h"
-
-// OCCT Includes
+#include <SMDS_Mesh.hxx>
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+#include <SMESH_NumberFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
+
+// SALOME GEOM includes
+#include <GEOMBase.h>
+
+// SALOME GUI includes
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+#include <SUIT_Desktop.h>
+#include <SVTK_ViewModel.h>
+#include <SalomeApp_Tools.h>
+#include <SalomeApp_TypeFilter.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_MessageBox.h>
+
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
#include <TopoDS_Vertex.hxx>
#include <BRep_Tool.hxx>
-
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qapplication.h>
-#include <qstringlist.h>
-#include <qcheckbox.h>
-#include <qmessagebox.h>
-
+#include <gp_Pnt.hxx>
+
+// Qt includes
+#include <QGroupBox>
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QLabel>
+#include <QRadioButton>
+#include <QCheckBox>
+
+// VTK includes
#include <vtkProperty.h>
-// IDL Headers
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-#define SPACING 5
-#define MARGIN 10
+#define SPACING 6
+#define MARGIN 11
/*!
* \brief Dialog to publish a sub-shape of the mesh main shape
SMESHGUI_MakeNodeAtPointDlg::SMESHGUI_MakeNodeAtPointDlg()
: SMESHGUI_Dialog( 0, false, true )
{
- setCaption(tr("CAPTION"));
+ setWindowTitle(tr("CAPTION"));
- QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame(), MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
+ aDlgLay->setMargin(MARGIN);;
+ aDlgLay->setSpacing(SPACING);
- QFrame* aMainFrame = createMainFrame (mainFrame());
+ QWidget* aMainFrame = createMainFrame (mainFrame());
aDlgLay->addWidget(aMainFrame);
// function : createMainFrame()
// purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_MakeNodeAtPointDlg::createMainFrame (QWidget* theParent)
{
- QFrame* aFrame = new QFrame(theParent);
+ QWidget* aFrame = new QWidget(theParent);
SUIT_ResourceMgr* rm = SMESH::GetResourceMgr( SMESHGUI::GetSMESHGUI() );
QPixmap iconMoveNode (rm->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
// constructor
- QButtonGroup* aPixGrp = new QButtonGroup(1, Qt::Vertical, tr("MESH_PASS_THROUGH_POINT"), aFrame);
- aPixGrp->setExclusive(TRUE);
+ QGroupBox* aPixGrp = new QGroupBox(tr("MESH_PASS_THROUGH_POINT"), aFrame);
+ QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
+ aPixGrpLayout->setMargin(MARGIN);
+ aPixGrpLayout->setSpacing(SPACING);
+
QRadioButton* aRBut = new QRadioButton(aPixGrp);
- aRBut->setPixmap(iconMoveNode);
- aRBut->setChecked(TRUE);
+ aRBut->setIcon(iconMoveNode);
+ aRBut->setChecked(true);
+ aPixGrpLayout->addWidget(aRBut);
// coordinates
- QGroupBox* aCoordGrp = new QGroupBox(1, Qt::Vertical, tr("SMESH_COORDINATES"), aFrame);
+ QGroupBox* aCoordGrp = new QGroupBox(tr("SMESH_COORDINATES"), aFrame);
+ QHBoxLayout* aCoordGrpLayout = new QHBoxLayout(aCoordGrp);
+ aCoordGrpLayout->setMargin(MARGIN);
+ aCoordGrpLayout->setSpacing(SPACING);
+
myCoordBtn = new QPushButton(aCoordGrp);
- myCoordBtn->setPixmap(iconSelect);
- myCoordBtn->setToggleButton(TRUE);
+ myCoordBtn->setIcon(iconSelect);
+ myCoordBtn->setCheckable(true);
QLabel* aXLabel = new QLabel(tr("SMESH_X"), aCoordGrp);
- aXLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
myX = new SMESHGUI_SpinBox(aCoordGrp);
QLabel* aYLabel = new QLabel(tr("SMESH_Y"), aCoordGrp);
- //aYLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- aYLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
myY = new SMESHGUI_SpinBox(aCoordGrp);
QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp);
- //aZLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- aZLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
myZ = new SMESHGUI_SpinBox(aCoordGrp);
myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
+ aCoordGrpLayout->addWidget(myCoordBtn);
+ aCoordGrpLayout->addWidget(aXLabel);
+ aCoordGrpLayout->addWidget(myX);
+ aCoordGrpLayout->addWidget(aYLabel);
+ aCoordGrpLayout->addWidget(myY);
+ aCoordGrpLayout->addWidget(aZLabel);
+ aCoordGrpLayout->addWidget(myZ);
+
// Method selection
- QButtonGroup* aMethodGrp = new QButtonGroup(1, Qt::Vertical, tr("METHOD"), aFrame);
- aMethodGrp->setExclusive(TRUE);
+ QGroupBox* aMethodGrp = new QGroupBox(tr("METHOD"), aFrame);
+ QHBoxLayout* aMethodGrpLayout = new QHBoxLayout(aMethodGrp);
+ aMethodGrpLayout->setMargin(MARGIN);
+ aMethodGrpLayout->setSpacing(SPACING);
+
myMoveRBtn = new QRadioButton(tr("MOVE_EXISTING_METHOD"), aMethodGrp);
myCreateRBtn = new QRadioButton(tr("CREATE_NEW_METHOD"), aMethodGrp);
+ aMethodGrpLayout->addWidget(myMoveRBtn);
+ aMethodGrpLayout->addWidget(myCreateRBtn);
+
// node ID
- myNodeToMoveGrp = new QGroupBox(tr("NODE_2MOVE"), aFrame, "anIdGrp");
+ myNodeToMoveGrp = new QGroupBox(tr("NODE_2MOVE"), aFrame);
- QLabel* idLabel = new QLabel(tr("NODE_2MOVE_ID"), myNodeToMoveGrp, "idLabel");
+ QLabel* idLabel = new QLabel(tr("NODE_2MOVE_ID"), myNodeToMoveGrp);
myIdBtn = new QPushButton(myNodeToMoveGrp);
- myIdBtn->setPixmap(iconSelect);
- myIdBtn->setToggleButton(TRUE);
- myId = new QLineEdit(myNodeToMoveGrp,"myId");
- myId->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
- myAutoSearchChkBox = new QCheckBox( tr("AUTO_SEARCH"), myNodeToMoveGrp, "myAutoSearchChkBox");
- myPreviewChkBox = new QCheckBox( tr("PREVIEW"), myNodeToMoveGrp, "myPreviewChkBox");
-
- myNodeToMoveGrp->setColumnLayout(0, Qt::Vertical);
- myNodeToMoveGrp->layout()->setSpacing(0);
- myNodeToMoveGrp->layout()->setMargin(0);
- QGridLayout* myNodeToMoveGrpLayout = new QGridLayout(myNodeToMoveGrp->layout());
- myNodeToMoveGrpLayout->setAlignment(Qt::AlignTop);
+ myIdBtn->setIcon(iconSelect);
+ myIdBtn->setCheckable(true);
+ myId = new QLineEdit(myNodeToMoveGrp);
+ myId->setValidator(new SMESHGUI_IdValidator(this, 1));
+ myAutoSearchChkBox = new QCheckBox( tr("AUTO_SEARCH"), myNodeToMoveGrp);
+ myPreviewChkBox = new QCheckBox( tr("PREVIEW"), myNodeToMoveGrp);
+
+ QGridLayout* myNodeToMoveGrpLayout = new QGridLayout(myNodeToMoveGrp);
myNodeToMoveGrpLayout->setSpacing(SPACING);
myNodeToMoveGrpLayout->setMargin(MARGIN);
+
myNodeToMoveGrpLayout->addWidget( idLabel, 0, 0 );
myNodeToMoveGrpLayout->addWidget( myIdBtn, 0, 1 );
myNodeToMoveGrpLayout->addWidget( myId, 0, 2 );
- myNodeToMoveGrpLayout->addMultiCellWidget( myAutoSearchChkBox, 1, 1, 0, 2 );
- myNodeToMoveGrpLayout->addMultiCellWidget( myPreviewChkBox, 2, 2, 0, 2 );
+ myNodeToMoveGrpLayout->addWidget( myAutoSearchChkBox, 1, 0, 1, 3 );
+ myNodeToMoveGrpLayout->addWidget( myPreviewChkBox, 2, 0, 1, 3 );
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
aLay->addWidget(aPixGrp);
connect(myIdBtn, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
connect(myAutoSearchChkBox, SIGNAL (toggled(bool)), this, SLOT(ButtonToggled(bool)));
- myMoveRBtn->setChecked(TRUE);
- myIdBtn->setOn(TRUE);
- myAutoSearchChkBox->setChecked(TRUE);
+ myMoveRBtn->setChecked(true);
+ myIdBtn->setDown(true);
+ myAutoSearchChkBox->setChecked(true);
return aFrame;
}
if ( aSender == myCoordBtn ) // button to set coord by node selection
{
if ( myIdBtn->isEnabled() )
- myIdBtn->setOn( !on );
+ myIdBtn->setDown( !on );
}
else if ( aSender == myIdBtn ) // button to select a node to move
{
- myCoordBtn->setOn( !on );
+ myCoordBtn->setDown( !on );
}
else if ( aSender == myMoveRBtn ) // move node method
{
- myNodeToMoveGrp->setEnabled( TRUE );
+ myNodeToMoveGrp->setEnabled( true );
}
else if ( aSender == myCreateRBtn ) // create node method
{
- myNodeToMoveGrp->setEnabled( FALSE );
- myCoordBtn->setOn( TRUE );
+ myNodeToMoveGrp->setEnabled( false );
+ myCoordBtn->setDown( true );
}
}
if ( aSender == myAutoSearchChkBox ) // automatic node search
{
if ( on ) {
myId->setText("");
- myId->setReadOnly ( TRUE );
- myIdBtn->setOn( FALSE );
- myIdBtn->setEnabled( FALSE );
- myCoordBtn->setOn( TRUE );
+ myId->setReadOnly ( true );
+ myIdBtn->setDown( false );
+ myIdBtn->setEnabled( false );
+ myCoordBtn->setDown( true );
}
else {
- myId->setReadOnly ( FALSE );
- myIdBtn->setEnabled( TRUE );
+ myId->setReadOnly ( false );
+ myIdBtn->setEnabled( true );
}
}
}
// SalomeApp_TypeFilter depends on a current study
if ( myFilter ) delete myFilter;
- QPtrList<SUIT_SelectionFilter> filters;
+ QList<SUIT_SelectionFilter*> filters;
filters.append( new SalomeApp_TypeFilter((SalomeApp_Study*)study(), "SMESH" ));
TColStd_MapOfInteger vertexType;
vertexType.Add( TopAbs_VERTEX );
return false;
if ( !myMeshActor ) {
- SUIT_MessageBox::warn1( dlg(), tr( "SMESH_WRN_WARNING" ),
- tr("INVALID_MESH"), tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ),
+ tr("INVALID_MESH") );
dlg()->show();
return false;
}
if ( !isValid() ) { // node id is invalid
- SUIT_MessageBox::warn1( dlg(), tr( "SMESH_WRN_WARNING" ),
- tr("INVALID_ID"), tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( dlg(), tr( "SMESH_WRN_WARNING" ),
+ tr("INVALID_ID") );
dlg()->show();
return false;
}
try {
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
if (aMesh->_is_nil()) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("SMESHG_NO_MESH"), QMessageBox::Ok);
+ SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
+ tr("SMESHG_NO_MESH") );
return true;
}
SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor();
return true;
int aResult = 0;
- if ( myDlg->myCreateRBtn->isOn() )
+ if ( myDlg->myCreateRBtn->isDown() )
{
aResult = aMeshEditor->AddNode(myDlg->myX->GetValue(),
myDlg->myY->GetValue(),
bool ok = true;
if ( myMeshActor &&
- myDlg->myMoveRBtn->isOn() &&
+ myDlg->myMoveRBtn->isDown() &&
!myDlg->myAutoSearchChkBox->isChecked() )
{
ok = false;
void SMESHGUI_MakeNodeAtPointOp::onSelectionDone()
{
- if ( !myDlg->isShown() || !myDlg->isEnabled() )
+ if ( !myDlg->isVisible() || !myDlg->isEnabled() )
return;
try {
SALOME_ListIO aList;
SMESH_Actor* aMeshActor = SMESH::FindActorByEntry(anIO->getEntry());
if (!aMeshActor) { // coord by geom
- if ( myDlg->myCoordBtn->isOn() ) {
+ if ( myDlg->myCoordBtn->isDown() ) {
GEOM::GEOM_Object_var geom = SMESH::IObjectToInterface<GEOM::GEOM_Object>(anIO);
if ( !geom->_is_nil() ) {
TopoDS_Vertex aShape;
if (SMDS_Mesh* aMesh = aMeshActor->GetObject()->GetMesh()) {
if (const SMDS_MeshNode* aNode = aMesh->FindNode(aString.toInt())) {
myNoPreview = true;
- if ( myDlg->myCoordBtn->isOn() ) { // set coord
+ if ( myDlg->myCoordBtn->isDown() ) { // set coord
myDlg->myX->SetValue(aNode->X());
myDlg->myY->SetValue(aNode->Y());
myDlg->myZ->SetValue(aNode->Z());
myNoPreview = false;
redisplayPreview();
}
- else if ( myDlg->myIdBtn->isOn() &&
+ else if ( myDlg->myIdBtn->isDown() &&
myDlg->myIdBtn->isEnabled() ) { // set node to move
myDlg->myId->setText(aString);
myNoPreview = false;
SMESH::MeshPreviewStruct_var aMeshPreviewStruct;
bool moveShown = false;
- if ( myDlg->myMoveRBtn->isOn() && // Move method
+ if ( myDlg->myMoveRBtn->isDown() && // Move method
myMeshActor)
{
const bool autoSearch = myDlg->myAutoSearchChkBox->isChecked();
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_MakeNodeAtPointDlg.h
+// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_MakeNodeAtPointDlg.h
-// Author : Edward AGAPOV
-// Module : SMESH
+#ifndef SMESHGUI_MAKENODEATPOINTDLG_H
+#define SMESHGUI_MAKENODEATPOINTDLG_H
-#ifndef SMESHGUI_MakeNodeAtPointDlg_H
-#define SMESHGUI_MakeNodeAtPointDlg_H
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Dialog.h"
#include "SMESHGUI_SelectionOp.h"
-#include "VTKViewer.h"
-
-class QFrame;
+class QGroupBox;
class QLineEdit;
class QPushButton;
-class LightApp_SelectionMgr;
-class SVTK_ViewWindow;
-class QButtonGroup;
-class SMESHGUI;
class QCheckBox;
class QRadioButton;
class SMESHGUI_SpinBox;
-class SALOME_Actor;
class SMESHGUI_MeshEditPreview;
class SMESHGUI_MakeNodeAtPointDlg;
/*!
* \brief Operation to make a mesh pass through a point
*/
-class SMESHGUI_MakeNodeAtPointOp: public SMESHGUI_SelectionOp
+class SMESHGUI_EXPORT SMESHGUI_MakeNodeAtPointOp: public SMESHGUI_SelectionOp
{
Q_OBJECT
virtual bool onApply();
private slots:
-
void onSelectionDone();
void redisplayPreview();
private:
-
SMESHGUI_MakeNodeAtPointDlg* myDlg;
SUIT_SelectionFilter* myFilter;
SMESHGUI_MeshEditPreview* mySimulation;
SMESH_Actor* myMeshActor;
bool myNoPreview;
-
};
/*!
* \brief Dialog to make a mesh pass through a point
*/
-class SMESHGUI_MakeNodeAtPointDlg : public SMESHGUI_Dialog
+class SMESHGUI_EXPORT SMESHGUI_MakeNodeAtPointDlg : public SMESHGUI_Dialog
{
Q_OBJECT
public:
- SMESHGUI_MakeNodeAtPointDlg();
+ SMESHGUI_MakeNodeAtPointDlg();
private:
-
- QFrame* createMainFrame (QWidget*);
-
- QPushButton* myCoordBtn;
- SMESHGUI_SpinBox *myX, *myY, *myZ;
- QRadioButton *myMoveRBtn, *myCreateRBtn;
- QGroupBox* myNodeToMoveGrp;
- QPushButton* myIdBtn;
- QLineEdit* myId;
- QCheckBox* myAutoSearchChkBox;
- QCheckBox* myPreviewChkBox;
-
- QString myHelpFileName;
+ QWidget* createMainFrame( QWidget* );
+
+ QPushButton* myCoordBtn;
+ SMESHGUI_SpinBox* myX;
+ SMESHGUI_SpinBox* myY;
+ SMESHGUI_SpinBox* myZ;
+ QRadioButton* myMoveRBtn;
+ QRadioButton* myCreateRBtn;
+ QGroupBox* myNodeToMoveGrp;
+ QPushButton* myIdBtn;
+ QLineEdit* myId;
+ QCheckBox* myAutoSearchChkBox;
+ QCheckBox* myPreviewChkBox;
+
+ QString myHelpFileName;
friend class SMESHGUI_MakeNodeAtPointOp;
private slots:
-
- void ButtonToggled (bool);
+ void ButtonToggled( bool );
};
-#endif
+#endif // SMESHGUI_MAKENODEATPOINTDLG_H
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_MergeNodesDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-
-#include "SMESHGUI_MergeNodesDlg.h"
-
-#include "SMESHGUI.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_VTKUtils.h"
-#include "SMESHGUI_IdValidator.h"
-#include "SMESHGUI_SpinBox.h"
-
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-#include "SMESHGUI_MeshUtils.h"
-#include "SMDS_Mesh.hxx"
-
-#include "GEOMBase.h"
-
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-
-#include "LightApp_Application.h"
-
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
-
-#include "utilities.h"
-
-// OCCT Includes
-#include <TColStd_MapOfInteger.hxx>
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qlistbox.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qheader.h>
-
-//IDL Headers
-#include CORBA_SERVER_HEADER(SMESH_Group)
-
-using namespace std;
-
-//=================================================================================
-// class : SMESHGUI_MergeNodesDlg()
-// purpose :
-//=================================================================================
-SMESHGUI_MergeNodesDlg::SMESHGUI_MergeNodesDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
-{
- QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_MERGE_NODES")));
- QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
-
- if (!name)
- setName("SMESHGUI_MergeNodesDlg");
- resize(303, 185);
- setCaption(tr("SMESH_MERGE_NODES"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_MergeNodesDlgLayout = new QGridLayout(this);
- SMESHGUI_MergeNodesDlgLayout->setSpacing(6);
- SMESHGUI_MergeNodesDlgLayout->setMargin(11);
-
- /***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupConstructors->sizePolicy().hasHeightForWidth()));
- GroupConstructors->setTitle(tr("SMESH_MERGE_NODES" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- QHBoxLayout* RBLayout = new QHBoxLayout(0, 0, 6, "Layout2");
- RadioButton1= new QRadioButton(GroupConstructors, "RadioButton1");
- RadioButton1->setText(tr("" ));
- RadioButton1->setPixmap(image0);
- RBLayout->addWidget(RadioButton1);
- GroupConstructorsLayout->addLayout(RBLayout, 0, 0);
- SMESHGUI_MergeNodesDlgLayout->addWidget(GroupConstructors, 0, 0);
-
- /***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupButtons->sizePolicy().hasHeightForWidth()));
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_MergeNodesDlgLayout->addWidget(GroupButtons, 4, 0);
-
- /***************************************************************/
-
- // Controls for mesh defining
- GroupMesh = new QGroupBox(this, "GroupMesh");
- GroupMesh->setTitle(tr("SMESH_SELECT_WHOLE_MESH"));
- GroupMesh->setColumnLayout(0, Qt::Vertical);
- GroupMesh->layout()->setSpacing(0);
- GroupMesh->layout()->setMargin(0);
- GroupMeshLayout = new QGridLayout(GroupMesh->layout());
- GroupMeshLayout->setAlignment(Qt::AlignTop);
- GroupMeshLayout->setSpacing(6);
- GroupMeshLayout->setMargin(11);
-
- TextLabelName = new QLabel(GroupMesh, "TextLabelName");
- TextLabelName->setText(tr("SMESH_NAME"));
- GroupMeshLayout->addWidget(TextLabelName, 0, 0);
-
- SelectMeshButton = new QPushButton(GroupMesh, "SelectMeshButton");
- SelectMeshButton->setPixmap(image1);
- GroupMeshLayout->addWidget(SelectMeshButton, 0, 1);
-
- LineEditMesh = new QLineEdit(GroupMesh, "LineEditMesh");
- LineEditMesh->setReadOnly(true);
- GroupMeshLayout->addWidget(LineEditMesh, 0, 2);
-
- SMESHGUI_MergeNodesDlgLayout->addWidget(GroupMesh, 1, 0);
-
- // Controls for coincident nodes detecting
- GroupCoincident = new QGroupBox(this, "GroupCoincident");
- GroupCoincident->setTitle(tr("COINCIDENT_NODES"));
- GroupCoincident->setColumnLayout(0, Qt::Vertical);
- GroupCoincident->layout()->setSpacing(0);
- GroupCoincident->layout()->setMargin(0);
- QGridLayout* GroupCoincidentLayout = new QGridLayout(GroupCoincident->layout());
- GroupCoincidentLayout->setAlignment(Qt::AlignTop);
- GroupCoincidentLayout->setSpacing(6);
- GroupCoincidentLayout->setMargin(11);
-
- TextLabelTolerance = new QLabel(GroupCoincident, "TextLabelTolerance");
- TextLabelTolerance->setText(tr("SMESH_TOLERANCE"));
- GroupCoincidentLayout->addWidget(TextLabelTolerance, 0, 0);
-
- SpinBoxTolerance = new SMESHGUI_SpinBox(GroupCoincident, "SpinBoxTolerance");
- GroupCoincidentLayout->addWidget(SpinBoxTolerance, 0, 1);
-
- QPushButton* DetectButton = new QPushButton(GroupCoincident, "DetectButton");
- DetectButton->setText(tr("DETECT"));
- GroupCoincidentLayout->addWidget(DetectButton, 0, 2);
-
- ListCoincident = new QListView(GroupCoincident);
- ListCoincident->setSorting(-1);
- ListCoincident->addColumn("Nodes");
- ListCoincident->header()->hide();
-
- GroupCoincidentLayout->addMultiCellWidget(ListCoincident, 1, 1, 0, 1);
-
- SelectAllCB = new QCheckBox(GroupCoincident, "SelectAllCB");
- SelectAllCB->setText(tr("SELECT_ALL"));
- GroupCoincidentLayout->addWidget(SelectAllCB, 2, 0);
-
- SMESHGUI_MergeNodesDlgLayout->addWidget(GroupCoincident, 2, 0);
-
- // Controls for editing group of nodes
- GroupEdit = new QGroupBox(this, "GroupEdit");
- GroupEdit->setTitle(tr("EDIT_GROUP_OF_NODES"));
- GroupEdit->setColumnLayout(0, Qt::Vertical);
- GroupEdit->layout()->setSpacing(0);
- GroupEdit->layout()->setMargin(0);
- QGridLayout* GroupEditLayout = new QGridLayout(GroupEdit->layout());
- GroupEditLayout->setAlignment(Qt::AlignTop);
- GroupEditLayout->setSpacing(6);
- GroupEditLayout->setMargin(11);
-
- ListEdit = new QListBox(GroupEdit, "ListEdit");
- ListEdit->setColumnMode(QListBox::FitToHeight);
- ListEdit->setSelectionMode(QListBox::Extended);
- GroupEditLayout->addMultiCellWidget(ListEdit, 0, 2, 0, 0);
-
- QPushButton* AddButton = new QPushButton(GroupEdit, "AddButton");
- AddButton->setText(tr("SMESH_BUT_ADD"));
- GroupEditLayout->addWidget(AddButton, 0, 1);
-
- QPushButton* RemoveButton = new QPushButton(GroupEdit, "RemoveButton");
- RemoveButton->setText(tr("SMESH_BUT_REMOVE"));
- GroupEditLayout->addWidget(RemoveButton, 1, 1);
-
- QSpacerItem* spacer = new QSpacerItem(20, 200, QSizePolicy::Minimum, QSizePolicy::Expanding);
- GroupEditLayout->addItem(spacer, 2, 1);
-
- SMESHGUI_MergeNodesDlgLayout->addWidget(GroupEdit, 3, 0);
-
- /* Initialisations */
- SpinBoxTolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.1, 3);
- SpinBoxTolerance->SetValue(1e-05);
-
- RadioButton1->setChecked(TRUE);
-
- myEditCurrentArgument = (QWidget*)LineEditMesh;
-
- myActor = 0;
- mySubMeshOrGroup = SMESH::SMESH_subMesh::_nil();
-
- mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
-
- mySMESHGUI->SetActiveDialogBox((QDialog*)this);
-
- // Costruction of the logical filter
- SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
- SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
-
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
- if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
- if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
-
- myMeshOrSubMeshOrGroupFilter =
- new SMESH_LogicalFilter (aListOfFilters, SMESH_LogicalFilter::LO_OR);
-
- //myMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
-
- /* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
-
- connect(SelectMeshButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(DetectButton, SIGNAL (clicked()), this, SLOT(onDetect()));
- connect(ListCoincident, SIGNAL (selectionChanged()), this, SLOT(onSelectNodesGroup()));
- connect(ListCoincident, SIGNAL (pressed(QListViewItem*)), this, SLOT(updateControls()));
- connect(ListCoincident, SIGNAL (currentChanged(QListViewItem*)), this, SLOT(updateControls()));
- connect(SelectAllCB, SIGNAL(toggled(bool)), this, SLOT(onSelectAll(bool)));
- connect(ListEdit, SIGNAL (selectionChanged()), this, SLOT(onSelectNodesFromGroup()));
- connect(AddButton, SIGNAL (clicked()), this, SLOT(onAdd()));
- connect(RemoveButton, SIGNAL (clicked()), this, SLOT(onRemove()));
-
- connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- /* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
- this->show(); /* displays Dialog */
-
- resize(0,0);
- buttonOk->setEnabled(false);
- buttonApply->setEnabled(false);
-
- // Init Mesh field from selection
- SelectionIntoArgument();
-
- myHelpFileName = "merging_nodes_page.html";
-}
-
-//=================================================================================
-// function : ~SMESHGUI_MergeNodesDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-SMESHGUI_MergeNodesDlg::~SMESHGUI_MergeNodesDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : ClickOnApply()
-// purpose :
-//=================================================================================
-bool SMESHGUI_MergeNodesDlg::ClickOnApply()
-{
- if (mySMESHGUI->isActiveStudyLocked() || myMesh->_is_nil())
- return false;
-
- try {
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
-
- QApplication::setOverrideCursor(Qt::waitCursor);
- SMESH::array_of_long_array_var aGroupsOfNodes = new SMESH::array_of_long_array;
- aGroupsOfNodes->length(ListCoincident->childCount());
- QListViewItem* item = ListCoincident->firstChild();
-
- int anArrayNum = 0;
- while (item) {
- QStringList aListIds = QStringList("");
- if (((QCheckListItem*) item)->isOn())
- aListIds = QStringList::split(" ", item->text(0), false);
-
- SMESH::long_array_var anIds = new SMESH::long_array;
- anIds->length(aListIds.count());
-
- for (int i = 0; i < aListIds.count(); i++)
- anIds[i] = aListIds[i].toInt();
-
- aGroupsOfNodes[anArrayNum++] = anIds.inout();
-
- item = item->itemBelow();
- }
-
- aMeshEditor->MergeNodes (aGroupsOfNodes.inout());
- QApplication::restoreOverrideCursor();
- } catch(...) {
- }
-
- //mySelectionMgr->clearSelected();
- SMESH::UpdateView();
-
- onDetect();
- return true;
-}
-
-//=================================================================================
-// function : ClickOnOk()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::ClickOnOk()
-{
- if (ClickOnApply())
- ClickOnCancel();
-}
-
-//=================================================================================
-// function : ClickOnCancel()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::ClickOnCancel()
-{
- mySelectionMgr->clearFilters();
- //mySelectionMgr->clearSelected();
- SMESH::SetPointRepresentation(false);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- disconnect(mySelectionMgr, 0, this, 0);
- mySMESHGUI->ResetState();
- reject();
-}
-
-//=================================================================================
-// function : ClickOnHelp()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::ClickOnHelp()
-{
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
- else {
- QString platform;
-#ifdef WIN32
- platform = "winapplication";
-#else
- platform = "application";
-#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
- }
-}
-
-//=================================================================================
-// function : onEditNodesGroup()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::onEditNodesGroup()
-{
- if (ListCoincident->childCount() < 1)
- return;
-
- QString aNewIds = "";
-
- QListBoxItem* anItem;
- for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next())
- aNewIds+=QString(" %1").arg(anItem->text());
-
- ListCoincident->currentItem()->setText(0, aNewIds);
-}
-
-//=================================================================================
-// function : updateControls()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::updateControls()
-{
- if (ListCoincident->childCount() < 1) {
- SMESH::SetPointRepresentation(false);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- return;
- }
-
- bool hasChecked = false, hasUnchecked = false;
-
- QListViewItem* item = ListCoincident->firstChild();
-
- while (item && (!hasChecked || !hasUnchecked)) {
- if (((QCheckListItem*) item)->isOn())
- hasChecked = true;
- else
- hasUnchecked = true;
-
- item = item->itemBelow();
- }
-
- if (hasUnchecked)
- SelectAllCB->setChecked(false);
-
- bool enable = !(myMesh->_is_nil()) && hasChecked;
-
- buttonOk->setEnabled(enable);
- buttonApply->setEnabled(enable);
-}
-
-//=================================================================================
-// function : onDetect()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::onDetect()
-{
- if (myMesh->_is_nil())
- return;
-
- try {
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
-
- QApplication::setOverrideCursor(Qt::waitCursor);
- ListCoincident->clear();
- ListEdit->clear();
-
- SMESH::array_of_long_array_var aNodeGroups;
- if(!mySubMeshOrGroup->_is_nil())
- aMeshEditor->FindCoincidentNodesOnPart(mySubMeshOrGroup, SpinBoxTolerance->GetValue(), aNodeGroups);
- else
- aMeshEditor->FindCoincidentNodes(SpinBoxTolerance->GetValue(), aNodeGroups);
-
- for (int i = 0; i < aNodeGroups->length(); i++) {
- SMESH::long_array& aGroup = aNodeGroups[i];
-
- QString aNodeIds;
- for (int j = 0; j < aGroup.length(); j++)
- aNodeIds+=QString(" %1").arg(aGroup[j]);
-
- new QCheckListItem (ListCoincident, aNodeIds, QCheckListItem::CheckBox);
- }
- QApplication::restoreOverrideCursor();
- } catch(...) {
- }
-
- updateControls();
-}
-
-//=================================================================================
-// function : onSelectNodesGroup()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::onSelectNodesGroup()
-{
- if (!myActor)
- return;
-
- myEditCurrentArgument = (QWidget*)ListCoincident;
-
- QListViewItem* aSelectedItem = ListCoincident->selectedItem();
- if (!aSelectedItem)
- return;
-
- QStringList aListId = QStringList::split(" ", aSelectedItem->text(0), false);
-
- ListEdit->clear();
- ListEdit->insertStringList(aListId);
-
- //mySelectionMgr->clearSelected();
- //mySelectionMgr->AddIObject(myActor->getIO());
- SALOME_ListIO aList;
- aList.Append(myActor->getIO());
- mySelectionMgr->setSelectedObjects(aList, false);
-
- SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
-
- ListEdit->selectAll(true);
-}
-
-//=================================================================================
-// function : onSelectAll()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::onSelectAll (bool isToggled)
-{
- if (isToggled) {
- int aNbItems = 0;
- QListViewItem* item = ListCoincident->firstChild();
- while (item) {
- aNbItems++;
- if (!((QCheckListItem*) item)->isOn())
- ((QCheckListItem*) item)->setOn(true);
- item = item->itemBelow();
- }
-
- if (aNbItems) {
- buttonOk->setEnabled(true);
- buttonApply->setEnabled(true);
- }
- }
-}
-
-//=================================================================================
-// function : onSelectNodesFromGroup()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::onSelectNodesFromGroup()
-{
- if (!myActor)
- return;
-
- TColStd_MapOfInteger aIndexes;
- QListBoxItem* anItem;
- for (anItem = ListEdit->firstItem(); anItem != 0; anItem = anItem->next()) {
- if (anItem->isSelected()) {
- int anId = anItem->text().toInt();
- aIndexes.Add(anId);
- }
- }
-
- mySelector->AddOrRemoveIndex(myActor->getIO(), aIndexes, false);
- SALOME_ListIO aList;
- aList.Append(myActor->getIO());
- mySelectionMgr->setSelectedObjects(aList);
-}
-
-//=================================================================================
-// function : onAdd()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::onAdd()
-{
- if (!myActor)
- return;
-
- QString aListStr = "";
- int aNbNnodes = 0;
-
- aNbNnodes = SMESH::GetNameOfSelectedNodes(mySelector, myActor->getIO(), aListStr);
- if (aNbNnodes < 1)
- return;
-
- QStringList aNodes = QStringList::split(" ", aListStr);
- QListBoxItem* anItem = 0;
-
- for (QStringList::iterator it = aNodes.begin(); it != aNodes.end(); ++it) {
- anItem = ListEdit->findItem(*it, Qt::ExactMatch);
- if (!anItem) {
- anItem = new QListBoxText(*it);
- ListEdit->insertItem(anItem);
- }
- ListEdit->setSelected(anItem, true);
- }
-
- onEditNodesGroup();
-}
-
-//=================================================================================
-// function : onRemove()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::onRemove()
-{
- if (myEditCurrentArgument != (QWidget*)ListCoincident)
- return;
-
- for (int i = ListEdit->count(); i > 0; i--) {
- if (ListEdit->isSelected(i-1))
- ListEdit->removeItem(i-1);
- }
- onEditNodesGroup();
-}
-
-//=================================================================================
-// function : SetEditCurrentArgument()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::SetEditCurrentArgument()
-{
- QPushButton* send = (QPushButton*)sender();
-
- disconnect(mySelectionMgr, 0, this, 0);
- mySelectionMgr->clearSelected();
- mySelectionMgr->clearFilters();
-
- if (send == SelectMeshButton) {
- myEditCurrentArgument = (QWidget*)LineEditMesh;
- SMESH::SetPointRepresentation(false);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
- }
-
- myEditCurrentArgument->setFocus();
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- SelectionIntoArgument();
-}
-
-//=================================================================================
-// function : SelectionIntoArgument()
-// purpose : Called when selection as changed or other case
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::SelectionIntoArgument()
-{
- if (myEditCurrentArgument == (QWidget*)LineEditMesh) {
- QString aString = "";
- LineEditMesh->setText(aString);
-
- ListCoincident->clear();
- ListEdit->clear();
- myActor = 0;
-
- int nbSel = SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aString);
- if (nbSel != 1)
- return;
-
- SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type());
-
- Handle(SALOME_InteractiveObject) IO = aList.First();
- myMesh = SMESH::GetMeshByIO(IO);
-
- if (myMesh->_is_nil())
- return;
-
- myActor = SMESH::FindActorByEntry(IO->getEntry());
- if (!myActor)
- myActor = SMESH::FindActorByObject(myMesh);
- if(!myActor)
- return;
-
- mySubMeshOrGroup = SMESH::SMESH_IDSource::_nil();
-
- if ((!SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(IO)->_is_nil() || //SUBMESH OR GROUP
- !SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(IO)->_is_nil()) &&
- !SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO)->_is_nil())
- mySubMeshOrGroup = SMESH::IObjectToInterface<SMESH::SMESH_IDSource>(IO);
-
- LineEditMesh->setText(aString);
- }
-}
-
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::DeactivateActiveDialog()
-{
- if (GroupConstructors->isEnabled()) {
- GroupConstructors->setEnabled(false);
- GroupMesh->setEnabled(false);
- GroupCoincident->setEnabled(false);
- GroupEdit->setEnabled(false);
- GroupButtons->setEnabled(false);
- mySMESHGUI->ResetState();
- mySMESHGUI->SetActiveDialogBox(0);
- }
-}
-
-//=================================================================================
-// function : ActivateThisDialog()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::ActivateThisDialog()
-{
- /* Emit a signal to deactivate the active dialog */
- mySMESHGUI->EmitSignalDeactivateDialog();
- GroupConstructors->setEnabled(true);
- GroupMesh->setEnabled(true);
- GroupCoincident->setEnabled(true);
- GroupEdit->setEnabled(true);
- GroupButtons->setEnabled(true);
-
- mySMESHGUI->SetActiveDialogBox((QDialog*)this);
-
- SelectionIntoArgument();
-}
-
-//=================================================================================
-// function : enterEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::enterEvent (QEvent*)
-{
- if (!GroupConstructors->isEnabled())
- ActivateThisDialog();
-}
-
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent()
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_MergeNodesDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
-//=================================================================================
-// function : keyPressEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeNodesDlg::keyPressEvent( QKeyEvent* e )
-{
- QDialog::keyPressEvent( e );
- if ( e->isAccepted() )
- return;
-
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
-}
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_MergeNodesDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-
-#ifndef DIALOGBOX_MERGENODES_H
-#define DIALOGBOX_MERGENODES_H
-
-#include "SMESH_SMESHGUI.hxx"
-
-#include "LightApp_SelectionMgr.h"
-//#include "SMESH_TypeFilter.hxx"
-#include "SUIT_SelectionFilter.h"
-
-// QT Includes
-#include <qdialog.h>
-
-class QGridLayout;
-class QButtonGroup;
-class QGroupBox;
-class QLabel;
-class QLineEdit;
-class QPushButton;
-class QRadioButton;
-class QCheckBox;
-class QListView;
-class QListViewItem;
-class QListBox;
-class SMESHGUI;
-class SMESHGUI_SpinBox;
-class SMESH_Actor;
-class SVTK_ViewWindow;
-class SVTK_Selector;
-
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-
-
-//=================================================================================
-// class : SMESHGUI_MergeNodesDlg
-// purpose :
-//=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_MergeNodesDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- SMESHGUI_MergeNodesDlg( SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_MergeNodesDlg();
-
-private:
- void Init();
- void closeEvent( QCloseEvent* e );
- void enterEvent ( QEvent * ); /* mouse enter the QWidget */
- void hideEvent ( QHideEvent * ); /* ESC key */
- void keyPressEvent( QKeyEvent* e );
- void onEditNodesGroup();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- SVTK_Selector* mySelector;
-
- QWidget* myEditCurrentArgument;
-
- SMESH::SMESH_Mesh_var myMesh;
- SMESH::SMESH_IDSource_var mySubMeshOrGroup;
- SMESH_Actor* myActor;
- //Handle(SMESH_TypeFilter) myMeshOrSubMeshFilter;
- SUIT_SelectionFilter* myMeshOrSubMeshOrGroupFilter;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton1;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupMesh;
- QGroupBox* GroupCoincident;
- QGroupBox* GroupEdit;
- QLabel* TextLabelName;
- QLabel* TextLabelTolerance;
- QLineEdit* LineEditMesh;
- QPushButton* SelectMeshButton;
- QPushButton* DetectButton;
- QPushButton* AddButton;
- QPushButton* RemoveButton;
- QCheckBox* SelectAllCB;
- QListView* ListCoincident;
- QListBox* ListEdit;
- SMESHGUI_SpinBox* SpinBoxTolerance;
-
- QString myHelpFileName;
-
-private slots:
-
- void ClickOnOk();
- void ClickOnCancel();
- bool ClickOnApply();
- void ClickOnHelp();
- void updateControls();
- void onDetect();
- void onSelectNodesGroup();
- void onSelectAll(bool isToggled);
- void onSelectNodesFromGroup();
- void onAdd();
- void onRemove();
- void SetEditCurrentArgument();
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
-
-protected:
- QGridLayout* SMESHGUI_MergeNodesDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupMeshLayout;
- QGridLayout* GroupCoincidentLayout;
- QGridLayout* GroupEditLayout;
-};
-
-#endif // DIALOGBOX_MERGENODES_H
-// 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
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/**
-* SMESH SMESHGUI
-*
-* Copyright (C) 2005 CEA/DEN, EDF R&D
-*
-*
-*
-* File : SMESHGUI_MeshDlg.cxx
-* Author : Sergey LITONIN
-* Module : SMESH
-*/
+// File : SMESHGUI_MeshDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
+//
+// SMESH includes
#include "SMESHGUI_MeshDlg.h"
+// SALOME GUI includes
#include <SUIT_Session.h>
-
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qtabwidget.h>
-#include <qgroupbox.h>
-#include <qtoolbutton.h>
-#include <qiconset.h>
-#include <qstring.h>
-#include <qcombobox.h>
-#include <qpopupmenu.h>
-#include <qcursor.h>
-#include <qpushbutton.h>
+#include <SUIT_ResourceMgr.h>
+
+// Qt includes
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QLabel>
+#include <QTabWidget>
+#include <QGroupBox>
+#include <QToolButton>
+#include <QComboBox>
+#include <QMenu>
+#include <QCursor>
+#include <QPushButton>
+
+#define SPACING 6
+#define MARGIN 11
/*!
* \brief Tab for tab widget containing controls for definition of
*/
//================================================================================
SMESHGUI_MeshTab::SMESHGUI_MeshTab( QWidget* theParent )
-: QFrame( theParent ),
- myPopup( 0 )
+ : QFrame( theParent )
{
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
- QIconSet aCreateIcon( aResMgr->loadPixmap( "SMESH", tr( "ICON_HYPO" ) ) );
- QIconSet aEditIcon( aResMgr->loadPixmap( "SMESH", tr( "ICON_HYPO_EDIT" ) ) );
+ QIcon aCreateIcon( aResMgr->loadPixmap( "SMESH", tr( "ICON_HYPO" ) ) );
+ QIcon aEditIcon( aResMgr->loadPixmap( "SMESH", tr( "ICON_HYPO_EDIT" ) ) );
// Algorifm
QLabel* anAlgoLbl = new QLabel( tr( "ALGORITHM" ), this );
myHyp[ MainHyp ] = new QComboBox( this );
myHyp[ MainHyp ]->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myCreateHyp[ MainHyp ] = new QToolButton( this );
- myCreateHyp[ MainHyp ]->setIconSet( aCreateIcon );
+ myCreateHyp[ MainHyp ]->setIcon( aCreateIcon );
myEditHyp[ MainHyp ] = new QToolButton( this );
- myEditHyp[ MainHyp ]->setIconSet( aEditIcon );
+ myEditHyp[ MainHyp ]->setIcon( aEditIcon );
// Line
QFrame* aLine = new QFrame( this );
myHyp[ AddHyp ] = new QComboBox( this );
myHyp[ AddHyp ]->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
myCreateHyp[ AddHyp ] = new QToolButton( this );
- myCreateHyp[ AddHyp ]->setIconSet( aCreateIcon );
+ myCreateHyp[ AddHyp ]->setIcon( aCreateIcon );
myEditHyp[ AddHyp ] = new QToolButton( this );
- myEditHyp[ AddHyp ]->setIconSet( aEditIcon );
+ myEditHyp[ AddHyp ]->setIcon( aEditIcon );
// Fill layout
- QGridLayout* aLay = new QGridLayout( this, 5, 4, 5, 5 );
+ QGridLayout* aLay = new QGridLayout( this );
+ aLay->setMargin( MARGIN );
+ aLay->setSpacing( SPACING );
+
aLay->addWidget( anAlgoLbl, 0, 0 );
aLay->addWidget( myHyp[ Algo ], 0, 1 );
aLay->addWidget( aHypLbl, 1, 0 );
aLay->addWidget( myHyp[ MainHyp ], 1, 1 );
aLay->addWidget( myCreateHyp[ MainHyp ], 1, 2 );
aLay->addWidget( myEditHyp[ MainHyp ], 1, 3 );
- aLay->addMultiCellWidget( aLine, 2, 2, 0, 3 );
+ aLay->addWidget( aLine, 2, 0, 1, 4 );
aLay->addWidget( anAddHypLbl, 3, 0 );
aLay->addWidget( myHyp[ AddHyp ], 3, 1 );
aLay->addWidget( myCreateHyp[ AddHyp ], 3, 2 );
setAvailableHyps( AddHyp, QStringList() );
}
+//================================================================================
+/*!
+ * \brief Destructor
+ */
+//================================================================================
SMESHGUI_MeshTab::~SMESHGUI_MeshTab()
{
- if ( myPopup )
- delete myPopup;
}
//================================================================================
if ( theId == Algo )
{
myHyp[ Algo ]->clear();
- myHyp[ Algo ]->insertItem( tr( "NONE" ) );
- myHyp[ Algo ]->insertStringList( theHyps );
- myHyp[ Algo ]->setCurrentItem( 0 );
+ myHyp[ Algo ]->addItem( tr( "NONE" ) );
+ myHyp[ Algo ]->addItems( theHyps );
+ myHyp[ Algo ]->setCurrentIndex( 0 );
}
else {
myCreateHyp[ theId ]->setEnabled( enable );
if ( theId != Algo )
{
myHyp[ theId ]->clear();
- myHyp[ theId ]->insertItem( tr( "NONE" ) );
- myHyp[ theId ]->insertStringList( theHyps );
- myHyp[ theId ]->setCurrentItem( 0 );
+ myHyp[ theId ]->addItem( tr( "NONE" ) );
+ myHyp[ theId ]->addItems( theHyps );
+ myHyp[ theId ]->setCurrentIndex( 0 );
myHyp[ theId ]->setEnabled( !theHyps.isEmpty() );
myEditHyp[ theId ]->setEnabled( false );
}
//================================================================================
void SMESHGUI_MeshTab::addHyp( const int theId, const QString& theHyp )
{
- myHyp[ theId ]->insertItem( theHyp );
- myHyp[ theId ]->setCurrentItem( myHyp[ theId ]->count() - 1 );
+ myHyp[ theId ]->addItem( theHyp );
+ myHyp[ theId ]->setCurrentIndex( myHyp[ theId ]->count() - 1 );
myEditHyp[ theId ]->setEnabled( true );
myHyp[ theId ]->setEnabled( true );
}
const QString& theNewName )
{
if ( theIndex > 0 && theIndex < myHyp[ theId ]->count() )
- myHyp[ theId ]->changeItem( theNewName, theIndex );
+ myHyp[ theId ]->setItemText( theIndex, theNewName );
}
//================================================================================
{
if ( theIndex >= 0 && theIndex < myHyp[ theId ]->count() )
{
- myHyp[ theId ]->setCurrentItem( theIndex );
+ myHyp[ theId ]->setCurrentIndex( theIndex );
if ( myEditHyp[ theId ] )
myEditHyp[ theId ]->setEnabled( theIndex > 0 );
}
//================================================================================
int SMESHGUI_MeshTab::currentHyp( const int theId ) const
{
- return myHyp[ theId ]->currentItem();
+ return myHyp[ theId ]->currentIndex();
}
//================================================================================
//================================================================================
void SMESHGUI_MeshTab::onCreateHyp()
{
- const QObject* aSender = sender();
-
- if ( !myPopup )
- {
- myPopup = new QPopupMenu( 0 );
- connect( myPopup, SIGNAL( activated( int ) ), SLOT( onPopupItem( int ) ) );
- }
+ bool isMainHyp = sender() == myCreateHyp[ MainHyp ];
+
+ QMenu aPopup( this );
- QStringList aHypNames;
- if ( aSender == myCreateHyp[ MainHyp ] )
- {
- aHypNames = myAvailableHyps[ MainHyp ];
- myPopup->setName( "MainHypPopup" );
- }
- else
- {
- aHypNames = myAvailableHyps[ AddHyp ];
- myPopup->setName( "AddHypPopup" );
- }
-
- myPopup->clear();
+ QStringList aHypNames = isMainHyp ?
+ myAvailableHyps[ MainHyp ] : aHypNames = myAvailableHyps[ AddHyp ];
+
+ QList<QAction*> actions;
for ( int i = 0, n = aHypNames.count(); i < n; i++ )
- myPopup->insertItem( aHypNames[ i ], i );
+ actions.append( aPopup.addAction( aHypNames[ i ] ) );
- myPopup->exec( QCursor::pos() );
+ QAction* a = aPopup.exec( QCursor::pos() );
+ if ( a )
+ emit createHyp( isMainHyp ? MainHyp : AddHyp, actions.indexOf( a ) );
}
//================================================================================
{
const QObject* aSender = sender();
int aHypType = aSender == myEditHyp[ MainHyp ] ? MainHyp : AddHyp;
- emit editHyp( aHypType, myHyp[ aHypType ]->currentItem() - 1 ); // - 1 because there is NONE on the top
+ emit editHyp( aHypType, myHyp[ aHypType ]->currentIndex() - 1 ); // - 1 because there is NONE on the top
}
//================================================================================
}
}
-//================================================================================
-/*!
- * \brief Emits createHyp signal
- *
- * SLOT called when item of popup for hypothesis creation is activated. Emits
- * createHyp signal to notify operation obout this event
- */
-//================================================================================
-void SMESHGUI_MeshTab::onPopupItem( int theId )
-{
- const QObject* aSender = sender();
- if ( aSender )
- emit createHyp( strcmp( aSender->name(), "MainHypPopup" ) == 0 ? MainHyp : AddHyp, theId );
-}
-
//================================================================================
/*!
* \brief Resets all tab fields
{
for ( int i = Algo; i <= AddHyp; i++ )
{
- myHyp[ i ]->setCurrentItem( 0 );
+ myHyp[ i ]->setCurrentIndex( 0 );
if ( myEditHyp[ i ] )
myEditHyp[ i ]->setEnabled( false );
}
: SMESHGUI_Dialog( 0, false, true )
{
// Create top controls
-
- QGroupBox* aGrp = new QGroupBox( 3, Qt::Horizontal, mainFrame() );
- aGrp->setFrameStyle( QFrame::NoFrame );
- aGrp->setInsideMargin( 0 );
+
// name
- createObject( tr( "NAME" ), aGrp, Obj );
+ createObject( tr( "NAME" ), mainFrame(), Obj );
setNameIndication( Obj, OneName );
setReadOnly( Obj, false );
// mesh
- createObject( tr( "MESH" ), aGrp, Mesh );
+ createObject( tr( "MESH" ), mainFrame(), Mesh );
// geometry
- createObject( tr( "GEOMETRY" ), aGrp, Geom );
+ createObject( tr( "GEOMETRY" ), mainFrame(), Geom );
myGeomPopup = 0;
// Create tab widget
myTabWg->addTab( myTabs[ Dim0D ], tr( "DIM_0D" ) );
// Hypotheses Sets
- myHypoSetPopup = new QPopupMenu();
- QButton* aHypoSetButton = new QPushButton( mainFrame(), "aHypoSetButton");
- aHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
+ myHypoSetButton = new QToolButton( mainFrame() );
+ myHypoSetButton->setText( tr( "HYPOTHESES_SETS" ) );
+ myHypoSetButton->setEnabled( false );
// Fill layout
- QVBoxLayout* aLay = new QVBoxLayout( mainFrame(), 0, 5 );
- aLay->addWidget( aGrp );
- aLay->addItem( new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum) );
- aLay->addWidget( myTabWg );
- aLay->addWidget( aHypoSetButton );
+ QGridLayout* aLay = new QGridLayout( mainFrame() );
+ aLay->setMargin( 0 );
+ aLay->setSpacing( SPACING );
+
+ aLay->addWidget( objectWg( Obj, Label ), 0, 0 );
+ aLay->addWidget( objectWg( Obj, Btn ), 0, 1 );
+ aLay->addWidget( objectWg( Obj, Control ), 0, 2 );
+ aLay->addWidget( objectWg( Mesh, Label ), 1, 0 );
+ aLay->addWidget( objectWg( Mesh, Btn ), 1, 1 );
+ aLay->addWidget( objectWg( Mesh, Control ), 1, 2 );
+ aLay->addWidget( objectWg( Geom, Label ), 2, 0 );
+ aLay->addWidget( objectWg( Geom, Btn ), 2, 1 );
+ aLay->addWidget( objectWg( Geom, Control ), 2, 2 );
+ aLay->addWidget( myTabWg, 4, 0, 1, 3 );
+ aLay->addWidget( myHypoSetButton, 5, 0, 1, 3 );
+ aLay->setRowMinimumHeight( 3, 20 );
// Disable controls if necessary
setObjectShown( Mesh, false );
if ( theToCreate )
{
- setCaption( tr( "CREATE_MESH" ) );
+ setWindowTitle( tr( "CREATE_MESH" ) );
objectWg( Obj, Btn )->hide();
if ( theIsMesh )
- setCaption( tr( "CREATE_MESH" ) );
+ setWindowTitle( tr( "CREATE_MESH" ) );
else
{
- setCaption( tr( "CREATE_SUBMESH" ) );
+ setWindowTitle( tr( "CREATE_SUBMESH" ) );
setObjectShown( Mesh, true );
}
}
else
{
- setCaption( tr( "EDIT_MESH_SUBMESH" ) );
+ setWindowTitle( tr( "EDIT_MESH_SUBMESH" ) );
objectWg( Mesh, Btn )->hide();
objectWg( Geom, Btn )->hide();
}
-
- // Connect signals and slots
- connect( aHypoSetButton, SIGNAL( clicked() ), SLOT( onHypoSetButton() ) );
- connect( myHypoSetPopup, SIGNAL( activated( int ) ), SLOT( onHypoSetPopup( int ) ) );
}
SMESHGUI_MeshDlg::~SMESHGUI_MeshDlg()
{
- if ( myHypoSetPopup )
- delete myHypoSetPopup;
}
//================================================================================
//================================================================================
void SMESHGUI_MeshDlg::setCurrentTab( const int theId )
{
- myTabWg->setCurrentPage( Dim3D - theId );
+ myTabWg->setCurrentIndex( Dim3D - theId );
}
//================================================================================
bool enable = ( dim <= DIM );
if ( !enable )
myTabs[ dim ]->reset();
- myTabWg->setTabEnabled( myTabs[ dim ], enable );
+ myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ dim ] ), enable );
}
// deselect desabled tab
- if ( !myTabWg->isTabEnabled( myTabWg->currentPage() ))
+ if ( !myTabWg->isTabEnabled( myTabWg->currentIndex() ) )
setCurrentTab( DIM - 1 );
}
void SMESHGUI_MeshDlg::setHypoSets( const QStringList& theSets )
{
- myHypoSetPopup->clear();
+ QMenu* aHypoSetPopup = myHypoSetButton->menu();
+ if ( !aHypoSetPopup ) {
+ aHypoSetPopup = new QMenu( myHypoSetButton );
+ connect( aHypoSetPopup, SIGNAL( triggered( QAction* ) ), SLOT( onHypoSetPopup( QAction* ) ) );
+ myHypoSetButton->setMenu( aHypoSetPopup );
+ myHypoSetButton->setPopupMode( QToolButton::InstantPopup );
+ }
+ aHypoSetPopup->clear();
for ( int i = 0, n = theSets.count(); i < n; i++ ) {
- myHypoSetPopup->insertItem( theSets[ i ], i );
+ aHypoSetPopup->addAction( theSets[ i ] );
}
+ myHypoSetButton->setEnabled( !aHypoSetPopup->isEmpty() );
}
//================================================================================
*/
//================================================================================
-void SMESHGUI_MeshDlg::onHypoSetPopup( int theIndex )
+void SMESHGUI_MeshDlg::onHypoSetPopup( QAction* a )
{
- emit hypoSet( myHypoSetPopup->text( theIndex ));
+ emit hypoSet( a->text() );
}
-//================================================================================
-/*!
- * \brief Shows myHypoSetPopup
- */
-//================================================================================
-
-void SMESHGUI_MeshDlg::onHypoSetButton()
-{
- myHypoSetPopup->exec( QCursor::pos() );
-}
-
//================================================================================
/*!
* \brief Enable showing of the popup when Geometry selection btn is clicked
void SMESHGUI_MeshDlg::setGeomPopupEnabled( const bool enable )
{
- if ( QButton* selBtn = dynamic_cast<QButton*>( objectWg( Geom, Btn )))
+ if ( QToolButton* selBtn = qobject_cast<QToolButton*>( objectWg( Geom, Btn )))
{
disconnect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
if ( enable ) {
if ( ! myGeomPopup ) {
- myGeomPopup = new QPopupMenu();
- myGeomPopup->insertItem( tr("DIRECT_GEOM_SELECTION"), DIRECT_GEOM_INDEX );
- myGeomPopup->insertItem( tr("GEOM_BY_MESH_ELEM_SELECTION"), GEOM_BY_MESH_INDEX );
- connect( myGeomPopup, SIGNAL( activated( int ) ), SLOT( onGeomPopup( int ) ) );
+ myGeomPopup = new QMenu();
+ myGeomPopup->addAction( tr("DIRECT_GEOM_SELECTION") )->setData( DIRECT_GEOM_INDEX );
+ myGeomPopup->addAction( tr("GEOM_BY_MESH_ELEM_SELECTION") )->setData( GEOM_BY_MESH_INDEX );
+ connect( myGeomPopup, SIGNAL( triggered( QAction* ) ), SLOT( onGeomPopup( QAction* ) ) );
}
connect( selBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) ));
}
*/
//================================================================================
void SMESHGUI_MeshDlg::disableTab(const int theTabId) {
- myTabWg->setTabEnabled( myTabs[ theTabId ], false );
+ myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ), false );
}
//================================================================================
*/
//================================================================================
void SMESHGUI_MeshDlg::enableTab(const int theTabId) {
- myTabWg->setTabEnabled( myTabs[ theTabId ], true );
+ myTabWg->setTabEnabled( myTabWg->indexOf( myTabs[ theTabId ] ), true );
}
void SMESHGUI_MeshDlg::onGeomSelectionButton(bool isBtnOn)
myGeomPopup->exec( QCursor::pos() );
}
-void SMESHGUI_MeshDlg::onGeomPopup( int index )
+void SMESHGUI_MeshDlg::onGeomPopup( QAction* a )
{
- emit geomSelectionByMesh( index == GEOM_BY_MESH_INDEX );
+ emit geomSelectionByMesh( a->data().toInt() == GEOM_BY_MESH_INDEX );
}
-// 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
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/**
-* SMESH SMESHGUI
-*
-* Copyright (C) 2005 CEA/DEN, EDF R&D
-*
-*
-*
-* File : SMESHGUI_MeshDlg.h
-* Author : Sergey LITONIN
-* Module : SMESH
-*/
-
+// File : SMESHGUI_MeshDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_MeshDlg_H
-#define SMESHGUI_MeshDlg_H
+#ifndef SMESHGUI_MESHDLG_H
+#define SMESHGUI_MESHDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Dialog.h"
-#include <qframe.h>
-#include <qstringlist.h>
-#include <qmap.h>
+
+// Qt includes
+#include <QFrame>
+#include <QStringList>
+#include <QMap>
class SMESHGUI_MeshTab;
class QTabWidget;
-class QLineEdit;
class QComboBox;
class QToolButton;
-class QString;
-class QPopupMenu;
+class QMenu;
+class QAction;
/*!
* \brief Dialog for mech creation or editing
enum Dimensions { Dim0D = 0, Dim1D, Dim2D, Dim3D };
public:
- SMESHGUI_MeshDlg( const bool theToCreate, const bool theIsMesh );
+ SMESHGUI_MeshDlg( const bool, const bool );
virtual ~SMESHGUI_MeshDlg();
SMESHGUI_MeshTab* tab( const int ) const;
signals:
-
void hypoSet( const QString& );
void geomSelectionByMesh( bool );
private slots:
-
- void onHypoSetPopup( int );
- void onHypoSetButton();
- void onGeomPopup( int );
+ void onHypoSetPopup( QAction* );
+ void onGeomPopup( QAction* );
void onGeomSelectionButton( bool );
private:
-
- QMap< int, SMESHGUI_MeshTab* > myTabs;
- QTabWidget* myTabWg;
- QPopupMenu* myHypoSetPopup;
- QPopupMenu* myGeomPopup;
+ QMap<int, SMESHGUI_MeshTab*> myTabs;
+ QTabWidget* myTabWg;
+ QToolButton* myHypoSetButton;
+ QMenu* myGeomPopup;
};
/*!
void reset();
signals:
-
- void createHyp( const int theHypType, const int theIndex );
+ void createHyp( const int, const int );
//!< Emited when "Create hypothesis" button clicked
- void editHyp( const int theHypType, const int theIndex );
+ void editHyp( const int, const int );
//!< Emited when "Edit hypothesis" button clicked
- void selectAlgo( const int theIndex );
+ void selectAlgo( const int );
//!< Emited when an algorithm is selected
private slots:
-
void onCreateHyp();
void onEditHyp();
void onHyp( int );
void onPopupItem( int );
private:
+ QMap<int, QComboBox*> myHyp;
+ QMap<int, QToolButton*> myCreateHyp;
+ QMap<int, QToolButton*> myEditHyp;
- QMap< int, QComboBox* > myHyp;
- QMap< int, QToolButton* > myCreateHyp;
- QMap< int, QToolButton* > myEditHyp;
-
- QMap< int, QStringList > myAvailableHyps;
- QMap< int, QStringList > myExistingHyps;
-
- QPopupMenu* myPopup;
+ QMap<int, QStringList> myAvailableHyps;
+ QMap<int, QStringList> myExistingHyps;
};
-#endif
+#endif // SMESHGUI_MESHDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_MeshEditPreview.cxx
+// Author : Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_MeshEditPreview.cxx
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_MeshEditPreview.h"
-#include "VTKViewer_CellLocationsArray.h"
-#include "SVTK_ViewWindow.h"
-
-#include "SMESH_Actor.h"
-#include "SMESH_ActorUtils.h"
#include "SMESHGUI_VTKUtils.h"
-// VTK Includes
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+
+// SALOME GUI includes
+#include <VTKViewer_CellLocationsArray.h>
+#include <SVTK_ViewWindow.h>
+
+// VTK includes
#include <vtkPoints.h>
#include <vtkIdList.h>
#include <vtkCellArray.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
-// QT Includes
-#include <qcolor.h>
+// Qt includes
+#include <QColor>
-// IDL Headers
-#include "SALOMEconfig.h"
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace SMESH;
-
//================================================================================
/*!
* \brief Constructor
myPreviewActor->PickableOff();
vtkFloatingPointType anRGB[3];
- GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
+ SMESH::GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
SetColor( anRGB[0], anRGB[1], anRGB[2] );
myPreviewActor->SetMapper( aMapper );
int aNodePos = 0;
for ( int i = 0; i < anElemTypes.length(); i++ ) {
- const ElementSubType& anElementSubType = anElemTypes[i];
+ const SMESH::ElementSubType& anElementSubType = anElemTypes[i];
SMDSAbs_ElementType aType = SMDSAbs_ElementType(anElementSubType.SMDS_ElementType);
vtkIdType aNbNodes = anElementSubType.nbNodesInElement;
anIdList->SetNumberOfIds( aNbNodes );
void SMESHGUI_MeshEditPreview::SetVisibility (bool theVisibility)
{
myPreviewActor->SetVisibility(theVisibility);
- RepaintCurrentView();
+ SMESH::RepaintCurrentView();
}
//================================================================================
{
myPreviewActor->SetColor( R, G, B );
}
+
+//================================================================================
+/*!
+ * \brief Get preview actor
+ */
+//================================================================================
+SALOME_Actor* SMESHGUI_MeshEditPreview::GetActor() const
+{
+ return myPreviewActor;
+}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_MeshEditPreview.h
+// Author : Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_MeshEditPreview.cxx
-// Module : SMESH
-// $Header:
#ifndef SMESHGUI_MESHEDITPREVIEW_H
#define SMESHGUI_MESHEDITPREVIEW_H
+// SMESH includes
+#include "SMESH_SMESHGUI.hxx"
+
class SVTK_ViewWindow;
class vtkUnstructuredGrid;
class SALOME_Actor;
-namespace SMESH {
+
+namespace SMESH
+{
class MeshPreviewStruct;
}
/*!
* \brief Displayer of the mesh edition preview
*/
-class SMESHGUI_MeshEditPreview {
- SVTK_ViewWindow* myViewWindow;
+class SMESHGUI_EXPORT SMESHGUI_MeshEditPreview
+{
+ SVTK_ViewWindow* myViewWindow;
vtkUnstructuredGrid* myGrid;
- SALOME_Actor* myPreviewActor;
+ SALOME_Actor* myPreviewActor;
public:
-
- SMESHGUI_MeshEditPreview(SVTK_ViewWindow* theViewWindow);
+ SMESHGUI_MeshEditPreview( SVTK_ViewWindow* );
~SMESHGUI_MeshEditPreview();
- void SetData (const SMESH::MeshPreviewStruct* theMeshPreviewStruct);
-
- void SetVisibility (bool theVisibility);
-
- void SetColor(double R, double G, double B);
-
- SALOME_Actor* GetActor() { return myPreviewActor; }
-
+ void SetData( const SMESH::MeshPreviewStruct* );
+ void SetVisibility( bool );
+ void SetColor( double, double, double );
+ SALOME_Actor* GetActor() const;
};
-#endif
+#endif // SMESHGUI_MESHEDITPREVIEW_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_MeshInfosDlg.cxx
+// Author : Nicolas BARBEROU
//
-//
-// File : SMESHGUI_MeshInfosDlg.cxx
-// Author : Nicolas BARBEROU
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_MeshInfosDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-
-#include "LightApp_SelectionMgr.h"
-#include "LightApp_Application.h"
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOME_ListIO.hxx"
-
-#include "utilities.h"
-
-// QT Includes
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qframe.h>
-#include <qwidgetstack.h>
-#include <qlayout.h>
-#include <qmap.h>
-#include <qpushbutton.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_Application.h>
+#include <SALOME_ListIO.hxx>
+
+// SALOME KERNEL includes
+#include <SALOMEDSClient_Study.hxx>
+
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QFrame>
+#include <QStackedWidget>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QPushButton>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Group)
-using namespace std;
-
#define COLONIZE(str) (QString(str).contains(":") > 0 ? QString(str) : QString(str) + " :" )
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// function : SMESHGUI_MeshInfosDlg()
// purpose : Constructor
//=================================================================================
-SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg (SMESHGUI* theModule,
- const char* name,
- bool modal,
- WFlags fl):
- QDialog(SMESH::GetDesktop(theModule),
- name,
- modal,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
+SMESHGUI_MeshInfosDlg::SMESHGUI_MeshInfosDlg(SMESHGUI* theModule):
+ QDialog(SMESH::GetDesktop(theModule)),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule)
{
- if (!name)
- setName("SMESHGUI_MeshInfosDlg");
- setCaption(tr("SMESH_MESHINFO_TITLE"));
- setSizeGripEnabled(TRUE);
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle(tr("SMESH_MESHINFO_TITLE"));
+ setSizeGripEnabled(true);
myStartSelection = true;
myIsActiveWindow = true;
QVBoxLayout* aTopLayout = new QVBoxLayout(this);
- aTopLayout->setSpacing(6); aTopLayout->setMargin(11);
+ aTopLayout->setSpacing(SPACING); aTopLayout->setMargin(MARGIN);
// select button & label
QPixmap image0(SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH",tr("ICON_SELECT")));
- mySelectBtn = new QPushButton(this, "mySelectBtn");
- mySelectBtn->setPixmap(image0);
- mySelectBtn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+ mySelectBtn = new QPushButton(this);
+ mySelectBtn->setIcon(image0);
- mySelectLab = new QLabel(this, "mySelectLab");
- mySelectLab->setAlignment(AlignCenter);
+ mySelectLab = new QLabel(this);
+ mySelectLab->setAlignment(Qt::AlignCenter);
QFont fnt = mySelectLab->font(); fnt.setBold(true);
mySelectLab->setFont(fnt);
aSelectLayout->addWidget(mySelectLab);
// top widget stack
- myWGStack = new QWidgetStack(this);
+ myWGStack = new QStackedWidget(this);
// no valid selection
QWidget* myBadWidget = new QWidget(myWGStack);
QVBoxLayout* aBadLayout = new QVBoxLayout(myBadWidget);
- QLabel* myBadLab = new QLabel(tr("SMESH_BAD_SELECTION"), myBadWidget, "myBadLab");
+ QLabel* myBadLab = new QLabel(tr("SMESH_BAD_SELECTION"), myBadWidget);
myBadLab->setAlignment(Qt::AlignCenter);
myBadLab->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
aBadLayout->addWidget(myBadLab);
- myWGStack->addWidget(myBadWidget, 0);
+ myWGStack->addWidget(myBadWidget);
// mesh
myMeshWidget = new QWidget(myWGStack);
QGridLayout* aMeshLayout = new QGridLayout(myMeshWidget);
- aMeshLayout->setSpacing(6); aMeshLayout->setMargin(0);
+ aMeshLayout->setSpacing(SPACING); aMeshLayout->setMargin(0);
myWGStack->addWidget(myMeshWidget);
// --> name
- QLabel* myMeshNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), myMeshWidget, "myMeshNameLab");
- myMeshName = new QLabel(myMeshWidget, "myMeshName");
+ QLabel* myMeshNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), myMeshWidget);
+ myMeshName = new QLabel(myMeshWidget);
myMeshName->setMinimumWidth(100);
QFrame* line1 = new QFrame(myMeshWidget);
line1->setFrameStyle(QFrame::HLine | QFrame::Sunken);
// --> nodes
- QLabel* myMeshNbNodesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), myMeshWidget, "myMeshNbNodesLab");
- myMeshNbNodes = new QLabel(myMeshWidget, "myMeshNbNodes");
+ QLabel* myMeshNbNodesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), myMeshWidget);
+ myMeshNbNodes = new QLabel(myMeshWidget);
myMeshNbNodes->setMinimumWidth(100);
// --> header with orders
- QLabel* myMeshOrder0Lab = new QLabel(tr("SMESH_MESHINFO_ORDER0"), myMeshWidget, "myMeshOrder0Lab");
- QLabel* myMeshOrder1Lab = new QLabel(tr("SMESH_MESHINFO_ORDER1"), myMeshWidget, "myMeshOrder1Lab");
- QLabel* myMeshOrder2Lab = new QLabel(tr("SMESH_MESHINFO_ORDER2"), myMeshWidget, "myMeshOrder2Lab");
+ QLabel* myMeshOrder0Lab = new QLabel(tr("SMESH_MESHINFO_ORDER0"), myMeshWidget);
+ QLabel* myMeshOrder1Lab = new QLabel(tr("SMESH_MESHINFO_ORDER1"), myMeshWidget);
+ QLabel* myMeshOrder2Lab = new QLabel(tr("SMESH_MESHINFO_ORDER2"), myMeshWidget);
QFont fnti = myMeshOrder0Lab->font(); fnti.setItalic(true);
myMeshOrder0Lab->setFont(fnti);
myMeshOrder1Lab->setFont(fnti);
myMeshOrder2Lab->setFont(fnti);
// --> edges
- QLabel* myMeshNbEdgesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), myMeshWidget, "myMeshNbEdgesLab");
- myMeshNbEdges = new QLabel(myMeshWidget, "myMeshNbEdges");
+ QLabel* myMeshNbEdgesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), myMeshWidget);
+ myMeshNbEdges = new QLabel(myMeshWidget);
myMeshNbEdges->setMinimumWidth(100);
- myMeshNbEdges1 = new QLabel(myMeshWidget, "myMeshNbEdges1");
+ myMeshNbEdges1 = new QLabel(myMeshWidget);
myMeshNbEdges1->setMinimumWidth(100);
- myMeshNbEdges2 = new QLabel(myMeshWidget, "myMeshNbEdges2");
+ myMeshNbEdges2 = new QLabel(myMeshWidget);
myMeshNbEdges2->setMinimumWidth(100);
// --> faces
- myMeshFacesGroup = new QGroupBox(tr("SMESH_MESHINFO_FACES"), myMeshWidget, "myMeshFacesGroup");
- myMeshFacesGroup->setColumnLayout(0, Qt::Vertical);
- myMeshFacesGroup->layout()->setSpacing(0); myMeshFacesGroup->layout()->setMargin(0);
- QGridLayout* myMeshFacesGroupLayout = new QGridLayout(myMeshFacesGroup->layout());
- myMeshFacesGroupLayout->setAlignment(Qt::AlignTop);
- myMeshFacesGroupLayout->setSpacing(6); myMeshFacesGroupLayout->setMargin(11);
+ myMeshFacesGroup = new QGroupBox(tr("SMESH_MESHINFO_FACES"), myMeshWidget);
+ QGridLayout* myMeshFacesGroupLayout = new QGridLayout(myMeshFacesGroup);
+ myMeshFacesGroupLayout->setSpacing(SPACING); myMeshFacesGroupLayout->setMargin(MARGIN);
// --> faces --> total
- QLabel* myMeshNbFacesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), myMeshFacesGroup, "myMeshNbFacesLab");
+ QLabel* myMeshNbFacesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), myMeshFacesGroup);
myMeshNbFacesLab->setFont(fnt);
- myMeshNbFaces = new QLabel(myMeshFacesGroup, "myMeshNbFaces");
+ myMeshNbFaces = new QLabel(myMeshFacesGroup);
myMeshNbFaces->setMinimumWidth(100);
myMeshNbFaces->setFont(fnt);
- myMeshNbFaces1 = new QLabel(myMeshFacesGroup, "myMeshNbFaces1");
+ myMeshNbFaces1 = new QLabel(myMeshFacesGroup);
myMeshNbFaces1->setMinimumWidth(100);
myMeshNbFaces1->setFont(fnt);
- myMeshNbFaces2 = new QLabel(myMeshFacesGroup, "myMeshNbFaces2");
+ myMeshNbFaces2 = new QLabel(myMeshFacesGroup);
myMeshNbFaces2->setMinimumWidth(100);
myMeshNbFaces2->setFont(fnt);
// --> faces --> triangles
- QLabel* myMeshNbTrianglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), myMeshFacesGroup, "myMeshNbTrianglesLab");
- myMeshNbTriangles = new QLabel(myMeshFacesGroup, "myMeshNbTriangles");
+ QLabel* myMeshNbTrianglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TRIANGLES")), myMeshFacesGroup);
+ myMeshNbTriangles = new QLabel(myMeshFacesGroup);
myMeshNbTriangles->setMinimumWidth(100);
- myMeshNbTriangles1 = new QLabel(myMeshFacesGroup, "myMeshNbTriangles1");
+ myMeshNbTriangles1 = new QLabel(myMeshFacesGroup);
myMeshNbTriangles1->setMinimumWidth(100);
- myMeshNbTriangles2 = new QLabel(myMeshFacesGroup, "myMeshNbTriangles2");
+ myMeshNbTriangles2 = new QLabel(myMeshFacesGroup);
myMeshNbTriangles2->setMinimumWidth(100);
// --> faces --> quadrangles
- QLabel* myMeshNbQuadranglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), myMeshFacesGroup, "myMeshNbQuadranglesLab");
- myMeshNbQuadrangles = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles");
+ QLabel* myMeshNbQuadranglesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_QUADRANGLES")), myMeshFacesGroup);
+ myMeshNbQuadrangles = new QLabel(myMeshFacesGroup);
myMeshNbQuadrangles->setMinimumWidth(100);
- myMeshNbQuadrangles1 = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles1");
+ myMeshNbQuadrangles1 = new QLabel(myMeshFacesGroup);
myMeshNbQuadrangles1->setMinimumWidth(100);
- myMeshNbQuadrangles2 = new QLabel(myMeshFacesGroup, "myMeshNbQuadrangles2");
+ myMeshNbQuadrangles2 = new QLabel(myMeshFacesGroup);
myMeshNbQuadrangles2->setMinimumWidth(100);
// --> faces --> polygons
- QLabel* myMeshNbPolygonesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYGONES" ) ), myMeshFacesGroup, "myMeshNbPolygonesLab" );
- myMeshNbPolygones = new QLabel( myMeshFacesGroup, "myMeshNbPolygones" );
+ QLabel* myMeshNbPolygonesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYGONES" ) ), myMeshFacesGroup );
+ myMeshNbPolygones = new QLabel( myMeshFacesGroup );
myMeshNbPolygones->setMinimumWidth( 100 );
myMeshFacesGroupLayout->addWidget(myMeshNbFacesLab, 0, 0);
myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles, 2, 1);
myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles1, 2, 2);
myMeshFacesGroupLayout->addWidget(myMeshNbQuadrangles2, 2, 3);
- myMeshFacesGroupLayout->addWidget( myMeshNbPolygonesLab, 3, 0 );
- myMeshFacesGroupLayout->addWidget( myMeshNbPolygones, 3, 1 );
+ myMeshFacesGroupLayout->addWidget(myMeshNbPolygonesLab, 3, 0);
+ myMeshFacesGroupLayout->addWidget(myMeshNbPolygones, 3, 1);
// --> volumes
- myMeshVolumesGroup = new QGroupBox(tr("SMESH_MESHINFO_VOLUMES"), myMeshWidget, "myMeshVolumesGroup");
- myMeshVolumesGroup->setColumnLayout(0, Qt::Vertical);
- myMeshVolumesGroup->layout()->setSpacing(0); myMeshVolumesGroup->layout()->setMargin(0);
- QGridLayout* myMeshVolumesGroupLayout = new QGridLayout(myMeshVolumesGroup->layout());
- myMeshVolumesGroupLayout->setAlignment(Qt::AlignTop);
- myMeshVolumesGroupLayout->setSpacing(6); myMeshVolumesGroupLayout->setMargin(11);
+ myMeshVolumesGroup = new QGroupBox(tr("SMESH_MESHINFO_VOLUMES"), myMeshWidget);
+ QGridLayout* myMeshVolumesGroupLayout = new QGridLayout(myMeshVolumesGroup);
+ myMeshVolumesGroupLayout->setSpacing(SPACING); myMeshVolumesGroupLayout->setMargin(MARGIN);
// --> volumes --> total
- QLabel* myMeshNbVolumesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), myMeshVolumesGroup, "myMeshNbVolumesLab");
+ QLabel* myMeshNbVolumesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), myMeshVolumesGroup);
myMeshNbVolumesLab->setFont(fnt);
- myMeshNbVolumes = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes");
+ myMeshNbVolumes = new QLabel(myMeshVolumesGroup);
myMeshNbVolumes->setMinimumWidth(100);
myMeshNbVolumes->setFont(fnt);
- myMeshNbVolumes1 = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes1");
+ myMeshNbVolumes1 = new QLabel(myMeshVolumesGroup);
myMeshNbVolumes1->setMinimumWidth(100);
myMeshNbVolumes1->setFont(fnt);
- myMeshNbVolumes2 = new QLabel(myMeshVolumesGroup, "myMeshNbVolumes2");
+ myMeshNbVolumes2 = new QLabel(myMeshVolumesGroup);
myMeshNbVolumes2->setMinimumWidth(100);
myMeshNbVolumes2->setFont(fnt);
// --> volumes --> tetrahedrons
- QLabel* myMeshNbTetraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TETRAS")), myMeshVolumesGroup, "myMeshNbTetraLab");
- myMeshNbTetra = new QLabel(myMeshVolumesGroup, "myMeshNbTetra");
+ QLabel* myMeshNbTetraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TETRAS")), myMeshVolumesGroup);
+ myMeshNbTetra = new QLabel(myMeshVolumesGroup);
myMeshNbTetra->setMinimumWidth(100);
- myMeshNbTetra1 = new QLabel(myMeshVolumesGroup, "myMeshNbTetra1");
+ myMeshNbTetra1 = new QLabel(myMeshVolumesGroup);
myMeshNbTetra1->setMinimumWidth(100);
- myMeshNbTetra2 = new QLabel(myMeshVolumesGroup, "myMeshNbTetra2");
+ myMeshNbTetra2 = new QLabel(myMeshVolumesGroup);
myMeshNbTetra2->setMinimumWidth(100);
// --> volumes --> hexahedrons
- QLabel* myMeshNbHexaLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), myMeshVolumesGroup, "myMeshNbHexaLab");
- myMeshNbHexa = new QLabel(myMeshVolumesGroup, "myMeshNbHexa");
+ QLabel* myMeshNbHexaLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAS")), myMeshVolumesGroup);
+ myMeshNbHexa = new QLabel(myMeshVolumesGroup);
myMeshNbHexa->setMinimumWidth(100);
- myMeshNbHexa1 = new QLabel(myMeshVolumesGroup, "myMeshNbHexa1");
+ myMeshNbHexa1 = new QLabel(myMeshVolumesGroup);
myMeshNbHexa1->setMinimumWidth(100);
- myMeshNbHexa2 = new QLabel(myMeshVolumesGroup, "myMeshNbHexa2");
+ myMeshNbHexa2 = new QLabel(myMeshVolumesGroup);
myMeshNbHexa2->setMinimumWidth(100);
// --> volumes --> prisms
- QLabel* myMeshNbPrismLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PRISMS")), myMeshVolumesGroup, "myMeshNbPrismLab");
- myMeshNbPrism = new QLabel(myMeshVolumesGroup, "myMeshNbPrism");
+ QLabel* myMeshNbPrismLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PRISMS")), myMeshVolumesGroup);
+ myMeshNbPrism = new QLabel(myMeshVolumesGroup);
myMeshNbPrism->setMinimumWidth(100);
- myMeshNbPrism1 = new QLabel(myMeshVolumesGroup, "myMeshNbPrism1");
+ myMeshNbPrism1 = new QLabel(myMeshVolumesGroup);
myMeshNbPrism1->setMinimumWidth(100);
- myMeshNbPrism2 = new QLabel(myMeshVolumesGroup, "myMeshNbPrism2");
+ myMeshNbPrism2 = new QLabel(myMeshVolumesGroup);
myMeshNbPrism2->setMinimumWidth(100);
// --> volumes --> pyramids
- QLabel* myMeshNbPyraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PYRAS")), myMeshVolumesGroup, "myMeshNbPyraLab");
- myMeshNbPyra = new QLabel(myMeshVolumesGroup, "myMeshNbPyra");
+ QLabel* myMeshNbPyraLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_PYRAS")), myMeshVolumesGroup);
+ myMeshNbPyra = new QLabel(myMeshVolumesGroup);
myMeshNbPyra->setMinimumWidth(100);
- myMeshNbPyra1 = new QLabel(myMeshVolumesGroup, "myMeshNbPyra1");
+ myMeshNbPyra1 = new QLabel(myMeshVolumesGroup);
myMeshNbPyra1->setMinimumWidth(100);
- myMeshNbPyra2 = new QLabel(myMeshVolumesGroup, "myMeshNbPyra2");
+ myMeshNbPyra2 = new QLabel(myMeshVolumesGroup);
myMeshNbPyra2->setMinimumWidth(100);
// --> volumes --> polyherones
- QLabel* myMeshNbPolyhedronesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYEDRES" ) ), myMeshVolumesGroup, "myMeshNbPolyhedronLab" );
- myMeshNbPolyhedrones = new QLabel( myMeshVolumesGroup, "myMeshNbPolyhedrones" );
+ QLabel* myMeshNbPolyhedronesLab = new QLabel( COLONIZE( tr( "SMESH_MESHINFO_POLYEDRES" ) ), myMeshVolumesGroup );
+ myMeshNbPolyhedrones = new QLabel( myMeshVolumesGroup );
myMeshNbPolyhedrones->setMinimumWidth( 100 );
- myMeshVolumesGroupLayout->addWidget(myMeshNbVolumesLab, 0, 0);
- myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes, 0, 1);
- myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes1, 0, 2);
- myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes2, 0, 3);
- myMeshVolumesGroupLayout->addWidget(myMeshNbTetraLab, 1, 0);
- myMeshVolumesGroupLayout->addWidget(myMeshNbTetra, 1, 1);
- myMeshVolumesGroupLayout->addWidget(myMeshNbTetra1, 1, 2);
- myMeshVolumesGroupLayout->addWidget(myMeshNbTetra2, 1, 3);
- myMeshVolumesGroupLayout->addWidget(myMeshNbHexaLab, 2, 0);
- myMeshVolumesGroupLayout->addWidget(myMeshNbHexa, 2, 1);
- myMeshVolumesGroupLayout->addWidget(myMeshNbHexa1, 2, 2);
- myMeshVolumesGroupLayout->addWidget(myMeshNbHexa2, 2, 3);
- myMeshVolumesGroupLayout->addWidget(myMeshNbPrismLab, 3, 0);
- myMeshVolumesGroupLayout->addWidget(myMeshNbPrism, 3, 1);
- myMeshVolumesGroupLayout->addWidget(myMeshNbPrism1, 3, 2);
- myMeshVolumesGroupLayout->addWidget(myMeshNbPrism2, 3, 3);
- myMeshVolumesGroupLayout->addWidget(myMeshNbPyraLab, 4, 0);
- myMeshVolumesGroupLayout->addWidget(myMeshNbPyra, 4, 1);
- myMeshVolumesGroupLayout->addWidget(myMeshNbPyra1, 4, 2);
- myMeshVolumesGroupLayout->addWidget(myMeshNbPyra2, 4, 3);
- myMeshVolumesGroupLayout->addWidget( myMeshNbPolyhedronesLab, 5, 0 );
- myMeshVolumesGroupLayout->addWidget( myMeshNbPolyhedrones, 5, 1 );
-
- aMeshLayout->addWidget(myMeshNameLab, 0, 0);
- aMeshLayout->addWidget(myMeshName, 0, 1);
- aMeshLayout->addMultiCellWidget(line1, 1, 1, 0, 1);
- aMeshLayout->addWidget(myMeshNbNodesLab, 2, 0);
- aMeshLayout->addWidget(myMeshNbNodes, 2, 1);
- aMeshLayout->addWidget(myMeshOrder0Lab, 3, 1);
- aMeshLayout->addWidget(myMeshOrder1Lab, 3, 2);
- aMeshLayout->addWidget(myMeshOrder2Lab, 3, 3);
- aMeshLayout->addWidget(myMeshNbEdgesLab, 4, 0);
- aMeshLayout->addWidget(myMeshNbEdges, 4, 1);
- aMeshLayout->addWidget(myMeshNbEdges1, 4, 2);
- aMeshLayout->addWidget(myMeshNbEdges2, 4, 3);
- aMeshLayout->addMultiCellWidget(myMeshFacesGroup, 5, 5, 0, 3);
- aMeshLayout->addMultiCellWidget(myMeshVolumesGroup, 6, 6, 0, 3);
- aMeshLayout->addItem(new QSpacerItem(6, 6, QSizePolicy::Minimum, QSizePolicy::Expanding), 7, 0);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbVolumesLab, 0, 0);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes, 0, 1);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes1, 0, 2);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbVolumes2, 0, 3);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbTetraLab, 1, 0);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbTetra, 1, 1);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbTetra1, 1, 2);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbTetra2, 1, 3);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbHexaLab, 2, 0);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbHexa, 2, 1);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbHexa1, 2, 2);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbHexa2, 2, 3);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPrismLab, 3, 0);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPrism, 3, 1);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPrism1, 3, 2);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPrism2, 3, 3);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPyraLab, 4, 0);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPyra, 4, 1);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPyra1, 4, 2);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPyra2, 4, 3);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPolyhedronesLab, 5, 0);
+ myMeshVolumesGroupLayout->addWidget(myMeshNbPolyhedrones, 5, 1);
+
+ aMeshLayout->addWidget(myMeshNameLab, 0, 0);
+ aMeshLayout->addWidget(myMeshName, 0, 1);
+ aMeshLayout->addWidget(line1, 1, 0, 1, 2);
+ aMeshLayout->addWidget(myMeshNbNodesLab, 2, 0);
+ aMeshLayout->addWidget(myMeshNbNodes, 2, 1);
+ aMeshLayout->addWidget(myMeshOrder0Lab, 3, 1);
+ aMeshLayout->addWidget(myMeshOrder1Lab, 3, 2);
+ aMeshLayout->addWidget(myMeshOrder2Lab, 3, 3);
+ aMeshLayout->addWidget(myMeshNbEdgesLab, 4, 0);
+ aMeshLayout->addWidget(myMeshNbEdges, 4, 1);
+ aMeshLayout->addWidget(myMeshNbEdges1, 4, 2);
+ aMeshLayout->addWidget(myMeshNbEdges2, 4, 3);
+ aMeshLayout->addWidget(myMeshFacesGroup, 5, 0, 1, 4);
+ aMeshLayout->addWidget(myMeshVolumesGroup, 6, 0, 1, 4);
+ aMeshLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 7, 0);
// submesh
mySubMeshWidget = new QWidget(myWGStack);
QGridLayout* aSubMeshLayout = new QGridLayout(mySubMeshWidget);
- aSubMeshLayout->setSpacing(6); aSubMeshLayout->setMargin(0);
+ aSubMeshLayout->setSpacing(SPACING); aSubMeshLayout->setMargin(0);
myWGStack->addWidget(mySubMeshWidget);
// --> name
- QLabel* mySubMeshNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), mySubMeshWidget, "mySubMeshNameLab");
- mySubMeshName = new QLabel(mySubMeshWidget, "mySubMeshName");
+ QLabel* mySubMeshNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), mySubMeshWidget);
+ mySubMeshName = new QLabel(mySubMeshWidget);
mySubMeshName->setMinimumWidth(100);
QFrame* line2 = new QFrame(mySubMeshWidget);
line2->setFrameStyle(QFrame::HLine | QFrame::Sunken);
// --> nodes
- QLabel* mySubMeshNbNodesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), mySubMeshWidget, "mySubMeshNbNodesLab");
- mySubMeshNbNodes = new QLabel(mySubMeshWidget, "mySubMeshNbNodes");
+ QLabel* mySubMeshNbNodesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NODES")), mySubMeshWidget);
+ mySubMeshNbNodes = new QLabel(mySubMeshWidget);
mySubMeshNbNodes->setMinimumWidth(100);
// --> elements
- mySubMeshElementsGroup = new QGroupBox(tr("SMESH_MESHINFO_ELEMENTS"), mySubMeshWidget, "mySubMeshElementsGroup");
- mySubMeshElementsGroup->setColumnLayout(0, Qt::Vertical);
- mySubMeshElementsGroup->layout()->setSpacing(0); mySubMeshElementsGroup->layout()->setMargin(0);
- QGridLayout* mySubMeshElementsGroupLayout = new QGridLayout(mySubMeshElementsGroup->layout());
- mySubMeshElementsGroupLayout->setAlignment(Qt::AlignTop);
- mySubMeshElementsGroupLayout->setSpacing(6); mySubMeshElementsGroupLayout->setMargin(11);
+ mySubMeshElementsGroup = new QGroupBox(tr("SMESH_MESHINFO_ELEMENTS"), mySubMeshWidget);
+ QGridLayout* mySubMeshElementsGroupLayout = new QGridLayout(mySubMeshElementsGroup);
+ mySubMeshElementsGroupLayout->setSpacing(SPACING); mySubMeshElementsGroupLayout->setMargin(MARGIN);
// --> elements --> total
- QLabel* mySubMeshNbElementsLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), mySubMeshElementsGroup, "mySubMeshNbElementsLab");
+ QLabel* mySubMeshNbElementsLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TOTAL")), mySubMeshElementsGroup);
mySubMeshNbElementsLab->setFont(fnt);
- mySubMeshNbElements = new QLabel(mySubMeshElementsGroup, "mySubMeshNbElements");
+ mySubMeshNbElements = new QLabel(mySubMeshElementsGroup);
mySubMeshNbElements->setMinimumWidth(100);
mySubMeshNbElements->setFont(fnt);
// --> elements --> edges
- QLabel* mySubMeshNbEdgesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), mySubMeshElementsGroup, "mySubMeshNbEdgesLab");
- mySubMeshNbEdges = new QLabel(mySubMeshElementsGroup, "mySubMeshNbEdges");
+ QLabel* mySubMeshNbEdgesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_EDGES")), mySubMeshElementsGroup);
+ mySubMeshNbEdges = new QLabel(mySubMeshElementsGroup);
mySubMeshNbEdges->setMinimumWidth(100);
// --> elements --> faces
- QLabel* mySubMeshNbFacesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), mySubMeshElementsGroup, "mySubMeshNbFacesLab");
- mySubMeshNbFaces = new QLabel(mySubMeshElementsGroup, "mySubMeshNbFaces");
+ QLabel* mySubMeshNbFacesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_FACES")), mySubMeshElementsGroup);
+ mySubMeshNbFaces = new QLabel(mySubMeshElementsGroup);
mySubMeshNbFaces->setMinimumWidth(100);
// --> elements --> volumes
- QLabel* mySubMeshNbVolumesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), mySubMeshElementsGroup, "mySubMeshNbVolumesLab");
- mySubMeshNbVolumes = new QLabel(mySubMeshElementsGroup, "mySubMeshNbVolumes");
+ QLabel* mySubMeshNbVolumesLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_VOLUMES")), mySubMeshElementsGroup);
+ mySubMeshNbVolumes = new QLabel(mySubMeshElementsGroup);
mySubMeshNbVolumes->setMinimumWidth(100);
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbElementsLab, 0, 0);
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbVolumesLab, 3, 0);
mySubMeshElementsGroupLayout->addWidget(mySubMeshNbVolumes, 3, 1);
- aSubMeshLayout->addWidget(mySubMeshNameLab, 0, 0);
- aSubMeshLayout->addWidget(mySubMeshName, 0, 1);
- aSubMeshLayout->addMultiCellWidget(line2, 1, 1, 0, 1);
- aSubMeshLayout->addWidget(mySubMeshNbNodesLab, 2, 0);
- aSubMeshLayout->addWidget(mySubMeshNbNodes, 2, 1);
- aSubMeshLayout->addMultiCellWidget(mySubMeshElementsGroup, 3, 3, 0, 1);
- aSubMeshLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding), 4, 0);
+ aSubMeshLayout->addWidget(mySubMeshNameLab, 0, 0);
+ aSubMeshLayout->addWidget(mySubMeshName, 0, 1);
+ aSubMeshLayout->addWidget(line2, 1, 0, 1, 2);
+ aSubMeshLayout->addWidget(mySubMeshNbNodesLab, 2, 0);
+ aSubMeshLayout->addWidget(mySubMeshNbNodes, 2, 1);
+ aSubMeshLayout->addWidget(mySubMeshElementsGroup, 3, 0, 1, 2);
+ aSubMeshLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 4, 0);
// group
myGroupWidget = new QWidget(myWGStack);
QGridLayout* myGroupWidgetLayout = new QGridLayout(myGroupWidget);
- myGroupWidgetLayout->setSpacing(6); myGroupWidgetLayout->setMargin(0);
+ myGroupWidgetLayout->setSpacing(SPACING); myGroupWidgetLayout->setMargin(0);
myWGStack->addWidget(myGroupWidget);
// --> name
- QLabel* myGroupNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), myGroupWidget, "myGroupNameLab");
- myGroupName = new QLabel(myGroupWidget, "myGroupName");
+ QLabel* myGroupNameLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_NAME")), myGroupWidget);
+ myGroupName = new QLabel(myGroupWidget);
myGroupName->setMinimumWidth(100);
QFrame* line3 = new QFrame(myGroupWidget);
line3->setFrameStyle(QFrame::HLine | QFrame::Sunken);
// --> type
- QLabel* myGroupTypeLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TYPE")), myGroupWidget, "myGroupTypeLab");
- myGroupType = new QLabel(myGroupWidget, "myGroupType");
+ QLabel* myGroupTypeLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_TYPE")), myGroupWidget);
+ myGroupType = new QLabel(myGroupWidget);
myGroupType->setMinimumWidth(100);
// --> number of entities
- QLabel* myGroupNbLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_ENTITIES")), myGroupWidget, "myGroupNbLab");
- myGroupNb = new QLabel(myGroupWidget, "myGroupNb");
+ QLabel* myGroupNbLab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_ENTITIES")), myGroupWidget);
+ myGroupNb = new QLabel(myGroupWidget);
myGroupNb->setMinimumWidth(100);
- myGroupWidgetLayout->addWidget(myGroupNameLab, 0, 0);
- myGroupWidgetLayout->addWidget(myGroupName, 0, 1);
- myGroupWidgetLayout->addMultiCellWidget(line3, 1, 1, 0, 1);
- myGroupWidgetLayout->addWidget(myGroupTypeLab, 2, 0);
- myGroupWidgetLayout->addWidget(myGroupType, 2, 1);
- myGroupWidgetLayout->addWidget(myGroupNbLab, 3, 0);
- myGroupWidgetLayout->addWidget(myGroupNb, 3, 1);
- myGroupWidgetLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Minimum, QSizePolicy::Expanding), 4, 0);
+ myGroupWidgetLayout->addWidget(myGroupNameLab, 0, 0);
+ myGroupWidgetLayout->addWidget(myGroupName, 0, 1);
+ myGroupWidgetLayout->addWidget(line3, 1, 0, 1, 2);
+ myGroupWidgetLayout->addWidget(myGroupTypeLab, 2, 0);
+ myGroupWidgetLayout->addWidget(myGroupType, 2, 1);
+ myGroupWidgetLayout->addWidget(myGroupNbLab, 3, 0);
+ myGroupWidgetLayout->addWidget(myGroupNb, 3, 1);
+ myGroupWidgetLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), 4, 0);
// buttons
- myButtonsGroup = new QGroupBox(this, "myButtonsGroup");
- myButtonsGroup->setColumnLayout(0, Qt::Vertical);
- myButtonsGroup->layout()->setSpacing(0); myButtonsGroup->layout()->setMargin(0);
- QHBoxLayout* myButtonsGroupLayout = new QHBoxLayout(myButtonsGroup->layout());
- myButtonsGroupLayout->setAlignment(Qt::AlignTop);
- myButtonsGroupLayout->setSpacing(6); myButtonsGroupLayout->setMargin(11);
+ myButtonsGroup = new QGroupBox(this);
+ QHBoxLayout* myButtonsGroupLayout = new QHBoxLayout(myButtonsGroup);
+ myButtonsGroupLayout->setSpacing(SPACING); myButtonsGroupLayout->setMargin(MARGIN);
// buttons --> OK and Help buttons
- myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup, "myOkBtn");
- myOkBtn->setAutoDefault(TRUE); myOkBtn->setDefault(TRUE);
- myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup, "myHelpBtn");
- myHelpBtn->setAutoDefault(TRUE);
+ myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup);
+ myOkBtn->setAutoDefault(true); myOkBtn->setDefault(true);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup);
+ myHelpBtn->setAutoDefault(true);
myButtonsGroupLayout->addWidget(myOkBtn);
+ myButtonsGroupLayout->addSpacing(10);
myButtonsGroupLayout->addStretch();
myButtonsGroupLayout->addWidget(myHelpBtn);
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
- this->show();
-
// init dialog with current selection
onSelectionChanged();
if (!CORBA::is_nil(anObject)) {
SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow(anObject);
if (!aMesh->_is_nil()) {
- myWGStack->raiseWidget(myMeshWidget);
- setCaption(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
+ myWGStack->setCurrentWidget(myMeshWidget);
+ setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_OBJECT_MESH") + "]");
myMeshName->setText(aSO->GetName().c_str());
myMeshNbNodes->setNum((int)aMesh->NbNodes());
myMeshNbEdges->setNum((int)aMesh->NbEdges());
}
SMESH::SMESH_subMesh_var aSubMesh = SMESH::SMESH_subMesh::_narrow(anObject);
if (!aSubMesh->_is_nil()) {
- myWGStack->raiseWidget(mySubMeshWidget);
- setCaption(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_SUBMESH") + "]");
+ myWGStack->setCurrentWidget(mySubMeshWidget);
+ setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_SUBMESH") + "]");
mySubMeshName->setText(aSO->GetName().c_str());
mySubMeshNbNodes->setNum((int)aSubMesh->GetNumberOfNodes(true));
mySubMeshNbElements->setNum((int)aSubMesh->GetNumberOfElements());
}
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
if (!aGroup->_is_nil()) {
- myWGStack->raiseWidget(myGroupWidget);
- setCaption(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_GROUP") + "]");
+ myWGStack->setCurrentWidget(myGroupWidget);
+ setWindowTitle(tr("SMESH_MESHINFO_TITLE") + " [" + tr("SMESH_GROUP") + "]");
myGroupName->setText(aSO->GetName().c_str());
int aType = aGroup->GetType();
QString strType;
strType = "SMESH_MESHINFO_ALL_TYPES"; break;
}
- myGroupType->setText(tr(strType));
+ myGroupType->setText(tr(strType.toLatin1().data()));
myGroupNb->setNum((int)aGroup->Size());
return;
}
}
}
}
- myWGStack->raiseWidget(0);
- setCaption(tr("SMESH_MESHINFO_TITLE"));
+ myWGStack->setCurrentIndex(0);
+ setWindowTitle(tr("SMESH_MESHINFO_TITLE"));
}
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
-void SMESHGUI_MeshInfosDlg::closeEvent (QCloseEvent* e)
+void SMESHGUI_MeshInfosDlg::closeEvent(QCloseEvent* e)
{
mySMESHGUI->ResetState();
QDialog::closeEvent(e);
// function : windowActivationChange()
// purpose : called when window is activated/deactivated
//=================================================================================
-void SMESHGUI_MeshInfosDlg::windowActivationChange (bool oldActive)
+void SMESHGUI_MeshInfosDlg::windowActivationChange(bool oldActive)
{
QDialog::windowActivationChange(oldActive);
if (isActiveWindow() && myIsActiveWindow != isActiveWindow())
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_MeshInfosDlg.h
+// Author : Nicolas BARBEROU
//
-// File : SMESHGUI_MeshInfosDlg.h
-// Author : Nicolas BARBEROU
-// Module : SMESH
-// $Header$
#ifndef SMESHGUI_MESHINFOSDLG_H
#define SMESHGUI_MESHINFOSDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-// QT Includes
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
class QGroupBox;
class QLabel;
class QPushButton;
-class QWidgetStack;
+class QStackedWidget;
class LightApp_SelectionMgr;
class SMESHGUI;
class SMESHGUI_EXPORT SMESHGUI_MeshInfosDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_MeshInfosDlg( SMESHGUI* theModule,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0 );
- ~SMESHGUI_MeshInfosDlg();
+ SMESHGUI_MeshInfosDlg( SMESHGUI* );
+ ~SMESHGUI_MeshInfosDlg();
protected:
- void closeEvent( QCloseEvent* e );
- void keyPressEvent( QKeyEvent* e );
- void windowActivationChange( bool oldActive );
- void DumpMeshInfos();
+ void closeEvent( QCloseEvent* );
+ void keyPressEvent( QKeyEvent* );
+ void windowActivationChange( bool );
+ void DumpMeshInfos();
private slots:
- void onSelectionChanged();
- void DeactivateActiveDialog() ;
- void ActivateThisDialog();
- void onStartSelection();
- void onHelp();
+ void onSelectionChanged();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onStartSelection();
+ void onHelp();
private:
- SMESHGUI* mySMESHGUI;
- LightApp_SelectionMgr* mySelectionMgr;
- bool myStartSelection;
- bool myIsActiveWindow;
-
- QPushButton* mySelectBtn;
- QLabel* mySelectLab;
-
- QWidgetStack* myWGStack;
-
- QWidget* myMeshWidget;
- QLabel* myMeshName;
- QLabel* myMeshNbNodes;
- QLabel* myMeshNbEdges;
- QLabel* myMeshNbEdges1;
- QLabel* myMeshNbEdges2;
- QGroupBox* myMeshFacesGroup;
- QLabel* myMeshNbFaces;
- QLabel* myMeshNbFaces1;
- QLabel* myMeshNbFaces2;
- QLabel* myMeshNbTriangles;
- QLabel* myMeshNbTriangles1;
- QLabel* myMeshNbTriangles2;
- QLabel* myMeshNbQuadrangles;
- QLabel* myMeshNbQuadrangles1;
- QLabel* myMeshNbQuadrangles2;
- QLabel* myMeshNbPolygones;
- QGroupBox* myMeshVolumesGroup;
- QLabel* myMeshNbVolumes;
- QLabel* myMeshNbVolumes1;
- QLabel* myMeshNbVolumes2;
- QLabel* myMeshNbTetra;
- QLabel* myMeshNbTetra1;
- QLabel* myMeshNbTetra2;
- QLabel* myMeshNbHexa;
- QLabel* myMeshNbHexa1;
- QLabel* myMeshNbHexa2;
- QLabel* myMeshNbPyra;
- QLabel* myMeshNbPyra1;
- QLabel* myMeshNbPyra2;
- QLabel* myMeshNbPrism;
- QLabel* myMeshNbPrism1;
- QLabel* myMeshNbPrism2;
- QLabel* myMeshNbPolyhedrones;
-
- QWidget* mySubMeshWidget;
- QLabel* mySubMeshName;
- QLabel* mySubMeshNbNodes;
- QGroupBox* mySubMeshElementsGroup;
- QLabel* mySubMeshNbElements;
- QLabel* mySubMeshNbEdges;
- QLabel* mySubMeshNbFaces;
- QLabel* mySubMeshNbVolumes;
-
- QWidget* myGroupWidget;
- QLabel* myGroupName;
- QLabel* myGroupType;
- QLabel* myGroupNb;
-
- QGroupBox* myButtonsGroup;
- QPushButton* myOkBtn;
- QPushButton* myHelpBtn;
-
- QString myHelpFileName;
+ SMESHGUI* mySMESHGUI;
+ LightApp_SelectionMgr* mySelectionMgr;
+ bool myStartSelection;
+ bool myIsActiveWindow;
+
+ QPushButton* mySelectBtn;
+ QLabel* mySelectLab;
+
+ QStackedWidget* myWGStack;
+
+ QWidget* myMeshWidget;
+ QLabel* myMeshName;
+ QLabel* myMeshNbNodes;
+ QLabel* myMeshNbEdges;
+ QLabel* myMeshNbEdges1;
+ QLabel* myMeshNbEdges2;
+ QGroupBox* myMeshFacesGroup;
+ QLabel* myMeshNbFaces;
+ QLabel* myMeshNbFaces1;
+ QLabel* myMeshNbFaces2;
+ QLabel* myMeshNbTriangles;
+ QLabel* myMeshNbTriangles1;
+ QLabel* myMeshNbTriangles2;
+ QLabel* myMeshNbQuadrangles;
+ QLabel* myMeshNbQuadrangles1;
+ QLabel* myMeshNbQuadrangles2;
+ QLabel* myMeshNbPolygones;
+ QGroupBox* myMeshVolumesGroup;
+ QLabel* myMeshNbVolumes;
+ QLabel* myMeshNbVolumes1;
+ QLabel* myMeshNbVolumes2;
+ QLabel* myMeshNbTetra;
+ QLabel* myMeshNbTetra1;
+ QLabel* myMeshNbTetra2;
+ QLabel* myMeshNbHexa;
+ QLabel* myMeshNbHexa1;
+ QLabel* myMeshNbHexa2;
+ QLabel* myMeshNbPyra;
+ QLabel* myMeshNbPyra1;
+ QLabel* myMeshNbPyra2;
+ QLabel* myMeshNbPrism;
+ QLabel* myMeshNbPrism1;
+ QLabel* myMeshNbPrism2;
+ QLabel* myMeshNbPolyhedrones;
+
+ QWidget* mySubMeshWidget;
+ QLabel* mySubMeshName;
+ QLabel* mySubMeshNbNodes;
+ QGroupBox* mySubMeshElementsGroup;
+ QLabel* mySubMeshNbElements;
+ QLabel* mySubMeshNbEdges;
+ QLabel* mySubMeshNbFaces;
+ QLabel* mySubMeshNbVolumes;
+
+ QWidget* myGroupWidget;
+ QLabel* myGroupName;
+ QLabel* myGroupType;
+ QLabel* myGroupNb;
+
+ QGroupBox* myButtonsGroup;
+ QPushButton* myOkBtn;
+ QPushButton* myHelpBtn;
+
+ QString myHelpFileName;
};
#endif // SMESHGUI_MESHINFOSDLG_H
-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// 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
+// 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
//
-/**
-* SMESH SMESHGUI
-*
-* Copyright (C) 2005 CEA/DEN, EDF R&D
-*
-*
-*
-* File : SMESHGUI_MeshOp.h
-* Author : Sergey LITONIN
-* Module : SMESHGUI
-*/
+// File : SMESHGUI_MeshOp.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
+//
+// SMESH includes
#include "SMESHGUI_MeshOp.h"
+
+#include "SMESHGUI.h"
#include "SMESHGUI_MeshDlg.h"
#include "SMESHGUI_ShapeByMeshDlg.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESHGUI.h"
-
#include "SMESHGUI_HypothesesUtils.h"
#include "SMESHGUI_Hypotheses.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_GEOMGenUtils.h"
-#include "SMESHGUI_VTKUtils.h"
-
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_NumberFilter.hxx"
-
-#include CORBA_CLIENT_HEADER(SMESH_Gen)
-
-#include "GEOM_SelectionFilter.h"
-#include "GEOMBase.h"
-#include "GeometryGUI.h"
-
-#include "SalomeApp_Tools.h"
-#include "SalomeApp_Application.h"
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOMEDSClient_AttributeIOR.hxx"
-#include "SALOMEDSClient_AttributeName.hxx"
-#include "SALOMEDS_SComponent.hxx"
-#include "SALOMEDS_SObject.hxx"
-
-#include "LightApp_SelectionMgr.h"
-#include "LightApp_UpdateFlags.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_OverrideCursor.h"
-#include "SALOME_InteractiveObject.hxx"
-#include "SALOME_ListIO.hxx"
-
-#include "utilities.h"
-
-#include <qstringlist.h>
-#include <qlineedit.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_NumberFilter.hxx>
+
+// SALOME GEOM includes
+#include <GEOM_SelectionFilter.h>
+#include <GEOMBase.h>
+#include <GeometryGUI.h>
+
+// SALOME GUI includes
+#include <SalomeApp_Tools.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_UpdateFlags.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
+#include <SALOME_InteractiveObject.hxx>
+#include <SALOME_ListIO.hxx>
+
+// SALOME KERNEL includes
+#include <SALOMEDS_SComponent.hxx>
+#include <SALOMEDS_SObject.hxx>
+
+// Qt includes
+#include <QStringList>
+#include <QLineEdit>
+
+// OCCT includes
#include <TopoDS_Shape.hxx>
#include <TopExp_Explorer.hxx>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SMESH_Gen)
+
//================================================================================
/*!
* \brief Constructor
{
dlg()->show();
if ( aMess != "" )
- SUIT_MessageBox::warn1( myDlg,
- tr( "SMESH_WRN_WARNING" ), aMess, tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( myDlg, tr( "SMESH_WRN_WARNING" ), aMess );
return false;
}
{
if ( aMess == "" )
aMess = tr( "SMESH_OPERATION_FAILED" );
- SUIT_MessageBox::warn1( myDlg,
- tr( "SMESH_ERROR" ), aMess, tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( myDlg, tr( "SMESH_ERROR" ), aMess );
}
return aResult;
// mesh
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() );
+ _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
if (!pMesh) return false;
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
// check all selected shapes
QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
- for (; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) {
+ for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) {
QString aSubGeomEntry = (*aSubShapesIter);
- _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.latin1());
+ _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
if (!pSubGeom) return false;
GEOM::GEOM_Object_var aSubGeomVar =
{
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() );
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() );
+ _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
+ _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
if ( pMesh && pGeom ) {
GEOM::GEOM_Object_var geom = SMESH::SObjectToInterface<GEOM::GEOM_Object>( pGeom );
if ( !geom->_is_nil() ) {
int tag = -1;
switch ( geom->GetShapeType() ) {
- case GEOM::VERTEX: tag = SMESH::Tag_SubMeshOnVertex ; break;
- case GEOM::EDGE: tag = SMESH::Tag_SubMeshOnEdge ; break;
- case GEOM::WIRE: tag = SMESH::Tag_SubMeshOnWire ; break;
- case GEOM::FACE: tag = SMESH::Tag_SubMeshOnFace ; break;
- case GEOM::SHELL: tag = SMESH::Tag_SubMeshOnShell ; break;
- case GEOM::SOLID: tag = SMESH::Tag_SubMeshOnSolid ; break;
+ case GEOM::VERTEX: tag = SMESH::Tag_SubMeshOnVertex; break;
+ case GEOM::EDGE: tag = SMESH::Tag_SubMeshOnEdge; break;
+ case GEOM::WIRE: tag = SMESH::Tag_SubMeshOnWire; break;
+ case GEOM::FACE: tag = SMESH::Tag_SubMeshOnFace; break;
+ case GEOM::SHELL: tag = SMESH::Tag_SubMeshOnShell; break;
+ case GEOM::SOLID: tag = SMESH::Tag_SubMeshOnSolid; break;
case GEOM::COMPOUND: tag = SMESH::Tag_SubMeshOnCompound; break;
default:;
}
if ( pMesh->FindSubObject( tag, aSubmeshRoot ) )
{
_PTR(ChildIterator) smIter = aStudy->NewChildIterator( aSubmeshRoot );
- for (; smIter->More(); smIter->Next() )
+ for ( ; smIter->More(); smIter->Next() )
{
_PTR(SObject) aSmObj = smIter->Value();
if ( ! aSmObj->FindAttribute( anAttr, "AttributeIOR" ))
continue;
_PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSmObj);
- for (; anIter1->More(); anIter1->Next()) {
+ for ( ; anIter1->More(); anIter1->Next()) {
_PTR(SObject) pGeom2 = anIter1->Value();
if ( pGeom2->ReferencedObject( pGeom2 ) &&
pGeom2->GetID() == pGeom->GetID() )
//================================================================================
void SMESHGUI_MeshOp::selectionDone()
{
- if (!dlg()->isShown() || !myDlg->isEnabled())
+ if (!dlg()->isVisible() || !myDlg->isEnabled())
return;
SMESHGUI_SelectionOp::selectionDone();
//Check geometry for mesh
QString anObjEntry = myDlg->selectedObject(SMESHGUI_MeshDlg::Obj);
- _PTR(SObject) pObj = studyDS()->FindObjectID(anObjEntry.latin1());
+ _PTR(SObject) pObj = studyDS()->FindObjectID(anObjEntry.toLatin1().data());
if (pObj)
{
SMESH::SMESH_Mesh_var aMeshVar =
aSeq->length(aGEOMs.count());
QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
int iSubSh = 0;
- for (; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
+ for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
QString aSubGeomEntry = (*aSubShapesIter);
- _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.latin1());
+ _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
GEOM::GEOM_Object_var aSubGeomVar =
GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject());
aSeq[iSubSh] = aSubGeomVar;
} else {
// get geometry by selected sub-mesh
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.latin1() );
+ _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
if (!aGeomVar->_is_nil()) {
aSeq->length(1);
SMESH::SMESH_subMesh_var sm =
SMESH::SObjectToInterface<SMESH::SMESH_subMesh>( pSubmesh );
bool editSubmesh = ( !sm->_is_nil() &&
- SUIT_MessageBox::question2( myDlg, tr( "SMESH_WARNING" ),
- tr( "EDIT_SUBMESH_QUESTION"),
- tr( "SMESH_BUT_YES" ),
- tr( "SMESH_BUT_NO" ), 1, 0, 0 ));
+ SUIT_MessageBox::question( myDlg, tr( "SMESH_WARNING" ),
+ tr( "EDIT_SUBMESH_QUESTION"),
+ SUIT_MessageBox::Yes |
+ SUIT_MessageBox::No,
+ SUIT_MessageBox::No )
+ == SUIT_MessageBox::Yes );
if ( editSubmesh )
{
selectionMgr()->clearFilters();
// enable/disable popup for choice of geom selection way
bool enable = false;
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
- if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() )) {
+ if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
if ( !mesh->_is_nil() )
enable = ( shapeDim > 1 ) && ( mesh->NbEdges() > 0 );
}
// Name
- QString aMeshName = myDlg->objectText( SMESHGUI_MeshDlg::Obj );
- aMeshName = aMeshName.stripWhiteSpace();
- if ( aMeshName == "" )
+ QString aMeshName = myDlg->objectText( SMESHGUI_MeshDlg::Obj ).trimmed();
+ if ( aMeshName.isEmpty() )
{
theMess = myIsMesh ? tr( "NAME_OF_MESH_IS_EMPTY" ) : tr( "NAME_OF_SUBMESH_IS_EMPTY" );
return false;
{
QString aMeshEntry = myDlg->selectedObject
( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
- if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() )) {
+ if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface<SMESH::SMESH_Mesh>( pMesh );
if ( !mesh->_is_nil() && CORBA::is_nil( mesh->GetShapeToMesh() )) {
theMess = tr( "IMPORTED_MESH" );
theMess = tr( "GEOMETRY_OBJECT_IS_NOT_DEFINED" );
return false;
}
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() );
+ _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
if ( !pGeom || GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() )->_is_nil() )
{
theMess = tr( "GEOMETRY_OBJECT_IS_NULL" );
theMess = tr( "MESH_IS_NOT_DEFINED" );
return false;
}
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() );
+ _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
if ( !pMesh || SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() )->_is_nil() )
{
theMess = tr( "MESH_IS_NULL" );
{
_PTR(ChildIterator) anIter =
SMESH::GetActiveStudyDocument()->NewChildIterator( aHypRoot );
- for (; anIter->More(); anIter->Next() )
+ for ( ; anIter->More(); anIter->Next() )
{
_PTR(SObject) anObj = anIter->Value();
if ( isMesh ) // i.e. mesh or submesh
SMESH::SMESH_Hypothesis_var aHypVar = SMESH::SMESH_Hypothesis::_narrow( aVar );
if ( !aHypVar->_is_nil() )
{
- CORBA::String_var aHypType( aHypVar->GetName() );
- HypothesisData* aData = SMESH::GetHypothesisData( aHypType );
+ HypothesisData* aData = SMESH::GetHypothesisData( aHypVar->GetName() );
if ( ( theDim == -1 || aData->Dim.contains( theDim ) ) &&
( isCompatible ( theAlgoData, aData, theHypType )) &&
( isAux == aData->IsAux ))
const int nbColonsInMeshEntry = 3;
bool isSubMesh = myToCreate ?
!myIsMesh :
- myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ).contains(':') > nbColonsInMeshEntry;
+ myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ).count(':') > nbColonsInMeshEntry;
if ( isSubMesh )
{
QString anEntry = myDlg->selectedObject
( myToCreate ? SMESHGUI_MeshDlg::Mesh : SMESHGUI_MeshDlg::Obj );
- if ( _PTR(SObject) pObj = studyDS()->FindObjectID( anEntry.latin1() ))
+ if ( _PTR(SObject) pObj = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
{
CORBA::Object_ptr Obj = _CAST( SObject,pObj )->GetObject();
if ( myToCreate ) // mesh and geom may be selected
{
aMeshVar = SMESH::SMESH_Mesh::_narrow( Obj );
anEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
- if ( _PTR(SObject) pGeom = studyDS()->FindObjectID( anEntry.latin1() ))
+ if ( _PTR(SObject) pGeom = studyDS()->FindObjectID( anEntry.toLatin1().data() ))
aGeomVar= GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
}
else // edition: sub-mesh may be selected
}
if ( !aMeshVar->_is_nil() && !aGeomVar->_is_nil() )
- return SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType,
- aServerLib,
+ return SMESHGUI::GetSMESHGen()->GetHypothesisParameterValues( aHypType.toLatin1().data(),
+ aServerLib.toLatin1().data(),
aMeshVar,
aGeomVar );
}
// Main dialog must not update it's own selected objects in this case.
dlg()->deactivateAll();
- HypothesisData* aData = SMESH::GetHypothesisData(theTypeName.latin1());
+ HypothesisData* aData = SMESH::GetHypothesisData(theTypeName);
if (!aData)
return;
QStringList aHypNames;
TDim2Type2HypList::const_iterator aDimIter = myExistingHyps.begin();
- for (; aDimIter != myExistingHyps.end(); aDimIter++) {
- const TType2HypList& aType2HypList = aDimIter.data();
+ for ( ; aDimIter != myExistingHyps.end(); aDimIter++) {
+ const TType2HypList& aType2HypList = aDimIter.value();
TType2HypList::const_iterator aTypeIter = aType2HypList.begin();
- for (; aTypeIter != aType2HypList.end(); aTypeIter++) {
- const THypList& aHypList = aTypeIter.data();
+ for ( ; aTypeIter != aType2HypList.end(); aTypeIter++) {
+ const THypList& aHypList = aTypeIter.value();
THypList::const_iterator anIter = aHypList.begin();
- for (; anIter != aHypList.end(); anIter++) {
+ for ( ; anIter != aHypList.end(); anIter++) {
const THypItem& aHypItem = *anIter;
const QString& aHypName = aHypItem.second;
aHypNames.append(aHypName);
if ( aHyp->_is_nil() )
return;
- CORBA::String_var aTypeName = aHyp->GetName();
- SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aTypeName );
+ SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aHyp->GetName() );
if ( aCreator ) {
myDlg->setEnabled( false );
aCreator->edit( aHyp.in(), aHypItem.second, dlg() );
}
HypothesisData* prevAlgo = algoData;
bool noCompatible = false;
- for (; dim * dir <= lastDim * dir; dim += dir)
+ for ( ; dim * dir <= lastDim * dir; dim += dir)
{
if ( !isAccessibleDim( dim ))
continue;
noCompatible = anAvailable.isEmpty();
// restore previously selected algo
- algoIndex = myAvailableHypData[dim][Algo].findIndex( curAlgo );
+ algoIndex = myAvailableHypData[dim][Algo].indexOf( curAlgo );
if ( !isSubmesh && algoIndex < 0 && soleCompatible && !forward && dim != SMESH::DIM_0D)
// select the sole compatible algo
- algoIndex = myAvailableHypData[dim][Algo].findIndex( soleCompatible );
+ algoIndex = myAvailableHypData[dim][Algo].indexOf( soleCompatible );
setCurrentHyp( dim, Algo, algoIndex );
// remember current algo
myObjHyps[ dim ][ type ].count() > 0 &&
curHypType == myObjHyps[ dim ][ type ].first().first->GetName())
{
- CORBA::String_var aName = curHyp->GetName();
- HypothesisData* hypData = SMESH::GetHypothesisData( aName );
+ HypothesisData* hypData = SMESH::GetHypothesisData( curHyp->GetName() );
for (int i = 0; i < myAvailableHypData[ dim ][ Algo ].count(); ++i) {
curAlgo = myAvailableHypData[ dim ][ Algo ][ i ];
if (curAlgo && hypData && isCompatible(curAlgo, hypData, type))
{
// check if a selected hyp is compatible with the curAlgo
if ( !curHyp->_is_nil() ) {
- CORBA::String_var aName = curHyp->GetName();
- HypothesisData* hypData = SMESH::GetHypothesisData( aName );
+ HypothesisData* hypData = SMESH::GetHypothesisData( curHyp->GetName() );
if ( !isCompatible( curAlgo, hypData, type ))
curHyp = SMESH::SMESH_Hypothesis::_nil();
}
int aDim = aHypData->Dim[0];
// create or/and set
if (isAlgo) {
- int index = myAvailableHypData[aDim][Algo].findIndex( aHypData );
+ int index = myAvailableHypData[aDim][Algo].indexOf( aHypData );
if ( index < 0 ) {
QStringList anAvailable;
availableHyps( aDim, Algo, anAvailable, myAvailableHypData[aDim][Algo] );
myDlg->tab( aDim )->setAvailableHyps( Algo, anAvailable );
- index = myAvailableHypData[aDim][Algo].findIndex( aHypData );
+ index = myAvailableHypData[aDim][Algo].indexOf( aHypData );
}
setCurrentHyp( aDim, Algo, index );
onAlgoSelected( index, aDim );
QStringList anAvailable;
availableHyps( aDim, MainHyp, anAvailable, myAvailableHypData[aDim][MainHyp] );
myDlg->tab( aDim )->setAvailableHyps( MainHyp, anAvailable );
- int index = myAvailableHypData[aDim][MainHyp].findIndex( aHypData );
+ int index = myAvailableHypData[aDim][MainHyp].indexOf( aHypData );
if ( index < 0 ) {
mainHyp = false;
- index = myAvailableHypData[aDim][AddHyp].findIndex( aHypData );
+ index = myAvailableHypData[aDim][AddHyp].indexOf( aHypData );
}
if (index >= 0)
createHypothesis(aDim, mainHyp ? MainHyp : AddHyp, aHypoTypeName);
QStringList aList;
myDlg->selectedObject( SMESHGUI_MeshDlg::Geom, aList );
QStringList::Iterator it = aList.begin();
- for (; it!=aList.end(); it++)
+ for ( ; it!=aList.end(); it++)
{
QString aGeomEntry = *it;
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() );
+ _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
GEOM::GEOM_Object_var aGeomVar =
GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
return false;
_PTR(SObject) aMeshSO = SMESH::FindSObject( aMeshVar.in() );
if ( aMeshSO )
- SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ).latin1() );
+ SMESH::SetName( aMeshSO, myDlg->objectText( SMESHGUI_MeshDlg::Obj ) );
for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ ) {
if ( !isAccessibleDim( aDim )) continue;
// get mesh object
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
- _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() );
+ _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() );
SMESH::SMESH_Mesh_var aMeshVar =
SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
if (aMeshVar->_is_nil())
{
//QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
QString aGeomEntry = aGEOMs.first();
- _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() );
+ _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.toLatin1().data() );
aGeomVar = GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() );
}
else if (aGEOMs.count() > 1)
GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
aSeq->length(aGEOMs.count());
QStringList::const_iterator aSubShapesIter = aGEOMs.begin();
- for (; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
+ for ( ; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) {
QString aSubGeomEntry = (*aSubShapesIter);
- _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.latin1());
+ _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.toLatin1().data());
GEOM::GEOM_Object_var aSubGeomVar =
GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject());
TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aSubGeomVar->GetShapeType();
QString aNewGeomGroupName ("Auto_group_for_");
aNewGeomGroupName += aName;
SALOMEDS::SObject_var aNewGroupSO =
- geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar, aNewGeomGroupName, mainGeom);
+ geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar,
+ aNewGeomGroupName.toLatin1().data(), mainGeom);
}
}
}
SUIT_OverrideCursor aWaitCursor;
// create sub-mesh
- SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.latin1() );
+ SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.toLatin1().data() );
for ( int aDim = SMESH::DIM_0D; aDim <= SMESH::DIM_3D; aDim++ )
{
do
{
aResName = aPrefix + QString::number( i++ );
- anObj = aStudy->FindObject( aResName.latin1() );
+ anObj = aStudy->FindObject( aResName.toLatin1().data() );
}
while ( anObj );
// look for anexisting algo of such a type
THypList& aHypVarList = myExistingHyps[ theDim ][ Algo ];
THypList::iterator anIter = aHypVarList.begin();
- for (; anIter != aHypVarList.end(); anIter++)
+ for ( ; anIter != aHypVarList.end(); anIter++)
{
SMESH::SMESH_Hypothesis_var aHypVar = (*anIter).first;
CORBA::String_var aName = aHypVar->GetName();
void SMESHGUI_MeshOp::readMesh()
{
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.latin1() );
+ _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
if ( !pObj )
return;
if ( myObjHyps[ dim ][ Algo ].count() > 0 )
{
SMESH::SMESH_Hypothesis_var aVar = myObjHyps[ dim ][ Algo ].first().first;
- CORBA::String_var aHypTypeName = aVar->GetName();
- HypothesisData* algoData = SMESH::GetHypothesisData( aHypTypeName );
- aHypIndex = myAvailableHypData[ dim ][ Algo ].findIndex ( algoData );
+ HypothesisData* algoData = SMESH::GetHypothesisData( aVar->GetName() );
+ aHypIndex = myAvailableHypData[ dim ][ Algo ].indexOf ( algoData );
// if ( aHypIndex < 0 && algoData ) {
// // assigned algo is incompatible with other algorithms
// myAvailableHypData[ dim ][ Algo ].push_back( algoData );
{
int i = 0;
THypList::const_iterator anIter = theHypList.begin();
- for (; anIter != theHypList.end(); ++ anIter)
+ for ( ; anIter != theHypList.end(); ++ anIter)
{
if ( theHyp->_is_equivalent( (*anIter).first ) )
{
return false;
QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
- _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.latin1() );
+ _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
if ( !pObj )
return false;
// Set new name
QString aName = myDlg->objectText( SMESHGUI_MeshDlg::Obj );
- SMESH::SetName( pObj, aName.latin1() );
+ SMESH::SetName( pObj, aName );
int aDim = ( myIsOnGeometry ) ? SMESH::DIM_0D : SMESH::DIM_3D;
// First, remove old algos in order to avoid messages on algorithm hiding
// remove old hypotheses
if ( myObjHyps[ dim ][ hypType ].count() > 0 )
{
- anOldHypIndex = find( myObjHyps[ dim ][ hypType ].first().first ,
+ anOldHypIndex = find( myObjHyps[ dim ][ hypType ].first().first,
myExistingHyps[ dim ][ hypType ] );
if ( aNewHypIndex != anOldHypIndex || // different hyps
anOldHypIndex == -1 ) // hyps of different algos
}
// set mesh object to SMESHGUI_ShapeByMeshOp and start it
QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh );
- if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() )) {
+ if ( _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.toLatin1().data() )) {
SMESH::SMESH_Mesh_var aMeshVar =
SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() );
if ( !aMeshVar->_is_nil() ) {
if ( !aGeomVar->_is_nil() )
{
QString ID = aGeomVar->GetStudyEntry();
- if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID.latin1() )) {
+ if ( _PTR(SObject) aGeomSO = studyDS()->FindObjectID( ID.toLatin1().data() )) {
selectObject( aGeomSO );
selectionDone();
}
-// 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
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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.
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
+// 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-/**
-* SMESH SMESHGUI
-*
-* Copyright (C) 2005 CEA/DEN, EDF R&D
-*
-*
-*
-* File : SMESHGUI_MeshOp.h
-* Author : Sergey LITONIN
-* Module : SMESHGUI
-*/
+// File : SMESHGUI_MeshOp.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_MeshOp_H
-#define SMESHGUI_MeshOp_H
+#ifndef SMESHGUI_MESHOP_H
+#define SMESHGUI_MESHOP_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_SelectionOp.h"
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(GEOM_Gen)
-#include CORBA_CLIENT_HEADER(SMESH_Mesh)
-
-#include <qstringlist.h>
-
class SMESHGUI_MeshDlg;
class SMESHGUI_ShapeByMeshOp;
class HypothesisData;
Q_OBJECT
public:
-
enum HypType{ Algo = 0, MainHyp, AddHyp, NbHypTypes };
typedef std::pair<SMESH::SMESH_Hypothesis_var, QString> THypItem;
- typedef QValueList< THypItem > THypList;
+ typedef QList< THypItem > THypList;
typedef int THypType;
typedef QMap< THypType, THypList > TType2HypList;
typedef int THypDim;
typedef QMap< THypDim, TType2HypList > TDim2Type2HypList;
- SMESHGUI_MeshOp( const bool theToCreate, const bool theIsMesh = true );
+public:
+ SMESHGUI_MeshOp( const bool, const bool = true );
virtual ~SMESHGUI_MeshOp();
virtual LightApp_Dialog* dlg() const;
protected slots:
virtual bool onApply();
- void onCreateHyp( const int theHypType, const int theIndex );
- void onEditHyp( const int theHypType, const int theIndex );
- void onHypoSet( const QString& theSetName );
+ void onCreateHyp( const int, const int );
+ void onEditHyp( const int, const int );
+ void onHypoSet( const QString& );
void onGeomSelectionByMesh( bool );
- void onPublishShapeByMeshDlg(SUIT_Operation*);
- void onCloseShapeByMeshDlg(SUIT_Operation*);
- void onAlgoSelected( const int theIndex,
- const int theDim = -1);
+ void onPublishShapeByMeshDlg( SUIT_Operation* );
+ void onCloseShapeByMeshDlg( SUIT_Operation* );
+ void onAlgoSelected( const int, const int = -1 );
private:
-
- typedef QValueList<HypothesisData*> THypDataList; // typedef: list of hypothesis data
+ typedef QList<HypothesisData*> THypDataList; // typedef: list of hypothesis data
bool isValid( QString& ) const;
- void availableHyps( const int theDim,
- const int theHypType,
- QStringList& theHyps,
- THypDataList& theDataList,
- HypothesisData* theAlgoData = 0 ) const;
- void existingHyps( const int theDim,
- const int theHypType,
- _PTR(SObject) theFather,
- QStringList& theHyps,
- THypList& theHypList,
- HypothesisData* theAlgoData = 0);
- HypothesisData* hypData( const int theDim,
- const int theHypType,
- const int theIndex); // access to myAvailableHypData
-
- void createHypothesis(const int theDim, const int theType,
- const QString& theTypeName);
+ void availableHyps( const int,
+ const int,
+ QStringList&,
+ THypDataList&,
+ HypothesisData* = 0 ) const;
+ void existingHyps( const int,
+ const int,
+ _PTR(SObject),
+ QStringList&,
+ THypList&,
+ HypothesisData* = 0 );
+ HypothesisData* hypData( const int,
+ const int,
+ const int ); // access to myAvailableHypData
+
+ void createHypothesis( const int, const int,
+ const QString& );
bool createMesh( QString& );
bool createSubMesh( QString& );
void readMesh();
QString name( _PTR(SObject) ) const;
int find( const SMESH::SMESH_Hypothesis_var&,
- const THypList& theHypList) const;
- SMESH::SMESH_Hypothesis_var getInitParamsHypothesis( const QString& aHypType,
- const QString& aServerLib ) const;
+ const THypList& ) const;
+ SMESH::SMESH_Hypothesis_var getInitParamsHypothesis( const QString&,
+ const QString& ) const;
bool isSubshapeOk() const;
_PTR(SObject) getSubmeshByGeom() const;
void selectObject( _PTR(SObject) ) const;
bool myIgnoreAlgoSelection;
};
-#endif
+#endif // SMESHGUI_MESHOP_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_MeshPatternDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_MeshPatternDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_MeshPatternDlg.h"
#include "SMESHGUI.h"
-#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_CreatePatternDlg.h"
#include "SMESHGUI_PatternWidget.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_PatternUtils.h"
#include "SMESHGUI_GEOMGenUtils.h"
-#include "SMESH_Actor.h"
-#include "SMESH_ActorUtils.h"
-#include "SMESH_NumberFilter.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+#include <SMESH_NumberFilter.hxx>
-#include "SMDS_Mesh.hxx"
-#include "SMDS_MeshElement.hxx"
+#include <SMDS_Mesh.hxx>
+#include <SMDS_MeshElement.hxx>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_FileDlg.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "LightApp_SelectionMgr.h"
-#include "SalomeApp_Tools.h"
-#include "SalomeApp_Study.h"
-#include "LightApp_Application.h"
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Tools.h>
+#include <LightApp_Application.h>
-#include "SALOMEDS_SObject.hxx"
+#include <SALOME_ListIO.hxx>
-#include "SALOME_ListIO.hxx"
-#include "SVTK_Selection.h"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <VTKViewer_CellLocationsArray.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_Selector.h"
-#include "SVTK_ViewWindow.h"
-#include "VTKViewer_CellLocationsArray.h"
+// SALOME KERNEL includes
+#include <SALOMEDS_SObject.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qbuttongroup.h>
-#include <qmessagebox.h>
-#include <qcstring.h>
-#include <qspinbox.h>
-#include <qvaluelist.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qfiledialog.h>
-
-// VTK Includes
-#include <vtkCell.h>
+
+// Qt includes
+#include <QFrame>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QLabel>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QButtonGroup>
+#include <QSpinBox>
+#include <QList>
+#include <QDir>
+#include <QFileDialog>
+#include <QFileInfo>
+#include <QFile>
+#include <QKeyEvent>
+
+// VTK includes
#include <vtkIdList.h>
#include <vtkCellArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
-#define SPACING 5
-#define MARGIN 10
+#define SPACING 6
+#define MARGIN 11
/*!
* Class : SMESHGUI_MeshPatternDlg
// name : SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg
// Purpose : Constructor
//=======================================================================
-SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule,
- const char* theName )
- : QDialog( SMESH::GetDesktop( theModule ), theName, false, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
- myBusy(false),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_MeshPatternDlg::SMESHGUI_MeshPatternDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ myBusy( false ),
+ myCreationDlg( 0 )
{
- setCaption(tr("CAPTION"));
+ setModal( false );
+ setWindowTitle( tr( "CAPTION" ) );
- QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout( this );
+ aDlgLay->setMargin( MARGIN );
+ aDlgLay->setSpacing( SPACING );
- QFrame* aMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
+ QWidget* aMainFrame = createMainFrame ( this );
+ QWidget* aBtnFrame = createButtonFrame( this );
- aDlgLay->addWidget(aMainFrame);
- aDlgLay->addWidget(aBtnFrame);
+ aDlgLay->addWidget( aMainFrame );
+ aDlgLay->addWidget( aBtnFrame );
- aDlgLay->setStretchFactor(aMainFrame, 1);
-
- myCreationDlg = 0;
+ aDlgLay->setStretchFactor( aMainFrame, 1 );
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
// name : SMESHGUI_MeshPatternDlg::createMainFrame
// Purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_MeshPatternDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_MeshPatternDlg::createMainFrame (QWidget* theParent)
{
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
- QPixmap iconSlct ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
- QPixmap icon2d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_2d")));
- QPixmap icon3d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_3d")));
- QPixmap iconOpen ( mgr->loadPixmap("STD", tr("ICON_FILE_OPEN")));
+ QPixmap iconSlct ( mgr->loadPixmap( "SMESH", tr( "ICON_SELECT" ) ) );
+ QPixmap icon2d ( mgr->loadPixmap( "SMESH", tr( "ICON_PATTERN_2d" ) ) );
+ QPixmap icon3d ( mgr->loadPixmap( "SMESH", tr( "ICON_PATTERN_3d" ) ) );
+ QPixmap iconOpen ( mgr->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ) );
+
+ QPixmap iconSample2d ( mgr->loadPixmap( "SMESH", tr( "ICON_PATTERN_SAMPLE_2D" ) ) );
+ QPixmap iconSample3d ( mgr->loadPixmap( "SMESH", tr( "ICON_PATTERN_SAMPLE_3D" ) ) );
- QPixmap iconSample2d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D")));
- QPixmap iconSample3d ( mgr->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_3D")));
+ QWidget* aMainGrp = new QWidget( theParent );
- QGroupBox* aMainGrp = new QGroupBox (1, Qt::Horizontal, theParent);
- aMainGrp->setFrameStyle(QFrame::NoFrame);
- aMainGrp->setInsideMargin(0);
+ QVBoxLayout* aMainGrpLayout = new QVBoxLayout( aMainGrp );
+ aMainGrpLayout->setMargin( 0 );
+ aMainGrpLayout->setSpacing( SPACING );
// Pattern type group
- myTypeGrp = new QButtonGroup (1, Qt::Vertical, tr("PATTERN_TYPE"), aMainGrp);
- mySwitch2d = new QRadioButton (myTypeGrp);
- mySwitch3d = new QRadioButton (myTypeGrp);
- mySwitch2d->setPixmap(icon2d);
- mySwitch3d->setPixmap(icon3d);
- myTypeGrp->insert(mySwitch2d, Type_2d);
- myTypeGrp->insert(mySwitch3d, Type_3d);
+ QGroupBox* aTypeGrp = new QGroupBox( tr( "PATTERN_TYPE" ), aMainGrp );
+ QHBoxLayout* aTypeGrpLayout = new QHBoxLayout( aTypeGrp );
+ aTypeGrpLayout->setMargin( MARGIN );
+ aTypeGrpLayout->setSpacing( SPACING );
+
+ mySwitch2d = new QRadioButton( aTypeGrp );
+ mySwitch3d = new QRadioButton( aTypeGrp );
+ mySwitch2d->setIcon( icon2d );
+ mySwitch3d->setIcon( icon3d );
+
+ myTypeGrp = new QButtonGroup( aMainGrp );
+ myTypeGrp->addButton( mySwitch2d, Type_2d );
+ myTypeGrp->addButton( mySwitch3d, Type_3d );
+
+ // ... layout widgets
+
+ aTypeGrpLayout->addWidget( mySwitch2d );
+ aTypeGrpLayout->addWidget( mySwitch3d );
// Mesh group
- QGroupBox* aMeshGrp = new QGroupBox(1, Qt::Vertical, tr("SMESH_MESH"), aMainGrp);
- new QLabel(tr("SMESH_MESH"), aMeshGrp);
- mySelBtn[ Mesh ] = new QPushButton(aMeshGrp);
- mySelBtn[ Mesh ]->setPixmap(iconSlct);
- mySelEdit[ Mesh ] = new QLineEdit(aMeshGrp);
- mySelEdit[ Mesh ]->setReadOnly(true);
+ QGroupBox* aMeshGrp = new QGroupBox( tr( "SMESH_MESH" ), aMainGrp );
+ QHBoxLayout* aMeshGrpLayout = new QHBoxLayout( aMeshGrp );
+ aMeshGrpLayout->setMargin( MARGIN );
+ aMeshGrpLayout->setSpacing( SPACING );
+
+ QLabel* aMeshLab = new QLabel( tr( "SMESH_MESH" ), aMeshGrp );
+ mySelBtn[ Mesh ] = new QPushButton( aMeshGrp );
+ mySelBtn[ Mesh ]->setIcon( iconSlct );
+ mySelEdit[ Mesh ] = new QLineEdit( aMeshGrp );
+ mySelEdit[ Mesh ]->setReadOnly( true );
+
+ // ... layout widgets
+
+ aMeshGrpLayout->addWidget( aMeshLab );
+ aMeshGrpLayout->addWidget( mySelBtn[ Mesh ] );
+ aMeshGrpLayout->addWidget( mySelEdit[ Mesh ] );
// Pattern group
- QGroupBox* aPatGrp = new QGroupBox(1, Qt::Horizontal, tr("PATTERN"), aMainGrp);
+ QGroupBox* aPatGrp = new QGroupBox( tr( "PATTERN" ), aMainGrp );
+ QGridLayout* aPatGrpLayout = new QGridLayout( aPatGrp );
+ aPatGrpLayout->setMargin( MARGIN );
+ aPatGrpLayout->setSpacing( SPACING );
+
+ // ... Pattern name
+
+ QLabel* aNameLab = new QLabel( tr( "PATTERN" ), aPatGrp );
+ myName = new QLineEdit( aPatGrp );
+ myName->setReadOnly( true );
+ myOpenBtn = new QPushButton( aPatGrp );
+ myOpenBtn->setIcon( iconOpen );
+ myNewBtn = new QPushButton( tr( "NEW" ), aPatGrp );
+
+ // ... Mode selection check box
+ myRefine = new QCheckBox( tr( "REFINE" ), aPatGrp );
+
+ // ... selection widgets for Apply to geom mode
+ myGeomGrp = new QFrame( aPatGrp );
+ myGeomGrp->setFrameStyle( QFrame::NoFrame );
+ QGridLayout* myGeomGrpLayout = new QGridLayout( myGeomGrp );
+ myGeomGrpLayout->setMargin( 0 );
+ myGeomGrpLayout->setSpacing( SPACING );
+
+ for ( int i = Object; i <= Vertex2; i++ ) {
+ mySelLbl[ i ] = new QLabel( myGeomGrp );
+ mySelBtn[ i ] = new QPushButton( myGeomGrp );
+ mySelBtn[ i ]->setIcon( iconSlct );
+ mySelEdit[ i ] = new QLineEdit( myGeomGrp );
+ mySelEdit[ i ]->setReadOnly( true );
+ myGeomGrpLayout->addWidget( mySelLbl[ i ], i - Object, 0 );
+ myGeomGrpLayout->addWidget( mySelBtn[ i ], i - Object, 1 );
+ myGeomGrpLayout->addWidget( mySelEdit[ i ], i - Object, 2 );
+ }
- // pattern name
- QGroupBox* aNameGrp = new QGroupBox(1, Qt::Vertical, aPatGrp);
- aNameGrp->setFrameStyle(QFrame::NoFrame);
- aNameGrp->setInsideMargin(0);
- new QLabel(tr("PATTERN"), aNameGrp);
- myName = new QLineEdit(aNameGrp);
- myName->setReadOnly(true);
- myOpenBtn = new QPushButton(aNameGrp);
- myOpenBtn->setPixmap(iconOpen);
- myNewBtn = new QPushButton(tr("NEW"), aNameGrp);
+ // ... Widgets for refinement of existing mesh elements
- // Mode selection check box
- myRefine = new QCheckBox(tr("REFINE"), aPatGrp);
+ myRefineGrp = new QFrame( aPatGrp );
+ myRefineGrp->setFrameStyle( QFrame::NoFrame );
- // selection widgets for Apply to geom mode
- myGeomGrp = new QGroupBox(3, Qt::Horizontal, aPatGrp);
- myGeomGrp->setFrameStyle(QFrame::NoFrame);
- myGeomGrp->setInsideMargin(0);
+ QGridLayout* myRefineGrpLayout = new QGridLayout( myRefineGrp );
+ myRefineGrpLayout->setMargin( 0 );
+ myRefineGrpLayout->setSpacing( SPACING );
- for (int i = Object; i <= Vertex2; i++)
- {
- mySelLbl[ i ] = new QLabel(myGeomGrp);
- mySelBtn[ i ] = new QPushButton(myGeomGrp);
- mySelBtn[ i ]->setPixmap(iconSlct);
- mySelEdit[ i ] = new QLineEdit(myGeomGrp);
- mySelEdit[ i ]->setReadOnly(true);
- }
+ mySelLbl[ Ids ] = new QLabel( myRefineGrp );
+ mySelBtn[ Ids ] = new QPushButton( myRefineGrp );
+ mySelBtn[ Ids ]->setIcon( iconSlct );
+ mySelEdit[ Ids ] = new QLineEdit( myRefineGrp );
+
+ QLabel* aNodeLbl = new QLabel( tr( "NODE_1" ), myRefineGrp );
+ myNode1 = new QSpinBox( myRefineGrp );
+ myNode2Lbl = new QLabel( tr( "NODE_2" ), myRefineGrp );
+ myNode2 = new QSpinBox( myRefineGrp );
- // Widgets for refinement of existing mesh elements
- myRefineGrp = new QFrame(aPatGrp);
- myRefineGrp->setFrameStyle(QFrame::NoFrame);
- QGridLayout* aRefGrid = new QGridLayout(myRefineGrp, 3, 3, 0, 5);
-
- mySelLbl[ Ids ] = new QLabel(myRefineGrp);
- mySelBtn[ Ids ] = new QPushButton(myRefineGrp);
- mySelBtn[ Ids ]->setPixmap(iconSlct);
- mySelEdit[ Ids ] = new QLineEdit(myRefineGrp);
-
- QLabel* aNodeLbl = new QLabel(tr("NODE_1"), myRefineGrp);
- myNode1 = new QSpinBox(myRefineGrp);
- myNode2Lbl = new QLabel(tr("NODE_2"), myRefineGrp);
- myNode2 = new QSpinBox(myRefineGrp);
-
- aRefGrid->addWidget(mySelLbl [ Ids ], 0, 0);
- aRefGrid->addWidget(mySelBtn [ Ids ], 0, 1);
- aRefGrid->addWidget(mySelEdit[ Ids ], 0, 2);
- aRefGrid->addWidget(aNodeLbl, 1, 0);
- aRefGrid->addMultiCellWidget(myNode1, 1, 1, 1, 2);
- aRefGrid->addWidget(myNode2Lbl, 2, 0);
- aRefGrid->addMultiCellWidget(myNode2, 2, 2, 1, 2);
-
- // reverse check box
- myReverseChk = new QCheckBox(tr("REVERSE"), aPatGrp);
-
- // CreatePoly check box
+ myRefineGrpLayout->addWidget( mySelLbl[ Ids ], 0, 0 );
+ myRefineGrpLayout->addWidget( mySelBtn[ Ids ], 0, 1 );
+ myRefineGrpLayout->addWidget( mySelEdit[ Ids ], 0, 2 );
+ myRefineGrpLayout->addWidget( aNodeLbl, 1, 0 );
+ myRefineGrpLayout->addWidget( myNode1, 1, 1, 1, 2 );
+ myRefineGrpLayout->addWidget( myNode2Lbl, 2, 0 );
+ myRefineGrpLayout->addWidget( myNode2, 2, 1, 1, 2 );
+
+ // ... reverse check box
+ myReverseChk = new QCheckBox( tr( "REVERSE" ), aPatGrp );
+
+ // ... CreatePoly check box
myCreatePolygonsChk = new QCheckBox( tr( "CREATE_POLYGONS_NEAR_BOUNDARY" ), aPatGrp );
myCreatePolyedrsChk = new QCheckBox( tr( "CREATE_POLYEDRS_NEAR_BOUNDARY" ), aPatGrp );
- // Pictures 2d and 3d
- for (int i = 0; i < 2; i++) {
- if (i == 0) {
- myPicture2d = new SMESHGUI_PatternWidget(aPatGrp),
- myPicture2d->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
- } else {
- myPicture3d = new QFrame(aPatGrp),
- myPreview3d = new QLabel(myPicture3d);
- myPreview3d->setPixmap(iconSample3d);
- QGridLayout* aLay = new QGridLayout(myPicture3d, 3, 3, 0, 0);
- QSpacerItem* aSpacerH1 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
- QSpacerItem* aSpacerH2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
- QSpacerItem* aSpacerV1 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
- QSpacerItem* aSpacerV2 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
- aLay->addItem(aSpacerH1, 1, 0);
- aLay->addItem(aSpacerH2, 1, 2);
- aLay->addItem(aSpacerV1, 0, 1);
- aLay->addItem(aSpacerV2, 2, 1);
- aLay->addWidget(myPreview3d, 1, 1);
- }
- }
+ // ... Pictures 2d and 3d
+
+ myPicture2d = new SMESHGUI_PatternWidget( aPatGrp );
+ myPicture2d->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+
+ myPicture3d = new QLabel( aPatGrp );
+ myPicture3d->setPixmap( iconSample3d );
+ myPicture3d->setScaledContents( false );
+ myPicture3d->setAlignment( Qt::AlignCenter );
+ myPicture3d->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
- myPreviewChk = new QCheckBox(tr("PREVIEW"), aPatGrp);
+ // ... preview check box
+
+ myPreviewChk = new QCheckBox( tr( "PREVIEW" ), aPatGrp );
+
+ // ... layout widgets
+
+ aPatGrpLayout->addWidget( aNameLab, 0, 0 );
+ aPatGrpLayout->addWidget( myName, 0, 1 );
+ aPatGrpLayout->addWidget( myOpenBtn, 0, 2 );
+ aPatGrpLayout->addWidget( myNewBtn, 0, 3 );
+ aPatGrpLayout->addWidget( myRefine, 1, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myRefine, 1, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myGeomGrp, 2, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myRefineGrp, 3, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myReverseChk, 4, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myCreatePolygonsChk, 5, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myCreatePolyedrsChk, 6, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myPicture2d, 7, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myPicture3d, 8, 0, 1, 4 );
+ aPatGrpLayout->addWidget( myPreviewChk, 9, 0, 1, 4 );
+
+ // main layout
+
+ aMainGrpLayout->addWidget( aTypeGrp );
+ aMainGrpLayout->addWidget( aMeshGrp );
+ aMainGrpLayout->addWidget( aPatGrp );
// Connect signals and slots
- connect(myTypeGrp, SIGNAL(clicked(int)), SLOT(onTypeChanged(int)));
+ connect(myTypeGrp, SIGNAL(buttonClicked(int)), SLOT(onTypeChanged(int)));
connect(myOpenBtn, SIGNAL(clicked()), SLOT(onOpen()));
connect(myNewBtn, SIGNAL(clicked()), SLOT(onNew()));
// name : SMESHGUI_MeshPatternDlg::createButtonFrame
// Purpose : Create frame containing buttons
//=======================================================================
-QFrame* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_MeshPatternDlg::createButtonFrame (QWidget* theParent)
{
QFrame* aFrame = new QFrame(theParent);
aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
- myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING);
+ QHBoxLayout* aLay = new QHBoxLayout( aFrame );
+ aLay->setMargin( MARGIN );
+ aLay->setSpacing( SPACING );
aLay->addWidget(myOkBtn);
aLay->addWidget(myApplyBtn);
- aLay->addItem(aSpacer);
+ aLay->addSpacing( 10 );
+ aLay->addStretch();
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
- myTypeGrp->setButton(Type_2d);
+ myTypeGrp->button(Type_2d)->setChecked(true);
onTypeChanged(Type_2d);
onModeToggled(isRefine());
//=======================================================================
bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
{
- QValueList<int> ids;
+ QList<int> ids;
if ((isRefine() &&
(myMesh->_is_nil() || !getIds(ids) || getNode(false) < 0 ||
myType == Type_3d && (getNode(true) < 0 || getNode(false) == getNode(true))))
myGeomObj[ Vertex1 ]->_is_nil() || myType == Type_3d && myGeomObj[ Vertex2 ]->_is_nil())))
{
if (theMess)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
+ tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
- if ( myName->text()=="" ) {
+ if ( myName->text().isEmpty() ) {
if (theMess)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
- tr("SMESHGUI_INVALID_PARAMETERS"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_INSUFFICIENT_DATA"),
+ tr("SMESHGUI_INVALID_PARAMETERS"));
return false;
}
erasePreview();
if (isRefine()) { // Refining existing mesh elements
- QValueList<int> ids;
+ QList<int> ids;
getIds(ids);
SMESH::long_array_var varIds = new SMESH::long_array();
varIds->length(ids.count());
int i = 0;
- for (QValueList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
+ for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
varIds[i++] = *it;
myType == Type_2d
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
return true;
} else {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("SMESH_OPERATION_FAILED"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
+ tr("SMESH_OPERATION_FAILED"));
return false;
}
} catch (const SALOME::SALOME_Exception& S_ex) {
#else
platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
void SMESHGUI_MeshPatternDlg::onOpen()
{
SUIT_FileDlg* aDlg = new SUIT_FileDlg (this, true);
- aDlg->setCaption(tr("LOAD_PATTERN"));
- aDlg->setMode(QFileDialog::ExistingFile);
+ aDlg->setWindowTitle(tr("LOAD_PATTERN"));
+ aDlg->setFileMode(QFileDialog::ExistingFile);
aDlg->setFilters(prepareFilters());
- if (myName->text() != "")
- aDlg->setSelection(myName->text() + ".smp");
- QPushButton* anOkBtn = (QPushButton*)aDlg->child("OK", "QPushButton");
+ if (!myName->text().isEmpty())
+ aDlg->selectFile(myName->text() + ".smp");
+ QPushButton* anOkBtn = qFindChild<QPushButton*>( aDlg, "OK" );
if (anOkBtn != 0)
anOkBtn->setText(tr("SMESH_BUT_OK"));
if (fName.isEmpty())
return;
- if (QFileInfo(fName).extension().isEmpty())
+ if (QFileInfo(fName).suffix().isEmpty())
fName = autoExtension(fName);
fName = QDir::convertSeparators(fName);
// Read string from file
QFile aFile(fName);
- if (!aFile.open(IO_ReadOnly)) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_OPENING"), QMessageBox::Ok);
+ if (!aFile.open(QIODevice::ReadOnly)) {
+ SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
+ tr("ERROR_OF_OPENING"));
return;
}
QByteArray aDataArray = aFile.readAll();
- const char* aData = aDataArray.data();
- if (aData == 0) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_READING"), QMessageBox::Ok);
+ if (aDataArray.size() > 0) {
+ SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
+ tr("ERROR_OF_READING"));
return;
}
- if (loadFromFile(aData))
- myName->setText(QFileInfo(fName).baseName());
+ if (loadFromFile(aDataArray))
+ myName->setText(QFileInfo(fName).completeBaseName());
updateWgState();
displayPreview();
return;
} else {
PointVector aPoints(pnts->length());
- QValueVector<int> aKeyPoints(keyPoints->length());
+ QVector<int> aKeyPoints(keyPoints->length());
ConnectivityVector anElemPoints(elemPoints->length());
for (int i = 0, n = pnts->length(); i < n; i++)
aKeyPoints[ i2 ] = keyPoints[ i2 ];
for (int i3 = 0, n3 = elemPoints->length(); i3 < n3; i3++) {
- QValueVector<int> aVec(elemPoints[ i3 ].length());
+ QVector<int> aVec(elemPoints[ i3 ].length());
for (int i4 = 0, n4 = elemPoints[ i3 ].length(); i4 < n4; i4++)
aVec[ i4 ] = elemPoints[ i3 ][ i4 ];
void SMESHGUI_MeshPatternDlg::erasePreview()
{
// Erase preview in 2D viewer
- myPicture2d->SetPoints(PointVector(), QValueVector<int>(), ConnectivityVector());
+ myPicture2d->SetPoints(PointVector(), QVector<int>(), ConnectivityVector());
// Erase preview in 3D viewer
if (myPreviewActor == 0)
}
}
- QValueList<int> ids;
+ QList<int> ids;
if (!CORBA::is_nil(myPattern)/* && getIds(ids)*/) {
SMESH::long_array_var keyPoints = myPattern->GetKeyPoints();
if (keyPoints->length()) {
try {
SMESH::SMESH_Pattern_var aPattern = SMESH::GetPattern();
- if (!aPattern->LoadFromFile(theName.latin1()) ||
+ if (!aPattern->LoadFromFile(theName.toLatin1().data()) ||
myType == Type_2d && !aPattern->Is2D()) {
SMESH::SMESH_Pattern::ErrorCode aCode = aPattern->GetErrorCode();
QString aMess;
else if (aCode == SMESH::SMESH_Pattern::ERR_READ_BAD_KEY_POINT ) aMess = tr("ERR_READ_BAD_KEY_POINT");
else aMess = tr("ERROR_OF_LOADING");
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"), aMess, QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_ERROR"), aMess);
return false;
} else {
myPattern = aPattern;
}
} catch (const SALOME::SALOME_Exception& S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("ERROR_OF_LOADING"), QMessageBox::Ok);
- return false;
+ SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
+ tr("ERROR_OF_LOADING") );
+ return false;
}
}
try {
// Get points from pattern
SMESH::point_array_var pnts;
- QValueList<int> ids;
+ QList<int> ids;
if (isRefine() && getIds(ids)) {
SMESH::long_array_var varIds = new SMESH::long_array();
varIds->length(ids.count());
int i = 0;
- for (QValueList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
+ for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it)
varIds[i++] = *it;
pnts = myType == Type_2d
? myPattern->ApplyToMeshFaces (myMesh, varIds, getNode(false), myReverseChk->isChecked())
aMesh = anActor->GetObject()->GetMesh();
if (aMesh) {
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
TColStd_MapOfInteger newIndices;
QSpinBox* second = first == myNode1 ? myNode2 : myNode1;
int secondVal = second->value();
if (secondVal == value) {
- secondVal = value == second->maxValue() ? second->minValue() : value + 1;
+ secondVal = value == second->maximum() ? second->minimum() : value + 1;
bool blocked = second->signalsBlocked();
second->blockSignals(true);
second->setValue(secondVal);
// name : getIds
// Purpose :
//=======================================================================
-bool SMESHGUI_MeshPatternDlg::getIds (QValueList<int>& ids) const
+bool SMESHGUI_MeshPatternDlg::getIds (QList<int>& ids) const
{
ids.clear();
- QStringList strIds = QStringList::split(" ", mySelEdit[Ids]->text());
+ QStringList strIds = mySelEdit[Ids]->text().split(" ", QString::SkipEmptyParts );
bool isOk;
int val;
for (QStringList::iterator it = strIds.begin(); it != strIds.end(); ++it) {
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
+ if ( e->key() == Qt::Key_F1 )
{
e->accept();
onHelp();
-// 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
+// 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 : SMESHGUI_MeshPatternDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_MeshPatternDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-#ifndef SMESHGUI_MeshPatternDlg_H
-#define SMESHGUI_MeshPatternDlg_H
+#ifndef SMESHGUI_MESHPATTERNDLG_H
+#define SMESHGUI_MESHPATTERNDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
+#include <QMap>
-// IDL Headers
+// IDL includes
#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Pattern)
-class QCloseEvent;
class QFrame;
class QLineEdit;
-class SMESHGUI_SpinBox;
class QPushButton;
-class LightApp_SelectionMgr;
class QRadioButton;
class QCheckBox;
class QButtonGroup;
class QLabel;
class QSpinBox;
-class QGroupBox;
-class SMESHGUI_CreatePatternDlg;
-class SMESHGUI_PatternWidget;
class vtkUnstructuredGrid;
class SALOME_Actor;
-class SVTK_ViewWindow;
class SVTK_Selector;
+class LightApp_SelectionMgr;
class SMESHGUI;
+class SMESHGUI_CreatePatternDlg;
+class SMESHGUI_PatternWidget;
/*
Class : SMESHGUI_MeshPatternDlg
enum { Mesh, Object, Vertex1, Vertex2, Ids };
public:
- SMESHGUI_MeshPatternDlg( SMESHGUI*,
- const char* = 0 );
- virtual ~SMESHGUI_MeshPatternDlg();
+ SMESHGUI_MeshPatternDlg( SMESHGUI* );
+ virtual ~SMESHGUI_MeshPatternDlg();
void Init();
private slots:
-
void onOk();
bool onApply();
void onClose();
void onOkCreationDlg();
void onCloseCreationDlg();
void onTextChanged( const QString& );
- void onNodeChanged( int value );
+ void onNodeChanged( int );
private:
-
- QFrame* createButtonFrame( QWidget* );
- QFrame* createMainFrame ( QWidget* );
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame( QWidget* );
void displayPreview();
vtkUnstructuredGrid* getGrid();
void erasePreview();
bool loadFromFile( const QString& );
void activateSelection();
QStringList prepareFilters() const;
- QString autoExtension( const QString& theFileName ) const;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
- void keyPressEvent(QKeyEvent*);
- bool isValid( const bool theMess = true );
+ QString autoExtension( const QString& ) const;
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void keyPressEvent( QKeyEvent* );
+ bool isValid( const bool = true );
void resetSelInput();
bool isRefine() const;
- bool getIds( QValueList<int>& ) const;
+ bool getIds( QList<int>& ) const;
int getNode( bool = false ) const;
private:
-
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QSpinBox* myNode2;
QLabel* myNode2Lbl;
- QGroupBox* myGeomGrp;
- QMap< int, QPushButton* > mySelBtn;
- QMap< int, QLineEdit* > mySelEdit;
- QMap< int, QLabel* > mySelLbl;
+ QFrame* myGeomGrp;
+ QMap<int, QPushButton*> mySelBtn;
+ QMap<int, QLineEdit*> mySelEdit;
+ QMap<int, QLabel*> mySelLbl;
QLineEdit* myName;
QPushButton* myOpenBtn;
QCheckBox* myCreatePolygonsChk;
QCheckBox* myCreatePolyedrsChk;
SMESHGUI_PatternWidget* myPicture2d;
- QFrame* myPicture3d;
- QLabel* myPreview3d;
+ QLabel* myPicture3d;
QCheckBox* myPreviewChk;
SMESH::SMESH_Mesh_var myMesh;
GEOM::GEOM_Object_var myMeshShape;
- QMap< int, GEOM::GEOM_Object_var > myGeomObj;
+ QMap<int, GEOM::GEOM_Object_var> myGeomObj;
SMESHGUI_CreatePatternDlg* myCreationDlg;
SMESH::SMESH_Pattern_var myPattern;
QString myHelpFileName;
};
-#endif
+#endif // SMESHGUI_MESHPATTERNDLG_H
-// 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
-//
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_MeshUtils.cxx
+// Author : Open CASCADE S.A.S.
+//
-
+// SMESH includes
#include "SMESHGUI_MeshUtils.h"
+
#include "SMESHGUI_Utils.h"
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOMEconfig.h"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_Study.hxx>
+
+// Qt includes
+#include <QStringList>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
namespace SMESH
{
-
SMESH_Mesh_var GetMeshByIO(const Handle(SALOME_InteractiveObject)& theIO)
{
CORBA::Object_var anObj = IObjectToObject(theIO);
return SMESH_Mesh::_nil();
}
- QString UniqueMeshName(const char* theBaseName, const char* thePostfix)
+ QString UniqueMeshName(const QString& theBaseName, const QString& thePostfix)
{
- QString baseName = theBaseName;
- if ( thePostfix/* && !name.contains( postfix )*/) { // add postfix
- baseName += "_";
- baseName += thePostfix;
- }
- if(_PTR(Study) aStudy = GetActiveStudyDocument()) {
+ QString baseName = thePostfix.isEmpty() ?
+ theBaseName : theBaseName + "_" + thePostfix;
+ if ( _PTR(Study) aStudy = GetActiveStudyDocument() ) {
QString name = baseName;
- while ( !aStudy->FindObjectByName( name.latin1(), "SMESH" ).empty() ) {
+ while ( !aStudy->FindObjectByName( name.toLatin1().data(), "SMESH" ).empty() ) {
int nb = 0;
- if ( name[ name.length()-1 ].isNumber() ) {
- int nbBeg = name.findRev("_");
- nb = name.right( name.length() - nbBeg - 1 ).toInt();
- name = name.left( nbBeg );
- }
- name += QString("_%1").arg( nb+1 );
+ QStringList names = name.split("_", QString::KeepEmptyParts);
+ if ( names.count() > 0 ) {
+ bool ok;
+ int index = names.last().toInt( &ok );
+ if ( ok ) {
+ nb = index;
+ names.removeLast();
+ }
+ }
+ names.append( QString::number( nb+1 ) );
+ name = names.join( "_" );
}
return name;
}
- return QString("");
+ return baseName;
}
-
-}
+} // end of namespace SMESH
-// 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
-//
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_MeshUtils.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_MeshUtils_HeaderFile
-#define SMESHGUI_MeshUtils_HeaderFile
+#ifndef SMESHGUI_MESHUTILS_H
+#define SMESHGUI_MESHUTILS_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "SALOME_InteractiveObject.hxx"
-
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
-#include <qstring.h>
+// Qt includes
+#include <QString>
+// SALOME GUI includes
+#include <SALOME_InteractiveObject.hxx>
-namespace SMESH{
-
-SMESHGUI_EXPORT
- SMESH_Mesh_var GetMeshByIO(const Handle(SALOME_InteractiveObject)& theIO);
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
- QString UniqueMeshName(const char* theBaseName, const char* thePostfix);
+namespace SMESH
+{
+ SMESHGUI_EXPORT
+ SMESH_Mesh_var GetMeshByIO( const Handle(SALOME_InteractiveObject)& );
+
+ SMESHGUI_EXPORT
+ QString UniqueMeshName( const QString&, const QString& = QString() );
}
-
-#endif
+#endif // SMESHGUI_MESHUTILS_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_MoveNodesDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_MoveNodesDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_MoveNodesDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
-#include "SMESH_Actor.h"
-#include "SMDS_Mesh.hxx"
-#include "SMDS_MeshNode.hxx"
-
-#include "LightApp_SelectionMgr.h"
-#include "LightApp_Application.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+#include <SMESH_Actor.h>
+#include <SMDS_Mesh.hxx>
-#include "SVTK_Selector.h"
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SALOME_ListIO.hxx"
+// SALOME GUI includes
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_Application.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SVTK_ViewWindow.h"
-#include "VTKViewer_CellLocationsArray.h"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-#include "utilities.h"
+#include <VTKViewer_CellLocationsArray.h>
// OCCT includes
#include <TColStd_MapOfInteger.hxx>
// VTK includes
-#include <vtkCell.h>
#include <vtkIdList.h>
#include <vtkCellArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
-// QT includes
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qmessagebox.h>
-#include <qbuttongroup.h>
-
-// IDL Headers
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QKeyEvent>
+
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-#define MARGIN 10
-#define SPACING 5
-
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// name : SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg
// Purpose :
//=================================================================================
-SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg (SMESHGUI* theModule,
- const char* theName):
- QDialog(SMESH::GetDesktop(theModule),
- theName,
- false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg(SMESHGUI* theModule):
+ QDialog(SMESH::GetDesktop(theModule)),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule)
{
myPreviewActor = 0;
myBusy = false;
- setCaption(tr("CAPTION"));
+ setModal(false);
+ setWindowTitle(tr("CAPTION"));
- QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout(this);
+ aDlgLay->setSpacing(SPACING);
+ aDlgLay->setMargin(MARGIN);
- QFrame* aMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
+ QWidget* aMainFrame = createMainFrame (this);
+ QWidget* aBtnFrame = createButtonFrame(this);
aDlgLay->addWidget(aMainFrame);
aDlgLay->addWidget(aBtnFrame);
- aDlgLay->setStretchFactor(aMainFrame, 1);
-
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
myHelpFileName = "moving_nodes_page.html";
// name : SMESHGUI_MoveNodesDlg::createButtonFrame
// Purpose : Create frame containing buttons
//=======================================================================
-QFrame* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_MoveNodesDlg::createButtonFrame (QWidget* theParent)
{
QFrame* aFrame = new QFrame(theParent);
aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
- myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-
- QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING);
+ QHBoxLayout* aLay = new QHBoxLayout(aFrame);
+ aLay->setSpacing(SPACING);
+ aLay->setMargin(MARGIN);
aLay->addWidget(myOkBtn);
+ aLay->addSpacing(10);
aLay->addWidget(myApplyBtn);
- aLay->addItem(aSpacer);
+ aLay->addSpacing(10);
+ aLay->addStretch();
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
// name : SMESHGUI_MoveNodesDlg::createMainFrame
// Purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_MoveNodesDlg::createMainFrame (QWidget* theParent)
{
- QFrame* aFrame = new QFrame(theParent);
+ QWidget* aFrame = new QWidget(theParent);
QPixmap iconMoveNode (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_MOVE_NODE")));
QPixmap iconSelect (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- QButtonGroup* aPixGrp = new QButtonGroup(1, Qt::Vertical, tr("MESH_NODE"), aFrame);
- aPixGrp->setExclusive(TRUE);
+ //------------------------------------------------------------
+ QGroupBox* aPixGrp = new QGroupBox(tr("MESH_NODE"), aFrame);
+ QHBoxLayout* aPixGrpLayout = new QHBoxLayout(aPixGrp);
+ aPixGrpLayout->setSpacing(SPACING);
+ aPixGrpLayout->setMargin(MARGIN);
+
QRadioButton* aRBut = new QRadioButton(aPixGrp);
- aRBut->setPixmap(iconMoveNode);
- aRBut->setChecked(TRUE);
+ aRBut->setIcon(iconMoveNode);
+ aRBut->setChecked(true);
+
+ aPixGrpLayout->addWidget(aRBut);
+ aPixGrpLayout->addStretch();
- QGroupBox* anIdGrp = new QGroupBox(1, Qt::Vertical, tr("SMESH_MOVE"), aFrame);
- new QLabel(tr("NODE_ID"), anIdGrp);
- (new QPushButton(anIdGrp))->setPixmap(iconSelect);
+ //------------------------------------------------------------
+ QGroupBox* anIdGrp = new QGroupBox(tr("SMESH_MOVE"), aFrame);
+ QHBoxLayout* anIdGrpLayout = new QHBoxLayout(anIdGrp);
+ anIdGrpLayout->setSpacing(SPACING);
+ anIdGrpLayout->setMargin(MARGIN);
+
+ QLabel* idLabl = new QLabel(tr("NODE_ID"), anIdGrp);
+ QPushButton* idBtn = new QPushButton(anIdGrp);
+ idBtn->setIcon(iconSelect);
myId = new QLineEdit(anIdGrp);
- myId->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
+ myId->setValidator(new SMESHGUI_IdValidator(this, 1));
+
+ anIdGrpLayout->addWidget(idLabl);
+ anIdGrpLayout->addWidget(idBtn);
+ anIdGrpLayout->addWidget(myId);
+
+ //------------------------------------------------------------
+ QGroupBox* aCoordGrp = new QGroupBox(tr("SMESH_COORDINATES"), aFrame);
+ QHBoxLayout* aCoordGrpLayout = new QHBoxLayout(aCoordGrp);
+ aCoordGrpLayout->setSpacing(SPACING);
+ aCoordGrpLayout->setMargin(MARGIN);
- QGroupBox* aCoordGrp = new QGroupBox(1, Qt::Vertical, tr("SMESH_COORDINATES"), aFrame);
QLabel* aXLabel = new QLabel(tr("SMESH_X"), aCoordGrp);
- aXLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
myX = new SMESHGUI_SpinBox(aCoordGrp);
QLabel* aYLabel = new QLabel(tr("SMESH_Y"), aCoordGrp);
- //aYLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- aYLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
myY = new SMESHGUI_SpinBox(aCoordGrp);
QLabel* aZLabel = new QLabel(tr("SMESH_Z"), aCoordGrp);
- //aZLabel->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- aZLabel->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
myZ = new SMESHGUI_SpinBox(aCoordGrp);
+ aCoordGrpLayout->addWidget(aXLabel);
+ aCoordGrpLayout->addWidget(myX);
+ aCoordGrpLayout->addWidget(aYLabel);
+ aCoordGrpLayout->addWidget(myY);
+ aCoordGrpLayout->addWidget(aZLabel);
+ aCoordGrpLayout->addWidget(myZ);
+
+ //------------------------------------------------------------
myX->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
myY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
myZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 25.0, DBL_DIGITS_DISPLAY);
+ //------------------------------------------------------------
QVBoxLayout* aLay = new QVBoxLayout(aFrame);
+ aLay->setMargin(0);
+ aLay->setMargin(SPACING);
aLay->addWidget(aPixGrp);
aLay->addWidget(anIdGrp);
aLay->addWidget(aCoordGrp);
+ //------------------------------------------------------------
// connect signale and slots
connect(myX, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
connect(myY, SIGNAL (valueChanged(double)), this, SLOT(redisplayPreview()));
reset();
setEnabled(true);
- this->show();
-
// set selection mode
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
// name : SMESHGUI_MoveNodesDlg::isValid
// Purpose : Verify validity of entry information
//=======================================================================
-bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess) const
+bool SMESHGUI_MoveNodesDlg::isValid (const bool theMess)
{
if (myId->text().isEmpty()) {
if (theMess)
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_WARNING"),
- tr("NODE_ID_IS_NOT_DEFINED"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_WARNING"),
+ tr("NODE_ID_IS_NOT_DEFINED"));
return false;
}
return true;
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(myMeshActor->getIO());
if (aMesh->_is_nil()) {
- QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_ERROR"),
- tr("SMESHG_NO_MESH"), QMessageBox::Ok);
+ SUIT_MessageBox::information(this, tr("SMESH_ERROR"),
+ tr("SMESHG_NO_MESH"));
return false;
}
#else
platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_MoveNodesDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-// File : SMESHGUI_MoveNodesDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-#ifndef DIALOGBOX_MOVE_NODES_H
-#define DIALOGBOX_MOVE_NODES_H
+#ifndef SMESHGUI_MOVENODESDLG_H
+#define SMESHGUI_MOVENODESDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
class QLineEdit;
class QPushButton;
-class SMESHGUI_SpinBox;
-class SALOME_Actor;
-class QFrame;
class SMESHGUI;
class SMESH_Actor;
-class SUIT_Desktop;
+class SMESHGUI_SpinBox;
+class SALOME_Actor;
class SVTK_Selector;
-class SVTK_ViewWindow;
+class LightApp_SelectionMgr;
//=================================================================================
// class : SMESHGUI_MoveNodesDlg
Q_OBJECT
public:
-
- SMESHGUI_MoveNodesDlg(SMESHGUI* theModule,
- const char* name = 0);
- virtual ~SMESHGUI_MoveNodesDlg();
+ SMESHGUI_MoveNodesDlg( SMESHGUI* );
+ virtual ~SMESHGUI_MoveNodesDlg();
- void Init();
+ void Init();
private slots:
-
void onOk();
bool onApply();
void onClose();
void onSelectionDone();
void redisplayPreview();
- void onTextChange(const QString&);
+ void onTextChange( const QString& );
private:
-
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
- void hideEvent ( QHideEvent * );
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void hideEvent( QHideEvent* );
void keyPressEvent( QKeyEvent* );
void erasePreview();
- QFrame* createButtonFrame( QWidget* );
- QFrame* createMainFrame ( QWidget* );
- bool isValid( const bool ) const;
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame ( QWidget* );
+ bool isValid( const bool );
void reset();
void updateButtons();
private:
-
QPushButton* myOkBtn;
QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QString myHelpFileName;
};
-#endif // DIALOGBOX_MOVE_NODES_H
+#endif // SMESHGUI_MOVENODESDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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 : SMESHGUI_MultiEditDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_MultiEditDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_MultiEditDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_FilterUtils.h"
#include "SMESHGUI_SpinBox.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMDS_Mesh.hxx"
-#include "SMDS_MeshElement.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMDS_Mesh.hxx>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "LightApp_SelectionMgr.h"
-#include "LightApp_Application.h"
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_Application.h>
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
-#include "SVTK_Selector.h"
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "VTKViewer_CellLocationsArray.h"
+#include <SVTK_Selector.h>
+#include <SVTK_ViewWindow.h>
+#include <VTKViewer_CellLocationsArray.h>
-// OCCT Includes
-#include <Precision.hxx>
+// OCCT includes
#include <TColStd_IndexedMapOfInteger.hxx>
#include <TColStd_DataMapOfIntegerInteger.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
-// VTK Includes
-#include <vtkCell3D.h>
-#include <vtkQuad.h>
-#include <vtkTriangle.h>
-#include <vtkPolygon.h>
-#include <vtkConvexPointSet.h>
+// VTK includes
#include <vtkIdList.h>
#include <vtkCellArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
-// QT Includes
-#include <qframe.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlistbox.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qgroupbox.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qapplication.h>
-#include <qradiobutton.h>
-#include <qhbuttongroup.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+// Qt includes
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QListWidget>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QGroupBox>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QButtonGroup>
+#include <QRadioButton>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
-#define SPACING 5
-#define MARGIN 10
+#define SPACING 6
+#define MARGIN 11
/*!
* Class : SMESHGUI_MultiEditDlg
SMESHGUI_MultiEditDlg
::SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
const int theMode,
- const bool the3d2d,
- const char* theName):
- QDialog(SMESH::GetDesktop(theModule),
- theName,
- false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose),
- mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
- mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
- mySMESHGUI(theModule)
+ const bool the3d2d):
+ QDialog(SMESH::GetDesktop(theModule)),
+ mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
+ mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ mySMESHGUI(theModule)
{
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+
myFilterDlg = 0;
myEntityType = 0;
myFilterType = theMode;
- QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout(this);
+ aDlgLay->setMargin(MARGIN);
+ aDlgLay->setSpacing(SPACING);
- QFrame* aMainFrame = createMainFrame (this, the3d2d);
- QFrame* aBtnFrame = createButtonFrame(this);
+ QWidget* aMainFrame = createMainFrame (this, the3d2d);
+ QWidget* aBtnFrame = createButtonFrame(this);
aDlgLay->addWidget(aMainFrame);
aDlgLay->addWidget(aBtnFrame);
- aDlgLay->setStretchFactor(aMainFrame, 1);
- aDlgLay->setStretchFactor(aBtnFrame, 0);
Init();
}
// name : SMESHGUI_MultiEditDlg::createMainFrame
// Purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_MultiEditDlg::createMainFrame (QWidget* theParent, const bool the3d2d)
+QWidget* SMESHGUI_MultiEditDlg::createMainFrame (QWidget* theParent, const bool the3d2d)
{
- QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, theParent);
- aMainGrp->setFrameStyle(QFrame::NoFrame);
- aMainGrp->setInsideMargin(0);
+ QWidget* aMainGrp = new QWidget(theParent);
+ QVBoxLayout* aMainGrpLayout = new QVBoxLayout(aMainGrp);
+ aMainGrpLayout->setMargin(0);
+ aMainGrpLayout->setSpacing(SPACING);
QPixmap aPix (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
// "Selected cells" group
- mySelGrp = new QGroupBox(1, Qt::Horizontal, aMainGrp);
+ mySelGrp = new QGroupBox(aMainGrp);
+
+ QGridLayout* mySelGrpLayout = new QGridLayout(mySelGrp);
+ mySelGrpLayout->setMargin(MARGIN);
+ mySelGrpLayout->setSpacing(SPACING);
myEntityTypeGrp = 0;
if (the3d2d) {
- myEntityTypeGrp = new QHButtonGroup(tr("SMESH_ELEMENTS_TYPE"), mySelGrp);
- (new QRadioButton(tr("SMESH_FACE"), myEntityTypeGrp))->setChecked(true);
- (new QRadioButton(tr("SMESH_VOLUME"), myEntityTypeGrp));
- myEntityType = myEntityTypeGrp->id(myEntityTypeGrp->selected());
- }
+ QGroupBox* aEntityTypeGrp = new QGroupBox(tr("SMESH_ELEMENTS_TYPE"), mySelGrp);
+ myEntityTypeGrp = new QButtonGroup(mySelGrp);
+ QHBoxLayout* aEntityLayout = new QHBoxLayout(aEntityTypeGrp);
+ aEntityLayout->setMargin(MARGIN);
+ aEntityLayout->setSpacing(SPACING);
- QFrame* aFrame = new QFrame(mySelGrp);
+ QRadioButton* aFaceRb = new QRadioButton(tr("SMESH_FACE"), aEntityTypeGrp);
+ QRadioButton* aVolumeRb = new QRadioButton(tr("SMESH_VOLUME"), aEntityTypeGrp);
- myListBox = new QListBox(aFrame);
- myListBox->setSelectionMode(QListBox::Extended);
- myListBox->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
- myListBox->installEventFilter(this);
+ aEntityLayout->addWidget(aFaceRb);
+ aEntityLayout->addWidget(aVolumeRb);
- myFilterBtn = new QPushButton(tr("FILTER") , aFrame);
- myAddBtn = new QPushButton(tr("ADD") , aFrame);
- myRemoveBtn = new QPushButton(tr("REMOVE") , aFrame);
- mySortBtn = new QPushButton(tr("SORT_LIST"), aFrame);
+ myEntityTypeGrp->addButton(aFaceRb, 0);
+ myEntityTypeGrp->addButton(aVolumeRb, 1);
+ aFaceRb->setChecked(true);
+ myEntityType = myEntityTypeGrp->checkedId();
- QGridLayout* aLay = new QGridLayout(aFrame, 5, 2, 0, 5);
- aLay->addMultiCellWidget(myListBox, 0, 4, 0, 0);
- aLay->addWidget(myFilterBtn, 0, 1);
- aLay->addWidget(myAddBtn, 1, 1);
- aLay->addWidget(myRemoveBtn, 2, 1);
- aLay->addWidget(mySortBtn, 3, 1);
+ mySelGrpLayout->addWidget(aEntityTypeGrp, 0, 0, 1, 2);
+ }
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
- aLay->addItem(aSpacer, 4, 1);
+ myListBox = new QListWidget(mySelGrp);
+ myListBox->setSelectionMode(QListWidget::ExtendedSelection);
+ myListBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+ myListBox->installEventFilter(this);
+
+ myFilterBtn = new QPushButton(tr("FILTER"), mySelGrp);
+ myAddBtn = new QPushButton(tr("ADD"), mySelGrp);
+ myRemoveBtn = new QPushButton(tr("REMOVE"), mySelGrp);
+ mySortBtn = new QPushButton(tr("SORT_LIST"), mySelGrp);
+
+ int row = mySelGrpLayout->rowCount();
+ mySelGrpLayout->addWidget(myListBox, row, 0, 6, 1);
+ mySelGrpLayout->addWidget(myFilterBtn, row, 1);
+ mySelGrpLayout->addWidget(myAddBtn, row+2, 1);
+ mySelGrpLayout->addWidget(myRemoveBtn, row+3, 1);
+ mySelGrpLayout->addWidget(mySortBtn, row+5, 1);
+ mySelGrpLayout->setRowMinimumHeight(row+1, 10);
+ mySelGrpLayout->setRowMinimumHeight(row+4, 10);
+ mySelGrpLayout->setRowStretch(row+1, 5);
+ mySelGrpLayout->setRowStretch(row+4, 5);
myToAllChk = new QCheckBox(tr("TO_ALL"), mySelGrp);
+ mySelGrpLayout->addWidget(myToAllChk, mySelGrpLayout->rowCount(), 0,
+ 1, mySelGrpLayout->columnCount());
// Split/Join criterion group
- myCriterionGrp = new QGroupBox(3, Qt::Vertical, tr("SPLIT_JOIN_CRITERION"), aMainGrp);
-
- myGroupChoice = new QButtonGroup(3, Qt::Vertical, myCriterionGrp);
- myGroupChoice->setInsideMargin(0);
- myGroupChoice->setFrameStyle(QFrame::NoFrame);
- (new QRadioButton(tr("USE_DIAGONAL_1_3"), myGroupChoice))->setChecked(true);
- (new QRadioButton(tr("USE_DIAGONAL_2_4"), myGroupChoice));
- (new QRadioButton(tr("USE_NUMERIC_FUNC"), myGroupChoice));
+ myCriterionGrp = new QGroupBox(tr("SPLIT_JOIN_CRITERION"), aMainGrp);
+ QVBoxLayout* aCriterionLayout = new QVBoxLayout(myCriterionGrp);
+ aCriterionLayout->setMargin(MARGIN);
+ aCriterionLayout->setSpacing(SPACING);
+
+ myChoiceWidget = new QWidget(myCriterionGrp);
+ myGroupChoice = new QButtonGroup(myChoiceWidget);
+ QVBoxLayout* aGroupChoiceLayout = new QVBoxLayout(myChoiceWidget);
+ aGroupChoiceLayout->setMargin(0);
+ aGroupChoiceLayout->setSpacing(SPACING);
+
+ QRadioButton* aDiag13RB = new QRadioButton(tr("USE_DIAGONAL_1_3"), myChoiceWidget);
+ QRadioButton* aDiag24RB = new QRadioButton(tr("USE_DIAGONAL_2_4"), myChoiceWidget);
+ QRadioButton* aNumFuncRB = new QRadioButton(tr("USE_NUMERIC_FUNC"), myChoiceWidget);
+
+ aGroupChoiceLayout->addWidget(aDiag13RB);
+ aGroupChoiceLayout->addWidget(aDiag24RB);
+ aGroupChoiceLayout->addWidget(aNumFuncRB);
+ myGroupChoice->addButton(aDiag13RB, 0);
+ myGroupChoice->addButton(aDiag24RB, 1);
+ myGroupChoice->addButton(aNumFuncRB, 2);
+ aDiag13RB->setChecked(true);
myComboBoxFunctor = new QComboBox(myCriterionGrp);
- myComboBoxFunctor->insertItem(tr("ASPECTRATIO_ELEMENTS"));
- myComboBoxFunctor->insertItem(tr("MINIMUMANGLE_ELEMENTS"));
- myComboBoxFunctor->insertItem(tr("SKEW_ELEMENTS"));
- myComboBoxFunctor->insertItem(tr("AREA_ELEMENTS"));
- //myComboBoxFunctor->insertItem(tr("LENGTH2D_EDGES")); // for existing elements only
- //myComboBoxFunctor->insertItem(tr("MULTI2D_BORDERS")); // for existing elements only
- myComboBoxFunctor->setCurrentItem(0);
+ myComboBoxFunctor->addItem(tr("ASPECTRATIO_ELEMENTS"));
+ myComboBoxFunctor->addItem(tr("MINIMUMANGLE_ELEMENTS"));
+ myComboBoxFunctor->addItem(tr("SKEW_ELEMENTS"));
+ myComboBoxFunctor->addItem(tr("AREA_ELEMENTS"));
+ //myComboBoxFunctor->addItem(tr("LENGTH2D_EDGES")); // for existing elements only
+ //myComboBoxFunctor->addItem(tr("MULTI2D_BORDERS")); // for existing elements only
+ myComboBoxFunctor->setCurrentIndex(0);
+
+ aCriterionLayout->addWidget(myChoiceWidget);
+ aCriterionLayout->addWidget(myComboBoxFunctor);
myCriterionGrp->hide();
- myGroupChoice->hide();
+ myChoiceWidget->hide();
myComboBoxFunctor->setEnabled(false);
// "Select from" group
- QGroupBox* aGrp = new QGroupBox(3, Qt::Horizontal, tr("SELECT_FROM"), aMainGrp);
+ QGroupBox* aGrp = new QGroupBox(tr("SELECT_FROM"), aMainGrp);
+ QGridLayout* aGrpLayout = new QGridLayout(aGrp);
+ aGrpLayout->setMargin(MARGIN);
+ aGrpLayout->setSpacing(SPACING);
mySubmeshChk = new QCheckBox(tr("SMESH_SUBMESH"), aGrp);
mySubmeshBtn = new QPushButton(aGrp);
mySubmesh = new QLineEdit(aGrp);
mySubmesh->setReadOnly(true);
- mySubmeshBtn->setPixmap(aPix);
+ mySubmeshBtn->setIcon(aPix);
myGroupChk = new QCheckBox(tr("SMESH_GROUP"), aGrp);
myGroupBtn = new QPushButton(aGrp);
myGroup = new QLineEdit(aGrp);
myGroup->setReadOnly(true);
- myGroupBtn->setPixmap(aPix);
+ myGroupBtn->setIcon(aPix);
+
+ aGrpLayout->addWidget(mySubmeshChk);
+ aGrpLayout->addWidget(mySubmeshBtn);
+ aGrpLayout->addWidget(mySubmesh);
+ aGrpLayout->addWidget(myGroupChk);
+ aGrpLayout->addWidget(myGroupBtn);
+ aGrpLayout->addWidget(myGroup);
+
+ aMainGrpLayout->addWidget(mySelGrp);
+ aMainGrpLayout->addWidget(myCriterionGrp);
+ aMainGrpLayout->addWidget(aGrp);
return aMainGrp;
}
// name : SMESHGUI_MultiEditDlg::createButtonFrame
// Purpose : Create frame containing buttons
//=======================================================================
-QFrame* SMESHGUI_MultiEditDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_MultiEditDlg::createButtonFrame (QWidget* theParent)
{
- QFrame* aFrame = new QFrame (theParent);
- aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
+ QGroupBox* aFrame = new QGroupBox(theParent);
myOkBtn = new QPushButton (tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton (tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton (tr("SMESH_BUT_CLOSE"), aFrame);
- myHelpBtn = new QPushButton (tr("SMESH_BUT_HELP"), aFrame);
-
- QSpacerItem* aSpacer = new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ myHelpBtn = new QPushButton (tr("SMESH_BUT_HELP"), aFrame);
- QHBoxLayout* aLay = new QHBoxLayout (aFrame, MARGIN, SPACING);
+ QHBoxLayout* aLay = new QHBoxLayout (aFrame);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
aLay->addWidget(myOkBtn);
+ aLay->addSpacing(10);
aLay->addWidget(myApplyBtn);
- aLay->addItem(aSpacer);
+ aLay->addSpacing(10);
+ aLay->addStretch();
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
{
if (myFilterDlg != 0)
{
- myFilterDlg->reparent(0, QPoint());
+ myFilterDlg->setParent(0);
delete myFilterDlg;
}
}
{
if (object == myListBox && event->type() == QEvent::KeyPress) {
QKeyEvent* ke = (QKeyEvent*)event;
- if (ke->key() == Key_Delete)
+ if (ke->key() == Qt::Key_Delete)
onRemoveBtn();
}
return QDialog::eventFilter(object, event);
aNF = aFilterMgr->CreateLength2D();
else if (myComboBoxFunctor->currentText() == tr("MULTI2D_BORDERS"))
aNF = aFilterMgr->CreateMultiConnection2D();
- else ;
+ else;
return aNF._retn();
}
// dialog controls
connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn() ));
- connect(myAddBtn , SIGNAL(clicked()), SLOT(onAddBtn() ));
+ connect(myAddBtn, SIGNAL(clicked()), SLOT(onAddBtn() ));
connect(myRemoveBtn, SIGNAL(clicked()), SLOT(onRemoveBtn() ));
- connect(mySortBtn , SIGNAL(clicked()), SLOT(onSortListBtn()));
+ connect(mySortBtn, SIGNAL(clicked()), SLOT(onSortListBtn()));
connect(mySubmeshChk, SIGNAL(stateChanged(int)), SLOT(onSubmeshChk()));
- connect(myGroupChk , SIGNAL(stateChanged(int)), SLOT(onGroupChk() ));
- connect(myToAllChk , SIGNAL(stateChanged(int)), SLOT(onToAllChk() ));
+ connect(myGroupChk, SIGNAL(stateChanged(int)), SLOT(onGroupChk() ));
+ connect(myToAllChk, SIGNAL(stateChanged(int)), SLOT(onToAllChk() ));
if (myEntityTypeGrp)
- connect(myEntityTypeGrp, SIGNAL(clicked(int)), SLOT(on3d2dChanged(int)));
+ connect(myEntityTypeGrp, SIGNAL(buttonClicked(int)), SLOT(on3d2dChanged(int)));
connect(myListBox, SIGNAL(selectionChanged()), SLOT(onListSelectionChanged()));
{
// skl 07.02.2006
SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh();
- if( myFilterType == SMESHGUI_TriaFilter ||
- myFilterType == SMESHGUI_QuadFilter ||
- myFilterType == SMESHGUI_FaceFilter ) {
+ if( myFilterType == SMESH::TriaFilter ||
+ myFilterType == SMESH::QuadFilter ||
+ myFilterType == SMESH::FaceFilter ) {
SMDS_FaceIteratorPtr it = aMesh->facesIterator();
while(it->more()) {
const SMDS_MeshFace* f = it->next();
- if(myFilterType == SMESHGUI_FaceFilter) {
+ if(myFilterType == SMESH::FaceFilter) {
myIds.Add(f->GetID());
}
- else if( myFilterType==SMESHGUI_TriaFilter &&
+ else if( myFilterType==SMESH::TriaFilter &&
( f->NbNodes()==3 || f->NbNodes()==6 ) ) {
myIds.Add(f->GetID());
}
- else if( myFilterType==SMESHGUI_QuadFilter &&
+ else if( myFilterType==SMESH::QuadFilter &&
( f->NbNodes()==4 || f->NbNodes()==8 ) ) {
myIds.Add(f->GetID());
}
}
}
- else if(myFilterType == SMESHGUI_VolumeFilter) {
+ else if(myFilterType == SMESH::VolumeFilter) {
SMDS_VolumeIteratorPtr it = aMesh->volumesIterator();
while(it->more()) {
const SMDS_MeshVolume* f = it->next();
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
Handle(SALOME_InteractiveObject) anIO = aList.First();
int aNbItems = SMESH::GetNameOfSelectedElements(mySelector,anIO,aListStr);
if (aNbItems > 0) {
- QStringList anElements = QStringList::split(" ", aListStr);
- QListBoxItem* anItem = 0;
+ QStringList anElements = aListStr.split(" ", QString::SkipEmptyParts);
for (QStringList::iterator it = anElements.begin(); it != anElements.end(); ++it) {
- anItem = myListBox->findItem(*it, Qt::ExactMatch);
- if (anItem) myListBox->setSelected(anItem, true);
+ QList<QListWidgetItem*> items = myListBox->findItems(*it, Qt::MatchExactly);
+ QListWidgetItem* anItem;
+ foreach(anItem, items)
+ anItem->setSelected(true);
}
}
{
myIds.Clear();
for (int i = 0, n = myListBox->count(); i < n; i++)
- myIds.Add(myListBox->text(i).toInt());
+ myIds.Add(myListBox->item(i)->text().toInt());
emit ListContensChanged();
mySelector->GetIndex(aList.First(),toBeAdded);
} else if (mySubmeshChk->isChecked()) {
SALOME_ListIteratorOfListIO anIter(aList);
- for (; anIter.More(); anIter.Next()) {
+ for ( ; anIter.More(); anIter.Next()) {
SMESH::SMESH_subMesh_var aSubMesh =
SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(anIter.Value());
if (!aSubMesh->_is_nil()) {
}
} else if (myGroupChk->isChecked()) {
SALOME_ListIteratorOfListIO anIter(aList);
- for (; anIter.More(); anIter.Next()) {
+ for ( ; anIter.More(); anIter.Next()) {
SMESH::SMESH_GroupBase_var aGroup =
SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(anIter.Value());
if (!aGroup->_is_nil() && (aGroup->GetType() == SMESH::FACE &&
myGroupChk->setChecked(false);
for(int i = 1; i <= toBeAdded.Extent(); i++)
if (myIds.Add(toBeAdded(i))) {
- QListBoxItem * item = new QListBoxText(QString("%1").arg(toBeAdded(i)));
- myListBox->insertItem(item);
- myListBox->setSelected(item, true);
+ QListWidgetItem* item = new QListWidgetItem(QString("%1").arg(toBeAdded(i)));
+ myListBox->addItem(item);
+ item->setSelected(true);
}
myBusy = false;
{
myBusy = true;
- for (int i = 0, n = myListBox->count(); i < n; i++)
+ QList<QListWidgetItem*> selItems = myListBox->selectedItems();
+ QListWidgetItem* item;
+ foreach(item, selItems)
{
- for (int i = myListBox->count(); i > 0; i--) {
- if (myListBox->isSelected(i - 1))
- {
- int anId = myListBox->text(i - 1).toInt();
- myIds.Remove(anId);
- myIds.Remove(anId);
- myListBox->removeItem(i-1);
- }
- }
+ myIds.Remove(item->text().toInt());
+ delete item;
}
+
myBusy = false;
emit ListContensChanged();
int i, k = myListBox->count();
if (k > 0)
{
- QStringList aSelected;
+ QList<int> aSelected;
std::vector<int> anArray(k);
- QListBoxItem* anItem;
- for (anItem = myListBox->firstItem(), i = 0; anItem != 0; anItem = anItem->next(), i++)
+ for (i = 0; i < k; i++)
{
- anArray[ i ] = anItem->text().toInt();
- if (anItem->isSelected())
- aSelected.append(anItem->text());
+ int id = myListBox->item(i)->text().toInt();
+ anArray[ i ] = id;
+ if (myListBox->item(i)->isSelected())
+ aSelected.append(id);
}
std::sort(anArray.begin(), anArray.end());
- myListBox->clear();
- for (i = 0; i < k; i++)
- myListBox->insertItem(QString::number(anArray[ i ]));
- for (QStringList::iterator it = aSelected.begin(); it != aSelected.end(); ++it)
- {
- anItem = myListBox->findItem(*it, Qt::ExactMatch);
- if (anItem)
- myListBox->setSelected(anItem, true);
+ myListBox->clear();
+ for (i = 0; i < k; i++) {
+ QListWidgetItem* item = new QListWidgetItem(QString::number(anArray[i]));
+ myListBox->addItem(item);
+ item->setSelected(aSelected.contains(anArray[i]));
}
}
myBusy = false;
TVisualObjPtr anObj = anActor->GetObject();
TColStd_MapOfInteger anIndexes;
- for (QListBoxItem* anItem = myListBox->firstItem(); anItem != 0; anItem = anItem->next())
+ int total = myListBox->count();
+ for (int i = 0; i < total; i++)
{
- if (anItem->isSelected())
+ if (myListBox->item(i)->isSelected())
{
- int anId = anItem->text().toInt();
+ int anId = myListBox->item(i)->text().toInt();
if (anObj->GetElemVTKId(anId) >= 0) // avoid exception in hilight
anIndexes.Add(anId);
}
} else {
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(FaceSelection);
- if (myFilterType == SMESHGUI_TriaFilter)
+ if (myFilterType == SMESH::TriaFilter)
SMESH::SetFilter(new SMESHGUI_TriangleFilter());
- else if (myFilterType == SMESHGUI_QuadFilter)
+ else if (myFilterType == SMESH::QuadFilter)
SMESH::SetFilter(new SMESHGUI_QuadrangleFilter());
else
SMESH::SetFilter(new SMESHGUI_FacesFilter());
emit ListContensChanged();
if (type)
- myFilterType = SMESHGUI_VolumeFilter;
+ myFilterType = SMESH::VolumeFilter;
else
- myFilterType = SMESHGUI_FaceFilter;
+ myFilterType = SMESH::FaceFilter;
updateButtons();
setSelectionMode();
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
/*!
*/
SMESHGUI_ChangeOrientationDlg
-::SMESHGUI_ChangeOrientationDlg(SMESHGUI* theModule,
- const char* theName):
- SMESHGUI_MultiEditDlg(theModule, SMESHGUI_FaceFilter, true, theName)
+::SMESHGUI_ChangeOrientationDlg(SMESHGUI* theModule):
+ SMESHGUI_MultiEditDlg(theModule, SMESH::FaceFilter, true)
{
- setCaption(tr("CAPTION"));
+ setWindowTitle(tr("CAPTION"));
myHelpFileName = "changing_orientation_of_elements_page.html";
}
*/
SMESHGUI_UnionOfTrianglesDlg
-::SMESHGUI_UnionOfTrianglesDlg(SMESHGUI* theModule,
- const char* theName):
- SMESHGUI_MultiEditDlg(theModule, SMESHGUI_TriaFilter, false, theName)
+::SMESHGUI_UnionOfTrianglesDlg(SMESHGUI* theModule):
+ SMESHGUI_MultiEditDlg(theModule, SMESH::TriaFilter, false)
{
- setCaption(tr("CAPTION"));
+ setWindowTitle(tr("CAPTION"));
myComboBoxFunctor->setEnabled(true);
- myComboBoxFunctor->insertItem(tr("WARP_ELEMENTS")); // for quadrangles only
- myComboBoxFunctor->insertItem(tr("TAPER_ELEMENTS")); // for quadrangles only
+ myComboBoxFunctor->addItem(tr("WARP_ELEMENTS")); // for quadrangles only
+ myComboBoxFunctor->addItem(tr("TAPER_ELEMENTS")); // for quadrangles only
// Maximum angle
- QGroupBox* aMaxAngleGrp = new QGroupBox (2, Qt::Horizontal, myCriterionGrp);
- aMaxAngleGrp->setInsideMargin(0);
- aMaxAngleGrp->setFrameStyle(QFrame::NoFrame);
- new QLabel (tr("MAXIMUM_ANGLE"), aMaxAngleGrp);
+ QWidget* aMaxAngleGrp = new QWidget(myCriterionGrp);
+ QHBoxLayout* aMaxAngleGrpLayout = new QHBoxLayout(aMaxAngleGrp);
+ aMaxAngleGrpLayout->setMargin(0);
+ aMaxAngleGrpLayout->setSpacing(SPACING);
+
+ QLabel* aLab = new QLabel (tr("MAXIMUM_ANGLE"), aMaxAngleGrp);
myMaxAngleSpin = new SMESHGUI_SpinBox (aMaxAngleGrp);
myMaxAngleSpin->RangeStepAndValidator(0, 180.0, 1.0, 3);
myMaxAngleSpin->SetValue(30.0);
+ aMaxAngleGrpLayout->addWidget(aLab);
+ aMaxAngleGrpLayout->addWidget(myMaxAngleSpin);
+
+ ((QVBoxLayout*)aMaxAngleGrpLayout->layout())->addWidget(aMaxAngleGrp);
myCriterionGrp->show();
myHelpFileName = "uniting_set_of_triangles_page.html";
*/
SMESHGUI_CuttingOfQuadsDlg
-::SMESHGUI_CuttingOfQuadsDlg(SMESHGUI* theModule,
- const char* theName):
- SMESHGUI_MultiEditDlg(theModule, SMESHGUI_QuadFilter, false, theName)
+::SMESHGUI_CuttingOfQuadsDlg(SMESHGUI* theModule):
+ SMESHGUI_MultiEditDlg(theModule, SMESH::QuadFilter, false)
{
- setCaption(tr("CAPTION"));
+ setWindowTitle(tr("CAPTION"));
myPreviewActor = 0;
myPreviewChk = new QCheckBox (tr("PREVIEW"), mySelGrp);
+ QGridLayout* aLay = (QGridLayout*)(mySelGrp->layout());
+ aLay->addWidget(myPreviewChk, aLay->rowCount(), 0, 1, aLay->columnCount());
myCriterionGrp->show();
- myGroupChoice->show();
+ myChoiceWidget->show();
myComboBoxFunctor->setEnabled(false);
- connect(myPreviewChk , SIGNAL(stateChanged(int)) , this, SLOT(onPreviewChk()));
- connect(myGroupChoice , SIGNAL(clicked(int)) , this, SLOT(onCriterionRB()));
- connect(myComboBoxFunctor, SIGNAL(activated(int)) , this, SLOT(onPreviewChk()));
- connect(this , SIGNAL(ListContensChanged()), this, SLOT(onPreviewChk()));
+ connect(myPreviewChk, SIGNAL(stateChanged(int)), this, SLOT(onPreviewChk()));
+ connect(myGroupChoice, SIGNAL(buttonClicked(int)), this, SLOT(onCriterionRB()));
+ connect(myComboBoxFunctor, SIGNAL(activated(int)), this, SLOT(onPreviewChk()));
+ connect(this, SIGNAL(ListContensChanged()), this, SLOT(onPreviewChk()));
myHelpFileName = "cutting_quadrangles_page.html";
}
bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
const SMESH::long_array& theIds)
{
- switch (myGroupChoice->id(myGroupChoice->selected())) {
+ switch (myGroupChoice->checkedId()) {
case 0: // use diagonal 1-3
return theEditor->SplitQuad(theIds, true);
case 1: // use diagonal 2-4
void SMESHGUI_CuttingOfQuadsDlg::onCriterionRB()
{
- if (myGroupChoice->id(myGroupChoice->selected()) == 2) // Use numeric functor
+ if (myGroupChoice->checkedId() == 2) // Use numeric functor
myComboBoxFunctor->setEnabled(true);
else
myComboBoxFunctor->setEnabled(false);
return;
// 0 - use diagonal 1-3, 1 - use diagonal 2-4, 2 - use numerical functor
- int aChoice = myGroupChoice->id(myGroupChoice->selected());
+ int aChoice = myGroupChoice->checkedId();
SMESH::NumericalFunctor_var aCriterion = SMESH::NumericalFunctor::_nil();
SMESH::SMESH_MeshEditor_var aMeshEditor = SMESH::SMESH_MeshEditor::_nil();
if (aChoice == 2) {
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_MultiEditDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_MultiEditDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-#ifndef SMESHGUI_MultiEditDlg_H
-#define SMESHGUI_MultiEditDlg_H
+#ifndef SMESHGUI_MULTIEDITDLG_H
+#define SMESHGUI_MULTIEDITDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
-
-#include "SUIT_SelectionFilter.h"
+// Qt includes
+#include <QDialog>
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
-#include CORBA_SERVER_HEADER(SMESH_Filter)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
class SMESHGUI;
class LightApp_SelectionMgr;
class SALOME_Actor;
class SVTK_Selector;
-class SVTK_ViewWindow;
-class QFrame;
-class QObject;
-class QListBox;
+class QListWidget;
class QComboBox;
class QCheckBox;
class QGroupBox;
Q_OBJECT
public:
- SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
- const int,
- const bool = false,
- const char* = 0 );
- virtual ~SMESHGUI_MultiEditDlg();
+ SMESHGUI_MultiEditDlg( SMESHGUI*, const int, const bool = false );
+ virtual ~SMESHGUI_MultiEditDlg();
void Init();
- bool eventFilter( QObject* object, QEvent* event );
+ bool eventFilter( QObject*, QEvent* );
signals:
void ListContensChanged();
SMESH::NumericalFunctor_ptr getNumericalFunctor();
protected:
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ;
- void hideEvent ( QHideEvent * ); /* ESC key */
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent * );
+ void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
- QFrame* createButtonFrame( QWidget* );
- QFrame* createMainFrame ( QWidget*, const bool );
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame( QWidget*, const bool );
bool isValid( const bool ) const;
SMESH::long_array_var getIds();
void updateButtons();
void setSelectionMode();
- virtual bool isIdValid( const int theID ) const;
- virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& ) = 0;
+ virtual bool isIdValid( const int ) const;
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr,
+ const SMESH::long_array& ) = 0;
int entityType();
protected:
QGroupBox* mySelGrp;
QGroupBox* myCriterionGrp;
+ QWidget* myChoiceWidget;
QButtonGroup* myGroupChoice;
QComboBox* myComboBoxFunctor;
- QListBox* myListBox;
+ QListWidget* myListBox;
QPushButton* myFilterBtn;
QPushButton* myAddBtn;
QPushButton* myRemoveBtn;
Q_OBJECT
public:
- SMESHGUI_ChangeOrientationDlg(SMESHGUI* theModule,
- const char* = 0);
- virtual ~SMESHGUI_ChangeOrientationDlg();
+ SMESHGUI_ChangeOrientationDlg( SMESHGUI* );
+ virtual ~SMESHGUI_ChangeOrientationDlg();
protected:
virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
Q_OBJECT
public:
- SMESHGUI_UnionOfTrianglesDlg(SMESHGUI* theModule,
- const char* = 0);
- virtual ~SMESHGUI_UnionOfTrianglesDlg();
+ SMESHGUI_UnionOfTrianglesDlg( SMESHGUI* );
+ virtual ~SMESHGUI_UnionOfTrianglesDlg();
protected:
- virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
private:
SMESHGUI_SpinBox* myMaxAngleSpin;
Q_OBJECT
public:
- SMESHGUI_CuttingOfQuadsDlg(SMESHGUI* theModule,
- const char* = 0);
- virtual ~SMESHGUI_CuttingOfQuadsDlg();
+ SMESHGUI_CuttingOfQuadsDlg( SMESHGUI* );
+ virtual ~SMESHGUI_CuttingOfQuadsDlg();
protected:
virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
QCheckBox* myPreviewChk;
};
-#endif
+#endif // SMESHGUI_MULTIEDITDLG_H
-// SMESH SMESHGUI : GUI for SMESH 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
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_NodesDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_NodesDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_NodesDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
-#include "SMESH_Actor.h"
-#include "SMESH_ActorUtils.h"
-#include "SMESH_ObjectDef.h"
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+#include <SMESH_ObjectDef.h>
-#include "SMDS_Mesh.hxx"
-#include "SMDS_MeshNode.hxx"
+#include <SMDS_Mesh.hxx>
+#include <SMDS_MeshNode.hxx>
-#include "SUIT_Session.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_ViewWindow.h"
-#include "SUIT_ViewManager.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_Desktop.h"
+// SALOME GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
-#include "SalomeApp_Study.h"
-#include "LightApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "SVTK_Selector.h"
-#include "SVTK_ViewWindow.h"
-#include "VTKViewer_CellLocationsArray.h"
+#include <SVTK_ViewWindow.h>
+#include <VTKViewer_CellLocationsArray.h>
-#include "SALOME_Actor.h"
-#include "SALOME_ListIO.hxx"
+// SALOME KERNEL includes
+#include <SALOMEDS_Study.hxx>
+#include <SALOMEDS_SObject.hxx>
-#include "utilities.h"
+#include <utilities.h>
-// VTK Includes
-#include <vtkCell.h>
+// VTK includes
#include <vtkIdList.h>
#include <vtkCellArray.h>
#include <vtkUnsignedCharArray.h>
#include <vtkUnstructuredGrid.h>
#include <vtkDataSetMapper.h>
-#include <vtkActorCollection.h>
#include <vtkRenderer.h>
#include <vtkProperty.h>
-
-// QT Includes
-#include <qbuttongroup.h>
-#include <qframe.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qvariant.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qvalidator.h>
-#include <qevent.h>
-
+#include <vtkPoints.h>
+
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
-
-
-namespace SMESH {
+#define SPACING 6
+#define MARGIN 11
- void AddNode (SMESH::SMESH_Mesh_ptr theMesh, float x, float y, float z)
+namespace SMESH
+{
+ void AddNode( SMESH::SMESH_Mesh_ptr theMesh, float x, float y, float z )
{
SUIT_OverrideCursor wc;
try {
- _PTR(SObject) aSobj = SMESH::FindSObject(theMesh);
+ _PTR(SObject) aSobj = SMESH::FindSObject( theMesh );
SMESH::SMESH_MeshEditor_var aMeshEditor = theMesh->GetMeshEditor();
- aMeshEditor->AddNode(x,y,z);
+ aMeshEditor->AddNode( x, y, z );
_PTR(Study) aStudy = GetActiveStudyDocument();
CORBA::Long anId = aStudy->StudyId();
- if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId, aSobj->GetID().c_str())) {
- aVisualObj->Update(true);
+ if (TVisualObjPtr aVisualObj = SMESH::GetVisualObj( anId, aSobj->GetID().c_str() ) ) {
+ aVisualObj->Update( true );
}
- } catch (SALOME::SALOME_Exception& exc) {
- INFOS("Follow exception was cought:\n\t" << exc.details.text);
- } catch (const std::exception& exc) {
- INFOS("Follow exception was cought:\n\t" << exc.what());
- } catch (...) {
- INFOS("Unknown exception was cought !!!");
+ }
+ catch ( SALOME::SALOME_Exception& exc ) {
+ INFOS( "Follow exception was cought:\n\t" << exc.details.text );
+ }
+ catch ( const std::exception& exc ) {
+ INFOS( "Follow exception was cought:\n\t" << exc.what() );
+ }
+ catch ( ... ) {
+ INFOS( "Unknown exception was cought !!!" );
}
}
- class TNodeSimulation {
- SVTK_ViewWindow* myViewWindow;
+ class TNodeSimulation
+ {
+ SVTK_ViewWindow* myViewWindow;
- SALOME_Actor *myPreviewActor;
+ SALOME_Actor* myPreviewActor;
vtkDataSetMapper* myMapper;
- vtkPoints* myPoints;
+ vtkPoints* myPoints;
public:
- TNodeSimulation(SVTK_ViewWindow* theViewWindow):
- myViewWindow(theViewWindow)
+ TNodeSimulation( SVTK_ViewWindow* theViewWindow ):
+ myViewWindow( theViewWindow )
{
vtkUnstructuredGrid* aGrid = vtkUnstructuredGrid::New();
// Create points
myPoints = vtkPoints::New();
- myPoints->SetNumberOfPoints(1);
- myPoints->SetPoint(0,0.0,0.0,0.0);
+ myPoints->SetNumberOfPoints( 1 );
+ myPoints->SetPoint( 0, 0.0, 0.0, 0.0 );
// Create cells
vtkIdList *anIdList = vtkIdList::New();
- anIdList->SetNumberOfIds(1);
+ anIdList->SetNumberOfIds( 1 );
vtkCellArray *aCells = vtkCellArray::New();
- aCells->Allocate(2, 0);
+ aCells->Allocate( 2, 0 );
vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
- aCellTypesArray->SetNumberOfComponents(1);
- aCellTypesArray->Allocate(1);
+ aCellTypesArray->SetNumberOfComponents( 1 );
+ aCellTypesArray->Allocate( 1 );
- anIdList->SetId(0, 0);
- aCells->InsertNextCell(anIdList);
- aCellTypesArray->InsertNextValue(VTK_VERTEX);
+ anIdList->SetId( 0, 0 );
+ aCells->InsertNextCell( anIdList );
+ aCellTypesArray->InsertNextValue( VTK_VERTEX );
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
- aCellLocationsArray->SetNumberOfComponents(1);
- aCellLocationsArray->SetNumberOfTuples(1);
+ aCellLocationsArray->SetNumberOfComponents( 1 );
+ aCellLocationsArray->SetNumberOfTuples( 1 );
aCells->InitTraversal();
vtkIdType npts = 0;
- aCellLocationsArray->SetValue(0, aCells->GetTraversalLocation(npts));
+ aCellLocationsArray->SetValue( 0, aCells->GetTraversalLocation( npts ) );
- aGrid->SetCells(aCellTypesArray, aCellLocationsArray, aCells);
+ aGrid->SetCells( aCellTypesArray, aCellLocationsArray, aCells );
- aGrid->SetPoints(myPoints);
- aGrid->SetCells(aCellTypesArray, aCellLocationsArray,aCells);
+ aGrid->SetPoints( myPoints );
+ aGrid->SetCells( aCellTypesArray, aCellLocationsArray, aCells );
aCellLocationsArray->Delete();
aCellTypesArray->Delete();
aCells->Delete();
// Create and display actor
myMapper = vtkDataSetMapper::New();
- myMapper->SetInput(aGrid);
+ myMapper->SetInput( aGrid );
aGrid->Delete();
myPreviewActor = SALOME_Actor::New();
- myPreviewActor->SetInfinitive(true);
+ myPreviewActor->SetInfinitive( true );
myPreviewActor->VisibilityOff();
myPreviewActor->PickableOff();
- myPreviewActor->SetMapper(myMapper);
+ myPreviewActor->SetMapper( myMapper );
vtkProperty* aProp = vtkProperty::New();
aProp->SetRepresentationToPoints();
myPreviewActor->SetProperty( aProp );
aProp->Delete();
- myViewWindow->AddActor(myPreviewActor);
+ myViewWindow->AddActor( myPreviewActor );
}
- void SetPosition (float x, float y, float z)
+ void SetPosition( float x, float y, float z )
{
- myPoints->SetPoint(0,x,y,z);
+ myPoints->SetPoint( 0, x, y, z );
myPoints->Modified();
- SetVisibility(true);
+ SetVisibility( true );
}
- void SetVisibility (bool theVisibility)
+ void SetVisibility( bool theVisibility )
{
- myPreviewActor->SetVisibility(theVisibility);
+ myPreviewActor->SetVisibility( theVisibility );
RepaintCurrentView();
}
~TNodeSimulation()
{
- myViewWindow->RemoveActor(myPreviewActor);
+ myViewWindow->RemoveActor( myPreviewActor );
myPreviewActor->Delete();
myMapper->RemoveAllInputs();
// class : SMESHGUI_NodesDlg()
// purpose :
//=================================================================================
-SMESHGUI_NodesDlg::SMESHGUI_NodesDlg (SMESHGUI* theModule,
- const char* name,
- bool modal,
- WFlags fl):
- QDialog(SMESH::GetDesktop(theModule),
- name,
- modal,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
- mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
- mySMESHGUI(theModule)
+SMESHGUI_NodesDlg::SMESHGUI_NodesDlg( SMESHGUI* theModule ):
+ QDialog( SMESH::GetDesktop( theModule ) ),
+ mySelector( SMESH::GetViewWindow( theModule )->GetSelector() ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ mySMESHGUI( theModule )
{
- mySimulation = new SMESH::TNodeSimulation(SMESH::GetViewWindow( mySMESHGUI ));
-
- QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_NODE")));
- if (!name)
- setName("SMESHGUI_NodesDlg");
- resize(303, 185);
- setCaption(tr("MESH_NODE_TITLE"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_NodesDlgLayout = new QGridLayout(this);
- SMESHGUI_NodesDlgLayout->setSpacing(6);
- SMESHGUI_NodesDlgLayout->setMargin(11);
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle( "MESH_NODE_TITLE" );
+ setSizeGripEnabled( true );
+
+ mySimulation = new SMESH::TNodeSimulation( SMESH::GetViewWindow( mySMESHGUI ) );
+
+ QPixmap image0( SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap( "SMESH",
+ tr( "ICON_DLG_NODE" ) ) );
+
+ QVBoxLayout* SMESHGUI_NodesDlgLayout = new QVBoxLayout( this );
+ SMESHGUI_NodesDlgLayout->setSpacing( SPACING );
+ SMESHGUI_NodesDlgLayout->setMargin( MARGIN );
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_NodesDlgLayout->addWidget(GroupButtons, 2, 0);
+ GroupConstructors = new QGroupBox( tr( "MESH_NODE" ), this );
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout( GroupConstructors );
+ GroupConstructorsLayout->setSpacing( SPACING );
+ GroupConstructorsLayout->setMargin( MARGIN );
+
+ Constructor1 = new QRadioButton( GroupConstructors );
+ Constructor1->setIcon( image0 );
+ Constructor1->setChecked( true );
+
+ GroupConstructorsLayout->addWidget( Constructor1 );
+ GroupConstructorsLayout->addStretch();
+
+ /***************************************************************/
+ GroupCoordinates = new QGroupBox( tr( "SMESH_COORDINATES" ), this );
+ QHBoxLayout* GroupCoordinatesLayout = new QHBoxLayout(GroupCoordinates);
+ GroupCoordinatesLayout->setSpacing(SPACING);
+ GroupCoordinatesLayout->setMargin(MARGIN);
+
+ TextLabel_X = new QLabel( tr( "SMESH_X" ), GroupCoordinates );
+ SpinBox_X = new SMESHGUI_SpinBox( GroupCoordinates );
+
+ TextLabel_Y = new QLabel( tr( "SMESH_Y" ), GroupCoordinates );
+ SpinBox_Y = new SMESHGUI_SpinBox( GroupCoordinates );
+
+ TextLabel_Z = new QLabel( tr( "SMESH_Z" ), GroupCoordinates );
+ SpinBox_Z = new SMESHGUI_SpinBox( GroupCoordinates );
+
+ GroupCoordinatesLayout->addWidget( TextLabel_X );
+ GroupCoordinatesLayout->addWidget( SpinBox_X );
+ GroupCoordinatesLayout->addWidget( TextLabel_Y);
+ GroupCoordinatesLayout->addWidget( SpinBox_Y );
+ GroupCoordinatesLayout->addWidget( TextLabel_Z );
+ GroupCoordinatesLayout->addWidget( SpinBox_Z );
/***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setTitle(tr("MESH_NODE" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- Constructor1 = new QRadioButton(GroupConstructors, "Constructor1");
- Constructor1->setText(tr("" ));
- Constructor1->setPixmap(image0);
- Constructor1->setChecked(TRUE);
- GroupConstructorsLayout->addWidget(Constructor1, 0, 0);
- QSpacerItem* spacer_2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupConstructorsLayout->addItem(spacer_2, 0, 1);
- SMESHGUI_NodesDlgLayout->addWidget(GroupConstructors, 0, 0);
+ GroupButtons = new QGroupBox( this );
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
+ GroupButtonsLayout->setSpacing( SPACING );
+ GroupButtonsLayout->setMargin( MARGIN );
+ buttonOk = new QPushButton( tr( "SMESH_BUT_OK" ), GroupButtons );
+ buttonOk->setAutoDefault( true );
+ buttonOk->setDefault( true );
+ buttonApply = new QPushButton( tr( "SMESH_BUT_APPLY" ), GroupButtons );
+ buttonApply->setAutoDefault( true );
+ buttonCancel = new QPushButton( tr( "SMESH_BUT_CLOSE" ), GroupButtons );
+ buttonCancel->setAutoDefault( true );
+ buttonHelp = new QPushButton( tr( "SMESH_BUT_HELP" ), GroupButtons );
+ buttonHelp->setAutoDefault( true );
+
+ GroupButtonsLayout->addWidget( buttonOk );
+ GroupButtonsLayout->addSpacing( 10 );
+ GroupButtonsLayout->addWidget( buttonApply );
+ GroupButtonsLayout->addSpacing( 10 );
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget( buttonCancel );
+ GroupButtonsLayout->addWidget( buttonHelp );
/***************************************************************/
- GroupCoordinates = new QGroupBox(this, "GroupCoordinates");
- GroupCoordinates->setTitle(tr("SMESH_COORDINATES" ));
- GroupCoordinates->setColumnLayout(0, Qt::Vertical);
- GroupCoordinates->layout()->setSpacing(0);
- GroupCoordinates->layout()->setMargin(0);
- GroupCoordinatesLayout = new QGridLayout(GroupCoordinates->layout());
- GroupCoordinatesLayout->setAlignment(Qt::AlignTop);
- GroupCoordinatesLayout->setSpacing(6);
- GroupCoordinatesLayout->setMargin(11);
-
- TextLabel_X = new QLabel(GroupCoordinates, "TextLabel_X");
- TextLabel_X->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
- TextLabel_X->setText(tr("SMESH_X" ));
- GroupCoordinatesLayout->addWidget(TextLabel_X, 0, 0);
-
- TextLabel_Y = new QLabel(GroupCoordinates, "TextLabel_Y");
- //TextLabel_Y->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabel_Y->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
- TextLabel_Y->setText(tr("SMESH_Y" ));
- GroupCoordinatesLayout->addWidget(TextLabel_Y, 0, 2);
-
- TextLabel_Z = new QLabel(GroupCoordinates, "TextLabel_Z");
- //TextLabel_Z->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabel_Z->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
- TextLabel_Z->setText(tr("SMESH_Z" ));
- GroupCoordinatesLayout->addWidget(TextLabel_Z, 0, 4);
-
- SpinBox_X = new SMESHGUI_SpinBox(GroupCoordinates, "SpinBox_X");
- GroupCoordinatesLayout->addWidget(SpinBox_X, 0, 1);
-
- SpinBox_Y = new SMESHGUI_SpinBox(GroupCoordinates, "SpinBox_Y");
- GroupCoordinatesLayout->addWidget(SpinBox_Y, 0, 3);
-
- SpinBox_Z = new SMESHGUI_SpinBox(GroupCoordinates, "SpinBox_Z");
- GroupCoordinatesLayout->addWidget(SpinBox_Z, 0, 5);
-
- SMESHGUI_NodesDlgLayout->addWidget(GroupCoordinates, 1, 0);
+ SMESHGUI_NodesDlgLayout->addWidget( GroupConstructors );
+ SMESHGUI_NodesDlgLayout->addWidget( GroupCoordinates );
+ SMESHGUI_NodesDlgLayout->addWidget( GroupButtons );
myHelpFileName = "adding_nodes_and_elements_page.html#adding_nodes_anchor";
// function : Init()
// purpose :
//=================================================================================
-void SMESHGUI_NodesDlg::Init ()
+void SMESHGUI_NodesDlg::Init()
{
/* Get setting of step value from file configuration */
- double step;
- // QString St = SUIT_CONFIG->getSetting("xxxxxxxxxxxxx"); TODO
- // step = St.toDouble(); TODO
- step = 25.0;
+ double step = 25.0;
/* min, max, step and decimals for spin boxes */
- SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
- SpinBox_Y->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
- SpinBox_Z->RangeStepAndValidator(COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY);
- SpinBox_X->SetValue(0.0);
- SpinBox_Y->SetValue(0.0);
- SpinBox_Z->SetValue(0.0);
+ SpinBox_X->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
+ SpinBox_Y->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
+ SpinBox_Z->RangeStepAndValidator( COORD_MIN, COORD_MAX, step, DBL_DIGITS_DISPLAY );
+ SpinBox_X->SetValue( 0.0 );
+ SpinBox_Y->SetValue( 0.0 );
+ SpinBox_Z->SetValue( 0.0 );
- mySMESHGUI->SetActiveDialogBox((QDialog*)this);
+ mySMESHGUI->SetActiveDialogBox( this );
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
+ connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
- connect(SpinBox_X, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
- connect(SpinBox_Y, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
- connect(SpinBox_Z, SIGNAL (valueChanged(double)), SLOT(ValueChangedInSpinBox(double)));
+ connect( SpinBox_X, SIGNAL( valueChanged( double ) ), SLOT( ValueChangedInSpinBox( double ) ) );
+ connect( SpinBox_Y, SIGNAL( valueChanged( double ) ), SLOT( ValueChangedInSpinBox( double ) ) );
+ connect( SpinBox_Z, SIGNAL( valueChanged( double ) ), SLOT( ValueChangedInSpinBox( double ) ) );
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
- connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
+ connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( SelectionIntoArgument() ) );
+ connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) );
/* to close dialog if study frame change */
- connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
-
- this->show();
+ connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( ClickOnCancel() ) );
// set selection mode
- SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
+ SMESH::SetPointRepresentation( true );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
+ aViewWindow->SetSelectionMode( NodeSelection );
SelectionIntoArgument();
}
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
-void SMESHGUI_NodesDlg::ValueChangedInSpinBox (double newValue)
+void SMESHGUI_NodesDlg::ValueChangedInSpinBox( double newValue )
{
- if (!myMesh->_is_nil()) {
+ if ( !myMesh->_is_nil() ) {
double vx = SpinBox_X->GetValue();
double vy = SpinBox_Y->GetValue();
double vz = SpinBox_Z->GetValue();
- mySimulation->SetPosition(vx,vy,vz);
+ mySimulation->SetPosition( vx, vy, vz );
}
}
//=================================================================================
void SMESHGUI_NodesDlg::ClickOnOk()
{
- if (ClickOnApply())
+ if ( ClickOnApply() )
ClickOnCancel();
}
//=================================================================================
bool SMESHGUI_NodesDlg::ClickOnApply()
{
- if (mySMESHGUI->isActiveStudyLocked())
+ if ( mySMESHGUI->isActiveStudyLocked() )
return false;
- if (myMesh->_is_nil()) {
- SUIT_MessageBox::warn1(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- tr("MESH_IS_NOT_SELECTED"), tr("SMESH_BUT_OK"));
+ if ( myMesh->_is_nil() ) {
+ SUIT_MessageBox::warning( this, tr( "SMESH_WRN_WARNING" ),
+ tr( "MESH_IS_NOT_SELECTED" ) );
return false;
}
double x = SpinBox_X->GetValue();
double y = SpinBox_Y->GetValue();
double z = SpinBox_Z->GetValue();
- mySimulation->SetVisibility(false);
- SMESH::AddNode(myMesh,x,y,z);
- SMESH::SetPointRepresentation(true);
+ mySimulation->SetVisibility( false );
+ SMESH::AddNode( myMesh, x, y, z );
+ SMESH::SetPointRepresentation( true );
// select myMesh
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList);
- if (aList.Extent() != 1) {
- if (SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView()) {
+ mySelectionMgr->selectedObjects( aList );
+ if ( aList.Extent() != 1 ) {
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView() ) {
vtkActorCollection *aCollection = aViewWindow->getRenderer()->GetActors();
aCollection->InitTraversal();
- while (vtkActor *anAct = aCollection->GetNextActor()) {
- if (SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)) {
- if (anActor->hasIO()) {
- if (SMESH_MeshObj *aMeshObj = dynamic_cast<SMESH_MeshObj*>(anActor->GetObject().get())) {
- if (myMesh->_is_equivalent(aMeshObj->GetMeshServer())) {
+ while ( vtkActor *anAct = aCollection->GetNextActor() ) {
+ if ( SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>( anAct ) ) {
+ if ( anActor->hasIO() ) {
+ if ( SMESH_MeshObj *aMeshObj = dynamic_cast<SMESH_MeshObj*>( anActor->GetObject().get() ) ) {
+ if ( myMesh->_is_equivalent( aMeshObj->GetMeshServer() ) ) {
aList.Clear();
- aList.Append(anActor->getIO());
- mySelectionMgr->setSelectedObjects(aList, false);
+ aList.Append( anActor->getIO() );
+ mySelectionMgr->setSelectedObjects( aList, false );
break;
}
}
//=================================================================================
void SMESHGUI_NodesDlg::ClickOnCancel()
{
- disconnect(mySelectionMgr, 0, this, 0);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
+ disconnect( mySelectionMgr, 0, this, 0 );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
+ aViewWindow->SetSelectionMode( ActorSelection );
- mySimulation->SetVisibility(false);
- SMESH::SetPointRepresentation(false);
+ mySimulation->SetVisibility( false );
+ SMESH::SetPointRepresentation( false );
mySMESHGUI->ResetState();
reject();
//=================================================================================
void SMESHGUI_NodesDlg::ClickOnHelp()
{
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
+ LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
+ if ( app )
+ app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) :
+ QString( "" ), myHelpFileName );
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning( this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ platform ) ).
+ arg( myHelpFileName ) );
}
}
//=================================================================================
void SMESHGUI_NodesDlg::SelectionIntoArgument()
{
- if (!GroupConstructors->isEnabled())
+ if ( !GroupConstructors->isEnabled() )
return;
- mySimulation->SetVisibility(false);
- SMESH::SetPointRepresentation(true);
+ mySimulation->SetVisibility( false );
+ SMESH::SetPointRepresentation( true );
const SALOME_ListIO& aList = mySelector->StoredIObjects();
- if (aList.Extent() == 1) {
+ if ( aList.Extent() == 1 ) {
Handle(SALOME_InteractiveObject) anIO = aList.First();
- if (anIO->hasEntry()) {
- myMesh = SMESH::GetMeshByIO(anIO);
- if (myMesh->_is_nil()) return;
+ if ( anIO->hasEntry() ) {
+ myMesh = SMESH::GetMeshByIO( anIO );
+ if ( myMesh->_is_nil() ) return;
QString aText;
- if (SMESH::GetNameOfSelectedNodes(mySelector,anIO,aText) == 1) {
- if (SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh.in())) {
- if (SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh()) {
- if (const SMDS_MeshNode* aNode = aMesh->FindNode(aText.toInt())) {
- SpinBox_X->SetValue(aNode->X());
- SpinBox_Y->SetValue(aNode->Y());
- SpinBox_Z->SetValue(aNode->Z());
+ if ( SMESH::GetNameOfSelectedNodes( mySelector, anIO, aText ) == 1 ) {
+ if ( SMESH_Actor* anActor = SMESH::FindActorByObject( myMesh.in() ) ) {
+ if ( SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh() ) {
+ if ( const SMDS_MeshNode* aNode = aMesh->FindNode( aText.toInt() ) ) {
+ SpinBox_X->SetValue( aNode->X() );
+ SpinBox_Y->SetValue( aNode->Y() );
+ SpinBox_Z->SetValue( aNode->Z() );
}
}
}
}
- mySimulation->SetPosition(SpinBox_X->GetValue(),
- SpinBox_Y->GetValue(),
- SpinBox_Z->GetValue());
+ mySimulation->SetPosition( SpinBox_X->GetValue(),
+ SpinBox_Y->GetValue(),
+ SpinBox_Z->GetValue() );
}
}
}
// function : closeEvent()
// purpose :
//=================================================================================
-void SMESHGUI_NodesDlg::closeEvent (QCloseEvent*)
+void SMESHGUI_NodesDlg::closeEvent( QCloseEvent* )
{
this->ClickOnCancel(); /* same than click on cancel button */
}
// function : hideEvent()
// purpose : caused by ESC key
//=================================================================================
-void SMESHGUI_NodesDlg::hideEvent (QHideEvent*)
+void SMESHGUI_NodesDlg::hideEvent( QHideEvent* )
{
- if (!isMinimized())
+ if ( !isMinimized() )
ClickOnCancel();
}
// function : enterEvent()
// purpose : to reactivate this dialog box when mouse enter onto the window
//=================================================================================
-void SMESHGUI_NodesDlg::enterEvent(QEvent*)
+void SMESHGUI_NodesDlg::enterEvent( QEvent* )
{
- if (!GroupConstructors->isEnabled())
+ if ( !GroupConstructors->isEnabled() )
ActivateThisDialog();
}
//=================================================================================
void SMESHGUI_NodesDlg::DeactivateActiveDialog()
{
- if (GroupConstructors->isEnabled()) {
- GroupConstructors->setEnabled(false);
- GroupCoordinates->setEnabled(false);
- GroupButtons->setEnabled(false);
- mySimulation->SetVisibility(false);
+ if ( GroupConstructors->isEnabled() ) {
+ GroupConstructors->setEnabled( false );
+ GroupCoordinates->setEnabled( false );
+ GroupButtons->setEnabled( false );
+ mySimulation->SetVisibility( false );
mySMESHGUI->ResetState();
- mySMESHGUI->SetActiveDialogBox(0);
+ mySMESHGUI->SetActiveDialogBox( 0 );
}
}
void SMESHGUI_NodesDlg::ActivateThisDialog()
{
mySMESHGUI->EmitSignalDeactivateDialog();
- GroupConstructors->setEnabled(true);
- GroupCoordinates->setEnabled(true);
- GroupButtons->setEnabled(true);
+ GroupConstructors->setEnabled( true );
+ GroupCoordinates->setEnabled( true );
+ GroupButtons->setEnabled( true );
- SMESH::SetPointRepresentation(true);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
+ SMESH::SetPointRepresentation( true );
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
+ aViewWindow->SetSelectionMode( NodeSelection );
SelectionIntoArgument();
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_NodesDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_NodesDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-#ifndef DIALOGBOX_NODES_H
-#define DIALOGBOX_NODES_H
+#ifndef SMESHGUI_NODESDLG_H
+#define SMESHGUI_NODESDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qvariant.h>
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QButtonGroup;
-class QFrame;
class QGroupBox;
class QLabel;
-class QLineEdit;
class QPushButton;
class QRadioButton;
class SMESHGUI;
class SVTK_Selector;
-class SVTK_ViewWindow;
class SMESHGUI_SpinBox;
class LightApp_SelectionMgr;
-namespace SMESH{
+namespace SMESH
+{
struct TNodeSimulation;
}
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
//=================================================================================
// class : SMESHGUI_NodesDlg
// purpose :
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_NodesDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_NodesDlg (SMESHGUI* theModule,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
-
- ~SMESHGUI_NodesDlg();
+ SMESHGUI_NodesDlg( SMESHGUI* );
+ ~SMESHGUI_NodesDlg();
private:
- LightApp_SelectionMgr* mySelectionMgr;
- SVTK_Selector* mySelector;
- SMESHGUI* mySMESHGUI;
-
- SMESH::SMESH_Mesh_var myMesh;
- SMESH::TNodeSimulation* mySimulation;
-
- void Init ();
- void enterEvent(QEvent* e);
- void closeEvent(QCloseEvent*);
- void hideEvent (QHideEvent *); /* ESC key */
- void keyPressEvent(QKeyEvent*);
-
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
- QGroupBox* GroupCoordinates;
- SMESHGUI_SpinBox* SpinBox_X;
- SMESHGUI_SpinBox* SpinBox_Y;
- SMESHGUI_SpinBox* SpinBox_Z;
-
- QLabel* TextLabel_X;
- QLabel* TextLabel_Y;
- QLabel* TextLabel_Z;
-
- QGroupBox* GroupButtons;
- QPushButton* buttonApply;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonHelp;
-
- QString myHelpFileName;
+ LightApp_SelectionMgr* mySelectionMgr;
+ SVTK_Selector* mySelector;
+ SMESHGUI* mySMESHGUI;
+
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH::TNodeSimulation* mySimulation;
+
+ void Init();
+ void enterEvent( QEvent* );
+ void closeEvent( QCloseEvent* );
+ void hideEvent ( QHideEvent* );
+ void keyPressEvent( QKeyEvent* );
+
+ QGroupBox* GroupConstructors;
+ QRadioButton* Constructor1;
+ QGroupBox* GroupCoordinates;
+ SMESHGUI_SpinBox* SpinBox_X;
+ SMESHGUI_SpinBox* SpinBox_Y;
+ SMESHGUI_SpinBox* SpinBox_Z;
+
+ QLabel* TextLabel_X;
+ QLabel* TextLabel_Y;
+ QLabel* TextLabel_Z;
+
+ QGroupBox* GroupButtons;
+ QPushButton* buttonApply;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonHelp;
+
+ QString myHelpFileName;
private slots:
-
- void ClickOnOk();
- void ClickOnCancel();
- bool ClickOnApply();
- void ClickOnHelp();
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void SelectionIntoArgument() ;
- void ValueChangedInSpinBox( double newValue ) ;
-
-protected:
- QGridLayout* SMESHGUI_NodesDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupCoordinatesLayout;
- QGridLayout* GroupButtonsLayout;
+ void ClickOnOk();
+ void ClickOnCancel();
+ bool ClickOnApply();
+ void ClickOnHelp();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void SelectionIntoArgument();
+ void ValueChangedInSpinBox( double );
};
-#endif // DIALOGBOX_NODES_H
+#endif // SMESHGUI_NODESDLG_H
-// SMESH SMDS : implementaion of Salome mesh data structure
+// SMESH SMDS : implementaion of Salome mesh data structure
//
-// Copyright (C) 2003 OPEN CASCADE
-//
-// 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
+// Copyright (C) 2003 OPEN CASCADE
+//
+// 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 : SMESHGUI_Operation.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_Operation.h
-// Author : Sergey LITONIN
-// Module : SALOME
+// SMESH includes
#include "SMESHGUI_Operation.h"
-#include <SMESHGUI.h>
-#include <SMESHGUI_Dialog.h>
+#include "SMESHGUI.h"
+#include "SMESHGUI_Dialog.h"
+
+// SALOME GUI includes
#include <SalomeApp_Study.h>
#include <LightApp_Application.h>
#include <SUIT_Session.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
-#include <qstringlist.h>
+// Qt includes
+#include <QStringList>
/*
Class : SMESHGUI_Operation
return false;
else if ( getSMESHGUI() == 0 )
{
- SUIT_MessageBox::warn1( desktop(), tr( "SMESH_WRN_WARNING" ),
- tr( "NO_MODULE" ), tr( "SMESH_BUT_OK" ) );
+ SUIT_MessageBox::warning( desktop(), tr( "SMESH_WRN_WARNING" ),
+ tr( "NO_MODULE" ) );
return false;
}
else if ( isStudyLocked() )
if (app)
app->onHelpContextModule(getSMESHGUI() ? app->moduleName(getSMESHGUI()->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning( desktop(), tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName) );
}
}
if ( studyDS()->GetProperties()->IsLocked() )
{
if ( theMess )
- SUIT_MessageBox::warn1 ( SMESHGUI::desktop(), QObject::tr( "WRN_WARNING" ),
- QObject::tr( "WRN_STUDY_LOCKED" ), QObject::tr( "BUT_OK" ) );
+ SUIT_MessageBox::warning( SMESHGUI::desktop(), tr( "WRN_WARNING" ),
+ tr( "WRN_STUDY_LOCKED" ) );
return true;
}
}
}
return theOtherOp && theOtherOp->inherits( "SMESHGUI_Operation" ) &&
- ( !anOps.contains( theOtherOp->className() ) || anOps.contains( className() ) );
+ ( !anOps.contains( theOtherOp->metaObject()->className() ) ||
+ anOps.contains( metaObject()->className() ) );
return true;
}
-
-
-
-
-
-
-
-
-
-
-
-
-// SMESH SMDS : implementaion of Salome mesh data structure
+// SMESH SMDS : implementaion of Salome mesh data structure
//
-// Copyright (C) 2003 OPEN CASCADE
-//
-// 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
+// Copyright (C) 2003 OPEN CASCADE
+//
+// 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 : SMESHGUI_Operation.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_Operation.h
-// Author : Sergey LITONIN
-// Module : SALOME
-
-#ifndef SMESHGUI_Operation_H
-#define SMESHGUI_Operation_H
+#ifndef SMESHGUI_OPERATION_H
+#define SMESHGUI_OPERATION_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+// SALOME GUI includes
#include <LightApp_Operation.h>
+
+// SALOME KERNEL includes
#include <SALOMEDSClient.hxx>
class SMESHGUI;
QString myHelpFileName;
protected slots:
- virtual void onOk();
- virtual bool onApply();
- virtual void onCancel();
- void onHelp();
+ virtual void onOk();
+ virtual bool onApply();
+ virtual void onCancel();
+ void onHelp();
};
-#endif
-
-
-
-
-
-
+#endif // SMESHGUI_OPERATION_H
-// 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
-//
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_PatternUtils.cxx
+// Author : Open CASCADE S.A.S.
+//
-
+// SMESH includes
#include "SMESHGUI_PatternUtils.h"
#include "SMESHGUI.h"
-namespace SMESH {
-
+namespace SMESH
+{
SMESH::SMESH_Pattern_var GetPattern()
{
return SMESHGUI::GetSMESHGen()->GetPattern();
}
-}
+} // end of namespace SMESH
-// 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
-//
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_PatternUtils.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_PatternUtils_HeaderFile
-#define SMESHGUI_PatternUtils_HeaderFile
+#ifndef SMESHGUI_PATTERNUTILS_H
+#define SMESHGUI_PATTERNUTILS_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "SALOMEconfig.h"
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Pattern)
-
-namespace SMESH{
-
-SMESHGUI_EXPORT
- SMESH::SMESH_Pattern_var GetPattern();
-
+namespace SMESH
+{
+ SMESHGUI_EXPORT
+ SMESH::SMESH_Pattern_var GetPattern();
}
-
-#endif
+#endif // SMESHGUI_PATTERNUTILS_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_PatternWidget.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_PatternWidget.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_PatternWidget.h"
-//Qt includes
-#include <qpainter.h>
-#include <qpoint.h>
+// Qt includes
+#include <QPainter>
+const int Shift = 4; // shift of the point number from point
+const int Border = 20; // border size
+const int Radius = 3; // radius of a point
//=================================================================================
// class : SMESHGUI_PatternWidget()
// purpose :
//=================================================================================
-SMESHGUI_PatternWidget::SMESHGUI_PatternWidget (QWidget* parent, const char* name, WFlags fl)
- : QFrame(parent, name, WStyle_Customize)
+SMESHGUI_PatternWidget::SMESHGUI_PatternWidget( QWidget* parent )
+ : QFrame( parent )
{
- myMinU = myMinV = myMaxU = myMaxV = 0;
- setMinimumHeight(150);
- repaint();
+ myMinU = myMinV = myMaxU = myMaxV = 0;
+ setMinimumHeight( 150 );
}
//=================================================================================
// function : SetPoints()
// purpose :
//=================================================================================
-void SMESHGUI_PatternWidget::SetPoints (PointVector thePoints,
- QValueVector<int> theKeys,
- ConnectivityVector theConnections)
+void SMESHGUI_PatternWidget::SetPoints( const PointVector& thePoints,
+ const QVector<int>& theKeys,
+ const ConnectivityVector& theConnections )
{
- myPoints = thePoints;
- myKeys = theKeys;
- myConnections = theConnections;
+ myPoints = thePoints;
+ myKeys = theKeys;
+ myConnections = theConnections;
- if (!thePoints.size())
+ if ( myPoints.isEmpty() )
return;
- myMinU = myMaxU = (thePoints[0]).x;
- myMinV = myMaxV = (thePoints[0]).y;
- double x, y;
-
- for (int i = 1; i < thePoints.size(); i++) {
- x = (thePoints[i]).x;
- y = (thePoints[i]).y;
-
- if (myMinU > x)
- myMinU = x;
- if (myMaxU < x)
- myMaxU = x;
- if (myMinV > y)
- myMinV = y;
- if (myMaxV < y)
- myMaxV = y;
+ myMinU = myMaxU = myPoints[0].x;
+ myMinV = myMaxV = myPoints[0].y;
+
+ for ( int i = 1; i < myPoints.size(); i++ ) {
+ myMinU = qMin( myPoints[i].x, myMinU );
+ myMaxU = qMax( myPoints[i].x, myMaxU );
+ myMinV = qMin( myPoints[i].y, myMinV );
+ myMaxV = qMax( myPoints[i].y, myMaxV );
}
repaint();
}
-static const int Shift = 4; // shift of the point number from point
-static const int Border = 20;
-
//=================================================================================
// function : paintEvent()
// purpose :
//=================================================================================
-void SMESHGUI_PatternWidget::paintEvent (QPaintEvent*)
+void SMESHGUI_PatternWidget::paintEvent( QPaintEvent* )
{
- QPainter paint (this);
- paint.setBrush(Qt::SolidPattern);
-
- //Draw points
- const int aRadius = 3; // radius of a point
+ QPainter painter( this );
+ painter.setBrush( Qt::SolidPattern );
- for (int i = 0; i < myKeys.size() && i < myPoints.size(); i++) {
+ // Draw points
+ for ( int i = 0; i < myKeys.size() && i < myPoints.size(); i++ ) {
SMESH::PointStruct aPoint = myPoints[ myKeys[i] ];
- QPoint aQPnt = MapCoords(aPoint.x, aPoint.y);
+ QPoint aQPnt = mapCoords( aPoint.x, aPoint.y );
- paint.drawPie(aQPnt.x() - aRadius, aQPnt.y() - aRadius, aRadius*2, aRadius*2, 5760, 5760);
- paint.drawText(aQPnt.x() + Shift, aQPnt.y() - Shift, QString::number(i+1));
+ painter.drawPie( aQPnt.x() - Radius, aQPnt.y() - Radius,
+ Radius * 2, Radius * 2, 0, 360 * 16 );
+ painter.drawText( aQPnt.x() + Shift, aQPnt.y() - Shift,
+ QString::number( i+1 ) );
}
- //Draw lines
- for (int i = 0; i < myConnections.size(); i++) {
- QValueVector<int> aCVector = myConnections[i];
+ // Draw lines
+ for ( int i = 0; i < myConnections.size(); i++ ) {
+ QVector<int> aCVector = myConnections[i];
- if (aCVector.size() == 0)
+ if ( aCVector.isEmpty() )
continue;
SMESH::PointStruct aPoint = myPoints[ aCVector[0] ];
- const QPoint aBeginPnt = MapCoords(aPoint.x, aPoint.y);
+ const QPoint aBeginPnt = mapCoords( aPoint.x, aPoint.y );
QPoint aFirstPnt = aBeginPnt, aSecondPnt;
- for (int j = 1; j < aCVector.size(); j++) {
+ for ( int j = 1; j < aCVector.size(); j++ ) {
aPoint = myPoints[ aCVector[j] ];
- aSecondPnt = MapCoords(aPoint.x, aPoint.y);
- paint.drawLine(aFirstPnt, aSecondPnt);
+ aSecondPnt = mapCoords( aPoint.x, aPoint.y );
+ painter.drawLine( aFirstPnt, aSecondPnt );
aFirstPnt = aSecondPnt;
}
- paint.drawLine(aBeginPnt, aSecondPnt);
+ painter.drawLine( aBeginPnt, aSecondPnt );
}
}
//=================================================================================
-// function : MapCoords()
+// function : mapCoords()
// purpose :
//=================================================================================
-QPoint SMESHGUI_PatternWidget::MapCoords (const double u, const double v)
+QPoint SMESHGUI_PatternWidget::mapCoords( const double u, const double v )
{
- int aWidth = width() - 2*Border;
- int aHeight = height() - 2*Border;
+ int aWidth = width() - 2 * Border;
+ int aHeight = height() - 2 * Border;
double aUBound = myMaxU - myMinU;
double aVBound = myMaxV - myMinV;
- double aUScale = aWidth/aUBound;
- double aVScale = aHeight/aVBound;
+ double aUScale = aWidth / aUBound;
+ double aVScale = aHeight / aVBound;
double aScale;
aUScale <= aVScale ? aScale = aUScale : aScale = aVScale;
- double aUMiddle = (myMaxU + myMinU)/2;
- double aVMiddle = (myMaxV + myMinV)/2;
-
- int x = int(aWidth/2 + (u - aUMiddle)*aScale + Border - Shift);
+ double aUMiddle = ( myMaxU + myMinU ) / 2;
+ double aVMiddle = ( myMaxV + myMinV ) / 2;
- int y = int(aHeight/2 + (aVMiddle - v)*aScale + Border + Shift);
+ int x = int( aWidth / 2 + ( u - aUMiddle ) * aScale + Border - Shift );
- QPoint aPoint = QPoint(x, y);
+ int y = int( aHeight / 2 + ( aVMiddle - v ) * aScale + Border + Shift );
- return aPoint;
+ return QPoint( x, y );
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_PatternWidget.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_PatternWidget.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef WIDGET_PATTERN_H
-#define WIDGET_PATTERN_H
+#ifndef SMESHGUI_PATTERNWIDGET_H
+#define SMESHGUI_PATTERNWIDGET_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qframe.h>
-#include <qvaluevector.h>
+// Qt includes
+#include <QFrame>
+#include <QVector>
-// IDL Headers
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
-typedef QValueVector<SMESH::PointStruct> PointVector;
-typedef QValueVector< QValueVector<int> > ConnectivityVector;
-
-class QPoint;
+typedef QVector<SMESH::PointStruct> PointVector;
+typedef QVector< QVector<int> > ConnectivityVector;
//=================================================================================
// class : SMESHGUI_PatternWidget
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_PatternWidget : public QFrame
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_PatternWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
-
- ~SMESHGUI_PatternWidget();
-
- void SetPoints( PointVector thePoints, QValueVector<int> theKeys, ConnectivityVector theConnections );
-
-private :
- PointVector myPoints;
- QValueVector<int> myKeys;
- ConnectivityVector myConnections;
-
- double myMinU, myMaxU, myMinV, myMaxV;
-
-private slots:
+ SMESHGUI_PatternWidget( QWidget* = 0 );
+ ~SMESHGUI_PatternWidget();
+
+ void SetPoints( const PointVector&,
+ const QVector<int>&,
+ const ConnectivityVector& );
+private:
+ PointVector myPoints;
+ QVector<int> myKeys;
+ ConnectivityVector myConnections;
+
+ double myMinU, myMaxU, myMinV, myMaxV;
+
protected:
- void paintEvent( QPaintEvent * );
- QPoint MapCoords( const double u, const double v );
-};
+ void paintEvent( QPaintEvent* );
-#endif // WIDGET_PATTERN_H
+private:
+ QPoint mapCoords( const double, const double );
+};
+#endif // SMESHGUI_PATTERNWIDGET_H
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SMESHGUI_PrecisionDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-
-#ifndef SMESHGUI_PrecisionDlg_H
-#define SMESHGUI_PrecisionDlg_H
-
-#include "SMESH_SMESHGUI.hxx"
-
-#include <qdialog.h>
-
-class QSpinBox;
-class QPushButton;
-class QCheckBox;
-class QFrame;
-class SMESHGUI;
-
-/*
- Class : SMESHGUI_PrecisionDlg
- Description : Dialog to specify precision of mesh quality controls
-*/
-
-class SMESHGUI_EXPORT SMESHGUI_PrecisionDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- SMESHGUI_PrecisionDlg( SMESHGUI* );
-
- virtual ~SMESHGUI_PrecisionDlg();
-
- void Init();
-
-private slots:
-
- void onOk();
- void onClose();
- void onNotUse();
-
-private:
-
- QFrame* createButtonFrame( QWidget* );
- QFrame* createMainFrame( QWidget* );
- void closeEvent( QCloseEvent* );
-
-private:
- SMESHGUI* mySMESHGUI;
- QSpinBox* mySpinBox;
- QPushButton* myOKBtn;
- QPushButton* myCancelBtn;
- QCheckBox* myNotUseChk;
-
-};
-
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_Preferences_ColorDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_Preferences_ColorDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_Preferences_ColorDlg.h"
+
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
-#include "utilities.h"
-
-// QT Includes
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qframe.h>
-#include <qlabel.h>
-#include <qpixmap.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qcolordialog.h>
-#include <qspinbox.h>
-#include <qcolor.h>
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <QtxColorButton.h>
-#include "SUIT_Desktop.h"
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QSpinBox>
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// function : SMESHGUI_Preferences_ColorDlg()
// purpose : Constructs a SMESHGUI_Preferences_ColorDlg which is a child
// of 'parent', with the name 'name' and widget flags set to 'f'
// The dialog will by default be modeless, unless you
-// set'modal' to TRUE to construct a modal dialog.
+// set'modal' to true to construct a modal dialog.
//=================================================================================
-SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModule, const char* name)
- : QDialog( SMESH::GetDesktop( theModule ), name, true, WStyle_Customize |
- WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
+SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule )
{
- if (!name)
- setName("SMESHGUI_Preferences_ColorDlg");
- setCaption(tr("Preferences - Set Color"));
- setSizeGripEnabled(TRUE);
- QGridLayout* SMESHGUI_Preferences_ColorDlgLayout = new QGridLayout(this);
- SMESHGUI_Preferences_ColorDlgLayout->setSpacing(6);
- SMESHGUI_Preferences_ColorDlgLayout->setMargin(11);
-
- ButtonGroup1 = new QButtonGroup(tr("Elements"), this, "ButtonGroup1");
- ButtonGroup1->setColumnLayout(0, Qt::Vertical);
- ButtonGroup1->layout()->setSpacing(0);
- ButtonGroup1->layout()->setMargin(0);
- QGridLayout* ButtonGroup1Layout = new QGridLayout(ButtonGroup1->layout());
- ButtonGroup1Layout->setAlignment(Qt::AlignTop);
- ButtonGroup1Layout->setSpacing(6);
- ButtonGroup1Layout->setMargin(11);
-
- TextLabel_Fill = new QLabel(tr("Fill"), ButtonGroup1, "TextLabel_2D_Fill");
- ButtonGroup1Layout->addWidget(TextLabel_Fill, 0, 0);
-
- btnFillColor = new QPushButton(ButtonGroup1, "btnFillColor");
- btnFillColor->setFixedSize(QSize(25, 25));
- ButtonGroup1Layout->addWidget(btnFillColor, 0, 1);
-
- TextLabel_Outine = new QLabel(tr("Outline"), ButtonGroup1, "TextLabel_2D_Outine");
- ButtonGroup1Layout->addWidget(TextLabel_Outine, 0, 2);
-
- btnOutlineColor = new QPushButton(ButtonGroup1, "btnOutlineColor");
- btnOutlineColor->setFixedSize(QSize(25, 25));
- ButtonGroup1Layout->addWidget(btnOutlineColor, 0, 3);
-
- TextLabel_Width = new QLabel(tr("Width"), ButtonGroup1, "TextLabel_2D_Width");
- ButtonGroup1Layout->addWidget(TextLabel_Width, 0, 4);
-
- SpinBox_Width = new QSpinBox(0, 5, 1, ButtonGroup1, "SpinBox_Width");
- SpinBox_Width->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- SpinBox_Width->setWrapping(FALSE);
- SpinBox_Width->setButtonSymbols(QSpinBox::PlusMinus);
- ButtonGroup1Layout->addWidget(SpinBox_Width, 0, 5);
-
- TextLabel_BackFace = new QLabel(tr("Back Face"), ButtonGroup1, "TextLabel_BackFace");
- ButtonGroup1Layout->addWidget(TextLabel_BackFace, 1, 0);
-
- btnBackFaceColor = new QPushButton(ButtonGroup1, "btnBackFaceColor");
- btnBackFaceColor->setFixedSize(QSize(25, 25));
- ButtonGroup1Layout->addWidget(btnBackFaceColor, 1, 1);
-
- TextLabel_ShrinkCoeff = new QLabel(tr("Shrink coef."), ButtonGroup1, "TextLabel_ShrinkCoeff");
- ButtonGroup1Layout->addWidget(TextLabel_ShrinkCoeff, 2, 0);
-
- SpinBox_Shrink = new QSpinBox(20, 100, 1, ButtonGroup1, "SpinBox_Shrink");
- SpinBox_Shrink->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- SpinBox_Shrink->setButtonSymbols(QSpinBox::PlusMinus);
- ButtonGroup1Layout->addMultiCellWidget(SpinBox_Shrink, 2, 2, 1, 5);
-
- SMESHGUI_Preferences_ColorDlgLayout->addWidget(ButtonGroup1, 0, 0);
-
- ButtonGroup2 = new QButtonGroup(tr("Nodes"), this, "ButtonGroup2");
- ButtonGroup2->setColumnLayout(0, Qt::Vertical);
- ButtonGroup2->layout()->setSpacing(0);
- ButtonGroup2->layout()->setMargin(0);
- QGridLayout* ButtonGroup2Layout = new QGridLayout(ButtonGroup2->layout());
- ButtonGroup2Layout->setAlignment(Qt::AlignTop);
- ButtonGroup2Layout->setSpacing(6);
- ButtonGroup2Layout->setMargin(11);
-
- TextLabel_Nodes_Color = new QLabel(tr("Color"), ButtonGroup2, "TextLabel_Nodes_Color");
- ButtonGroup2Layout->addWidget(TextLabel_Nodes_Color, 0, 0);
-
- btnNodeColor = new QPushButton(ButtonGroup2, "btnNodeColor");
- btnNodeColor->setFixedSize(QSize(25, 25));
- ButtonGroup2Layout->addWidget(btnNodeColor, 0, 1);
-
- TextLabel_Nodes_Size = new QLabel(tr("Size"), ButtonGroup2, "TextLabel_Nodes_Size");
- ButtonGroup2Layout->addWidget(TextLabel_Nodes_Size, 0, 2);
-
- SpinBox_Nodes_Size = new QSpinBox(0, 5, 1, ButtonGroup2, "SpinBox_Nodes_Size");
- SpinBox_Nodes_Size->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- SpinBox_Nodes_Size->setWrapping(FALSE);
- SpinBox_Nodes_Size->setButtonSymbols(QSpinBox::PlusMinus);
- ButtonGroup2Layout->addWidget(SpinBox_Nodes_Size, 0, 3);
-
- SMESHGUI_Preferences_ColorDlgLayout->addWidget(ButtonGroup2, 1, 0);
-
- GroupButtons = new QButtonGroup(this, "GroupButtons");
- 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);
-
- buttonOk = new QPushButton(tr("&OK"), GroupButtons, "buttonOk");
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
-
- GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
-
- buttonCancel = new QPushButton(tr("&Cancel"), GroupButtons, "buttonCancel");
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
-
- SMESHGUI_Preferences_ColorDlgLayout->addWidget(GroupButtons, 2, 0);
-
- Init();
-}
-
-//=================================================================================
-// function : ~SMESHGUI_Preferences_ColorDlg()
-// purpose : Destructor
-//=================================================================================
-SMESHGUI_Preferences_ColorDlg::~SMESHGUI_Preferences_ColorDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : Init()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_ColorDlg::Init()
-{
- mySMESHGUI->SetActiveDialogBox((QDialog*)this);
+ setModal( true );
+ setWindowTitle( tr( "Preferences - Set Color" ) );
+ setSizeGripEnabled( true );
+
+ // -------------------------------
+ QVBoxLayout* topLayout = new QVBoxLayout( this );
+ topLayout->setSpacing( SPACING );
+ topLayout->setMargin( MARGIN );
+
+ // -------------------------------
+ QGroupBox* ButtonGroup1 = new QGroupBox( tr( "Elements" ), this );
+ QGridLayout* ButtonGroup1Layout = new QGridLayout( ButtonGroup1 );
+ ButtonGroup1Layout->setSpacing( SPACING );
+ ButtonGroup1Layout->setMargin( MARGIN );
+
+ QLabel* TextLabel_Fill = new QLabel( tr( "Fill" ), ButtonGroup1 );
+ btnFillColor = new QtxColorButton( ButtonGroup1 );
+
+ QLabel* TextLabel_BackFace = new QLabel( tr( "Back Face" ), ButtonGroup1 );
+ btnBackFaceColor = new QtxColorButton( ButtonGroup1 );
+
+ QLabel* TextLabel_Outine = new QLabel( tr( "Outline" ), ButtonGroup1 );
+ btnOutlineColor = new QtxColorButton( ButtonGroup1 );
+
+ QLabel* TextLabel_Width = new QLabel( tr( "Width" ), ButtonGroup1 );
+ SpinBox_Width = new QSpinBox( ButtonGroup1 );
+ SpinBox_Width->setRange( 0, 5 );
+ SpinBox_Width->setSingleStep( 1 );
+ SpinBox_Width->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ SpinBox_Width->setButtonSymbols( QSpinBox::PlusMinus );
+
+ QLabel* TextLabel_ShrinkCoeff = new QLabel( tr( "Shrink coef." ), ButtonGroup1 );
+ SpinBox_Shrink = new QSpinBox( ButtonGroup1 );
+ SpinBox_Shrink->setRange( 20, 100 );
+ SpinBox_Shrink->setSingleStep( 1 );
+ SpinBox_Shrink->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ SpinBox_Shrink->setButtonSymbols( QSpinBox::PlusMinus );
+
+ ButtonGroup1Layout->addWidget( TextLabel_Fill, 0, 0 );
+ ButtonGroup1Layout->addWidget( btnFillColor, 0, 1 );
+ ButtonGroup1Layout->addWidget( TextLabel_BackFace, 1, 0 );
+ ButtonGroup1Layout->addWidget( btnBackFaceColor, 1, 1 );
+ ButtonGroup1Layout->addWidget( TextLabel_Outine, 2, 0 );
+ ButtonGroup1Layout->addWidget( btnOutlineColor, 2, 1 );
+ ButtonGroup1Layout->addWidget( TextLabel_Width, 0, 2 );
+ ButtonGroup1Layout->addWidget( SpinBox_Width, 0, 3 );
+ ButtonGroup1Layout->addWidget( TextLabel_ShrinkCoeff, 1, 2 );
+ ButtonGroup1Layout->addWidget( SpinBox_Shrink, 1, 3 );
+
+ // -------------------------------
+ QGroupBox* ButtonGroup2 = new QGroupBox( tr( "Nodes" ), this );
+ QHBoxLayout* ButtonGroup2Layout = new QHBoxLayout( ButtonGroup2 );
+ ButtonGroup2Layout->setSpacing( SPACING );
+ ButtonGroup2Layout->setMargin( MARGIN );
+
+ QLabel* TextLabel_Nodes_Color = new QLabel( tr( "Color" ), ButtonGroup2 );
+ btnNodeColor = new QtxColorButton( ButtonGroup2 );
+
+ QLabel* TextLabel_Nodes_Size = new QLabel( tr( "Size" ), ButtonGroup2 );
+ SpinBox_Nodes_Size = new QSpinBox( ButtonGroup2 );
+ SpinBox_Nodes_Size->setRange( 0, 5 );
+ SpinBox_Nodes_Size->setSingleStep( 1 );
+ SpinBox_Nodes_Size->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ SpinBox_Nodes_Size->setButtonSymbols( QSpinBox::PlusMinus );
+
+ ButtonGroup2Layout->addWidget( TextLabel_Nodes_Color );
+ ButtonGroup2Layout->addWidget( btnNodeColor );
+ ButtonGroup2Layout->addWidget( TextLabel_Nodes_Size );
+ ButtonGroup2Layout->addWidget( SpinBox_Nodes_Size );
+
+ // -------------------------------
+ QGroupBox* GroupButtons = new QGroupBox( this );
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
+ GroupButtonsLayout->setSpacing( SPACING );
+ GroupButtonsLayout->setMargin( MARGIN );
+
+ QPushButton* buttonOk = new QPushButton( tr( "&OK" ), GroupButtons );
+ buttonOk->setAutoDefault( true );
+ buttonOk->setDefault( true );
+
+ QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ), GroupButtons );
+ buttonCancel->setAutoDefault( true );
+
+ GroupButtonsLayout->addWidget( buttonOk );
+ GroupButtonsLayout->addSpacing( 10 );
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget( buttonCancel );
+
+ // -------------------------------
+ topLayout->addWidget( ButtonGroup1 );
+ topLayout->addWidget( ButtonGroup2 );
+ topLayout->addWidget( GroupButtons );
+
+ // -------------------------------
+ mySMESHGUI->SetActiveDialogBox( this );
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
- connect(btnFillColor, SIGNAL(clicked()), this, SLOT(SelectFillColor()));
- connect(btnOutlineColor, SIGNAL(clicked()), this, SLOT(SelectOutlineColor()));
- connect(btnNodeColor, SIGNAL(clicked()), this, SLOT(SelectNodeColor()));
- connect(btnBackFaceColor, SIGNAL(clicked()), this, SLOT(SelectBackFaceColor()));
-
- connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ),
+ this, SLOT( DeactivateActiveDialog() ) );
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-}
-
-//=================================================================================
-// function : SelectFillColor()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_ColorDlg::SelectFillColor()
-{
- QColor color = btnFillColor->palette().active().button();
- color = QColorDialog::getColor(color);
- if (color.isValid()) {
- QPalette pal = btnFillColor->palette();
- pal.setColor(QColorGroup::Button, color);
- btnFillColor->setPalette(pal);
- }
-}
-
-//=================================================================================
-// function : SelectBackFaceColor()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_ColorDlg::SelectBackFaceColor()
-{
- QColor color = btnBackFaceColor->palette().active().button();
- color = QColorDialog::getColor(color);
- if (color.isValid()) {
- QPalette pal = btnBackFaceColor->palette();
- pal.setColor(QColorGroup::Button, color);
- btnBackFaceColor->setPalette(pal);
- }
-}
-
-//=================================================================================
-// function : SelectOutlineColor()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_ColorDlg::SelectOutlineColor()
-{
- QColor color = btnOutlineColor->palette().active().button();
- color = QColorDialog::getColor(color);
- if (color.isValid()) {
- QPalette pal = btnOutlineColor->palette();
- pal.setColor(QColorGroup::Button, color);
- btnOutlineColor->setPalette(pal);
- }
+ connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ),
+ this, SLOT( ClickOnCancel() ) );
}
//=================================================================================
-// function : SelectNodeColor()
-// purpose :
+// function : ~SMESHGUI_Preferences_ColorDlg()
+// purpose : Destructor
//=================================================================================
-void SMESHGUI_Preferences_ColorDlg::SelectNodeColor()
+SMESHGUI_Preferences_ColorDlg::~SMESHGUI_Preferences_ColorDlg()
{
- QColor color = btnNodeColor->palette().active().button();
- color = QColorDialog::getColor(color);
- if (color.isValid()) {
- QPalette pal = btnNodeColor->palette();
- pal.setColor(QColorGroup::Button, color);
- btnNodeColor->setPalette(pal);
- }
}
//=================================================================================
// function : closeEvent()
// purpose :
//=================================================================================
-void SMESHGUI_Preferences_ColorDlg::closeEvent (QCloseEvent*)
+void SMESHGUI_Preferences_ColorDlg::closeEvent( QCloseEvent* )
{
- this->ClickOnCancel(); /* same than click on cancel button */
+ ClickOnCancel(); /* same than click on cancel button */
}
//=================================================================================
// function : SetColor()
// purpose :
//=================================================================================
-void SMESHGUI_Preferences_ColorDlg::SetColor (int type, QColor color)
+void SMESHGUI_Preferences_ColorDlg::SetColor( int type, const QColor& color )
{
- switch (type) {
- case 1 : // fill
- {
- QPalette pal = btnFillColor->palette();
- pal.setColor(QColorGroup::Button, color);
- btnFillColor->setPalette(pal);
- break;
- }
- case 2 : // outline
- {
- QPalette pal = btnOutlineColor->palette();
- pal.setColor(QColorGroup::Button, color);
- btnOutlineColor->setPalette(pal);
- break;
- }
- case 3 : // node
- {
- QPalette pal = btnNodeColor->palette();
- pal.setColor(QColorGroup::Button, color);
- btnNodeColor->setPalette(pal);
- break;
- }
- case 4 : // back face
- {
- QPalette pal = btnBackFaceColor->palette();
- pal.setColor(QColorGroup::Button, color);
- btnBackFaceColor->setPalette(pal);
- break;
- }
+ switch ( type ) {
+ case 1 : btnFillColor->setColor( color ); break; // fill
+ case 2 : btnOutlineColor->setColor( color ); break; // outline
+ case 3 : btnNodeColor->setColor( color ); break; // node
+ case 4 : btnBackFaceColor->setColor( color ); break; // back face
+ default: break;
}
}
// function : GetColor()
// purpose :
//=================================================================================
-QColor SMESHGUI_Preferences_ColorDlg::GetColor (int type)
+QColor SMESHGUI_Preferences_ColorDlg::GetColor( int type )
{
QColor color;
- switch (type) {
- case 1 : color = btnFillColor->palette().active().button(); break; // fill
- case 2 : color = btnOutlineColor->palette().active().button(); break; // outline
- case 3 : color = btnNodeColor->palette().active().button(); break; // node
- case 4 : color = btnBackFaceColor->palette().active().button(); break; // back face
+ switch ( type ) {
+ case 1 : color = btnFillColor->color(); break; // fill
+ case 2 : color = btnOutlineColor->color(); break; // outline
+ case 3 : color = btnNodeColor->color(); break; // node
+ case 4 : color = btnBackFaceColor->color(); break; // back face
+ default: break;
}
return color;
}
// function : SetIntValue()
// purpose :
//=================================================================================
-void SMESHGUI_Preferences_ColorDlg::SetIntValue (int type, int value)
+void SMESHGUI_Preferences_ColorDlg::SetIntValue( int type, int value )
{
- switch (type) {
- case 1 : SpinBox_Width->setValue(value); break; // width
- case 2 : SpinBox_Nodes_Size->setValue(value); break; // nodes size = value; break;
- case 3 : SpinBox_Shrink->setValue(value); break; // shrink coeff
+ switch ( type ) {
+ case 1 : SpinBox_Width->setValue( value ); break; // width
+ case 2 : SpinBox_Nodes_Size->setValue( value ); break; // nodes size = value; break;
+ case 3 : SpinBox_Shrink->setValue( value ); break; // shrink coeff
+ default: break;
}
}
// function : GetIntValue()
// purpose :
//=================================================================================
-int SMESHGUI_Preferences_ColorDlg::GetIntValue (int type)
+int SMESHGUI_Preferences_ColorDlg::GetIntValue( int type )
{
int res = 0;
- switch (type) {
+ switch ( type ) {
case 1 : res = SpinBox_Width->value(); break; // width
case 2 : res = SpinBox_Nodes_Size->value(); break; // nodes size
case 3 : res = SpinBox_Shrink->value(); break; // shrink coeff
+ default: break;
}
return res;
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_Preferences_ColorDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-// File : SMESHGUI_Preferences_ColorDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
#ifndef SMESHGUI_PREFERENCES_COLORDLG_H
#define SMESHGUI_PREFERENCES_COLORDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-// SALOME Includes
-//#include "SUIT_Config.h"
-//#include "SUIT_Settings.h"
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Gen)
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qdialog.h>
-
-class QButtonGroup;
-class QFrame;
-class QLabel;
-class QPushButton;
class QSpinBox;
-class QColor;
class SMESHGUI;
+class QtxColorButton;
class SMESHGUI_EXPORT SMESHGUI_Preferences_ColorDlg : public QDialog
{
- Q_OBJECT
-
+ Q_OBJECT
+
public:
- SMESHGUI_Preferences_ColorDlg( SMESHGUI*, const char* name = 0 );
- ~SMESHGUI_Preferences_ColorDlg();
+ SMESHGUI_Preferences_ColorDlg( SMESHGUI* );
+ ~SMESHGUI_Preferences_ColorDlg();
- void SetColor(int type, QColor color);
- QColor GetColor(int type);
- void SetIntValue(int type, int value);
- int GetIntValue(int type);
+ void SetColor( int, const QColor& );
+ QColor GetColor( int );
+ void SetIntValue( int, int );
+ int GetIntValue( int );
-private:
- void closeEvent( QCloseEvent* e ) ;
- void Init();
+protected:
+ void closeEvent( QCloseEvent* );
private slots:
-// void RadioButtonClicked(int radioButtonId);
- void ClickOnOk();
- void ClickOnCancel();
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
-
- void SelectFillColor();
- void SelectBackFaceColor();
- void SelectOutlineColor();
- void SelectNodeColor();
-
+ void ClickOnOk();
+ void ClickOnCancel();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+
private:
- SMESH::SMESH_Gen_var myCompMesh ;
- SMESHGUI* mySMESHGUI ;
-
- QButtonGroup* ButtonGroup1;
- QLabel* TextLabel_Fill;
- QPushButton* btnFillColor;
- QLabel* TextLabel_Outine;
- QPushButton* btnOutlineColor;
- QLabel* TextLabel_Width;
- QSpinBox* SpinBox_Width;
- QLabel* TextLabel_BackFace;
- QPushButton* btnBackFaceColor;
- QLabel* TextLabel_ShrinkCoeff;
- QSpinBox* SpinBox_Shrink;
- QButtonGroup* ButtonGroup2;
- QLabel* TextLabel_Nodes_Color;
- QPushButton* btnNodeColor;
- QLabel* TextLabel_Nodes_Size;
- QSpinBox* SpinBox_Nodes_Size;
- QButtonGroup* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
+ SMESHGUI* mySMESHGUI;
+
+ QtxColorButton* btnFillColor;
+ QtxColorButton* btnBackFaceColor;
+ QtxColorButton* btnOutlineColor;
+ QSpinBox* SpinBox_Width;
+ QSpinBox* SpinBox_Shrink;
+ QtxColorButton* btnNodeColor;
+ QSpinBox* SpinBox_Nodes_Size;
};
#endif // SMESHGUI_PREFERENCES_COLORDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_Preferences_ScalarBarDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_Preferences_ScalarBarDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_Preferences_ScalarBarDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_Utils.h"
-#include "SMESH_Actor.h"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-
-#include "LightApp_SelectionMgr.h"
-#include "SALOME_ListIO.hxx"
-
-#include <QtxDblSpinBox.h>
-
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qtoolbutton.h>
-#include <qradiobutton.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qcolordialog.h>
-
+#include <SMESH_Actor.h>
+
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+
+#include <QtxDoubleSpinBox.h>
+#include <QtxColorButton.h>
+
+// Qt includes
+#include <QButtonGroup>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QSpinBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QDoubleValidator>
+
+// VTK includes
#include <vtkTextProperty.h>
#include <vtkScalarBarActor.h>
#include <vtkLookupTable.h>
#define MARGIN_SIZE 11
#define SPACING_SIZE 6
-using namespace std;
-
// Only one instance is allowed
SMESHGUI_Preferences_ScalarBarDlg* SMESHGUI_Preferences_ScalarBarDlg::myDlg = 0;
void SMESHGUI_Preferences_ScalarBarDlg::ScalarBarProperties( SMESHGUI* theModule )
{
if (!myDlg) {
- myDlg = new SMESHGUI_Preferences_ScalarBarDlg( theModule, true);
+ myDlg = new SMESHGUI_Preferences_ScalarBarDlg( theModule );
myDlg->show();
} else {
myDlg->show();
- myDlg->setActiveWindow();
myDlg->raise();
- myDlg->setFocus();
+ myDlg->activateWindow();
}
}
-//=================================================================================================
-/*!
- * SMESHGUI_Preferences_ScalarBarDlg::ScalarBarPreferences
- *
- * Opens "Scalar Bar Preferences" dialog box
- */
-//=================================================================================================
-void SMESHGUI_Preferences_ScalarBarDlg::ScalarBarPreferences( SMESHGUI* theModule )
-{
- SMESHGUI_Preferences_ScalarBarDlg* aDlg =
- new SMESHGUI_Preferences_ScalarBarDlg( theModule, false);
- aDlg->exec();
-}
-
//=================================================================================================
/*!
* SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg
* Constructor
*/
//=================================================================================================
-SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* theModule, bool property, bool modal )
- : QDialog( SMESH::GetDesktop( theModule ), 0, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
- mySMESHGUI( theModule ),
- mySelectionMgr( property ? SMESH::GetSelectionMgr( theModule ) : 0 )
+SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
DEF_VER_X = 0.01;
DEF_VER_Y = 0.10;
DEF_HOR_Y = 0.01;
DEF_HOR_H = 0.12;
DEF_HOR_W = 0.60;
- setName("SMESHGUI_Preferences_ScalarBarDlg");
- setCaption( property ? tr("SMESH_PROPERTIES_SCALARBAR") : tr("SMESH_PREFERENCES_SCALARBAR"));
- setSizeGripEnabled(TRUE);
+
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle( tr("SMESH_PROPERTIES_SCALARBAR") );
+ setSizeGripEnabled(true);
myActor = 0;
/******************************************************************************/
// Top layout
- QGridLayout* aTopLayout = new QGridLayout( this );
+ QVBoxLayout* aTopLayout = new QVBoxLayout( this );
aTopLayout->setSpacing( SPACING_SIZE ); aTopLayout->setMargin( MARGIN_SIZE );
- int aRow = 0;
/******************************************************************************/
// Scalar range
- if ( mySelectionMgr ) {
- myRangeGrp = new QGroupBox ( tr( "SMESH_RANGE_SCALARBAR" ), this, "myRangeGrp" );
- myRangeGrp->setColumnLayout( 0, Qt::Vertical );
- myRangeGrp->layout()->setSpacing( 0 ); myRangeGrp->layout()->setMargin( 0 );
- QGridLayout* myRangeGrpLayout = new QGridLayout( myRangeGrp->layout() );
- myRangeGrpLayout->setAlignment( Qt::AlignTop );
- myRangeGrpLayout->setSpacing( SPACING_SIZE ); myRangeGrpLayout->setMargin( MARGIN_SIZE );
-
- myMinEdit = new QLineEdit( myRangeGrp, "myMinEdit" );
- myMinEdit->setMinimumWidth( MINIMUM_WIDTH );
- myMinEdit->setValidator( new QDoubleValidator( this ) );
-
- myMaxEdit = new QLineEdit( myRangeGrp, "myMaxEdit" );
- myMaxEdit->setMinimumWidth( MINIMUM_WIDTH );
- myMaxEdit->setValidator( new QDoubleValidator( this ) );
-
- myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MIN" ), myRangeGrp, "myMinLab" ), 0, 0 );
- myRangeGrpLayout->addWidget( myMinEdit, 0, 1 );
- myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MAX" ), myRangeGrp, "myMaxLab" ), 0, 2 );
- myRangeGrpLayout->addWidget( myMaxEdit, 0, 3 );
-
- aTopLayout->addWidget( myRangeGrp, aRow, 0 );
- aRow++;
- }
+ myRangeGrp = new QGroupBox ( tr( "SMESH_RANGE_SCALARBAR" ), this );
+ QHBoxLayout* myRangeGrpLayout = new QHBoxLayout( myRangeGrp );
+ myRangeGrpLayout->setSpacing( SPACING_SIZE ); myRangeGrpLayout->setMargin( MARGIN_SIZE );
+
+ myMinEdit = new QLineEdit( myRangeGrp );
+ myMinEdit->setMinimumWidth( MINIMUM_WIDTH );
+ myMinEdit->setValidator( new QDoubleValidator( this ) );
+
+ myMaxEdit = new QLineEdit( myRangeGrp );
+ myMaxEdit->setMinimumWidth( MINIMUM_WIDTH );
+ myMaxEdit->setValidator( new QDoubleValidator( this ) );
+
+ myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MIN" ), myRangeGrp ) );
+ myRangeGrpLayout->addWidget( myMinEdit );
+ myRangeGrpLayout->addWidget( new QLabel( tr( "SMESH_RANGE_MAX" ), myRangeGrp ) );
+ myRangeGrpLayout->addWidget( myMaxEdit );
+
+ aTopLayout->addWidget( myRangeGrp );
/******************************************************************************/
// Text properties
- myFontGrp = new QGroupBox ( tr( "SMESH_FONT_SCALARBAR" ), this, "myFontGrp" );
- myFontGrp->setColumnLayout( 0, Qt::Vertical );
- myFontGrp->layout()->setSpacing( 0 ); myFontGrp->layout()->setMargin( 0 );
- QGridLayout* myFontGrpLayout = new QGridLayout( myFontGrp->layout() );
- myFontGrpLayout->setAlignment( Qt::AlignTop );
+ myFontGrp = new QGroupBox ( tr( "SMESH_FONT_SCALARBAR" ), this );
+ QGridLayout* myFontGrpLayout = new QGridLayout( myFontGrp );
myFontGrpLayout->setSpacing( SPACING_SIZE ); myFontGrpLayout->setMargin( MARGIN_SIZE );
- myTitleColorBtn = new QToolButton( myFontGrp, "myTitleColorBtn" );
- myTitleColorBtn->setMinimumWidth( 20 );
+ myTitleColorBtn = new QtxColorButton( myFontGrp );
- myTitleFontCombo = new QComboBox( false, myFontGrp, "myTitleFontCombo" );
+ myTitleFontCombo = new QComboBox( myFontGrp );
myTitleFontCombo->setMinimumWidth( MINIMUM_WIDTH );
myTitleFontCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myTitleFontCombo->insertItem( tr( "SMESH_FONT_ARIAL" ) );
- myTitleFontCombo->insertItem( tr( "SMESH_FONT_COURIER" ) );
- myTitleFontCombo->insertItem( tr( "SMESH_FONT_TIMES" ) );
+ myTitleFontCombo->addItem( tr( "SMESH_FONT_ARIAL" ) );
+ myTitleFontCombo->addItem( tr( "SMESH_FONT_COURIER" ) );
+ myTitleFontCombo->addItem( tr( "SMESH_FONT_TIMES" ) );
- myTitleBoldCheck = new QCheckBox( tr( "SMESH_FONT_BOLD" ), myFontGrp, "myTitleBoldCheck" );
- myTitleItalicCheck = new QCheckBox( tr( "SMESH_FONT_ITALIC" ), myFontGrp, "myTitleItalicCheck" );
- myTitleShadowCheck = new QCheckBox( tr( "SMESH_FONT_SHADOW" ), myFontGrp, "myTitleShadowCheck" );
+ myTitleBoldCheck = new QCheckBox( tr( "SMESH_FONT_BOLD" ), myFontGrp );
+ myTitleItalicCheck = new QCheckBox( tr( "SMESH_FONT_ITALIC" ), myFontGrp );
+ myTitleShadowCheck = new QCheckBox( tr( "SMESH_FONT_SHADOW" ), myFontGrp );
- myLabelsColorBtn = new QToolButton( myFontGrp, "myLabelsColorBtn" );
- myLabelsColorBtn->setMinimumWidth( 20 );
+ myLabelsColorBtn = new QtxColorButton( myFontGrp );
- myLabelsFontCombo = new QComboBox( false, myFontGrp, "myLabelsFontCombo" );
+ myLabelsFontCombo = new QComboBox( myFontGrp );
myLabelsFontCombo->setMinimumWidth( MINIMUM_WIDTH );
myLabelsFontCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myLabelsFontCombo->insertItem( tr( "SMESH_FONT_ARIAL" ) );
- myLabelsFontCombo->insertItem( tr( "SMESH_FONT_COURIER" ) );
- myLabelsFontCombo->insertItem( tr( "SMESH_FONT_TIMES" ) );
+ myLabelsFontCombo->addItem( tr( "SMESH_FONT_ARIAL" ) );
+ myLabelsFontCombo->addItem( tr( "SMESH_FONT_COURIER" ) );
+ myLabelsFontCombo->addItem( tr( "SMESH_FONT_TIMES" ) );
- myLabelsBoldCheck = new QCheckBox( tr( "SMESH_FONT_BOLD" ), myFontGrp, "myLabelsBoldCheck" );
- myLabelsItalicCheck = new QCheckBox( tr( "SMESH_FONT_ITALIC" ), myFontGrp, "myLabelsItalicCheck" );
- myLabelsShadowCheck = new QCheckBox( tr( "SMESH_FONT_SHADOW" ), myFontGrp, "myLabelsShadowCheck" );
+ myLabelsBoldCheck = new QCheckBox( tr( "SMESH_FONT_BOLD" ), myFontGrp );
+ myLabelsItalicCheck = new QCheckBox( tr( "SMESH_FONT_ITALIC" ), myFontGrp );
+ myLabelsShadowCheck = new QCheckBox( tr( "SMESH_FONT_SHADOW" ), myFontGrp );
- myFontGrpLayout->addWidget( new QLabel( tr( "SMESH_TITLE" ), myFontGrp, "myFontTitleLab" ), 0, 0 );
+ myFontGrpLayout->addWidget( new QLabel( tr( "SMESH_TITLE" ), myFontGrp ), 0, 0 );
myFontGrpLayout->addWidget( myTitleColorBtn, 0, 1 );
myFontGrpLayout->addWidget( myTitleFontCombo, 0, 2 );
myFontGrpLayout->addWidget( myTitleBoldCheck, 0, 3 );
myFontGrpLayout->addWidget( myTitleItalicCheck, 0, 4 );
myFontGrpLayout->addWidget( myTitleShadowCheck, 0, 5 );
- myFontGrpLayout->addWidget( new QLabel( tr( "SMESH_LABELS" ), myFontGrp, "myFontLabelsLab" ), 1, 0 );
+ myFontGrpLayout->addWidget( new QLabel( tr( "SMESH_LABELS" ), myFontGrp ), 1, 0 );
myFontGrpLayout->addWidget( myLabelsColorBtn, 1, 1 );
myFontGrpLayout->addWidget( myLabelsFontCombo, 1, 2 );
myFontGrpLayout->addWidget( myLabelsBoldCheck, 1, 3 );
myFontGrpLayout->addWidget( myLabelsItalicCheck, 1, 4 );
myFontGrpLayout->addWidget( myLabelsShadowCheck, 1, 5 );
- aTopLayout->addWidget( myFontGrp, aRow, 0 );
- aRow++;
+ aTopLayout->addWidget( myFontGrp );
/******************************************************************************/
// Labels & Colors
- myLabColorGrp = new QGroupBox ( tr( "SMESH_LABELS_COLORS_SCALARBAR" ), this, "myLabColorGrp" );
- myLabColorGrp->setColumnLayout( 0, Qt::Vertical );
- myLabColorGrp->layout()->setSpacing( 0 ); myLabColorGrp->layout()->setMargin( 0 );
- QGridLayout* myLabColorGrpLayout = new QGridLayout( myLabColorGrp->layout() );
- myLabColorGrpLayout->setAlignment( Qt::AlignTop );
+ myLabColorGrp = new QGroupBox ( tr( "SMESH_LABELS_COLORS_SCALARBAR" ), this );
+ QHBoxLayout* myLabColorGrpLayout = new QHBoxLayout( myLabColorGrp );
myLabColorGrpLayout->setSpacing( SPACING_SIZE ); myLabColorGrpLayout->setMargin( MARGIN_SIZE );
- myColorsSpin = new QSpinBox( 2, 256, 1, myLabColorGrp, "myColorsSpin" );
+ myColorsSpin = new QSpinBox( myLabColorGrp );
+ myColorsSpin->setRange( 2, 256 );
+ myColorsSpin->setSingleStep( 1 );
myColorsSpin->setMinimumWidth( MINIMUM_WIDTH );
myColorsSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myLabelsSpin = new QSpinBox( 2, 65, 1, myLabColorGrp, "myLabelsSpin" );
+ myLabelsSpin = new QSpinBox( myLabColorGrp );
+ myLabelsSpin->setRange( 2, 65 );
+ myLabelsSpin->setSingleStep( 1 );
myLabelsSpin->setMinimumWidth( MINIMUM_WIDTH );
myLabelsSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myLabColorGrpLayout->addWidget( new QLabel( tr( "SMESH_NUMBEROFCOLORS" ), myLabColorGrp, "myNbColorLab" ), 0, 0 );
- myLabColorGrpLayout->addWidget( myColorsSpin, 0, 1 );
- myLabColorGrpLayout->addWidget( new QLabel( tr( "SMESH_NUMBEROFLABELS" ), myLabColorGrp, "myNbLabsLab" ), 0, 2 );
- myLabColorGrpLayout->addWidget( myLabelsSpin, 0, 3 );
+ myLabColorGrpLayout->addWidget( new QLabel( tr( "SMESH_NUMBEROFCOLORS" ), myLabColorGrp ) );
+ myLabColorGrpLayout->addWidget( myColorsSpin );
+ myLabColorGrpLayout->addWidget( new QLabel( tr( "SMESH_NUMBEROFLABELS" ), myLabColorGrp ) );
+ myLabColorGrpLayout->addWidget( myLabelsSpin );
- aTopLayout->addWidget( myLabColorGrp, aRow, 0 );
- aRow++;
+ aTopLayout->addWidget( myLabColorGrp );
/******************************************************************************/
// Orientation
- myOrientationGrp = new QButtonGroup ( tr( "SMESH_ORIENTATION" ), this, "myOrientationGrp" );
- myOrientationGrp->setColumnLayout( 0, Qt::Vertical );
- myOrientationGrp->layout()->setSpacing( 0 ); myOrientationGrp->layout()->setMargin( 0 );
- QGridLayout* myOrientationGrpLayout = new QGridLayout( myOrientationGrp->layout() );
- myOrientationGrpLayout->setAlignment( Qt::AlignTop );
+ myOrientationGrp = new QGroupBox ( tr( "SMESH_ORIENTATION" ), this );
+ QButtonGroup* aOrientationGrp = new QButtonGroup( this );
+ QHBoxLayout* myOrientationGrpLayout = new QHBoxLayout( myOrientationGrp );
myOrientationGrpLayout->setSpacing( SPACING_SIZE ); myOrientationGrpLayout->setMargin( MARGIN_SIZE );
- myVertRadioBtn = new QRadioButton( tr( "SMESH_VERTICAL" ), myOrientationGrp, "myVertRadioBtn" );
- myHorizRadioBtn = new QRadioButton( tr( "SMESH_HORIZONTAL" ), myOrientationGrp, "myHorizRadioBtn" );
+ myVertRadioBtn = new QRadioButton( tr( "SMESH_VERTICAL" ), myOrientationGrp );
+ myHorizRadioBtn = new QRadioButton( tr( "SMESH_HORIZONTAL" ), myOrientationGrp );
myVertRadioBtn->setChecked( true );
- myOrientationGrpLayout->addWidget( myVertRadioBtn, 0, 0 );
- myOrientationGrpLayout->addWidget( myHorizRadioBtn, 0, 1 );
+ myOrientationGrpLayout->addWidget( myVertRadioBtn );
+ myOrientationGrpLayout->addWidget( myHorizRadioBtn );
+ aOrientationGrp->addButton(myVertRadioBtn);
+ aOrientationGrp->addButton(myHorizRadioBtn);
- aTopLayout->addWidget( myOrientationGrp, aRow, 0 );
- aRow++;
+ aTopLayout->addWidget( myOrientationGrp );
/******************************************************************************/
// Position & Size
- myOriginDimGrp = new QGroupBox (tr("SMESH_POSITION_SIZE_SCALARBAR"), this, "myOriginDimGrp");
- myOriginDimGrp->setColumnLayout(0, Qt::Vertical);
- myOriginDimGrp->layout()->setSpacing( 0 ); myOriginDimGrp->layout()->setMargin( 0 );
- QGridLayout* myOriginDimGrpLayout = new QGridLayout( myOriginDimGrp->layout() );
- myOriginDimGrpLayout->setAlignment( Qt::AlignTop );
+ myOriginDimGrp = new QGroupBox ( tr("SMESH_POSITION_SIZE_SCALARBAR"), this );
+ QGridLayout* myOriginDimGrpLayout = new QGridLayout( myOriginDimGrp );
myOriginDimGrpLayout->setSpacing( SPACING_SIZE ); myOriginDimGrpLayout->setMargin( MARGIN_SIZE );
- myXSpin = new QtxDblSpinBox (0.0, 1.0, 0.1, myOriginDimGrp);
+ myXSpin = new QtxDoubleSpinBox (0.0, 1.0, 0.1, myOriginDimGrp);
myXSpin->setMinimumWidth( MINIMUM_WIDTH );
myXSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myYSpin = new QtxDblSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+ myYSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
myYSpin->setMinimumWidth( MINIMUM_WIDTH );
myYSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myWidthSpin = new QtxDblSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+ myWidthSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
myWidthSpin->setMinimumWidth( MINIMUM_WIDTH );
myWidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myHeightSpin = new QtxDblSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
+ myHeightSpin = new QtxDoubleSpinBox(0.0, 1.0, 0.1, myOriginDimGrp);
myHeightSpin->setMinimumWidth( MINIMUM_WIDTH );
myHeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- myOriginDimGrpLayout->addWidget( new QLabel( tr( "SMESH_X_SCALARBAR" ), myOriginDimGrp, "myXLab" ), 0, 0 );
+ myOriginDimGrpLayout->addWidget( new QLabel( tr( "SMESH_X_SCALARBAR" ), myOriginDimGrp ), 0, 0 );
myOriginDimGrpLayout->addWidget( myXSpin, 0, 1 );
- myOriginDimGrpLayout->addWidget( new QLabel( tr( "SMESH_Y_SCALARBAR" ), myOriginDimGrp, "myYLab" ), 0, 2 );
+ myOriginDimGrpLayout->addWidget( new QLabel( tr( "SMESH_Y_SCALARBAR" ), myOriginDimGrp ), 0, 2 );
myOriginDimGrpLayout->addWidget( myYSpin, 0, 3 );
- myOriginDimGrpLayout->addWidget( new QLabel( tr( "SMESH_WIDTH" ), myOriginDimGrp, "myWidthLab" ), 1, 0 );
+ myOriginDimGrpLayout->addWidget( new QLabel( tr( "SMESH_WIDTH" ), myOriginDimGrp ), 1, 0 );
myOriginDimGrpLayout->addWidget( myWidthSpin, 1, 1 );
- myOriginDimGrpLayout->addWidget( new QLabel( tr( "SMESH_HEIGHT" ), myOriginDimGrp, "myHeightLab" ), 1, 2 );
+ myOriginDimGrpLayout->addWidget( new QLabel( tr( "SMESH_HEIGHT" ), myOriginDimGrp ), 1, 2 );
myOriginDimGrpLayout->addWidget( myHeightSpin, 1, 3 );
- aTopLayout->addWidget( myOriginDimGrp, aRow, 0 );
- aRow++;
+ aTopLayout->addWidget( myOriginDimGrp );
/***************************************************************/
// Common buttons
- myButtonGrp = new QGroupBox( this, "myButtonGrp" );
- myButtonGrp->setColumnLayout(0, Qt::Vertical );
- myButtonGrp->layout()->setSpacing( 0 ); myButtonGrp->layout()->setMargin( 0 );
- QHBoxLayout* myButtonGrpLayout = new QHBoxLayout( myButtonGrp->layout() );
- myButtonGrpLayout->setAlignment( Qt::AlignTop );
+ myButtonGrp = new QGroupBox( this );
+ QHBoxLayout* myButtonGrpLayout = new QHBoxLayout( myButtonGrp );
myButtonGrpLayout->setSpacing( SPACING_SIZE ); myButtonGrpLayout->setMargin( MARGIN_SIZE );
- myOkBtn = new QPushButton( tr( "SMESH_BUT_OK" ), myButtonGrp, "myOkBtn" );
- myOkBtn->setAutoDefault( TRUE ); myOkBtn->setDefault( TRUE );
+ myOkBtn = new QPushButton( tr( "SMESH_BUT_OK" ), myButtonGrp );
+ myOkBtn->setAutoDefault( true ); myOkBtn->setDefault( true );
+ myApplyBtn = new QPushButton( tr( "SMESH_BUT_APPLY" ), myButtonGrp );
+ myApplyBtn->setAutoDefault( true );
+ myCancelBtn = new QPushButton( tr( "SMESH_BUT_CLOSE" ), myButtonGrp );
+ myCancelBtn->setAutoDefault( true );
+
myButtonGrpLayout->addWidget( myOkBtn );
- if ( mySelectionMgr ) {
- myApplyBtn = new QPushButton( tr( "SMESH_BUT_APPLY" ), myButtonGrp, "myApplyBtn" );
- myApplyBtn->setAutoDefault( TRUE );
- myButtonGrpLayout->addWidget( myApplyBtn );
- }
+ myButtonGrpLayout->addSpacing( 10 );
+ myButtonGrpLayout->addWidget( myApplyBtn );
+ myButtonGrpLayout->addSpacing( 10 );
myButtonGrpLayout->addStretch();
- myCancelBtn = new QPushButton( tr( "SMESH_BUT_CANCEL" ), myButtonGrp, "myCancelBtn" );
- if ( mySelectionMgr )
- myCancelBtn->setText( tr( "SMESH_BUT_CLOSE" ) );
- myCancelBtn->setAutoDefault( TRUE );
myButtonGrpLayout->addWidget( myCancelBtn );
- aTopLayout->addWidget( myButtonGrp, aRow, 0 );
+ aTopLayout->addWidget( myButtonGrp );
/***************************************************************/
// Init
// --> first init from preferences
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
- QColor titleColor (255, 255, 255);
- if (mgr && mgr->hasValue("SMESH", "scalar_bar_title_color")) {
- QStringList aTColor =
- QStringList::split(":", mgr->stringValue("SMESH", "scalar_bar_title_color"), false);
- titleColor = QColor((aTColor.count() > 0 ? aTColor[0].toInt() : 255),
- (aTColor.count() > 1 ? aTColor[1].toInt() : 255),
- (aTColor.count() > 2 ? aTColor[2].toInt() : 255));
- }
- myTitleColorBtn->setPaletteBackgroundColor(titleColor);
- myTitleFontCombo->setCurrentItem(0);
- if (mgr && mgr->hasValue("SMESH", "scalar_bar_title_font")) {
+ QColor titleColor = mgr->colorValue("SMESH", "scalar_bar_title_color",
+ QColor(255, 255, 255));
+ myTitleColorBtn->setColor(titleColor);
+ myTitleFontCombo->setCurrentIndex(0);
+ if (mgr->hasValue("SMESH", "scalar_bar_title_font")) {
QFont f = mgr->fontValue( "SMESH", "scalar_bar_title_font" );
if( f.family()=="Arial" )
- myTitleFontCombo->setCurrentItem(0);
+ myTitleFontCombo->setCurrentIndex(0);
if( f.family()=="Courier" )
- myTitleFontCombo->setCurrentItem(1);
+ myTitleFontCombo->setCurrentIndex(1);
if( f.family()=="Times")
- myTitleFontCombo->setCurrentItem(2);
-
+ myTitleFontCombo->setCurrentIndex(2);
+
myTitleBoldCheck->setChecked ( f.bold() );
myTitleItalicCheck->setChecked( f.italic() );
myTitleShadowCheck->setChecked( f.underline() );
}
-
- QColor labelColor (255, 255, 255);
- if (mgr && mgr->hasValue("SMESH", "scalar_bar_label_color")) {
- QStringList aLColor =
- QStringList::split(":", mgr->stringValue("SMESH", "scalar_bar_label_color"), false);
- labelColor = QColor((aLColor.count() > 0 ? aLColor[0].toInt() : 255),
- (aLColor.count() > 1 ? aLColor[1].toInt() : 255),
- (aLColor.count() > 2 ? aLColor[2].toInt() : 255));
- }
- myLabelsColorBtn->setPaletteBackgroundColor(labelColor);
- myLabelsFontCombo->setCurrentItem(0);
- if (mgr && mgr->hasValue("SMESH", "scalar_bar_label_font")) {
+
+ QColor labelColor = mgr->colorValue("SMESH", "scalar_bar_label_color",
+ QColor(255, 255, 255));
+ myLabelsColorBtn->setColor(labelColor);
+ myLabelsFontCombo->setCurrentIndex(0);
+ if (mgr->hasValue("SMESH", "scalar_bar_label_font")) {
QFont f = mgr->fontValue( "SMESH", "scalar_bar_label_font" );
if (f.family() == "Arial")
- myLabelsFontCombo->setCurrentItem(0);
+ myLabelsFontCombo->setCurrentIndex(0);
if (f.family() == "Courier")
- myLabelsFontCombo->setCurrentItem(1);
+ myLabelsFontCombo->setCurrentIndex(1);
if (f.family() == "Times")
- myLabelsFontCombo->setCurrentItem(2);
+ myLabelsFontCombo->setCurrentIndex(2);
myLabelsBoldCheck ->setChecked( f.bold() );
myLabelsItalicCheck->setChecked( f.italic() );
myLabelsShadowCheck->setChecked( f.underline() );
}
- int aNbColors = 64;
- if (mgr && mgr->hasValue("SMESH", "scalar_bar_num_colors"))
- aNbColors = mgr->integerValue("SMESH", "scalar_bar_num_colors");
+ int aNbColors = mgr->integerValue("SMESH", "scalar_bar_num_colors", 64);
myColorsSpin->setValue(aNbColors);
- int aNbLabels = 5;
- if (mgr && mgr->hasValue("SMESH", "scalar_bar_num_labels"))
- aNbLabels = mgr->integerValue("SMESH", "scalar_bar_num_labels");
+ int aNbLabels = mgr->integerValue("SMESH", "scalar_bar_num_labels", 5);
myLabelsSpin->setValue(aNbLabels);
- int aOrientation = ( mgr ? mgr->integerValue( "SMESH", "scalar_bar_orientation", 1 ) : 1 );
- bool isHoriz = ( aOrientation==1 );
- if (aOrientation == 1)
+ int aOrientation = mgr->integerValue( "SMESH", "scalar_bar_orientation", 1 );
+ bool isHoriz = aOrientation == 1;
+ if (isHoriz)
myHorizRadioBtn->setChecked(true);
else
myVertRadioBtn->setChecked(true);
myIniOrientation = myVertRadioBtn->isChecked();
QString name = isHoriz ? "scalar_bar_horizontal_%1" : "scalar_bar_vertical_%1";
- if (mgr && mgr->hasValue("SMESH", name.arg( "x" )))
- myIniX = mgr->doubleValue("SMESH", name.arg( "x" ));
- else
- myIniX = myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X;
- if (mgr && mgr->hasValue("SMESH", name.arg( "y" )))
- myIniY = mgr->doubleValue("SMESH", name.arg( "y" ));
- else
- myIniY = myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y;
+ myIniX = mgr->doubleValue("SMESH", name.arg( "x" ),
+ myHorizRadioBtn->isChecked() ? DEF_HOR_X : DEF_VER_X);
- if (mgr && mgr->hasValue("SMESH", name.arg( "width" )))
- myIniW = mgr->doubleValue("SMESH", name.arg( "width" ));
- else
- myIniW = myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W;
+ myIniY = mgr->doubleValue("SMESH", name.arg( "y" ),
+ myHorizRadioBtn->isChecked() ? DEF_HOR_Y : DEF_VER_Y);
- if (mgr && mgr->hasValue("SMESH", name.arg( "height" )))
- myIniH = mgr->doubleValue("SMESH", name.arg( "height" ));
- else
- myIniH = myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H;
+ myIniW = mgr->doubleValue("SMESH", name.arg( "width" ),
+ myHorizRadioBtn->isChecked() ? DEF_HOR_W : DEF_VER_W);
+
+ myIniH = mgr->doubleValue("SMESH", name.arg( "height" ),
+ myHorizRadioBtn->isChecked() ? DEF_HOR_H : DEF_VER_H);
setOriginAndSize(myIniX, myIniY, myIniW, myIniH);
- if (mySelectionMgr) {
- // --> then init from selection if necessary
- onSelectionChanged();
- }
+ // --> then init from selection if necessary
+ onSelectionChanged();
/***************************************************************/
// Connect section
- connect( myTitleColorBtn, SIGNAL( clicked() ), this, SLOT( onTitleColor() ) );
- connect( myLabelsColorBtn, SIGNAL( clicked() ), this, SLOT( onLabelsColor() ) );
connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) );
+ connect( myApplyBtn, SIGNAL( clicked() ), this, SLOT( onApply() ) );
connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( onCancel() ) );
connect( myXSpin, SIGNAL( valueChanged( double ) ), this, SLOT( onXYChanged() ) );
connect( myYSpin, SIGNAL( valueChanged( double ) ), this, SLOT( onXYChanged() ) );
- connect( myOrientationGrp, SIGNAL( clicked( int ) ), this, SLOT( onOrientationChanged() ) );
- if ( mySelectionMgr ) {
- connect( myApplyBtn, SIGNAL( clicked() ), this, SLOT( onApply() ) );
- connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
- }
- connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onCancel() ) ) ;
+ connect( aOrientationGrp, SIGNAL( buttonClicked( int ) ), this, SLOT( onOrientationChanged() ) );
+ connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
+ connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onCancel() ) );
}
//=================================================================================================
//=================================================================================================
bool SMESHGUI_Preferences_ScalarBarDlg::onApply()
{
- if (mySelectionMgr) {
- // Scalar Bar properties
- if (!myActor)
- return false;
- vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
-
- vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
- QColor aTColor = myTitleColorBtn->paletteBackgroundColor();
- aTitleTextPrp->SetColor( aTColor.red()/255., aTColor.green()/255., aTColor.blue()/255. );
- if ( myTitleFontCombo->currentItem() == 0 )
- aTitleTextPrp->SetFontFamilyToArial();
- else if ( myTitleFontCombo->currentItem() == 1 )
- aTitleTextPrp->SetFontFamilyToCourier();
- else
- aTitleTextPrp->SetFontFamilyToTimes();
- aTitleTextPrp->SetBold( myTitleBoldCheck->isChecked() );
- aTitleTextPrp->SetItalic( myTitleItalicCheck->isChecked() );
- aTitleTextPrp->SetShadow( myTitleShadowCheck->isChecked() );
- myScalarBarActor->SetTitleTextProperty( aTitleTextPrp );
-
- vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
- QColor aLColor = myLabelsColorBtn->paletteBackgroundColor();
- aLabelsTextPrp->SetColor( aLColor.red()/255., aLColor.green()/255., aLColor.blue()/255. );
- if ( myLabelsFontCombo->currentItem() == 0 )
- aLabelsTextPrp->SetFontFamilyToArial();
- else if ( myLabelsFontCombo->currentItem() == 1 )
- aLabelsTextPrp->SetFontFamilyToCourier();
- else
- aLabelsTextPrp->SetFontFamilyToTimes();
- aLabelsTextPrp->SetBold( myLabelsBoldCheck->isChecked() );
- aLabelsTextPrp->SetItalic( myLabelsItalicCheck->isChecked() );
- aLabelsTextPrp->SetShadow( myLabelsShadowCheck->isChecked() );
- myScalarBarActor->SetLabelTextProperty( aLabelsTextPrp );
-
- myScalarBarActor->SetNumberOfLabels( myLabelsSpin->value() );
- myScalarBarActor->SetMaximumNumberOfColors( myColorsSpin->value() );
-
- if ( myHorizRadioBtn->isChecked() )
- myScalarBarActor->SetOrientationToHorizontal();
- else
- myScalarBarActor->SetOrientationToVertical();
-
- myScalarBarActor->SetPosition( myXSpin->value(), myYSpin->value() );
- myScalarBarActor->SetWidth( myWidthSpin->value() );
- myScalarBarActor->SetHeight( myHeightSpin->value() );
-
- double aMin = myMinEdit->text().toDouble();
- double aMax = myMaxEdit->text().toDouble();
- vtkLookupTable* myLookupTable =
- static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
- myLookupTable->SetRange( aMin, aMax );
- myLookupTable->SetNumberOfTableValues(myColorsSpin->value());
- myLookupTable->Build();
- SMESH::RepaintCurrentView();
- } else {
- // Scalar Bar preferences
- SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
- if (!mgr) return false;
-
- QColor titleColor = myTitleColorBtn->paletteBackgroundColor();
- mgr->setValue("SMESH", "scalar_bar_title_color", titleColor );
-
- QFont f;
- if (myTitleFontCombo->currentItem() == 0)
- f.setFamily( "Arial" );
- else if (myTitleFontCombo->currentItem() == 1)
- f.setFamily( "Courier" );
- else
- f.setFamily( "Times");
-
- f.setBold( myTitleBoldCheck ->isChecked() );
- f.setItalic( myTitleItalicCheck->isChecked() );
- f.setUnderline( myTitleShadowCheck->isChecked() );
- mgr->setValue( "SMESH", "scalar_bar_title_font", f );
-
- QColor labelColor = myLabelsColorBtn->paletteBackgroundColor();
- mgr->setValue("SMESH", "scalar_bar_label_color", labelColor );
-
- if (myLabelsFontCombo->currentItem() == 0)
- f.setFamily( "Arial" );
- else if ( myLabelsFontCombo->currentItem() == 1 )
- f.setFamily( "Courier");
- else
- f.setFamily( "Times");
-
- f.setBold( myLabelsBoldCheck ->isChecked() );
- f.setItalic( myLabelsItalicCheck->isChecked() );
- f.setUnderline( myLabelsShadowCheck->isChecked() );
- mgr->setValue( "SMESH", "scalar_bar_label_font", f );
-
- mgr->setValue("SMESH", "scalar_bar_num_colors", myColorsSpin->value());
- mgr->setValue("SMESH", "scalar_bar_num_labels", myLabelsSpin->value());
-
- mgr->setValue("SMESH", "scalar_bar_orientation", myHorizRadioBtn->isChecked() ? 1 : 0 );
-
- QString name = myHorizRadioBtn->isChecked() ? "scalar_bar_horizontal_%1" : "scalar_bar_vertical_%1";
- mgr->setValue("SMESH", name.arg( "x" ), myXSpin->value());
- mgr->setValue("SMESH", name.arg( "y" ), myYSpin->value());
- mgr->setValue("SMESH", name.arg( "width" ), myWidthSpin->value());
- mgr->setValue("SMESH", name.arg( "height" ), myHeightSpin->value());
- }
+ // Scalar Bar properties
+ if (!myActor)
+ return false;
+ vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
+
+ vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
+ QColor aTColor = myTitleColorBtn->color();
+ aTitleTextPrp->SetColor( aTColor.red()/255., aTColor.green()/255., aTColor.blue()/255. );
+ if ( myTitleFontCombo->currentIndex() == 0 )
+ aTitleTextPrp->SetFontFamilyToArial();
+ else if ( myTitleFontCombo->currentIndex() == 1 )
+ aTitleTextPrp->SetFontFamilyToCourier();
+ else
+ aTitleTextPrp->SetFontFamilyToTimes();
+ aTitleTextPrp->SetBold( myTitleBoldCheck->isChecked() );
+ aTitleTextPrp->SetItalic( myTitleItalicCheck->isChecked() );
+ aTitleTextPrp->SetShadow( myTitleShadowCheck->isChecked() );
+ myScalarBarActor->SetTitleTextProperty( aTitleTextPrp );
+
+ vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
+ QColor aLColor = myLabelsColorBtn->color();
+ aLabelsTextPrp->SetColor( aLColor.red()/255., aLColor.green()/255., aLColor.blue()/255. );
+ if ( myLabelsFontCombo->currentIndex() == 0 )
+ aLabelsTextPrp->SetFontFamilyToArial();
+ else if ( myLabelsFontCombo->currentIndex() == 1 )
+ aLabelsTextPrp->SetFontFamilyToCourier();
+ else
+ aLabelsTextPrp->SetFontFamilyToTimes();
+ aLabelsTextPrp->SetBold( myLabelsBoldCheck->isChecked() );
+ aLabelsTextPrp->SetItalic( myLabelsItalicCheck->isChecked() );
+ aLabelsTextPrp->SetShadow( myLabelsShadowCheck->isChecked() );
+ myScalarBarActor->SetLabelTextProperty( aLabelsTextPrp );
+
+ myScalarBarActor->SetNumberOfLabels( myLabelsSpin->value() );
+ myScalarBarActor->SetMaximumNumberOfColors( myColorsSpin->value() );
+
+ if ( myHorizRadioBtn->isChecked() )
+ myScalarBarActor->SetOrientationToHorizontal();
+ else
+ myScalarBarActor->SetOrientationToVertical();
+
+ myScalarBarActor->SetPosition( myXSpin->value(), myYSpin->value() );
+ myScalarBarActor->SetWidth( myWidthSpin->value() );
+ myScalarBarActor->SetHeight( myHeightSpin->value() );
+
+ double aMin = myMinEdit->text().toDouble();
+ double aMax = myMaxEdit->text().toDouble();
+ vtkLookupTable* myLookupTable =
+ static_cast<vtkLookupTable*>(myScalarBarActor->GetLookupTable());
+ myLookupTable->SetRange( aMin, aMax );
+ myLookupTable->SetNumberOfTableValues(myColorsSpin->value());
+ myLookupTable->Build();
+ SMESH::RepaintCurrentView();
return true;
}
close();
}
-//=================================================================================================
-/*!
- * SMESHGUI_Preferences_ScalarBarDlg::onTitleColor
- *
- * Change Title color button slot
- */
-//=================================================================================================
-void SMESHGUI_Preferences_ScalarBarDlg::onTitleColor()
-{
- QColor aColor = myTitleColorBtn->paletteBackgroundColor();
- aColor = QColorDialog::getColor( aColor, this );
- if ( aColor.isValid() )
- myTitleColorBtn->setPaletteBackgroundColor( aColor );
-}
-
-//=================================================================================================
-/*!
- * SMESHGUI_Preferences_ScalarBarDlg::onLabelsColor
- *
- * Change Labels color button slot
- */
-//=================================================================================================
-void SMESHGUI_Preferences_ScalarBarDlg::onLabelsColor()
-{
- QColor aColor = myLabelsColorBtn->paletteBackgroundColor();
- aColor = QColorDialog::getColor( aColor, this );
- if ( aColor.isValid() )
- myLabelsColorBtn->setPaletteBackgroundColor( aColor );
-}
-
//=================================================================================================
/*!
* SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::onSelectionChanged()
{
- if (mySelectionMgr) {
- SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList);
-
- if (aList.Extent() == 1) {
- Handle(SALOME_InteractiveObject) anIO = aList.First();
- if( anIO->hasEntry() ) {
- SMESH_Actor* anActor = SMESH::FindActorByEntry(anIO->getEntry());
- if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
- myActor = anActor;
- vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
-
- if ( myScalarBarActor->GetLookupTable() ) {
- vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
- myMinEdit->setText( QString::number( range[0],'g',12 ) );
- myMaxEdit->setText( QString::number( range[1],'g',12 ) );
- }
-
- vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
- vtkFloatingPointType aTColor[3];
- aTitleTextPrp->GetColor( aTColor );
- myTitleColorBtn->setPaletteBackgroundColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
- myTitleFontCombo->setCurrentItem( aTitleTextPrp->GetFontFamily() );
- myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
- myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
- myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
-
- vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
- vtkFloatingPointType aLColor[3];
- aLabelsTextPrp->GetColor( aLColor );
- myLabelsColorBtn->setPaletteBackgroundColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
- myLabelsFontCombo->setCurrentItem( aLabelsTextPrp->GetFontFamily() );
- myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
- myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
- myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
-
- myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
- myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
-
- if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
- myVertRadioBtn->setChecked( true );
- else
- myHorizRadioBtn->setChecked( true );
- myIniOrientation = myVertRadioBtn->isChecked();
-
- myIniX = myScalarBarActor->GetPosition()[0];
- myIniY = myScalarBarActor->GetPosition()[1];
- myIniW = myScalarBarActor->GetWidth();
- myIniH = myScalarBarActor->GetHeight();
- setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
-
- myRangeGrp->setEnabled( true );
- myFontGrp->setEnabled( true );
- myLabColorGrp->setEnabled( true );
- myOrientationGrp->setEnabled( true );
- myOriginDimGrp->setEnabled( true );
- myOkBtn->setEnabled( true );
- myApplyBtn->setEnabled( true );
- return;
+ SALOME_ListIO aList;
+ mySelectionMgr->selectedObjects(aList);
+
+ if (aList.Extent() == 1) {
+ Handle(SALOME_InteractiveObject) anIO = aList.First();
+ if( anIO->hasEntry() ) {
+ SMESH_Actor* anActor = SMESH::FindActorByEntry(anIO->getEntry());
+ if ( anActor && anActor->GetScalarBarActor() && anActor->GetControlMode() != SMESH_Actor::eNone ) {
+ myActor = anActor;
+ vtkScalarBarActor* myScalarBarActor = myActor->GetScalarBarActor();
+
+ if ( myScalarBarActor->GetLookupTable() ) {
+ vtkFloatingPointType *range = myScalarBarActor->GetLookupTable()->GetRange();
+ myMinEdit->setText( QString::number( range[0],'g',12 ) );
+ myMaxEdit->setText( QString::number( range[1],'g',12 ) );
}
+
+ vtkTextProperty* aTitleTextPrp = myScalarBarActor->GetTitleTextProperty();
+ vtkFloatingPointType aTColor[3];
+ aTitleTextPrp->GetColor( aTColor );
+ myTitleColorBtn->setColor( QColor( (int)( aTColor[0]*255 ), (int)( aTColor[1]*255 ), (int)( aTColor[2]*255 ) ) );
+ myTitleFontCombo->setCurrentIndex( aTitleTextPrp->GetFontFamily() );
+ myTitleBoldCheck->setChecked( aTitleTextPrp->GetBold() );
+ myTitleItalicCheck->setChecked( aTitleTextPrp->GetItalic() );
+ myTitleShadowCheck->setChecked( aTitleTextPrp->GetShadow() );
+
+ vtkTextProperty* aLabelsTextPrp = myScalarBarActor->GetLabelTextProperty();
+ vtkFloatingPointType aLColor[3];
+ aLabelsTextPrp->GetColor( aLColor );
+ myLabelsColorBtn->setColor( QColor( (int)( aLColor[0]*255 ), (int)( aLColor[1]*255 ), (int)( aLColor[2]*255 ) ) );
+ myLabelsFontCombo->setCurrentIndex( aLabelsTextPrp->GetFontFamily() );
+ myLabelsBoldCheck->setChecked( aLabelsTextPrp->GetBold() );
+ myLabelsItalicCheck->setChecked( aLabelsTextPrp->GetItalic() );
+ myLabelsShadowCheck->setChecked( aLabelsTextPrp->GetShadow() );
+
+ myLabelsSpin->setValue( myScalarBarActor->GetNumberOfLabels() );
+ myColorsSpin->setValue( myScalarBarActor->GetMaximumNumberOfColors() );
+
+ if ( myScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL )
+ myVertRadioBtn->setChecked( true );
+ else
+ myHorizRadioBtn->setChecked( true );
+ myIniOrientation = myVertRadioBtn->isChecked();
+
+ myIniX = myScalarBarActor->GetPosition()[0];
+ myIniY = myScalarBarActor->GetPosition()[1];
+ myIniW = myScalarBarActor->GetWidth();
+ myIniH = myScalarBarActor->GetHeight();
+ setOriginAndSize( myIniX, myIniY, myIniW, myIniH );
+
+ myRangeGrp->setEnabled( true );
+ myFontGrp->setEnabled( true );
+ myLabColorGrp->setEnabled( true );
+ myOrientationGrp->setEnabled( true );
+ myOriginDimGrp->setEnabled( true );
+ myOkBtn->setEnabled( true );
+ myApplyBtn->setEnabled( true );
+ return;
}
}
- myActor = 0;
- myRangeGrp->setEnabled( false );
- myFontGrp->setEnabled( false );
- myLabColorGrp->setEnabled( false );
- myOrientationGrp->setEnabled( false );
- myOriginDimGrp->setEnabled( false );
- myOkBtn->setEnabled( false );
- myApplyBtn->setEnabled( false );
}
+ myActor = 0;
+ myRangeGrp->setEnabled( false );
+ myFontGrp->setEnabled( false );
+ myLabColorGrp->setEnabled( false );
+ myOrientationGrp->setEnabled( false );
+ myOriginDimGrp->setEnabled( false );
+ myOkBtn->setEnabled( false );
+ myApplyBtn->setEnabled( false );
}
//=================================================================================================
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::closeEvent( QCloseEvent* e )
{
- if ( mySelectionMgr ) // "Properties" dialog box
- myDlg = 0;
+ myDlg = 0;
QDialog::closeEvent( e );
}
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::onXYChanged()
{
- myWidthSpin->setMaxValue( 1.0 - myXSpin->value() );
- myHeightSpin->setMaxValue( 1.0 - myYSpin->value() );
+ myWidthSpin->setMaximum( 1.0 - myXSpin->value() );
+ myHeightSpin->setMaximum( 1.0 - myYSpin->value() );
}
//=================================================================================================
blockSignals( true );
myXSpin->setValue( x );
myYSpin->setValue( y );
- myWidthSpin->setMaxValue( 1.0 );
+ myWidthSpin->setMaximum( 1.0 );
myWidthSpin->setValue( w );
- myHeightSpin->setMaxValue( 1.0 );
+ myHeightSpin->setMaximum( 1.0 );
myHeightSpin->setValue( h );
blockSignals( false );
onXYChanged();
//=================================================================================================
void SMESHGUI_Preferences_ScalarBarDlg::onOrientationChanged()
{
- this->initScalarBarFromResources();
+ initScalarBarFromResources();
int aOrientation = myVertRadioBtn->isChecked();
if ( aOrientation == myIniOrientation )
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_Preferences_ScalarBarDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-// File : SMESHGUI_Preferences_ScalarBarDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
#ifndef SMESHGUI_PREFERENCES_SCALARBARDLG_H
#define SMESHGUI_PREFERENCES_SCALARBARDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
-class QButtonGroup;
class QCheckBox;
class QComboBox;
class QGroupBox;
-class QLabel;
class QLineEdit;
class QPushButton;
class QToolButton;
class QRadioButton;
class QSpinBox;
-class SMESHGUI;
-
-class QtxDblSpinBox;
-
-class LightApp_SelectionMgr;
+class SMESHGUI;
class SMESH_Actor;
+class QtxDoubleSpinBox;
+class QtxColorButton;
+class LightApp_SelectionMgr;
class SMESHGUI_EXPORT SMESHGUI_Preferences_ScalarBarDlg : public QDialog
{
Q_OBJECT
+private:
+ SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI* );
+
+ static SMESHGUI_Preferences_ScalarBarDlg* myDlg;
+
public:
~SMESHGUI_Preferences_ScalarBarDlg();
- static void ScalarBarPreferences( SMESHGUI* );
- static void ScalarBarProperties ( SMESHGUI* );
-protected:
- SMESHGUI_Preferences_ScalarBarDlg( SMESHGUI*, bool, bool modal = FALSE );
- static SMESHGUI_Preferences_ScalarBarDlg* myDlg;
- void closeEvent( QCloseEvent* e );
- void setOriginAndSize( const double x, const double y, const double w, const double h );
- void initScalarBarFromResources();
+ static void ScalarBarProperties( SMESHGUI* );
+
+ void closeEvent( QCloseEvent* );
+ void setOriginAndSize( const double,
+ const double,
+ const double,
+ const double );
+ void initScalarBarFromResources();
protected slots:
- void onOk();
- bool onApply();
- void onCancel();
- void onTitleColor();
- void onLabelsColor();
- void onSelectionChanged();
- void onXYChanged();
- void onOrientationChanged();
+ void onOk();
+ bool onApply();
+ void onCancel();
+ void onSelectionChanged();
+ void onXYChanged();
+ void onOrientationChanged();
private:
SMESHGUI* mySMESHGUI;
SMESH_Actor* myActor;
double myIniX, myIniY, myIniW, myIniH;
int myIniOrientation;
- double DEF_VER_X,DEF_VER_Y,DEF_VER_H,DEF_VER_W;
- double DEF_HOR_X,DEF_HOR_Y,DEF_HOR_H,DEF_HOR_W;
-
- QGroupBox* myRangeGrp;
- QLineEdit* myMinEdit;
- QLineEdit* myMaxEdit;
-
- QGroupBox* myFontGrp;
- QToolButton* myTitleColorBtn;
- QComboBox* myTitleFontCombo;
- QCheckBox* myTitleBoldCheck;
- QCheckBox* myTitleItalicCheck;
- QCheckBox* myTitleShadowCheck;
- QToolButton* myLabelsColorBtn;
- QComboBox* myLabelsFontCombo;
- QCheckBox* myLabelsBoldCheck;
- QCheckBox* myLabelsItalicCheck;
- QCheckBox* myLabelsShadowCheck;
+ double DEF_VER_X, DEF_VER_Y, DEF_VER_H, DEF_VER_W;
+ double DEF_HOR_X, DEF_HOR_Y, DEF_HOR_H, DEF_HOR_W;
+
+ QGroupBox* myRangeGrp;
+ QLineEdit* myMinEdit;
+ QLineEdit* myMaxEdit;
+
+ QGroupBox* myFontGrp;
+ QtxColorButton* myTitleColorBtn;
+ QComboBox* myTitleFontCombo;
+ QCheckBox* myTitleBoldCheck;
+ QCheckBox* myTitleItalicCheck;
+ QCheckBox* myTitleShadowCheck;
+ QtxColorButton* myLabelsColorBtn;
+ QComboBox* myLabelsFontCombo;
+ QCheckBox* myLabelsBoldCheck;
+ QCheckBox* myLabelsItalicCheck;
+ QCheckBox* myLabelsShadowCheck;
- QGroupBox* myLabColorGrp;
- QSpinBox* myColorsSpin;
- QSpinBox* myLabelsSpin;
-
- QButtonGroup* myOrientationGrp;
- QRadioButton* myVertRadioBtn;
- QRadioButton* myHorizRadioBtn;
-
- QGroupBox* myOriginDimGrp;
- QtxDblSpinBox* myXSpin;
- QtxDblSpinBox* myYSpin;
- QtxDblSpinBox* myWidthSpin;
- QtxDblSpinBox* myHeightSpin;
-
- QGroupBox* myButtonGrp;
- QPushButton* myOkBtn;
- QPushButton* myApplyBtn;
- QPushButton* myCancelBtn;
+ QGroupBox* myLabColorGrp;
+ QSpinBox* myColorsSpin;
+ QSpinBox* myLabelsSpin;
+
+ QGroupBox* myOrientationGrp;
+ QRadioButton* myVertRadioBtn;
+ QRadioButton* myHorizRadioBtn;
+
+ QGroupBox* myOriginDimGrp;
+ QtxDoubleSpinBox* myXSpin;
+ QtxDoubleSpinBox* myYSpin;
+ QtxDoubleSpinBox* myWidthSpin;
+ QtxDoubleSpinBox* myHeightSpin;
+
+ QGroupBox* myButtonGrp;
+ QPushButton* myOkBtn;
+ QPushButton* myApplyBtn;
+ QPushButton* myCancelBtn;
};
#endif // SMESHGUI_PREFERENCES_SCALARBARDLG_H
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_Preferences_SelectionDlg.cxx
-// Author : Natalia KOPNOVA
-// Module : SMESH
-// $Header$
-
-#include "SMESHGUI_Preferences_SelectionDlg.h"
-#include "SMESHGUI.h"
-
-#include "SMESHGUI_Utils.h"
-
-#include "SUIT_Desktop.h"
-
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qvalidator.h>
-#include <qspinbox.h>
-#include <qpushbutton.h>
-#include <qpalette.h>
-#include <qcolordialog.h>
-
-using namespace std;
-
-//=================================================================================
-// class : SMESHGUI_LineEdit
-// purpose :
-//=================================================================================
-SMESHGUI_LineEdit::SMESHGUI_LineEdit(QWidget* parent, const char *name)
- : QLineEdit(parent, name)
-{
-}
-
-SMESHGUI_LineEdit::SMESHGUI_LineEdit(const QString& text, QWidget* parent, const char *name)
- : QLineEdit(text, parent, name)
-{
-}
-
-void SMESHGUI_LineEdit::focusOutEvent(QFocusEvent* e)
-{
- const QValidator* aVal = validator();
- QString aText = text();
- int aCurPos = cursorPosition();
- if (aVal && aVal->validate(aText, aCurPos) != QValidator::Acceptable) {
- QString aValid = aText;
- aVal->fixup(aValid);
- if (aText != aValid) {
- setText(aValid);
- update();
- return;
- }
- }
- QLineEdit::focusOutEvent(e);
-}
-
-
-//=================================================================================
-// class : SMESHGUI_DoubleValidator
-// purpose :
-//=================================================================================
-SMESHGUI_DoubleValidator::SMESHGUI_DoubleValidator(QObject * parent, const char *name)
- : QDoubleValidator(parent, name)
-{
-}
-
-SMESHGUI_DoubleValidator::SMESHGUI_DoubleValidator(double bottom, double top, int decimals,
- QObject * parent, const char *name)
- : QDoubleValidator(bottom, top, decimals, parent, name)
-{
-}
-
-void SMESHGUI_DoubleValidator::fixup(QString& theText) const
-{
- bool ok;
- double aValue = theText.toDouble(&ok);
- if (ok) {
- if (aValue < bottom())
- theText = QString::number(bottom(), 'g', decimals());
- if (aValue > top())
- theText = QString::number(top(), 'g', decimals());
- }
-}
-
-
-//=================================================================================
-// class : SMESHGUI_Preferences_SelectionDlg()
-// purpose :
-//=================================================================================
-SMESHGUI_Preferences_SelectionDlg::SMESHGUI_Preferences_SelectionDlg( SMESHGUI* theModule, const char* name )
- : QDialog( SMESH::GetDesktop( theModule ), name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
- mySMESHGUI( theModule )
-{
- if ( !name ) setName( "SMESHGUI_Preferences_SelectionDlg" );
- setCaption( tr( "SMESH_PREF_SELECTION" ) );
-
- QVBoxLayout* aMainLayout = new QVBoxLayout(this, 11, 6);
- QLabel* aLabel;
-
- /***************************************************************/
- QGroupBox* aSelectBox = new QGroupBox(4, Qt::Horizontal, this, "selection");
- aSelectBox->setTitle(tr("SMESH_SELECTION"));
-
- aLabel = new QLabel(aSelectBox, "selection color label");
- aLabel->setText(tr("SMESH_OUTLINE_COLOR"));
- myColor[2] = new QPushButton(aSelectBox, "outline color");
- myColor[2]->setFixedSize(QSize(25, 25));
-
- aSelectBox->addSpace(0);
- aSelectBox->addSpace(0);
-
- aLabel = new QLabel(aSelectBox, "selection color label");
- aLabel->setText(tr("SMESH_ELEMENTS_COLOR"));
- myColor[1] = new QPushButton(aSelectBox, "elements color");
- myColor[1]->setFixedSize(QSize(25, 25));
-
- aLabel = new QLabel(aSelectBox, "selection width label");
- aLabel->setText(tr("SMESH_WIDTH"));
- myWidth[1] = new QSpinBox(0, 5, 1, aSelectBox, "selection width");
- myWidth[1]->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- myWidth[1]->setButtonSymbols(QSpinBox::PlusMinus);
- myWidth[1]->setMinimumWidth(50);
-
- /***************************************************************/
- QGroupBox* aPreSelectBox = new QGroupBox(1, Qt::Vertical, this, "preselection");
- aPreSelectBox->setTitle(tr("SMESH_PRESELECTION"));
-
- aLabel = new QLabel(aPreSelectBox, "preselection color label");
- aLabel->setText(tr("SMESH_HILIGHT_COLOR"));
- myColor[0] = new QPushButton(aPreSelectBox, "preselection color");
- myColor[0]->setFixedSize(QSize(25, 25));
-
- aLabel = new QLabel(aPreSelectBox, "preselection width label");
- aLabel->setText(tr("SMESH_WIDTH"));
- myWidth[0] = new QSpinBox(0, 5, 1, aPreSelectBox, "preselection width");
- myWidth[0]->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- myWidth[0]->setButtonSymbols(QSpinBox::PlusMinus);
- myWidth[0]->setMinimumWidth(50);
-
- /***************************************************************/
- QGroupBox* aPrecisionBox = new QGroupBox(1, Qt::Vertical, this, "preselection");
- aPrecisionBox->setTitle(tr("SMESH_PRECISION"));
- QDoubleValidator* aValidator = new SMESHGUI_DoubleValidator(aPrecisionBox);
- aValidator->setBottom(0.001);
- aValidator->setDecimals(6);
-
- aLabel = new QLabel(aPrecisionBox, "node tol label");
- aLabel->setText(tr("SMESH_NODES"));
- myPrecision[0] = new SMESHGUI_LineEdit(aPrecisionBox, "node precision");
- myPrecision[0]->setValidator(aValidator);
-
- aLabel = new QLabel(aPrecisionBox, "item tol label");
- aLabel->setText(tr("SMESH_ELEMENTS"));
- myPrecision[1] = new SMESHGUI_LineEdit(aPrecisionBox, "item precision");
- myPrecision[1]->setValidator(aValidator);
-
- /***************************************************************/
- QFrame* aButtons = new QFrame(this, "button box");
- aButtons->setFrameStyle(QFrame::Box | QFrame::Sunken);
- QHBoxLayout* aBtnLayout = new QHBoxLayout(aButtons, 11, 6);
- aBtnLayout->setAutoAdd(false);
-
- QPushButton* aOKBtn = new QPushButton(aButtons, "ok");
- aOKBtn->setText(tr("SMESH_BUT_OK"));
- aOKBtn->setAutoDefault(true);
- aOKBtn->setDefault(true);
- QPushButton* aCloseBtn = new QPushButton(aButtons, "close");
- aCloseBtn->setText(tr("SMESH_BUT_CLOSE"));
- aCloseBtn->setAutoDefault(true);
-
- aBtnLayout->addWidget(aOKBtn);
- aBtnLayout->addStretch();
- aBtnLayout->addWidget(aCloseBtn);
-
- /***************************************************************/
- aMainLayout->addWidget(aSelectBox);
- aMainLayout->addWidget(aPreSelectBox);
- aMainLayout->addWidget(aPrecisionBox);
- aMainLayout->addWidget(aButtons);
-
- for (int i = 0; i < 3; i++)
- connect(myColor[i], SIGNAL(clicked()), this, SLOT(onSelectColor()));
-
- connect(aOKBtn, SIGNAL(clicked()), this, SLOT(accept()));
- connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
-}
-
-//=================================================================================
-// function : ~SMESHGUI_Preferences_SelectionDlg()
-// purpose : Destroys the object and frees any allocated resources
-//=================================================================================
-SMESHGUI_Preferences_SelectionDlg::~SMESHGUI_Preferences_SelectionDlg()
-{
- // no need to delete child widgets, Qt does it all for us
-}
-
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_SelectionDlg::closeEvent( QCloseEvent* e )
-{
- reject();
-}
-
-//=================================================================================
-// function : onSelectColor()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_SelectionDlg::onSelectColor()
-{
- QPushButton* aSender = (QPushButton*)sender();
- QColor aColor = aSender->palette().active().button();
- aColor = QColorDialog::getColor(aColor, this);
- if (aColor.isValid()) {
- QPalette aPal = aSender->palette();
- aPal.setColor(QColorGroup::Button, aColor);
- aSender->setPalette(aPal);
- }
-}
-
-//=================================================================================
-// function : SetColor()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_SelectionDlg::SetColor(int type, QColor color)
-{
- if (type > 0 && type <= 3) {
- QPalette aPal = myColor[type-1]->palette();
- aPal.setColor(QColorGroup::Button, color);
- myColor[type-1]->setPalette(aPal);
- }
-}
-
-//=================================================================================
-// function : GetColor()
-// purpose :
-//=================================================================================
-QColor SMESHGUI_Preferences_SelectionDlg::GetColor(int type)
-{
- QColor aColor;
- if (type > 0 && type <= 3)
- aColor = myColor[type-1]->palette().active().button();
- return aColor;
-}
-
-//=================================================================================
-// function : SetWidth()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_SelectionDlg::SetWidth(int type, int value)
-{
- if (type > 0 && type <= 2)
- myWidth[type-1]->setValue(value);
-}
-
-//=================================================================================
-// function : GetWidth()
-// purpose :
-//=================================================================================
-int SMESHGUI_Preferences_SelectionDlg::GetWidth(int type)
-{
- if (type > 0 && type <= 2)
- return myWidth[type-1]->value();
- return 0;
-}
-
-//=================================================================================
-// function : SetPrecision()
-// purpose :
-//=================================================================================
-void SMESHGUI_Preferences_SelectionDlg::SetPrecision(int type, double value)
-{
- if (type > 0 && type <= 2)
- myPrecision[type-1]->setText(QString::number(value));
-}
-
-//=================================================================================
-// function : GetPrecision()
-// purpose :
-//=================================================================================
-double SMESHGUI_Preferences_SelectionDlg::GetPrecision(int type)
-{
- if (type > 0 && type <= 2)
- return myPrecision[type-1]->text().toDouble();
- return 0;
-}
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_Preferences_SelectionDlg.h
-// Author : Natalia KOPNOVA
-// Module : SMESH
-// $Header$
-
-#ifndef SMESHGUI_PREFERENCES_SELECTIONDLG_H
-#define SMESHGUI_PREFERENCES_SELECTIONDLG_H
-
-#include "SMESH_SMESHGUI.hxx"
-
-
-// QT Includes
-#include <qdialog.h>
-#include <qlineedit.h>
-#include <qvalidator.h>
-
-class QPushButton;
-class QSpinBox;
-class QColor;
-class SMESHGUI;
-
-class SMESHGUI_EXPORT SMESHGUI_LineEdit : public QLineEdit
-{
- Q_OBJECT
-
- public:
- SMESHGUI_LineEdit(QWidget* parent, const char* name = 0);
- SMESHGUI_LineEdit(const QString& text, QWidget* parent, const char* name = 0);
-
- ~SMESHGUI_LineEdit() {};
-
- protected:
- void focusOutEvent(QFocusEvent* e);
-};
-
-class SMESHGUI_EXPORT SMESHGUI_DoubleValidator : public QDoubleValidator
-{
- Q_OBJECT
-
- public:
- SMESHGUI_DoubleValidator(QObject* parent, const char* name = 0);
- SMESHGUI_DoubleValidator(double bottom, double top, int decimals,
- QObject* parent, const char* name = 0);
-
- ~SMESHGUI_DoubleValidator() {};
-
- void fixup(QString& text) const;
-};
-
-class SMESHGUI_EXPORT SMESHGUI_Preferences_SelectionDlg : public QDialog
-{
- Q_OBJECT
-
-public:
- SMESHGUI_Preferences_SelectionDlg( SMESHGUI*, const char* name = 0 );
- ~SMESHGUI_Preferences_SelectionDlg();
-
- void SetColor(int type, QColor color);
- QColor GetColor(int type);
- void SetWidth(int type, int value);
- int GetWidth(int type);
- void SetPrecision(int type, double value);
- double GetPrecision(int type);
-
-private:
- void closeEvent( QCloseEvent* e ) ;
-
-private slots:
- void onSelectColor();
-
-private:
- SMESHGUI* mySMESHGUI;
- QPushButton* myColor[3];
- QSpinBox* myWidth[2];
- QLineEdit* myPrecision[2];
-};
-
-#endif // SMESHGUI_PREFERENCES_SELECTIONDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_RemoveElementsDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_RemoveElementsDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_RemoveElementsDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMDS_Mesh.hxx"
+#include <SMESH_Actor.h>
+#include <SMDS_Mesh.hxx>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SVTK_Selector.h"
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Tools.h>
-#include "SalomeApp_Tools.h"
-#include "LightApp_Application.h"
-#include "utilities.h"
+#include <SVTK_Selector.h>
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qvariant.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
-
-using namespace std;
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+#define SPACING 6
+#define MARGIN 11
+
//=================================================================================
// class : SMESHGUI_RemoveElementsDlg()
// purpose :
//=================================================================================
SMESHGUI_RemoveElementsDlg
-::SMESHGUI_RemoveElementsDlg (SMESHGUI* theModule,
- const char* name,
- bool modal,
- WFlags fl)
- : QDialog(SMESH::GetDesktop(theModule),
- name,
- modal,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
+::SMESHGUI_RemoveElementsDlg(SMESHGUI* theModule)
+ : QDialog(SMESH::GetDesktop(theModule)),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule),
myBusy(false)
{
- QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_REM_ELEMENT")));
- QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
-
- if (!name)
- setName("SMESHGUI_RemoveElementsDlg");
- resize(303, 185);
- setCaption(tr("SMESH_REMOVE_ELEMENTS_TITLE"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_RemoveElementsDlgLayout = new QGridLayout(this);
- SMESHGUI_RemoveElementsDlgLayout->setSpacing(6);
- SMESHGUI_RemoveElementsDlgLayout->setMargin(11);
-
- /***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setTitle(tr("SMESH_ELEMENTS" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- Constructor1 = new QRadioButton(GroupConstructors, "Constructor1");
- Constructor1->setText(tr("" ));
- Constructor1->setPixmap(image0);
- Constructor1->setChecked(TRUE);
- Constructor1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth()));
- Constructor1->setMinimumSize(QSize(50, 0));
- GroupConstructorsLayout->addWidget(Constructor1, 0, 0);
- QSpacerItem* spacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupConstructorsLayout->addItem(spacer, 0, 1);
- SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupConstructors, 0, 0);
-
- /***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupButtons, 2, 0);
-
- /***************************************************************/
- GroupC1 = new QGroupBox(this, "GroupC1");
- GroupC1->setTitle(tr("SMESH_REMOVE" ));
- GroupC1->setMinimumSize(QSize(0, 0));
- GroupC1->setFrameShape(QGroupBox::Box);
- GroupC1->setFrameShadow(QGroupBox::Sunken);
- GroupC1->setColumnLayout(0, Qt::Vertical);
- GroupC1->layout()->setSpacing(0);
- GroupC1->layout()->setMargin(0);
- GroupC1Layout = new QGridLayout(GroupC1->layout());
- GroupC1Layout->setAlignment(Qt::AlignTop);
- GroupC1Layout->setSpacing(6);
- GroupC1Layout->setMargin(11);
- TextLabelC1A1 = new QLabel(GroupC1, "TextLabelC1A1");
- TextLabelC1A1->setText(tr("SMESH_ID_ELEMENTS" ));
- TextLabelC1A1->setMinimumSize(QSize(50, 0));
- TextLabelC1A1->setFrameShape(QLabel::NoFrame);
- TextLabelC1A1->setFrameShadow(QLabel::Plain);
- GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
- SelectButtonC1A1 = new QPushButton(GroupC1, "SelectButtonC1A1");
- SelectButtonC1A1->setText(tr("" ));
- SelectButtonC1A1->setPixmap(image1);
- SelectButtonC1A1->setToggleButton(FALSE);
- GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
- LineEditC1A1 = new QLineEdit(GroupC1, "LineEditC1A1");
- LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
- SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupC1, 1, 0);
-
- myHelpFileName = "removing_nodes_and_elements_page.html#removing_elements_anchor";
-
- Init(); /* Initialisations */
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle(tr("SMESH_REMOVE_NODES_TITLE"));
+ setSizeGripEnabled(true);
+
+ QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_REM_ELEMENT")));
+ QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
+
+ QVBoxLayout* SMESHGUI_RemoveElementsDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_RemoveElementsDlgLayout->setSpacing(SPACING);
+ SMESHGUI_RemoveElementsDlgLayout->setMargin(MARGIN);
+
+ /***************************************************************/
+ GroupConstructors = new QGroupBox(tr("SMESH_ELEMENTS"), this);
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ GroupConstructorsLayout->setSpacing(SPACING);
+ GroupConstructorsLayout->setMargin(MARGIN);
+
+ Constructor1 = new QRadioButton(GroupConstructors);
+ Constructor1->setIcon(image0);
+ Constructor1->setChecked(true);
+
+ GroupConstructorsLayout->addWidget(Constructor1);
+ GroupConstructorsLayout->addStretch();
+
+ /***************************************************************/
+ GroupC1 = new QGroupBox(tr("SMESH_REMOVE"), this);
+ QHBoxLayout* GroupC1Layout = new QHBoxLayout(GroupC1);
+ GroupC1Layout->setSpacing(SPACING);
+ GroupC1Layout->setMargin(MARGIN);
+
+ TextLabelC1A1 = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupC1);
+ SelectButtonC1A1 = new QPushButton(GroupC1);
+ SelectButtonC1A1->setIcon(image1);
+ LineEditC1A1 = new QLineEdit(GroupC1);
+ LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this));
+
+ GroupC1Layout->addWidget(TextLabelC1A1);
+ GroupC1Layout->addWidget(SelectButtonC1A1);
+ GroupC1Layout->addWidget(LineEditC1A1);
+
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupConstructors);
+ SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupC1);
+ SMESHGUI_RemoveElementsDlgLayout->addWidget(GroupButtons);
+
+ myHelpFileName = "removing_nodes_and_elements_page.html#removing_elements_anchor";
+
+ Init(); /* Initialisations */
}
//=================================================================================
//=================================================================================
SMESHGUI_RemoveElementsDlg::~SMESHGUI_RemoveElementsDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
//=================================================================================
void SMESHGUI_RemoveElementsDlg::Init()
{
- GroupC1->show();
myConstructorId = 0;
- Constructor1->setChecked(TRUE);
+ Constructor1->setChecked(true);
myEditCurrentArgument = LineEditC1A1;
- myNbOkElements = false;
+ myNbOkElements = 0;
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myActor = 0;
myBusy = false;
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
/* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
- SLOT(onTextChange(const QString&)));
-
- this->show(); /* displays Dialog */
+ SLOT(onTextChange(const QString&)));
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
SelectionIntoArgument();
}
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void SMESHGUI_RemoveElementsDlg::ConstructorsClicked (int)
-{
-}
-
//=================================================================================
// function : ClickOnApply()
// purpose :
{
if (mySMESHGUI->isActiveStudyLocked())
return;
+
if (myNbOkElements) {
- QStringList aListId = QStringList::split(" ", myEditCurrentArgument->text(), false);
+ QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
anArrayOfIdeces->length(aListId.count());
for (int i = 0; i < aListId.count(); i++)
//=================================================================================
void SMESHGUI_RemoveElementsDlg::ClickOnOk()
{
- this->ClickOnApply();
- this->ClickOnCancel();
-
- return;
+ ClickOnApply();
+ ClickOnCancel();
}
//=================================================================================
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
reject();
- return;
}
//=================================================================================
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
//function : onTextChange
//purpose :
//=======================================================================
-void SMESHGUI_RemoveElementsDlg::onTextChange (const QString& theNewText)
+void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText)
{
- if (myBusy)
- return;
+ if (myBusy) return;
myBusy = true;
myNbOkElements = 0;
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
if(const SMDS_MeshElement *anElem = aMesh->FindElement(aListId[i].toInt())) {
newIndices.Add(anElem->GetID());
void SMESHGUI_RemoveElementsDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
- switch (myConstructorId)
+ switch (myConstructorId) {
+ case 0: /* default constructor */
{
- case 0: /* default constructor */
- {
- if(send == SelectButtonC1A1) {
- LineEditC1A1->setFocus();
- myEditCurrentArgument = LineEditC1A1;
- }
- SelectionIntoArgument();
- break;
+ if(send == SelectButtonC1A1) {
+ LineEditC1A1->setFocus();
+ myEditCurrentArgument = LineEditC1A1;
}
+ SelectionIntoArgument();
+ break;
}
- return;
+ }
}
//=================================================================================
mySMESHGUI->SetActiveDialogBox((QDialog*)this); // ??
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(NodeSelection);
+ aViewWindow->SetSelectionMode(CellSelection);
SelectionIntoArgument(); // ??
}
// function : enterEvent()
// purpose :
//=================================================================================
-void SMESHGUI_RemoveElementsDlg::enterEvent (QEvent*)
+void SMESHGUI_RemoveElementsDlg::enterEvent(QEvent*)
{
if (!GroupConstructors->isEnabled())
ActivateThisDialog();
// function : closeEvent()
// purpose :
//=================================================================================
-void SMESHGUI_RemoveElementsDlg::closeEvent (QCloseEvent*)
+void SMESHGUI_RemoveElementsDlg::closeEvent(QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
- return;
+ ClickOnCancel();
}
//=======================================================================
//function : hideEvent
//purpose : caused by ESC key
//=======================================================================
-void SMESHGUI_RemoveElementsDlg::hideEvent (QHideEvent * e)
+void SMESHGUI_RemoveElementsDlg::hideEvent( QHideEvent* )
{
if (!isMinimized())
ClickOnCancel();
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_RemoveElementsDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-// File : SMESHGUI_RemoveElementsDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-#ifndef DIALOGBOX_REMOVE_ELEMENTS_H
-#define DIALOGBOX_REMOVE_ELEMENTS_H
+#ifndef SMESHGUI_REMOVEELEMENTSDLG_H
+#define SMESHGUI_REMOVEELEMENTSDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qvariant.h>
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class SMESHGUI;
class SMESH_Actor;
class SVTK_Selector;
-class SVTK_ViewWindow;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class LightApp_SelectionMgr;
//=================================================================================
// class : SMESHGUI_RemoveElementsDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_RemoveElementsDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_RemoveElementsDlg(SMESHGUI* theModule,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_RemoveElementsDlg();
+ SMESHGUI_RemoveElementsDlg( SMESHGUI* );
+ ~SMESHGUI_RemoveElementsDlg();
private:
-
- void Init() ;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
- void hideEvent ( QHideEvent * ); /* ESC key */
- void keyPressEvent( QKeyEvent* e );
-
- LightApp_SelectionMgr* mySelectionMgr;
- SVTK_Selector* mySelector;
- SMESHGUI* mySMESHGUI;
-
- int myNbOkElements; /* to check when arguments is defined */
- int myConstructorId; /* Current constructor id = radio button id */
- QLineEdit* myEditCurrentArgument; /* Current LineEdit */
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupC1;
- QLabel* TextLabelC1A1;
- QPushButton* SelectButtonC1A1;
- QLineEdit* LineEditC1A1;
-
- QString myHelpFileName;
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+
+ LightApp_SelectionMgr* mySelectionMgr;
+ SVTK_Selector* mySelector;
+ SMESHGUI* mySMESHGUI;
+
+ int myNbOkElements; /* to check when arguments is defined */
+ int myConstructorId; /* Current constructor id = radio button id */
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+
+ QGroupBox* GroupConstructors;
+ QRadioButton* Constructor1;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupC1;
+ QLabel* TextLabelC1A1;
+ QPushButton* SelectButtonC1A1;
+ QLineEdit* LineEditC1A1;
+
+ QString myHelpFileName;
private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void onTextChange(const QString&);
-
-protected:
- QGridLayout* SMESHGUI_RemoveElementsDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupC1Layout;
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
};
-#endif // DIALOGBOX_REMOVE_ELEMENTS_H
+#endif // SMESHGUI_REMOVEELEMENTSDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_RemoveNodesDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_RemoveNodesDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_RemoveNodesDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMDS_Mesh.hxx"
-
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+#include <SMESH_Actor.h>
+#include <SMDS_Mesh.hxx>
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SVTK_Selector.h"
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Tools.h>
-#include "utilities.h"
+#include <SVTK_Selector.h>
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qvariant.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
-
-using namespace std;
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+#define SPACING 6
+#define MARGIN 11
+
//=================================================================================
// class : SMESHGUI_RemoveNodesDlg()
// purpose :
//=================================================================================
SMESHGUI_RemoveNodesDlg
-::SMESHGUI_RemoveNodesDlg(SMESHGUI* theModule,
- const char* name,
- bool modal,
- WFlags fl)
- : QDialog(SMESH::GetDesktop(theModule),
- name,
- modal,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
+::SMESHGUI_RemoveNodesDlg(SMESHGUI* theModule)
+ : QDialog(SMESH::GetDesktop(theModule)),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule),
myBusy(false)
{
- QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_REM_NODE")));
- QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
-
- if (!name)
- setName("SMESHGUI_RemoveNodesDlg");
- resize(303, 185);
- setCaption(tr("SMESH_REMOVE_NODES_TITLE" ));
- setSizeGripEnabled(TRUE);
- SMESHGUI_RemoveNodesDlgLayout = new QGridLayout(this);
- SMESHGUI_RemoveNodesDlgLayout->setSpacing(6);
- SMESHGUI_RemoveNodesDlgLayout->setMargin(11);
-
- /***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setTitle(tr("SMESH_NODES" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- Constructor1 = new QRadioButton(GroupConstructors, "Constructor1");
- Constructor1->setText(tr("" ));
- Constructor1->setPixmap(image0);
- Constructor1->setChecked(TRUE);
- Constructor1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth()));
- Constructor1->setMinimumSize(QSize(50, 0));
- GroupConstructorsLayout->addWidget(Constructor1, 0, 0);
- QSpacerItem* spacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupConstructorsLayout->addItem(spacer, 0, 1);
- SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupConstructors, 0, 0);
-
- /***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupButtons, 2, 0);
-
- /***************************************************************/
- GroupC1 = new QGroupBox(this, "GroupC1");
- GroupC1->setTitle(tr("SMESH_REMOVE" ));
- GroupC1->setMinimumSize(QSize(0, 0));
- GroupC1->setFrameShape(QGroupBox::Box);
- GroupC1->setFrameShadow(QGroupBox::Sunken);
- GroupC1->setColumnLayout(0, Qt::Vertical);
- GroupC1->layout()->setSpacing(0);
- GroupC1->layout()->setMargin(0);
- GroupC1Layout = new QGridLayout(GroupC1->layout());
- GroupC1Layout->setAlignment(Qt::AlignTop);
- GroupC1Layout->setSpacing(6);
- GroupC1Layout->setMargin(11);
- TextLabelC1A1 = new QLabel(GroupC1, "TextLabelC1A1");
- TextLabelC1A1->setText(tr("SMESH_ID_NODES" ));
- TextLabelC1A1->setMinimumSize(QSize(50, 0));
- TextLabelC1A1->setFrameShape(QLabel::NoFrame);
- TextLabelC1A1->setFrameShadow(QLabel::Plain);
- GroupC1Layout->addWidget(TextLabelC1A1, 0, 0);
- SelectButtonC1A1 = new QPushButton(GroupC1, "SelectButtonC1A1");
- SelectButtonC1A1->setText(tr("" ));
- SelectButtonC1A1->setPixmap(image1);
- SelectButtonC1A1->setToggleButton(FALSE);
- GroupC1Layout->addWidget(SelectButtonC1A1, 0, 1);
- LineEditC1A1 = new QLineEdit(GroupC1, "LineEditC1A1");
- LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupC1Layout->addWidget(LineEditC1A1, 0, 2);
- SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupC1, 1, 0);
-
- myHelpFileName = "removing_nodes_and_elements_page.html#removing_nodes_anchor";
-
- Init(); /* Initialisations */
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle(tr("SMESH_REMOVE_NODES_TITLE"));
+ setSizeGripEnabled(true);
+
+ QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_REM_NODE")));
+ QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
+
+ QVBoxLayout* SMESHGUI_RemoveNodesDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_RemoveNodesDlgLayout->setSpacing(SPACING);
+ SMESHGUI_RemoveNodesDlgLayout->setMargin(MARGIN);
+
+ /***************************************************************/
+ GroupConstructors = new QGroupBox(tr("SMESH_NODES"), this);
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ GroupConstructorsLayout->setSpacing(SPACING);
+ GroupConstructorsLayout->setMargin(MARGIN);
+
+ Constructor1 = new QRadioButton(GroupConstructors);
+ Constructor1->setIcon(image0);
+ Constructor1->setChecked(true);
+
+ GroupConstructorsLayout->addWidget(Constructor1);
+ GroupConstructorsLayout->addStretch();
+
+ /***************************************************************/
+ GroupC1 = new QGroupBox(tr("SMESH_REMOVE"), this);
+ QHBoxLayout* GroupC1Layout = new QHBoxLayout(GroupC1);
+ GroupC1Layout->setSpacing(SPACING);
+ GroupC1Layout->setMargin(MARGIN);
+
+ TextLabelC1A1 = new QLabel(tr("SMESH_ID_NODES"), GroupC1);
+ SelectButtonC1A1 = new QPushButton(GroupC1);
+ SelectButtonC1A1->setIcon(image1);
+ LineEditC1A1 = new QLineEdit(GroupC1);
+ LineEditC1A1->setValidator(new SMESHGUI_IdValidator(this));
+
+ GroupC1Layout->addWidget(TextLabelC1A1);
+ GroupC1Layout->addWidget(SelectButtonC1A1);
+ GroupC1Layout->addWidget(LineEditC1A1);
+
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupConstructors);
+ SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupC1);
+ SMESHGUI_RemoveNodesDlgLayout->addWidget(GroupButtons);
+
+ myHelpFileName = "removing_nodes_and_elements_page.html#removing_nodes_anchor";
+
+ Init(); /* Initialisations */
}
//=================================================================================
//=================================================================================
SMESHGUI_RemoveNodesDlg::~SMESHGUI_RemoveNodesDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
//=================================================================================
void SMESHGUI_RemoveNodesDlg::Init()
{
- GroupC1->show();
myConstructorId = 0;
- Constructor1->setChecked(TRUE);
+ Constructor1->setChecked(true);
myEditCurrentArgument = LineEditC1A1;
myNbOkNodes = 0;
myBusy = false;
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(SelectButtonC1A1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&)));
- this->show(); /* displays Dialog */
-
SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
SelectionIntoArgument();
}
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void SMESHGUI_RemoveNodesDlg::ConstructorsClicked (int)
-{
-}
-
//=================================================================================
// function : ClickOnApply()
// purpose :
return;
if (myNbOkNodes) {
- QStringList aListId = QStringList::split(" ", myEditCurrentArgument->text(), false);
+ QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array;
anArrayOfIdeces->length(aListId.count());
for (int i = 0; i < aListId.count(); i++)
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
aResult = aMeshEditor->RemoveNodes(anArrayOfIdeces.inout());
- } catch(...) {
+ } catch (const SALOME::SALOME_Exception& S_ex) {
+ SalomeApp_Tools::QtCatchCorbaException(S_ex);
+ myEditCurrentArgument->clear();
+ } catch (...){
+ myEditCurrentArgument->clear();
}
if (aResult) {
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
//function : onTextChange
//purpose :
//=======================================================================
-void SMESHGUI_RemoveNodesDlg::onTextChange (const QString& theNewText)
+void SMESHGUI_RemoveNodesDlg::onTextChange(const QString& theNewText)
{
if (myBusy) return;
myBusy = true;
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
if (const SMDS_MeshNode *aNode = aMesh->FindNode(aListId[i].toInt())) {
newIndices.Add(aNode->GetID());
void SMESHGUI_RemoveNodesDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
- switch (myConstructorId)
+ switch (myConstructorId) {
+ case 0: /* default constructor */
{
- case 0: /* default constructor */
- {
- if(send == SelectButtonC1A1) {
- LineEditC1A1->setFocus();
- myEditCurrentArgument = LineEditC1A1;
- }
- SelectionIntoArgument();
- break;
+ if(send == SelectButtonC1A1) {
+ LineEditC1A1->setFocus();
+ myEditCurrentArgument = LineEditC1A1;
}
+ SelectionIntoArgument();
+ break;
}
- return;
+ }
}
//=================================================================================
// function : enterEvent()
// purpose :
//=================================================================================
-void SMESHGUI_RemoveNodesDlg::enterEvent (QEvent*)
+void SMESHGUI_RemoveNodesDlg::enterEvent(QEvent*)
{
if (!GroupConstructors->isEnabled())
ActivateThisDialog();
// function : closeEvent()
// purpose :
//=================================================================================
-void SMESHGUI_RemoveNodesDlg::closeEvent (QCloseEvent*)
+void SMESHGUI_RemoveNodesDlg::closeEvent(QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
- return;
+ ClickOnCancel();
}
//=======================================================================
//function : hideEvent
//purpose : caused by ESC key
//=======================================================================
-void SMESHGUI_RemoveNodesDlg::hideEvent (QHideEvent * e)
+void SMESHGUI_RemoveNodesDlg::hideEvent( QHideEvent* )
{
if (!isMinimized())
ClickOnCancel();
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_RemoveNodesDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-// File : SMESHGUI_RemoveNodesDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-#ifndef DIALOGBOX_REMOVE_NODES_H
-#define DIALOGBOX_REMOVE_NODES_H
+#ifndef SMESHGUI_REMOVENODESDLG_H
+#define SMESHGUI_REMOVENODESDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qvariant.h>
-#include <qdialog.h>
-
-// Open CASCADE Includes
-#include <TColStd_IndexedMapOfInteger.hxx>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QVBoxLayout;
-class QHBoxLayout;
-class QGridLayout;
-class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class SMESHGUI;
class SMESH_Actor;
class SVTK_Selector;
-class SVTK_ViewWindow;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class LightApp_SelectionMgr;
//=================================================================================
// class : SMESHGUI_RemoveNodesDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_RemoveNodesDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_RemoveNodesDlg(SMESHGUI* theModule,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_RemoveNodesDlg();
+ SMESHGUI_RemoveNodesDlg( SMESHGUI* );
+ ~SMESHGUI_RemoveNodesDlg();
private:
-
- void Init() ;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
- void hideEvent ( QHideEvent * ); /* ESC key */
- void keyPressEvent( QKeyEvent* e );
-
- LightApp_SelectionMgr* mySelectionMgr;
- SVTK_Selector* mySelector;
- SMESHGUI* mySMESHGUI;
-
- int myNbOkNodes; /* to check when arguments is defined */
- int myConstructorId; /* Current constructor id = radio button id */
- QLineEdit* myEditCurrentArgument; /* Current LineEdit */
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupC1;
- QLabel* TextLabelC1A1;
- QPushButton* SelectButtonC1A1;
- QLineEdit* LineEditC1A1;
-
- QString myHelpFileName;
-
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+
+ LightApp_SelectionMgr* mySelectionMgr;
+ SVTK_Selector* mySelector;
+ SMESHGUI* mySMESHGUI;
+
+ int myNbOkNodes; /* to check when arguments is defined */
+ int myConstructorId; /* Current constructor id = radio button id */
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+
+ QGroupBox* GroupConstructors;
+ QRadioButton* Constructor1;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupC1;
+ QLabel* TextLabelC1A1;
+ QPushButton* SelectButtonC1A1;
+ QLineEdit* LineEditC1A1;
+
+ QString myHelpFileName;
+
private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void onTextChange(const QString&);
-
-protected:
- QGridLayout* SMESHGUI_RemoveNodesDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupC1Layout;
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
};
-#endif // DIALOGBOX_REMOVE_NODES_H
+#endif // SMESHGUI_REMOVENODESDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_RenumberingDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_RenumberingDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_RenumberingDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMDS_Mesh.hxx"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-
-#include "LightApp_Application.h"
-
-#include "SALOME_ListIO.hxx"
-
-#include "utilities.h"
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-
-using namespace std;
-
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_MessageBox.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <SALOME_ListIO.hxx>
+
+// Qt includes
+#include <QApplication>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
+#define SPACING 6
+#define MARGIN 11
+
//=================================================================================
// class : SMESHGUI_RenumberingDlg()
// purpose :
//=================================================================================
-SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const char* name,
- const int unit, bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_RenumberingDlg::SMESHGUI_RenumberingDlg( SMESHGUI* theModule, const int unit)
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
myUnit = unit;
- if (!name)
- setName("SMESHGUI_RenumberingDlg");
- resize(303, 185);
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(unit == 0 ?
+ tr("SMESH_RENUMBERING_NODES_TITLE") :
+ tr("SMESH_RENUMBERING_ELEMENTS_TITLE"));
+ setSizeGripEnabled(true);
- QPixmap image0;
- QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("SMESH",tr("ICON_SELECT")));
+ SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( mySMESHGUI );
+ QPixmap image0(resMgr->loadPixmap("SMESH", unit == 0 ?
+ tr("ICON_DLG_RENUMBERING_NODES") :
+ tr("ICON_DLG_RENUMBERING_ELEMENTS")));
+ QPixmap image1(resMgr->loadPixmap("SMESH",tr("ICON_SELECT")));
- if (unit == 0) {
- image0 = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("SMESH",tr("ICON_DLG_RENUMBERING_NODES")));
- setCaption(tr("SMESH_RENUMBERING_NODES_TITLE" ));
- }
- else if (unit == 1) {
- image0 = QPixmap(SUIT_Session::session()->resourceMgr()->loadPixmap("SMESH",tr("ICON_DLG_RENUMBERING_ELEMENTS")));
- setCaption(tr("SMESH_RENUMBERING_ELEMENTS_TITLE" ));
- }
+ QVBoxLayout* SMESHGUI_RenumberingDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_RenumberingDlgLayout->setSpacing(SPACING);
+ SMESHGUI_RenumberingDlgLayout->setMargin(MARGIN);
+
+ /***************************************************************/
+ QGroupBox* GroupConstructors = new QGroupBox(unit == 0 ?
+ tr("SMESH_NODES") :
+ tr("SMESH_ELEMENTS"),
+ this);
+ myHelpFileName = unit == 0 ?
+ "renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor" :
+ "renumbering_nodes_and_elements_page.html#renumbering_elements_anchor";
+
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ GroupConstructorsLayout->setSpacing(SPACING);
+ GroupConstructorsLayout->setMargin(MARGIN);
+
+ Constructor1 = new QRadioButton(GroupConstructors);
+ Constructor1->setIcon(image0);
+ Constructor1->setChecked(true);
- setSizeGripEnabled(TRUE);
- SMESHGUI_RenumberingDlgLayout = new QGridLayout(this);
- SMESHGUI_RenumberingDlgLayout->setSpacing(6);
- SMESHGUI_RenumberingDlgLayout->setMargin(11);
+ GroupConstructorsLayout->addWidget(Constructor1);
+ GroupConstructorsLayout->addStretch();
/***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- if (unit == 0) {
- GroupConstructors->setTitle(tr("SMESH_NODES" ));
- myHelpFileName = "renumbering_nodes_and_elements_page.html#renumbering_nodes_anchor";
- }
- else if (unit == 1) {
- GroupConstructors->setTitle(tr("SMESH_ELEMENTS" ));
- myHelpFileName = "renumbering_nodes_and_elements_page.html#renumbering_elements_anchor";
- }
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- Constructor1 = new QRadioButton(GroupConstructors, "Constructor1");
- Constructor1->setText(tr("" ));
- Constructor1->setPixmap(image0);
- Constructor1->setChecked(TRUE);
- Constructor1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, Constructor1->sizePolicy().hasHeightForWidth()));
- Constructor1->setMinimumSize(QSize(50, 0));
- GroupConstructorsLayout->addWidget(Constructor1, 0, 0);
- QSpacerItem* spacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupConstructorsLayout->addItem(spacer, 0, 1);
- SMESHGUI_RenumberingDlgLayout->addWidget(GroupConstructors, 0, 0);
+ GroupMesh = new QGroupBox(tr("SMESH_RENUMBERING"), this);
+ QHBoxLayout* GroupMeshLayout = new QHBoxLayout(GroupMesh);
+ GroupMeshLayout->setMargin(MARGIN);
+ GroupMeshLayout->setSpacing(SPACING);
+
+ TextLabelMesh = new QLabel(tr("SMESH_MESH"), GroupMesh);
+ SelectButton = new QPushButton(GroupMesh);
+ SelectButton->setIcon(image1);
+ LineEditMesh = new QLineEdit(GroupMesh);
+ LineEditMesh->setReadOnly(true);
+
+ GroupMeshLayout->addWidget(TextLabelMesh);
+ GroupMeshLayout->addWidget(SelectButton);
+ GroupMeshLayout->addWidget(LineEditMesh);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_RenumberingDlgLayout->addWidget(GroupButtons, 2, 0);
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
/***************************************************************/
- GroupMesh = new QGroupBox(this, "GroupMesh");
- GroupMesh->setTitle(tr("SMESH_RENUMBERING" ));
- GroupMesh->setMinimumSize(QSize(0, 0));
- GroupMesh->setFrameShape(QGroupBox::Box);
- GroupMesh->setFrameShadow(QGroupBox::Sunken);
- GroupMesh->setColumnLayout(0, Qt::Vertical);
- GroupMesh->layout()->setSpacing(0);
- GroupMesh->layout()->setMargin(0);
- GroupMeshLayout = new QGridLayout(GroupMesh->layout());
- GroupMeshLayout->setAlignment(Qt::AlignTop);
- GroupMeshLayout->setSpacing(6);
- GroupMeshLayout->setMargin(11);
- TextLabelMesh = new QLabel(GroupMesh, "TextLabelMesh");
- TextLabelMesh->setText(tr("SMESH_MESH"));
- TextLabelMesh->setMinimumSize(QSize(50, 0));
- TextLabelMesh->setFrameShape(QLabel::NoFrame);
- TextLabelMesh->setFrameShadow(QLabel::Plain);
- GroupMeshLayout->addWidget(TextLabelMesh, 0, 0);
- SelectButton = new QPushButton(GroupMesh, "SelectButton");
- SelectButton->setText(tr("" ));
- SelectButton->setPixmap(image1);
- SelectButton->setToggleButton(FALSE);
- GroupMeshLayout->addWidget(SelectButton, 0, 1);
- LineEditMesh = new QLineEdit(GroupMesh, "LineEditMesh");
- LineEditMesh->setReadOnly(true);
- GroupMeshLayout->addWidget(LineEditMesh, 0, 2);
- SMESHGUI_RenumberingDlgLayout->addWidget(GroupMesh, 1, 0);
+ SMESHGUI_RenumberingDlgLayout->addWidget(GroupConstructors);
+ SMESHGUI_RenumberingDlgLayout->addWidget(GroupMesh);
+ SMESHGUI_RenumberingDlgLayout->addWidget(GroupButtons);
Init(); /* Initialisations */
}
//=================================================================================
SMESHGUI_RenumberingDlg::~SMESHGUI_RenumberingDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
//=================================================================================
void SMESHGUI_RenumberingDlg::Init()
{
- GroupMesh->show();
myConstructorId = 0;
- Constructor1->setChecked(TRUE);
+ Constructor1->setChecked(true);
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
myMesh = SMESH::SMESH_Mesh::_nil();
myMeshFilter = new SMESH_TypeFilter (MESH);
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(SelectButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
/* to close dialog if study change */
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
- this->show(); /* displays Dialog */
-
myEditCurrentArgument = LineEditMesh;
LineEditMesh->setFocus();
mySelectionMgr->clearFilters();
SelectionIntoArgument();
}
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void SMESHGUI_RenumberingDlg::ConstructorsClicked (int)
-{
-}
-
//=================================================================================
// function : ClickOnApply()
// purpose :
if (mySMESHGUI->isActiveStudyLocked())
return;
- if (!myMesh->_is_nil())
- {
- try
- {
- SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
- bool isUnitsLabeled = false;
-
- if (myUnit == 0 && anActor) {
- isUnitsLabeled = anActor->GetPointsLabeled();
- if (isUnitsLabeled) anActor->SetPointsLabeled(false);
- }
- else if (myUnit == 1 && anActor) {
- isUnitsLabeled = anActor->GetCellsLabeled();
- if (isUnitsLabeled) anActor->SetCellsLabeled(false);
- }
-
- QApplication::setOverrideCursor(Qt::waitCursor);
- if (myUnit == 0) {
- aMeshEditor->RenumberNodes();
- if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
- }
- else if (myUnit == 1) {
- aMeshEditor->RenumberElements();
- if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
- }
- QApplication::restoreOverrideCursor();
- }
- catch(...)
- {
- }
-
- //mySelectionMgr->clearSelected();
- SMESH::UpdateView();
+ if (!myMesh->_is_nil()) {
+ try {
+ SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
+ SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh);
+ bool isUnitsLabeled = false;
+
+ if (myUnit == 0 && anActor) {
+ isUnitsLabeled = anActor->GetPointsLabeled();
+ if (isUnitsLabeled) anActor->SetPointsLabeled(false);
+ }
+ else if (myUnit == 1 && anActor) {
+ isUnitsLabeled = anActor->GetCellsLabeled();
+ if (isUnitsLabeled) anActor->SetCellsLabeled(false);
+ }
+
+ QApplication::setOverrideCursor(Qt::WaitCursor);
+ if (myUnit == 0) {
+ aMeshEditor->RenumberNodes();
+ if (isUnitsLabeled && anActor) anActor->SetPointsLabeled(true);
+ }
+ else if (myUnit == 1) {
+ aMeshEditor->RenumberElements();
+ if (isUnitsLabeled && anActor) anActor->SetCellsLabeled(true);
+ }
+ QApplication::restoreOverrideCursor();
+ }
+ catch(...) {
}
+
+ //mySelectionMgr->clearSelected();
+ SMESH::UpdateView();
+ }
}
//=================================================================================
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
void SMESHGUI_RenumberingDlg::closeEvent(QCloseEvent* e)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_RenumberingDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_RenumberingDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_RENUMBERING_H
-#define DIALOGBOX_RENUMBERING_H
+#ifndef SMESHGUI_RENUMBERINGDLG_H
+#define SMESHGUI_RENUMBERINGDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-//#include "SMESH_TypeFilter.hxx"
-#include "SUIT_SelectionFilter.h"
-
-// QT Includes
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
-// Open CASCADE Includes
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
-class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
class SMESHGUI;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
+class LightApp_SelectionMgr;
+class SUIT_SelectionFilter;
//=================================================================================
// class : SMESHGUI_RenumberingDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_RenumberingDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_RenumberingDlg( SMESHGUI*,
- const char* name = 0,
- const int unit = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_RenumberingDlg();
+ SMESHGUI_RenumberingDlg( SMESHGUI*, const int = 0 );
+ ~SMESHGUI_RenumberingDlg();
private:
- void Init();
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ) ; /* mouse enter the QWidget */
- void hideEvent ( QHideEvent * ); /* ESC key */
- void keyPressEvent( QKeyEvent* e );
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- int myConstructorId; /* Current constructor id = radio button id */
- QLineEdit* myEditCurrentArgument; /* Current LineEdit */
-
- int myUnit;
- SMESH::SMESH_Mesh_var myMesh;
- //Handle(SMESH_TypeFilter) myMeshFilter;
- SUIT_SelectionFilter* myMeshFilter;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupMesh;
- QLabel* TextLabelMesh;
- QPushButton* SelectButton;
- QLineEdit* LineEditMesh;
-
- QString myHelpFileName;
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ int myConstructorId; /* Current constructor id = radio button id */
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+
+ int myUnit;
+ SMESH::SMESH_Mesh_var myMesh;
+ //Handle(SMESH_TypeFilter) myMeshFilter;
+ SUIT_SelectionFilter* myMeshFilter;
+
+ QGroupBox* GroupConstructors;
+ QRadioButton* Constructor1;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupMesh;
+ QLabel* TextLabelMesh;
+ QPushButton* SelectButton;
+ QLineEdit* LineEditMesh;
+
+ QString myHelpFileName;
private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
-
-protected:
- QGridLayout* SMESHGUI_RenumberingDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupMeshLayout;
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
};
-#endif // DIALOGBOX_RENUMBERING_H
+#endif // SMESHGUI_RENUMBERINGDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_RevolutionDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_RevolutionDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_RevolutionDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-#include "SMDS_Mesh.hxx"
-
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
+#include <SMDS_Mesh.hxx>
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SVTK_ViewWindow.h>
+#include <SVTK_Selector.h>
+#include <SALOME_ListIO.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qspinbox.h>
-#include <qvalidator.h>
-#include <qpixmap.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+
+// Qt includes
+#include <QApplication>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QSpinBox>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// class : SMESHGUI_RevolutionDlg()
// purpose :
//=================================================================================
-SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_RevolutionDlg::SMESHGUI_RevolutionDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_EDGE")));
QPixmap image1 ( mgr->loadPixmap("SMESH", tr("ICON_DLG_TRIANGLE")));
QPixmap image2 ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_RevolutionDlg");
- resize(303, 185);
- setCaption(tr("REVOLUTION_AROUND_AXIS"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_RevolutionDlgLayout = new QGridLayout(this);
- SMESHGUI_RevolutionDlgLayout->setSpacing(6);
- SMESHGUI_RevolutionDlgLayout->setMargin(11);
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("REVOLUTION_AROUND_AXIS"));
+ setSizeGripEnabled(true);
+
+ QVBoxLayout* SMESHGUI_RevolutionDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_RevolutionDlgLayout->setSpacing(SPACING);
+ SMESHGUI_RevolutionDlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setTitle(tr("SMESH_REVOLUTION" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- RadioButton1= new QRadioButton(GroupConstructors, "RadioButton1");
- RadioButton1->setText(tr("" ));
- RadioButton1->setPixmap(image0);
- GroupConstructorsLayout->addWidget(RadioButton1, 0, 0);
- RadioButton2= new QRadioButton(GroupConstructors, "RadioButton2");
- RadioButton2->setText(tr("" ));
- RadioButton2->setPixmap(image1);
- GroupConstructorsLayout->addWidget(RadioButton2, 0, 2);
- SMESHGUI_RevolutionDlgLayout->addWidget(GroupConstructors, 0, 0);
+ ConstructorsBox = new QGroupBox(tr("SMESH_REVOLUTION"), this);
+ GroupConstructors = new QButtonGroup(this);
+ QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
+ ConstructorsBoxLayout->setSpacing(SPACING);
+ ConstructorsBoxLayout->setMargin(MARGIN);
+
+ RadioButton1 = new QRadioButton(ConstructorsBox);
+ RadioButton1->setIcon(image0);
+ RadioButton2 = new QRadioButton(ConstructorsBox);
+ RadioButton2->setIcon(image1);
+
+ ConstructorsBoxLayout->addWidget(RadioButton1);
+ ConstructorsBoxLayout->addWidget(RadioButton2);
+ GroupConstructors->addButton(RadioButton1, 0);
+ GroupConstructors->addButton(RadioButton2, 1);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_RevolutionDlgLayout->addWidget(GroupButtons, 2, 0);
-
- /***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setTitle(tr("REVOLUTION_1D"));
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6);
- GroupArgumentsLayout->setMargin(11);
+ GroupArguments = new QGroupBox(tr("REVOLUTION_1D"), this);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
// Controls for elements selection
- TextLabelElements = new QLabel(GroupArguments, "TextLabelElements");
- TextLabelElements->setText(tr("SMESH_ID_ELEMENTS" ));
- TextLabelElements->setFixedWidth(74);
- GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
-
- SelectElementsButton = new QPushButton(GroupArguments, "SelectElementsButton");
- SelectElementsButton->setText(tr("" ));
- SelectElementsButton->setPixmap(image2);
- SelectElementsButton->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
+
+ SelectElementsButton = new QPushButton(GroupArguments);
+ SelectElementsButton->setIcon(image2);
- LineEditElements = new QLineEdit(GroupArguments, "LineEditElements");
- LineEditElements->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
+ LineEditElements = new QLineEdit(GroupArguments);
+ LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
// Control for the whole mesh selection
- CheckBoxMesh = new QCheckBox(GroupArguments, "CheckBoxMesh");
- CheckBoxMesh->setText(tr("SMESH_SELECT_WHOLE_MESH" ));
- GroupArgumentsLayout->addMultiCellWidget(CheckBoxMesh, 1, 1, 0, 3);
+ CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
// Controls for axis defining
- GroupAxis = new QGroupBox(GroupArguments, "GroupAxis");
- GroupAxis->setTitle(tr("SMESH_AXIS"));
- GroupAxis->setColumnLayout(0, Qt::Vertical);
- GroupAxis->layout()->setSpacing(0);
- GroupAxis->layout()->setMargin(0);
- QGridLayout* GroupAxisLayout = new QGridLayout(GroupAxis->layout());
- GroupAxisLayout->setAlignment(Qt::AlignTop);
- GroupAxisLayout->setSpacing(6);
- GroupAxisLayout->setMargin(11);
-
- TextLabelPoint = new QLabel(GroupAxis, "TextLabelPoint");
- TextLabelPoint->setText(tr("SMESH_POINT"));
- GroupAxisLayout->addWidget(TextLabelPoint, 0, 0);
-
- SelectPointButton = new QPushButton(GroupAxis, "SelectPointButton");
- SelectPointButton->setPixmap(image2);
- GroupAxisLayout->addWidget(SelectPointButton, 0, 1);
-
- TextLabelX = new QLabel(GroupAxis, "TextLabelX");
- TextLabelX->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelX->setText(tr("SMESH_X"));
- GroupAxisLayout->addWidget(TextLabelX, 0, 2);
-
- SpinBox_X = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_X");
- GroupAxisLayout->addWidget(SpinBox_X, 0, 3);
-
- TextLabelY = new QLabel(GroupAxis, "TextLabelY");
- TextLabelY->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelY->setText(tr("SMESH_Y"));
- GroupAxisLayout->addWidget(TextLabelY, 0, 4);
-
- SpinBox_Y = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_Y");
- GroupAxisLayout->addWidget(SpinBox_Y, 0, 5);
-
- TextLabelZ = new QLabel(GroupAxis, "TextLabelZ");
- TextLabelZ->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelZ->setText(tr("SMESH_Z"));
- GroupAxisLayout->addWidget(TextLabelZ, 0, 6);
-
- SpinBox_Z = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_Z");
- GroupAxisLayout->addWidget(SpinBox_Z, 0, 7);
-
- TextLabelVector = new QLabel(GroupAxis, "TextLabelVector");
- TextLabelVector->setText(tr("SMESH_VECTOR"));
- GroupAxisLayout->addWidget(TextLabelVector, 1, 0);
-
- SelectVectorButton = new QPushButton(GroupAxis, "SelectVectorButton");
- SelectVectorButton->setPixmap(image2);
+ GroupAxis = new QGroupBox(tr("SMESH_AXIS"), GroupArguments);
+ QGridLayout* GroupAxisLayout = new QGridLayout(GroupAxis);
+ GroupAxisLayout->setSpacing(SPACING);
+ GroupAxisLayout->setMargin(MARGIN);
+
+ TextLabelPoint = new QLabel(tr("SMESH_POINT"), GroupAxis);
+ SelectPointButton = new QPushButton(GroupAxis);
+ SelectPointButton->setIcon(image2);
+
+ TextLabelX = new QLabel(tr("SMESH_X"), GroupAxis);
+ SpinBox_X = new SMESHGUI_SpinBox(GroupAxis);
+
+ TextLabelY = new QLabel(tr("SMESH_Y"), GroupAxis);
+ SpinBox_Y = new SMESHGUI_SpinBox(GroupAxis);
+
+ TextLabelZ = new QLabel(tr("SMESH_Z"), GroupAxis);
+ SpinBox_Z = new SMESHGUI_SpinBox(GroupAxis);
+
+ TextLabelVector = new QLabel(tr("SMESH_VECTOR"), GroupAxis);
+ SelectVectorButton = new QPushButton(GroupAxis);
+ SelectVectorButton->setIcon(image2);
+
+ TextLabelDX = new QLabel(tr("SMESH_DX"), GroupAxis);
+ SpinBox_DX = new SMESHGUI_SpinBox(GroupAxis);
+
+ TextLabelDY = new QLabel(tr("SMESH_DY"), GroupAxis);
+ SpinBox_DY = new SMESHGUI_SpinBox(GroupAxis);
+
+ TextLabelDZ = new QLabel(tr("SMESH_DZ"), GroupAxis);
+ SpinBox_DZ = new SMESHGUI_SpinBox(GroupAxis);
+
+ GroupAxisLayout->addWidget(TextLabelPoint, 0, 0);
+ GroupAxisLayout->addWidget(SelectPointButton, 0, 1);
+ GroupAxisLayout->addWidget(TextLabelX, 0, 2);
+ GroupAxisLayout->addWidget(SpinBox_X, 0, 3);
+ GroupAxisLayout->addWidget(TextLabelY, 0, 4);
+ GroupAxisLayout->addWidget(SpinBox_Y, 0, 5);
+ GroupAxisLayout->addWidget(TextLabelZ, 0, 6);
+ GroupAxisLayout->addWidget(SpinBox_Z, 0, 7);
+ GroupAxisLayout->addWidget(TextLabelVector, 1, 0);
GroupAxisLayout->addWidget(SelectVectorButton, 1, 1);
-
- TextLabelDX = new QLabel(GroupAxis, "TextLabelDX");
- TextLabelDX->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelDX->setText(tr("SMESH_DX"));
- GroupAxisLayout->addWidget(TextLabelDX, 1, 2);
-
- SpinBox_DX = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_DX");
- GroupAxisLayout->addWidget(SpinBox_DX, 1, 3);
-
- TextLabelDY = new QLabel(GroupAxis, "TextLabelDY");
- TextLabelDY->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelDY->setText(tr("SMESH_DY"));
- GroupAxisLayout->addWidget(TextLabelDY, 1, 4);
-
- SpinBox_DY = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_DY");
- GroupAxisLayout->addWidget(SpinBox_DY, 1, 5);
-
- TextLabelDZ = new QLabel(GroupAxis, "TextLabelDZ");
- TextLabelDZ->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelDZ->setText(tr("SMESH_DZ"));
- GroupAxisLayout->addWidget(TextLabelDZ, 1, 6);
-
- SpinBox_DZ = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_DZ");
- GroupAxisLayout->addWidget(SpinBox_DZ, 1, 7);
-
- GroupArgumentsLayout->addMultiCellWidget(GroupAxis, 2, 2, 0, 3);
+ GroupAxisLayout->addWidget(TextLabelDX, 1, 2);
+ GroupAxisLayout->addWidget(SpinBox_DX, 1, 3);
+ GroupAxisLayout->addWidget(TextLabelDY, 1, 4);
+ GroupAxisLayout->addWidget(SpinBox_DY, 1, 5);
+ GroupAxisLayout->addWidget(TextLabelDZ, 1, 6);
+ GroupAxisLayout->addWidget(SpinBox_DZ, 1, 7);
// Controls for angle defining
- TextLabelAngle = new QLabel(GroupArguments, "TextLabelAngle");
- TextLabelAngle->setText(tr("SMESH_ANGLE" ));
- GroupArgumentsLayout->addMultiCellWidget(TextLabelAngle, 3, 3, 0, 1);
-
- SpinBox_Angle = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Angle");
- GroupArgumentsLayout->addWidget(SpinBox_Angle, 3, 2);
+ TextLabelAngle = new QLabel(tr("SMESH_ANGLE"), GroupArguments);
+ SpinBox_Angle = new SMESHGUI_SpinBox(GroupArguments);
// Controls for nb. steps defining
- TextLabelNbSteps = new QLabel(GroupArguments, "TextLabelNbSteps");
- TextLabelNbSteps->setText(tr("SMESH_NUMBEROFSTEPS" ));
- GroupArgumentsLayout->addMultiCellWidget(TextLabelNbSteps, 4, 4, 0, 1);
-
- SpinBox_NbSteps = new QSpinBox(GroupArguments, "SpinBox_NbSteps");
- GroupArgumentsLayout->addWidget(SpinBox_NbSteps, 4, 2);
+ TextLabelNbSteps = new QLabel(tr("SMESH_NUMBEROFSTEPS"), GroupArguments);
+ SpinBox_NbSteps = new QSpinBox(GroupArguments);
// Controls for tolerance defining
- TextLabelTolerance = new QLabel(GroupArguments, "TextLabelTolerance");
- TextLabelTolerance->setText(tr("SMESH_TOLERANCE"));
- GroupArgumentsLayout->addMultiCellWidget(TextLabelTolerance, 5, 5, 0, 1);
-
- SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Tolerance");
- GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 5, 2);
+ TextLabelTolerance = new QLabel(tr("SMESH_TOLERANCE"), GroupArguments);
+ SpinBox_Tolerance = new SMESHGUI_SpinBox(GroupArguments);
// CheckBox for groups generation
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
MakeGroupsCheck->setChecked(true);
- GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 6, 6, 0, 3);
+ GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
+ GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
+ GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 3);
+ GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 3);
+ GroupArgumentsLayout->addWidget(TextLabelAngle, 3, 0, 1, 2);
+ GroupArgumentsLayout->addWidget(SpinBox_Angle, 3, 2);
+ GroupArgumentsLayout->addWidget(TextLabelNbSteps, 4, 0, 1, 2);
+ GroupArgumentsLayout->addWidget(SpinBox_NbSteps, 4, 2);
+ GroupArgumentsLayout->addWidget(TextLabelTolerance, 5, 0, 1, 2);
+ GroupArgumentsLayout->addWidget(SpinBox_Tolerance, 5, 2);
+ GroupArgumentsLayout->addWidget(MakeGroupsCheck, 6, 0, 1, 3);
- SMESHGUI_RevolutionDlgLayout->addWidget(GroupArguments, 1, 0);
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ SMESHGUI_RevolutionDlgLayout->addWidget(ConstructorsBox);
+ SMESHGUI_RevolutionDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_RevolutionDlgLayout->addWidget(GroupButtons);
/* Initialisations */
SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_Angle->RangeStepAndValidator(COORD_MIN, COORD_MAX, 5.0, 3);
- QIntValidator* anIntValidator = new QIntValidator(SpinBox_NbSteps);
- SpinBox_NbSteps->setValidator(anIntValidator);
SpinBox_NbSteps->setRange(1, 999999);
SpinBox_Tolerance->RangeStepAndValidator(0.0, COORD_MAX, 0.1, 6);
- GroupArguments->show();
- RadioButton1->setChecked(TRUE);
+ RadioButton1->setChecked(true);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
Init();
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
- connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(SelectPointButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(SelectVectorButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(SelectPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(SelectVectorButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
connect(SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
- this->show(); /* displays Dialog */
-
ConstructorsClicked(0);
SelectionIntoArgument();
- resize(0,0); // ??
}
//=================================================================================
return;
if (myNbOkElements && IsAxisOk()) {
- QStringList aListElementsId = QStringList::split(" ", myElementsId, false);
+ QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId = new SMESH::long_array;
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
if ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() )
SMESH::ListOfGroups_var groups =
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
//=================================================================================
void SMESHGUI_RevolutionDlg::DeactivateActiveDialog()
{
- if (GroupConstructors->isEnabled()) {
- GroupConstructors->setEnabled(false);
+ if (ConstructorsBox->isEnabled()) {
+ ConstructorsBox->setEnabled(false);
GroupArguments->setEnabled(false);
GroupButtons->setEnabled(false);
mySMESHGUI->ResetState();
{
/* Emit a signal to deactivate the active dialog */
mySMESHGUI->EmitSignalDeactivateDialog();
- GroupConstructors->setEnabled(true);
+ ConstructorsBox->setEnabled(true);
GroupArguments->setEnabled(true);
GroupButtons->setEnabled(true);
//=================================================================================
void SMESHGUI_RevolutionDlg::enterEvent (QEvent*)
{
- if (!GroupConstructors->isEnabled())
+ if (!ConstructorsBox->isEnabled())
ActivateThisDialog();
}
void SMESHGUI_RevolutionDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
//=================================================================================
int SMESHGUI_RevolutionDlg::GetConstructorId()
{
- if (GroupConstructors != NULL && GroupConstructors->selected() != NULL)
- return GroupConstructors->id(GroupConstructors->selected());
- return -1;
+ return GroupConstructors->checkedId();
}
//=================================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_RevolutionDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_RevolutionDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_REVOLUTION_H
-#define DIALOGBOX_REVOLUTION_H
+#ifndef SMESHGUI_REVOLUTIONDLG_H
+#define SMESHGUI_REVOLUTIONDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-
-#include "SMESH_LogicalFilter.hxx"
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
class QButtonGroup;
class QGroupBox;
class QLabel;
class SMESHGUI_SpinBox;
class SMESHGUI;
class SMESH_Actor;
-class SMESHGUI_SpinBox;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
+class LightApp_SelectionMgr;
+class SMESH_LogicalFilter;
//=================================================================================
// class : SMESHGUI_RevolutionDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_RevolutionDlg (SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_RevolutionDlg();
+ SMESHGUI_RevolutionDlg( SMESHGUI* );
+ ~SMESHGUI_RevolutionDlg();
private:
- void Init (bool ResetControls = true);
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
- int GetConstructorId();
- bool IsAxisOk();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- int myNbOkElements; /* to check when elements are defined */
- QString myElementsId;
- QWidget* myEditCurrentArgument; /* Current argument */
- SVTK_Selector* mySelector;
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
- SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton1;
- QRadioButton* RadioButton2;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupArguments;
- QGroupBox* GroupAxis;
- QLabel* TextLabelElements;
- QPushButton* SelectElementsButton;
- QLineEdit* LineEditElements;
- QCheckBox* CheckBoxMesh;
- QCheckBox* MakeGroupsCheck;
-
- QLabel* TextLabelPoint;
- QPushButton* SelectPointButton;
- QLabel* TextLabelX;
- SMESHGUI_SpinBox* SpinBox_X;
- QLabel* TextLabelY;
- SMESHGUI_SpinBox* SpinBox_Y;
- QLabel* TextLabelZ;
- SMESHGUI_SpinBox* SpinBox_Z;
- QLabel* TextLabelVector;
- QPushButton* SelectVectorButton;
- QLabel* TextLabelDX;
- SMESHGUI_SpinBox* SpinBox_DX;
- QLabel* TextLabelDY;
- SMESHGUI_SpinBox* SpinBox_DY;
- QLabel* TextLabelDZ;
- SMESHGUI_SpinBox* SpinBox_DZ;
-
- QLabel* TextLabelAngle;
- SMESHGUI_SpinBox* SpinBox_Angle;
- QLabel* TextLabelNbSteps;
- QSpinBox* SpinBox_NbSteps;
- QLabel* TextLabelTolerance;
- SMESHGUI_SpinBox* SpinBox_Tolerance;
-
- QString myHelpFileName;
-
+ void Init( bool = true);
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ int GetConstructorId();
+ bool IsAxisOk();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ int myNbOkElements; /* to check when elements are defined */
+ QString myElementsId;
+ QWidget* myEditCurrentArgument; /* Current argument */
+ SVTK_Selector* mySelector;
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
+
+ QGroupBox* ConstructorsBox;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupArguments;
+ QGroupBox* GroupAxis;
+ QLabel* TextLabelElements;
+ QPushButton* SelectElementsButton;
+ QLineEdit* LineEditElements;
+ QCheckBox* CheckBoxMesh;
+ QCheckBox* MakeGroupsCheck;
+
+ QLabel* TextLabelPoint;
+ QPushButton* SelectPointButton;
+ QLabel* TextLabelX;
+ SMESHGUI_SpinBox* SpinBox_X;
+ QLabel* TextLabelY;
+ SMESHGUI_SpinBox* SpinBox_Y;
+ QLabel* TextLabelZ;
+ SMESHGUI_SpinBox* SpinBox_Z;
+ QLabel* TextLabelVector;
+ QPushButton* SelectVectorButton;
+ QLabel* TextLabelDX;
+ SMESHGUI_SpinBox* SpinBox_DX;
+ QLabel* TextLabelDY;
+ SMESHGUI_SpinBox* SpinBox_DY;
+ QLabel* TextLabelDZ;
+ SMESHGUI_SpinBox* SpinBox_DZ;
+
+ QLabel* TextLabelAngle;
+ SMESHGUI_SpinBox* SpinBox_Angle;
+ QLabel* TextLabelNbSteps;
+ QSpinBox* SpinBox_NbSteps;
+ QLabel* TextLabelTolerance;
+ SMESHGUI_SpinBox* SpinBox_Tolerance;
+
+ QString myHelpFileName;
+
private slots:
-
- void ConstructorsClicked (int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument();
- void SelectionIntoArgument();
- void DeactivateActiveDialog();
- void ActivateThisDialog();
- void onTextChange (const QString&);
- void onSelectMesh (bool toSelectMesh);
- void onVectorChanged();
-
-protected:
- QGridLayout* SMESHGUI_RevolutionDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupArgumentsLayout;
+ void ConstructorsClicked( int );
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onSelectMesh( bool );
+ void onVectorChanged();
};
-#endif // DIALOGBOX_REVOLUTION_H
+#endif // SMESHGUI_REVOLUTIONDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_RotationDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_RotationDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_RotationDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-#include "SMDS_Mesh.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
+#include <SMDS_Mesh.hxx>
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
-#include "LightApp_Application.h"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
-#include "SALOMEDSClient_SObject.hxx"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-#include "utilities.h"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_SObject.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+
+// Qt includes
+#include <QApplication>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
-
enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action type
+#define SPACING 8
+#define MARGIN 11
+
//=================================================================================
// class : SMESHGUI_RotationDlg()
// purpose :
//=================================================================================
-SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_RotationDlg::SMESHGUI_RotationDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_MESH_ROTATION")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_RotationDlg");
- resize(303, 185);
- setCaption(tr("SMESH_ROTATION_TITLE"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_RotationDlgLayout = new QGridLayout(this);
- SMESHGUI_RotationDlgLayout->setSpacing(6);
- SMESHGUI_RotationDlgLayout->setMargin(11);
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("SMESH_ROTATION_TITLE"));
+ setSizeGripEnabled(true);
- /***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupConstructors->sizePolicy().hasHeightForWidth()));
- GroupConstructors->setTitle(tr("SMESH_ROTATION"));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- RadioButton1= new QRadioButton(GroupConstructors, "RadioButton1");
- RadioButton1->setText(tr("" ));
- RadioButton1->setPixmap(image0);
- RadioButton1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)1,
- (QSizePolicy::SizeType)0,
- RadioButton1->sizePolicy().hasHeightForWidth()));
- RadioButton1->setMinimumSize(QSize(50, 0));
- GroupConstructorsLayout->addWidget(RadioButton1, 0, 0);
- QSpacerItem* spacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupConstructorsLayout->addItem(spacer, 0, 1);
- SMESHGUI_RotationDlgLayout->addWidget(GroupConstructors, 0, 0);
+ QVBoxLayout* SMESHGUI_RotationDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_RotationDlgLayout->setSpacing(SPACING);
+ SMESHGUI_RotationDlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupButtons->sizePolicy().hasHeightForWidth()));
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE"));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY"));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK"));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_RotationDlgLayout->addWidget(GroupButtons, 2, 0);
+ GroupConstructors = new QGroupBox(tr("SMESH_ROTATION"), this);
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ GroupConstructorsLayout->setSpacing(SPACING);
+ GroupConstructorsLayout->setMargin(MARGIN);
+
+ RadioButton1= new QRadioButton(GroupConstructors);
+ RadioButton1->setIcon(image0);
+
+ GroupConstructorsLayout->addWidget(RadioButton1);
+ GroupConstructorsLayout->addStretch();
/***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setTitle(tr("SMESH_ARGUMENTS"));
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6);
- GroupArgumentsLayout->setMargin(11);
+ GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
// Controls for elements selection
- TextLabelElements = new QLabel(GroupArguments, "TextLabelElements");
- TextLabelElements->setText(tr("SMESH_ID_ELEMENTS" ));
- //TextLabelElements->setFixedWidth(74);
- GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
-
- SelectElementsButton = new QPushButton(GroupArguments, "SelectElementsButton");
- SelectElementsButton->setText(tr("" ));
- SelectElementsButton->setPixmap(image1);
- SelectElementsButton->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
-
- LineEditElements = new QLineEdit(GroupArguments, "LineEditElements");
- LineEditElements->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupArgumentsLayout->addMultiCellWidget(LineEditElements, 0, 0, 2, 3);
+ TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
+ SelectElementsButton = new QPushButton(GroupArguments);
+ SelectElementsButton->setIcon(image1);
+ LineEditElements = new QLineEdit(GroupArguments);
+ LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
// Control for the whole mesh selection
- CheckBoxMesh = new QCheckBox(GroupArguments, "CheckBoxMesh");
- CheckBoxMesh->setText(tr("SMESH_SELECT_WHOLE_MESH" ));
- GroupArgumentsLayout->addMultiCellWidget(CheckBoxMesh, 1, 1, 0, 3);
+ CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
// Controls for axis defining
- GroupAxis = new QGroupBox(GroupArguments, "GroupAxis");
- GroupAxis->setTitle(tr("SMESH_AXIS"));
- GroupAxis->setColumnLayout(0, Qt::Vertical);
- GroupAxis->layout()->setSpacing(0);
- GroupAxis->layout()->setMargin(0);
- QGridLayout* GroupAxisLayout = new QGridLayout(GroupAxis->layout());
- GroupAxisLayout->setAlignment(Qt::AlignTop);
- GroupAxisLayout->setSpacing(6);
- GroupAxisLayout->setMargin(11);
-
- TextLabelPoint = new QLabel(GroupAxis, "TextLabelPoint");
- TextLabelPoint->setText(tr("SMESH_POINT"));
- GroupAxisLayout->addWidget(TextLabelPoint, 0, 0);
-
- SelectPointButton = new QPushButton(GroupAxis, "SelectPointButton");
- SelectPointButton->setPixmap(image1);
- GroupAxisLayout->addWidget(SelectPointButton, 0, 1);
-
- TextLabelX = new QLabel(GroupAxis, "TextLabelX");
- TextLabelX->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelX->setText(tr("SMESH_X"));
- GroupAxisLayout->addWidget(TextLabelX, 0, 2);
-
- SpinBox_X = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_X");
- GroupAxisLayout->addWidget(SpinBox_X, 0, 3);
-
- TextLabelY = new QLabel(GroupAxis, "TextLabelY");
- TextLabelY->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelY->setText(tr("SMESH_Y"));
- GroupAxisLayout->addWidget(TextLabelY, 0, 4);
-
- SpinBox_Y = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_Y");
- GroupAxisLayout->addWidget(SpinBox_Y, 0, 5);
-
- TextLabelZ = new QLabel(GroupAxis, "TextLabelZ");
- TextLabelZ->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelZ->setText(tr("SMESH_Z"));
- GroupAxisLayout->addWidget(TextLabelZ, 0, 6);
-
- SpinBox_Z = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_Z");
- GroupAxisLayout->addWidget(SpinBox_Z, 0, 7);
-
- TextLabelVector = new QLabel(GroupAxis, "TextLabelVector");
- TextLabelVector->setText(tr("SMESH_VECTOR"));
- GroupAxisLayout->addWidget(TextLabelVector, 1, 0);
-
- SelectVectorButton = new QPushButton(GroupAxis, "SelectVectorButton");
- SelectVectorButton->setPixmap(image1);
+ GroupAxis = new QGroupBox(tr("SMESH_AXIS"), GroupArguments);
+ QGridLayout* GroupAxisLayout = new QGridLayout(GroupAxis);
+ GroupAxisLayout->setSpacing(SPACING);
+ GroupAxisLayout->setMargin(MARGIN);
+
+ TextLabelPoint = new QLabel(tr("SMESH_POINT"), GroupAxis);
+ SelectPointButton = new QPushButton(GroupAxis);
+ SelectPointButton->setIcon(image1);
+
+ TextLabelX = new QLabel(tr("SMESH_X"), GroupAxis);
+ SpinBox_X = new SMESHGUI_SpinBox(GroupAxis);
+ TextLabelY = new QLabel(tr("SMESH_Y"), GroupAxis);
+ SpinBox_Y = new SMESHGUI_SpinBox(GroupAxis);
+ TextLabelZ = new QLabel(tr("SMESH_Z"), GroupAxis);
+ SpinBox_Z = new SMESHGUI_SpinBox(GroupAxis);
+
+ TextLabelVector = new QLabel(tr("SMESH_VECTOR"), GroupAxis);
+ SelectVectorButton = new QPushButton(GroupAxis);
+ SelectVectorButton->setIcon(image1);
+
+ TextLabelDX = new QLabel(tr("SMESH_DX"), GroupAxis);
+ SpinBox_DX = new SMESHGUI_SpinBox(GroupAxis);
+ TextLabelDY = new QLabel(tr("SMESH_DY"), GroupAxis);
+ SpinBox_DY = new SMESHGUI_SpinBox(GroupAxis);
+ TextLabelDZ = new QLabel(tr("SMESH_DZ"), GroupAxis);
+ SpinBox_DZ = new SMESHGUI_SpinBox(GroupAxis);
+
+ GroupAxisLayout->addWidget(TextLabelPoint, 0, 0);
+ GroupAxisLayout->addWidget(SelectPointButton, 0, 1);
+ GroupAxisLayout->addWidget(TextLabelX, 0, 2);
+ GroupAxisLayout->addWidget(SpinBox_X, 0, 3);
+ GroupAxisLayout->addWidget(TextLabelY, 0, 4);
+ GroupAxisLayout->addWidget(SpinBox_Y, 0, 5);
+ GroupAxisLayout->addWidget(TextLabelZ, 0, 6);
+ GroupAxisLayout->addWidget(SpinBox_Z, 0, 7);
+ GroupAxisLayout->addWidget(TextLabelVector, 1, 0);
GroupAxisLayout->addWidget(SelectVectorButton, 1, 1);
-
- TextLabelDX = new QLabel(GroupAxis, "TextLabelDX");
- TextLabelDX->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelDX->setText(tr("SMESH_DX"));
- GroupAxisLayout->addWidget(TextLabelDX, 1, 2);
-
- SpinBox_DX = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_DX");
- GroupAxisLayout->addWidget(SpinBox_DX, 1, 3);
-
- TextLabelDY = new QLabel(GroupAxis, "TextLabelDY");
- TextLabelDY->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelDY->setText(tr("SMESH_DY"));
- GroupAxisLayout->addWidget(TextLabelDY, 1, 4);
-
- SpinBox_DY = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_DY");
- GroupAxisLayout->addWidget(SpinBox_DY, 1, 5);
-
- TextLabelDZ = new QLabel(GroupAxis, "TextLabelDZ");
- TextLabelDZ->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelDZ->setText(tr("SMESH_DZ"));
- GroupAxisLayout->addWidget(TextLabelDZ, 1, 6);
-
- SpinBox_DZ = new SMESHGUI_SpinBox(GroupAxis, "SpinBox_DZ");
- GroupAxisLayout->addWidget(SpinBox_DZ, 1, 7);
-
- GroupArgumentsLayout->addMultiCellWidget(GroupAxis, 2, 2, 0, 3);
+ GroupAxisLayout->addWidget(TextLabelDX, 1, 2);
+ GroupAxisLayout->addWidget(SpinBox_DX, 1, 3);
+ GroupAxisLayout->addWidget(TextLabelDY, 1, 4);
+ GroupAxisLayout->addWidget(SpinBox_DY, 1, 5);
+ GroupAxisLayout->addWidget(TextLabelDZ, 1, 6);
+ GroupAxisLayout->addWidget(SpinBox_DZ, 1, 7);
// Controls for angle defining
- TextLabelAngle = new QLabel(GroupArguments, "TextLabelAngle");
- TextLabelAngle->setText(tr("SMESH_ANGLE"));
- GroupArgumentsLayout->addMultiCellWidget(TextLabelAngle, 3, 3, 0, 2);
-
- SpinBox_Angle = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_Angle");
- GroupArgumentsLayout->addWidget(SpinBox_Angle, 3, 2);
+ TextLabelAngle = new QLabel(tr("SMESH_ANGLE"), GroupArguments);
+ SpinBox_Angle = new SMESHGUI_SpinBox(GroupArguments);
// action switch
- ActionGroup = new QButtonGroup(1, Qt::Horizontal, GroupArguments, "ActionGroup");
- ActionGroup->setExclusive(true);
- ActionGroup->insert(new QRadioButton(tr("SMESH_MOVE_ELEMENTS"),ActionGroup), MOVE_ELEMS_BUTTON);
- ActionGroup->insert(new QRadioButton(tr("SMESH_COPY_ELEMENTS"),ActionGroup), COPY_ELEMS_BUTTON);
- ActionGroup->insert(new QRadioButton(tr("SMESH_CREATE_MESH" ),ActionGroup), MAKE_MESH_BUTTON);
- GroupArgumentsLayout->addMultiCellWidget(ActionGroup, 4, 6, 0, 2);
+ ActionBox = new QGroupBox(tr("ACTION"), GroupArguments);
+ ActionGroup = new QButtonGroup(GroupArguments);
+ QVBoxLayout* ActionBoxLayout = new QVBoxLayout(ActionBox);
+ ActionBoxLayout->setSpacing(SPACING);
+ ActionBoxLayout->setMargin(MARGIN);
+
+ QRadioButton* aMoveElements = new QRadioButton(tr("SMESH_MOVE_ELEMENTS"), ActionBox);
+ QRadioButton* aCopyElements = new QRadioButton(tr("SMESH_COPY_ELEMENTS"), ActionBox);
+ QRadioButton* aCreateMesh = new QRadioButton(tr("SMESH_CREATE_MESH"), ActionBox);
+
+ ActionBoxLayout->addWidget(aMoveElements);
+ ActionBoxLayout->addWidget(aCopyElements);
+ ActionBoxLayout->addWidget(aCreateMesh);
+ ActionGroup->addButton(aMoveElements, MOVE_ELEMS_BUTTON);
+ ActionGroup->addButton(aCopyElements, COPY_ELEMS_BUTTON);
+ ActionGroup->addButton(aCreateMesh, MAKE_MESH_BUTTON);
// CheckBox for groups generation
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
- GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 3);
// Name of a mesh to create
- LineEditNewMesh = new QLineEdit(GroupArguments, "LineEditNewMesh");
- GroupArgumentsLayout->addWidget(LineEditNewMesh, 6, 3);
+ LineEditNewMesh = new QLineEdit(GroupArguments);
+
+ GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
+ GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 2);
+ GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4);
+ GroupArgumentsLayout->addWidget(GroupAxis, 2, 0, 1, 4);
+ GroupArgumentsLayout->addWidget(TextLabelAngle, 3, 0, 1, 2);
+ GroupArgumentsLayout->addWidget(SpinBox_Angle, 3, 2);
+ GroupArgumentsLayout->addWidget(ActionBox, 4, 0, 3, 3);
+ GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 3);
+ GroupArgumentsLayout->addWidget(LineEditNewMesh, 6, 3);
+
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
- SMESHGUI_RotationDlgLayout->addWidget(GroupArguments, 1, 0);
+ /***************************************************************/
+ SMESHGUI_RotationDlgLayout->addWidget(GroupConstructors);
+ SMESHGUI_RotationDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_RotationDlgLayout->addWidget(GroupButtons);
/* Initialisations */
SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_Angle->RangeStepAndValidator(-360.0, +360.0, 5.0, 3);
- GroupArguments->show();
myConstructorId = 0;
- RadioButton1->setChecked(TRUE);
+ RadioButton1->setChecked(true);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SelectPointButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
- connect(ActionGroup, SIGNAL(clicked(int)), SLOT(onActionClicked(int)));
+ connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
- this->show(); /* displays Dialog */
-
- ConstructorsClicked(0);
- //SelectionIntoArgument();
onActionClicked(MOVE_ELEMS_BUTTON);
- resize(0,0); // ??
}
//=================================================================================
//=================================================================================
SMESHGUI_RotationDlg::~SMESHGUI_RotationDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
SpinBox_Angle->SetValue(45);
- ((QRadioButton*) ActionGroup->find( MOVE_ELEMS_BUTTON ))->setChecked(TRUE);
+ ActionGroup->button( MOVE_ELEMS_BUTTON )->setChecked(true);
CheckBoxMesh->setChecked(false);
// MakeGroupsCheck->setChecked(false);
// MakeGroupsCheck->setEnabled(false);
onSelectMesh(CheckBoxMesh->isChecked());
}
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void SMESHGUI_RotationDlg::ConstructorsClicked (int constructorId)
-{
-}
-
//=================================================================================
// function : ClickOnApply()
// purpose :
return;
if (myNbOkElements && IsAxisOk()) {
- QStringList aListElementsId = QStringList::split(" ", myElementsId, false);
+ QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId = new SMESH::long_array;
anAxis.vz = SpinBox_DZ->GetValue();
double anAngle = (SpinBox_Angle->GetValue())*PI/180;
- int actionButton = ActionGroup->id( ActionGroup->selected() );
+ int actionButton = ActionGroup->checkedId();
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
switch ( actionButton ) {
case MOVE_ELEMS_BUTTON:
aMeshEditor->Rotate(anElementsId, anAxis, anAngle, false);
case MAKE_MESH_BUTTON:
SMESH::SMESH_Mesh_var mesh =
aMeshEditor->RotateMakeMesh(anElementsId, anAxis, anAngle, makeGroups,
- LineEditNewMesh->text().latin1());
+ LineEditNewMesh->text().toLatin1().data());
}
QApplication::restoreOverrideCursor();
} catch (...) {
actionButton == MAKE_MESH_BUTTON )
mySMESHGUI->updateObjBrowser(true); // new groups may appear
Init(false);
- //ConstructorsClicked(GetConstructorId());
SelectionIntoArgument();
}
}
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt());
if (e)
MakeGroupsCheck->setChecked(false);
MakeGroupsCheck->setEnabled(false);
}
- else if ( ActionGroup->id( ActionGroup->selected() ) != MOVE_ELEMS_BUTTON ) {
+ else if ( ActionGroup->checkedId() != MOVE_ELEMS_BUTTON ) {
MakeGroupsCheck->setEnabled(true);
}
if (CheckBoxMesh->isChecked()) {
void SMESHGUI_RotationDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=================================================================================
}
else {
_PTR(SObject) meshSO = SMESH::FindSObject( myMesh );
- name = meshSO->GetName();
+ name = meshSO->GetName().c_str();
}
if ( !name.isEmpty() )
- LineEditNewMesh->setText( SMESH::UniqueMeshName( name.latin1(), "rotated"));
+ LineEditNewMesh->setText( SMESH::UniqueMeshName( name, "rotated"));
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_RotationDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_RotationDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_ROTATION_H
-#define DIALOGBOX_ROTATION_H
+#ifndef SMESHGUI_ROTATIONDLG_H
+#define SMESHGUI_ROTATIONDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
-
-#include "SMESH_LogicalFilter.hxx"
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
class QButtonGroup;
class QGroupBox;
class QLabel;
class QPushButton;
class QRadioButton;
class QCheckBox;
-class SMESHGUI_SpinBox;
class SMESHGUI;
class SMESH_Actor;
class SMESHGUI_SpinBox;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
+class LightApp_SelectionMgr;
+class SMESH_LogicalFilter;
//=================================================================================
// class : SMESHGUI_RotationDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_RotationDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_RotationDlg( SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_RotationDlg();
+ SMESHGUI_RotationDlg( SMESHGUI* );
+ ~SMESHGUI_RotationDlg();
private:
- void Init (bool ResetControls = true);
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
- bool IsAxisOk();
- void setNewMeshName();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- int myNbOkElements; /* to check when elements are defined */
- QString myElementsId;
- SVTK_Selector* mySelector;
-
- QWidget* myEditCurrentArgument; /* Current LineEdit */
- int myConstructorId;
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
- SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton1;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupArguments;
- QGroupBox* GroupAxis;
- QLabel* TextLabelElements;
- QPushButton* SelectElementsButton;
- QLineEdit* LineEditElements;
- QCheckBox* CheckBoxMesh;
-
- QLabel* TextLabelPoint;
- QPushButton* SelectPointButton;
- QLabel* TextLabelX;
- SMESHGUI_SpinBox* SpinBox_X;
- QLabel* TextLabelY;
- SMESHGUI_SpinBox* SpinBox_Y;
- QLabel* TextLabelZ;
- SMESHGUI_SpinBox* SpinBox_Z;
- QLabel* TextLabelVector;
- QPushButton* SelectVectorButton;
- QLabel* TextLabelDX;
- SMESHGUI_SpinBox* SpinBox_DX;
- QLabel* TextLabelDY;
- SMESHGUI_SpinBox* SpinBox_DY;
- QLabel* TextLabelDZ;
- SMESHGUI_SpinBox* SpinBox_DZ;
-
- QLabel* TextLabelAngle;
- SMESHGUI_SpinBox* SpinBox_Angle;
- //QCheckBox* CheckBoxCopy;
- QButtonGroup* ActionGroup;
- QCheckBox* MakeGroupsCheck;
- QLineEdit* LineEditNewMesh;
-
- QString myHelpFileName;
+ void Init( bool = true );
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ bool IsAxisOk();
+ void setNewMeshName();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ int myNbOkElements; /* to check when elements are defined */
+ QString myElementsId;
+ SVTK_Selector* mySelector;
+
+ QWidget* myEditCurrentArgument; /* Current LineEdit */
+ int myConstructorId;
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
+
+ QGroupBox* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupArguments;
+ QGroupBox* GroupAxis;
+ QLabel* TextLabelElements;
+ QPushButton* SelectElementsButton;
+ QLineEdit* LineEditElements;
+ QCheckBox* CheckBoxMesh;
+
+ QLabel* TextLabelPoint;
+ QPushButton* SelectPointButton;
+ QLabel* TextLabelX;
+ SMESHGUI_SpinBox* SpinBox_X;
+ QLabel* TextLabelY;
+ SMESHGUI_SpinBox* SpinBox_Y;
+ QLabel* TextLabelZ;
+ SMESHGUI_SpinBox* SpinBox_Z;
+ QLabel* TextLabelVector;
+ QPushButton* SelectVectorButton;
+ QLabel* TextLabelDX;
+ SMESHGUI_SpinBox* SpinBox_DX;
+ QLabel* TextLabelDY;
+ SMESHGUI_SpinBox* SpinBox_DY;
+ QLabel* TextLabelDZ;
+ SMESHGUI_SpinBox* SpinBox_DZ;
+
+ QLabel* TextLabelAngle;
+ SMESHGUI_SpinBox* SpinBox_Angle;
+ //QCheckBox* CheckBoxCopy;
+ QGroupBox* ActionBox;
+ QButtonGroup* ActionGroup;
+ QCheckBox* MakeGroupsCheck;
+ QLineEdit* LineEditNewMesh;
+
+ QString myHelpFileName;
private slots:
-
- void ConstructorsClicked (int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument();
- void SelectionIntoArgument();
- void DeactivateActiveDialog();
- void ActivateThisDialog();
- void onTextChange (const QString&);
- void onSelectMesh (bool toSelectMesh);
- void onVectorChanged();
- void onActionClicked(int button);
-
-protected:
- QGridLayout* SMESHGUI_RotationDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupArgumentsLayout;
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onSelectMesh( bool );
+ void onVectorChanged();
+ void onActionClicked( int );
};
-#endif // DIALOGBOX_ROTATION_H
+#endif // SMESHGUI_ROTATIONDLG_H
+++ /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 "QAD_Desktop.h"
-
-#include "SMESHGUI_SMESHGenUtils.h"
-
-#include "SALOMEconfig.h"
-#include CORBA_CLIENT_HEADER(SALOMEDS)
-
-namespace SMESH
-{
-
- SMESH::SMESH_Gen_var GetSMESHGen()
- {
- static SMESH::SMESH_Gen_var aSMESHGen;
- if(CORBA::is_nil(aSMESHGen)){
- if(QAD_Desktop* aDesktop = QAD_Application::getDesktop()){
- Engines::Component_var aComponent = aDesktop->getEngine("FactoryServer","SMESH");
- aSMESHGen = SMESH::SMESH_Gen::_narrow(aComponent);
- }
- }
- return aSMESHGen;
- }
-
-}
+++ /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 SMESHGUI_SMESHGenUtils_HeaderFile
-#define SMESHGUI_SMESHGenUtils_HeaderFile
-
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(SMESH_Gen)
-
-
-namespace SMESH
-{
-
- SMESH::SMESH_Gen_var GetSMESHGen();
-
-}
-
-
-#endif
-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// SMESH SMESHGUI_Selection
+//
+// 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
+// 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
+//
+// 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
+// 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 : SMESHGUI_Selection.cxx
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
+//
+// SMESH includes
#include "SMESHGUI_Selection.h"
+
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
-#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_GEOMGenUtils.h"
-#include "SMESH_Type.h"
-#include "SMESH_Actor.h"
-
-#include "LightApp_SelectionMgr.h"
-#include "SalomeApp_Study.h"
-#include "LightApp_VTKSelector.h"
+#include <SMESH_Type.h>
+#include <SMESH_Actor.h>
-#include "SUIT_Session.h"
-
-#include "SVTK_RenderWindowInteractor.h"
-#include "SVTK_ViewWindow.h"
+// SALOME GUI includes
+#include <SalomeApp_Study.h>
+#include <LightApp_VTKSelector.h>
+#include <SVTK_ViewWindow.h>
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SMESH_Gen)
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
#include CORBA_CLIENT_HEADER(SMESH_Group)
//function : SMESHGUI_Selection
//purpose :
//=======================================================================
-SMESHGUI_Selection::SMESHGUI_Selection()
-: LightApp_Selection()
-{
-}
-
-//=======================================================================
-//function : ~SMESHGUI_Selection
-//purpose :
-//=======================================================================
-SMESHGUI_Selection::~SMESHGUI_Selection()
+SMESHGUI_Selection::SMESHGUI_Selection( const QString& client, LightApp_SelectionMgr* mgr )
+: LightApp_Selection( client, mgr )
{
-}
-
-//=======================================================================
-//function : init
-//purpose :
-//=======================================================================
-void SMESHGUI_Selection::init( const QString& client, LightApp_SelectionMgr* mgr )
-{
- LightApp_Selection::init( client, mgr );
-
if( mgr && study() )
{
SalomeApp_Study* aSStudy = dynamic_cast<SalomeApp_Study*>(study());
}
}
+//=======================================================================
+//function : ~SMESHGUI_Selection
+//purpose :
+//=======================================================================
+SMESHGUI_Selection::~SMESHGUI_Selection()
+{
+}
+
//=======================================================================
//function : processOwner
//purpose :
}
//=======================================================================
-//function : param
+//function : parameter
//purpose :
//=======================================================================
-QtxValue SMESHGUI_Selection::param( const int ind, const QString& p ) const
+QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const
{
- QtxValue val;
- if ( p=="client" ) val = QtxValue( globalParam( p ) );
- else if ( p=="type" ) val = QtxValue( myTypes[ind] );
- else if ( p=="elemTypes" ) val = QtxValue( elemTypes( ind ) );
- else if ( p=="isAutoColor" ) val = QtxValue( isAutoColor( ind ) );
- else if ( p=="numberOfNodes" ) val = QtxValue( numberOfNodes( ind ) );
- else if ( p=="labeledTypes" ) val = QtxValue( labeledTypes( ind ) );
- else if ( p=="shrinkMode" ) val = QtxValue( shrinkMode( ind ) );
- else if ( p=="entityMode" ) val = QtxValue( entityMode( ind ) );
- else if ( p=="controlMode" ) val = QtxValue( controlMode( ind ) );
- else if ( p=="displayMode" ) val = QtxValue( displayMode( ind ) );
- else if ( p=="isComputable" ) val = QtxValue( isComputable( ind ) );
- else if ( p=="hasReference" ) val = QtxValue( hasReference( ind ) );
-// else if ( p=="isVisible" ) val = QtxValue( isVisible( ind ) );
-
- // printf( "--> param() : [%s] = %s (%s)\n", p.latin1(), val.toString().latin1(), val.typeName() );
- //if ( val.type() == QVariant::List )
- //cout << "size: " << val.toList().count() << endl;
+ QVariant val;
+ if ( p=="client" ) val = QVariant( LightApp_Selection::parameter( p ) );
+ else if ( p=="type" ) val = QVariant( myTypes[ind] );
+ else if ( p=="elemTypes" ) val = QVariant( elemTypes( ind ) );
+ else if ( p=="isAutoColor" ) val = QVariant( isAutoColor( ind ) );
+ else if ( p=="numberOfNodes" ) val = QVariant( numberOfNodes( ind ) );
+ else if ( p=="labeledTypes" ) val = QVariant( labeledTypes( ind ) );
+ else if ( p=="shrinkMode" ) val = QVariant( shrinkMode( ind ) );
+ else if ( p=="entityMode" ) val = QVariant( entityMode( ind ) );
+ else if ( p=="controlMode" ) val = QVariant( controlMode( ind ) );
+ else if ( p=="displayMode" ) val = QVariant( displayMode( ind ) );
+ else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) );
+ else if ( p=="hasReference" ) val = QVariant( hasReference( ind ) );
if( val.isValid() )
return val;
else
- return LightApp_Selection::param( ind, p );
+ return LightApp_Selection::parameter( ind, p );
}
//=======================================================================
SMESH_Actor* SMESHGUI_Selection::getActor( int ind ) const
{
if( ind >= 0 && ind < count() )
- return ((QPtrList<SMESH_Actor>&)myActors).at( ind );
+ return myActors.at( ind );
else
return 0;
}
//purpose : may return {'Edge' 'Face' 'Volume'} at most
//=======================================================================
-QValueList<QVariant> SMESHGUI_Selection::elemTypes( int ind ) const
+QList<QVariant> SMESHGUI_Selection::elemTypes( int ind ) const
{
- QValueList<QVariant> types;
+ QList<QVariant> types;
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
TVisualObjPtr object = actor->GetObject();
//purpose : may return {'Point' 'Cell'} at most
//=======================================================================
-QValueList<QVariant> SMESHGUI_Selection::labeledTypes( int ind ) const
+QList<QVariant> SMESHGUI_Selection::labeledTypes( int ind ) const
{
- QValueList<QVariant> types;
+ QList<QVariant> types;
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
if ( actor->GetPointsLabeled()) types.append( "Point" );
case SMESH_Actor::eEdge: return "eEdge";
case SMESH_Actor::eSurface: return "eSurface";
case SMESH_Actor::ePoint: return "ePoint";
- default:;
+ default: break;
}
}
return "Unknown";
//purpose : may return {'Edge' 'Face' 'Volume'} at most
//=======================================================================
-QValueList<QVariant> SMESHGUI_Selection::entityMode( int ind ) const
+QList<QVariant> SMESHGUI_Selection::entityMode( int ind ) const
{
- QValueList<QVariant> types;
+ QList<QVariant> types;
SMESH_Actor* actor = getActor( ind );
if ( actor ) {
unsigned int aMode = actor->GetEntityMode();
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).latin1() );
+ _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
if ( ! CORBA::is_nil( obj )) {
{
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
- _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).latin1() );
+ _PTR(SObject) sobj = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
CORBA::Object_var obj = SMESH::SObjectToObject( sobj, SMESH::GetActiveStudyDocument() );
if ( ! CORBA::is_nil( obj )) {
if ( !io.IsNull() ) {
SMESH::SMESH_Mesh_var mesh = SMESH::GetMeshByIO(io); // m,sm,gr->m
if ( !mesh->_is_nil() ) {*/
- _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).latin1() );
+ _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
//FindSObject( mesh );
if ( so ) {
CORBA::Object_var obj = SMESH::SObjectToObject(so, SMESH::GetActiveStudyDocument());
if (!mesh->_is_nil()){
if(mesh->HasShapeToMesh()) {
GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
- return QVariant( !shape->_is_nil(), 0 );
+ return QVariant( !shape->_is_nil() );
}
else
{
- return QVariant(!mesh->NbFaces()==0, 0);
+ return QVariant(!mesh->NbFaces()==0);
}
}
else
{
GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so );
- return QVariant( !shape->_is_nil(), 0 );
+ return QVariant( !shape->_is_nil() );
}
}
}
// }
// }
}
- return QVariant( false, 0 );
+ return QVariant( false );
}
//=======================================================================
QVariant SMESHGUI_Selection::hasReference( int ind ) const
{
- return QVariant( isReference( ind ), 0 );
+ return QVariant( isReference( ind ) );
}
//=======================================================================
if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" )
{
QString ent = entry( ind );
- SMESH_Actor* actor = SMESH::FindActorByEntry( ent.latin1() );
+ SMESH_Actor* actor = SMESH::FindActorByEntry( ent.toLatin1().data() );
if ( actor && actor->hasIO() ) {
if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView())
- return QVariant( aViewWindow->isVisible( actor->getIO() ), 0 );
+ return QVariant( aViewWindow->isVisible( actor->getIO() ) );
}
}
- return QVariant( false, 0 );
+ return QVariant( false );
}
//=======================================================================
int SMESHGUI_Selection::type( const QString& entry, _PTR(Study) study )
{
- _PTR(SObject) obj (study->FindObjectID(entry.latin1()));
+ _PTR(SObject) obj (study->FindObjectID(entry.toLatin1().data()));
if( !obj )
return -1;
-// SMESH SMESHGUI_Selection
+// SMESH SMESHGUI_Selection
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_Selection.h
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_Selection.h
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-// $Header$
-#ifndef SMESHGUI_SELECTION_HeaderFile
-#define SMESHGUI_SELECTION_HeaderFile
+#ifndef SMESHGUI_SELECTION_H
+#define SMESHGUI_SELECTION_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_Selection.h"
-#include "SALOMEDSClient_definitions.hxx"
+// SALOME GUI includes
+#include <LightApp_Selection.h>
+
+// SALOME KERNEL includes
+#include <SALOMEDSClient_definitions.hxx>
class LightApp_SelectionMgr;
-class SALOMEDSClient_Study;
class LightApp_DataOwner;
+class SALOMEDSClient_Study;
class SMESH_Actor;
class SMESHGUI_EXPORT SMESHGUI_Selection : public LightApp_Selection
{
public:
- SMESHGUI_Selection();
+ SMESHGUI_Selection( const QString&, LightApp_SelectionMgr* );
virtual ~SMESHGUI_Selection();
- virtual void init( const QString&, LightApp_SelectionMgr* );
- virtual QtxValue param( const int , const QString& paramName ) const;
- virtual void processOwner( const LightApp_DataOwner* );
+ virtual QVariant parameter( const int, const QString& ) const;
+ virtual void processOwner( const LightApp_DataOwner* );
// got from object, not from actor
- virtual bool isAutoColor( int ind ) const;
- virtual int numberOfNodes( int ind ) const;
- virtual QVariant isComputable( int ind ) const;
- virtual QVariant hasReference( int ind ) const;
- virtual QVariant isVisible( int ind ) const;
+ virtual bool isAutoColor( int ) const;
+ virtual int numberOfNodes( int ) const;
+ virtual QVariant isComputable( int ) const;
+ virtual QVariant hasReference( int ) const;
+ virtual QVariant isVisible( int ) const;
// parameters got from actor return nothing if an actor is not visible
- virtual QValueList<QVariant> elemTypes( int ind ) const;
- virtual QValueList<QVariant> labeledTypes( int ind ) const;
- virtual QString displayMode( int ind ) const;
- virtual QString shrinkMode( int ind ) const;
- virtual QValueList<QVariant> entityMode( int ind ) const;
- virtual QString controlMode( int ind ) const;
+ virtual QList<QVariant> elemTypes( int ) const;
+ virtual QList<QVariant> labeledTypes( int ) const;
+ virtual QString displayMode( int ) const;
+ virtual QString shrinkMode( int ) const;
+ virtual QList<QVariant> entityMode( int ) const;
+ virtual QString controlMode( int ) const;
- SMESH_Actor* getActor( int ind ) const;
+ SMESH_Actor* getActor( int ) const;
- static int type( const QString&, _PTR(Study) );
- static QString typeName( const int type);
+ static int type( const QString&, _PTR(Study) );
+ static QString typeName( const int );
private:
- QStringList myTypes;
- QPtrList<SMESH_Actor> myActors;
+ QStringList myTypes;
+ QList<SMESH_Actor*> myActors;
};
-#endif
+#endif // SMESHGUI_SELECTION_H
-// 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
+// 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 : SMESHGUI_SelectionOp.cxx
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-// File : SMESHGUI_SelectionOp.cxx
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-
-#include <SMESHGUI_SelectionOp.h>
-#include <SMESHGUI_VTKUtils.h>
-#include <SMESHGUI_MeshUtils.h>
-#include <SMESHGUI_Selection.h>
-#include <SMESHGUI.h>
+
+// SMESH includes
+#include "SMESHGUI_SelectionOp.h"
+
+#include "SMESHGUI.h"
+#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_MeshUtils.h"
+#include "SMESHGUI_Selection.h"
+
+#include <SMESH_Actor.h>
+#include <SMDS_Mesh.hxx>
+#include <SMDS_MeshNode.hxx>
+
+// SALOME GUI includes
#include <SUIT_SelectionFilter.h>
#include <LightApp_SelectionMgr.h>
#include <SalomeApp_Study.h>
-#include <LightApp_VTKSelector.h>
#include <SVTK_ViewWindow.h>
#include <SVTK_ViewModel.h>
-#include <SVTK_Selector.h>
-#include <SMESH_Actor.h>
-#include <SMDS_Mesh.hxx>
-#include <SMDS_MeshNode.hxx>
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
+// SALOME KERNEL includes
#include <SALOMEDS_SObject.hxx>
-#include <SALOME_ListIteratorOfListIO.hxx>
-
/*
Class : SMESHGUI_SelectionOp
Description : Base operation for all operations using object selection in viewer or objectbrowser
LightApp_SelectionMgr* mgr = selectionMgr();
Filters::const_iterator anIt = myFilters.begin(),
aLast = myFilters.end();
- for (; anIt != aLast; anIt++) {
- if (anIt.data()) {
- if (mgr) mgr->removeFilter(anIt.data());
- delete anIt.data();
+ for ( ; anIt != aLast; anIt++) {
+ if (anIt.value()) {
+ if (mgr) mgr->removeFilter(anIt.value());
+ delete anIt.value();
}
}
if( t<0 )
{
//try to get GEOM type
- _PTR( SObject ) sobj = st->FindObjectID( str.latin1() );
+ _PTR( SObject ) sobj = st->FindObjectID( str.toLatin1().data() );
if( sobj )
{
GEOM::GEOM_Object_var obj = GEOM::GEOM_Object::_narrow(
}
else
{
- int pos = str.find( idChar() );
+ int pos = str.indexOf( idChar() );
QString entry = str.left( pos ),
_id = str.mid( pos+1 );
bool ok;
int id = _id.toInt( &ok );
if( ok )
{
- _PTR( SObject ) sobj = st->FindObjectID( entry.latin1() );
+ _PTR( SObject ) sobj = st->FindObjectID( entry.toLatin1().data() );
SMESH::SMESH_Mesh_var mesh = SMESH::SMESH_Mesh::_narrow(
dynamic_cast<SALOMEDS_SObject*>( sobj.get() )->GetObject() );
SMESH::SMESH_subMesh_var submesh = SMESH::SMESH_subMesh::_narrow(
for( ; anIt!=aLast; anIt++ )
{
id_str = *anIt;
- int pos = idchar=='\0' ? -1 : id_str.find( idchar );
+ int pos = idchar=='\0' ? -1 : id_str.indexOf( idchar );
int id = -1;
if( idchar=='\0' || pos>=0 )
{
-// 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
+// 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 : SMESHGUI_SelectionOp.h
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-// File : SMESHGUI_SelectionOp.h
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-
-#ifndef SMESHGUI_SelectionOp_H
-#define SMESHGUI_SelectionOp_H
+#ifndef SMESHGUI_SELECTIONOP_H
+#define SMESHGUI_SELECTIONOP_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <SMESHGUI_Operation.h>
-#include <SMESHGUI_Dialog.h>
+#include "SMESHGUI_Operation.h"
+#include "SMESHGUI_Dialog.h"
+
+// SALOME GUI includes
#include <SVTK_Selection.h>
#include <SALOME_InteractiveObject.hxx>
+// IDL includes
#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Gen)
-
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
class SUIT_SelectionFilter;
class TColStd_MapOfInteger;
Q_OBJECT
public:
- typedef QValueList<int> IdList; //! List of node or element ids
+ typedef QList<int> IdList; //! List of node or element ids
public:
SMESHGUI_SelectionOp( const Selection_Mode = ActorSelection );
virtual ~SMESHGUI_SelectionOp();
- static void extractIds( const QStringList&, IdList&, const QChar );
+ static void extractIds( const QStringList&, IdList&, const QChar );
protected:
typedef enum
virtual SUIT_SelectionFilter* createFilter( const int ) const;
//! Remove only filters set by this operation (they are in map myFilters )
- void removeCustomFilters();
+ void removeCustomFilters();
//! Return what selection mode is set in VTK viewer
- Selection_Mode selectionMode() const;
+ Selection_Mode selectionMode() const;
//! Set selection mode in VTK viewer
- void setSelectionMode( const Selection_Mode );
+ void setSelectionMode( const Selection_Mode );
//! Hilight object in VTK viewer
- void highlight( const Handle( SALOME_InteractiveObject )&,
- const bool, const bool = true );
+ void highlight( const Handle( SALOME_InteractiveObject )&,
+ const bool, const bool = true );
//! Select some nodes or elements in VTK
- void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
- const TColStd_MapOfInteger&, const bool );
+ void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&,
+ const TColStd_MapOfInteger&, const bool );
- SVTK_ViewWindow* viewWindow() const;
- SVTK_Selector* selector() const;
+ SVTK_ViewWindow* viewWindow() const;
+ SVTK_Selector* selector() const;
//! Get names, types and ids of selected objects
- virtual void selected( QStringList&, SMESHGUI_Dialog::TypesList&, QStringList& ) const;
+ virtual void selected( QStringList&,
+ SMESHGUI_Dialog::TypesList&, QStringList& ) const;
//! Find type by id
- virtual int typeById( const QString&, const EntityType ) const;
+ virtual int typeById( const QString&, const EntityType ) const;
//! Char using to divide <entry> and <id> in string id representation. By default, '#'
- virtual QChar idChar() const;
+ virtual QChar idChar() const;
//! Try to find in certain object selection widget selected node or element ids and return it
- void selectedIds( const int, IdList& ) const;
+ void selectedIds( const int, IdList& ) const;
//! Find in QStringList correct node or element ids representation and append integer(id) to IdList
- void extractIds( const QStringList&, IdList& ) const;
+ void extractIds( const QStringList&, IdList& ) const;
//! Return selected mesh if selection mode isn't ActorSelection and only one object is selected
- SMESH::SMESH_Mesh_var mesh() const;
+ SMESH::SMESH_Mesh_var mesh() const;
//! Return actor according to selected mesh if selection mode isn't ActorSelection
- SMESH_Actor* actor() const;
+ SMESH_Actor* actor() const;
protected slots:
//! Installs filter corresponding to certain object selection widget
- virtual void onActivateObject( int );
+ virtual void onActivateObject( int );
//! Removes filter corresponding to certain object selection widget
- virtual void onDeactivateObject( int );
+ virtual void onDeactivateObject( int );
/*!
* Empty default implementation. In successors it may be used for more advanced selection checking.
* This slot is connected to signal when the selection changed in some object selection widget
*/
- virtual void onSelectionChanged( int );
+ virtual void onSelectionChanged( int );
/*! Default implementation allowing user to edit selected ids "by hands".
In order to run default mechanism, you must set for some
to this slot
Warning: this mechanism can process only integer ids, NOT MESH OR GROUP NAMES!!!
*/
- virtual void onTextChanged( int, const QStringList& );
+ virtual void onTextChanged( int, const QStringList& );
private:
typedef QMap<int, SUIT_SelectionFilter*> Filters;
Selection_Mode myDefSelectionMode, myOldSelectionMode;
};
-#endif
+#endif // SMESHGUI_SELECTIONOP_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_SewingDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_SewingDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_SewingDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMDS_Mesh.hxx"
-
-#include "SUIT_Session.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
+#include <SMESH_Actor.h>
+#include <SMDS_Mesh.hxx>
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qpixmap.h>
+// Qt includes
+#include <QApplication>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
-
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// class : SMESHGUI_SewingDlg()
// purpose :
//=================================================================================
-SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_SewingDlg::SMESHGUI_SewingDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
QPixmap image0 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_FREEBORDERS")));
QPixmap image3 (mgr->loadPixmap("SMESH", tr("ICON_SMESH_SEWING_SIDEELEMENTS")));
QPixmap image4 (mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_SewingDlg");
- resize(303, 185);
- setCaption(tr("SMESH_SEWING"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_SewingDlgLayout = new QGridLayout(this);
- SMESHGUI_SewingDlgLayout->setSpacing(6);
- SMESHGUI_SewingDlgLayout->setMargin(11);
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("SMESH_SEWING"));
+ setSizeGripEnabled(true);
- /***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupConstructors->sizePolicy().hasHeightForWidth()));
- GroupConstructors->setTitle(tr("SMESH_SEWING"));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- QHBoxLayout* RBLayout = new QHBoxLayout(0, 0, 6, "Layout2");
- RadioButton1= new QRadioButton(GroupConstructors, "RadioButton1");
- RadioButton1->setText(tr("" ));
- RadioButton1->setPixmap(image0);
- RBLayout->addWidget(RadioButton1);
- RadioButton2= new QRadioButton(GroupConstructors, "RadioButton2");
- RadioButton2->setText(tr("" ));
- RadioButton2->setPixmap(image1);
- RBLayout->addWidget(RadioButton2);
- RadioButton3= new QRadioButton(GroupConstructors, "RadioButton3");
- RadioButton3->setText(tr("" ));
- RadioButton3->setPixmap(image2);
- RBLayout->addWidget(RadioButton3);
- RadioButton4= new QRadioButton(GroupConstructors, "RadioButton4");
- RadioButton4->setText(tr("" ));
- RadioButton4->setPixmap(image3);
- RBLayout->addWidget(RadioButton4);
- GroupConstructorsLayout->addLayout(RBLayout, 0, 0);
- SMESHGUI_SewingDlgLayout->addWidget(GroupConstructors, 0, 0);
+ QVBoxLayout* SMESHGUI_SewingDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_SewingDlgLayout->setSpacing(SPACING);
+ SMESHGUI_SewingDlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupButtons->sizePolicy().hasHeightForWidth()));
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE"));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY"));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK"));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_SewingDlgLayout->addWidget(GroupButtons, 2, 0);
+ ConstructorsBox = new QGroupBox(tr("SMESH_SEWING"), this);
+ GroupConstructors = new QButtonGroup(this);
+ QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
+ ConstructorsBoxLayout->setSpacing(SPACING);
+ ConstructorsBoxLayout->setMargin(MARGIN);
+
+ RadioButton1 = new QRadioButton(ConstructorsBox);
+ RadioButton1->setIcon(image0);
+ RadioButton2 = new QRadioButton(ConstructorsBox);
+ RadioButton2->setIcon(image1);
+ RadioButton3 = new QRadioButton(ConstructorsBox);
+ RadioButton3->setIcon(image2);
+ RadioButton4 = new QRadioButton(ConstructorsBox);
+ RadioButton4->setIcon(image3);
+
+ ConstructorsBoxLayout->addWidget(RadioButton1);
+ ConstructorsBoxLayout->addWidget(RadioButton2);
+ ConstructorsBoxLayout->addWidget(RadioButton3);
+ ConstructorsBoxLayout->addWidget(RadioButton4);
+ GroupConstructors->addButton(RadioButton1, 0);
+ GroupConstructors->addButton(RadioButton2, 1);
+ GroupConstructors->addButton(RadioButton3, 2);
+ GroupConstructors->addButton(RadioButton4, 3);
/***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6);
- GroupArgumentsLayout->setMargin(11);
+ GroupArguments = new QGroupBox(this);
+ QVBoxLayout* GroupArgumentsLayout = new QVBoxLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
// First subgroup
- SubGroup1 = new QGroupBox(GroupArguments, "SubGroup1");
- SubGroup1->setColumnLayout(0, Qt::Vertical);
- SubGroup1->layout()->setSpacing(0);
- SubGroup1->layout()->setMargin(0);
- QGridLayout* SubGroup1Layout = new QGridLayout(SubGroup1->layout());
- SubGroup1Layout->setAlignment(Qt::AlignTop);
- SubGroup1Layout->setSpacing(6);
- SubGroup1Layout->setMargin(11);
+ SubGroup1 = new QGroupBox(GroupArguments);
+ QGridLayout* SubGroup1Layout = new QGridLayout(SubGroup1);
+ SubGroup1Layout->setSpacing(SPACING);
+ SubGroup1Layout->setMargin(MARGIN);
// Controls of the first subgroup
- TextLabel1 = new QLabel(SubGroup1, "TextLabel1");
- TextLabel1->setFixedWidth(104);
- SubGroup1Layout->addWidget(TextLabel1, 0, 0);
-
- SelectButton1 = new QPushButton(SubGroup1, "SelectButton1");
- SelectButton1->setPixmap(image4);
+ TextLabel1 = new QLabel(SubGroup1);
+ SelectButton1 = new QPushButton(SubGroup1);
+ SelectButton1->setIcon(image4);
+ LineEdit1 = new QLineEdit(SubGroup1);
+
+ TextLabel2 = new QLabel(SubGroup1);
+ SelectButton2 = new QPushButton(SubGroup1);
+ SelectButton2->setIcon(image4);
+ LineEdit2 = new QLineEdit(SubGroup1);
+
+ TextLabel3 = new QLabel(SubGroup1);
+ SelectButton3 = new QPushButton(SubGroup1);
+ SelectButton3->setIcon(image4);
+ LineEdit3 = new QLineEdit(SubGroup1);
+
+ SubGroup1Layout->addWidget(TextLabel1, 0, 0);
SubGroup1Layout->addWidget(SelectButton1, 0, 1);
-
- LineEdit1 = new QLineEdit(SubGroup1, "LineEdit1");
- SubGroup1Layout->addWidget(LineEdit1, 0, 2);
-
- TextLabel2 = new QLabel(SubGroup1, "TextLabel2");
- SubGroup1Layout->addWidget(TextLabel2, 1, 0);
-
- SelectButton2 = new QPushButton(SubGroup1, "SelectButton2");
- SelectButton2->setPixmap(image4);
+ SubGroup1Layout->addWidget(LineEdit1, 0, 2);
+ SubGroup1Layout->addWidget(TextLabel2, 1, 0);
SubGroup1Layout->addWidget(SelectButton2, 1, 1);
-
- LineEdit2 = new QLineEdit(SubGroup1, "LineEdit2");
- SubGroup1Layout->addWidget(LineEdit2, 1, 2);
-
- TextLabel3 = new QLabel(SubGroup1, "TextLabel3");
- SubGroup1Layout->addWidget(TextLabel3, 2, 0);
-
- SelectButton3 = new QPushButton(SubGroup1, "SelectButton3");
- SelectButton3->setPixmap(image4);
+ SubGroup1Layout->addWidget(LineEdit2, 1, 2);
+ SubGroup1Layout->addWidget(TextLabel3, 2, 0);
SubGroup1Layout->addWidget(SelectButton3, 2, 1);
-
- LineEdit3 = new QLineEdit(SubGroup1, "LineEdit3");
- SubGroup1Layout->addWidget(LineEdit3, 2, 2);
+ SubGroup1Layout->addWidget(LineEdit3, 2, 2);
// Second subgroup
- SubGroup2 = new QGroupBox(GroupArguments, "SubGroup2");
- SubGroup2->setColumnLayout(0, Qt::Vertical);
- SubGroup2->layout()->setSpacing(0);
- SubGroup2->layout()->setMargin(0);
- QGridLayout* SubGroup2Layout = new QGridLayout(SubGroup2->layout());
- SubGroup2Layout->setAlignment(Qt::AlignTop);
- SubGroup2Layout->setSpacing(6);
- SubGroup2Layout->setMargin(11);
+ SubGroup2 = new QGroupBox(GroupArguments);
+ QGridLayout* SubGroup2Layout = new QGridLayout(SubGroup2);
+ SubGroup2Layout->setSpacing(SPACING);
+ SubGroup2Layout->setMargin(MARGIN);
// Controls of the first subgroup
- TextLabel4 = new QLabel(SubGroup2, "TextLabel4");
- SubGroup2Layout->addWidget(TextLabel4, 0, 0);
-
- SelectButton4 = new QPushButton(SubGroup2, "SelectButton4");
- SelectButton4->setPixmap(image4);
+ TextLabel4 = new QLabel(SubGroup2);
+ SelectButton4 = new QPushButton(SubGroup2);
+ SelectButton4->setIcon(image4);
+ LineEdit4 = new QLineEdit(SubGroup2);
+
+ TextLabel5 = new QLabel(SubGroup2);
+ SelectButton5 = new QPushButton(SubGroup2);
+ SelectButton5->setIcon(image4);
+ LineEdit5 = new QLineEdit(SubGroup2);
+
+ TextLabel6 = new QLabel(SubGroup2);
+ SelectButton6 = new QPushButton(SubGroup2);
+ SelectButton6->setIcon(image4);
+ LineEdit6 = new QLineEdit(SubGroup2);
+
+ SubGroup2Layout->addWidget(TextLabel4, 0, 0);
SubGroup2Layout->addWidget(SelectButton4, 0, 1);
-
- LineEdit4 = new QLineEdit(SubGroup2, "LineEdit4");
- SubGroup2Layout->addWidget(LineEdit4, 0, 2);
-
- TextLabel5 = new QLabel(SubGroup2, "TextLabel5");
- SubGroup2Layout->addWidget(TextLabel5, 1, 0);
-
- SelectButton5 = new QPushButton(SubGroup2, "SelectButton5");
- SelectButton5->setPixmap(image4);
+ SubGroup2Layout->addWidget(LineEdit4, 0, 2);
+ SubGroup2Layout->addWidget(TextLabel5, 1, 0);
SubGroup2Layout->addWidget(SelectButton5, 1, 1);
-
- LineEdit5 = new QLineEdit(SubGroup2, "LineEdit5");
- SubGroup2Layout->addWidget(LineEdit5, 1, 2);
-
- TextLabel6 = new QLabel(SubGroup2, "TextLabel6");
- SubGroup2Layout->addWidget(TextLabel6, 2, 0);
-
- SelectButton6 = new QPushButton(SubGroup2, "SelectButton6");
- SelectButton6->setPixmap(image4);
+ SubGroup2Layout->addWidget(LineEdit5, 1, 2);
+ SubGroup2Layout->addWidget(TextLabel6, 2, 0);
SubGroup2Layout->addWidget(SelectButton6, 2, 1);
-
- LineEdit6 = new QLineEdit(SubGroup2, "LineEdit6");
- SubGroup2Layout->addWidget(LineEdit6, 2, 2);
-
- // Add subgroups to the group of arguments
- GroupArgumentsLayout->addWidget(SubGroup1, 0, 0);
- GroupArgumentsLayout->addWidget(SubGroup2, 1, 0);
+ SubGroup2Layout->addWidget(LineEdit6, 2, 2);
// Control for the merging equal elements
- CheckBoxMerge = new QCheckBox(GroupArguments, "CheckBoxMerge");
- CheckBoxMerge->setText(tr("MERGE_EQUAL_ELEMENTS" ));
- GroupArgumentsLayout->addWidget(CheckBoxMerge, 2, 0);
-
-// Control for the polygons creation instead of splitting
- CheckBoxPolygons = new QCheckBox( GroupArguments, "CheckBoxPolygons" );
- CheckBoxPolygons->setText( tr( "CREATE_POLYGONS_INSTEAD_SPLITTING" ) );
- GroupArgumentsLayout->addWidget( CheckBoxPolygons, 3, 0 );
+ CheckBoxMerge = new QCheckBox(tr("MERGE_EQUAL_ELEMENTS"), GroupArguments);
+
+ // Control for the polygons creation instead of splitting
+ CheckBoxPolygons = new QCheckBox(tr("CREATE_POLYGONS_INSTEAD_SPLITTING"), GroupArguments);
// Control for the polyedres creation to obtain conform mesh
- CheckBoxPolyedrs = new QCheckBox( GroupArguments, "CheckBoxPolyedrs" );
- CheckBoxPolyedrs->setText( tr( "CREATE_POLYEDRS_NEAR_BOUNDARY" ) );
- GroupArgumentsLayout->addWidget( CheckBoxPolyedrs, 4, 0 );
+ CheckBoxPolyedrs = new QCheckBox(tr("CREATE_POLYEDRS_NEAR_BOUNDARY"), GroupArguments);
+ // layout
+ GroupArgumentsLayout->addWidget(SubGroup1);
+ GroupArgumentsLayout->addWidget(SubGroup2);
+ GroupArgumentsLayout->addWidget(CheckBoxMerge);
+ GroupArgumentsLayout->addWidget(CheckBoxPolygons);
+ GroupArgumentsLayout->addWidget(CheckBoxPolyedrs);
+
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
- SMESHGUI_SewingDlgLayout->addWidget(GroupArguments, 1, 0);
+ /***************************************************************/
+ SMESHGUI_SewingDlgLayout->addWidget(ConstructorsBox);
+ SMESHGUI_SewingDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_SewingDlgLayout->addWidget(GroupButtons);
/* Initialisations */
- GroupArguments->show();
- RadioButton1->setChecked(TRUE);
+ RadioButton1->setChecked(true);
- LineEdit2->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
- LineEdit3->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
- LineEdit5->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
- LineEdit6->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
+ LineEdit2->setValidator(new SMESHGUI_IdValidator(this, 1));
+ LineEdit3->setValidator(new SMESHGUI_IdValidator(this, 1));
+ LineEdit5->setValidator(new SMESHGUI_IdValidator(this, 1));
+ LineEdit6->setValidator(new SMESHGUI_IdValidator(this, 1));
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
Init();
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectButton1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SelectButton2, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(LineEdit5, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(LineEdit6, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
- this->show(); /* displays Dialog */
-
ConstructorsClicked(0);
- resize(0,0);
}
//=================================================================================
//=================================================================================
SMESHGUI_SewingDlg::~SMESHGUI_SewingDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
if (!CheckBoxPolyedrs->isVisible())
CheckBoxPolyedrs->show();
-
break;
}
case 1:
if (!CheckBoxPolyedrs->isVisible())
CheckBoxPolyedrs->show();
-
myOk5 = true;
break;
TextLabel5->setText(tr("NODE1_TO_MERGE"));
TextLabel6->setText(tr("NODE2_TO_MERGE"));
- LineEdit1->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- LineEdit4->setValidator(new SMESHGUI_IdValidator(this, "validator"));
+ LineEdit1->setValidator(new SMESHGUI_IdValidator(this));
+ LineEdit4->setValidator(new SMESHGUI_IdValidator(this));
SMESH::SetPointRepresentation(false);
TextLabel5->setText(tr("SECOND_NODE_ID"));
TextLabel6->setText(tr("LAST_NODE_ID"));
- LineEdit1->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
- LineEdit4->setValidator(new SMESHGUI_IdValidator(this, "validator", 1));
+ LineEdit1->setValidator(new SMESHGUI_IdValidator(this, 1));
+ LineEdit4->setValidator(new SMESHGUI_IdValidator(this, 1));
SMESH::SetPointRepresentation(true);
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
mySelectionMgr->setSelectedObjects( io );
+
+ QApplication::instance()->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
}
//=================================================================================
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
int aConstructorId = GetConstructorId();
SMESH::SMESH_MeshEditor::Sew_Error anError;
toCreatePolygons,
toCreatePolyedrs);
else if (aConstructorId == 3) {
- QStringList aListElementsId1 = QStringList::split(" ", LineEdit1->text(), false);
- QStringList aListElementsId2 = QStringList::split(" ", LineEdit4->text(), false);
+ QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts);
+ QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId1 = new SMESH::long_array;
SMESH::long_array_var anElementsId2 = new SMESH::long_array;
QApplication::restoreOverrideCursor();
if (!aResult) {
- QString msg = tr(QString("ERROR_%1").arg(anError));
- SUIT_MessageBox::warn1(SMESHGUI::desktop(), tr("SMESH_WRN_WARNING"),
- msg, tr("SMESH_BUT_OK"));
+ QString msg = tr(QString("ERROR_%1").arg(anError).toLatin1().data());
+ SUIT_MessageBox::warning(this, tr("SMESH_WRN_WARNING"), msg);
}
} catch (...) {
}
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(CellSelection);
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
bool isEvenOneExists = false;
//=================================================================================
void SMESHGUI_SewingDlg::DeactivateActiveDialog()
{
- if (GroupConstructors->isEnabled()) {
- GroupConstructors->setEnabled(false);
+ if (ConstructorsBox->isEnabled()) {
+ ConstructorsBox->setEnabled(false);
GroupArguments->setEnabled(false);
GroupButtons->setEnabled(false);
mySMESHGUI->ResetState();
{
/* Emit a signal to deactivate the active dialog */
mySMESHGUI->EmitSignalDeactivateDialog();
- GroupConstructors->setEnabled(true);
+ ConstructorsBox->setEnabled(true);
GroupArguments->setEnabled(true);
GroupButtons->setEnabled(true);
//=================================================================================
void SMESHGUI_SewingDlg::enterEvent (QEvent* e)
{
- if (!GroupConstructors->isEnabled())
+ if (!ConstructorsBox->isEnabled())
ActivateThisDialog();
}
void SMESHGUI_SewingDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
//=================================================================================
int SMESHGUI_SewingDlg::GetConstructorId()
{
- if (GroupConstructors != NULL && GroupConstructors->selected() != NULL)
- return GroupConstructors->id(GroupConstructors->selected());
- return -1;
+ return GroupConstructors->checkedId();
}
//=================================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_SewingDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_SewingDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_SEWING_H
-#define DIALOGBOX_SEWING_H
+#ifndef SMESHGUI_SEWINGDLG_H
+#define SMESHGUI_SEWINGDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
+// Qt includes
+#include <QDialog>
-// QT Includes
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
class QButtonGroup;
class QGroupBox;
class QLabel;
class QCheckBox;
class SMESHGUI;
class SMESH_Actor;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
+class LightApp_SelectionMgr;
//=================================================================================
// class : SMESHGUI_SewingDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_SewingDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_SewingDlg( SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_SewingDlg();
+ SMESHGUI_SewingDlg( SMESHGUI* );
+ ~SMESHGUI_SewingDlg();
private:
- void Init() ;
- void closeEvent( QCloseEvent* e ) ;
- void enterEvent ( QEvent * ); /* mouse enter the QWidget */
- void hideEvent ( QHideEvent * ); /* ESC key */
- void keyPressEvent(QKeyEvent*);
- int GetConstructorId();
- bool IsValid();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- int myOk1, myOk2, myOk3, myOk4, myOk5, myOk6;
- QLineEdit* myEditCurrentArgument; /* Current LineEdit */
- SVTK_Selector* mySelector;
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton1;
- QRadioButton* RadioButton2;
- QRadioButton* RadioButton3;
- QRadioButton* RadioButton4;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupArguments;
- QGroupBox* SubGroup1;
- QGroupBox* SubGroup2;
- QLabel* TextLabel1;
- QLabel* TextLabel2;
- QLabel* TextLabel3;
- QLabel* TextLabel4;
- QLabel* TextLabel5;
- QLabel* TextLabel6;
- QPushButton* SelectButton1;
- QPushButton* SelectButton2;
- QPushButton* SelectButton3;
- QPushButton* SelectButton4;
- QPushButton* SelectButton5;
- QPushButton* SelectButton6;
- QLineEdit* LineEdit1;
- QLineEdit* LineEdit2;
- QLineEdit* LineEdit3;
- QLineEdit* LineEdit4;
- QLineEdit* LineEdit5;
- QLineEdit* LineEdit6;
- QCheckBox* CheckBoxMerge;
- QCheckBox* CheckBoxPolygons;
- QCheckBox* CheckBoxPolyedrs;
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ int GetConstructorId();
+ bool IsValid();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ int myOk1, myOk2, myOk3, myOk4, myOk5, myOk6;
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+ SVTK_Selector* mySelector;
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+
+ QGroupBox* ConstructorsBox;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QRadioButton* RadioButton3;
+ QRadioButton* RadioButton4;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupArguments;
+ QGroupBox* SubGroup1;
+ QGroupBox* SubGroup2;
+ QLabel* TextLabel1;
+ QLabel* TextLabel2;
+ QLabel* TextLabel3;
+ QLabel* TextLabel4;
+ QLabel* TextLabel5;
+ QLabel* TextLabel6;
+ QPushButton* SelectButton1;
+ QPushButton* SelectButton2;
+ QPushButton* SelectButton3;
+ QPushButton* SelectButton4;
+ QPushButton* SelectButton5;
+ QPushButton* SelectButton6;
+ QLineEdit* LineEdit1;
+ QLineEdit* LineEdit2;
+ QLineEdit* LineEdit3;
+ QLineEdit* LineEdit4;
+ QLineEdit* LineEdit5;
+ QLineEdit* LineEdit6;
+ QCheckBox* CheckBoxMerge;
+ QCheckBox* CheckBoxPolygons;
+ QCheckBox* CheckBoxPolyedrs;
- QString myHelpFileName;
+ QString myHelpFileName;
private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- bool ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument(bool isSelectionChanged = true) ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void onTextChange(const QString&);
-
-protected:
- QGridLayout* SMESHGUI_SewingDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupArgumentsLayout;
+ void ConstructorsClicked( int );
+ void ClickOnOk();
+ void ClickOnCancel();
+ bool ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument( bool = true );
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
};
-#endif // DIALOGBOX_SEWING_H
+#endif // SMESHGUI_SEWINGDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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 : SMESHGUI_ShapeByMeshDlg.cxx
+// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_ShapeByMeshDlg.cxx
-// Author : Edward AGAPOV
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_ShapeByMeshDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
-#include "SMDS_Mesh.hxx"
-#include "SMDS_MeshNode.hxx"
-#include "SMESH_Actor.h"
+#include <SMDS_Mesh.hxx>
+#include <SMDS_MeshNode.hxx>
+#include <SMESH_Actor.h>
+
+// SALOME GEOM includes
+#include <GEOMBase.h>
+#include <GeometryGUI.h>
-#include "GEOMBase.h"
-#include "GeometryGUI.h"
+// SALOME GUI includes
+#include <LightApp_DataOwner.h>
+#include <LightApp_SelectionMgr.h>
+#include <SALOME_ListIO.hxx>
+#include <SUIT_Desktop.h>
+#include <SVTK_Selector.h>
+#include <SVTK_ViewWindow.h>
+#include <SVTK_ViewModel.h>
+#include <SalomeApp_Tools.h>
-#include "LightApp_DataOwner.h"
-#include "LightApp_SelectionMgr.h"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOME_ListIO.hxx"
-#include "SUIT_Desktop.h"
-#include "SVTK_Selector.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_ViewModel.h"
-#include "SalomeApp_Tools.h"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_SObject.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
#include <TopoDS_Shape.hxx>
#include <TopExp_Explorer.hxx>
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qapplication.h>
-#include <qstringlist.h>
-
-#define SPACING 5
-#define MARGIN 10
-
+// Qt includes
+#include <QFrame>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QLineEdit>
+#include <QLabel>
+#include <QRadioButton>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QStringList>
+
+#define SPACING 6
+#define MARGIN 11
enum { EDGE = 0, FACE, VOLUME };
SMESHGUI_ShapeByMeshDlg::SMESHGUI_ShapeByMeshDlg()
: SMESHGUI_Dialog( 0, false, true, OK | Close )
{
- setCaption(tr("CAPTION"));
+ setWindowTitle(tr("CAPTION"));
- QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame(), MARGIN, SPACING);
+ QVBoxLayout* aDlgLay = new QVBoxLayout (mainFrame());
+ aDlgLay->setMargin(MARGIN);
+ aDlgLay->setSpacing(SPACING);
QFrame* aMainFrame = createMainFrame (mainFrame());
//=======================================================================
QFrame* SMESHGUI_ShapeByMeshDlg::createMainFrame (QWidget* theParent)
{
- QFrame* aMainGrp = new QFrame(theParent, "main frame");
- QGridLayout* aLayout = new QGridLayout(aMainGrp, 3, 2);
- aLayout->setSpacing(6);
- aLayout->setAutoAdd(false);
+ QFrame* aMainGrp = new QFrame(theParent);
+ QGridLayout* aLayout = new QGridLayout(aMainGrp);
+ aLayout->setMargin(0);
+ aLayout->setSpacing(SPACING);
// elem type
- myElemTypeGroup = new QButtonGroup(1, Qt::Vertical, aMainGrp, "Group types");
- myElemTypeGroup->setTitle(tr("SMESH_ELEMENT_TYPE"));
- myElemTypeGroup->setExclusive(true);
-
- (new QRadioButton( tr("SMESH_EDGE") , myElemTypeGroup))->setChecked(true);
- new QRadioButton( tr("SMESH_FACE") , myElemTypeGroup);
- new QRadioButton( tr("SMESH_VOLUME"), myElemTypeGroup);
-
+ myElemTypeBox = new QGroupBox(tr("SMESH_ELEMENT_TYPE"), aMainGrp);
+ myElemTypeGroup = new QButtonGroup(aMainGrp);
+ QHBoxLayout* myElemTypeBoxLayout = new QHBoxLayout(myElemTypeBox);
+ myElemTypeBoxLayout->setMargin(MARGIN);
+ myElemTypeBoxLayout->setSpacing(SPACING);
+
+ QRadioButton* aEdgeRb = new QRadioButton( tr("SMESH_EDGE"), myElemTypeBox);
+ QRadioButton* aFaceRb = new QRadioButton( tr("SMESH_FACE"), myElemTypeBox);
+ QRadioButton* aVolumeRb = new QRadioButton( tr("SMESH_VOLUME"), myElemTypeBox);
+
+ myElemTypeBoxLayout->addWidget(aEdgeRb);
+ myElemTypeBoxLayout->addWidget(aFaceRb);
+ myElemTypeBoxLayout->addWidget(aVolumeRb);
+ myElemTypeGroup->addButton(aEdgeRb, 0);
+ myElemTypeGroup->addButton(aFaceRb, 1);
+ myElemTypeGroup->addButton(aVolumeRb, 2);
+ aEdgeRb->setChecked(true);
+
// element id
- QLabel* anIdLabel = new QLabel( aMainGrp, "element id label");
- anIdLabel->setText( tr("ELEMENT_ID") );
- myElementId = new QLineEdit( aMainGrp, "element id");
- if (!myIsMultipleAllowed)
- myElementId->setValidator( new SMESHGUI_IdValidator( theParent, "id validator", 1 ));
- else
- myElementId->setValidator( new SMESHGUI_IdValidator( theParent, "id validator" ));
+ QLabel* anIdLabel = new QLabel( tr("ELEMENT_ID"), aMainGrp );
+ myElementId = new QLineEdit( aMainGrp );
+ myElementId->setValidator( new SMESHGUI_IdValidator( theParent,
+ !myIsMultipleAllowed ? 1 : 0 ) ); // 0 for any number of entities
// shape name
- QLabel* aNameLabel = new QLabel( aMainGrp, "geom name label");
- aNameLabel->setText( tr("GEOMETRY_NAME") );
- myGeomName = new QLineEdit( aMainGrp, "geom name");
+ QLabel* aNameLabel = new QLabel( tr("GEOMETRY_NAME"), aMainGrp );
+ myGeomName = new QLineEdit( aMainGrp );
- aLayout->addMultiCellWidget(myElemTypeGroup, 0, 0, 0, 1);
+ aLayout->addWidget(myElemTypeBox, 0, 0, 1, 2);
aLayout->addWidget(anIdLabel, 1, 0);
aLayout->addWidget(myElementId, 1, 1);
aLayout->addWidget(aNameLabel, 2, 0);
//=======================================================================
SMESHGUI_ShapeByMeshDlg::~SMESHGUI_ShapeByMeshDlg()
{
- // no need to delete child widgets, Qt does it all for us
+}
+
+void SMESHGUI_ShapeByMeshDlg:: setMultipleAllowed( bool isAllowed )
+{
+ myIsMultipleAllowed = isAllowed;
}
//================================================================================
/*!
* \brief Constructor
-*/
+ */
//================================================================================
SMESHGUI_ShapeByMeshOp::SMESHGUI_ShapeByMeshOp(bool isMultipleAllowed):
myIsMultipleAllowed(isMultipleAllowed)
myDlg = new SMESHGUI_ShapeByMeshDlg;
myDlg->setMultipleAllowed(myIsMultipleAllowed);
- connect(myDlg->myElemTypeGroup, SIGNAL(clicked(int)), SLOT(onTypeChanged(int)));
+ connect(myDlg->myElemTypeGroup, SIGNAL(buttonClicked(int)), SLOT(onTypeChanged(int)));
connect(myDlg->myElementId, SIGNAL(textChanged(const QString&)), SLOT(onElemIdChanged(const QString&)));
}
//================================================================================
/*!
* \brief Destructor
-*/
+ */
//================================================================================
SMESHGUI_ShapeByMeshOp::~SMESHGUI_ShapeByMeshOp()
{
//================================================================================
/*!
* \brief Gets dialog of this operation
- * \retval LightApp_Dialog* - pointer to dialog of this operation
-*/
+ * \retval LightApp_Dialog* - pointer to dialog of this operation
+ */
//================================================================================
LightApp_Dialog* SMESHGUI_ShapeByMeshOp::dlg() const
{
return myDlg;
}
+SMESH::SMESH_Mesh_ptr SMESHGUI_ShapeByMeshOp::GetMesh()
+{
+ return myMesh;
+}
+
//=======================================================================
// function : GetShape()
// purpose : Get published sub-shape
myGeomObj = GEOM::GEOM_Object::_nil();
myHasSolids = false;
- vector< bool > hasElement (myDlg->myElemTypeGroup->count(), false);
+ vector< bool > hasElement (myDlg->myElemTypeGroup->buttons().count(), false);
if (!myMesh->_is_nil() )
- {
-// _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in());
-// SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str()));
-
- vector< int > nbShapes( TopAbs_SHAPE, 0 );
- int shapeDim = 0; // max dim with several shapes
- //if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape
{
- _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
- GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
- if ( !mainShape->_is_nil() )
+ // _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in());
+ // SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str()));
+
+ vector< int > nbShapes( TopAbs_SHAPE, 0 );
+ int shapeDim = 0; // max dim with several shapes
+ //if ( /*mySelectionMgr*/ selectionMgr()->isOk(anIObj) ) // check that the mesh has a valid shape
{
- TopoDS_Shape aShape;
- if ( GEOMBase::GetShape(mainShape, aShape))
- {
- TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
- for ( int dim = 4; dim > 0; --dim ) {
- TopAbs_ShapeEnum type = types[ dim - 1 ];
- TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
- TopExp_Explorer exp( aShape, type, avoid );
- for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
- ++nbShapes[ type ];
- if ( nbShapes[ type ] > 1 ) {
- shapeDim = dim;
- break;
- }
- }
- }
+ _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in());
+ GEOM::GEOM_Object_var mainShape = SMESH::GetGeom(aSO);
+ if ( !mainShape->_is_nil() )
+ {
+ TopoDS_Shape aShape;
+ if ( GEOMBase::GetShape(mainShape, aShape))
+ {
+ TopAbs_ShapeEnum types[4] = { TopAbs_EDGE, TopAbs_FACE, TopAbs_SHELL, TopAbs_SOLID };
+ for ( int dim = 4; dim > 0; --dim ) {
+ TopAbs_ShapeEnum type = types[ dim - 1 ];
+ TopAbs_ShapeEnum avoid = ( type == TopAbs_SHELL ) ? TopAbs_SOLID : TopAbs_SHAPE;
+ TopExp_Explorer exp( aShape, type, avoid );
+ for ( ; nbShapes[ type ] < 2 && exp.More(); exp.Next() )
+ ++nbShapes[ type ];
+ if ( nbShapes[ type ] > 1 ) {
+ shapeDim = dim;
+ break;
+ }
+ }
+ }
+ }
}
+ if (shapeDim > 0)
+ {
+ if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
+ shapeDim = 3;
+ hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges();
+ hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces();
+ hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
+ }
+ myHasSolids = nbShapes[ TopAbs_SOLID ];
}
- if (shapeDim > 0)
- {
- if ( nbShapes[ TopAbs_SHELL ] + nbShapes[ TopAbs_SOLID ] > 1 )
- shapeDim = 3;
- hasElement[ EDGE ] = shapeDim > 0 && myMesh->NbEdges() ;
- hasElement[ FACE ] = shapeDim > 1 && myMesh->NbFaces() ;
- hasElement[ VOLUME ] = shapeDim > 2 && myMesh->NbVolumes();
- }
- myHasSolids = nbShapes[ TopAbs_SOLID ];
- }
// disable inexistant elem types
- for ( int i = 0; i < myDlg->myElemTypeGroup->count(); ++i ) {
- if ( QButton* button = myDlg->myElemTypeGroup->find( i ) )
+ for ( int i = 0; i < myDlg->myElemTypeGroup->buttons().count(); ++i ) {
+ if ( QAbstractButton* button = myDlg->myElemTypeGroup->button( i ) )
button->setEnabled( hasElement[ i ] );
}
myDlg->myElementId->setEnabled( hasElement[ EDGE ] );
{
SMESHGUI_SelectionOp::commitOperation();
try {
- QStringList aListId = QStringList::split( " ", myDlg->myElementId->text(), false);
+ QStringList aListId = myDlg->myElementId->text().split( " ", QString::SkipEmptyParts);
if (aListId.count() == 1)
{
int elemID = (aListId.first()).toInt();
myGeomObj = SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement
- ( myMesh.in(), elemID, myDlg->myGeomName->text().latin1());
+ ( myMesh.in(), elemID, myDlg->myGeomName->text().toLatin1().data());
}
else
{
}
// publish the GEOM object in study
- QString aNewGeomGroupName ( myDlg->myGeomName->text().latin1() );
+ QString aNewGeomGroupName ( myDlg->myGeomName->text() );
SALOMEDS::SObject_var aNewGroupSO =
- geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj, aNewGeomGroupName, aMeshShape);
+ geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj,
+ aNewGeomGroupName.toLatin1().data(), aMeshShape);
}
}
catch (const SALOME::SALOME_Exception& S_ex) {
}
+bool SMESHGUI_ShapeByMeshOp::onApply()
+{
+ return true;
+}
+
//=======================================================================
// function : onSelectionDone()
// purpose : SLOT called when selection changed. Enable/desable [ OK ]
QString geomName;
Selection_Mode mode = EdgeSelection;
- switch ( myDlg->myElemTypeGroup->id( myDlg->myElemTypeGroup->selected() )) {
+ switch ( myDlg->myElemTypeGroup->checkedId() ) {
case EDGE :
mode = EdgeSelection; geomName = tr("GEOM_EDGE"); break;
case FACE :
myDlg->setButtonEnabled( false, QtxDialog::OK );
if ( myIsManualIdEnter && !myMesh->_is_nil() )
+ {
if ( SMESH_Actor* actor = SMESH::FindActorByObject(myMesh) )
+ {
if ( SMDS_Mesh* aMesh = actor->GetObject()->GetMesh() )
{
- SMDSAbs_ElementType type = SMDSAbs_Edge;
- switch ( myDlg->myElemTypeGroup->id( myDlg->myElemTypeGroup->selected() )) {
- case EDGE : type = SMDSAbs_Edge; break;
- case FACE : type = SMDSAbs_Face; break;
- case VOLUME: type = SMDSAbs_Volume; break;
- default: return;
- }
- TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split( " ", theNewText, false);
- for ( int i = 0; i < aListId.count(); i++ ) {
- if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
- if ( e->GetType() == type )
- newIndices.Add( e->GetID() );
- }
-
+ SMDSAbs_ElementType type = SMDSAbs_Edge;
+ switch ( myDlg->myElemTypeGroup->checkedId() ) {
+ case EDGE : type = SMDSAbs_Edge; break;
+ case FACE : type = SMDSAbs_Face; break;
+ case VOLUME: type = SMDSAbs_Volume; break;
+ default: return;
+ }
+ TColStd_MapOfInteger newIndices;
+ QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts);
+ for ( int i = 0; i < aListId.count(); i++ ) {
+ if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() ))
+ if ( e->GetType() == type )
+ newIndices.Add( e->GetID() );
+ }
+
if ( !newIndices.IsEmpty() )
- {
- if (!myIsMultipleAllowed && newIndices.Extent() != 1)
- return;
- if ( SVTK_Selector* s = selector() ) {
- s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
- viewWindow()->highlight( actor->getIO(), true, true );
- myDlg->setButtonEnabled( true, QtxDialog::OK );
- }
+ {
+ if (!myIsMultipleAllowed && newIndices.Extent() != 1)
+ return;
+ if ( SVTK_Selector* s = selector() ) {
+ s->AddOrRemoveIndex( actor->getIO(), newIndices, false );
+ viewWindow()->highlight( actor->getIO(), true, true );
+ myDlg->setButtonEnabled( true, QtxDialog::OK );
}
+ }
}
+ }
+ }
}
//=======================================================================
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_ShapeByMeshDlg.h
+// Author : Edward AGAPOV, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_ShapeByMeshDlg.h
-// Author : Edward AGAPOV
-// Module : SMESH
-
-#ifndef SMESHGUI_ShapeByMeshDlg_H
-#define SMESHGUI_ShapeByMeshDlg_H
+#ifndef SMESHGUI_SHAPEBYMESHDLG_H
+#define SMESHGUI_SHAPEBYMESHDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
#include "SMESHGUI_Dialog.h"
#include "SMESHGUI_SelectionOp.h"
-// IDL Headers
+// IDL includes
#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(GEOM_Gen)
#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QCloseEvent;
class QFrame;
class QLineEdit;
-class QPushButton;
-class LightApp_SelectionMgr;
-class SVTK_ViewWindow;
class QButtonGroup;
-class SMESHGUI;
+class QGroupBox;
/*!
* \brief Dialog to publish a sub-shape of the mesh main shape
Q_OBJECT
public:
- SMESHGUI_ShapeByMeshDlg();
- virtual ~SMESHGUI_ShapeByMeshDlg();
+ SMESHGUI_ShapeByMeshDlg();
+ virtual ~SMESHGUI_ShapeByMeshDlg();
private:
+ QFrame* createMainFrame( QWidget* );
- QFrame* createMainFrame (QWidget*);
-
+ QGroupBox* myElemTypeBox;
QButtonGroup* myElemTypeGroup;
QLineEdit* myElementId;
QLineEdit* myGeomName;
bool myIsMultipleAllowed;
- void setMultipleAllowed(bool isAllowed) {myIsMultipleAllowed = isAllowed;};
+ void setMultipleAllowed( bool );
friend class SMESHGUI_ShapeByMeshOp;
};
Q_OBJECT
public:
- SMESHGUI_ShapeByMeshOp(bool isMultipleAllowed = false);
+ SMESHGUI_ShapeByMeshOp( bool = false );
virtual ~SMESHGUI_ShapeByMeshOp();
- virtual LightApp_Dialog* dlg() const;
+ virtual LightApp_Dialog* dlg() const;
void Init();
- void SetMesh (SMESH::SMESH_Mesh_ptr);
- SMESH::SMESH_Mesh_ptr GetMesh () { return myMesh; }
+ void SetMesh( SMESH::SMESH_Mesh_ptr );
+ SMESH::SMESH_Mesh_ptr GetMesh();
GEOM::GEOM_Object_ptr GetShape();
protected:
-
- virtual void commitOperation();
- virtual void startOperation();
+ virtual void commitOperation();
+ virtual void startOperation();
void activateSelection();
- void setElementID(const QString&);
+ void setElementID( const QString& );
protected slots:
-
- virtual bool onApply() { return true; }
+ virtual bool onApply();
private slots:
-
void onSelectionDone();
- void onTypeChanged (int);
- void onElemIdChanged (const QString&);
+ void onTypeChanged( int );
+ void onElemIdChanged( const QString& );
private:
-
SMESHGUI_ShapeByMeshDlg* myDlg;
SMESH::SMESH_Mesh_var myMesh;
GEOM::GEOM_Object_var myGeomObj;
-// SMESH SMESHGUI : GUI for SMESH component
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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 : SMESHGUI_SingleEditDlg.cxx
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_SingleEditDlg.cxx
-// Author : Sergey LITONIN
-// Module : SMESH
+// SMESH includes
#include "SMESHGUI_SingleEditDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
-#include "SMESHGUI_SpinBox.h"
-#include "SMESH_Actor.h"
-#include "SMDS_Mesh.hxx"
+#include <SMESH_Actor.h>
+#include <SMDS_Mesh.hxx>
-#include "LightApp_SelectionMgr.h"
-#include "LightApp_Application.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
+// SALOME GUI includes
+#include <LightApp_SelectionMgr.h>
+#include <LightApp_Application.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
-#include "SVTK_Selector.h"
-#include "SVTK_ViewWindow.h"
-#include "SALOME_ListIO.hxx"
+#include <SVTK_Selector.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-#include "utilities.h"
-
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
-// QT Includes
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qmessagebox.h>
-#include <qvalidator.h>
-
-
-#define SPACING 5
-#define MARGIN 10
+// Qt includes
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QGroupBox>
+#include <QLabel>
+#include <QValidator>
+#include <QKeyEvent>
+#define SPACING 6
+#define MARGIN 11
/*!
* Class : SMESHGUI_DiagValidator
*/
class SMESHGUI_DiagValidator: public QValidator
{
- public:
- SMESHGUI_DiagValidator (QWidget * parent, const char * name = 0):
- QValidator(parent,name) {}
+public:
+ SMESHGUI_DiagValidator (QWidget* parent):
+ QValidator(parent) {}
- State validate (QString & text, int & pos) const
+ State validate (QString& text, int& pos) const
{
- text.stripWhiteSpace();
+ text = text.trimmed();
text.replace(QRegExp("[^0-9]+"), "-");
if (text == "-")
text = "";
- int ind = text.find(QRegExp("-[0-9]+-"));
+ int ind = text.indexOf(QRegExp("-[0-9]+-"));
if (ind > 0) { // leave only two ids
- ind = text.find('-', ind + 1);
+ ind = text.indexOf('-', ind + 1);
if (ind > 0)
text.truncate(ind);
}
// Purpose : Constructor
//=======================================================================
SMESHGUI_SingleEditDlg
-::SMESHGUI_SingleEditDlg(SMESHGUI* theModule,
- const char* theName):
- QDialog(SMESH::GetDesktop(theModule),
- theName,
- false,
- WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+::SMESHGUI_SingleEditDlg(SMESHGUI* theModule)
+ : QDialog(SMESH::GetDesktop(theModule)),
mySelector(SMESH::GetViewWindow(theModule)->GetSelector()),
mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
mySMESHGUI(theModule)
{
- QVBoxLayout* aDlgLay = new QVBoxLayout(this, MARGIN, SPACING);
+ setModal(false);
+
+ QVBoxLayout* aDlgLay = new QVBoxLayout(this);
+ aDlgLay->setMargin(MARGIN);
+ aDlgLay->setSpacing(SPACING);
- QFrame* aMainFrame = createMainFrame (this);
- QFrame* aBtnFrame = createButtonFrame(this);
+ QWidget* aMainFrame = createMainFrame (this);
+ QWidget* aBtnFrame = createButtonFrame(this);
aDlgLay->addWidget(aMainFrame);
aDlgLay->addWidget(aBtnFrame);
- aDlgLay->setStretchFactor(aMainFrame, 1);
-
Init();
}
// name : createMainFrame()
// Purpose : Create frame containing dialog's input fields
//=======================================================================
-QFrame* SMESHGUI_SingleEditDlg::createMainFrame (QWidget* theParent)
+QWidget* SMESHGUI_SingleEditDlg::createMainFrame (QWidget* theParent)
{
- QGroupBox* aMainGrp = new QGroupBox(1, Qt::Vertical, tr("EDGE_BETWEEN"), theParent);
+ QGroupBox* aMainGrp = new QGroupBox(tr("EDGE_BETWEEN"), theParent);
+ QHBoxLayout* aLay = new QHBoxLayout(aMainGrp);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
QPixmap aPix (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- new QLabel(tr("SMESH_EDGE"), aMainGrp);
- (new QPushButton(aMainGrp))->setPixmap(aPix);
+ QLabel* aLab = new QLabel(tr("SMESH_EDGE"), aMainGrp);
+ QPushButton* aBtn = new QPushButton(aMainGrp);
+ aBtn->setIcon(aPix);
myEdge = new QLineEdit(aMainGrp);
- myEdge->setValidator(new SMESHGUI_DiagValidator(this, "validator"));
+ myEdge->setValidator(new SMESHGUI_DiagValidator(this));
+
+ aLay->addWidget(aLab);
+ aLay->addWidget(aBtn);
+ aLay->addWidget(myEdge);
return aMainGrp;
}
// name : createButtonFrame()
// Purpose : Create frame containing buttons
//=======================================================================
-QFrame* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent)
+QWidget* SMESHGUI_SingleEditDlg::createButtonFrame (QWidget* theParent)
{
- QFrame* aFrame = new QFrame(theParent);
- aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken);
+ QGroupBox* aFrame = new QGroupBox(theParent);
myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame);
myApplyBtn = new QPushButton(tr("SMESH_BUT_APPLY"), aFrame);
myCloseBtn = new QPushButton(tr("SMESH_BUT_CLOSE"), aFrame);
- myHelpBtn = new QPushButton (tr("SMESH_BUT_HELP"), aFrame);
-
- QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame);
- QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING);
+ QHBoxLayout* aLay = new QHBoxLayout(aFrame);
+ aLay->setMargin(MARGIN);
+ aLay->setSpacing(SPACING);
aLay->addWidget(myOkBtn);
+ aLay->addSpacing(10);
aLay->addWidget(myApplyBtn);
- aLay->addItem(aSpacer);
+ aLay->addSpacing(10);
+ aLay->addStretch();
aLay->addWidget(myCloseBtn);
aLay->addWidget(myHelpBtn);
myApplyBtn->setEnabled(false);
setEnabled(true);
- this->show();
-
// set selection mode
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(EdgeOfCellSelection);
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
mySelector->GetIndex(anIO,selectedIndices);
myBusy = false;
- QStringList aListId = QStringList::split("-", theNewText, false);
+ QStringList aListId = theNewText.split("-", QString::SkipEmptyParts);
if (aListId.count() != 2)
return;
SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(aList.First());
if (aMesh->_is_nil()) {
- SUIT_MessageBox::info1(SMESH::GetDesktop(mySMESHGUI),
- tr("SMESH_ERROR"),
- tr("SMESHG_NO_MESH"),
- tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::information(SMESH::GetDesktop(mySMESHGUI),
+ tr("SMESH_ERROR"),
+ tr("SMESHG_NO_MESH"));
return false;
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
/*!
*/
SMESHGUI_TrianglesInversionDlg
-::SMESHGUI_TrianglesInversionDlg(SMESHGUI* theModule,
- const char* theName)
-: SMESHGUI_SingleEditDlg(theModule,theName)
+::SMESHGUI_TrianglesInversionDlg(SMESHGUI* theModule)
+: SMESHGUI_SingleEditDlg(theModule)
{
- setCaption(tr("CAPTION"));
+ setWindowTitle(tr("CAPTION"));
myHelpFileName = "diagonal_inversion_of_elements_page.html";
}
*/
SMESHGUI_UnionOfTwoTrianglesDlg
-::SMESHGUI_UnionOfTwoTrianglesDlg(SMESHGUI* theModule,
- const char* theName)
-: SMESHGUI_SingleEditDlg(theModule,theName)
+::SMESHGUI_UnionOfTwoTrianglesDlg(SMESHGUI* theModule)
+: SMESHGUI_SingleEditDlg(theModule)
{
- setCaption(tr("CAPTION"));
+ setWindowTitle(tr("CAPTION"));
myHelpFileName = "uniting_two_triangles_page.html";
}
-// 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
+// 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 : SMESHGUI_SingleEditDlg.h
+// Author : Sergey LITONIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_SingleEditDlg.h
-// Author : Sergey LITONIN
-// Module : SMESH
-
-#ifndef SMESHGUI_SingleEditDlg_H
-#define SMESHGUI_SingleEditDlg_H
+#ifndef SMESHGUI_SINGLEEDITDLG_H
+#define SMESHGUI_SINGLEEDITDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
+// IDL includes
#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-class QCloseEvent;
-class QFrame;
class QLineEdit;
-class SMESHGUI_SpinBox;
class QPushButton;
class SMESHGUI;
class SMESH_Actor;
class SVTK_Selector;
-class SVTK_ViewWindow;
class LightApp_SelectionMgr;
/*!
Q_OBJECT
public:
- SMESHGUI_SingleEditDlg(SMESHGUI* theModule,
- const char* theName = 0);
+ SMESHGUI_SingleEditDlg( SMESHGUI* );
virtual ~SMESHGUI_SingleEditDlg();
- void Init();
+ void Init();
protected slots:
void onOk();
void onDeactivate();
void onSelectionDone();
- void onTextChange (const QString&);
+ void onTextChange( const QString& );
protected:
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*);
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
- QFrame* createButtonFrame (QWidget*);
- QFrame* createMainFrame (QWidget*);
- bool isValid (const bool) const;
- bool getNodeIds (const QString&, int&, int&) const;
- virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int) = 0;
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* );
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ QWidget* createButtonFrame( QWidget* );
+ QWidget* createMainFrame( QWidget* );
+ bool isValid( const bool ) const;
+ bool getNodeIds( const QString&, int&, int& ) const;
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr, const int, const int ) = 0;
protected:
bool myBusy;
Q_OBJECT
public:
- SMESHGUI_TrianglesInversionDlg(SMESHGUI* theModule,
- const char* theName = 0);
+ SMESHGUI_TrianglesInversionDlg( SMESHGUI* );
virtual ~SMESHGUI_TrianglesInversionDlg();
protected:
- virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int);
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr, const int, const int );
};
/*!
Q_OBJECT
public:
- SMESHGUI_UnionOfTwoTrianglesDlg(SMESHGUI* theModule,
- const char* theName = 0);
+ SMESHGUI_UnionOfTwoTrianglesDlg( SMESHGUI* );
virtual ~SMESHGUI_UnionOfTwoTrianglesDlg();
protected:
- virtual bool process (SMESH::SMESH_MeshEditor_ptr, const int, const int);
+ virtual bool process( SMESH::SMESH_MeshEditor_ptr, const int, const int );
};
-#endif
+#endif // SMESHGUI_SINGLEEDITDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_SmoothingDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_SmoothingDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_SmoothingDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_NumberFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-
-#include "SMDS_Mesh.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+#include <SMDS_Mesh.hxx>
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_Selector.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SVTK_ViewModel.h>
+#include <SVTK_Selector.h>
+#include <SVTK_ViewWindow.h>
+#include <SVTK_Selection.h>
+#include <SALOME_ListIO.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qpixmap.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+
+// Qt includes
+#include <QApplication>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QComboBox>
+#include <QCheckBox>
+#include <QSpinBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// function : SMESHGUI_SmoothingDlg()
// purpose : constructor
//=================================================================================
-SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_SmoothingDlg::SMESHGUI_SmoothingDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_DLG_SMOOTHING")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_SmoothingDlg");
- resize(303, 185);
- setCaption(tr("SMESH_SMOOTHING"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_SmoothingDlgLayout = new QGridLayout(this);
- SMESHGUI_SmoothingDlgLayout->setSpacing(6);
- SMESHGUI_SmoothingDlgLayout->setMargin(11);
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("SMESH_SMOOTHING"));
+ setSizeGripEnabled(true);
/***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setTitle(tr("SMESH_SMOOTHING" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- Constructor1 = new QRadioButton(GroupConstructors, "Constructor1");
- Constructor1->setText(tr("" ));
- Constructor1->setPixmap(image0);
- Constructor1->setChecked(TRUE);
- Constructor1->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)1,
- (QSizePolicy::SizeType)0,
- Constructor1->sizePolicy().hasHeightForWidth()));
- Constructor1->setMinimumSize(QSize(50, 0));
- GroupConstructorsLayout->addWidget(Constructor1, 0, 0);
- QSpacerItem* spacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupConstructorsLayout->addItem(spacer, 0, 1);
- SMESHGUI_SmoothingDlgLayout->addWidget(GroupConstructors, 0, 0);
+ QVBoxLayout* SMESHGUI_SmoothingDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_SmoothingDlgLayout->setSpacing(SPACING);
+ SMESHGUI_SmoothingDlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr(""));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_SmoothingDlgLayout->addWidget(GroupButtons, 2, 0);
+ GroupConstructors = new QGroupBox(tr("SMESH_SMOOTHING"), this);
+ QHBoxLayout* GroupConstructorsLayout = new QHBoxLayout(GroupConstructors);
+ GroupConstructorsLayout->setSpacing(SPACING);
+ GroupConstructorsLayout->setMargin(MARGIN);
+
+ Constructor1 = new QRadioButton(GroupConstructors);
+ Constructor1->setIcon(image0);
+ Constructor1->setChecked(true);
+ GroupConstructorsLayout->addWidget(Constructor1);
+ GroupConstructorsLayout->addStretch();
/***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setTitle(tr("SMESH_ARGUMENTS"));
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6);
- GroupArgumentsLayout->setMargin(11);
+ GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
// Controls for elements selection
- TextLabelElements = new QLabel(GroupArguments, "TextLabelElements");
- TextLabelElements->setText(tr("SMESH_ID_ELEMENTS" ));
- GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
+ TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
- SelectElementsButton = new QPushButton(GroupArguments, "SelectElementsButton");
- SelectElementsButton->setText(tr("" ));
- SelectElementsButton->setPixmap(image1);
- SelectElementsButton->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ SelectElementsButton = new QPushButton(GroupArguments);
+ SelectElementsButton->setIcon(image1);
- LineEditElements = new QLineEdit(GroupArguments, "LineEditElements");
- LineEditElements->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
+ LineEditElements = new QLineEdit(GroupArguments);
+ LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
// Control for the whole mesh selection
- CheckBoxMesh = new QCheckBox(GroupArguments, "CheckBoxMesh");
- CheckBoxMesh->setText(tr("SMESH_SELECT_WHOLE_MESH"));
- GroupArgumentsLayout->addMultiCellWidget(CheckBoxMesh, 1, 1, 0, 2);
+ CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
// Controls for nodes selection
- TextLabelNodes = new QLabel(GroupArguments, "TextLabelNodes");
- TextLabelNodes->setText(tr("FIXED_NODES_IDS"));
- GroupArgumentsLayout->addWidget(TextLabelNodes, 2, 0);
+ TextLabelNodes = new QLabel(tr("FIXED_NODES_IDS"), GroupArguments);
- SelectNodesButton = new QPushButton(GroupArguments, "SelectNodesButton");
- SelectNodesButton->setText(tr("" ));
- SelectNodesButton->setPixmap(image1);
- SelectNodesButton->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectNodesButton, 2, 1);
+ SelectNodesButton = new QPushButton(GroupArguments);
+ SelectNodesButton->setIcon(image1);
- LineEditNodes = new QLineEdit(GroupArguments, "LineEditNodes");
- LineEditNodes->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupArgumentsLayout->addWidget(LineEditNodes, 2, 2);
+ LineEditNodes = new QLineEdit(GroupArguments);
+ LineEditNodes->setValidator(new SMESHGUI_IdValidator(this));
// Controls for method selection
- TextLabelMethod = new QLabel(GroupArguments, "TextLabelMethod");
- TextLabelMethod->setText(tr("METHOD" ));
- GroupArgumentsLayout->addMultiCellWidget(TextLabelMethod, 3, 3, 0, 1);
+ TextLabelMethod = new QLabel(tr("METHOD"), GroupArguments);
- ComboBoxMethod = new QComboBox(GroupArguments, "ComboBoxMethod");
- GroupArgumentsLayout->addWidget(ComboBoxMethod, 3, 2);
+ ComboBoxMethod = new QComboBox(GroupArguments);
// Controls for iteration limit defining
- TextLabelLimit = new QLabel(GroupArguments, "TextLabelLimit");
- TextLabelLimit->setText(tr("ITERATION_LIMIT" ));
- GroupArgumentsLayout->addMultiCellWidget(TextLabelLimit, 4, 4, 0, 1);
+ TextLabelLimit = new QLabel(tr("ITERATION_LIMIT"), GroupArguments);
- SpinBox_IterationLimit = new QSpinBox(GroupArguments, "SpinBox_IterationLimit");
- GroupArgumentsLayout->addWidget(SpinBox_IterationLimit, 4, 2);
+ SpinBox_IterationLimit = new QSpinBox(GroupArguments);
// Controls for max. aspect ratio defining
- TextLabelAspectRatio = new QLabel(GroupArguments, "TextLabelAspectRatio");
- TextLabelAspectRatio->setText(tr("MAX_ASPECT_RATIO"));
- GroupArgumentsLayout->addMultiCellWidget(TextLabelAspectRatio, 5, 5, 0, 1);
+ TextLabelAspectRatio = new QLabel(tr("MAX_ASPECT_RATIO"), GroupArguments);
- SpinBox_AspectRatio = new SMESHGUI_SpinBox(GroupArguments, "SpinBox_AspectRatio");
- GroupArgumentsLayout->addWidget(SpinBox_AspectRatio, 5, 2);
+ SpinBox_AspectRatio = new SMESHGUI_SpinBox(GroupArguments);
// Check box "Is Parametric"
- CheckBoxParametric = new QCheckBox( GroupArguments, "CheckBoxParametric" );
- CheckBoxParametric->setText( tr( "IS_PARAMETRIC" ) );
- GroupArgumentsLayout->addMultiCellWidget( CheckBoxParametric, 6, 6, 0, 2 );
+ CheckBoxParametric = new QCheckBox( tr("IS_PARAMETRIC"), GroupArguments );
+
+ GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
+ GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ GroupArgumentsLayout->addWidget(LineEditElements, 0, 2);
+ GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 3);
+ GroupArgumentsLayout->addWidget(TextLabelNodes, 2, 0);
+ GroupArgumentsLayout->addWidget(SelectNodesButton, 2, 1);
+ GroupArgumentsLayout->addWidget(LineEditNodes, 2, 2);
+ GroupArgumentsLayout->addWidget(TextLabelMethod, 3, 0);
+ GroupArgumentsLayout->addWidget(ComboBoxMethod, 3, 2);
+ GroupArgumentsLayout->addWidget(TextLabelLimit, 4, 0);
+ GroupArgumentsLayout->addWidget(SpinBox_IterationLimit, 4, 2);
+ GroupArgumentsLayout->addWidget(TextLabelAspectRatio, 5, 0);
+ GroupArgumentsLayout->addWidget(SpinBox_AspectRatio, 5, 2);
+ GroupArgumentsLayout->addWidget(CheckBoxParametric, 6, 0, 1, 3);
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
- SMESHGUI_SmoothingDlgLayout->addWidget(GroupArguments, 1, 0);
+ /***************************************************************/
+ SMESHGUI_SmoothingDlgLayout->addWidget(GroupConstructors);
+ SMESHGUI_SmoothingDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_SmoothingDlgLayout->addWidget(GroupButtons);
+ /***************************************************************/
/* Initialisations */
- ComboBoxMethod->insertItem(tr("LAPLACIAN"));
- ComboBoxMethod->insertItem(tr("CENTROIDAL"));
+ ComboBoxMethod->addItem(tr("LAPLACIAN"));
+ ComboBoxMethod->addItem(tr("CENTROIDAL"));
- ComboBoxMethod->setCurrentItem(0);
+ ComboBoxMethod->setCurrentIndex(0);
- CheckBoxParametric->setChecked( TRUE );
+ CheckBoxParametric->setChecked( true );
- QIntValidator* anIntValidator = new QIntValidator(SpinBox_IterationLimit);
- SpinBox_IterationLimit->setValidator(anIntValidator);
SpinBox_IterationLimit->setRange(1, 999999);
SpinBox_IterationLimit->setValue(20);
SpinBox_AspectRatio->RangeStepAndValidator(0.0, +999999.999, 0.1, 3);
GroupArguments->show();
myConstructorId = 0;
- Constructor1->setChecked(TRUE);
+ Constructor1->setChecked(true);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SelectNodesButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)),
SLOT(onSelectMesh(bool)));
-
- /***************************************************************/
-
- this->show(); // displays Dialog
}
//=================================================================================
onSelectMesh(false);
}
-//=================================================================================
-// function : ConstructorsClicked()
-// purpose : Radio button management
-//=================================================================================
-void SMESHGUI_SmoothingDlg::ConstructorsClicked (int constructorId)
-{
-}
-
//=================================================================================
// function : ClickOnApply()
// purpose : Called when user presses <Apply> button
return;
if (myNbOkElements &&
- (myNbOkNodes || LineEditNodes->text().stripWhiteSpace().isEmpty())) {
- QStringList aListElementsId = QStringList::split(" ", myElementsId, false);
- QStringList aListNodesId = QStringList::split(" ", LineEditNodes->text(), false);
+ (myNbOkNodes || LineEditNodes->text().trimmed().isEmpty())) {
+ QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
+ QStringList aListNodesId = LineEditNodes->text().split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId = new SMESH::long_array;
SMESH::long_array_var aNodesId = new SMESH::long_array;
double aMaxAspectRatio = SpinBox_AspectRatio->GetValue();
SMESH::SMESH_MeshEditor::Smooth_Method aMethod = SMESH::SMESH_MeshEditor::LAPLACIAN_SMOOTH;
- if (ComboBoxMethod->currentItem() > 0)
+ if (ComboBoxMethod->currentIndex() > 0)
aMethod = SMESH::SMESH_MeshEditor::CENTROIDAL_SMOOTH;
bool aResult = false;
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
if ( CheckBoxParametric->isChecked() )
aResult = aMeshEditor->SmoothParametric(anElementsId.inout(), aNodesId.inout(),
anIterationLimit, aMaxAspectRatio, aMethod);
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if (aMesh) {
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
if (send == LineEditElements) {
const Handle(SALOME_InteractiveObject)& anIO = myActor->getIO();
}
}
- if (myNbOkElements && (myNbOkNodes || LineEditNodes->text().stripWhiteSpace().isEmpty())) {
+ if (myNbOkElements && (myNbOkNodes || LineEditNodes->text().trimmed().isEmpty())) {
buttonOk->setEnabled(true);
buttonApply->setEnabled(true);
}
void SMESHGUI_SmoothingDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_SmoothingDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_SmoothingDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_SMOOTHING_H
-#define DIALOGBOX_SMOOTHING_H
+#ifndef SMESHGUI_SMOOTHINGDLG_H
+#define SMESHGUI_SMOOTHINGDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
+// Qt includes
+#include <QDialog>
-#include "SMESH_LogicalFilter.hxx"
-
-// QT Includes
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
-class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class SMESHGUI_SpinBox;
class SMESHGUI;
class SMESH_Actor;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
+class LightApp_SelectionMgr;
+class SMESH_LogicalFilter;
//=================================================================================
// class : SMESHGUI_SmoothingDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_SmoothingDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_SmoothingDlg( SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_SmoothingDlg();
+ SMESHGUI_SmoothingDlg( SMESHGUI* );
+ ~SMESHGUI_SmoothingDlg();
private:
-
- void Init();
- void closeEvent(QCloseEvent*);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- QString myElementsId;
- int myNbOkElements; /* to check when elements are defined */
- int myNbOkNodes; /* to check when fixed nodes are defined */
- int myConstructorId; /* Current constructor id = radio button id */
- QLineEdit* myEditCurrentArgument; /* Current LineEdit */
- SVTK_Selector* mySelector;
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
- SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* Constructor1;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupArguments;
- QLabel* TextLabelElements;
- QPushButton* SelectElementsButton;
- QLineEdit* LineEditElements;
- QCheckBox* CheckBoxMesh;
- QLabel* TextLabelNodes;
- QPushButton* SelectNodesButton;
- QLineEdit* LineEditNodes;
- QLabel* TextLabelMethod;
- QComboBox* ComboBoxMethod;
- QLabel* TextLabelLimit;
- QSpinBox* SpinBox_IterationLimit;
- QLabel* TextLabelAspectRatio;
- SMESHGUI_SpinBox* SpinBox_AspectRatio;
- QCheckBox * CheckBoxParametric;
-
- QString myHelpFileName;
+ void Init();
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ QString myElementsId;
+ int myNbOkElements; /* to check when elements are defined */
+ int myNbOkNodes; /* to check when fixed nodes are defined */
+ int myConstructorId; /* Current constructor id = radio button id */
+ QLineEdit* myEditCurrentArgument; /* Current LineEdit */
+ SVTK_Selector* mySelector;
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
+
+ QGroupBox* GroupConstructors;
+ QRadioButton* Constructor1;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupArguments;
+ QLabel* TextLabelElements;
+ QPushButton* SelectElementsButton;
+ QLineEdit* LineEditElements;
+ QCheckBox* CheckBoxMesh;
+ QLabel* TextLabelNodes;
+ QPushButton* SelectNodesButton;
+ QLineEdit* LineEditNodes;
+ QLabel* TextLabelMethod;
+ QComboBox* ComboBoxMethod;
+ QLabel* TextLabelLimit;
+ QSpinBox* SpinBox_IterationLimit;
+ QLabel* TextLabelAspectRatio;
+ SMESHGUI_SpinBox* SpinBox_AspectRatio;
+ QCheckBox* CheckBoxParametric;
+
+ QString myHelpFileName;
private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void onTextChange(const QString&);
- void onSelectMesh(bool toSelectMesh);
-
-protected:
- QGridLayout* SMESHGUI_SmoothingDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupArgumentsLayout;
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onSelectMesh( bool );
};
-#endif // DIALOGBOX_SMOOTHING_H
+#endif // SMESHGUI_SMOOTHINGDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_SpinBox.cxx
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_SpinBox.cxx
-// Author : Lucien PIGNOLONI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_SpinBox.h"
-#include "SMESHGUI.h"
-
-#include <qvalidator.h>
-#include <qlineedit.h>
-using namespace std;
+// Qt includes
+#include <QDoubleValidator>
+#include <QLineEdit>
//=================================================================================
// class : SMESHGUI_SpinBox()
// purpose : constructor of specific widget accepting floats in double precision.
//=================================================================================
-SMESHGUI_SpinBox::SMESHGUI_SpinBox (QWidget* parent, const char* name)
- : QtxDblSpinBox(parent, name)
+SMESHGUI_SpinBox::SMESHGUI_SpinBox( QWidget* parent )
+ : QtxDoubleSpinBox( parent )
{
}
//=================================================================================
-// function : SetStep() [SLOT]
-// purpose :
+// function : ~SMESHGUI_SpinBox()
+// purpose : destructor
//=================================================================================
-void SMESHGUI_SpinBox::SetStep (double newStep)
+SMESHGUI_SpinBox::~SMESHGUI_SpinBox()
{
- setLineStep(newStep);
}
//=================================================================================
-// function : ~SMESHGUI_SpinBox()
-// purpose : destructor
+// function : SetStep() [SLOT]
+// purpose :
//=================================================================================
-SMESHGUI_SpinBox::~SMESHGUI_SpinBox()
+void SMESHGUI_SpinBox::SetStep( double newStep )
{
+ setSingleStep( newStep );
}
//=================================================================================
// function : SetValue()
// purpose :
//=================================================================================
-void SMESHGUI_SpinBox::SetValue (double v)
+void SMESHGUI_SpinBox::SetValue( double v )
{
setValue(v);
editor()->setCursorPosition( 0 );
// function : GetValue()
// purpose : returns a double
//=================================================================================
-double SMESHGUI_SpinBox::GetValue()
+double SMESHGUI_SpinBox::GetValue() const
{
return value();
}
// function : GetString()
// purpose : returns a QString
//=================================================================================
-QString SMESHGUI_SpinBox::GetString()
+QString SMESHGUI_SpinBox::GetString() const
{
return cleanText();
}
+//=================================================================================
+// function : editor()
+// purpose : returns editor
+//=================================================================================
+QLineEdit* SMESHGUI_SpinBox::editor() const
+{
+ return QtxDoubleSpinBox::lineEdit();
+}
+
+//=================================================================================
+// function : validator()
+// purpose : returns validator
+//=================================================================================
+QDoubleValidator* SMESHGUI_SpinBox::validator() const
+{
+ return (QDoubleValidator*)editor()->validator();
+}
+
//=================================================================================
// function : RangeStepAndValidator()
// purpose :
//=================================================================================
-void SMESHGUI_SpinBox::RangeStepAndValidator
- (double min, double max, double step, unsigned short decimals)
+void SMESHGUI_SpinBox::RangeStepAndValidator( double min,
+ double max,
+ double step,
+ unsigned short decimals )
{
- setPrecision(-decimals); // PAL8769. Minus is for using 'g' double->string conversion specifier,
- // see QtxDblSpinBox::mapValueToText( double v )
- setRange(min, max);
- setLineStep(step);
- ((QDoubleValidator*)validator())->setRange(min, max, decimals);
+ setDecimals(decimals); // PAL8769. Minus is for using 'g' double->string conversion specifier,
+ // see QtxDoubleSpinBox::mapValueToText( double v )
+ setRange( min, max );
+ setSingleStep( step );
+ validator()->setRange( min, max, decimals );
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_SpinBox.h
+// Author : Lucien PIGNOLONI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_SpinBox.h
-// Author : Lucien PIGNOLONI
-// Module : SMESH
-// $Header$
-#ifndef SMESH_SPINBOX_H
-#define SMESH_SPINBOX_H
+#ifndef SMESHGUI_SPINBOX_H
+#define SMESHGUI_SPINBOX_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include <QtxDblSpinBox.h>
+// SALOME GUI includes
+#include <QtxDoubleSpinBox.h>
-// like in GEOM_SRC/src/DlgRef/DlgRef_SpinBox.h
#define COORD_MIN -1e+15
#define COORD_MAX +1e+15
#define DBL_DIGITS_DISPLAY 14
+class QLineEdit;
+class QDoubleValidator;
+
//=================================================================================
// class : SMESHGUI_SpinBox
-// purpose : Derivated from QtxDblSpinBox class
+// purpose : Derivated from QtxDoubleSpinBox class
//=================================================================================
-class SMESHGUI_EXPORT SMESHGUI_SpinBox : public QtxDblSpinBox
+class SMESHGUI_EXPORT SMESHGUI_SpinBox : public QtxDoubleSpinBox
{
Q_OBJECT
public:
- SMESHGUI_SpinBox (QWidget* parent, const char* name = 0);
+ SMESHGUI_SpinBox( QWidget* );
~SMESHGUI_SpinBox();
- void RangeStepAndValidator (double min = -1000000.0,
- double max = +1000000.0,
- double step = 100.0,
- unsigned short decimals = 3);
- void SetValue (double v);
- double GetValue();
- QString GetString();
- QLineEdit* editor() { return QtxDblSpinBox::editor(); }
+ void RangeStepAndValidator( double = -1000000.0,
+ double = +1000000.0,
+ double = 100.0,
+ unsigned short = 3 );
+ void SetValue( double );
+ double GetValue() const;
+ QString GetString() const;
+ QLineEdit* editor() const;
+ QDoubleValidator* validator() const;
public slots:
- void SetStep (double newStep);
+ void SetStep( double );
};
-#endif // SMESH_SPINBOX_H
+
+#endif // SMESHGUI_SPINBOX_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : SMESHGUI_StandardMeshInfosDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_StandardMeshInfosDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_StandardMeshInfosDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_MeshUtils.h"
-#include "SMESH_TypeFilter.hxx"
-
-#include "SALOMEDSClient_Study.hxx"
-#include "SALOMEDSClient_SObject.hxx"
+#include <SMESH_TypeFilter.hxx>
-#include "SUIT_Desktop.h"
-#include "SUIT_Session.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_MessageBox.h"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_Study.hxx>
+#include <SALOMEDSClient_SObject.hxx>
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
-#include "LightApp_SelectionMgr.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SALOME_ListIO.hxx>
-// QT Includes
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qtextbrowser.h>
-#include <qmap.h>
-#include <qpushbutton.h>
+// Qt includes
+#include <QGroupBox>
+#include <QLabel>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QLineEdit>
+#include <QTextBrowser>
+#include <QPushButton>
+#include <QKeyEvent>
-// IDL Headers
-#include "SALOMEconfig.h"
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Group)
-#include CORBA_SERVER_HEADER(GEOM_Gen)
-
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
/*!
* Constructor
*/
//=================================================================================
-SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_StandardMeshInfosDlg::SMESHGUI_StandardMeshInfosDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
- if (!name)
- setName("SMESHGUI_StandardMeshInfosDlg");
- setCaption(tr("SMESH_STANDARD_MESHINFO_TITLE" ));
- setSizeGripEnabled(TRUE);
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("SMESH_STANDARD_MESHINFO_TITLE"));
+ setSizeGripEnabled(true);
myStartSelection = true;
myIsActiveWindow = true;
// dialog layout
- QGridLayout* aDlgLayout = new QGridLayout(this);
- aDlgLayout->setSpacing(6);
- aDlgLayout->setMargin(11);
+ QVBoxLayout* aDlgLayout = new QVBoxLayout(this);
+ aDlgLayout->setSpacing(SPACING);
+ aDlgLayout->setMargin(MARGIN);
// mesh group box
- myMeshGroup = new QGroupBox(this, "myMeshGroup");
- myMeshGroup->setTitle(tr("SMESH_MESH"));
- myMeshGroup->setColumnLayout(0, Qt::Vertical);
- myMeshGroup->layout()->setSpacing(0);
- myMeshGroup->layout()->setMargin(0);
- QGridLayout* myMeshGroupLayout = new QGridLayout(myMeshGroup->layout());
- myMeshGroupLayout->setAlignment(Qt::AlignTop);
- myMeshGroupLayout->setSpacing(6);
- myMeshGroupLayout->setMargin(11);
+ myMeshGroup = new QGroupBox(tr("SMESH_MESH"), this);
+ QHBoxLayout* myMeshGroupLayout = new QHBoxLayout(myMeshGroup);
+ myMeshGroupLayout->setSpacing(SPACING);
+ myMeshGroupLayout->setMargin(MARGIN);
// select button, label and line edit with mesh name
- myNameLab = new QLabel(myMeshGroup, "myNameLab");
- myNameLab->setText(tr("SMESH_NAME" ));
- myMeshGroupLayout->addWidget(myNameLab, 0, 0);
+ myNameLab = new QLabel(tr("SMESH_NAME"), myMeshGroup);
+ myMeshGroupLayout->addWidget(myNameLab);
QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("SMESH",tr("ICON_SELECT")));
- mySelectBtn = new QPushButton(myMeshGroup, "mySelectBtn");
- mySelectBtn->setPixmap(image0);
- mySelectBtn->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
- myMeshGroupLayout->addWidget(mySelectBtn, 0, 1);
+ mySelectBtn = new QPushButton(myMeshGroup);
+ mySelectBtn->setIcon(image0);
+ myMeshGroupLayout->addWidget(mySelectBtn);
- myMeshLine = new QLineEdit(myMeshGroup, "myMeshLine");
- myMeshGroupLayout->addWidget(myMeshLine, 0, 2);
+ myMeshLine = new QLineEdit(myMeshGroup);
+ myMeshGroupLayout->addWidget(myMeshLine);
- aDlgLayout->addWidget(myMeshGroup, 0, 0);
+ aDlgLayout->addWidget(myMeshGroup);
// information group box
- myInfoGroup = new QGroupBox(this, "myInfoGroup");
- myInfoGroup->setTitle(tr("SMESH_INFORMATION"));
- myInfoGroup->setColumnLayout(0, Qt::Vertical);
- myInfoGroup->layout()->setSpacing(0);
- myInfoGroup->layout()->setMargin(0);
- QGridLayout* myInfoGroupLayout = new QGridLayout(myInfoGroup->layout());
- myInfoGroupLayout->setAlignment(Qt::AlignTop);
- myInfoGroupLayout->setSpacing(6);
- myInfoGroupLayout->setMargin(11);
+ myInfoGroup = new QGroupBox(tr("SMESH_INFORMATION"), this);
+ QVBoxLayout* myInfoGroupLayout = new QVBoxLayout(myInfoGroup);
+ myInfoGroupLayout->setSpacing(SPACING);
+ myInfoGroupLayout->setMargin(MARGIN);
// information text browser
- myInfo = new QTextBrowser(myInfoGroup, "myInfo");
- myInfoGroupLayout->addWidget(myInfo, 0, 0);
+ myInfo = new QTextBrowser(myInfoGroup);
+ myInfo->setMinimumSize(200, 150);
+ myInfoGroupLayout->addWidget(myInfo);
- aDlgLayout->addWidget(myInfoGroup, 1, 0);
+ aDlgLayout->addWidget(myInfoGroup);
// buttons group
- myButtonsGroup = new QGroupBox(this, "myButtonsGroup");
- myButtonsGroup->setColumnLayout(0, Qt::Vertical);
- myButtonsGroup->layout()->setSpacing(0); myButtonsGroup->layout()->setMargin(0);
- QHBoxLayout* myButtonsGroupLayout = new QHBoxLayout(myButtonsGroup->layout());
- myButtonsGroupLayout->setAlignment(Qt::AlignTop);
- myButtonsGroupLayout->setSpacing(6); myButtonsGroupLayout->setMargin(11);
+ myButtonsGroup = new QGroupBox(this);
+ QHBoxLayout* myButtonsGroupLayout = new QHBoxLayout(myButtonsGroup);
+ myButtonsGroupLayout->setSpacing(SPACING);
+ myButtonsGroupLayout->setMargin(MARGIN);
// buttons --> OK and Help buttons
- myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), myButtonsGroup, "myOkBtn");
- myOkBtn->setAutoDefault(TRUE); myOkBtn->setDefault(TRUE);
- myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP" ), myButtonsGroup, "myHelpBtn");
- myHelpBtn->setAutoDefault(TRUE);
+ myOkBtn = new QPushButton(tr("SMESH_BUT_OK"), myButtonsGroup);
+ myOkBtn->setAutoDefault(true); myOkBtn->setDefault(true);
+ myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), myButtonsGroup);
+ myHelpBtn->setAutoDefault(true);
myButtonsGroupLayout->addWidget(myOkBtn);
+ myButtonsGroupLayout->addSpacing(10);
myButtonsGroupLayout->addStretch();
myButtonsGroupLayout->addWidget(myHelpBtn);
- aDlgLayout->addWidget(myButtonsGroup, 2, 0);
+ aDlgLayout->addWidget(myButtonsGroup);
mySMESHGUI->SetActiveDialogBox(this);
connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect( mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
- // resize and move dialog, then show
- this->setMinimumSize(270, 428);
- this->show();
-
// init dialog with current selection
myMeshFilter = new SMESH_TypeFilter (MESH);
mySelectionMgr->installFilter(myMeshFilter);
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
- for (; it->More(); it->Next()) {
+ for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
- for (; it->More(); it->Next()) {
+ for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
// info about groups on faces
anObj.reset();
- aMeshSO->FindSubObject(SMESH::Tag_FaceGroups , anObj);
+ aMeshSO->FindSubObject(SMESH::Tag_FaceGroups, anObj);
if (anObj) {
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (!hasGroup && it->More()) {
anInfo.append(QString("Groups:<br><br>"));
hasGroup = true;
}
- for (; it->More(); it->Next()) {
+ for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
_PTR(ChildIterator) it = aStudy->NewChildIterator(anObj);
if (!hasGroup && it->More())
anInfo.append(QString("Groups:<br>"));
- for (; it->More(); it->Next()) {
+ for ( ; it->More(); it->Next()) {
_PTR(SObject) subObj = it->Value();
CORBA::Object_var anObject = SMESH::SObjectToObject(subObj);
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow(anObject);
#else
platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- onHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_StandardMeshInfosDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_StandardMeshInfosDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
#ifndef SMESHGUI_STANDARDMESHINFOSDLG_H
#define SMESHGUI_STANDARDMESHINFOSDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-//#include "SMESH_TypeFilter.hxx"
-#include "SUIT_SelectionFilter.h"
-
-// QT Includes
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
class QGroupBox;
class QLabel;
class QPushButton;
class QLineEdit;
class QTextBrowser;
-class LightApp_SelectionMgr;
class SMESHGUI;
-
+class LightApp_SelectionMgr;
+class SUIT_SelectionFilter;
class SMESHGUI_EXPORT SMESHGUI_StandardMeshInfosDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_StandardMeshInfosDlg( SMESHGUI*, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
- ~SMESHGUI_StandardMeshInfosDlg();
+ SMESHGUI_StandardMeshInfosDlg( SMESHGUI* );
+ ~SMESHGUI_StandardMeshInfosDlg();
protected:
- void closeEvent( QCloseEvent* e );
- void keyPressEvent( QKeyEvent* e );
- void windowActivationChange( bool oldActive );
- void DumpMeshInfos();
+ void closeEvent( QCloseEvent* );
+ void keyPressEvent( QKeyEvent* );
+ void windowActivationChange( bool );
+ void DumpMeshInfos();
private slots:
- void onSelectionChanged();
- void DeactivateActiveDialog() ;
- void ActivateThisDialog();
- void onStartSelection();
- void onHelp();
+ void onSelectionChanged();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onStartSelection();
+ void onHelp();
private:
- SMESHGUI* mySMESHGUI;
- LightApp_SelectionMgr* mySelectionMgr;
- bool myStartSelection;
- bool myIsActiveWindow;
+ SMESHGUI* mySMESHGUI;
+ LightApp_SelectionMgr* mySelectionMgr;
+ bool myStartSelection;
+ bool myIsActiveWindow;
- //Handle(SMESH_TypeFilter) myMeshFilter;
- SUIT_SelectionFilter* myMeshFilter;
+ SUIT_SelectionFilter* myMeshFilter;
- QLabel* myNameLab;
- QPushButton* mySelectBtn;
- QLineEdit* myMeshLine;
+ QLabel* myNameLab;
+ QPushButton* mySelectBtn;
+ QLineEdit* myMeshLine;
- QTextBrowser* myInfo;
+ QTextBrowser* myInfo;
- QGroupBox* myMeshGroup;
- QGroupBox* myInfoGroup;
+ QGroupBox* myMeshGroup;
+ QGroupBox* myInfoGroup;
- QGroupBox* myButtonsGroup;
- QPushButton* myOkBtn;
- QPushButton* myHelpBtn;
+ QGroupBox* myButtonsGroup;
+ QPushButton* myOkBtn;
+ QPushButton* myHelpBtn;
- QString myHelpFileName;
+ QString myHelpFileName;
};
#endif // SMESHGUI_STANDARDMESHINFOSDLG_H
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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 : SMESH_Swig.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-
-#include "SMESHGUI_Swig.hxx"
-
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
-
-#include "SMESHGUI.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_GEOMGenUtils.h"
-#include "SMESHGUI_Displayer.h"
-
-// SALOME Includes
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_ViewModel.h"
-#include "VTKViewer_ViewModel.h"
-
-#include "SALOME_Event.hxx"
-#include "SALOME_NamingService.hxx"
-#include "SalomeApp_Application.h"
-#include "SALOMEDSClient_ClientFactory.hxx"
-
-#include "utilities.h"
-
-// Open CASCADE Includes
-#include <TopoDS.hxx>
-
-// QT Includes
-#include <qapplication.h>
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Gen)
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-#include CORBA_SERVER_HEADER(SMESH_Hypothesis)
-
-using namespace std;
-
-static CORBA::ORB_var anORB;
-
-namespace
-{
- //---------------------------------------------------------------
- inline
- CORBA::Object_var
- StringToObject(const std::string& theIOR)
- {
- return anORB->string_to_object(theIOR.c_str());
- }
-
-
- //---------------------------------------------------------------
- inline
- SALOMEDS::SObject_var
- GetDomainRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- CORBA::Long theDomainRootTag,
- const QString& theName,
- const QString& thePixmap)
- {
- SALOMEDS::SObject_var aDomainRoot;
- if (!theSComponentMesh->FindSubObject(theDomainRootTag,aDomainRoot)) {
- aDomainRoot = theStudyBuilder->NewObjectToTag(theSComponentMesh,theDomainRootTag);
- SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeName");
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(theName.latin1());
- anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributePixMap");
- SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap(thePixmap.latin1());
- anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeSelectable");
- SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
- aSelAttr->SetSelectable(false);
- }
-
- return aDomainRoot;
- }
-
-
- //---------------------------------------------------------------
- inline
- SALOMEDS::SObject_var
- GetHypothesisRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
- {
- return GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_HypothesisRoot,
- QObject::tr("SMESH_MEN_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
- }
-
-
- //---------------------------------------------------------------
- inline
- SALOMEDS::SObject_var
- GetAlgorithmsRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
- {
- return GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- QObject::tr("SMESH_MEN_ALGORITHMS"),
- "ICON_SMESH_TREE_ALGO");
- }
-
-
- //---------------------------------------------------------------
- inline
- SALOMEDS::SObject_var
- AddToDomain(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- CORBA::Long theDomainRootTag,
- const QString& theDomainName,
- const QString& theDomainPixmap)
- {
- SALOMEDS::SObject_var aDomain = GetDomainRoot(theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- theDomainName,
- theDomainPixmap);
- // Add New Hypothesis
- SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(aDomain);
- SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap");
- SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- CORBA::Object_var anObject = StringToObject(theIOR);
- SMESH::SMESH_Hypothesis_var aDomainItem = SMESH::SMESH_Hypothesis::_narrow(anObject.in());
- CORBA::String_var aType = aDomainItem->GetName();
- QString aPixmapName = theDomainPixmap + "_" + aType.in();
- aPixmap->SetPixMap(aPixmapName.latin1());
- anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
- SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(theIOR.c_str());
-
- return aSObject;
- }
-
-
- //---------------------------------------------------------------
- SALOMEDS::SObject_var
- AddHypothesis(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
- {
- return AddToDomain(theIOR,
- theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_HypothesisRoot,
- QObject::tr("SMESH_MEN_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
- }
-
-
- //---------------------------------------------------------------
- SALOMEDS::SObject_var
- AddAlgorithms(const std::string& theIOR,
- const SALOMEDS::SComponent_var& theSComponentMesh,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
- {
- return AddToDomain(theIOR,
- theSComponentMesh,
- theStudyBuilder,
- SMESH::Tag_AlgorithmsRoot,
- QObject::tr("SMESH_MEN_ALGORITHMS"),
- "ICON_SMESH_TREE_ALGO");
- }
-
-
- //---------------------------------------------------------------
- void
- SetDomain(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder,
- long theRefOnAppliedDomainTag,
- const QString& theAppliedDomainMEN,
- const QString& theAppliedDomainICON)
- {
- SALOMEDS::SObject_var aMeshOrSubMeshSO = theStudy->FindObjectID(theMeshOrSubMeshEntry);
- SALOMEDS::SObject_var aHypothesisSO = theStudy->FindObjectID(theDomainEntry);
-
- if(!aMeshOrSubMeshSO->_is_nil() && !aHypothesisSO->_is_nil()){
- //Find or Create Applied Hypothesis root
- SALOMEDS::SObject_var anAppliedDomainSO;
- if(!aMeshOrSubMeshSO->FindSubObject(theRefOnAppliedDomainTag,anAppliedDomainSO)){
- anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag);
- SALOMEDS::GenericAttribute_var anAttr =
- theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(theAppliedDomainMEN.latin1());
- anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable");
- SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
- aSelAttr->SetSelectable(false);
- anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributePixMap");
- SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap(theAppliedDomainICON.latin1());
- }
- SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(anAppliedDomainSO);
- theStudyBuilder->Addreference(aSObject,aHypothesisSO);
- }
- }
-
-
- //---------------------------------------------------------------
- void
- SetHypothesis(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
- {
- SetDomain(theMeshOrSubMeshEntry,
- theDomainEntry,
- theStudy,
- theStudyBuilder,
- SMESH::Tag_RefOnAppliedHypothesis,
- QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
- "ICON_SMESH_TREE_HYPO");
- }
-
-
- //---------------------------------------------------------------
- void
- SetAlgorithms(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry,
- const SALOMEDS::Study_var& theStudy,
- const SALOMEDS::StudyBuilder_var& theStudyBuilder)
- {
- SetDomain(theMeshOrSubMeshEntry,
- theDomainEntry,
- theStudy,
- theStudyBuilder,
- SMESH::Tag_RefOnAppliedAlgorithms,
- QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
- "ICON_SMESH_TREE_ALGO");
- }
-}
-
-
-//===============================================================
-SMESH_Swig::SMESH_Swig()
-{
- class TEvent: public SALOME_Event
- {
- CORBA::ORB_var& myORB;
- public:
-
- TEvent(CORBA::ORB_var& theORB):
- myORB(theORB)
- {}
-
- virtual
- void
- Execute()
- {
- try {
- ORB_INIT &anORBInit = *SINGLETON_<ORB_INIT>::Instance();
- ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
- myORB = anORBInit( 0 , 0 );
- } catch (...) {
- INFOS("internal error : orb not found");
- }
- }
- };
-
- MESSAGE("Constructeur");
-
- if(CORBA::is_nil(anORB))
- ProcessVoidEvent(new TEvent(anORB));
-
- ASSERT(!CORBA::is_nil(anORB));
-}
-
-
-//===============================================================
-void
-SMESH_Swig::Init(int theStudyID)
-{
- class TEvent: public SALOME_Event
- {
- int myStudyID;
- SALOMEDS::Study_var& myStudy;
- SALOMEDS::StudyBuilder_var& myStudyBuilder;
- SALOMEDS::SComponent_var& mySComponentMesh;
- public:
- TEvent(int theStudyID,
- SALOMEDS::Study_var& theStudy,
- SALOMEDS::StudyBuilder_var& theStudyBuilder,
- SALOMEDS::SComponent_var& theSComponentMesh):
- myStudyID(theStudyID),
- myStudy(theStudy),
- myStudyBuilder(theStudyBuilder),
- mySComponentMesh(theSComponentMesh)
- {}
-
- virtual
- void
- Execute()
- {
- SUIT_Session* aSession = SUIT_Session::session();
- SUIT_Application* anApplication = aSession->activeApplication();
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(anApplication);
-
- SALOME_NamingService* aNamingService = anApp->namingService();
- CORBA::Object_var anObject = aNamingService->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
- myStudy = aStudyMgr->GetStudyByID(myStudyID);
-
- SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
- aSMESHGen->SetCurrentStudy( myStudy.in() );
-
- myStudyBuilder = myStudy->NewBuilder();
-
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeName_var aName;
- SALOMEDS::AttributePixMap_var aPixmap;
-
- SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
- if(aSComponent->_is_nil()){
- bool aLocked = myStudy->GetProperties()->IsLocked();
- if (aLocked)
- myStudy->GetProperties()->SetLocked(false);
-
- aSComponent = myStudyBuilder->NewComponent("SMESH");
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributeName");
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
-
- SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
- if (!aSMESHGUI){
- CAM_Module* aModule = anApp->module("Mesh");
- if(!aModule)
- aModule = anApp->loadModule("Mesh");
- aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
- } //SRN: BugID IPAL9186: end of a fix
- aName->SetValue(aSMESHGUI->moduleName());
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap");
- aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
- myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
- if (aLocked)
- myStudy->GetProperties()->SetLocked(true);
- }
-
- mySComponentMesh = SALOMEDS::SComponent::_narrow(aSComponent);
-
- qApp->processEvents(); // Workaround for bug 12662
- }
- };
-
- MESSAGE("Init");
-
- ProcessVoidEvent(new TEvent(theStudyID,
- myStudy,
- myStudyBuilder,
- mySComponentMesh));
-}
-
-
-//===============================================================
-SMESH_Swig::~SMESH_Swig()
-{
- MESSAGE("Destructeur");
-}
-
-
-//===============================================================
-const char* SMESH_Swig::AddNewMesh(const char* theIOR)
-{
- MESSAGE("AddNewMesh");
-
- // VSR: added temporarily - to be removed - objects are published automatically by engine
- SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR);
- if (aSObject->_is_nil()){
- //Find or Create Hypothesis root
- GetHypothesisRoot(mySComponentMesh,myStudyBuilder);
- GetAlgorithmsRoot(mySComponentMesh,myStudyBuilder);
-
- // Add New Mesh
- aSObject = myStudyBuilder->NewObject(mySComponentMesh);
- SALOMEDS::GenericAttribute_var anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap");
- SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
- aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH" );
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR");
- SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(theIOR);
- }
-
- CORBA::String_var anEntry = aSObject->GetID();
-
- return anEntry._retn();
-}
-
-
-//===============================================================
-const char* SMESH_Swig::AddNewHypothesis(const char* theIOR)
-{
- MESSAGE("AddNewHypothesis");
-
- SALOMEDS::SObject_var aSObject = ::AddHypothesis(theIOR,
- mySComponentMesh,
- myStudyBuilder);
- CORBA::String_var anEntry = aSObject->GetID();
- return anEntry._retn();
-}
-
-
-//===============================================================
-const char* SMESH_Swig::AddNewAlgorithms(const char* theIOR)
-{
- MESSAGE("AddNewAlgorithms");
-
- SALOMEDS::SObject_var aSObject = ::AddAlgorithms(theIOR,
- mySComponentMesh,
- myStudyBuilder);
- CORBA::String_var anEntry = aSObject->GetID();
- return anEntry._retn();
-}
-
-
-//===============================================================
-void SMESH_Swig::SetShape(const char* theShapeEntry,
- const char* theMeshEntry)
-{
- SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID( theMeshEntry );
- SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID( theShapeEntry );
-
- if(!aMeshSO->_is_nil() && !aGeomShapeSO->_is_nil()){
- SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO, SMESH::Tag_RefOnShape);
- myStudyBuilder->Addreference(aSObject,aGeomShapeSO);
- }
-}
-
-
-//===============================================================
-void SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry)
-{
- ::SetHypothesis(theMeshOrSubMeshEntry,
- theDomainEntry,
- myStudy,
- myStudyBuilder);
-}
-
-
-//===============================================================
-void SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
- const char* theDomainEntry)
-{
- ::SetAlgorithms(theMeshOrSubMeshEntry,
- theDomainEntry,
- myStudy,
- myStudyBuilder);
-}
-
-
-//===============================================================
-void
-SMESH_Swig::UnSetHypothesis(const char* theDomainEntry)
-{
- SALOMEDS::SObject_var aDomainSO = myStudy->FindObjectID(theDomainEntry);
- if(!aDomainSO->_is_nil())
- myStudyBuilder->RemoveObject(aDomainSO);
-}
-
-const char* SMESH_Swig::AddSubMesh(const char* theMeshEntry,
- const char* theSubMeshIOR,
- int theShapeType)
-{
- SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry);
- if(!aMeshSO->_is_nil()){
- long aShapeTag;
- QString aSubMeshName;
- switch(theShapeType){
- case TopAbs_SOLID:
- aShapeTag = SMESH::Tag_SubMeshOnSolid;
- aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnSolid");
- break;
- case TopAbs_FACE:
- aShapeTag = SMESH::Tag_SubMeshOnFace;
- aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnFace");
- break;
- case TopAbs_EDGE:
- aShapeTag = SMESH::Tag_SubMeshOnEdge;
- aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnEdge");
- break;
- case TopAbs_VERTEX:
- aShapeTag = SMESH::Tag_SubMeshOnVertex;
- aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnVertex");
- break;
- default:
- aShapeTag = SMESH::Tag_SubMeshOnCompound;
- aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnCompound");
- }
-
- SALOMEDS::SObject_var aSubMeshesRoot;
- SALOMEDS::GenericAttribute_var anAttr;
- if(!aMeshSO->FindSubObject(aShapeTag,aSubMeshesRoot)){
- aSubMeshesRoot = myStudyBuilder->NewObjectToTag(aMeshSO,aShapeTag);
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeName");
- SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(aSubMeshName.latin1());
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeSelectable");
- SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
- aSelAttr->SetSelectable(false);
- }
-
- SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObject(aSubMeshesRoot);
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
- SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- anIOR->SetValue(theSubMeshIOR);
-
- CORBA::String_var aString = aSObject->GetID();
- return aString._retn();
- }
-
- return "";
-}
-
-const char* SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry,
- const char* theGeomShapeEntry,
- const char* theSubMeshIOR,
- int ShapeType)
-{
- SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID(theGeomShapeEntry);
- if(!aGeomShapeSO->_is_nil()){
- const char * aSubMeshEntry = AddSubMesh(theMeshEntry,theSubMeshIOR,ShapeType);
- SALOMEDS::SObject_var aSubMeshSO = myStudy->FindObjectID(aSubMeshEntry);
- if(!aSubMeshSO->_is_nil()){
- SetShape(theGeomShapeEntry,aSubMeshEntry);
- CORBA::String_var aString = aSubMeshSO->GetID();
- return aString._retn();
- }
- }
-
- return "";
-}
-
-void SMESH_Swig::CreateAndDisplayActor( const char* Mesh_Entry )
-{
- // SMESH_Actor* Mesh = smeshGUI->ReadScript(aM);
- class TEvent: public SALOME_Event
- {
- private:
- const char* _entry;
- public:
- TEvent(const char* Mesh_Entry) {
- _entry = Mesh_Entry;
- }
- virtual void Execute() {
- //SMESH::UpdateView(SMESH::eDisplay, _entry);
- SUIT_Session* aSession = SUIT_Session::session();
- SUIT_Application* anApplication = aSession->activeApplication();
- SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(anApplication);
- SUIT_ViewManager* vman = anApp->getViewManager(VTKViewer_Viewer::Type(),true);
- SMESHGUI_Displayer* aDisp = new SMESHGUI_Displayer(anApp);
- aDisp->Display(_entry,1);
- }
- };
-
- ProcessVoidEvent(new TEvent(Mesh_Entry));
-}
-
-void SMESH_Swig::SetName(const char* theEntry,
- const char* theName)
-{
- SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(theEntry);
- SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::AttributeName_var aName;
- if(!aSObject->_is_nil()){
- anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeName");
- aName = SALOMEDS::AttributeName::_narrow(anAttr);
- aName->SetValue(theName);
- }
-}
-
-//================================================================================
-/*!
- * \brief Set mesh icon according to compute status
- * \param Mesh_Entry - entry of a mesh
- * \param isComputed - is mesh computed or not
- */
-//================================================================================
-
-void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
- const bool theIsComputed,
- const bool isEmpty)
-{
- class TEvent: public SALOME_Event
- {
- SALOMEDS::Study_var myStudy;
- std::string myMeshEntry;
- bool myIsComputed, myIsEmpty;
- public:
- TEvent(const SALOMEDS::Study_var& theStudy,
- const std::string& theMeshEntry,
- const bool theIsComputed,
- const bool isEmpty):
- myStudy(theStudy),
- myMeshEntry(theMeshEntry),
- myIsComputed(theIsComputed),
- myIsEmpty(isEmpty)
- {}
-
- virtual
- void
- Execute()
- {
- SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str());
- if(!aMeshSO->_is_nil())
- if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
- SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
- }
- };
-
- ProcessVoidEvent(new TEvent(myStudy,
- theMeshEntry,
- theIsComputed,
- isEmpty));
-}
+++ /dev/null
-// SMESH SMESH : GUI for SMESH 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 : SMESHGUI_Swig.hxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-
-#ifndef _SMESHGUI_SWIG_HXX_
-#define _SMESHGUI_SWIG_HXX_
-
-#include "SMESH_SMESHGUI.hxx"
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SALOMEDS)
-#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
-
-class SMESHGUI_EXPORT SMESH_Swig
-{
-public:
- SMESH_Swig();
- ~SMESH_Swig();
-
- void Init(int studyID);
-
- const char* AddNewMesh(const char* IOR);
-
- const char* AddNewHypothesis(const char* IOR);
- const char* AddNewAlgorithms(const char* IOR);
-
- void SetShape(const char* ShapeEntry, const char* MeshEntry);
-
- void SetHypothesis(const char* Mesh_Or_SubMesh_Entry, const char* Hypothesis_Entry);
- void SetAlgorithms(const char* Mesh_Or_SubMesh_Entry, const char* Algorithms_Entry);
-
- void UnSetHypothesis(const char* Applied_Hypothesis_Entry );
-
- const char* AddSubMesh (const char* Mesh_Entry, const char* SM_IOR, int ST);
- const char* AddSubMeshOnShape (const char* Mesh_Entry, const char* GeomShape_Entry, const char* SM_IOR, int ST);
-
- void CreateAndDisplayActor( const char* Mesh_Entry );
-
- void SetName(const char* Entry, const char* Name);
-
- /*!
- * \brief Set mesh icon according to compute status
- * \param Mesh_Entry - entry of a mesh
- * \param isComputed - is mesh computed or not
- */
- void SetMeshIcon(const char* Mesh_Entry, const bool isComputed, const bool isEmpty);
-
-private:
- SALOMEDS::Study_var myStudy;
- SALOMEDS::StudyBuilder_var myStudyBuilder;
- SALOMEDS::SComponent_var mySComponentMesh;
-};
-
-
-#endif
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_Swig.i
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-
-%{
-#include "SMESHGUI_Swig.hxx"
-%}
-
-/* Exception handler for all functions */
-%exception {
- class PyAllowThreadsGuard {
- public:
- // Py_BEGIN_ALLOW_THREADS
- PyAllowThreadsGuard() { _save = PyEval_SaveThread(); }
- // Py_END_ALLOW_THREADS
- ~PyAllowThreadsGuard() { PyEval_RestoreThread(_save); }
- private:
- PyThreadState *_save;
- };
-
- PyAllowThreadsGuard guard;
-
- $action
-}
-
-%include "typemaps.i"
-
-class SMESH_Swig
-{
- public:
- SMESH_Swig();
- ~SMESH_Swig();
-
- void Init(int studyID);
-
- const char* AddNewMesh(const char* IOR);
- const char* AddNewHypothesis(const char* IOR);
- const char* AddNewAlgorithms(const char* IOR);
-
- void SetShape(const char* ShapeEntry, const char* MeshEntry);
-
- void SetHypothesis(const char* Mesh_Or_SubMesh_Entry, const char* Hypothesis_Entry);
- void SetAlgorithms(const char* Mesh_Or_SubMesh_Entry, const char* Algorithms_Entry);
-
- void UnSetHypothesis(const char* Applied_Hypothesis_Entry );
-
- const char* AddSubMesh (const char* Mesh_Entry, const char* SM_IOR, int ST);
- const char* AddSubMeshOnShape (const char* Mesh_Entry, const char* GeomShape_Entry, const char* SM_IOR, int ST);
-
- void SetName(const char* Entry, const char* Name);
-
- void SetMeshIcon(const char* Mesh_Entry, const bool isComputed, const bool isEmpty);
-
- void CreateAndDisplayActor( const char* Mesh_Entry );
-};
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_SymmetryDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_SymmetryDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_SymmetryDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-#include "SMDS_Mesh.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
+#include <SMDS_Mesh.hxx>
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "LightApp_Application.h"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SVTK_Selection.h"
-#include "SALOME_ListIO.hxx"
-#include "SALOMEDSClient_SObject.hxx"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-#include "utilities.h"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_SObject.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+
+// Qt includes
+#include <QApplication>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
-
enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action type
+#define SPACING 6
+#define MARGIN 11
+
//=================================================================================
// class : SMESHGUI_SymmetryDlg()
// purpose :
//=================================================================================
-SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_POINT")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_AXIS")));
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_SYMMETRY_PLANE")));
QPixmap image3 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_SymmetryDlg");
- resize(303, 185);
- setCaption(tr("SMESH_SYMMETRY"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_SymmetryDlgLayout = new QGridLayout(this);
- SMESHGUI_SymmetryDlgLayout->setSpacing(6);
- SMESHGUI_SymmetryDlgLayout->setMargin(11);
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("SMESH_SYMMETRY"));
+ setSizeGripEnabled(true);
- /***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupConstructors->sizePolicy().hasHeightForWidth()));
- GroupConstructors->setTitle(tr("SMESH_SYMMETRY" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- QHBoxLayout* RBLayout = new QHBoxLayout(0, 0, 6, "Layout2");
- RadioButton1= new QRadioButton(GroupConstructors, "RadioButton1");
- RadioButton1->setText(tr("" ));
- RadioButton1->setPixmap(image0);
- RBLayout->addWidget(RadioButton1);
- RadioButton2= new QRadioButton(GroupConstructors, "RadioButton2");
- RadioButton2->setText(tr("" ));
- RadioButton2->setPixmap(image1);
- RBLayout->addWidget(RadioButton2);
- RadioButton3= new QRadioButton(GroupConstructors, "RadioButton3");
- RadioButton3->setText(tr("" ));
- RadioButton3->setPixmap(image2);
- RBLayout->addWidget(RadioButton3);
- GroupConstructorsLayout->addLayout(RBLayout, 0, 0);
- SMESHGUI_SymmetryDlgLayout->addWidget(GroupConstructors, 0, 0);
+ QVBoxLayout* SMESHGUI_SymmetryDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_SymmetryDlgLayout->setSpacing(SPACING);
+ SMESHGUI_SymmetryDlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7,
- (QSizePolicy::SizeType)0, 0, 0,
- GroupButtons->sizePolicy().hasHeightForWidth()));
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_SymmetryDlgLayout->addWidget(GroupButtons, 2, 0);
+ ConstructorsBox = new QGroupBox(tr("SMESH_SYMMETRY"), this);
+ GroupConstructors = new QButtonGroup(this);
+ QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
+ ConstructorsBoxLayout->setSpacing(SPACING);
+ ConstructorsBoxLayout->setMargin(MARGIN);
+
+ RadioButton1 = new QRadioButton(ConstructorsBox);
+ RadioButton1->setIcon(image0);
+ RadioButton2 = new QRadioButton(ConstructorsBox);
+ RadioButton2->setIcon(image1);
+ RadioButton3 = new QRadioButton(ConstructorsBox);
+ RadioButton3->setIcon(image2);
+
+ ConstructorsBoxLayout->addWidget(RadioButton1);
+ ConstructorsBoxLayout->addWidget(RadioButton2);
+ ConstructorsBoxLayout->addWidget(RadioButton3);
+ GroupConstructors->addButton(RadioButton1, 0);
+ GroupConstructors->addButton(RadioButton2, 1);
+ GroupConstructors->addButton(RadioButton3, 2);
/***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setTitle(tr("SMESH_ARGUMENTS"));
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6);
- GroupArgumentsLayout->setMargin(11);
+ GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
// Controls for elements selection
- TextLabelElements = new QLabel(GroupArguments, "TextLabelElements");
- TextLabelElements->setText(tr("SMESH_ID_ELEMENTS" ));
- //TextLabelElements->setFixedWidth(74);
- GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
- //GroupArgumentsLayout->addMultiCellWidget(TextLabelElements, 0, 0, 0, 1);
-
- SelectElementsButton = new QPushButton(GroupArguments, "SelectElementsButton");
- SelectElementsButton->setText(tr("" ));
- SelectElementsButton->setPixmap(image3);
- SelectElementsButton->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
-
- LineEditElements = new QLineEdit(GroupArguments, "LineEditElements");
- LineEditElements->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- //GroupArgumentsLayout->addWidget(LineEditElements, 0, 3);
- GroupArgumentsLayout->addMultiCellWidget(LineEditElements, 0, 0, 2, 4);
+ TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
+ SelectElementsButton = new QPushButton(GroupArguments);
+ SelectElementsButton->setIcon(image3);
+ LineEditElements = new QLineEdit(GroupArguments);
+ LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
// Control for the whole mesh selection
- CheckBoxMesh = new QCheckBox(GroupArguments, "CheckBoxMesh");
- CheckBoxMesh->setText(tr("SMESH_SELECT_WHOLE_MESH" ));
- GroupArgumentsLayout->addMultiCellWidget(CheckBoxMesh, 1, 1, 0, 4);
+ CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
// Controls for mirror selection
- GroupMirror = new QGroupBox(GroupArguments, "GroupMirror");
- GroupMirror->setColumnLayout(0, Qt::Vertical);
- GroupMirror->layout()->setSpacing(0);
- GroupMirror->layout()->setMargin(0);
- QGridLayout* GroupMirrorLayout = new QGridLayout(GroupMirror->layout());
- GroupMirrorLayout->setAlignment(Qt::AlignTop);
- GroupMirrorLayout->setSpacing(6);
- GroupMirrorLayout->setMargin(11);
-
- TextLabelPoint = new QLabel(GroupMirror, "TextLabelPoint");
- TextLabelPoint->setText(tr("SMESH_POINT"));
- GroupMirrorLayout->addWidget(TextLabelPoint, 0, 0);
-
- SelectPointButton = new QPushButton(GroupMirror, "SelectPointButton");
- SelectPointButton->setPixmap(image3);
- GroupMirrorLayout->addWidget(SelectPointButton, 0, 1);
-
- TextLabelX = new QLabel(GroupMirror, "TextLabelX");
- TextLabelX->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelX->setText(tr("SMESH_X"));
- GroupMirrorLayout->addWidget(TextLabelX, 0, 2);
-
- SpinBox_X = new SMESHGUI_SpinBox(GroupMirror, "SpinBox_X");
- GroupMirrorLayout->addWidget(SpinBox_X, 0, 3);
-
- TextLabelY = new QLabel(GroupMirror, "TextLabelY");
- TextLabelY->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelY->setText(tr("SMESH_Y"));
- GroupMirrorLayout->addWidget(TextLabelY, 0, 4);
-
- SpinBox_Y = new SMESHGUI_SpinBox(GroupMirror, "SpinBox_Y");
- GroupMirrorLayout->addWidget(SpinBox_Y, 0, 5);
-
- TextLabelZ = new QLabel(GroupMirror, "TextLabelZ");
- TextLabelZ->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabelZ->setText(tr("SMESH_Z"));
- GroupMirrorLayout->addWidget(TextLabelZ, 0, 6);
-
- SpinBox_Z = new SMESHGUI_SpinBox(GroupMirror, "SpinBox_Z");
- GroupMirrorLayout->addWidget(SpinBox_Z, 0, 7);
-
- TextLabelVector = new QLabel(GroupMirror, "TextLabelVector");
- GroupMirrorLayout->addWidget(TextLabelVector, 1, 0);
-
- SelectVectorButton = new QPushButton(GroupMirror, "SelectVectorButton");
- SelectVectorButton->setPixmap(image3);
+ GroupMirror = new QGroupBox(GroupArguments);
+ QGridLayout* GroupMirrorLayout = new QGridLayout(GroupMirror);
+ GroupMirrorLayout->setSpacing(SPACING);
+ GroupMirrorLayout->setMargin(MARGIN);
+
+ TextLabelPoint = new QLabel(tr("SMESH_POINT"), GroupMirror);
+ SelectPointButton = new QPushButton(GroupMirror);
+ SelectPointButton->setIcon(image3);
+
+ TextLabelX = new QLabel(tr("SMESH_X"), GroupMirror);
+ SpinBox_X = new SMESHGUI_SpinBox(GroupMirror);
+ TextLabelY = new QLabel(tr("SMESH_Y"), GroupMirror);
+ SpinBox_Y = new SMESHGUI_SpinBox(GroupMirror);
+ TextLabelZ = new QLabel(tr("SMESH_Z"), GroupMirror);
+ SpinBox_Z = new SMESHGUI_SpinBox(GroupMirror);
+
+ TextLabelVector = new QLabel(GroupMirror);
+ SelectVectorButton = new QPushButton(GroupMirror);
+ SelectVectorButton->setIcon(image3);
+
+ TextLabelDX = new QLabel(tr("SMESH_DX"), GroupMirror);
+ SpinBox_DX = new SMESHGUI_SpinBox(GroupMirror);
+ TextLabelDY = new QLabel(tr("SMESH_DY"), GroupMirror);
+ SpinBox_DY = new SMESHGUI_SpinBox(GroupMirror);
+ TextLabelDZ = new QLabel(tr("SMESH_DZ"), GroupMirror);
+ SpinBox_DZ = new SMESHGUI_SpinBox(GroupMirror);
+
+ GroupMirrorLayout->addWidget(TextLabelPoint, 0, 0);
+ GroupMirrorLayout->addWidget(SelectPointButton, 0, 1);
+ GroupMirrorLayout->addWidget(TextLabelX, 0, 2);
+ GroupMirrorLayout->addWidget(SpinBox_X, 0, 3);
+ GroupMirrorLayout->addWidget(TextLabelY, 0, 4);
+ GroupMirrorLayout->addWidget(SpinBox_Y, 0, 5);
+ GroupMirrorLayout->addWidget(TextLabelZ, 0, 6);
+ GroupMirrorLayout->addWidget(SpinBox_Z, 0, 7);
+ GroupMirrorLayout->addWidget(TextLabelVector, 1, 0);
GroupMirrorLayout->addWidget(SelectVectorButton, 1, 1);
-
- TextLabelDX = new QLabel(GroupMirror, "TextLabelDX");
- TextLabelDX->setText(tr("SMESH_DX"));
- TextLabelDX->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- GroupMirrorLayout->addWidget(TextLabelDX, 1, 2);
-
- SpinBox_DX = new SMESHGUI_SpinBox(GroupMirror, "SpinBox_DX");
- GroupMirrorLayout->addWidget(SpinBox_DX, 1, 3);
-
- TextLabelDY = new QLabel(GroupMirror, "TextLabelDY");
- TextLabelDY->setText(tr("SMESH_DY"));
- TextLabelDY->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- GroupMirrorLayout->addWidget(TextLabelDY, 1, 4);
-
- SpinBox_DY = new SMESHGUI_SpinBox(GroupMirror, "SpinBox_DY");
- GroupMirrorLayout->addWidget(SpinBox_DY, 1, 5);
-
- TextLabelDZ = new QLabel(GroupMirror, "TextLabelDZ");
- TextLabelDZ->setText(tr("SMESH_DZ"));
- TextLabelDZ->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- GroupMirrorLayout->addWidget(TextLabelDZ, 1, 6);
-
- SpinBox_DZ = new SMESHGUI_SpinBox(GroupMirror, "SpinBox_DZ");
- GroupMirrorLayout->addWidget(SpinBox_DZ, 1, 7);
-
- GroupArgumentsLayout->addMultiCellWidget(GroupMirror, 2, 2, 0, 4);
+ GroupMirrorLayout->addWidget(TextLabelDX, 1, 2);
+ GroupMirrorLayout->addWidget(SpinBox_DX, 1, 3);
+ GroupMirrorLayout->addWidget(TextLabelDY, 1, 4);
+ GroupMirrorLayout->addWidget(SpinBox_DY, 1, 5);
+ GroupMirrorLayout->addWidget(TextLabelDZ, 1, 6);
+ GroupMirrorLayout->addWidget(SpinBox_DZ, 1, 7);
// switch of action type
- ActionGroup = new QButtonGroup(1, Qt::Horizontal, GroupArguments, "ActionGroup");
- ActionGroup->setExclusive(true);
- ActionGroup->insert(new QRadioButton(tr("SMESH_MOVE_ELEMENTS"),ActionGroup), MOVE_ELEMS_BUTTON);
- ActionGroup->insert(new QRadioButton(tr("SMESH_COPY_ELEMENTS"),ActionGroup), COPY_ELEMS_BUTTON);
- ActionGroup->insert(new QRadioButton(tr("SMESH_CREATE_MESH" ),ActionGroup), MAKE_MESH_BUTTON);
- GroupArgumentsLayout->addMultiCellWidget(ActionGroup, 3, 5, 0, 3);
+ ActionBox = new QGroupBox(tr("ACTION"), GroupArguments);
+ ActionGroup = new QButtonGroup(GroupArguments);
+ QVBoxLayout* ActionBoxLayout = new QVBoxLayout(ActionBox);
+ ActionBoxLayout->addSpacing(SPACING);
+ ActionBoxLayout->setMargin(MARGIN);
+
+ QRadioButton* aMoveElements = new QRadioButton(tr("SMESH_MOVE_ELEMENTS"), ActionBox);
+ QRadioButton* aCopyElements = new QRadioButton(tr("SMESH_COPY_ELEMENTS"), ActionBox);
+ QRadioButton* aCreateMesh = new QRadioButton(tr("SMESH_CREATE_MESH"), ActionBox);
+
+ ActionBoxLayout->addWidget(aMoveElements);
+ ActionBoxLayout->addWidget(aCopyElements);
+ ActionBoxLayout->addWidget(aCreateMesh);
+ ActionGroup->addButton(aMoveElements, MOVE_ELEMS_BUTTON);
+ ActionGroup->addButton(aCopyElements, COPY_ELEMS_BUTTON);
+ ActionGroup->addButton(aCreateMesh, MAKE_MESH_BUTTON);
// CheckBox for groups generation
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
MakeGroupsCheck->setChecked(false);
- GroupArgumentsLayout->addWidget(MakeGroupsCheck, 4, 4);
// Name of a mesh to create
- LineEditNewMesh = new QLineEdit(GroupArguments, "LineEditNewMesh");
- GroupArgumentsLayout->addWidget(LineEditNewMesh, 5, 4);
+ LineEditNewMesh = new QLineEdit(GroupArguments);
+
+ // layout
+ GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
+ GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 2);
+ GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 4);
+ GroupArgumentsLayout->addWidget(GroupMirror, 2, 0, 1, 4);
+ GroupArgumentsLayout->addWidget(ActionBox, 3, 0, 3, 3);
+ GroupArgumentsLayout->addWidget(MakeGroupsCheck, 4, 4);
+ GroupArgumentsLayout->addWidget(LineEditNewMesh, 5, 4);
- SMESHGUI_SymmetryDlgLayout->addWidget(GroupArguments, 1, 0);
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ SMESHGUI_SymmetryDlgLayout->addWidget(ConstructorsBox);
+ SMESHGUI_SymmetryDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_SymmetryDlgLayout->addWidget(GroupButtons);
/* Initialisations */
SpinBox_X->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_DY->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
SpinBox_DZ->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, 3);
- GroupArguments->show();
- RadioButton1->setChecked(TRUE);
+ RadioButton1->setChecked(true);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
Init();
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
- connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(SelectPointButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
- connect(SelectVectorButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(SelectElementsButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(SelectPointButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+ connect(SelectVectorButton, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
connect(SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(onVectorChanged()));
connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
- connect(ActionGroup, SIGNAL(clicked(int)), SLOT(onActionClicked(int)));
-
- this->show(); /* displays Dialog */
+ connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
ConstructorsClicked(0);
SelectionIntoArgument();
onActionClicked(MOVE_ELEMS_BUTTON);
- resize(0,0); // ??
}
//=================================================================================
//=================================================================================
SMESHGUI_SymmetryDlg::~SMESHGUI_SymmetryDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
SpinBox_DY->SetValue(0.0);
SpinBox_DZ->SetValue(0.0);
- ((QRadioButton*) ActionGroup->find( MOVE_ELEMS_BUTTON ))->setChecked(TRUE);
+ ActionGroup->button( MOVE_ELEMS_BUTTON )->setChecked(true);
CheckBoxMesh->setChecked(false);
// MakeGroupsCheck->setChecked(false);
// MakeGroupsCheck->setEnabled(false);
onSelectMesh(true);
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ QApplication::instance()->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
}
//=================================================================================
return;
if (myNbOkElements && IsMirrorOk()) {
- QStringList aListElementsId = QStringList::split(" ", myElementsId, false);
+ QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId = new SMESH::long_array;
if (GetConstructorId() == 2)
aMirrorType = SMESH::SMESH_MeshEditor::PLANE;
- int actionButton = ActionGroup->id( ActionGroup->selected() );
+ int actionButton = ActionGroup->checkedId();
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
switch ( actionButton ) {
case MOVE_ELEMS_BUTTON:
aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
case MAKE_MESH_BUTTON:
SMESH::SMESH_Mesh_var mesh =
aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
- LineEditNewMesh->text().latin1());
+ LineEditNewMesh->text().toLatin1().data());
}
QApplication::restoreOverrideCursor();
} catch (...) {
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
if (send == LineEditElements) {
for (int i = 0; i < aListId.count(); i++) {
MakeGroupsCheck->setChecked(false);
MakeGroupsCheck->setEnabled(false);
}
- else if ( ActionGroup->id( ActionGroup->selected() ) != MOVE_ELEMS_BUTTON ) {
+ else if ( ActionGroup->checkedId() != MOVE_ELEMS_BUTTON ) {
MakeGroupsCheck->setEnabled(true);
}
if (CheckBoxMesh->isChecked()) {
//=================================================================================
void SMESHGUI_SymmetryDlg::DeactivateActiveDialog()
{
- if (GroupConstructors->isEnabled()) {
- GroupConstructors->setEnabled(false);
+ if (ConstructorsBox->isEnabled()) {
+ ConstructorsBox->setEnabled(false);
GroupArguments->setEnabled(false);
GroupButtons->setEnabled(false);
mySMESHGUI->ResetState();
{
/* Emit a signal to deactivate the active dialog */
mySMESHGUI->EmitSignalDeactivateDialog();
- GroupConstructors->setEnabled(true);
+ ConstructorsBox->setEnabled(true);
GroupArguments->setEnabled(true);
GroupButtons->setEnabled(true);
//=================================================================================
void SMESHGUI_SymmetryDlg::enterEvent (QEvent*)
{
- if (!GroupConstructors->isEnabled())
+ if (!ConstructorsBox->isEnabled())
ActivateThisDialog();
}
void SMESHGUI_SymmetryDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
//=================================================================================
int SMESHGUI_SymmetryDlg::GetConstructorId()
{
- if (GroupConstructors != NULL && GroupConstructors->selected() != NULL)
- return GroupConstructors->id(GroupConstructors->selected());
- return -1;
+ return GroupConstructors->checkedId();
}
//=================================================================================
}
else {
_PTR(SObject) meshSO = SMESH::FindSObject( myMesh );
- name = meshSO->GetName();
+ name = meshSO->GetName().c_str();
}
if ( !name.isEmpty() )
- LineEditNewMesh->setText( SMESH::UniqueMeshName( name.latin1(), "mirrored"));
+ LineEditNewMesh->setText( SMESH::UniqueMeshName( name, "mirrored"));
}
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_SymmetryDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_SymmetryDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_SYMMETRY_H
-#define DIALOGBOX_SYMMETRY_H
+#ifndef SMESHGUI_SYMMETRYDLG_H
+#define SMESHGUI_SYMMETRYDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
+// Qt includes
+#include <QDialog>
-#include "SMESH_LogicalFilter.hxx"
-
-// QT Includes
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
-class QHBoxLayout;
class QButtonGroup;
class QGroupBox;
class QLabel;
class SMESHGUI_SpinBox;
class SMESHGUI;
class SMESH_Actor;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
+class LightApp_SelectionMgr;
+class SMESH_LogicalFilter;
//=================================================================================
// class : SMESHGUI_SymmetryDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_SymmetryDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_SymmetryDlg( SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_SymmetryDlg();
+ SMESHGUI_SymmetryDlg( SMESHGUI* );
+ ~SMESHGUI_SymmetryDlg();
private:
- void Init (bool ResetControls = true);
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
- int GetConstructorId();
- bool IsMirrorOk();
- void setNewMeshName();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- int myNbOkElements; /* to check when elements are defined */
- QString myElementsId;
- SVTK_Selector* mySelector;
-
- QWidget* myEditCurrentArgument; /* Current LineEdit */
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
- SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
+ void Init( bool = true );
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ int GetConstructorId();
+ bool IsMirrorOk();
+ void setNewMeshName();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ int myNbOkElements; /* to check when elements are defined */
+ QString myElementsId;
+ SVTK_Selector* mySelector;
+
+ QWidget* myEditCurrentArgument; /* Current LineEdit */
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton1;
- QRadioButton* RadioButton2;
- QRadioButton* RadioButton3;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupArguments;
- QGroupBox* GroupMirror;
- QLabel* TextLabelElements;
- QPushButton* SelectElementsButton;
- QLineEdit* LineEditElements;
- QCheckBox* CheckBoxMesh;
-
- QLabel* TextLabelPoint;
- QPushButton* SelectPointButton;
- QLabel* TextLabelX;
- SMESHGUI_SpinBox* SpinBox_X;
- QLabel* TextLabelY;
- SMESHGUI_SpinBox* SpinBox_Y;
- QLabel* TextLabelZ;
- SMESHGUI_SpinBox* SpinBox_Z;
- QLabel* TextLabelVector;
- QPushButton* SelectVectorButton;
- QLabel* TextLabelDX;
- SMESHGUI_SpinBox* SpinBox_DX;
- QLabel* TextLabelDY;
- SMESHGUI_SpinBox* SpinBox_DY;
- QLabel* TextLabelDZ;
- SMESHGUI_SpinBox* SpinBox_DZ;
+ QGroupBox* ConstructorsBox;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QRadioButton* RadioButton3;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupArguments;
+ QGroupBox* GroupMirror;
+ QLabel* TextLabelElements;
+ QPushButton* SelectElementsButton;
+ QLineEdit* LineEditElements;
+ QCheckBox* CheckBoxMesh;
+
+ QLabel* TextLabelPoint;
+ QPushButton* SelectPointButton;
+ QLabel* TextLabelX;
+ SMESHGUI_SpinBox* SpinBox_X;
+ QLabel* TextLabelY;
+ SMESHGUI_SpinBox* SpinBox_Y;
+ QLabel* TextLabelZ;
+ SMESHGUI_SpinBox* SpinBox_Z;
+ QLabel* TextLabelVector;
+ QPushButton* SelectVectorButton;
+ QLabel* TextLabelDX;
+ SMESHGUI_SpinBox* SpinBox_DX;
+ QLabel* TextLabelDY;
+ SMESHGUI_SpinBox* SpinBox_DY;
+ QLabel* TextLabelDZ;
+ SMESHGUI_SpinBox* SpinBox_DZ;
- //QCheckBox* CheckBoxCopy;
- QButtonGroup* ActionGroup;
- QCheckBox* MakeGroupsCheck;
- QLineEdit* LineEditNewMesh;
+ QGroupBox* ActionBox;
+ QButtonGroup* ActionGroup;
+ QCheckBox* MakeGroupsCheck;
+ QLineEdit* LineEditNewMesh;
- QString myHelpFileName;
+ QString myHelpFileName;
- private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void onTextChange(const QString&);
- void onSelectMesh(bool toSelectMesh);
- void onVectorChanged();
- void onActionClicked(int button);
-
-protected:
- QGridLayout* SMESHGUI_SymmetryDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupArgumentsLayout;
+private slots:
+ void ConstructorsClicked( int );
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onSelectMesh( bool );
+ void onVectorChanged();
+ void onActionClicked( int );
};
-#endif // DIALOGBOX_SYMMETRY_H
+#endif // SMESHGUI_SYMMETRYDLG_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_TranslationDlg.cxx
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_TranslationDlg.cxx
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_TranslationDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMESHGUI_IdValidator.h"
-#include "SMESH_Actor.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_LogicalFilter.hxx"
-#include "SMDS_Mesh.hxx"
+#include <SMESH_Actor.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_LogicalFilter.hxx>
+#include <SMDS_Mesh.hxx>
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "LightApp_Application.h"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_Selection.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SALOME_ListIO.hxx"
-#include "SALOMEDSClient_SObject.hxx"
+#include <SVTK_ViewModel.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-#include "utilities.h"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_SObject.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
-
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qspinbox.h>
-#include <qpixmap.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+
+// Qt includes
+#include <QApplication>
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QSpinBox>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
-
enum { MOVE_ELEMS_BUTTON = 0, COPY_ELEMS_BUTTON, MAKE_MESH_BUTTON }; //!< action type
+#define SPACING 6
+#define MARGIN 11
+
//=================================================================================
// class : SMESHGUI_TranslationDlg()
// purpose :
//=================================================================================
-SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+SMESHGUI_TranslationDlg::SMESHGUI_TranslationDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_POINTS")));
QPixmap image1 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SMESH_TRANSLATION_VECTOR")));
QPixmap image2 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT")));
- if (!name)
- setName("SMESHGUI_TranslationDlg");
- resize(303, 185);
- setCaption(tr("SMESH_TRANSLATION"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_TranslationDlgLayout = new QGridLayout(this);
- SMESHGUI_TranslationDlgLayout->setSpacing(6);
- SMESHGUI_TranslationDlgLayout->setMargin(11);
+ setModal(false);
+ setAttribute(Qt::WA_DeleteOnClose, true);
+ setWindowTitle(tr("SMESH_TRANSLATION"));
+ setSizeGripEnabled(true);
- /***************************************************************/
- GroupConstructors = new QButtonGroup(this, "GroupConstructors");
- GroupConstructors->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupConstructors->sizePolicy().hasHeightForWidth()));
- GroupConstructors->setTitle(tr("SMESH_TRANSLATION" ));
- GroupConstructors->setExclusive(TRUE);
- GroupConstructors->setColumnLayout(0, Qt::Vertical);
- GroupConstructors->layout()->setSpacing(0);
- GroupConstructors->layout()->setMargin(0);
- GroupConstructorsLayout = new QGridLayout(GroupConstructors->layout());
- GroupConstructorsLayout->setAlignment(Qt::AlignTop);
- GroupConstructorsLayout->setSpacing(6);
- GroupConstructorsLayout->setMargin(11);
- RadioButton1= new QRadioButton(GroupConstructors, "RadioButton1");
- RadioButton1->setText(tr("" ));
- RadioButton1->setPixmap(image0);
- GroupConstructorsLayout->addWidget(RadioButton1, 0, 0);
- RadioButton2= new QRadioButton(GroupConstructors, "RadioButton2");
- RadioButton2->setText(tr("" ));
- RadioButton2->setPixmap(image1);
- GroupConstructorsLayout->addWidget(RadioButton2, 0, 2 );
- SMESHGUI_TranslationDlgLayout->addWidget(GroupConstructors, 0, 0);
+ QVBoxLayout* SMESHGUI_TranslationDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_TranslationDlgLayout->setSpacing(SPACING);
+ SMESHGUI_TranslationDlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth()));
- GroupButtons->setGeometry(QRect(10, 10, 281, 48));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 4);
- buttonCancel = new QPushButton(GroupButtons, "buttonCancel");
- buttonCancel->setText(tr("SMESH_BUT_CLOSE" ));
- buttonCancel->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonCancel, 0, 3);
- buttonApply = new QPushButton(GroupButtons, "buttonApply");
- buttonApply->setText(tr("SMESH_BUT_APPLY" ));
- buttonApply->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonApply, 0, 1);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 2);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_TranslationDlgLayout->addWidget(GroupButtons, 2, 0);
+ ConstructorsBox = new QGroupBox(tr("SMESH_TRANSLATION"), this);
+ GroupConstructors = new QButtonGroup(this);
+ QHBoxLayout* ConstructorsBoxLayout = new QHBoxLayout(ConstructorsBox);
+ ConstructorsBoxLayout->setSpacing(SPACING);
+ ConstructorsBoxLayout->setMargin(MARGIN);
+
+ RadioButton1= new QRadioButton(ConstructorsBox);
+ RadioButton1->setIcon(image0);
+ RadioButton2= new QRadioButton(ConstructorsBox);
+ RadioButton2->setIcon(image1);
+
+ ConstructorsBoxLayout->addWidget(RadioButton1);
+ ConstructorsBoxLayout->addWidget(RadioButton2);
+ GroupConstructors->addButton(RadioButton1, 0);
+ GroupConstructors->addButton(RadioButton2, 1);
/***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setTitle(tr("SMESH_ARGUMENTS"));
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6);
- GroupArgumentsLayout->setMargin(11);
+ GroupArguments = new QGroupBox(tr("SMESH_ARGUMENTS"), this);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
// Controls for elements selection
- TextLabelElements = new QLabel(GroupArguments, "TextLabelElements");
- TextLabelElements->setText(tr("SMESH_ID_ELEMENTS" ));
- TextLabelElements->setFixedWidth(74);
- GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
-
- SelectElementsButton = new QPushButton(GroupArguments, "SelectElementsButton");
- SelectElementsButton->setText(tr("" ));
- SelectElementsButton->setPixmap(image2);
- SelectElementsButton->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
-
- LineEditElements = new QLineEdit(GroupArguments, "LineEditElements");
- LineEditElements->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupArgumentsLayout->addMultiCellWidget(LineEditElements, 0, 0, 2, 7);
+ TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
+ SelectElementsButton = new QPushButton(GroupArguments);
+ SelectElementsButton->setIcon(image2);
+ LineEditElements = new QLineEdit(GroupArguments);
+ LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
// Control for the whole mesh selection
- CheckBoxMesh = new QCheckBox(GroupArguments, "CheckBoxMesh");
- CheckBoxMesh->setText(tr("SMESH_SELECT_WHOLE_MESH" ));
- GroupArgumentsLayout->addMultiCellWidget(CheckBoxMesh, 1, 1, 0, 7);
+ CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
// Controls for vector and points selection
- TextLabel1 = new QLabel(GroupArguments, "TextLabel1");
- GroupArgumentsLayout->addWidget(TextLabel1, 2, 0);
-
- SelectButton1 = new QPushButton(GroupArguments, "SelectButton1");
- SelectButton1->setText(tr("" ));
- SelectButton1->setPixmap(image2);
- SelectButton1->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectButton1, 2, 1);
-
- TextLabel1_1 = new QLabel(GroupArguments, "TextLabel1_1");
- TextLabel1_1->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- GroupArgumentsLayout->addWidget(TextLabel1_1, 2, 2);
-
- SpinBox1_1 = new SMESHGUI_SpinBox(GroupArguments, "SpinBox1_1");
- GroupArgumentsLayout->addWidget(SpinBox1_1, 2, 3);
-
- TextLabel1_2 = new QLabel(GroupArguments, "TextLabel1_2");
- TextLabel1_2->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- GroupArgumentsLayout->addWidget(TextLabel1_2, 2, 4);
-
- SpinBox1_2 = new SMESHGUI_SpinBox(GroupArguments, "SpinBox1_2");
- GroupArgumentsLayout->addWidget(SpinBox1_2, 2, 5);
-
- TextLabel1_3 = new QLabel(GroupArguments, "TextLabel1_3");
- TextLabel1_3->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- GroupArgumentsLayout->addWidget(TextLabel1_3, 2, 6);
-
- SpinBox1_3 = new SMESHGUI_SpinBox(GroupArguments, "SpinBox1_3");
- GroupArgumentsLayout->addWidget(SpinBox1_3, 2, 7);
-
- TextLabel2 = new QLabel(GroupArguments, "TextLabel2");
- TextLabel2->setText(tr("SMESH_POINT_2" ));
- GroupArgumentsLayout->addWidget(TextLabel2, 3, 0);
-
- SelectButton2 = new QPushButton(GroupArguments, "SelectButton2");
- SelectButton2->setText(tr("" ));
- SelectButton2->setPixmap(image2);
- SelectButton2->setToggleButton(FALSE);
- GroupArgumentsLayout->addWidget(SelectButton2, 3, 1);
-
- TextLabel2_1 = new QLabel(GroupArguments, "TextLabel2_1");
- TextLabel2_1->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabel2_1->setText(tr("SMESH_X" ));
- GroupArgumentsLayout->addWidget(TextLabel2_1, 3, 2);
-
- SpinBox2_1 = new SMESHGUI_SpinBox(GroupArguments, "SpinBox2_1");
- GroupArgumentsLayout->addWidget(SpinBox2_1, 3, 3);
-
- TextLabel2_2 = new QLabel(GroupArguments, "TextLabel2_2");
- TextLabel2_2->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabel2_2->setText(tr("SMESH_Y" ));
- GroupArgumentsLayout->addWidget(TextLabel2_2, 3, 4);
-
- SpinBox2_2 = new SMESHGUI_SpinBox(GroupArguments, "SpinBox2_2");
- GroupArgumentsLayout->addWidget(SpinBox2_2, 3, 5);
-
- TextLabel2_3 = new QLabel(GroupArguments, "TextLabel2_3");
- TextLabel2_3->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::ExpandTabs );
- TextLabel2_3->setText(tr("SMESH_Z"));
- GroupArgumentsLayout->addWidget(TextLabel2_3, 3, 6);
-
- SpinBox2_3 = new SMESHGUI_SpinBox(GroupArguments, "SpinBox2_3");
- GroupArgumentsLayout->addWidget(SpinBox2_3, 3, 7);
-
- // Controls for "Create a copy" option
-// CheckBoxCopy = new QCheckBox(GroupArguments, "CheckBoxCopy");
-// CheckBoxCopy->setText(tr("SMESH_CREATE_COPY"));
-// GroupArgumentsLayout->addMultiCellWidget(CheckBoxCopy, 4, 4, 0, 2);
+ TextLabel1 = new QLabel(GroupArguments);
+ SelectButton1 = new QPushButton(GroupArguments);
+ SelectButton1->setIcon(image2);
+
+ TextLabel1_1 = new QLabel(GroupArguments);
+ SpinBox1_1 = new SMESHGUI_SpinBox(GroupArguments);
+ TextLabel1_2 = new QLabel(GroupArguments);
+ SpinBox1_2 = new SMESHGUI_SpinBox(GroupArguments);
+ TextLabel1_3 = new QLabel(GroupArguments);
+ SpinBox1_3 = new SMESHGUI_SpinBox(GroupArguments);
+
+ TextLabel2 = new QLabel(tr("SMESH_POINT_2"), GroupArguments);
+ SelectButton2 = new QPushButton(GroupArguments);
+ SelectButton2->setIcon(image2);
+
+ TextLabel2_1 = new QLabel(tr("SMESH_X"), GroupArguments);
+ SpinBox2_1 = new SMESHGUI_SpinBox(GroupArguments);
+ TextLabel2_2 = new QLabel(tr("SMESH_Y"), GroupArguments);
+ SpinBox2_2 = new SMESHGUI_SpinBox(GroupArguments);
+ TextLabel2_3 = new QLabel(tr("SMESH_Z"), GroupArguments);
+ SpinBox2_3 = new SMESHGUI_SpinBox(GroupArguments);
// switch of action type
- ActionGroup = new QButtonGroup(1, Qt::Horizontal, GroupArguments, "ActionGroup");
- ActionGroup->setExclusive(true);
- ActionGroup->insert(new QRadioButton(tr("SMESH_MOVE_ELEMENTS"),ActionGroup), MOVE_ELEMS_BUTTON);
- ActionGroup->insert(new QRadioButton(tr("SMESH_COPY_ELEMENTS"),ActionGroup), COPY_ELEMS_BUTTON);
- ActionGroup->insert(new QRadioButton(tr("SMESH_CREATE_MESH" ),ActionGroup), MAKE_MESH_BUTTON);
- GroupArgumentsLayout->addMultiCellWidget(ActionGroup, 4, 6, 0, 3);
+ ActionBox = new QGroupBox(tr("ACTION"), GroupArguments);
+ ActionGroup = new QButtonGroup(GroupArguments);
+ QVBoxLayout* ActionBoxLayout = new QVBoxLayout(ActionBox);
+ ActionBoxLayout->addSpacing(SPACING);
+ ActionBoxLayout->setMargin(MARGIN);
+
+ QRadioButton* aMoveElements = new QRadioButton(tr("SMESH_MOVE_ELEMENTS"), ActionBox);
+ QRadioButton* aCopyElements = new QRadioButton(tr("SMESH_COPY_ELEMENTS"), ActionBox);
+ QRadioButton* aCreateMesh = new QRadioButton(tr("SMESH_CREATE_MESH"), ActionBox);
+
+ ActionBoxLayout->addWidget(aMoveElements);
+ ActionBoxLayout->addWidget(aCopyElements);
+ ActionBoxLayout->addWidget(aCreateMesh);
+ ActionGroup->addButton(aMoveElements, MOVE_ELEMS_BUTTON);
+ ActionGroup->addButton(aCopyElements, COPY_ELEMS_BUTTON);
+ ActionGroup->addButton(aCreateMesh, MAKE_MESH_BUTTON);
// CheckBox for groups generation
MakeGroupsCheck = new QCheckBox(tr("SMESH_MAKE_GROUPS"), GroupArguments);
MakeGroupsCheck->setChecked(false);
- GroupArgumentsLayout->addMultiCellWidget(MakeGroupsCheck, 5, 5, 4, 7);
// Name of a mesh to create
- LineEditNewMesh = new QLineEdit(GroupArguments, "LineEditNewMesh");
- GroupArgumentsLayout->addMultiCellWidget(LineEditNewMesh, 6, 6, 4, 7);
+ LineEditNewMesh = new QLineEdit(GroupArguments);
+
+ // layout
+ GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
+ GroupArgumentsLayout->addWidget(SelectElementsButton, 0, 1);
+ GroupArgumentsLayout->addWidget(LineEditElements, 0, 2, 1, 6);
+ GroupArgumentsLayout->addWidget(CheckBoxMesh, 1, 0, 1, 8);
+ GroupArgumentsLayout->addWidget(TextLabel1, 2, 0);
+ GroupArgumentsLayout->addWidget(SelectButton1, 2, 1);
+ GroupArgumentsLayout->addWidget(TextLabel1_1, 2, 2);
+ GroupArgumentsLayout->addWidget(SpinBox1_1, 2, 3);
+ GroupArgumentsLayout->addWidget(TextLabel1_2, 2, 4);
+ GroupArgumentsLayout->addWidget(SpinBox1_2, 2, 5);
+ GroupArgumentsLayout->addWidget(TextLabel1_3, 2, 6);
+ GroupArgumentsLayout->addWidget(SpinBox1_3, 2, 7);
+ GroupArgumentsLayout->addWidget(TextLabel2, 3, 0);
+ GroupArgumentsLayout->addWidget(SelectButton2, 3, 1);
+ GroupArgumentsLayout->addWidget(TextLabel2_1, 3, 2);
+ GroupArgumentsLayout->addWidget(SpinBox2_1, 3, 3);
+ GroupArgumentsLayout->addWidget(TextLabel2_2, 3, 4);
+ GroupArgumentsLayout->addWidget(SpinBox2_2, 3, 5);
+ GroupArgumentsLayout->addWidget(TextLabel2_3, 3, 6);
+ GroupArgumentsLayout->addWidget(SpinBox2_3, 3, 7);
+ GroupArgumentsLayout->addWidget(ActionBox, 4, 0, 3, 4);
+ GroupArgumentsLayout->addWidget(MakeGroupsCheck, 5, 5, 1, 4);
+ GroupArgumentsLayout->addWidget(LineEditNewMesh, 6, 5, 1, 4);
- SMESHGUI_TranslationDlgLayout->addWidget(GroupArguments, 1, 0);
+ /***************************************************************/
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
+ buttonApply->setAutoDefault(true);
+ buttonCancel = new QPushButton(tr("SMESH_BUT_CLOSE"), GroupButtons);
+ buttonCancel->setAutoDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addWidget(buttonApply);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonCancel);
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ /***************************************************************/
+ SMESHGUI_TranslationDlgLayout->addWidget(ConstructorsBox);
+ SMESHGUI_TranslationDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_TranslationDlgLayout->addWidget(GroupButtons);
/* Initialisations */
SpinBox1_1->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
SpinBox2_2->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
SpinBox2_3->RangeStepAndValidator(COORD_MIN, COORD_MAX, 10.0, DBL_DIGITS_DISPLAY);
- GroupArguments->show();
- RadioButton1->setChecked(TRUE);
+ RadioButton1->setChecked(true);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
Init();
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
- connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupConstructors, SIGNAL(clicked(int)), SLOT(ConstructorsClicked(int)));
+ connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
connect(SelectElementsButton, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(SelectButton1, SIGNAL (clicked()), this, SLOT(SetEditCurrentArgument()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
- connect(ActionGroup, SIGNAL(clicked(int)), SLOT(onActionClicked(int)));
-
- this->show(); /* displays Dialog */
+ connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
ConstructorsClicked(0);
SelectionIntoArgument();
onActionClicked(MOVE_ELEMS_BUTTON);
- resize(0,0); // ??
}
//=================================================================================
//=================================================================================
SMESHGUI_TranslationDlg::~SMESHGUI_TranslationDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
SpinBox2_2->SetValue(0.0);
SpinBox2_3->SetValue(0.0);
- ((QRadioButton*) ActionGroup->find( MOVE_ELEMS_BUTTON ))->setChecked(TRUE);
+ ActionGroup->button( MOVE_ELEMS_BUTTON )->setChecked(true);
CheckBoxMesh->setChecked(false);
// MakeGroupsCheck->setChecked(false);
// MakeGroupsCheck->setEnabled(false);
onSelectMesh(true);
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+ QApplication::instance()->processEvents();
+ updateGeometry();
+ resize( minimumSize() );
}
//=================================================================================
return;
if (myNbOkElements) {
- QStringList aListElementsId = QStringList::split(" ", myElementsId, false);
+ QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts);
SMESH::long_array_var anElementsId = new SMESH::long_array;
aVector.PS.z = SpinBox1_3->GetValue();
}
- int actionButton = ActionGroup->id( ActionGroup->selected() );
+ int actionButton = ActionGroup->checkedId();
bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
try {
SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
- QApplication::setOverrideCursor(Qt::waitCursor);
+ QApplication::setOverrideCursor(Qt::WaitCursor);
switch ( actionButton ) {
case MOVE_ELEMS_BUTTON:
aMeshEditor->Translate(anElementsId, aVector, false);
case MAKE_MESH_BUTTON:
SMESH::SMESH_Mesh_var mesh =
aMeshEditor->TranslateMakeMesh(anElementsId, aVector, makeGroups,
- LineEditNewMesh->text().latin1());
+ LineEditNewMesh->text().toLatin1().data());
}
QApplication::restoreOverrideCursor();
} catch (...) {
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
}
}
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
if (send == LineEditElements) {
for (int i = 0; i < aListId.count(); i++) {
MakeGroupsCheck->setChecked(false);
MakeGroupsCheck->setEnabled(false);
}
- else if ( ActionGroup->id( ActionGroup->selected() ) != MOVE_ELEMS_BUTTON ) {
+ else if ( ActionGroup->checkedId() != MOVE_ELEMS_BUTTON ) {
MakeGroupsCheck->setEnabled(true);
}
//=================================================================================
void SMESHGUI_TranslationDlg::DeactivateActiveDialog()
{
- if (GroupConstructors->isEnabled()) {
- GroupConstructors->setEnabled(false);
+ if (ConstructorsBox->isEnabled()) {
+ ConstructorsBox->setEnabled(false);
GroupArguments->setEnabled(false);
GroupButtons->setEnabled(false);
mySMESHGUI->ResetState();
{
/* Emit a signal to deactivate the active dialog */
mySMESHGUI->EmitSignalDeactivateDialog();
- GroupConstructors->setEnabled(true);
+ ConstructorsBox->setEnabled(true);
GroupArguments->setEnabled(true);
GroupButtons->setEnabled(true);
//=================================================================================
void SMESHGUI_TranslationDlg::enterEvent (QEvent*)
{
- if (!GroupConstructors->isEnabled())
+ if (!ConstructorsBox->isEnabled())
ActivateThisDialog();
}
void SMESHGUI_TranslationDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
}
else {
_PTR(SObject) meshSO = SMESH::FindSObject( myMesh );
- name = meshSO->GetName();
+ name = meshSO->GetName().c_str();
}
if ( !name.isEmpty() )
- LineEditNewMesh->setText( SMESH::UniqueMeshName( name.latin1(), "translated"));
+ LineEditNewMesh->setText( SMESH::UniqueMeshName( name, "translated"));
}
}
//=================================================================================
int SMESHGUI_TranslationDlg::GetConstructorId()
{
- if (GroupConstructors != NULL && GroupConstructors->selected() != NULL)
- return GroupConstructors->id(GroupConstructors->selected());
- return -1;
+ return GroupConstructors->checkedId();
}
//=================================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_TranslationDlg.h
+// Author : Michael ZORIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_TranslationDlg.h
-// Author : Michael ZORIN
-// Module : SMESH
-// $Header:
-#ifndef DIALOGBOX_TRANSLATION_H
-#define DIALOGBOX_TRANSLATION_H
+#ifndef SMESHGUI_TRANSLATIONDLG_H
+#define SMESHGUI_TRANSLATIONDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "LightApp_SelectionMgr.h"
+// Qt includes
+#include <QDialog>
-#include "SMESH_LogicalFilter.hxx"
-
-// QT Includes
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
class QButtonGroup;
class QGroupBox;
class QLabel;
class SMESHGUI;
class SMESHGUI_SpinBox;
class SMESH_Actor;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
+class LightApp_SelectionMgr;
+class SMESH_LogicalFilter;
//=================================================================================
// class : SMESHGUI_TranslationDlg
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_TranslationDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_TranslationDlg( SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
- ~SMESHGUI_TranslationDlg();
+ SMESHGUI_TranslationDlg( SMESHGUI* );
+ ~SMESHGUI_TranslationDlg();
private:
- void Init (bool ResetControls = true);
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
- int GetConstructorId();
- void setNewMeshName();
-
- SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
- LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
- QString myElementsId;
- int myNbOkElements; /* to check when elements are defined */
-
- SVTK_Selector* mySelector;
-
- QWidget* myEditCurrentArgument;
-
- bool myBusy;
- SMESH::SMESH_Mesh_var myMesh;
- SMESH_Actor* myActor;
- SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
-
- QButtonGroup* GroupConstructors;
- QRadioButton* RadioButton1;
- QRadioButton* RadioButton2;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonCancel;
- QPushButton* buttonApply;
- QPushButton* buttonHelp;
- QGroupBox* GroupArguments;
- QLabel* TextLabelElements;
- QPushButton* SelectElementsButton;
- QLineEdit* LineEditElements;
- QCheckBox* CheckBoxMesh;
- QLabel* TextLabel1;
- QPushButton* SelectButton1;
- QLabel* TextLabel1_1;
- SMESHGUI_SpinBox* SpinBox1_1;
- QLabel* TextLabel1_2;
- SMESHGUI_SpinBox* SpinBox1_2;
- QLabel* TextLabel1_3;
- SMESHGUI_SpinBox* SpinBox1_3;
- QLabel* TextLabel2;
- QPushButton* SelectButton2;
- QLabel* TextLabel2_1;
- SMESHGUI_SpinBox* SpinBox2_1;
- QLabel* TextLabel2_2;
- SMESHGUI_SpinBox* SpinBox2_2;
- QLabel* TextLabel2_3;
- SMESHGUI_SpinBox* SpinBox2_3;
- //QCheckBox* CheckBoxCopy;
- QButtonGroup* ActionGroup;
- QCheckBox* MakeGroupsCheck;
- QLineEdit* LineEditNewMesh;
-
- QString myHelpFileName;
+ void Init( bool = true );
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
+ int GetConstructorId();
+ void setNewMeshName();
+
+ SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
+ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
+ QString myElementsId;
+ int myNbOkElements; /* to check when elements are defined */
+
+ SVTK_Selector* mySelector;
+
+ QWidget* myEditCurrentArgument;
+
+ bool myBusy;
+ SMESH::SMESH_Mesh_var myMesh;
+ SMESH_Actor* myActor;
+ SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
+
+ QGroupBox* ConstructorsBox;
+ QButtonGroup* GroupConstructors;
+ QRadioButton* RadioButton1;
+ QRadioButton* RadioButton2;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonCancel;
+ QPushButton* buttonApply;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupArguments;
+ QLabel* TextLabelElements;
+ QPushButton* SelectElementsButton;
+ QLineEdit* LineEditElements;
+ QCheckBox* CheckBoxMesh;
+ QLabel* TextLabel1;
+ QPushButton* SelectButton1;
+ QLabel* TextLabel1_1;
+ SMESHGUI_SpinBox* SpinBox1_1;
+ QLabel* TextLabel1_2;
+ SMESHGUI_SpinBox* SpinBox1_2;
+ QLabel* TextLabel1_3;
+ SMESHGUI_SpinBox* SpinBox1_3;
+ QLabel* TextLabel2;
+ QPushButton* SelectButton2;
+ QLabel* TextLabel2_1;
+ SMESHGUI_SpinBox* SpinBox2_1;
+ QLabel* TextLabel2_2;
+ SMESHGUI_SpinBox* SpinBox2_2;
+ QLabel* TextLabel2_3;
+ SMESHGUI_SpinBox* SpinBox2_3;
+ //QCheckBox* CheckBoxCopy;
+ QGroupBox* ActionBox;
+ QButtonGroup* ActionGroup;
+ QCheckBox* MakeGroupsCheck;
+ QLineEdit* LineEditNewMesh;
+
+ QString myHelpFileName;
- private slots:
-
- void ConstructorsClicked(int constructorId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnApply();
- void ClickOnHelp();
- void SetEditCurrentArgument() ;
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void onTextChange(const QString&);
- void onSelectMesh(bool toSelectMesh);
- void onActionClicked(int button);
-
-protected:
- QGridLayout* SMESHGUI_TranslationDlgLayout;
- QGridLayout* GroupConstructorsLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupArgumentsLayout;
+private slots:
+ void ConstructorsClicked( int );
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnApply();
+ void ClickOnHelp();
+ void SetEditCurrentArgument();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
+ void onSelectMesh( bool );
+ void onActionClicked( int );
};
-#endif // DIALOGBOX_TRANSLATION_H
+#endif // SMESHGUI_TRANSLATIONDLG_H
-// SMESH SMESHGUI : GUI for SMESH 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
+// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_TransparencyDlg.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_TransparencyDlg.cxx
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "SMESHGUI_TransparencyDlg.h"
#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESH_Actor.h"
-#include "SUIT_Desktop.h"
-#include "SUIT_OverrideCursor.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
-#include "SALOME_ListIO.hxx"
-#include "SALOME_ListIteratorOfListIO.hxx"
-#include "SALOME_InteractiveObject.hxx"
+#include <SALOME_ListIO.hxx>
+#include <SALOME_ListIteratorOfListIO.hxx>
-#include "SalomeApp_Study.h"
-#include "LightApp_Application.h"
-#include "LightApp_SelectionMgr.h"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "SVTK_ViewWindow.h"
+#include <SVTK_ViewWindow.h>
-// QT Includes
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qslider.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
+// Qt includes
+#include <QLabel>
+#include <QPushButton>
+#include <QSlider>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QKeyEvent>
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// class : SMESHGUI_TransparencyDlg()
// purpose :
//
//=================================================================================
-SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* theModule,
- const char* name,
- bool modal,
- WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | WDestructiveClose ),
- mySMESHGUI( theModule ),
- mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
- myViewWindow( SMESH::GetViewWindow( theModule ) )
+SMESHGUI_TransparencyDlg::SMESHGUI_TransparencyDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
+ mySMESHGUI( theModule ),
+ mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+ myViewWindow( SMESH::GetViewWindow( theModule ) )
{
- if (!name)
- setName("SMESHGUI_TransparencyDlg");
- setCaption(tr("SMESH_TRANSPARENCY_TITLE" ));
- setSizeGripEnabled(TRUE);
- QGridLayout* SMESHGUI_TransparencyDlgLayout = new QGridLayout(this);
- SMESHGUI_TransparencyDlgLayout->setSpacing(6);
- SMESHGUI_TransparencyDlgLayout->setMargin(11);
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle( tr( "SMESH_TRANSPARENCY_TITLE" ) );
+ setSizeGripEnabled( true );
+
+ QVBoxLayout* SMESHGUI_TransparencyDlgLayout = new QVBoxLayout( this );
+ SMESHGUI_TransparencyDlgLayout->setSpacing( SPACING );
+ SMESHGUI_TransparencyDlgLayout->setMargin( MARGIN );
/*************************************************************************/
- QGroupBox* GroupC1 = new QGroupBox(this, "GroupC1");
- GroupC1->setColumnLayout(0, Qt::Vertical);
- GroupC1->layout()->setSpacing(0);
- GroupC1->layout()->setMargin(0);
- QGridLayout* GroupC1Layout = new QGridLayout(GroupC1->layout());
- GroupC1Layout->setAlignment(Qt::AlignTop);
- GroupC1Layout->setSpacing(6);
- GroupC1Layout->setMargin(11);
-
- TextLabelTransparent = new QLabel(GroupC1, "TextLabelTransparent");
- TextLabelTransparent->setText(tr("SMESH_TRANSPARENCY_TRANSPARENT" ));
- TextLabelTransparent->setAlignment(AlignLeft);
- GroupC1Layout->addWidget(TextLabelTransparent, 0, 0);
-
- ValueLab = new QLabel(GroupC1, "ValueLab");
- ValueLab->setAlignment(AlignCenter);
- ValueLab->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
- QFont fnt = ValueLab->font(); fnt.setBold(true); ValueLab->setFont(fnt);
- GroupC1Layout->addWidget(ValueLab, 0, 1);
-
- TextLabelOpaque = new QLabel(GroupC1, "TextLabelOpaque");
- TextLabelOpaque->setText(tr("SMESH_TRANSPARENCY_OPAQUE" ));
- TextLabelOpaque->setAlignment(AlignRight);
- GroupC1Layout->addWidget(TextLabelOpaque, 0, 2);
-
- Slider1 = new QSlider(0, 10, 1, 5, Horizontal, GroupC1, "Slider1");
- Slider1->setFocusPolicy(QWidget::NoFocus);
- Slider1->setMinimumSize(300, 0);
- Slider1->setTickmarks(QSlider::Above);
- Slider1->setTickInterval(10);
- Slider1->setTracking(true);
- Slider1->setMinValue(0);
- Slider1->setMaxValue(100);
- Slider1->setLineStep(1);
- Slider1->setPageStep(10);
- GroupC1Layout->addMultiCellWidget(Slider1, 1, 1, 0, 2);
+ QGroupBox* GroupC1 = new QGroupBox( this );
+ QGridLayout* GroupC1Layout = new QGridLayout( GroupC1 );
+ GroupC1Layout->setSpacing( SPACING );
+ GroupC1Layout->setMargin( MARGIN );
+
+ TextLabelTransparent = new QLabel( tr( "SMESH_TRANSPARENCY_TRANSPARENT" ), GroupC1 );
+ TextLabelTransparent->setAlignment( Qt::AlignLeft );
+
+ ValueLab = new QLabel( GroupC1 );
+ ValueLab->setAlignment( Qt::AlignCenter );
+ ValueLab->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ QFont fnt = ValueLab->font(); fnt.setBold( true ); ValueLab->setFont( fnt );
+
+ TextLabelOpaque = new QLabel( tr( "SMESH_TRANSPARENCY_OPAQUE" ), GroupC1 );
+ TextLabelOpaque->setAlignment( Qt::AlignRight );
+
+ Slider1 = new QSlider( Qt::Horizontal, GroupC1 );
+ Slider1->setRange( 0, 100 );
+ Slider1->setSingleStep( 1 );
+ Slider1->setPageStep( 10 );
+ Slider1->setTickPosition( QSlider::TicksAbove );
+ Slider1->setTickInterval( 10 );
+ Slider1->setTracking( true );
+ Slider1->setFocusPolicy( Qt::NoFocus );
+ Slider1->setMinimumWidth( 300 );
+
+ GroupC1Layout->addWidget( TextLabelTransparent, 0, 0 );
+ GroupC1Layout->addWidget( ValueLab, 0, 1 );
+ GroupC1Layout->addWidget( TextLabelOpaque, 0, 2 );
+ GroupC1Layout->addWidget( Slider1, 1, 0, 1, 3 );
/*************************************************************************/
- QGroupBox* GroupButtons = new QGroupBox(this, "GroupButtons");
- 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);
-
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_CLOSE"));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP"));
- buttonHelp->setAutoDefault(TRUE);
-
- //GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 0);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 2);
- //GroupButtonsLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 2);
-
- SMESHGUI_TransparencyDlgLayout->addWidget(GroupC1, 0, 0);
- SMESHGUI_TransparencyDlgLayout->addWidget(GroupButtons, 1, 0);
+ QGroupBox* GroupButtons = new QGroupBox( this );
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons );
+ GroupButtonsLayout->setSpacing( SPACING );
+ GroupButtonsLayout->setMargin( MARGIN );
+
+ buttonOk = new QPushButton( tr( "SMESH_BUT_CLOSE" ), GroupButtons );
+ buttonOk->setAutoDefault( true );
+ buttonOk->setDefault( true );
+ buttonHelp = new QPushButton( tr( "SMESH_BUT_HELP" ), GroupButtons );
+ buttonHelp->setAutoDefault( true );
+
+ GroupButtonsLayout->addWidget( buttonOk );
+ GroupButtonsLayout->addSpacing( 10 );
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget( buttonHelp );
+
+ /*************************************************************************/
+ SMESHGUI_TransparencyDlgLayout->addWidget( GroupC1 );
+ SMESHGUI_TransparencyDlgLayout->addWidget( GroupButtons );
// Initial state
- this->onSelectionChanged();
+ onSelectionChanged();
// signals and slots connections : after ValueHasChanged()
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(Slider1, SIGNAL(valueChanged(int)), this, SLOT(SetTransparency()));
- connect(Slider1, SIGNAL(sliderMoved(int)), this, SLOT(ValueHasChanged()));
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnOk()));
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionChanged()));
+ connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
+ connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
+ connect( Slider1, SIGNAL( valueChanged( int ) ), this, SLOT( SetTransparency() ) );
+ connect( Slider1, SIGNAL( sliderMoved( int ) ), this, SLOT( ValueHasChanged() ) );
+ connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnOk() ) );
+ connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
myHelpFileName = "transparency_page.html";
-
- this->show();
}
//=================================================================================
//=================================================================================
SMESHGUI_TransparencyDlg::~SMESHGUI_TransparencyDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=======================================================================
//=================================================================================
void SMESHGUI_TransparencyDlg::ClickOnHelp()
{
- LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
- if (app)
- app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
+ LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
+ if ( app )
+ app->onHelpContextModule( mySMESHGUI ? app->moduleName( mySMESHGUI->moduleName() ) :
+ QString( "" ), myHelpFileName );
else {
- QString platform;
+ QString platform;
#ifdef WIN32
- platform = "winapplication";
+ platform = "winapplication";
#else
- platform = "application";
+ platform = "application";
#endif
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ),
+ tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
+ arg( app->resourceMgr()->stringValue( "ExternalBrowser",
+ platform ) ).
+ arg( myHelpFileName ) );
}
}
//=================================================================================
void SMESHGUI_TransparencyDlg::SetTransparency()
{
- if( myViewWindow ) {
+ if ( myViewWindow ) {
SUIT_OverrideCursor wc;
- float opacity = this->Slider1->value() / 100.;
+ float opacity = Slider1->value() / 100.;
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList);
+ mySelectionMgr->selectedObjects( aList );
- SALOME_ListIteratorOfListIO It (aList);
- for (;It.More(); It.Next()) {
+ SALOME_ListIteratorOfListIO It( aList );
+ for ( ; It.More(); It.Next() ) {
Handle(SALOME_InteractiveObject) IOS = It.Value();
- SMESH_Actor* anActor = SMESH::FindActorByEntry(IOS->getEntry());
- if (anActor)
- anActor->SetOpacity(opacity);
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( IOS->getEntry() );
+ if ( anActor )
+ anActor->SetOpacity( opacity );
}
myViewWindow->Repaint();
}
//=================================================================================
void SMESHGUI_TransparencyDlg::ValueHasChanged()
{
- ValueLab->setText(QString::number(this->Slider1->value()) + "%");
+ ValueLab->setText( QString::number( Slider1->value() ) + "%") ;
}
//=================================================================================
//=================================================================================
void SMESHGUI_TransparencyDlg::onSelectionChanged()
{
- if( myViewWindow ) {
+ if ( myViewWindow ) {
int opacity = 100;
SALOME_ListIO aList;
- mySelectionMgr->selectedObjects(aList);
+ mySelectionMgr->selectedObjects( aList );
- if (aList.Extent() == 1) {
+ if ( aList.Extent() == 1 ) {
Handle(SALOME_InteractiveObject) FirstIOS = aList.First();
- if (!FirstIOS.IsNull()) {
- SMESH_Actor* anActor = SMESH::FindActorByEntry(FirstIOS->getEntry());
- if (anActor)
- opacity = int(anActor->GetOpacity() * 100. + 0.5);
+ if ( !FirstIOS.IsNull() ) {
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( FirstIOS->getEntry() );
+ if ( anActor )
+ opacity = int( anActor->GetOpacity() * 100. + 0.5 );
}
- } else if (aList.Extent() > 1) {
- SALOME_ListIteratorOfListIO It (aList);
+ }
+ else if ( aList.Extent() > 1 ) {
+ SALOME_ListIteratorOfListIO It( aList );
int setOp = -1;
- for (; It.More(); It.Next()) {
+ for ( ; It.More(); It.Next() ) {
Handle(SALOME_InteractiveObject) IO = It.Value();
- if (!IO.IsNull()) {
- SMESH_Actor* anActor = SMESH::FindActorByEntry(IO->getEntry());
- if (anActor) {
- int op = int(anActor->GetOpacity() * 100. + 0.5);
- if (setOp < 0)
+ if ( !IO.IsNull() ) {
+ SMESH_Actor* anActor = SMESH::FindActorByEntry( IO->getEntry() );
+ if ( anActor ) {
+ int op = int( anActor->GetOpacity() * 100. + 0.5 );
+ if ( setOp < 0 )
setOp = op;
- else if (setOp != op) {
+ else if ( setOp != op ) {
setOp = 100;
break;
}
}
}
}
- if (setOp >= 0)
+ if ( setOp >= 0 )
opacity = setOp;
- } else {
+ }
+ else {
}
- Slider1->setValue(opacity);
+ Slider1->setValue( opacity );
}
ValueHasChanged();
}
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_TransparencyDlg.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_TransparencyDlg.h
-// Author : Nicolas REJNERI
-// Module : SMESH
-// $Header$
-#ifndef DIALOGBOX_TRANSPARENCYDLG_H
-#define DIALOGBOX_TRANSPARENCYDLG_H
+#ifndef SMESHGUI_TRANSPARENCYDLG_H
+#define SMESHGUI_TRANSPARENCYDLG_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-// QT Includes
-#include <qdialog.h>
+// Qt includes
+#include <QDialog>
class QLabel;
class QPushButton;
class QSlider;
class LightApp_SelectionMgr;
-class SVTK_Selector;
class SVTK_ViewWindow;
class SMESHGUI;
//=================================================================================
class SMESHGUI_EXPORT SMESHGUI_TransparencyDlg : public QDialog
{
- Q_OBJECT
+ Q_OBJECT
public:
- SMESHGUI_TransparencyDlg( SMESHGUI*,
- const char* name = 0,
- bool modal = false,
- WFlags fl = 0 );
-
- ~SMESHGUI_TransparencyDlg();
+ SMESHGUI_TransparencyDlg( SMESHGUI* );
+ ~SMESHGUI_TransparencyDlg();
private:
- void keyPressEvent(QKeyEvent*);
-
-private :
+ void keyPressEvent( QKeyEvent* );
+private:
SMESHGUI* mySMESHGUI;
LightApp_SelectionMgr* mySelectionMgr;
SVTK_ViewWindow* myViewWindow;
- QPushButton* buttonOk;
- QPushButton* buttonHelp;
- QLabel* TextLabelOpaque;
- QLabel* ValueLab;
- QLabel* TextLabelTransparent;
- QSlider* Slider1;
+ QPushButton* buttonOk;
+ QPushButton* buttonHelp;
+ QLabel* TextLabelOpaque;
+ QLabel* ValueLab;
+ QLabel* TextLabelTransparent;
+ QSlider* Slider1;
- QString myHelpFileName;
+ QString myHelpFileName;
public slots:
-
- void ClickOnOk();
- void ClickOnHelp();
- void ValueHasChanged();
- void SetTransparency();
- void onSelectionChanged();
+ void ClickOnOk();
+ void ClickOnHelp();
+ void ValueHasChanged();
+ void SetTransparency();
+ void onSelectionChanged();
};
-#endif // DIALOGBOX_TRANSPARENCYDLG_H
+#endif // SMESHGUI_TRANSPARENCYDLG_H
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_Utils.cxx
+// Author : Open CASCADE S.A.S.
+//
-
-#include <qstring.h>
-
+// SMESH includes
#include "SMESHGUI_Utils.h"
-#include "SMESHGUI.h"
-
-#include "OB_Browser.h"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_Application.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-#include "LightApp_SelectionMgr.h"
-#include "SalomeApp_Application.h"
-#include "SalomeApp_Module.h"
-#include "SalomeApp_Study.h"
-
-#include "SALOME_ListIO.hxx"
-
-#include "SALOMEconfig.h"
-#include CORBA_CLIENT_HEADER(GEOM_Gen)
+#include "SMESHGUI.h"
-#include "utilities.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
-//using namespace std;
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Module.h>
+#include <SalomeApp_Study.h>
-namespace SMESH{
+#include <SALOME_ListIO.hxx>
+namespace SMESH
+{
SUIT_Desktop*
GetDesktop(const CAM_Module* theModule)
{
return anObj;
}
-
SUIT_Study* GetActiveStudy()
{
SUIT_Application* app = SUIT_Session::session()->activeApplication();
return _PTR(SObject)();
}
- void SetName (_PTR(SObject) theSObject, const char* theName)
+ void SetName (_PTR(SObject) theSObject, const QString& theName)
{
_PTR(Study) aStudy = GetActiveStudyDocument();
if (aStudy->GetProperties()->IsLocked())
aBuilder->FindOrCreateAttribute(theSObject, "AttributeName");
_PTR(AttributeName) aName = anAttr;
if (aName)
- aName->SetValue(theName);
+ aName->SetValue(theName.toLatin1().data());
}
- void SetValue (_PTR(SObject) theSObject, const char* theValue)
+ void SetValue (_PTR(SObject) theSObject, const QString& theValue)
{
_PTR(Study) aStudy = GetActiveStudyDocument();
if (aStudy->GetProperties()->IsLocked())
aBuilder->FindOrCreateAttribute(theSObject, "AttributeComment");
_PTR(AttributeComment) aComment = anAttr;
if (aComment)
- aComment->SetValue(theValue);
+ aComment->SetValue(theValue.toLatin1().data());
}
- void setFileName (_PTR(SObject) theSObject, const char* theValue)
+ void setFileName (_PTR(SObject) theSObject, const QString& theValue)
{
_PTR(Study) aStudy = GetActiveStudyDocument();
if (aStudy->GetProperties()->IsLocked())
aBuilder->FindOrCreateAttribute(theSObject, "AttributeExternalFileDef");
_PTR(AttributeExternalFileDef) aFileName = anAttr;
if (aFileName)
- aFileName->SetValue(theValue);
+ aFileName->SetValue(theValue.toLatin1().data());
}
- void setFileType (_PTR(SObject) theSObject, const char* theValue)
+ void setFileType (_PTR(SObject) theSObject, const QString& theValue)
{
_PTR(Study) aStudy = GetActiveStudyDocument();
if (aStudy->GetProperties()->IsLocked())
aBuilder->FindOrCreateAttribute(theSObject, "AttributeFileType");
_PTR(AttributeFileType) aFileType = anAttr;
if (aFileType)
- aFileType->SetValue(theValue);
+ aFileType->SetValue(theValue.toLatin1().data());
}
CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
return CORBA::Object::_nil();
}
- CORBA::Object_var IORToObject (const char* theIOR)
+ CORBA::Object_var IORToObject (const QString& theIOR)
{
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
(SUIT_Session::session()->activeApplication());
- return app->orb()->string_to_object(theIOR);
+ return app->orb()->string_to_object(theIOR.toLatin1().data());
}
int GetNameOfSelectedIObjects(LightApp_SelectionMgr* theMgr, QString& theName)
_PTR(SObject) aSObj = anIter->Value();
if (i >= 4) {
_PTR(ChildIterator) anIter1 = aStudy->NewChildIterator(aSObj);
- for (; anIter1->More(); anIter1->Next()) {
+ for ( ; anIter1->More(); anIter1->Next()) {
_PTR(SObject) aSObj1 = anIter1->Value();
anAttr = aBuilder->FindOrCreateAttribute(aSObj1, "AttributePixMap");
aPixmap = anAttr;
}
}
- void ShowHelpFile (QString theHelpFileName)
+ void ShowHelpFile (const QString& theHelpFileName)
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app) {
theHelpFileName);
}
else {
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(theHelpFileName),
- QObject::tr("BUT_OK"));
- }
+ SUIT_MessageBox::warning(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ "application")).
+ arg(theHelpFileName));
+ }
}
-
-// void UpdateObjBrowser (bool)
-// {
-// //SMESHGUI::activeStudy()->updateObjBrowser(true);
-// //SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
-// // (SUIT_Session::session()->activeApplication());
-// //if (anApp) anApp->objectBrowser()->updateTree();
-// SMESHGUI::GetSMESHGUI()->updateObjBrowser();
-// }
-}
+} // end of namespace SMESH
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_Utils.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef SMESHGUI_Utils_HeaderFile
-#define SMESHGUI_Utils_HeaderFile
+#ifndef SMESHGUI_UTILS_H
+#define SMESHGUI_UTILS_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
+// CORBA includes
#include <omniORB4/CORBA.h>
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOME_InteractiveObject.hxx"
-#include "LightApp_DataOwner.h"
+// SALOME KERNEL includes
+#include <SALOMEDSClient_definitions.hxx>
-class QString;
+// SALOME GUI includes
+#include <SALOME_InteractiveObject.hxx>
+#include <LightApp_DataOwner.h>
class SUIT_ViewWindow;
class SUIT_Desktop;
class SalomeApp_Module;
class LightApp_SelectionMgr;
-namespace SMESH {
-
+namespace SMESH
+{
SMESHGUI_EXPORT
SUIT_Desktop*
- GetDesktop(const CAM_Module* theModule);
+ GetDesktop( const CAM_Module* );
SMESHGUI_EXPORT
LightApp_SelectionMgr*
- GetSelectionMgr(const SalomeApp_Module* theModule);
+ GetSelectionMgr( const SalomeApp_Module* );
SMESHGUI_EXPORT
SalomeApp_Study*
- GetAppStudy(const CAM_Module* theModule);
+ GetAppStudy( const CAM_Module* );
SMESHGUI_EXPORT
SUIT_ResourceMgr*
SMESHGUI_EXPORT
_PTR(Study)
- GetCStudy(const SalomeApp_Study* theStudy);
+ GetCStudy( const SalomeApp_Study* );
SMESHGUI_EXPORT
- CORBA::Object_var DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner);
+ CORBA::Object_var DataOwnerToObject( const LightApp_DataOwnerPtr& );
template<class TInterface> typename TInterface::_var_type
- DataOwnerToInterface(const LightApp_DataOwnerPtr& theDataOwner)
+ DataOwnerToInterface( const LightApp_DataOwnerPtr& theDataOwner )
{
CORBA::Object_var anObj = DataOwnerToObject(theDataOwner);
if(!CORBA::is_nil(anObj))
return TInterface::_nil();
}
-
SMESHGUI_EXPORT
SUIT_Study* GetActiveStudy();
_PTR(Study) GetActiveStudyDocument();
SMESHGUI_EXPORT
- _PTR(SObject) FindSObject(CORBA::Object_ptr theObject);
+ _PTR(SObject) FindSObject( CORBA::Object_ptr );
SMESHGUI_EXPORT
- void SetName (_PTR(SObject) theSObject, const char* theName);
+ void SetName( _PTR(SObject), const QString& );
SMESHGUI_EXPORT
- void SetValue (_PTR(SObject) theSObject, const char* theValue);
- void setFileType (_PTR(SObject) theSObject, const char* theValue);
- void setFileName (_PTR(SObject) theSObject, const char* theValue);
+ void SetValue( _PTR(SObject), const QString& );
+ void setFileType( _PTR(SObject), const QString& );
+ void setFileName( _PTR(SObject), const QString& );
SMESHGUI_EXPORT
- CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject,
- _PTR(Study) theStudy);
+ CORBA::Object_var SObjectToObject( _PTR(SObject),
+ _PTR(Study) );
SMESHGUI_EXPORT
- CORBA::Object_var SObjectToObject(_PTR(SObject) theSObject);
+ CORBA::Object_var SObjectToObject( _PTR(SObject) );
template<class TInterface> typename TInterface::_var_type
- SObjectToInterface(_PTR(SObject) theSObject)
+ SObjectToInterface( _PTR(SObject) theSObject )
{
CORBA::Object_var anObj = SObjectToObject(theSObject);
if(!CORBA::is_nil(anObj))
}
SMESHGUI_EXPORT
- CORBA::Object_var IObjectToObject(const Handle(SALOME_InteractiveObject)& theIO);
+ CORBA::Object_var IObjectToObject( const Handle(SALOME_InteractiveObject)& );
template<class TInterface> typename TInterface::_var_type
- IObjectToInterface(const Handle(SALOME_InteractiveObject)& theIO)
+ IObjectToInterface( const Handle(SALOME_InteractiveObject)& theIO )
{
CORBA::Object_var anObj = IObjectToObject(theIO);
if(!CORBA::is_nil(anObj))
}
SMESHGUI_EXPORT
- CORBA::Object_var IORToObject(const char* theIOR);
+ CORBA::Object_var IORToObject( const QString& );
template<class TInterface> typename TInterface::_var_type
- IORToInterface(const char* theIOR)
+ IORToInterface( const QString& theIOR )
{
- CORBA::Object_var anObj = IORToObject(theIOR);
- if(!CORBA::is_nil(anObj))
- return TInterface::_narrow(anObj);
+ CORBA::Object_var anObj = IORToObject( theIOR );
+ if ( !CORBA::is_nil( anObj ) )
+ return TInterface::_narrow( anObj );
return TInterface::_nil();
}
SMESHGUI_EXPORT
- int GetNameOfSelectedIObjects (LightApp_SelectionMgr*, QString& theName);
+ int GetNameOfSelectedIObjects( LightApp_SelectionMgr*, QString& );
SMESHGUI_EXPORT
- _PTR(SObject) GetMeshOrSubmesh (_PTR(SObject) theSObject);
+ _PTR(SObject) GetMeshOrSubmesh( _PTR(SObject) );
SMESHGUI_EXPORT
- void ModifiedMesh (_PTR(SObject) theSObject, bool theIsNot, bool isEmptyMesh=false);
+ void ModifiedMesh( _PTR(SObject), bool, bool = false );
SMESHGUI_EXPORT
- void ShowHelpFile (QString theHelpFileName);
+ void ShowHelpFile( const QString& );
}
-#endif
+#endif // SMESHGUI_UTILS_H
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_VTKUtils.cxx
+// Author : Open CASCADE S.A.S.
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-
+// SMESH includes
#include "SMESHGUI_VTKUtils.h"
+
+#include "SMESHGUI.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_Filter.h"
-#include "SMESHGUI.h"
-#include "SMESH_Actor.h"
-#include "SMESH_ActorUtils.h"
-#include "SMESH_ObjectDef.h"
+#include <SMESH_Actor.h>
+#include <SMESH_ActorUtils.h>
+#include <SMESH_ObjectDef.h>
#include <SMDS_Mesh.hxx>
+// SALOME GUI includes
#include <SUIT_Desktop.h>
#include <SUIT_Session.h>
-#include <SUIT_Study.h>
#include <SUIT_MessageBox.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ResourceMgr.h>
#include <SALOME_ListIO.hxx>
#include <SALOME_ListIteratorOfListIO.hxx>
#include <SalomeApp_Application.h>
#include <SalomeApp_Study.h>
+// SALOME KERNEL includes
#include <utilities.h>
+// IDL includes
#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SMESH_Gen)
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
#include CORBA_CLIENT_HEADER(SMESH_Group)
-#include CORBA_CLIENT_HEADER(SMESH_Hypothesis)
-
-#include <SALOMEDSClient_Study.hxx>
-#include <SALOMEDSClient_SObject.hxx>
-// VTK
+// VTK includes
#include <vtkRenderer.h>
#include <vtkActorCollection.h>
#include <vtkUnstructuredGrid.h>
-// OCCT
+// OCCT includes
#include <TColStd_IndexedMapOfInteger.hxx>
#include <Standard_ErrorHandler.hxx>
-// STL
-#include <set>
-using namespace std;
-
-
-namespace SMESH {
-
- typedef map<TKeyOfVisualObj,TVisualObjPtr> TVisualObjCont;
+namespace SMESH
+{
+ typedef std::map<TKeyOfVisualObj,TVisualObjPtr> TVisualObjCont;
static TVisualObjCont VISUAL_OBJ_CONT;
//=============================================================================
SUIT_ViewManager* aViewManager =
app ? app->getViewManager(SVTK_Viewer::Type(), true) : 0;
if ( aViewManager ) {
- QPtrVector<SUIT_ViewWindow> views = aViewManager->getViews();
+ QVector<SUIT_ViewWindow*> views = aViewManager->getViews();
for ( int iV = 0; iV < views.count(); ++iV ) {
if ( SMESH_Actor* actor = FindActorByEntry( views[iV], theEntry)) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV]))
for ( int iM = 0; iM < viewMgrs.count(); ++iM ) {
SUIT_ViewManager* aViewManager = viewMgrs.at( iM );
if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type()) {
- QPtrVector<SUIT_ViewWindow> views = aViewManager->getViews();
+ QVector<SUIT_ViewWindow*> views = aViewManager->getViews();
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
vtkRenderer *aRenderer = vtkWnd->getRenderer();
SUIT_ViewManager* aViewManager = viewMgrs.at( iM );
if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() &&
aViewManager->study()->id() == studyID ) {
- QPtrVector<SUIT_ViewWindow> views = aViewManager->getViews();
+ QVector<SUIT_ViewWindow*> views = aViewManager->getViews();
for ( int iV = 0; iV < views.count(); ++iV ) {
if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) {
vtkRenderer *aRenderer = vtkWnd->getRenderer();
// after or at showing this message, so we do an additional check of available memory
// char* buf = new char[100*1024];
// delete [] buf;
- SUIT_MessageBox::warn1 (SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_VISU_PROBLEM"),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_VISU_PROBLEM"));
} catch (...) {
// no more memory at all: last resort
cout<< "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" <<endl;
theVISU_MemoryReserve = 0;
}
RemoveAllObjectsWithActors();
- SUIT_MessageBox::warn1 (SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_VISU_PROBLEM_CLEAR"),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_VISU_PROBLEM_CLEAR"));
cout<< "...done" << endl;
}
}
cout << "SMESHGUI_VTKUtils::GetVisualObj(), freeMB=" << freeMB
<< ", usedMB=" << usedMB<< endl;
#endif
- int continu = 0;
+ bool continu = false;
if ( usedMB * 10 > freeMB )
// even dont try to show
- SUIT_MessageBox::warn1 (SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
- QObject::tr("SMESH_NO_MESH_VISUALIZATION"),
- QObject::tr("SMESH_BUT_OK"));
+ SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"),
+ QObject::tr("SMESH_NO_MESH_VISUALIZATION"));
else
// there is a chance to succeed
- continu = SUIT_MessageBox::warn2
+ continu = SUIT_MessageBox::warning
(SMESHGUI::desktop(),
QObject::tr("SMESH_WRN_WARNING"),
QObject::tr("SMESH_CONTINUE_MESH_VISUALIZATION"),
- QObject::tr("SMESH_BUT_YES"), QObject::tr("SMESH_BUT_NO"),
- 1, 0, 1);
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No,
+ SUIT_MessageBox::Yes ) == SUIT_MessageBox::Yes;
if ( !continu ) {
// remove the corresponding actors from all views
RemoveVisualObjectWithActors( theEntry );
if( !theMgr )
return NULL;
- QPtrVector<SUIT_ViewWindow> views = theMgr->getViews();
- if( views.containsRef( theWindow ) )
+ QVector<SUIT_ViewWindow*> views = theMgr->getViews();
+ if( views.contains( theWindow ) )
return GetVtkViewWindow( theWindow );
else
return NULL;
vtkActorCollection *aCollection = aRenderer->GetActors();
aCollection->InitTraversal();
while(vtkActor *anAct = aCollection->GetNextActor())
- if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct))
+ if(dynamic_cast<SMESH_Actor*>(anAct))
return false;
}
return true;
}
}else{
SALOME_ListIteratorOfListIO anIter( selected );
- for(; anIter.More(); anIter.Next()){
+ for( ; anIter.More(); anIter.Next()){
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if ( !Update(anIO,true) )
break; // avoid multiple warinings if visu failed
return;
}
- QPtrVector<SUIT_ViewWindow> views = vm->getViews();
+ QVector<SUIT_ViewWindow*> views = vm->getViews();
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( theModule );
if( !mgr )
void RemoveFilters(SVTK_Selector* theSelector)
{
- for ( int id = SMESHGUI_NodeFilter; theSelector && id < SMESHGUI_LastFilter; id++ )
+ for ( int id = SMESH::NodeFilter; theSelector && id < SMESH::LastFilter; id++ )
theSelector->RemoveFilter( id );
}
anIdContainer.insert(aMapIndex(i));
TIdContainer::const_iterator anIter = anIdContainer.begin();
- for(; anIter != anIdContainer.end(); anIter++)
+ for( ; anIter != anIdContainer.end(); anIter++)
theName += QString(" %1").arg(*anIter);
return aMapIndex.Extent();
for( int i = 1; i <= aMapIndex.Extent(); i++)
anIdContainer.insert(aMapIndex(i));
TIdContainer::const_iterator anIter = anIdContainer.begin();
- for(; anIter != anIdContainer.end(); anIter++){
+ for( ; anIter != anIdContainer.end(); anIter++){
theName += QString(" %1").arg(*anIter);
}
return aMapIndex.Extent();
}
}
-}
+} // end of namespace SMESH
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// SMESH SMESHGUI : GUI for SMESH component
//
-// 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.
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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.
+// 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.
//
-// 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
+// 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 : SMESHGUI_VTKUtils.h
+// Author : Open CASCADE S.A.S.
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#ifndef SMESHGUI_VTKUtils_HeaderFile
-#define SMESHGUI_VTKUtils_HeaderFile
+#ifndef SMESHGUI_VTKUTILS_H
+#define SMESHGUI_VTKUTILS_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "SALOMEDSClient_definitions.hxx"
-#include "SALOME_InteractiveObject.hxx"
-#include "VTKViewer_Filter.h"
-
-#include "SMESH_Object.h"
#include "SMESHGUI_Utils.h"
+#include <SMESH_Object.h>
-#include <CORBA.h>
-
-#include "SALOMEconfig.h"
-#include CORBA_CLIENT_HEADER(SALOMEDS)
+// SALOME KERNEL includes
+#include <SALOMEDSClient_definitions.hxx>
-#include <boost/shared_ptr.hpp>
-
-class QString;
+// SALOME GUI includes
+#include <SALOME_InteractiveObject.hxx>
+#include <VTKViewer_Filter.h>
class TColStd_IndexedMapOfInteger;
class SALOMEDSClient_Study;
-class SUIT_Study;
class SUIT_ViewWindow;
class SUIT_ViewManager;
class SMESH_Actor;
class SALOME_Actor;
-namespace SMESH {
-
+namespace SMESH
+{
//----------------------------------------------------------------------------
typedef pair<int,string> TKeyOfVisualObj;
SMESHGUI_EXPORT
- TVisualObjPtr GetVisualObj(int theStudyId,
- const char* theEntry);
+ TVisualObjPtr GetVisualObj( int, const char* );
SMESHGUI_EXPORT
void OnVisuException(); // PAL16631
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
- SVTK_ViewWindow* GetViewWindow(const SalomeApp_Module* theModule = NULL,
- bool createIfNotFound = false);
+ SVTK_ViewWindow* GetViewWindow( const SalomeApp_Module* = 0,
+ bool = false );
SMESHGUI_EXPORT
- SVTK_ViewWindow* FindVtkViewWindow(SUIT_ViewManager*, SUIT_ViewWindow*);
+ SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* );
SMESHGUI_EXPORT
- SVTK_ViewWindow* GetVtkViewWindow(SUIT_ViewWindow*);
+ SVTK_ViewWindow* GetVtkViewWindow( SUIT_ViewWindow* );
SMESHGUI_EXPORT
SVTK_ViewWindow* GetCurrentVtkView();
SMESHGUI_EXPORT
void RepaintCurrentView();
SMESHGUI_EXPORT
- void RepaintViewWindow(SVTK_ViewWindow*);
+ void RepaintViewWindow( SVTK_ViewWindow* );
SMESHGUI_EXPORT
- void RenderViewWindow(SVTK_ViewWindow*);
+ void RenderViewWindow( SVTK_ViewWindow* );
SMESHGUI_EXPORT
void FitAll();
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
- SMESH_Actor* FindActorByEntry (SUIT_ViewWindow*, const char* theEntry);
+ SMESH_Actor* FindActorByEntry( SUIT_ViewWindow*, const char* );
SMESHGUI_EXPORT
- SMESH_Actor* FindActorByEntry (const char* theEntry);
+ SMESH_Actor* FindActorByEntry( const char* );
SMESHGUI_EXPORT
- SMESH_Actor* FindActorByObject (CORBA::Object_ptr theObject);
+ SMESH_Actor* FindActorByObject( CORBA::Object_ptr );
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
- SMESH_Actor* CreateActor (_PTR(Study), const char*, int = false);
+ SMESH_Actor* CreateActor( _PTR(Study), const char*, int = false );
SMESHGUI_EXPORT
- void DisplayActor (SUIT_ViewWindow*, SMESH_Actor* theActor);
+ void DisplayActor( SUIT_ViewWindow*, SMESH_Actor* );
SMESHGUI_EXPORT
- void RemoveActor (SUIT_ViewWindow*, SMESH_Actor* theActor);
+ void RemoveActor( SUIT_ViewWindow*, SMESH_Actor* );
SMESHGUI_EXPORT
- void RemoveVisuData(int studyID);
+ void RemoveVisuData( int );
//----------------------------------------------------------------------------
- enum EDisplaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll};
+ enum EDisplaing { eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll };
+
SMESHGUI_EXPORT
- bool UpdateView (SUIT_ViewWindow*,
- EDisplaing theAction,
- const char* theEntry = "" );
+ bool UpdateView( SUIT_ViewWindow*, EDisplaing, const char* = "" );
SMESHGUI_EXPORT
- bool UpdateView (EDisplaing theAction,
- const char* theEntry = "");
+ bool UpdateView( EDisplaing, const char* = "" );
SMESHGUI_EXPORT
void UpdateView();
SMESHGUI_EXPORT
- bool Update(const Handle(SALOME_InteractiveObject)& theIO,
- bool theDisplay);
-
+ bool Update( const Handle(SALOME_InteractiveObject)&, bool );
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
- void SetPointRepresentation(bool theIsVisible);
+ void SetPointRepresentation( bool );
SMESHGUI_EXPORT
- void SetPickable(SMESH_Actor* theActor = NULL);
+ void SetPickable( SMESH_Actor* = 0 );
SMESHGUI_EXPORT
void UpdateSelectionProp( SMESHGUI* );
-
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
- SVTK_Selector* GetSelector (SUIT_ViewWindow* = GetActiveWindow());
+ SVTK_Selector* GetSelector( SUIT_ViewWindow* = GetActiveWindow() );
SMESHGUI_EXPORT
- void SetFilter (const Handle(VTKViewer_Filter)& theFilter,
- SVTK_Selector* theSelector = GetSelector());
+ void SetFilter( const Handle(VTKViewer_Filter)&, SVTK_Selector* = GetSelector() );
SMESHGUI_EXPORT
- Handle(VTKViewer_Filter) GetFilter (int theId, SVTK_Selector* theSelector = GetSelector());
+ Handle(VTKViewer_Filter) GetFilter( int, SVTK_Selector* = GetSelector() );
SMESHGUI_EXPORT
- bool IsFilterPresent (int theId, SVTK_Selector* theSelector = GetSelector());
+ bool IsFilterPresent( int, SVTK_Selector* = GetSelector() );
SMESHGUI_EXPORT
- void RemoveFilter (int theId, SVTK_Selector* theSelector = GetSelector());
+ void RemoveFilter( int, SVTK_Selector* = GetSelector() );
SMESHGUI_EXPORT
- void RemoveFilters (SVTK_Selector* theSelector = GetSelector());
+ void RemoveFilters( SVTK_Selector* = GetSelector());
SMESHGUI_EXPORT
- bool IsValid (SALOME_Actor* theActor, int theCellId,
- SVTK_Selector* theSelector = GetSelector());
+ bool IsValid( SALOME_Actor*, int, SVTK_Selector* = GetSelector() );
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
- int GetNameOfSelectedNodes(SVTK_Selector* theSelector,
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName);
+ int GetNameOfSelectedNodes( SVTK_Selector*,
+ const Handle(SALOME_InteractiveObject)&,
+ QString& );
SMESHGUI_EXPORT
- int GetNameOfSelectedElements(SVTK_Selector* theSelector,
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName);
+ int GetNameOfSelectedElements( SVTK_Selector*,
+ const Handle(SALOME_InteractiveObject)&,
+ QString& );
SMESHGUI_EXPORT
- int GetEdgeNodes(SVTK_Selector* theSelector,
- const TVisualObjPtr& theVisualObj,
- int& theId1,
- int& theId2);
+ int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& );
//----------------------------------------------------------------------------
SMESHGUI_EXPORT
- int GetNameOfSelectedNodes (LightApp_SelectionMgr*,
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName);
+ int GetNameOfSelectedNodes( LightApp_SelectionMgr*,
+ const Handle(SALOME_InteractiveObject)&,
+ QString& );
SMESHGUI_EXPORT
- int GetNameOfSelectedNodes (LightApp_SelectionMgr*,
- QString& aName);
+ int GetNameOfSelectedNodes( LightApp_SelectionMgr*, QString& );
SMESHGUI_EXPORT
- int GetNameOfSelectedElements (LightApp_SelectionMgr*,
- const Handle(SALOME_InteractiveObject)& theIO,
- QString& theName);
+ int GetNameOfSelectedElements( LightApp_SelectionMgr*,
+ const Handle(SALOME_InteractiveObject)&,
+ QString& );
SMESHGUI_EXPORT
- int GetNameOfSelectedElements (LightApp_SelectionMgr*,
- QString& aName);
+ int GetNameOfSelectedElements( LightApp_SelectionMgr*, QString& );
SMESHGUI_EXPORT
- int GetSelected (LightApp_SelectionMgr*,
- TColStd_IndexedMapOfInteger& theMap,
- const bool theIsElement = true );
+ int GetSelected( LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger&,
+ const bool = true );
SMESHGUI_EXPORT
- int GetEdgeNodes (LightApp_SelectionMgr*, int& theId1, int& theId2);
+ int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );
SMESHGUI_EXPORT
- void SetControlsPrecision (const long theVal);
+ void SetControlsPrecision( const long );
};
-#endif
+#endif // SMESHGUI_VTKUTILS_H
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH component
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : SMESHGUI_WhatIsDlg.cxx
+// Author : Vladimir TURIN, Open CASCADE S.A.S.
//
-//
-// File : SMESHGUI_WhatIsDlg.cxx
-// Author : Vladimir TURIN
-// Module : SMESH
-// $Header:
+// SMESH includes
#include "SMESHGUI_WhatIsDlg.h"
#include "SMESHGUI.h"
-#include "SMESHGUI_SpinBox.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_MeshUtils.h"
#include "SMDS_Mesh.hxx"
#include "SMDS_VolumeTool.hxx"
-#include "SUIT_Desktop.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Session.h"
-#include "SUIT_MessageBox.h"
-
-#include "LightApp_Application.h"
+// SALOME GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_MessageBox.h>
-#include "SVTK_ViewModel.h"
-#include "SVTK_Selection.h"
-#include "SVTK_ViewWindow.h"
-#include "SVTK_Selector.h"
-#include "SALOME_ListIO.hxx"
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
-#include "utilities.h"
+#include <SVTK_ViewModel.h>
+#include <SVTK_Selection.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-// OCCT Includes
+// OCCT includes
#include <TColStd_MapOfInteger.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
#include <gp_XYZ.hxx>
-// QT Includes
-#include <qapplication.h>
-#include <qbuttongroup.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qspinbox.h>
-#include <qpixmap.h>
-#include <qtextbrowser.h>
-
-// IDL Headers
-#include "SALOMEconfig.h"
+// Qt includes
+#include <QButtonGroup>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QTextBrowser>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QGridLayout>
+#include <QKeyEvent>
+
+// IDL includes
+#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Group)
-#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
-using namespace std;
+#define SPACING 6
+#define MARGIN 11
//=================================================================================
// class : SMESHGUI_WhatIsDlg()
// purpose :
//=================================================================================
-SMESHGUI_WhatIsDlg::SMESHGUI_WhatIsDlg( SMESHGUI* theModule, const char* name,
- bool modal, WFlags fl)
- : QDialog( SMESH::GetDesktop( theModule ), name, modal, WStyle_Customize | WStyle_NormalBorder |
- WStyle_Title | WStyle_SysMenu | Qt::WDestructiveClose),
+SMESHGUI_WhatIsDlg::SMESHGUI_WhatIsDlg( SMESHGUI* theModule )
+ : QDialog( SMESH::GetDesktop( theModule ) ),
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
{
- if (!name)
- setName("SMESHGUI_WhatIsDlg");
- resize(300, 500);
- setCaption(tr("SMESH_WHAT_IS_TITLE"));
- setSizeGripEnabled(TRUE);
- SMESHGUI_WhatIsDlgLayout = new QGridLayout(this);
- SMESHGUI_WhatIsDlgLayout->setSpacing(6);
- SMESHGUI_WhatIsDlgLayout->setMargin(11);
+ setModal( false );
+ setAttribute( Qt::WA_DeleteOnClose, true );
+ setWindowTitle(tr("SMESH_WHAT_IS_TITLE"));
+ setSizeGripEnabled(true);
+ QVBoxLayout* SMESHGUI_WhatIsDlgLayout = new QVBoxLayout(this);
+ SMESHGUI_WhatIsDlgLayout->setSpacing(SPACING);
+ SMESHGUI_WhatIsDlgLayout->setMargin(MARGIN);
/***************************************************************/
- GroupMesh = new QButtonGroup(this, "GroupSelections");
- GroupMesh->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupMesh->sizePolicy().hasHeightForWidth()));
- GroupMesh->setTitle(tr(""));
- GroupMesh->setColumnLayout(0, Qt::Vertical);
- GroupMesh->layout()->setSpacing(0);
- GroupMesh->layout()->setMargin(0);
- GroupMeshLayout = new QGridLayout(GroupMesh->layout());
- GroupMeshLayout->setAlignment(Qt::AlignTop);
- GroupMeshLayout->setSpacing(6);
- GroupMeshLayout->setMargin(11);
- MeshLabel = new QLabel(GroupMesh, "MeshLabel");
- MeshLabel->setText(tr("SMESH_NAME"));
- GroupMeshLayout->addWidget(MeshLabel, 0, 0);
- MeshName = new QLabel(GroupMesh, "MeshName");
- MeshName->setText(tr(""));
- GroupMeshLayout->addWidget(MeshName, 0, 1);
- SMESHGUI_WhatIsDlgLayout->addWidget(GroupMesh, 0, 0);
+ GroupMesh = new QGroupBox(this);
+ QHBoxLayout* GroupMeshLayout = new QHBoxLayout(GroupMesh);
+ GroupMeshLayout->setSpacing(SPACING);
+ GroupMeshLayout->setMargin(MARGIN);
+
+ MeshLabel = new QLabel(tr("SMESH_NAME"), GroupMesh);
+ GroupMeshLayout->addWidget(MeshLabel);
+ MeshName = new QLineEdit(GroupMesh);
+ MeshName->setReadOnly(true);
+ GroupMeshLayout->addWidget(MeshName);
/***************************************************************/
- GroupSelections = new QButtonGroup(this, "GroupSelections");
- GroupSelections->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5, (QSizePolicy::SizeType)0, 0, 0, GroupSelections->sizePolicy().hasHeightForWidth()));
- GroupSelections->setTitle(tr("ENTITY_TYPE" ));
- GroupSelections->setExclusive(TRUE);
- GroupSelections->setColumnLayout(0, Qt::Vertical);
- GroupSelections->layout()->setSpacing(0);
- GroupSelections->layout()->setMargin(0);
- GroupSelectionsLayout = new QGridLayout(GroupSelections->layout());
- GroupSelectionsLayout->setAlignment(Qt::AlignTop);
- GroupSelectionsLayout->setSpacing(6);
- GroupSelectionsLayout->setMargin(11);
- RadioButtonNodes = new QRadioButton(GroupSelections, "RadioButtonNodes");
- RadioButtonNodes->setText(tr("SMESH_NODES"));
- GroupSelectionsLayout->addWidget(RadioButtonNodes, 0, 0);
- RadioButtonElements = new QRadioButton(GroupSelections, "RadioButtonElements");
- RadioButtonElements->setText(tr("SMESH_ELEMENTS"));
- GroupSelectionsLayout->addWidget(RadioButtonElements, 0, 1 );
- SMESHGUI_WhatIsDlgLayout->addWidget(GroupSelections, 1, 0);
+ GroupSelections = new QGroupBox(tr("ENTITY_TYPE"), this);
+ QButtonGroup* GroupSel = new QButtonGroup(this);
+ QHBoxLayout* GroupSelectionsLayout = new QHBoxLayout(GroupSelections);
+ GroupSelectionsLayout->setSpacing(SPACING);
+ GroupSelectionsLayout->setMargin(MARGIN);
+
+ RadioButtonNodes = new QRadioButton(tr("SMESH_NODES"), GroupSelections);
+ GroupSelectionsLayout->addWidget(RadioButtonNodes);
+ GroupSel->addButton(RadioButtonNodes, 0);
+ RadioButtonElements = new QRadioButton(tr("SMESH_ELEMENTS"), GroupSelections);
+ GroupSelectionsLayout->addWidget(RadioButtonElements);
+ GroupSel->addButton(RadioButtonElements, 1);
/***************************************************************/
- GroupArguments = new QGroupBox(this, "GroupArguments");
- GroupArguments->setTitle(tr("SMESH_INFORMATION"));
- GroupArguments->setColumnLayout(0, Qt::Vertical);
- GroupArguments->layout()->setSpacing(0);
- GroupArguments->layout()->setMargin(0);
- GroupArgumentsLayout = new QGridLayout(GroupArguments->layout());
- GroupArgumentsLayout->setAlignment(Qt::AlignTop);
- GroupArgumentsLayout->setSpacing(6);
- GroupArgumentsLayout->setMargin(11);
+ GroupArguments = new QGroupBox(tr("SMESH_INFORMATION"), this);
+ QGridLayout* GroupArgumentsLayout = new QGridLayout(GroupArguments);
+ GroupArgumentsLayout->setSpacing(SPACING);
+ GroupArgumentsLayout->setMargin(MARGIN);
// Controls for elements selection
- TextLabelElements = new QLabel(GroupArguments, "TextLabelElements");
- TextLabelElements->setText(tr("SMESH_ID_ELEMENTS" ));
- TextLabelElements->setFixedWidth(74);
+ TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
GroupArgumentsLayout->addWidget(TextLabelElements, 0, 0);
- LineEditElements = new QLineEdit(GroupArguments, "LineEditElements");
- LineEditElements->setValidator(new SMESHGUI_IdValidator(this, "validator"));
- GroupArgumentsLayout->addMultiCellWidget(LineEditElements, 0, 0, 2, 7);
+ LineEditElements = new QLineEdit(GroupArguments);
+ LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
+ GroupArgumentsLayout->addWidget(LineEditElements, 0, 1);
// information text browser
- Info = new QTextBrowser(GroupArguments, "Info");
- Info->setHScrollBarMode(QScrollView::AlwaysOff);
- Info->setVScrollBarMode(QScrollView::AlwaysOff);
- GroupArgumentsLayout->addMultiCellWidget(Info, 1, 1, 0, 7);
-
- SMESHGUI_WhatIsDlgLayout->addWidget(GroupArguments, 2, 0);
+ Info = new QTextBrowser(GroupArguments);
+ Info->setMinimumSize(200, 150);
+ GroupArgumentsLayout->addWidget(Info, 1, 0, 1, 2);
/***************************************************************/
- GroupButtons = new QGroupBox(this, "GroupButtons");
- GroupButtons->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, GroupButtons->sizePolicy().hasHeightForWidth()));
- GroupButtons->setTitle(tr("" ));
- GroupButtons->setColumnLayout(0, Qt::Vertical);
- GroupButtons->layout()->setSpacing(0);
- GroupButtons->layout()->setMargin(0);
- GroupButtonsLayout = new QGridLayout(GroupButtons->layout());
- GroupButtonsLayout->setAlignment(Qt::AlignTop);
- GroupButtonsLayout->setSpacing(6);
- GroupButtonsLayout->setMargin(11);
- buttonHelp = new QPushButton(GroupButtons, "buttonHelp");
- buttonHelp->setText(tr("SMESH_BUT_HELP" ));
- buttonHelp->setAutoDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonHelp, 0, 3);
- QSpacerItem* spacer_9 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
- GroupButtonsLayout->addItem(spacer_9, 0, 1);
- buttonOk = new QPushButton(GroupButtons, "buttonOk");
- buttonOk->setText(tr("SMESH_BUT_OK" ));
- buttonOk->setAutoDefault(TRUE);
- buttonOk->setDefault(TRUE);
- GroupButtonsLayout->addWidget(buttonOk, 0, 0);
- SMESHGUI_WhatIsDlgLayout->addWidget(GroupButtons, 3, 0);
-
- GroupArguments->show();
- RadioButtonNodes->setChecked(TRUE);
+ GroupButtons = new QGroupBox(this);
+ QHBoxLayout* GroupButtonsLayout = new QHBoxLayout(GroupButtons);
+ GroupButtonsLayout->setSpacing(SPACING);
+ GroupButtonsLayout->setMargin(MARGIN);
+
+ buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+ buttonOk->setAutoDefault(true);
+ buttonOk->setDefault(true);
+ buttonHelp = new QPushButton(tr("SMESH_BUT_HELP"), GroupButtons);
+ buttonHelp->setAutoDefault(true);
+
+ GroupButtonsLayout->addWidget(buttonOk);
+ GroupButtonsLayout->addSpacing(10);
+ GroupButtonsLayout->addStretch();
+ GroupButtonsLayout->addWidget(buttonHelp);
+
+ SMESHGUI_WhatIsDlgLayout->addWidget(GroupMesh);
+ SMESHGUI_WhatIsDlgLayout->addWidget(GroupSelections);
+ SMESHGUI_WhatIsDlgLayout->addWidget(GroupArguments);
+ SMESHGUI_WhatIsDlgLayout->addWidget(GroupButtons);
+
+ RadioButtonNodes->setChecked(true);
mySelector = (SMESH::GetViewWindow( mySMESHGUI ))->GetSelector();
SMESH_TypeFilter* aMeshOrSubMeshFilter = new SMESH_TypeFilter (MESHorSUBMESH);
SMESH_TypeFilter* aSmeshGroupFilter = new SMESH_TypeFilter (GROUP);
- QPtrList<SUIT_SelectionFilter> aListOfFilters;
+ QList<SUIT_SelectionFilter*> aListOfFilters;
if (aMeshOrSubMeshFilter) aListOfFilters.append(aMeshOrSubMeshFilter);
if (aSmeshGroupFilter) aListOfFilters.append(aSmeshGroupFilter);
Init();
/* signals and slots connections */
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(GroupSelections, SIGNAL(clicked(int)), SLOT(SelectionsClicked(int)));
+ connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+ connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
+ connect(GroupSel, SIGNAL(buttonClicked(int)), SLOT(SelectionsClicked(int)));
- connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+ connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+ connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
- this->show(); /* displays Dialog */
SelectionsClicked(0);
SelectionIntoArgument();
//=================================================================================
SMESHGUI_WhatIsDlg::~SMESHGUI_WhatIsDlg()
{
- // no need to delete child widgets, Qt does it all for us
}
//=================================================================================
if (app)
app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
else {
- SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
- QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
- arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName),
- QObject::tr("BUT_OK"));
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ "application")).
+ arg(myHelpFileName));
}
}
TColStd_MapOfInteger newIndices;
- QStringList aListId = QStringList::split(" ", theNewText, false);
+ QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts);
for (int i = 0; i < aListId.count(); i++) {
const SMDS_MeshElement * e = RadioButtonNodes->isChecked()?
anInfo=tr("ENTITY_TYPE") + ": ";
if(e->GetType() == SMDSAbs_Node) {
anInfo+=tr("MESH_NODE")+"\n";
- const SMDS_MeshNode *en = (SMDS_MeshNode*) e;
+ //const SMDS_MeshNode *en = (SMDS_MeshNode*) e; // VSR: not used!
} else if(e->GetType() == SMDSAbs_Edge) {
anInfo+=tr("SMESH_EDGE")+"\n";
anInfo+=tr("SMESH_MESHINFO_TYPE")+": ";
gp_XYZ anXYZ(0.,0.,0.);
SMDS_ElemIteratorPtr nodeIt = e->nodesIterator();
int nbNodes = 0;
- for(; nodeIt->more(); nbNodes++) {
+ for( ; nodeIt->more(); nbNodes++) {
const SMDS_MeshNode* node = static_cast<const SMDS_MeshNode*>( nodeIt->next() );
anXYZ.Add( gp_XYZ( node->X(), node->Y(), node->Z() ) );
}
- anXYZ.Divide(e->NbNodes()) ;
+ anXYZ.Divide(e->NbNodes());
anInfo+=QString("X=%1\nY=%2\nZ=%3\n").arg(anXYZ.X()).arg(anXYZ.Y()).arg(anXYZ.Z());
Info->setText(anInfo);
}
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ if ( SMESH::GetViewWindow( mySMESHGUI ))
SelectionsClicked(RadioButtonNodes->isChecked()?0:1);
SelectionIntoArgument();
void SMESHGUI_WhatIsDlg::closeEvent (QCloseEvent*)
{
/* same than click on cancel button */
- this->ClickOnCancel();
+ ClickOnCancel();
}
//=======================================================================
if ( e->isAccepted() )
return;
- if ( e->key() == Key_F1 )
- {
- e->accept();
- ClickOnHelp();
- }
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ ClickOnHelp();
+ }
}
-// SMESH SMESHGUI : GUI for SMESH component
+// SMESH SMESHGUI : GUI for SMESH 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
+// 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 : SMESHGUI_WhatIsDlg.h
+// Author : Vladimir TURIN, Open CASCADE S.A.S.
//
-// File : SMESHGUI_WhatIsDlg.h
-// Author : Vladimir TURIN
-// Module : SMESH
-// $Header:
#ifndef SMESHGUI_WHATISDLG_H
#define SMESHGUI_WHATISDLG_H
-#include "LightApp_SelectionMgr.h"
+// Qt includes
+#include <QDialog>
-#include "SMESH_LogicalFilter.hxx"
-
-// QT Includes
-#include <qdialog.h>
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QGridLayout;
-class QButtonGroup;
class QGroupBox;
class QLabel;
class QLineEdit;
class QPushButton;
class QRadioButton;
-class QCheckBox;
class QTextBrowser;
class SMESHGUI;
-class SMESHGUI_SpinBox;
class SMESH_Actor;
-class SVTK_ViewWindow;
class SVTK_Selector;
-
-// IDL Headers
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
+class LightApp_SelectionMgr;
+class SMESH_LogicalFilter;
//=================================================================================
// class : SMESHGUI_WhatIsDlg
class SMESHGUI_WhatIsDlg : public QDialog
{
Q_OBJECT
-
+
public:
-
- SMESHGUI_WhatIsDlg( SMESHGUI*,
- const char* name = 0,
- bool modal = FALSE,
- WFlags fl = 0);
+ SMESHGUI_WhatIsDlg( SMESHGUI* );
~SMESHGUI_WhatIsDlg();
private:
-
- void Init (bool ResetControls = true);
- void closeEvent (QCloseEvent*);
- void enterEvent (QEvent*); /* mouse enter the QWidget */
- void hideEvent (QHideEvent*); /* ESC key */
- void keyPressEvent(QKeyEvent*);
+ void Init( bool = true );
+ void closeEvent( QCloseEvent* );
+ void enterEvent( QEvent* ); /* mouse enter the QWidget */
+ void hideEvent( QHideEvent* ); /* ESC key */
+ void keyPressEvent( QKeyEvent* );
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
SMESH_Actor* myActor;
SMESH_LogicalFilter* myMeshOrSubMeshOrGroupFilter;
- QButtonGroup* GroupSelections;
- QRadioButton* RadioButtonNodes;
- QRadioButton* RadioButtonElements;
- QGroupBox* GroupButtons;
- QPushButton* buttonOk;
- QPushButton* buttonHelp;
- QGroupBox* GroupArguments;
- QGroupBox* GroupMesh;
- QLabel* TextLabelElements;
- QLineEdit* LineEditElements;
- QLabel* MeshLabel;
- QLabel* MeshName;
-
- QTextBrowser* Info;
+ QGroupBox* GroupSelections;
+ QRadioButton* RadioButtonNodes;
+ QRadioButton* RadioButtonElements;
+ QGroupBox* GroupButtons;
+ QPushButton* buttonOk;
+ QPushButton* buttonHelp;
+ QGroupBox* GroupArguments;
+ QGroupBox* GroupMesh;
+ QLabel* TextLabelElements;
+ QLineEdit* LineEditElements;
+ QLabel* MeshLabel;
+ QLineEdit* MeshName;
+
+ QTextBrowser* Info;
- QString myHelpFileName;
+ QString myHelpFileName;
private slots:
-
- void SelectionsClicked(int selectionId);
- void ClickOnOk();
- void ClickOnCancel();
- void ClickOnHelp();
- void SelectionIntoArgument() ;
- void DeactivateActiveDialog() ;
- void ActivateThisDialog() ;
- void onTextChange(const QString&);
-
-protected:
-
- QGridLayout* SMESHGUI_WhatIsDlgLayout;
- QGridLayout* GroupSelectionsLayout;
- QGridLayout* GroupMeshLayout;
- QGridLayout* GroupButtonsLayout;
- QGridLayout* GroupArgumentsLayout;
+ void SelectionsClicked( int );
+ void ClickOnOk();
+ void ClickOnCancel();
+ void ClickOnHelp();
+ void SelectionIntoArgument();
+ void DeactivateActiveDialog();
+ void ActivateThisDialog();
+ void onTextChange( const QString& );
};
#endif // SMESHGUI_WHATISDLG_H
-// SMESH SMESHGUI : reading of xml file with list of available hypotheses and algorithms
-// Copyright (C) 2003 CEA
+// SMESH SMESHGUI : reading of xml file with list of available hypotheses and algorithms
//
-// 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.
+// Copyright (C) 2003 CEA
//
-
-// 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.
+// 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.
//
-// 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
+// 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.
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// 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 : SMESHGUI_XmlHandler.cxx
+// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
//
-// File : SMESHGUI_XmlHandler.cxx
-// Author : Julia DOROVSKIKH
-// Module : SMESH
-// $Header$
-#define INCLUDE_MENUITEM_DEF
-
-// QT Include
-#include <qfileinfo.h>
-#include <qstringlist.h>
+// SMESH includes
+#include "SMESHGUI_XmlHandler.h"
#include "SMESHGUI.h"
-#include "SUIT_ResourceMgr.h"
-#include "SUIT_Desktop.h"
-
-#include "SMESHGUI_XmlHandler.h"
#include "SMESHGUI_Hypotheses.h"
-#include "SMESHGUI_Utils.h"
-#include "utilities.h"
+// SALOME GUI includes
+#include "SUIT_ResourceMgr.h"
-using namespace std;
+// SALOME KERNEL includes
+#include <utilities.h>
/*!
Constructor
bool SMESHGUI_XmlHandler::startDocument()
{
myErrorProt = "";
- return TRUE;
+ return true;
}
/*!
QString aResName = atts.value("resources");
if (aResName != "")
{
- MESSAGE("Loading Resources " << aResName);
+ MESSAGE("Loading Resources " << aResName.toLatin1().data());
SUIT_ResourceMgr* resMgr = SMESHGUI::resourceMgr();
resMgr->loadTranslator("resources",aResName+"_msg_en.qm");
resMgr->loadTranslator("resources",aResName+"_images.qm");
QString aDimStr = atts.value("dim");
aDimStr = aDimStr.remove( ' ' );
- QStringList aDimList = QStringList::split( ',', aDimStr );
+ QStringList aDimList = aDimStr.split( ',', QString::SkipEmptyParts );
QStringList::iterator anIter;
bool isOk;
- QValueList<int> aDim;
+ QList<int> aDim;
for ( anIter = aDimList.begin(); anIter != aDimList.end(); ++anIter )
{
int aVal = (*anIter).toInt( &isOk );
QString aStr = atts.value( name[i] );
if ( !aStr.isEmpty() ) {
aStr.remove( ' ' );
- attr[ i ] = QStringList::split( ',', aStr );
+ attr[ i ] = aStr.split( ',', QString::SkipEmptyParts );
}
}
if (qName == "algorithm")
{
- myAlgorithmsMap[(char*)aHypAlType.latin1()] = aHypData;
+ myAlgorithmsMap[aHypAlType.toLatin1().data()] = aHypData;
}
else
{
- myHypothesesMap[(char*)aHypAlType.latin1()] = aHypData;
+ myHypothesesMap[aHypAlType.toLatin1().data()] = aHypData;
}
}
}
QString aHypos = isHypo ? atts.value("hypos") : atts.value("algos");
aHypos = aHypos.remove( ' ' );
QStringList* aHypoList = isHypo ? & aHypoSet->HypoList : & aHypoSet->AlgoList;
- *aHypoList = QStringList::split( ',', aHypos );
+ *aHypoList = aHypos.split( ',', QString::SkipEmptyParts );
}
}
}
else
{
// error
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
*/
bool SMESHGUI_XmlHandler::endElement (const QString&, const QString&, const QString&)
{
- return TRUE;
+ return true;
}
bool SMESHGUI_XmlHandler::characters (const QString& ch)
{
// we are not interested in whitespaces
- QString ch_simplified = ch.simplifyWhiteSpace();
+ QString ch_simplified = ch.simplified();
if ( ch_simplified.isEmpty() )
- return TRUE;
- return TRUE;
+ return true;
+ return true;
}
-// SMESH SMESHGUI : reading of xml file with list of available hypotheses and algorithms
+// SMESH SMESHGUI : reading of xml file with list of available hypotheses and algorithms
//
-// Copyright (C) 2003 CEA
+// Copyright (C) 2003 CEA
//
-// 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
+// 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 : SMESHGUI_XmlHandler.h
+// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
//
-// File : SMESHGUI_XmlHandler.cxx
-// Author : Julia DOROVSKIKH
-// Module : SMESH
-// $Header$
-#ifndef SMESHGUI_XmlHandler_HeaderFile
-#define SMESHGUI_XmlHandler_HeaderFile
+#ifndef SMESHGUI_XMLHANDLER_H
+#define SMESHGUI_XMLHANDLER_H
+// SMESH includes
#include "SMESH_SMESHGUI.hxx"
-#include "SMESHGUI_Hypotheses.h"
+// Qt includes
+#include <QXmlDefaultHandler>
-#include <qxml.h>
+// STL includes
+#include <string>
#include <map>
#include <list>
+class HypothesisData;
+class HypothesesSet;
+
class SMESHGUI_EXPORT SMESHGUI_XmlHandler : public QXmlDefaultHandler
{
- public:
+public:
SMESHGUI_XmlHandler();
virtual ~SMESHGUI_XmlHandler();
- bool startDocument();
- bool startElement( const QString& namespaceURI, const QString& localName,
- const QString& qName, const QXmlAttributes& atts );
- bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName );
- bool characters( const QString& ch );
+ bool startDocument();
+ bool startElement( const QString&, const QString&,
+ const QString&, const QXmlAttributes& );
+ bool endElement( const QString&, const QString&, const QString& );
+ bool characters( const QString& );
- QString errorString();
- QString errorProtocol();
- bool fatalError (const QXmlParseException& exception);
+ QString errorString();
+ QString errorProtocol();
+ bool fatalError( const QXmlParseException& );
- public:
+public:
std::map<std::string, HypothesisData*> myHypothesesMap;
std::map<std::string, HypothesisData*> myAlgorithmsMap;
- std::list<HypothesesSet*> myListOfHypothesesSets;
+ std::list<HypothesesSet*> myListOfHypothesesSets;
- private:
- QString myErrorProt;
- QString myPluginName;
- QString myServerLib;
- QString myClientLib;
+private:
+ QString myErrorProt;
+ QString myPluginName;
+ QString myServerLib;
+ QString myClientLib;
};
-
-#endif
+#endif // SMESHGUI_XMLHANDLER_H
+++ /dev/null
-// SMESH SMESHGUI : GUI for SMESH 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 : SMESHGUI_aParameter.h
-// Module : SMESH
-// $Header$
-
-#ifndef SMESHGUI_aParameter_H
-#define SMESHGUI_aParameter_H
-
-#include <boost/shared_ptr.hpp>
-#include <qstringlist.h>
-#include <qmap.h>
-#include <qtable.h>
-
-#include <SALOMEconfig.h>
-#include CORBA_SERVER_HEADER(SMESH_Mesh)
-
-class QWidget;
-class SMESHGUI_aParameter;
-
-typedef boost::shared_ptr<SMESHGUI_aParameter> SMESHGUI_aParameterPtr;
-
-/*!
- * \brief This class is the base class of all parameters
- */
-class SMESHGUI_aParameter
-{
-public:
- typedef bool (*VALIDATION_FUNC)( SMESHGUI_aParameter* );
-
- SMESHGUI_aParameter(const QString& label, const bool = false );
- virtual ~SMESHGUI_aParameter();
-
- enum Type { INT, DOUBLE, STRING, ENUM, BOOL, TABLE };
- virtual Type GetType() const = 0;
- virtual bool GetNewInt( int & Value ) const = 0;
- virtual bool GetNewDouble( double & Value ) const = 0;
- virtual bool GetNewText( QString & Value ) const = 0;
- virtual void TakeValue( QWidget* ) = 0;
- virtual QWidget* CreateWidget( QWidget* ) const = 0;
- virtual void InitializeWidget( QWidget* ) const = 0;
-
- bool needPreview() const;
-
- /*!
- * \brief Returns string representation of signal emitted when value in corrsponding widget is changed
- */
- virtual QString sigValueChanged() const;
-
- QString & Label();
-
-protected:
- QString _label;
- bool _needPreview;
-};
-
-/*!
- * \brief This class provides parameter with integer value
- */
-class SMESHGUI_intParameter: public SMESHGUI_aParameter
-{
-public:
- SMESHGUI_intParameter(const int initValue = 0,
- const QString& label = QString::null,
- const int bottom = 0,
- const int top = 1000,
- const bool = false );
- int & InitValue() { return _initValue; }
- int & Top() { return _top; }
- int & Bottom() { return _bottom; }
- virtual Type GetType() const;
- virtual bool GetNewInt( int & Value ) const;
- virtual bool GetNewDouble( double & Value ) const;
- virtual bool GetNewText( QString & Value ) const;
- virtual void TakeValue( QWidget* );
- virtual QWidget* CreateWidget( QWidget* ) const;
- virtual void InitializeWidget( QWidget* ) const;
-
- virtual QString sigValueChanged() const;
-
-protected:
- int _top, _bottom;
- int _initValue, _newValue;
-};
-
-/*!
- * \brief This class provides parameter with double value
- */
-class SMESHGUI_doubleParameter: public SMESHGUI_aParameter
-{
-public:
- SMESHGUI_doubleParameter(const double initValue = 0.0,
- const QString& label = QString::null,
- const double bottom = -1E6,
- const double top = +1E6,
- const double step = 1.0,
- const int decimals = 3,
- const bool = false);
- double & InitValue() { return _initValue; }
- double & Top() { return _top; }
- double & Bottom() { return _bottom; }
- double & Step() { return _step; }
- int & Decimals() { return _decimals; }
- virtual Type GetType() const;
- virtual bool GetNewInt( int & Value ) const;
- virtual bool GetNewDouble( double & Value ) const;
- virtual bool GetNewText( QString & Value ) const;
- virtual QWidget* CreateWidget( QWidget* ) const;
- virtual void InitializeWidget( QWidget* ) const;
- virtual void TakeValue( QWidget* );
-
- virtual QString sigValueChanged() const;
-
-protected:
- double _top, _bottom, _step;
- double _initValue, _newValue;
- int _decimals;
-};
-
-/*!
- * \brief This class provides parameter with string value
- */
-class SMESHGUI_strParameter: public SMESHGUI_aParameter
-{
-public:
- SMESHGUI_strParameter( const QString& initValue = "",
- const QString& label = QString::null,
- const bool = false );
- QString& InitValue() { return _initValue; }
- virtual Type GetType() const;
- virtual bool GetNewInt( int & Value ) const;
- virtual bool GetNewDouble( double & Value ) const;
- virtual bool GetNewText( QString & Value ) const;
- virtual QWidget* CreateWidget( QWidget* ) const;
- virtual void InitializeWidget( QWidget* ) const;
- virtual void TakeValue( QWidget* );
-
- virtual QString sigValueChanged() const;
-
-protected:
- QString _initValue, _newValue;
-};
-
-
-/*!
- * \brief This class represents the base parameter which contains dependency of
- * shown state of other parameters on value of current
- */
-class SMESHGUI_dependParameter: public SMESHGUI_aParameter
-{
-public:
- /*!
- * \brief This map describes what parameters must be shown when this parameter has value as key
- * The list contains some indices of parameters (for example, order in some list)
- * Value is integer based 0. If map is empty, it means that there is no dependencies.
- */
- typedef QValueList< int > IntList;
- typedef QMap< int, IntList > ShownMap;
-
-public:
- SMESHGUI_dependParameter( const QString& = QString::null, const bool = false );
-
- const ShownMap& shownMap() const;
- ShownMap& shownMap();
-
-private:
- ShownMap myShownMap;
-};
-
-/*!
- * \brief This class represents parameter which can have value from fixed set
- */
-class SMESHGUI_enumParameter: public SMESHGUI_dependParameter
-{
-public:
- /*!
- * \brief Creates parameter with set of values 'values', default value 'init' and title 'label'
- * Every value can be described both by integer based 0 or by string value
- */
- SMESHGUI_enumParameter( const QStringList& values,
- const int init = 0,
- const QString& label = QString::null,
- const bool = false );
- virtual ~SMESHGUI_enumParameter();
-
- /*!
- * \brief Returns count of possible values
- */
- int Count() const;
-
- int& InitValue() { return myInitValue; }
- virtual Type GetType() const;
- virtual bool GetNewInt( int& ) const;
- virtual bool GetNewDouble( double& ) const;
- virtual bool GetNewText( QString& ) const;
- virtual QWidget* CreateWidget( QWidget* ) const;
- virtual void InitializeWidget( QWidget* ) const;
- virtual void TakeValue( QWidget* );
-
- virtual QString sigValueChanged() const;
-
-protected:
- int myInitValue, myValue;
- QStringList myValues;
-};
-
-
-/*!
- * \brief This class represents parameter which can have value true or false
- */
-class SMESHGUI_boolParameter: public SMESHGUI_dependParameter
-{
-public:
- SMESHGUI_boolParameter( const bool = false,
- const QString& = QString::null,
- const bool = false );
- virtual ~SMESHGUI_boolParameter();
-
- bool& InitValue() { return myInitValue; }
- virtual Type GetType() const;
- virtual bool GetNewInt( int& ) const;
- virtual bool GetNewDouble( double& ) const;
- virtual bool GetNewText( QString& ) const;
- virtual QWidget* CreateWidget( QWidget* ) const;
- virtual void InitializeWidget( QWidget* ) const;
- virtual void TakeValue( QWidget* );
-
- virtual QString sigValueChanged() const;
-
-protected:
- bool myInitValue, myValue;
-};
-
-
-class QButton;
-class SMESHGUI_tableParameter;
-
-
-/*!
- * \brief This class represents custom table. It has only double values and
- editor for every cell has validator
- */
-class SMESHGUI_Table : public QTable
-{
- Q_OBJECT
-
-public:
- SMESHGUI_Table( const SMESHGUI_tableParameter*, int numRows, int numCols, QWidget* = 0, const char* = 0 );
- virtual ~SMESHGUI_Table();
-
-/*!
- * \brief Hides current editor of cell
- */
- void stopEditing();
-
- virtual QSize sizeHint() const;
-
-/*!
- * \brief Returns parameters of double validator corresponding to cell (row,col)
- */
- void validator( const int row, const int col, double&, double&, int& );
-
-/*!
- * \brief Sets the double validator parameters to every cell in row range [rmin,rmax]
- * and column range [cmin,cmax].
- * If rmin=-1 then rmin is set to 0, if rmax=-1 then rmax = last row.
- * Analogically cmin and cmax are set
- */
- void setValidator( const double, const double, const int,
- const int rmin = -1, const int rmax = -1,
- const int cmin = -1, const int cmax = -1 );
-
-protected:
- virtual void keyPressEvent( QKeyEvent* );
- virtual bool eventFilter( QObject*, QEvent* );
- virtual QWidget* createEditor( int, int, bool ) const;
-
-private:
- SMESHGUI_tableParameter* myParam;
-};
-
-
-/*!
- * \brief This class represents frame for table and buttons
- */
-class SMESHGUI_TableFrame : public QFrame
-{
- Q_OBJECT
-
-public:
-/*!
- * \brief Values corresponding to buttons for table resize
- */
- typedef enum { ADD_COLUMN, REMOVE_COLUMN, ADD_ROW, REMOVE_ROW } Button;
-
-public:
- SMESHGUI_TableFrame( const SMESHGUI_tableParameter*, QWidget* );
- ~SMESHGUI_TableFrame();
-
- SMESHGUI_Table* table() const;
-
-/*!
- * \brief Changes shown state of some button for table resize
- */
- void setShown( const Button, const bool );
-
-/*!
- * \brief Returns shown state of some button for table resize
- */
- bool isShown( const Button ) const;
-
-private:
- QButton* button( const Button ) const;
-
-private slots:
- void onButtonClicked();
-
-signals:
-/*!
- * \brief This signal is emitted if some of button for table resize is clicked
- * Second parameter is current column for ADD_COLUMN, REMOVE_COLUMN buttons
- * and current row for ADD_ROW, REMOVE_ROW buttons. Take into account that
- * this object resize table ( returned by table() ) automatically
- */
- void toEdit( SMESHGUI_TableFrame::Button, int );
- void valueChanged( int, int );
-
-private:
- QButton *myAddColumn, *myRemoveColumn, *myAddRow, *myRemoveRow;
- SMESHGUI_Table* myTable;
-};
-
-
-/*!
- * \brief This class represents parameter which can have two-dimensional array of values
- */
-class SMESHGUI_tableParameter: public QObject, public SMESHGUI_aParameter
-{
- Q_OBJECT
-
-public:
-/*!
- * \brief Creates table parameter with default value 'init' and title 'label'.
- * The default value means that by default the table is filled with default value
- * and if new column or row is added then it is filled with default value
- */
- SMESHGUI_tableParameter( const double init = 0.0,
- const QString& label = QString::null,
- const bool preview = false );
- virtual ~SMESHGUI_tableParameter();
-
- virtual Type GetType() const;
- virtual bool GetNewInt( int& ) const;
- virtual bool GetNewDouble( double& ) const;
- virtual bool GetNewText( QString& ) const;
- virtual QWidget* CreateWidget( QWidget* ) const;
- virtual void InitializeWidget( QWidget* ) const;
- virtual void TakeValue( QWidget* );
-
- static void sortData( SMESH::double_array& );
-
-/*!
- * \brief Updates look of widget in accordance with all parameters of this object
- */
- void update( QWidget* ) const;
-
-/*!
- * \brief Returns data taken from widget. Please don't forget to call TakeValue before.
- */
- void data( SMESH::double_array& ) const;
-
-/*!
- * \brief Sets data. The InitializeWidget must be called in order to change values in widget
- */
- void setData( const SMESH::double_array& );
-
-/*!
- * \brief Sets count of columns and updates widget
- */
- void setColCount( const int, QWidget* = 0 );
-
-/*!
- * \brief Sets count of rows and updates widget
- */
- void setRowCount( const int, QWidget* = 0 );
-
-/*!
- * \brief Binds count of columns to some parameter and updates widget. Take into account that
- * if this parameter is changed, the update() must be called to resize table
- */
- void setColCount( const SMESHGUI_aParameterPtr, QWidget* = 0 );
-
-/*!
- * \brief Binds count of rows to some parameter and updates widget. Take into account that
- * if this parameter is changed, the update() must be called to resize table
- */
- void setRowCount( const SMESHGUI_aParameterPtr, QWidget* = 0 );
-
-/*!
- * \brief Enables or disables to change count of columns by buttons
- */
- void setEditCols( const bool );
-
-/*!
- * \brief Enables or disables to change count of rows by buttons
- */
- void setEditRows( const bool );
-
- virtual QString sigValueChanged() const;
-
- void setValidator( const int col, const double, const double, const int );
- void validator( const int col, double&, double&, int& ) const;
-
-/*!
- * \brief These methods allow to read and change name of column
- */
- void setColName( const int, const QString& );
- QString colName( const int ) const;
-
-private slots:
- void onEdit( SMESHGUI_TableFrame::Button, int );
- void onEdit( SMESHGUI_Table*, SMESHGUI_TableFrame::Button, int );
-
-private:
- void setItems( QWidget*, int = -1, int = -1, int = -1, int = -1 ) const;
-
-private:
- typedef struct
- {
- double myMin, myMax;
- int myDecimals;
- } ValidatorInfo;
-
- typedef QMap<int, ValidatorInfo> ValidatorsMap;
-
-private:
- int myColsInt, myRowsInt;
- SMESHGUI_aParameterPtr myCols, myRows;
- double myInitValue;
- SMESH::double_array myData;
- ValidatorsMap myValidators;
- bool myEditCols, myEditRows;
- QMap< int, QString > myColNames;
-
- friend class SMESHGUI_Table;
-};
-
-#endif // SMESHGUI_aParameter.h
-
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+// File : SMESH_SMESHGUI.hxx
+// Author : Alexander BORODIN, Open CASCADE S.A.S.
//
-// File : SMESH_SMESHGUI.hxx
-// Author : Alexander A. BORODIN
-// Module : SMESH
-#ifndef _SMESH_SMESHGUI_HXX_
-#define _SMESH_SMESHGUI_HXX_
+#ifndef SMESH_SMESHGUI_HXX
+#define SMESH_SMESHGUI_HXX
#ifdef WNT
#if defined SMESHGUI_EXPORTS
#define SMESHGUI_EXPORT
#endif
-#endif
+#endif // SMESH_SMESHGUI_HXX
--- /dev/null
+<!DOCTYPE TS>
+<TS version="1.1" >
+ <context>
+ <name>@default</name>
+ <message>
+ <source>ICON_APPEND</source>
+ <translation>mesh_add.png</translation>
+ </message>
+ <message>
+ <source>ICON_CONSTRUCT_GROUP</source>
+ <translation>mesh_make_group.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_ADD_ALGORITHM</source>
+ <translation>mesh_set_algo.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_ADD_HYPOTHESIS</source>
+ <translation>mesh_set_hypo.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_ADD_SUBMESH</source>
+ <translation>mesh_add_sub.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_CONNECTIVITY</source>
+ <translation>mesh_connectivity.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_EDGE</source>
+ <translation>mesh_line.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_EDIT_MESH</source>
+ <translation>mesh_edit.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_HEXAS</source>
+ <translation>mesh_hexa.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_INIT_MESH</source>
+ <translation>mesh_init.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MESH_DIAGONAL</source>
+ <translation>mesh_diagonal.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MESH_ORIENTATION</source>
+ <translation>mesh_orientation.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MESH_ROTATION</source>
+ <translation>mesh_rotation.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MOVE_NODE</source>
+ <translation>mesh_move_node.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_NODE</source>
+ <translation>mesh_vertex.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRANGLE</source>
+ <translation>mesh_quad.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_EDGE</source>
+ <translation>mesh_quad_edge.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_HEXAHEDRON</source>
+ <translation>mesh_quad_hexahedron.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_PENTAHEDRON</source>
+ <translation>mesh_quad_pentahedron.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_PYRAMID</source>
+ <translation>mesh_quad_pyramid.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_QUADRANGLE</source>
+ <translation>mesh_quad_quadrangle.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_TETRAHEDRON</source>
+ <translation>mesh_quad_tetrahedron.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_TRIANGLE</source>
+ <translation>mesh_quad_triangle.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_REM_ELEMENT</source>
+ <translation>mesh_rem_element.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_REM_NODE</source>
+ <translation>mesh_rem_node.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_RENUMBERING_ELEMENTS</source>
+ <translation>mesh_renumbering_elements.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_RENUMBERING_NODES</source>
+ <translation>mesh_renumbering_nodes.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_SMOOTHING</source>
+ <translation>mesh_smoothing.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_TETRAS</source>
+ <translation>mesh_tetra.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_TRIANGLE</source>
+ <translation>mesh_triangle.png</translation>
+ </message>
+ <message>
+ <source>ICON_EDIT_GROUP</source>
+ <translation>mesh_edit_group.png</translation>
+ </message>
+ <message>
+ <source>ICON_OBJBROWSER_SMESH</source>
+ <translation>mesh.png</translation>
+ </message>
+ <message>
+ <source>ICON_PATTERN_2d</source>
+ <translation>mesh_algo_mefisto.png</translation>
+ </message>
+ <message>
+ <source>ICON_PATTERN_3d</source>
+ <translation>mesh_algo_hexa.png</translation>
+ </message>
+ <message>
+ <source>ICON_PATTERN_SAMPLE_2D</source>
+ <translation>pattern_sample_2d.png</translation>
+ </message>
+ <message>
+ <source>ICON_PATTERN_SAMPLE_3D</source>
+ <translation>pattern_sample_3D.png</translation>
+ </message>
+ <message>
+ <source>ICON_REMOVE</source>
+ <translation>mesh_remove.png</translation>
+ </message>
+ <message>
+ <source>ICON_SELECT</source>
+ <translation>select1.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_MERGE_NODES</source>
+ <translation>mesh_merge_nodes.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SEWING_BORDERTOSIDE</source>
+ <translation>mesh_sew_bordertoside.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SEWING_CONFORM_FREEBORDERS</source>
+ <translation>mesh_sew_conform_freeborders.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SEWING_FREEBORDERS</source>
+ <translation>mesh_sew_freeborders.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SEWING_SIDEELEMENTS</source>
+ <translation>mesh_sew_sideelements.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SYMMETRY_AXIS</source>
+ <translation>mesh_symmetry_axis.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SYMMETRY_PLANE</source>
+ <translation>mesh_symmetry_plane.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SYMMETRY_POINT</source>
+ <translation>mesh_symmetry_point.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TRANSLATION_POINTS</source>
+ <translation>mesh_translation_points.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TRANSLATION_VECTOR</source>
+ <translation>mesh_translation_vector.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO</source>
+ <translation>mesh_tree_algo.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_GROUP</source>
+ <translation>mesh_tree_group.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO</source>
+ <translation>mesh_tree_hypo.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_MESH</source>
+ <translation>mesh_tree_mesh.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_MESH_IMPORTED</source>
+ <translation>mesh_tree_importedmesh.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_MESH_WARN</source>
+ <translation>mesh_tree_mesh_warn.png</translation>
+ </message>
+ </context>
+</TS>
--- /dev/null
+<!DOCTYPE TS>
+<TS version="1.1" >
+ <context>
+ <name>@default</name>
+ <message>
+ <source>ICON_ADV_INFO</source>
+ <translation>advanced_mesh_info.png</translation>
+ </message>
+ <message>
+ <source>ICON_ANGLE</source>
+ <translation>mesh_angle.png</translation>
+ </message>
+ <message>
+ <source>ICON_APPEND</source>
+ <translation>mesh_add.png</translation>
+ </message>
+ <message>
+ <source>ICON_AREA</source>
+ <translation>mesh_area.png</translation>
+ </message>
+ <message>
+ <source>ICON_ASPECT</source>
+ <translation>mesh_aspect.png</translation>
+ </message>
+ <message>
+ <source>ICON_ASPECT_3D</source>
+ <translation>mesh_aspect_3d.png</translation>
+ </message>
+ <message>
+ <source>ICON_BUILD_COMPOUND</source>
+ <translation>mesh_build_compound.png</translation>
+ </message>
+ <message>
+ <source>ICON_COMPUTE</source>
+ <translation>mesh_compute.png</translation>
+ </message>
+ <message>
+ <source>ICON_CONNECTION</source>
+ <translation>mesh_multi_edges.png</translation>
+ </message>
+ <message>
+ <source>ICON_CONNECTION_2D</source>
+ <translation>mesh_multi_edges_2d.png</translation>
+ </message>
+ <message>
+ <source>ICON_CONSTRUCT_GROUP</source>
+ <translation>mesh_make_group.png</translation>
+ </message>
+ <message>
+ <source>ICON_CONV_TO_QUAD</source>
+ <translation>mesh_conv_to_quad.png</translation>
+ </message>
+ <message>
+ <source>ICON_CUT</source>
+ <translation>mesh_cutGroups.png</translation>
+ </message>
+ <message>
+ <source>ICON_CUTQUAD</source>
+ <translation>mesh_cutquad.png</translation>
+ </message>
+ <message>
+ <source>ICON_DELETE</source>
+ <translation>delete.png</translation>
+ </message>
+ <message>
+ <source>ICON_DEL_GROUP</source>
+ <translation>mesh_deleteGroups.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_ADD_ALGORITHM</source>
+ <translation>mesh_set_algo.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_ADD_HYPOTHESIS</source>
+ <translation>mesh_set_hypo.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_ADD_SUBMESH</source>
+ <translation>mesh_add_sub.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_BUILD_COMPOUND_MESH</source>
+ <translation>mesh_build_compound.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_CONNECTIVITY</source>
+ <translation>mesh_connectivity.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_EDGE</source>
+ <translation>mesh_line.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_EDIT_MESH</source>
+ <translation>mesh_edit.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_HEXAS</source>
+ <translation>mesh_hexa.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_INIT_MESH</source>
+ <translation>mesh_init.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MERGE_ELEMENTS</source>
+ <translation>mesh_merge_elements.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MESH_DIAGONAL</source>
+ <translation>mesh_diagonal.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MESH_ORIENTATION</source>
+ <translation>mesh_orientation.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MESH_ROTATION</source>
+ <translation>mesh_rotation.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MESH_THROU_POINT</source>
+ <translation>mesh_node_to_point.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MOVE_NODE</source>
+ <translation>mesh_move_node.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_NODE</source>
+ <translation>mesh_vertex.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_POLYGON</source>
+ <translation>mesh_polygon.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_POLYHEDRON</source>
+ <translation>mesh_polyhedron.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRANGLE</source>
+ <translation>mesh_quad.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_EDGE</source>
+ <translation>mesh_quad_edge.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_HEXAHEDRON</source>
+ <translation>mesh_quad_hexahedron.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_PENTAHEDRON</source>
+ <translation>mesh_quad_pentahedron.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_PYRAMID</source>
+ <translation>mesh_quad_pyramid.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_QUADRANGLE</source>
+ <translation>mesh_quad_quadrangle.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_TETRAHEDRON</source>
+ <translation>mesh_quad_tetrahedron.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_QUADRATIC_TRIANGLE</source>
+ <translation>mesh_quad_triangle.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_REM_ELEMENT</source>
+ <translation>mesh_rem_element.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_REM_NODE</source>
+ <translation>mesh_rem_node.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_RENUMBERING_ELEMENTS</source>
+ <translation>mesh_renumbering_elements.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_RENUMBERING_NODES</source>
+ <translation>mesh_renumbering_nodes.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_SMOOTHING</source>
+ <translation>mesh_smoothing.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_TETRAS</source>
+ <translation>mesh_tetra.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_TRIANGLE</source>
+ <translation>mesh_triangle.png</translation>
+ </message>
+ <message>
+ <source>ICON_EDIT_GROUP</source>
+ <translation>mesh_edit_group.png</translation>
+ </message>
+ <message>
+ <source>ICON_EXTRUSION</source>
+ <translation>mesh_extrusion.png</translation>
+ </message>
+ <message>
+ <source>ICON_EXTRUSION_ALONG</source>
+ <translation>mesh_extrusionpath.png</translation>
+ </message>
+ <message>
+ <source>ICON_FILE_OPEN</source>
+ <translation>open.png</translation>
+ </message>
+ <message>
+ <source>ICON_FREE_EDGE</source>
+ <translation>mesh_free_edges.png</translation>
+ </message>
+ <message>
+ <source>ICON_FREE_EDGE_2D</source>
+ <translation>mesh_free_edges_2d.png</translation>
+ </message>
+ <message>
+ <source>ICON_HYPO</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_HYPO_EDIT</source>
+ <translation>mesh_hypo_edit.png</translation>
+ </message>
+ <message>
+ <source>ICON_INTERSECT</source>
+ <translation>mesh_intersectGroups.png</translation>
+ </message>
+ <message>
+ <source>ICON_LENGTH</source>
+ <translation>mesh_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_LENGTH_2D</source>
+ <translation>mesh_length_2d.png</translation>
+ </message>
+ <message>
+ <source>ICON_MAP</source>
+ <translation>mesh_pattern.png</translation>
+ </message>
+ <message>
+ <source>ICON_OBJBROWSER_SMESH</source>
+ <translation>mesh.png</translation>
+ </message>
+ <message>
+ <source>ICON_PATTERN_2d</source>
+ <translation>mesh_algo_mefisto.png</translation>
+ </message>
+ <message>
+ <source>ICON_PATTERN_3d</source>
+ <translation>mesh_algo_hexa.png</translation>
+ </message>
+ <message>
+ <source>ICON_PATTERN_SAMPLE_2D</source>
+ <translation>pattern_sample_2d.png</translation>
+ </message>
+ <message>
+ <source>ICON_PATTERN_SAMPLE_3D</source>
+ <translation>pattern_sample_3D.png</translation>
+ </message>
+ <message>
+ <source>ICON_POINTS</source>
+ <translation>mesh_points.png</translation>
+ </message>
+ <message>
+ <source>ICON_REMOVE</source>
+ <translation>mesh_remove.png</translation>
+ </message>
+ <message>
+ <source>ICON_REVOLUTION</source>
+ <translation>mesh_revolution.png</translation>
+ </message>
+ <message>
+ <source>ICON_SELECT</source>
+ <translation>select1.png</translation>
+ </message>
+ <message>
+ <source>ICON_SHADE</source>
+ <translation>mesh_shading.png</translation>
+ </message>
+ <message>
+ <source>ICON_SHRINK</source>
+ <translation>mesh_shrink.png</translation>
+ </message>
+ <message>
+ <source>ICON_SKEW</source>
+ <translation>mesh_skew.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_MERGE_NODES</source>
+ <translation>mesh_merge_nodes.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SEWING_BORDERTOSIDE</source>
+ <translation>mesh_sew_bordertoside.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SEWING_CONFORM_FREEBORDERS</source>
+ <translation>mesh_sew_conform_freeborders.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SEWING_FREEBORDERS</source>
+ <translation>mesh_sew_freeborders.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SEWING_SIDEELEMENTS</source>
+ <translation>mesh_sew_sideelements.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SYMMETRY_AXIS</source>
+ <translation>mesh_symmetry_axis.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SYMMETRY_PLANE</source>
+ <translation>mesh_symmetry_plane.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_SYMMETRY_POINT</source>
+ <translation>mesh_symmetry_point.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TRANSLATION_POINTS</source>
+ <translation>mesh_translation_points.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TRANSLATION_VECTOR</source>
+ <translation>mesh_translation_vector.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO</source>
+ <translation>mesh_tree_algo.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_GROUP</source>
+ <translation>mesh_tree_group.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO</source>
+ <translation>mesh_tree_hypo.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_MESH</source>
+ <translation>mesh_tree_mesh.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_MESH_IMPORTED</source>
+ <translation>mesh_tree_importedmesh.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_MESH_PARTIAL</source>
+ <translation>mesh_tree_mesh_partial.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_MESH_WARN</source>
+ <translation>mesh_tree_mesh_warn.png</translation>
+ </message>
+ <message>
+ <source>ICON_STD_INFO</source>
+ <translation>standard_mesh_info.png</translation>
+ </message>
+ <message>
+ <source>ICON_TAPER</source>
+ <translation>mesh_taper.png</translation>
+ </message>
+ <message>
+ <source>ICON_UNION</source>
+ <translation>mesh_unionGroups.png</translation>
+ </message>
+ <message>
+ <source>ICON_UNION2TRI</source>
+ <translation>mesh_union2tri.png</translation>
+ </message>
+ <message>
+ <source>ICON_UNIONTRI</source>
+ <translation>mesh_uniontri.png</translation>
+ </message>
+ <message>
+ <source>ICON_UPDATE</source>
+ <translation>mesh_update.png</translation>
+ </message>
+ <message>
+ <source>ICON_VOLUME_3D</source>
+ <translation>mesh_volume_3d.png</translation>
+ </message>
+ <message>
+ <source>ICON_WARP</source>
+ <translation>mesh_wrap.png</translation>
+ </message>
+ <message>
+ <source>ICON_WHAT_IS</source>
+ <translation>mesh_whatis.png</translation>
+ </message>
+ <message>
+ <source>ICON_WIRE</source>
+ <translation>mesh_wireframe.png</translation>
+ </message>
+ </context>
+</TS>
--- /dev/null
+<!DOCTYPE TS>
+<TS version="1.1" >
+ <context>
+ <name>@default</name>
+ <message>
+ <source>AREA_ELEMENTS</source>
+ <translation>Area</translation>
+ </message>
+ <message>
+ <source>ASPECTRATIO_3D_ELEMENTS</source>
+ <translation>Aspect Ratio 3D</translation>
+ </message>
+ <message>
+ <source>ASPECTRATIO_ELEMENTS</source>
+ <translation>Aspect Ratio</translation>
+ </message>
+ <message>
+ <source>COL_ALGO_HEADER</source>
+ <translation>Algorithm</translation>
+ </message>
+ <message>
+ <source>COL_ERROR_HEADER</source>
+ <translation>Error</translation>
+ </message>
+ <message>
+ <source>COL_SHAPE_HEADER</source>
+ <translation>SubShape</translation>
+ </message>
+ <message>
+ <source>COMPERR_ALGO_FAILED</source>
+ <translation>Algorithm failed</translation>
+ </message>
+ <message>
+ <source>COMPERR_BAD_INPUT_MESH</source>
+ <translation>Invalid input mesh</translation>
+ </message>
+ <message>
+ <source>COMPERR_BAD_SHAPE</source>
+ <translation>Unexpected geometry</translation>
+ </message>
+ <message>
+ <source>COMPERR_EXCEPTION</source>
+ <translation>Unknown exception</translation>
+ </message>
+ <message>
+ <source>COMPERR_MEMORY_PB</source>
+ <translation>Memory allocation problem</translation>
+ </message>
+ <message>
+ <source>COMPERR_OCC_EXCEPTION</source>
+ <translation>OCC exception</translation>
+ </message>
+ <message>
+ <source>COMPERR_OK</source>
+ <translation>No errors</translation>
+ </message>
+ <message>
+ <source>COMPERR_SLM_EXCEPTION</source>
+ <translation>SALOME exception</translation>
+ </message>
+ <message>
+ <source>COMPERR_STD_EXCEPTION</source>
+ <translation>std::exception</translation>
+ </message>
+ <message>
+ <source>DIRECT_GEOM_SELECTION</source>
+ <translation>Direct geometry selection</translation>
+ </message>
+ <message>
+ <source>ELEMENT_ID</source>
+ <translation>Element ID</translation>
+ </message>
+ <message>
+ <source>FREE_BORDERS</source>
+ <translation>Free Borders</translation>
+ </message>
+ <message>
+ <source>GEOMETRY_NAME</source>
+ <translation>Geometry name</translation>
+ </message>
+ <message>
+ <source>GEOM_BY_MESH_ELEM_SELECTION</source>
+ <translation>Find geometry by mesh element selection</translation>
+ </message>
+ <message>
+ <source>GLOBAL_ALGO</source>
+ <translation>Global</translation>
+ </message>
+ <message>
+ <source>INF_SELECT_OBJECT</source>
+ <translation>Select an object</translation>
+ </message>
+ <message>
+ <source>LENGTH2D_EDGES</source>
+ <translation>Length 2D</translation>
+ </message>
+ <message>
+ <source>LENGTH_EDGES</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>LOCAL_ALGO</source>
+ <translation>Local</translation>
+ </message>
+ <message>
+ <source>MEN_ADD</source>
+ <translation>Add</translation>
+ </message>
+ <message>
+ <source>MEN_ADV_INFO</source>
+ <translation>Advanced Mesh Infos</translation>
+ </message>
+ <message>
+ <source>MEN_ALL</source>
+ <translation>All</translation>
+ </message>
+ <message>
+ <source>MEN_AREA</source>
+ <translation>Area</translation>
+ </message>
+ <message>
+ <source>MEN_ASPECT</source>
+ <translation>Aspect Ratio</translation>
+ </message>
+ <message>
+ <source>MEN_ASPECT_3D</source>
+ <translation>Aspect Ratio 3D</translation>
+ </message>
+ <message>
+ <source>MEN_AUTO_COLOR</source>
+ <translation>Auto color</translation>
+ </message>
+ <message>
+ <source>MEN_AUTO_UPD</source>
+ <translation>Automatic update</translation>
+ </message>
+ <message>
+ <source>MEN_BUILD_COMPOUND</source>
+ <translation>Build Compound</translation>
+ </message>
+ <message>
+ <source>MEN_CLIP</source>
+ <translation>Clipping</translation>
+ </message>
+ <message>
+ <source>MEN_COLORS</source>
+ <translation>Colors / Size</translation>
+ </message>
+ <message>
+ <source>MEN_COMPUTE</source>
+ <translation>Compute</translation>
+ </message>
+ <message>
+ <source>MEN_CONNECTION</source>
+ <translation>Borders at Multi-Connection</translation>
+ </message>
+ <message>
+ <source>MEN_CONNECTION_2D</source>
+ <translation>Borders at Multi-Connection 2D</translation>
+ </message>
+ <message>
+ <source>MEN_CONSTRUCT_GROUP</source>
+ <translation>Construct Group</translation>
+ </message>
+ <message>
+ <source>MEN_CONV_TO_QUAD</source>
+ <translation>Convert to/from quadratic</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_GROUP</source>
+ <translation>Create Group</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_MESH</source>
+ <translation>Create Mesh</translation>
+ </message>
+ <message>
+ <source>MEN_CREATE_SUBMESH</source>
+ <translation>Create Sub-mesh</translation>
+ </message>
+ <message>
+ <source>MEN_CTRL</source>
+ <translation>Controls</translation>
+ </message>
+ <message>
+ <source>MEN_CUT</source>
+ <translation>Cutting of quadrangles</translation>
+ </message>
+ <message>
+ <source>MEN_CUT_GROUP</source>
+ <translation>Cut Groups</translation>
+ </message>
+ <message>
+ <source>MEN_DAT</source>
+ <translation>DAT file</translation>
+ </message>
+ <message>
+ <source>MEN_DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>MEN_DEL_GROUP</source>
+ <translation>Delete Groups</translation>
+ </message>
+ <message>
+ <source>MEN_DISABLE_AUTO_COLOR</source>
+ <translation>Disable auto color</translation>
+ </message>
+ <message>
+ <source>MEN_DISPLAY_ONLY</source>
+ <translation>Show only</translation>
+ </message>
+ <message>
+ <source>MEN_DISPMODE</source>
+ <translation>Display mode</translation>
+ </message>
+ <message>
+ <source>MEN_DISP_ENT</source>
+ <translation>Display entity</translation>
+ </message>
+ <message>
+ <source>MEN_EDGE</source>
+ <translation>Edge</translation>
+ </message>
+ <message>
+ <source>MEN_EDGES</source>
+ <translation>Edges</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT</source>
+ <translation>Edit</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_GROUP</source>
+ <translation>Edit Group</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_HYPO</source>
+ <translation>Edit Hypothesis</translation>
+ </message>
+ <message>
+ <source>MEN_EDIT_MESHSUBMESH</source>
+ <translation>Edit Mesh/Sub-mesh</translation>
+ </message>
+ <message>
+ <source>MEN_EXPORT</source>
+ <translation>Export</translation>
+ </message>
+ <message>
+ <source>MEN_EXPORT_DAT</source>
+ <translation>Export to DAT file</translation>
+ </message>
+ <message>
+ <source>MEN_EXPORT_MED</source>
+ <translation>Export to MED file</translation>
+ </message>
+ <message>
+ <source>MEN_EXPORT_STL</source>
+ <translation>Export to STL file</translation>
+ </message>
+ <message>
+ <source>MEN_EXPORT_UNV</source>
+ <translation>Export to UNV file</translation>
+ </message>
+ <message>
+ <source>MEN_EXTRUSION</source>
+ <translation>Extrusion</translation>
+ </message>
+ <message>
+ <source>MEN_EXTRUSION_ALONG</source>
+ <translation>Extrusion along a path</translation>
+ </message>
+ <message>
+ <source>MEN_FACES</source>
+ <translation>Faces</translation>
+ </message>
+ <message>
+ <source>MEN_FILE</source>
+ <translation>File</translation>
+ </message>
+ <message>
+ <source>MEN_FREE_BORDER</source>
+ <translation>Free Borders</translation>
+ </message>
+ <message>
+ <source>MEN_FREE_EDGE</source>
+ <translation>Free Edges</translation>
+ </message>
+ <message>
+ <source>MEN_GLOBAL_HYPO</source>
+ <translation>Global Hypothesis</translation>
+ </message>
+ <message>
+ <source>MEN_HEXA</source>
+ <translation>Hexahedron</translation>
+ </message>
+ <message>
+ <source>MEN_HIDE</source>
+ <translation>Hide</translation>
+ </message>
+ <message>
+ <source>MEN_HYPO</source>
+ <translation>Hypotheses</translation>
+ </message>
+ <message>
+ <source>MEN_IMPORT</source>
+ <translation>Import</translation>
+ </message>
+ <message>
+ <source>MEN_INT_GROUP</source>
+ <translation>Intersect Groups</translation>
+ </message>
+ <message>
+ <source>MEN_INV</source>
+ <translation>Diagonal Inversion</translation>
+ </message>
+ <message>
+ <source>MEN_LENGTH</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>MEN_LENGTH_2D</source>
+ <translation>Length 2D</translation>
+ </message>
+ <message>
+ <source>MEN_MAP</source>
+ <translation>Pattern mapping</translation>
+ </message>
+ <message>
+ <source>MEN_MED</source>
+ <translation>MED file</translation>
+ </message>
+ <message>
+ <source>MEN_MERGE</source>
+ <translation>Merge nodes</translation>
+ </message>
+ <message>
+ <source>MEN_MERGE_ELEMENTS</source>
+ <translation>Merge elements</translation>
+ </message>
+ <message>
+ <source>MEN_MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>MEN_MESH_THROU_POINT</source>
+ <translation>Mesh to pass through a point</translation>
+ </message>
+ <message>
+ <source>MEN_MIN_ANG</source>
+ <translation>Minimum Angle</translation>
+ </message>
+ <message>
+ <source>MEN_MODIFY</source>
+ <translation>Modification</translation>
+ </message>
+ <message>
+ <source>MEN_MOVE</source>
+ <translation>Move Node</translation>
+ </message>
+ <message>
+ <source>MEN_NODE</source>
+ <translation>Node</translation>
+ </message>
+ <message>
+ <source>MEN_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>MEN_NUM</source>
+ <translation>Numbering</translation>
+ </message>
+ <message>
+ <source>MEN_NUM_ELEMENTS</source>
+ <translation>Display Elements #</translation>
+ </message>
+ <message>
+ <source>MEN_NUM_NODES</source>
+ <translation>Display Nodes #</translation>
+ </message>
+ <message>
+ <source>MEN_ORIENT</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>MEN_POLYGON</source>
+ <translation>Polygon</translation>
+ </message>
+ <message>
+ <source>MEN_POLYHEDRON</source>
+ <translation>Polyhedron</translation>
+ </message>
+ <message>
+ <source>MEN_PRECISION</source>
+ <translation>Precision</translation>
+ </message>
+ <message>
+ <source>MEN_PREF</source>
+ <translation>Preferences</translation>
+ </message>
+ <message>
+ <source>MEN_QUAD</source>
+ <translation>Quadrangle</translation>
+ </message>
+ <message>
+ <source>MEN_QUADRATIC_EDGE</source>
+ <translation>Quadratic Edge</translation>
+ </message>
+ <message>
+ <source>MEN_QUADRATIC_HEXAHEDRON</source>
+ <translation>Quadratic Hexahedron</translation>
+ </message>
+ <message>
+ <source>MEN_QUADRATIC_PENTAHEDRON</source>
+ <translation>Quadratic Pentahedron</translation>
+ </message>
+ <message>
+ <source>MEN_QUADRATIC_PYRAMID</source>
+ <translation>Quadratic Pyramid</translation>
+ </message>
+ <message>
+ <source>MEN_QUADRATIC_QUADRANGLE</source>
+ <translation>Quadratic Quadrangle</translation>
+ </message>
+ <message>
+ <source>MEN_QUADRATIC_TETRAHEDRON</source>
+ <translation>Quadratic Tetrahedron</translation>
+ </message>
+ <message>
+ <source>MEN_QUADRATIC_TRIANGLE</source>
+ <translation>Quadratic Triangle</translation>
+ </message>
+ <message>
+ <source>MEN_QUALITY</source>
+ <translation>Quality controls</translation>
+ </message>
+ <message>
+ <source>MEN_REMOVE</source>
+ <translation>Remove</translation>
+ </message>
+ <message>
+ <source>MEN_REMOVE_ELEMENTS</source>
+ <translation>Elements</translation>
+ </message>
+ <message>
+ <source>MEN_REMOVE_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>MEN_RENAME</source>
+ <translation>Rename</translation>
+ </message>
+ <message>
+ <source>MEN_RENUM</source>
+ <translation>Renumbering</translation>
+ </message>
+ <message>
+ <source>MEN_RENUM_ELEMENTS</source>
+ <translation>Elements</translation>
+ </message>
+ <message>
+ <source>MEN_RENUM_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>MEN_RESET</source>
+ <translation>Reset</translation>
+ </message>
+ <message>
+ <source>MEN_REVOLUTION</source>
+ <translation>Revolution</translation>
+ </message>
+ <message>
+ <source>MEN_ROT</source>
+ <translation>Rotation</translation>
+ </message>
+ <message>
+ <source>MEN_SCALAR_BAR</source>
+ <translation>Scalar bar</translation>
+ </message>
+ <message>
+ <source>MEN_SCALAR_BAR_PROP</source>
+ <translation>Scalar bar Properties</translation>
+ </message>
+ <message>
+ <source>MEN_SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>MEN_SEL_FILTER_LIB</source>
+ <translation>Selection filters library</translation>
+ </message>
+ <message>
+ <source>MEN_SEW</source>
+ <translation>Sewing</translation>
+ </message>
+ <message>
+ <source>MEN_SHADE</source>
+ <translation>Shading</translation>
+ </message>
+ <message>
+ <source>MEN_SHOW</source>
+ <translation>Show</translation>
+ </message>
+ <message>
+ <source>MEN_SHRINK</source>
+ <translation>Shrink</translation>
+ </message>
+ <message>
+ <source>MEN_SKEW</source>
+ <translation>Skew</translation>
+ </message>
+ <message>
+ <source>MEN_SMOOTH</source>
+ <translation>Smoothing</translation>
+ </message>
+ <message>
+ <source>MEN_STD_INFO</source>
+ <translation>Standard Mesh Infos</translation>
+ </message>
+ <message>
+ <source>MEN_STL</source>
+ <translation>STL file</translation>
+ </message>
+ <message>
+ <source>MEN_SYM</source>
+ <translation>Symmetry</translation>
+ </message>
+ <message>
+ <source>MEN_TAPER</source>
+ <translation>Taper</translation>
+ </message>
+ <message>
+ <source>MEN_TETRA</source>
+ <translation>Tetrahedron</translation>
+ </message>
+ <message>
+ <source>MEN_TOOLS</source>
+ <translation>Tools</translation>
+ </message>
+ <message>
+ <source>MEN_TRANS</source>
+ <translation>Translation</translation>
+ </message>
+ <message>
+ <source>MEN_TRANSF</source>
+ <translation>Transformation</translation>
+ </message>
+ <message>
+ <source>MEN_TRANSP</source>
+ <translation>Transparency</translation>
+ </message>
+ <message>
+ <source>MEN_TRIANGLE</source>
+ <translation>Triangle</translation>
+ </message>
+ <message>
+ <source>MEN_UNASSIGN</source>
+ <translation>Unassign</translation>
+ </message>
+ <message>
+ <source>MEN_UNION</source>
+ <translation>Union of triangles</translation>
+ </message>
+ <message>
+ <source>MEN_UNION2</source>
+ <translation>Union of two triangles</translation>
+ </message>
+ <message>
+ <source>MEN_UNV</source>
+ <translation>UNV file</translation>
+ </message>
+ <message>
+ <source>MEN_UN_GROUP</source>
+ <translation>Union Groups</translation>
+ </message>
+ <message>
+ <source>MEN_UPDATE</source>
+ <translation>Update</translation>
+ </message>
+ <message>
+ <source>MEN_VIEW</source>
+ <translation>View</translation>
+ </message>
+ <message>
+ <source>MEN_VOLUMES</source>
+ <translation>Volumes</translation>
+ </message>
+ <message>
+ <source>MEN_VOLUME_3D</source>
+ <translation>Volume</translation>
+ </message>
+ <message>
+ <source>MEN_WARP</source>
+ <translation>Warping angle</translation>
+ </message>
+ <message>
+ <source>MEN_WHAT_IS</source>
+ <translation>Mesh Element Info</translation>
+ </message>
+ <message>
+ <source>MEN_WIRE</source>
+ <translation>Wireframe</translation>
+ </message>
+ <message>
+ <source>MESHERS_FILE_CANT_OPEN</source>
+ <translation>Can not open resource file</translation>
+ </message>
+ <message>
+ <source>MESHERS_FILE_CHECK_VARIABLE</source>
+ <translation>Check environment variable SMESH_MeshersList</translation>
+ </message>
+ <message>
+ <source>MESHERS_FILE_NO_VARIABLE</source>
+ <translation>Environment variable SMESH_MeshersList is not defined</translation>
+ </message>
+ <message>
+ <source>MESH_IS_NOT_SELECTED</source>
+ <translation>There is no selected mesh\nPlease, select a mesh and try again</translation>
+ </message>
+ <message>
+ <source>MESH_NODE</source>
+ <translation>Node</translation>
+ </message>
+ <message>
+ <source>MESH_NODE_TITLE</source>
+ <translation>Add Node</translation>
+ </message>
+ <message>
+ <source>MINIMUMANGLE_ELEMENTS</source>
+ <translation>Minimum Angle</translation>
+ </message>
+ <message>
+ <source>MULTI2D_BORDERS</source>
+ <translation>Borders at Multi-Connections 2D</translation>
+ </message>
+ <message>
+ <source>MULTI_BORDERS</source>
+ <translation>Borders at Multi-Connections</translation>
+ </message>
+ <message>
+ <source>NODE_ID</source>
+ <translation>Node ID</translation>
+ </message>
+ <message>
+ <source>NON_SMESH_OBJECTS_SELECTED</source>
+ <translation>There are objects selected which do not belong to %1 component.</translation>
+ </message>
+ <message>
+ <source>PREVIEW</source>
+ <translation>Preview</translation>
+ </message>
+ <message>
+ <source>SKEW_ELEMENTS</source>
+ <translation>Skew</translation>
+ </message>
+ <message>
+ <source>SMESHGUI_INVALID_PARAMETERS</source>
+ <translation>Parameters are not correctly specified\nPlease enter correct values and try again</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_ALGORITHM</source>
+ <translation>Algorithms</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_ALGORITHM_TITLE</source>
+ <translation>Algorithms Assignation</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_EDGE</source>
+ <translation>Add Edge</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_EDGE_TITLE</source>
+ <translation>Add Edge</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_HEXAS</source>
+ <translation>Add Hexahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_HEXAS_TITLE</source>
+ <translation>Add Hexahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_HYPOTHESIS</source>
+ <translation>Hypothesis</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_HYPOTHESIS_TITLE</source>
+ <translation>Hypothesis Assignation</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_HYP_WRN</source>
+ <translation>\"%1\" assigned but:\n</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_POLYGON</source>
+ <translation>Add polygon</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_POLYGON_TITLE</source>
+ <translation>Add polygon</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRANGLE</source>
+ <translation>Add Quadrangle</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRANGLE_TITLE</source>
+ <translation>Add Quadrangle</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_EDGE_TITLE</source>
+ <translation>Add Quadratic Edge</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_HEXAHEDRON_TITLE</source>
+ <translation>Add Quadratic Hexahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE</source>
+ <translation>Add Quadratic Pentahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_PYRAMID_TITLE</source>
+ <translation>Add Quadratic Pyramid</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_QUADRANGLE_TITLE</source>
+ <translation>Add Quadratic Quadrangle</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_TETRAHEDRON_TITLE</source>
+ <translation>Add Quadratic Tetrahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_TRIANGLE_TITLE</source>
+ <translation>Add Quadratic Triangle</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_SUBMESH</source>
+ <translation>SubMesh Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_TETRAS</source>
+ <translation>Add Tetrahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_TETRAS_TITLE</source>
+ <translation>Add Tetrahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_TRIANGLE</source>
+ <translation>Add Triangle</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_TRIANGLE_TITLE</source>
+ <translation>Add Triangle</translation>
+ </message>
+ <message>
+ <source>SMESH_ANGLE</source>
+ <translation>Angle</translation>
+ </message>
+ <message>
+ <source>SMESH_ARGUMENTS</source>
+ <translation>Arguments</translation>
+ </message>
+ <message>
+ <source>SMESH_AUTO_GROUPS</source>
+ <translation>Automatically create groups</translation>
+ </message>
+ <message>
+ <source>SMESH_AVAILABLE</source>
+ <translation>Available</translation>
+ </message>
+ <message>
+ <source>SMESH_AVAILABLE_ALGORITHMS</source>
+ <translation>Available algorithms</translation>
+ </message>
+ <message>
+ <source>SMESH_AVAILABLE_HYPOTHESES</source>
+ <translation>Available hypotheses</translation>
+ </message>
+ <message>
+ <source>SMESH_AXIS</source>
+ <translation>Axis</translation>
+ </message>
+ <message>
+ <source>SMESH_BAD_SELECTION</source>
+ <translation>No valid selection</translation>
+ </message>
+ <message>
+ <source>SMESH_BOUNDARYEDGES</source>
+ <translation>Boundary Edges</translation>
+ </message>
+ <message>
+ <source>SMESH_BUILD_COMPOUND_TITLE</source>
+ <translation>Create a Compound</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_ADD</source>
+ <translation>A&dd</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_APPLY</source>
+ <translation>&Apply</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_CANCEL</source>
+ <translation>&Cancel</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_CLOSE</source>
+ <translation>&Close</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_CREATE</source>
+ <translation>Create</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_FILTER</source>
+ <translation>Set &Filters</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_HELP</source>
+ <translation>&Help</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_NEW</source>
+ <translation>New</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_NO</source>
+ <translation>&No</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_OK</source>
+ <translation>&Ok</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_REMOVE</source>
+ <translation>&Remove</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_SORT</source>
+ <translation>&Sort List</translation>
+ </message>
+ <message>
+ <source>SMESH_BUT_YES</source>
+ <translation>&Yes</translation>
+ </message>
+ <message>
+ <source>SMESH_CANT_ADD_HYP</source>
+ <translation>Can not assign \"%1\":\n</translation>
+ </message>
+ <message>
+ <source>SMESH_CANT_RM_HYP</source>
+ <translation>Can not unassign \"%1\":\n</translation>
+ </message>
+ <message>
+ <source>SMESH_CHECK_COLOR</source>
+ <translation>Color</translation>
+ </message>
+ <message>
+ <source>SMESH_CLIPPING_FROM</source>
+ <translation>From <---</translation>
+ </message>
+ <message>
+ <source>SMESH_CLIPPING_INTO</source>
+ <translation>---> Into</translation>
+ </message>
+ <message>
+ <source>SMESH_CLIPPING_TITLE</source>
+ <translation>Change Clipping</translation>
+ </message>
+ <message>
+ <source>SMESH_COMPUTE_SUCCEED</source>
+ <translation>Mesh computation succeed</translation>
+ </message>
+ <message>
+ <source>SMESH_CONTENT</source>
+ <translation>Content</translation>
+ </message>
+ <message>
+ <source>SMESH_CONTINUE_MESH_VISUALIZATION</source>
+ <translation>It seems that there is not enough memory to show the mesh\n</translation>
+ </message>
+ <message>
+ <source>SMESH_COORDINATES</source>
+ <translation>Coordinates</translation>
+ </message>
+ <message>
+ <source>SMESH_COPY_ELEMENTS</source>
+ <translation>Copy Elements</translation>
+ </message>
+ <message>
+ <source>SMESH_COPY_GROUPS</source>
+ <translation>Copy groups</translation>
+ </message>
+ <message>
+ <source>SMESH_CREATE_ALGORITHMS</source>
+ <translation>Create algorithms</translation>
+ </message>
+ <message>
+ <source>SMESH_CREATE_COPY</source>
+ <translation>Create a copy</translation>
+ </message>
+ <message>
+ <source>SMESH_CREATE_GROUP_TITLE</source>
+ <translation>Create Group</translation>
+ </message>
+ <message>
+ <source>SMESH_CREATE_HYPOTHESES</source>
+ <translation>Create hypotheses</translation>
+ </message>
+ <message>
+ <source>SMESH_CREATE_MESH</source>
+ <translation>Create a new mesh</translation>
+ </message>
+ <message>
+ <source>SMESH_CREATE_POLYHEDRAL_VOLUME_TITLE</source>
+ <translation>Create polyhedral volume</translation>
+ </message>
+ <message>
+ <source>SMESH_DIAGONAL</source>
+ <translation>Diagonal Inversion</translation>
+ </message>
+ <message>
+ <source>SMESH_DIAGONAL_INVERSION_TITLE</source>
+ <translation>Diagonal Inversion</translation>
+ </message>
+ <message>
+ <source>SMESH_DISTANCE</source>
+ <translation>Distance</translation>
+ </message>
+ <message>
+ <source>SMESH_DRS_1</source>
+ <translation>MED file contains no mesh with the given name</translation>
+ </message>
+ <message>
+ <source>SMESH_DRS_2</source>
+ <translation></translation>
+ </message>
+ <message>
+ <source>SMESH_DRS_3</source>
+ <translation>Some elements were skipped due to incorrect file data</translation>
+ </message>
+ <message>
+ <source>SMESH_DRS_4</source>
+ <translation> The file is incorrect,\n</translation>
+ </message>
+ <message>
+ <source>SMESH_DRS_EMPTY</source>
+ <translation> The file is empty,\n</translation>
+ </message>
+ <message>
+ <source>SMESH_DX</source>
+ <translation>dX</translation>
+ </message>
+ <message>
+ <source>SMESH_DY</source>
+ <translation>dY</translation>
+ </message>
+ <message>
+ <source>SMESH_DZ</source>
+ <translation>dZ</translation>
+ </message>
+ <message>
+ <source>SMESH_EDGE</source>
+ <translation>Edge</translation>
+ </message>
+ <message>
+ <source>SMESH_EDGES_CONNECTIVITY_TITLE</source>
+ <translation>Edges Connectivity</translation>
+ </message>
+ <message>
+ <source>SMESH_EDIT_GROUP_TITLE</source>
+ <translation>Edit Group</translation>
+ </message>
+ <message>
+ <source>SMESH_EDIT_HYPOTHESES</source>
+ <translation>Hypotheses Assignation</translation>
+ </message>
+ <message>
+ <source>SMESH_EDIT_USED</source>
+ <translation>Used</translation>
+ </message>
+ <message>
+ <source>SMESH_ELEMENTS</source>
+ <translation>Elements</translation>
+ </message>
+ <message>
+ <source>SMESH_ELEMENTS_COLOR</source>
+ <translation>Mesh Element Color</translation>
+ </message>
+ <message>
+ <source>SMESH_ELEMENTS_TYPE</source>
+ <translation>Elements Type</translation>
+ </message>
+ <message>
+ <source>SMESH_ELEMENT_TYPE</source>
+ <translation>Element Type</translation>
+ </message>
+ <message>
+ <source>SMESH_ERROR</source>
+ <translation>Error</translation>
+ </message>
+ <message>
+ <source>SMESH_ERR_SCALARBAR_PARAMS</source>
+ <translation>Warning! The parameters is incorrect</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_FAILED</source>
+ <translation>Mesh export failed.\nProbably, there is not enough space on disk.</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_MED_DUPLICATED_GRP</source>
+ <translation>There are duplicated group names in mesh \"%1\".\n</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_MED_V2_1</source>
+ <translation>During export mesh with name - \"%1\" to MED 2.1\n</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_STL1</source>
+ <translation>Mesh - \"%1\" does not contain triangles</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_STL2</source>
+ <translation>Mesh - \"%1\" contains another than triangles elements,</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPORT_UNV</source>
+ <translation>During export mesh with name - \"%1\" to UNV\n</translation>
+ </message>
+ <message>
+ <source>SMESH_EXTRUSION</source>
+ <translation>Extrusion</translation>
+ </message>
+ <message>
+ <source>SMESH_FACE</source>
+ <translation>Face</translation>
+ </message>
+ <message>
+ <source>SMESH_FEATUREANGLE</source>
+ <translation>Feature Angle</translation>
+ </message>
+ <message>
+ <source>SMESH_FEATUREEDGES</source>
+ <translation>Feature Edges</translation>
+ </message>
+ <message>
+ <source>SMESH_FONT_ARIAL</source>
+ <translation>Arial</translation>
+ </message>
+ <message>
+ <source>SMESH_FONT_BOLD</source>
+ <translation>Bold</translation>
+ </message>
+ <message>
+ <source>SMESH_FONT_COURIER</source>
+ <translation>Courier</translation>
+ </message>
+ <message>
+ <source>SMESH_FONT_ITALIC</source>
+ <translation>Italic</translation>
+ </message>
+ <message>
+ <source>SMESH_FONT_SCALARBAR</source>
+ <translation>Font</translation>
+ </message>
+ <message>
+ <source>SMESH_FONT_SHADOW</source>
+ <translation>Shadow</translation>
+ </message>
+ <message>
+ <source>SMESH_FONT_TIMES</source>
+ <translation>Times</translation>
+ </message>
+ <message>
+ <source>SMESH_GEOM_GROUP</source>
+ <translation>Geometry group</translation>
+ </message>
+ <message>
+ <source>SMESH_GROUP</source>
+ <translation>Group</translation>
+ </message>
+ <message>
+ <source>SMESH_GROUP_GEOMETRY</source>
+ <translation>Group on geometry</translation>
+ </message>
+ <message>
+ <source>SMESH_GROUP_SELECTED</source>
+ <translation>%1 Groups</translation>
+ </message>
+ <message>
+ <source>SMESH_GROUP_STANDALONE</source>
+ <translation>Standalone group</translation>
+ </message>
+ <message>
+ <source>SMESH_GROUP_TYPE</source>
+ <translation>Group type</translation>
+ </message>
+ <message>
+ <source>SMESH_HEIGHT</source>
+ <translation>Height:</translation>
+ </message>
+ <message>
+ <source>SMESH_HEXAS</source>
+ <translation>Hexahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_HILIGHT_COLOR</source>
+ <translation>Highlight Color</translation>
+ </message>
+ <message>
+ <source>SMESH_HORIZONTAL</source>
+ <translation>Horizontal</translation>
+ </message>
+ <message>
+ <source>SMESH_HYPOTHESES</source>
+ <translation>Hypotheses</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_1</source>
+ <translation>Algorithm misses a hypothesis</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_10</source>
+ <translation>Hypothesis and submesh dimensions mismatch</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_11</source>
+ <translation>Shape is neither the main one, nor its subshape, nor a valid group</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_12</source>
+ <translation>Geomerty mismatches algorithm's expectation</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_2</source>
+ <translation>There are concurrent hypotheses on a shape</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_3</source>
+ <translation>Hypothesis has a bad parameter value</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_4</source>
+ <translation>Submesh is ignored as there is another algorithm of upper dimension generating %1D elements</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_5</source>
+ <translation>Algorithm hides algorithm(s) of lower dimension by generating all-dimensions elements</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_6</source>
+ <translation>Unknown fatal error at hypothesis definition</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_7</source>
+ <translation>Hypothesis is not suitable in the current context</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_8</source>
+ <translation>Non-conform mesh is produced using applied hypotheses</translation>
+ </message>
+ <message>
+ <source>SMESH_HYP_9</source>
+ <translation>Such dimention hypothesis is already assigned to the shape</translation>
+ </message>
+ <message>
+ <source>SMESH_ID_DIAGONAL</source>
+ <translation>Id Edges</translation>
+ </message>
+ <message>
+ <source>SMESH_ID_ELEMENTS</source>
+ <translation>Id Elements</translation>
+ </message>
+ <message>
+ <source>SMESH_ID_FACES</source>
+ <translation>Id Faces</translation>
+ </message>
+ <message>
+ <source>SMESH_ID_NODES</source>
+ <translation>Id Nodes</translation>
+ </message>
+ <message>
+ <source>SMESH_INFORMATION</source>
+ <translation>Information</translation>
+ </message>
+ <message>
+ <source>SMESH_INIT</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>SMESH_INIT_MESH</source>
+ <translation>Mesh Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_INSUFFICIENT_DATA</source>
+ <translation>Insufficient input value</translation>
+ </message>
+ <message>
+ <source>SMESH_LABELS</source>
+ <translation>Labels:</translation>
+ </message>
+ <message>
+ <source>SMESH_LABELS_COLORS_SCALARBAR</source>
+ <translation>Colors && Labels</translation>
+ </message>
+ <message>
+ <source>SMESH_LENGTH</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>SMESH_MAKE_GROUPS</source>
+ <translation>Generate groups</translation>
+ </message>
+ <message>
+ <source>SMESH_MANIFOLDEDGES</source>
+ <translation>Manifold Edges</translation>
+ </message>
+ <message>
+ <source>SMESH_MAX</source>
+ <translation>Max</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_ALGORITHMS</source>
+ <translation>Algorithms</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_APPLIED_ALGORIHTMS</source>
+ <translation>Applied Algorithms</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_APPLIED_HYPOTHESIS</source>
+ <translation>Applied Hypotheses</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_COMPONENT</source>
+ <translation>SMESH</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_HYPOTHESIS</source>
+ <translation>Hypotheses</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_SubMeshesOnCompound</source>
+ <translation>SubMeshes On Compound</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_SubMeshesOnEdge</source>
+ <translation>SubMeshes On Edge</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_SubMeshesOnFace</source>
+ <translation>SubMeshes On Face</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_SubMeshesOnSolid</source>
+ <translation>SubMeshes On Solid</translation>
+ </message>
+ <message>
+ <source>SMESH_MEN_SubMeshesOnVertex</source>
+ <translation>SubMeshes On Vertex</translation>
+ </message>
+ <message>
+ <source>SMESH_MERGE_ELEMENTS</source>
+ <translation>Merge elements</translation>
+ </message>
+ <message>
+ <source>SMESH_MERGE_NODES</source>
+ <translation>Merge nodes</translation>
+ </message>
+ <message>
+ <source>SMESH_MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_ALL_TYPES</source>
+ <translation>Heterogenous</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_EDGES</source>
+ <translation>Edges</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_ELEMENTS</source>
+ <translation>Elements</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_ENTITIES</source>
+ <translation>Entities</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_FACES</source>
+ <translation>Faces</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_HEXAS</source>
+ <translation>Hexahedrons</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_NAME</source>
+ <translation>Name</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_ORDER0</source>
+ <translation>Total</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_ORDER1</source>
+ <translation>Linear</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_ORDER2</source>
+ <translation>Quadratic</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_POLYEDRES</source>
+ <translation>Polyhedrons</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_POLYGONES</source>
+ <translation>Polygons</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_PRISMS</source>
+ <translation>Prisms</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_PYRAS</source>
+ <translation>Pyramids</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_QUADRANGLES</source>
+ <translation>Quadrangles</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_TETRAS</source>
+ <translation>Tetrahedrons</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_TITLE</source>
+ <translation>Mesh Infos</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_TOTAL</source>
+ <translation>Total</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_TRIANGLES</source>
+ <translation>Triangles</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_TYPE</source>
+ <translation>Type</translation>
+ </message>
+ <message>
+ <source>SMESH_MESHINFO_VOLUMES</source>
+ <translation>Volumes</translation>
+ </message>
+ <message>
+ <source>SMESH_MIN</source>
+ <translation>Min</translation>
+ </message>
+ <message>
+ <source>SMESH_MOVE</source>
+ <translation>Move</translation>
+ </message>
+ <message>
+ <source>SMESH_MOVE_ELEMENTS</source>
+ <translation>Move Elements</translation>
+ </message>
+ <message>
+ <source>SMESH_MOVE_NODES_TITLE</source>
+ <translation>Move Node</translation>
+ </message>
+ <message>
+ <source>SMESH_NAME</source>
+ <translation>Name</translation>
+ </message>
+ <message>
+ <source>SMESH_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>SMESH_NONMANIFOLDEDGES</source>
+ <translation>Non Manifold Edges</translation>
+ </message>
+ <message>
+ <source>SMESH_NORMAL</source>
+ <translation>Normal</translation>
+ </message>
+ <message>
+ <source>SMESH_NO_MESH_VISUALIZATION</source>
+ <translation>There is not enough memory to show the mesh</translation>
+ </message>
+ <message>
+ <source>SMESH_NUMBEROFCOLORS</source>
+ <translation>Nb of colors:</translation>
+ </message>
+ <message>
+ <source>SMESH_NUMBEROFLABELS</source>
+ <translation>Nb of labels:</translation>
+ </message>
+ <message>
+ <source>SMESH_NUMBEROFSTEPS</source>
+ <translation>Number of steps:</translation>
+ </message>
+ <message>
+ <source>SMESH_OBJECTS_SELECTED</source>
+ <translation>%1_objects</translation>
+ </message>
+ <message>
+ <source>SMESH_OBJECT_ALGORITHM</source>
+ <translation>Algorithm</translation>
+ </message>
+ <message>
+ <source>SMESH_OBJECT_GEOM</source>
+ <translation>Geometrical Object</translation>
+ </message>
+ <message>
+ <source>SMESH_OBJECT_HYPOTHESIS</source>
+ <translation>Hypothesis</translation>
+ </message>
+ <message>
+ <source>SMESH_OBJECT_MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>SMESH_OBJECT_MESHorSUBMESH</source>
+ <translation>Mesh or SubMesh</translation>
+ </message>
+ <message>
+ <source>SMESH_OPERATION_FAILED</source>
+ <translation>Operation failed</translation>
+ </message>
+ <message>
+ <source>SMESH_ORIENTATION</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>SMESH_ORIENTATION_ELEMENTS_TITLE</source>
+ <translation>Change Orientation</translation>
+ </message>
+ <message>
+ <source>SMESH_OUTLINE_COLOR</source>
+ <translation>Mesh Object Color</translation>
+ </message>
+ <message>
+ <source>SMESH_PARAMETERS</source>
+ <translation>Parameters</translation>
+ </message>
+ <message>
+ <source>SMESH_PLANE</source>
+ <translation>Plane</translation>
+ </message>
+ <message>
+ <source>SMESH_POINT</source>
+ <translation>Point</translation>
+ </message>
+ <message>
+ <source>SMESH_POINT_1</source>
+ <translation>Point 1</translation>
+ </message>
+ <message>
+ <source>SMESH_POINT_2</source>
+ <translation>Point 2</translation>
+ </message>
+ <message>
+ <source>SMESH_POLYEDRE_CREATE_ERROR</source>
+ <translation>Polyedron creation error</translation>
+ </message>
+ <message>
+ <source>SMESH_POLYEDRON</source>
+ <translation>Polyhedron</translation>
+ </message>
+ <message>
+ <source>SMESH_POLYGON</source>
+ <translation>Polygon</translation>
+ </message>
+ <message>
+ <source>SMESH_POSITION_SIZE_SCALARBAR</source>
+ <translation>Origin && Size</translation>
+ </message>
+ <message>
+ <source>SMESH_PRECISION</source>
+ <translation>Precision</translation>
+ </message>
+ <message>
+ <source>SMESH_PREFERENCES_SCALARBAR</source>
+ <translation>Scalar Bar Preferences</translation>
+ </message>
+ <message>
+ <source>SMESH_PREF_SELECTION</source>
+ <translation>Preferences - Selection</translation>
+ </message>
+ <message>
+ <source>SMESH_PRESELECTION</source>
+ <translation>Preselection</translation>
+ </message>
+ <message>
+ <source>SMESH_PRISM</source>
+ <translation>Prism</translation>
+ </message>
+ <message>
+ <source>SMESH_PROPERTIES_SCALARBAR</source>
+ <translation>Scalar Bar Properties</translation>
+ </message>
+ <message>
+ <source>SMESH_PYRAMID</source>
+ <translation>Pyramid</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRANGLE</source>
+ <translation>Quadrangle</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_EDGE</source>
+ <translation>Quadratic Edge</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_HEXAHEDRON</source>
+ <translation>Quadratic Hexahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_PENTAHEDRON</source>
+ <translation>Quadratic Pentahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_PYRAMID</source>
+ <translation>Quadratic Pyramid</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_QUADRANGLE</source>
+ <translation>Quadratic Quadrangle</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_TETRAHEDRON</source>
+ <translation>Quadratic Tetrahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_QUADRATIC_TRIANGLE</source>
+ <translation>Quadratic Triangle</translation>
+ </message>
+ <message>
+ <source>SMESH_RANGE_MAX</source>
+ <translation>Max value:</translation>
+ </message>
+ <message>
+ <source>SMESH_RANGE_MIN</source>
+ <translation>Min value:</translation>
+ </message>
+ <message>
+ <source>SMESH_RANGE_SCALARBAR</source>
+ <translation>Scalar Range</translation>
+ </message>
+ <message>
+ <source>SMESH_REALLY_DELETE</source>
+ <translation>Do you really want to delete object(s) ?</translation>
+ </message>
+ <message>
+ <source>SMESH_REMOVE</source>
+ <translation>Remove</translation>
+ </message>
+ <message>
+ <source>SMESH_REMOVE_ELEMENTS_TITLE</source>
+ <translation>Remove Elements</translation>
+ </message>
+ <message>
+ <source>SMESH_REMOVE_NODES_TITLE</source>
+ <translation>Remove Nodes</translation>
+ </message>
+ <message>
+ <source>SMESH_RENUMBERING</source>
+ <translation>Renumbering</translation>
+ </message>
+ <message>
+ <source>SMESH_RENUMBERING_ELEMENTS_TITLE</source>
+ <translation>Renumbering elements</translation>
+ </message>
+ <message>
+ <source>SMESH_RENUMBERING_NODES_TITLE</source>
+ <translation>Renumbering nodes</translation>
+ </message>
+ <message>
+ <source>SMESH_REVERSE</source>
+ <translation>Reverse</translation>
+ </message>
+ <message>
+ <source>SMESH_REVOLUTION</source>
+ <translation>Revolution</translation>
+ </message>
+ <message>
+ <source>SMESH_RM_HYP_WRN</source>
+ <translation>\"%1\" unassigned but:\n</translation>
+ </message>
+ <message>
+ <source>SMESH_ROTATION</source>
+ <translation>Rotation</translation>
+ </message>
+ <message>
+ <source>SMESH_ROTATION_TITLE</source>
+ <translation>Rotation about an axis</translation>
+ </message>
+ <message>
+ <source>SMESH_SCALARBAR</source>
+ <translation>Scalar Bar</translation>
+ </message>
+ <message>
+ <source>SMESH_SEGMENTS</source>
+ <translation>Segments</translation>
+ </message>
+ <message>
+ <source>SMESH_SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>SMESH_SELECT_FROM</source>
+ <translation>Select From</translation>
+ </message>
+ <message>
+ <source>SMESH_SELECT_WHOLE_MESH</source>
+ <translation>Select whole mesh, submesh or group</translation>
+ </message>
+ <message>
+ <source>SMESH_SET_COLOR</source>
+ <translation>Color group</translation>
+ </message>
+ <message>
+ <source>SMESH_SEWING</source>
+ <translation>Sewing</translation>
+ </message>
+ <message>
+ <source>SMESH_SMOOTHING</source>
+ <translation>Smoothing</translation>
+ </message>
+ <message>
+ <source>SMESH_STANDARD_MESHINFO_TITLE</source>
+ <translation>Standard Mesh Infos</translation>
+ </message>
+ <message>
+ <source>SMESH_SUBMESH</source>
+ <translation>SubMesh</translation>
+ </message>
+ <message>
+ <source>SMESH_SUBMESH_SELECTED</source>
+ <translation>%1 SubMeshes</translation>
+ </message>
+ <message>
+ <source>SMESH_SYMMETRY</source>
+ <translation>Symmetry</translation>
+ </message>
+ <message>
+ <source>SMESH_TETRAS</source>
+ <translation>Tetrahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_TITLE</source>
+ <translation>Title:</translation>
+ </message>
+ <message>
+ <source>SMESH_TOLERANCE</source>
+ <translation>Tolerance</translation>
+ </message>
+ <message>
+ <source>SMESH_TRANSLATION</source>
+ <translation>Translation</translation>
+ </message>
+ <message>
+ <source>SMESH_TRANSPARENCY_OPAQUE</source>
+ <translation>---> Opaque</translation>
+ </message>
+ <message>
+ <source>SMESH_TRANSPARENCY_TITLE</source>
+ <translation>Change Transparency</translation>
+ </message>
+ <message>
+ <source>SMESH_TRANSPARENCY_TRANSPARENT</source>
+ <translation>Transparent <---</translation>
+ </message>
+ <message>
+ <source>SMESH_TRIANGLE</source>
+ <translation>Triangle</translation>
+ </message>
+ <message>
+ <source>SMESH_UPDATEVIEW</source>
+ <translation>Update View</translation>
+ </message>
+ <message>
+ <source>SMESH_VALUE</source>
+ <translation>Value</translation>
+ </message>
+ <message>
+ <source>SMESH_VECTOR</source>
+ <translation>Vector</translation>
+ </message>
+ <message>
+ <source>SMESH_VERTICAL</source>
+ <translation>Vertical</translation>
+ </message>
+ <message>
+ <source>SMESH_VISU_PROBLEM</source>
+ <translation>Mesh visualization failed, probably due to lack of memory</translation>
+ </message>
+ <message>
+ <source>SMESH_VISU_PROBLEM_CLEAR</source>
+ <translation>Mesh visualization failed, no memory even to show a message,\n</translation>
+ </message>
+ <message>
+ <source>SMESH_VOLUME</source>
+ <translation>Volume</translation>
+ </message>
+ <message>
+ <source>SMESH_WARNING</source>
+ <translation>Warning</translation>
+ </message>
+ <message>
+ <source>SMESH_WHAT_IS_TITLE</source>
+ <translation>Mesh Element Info</translation>
+ </message>
+ <message>
+ <source>SMESH_WIDTH</source>
+ <translation>Width:</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_ALGORITHM_ALREADYEXIST</source>
+ <translation>Algorithm already exists</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_COMPUTE_FAILED</source>
+ <translation>Mesh computation failed</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_EMPTY_NAME</source>
+ <translation>Empty name is not valid</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_HYPOTHESIS_ALREADYEXIST</source>
+ <translation>Hypothesis already exists</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_HYPOTHESIS_NOTEXIST</source>
+ <translation>Hypothesis or Algorithm not exists</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_MISSING_PARAMETERS</source>
+ <translation>Missing parameters</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_NO_AVAILABLE_DATA</source>
+ <translation>No available data in selection</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_SELECTIONMODE_DIAGONAL</source>
+ <translation>Activate Link Selection Mode</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_SELECTIONMODE_ELEMENTS</source>
+ <translation>Activate Elements Selection Mode</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_SELECTIONMODE_NODES</source>
+ <translation>Activate Nodes Selection Mode</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_VIEWER_VTK</source>
+ <translation>Study frame with VTK Viewer must be activated</translation>
+ </message>
+ <message>
+ <source>SMESH_WRN_WARNING</source>
+ <translation>Warning</translation>
+ </message>
+ <message>
+ <source>SMESH_X</source>
+ <translation>X</translation>
+ </message>
+ <message>
+ <source>SMESH_X_SCALARBAR</source>
+ <translation>X:</translation>
+ </message>
+ <message>
+ <source>SMESH_Y</source>
+ <translation>Y</translation>
+ </message>
+ <message>
+ <source>SMESH_Y_SCALARBAR</source>
+ <translation>Y:</translation>
+ </message>
+ <message>
+ <source>SMESH_Z</source>
+ <translation>Z</translation>
+ </message>
+ <message>
+ <source>STATE_ALGO_MISSING</source>
+ <translation>%3 %2D algorithm is missing</translation>
+ </message>
+ <message>
+ <source>STATE_HYP_BAD_GEOMETRY</source>
+ <translation>%3 %2D algorithm \"%1\" is assigned to geometry mismatching its expectation</translation>
+ </message>
+ <message>
+ <source>STATE_HYP_BAD_PARAMETER</source>
+ <translation>Hypothesis of %3 %2D algorithm \"%1\" has a bad parameter value</translation>
+ </message>
+ <message>
+ <source>STATE_HYP_MISSING</source>
+ <translation>%3 %2D algorithm \"%1\" misses %4D hypothesis</translation>
+ </message>
+ <message>
+ <source>STATE_HYP_NOTCONFORM</source>
+ <translation>%3 %2D algorithm \"%1\" would produce not conform mesh: global \"Not Conform Mesh Allowed\" hypotesis is missing</translation>
+ </message>
+ <message>
+ <source>STB_ADV_INFO</source>
+ <translation>Advanced Mesh Infos</translation>
+ </message>
+ <message>
+ <source>STB_ALL</source>
+ <translation>All</translation>
+ </message>
+ <message>
+ <source>STB_AREA</source>
+ <translation>Area</translation>
+ </message>
+ <message>
+ <source>STB_ASPECT</source>
+ <translation>Aspect Ratio</translation>
+ </message>
+ <message>
+ <source>STB_ASPECT_3D</source>
+ <translation>Aspect Ratio 3D</translation>
+ </message>
+ <message>
+ <source>STB_AUTO_COLOR</source>
+ <translation>Auto color</translation>
+ </message>
+ <message>
+ <source>STB_AUTO_UPD</source>
+ <translation>Automatic update</translation>
+ </message>
+ <message>
+ <source>STB_BUILD_COMPOUND</source>
+ <translation>Build Compound Mesh</translation>
+ </message>
+ <message>
+ <source>STB_CLIP</source>
+ <translation>Clipping</translation>
+ </message>
+ <message>
+ <source>STB_COLORS</source>
+ <translation>Colors / Size</translation>
+ </message>
+ <message>
+ <source>STB_COMPUTE</source>
+ <translation>Compute</translation>
+ </message>
+ <message>
+ <source>STB_CONNECTION</source>
+ <translation>Borders at Multi-Connection</translation>
+ </message>
+ <message>
+ <source>STB_CONNECTION_2D</source>
+ <translation>Borders at Multi-Connection 2D</translation>
+ </message>
+ <message>
+ <source>STB_CONSTRUCT_GROUP</source>
+ <translation>Construct Group</translation>
+ </message>
+ <message>
+ <source>STB_CONV_TO_QUAD</source>
+ <translation>Convert to/from quadratic</translation>
+ </message>
+ <message>
+ <source>STB_CREATE_GROUP</source>
+ <translation>Create Group</translation>
+ </message>
+ <message>
+ <source>STB_CREATE_MESH</source>
+ <translation>Create Mesh</translation>
+ </message>
+ <message>
+ <source>STB_CREATE_SUBMESH</source>
+ <translation>Create Sub-mesh</translation>
+ </message>
+ <message>
+ <source>STB_CUT</source>
+ <translation>Cutting of quadrangles</translation>
+ </message>
+ <message>
+ <source>STB_CUT_GROUP</source>
+ <translation>Cut Groups</translation>
+ </message>
+ <message>
+ <source>STB_DAT</source>
+ <translation>Import DAT file</translation>
+ </message>
+ <message>
+ <source>STB_DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>STB_DEL_GROUP</source>
+ <translation>Delete Groups</translation>
+ </message>
+ <message>
+ <source>STB_DISABLE_AUTO_COLOR</source>
+ <translation>Disable auto color</translation>
+ </message>
+ <message>
+ <source>STB_DISPLAY_ONLY</source>
+ <translation>Show only</translation>
+ </message>
+ <message>
+ <source>STB_DISP_ENT</source>
+ <translation>Display entity</translation>
+ </message>
+ <message>
+ <source>STB_EDGE</source>
+ <translation>Edge</translation>
+ </message>
+ <message>
+ <source>STB_EDGES</source>
+ <translation>Edges</translation>
+ </message>
+ <message>
+ <source>STB_EDIT_GROUP</source>
+ <translation>Edit Group</translation>
+ </message>
+ <message>
+ <source>STB_EDIT_HYPO</source>
+ <translation>Edit Hypothesis</translation>
+ </message>
+ <message>
+ <source>STB_EDIT_MESHSUBMESH</source>
+ <translation>Edit Mesh/Sub-mesh</translation>
+ </message>
+ <message>
+ <source>STB_EXPORT_DAT</source>
+ <translation>Export to DAT file</translation>
+ </message>
+ <message>
+ <source>STB_EXPORT_MED</source>
+ <translation>Export to MED file</translation>
+ </message>
+ <message>
+ <source>STB_EXPORT_STL</source>
+ <translation>Export to STL file</translation>
+ </message>
+ <message>
+ <source>STB_EXPORT_UNV</source>
+ <translation>Export to UNV file</translation>
+ </message>
+ <message>
+ <source>STB_EXTRUSION</source>
+ <translation>Extrusion</translation>
+ </message>
+ <message>
+ <source>STB_EXTRUSION_ALONG</source>
+ <translation>Extrusion along a path</translation>
+ </message>
+ <message>
+ <source>STB_FACES</source>
+ <translation>Faces</translation>
+ </message>
+ <message>
+ <source>STB_FREE_BORDER</source>
+ <translation>Free Borders</translation>
+ </message>
+ <message>
+ <source>STB_FREE_EDGE</source>
+ <translation>Free Edges</translation>
+ </message>
+ <message>
+ <source>STB_GLOBAL_HYPO</source>
+ <translation>Global Hypothesis</translation>
+ </message>
+ <message>
+ <source>STB_HEXA</source>
+ <translation>Hexahedron</translation>
+ </message>
+ <message>
+ <source>STB_HIDE</source>
+ <translation>Hide</translation>
+ </message>
+ <message>
+ <source>STB_INT_GROUP</source>
+ <translation>Intersect Groups</translation>
+ </message>
+ <message>
+ <source>STB_INV</source>
+ <translation>Diagonal Inversion</translation>
+ </message>
+ <message>
+ <source>STB_LENGTH</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>STB_LENGTH_2D</source>
+ <translation>Length 2D</translation>
+ </message>
+ <message>
+ <source>STB_MAP</source>
+ <translation>Pattern mapping</translation>
+ </message>
+ <message>
+ <source>STB_MED</source>
+ <translation>Import MED file</translation>
+ </message>
+ <message>
+ <source>STB_MERGE</source>
+ <translation>Merge nodes</translation>
+ </message>
+ <message>
+ <source>STB_MERGE_ELEMENTS</source>
+ <translation>Merge elements</translation>
+ </message>
+ <message>
+ <source>STB_MESH_THROU_POINT</source>
+ <translation>Mesh to pass through a point</translation>
+ </message>
+ <message>
+ <source>STB_MIN_ANG</source>
+ <translation>Minimum Angle</translation>
+ </message>
+ <message>
+ <source>STB_MOVE</source>
+ <translation>Move Node</translation>
+ </message>
+ <message>
+ <source>STB_NODE</source>
+ <translation>Node</translation>
+ </message>
+ <message>
+ <source>STB_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>STB_NUM_ELEMENTS</source>
+ <translation>Display Elements</translation>
+ </message>
+ <message>
+ <source>STB_NUM_NODES</source>
+ <translation>Display Nodes</translation>
+ </message>
+ <message>
+ <source>STB_ORIENT</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>STB_POLYGON</source>
+ <translation>Polygon</translation>
+ </message>
+ <message>
+ <source>STB_POLYHEDRON</source>
+ <translation>Polyhedron</translation>
+ </message>
+ <message>
+ <source>STB_PRECISION</source>
+ <translation>Precision</translation>
+ </message>
+ <message>
+ <source>STB_QUAD</source>
+ <translation>Quadrangle</translation>
+ </message>
+ <message>
+ <source>STB_QUADRATIC_EDGE</source>
+ <translation>Quadratic Edge</translation>
+ </message>
+ <message>
+ <source>STB_QUADRATIC_HEXAHEDRON</source>
+ <translation>Quadratic Hexahedron</translation>
+ </message>
+ <message>
+ <source>STB_QUADRATIC_PENTAHEDRON</source>
+ <translation>Quadratic Pentahedron</translation>
+ </message>
+ <message>
+ <source>STB_QUADRATIC_PYRAMID</source>
+ <translation>Quadratic Pyramid</translation>
+ </message>
+ <message>
+ <source>STB_QUADRATIC_QUADRANGLE</source>
+ <translation>Quadratic Quadrangle</translation>
+ </message>
+ <message>
+ <source>STB_QUADRATIC_TETRAHEDRON</source>
+ <translation>Quadratic Tetrahedron</translation>
+ </message>
+ <message>
+ <source>STB_QUADRATIC_TRIANGLE</source>
+ <translation>Quadratic Triangle</translation>
+ </message>
+ <message>
+ <source>STB_REMOVE_ELEMENTS</source>
+ <translation>Remove elements</translation>
+ </message>
+ <message>
+ <source>STB_REMOVE_NODES</source>
+ <translation>Remove nodes</translation>
+ </message>
+ <message>
+ <source>STB_RENAME</source>
+ <translation>Rename</translation>
+ </message>
+ <message>
+ <source>STB_RENUM_ELEMENTS</source>
+ <translation>Renumbering elements</translation>
+ </message>
+ <message>
+ <source>STB_RENUM_NODES</source>
+ <translation>Renumbering nodes</translation>
+ </message>
+ <message>
+ <source>STB_RESET</source>
+ <translation>Reset</translation>
+ </message>
+ <message>
+ <source>STB_REVOLUTION</source>
+ <translation>Revolution</translation>
+ </message>
+ <message>
+ <source>STB_ROT</source>
+ <translation>Rotation</translation>
+ </message>
+ <message>
+ <source>STB_SCALAR_BAR</source>
+ <translation>Scalar bar</translation>
+ </message>
+ <message>
+ <source>STB_SCALAR_BAR_PROP</source>
+ <translation>Scalar bar Properties</translation>
+ </message>
+ <message>
+ <source>STB_SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>STB_SEL_FILTER_LIB</source>
+ <translation>Selection filters library</translation>
+ </message>
+ <message>
+ <source>STB_SEW</source>
+ <translation>Sewing</translation>
+ </message>
+ <message>
+ <source>STB_SHADE</source>
+ <translation>Shading</translation>
+ </message>
+ <message>
+ <source>STB_SHOW</source>
+ <translation>Show</translation>
+ </message>
+ <message>
+ <source>STB_SHRINK</source>
+ <translation>Shrink</translation>
+ </message>
+ <message>
+ <source>STB_SKEW</source>
+ <translation>Skew</translation>
+ </message>
+ <message>
+ <source>STB_SMOOTH</source>
+ <translation>Smoothing</translation>
+ </message>
+ <message>
+ <source>STB_STD_INFO</source>
+ <translation>Standard Mesh Infos</translation>
+ </message>
+ <message>
+ <source>STB_SYM</source>
+ <translation>Symmetry</translation>
+ </message>
+ <message>
+ <source>STB_TAPER</source>
+ <translation>Taper</translation>
+ </message>
+ <message>
+ <source>STB_TETRA</source>
+ <translation>Tetrahedron</translation>
+ </message>
+ <message>
+ <source>STB_TRANS</source>
+ <translation>Translation</translation>
+ </message>
+ <message>
+ <source>STB_TRANSP</source>
+ <translation>Transparency</translation>
+ </message>
+ <message>
+ <source>STB_TRIANGLE</source>
+ <translation>Triangle</translation>
+ </message>
+ <message>
+ <source>STB_UNASSIGN</source>
+ <translation>Unassign</translation>
+ </message>
+ <message>
+ <source>STB_UNION</source>
+ <translation>Union of triangles</translation>
+ </message>
+ <message>
+ <source>STB_UNION2</source>
+ <translation>Union of two triangles</translation>
+ </message>
+ <message>
+ <source>STB_UNV</source>
+ <translation>Import UNV file</translation>
+ </message>
+ <message>
+ <source>STB_UN_GROUP</source>
+ <translation>Union Groups</translation>
+ </message>
+ <message>
+ <source>STB_UPDATE</source>
+ <translation>Update</translation>
+ </message>
+ <message>
+ <source>STB_VOLUMES</source>
+ <translation>Volumes</translation>
+ </message>
+ <message>
+ <source>STB_VOLUME_3D</source>
+ <translation>Volume</translation>
+ </message>
+ <message>
+ <source>STB_WARP</source>
+ <translation>Warping angle</translation>
+ </message>
+ <message>
+ <source>STB_WHAT_IS</source>
+ <translation>Mesh Element Info</translation>
+ </message>
+ <message>
+ <source>STB_WIRE</source>
+ <translation>Wireframe</translation>
+ </message>
+ <message>
+ <source>TAPER_ELEMENTS</source>
+ <translation>Taper</translation>
+ </message>
+ <message>
+ <source>TB_ADD_REMOVE</source>
+ <translation>Add/Remove Toolbar</translation>
+ </message>
+ <message>
+ <source>TB_CTRL</source>
+ <translation>Controls Toolbar</translation>
+ </message>
+ <message>
+ <source>TB_DISP_MODE</source>
+ <translation>Display Mode Toolbar</translation>
+ </message>
+ <message>
+ <source>TB_HYPO</source>
+ <translation>Hypotheses Toolbar</translation>
+ </message>
+ <message>
+ <source>TB_MESH</source>
+ <translation>Mesh Toolbar</translation>
+ </message>
+ <message>
+ <source>TB_MODIFY</source>
+ <translation>Modification Toolbar</translation>
+ </message>
+ <message>
+ <source>TOP_ADV_INFO</source>
+ <translation>Advanced Mesh Infos</translation>
+ </message>
+ <message>
+ <source>TOP_ALL</source>
+ <translation>All</translation>
+ </message>
+ <message>
+ <source>TOP_AREA</source>
+ <translation>Area</translation>
+ </message>
+ <message>
+ <source>TOP_ASPECT</source>
+ <translation>Aspect Ratio</translation>
+ </message>
+ <message>
+ <source>TOP_ASPECT_3D</source>
+ <translation>Aspect Ratio 3D</translation>
+ </message>
+ <message>
+ <source>TOP_AUTO_COLOR</source>
+ <translation>Auto color</translation>
+ </message>
+ <message>
+ <source>TOP_AUTO_UPD</source>
+ <translation>Automatic update</translation>
+ </message>
+ <message>
+ <source>TOP_BUILD_COMPOUND</source>
+ <translation>Build Compound Mesh</translation>
+ </message>
+ <message>
+ <source>TOP_CLIP</source>
+ <translation>Clipping</translation>
+ </message>
+ <message>
+ <source>TOP_COLORS</source>
+ <translation>Colors / Size</translation>
+ </message>
+ <message>
+ <source>TOP_COMPUTE</source>
+ <translation>Compute</translation>
+ </message>
+ <message>
+ <source>TOP_CONNECTION</source>
+ <translation>Borders at Multi-Connection</translation>
+ </message>
+ <message>
+ <source>TOP_CONNECTION_2D</source>
+ <translation>Borders at Multi-Connection 2D</translation>
+ </message>
+ <message>
+ <source>TOP_CONSTRUCT_GROUP</source>
+ <translation>Construct Group</translation>
+ </message>
+ <message>
+ <source>TOP_CONV_TO_QUAD</source>
+ <translation>Convert to/from quadratic</translation>
+ </message>
+ <message>
+ <source>TOP_CREATE_GROUP</source>
+ <translation>Create Group</translation>
+ </message>
+ <message>
+ <source>TOP_CREATE_MESH</source>
+ <translation>Create Mesh</translation>
+ </message>
+ <message>
+ <source>TOP_CREATE_SUBMESH</source>
+ <translation>Create Sub-mesh</translation>
+ </message>
+ <message>
+ <source>TOP_CUT</source>
+ <translation>Cutting of quadrangles</translation>
+ </message>
+ <message>
+ <source>TOP_CUT_GROUP</source>
+ <translation>Cut Groups</translation>
+ </message>
+ <message>
+ <source>TOP_DAT</source>
+ <translation>Import DAT file</translation>
+ </message>
+ <message>
+ <source>TOP_DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>TOP_DEL_GROUP</source>
+ <translation>Delete Groups</translation>
+ </message>
+ <message>
+ <source>TOP_DISABLE_AUTO_COLOR</source>
+ <translation>Disable auto color</translation>
+ </message>
+ <message>
+ <source>TOP_DISPLAY_ONLY</source>
+ <translation>Show only</translation>
+ </message>
+ <message>
+ <source>TOP_DISP_ENT</source>
+ <translation>Display entity</translation>
+ </message>
+ <message>
+ <source>TOP_EDGE</source>
+ <translation>Edge</translation>
+ </message>
+ <message>
+ <source>TOP_EDGES</source>
+ <translation>Edges</translation>
+ </message>
+ <message>
+ <source>TOP_EDIT_GROUP</source>
+ <translation>Edit Group</translation>
+ </message>
+ <message>
+ <source>TOP_EDIT_HYPO</source>
+ <translation>Edit Hypothesis</translation>
+ </message>
+ <message>
+ <source>TOP_EDIT_MESHSUBMESH</source>
+ <translation>Edit Mesh/Sub-mesh</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORT_DAT</source>
+ <translation>Export to DAT file</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORT_MED</source>
+ <translation>Export to MED file</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORT_STL</source>
+ <translation>Export to STL file</translation>
+ </message>
+ <message>
+ <source>TOP_EXPORT_UNV</source>
+ <translation>Export to UNV file</translation>
+ </message>
+ <message>
+ <source>TOP_EXTRUSION</source>
+ <translation>Extrusion</translation>
+ </message>
+ <message>
+ <source>TOP_EXTRUSION_ALONG</source>
+ <translation>Extrusion along a path</translation>
+ </message>
+ <message>
+ <source>TOP_FACES</source>
+ <translation>Faces</translation>
+ </message>
+ <message>
+ <source>TOP_FREE_BORDER</source>
+ <translation>Free Borders</translation>
+ </message>
+ <message>
+ <source>TOP_FREE_EDGE</source>
+ <translation>Free Edges</translation>
+ </message>
+ <message>
+ <source>TOP_GLOBAL_HYPO</source>
+ <translation>Global Hypothesis</translation>
+ </message>
+ <message>
+ <source>TOP_HEXA</source>
+ <translation>Hexahedron</translation>
+ </message>
+ <message>
+ <source>TOP_HIDE</source>
+ <translation>Hide</translation>
+ </message>
+ <message>
+ <source>TOP_INT_GROUP</source>
+ <translation>Intersect Groups</translation>
+ </message>
+ <message>
+ <source>TOP_INV</source>
+ <translation>Diagonal Inversion</translation>
+ </message>
+ <message>
+ <source>TOP_LENGTH</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>TOP_LENGTH_2D</source>
+ <translation>Length 2D</translation>
+ </message>
+ <message>
+ <source>TOP_MAP</source>
+ <translation>Pattern mapping</translation>
+ </message>
+ <message>
+ <source>TOP_MED</source>
+ <translation>Import MED file</translation>
+ </message>
+ <message>
+ <source>TOP_MERGE</source>
+ <translation>Merge nodes</translation>
+ </message>
+ <message>
+ <source>TOP_MERGE_ELEMENTS</source>
+ <translation>Merge elements</translation>
+ </message>
+ <message>
+ <source>TOP_MESH_THROU_POINT</source>
+ <translation>Mesh to pass through a point</translation>
+ </message>
+ <message>
+ <source>TOP_MIN_ANG</source>
+ <translation>Minimum Angle</translation>
+ </message>
+ <message>
+ <source>TOP_MOVE</source>
+ <translation>Move Node</translation>
+ </message>
+ <message>
+ <source>TOP_NODE</source>
+ <translation>Node</translation>
+ </message>
+ <message>
+ <source>TOP_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>TOP_NUM_ELEMENTS</source>
+ <translation>Display Elements</translation>
+ </message>
+ <message>
+ <source>TOP_NUM_NODES</source>
+ <translation>Display Nodes</translation>
+ </message>
+ <message>
+ <source>TOP_ORIENT</source>
+ <translation>Orientation</translation>
+ </message>
+ <message>
+ <source>TOP_POLYGON</source>
+ <translation>Polygon</translation>
+ </message>
+ <message>
+ <source>TOP_POLYHEDRON</source>
+ <translation>Polyhedron</translation>
+ </message>
+ <message>
+ <source>TOP_PRECISION</source>
+ <translation>Precision</translation>
+ </message>
+ <message>
+ <source>TOP_QUAD</source>
+ <translation>Quadrangle</translation>
+ </message>
+ <message>
+ <source>TOP_QUADRATIC_EDGE</source>
+ <translation>Quadratic Edge</translation>
+ </message>
+ <message>
+ <source>TOP_QUADRATIC_HEXAHEDRON</source>
+ <translation>Quadratic Hexahedron</translation>
+ </message>
+ <message>
+ <source>TOP_QUADRATIC_PENTAHEDRON</source>
+ <translation>Quadratic Pentahedron</translation>
+ </message>
+ <message>
+ <source>TOP_QUADRATIC_PYRAMID</source>
+ <translation>Quadratic Pyramid</translation>
+ </message>
+ <message>
+ <source>TOP_QUADRATIC_QUADRANGLE</source>
+ <translation>Quadratic Quadrangle</translation>
+ </message>
+ <message>
+ <source>TOP_QUADRATIC_TETRAHEDRON</source>
+ <translation>Quadratic Tetrahedron</translation>
+ </message>
+ <message>
+ <source>TOP_QUADRATIC_TRIANGLE</source>
+ <translation>Quadratic Triangle</translation>
+ </message>
+ <message>
+ <source>TOP_REMOVE_ELEMENTS</source>
+ <translation>Remove elements</translation>
+ </message>
+ <message>
+ <source>TOP_REMOVE_NODES</source>
+ <translation>Remove nodes</translation>
+ </message>
+ <message>
+ <source>TOP_RENAME</source>
+ <translation>Rename</translation>
+ </message>
+ <message>
+ <source>TOP_RENUM_ELEMENTS</source>
+ <translation>Renumbering elements</translation>
+ </message>
+ <message>
+ <source>TOP_RENUM_NODES</source>
+ <translation>Renumbering nodes</translation>
+ </message>
+ <message>
+ <source>TOP_RESET</source>
+ <translation>Reset</translation>
+ </message>
+ <message>
+ <source>TOP_REVOLUTION</source>
+ <translation>Revolution</translation>
+ </message>
+ <message>
+ <source>TOP_ROT</source>
+ <translation>Rotation</translation>
+ </message>
+ <message>
+ <source>TOP_SCALAR_BAR</source>
+ <translation>Scalar bar</translation>
+ </message>
+ <message>
+ <source>TOP_SCALAR_BAR_PROP</source>
+ <translation>Scalar bar Properties</translation>
+ </message>
+ <message>
+ <source>TOP_SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>TOP_SEL_FILTER_LIB</source>
+ <translation>Selection filters library</translation>
+ </message>
+ <message>
+ <source>TOP_SEW</source>
+ <translation>Sewing</translation>
+ </message>
+ <message>
+ <source>TOP_SHADE</source>
+ <translation>Shading</translation>
+ </message>
+ <message>
+ <source>TOP_SHOW</source>
+ <translation>Show</translation>
+ </message>
+ <message>
+ <source>TOP_SHRINK</source>
+ <translation>Shrink</translation>
+ </message>
+ <message>
+ <source>TOP_SKEW</source>
+ <translation>Skew</translation>
+ </message>
+ <message>
+ <source>TOP_SMOOTH</source>
+ <translation>Smoothing</translation>
+ </message>
+ <message>
+ <source>TOP_STD_INFO</source>
+ <translation>Standard Mesh Infos</translation>
+ </message>
+ <message>
+ <source>TOP_SYM</source>
+ <translation>Symmetry</translation>
+ </message>
+ <message>
+ <source>TOP_TAPER</source>
+ <translation>Taper</translation>
+ </message>
+ <message>
+ <source>TOP_TETRA</source>
+ <translation>Tetrahedron</translation>
+ </message>
+ <message>
+ <source>TOP_TRANS</source>
+ <translation>Translation</translation>
+ </message>
+ <message>
+ <source>TOP_TRANSP</source>
+ <translation>Transparency</translation>
+ </message>
+ <message>
+ <source>TOP_TRIANGLE</source>
+ <translation>Triangle</translation>
+ </message>
+ <message>
+ <source>TOP_UNASSIGN</source>
+ <translation>Unassign</translation>
+ </message>
+ <message>
+ <source>TOP_UNION</source>
+ <translation>Union of triangles</translation>
+ </message>
+ <message>
+ <source>TOP_UNION2</source>
+ <translation>Union of two triangles</translation>
+ </message>
+ <message>
+ <source>TOP_UNV</source>
+ <translation>Import UNV file</translation>
+ </message>
+ <message>
+ <source>TOP_UN_GROUP</source>
+ <translation>Union Groups</translation>
+ </message>
+ <message>
+ <source>TOP_UPDATE</source>
+ <translation>Update</translation>
+ </message>
+ <message>
+ <source>TOP_VOLUMES</source>
+ <translation>Volumes</translation>
+ </message>
+ <message>
+ <source>TOP_VOLUME_3D</source>
+ <translation>Volume</translation>
+ </message>
+ <message>
+ <source>TOP_WARP</source>
+ <translation>Warping angle</translation>
+ </message>
+ <message>
+ <source>TOP_WHAT_IS</source>
+ <translation>Mesh Element Info</translation>
+ </message>
+ <message>
+ <source>TOP_WIRE</source>
+ <translation>Wireframe</translation>
+ </message>
+ <message>
+ <source>VOLUME_3D_ELEMENTS</source>
+ <translation>Area</translation>
+ </message>
+ <message>
+ <source>WARP_ELEMENTS</source>
+ <translation>Warping</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI</name>
+ <message>
+ <source>NOT_A_VTK_VIEWER</source>
+ <translation>This command is available in VTK viewer only\nPlease, create VTK viewer and try again</translation>
+ </message>
+ <message>
+ <source>PREF_AUTO_GROUPS</source>
+ <translation>Automatically create groups for MED export</translation>
+ </message>
+ <message>
+ <source>PREF_AUTO_UPDATE</source>
+ <translation>Automatic update</translation>
+ </message>
+ <message>
+ <source>PREF_BACKFACE</source>
+ <translation>Back face</translation>
+ </message>
+ <message>
+ <source>PREF_COLOR</source>
+ <translation>Color</translation>
+ </message>
+ <message>
+ <source>PREF_DISPLAY_ENTITY</source>
+ <translation>Display entity</translation>
+ </message>
+ <message>
+ <source>PREF_DISPLAY_MODE</source>
+ <translation>Display mode</translation>
+ </message>
+ <message>
+ <source>PREF_ELEMENTS</source>
+ <translation>Elements</translation>
+ </message>
+ <message>
+ <source>PREF_ELEMENT_COLOR</source>
+ <translation>Element color</translation>
+ </message>
+ <message>
+ <source>PREF_FILL</source>
+ <translation>Fill</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_ELEMENTS</source>
+ <translation>Elements</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_EXPORT</source>
+ <translation>Mesh export</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_PRECISION</source>
+ <translation>Precision</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_PRESELECTION</source>
+ <translation>Preselection</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_QUALITY</source>
+ <translation>Quality controls</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>PREF_GROUP_UPDATE</source>
+ <translation>Update</translation>
+ </message>
+ <message>
+ <source>PREF_HIGHLIGHT_COLOR</source>
+ <translation>Highlight color</translation>
+ </message>
+ <message>
+ <source>PREF_LABELS_COLOR</source>
+ <translation>Labels color</translation>
+ </message>
+ <message>
+ <source>PREF_NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>PREF_OBJECTS</source>
+ <translation>Objects</translation>
+ </message>
+ <message>
+ <source>PREF_OBJECT_COLOR</source>
+ <translation>Object color</translation>
+ </message>
+ <message>
+ <source>PREF_OUTLINE</source>
+ <translation>Outline</translation>
+ </message>
+ <message>
+ <source>PREF_PRECISION_USE</source>
+ <translation>Use precision</translation>
+ </message>
+ <message>
+ <source>PREF_PRECISION_VALUE</source>
+ <translation>Number of digits after point</translation>
+ </message>
+ <message>
+ <source>PREF_RENUMBER</source>
+ <translation>Automatic renumbering</translation>
+ </message>
+ <message>
+ <source>PREF_SHRINK_COEFF</source>
+ <translation>Shrink coef.</translation>
+ </message>
+ <message>
+ <source>PREF_SIZE</source>
+ <translation>Size</translation>
+ </message>
+ <message>
+ <source>PREF_TAB_GENERAL</source>
+ <translation>General</translation>
+ </message>
+ <message>
+ <source>PREF_TAB_MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>PREF_TAB_SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>PREF_TITLE_COLOR</source>
+ <translation>Title color</translation>
+ </message>
+ <message>
+ <source>PREF_WIDTH</source>
+ <translation>Width</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_AddQuadraticElementDlg</name>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_EDGE</source>
+ <translation>Add Quadratic Edge</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_HEXAHEDRON</source>
+ <translation>Add Quadratic Hexahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_PENTAHEDRON</source>
+ <translation>Add Quadratic Pentahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_PYRAMID</source>
+ <translation>Add Quadratic Pyramid</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_QUADRANGLE</source>
+ <translation>Add Quadratic Quadrangle</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_TETRAHEDRON</source>
+ <translation>Add Quadratic Tetrahedron</translation>
+ </message>
+ <message>
+ <source>SMESH_ADD_QUADRATIC_TRIANGLE</source>
+ <translation>Add Quadratic Triangle</translation>
+ </message>
+ <message>
+ <source>SMESH_CORNER_NODES</source>
+ <translation>Corner Nodes:</translation>
+ </message>
+ <message>
+ <source>SMESH_FIRST</source>
+ <translation>First</translation>
+ </message>
+ <message>
+ <source>SMESH_LAST</source>
+ <translation>Last</translation>
+ </message>
+ <message>
+ <source>SMESH_MIDDLE</source>
+ <translation>Middle</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_BuildCompoundDlg</name>
+ <message>
+ <source>COMPOUND</source>
+ <translation>Compound</translation>
+ </message>
+ <message>
+ <source>COMPOUND_MESH</source>
+ <translation>Compound_Mesh</translation>
+ </message>
+ <message>
+ <source>CREATE_COMMON_GROUPS</source>
+ <translation>Create common groups for initial meshes</translation>
+ </message>
+ <message>
+ <source>MERGE_NODES_AND_ELEMENTS</source>
+ <translation>Merge coincident nodes and elements</translation>
+ </message>
+ <message>
+ <source>MESHES</source>
+ <translation>Meshes</translation>
+ </message>
+ <message>
+ <source>PROCESSING_IDENTICAL_GROUPS</source>
+ <translation>Processing identical groups</translation>
+ </message>
+ <message>
+ <source>RENAME</source>
+ <translation>Rename</translation>
+ </message>
+ <message>
+ <source>RESULT_NAME</source>
+ <translation>Result name</translation>
+ </message>
+ <message>
+ <source>UNITE</source>
+ <translation>Unite</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_ChangeOrientationDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Modification of orientation</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_ComputeDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Compute mesh failed</translation>
+ </message>
+ <message>
+ <source>CONSTRUCTOR</source>
+ <translation>Compute mesh</translation>
+ </message>
+ <message>
+ <source>ERRORS</source>
+ <translation>Errors</translation>
+ </message>
+ <message>
+ <source>MEMORY_LACK</source>
+ <translation>Memory allocation problem</translation>
+ </message>
+ <message>
+ <source>PUBLISH_SHAPE</source>
+ <translation>Publish SubShape</translation>
+ </message>
+ <message>
+ <source>SHOW_SHAPE</source>
+ <translation>Show SubShape</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_ConvToQuadDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Convert to/from quadratic</translation>
+ </message>
+ <message>
+ <source>MEDIUMNDS</source>
+ <translation>Medium nodes on geometry</translation>
+ </message>
+ <message>
+ <source>MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>RADIOBTN_1</source>
+ <translation>Convert to quadratic</translation>
+ </message>
+ <message>
+ <source>RADIOBTN_2</source>
+ <translation>Convert from quadratic</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_ConvToQuadOp</name>
+ <message>
+ <source>MESH_IS_NOT_SELECTED</source>
+ <translation>Mesh is not selected\nPlease specify it and try again</translation>
+ </message>
+ <message>
+ <source>REF_IS_NULL</source>
+ <translation>No valid mesh object selected</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_CreatePatternDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Pattern Creation</translation>
+ </message>
+ <message>
+ <source>DEFAULT_2D</source>
+ <translation>Pattern_2d</translation>
+ </message>
+ <message>
+ <source>DEFAULT_3D</source>
+ <translation>Pattern_3d</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_CREATION</source>
+ <translation>Internal error occurs during pattern creation\nPlease verify validity of entered information</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_SAVING</source>
+ <translation>Internal error occurs during pattern saving. Please verify\n\free disk space and your write permission to this file</translation>
+ </message>
+ <message>
+ <source>ERR_LOADF_CANT_PROJECT</source>
+ <translation>Impossible to perform projection of nodes to the face</translation>
+ </message>
+ <message>
+ <source>ERR_LOADF_CLOSED_FACE</source>
+ <translation>It is impossible to create pattern from face having seam edge</translation>
+ </message>
+ <message>
+ <source>ERR_LOADF_NARROW_FACE</source>
+ <translation>It is impossible to create pattern from narrow face</translation>
+ </message>
+ <message>
+ <source>ERR_LOADV_BAD_SHAPE</source>
+ <translation>Pattern can be created from closed shell or solid with 6 faces only</translation>
+ </message>
+ <message>
+ <source>ERR_LOADV_COMPUTE_PARAMS</source>
+ <translation>It is impossible to compute point parameters</translation>
+ </message>
+ <message>
+ <source>ERR_LOAD_EMPTY_SUBMESH</source>
+ <translation>There are no elements to create pattern</translation>
+ </message>
+ <message>
+ <source>MESH_OR_SUBMESH</source>
+ <translation>Mesh or SubMesh</translation>
+ </message>
+ <message>
+ <source>PATTERN</source>
+ <translation>Pattern</translation>
+ </message>
+ <message>
+ <source>PATTERN_FILT</source>
+ <translation>Pattern files(*.smp)</translation>
+ </message>
+ <message>
+ <source>PATTERN_NAME</source>
+ <translation>Pattern name</translation>
+ </message>
+ <message>
+ <source>PATTERN_TYPE</source>
+ <translation>Pattern type</translation>
+ </message>
+ <message>
+ <source>PROJECT</source>
+ <translation>Project nodes on the face</translation>
+ </message>
+ <message>
+ <source>SAVE</source>
+ <translation>Save...</translation>
+ </message>
+ <message>
+ <source>SAVE_PATTERN</source>
+ <translation>Save Pattern</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_CreatePolyhedralVolumeDlg</name>
+ <message>
+ <source>FACES_BY_NODES</source>
+ <translation>Faces by nodes</translation>
+ </message>
+ <message>
+ <source>SMESH_POLYEDRE_CREATE_ERROR</source>
+ <translation>Polyhedron creation error.</translation>
+ </message>
+ <message>
+ <source>SMESH_POLYEDRE_PREVIEW</source>
+ <translation>Polyhedron preview</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_CuttingOfQuadsDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Cutting of quadrangles</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_DeleteGroupDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Delete groups with contents</translation>
+ </message>
+ <message>
+ <source>NO_SELECTED_GROUPS</source>
+ <translation>There are no selected groups\nPlease select a groups and try again</translation>
+ </message>
+ <message>
+ <source>SELECTED_GROUPS</source>
+ <translation>Selected groups</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_EditMeshDlg</name>
+ <message>
+ <source>COINCIDENT_ELEMENTS</source>
+ <translation>Coincident elements</translation>
+ </message>
+ <message>
+ <source>COINCIDENT_NODES</source>
+ <translation>Coincident nodes</translation>
+ </message>
+ <message>
+ <source>DETECT</source>
+ <translation>Detect</translation>
+ </message>
+ <message>
+ <source>EDIT_SELECTED_GROUP</source>
+ <translation>Edit selected group</translation>
+ </message>
+ <message>
+ <source>SELECT_ALL</source>
+ <translation>Select all</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_ExtrusionAlongPathDlg</name>
+ <message>
+ <source>BAD_SHAPE_TYPE</source>
+ <translation>The shape selected for the path is not edge</translation>
+ </message>
+ <message>
+ <source>CANT_GET_TANGENT</source>
+ <translation>Can't get tangent for one of the path nodes</translation>
+ </message>
+ <message>
+ <source>EXTRUSION_1D</source>
+ <translation>Extrusion of 1D elements</translation>
+ </message>
+ <message>
+ <source>EXTRUSION_2D</source>
+ <translation>Extrusion of 2D elements</translation>
+ </message>
+ <message>
+ <source>EXTRUSION_ALONG_PATH</source>
+ <translation>Extrusion along a path</translation>
+ </message>
+ <message>
+ <source>EXTR_BAD_STARTING_NODE</source>
+ <translation>Wrong path starting node</translation>
+ </message>
+ <message>
+ <source>LINEAR_ANGLES</source>
+ <translation>Linear variation of the angles</translation>
+ </message>
+ <message>
+ <source>NO_ELEMENTS_SELECTED</source>
+ <translation>No mesh elements are selected for extrusion</translation>
+ </message>
+ <message>
+ <source>SELECTED_PATH_IS_NOT_EDGE</source>
+ <translation>Path mesh should be of edge type</translation>
+ </message>
+ <message>
+ <source>SMESH_ANGLES</source>
+ <translation>Rotation Angles</translation>
+ </message>
+ <message>
+ <source>SMESH_BASE_POINT</source>
+ <translation>Base Point</translation>
+ </message>
+ <message>
+ <source>SMESH_PATH</source>
+ <translation>Path</translation>
+ </message>
+ <message>
+ <source>SMESH_PATH_MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>SMESH_PATH_SHAPE</source>
+ <translation>Shape (edge)</translation>
+ </message>
+ <message>
+ <source>SMESH_PATH_START</source>
+ <translation>Start node</translation>
+ </message>
+ <message>
+ <source>SMESH_USE_ANGLES</source>
+ <translation>Use Angles</translation>
+ </message>
+ <message>
+ <source>SMESH_USE_BASE_POINT</source>
+ <translation>Use Base Point</translation>
+ </message>
+ <message>
+ <source>WRONG_ANGLES_NUMBER</source>
+ <translation>The number of angles should correspond to the number of path nodes</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_ExtrusionDlg</name>
+ <message>
+ <source>EXTRUSION_1D</source>
+ <translation>Extrusion of 1D elements</translation>
+ </message>
+ <message>
+ <source>EXTRUSION_2D</source>
+ <translation>Extrusion of 2D elements</translation>
+ </message>
+ <message>
+ <source>EXTRUSION_ALONG_LINE</source>
+ <translation>Extrusion along a line</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_FilterDlg</name>
+ <message>
+ <source>BAD_SHAPE_NAME</source>
+ <translation>There is no \"%1\" geometrical object in the current study\nPlease select valid object and try again</translation>
+ </message>
+ <message>
+ <source>CURRENT_GROUP</source>
+ <translation>Current Group</translation>
+ </message>
+ <message>
+ <source>EDGES_TLT</source>
+ <translation>Filter for Edges</translation>
+ </message>
+ <message>
+ <source>FACES_TLT</source>
+ <translation>Filter for Faces</translation>
+ </message>
+ <message>
+ <source>MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>NODES_TLT</source>
+ <translation>Filter for Nodes</translation>
+ </message>
+ <message>
+ <source>SELECTION</source>
+ <translation>Initial Selection</translation>
+ </message>
+ <message>
+ <source>SET_IN_VIEWER</source>
+ <translation>Insert filter in viewer</translation>
+ </message>
+ <message>
+ <source>SHAPE_IS_NOT_A_CYLINDER</source>
+ <translation>\"%1\" is not a cylinderical face\nPlease select a cylindrical face and try again</translation>
+ </message>
+ <message>
+ <source>SHAPE_IS_NOT_A_FACE</source>
+ <translation>\"%1\" is not a face\nPlease select a face and try again</translation>
+ </message>
+ <message>
+ <source>SHAPE_IS_NOT_A_PLANE</source>
+ <translation>\"%1\" is not a plane\nPlease select a plane and try again</translation>
+ </message>
+ <message>
+ <source>SOURCE</source>
+ <translation>Source</translation>
+ </message>
+ <message>
+ <source>TLT</source>
+ <translation>Selection filter</translation>
+ </message>
+ <message>
+ <source>VOLUMES_TLT</source>
+ <translation>Filter for Volumes</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_FilterLibraryDlg</name>
+ <message>
+ <source>ADD</source>
+ <translation>Add</translation>
+ </message>
+ <message>
+ <source>ADD_TO_TLT</source>
+ <translation>Add selection filter to library</translation>
+ </message>
+ <message>
+ <source>ALL_FILES_FILTER</source>
+ <translation>All Files (*.*)</translation>
+ </message>
+ <message>
+ <source>ASSIGN_NEW_NAME</source>
+ <translation>Library already contains filter with name \"%1\"\nNew name \"%2\" is assigned to added filter</translation>
+ </message>
+ <message>
+ <source>COPY_FROM_TLT</source>
+ <translation>Copy selection filter from library</translation>
+ </message>
+ <message>
+ <source>DELETE</source>
+ <translation>Delete</translation>
+ </message>
+ <message>
+ <source>EDGE</source>
+ <translation>Edge</translation>
+ </message>
+ <message>
+ <source>EDIT_LIB_TLT</source>
+ <translation>Selection filter library</translation>
+ </message>
+ <message>
+ <source>ELEMENT</source>
+ <translation>Element</translation>
+ </message>
+ <message>
+ <source>EMPTY_FILTER_NAME</source>
+ <translation>Name of the filter is empty\nPlease enter a non-empty name</translation>
+ </message>
+ <message>
+ <source>ERROR_FILTER_NAME</source>
+ <translation>Name of the filter is not unique\nPlease enter other name</translation>
+ </message>
+ <message>
+ <source>ERROR_LOAD</source>
+ <translation>It is impossible to load library\nPlease check library file name and attributes</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_ADDING</source>
+ <translation>Internal error occurs during adiing new filter in library.\nPlease verify validity of entered information</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_COPYING</source>
+ <translation>Internal error occurs during copying filter from library.\nPlease verify validity of entered information</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_DELETING</source>
+ <translation>Internal error occurs during deleting filter from library.\nPlease verify validity of entered information</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_EDITING</source>
+ <translation>Internal error occurs during editing filter library.\nPlease verify validity of entered information</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_SAVING</source>
+ <translation>Internal error occurs during saving filter library\nPlease check input data and try again</translation>
+ </message>
+ <message>
+ <source>FACE</source>
+ <translation>Face</translation>
+ </message>
+ <message>
+ <source>FILTER</source>
+ <translation>Filter</translation>
+ </message>
+ <message>
+ <source>FILTER_NAME</source>
+ <translation>Filter name</translation>
+ </message>
+ <message>
+ <source>FILTER_NAMES</source>
+ <translation>Names of filters</translation>
+ </message>
+ <message>
+ <source>LIBRARY_FILE</source>
+ <translation>Library file name</translation>
+ </message>
+ <message>
+ <source>LIBRARY_IS_NOT_LOADED</source>
+ <translation>Library is not loaded. Please load library and try again</translation>
+ </message>
+ <message>
+ <source>LIB_NAME</source>
+ <translation>FilterLib.xml</translation>
+ </message>
+ <message>
+ <source>NODE</source>
+ <translation>Node</translation>
+ </message>
+ <message>
+ <source>NO_PERMISSION</source>
+ <translation>You do not have write permission to this file</translation>
+ </message>
+ <message>
+ <source>OPEN_LIBRARY</source>
+ <translation>Open library</translation>
+ </message>
+ <message>
+ <source>SELECTION</source>
+ <translation>Selection</translation>
+ </message>
+ <message>
+ <source>VOLUME</source>
+ <translation>Volume</translation>
+ </message>
+ <message>
+ <source>XML_FILT</source>
+ <translation>XML files(*.xml)</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_FilterTable</name>
+ <message>
+ <source>ADD</source>
+ <translation>Add</translation>
+ </message>
+ <message>
+ <source>ADDITIONAL_PARAMETERS</source>
+ <translation>Additional parameters</translation>
+ </message>
+ <message>
+ <source>ADD_TO</source>
+ <translation>Add to...</translation>
+ </message>
+ <message>
+ <source>AND</source>
+ <translation>And</translation>
+ </message>
+ <message>
+ <source>AREA</source>
+ <translation>Area</translation>
+ </message>
+ <message>
+ <source>ASPECT_RATIO</source>
+ <translation>Aspect ratio</translation>
+ </message>
+ <message>
+ <source>ASPECT_RATIO_3D</source>
+ <translation>Aspect ratio 3D</translation>
+ </message>
+ <message>
+ <source>BAD_ORIENTED_VOLUME</source>
+ <translation>Bad oriented volume</translation>
+ </message>
+ <message>
+ <source>BELONG_TO_CYLINDER</source>
+ <translation>Belong to Cylinder</translation>
+ </message>
+ <message>
+ <source>BELONG_TO_GENSURFACE</source>
+ <translation>Belong to Surface</translation>
+ </message>
+ <message>
+ <source>BELONG_TO_GEOM</source>
+ <translation>Belong to Geom</translation>
+ </message>
+ <message>
+ <source>BELONG_TO_PLANE</source>
+ <translation>Belong to Plane</translation>
+ </message>
+ <message>
+ <source>BINARY</source>
+ <translation>Binary</translation>
+ </message>
+ <message>
+ <source>CLEAR</source>
+ <translation>Clear</translation>
+ </message>
+ <message>
+ <source>COMPARE</source>
+ <translation>Compare</translation>
+ </message>
+ <message>
+ <source>COPY_FROM</source>
+ <translation>Copy from...</translation>
+ </message>
+ <message>
+ <source>CRITERION</source>
+ <translation>Criterion</translation>
+ </message>
+ <message>
+ <source>EDGES</source>
+ <translation>Edges</translation>
+ </message>
+ <message>
+ <source>ENTITY_TYPE</source>
+ <translation>Entity type</translation>
+ </message>
+ <message>
+ <source>EQUAL_TO</source>
+ <translation>Equal to</translation>
+ </message>
+ <message>
+ <source>ERROR</source>
+ <translation>Threshold value is not correctly specified\nPlease enter correct value and try again</translation>
+ </message>
+ <message>
+ <source>FACES</source>
+ <translation>Faces</translation>
+ </message>
+ <message>
+ <source>FILTER</source>
+ <translation>Filter</translation>
+ </message>
+ <message>
+ <source>FREE_BORDERS</source>
+ <translation>Free borders</translation>
+ </message>
+ <message>
+ <source>FREE_EDGES</source>
+ <translation>Free edges</translation>
+ </message>
+ <message>
+ <source>ID</source>
+ <translation>ID</translation>
+ </message>
+ <message>
+ <source>INSERT</source>
+ <translation>Insert</translation>
+ </message>
+ <message>
+ <source>LENGTH</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>LESS_THAN</source>
+ <translation>Less than</translation>
+ </message>
+ <message>
+ <source>LYING_ON_GEOM</source>
+ <translation>Lying on Geom</translation>
+ </message>
+ <message>
+ <source>MINIMUM_ANGLE</source>
+ <translation>Minimum angle</translation>
+ </message>
+ <message>
+ <source>MORE_THAN</source>
+ <translation>More than</translation>
+ </message>
+ <message>
+ <source>MULTIEDGES_ERROR</source>
+ <translation>Threshold value of borders at multi-connections can not be equal 1\nPlease enter correct value and try again</translation>
+ </message>
+ <message>
+ <source>MULTI_BORDERS</source>
+ <translation>Borders at multi-connections</translation>
+ </message>
+ <message>
+ <source>NODES</source>
+ <translation>Nodes</translation>
+ </message>
+ <message>
+ <source>NOT</source>
+ <translation>Not</translation>
+ </message>
+ <message>
+ <source>OR</source>
+ <translation>Or</translation>
+ </message>
+ <message>
+ <source>RANGE_OF_IDS</source>
+ <translation>Range of IDs</translation>
+ </message>
+ <message>
+ <source>REMOVE</source>
+ <translation>Remove</translation>
+ </message>
+ <message>
+ <source>SKEW</source>
+ <translation>Skew</translation>
+ </message>
+ <message>
+ <source>TAPER</source>
+ <translation>Taper</translation>
+ </message>
+ <message>
+ <source>THRESHOLD_VALUE</source>
+ <translation>Threshold value</translation>
+ </message>
+ <message>
+ <source>UNARY</source>
+ <translation>Unary</translation>
+ </message>
+ <message>
+ <source>VOLUMES</source>
+ <translation>Volumes</translation>
+ </message>
+ <message>
+ <source>VOLUME_3D</source>
+ <translation>Volume</translation>
+ </message>
+ <message>
+ <source>WARPING</source>
+ <translation>Warping</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_GroupOpDlg</name>
+ <message>
+ <source>ARGUMENTS</source>
+ <translation>Arguments</translation>
+ </message>
+ <message>
+ <source>CUT_OF_TWO_GROUPS</source>
+ <translation>Cut of two groups</translation>
+ </message>
+ <message>
+ <source>DIFF_MESHES</source>
+ <translation>Arguments of operation are not correctly specified\nGroups correspond to a different meshes\nPlease specify valid arguments and try again</translation>
+ </message>
+ <message>
+ <source>DIFF_TYPES</source>
+ <translation>Arguments of operation are not correctly specified\nGroups contain elements of different types\nPlease specify valid arguments and try again</translation>
+ </message>
+ <message>
+ <source>EMPTY_NAME</source>
+ <translation>Name of group to be created is not valid\nPlease specify non-empty name and try again</translation>
+ </message>
+ <message>
+ <source>INCORRECT_ARGUMENTS</source>
+ <translation>Arguments of operation are not specified\nPlease specify them and try again</translation>
+ </message>
+ <message>
+ <source>INTERSECTION_OF_TWO_GROUPS</source>
+ <translation>Intersection of two groups</translation>
+ </message>
+ <message>
+ <source>MAIN_OBJECT</source>
+ <translation>Main object</translation>
+ </message>
+ <message>
+ <source>NAME</source>
+ <translation>Name</translation>
+ </message>
+ <message>
+ <source>OBJECT_1</source>
+ <translation>Object 1</translation>
+ </message>
+ <message>
+ <source>OBJECT_2</source>
+ <translation>Object 2</translation>
+ </message>
+ <message>
+ <source>RESULT_NAME</source>
+ <translation>Result name</translation>
+ </message>
+ <message>
+ <source>TOOL_OBJECT</source>
+ <translation>Tool object</translation>
+ </message>
+ <message>
+ <source>UNION_OF_TWO_GROUPS</source>
+ <translation>Union of two groups</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MakeNodeAtPointDlg</name>
+ <message>
+ <source>AUTO_SEARCH</source>
+ <translation>Automatic search</translation>
+ </message>
+ <message>
+ <source>CAPTION</source>
+ <translation>Mesh to pass through a point</translation>
+ </message>
+ <message>
+ <source>CREATE_NEW_METHOD</source>
+ <translation>Create a node</translation>
+ </message>
+ <message>
+ <source>MESH_PASS_THROUGH_POINT</source>
+ <translation>Make a node at point</translation>
+ </message>
+ <message>
+ <source>METHOD</source>
+ <translation>Method</translation>
+ </message>
+ <message>
+ <source>MOVE_EXISTING_METHOD</source>
+ <translation>Move a node</translation>
+ </message>
+ <message>
+ <source>NODE_2MOVE</source>
+ <translation>Node to move</translation>
+ </message>
+ <message>
+ <source>NODE_2MOVE_ID</source>
+ <translation>ID</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MakeNodeAtPointOp</name>
+ <message>
+ <source>INVALID_ID</source>
+ <translation>Node ID is invalid</translation>
+ </message>
+ <message>
+ <source>INVALID_MESH</source>
+ <translation>Mesh to modify not selected</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MeshDlg</name>
+ <message>
+ <source>CREATE_MESH</source>
+ <translation>Create mesh</translation>
+ </message>
+ <message>
+ <source>CREATE_SUBMESH</source>
+ <translation>Create sub-mesh</translation>
+ </message>
+ <message>
+ <source>DIM_0D</source>
+ <translation>0D</translation>
+ </message>
+ <message>
+ <source>DIM_1D</source>
+ <translation>1D</translation>
+ </message>
+ <message>
+ <source>DIM_2D</source>
+ <translation>2D</translation>
+ </message>
+ <message>
+ <source>DIM_3D</source>
+ <translation>3D</translation>
+ </message>
+ <message>
+ <source>EDIT_MESH_SUBMESH</source>
+ <translation>Edit mesh/sub-mesh</translation>
+ </message>
+ <message>
+ <source>GEOMETRY</source>
+ <translation>Geometry</translation>
+ </message>
+ <message>
+ <source>HYPOTHESES_SETS</source>
+ <translation>Assign a set of hypotheses</translation>
+ </message>
+ <message>
+ <source>MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>NAME</source>
+ <translation>Name</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MeshOp</name>
+ <message>
+ <source>ALGORITHM_WITHOUT_HYPOTHESIS</source>
+ <translation>Algorithm is defined for %1 dimension but hypothesis is not defined</translation>
+ </message>
+ <message>
+ <source>EDIT_SUBMESH_QUESTION</source>
+ <translation>A submesh on the selected geometry already exists.\n Do you want to edit this submesh?</translation>
+ </message>
+ <message>
+ <source>GEOMETRY_OBJECT_IS_NOT_DEFINED</source>
+ <translation>Geometry object is not defined\nPlease specify it and try again</translation>
+ </message>
+ <message>
+ <source>GEOMETRY_OBJECT_IS_NULL</source>
+ <translation>Geometry object is null</translation>
+ </message>
+ <message>
+ <source>HYPOTHESES_AND_ALGORITHMS_ARE_NOT_DEFINED</source>
+ <translation>Hypotheses and algorithms are not defined</translation>
+ </message>
+ <message>
+ <source>HYPOTHESIS_WITHOUT_ALGORITHM</source>
+ <translation>Hypothesis is defined for %1 dimension but algorithm is not defined</translation>
+ </message>
+ <message>
+ <source>IMPORTED_MESH</source>
+ <translation>Mesh is not built on geometry</translation>
+ </message>
+ <message>
+ <source>INVALID_SUBSHAPE</source>
+ <translation>Geometry object is not a subshape of the shape to mesh</translation>
+ </message>
+ <message>
+ <source>MESH_IS_NOT_DEFINED</source>
+ <translation>Mesh is not defined\nPlease specify it and try again</translation>
+ </message>
+ <message>
+ <source>MESH_IS_NULL</source>
+ <translation>Mesh is null</translation>
+ </message>
+ <message>
+ <source>NAME_OF_MESH_IS_EMPTY</source>
+ <translation>Name of mesh is empty\nPlease enter valid name and try again</translation>
+ </message>
+ <message>
+ <source>NAME_OF_SUBMESH_IS_EMPTY</source>
+ <translation>Name of submesh is empty\nPlease enter valid name and try again</translation>
+ </message>
+ <message>
+ <source>THERE_IS_NO_OBJECT_FOR_EDITING</source>
+ <translation>There is no object for editing. Please\nselect mesh or sub-mesh and try again</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MeshPatternDlg</name>
+ <message>
+ <source>3D_BLOCK</source>
+ <translation>3D block</translation>
+ </message>
+ <message>
+ <source>CAPTION</source>
+ <translation>Pattern Mapping</translation>
+ </message>
+ <message>
+ <source>CREATE_POLYEDRS_NEAR_BOUNDARY</source>
+ <translation>Create polyhedrons near boundary</translation>
+ </message>
+ <message>
+ <source>CREATE_POLYGONS_NEAR_BOUNDARY</source>
+ <translation>Create polygons near boundary</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_LOADING</source>
+ <translation>Loading of pattern from file failed. Probably file\nis corrupted or contains pattern of the other type</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_OPENING</source>
+ <translation>It is impossible to open file. Please verify whether\nfile exists and your permission to this file</translation>
+ </message>
+ <message>
+ <source>ERROR_OF_READING</source>
+ <translation>It is impossible to load pattern\nPlease verify file's contents</translation>
+ </message>
+ <message>
+ <source>ERR_READ_3D_COORD</source>
+ <translation>It is impossible to load pattern\nCoordinates of 3D points out of [0,1] range</translation>
+ </message>
+ <message>
+ <source>ERR_READ_BAD_INDEX</source>
+ <translation>It is impossible to load pattern\nInvalid index of point detected</translation>
+ </message>
+ <message>
+ <source>ERR_READ_BAD_KEY_POINT</source>
+ <translation>It is impossible to load pattern\nKey-point not on a boundary</translation>
+ </message>
+ <message>
+ <source>ERR_READ_ELEM_POINTS</source>
+ <translation>It is impossible to load pattern\ninvalid number of points in element</translation>
+ </message>
+ <message>
+ <source>ERR_READ_NB_POINTS</source>
+ <translation>It is impossible to load pattern\nIt is impossible to read number of points from file</translation>
+ </message>
+ <message>
+ <source>ERR_READ_NO_ELEMS</source>
+ <translation>It is impossible to load pattern\nThere are no elements in it</translation>
+ </message>
+ <message>
+ <source>ERR_READ_NO_KEYPOINT</source>
+ <translation>It is impossible to load pattern\nThere are no key-points in 2D one</translation>
+ </message>
+ <message>
+ <source>ERR_READ_POINT_COORDS</source>
+ <translation>It is impossible to load pattern\nIt is impossible to read point coordinates from file</translation>
+ </message>
+ <message>
+ <source>ERR_READ_TOO_FEW_POINTS</source>
+ <translation>It is impossible to load pattern. There are\n too few points in the file for pattern loading</translation>
+ </message>
+ <message>
+ <source>FACE</source>
+ <translation>Face</translation>
+ </message>
+ <message>
+ <source>LOAD_PATTERN</source>
+ <translation>Load pattern</translation>
+ </message>
+ <message>
+ <source>MESH_FACES</source>
+ <translation>Mesh faces</translation>
+ </message>
+ <message>
+ <source>MESH_VOLUMES</source>
+ <translation>Mesh volumes</translation>
+ </message>
+ <message>
+ <source>NEW</source>
+ <translation>New...</translation>
+ </message>
+ <message>
+ <source>NODE_1</source>
+ <translation>Node 1</translation>
+ </message>
+ <message>
+ <source>NODE_2</source>
+ <translation>Node 2</translation>
+ </message>
+ <message>
+ <source>PATTERN</source>
+ <translation>Pattern</translation>
+ </message>
+ <message>
+ <source>PATTERN_FILT</source>
+ <translation>Pattern files(*.smp)</translation>
+ </message>
+ <message>
+ <source>PATTERN_TYPE</source>
+ <translation>Pattern type</translation>
+ </message>
+ <message>
+ <source>PREVIEW</source>
+ <translation>Preview</translation>
+ </message>
+ <message>
+ <source>REFINE</source>
+ <translation>Refine selected mesh elements</translation>
+ </message>
+ <message>
+ <source>REVERSE</source>
+ <translation>Reverse order of key-points</translation>
+ </message>
+ <message>
+ <source>VERTEX</source>
+ <translation>Vertex </translation>
+ </message>
+ <message>
+ <source>VERTEX1</source>
+ <translation>Vertex 1</translation>
+ </message>
+ <message>
+ <source>VERTEX2</source>
+ <translation>Vertex 2</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MeshTab</name>
+ <message>
+ <source>ADD_HYPOTHESIS</source>
+ <translation>Add. Hypothesis</translation>
+ </message>
+ <message>
+ <source>ALGORITHM</source>
+ <translation>Algorithm</translation>
+ </message>
+ <message>
+ <source>HYPOTHESIS</source>
+ <translation>Hypothesis</translation>
+ </message>
+ <message>
+ <source>NONE</source>
+ <translation><None></translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MoveNodesDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Move node</translation>
+ </message>
+ <message>
+ <source>NODE_ID_IS_NOT_DEFINED</source>
+ <translation>Node ID is not defined</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_MultiEditDlg</name>
+ <message>
+ <source>ADD</source>
+ <translation>Add</translation>
+ </message>
+ <message>
+ <source>FILTER</source>
+ <translation>Filter</translation>
+ </message>
+ <message>
+ <source>REMOVE</source>
+ <translation>Remove</translation>
+ </message>
+ <message>
+ <source>SELECT_FROM</source>
+ <translation>Select from</translation>
+ </message>
+ <message>
+ <source>SORT_LIST</source>
+ <translation>Sort list</translation>
+ </message>
+ <message>
+ <source>SPLIT_JOIN_CRITERION</source>
+ <translation>Criterion</translation>
+ </message>
+ <message>
+ <source>TO_ALL</source>
+ <translation>Apply to all</translation>
+ </message>
+ <message>
+ <source>USE_DIAGONAL_1_3</source>
+ <translation>Use diagonal 1-3</translation>
+ </message>
+ <message>
+ <source>USE_DIAGONAL_2_4</source>
+ <translation>Use diagonal 2-4</translation>
+ </message>
+ <message>
+ <source>USE_NUMERIC_FUNC</source>
+ <translation>Use numeric functor</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_PrecisionDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Precision for mesh quality controls</translation>
+ </message>
+ <message>
+ <source>NOT_USE</source>
+ <translation>Do not use</translation>
+ </message>
+ <message>
+ <source>PRECISION</source>
+ <translation>Number of digits after point</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_RevolutionDlg</name>
+ <message>
+ <source>ANGLE_BY_STEP</source>
+ <translation>Use Angle by Step</translation>
+ </message>
+ <message>
+ <source>PREVIEW</source>
+ <translation>Preview</translation>
+ </message>
+ <message>
+ <source>REVOLUTION_1D</source>
+ <translation>Revolution of 1D elements</translation>
+ </message>
+ <message>
+ <source>REVOLUTION_2D</source>
+ <translation>Revolution of 2D elements</translation>
+ </message>
+ <message>
+ <source>REVOLUTION_AROUND_AXIS</source>
+ <translation>Revolution around an axis</translation>
+ </message>
+ <message>
+ <source>TOTAL_ANGLE</source>
+ <translation>Use Total Angle</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_SewingDlg</name>
+ <message>
+ <source>BORDER</source>
+ <translation>Border</translation>
+ </message>
+ <message>
+ <source>BORDER_1</source>
+ <translation>Border 1</translation>
+ </message>
+ <message>
+ <source>BORDER_2</source>
+ <translation>Border 2</translation>
+ </message>
+ <message>
+ <source>CREATE_POLYEDRS_NEAR_BOUNDARY</source>
+ <translation>Replace affected volumes by polyedres</translation>
+ </message>
+ <message>
+ <source>CREATE_POLYGONS_INSTEAD_SPLITTING</source>
+ <translation>Create polygons instead of splitting</translation>
+ </message>
+ <message>
+ <source>ERROR_1</source>
+ <translation>Free Border1 not found by the selected nodes</translation>
+ </message>
+ <message>
+ <source>ERROR_2</source>
+ <translation>Free Border2 not found by the selected nodes</translation>
+ </message>
+ <message>
+ <source>ERROR_3</source>
+ <translation>Free Border1 and Border2 not found by the selected nodes</translation>
+ </message>
+ <message>
+ <source>ERROR_4</source>
+ <translation>No path from the first side node to the last side node have been found</translation>
+ </message>
+ <message>
+ <source>ERROR_5</source>
+ <translation>Not allowed to splite volumes on the side!</translation>
+ </message>
+ <message>
+ <source>ERROR_6</source>
+ <translation>Different number of elements selected on the sides</translation>
+ </message>
+ <message>
+ <source>ERROR_7</source>
+ <translation>Element sets are topologically different or given nodes are inconvenient</translation>
+ </message>
+ <message>
+ <source>ERROR_8</source>
+ <translation>Nodes on the side 1 are either not linked or not laying on the element set boundary</translation>
+ </message>
+ <message>
+ <source>ERROR_9</source>
+ <translation>Nodes on the side 2 are either not linked or not laying on the element set boundary</translation>
+ </message>
+ <message>
+ <source>FIRST_NODE_ID</source>
+ <translation>First Node ID</translation>
+ </message>
+ <message>
+ <source>LAST_NODE_ID</source>
+ <translation>Last Node ID</translation>
+ </message>
+ <message>
+ <source>MERGE_EQUAL_ELEMENTS</source>
+ <translation>Merge equal elements</translation>
+ </message>
+ <message>
+ <source>NODE1_TO_MERGE</source>
+ <translation>Node 1 To Merge</translation>
+ </message>
+ <message>
+ <source>NODE2_TO_MERGE</source>
+ <translation>Node 2 To Merge</translation>
+ </message>
+ <message>
+ <source>SECOND_NODE_ID</source>
+ <translation>Second Node ID</translation>
+ </message>
+ <message>
+ <source>SEW_BORDER_TO_SIDE</source>
+ <translation>Sew Border To Side</translation>
+ </message>
+ <message>
+ <source>SEW_CONFORM_FREE_BORDERS</source>
+ <translation>Sew Conform Free Borders</translation>
+ </message>
+ <message>
+ <source>SEW_FREE_BORDERS</source>
+ <translation>Sew Free Borders</translation>
+ </message>
+ <message>
+ <source>SEW_SIDE_ELEMENTS</source>
+ <translation>Sew Side Elements</translation>
+ </message>
+ <message>
+ <source>SIDE</source>
+ <translation>Side</translation>
+ </message>
+ <message>
+ <source>SIDE_1</source>
+ <translation>Side 1</translation>
+ </message>
+ <message>
+ <source>SIDE_2</source>
+ <translation>Side 2</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_ShapeByMeshDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Find geometry by mesh element</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_SingleEditDlg</name>
+ <message>
+ <source>EDGE_BETWEEN</source>
+ <translation>Edge between neighboring triangles</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_SmoothingDlg</name>
+ <message>
+ <source>CENTROIDAL</source>
+ <translation>Centroidal</translation>
+ </message>
+ <message>
+ <source>FIXED_NODES_IDS</source>
+ <translation>Fixed nodes ids</translation>
+ </message>
+ <message>
+ <source>IS_PARAMETRIC</source>
+ <translation>in parametric space</translation>
+ </message>
+ <message>
+ <source>ITERATION_LIMIT</source>
+ <translation>Iteration limit</translation>
+ </message>
+ <message>
+ <source>LAPLACIAN</source>
+ <translation>Laplacian</translation>
+ </message>
+ <message>
+ <source>MAX_ASPECT_RATIO</source>
+ <translation>Max. aspect ratio</translation>
+ </message>
+ <message>
+ <source>METHOD</source>
+ <translation>Method</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_TrianglesInversionDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Diagonal inversion</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_UnionOfTrianglesDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Union of triangles</translation>
+ </message>
+ <message>
+ <source>MAXIMUM_ANGLE</source>
+ <translation>Maximum bending angle</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_UnionOfTwoTrianglesDlg</name>
+ <message>
+ <source>CAPTION</source>
+ <translation>Union of two triangles</translation>
+ </message>
+ </context>
+ <context>
+ <name>SMESHGUI_WhatIsDlg</name>
+ <message>
+ <source>ENTITY_TYPE</source>
+ <translation>Element type</translation>
+ </message>
+ <message>
+ <source>GRAVITY_CENTER</source>
+ <translation>Gravity center</translation>
+ </message>
+ </context>
+</TS>
libSMESHEngine_la_LDFLAGS = \
+ $(CORBA_LIBS) \
../../idl/libSalomeIDLSMESH.la \
../SMESH/libSMESHimpl.la \
../Controls/libSMESHControls.la \
-lSalomeLifeCycleCORBA \
-lTOOLSDS \
-lSalomeGenericObj \
- $(GEOM_LDFLAGS) \
- -lGEOMClient \
$(MED_LDFLAGS) \
-lMEDWrapper_V2_2 \
$(CAS_LDPATH) \
-lTKCDF \
-lTKBO \
- -lTKShHealing \
- $(CORBA_LIBS)
+ -lTKShHealing
+# $(GEOM_LDFLAGS) \
+# -lGEOMClient
SMESHEngine_CPPFLAGS = \
$(libSMESHEngine_la_CPPFLAGS)
-# 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
+# SMESH SMESHGUI : GUI for SMESH 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 : Makefile.am
+# Author : Alexander BORODIN, Open CASCADE S.A.S.
#
-# File : Makefile.in
-# Author : Nicolas REJNERI, Paul RASCLE
-# Modified by : Alexander BORODIN (OCN) - autotools usage
-# Module : SMESH
-# $Header$
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# this option puts it to dist
#BUILT_SOURCES = swig_wrap.cpp
+salomeinclude_HEADERS = \
+ libSMESH_Swig.h \
+ libSMESH_Swig.i
+
SWIG_FLAGS = \
@SWIG_FLAGS@ \
-I$(srcdir) \
libSMESH_Swigcmodule_la_SOURCES = \
$(BUILT_SOURCES) \
$(SWIG_SOURCES) \
- ../SMESHGUI/SMESHGUI_Swig.cxx
+ libSMESH_Swig.cxx
nodist_libSMESH_Swigcmodule_la_SOURCES = \
swig_wrap.cpp
--- /dev/null
+// SMESH SMESH : GUI for SMESH 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 : libSMESH_Swig.cxx
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
+//
+
+// SMESH includes
+#include "libSMESH_Swig.h"
+
+#include <SMESHGUI.h>
+#include <SMESHGUI_Utils.h>
+#include <SMESHGUI_Displayer.h>
+
+// SALOME KERNEL includes
+#include <Utils_ORB_INIT.hxx>
+#include <Utils_SINGLETON.hxx>
+#include <SALOMEDSClient_ClientFactory.hxx>
+
+#include <utilities.h>
+
+// SALOME GUI includes
+#include <SUIT_Session.h>
+#include <VTKViewer_ViewModel.h>
+#include <SALOME_Event.h>
+#include <SalomeApp_Application.h>
+
+// OCCT includes
+#include <TopAbs.hxx>
+
+// Qt includes
+#include <QApplication>
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SMESH_Gen)
+#include CORBA_SERVER_HEADER(SMESH_Hypothesis)
+
+static CORBA::ORB_var anORB;
+
+namespace
+{
+ //---------------------------------------------------------------
+ inline
+ CORBA::Object_var
+ StringToObject(const std::string& theIOR)
+ {
+ return anORB->string_to_object(theIOR.c_str());
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ SALOMEDS::SObject_var
+ GetDomainRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ CORBA::Long theDomainRootTag,
+ const QString& theName,
+ const QString& thePixmap)
+ {
+ SALOMEDS::SObject_var aDomainRoot;
+ if (!theSComponentMesh->FindSubObject(theDomainRootTag,aDomainRoot)) {
+ aDomainRoot = theStudyBuilder->NewObjectToTag(theSComponentMesh,theDomainRootTag);
+ SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeName");
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(theName.toLatin1().data());
+ anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributePixMap");
+ SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixmap->SetPixMap(thePixmap.toLatin1().data());
+ anAttr = theStudyBuilder->FindOrCreateAttribute(aDomainRoot,"AttributeSelectable");
+ SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
+ aSelAttr->SetSelectable(false);
+ }
+
+ return aDomainRoot;
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ SALOMEDS::SObject_var
+ GetHypothesisRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ {
+ return GetDomainRoot(theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_HypothesisRoot,
+ QObject::tr("SMESH_MEN_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ SALOMEDS::SObject_var
+ GetAlgorithmsRoot(const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ {
+ return GetDomainRoot(theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ QObject::tr("SMESH_MEN_ALGORITHMS"),
+ "ICON_SMESH_TREE_ALGO");
+ }
+
+
+ //---------------------------------------------------------------
+ inline
+ SALOMEDS::SObject_var
+ AddToDomain(const std::string& theIOR,
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ CORBA::Long theDomainRootTag,
+ const QString& theDomainName,
+ const QString& theDomainPixmap)
+ {
+ SALOMEDS::SObject_var aDomain = GetDomainRoot(theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ theDomainName,
+ theDomainPixmap);
+ // Add New Hypothesis
+ SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(aDomain);
+ SALOMEDS::GenericAttribute_var anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap");
+ SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ CORBA::Object_var anObject = StringToObject(theIOR);
+ SMESH::SMESH_Hypothesis_var aDomainItem = SMESH::SMESH_Hypothesis::_narrow(anObject.in());
+ CORBA::String_var aType = aDomainItem->GetName();
+ QString aPixmapName = theDomainPixmap + "_" + aType.in();
+ aPixmap->SetPixMap(aPixmapName.toLatin1().data());
+ anAttr = theStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
+ SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ anIOR->SetValue(theIOR.c_str());
+
+ return aSObject;
+ }
+
+
+ //---------------------------------------------------------------
+ SALOMEDS::SObject_var
+ AddHypothesis(const std::string& theIOR,
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ {
+ return AddToDomain(theIOR,
+ theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_HypothesisRoot,
+ QObject::tr("SMESH_MEN_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
+ }
+
+
+ //---------------------------------------------------------------
+ SALOMEDS::SObject_var
+ AddAlgorithms(const std::string& theIOR,
+ const SALOMEDS::SComponent_var& theSComponentMesh,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ {
+ return AddToDomain(theIOR,
+ theSComponentMesh,
+ theStudyBuilder,
+ SMESH::Tag_AlgorithmsRoot,
+ QObject::tr("SMESH_MEN_ALGORITHMS"),
+ "ICON_SMESH_TREE_ALGO");
+ }
+
+
+ //---------------------------------------------------------------
+ void
+ SetDomain(const char* theMeshOrSubMeshEntry,
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ long theRefOnAppliedDomainTag,
+ const QString& theAppliedDomainMEN,
+ const QString& theAppliedDomainICON)
+ {
+ SALOMEDS::SObject_var aMeshOrSubMeshSO = theStudy->FindObjectID(theMeshOrSubMeshEntry);
+ SALOMEDS::SObject_var aHypothesisSO = theStudy->FindObjectID(theDomainEntry);
+
+ if(!aMeshOrSubMeshSO->_is_nil() && !aHypothesisSO->_is_nil()){
+ //Find or Create Applied Hypothesis root
+ SALOMEDS::SObject_var anAppliedDomainSO;
+ if(!aMeshOrSubMeshSO->FindSubObject(theRefOnAppliedDomainTag,anAppliedDomainSO)){
+ anAppliedDomainSO = theStudyBuilder->NewObjectToTag(aMeshOrSubMeshSO,theRefOnAppliedDomainTag);
+ SALOMEDS::GenericAttribute_var anAttr =
+ theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeName");
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(theAppliedDomainMEN.toLatin1().data());
+ anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributeSelectable");
+ SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
+ aSelAttr->SetSelectable(false);
+ anAttr = theStudyBuilder->FindOrCreateAttribute(anAppliedDomainSO,"AttributePixMap");
+ SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixmap->SetPixMap(theAppliedDomainICON.toLatin1().data());
+ }
+ SALOMEDS::SObject_var aSObject = theStudyBuilder->NewObject(anAppliedDomainSO);
+ theStudyBuilder->Addreference(aSObject,aHypothesisSO);
+ }
+ }
+
+
+ //---------------------------------------------------------------
+ void
+ SetHypothesis(const char* theMeshOrSubMeshEntry,
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ {
+ SetDomain(theMeshOrSubMeshEntry,
+ theDomainEntry,
+ theStudy,
+ theStudyBuilder,
+ SMESH::Tag_RefOnAppliedHypothesis,
+ QObject::tr("SMESH_MEN_APPLIED_HYPOTHESIS"),
+ "ICON_SMESH_TREE_HYPO");
+ }
+
+
+ //---------------------------------------------------------------
+ void
+ SetAlgorithms(const char* theMeshOrSubMeshEntry,
+ const char* theDomainEntry,
+ const SALOMEDS::Study_var& theStudy,
+ const SALOMEDS::StudyBuilder_var& theStudyBuilder)
+ {
+ SetDomain(theMeshOrSubMeshEntry,
+ theDomainEntry,
+ theStudy,
+ theStudyBuilder,
+ SMESH::Tag_RefOnAppliedAlgorithms,
+ QObject::tr("SMESH_MEN_APPLIED_ALGORIHTMS"),
+ "ICON_SMESH_TREE_ALGO");
+ }
+}
+
+
+//===============================================================
+SMESH_Swig::SMESH_Swig()
+{
+ class TEvent: public SALOME_Event
+ {
+ CORBA::ORB_var& myORB;
+ public:
+
+ TEvent(CORBA::ORB_var& theORB):
+ myORB(theORB)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ try {
+ ORB_INIT &anORBInit = *SINGLETON_<ORB_INIT>::Instance();
+ ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
+ myORB = anORBInit( 0, 0 );
+ } catch (...) {
+ INFOS("internal error : orb not found");
+ }
+ }
+ };
+
+ MESSAGE("Constructeur");
+
+ if(CORBA::is_nil(anORB))
+ ProcessVoidEvent(new TEvent(anORB));
+
+ ASSERT(!CORBA::is_nil(anORB));
+}
+
+
+//===============================================================
+void
+SMESH_Swig::Init(int theStudyID)
+{
+ class TEvent: public SALOME_Event
+ {
+ int myStudyID;
+ SALOMEDS::Study_var& myStudy;
+ SALOMEDS::StudyBuilder_var& myStudyBuilder;
+ SALOMEDS::SComponent_var& mySComponentMesh;
+ public:
+ TEvent(int theStudyID,
+ SALOMEDS::Study_var& theStudy,
+ SALOMEDS::StudyBuilder_var& theStudyBuilder,
+ SALOMEDS::SComponent_var& theSComponentMesh):
+ myStudyID(theStudyID),
+ myStudy(theStudy),
+ myStudyBuilder(theStudyBuilder),
+ mySComponentMesh(theSComponentMesh)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ SUIT_Session* aSession = SUIT_Session::session();
+ SUIT_Application* anApplication = aSession->activeApplication();
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(anApplication);
+
+ SALOME_NamingService* aNamingService = anApp->namingService();
+ CORBA::Object_var anObject = aNamingService->Resolve("/myStudyManager");
+ SALOMEDS::StudyManager_var aStudyMgr = SALOMEDS::StudyManager::_narrow(anObject);
+ myStudy = aStudyMgr->GetStudyByID(myStudyID);
+
+ SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen();
+ aSMESHGen->SetCurrentStudy( myStudy.in() );
+
+ myStudyBuilder = myStudy->NewBuilder();
+
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeName_var aName;
+ SALOMEDS::AttributePixMap_var aPixmap;
+
+ SALOMEDS::SComponent_var aSComponent = myStudy->FindComponent("SMESH");
+ if(aSComponent->_is_nil()){
+ bool aLocked = myStudy->GetProperties()->IsLocked();
+ if (aLocked)
+ myStudy->GetProperties()->SetLocked(false);
+
+ aSComponent = myStudyBuilder->NewComponent("SMESH");
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributeName");
+ aName = SALOMEDS::AttributeName::_narrow(anAttr);
+
+ SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); //SRN: BugID IPAL9186, load a SMESH gui if it hasn't been loaded
+ if (!aSMESHGUI){
+ CAM_Module* aModule = anApp->module("Mesh");
+ if(!aModule)
+ aModule = anApp->loadModule("Mesh");
+ aSMESHGUI = dynamic_cast<SMESHGUI*>(aModule);
+ } //SRN: BugID IPAL9186: end of a fix
+ aName->SetValue(aSMESHGUI->moduleName().toLatin1().data());
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSComponent,"AttributePixMap");
+ aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixmap->SetPixMap( "ICON_OBJBROWSER_SMESH" );
+ myStudyBuilder->DefineComponentInstance(aSComponent,aSMESHGen);
+ if (aLocked)
+ myStudy->GetProperties()->SetLocked(true);
+ }
+
+ mySComponentMesh = SALOMEDS::SComponent::_narrow(aSComponent);
+
+ qApp->processEvents(); // Workaround for bug 12662
+ }
+ };
+
+ MESSAGE("Init");
+
+ ProcessVoidEvent(new TEvent(theStudyID,
+ myStudy,
+ myStudyBuilder,
+ mySComponentMesh));
+}
+
+
+//===============================================================
+SMESH_Swig::~SMESH_Swig()
+{
+ MESSAGE("Destructeur");
+}
+
+
+//===============================================================
+const char* SMESH_Swig::AddNewMesh(const char* theIOR)
+{
+ MESSAGE("AddNewMesh");
+
+ // VSR: added temporarily - to be removed - objects are published automatically by engine
+ SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(theIOR);
+ if (aSObject->_is_nil()){
+ //Find or Create Hypothesis root
+ GetHypothesisRoot(mySComponentMesh,myStudyBuilder);
+ GetAlgorithmsRoot(mySComponentMesh,myStudyBuilder);
+
+ // Add New Mesh
+ aSObject = myStudyBuilder->NewObject(mySComponentMesh);
+ SALOMEDS::GenericAttribute_var anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributePixMap");
+ SALOMEDS::AttributePixMap_var aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
+ aPixmap->SetPixMap( "ICON_SMESH_TREE_MESH" );
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR");
+ SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ anIOR->SetValue(theIOR);
+ }
+
+ CORBA::String_var anEntry = aSObject->GetID();
+
+ return anEntry._retn();
+}
+
+
+//===============================================================
+const char* SMESH_Swig::AddNewHypothesis(const char* theIOR)
+{
+ MESSAGE("AddNewHypothesis");
+
+ SALOMEDS::SObject_var aSObject = ::AddHypothesis(theIOR,
+ mySComponentMesh,
+ myStudyBuilder);
+ CORBA::String_var anEntry = aSObject->GetID();
+ return anEntry._retn();
+}
+
+
+//===============================================================
+const char* SMESH_Swig::AddNewAlgorithms(const char* theIOR)
+{
+ MESSAGE("AddNewAlgorithms");
+
+ SALOMEDS::SObject_var aSObject = ::AddAlgorithms(theIOR,
+ mySComponentMesh,
+ myStudyBuilder);
+ CORBA::String_var anEntry = aSObject->GetID();
+ return anEntry._retn();
+}
+
+
+//===============================================================
+void SMESH_Swig::SetShape(const char* theShapeEntry,
+ const char* theMeshEntry)
+{
+ SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID( theMeshEntry );
+ SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID( theShapeEntry );
+
+ if(!aMeshSO->_is_nil() && !aGeomShapeSO->_is_nil()){
+ SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObjectToTag(aMeshSO, SMESH::Tag_RefOnShape);
+ myStudyBuilder->Addreference(aSObject,aGeomShapeSO);
+ }
+}
+
+
+//===============================================================
+void SMESH_Swig::SetHypothesis(const char* theMeshOrSubMeshEntry,
+ const char* theDomainEntry)
+{
+ ::SetHypothesis(theMeshOrSubMeshEntry,
+ theDomainEntry,
+ myStudy,
+ myStudyBuilder);
+}
+
+
+//===============================================================
+void SMESH_Swig::SetAlgorithms(const char* theMeshOrSubMeshEntry,
+ const char* theDomainEntry)
+{
+ ::SetAlgorithms(theMeshOrSubMeshEntry,
+ theDomainEntry,
+ myStudy,
+ myStudyBuilder);
+}
+
+
+//===============================================================
+void
+SMESH_Swig::UnSetHypothesis(const char* theDomainEntry)
+{
+ SALOMEDS::SObject_var aDomainSO = myStudy->FindObjectID(theDomainEntry);
+ if(!aDomainSO->_is_nil())
+ myStudyBuilder->RemoveObject(aDomainSO);
+}
+
+const char* SMESH_Swig::AddSubMesh(const char* theMeshEntry,
+ const char* theSubMeshIOR,
+ int theShapeType)
+{
+ SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(theMeshEntry);
+ if(!aMeshSO->_is_nil()){
+ long aShapeTag;
+ QString aSubMeshName;
+ switch(theShapeType){
+ case TopAbs_SOLID:
+ aShapeTag = SMESH::Tag_SubMeshOnSolid;
+ aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnSolid");
+ break;
+ case TopAbs_FACE:
+ aShapeTag = SMESH::Tag_SubMeshOnFace;
+ aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnFace");
+ break;
+ case TopAbs_EDGE:
+ aShapeTag = SMESH::Tag_SubMeshOnEdge;
+ aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnEdge");
+ break;
+ case TopAbs_VERTEX:
+ aShapeTag = SMESH::Tag_SubMeshOnVertex;
+ aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnVertex");
+ break;
+ default:
+ aShapeTag = SMESH::Tag_SubMeshOnCompound;
+ aSubMeshName = QObject::tr("SMESH_MEN_SubMeshesOnCompound");
+ }
+
+ SALOMEDS::SObject_var aSubMeshesRoot;
+ SALOMEDS::GenericAttribute_var anAttr;
+ if(!aMeshSO->FindSubObject(aShapeTag,aSubMeshesRoot)){
+ aSubMeshesRoot = myStudyBuilder->NewObjectToTag(aMeshSO,aShapeTag);
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeName");
+ SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(aSubMeshName.toLatin1().data());
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSubMeshesRoot,"AttributeSelectable");
+ SALOMEDS::AttributeSelectable_var aSelAttr = SALOMEDS::AttributeSelectable::_narrow(anAttr);
+ aSelAttr->SetSelectable(false);
+ }
+
+ SALOMEDS::SObject_var aSObject = myStudyBuilder->NewObject(aSubMeshesRoot);
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeIOR");
+ SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+ anIOR->SetValue(theSubMeshIOR);
+
+ CORBA::String_var aString = aSObject->GetID();
+ return aString._retn();
+ }
+
+ return "";
+}
+
+const char* SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry,
+ const char* theGeomShapeEntry,
+ const char* theSubMeshIOR,
+ int ShapeType)
+{
+ SALOMEDS::SObject_var aGeomShapeSO = myStudy->FindObjectID(theGeomShapeEntry);
+ if(!aGeomShapeSO->_is_nil()){
+ const char * aSubMeshEntry = AddSubMesh(theMeshEntry,theSubMeshIOR,ShapeType);
+ SALOMEDS::SObject_var aSubMeshSO = myStudy->FindObjectID(aSubMeshEntry);
+ if(!aSubMeshSO->_is_nil()){
+ SetShape(theGeomShapeEntry,aSubMeshEntry);
+ CORBA::String_var aString = aSubMeshSO->GetID();
+ return aString._retn();
+ }
+ }
+
+ return "";
+}
+
+void SMESH_Swig::CreateAndDisplayActor( const char* Mesh_Entry )
+{
+ // SMESH_Actor* Mesh = smeshGUI->ReadScript(aM);
+ class TEvent: public SALOME_Event
+ {
+ private:
+ const char* _entry;
+ public:
+ TEvent(const char* Mesh_Entry) {
+ _entry = Mesh_Entry;
+ }
+ virtual void Execute() {
+ //SMESH::UpdateView(SMESH::eDisplay, _entry);
+ SUIT_Session* aSession = SUIT_Session::session();
+ SUIT_Application* anApplication = aSession->activeApplication();
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(anApplication);
+ /*SUIT_ViewManager* vman = */anApp->getViewManager(VTKViewer_Viewer::Type(),true);
+ SMESHGUI_Displayer* aDisp = new SMESHGUI_Displayer(anApp);
+ aDisp->Display(_entry,1);
+ }
+ };
+
+ ProcessVoidEvent(new TEvent(Mesh_Entry));
+}
+
+void SMESH_Swig::SetName(const char* theEntry,
+ const char* theName)
+{
+ SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(theEntry);
+ SALOMEDS::GenericAttribute_var anAttr;
+ SALOMEDS::AttributeName_var aName;
+ if(!aSObject->_is_nil()){
+ anAttr = myStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeName");
+ aName = SALOMEDS::AttributeName::_narrow(anAttr);
+ aName->SetValue(theName);
+ }
+}
+
+//================================================================================
+/*!
+ * \brief Set mesh icon according to compute status
+ * \param Mesh_Entry - entry of a mesh
+ * \param isComputed - is mesh computed or not
+ */
+//================================================================================
+
+void SMESH_Swig::SetMeshIcon(const char* theMeshEntry,
+ const bool theIsComputed,
+ const bool isEmpty)
+{
+ class TEvent: public SALOME_Event
+ {
+ SALOMEDS::Study_var myStudy;
+ std::string myMeshEntry;
+ bool myIsComputed, myIsEmpty;
+ public:
+ TEvent(const SALOMEDS::Study_var& theStudy,
+ const std::string& theMeshEntry,
+ const bool theIsComputed,
+ const bool isEmpty):
+ myStudy(theStudy),
+ myMeshEntry(theMeshEntry),
+ myIsComputed(theIsComputed),
+ myIsEmpty(isEmpty)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ SALOMEDS::SObject_var aMeshSO = myStudy->FindObjectID(myMeshEntry.c_str());
+ if(!aMeshSO->_is_nil())
+ if(_PTR(SObject) aMesh = ClientFactory::SObject(aMeshSO))
+ SMESH::ModifiedMesh(aMesh,myIsComputed,myIsEmpty);
+ }
+ };
+
+ ProcessVoidEvent(new TEvent(myStudy,
+ theMeshEntry,
+ theIsComputed,
+ isEmpty));
+}
--- /dev/null
+// SMESH SMESH : GUI for SMESH 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 : libSMESH_Swig.h
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
+//
+
+#ifndef LIBSMESH_SWIG_H
+#define LIBSMESH_SWIG_H
+
+#ifdef WNT
+#if defined SMESHSWIG_EXPORTS
+ #define SMESHSWIG_EXPORT __declspec( dllexport )
+ #else
+ #define SMESHSWIG_EXPORT __declspec( dllimport )
+ #endif
+#else
+ #define SMESHSWIG_EXPORT
+#endif
+
+// IDL includes
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+class SMESHSWIG_EXPORT SMESH_Swig
+{
+public:
+ SMESH_Swig();
+ ~SMESH_Swig();
+
+ void Init( int );
+
+ const char* AddNewMesh( const char* );
+
+ const char* AddNewHypothesis( const char* );
+ const char* AddNewAlgorithms( const char* );
+
+ void SetShape( const char*, const char* );
+
+ void SetHypothesis( const char*, const char* );
+ void SetAlgorithms( const char*, const char* );
+
+ void UnSetHypothesis( const char* );
+
+ const char* AddSubMesh( const char*, const char*, int );
+ const char* AddSubMeshOnShape( const char*, const char*, const char*, int );
+
+ void CreateAndDisplayActor( const char* );
+
+ void SetName( const char*, const char* );
+
+ /*!
+ * \brief Set mesh icon according to compute status
+ * \param Mesh_Entry - entry of a mesh
+ * \param isComputed - is mesh computed or not
+ */
+ void SetMeshIcon( const char*, const bool, const bool );
+
+private:
+ SALOMEDS::Study_var myStudy;
+ SALOMEDS::StudyBuilder_var myStudyBuilder;
+ SALOMEDS::SComponent_var mySComponentMesh;
+};
+
+#endif // LIBSMESH_SWIG_H
-// 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
+// SMESH SMESHGUI : GUI for SMESH 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 : libSMESH_Swig.i
+// Author : Nicolas REJNERI, Open CASCADE S.A.S.
//
-// File : libGeometry_Swig.i
-// Author : Nicolas REJNERI, Paul RASCLE
-// Module : SMESH
-// $Header$
%module libSMESH_Swig
-%include "SMESHGUI_Swig.i"
+%{
+#include "libSMESH_Swig.h"
+%}
+
+/* Exception handler for all functions */
+%exception
+{
+ class PyAllowThreadsGuard
+ {
+ public:
+ // Py_BEGIN_ALLOW_THREADS
+ PyAllowThreadsGuard() { _save = PyEval_SaveThread(); }
+ // Py_END_ALLOW_THREADS
+ ~PyAllowThreadsGuard() { PyEval_RestoreThread(_save); }
+ private:
+ PyThreadState *_save;
+ };
+
+ PyAllowThreadsGuard guard;
+
+ $action
+}
+
+%include "typemaps.i"
+
+class SMESH_Swig
+{
+ public:
+ SMESH_Swig();
+ ~SMESH_Swig();
+
+ void Init(int studyID);
+
+ const char* AddNewMesh(const char* IOR);
+ const char* AddNewHypothesis(const char* IOR);
+ const char* AddNewAlgorithms(const char* IOR);
+
+ void SetShape(const char* ShapeEntry, const char* MeshEntry);
+
+ void SetHypothesis(const char* Mesh_Or_SubMesh_Entry, const char* Hypothesis_Entry);
+ void SetAlgorithms(const char* Mesh_Or_SubMesh_Entry, const char* Algorithms_Entry);
+
+ void UnSetHypothesis(const char* Applied_Hypothesis_Entry );
+
+ const char* AddSubMesh (const char* Mesh_Entry, const char* SM_IOR, int ST);
+ const char* AddSubMeshOnShape (const char* Mesh_Entry, const char* GeomShape_Entry, const char* SM_IOR, int ST);
+
+ void SetName(const char* Entry, const char* Name);
+
+ void SetMeshIcon(const char* Mesh_Entry, const bool isComputed, const bool isEmpty);
+ void CreateAndDisplayActor( const char* Mesh_Entry );
+};
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+// File : SMESH_StdMeshersGUI.hxx
+// Author : Alexander BORODIN, Open CASCADE S.A.S.
//
-// File : SMESH_StdMeshersGUI.hxx
-// Author : Alexander BORODIN
-// Module : SMESH
-// $Header:
-#ifndef _SMESH_StdMeshersGUI_HXX_
-#define _SMESH_StdMeshersGUI_HXX_
+#ifndef SMESH_STDMESHERSGUI_HXX
+#define SMESH_STDMESHERSGUI_HXX
#ifdef WNT
#if defined STDMESHERSGUI_EXPORTS
#define STDMESHERSGUI_EXPORT
#endif
-#endif
+#endif // SMESH_STDMESHERSGUI_HXX
-// SMESH StdMeshersGUI : GUI for plugged-in meshers
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// Copyright (C) 2003 CEA
-//
-// 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
+// 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 : StdMeshersGUI.cxx
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-// File : StdMeshersGUI.cxx
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "StdMeshersGUI_StdHypothesisCreator.h"
#include "StdMeshersGUI_NbSegmentsCreator.h"
-
//=============================================================================
/*! GetHypothesisCreator
*
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : StdMeshersGUI_DistrPreview.cxx
+// Author : Open CASCADE S.A.S.
+//
+// SMESH includes
#include "StdMeshersGUI_DistrPreview.h"
+// Qwt includes
+#include <qwt_plot_curve.h>
+#include <qwt_plot_marker.h>
+#include <qwt_symbol.h>
+#include <qwt_legend.h>
+
+// OCCT includes
#include <Expr_NamedUnknown.hxx>
#include <Expr_GeneralExpression.hxx>
{
myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
myVars.ChangeValue( 1 ) = new Expr_NamedUnknown( "t" );
- myDensity = insertCurve( QString() );
- myDistr = insertCurve( QString() );
- myMsg = insertMarker( new QwtPlotMarker( this ) );
- setMarkerPos( myMsg, 0.5, 0.5 );
- setMarkerLabelPen( myMsg, QPen( Qt::red, 1 ) );
- QFont f = markerFont( myMsg );
- f.setPointSize( 14 );
- f.setBold( true );
- setMarkerFont( myMsg, f );
- setCurvePen( myDensity, QPen( Qt::red, 1 ) );
+ myDensity = new QwtPlotCurve( QString() );
+ myDensity->attach( this );
+ myDistr = new QwtPlotCurve( QString() );
+ myDistr->attach( this );
+ myMsg = new QwtPlotMarker();
+ myMsg->attach( this );
+ myMsg->setValue( 0.5, 0.5 );
+ QwtText mt = myMsg->label();
+ mt.setBackgroundPen( QPen( Qt::red, 1 ) );
+ QFont f = mt.font();
+ f.setPointSize( 14 ); f.setBold( true );
+ mt.setFont( f );
+ myMsg->setLabel( mt );
+ myDensity->setPen( QPen( Qt::red, 1 ) );
QColor dc = Qt::blue;
- setCurvePen( myDistr, QPen( dc, 1 ) );
- setCurveSymbol( myDistr, QwtSymbol( QwtSymbol::XCross, QBrush( dc ), QPen( dc ), QSize( 5, 5 ) ) );
- setAutoLegend( true );
- enableLegend( true );
- setLegendPos( Qwt::Bottom );
- setCurveTitle( myDensity, tr( "SMESH_DENSITY_FUNC" ) );
- setCurveTitle( myDistr, tr( "SMESH_DISTR" ) );
+ myDistr->setPen( QPen( dc, 1 ) );
+ myDistr->setSymbol( QwtSymbol( QwtSymbol::XCross, QBrush( dc ), QPen( dc ), QSize( 5, 5 ) ) );
+
+ QwtLegend* l = legend();
+ if ( !l ) {
+ l = new QwtLegend( this );
+ l->setFrameStyle( QFrame::Box | QFrame::Sunken );
+ }
+ insertLegend( l, QwtPlot::BottomLegend );
+
+ myDensity->setTitle( tr( "SMESH_DENSITY_FUNC" ) );
+ myDistr->setTitle( tr( "SMESH_DISTR" ) );
}
StdMeshersGUI_DistrPreview::~StdMeshersGUI_DistrPreview()
if( isTableFunc() )
arr = h->BuildDistributionTab( myTableFunc, myNbSeg, ( int )myConv );
else
- arr = h->BuildDistributionExpr( myFunction.latin1(), myNbSeg, ( int )myConv );
+ arr = h->BuildDistributionExpr( myFunction.toLatin1().data(), myNbSeg, ( int )myConv );
if( arr )
{
distr = *arr;
return;
}
else
- setMarkerLabel( myMsg, QString() );
+ {
+ QwtText mt = myMsg->label();
+ mt.setText( QString() );
+ myMsg->setLabel( mt );
+ }
int size = graph.length()/2;
double* x = new double[size], *y = new double[size];
max_x = x[i];
}
- setAxisScale( curveXAxis( myDensity ), min_x, max_x );
- setAxisScale( curveYAxis( myDensity ), min( 0.0, min_y ), max( 0.0, max_y ) );
- setCurveData( myDensity, x, y, size );
+ setAxisScale( myDensity->xAxis(), min_x, max_x );
+ setAxisScale( myDensity->yAxis(), min( 0.0, min_y ), max( 0.0, max_y ) );
+ myDensity->setData( x, y, size );
if( x )
delete[] x;
if( y )
x[i] = distr[i];
y[i] = 0;
}
- setCurveData( myDistr, x, y, size );
+ myDistr->setData( x, y, size );
delete[] x;
delete[] y;
x = y = 0;
void StdMeshersGUI_DistrPreview::showError()
{
- setAxisScale( curveXAxis( myDensity ), 0.0, 1.0 );
- setAxisScale( curveYAxis( myDensity ), 0.0, 1.0 );
- setCurveData( myDensity, 0, 0, 0 );
- setCurveData( myDistr, 0, 0, 0 );
- setMarkerLabel( myMsg, tr( "SMESH_INVALID_FUNCTION" ) );
+ setAxisScale( myDensity->xAxis(), 0.0, 1.0 );
+ setAxisScale( myDensity->yAxis(), 0.0, 1.0 );
+ myDensity->setData( 0, 0, 0 );
+ myDistr->setData( 0, 0, 0 );
+ QwtText mt = myMsg->label();
+ mt.setText( tr( "SMESH_INVALID_FUNCTION" ) );
+ myMsg->setLabel( mt );
replot();
}
OCC_CATCH_SIGNALS;
#endif
myExpr = ExprIntrp_GenExp::Create();
- myExpr->Process( ( Standard_CString ) str.latin1() );
+ myExpr->Process( ( Standard_CString ) str.toLatin1().data() );
} catch(Standard_Failure) {
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
parsed_ok = false;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : StdMeshersGUI_DistrPreview.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef STD_MESHERS_GUI_DISTR_PREVIEW_HEADER
-#define STD_MESHERS_GUI_DISTR_PREVIEW_HEADER
+#ifndef STDMESHERSGUI_DISTRPREVIEW_H
+#define STDMESHERSGUI_DISTRPREVIEW_H
+// SMESH includes
#include "SMESH_StdMeshersGUI.hxx"
+// Qwt includes
#include <qwt_plot.h>
+
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
+
+// OCCT includes
#include <ExprIntrp_GenExp.hxx>
#include <Expr_Array1OfNamedUnknown.hxx>
#include <TColStd_Array1OfReal.hxx>
+class QwtPlotCurve;
+class QwtPlotMarker;
+
class STDMESHERSGUI_EXPORT StdMeshersGUI_DistrPreview : public QwtPlot
{
Q_OBJECT
bool myIsTable;
Conversion myConv;
SMESH::double_array myTableFunc;
- long myDensity, myDistr, myMsg;
+ QwtPlotCurve* myDensity;
+ QwtPlotCurve* myDistr;
+ QwtPlotMarker* myMsg;
Handle(ExprIntrp_GenExp) myExpr;
Expr_Array1OfNamedUnknown myVars;
TColStd_Array1OfReal myValues;
StdMeshers::StdMeshers_NumberOfSegments_var myHypo;
};
-#endif
+#endif // STDMESHERSGUI_DISTRPREVIEW_H
-// SMESH StdMeshersGUI
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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 : StdMeshersGUI_DistrTable.cxx
+// Author : Open CASCADE S.A.S.
//
-//
-// File : StdMeshersGUI_DistrTable.cxx
-// Module : SMESH
-// $Header$
+// SMESH includes
#include "StdMeshersGUI_DistrTable.h"
-#include <QtxDblValidator.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
+// Qt incldues
+#include <QItemDelegate>
+#include <QTableWidget>
+#include <QDoubleSpinBox>
+#include <QPushButton>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+
+#define SPACING 6
+
+/*!
+ \brief Sort list of points by ascending order.
+ \internal
+*/
+static void sortData( QList<double>& d )
+{
+ typedef QPair<double, double> Pair;
+ QList<Pair> pairs;
+ for ( int i = 0; i < d.count() / 2; i++ )
+ pairs.append( Pair( d[i*2], d[i*2+1] ) );
+
+ qSort( pairs );
+
+ d.clear();
+
+ Pair p;
+ double prevX = 0.0, prevY = 0.0;
+
+ d.append( prevX );
+ d.append( pairs.count() > 0 ? pairs[0].second : prevY );
+
+ foreach( p, pairs ) {
+ if ( p.first > prevX ) {
+ d.append( p.first );
+ d.append( p.second );
+ prevY = p.second;
+ }
+ prevX = p.first;
+ }
+
+ if ( prevX < 1.0 ) {
+ d.append( 1.0 );
+ d.append( prevY );
+ }
+}
+
+/*!
+ \class StdMeshersGUI_DistrTableFrame::SpinBoxDelegate
+ \brief Custom item delegate (uses double spin box to edit table item)
+ \internal
+*/
-//=================================================================================
-// class : StdMeshersGUI_DistrTable
-// purpose :
-//=================================================================================
-StdMeshersGUI_DistrTable::StdMeshersGUI_DistrTable( const int rows, QWidget* parent, const char* name )
-: QTable( rows, 2, parent, name )
+class StdMeshersGUI_DistrTableFrame::SpinBoxDelegate : public QItemDelegate
+{
+public:
+ SpinBoxDelegate( StdMeshersGUI_DistrTableFrame::Table* );
+ ~SpinBoxDelegate();
+
+ QWidget* createEditor( QWidget*,
+ const QStyleOptionViewItem&,
+ const QModelIndex& ) const;
+ void setEditorData( QWidget*, const QModelIndex&) const;
+ void setModelData( QWidget*, QAbstractItemModel*,
+ const QModelIndex& ) const;
+ void updateEditorGeometry( QWidget*,
+ const QStyleOptionViewItem&,
+ const QModelIndex& ) const;
+
+private:
+ StdMeshersGUI_DistrTableFrame::Table* myTable;
+};
+
+/*!
+ \class StdMeshersGUI_DistrTableFrame::Table
+ \brief Table function widget
+ \internal
+*/
+
+class StdMeshersGUI_DistrTableFrame::Table : public QTableWidget
+{
+private:
+ struct EditorData
+ {
+ int r, c;
+ QDoubleSpinBox* sb;
+ EditorData() { reset(); }
+ void reset() { r = -1; c = -1; sb = 0; }
+ };
+
+public:
+ Table( QWidget*, int = 2 );
+ ~Table();
+
+ QList<double> data();
+ void setData( const QList<double>& );
+
+ double value( int, int ) const;
+ void setValue( int, int, double );
+
+ double argMinimum( int ) const;
+ double argMaximum( int ) const;
+ double argStep( int ) const;
+ double funcMinimum( int ) const;
+ double funcMaximum( int ) const;
+ double funcStep( int ) const;
+
+ void setFuncMinValue( double );
+
+ QSize sizeHint() const;
+
+ void addRow();
+ void deleteRow();
+
+ void setEditor( int, int, QDoubleSpinBox* );
+
+protected:
+ void closeEditor( QWidget*, QAbstractItemDelegate::EndEditHint );
+
+private:
+ void setUpRows( bool = false );
+ QSize cachedSizeHint() const;
+ void setCachedSizeHint( const QSize& ) const;
+ QList<int> selectedRows();
+
+private:
+ double myFuncMin;
+ QSize myCachedSizeHint;
+ EditorData myEditorData;
+};
+
+// ---
+// StdMeshersGUI_DistrTableFrame::SpinBoxDelegate implementation
+// ---
+
+StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
+SpinBoxDelegate( StdMeshersGUI_DistrTableFrame::Table* parent )
+ : QItemDelegate( parent ), myTable( parent )
{
- horizontalHeader()->setLabel( 0, "t" );
- horizontalHeader()->setLabel( 1, "f(t)" );
- myArgV = new QtxDblValidator( 0.0, 1.0, 3, this );
- myFuncV = new QtxDblValidator( 0.0, 1E20, 3, this );
}
-StdMeshersGUI_DistrTable::~StdMeshersGUI_DistrTable()
+StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
+~SpinBoxDelegate()
{
}
-QSize StdMeshersGUI_DistrTable::sizeHint() const
+QWidget*
+StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
+createEditor( QWidget* parent,
+ const QStyleOptionViewItem& /*option*/,
+ const QModelIndex& index ) const
{
- if( cachedSizeHint().isValid() )
- return cachedSizeHint();
+ QDoubleSpinBox* sb = new QDoubleSpinBox( parent );
+ sb->setFrame(false);
+ sb->setMinimum( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
+ myTable->argMinimum( index.row() ) :
+ myTable->funcMinimum( index.row() ) );
+ sb->setMaximum( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
+ myTable->argMaximum( index.row() ) :
+ myTable->funcMaximum( index.row() ) );
+ sb->setSingleStep( index.column() == StdMeshersGUI_DistrTableFrame::ArgColumn ?
+ myTable->argStep( index.row() ) :
+ myTable->funcStep( index.row() ) );
+ myTable->setEditor( index.row(), index.column(), sb );
+ return sb;
+}
- constPolish();
+void
+StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
+setEditorData( QWidget* editor, const QModelIndex& index ) const
+{
+ QString value = index.model()->data(index, Qt::DisplayRole).toString();
+ QDoubleSpinBox* sb = static_cast<QDoubleSpinBox*>(editor);
- QSize sh = QScrollView::sizeHint();
- if( sh.width()<400 )
- sh.setWidth( 400 );
- if( sh.height()<200 )
- sh.setHeight( 200 );
+ bool bOk = false;
+ double v = value.toDouble( &bOk );
+ if ( !bOk ) v = sb->minimum();
- setCachedSizeHint( sh );
- return sh;
+ sb->setValue( v );
}
-void StdMeshersGUI_DistrTable::stopEditing( const bool accept )
+void
+StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
+setModelData( QWidget* editor, QAbstractItemModel* model,
+ const QModelIndex& index ) const
{
- endEdit( currEditRow(), currEditCol(), accept, false );
+ QDoubleSpinBox* sb = static_cast<QDoubleSpinBox*>(editor);
+ model->setData( index, QString::number( sb->value() ), Qt::DisplayRole );
}
-QWidget* StdMeshersGUI_DistrTable::beginEdit( int row, int col, bool replace )
+void
+StdMeshersGUI_DistrTableFrame::SpinBoxDelegate::
+updateEditorGeometry( QWidget* editor,
+ const QStyleOptionViewItem& option,
+ const QModelIndex& /*index*/ ) const
{
- QWidget* w = QTable::beginEdit( row, col, replace );
- if( w && w->inherits( "QLineEdit" ) )
- ( ( QLineEdit* )w )->selectAll();
- return w;
+ editor->setGeometry( option.rect );
}
-void StdMeshersGUI_DistrTable::edit( const int r, const int c )
+// ---
+// StdMeshersGUI_DistrTableFrame::Table implementation
+// ---
+
+StdMeshersGUI_DistrTableFrame::Table::
+Table( QWidget* parent, int rows )
+ : QTableWidget( parent ), myFuncMin( 0.0 )
{
- if( isEditing() )
- endEdit( currEditRow(), currEditCol(), true, false );
- clearSelection();
- setCurrentCell( r, c );
- if( beginEdit( r, c, false ) )
- setEditMode( Editing, r, c );
- QTableSelection sel;
- sel.init( r, c );
- sel.expandTo( r, c );
- addSelection( sel );
+ setItemDelegate( new StdMeshersGUI_DistrTableFrame::SpinBoxDelegate( this ) );
+
+ setColumnCount( 2 );
+
+ QStringList labs;
+ labs << "t" << "f(t)";
+ setHorizontalHeaderLabels( labs );
+
+ while( rows-- )
+ addRow();
+
+ setUpRows( true );
}
-bool StdMeshersGUI_DistrTable::eventFilter( QObject* o, QEvent* e )
+void
+StdMeshersGUI_DistrTableFrame::Table::
+setEditor( int r, int c, QDoubleSpinBox* sb )
{
- if( e && e->type()==QEvent::KeyPress )
- {
- QKeyEvent* ke = ( QKeyEvent* )e;
- int k = ke->key();
- if( k==Qt::Key_Tab || k==Qt::Key_BackTab || k==Qt::Key_Return || k==Qt::Key_Up || k==Qt::Key_Down )
- {
- keyPressEvent( ke );
- return true;
- }
- }
- return QTable::eventFilter( o, e );
-}
-
-void StdMeshersGUI_DistrTable::keyPressEvent( QKeyEvent* e )
-{
- if( e )
- {
- int r = currentRow(), c = currentColumn(), nr, nc;
- bool shift = e->state() & Qt::ShiftButton, cr = false;
- switch( e->key() )
- {
- case Qt::Key_Tab:
- nc = c+1;
- nr = r;
- break;
-
- case Qt::Key_BackTab:
- nc = c-1;
- nr = r;
- break;
-
- case Qt::Key_Return:
- nc = 0;
- nr = shift ? r-1 : r+1;
- cr = true;
- break;
-
- case Qt::Key_Up:
- nc = c;
- nr = r-1;
- break;
-
- case Qt::Key_Down:
- nc = c;
- nr = r+1;
- break;
-
- default:
- QTable::keyPressEvent( e );
- return;
- }
+ myEditorData.r = r;
+ myEditorData.c = c;
+ myEditorData.sb = sb;
+}
- if( nc<0 )
- {
- nc=1; nr--;
- }
- if( nc>1 )
- {
- nc=0; nr++;
- }
+StdMeshersGUI_DistrTableFrame::Table::
+~Table()
+{
+}
- if( nr>=numRows() && cr )
- {
- if( isEditing() )
- endEdit( currEditRow(), currEditCol(), true, false );
- onEdit( INSERT_ROW, nr );
- }
+QList<double>
+StdMeshersGUI_DistrTableFrame::Table::
+data()
+{
+ closePersistentEditor( currentItem() );
- else if( nr<0 || nr>=numRows() )
- {
- nr = r; nc = c;
- }
- edit( nr, nc );
- e->accept();
+ QList<double> d;
+ for ( int r = 0; r < rowCount(); r++ ) {
+ d.append( value( r, ArgColumn ) );
+ d.append( value( r, FuncColumn ) );
}
+ return d;
}
-QWidget* StdMeshersGUI_DistrTable::createEditor( int r, int c, bool init ) const
+void
+StdMeshersGUI_DistrTableFrame::Table::
+setData( const QList<double>& d )
{
- QWidget* w = QTable::createEditor( r, c, init );
- if( w )
- {
- //w->installEventFilter( this );
- if( w->inherits( "QLineEdit" ) )
- {
- QLineEdit* le = ( QLineEdit* )w;
- le->setValidator( c==0 ? myArgV : myFuncV );
- }
+ closePersistentEditor( currentItem() );
+
+ setRowCount( d.count() / 2 );
+ for ( int r = 0; r < rowCount(); r++ ) {
+ setValue( r, ArgColumn, d[r*2] );
+ setValue( r, FuncColumn, d[r*2+1] );
}
-
- return w;
-}
-
-void StdMeshersGUI_DistrTable::onEdit( TableButton b, int cur )
-{
- switch( b )
- {
- case INSERT_ROW:
- setNumRows( numRows()+1 );
- for( int i=numRows()-1; i>=cur; i-- )
- for( int j=0; j<numCols(); j++ )
- if( i>cur )
- setText( i, j, text( i-1, j ) );
- else
- setText( i, j, "0" );
- emit( valueChanged( cur, 0 ) );
- break;
-
- case REMOVE_ROW:
- if( numRows()>1 )
- {
- for( int i=cur; i<numRows(); i++ )
- for( int j=0; j<numCols(); j++ )
- setText( i, j, text( i+1, j ) );
- setNumRows( numRows()-1 );
- }
- emit( valueChanged( cur, 0 ) );
- break;
+}
+
+double
+StdMeshersGUI_DistrTableFrame::Table::
+value( int r, int c ) const
+{
+ if ( r < 0 || r > rowCount() || c < 0 || c > columnCount() || !item( r, c ) )
+ return 0.0;
+
+ return item( r, c )->text().toDouble();
+}
+
+void
+StdMeshersGUI_DistrTableFrame::Table::
+setValue( int r, int c, double v )
+{
+ if ( r < 0 || r > rowCount() || c < 0 || c > columnCount() )
+ return;
+
+ if ( c == FuncColumn && v < funcMinimum( r ) )
+ v = funcMinimum( r ); // correct func value according to the valid min value
+ if ( c == FuncColumn && v < funcMaximum( r ) )
+ v = funcMaximum( r ); // correct func value according to the valid max value
+ else if ( r == ArgColumn && v < argMinimum( r ) )
+ v = argMinimum( r ); // correct arg value according to the valid min value
+ else if ( r == ArgColumn && v > argMaximum( r ) )
+ v = argMaximum( r ); // correct arg value according to the valid max value
+
+ if ( !item( r, c ) )
+ setItem( r, c, new QTableWidgetItem );
+ item( r, c )->setText( QString::number( v ) );
+}
+
+double
+StdMeshersGUI_DistrTableFrame::Table::
+argMinimum( int r ) const
+{
+ // for the first row the minimum value is always 0.0
+ // for the other rows the minumum value is the above row's value
+ double val = 0.0;
+ if ( r > 0 && r < rowCount() )
+ val = value( r-1, ArgColumn );
+ return val;
+}
+
+double
+StdMeshersGUI_DistrTableFrame::Table::
+argMaximum( int r ) const
+{
+ // for the last row the maximum value is always 1.0
+ // for the other rows the maxumum value is the below row's value
+ double val = 1.0;
+ if ( r >= 0 && r < rowCount()-1 ) {
+ val = value( r+1, ArgColumn );
}
+ return val;
}
-void StdMeshersGUI_DistrTable::sortData( SMESH::double_array& arr )
+double
+StdMeshersGUI_DistrTableFrame::Table::
+argStep( int /*r*/ ) const
{
- QValueList< QPair<double,double> > aData;
- if( arr.length()%2==1 )
- arr.length( arr.length()-1 );
+ // correct this to provide more smart behaviour if needed
+ return 0.1;
+}
- int aLen = arr.length();
- for( int i=0; i<aLen/2; i++ )
- aData.append( QPair<double,double>( arr[2*i], arr[2*i+1] ) );
+double
+StdMeshersGUI_DistrTableFrame::Table::
+funcMinimum( int /*r*/ ) const
+{
+ // correct this to provide more smart behaviour if needed
+ return myFuncMin;
+}
+
+double
+StdMeshersGUI_DistrTableFrame::Table::
+funcMaximum( int /*r*/ ) const
+{
+ // correct this to provide more smart behaviour if needed
+ return 1e20;
+}
- qHeapSort( aData );
+double
+StdMeshersGUI_DistrTableFrame::Table::
+funcStep( int /*r*/ ) const
+{
+ // correct this to provide more smart behaviour if needed
+ return 1.0;
+}
- QValueList< QPair<double,double> >::const_iterator anIt = aData.begin(), aLast = aData.end();
- QValueList<double> unique_values;
- double prev; int i=0;
- if( (*anIt).first>0.0 )
- {
- unique_values.append( 0.0 );
- unique_values.append( (*anIt).second );
- i++; prev = 0.0;
+void
+StdMeshersGUI_DistrTableFrame::Table::
+setFuncMinValue( double val )
+{
+ myFuncMin = val;
+
+ QTableWidgetItem* i = currentItem();
+ if ( i &&
+ i->row() == myEditorData.r &&
+ i->column() == myEditorData.c &&
+ i->column() == FuncColumn &&
+ myEditorData.sb ) {
+ myEditorData.sb->setMinimum( myFuncMin );
}
- for( ; anIt!=aLast; anIt++ )
- {
- if( i==0 || (*anIt).first>prev )
- {
- unique_values.append( (*anIt).first );
- unique_values.append( (*anIt).second );
- i++;
- }
- prev = (*anIt).first;
+ else {
+ closePersistentEditor( currentItem() );
}
- if( prev<1.0 )
- {
- unique_values.append( 1.0 );
- anIt--;
- unique_values.append( (*anIt).second );
+
+ for ( int r = 0; r < rowCount(); r++ ) {
+ double v = item( r, FuncColumn )->text().toDouble();
+ if ( v < myFuncMin )
+ item( r, FuncColumn )->setText( QString::number( myFuncMin ) );
}
+}
- arr.length( unique_values.count() );
- QValueList<double>::const_iterator anIt1 = unique_values.begin(), aLast1 = unique_values.end();
- for( int j=0; anIt1!=aLast1; anIt1++, j++ )
- arr[j] = *anIt1;
+QSize
+StdMeshersGUI_DistrTableFrame::Table::
+sizeHint() const
+{
+ if( cachedSizeHint().isValid() )
+ return cachedSizeHint();
+
+ QSize sh = QTableWidget::sizeHint();
+ if( sh.width() < 400 )
+ sh.setWidth( 400 );
+ if( sh.height() < 200 )
+ sh.setHeight( 200 );
+
+ setCachedSizeHint( sh );
+ return sh;
}
-void StdMeshersGUI_DistrTable::data( SMESH::double_array& v )
+void
+StdMeshersGUI_DistrTableFrame::Table::
+addRow()
{
- stopEditing( true );
- v.length( 2*numRows() );
- for( int i=0; i<numRows(); i++ )
- for( int j=0; j<numCols(); j++ )
- v[numCols()*i+j] = text( i, j ).toDouble();
- sortData( v );
+ int r = currentRow() >= 0 ? currentRow() : ( rowCount() > 0 ? rowCount() - 1 : 0 );
+ insertRow( r );
+
+ double argMin = argMinimum( r );
+ double funcMin = funcMinimum( r );
+
+ setItem( r, ArgColumn, new QTableWidgetItem( QString::number( argMin ) ) );
+ setItem( r, FuncColumn, new QTableWidgetItem( QString::number( funcMin ) ) );
}
-void StdMeshersGUI_DistrTable::setData( const SMESH::double_array& d )
+void
+StdMeshersGUI_DistrTableFrame::Table::
+deleteRow()
{
- stopEditing( false );
- setNumRows( d.length()/2 );
- QString val;
- for( int i=0; i<d.length(); i++ )
- {
- QtxDblValidator* v = i%2==0 ? myArgV : myFuncV;
- val = QString::number( d[i] );
- v->fixup( val );
- setText( i/2, i%2, val );
- }
+ QList<int> selRows = selectedRows();
+ for ( int r = selRows.count()-1; r >= 0; r-- )
+ removeRow( r );
}
-QtxDblValidator* StdMeshersGUI_DistrTable::argValidator() const
+void
+StdMeshersGUI_DistrTableFrame::Table::
+closeEditor( QWidget* editor, QAbstractItemDelegate::EndEditHint hint )
{
- return myArgV;
+ myEditorData.reset();
+ QTableWidget::closeEditor( editor, hint );
}
-QtxDblValidator* StdMeshersGUI_DistrTable::funcValidator() const
+void
+StdMeshersGUI_DistrTableFrame::Table::
+setUpRows( bool autoset )
{
- return myFuncV;
+ if ( rowCount() < 1 )
+ return;
+ if ( autoset ) {
+ double s = argMaximum( rowCount()-1 ) / rowCount();
+ for ( int r = 0; r < rowCount()-1; r++ )
+ setValue( r, ArgColumn, r * s );
+ setValue( rowCount()-1, ArgColumn, argMaximum( rowCount()-1 ) );
+ }
+ else {
+ // TODO
+ }
}
-//=================================================================================
-// class : StdMeshersGUI_DistrTableFrame
-// purpose :
-//=================================================================================
-StdMeshersGUI_DistrTableFrame::StdMeshersGUI_DistrTableFrame( QWidget* parent )
-: QFrame( parent )
+QSize
+StdMeshersGUI_DistrTableFrame::Table::
+cachedSizeHint() const
{
- QVBoxLayout* main = new QVBoxLayout( this, 0, 0 );
+ return myCachedSizeHint;
+}
- myTable = new StdMeshersGUI_DistrTable( 1, this );
- connect( myTable, SIGNAL( valueChanged( int, int ) ), this, SIGNAL( valueChanged( int, int ) ) );
- connect( this, SIGNAL( toEdit( TableButton, int ) ), myTable, SLOT( onEdit( TableButton, int ) ) );
-
- QFrame* aButFrame = new QFrame( this );
- QHBoxLayout* butLay = new QHBoxLayout( aButFrame, 5, 5 );
+void
+StdMeshersGUI_DistrTableFrame::Table::
+setCachedSizeHint( const QSize& s ) const
+{
+ Table* that = const_cast<Table*>( this );
+ that->myCachedSizeHint = s;
+}
- myInsertRow = new QPushButton( tr( "SMESH_INSERT_ROW" ), aButFrame );
- myRemoveRow = new QPushButton( tr( "SMESH_REMOVE_ROW" ), aButFrame );
+QList<int>
+StdMeshersGUI_DistrTableFrame::Table::
+selectedRows()
+{
+ QList<int> l;
+ QList<QTableWidgetItem*> selItems = selectedItems();
+ QTableWidgetItem* i;
+ foreach( i, selItems )
+ if ( !l.contains( i->row() ) ) l.append( i->row() );
+ qSort( l );
+ return l;
+}
- butLay->addWidget( myInsertRow, 0 );
- butLay->addWidget( myRemoveRow, 0 );
- butLay->addStretch( 1 );
+/*!
+ \class StdMeshersGUI_DistrTableFrame
+ \brief Distribution table widget
+*/
- main->addWidget( myTable, 1 );
- main->addWidget( aButFrame, 0 );
+StdMeshersGUI_DistrTableFrame::
+StdMeshersGUI_DistrTableFrame( QWidget* parent )
+ : QWidget( parent )
+{
+ QVBoxLayout* main = new QVBoxLayout( this );
+ main->setMargin( 0 );
+ main->setSpacing( 0 );
- connect( myInsertRow, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) );
- connect( myRemoveRow, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) );
+ // ---
+ myTable = new Table( this );
+ connect( myTable, SIGNAL( valueChanged( int, int ) ), this, SIGNAL( valueChanged( int, int ) ) );
+
+ // ---
+ QWidget* aButFrame = new QWidget( this );
+ QHBoxLayout* butLay = new QHBoxLayout( aButFrame );
+ butLay->setContentsMargins( 0, SPACING, 0, SPACING );
+ butLay->setSpacing( SPACING );
+
+ myButtons[ InsertRowBtn ] = new QPushButton( tr( "SMESH_INSERT_ROW" ), aButFrame );
+ myButtons[ RemoveRowBtn ] = new QPushButton( tr( "SMESH_REMOVE_ROW" ), aButFrame );
+
+ butLay->addWidget( myButtons[ InsertRowBtn ] );
+ butLay->addWidget( myButtons[ RemoveRowBtn ] );
+ butLay->addStretch();
+
+ // ---
+ main->addWidget( myTable );
+ main->addWidget( aButFrame );
+
+ // ---
+ connect( myButtons[ InsertRowBtn ], SIGNAL( clicked() ), this, SLOT( onInsert() ) );
+ connect( myButtons[ RemoveRowBtn ], SIGNAL( clicked() ), this, SLOT( onRemove() ) );
+ connect( myTable, SIGNAL( currentCellChanged( int, int, int, int ) ),
+ this, SIGNAL( currentChanged( int, int ) ) );
+ connect( myTable, SIGNAL( cellChanged( int, int ) ),
+ this, SIGNAL( valueChanged( int, int ) ) );
}
-StdMeshersGUI_DistrTableFrame::~StdMeshersGUI_DistrTableFrame()
+StdMeshersGUI_DistrTableFrame::
+~StdMeshersGUI_DistrTableFrame()
{
}
-StdMeshersGUI_DistrTable* StdMeshersGUI_DistrTableFrame::table() const
+void
+StdMeshersGUI_DistrTableFrame::
+showButton( const TableButton b, const bool on )
{
- return myTable;
+ if ( button( b ) ) button( b )->setVisible( on );
}
-void StdMeshersGUI_DistrTableFrame::setShown( const TableButton b, const bool sh )
+bool
+StdMeshersGUI_DistrTableFrame::
+isButtonShown( const TableButton b ) const
{
- if( button( b ) )
- button( b )->setShown( sh );
+ return button( b ) ? button( b )->isVisible() : false;
+}
+
+void
+StdMeshersGUI_DistrTableFrame::
+data( DataArray& array ) const
+{
+ QList<double> d = myTable->data();
+ sortData( d );
+
+ array.length( d.count() );
+ for ( int i = 0; i < d.count(); i++ )
+ array[i] = d[i];
}
-bool StdMeshersGUI_DistrTableFrame::isShown( const TableButton b ) const
+void
+StdMeshersGUI_DistrTableFrame::
+setData( const DataArray& array )
{
- bool res = false;
- if( button( b ) )
- res = button( b )->isShown();
- return res;
+ QList<double> d;
+ for ( int i = 0; i < array.length(); i++ )
+ d.append( array[i] );
+
+ sortData( d );
+ myTable->setData( d );
}
-QButton* StdMeshersGUI_DistrTableFrame::button( const TableButton b ) const
+void
+StdMeshersGUI_DistrTableFrame::
+setFuncMinValue( double v )
{
- QButton* res = 0;
- switch( b )
- {
- case INSERT_ROW:
- res = myInsertRow;
- break;
+ myTable->setFuncMinValue( v );
+}
- case REMOVE_ROW:
- res = myRemoveRow;
- break;
- }
- return res;
+QPushButton*
+StdMeshersGUI_DistrTableFrame::
+button( const TableButton b ) const
+{
+ return myButtons.contains( b ) ? myButtons[ b ] : 0;
}
-void StdMeshersGUI_DistrTableFrame::onButtonClicked()
+void
+StdMeshersGUI_DistrTableFrame::
+onInsert()
{
- if( sender()==button( INSERT_ROW ) )
- emit toEdit( INSERT_ROW, table()->currentRow() );
-
- else if( sender()==button( REMOVE_ROW ) )
- emit toEdit( REMOVE_ROW, table()->currentRow() );
+ myTable->addRow();
}
+void
+StdMeshersGUI_DistrTableFrame::
+onRemove()
+{
+ myTable->deleteRow();
+}
-// SMESH StdMeshersGUI
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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
+// 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 : StdMeshersGUI_DistrTable.h
+// Author : Open CASCADE S.A.S.
//
-// File : StdMeshersGUI_DistrTable.h
-// Module : SMESH
-// $Header$
-#ifndef StdMesherGUI_DistrTable_Header
-#define StdMesherGUI_DistrTable_Header
+#ifndef STDMESHERSGUI_DISTRTABLE_H
+#define STDMESHERSGUI_DISTRTABLE_H
+// SMESH includes
#include "SMESH_StdMeshersGUI.hxx"
-#include <qtable.h>
+// Qt includes
+#include <QWidget>
+#include <QList>
+#include <QMap>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
-class QButton;
-class QtxDblValidator;
-
-/*!
- * \brief Values corresponding to buttons for table resize
- */
-typedef enum { INSERT_ROW, REMOVE_ROW } TableButton;
+class QPushButton;
-/*!
- * \brief This class represents custom table. It has only double values and
- editor for every cell has validator
- */
-class STDMESHERSGUI_EXPORT StdMeshersGUI_DistrTable : public QTable
+class StdMeshersGUI_DistrTableFrame : public QWidget
{
Q_OBJECT
-
-public:
- StdMeshersGUI_DistrTable( const int rows, QWidget* = 0, const char* = 0 );
- virtual ~StdMeshersGUI_DistrTable();
-
-/*!
- * \brief Hides current editor of cell
- */
- void stopEditing( const bool accept );
-
- virtual QSize sizeHint() const;
-
- static void sortData( SMESH::double_array& );
-
- void data( SMESH::double_array& );
- void setData( const SMESH::double_array& );
-
- QtxDblValidator* argValidator() const;
- QtxDblValidator* funcValidator() const;
-
-protected:
- virtual QWidget* createEditor( int, int, bool ) const;
- virtual bool eventFilter( QObject*, QEvent* );
- virtual void keyPressEvent( QKeyEvent* );
- virtual QWidget* beginEdit( int row, int col, bool replace );
- virtual void edit( const int, const int );
-private slots:
- void onEdit( TableButton, int );
-
-private:
- QtxDblValidator *myArgV, *myFuncV;
-};
+ enum { ArgColumn, FuncColumn };
+ class Table;
+ class SpinBoxDelegate;
-/*!
- * \brief This class represents frame for table and buttons
- */
-class STDMESHERSGUI_EXPORT StdMeshersGUI_DistrTableFrame : public QFrame
-{
- Q_OBJECT
+ typedef SMESH::double_array DataArray;
public:
- StdMeshersGUI_DistrTableFrame( QWidget* );
+ typedef enum { InsertRowBtn, RemoveRowBtn } TableButton;
+
+ StdMeshersGUI_DistrTableFrame( QWidget* = 0 );
~StdMeshersGUI_DistrTableFrame();
- StdMeshersGUI_DistrTable* table() const;
+ void showButton( const TableButton, const bool );
+ bool isButtonShown( const TableButton ) const;
-/*!
- * \brief Changes shown state of some button for table resize
- */
- void setShown( const TableButton, const bool );
+ void data( DataArray& ) const;
+ void setData( const DataArray& );
+
+ void setFuncMinValue( double );
-/*!
- * \brief Returns shown state of some button for table resize
- */
- bool isShown( const TableButton ) const;
-
private:
- QButton* button( const TableButton ) const;
+ QPushButton* button( const TableButton ) const;
private slots:
- void onButtonClicked();
-
+ void onInsert();
+ void onRemove();
+
signals:
-/*!
- * \brief This signal is emitted if some of button for table resize is clicked
- * Second parameter is current row. Take into account that
- * this object resize table ( returned by table() ) automatically
- */
- void toEdit( TableButton, int );
- void valueChanged( int, int );
+ void valueChanged( int, int );
+ void currentChanged( int, int );
private:
- QButton *myInsertRow, *myRemoveRow;
- StdMeshersGUI_DistrTable *myTable;
+ QMap<int, QPushButton*> myButtons;
+ Table* myTable;
};
-#endif
-
+#endif // STDMESHERSGUI_DISTRTABLE_H
-// SMESH StdMeshersGUI
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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
+// 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 : StdMeshersGUI_LayerDistributionParamWdg.cxx
+// Author : Open CASCADE S.A.S.
//
-// File : StdMeshersGUI_LayerDistributionParamWdg.cxx
-// Module : SMESH
+// SMESH includes
#include "StdMeshersGUI_LayerDistributionParamWdg.h"
-#include <qpushbutton.h>
-#include <qcursor.h>
-#include <qpopupmenu.h>
-#include <qdialog.h>
-
-#include "SMESHGUI.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_HypothesesUtils.h"
-#include "SMESHGUI_Hypotheses.h"
-// #include "SUIT_ResourceMgr.h"
-// #include "LightApp_SelectionMgr.h"
-#include "SALOMEDSClient_SObject.hxx"
-#include "SALOMEDS_Study.hxx"
-#include "SalomeApp_Tools.h"
+#include <SMESHGUI.h>
+#include <SMESHGUI_HypothesesUtils.h>
+#include <SMESHGUI_Hypotheses.h>
+
+// SALOME GUI includes
+#include <SalomeApp_Tools.h>
+
+// Qt includes
+#include <QPushButton>
+#include <QCursor>
+#include <QMenu>
+#include <QDialog>
+#include <QHBoxLayout>
+
+#define SPACING 6
//================================================================================
/*!
::StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr hyp,
const QString& theName,
QDialog* dlg):
- QHGroupBox(), myName(theName), myDlg( dlg )
+ QWidget(), myName(theName), myDlg( dlg )
{
init();
set( hyp );
StdMeshersGUI_LayerDistributionParamWdg::~StdMeshersGUI_LayerDistributionParamWdg()
{
- if ( myHypTypePopup )
- delete myHypTypePopup;
}
//================================================================================
void StdMeshersGUI_LayerDistributionParamWdg::init()
{
- setFrameStyle(QFrame::NoFrame);
- setInsideMargin(0);
+ QHBoxLayout* aHBox = new QHBoxLayout( this );
+ aHBox->setMargin( 0 );
+ aHBox->setSpacing( SPACING );
mySMESHGUI = SMESHGUI::GetSMESHGUI();
- myCreateButton = new QPushButton( this, "createBut");
- myEditButton = new QPushButton( tr("EDIT"), this, "createBut");
+ myCreateButton = new QPushButton( this );
+ myCreateButton->setObjectName( "createBut" );
-// SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
-// QPixmap iconSlct ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
-// mySelButton->setPixmap(iconSlct);
-// mySelButton->setToggleButton( true );
+ myEditButton = new QPushButton( tr("EDIT"), this );
+ myEditButton->setObjectName( "editBut" );
- myHypTypePopup = new QPopupMenu();
+ myHypTypePopup = new QMenu( this );
// Add to pop-up hypotheses of "Regular_1D" algo
- myHypTypePopup->clear();
HypothesisData* algoData = SMESH::GetHypothesisData( "Regular_1D" );
myHypTypes = SMESH::GetAvailableHypotheses( false, 1 );
QStringList::const_iterator anIter = myHypTypes.begin();
HypothesisData* hypData = SMESH::GetHypothesisData( *anIter );
bool bidon;
if ( SMESH::IsAvailableHypothesis( algoData, hypData->TypeName, bidon ))
- myHypTypePopup->insertItem( hypData->Label );
+ myHypTypePopup->addAction( hypData->Label );
}
+ aHBox->addWidget( myCreateButton );
+ aHBox->addWidget( myEditButton );
+ aHBox->addStretch();
+
connect( myCreateButton, SIGNAL(clicked()), SLOT(onCreate()));
connect( myEditButton, SIGNAL(clicked()), SLOT(onEdit()));
- connect( myHypTypePopup, SIGNAL( activated( int ) ), SLOT( onHypTypePopup( int ) ) );
+ connect( myHypTypePopup, SIGNAL(triggered( QAction* ) ), SLOT( onHypTypePopup( QAction* ) ) );
}
//================================================================================
*/
//================================================================================
-void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( int theIndex )
+void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( QAction* a )
{
SMESH::SMESH_Gen_var gen = mySMESHGUI->GetSMESHGen();
// create a hyp
HypothesisData* aHypData = 0;
QStringList::const_iterator anIter = myHypTypes.begin();
+
for ( ; !aHypData && anIter != myHypTypes.end(); ++anIter )
{
HypothesisData* hypData = SMESH::GetHypothesisData( *anIter );
- if ( myHypTypePopup->text( theIndex ) == hypData->Label )
+ if ( a->text() == hypData->Label )
aHypData = hypData;
}
QString aServLib = aHypData->ServerLibName;
QString aHypType = aHypData->TypeName;
try {
- set( gen->CreateHypothesis(aHypType, aServLib));
+ set( gen->CreateHypothesis(aHypType.toLatin1().data(), aServLib.toLatin1().data()));
}
catch (const SALOME::SALOME_Exception & S_ex) {
SalomeApp_Tools::QtCatchCorbaException(S_ex);
-// SMESH StdMeshersGUI
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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
+// 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 : StdMeshersGUI_LayerDistributionParamWdg.h
+// Author : Open CASCADE S.A.S.
//
-// File : StdMeshersGUI_LayerDistributionParamWdg.h
-// Module : SMESH
-// $Header$
-#ifndef StdMeshersGUI_LayerDistributionParamWdg_Header
-#define StdMeshersGUI_LayerDistributionParamWdg_Header
+#ifndef STDMESHERSGUI_LAYERDISTRIBUTIONPARAMWGD_H
+#define STDMESHERSGUI_LAYERDISTRIBUTIONPARAMWGD_H
+// SMESH includes
#include "SMESH_StdMeshersGUI.hxx"
-#include <qhgroupbox.h>
-#include <qstringlist.h>
+// Qt includes
+#include <QWidget>
+#include <QStringList>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Hypothesis)
class SMESHGUI;
class QPushButton;
-class QPopupMenu;
+class QMenu;
+class QAction;
class QDialog;
/*!
* \brief Widget controlling hypothesis parameter that is another hypothesis
*/
-class STDMESHERSGUI_EXPORT StdMeshersGUI_LayerDistributionParamWdg : public QHGroupBox
+class STDMESHERSGUI_EXPORT StdMeshersGUI_LayerDistributionParamWdg : public QWidget
{
Q_OBJECT
public:
- StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr hyp,
- const QString& theName,
- QDialog* dlg);
+ StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr,
+ const QString&,
+ QDialog*);
~StdMeshersGUI_LayerDistributionParamWdg();
SMESH::SMESH_Hypothesis_var GetHypothesis() { return myHyp; }
private slots:
void onCreate();
void onEdit();
- void onHypTypePopup( int );
+ void onHypTypePopup( QAction* );
private:
void init();
- void set(SMESH::SMESH_Hypothesis_ptr hyp);
+ void set(SMESH::SMESH_Hypothesis_ptr);
private:
SMESH::SMESH_Hypothesis_var myHyp;
QPushButton* myCreateButton;
QPushButton* myEditButton;
- QPopupMenu* myHypTypePopup;
+ QMenu* myHypTypePopup;
QDialog* myDlg;
QString myName;
QString myParamValue;
QStringList myHypTypes;
};
-#endif
-
+#endif // STDMESHERSGUI_LAYERDISTRIBUTIONPARAMWGD_H
-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : StdMeshersGUI_NbSegmentsCreator.cxx
+// Author : Open CASCADE S.A.S.
+//
+// SMESH includes
#include "StdMeshersGUI_NbSegmentsCreator.h"
#include "StdMeshersGUI_DistrTable.h"
#include "StdMeshersGUI_DistrPreview.h"
#include <SMESHGUI_Utils.h>
#include <SMESHGUI_HypothesesUtils.h>
+#include <SMESHGUI_SpinBox.h>
+// IDL includes
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
+// SALOME GUI includes
#include <SalomeApp_Tools.h>
-
#include <QtxIntSpinBox.h>
#include <QtxComboBox.h>
-#include <QtxDblValidator.h>
-#include <SMESHGUI_SpinBox.h>
-#include <qlabel.h>
-#include <qgroupbox.h>
-#include <qframe.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
+// Qt includes
+#include <QLabel>
+#include <QGroupBox>
+#include <QFrame>
+#include <QLineEdit>
+#include <QButtonGroup>
+#include <QRadioButton>
+#include <QGridLayout>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+
+#define SPACING 6
+#define MARGIN 11
StdMeshersGUI_NbSegmentsCreator::StdMeshersGUI_NbSegmentsCreator()
: StdMeshersGUI_StdHypothesisCreator( "NumberOfSegments" ),
myTable( 0 ),
myPreview( 0 ),
myExpr( 0 ),
+ myConvBox( 0 ),
myConv( 0 ),
myLScale( 0 ),
myLTable( 0 ),
myLExpr( 0 ),
- myLConv( 0 ),
myInfo( 0 ),
myGroupLayout( 0 ),
myTableRow( 0 ),
QFrame* StdMeshersGUI_NbSegmentsCreator::buildFrame()
{
- QFrame* fr = new QFrame( 0, "myframe" );
- QVBoxLayout* lay = new QVBoxLayout( fr, 5, 0 );
+ QFrame* fr = new QFrame();
- QGroupBox* GroupC1 = new QGroupBox( fr, "GroupC1" );
+ QVBoxLayout* lay = new QVBoxLayout( fr );
+ lay->setMargin( 0 );
+ lay->setSpacing( 0 );
+
+ QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
lay->addWidget( GroupC1 );
StdMeshers::StdMeshers_NumberOfSegments_var h =
StdMeshers::StdMeshers_NumberOfSegments::_narrow( hypothesis() );
myPreview = new StdMeshersGUI_DistrPreview( GroupC1, h.in() );
- GroupC1->setTitle( tr( "SMESH_ARGUMENTS" ) );
- GroupC1->setColumnLayout(0, Qt::Vertical );
- GroupC1->layout()->setSpacing( 0 );
- GroupC1->layout()->setMargin( 0 );
- myGroupLayout = new QGridLayout( GroupC1->layout() );
- myGroupLayout->setAlignment( Qt::AlignTop );
- myGroupLayout->setSpacing( 6 );
- myGroupLayout->setMargin( 11 );
- myGroupLayout->setColStretch( 0, 0 );
- myGroupLayout->setColStretch( 1, 1 );
+ myGroupLayout = new QGridLayout( GroupC1 );
+ myGroupLayout->setSpacing( SPACING );
+ myGroupLayout->setMargin( MARGIN );
+ myGroupLayout->setColumnStretch( 0, 0 );
+ myGroupLayout->setColumnStretch( 1, 1 );
int row = 0;
// 0) name
// 1) number of segments
myGroupLayout->addWidget( new QLabel( tr( "SMESH_NB_SEGMENTS_PARAM" ), GroupC1 ), row, 0 );
myNbSeg = new QtxIntSpinBox( GroupC1 );
- myNbSeg->setMinValue( 1 );
- myNbSeg->setMaxValue( 9999 );
+ myNbSeg->setMinimum( 1 );
+ myNbSeg->setMaximum( 9999 );
myGroupLayout->addWidget( myNbSeg, row, 1 );
row++;
myGroupLayout->addWidget( new QLabel( tr( "SMESH_DISTR_TYPE" ), GroupC1 ), row, 0 );
myDistr = new QtxComboBox( GroupC1 );
QStringList types;
- types.append( QObject::tr( "SMESH_DISTR_REGULAR" ) );
- types.append( QObject::tr( "SMESH_DISTR_SCALE" ) );
- types.append( QObject::tr( "SMESH_DISTR_TAB" ) );
- types.append( QObject::tr( "SMESH_DISTR_EXPR" ) );
- myDistr->insertStringList( types );
+ types.append( tr( "SMESH_DISTR_REGULAR" ) );
+ types.append( tr( "SMESH_DISTR_SCALE" ) );
+ types.append( tr( "SMESH_DISTR_TAB" ) );
+ types.append( tr( "SMESH_DISTR_EXPR" ) );
+ myDistr->addItems( types );
myGroupLayout->addWidget( myDistr, row, 1 );
row++;
row++;
myInfo = new QLabel( tr( "SMESH_FUNC_DOMAIN" ), GroupC1 );
- myGroupLayout->addMultiCellWidget( myInfo, row, row, 0, 1 );
+ myGroupLayout->addWidget( myInfo, row, 0, 1, 2 );
row++;
// 4) table
row++;
// 6) conversion (radiogroup)
- myGroupLayout->addWidget( myLConv = new QLabel( tr( "SMESH_CONV_MODE" ), GroupC1 ), row, 0 );
+ myConvBox = new QGroupBox( tr( "SMESH_CONV_MODE" ), GroupC1 );
myConv = new QButtonGroup( GroupC1 );
- myConv->setExclusive( true );
- myConv->setColumnLayout( 0, Qt::Vertical );
- QGridLayout* convLay = new QGridLayout( myConv->layout() );
- convLay->addWidget( new QRadioButton( tr( "SMESH_EXP_MODE" ), myConv ), 0, 0 );
- convLay->addWidget( myCutNeg = new QRadioButton( tr( "SMESH_CUT_NEG_MODE" ), myConv ), 1, 0 );
- myGroupLayout->addWidget( myConv, row, 1 );
+
+ QHBoxLayout* convLay = new QHBoxLayout( myConvBox );
+ convLay->setMargin( MARGIN );
+ convLay->setSpacing( SPACING );
+
+ QRadioButton* rbExp = new QRadioButton( tr( "SMESH_EXP_MODE" ), myConvBox );
+ QRadioButton* myCutNeg = new QRadioButton( tr( "SMESH_CUT_NEG_MODE" ), myConvBox );
+
+ convLay->addWidget( rbExp );
+ convLay->addWidget( myCutNeg );
+ myConv->addButton( rbExp, 0 );
+ myConv->addButton( myCutNeg, 1 );
+
+ myGroupLayout->addWidget( myConvBox, row, 0, 1, 2 );
row++;
// 7) distribution preview
- myGroupLayout->addMultiCellWidget( myPreview, row, row, 0, 1 );
+ myGroupLayout->addWidget( myPreview, row, 0, 1, 2 );
myGroupLayout->setRowStretch( row, 1 );
myPreviewRow = row;
row++;
connect( myDistr, SIGNAL( activated( int ) ), this, SLOT( onValueChanged() ) );
connect( myTable, SIGNAL( valueChanged( int, int ) ), this, SLOT( onValueChanged() ) );
connect( myExpr, SIGNAL( textChanged( const QString& ) ), this, SLOT( onValueChanged() ) );
- connect( myConv, SIGNAL( clicked( int ) ), this, SLOT( onValueChanged() ) );
+ connect( myConv, SIGNAL( cuttonClicked( int ) ), this, SLOT( onValueChanged() ) );
return fr;
}
if( myName )
myName->setText( data.myName );
myNbSeg->setValue( data.myNbSeg );
- myDistr->setCurrentItem( data.myDistrType );
+ myDistr->setCurrentIndex( data.myDistrType );
myScale->setValue( data.myScale );
- myConv->setButton( data.myConv );
- myTable->table()->funcValidator()->setBottom(myConv->id( myConv->selected() )==0 ? -1E20 : 0);
- myTable->table()->setData( data.myTable );
+ myConv->button( data.myConv )->setChecked( true );
+ myTable->setFuncMinValue(myConv->checkedId()==0 ? -1E20 : 0);
+ myTable->setData( data.myTable );
myExpr->setText( data.myExpr );
}
try
{
if( isCreation() )
- SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.latin1() );
+ SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
h->SetNumberOfSegments( h_data.myNbSeg );
int distr = h_data.myDistrType;
h->SetTableFunction( h_data.myTable );
if( distr==3 )
- h->SetExpressionFunction( h_data.myExpr.latin1() );
+ h->SetExpressionFunction( h_data.myExpr.toLatin1().data() );
//setting of function must follow after setConversionMode, because otherwise
//the function will be checked with old conversion mode, so that it may occurs
//unexpected errors for user
{
h_data.myName = myName ? myName->text() : "";
h_data.myNbSeg = myNbSeg->value();
- h_data.myDistrType = myDistr->currentItem();
- h_data.myConv = myConv->id( myConv->selected() );
+ h_data.myDistrType = myDistr->currentIndex();
+ h_data.myConv = myConv->checkedId();
h_data.myScale = myScale->value();
- myTable->table()->data( h_data.myTable );
+ myTable->data( h_data.myTable );
h_data.myExpr = myExpr->text();
return true;
}
void StdMeshersGUI_NbSegmentsCreator::onValueChanged()
{
- int distr = myDistr->currentItem();
+ int distr = myDistr->currentIndex();
/* if( distr==2 ) //table func
myCutNeg->setText( tr( "SMESH_NO_CONV" ) );
if( distr==2 && sender()==myConv ) //table func
{
- myTable->table()->funcValidator()->setBottom( myConv->id( myConv->selected() )==0 ? -1E20 : 0 );
+ myTable->setFuncMinValue( myConv->checkedId()==0 ? -1E20 : 0 );
SMESH::double_array arr;
- myTable->table()->data( arr );
- myTable->table()->setData( arr ); //update data in table
+ myTable->data( arr );
+ myTable->setData( arr ); //update data in table
}
myScale->setShown( distr==1 );
myPreview->setShown( isFunc );
myGroupLayout->setRowStretch( myPreviewRow, isFunc ? 1 : 0 );
- myConv->setShown( isFunc );
- myLConv->setShown( isFunc );
+ myConvBox->setShown( isFunc );
if( distr==2 )
myTable->show();
if( distr==2 ) //preview for table-described function
{
SMESH::double_array a;
- myTable->table()->data( a );
+ myTable->data( a );
myPreview->setParams( a, nbSeg, false );
}
else if( distr==3 ) //preview for analytic-described function
myPreview->setParams( myExpr->text(), nbSeg, 100, false );
if( isFunc )
- myPreview->setConversion( StdMeshersGUI_DistrPreview::Conversion( myConv->id( myConv->selected() ) ) );
+ myPreview->setConversion( StdMeshersGUI_DistrPreview::Conversion( myConv->checkedId() ) );
}
-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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 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.
+// 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
+// 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 : StdMeshersGUI_NbSegmentsCreator.h
+// Author : Open CASCADE S.A.S.
+//
-#ifndef NB_SEGMENTS_CREATOR_HEADER
-#define NB_SEGMENTS_CREATOR_HEADER
+#ifndef STDMESHERSGUI_NBSEGMENTSCREATOR_H
+#define STDMESHERSGUI_NBSEGMENTSCREATOR_H
+// SMESH includes
#include "SMESH_StdMeshersGUI.hxx"
#include "StdMeshersGUI_StdHypothesisCreator.h"
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_Mesh)
class StdMeshersGUI_DistrPreview;
class QLineEdit;
class QButtonGroup;
+class QGroupBox;
class QGridLayout;
class QRadioButton;
StdMeshersGUI_DistrTableFrame* myTable;
StdMeshersGUI_DistrPreview* myPreview;
QLineEdit *myName, *myExpr;
+ QGroupBox* myConvBox;
QButtonGroup* myConv;
- QLabel *myLScale, *myLTable, *myLExpr, *myLConv, *myInfo;
+ QLabel *myLScale, *myLTable, *myLExpr, *myInfo;
QGridLayout* myGroupLayout;
int myTableRow, myPreviewRow;
QRadioButton* myCutNeg;
};
-#endif
+#endif // STDMESHERSGUI_NBSEGMENTSCREATOR_H
-// SMESH StdMeshersGUI
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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
+// 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 : StdMeshersGUI_ObjectReferenceParamWdg.cxx
+// Author : Open CASCADE S.A.S.
//
-// File : StdMeshersGUI_ObjectReferenceParamWdg.cxx
-// Module : SMESH
+// SMESH includes
#include "StdMeshersGUI_ObjectReferenceParamWdg.h"
-#include <qpushbutton.h>
-#include <qlineedit.h>
-#include <qvariant.h>
+#include <SMESHGUI.h>
+#include <SMESHGUI_VTKUtils.h>
+#include <SMESH_TypeFilter.hxx>
+
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+#include <LightApp_SelectionMgr.h>
+#include <SVTK_ViewWindow.h>
+#include <SALOME_ListIO.hxx>
-#include "SMESHGUI.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESHGUI_VTKUtils.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SUIT_ResourceMgr.h"
-#include "LightApp_SelectionMgr.h"
-#include "SVTK_ViewWindow.h"
-#include "SALOME_ListIO.hxx"
-#include "SALOMEDSClient_SObject.hxx"
+// SALOME KERNEL incldues
+#include <SALOMEDSClient_SObject.hxx>
+
+// Qt includes
+#include <QPushButton>
+#include <QLineEdit>
+#include <QHBoxLayout>
+
+#define SPACING 6
//================================================================================
/*!
StdMeshersGUI_ObjectReferenceParamWdg::StdMeshersGUI_ObjectReferenceParamWdg
( SUIT_SelectionFilter* f, QWidget* parent)
- : QHGroupBox( parent )
+ : QWidget( parent )
{
myFilter = f;
init();
StdMeshersGUI_ObjectReferenceParamWdg::StdMeshersGUI_ObjectReferenceParamWdg
( MeshObjectType objType, QWidget* parent )
- : QHGroupBox( parent )
+ : QWidget( parent )
{
myFilter = new SMESH_TypeFilter( objType );
init();
void StdMeshersGUI_ObjectReferenceParamWdg::init()
{
- setFrameStyle(QFrame::NoFrame);
- setInsideMargin(0);
+ QHBoxLayout* aHBox = new QHBoxLayout(this);
+
+ aHBox->setMargin(0);
+ aHBox->setSpacing(SPACING);
mySMESHGUI = SMESHGUI::GetSMESHGUI();
mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI );
QPixmap iconSlct ( mgr->loadPixmap("SMESH", tr("ICON_SELECT")));
mySelButton = new QPushButton(this);
- mySelButton->setPixmap(iconSlct);
- mySelButton->setToggleButton( true );
+ mySelButton->setIcon(iconSlct);
+ mySelButton->setCheckable( true );
myObjNameLineEdit = new QLineEdit(this);
myObjNameLineEdit->setReadOnly(true);
+ aHBox->addWidget( mySelButton );
+ aHBox->addWidget( myObjNameLineEdit );
+ aHBox->addStretch();
+
connect( mySelButton, SIGNAL(clicked()), SLOT(activateSelection()));
}
}
emit selectionActivated();
- mySelButton->setOn( mySelectionActivated );
+ mySelButton->setChecked( mySelectionActivated );
}
//================================================================================
disconnect(mySelectionMgr, 0, this, 0 );
mySelectionMgr->removeFilter( myFilter );
- mySelButton->setOn( mySelectionActivated );
+ mySelButton->setChecked( mySelectionActivated );
}
//================================================================================
string name = sobj->GetName();
myObjNameLineEdit->setText( name.c_str() );
myObject = CORBA::Object::_duplicate( obj );
- myParamValue = sobj->GetID();
+ myParamValue = sobj->GetID().c_str();
}
}
-// SMESH StdMeshersGUI
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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
+// 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 : StdMeshersGUI_ObjectReferenceParamWdg.h
+// Author : Open CASCADE S.A.S.
//
-// File : StdMeshersGUI_ObjectReferenceParamWdg.h
-// Module : SMESH
-// $Header$
-#ifndef StdMeshersGUI_ObjectReferenceParamWdg_Header
-#define StdMeshersGUI_ObjectReferenceParamWdg_Header
+#ifndef STDMESHERSGUI_OBJECTREFERENCEPARAMWDG_H
+#define STDMESHERSGUI_OBJECTREFERENCEPARAMWDG_H
+// SMESH includes
#include "SMESH_StdMeshersGUI.hxx"
-#include "SMESH_Type.h"
-#include "qhgroupbox.h"
+#include <SMESH_Type.h>
+
+// Qt includes
+#include <QWidget>
+// CORBA includes
#include <CORBA.h>
class SUIT_SelectionFilter;
/*!
* \brief Widget controlling hypothesis parameter that is an object reference
*/
-class STDMESHERSGUI_EXPORT StdMeshersGUI_ObjectReferenceParamWdg : public QHGroupBox
+class STDMESHERSGUI_EXPORT StdMeshersGUI_ObjectReferenceParamWdg : public QWidget
{
Q_OBJECT
QString myParamValue;
};
-#endif
-
+#endif // STDMESHERSGUI_OBJECTREFERENCEPARAMWDG_H
-// SMESH StdMeshersGUI : GUI for plugged-in meshers
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// Copyright (C) 2003 CEA
-//
-// 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
+// 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 : StdMeshersGUI_StdHypothesisCreator.cxx
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-// File : StdMeshersGUI_StdHypothesisCreator.cxx
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-// $Header: /home/server/cvs/SMESH/SMESH_SRC/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
+// SMESH includes
#include "StdMeshersGUI_StdHypothesisCreator.h"
-#include "SMESHGUI.h"
-#include "SMESHGUI_SpinBox.h"
-#include "SMESHGUI_HypothesesUtils.h"
-#include "SMESHGUI_Utils.h"
-#include "SMESH_TypeFilter.hxx"
-#include "SMESH_NumberFilter.hxx"
-#include "StdMeshersGUI_ObjectReferenceParamWdg.h"
-#include "StdMeshersGUI_LayerDistributionParamWdg.h"
+#include <SMESHGUI.h>
+#include <SMESHGUI_SpinBox.h>
+#include <SMESHGUI_HypothesesUtils.h>
+#include <SMESHGUI_Utils.h>
+#include <SMESH_TypeFilter.hxx>
+#include <SMESH_NumberFilter.hxx>
+#include <StdMeshersGUI_ObjectReferenceParamWdg.h>
+#include <StdMeshersGUI_LayerDistributionParamWdg.h>
-#include "SUIT_ResourceMgr.h"
+// SALOME GUI includes
+#include <SUIT_ResourceMgr.h>
+// IDL includes
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
#include CORBA_SERVER_HEADER(SMESH_Mesh)
-#include <qpixmap.h>
-#include <qhbox.h>
-#include <qslider.h>
-#include <qlabel.h>
-
+// Qt includes
+#include <QHBoxLayout>
+#include <QSlider>
+#include <QLabel>
const double VALUE_MAX = 1.0e+15, // COORD_MAX
VALUE_MAX_2 = VALUE_MAX * VALUE_MAX,
if ( isCreation() ) ++i; // skip widget of 'name' parameter
if ( i < myCustomWidgets.count() ) {
- QPtrList<QWidget>::const_iterator anIt = myCustomWidgets.begin();
- QPtrList<QWidget>::const_iterator aLast = myCustomWidgets.end();
+ QList<QWidget*>::const_iterator anIt = myCustomWidgets.begin();
+ QList<QWidget*>::const_iterator aLast = myCustomWidgets.end();
for ( int j = 0 ; !w && anIt != aLast; ++anIt )
if ( i == j )
w = *anIt;
}
if ( !w ) {
// list has no at() const, so we iterate
- QPtrList<QWidget>::const_iterator anIt = widgets().begin();
- QPtrList<QWidget>::const_iterator aLast = widgets().end();
+ QList<QWidget*>::const_iterator anIt = widgets().begin();
+ QList<QWidget*>::const_iterator aLast = widgets().end();
for( int j = 0; !w && anIt!=aLast; anIt++, ++j ) {
if ( i == j )
w = *anIt;
*/
//================================================================================
- class TDoubleSliderWith2Lables: public QHBox
+ class TDoubleSliderWith2Lables: public QWidget
{
public:
TDoubleSliderWith2Lables( const QString& leftLabel, const QString& rightLabel,
const double initValue, const double bottom,
const double top , const double precision,
QWidget * parent=0 , const char * name=0 )
- :QHBox(parent,name), _bottom(bottom), _precision(precision)
+ :QWidget(parent), _bottom(bottom), _precision(precision)
{
- if ( !leftLabel.isEmpty() ) (new QLabel( this ))->setText( leftLabel );
- _slider = new QSlider( Horizontal, this );
+ setObjectName(name);
+
+ QHBoxLayout* aHBoxL = new QHBoxLayout(this);
+
+ if ( !leftLabel.isEmpty() ) {
+ QLabel* aLeftLabel = new QLabel( this );
+ aLeftLabel->setText( leftLabel );
+ aHBoxL->addWidget( aLeftLabel );
+ }
+
+ _slider = new QSlider( Qt::Horizontal, this );
_slider->setRange( 0, toInt( top ));
_slider->setValue( toInt( initValue ));
- if ( !rightLabel.isEmpty() ) (new QLabel( this ))->setText( rightLabel );
+ aHBoxL->addWidget( _slider );
+
+ if ( !rightLabel.isEmpty() ) {
+ QLabel* aRightLabel = new QLabel( this );
+ aRightLabel->setText( rightLabel );
+ aHBoxL->addWidget( aRightLabel );
+ }
+
+ setLayout( aHBoxL );
}
double value() const { return _bottom + _slider->value() * _precision; }
QSlider * getSlider() const { return _slider; }
*/
//================================================================================
- void deactivateObjRefParamWdg( QPtrList<QWidget>* widgetList )
+ void deactivateObjRefParamWdg( QList<QWidget*>* widgetList )
{
StdMeshersGUI_ObjectReferenceParamWdg* w = 0;
- QPtrList<QWidget>::iterator anIt = widgetList->begin();
- QPtrList<QWidget>::iterator aLast = widgetList->end();
+ QList<QWidget*>::iterator anIt = widgetList->begin();
+ QList<QWidget*>::iterator aLast = widgetList->end();
for ( ; anIt != aLast; anIt++ ) {
if ( (*anIt) && (*anIt)->inherits( "StdMeshersGUI_ObjectReferenceParamWdg" ))
{
bool res = getStdParamFromDlg( params );
if( isCreation() )
{
- SMESH::SetName( SMESH::FindSObject( hypothesis() ), params[0].myValue.toString().latin1() );
- params.remove( params.begin() );
+ SMESH::SetName( SMESH::FindSObject( hypothesis() ), params[0].myValue.toString().toLatin1().data() );
+ params.erase( params.begin() );
}
QString valueStr = stdParamValues( params );
SMESHGUI_SpinBox* sb = w->inherits( "SMESHGUI_SpinBox" ) ? ( SMESHGUI_SpinBox* )w : 0;
if( hypType()=="LocalLength" && sb )
{
- if (sb->name() == tr("SMESH_LOCAL_LENGTH_PARAM"))
+ if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PARAM"))
sb->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 1.0, 6 );
- else if (sb->name() == tr("SMESH_LOCAL_LENGTH_PRECISION"))
+ else if (sb->objectName() == tr("SMESH_LOCAL_LENGTH_PRECISION"))
sb->RangeStepAndValidator( 0.0, 1.0, 0.05, 6 );
}
else if( hypType()=="Arithmetic1D" && sb )
QString StdMeshersGUI_StdHypothesisCreator::caption() const
{
- return tr( QString( "SMESH_%1_TITLE" ).arg( hypTypeName( hypType() ) ) );
+ return tr( QString( "SMESH_%1_TITLE" ).arg( hypTypeName( hypType() ) ).toLatin1().data() );
}
//================================================================================
QPixmap StdMeshersGUI_StdHypothesisCreator::icon() const
{
- QString hypIconName = tr( QString( "ICON_DLG_%1" ).arg( hypTypeName( hypType() ) ) );
+ QString hypIconName = tr( QString( "ICON_DLG_%1" ).arg( hypTypeName( hypType() ) ).toLatin1().data() );
return SMESHGUI::resourceMgr()->loadPixmap( "SMESH", hypIconName );
}
QString StdMeshersGUI_StdHypothesisCreator::type() const
{
- return tr( QString( "SMESH_%1_HYPOTHESIS" ).arg( hypTypeName( hypType() ) ) );
+ return tr( QString( "SMESH_%1_HYPOTHESIS" ).arg( hypTypeName( hypType() ) ).toLatin1().data() );
}
//================================================================================
QWidget* w = 0;
if ( index < customWidgets()->count() ) {
w = customWidgets()->at( index );
- if ( w )
- w->reparent( parent, QPoint( 0, 0 ));
+ if ( w ) {
+ w->setParent( parent );
+ w->move( QPoint( 0, 0 ) );
+ }
}
return w;
}
-// SMESH StdMeshersGUI : GUI for plugged-in meshers
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// Copyright (C) 2003 CEA
-//
-// 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
+// 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 : StdMeshersGUI_StdHypothesisCreator.h
+// Author : Alexander SOLOVYOV, Open CASCADE S.A.S.
//
-// File : StdMeshersGUI_StdHypothesisCreator.h
-// Author : Alexander SOLOVYOV
-// Module : SMESH
-// $Header: /home/server/cvs/SMESH/SMESH_SRC/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h
-#ifndef STDMESHERSGUI_StdHypothesisCreator_HeaderFile
-#define STDMESHERSGUI_StdHypothesisCreator_HeaderFile
+#ifndef STDMESHERSGUI_STDHYPOTHESISCREATOR_H
+#define STDMESHERSGUI_STDHYPOTHESISCREATOR_H
+// SMESH includes
#include "SMESH_StdMeshersGUI.hxx"
#include <SMESHGUI_Hypotheses.h>
ListOfWidgets myCustomWidgets;
};
-#endif
+#endif // STDMESHERSGUI_STDHYPOTHESISCREATOR_H
--- /dev/null
+<!DOCTYPE TS>
+<TS version="1.1" >
+ <context>
+ <name>@default</name>
+ <message>
+ <source>ICON_DLG_ARITHMETIC_1D</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_AUTOMATIC_LENGTH</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_DEFLECTION1D</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_GEOMETRIC_1D</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_LAYER_DISTRIBUTION</source>
+ <translation>mesh_hypo_layer_distribution.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_LOCAL_LENGTH</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MAX_ELEMENT_AREA</source>
+ <translation>mesh_hypo_area.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_MAX_ELEMENT_VOLUME</source>
+ <translation>mesh_hypo_volume.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_NB_SEGMENTS</source>
+ <translation>mesh_hypo_segment.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_NUMBER_OF_LAYERS</source>
+ <translation>mesh_hypo_layer_distribution.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_PROJECTION_SOURCE_1D</source>
+ <translation>mesh_hypo_source_edge.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_PROJECTION_SOURCE_2D</source>
+ <translation>mesh_hypo_source_face.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_PROJECTION_SOURCE_3D</source>
+ <translation>mesh_hypo_source_3d.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_SEGMENT_LENGTH_AROUND_VERTEX</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_DLG_START_END_LENGTH</source>
+ <translation>mesh_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SELECT</source>
+ <translation>select1.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_CompositeSegment_1D</source>
+ <translation>mesh_tree_algo_regular.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_Hexa_3D</source>
+ <translation>mesh_tree_algo_hexa.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_MEFISTO_2D</source>
+ <translation>mesh_tree_algo_mefisto.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_Prism_3D</source>
+ <translation>mesh_tree_algo_projection_3d.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_Projection_1D</source>
+ <translation>mesh_tree_algo_regular.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_Projection_2D</source>
+ <translation>mesh_tree_algo_projection_2d.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_Projection_3D</source>
+ <translation>mesh_tree_hypo_projection_3d.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_Quadrangle_2D</source>
+ <translation>mesh_tree_algo_quad.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_RadialPrism_3D</source>
+ <translation>mesh_tree_algo_radial_prism.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_Regular_1D</source>
+ <translation>mesh_tree_algo_regular.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_ALGO_SegmentAroundVertex_0D</source>
+ <translation>mesh_tree_algo_regular.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_Arithmetic1D</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_AutomaticLength</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_Deflection1D</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_LayerDistribution</source>
+ <translation>mesh_tree_hypo_layers_distribution.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_LengthFromEdges</source>
+ <translation>mesh_tree_hypo_area.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_LocalLength</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_MaxElementArea</source>
+ <translation>mesh_tree_hypo_area.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_MaxElementVolume</source>
+ <translation>mesh_tree_hypo_volume.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_NotConformAllowed</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_NumberOfLayers</source>
+ <translation>mesh_tree_hypo_layers_distribution.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_NumberOfSegments</source>
+ <translation>mesh_tree_hypo_segment.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_ProjectionSource1D</source>
+ <translation>mesh_tree_hypo_source_edge.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_ProjectionSource2D</source>
+ <translation>mesh_tree_hypo_source_face.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_ProjectionSource3D</source>
+ <translation>mesh_tree_hypo_source_3d_shape.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_Propagation</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_QuadranglePreference</source>
+ <translation>mesh_tree_algo_quad.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_QuadraticMesh</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_SegmentLengthAroundVertex</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ <message>
+ <source>ICON_SMESH_TREE_HYPO_StartEndLength</source>
+ <translation>mesh_tree_hypo_length.png</translation>
+ </message>
+ </context>
+</TS>
--- /dev/null
+<!DOCTYPE TS>
+<TS version="1.1" >
+ <context>
+ <name>@default</name>
+ <message>
+ <source>SMESH_ARITHMETIC_1D_HYPOTHESIS</source>
+ <translation>Arithmetic 1D</translation>
+ </message>
+ <message>
+ <source>SMESH_ARITHMETIC_1D_PARAM</source>
+ <translation>Arithmetic Reason</translation>
+ </message>
+ <message>
+ <source>SMESH_ARITHMETIC_1D_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_AUTOMATIC_LENGTH_HYPOTHESIS</source>
+ <translation>Automatic Length</translation>
+ </message>
+ <message>
+ <source>SMESH_AUTOMATIC_LENGTH_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_CONV_MODE</source>
+ <translation>Conversion mode </translation>
+ </message>
+ <message>
+ <source>SMESH_CUT_NEG_MODE</source>
+ <translation>Cut negative</translation>
+ </message>
+ <message>
+ <source>SMESH_DEFLECTION1D_HYPOTHESIS</source>
+ <translation>Deflection 1D</translation>
+ </message>
+ <message>
+ <source>SMESH_DEFLECTION1D_PARAM</source>
+ <translation>Deflection</translation>
+ </message>
+ <message>
+ <source>SMESH_DEFLECTION1D_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_DENSITY_FUNC</source>
+ <translation>Density function</translation>
+ </message>
+ <message>
+ <source>SMESH_DISTR</source>
+ <translation>Distribution</translation>
+ </message>
+ <message>
+ <source>SMESH_DISTR_EXPR</source>
+ <translation>Distribution with analitic density</translation>
+ </message>
+ <message>
+ <source>SMESH_DISTR_REGULAR</source>
+ <translation>Equidistant distribution</translation>
+ </message>
+ <message>
+ <source>SMESH_DISTR_SCALE</source>
+ <translation>Scale distribution</translation>
+ </message>
+ <message>
+ <source>SMESH_DISTR_TAB</source>
+ <translation>Distribution with table density</translation>
+ </message>
+ <message>
+ <source>SMESH_DISTR_TYPE</source>
+ <translation>Type of distribution</translation>
+ </message>
+ <message>
+ <source>SMESH_END_LENGTH_PARAM</source>
+ <translation>End Length</translation>
+ </message>
+ <message>
+ <source>SMESH_EXPR_FUNC</source>
+ <translation>Density function f(t) = </translation>
+ </message>
+ <message>
+ <source>SMESH_EXP_MODE</source>
+ <translation>Exponent</translation>
+ </message>
+ <message>
+ <source>SMESH_FINENESS_PARAM</source>
+ <translation>Fineness</translation>
+ </message>
+ <message>
+ <source>SMESH_FUNC_DOMAIN</source>
+ <translation>Warning: function must be defined on segment [0..1]</translation>
+ </message>
+ <message>
+ <source>SMESH_INSERT_ROW</source>
+ <translation>Insert row</translation>
+ </message>
+ <message>
+ <source>SMESH_INVALID_FUNCTION</source>
+ <translation>Function is invalid</translation>
+ </message>
+ <message>
+ <source>SMESH_LAYERS_DISTRIBUTION</source>
+ <translation>1D Hypothesis</translation>
+ </message>
+ <message>
+ <source>SMESH_LAYER_DISTRIBUTION_HYPOTHESIS</source>
+ <translation>Distribution of Layers</translation>
+ </message>
+ <message>
+ <source>SMESH_LAYER_DISTRIBUTION_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_LOCAL_LENGTH_HYPOTHESIS</source>
+ <translation>Average Length</translation>
+ </message>
+ <message>
+ <source>SMESH_LOCAL_LENGTH_PARAM</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>SMESH_LOCAL_LENGTH_PRECISION</source>
+ <translation>Precision</translation>
+ </message>
+ <message>
+ <source>SMESH_LOCAL_LENGTH_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_MAX_ELEMENT_AREA_HYPOTHESIS</source>
+ <translation>Max. Element Area</translation>
+ </message>
+ <message>
+ <source>SMESH_MAX_ELEMENT_AREA_PARAM</source>
+ <translation>Max. Area</translation>
+ </message>
+ <message>
+ <source>SMESH_MAX_ELEMENT_AREA_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_MAX_ELEMENT_VOLUME_HYPOTHESIS</source>
+ <translation>Max. Element Volume</translation>
+ </message>
+ <message>
+ <source>SMESH_MAX_ELEMENT_VOLUME_PARAM</source>
+ <translation>Max. Volume</translation>
+ </message>
+ <message>
+ <source>SMESH_MAX_ELEMENT_VOLUME_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_NB_SEGMENTS_HYPOTHESIS</source>
+ <translation>Number of Segments</translation>
+ </message>
+ <message>
+ <source>SMESH_NB_SEGMENTS_PARAM</source>
+ <translation>Number of Segments</translation>
+ </message>
+ <message>
+ <source>SMESH_NB_SEGMENTS_SCALE_PARAM</source>
+ <translation>Scale Factor</translation>
+ </message>
+ <message>
+ <source>SMESH_NB_SEGMENTS_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_NO_CONV</source>
+ <translation>No conversion</translation>
+ </message>
+ <message>
+ <source>SMESH_NUMBER_OF_LAYERS</source>
+ <translation>Number of Layers</translation>
+ </message>
+ <message>
+ <source>SMESH_NUMBER_OF_LAYERS_HYPOTHESIS</source>
+ <translation>Radial Prism Parameter</translation>
+ </message>
+ <message>
+ <source>SMESH_NUMBER_OF_LAYERS_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_PROJECTION_SOURCE_1D_HYPOTHESIS</source>
+ <translation>Projection Source 1D</translation>
+ </message>
+ <message>
+ <source>SMESH_PROJECTION_SOURCE_1D_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_PROJECTION_SOURCE_2D_HYPOTHESIS</source>
+ <translation>Projection Source 2D</translation>
+ </message>
+ <message>
+ <source>SMESH_PROJECTION_SOURCE_2D_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_PROJECTION_SOURCE_3D_HYPOTHESIS</source>
+ <translation>Projection Source 3D</translation>
+ </message>
+ <message>
+ <source>SMESH_PROJECTION_SOURCE_3D_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_REMOVE_ROW</source>
+ <translation>Remove row</translation>
+ </message>
+ <message>
+ <source>SMESH_SEGMENT_LENGTH_AROUND_VERTEX_HYPOTHESIS</source>
+ <translation>Segment Length Around Vertex</translation>
+ </message>
+ <message>
+ <source>SMESH_SEGMENT_LENGTH_AROUND_VERTEX_PARAM</source>
+ <translation>Length</translation>
+ </message>
+ <message>
+ <source>SMESH_SEGMENT_LENGTH_AROUND_VERTEX_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_SOURCE_3DSHAPE</source>
+ <translation>3D shape</translation>
+ </message>
+ <message>
+ <source>SMESH_SOURCE_EDGE</source>
+ <translation>Edge</translation>
+ </message>
+ <message>
+ <source>SMESH_SOURCE_FACE</source>
+ <translation>Face</translation>
+ </message>
+ <message>
+ <source>SMESH_SOURCE_MESH</source>
+ <translation>Mesh</translation>
+ </message>
+ <message>
+ <source>SMESH_SOURCE_VERTEX</source>
+ <translation>Source Vertex</translation>
+ </message>
+ <message>
+ <source>SMESH_SOURCE_VERTEX1</source>
+ <translation>Source Vertex 1</translation>
+ </message>
+ <message>
+ <source>SMESH_SOURCE_VERTEX2</source>
+ <translation>Source Vertex 2</translation>
+ </message>
+ <message>
+ <source>SMESH_START_END_LENGTH_HYPOTHESIS</source>
+ <translation>Start and End local Length</translation>
+ </message>
+ <message>
+ <source>SMESH_START_END_LENGTH_TITLE</source>
+ <translation>Hypothesis Construction</translation>
+ </message>
+ <message>
+ <source>SMESH_START_LENGTH_PARAM</source>
+ <translation>Start Length</translation>
+ </message>
+ <message>
+ <source>SMESH_TAB_FUNC</source>
+ <translation>Table function</translation>
+ </message>
+ <message>
+ <source>SMESH_TARGET_VERTEX</source>
+ <translation>Target Vertex</translation>
+ </message>
+ <message>
+ <source>SMESH_TARGET_VERTEX1</source>
+ <translation>Target Vertex 1</translation>
+ </message>
+ <message>
+ <source>SMESH_TARGET_VERTEX2</source>
+ <translation>Target Vertex 2</translation>
+ </message>
+ </context>
+ <context>
+ <name>StdMeshersGUI_LayerDistributionParamWdg</name>
+ <message>
+ <source>CHANGE_TYPE</source>
+ <translation>Change Type</translation>
+ </message>
+ <message>
+ <source>CREATE</source>
+ <translation>Create</translation>
+ </message>
+ <message>
+ <source>EDIT</source>
+ <translation>Edit</translation>
+ </message>
+ </context>
+</TS>