diff --git a/adm_local/cmake_files/FindGEOM.cmake b/adm_local/cmake_files/FindGEOM.cmake index 5f138fd7e..fc6f3eb94 100644 --- a/adm_local/cmake_files/FindGEOM.cmake +++ b/adm_local/cmake_files/FindGEOM.cmake @@ -19,6 +19,7 @@ SET(GEOM_CXXFLAGS -I${GEOM_ROOT_DIR}/include/salome) +FIND_LIBRARY(AdvancedGUI AdvancedGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BasicGUI BasicGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BlocksGUI BlocksGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(BooleanGUI BooleanGUI ${GEOM_ROOT_DIR}/lib/salome) @@ -48,6 +49,7 @@ FIND_LIBRARY(IGESImport IGESImport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(MeasureGUI MeasureGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(NMTDS NMTDS ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(NMTTools NMTTools ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(OCC2VTK OCC2VTK ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(OperationGUI OperationGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(PrimitiveGUI PrimitiveGUI ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(RepairGUI RepairGUI ${GEOM_ROOT_DIR}/lib/salome) @@ -57,3 +59,4 @@ FIND_LIBRARY(STEPExport STEPExport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(STEPImport STEPImport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(STLExport STLExport ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(TransformationGUI TransformationGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(VTKExport VTKExport ${GEOM_ROOT_DIR}/lib/salome) diff --git a/bin/Makefile.am b/bin/Makefile.am index da76a6844..f0f18a9f0 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -28,6 +28,7 @@ nodist_salomescript_DATA = VERSION # python files dist_salomescript_PYTHON = \ + addvars2notebook_GEOM.py \ geom_setenv.py # distributed files diff --git a/bin/addvars2notebook_GEOM.py b/bin/addvars2notebook_GEOM.py new file mode 100644 index 000000000..01c37c582 --- /dev/null +++ b/bin/addvars2notebook_GEOM.py @@ -0,0 +1,50 @@ + +def addvars2notebook(filename, vars_and_values): + stream = open(filename) + lines = stream.readlines() + stream.close() + newlines = [] + for line in lines: + if line.find("= geompy.") >= 0: + name = line.split('=')[0] + name = name.strip() + vals = line + fields = vals.split("(") + if len(fields) == 2: + begin = fields[0] + "(" + vals = fields[1] + fields = vals.split(")") + if len(fields) == 2: + vals = fields[0] + end = ")" + fields[1] + vals = vals.split(',') + newline = begin + newvals = [] + for i in range(len(vals)): + valname = name + "_val_%s"%(i+1) + val = vals[i] + vvv = val.strip() + try: + iii = int(vvv) + vars_and_values.append([valname, val]) + val = val.replace(vvv, valname.__repr__()) + except ValueError: + try: + fff = float(vvv) + vars_and_values.append([valname, val]) + val = val.replace(vvv, valname.__repr__()) + except ValueError: + pass + pass + newvals.append(val) + pass + newline += ','.join(newvals) + newline += end + line = newline + pass + pass + pass + newlines.append(line) + pass + content = "".join(newlines) + return content diff --git a/configure.ac b/configure.ac index 30c3af66d..61386b2a1 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ # Modified by : Alexander BORODIN (OCN) - autotools usage # Created from configure.in.base # -AC_INIT([Salome2 Project GEOM module], [6.1.0], [webmaster.salome@opencascade.com], [SalomeGEOM]) +AC_INIT([Salome2 Project GEOM module], [6.2.0], [webmaster.salome@opencascade.com], [SalomeGEOM]) AC_CONFIG_AUX_DIR(adm_local/unix/config_files) AC_CANONICAL_HOST AC_CANONICAL_TARGET @@ -282,16 +282,16 @@ if test "${gui_ok}" = "yes"; then echo CHECK_QT - - echo - echo --------------------------------------------- - echo testing VTK - echo --------------------------------------------- - echo - - CHECK_VTK fi +echo +echo --------------------------------------------- +echo testing VTK +echo --------------------------------------------- +echo + +CHECK_VTK + echo echo --------------------------------------------- echo testing HDF5 @@ -324,6 +324,13 @@ echo CHECK_HTML_GENERATORS +echo +echo --------------------------------------------- +echo testing sphinx +echo --------------------------------------------- +echo +CHECK_SPHINX + echo echo --------------------------------------------- echo Testing Kernel @@ -341,11 +348,11 @@ echo echo Configure if test "${gui_ok}" = "yes"; then - variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok gui_ok" + variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok sphinx_ok Kernel_ok gui_ok" elif test "${SalomeGUI_need}" != "no"; then - variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok gui_ok" + variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok gui_ok" else - variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok" + variables="cc_ok lex_yacc_ok python_ok swig_ok threads_ok vtk_ok hdf5_ok omniORB_ok boost_ok occ_ok doxygen_ok graphviz_ok Kernel_ok" fi for var in $variables @@ -376,6 +383,19 @@ echo # chmod +x ./bin/*; \ #]) +AC_CONFIG_COMMANDS([hack_libtool],[ +sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\ + if test \"\$(echo \$[@] | grep -E '\\\-L/usr/lib(/../lib)?(64)? ')\" == \"\" \n\ + then\n\ + cmd=\"\1 \$[@]\"\n\ + else\n\ + cmd=\"\1 \"\`echo \$[@] | sed -r -e 's|(.*)-L/usr/lib(/../lib)?(64)? (.*)|\\\1\\\4 -L/usr/lib\\\3|g'\`\n\ + fi\n\ + \$cmd\n\ +}\n\ +CC=\"hack_libtool\"%g" libtool +],[]) + # This list is initiated using autoscan and must be updated manually # when adding a new file .in to manage. When you execute # autoscan, the Makefile list is generated in the output file configure.scan. @@ -389,6 +409,7 @@ AC_OUTPUT([ \ bin/Makefile \ GEOM_version.h \ doc/Makefile \ + doc/docutils/Makefile \ doc/salome/Makefile \ doc/salome/gui/Makefile \ doc/salome/gui/GEOM/Makefile \ @@ -423,6 +444,8 @@ AC_OUTPUT([ \ src/GEOM_I_Superv/Makefile \ src/GEOM_SWIG/Makefile \ src/GEOM_SWIG_WITHIHM/Makefile \ + src/GEOM_PY/Makefile \ + src/GEOM_PY/structelem/Makefile \ src/GenerationGUI/Makefile \ src/GroupGUI/Makefile \ src/IGESExport/Makefile \ @@ -431,6 +454,7 @@ AC_OUTPUT([ \ src/NMTDS/Makefile \ src/NMTTools/Makefile \ src/OBJECT/Makefile \ + src/OCC2VTK/Makefile \ src/OperationGUI/Makefile \ src/PrimitiveGUI/Makefile \ src/RepairGUI/Makefile \ @@ -440,6 +464,7 @@ AC_OUTPUT([ \ src/STLExport/Makefile \ src/ShHealOper/Makefile \ src/TransformationGUI/Makefile \ + src/VTKExport/Makefile \ resources/Makefile \ resources/GEOMCatalog.xml \ idl/Makefile \ diff --git a/doc/Makefile.am b/doc/Makefile.am index f40fb81a5..6cf4c8ea2 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -24,7 +24,7 @@ # $Header$ # source path # -SUBDIRS = salome +SUBDIRS = salome docutils usr_docs: (cd salome && $(MAKE) $(AM_MAKEFLAGS) usr_docs) diff --git a/doc/docutils/Makefile.am b/doc/docutils/Makefile.am new file mode 100644 index 000000000..16ec48f2d --- /dev/null +++ b/doc/docutils/Makefile.am @@ -0,0 +1,93 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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 $(top_srcdir)/adm_local/unix/make_common_starter.am + +pydocdir = $(docdir)/tui/GEOM/docutils + +.PHONY : latex + +if SPHINX_IS_OK + +html/index.html:$(RSTFILES) + make htm + +endif + +EXTRA_DIST+= images + +SPHINXOPTS = +SOURCEDIR = $(srcdir) +SPHINXBUILD = sphinx-build +PAPEROPT_a4 = -D latex_paper_size=a4 +ALLSPHINXOPTS = -d doctrees $(PAPEROPT_a4) $(SPHINXOPTS) $(SOURCEDIR) + +SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/bin/salome:$(KERNEL_ROOT_DIR)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(KERNEL_ROOT_DIR)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages + +SPHINX_LD_LIBRARY_PATH = $(KERNEL_ROOT_DIR)/lib/salome:$(OMNIORB_ROOT)/lib + +htm: + mkdir -p html doctrees + PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH}; \ + LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH}; \ + $(SPHINXBUILD) -W -b html $(ALLSPHINXOPTS) html + @echo + @echo "Build finished. The HTML pages are in html." + +latex: + mkdir -p latex doctrees + PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH}; \ + LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH}; \ + $(SPHINXBUILD) -W -b latex $(ALLSPHINXOPTS) latex + @echo + @echo "Build finished; the LaTeX files are in latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +html: + mkdir -p $@ + +RSTFILES= \ + index.rst \ + overview.rst \ + docapi.rst + +EXTRA_DIST+= $(RSTFILES) + +EXTRA_DIST+= \ + conf.py + +install-data-local: html/index.html + test -z $(pydocdir) || mkdir -p $(DESTDIR)$(pydocdir) + if test -d "html"; then b=; else b="$(srcdir)/"; fi; \ + cp -rf $$b"html"/* $(pydocdir) ; \ + if test -f $$b"latex"/geompy.pdf; then cp -f $$b"latex"/geompy.pdf $(pydocdir) ; fi; + +uninstall-local: + -test -d $(pydocdir) && chmod -R +w $(pydocdir) && rm -rf $(pydocdir)/* + +clean-local: + -rm -rf html latex doctrees + if test -d "html"; then rm -rf html ; fi + +disthook : + -test -d html && cp -Rp html $(distdir) diff --git a/doc/docutils/conf.py b/doc/docutils/conf.py new file mode 100644 index 000000000..5afa71b2f --- /dev/null +++ b/doc/docutils/conf.py @@ -0,0 +1,200 @@ +# -*- coding: iso-8859-1 -*- +# +# yacs documentation build configuration file, created by +# sphinx-quickstart on Fri Aug 29 09:57:25 2008. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# The contents of this file are pickled, so don't put values in the namespace +# that aren't pickleable (module imports are okay, they're removed automatically). +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If your extensions are in another directory, add it here. If the directory +# is relative to the documentation root, use os.path.abspath to make it +# absolute, like shown here. +#sys.path.append(os.path.abspath('.')) + +# General configuration +# --------------------- + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc'] + +# Uncomment the following line to build the links with Python documentation +# (you might need to set http_proxy environment variable for this to work) +#extensions += ['sphinx.ext.intersphinx'] + +# Intersphinx mapping to add links to modules and objects in the Python +# standard library documentation +intersphinx_mapping = {'http://docs.python.org': None} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +source_encoding = 'utf-8' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'GEOM python packages' +copyright = '2010 EDF R&D' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '5.1.4' +# The full version, including alpha/beta/rc tags. +release = '5.1.4' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +language = 'en' + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of documents that shouldn't be included in the build. +#unused_docs = [] + +# List of directories, relative to source directory, that shouldn't be searched +# for source files. +exclude_trees = ['.build','ref','images','CVS','.svn'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + + +# Options for HTML output +# ----------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +html_theme = 'default' +#html_theme = 'nature' +#html_theme = 'agogo' +#html_theme = 'sphinxdoc' +#html_theme = 'omadoc' + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = ['themes'] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +#html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +html_use_modindex = False + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, the reST sources are included in the HTML build as _sources/. +html_copy_source = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = '' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'geompydoc' + + +# Options for LaTeX output +# ------------------------ + +# The paper size ('letter' or 'a4'). +latex_paper_size = 'a4' + +# The font size ('10pt', '11pt' or '12pt'). +latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, document class [howto/manual]). +latex_documents = [ + ('index', 'geompy.tex', 'Documentation of the GEOM python packages', 'EDF R\&D', 'manual') +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +latex_logo = '../salome/tui/images/head.png' + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = True + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +latex_use_modindex = False diff --git a/doc/docutils/docapi.rst b/doc/docutils/docapi.rst new file mode 100644 index 000000000..20a52ca80 --- /dev/null +++ b/doc/docutils/docapi.rst @@ -0,0 +1,43 @@ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Documentation of the programming interface (API) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This section describes the python packages and modules of the +``salome.geom`` python package. The main part is generated from the +code documentation included in source python files. + +:mod:`salome.geom` -- Package containing the GEOM python utilities +================================================================== + +:mod:`geomtools` -- Tools to access GEOM engine and objects +----------------------------------------------------------- + +.. automodule:: salome.geom.geomtools + :members: + +:mod:`structelem` -- Structural elements package +------------------------------------------------ + +.. automodule:: salome.geom.structelem + +.. autoclass:: StructuralElementManager + :members: + +.. autoclass:: StructuralElement + :members: + +:mod:`structelem.parts` -- Structural element parts +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: salome.geom.structelem.parts + :members: + :undoc-members: + :show-inheritance: + +:mod:`structelem.orientation` -- Structural element orientation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. automodule:: salome.geom.structelem.orientation + :members: + :undoc-members: diff --git a/doc/docutils/images/salome-geom-structuralelements.png b/doc/docutils/images/salome-geom-structuralelements.png new file mode 100644 index 000000000..6ed41b12f Binary files /dev/null and b/doc/docutils/images/salome-geom-structuralelements.png differ diff --git a/doc/docutils/index.rst b/doc/docutils/index.rst new file mode 100644 index 000000000..81e4f24aa --- /dev/null +++ b/doc/docutils/index.rst @@ -0,0 +1,14 @@ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Documentation of the GEOM python packages +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +Main documentation +================== + +.. toctree:: + :maxdepth: 3 + + overview.rst + docapi.rst + diff --git a/doc/docutils/overview.rst b/doc/docutils/overview.rst new file mode 100644 index 000000000..3ca3a4b20 --- /dev/null +++ b/doc/docutils/overview.rst @@ -0,0 +1,38 @@ + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +General presentation of the GEOM python package +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +The GEOM python package essentially contains: + +* The visualization of structural elements: a function to create + geometrical 3D representations of mechanical models called + "structural elements". + +Note that these functions either encapsulate the python programming +interface of GEOM core (the CORBA or SWIG interfaces for example) or +extend existing utilities as the ``geompy.py`` module. + +The functions are distributed in the python package +``salome.geom``. For example, the usage of the visualization of +structural elements can be appreciated with this set of instructions: + +.. code-block:: python + + from salome.geom.structelem import TEST_StructuralElement + TEST_StructuralElement() + +This creates the geometrical objects displayed in the study below: + +.. image:: /images/salome-geom-structuralelements.png + :align: center + +The specification of the programming interface of this package is +detailled in the part :doc:`Documentation of the programming interface +(API)` of this documentation. + +.. note:: + The main package ``salome`` contains other sub-packages that are + distributed with the other SALOME modules. For example, the KERNEL + module provides the python package ``salome.kernel`` and SMESH the + package ``salome.smesh``. diff --git a/doc/salome/gui/GEOM/Makefile.am b/doc/salome/gui/GEOM/Makefile.am index 245046a1f..9740ec3ec 100755 --- a/doc/salome/gui/GEOM/Makefile.am +++ b/doc/salome/gui/GEOM/Makefile.am @@ -56,7 +56,7 @@ clean-local: @for filen in `find . -maxdepth 1` ; do \ case $${filen} in \ ./Makefile | ./doxyfile | ./doxyfile_py | ./doxyfile_tui ) ;; \ - . | .. ) ;; \ + . | .. | ./static ) ;; \ *) echo "Removing $${filen}" ; rm -rf $${filen} ;; \ esac ; \ done ; @@ -67,7 +67,7 @@ install-data-local: usr_docs case $${filen} in \ ./Makefile | ./doxyfile | ./doxyfile_py | ./doxyfile_tui ) ;; \ ./doxyfile.bak | ./doxyfile_py.bak | ./doxyfile_tui.bak ) ;; \ - . | .. ) ;; \ + . | .. | ./static ) ;; \ *) echo "Installing $${filen}" ; cp -rp $${filen} $(DESTDIR)$(docdir)/gui/GEOM ;; \ esac ; \ done ; diff --git a/doc/salome/gui/GEOM/doxyfile.in b/doc/salome/gui/GEOM/doxyfile.in index cc6155462..cfd0ff0f7 100755 --- a/doc/salome/gui/GEOM/doxyfile.in +++ b/doc/salome/gui/GEOM/doxyfile.in @@ -72,3 +72,4 @@ GENERATE_RTF = NO #--------------------------------------------------------------------------- TAGFILES = geompy_doc.tag=geompy_doc ALLEXTERNALS = NO +SEARCHENGINE = YES diff --git a/doc/salome/gui/GEOM/doxyfile_py.in b/doc/salome/gui/GEOM/doxyfile_py.in index b296fa5b7..a44abf012 100755 --- a/doc/salome/gui/GEOM/doxyfile_py.in +++ b/doc/salome/gui/GEOM/doxyfile_py.in @@ -159,3 +159,4 @@ DOT_CLEANUP = YES #--------------------------------------------------------------------------- GENERATE_TAGFILE = geompy_doc.tag TAGFILES = tui_examples.tag=.. +SEARCHENGINE = YES diff --git a/doc/salome/gui/GEOM/doxyfile_tui.in b/doc/salome/gui/GEOM/doxyfile_tui.in index 64eca7dcb..f0d198e98 100755 --- a/doc/salome/gui/GEOM/doxyfile_tui.in +++ b/doc/salome/gui/GEOM/doxyfile_tui.in @@ -53,7 +53,7 @@ HTML_FOOTER = @srcdir@/static/footer.html HTML_STYLESHEET = @srcdir@/static/doxygen.css TOC_EXPAND = YES DISABLE_INDEX = NO -GENERATE_TREEVIEW = YES +GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 300 #--------------------------------------------------------------------------- @@ -70,3 +70,4 @@ GENERATE_RTF = NO #External reference options #--------------------------------------------------------------------------- GENERATE_TAGFILE = tui_examples.tag +SEARCHENGINE = YES diff --git a/doc/salome/gui/GEOM/images/edge1.png b/doc/salome/gui/GEOM/images/edge1.png new file mode 100644 index 000000000..03840b25e Binary files /dev/null and b/doc/salome/gui/GEOM/images/edge1.png differ diff --git a/doc/salome/gui/GEOM/images/edge2.png b/doc/salome/gui/GEOM/images/edge2.png new file mode 100644 index 000000000..b17336e06 Binary files /dev/null and b/doc/salome/gui/GEOM/images/edge2.png differ diff --git a/doc/salome/gui/GEOM/images/geomscreen.png b/doc/salome/gui/GEOM/images/geomscreen.png index 58908a742..ebcd56f2e 100755 Binary files a/doc/salome/gui/GEOM/images/geomscreen.png and b/doc/salome/gui/GEOM/images/geomscreen.png differ diff --git a/doc/salome/gui/GEOM/images/get_in_place_lost_part.png b/doc/salome/gui/GEOM/images/get_in_place_lost_part.png new file mode 100644 index 000000000..2abc8432a Binary files /dev/null and b/doc/salome/gui/GEOM/images/get_in_place_lost_part.png differ diff --git a/doc/salome/gui/GEOM/images/limit_tolerance_dlg.png b/doc/salome/gui/GEOM/images/limit_tolerance_dlg.png new file mode 100644 index 000000000..98adfc454 Binary files /dev/null and b/doc/salome/gui/GEOM/images/limit_tolerance_dlg.png differ diff --git a/doc/salome/gui/GEOM/images/mtrans1.png b/doc/salome/gui/GEOM/images/mtrans1.png index 41b44d79b..5abf96abb 100755 Binary files a/doc/salome/gui/GEOM/images/mtrans1.png and b/doc/salome/gui/GEOM/images/mtrans1.png differ diff --git a/doc/salome/gui/GEOM/images/mtrans2.png b/doc/salome/gui/GEOM/images/mtrans2.png index 9c9781b82..ee32abe1e 100755 Binary files a/doc/salome/gui/GEOM/images/mtrans2.png and b/doc/salome/gui/GEOM/images/mtrans2.png differ diff --git a/doc/salome/gui/GEOM/images/neo-mrot1.png b/doc/salome/gui/GEOM/images/neo-mrot1.png index d1e7c78e9..f00e5c0b1 100755 Binary files a/doc/salome/gui/GEOM/images/neo-mrot1.png and b/doc/salome/gui/GEOM/images/neo-mrot1.png differ diff --git a/doc/salome/gui/GEOM/images/neo-mrot2.png b/doc/salome/gui/GEOM/images/neo-mrot2.png index 42ddcee14..fb4a819ac 100755 Binary files a/doc/salome/gui/GEOM/images/neo-mrot2.png and b/doc/salome/gui/GEOM/images/neo-mrot2.png differ diff --git a/doc/salome/gui/GEOM/images/neo-obj2.png b/doc/salome/gui/GEOM/images/neo-obj2.png deleted file mode 100755 index 3ce42b45c..000000000 Binary files a/doc/salome/gui/GEOM/images/neo-obj2.png and /dev/null differ diff --git a/doc/salome/gui/GEOM/images/neo-obj3.png b/doc/salome/gui/GEOM/images/neo-obj3.png index cb9bd40b1..c378521b8 100755 Binary files a/doc/salome/gui/GEOM/images/neo-obj3.png and b/doc/salome/gui/GEOM/images/neo-obj3.png differ diff --git a/doc/salome/gui/GEOM/images/partition1.png b/doc/salome/gui/GEOM/images/partition1.png index cc5b15544..65d318ea3 100755 Binary files a/doc/salome/gui/GEOM/images/partition1.png and b/doc/salome/gui/GEOM/images/partition1.png differ diff --git a/doc/salome/gui/GEOM/images/partition2.png b/doc/salome/gui/GEOM/images/partition2.png index 18f01e212..8125cdbb9 100755 Binary files a/doc/salome/gui/GEOM/images/partition2.png and b/doc/salome/gui/GEOM/images/partition2.png differ diff --git a/doc/salome/gui/GEOM/images/salome-geom-structuralelements.png b/doc/salome/gui/GEOM/images/salome-geom-structuralelements.png new file mode 100644 index 000000000..6ed41b12f Binary files /dev/null and b/doc/salome/gui/GEOM/images/salome-geom-structuralelements.png differ diff --git a/doc/salome/gui/GEOM/images/transformation13.png b/doc/salome/gui/GEOM/images/transformation13.png index c9ffa8325..6436379f4 100644 Binary files a/doc/salome/gui/GEOM/images/transformation13.png and b/doc/salome/gui/GEOM/images/transformation13.png differ diff --git a/doc/salome/gui/GEOM/images/transformation5.png b/doc/salome/gui/GEOM/images/transformation5.png index c9b54e819..e2d877124 100755 Binary files a/doc/salome/gui/GEOM/images/transformation5.png and b/doc/salome/gui/GEOM/images/transformation5.png differ diff --git a/doc/salome/gui/GEOM/images/transformation6.png b/doc/salome/gui/GEOM/images/transformation6.png index 2fa724cf9..a9e4cf286 100755 Binary files a/doc/salome/gui/GEOM/images/transformation6.png and b/doc/salome/gui/GEOM/images/transformation6.png differ diff --git a/doc/salome/gui/GEOM/input/chamfer_operation.doc b/doc/salome/gui/GEOM/input/chamfer_operation.doc index 38fdba843..9e464518d 100644 --- a/doc/salome/gui/GEOM/input/chamfer_operation.doc +++ b/doc/salome/gui/GEOM/input/chamfer_operation.doc @@ -3,7 +3,7 @@ \page chamfer_operation_page Chamfer \n To produce a \b Chamfer in the Main Menu select -Operations - > Transformation - > Chamfer +Operations - > Chamfer \n This operation allows you to make chamfer of the edges of a Shape. \n The \b Result will be a \b GEOM_Object. diff --git a/doc/salome/gui/GEOM/input/creating_edge.doc b/doc/salome/gui/GEOM/input/creating_edge.doc index 6d45a5418..ffbfa69de 100644 --- a/doc/salome/gui/GEOM/input/creating_edge.doc +++ b/doc/salome/gui/GEOM/input/creating_edge.doc @@ -2,25 +2,50 @@ \page create_edge_page Edge -\n To create an \b Edge in the Main Menu select New Entity- > Build - > Edge +To create an \b Edge, in the Main Menu select New Entity > +Build > Edge -\n You can create an \b Edge from two points (\b Point1 and \b Point2), being the first and the last vertices of the edge. +There are two ways to create an edge. In both cases the \b Result +will be a \b GEOM_Object (EDGE). -The \b Result will be a \b GEOM_Object (EDGE). +Firstly, you can create an \b Edge by specifying two points (\b Point1 and +\b Point2), which are the first and the last vertices of the edge. -TUI Command: geompy.MakeEdge(Vertex1, Vertex2), where -Vertex1 and Vertex2 are correspondingly the first and the last vertex -of the edge. +TUI Command: geompy.MakeEdge(Vertex1, Vertex2)
+Arguments: Name + 2 vertices (Vertex1 and Vertex2 are +correspondingly the first and the last vertex of the edge). -Arguments: Name + 2 vertices. +\image html edge1.png "Create edge by two points" -\image html neo-obj2.png +Secondly, you can create an \b Edge by specifying a single wire. -\n Example: +In this mode the following use cases are possible: +- All edges that form the wire lie on the same geometrical curve +(i.e. curve(edge1) == curve(edge2)). +- The edges that form the wire lie on analytical curves of the same +type, for example, segments of line, arcs, etc. In this case, the +algorithm checks geometrical coincidence of these curves using +a certain tolerance. If the curves are coinciding in terms of the given +tolerance, the resulting edge is built as if on a single curve. +- The edges that form the wire have the same tangency in the connection +points. In this case the curves are interpolated by the single +b-spline curve with sufficient precision. The resulting edge will +be built on this curve. + +The case when the edges that form the wire have different tangency in +the connection points (sharp bend) is not processed. + +TUI Command: geompy.MakeEdgeWire(Wire, LinearTolerance, AngularTolerance)
+Arguments: Name + 1 wire + Linear Tolerance + Angular Tolerance +(tolerance values are used to check coincidence of the underlying curves). + +\image html edge2.png "Create edge from wire" + +Example: \image html edgesn.png "Edge" Our TUI Scripts provide you with useful examples of creation of \ref tui_creation_edge "Advanced Geometric Objects". -*/ \ No newline at end of file +*/ diff --git a/doc/salome/gui/GEOM/input/creating_extrusion.doc b/doc/salome/gui/GEOM/input/creating_extrusion.doc index c86ed5ac5..afd78e1f6 100644 --- a/doc/salome/gui/GEOM/input/creating_extrusion.doc +++ b/doc/salome/gui/GEOM/input/creating_extrusion.doc @@ -18,8 +18,8 @@ shell, solid or compsolid). \n Both Directions checkbox allows extruiding the source object both forward and backward. \n TUI Command: geompy.MakePrismVecH(Base, Vector, Height) -\n Arguments: Name + 1 shape (vertex, edge, planar wire, face or -shell) serving as base object + 1 vector (for direction of the +\n Arguments: Name + one or several shapes (vertex, edge, planar wire, face or +shell) serving as base objects + 1 vector (for direction of the extrusion) + 1 value (dimension). \image html extrusion1.png @@ -30,8 +30,8 @@ you don't need to create it in advance). \n Both Directions checkbox allows extruiding the source object both forward and backward. \n TUI Command: geompy.MakePrism(Base, Point1, Point2) -\n Arguments: Name + 1 shape (vertex, edge, planar wire, face or -shell) serving as base object + 2 vertices. +\n Arguments: Name + one or several shapes (vertex, edge, planar wire, face or +shell) serving as base objects + 2 vertices. \image html extrusion2.png @@ -40,8 +40,8 @@ and the DX, DY, DZ Vector\n Both Directions checkbox allows extruding the source objects both forward and backward. \n TUI Command: geompy.MakePrismDXDYDZ(Base, dx, dy, dz) -\n Arguments: Name + 1 shape (vertex, edge, planar wire, face or -shell) serving as base object + 3 axis directions. +\n Arguments: Name + one or several shapes (vertex, edge, planar wire, face or +shell) serving as base objects + 3 axis directions. \image html extrusion3.png diff --git a/doc/salome/gui/GEOM/input/creating_filling.doc b/doc/salome/gui/GEOM/input/creating_filling.doc index a66bb45f0..5074f4eed 100644 --- a/doc/salome/gui/GEOM/input/creating_filling.doc +++ b/doc/salome/gui/GEOM/input/creating_filling.doc @@ -4,39 +4,38 @@ To generate a \b Filling in the Main Menu select New Entity - > Generation - > Filling -To create a curving face using several edges you need to define the +To create a curvilinear face from several edges you need to define the following parameters: \n Input Compound - the list of edges/wires used for creation -of the surface. Before perform filling algorithm each wire from -compound is converted to one edge created on BSpline curve built using -curves from all edges from wire. +of the surface. To prepare for the filling each wire of the compound +is converted to an edge created on a BSpline curve built using curves +from all edges of the wire. \n \b Minimum and Maximum Degree of equation of the resulting BSpline or Besier curves describing the surface; \n \b Tolerance for \b 2D and for \b 3D - minimum distance between the created surface and the reference edge; -\n Number of -Iterations - defines the maximum number of iterations. The +\n Number of Iterations - defines the maximum number of iterations. The iterations are repeated until the required tolerance is reached. So, a greater number of iterations allows producing a better surface. \n Method - Kind of method to perform filling operation -1. Default - standard behaviour -2. Use edges orientation - orientation of edges are used: if edge is -reversed curve from this edge is reversed before using in filling +1. Default - the standard behaviour. +2. Use edges orientation - the edges orientation is used: if an edge is +reversed, the curve from this edge is reversed before being used by the filling algorithm. -3. Auto-correct edges orientation - change orientation of curves using -minimization of sum of distances between ends points of edges. +3. Auto-correct edges orientation - curves orientation is changed to +minimize the sum of distances between ends points of edges. \n Approximation - if checked, BSpline curves are generated in the process of surface construction (using GeomAPI_PointsToBSplineSurface functionality). By default the surface is created using Besier curves. The usage of Approximation -makes the algorithm work slower, but allows building the surface for -rather complex cases. +slows the algorithm, but allows building the surface for complex cases. \n The \b Result of the operation will be a GEOM_Object (face). \n TUI Command: geompy.MakeFilling(Edges, MinDegree, MaxDegree, Tol2D, Tol3D, NbIter) \n Arguments: Name + 1 List of edges + 7 Parameters -(Min. degree, Max. degree, 2D tolerance, 3D tolerance, Number of iterations, Method, Approximation). +(Min. degree, Max. degree, Number of iterations, 2D tolerance, 3D +tolerance, Number of iterations, Method, Approximation). \image html filling.png diff --git a/doc/salome/gui/GEOM/input/creating_wire.doc b/doc/salome/gui/GEOM/input/creating_wire.doc index 52357774e..3dd6e3992 100644 --- a/doc/salome/gui/GEOM/input/creating_wire.doc +++ b/doc/salome/gui/GEOM/input/creating_wire.doc @@ -4,10 +4,14 @@ \n To create a \b Wire in the Main Menu select New Entity - > Build - > Wire -\n You can create a \b Wire from several connected edges and wires by +\n You can create a \b Wire from several connected edges or wires by selecting them in the object browser or in the viewer holding Shift -button. -\n Select \b Tolerance which will be used to check the +button. + +It is possible to select wires or edges from objects. To specify subshape type, use +the Object Type radio buttons. + +Select \b Tolerance which will be used to check the connections. If the \b Tolerance value is more than 1e-07, and a gap within this tolerance is detected, the corresponding edges will be modified to connect in the middle of the gap. diff --git a/doc/salome/gui/GEOM/input/fillet1d_operation.doc b/doc/salome/gui/GEOM/input/fillet1d_operation.doc index 46d291b48..7e1174bd5 100644 --- a/doc/salome/gui/GEOM/input/fillet1d_operation.doc +++ b/doc/salome/gui/GEOM/input/fillet1d_operation.doc @@ -10,7 +10,7 @@ constructed, have to lie in the same plane. \image html fillet1d_2.png To produce a \b Fillet 1D in the Main Menu select -Operations - > Transformation - > Fillet 1D +Operations - > Fillet 1D Define the Wire with planar Edges to create a fillet on, select the necessary vertexes on this wire in the OCC Viewer and define the \b Radius of the Fillet. diff --git a/doc/salome/gui/GEOM/input/fillet2d_operation.doc b/doc/salome/gui/GEOM/input/fillet2d_operation.doc index 74b044b05..a4c06f5e0 100755 --- a/doc/salome/gui/GEOM/input/fillet2d_operation.doc +++ b/doc/salome/gui/GEOM/input/fillet2d_operation.doc @@ -7,7 +7,7 @@ This operation creates fillets on the corners of a 2D Planar Face. \image html fillet2d_2.png To produce a \b Fillet 2D in the Main Menu select -Operations - > Transformation - > Fillet 2D +Operations - > Fillet 2D Define the Planar Face to create a fillet on, select the necessary vertexes on this face in the OCC Viewer and define the \b Radius of the Fillet. diff --git a/doc/salome/gui/GEOM/input/fillet_operation.doc b/doc/salome/gui/GEOM/input/fillet_operation.doc index 8bf2ee1f6..e913892e2 100644 --- a/doc/salome/gui/GEOM/input/fillet_operation.doc +++ b/doc/salome/gui/GEOM/input/fillet_operation.doc @@ -3,7 +3,7 @@ \page fillet_operation_page Fillet \n To produce a \b Fillet in the Main Menu select -Operations - > Transformation - > Fillet +Operations - > Fillet \n This operation creates fillets on the edges of a shape. \n The \b Result will be a \b GEOM_Object. diff --git a/doc/salome/gui/GEOM/input/geompypkg.doc b/doc/salome/gui/GEOM/input/geompypkg.doc new file mode 100644 index 000000000..bd507959a --- /dev/null +++ b/doc/salome/gui/GEOM/input/geompypkg.doc @@ -0,0 +1,44 @@ +/*! + +\page geompypkg_page Programming Interface of GEOM python package + +Sorry, but the documentation is not available yet in doxygen format. + +Fortunately, a documentation exists in restructured format and then +can be generated here using sphinx, in the expectative of the doxygen +version. This documentation is available +here. + +Here is a sample generated from the doxygen format: + +The GEOM python package essentially contains: + +
    +
  • The visualization of structural elements: a function to create + geometrical 3D representations of mechanical models called + "structural elements". +
+ +For details, you should refer to the complete + documentation of the GEOM +python packages generated with sphinx from rst text files. + +Note that these functions either encapsulate the python programming +interface of GEOM core (the CORBA or SWIG interfaces for example) or +extend existing utilities as the ``geompy.py`` module. + +The functions are distributed in the python package +``salome.geom``. For example, the usage of the visualization of +structural elements can be appreciated with this set of instructions: + +\code + + from salome.geom.structelem import TEST_StructuralElement + TEST_StructuralElement() +\endcode + +This creates the geometrical objects displayed in the study below: + +\image html salome-geom-structuralelements.png "Example of Geometry created from structural elements" + +*/ diff --git a/doc/salome/gui/GEOM/input/index.doc b/doc/salome/gui/GEOM/input/index.doc index d28e8c343..856e03a54 100644 --- a/doc/salome/gui/GEOM/input/index.doc +++ b/doc/salome/gui/GEOM/input/index.doc @@ -23,6 +23,8 @@ various algorithms; Almost all geometry module functionalities are accessible via \subpage geompy_page "Geometry module Python Interface" +Also it can be useful to have a look at the \subpage geompypkg_page "documentation on GEOM python packages". + \image html image3.png "Example of Geometry module usage for engineering tasks" diff --git a/doc/salome/gui/GEOM/input/limit_tolerance_operation.doc b/doc/salome/gui/GEOM/input/limit_tolerance_operation.doc new file mode 100644 index 000000000..f7c0b2e84 --- /dev/null +++ b/doc/salome/gui/GEOM/input/limit_tolerance_operation.doc @@ -0,0 +1,37 @@ +/*! + +\page limit_tolerance_operation_page Limit Tolerance + +\n To produce a Limit Tolerance operation in the Main + Menu select Repair - > Limit Tolerance. + +\image html limit_tolerance_dlg.png + +\n Arguments: Name + 1 shape + 1 value (new tolerance). + +\n It is possible on all kind of shapes. + +\n The \b Result will be a \b GEOM_Object. + +\n This functionality tries to set a new value of tolerance for the + given shape. However, the final tolerance value also depends on the + initial shape topology (takes into consideration the existing gaps) to obtain + a valid resulting shape. + +\n Example of usage: +
    +
  1. Partition objects obj1 and obj2.
  2. +
  3. Partition fails.
  4. +
  5. Perform Limit Tolerance on objects obj1 and obj2.
  6. +
  7. Try to partition them again.
  8. +
+See also \ref tui_limit_tolerance "TUI example". + +\n TUI Command: geompy.LimitTolerance(Shape, Tolerance), + where \em Shape is a shape with presumably incorrect tolerance, \em + Tolerance is the required tolerance value. + +Our TUI Scripts provide you with useful examples of +\ref tui_limit_tolerance "Repairing Operations". + +*/ diff --git a/doc/salome/gui/GEOM/input/multi_translation_operation.doc b/doc/salome/gui/GEOM/input/multi_translation_operation.doc index 2bd2ef3fc..7e6d64f46 100644 --- a/doc/salome/gui/GEOM/input/multi_translation_operation.doc +++ b/doc/salome/gui/GEOM/input/multi_translation_operation.doc @@ -12,7 +12,9 @@ two directions. \n To produce a Simple Multi Translation (in one direction) you need to indicate an \b Object to be translated, a \b Vector of translation, a \b Step of translation and a Number of Times the -Object should be duplicated. +Object should be duplicated. If a curve has been selected instead of +the Vector, only its first and last vertices will be used to get the vector direction +and the dialog preview will display the vector along which the object will be translated. \n TUI Command: geompy.MakeMultiTranslation1D(Shape, Dir, Step, NbTimes) \n Arguments: Name + 1 shape + 1 vector (for direction) + 1 @@ -27,6 +29,8 @@ step value + 1 value (repetition). \n To produce a Double Multi Translation (in two directions) you need to indicate an \b Object to be translated, and, for both axes, a \b Vector of translation, a \b Step of translation and a Number of Times the shape must be duplicated. +If a curve has been selected instead of the Vector, only its first and last vertices will be used to get the vector direction +and the dialog preview will display the vector along which the object will be translated. \n TUI Command: geompy.MakeMultiTranslation2D(Shape, Dir1, Step1, NbTimes1, Dir2, Step2, NbTimes2), where \em Shape is a shape diff --git a/doc/salome/gui/GEOM/input/partition.doc b/doc/salome/gui/GEOM/input/partition.doc index 6661d12f2..c802d7611 100644 --- a/doc/salome/gui/GEOM/input/partition.doc +++ b/doc/salome/gui/GEOM/input/partition.doc @@ -2,79 +2,103 @@ \page partition_page Partition -\n To produce a \b Partition in the Main Menu select Operations - > Partition +To produce a \b Partition in the Main Menu select Operations - > Partition -\n This operation builds a compound by intersection of several shapes +This operation builds a compound by intersection of several shapes with a set of tool objects or with a plane. -\n The \b Result will be any \b GEOM_Object. +The \b Result will be a \b GEOM_Object.

Intersection of two shapes.

\image html partition1.png -\n Arguments: Name + 2 lists of shapes (the shapes from the +Arguments: Name + 2 lists of shapes (the shapes from the first list will be intersected with the shapes from the second list) + Resulting Type of shape. -\n As far as the intersection of two objects can produce any type of +As far as the intersection of two objects can produce any type of geometrical objects, Resulting type box allows choosing the preferrable result, i.e. a solid, a shell, a list of faces, etc. -\nResulting type has to be equal or lower than the type of the + +The Resulting type has to be equal or lower than the type of the \em Objects. In other words, if the \em Objects don't contain any shape of this type, Partition fails. Keep shapes of lower type checkbox manages standalone shapes of type other than the \em Limit. If it is checked, lower dimension objects will be preserved, else they will be lost. -\n For example, you do a partition of a box (Solid) and a face (Face) -without any tool. If you choose Resulting Type "Solid", you will -obtain a compound of two solids (let's the box will be splitted by the -face on two parts), but if you will also check Keep shapes of lower -type checkbox, you will obtain a compound of two solids and one -face (the face will have a hole where the original face lays inside -the box, see corresponding \ref partition_picture_3 "picture" below). -\n Advanced option: +For example, you partition a box (Solid) and a face (Face) +without any tool (the box is split in two parts by the shape). If you +choose the Resulting Type "Solid", you will +obtain a compound of two solids, but if you also check Keep shapes of lower +type checkbox, you will obtain a compound of two solids and one +face (there will be a hole in the resulting face, where the original +face intersects with the box, see the corresponding \ref partition_picture_3 "picture" below). + +No sub-shapes intersection (Compounds only) check box affects +only input shapes of the Compound type. If this option is switched off (default +behavior) each input compound will be automatically exploded into +sub-shapes and the intersection between these shapes will be also +computed. If this option is switched on, the intersection between +sub-shapes will not be performed. In this case the Partition algorithm +will work faster, but the result might differ from the default behavior. + + Advanced option: \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". -\n TUI Command: geompy.MakePartition(ListOfShapes, +\note Partition is a complex operation, so its result of it depends + on the quality of the initial shapes. Sometimes, if partition fails, + such healing operations as Shape Processing + and Limit Tolerance can help to attune source shapes to obtain correct result of the Partition. + See also \ref tui_limit_tolerance "TUI example" of shape healing. + +TUI Command (with sub-shapes intersection): + +geompy.MakePartition(ListOfShapes, ListOfTools, ListOfKeepInside, +ListOfRemoveInside, Limit, RemoveWebs, ListOfMaterials, +KeepNonlimitShapes) + +TUI Command (without sub-shapes intersection): + +geompy.MakePartitionNonSelfIntersectedShape(ListOfShapes, ListOfTools, ListOfKeepInside, ListOfRemoveInside, Limit, RemoveWebs, -ListOfMaterials, KeepNonlimitShapes), where where \em -ListOfShapes is a list of shapes to be intersected, \em ListOfTools is -a list of shapes to intersect the shapes from ListOfShapes, \em Limit -is a Type of resulting shapes and \em KeepNonlimitShapes is a flag -that allows to preserve standalone shapes of low dimension (than -Limit) in the result. - -\n Since the implementation of a new version of PartitionAlgo other -parameters are ignored by the current functionality and remain there -only to support the old scripts. +ListOfMaterials, KeepNonlimitShapes) +Here, +- \em ListOfShapes is a list of shapes to be intersected +- \em ListOfTools is a list of shapes to intersect the shapes from +\em ListOfShapes +- \em Limit is a Type of resulting shapes +- \em KeepNonlimitShapes is a flag that allows to preserve standalone +shapes of low dimension (than \em Limit) in the result. +- Other parameters are obsolete and kept only for compatibility with +previous versions of SALOME.

Intersection of a Shape and a Plane.

\image html partition2.png -\n Arguments: Name + a list of shapes which will be intersected -+ 1 cutting plane. +Arguments: Name + 1 shape to be intersected + 1 cutting plane. -\n Advanced option: - \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". +Advanced option: +\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments". -\n TUI Command: geompy.MakeHalfPartition(Shapes, -Plane), where \em Shapes are a list of Shapes to be intersected -and \em Plane is a Tool shape, to intersect the \em Shapes. +TUI Command: -\n Example: +geompy.MakeHalfPartition(Shape, Plane), where: +- \em Shape is a source shape to be intersected by the \em Plane +- \em Plane is a tool shape, to intersect the \em Shape. + +Examples: \image html partitionsn1.png "Box intersected by a plane" \image html partitionsn2.png "Result of intersection" \anchor partition_picture_3 -\image html partitionsn3.png "Result of intersection of a box and a plane (both as \em Objects, no tools) with Resulting type \em Solid and checked \em Keep \em shapes \em of \em lower \em type" +\image html partitionsn3.png "Result of intersection of a box and a plane (both as \em Objects, no tools) with the Resulting type \em Solid and checked 'Keep shapes of lower type'" -Our TUI Scripts provide you with useful examples of the use of -\ref tui_partition "Basic Operations". +Our TUI Scripts provide you with useful examples of \ref tui_partition "Basic Operations". */ diff --git a/doc/salome/gui/GEOM/input/repairing_operations.doc b/doc/salome/gui/GEOM/input/repairing_operations.doc index 542f5c25e..592c1b653 100644 --- a/doc/salome/gui/GEOM/input/repairing_operations.doc +++ b/doc/salome/gui/GEOM/input/repairing_operations.doc @@ -17,6 +17,8 @@ holes with free boundaries on a selected face.
  • \subpage sewing_operation_page "Sewing" - sews faces or shells.
  • \subpage glue_faces_operation_page "Glue faces" - unites coincident faces within the given tolerance.
  • +
  • \subpage limit_tolerance_operation_page "Limit Tolerance" - tries +to set new tolerance value for the given shape.
  • \subpage add_point_on_edge_operation_page "Add point on edge" - splits an edge in two.
  • \subpage change_orientation_operation_page "Change orientation" - diff --git a/doc/salome/gui/GEOM/input/shape_processing_operation.doc b/doc/salome/gui/GEOM/input/shape_processing_operation.doc index b10f35c6e..5aac5fd14 100644 --- a/doc/salome/gui/GEOM/input/shape_processing_operation.doc +++ b/doc/salome/gui/GEOM/input/shape_processing_operation.doc @@ -3,7 +3,7 @@ \page shape_processing_operation_page Shape Processing \n To produce a Shape Processing operation in the Main Menu -select Repair - > Shape Processing. + select Repair - > Shape Processing. \n This operation processes one or more shapes using various operators. \n The \b Result will be a \b GEOM_Object. @@ -15,6 +15,19 @@ is a list of operators ("FixShape", "SplitClosedFaces", etc.), etc), \em Values is a list of values of parameters placed in the same order as in the list of Parameters. +\note Shape Processing is useful not only on invalid shapes, + but also on the shapes, that are classified as valid by + the Check functionality. Use it, if an operation (for + example, Partition) fails. + Example of usage: +
      +
    1. Try to partition objects obj1 and obj2.
    2. +
    3. Partition fails.
    4. +
    5. Perform Shape Processing on objects obj1 and obj2.
    6. +
    7. Try to partition them again.
    8. +
    + See also \ref tui_limit_tolerance "TUI example". + \n In this dialog box you can select the object that you need to process, define its name and operators applied to it during processing. diff --git a/doc/salome/gui/GEOM/input/translation_operation.doc b/doc/salome/gui/GEOM/input/translation_operation.doc index 32958367d..98fe6808a 100644 --- a/doc/salome/gui/GEOM/input/translation_operation.doc +++ b/doc/salome/gui/GEOM/input/translation_operation.doc @@ -31,7 +31,9 @@ of the vector. \image html transformation2.png -\n Finally you can define an \b Object and the vector. The object will be translated by the length of the vector. +\n Finally you can define an \b Object and a vector. The object will be translated by the length of the vector. +If a curve has been selected instead of the vector, only its first and last vertices will be used to get the vector direction +and the dialog preview will display the vector along which the object will be translated. \n TUI Command: geompy.MakeTranslationVector(Object, Vector) \n Activate Distance checkbox and Distance field allow defining the custom distance of translation. \n TUI Command for translation by vector and custom distance: geompy.MakeTranslationVectorDistance(Object, Vector, Distance) diff --git a/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc b/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc index 1a76d9be8..0e8861511 100644 --- a/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc +++ b/doc/salome/gui/GEOM/input/tui_advanced_geom_objs.doc @@ -10,6 +10,10 @@ import geompy import salome gg = salome.ImportComponentGUI("GEOM") +# +# create edge by two points +# + # create vertices p0 = geompy.MakeVertex(0. , 0. , 0. ) pxyz = geompy.MakeVertex(100., 100., 100.) @@ -18,10 +22,30 @@ pxyz = geompy.MakeVertex(100., 100., 100.) edge = geompy.MakeEdge(p0, pxyz) # add object in the study -id_edge = geompy.addToStudy(edge,"Edge") +id_edge = geompy.addToStudy(edge,"Edge_1") # display an edge gg.createAndDisplayGO(id_edge) + +# +# create edge from wire +# + +# create a circle +c = geompy.MakeCircle(None, None, 100) + +# create a wire +w = geompy.MakeWire([c], 1e-07) + +# create an edge from wire +edge = geompy.MakeEdgeWire(w) + +# add object in the study +id_edge = geompy.addToStudy(edge,"Edge_2") + +# display an edge +gg.createAndDisplayGO(id_edge) + \endcode \anchor tui_creation_wire diff --git a/doc/salome/gui/GEOM/input/tui_repairing_operations.doc b/doc/salome/gui/GEOM/input/tui_repairing_operations.doc index d55300562..237440c2f 100644 --- a/doc/salome/gui/GEOM/input/tui_repairing_operations.doc +++ b/doc/salome/gui/GEOM/input/tui_repairing_operations.doc @@ -289,6 +289,43 @@ gg.createAndDisplayGO(id_glue) gg.setDisplayMode(id_glue,1) \endcode +\anchor tui_limit_tolerance +

    Limit Tolerance

    + +\code +import geompy +gg = salome.ImportComponentGUI("GEOM") + +# import initial topology +shape1 = geompy.ImportBREP("my_shape_1.brep") +shape2 = geompy.ImportBREP("my_shape_2.brep") + +geompy.addToStudy(shape1, "Shape 1") +geompy.addToStudy(shape2, "Shape 2") + +# perform partition +try: + part = geompy.MakePartition([shape1, shape2]) +except: + # limit tolerance + tolerance = 1e-07 + shape1_lt = geompy.LimitTolerance(shape1, tolerance) + shape2_lt = geompy.LimitTolerance(shape2, tolerance) + + # process shape + good_shape1 = geompy.ProcessShape(shape1_lt, ["FixShape"], ["FixShape.Tolerance3d"], ["1e-7"]) + good_shape2 = geompy.ProcessShape(shape2_lt, ["FixShape"], ["FixShape.Tolerance3d"], ["1e-7"]) + + geompy.addToStudy(good_shape1, "Shape 1 corrected") + geompy.addToStudy(good_shape2, "Shape 2 corrected") + + # perform partition on corrected shapes + part = geompy.MakePartition([good_shape1, good_shape2]) + pass + +geompy.addToStudy(part, "Partition") +\endcode + \anchor tui_add_point_on_edge

    Add Point on Edge

    diff --git a/doc/salome/gui/GEOM/input/tui_test_others.doc b/doc/salome/gui/GEOM/input/tui_test_others.doc index 84779c467..7560a76de 100644 --- a/doc/salome/gui/GEOM/input/tui_test_others.doc +++ b/doc/salome/gui/GEOM/input/tui_test_others.doc @@ -99,12 +99,21 @@ \anchor swig_GetPoint \until blocksComp (-50, -50, -50) +\anchor swig_GetVertexNearPoint +\until near (40, 40, 40) + +\anchor swig_GetEdge +\until by two points + \anchor swig_GetEdgeNearPoint \until edge near point \anchor swig_GetBlockByParts \until "b0 image" +\anchor swig_GetShapesNearPoint +\until "faces near point" + \anchor swig_GetShapesOnPlane \until Face on Plane diff --git a/doc/salome/tui/doxyfile.in b/doc/salome/tui/doxyfile.in index ab6723a31..4772dc4a0 100755 --- a/doc/salome/tui/doxyfile.in +++ b/doc/salome/tui/doxyfile.in @@ -264,4 +264,4 @@ DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- -SEARCHENGINE = YES +SEARCHENGINE = NO diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 304b16a86..179ecf35a 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -19,10 +19,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File : GEOM_Gen.idl // Author : Sergey RUIN -// + #ifndef __GEOM_GEN__ #define __GEOM_GEN__ @@ -45,13 +44,13 @@ module GEOM * Marker type */ enum marker_type { MT_NONE, MT_POINT, MT_PLUS, MT_STAR, MT_O, MT_X, MT_O_POINT, MT_O_PLUS, - MT_O_STAR, MT_O_X, MT_BALL, MT_RING1, MT_RING2, MT_RING3, MT_USER }; + MT_O_STAR, MT_O_X, MT_BALL, MT_RING1, MT_RING2, MT_RING3, MT_USER }; /*! * Marker size */ enum marker_size { MS_NONE, MS_10, MS_15, MS_20, MS_25, MS_30, MS_35, - MS_40, MS_45, MS_50, MS_55, MS_60, MS_65, MS_70 }; + MS_40, MS_45, MS_50, MS_55, MS_60, MS_65, MS_70 }; /*! * State of shape relatively geometrical surface like plane, sphere or cylinder. @@ -167,6 +166,24 @@ module GEOM */ shape_type GetShapeType(); + /*! + * Get the topology type of the object value. + * In contrast to the shape type, this function returns type of the most + * top-level sub-shape of the COMPOUND or COMPSOLID, if there is only one + * sub-shape there. + * \sa GetShapeType() + */ + shape_type GetTopologyType(); + + /*! + * Get a minimal type of the top-level shapes contained in the object. + * This function is useful for the compounds only; for simple shapes it + * exactly the same value as GetShapeType(). + * Note, that compounds are procesed recursively. + * \sa GetShapeType(), GetTopologyType() + */ + shape_type GetMinShapeType(); + /*! * Set name of the object. * \param theName is a name which will be associated with this object. @@ -376,7 +393,7 @@ module GEOM * \return New GEOM_Object, containing the created point. */ GEOM_Object MakePointWithReference (in GEOM_Object theReference, - in double theX, in double theY, in double theZ); + in double theX, in double theY, in double theZ); /*! * Create a point, corresponding to the given parameter on the given curve. @@ -385,7 +402,7 @@ module GEOM * \return New GEOM_Object, containing the created point. */ GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve, - in double theParameter); + in double theParameter); /*! * Create a point on the given curve, projecting given point @@ -409,8 +426,8 @@ module GEOM * \return New GEOM_Object, containing the created point. */ GEOM_Object MakePointOnSurface (in GEOM_Object theRefSurf, - in double theUParameter, - in double theVParameter); + in double theUParameter, + in double theVParameter); /*! * Create a point on the given surface, projecting given point @@ -432,7 +449,7 @@ module GEOM * \return New GEOM_Object, containing the created point. */ GEOM_Object MakePointOnLinesIntersection (in GEOM_Object theRefLine1, - in GEOM_Object theRefLine2); + in GEOM_Object theRefLine2); /*! * Create a vector, corresponding to tangent to the given parameter on the given curve. @@ -443,7 +460,7 @@ module GEOM * \return New GEOM_Object, containing the created point. */ GEOM_Object MakeTangentOnCurve (in GEOM_Object theRefCurve, - in double theParameter); + in double theParameter); /*! * Create a vector with the given components. @@ -453,8 +470,8 @@ module GEOM * \return New GEOM_Object, containing the created vector. */ GEOM_Object MakeVectorDXDYDZ (in double theDX, - in double theDY, - in double theDZ); + in double theDY, + in double theDZ); /*! * Create a vector between two points. @@ -498,9 +515,9 @@ module GEOM * \return New GEOM_Object, containing the created plane. */ GEOM_Object MakePlaneThreePnt (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3, - in double theTrimSize); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3, + in double theTrimSize); /*! * Create a plane, passing through the given point @@ -511,8 +528,8 @@ module GEOM * \return New GEOM_Object, containing the created plane. */ GEOM_Object MakePlanePntVec (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theTrimSize); + in GEOM_Object theVec, + in double theTrimSize); /*! * Create a plane, similar to the existing one, but with another size of representing face. @@ -521,7 +538,7 @@ module GEOM * \return New GEOM_Object, containing the created plane. */ GEOM_Object MakePlaneFace (in GEOM_Object theFace, - in double theTrimSize); + in double theTrimSize); /*! * Create a plane, by two vectors. @@ -531,8 +548,8 @@ module GEOM * \return New GEOM_Object, containing the created plane. */ GEOM_Object MakePlane2Vec (in GEOM_Object theVec1, - in GEOM_Object theVec2, - in double theTrimSize); + in GEOM_Object theVec2, + in double theTrimSize); /*! * Create a plane, defined by local coordinate system. @@ -542,8 +559,8 @@ module GEOM * \return New GEOM_Object, containing the created plane. */ GEOM_Object MakePlaneLCS (in GEOM_Object theLCS, - in double theTrimSize, - in double theOrientation); + in double theTrimSize, + in double theOrientation); /*! * Create a local coordinate system. @@ -553,8 +570,8 @@ module GEOM * \return New GEOM_Object, containing the created coordinate system. */ GEOM_Object MakeMarker (in double theOX , in double theOY , in double theOZ, - in double theXDX, in double theXDY, in double theXDZ, - in double theYDX, in double theYDY, in double theYDZ); + in double theXDX, in double theXDY, in double theXDZ, + in double theYDX, in double theYDY, in double theYDZ); /*! * Create a local coordinate system from shape. @@ -562,7 +579,7 @@ module GEOM * \return New GEOM_Object, containing the created coordinate system. */ GEOM_Object MakeMarkerFromShape (in GEOM_Object theShape); - + /*! * Create a local coordinate system from point and two vectors (DX, DY). * \param theOrigin Point of coordinate system origin. @@ -571,7 +588,7 @@ module GEOM * \return New GEOM_Object, containing the created coordinate system. */ GEOM_Object MakeMarkerPntTwoVec (in GEOM_Object theOrigin, in GEOM_Object theXVec, in GEOM_Object theYVec); - + /*! * Create a tangent plane to specified face in the point with specified parameters. * Values of parameters should be between 0. and 1.0 @@ -582,9 +599,9 @@ module GEOM * \return New GEOM_Object, containing the face built on tangent plane. */ GEOM_Object MakeTangentPlaneOnFace(in GEOM_Object theFace, - in double theParameterU, - in double theParameterV, - in double theTrimSize); + in double theParameterU, + in double theParameterV, + in double theTrimSize); }; interface GEOM_ITransformOperations : GEOM_IOperations @@ -597,8 +614,8 @@ module GEOM * \return theObject. */ GEOM_Object TranslateTwoPoints (in GEOM_Object theObject, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /*! * Translate the given object along the vector, specified @@ -609,7 +626,7 @@ module GEOM * \return New GEOM_Object, containing the translated object. */ GEOM_Object TranslateTwoPointsCopy (in GEOM_Object theObject, - in GEOM_Object thePoint1, + in GEOM_Object thePoint1, in GEOM_Object thePoint2); /*! @@ -619,7 +636,7 @@ module GEOM * \return theObject. */ GEOM_Object TranslateDXDYDZ (in GEOM_Object theObject, - in double theDX, in double theDY, in double theDZ); + in double theDX, in double theDY, in double theDZ); /*! * Translate the given object along the vector, specified @@ -629,7 +646,7 @@ module GEOM * \return New GEOM_Object, containing the translated object. */ GEOM_Object TranslateDXDYDZCopy (in GEOM_Object theObject, - in double theDX, in double theDY, in double theDZ); + in double theDX, in double theDY, in double theDZ); /*! @@ -639,7 +656,7 @@ module GEOM * \return theObject. */ GEOM_Object TranslateVector (in GEOM_Object theObject, - in GEOM_Object theVector); + in GEOM_Object theVector); /*! * Translate the given object along the given vector, @@ -649,7 +666,7 @@ module GEOM * \return New GEOM_Object, containing the translated object. */ GEOM_Object TranslateVectorCopy (in GEOM_Object theObject, - in GEOM_Object theVector); + in GEOM_Object theVector); /*! * Translate the given object along the given vector on given distance, @@ -661,9 +678,9 @@ module GEOM * \return New GEOM_Object, containing the translated object. */ GEOM_Object TranslateVectorDistance (in GEOM_Object theObject, - in GEOM_Object theVector, - in double theDistance, - in boolean theCopy); + in GEOM_Object theVector, + in double theDistance, + in boolean theCopy); /*! * Translate the given object along the given vector a given number times @@ -675,9 +692,9 @@ module GEOM * the shapes, obtained after each translation. */ GEOM_Object MultiTranslate1D (in GEOM_Object theObject, - in GEOM_Object theVector, - in double theStep, - in long theNbTimes); + in GEOM_Object theVector, + in double theStep, + in long theNbTimes); /*! * Conseqently apply two specified translations to theObject specified number of times. @@ -692,12 +709,12 @@ module GEOM * the shapes, obtained after each translation. */ GEOM_Object MultiTranslate2D (in GEOM_Object theObject, - in GEOM_Object theVector1, - in double theStep1, - in long theNbTimes1, - in GEOM_Object theVector2, - in double theStep2, - in long theNbTimes2); + in GEOM_Object theVector1, + in double theStep1, + in long theNbTimes1, + in GEOM_Object theVector2, + in double theStep2, + in long theNbTimes2); /*! * Rotate given object around vector perpendicular to plane containing three points. @@ -708,9 +725,9 @@ module GEOM * \return theObject. */ GEOM_Object RotateThreePoints (in GEOM_Object theObject, - in GEOM_Object theCentPoint, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object theCentPoint, + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /*! @@ -723,9 +740,9 @@ module GEOM * \return New GEOM_Object, containing the rotated object. */ GEOM_Object RotateThreePointsCopy (in GEOM_Object theObject, - in GEOM_Object theCentPoint, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object theCentPoint, + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /*! * Rotate the given object around the given axis on the given angle. @@ -735,8 +752,8 @@ module GEOM * \return theObject. */ GEOM_Object Rotate (in GEOM_Object theObject, - in GEOM_Object theAxis, - in double theAngle); + in GEOM_Object theAxis, + in double theAngle); /*! @@ -748,8 +765,8 @@ module GEOM * \return New GEOM_Object, containing the rotated object. */ GEOM_Object RotateCopy (in GEOM_Object theObject, - in GEOM_Object theAxis, - in double theAngle); + in GEOM_Object theAxis, + in double theAngle); /*! @@ -762,8 +779,8 @@ module GEOM * shapes, obtained after each rotation. */ GEOM_Object MultiRotate1D (in GEOM_Object theObject, - in GEOM_Object theAxis, - in long theNbTimes); + in GEOM_Object theAxis, + in long theNbTimes); /*! * Rotate the given object around the @@ -781,11 +798,11 @@ module GEOM * shapes, obtained after each transformation. */ GEOM_Object MultiRotate2D (in GEOM_Object theObject, - in GEOM_Object theAxis, - in double theAngle, - in long theNbTimes1, - in double theStep, - in long theNbTimes2); + in GEOM_Object theAxis, + in double theAngle, + in long theNbTimes1, + in double theStep, + in long theNbTimes2); /*! * Replace the given object by an object, @@ -862,7 +879,7 @@ module GEOM * \return theObject. */ GEOM_Object ScaleShape (in GEOM_Object theObject, in GEOM_Object thePoint, - in double theFactor); + in double theFactor); /*! * Scale the given object by the factor, creating its copy before the scaling. @@ -872,7 +889,7 @@ module GEOM * \return New GEOM_Object, containing the scaled shape. */ GEOM_Object ScaleShapeCopy (in GEOM_Object theObject, in GEOM_Object thePoint, - in double theFactor); + in double theFactor); /*! * Scale the given object by different factors along coordinate axes. @@ -913,8 +930,8 @@ module GEOM * \return theObject. */ GEOM_Object PositionShape (in GEOM_Object theObject, - in GEOM_Object theStartLCS, - in GEOM_Object theEndLCS); + in GEOM_Object theStartLCS, + in GEOM_Object theEndLCS); /*! * Modify the Location of the given object by LCS, @@ -929,24 +946,24 @@ module GEOM * \return New GEOM_Object, containing the displaced shape. */ GEOM_Object PositionShapeCopy (in GEOM_Object theObject, - in GEOM_Object theStartLCS, - in GEOM_Object theEndLCS); + in GEOM_Object theStartLCS, + in GEOM_Object theEndLCS); /*! * Modify the Location of the given object by Path, * \param theObject The object to be displaced. * \param thePath Wire or Edge along that the object will be translated. - * \param theDistance progress of Path (0 = actual location, 1 = end of path location). - * \param theCopy is a true or false parameter. true is to create a copy, false to move the object. - * \param theCopy is a true or false parameter. true is to reverse direction, false is to move normal direction. + * \param theDistance progress of Path (0 = actual location, 1 = end of path location). + * \param theCopy is a true or false parameter. true is to create a copy, false to move the object. + * \param theCopy is a true or false parameter. true is to reverse direction, false is to move normal direction. * \return New GEOM_Object, containing the displaced shape. */ GEOM_Object PositionAlongPath (in GEOM_Object theObject, - in GEOM_Object thePath, - in double theDistance, - in boolean theCopy, - in boolean theReverse); + in GEOM_Object thePath, + in double theDistance, + in boolean theCopy, + in boolean theReverse); /*! * Recompute the shape from its arguments. @@ -1010,16 +1027,16 @@ module GEOM * \return New GEOM_Object, containing the created disk. */ GEOM_Object MakeDiskPntVecR (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theR); + in GEOM_Object theVec, + in double theR); /*! * Create a disk (circular face), passing through three given points * \param thePnt1, thePnt2, thePnt3 Points, defining the disk. * \return New GEOM_Object, containing the created disk. */ GEOM_Object MakeDiskThreePnt (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3); /*! * Create a disk specified dimensions along OX-OY coordinate axes, @@ -1049,9 +1066,9 @@ module GEOM * \return New GEOM_Object, containing the created cylinder. */ GEOM_Object MakeCylinderPntVecRH (in GEOM_Object thePnt, - in GEOM_Object theAxis, - in double theR, - in double theH); + in GEOM_Object theAxis, + in double theR, + in double theH); /*! * Create a cone with given height and radiuses at @@ -1078,10 +1095,10 @@ module GEOM * \return New GEOM_Object, containing the created cone. */ GEOM_Object MakeConePntVecR1R2H (in GEOM_Object thePnt, - in GEOM_Object theAxis, - in double theR1, - in double theR2, - in double theH); + in GEOM_Object theAxis, + in double theR1, + in double theR2, + in double theH); /*! * Create a torus with given radiuses at the origin of coordinate system. @@ -1090,7 +1107,7 @@ module GEOM * \return New GEOM_Object, containing the created torus. */ GEOM_Object MakeTorusRR (in double theRMajor, - in double theRMinor); + in double theRMinor); /*! * Create a torus with given center, normal vector and radiuses. @@ -1101,9 +1118,9 @@ module GEOM * \return New GEOM_Object, containing the created torus. */ GEOM_Object MakeTorusPntVecRR (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theRMajor, - in double theRMinor); + in GEOM_Object theVec, + in double theRMajor, + in double theRMinor); /*! * Create a sphere with given radius at the origin of coordinate system. @@ -1130,12 +1147,12 @@ module GEOM * \return New GEOM_Object, containing the created prism. */ GEOM_Object MakePrismVecH (in GEOM_Object theBase, - in GEOM_Object theVec, - in double theH); + in GEOM_Object theVec, + in double theH); /* The Same Prism but in 2 directions (forward&backward) */ GEOM_Object MakePrismVecH2Ways (in GEOM_Object theBase, - in GEOM_Object theVec, - in double theH); + in GEOM_Object theVec, + in double theH); /*! * Create a shape by extrusion of the base shape along a vector, defined by two points. @@ -1145,12 +1162,12 @@ module GEOM * \return New GEOM_Object, containing the created prism. */ GEOM_Object MakePrismTwoPnt (in GEOM_Object theBase, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /* The same prism but in two directions forward&backward */ GEOM_Object MakePrismTwoPnt2Ways (in GEOM_Object theBase, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /*! * Create a shape by extrusion of the base shape along a vector, defined by DX DY DZ. @@ -1159,7 +1176,7 @@ module GEOM * \return New GEOM_Object, containing the created prism. */ GEOM_Object MakePrismDXDYDZ (in GEOM_Object theBase, - in double theDX, in double theDY, in double theDZ); + in double theDX, in double theDY, in double theDZ); /* The same prism but in two directions forward&backward */ GEOM_Object MakePrismDXDYDZ2Ways (in GEOM_Object theBase, in double theDX, in double theDY, in double theDZ); @@ -1183,12 +1200,12 @@ module GEOM * \return New GEOM_Object, containing the created revolution. */ GEOM_Object MakeRevolutionAxisAngle (in GEOM_Object theBase, - in GEOM_Object theAxis, - in double theAngle); + in GEOM_Object theAxis, + in double theAngle); /* The Same Revolution but in both ways forward&backward */ GEOM_Object MakeRevolutionAxisAngle2Ways (in GEOM_Object theBase, - in GEOM_Object theAxis, - in double theAngle); + in GEOM_Object theAxis, + in double theAngle); /*! * Create a filling from the given compound of contours. @@ -1201,9 +1218,9 @@ module GEOM * \return New GEOM_Object, containing the created filling surface. */ GEOM_Object MakeFilling (in GEOM_Object theShape, - in long theMinDeg, in long theMaxDeg, - in double theTol2D, in double theTol3D, - in long theNbIter, + in long theMinDeg, in long theMaxDeg, + in double theTol2D, in double theTol3D, + in long theNbIter, in filling_oper_method theMethod, in boolean theApprox); @@ -1216,8 +1233,8 @@ module GEOM * \return New GEOM_Object, containing the created shell or solid. */ GEOM_Object MakeThruSections(in ListOfGO theSeqSections, - in boolean theModeSolid, - in double thePreci, + in boolean theModeSolid, + in double thePreci, in boolean theRuled); /*! @@ -1232,14 +1249,14 @@ module GEOM * \param theWithContact - the mode defining that the section is translated to be in * contact with the spine. * \param - WithCorrection - defining that the section is rotated to be - * orthogonal to the spine tangent in the correspondent point + * orthogonal to the spine tangent in the correspondent point * \return New GEOM_Object, containing the created pipe. */ GEOM_Object MakePipeWithDifferentSections (in ListOfGO theSeqBases, - in ListOfGO theLocations, - in GEOM_Object thePath, - in boolean theWithContact , - in boolean theWithCorrection ); + in ListOfGO theLocations, + in GEOM_Object thePath, + in boolean theWithContact , + in boolean theWithCorrection ); /*! * Create a shape by extrusion of the profile shape along @@ -1254,15 +1271,15 @@ module GEOM * \param theWithContact - the mode defining that the section is translated to be in * contact with the spine. * \param - WithCorrection - defining that the section is rotated to be - * orthogonal to the spine tangent in the correspondent point + * orthogonal to the spine tangent in the correspondent point * \return New GEOM_Object, containing the created pipe. */ GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases, - in ListOfGO theSeqSubBases, - in ListOfGO theLocations, - in GEOM_Object thePath, - in boolean theWithContact , - in boolean theWithCorrection ); + in ListOfGO theSeqSubBases, + in ListOfGO theLocations, + in GEOM_Object thePath, + in boolean theWithContact , + in boolean theWithCorrection ); /*! * Create solids between given sections @@ -1271,7 +1288,7 @@ module GEOM * \return New GEOM_Object, containing the created solids. */ GEOM_Object MakePipeShellsWithoutPath (in ListOfGO theSeqBases, - in ListOfGO theLocations); + in ListOfGO theLocations); /*! * Create a shape by extrusion of the base shape along @@ -1285,8 +1302,8 @@ module GEOM * \return New GEOM_Object, containing the created pipe. */ GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase, - in GEOM_Object thePath, - in GEOM_Object theVec); + in GEOM_Object thePath, + in GEOM_Object theVec); }; @@ -1305,6 +1322,17 @@ module GEOM */ GEOM_Object MakeEdge (in GEOM_Object thePnt1, in GEOM_Object thePnt2); + /*! + * Create an edge from specified wire. + * \param theWire source Wire. + * \param theLinearTolerance linear tolerance value + * \param theAngularTolerance angular tolerance value + * \return New GEOM_Object, containing the created edge. + */ + GEOM_Object MakeEdgeWire (in GEOM_Object theWire, + in double theLinearTolerance, + in double theAngularTolerance); + /*! * Create a wire from the set of edges and wires. * \param theEdgesAndWires List of edge and/or wires. @@ -1388,7 +1416,18 @@ module GEOM * \return New GEOM_Object, containing a copy of theShape without some faces. */ GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance, - in ListOfGO theFaces, in boolean doKeepNonSolids); + in ListOfGO theFaces, in boolean doKeepNonSolids); + + /*! + * Get all sub-shapes and groups of \a theShape, + * that were created already by any other methods. + * \param theShape Any shape. + * \param theGroupsOnly If this parameter is TRUE, only groups will be + * returned, else all found sub-shapes and groups. + * \return List of existing sub-objects of \a theShape. + */ + ListOfGO GetExistingSubObjects (in GEOM_Object theShape, + in boolean theGroupsOnly); /*! * Deprecated method. Use MakeAllSubShapes() instead. @@ -1436,7 +1475,7 @@ module GEOM * Don't try to apply modification operations on them. */ GEOM_Object GetSubShape (in GEOM_Object theMainShape, - in long theID); + in long theID); /*! * Get global index of \a theSubShape in \a theMainShape. @@ -1513,8 +1552,8 @@ module GEOM * \return List of sub-shapes of theShape1, shared with theShape2. */ ListOfGO GetSharedShapes (in GEOM_Object theShape1, - in GEOM_Object theShape2, - in long theShapeType); + in GEOM_Object theShape2, + in long theShapeType); /*! * Get all sub-shapes, shared by all shapes in the list \a theShapes. @@ -1536,9 +1575,9 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnPlane (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAx1, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAx1, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively * the specified plane by the certain way, defined through \a theState parameter. @@ -1551,10 +1590,10 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnPlaneWithLocation (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAx1, - in GEOM_Object thePnt, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAx1, + in GEOM_Object thePnt, + in shape_state theState); @@ -1570,10 +1609,10 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnCylinder (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAxis, - in double theRadius, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAxis, + in double theRadius, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1605,10 +1644,10 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnSphere (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theCenter, - in double theRadius, - in shape_state theState); + in long theShapeType, + in GEOM_Object theCenter, + in double theRadius, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1641,9 +1680,9 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnPlaneIDs (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAx1, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAx1, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1657,10 +1696,10 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnPlaneWithLocationIDs (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAx1, - in GEOM_Object thePnt, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAx1, + in GEOM_Object thePnt, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1674,10 +1713,10 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnCylinderIDs (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theAxis, - in double theRadius, - in shape_state theState); + in long theShapeType, + in GEOM_Object theAxis, + in double theRadius, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1709,10 +1748,10 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnSphereIDs (in GEOM_Object theShape, - in long theShapeType, - in GEOM_Object theCenter, - in double theRadius, - in shape_state theState); + in long theShapeType, + in GEOM_Object theCenter, + in double theRadius, + in shape_state theState); /*! * Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively @@ -1743,9 +1782,9 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnBoxIDs (in GEOM_Object theBox, - in GEOM_Object theShape, - in long theShapeType, - in shape_state theState); + in GEOM_Object theShape, + in long theShapeType, + in shape_state theState); /*! * \brief Find subshapes complying with given status @@ -1756,9 +1795,9 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnBox (in GEOM_Object theBox, - in GEOM_Object theShape, - in long theShapeType, - in shape_state theState); + in GEOM_Object theShape, + in long theShapeType, + in shape_state theState); /*! * \brief Find subshapes complying with given status @@ -1769,9 +1808,9 @@ module GEOM * \return List of IDs of all found sub-shapes. */ ListOfLong GetShapesOnShapeIDs (in GEOM_Object theCheckShape, - in GEOM_Object theShape, - in short theShapeType, - in shape_state theState); + in GEOM_Object theShape, + in short theShapeType, + in shape_state theState); /*! * \brief Find subshapes complying with given status @@ -1782,9 +1821,9 @@ module GEOM * \return List of all found sub-shapes. */ ListOfGO GetShapesOnShape (in GEOM_Object theCheckShape, - in GEOM_Object theShape, - in short theShapeType, - in shape_state theState); + in GEOM_Object theShape, + in short theShapeType, + in shape_state theState); /*! * \brief Find subshapes complying with given status @@ -1795,9 +1834,9 @@ module GEOM * \return compound includes all found sub-shapes. */ GEOM_Object GetShapesOnShapeAsCompound (in GEOM_Object theCheckShape, - in GEOM_Object theShape, - in short theShapeType, - in shape_state theState); + in GEOM_Object theShape, + in short theShapeType, + in shape_state theState); /*! * Get sub-shape(s) of \a theShapeWhere, which are @@ -1807,7 +1846,7 @@ module GEOM * \return Group of all found sub-shapes or a single found sub-shape. */ GEOM_Object GetInPlace (in GEOM_Object theShapeWhere, - in GEOM_Object theShapeWhat); + in GEOM_Object theShapeWhat); /*! * Get sub-shape(s) of \a theShapeWhere, which are @@ -1824,7 +1863,7 @@ module GEOM * \return Group of all found sub-shapes or a single found sub-shape. */ GEOM_Object GetInPlaceByHistory (in GEOM_Object theShapeWhere, - in GEOM_Object theShapeWhat); + in GEOM_Object theShapeWhat); /*! * Get sub-shape of theShapeWhere, which are @@ -1834,7 +1873,7 @@ module GEOM * \return found sub-shape. */ GEOM_Object GetSame (in GEOM_Object theShapeWhere, - in GEOM_Object theShapeWhat); + in GEOM_Object theShapeWhat); }; /*! @@ -1855,9 +1894,9 @@ module GEOM * \return New GEOM_Object, containing the created face. */ GEOM_Object MakeQuad (in GEOM_Object theEdge1, - in GEOM_Object theEdge2, - in GEOM_Object theEdge3, - in GEOM_Object theEdge4); + in GEOM_Object theEdge2, + in GEOM_Object theEdge3, + in GEOM_Object theEdge4); /*! * Create a quadrangle face on two edges. @@ -1866,7 +1905,7 @@ module GEOM * \return New GEOM_Object, containing the created face. */ GEOM_Object MakeQuad2Edges (in GEOM_Object theEdge1, - in GEOM_Object theEdge2); + in GEOM_Object theEdge2); /*! * Create a quadrangle face with specified corners. @@ -1875,9 +1914,9 @@ module GEOM * \return New GEOM_Object, containing the created face. */ GEOM_Object MakeQuad4Vertices (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3, - in GEOM_Object thePnt4); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3, + in GEOM_Object thePnt4); /*! * Create a hexahedral solid, bounded by the six given faces. Order of @@ -1886,11 +1925,11 @@ module GEOM * \return New GEOM_Object, containing the created solid. */ GEOM_Object MakeHexa (in GEOM_Object theFace1, - in GEOM_Object theFace2, - in GEOM_Object theFace3, - in GEOM_Object theFace4, - in GEOM_Object theFace5, - in GEOM_Object theFace6); + in GEOM_Object theFace2, + in GEOM_Object theFace3, + in GEOM_Object theFace4, + in GEOM_Object theFace5, + in GEOM_Object theFace6); /*! * Create a hexahedral solid between two given faces. @@ -1899,7 +1938,7 @@ module GEOM * \return New GEOM_Object, containing the created solid. */ GEOM_Object MakeHexa2Faces (in GEOM_Object theFace1, - in GEOM_Object theFace2); + in GEOM_Object theFace2); /*! * Extract elements of blocks and blocks compounds @@ -1914,10 +1953,19 @@ module GEOM * \return New GEOM_Object, containing the found vertex. */ GEOM_Object GetPoint (in GEOM_Object theShape, - in double theX, - in double theY, - in double theZ, - in double theEpsilon); + in double theX, + in double theY, + in double theZ, + in double theEpsilon); + + /*! + * Find a vertex of the given shape, which has minimal distance to the given point. + * \param theShape Any shape. + * \param thePoint Point, close to the desired vertex. + * \return New GEOM_Object, containing the found vertex. + */ + GEOM_Object GetVertexNearPoint (in GEOM_Object theShape, + in GEOM_Object thePoint); /*! * Get an edge, found in the given shape by two given vertices. @@ -1926,8 +1974,8 @@ module GEOM * \return New GEOM_Object, containing the found edge. */ GEOM_Object GetEdge (in GEOM_Object theShape, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2); /*! * Find an edge of the given shape, which has minimal distance to the given point. @@ -1936,7 +1984,7 @@ module GEOM * \return New GEOM_Object, containing the found edge. */ GEOM_Object GetEdgeNearPoint (in GEOM_Object theShape, - in GEOM_Object thePoint); + in GEOM_Object thePoint); /*! * Returns a face, found in the given shape by four given corner vertices. @@ -1945,10 +1993,10 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetFaceByPoints (in GEOM_Object theShape, - in GEOM_Object thePoint1, - in GEOM_Object thePoint2, - in GEOM_Object thePoint3, - in GEOM_Object thePoint4); + in GEOM_Object thePoint1, + in GEOM_Object thePoint2, + in GEOM_Object thePoint3, + in GEOM_Object thePoint4); /*! * Get a face of block, found in the given shape by two given edges. @@ -1957,8 +2005,8 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetFaceByEdges (in GEOM_Object theShape, - in GEOM_Object theEdge1, - in GEOM_Object theEdge2); + in GEOM_Object theEdge1, + in GEOM_Object theEdge2); /*! * Find a face, opposite to the given one in the given block. @@ -1967,7 +2015,7 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetOppositeFace (in GEOM_Object theBlock, - in GEOM_Object theFace); + in GEOM_Object theFace); /*! * Find a face of the given shape, which has minimal distance to the given point. @@ -1976,7 +2024,7 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetFaceNearPoint (in GEOM_Object theShape, - in GEOM_Object thePoint); + in GEOM_Object thePoint); /*! * Find a face of block, whose outside normale has minimal angle with the given vector. @@ -1985,7 +2033,23 @@ module GEOM * \return New GEOM_Object, containing the found face. */ GEOM_Object GetFaceByNormale (in GEOM_Object theBlock, - in GEOM_Object theVector); + in GEOM_Object theVector); + + /*! + * Find all subshapes of type \a theShapeType of the given shape, + * which have minimal distance to the given point. + * \param theShape Any shape. + * \param thePoint Point, close to the desired shape. + * \param theShapeType Defines what kind of subshapes is searched. + * \param theTolerance The tolerance for distances comparison. All shapes + * with distances to the given point in interval + * [minimal_distance, minimal_distance + theTolerance] will be gathered. + * \return New GEOM_Object, containing a group of all found shapes. + */ + GEOM_Object GetShapesNearPoint (in GEOM_Object theShape, + in GEOM_Object thePoint, + in long theShapeType, + in double theTolerance); /*! * Extract blocks from blocks compounds @@ -2001,9 +2065,9 @@ module GEOM * \return theNbBlocks Number of specified blocks in theCompound. */ boolean IsCompoundOfBlocks (in GEOM_Object theCompound, - in long theMinNbFaces, - in long theMaxNbFaces, - out long theNbBlocks); + in long theMinNbFaces, + in long theMaxNbFaces, + out long theNbBlocks); /*! * Enumeration of Blocks Compound defects. @@ -2054,7 +2118,7 @@ module GEOM * \return theErrors Structure, containing discovered errors and incriminated sub-shapes. */ boolean CheckCompoundOfBlocks (in GEOM_Object theCompound, - out BCErrors theErrors); + out BCErrors theErrors); /*! * Convert sequence of Blocks Compound errors, returned by @@ -2064,7 +2128,7 @@ module GEOM * \return String, describing all the errors in form, suitable for printing. */ string PrintBCErrors (in GEOM_Object theCompound, - in BCErrors theErrors); + in BCErrors theErrors); /*! * Remove all seam and degenerated edges from \a theShape. @@ -2097,8 +2161,8 @@ module GEOM * \return List of GEOM_Objects, containing the retrieved blocks. */ ListOfGO ExplodeCompoundOfBlocks (in GEOM_Object theCompound, - in long theMinNbFaces, - in long theMaxNbFaces); + in long theMinNbFaces, + in long theMaxNbFaces); /*! * Find block, containing the given point inside its volume or on boundary. @@ -2108,7 +2172,7 @@ module GEOM * \return New GEOM_Object, containing the found block. */ GEOM_Object GetBlockNearPoint (in GEOM_Object theCompound, - in GEOM_Object thePoint); + in GEOM_Object thePoint); /*! * Find block, containing all the elements, passed as the parts, or maximum quantity of them. @@ -2117,7 +2181,7 @@ module GEOM * \return New GEOM_Object, containing the found block. */ GEOM_Object GetBlockByParts (in GEOM_Object theCompound, - in ListOfGO theParts); + in ListOfGO theParts); /*! * Return all blocks, containing all the elements, passed as the parts. @@ -2126,7 +2190,7 @@ module GEOM * \return List of GEOM_Objects, containing the found blocks. */ ListOfGO GetBlocksByParts (in GEOM_Object theCompound, - in ListOfGO theParts); + in ListOfGO theParts); /*! * Operations on blocks with gluing of result @@ -2144,9 +2208,9 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeMultiTransformation1D (in GEOM_Object theBlock, - in long theDirFace1, - in long theDirFace2, - in long theNbTimes); + in long theDirFace1, + in long theDirFace2, + in long theNbTimes); /*! * Multi-transformate block and glue the result. @@ -2157,12 +2221,12 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeMultiTransformation2D (in GEOM_Object theBlock, - in long theDirFace1U, - in long theDirFace2U, - in long theNbTimesU, - in long theDirFace1V, - in long theDirFace2V, - in long theNbTimesV); + in long theDirFace1U, + in long theDirFace2U, + in long theNbTimesU, + in long theDirFace1V, + in long theDirFace2V, + in long theNbTimesV); /*! * Special operation - propagation @@ -2193,8 +2257,8 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeBoolean (in GEOM_Object theShape1, - in GEOM_Object theShape2, - in long theOperation); + in GEOM_Object theShape2, + in long theOperation); /*! * Perform partition operation. @@ -2222,13 +2286,13 @@ module GEOM * \return New GEOM_Object, containing the result shapes. */ GEOM_Object MakePartition (in ListOfGO theShapes, - in ListOfGO theTools, - in ListOfGO theKeepInside, - in ListOfGO theRemoveInside, - in short theLimit, - in boolean theRemoveWebs, - in ListOfLong theMaterials, - in short theKeepNonlimitShapes); + in ListOfGO theTools, + in ListOfGO theKeepInside, + in ListOfGO theRemoveInside, + in short theLimit, + in boolean theRemoveWebs, + in ListOfLong theMaterials, + in short theKeepNonlimitShapes); /*! * Perform partition operation. @@ -2244,13 +2308,13 @@ module GEOM * \return New GEOM_Object, containing the result shapes. */ GEOM_Object MakePartitionNonSelfIntersectedShape (in ListOfGO theShapes, - in ListOfGO theTools, - in ListOfGO theKeepInside, - in ListOfGO theRemoveInside, - in short theLimit, - in boolean theRemoveWebs, - in ListOfLong theMaterials, - in short theKeepNonlimitShapes); + in ListOfGO theTools, + in ListOfGO theKeepInside, + in ListOfGO theRemoveInside, + in short theLimit, + in boolean theRemoveWebs, + in ListOfLong theMaterials, + in short theKeepNonlimitShapes); /*! * Perform partition of the Shape with the Plane @@ -2259,7 +2323,7 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeHalfPartition (in GEOM_Object theShape, - in GEOM_Object thePlane); + in GEOM_Object thePlane); }; /*! @@ -2276,16 +2340,16 @@ module GEOM * \return New GEOM_Object, containing the created circle. */ GEOM_Object MakeCirclePntVecR (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theR); + in GEOM_Object theVec, + in double theR); /*! * Create a circle, passing through three given points * \param thePnt1,thePnt2,thePnt3 Points, defining the circle. * \return New GEOM_Object, containing the created circle. */ GEOM_Object MakeCircleThreePnt (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3); /*! * Create a circle with given center, with a radius equals the distance from center to Point1 * and on a plane defined by all of three points. @@ -2293,8 +2357,8 @@ module GEOM * \return New GEOM_Object, containing the created circle. */ GEOM_Object MakeCircleCenter2Pnt (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3); /*! * Create an ellipse with given center, normal vector and radiuses. * \param thePnt Ellipse center. @@ -2304,9 +2368,9 @@ module GEOM * \return New GEOM_Object, containing the created ellipse. */ GEOM_Object MakeEllipse (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theRMajor, - in double theRMinor); + in GEOM_Object theVec, + in double theRMajor, + in double theRMinor); /*! * Create an ellipse with given center, normal vector, main axis vector and radiuses. @@ -2318,10 +2382,10 @@ module GEOM * \return New GEOM_Object, containing the created ellipse. */ GEOM_Object MakeEllipseVec (in GEOM_Object thePnt, - in GEOM_Object theVec, - in double theRMajor, - in double theRMinor, - in GEOM_Object theVecMaj); + in GEOM_Object theVec, + in double theRMajor, + in double theRMinor, + in GEOM_Object theVecMaj); /*! * Create an arc of circle, passing through three given points. @@ -2331,8 +2395,8 @@ module GEOM * \return New GEOM_Object, containing the created arc. */ GEOM_Object MakeArc (in GEOM_Object thePnt1, - in GEOM_Object thePnt2, - in GEOM_Object thePnt3); + in GEOM_Object thePnt2, + in GEOM_Object thePnt3); /*! * Create an arc of circle of center C from one point to another @@ -2355,8 +2419,8 @@ module GEOM * \return New GEOM_Object, containing the created arc. */ GEOM_Object MakeArcOfEllipse (in GEOM_Object theCenter, - in GEOM_Object thePnt1, - in GEOM_Object thePnt2); + in GEOM_Object thePnt1, + in GEOM_Object thePnt2); /*! @@ -2452,7 +2516,7 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeFilletAll (in GEOM_Object theShape, - in double theR); + in double theR); /*! * Perform a fillet on the specified edges of the given shape @@ -2464,12 +2528,12 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeFilletEdges (in GEOM_Object theShape, - in double theR, - in ListOfLong theEdges); + in double theR, + in ListOfLong theEdges); GEOM_Object MakeFilletEdgesR1R2 (in GEOM_Object theShape, - in double theR1, - in double theR2, - in ListOfLong theEdges); + in double theR1, + in double theR2, + in ListOfLong theEdges); /*! * Perform a fillet on all edges of the specified faces of the given shape. @@ -2481,13 +2545,13 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeFilletFaces (in GEOM_Object theShape, - in double theR, - in ListOfLong theFaces); + in double theR, + in ListOfLong theFaces); GEOM_Object MakeFilletFacesR1R2 (in GEOM_Object theShape, - in double theR1, - in double theR2, - in ListOfLong theFaces); + in double theR1, + in double theR2, + in ListOfLong theFaces); /*! * Perform a fillet on face of the specified vertexes of the given shape. @@ -2499,8 +2563,8 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeFillet2D (in GEOM_Object theShape, - in double theR, - in ListOfLong theVertexes); + in double theR, + in ListOfLong theVertexes); /*! * Perform a fillet on edges of the specified vertexes of the given wire. @@ -2514,8 +2578,8 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeFillet1D (in GEOM_Object theShape, - in double theR, - in ListOfLong theVertexes); + in double theR, + in ListOfLong theVertexes); /*! * Perform a symmetric chamfer on all edges of the given shape. @@ -2524,7 +2588,7 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeChamferAll (in GEOM_Object theShape, - in double theD); + in double theD); /*! * Perform a chamfer on edges, common to the specified faces. @@ -2538,15 +2602,15 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeChamferEdge (in GEOM_Object theShape, - in double theD1, in double theD2, - in long theFace1, in long theFace2); + in double theD1, in double theD2, + in long theFace1, in long theFace2); /*! * The Same but with params theD = Chamfer Lenght * and theAngle = Chamfer Angle (Angle in radians) */ GEOM_Object MakeChamferEdgeAD (in GEOM_Object theShape, - in double theD, in double theAngle, - in long theFace1, in long theFace2); + in double theD, in double theAngle, + in long theFace1, in long theFace2); /*! * Perform a chamfer on all edges of the specified faces. @@ -2562,15 +2626,15 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeChamferFaces (in GEOM_Object theShape, - in double theD1, in double theD2, - in ListOfLong theFaces); + in double theD1, in double theD2, + in ListOfLong theFaces); /*! * The Same but with params theD = Chamfer Lenght * and theAngle = Chamfer Angle (Angle in radians) */ GEOM_Object MakeChamferFacesAD (in GEOM_Object theShape, - in double theD, in double theAngle, - in ListOfLong theFaces); + in double theD, in double theAngle, + in ListOfLong theFaces); /*! * Perform a chamfer on edges, @@ -2581,15 +2645,15 @@ module GEOM * \return New GEOM_Object, containing the result shape. */ GEOM_Object MakeChamferEdges (in GEOM_Object theShape, - in double theD1, in double theD2, - in ListOfLong theEdges); + in double theD1, in double theD2, + in ListOfLong theEdges); /*! * The Same but with params theD = Chamfer Lenght * and theAngle = Chamfer Angle (Angle in radians) */ GEOM_Object MakeChamferEdgesAD (in GEOM_Object theShape, - in double theD, in double theAngle, - in ListOfLong theEdges); + in double theD, in double theAngle, + in ListOfLong theEdges); /*! * Perform an Archimde operation on the given shape with given parameters. @@ -2602,9 +2666,9 @@ module GEOM * by a plane, corresponding to water level. */ GEOM_Object MakeArchimede (in GEOM_Object theShape, - in double theWeight, - in double theWaterDensity, - in double theMeshDeflection); + in double theWeight, + in double theWaterDensity, + in double theMeshDeflection); /*! * Duplicates GEOM_IShapesOperations.GetSubShapeIndex(). @@ -2630,9 +2694,9 @@ module GEOM * \return New GEOM_Object, containing processed shape. */ GEOM_Object ProcessShape (in GEOM_Object theShapes, - in string_array theOperators, - in string_array theParameters, - in string_array theValues); + in string_array theOperators, + in string_array theParameters, + in string_array theValues); /*! * Get default sequence of operators, their parameters and parameters' values @@ -2644,8 +2708,8 @@ module GEOM * as parameters are listed in \a theParameters list. */ void GetShapeProcessParameters (out string_array theOperators, - out string_array theParameters, - out string_array theValues); + out string_array theParameters, + out string_array theValues); /*! * Get parameters and parameters' values for the given Shape Process operation. * In the current implementation the defaults are @@ -2656,8 +2720,8 @@ module GEOM * as parameters are listed in \a theParameters list. */ void GetOperatorParameters (in string theOperator, - out string_array theParameters, - out string_array theValues); + out string_array theParameters, + out string_array theValues); /*! * Remove faces from the given object (shape). @@ -2678,7 +2742,7 @@ module GEOM * \return New GEOM_Object, containing processed shape. */ GEOM_Object CloseContour (in GEOM_Object theObject, in short_array theWires, - in boolean isCommonVertex); + in boolean isCommonVertex); /*! * Remove internal wires and edges from the given object (face). @@ -2718,7 +2782,7 @@ module GEOM * \return New GEOM_Object, containing processed shape. */ GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex, - in double theValue, in boolean isByParameter); + in double theValue, in boolean isByParameter); /*! * Get a list of wires (wrapped in GEOM_Object-s), @@ -2729,8 +2793,8 @@ module GEOM * \return FALSE, if an error(s) occured during the method execution. */ boolean GetFreeBoundary (in GEOM_Object theObject, - out ListOfGO theClosedWires, - out ListOfGO theOpenWires); + out ListOfGO theClosedWires, + out ListOfGO theOpenWires); /*! * Change orientation of the given object. @@ -2740,6 +2804,14 @@ module GEOM GEOM_Object ChangeOrientation (in GEOM_Object theObject); GEOM_Object ChangeOrientationCopy (in GEOM_Object theObject); + /*! + * Try to limit tolerance of the given object by value \a theTolerance. + * \param theObject Shape to be processed. + * \param theTolerance Required tolerance value. + * \return New GEOM_Object, containing processed shape. + */ + GEOM_Object LimitTolerance (in GEOM_Object theObject, in double theTolerance); + }; /*! @@ -2781,7 +2853,7 @@ module GEOM * \return Returns available formats and patterns through the arguments. */ void ImportTranslators (out string_array theFormats, - out string_array thePatterns); + out string_array thePatterns); /*! * Get the supported export formats and corresponding patterns for File dialog. @@ -2790,7 +2862,7 @@ module GEOM * \return Returns available formats and patterns through the arguments. */ void ExportTranslators (out string_array theFormats, - out string_array thePatterns); + out string_array thePatterns); /*! * Load texture from file @@ -2891,8 +2963,8 @@ module GEOM */ //short KindOfShape (in GEOM_Object theShape, GEOM_IKindOfShape::shape_kind KindOfShape (in GEOM_Object theShape, - out ListOfLong theIntegers, - out ListOfDouble theDoubles); + out ListOfLong theIntegers, + out ListOfDouble theDoubles); /*! * Get position (LCS) of theShape. @@ -2906,9 +2978,9 @@ module GEOM * \return Returns position of the shape through the last nine arguments. */ void GetPosition (in GEOM_Object theShape, - out double Ox, out double Oy, out double Oz, - out double Zx, out double Zy, out double Zz, - out double Xx, out double Xy, out double Xz); + out double Ox, out double Oy, out double Oz, + out double Zx, out double Zy, out double Zz, + out double Xx, out double Xy, out double Xz); /*! * Get summarized length of all wires, @@ -2920,9 +2992,9 @@ module GEOM * \return Returns shape properties through the last three arguments. */ void GetBasicProperties (in GEOM_Object theShape, - out double theLength, - out double theSurfArea, - out double theVolume); + out double theLength, + out double theSurfArea, + out double theVolume); /*! * Get a point, situated at the centre of mass of theShape. @@ -2930,8 +3002,7 @@ module GEOM * \return New GEOM_Object, containing the created point. */ GEOM_Object GetCentreOfMass (in GEOM_Object theShape); - - + /* * Get the vertex by index for 1D objects depends the edge/wire orientation * \param theShape Shape (wire or edge) to find the vertex on it @@ -2949,7 +3020,7 @@ module GEOM * \return New GEOM_Object, containing the created normal vector. */ GEOM_Object GetNormal (in GEOM_Object theFace, - in GEOM_Object theOptionalPoint); + in GEOM_Object theOptionalPoint); /*! * Get inertia matrix and moments of inertia of theShape. @@ -2959,10 +3030,10 @@ module GEOM * \return Returns inertia through the last twelve arguments. */ void GetInertia (in GEOM_Object theShape, - out double I11, out double I12, out double I13, - out double I21, out double I22, out double I23, - out double I31, out double I32, out double I33, - out double Ix , out double Iy , out double Iz); + out double I11, out double I12, out double I13, + out double I21, out double I22, out double I23, + out double I31, out double I32, out double I33, + out double Ix , out double Iy , out double Iz); /*! * Get parameters of bounding box of the given shape @@ -2973,9 +3044,9 @@ module GEOM * \return Returns parameters of bounding box through the last six arguments. */ void GetBoundingBox (in GEOM_Object theShape, - out double Xmin, out double Xmax, - out double Ymin, out double Ymax, - out double Zmin, out double Zmax); + out double Xmin, out double Xmax, + out double Ymin, out double Ymax, + out double Zmin, out double Zmax); /*! * Get min and max tolerances of sub-shapes of theShape @@ -2986,9 +3057,9 @@ module GEOM * \return Returns shape tolerances through the last six arguments. */ void GetTolerance (in GEOM_Object theShape, - out double FaceMin, out double FaceMax, - out double EdgeMin, out double EdgeMax, - out double VertMin, out double VertMax); + out double FaceMin, out double FaceMax, + out double EdgeMin, out double EdgeMax, + out double VertMin, out double VertMax); /*! * Check a topology of the given shape. @@ -2997,7 +3068,7 @@ module GEOM * \return TRUE, if the shape "seems to be valid" from the topological point of view. */ boolean CheckShape (in GEOM_Object theShape, - out string theDescription); + out string theDescription); /*! * Check a topology and a geometry of the given shape. @@ -3006,7 +3077,7 @@ module GEOM * \return TRUE, if the shape "seems to be valid". */ boolean CheckShapeWithGeometry (in GEOM_Object theShape, - out string theDescription); + out string theDescription); /*! * Obtain description of the given shape @@ -3023,8 +3094,8 @@ module GEOM * \return Value of the minimal distance between the given shapes. */ double GetMinDistance (in GEOM_Object theShape1, in GEOM_Object theShape2, - out double X1, out double Y1, out double Z1, - out double X2, out double Y2, out double Z2); + out double X1, out double Y1, out double Z1, + out double X2, out double Y2, out double Z2); /*! * Get angle between the given lines or linear edges. @@ -3062,7 +3133,7 @@ module GEOM * \return Value of curvature. */ double MaxSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam, - in double theVParam); + in double theVParam); /*! * Get max radius of curvature of surface in the given point @@ -3080,7 +3151,7 @@ module GEOM * \return Value of curvature. */ double MinSurfaceCurvatureByParam (in GEOM_Object theShape, in double theUParam, - in double theVParam); + in double theVParam); /*! * Get min radius of curvature of surface in the given point @@ -3189,9 +3260,9 @@ module GEOM * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true) * \return List of GEOM_Objects, containing the created shape and propagation groups. */ - ListOfGO MakePipeTShape (in double theR1, in double theW1, in double theL1, - in double theR2, in double theW2, in double theL2, - in boolean theHexMesh); + ListOfGO MakePipeTShape (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in boolean theHexMesh); /*! * Create a T-shape object with specified caracteristics for the main and * the incident pipes (radius, width, half-length). @@ -3209,10 +3280,10 @@ module GEOM * \param theP3 Junction point of incident pipe * \return List of GEOM_Objects, containing the created shape and propagation groups. */ - ListOfGO MakePipeTShapeWithPosition (in double theR1, in double theW1, in double theL1, - in double theR2, in double theW2, in double theL2, - in boolean theHexMesh, - in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); + ListOfGO MakePipeTShapeWithPosition (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in boolean theHexMesh, + in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); /*! * Create a T-shape object with specified caracteristics for the main and * the incident pipes (radius, width, half-length). A chamfer is created @@ -3230,8 +3301,8 @@ module GEOM * \return List of GEOM_Objects, containing the created shape and propagation groups. */ ListOfGO MakePipeTShapeChamfer (in double theR1, in double theW1, in double theL1, - in double theR2, in double theW2, in double theL2, - in double theH, in double theW, in boolean theHexMesh); + in double theR2, in double theW2, in double theL2, + in double theH, in double theW, in boolean theHexMesh); /*! * Create a T-shape object with specified caracteristics for the main and * the incident pipes (radius, width, half-length). A chamfer is created @@ -3252,10 +3323,10 @@ module GEOM * \param theP3 Junction point of incident pipe * \return List of GEOM_Objects, containing the created shape and propagation groups. */ - ListOfGO MakePipeTShapeChamferWithPosition (in double theR1, in double theW1, in double theL1, - in double theR2, in double theW2, in double theL2, - in double theH, in double theW, in boolean theHexMesh, - in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); + ListOfGO MakePipeTShapeChamferWithPosition (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in double theH, in double theW, in boolean theHexMesh, + in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); /*! * Create a T-shape object with specified caracteristics for the main and * the incident pipes (radius, width, half-length). A fillet is created @@ -3271,9 +3342,9 @@ module GEOM * \param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=true) * \return List of GEOM_Objects, containing the created shape and propagation groups. */ - ListOfGO MakePipeTShapeFillet (in double theR1, in double theW1, in double theL1, - in double theR2, in double theW2, in double theL2, - in double theRF, in boolean theHexMesh); + ListOfGO MakePipeTShapeFillet (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in double theRF, in boolean theHexMesh); /*! * Create a T-shape object with specified caracteristics for the main and * the incident pipes (radius, width, half-length). A fillet is created @@ -3293,13 +3364,13 @@ module GEOM * \param theP3 Junction point of incident pipe * \return List of GEOM_Objects, containing the created shape and propagation groups. */ - ListOfGO MakePipeTShapeFilletWithPosition (in double theR1, in double theW1, in double theL1, - in double theR2, in double theW2, in double theL2, - in double theRF, in boolean theHexMesh, - in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); + ListOfGO MakePipeTShapeFilletWithPosition (in double theR1, in double theW1, in double theL1, + in double theR2, in double theW2, in double theL2, + in double theRF, in boolean theHexMesh, + in GEOM_Object theP1, in GEOM_Object theP2, in GEOM_Object theP3); /*@@ insert new functions before this line @@ do not remove this line @@*/ }; - + /*! * GEOM_Gen: Interface to access other GEOM interfaces. * Also contains some methods to access and manage GEOM objects. @@ -3321,9 +3392,9 @@ module GEOM * Returns a SObject where theObject is placed */ SALOMEDS::SObject AddInStudy (in SALOMEDS::Study theStudy, - in GEOM_Object theObject, - in string theName, - in GEOM_Object theFather); + in GEOM_Object theObject, + in string theName, + in GEOM_Object theFather); /*! * Publish sub-shapes, standing for arguments and sub-shapes of arguments @@ -3349,12 +3420,42 @@ module GEOM * \return list of published sub-shapes */ ListOfGO RestoreSubShapesO (in SALOMEDS::Study theStudy, - in GEOM_Object theObject, - in ListOfGO theArgs, - in find_shape_method theFindMethod, - in boolean theInheritFirstArg, + in GEOM_Object theObject, + in ListOfGO theArgs, + in find_shape_method theFindMethod, + in boolean theInheritFirstArg, in boolean theAddPrefix); + /*! + * Publish sub-shapes, standing for arguments and sub-shapes of arguments + * To be used from python scripts out of geompy.addToStudy (non-default usage) + * \param theStudy the study, in which theObject is published already, + * and in which the arguments will be published + * \param theObject published GEOM object, arguments of which will be published + * \param theArgs list of GEOM_Object, operation arguments to be published. + * If this list is empty, all operation arguments will be published + * \param theFindMethod method to search subshapes, corresponding to arguments and + * their subshapes. Value from enumeration GEOM::find_shape_method. + * \param theInheritFirstArg set properties of the first argument for \a theObject. + * Do not publish subshapes in place of arguments, but only + * in place of subshapes of the first argument, + * because the whole shape corresponds to the first argument. + * Mainly to be used after transformations, but it also can be + * usefull after partition with one object shape, and some other + * operations, where only the first argument has to be considered. + * If theObject has only one argument shape, this flag is automatically + * considered as True, not regarding really passed value. + * \param theAddPrefix add prefix "from_" to names of restored sub-shapes, + * and prefix "from_subshapes_of_" to names of partially restored subshapes. + * \return list of published sub-shapes + */ + ListOfGO RestoreGivenSubShapesO (in SALOMEDS::Study theStudy, + in GEOM_Object theObject, + in ListOfGO theArgs, + in find_shape_method theFindMethod, + in boolean theInheritFirstArg, + in boolean theAddPrefix); + /*! * Publish sub-shapes, standing for arguments and sub-shapes of arguments * To be used from GUI and from geompy.addToStudy. @@ -3362,10 +3463,10 @@ module GEOM * \param theSObject study object, referencing GEOM object, arguments of which will be published */ ListOfGO RestoreSubShapesSO (in SALOMEDS::Study theStudy, - in SALOMEDS::SObject theSObject, - in ListOfGO theArgs, - in find_shape_method theFindMethod, - in boolean theInheritFirstArg, + in SALOMEDS::SObject theSObject, + in ListOfGO theArgs, + in find_shape_method theFindMethod, + in boolean theInheritFirstArg, in boolean theAddPrefix); /*! @@ -3446,8 +3547,8 @@ module GEOM * \param theObject The object which named subshapes are published */ ListOfGO PublishNamedShapesInStudy(in SALOMEDS::Study theStudy, - //in SObject theSObject, - in Object theObject); + //in SObject theSObject, + in Object theObject); }; }; diff --git a/resources/ImportExport b/resources/ImportExport index 654d2e1a3..f338de457 100644 --- a/resources/ImportExport +++ b/resources/ImportExport @@ -1,5 +1,5 @@ Import: BREP|IGES|STEP|ACIS -Export: BREP|IGES|IGES_5_3|STEP|STL_Bin|STL_ASCII|ACIS +Export: BREP|IGES|IGES_5_3|STEP|STL_Bin|STL_ASCII|ACIS|VTK BREP.Import: libBREPImport BREP.Export: libBREPExport @@ -26,3 +26,6 @@ STL_ASCII.Pattern: STL ASCII Files ( *.stl ) ACIS.Import: libACISImport ACIS.Export: libACISExport ACIS.Pattern: ACIS Files ( *.sat ) + +VTK.Export: libVTKExport +VTK.Pattern: VTK Files ( *.vtk ) diff --git a/resources/Makefile.am b/resources/Makefile.am index 94b2eb825..02d6e15bb 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -47,6 +47,7 @@ box2points.png \ boxdxyz.png \ build_compound.png \ build_edge.png \ +build_edge_wire.png \ build_face.png \ build_shell.png \ build_solid.png \ @@ -93,6 +94,7 @@ filletface.png \ filling.png \ fuse.png \ geometry.png \ +limit_tolerance.png \ line.png \ line2points.png \ line2faces.png \ @@ -109,6 +111,7 @@ multitranslationdouble.png \ multitranslationsimple.png \ normale.png \ offset.png \ +origin_and_vectors.png \ partition.png \ partitionkeep.png \ partitionplane.png \ diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 26adbc5ec..e57d0cf32 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -49,6 +49,8 @@ + + diff --git a/resources/build_edge_wire.png b/resources/build_edge_wire.png new file mode 100644 index 000000000..3c7b5383b Binary files /dev/null and b/resources/build_edge_wire.png differ diff --git a/resources/limit_tolerance.png b/resources/limit_tolerance.png new file mode 100644 index 000000000..35f20804e Binary files /dev/null and b/resources/limit_tolerance.png differ diff --git a/resources/origin_and_vectors.png b/resources/origin_and_vectors.png new file mode 100755 index 000000000..0c5fa9f72 Binary files /dev/null and b/resources/origin_and_vectors.png differ diff --git a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx index b43126f08..d8563cff8 100644 --- a/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx +++ b/src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx @@ -427,7 +427,7 @@ void AdvancedGUI_PipeTShapeDlg::SelectionIntoArgument() { //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/BasicGUI/BasicGUI_ArcDlg.cxx b/src/BasicGUI/BasicGUI_ArcDlg.cxx index a4a6dfc81..ad6ebb30f 100644 --- a/src/BasicGUI/BasicGUI_ArcDlg.cxx +++ b/src/BasicGUI/BasicGUI_ArcDlg.cxx @@ -288,7 +288,7 @@ void BasicGUI_ArcDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil() ) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); } diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index 119176c59..5c9ab11c0 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -70,8 +70,8 @@ BasicGUI_CircleDlg::BasicGUI_CircleDlg( GeometryGUI* theGeometryGUI, QWidget* pa GroupPntVecR = new DlgRef_2Sel1Spin( centralWidget() ); GroupPntVecR->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) ); - GroupPntVecR->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) + " (Origin by default)" ); - GroupPntVecR->TextLabel2->setText( tr( "GEOM_VECTOR" ) + " (Z axis by default)" ); + GroupPntVecR->TextLabel1->setText( tr( "GEOM_CENTER_POINT" ) + " " + tr( "GEOM_CENTER_DEFAULT" ) ); + GroupPntVecR->TextLabel2->setText( tr( "GEOM_VECTOR" ) + " " + tr( "GEOM_AXIS_DEFAULT" ) ); GroupPntVecR->TextLabel3->setText( tr( "GEOM_RADIUS" ) ); GroupPntVecR->PushButton1->setIcon( image1 ); GroupPntVecR->PushButton2->setIcon( image1 ); @@ -358,7 +358,7 @@ void BasicGUI_CircleDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName ); - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil() ) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex ); } diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 4354cf072..40af9d35e 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -261,7 +261,7 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); } diff --git a/src/BasicGUI/BasicGUI_LineDlg.cxx b/src/BasicGUI/BasicGUI_LineDlg.cxx index 9a45c86d4..4e2e4d77e 100644 --- a/src/BasicGUI/BasicGUI_LineDlg.cxx +++ b/src/BasicGUI/BasicGUI_LineDlg.cxx @@ -275,7 +275,7 @@ void BasicGUI_LineDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName ); - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil() ) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex ); } diff --git a/src/BasicGUI/BasicGUI_MarkerDlg.cxx b/src/BasicGUI/BasicGUI_MarkerDlg.cxx index 70cdd2c2a..6a2007aef 100644 --- a/src/BasicGUI/BasicGUI_MarkerDlg.cxx +++ b/src/BasicGUI/BasicGUI_MarkerDlg.cxx @@ -441,7 +441,7 @@ void BasicGUI_MarkerDlg::onSelectionDone() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObj, aName ); - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil() ) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); aSelectedObj = aShapesOp->GetSubShape( aSelectedObj, anIndex ); } diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index e6b6f6610..b7462a70f 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -470,7 +470,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName ); - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil() ) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex ); } diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index dc8ff2693..90af070cd 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -510,8 +510,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil() ) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); @@ -907,9 +906,11 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects ) if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() && aShape.ShapeType() == TopAbs_VERTEX ) { gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); - myX->setText( QString( "%1" ).arg( aPnt.X() ) ); - myY->setText( QString( "%1" ).arg( aPnt.Y() ) ); - myZ->setText( QString( "%1" ).arg( aPnt.Z() ) ); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); + myX->setText( DlgRef::PrintDoubleValue( aPnt.X(), aPrecision ) ); + myY->setText( DlgRef::PrintDoubleValue( aPnt.Y(), aPrecision ) ); + myZ->setText( DlgRef::PrintDoubleValue( aPnt.Z(), aPrecision ) ); } else { myX->setText( "" ); diff --git a/src/BasicGUI/BasicGUI_PointDlg.h b/src/BasicGUI/BasicGUI_PointDlg.h index abb2eab36..0e6973fc4 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.h +++ b/src/BasicGUI/BasicGUI_PointDlg.h @@ -83,7 +83,7 @@ private: GEOM::GEOM_Object_var myLine2; bool myBusy; - + DlgRef_3Spin* GroupXYZ; DlgRef_1Sel3Spin* GroupRefPoint; DlgRef_1Sel1Spin* GroupOnCurve; diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 97e19c98d..5d42f980f 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -302,7 +302,7 @@ void BasicGUI_VectorDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); } diff --git a/src/BlocksGUI/BlocksGUI_BlockDlg.cxx b/src/BlocksGUI/BlocksGUI_BlockDlg.cxx index 280d911c8..5c5458896 100644 --- a/src/BlocksGUI/BlocksGUI_BlockDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_BlockDlg.cxx @@ -269,7 +269,7 @@ void BlocksGUI_BlockDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); } diff --git a/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx b/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx index adbc2f524..f458dc051 100644 --- a/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx +++ b/src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx @@ -261,7 +261,7 @@ void BlocksGUI_QuadFaceDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(anObj, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); anObj = aShapesOp->GetSubShape(anObj, anIndex); } diff --git a/src/BuildGUI/BuildGUI_CompoundDlg.cxx b/src/BuildGUI/BuildGUI_CompoundDlg.cxx index e71337972..24f18c622 100644 --- a/src/BuildGUI/BuildGUI_CompoundDlg.cxx +++ b/src/BuildGUI/BuildGUI_CompoundDlg.cxx @@ -113,6 +113,7 @@ void BuildGUI_CompoundDlg::Init() globalSelection( GEOM_ALLSHAPES ); initName( tr( "GEOM_COMPOUND" ) ); + SelectionIntoArgument(); } diff --git a/src/BuildGUI/BuildGUI_EdgeDlg.cxx b/src/BuildGUI/BuildGUI_EdgeDlg.cxx index 5096b2a7a..33e9f1e50 100644 --- a/src/BuildGUI/BuildGUI_EdgeDlg.cxx +++ b/src/BuildGUI/BuildGUI_EdgeDlg.cxx @@ -36,6 +36,7 @@ #include #include +#include //================================================================================= // class : BuildGUI_EdgeDlg() @@ -47,38 +48,58 @@ BuildGUI_EdgeDlg::BuildGUI_EdgeDlg (GeometryGUI* theGeometryGUI, QWidget* parent) : GEOMBase_Skeleton(theGeometryGUI, parent) { - QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE"))); - QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); + QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); + QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE"))); + QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BUILD_EDGE_WIRE"))); setWindowTitle(tr("GEOM_EDGE_TITLE")); /***************************************************************/ mainFrame()->GroupConstructors->setTitle(tr("GEOM_EDGE")); - mainFrame()->RadioButton1->setIcon(image0); - mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose); - mainFrame()->RadioButton2->close(); - mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton1->setIcon(image1); + mainFrame()->RadioButton2->setIcon(image2); + mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); mainFrame()->RadioButton3->close(); - GroupPoints = new DlgRef_2Sel(centralWidget()); + // two points + GroupPoints = new DlgRef_2Sel(centralWidget()); GroupPoints->GroupBox1->setTitle(tr("GEOM_POINTS")); GroupPoints->TextLabel1->setText(tr("GEOM_POINT_I").arg(1)); GroupPoints->TextLabel2->setText(tr("GEOM_POINT_I").arg(2)); - GroupPoints->PushButton1->setIcon(image1); - GroupPoints->PushButton2->setIcon(image1); - + GroupPoints->PushButton1->setIcon(image0); + GroupPoints->PushButton2->setIcon(image0); GroupPoints->LineEdit1->setReadOnly(true); GroupPoints->LineEdit2->setReadOnly(true); + // wire + + GroupWire = new DlgRef_1Sel2Spin(centralWidget()); + GroupWire->GroupBox1->setTitle(tr("GEOM_WIRE")); + GroupWire->TextLabel1->setText(tr("GEOM_WIRE")); + GroupWire->PushButton1->setIcon(image0); + GroupWire->LineEdit1->setReadOnly(true); + GroupWire->TextLabel2->setText( tr( "GEOM_LINEAR_TOLERANCE" ) ); + GroupWire->TextLabel3->setText( tr( "GEOM_ANGULAR_TOLERANCE" ) ); + double SpecificStep = 0.0001; + double prec1 = Precision::Confusion(); + double prec2 = Precision::Angular(); + initSpinBox(GroupWire->SpinBox_DX, prec1, MAX_NUMBER, SpecificStep, "len_tol_precision" ); + initSpinBox(GroupWire->SpinBox_DY, prec2, MAX_NUMBER, SpecificStep, "ang_tol_precision" ); + GroupWire->SpinBox_DX->setValue(prec1); + GroupWire->SpinBox_DY->setValue(prec2); + + // layout + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); layout->setMargin(0); layout->setSpacing(6); layout->addWidget(GroupPoints); + layout->addWidget(GroupWire); /***************************************************************/ setHelpFileName("create_edge_page.html"); - // Initialisation + // initialisation Init(); } @@ -98,28 +119,35 @@ BuildGUI_EdgeDlg::~BuildGUI_EdgeDlg() void BuildGUI_EdgeDlg::Init() { // init variables - GroupPoints->LineEdit1->setReadOnly(true); - GroupPoints->LineEdit2->setReadOnly(true); - - GroupPoints->LineEdit1->setText(""); - GroupPoints->LineEdit2->setText(""); - myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil(); - myOkPoint1 = myOkPoint2 = false; + myPoint1 = myPoint2 = myWire = GEOM::GEOM_Object::_nil(); + myEditCurrentArgument = GroupPoints->LineEdit1; + GroupPoints->PushButton1->setDown(true); + globalSelection(); // close local contexts, if any + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); // signals and slots connections + connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ); + connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ); + + connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) ); + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupWire->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + connect(GroupWire->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); initName(tr("GEOM_EDGE")); - GroupPoints->PushButton1->click(); - SelectionIntoArgument(); + ConstructorsClicked( 0 ); } //================================================================================= @@ -142,11 +170,60 @@ bool BuildGUI_EdgeDlg::ClickOnApply() return false; initName(); - // activate selection and connect selection manager - GroupPoints->PushButton1->click(); + + myEditCurrentArgument->setText( "" ); + ConstructorsClicked( getConstructorId() ); + return true; } +//================================================================================= +// function : ConstructorsClicked() +// purpose : Radio button management +//================================================================================= +void BuildGUI_EdgeDlg::ConstructorsClicked( int constructorId ) +{ + switch ( constructorId ) { + case 0: + { + globalSelection(); // close local contexts, if any + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); + + myEditCurrentArgument = GroupPoints->LineEdit1; + GroupPoints->LineEdit1->setText( "" ); + GroupPoints->LineEdit2->setText( "" ); + myPoint1 = GEOM::GEOM_Object::_nil(); + myPoint2 = GEOM::GEOM_Object::_nil(); + GroupPoints->PushButton1->setDown(true); + GroupPoints->PushButton2->setDown(false); + GroupPoints->LineEdit1->setEnabled(true); + GroupPoints->LineEdit2->setEnabled(false); + GroupPoints->show(); + GroupWire->hide(); + break; + } + case 1: + { + globalSelection(); // close local contexts, if any + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE ); + + myEditCurrentArgument = GroupWire->LineEdit1; + GroupWire->LineEdit1->setText(""); + myWire = GEOM::GEOM_Object::_nil(); + GroupWire->PushButton1->setDown(true); + GroupWire->LineEdit1->setEnabled(true); + GroupPoints->hide(); + GroupWire->show(); + break; + } + } + + qApp->processEvents(); + updateGeometry(); + resize( minimumSizeHint() ); + SelectionIntoArgument(); +} + //================================================================================= // function : SelectionIntoArgument() // purpose : Called when selection is changed or on dialog initialization or activation @@ -161,38 +238,67 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument() aSelMgr->selectedObjects(aSelList); if (aSelList.Extent() != 1) { - if (myEditCurrentArgument == GroupPoints->LineEdit1) - myOkPoint1 = false; - else if (myEditCurrentArgument == GroupPoints->LineEdit2) - myOkPoint2 = false; + if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint1 = GEOM::GEOM_Object::_nil(); + else if (myEditCurrentArgument == GroupPoints->LineEdit2) myPoint2 = GEOM::GEOM_Object::_nil(); + else if (myEditCurrentArgument == GroupWire->LineEdit1) myWire = GEOM::GEOM_Object::_nil(); + displayPreview(); return; } // nbSel == 1 Standard_Boolean testResult = Standard_False; GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult); - if (!testResult || aSelectedObject->_is_nil()) - return; - myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject)); + if ( testResult && !aSelectedObject->_is_nil() ) { + QString aName = GEOMBase::GetName( aSelectedObject ); + TopAbs_ShapeEnum aNeedType = myEditCurrentArgument == GroupWire->LineEdit1 ? TopAbs_WIRE : TopAbs_VERTEX; - // clear selection - disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); - myGeomGUI->getApp()->selectionMgr()->clearSelected(); - connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(SelectionIntoArgument())); + TopoDS_Shape aShape; + if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) { + TColStd_IndexedMapOfInteger aMap; + aSelMgr->GetIndexes( aSelList.First(), aMap ); + if ( aMap.Extent() == 1 ) { // Local Selection + int anIndex = aMap( 1 ); + aName += ( aNeedType == TopAbs_WIRE ? QString( ":wire_%1" ).arg( anIndex ) : QString( ":vertex_%1" ).arg( anIndex ) ); - if (myEditCurrentArgument == GroupPoints->LineEdit1) { - myPoint1 = aSelectedObject; - myOkPoint1 = true; - if (!myOkPoint2) - GroupPoints->PushButton2->click(); - } - else if (myEditCurrentArgument == GroupPoints->LineEdit2) { - myPoint2 = aSelectedObject; - myOkPoint2 = true; - if (!myOkPoint1) - GroupPoints->PushButton1->click(); + //Find SubShape Object in Father + GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName ); + if ( CORBA::is_nil( aFindedObject ) ) { // Object not found in study + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); + aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex ); + } + else { + aSelectedObject = aFindedObject; // get Object from study + } + } + else { // Global Selection + if ( aShape.ShapeType() != aNeedType ) { + aSelectedObject = GEOM::GEOM_Object::_nil(); + aName = ""; + } + } + } + + myEditCurrentArgument->setText( aName ); + + if (!aSelectedObject->_is_nil()) { // clear selection if something selected + globalSelection(); + localSelection( GEOM::GEOM_Object::_nil(), aNeedType ); + } + + if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { + myPoint1 = aSelectedObject; + if ( !myPoint1->_is_nil() && myPoint2->_is_nil() ) + GroupPoints->PushButton2->click(); + } + else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) { + myPoint2 = aSelectedObject; + if ( !myPoint2->_is_nil() && myPoint1->_is_nil() ) + GroupPoints->PushButton1->click(); + } + else if ( myEditCurrentArgument == GroupWire->LineEdit1 ) { + myWire = aSelectedObject; + } } displayPreview(); @@ -205,7 +311,6 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument() void BuildGUI_EdgeDlg::SetEditCurrentArgument() { QPushButton* send = (QPushButton*)sender(); - //globalSelection();//?? if (send == GroupPoints->PushButton1) { myEditCurrentArgument = GroupPoints->LineEdit1; @@ -217,19 +322,14 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument() GroupPoints->PushButton1->setDown(false); GroupPoints->LineEdit1->setEnabled(false); } + else if (send == GroupWire->PushButton1) { + myEditCurrentArgument = GroupWire->LineEdit1; + } // enable line edit myEditCurrentArgument->setEnabled(true); myEditCurrentArgument->setFocus(); - // after setFocus(), because it will be setDown(false) when loses focus send->setDown(true); - - disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); - globalSelection(GEOM_POINT); - connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(SelectionIntoArgument())); - - // seems we need it only to avoid preview disappearing, caused by selection mode change displayPreview(); } @@ -240,7 +340,7 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument() void BuildGUI_EdgeDlg::LineEditReturnPressed() { QLineEdit* send = (QLineEdit*)sender(); - if (send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2) { + if (send == GroupPoints->LineEdit1 || send == GroupPoints->LineEdit2 || send == GroupWire->LineEdit1 ) { myEditCurrentArgument = send; GEOMBase_Skeleton::LineEditReturnPressed(); } @@ -257,7 +357,7 @@ void BuildGUI_EdgeDlg::ActivateThisDialog() connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - displayPreview(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= @@ -283,9 +383,18 @@ GEOM::GEOM_IOperations_ptr BuildGUI_EdgeDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool BuildGUI_EdgeDlg::isValid (QString&) +bool BuildGUI_EdgeDlg::isValid (QString& msg) { - return myOkPoint1 && myOkPoint2; + bool ok = false; + if ( getConstructorId() == 0 ) { + ok = !myPoint1->_is_nil() && !myPoint2->_is_nil(); + } + else { + ok = !myWire->_is_nil(); + ok = ok && GroupWire->SpinBox_DX->isValid( msg, !IsPreview() ); + ok = ok && GroupWire->SpinBox_DY->isValid( msg, !IsPreview() ); + } + return ok; } //================================================================================= @@ -294,11 +403,57 @@ bool BuildGUI_EdgeDlg::isValid (QString&) //================================================================================= bool BuildGUI_EdgeDlg::execute (ObjectList& objects) { + bool res = false; + GEOM::GEOM_Object_var anObj; + GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() ); - GEOM::GEOM_Object_var anObj = anOper->MakeEdge(myPoint1, myPoint2); - if (!anObj->_is_nil()) - objects.push_back(anObj._retn()); + switch ( getConstructorId() ) { + case 0 : + { + anObj = anOper->MakeEdge( myPoint1, myPoint2 ); + res = true; + break; + } + case 1: + { + double aLinearTolerance = GroupWire->SpinBox_DX->value(); + double anAngularTolerance = GroupWire->SpinBox_DY->value(); + + QStringList aParameters; + aParameters << GroupWire->SpinBox_DX->text(); + aParameters << GroupWire->SpinBox_DY->text(); + + anObj = anOper->MakeEdgeWire( myWire, aLinearTolerance, anAngularTolerance ); + + if ( !anObj->_is_nil() && !IsPreview() ) + anObj->SetParameters( aParameters.join(":").toLatin1().constData() ); + + res = true; + break; + } + } - return true; + if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() ); + + return res; +} + +//================================================================================= +// function : addSubshapeToStudy +// purpose : virtual method to add new SubObjects if local selection +//================================================================================= +void BuildGUI_EdgeDlg::addSubshapesToStudy() +{ + QMap objMap; + switch ( getConstructorId() ) { + case 0 : + objMap[GroupPoints->LineEdit1->text()] = myPoint1; + objMap[GroupPoints->LineEdit2->text()] = myPoint2; + break; + case 1 : + objMap[GroupWire->LineEdit1->text()] = myWire; + break; + } + addSubshapesToFather( objMap ); } diff --git a/src/BuildGUI/BuildGUI_EdgeDlg.h b/src/BuildGUI/BuildGUI_EdgeDlg.h index 1f95ea865..f6e09236f 100644 --- a/src/BuildGUI/BuildGUI_EdgeDlg.h +++ b/src/BuildGUI/BuildGUI_EdgeDlg.h @@ -29,6 +29,7 @@ #include +class DlgRef_1Sel2Spin; class DlgRef_2Sel; //================================================================================= @@ -48,19 +49,21 @@ protected: virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); + virtual void addSubshapesToStudy(); private: void Init(); void enterEvent( QEvent* ); private: - GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the edge */ - bool myOkPoint1; /* true when myPoint is defined */ - bool myOkPoint2; + GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the edge */ + GEOM::GEOM_Object_var myWire; /* Wire */ DlgRef_2Sel* GroupPoints; + DlgRef_1Sel2Spin* GroupWire; private slots: + void ConstructorsClicked( int ); void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); diff --git a/src/BuildGUI/BuildGUI_SolidDlg.cxx b/src/BuildGUI/BuildGUI_SolidDlg.cxx index 05814b272..4f29cfcff 100644 --- a/src/BuildGUI/BuildGUI_SolidDlg.cxx +++ b/src/BuildGUI/BuildGUI_SolidDlg.cxx @@ -117,6 +117,7 @@ void BuildGUI_SolidDlg::Init() SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); initName( tr( "GEOM_SOLID" ) ); + SelectionIntoArgument(); } diff --git a/src/BuildGUI/BuildGUI_WireDlg.cxx b/src/BuildGUI/BuildGUI_WireDlg.cxx index 5ecf3efb2..a769ce1c1 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.cxx +++ b/src/BuildGUI/BuildGUI_WireDlg.cxx @@ -36,8 +36,11 @@ #include #include #include +#include #include +#include +#include #include //================================================================================= @@ -63,8 +66,14 @@ BuildGUI_WireDlg::BuildGUI_WireDlg( GeometryGUI* theGeometryGUI, QWidget* parent mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); mainFrame()->RadioButton3->close(); - GroupArgs = new DlgRef_1Sel1Spin( centralWidget() ); + GroupType = new DlgRef_3Radio( centralWidget() ); + GroupType->GroupBox1->setTitle( tr( "GEOM_OBJECT_TYPE" ) ); + GroupType->RadioButton1->setText( tr( "GEOM_EDGE" ) ); + GroupType->RadioButton2->setText( tr( "GEOM_WIRE" ) ); + GroupType->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); + GroupType->RadioButton3->close(); + GroupArgs = new DlgRef_1Sel1Spin( centralWidget() ); GroupArgs->GroupBox1->setTitle( tr( "GEOM_WIRE_CONNECT" ) ); GroupArgs->TextLabel1->setText( tr( "GEOM_OBJECTS" ) ); GroupArgs->PushButton1->setIcon( image1 ); @@ -78,6 +87,7 @@ BuildGUI_WireDlg::BuildGUI_WireDlg( GeometryGUI* theGeometryGUI, QWidget* parent QVBoxLayout* layout = new QVBoxLayout( centralWidget() ); layout->setMargin( 0 ); layout->setSpacing( 6 ); + layout->addWidget( GroupType ); layout->addWidget( GroupArgs ); /***************************************************************/ @@ -107,13 +117,11 @@ void BuildGUI_WireDlg::Init() /* init variables */ myEditCurrentArgument = GroupArgs->LineEdit1; GroupArgs->LineEdit1->setReadOnly( true ); + GroupType->RadioButton1->setChecked(true); myOkEdgesAndWires = false; - TColStd_MapOfInteger aMap; - aMap.Add( GEOM_WIRE ); - aMap.Add( GEOM_EDGE ); - globalSelection( aMap ); + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE ); /* signals and slots connections */ connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); @@ -121,6 +129,12 @@ void BuildGUI_WireDlg::Init() connect( GroupArgs->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ); connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); + + connect( GroupType->RadioButton1, SIGNAL( clicked() ), this, SLOT( TypeButtonClicked() ) ); + connect( GroupType->RadioButton2, SIGNAL( clicked() ), this, SLOT( TypeButtonClicked() ) ); + + connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ); + connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) ); initName( tr( "GEOM_WIRE" ) ); SelectionIntoArgument(); @@ -144,13 +158,36 @@ void BuildGUI_WireDlg::ClickOnOk() //================================================================================= bool BuildGUI_WireDlg::ClickOnApply() { - if ( !onAccept() ) + if ( !onAccept() || !myOkEdgesAndWires ) return false; initName(); + TypeButtonClicked(); + myMapToStudy.clear(); + myEdgesAndWires.length(0); + myOkEdgesAndWires = false; + myEditCurrentArgument->setText( "" ); return true; } +//================================================================================= +// function : TypeBittonClicked() +// purpose : Radio button management +//================================================================================= +void BuildGUI_WireDlg::TypeButtonClicked() +{ + if ( GroupType->RadioButton1->isChecked() ) { + globalSelection(); // close local contexts, if any + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE ); + GroupArgs->TextLabel1->setText( tr( "GEOM_EDGE" ) ); + } + else if ( GroupType->RadioButton2->isChecked() ) { + globalSelection(); // close local contexts, if any + localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE ); + GroupArgs->TextLabel1->setText( tr( "GEOM_WIRE" ) ); + } + SelectionIntoArgument(); +} //================================================================================= // function : SelectionIntoArgument() @@ -168,14 +205,71 @@ void BuildGUI_WireDlg::SelectionIntoArgument() myOkEdgesAndWires = false; int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString); - if ( nbSel == 0 ) + if ( nbSel == 0 ) { + myMapToStudy.clear(); return; - if ( nbSel != 1 ) - aString = tr( "%1_objects" ).arg( nbSel ); + } - GEOMBase::ConvertListOfIOInListOfGO(aSelList, myEdgesAndWires); - if ( !myEdgesAndWires.length() ) - return; + TopAbs_ShapeEnum aNeedType = TopAbs_EDGE; + if (GroupType->RadioButton2->isChecked()) + aNeedType = TopAbs_WIRE; + + std::list aList; // subshapes list + TopoDS_Shape aShape; + Standard_Boolean aRes = Standard_False; + for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) { + TColStd_IndexedMapOfInteger aMap; + GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes ); + if ( !CORBA::is_nil(aSelectedObject) && aRes && GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) { + aSelMgr->GetIndexes( anIt.Value(), aMap ); + + if ( aMap.Extent() > 0 ) { // local selection + for (int ind = 1; ind <= aMap.Extent(); ind++) { + aString = aSelectedObject->GetName(); + int anIndex = aMap(ind); + if ( aNeedType == TopAbs_EDGE ) + aString += QString( ":edge_%1" ).arg( anIndex ); + else + aString += QString( ":wire_%1" ).arg( anIndex ); + + //Find SubShape Object in Father + GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aString ); + + if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); + aList.push_back( aShapesOp->GetSubShape( aSelectedObject, anIndex ) ); + myMapToStudy[aString] = aShapesOp->GetSubShape( aSelectedObject, anIndex ); + } + else { + aList.push_back( aFindedObject ); // get Object from study + } + } + } else { // global selection + if ( aShape.ShapeType() == aNeedType ) { + GEOMBase::ConvertListOfIOInListOfGO(aSelList, myEdgesAndWires); + } else { + aList.clear(); + myEdgesAndWires.length(0); + } + } + } + } + + // convert aList in listofgo + if ( aList.size() ) { + myEdgesAndWires.length( aList.size() ); + int k = 0; + for ( std::list::iterator j = aList.begin(); j != aList.end(); j++ ) + myEdgesAndWires[k++] = *j; + } + + if ( myEdgesAndWires.length() > 1 ) + aString = tr( "%1_objects" ).arg( myEdgesAndWires.length() ); + + if ( !myEdgesAndWires.length() ) { + aString = ""; + myMapToStudy.clear(); + } myEditCurrentArgument->setText( aString ); myOkEdgesAndWires = true; @@ -192,10 +286,7 @@ void BuildGUI_WireDlg::SetEditCurrentArgument() if ( send != GroupArgs->PushButton1 ) return; - TColStd_MapOfInteger aMap; - aMap.Add( GEOM_WIRE ); - aMap.Add( GEOM_EDGE ); - globalSelection( aMap ); + TypeButtonClicked(); myEditCurrentArgument = GroupArgs->LineEdit1; myEditCurrentArgument->setFocus(); @@ -212,12 +303,18 @@ void BuildGUI_WireDlg::ActivateThisDialog() GEOMBase_Skeleton::ActivateThisDialog(); connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - TColStd_MapOfInteger aMap; - aMap.Add( GEOM_WIRE ); - aMap.Add( GEOM_EDGE ); - globalSelection( aMap ); + + TypeButtonClicked(); } +//================================================================================= +// function : DeactivateActiveDialog() +// purpose : public slot to deactivate if active +//================================================================================= +void BuildGUI_WireDlg::DeactivateActiveDialog() +{ + GEOMBase_Skeleton::DeactivateActiveDialog(); +} //================================================================================= // function : enterEvent() @@ -262,3 +359,12 @@ bool BuildGUI_WireDlg::execute (ObjectList& objects) return true; } + +//================================================================================= +// function : addSubshapeToStudy +// purpose : virtual method to add new SubObjects if local selection +//================================================================================= +void BuildGUI_WireDlg::addSubshapesToStudy() +{ + addSubshapesToFather( myMapToStudy ); +} diff --git a/src/BuildGUI/BuildGUI_WireDlg.h b/src/BuildGUI/BuildGUI_WireDlg.h index d34966921..2ebe55958 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.h +++ b/src/BuildGUI/BuildGUI_WireDlg.h @@ -30,6 +30,7 @@ #include class DlgRef_1Sel1Spin; +class DlgRef_3Radio; //================================================================================= // class : BuildGUI_WireDlg @@ -47,7 +48,8 @@ protected: // redefined from GEOMBase_Helper virtual GEOM::GEOM_IOperations_ptr createOperation(); virtual bool isValid( QString& ); - virtual bool execute( ObjectList& ); + virtual bool execute( ObjectList& ); + virtual void addSubshapesToStudy(); private: void Init(); @@ -58,13 +60,18 @@ private: bool myOkEdgesAndWires; /* to check when arguments is defined */ DlgRef_1Sel1Spin* GroupArgs; + DlgRef_3Radio* GroupType; + + QMap myMapToStudy; private slots: void ClickOnOk(); bool ClickOnApply(); void ActivateThisDialog(); + void DeactivateActiveDialog(); void SelectionIntoArgument(); void SetEditCurrentArgument(); + void TypeButtonClicked(); }; #endif // BUILDGUI_WIREDLG_H diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index 7d131f0eb..d77481e8f 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -342,6 +342,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); aView->SetDisplayMode( mode ); + GeometryGUI::Modified(); } else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); @@ -363,6 +364,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) } ic->SetDisplayMode( newmode, Standard_False ); + GeometryGUI::Modified(); } } @@ -413,6 +415,7 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow ) } } } + GeometryGUI::Modified(); } else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { viewWindow->setCustomData( "VectorsMode", QVariant( mode ) ); @@ -433,6 +436,7 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow ) } ite.Next(); } + GeometryGUI::Modified(); } } @@ -504,6 +508,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow } } aView->Repaint(); + GeometryGUI::Modified(); } else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); @@ -534,6 +539,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow } } ic->UpdateCurrentViewer(); + GeometryGUI::Modified(); } } diff --git a/src/DlgRef/DlgRef.cxx b/src/DlgRef/DlgRef.cxx index d3a0bc5ec..1ff6c6b87 100644 --- a/src/DlgRef/DlgRef.cxx +++ b/src/DlgRef/DlgRef.cxx @@ -288,6 +288,20 @@ DlgRef_2Sel1List1Check::~DlgRef_2Sel1List1Check() { } +////////////////////////////////////////// +// DlgRef_2Sel1List2Check +////////////////////////////////////////// + +DlgRef_2Sel1List2Check::DlgRef_2Sel1List2Check( QWidget* parent, Qt::WindowFlags f ) +: QWidget( parent, f ) +{ + setupUi( this ); +} + +DlgRef_2Sel1List2Check::~DlgRef_2Sel1List2Check() +{ +} + ////////////////////////////////////////// // DlgRef_2Sel1List ////////////////////////////////////////// @@ -781,13 +795,12 @@ QString DlgRef::PrintDoubleValue( double theValue, int thePrecision ) if ( qAbs(theValue) < prec ) return "0"; - QString aRes; - aRes.setNum( theValue, 'g', thePrecision ); + QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( thePrecision ) ); if ( prec > 0 ) { int p = 0; while ( p < thePrecision ) { - aRes.setNum( theValue, 'g', p++ ); + QString aRes = QLocale().toString( theValue, thePrecision >= 0 ? 'f' : 'g', qAbs( p++ ) ); double v = aRes.toDouble(); double err = qAbs( theValue - v ); if ( err > 0 && err <= prec ) @@ -796,21 +809,19 @@ QString DlgRef::PrintDoubleValue( double theValue, int thePrecision ) } // remove trailing zeroes - QString delim( "." ); - int idx = aRes.lastIndexOf( delim ); - if ( idx == -1 ) - return aRes; + QRegExp expre( QString( "(%1|%2)[+-]?[0-9]+$" ).arg( QLocale().exponential().toLower(), + QLocale().exponential().toUpper() ) ); - QString iPart = aRes.left( idx ); - QString fPart = aRes.mid( idx + 1 ); + int idx = aRes.indexOf( expre ); + QString aResExp = ""; + if ( idx >= 0 ) { + aResExp = aRes.mid( idx ); + aRes = aRes.left( idx ); + } - while ( !fPart.isEmpty() && fPart.at( fPart.length() - 1 ) == '0' ) - fPart.remove( fPart.length() - 1, 1 ); + if ( aRes.contains( QLocale().decimalPoint() ) ) + aRes.remove( QRegExp( QString( "(\\%1|0)0*$" ).arg( QLocale().decimalPoint() ) ) ); - aRes = iPart; - if ( !fPart.isEmpty() ) - aRes += delim + fPart; - - return aRes; + return aRes == "-0" ? QString( "0" ) : aRes + aResExp; } diff --git a/src/DlgRef/DlgRef.h b/src/DlgRef/DlgRef.h index 642aba629..a7b31a945 100644 --- a/src/DlgRef/DlgRef.h +++ b/src/DlgRef/DlgRef.h @@ -339,6 +339,22 @@ public: ~DlgRef_2Sel1List1Check(); }; +////////////////////////////////////////// +// DlgRef_2Sel1List2Check +////////////////////////////////////////// + +#include "ui_DlgRef_2Sel1List2Check_QTD.h" + +class DLGREF_EXPORT DlgRef_2Sel1List2Check : public QWidget, + public Ui::DlgRef_2Sel1List2Check_QTD +{ + Q_OBJECT + +public: + DlgRef_2Sel1List2Check( QWidget* = 0, Qt::WindowFlags = 0 ); + ~DlgRef_2Sel1List2Check(); +}; + ////////////////////////////////////////// // DlgRef_2Sel1List ////////////////////////////////////////// diff --git a/src/DlgRef/DlgRef_2Sel1List2Check_QTD.ui b/src/DlgRef/DlgRef_2Sel1List2Check_QTD.ui new file mode 100644 index 000000000..8cc018c02 --- /dev/null +++ b/src/DlgRef/DlgRef_2Sel1List2Check_QTD.ui @@ -0,0 +1,151 @@ + + + DlgRef_2Sel1List2Check_QTD + + + + 0 + 0 + 127 + 140 + + + + + + + + 0 + + + 0 + + + + + + + + + + + + 0 + 0 + + + + TL1 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + 0 + + + + TL2 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + 0 + + + + TL3 + + + false + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + qPixmapFromMimeSource + + PushButton1 + LineEdit1 + PushButton2 + LineEdit2 + ComboBox1 + CheckButton1 + CheckButton2 + + + + diff --git a/src/DlgRef/Makefile.am b/src/DlgRef/Makefile.am index 0aadfc72d..f7af410b2 100644 --- a/src/DlgRef/Makefile.am +++ b/src/DlgRef/Makefile.am @@ -55,6 +55,7 @@ UIC_FILES = \ ui_DlgRef_1SelExt_QTD.h \ ui_DlgRef_1Spin_QTD.h \ ui_DlgRef_2Sel1List1Check_QTD.h \ + ui_DlgRef_2Sel1List2Check_QTD.h \ ui_DlgRef_2Sel1List_QTD.h \ ui_DlgRef_2Sel1Spin2Check_QTD.h \ ui_DlgRef_2Sel1Spin_QTD.h \ diff --git a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx index cd93e922e..43e6e8981 100755 --- a/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_3DSketcherDlg.cxx @@ -39,14 +39,17 @@ #include #include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include #include -#include -#include +//#include +//#include +#include +#include +#include class Locker { @@ -596,13 +599,48 @@ void EntityGUI_3DSketcherDlg::displayPreview( GEOM::GEOM_Object_ptr object, // Function : createShapes // Purpose : Create applyed wire, and last segment from entry object //================================================================ -bool EntityGUI_3DSketcherDlg::createShapes( GEOM::GEOM_Object_ptr theObject, +bool EntityGUI_3DSketcherDlg::createShapes( GEOM::GEOM_Object_ptr /*theObject*/, TopoDS_Shape& theApplyedWire, TopoDS_Shape& theLastSegment ) { + QList points; + foreach( XYZ xyz, myPointsList) { + gp_Pnt p(xyz.x, xyz.y, xyz.z); + if ( points.isEmpty() || points.last().Distance(p) > gp::Resolution()) + points << p; + } + + if ( points.count() == 1 ) { + // only one point is created + BRepBuilderAPI_MakeVertex mkVertex (points.last()); + theApplyedWire = mkVertex.Shape(); + } + else if ( points.count() > 1 ) { + // wire is created + BRepBuilderAPI_MakePolygon mkWire; + foreach( gp_Pnt p, points ) + mkWire.Add(p); + theApplyedWire = mkWire.Shape(); + } + + XYZ curxyz = getCurrentPoint(); + gp_Pnt curpnt(curxyz.x, curxyz.y, curxyz.z); + + if ( points.isEmpty() || points.last().Distance(curpnt) <= gp::Resolution() ) { + BRepBuilderAPI_MakeVertex mkVertex (curpnt); + theLastSegment = mkVertex.Shape(); + } + else { + BRepBuilderAPI_MakeEdge mkEdge(points.last(), curpnt); + theLastSegment = mkEdge.Shape(); + } + + /* VSR: old algorithm does not work properly, see bug 0020899 TopoDS_Shape aShape; - if ( !GEOMBase::GetShape( theObject, aShape ) || - aShape.ShapeType() != TopAbs_WIRE && aShape.ShapeType() != TopAbs_VERTEX ) + if ( !GEOMBase::GetShape( theObject, aShape ) ) + return false; + + if( aShape.ShapeType() != TopAbs_WIRE && aShape.ShapeType() != TopAbs_VERTEX ) return false; theApplyedWire = aShape; @@ -628,7 +666,8 @@ bool EntityGUI_3DSketcherDlg::createShapes( GEOM::GEOM_Object_ptr theObject, else if ( !theLastSegment.IsNull() ) { TopExp_Explorer vertexExp( theLastSegment, TopAbs_VERTEX ); theApplyedWire = vertexExp.Current(); - } + } + */ return true; } diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index 8af4d0d69..0400c1a4a 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -1454,7 +1454,7 @@ void EntityGUI_SketcherDlg::ActivateThisDialog() //================================================================================= void EntityGUI_SketcherDlg::enterEvent( QEvent* ) { - if ( !MainWidget->GroupConstructors->isEnabled() ) + if ( !isEnabled() ) ActivateThisDialog(); } diff --git a/src/GEOM/GEOM_Engine.cxx b/src/GEOM/GEOM_Engine.cxx index 60a5e7da7..f3607e52f 100644 --- a/src/GEOM/GEOM_Engine.cxx +++ b/src/GEOM/GEOM_Engine.cxx @@ -189,10 +189,12 @@ GEOM_Engine::GEOM_Engine() GEOM_Engine::~GEOM_Engine() { GEOM_DataMapIteratorOfDataMapOfAsciiStringTransient It(_objects); + std::list< Handle(GEOM_Object) > objs; for(; It.More(); It.Next()) - { - RemoveObject(Handle(GEOM_Object)::DownCast(It.Value())); - } + objs.push_back( Handle(GEOM_Object)::DownCast(It.Value()) ); + std::list< Handle(GEOM_Object) >::iterator objit; + for(objit = objs.begin(); objit != objs.end(); ++objit) + RemoveObject(*objit); //Close all documents not closed for(Interface_DataMapIteratorOfDataMapOfIntegerTransient anItr(_mapIDDocument); anItr.More(); anItr.Next()) @@ -310,7 +312,7 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape, Handle(TColStd_HArray1OfInteger) theIndices, bool isStandaloneOperation) { - if(theMainShape.IsNull() || theIndices.IsNull()) return NULL; + if (theMainShape.IsNull() || theIndices.IsNull()) return NULL; Handle(TDocStd_Document) aDoc = GetDocument(theMainShape->GetDocID()); Handle(TDataStd_TreeNode) aRoot = TDataStd_TreeNode::Set(aDoc->Main()); @@ -319,21 +321,6 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape, // if this label has been freed (object deleted) bool useExisting = false; TDF_Label aChild; - /* - if (!_lastCleared.IsNull()) { - if (_lastCleared.Root() == aDoc->Main().Root()) { - useExisting = true; - aChild = _lastCleared; - // 0020229: if next label exists and is empty, try to reuse it - Standard_Integer aNextTag = aChild.Tag() + 1; - TDF_Label aNextL = aDoc->Main().FindChild(aNextTag, Standard_False); - if (!aNextL.IsNull() && !aNextL.HasAttribute()) - _lastCleared = aNextL; - else - _lastCleared.Nullify(); - } - } - */ int aDocID = theMainShape->GetDocID(); if (_freeLabels.find(aDocID) != _freeLabels.end()) { std::list& aFreeLabels = _freeLabels[aDocID]; @@ -349,10 +336,10 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape, } Handle(GEOM_Function) aMainShape = theMainShape->GetLastFunction(); - Handle(GEOM_Object) anObject = new GEOM_Object(aChild, 28); //28 is SUBSHAPE type + Handle(GEOM_Object) anObject = new GEOM_Object (aChild, 28); //28 is SUBSHAPE type Handle(GEOM_Function) aFunction = anObject->AddFunction(GEOM_Object::GetSubShapeID(), 1); - GEOM_ISubShape aSSI(aFunction); + GEOM_ISubShape aSSI (aFunction); aSSI.SetMainShape(aMainShape); aSSI.SetIndices(theIndices); @@ -372,11 +359,14 @@ Handle(GEOM_Object) GEOM_Engine::AddSubShape(Handle(GEOM_Object) theMainShape, return NULL; } - //Put an object in the map of created objects + // Put an object in the map of created objects TCollection_AsciiString anID = BuildIDFromObject(anObject); - if(_objects.IsBound(anID)) _objects.UnBind(anID); + if (_objects.IsBound(anID)) _objects.UnBind(anID); _objects.Bind(anID, anObject); + // Put this subshape in the list of subshapes of theMainShape + aMainShape->AddSubShapeReference(aFunction); + GEOM::TPythonDump pd (aFunction); if (isStandaloneOperation) { @@ -410,9 +400,19 @@ bool GEOM_Engine::RemoveObject(Handle(GEOM_Object) theObject) TCollection_AsciiString anID = BuildIDFromObject(theObject); if (_objects.IsBound(anID)) _objects.UnBind(anID); + // If subshape, remove it from the list of subshapes of its main shape + if (!theObject->IsMainShape()) { + Handle(GEOM_Function) aFunction = theObject->GetFunction(1); + GEOM_ISubShape aSSI (aFunction); + Handle(GEOM_Function) aMainShape = aSSI.GetMainShape(); + //If main shape is not null, then remove + if(!aMainShape.IsNull()) + aMainShape->RemoveSubShapeReference(aFunction); + } + int nb = theObject->GetNbFunctions(); Handle(TDataStd_TreeNode) aNode; - for (int i = 1; i<=nb; i++) { + for (int i = 1; i <= nb; i++) { Handle(GEOM_Function) aFunction = theObject->GetFunction(i); if (aFunction->GetEntry().FindAttribute(GEOM_Function::GetFunctionTreeID(), aNode)) aNode->Remove(); @@ -627,9 +627,11 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID, for ( ; anEntryToCommand != anEntryToCommandMap.end(); ++anEntryToCommand ) aFuncScript += (char*)anEntryToCommand->second.c_str(); - // PTv, 0020001 add result objects from RestoreSubShapes into ignore list, + // PTv, 0020001 add result objects from RestoreGivenSubShapes into ignore list, // because they will be published during command execution - int indx = anAfterScript.Search( "RestoreSubShapes" ); + int indx = anAfterScript.Search( "RestoreGivenSubShapes" ); + if ( indx == -1 ) + indx = anAfterScript.Search( "RestoreSubShapes" ); if ( indx != -1 ) { TCollection_AsciiString aSubStr = anAfterScript.SubString(1, indx); Handle(TColStd_HSequenceOfInteger) aSeq = FindEntries(aSubStr); @@ -922,9 +924,11 @@ bool ProcessFunction(Handle(GEOM_Function)& theFunction, // 0020001 PTv, check for critical functions, which requier dump of objects if (theIsPublished) { - // currently, there is only one function "RestoreSubShapes", + // currently, there is only one function "RestoreGivenSubShapes", // later this check could be replaced by iterations on list of such functions - if (aDescr.Search( "RestoreSubShapes" ) != -1) + if (aDescr.Search( "RestoreGivenSubShapes" ) != -1) + theIsDumpCollected = true; + else if (aDescr.Search( "RestoreSubShapes" ) != -1) theIsDumpCollected = true; } @@ -935,7 +939,9 @@ bool ProcessFunction(Handle(GEOM_Function)& theFunction, bool isBefore = true; TCollection_AsciiString aSubStr = aDescr.Token("\n\t", i++); while (!aSubStr.IsEmpty()) { - if (isBefore && aSubStr.Search( "RestoreSubShapes" ) == -1) + if (isBefore && + aSubStr.Search( "RestoreGivenSubShapes" ) == -1 && + aSubStr.Search( "RestoreSubShapes" ) == -1) theScript += TCollection_AsciiString("\n\t") + aSubStr; else theAfterScript += TCollection_AsciiString("\n\t") + aSubStr; diff --git a/src/GEOM/GEOM_Function.cxx b/src/GEOM/GEOM_Function.cxx index 3a348fd5e..46da48dfc 100644 --- a/src/GEOM/GEOM_Function.cxx +++ b/src/GEOM/GEOM_Function.cxx @@ -18,7 +18,6 @@ // 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 @@ -43,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -64,6 +64,8 @@ #define RESULT_LABEL 2 #define DESCRIPTION_LABEL 3 #define HISTORY_LABEL 4 +#define SUBSHAPES_LABEL 5 // 0020756: GetGroups +#define NAMING_LABEL 6 // 002020750: Naming during STEP import #define ARGUMENTS _label.FindChild((ARGUMENT_LABEL)) #define ARGUMENT(thePosition) _label.FindChild((ARGUMENT_LABEL)).FindChild((thePosition)) @@ -471,8 +473,8 @@ TCollection_AsciiString GEOM_Function::GetString(int thePosition) void GEOM_Function::SetReference(int thePosition, Handle(GEOM_Function) theReference) { _isDone = false; - if(thePosition <= 0) return; - if(theReference.IsNull()) return; + if (thePosition <= 0) return; + if (theReference.IsNull()) return; TDF_Label anArgLabel = ARGUMENT(thePosition); TDF_Reference::Set(anArgLabel, theReference->GetEntry()); TDataStd_UAttribute::Set(anArgLabel, GetDependencyID()); @@ -670,6 +672,85 @@ void GEOM_Function::GetDependency(TDF_LabelSequence& theSeq) } } +//============================================================================= +/*! + * AddSubShapeReference + */ +//============================================================================= +void GEOM_Function::AddSubShapeReference(Handle(GEOM_Function) theSubShape) +{ + _isDone = false; + + TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL); + + Handle(TDataStd_ExtStringList) aList; + if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) { + aList = new TDataStd_ExtStringList; + aSubShapesLabel.AddAttribute(aList); + } + + TCollection_AsciiString anEntry; + TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry); + aList->Append(anEntry); + + _isDone = true; +} + +//============================================================================= +/*! + * RemoveSubShapeReference + */ +//============================================================================= +void GEOM_Function::RemoveSubShapeReference(Handle(GEOM_Function) theSubShape) +{ + _isDone = false; + + TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL); + + Handle(TDataStd_ExtStringList) aList; + if (aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) { + TCollection_AsciiString anEntry; + TDF_Tool::Entry(theSubShape->GetOwnerEntry(), anEntry); + aList->Remove(anEntry); + } + + _isDone = true; +} + +//============================================================================= +/*! + * HasSubShapeReferences + */ +//============================================================================= +bool GEOM_Function::HasSubShapeReferences() +{ + _isDone = true; + + TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL); + return aSubShapesLabel.IsAttribute(TDataStd_ExtStringList::GetID()); +} + +//============================================================================= +/*! + * GetSubShapeReferences + */ +//============================================================================= +const TDataStd_ListOfExtendedString& GEOM_Function::GetSubShapeReferences() +{ + _isDone = false; + + TDF_Label aSubShapesLabel = _label.FindChild(SUBSHAPES_LABEL); + + Handle(TDataStd_ExtStringList) aList; + if (!aSubShapesLabel.FindAttribute(TDataStd_ExtStringList::GetID(), aList)) { + aList = new TDataStd_ExtStringList; + aSubShapesLabel.AddAttribute(aList); + } + + _isDone = true; + return aList->List(); +} + //============================================================================= /*! * GetHistoryEntry @@ -713,6 +794,16 @@ TDF_Label GEOM_Function::GetArgumentHistoryEntry (const TDF_Label& theArgu return aHistoryCurLabel; } +//============================================================================= +/*! + * GetNamingEntry + */ +//============================================================================= +TDF_Label GEOM_Function::GetNamingEntry (const Standard_Boolean create) +{ + return _label.FindChild(NAMING_LABEL, create); +} + //======================================================================= //function : GEOM_Function_Type_ //purpose : @@ -721,10 +812,9 @@ Standard_EXPORT Handle_Standard_Type& GEOM_Function_Type_() { static Handle_Standard_Type aType1 = STANDARD_TYPE(MMgt_TShared); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(MMgt_TShared); + if (aType1.IsNull()) aType1 = STANDARD_TYPE(MMgt_TShared); static Handle_Standard_Type aType2 = STANDARD_TYPE(Standard_Transient); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient); - + if (aType2.IsNull()) aType2 = STANDARD_TYPE(Standard_Transient); static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL}; static Handle_Standard_Type _aType = new Standard_Type("GEOM_Function", @@ -751,5 +841,5 @@ const Handle(GEOM_Function) Handle(GEOM_Function)::DownCast(const Handle(Standar } } - return _anOtherObject ; + return _anOtherObject; } diff --git a/src/GEOM/GEOM_Function.hxx b/src/GEOM/GEOM_Function.hxx index 4cd9fe3ff..9476ae2e6 100644 --- a/src/GEOM/GEOM_Function.hxx +++ b/src/GEOM/GEOM_Function.hxx @@ -18,7 +18,6 @@ // 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 _GEOM_Function_HeaderFile #define _GEOM_Function_HeaderFile @@ -34,10 +33,10 @@ #endif #ifndef _Handle_MMgt_TShared_HeaderFile #include -#endif +#endif #ifndef _MMgt_TShared_HeaderFile #include -#endif +#endif #ifndef _Standard_GUID_HeaderFile #include #endif @@ -65,31 +64,31 @@ class Handle(MMgt_TShared); class GEOM_Function; #include - +#include Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOM_Function); class Handle(GEOM_Function) : public Handle(MMgt_TShared) { public: - inline void* operator new(size_t,void* anAddress) + inline void* operator new(size_t,void* anAddress) { return anAddress; } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); + inline void* operator new(size_t size) + { + return Standard::Allocate(size); } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); + inline void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); } - Handle(GEOM_Function)():Handle(MMgt_TShared)() {} - Handle(GEOM_Function)(const Handle(GEOM_Function)& aHandle) : Handle(MMgt_TShared)(aHandle) + Handle(GEOM_Function)():Handle(MMgt_TShared)() {} + Handle(GEOM_Function)(const Handle(GEOM_Function)& aHandle) : Handle(MMgt_TShared)(aHandle) { } - Handle(GEOM_Function)(const GEOM_Function* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) + Handle(GEOM_Function)(const GEOM_Function* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) { } @@ -105,18 +104,18 @@ class Handle(GEOM_Function) : public Handle(MMgt_TShared) { return *this; } - GEOM_Function* operator->() + GEOM_Function* operator->() { return (GEOM_Function *)ControlAccess(); } - GEOM_Function* operator->() const + GEOM_Function* operator->() const { return (GEOM_Function *)ControlAccess(); } Standard_EXPORT ~Handle(GEOM_Function)() {}; - + Standard_EXPORT static const Handle(GEOM_Function) DownCast(const Handle(Standard_Transient)& AnObject); }; @@ -125,24 +124,26 @@ class GEOM_Function : public MMgt_TShared public: - inline void* operator new(size_t,void* anAddress) + inline void* operator new(size_t,void* anAddress) { return anAddress; } - inline void* operator new(size_t size) - { - return Standard::Allocate(size); + inline void* operator new(size_t size) + { + return Standard::Allocate(size); } - inline void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); + inline void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); } // Type management // Standard_EXPORT friend Handle_Standard_Type& GEOM_Function_Type_(); - Standard_EXPORT const Handle(Standard_Type)& DynamicType() const { return STANDARD_TYPE(GEOM_Function) ; } - Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOM_Function) == AType || MMgt_TShared::IsKind(AType)); } + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const + { return STANDARD_TYPE(GEOM_Function) ; } + Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const + { return (STANDARD_TYPE(GEOM_Function) == AType || MMgt_TShared::IsKind(AType)); } private: @@ -150,22 +151,22 @@ private: public: - //Returns a GUID for a function tree + //Returns a GUID for a function tree Standard_EXPORT static const Standard_GUID& GetFunctionTreeID(); - //Returns the ID which is associated with a reference to another function + //Returns the ID which is associated with a reference to another function Standard_EXPORT static const Standard_GUID& GetDependencyID(); //Finds and returns a function located on a label theEntry Standard_EXPORT static Handle(GEOM_Function) GetFunction(const TDF_Label& theEntry); - Standard_EXPORT GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& theGUID, int theType); + Standard_EXPORT GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& theGUID, int theType); Standard_EXPORT ~GEOM_Function() {;} Standard_EXPORT TDF_Label GetOwnerEntry(); - //Access to properties + //Access to properties //Returns a result of the function built by the function Driver Standard_EXPORT TopoDS_Shape GetValue(); @@ -177,7 +178,7 @@ public: Standard_EXPORT TDF_Label& GetEntry() { return _label; } //Returns the type of the function - Standard_EXPORT int GetType(); + Standard_EXPORT int GetType(); //Returns a function Driver GUID Standard_EXPORT Standard_GUID GetDriverGUID(); @@ -185,8 +186,8 @@ public: //Returns aPython description of the function Standard_EXPORT TCollection_AsciiString GetDescription(); - //Sets aPython description of the function - Standard_EXPORT void SetDescription(const TCollection_AsciiString& theDescription); + //Sets aPython description of the function + Standard_EXPORT void SetDescription(const TCollection_AsciiString& theDescription); //Access to arguments @@ -206,8 +207,8 @@ public: Standard_EXPORT void SetInteger(int thePosition, int theValue); //Returns an integer argument at position thePosition - Standard_EXPORT int GetInteger(int thePosition); - + Standard_EXPORT int GetInteger(int thePosition); + //Sets an integer array argument at position thePosition Standard_EXPORT void SetIntegerArray(int thePosition, const Handle(TColStd_HArray1OfInteger)& theArray); @@ -221,18 +222,18 @@ public: Standard_EXPORT void SetString(int thePosition, const TCollection_AsciiString& theValue); //Returns a string argument at position thePosition - Standard_EXPORT TCollection_AsciiString GetString(int thePosition); - + Standard_EXPORT TCollection_AsciiString GetString(int thePosition); + //Returns a reference to other function argument at position thePosition - Standard_EXPORT Handle(GEOM_Function) GetReference(int thePosition); + Standard_EXPORT Handle(GEOM_Function) GetReference(int thePosition); //Set an array of ExtendedString Standard_EXPORT void SetStringArray(int thePosition, const Handle(TColStd_HArray1OfExtendedString)& theArray); - + //Returns the array of ExtendedString Standard_EXPORT Handle(TColStd_HArray1OfExtendedString) GetStringArray(int thePosition); - //Returns a GUID for a references tree + //Returns a GUID for a references tree Standard_EXPORT static const Standard_GUID& GetReferencesTreeID(); //Sets a list of references to other function arguments at position thePosition @@ -240,33 +241,41 @@ public: const Handle(TColStd_HSequenceOfTransient)& theRefList); //Returns a list of references to other function arguments at position thePosition - Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetReferenceList (int thePosition); + Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetReferenceList (int thePosition); //Sets a TopoDS_Shape argument at position thePosition //void SetShape(int thePosition, const TopoDS_Shape& theShape); - + //Returns a TopoDS_Shape argument at position thePosition - //TopoDS_Shape GetShape(int thePosition); - - //Returns true if the last method succided + //TopoDS_Shape GetShape(int thePosition); + + //Returns true if the last method succided Standard_EXPORT bool IsDone() { return _isDone; } //Returns a sequence of the external dependencies of this function Standard_EXPORT void GetDependency(TDF_LabelSequence& theSeq); + // Add/Remove/Check/Get subshape references + Standard_EXPORT void AddSubShapeReference (Handle(GEOM_Function) theSubShape); + Standard_EXPORT void RemoveSubShapeReference(Handle(GEOM_Function) theSubShape); + Standard_EXPORT bool HasSubShapeReferences(); + Standard_EXPORT const TDataStd_ListOfExtendedString& GetSubShapeReferences(); + //Returns top label of this function's history tree Standard_EXPORT TDF_Label GetHistoryEntry (const Standard_Boolean create = Standard_True); //Returns history label, corresponding to the label, //on which a reference on argument is stored Standard_EXPORT TDF_Label GetArgumentHistoryEntry (const TDF_Label& theArgumentRefEntry, - const Standard_Boolean create = Standard_True); + const Standard_Boolean create = Standard_True); + + //Returns top label of this function's naming tree + Standard_EXPORT TDF_Label GetNamingEntry (const Standard_Boolean create = Standard_True); private: - - TDF_Label _label; - bool _isDone; + TDF_Label _label; + bool _isDone; }; #endif diff --git a/src/GEOM/GEOM_ISubShape.hxx b/src/GEOM/GEOM_ISubShape.hxx index 96e980918..2f09aa141 100644 --- a/src/GEOM/GEOM_ISubShape.hxx +++ b/src/GEOM/GEOM_ISubShape.hxx @@ -19,18 +19,16 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// NOTE: This is an intreface to a function for the Shapes +// (Wire, Face, Shell, Solid and Compound) creation. -// NOTE: This is an intreface to a function for the Shapes -// (Wire, Face, Shell, Solid and Compound) creation. -// #include "GEOM_Function.hxx" #include "TColStd_HSequenceOfTransient.hxx" #include "TColStd_HArray1OfInteger.hxx" -#define SHAPE_ARG_MAIN_SHAPE 1 -#define SHAPE_ARG_INDICES 2 -#define SHAPE_ARG_SORTED 3 +#define SHAPE_ARG_MAIN_SHAPE 1 +#define SHAPE_ARG_INDICES 2 class GEOM_ISubShape { diff --git a/src/GEOM/Makefile.am b/src/GEOM/Makefile.am index 04216b608..03a5db3c5 100644 --- a/src/GEOM/Makefile.am +++ b/src/GEOM/Makefile.am @@ -73,7 +73,7 @@ libGEOMbasic_la_CPPFLAGS = \ libGEOMbasic_la_LDFLAGS = \ $(CORBA_LIBS) \ - $(KERNEL_LDFLAGS) -lSALOMELocalTrace \ + $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \ $(STDLIB) \ $(CAS_LDPATH) -lTKXSBase \ $(CAS_OCAF) \ diff --git a/src/GEOMAlgo/BlockFix_UnionEdges.cxx b/src/GEOMAlgo/BlockFix_UnionEdges.cxx index 602c3e859..8dd2946b0 100644 --- a/src/GEOMAlgo/BlockFix_UnionEdges.cxx +++ b/src/GEOMAlgo/BlockFix_UnionEdges.cxx @@ -291,9 +291,15 @@ TopoDS_Shape BlockFix_UnionEdges::Perform(const TopoDS_Shape& Shape, TopoDS_Shape aResult = myContext->Apply(Shape); // processing each solid - TopExp_Explorer exps; - for(exps.Init(Shape, TopAbs_SOLID); exps.More(); exps.Next()) { - TopoDS_Solid aSolid = TopoDS::Solid(exps.Current()); + TopAbs_ShapeEnum aType = TopAbs_SOLID; + TopExp_Explorer exps (Shape, aType); + if (!exps.More()) { + aType = TopAbs_SHELL; + exps.Init(Shape, aType); + } + for (; exps.More(); exps.Next()) { + //TopoDS_Solid aSolid = TopoDS::Solid(exps.Current()); + TopoDS_Shape aSolid = exps.Current(); TopTools_IndexedMapOfShape ChangedFaces; @@ -307,21 +313,21 @@ TopoDS_Shape BlockFix_UnionEdges::Perform(const TopoDS_Shape& Shape, // processing each face TopExp_Explorer exp; - for(exp.Init(aRes, TopAbs_FACE); exp.More(); exp.Next()) { + for (exp.Init(aRes, TopAbs_FACE); exp.More(); exp.Next()) { TopoDS_Face aFace = TopoDS::Face(aContext->Apply(exp.Current().Oriented(TopAbs_FORWARD))); TopTools_IndexedDataMapOfShapeListOfShape aMapFacesEdges; - for(TopExp_Explorer expe(aFace,TopAbs_EDGE); expe.More(); expe.Next()) { + for (TopExp_Explorer expe(aFace,TopAbs_EDGE); expe.More(); expe.Next()) { TopoDS_Edge edge = TopoDS::Edge(expe.Current()); - if(!aMapEdgeFaces.Contains(edge)) continue; + if (!aMapEdgeFaces.Contains(edge)) continue; const TopTools_ListOfShape& aList = aMapEdgeFaces.FindFromKey(edge); TopTools_ListIteratorOfListOfShape anIter(aList); - for( ; anIter.More(); anIter.Next()) { + for ( ; anIter.More(); anIter.Next()) { TopoDS_Face face = TopoDS::Face(anIter.Value()); TopoDS_Face face1 = TopoDS::Face(aContext->Apply(anIter.Value())); - if(face1.IsSame(aFace)) continue; - if(aMapFacesEdges.Contains(face)) { + if (face1.IsSame(aFace)) continue; + if (aMapFacesEdges.Contains(face)) { aMapFacesEdges.ChangeFromKey(face).Append(edge); } else { @@ -332,27 +338,27 @@ TopoDS_Shape BlockFix_UnionEdges::Perform(const TopoDS_Shape& Shape, } } - for(Standard_Integer i=1; i<=aMapFacesEdges.Extent(); i++) { + for (Standard_Integer i=1; i<=aMapFacesEdges.Extent(); i++) { const TopTools_ListOfShape& ListEdges = aMapFacesEdges.FindFromIndex(i); TopTools_SequenceOfShape SeqEdges; TopTools_ListIteratorOfListOfShape anIter(ListEdges); - for( ; anIter.More(); anIter.Next()) { + for ( ; anIter.More(); anIter.Next()) { SeqEdges.Append(anIter.Value()); } - if(SeqEdges.Length()==1) continue; + if (SeqEdges.Length()==1) continue; TopoDS_Edge E; - if( MergeEdges(SeqEdges,aFace,Tol,E) ) { + if ( MergeEdges(SeqEdges,aFace,Tol,E) ) { // now we have only one edge - aChain.Value(1) // we have to replace old ListEdges with this new edge aContext->Replace(SeqEdges(1),E); - for(Standard_Integer j=2; j<=SeqEdges.Length(); j++) { + for (Standard_Integer j=2; j<=SeqEdges.Length(); j++) { aContext->Remove(SeqEdges(j)); } TopoDS_Face tmpF = TopoDS::Face(exp.Current()); - if( !ChangedFaces.Contains(tmpF) ) + if ( !ChangedFaces.Contains(tmpF) ) ChangedFaces.Add(tmpF); tmpF = TopoDS::Face(aMapFacesEdges.FindKey(i)); - if( !ChangedFaces.Contains(tmpF) ) + if ( !ChangedFaces.Contains(tmpF) ) ChangedFaces.Add(tmpF); } } @@ -360,7 +366,7 @@ TopoDS_Shape BlockFix_UnionEdges::Perform(const TopoDS_Shape& Shape, } // end processing each face // fix changed faces and replace them in the local context - for(Standard_Integer i=1; i<=ChangedFaces.Extent(); i++) { + for (Standard_Integer i=1; i<=ChangedFaces.Extent(); i++) { TopoDS_Face aFace = TopoDS::Face(aContext->Apply(ChangedFaces.FindKey(i))); Handle(ShapeFix_Face) sff = new ShapeFix_Face(aFace); sff->SetContext(myContext); @@ -371,11 +377,11 @@ TopoDS_Shape BlockFix_UnionEdges::Perform(const TopoDS_Shape& Shape, aContext->Replace(aFace,sff->Face()); } - if(ChangedFaces.Extent()>0) { + if (ChangedFaces.Extent() > 0) { // fix changed shell and replace it in the local context TopoDS_Shape aRes1 = aContext->Apply(aRes); TopExp_Explorer expsh; - for(expsh.Init(aRes1, TopAbs_SHELL); expsh.More(); expsh.Next()) { + for (expsh.Init(aRes1, TopAbs_SHELL); expsh.More(); expsh.Next()) { TopoDS_Shell aShell = TopoDS::Shell(expsh.Current()); Handle(ShapeFix_Shell) sfsh = new ShapeFix_Shell; sfsh->FixFaceOrientation(aShell); diff --git a/src/GEOMAlgo/GEOMAlgo.cdl b/src/GEOMAlgo/GEOMAlgo.cdl index a9349ecab..3d5fadbb9 100755 --- a/src/GEOMAlgo/GEOMAlgo.cdl +++ b/src/GEOMAlgo/GEOMAlgo.cdl @@ -19,12 +19,11 @@ -- -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -- - -- File: GEOMAlgo.cdl -- Created: Sat Dec 04 12:36:22 2004 -- Author: Peter KURNEV -- --- + package GEOMAlgo ---Purpose: @@ -117,7 +116,7 @@ is deferred class Clsf; class ClsfSurf; class ClsfBox; - class FinderShapeOn2; + --class FinderShapeOn2; class PassKeyShapeMapHasher; -- -- classes @@ -131,7 +130,8 @@ is -- gluer class Gluer; class Gluer1; - class GlueAnalyser; + class GlueAnalyser; + class CoupleOfShapes; class PassKey; class PassKeyMapHasher; @@ -146,20 +146,14 @@ is class ShellSolid; class VertexSolid; class SolidSolid; - class FinderShapeOn; + --class FinderShapeOn; -- - class FinderShapeOn1; + --class FinderShapeOn1; class StateCollector; - -- adds - deferred class HAlgo; - deferred class Clsf; - class ClsfSurf; - class ClsfBox; - --modified by NIZNHY-PKV Mon Jan 29 10:27:44 2007f + class ClsfSolid; - --modified by NIZNHY-PKV Mon Jan 29 10:27:46 2007t - class FinderShapeOn2; - class PassKeyShapeMapHasher; +-- class FinderShapeOn2; +-- class PassKeyShapeMapHasher; -- -- Builder/Splitter deferred class BuilderShape; @@ -177,6 +171,7 @@ is class WireSplitter; class WireEdgeSet; class WESCorrector; + class WESScaler; -- -- Pointers -- @@ -243,20 +238,9 @@ is Shape from TopoDS, PassKeyShapeMapHasher from GEOMAlgo); - class DataMapOfShapeShapeSet instantiates - DataMap from TCollection(Shape from TopoDS, - ShapeSet from GEOMAlgo, - ShapeMapHasher from TopTools); - - class DataMapOfShapeReal instantiates - DataMap from TCollection(Shape from TopoDS, - Real from Standard, - ShapeMapHasher from TopTools); - - - class DataMapOfRealListOfShape instantiates - DataMap from TCollection(Real from Standard, - ListOfShape from TopTools, - MapRealHasher from TColStd); + class DataMapOfOrientedShapeShape instantiates + DataMap from TCollection (Shape from TopoDS, + Shape from TopoDS, + OrientedShapeMapHasher from TopTools); end GEOMAlgo; diff --git a/src/GEOMAlgo/GEOMAlgo_Builder.cxx b/src/GEOMAlgo/GEOMAlgo_Builder.cxx index feee863db..6fd871441 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape.hxx new file mode 100644 index 000000000..4c8a9f2a1 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape.hxx @@ -0,0 +1,112 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape_HeaderFile +#define _GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape_HeaderFile + +#ifndef _TCollection_BasicMapIterator_HeaderFile +#include +#endif +#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile +#include +#endif +class Standard_NoSuchObject; +class TopoDS_Shape; +class TopTools_OrientedShapeMapHasher; +class GEOMAlgo_DataMapOfOrientedShapeShape; +class GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape : public TCollection_BasicMapIterator { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape(); + + +Standard_EXPORT GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape(const GEOMAlgo_DataMapOfOrientedShapeShape& aMap); + + +Standard_EXPORT void Initialize(const GEOMAlgo_DataMapOfOrientedShapeShape& aMap) ; + + +Standard_EXPORT const TopoDS_Shape& Key() const; + + +Standard_EXPORT const TopoDS_Shape& Value() const; + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape_0.cxx b/src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape_0.cxx new file mode 100644 index 000000000..e809e4a60 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape_0.cxx @@ -0,0 +1,54 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#include + +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TopTools_OrientedShapeMapHasher_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_DataMapOfOrientedShapeShape_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile +#include +#endif + + +#define TheKey TopoDS_Shape +#define TheKey_hxx +#define TheItem TopoDS_Shape +#define TheItem_hxx +#define Hasher TopTools_OrientedShapeMapHasher +#define Hasher_hxx +#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape +#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_Type_() +#define TCollection_DataMap GEOMAlgo_DataMapOfOrientedShapeShape +#define TCollection_DataMap_hxx +#include + diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx new file mode 100644 index 000000000..529a10bf0 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx @@ -0,0 +1,128 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile +#define _GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile +#include +#endif + +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TCollection_MapNode_HeaderFile +#include +#endif +#ifndef _TCollection_MapNodePtr_HeaderFile +#include +#endif +class TopoDS_Shape; +class TopTools_OrientedShapeMapHasher; +class GEOMAlgo_DataMapOfOrientedShapeShape; +class GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape; + + + +class GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape : public TCollection_MapNode { + +public: + // Methods PUBLIC + // + +GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape(const TopoDS_Shape& K,const TopoDS_Shape& I,const TCollection_MapNodePtr& n); + + TopoDS_Shape& Key() const; + + TopoDS_Shape& Value() const; +//Standard_EXPORT ~GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape(); + + + + + // Type management + // + Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; + //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // +TopoDS_Shape myKey; +TopoDS_Shape myValue; + + +}; + +#define TheKey TopoDS_Shape +#define TheKey_hxx +#define TheItem TopoDS_Shape +#define TheItem_hxx +#define Hasher TopTools_OrientedShapeMapHasher +#define Hasher_hxx +#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape +#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_Type_() +#define TCollection_DataMap GEOMAlgo_DataMapOfOrientedShapeShape +#define TCollection_DataMap_hxx + +#include + +#undef TheKey +#undef TheKey_hxx +#undef TheItem +#undef TheItem_hxx +#undef Hasher +#undef Hasher_hxx +#undef TCollection_DataMapNode +#undef TCollection_DataMapNode_hxx +#undef TCollection_DataMapIterator +#undef TCollection_DataMapIterator_hxx +#undef Handle_TCollection_DataMapNode +#undef TCollection_DataMapNode_Type_ +#undef TCollection_DataMap +#undef TCollection_DataMap_hxx + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_0.cxx b/src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_0.cxx new file mode 100644 index 000000000..d2dd35684 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_0.cxx @@ -0,0 +1,100 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#include + +#ifndef _Standard_TypeMismatch_HeaderFile +#include +#endif + +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TopTools_OrientedShapeMapHasher_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_DataMapOfOrientedShapeShape_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape_HeaderFile +#include +#endif +//GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape::~GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape() {} + + + +Standard_EXPORT Handle_Standard_Type& GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_Type_() +{ + + static Handle_Standard_Type aType1 = STANDARD_TYPE(TCollection_MapNode); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + + + static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = new Standard_Type("GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape", + sizeof(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); + + return _aType; +} + + +// DownCast method +// allow safe downcasting +// +const Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape) Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)::DownCast(const Handle(Standard_Transient)& AnObject) +{ + Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape) _anOtherObject; + + if (!AnObject.IsNull()) { + if (AnObject->IsKind(STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape))) { + _anOtherObject = Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)((Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)&)AnObject); + } + } + + return _anOtherObject ; +} +const Handle(Standard_Type)& GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape::DynamicType() const +{ + return STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape) ; +} +//Standard_Boolean GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape::IsKind(const Handle(Standard_Type)& AType) const +//{ +// return (STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape) == AType || TCollection_MapNode::IsKind(AType)); +//} +//Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape::~Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape() {} +#define TheKey TopoDS_Shape +#define TheKey_hxx +#define TheItem TopoDS_Shape +#define TheItem_hxx +#define Hasher TopTools_OrientedShapeMapHasher +#define Hasher_hxx +#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape +#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_Type_() +#define TCollection_DataMap GEOMAlgo_DataMapOfOrientedShapeShape +#define TCollection_DataMap_hxx +#include + diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfOrientedShapeShape.hxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfOrientedShapeShape.hxx new file mode 100644 index 000000000..f2a0e129b --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfOrientedShapeShape.hxx @@ -0,0 +1,154 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#ifndef _GEOMAlgo_DataMapOfOrientedShapeShape_HeaderFile +#define _GEOMAlgo_DataMapOfOrientedShapeShape_HeaderFile + +#ifndef _TCollection_BasicMap_HeaderFile +#include +#endif +#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile +#include +#endif +#ifndef _Standard_Integer_HeaderFile +#include +#endif +#ifndef _Standard_Boolean_HeaderFile +#include +#endif +class Standard_DomainError; +class Standard_NoSuchObject; +class TopoDS_Shape; +class TopTools_OrientedShapeMapHasher; +class GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape; +class GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class GEOMAlgo_DataMapOfOrientedShapeShape : public TCollection_BasicMap { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + + +Standard_EXPORT GEOMAlgo_DataMapOfOrientedShapeShape(const Standard_Integer NbBuckets = 1); + + +Standard_EXPORT GEOMAlgo_DataMapOfOrientedShapeShape& Assign(const GEOMAlgo_DataMapOfOrientedShapeShape& Other) ; + GEOMAlgo_DataMapOfOrientedShapeShape& operator =(const GEOMAlgo_DataMapOfOrientedShapeShape& Other) +{ + return Assign(Other); +} + + + +Standard_EXPORT void ReSize(const Standard_Integer NbBuckets) ; + + +Standard_EXPORT void Clear() ; +~GEOMAlgo_DataMapOfOrientedShapeShape() +{ + Clear(); +} + + + +Standard_EXPORT Standard_Boolean Bind(const TopoDS_Shape& K,const TopoDS_Shape& I) ; + + +Standard_EXPORT Standard_Boolean IsBound(const TopoDS_Shape& K) const; + + +Standard_EXPORT Standard_Boolean UnBind(const TopoDS_Shape& K) ; + + +Standard_EXPORT const TopoDS_Shape& Find(const TopoDS_Shape& K) const; + const TopoDS_Shape& operator()(const TopoDS_Shape& K) const +{ + return Find(K); +} + + + +Standard_EXPORT TopoDS_Shape& ChangeFind(const TopoDS_Shape& K) ; + TopoDS_Shape& operator()(const TopoDS_Shape& K) +{ + return ChangeFind(K); +} + + + + + + +protected: + + // Methods PROTECTED + // + + + // Fields PROTECTED + // + + +private: + + // Methods PRIVATE + // + + +Standard_EXPORT GEOMAlgo_DataMapOfOrientedShapeShape(const GEOMAlgo_DataMapOfOrientedShapeShape& Other); + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/GEOMAlgo/GEOMAlgo_DataMapOfOrientedShapeShape_0.cxx b/src/GEOMAlgo/GEOMAlgo_DataMapOfOrientedShapeShape_0.cxx new file mode 100644 index 000000000..6d57bbe16 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_DataMapOfOrientedShapeShape_0.cxx @@ -0,0 +1,57 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#include + +#ifndef _Standard_DomainError_HeaderFile +#include +#endif +#ifndef _Standard_NoSuchObject_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _TopTools_OrientedShapeMapHasher_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape_HeaderFile +#include +#endif + + +#define TheKey TopoDS_Shape +#define TheKey_hxx +#define TheItem TopoDS_Shape +#define TheItem_hxx +#define Hasher TopTools_OrientedShapeMapHasher +#define Hasher_hxx +#define TCollection_DataMapNode GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape +#define TCollection_DataMapNode_hxx +#define TCollection_DataMapIterator GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape +#define TCollection_DataMapIterator_hxx +#define Handle_TCollection_DataMapNode Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape +#define TCollection_DataMapNode_Type_() GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_Type_() +#define TCollection_DataMap GEOMAlgo_DataMapOfOrientedShapeShape +#define TCollection_DataMap_hxx +#include + diff --git a/src/GEOMAlgo/GEOMAlgo_Tools.cdl b/src/GEOMAlgo/GEOMAlgo_Tools.cdl index 92beb2e48..e44936b6b 100644 --- a/src/GEOMAlgo/GEOMAlgo_Tools.cdl +++ b/src/GEOMAlgo/GEOMAlgo_Tools.cdl @@ -1,4 +1,4 @@ --- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +-- Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE -- -- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS diff --git a/src/GEOMAlgo/GEOMAlgo_Tools.hxx b/src/GEOMAlgo/GEOMAlgo_Tools.hxx index 50de1a5de..5fe38013e 100644 --- a/src/GEOMAlgo/GEOMAlgo_Tools.hxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools.hxx @@ -1,23 +1,24 @@ -// File generated by CPPExt (Value) +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 1991 - 2000 by -// Matra Datavision SA. All rights reserved. -// -// Copyright (C) 2001 - 2004 by -// Open CASCADE SA. All rights reserved. -// -// This file is part of the Open CASCADE Technology software. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 software may be distributed and/or modified under the terms and -// conditions of the Open CASCADE Public License as defined by Open CASCADE SA -// and appearing in the file LICENSE included in the packaging of this file. -// -// This software is distributed on an "AS IS" basis, without warranty of any -// kind, and Open CASCADE SA hereby disclaims all such warranties, -// including without limitation, any warranties of merchantability, fitness -// for a particular purpose or non-infringement. Please see the License for -// the specific terms and conditions governing rights and limitations under the -// License. #ifndef _GEOMAlgo_Tools_HeaderFile #define _GEOMAlgo_Tools_HeaderFile diff --git a/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx b/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx index c679c32a4..b273ae5fe 100755 --- a/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx @@ -1054,10 +1054,10 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, Standard_Real aT, gp_Pnt& aPF, gp_Dir& aDNF, - IntTools_Context& aCtx) + IntTools_Context& )//aCtx) { Standard_Boolean bReverse; - Standard_Real aT1, aT2, dT, aU, aV; + Standard_Real aT1, aT2, dT;//, aU, aV; gp_Dir aDTT, aDNFT, aDBT; gp_Pnt aPFT, aPFx; Handle(Geom_Curve) aC3D; @@ -1099,7 +1099,7 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, aTS=aGAS.GetType(); if (aTS==GeomAbs_BSplineSurface || aTS==GeomAbs_BezierSurface || - aTS==GeomAbs_Plane) {//modified by NIZNHY-PKV Fri Dec 4 08:23:24 2009ft + aTS==GeomAbs_Plane) { Standard_Real aTolEx, aTolFx, aTol, dUR, dVR, dR; // aTolEx=BRep_Tool::Tolerance(aEx); @@ -1123,6 +1123,8 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, aDNF.Reverse(); } // + //modified by NIZNHY-PKV Wed Sep 22 10:52:54 2010f + /* GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF); // aProjector.Perform(aPFx); @@ -1134,4 +1136,6 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, aDNF.Reverse(); } } + */ + //modified by NIZNHY-PKV Wed Sep 22 10:52:59 2010t } diff --git a/src/GEOMAlgo/GEOMAlgo_Tools_1.cxx b/src/GEOMAlgo/GEOMAlgo_Tools_1.cxx index 992c8af4c..9f1aaf15b 100644 --- a/src/GEOMAlgo/GEOMAlgo_Tools_1.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools_1.cxx @@ -1,9 +1,26 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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: GEOMAlgo_Tools_1.cxx // Created: Thu May 6 10:46:21 2010 // Author: Peter KURNEV // - #include // #include @@ -38,6 +55,7 @@ #include #include #include +#include static inline Standard_Boolean IsEqual(const TopoDS_Shape& aS1, @@ -72,7 +90,7 @@ static const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aF, aLoc); aGAS.Load(aS); aTS=aGAS.GetType(); - if (aTS==GeomAbs_Cylinder) { + if (aTS==GeomAbs_Cylinder || aTS==GeomAbs_Plane) { aItF.Initialize(aF); for (; aItF.More(); aItF.Next()) { const TopoDS_Wire& aW=*((TopoDS_Wire*)&aItF.Value()); diff --git a/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx b/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx index e033ad244..4ee7d7a69 100755 --- a/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx +++ b/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx @@ -19,7 +19,6 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File: NMTAlgo_WESCorrector.cxx // Created: // Author: Peter KURNEV @@ -27,7 +26,11 @@ // #include +#include + +#include #include + #include #include #include @@ -35,6 +38,7 @@ #include #include +#include #include #include @@ -53,12 +57,17 @@ #include #include #include - +#include static void MakeWire(const TopTools_ListOfShape& aLE, TopoDS_Wire& newWire); + +static + Standard_Boolean IsToScale(const TopoDS_Face& aF, + Standard_Real& aScale); + //======================================================================= // function: // purpose: @@ -215,19 +224,21 @@ static aER.Orientation(TopAbs_REVERSED); aLEC.Append(aER); // - //modified by NIZNHY-PKV Tue Nov 28 12:02:29 2006f - //bClosed=BRep_Tool::IsClosed(TopoDS::Edge(aER), myWES->Face()); - //if (!bClosed) { - bRegular=Standard_False; - //} - //modified by NIZNHY-PKV Tue Nov 28 12:02:33 2006t + bRegular=Standard_False; } else { aLEC.Append(aER); } // if (bRegular) { - TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + //modified by NIZNHY-PKV Wed Oct 20 14:45:52 2010f + const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aER); + if (!BRep_Tool::Degenerated(aEx)) { + TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + } + // + //TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + //modified by NIZNHY-PKV Wed Oct 20 14:46:48 2010t } }//for (j=1; j<=aNbC; ++j) { // @@ -266,21 +277,24 @@ static //======================================================================= void GEOMAlgo_WESCorrector::DoCorrections() { - Standard_Boolean bIsRegular, bIsNothingToDo; + Standard_Boolean bIsRegular, bIsNothingToDo, bToScale; Standard_Integer iErr; + Standard_Real aScale; TopoDS_Wire aW; BOP_ListIteratorOfListOfConnexityBlock aCBIt; + GEOMAlgo_WESScaler aWSC; // const TopoDS_Face& aF=myWES->Face(); // + bToScale=IsToScale(aF, aScale); + // myNewWES.SetFace(aF); aCBIt.Initialize(myConnexityBlocks); for (; aCBIt.More(); aCBIt.Next()) { const BOP_ConnexityBlock& aCB=aCBIt.Value(); const TopTools_ListOfShape& aLE=aCB.Shapes(); - + // bIsRegular=aCB.IsRegular(); - if (bIsRegular) { MakeWire(aLE, aW); myNewWES.AddShape (aW); @@ -289,30 +303,84 @@ static // GEOMAlgo_WireSplitter aWS; // - aWS.SetFace(aF); - aWS.SetEdges(aLE); - // - aWS.Perform(); - iErr=aWS.ErrorStatus(); - if (iErr) { - continue; - } - bIsNothingToDo=aWS.IsNothingToDo(); - if (bIsNothingToDo) { - MakeWire(aLE, aW); - myNewWES.AddShape (aW); - continue; - } - // - const BOPTColStd_ListOfListOfShape& aSSS=aWS.Shapes(); - - BOPTColStd_ListIteratorOfListOfListOfShape aWireIt(aSSS); - for (; aWireIt.More(); aWireIt.Next()) { - const TopTools_ListOfShape& aLEx=aWireIt.Value(); + if(bToScale) { + TopoDS_Shape aE; + TopTools_ListIteratorOfListOfShape aIt; + BOPTColStd_ListIteratorOfListOfListOfShape aItLLSS; // - MakeWire(aLEx, aW); - myNewWES.AddShape (aW); - } + aWSC.SetScale(aScale); + aWSC.SetFace(aF); + aWSC.SetEdges(aLE); + // + aWSC.Perform(); + iErr=aWSC.ErrorStatus(); + if (iErr) { + return; + } + // + const TopoDS_Face& aFS=aWSC.FaceScaled(); + const TopTools_ListOfShape& aLES=aWSC.EdgesScaled(); + // + aWS.SetFace(aFS); + aWS.SetEdges(aLES); + // + aWS.Perform(); + iErr=aWS.ErrorStatus(); + if (iErr) { + continue; + } + // + bIsNothingToDo=aWS.IsNothingToDo(); + if (bIsNothingToDo) { + MakeWire(aLE, aW); + myNewWES.AddShape (aW); + continue; + } + // + const BOPTColStd_ListOfListOfShape& aLLSS=aWS.Shapes(); + aItLLSS.Initialize(aLLSS); + for (; aItLLSS.More(); aItLLSS.Next()) { + TopTools_ListOfShape aLS; + // + const TopTools_ListOfShape& aLSS=aItLLSS.Value(); + aIt.Initialize(aLSS); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aES=aIt.Value(); + aE=aWSC.Origin(aES); + aLS.Append(aE); + } + // + MakeWire(aLS, aW); + myNewWES.AddShape (aW); + } + }//if(bToScale) + // + else { + aWS.SetFace(aF); + aWS.SetEdges(aLE); + // + aWS.Perform(); + iErr=aWS.ErrorStatus(); + if (iErr) { + continue; + } + bIsNothingToDo=aWS.IsNothingToDo(); + if (bIsNothingToDo) { + MakeWire(aLE, aW); + myNewWES.AddShape (aW); + continue; + } + // + const BOPTColStd_ListOfListOfShape& aSSS=aWS.Shapes(); + + BOPTColStd_ListIteratorOfListOfListOfShape aWireIt(aSSS); + for (; aWireIt.More(); aWireIt.Next()) { + const TopTools_ListOfShape& aLEx=aWireIt.Value(); + // + MakeWire(aLEx, aW); + myNewWES.AddShape (aW); + } + }// else } } //======================================================================= @@ -331,3 +399,36 @@ static aBB.Add(newWire, aE); } } +// + + +//======================================================================= +//function : IsToScale +//purpose : +//======================================================================= +Standard_Boolean IsToScale(const TopoDS_Face& aF, + Standard_Real& aScale) +{ + Standard_Boolean bRet; + Standard_Real aV1, aV2, dV, aTr; + GeomAbs_SurfaceType aType; + BRepAdaptor_Surface aBAS; + // + bRet=Standard_False; + aScale=1.; + // + aBAS.Initialize(aF); + aType=aBAS.GetType(); + if (aType==GeomAbs_Cylinder) { + aTr=1.e5; + aV1=aBAS.FirstVParameter(); + aV2=aBAS.LastVParameter(); + dV=aV2-aV1; + if (dV>aTr) { + bRet=!bRet; + aScale=1./aTr; + } + } + return bRet; +} + diff --git a/src/GEOMAlgo/GEOMAlgo_WESScaler.cdl b/src/GEOMAlgo/GEOMAlgo_WESScaler.cdl new file mode 100644 index 000000000..fe4cdc0f4 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_WESScaler.cdl @@ -0,0 +1,121 @@ +-- Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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: GEOMAlgo_WESScaler.cdl +-- Created: +-- Author: +-- + + +class WESScaler from GEOMAlgo + inherits Algo from GEOMAlgo + + ---Purpose: + +uses + Face from TopoDS, + Shape from TopoDS, + ListOfShape from TopTools, + DataMapOfOrientedShapeShape from GEOMAlgo, + WireEdgeSet from GEOMAlgo, + PWireEdgeSet from GEOMAlgo + +--raises + +is + Create + ---Purpose: Empty constructor + returns WESScaler from GEOMAlgo; + ---C++: alias "Standard_EXPORT virtual ~GEOMAlgo_WESScaler();" + + SetScale (me:out; + aWES: Real from Standard); + ---Purpose: + -- Modifier + + Scale(me) + returns Real from Standard; + ---Purpose: + -- Selector + + SetFace (me:out; + aF: Face from TopoDS); + + Face (me) + returns Face from TopoDS; + ---C++: return const & + + SetEdges (me:out; + aLE:ListOfShape from TopTools); + + Edges (me) + returns ListOfShape from TopTools; + ---C++: return const & + + Perform(me:out) + ---Purpose: Performs the algorithm + is redefined; + + FaceScaled (me) + returns Face from TopoDS; + ---C++: return const & + + EdgesScaled (me) + returns ListOfShape from TopTools; + ---C++: return const & + + Image(me; + aS:Shape from TopoDS) + returns Shape from TopoDS; + ---C++: return const & + ---Purpose: + + Origin(me; + aS:Shape from TopoDS) + returns Shape from TopoDS; + ---C++: return const & + + ---Purpose: + Images(me) + returns DataMapOfOrientedShapeShape from GEOMAlgo; + ---C++: return const & + ---Purpose: + --- Selector + + Origins(me) + returns DataMapOfOrientedShapeShape from GEOMAlgo; + ---C++: return const & + ---Purpose: + --- Selector + + CheckData(me:out) + ---Purpose: Performs the algorithm + is redefined protected; + +fields + myScale : Real from Standard is protected; + myFace : Face from TopoDS is protected; + + myEdges : ListOfShape from TopTools is protected; + myFaceScaled : Face from TopoDS is protected; + myEdgesScaled : ListOfShape from TopTools is protected; + myImages : DataMapOfOrientedShapeShape from GEOMAlgo is protected; + myOrigins : DataMapOfOrientedShapeShape from GEOMAlgo is protected; + myShapeTmp : Shape from TopoDS is protected; +end WESScaler; + diff --git a/src/GEOMAlgo/GEOMAlgo_WESScaler.cxx b/src/GEOMAlgo/GEOMAlgo_WESScaler.cxx new file mode 100644 index 000000000..a7e283426 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_WESScaler.cxx @@ -0,0 +1,267 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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: GEOMAlgo_WESScaler.cxx +// Created: +// Author: +// + + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + + +//======================================================================= +//function : +//purpose : +//======================================================================= + GEOMAlgo_WESScaler::GEOMAlgo_WESScaler() +: + GEOMAlgo_Algo() +{ + myScale=1.; +} +//======================================================================= +//function : ~ +//purpose : +//======================================================================= + GEOMAlgo_WESScaler::~GEOMAlgo_WESScaler() +{ +} +//======================================================================= +// function: SetScale +// purpose: +//======================================================================= + void GEOMAlgo_WESScaler::SetScale (const Standard_Real aScale) +{ + myScale=aScale; +} +//======================================================================= +// function: Scale +// purpose: +//======================================================================= + Standard_Real GEOMAlgo_WESScaler::Scale()const +{ + return myScale; +} +//======================================================================= +// function: SetFace +// purpose: +//======================================================================= + void GEOMAlgo_WESScaler::SetFace(const TopoDS_Face& aF) +{ + myFace=aF; +} +//======================================================================= +// function: Face +// purpose: +//======================================================================= + const TopoDS_Face& GEOMAlgo_WESScaler::Face()const +{ + return myFace; +} +//======================================================================= +// function: SetEdges +// purpose: +//======================================================================= + void GEOMAlgo_WESScaler::SetEdges(const TopTools_ListOfShape& aLE) +{ + myEdges=aLE; +} +//======================================================================= +// function: Edges +// purpose: +//======================================================================= + const TopTools_ListOfShape& GEOMAlgo_WESScaler::Edges()const +{ + return myEdges; +} +//======================================================================= +// function: FaceScaled +// purpose: +//======================================================================= + const TopoDS_Face& GEOMAlgo_WESScaler::FaceScaled()const +{ + return myFaceScaled; +} +//======================================================================= +// function: EdgesScaled +// purpose: +//======================================================================= + const TopTools_ListOfShape& GEOMAlgo_WESScaler::EdgesScaled()const +{ + return myEdgesScaled; +} +//======================================================================= +// function: Image +// purpose: +//======================================================================= + const TopoDS_Shape& GEOMAlgo_WESScaler::Image (const TopoDS_Shape& aS) const +{ + if (myImages.IsBound(aS)) { + return myImages.Find(aS); + } + return myShapeTmp; +} +//======================================================================= +// function: Origin +// purpose: +//======================================================================= + const TopoDS_Shape& GEOMAlgo_WESScaler::Origin (const TopoDS_Shape& aS) const +{ + if (myOrigins.IsBound(aS)) { + return myOrigins.Find(aS); + } + return myShapeTmp; +} +//======================================================================= +// function: Images +// purpose: +//======================================================================= + const GEOMAlgo_DataMapOfOrientedShapeShape& GEOMAlgo_WESScaler::Images () const +{ + return myImages; +} +//======================================================================= +// function: Origins +// purpose: +//======================================================================= + const GEOMAlgo_DataMapOfOrientedShapeShape& GEOMAlgo_WESScaler::Origins () const +{ + return myOrigins; +} +//======================================================================= +// function: CheckData +// purpose: +//======================================================================= + void GEOMAlgo_WESScaler::CheckData() +{ + myErrorStatus=0; + // + if(myFace.IsNull()) { + myErrorStatus=2; + return; + } + if(!myEdges.Extent()) { + myErrorStatus=3; + return; + } + if (myScale<=0.){ + myErrorStatus=4; + } +} +//======================================================================= +// function: Perform +// purpose: +//======================================================================= + void GEOMAlgo_WESScaler::Perform() +{ + Standard_Boolean bIsDone; + Standard_Integer i; + gp_Pnt aP; + gp_Trsf aTrsf; + TopAbs_Orientation aOr; + TopoDS_Shape aFC, aFR, aER; + TopoDS_Wire aWE; + TopoDS_Iterator aItS; + BRep_Builder aBB; + TopTools_ListIteratorOfListOfShape aIt; + // + // 0. CheckData + CheckData(); + if(myErrorStatus) { + return; + } + // + myImages.Clear(); + myOrigins.Clear(); + myEdgesScaled.Clear(); + // + // 1. aFC + aFC=myFace.EmptyCopied(); + // + aBB.MakeWire(aWE); + aIt.Initialize(myEdges); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE=aIt.Value(); + aBB.Add(aWE, aE); + } + aBB.Add(aFC, aWE); + // + aItS.Initialize(myFace); + for (; aItS.More(); aItS.Next()) { + const TopoDS_Shape& aW=aItS.Value(); + aBB.Add(aFC, aW); + } + // + // 2. Scale aFC + aP.SetCoord(0.,0.,0.); + aTrsf.SetScale(aP, myScale); + // + BRepBuilderAPI_Transform aBT(aTrsf); + aBT.Perform(aFC); + bIsDone=aBT.IsDone(); + if (!bIsDone) { + myErrorStatus=10; + return; + } + // + const TopoDS_Shape& aSR=aBT.Shape(); + // + // Refined image face FR + aFR=aSR.EmptyCopied(); + aItS.Initialize(aSR); + for (i=0; aItS.More(); aItS.Next(),++i) { + const TopoDS_Shape& aWR=aItS.Value(); + if (i) { + aBB.Add(aFR, aWR); + } + } + myFaceScaled=*((TopoDS_Face*)&aFR); + // + // 3. Fill Images, Origins, EdgesScaled + aIt.Initialize(myEdges); + for (; aIt.More(); aIt.Next()) { + const TopoDS_Shape& aE=aIt.Value(); + aOr=aE.Orientation(); + // + aER=aBT.ModifiedShape(aE); + if(aER.IsNull()) { + myErrorStatus=11; + return; + } + // + aER.Orientation(aOr); + myImages.Bind(aE, aER); + myOrigins.Bind(aER, aE); + // + myEdgesScaled.Append(aER); + } +} diff --git a/src/GEOMAlgo/GEOMAlgo_WESScaler.hxx b/src/GEOMAlgo/GEOMAlgo_WESScaler.hxx new file mode 100644 index 000000000..a3f150f93 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_WESScaler.hxx @@ -0,0 +1,166 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#ifndef _GEOMAlgo_WESScaler_HeaderFile +#define _GEOMAlgo_WESScaler_HeaderFile + +#ifndef _Standard_Real_HeaderFile +#include +#endif +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _TopTools_ListOfShape_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_DataMapOfOrientedShapeShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_Algo_HeaderFile +#include +#endif +class TopoDS_Face; +class TopTools_ListOfShape; +class TopoDS_Shape; +class GEOMAlgo_DataMapOfOrientedShapeShape; + + +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + + +class GEOMAlgo_WESScaler : public GEOMAlgo_Algo { + +public: + + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // + +//! Empty constructor
    +Standard_EXPORT GEOMAlgo_WESScaler(); +Standard_EXPORT virtual ~GEOMAlgo_WESScaler(); + + +//! Modifier
    +Standard_EXPORT void SetScale(const Standard_Real aWES) ; + + +//! Selector
    +Standard_EXPORT Standard_Real Scale() const; + + +Standard_EXPORT void SetFace(const TopoDS_Face& aF) ; + + +Standard_EXPORT const TopoDS_Face& Face() const; + + +Standard_EXPORT void SetEdges(const TopTools_ListOfShape& aLE) ; + + +Standard_EXPORT const TopTools_ListOfShape& Edges() const; + +//! Performs the algorithm
    +Standard_EXPORT virtual void Perform() ; + + +Standard_EXPORT const TopoDS_Face& FaceScaled() const; + + +Standard_EXPORT const TopTools_ListOfShape& EdgesScaled() const; + + +Standard_EXPORT const TopoDS_Shape& Image(const TopoDS_Shape& aS) const; + + +Standard_EXPORT const TopoDS_Shape& Origin(const TopoDS_Shape& aS) const; + + +//! Selector
    +Standard_EXPORT const GEOMAlgo_DataMapOfOrientedShapeShape& Images() const; + + +//! Selector
    +Standard_EXPORT const GEOMAlgo_DataMapOfOrientedShapeShape& Origins() const; + + + + + +protected: + + // Methods PROTECTED + // + +//! Performs the algorithm
    +Standard_EXPORT virtual void CheckData() ; + + + // Fields PROTECTED + // +Standard_Real myScale; +TopoDS_Face myFace; +TopTools_ListOfShape myEdges; +TopoDS_Face myFaceScaled; +TopTools_ListOfShape myEdgesScaled; +GEOMAlgo_DataMapOfOrientedShapeShape myImages; +GEOMAlgo_DataMapOfOrientedShapeShape myOrigins; +TopoDS_Shape myShapeTmp; + + +private: + + // Methods PRIVATE + // + + + // Fields PRIVATE + // + + +}; + + + + + +// other Inline functions and methods (like "C++: function call" methods) +// + + +#endif diff --git a/src/GEOMAlgo/GEOMAlgo_WESScaler.ixx b/src/GEOMAlgo/GEOMAlgo_WESScaler.ixx new file mode 100644 index 000000000..1660c5804 --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_WESScaler.ixx @@ -0,0 +1,24 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#include + + + + diff --git a/src/GEOMAlgo/GEOMAlgo_WESScaler.jxx b/src/GEOMAlgo/GEOMAlgo_WESScaler.jxx new file mode 100644 index 000000000..adfba231e --- /dev/null +++ b/src/GEOMAlgo/GEOMAlgo_WESScaler.jxx @@ -0,0 +1,34 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#ifndef _TopoDS_Face_HeaderFile +#include +#endif +#ifndef _TopTools_ListOfShape_HeaderFile +#include +#endif +#ifndef _TopoDS_Shape_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_DataMapOfOrientedShapeShape_HeaderFile +#include +#endif +#ifndef _GEOMAlgo_WESScaler_HeaderFile +#include +#endif diff --git a/src/GEOMAlgo/Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx b/src/GEOMAlgo/Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx new file mode 100644 index 000000000..47455d963 --- /dev/null +++ b/src/GEOMAlgo/Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx @@ -0,0 +1,72 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#ifndef _Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile +#define _Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_HeaderFile + +#ifndef _Standard_Macro_HeaderFile +#include +#endif +#ifndef _Standard_HeaderFile +#include +#endif + +#ifndef _Handle_TCollection_MapNode_HeaderFile +#include +#endif + +class Standard_Transient; +class Handle_Standard_Type; +class Handle(TCollection_MapNode); +class GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape; +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape); + +class Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape) : public Handle(TCollection_MapNode) { + public: + Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)():Handle(TCollection_MapNode)() {} + Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)(const Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)& aHandle) : Handle(TCollection_MapNode)(aHandle) + { + } + + Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)(const GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape* anItem) : Handle(TCollection_MapNode)((TCollection_MapNode *)anItem) + { + } + + Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)& operator=(const Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)& operator=(const GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape* anItem) + { + Assign((Standard_Transient *)anItem); + return *this; + } + + GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape* operator->() const + { + return (GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape *)ControlAccess(); + } + +// Standard_EXPORT ~Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape)(); + + Standard_EXPORT static const Handle(GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape) DownCast(const Handle(Standard_Transient)& AnObject); +}; +#endif diff --git a/src/GEOMAlgo/Makefile.am b/src/GEOMAlgo/Makefile.am index 597d6d5c6..3372a1ed3 100644 --- a/src/GEOMAlgo/Makefile.am +++ b/src/GEOMAlgo/Makefile.am @@ -16,14 +16,14 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # - +# # GEOM GEOMAlgo : tools for Glue Faces algorithm # File : Makefile.in # Author : Julia DOROVSKIKH # Modified by : Alexander BORODIN (OCN) - autotools usage # Module : GEOM # $Header$ -# + include $(top_srcdir)/adm_local/unix/make_common_starter.am # Libraries targets @@ -51,20 +51,27 @@ dist_libGEOMAlgo_la_SOURCES = \ GEOMAlgo_BuilderTools.cxx \ GEOMAlgo_ClsfBox.cxx \ GEOMAlgo_Clsf.cxx \ + GEOMAlgo_ClsfSolid.cxx \ GEOMAlgo_ClsfSurf.cxx \ GEOMAlgo_CoupleOfShapes.cxx \ + GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape_0.cxx \ GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger_0.cxx \ + GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_0.cxx \ GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape_0.cxx \ GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal_0.cxx \ GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet_0.cxx \ + GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape_0.cxx \ GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger_0.cxx \ + GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_0.cxx \ GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape_0.cxx \ GEOMAlgo_DataMapNodeOfDataMapOfShapeReal_0.cxx \ GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet_0.cxx \ - GEOMAlgo_DataMapOfPassKeyInteger_0.cxx \ - GEOMAlgo_DataMapOfRealListOfShape_0.cxx \ - GEOMAlgo_DataMapOfShapeReal_0.cxx \ - GEOMAlgo_DataMapOfShapeShapeSet_0.cxx \ + GEOMAlgo_DataMapOfOrientedShapeShape_0.cxx \ + GEOMAlgo_DataMapOfPassKeyInteger_0.cxx \ + GEOMAlgo_DataMapOfPassKeyShapeShape_0.cxx \ + GEOMAlgo_DataMapOfRealListOfShape_0.cxx \ + GEOMAlgo_DataMapOfShapeReal_0.cxx \ + GEOMAlgo_DataMapOfShapeShapeSet_0.cxx \ GEOMAlgo_FinderShapeOn1.cxx \ GEOMAlgo_FinderShapeOn2.cxx \ GEOMAlgo_FinderShapeOn.cxx \ @@ -76,13 +83,15 @@ dist_libGEOMAlgo_la_SOURCES = \ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfIntegerShape_0.cxx \ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape_0.cxx \ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape_0.cxx \ - GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \ - GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState_0.cxx \ - GEOMAlgo_IndexedDataMapOfIntegerShape_0.cxx \ - GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_0.cxx \ - GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_0.cxx \ - GEOMAlgo_IndexedDataMapOfShapeBox_0.cxx \ - GEOMAlgo_IndexedDataMapOfShapeState_0.cxx \ + GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox_0.cxx \ + GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_0.cxx \ + GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState_0.cxx \ + GEOMAlgo_IndexedDataMapOfIntegerShape_0.cxx \ + GEOMAlgo_IndexedDataMapOfPassKeyListOfShape_0.cxx \ + GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape_0.cxx \ + GEOMAlgo_IndexedDataMapOfShapeBox_0.cxx \ + GEOMAlgo_IndexedDataMapOfShapeShapeInfo_0.cxx \ + GEOMAlgo_IndexedDataMapOfShapeState_0.cxx \ GEOMAlgo_ListIteratorOfListOfCoupleOfShapes_0.cxx \ GEOMAlgo_ListIteratorOfListOfPnt_0.cxx \ GEOMAlgo_ListNodeOfListOfCoupleOfShapes_0.cxx \ @@ -94,6 +103,9 @@ dist_libGEOMAlgo_la_SOURCES = \ GEOMAlgo_PassKeyShape.cxx \ GEOMAlgo_PassKeyShapeMapHasher.cxx \ GEOMAlgo_ShapeAlgo.cxx \ + GEOMAlgo_ShapeInfo.cxx \ + GEOMAlgo_ShapeInfoFiller.cxx \ + GEOMAlgo_ShapeInfoFiller_1.cxx \ GEOMAlgo_ShapeSet.cxx \ GEOMAlgo_ShapeSolid.cxx \ GEOMAlgo_ShellSolid.cxx \ @@ -106,18 +118,10 @@ dist_libGEOMAlgo_la_SOURCES = \ GEOMAlgo_Tools_1.cxx \ GEOMAlgo_VertexSolid.cxx \ GEOMAlgo_WESCorrector.cxx \ + GEOMAlgo_WESScaler.cxx \ GEOMAlgo_WireEdgeSet.cxx \ GEOMAlgo_WireSolid.cxx \ - GEOMAlgo_WireSplitter.cxx \ - GEOMAlgo_ClsfSolid.cxx \ - GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape_0.cxx \ - GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape_0.cxx \ - GEOMAlgo_DataMapOfPassKeyShapeShape_0.cxx \ - GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo_0.cxx \ - GEOMAlgo_ShapeInfoFiller_1.cxx \ - GEOMAlgo_IndexedDataMapOfShapeShapeInfo_0.cxx \ - GEOMAlgo_ShapeInfo.cxx \ - GEOMAlgo_ShapeInfoFiller.cxx + GEOMAlgo_WireSplitter.cxx # header files salomeinclude_HEADERS = \ @@ -173,24 +177,33 @@ salomeinclude_HEADERS = \ GEOMAlgo_Clsf.hxx \ GEOMAlgo_Clsf.ixx \ GEOMAlgo_Clsf.jxx \ + GEOMAlgo_ClsfSolid.hxx \ + GEOMAlgo_ClsfSolid.ixx \ + GEOMAlgo_ClsfSolid.jxx \ GEOMAlgo_ClsfSurf.hxx \ GEOMAlgo_ClsfSurf.ixx \ GEOMAlgo_ClsfSurf.jxx \ GEOMAlgo_CoupleOfShapes.hxx \ GEOMAlgo_CoupleOfShapes.ixx \ GEOMAlgo_CoupleOfShapes.jxx \ - GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx \ - GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx \ - GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx \ - GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx \ + GEOMAlgo_DataMapIteratorOfDataMapOfOrientedShapeShape.hxx \ + GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx \ + GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx \ + GEOMAlgo_DataMapIteratorOfDataMapOfRealListOfShape.hxx \ + GEOMAlgo_DataMapIteratorOfDataMapOfShapeReal.hxx \ + GEOMAlgo_DataMapIteratorOfDataMapOfShapeShapeSet.hxx \ + GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx \ GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx \ + GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx \ GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx \ GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx \ GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx \ - GEOMAlgo_DataMapOfPassKeyInteger.hxx \ - GEOMAlgo_DataMapOfRealListOfShape.hxx \ - GEOMAlgo_DataMapOfShapeReal.hxx \ - GEOMAlgo_DataMapOfShapeShapeSet.hxx \ + GEOMAlgo_DataMapOfOrientedShapeShape.hxx \ + GEOMAlgo_DataMapOfPassKeyInteger.hxx \ + GEOMAlgo_DataMapOfPassKeyShapeShape.hxx \ + GEOMAlgo_DataMapOfRealListOfShape.hxx \ + GEOMAlgo_DataMapOfShapeReal.hxx \ + GEOMAlgo_DataMapOfShapeShapeSet.hxx \ GEOMAlgo_FinderShapeOn1.ixx \ GEOMAlgo_FinderShapeOn1.hxx \ GEOMAlgo_FinderShapeOn1.jxx \ @@ -217,18 +230,24 @@ salomeinclude_HEADERS = \ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx \ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx \ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \ + GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx \ GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState.hxx \ GEOMAlgo_IndexedDataMapOfIntegerShape.hxx \ GEOMAlgo_IndexedDataMapOfPassKeyListOfShape.hxx \ GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx \ GEOMAlgo_IndexedDataMapOfShapeBox.hxx \ + GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx \ GEOMAlgo_IndexedDataMapOfShapeState.hxx \ - GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx \ - GEOMAlgo_ListIteratorOfListOfPnt.hxx \ - GEOMAlgo_ListNodeOfListOfCoupleOfShapes.hxx \ - GEOMAlgo_ListNodeOfListOfPnt.hxx \ - GEOMAlgo_ListOfCoupleOfShapes.hxx \ - GEOMAlgo_ListOfPnt.hxx \ + GEOMAlgo_KindOfBounds.hxx \ + GEOMAlgo_KindOfClosed.hxx \ + GEOMAlgo_KindOfName.hxx \ + GEOMAlgo_KindOfShape.hxx \ + GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx \ + GEOMAlgo_ListIteratorOfListOfPnt.hxx \ + GEOMAlgo_ListNodeOfListOfCoupleOfShapes.hxx \ + GEOMAlgo_ListNodeOfListOfPnt.hxx \ + GEOMAlgo_ListOfCoupleOfShapes.hxx \ + GEOMAlgo_ListOfPnt.hxx \ GEOMAlgo_PassKey.hxx \ GEOMAlgo_PassKey.ixx \ GEOMAlgo_PassKey.jxx \ @@ -245,6 +264,12 @@ salomeinclude_HEADERS = \ GEOMAlgo_ShapeAlgo.hxx \ GEOMAlgo_ShapeAlgo.ixx \ GEOMAlgo_ShapeAlgo.jxx \ + GEOMAlgo_ShapeInfo.hxx \ + GEOMAlgo_ShapeInfo.ixx \ + GEOMAlgo_ShapeInfo.jxx \ + GEOMAlgo_ShapeInfoFiller.hxx \ + GEOMAlgo_ShapeInfoFiller.ixx \ + GEOMAlgo_ShapeInfoFiller.jxx \ GEOMAlgo_ShapeSet.hxx \ GEOMAlgo_ShapeSet.ixx \ GEOMAlgo_ShapeSet.jxx \ @@ -279,6 +304,9 @@ salomeinclude_HEADERS = \ GEOMAlgo_WESCorrector.hxx \ GEOMAlgo_WESCorrector.ixx \ GEOMAlgo_WESCorrector.jxx \ + GEOMAlgo_WESScaler.hxx \ + GEOMAlgo_WESScaler.ixx \ + GEOMAlgo_WESScaler.jxx \ GEOMAlgo_WireEdgeSet.hxx \ GEOMAlgo_WireEdgeSet.ixx \ GEOMAlgo_WireEdgeSet.jxx \ @@ -290,8 +318,11 @@ salomeinclude_HEADERS = \ GEOMAlgo_WireSplitter.jxx \ Handle_GEOMAlgo_ClsfBox.hxx \ Handle_GEOMAlgo_Clsf.hxx \ + Handle_GEOMAlgo_ClsfSolid.hxx \ Handle_GEOMAlgo_ClsfSurf.hxx \ + Handle_GEOMAlgo_DataMapNodeOfDataMapOfOrientedShapeShape.hxx \ Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyInteger.hxx \ + Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx \ Handle_GEOMAlgo_DataMapNodeOfDataMapOfRealListOfShape.hxx \ Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeReal.hxx \ Handle_GEOMAlgo_DataMapNodeOfDataMapOfShapeShapeSet.hxx \ @@ -300,30 +331,10 @@ salomeinclude_HEADERS = \ Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyListOfShape.hxx \ Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfPassKeyShapeListOfShape.hxx \ Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeBox.hxx \ + Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx \ Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeState.hxx \ Handle_GEOMAlgo_ListNodeOfListOfCoupleOfShapes.hxx \ - Handle_GEOMAlgo_ListNodeOfListOfPnt.hxx \ - GEOMAlgo_ClsfSolid.hxx \ - GEOMAlgo_ClsfSolid.ixx \ - GEOMAlgo_ClsfSolid.jxx \ - GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyShapeShape.hxx \ - GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx \ - GEOMAlgo_DataMapOfPassKeyShapeShape.hxx \ - GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx \ - GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx \ - GEOMAlgo_KindOfBounds.hxx \ - GEOMAlgo_KindOfClosed.hxx \ - GEOMAlgo_KindOfName.hxx \ - GEOMAlgo_KindOfShape.hxx \ - GEOMAlgo_ShapeInfo.hxx \ - GEOMAlgo_ShapeInfo.ixx \ - GEOMAlgo_ShapeInfo.jxx \ - GEOMAlgo_ShapeInfoFiller.hxx \ - GEOMAlgo_ShapeInfoFiller.ixx \ - GEOMAlgo_ShapeInfoFiller.jxx \ - Handle_GEOMAlgo_ClsfSolid.hxx \ - Handle_GEOMAlgo_DataMapNodeOfDataMapOfPassKeyShapeShape.hxx \ - Handle_GEOMAlgo_IndexedDataMapNodeOfIndexedDataMapOfShapeShapeInfo.hxx + Handle_GEOMAlgo_ListNodeOfListOfPnt.hxx libGEOMAlgo_la_CPPFLAGS = \ $(CAS_CPPFLAGS) \ @@ -384,6 +395,7 @@ CDL_FILES = \ GEOMAlgo_Tools3D.cdl \ GEOMAlgo_VertexSolid.cdl \ GEOMAlgo_WESCorrector.cdl \ + GEOMAlgo_WESScaler.cdl \ GEOMAlgo_WireEdgeSet.cdl \ GEOMAlgo_WireSolid.cdl \ GEOMAlgo_WireSplitter.cdl diff --git a/src/GEOMBase/GEOMBase.cxx b/src/GEOMBase/GEOMBase.cxx index 6cbf4f374..efd69ff3c 100644 --- a/src/GEOMBase/GEOMBase.cxx +++ b/src/GEOMBase/GEOMBase.cxx @@ -893,7 +893,7 @@ GEOM::GEOM_Object_ptr GEOMBase::GetObjectFromIOR( const char* theIOR ) // function : GetIORFromObject() // purpose : returns IOR of a given GEOM_Object //======================================================================= -char* GEOMBase::GetIORFromObject( const GEOM::GEOM_Object_ptr& theObject ) +QString GEOMBase::GetIORFromObject( const GEOM::GEOM_Object_ptr& theObject ) { if ( CORBA::is_nil( theObject ) ) return NULL; diff --git a/src/GEOMBase/GEOMBase.h b/src/GEOMBase/GEOMBase.h index e1bd56882..fb846fe3c 100644 --- a/src/GEOMBase/GEOMBase.h +++ b/src/GEOMBase/GEOMBase.h @@ -90,7 +90,7 @@ public : static GEOM::GEOM_Object_ptr GetObjectFromIOR(const char* theIOR); - static char* GetIORFromObject(const GEOM::GEOM_Object_ptr& theObject); + static QString GetIORFromObject(const GEOM::GEOM_Object_ptr& theObject); /* Geometry */ static bool VertexToPoint(const TopoDS_Shape& S, gp_Pnt& P); diff --git a/src/GEOMBase/GEOMBase_Helper.cxx b/src/GEOMBase/GEOMBase_Helper.cxx index 3a2878658..de5f92978 100755 --- a/src/GEOMBase/GEOMBase_Helper.cxx +++ b/src/GEOMBase/GEOMBase_Helper.cxx @@ -95,7 +95,8 @@ GEOMBase_Helper::GEOMBase_Helper( SUIT_Desktop* desktop ) //================================================================ GEOMBase_Helper::~GEOMBase_Helper() { - if ( !SUIT_Session::session()->activeApplication()->desktop() ) + //rnv: Fix for the "IPAL21922 : WinTC5.1.4: incorrect quit salome" + if ( !SUIT_Session::session()->activeApplication() || !SUIT_Session::session()->activeApplication()->desktop() ) return; if ( myPreview.size() ) @@ -169,9 +170,10 @@ void GEOMBase_Helper::erase( const ObjectList& objList, const bool updateView ) void GEOMBase_Helper::erase( GEOM::GEOM_Object_ptr object, const bool updateView ) { if ( !object->_is_nil() ) { - std::string entry = getEntry( object ); + QString entry = getEntry( object ); getDisplayer()->Erase( new SALOME_InteractiveObject( - entry.c_str(), "GEOM", strdup( GEOMBase::GetName( object ).toLatin1().constData() ) ), true, updateView ); + entry.toLatin1().constData(), + "GEOM", strdup( GEOMBase::GetName( object ).toLatin1().constData() ) ), true, updateView ); } } @@ -208,9 +210,9 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object, // Enable activisation of selection getDisplayer()->SetToActivate( true ); - std::string entry = getEntry( object ); + QString entry = getEntry( object ); getDisplayer()->Redisplay(new SALOME_InteractiveObject - (entry.c_str(), "GEOM", strdup(GEOMBase::GetName(object).toLatin1().constData())), false); + (entry.toLatin1().constData(), "GEOM", strdup(GEOMBase::GetName(object).toLatin1().constData())), false); } if ( withChildren ) { @@ -226,9 +228,9 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object, (GeometryGUI::ClientSObjectToObject(anIt->Value())); if ( !CORBA::is_nil( aChild ) ) { if ( !aChild->_is_nil() ) { - std::string entry = getEntry( aChild ); + QString entry = getEntry( aChild ); getDisplayer()->Redisplay( new SALOME_InteractiveObject( - entry.c_str(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false ); + entry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false ); } } } @@ -448,10 +450,10 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo GEOM::GEOM_Object_ptr anObj = *anIter; if ( anObj->_is_nil() ) continue; - std::string aEntry = getEntry( anObj ); - if ( aEntry != "" ) + QString anEntry = getEntry( anObj ); + if ( anEntry != "" ) aListOfIO.Append( new SALOME_InteractiveObject( - aEntry.c_str(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) ); + anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) ); } getDisplayer()->LocalSelection( aListOfIO, theMode ); @@ -618,21 +620,18 @@ SalomeApp_Study* GEOMBase_Helper::getStudy() const // Function : getEntry // Purpose : //================================================================ -char* GEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const +QString GEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const { SalomeApp_Study* study = getStudy(); if ( study ) { - char * objIOR = GEOMBase::GetIORFromObject( object ); - std::string IOR( objIOR ); - free( objIOR ); - if ( IOR != "" ) { - _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( IOR ) ); - if ( SO ) { - return (char*) TCollection_AsciiString((char*)SO->GetID().c_str()).ToCString(); - } + QString objIOR = GEOMBase::GetIORFromObject( object ); + if ( objIOR != "" ) { + _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( objIOR.toLatin1().constData() ) ); + if ( SO ) + return QString::fromStdString(SO->GetID()); } } - return (char*)""; + return ""; } //================================================================ @@ -1024,9 +1023,8 @@ bool GEOMBase_Helper::selectObjects( ObjectList& objects ) ObjectList::iterator anIter; for ( anIter = objects.begin(); anIter != objects.end(); ++anIter ) { - std::string entry = getEntry( *anIter ); - QString aEntry( entry.c_str() ); - LightApp_DataOwner* anOwher = new LightApp_DataOwner( aEntry ); + QString anEntry = getEntry( *anIter ); + LightApp_DataOwner* anOwher = new LightApp_DataOwner( anEntry ); aList.append( anOwher ); } @@ -1056,8 +1054,8 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather (GEOM::GEOM_Object_ptr dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); _PTR(Study) aDStudy = appStudy->studyDS(); - std::string IOR = GEOMBase::GetIORFromObject( theFather ); - _PTR(SObject) SObj ( aDStudy->FindObjectIOR( IOR ) ); + QString IOR = GEOMBase::GetIORFromObject( theFather ); + _PTR(SObject) SObj ( aDStudy->FindObjectIOR( IOR.toLatin1().constData() ) ); bool inStudy = false; GEOM::GEOM_Object_var aReturnObject; @@ -1072,7 +1070,7 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather (GEOM::GEOM_Object_ptr } if (inStudy) return aReturnObject._retn(); - + return GEOM::GEOM_Object::_nil(); } @@ -1103,11 +1101,11 @@ void GEOMBase_Helper::addSubshapesToFather( QMap if ( !anOp->_is_nil() ) { GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.value() ); if ( !aFatherObj->_is_nil() ) { - std::string aFatherEntry = getEntry( aFatherObj ); + QString aFatherEntry = getEntry( aFatherObj ); if ( aFatherEntry != "") { // additional checking that object is valid 0020598 EDF 1191 GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() ); //Add Object to study if its not exist - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) + if ( aFindedObject->_is_nil() ) GeometryGUI::GetGeomGen()->AddInStudy(GeometryGUI::ClientStudyToStudy(aDStudy), it.value(), it.key().toLatin1().data(), aFatherObj ); } diff --git a/src/GEOMBase/GEOMBase_Helper.h b/src/GEOMBase/GEOMBase_Helper.h index b8e12adba..0a3fc2914 100755 --- a/src/GEOMBase/GEOMBase_Helper.h +++ b/src/GEOMBase/GEOMBase_Helper.h @@ -177,7 +177,7 @@ protected: SUIT_Desktop* getDesktop() const; private: - char* getEntry ( GEOM::GEOM_Object_ptr ) const; + QString getEntry( GEOM::GEOM_Object_ptr ) const; void clearShapeBuffer( GEOM::GEOM_Object_ptr ); private: diff --git a/src/GEOMClient/GEOM_Client.cxx b/src/GEOMClient/GEOM_Client.cxx index 7d0990466..0e07e69d3 100644 --- a/src/GEOMClient/GEOM_Client.cxx +++ b/src/GEOMClient/GEOM_Client.cxx @@ -30,7 +30,7 @@ #include -#include +#include #include "GEOM_Client.hxx" #include @@ -81,7 +81,7 @@ TopoDS_Shape GEOM_Client::Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr a int sizebuf = SeqFile->length(); char* buf; buf = (char*) &SeqFile[0]; - std::istrstream streamBrep(buf,sizebuf); + std::istringstream streamBrep(buf); BRep_Builder aBuilder; BRepTools::Read(S, streamBrep, aBuilder); return(S); diff --git a/src/GEOMClient/GEOM_Client.hxx b/src/GEOMClient/GEOM_Client.hxx index 5e5269504..f5f9cafc2 100644 --- a/src/GEOMClient/GEOM_Client.hxx +++ b/src/GEOMClient/GEOM_Client.hxx @@ -32,6 +32,9 @@ #include #include CORBA_SERVER_HEADER(GEOM_Gen) # +#ifdef HAVE_FINITE +#undef HAVE_FINITE // E.A. fix a warning about redefinition of HAVE_FINITE in re-inclusion of Standard_values.h +#endif #ifndef _TColStd_SequenceOfAsciiString_HeaderFile #include #endif diff --git a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx index 898d60177..36a455dcf 100644 --- a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx +++ b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx @@ -114,11 +114,12 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const if (!entryStr.isEmpty()) { + Handle(SALOME_InteractiveObject) anIO = Handle(SALOME_InteractiveObject)::DownCast(io->GetOwner()); LightApp_DataOwner* owner; if (index > -1) // Local Selection owner = new LightApp_DataSubOwner (entryStr, index); - else // Global Selection - owner = new LightApp_DataOwner (entryStr); + else if ( !anIO.IsNull() ) // Global Selection + owner = new LightApp_DataOwner( anIO ); aList.append(SUIT_DataOwnerPtr(owner)); } @@ -134,8 +135,11 @@ void GEOMGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const if ( !entryStr.isEmpty() ) { - LightApp_DataOwner* owner = new LightApp_DataOwner( entryStr ); - aList.append( SUIT_DataOwnerPtr( owner ) ); + Handle(SALOME_InteractiveObject) anIO = Handle(SALOME_InteractiveObject)::DownCast(io->GetOwner()); + if ( !anIO.IsNull() ) { + LightApp_DataOwner* owner = new LightApp_DataOwner( anIO ); + aList.append( SUIT_DataOwnerPtr( owner ) ); + } } } } @@ -196,11 +200,7 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) Handle(AIS_InteractiveContext) ic = vw->getAISContext(); // "entry - list_of_int" map for LOCAL selection -#ifndef WNT NCollection_DataMap indexesMap; -#else - NCollection_DataMap indexesMap; -#endif QMap globalSelMap; // only Key=entry from this map is used. value(int) is NOT used at all. SelectMgr_IndexedMapOfOwner ownersmap; // map of owners to be selected @@ -216,11 +216,7 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) if ( subOwner ) { QString entry = subOwner->entry(); -#ifndef WNT if ( indexesMap.IsBound( TCollection_AsciiString(entry.toLatin1().data()))) -#else - if ( indexesMap.IsBound( entry.toLatin1().data() ) ) -#endif { TColStd_IndexedMapOfInteger& subIndexes = indexesMap.ChangeFind(entry.toLatin1().data()); subIndexes.Add( subOwner->index() ); diff --git a/src/GEOMGUI/GEOMGUI_Selection.cxx b/src/GEOMGUI/GEOMGUI_Selection.cxx index 3d4920b3e..f4aeb8ccf 100644 --- a/src/GEOMGUI/GEOMGUI_Selection.cxx +++ b/src/GEOMGUI/GEOMGUI_Selection.cxx @@ -98,6 +98,8 @@ QVariant GEOMGUI_Selection::parameter( const int ind, const QString& p ) const return QVariant( hasHiddenChildren( ind ) ); else if ( p == "hasShownChildren" ) return QVariant( hasShownChildren( ind ) ); + else if ( p == "compoundOfVertices" ) + return QVariant( compoundOfVertices( ind ) ); else return LightApp_Selection::parameter( ind, p ); } @@ -129,7 +131,8 @@ int GEOMGUI_Selection::typeId( const int index ) const int aType = -1; GEOM::GEOM_Object_var anObj = getObject( index ); if ( !CORBA::is_nil( anObj ) ) - aType = anObj->GetType(); + //aType = anObj->GetType(); + aType = (int)anObj->GetShapeType(); return aType; } @@ -273,6 +276,29 @@ bool GEOMGUI_Selection::expandable( const _PTR(SObject)& obj ) return exp; } +bool GEOMGUI_Selection::isCompoundOfVertices( GEOM::GEOM_Object_ptr obj ) +{ + bool ret = false; + SalomeApp_Study* appStudy = dynamic_cast + (SUIT_Session::session()->activeApplication()->activeStudy()); + if ( appStudy && !CORBA::is_nil( obj ) && obj->GetShapeType() == GEOM::COMPOUND ) { + GEOM::GEOM_IMeasureOperations_var anOper = GeometryGUI::GetGeomGen()->GetIMeasureOperations( appStudy->id() ); + QString whatIs = anOper->WhatIs( obj ); + QStringList data = whatIs.split( "\n", QString::SkipEmptyParts ); + int nbVertices = 0, nbCompounds = 0, nbOther = 0; + foreach ( QString s, data ) { + QString type = s.section( ":", 0, 0 ).trimmed().toLower(); + int cnt = s.section( ":", 1, 1 ).trimmed().toInt(); + if ( type == "vertex" ) nbVertices += cnt; + else if ( type == "compound" ) nbCompounds += cnt; + else if ( type != "shape" ) nbOther += cnt; + } + ret = nbVertices > 0 && nbCompounds == 1 && nbOther == 0; + anOper->Destroy(); + } + return ret; +} + bool GEOMGUI_Selection::hasHiddenChildren( const int index ) const { bool OK = false; @@ -309,6 +335,11 @@ bool GEOMGUI_Selection::hasShownChildren( const int index ) const return OK; } +bool GEOMGUI_Selection::compoundOfVertices( const int index ) const +{ + return isCompoundOfVertices( getObject( index ) ); +} + bool GEOMGUI_Selection::isComponent( const int index ) const { SalomeApp_Study* appStudy = dynamic_cast diff --git a/src/GEOMGUI/GEOMGUI_Selection.h b/src/GEOMGUI/GEOMGUI_Selection.h index e6cb762e8..9911ad4df 100644 --- a/src/GEOMGUI/GEOMGUI_Selection.h +++ b/src/GEOMGUI/GEOMGUI_Selection.h @@ -48,6 +48,10 @@ public: virtual bool processOwner( const LightApp_DataOwner* ); + static bool hasChildren( const _PTR(SObject)& ); + static bool expandable( const _PTR(SObject)& ); + static bool isCompoundOfVertices( GEOM::GEOM_Object_ptr ); + private: bool isVisible( const int ) const; bool isAutoColor( const int ) const; @@ -58,9 +62,7 @@ private: bool isVectorsMode( const int ) const; bool hasHiddenChildren( const int ) const; bool hasShownChildren( const int ) const; - - static bool hasChildren( const _PTR(SObject)& ); - static bool expandable( const _PTR(SObject)& ); + bool compoundOfVertices( const int ) const; bool isComponent( const int ) const; GEOM::GEOM_Object_ptr getObject( const int ) const; diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 82853c712..3196289e5 100644 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -81,6 +81,9 @@ #include #include #include +#include +#include +#include // VTK Includes #include @@ -126,6 +129,36 @@ static inline int getTopAbsMode( const int implType ) } } +static bool isCompoundOfVertices( const TopoDS_Shape& theShape ) +{ + bool ret = false; + if ( !theShape.IsNull() ) { + int iType, nbTypes [TopAbs_SHAPE]; + for (iType = 0; iType < TopAbs_SHAPE; ++iType) + nbTypes[iType] = 0; + nbTypes[theShape.ShapeType()]++; + + TopTools_MapOfShape aMapOfShape; + aMapOfShape.Add(theShape); + TopTools_ListOfShape aListOfShape; + aListOfShape.Append(theShape); + + TopTools_ListIteratorOfListOfShape itL (aListOfShape); + for (; itL.More(); itL.Next()) { + TopoDS_Iterator it (itL.Value()); + for (; it.More(); it.Next()) { + TopoDS_Shape s = it.Value(); + if (aMapOfShape.Add(s)) { + aListOfShape.Append(s); + nbTypes[s.ShapeType()]++; + } + } + } + ret = nbTypes[TopAbs_VERTEX] > 0 && nbTypes[TopAbs_COMPOUND] == 1; + } + return ret; +} + //================================================================ // Function : getFilter // Purpose : Get filter corresponding to the type of object @@ -579,7 +612,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) AISShape->SetColor( (Quantity_NameOfColor)GetColor() ); Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect(); anAspect->SetColor( (Quantity_NameOfColor)GetColor() ); - if ( myShape.ShapeType() == TopAbs_VERTEX ) + if ( myShape.ShapeType() == TopAbs_VERTEX || isCompoundOfVertices( myShape ) ) { anAspect->SetScale( myScaleOfMarker ); anAspect->SetTypeOfMarker( myTypeOfMarker ); @@ -588,7 +621,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) } else { - if ( myShape.ShapeType() == TopAbs_VERTEX ) + if ( myShape.ShapeType() == TopAbs_VERTEX || isCompoundOfVertices( myShape ) ) { col = aResMgr->colorValue( "Geometry", "point_color", QColor( 255, 255, 0 ) ); aColor = SalomeApp_Tools::color( col ); @@ -727,7 +760,7 @@ void GEOM_Displayer::Update( SALOME_OCCPrs* prs ) Quantity_Color aQuanColor( aSColor.R, aSColor.G, aSColor.B, Quantity_TOC_RGB ); AISShape->SetColor( aQuanColor ); AISShape->SetShadingColor( aQuanColor ); - if ( myShape.ShapeType() == TopAbs_VERTEX ) { + if ( myShape.ShapeType() == TopAbs_VERTEX || isCompoundOfVertices( myShape ) ) { Handle(Prs3d_PointAspect) anAspect = AISShape->Attributes()->PointAspect(); anAspect->SetColor( aQuanColor ); anAspect->SetScale( myScaleOfMarker ); diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index 61a9e5362..a99fc90cd 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -109,6 +109,10 @@ ICON_DLG_BUILD_EDGE build_edge.png + + ICON_DLG_BUILD_EDGE_WIRE + build_edge_wire.png + ICON_DLG_BUILD_FACE build_face.png @@ -269,6 +273,10 @@ ICON_DLG_GLUE_FACES2 glue2.png + + ICON_DLG_LIMIT_TOLERANCE + limit_tolerance.png + ICON_DLG_INERTIA axisinertia.png @@ -849,6 +857,10 @@ ICO_GLUE_FACES glue.png + + ICO_LIMIT_TOLERANCE + limit_tolerance.png + ICO_GROUP_CREATE group_new.png @@ -905,6 +917,10 @@ ICO_OFFSET offset.png + + ICO_ORIGIN_AND_VECTORS + origin_and_vectors.png + ICO_PARTITION partition.png diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index 895af0c3f..b0ea88ed1 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -1,4730 +1,4786 @@ + - - - - @default - - BRep_API: command not done - Error: can't build object - - - CHANGE_ORIENTATION_NEW_OBJ_NAME - Invert - - - CLOSE_CONTOUR_NEW_OBJ_NAME - CloseContour - - - DEP_OBJECT - Selected object has been used to create another one. -It can't be deleted - - - DEVIDE_EDGE_NEW_OBJECT_NAME - NewObject - - - ERROR_SHAPE_TYPE - Object of incorrect type selected! + + + @default + + BRep_API: command not done + Error: can't build object + + + CHANGE_ORIENTATION_NEW_OBJ_NAME + Invert + + + CLOSE_CONTOUR_NEW_OBJ_NAME + CloseContour + + + DEP_OBJECT + Selected object has been used to create another one. +It can't be deleted + + + DEVIDE_EDGE_NEW_OBJECT_NAME + NewObject + + + ERROR_SHAPE_TYPE + Object of incorrect type selected! Please, select face, shell or solid and try again - - - iErr : 10 - the Classifier is NULL - - - iErr : 11 - the Shape is NULL - - - iErr : 12 - Unallowed Type of Subshape - - - iErr : 13 - Unallowed State - - - iErr : 15 - Unallowed Surface Type - - - iErr : 20 - Triangulation is not Found - - - iErr : 30 - Can not Obtain the Line From the Link - - - iErr : 40 - A Point Can Not Be Classified - - - iErr : 41 - Invalid Data for Classifier - - - GEOM_2D_CONTINUTY - 2D continuity - - - GEOM_2D_CURVE_MODE - 2D curve mode - - - GEOM_2D_TOLERANCE - 2D tolerance - - - GEOM_3D_CONTINUTY - 3D continuity - - - GEOM_3D_CURVE_MODE - 3D curve mode - - - GEOM_3D_TOLERANCE - 3D tolerance - - - GEOM_3_POINTS - 3 points - - - GEOM_ADD_POINT - Add point - - - GEOM_ANGLE - Angle : - - - GEOM_ANGLE_1 - Angle - - - GEOM_ARC_ELLIPSE - Arc of ellipse - - - GEOM_ARC - Arc - - - GEOM_ARCHIMEDE - Archimede - - - GEOM_ARCHIMEDE_TITLE - Archimede Construction - - - GEOM_ARC_TITLE - Arc Construction - - - GEOM_ARGUMENTS - Arguments - - - GEOM_AXE_MIRROR - Axe Mirror - - - GEOM_AXIS - Axis - - - GEOM_BASE - Base - - - GEOM_BASE_OBJECT - Base Object - - - GEOM_BASE_POINT - Base Point - - - GEOM_BEZIER - Bezier - - - GEOM_BINORMAL - BiNormal - - - GEOM_BLOCK - Hexahedral Solid - - - GEOM_BLOCKS_COMPOUND - BlocksCompound - - - GEOM_BLOCK_EXPLODE - Sub Blocks - - - GEOM_BLOCK_EXPLODE_TITLE - Sub Blocks Selection - - - GEOM_BLOCK_MULTITRSF - Block Multi-Transformation - - - GEOM_BLOCK_MULTITRSF_DOUBLE - Multi-Transformation Double - - - GEOM_BLOCK_MULTITRSF_SIMPLE - Multi-Transformation Simple - - - GEOM_BLOCK_MULTITRSF_TITLE - Block Multi-Transformation - - - GEOM_BLOCK_TITLE - Hexahedral Solid Construction - - - GEOM_BNDBOX - Bounding Box - - - GEOM_BNDBOX_OBJDIM - Object And Its Dimensions - - - GEOM_BNDBOX_TITLE - Bounding Box Information - - - GEOM_BOX - Box - - - GEOM_BOX_OBJ - Dimensions At Origin - - - GEOM_BOX_TITLE - Box Construction - - - GEOM_BSplineRestriction - BSplineRestriction - - - GEOM_BUT_APPLY - &Apply - - - GEOM_BUT_CANCEL - &Cancel - - - GEOM_BUT_CLOSE - &Close - - - GEOM_BUT_CLOSE_SKETCH - Sketch Closure - - - GEOM_BUT_END_SKETCH - Sketch Validation - - - GEOM_BUT_EXPLODE - &Explode - - - GEOM_BUT_HELP - &Help - - - GEOM_BUT_NO - &No - - - GEOM_BUT_OK - O&k - - - GEOM_BUT_APPLY_AND_CLOSE - A&pply and Close - - - GEOM_BUT_YES - &Yes - - - GEOM_BY_LENGTH - By length - - - GEOM_BY_PARAMETER - By parameter - - - GEOM_CENTER - Center - - - GEOM_CENTER_POINT - Center Point - - - GEOM_CENTRAL_POINT - Central Point - - - GEOM_CHAMFER - Chamfer - - - GEOM_CHAMFER_ABORT - Chamfer can't be computed with %1 and %2 - - - GEOM_CHAMFER_ALL - Chamfer On Whole Shape - - - GEOM_CHAMFER_EDGES - Chamfer On Edges From Shape - - - GEOM_CHAMFER_FACES - Chamfer On Faces From Shape - - - GEOM_CHAMFER_TITLE - Chamfer Construction - - - GEOM_CHANGE_ORIENTATION - Objects to change orientation - - - GEOM_CHANGE_ORIENTATION_TITLE - Change orientation - - - GEOM_CHECK_BLOCKS_COMPOUND - Check and Improve Blocks Compound - - - GEOM_CHECK_BLOCKS_COMPOUND_FAILED - Check failed - - - GEOM_CHECK_BLOCKS_COMPOUND_ERRORS - Errors - - - GEOM_CHECK_BLOCKS_COMPOUND_HAS_ERRORS - The Compound of Blocks has errors - - - GEOM_CHECK_BLOCKS_COMPOUND_HAS_NO_ERRORS - The Compound of Blocks has no errors - - - GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES - Incriminated Sub-Shapes - - - GEOM_CHECK_INFOS - Object And Its Topological Information - - - GEOM_CHECK_SHAPE - Check Shape - - - GEOM_CHECK_TITLE - Check Shape Information - - - GEOM_CIRCLE - Circle - - - GEOM_CIRCLE_TITLE - Circle Construction - - - GEOM_CLOSECONTOUR_TITLE - Close contour - - - GEOM_CMASS - Center Of Mass - - - GEOM_CMASS_TITLE - Center Of Mass Construction - - - GEOM_COMMON - Common - - - GEOM_COMMON_TITLE - Common Of Two Objects - - - GEOM_COMPOUND - Compound - - - GEOM_COMPOUNDSOLID - CompSolid - - - GEOM_COMPOUND_TITLE - Create A Compound - - - GEOM_CONE - Cone - - - GEOM_CONE_TITLE - Cone Construction - - - GEOM_CONFIRM - Confirm operation - - - GEOM_CONFIRM_INFO - Shape contains %1 sub shapes ! - - - GEOM_COOR - Coord. : - - - GEOM_COORDINATES - Coordinates - - - GEOM_COORDINATES_RES - Result coordinates - - - GEOM_CREATE_COPY - Create a copy - - - GEOM_CREATE_SINGLE_SOLID - Create a single solid - - - GEOM_CURVE - Curve - - - GEOM_CURVE_CONTINUTY - Curve continuity - - - GEOM_CURVE_TITLE - Curve Construction - - - GEOM_CUT - Cut - - - GEOM_CUT_TITLE - Cut Of Two Objects - - - GEOM_CYLINDER - Cylinder - - - GEOM_CYLINDER_TITLE - Cylinder Construction - - - GEOM_D1 - D1 : - - - GEOM_D2 - D2 : - - - GEOM_DETECT - Detect - - - GEOM_DIAGONAL_POINTS - Diagonal Points - - - GEOM_DISK - Disk - - - GEOM_DISK_TITLE - Disk Construction - - - GEOM_DIMENSIONS - Dimensions - - - GEOM_DISTANCE - Distance - - - GEOM_DIVIDE_EDGE_TITLE - Addition of point - - - GEOM_DX - Dx : - - - GEOM_DY - Dy : - - - GEOM_DZ - Dz : - - - GEOM_DropSmallEdges - DropSmallEdges - - - GEOM_EDGE - Edge - - - GEOM_EDGE_TITLE - Create An Edge - - - GEOM_ELLIPSE - Ellipse - - - GEOM_ELLIPSE_ERROR_1 - Error creating ellipse. Reason: minor radius is greater than major radius. - - - GEOM_ELLIPSE_TITLE - Ellipse Construction - - - GEOM_END_LCS - End LCS - - - GEOM_ERROR - Error - - - GEOM_ERROR_STATUS - Operation status - - - GEOM_ERR_GET_ENGINE - Failed to obtain GEOM Engine component. Reload Geometry module and try again. - - - GEOM_ERR_LIB_NOT_FOUND - GUI library corresponding to the user action can not be found or loaded - - - GEOM_EXTRUSION - Extrusion - - - GEOM_EXTRUSION_BSV - Base Shape + Vector - - - GEOM_EXTRUSION_BSV_2P - Base Shape + 2 Points - - - GEOM_EXTRUSION_DXDYDZ - Base Shape + DX DY DZ Vector - - - GEOM_EXTRUSION_TITLE - Construction by Extrusion - - - GEOM_FACE - Face - - - GEOM_CS - Coordinate system - - - GEOM_GCS - Global coordinate system - - - GEOM_LCS - Local coordinate system - - - GEOM_FACES - Faces - - - GEOM_FACE_FFW - Face creation from wires and/or edges - - - GEOM_FACE_OPT - Try to create a planar face - - - GEOM_FACE_OR_LCS - Face or LCS - - - GEOM_FACE_SELECTION - Face Selection - - - GEOM_FACE_TITLE - Create A Face - - - GEOM_RECTANGLE_TITLE - Rectangle Construction - - - GEOM_RECTANGLE - Rectangle - - - GEOM_FILLET - Fillet - - - GEOM_FILLET_2D - Fillet 2D - - - GEOM_FILLET_1D - Fillet 1D - - - GEOM_FILLET_ABORT - Fillet can't be computed with radius %1 - - - GEOM_FILLET_ALL - Fillet On Whole Shape - - - GEOM_FILLET_EDGES - Fillet On Edges From Shape - - - GEOM_FILLET_WIRES - Fillet On Wires From Shape - - - GEOM_FILLET_FACES - Fillet On Faces From Shape - - - GEOM_FILLET_VERTEXES - Fillet On Vertexes From Face - - - GEOM_FILLET_TITLE - Fillet Construction - - - GEOM_FILLET_2D_TITLE - 2D Fillet Construction - - - GEOM_FILLET_1D_TITLE - 1D Fillet Construction - - - GEOM_FILLING - Filling - - - GEOM_FILLING_ARG - Arguments And Parameters - - - GEOM_FILLING_COMPOUND - Input compound - - - GEOM_FILLING_MAX_DEG - Max deg - - - GEOM_FILLING_MIN_DEG - Min deg - - - GEOM_FILLING_NB_ITER - Nb. Iter : - - - GEOM_FILLING_TITLE - Filling Surface With Edges - - - GEOM_FILLING_TOL_2D - Tol. 2D : - - - GEOM_FILLING_TOL_3D - Tol. 3D : - - - GEOM_FREE_BOUNDARIES - Free boundaries - - - GEOM_FREE_BOUNDS_ERROR - Object is not selected - - - GEOM_FREE_BOUNDS_MSG - Number of free boundaries detected: %1 (%2 closed, %3 open) - - - GEOM_FREE_BOUNDS_TLT - Free boundary detection - - - GEOM_FREE_FACES - Free faces - - - GEOM_FREE_FACES_TITLE - Free faces - - - GEOM_FUSE - Fuse - - - GEOM_FUSE_TITLE - Fuse Two Objects - - - GEOM_FixFaceSize - FixFaceSize - - - GEOM_FixShape - FixShape - - - GEOM_GLUE - Glue - - - GEOM_GLUE_TITLE - Glue faces - - - GEOM_HEIGHT - Height : - - - GEOM_HOLES - Holes - - - GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE - Identical names : select by mouse ! - - - GEOM_IMPORT - Imported_Shape - - - GEOM_INCORRECT_INPUT - Incorrect Input Data! - - - GEOM_INERTIA_CONSTR - Matrix And Moments Of Inertia - - - GEOM_INERTIA_I - %1:1 : - - - GEOM_INERTIA_IXYZ - IX & IY & IZ : - - - GEOM_INERTIA_TITLE - Calculs Of Inertia - - - GEOM_INF_LOADED - File %1 loaded. - - - GEOM_INTERNAL_WIRES - Internal wires - - - GEOM_INTERPOL - Interpolation - - - GEOM_KEEP_OBJECT - Keep Object - - - GEOM_LENGTH - Length : - - - GEOM_LINE - Line - - - GEOM_LINE_TITLE - Line Construction - - - GEOM_MAIN_OBJECT - Main Object - - - GEOM_MARKER - Marker - - - GEOM_MARKER_TITLE - Create marker - - - GEOM_MATERIAL_ID - Material ID: - - - GEOM_MATERIAL_MATERIAL - Material - - - GEOM_MATERIAL_SET - << Set - - - GEOM_MATERIAL_SHAPE - Shapes - - - GEOM_MATERIAL_TITLE - Define materials for Dominant Fuse - - - GEOM_MATRIX - Matrix : - - - GEOM_MAX - Max : - - - GEOM_MAX_3D_TOLERANCE - Max 3D tolerance - - - GEOM_MAX_TOLERANCE - Max tolerance - - - GEOM_MEN_ALL_FILES - All Files ( * ) - - - GEOM_MEN_ANGLE - Angle : - - - GEOM_MEN_COMPONENT - Geometry - - - GEOM_MEN_ENTER_ANGLE - Enter An Angle In Degrees - - - GEOM_MEN_EXPORT - Export - - - GEOM_MEN_IMPORT - Import - - - GEOM_MEN_ISOS - Select Number Of Isos - - - GEOM_MEN_ISOU - Isos U : - - - GEOM_MEN_ISOV - Isos V : - - - GEOM_MEN_POPUP_NAME - %1 Objects - - - GEOM_MEN_SHADING - Shading - - - GEOM_MEN_SKETCHER_X - Enter a Length to Set X - - - GEOM_MEN_SKETCHER_Y - Enter a Length to Set Y - - - GEOM_MEN_STEP_LABEL - Step : - - - GEOM_MEN_TRANSPARENCY - Transparency - - - GEOM_MEN_TRANSPARENCY_LABEL - Transparency : - - - GEOM_MEN_WIREFRAME - Wireframe - - - GEOM_MEN_X - X : - - - GEOM_MEN_Y - Y : - - - GEOM_MESHING_DEFLECTION - Meshing Deflect. : - - - GEOM_MIN - Min : - - - GEOM_MINDIST_OBJ - Objects And Results - - - GEOM_MINDIST_TITLE - Minimun Distance Between Two Objects - - - GEOM_MIRROR - Mirror - - - GEOM_MIRROR_TITLE - Mirror An Object - - - GEOM_MULTIROTATION - Multi-Rotation - - - GEOM_MULTIROTATION_DOUBLE - Multi Rotation Double - - - GEOM_MULTIROTATION_SIMPLE - Multi Rotation Simple - - - GEOM_MULTIROTATION_TITLE - Multi-Rotation - - - GEOM_MULTITRANSLATION - Multi-Translation - - - GEOM_MULTITRANSLATION_DOUBLE - Multi Translation Double - - - GEOM_MULTITRANSLATION_SIMPLE - Multi Translation Simple - - - GEOM_MULTITRANSLATION_TITLE - Multi-Translation - - - GEOM_NAME_INCORRECT - Object name not found - - - GEOM_NB_BLOCKS_NO_OTHERS - There are %1 specified blocks and NO other solids - - - GEOM_NB_BLOCKS_SOME_OTHERS - There are %1 specified blocks and some other solids - - - GEOM_NB_TIMES - Nb. Times : - - - GEOM_NB_TIMES_U - Nb. Times U : - - - GEOM_NB_TIMES_V - Nb. Times V : - - - GEOM_NODES - Nodes - - - GEOM_NUM_SPLIT_POINTS - Number of splitting points - - - GEOM_OBJECT - Object - - - GEOM_OBJECT_TYPE - Object Type - - - GEOM_OBJECTS - Objects - - - GEOM_OBJECT_I - Object %1 - - - GEOM_OBJECT_RESULT - Object And Result - - - GEOM_OFFSET - Offset - - - GEOM_OFFSET_TITLE - Offset Surface - - - GEOM_OPERATIONS - Operations - - - GEOM_ORIENTATION - Orientation - - - GEOM_ORIENTATION_OPT - Reverse orientation with normal vectors simulation - - - GEOM_ORIENTATION_TITLE - Change Orientation - - - GEOM_PARAMETER - Parameter : - - - GEOM_PARAMETERS - Parameters - - - GEOM_POINT_ON_EDGE - Point on Edge - - - GEOM_POINT_ON_FACE - Point on Face - - - GEOM_PARAM_VALUE - By parameter - - - GEOM_COORD_VALUE - By coordinate - - - GEOM_PARTITION - Partition - - - GEOM_WRN_PARTITION_RESULT_EMPTY - The partition result is empty, please verify the reconstruction limit parameter. - - - GEOM_PARTITION_HALFSPACE - Half-space partition - - - GEOM_PARTITION_ORIENTATION - Change Orientation - - - GEOM_PARTITION_TITLE - Partition Of Object With Tool - - - GEOM_PATH_OBJECT - Path Object - - - GEOM_PIPE - Pipe - - - GEOM_PIPE_TITLE - Pipe Construction - - - GEOM_SEGMENT - Segment of straight line - - - GEOM_SELECT_UNPUBLISHED_EDGES - Select unpublished edges - - - GEOM_PLANE - Plane - - - GEOM_PLANE_MIRROR - Plane Mirror - - - GEOM_PLANE_PV - Point + Vector - - - GEOM_PLANE_PVC - Point + Coordinate Vector - - - GEOM_PLANE_SIZE - Size of plane : - - - GEOM_PLANE_TITLE - Plane Construction - - - GEOM_POINT - Point - - - GEOM_POINT1 - Point 1 - - - GEOM_POINT2 - Point 2 - - - GEOM_POINT3 - Point 3 - - - GEOM_POINTS - Points - - - GEOM_POINT_I - Point %1 - - - GEOM_POINT_MIRROR - Point Mirror - - - GEOM_POINT_TITLE - Point Construction - - - GEOM_POLYLINE - Polyline - - - GEOM_POSITION - Location - - - GEOM_POSITION_TITLE - Modify the Location of an Object - - - GEOM_PRECISION - Precision : - - - GEOM_PROPAGATE - Propagate - - - GEOM_PROPAGATE_TITLE - Propagate - - - GEOM_PROPERTIES - Basic Properties - - - GEOM_PROPERTIES_CONSTR - Object And Its Properties - - - GEOM_PROPERTIES_SURFACE - Surface is : - - - GEOM_PROPERTIES_TITLE - Basic Properties Information - - - GEOM_PROPERTIES_VOLUME - Volume is : - - - GEOM_PRP_ABORT - Operation aborted - - - GEOM_PRP_COMMAND - No command associated with this id = %1. - - - GEOM_PRP_DONE - Operation done - - - GEOM_PRP_EXPORT - Exporting geometry to %1 ... - - - GEOM_PRP_LOADING - Loading %1 ... - - - GEOM_PRP_MIN_DIST - Min Distance not computed - - - GEOM_PRP_NOT_FOR_VTK_VIEWER - Not allowed in VTK viewer - - - GEOM_PRP_NULLSHAPE - Error, null or inappropriate shape ! - - - GEOM_PRP_READY - Ready - - - GEOM_PRP_SELECT_EDGE - Select edges and click on Apply - - - GEOM_PRP_SELECT_FACE - Select faces to suppress and click on Ok/Apply - - - GEOM_PRP_SELECT_FIRST - Select main shape first - - - GEOM_PRP_SELECT_SUBSHAPES - Select Sub Shapes - - - GEOM_PRP_SHAPE_IN_STUDY - Main shape must be in the study before - - - GEOM_QUAD_FACE - Quadrangle Face - - - GEOM_QUAD_FACE_TITLE - Quadrangle Face Construction - - - GEOM_RADIUS - Radius : - - - GEOM_RADIUS_I - Radius %1 : - - - GEOM_RADIUS_MAJOR - Major radius : - - - GEOM_RADIUS_MINOR - Minor radius : - - - GEOM_RECONSTRUCTION_LIMIT - Resulting Type - - - GEOM_RECONSTRUCTION_LIMIT_EDGE - Edge - - - GEOM_RECONSTRUCTION_LIMIT_FACE - Face - - - GEOM_RECONSTRUCTION_LIMIT_SHAPE - Shape - - - GEOM_RECONSTRUCTION_LIMIT_SHELL - Shell - - - GEOM_RECONSTRUCTION_LIMIT_SOLID - Solid - - - GEOM_RECONSTRUCTION_LIMIT_VERTEX - Vertex - - - GEOM_RECONSTRUCTION_LIMIT_WIRE - Wire - - - GEOM_REF_POINT - Point with reference - - - GEOM_REMOVE_ALL_HOLES - Remove all holes - - - GEOM_REMOVE_ALL_INT_WIRES - Remove all internal wires - - - GEOM_REMOVE_HOLES_TITLE - Suppress holes - - - GEOM_REMOVE_INTERNAL_WIRES_TITLE - Suppress internal wires - - - GEOM_REMOVE_WEBS - Remove webs - - - GEOM_REQUIRED_DEGREE - Required degree - - - GEOM_REQUIRED_NUM_SEGMENTS - Required number of segments - - - GEOM_REVERSE - Reverse - - - GEOM_REVERSE_DIRECTION - Reverse Direction - - - GEOM_REVERSE_PLANE - Reverse the plane normal - - - GEOM_REVERSE_U - Reverse U - - - GEOM_REVERSE_V - Reverse V - - - GEOM_REVERSE_VECTOR - Reverse Vector - - - GEOM_REVOLUTION - Revolution - - - GEOM_REVOLUTION_TITLE - Construction By Revolution - - - GEOM_ROTATION - Rotation - - - GEOM_ROTATION_TITLE - Rotation Of An Object - - - GEOM_SCALE - Scale - - - GEOM_SCALE_FACTOR - Scale Factor : - - - GEOM_SCALE_TITLE - Scale An Object - - - GEOM_SECTION - Section - - - GEOM_SECTION_TITLE - Section Of Two Objects - - - GEOM_SELECTED_FACE - Selected face - - - GEOM_SELECTED_OBJECTS - Selected objects - - - GEOM_SELECTED_SHAPE - Selected shape - - - GEOM_SELECTION - Selection - - - GEOM_SET_MATERIALS - Set materials - - - GEOM_SEWING - Sewing - - - GEOM_SEWING_TITLE - Topological sewing - - - GEOM_SHAPE - Shape - - - GEOM_SHAPEPROCESS_TITLE - Shape Processing - - - GEOM_SHAPES - Shapes - - - GEOM_SHELL - Shell - - - GEOM_SHELLS - Shells - - - GEOM_SHELL_TITLE - Shell Construction - - - GEOM_SKETCHER_ABS - Absolute - - - GEOM_SKETCHER_ADD_PARAMS - Additionnal Parameters - - - GEOM_SKETCHER_ANGLE - Angle - - - GEOM_SKETCHER_ANGLE2 - Angle : - - - GEOM_SKETCHER_APPLY - Apply - - - GEOM_SKETCHER_ARC - Arc - - - GEOM_SKETCHER_CENTER - Center - - - GEOM_SKETCHER_CENTER2 - Center : - - - GEOM_SKETCHER_CENTER_X - Center X coord. : - - - GEOM_SKETCHER_CENTER_Y - Center Y coord. : - - - GEOM_SKETCHER_CENTER_DX - Center DX coord. : - - - GEOM_SKETCHER_CENTER_DY - Center DY coord. : - - - GEOM_SKETCHER_DEST - Destination - - - GEOM_SKETCHER_DIR - Direction - - - GEOM_SKETCHER_DX2 - DX : - - - GEOM_SKETCHER_DY2 - DY : - - - GEOM_SKETCHER_DZ2 - DZ : - - - GEOM_SKETCHER_EL - Element Type - - - GEOM_SKETCHER_RESTORE - Restore - - - GEOM_SKETCHER_LENGTH - Length - - - GEOM_SKETCHER_LENGTH2 - Length : - - - GEOM_SKETCHER_NONE - None (Tangential) - - - GEOM_SKETCHER_PER - Perpendicular - - - GEOM_SKETCHER_POINT - Point - - - GEOM_SKETCHER_POINT2 - Point : - - - GEOM_SKETCHER_END_POINT2 - End Point : - - - GEOM_SKETCHER_RADIUS - Radius - - - GEOM_SKETCHER_RADIUS2 - Radius : - - - GEOM_SKETCHER_REL - Relative - - - GEOM_SKETCHER_SEGMENT - Segment - - - GEOM_SKETCHER_SEL - Selection - - - GEOM_SKETCHER_TAN - Tangent - - - GEOM_SKETCHER_TITLE - 2D Sketch Construction - - - GEOM_3DSKETCHER_TITLE - 3D Sketch Construction - - - GEOM_SKETCHER_TYPE - Type - - - GEOM_SKETCHER_UNDO - Undo - - - GEOM_SKETCHER_VALUES - Values - - - GEOM_SKETCHER_VX2 - VX : - - - GEOM_SKETCHER_VXVY - VX-VY - - - GEOM_SKETCHER_VY2 - VY : - - - GEOM_SKETCHER_X - X - - - GEOM_SKETCHER_X2 - X : - - - GEOM_SKETCHER_X3 - Abs. X : - - - GEOM_SKETCHER_Y - Y - - - GEOM_SKETCHER_Y2 - Y : - - - GEOM_SKETCHER_Y3 - Abs. Y : - - - GEOM_SKETCHER_Z2 - Z : - - - GEOM_3DSKETCHER - 3D Sketcher - - - GEOM_COORDINATES_TYPE - Coordinates Type - - - GEOM_SOLID - Solid - - - GEOM_SOLID_TITLE - Solid Construction - - - GEOM_SPHERE - Sphere - - - GEOM_SPHERE_CR - Center + Radius - - - GEOM_SPHERE_RO - Radius At Origin - - - GEOM_SPHERE_TITLE - Sphere Construction - - - GEOM_SPLINE - Spline - - - GEOM_SPLINE_TITLE - Spline Construction - - - GEOM_START_LCS - Start LCS - - - SELECT_UNPUBLISHED_EDGES - Select unpublished edges - - - GEOM_STEP - Step : - - - GEOM_STEP_TITLE - Step value for GUI constructions - - - GEOM_STEP_U - Step U : - - - GEOM_STEP_V - Step V : - - - GEOM_STUDY_LOCKED - The active study is locked and therefore cannot be modified - - - GEOM_SUBSHAPE_SELECT - Select Sub Shapes - - - GEOM_SUBSHAPE_TITLE - Sub Shapes Selection - - - GEOM_SUBSHAPE_TYPE - Sub Shapes Type - - - GEOM_SUB_SHAPE - Sub Shapes - - - GEOM_SUPPRESSHOLE_FACE_SHELL - Face or shell - - - GEOM_SUPPRESSHOLE_SELECTFACE - Select the face with hole - - - GEOM_SUPPRESSHOLE_SELECTFACE_END - Select end face (if hole traversing) - - - GEOM_SUPPRESSHOLE_SELECTWIRE - Select wire on face - - - GEOM_SUPPRESSHOLE_SELECTWIRE_END - Select end wire (if hole traversing) - - - GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE - Select hole(s) on the face - - - GEOM_SUPPRESSHOLE_TITLE - Suppress holes - - - GEOM_SUPPRESS_RESULT - Suppress Result - - - GEOM_SUPPRESS_RESULT_INSIDE - Inside - - - GEOM_SUPPRESS_RESULT_OUTSIDE - Outside - - - GEOM_SUPRESSFACE - Supress Face - - - GEOM_SUPRESSFACE_SELECT - Select Faces To Suppress - - - GEOM_SUPRESSFACE_TITLE - Suppress Faces In An Object - - - GEOM_SURFACE_CONTINUTY - Surface continuity - - - GEOM_SURFACE_MODE - Surface mode - - - GEOM_SURFCONE - Conical Face - - - GEOM_SURFCYLINDER - Cylindrical Face - - - GEOM_SURFSPHERE - Spherical Face - - - GEOM_SURFTORUS - Toroidal Face - - - GEOM_SameParameter - SameParameter - - - GEOM_SplitAngle - SplitAngle - - - GEOM_SplitClosedFaces - SplitClosedFaces - - - GEOM_SplitContinuity - SplitContinuity - - - GEOM_TOLERANCE - Tolerance - - - GEOM_TOLERANCE_CONSTR - Object And Its Tolerances - - - GEOM_TOLERANCE_EDGE - Edge : - - - GEOM_TOLERANCE_FACE - Face : - - - GEOM_TOLERANCE_TITLE - Maximum Tolerance - - - GEOM_TOLERANCE_VERTEX - Vertex : - - - GEOM_TOOL_OBJECT - Tool Object - - - GEOM_TOOL_OBJECTS - Tool Objects - - - GEOM_TORUS - Torus - - - GEOM_TORUS_TITLE - Torus Construction - - - GEOM_TRANSLATION - Translation - - - GEOM_TRANSLATION_COOR - Translation With Coordinates - - - GEOM_TRANSLATION_TITLE - Translation Of An Object - - - GEOM_TRANSPARENCY_OPAQUE - Opaque - - - GEOM_TRANSPARENCY_TITLE - Transparency - - - GEOM_TRANSPARENCY_TRANSPARENT - Transparent - - - GEOM_TRIHEDRON - Trihedron - - - GEOM_ToBezier - ToBezier - - - GEOM_VALUE - Value - - - GEOM_VECTOR - Vector - - - GEOM_VECTOR_LENGTH - Vector Length : - - - GEOM_VECTOR_TITLE - Vector Construction - - - GEOM_VECTOR_U - Vector U - - - GEOM_VECTOR_V - Vector V - - - GEOM_VERTEX - Vertex - - - GEOM_VERTEXES - Vertexes - - - GEOM_WATER_DENSITY - Water Density : - - - GEOM_WEIGHT - Weight : - - - GEOM_WIDTH - Width : - - - GEOM_WHATIS - Whatis - - - GEOM_WHATIS_OBJECT - Object And Its Topological Information - - - GEOM_WHATIS_TITLE - Whatis Information - - - GEOM_WIRE - Wire - - - GEOM_WIRES - Wire(s) - - - GEOM_WIRES_TO_REMOVE - Wires to remove - - - GEOM_WIREZ - Wires - - - GEOM_WIRE_CONNECT - Wire creation from wires/edges connected - - - GEOM_WIRE_TITLE - Create A Wire - - - GEOM_WPLANE - Working Plane - - - GEOM_WPLANE_FACE - Plane, Planar Face or LCS - - - GEOM_WPLANE_ORIGIN - Select a plane - - - GEOM_WPLANE_OXY - OXY - - - GEOM_WPLANE_OYZ - OYZ - - - GEOM_WPLANE_OZX - OZX - - - GEOM_WPLANE_TITLE - Working Plane Selection - - - GEOM_WPLANE_VECTOR - Select 2 vectors - - - GEOM_WPLANE_VX - Vector X - - - GEOM_WPLANE_VZ - Vector Z - - - GEOM_WRN_RADIUS_NULL - Radius is null - - - GEOM_WRN_WARNING - Warning - - - WRN_SHAPE_UNCLOSED - Unable to create solid from unclosed shape %1 - - - GEOM_X - X : - - - GEOM_Y - Y : - - - GEOM_Z - Z : - - - GLUE_NEW_OBJ_NAME - Glue - - - MEN_ALL_SEL_ONLY - Select All - - - MEN_ARC - Arc - - - MEN_ARCHIMEDE - Archimede - - - MEN_BASIC - Basic - - - MEN_BASIC_PROPS - Basic Properties - - - MEN_BLOCKS - Blocks - - - MEN_BND_BOX - Bounding Box - - - MEN_BOOLEAN - Boolean - - - MEN_BOX - Box - - - MEN_BUILD - Build - - - MEN_CHAMFER - Chamfer - - - MEN_CHANGE_ORIENTATION - Change Orientation - - - MEN_CHECK - Check Shape - - - MEN_CHECK_COMPOUND - Check Compound of Blocks - - - MEN_CHECK_FREE_BNDS - Check Free Boundaries - - - MEN_CHECK_FREE_FACES - Check Free Faces - - - MEN_CHECK_GEOMETRY - Check Geometry - - - MEN_CIRCLE - Circle - - - MEN_CLIPPING - Clipping Range - - - MEN_CLOSE_CONTOUR - Close Contour - - - MEN_COMMON - Common - - - MEN_COMPOUND - Compound - - - MEN_COMPOUND_SEL_ONLY - Compound - - - MEN_CONE - Cone - - - MEN_CURVE - Curve - - - MEN_CUT - Cut - - - MEN_CYLINDER - Cylinder - - - MEN_RECTANGLE - Rectangle - - - MEN_DELETE - Delete - - - MEN_DIMENSIONS - Dimensions - - - MEN_DISPLAY - Show - - - MEN_DISK - Disk - - - MEN_DISPLAY_ALL - Show All - - - MEN_DISPLAY_MODE - Display Mode - - - MEN_DISPLAY_ONLY - Show Only - - - MEN_EDGE - Edge - - - MEN_EDGE_SEL_ONLY - Edge - - - MEN_EDIT - Edit - - - MEN_ELLIPSE - Ellipse - - - MEN_ERASE - Hide - - - MEN_ERASE_ALL - Hide All - - - MEN_EXPLODE - Explode - - - MEN_EXPLODE_BLOCKS - Explode on Blocks - - - MEN_EXPORT - Export... - - - MEN_EXTRUSION - Extrusion - - - MEN_FACE - Face - - - MEN_FACE_SEL_ONLY - Face - - - MEN_FILE - File - - - MEN_FILLET - Fillet 3D - - - MEN_FILLET_1D - Fillet 1D - - - MEN_FILLET_2D - Fillet 2D - - - MEN_FILLING - Filling - - - MEN_FUSE - Fuse - - - MEN_GENERATION - Generation - - - MEN_GLUE_FACES - Glue Faces - - - MEN_GROUP - Group - - - MEN_GROUP_CREATE - Create - - - MEN_GROUP_EDIT - Edit - - - MEN_RELOAD_IMPORTED - Reload From Disk - - - MEN_HEX_SOLID - Hexahedral Solid - - - MEN_IMPORT - Import... - - - MEN_INERTIA - Inertia - - - MEN_ISOS - Isos - - - MEN_LINE - Line - - - MEN_LOCAL_CS - Local Coordinate System - - - MEN_MASS_CENTER - Center of Mass - - - MEN_MEASURES - Measures - - - MEN_MIN_DIST - Min Distance - - - MEN_MIRROR - Mirror Image - - - MEN_MODIFY_LOCATION - Modify Location - - - MEN_MUL_ROTATION - Multi-Rotation - - - MEN_MUL_TRANSFORM - Multi-Transformation - - - MEN_MUL_TRANSLATION - Multi-Translation - - - MEN_NEW_ENTITY - New Entity - - - MEN_OFFSET - Offset Surface - - - MEN_OPERATIONS - Operations - - - MEN_PARTITION - Partition - - - MEN_PIPE - Extrusion Along Path - - - MEN_PLANE - Plane - - - MEN_POINT - Point - - - MEN_POINT_COORDS - Point Coordinates - - - MEN_POINT_ON_EDGE - Add Point on Edge - - - MEN_POP_COLOR - Color - - - MEN_POP_CREATE_GROUP - Create Group - - - MEN_POP_SHOW_CHILDREN - Show Children - - - MEN_POP_HIDE_CHILDREN - Hide Children - - - MEN_POP_ISOS - Isos - - - MEN_POP_DEFLECTION - Deflection Coefficient - - - MEN_POP_RENAME - Rename - - - MEN_POP_SHADING - Shading - - - MEN_POP_TRANSPARENCY - Transparency - - - MEN_POP_WIREFRAME - Wireframe - - - MEN_POP_VECTORS - Show Edge Direction - - - MEN_PREFERENCES - Preferences - - - MEN_PREFERENCES_GEOM - Geometry - - - MEN_PRIMITIVES - Primitives - - - MEN_ADVANCED - Advanced - - - MEN_PROPAGATE - Propagate - - - MEN_Q_FACE - Quadrangle Face - - - MEN_REPAIR - Repair - - - MEN_REVOLUTION - Revolution - - - MEN_ROTATION - Rotation - - - MEN_SCALE - Scale Transform - - - MEN_SECTION - Section - - - MEN_SELECT_ONLY - Select Only - - - MEN_SEWING - Sewing - - - MEN_SHADING - Shading - - - MEN_SHADING_COLOR - Shading Color - - - MEN_SHAPE_PROCESS - Shape Processing - - - MEN_SHELL - Shell - - - MEN_SHELL_SEL_ONLY - Shell - - - MEN_SKETCH - 2D Sketch - - - MEN_3DSKETCH - 3D Sketch - - - MEN_SOLID - Solid - - - MEN_SOLID_SEL_ONLY - Solid - - - MEN_SPHERE - Sphere - - - MEN_STEP_VALUE - Step Value - - - MEN_SUPPERSS_HOLES - Suppress Holes - - - MEN_SUPPRESS_FACES - Suppress Faces - - - MEN_SUPPRESS_INT_WIRES - Suppress Internal Wires - - - MEN_TOLERANCE - Tolerance - - - MEN_TOOLS - Tools - - - MEN_TORUS - Torus - - - MEN_TRANSFORMATION - Transformation - - - MEN_TRANSLATION - Translation - - - MEN_VECTOR - Vector - - - MEN_VERTEX_SEL_ONLY - Vertex - - - MEN_VIEW - View - - - MEN_WHAT_IS - What is - - - MEN_WIRE - Wire - - - MEN_VECTOR_MODE_ON - Show Edge Direction - - - MEN_VECTOR_MODE_OFF - Hide Edge Direction - - - MEN_WIREFRAME - Wireframe - - - MEN_WIRE_SEL_ONLY - Wire - - - MEN_WORK_PLANE - Working Plane - - - MEN_POP_POINT_MARKER - Point Marker - - - NAME_LBL - Name: - - - NON_GEOM_OBJECTS_SELECTED - There are objects selected which do not belong to %1 component. - - - PREF_DEFLECTION - Deflection coefficient - - - GEOM_PREF_def_precision - Default precision - - - GEOM_PREF_length_precision - Length precision - - - GEOM_PREF_angle_precision - Angular precision - - - GEOM_PREF_len_tol_precision - Length tolerance precision - - - GEOM_PREF_ang_tol_precision - Angular tolerance precision - - - GEOM_PREF_weight_precision - Weight precision - - - GEOM_PREF_density_precision - Density precision - - - GEOM_PREF_parametric_precision - Parametric precision - - - GEOM_PREF_param_tol_precision - Parametric tolerance precision - - - PREF_DISPLAY_MODE - Default display mode - - - PREF_FREE_BOUND_COLOR - Color of free boundaries - - - PREF_GROUP_GENERAL - General - - - PREF_GROUP_OCCVIEWER - OCC Viewer 3d - - - GEOM_PREF_GROUP_PRECISION - Input fields precision - - - PREF_GROUP_VERTEX - Marker of Points - - - PREF_ISOS_COLOR - Color of isolines - - - PREF_LINE_COLOR - Color of edges, vectors, wires - - - PREF_MARKER_SCALE - Size - - - PREF_POINT_COLOR - Color of points - - - PREF_SHADING_COLOR - Default shading color - - - PREF_STEP_VALUE - Step value for spin boxes - - - PREF_TAB_SETTINGS - Settings - - - PREF_TYPE_OF_MARKER - Type - - - PREF_WIREFRAME_COLOR - Default wireframe color - - - PROCESS_SHAPE_NEW_OBJ_NAME - ProcessShape - - - REMOVE_HOLES_NEW_OBJ_NAME - SupressHoles - - - REMOVE_INT_WIRES_NEW_OBJ_NAME - RemoveIntWires - - - SEWING_NEW_OBJ_NAME - Sewing - - - STB_ALL_SEL_ONLY - Select all Objects - - - STB_ARC - Create an arc - - - STB_ARCHIMEDE - Archimede operation - - - STB_BASIC_PROPS - Show basic properties of the shape - - - STB_BND_BOX - Compute bounding box of the shape - - - STB_BOX - Create a box - - - STB_CHAMFER - Create a chamfer - - - STB_CHANGE_ORIENTATION - Change orientation - - - STB_CHECK - Check shape validity - - - STB_CHECK_COMPOUND - Check compound of blocks - - - STB_CHECK_FREE_BNDS - Check free boundaries - - - STB_CHECK_FREE_FACES - Check free faces - - - STB_CHECK_GEOMETRY - Check Geometry - - - STB_CIRCLE - Create a circle - - - STB_CLIPPING - Clipping range - - - STB_CLOSE_CONTOUR - Perform close contour - - - STB_COMMON - Common - - - STB_COMPOUND - Build a compound - - - STB_COMPOUND_SEL_ONLY - Select only a Compounds - - - STB_CONE - Create a cone - - - STB_CURVE - Create a curve - - - STB_CUT - Cut - - - STB_CYLINDER - Create a cylinder - - - STB_RECTANGLE - Create rectangular face - - - STB_DELETE - Delete object - - - STB_DISK - Create a disk - - - STB_DISPLAY - Show object(s) - - - STB_DISPLAY_ALL - Show all - - - STB_DISPLAY_ONLY - Show only - - - STB_EDGE - Build an edge - - - STB_EDGE_SEL_ONLY - Select only a Edges - - - STB_ELLIPSE - Create an ellipse - - - STB_ERASE - Hide object(s) - - - STB_ERASE_ALL - Hide all - - - STB_EXPLODE - Explode - - - STB_EXPLODE_BLOCKS - Explode on Blocks - - - STB_EXPORT - Export geometry to BREP file - - - STB_EXTRUSION - Create an extrusion - - - STB_FACE - Build a face - - - STB_FACE_SEL_ONLY - Select only a Faces - - - STB_FILLET - Create 3D fillet - - - STB_FILLET_1D - Create 1D fillet - - - STB_FILLET_2D - Create 2D fillet - - - STB_FILLING - Create a filling - - - STB_FUSE - Fuse - - - STB_GLUE_FACES - Perform glue faces - - - STB_GROUP_CREATE - Create a group - - - STB_GROUP_EDIT - Edit a group - - - STB_RELOAD_IMPORTED - Reload imported shape from its original place on disk - - - STB_HEX_SOLID - Hexahedral Solid - - - STB_IMPORT - Import geometry from BREP file - - - STB_INERTIA - Compute moments of intertia of the shape - - - STB_ISOS - Set number of isolines - - - STB_LINE - Create a line - - - STB_LOCAL_CS - Create a local coordinate system - - - STB_MASS_CENTER - Compute center of mass of the shape - - - STB_MIN_DIST - Compute minimum distance between two objects - - - STB_MIRROR - Mirror a shape - - - STB_MODIFY_LOCATION - Modify shape's location - - - STB_MUL_ROTATION - Perform multi-rotation - - - STB_MUL_TRANSFORM - Perform multi-transformation - - - STB_MUL_TRANSLATION - Perform multi-translation - - - STB_OFFSET - Offset surface - - - STB_PARTITION - Make a partition - - - STB_PIPE - Create a shape by extrusion along a path - - - STB_PLANE - Create a plane - - - STB_POINT - Create a point - - - STB_POINT_COORDS - Display point coordinates - - - STB_POINT_ON_EDGE - Add point on edge - - - STB_POP_COLOR - Color - - - STB_POP_CREATE_GROUP - Create Group - - - STB_POP_SHOW_CHILDREN - Show child objects - - - STB_POP_HIDE_CHILDREN - Hide child objects - - - STB_POP_ISOS - Isolines - - - STB_POP_DEFLECTION - Deflection Coefficient - - - STB_POP_RENAME - Rename - - - STB_POP_SHADING - Shading - - - STB_POP_TRANSPARENCY - Transparency - - - STB_POP_WIREFRAME - Wireframe - - - STB_PROPAGATE - Propagate - - - STB_Q_FACE - Quadrangle Face - - - STB_REVOLUTION - Create a revolution - - - STB_ROTATION - Rotate a shape - - - STB_SCALE - Scale a shape - - - STB_SECTION - Section - - - STB_SEWING - Perform sewing - - - STB_SHADING - Shading - - - STB_VECTOR_MODE - Change Edge Presentation Mode - - - STB_SHADING_COLOR - Set shading color - - - STB_SHAPE_PROCESS - Perform shape processing - - - STB_SHELL - Build a shell - - - STB_SHELL_SEL_ONLY - Select only a Shells - - - STB_SKETCH - Create 2D sketch - - - STB_3DSKETCH - Create 3D sketch - - - STB_SOLID - Build a solid - - - STB_SOLID_SEL_ONLY - Select only a Solids - - - STB_SPHERE - Create a sphere - - - STB_STEP_VALUE - Set step value - - - STB_SUPPERSS_HOLES - Perform suppress holes - - - STB_SUPPRESS_FACES - Perform suppress faces - - - STB_SUPPRESS_INT_WIRES - Perform suppress internal wires - - - STB_TOLERANCE - Compute tolerance of the shape - - - STB_TORUS - Create a torus - - - STB_TRANSLATION - Translate shape - - - STB_VECTOR - Create a vector - - - STB_VERTEX_SEL_ONLY - Select only a Points - - - STB_WHAT_IS - What is - - - STB_WIRE - Build a wire - - - STB_WIRE_SEL_ONLY - Select only a Wires - - - STB_WORK_PLANE - Create a working plane - - - STB_POP_POINT_MARKER - Set Point Marker - - - SUPPRESS_RESULT - Suppress Result - - - SUPRESS_FACE_NEW_OBJ_NAME - SupressFaces - - - ShHealOper_ErrorExecution_msg - Shape Healing algorithm failed - - - ShHealOper_InvalidParameters_msg - Incorrect parameters for Shape Healing algorithm - - - ShHealOper_NotError_msg - Shape Healing algorithm has done no modification of the original shape - - - TLT_RENAME - Rename - - - TOM_O - O - - - TOM_O_PLUS - + in O - - - TOM_O_POINT - . in O - - - TOM_O_STAR - * in O - - - TOM_O_X - X in O - - - TOM_PLUS - + - - - TOM_POINT - . - - - TOM_STAR - * - - - TOM_X - X - - - TOOL_BASIC - Basic - - - TOOL_BOOLEAN - Boolean operations - - - TOOL_GENERATION - Generation - - - TOOL_PRIMITIVES - Primitives - - - TOOL_TRANSFORMATION - Transformation - - - TOOL_BUILD - Build - - - TOOL_OPERATIONS - Operations - - - TOOL_ADVANCED - Advanced - - - TOOL_MEASURES - Measures - - - TOP_ARC - Create an arc - - - TOP_ARCHIMEDE - Archimede - - - TOP_BASIC_PROPS - Basic properties - - - TOP_BND_BOX - Bounding box - - - TOP_BOX - Create a box - - - TOP_CHAMFER - Chamfer - - - TOP_CHANGE_ORIENTATION - Change orientation - - - TOP_CHECK - Check shape - - - TOP_CHECK_COMPOUND - Check compound of blocks - - - TOP_CHECK_FREE_BNDS - Check free boundaries - - - TOP_CHECK_FREE_FACES - Check free faces - - - TOP_CHECK_GEOMETRY - Check Geometry - - - TOP_CIRCLE - Create a circle - - - TOP_CLIPPING - Clipping range - - - TOP_CLOSE_CONTOUR - Perform close contour - - - TOP_COMMON - Common - - - TOP_COMPOUND - Build compound - - - TOP_CONE - Create a cone - - - TOP_CURVE - Create a curve - - - TOP_CUT - Cut - - - TOP_CYLINDER - Create a cylinder - - - TOP_DELETE - Delete object - - - TOP_RECTANGLE - Create rectangular face - - - TOP_DISK - Create a disk - - - TOP_DISPLAY - Show - - - TOP_DISPLAY_ALL - Show all - - - TOP_DISPLAY_ONLY - Show only - - - TOP_EDGE - Build edge - - - TOP_ELLIPSE - Create an ellipse - - - TOP_ERASE - Hide - - - TOP_ERASE_ALL - Hide all - - - TOP_EXPLODE - Explode - - - TOP_EXPLODE_BLOCKS - Explode on Blocks - - - TOP_EXPORT - Export geometry to BREP file - - - TOP_EXTRUSION - Create an extrusion - - - TOP_FACE - Build face - - - TOP_FILLET - Fillet 3D - - - TOP_FILLET_1D - Fillet 1D - - - TOP_FILLET_2D - Fillet 2D - - - TOP_FILLING - Create a filling - - - TOP_FUSE - Fuse - - - TOP_GLUE_FACES - Perform glue faces - - - TOP_GROUP_CREATE - Create a group - - - TOP_GROUP_EDIT - Edit a group - - - TOP_HEX_SOLID - Hexahedral Solid - - - TOP_IMPORT - Import geometry from BREP file - - - TOP_INERTIA - Moments of intertia - - - TOP_ISOS - Set number of isolines - - - TOP_LINE - Create a line - - - TOP_LOCAL_CS - Create a local coordinate system - - - TOP_MASS_CENTER - Center of mass - - - TOP_MIN_DIST - Minimum distance - - - TOP_MIRROR - Mirror image - - - TOP_MODIFY_LOCATION - Modify location - - - TOP_MUL_ROTATION - Multi-Rotation - - - TOP_MUL_TRANSFORM - Multi-transformation - - - TOP_MUL_TRANSLATION - Multi-Translation - - - TOP_OFFSET - Offset surface - - - TOP_PARTITION - Partition - - - TOP_PIPE - Extrusion along path - - - TOP_PLANE - Create a plane - - - TOP_POINT - Create a point - - - TOP_POINT_COORDS - Point coordinates - - - TOP_POINT_ON_EDGE - Add point on edge - - - TOP_POP_COLOR - Color - - - TOP_POP_CREATE_GROUP - Create Group - - - TOP_POP_SHOW_CHILDREN - Show Children - - - TOP_POP_HIDE_CHILDREN - Hide Children - - - TOP_POP_ISOS - Isolines - - - TOP_POP_DEFLECTION - Deflection Coefficient - - - TOP_POP_RENAME - Rename - - - TOP_POP_SHADING - Shading - - - TOP_POP_TRANSPARENCY - Transparency - - - TOP_POP_WIREFRAME - Wireframe - - - TOP_PROPAGATE - Propagate - - - TOP_Q_FACE - Quadrangle Face - - - TOP_REVOLUTION - Create a revolution - - - TOP_ROTATION - Rotation - - - TOP_SCALE - Scale transform - - - TOP_SECTION - Section - - - TOP_SEWING - Perform sewing - - - TOP_SHADING - Shading - - - TOP_SHADING_COLOR - Set shading color - - - TOP_SHAPE_PROCESS - Perform shape processing - - - TOP_SHELL - Build shell - - - TOP_SKETCH - 2D sketch - - - TOP_3DSKETCH - 3D sketch - - - TOP_SOLID - Build solid - - - TOP_SPHERE - Create a sphere - - - TOP_STEP_VALUE - Set step value - - - TOP_SUPPERSS_HOLES - Perform suppress holes - - - TOP_SUPPRESS_FACES - Perform suppress faces - - - TOP_SUPPRESS_INT_WIRES - Perform suppress internal wires - - - TOP_TOLERANCE - Tolerance - - - TOP_TORUS - Create a torus - - - TOP_TRANSLATION - Translation - - - TOP_VECTOR - Create a vector - - - TOP_WHAT_IS - What is - - - TOP_WIRE - Build wire - - - TOP_WORK_PLANE - Create a working plane - - - TOP_POP_POINT_MARKER - Point Marker - - - WRN_NOT_IMPLEMENTED - Sorry, this functionality is not yet implemented - - - _S_ - (s) - - - NOT_FOUND_ANY - Not a single entity has been found - - - GEOM_FACE_I - Face %1 - - - GEOM_CONSTANT_RADIUS - Radius : - - - GEOM_R1 - R1 : - - - GEOM_R2 - R2 : - - - GEOM_BOTHWAY - Both Directions - - - GEOM_NORMALE - Normal To A Face - - - GEOM_VECTOR_NORMALE - Vector_Normal - - - GEOM_LINE1 - Line 1 - - - GEOM_LINE2 - Line 2 - - - GEOM_D - D : - - - GEOM_CHAMFER_EDGE - Chamfer On Selected Edges - - - SELECTED_EDGE - Selected Edges - - - GEOM_NORMALE_TITLE - Create Normal To A Face - - - GEOM_MEASURE_ANGLE_TITLE - Angle Between Two Straight Edges/Lines/Vectors - - - GEOM_MEASURE_ANGLE_ANGLE - Angle - - - GEOM_MEASURE_ANGLE_OBJ - Objects And Results - - - GEOM_MEASURE_ANGLE_IS - Angle in degrees : - - - GEOM_LINE_INTERSECTION - Point On Lines Intersection - - - GEOM_KEEP_NONLIMIT_SHAPES - Keep shapes of lower type - - - GEOM_CENTER_2POINTS - Center and two points - - - GEOM_REMOVE_EXTRA_EDGES_TITLE - Remove extra edges - - - GEOM_REMOVE_EXTRA_EDGES - Object to remove extra edges - - - GEOM_RMEE_UNION_FACES - Union faces, laying on common surface - - - REMOVE_EXTRA_EDGES_NEW_OBJ_NAME - NoExtraEdges - - - TOP_REMOVE_EXTRA_EDGES - Remove extra edges - - - MEN_REMOVE_EXTRA_EDGES - Remove Extra Edges - - - STB_REMOVE_EXTRA_EDGES - Remove extra edges - - - TOP_NORMALE - Normal to a face - - - MEN_NORMALE - Normal to a Face - - - STB_NORMALE - Compute normal to the face - - - TOP_MEASURE_ANGLE - Angle - - - MEN_MEASURE_ANGLE - Angle - - - STB_MEASURE_ANGLE - Compute angle between two lines or linear edges - - - TOP_POP_AUTO_COLOR - Auto color - - - MEN_POP_AUTO_COLOR - Auto Color - - - STB_POP_AUTO_COLOR - Auto color - - - TOP_POP_DISABLE_AUTO_COLOR - Disable auto color - - - MEN_POP_DISABLE_AUTO_COLOR - Disable Auto Color - - - STB_POP_DISABLE_AUTO_COLOR - Disable auto color - - - GEOM_RESULT_NAME_GRP - Result name - - - GEOM_RESULT_NAME_LBL - Name - - - GEOM_FILLING_APPROX - Approximation - - - GEOM_FILLING_METHOD - Method - - - GEOM_FILLING_DEFAULT - Default (standard behaviour) - - - GEOM_FILLING_USEORI - Use edges orientation - - - GEOM_FILLING_AUTO - Auto-correct edges orientation - - - GEOM_WRN_NO_APPROPRIATE_SELECTION - No appropriate objects selected - - - GEOM_SHAPES_ON_SHAPE - Get shapes on shape - - - GEOM_SHAPES_ON_SHAPE_ESHAPE - Shape for exploding - - - GEOM_SHAPES_ON_SHAPE_CSHAPE - Solid for checking - - - GEOM_SHAPES_ON_SHAPE_STATE - State - - - GEOM_KIND_OF_SHAPE - Kind of Shape : - - - GEOM_CLOSED - Closed - - - GEOM_UNCLOSED - Opened - - - GEOM_CLOSEDUNCLOSED - Not defined, Closed or Opened. Possibly, error occured. - - - GEOM_DISK_CIRCLE - Disk - - - GEOM_DISK_ELLIPSE - Elliptical face - - - GEOM_PLANAR_FACE - Planar Face - - - GEOM_PLANAR_EDGE_WIRE - Wire with Planar Edges - - - GEOM_POLYGON - Polygon - - - GEOM_POLYHEDRON - Polyhedron - - - GEOM_NORMAL - Normal direction - - - GEOM_DIRECTION - Direction - - - GEOM_UPARAMETER - U-parameter : - - - GEOM_VPARAMETER - V-parameter : - - - GEOM_X_I - X%1 : - - - GEOM_Y_I - Y%1 : - - - GEOM_Z_I - Z%1 : - - - GEOM_SHAPES_ON_SHAPE_TITLE - Get shapes on shape - - - GEOM_SCALE_FACTOR_X - Scale Factor X : - - - GEOM_SCALE_FACTOR_Y - Scale Factor Y : - - - GEOM_SCALE_FACTOR_Z - Scale Factor Z : - - - GEOM_STATE_IN - IN - - - GEOM_STATE_OUT - OUT - - - GEOM_STATE_ON - ON - - - GEOM_STATE_ONIN - ONIN - - - GEOM_STATE_ONOUT - ONOUT - - - GEOM_STATE_INOUT - INOUT - - - TOP_GET_SHAPES_ON_SHAPE - Get shapes on shape - - - MEN_GET_SHAPES_ON_SHAPE - Get Shapes on Shape - - - STB_GET_SHAPES_ON_SHAPE - Get shapes on shape - - - TOP_GET_SHARED_SHAPES - Get shared shapes - - - MEN_GET_SHARED_SHAPES - Get Shared Shapes - - - STB_GET_SHARED_SHAPES - Get shared shapes - - - GEOM_PUBLISH_RESULT_GRP - Advanced options - - - GEOM_RESTORE_SUB_SHAPES - Set presentation parameters and subshapes from arguments - - - GEOM_RSS_ADD_FREFIX - Add prefix to names of restored subshapes - - - GEOM_ALL_IMPORT_FILES - All supported formats ( %1 ) - - - GEOM_UNSUPPORTED_TYPE - Unsupported format for the file - - - GEOM_UNKNOWN_IMPORT_ERROR - Unknown error - - - GEOM_IMPORT_ERRORS - Import operation has finished with errors: - - - GEOM_PUBLISH_NAMED_SHAPES - Create groups for named shapes (if there are any)? - - - GEOM_SCALE_DIMENSIONS - Would you like to take into account the units? + + + iErr : 10 + the Classifier is NULL + + + iErr : 11 + the Shape is NULL + + + iErr : 12 + Unallowed Type of Subshape + + + iErr : 13 + Unallowed State + + + iErr : 15 + Unallowed Surface Type + + + iErr : 20 + Triangulation is not Found + + + iErr : 30 + Can not Obtain the Line From the Link + + + iErr : 40 + A Point Can Not Be Classified + + + iErr : 41 + Invalid Data for Classifier + + + GEOM_2D_CONTINUTY + 2D continuity + + + GEOM_2D_CURVE_MODE + 2D curve mode + + + GEOM_2D_TOLERANCE + 2D tolerance + + + GEOM_3D_CONTINUTY + 3D continuity + + + GEOM_3D_CURVE_MODE + 3D curve mode + + + GEOM_3D_TOLERANCE + 3D tolerance + + + GEOM_3_POINTS + 3 points + + + GEOM_ADD_POINT + Add point + + + GEOM_ANGLE + Angle : + + + GEOM_ANGLE_1 + Angle + + + GEOM_ARC_ELLIPSE + Arc of ellipse + + + GEOM_ARC + Arc + + + GEOM_ARCHIMEDE + Archimede + + + GEOM_ARCHIMEDE_TITLE + Archimede Construction + + + GEOM_ARC_TITLE + Arc Construction + + + GEOM_ARGUMENTS + Arguments + + + GEOM_AXE_MIRROR + Axe Mirror + + + GEOM_AXIS + Axis + + + GEOM_BASE + Base + + + GEOM_BASE_OBJECT + Base Object + + + GEOM_BASE_POINT + Base Point + + + GEOM_BEZIER + Bezier + + + GEOM_BINORMAL + BiNormal + + + GEOM_BLOCK + Hexahedral Solid + + + GEOM_BLOCKS_COMPOUND + BlocksCompound + + + GEOM_BLOCK_EXPLODE + Sub Blocks + + + GEOM_BLOCK_EXPLODE_TITLE + Sub Blocks Selection + + + GEOM_BLOCK_MULTITRSF + Block Multi-Transformation + + + GEOM_BLOCK_MULTITRSF_DOUBLE + Multi-Transformation Double + + + GEOM_BLOCK_MULTITRSF_SIMPLE + Multi-Transformation Simple + + + GEOM_BLOCK_MULTITRSF_TITLE + Block Multi-Transformation + + + GEOM_BLOCK_TITLE + Hexahedral Solid Construction + + + GEOM_BNDBOX + Bounding Box + + + GEOM_BNDBOX_OBJDIM + Object And Its Dimensions + + + GEOM_BNDBOX_TITLE + Bounding Box Information + + + GEOM_BOX + Box + + + GEOM_BOX_OBJ + Dimensions At Origin + + + GEOM_BOX_TITLE + Box Construction + + + GEOM_BSplineRestriction + BSplineRestriction + + + GEOM_BUT_APPLY + &Apply + + + GEOM_BUT_CANCEL + &Cancel + + + GEOM_BUT_CLOSE + &Close + + + GEOM_BUT_CLOSE_SKETCH + Sketch Closure + + + GEOM_BUT_END_SKETCH + Sketch Validation + + + GEOM_BUT_EXPLODE + &Explode + + + GEOM_BUT_HELP + &Help + + + GEOM_BUT_NO + &No + + + GEOM_BUT_OK + O&k + + + GEOM_BUT_APPLY_AND_CLOSE + A&pply and Close + + + GEOM_BUT_YES + &Yes + + + GEOM_BY_LENGTH + By length + + + GEOM_BY_PARAMETER + By parameter + + + GEOM_CENTER + Center + + + GEOM_CENTER_DEFAULT + (Origin by default) + + + GEOM_CENTER_POINT + Center Point + + + + GEOM_CENTRAL_POINT + Central Point + + + GEOM_CHAMFER + Chamfer + + + GEOM_CHAMFER_ABORT + Chamfer can't be computed with %1 and %2 + + + GEOM_CHAMFER_ALL + Chamfer On Whole Shape + + + GEOM_CHAMFER_EDGES + Chamfer On Edges From Shape + + + GEOM_CHAMFER_FACES + Chamfer On Faces From Shape + + + GEOM_CHAMFER_TITLE + Chamfer Construction + + + GEOM_CHANGE_ORIENTATION + Objects to change orientation + + + GEOM_CHANGE_ORIENTATION_TITLE + Change orientation + + + GEOM_CHECK_BLOCKS_COMPOUND + Check and Improve Blocks Compound + + + GEOM_CHECK_BLOCKS_COMPOUND_FAILED + Check failed + + + GEOM_CHECK_BLOCKS_COMPOUND_ERRORS + Errors + + + GEOM_CHECK_BLOCKS_COMPOUND_HAS_ERRORS + The Compound of Blocks has errors + + + GEOM_CHECK_BLOCKS_COMPOUND_HAS_NO_ERRORS + The Compound of Blocks has no errors + + + GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES + Incriminated Sub-Shapes + + + GEOM_CHECK_INFOS + Object And Its Topological Information + + + GEOM_CHECK_SHAPE + Check Shape + + + GEOM_CHECK_TITLE + Check Shape Information + + + GEOM_CIRCLE + Circle + + + GEOM_CIRCLE_TITLE + Circle Construction + + + GEOM_CLOSECONTOUR_TITLE + Close contour + + + GEOM_CMASS + Center Of Mass + + + GEOM_CMASS_TITLE + Center Of Mass Construction + + + GEOM_COMMON + Common + + + GEOM_COMMON_TITLE + Common Of Two Objects + + + GEOM_COMPOUND + Compound + + + GEOM_COMPOUNDSOLID + CompSolid + + + GEOM_COMPOUND_TITLE + Create A Compound + + + GEOM_CONE + Cone + + + GEOM_CONE_TITLE + Cone Construction + + + GEOM_CONFIRM + Confirm operation + + + GEOM_CONFIRM_INFO + Shape contains %1 sub shapes ! + + + GEOM_COOR + Coord. : + + + GEOM_COORDINATES + Coordinates + + + GEOM_COORDINATES_RES + Result coordinates + + + GEOM_CREATE_COPY + Create a copy + + + GEOM_CREATE_SINGLE_SOLID + Create a single solid + + + GEOM_CURVE + Curve + + + GEOM_CURVE_CONTINUTY + Curve continuity + + + GEOM_CURVE_TITLE + Curve Construction + + + GEOM_CUT + Cut + + + GEOM_CUT_TITLE + Cut Of Two Objects + + + GEOM_CYLINDER + Cylinder + + + GEOM_CYLINDER_TITLE + Cylinder Construction + + + GEOM_D1 + D1 : + + + GEOM_D2 + D2 : + + + GEOM_DETECT + Detect + + + GEOM_DIAGONAL_POINTS + Diagonal Points + + + GEOM_DISK + Disk + + + GEOM_DISK_TITLE + Disk Construction + + + GEOM_DIMENSIONS + Dimensions + + + GEOM_DISTANCE + Distance + + + GEOM_DIVIDE_EDGE_TITLE + Addition of point + + + GEOM_DX + Dx : + + + GEOM_DY + Dy : + + + GEOM_DZ + Dz : + + + GEOM_DropSmallEdges + DropSmallEdges + + + GEOM_EDGE + Edge + + + GEOM_EDGE_TITLE + Create An Edge + + + GEOM_ELLIPSE + Ellipse + + + GEOM_ELLIPSE_ERROR_1 + Error creating ellipse. Reason: minor radius is greater than major radius. + + + GEOM_ELLIPSE_TITLE + Ellipse Construction + + + GEOM_END_LCS + End LCS + + + GEOM_ERROR + Error + + + GEOM_ERROR_STATUS + Operation status + + + GEOM_ERR_GET_ENGINE + Failed to obtain GEOM Engine component. Reload Geometry module and try again. + + + GEOM_ERR_LIB_NOT_FOUND + GUI library corresponding to the user action can not be found or loaded + + + GEOM_EXTRUSION + Extrusion + + + GEOM_EXTRUSION_BSV + Base Shapes + Vector + + + GEOM_EXTRUSION_BSV_2P + Base Shapes + 2 Points + + + GEOM_EXTRUSION_DXDYDZ + Base Shapes + DX DY DZ Vector + + + GEOM_EXTRUSION_TITLE + Construction by Extrusion + + + GEOM_FACE + Face + + + GEOM_CS + Coordinate system + + + GEOM_GCS + Global coordinate system + + + GEOM_LCS + Local coordinate system + + + GEOM_FACES + Faces + + + GEOM_FACE_FFW + Face creation from wires and/or edges + + + GEOM_FACE_OPT + Try to create a planar face + + + GEOM_FACE_OR_LCS + Face or LCS + + + GEOM_FACE_SELECTION + Face Selection + + + GEOM_FACE_TITLE + Create A Face + + + GEOM_RECTANGLE_TITLE + Rectangle Construction + + + GEOM_RECTANGLE + Rectangle + + + GEOM_FILLET + Fillet + + + GEOM_FILLET_2D + Fillet 2D + + + GEOM_FILLET_1D + Fillet 1D + + + GEOM_FILLET_ABORT + Fillet can't be computed with radius %1 + + + GEOM_FILLET_ALL + Fillet On Whole Shape + + + GEOM_FILLET_EDGES + Fillet On Edges From Shape + + + GEOM_FILLET_WIRES + Fillet On Wires From Shape + + + GEOM_FILLET_FACES + Fillet On Faces From Shape + + + GEOM_FILLET_VERTEXES + Fillet On Vertexes From Face + + + GEOM_FILLET_TITLE + Fillet Construction + + + GEOM_FILLET_2D_TITLE + 2D Fillet Construction + + + GEOM_FILLET_1D_TITLE + 1D Fillet Construction + + + GEOM_FILLING + Filling + + + GEOM_FILLING_ARG + Arguments And Parameters + + + GEOM_FILLING_COMPOUND + Input compound + + + GEOM_FILLING_MAX_DEG + Max deg + + + GEOM_FILLING_MIN_DEG + Min deg + + + GEOM_FILLING_NB_ITER + Nb. Iter : + + + GEOM_FILLING_TITLE + Filling Surface With Edges + + + GEOM_FILLING_TOL_2D + Tol. 2D : + + + GEOM_FILLING_TOL_3D + Tol. 3D : + + + GEOM_FREE_BOUNDARIES + Free boundaries + + + GEOM_FREE_BOUNDS_ERROR + Object is not selected + + + GEOM_FREE_BOUNDS_MSG + Number of free boundaries detected: %1 (%2 closed, %3 open) + + + GEOM_FREE_BOUNDS_TLT + Free boundary detection + + + GEOM_FREE_FACES + Free faces + + + GEOM_FREE_FACES_TITLE + Free faces + + + GEOM_FUSE + Fuse + + + GEOM_FUSE_TITLE + Fuse Two Objects + + + GEOM_FixFaceSize + FixFaceSize + + + GEOM_FixShape + FixShape + + + GEOM_GLUE + Glue + + + GEOM_GLUE_TITLE + Glue faces + + + GEOM_LIMIT_TOLERANCE_TITLE + Limit tolerance + + + GEOM_HEIGHT + Height : + + + GEOM_HOLES + Holes + + + GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE + Identical names : select by mouse ! + + + GEOM_IMPORT + Imported_Shape + + + GEOM_INCORRECT_INPUT + Incorrect Input Data! + + + GEOM_INERTIA_CONSTR + Matrix And Moments Of Inertia + + + GEOM_INERTIA_I + %1:1 : + + + GEOM_INERTIA_IXYZ + IX & IY & IZ : + + + GEOM_INERTIA_TITLE + Calculs Of Inertia + + + GEOM_INF_LOADED + File %1 loaded. + + + GEOM_INTERNAL_WIRES + Internal wires + + + GEOM_INTERPOL + Interpolation + + + GEOM_KEEP_OBJECT + Keep Object + + + GEOM_LENGTH + Length : + + + GEOM_LINE + Line + + + GEOM_LINE_TITLE + Line Construction + + + GEOM_MAIN_OBJECT + Main Object + + + GEOM_MARKER + Marker + + + GEOM_MARKER_TITLE + Create marker + + + GEOM_MATERIAL_ID + Material ID: + + + GEOM_MATERIAL_MATERIAL + Material + + + GEOM_MATERIAL_SET + << Set + + + GEOM_MATERIAL_SHAPE + Shapes + + + GEOM_MATERIAL_TITLE + Define materials for Dominant Fuse + + + GEOM_MATRIX + Matrix : + + + GEOM_MAX + Max : + + + GEOM_MAX_3D_TOLERANCE + Max 3D tolerance + + + GEOM_MAX_TOLERANCE + Max tolerance + + + GEOM_MEN_ALL_FILES + All Files ( * ) + + + GEOM_MEN_ANGLE + Angle : + + + GEOM_MEN_COMPONENT + Geometry + + + GEOM_MEN_ENTER_ANGLE + Enter An Angle In Degrees + + + GEOM_MEN_EXPORT + Export + + + GEOM_MEN_IMPORT + Import + + + GEOM_MEN_ISOS + Select Number Of Isos + + + GEOM_MEN_ISOU + Isos U : + + + GEOM_MEN_ISOV + Isos V : + + + GEOM_MEN_POPUP_NAME + %1 Objects + + + GEOM_MEN_SHADING + Shading + + + GEOM_MEN_SKETCHER_X + Enter a Length to Set X + + + GEOM_MEN_SKETCHER_Y + Enter a Length to Set Y + + + GEOM_MEN_STEP_LABEL + Step : + + + GEOM_MEN_TRANSPARENCY + Transparency + + + GEOM_MEN_TRANSPARENCY_LABEL + Transparency : + + + GEOM_MEN_WIREFRAME + Wireframe + + + GEOM_MEN_X + X : + + + GEOM_MEN_Y + Y : + + + GEOM_MESHING_DEFLECTION + Meshing Deflect. : + + + GEOM_MIN + Min : + + + GEOM_MINDIST_OBJ + Objects And Results + + + GEOM_MINDIST_TITLE + Minimun Distance Between Two Objects + + + GEOM_MIRROR + Mirror + + + GEOM_MIRROR_TITLE + Mirror An Object + + + GEOM_MULTIROTATION + Multi-Rotation + + + GEOM_MULTIROTATION_DOUBLE + Multi Rotation Double + + + GEOM_MULTIROTATION_SIMPLE + Multi Rotation Simple + + + GEOM_MULTIROTATION_TITLE + Multi-Rotation + + + GEOM_MULTITRANSLATION + Multi-Translation + + + GEOM_MULTITRANSLATION_DOUBLE + Multi Translation Double + + + GEOM_MULTITRANSLATION_SIMPLE + Multi Translation Simple + + + GEOM_MULTITRANSLATION_TITLE + Multi-Translation + + + GEOM_NAME_INCORRECT + Object name not found + + + GEOM_NB_BLOCKS_NO_OTHERS + There are %1 specified blocks and NO other solids + + + GEOM_NB_BLOCKS_SOME_OTHERS + There are %1 specified blocks and some other solids + + + GEOM_NB_TIMES + Nb. Times : + + + GEOM_NB_TIMES_U + Nb. Times U : + + + GEOM_NB_TIMES_V + Nb. Times V : + + + GEOM_NODES + Nodes + + + GEOM_NUM_SPLIT_POINTS + Number of splitting points + + + GEOM_OBJECT + Object + + + GEOM_OBJECT_TYPE + Object Type + + + GEOM_OBJECTS + Objects + + + GEOM_OBJECT_I + Object %1 + + + GEOM_OBJECT_RESULT + Object And Result + + + GEOM_OFFSET + Offset + + + GEOM_OFFSET_TITLE + Offset Surface + + + GEOM_OPERATIONS + Operations + + + GEOM_ORIENTATION + Orientation + + + GEOM_ORIENTATION_OPT + Reverse orientation with normal vectors simulation + + + GEOM_ORIENTATION_TITLE + Change Orientation + + + GEOM_PARAMETER + Parameter : + + + GEOM_PARAMETERS + Parameters + + + GEOM_POINT_ON_EDGE + Point on Edge + + + GEOM_POINT_ON_FACE + Point on Face + + + GEOM_PARAM_VALUE + By parameter + + + GEOM_COORD_VALUE + By coordinate + + + GEOM_PARTITION + Partition + + + GEOM_WRN_PARTITION_RESULT_EMPTY + The partition result is empty, please verify the reconstruction limit parameter. + + + GEOM_PARTITION_HALFSPACE + Half-space partition + + + GEOM_PARTITION_ORIENTATION + Change Orientation + + + GEOM_PARTITION_TITLE + Partition Of Object With Tool + + + GEOM_PATH_OBJECT + Path Object + + + GEOM_PIPE + Pipe + + + GEOM_PIPE_TITLE + Pipe Construction + + + GEOM_SEGMENT + Segment of straight line + + + GEOM_SELECT_UNPUBLISHED_EDGES + Select unpublished edges + + + GEOM_PLANE + Plane + + + GEOM_PLANE_MIRROR + Plane Mirror + + + GEOM_PLANE_PV + Point + Vector + + + GEOM_PLANE_PVC + Point + Coordinate Vector + + + GEOM_PLANE_SIZE + Size of plane : + + + GEOM_PLANE_TITLE + Plane Construction + + + GEOM_POINT + Point + + + GEOM_POINT1 + Point 1 + + + GEOM_POINT2 + Point 2 + + + GEOM_POINT3 + Point 3 + + + GEOM_POINTS + Points + + + GEOM_POINT_I + Point %1 + + + GEOM_POINT_MIRROR + Point Mirror + + + GEOM_POINT_TITLE + Point Construction + + + GEOM_POLYLINE + Polyline + + + GEOM_POSITION + Location + + + GEOM_POSITION_TITLE + Modify the Location of an Object + + + GEOM_PRECISION + Precision : + + + GEOM_PROPAGATE + Propagate + + + GEOM_PROPAGATE_TITLE + Propagate + + + GEOM_PROPERTIES + Basic Properties + + + GEOM_PROPERTIES_CONSTR + Object And Its Properties + + + GEOM_PROPERTIES_SURFACE + Surface is : + + + GEOM_PROPERTIES_TITLE + Basic Properties Information + + + GEOM_PROPERTIES_VOLUME + Volume is : + + + GEOM_PRP_ABORT + Operation aborted + + + GEOM_PRP_COMMAND + No command associated with this id = %1. + + + GEOM_PRP_DONE + Operation done + + + GEOM_PRP_EXPORT + Exporting geometry to %1 ... + + + GEOM_PRP_LOADING + Loading %1 ... + + + GEOM_PRP_MIN_DIST + Min Distance not computed + + + GEOM_PRP_NOT_FOR_VTK_VIEWER + Not allowed in VTK viewer + + + GEOM_PRP_NULLSHAPE + Error, null or inappropriate shape ! + + + GEOM_PRP_READY + Ready + + + GEOM_PRP_SELECT_EDGE + Select edges and click on Apply + + + GEOM_PRP_SELECT_FACE + Select faces to suppress and click on Ok/Apply + + + GEOM_PRP_SELECT_FIRST + Select main shape first + + + GEOM_PRP_SELECT_SUBSHAPES + Select Sub Shapes + + + GEOM_PRP_SHAPE_IN_STUDY + Main shape must be in the study before + + + GEOM_QUAD_FACE + Quadrangle Face + + + GEOM_QUAD_FACE_TITLE + Quadrangle Face Construction + + + GEOM_RADIUS + Radius : + + + GEOM_RADIUS_I + Radius %1 : + + + GEOM_RADIUS_MAJOR + Major radius : + + + GEOM_RADIUS_MINOR + Minor radius : + + + GEOM_RECONSTRUCTION_LIMIT + Resulting Type + + + GEOM_RECONSTRUCTION_LIMIT_EDGE + Edge + + + GEOM_RECONSTRUCTION_LIMIT_FACE + Face + + + GEOM_RECONSTRUCTION_LIMIT_SHAPE + Shape + + + GEOM_RECONSTRUCTION_LIMIT_SHELL + Shell + + + GEOM_RECONSTRUCTION_LIMIT_SOLID + Solid + + + GEOM_RECONSTRUCTION_LIMIT_VERTEX + Vertex + + + GEOM_RECONSTRUCTION_LIMIT_WIRE + Wire + + + GEOM_REF_POINT + Point with reference + + + GEOM_REMOVE_ALL_HOLES + Remove all holes + + + GEOM_REMOVE_ALL_INT_WIRES + Remove all internal wires + + + GEOM_REMOVE_HOLES_TITLE + Suppress holes + + + GEOM_REMOVE_INTERNAL_WIRES_TITLE + Suppress internal wires + + + GEOM_REMOVE_WEBS + Remove webs + + + GEOM_REQUIRED_DEGREE + Required degree + + + GEOM_REQUIRED_NUM_SEGMENTS + Required number of segments + + + GEOM_REVERSE + Reverse + + + GEOM_REVERSE_DIRECTION + Reverse Direction + + + GEOM_REVERSE_PLANE + Reverse the plane normal + + + GEOM_REVERSE_U + Reverse U + + + GEOM_REVERSE_V + Reverse V + + + GEOM_REVERSE_VECTOR + Reverse Vector + + + GEOM_REVOLUTION + Revolution + + + GEOM_REVOLUTION_TITLE + Construction By Revolution + + + GEOM_ROTATION + Rotation + + + GEOM_ROTATION_TITLE + Rotation Of An Object + + + GEOM_SCALE + Scale + + + GEOM_SCALE_FACTOR + Scale Factor : + + + GEOM_SCALE_TITLE + Scale An Object + + + GEOM_SECTION + Section + + + GEOM_SECTION_TITLE + Section Of Two Objects + + + GEOM_SELECTED_FACE + Selected face + + + GEOM_SELECTED_OBJECTS + Selected objects + + + GEOM_SELECTED_SHAPE + Selected shape + + + GEOM_SELECTION + Selection + + + GEOM_SET_MATERIALS + Set materials + + + GEOM_SEWING + Sewing + + + GEOM_SEWING_TITLE + Topological sewing + + + GEOM_SHAPE + Shape + + + GEOM_SHAPEPROCESS_TITLE + Shape Processing + + + GEOM_SHAPES + Shapes + + + GEOM_SHELL + Shell + + + GEOM_SHELLS + Shells + + + GEOM_SHELL_TITLE + Shell Construction + + + GEOM_SKETCHER_ABS + Absolute + + + GEOM_SKETCHER_ADD_PARAMS + Additionnal Parameters + + + GEOM_SKETCHER_ANGLE + Angle + + + GEOM_SKETCHER_ANGLE2 + Angle : + + + GEOM_SKETCHER_APPLY + Apply + + + GEOM_SKETCHER_ARC + Arc + + + GEOM_SKETCHER_CENTER + Center + + + GEOM_SKETCHER_CENTER2 + Center : + + + GEOM_SKETCHER_CENTER_X + Center X coord. : + + + GEOM_SKETCHER_CENTER_Y + Center Y coord. : + + + GEOM_SKETCHER_CENTER_DX + Center DX coord. : + + + GEOM_SKETCHER_CENTER_DY + Center DY coord. : + + + GEOM_SKETCHER_DEST + Destination + + + GEOM_SKETCHER_DIR + Direction + + + GEOM_SKETCHER_DX2 + DX : + + + GEOM_SKETCHER_DY2 + DY : + + + GEOM_SKETCHER_DZ2 + DZ : + + + GEOM_SKETCHER_EL + Element Type + + + GEOM_SKETCHER_RESTORE + Restore + + + GEOM_SKETCHER_LENGTH + Length + + + GEOM_SKETCHER_LENGTH2 + Length : + + + GEOM_SKETCHER_NONE + None (Tangential) + + + GEOM_SKETCHER_PER + Perpendicular + + + GEOM_SKETCHER_POINT + Point + + + GEOM_SKETCHER_POINT2 + Point : + + + GEOM_SKETCHER_END_POINT2 + End Point : + + + GEOM_SKETCHER_RADIUS + Radius + + + GEOM_SKETCHER_RADIUS2 + Radius : + + + GEOM_SKETCHER_REL + Relative + + + GEOM_SKETCHER_SEGMENT + Segment + + + GEOM_SKETCHER_SEL + Selection + + + GEOM_SKETCHER_TAN + Tangent + + + GEOM_SKETCHER_TITLE + 2D Sketch Construction + + + GEOM_3DSKETCHER_TITLE + 3D Sketch Construction + + + GEOM_SKETCHER_TYPE + Type + + + GEOM_SKETCHER_UNDO + Undo + + + GEOM_SKETCHER_VALUES + Values + + + GEOM_SKETCHER_VX2 + VX : + + + GEOM_SKETCHER_VXVY + VX-VY + + + GEOM_SKETCHER_VY2 + VY : + + + GEOM_SKETCHER_X + X + + + GEOM_SKETCHER_X2 + X : + + + GEOM_SKETCHER_X3 + Abs. X : + + + GEOM_SKETCHER_Y + Y + + + GEOM_SKETCHER_Y2 + Y : + + + GEOM_SKETCHER_Y3 + Abs. Y : + + + GEOM_SKETCHER_Z2 + Z : + + + GEOM_3DSKETCHER + 3D Sketcher + + + GEOM_COORDINATES_TYPE + Coordinates Type + + + GEOM_SOLID + Solid + + + GEOM_SOLID_TITLE + Solid Construction + + + GEOM_SPHERE + Sphere + + + GEOM_SPHERE_CR + Center + Radius + + + GEOM_SPHERE_RO + Radius At Origin + + + GEOM_SPHERE_TITLE + Sphere Construction + + + GEOM_SPLINE + Spline + + + GEOM_SPLINE_TITLE + Spline Construction + + + GEOM_START_LCS + Start LCS + + + SELECT_UNPUBLISHED_EDGES + Select unpublished edges + + + GEOM_STEP + Step : + + + GEOM_STEP_TITLE + Step value for GUI constructions + + + GEOM_STEP_U + Step U : + + + GEOM_STEP_V + Step V : + + + GEOM_STUDY_LOCKED + The active study is locked and therefore cannot be modified + + + GEOM_SUBSHAPE_SELECT + Select Sub Shapes + + + GEOM_SUBSHAPE_TITLE + Sub Shapes Selection + + + GEOM_SUBSHAPE_TYPE + Sub Shapes Type + + + GEOM_SUB_SHAPE + Sub Shapes + + + GEOM_SUPPRESSHOLE_FACE_SHELL + Face or shell + + + GEOM_SUPPRESSHOLE_SELECTFACE + Select the face with hole + + + GEOM_SUPPRESSHOLE_SELECTFACE_END + Select end face (if hole traversing) + + + GEOM_SUPPRESSHOLE_SELECTWIRE + Select wire on face + + + GEOM_SUPPRESSHOLE_SELECTWIRE_END + Select end wire (if hole traversing) + + + GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE + Select hole(s) on the face + + + GEOM_SUPPRESSHOLE_TITLE + Suppress holes + + + GEOM_SUPPRESS_RESULT + Suppress Result + + + GEOM_SUPPRESS_RESULT_INSIDE + Inside + + + GEOM_SUPPRESS_RESULT_OUTSIDE + Outside + + + GEOM_SUPRESSFACE + Supress Face + + + GEOM_SUPRESSFACE_SELECT + Select Faces To Suppress + + + GEOM_SUPRESSFACE_TITLE + Suppress Faces In An Object + + + GEOM_SURFACE_CONTINUTY + Surface continuity + + + GEOM_SURFACE_MODE + Surface mode + + + GEOM_SURFCONE + Conical Face + + + GEOM_SURFCYLINDER + Cylindrical Face + + + GEOM_SURFSPHERE + Spherical Face + + + GEOM_SURFTORUS + Toroidal Face + + + GEOM_SameParameter + SameParameter + + + GEOM_SplitAngle + SplitAngle + + + GEOM_SplitClosedFaces + SplitClosedFaces + + + GEOM_SplitContinuity + SplitContinuity + + + GEOM_TOLERANCE + Tolerance + + + GEOM_LINEAR_TOLERANCE + Linear Tolerance + + + GEOM_ANGULAR_TOLERANCE + Angular Tolerance + + + GEOM_TOLERANCE_CONSTR + Object And Its Tolerances + + + GEOM_TOLERANCE_EDGE + Edge : + + + GEOM_TOLERANCE_FACE + Face : + + + GEOM_TOLERANCE_TITLE + Maximum Tolerance + + + GEOM_TOLERANCE_VERTEX + Vertex : + + + GEOM_TOOL_OBJECT + Tool Object + + + GEOM_TOOL_OBJECTS + Tool Objects + + + GEOM_TORUS + Torus + + + GEOM_TORUS_TITLE + Torus Construction + + + GEOM_TRANSLATION + Translation + + + GEOM_TRANSLATION_COOR + Translation With Coordinates + + + GEOM_TRANSLATION_TITLE + Translation Of An Object + + + GEOM_TRANSPARENCY_OPAQUE + Opaque + + + GEOM_TRANSPARENCY_TITLE + Transparency + + + GEOM_TRANSPARENCY_TRANSPARENT + Transparent + + + GEOM_TRIHEDRON + Trihedron + + + GEOM_ToBezier + ToBezier + + + GEOM_VALUE + Value + + + GEOM_VECTOR + Vector + + + GEOM_AXIS_DEFAULT + (Z axis by default) + + + + GEOM_VECTOR_LENGTH + Vector Length : + + + GEOM_VECTOR_TITLE + Vector Construction + + + GEOM_VECTOR_U + Vector U + + + GEOM_VECTOR_V + Vector V + + + GEOM_VERTEX + Vertex + + + GEOM_VERTEXES + Vertexes + + + GEOM_WATER_DENSITY + Water Density : + + + GEOM_WEIGHT + Weight : + + + GEOM_WIDTH + Width : + + + GEOM_WHATIS + Whatis + + + GEOM_WHATIS_OBJECT + Object And Its Topological Information + + + GEOM_WHATIS_TITLE + Whatis Information + + + GEOM_WIRE + Wire + + + GEOM_WIRES + Wire(s) + + + GEOM_WIRES_TO_REMOVE + Wires to remove + + + GEOM_WIREZ + Wires + + + GEOM_WIRE_CONNECT + Wire creation from wires/edges connected + + + GEOM_WIRE_TITLE + Create A Wire + + + GEOM_WPLANE + Working Plane + + + GEOM_WPLANE_FACE + Plane, Planar Face or LCS + + + GEOM_WPLANE_ORIGIN + Select a plane + + + GEOM_WPLANE_OXY + OXY + + + GEOM_WPLANE_OYZ + OYZ + + + GEOM_WPLANE_OZX + OZX + + + GEOM_WPLANE_TITLE + Working Plane Selection + + + GEOM_WPLANE_VECTOR + Select 2 vectors + + + GEOM_WPLANE_VX + Vector X + + + GEOM_WPLANE_VZ + Vector Z + + + GEOM_WRN_RADIUS_NULL + Radius is null + + + GEOM_WRN_WARNING + Warning + + + WRN_SHAPE_UNCLOSED + Unable to create solid from unclosed shape %1 + + + GEOM_X + X : + + + GEOM_Y + Y : + + + GEOM_Z + Z : + + + GLUE_NEW_OBJ_NAME + Glue + + + LIMIT_TOLERANCE_NEW_OBJ_NAME + Limit_tolerance + + + MEN_ALL_SEL_ONLY + Select All + + + MEN_ARC + Arc + + + MEN_ARCHIMEDE + Archimede + + + MEN_BASIC + Basic + + + MEN_BASIC_PROPS + Basic Properties + + + MEN_BLOCKS + Blocks + + + MEN_BND_BOX + Bounding Box + + + MEN_BOOLEAN + Boolean + + + MEN_BOX + Box + + + MEN_BUILD + Build + + + MEN_CHAMFER + Chamfer + + + MEN_CHANGE_ORIENTATION + Change Orientation + + + MEN_CHECK + Check Shape + + + MEN_CHECK_COMPOUND + Check Compound of Blocks + + + MEN_CHECK_FREE_BNDS + Check Free Boundaries + + + MEN_CHECK_FREE_FACES + Check Free Faces + + + MEN_CHECK_GEOMETRY + Check Geometry + + + MEN_CIRCLE + Circle + + + MEN_CLIPPING + Clipping Range + + + MEN_CLOSE_CONTOUR + Close Contour + + + MEN_COMMON + Common + + + MEN_COMPOUND + Compound + + + MEN_COMPOUND_SEL_ONLY + Compound + + + MEN_CONE + Cone + + + MEN_CURVE + Curve + + + MEN_CUT + Cut + + + MEN_CYLINDER + Cylinder + + + MEN_RECTANGLE + Rectangle + + + MEN_DELETE + Delete + + + MEN_DIMENSIONS + Dimensions + + + MEN_DISPLAY + Show + + + MEN_DISK + Disk + + + MEN_DISPLAY_ALL + Show All + + + MEN_DISPLAY_MODE + Display Mode + + + MEN_DISPLAY_ONLY + Show Only + + + MEN_EDGE + Edge + + + MEN_EDGE_SEL_ONLY + Edge + + + MEN_EDIT + Edit + + + MEN_ELLIPSE + Ellipse + + + MEN_ERASE + Hide + + + MEN_ERASE_ALL + Hide All + + + MEN_EXPLODE + Explode + + + MEN_EXPLODE_BLOCKS + Explode on Blocks + + + MEN_EXPORT + Export... + + + MEN_EXTRUSION + Extrusion + + + MEN_FACE + Face + + + MEN_FACE_SEL_ONLY + Face + + + MEN_FILE + File + + + MEN_FILLET + Fillet 3D + + + MEN_FILLET_1D + Fillet 1D + + + MEN_FILLET_2D + Fillet 2D + + + MEN_FILLING + Filling + + + MEN_FUSE + Fuse + + + MEN_GENERATION + Generation + + + MEN_GLUE_FACES + Glue Faces + + + MEN_GROUP + Group + + + MEN_GROUP_CREATE + Create + + + MEN_GROUP_EDIT + Edit + + + MEN_RELOAD_IMPORTED + Reload From Disk + + + MEN_HEX_SOLID + Hexahedral Solid + + + MEN_IMPORT + Import... + + + MEN_INERTIA + Inertia + + + MEN_ISOS + Isos + + + MEN_LIMIT_TOLERANCE + Limit tolerance + + + MEN_LINE + Line + + + MEN_LOCAL_CS + Local Coordinate System + + + MEN_MASS_CENTER + Center of Mass + + + MEN_MEASURES + Measures + + + MEN_MIN_DIST + Min Distance + + + MEN_MIRROR + Mirror Image + + + MEN_MODIFY_LOCATION + Modify Location + + + MEN_MUL_ROTATION + Multi-Rotation + + + MEN_MUL_TRANSFORM + Multi-Transformation + + + MEN_MUL_TRANSLATION + Multi-Translation + + + MEN_NEW_ENTITY + New Entity + + + MEN_OFFSET + Offset Surface + + + MEN_OPERATIONS + Operations + + + MEN_ORIGIN_AND_VECTORS + Origin and Base Vectors + + + MEN_PARTITION + Partition + + + MEN_PIPE + Extrusion Along Path + + + MEN_PLANE + Plane + + + MEN_POINT + Point + + + MEN_POINT_COORDS + Point Coordinates + + + MEN_POINT_ON_EDGE + Add Point on Edge + + + MEN_POP_COLOR + Color + + + MEN_POP_CREATE_GROUP + Create Group + + + MEN_POP_SHOW_CHILDREN + Show Children + + + MEN_POP_HIDE_CHILDREN + Hide Children + + + MEN_POP_ISOS + Isos + + + MEN_POP_DEFLECTION + Deflection Coefficient + + + MEN_POP_RENAME + Rename + + + MEN_POP_SHADING + Shading + + + MEN_POP_TRANSPARENCY + Transparency + + + MEN_POP_WIREFRAME + Wireframe + + + MEN_POP_VECTORS + Show Edge Direction + + + MEN_PREFERENCES + Preferences + + + MEN_PREFERENCES_GEOM + Geometry + + + MEN_PRIMITIVES + Primitives + + + MEN_ADVANCED + Advanced + + + MEN_PROPAGATE + Propagate + + + MEN_Q_FACE + Quadrangle Face + + + MEN_REPAIR + Repair + + + MEN_REVOLUTION + Revolution + + + MEN_ROTATION + Rotation + + + MEN_SCALE + Scale Transform + + + MEN_SECTION + Section + + + MEN_SELECT_ONLY + Select Only + + + MEN_SEWING + Sewing + + + MEN_SHADING + Shading + + + MEN_SHADING_COLOR + Shading Color + + + MEN_SHAPE_PROCESS + Shape Processing + + + MEN_SHELL + Shell + + + MEN_SHELL_SEL_ONLY + Shell + + + MEN_SKETCH + 2D Sketch + + + MEN_3DSKETCH + 3D Sketch + + + MEN_SOLID + Solid + + + MEN_SOLID_SEL_ONLY + Solid + + + MEN_SPHERE + Sphere + + + MEN_STEP_VALUE + Step Value + + + MEN_SUPPERSS_HOLES + Suppress Holes + + + MEN_SUPPRESS_FACES + Suppress Faces + + + MEN_SUPPRESS_INT_WIRES + Suppress Internal Wires + + + MEN_TOLERANCE + Tolerance + + + MEN_TOOLS + Tools + + + MEN_TORUS + Torus + + + MEN_TRANSFORMATION + Transformation + + + MEN_TRANSLATION + Translation + + + MEN_VECTOR + Vector + + + MEN_VERTEX_SEL_ONLY + Vertex + + + MEN_VIEW + View + + + MEN_WHAT_IS + What is + + + MEN_WIRE + Wire + + + MEN_VECTOR_MODE_ON + Show Edge Direction + + + MEN_VECTOR_MODE_OFF + Hide Edge Direction + + + MEN_WIREFRAME + Wireframe + + + MEN_WIRE_SEL_ONLY + Wire + + + MEN_WORK_PLANE + Working Plane + + + MEN_POP_POINT_MARKER + Point Marker + + + NAME_LBL + Name: + + + NON_GEOM_OBJECTS_SELECTED + There are objects selected which do not belong to %1 component. + + + PREF_DEFLECTION + Deflection coefficient + + + GEOM_PREF_def_precision + Default precision + + + GEOM_PREF_length_precision + Length precision + + + GEOM_PREF_angle_precision + Angular precision + + + GEOM_PREF_len_tol_precision + Length tolerance precision + + + GEOM_PREF_ang_tol_precision + Angular tolerance precision + + + GEOM_PREF_weight_precision + Weight precision + + + GEOM_PREF_density_precision + Density precision + + + GEOM_PREF_parametric_precision + Parametric precision + + + GEOM_PREF_param_tol_precision + Parametric tolerance precision + + + PREF_AUTO_CREATE + Auto create + + + PREF_DISPLAY_MODE + Default display mode + + + PREF_FREE_BOUND_COLOR + Color of free boundaries + + + PREF_GROUP_ORIGIN_AND_BASE_VECTORS + Origin and base vectors + + + PREF_GROUP_GENERAL + General + + + PREF_GROUP_OCCVIEWER + OCC Viewer 3d + + + GEOM_PREF_GROUP_PRECISION + Input fields precision + + + PREF_GROUP_VERTEX + Marker of Points + + + PREF_ISOS_COLOR + Color of isolines + + + PREF_LINE_COLOR + Color of edges, vectors, wires + + + PREF_MARKER_SCALE + Size + + + PREF_POINT_COLOR + Color of points + + + PREF_SHADING_COLOR + Default shading color + + + PREF_STEP_VALUE + Step value for spin boxes + + + PREF_TAB_SETTINGS + Settings + + + PREF_TYPE_OF_MARKER + Type + + + PREF_BASE_VECTORS_LENGTH + Length of base vectors + + + PREF_WIREFRAME_COLOR + Default wireframe color + + + PROCESS_SHAPE_NEW_OBJ_NAME + ProcessShape + + + REMOVE_HOLES_NEW_OBJ_NAME + SupressHoles + + + REMOVE_INT_WIRES_NEW_OBJ_NAME + RemoveIntWires + + + SEWING_NEW_OBJ_NAME + Sewing + + + STB_ALL_SEL_ONLY + Select all Objects + + + STB_ARC + Create an arc + + + STB_ARCHIMEDE + Archimede operation + + + STB_BASIC_PROPS + Show basic properties of the shape + + + STB_BND_BOX + Compute bounding box of the shape + + + STB_BOX + Create a box + + + STB_CHAMFER + Create a chamfer + + + STB_CHANGE_ORIENTATION + Change orientation + + + STB_CHECK + Check shape validity + + + STB_CHECK_COMPOUND + Check compound of blocks + + + STB_CHECK_FREE_BNDS + Check free boundaries + + + STB_CHECK_FREE_FACES + Check free faces + + + STB_CHECK_GEOMETRY + Check Geometry + + + STB_CIRCLE + Create a circle + + + STB_CLIPPING + Clipping range + + + STB_CLOSE_CONTOUR + Perform close contour + + + STB_COMMON + Common + + + STB_COMPOUND + Build a compound + + + STB_COMPOUND_SEL_ONLY + Select only a Compounds + + + STB_CONE + Create a cone + + + STB_CURVE + Create a curve + + + STB_CUT + Cut + + + STB_CYLINDER + Create a cylinder + + + STB_RECTANGLE + Create rectangular face + + + STB_DELETE + Delete object + + + STB_DISK + Create a disk + + + STB_DISPLAY + Show object(s) + + + STB_DISPLAY_ALL + Show all + + + STB_DISPLAY_ONLY + Show only + + + STB_EDGE + Build an edge + + + STB_EDGE_SEL_ONLY + Select only a Edges + + + STB_ELLIPSE + Create an ellipse + + + STB_ERASE + Hide object(s) + + + STB_ERASE_ALL + Hide all + + + STB_EXPLODE + Explode + + + STB_EXPLODE_BLOCKS + Explode on Blocks + + + STB_EXPORT + Export geometry to BREP file + + + STB_EXTRUSION + Create an extrusion + + + STB_FACE + Build a face + + + STB_FACE_SEL_ONLY + Select only a Faces + + + STB_FILLET + Create 3D fillet + + + STB_FILLET_1D + Create 1D fillet + + + STB_FILLET_2D + Create 2D fillet + + + STB_FILLING + Create a filling + + + STB_FUSE + Fuse + + + STB_GLUE_FACES + Perform glue faces + + + STB_GROUP_CREATE + Create a group + + + STB_GROUP_EDIT + Edit a group + + + STB_RELOAD_IMPORTED + Reload imported shape from its original place on disk + + + STB_HEX_SOLID + Hexahedral Solid + + + STB_IMPORT + Import geometry from BREP file + + + STB_INERTIA + Compute moments of intertia of the shape + + + STB_ISOS + Set number of isolines + + + STB_LINE + Create a line + + + STB_LIMIT_TOLERANCE + Limit tolerance + + + STB_LOCAL_CS + Create a local coordinate system + + + STB_MASS_CENTER + Compute center of mass of the shape + + + STB_MIN_DIST + Compute minimum distance between two objects + + + STB_MIRROR + Mirror a shape + + + STB_MODIFY_LOCATION + Modify shape's location + + + STB_MUL_ROTATION + Perform multi-rotation + + + STB_MUL_TRANSFORM + Perform multi-transformation + + + STB_MUL_TRANSLATION + Perform multi-translation + + + STB_OFFSET + Offset surface + + + STB_ORIGIN_AND_VECTORS + Create an origin and base Vectors + + + STB_PARTITION + Make a partition + + + STB_PIPE + Create a shape by extrusion along a path + + + STB_PLANE + Create a plane + + + STB_POINT + Create a point + + + STB_POINT_COORDS + Display point coordinates + + + STB_POINT_ON_EDGE + Add point on edge + + + STB_POP_COLOR + Color + + + STB_POP_CREATE_GROUP + Create Group + + + STB_POP_SHOW_CHILDREN + Show child objects + + + STB_POP_HIDE_CHILDREN + Hide child objects + + + STB_POP_ISOS + Isolines + + + STB_POP_DEFLECTION + Deflection Coefficient + + + STB_POP_RENAME + Rename + + + STB_POP_SHADING + Shading + + + STB_POP_TRANSPARENCY + Transparency + + + STB_POP_WIREFRAME + Wireframe + + + STB_PROPAGATE + Propagate + + + STB_Q_FACE + Quadrangle Face + + + STB_REVOLUTION + Create a revolution + + + STB_ROTATION + Rotate a shape + + + STB_SCALE + Scale a shape + + + STB_SECTION + Section + + + STB_SEWING + Perform sewing + + + STB_SHADING + Shading + + + STB_VECTOR_MODE + Change Edge Presentation Mode + + + STB_SHADING_COLOR + Set shading color + + + STB_SHAPE_PROCESS + Perform shape processing + + + STB_SHELL + Build a shell + + + STB_SHELL_SEL_ONLY + Select only a Shells + + + STB_SKETCH + Create 2D sketch + + + STB_3DSKETCH + Create 3D sketch + + + STB_SOLID + Build a solid + + + STB_SOLID_SEL_ONLY + Select only a Solids + + + STB_SPHERE + Create a sphere + + + STB_STEP_VALUE + Set step value + + + STB_SUPPERSS_HOLES + Perform suppress holes + + + STB_SUPPRESS_FACES + Perform suppress faces + + + STB_SUPPRESS_INT_WIRES + Perform suppress internal wires + + + STB_TOLERANCE + Compute tolerance of the shape + + + STB_TORUS + Create a torus + + + STB_TRANSLATION + Translate shape + + + STB_VECTOR + Create a vector + + + STB_VERTEX_SEL_ONLY + Select only a Points + + + STB_WHAT_IS + What is + + + STB_WIRE + Build a wire + + + STB_WIRE_SEL_ONLY + Select only a Wires + + + STB_WORK_PLANE + Create a working plane + + + STB_POP_POINT_MARKER + Set Point Marker + + + SUPPRESS_RESULT + Suppress Result + + + SUPRESS_FACE_NEW_OBJ_NAME + SupressFaces + + + ShHealOper_ErrorExecution_msg + Shape Healing algorithm failed + + + ShHealOper_InvalidParameters_msg + Incorrect parameters for Shape Healing algorithm + + + ShHealOper_NotError_msg + Shape Healing algorithm has done no modification of the original shape + + + TLT_RENAME + Rename + + + TOM_O + O + + + TOM_O_PLUS + + in O + + + TOM_O_POINT + . in O + + + TOM_O_STAR + * in O + + + TOM_O_X + X in O + + + TOM_PLUS + + + + + TOM_POINT + . + + + TOM_STAR + * + + + TOM_X + X + + + TOOL_BASIC + Basic + + + TOOL_BOOLEAN + Boolean operations + + + TOOL_GENERATION + Generation + + + TOOL_PRIMITIVES + Primitives + + + TOOL_TRANSFORMATION + Transformation + + + TOOL_BUILD + Build + + + TOOL_OPERATIONS + Operations + + + TOOL_ADVANCED + Advanced + + + TOOL_MEASURES + Measures + + + TOP_ARC + Create an arc + + + TOP_ARCHIMEDE + Archimede + + + TOP_BASIC_PROPS + Basic properties + + + TOP_BND_BOX + Bounding box + + + TOP_BOX + Create a box + + + TOP_CHAMFER + Chamfer + + + TOP_CHANGE_ORIENTATION + Change orientation + + + TOP_CHECK + Check shape + + + TOP_CHECK_COMPOUND + Check compound of blocks + + + TOP_CHECK_FREE_BNDS + Check free boundaries + + + TOP_CHECK_FREE_FACES + Check free faces + + + TOP_CHECK_GEOMETRY + Check Geometry + + + TOP_CIRCLE + Create a circle + + + TOP_CLIPPING + Clipping range + + + TOP_CLOSE_CONTOUR + Perform close contour + + + TOP_COMMON + Common + + + TOP_COMPOUND + Build compound + + + TOP_CONE + Create a cone + + + TOP_CURVE + Create a curve + + + TOP_CUT + Cut + + + TOP_CYLINDER + Create a cylinder + + + TOP_DELETE + Delete object + + + TOP_RECTANGLE + Create rectangular face + + + TOP_DISK + Create a disk + + + TOP_DISPLAY + Show + + + TOP_DISPLAY_ALL + Show all + + + TOP_DISPLAY_ONLY + Show only + + + TOP_EDGE + Build edge + + + TOP_ELLIPSE + Create an ellipse + + + TOP_ERASE + Hide + + + TOP_ERASE_ALL + Hide all + + + TOP_EXPLODE + Explode + + + TOP_EXPLODE_BLOCKS + Explode on Blocks + + + TOP_EXPORT + Export geometry to BREP file + + + TOP_EXTRUSION + Create an extrusion + + + TOP_FACE + Build face + + + TOP_FILLET + Fillet 3D + + + TOP_FILLET_1D + Fillet 1D + + + TOP_FILLET_2D + Fillet 2D + + + TOP_FILLING + Create a filling + + + TOP_FUSE + Fuse + + + TOP_GLUE_FACES + Perform glue faces + + + TOP_GROUP_CREATE + Create a group + + + TOP_GROUP_EDIT + Edit a group + + + TOP_HEX_SOLID + Hexahedral Solid + + + TOP_IMPORT + Import geometry from BREP file + + + TOP_INERTIA + Moments of intertia + + + TOP_ISOS + Set number of isolines + + + TOP_LINE + Create a line + + + TOP_LIMIT_TOLERANCE + Limit tolerance + + + TOP_LOCAL_CS + Create a local coordinate system + + + TOP_MASS_CENTER + Center of mass + + + TOP_MIN_DIST + Minimum distance + + + TOP_MIRROR + Mirror image + + + TOP_MODIFY_LOCATION + Modify location + + + TOP_MUL_ROTATION + Multi-Rotation + + + TOP_MUL_TRANSFORM + Multi-transformation + + + TOP_MUL_TRANSLATION + Multi-Translation + + + TOP_OFFSET + Offset surface + + + TOP_ORIGIN_AND_VECTORS + Create an origin and base Vectors + + + TOP_PARTITION + Partition + + + TOP_PIPE + Extrusion along path + + + TOP_PLANE + Create a plane + + + TOP_POINT + Create a point + + + TOP_POINT_COORDS + Point coordinates + + + TOP_POINT_ON_EDGE + Add point on edge + + + TOP_POP_COLOR + Color + + + TOP_POP_CREATE_GROUP + Create Group + + + TOP_POP_SHOW_CHILDREN + Show Children + + + TOP_POP_HIDE_CHILDREN + Hide Children + + + TOP_POP_ISOS + Isolines + + + TOP_POP_DEFLECTION + Deflection Coefficient + + + TOP_POP_RENAME + Rename + + + TOP_POP_SHADING + Shading + + + TOP_POP_TRANSPARENCY + Transparency + + + TOP_POP_WIREFRAME + Wireframe + + + TOP_PROPAGATE + Propagate + + + TOP_Q_FACE + Quadrangle Face + + + TOP_REVOLUTION + Create a revolution + + + TOP_ROTATION + Rotation + + + TOP_SCALE + Scale transform + + + TOP_SECTION + Section + + + TOP_SEWING + Perform sewing + + + TOP_SHADING + Shading + + + TOP_SHADING_COLOR + Set shading color + + + TOP_SHAPE_PROCESS + Perform shape processing + + + TOP_SHELL + Build shell + + + TOP_SKETCH + 2D sketch + + + TOP_3DSKETCH + 3D sketch + + + TOP_SOLID + Build solid + + + TOP_SPHERE + Create a sphere + + + TOP_STEP_VALUE + Set step value + + + TOP_SUPPERSS_HOLES + Perform suppress holes + + + TOP_SUPPRESS_FACES + Perform suppress faces + + + TOP_SUPPRESS_INT_WIRES + Perform suppress internal wires + + + TOP_TOLERANCE + Tolerance + + + TOP_TORUS + Create a torus + + + TOP_TRANSLATION + Translation + + + TOP_VECTOR + Create a vector + + + TOP_WHAT_IS + What is + + + TOP_WIRE + Build wire + + + TOP_WORK_PLANE + Create a working plane + + + TOP_POP_POINT_MARKER + Point Marker + + + WRN_NOT_IMPLEMENTED + Sorry, this functionality is not yet implemented + + + _S_ + (s) + + + NOT_FOUND_ANY + Not a single entity has been found + + + GEOM_FACE_I + Face %1 + + + GEOM_CONSTANT_RADIUS + Radius : + + + GEOM_R1 + R1 : + + + GEOM_R2 + R2 : + + + GEOM_BOTHWAY + Both Directions + + + GEOM_NORMALE + Normal To A Face + + + GEOM_VECTOR_NORMALE + Vector_Normal + + + GEOM_LINE1 + Line 1 + + + GEOM_LINE2 + Line 2 + + + GEOM_D + D : + + + GEOM_CHAMFER_EDGE + Chamfer On Selected Edges + + + SELECTED_EDGE + Selected Edges + + + GEOM_NORMALE_TITLE + Create Normal To A Face + + + GEOM_MEASURE_ANGLE_TITLE + Angle Between Two Straight Edges/Lines/Vectors + + + GEOM_MEASURE_ANGLE_ANGLE + Angle + + + GEOM_MEASURE_ANGLE_OBJ + Objects And Results + + + GEOM_MEASURE_ANGLE_IS + Angle in degrees : + + + GEOM_LINE_INTERSECTION + Point On Lines Intersection + + + GEOM_KEEP_NONLIMIT_SHAPES + Keep shapes of lower type + + + GEOM_NO_SELF_INTERSECTION + No sub-shapes intersection (Compounds only) + + + GEOM_CENTER_2POINTS + Center and two points + + + GEOM_REMOVE_EXTRA_EDGES_TITLE + Remove extra edges + + + GEOM_REMOVE_EXTRA_EDGES + Object to remove extra edges + + + GEOM_RMEE_UNION_FACES + Union faces, laying on common surface + + + REMOVE_EXTRA_EDGES_NEW_OBJ_NAME + NoExtraEdges + + + TOP_REMOVE_EXTRA_EDGES + Remove extra edges + + + MEN_REMOVE_EXTRA_EDGES + Remove Extra Edges + + + STB_REMOVE_EXTRA_EDGES + Remove extra edges + + + TOP_NORMALE + Normal to a face + + + MEN_NORMALE + Normal to a Face + + + STB_NORMALE + Compute normal to the face + + + TOP_MEASURE_ANGLE + Angle + + + MEN_MEASURE_ANGLE + Angle + + + STB_MEASURE_ANGLE + Compute angle between two lines or linear edges + + + TOP_POP_AUTO_COLOR + Auto color + + + MEN_POP_AUTO_COLOR + Auto Color + + + STB_POP_AUTO_COLOR + Auto color + + + TOP_POP_DISABLE_AUTO_COLOR + Disable auto color + + + MEN_POP_DISABLE_AUTO_COLOR + Disable Auto Color + + + STB_POP_DISABLE_AUTO_COLOR + Disable auto color + + + GEOM_RESULT_NAME_GRP + Result name + + + GEOM_RESULT_NAME_LBL + Name + + + GEOM_FILLING_APPROX + Approximation + + + GEOM_FILLING_METHOD + Method + + + GEOM_FILLING_DEFAULT + Default (standard behaviour) + + + GEOM_FILLING_USEORI + Use edges orientation + + + GEOM_FILLING_AUTO + Auto-correct edges orientation + + + GEOM_WRN_NO_APPROPRIATE_SELECTION + No appropriate objects selected + + + GEOM_SHAPES_ON_SHAPE + Get shapes on shape + + + GEOM_SHAPES_ON_SHAPE_ESHAPE + Shape for exploding + + + GEOM_SHAPES_ON_SHAPE_CSHAPE + Solid for checking + + + GEOM_SHAPES_ON_SHAPE_STATE + State + + + GEOM_KIND_OF_SHAPE + Kind of Shape : + + + GEOM_CLOSED + Closed + + + GEOM_UNCLOSED + Opened + + + GEOM_CLOSEDUNCLOSED + Not defined, Closed or Opened. Possibly, error occured. + + + GEOM_DISK_CIRCLE + Disk + + + GEOM_DISK_ELLIPSE + Elliptical face + + + GEOM_PLANAR_FACE + Planar Face + + + GEOM_PLANAR_EDGE_WIRE + Wire with Planar Edges + + + GEOM_POLYGON + Polygon + + + GEOM_POLYHEDRON + Polyhedron + + + GEOM_NORMAL + Normal direction + + + GEOM_DIRECTION + Direction + + + GEOM_UPARAMETER + U-parameter : + + + GEOM_VPARAMETER + V-parameter : + + + GEOM_X_I + X%1 : + + + GEOM_Y_I + Y%1 : + + + GEOM_Z_I + Z%1 : + + + GEOM_SHAPES_ON_SHAPE_TITLE + Get shapes on shape + + + GEOM_SCALE_FACTOR_X + Scale Factor X : + + + GEOM_SCALE_FACTOR_Y + Scale Factor Y : + + + GEOM_SCALE_FACTOR_Z + Scale Factor Z : + + + GEOM_STATE_IN + IN + + + GEOM_STATE_OUT + OUT + + + GEOM_STATE_ON + ON + + + GEOM_STATE_ONIN + ONIN + + + GEOM_STATE_ONOUT + ONOUT + + + GEOM_STATE_INOUT + INOUT + + + TOP_GET_SHAPES_ON_SHAPE + Get shapes on shape + + + MEN_GET_SHAPES_ON_SHAPE + Get Shapes on Shape + + + STB_GET_SHAPES_ON_SHAPE + Get shapes on shape + + + TOP_GET_SHARED_SHAPES + Get shared shapes + + + MEN_GET_SHARED_SHAPES + Get Shared Shapes + + + STB_GET_SHARED_SHAPES + Get shared shapes + + + GEOM_PUBLISH_RESULT_GRP + Advanced options + + + GEOM_RESTORE_SUB_SHAPES + Set presentation parameters and subshapes from arguments + + + GEOM_RSS_ADD_FREFIX + Add prefix to names of restored subshapes + + + GEOM_ALL_IMPORT_FILES + All supported formats ( %1 ) + + + GEOM_UNSUPPORTED_TYPE + Unsupported format for the file + + + GEOM_UNKNOWN_IMPORT_ERROR + Unknown error + + + GEOM_IMPORT_ERRORS + Import operation has finished with errors: + + + GEOM_PUBLISH_NAMED_SHAPES + Create groups for named shapes (if there are any)? + + + GEOM_SCALE_DIMENSIONS + Would you like to take into account the units? Otherwise the dimensions will be kept without modifications. - - - GEOM_ADVANCED - Advanced shape: type %1 - - - GEOM_PRECISION_HINT - + + + GEOM_ADVANCED + Advanced shape: type %1 + + + GEOM_PRECISION_HINT + Input value precision can be adjusted using -'%1' parameter in Geometry module preferences. - - - - BasicGUI_CurveDlg - - GEOM_IS_CLOSED - Build a closed edge - - - - BasicGUI_EllipseDlg - - GEOM_VECTOR_MAJOR - Major Axis - - - ORIGIN_DEFAULT - Origin by default - - - X_AXIS_DEFAULT - X axis by default - - - Z_AXIS_DEFAULT - Z axis by default - - - - BasicGUI_MarkerDlg - - CAPTION - Local CS Construction - - - DX - Dx - - - DY - Dy - - - DZ - Dz - - - LCS_NAME - LocalCS - - - LOCALCS - Local coordinate system - - - ORIGIN - Coordinates of origin - - - VEC_PARALLEL - Coordinate system axes cannot be parallel - - - XDIR - X axis direction - - - YDIR - Y axis direction - - - - BlocksGUI_BlockDlg - - FACE_1 - Face 1 - - - FACE_2 - Face 2 - - - FACE_3 - Face 3 - - - FACE_4 - Face 4 - - - FACE_5 - Face 5 - - - FACE_6 - Face 6 - - - - BlocksGUI_ExplodeDlg - - NB_FACES_MAX - Max. nb. faces - - - NB_FACES_MIN - Min. nb. faces - - - - BlocksGUI_QuadFaceDlg - - EDGE_1 - Edge 1 - - - EDGE_2 - Edge 2 - - - EDGE_3 - Edge 3 - - - EDGE_4 - Edge 4 - - - VERTEX_1 - Vertex 1 - - - VERTEX_2 - Vertex 2 - - - VERTEX_3 - Vertex 3 - - - VERTEX_4 - Vertex 4 - - - - BlocksGUI_TrsfDlg - - FACE_1 - Face 1 - - - FACE_1U - Face 1 U - - - FACE_1V - Face 1 V - - - FACE_2 - Face 2 - - - FACE_2U - Face 2 U - - - FACE_2V - Face 2 V - - - - EntityGUI_SketcherDlg - - CANNOT_CLOSE - It is impossible to close sketch +'%1' parameter in Geometry module preferences. + + + TOP_PIPETSHAPE + Create Pipe TShape + + + MEN_PIPETSHAPE + Pipe TShape + + + STB_PIPETSHAPE + Create new Pipe TShape object + + + GEOM_ADVANCED_201 + Pipe TShape + + + HALF_LENGTH_MAIN_PIPE + Main pipe half length + + + HALF_LENGTH_INCIDENT_PIPE + Incident pipe half length + + + CIRCULAR_QUARTER_PIPE + Circular quarter of pipe + + + THICKNESS + Thickness + + + FLANGE + Flange + + + CHAMFER_OR_FILLET + Chamfer or fillet + + + CHAMFER + Chamfer + + + FILLET + Fillet + + + JUNCTION_FACE_1 + Junction 1 + + + JUNCTION_FACE_2 + Junction 2 + + + JUNCTION_FACE_3 + Junction 3 + + + GEOM_PLUGINS_OTHER + Other + + + + BasicGUI_CurveDlg + + GEOM_IS_CLOSED + Build a closed edge + + + + BasicGUI_EllipseDlg + + GEOM_VECTOR_MAJOR + Major Axis + + + ORIGIN_DEFAULT + Origin by default + + + X_AXIS_DEFAULT + X axis by default + + + Z_AXIS_DEFAULT + Z axis by default + + + + BasicGUI_MarkerDlg + + CAPTION + Local CS Construction + + + DX + Dx + + + DY + Dy + + + DZ + Dz + + + LCS_NAME + LocalCS + + + LOCALCS + Local coordinate system + + + ORIGIN + Coordinates of origin + + + VEC_PARALLEL + Coordinate system axes cannot be parallel + + + XDIR + X axis direction + + + YDIR + Y axis direction + + + + BlocksGUI_BlockDlg + + FACE_1 + Face 1 + + + FACE_2 + Face 2 + + + FACE_3 + Face 3 + + + FACE_4 + Face 4 + + + FACE_5 + Face 5 + + + FACE_6 + Face 6 + + + + BlocksGUI_ExplodeDlg + + NB_FACES_MAX + Max. nb. faces + + + NB_FACES_MIN + Min. nb. faces + + + + BlocksGUI_QuadFaceDlg + + EDGE_1 + Edge 1 + + + EDGE_2 + Edge 2 + + + EDGE_3 + Edge 3 + + + EDGE_4 + Edge 4 + + + VERTEX_1 + Vertex 1 + + + VERTEX_2 + Vertex 2 + + + VERTEX_3 + Vertex 3 + + + VERTEX_4 + Vertex 4 + + + + BlocksGUI_TrsfDlg + + FACE_1 + Face 1 + + + FACE_1U + Face 1 U + + + FACE_1V + Face 1 V + + + FACE_2 + Face 2 + + + FACE_2U + Face 2 U + + + FACE_2V + Face 2 V + + + + EntityGUI_SketcherDlg + + CANNOT_CLOSE + It is impossible to close sketch Number of sketch points too small - - - - EntityGUI_SubShapeDlg - - NO_SUBSHAPES_SELECTED - Please, select one or more sub-shapes - - - - GroupGUI - - NO_GROUP - Please, select a group to edit - - - - GroupGUI_GroupDlg - - ADD - Add - - - CREATE_GROUP_TITLE - Create Group - - - EDIT_GROUP_TITLE - Edit Group - - - EMPTY_LIST - Please, select one or more sub-shapes to put into the group - - - EMPTY_NAME - Please, specify a non-empty group name - - - GROUP_NAME - Group Name - - - GROUP_PREFIX - Group - - - MAIN_SHAPE - Main Shape - - - MAIN_SUB_SHAPES - Main Shape And Sub-Shapes - - - NO_GROUP - Please, select a group to edit - - - NO_MAIN_OBJ - Please, select a main shape - - - REMOVE - Remove - - - SELECT_ALL - Select All - - - SHAPE_SEL_RESTR - Main Shape Selection restriction - - - SHAPE_TYPE - Shape Type - - - NO_RESTR - No restriction - - - GEOM_PARTS_OF_SHAPE2 - Geometrical parts of the Second Shape - - - SUBSHAPES_OF_SHAPE2 - Only Sub-Shapes of the Second Shape - - - SECOND_SHAPE - Second Shape - - - - MeasureGUI_1Sel1TextView1Check_QTD - - CHECK_SHAPE_GEOMETRY - Check also geometry - - - - MeasureGUI_PointDlg - - CAPTION - Point Coordinates - - - COORDINATES - Point and its coordinates - - - POINT - Point - - - X - X - - - Y - Y - - - Z - Z - - - - OperationGUI_ChamferDlg - - D - D - - - FACE_1 - Face 1 - - - FACE_2 - Face 2 - - - SELECTED_FACES - Selected faces - - - - OperationGUI_FilletDlg - - SELECTED_EDGES - Selected edges - - - SELECTED_FACES - Selected faces - - - - RepairGUI_FreeBoundDlg - - CAPTION - Check free boundaries - - - FREE_BOUND - Free boundaries - - - NUMBER_CLOSED - Number of closed free boundaries: - - - NUMBER_OPEN - Number of open free boundaries: - - - - RepairGUI_GlueDlg - - FACES_FOR_GLUING_ARE_DETECTED - There are %1 face(s) that can be glued. They are coloured on the screen with red colour. + + + + EntityGUI_SubShapeDlg + + NO_SUBSHAPES_SELECTED + Please, select one or more sub-shapes + + + + GroupGUI + + NO_GROUP + Please, select a group to edit + + + + GroupGUI_GroupDlg + + ADD + Add + + + CREATE_GROUP_TITLE + Create Group + + + EDIT_GROUP_TITLE + Edit Group + + + EMPTY_LIST + Please, select one or more sub-shapes to put into the group + + + EMPTY_NAME + Please, specify a non-empty group name + + + GROUP_NAME + Group Name + + + GROUP_PREFIX + Group + + + MAIN_SHAPE + Main Shape + + + MAIN_SUB_SHAPES + Main Shape And Sub-Shapes + + + NO_GROUP + Please, select a group to edit + + + NO_MAIN_OBJ + Please, select a main shape + + + REMOVE + Remove + + + SHOW_ONLY_SELECTED + Show only selected + + + HIDE_SELECTED + Hide selected + + + SHOW_ALL_SUB_SHAPES + Show all sub-shapes + + + SELECT_ALL + Select All + + + SHAPE_SEL_RESTR + Main Shape Selection restriction + + + SHAPE_TYPE + Shape Type + + + NO_RESTR + No restriction + + + GEOM_PARTS_OF_SHAPE2 + Geometrical parts of the Second Shape + + + SUBSHAPES_OF_SHAPE2 + Only Sub-Shapes of the Second Shape + + + SECOND_SHAPE + Second Shape + + + + MeasureGUI_1Sel1TextView1Check_QTD + + CHECK_SHAPE_GEOMETRY + Check also geometry + + + + MeasureGUI_PointDlg + + CAPTION + Point Coordinates + + + COORDINATES + Point and its coordinates + + + POINT + Point + + + X + X + + + Y + Y + + + Z + Z + + + + OperationGUI_ChamferDlg + + D + D + + + FACE_1 + Face 1 + + + FACE_2 + Face 2 + + + SELECTED_FACES + Selected faces + + + + OperationGUI_FilletDlg + + SELECTED_EDGES + Selected edges + + + SELECTED_FACES + Selected faces + + + + RepairGUI_FreeBoundDlg + + CAPTION + Check free boundaries + + + FREE_BOUND + Free boundaries + + + NUMBER_CLOSED + Number of closed free boundaries: + + + NUMBER_OPEN + Number of open free boundaries: + + + + RepairGUI_GlueDlg + + FACES_FOR_GLUING_ARE_DETECTED + There are %1 face(s) that can be glued. They are coloured on the screen with red colour. Please close this message box and select faces for glueing - - - GLUE_FACES - Glue faces - - - SELECT_FACES - Select Faces - - - THERE_ARE_NO_FACES_FOR_GLUING - There are no faces for gluing - - - - RepairGUI_ShapeProcessDlg - - ERROR_NO_OBJECTS - Please, select a geometrical object for Shape Processing. - - - ERROR_NO_OPERATORS - Please, select at least one Shape Process operation to proceed. - - - TIME_CONSUMING - Enabling this option may result in a very time-consuming operation for some input shapes. + + + GLUE_FACES + Glue faces + + + SELECT_FACES + Select Faces + + + THERE_ARE_NO_FACES_FOR_GLUING + There are no faces for gluing + + + + RepairGUI_ShapeProcessDlg + + ERROR_NO_OBJECTS + Please, select a geometrical object for Shape Processing. + + + ERROR_NO_OPERATORS + Please, select at least one Shape Process operation to proceed. + + + TIME_CONSUMING + Enabling this option may result in a very time-consuming operation for some input shapes. Would you like to continue? - - - - GEOMToolsGUI_DeleteDlg - - GEOM_REALLY_DELETE - Do you really want to delete %1 object(s)? - - - GEOM_REALLY_DELETE_ALL - Do you really want to delete all objects? - - - GEOM_DELETE_OBJECTS - Delete objects - - - - GEOMToolsGUI_DeflectionDlg - - GEOM_DEFLECTION_TLT - Select Deflection of Shape - - - GEOM_DEFLECTION - Deflection : - - - - GEOMToolsGUI_MarkerDlg - - SET_MARKER_TLT - Set Point Marker - - - STANDARD_MARKER - Standard - - - CUSTOM_MARKER - Custom - - - TYPE - Type: - - - SCALE - Scale: - - - CUSTOM - Texture: - - - BROWSE - Browse... - - - OK_BTN - &OK - - - CANCEL_BTN - &Cancel - - - HELP_BTN - &Help - - - LOAD_TEXTURE_TLT - Load Texture - - - - OperationGUI_GetSharedShapesDlg - - GEOM_SHARED_SHAPES_TITLE - Get Shared Shapes - - - GEOM_GET_SHARED_SHAPES - Shared shapes - - - GEOM_SHARED_SHAPES_INPUT - Input data - - - MSG_SHARED_SHAPES_TOO_FEW_SHAPES - To few shapes selected. - - - GEOM_SHARED_SHAPE - Shared_%1 - - - - AdvancedGUI_PipeTShapeDlg - - GEOM_PIPE_TSHAPE_TITLE - Pipe TShape Construction - - - GEOM_PIPE_TSHAPE - PipeTShape - - - GEOM_PIPE_TSHAPE_MPIPE - Main pipe - - - GEOM_PIPE_TSHAPE_R - Radius - - - GEOM_PIPE_TSHAPE_W - Width - - - GEOM_PIPE_TSHAPE_L - Half-length - - - GEOM_PIPE_TSHAPE_IPIPE - Incident pipe - - - GEOM_PIPE_TSHAPE_CHAMFER - Chamfer - - - GEOM_PIPE_TSHAPE_CHAMFER_H - Height - - - GEOM_PIPE_TSHAPE_CHAMFER_W - Width - - - GEOM_PIPE_TSHAPE_FILLET - Fillet - - - GEOM_PIPE_TSHAPE_HEX - Prepare for hex mesh - - - GEOM_PIPE_TSHAPE_POSITION - Set position - - - GEOM_PIPE_TSHAPE_POSITION_P1 - Junction P1 - - - GEOM_PIPE_TSHAPE_POSITION_P2 - Junction P2 - - - GEOM_PIPE_TSHAPE_POSITION_P3 - Junction P3 - - - GEOM_PIPE_TSHAPE_POSITION_LBL_L1 - New L1 - - - GEOM_PIPE_TSHAPE_POSITION_LBL_L2 - New L2 - - - - @default - - TOP_PIPETSHAPE - Create Pipe TShape - - - MEN_PIPETSHAPE - Pipe TShape - - - STB_PIPETSHAPE - Create new Pipe TShape object - - - GEOM_ADVANCED_201 - Pipe TShape - - - HALF_LENGTH_MAIN_PIPE - Main pipe half length - - - HALF_LENGTH_INCIDENT_PIPE - Incident pipe half length - - - CIRCULAR_QUARTER_PIPE - Circular quarter of pipe - - - THICKNESS - Thickness - - - FLANGE - Flange - - - CHAMFER_OR_FILLET - Chamfer or fillet - - - CHAMFER - Chamfer - - - FILLET - Fillet - - - JUNCTION_FACE_1 - Junction 1 - - - JUNCTION_FACE_2 - Junction 2 - - - JUNCTION_FACE_3 - Junction 3 - - - + + + + GEOMToolsGUI_DeleteDlg + + GEOM_REALLY_DELETE + Do you really want to delete %1 object(s)? + + + GEOM_REALLY_DELETE_ALL + Do you really want to delete all objects? + + + GEOM_DELETE_OBJECTS + Delete objects + + + + GEOMToolsGUI_DeflectionDlg + + GEOM_DEFLECTION_TLT + Select Deflection of Shape + + + GEOM_DEFLECTION + Deflection : + + + + GEOMToolsGUI_MarkerDlg + + SET_MARKER_TLT + Set Point Marker + + + STANDARD_MARKER + Standard + + + CUSTOM_MARKER + Custom + + + TYPE + Type: + + + SCALE + Scale: + + + CUSTOM + Texture: + + + BROWSE + Browse... + + + OK_BTN + &OK + + + CANCEL_BTN + &Cancel + + + HELP_BTN + &Help + + + LOAD_TEXTURE_TLT + Load Texture + + + + OperationGUI_GetSharedShapesDlg + + GEOM_SHARED_SHAPES_TITLE + Get Shared Shapes + + + GEOM_GET_SHARED_SHAPES + Shared shapes + + + GEOM_SHARED_SHAPES_INPUT + Input data + + + MSG_SHARED_SHAPES_TOO_FEW_SHAPES + To few shapes selected. + + + GEOM_SHARED_SHAPE + Shared_%1 + + + + AdvancedGUI_PipeTShapeDlg + + GEOM_PIPE_TSHAPE_TITLE + Pipe TShape Construction + + + GEOM_PIPE_TSHAPE + PipeTShape + + + GEOM_PIPE_TSHAPE_MPIPE + Main pipe + + + GEOM_PIPE_TSHAPE_R + Radius + + + GEOM_PIPE_TSHAPE_W + Width + + + GEOM_PIPE_TSHAPE_L + Half-length + + + GEOM_PIPE_TSHAPE_IPIPE + Incident pipe + + + GEOM_PIPE_TSHAPE_CHAMFER + Chamfer + + + GEOM_PIPE_TSHAPE_CHAMFER_H + Height + + + GEOM_PIPE_TSHAPE_CHAMFER_W + Width + + + GEOM_PIPE_TSHAPE_FILLET + Fillet + + + GEOM_PIPE_TSHAPE_HEX + Prepare for hex mesh + + + GEOM_PIPE_TSHAPE_POSITION + Set position + + + GEOM_PIPE_TSHAPE_POSITION_P1 + Junction P1 + + + GEOM_PIPE_TSHAPE_POSITION_P2 + Junction P2 + + + GEOM_PIPE_TSHAPE_POSITION_P3 + Junction P3 + + + GEOM_PIPE_TSHAPE_POSITION_LBL_L1 + New L1 + + + GEOM_PIPE_TSHAPE_POSITION_LBL_L2 + New L2 + + diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 71587db95..3564fc070 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -1,1469 +1,4712 @@ + - - - - @default - - GEOM_ANGLE - Angle : - - - GEOM_ARC - Arc - - - GEOM_ARCHIMEDE - Archimde - - - GEOM_ARCHIMEDE_TITLE - Construction d'Archimde - - - GEOM_ARC_TITLE - Construction d'un Arc - - - GEOM_ARGUMENTS - Arguments - - - GEOM_AXE_MIRROR - Axe Miroir - - - GEOM_AXIS - Axe - - - GEOM_BASE - Base - - - GEOM_BASE_OBJECT - Objet De Base - - - GEOM_BASE_POINT - Point De Base - - - GEOM_BEZIER - Bezier - - - GEOM_BNDBOX - Boite Anglobante - - - GEOM_BNDBOX_OBJDIM - Objet and ses dimensions - - - GEOM_BNDBOX_TITLE - Boite Englobante - - - GEOM_BOX - Boite - - - GEOM_BOX_OBJ - Dimensions A l'Origine - - - GEOM_BOX_TITLE - Construction d'une Boite - - - GEOM_BUT_APPLY - &Appliquer - - - GEOM_BUT_CANCEL - &Annuler - - - GEOM_BUT_CLOSE - &Fermer - - - GEOM_BUT_CLOSE_SKETCH - Fermer Sketch - - - GEOM_BUT_END_SKETCH - Terminer Sketch - - - GEOM_BUT_EXPLODE - &Exploser - - - GEOM_BUT_HELP - &Aide - - - GEOM_BUT_NO - &Non - - - GEOM_BUT_OK - &Ok - - - GEOM_BUT_YES - &Oui - - - GEOM_CENTER - Centre - - - GEOM_CENTER_POINT - Point Centre - - - GEOM_CENTRAL_POINT - Point Central - - - GEOM_CHAMFER - Chanfrein - - - GEOM_CHAMFER_ABORT - Le chanfrein ne peut-tre realis avec %1 et %2 - - - GEOM_CHAMFER_ALL - Chanfrein sur toute la Shape - - - GEOM_CHAMFER_EDGES - Chanfrein sur Edges de la Shape - - - GEOM_CHAMFER_FACES - Chanfrein sur Faces de la Shape - - - GEOM_CHAMFER_TITLE - Construction d'un Chanfrein - - - GEOM_CHECK_BLOCKS_COMPOUND - Check Blocks Compound - - - GEOM_CHECK_BLOCKS_COMPOUND_ERRORS - Errors - - - GEOM_CHECK_BLOCKS_COMPOUND_HAS_ERRORS - The Compound of Blocks has errors - - - GEOM_CHECK_BLOCKS_COMPOUND_HAS_NO_ERRORS - The Compound of Blocks has no errors - - - GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES - Incriminated Sub-Shapes - - - GEOM_CHECK_COMPOUND_BLOCKS_TITLE - Check Blocks Compound - - - GEOM_CHECK_INFOS - Objet et ses Informations Topologiques - - - GEOM_CHECK_SHAPE - Check Shape - - - GEOM_CHECK_TITLE - Check Shape - - - GEOM_CIRCLE - Cercle - - - GEOM_CIRCLE_TITLE - Construction d'un Cercle - - - GEOM_CMASS - Centre de Masse - - - GEOM_CMASS_TITLE - Centre De Gravit - - - GEOM_COMMON - Joindre - - - GEOM_COMMON_TITLE - BOOLEEN : Jonction De Deux Objets - - - GEOM_COMPOUND - Compound - - - GEOM_COMPOUNDSOLID - CompSolid - - - GEOM_COMPOUND_TITLE - Cration d'un Compound - - - GEOM_CONE - Cone - - - GEOM_CONE_TITLE - Construction d'un Cone - - - GEOM_CONFIRM - Confirmer cette operation - - - GEOM_CONFIRM_INFO - L'objet contient %1 sous objets - - - GEOM_COOR - Coord. : - - - GEOM_COORDINATES - Coordonnes - - - GEOM_COORDINATES_RES - Resultats coordonnes - - - GEOM_CREATE_COPY - Create a copy - - - GEOM_CREATE_SINGLE_SOLID - Create a single solid - - - GEOM_CUT - Couper - - - GEOM_CUT_TITLE - BOOLEEN : Couper Deux Objets - - - GEOM_CYLINDER - Cylindre - - - GEOM_CYLINDER_TITLE - Construction d'un Cylindre - - - GEOM_D1 - D1 : - - - GEOM_D2 - D2 : - - - GEOM_DIAGONAL_POINTS - Points Diagonaux - - - GEOM_DIMENSIONS - Dimensions - - - GEOM_DISTANCE - Distance - - - GEOM_DX - Dx : - - - GEOM_DY - Dy : - - - GEOM_DZ - Dz : - - - GEOM_EDGE - Edge - - - GEOM_EDGE_TITLE - Cration d'un Edge - - - GEOM_ELLIPSE - Ellipse - - - GEOM_ELLIPSE_TITLE - Construction d'Ellipses - - - GEOM_EXTRUSION - Extrusion - - - GEOM_EXTRUSION_BSV - Shape de base + Vecteur - - - GEOM_EXTRUSION_BSV_2P - Shape de base + 2 Points - - - GEOM_EXTRUSION_TITLE - Extruder une Shape de base - - - GEOM_FACE - Face - - - GEOM_FACES - Faces - - - GEOM_FACE_FFW - Face a partir d'un wire - - - GEOM_FACE_OPT - Cration d'une Face plane - - - GEOM_FACE_SELECTION - Selection de Face - - - GEOM_FACE_TITLE - Cration d'une Face - - - GEOM_FILLET - Conge - - - GEOM_FILLET_ABORT - Le cong ne peut-tre realis avec un rayon de %1 - - - GEOM_FILLET_ALL - Cong sur toute la Shape - - - GEOM_FILLET_EDGES - Cong sur Edges de la Shape - - - GEOM_FILLET_WIRES - Cong sur Wires de la Shape - - - GEOM_FILLET_FACES - Cong sur Faces de la Shape - - - GEOM_FILLET_TITLE - Construction d'un Cong - - - GEOM_FILLING - Surface Par Edges - - - GEOM_FILLING_ARG - Argument Et Parametres - - - GEOM_FILLING_COMPOUND - Compound de Edges - - - GEOM_FILLING_MAX_DEG - Max. Deg - - - GEOM_FILLING_MIN_DEG - Min. Deg - - - GEOM_FILLING_NB_ITER - Nb. Iter - - - GEOM_FILLING_TITLE - Surface Par Edges - - - GEOM_FILLING_TOL_2D - Tol. 2D - - - GEOM_FILLING_TOL_3D - Tol. 3D - - - GEOM_FREE_FACES - Free faces - - - GEOM_FREE_FACES_TITLE - Free faces - - - GEOM_FUSE - Fusionner - - - GEOM_FUSE_TITLE - BOOLEEN : Fusionner deux Objets - - - GEOM_HEIGHT - Hauteur - - - GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE - Noms identiques : selectionner avec la souris ! - - - GEOM_INERTIA_CONSTR - Matrice Et Moments d'Inertie - - - GEOM_INERTIA_I - %1:1 - - - GEOM_INERTIA_IXYZ - IX & IY & IZ - - - GEOM_INERTIA_TITLE - Calculs d'Inertie - - - GEOM_INF_LOADED - Le fichier %1 est charg. - - - GEOM_INTERPOL - Interpolation - - - GEOM_KEEP_OBJECT - Objet garde - - - GEOM_LENGTH - Longueur : - - - GEOM_LINE - Ligne - - - GEOM_LINE_TITLE - Construction d'une Ligne - - - GEOM_MAIN_OBJECT - Objet Principal - - - GEOM_MATERIAL_ID - Material ID: - - - GEOM_MATERIAL_MATERIAL - Material - - - GEOM_MATERIAL_SET - << Set - - - GEOM_MATERIAL_SHAPE - Shapes - - - GEOM_MATERIAL_TITLE - Define materials for Dominant Fuse - - - GEOM_MATRIX - Matrice : - - - GEOM_MAX - Max : - - - GEOM_MEN_ALL_FILES - Tous fichiers ( * ) - - - GEOM_MEN_ANGLE - Angle : - - - GEOM_MEN_COMPONENT - Gometrie - - - GEOM_MEN_ENTER_ANGLE - Saisir un angle en degrs - - - GEOM_MEN_EXPORT - Exporter - - - GEOM_MEN_IMPORT - Importer - - - GEOM_MEN_ISOS - Choisir un nombre d'isos - - - GEOM_MEN_ISOU - Isos u : - - - GEOM_MEN_ISOV - Isos v : - - - GEOM_MEN_LOAD_SCRIPT - Fichiers PYTHON ( *.py ) - - - GEOM_MEN_POPUP_NAME - %1 Objets - - - GEOM_MEN_SHADING - Ombr - - - GEOM_MEN_SKETCHER_X - Saisir une longueur pour fixer X - - - GEOM_MEN_SKETCHER_Y - Saisir une longueur pour fixer Y - - - GEOM_MEN_STEP_LABEL - Increment - - - GEOM_MEN_TRANSPARENCY - Transparence - - - GEOM_MEN_TRANSPARENCY_LABEL - Transparence : - - - GEOM_MEN_WIREFRAME - Filaire - - - GEOM_MEN_X - X : - - - GEOM_MEN_Y - Y : - - - GEOM_MESHING_DEFLECTION - Dflection Du Maillage : - - - GEOM_MIN - Min : - - - GEOM_MINDIST_OBJ - Objets Et Resultats - - - GEOM_MINDIST_TITLE - Distance Minimale entre Deux Objets - - - GEOM_MIRROR - Miroir - - - GEOM_MIRROR_TITLE - Methode Miroir - - - GEOM_MULTIROTATION - Multi-Rotation - - - GEOM_MULTIROTATION_DOUBLE - Multi Rotation Double - - - GEOM_MULTIROTATION_SIMPLE - Multi Rotation Simple - - - GEOM_MULTIROTATION_TITLE - Multi-Rotation - - - GEOM_MULTITRANSLATION - Multi-Translation - - - GEOM_MULTITRANSLATION_DOUBLE - Multi Translation Double - - - GEOM_MULTITRANSLATION_SIMPLE - Multi Translation Simple - - - GEOM_MULTITRANSLATION_TITLE - Multi-Translation - - - GEOM_NAME_INCORRECT - Le nom saisi n'existe pas - - - GEOM_NB_TIMES - Nb. Fois : - - - GEOM_NB_TIMES_U - Nb. Fois U : - - - GEOM_NB_TIMES_V - Nb. Fois V : - - - GEOM_OBJECT - Objet - - - GEOM_OBJECTS - Objets - - - GEOM_OBJECT_I - Objet %1 - - - GEOM_OBJECT_RESULT - Objet Et Rsultat - - - GEOM_ORIENTATION - Orientation - - - GEOM_ORIENTATION_OPT - Renverser l'orientation avec une simulation de vecteur normal - - - GEOM_ORIENTATION_TITLE - Changer l'Orientation - - - GEOM_PARAMETER - Paramtre : - - - GEOM_POINT_ON_EDGE - Point sur la Edge - - - GEOM_POINT_ON_FACE - Point sur la Face - - - GEOM_PARAM_VALUE - By paramtrique - - - GEOM_COORD_VALUE - By Coordonnes - - - GEOM_PARTITION - Partition - - - GEOM_PARTITION_HALFSPACE - Half-space partition - - - GEOM_PARTITION_ORIENTATION - Change l'orientation - - - GEOM_PARTITION_TITLE - Partition d'Objects Avec Outils - - - GEOM_PATH_OBJECT - Objet Chemin - - - GEOM_PIPE - Pipe - - - GEOM_PIPE_TITLE - Construction d'une Pipe - - - GEOM_PLANE - Plan - - - GEOM_PLANE_MIRROR - Plan Miroir - - - GEOM_PLANE_PV - Point + Vecteur - - - GEOM_PLANE_PVC - Point + Vecteur Coordonnes - - - GEOM_PLANE_SIZE - Taille du plan : - - - GEOM_PLANE_TITLE - Construction d'un Plan - - - GEOM_POINT - Point - - - GEOM_POINTS - Points - - - GEOM_POINT_I - Point %1 - - - GEOM_POINT_MIRROR - Point Miroir - - - GEOM_POINT_TITLE - Construction d'un Point - - - GEOM_PRECISION - Prcision : - - - GEOM_PROPAGATE - Propagate - - - GEOM_PROPAGATE_TITLE - Propagate - - - GEOM_PROPERTIES - Basiques Proprietes - - - GEOM_PROPERTIES_CONSTR - Objet et ses Proprietes - - - GEOM_PROPERTIES_SURFACE - Surface : - - - GEOM_PROPERTIES_TITLE - Proprietes Basiques - - - GEOM_PROPERTIES_VOLUME - Volume : - - - GEOM_PRP_ABORT - L'opration a echou - - - GEOM_PRP_COMMAND - Pas de commande associe l'id = %1. - - - GEOM_PRP_DONE - Opration effectue - - - GEOM_PRP_LOADING - Chargement de %1 ... - - - GEOM_PRP_MIN_DIST - Min Distance non calculer - - - GEOM_PRP_NOT_FOR_VTK_VIEWER - Non permis dans viewer VTK - - - GEOM_PRP_NULLSHAPE - Erreur, objet inconsistant ou inappropri ! - - - GEOM_PRP_READY - Prt... - - - GEOM_PRP_SELECT_EDGE - Selectionner les edges et clicker sur Apply - - - GEOM_PRP_SELECT_FACE - Select les faces a supprimer et clicker sur Ok/Apply - - - GEOM_PRP_SELECT_FIRST - Selectionner la shape principale en premier - - - GEOM_PRP_SELECT_SUBSHAPES - Selection de sous objets - - - GEOM_PRP_SHAPE_IN_STUDY - La shape principale doit etre avant dans l'etude - - - GEOM_RADIUS - Rayon - - - GEOM_RADIUS_I - Rayon %1 - - - GEOM_RADIUS_MAJOR - Rayon max. : - - - GEOM_RADIUS_MINOR - Rayon min. : - - - GEOM_REALLY_DELETE - Voulez-vous supprimer l'object(s) ? - - - GEOM_RECONSTRUCTION_LIMIT - Limite de Reconstruction - - - GEOM_RECONSTRUCTION_LIMIT_EDGE - Edge - - - GEOM_RECONSTRUCTION_LIMIT_FACE - Face - - - GEOM_RECONSTRUCTION_LIMIT_SHAPE - Shape - - - GEOM_RECONSTRUCTION_LIMIT_SHELL - Shell - - - GEOM_RECONSTRUCTION_LIMIT_SOLID - Solid - - - GEOM_RECONSTRUCTION_LIMIT_VERTEX - Vertex - - - GEOM_RECONSTRUCTION_LIMIT_WIRE - Wire - - - GEOM_REMOVE_WEBS - Remove webs - - - GEOM_REVERSE - Renverser - - - GEOM_REVERSE_U - Renverser U - - - GEOM_REVERSE_V - Reverser V - - - GEOM_REVERSE_VECTOR - Renverser Le Vecteur - - - GEOM_REVOLUTION - Rvolution - - - GEOM_REVOLUTION_TITLE - Construction Par Revolution - - - GEOM_ROTATION - Rotation - - - GEOM_ROTATION_TITLE - Rotation d'un Objet - - - GEOM_SCALE - Echelle - - - GEOM_SCALE_FACTOR - Facteur d'echelle - - - GEOM_SCALE_TITLE - Echelle d'un Objet - - - GEOM_SECTION - Section - - - GEOM_SECTION_TITLE - BOOLEEN : Section De Deux Objets - - - GEOM_SELECTION - Slection - - - GEOM_SET_MATERIALS - Set materials - - - GEOM_SEWING - Coudre - - - GEOM_SEWING_TITLE - Coudre des Topologies - - - GEOM_SHAPE - Shape - - - GEOM_SHELL - Shell - - - GEOM_SHELLS - Shells - - - GEOM_SHELL_TITLE - Construction d'une Shell - - - GEOM_SKETCHER_ABS - Absolu - - - GEOM_SKETCHER_ANGLE - Angle - - - GEOM_SKETCHER_ANGLE2 - Angle : - - - GEOM_SKETCHER_APPLY - Appliquer - - - GEOM_SKETCHER_ARC - Arc - - - GEOM_SKETCHER_DEST - Destination - - - GEOM_SKETCHER_DIR - Direction - - - GEOM_SKETCHER_DX2 - DX : - - - GEOM_SKETCHER_DY2 - DY : - - - GEOM_SKETCHER_EL - Type d'Element - - - GEOM_SKETCHER_LENGTH - Longueur - - - GEOM_SKETCHER_LENGTH2 - Longueur : - - - GEOM_SKETCHER_PER - Perpendiculaire - - - GEOM_SKETCHER_POINT - Point - - - GEOM_SKETCHER_POINT2 - Point : - - - GEOM_SKETCHER_END_POINT2 - End Point : - - - GEOM_SKETCHER_RADIUS2 - Radius : - - - GEOM_SKETCHER_REL - Relative - - - GEOM_SKETCHER_SEGMENT - Sgment - - - GEOM_SKETCHER_SEL - Slection - - - GEOM_SKETCHER_TAN - Tangent - - - GEOM_SKETCHER_TITLE - Construction de Sketch - - - GEOM_SKETCHER_TYPE - Type - - - GEOM_SKETCHER_UNDO - Undo - - - GEOM_SKETCHER_VALUES - Valeurs - - - GEOM_SKETCHER_VX2 - VX : - - - GEOM_SKETCHER_VXVY - VX-VY - - - GEOM_SKETCHER_VY2 - VY : - - - GEOM_SKETCHER_X - X - - - GEOM_SKETCHER_X2 - X : - - - GEOM_SKETCHER_X3 - Abs. X : - - - GEOM_SKETCHER_Y - Y - - - GEOM_SKETCHER_Y2 - Y : - - - GEOM_SKETCHER_Y3 - Abs. Y : - - - GEOM_SOLID - Solide - - - GEOM_SOLID_TITLE - Construction d'un Solid - - - GEOM_SPHERE - Sphre - - - GEOM_SPHERE_CR - Centre + rayon - - - GEOM_SPHERE_RO - Rayon a l'origine - - - GEOM_SPHERE_TITLE - Construction d'une Sphere - - - GEOM_SPLINE - Spline - - - GEOM_SPLINE_TITLE - Construction de Splines - - - GEOM_STEP - Pas : - - - GEOM_STEP_TITLE - Increment par dfaut lors des constructions - - - GEOM_STEP_U - Pas U : - - - GEOM_STEP_V - Pas V : - - - GEOM_SUBSHAPE_SELECT - Selectionner de Sous Shapes - - - GEOM_SUBSHAPE_TITLE - Selection de Sous Shapes - - - GEOM_SUBSHAPE_TYPE - Type de Sous Shapes - - - GEOM_SUB_SHAPE - Sous Shapes - - - GEOM_SUPPRESSHOLE_FACE_SHELL - Face ou shell - - - GEOM_SUPPRESSHOLE_SELECTFACE - Selection de la face initiale - - - GEOM_SUPPRESSHOLE_SELECTFACE_END - Selection de la face terminale (si trou traversant) - - - GEOM_SUPPRESSHOLE_SELECTWIRE - Selection du contour/trou sur la face - - - GEOM_SUPPRESSHOLE_SELECTWIRE_END - Selection de contour final (si trou traversant) - - - GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE - Selection de trou(s) sur la face - - - GEOM_SUPPRESSHOLE_TITLE - Suppression de trous - - - GEOM_SUPPRESS_RESULT - Supprimer le Resultat - - - GEOM_SUPPRESS_RESULT_INSIDE - Intrieur - - - GEOM_SUPPRESS_RESULT_OUTSIDE - Extrieur - - - GEOM_SUPRESSFACE - Supression de Face - - - GEOM_SUPRESSFACE_SELECT - Selectionner les Faces a Supprimer - - - GEOM_SUPRESSFACE_TITLE - Supprimer des Faces dans un Objet - - - GEOM_SURFCONE - Face Conique - - - GEOM_SURFCYLINDER - Face Cylindrique - - - GEOM_SURFSPHERE - Face Sphrique - - - GEOM_SURFTORUS - Face Toroique - - - GEOM_TOLERANCE - Tolrance - - - GEOM_TOLERANCE_CONSTR - Object et ses Tolerances - - - GEOM_TOLERANCE_EDGE - Edge : - - - GEOM_TOLERANCE_FACE - Face : - - - GEOM_TOLERANCE_TITLE - Tolerance Maximale - - - GEOM_TOLERANCE_VERTEX - Vertex : - - - GEOM_TOOL_OBJECT - Objet Outil - - - GEOM_TORUS - Tore - - - GEOM_TORUS_TITLE - Constructiond'un Tore - - - GEOM_TRANSLATION - Translation - - - GEOM_TRANSLATION_COOR - Translation Avec Coordonnees - - - GEOM_TRANSLATION_TITLE - Translation d'un Objet - - - GEOM_TRANSPARENCY_OPAQUE - Opaque - - - GEOM_TRANSPARENCY_TITLE - Transparence - - - GEOM_TRANSPARENCY_TRANSPARENT - Transparent - - - GEOM_VECTOR - Vecteur - - - GEOM_VECTOR_LENGTH - Longueur Du Vecteur : - - - GEOM_VECTOR_TITLE - Construction d'un Vecteur - - - GEOM_VECTOR_U - Vecteur U - - - GEOM_VECTOR_V - Vecteur V - - - GEOM_VERTEX - Vertex - - - GEOM_WATER_DENSITY - Densit de l'eau : - - - GEOM_WEIGHT - poids - - - GEOM_WHATIS - Whatis - - - GEOM_WHATIS_OBJECT - Objet et ses Informations Topologiques - - - GEOM_WHATIS_TITLE - Whatis - - - GEOM_WIRE - Wire - - - GEOM_WIRES - Wire(s) - - - GEOM_WIRE_CONNECT - Creation d'un Wire a partir de wires/edges connectes - - - GEOM_WIRE_TITLE - Creer un Wire - - - GEOM_WPLANE - Plan de Travail - - - GEOM_WPLANE_FACE - Plan Ou Face plane - - - GEOM_WPLANE_TITLE - plan de travail - - - GEOM_WRN_RADIUS_NULL - Le rayon est nul - - - GEOM_WRN_WARNING - Avertissement - - - GEOM_X - X : - - - GEOM_Y - Y : - - - GEOM_Z - Z : - - - SUPPRESS_RESULT - Suppress Result - - + + + @default + + BRep_API: command not done + Erreur: impossible de construire l'objet + + + CHANGE_ORIENTATION_NEW_OBJ_NAME + Inverser + + + CLOSE_CONTOUR_NEW_OBJ_NAME + ContourFerme + + + DEP_OBJECT + L'objet choisi a été utilisé pour créer un autre objet. +Il n'est pas possible de le supprimer + + + DEVIDE_EDGE_NEW_OBJECT_NAME + NouvelObjet + + + ERROR_SHAPE_TYPE + Le type de l'objet choisi n'est pas correct! +Choisissez une face, une coque ou un solide et essayez de nouveau + + + iErr : 10 + le Classificateur est NULL + + + iErr : 11 + la Forme est NULL + + + iErr : 12 + Type d'objet non autoriqé + + + iErr : 13 + Cet état n'est pas autorisé + + + iErr : 15 + Ce type de surface n'est pas autorisé + + + iErr : 20 + Impossible de trouver la triangulation + + + iErr : 30 + Impossible d'obtenir la ligne à partir du lien + + + iErr : 40 + Impossible de classifier le point + + + iErr : 41 + Les données ne sont pas valides pour le classificateur + + + GEOM_2D_CONTINUTY + Continuité 2D + + + GEOM_2D_CURVE_MODE + Mode courbe 2D + + + GEOM_2D_TOLERANCE + Tolérance 2D + + + GEOM_3D_CONTINUTY + Continuité 3D + + + GEOM_3D_CURVE_MODE + Mode courbe 3D + + + GEOM_3D_TOLERANCE + Tolérance 3D + + + GEOM_3_POINTS + 3 points + + + GEOM_ADD_POINT + Ajouter un point + + + GEOM_ANGLE + Angle : + + + GEOM_ANGLE_1 + Angle + + + GEOM_ARC_ELLIPSE + Arc d'ellipse + + + GEOM_ARC + Arc + + + GEOM_ARCHIMEDE + Archimède + + + GEOM_ARCHIMEDE_TITLE + Construction Archimède + + + GEOM_ARC_TITLE + Construction d'un arc + + + GEOM_ARGUMENTS + Arguments + + + GEOM_AXE_MIRROR + Axe de symétrie + + + GEOM_AXIS + Axe + + + GEOM_BASE + Base + + + GEOM_BASE_OBJECT + Objet de Base + + + GEOM_BASE_POINT + Point de Base + + + GEOM_BEZIER + Bezier + + + GEOM_BINORMAL + BiNormal + + + GEOM_BLOCK + Solide Hexaédrique + + + GEOM_BLOCKS_COMPOUND + AssemblageBloques + + + GEOM_BLOCK_EXPLODE + Sous-Bloques + + + GEOM_BLOCK_EXPLODE_TITLE + Sélection des Sous-bloques + + + GEOM_BLOCK_MULTITRSF + Multi-Transformation Bloques + + + GEOM_BLOCK_MULTITRSF_DOUBLE + Multi-Transformation Double + + + GEOM_BLOCK_MULTITRSF_SIMPLE + Multi-Transformation Simple + + + GEOM_BLOCK_MULTITRSF_TITLE + Multi-Transformation Bloques + + + GEOM_BLOCK_TITLE + Construction d'un solide hexaédrique + + + GEOM_BNDBOX + Boîte Englobante + + + GEOM_BNDBOX_OBJDIM + Objet et ses Dimensions + + + GEOM_BNDBOX_TITLE + Boîte Englobante Information + + + GEOM_BOX + Boite + + + GEOM_BOX_OBJ + Dimensions à l'Origine + + + GEOM_BOX_TITLE + Construction d'une Boîte + + + GEOM_BSplineRestriction + BSplineLimitation + + + GEOM_BUT_APPLY + &Appliquer + + + GEOM_BUT_CANCEL + A&nnuler + + + GEOM_BUT_CLOSE + &Fermer + + + GEOM_BUT_CLOSE_SKETCH + Fermer le contour et valider + + + GEOM_BUT_END_SKETCH + Valider l'esquisse + + + GEOM_BUT_EXPLODE + &Eclater + + + GEOM_BUT_HELP + &Aide + + + GEOM_BUT_NO + &Non + + + GEOM_BUT_OK + &Oui + + + GEOM_BUT_APPLY_AND_CLOSE + A&ppliquer et Fermer + + + GEOM_BUT_YES + &Oui + + + GEOM_BY_LENGTH + Par longueur + + + GEOM_BY_PARAMETER + Par paramètre + + + GEOM_CENTER + Centre + + + GEOM_CENTER_DEFAULT + (Origine par défaut) + + + GEOM_CENTER_POINT + Point Central + + + GEOM_CENTRAL_POINT + Point Central + + + GEOM_CHAMFER + Chanfrein + + + GEOM_CHAMFER_ABORT + Il n'est pas possible de calculer un chanfrein avec %1 et %2 + + + GEOM_CHAMFER_ALL + Chanfrein sur l'Objet tout entier + + + GEOM_CHAMFER_EDGES + Chanfrein sur les arêtes d'un Objet + + + GEOM_CHAMFER_FACES + Chanfrein sur les Faces d'un Objet + + + GEOM_CHAMFER_TITLE + Construction d'un Chanfrein + + + GEOM_CHANGE_ORIENTATION + Objets à modifier + + + GEOM_CHANGE_ORIENTATION_TITLE + Changer l'orientation + + + GEOM_CHECK_BLOCKS_COMPOUND + Controler un Assemblage de Blocs + + + GEOM_CHECK_BLOCKS_COMPOUND_FAILED + La vérification n'a pas abouti + + + GEOM_CHECK_BLOCKS_COMPOUND_ERRORS + Erreurs + + + GEOM_CHECK_BLOCKS_COMPOUND_HAS_ERRORS + L'Assemblage de Blocs contient des erreurs + + + GEOM_CHECK_BLOCKS_COMPOUND_HAS_NO_ERRORS + L'Assemblage de Blocs n'a pas d'erreur + + + GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES + Sous-objets incriminés + + + GEOM_CHECK_INFOS + Objet et son Information Topologique + + + GEOM_CHECK_SHAPE + Contrôler un objet + + + GEOM_CHECK_TITLE + Contrôler la validité de l'objet + + + GEOM_CIRCLE + Circle + + + GEOM_CIRCLE_TITLE + Construction d'un Cercle + + + GEOM_CLOSECONTOUR_TITLE + Fermer le contour + + + GEOM_CMASS + Centre de Gravité + + + GEOM_CMASS_TITLE + Construction du Centre de Gravité + + + GEOM_COMMON + Intersection + + + GEOM_COMMON_TITLE + Intersection de deux Objets + + + GEOM_COMPOUND + Assemblage + + + GEOM_COMPOUNDSOLID + AssemblageSolide + + + GEOM_COMPOUND_TITLE + Créer un Assemblage + + + GEOM_CONE + Cône + + + GEOM_CONE_TITLE + Construction d'un Cône + + + GEOM_CONFIRM + Confirmer l'opération + + + GEOM_CONFIRM_INFO + L'objet contient %1 sous-objets ! + + + GEOM_COOR + Coord. : + + + GEOM_COORDINATES + Coordonnées + + + GEOM_COORDINATES_RES + Coordonnées résultantes + + + GEOM_CREATE_COPY + Créer une copie + + + GEOM_CREATE_SINGLE_SOLID + Créer un solide unique + + + GEOM_CURVE + Courbe + + + GEOM_CURVE_CONTINUTY + Continuité des Courbes + + + GEOM_CURVE_TITLE + Construction d'une Courbe + + + GEOM_CUT + Découpe + + + GEOM_CUT_TITLE + Découpe de deux Objets + + + GEOM_CYLINDER + Cylindre + + + GEOM_CYLINDER_TITLE + Construction d'un Cylindre + + + GEOM_D1 + D1 : + + + GEOM_D2 + D2 : + + + GEOM_DETECT + Détecter + + + GEOM_DIAGONAL_POINTS + Points Diagonaux + + + GEOM_DISK + Disque + + + GEOM_DISK_TITLE + Construction d'un Disque + + + GEOM_DIMENSIONS + Dimensions + + + GEOM_DISTANCE + Distance + + + GEOM_DIVIDE_EDGE_TITLE + Ajouter un point + + + GEOM_DX + Dx : + + + GEOM_DY + Dy : + + + GEOM_DZ + Dz : + + + GEOM_DropSmallEdges + ArêtesMineuresOmises + + + GEOM_EDGE + Arête + + + GEOM_EDGE_TITLE + Créer une Arête + + + GEOM_ELLIPSE + Ellipse + + + GEOM_ELLIPSE_ERROR_1 + Impossible de créer un ellipse: le demi petit axe est plus grand que le demi grand axe. + + + GEOM_ELLIPSE_TITLE + Construction d'une Ellipse + + + GEOM_END_LCS + Fin SCL + + + GEOM_ERROR + Erreur + + + GEOM_ERROR_STATUS + Etat de l'Opération + + + GEOM_ERR_GET_ENGINE + Il est impossible d'obtenir le composant GEOM Engine. Rouvrez le module Geometry et essayez de nouveau. + + + GEOM_ERR_LIB_NOT_FOUND + Il est impossible de trouver ou d'ouvrir la librairie IHM correspondante à l'action de l'utilisateur + + + GEOM_EXTRUSION + Extrusion + + + GEOM_EXTRUSION_BSV + Formes de Base + Vecteur + + + GEOM_EXTRUSION_BSV_2P + Formes de Base + 2 Points + + + GEOM_EXTRUSION_DXDYDZ + Formes de Base + Vecteur DX DY DZ + + + GEOM_EXTRUSION_TITLE + Construction par Extrusion + + + GEOM_FACE + Face + + + GEOM_CS + Système de Coordonnées + + + GEOM_GCS + Système de Coordonnées Global + + + GEOM_LCS + Système de Coordonnées Local + + + GEOM_FACES + Faces + + + GEOM_FACE_FFW + Création d'une Face à partir des contours et/ou arêtes + + + GEOM_FACE_OPT + Privilégier la création d'une face plane + + + GEOM_FACE_OR_LCS + Face ou SCL + + + GEOM_FACE_SELECTION + Sélection d'une Face + + + GEOM_FACE_TITLE + Créer une Face + + + GEOM_RECTANGLE_TITLE + Construction d'un Rectangle + + + GEOM_RECTANGLE + Rectangle + + + GEOM_FILLET + Congé + + + GEOM_FILLET_2D + Congé 2D + + + GEOM_FILLET_1D + Congé 1D + + + GEOM_FILLET_ABORT + Il n'est pas possible de calculer un congé avec le rayon %1 + + + GEOM_FILLET_ALL + Congé sur l'Objet tout entier + + + GEOM_FILLET_EDGES + Congé sur les Arêtes de l'Objet + + + GEOM_FILLET_WIRES + Congé sur les Contours de l'Objet + + + GEOM_FILLET_FACES + Congé sur les Faces de l'Objet + + + GEOM_FILLET_VERTEXES + Congé sur les Sommets de l'Objet + + + GEOM_FILLET_TITLE + Construction d'un Congé + + + GEOM_FILLET_2D_TITLE + Construction d'un Congé 2D + + + GEOM_FILLET_1D_TITLE + Construction d'un Congé 1D + + + GEOM_FILLING + Remplissage + + + GEOM_FILLING_ARG + Arguments et Paramètres + + + GEOM_FILLING_COMPOUND + Assemblage d'entrée + + + GEOM_FILLING_MAX_DEG + Degré maximal + + + GEOM_FILLING_MIN_DEG + Degré minimal + + + GEOM_FILLING_NB_ITER + Nb. Itér : + + + GEOM_FILLING_TITLE + Remplir une Surface avec des Arêtes + + + GEOM_FILLING_TOL_2D + Tol. 2D : + + + GEOM_FILLING_TOL_3D + Tol. 3D : + + + GEOM_FREE_BOUNDARIES + Contours Libres + + + GEOM_FREE_BOUNDS_ERROR + L'objet n'est pas sélectionné + + + GEOM_FREE_BOUNDS_MSG + Contours libres trouvés: %1 (%2 fermés, %3 ouverts) + + + GEOM_FREE_BOUNDS_TLT + Trouver des Contours Libres + + + GEOM_FREE_FACES + Faces Libres + + + GEOM_FREE_FACES_TITLE + Faces Libres + + + GEOM_FUSE + Union + + + GEOM_FUSE_TITLE + Réunir deux Objets + + + GEOM_FixFaceSize + TailleFaceRepare + + + GEOM_FixShape + ObjetRepare + + + GEOM_GLUE + Recoller + + + GEOM_GLUE_TITLE + Recollement de faces + + + GEOM_LIMIT_TOLERANCE_TITLE + Limiter la tolérance + + + GEOM_HEIGHT + Hauteur: + + + GEOM_HOLES + Trous + + + GEOM_IDENTICAL_NAMES_SELECT_BY_MOUSE + Noms Identiques : sélectionner à la souris ! + + + GEOM_IMPORT + Objet_Importé + + + GEOM_INCORRECT_INPUT + Les données d'entrée ne sont pas valides! + + + GEOM_INERTIA_CONSTR + Matrice et Moment d'Inertie + + + GEOM_INERTIA_I + %1:1 : + + + GEOM_INERTIA_IXYZ + IX & IY & IZ : + + + GEOM_INERTIA_TITLE + Calcul de l'Inertie + + + GEOM_INF_LOADED + Le fichier %1 est ouvert. + + + GEOM_INTERNAL_WIRES + Contours internes + + + GEOM_INTERPOL + Interpolation + + + GEOM_KEEP_OBJECT + Garder l'Objet + + + GEOM_LENGTH + Longueur : + + + GEOM_LINE + Ligne + + + GEOM_LINE_TITLE + Construction d'une Ligne + + + GEOM_MAIN_OBJECT + Objet Principal + + + GEOM_MARKER + Repère + + + GEOM_MARKER_TITLE + Créer une repère + + + GEOM_MATERIAL_ID + ID Matériel: + + + GEOM_MATERIAL_MATERIAL + Matériel + + + GEOM_MATERIAL_SET + << Jeu + + + GEOM_MATERIAL_SHAPE + Formes + + + GEOM_MATERIAL_TITLE + Définir les matériaux pour la Fusion Dominante + + + GEOM_MATRIX + Matrice : + + + GEOM_MAX + Max : + + + GEOM_MAX_3D_TOLERANCE + Tolérance 3D Maximale + + + GEOM_MAX_TOLERANCE + Tolérance Maximale + + + GEOM_MEN_ALL_FILES + Tous les Fichiers ( * ) + + + GEOM_MEN_ANGLE + Angle : + + + GEOM_MEN_COMPONENT + Géométrie + + + GEOM_MEN_ENTER_ANGLE + Indiquez l'Angle en Degrés + + + GEOM_MEN_EXPORT + Exporter + + + GEOM_MEN_IMPORT + Importer + + + GEOM_MEN_ISOS + Choisir le nombre d'Isolignes + + + GEOM_MEN_ISOU + Isos U : + + + GEOM_MEN_ISOV + Isos V : + + + GEOM_MEN_POPUP_NAME + %1 Objets + + + GEOM_MEN_SHADING + Ombrage + + + GEOM_MEN_SKETCHER_X + Indiquez la distance selon l'axe X + + + GEOM_MEN_SKETCHER_Y + Indiquez la distance selon l'axe Y + + + GEOM_MEN_STEP_LABEL + Pas : + + + GEOM_MEN_TRANSPARENCY + Transparence + + + GEOM_MEN_TRANSPARENCY_LABEL + Transparence : + + + GEOM_MEN_WIREFRAME + Filaire + + + GEOM_MEN_X + X : + + + GEOM_MEN_Y + Y : + + + GEOM_MESHING_DEFLECTION + Déflection de Maillage. : + + + GEOM_MIN + Min : + + + GEOM_MINDIST_OBJ + Objets et Résultats + + + GEOM_MINDIST_TITLE + Distance minimale entre deux Objets + + + GEOM_MIRROR + Miroir + + + GEOM_MIRROR_TITLE + Refléter un Objet + + + GEOM_MULTIROTATION + Multi-Rotation + + + GEOM_MULTIROTATION_DOUBLE + Multi Rotation Double + + + GEOM_MULTIROTATION_SIMPLE + Multi Rotation Simple + + + GEOM_MULTIROTATION_TITLE + Multi-Rotation + + + GEOM_MULTITRANSLATION + Multi-Translation + + + GEOM_MULTITRANSLATION_DOUBLE + Multi Translation Double + + + GEOM_MULTITRANSLATION_SIMPLE + Multi Translation Simple + + + GEOM_MULTITRANSLATION_TITLE + Multi-Translation + + + GEOM_NAME_INCORRECT + Le nom de l'Objet n'a pas été trouvé + + + GEOM_NB_BLOCKS_NO_OTHERS + Il y a %1 bloques spécifiés et PAS d'autres solides + + + GEOM_NB_BLOCKS_SOME_OTHERS + Il y a %1 bloques spécifiés et d'autres solides + + + GEOM_NB_TIMES + Nb. Fois : + + + GEOM_NB_TIMES_U + Nb. Fois U : + + + GEOM_NB_TIMES_V + Nb. Fois V : + + + GEOM_NODES + Noeuds + + + GEOM_NUM_SPLIT_POINTS + Nombre de points de découpe + + + GEOM_OBJECT + Objet + + + GEOM_OBJECT_TYPE + Type d'Objet + + + GEOM_OBJECTS + Objets + + + GEOM_OBJECT_I + Objet %1 + + + GEOM_OBJECT_RESULT + Objet et Résultat + + + GEOM_OFFSET + Décalage + + + GEOM_OFFSET_TITLE + Décaler une surface + + + GEOM_OPERATIONS + Opérations + + + GEOM_ORIENTATION + Orientation + + + GEOM_ORIENTATION_OPT + Inverser l'Orientation et simuler les vecteurs normaux + + + GEOM_ORIENTATION_TITLE + Changer l'Orientation + + + GEOM_PARAMETER + Paramètre : + + + GEOM_PARAMETERS + Paramètres + + + GEOM_POINT_ON_EDGE + Créer un point sur une arête + + + GEOM_POINT_ON_FACE + Créer un point sur une face + + + GEOM_PARAM_VALUE + Par paramètre + + + GEOM_COORD_VALUE + Par coordonnée + + + GEOM_PARTITION + Partition + + + GEOM_WRN_PARTITION_RESULT_EMPTY + Le résultat de la partition est vide, verifiez le paramètre limite de reconstruction + + + GEOM_PARTITION_HALFSPACE + Partition de demi-espace + + + GEOM_PARTITION_ORIENTATION + Changer l'Orientation + + + GEOM_PARTITION_TITLE + Partition d'un Objet avec un Outil + + + GEOM_PATH_OBJECT + Chemin + + + GEOM_PIPE + Tuyau + + + GEOM_PIPE_TITLE + Construction d'un tuyau + + + GEOM_SEGMENT + Segment de droite + + + GEOM_SELECT_UNPUBLISHED_EDGES + Choisir les arêtes non-publiées + + + GEOM_PLANE + Plan + + + GEOM_PLANE_MIRROR + Plan Miroir + + + GEOM_PLANE_PV + Point + Vecteur + + + GEOM_PLANE_PVC + Point + Vecteur de Coordonnées + + + GEOM_PLANE_SIZE + Taille du plan : + + + GEOM_PLANE_TITLE + Construction d'un Plan + + + GEOM_POINT + Point + + + GEOM_POINT1 + Point 1 + + + GEOM_POINT2 + Point 2 + + + GEOM_POINT3 + Point 3 + + + GEOM_POINTS + Points + + + GEOM_POINT_I + Point %1 + + + GEOM_POINT_MIRROR + Point Miroir + + + GEOM_POINT_TITLE + Construction d'un Point + + + GEOM_POLYLINE + Ligne brisée + + + GEOM_POSITION + Position + + + GEOM_POSITION_TITLE + Modifier la Position d'un Objet + + + GEOM_PRECISION + Précision : + + + GEOM_PROPAGATE + Propager + + + GEOM_PROPAGATE_TITLE + Propager + + + GEOM_PROPERTIES + Propriétés de Base + + + GEOM_PROPERTIES_CONSTR + Objet et ses Propriétés + + + GEOM_PROPERTIES_SURFACE + Surface : + + + GEOM_PROPERTIES_TITLE + Propriétés de Base + + + GEOM_PROPERTIES_VOLUME + Volume : + + + GEOM_PRP_ABORT + L'Opération a été annulée + + + GEOM_PRP_COMMAND + Pas de commandes associées avec cet id = %1. + + + GEOM_PRP_DONE + L'Opération a abouti + + + GEOM_PRP_EXPORT + Exporter la géométrie à %1 ... + + + GEOM_PRP_LOADING + Charger %1 ... + + + GEOM_PRP_MIN_DIST + La Distance minimale n'est pas calculée + + + GEOM_PRP_NOT_FOR_VTK_VIEWER + Interdit dans le visualiseur VTK + + + GEOM_PRP_NULLSHAPE + Erreur, l'objet est inexistant ou incorrect! + + + GEOM_PRP_READY + Prêt + + + GEOM_PRP_SELECT_EDGE + Choisissez les arêtes et cliquez sur Appliquer + + + GEOM_PRP_SELECT_FACE + Choisissez les faces à supprimer et cliquez sur Oui/Appliquer + + + GEOM_PRP_SELECT_FIRST + Commencez par choisir l'objet principal + + + GEOM_PRP_SELECT_SUBSHAPES + Choisissez les Sous-Objets + + + GEOM_PRP_SHAPE_IN_STUDY + Commencez par indiquer l'objet principal + + + GEOM_QUAD_FACE + Face Quadrangulaire + + + GEOM_QUAD_FACE_TITLE + Construction d'une Face Quadrangulaire + + + GEOM_RADIUS + Rayon : + + + GEOM_RADIUS_I + Rayon %1 : + + + GEOM_RADIUS_MAJOR + Demi grand axe : + + + GEOM_RADIUS_MINOR + Demi petit axe : + + + GEOM_RECONSTRUCTION_LIMIT + Type Résultant + + + GEOM_RECONSTRUCTION_LIMIT_EDGE + Arête + + + GEOM_RECONSTRUCTION_LIMIT_FACE + Face + + + GEOM_RECONSTRUCTION_LIMIT_SHAPE + Objet + + + GEOM_RECONSTRUCTION_LIMIT_SHELL + Coque + + + GEOM_RECONSTRUCTION_LIMIT_SOLID + Solide + + + GEOM_RECONSTRUCTION_LIMIT_VERTEX + Point + + + GEOM_RECONSTRUCTION_LIMIT_WIRE + Contour + + + GEOM_REF_POINT + Point avec référence + + + GEOM_REMOVE_ALL_HOLES + Supprimer tous les trous + + + GEOM_REMOVE_ALL_INT_WIRES + Supprimer tous les contours internes + + + GEOM_REMOVE_HOLES_TITLE + Supprimer les trous + + + GEOM_REMOVE_INTERNAL_WIRES_TITLE + Supprimer les contours internes + + + GEOM_REMOVE_WEBS + Supprimer les toiles + + + GEOM_REQUIRED_DEGREE + Degré nécessaire + + + GEOM_REQUIRED_NUM_SEGMENTS + Nombre de segments requis + + + GEOM_REVERSE + Inverser + + + GEOM_REVERSE_DIRECTION + Inverser la direction + + + GEOM_REVERSE_PLANE + Inverser la normale du plan + + + GEOM_REVERSE_U + Inverser U + + + GEOM_REVERSE_V + inverser V + + + GEOM_REVERSE_VECTOR + Inverser un vecteur + + + GEOM_REVOLUTION + Révolution + + + GEOM_REVOLUTION_TITLE + Construction par révolution + + + GEOM_ROTATION + Rotation + + + GEOM_ROTATION_TITLE + Rotation d'un objet + + + GEOM_SCALE + Echelle + + + GEOM_SCALE_FACTOR + Facteur d'échelle : + + + GEOM_SCALE_TITLE + Redimensionner un objet + + + GEOM_SECTION + Section + + + GEOM_SECTION_TITLE + Section de deux objets + + + GEOM_SELECTED_FACE + Face sélectionnée + + + GEOM_SELECTED_OBJECTS + Objets sélectionnés + + + GEOM_SELECTED_SHAPE + Forme sélectionnée + + + GEOM_SELECTION + Sélection + + + GEOM_SET_MATERIALS + Définir les materiaux + + + GEOM_SEWING + Couture + + + GEOM_SEWING_TITLE + Couture topologique + + + GEOM_SHAPE + Forme + + + GEOM_SHAPEPROCESS_TITLE + Traitement de formes + + + GEOM_SHAPES + Formes + + + GEOM_SHELL + Coque + + + GEOM_SHELLS + Coques + + + GEOM_SHELL_TITLE + Construction d'une coque + + + GEOM_SKETCHER_ABS + Absolu + + + GEOM_SKETCHER_ANGLE + Angle + + + GEOM_SKETCHER_ANGLE2 + Angle : + + + GEOM_SKETCHER_APPLY + Appliquer + + + GEOM_SKETCHER_ARC + Arc + + + GEOM_SKETCHER_DEST + Destination + + + GEOM_SKETCHER_DIR + Direction + + + GEOM_SKETCHER_DX2 + DX : + + + GEOM_SKETCHER_DY2 + DY : + + + GEOM_SKETCHER_DZ2 + DZ : + + + GEOM_SKETCHER_EL + Type d'élément + + + GEOM_SKETCHER_RESTORE + Restaurer + + + GEOM_SKETCHER_LENGTH + Longueur + + + GEOM_SKETCHER_LENGTH2 + Longueur : + + + GEOM_SKETCHER_PER + Perpendiculaire + + + GEOM_SKETCHER_POINT + Point + + + GEOM_SKETCHER_POINT2 + Point : + + + GEOM_SKETCHER_END_POINT2 + End Point : + + + GEOM_SKETCHER_RADIUS2 + Rayon : + + + GEOM_SKETCHER_REL + Relatif + + + GEOM_SKETCHER_SEGMENT + Segment + + + GEOM_SKETCHER_SEL + Sélection + + + GEOM_SKETCHER_TAN + Tangent + + + GEOM_SKETCHER_TITLE + Construction d'une esquisse 2D + + + GEOM_3DSKETCHER_TITLE + Construction d'une esquisse 3D + + + GEOM_SKETCHER_TYPE + Type + + + GEOM_SKETCHER_UNDO + Revenir + + + GEOM_SKETCHER_VALUES + Valeurs + + + GEOM_SKETCHER_VX2 + VX : + + + GEOM_SKETCHER_VXVY + VX-VY + + + GEOM_SKETCHER_VY2 + VY : + + + GEOM_SKETCHER_X + X + + + GEOM_SKETCHER_X2 + X : + + + GEOM_SKETCHER_X3 + Abs. X : + + + GEOM_SKETCHER_Y + Y + + + GEOM_SKETCHER_Y2 + Y : + + + GEOM_SKETCHER_Y3 + Abs. Y : + + + GEOM_SKETCHER_Z2 + Z : + + + GEOM_3DSKETCHER + Esquisse 3D + + + GEOM_COORDINATES_TYPE + Type de coordonnées + + + GEOM_SOLID + Solide + + + GEOM_SOLID_TITLE + Construction d'un solide + + + GEOM_SPHERE + Sphère + + + GEOM_SPHERE_CR + Centre + Rayon + + + GEOM_SPHERE_RO + Rayon (centre à l'origine) + + + GEOM_SPHERE_TITLE + Construction d'une sphère + + + GEOM_SPLINE + Spline + + + GEOM_SPLINE_TITLE + Construction d'un spline + + + GEOM_START_LCS + SCL du Début + + + SELECT_UNPUBLISHED_EDGES + Choisir les arêtes non-publiées + + + GEOM_STEP + Pas : + + + GEOM_STEP_TITLE + Valeur du pas pour les constructions d'IHM + + + GEOM_STEP_U + Pas U : + + + GEOM_STEP_V + Pas V : + + + GEOM_STUDY_LOCKED + L'étude en cours est fermée et il n'est pas possible de la modifier + + + GEOM_SUBSHAPE_SELECT + Choisir les sous-objets + + + GEOM_SUBSHAPE_TITLE + Sélection des sous-objets + + + GEOM_SUBSHAPE_TYPE + Type des sous-objets: + + + GEOM_SUB_SHAPE + Sous-objets + + + GEOM_SUPPRESSHOLE_FACE_SHELL + Face ou coque + + + GEOM_SUPPRESSHOLE_SELECTFACE + Choisir la face avec un trou + + + GEOM_SUPPRESSHOLE_SELECTFACE_END + Choisir la face finale (si l'on traverse le trou) + + + GEOM_SUPPRESSHOLE_SELECTWIRE + Choisir le contour d'une face + + + GEOM_SUPPRESSHOLE_SELECTWIRE_END + Choisir le contour final (si l'on traverse le trou) + + + GEOM_SUPPRESSHOLE_SELECT_HOLES_ON_FACE + Choisir les trous sur la face + + + GEOM_SUPPRESSHOLE_TITLE + Supprimer les trous + + + GEOM_SUPPRESS_RESULT + Supprimer le résultat + + + GEOM_SUPPRESS_RESULT_INSIDE + A l'intérieur + + + GEOM_SUPPRESS_RESULT_OUTSIDE + A l'extérieur + + + GEOM_SUPRESSFACE + Supprimer une Face + + + GEOM_SUPRESSFACE_SELECT + Choisissez les faces à supprimer + + + GEOM_SUPRESSFACE_TITLE + Supprimer les faces d'un objet + + + GEOM_SURFACE_CONTINUTY + Continuité des surfaces + + + GEOM_SURFACE_MODE + Mode de Surface + + + GEOM_SURFCONE + Face conique + + + GEOM_SURFCYLINDER + Face cylindrique + + + GEOM_SURFSPHERE + Face sphérique + + + GEOM_SURFTORUS + Face toroïdale + + + GEOM_SameParameter + MêmeParamètre + + + GEOM_SplitAngle + SéparerAngle + + + GEOM_SplitClosedFaces + SéparerFacesFermées + + + GEOM_SplitContinuity + SéparerContinuité + + + GEOM_TOLERANCE + Tolérance + + + GEOM_LINEAR_TOLERANCE + Tolérance linéaire + + + GEOM_ANGULAR_TOLERANCE + Tolérance angulaire + + + GEOM_TOLERANCE_CONSTR + Objet et ses tolérances + + + GEOM_TOLERANCE_EDGE + Arête : + + + GEOM_TOLERANCE_FACE + Face : + + + GEOM_TOLERANCE_TITLE + Tolérance maximale + + + GEOM_TOLERANCE_VERTEX + Point: + + + GEOM_TOOL_OBJECT + Objet outil + + + GEOM_TOOL_OBJECTS + Objets outils + + + GEOM_TORUS + Tore + + + GEOM_TORUS_TITLE + Construction d'un tore + + + GEOM_TRANSLATION + Translation + + + GEOM_TRANSLATION_COOR + Translation avec coordonnées + + + GEOM_TRANSLATION_TITLE + Translation d'un objet + + + GEOM_TRANSPARENCY_OPAQUE + Opaque + + + GEOM_TRANSPARENCY_TITLE + Transparence + + + GEOM_TRANSPARENCY_TRANSPARENT + Transparent + + + GEOM_TRIHEDRON + Trièdre + + + GEOM_ToBezier + VersBezier + + + GEOM_VALUE + Valeur + + + GEOM_VECTOR + Vecteur + + + GEOM_AXIS_DEFAULT + (Axe Z par défaut) + + + GEOM_VECTOR_LENGTH + Longueur d'un vecteur : + + + GEOM_VECTOR_TITLE + Construction d'un vecteur + + + GEOM_VECTOR_U + Vecteur U + + + GEOM_VECTOR_V + Vecteur V + + + GEOM_VERTEX + Sommet + + + GEOM_VERTEXES + Sommets + + + GEOM_WATER_DENSITY + Densité de l'eau : + + + GEOM_WEIGHT + Poids : + + + GEOM_WIDTH + Largeur : + + + GEOM_WHATIS + Qu'est-ce que c'est ? + + + GEOM_WHATIS_OBJECT + Objet et ses caractéristiques topologiques + + + GEOM_WHATIS_TITLE + Qu'est-ce que c'est ? + + + GEOM_WIRE + Contour + + + GEOM_WIRES + Contour(s) + + + GEOM_WIRES_TO_REMOVE + Contours à supprimer + + + GEOM_WIREZ + Contours + + + GEOM_WIRE_CONNECT + Création d'un contour à partir de contours/arêtes connecté(e)s + + + GEOM_WIRE_TITLE + Création d'un contour + + + GEOM_WPLANE + Plan de travail + + + GEOM_WPLANE_FACE + Plan, Face plane ou SCL + + + GEOM_WPLANE_ORIGIN + Choisissez un plan + + + GEOM_WPLANE_OXY + OXY + + + GEOM_WPLANE_OYZ + OYZ + + + GEOM_WPLANE_OZX + OZX + + + GEOM_WPLANE_TITLE + Sélection du plan de travail + + + GEOM_WPLANE_VECTOR + Choisissez 2 vecteurs + + + GEOM_WPLANE_VX + Vecteur X + + + GEOM_WPLANE_VZ + Vecteur Z + + + GEOM_WRN_RADIUS_NULL + Le rayon est nul + + + GEOM_WRN_WARNING + Attention + + + WRN_SHAPE_UNCLOSED + Impossible de créer un solide à partir d'une forme non-fermée %1 + + + GEOM_X + X : + + + GEOM_Y + Y : + + + GEOM_Z + Z : + + + GLUE_NEW_OBJ_NAME + Recollement + + + LIMIT_TOLERANCE_NEW_OBJ_NAME + Tolérance_limite + + + MEN_ALL_SEL_ONLY + Sélectionner tout + + + MEN_ARC + Arc + + + MEN_ARCHIMEDE + Archimède + + + MEN_BASIC + Objets de base + + + MEN_BASIC_PROPS + Propriétés de base + + + MEN_BLOCKS + Blocs + + + MEN_BND_BOX + Boîte englobante + + + MEN_BOOLEAN + Opérations booléennes + + + MEN_BOX + Boîte + + + MEN_BUILD + Construire + + + MEN_CHAMFER + Chanfrein + + + MEN_CHANGE_ORIENTATION + Changer l'orientation + + + MEN_CHECK + Contrôler un objet + + + MEN_CHECK_COMPOUND + Contrôler un assemblage de blocs + + + MEN_CHECK_FREE_BNDS + Contrôler les contours libres + + + MEN_CHECK_FREE_FACES + Contrôler les faces libres + + + MEN_CHECK_GEOMETRY + Contrôler la géométrie + + + MEN_CIRCLE + Cercle + + + MEN_CLIPPING + Plage de découpe + + + MEN_CLOSE_CONTOUR + Fermer le contour + + + MEN_COMMON + Intersection + + + MEN_COMPOUND + Assemblage + + + MEN_COMPOUND_SEL_ONLY + Assemblage + + + MEN_CONE + Cône + + + MEN_CURVE + Courbe + + + MEN_CUT + Découpe + + + MEN_CYLINDER + Cylindre + + + MEN_RECTANGLE + Rectangle + + + MEN_DELETE + Supprimer + + + MEN_DIMENSIONS + Dimensions + + + MEN_DISPLAY + Afficher + + + MEN_DISK + Disque + + + MEN_DISPLAY_ALL + Afficher tout + + + MEN_DISPLAY_MODE + Mode de visualisation + + + MEN_DISPLAY_ONLY + Afficher uniquement + + + MEN_EDGE + Arête + + + MEN_EDGE_SEL_ONLY + Arête + + + MEN_EDIT + Edition + + + MEN_ELLIPSE + Ellipse + + + MEN_ERASE + Cacher + + + MEN_ERASE_ALL + Cacher tout + + + MEN_EXPLODE + Eclater + + + MEN_EXPLODE_BLOCKS + Eclater en blocs + + + MEN_EXPORT + Exporter... + + + MEN_EXTRUSION + Extrusion + + + MEN_FACE + Face + + + MEN_FACE_SEL_ONLY + Face + + + MEN_FILE + Fichier + + + MEN_FILLET + Congé 3D + + + MEN_FILLET_1D + Congé 1D + + + MEN_FILLET_2D + Congé 2D + + + MEN_FILLING + Nappe + + + MEN_FUSE + Union + + + MEN_GENERATION + Génération + + + MEN_GLUE_FACES + Recoller les faces + + + MEN_GROUP + Groupe + + + MEN_GROUP_CREATE + Créer une groupe + + + MEN_GROUP_EDIT + Editer + + + MEN_RELOAD_IMPORTED + Recharger à partir du disque + + + MEN_HEX_SOLID + Solid hexaédrique + + + MEN_IMPORT + Importer... + + + MEN_INERTIA + Inertie + + + MEN_ISOS + Isos + + + MEN_LIMIT_TOLERANCE + Tolérance limite + + + MEN_LINE + Ligne + + + MEN_LOCAL_CS + Système de coordonnées local + + + MEN_MASS_CENTER + Centre de gravité + + + MEN_MEASURES + Mesures + + + MEN_MIN_DIST + Distance minimale + + + MEN_MIRROR + Symétrie + + + MEN_MODIFY_LOCATION + Modifer la position + + + MEN_MUL_ROTATION + Multi-rotation + + + MEN_MUL_TRANSFORM + Multi-transformation + + + MEN_MUL_TRANSLATION + Multi-translation + + + MEN_NEW_ENTITY + Nouvel objet + + + MEN_OFFSET + Décaler une surface + + + MEN_OPERATIONS + Opérations + + + MEN_ORIGIN_AND_VECTORS + Vecteurs de base et origine + + + MEN_PARTITION + Partition + + + MEN_PIPE + Extrusion suivant un chemin + + + MEN_PLANE + Plan + + + MEN_POINT + Point + + + MEN_POINT_COORDS + Coordonnées d'un point + + + MEN_POINT_ON_EDGE + Ajouter un point sur l'arête + + + MEN_POP_COLOR + Couleur + + + MEN_POP_CREATE_GROUP + Créer un groupe + + + MEN_POP_SHOW_CHILDREN + Montrer les enfants + + + MEN_POP_HIDE_CHILDREN + Cacher les enfants + + + MEN_POP_ISOS + Isos + + + MEN_POP_DEFLECTION + Coefficient de déformation + + + MEN_POP_RENAME + Renommer + + + MEN_POP_SHADING + Ombrage + + + MEN_POP_TRANSPARENCY + Transparence + + + MEN_POP_WIREFRAME + Filaire + + + MEN_POP_VECTORS + Montrer l'orientation de l'arête + + + MEN_PREFERENCES + Préférences + + + MEN_PREFERENCES_GEOM + Géométrie + + + MEN_PRIMITIVES + Primitives + + + MEN_ADVANCED + Avancé + + + MEN_PROPAGATE + Propager + + + MEN_Q_FACE + Face quadrangulaire + + + MEN_REPAIR + Réparer + + + MEN_REVOLUTION + Révolution + + + MEN_ROTATION + Rotation + + + MEN_SCALE + Redimensionner + + + MEN_SECTION + Section + + + MEN_SELECT_ONLY + Sélectionner uniquement + + + MEN_SEWING + Couture + + + MEN_SHADING + Ombrage + + + MEN_SHADING_COLOR + Couleur d'ombrage + + + MEN_SHAPE_PROCESS + Traitement de forme + + + MEN_SHELL + Coque + + + MEN_SHELL_SEL_ONLY + Coque + + + MEN_SKETCH + Esquisse 2D + + + MEN_3DSKETCH + Esquisse 3D + + + MEN_SOLID + Solide + + + MEN_SOLID_SEL_ONLY + Solide + + + MEN_SPHERE + Sphère + + + MEN_STEP_VALUE + Valeur du pas + + + MEN_SUPPERSS_HOLES + Supprimer les trous + + + MEN_SUPPRESS_FACES + Supprimer des faces + + + MEN_SUPPRESS_INT_WIRES + Supprimer des contours Internes + + + MEN_TOLERANCE + Tolérance + + + MEN_TOOLS + Outils + + + MEN_TORUS + Tore + + + MEN_TRANSFORMATION + Transformation + + + MEN_TRANSLATION + Translation + + + MEN_VECTOR + Vecteur + + + MEN_VERTEX_SEL_ONLY + Point + + + MEN_VIEW + Affichage + + + MEN_WHAT_IS + Qu'est-ce que c'est ? + + + MEN_WIRE + Contour + + + MEN_VECTOR_MODE_ON + Montrer l'orientation de l'arête + + + MEN_VECTOR_MODE_OFF + Cacher l'orientation de l'arête + + + MEN_WIREFRAME + Filaire + + + MEN_WIRE_SEL_ONLY + Contour + + + MEN_WORK_PLANE + Plan de travail + + + MEN_POP_POINT_MARKER + Marqueur de point + + + NAME_LBL + Nom : + + + NON_GEOM_OBJECTS_SELECTED + Il y a des objets n'appartenant pas au composant %1 dans la sélection + + + PREF_DEFLECTION + Coefficient de déformation + + + GEOM_PREF_def_precision + Précision par défaut + + + GEOM_PREF_length_precision + Précision de longueur + + + GEOM_PREF_angle_precision + Précision angulaire + + + GEOM_PREF_len_tol_precision + Tolérance de Précision de Longueur + + + GEOM_PREF_ang_tol_precision + Précision de la tolérance angulaire + + + GEOM_PREF_weight_precision + Précision de poids + + + GEOM_PREF_density_precision + Précision de densité + + + GEOM_PREF_parametric_precision + Précision paramétrique + + + GEOM_PREF_param_tol_precision + Tolérance de précision paramétrique + + + PREF_AUTO_CREATE + Créer automatiquement + + + PREF_DISPLAY_MODE + Mode de visualisation par défaut + + + PREF_FREE_BOUND_COLOR + Couleur des contours libres + + + PREF_GROUP_ORIGIN_AND_BASE_VECTORS + Vecteurs de base et origine + + + PREF_GROUP_GENERAL + Général + + + PREF_GROUP_OCCVIEWER + Visualiseur OCC 3d + + + GEOM_PREF_GROUP_PRECISION + Précision des champs d'entrée + + + PREF_GROUP_VERTEX + Marqueurs de points + + + PREF_ISOS_COLOR + Couleur des isolignes + + + PREF_LINE_COLOR + Couleur des arêtes, vecteurs, contours + + + PREF_MARKER_SCALE + Taille + + + PREF_POINT_COLOR + Couleur des points + + + PREF_SHADING_COLOR + Couleur d'ombrage par défaut + + + PREF_STEP_VALUE + Valeur du pas pour les boîtes d'incrément + + + PREF_TAB_SETTINGS + Préférences + + + PREF_TYPE_OF_MARKER + Type + + + PREF_BASE_VECTORS_LENGTH + Longueur des vecteurs de base + + + PREF_WIREFRAME_COLOR + Couleur des contours par défaut + + + PROCESS_SHAPE_NEW_OBJ_NAME + FormeRetraitée + + + REMOVE_HOLES_NEW_OBJ_NAME + SupprimerTrous + + + REMOVE_INT_WIRES_NEW_OBJ_NAME + SupprimerContoursInt + + + SEWING_NEW_OBJ_NAME + Couture + + + STB_ALL_SEL_ONLY + Choisir tous les objets + + + STB_ARC + Créer un arc + + + STB_ARCHIMEDE + Opération archimède + + + STB_BASIC_PROPS + Montrer les propriétés de base de l'objet + + + STB_BND_BOX + Calculer la boîte englobante de l'objet + + + STB_BOX + Créer une boîte + + + STB_CHAMFER + Créer un chanfrein + + + STB_CHANGE_ORIENTATION + Changer l'orientation + + + STB_CHECK + Contrôler une forme + + + STB_CHECK_COMPOUND + Contrôler un assemlage de blocs + + + STB_CHECK_FREE_BNDS + Vérifier les contours libres + + + STB_CHECK_FREE_FACES + Contrôler les faces libres + + + STB_CHECK_GEOMETRY + Contrôler la géométrie + + + STB_CIRCLE + Créer un cercle + + + STB_CLIPPING + Intervalle de découpe + + + STB_CLOSE_CONTOUR + Fermer le contour + + + STB_COMMON + Intersection + + + STB_COMPOUND + Construire un assemblage + + + STB_COMPOUND_SEL_ONLY + Ne choisir que des assemblages + + + STB_CONE + Créer un cône + + + STB_CURVE + Créer une courbe + + + STB_CUT + Découpe + + + STB_CYLINDER + Créer un cylindre + + + STB_RECTANGLE + Créer une face rectangulaire + + + STB_DELETE + Supprimer un objet + + + STB_DISK + Créer un disque + + + STB_DISPLAY + Afficher les objets + + + STB_DISPLAY_ALL + Afficher tout + + + STB_DISPLAY_ONLY + Afficher uniquement + + + STB_EDGE + Créer une arête + + + STB_EDGE_SEL_ONLY + Ne choisir que des arêtes + + + STB_ELLIPSE + Créer un ellipse + + + STB_ERASE + Cacher le(s) objet(s) + + + STB_ERASE_ALL + Cacher tout + + + STB_EXPLODE + Eclater + + + STB_EXPLODE_BLOCKS + Eclater en Blocs + + + STB_EXPORT + Exporter la géométrie au fichier BREP + + + STB_EXTRUSION + Créer une extrusion + + + STB_FACE + Construire une face + + + STB_FACE_SEL_ONLY + Ne choisir que des faces + + + STB_FILLET + Créer un congé 3D + + + STB_FILLET_1D + Créer un congé 1D + + + STB_FILLET_2D + Créer un congé 2D + + + STB_FILLING + Créer une nappe + + + STB_FUSE + Union + + + STB_GLUE_FACES + Recoller les faces + + + STB_GROUP_CREATE + Créer un groupe + + + STB_GROUP_EDIT + Editer un groupe + + + STB_RELOAD_IMPORTED + Recharger l'objet importé depuis le disque + + + STB_HEX_SOLID + Solide hexaédrique + + + STB_IMPORT + Importer une géométrie d'un fichier BREP + + + STB_INERTIA + Calculer les moments d'intertie de l'objet + + + STB_ISOS + Définir le nombre d'isolignes + + + STB_LINE + Créer une ligne + + + STB_LIMIT_TOLERANCE + Tolérance limite + + + STB_LOCAL_CS + Créer un système local de coordonnées + + + STB_MASS_CENTER + Calculer le centre de gravité de l'objet + + + STB_MIN_DIST + Calculer la distance minimale entre deux objets + + + STB_MIRROR + Refléter un objet + + + STB_MODIFY_LOCATION + Modifier la position d'un objet + + + STB_MUL_ROTATION + Effectuer une multi-rotation + + + STB_MUL_TRANSFORM + Effectuer une multi-transformation + + + STB_MUL_TRANSLATION + Effectuer une multi-translation + + + STB_OFFSET + Décaler une surface + + + STB_ORIGIN_AND_VECTORS + Créer les vecterurs de base et l'origine + + + STB_PARTITION + Effectuer une partition + + + STB_PIPE + Créer un objet par extrusion suivant un chemin + + + STB_PLANE + Créer un plan + + + STB_POINT + Créer un point + + + STB_POINT_COORDS + Montrer les coordonnées du point + + + STB_POINT_ON_EDGE + Ajouter un point sur l'arête + + + STB_POP_COLOR + Couleur + + + STB_POP_CREATE_GROUP + Créer un Groupe + + + STB_POP_SHOW_CHILDREN + Monter les objets fils + + + STB_POP_HIDE_CHILDREN + Cacher les objets fils + + + STB_POP_ISOS + Isolignes + + + STB_POP_DEFLECTION + Coefficient de déformation + + + STB_POP_RENAME + Renommer + + + STB_POP_SHADING + Ombrage + + + STB_POP_TRANSPARENCY + Transparence + + + STB_POP_WIREFRAME + Contours + + + STB_PROPAGATE + Propager + + + STB_Q_FACE + Face quadrangulaire + + + STB_REVOLUTION + Créer une révolution + + + STB_ROTATION + Tourner un objet + + + STB_SCALE + Redimensionner un objet + + + STB_SECTION + Section + + + STB_SEWING + Effectuer la couture + + + STB_SHADING + Ombrage + + + STB_VECTOR_MODE + Changer le mode de représentation des arêtes + + + STB_SHADING_COLOR + Définir la couleur d'ombrage + + + STB_SHAPE_PROCESS + Effectuer le traitement de formes + + + STB_SHELL + Construire une coque + + + STB_SHELL_SEL_ONLY + Ne choisir que des coques + + + STB_SKETCH + Créer une esquisse 2D + + + STB_3DSKETCH + Créer une esquisse 3D + + + STB_SOLID + Construire un solide + + + STB_SOLID_SEL_ONLY + Ne choisir que des solides + + + STB_SPHERE + Créer une sphère + + + STB_STEP_VALUE + Définir le valeur du pas + + + STB_SUPPERSS_HOLES + Effectuer la suppression des trous + + + STB_SUPPRESS_FACES + Effectuer la suppression des faces + + + STB_SUPPRESS_INT_WIRES + Effectuer la suppression des contours internes + + + STB_TOLERANCE + Calculer la tolérance d'un objet + + + STB_TORUS + Créer un tore + + + STB_TRANSLATION + Translater un objet + + + STB_VECTOR + Créer un vecteur + + + STB_VERTEX_SEL_ONLY + Ne choisir que des points + + + STB_WHAT_IS + Qu'est-ce que c'est ? + + + STB_WIRE + Construire un contour + + + STB_WIRE_SEL_ONLY + Ne choisir que des contours + + + STB_WORK_PLANE + Créer un plan de travail + + + STB_POP_POINT_MARKER + Définir un marqueur de point + + + SUPPRESS_RESULT + Supprimer le résultat + + + SUPRESS_FACE_NEW_OBJ_NAME + FacesSupprimees + + + ShHealOper_ErrorExecution_msg + L'algorithme de traitement de formes n'a pas abouti + + + ShHealOper_InvalidParameters_msg + Les paramètres de l'algorithme de traitement de formes sont incorrects + + + ShHealOper_NotError_msg + L'algorithme de traitement de formes n'a pas fait de modifications de la forme d'origine + + + TLT_RENAME + Renommer + + + TOM_O + O + + + TOM_O_PLUS + + en O + + + TOM_O_POINT + . en O + + + TOM_O_STAR + * en O + + + TOM_O_X + X en O + + + TOM_PLUS + + + + + TOM_POINT + . + + + TOM_STAR + * + + + TOM_X + X + + + TOOL_BASIC + Objets de base + + + TOOL_BOOLEAN + Opérations booléennes + + + TOOL_GENERATION + Génération + + + TOOL_PRIMITIVES + Primitives + + + TOOL_TRANSFORMATION + Transformation + + + TOOL_BUILD + Construire + + + TOOL_OPERATIONS + Opérations + + + TOOL_ADVANCED + Avancé + + + TOOL_MEASURES + Informations + + + TOP_ARC + Créer un arc + + + TOP_ARCHIMEDE + Archimède + + + TOP_BASIC_PROPS + Propriétés de base + + + TOP_BND_BOX + Boîte englobante + + + TOP_BOX + Créer une boîte + + + TOP_CHAMFER + Chanfrein + + + TOP_CHANGE_ORIENTATION + Changer l'orientation + + + TOP_CHECK + Valider l'objet + + + TOP_CHECK_COMPOUND + Valider l'assemblage de blocs + + + TOP_CHECK_FREE_BNDS + Valider les contours libres + + + TOP_CHECK_FREE_FACES + Contrôler les faces libres + + + TOP_CHECK_GEOMETRY + Contrôler la géométrie + + + TOP_CIRCLE + Créer un cercle + + + TOP_CLIPPING + Intervalle de découpe + + + TOP_CLOSE_CONTOUR + Fermer le contour + + + TOP_COMMON + Intersection + + + TOP_COMPOUND + Construire un assemblage + + + TOP_CONE + Créer un cône + + + TOP_CURVE + Créer une courbe + + + TOP_CUT + Découpe + + + TOP_CYLINDER + Créer un cylindre + + + TOP_DELETE + Supprimer l'objet + + + TOP_RECTANGLE + Créer une face rectangulaire + + + TOP_DISK + Créer un disque + + + TOP_DISPLAY + Afficher + + + TOP_DISPLAY_ALL + Afficher tout + + + TOP_DISPLAY_ONLY + Afficher uniquement + + + TOP_EDGE + Construire une arête + + + TOP_ELLIPSE + Créer un ellipse + + + TOP_ERASE + Cacher + + + TOP_ERASE_ALL + Cacher tout + + + TOP_EXPLODE + Eclater + + + TOP_EXPLODE_BLOCKS + Eclater en blocs + + + TOP_EXPORT + Exporter une géométrie au format BREP + + + TOP_EXTRUSION + Créer une extrusion + + + TOP_FACE + Construire une face + + + TOP_FILLET + Congé 3D + + + TOP_FILLET_1D + Congé 1D + + + TOP_FILLET_2D + Congé 2D + + + TOP_FILLING + Créer une nappe + + + TOP_FUSE + Union + + + TOP_GLUE_FACES + Recoller les faces + + + TOP_GROUP_CREATE + Créer un groupe + + + TOP_GROUP_EDIT + Editer un groupe + + + TOP_HEX_SOLID + Solide hexaédrique + + + TOP_IMPORT + Importer une géométrie d'un fichier BREP + + + TOP_INERTIA + Moments d'inertie + + + TOP_ISOS + Définir le nombre d'isolignes + + + TOP_LINE + Créer une ligne + + + TOP_LIMIT_TOLERANCE + Tolérance limite + + + TOP_LOCAL_CS + Créer un système local de coordonnées + + + TOP_MASS_CENTER + Centre de gravité + + + TOP_MIN_DIST + Distance minimale + + + TOP_MIRROR + Symétrie + + + TOP_MODIFY_LOCATION + Modifer la position + + + TOP_MUL_ROTATION + Multi-rotation + + + TOP_MUL_TRANSFORM + Multi-transformation + + + TOP_MUL_TRANSLATION + Multi-translation + + + TOP_OFFSET + Décaler une surface + + + TOP_ORIGIN_AND_VECTORS + Créer l'origine et les vecteurs de base + + + TOP_PARTITION + Partition + + + TOP_PIPE + Extrusion suivant un chemin + + + TOP_PLANE + Créer un plan + + + TOP_POINT + Créer un point + + + TOP_POINT_COORDS + Coordonnées d'un point + + + TOP_POINT_ON_EDGE + Ajouter un point sur l'arête + + + TOP_POP_COLOR + Couleur + + + TOP_POP_CREATE_GROUP + Créer un groupe + + + TOP_POP_SHOW_CHILDREN + Montrer les enfants + + + TOP_POP_HIDE_CHILDREN + Cacher les enfants + + + TOP_POP_ISOS + Isolignes + + + TOP_POP_DEFLECTION + Coefficient de déformation + + + TOP_POP_RENAME + Renommer + + + TOP_POP_SHADING + Ombrage + + + TOP_POP_TRANSPARENCY + Transparence + + + TOP_POP_WIREFRAME + Contours + + + TOP_PROPAGATE + Propager + + + TOP_Q_FACE + Face quadrangulaire + + + TOP_REVOLUTION + Créer une révolution + + + TOP_ROTATION + Rotation + + + TOP_SCALE + Redimensionner + + + TOP_SECTION + Section + + + TOP_SEWING + Effecture une couture + + + TOP_SHADING + Ombrage + + + TOP_SHADING_COLOR + Définir la couleur d'ombrage + + + TOP_SHAPE_PROCESS + Effectuer le traitement de forme + + + TOP_SHELL + Construire une coque + + + TOP_SKETCH + Esquisse 2D + + + TOP_3DSKETCH + Esquisse 3D + + + TOP_SOLID + Créer un solide + + + TOP_SPHERE + Créer une sphère + + + TOP_STEP_VALUE + Définir la valeur du pas + + + TOP_SUPPERSS_HOLES + Supprimer les trous + + + TOP_SUPPRESS_FACES + Supprimer les faces + + + TOP_SUPPRESS_INT_WIRES + Supprimer les contours internes + + + TOP_TOLERANCE + Tolérance + + + TOP_TORUS + Créer un tore + + + TOP_TRANSLATION + Translation + + + TOP_VECTOR + Créer un vecteur + + + TOP_WHAT_IS + Qu'est-ce que c'est ? + + + TOP_WIRE + Construire un contour + + + TOP_WORK_PLANE + Créer un plan de travail + + + TOP_POP_POINT_MARKER + Marqueur de point + + + WRN_NOT_IMPLEMENTED + Désolé, cette fonctionnalité n'est pas encore implémentée + + + _S_ + (s) + + + NOT_FOUND_ANY + Aucune entité n'a été trouvée + + + GEOM_FACE_I + Face %1 + + + GEOM_CONSTANT_RADIUS + Rayon : + + + GEOM_R1 + R1 : + + + GEOM_R2 + R2 : + + + GEOM_BOTHWAY + Dans les deux directions + + + GEOM_NORMALE + Normale à une face + + + GEOM_VECTOR_NORMALE + Vecteur_Normal + + + GEOM_LINE1 + Ligne 1 + + + GEOM_LINE2 + Ligne 2 + + + GEOM_D + D : + + + GEOM_CHAMFER_EDGE + Chanfrein sur les arêtes choisies + + + SELECTED_EDGE + Arêtes choisies + + + GEOM_NORMALE_TITLE + Créer un vecteur normal à une face + + + GEOM_MEASURE_ANGLE_TITLE + Angle entre deux arêtes/lignes/vecteurs droits + + + GEOM_MEASURE_ANGLE_ANGLE + Angle + + + GEOM_MEASURE_ANGLE_OBJ + Objets et résultats + + + GEOM_MEASURE_ANGLE_IS + Angle en degrés : + + + GEOM_LINE_INTERSECTION + Point à l'Intersection de deux lignes + + + GEOM_KEEP_NONLIMIT_SHAPES + Préserver les formes inférieures + + + GEOM_NO_SELF_INTERSECTION + Pas d'intersection des sous-formes (assemblages seuls) + + + GEOM_CENTER_2POINTS + Centre et deux points + + + GEOM_REMOVE_EXTRA_EDGES_TITLE + Supprimer les arêtes inutiles + + + GEOM_REMOVE_EXTRA_EDGES + Objet dont on suppime les arêtes inutiles + + + GEOM_RMEE_UNION_FACES + Union des faces, qui appartiennent à la même surface + + + REMOVE_EXTRA_EDGES_NEW_OBJ_NAME + PasdAretesSupplementaires + + + TOP_REMOVE_EXTRA_EDGES + Suppimer les arêtes inutiles + + + MEN_REMOVE_EXTRA_EDGES + Suppimer les arêtes inutiles + + + STB_REMOVE_EXTRA_EDGES + Suppimer les arêtes inutiles + + + TOP_NORMALE + Vecteur normal à une face + + + MEN_NORMALE + Vecteur normal à une face + + + STB_NORMALE + Vecteur normal à une face + + + TOP_MEASURE_ANGLE + Angle + + + MEN_MEASURE_ANGLE + Angle + + + STB_MEASURE_ANGLE + Calculer l'angle entre deux lignes ou arêtes linéaires + + + TOP_POP_AUTO_COLOR + Couleur Automatique + + + MEN_POP_AUTO_COLOR + Couleur Automatique + + + STB_POP_AUTO_COLOR + Couleur Automatique + + + TOP_POP_DISABLE_AUTO_COLOR + Désactiver le couleur automatique + + + MEN_POP_DISABLE_AUTO_COLOR + Désactiver le couleur automatique + + + STB_POP_DISABLE_AUTO_COLOR + Désactiver le couleur automatique + + + GEOM_RESULT_NAME_GRP + Nom du résultat + + + GEOM_RESULT_NAME_LBL + Nom + + + GEOM_FILLING_APPROX + Approximation + + + GEOM_FILLING_METHOD + Méthode + + + GEOM_FILLING_DEFAULT + Défaut (comportement standardisé) + + + GEOM_FILLING_USEORI + Utiliser l'orientation des arêtes + + + GEOM_FILLING_AUTO + Auto-corriger l'orientation des arêtes + + + GEOM_WRN_NO_APPROPRIATE_SELECTION + Pas d'objets appropriés choisis + + + GEOM_SHAPES_ON_SHAPE + Trouver les éléments d'un objet + + + GEOM_SHAPES_ON_SHAPE_ESHAPE + L'objet à éclater + + + GEOM_SHAPES_ON_SHAPE_CSHAPE + Le solide de contrôle + + + GEOM_SHAPES_ON_SHAPE_STATE + Etat + + + GEOM_KIND_OF_SHAPE + Type d'objet : + + + GEOM_CLOSED + Fermé + + + GEOM_UNCLOSED + Ouvert + + + GEOM_CLOSEDUNCLOSED + Il n'est pas défini, si l'objet est fermé ou ouvert. , il y a potentiellement une erreur. + + + GEOM_DISK_CIRCLE + Disque + + + GEOM_DISK_ELLIPSE + Face elliptique + + + GEOM_PLANAR_FACE + Face plane + + + GEOM_PLANAR_EDGE_WIRE + Contour avec des arêtes planes + + + GEOM_POLYGON + Polygone + + + GEOM_POLYHEDRON + Polyèdre + + + GEOM_NORMAL + Direction normale + + + GEOM_DIRECTION + Direction + + + GEOM_UPARAMETER + Paramètre-U : + + + GEOM_VPARAMETER + Paramètre-V : + + + GEOM_X_I + X%1 : + + + GEOM_Y_I + Y%1 : + + + GEOM_Z_I + Z%1 : + + + GEOM_SHAPES_ON_SHAPE_TITLE + Trouver les éléments d'un objet + + + GEOM_SCALE_FACTOR_X + Facteur de redimensionnnement suivant X : + + + GEOM_SCALE_FACTOR_Y + Facteur de redimensionnnement suivant Y : + + + GEOM_SCALE_FACTOR_Z + Facteur de redimensionnnement suivant Z : + + + GEOM_STATE_IN + IN + + + GEOM_STATE_OUT + OUT + + + GEOM_STATE_ON + ON + + + GEOM_STATE_ONIN + ONIN + + + GEOM_STATE_ONOUT + ONOUT + + + GEOM_STATE_INOUT + INOUT + + + TOP_GET_SHAPES_ON_SHAPES + Trouver les éléments d'un objet + + + MEN_GET_SHAPES_ON_SHAPES + Trouver les éléments d'un objet + + + STB_GET_SHAPES_ON_SHAPES + Trouver les éléments d'un objet + + + GEOM_PUBLISH_RESULT_GRP + Options avancées + + + GEOM_RESTORE_SUB_SHAPES + Importer les paramètres de la présentation et les sous-objets + + + GEOM_RSS_ADD_FREFIX + Ajouter un préfixe aux noms des sous-objets restaurés + + + GEOM_ALL_IMPORT_FILES + Tous les formats supportés ( %1 ) + + + GEOM_UNSUPPORTED_TYPE + Le format de ficher n'est pas supporté + + + GEOM_UNKNOWN_IMPORT_ERROR + Erreur inconnue + + + GEOM_IMPORT_ERRORS + L'import s'est fini avec des erreurs: + + + GEOM_PUBLISH_NAMED_SHAPES + Créer des groupes pour les objets indiqués (s'ils existent)? + + + GEOM_SCALE_DIMENSIONS + Voulez-vous prendre les unités en considération? +Sinon les dimensions seront préservées sans modifications. + + + GEOM_ADVANCED + Objet géométrique avancé : type %1 + + + GEOM_PRECISION_HINT + Il est possible d'ajuster la précision de la valeur d'entrée avec +le paramètre '%1' aux préférences du module Géométrie. + + + TOP_PIPETSHAPE + Créer un tuyau en T + + + MEN_PIPETSHAPE + Tuyau en T + + + STB_PIPETSHAPE + Créer un nouveau tuyau en T + + + GEOM_ADVANCED_201 + Tuyau en T + + + HALF_LENGTH_MAIN_PIPE + Demi-longueur du tuyau principal + + + HALF_LENGTH_INCIDENT_PIPE + Demi-longueur du tuyau incident + + + CIRCULAR_QUARTER_PIPE + Un quart circulaire du tuyau + + + THICKNESS + Epaisseur + + + FLANGE + Collerette + + + CHAMFER_OR_FILLET + Chanfrein ou congé + + + CHAMFER + Chanfrein + + + FILLET + Congé + + + JUNCTION_FACE_1 + Jonction 1 + + + JUNCTION_FACE_2 + Jonction 2 + + + JUNCTION_FACE_3 + Jonction 3 + + + GEOM_PLUGINS_OTHER + Autre + + + + BasicGUI_CurveDlg + + GEOM_IS_CLOSED + Construire une arête fermée + + + + BasicGUI_EllipseDlg + + GEOM_VECTOR_MAJOR + Grand Axe + + + ORIGIN_DEFAULT + Origine par défaut + + + X_AXIS_DEFAULT + Axe X par défaut + + + Z_AXIS_DEFAULT + Axe Z par défaut + + + + BasicGUI_MarkerDlg + + CAPTION + Construction d'un S.C. local + + + DX + Dx + + + DY + Dy + + + DZ + Dz + + + LCS_NAME + SCLocal + + + LOCALCS + Système de coordonnées local + + + ORIGIN + Coordonnées de l'origine + + + VEC_PARALLEL + Il n'est pas possible que les axes du système de coordonnées soient parallels + + + XDIR + Direction de l'axe X + + + YDIR + Direction de l'axe Y + + + + BlocksGUI_BlockDlg + + FACE_1 + Face 1 + + + FACE_2 + Face 2 + + + FACE_3 + Face 3 + + + FACE_4 + Face 4 + + + FACE_5 + Face 5 + + + FACE_6 + Face 6 + + + + BlocksGUI_ExplodeDlg + + NB_FACES_MAX + Nombre de faces maximal + + + NB_FACES_MIN + Nombre de faces maximal + + + + BlocksGUI_QuadFaceDlg + + EDGE_1 + Arête 1 + + + EDGE_2 + Arête 2 + + + EDGE_3 + Arête 3 + + + EDGE_4 + Arête 4 + + + VERTEX_1 + Sommet 1 + + + VERTEX_2 + Sommet 2 + + + VERTEX_3 + Sommet 3 + + + VERTEX_4 + Sommet 4 + + + + BlocksGUI_TrsfDlg + + FACE_1 + Face 1 + + + FACE_1U + Face 1 U + + + FACE_1V + Face 1 V + + + FACE_2 + Face 2 + + + FACE_2U + Face 2 U + + + FACE_2V + Face 2 V + + + + EntityGUI_SketcherDlg + + CANNOT_CLOSE + Il est impossible de fermer le contour +Le nombre de points n'est pas suffisant + + + + EntityGUI_SubShapeDlg + + NO_SUBSHAPES_SELECTED + Choisissez un ou plusieurs sous-objets + + + + GroupGUI + + NO_GROUP + Choisissez un groupe à éditer + + + + GroupGUI_GroupDlg + + ADD + Ajouter + + + CREATE_GROUP_TITLE + Créer un Groupe + + + EDIT_GROUP_TITLE + Editer un Groupe + + + EMPTY_LIST + Choisissez un ou plusieurs sous-objets à placer dans le groupe + + + EMPTY_NAME + Le nom de groupe est vide. Indiquez un nom valide + + + GROUP_NAME + Nom du Groupe + + + GROUP_PREFIX + Groupe + + + MAIN_SHAPE + Objet Principal + + + MAIN_SUB_SHAPES + Objet principal et objets secondaires + + + NO_GROUP + Choisissez un groupe à éditer + + + NO_MAIN_OBJ + Choisissez un objet principal + + + REMOVE + Supprimer + + + SHOW_ONLY_SELECTED + Afficher uniquement la sélection + + + HIDE_SELECTED + Cacher la sélection + + + SHOW_ALL_SUB_SHAPES + Afficher tous les sous-objets + + + SELECT_ALL + Tout sélectionner + + + SHAPE_SEL_RESTR + Restriction de la sélection + + + SHAPE_TYPE + Type d'objet + + + NO_RESTR + Pas de restriction + + + GEOM_PARTS_OF_SHAPE2 + Parties Géométriques de l'Objet Secondaire + + + SUBSHAPES_OF_SHAPE2 + Sous-Objets de l'Objet Secondaire Uniquement + + + SECOND_SHAPE + Objet secondaire + + + + MeasureGUI_1Sel1TextView1Check_QTD + + CHECK_SHAPE_GEOMETRY + Vérifier la géométrie + + + + MeasureGUI_PointDlg + + CAPTION + Coordonnées d'un Point + + + COORDINATES + Le Point et ses coordonnées + + + POINT + Point + + + X + X + + + Y + Y + + + Z + Z + + + + OperationGUI_ChamferDlg + + D + D + + + FACE_1 + Face 1 + + + FACE_2 + Face 2 + + + SELECTED_FACES + Faces sélectionnées + + + + OperationGUI_FilletDlg + + SELECTED_EDGES + Arêtes sélectionnées + + + SELECTED_FACES + Faces sélectionnées + + + + RepairGUI_FreeBoundDlg + + CAPTION + Vérifier les contours libres + + + FREE_BOUND + Contours Libres + + + NUMBER_CLOSED + Nombre de contours libres fermés + + + NUMBER_OPEN + Nombre de contours libres ouverts + + + + RepairGUI_GlueDlg + + FACES_FOR_GLUING_ARE_DETECTED + Il y a %1 face(s) à recoller surlignées en couleur rouge. +Fermez cette boîte d'alerte et choisissez les faces à recoller + + + GLUE_FACES + Recollement de faces + + + SELECT_FACES + Choisir les Faces + + + THERE_ARE_NO_FACES_FOR_GLUING + Il n'y a pas de faces à coller + + + + RepairGUI_ShapeProcessDlg + + ERROR_NO_OBJECTS + Choisissez un objet géométrique pour le traitement de forme. + + + ERROR_NO_OPERATORS + Choisissez au moins une opération de traitement de forme pour donner suite à l'opération + + + TIME_CONSUMING + L'activation de cette option peut résulter en une perte de temps sur certains objets. +Voulez-vous continuer? + + + + GEOMToolsGUI_DeleteDlg + + GEOM_REALLY_DELETE + Voulez-vous vraiment supprimer %1 objet(s)? + + + GEOM_REALLY_DELETE_ALL + Voulez-vous vraiment supprimer tous les objets? + + + GEOM_DELETE_OBJECTS + Supprimer les objets + + + + GEOMToolsGUI_DeflectionDlg + + GEOM_DEFLECTION_TLT + Choisir le degré de déformation d'un objet + + + GEOM_DEFLECTION + Déformation : + + + + GEOMToolsGUI_MarkerDlg + + SET_MARKER_TLT + Définir le Marqueur de Point + + + STANDARD_MARKER + Standard + + + CUSTOM_MARKER + Personnalisé + + + TYPE + Type: + + + SCALE + Echelle: + + + CUSTOM + Texture: + + + BROWSE + Naviguer... + + + OK_BTN + &OK + + + CANCEL_BTN + A&nnuler + + + HELP_BTN + &Aide + + + LOAD_TEXTURE_TLT + Ouvrir une Texture + + + + AdvancedGUI_PipeTShapeDlg + + GEOM_PIPE_TSHAPE_TITLE + Construction d'un Tuyau en T + + + GEOM_PIPE_TSHAPE + Tuyau en T + + + GEOM_PIPE_TSHAPE_MPIPE + Tuyau principal + + + GEOM_PIPE_TSHAPE_R + Rayon + + + GEOM_PIPE_TSHAPE_W + Largeur + + + GEOM_PIPE_TSHAPE_L + Demi-longueur + + + GEOM_PIPE_TSHAPE_IPIPE + Tuyau incident + + + GEOM_PIPE_TSHAPE_CHAMFER + Chanfrein + + + GEOM_PIPE_TSHAPE_CHAMFER_H + Hauteur + + + GEOM_PIPE_TSHAPE_CHAMFER_W + Largeur + + + GEOM_PIPE_TSHAPE_FILLET + Congé + + + GEOM_PIPE_TSHAPE_HEX + Préparer pour un maillage hexaédrique + + + GEOM_PIPE_TSHAPE_POSITION + Définir la position + + + GEOM_PIPE_TSHAPE_POSITION_P1 + Jonction P1 + + + GEOM_PIPE_TSHAPE_POSITION_P2 + Jonction P2 + + + GEOM_PIPE_TSHAPE_POSITION_P3 + Jonction P3 + + + GEOM_PIPE_TSHAPE_POSITION_LBL_L1 + Nouvelle L1 + + + GEOM_PIPE_TSHAPE_POSITION_LBL_L2 + Nouvelle L2 + + diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 29b739209..63fb01bf4 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -19,9 +19,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// GEOM GEOMGUI : GUI for Geometry component -// File : GeometryGUI.cxx -// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// GEOM GEOMGUI : GUI for Geometry component +// File : GeometryGUI.cxx +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) #include // E.A. must be included before Python.h to fix compilation on windows #include "Python.h" @@ -151,6 +151,17 @@ SALOMEDS::Study_var GeometryGUI::ClientStudyToStudy (_PTR(Study) theStudy) return aDSStudy._retn(); } +void GeometryGUI::Modified( bool theIsUpdateActions ) +{ + if( SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ) ) { + if( SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ) ) { + appStudy->Modified(); + if( theIsUpdateActions ) + app->updateActions(); + } + } +} + //======================================================================= // function : GeometryGUI::GeometryGUI() // purpose : Constructor @@ -359,6 +370,9 @@ void GeometryGUI::OnGUIEvent( int id ) QString libName; // find corresponding GUI library switch ( id ) { + case GEOMOp::OpOriginAndVectors: // MENU BASIC - ORIGIN AND BASE VECTORS + createOriginAndBaseVectors(); // internal operation + return; case GEOMOp::OpImport: // MENU FILE - IMPORT case GEOMOp::OpExport: // MENU FILE - EXPORT case GEOMOp::OpSelectVertex: // POPUP MENU - SELECT ONLY - VERTEX @@ -374,7 +388,11 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::OpDeflection: // POPUP MENU - DEFLECTION COEFFICIENT case GEOMOp::OpColor: // POPUP MENU - COLOR case GEOMOp::OpTransparency: // POPUP MENU - TRANSPARENCY + case GEOMOp::OpIncrTransparency: // SHORTCUT - INCREASE TRANSPARENCY + case GEOMOp::OpDecrTransparency: // SHORTCUT - DECREASE TRANSPARENCY case GEOMOp::OpIsos: // POPUP MENU - ISOS + case GEOMOp::OpIncrNbIsos: // SHORTCUT - INCREASE NB ISOS + case GEOMOp::OpDecrNbIsos: // SHORTCUT - DECREASE NB ISOS case GEOMOp::OpAutoColor: // POPUP MENU - AUTO COLOR case GEOMOp::OpNoAutoColor: // POPUP MENU - DISABLE AUTO COLOR case GEOMOp::OpShowChildren: // POPUP MENU - SHOW CHILDREN @@ -403,7 +421,7 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::OpVector: // MENU BASIC - VECTOR case GEOMOp::OpPlane: // MENU BASIC - PLANE case GEOMOp::OpCurve: // MENU BASIC - CURVE - case GEOMOp::OpLCS: // MENU BASIC - REPAIR + case GEOMOp::OpLCS: // MENU BASIC - LOCAL COORDINATE SYSTEM libName = "BasicGUI"; break; case GEOMOp::OpBox: // MENU PRIMITIVE - BOX @@ -473,6 +491,7 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::OpFreeFaces: // MENU MEASURE - FREE FACES case GEOMOp::OpOrientation: // MENU REPAIR - CHANGE ORIENTATION case GEOMOp::OpGlueFaces: // MENU REPAIR - GLUE FACES + case GEOMOp::OpLimitTolerance: // MENU REPAIR - LIMIT TOLERANCE case GEOMOp::OpRemoveExtraEdges: // MENU REPAIR - REMOVE EXTRA EDGES libName = "RepairGUI"; break; @@ -569,23 +588,54 @@ void GeometryGUI::OnMousePress( SUIT_ViewWindow* w, QMouseEvent* e ) // function : createGeomAction // purpose : //======================================================================= -void GeometryGUI::createGeomAction( const int id, const QString& label, const QString& icolabel, const int accel, const bool toggle ) +void GeometryGUI::createGeomAction( const int id, const QString& label, const QString& icolabel, + const int accel, const bool toggle, const QString& shortcutAction ) { SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); QPixmap icon = icolabel.isEmpty() ? resMgr->loadPixmap( "GEOM", tr( (QString( "ICO_" )+label).toLatin1().constData() ), false ) : resMgr->loadPixmap( "GEOM", tr( icolabel.toLatin1().constData() ) ); createAction( id, - tr( QString( "TOP_%1" ).arg( label ).toLatin1().constData() ), - icon, - tr( QString( "MEN_%1" ).arg( label ).toLatin1().constData() ), - tr( QString( "STB_%1" ).arg( label ).toLatin1().constData() ), - accel, - application()->desktop(), - toggle, - this, SLOT( OnGUIEvent() ) ); + tr( QString( "TOP_%1" ).arg( label ).toLatin1().constData() ), + icon, + tr( QString( "MEN_%1" ).arg( label ).toLatin1().constData() ), + tr( QString( "STB_%1" ).arg( label ).toLatin1().constData() ), + accel, + application()->desktop(), + toggle, + this, SLOT( OnGUIEvent() ), + shortcutAction ); } +//======================================================================= +// function : createOriginAndBaseVectors +// purpose : +//======================================================================= +void GeometryGUI::createOriginAndBaseVectors() +{ + SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); + if( appStudy ) { + _PTR(Study) studyDS = appStudy->studyDS(); + if( studyDS && !CORBA::is_nil( GetGeomGen() ) ) { + GEOM::GEOM_IBasicOperations_var aBasicOperations = GetGeomGen()->GetIBasicOperations( studyDS->StudyId() ); + if( !aBasicOperations->_is_nil() ) { + SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + double aLength = aResourceMgr->doubleValue( "Geometry", "base_vectors_length", 1.0 ); + GEOM::GEOM_Object_var anOrigin = aBasicOperations->MakePointXYZ( 0.0, 0.0, 0.0 ); + GEOM::GEOM_Object_var anOX = aBasicOperations->MakeVectorDXDYDZ( aLength, 0.0, 0.0 ); + GEOM::GEOM_Object_var anOY = aBasicOperations->MakeVectorDXDYDZ( 0.0, aLength, 0.0 ); + GEOM::GEOM_Object_var anOZ = aBasicOperations->MakeVectorDXDYDZ( 0.0, 0.0, aLength ); + SALOMEDS::Study_var aDSStudy = ClientStudyToStudy( studyDS ); + GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOrigin, "O" ); + GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOX, "OX" ); + GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOY, "OY" ); + GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOZ, "OZ" ); + + getApp()->updateObjectBrowser( false ); + } + } + } +} //======================================================================= // function : GeometryGUI::initialize() @@ -611,6 +661,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpVector, "VECTOR" ); createGeomAction( GEOMOp::OpPlane, "PLANE" ); createGeomAction( GEOMOp::OpLCS, "LOCAL_CS" ); + createGeomAction( GEOMOp::OpOriginAndVectors, "ORIGIN_AND_VECTORS" ); createGeomAction( GEOMOp::OpBox, "BOX" ); createGeomAction( GEOMOp::OpCylinder, "CYLINDER" ); @@ -674,6 +725,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpSewing, "SEWING" ); createGeomAction( GEOMOp::OpGlueFaces, "GLUE_FACES" ); + createGeomAction( GEOMOp::OpLimitTolerance, "LIMIT_TOLERANCE" ); createGeomAction( GEOMOp::OpSuppressFaces, "SUPPRESS_FACES" ); createGeomAction( GEOMOp::OpSuppressHoles, "SUPPERSS_HOLES" ); createGeomAction( GEOMOp::OpShapeProcess, "SHAPE_PROCESS" ); @@ -735,6 +787,19 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpPointMarker, "POP_POINT_MARKER" ); createGeomAction( GEOMOp::OpPipeTShape, "PIPETSHAPE" ); + + // Create actions for increase/decrease transparency shortcuts + createGeomAction( GEOMOp::OpIncrTransparency, "", "", 0, false, + "Geometry:Increase transparency"); + createGeomAction( GEOMOp::OpDecrTransparency, "", "", 0, false, + "Geometry:Decrease transparency"); + + // Create actions for increase/decrease number of isolines + createGeomAction( GEOMOp::OpIncrNbIsos, "", "", 0, false, + "Geometry:Increase number of isolines"); + createGeomAction( GEOMOp::OpDecrNbIsos, "", "", 0, false, + "Geometry:Decrease number of isolines"); + // createGeomAction( GEOMOp::OpPipeTShapeGroups, "PIPETSHAPEGROUPS" ); //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@// @@ -762,6 +827,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( GEOMOp::OpVector, basicId, -1 ); createMenu( GEOMOp::OpPlane, basicId, -1 ); createMenu( GEOMOp::OpLCS, basicId, -1 ); + createMenu( GEOMOp::OpOriginAndVectors, basicId, -1 ); int primId = createMenu( tr( "MEN_PRIMITIVES" ), newEntId, -1 ); createMenu( GEOMOp::OpBox, primId, -1 ); @@ -859,6 +925,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( GEOMOp::OpSuppressHoles, repairId, -1 ); createMenu( GEOMOp::OpSewing, repairId, -1 ); createMenu( GEOMOp::OpGlueFaces, repairId, -1 ); + createMenu( GEOMOp::OpLimitTolerance, repairId, -1 ); createMenu( GEOMOp::OpAddPointOnEdge, repairId, -1 ); //createMenu( GEOMOp::OpFreeBoundaries, repairId, -1 ); //createMenu( GEOMOp::OpFreeFaces, repairId, -1 ); @@ -930,6 +997,7 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( GEOMOp::OpVector, basicTbId ); createTool( GEOMOp::OpPlane, basicTbId ); createTool( GEOMOp::OpLCS, basicTbId ); + createTool( GEOMOp::OpOriginAndVectors, basicTbId ); int primTbId = createTool( tr( "TOOL_PRIMITIVES" ) ); createTool( GEOMOp::OpBox, primTbId ); @@ -1056,7 +1124,8 @@ void GeometryGUI::initialize( CAM_Application* app ) mgr->insert( action( GEOMOp::OpDeflection ), -1, -1 ); // deflection mgr->setRule( action( GEOMOp::OpDeflection ), "selcount>0 and isVisible and client='OCCViewer'", QtxPopupMgr::VisibleRule ); mgr->insert( action( GEOMOp::OpPointMarker ), -1, -1 ); // point marker - mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg( GEOM_POINT ), QtxPopupMgr::VisibleRule ); + //mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and $typeid in {%1}" ).arg(GEOM_POINT ), QtxPopupMgr::VisibleRule ); + mgr->setRule( action( GEOMOp::OpPointMarker ), QString( "selcount>0 and ( $typeid in {%1} or compoundOfVertices=true ) " ).arg(GEOM::VERTEX).arg(GEOM::COMPOUND), QtxPopupMgr::VisibleRule ); mgr->insert( separator(), -1, -1 ); // ----------- mgr->insert( action( GEOMOp::OpAutoColor ), -1, -1 ); // auto color mgr->setRule( action( GEOMOp::OpAutoColor ), autoColorPrefix + " and isAutoColor=false", QtxPopupMgr::VisibleRule ); @@ -1137,7 +1206,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) PyErr_Print(); else { - PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"geom","New Entity","Other"); + PyObject* result=PyObject_CallMethod( pluginsmanager, (char*)"initialize", (char*)"isss",1,"geom",tr("MEN_NEW_ENTITY").toStdString().c_str(),tr("GEOM_PLUGINS_OTHER").toStdString().c_str()); if(result==NULL) PyErr_Print(); Py_XDECREF(result); @@ -1198,6 +1267,20 @@ bool GeometryGUI::activateModule( SUIT_Study* study ) if ( viewMenu ) connect( viewMenu, SIGNAL( aboutToShow() ), this, SLOT( onViewAboutToShow() ) ); + // 0020836 (Basic vectors and origin) + SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + if( aResourceMgr->booleanValue( "Geometry", "auto_create_base_objects", false ) ) { + SalomeApp_Study* appStudy = dynamic_cast( application()->activeStudy() ); + if( appStudy ) { + _PTR(Study) studyDS = appStudy->studyDS(); + if( studyDS ) { + _PTR(SComponent) aSComponent = studyDS->FindComponent("GEOM"); + if( !aSComponent ) // create objects automatically only if there is no GEOM component + createOriginAndBaseVectors(); + } + } + } + return true; } @@ -1460,21 +1543,21 @@ void GeometryGUI::createPreferences() const int nbQuantities = 8; int prec[nbQuantities], ii = 0; prec[ii++] = addPreference( tr( "GEOM_PREF_length_precision" ), precGroup, - LightApp_Preferences::IntSpin, "Geometry", "length_precision" ); + LightApp_Preferences::IntSpin, "Geometry", "length_precision" ); prec[ii++] = addPreference( tr( "GEOM_PREF_angle_precision" ), precGroup, - LightApp_Preferences::IntSpin, "Geometry", "angle_precision" ); + LightApp_Preferences::IntSpin, "Geometry", "angle_precision" ); prec[ii++] = addPreference( tr( "GEOM_PREF_len_tol_precision" ), precGroup, - LightApp_Preferences::IntSpin, "Geometry", "len_tol_precision" ); + LightApp_Preferences::IntSpin, "Geometry", "len_tol_precision" ); prec[ii++] = addPreference( tr( "GEOM_PREF_ang_tol_precision" ), precGroup, - LightApp_Preferences::IntSpin, "Geometry", "ang_tol_precision" ); + LightApp_Preferences::IntSpin, "Geometry", "ang_tol_precision" ); prec[ii++] = addPreference( tr( "GEOM_PREF_weight_precision" ), precGroup, - LightApp_Preferences::IntSpin, "Geometry", "weight_precision" ); + LightApp_Preferences::IntSpin, "Geometry", "weight_precision" ); prec[ii++] = addPreference( tr( "GEOM_PREF_density_precision" ), precGroup, - LightApp_Preferences::IntSpin, "Geometry", "density_precision" ); + LightApp_Preferences::IntSpin, "Geometry", "density_precision" ); prec[ii++] = addPreference( tr( "GEOM_PREF_parametric_precision" ), precGroup, - LightApp_Preferences::IntSpin, "Geometry", "parametric_precision" ); + LightApp_Preferences::IntSpin, "Geometry", "parametric_precision" ); prec[ii ] = addPreference( tr( "GEOM_PREF_param_tol_precision" ), precGroup, - LightApp_Preferences::IntSpin, "Geometry", "param_tol_precision" ); + LightApp_Preferences::IntSpin, "Geometry", "param_tol_precision" ); // Set property for precision value for spinboxes for ( ii = 0; ii < nbQuantities; ii++ ){ @@ -1541,6 +1624,18 @@ void GeometryGUI::createPreferences() setPreferenceProperty( markerScale, "strings", aMarkerScaleValuesList ); setPreferenceProperty( markerScale, "indexes", aMarkerScaleIndicesList ); + + int originGroup = addPreference( tr( "PREF_GROUP_ORIGIN_AND_BASE_VECTORS" ), tabId ); + setPreferenceProperty( originGroup, "columns", 2 ); + + int baseVectorsLength = addPreference( tr( "PREF_BASE_VECTORS_LENGTH" ), originGroup, + LightApp_Preferences::DblSpin, "Geometry", "base_vectors_length" ); + setPreferenceProperty( baseVectorsLength, "min", 0.01 ); + setPreferenceProperty( baseVectorsLength, "max", 1000 ); + + addPreference( tr( "PREF_AUTO_CREATE" ), originGroup, + LightApp_Preferences::Bool, "Geometry", "auto_create_base_objects" ); + } void GeometryGUI::preferencesChanged( const QString& section, const QString& param ) diff --git a/src/GEOMGUI/GeometryGUI.h b/src/GEOMGUI/GeometryGUI.h index 87e0086b6..4e4dd3921 100644 --- a/src/GEOMGUI/GeometryGUI.h +++ b/src/GEOMGUI/GeometryGUI.h @@ -87,6 +87,8 @@ public: static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject); static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy); + static void Modified( bool = true ); + GEOM_Client& GetShapeReader() { return myShapeReader; } // Get active dialog box @@ -147,12 +149,15 @@ private: GEOMGUI* getLibrary( const QString& libraryName ); void createGeomAction( const int id, const QString& po_id, const QString& icon_id = QString(""), - const int key = 0, const bool toggle = false ); + const int key = 0, const bool toggle = false, + const QString& shortcutAction = QString() ); void createPopupItem( const int, const QString& clients, const QString& types, const bool isSingle = false, const int isVisible = -1, const bool isExpandAll = false, const bool isOCC = false, const int parentId = -1 ); + void createOriginAndBaseVectors(); + public: static GEOM::GEOM_Gen_var myComponentGeom; // GEOM engine!!! diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index 9c10e1f40..ce4f9edbd 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -40,10 +40,14 @@ namespace GEOMOp { OpDeflection = 1200, // POPUP MENU - DEFLECTION COEFFICIENT OpColor = 1201, // POPUP MENU - COLOR OpTransparency = 1202, // POPUP MENU - TRANSPARENCY - OpIsos = 1203, // POPUP MENU - ISOS - OpAutoColor = 1204, // POPUP MENU - AUTO COLOR - OpNoAutoColor = 1205, // POPUP MENU - DISABLE AUTO COLOR - OpPointMarker = 1206, // POPUP MENU - POINT MARKER + OpIncrTransparency = 1203, // SHORTCUT - INCREASE TRANSPARENCY + OpDecrTransparency = 1204, // SHORTCUT - DECREASE TRANSPARENCY + OpIsos = 1205, // POPUP MENU - ISOS + OpIncrNbIsos = 1206, // SHORTCUT - INCREASE NB ISOS + OpDecrNbIsos = 1207, // SHORTCUT - DECREASE NB ISOS + OpAutoColor = 1208, // POPUP MENU - AUTO COLOR + OpNoAutoColor = 1209, // POPUP MENU - DISABLE AUTO COLOR + OpPointMarker = 1210, // POPUP MENU - POINT MARKER OpShowChildren = 1250, // POPUP MENU - SHOW CHILDREN OpHideChildren = 1251, // POPUP MENU - HIDE CHILDREN OpRename = 1252, // POPUP MENU - RENAME @@ -68,6 +72,7 @@ namespace GEOMOp { OpPlane = 3006, // MENU NEW ENTITY - BASIC - PLANE OpCurve = 3007, // MENU NEW ENTITY - BASIC - CURVE OpLCS = 3008, // MENU NEW ENTITY - BASIC - LOCAL COORDINATE SYSTEM + OpOriginAndVectors = 3009, // MENU NEW ENTITY - BASIC - ORIGIN AND BASE VECTORS // PrimitiveGUI --------------//-------------------------------- OpBox = 3100, // MENU NEW ENTITY - PRIMITIVES - BOX OpCylinder = 3101, // MENU NEW ENTITY - PRIMITIVES - CYLINDER @@ -130,6 +135,7 @@ namespace GEOMOp { OpOrientation = 4009, // MENU REPAIR - CHANGE ORIENTATION OpGlueFaces = 4010, // MENU REPAIR - GLUE FACES OpRemoveExtraEdges = 4011, // MENU REPAIR - REMOVE EXTRA EDGES + OpLimitTolerance = 4012, // MENU REPAIR - LIMIT TOLERANCE // MeasureGUI ----------------//-------------------------------- OpProperties = 5000, // MENU MEASURES - PROPERTIES OpCenterMass = 5001, // MENU MEASURES - CENTRE OF MASS @@ -159,6 +165,6 @@ namespace GEOMOp { // OpPipeTShapeGroups = 10002, // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE GROUPS //@@ insert new functions before this line @@ do not remove this line @@// }; -} +} #endif // GEOMETRYGUI_OPERATIONS_H diff --git a/src/GEOMImpl/GEOMImpl_3DSketcherDriver.cxx b/src/GEOMImpl/GEOMImpl_3DSketcherDriver.cxx index f33fa29b9..6f0adcf50 100755 --- a/src/GEOMImpl/GEOMImpl_3DSketcherDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_3DSketcherDriver.cxx @@ -69,24 +69,31 @@ Standard_Integer GEOMImpl_3DSketcherDriver::Execute(TFunction_Logbook& log) cons TopoDS_Shape aShape; Handle(TColStd_HArray1OfReal) aCoordsArray = aCI.GetCoordinates(); - - BRepBuilderAPI_MakePolygon aMakePoly; int anArrayLength = aCoordsArray->Length(); - double x, y, z; - gp_Pnt aPnt; - for (int i = 0; i <=(anArrayLength - 3); i+=3) { - x = aCoordsArray->Value(i+1); - y = aCoordsArray->Value(i+2); - z = aCoordsArray->Value(i+3); - aPnt = gp_Pnt(x, y, z); - aMakePoly.Add(aPnt); + + std::list points; + + for (int i = 0; i <= (anArrayLength-3); i += 3) { + gp_Pnt aPnt = gp_Pnt(aCoordsArray->Value(i+1), aCoordsArray->Value(i+2), aCoordsArray->Value(i+3)); + if (points.empty() || aPnt.Distance(points.back()) > gp::Resolution()) + points.push_back(aPnt); } - if ( anArrayLength == 3) { // Only Start Point - BRepBuilderAPI_MakeVertex mkVertex (aPnt); + + if ( points.size() == 1) { // Only Start Point + BRepBuilderAPI_MakeVertex mkVertex (points.back()); aShape = mkVertex.Shape(); } - else { // Make Wire - if (aCoordsArray->Value(1) == x && aCoordsArray->Value(2) == y && aCoordsArray->Value(3) == z) + else if ( points.size() > 1) { // Make Wire + BRepBuilderAPI_MakePolygon aMakePoly; + std::list::iterator it; + for (it = points.begin(); it != points.end(); ++it) { + aMakePoly.Add(*it); + } + + if (points.size() > 2 && + points.back().X() == points.front().X() && + points.back().Y() == points.front().Y() && + points.back().Z() == points.front().Z()) aMakePoly.Close(); if (aMakePoly.IsDone()) diff --git a/src/GEOMImpl/GEOMImpl_Fillet1d.cxx b/src/GEOMImpl/GEOMImpl_Fillet1d.cxx index 6c0a67f7f..24123d0b7 100644 --- a/src/GEOMImpl/GEOMImpl_Fillet1d.cxx +++ b/src/GEOMImpl/GEOMImpl_Fillet1d.cxx @@ -1,763 +1,775 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 : GEOMImpl_Fillet1d.cxx -// Module : GEOMImpl -// -#include "GEOMImpl_Fillet1d.hxx" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * class GEOMImpl_Fillet1d - */ - - -//======================================================================= -//function : Constructor -//purpose : -//======================================================================= -GEOMImpl_Fillet1d::GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1, - const TopoDS_Edge& theEdge2, - const gp_Pln& thePlane) -: myEdgesExchnged( Standard_False ) -{ - myPlane = new Geom_Plane(thePlane); - - BRepAdaptor_Curve aBAC1(theEdge1); - BRepAdaptor_Curve aBAC2(theEdge2); - if (aBAC1.GetType() < aBAC2.GetType()) - { // first curve must be more complicated - myEdge1 = theEdge2; - myEdge2 = theEdge1; - myEdgesExchnged = Standard_True; - } - else - { - myEdge1 = theEdge1; - myEdge2 = theEdge2; - } - - Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(myEdge1, myStart1, myEnd1); - Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(myEdge2, myStart2, myEnd2); - - myCurve1 = GeomProjLib::Curve2d(aCurve1, myStart1, myEnd1, myPlane); - myCurve2 = GeomProjLib::Curve2d(aCurve2, myStart2, myEnd2, myPlane); - - while (myCurve1->IsPeriodic() && myStart1 >= myEnd1) - myEnd1 += myCurve1->Period(); - while (myCurve2->IsPeriodic() && myStart2 >= myEnd2) - myEnd2 += myCurve2->Period(); - - if (aBAC1.GetType() == aBAC2.GetType()) - { - if (myEnd2 - myStart2 < myEnd1 - myStart1) - { // first curve must be parametrically shorter - TopoDS_Edge anEdge = myEdge1; - myEdge1 = myEdge2; - myEdge2 = anEdge; - Handle(Geom2d_Curve) aCurve = myCurve1; - myCurve1 = myCurve2; - myCurve2 = aCurve; - Standard_Real a = myStart1; - myStart1 = myStart2; - myStart2 = a; - a = myEnd1; - myEnd1 = myEnd2; - myEnd2 = a; - myEdgesExchnged = Standard_True; - } - } -} - -//======================================================================= -//function : isRadiusIntersected -//purpose : local function -//======================================================================= -static Standard_Boolean isRadiusIntersected(const Handle(Geom2d_Curve)& theCurve, - const gp_Pnt2d theStart, - const gp_Pnt2d theEnd, - const Standard_Boolean theStartConnected) -{ - const Standard_Real aTol = Precision::Confusion(); - const Standard_Real anAngTol = Precision::Angular(); - Geom2dAPI_InterCurveCurve anInter(theCurve, new Geom2d_Line(theStart, - gp_Dir2d(gp_Vec2d(theStart, theEnd))), aTol); - Standard_Integer a; - gp_Pnt2d aPoint; - for(a = anInter.NbPoints(); a > 0; a--) - { - aPoint = anInter.Point(a); - if ( aPoint.Distance(theStart) < aTol && !theStartConnected ) - return Standard_True; - if (aPoint.Distance(theEnd) < aTol * 200) - return Standard_True; - if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) - return Standard_True; - } - Handle(Geom2d_Curve) aCurve; - for(a = anInter.NbSegments(); a > 0; a--) - { - anInter.Segment(a, aCurve); - aPoint = aCurve->Value(aCurve->FirstParameter()); - if (aPoint.Distance(theStart) < aTol) - if (!theStartConnected) - return Standard_True; - if (aPoint.Distance(theEnd) < aTol) - return Standard_True; - if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) - return Standard_True; - aPoint = aCurve->Value(aCurve->LastParameter()); - if (aPoint.Distance(theStart) < aTol) - if (!theStartConnected) - return Standard_True; - if (aPoint.Distance(theEnd) < aTol) - return Standard_True; - if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) - return Standard_True; - } - return Standard_False; -} - - -//======================================================================= -//function : fillPoint -//purpose : -//======================================================================= -void GEOMImpl_Fillet1d::fillPoint(GEOMImpl_Fillet1dPoint* thePoint) -{ - gp_Pnt2d aPoint; - gp_Vec2d aVec; - const Standard_Real aTol = Precision::Confusion(); - myCurve1->D1(thePoint->GetParam(), aPoint, aVec); - if (aVec.SquareMagnitude() < aTol) - return; - - gp_Vec2d aPerp(((myStartSide)?-1:1) * aVec.Y(), ((myStartSide)?1:-1) * aVec.X()); - aPerp.Normalize(); - aPerp.Multiply(myRadius); - gp_Pnt2d aCenter = aPoint.Translated(aPerp); - thePoint->SetCenter(aCenter); - - // on the intersection point - Standard_Boolean aValid = Standard_True; - Geom2dAPI_ProjectPointOnCurve aProjInt(aPoint, myCurve2); - if (aProjInt.NbPoints() && aPoint.Distance(aProjInt.NearestPoint()) < aTol) - aValid = Standard_False; - else - aValid = !isRadiusIntersected(myCurve2, aPoint, aCenter, Standard_True); - - Geom2dAPI_ProjectPointOnCurve aProj(aCenter, myCurve2); - Standard_Integer a, aNB = aProj.NbPoints(); - for(a = aNB; a > 0; a--) - { - if (aPoint.Distance(aProj.Point(a)) < aTol) - continue; - - Standard_Boolean aValid2 = aValid; - if (aValid2) - aValid2 = !isRadiusIntersected(myCurve1, aCenter, aProj.Point(a), Standard_False); - - // checking the right parameter - Standard_Real aParam = aProj.Parameter(a); - while(myCurve2->IsPeriodic() && aParam < myStart2) - aParam += myCurve2->Period(); - - thePoint->AddValue(aProj.Distance(a) * aProj.Distance(a) - myRadius * myRadius, - (aParam >= myStart2 && aParam <= myEnd2 && aValid2)); - if (fabs(fabs(aProj.Distance(a)) - myRadius) < aTol) - thePoint->SetParam2(aParam); - } -} - -//======================================================================= -//function : fillDiff -//purpose : -//======================================================================= -void GEOMImpl_Fillet1d::fillDiff(GEOMImpl_Fillet1dPoint* thePoint, Standard_Real theDiffStep, Standard_Boolean theFront) -{ - GEOMImpl_Fillet1dPoint* aDiff = - new GEOMImpl_Fillet1dPoint(thePoint->GetParam() + (theFront?(theDiffStep):(-theDiffStep))); - fillPoint(aDiff); - if (!thePoint->ComputeDifference(aDiff)) - { - aDiff->SetParam(thePoint->GetParam() + (theFront?(-theDiffStep):(theDiffStep))); - fillPoint(aDiff); - thePoint->ComputeDifference(aDiff); - } - delete aDiff; -} - -//======================================================================= -//function : Perform -//purpose : -//======================================================================= -Standard_Boolean GEOMImpl_Fillet1d::Perform(const Standard_Real theRadius) -{ - myResultParams.Clear(); - myResultOrientation.Clear(); - - Standard_Real aNBSteps = 100; - Geom2dAdaptor_Curve aGAC(myCurve1); - switch (aGAC.GetType()) - { - case GeomAbs_Line: - aNBSteps = 2; - break; - case GeomAbs_Circle: - aNBSteps = 4; - break; - case GeomAbs_Ellipse: - aNBSteps = 5; - break; - case GeomAbs_BezierCurve: - case GeomAbs_BSplineCurve: - aNBSteps = 2 + aGAC.Degree() * aGAC.NbPoles(); - break; - default: // unknown: maximum - aNBSteps = 100; - } - - myRadius = theRadius; - Standard_Real aParam, aStep, aDStep; - aStep = (myEnd1 - myStart1) / aNBSteps; - aDStep = aStep/1000.; - - Standard_Integer aCycle; - for(aCycle = 2, myStartSide = Standard_False; aCycle; myStartSide = !myStartSide, aCycle--) - { - GEOMImpl_Fillet1dPoint *aLeft = NULL, *aRight = NULL; - - for(aParam = myStart1 + aStep; aParam < myEnd1 || fabs(myEnd1 - aParam) < Precision::Confusion(); aParam += aStep) - { - if (!aLeft) - { - aLeft = new GEOMImpl_Fillet1dPoint(aParam - aStep); - fillPoint(aLeft); - fillDiff(aLeft, aDStep, Standard_True); - } - - aRight = new GEOMImpl_Fillet1dPoint(aParam); - fillPoint(aRight); - fillDiff(aRight, aDStep, Standard_False); - - aLeft->FilterPoints(aRight); - performNewton(aLeft, aRight); - - delete aLeft; - aLeft = aRight; - } - delete aLeft; - } - - if (myResultParams.Extent()) - return Standard_True; - - return Standard_False; -} - -//======================================================================= -//function : processPoint -//purpose : -//======================================================================= -Standard_Boolean GEOMImpl_Fillet1d::processPoint(GEOMImpl_Fillet1dPoint* theLeft, - GEOMImpl_Fillet1dPoint* theRight, - Standard_Real theParameter) -{ - if (theParameter >= theLeft->GetParam() && theParameter < theRight->GetParam()) - { - Standard_Real aDX = theRight->GetParam() - theLeft->GetParam(); - if (theParameter - theLeft->GetParam() < aDX / 100.) - { - theParameter = theLeft->GetParam() + aDX / 100.; - } - if (theRight->GetParam() - theParameter < aDX / 100.) - { - theParameter = theRight->GetParam() - aDX / 100.; - } - - GEOMImpl_Fillet1dPoint* aPoint1 = theLeft->Copy(); - GEOMImpl_Fillet1dPoint* aPoint2 = new GEOMImpl_Fillet1dPoint(theParameter); - fillPoint(aPoint2); - fillDiff(aPoint2, aDX / 1000., Standard_True); - - aPoint1->FilterPoints(aPoint2); - performNewton(aPoint1, aPoint2); - aPoint2->FilterPoints(theRight); - performNewton(aPoint2, theRight); - - delete aPoint1; - delete aPoint2; - return Standard_True; - } - - return Standard_False; -} - -//======================================================================= -//function : performNewton -//purpose : -//======================================================================= -void GEOMImpl_Fillet1d::performNewton(GEOMImpl_Fillet1dPoint* theLeft, - GEOMImpl_Fillet1dPoint* theRight) -{ - Standard_Integer a; - // check the left: if this is solution store it and remove it from the list of researching points of theLeft - a = theLeft->HasSolution(myRadius); - if (a) - { - if (theLeft->IsValid(a)) - { - myResultParams.Append(theLeft->GetParam()); - myResultOrientation.Append(myStartSide); - } - return; - } - - Standard_Real aDX = theRight->GetParam() - theLeft->GetParam(); - if ( aDX < Precision::Confusion() / 1000000.) - { - a = theRight->HasSolution(myRadius); - if (a) - if (theRight->IsValid(a)) - { - myResultParams.Append(theRight->GetParam()); - myResultOrientation.Append(myStartSide); - } - return; - } - - for(a = 1; a <= theLeft->GetNBValues(); a++) - { - Standard_Integer aNear = theLeft->GetNear(a); - - Standard_Real aA = (theRight->GetDiff(aNear) - theLeft->GetDiff(a)) / aDX; - Standard_Real aB = theLeft->GetDiff(a) - aA * theLeft->GetParam(); - Standard_Real aC = theLeft->GetValue(a) - theLeft->GetDiff(a) * theLeft->GetParam() + - aA * theLeft->GetParam() * theLeft->GetParam() / 2.0; - Standard_Real aDet = aB * aB - 2.0 * aA * aC; - - if ( fabs(aDet) < gp::Resolution() ) - continue; - - if (fabs(aA) < Precision::Confusion()) - { // linear case - if (fabs(aB) > 10e-20) - { - Standard_Real aX0 = - aC / aB; // use extremum - if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam()) - processPoint(theLeft, theRight, aX0); - } - else - { - processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise - } - } - else - { - if (fabs(aB) > fabs(aDet * 1000000.)) - { // possible floating point operations accurancy errors - processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise - } - else - { - if (aDet > 0) - { // two solutions - aDet = sqrt(aDet); - Standard_Boolean aRes = processPoint(theLeft, theRight, (- aB + aDet) / aA); - if (!aRes) - aRes = processPoint(theLeft, theRight, (- aB - aDet) / aA); - if (!aRes) - processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise - } - else - { - Standard_Real aX0 = - aB / aA; // use extremum - if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam()) - processPoint(theLeft, theRight, aX0); - else - processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise - } - } - } - } -} - -//======================================================================= -//function : Result -//purpose : -//======================================================================= -TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, - TopoDS_Edge& theEdge1, - TopoDS_Edge& theEdge2) -{ - TopoDS_Edge aResult; - gp_Pnt2d aTargetPoint2d; - Standard_Real aX, aY; - ElSLib::PlaneParameters(myPlane->Pln().Position(), thePoint, aX, aY); - aTargetPoint2d.SetCoord(aX, aY); - - // choose the nearest circle - Standard_Real aDistance, aP; - GEOMImpl_Fillet1dPoint *aNearest; - Standard_Integer a; - TColStd_ListIteratorOfListOfReal anIter(myResultParams); - for(aNearest = NULL, a = 1; anIter.More(); anIter.Next(), a++) - { - myStartSide = (myResultOrientation.Value(a)) ? Standard_True : Standard_False; - GEOMImpl_Fillet1dPoint *aPoint = new GEOMImpl_Fillet1dPoint(anIter.Value()); - fillPoint(aPoint); - if (!aPoint->HasSolution(myRadius)) - continue; - aP = fabs(aPoint->GetCenter().Distance(aTargetPoint2d) - myRadius); - if (!aNearest || aP < aDistance) - { - aNearest = aPoint; - aDistance = aP; - } - else - { - delete aPoint; - } - } - - if (!aNearest) - return aResult; - - // create circle edge - gp_Pnt aCenter = ElSLib::PlaneValue(aNearest->GetCenter().X(), - aNearest->GetCenter().Y(), - myPlane->Pln().Position()); - Handle(Geom_Circle) aCircle = - new Geom_Circle(gp_Ax2(aCenter, myPlane->Pln().Axis().Direction()), myRadius); - gp_Pnt2d aPoint2d1, aPoint2d2; - myCurve1->D0(aNearest->GetParam(), aPoint2d1); - myCurve2->D0(aNearest->GetParam2(), aPoint2d2); - gp_Pnt aPoint1 = ElSLib::PlaneValue(aPoint2d1.X(), aPoint2d1.Y(), myPlane->Pln().Position()); - gp_Pnt aPoint2 = ElSLib::PlaneValue(aPoint2d2.X(), aPoint2d2.Y(), myPlane->Pln().Position()); - - GeomAPI_ProjectPointOnCurve aProj(thePoint, aCircle); - Standard_Real aTarGetParam = aProj.LowerDistanceParameter(); - gp_Pnt aPointOnCircle = aProj.NearestPoint(); - - // Check extrema point manually, because there is a bug in Open CASCADE - // in calculation of nearest point to a circle near the parameter 0.0 - gp_Pnt p0 = ElCLib::Value(0.0, aCircle->Circ()); - if (p0.Distance(thePoint) < aPointOnCircle.Distance(thePoint)) - { - aTarGetParam = 0.0; - aPointOnCircle = p0; - } - - aProj.Perform(aPoint1); - Standard_Real aParam1 = aProj.LowerDistanceParameter(); - aProj.Perform(aPoint2); - Standard_Real aParam2 = aProj.LowerDistanceParameter(); - Standard_Boolean aIsOut = ((aParam1 < aTarGetParam && aParam2 < aTarGetParam) || - (aParam1 > aTarGetParam && aParam2 > aTarGetParam)); - if (aParam1 > aParam2) - aIsOut = !aIsOut; - BRepBuilderAPI_MakeEdge aBuilder(aCircle->Circ(), - aIsOut ? aParam2 : aParam1, - aIsOut? aParam1 : aParam2); - aResult = aBuilder.Edge(); - - // divide edges - Standard_Real aStart, anEnd; - Handle(Geom_Curve) aCurve = BRep_Tool::Curve(myEdge1, aStart, anEnd); - gp_Vec aDir; - aCurve->D1(aNearest->GetParam(), aPoint1, aDir); - - gp_Vec aCircleDir; - aCircle->D1(aParam1, aPoint1, aCircleDir); - if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ aIsOut) - aStart = aNearest->GetParam(); - else - anEnd = aNearest->GetParam(); - - //Check the case when start and end are identical. This happens - //when the edge decreases to size 0. Old ww5 allows such - //cases. So we are again bug compatible - if (fabs(aStart - anEnd) < Precision::PConfusion()/*gp::Resolution()*/) - anEnd = 0.01; - //Divide edge - BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd); - if (myEdgesExchnged) - theEdge2 = aDivider1.Edge(); - else - theEdge1 = aDivider1.Edge(); - - - aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd); - aCurve->D1(aNearest->GetParam2(), aPoint2, aDir); - - aCircle->D1(aParam2, aPoint2, aCircleDir); - if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ (!aIsOut)) - aStart = aNearest->GetParam2(); - else - anEnd = aNearest->GetParam2(); - - //Check the case when start and end are identical. This happens - //when the edge decreases to size 0. Old ww5 allows such - //cases. So we are again bug compatible - if (fabs(aStart - anEnd) < Precision::PConfusion()/*gp::Resolution()*/) - anEnd = 0.01; - BRepBuilderAPI_MakeEdge aDivider2(aCurve, aStart, anEnd); - if (myEdgesExchnged) - theEdge1 = aDivider2.Edge(); - else - theEdge2 = aDivider2.Edge(); - - delete aNearest; - return aResult; -} - -//======================================================================= -//function : AddValue -//purpose : -//======================================================================= -void GEOMImpl_Fillet1dPoint::AddValue(Standard_Real theValue, Standard_Boolean theValid) -{ - Standard_Integer a; - for(a = 1; a <= myV.Length(); a++) - { - if (theValue < myV.Value(a)) - { - myV.InsertBefore(a, theValue); - myValid.InsertBefore(a, (Standard_Integer)theValid); - return; - } - } - myV.Append(theValue); - myValid.Append((Standard_Integer)theValid); -} - -//======================================================================= -//function : ComputeDifference -//purpose : -//======================================================================= -Standard_Boolean GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoint* thePoint) -{ - Standard_Integer a; - Standard_Boolean aDiffsSet = (myD.Length() != 0); - Standard_Real aDX = thePoint->GetParam() - myParam, aDY; - if (thePoint->myV.Length() == myV.Length()) - { // absolutely the same points - for(a = 1; a <= myV.Length(); a++) - { - aDY = thePoint->myV.Value(a) - myV.Value(a); - if ( aDiffsSet ) - myD.SetValue(a, fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0); - else - myD.Append( fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0); - } - return Standard_True; - } - // between the diffeerent points searching for nearest analogs - Standard_Integer b; - for(a = 1; a <= myV.Length(); a++) - { - for(b = 1; b <= thePoint->myV.Length(); b++) - { - if (b == 1 || fabs(thePoint->myV.Value(b) - myV.Value(a)) < fabs(aDY)) - aDY = thePoint->myV.Value(b) - myV.Value(a); - } - if (aDiffsSet) - { - if ( fabs(aDX) > gp::Resolution() && fabs(aDY / aDX) < fabs(myD.Value(a))) - myD.SetValue(a, aDY / aDX); - else - myD.SetValue(a, 0); - } - else - { - myD.Append( fabs(aDX) > gp::Resolution() ? aDY/aDX : 0); - } - } - - return Standard_False; -} - -//======================================================================= -//function : FilterPoints -//purpose : -//======================================================================= -void GEOMImpl_Fillet1dPoint::FilterPoints(GEOMImpl_Fillet1dPoint* thePoint) -{ - Standard_Integer a, b; - TColStd_SequenceOfReal aDiffs; - Standard_Real aY, aY2, aDX = thePoint->GetParam() - myParam; - for(a = 1; a <= myV.Length(); a++) - { - // searching for near point from thePoint - Standard_Integer aNear = 0; - Standard_Real aDiff = aDX * 10000.; - aY = myV.Value(a) + myD.Value(a) * aDX; - for(b = 1; b <= thePoint->myV.Length(); b++) - { - // calculate hypothesis value of the Y2 with the constant first and second derivative - aY2 = aY + aDX * (thePoint->myD.Value(b) - myD.Value(a)) / 2.0; - if (aNear == 0 || fabs(aY2 - thePoint->myV.Value(b)) < fabs(aDiff)) - { - aNear = b; - aDiff = aY2 - thePoint->myV.Value(b); - } - }//for b... - - if (aNear) - { - if (myV.Value(a) * thePoint->myV.Value(aNear) > 0) - {// the same sign at the same sides of the interval - if (myV.Value(a) * myD.Value(a) > 0) - { - if (fabs(myD.Value(a)) > Precision::Confusion()) - aNear = 0; - } - else - { - if (fabs(myV.Value(a)) > fabs(thePoint->myV.Value(aNear))) - if (thePoint->myV.Value(aNear) * thePoint->myD.Value(aNear) < 0 && - fabs(thePoint->myD.Value(aNear)) > Precision::Confusion()) - { - aNear = 0; - } - } - } - } - - if (aNear) - { - if (myV.Value(a) * thePoint->myV.Value(aNear) > 0) - { - if ((myV.Value(a) + myD.Value(a) * aDX) * myV.Value(a) > Precision::Confusion() && - (thePoint->myV.Value(aNear) + thePoint->myD.Value(aNear) * aDX) * thePoint->myV.Value(aNear) > Precision::Confusion()) - { - aNear = 0; - } - } - } - - if (aNear) - { - if ( fabs(aDX) < gp::Resolution() || fabs(aDiff / aDX) > 1.e+7) - { - aNear = 0; - } - } - - if (aNear == 0) - { // there is no near: remove it from the list - myV.Remove(a); - myD.Remove(a); - myValid.Remove(a); - a--; - } - else - { - Standard_Boolean aFound = Standard_False; - for(b = 1; b <= myNear.Length(); b++) - { - if (myNear.Value(b) == aNear) - { - if (fabs(aDiffs.Value(b)) < fabs(aDiff)) - { // return this 'near' - aFound = Standard_True; - myV.Remove(a); - myD.Remove(a); - myValid.Remove(a); - a--; - break; - } - else - { // remove the old 'near' - myV.Remove(b); - myD.Remove(b); - myValid.Remove(b); - myNear.Remove(b); - aDiffs.Remove(b); - a--; - break; - } - } - }//for b... - if (!aFound) - { - myNear.Append(aNear); - aDiffs.Append(aDiff); - } - } - }//for a... -} - -//======================================================================= -//function : Copy -//purpose : -//======================================================================= -GEOMImpl_Fillet1dPoint* GEOMImpl_Fillet1dPoint::Copy() -{ - GEOMImpl_Fillet1dPoint* aCopy = new GEOMImpl_Fillet1dPoint(myParam); - Standard_Integer a; - for(a = 1; a <= myV.Length(); a++) - { - aCopy->myV.Append(myV.Value(a)); - aCopy->myD.Append(myD.Value(a)); - aCopy->myValid.Append(myValid.Value(a)); - } - return aCopy; -} - -//======================================================================= -//function : HasSolution -//purpose : -//======================================================================= -Standard_Integer GEOMImpl_Fillet1dPoint::HasSolution(const Standard_Real theRadius) -{ - Standard_Integer a; - for(a = 1; a <= myV.Length(); a++) - { - if (fabs(sqrt(fabs(fabs(myV.Value(a)) + theRadius * theRadius)) - theRadius) < Precision::Confusion() / 10.) - return a; - } - return 0; -} - -//======================================================================= -//function : RemoveSolution -//purpose : -//======================================================================= -void GEOMImpl_Fillet1dPoint::RemoveSolution(Standard_Integer theIndex) -{ - myV.Remove(theIndex); - myD.Remove(theIndex); - myValid.Remove(theIndex); - myNear.Remove(theIndex); -} +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 : GEOMImpl_Fillet1d.cxx +// Module : GEOMImpl +// +#include "GEOMImpl_Fillet1d.hxx" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * class GEOMImpl_Fillet1d + */ + + +//======================================================================= +//function : Constructor +//purpose : +//======================================================================= +GEOMImpl_Fillet1d::GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1, + const TopoDS_Edge& theEdge2, + const gp_Pln& thePlane) +: myEdgesExchnged( Standard_False ) +{ + myPlane = new Geom_Plane(thePlane); + + BRepAdaptor_Curve aBAC1(theEdge1); + BRepAdaptor_Curve aBAC2(theEdge2); + if (aBAC1.GetType() < aBAC2.GetType()) + { // first curve must be more complicated + myEdge1 = theEdge2; + myEdge2 = theEdge1; + myEdgesExchnged = Standard_True; + } + else + { + myEdge1 = theEdge1; + myEdge2 = theEdge2; + } + + Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(myEdge1, myStart1, myEnd1); + Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(myEdge2, myStart2, myEnd2); + + myCurve1 = GeomProjLib::Curve2d(aCurve1, myStart1, myEnd1, myPlane); + myCurve2 = GeomProjLib::Curve2d(aCurve2, myStart2, myEnd2, myPlane); + + while (myCurve1->IsPeriodic() && myStart1 >= myEnd1) + myEnd1 += myCurve1->Period(); + while (myCurve2->IsPeriodic() && myStart2 >= myEnd2) + myEnd2 += myCurve2->Period(); + + if (aBAC1.GetType() == aBAC2.GetType()) + { + if (myEnd2 - myStart2 < myEnd1 - myStart1) + { // first curve must be parametrically shorter + TopoDS_Edge anEdge = myEdge1; + myEdge1 = myEdge2; + myEdge2 = anEdge; + Handle(Geom2d_Curve) aCurve = myCurve1; + myCurve1 = myCurve2; + myCurve2 = aCurve; + Standard_Real a = myStart1; + myStart1 = myStart2; + myStart2 = a; + a = myEnd1; + myEnd1 = myEnd2; + myEnd2 = a; + myEdgesExchnged = Standard_True; + } + } +} + +//======================================================================= +//function : isRadiusIntersected +//purpose : local function +//======================================================================= +static Standard_Boolean isRadiusIntersected(const Handle(Geom2d_Curve)& theCurve, + const gp_Pnt2d theStart, + const gp_Pnt2d theEnd, + const Standard_Boolean theStartConnected) +{ + const Standard_Real aTol = Precision::Confusion(); + const Standard_Real anAngTol = Precision::Angular(); + Geom2dAPI_InterCurveCurve anInter(theCurve, new Geom2d_Line(theStart, + gp_Dir2d(gp_Vec2d(theStart, theEnd))), aTol); + Standard_Integer a; + gp_Pnt2d aPoint; + for(a = anInter.NbPoints(); a > 0; a--) + { + aPoint = anInter.Point(a); + if ( aPoint.Distance(theStart) < aTol && !theStartConnected ) + return Standard_True; + if (aPoint.Distance(theEnd) < aTol * 200) + return Standard_True; + if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) + return Standard_True; + } + Handle(Geom2d_Curve) aCurve; + for(a = anInter.NbSegments(); a > 0; a--) + { + anInter.Segment(a, aCurve); + aPoint = aCurve->Value(aCurve->FirstParameter()); + if (aPoint.Distance(theStart) < aTol) + if (!theStartConnected) + return Standard_True; + if (aPoint.Distance(theEnd) < aTol) + return Standard_True; + if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) + return Standard_True; + aPoint = aCurve->Value(aCurve->LastParameter()); + if (aPoint.Distance(theStart) < aTol) + if (!theStartConnected) + return Standard_True; + if (aPoint.Distance(theEnd) < aTol) + return Standard_True; + if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol)) + return Standard_True; + } + return Standard_False; +} + + +//======================================================================= +//function : fillPoint +//purpose : +//======================================================================= +void GEOMImpl_Fillet1d::fillPoint(GEOMImpl_Fillet1dPoint* thePoint) +{ + gp_Pnt2d aPoint; + gp_Vec2d aVec; + const Standard_Real aTol = Precision::Confusion(); + myCurve1->D1(thePoint->GetParam(), aPoint, aVec); + if (aVec.SquareMagnitude() < aTol) + return; + + gp_Vec2d aPerp(((myStartSide)?-1:1) * aVec.Y(), ((myStartSide)?1:-1) * aVec.X()); + aPerp.Normalize(); + aPerp.Multiply(myRadius); + gp_Pnt2d aCenter = aPoint.Translated(aPerp); + thePoint->SetCenter(aCenter); + + // on the intersection point + Standard_Boolean aValid = Standard_True; + Geom2dAPI_ProjectPointOnCurve aProjInt(aPoint, myCurve2); + if (aProjInt.NbPoints() && aPoint.Distance(aProjInt.NearestPoint()) < aTol) + aValid = Standard_False; + else + aValid = !isRadiusIntersected(myCurve2, aPoint, aCenter, Standard_True); + + Geom2dAPI_ProjectPointOnCurve aProj(aCenter, myCurve2); + Standard_Integer a, aNB = aProj.NbPoints(); + for(a = aNB; a > 0; a--) + { + if (aPoint.Distance(aProj.Point(a)) < aTol) + continue; + + Standard_Boolean aValid2 = aValid; + if (aValid2) + aValid2 = !isRadiusIntersected(myCurve1, aCenter, aProj.Point(a), Standard_False); + + // checking the right parameter + Standard_Real aParam = aProj.Parameter(a); + while(myCurve2->IsPeriodic() && aParam < myStart2) + aParam += myCurve2->Period(); + + thePoint->AddValue(aProj.Distance(a) * aProj.Distance(a) - myRadius * myRadius, + (aParam >= myStart2 && aParam <= myEnd2 && aValid2)); + if (fabs(fabs(aProj.Distance(a)) - myRadius) < aTol) + thePoint->SetParam2(aParam); + } +} + +//======================================================================= +//function : fillDiff +//purpose : +//======================================================================= +void GEOMImpl_Fillet1d::fillDiff(GEOMImpl_Fillet1dPoint* thePoint, Standard_Real theDiffStep, Standard_Boolean theFront) +{ + GEOMImpl_Fillet1dPoint* aDiff = + new GEOMImpl_Fillet1dPoint(thePoint->GetParam() + (theFront?(theDiffStep):(-theDiffStep))); + fillPoint(aDiff); + if (!thePoint->ComputeDifference(aDiff)) + { + aDiff->SetParam(thePoint->GetParam() + (theFront?(-theDiffStep):(theDiffStep))); + fillPoint(aDiff); + thePoint->ComputeDifference(aDiff); + } + delete aDiff; +} + +//======================================================================= +//function : Perform +//purpose : +//======================================================================= +Standard_Boolean GEOMImpl_Fillet1d::Perform(const Standard_Real theRadius) +{ + myDegreeOfRecursion = 0; + myResultParams.Clear(); + myResultOrientation.Clear(); + + Standard_Real aNBSteps = 100; + Geom2dAdaptor_Curve aGAC(myCurve1); + switch (aGAC.GetType()) + { + case GeomAbs_Line: + aNBSteps = 2; + break; + case GeomAbs_Circle: + aNBSteps = 4; + break; + case GeomAbs_Ellipse: + aNBSteps = 5; + break; + case GeomAbs_BezierCurve: + case GeomAbs_BSplineCurve: + aNBSteps = 2 + aGAC.Degree() * aGAC.NbPoles(); + break; + default: // unknown: maximum + aNBSteps = 100; + } + + myRadius = theRadius; + Standard_Real aParam, aStep, aDStep; + aStep = (myEnd1 - myStart1) / aNBSteps; + aDStep = aStep/1000.; + + Standard_Integer aCycle; + for(aCycle = 2, myStartSide = Standard_False; aCycle; myStartSide = !myStartSide, aCycle--) + { + GEOMImpl_Fillet1dPoint *aLeft = NULL, *aRight = NULL; + + for(aParam = myStart1 + aStep; aParam < myEnd1 || fabs(myEnd1 - aParam) < Precision::Confusion(); aParam += aStep) + { + if (!aLeft) + { + aLeft = new GEOMImpl_Fillet1dPoint(aParam - aStep); + fillPoint(aLeft); + fillDiff(aLeft, aDStep, Standard_True); + } + + aRight = new GEOMImpl_Fillet1dPoint(aParam); + fillPoint(aRight); + fillDiff(aRight, aDStep, Standard_False); + + aLeft->FilterPoints(aRight); + performNewton(aLeft, aRight); + + delete aLeft; + aLeft = aRight; + } + delete aLeft; + } + + if (myResultParams.Extent()) + return Standard_True; + + return Standard_False; +} + +//======================================================================= +//function : processPoint +//purpose : +//======================================================================= +Standard_Boolean GEOMImpl_Fillet1d::processPoint(GEOMImpl_Fillet1dPoint* theLeft, + GEOMImpl_Fillet1dPoint* theRight, + Standard_Real theParameter) +{ + if (theParameter >= theLeft->GetParam() && theParameter < theRight->GetParam()) + { + Standard_Real aDX = theRight->GetParam() - theLeft->GetParam(); + if (theParameter - theLeft->GetParam() < aDX / 100.) + { + theParameter = theLeft->GetParam() + aDX / 100.; + } + if (theRight->GetParam() - theParameter < aDX / 100.) + { + theParameter = theRight->GetParam() - aDX / 100.; + } + + // Protection on infinite loop. + myDegreeOfRecursion++; + Standard_Real diffx = 0.001 * aDX; + if (myDegreeOfRecursion > 1000) + { + diffx *= 10.0; + if (myDegreeOfRecursion > 10000) + { + diffx *= 10.0; + if (myDegreeOfRecursion > 100000) + { + return Standard_True; + } + } + } + + GEOMImpl_Fillet1dPoint* aPoint1 = theLeft->Copy(); + GEOMImpl_Fillet1dPoint* aPoint2 = new GEOMImpl_Fillet1dPoint(theParameter); + fillPoint(aPoint2); + fillDiff(aPoint2, diffx, Standard_True); + + aPoint1->FilterPoints(aPoint2); + performNewton(aPoint1, aPoint2); + aPoint2->FilterPoints(theRight); + performNewton(aPoint2, theRight); + + delete aPoint1; + delete aPoint2; + return Standard_True; + } + + return Standard_False; +} + +//======================================================================= +//function : performNewton +//purpose : +//======================================================================= +void GEOMImpl_Fillet1d::performNewton(GEOMImpl_Fillet1dPoint* theLeft, + GEOMImpl_Fillet1dPoint* theRight) +{ + Standard_Integer a; + // check the left: if this is solution store it and remove it from the list of researching points of theLeft + a = theLeft->HasSolution(myRadius); + if (a) + { + if (theLeft->IsValid(a)) + { + myResultParams.Append(theLeft->GetParam()); + myResultOrientation.Append(myStartSide); + } + return; + } + + Standard_Real aDX = theRight->GetParam() - theLeft->GetParam(); + if ( aDX < Precision::Confusion() / 1000000.) + { + a = theRight->HasSolution(myRadius); + if (a) + if (theRight->IsValid(a)) + { + myResultParams.Append(theRight->GetParam()); + myResultOrientation.Append(myStartSide); + } + return; + } + + for(a = 1; a <= theLeft->GetNBValues(); a++) + { + Standard_Integer aNear = theLeft->GetNear(a); + + Standard_Real aA = (theRight->GetDiff(aNear) - theLeft->GetDiff(a)) / aDX; + Standard_Real aB = theLeft->GetDiff(a) - aA * theLeft->GetParam(); + Standard_Real aC = theLeft->GetValue(a) - theLeft->GetDiff(a) * theLeft->GetParam() + + aA * theLeft->GetParam() * theLeft->GetParam() / 2.0; + Standard_Real aDet = aB * aB - 2.0 * aA * aC; + + if ( fabs(aDet) < gp::Resolution() ) + continue; + + if (fabs(aA) < Precision::Confusion()) + { // linear case + if (fabs(aB) > 10e-20) + { + Standard_Real aX0 = - aC / aB; // use extremum + if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam()) + processPoint(theLeft, theRight, aX0); + } + else + { + processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise + } + } + else + { + if (fabs(aB) > fabs(aDet * 1000000.)) + { // possible floating point operations accurancy errors + processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise + } + else + { + if (aDet > 0) + { // two solutions + aDet = sqrt(aDet); + Standard_Boolean aRes = processPoint(theLeft, theRight, (- aB + aDet) / aA); + if (!aRes) + aRes = processPoint(theLeft, theRight, (- aB - aDet) / aA); + if (!aRes) + processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise + } + else + { + Standard_Real aX0 = - aB / aA; // use extremum + if (aX0 > theLeft->GetParam() && aX0 < theRight->GetParam()) + processPoint(theLeft, theRight, aX0); + else + processPoint(theLeft, theRight, theLeft->GetParam() + aDX / 2.0); // linear division otherwise + } + } + } + } +} + +//======================================================================= +//function : Result +//purpose : +//======================================================================= +TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, + TopoDS_Edge& theEdge1, + TopoDS_Edge& theEdge2) +{ + TopoDS_Edge aResult; + gp_Pnt2d aTargetPoint2d; + Standard_Real aX, aY; + ElSLib::PlaneParameters(myPlane->Pln().Position(), thePoint, aX, aY); + aTargetPoint2d.SetCoord(aX, aY); + + // choose the nearest circle + Standard_Real aDistance, aP; + GEOMImpl_Fillet1dPoint *aNearest; + Standard_Integer a; + TColStd_ListIteratorOfListOfReal anIter(myResultParams); + for(aNearest = NULL, a = 1; anIter.More(); anIter.Next(), a++) + { + myStartSide = (myResultOrientation.Value(a)) ? Standard_True : Standard_False; + GEOMImpl_Fillet1dPoint *aPoint = new GEOMImpl_Fillet1dPoint(anIter.Value()); + fillPoint(aPoint); + if (!aPoint->HasSolution(myRadius)) + continue; + aP = fabs(aPoint->GetCenter().Distance(aTargetPoint2d) - myRadius); + if (!aNearest || aP < aDistance) + { + aNearest = aPoint; + aDistance = aP; + } + else + { + delete aPoint; + } + } + + if (!aNearest) + return aResult; + + // create circle edge + gp_Pnt aCenter = ElSLib::PlaneValue(aNearest->GetCenter().X(), + aNearest->GetCenter().Y(), + myPlane->Pln().Position()); + Handle(Geom_Circle) aCircle = + new Geom_Circle(gp_Ax2(aCenter, myPlane->Pln().Axis().Direction()), myRadius); + gp_Pnt2d aPoint2d1, aPoint2d2; + myCurve1->D0(aNearest->GetParam(), aPoint2d1); + myCurve2->D0(aNearest->GetParam2(), aPoint2d2); + gp_Pnt aPoint1 = ElSLib::PlaneValue(aPoint2d1.X(), aPoint2d1.Y(), myPlane->Pln().Position()); + gp_Pnt aPoint2 = ElSLib::PlaneValue(aPoint2d2.X(), aPoint2d2.Y(), myPlane->Pln().Position()); + + GeomAPI_ProjectPointOnCurve aProj(thePoint, aCircle); + Standard_Real aTarGetParam = aProj.LowerDistanceParameter(); + gp_Pnt aPointOnCircle = aProj.NearestPoint(); + + // Check extrema point manually, because there is a bug in Open CASCADE + // in calculation of nearest point to a circle near the parameter 0.0 + gp_Pnt p0 = ElCLib::Value(0.0, aCircle->Circ()); + if (p0.Distance(thePoint) < aPointOnCircle.Distance(thePoint)) + { + aTarGetParam = 0.0; + aPointOnCircle = p0; + } + + aProj.Perform(aPoint1); + Standard_Real aParam1 = aProj.LowerDistanceParameter(); + aProj.Perform(aPoint2); + Standard_Real aParam2 = aProj.LowerDistanceParameter(); + Standard_Boolean aIsOut = ((aParam1 < aTarGetParam && aParam2 < aTarGetParam) || + (aParam1 > aTarGetParam && aParam2 > aTarGetParam)); + if (aParam1 > aParam2) + aIsOut = !aIsOut; + BRepBuilderAPI_MakeEdge aBuilder(aCircle->Circ(), + aIsOut ? aParam2 : aParam1, + aIsOut? aParam1 : aParam2); + aResult = aBuilder.Edge(); + + // divide edges + Standard_Real aStart, anEnd; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(myEdge1, aStart, anEnd); + gp_Vec aDir; + aCurve->D1(aNearest->GetParam(), aPoint1, aDir); + + gp_Vec aCircleDir; + aCircle->D1(aParam1, aPoint1, aCircleDir); + if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ aIsOut) + aStart = aNearest->GetParam(); + else + anEnd = aNearest->GetParam(); + + if (fabs(aStart - anEnd) > Precision::Confusion()) + { + //Divide edge + BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd); + if (myEdgesExchnged) + theEdge2 = aDivider1.Edge(); + else + theEdge1 = aDivider1.Edge(); + } + + aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd); + aCurve->D1(aNearest->GetParam2(), aPoint2, aDir); + + aCircle->D1(aParam2, aPoint2, aCircleDir); + if ((aCircleDir.Angle(aDir) > PI / 2.0) ^ (!aIsOut)) + aStart = aNearest->GetParam2(); + else + anEnd = aNearest->GetParam2(); + + if (fabs(aStart - anEnd) > Precision::Confusion()) + { + BRepBuilderAPI_MakeEdge aDivider2(aCurve, aStart, anEnd); + if (myEdgesExchnged) + theEdge1 = aDivider2.Edge(); + else + theEdge2 = aDivider2.Edge(); + } + + delete aNearest; + return aResult; +} + +//======================================================================= +//function : AddValue +//purpose : +//======================================================================= +void GEOMImpl_Fillet1dPoint::AddValue(Standard_Real theValue, Standard_Boolean theValid) +{ + Standard_Integer a; + for(a = 1; a <= myV.Length(); a++) + { + if (theValue < myV.Value(a)) + { + myV.InsertBefore(a, theValue); + myValid.InsertBefore(a, (Standard_Integer)theValid); + return; + } + } + myV.Append(theValue); + myValid.Append((Standard_Integer)theValid); +} + +//======================================================================= +//function : ComputeDifference +//purpose : +//======================================================================= +Standard_Boolean GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoint* thePoint) +{ + Standard_Integer a; + Standard_Boolean aDiffsSet = (myD.Length() != 0); + Standard_Real aDX = thePoint->GetParam() - myParam, aDY; + if (thePoint->myV.Length() == myV.Length()) + { // absolutely the same points + for(a = 1; a <= myV.Length(); a++) + { + aDY = thePoint->myV.Value(a) - myV.Value(a); + if ( aDiffsSet ) + myD.SetValue(a, fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0); + else + myD.Append( fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0); + } + return Standard_True; + } + // between the diffeerent points searching for nearest analogs + Standard_Integer b; + for(a = 1; a <= myV.Length(); a++) + { + for(b = 1; b <= thePoint->myV.Length(); b++) + { + if (b == 1 || fabs(thePoint->myV.Value(b) - myV.Value(a)) < fabs(aDY)) + aDY = thePoint->myV.Value(b) - myV.Value(a); + } + if (aDiffsSet) + { + if ( fabs(aDX) > gp::Resolution() && fabs(aDY / aDX) < fabs(myD.Value(a))) + myD.SetValue(a, aDY / aDX); + else + myD.SetValue(a, 0); + } + else + { + myD.Append( fabs(aDX) > gp::Resolution() ? aDY/aDX : 0); + } + } + + return Standard_False; +} + +//======================================================================= +//function : FilterPoints +//purpose : +//======================================================================= +void GEOMImpl_Fillet1dPoint::FilterPoints(GEOMImpl_Fillet1dPoint* thePoint) +{ + Standard_Integer a, b; + TColStd_SequenceOfReal aDiffs; + Standard_Real aY, aY2, aDX = thePoint->GetParam() - myParam; + for(a = 1; a <= myV.Length(); a++) + { + // searching for near point from thePoint + Standard_Integer aNear = 0; + Standard_Real aDiff = aDX * 10000.; + aY = myV.Value(a) + myD.Value(a) * aDX; + for(b = 1; b <= thePoint->myV.Length(); b++) + { + // calculate hypothesis value of the Y2 with the constant first and second derivative + aY2 = aY + aDX * (thePoint->myD.Value(b) - myD.Value(a)) / 2.0; + if (aNear == 0 || fabs(aY2 - thePoint->myV.Value(b)) < fabs(aDiff)) + { + aNear = b; + aDiff = aY2 - thePoint->myV.Value(b); + } + }//for b... + + if (aNear) + { + if (myV.Value(a) * thePoint->myV.Value(aNear) > 0) + {// the same sign at the same sides of the interval + if (myV.Value(a) * myD.Value(a) > 0) + { + if (fabs(myD.Value(a)) > Precision::Confusion()) + aNear = 0; + } + else + { + if (fabs(myV.Value(a)) > fabs(thePoint->myV.Value(aNear))) + if (thePoint->myV.Value(aNear) * thePoint->myD.Value(aNear) < 0 && + fabs(thePoint->myD.Value(aNear)) > Precision::Confusion()) + { + aNear = 0; + } + } + } + } + + if (aNear) + { + if (myV.Value(a) * thePoint->myV.Value(aNear) > 0) + { + if ((myV.Value(a) + myD.Value(a) * aDX) * myV.Value(a) > Precision::Confusion() && + (thePoint->myV.Value(aNear) + thePoint->myD.Value(aNear) * aDX) * thePoint->myV.Value(aNear) > Precision::Confusion()) + { + aNear = 0; + } + } + } + + if (aNear) + { + if ( fabs(aDX) < gp::Resolution() || fabs(aDiff / aDX) > 1.e+7) + { + aNear = 0; + } + } + + if (aNear == 0) + { // there is no near: remove it from the list + myV.Remove(a); + myD.Remove(a); + myValid.Remove(a); + a--; + } + else + { + Standard_Boolean aFound = Standard_False; + for(b = 1; b <= myNear.Length(); b++) + { + if (myNear.Value(b) == aNear) + { + if (fabs(aDiffs.Value(b)) < fabs(aDiff)) + { // return this 'near' + aFound = Standard_True; + myV.Remove(a); + myD.Remove(a); + myValid.Remove(a); + a--; + break; + } + else + { // remove the old 'near' + myV.Remove(b); + myD.Remove(b); + myValid.Remove(b); + myNear.Remove(b); + aDiffs.Remove(b); + a--; + break; + } + } + }//for b... + if (!aFound) + { + myNear.Append(aNear); + aDiffs.Append(aDiff); + } + } + }//for a... +} + +//======================================================================= +//function : Copy +//purpose : +//======================================================================= +GEOMImpl_Fillet1dPoint* GEOMImpl_Fillet1dPoint::Copy() +{ + GEOMImpl_Fillet1dPoint* aCopy = new GEOMImpl_Fillet1dPoint(myParam); + Standard_Integer a; + for(a = 1; a <= myV.Length(); a++) + { + aCopy->myV.Append(myV.Value(a)); + aCopy->myD.Append(myD.Value(a)); + aCopy->myValid.Append(myValid.Value(a)); + } + return aCopy; +} + +//======================================================================= +//function : HasSolution +//purpose : +//======================================================================= +Standard_Integer GEOMImpl_Fillet1dPoint::HasSolution(const Standard_Real theRadius) +{ + Standard_Integer a; + for(a = 1; a <= myV.Length(); a++) + { + if (fabs(sqrt(fabs(fabs(myV.Value(a)) + theRadius * theRadius)) - theRadius) < Precision::Confusion() / 10.) + return a; + } + return 0; +} + +//======================================================================= +//function : RemoveSolution +//purpose : +//======================================================================= +void GEOMImpl_Fillet1dPoint::RemoveSolution(Standard_Integer theIndex) +{ + myV.Remove(theIndex); + myD.Remove(theIndex); + myValid.Remove(theIndex); + myNear.Remove(theIndex); +} diff --git a/src/GEOMImpl/GEOMImpl_Fillet1d.hxx b/src/GEOMImpl/GEOMImpl_Fillet1d.hxx index 80df11a1e..c12ee1567 100644 --- a/src/GEOMImpl/GEOMImpl_Fillet1d.hxx +++ b/src/GEOMImpl/GEOMImpl_Fillet1d.hxx @@ -1,141 +1,142 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 : GEOMImpl_Fillet1d.hxx -// Module : GEOMImpl -// -#ifndef _GEOMImpl_Fillet1d_HeaderFile -#define _GEOMImpl_Fillet1d_HeaderFile - -#include -#include -#include - -#include -#include -#include -#include - -class GEOMImpl_Fillet1dPoint; - -/** -* GEOMImpl_Fillet1d is 1D fillet algorithm on two planar edges with given radius -*/ - -class GEOMImpl_Fillet1d -{ -public: - //! Constructor - //! The fillet 1D algorithm initialise by two edges and plane - Standard_EXPORT GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1, - const TopoDS_Edge& theEdge2, - const gp_Pln& thePlane); - //! Makes fillet with given radius - //! @returns Standard_True, if at least one result computed - Standard_EXPORT Standard_Boolean Perform(const Standard_Real theRadius); - //! Returns result fillet edge and modified edges as out parameters - Standard_EXPORT TopoDS_Edge Result(const gp_Pnt& thePoint, TopoDS_Edge& theEdge1, TopoDS_Edge& theEdge2); - -private: - //! private methods - void fillPoint(GEOMImpl_Fillet1dPoint*); - void fillDiff(GEOMImpl_Fillet1dPoint*, Standard_Real, Standard_Boolean); - void performNewton(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*); - Standard_Boolean processPoint(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*, Standard_Real); - - -private: - //! private fields - TopoDS_Edge myEdge1, myEdge2; - Handle(Geom_Plane) myPlane; - Handle(Geom2d_Curve) myCurve1, myCurve2; - Standard_Real myStart1, myEnd1, myStart2, myEnd2, myRadius; - TColStd_ListOfReal myResultParams; - TColStd_SequenceOfInteger myResultOrientation; - Standard_Boolean myStartSide, myEdgesExchnged; -}; - - -/** -* GEOMImpl_Fillet1dPoint is an internal class for 1D fillet algorithm -* to store and compare computed solutions on edges -*/ - -class GEOMImpl_Fillet1dPoint -{ -public: - //! Puiblic methods - - //! Constructor - Standard_EXPORT GEOMImpl_Fillet1dPoint(Standard_Real theParam) - {myParam = theParam;} - - //! Make copy of point - //!WARNING: Copies only field values: myParam, myV, myD, myValid - Standard_EXPORT GEOMImpl_Fillet1dPoint* Copy(); // warning: this is not the full copy! - - //! Set/Get parameter - Standard_EXPORT inline void SetParam(Standard_Real theParam) - {myParam = theParam;} - Standard_EXPORT inline Standard_Real GetParam() const - {return myParam;} - Standard_EXPORT inline void SetParam2(const Standard_Real theParam2) - {myParam2 = theParam2;} - Standard_EXPORT inline Standard_Real GetParam2() - { return myParam2 ; } - - //! Returns validity - Standard_EXPORT inline Standard_Boolean IsValid(int theIndex) - {return (Standard_Boolean)myValid.Value(theIndex);} - - //! Get values - Standard_EXPORT inline Standard_Integer GetNBValues() {return myV.Length();} - Standard_EXPORT inline Standard_Real GetValue(Standard_Integer theIndex) - {return myV.Value(theIndex);} - Standard_EXPORT inline Standard_Real GetDiff(Standard_Integer theIndex) - {return myD.Value(theIndex);} - Standard_EXPORT inline Standard_Integer GetNear(Standard_Integer theIndex) - {return myNear.Value(theIndex);} - - //! Set/Get center point - Standard_EXPORT inline void SetCenter(const gp_Pnt2d thePoint) - {myCenter = thePoint;} - Standard_EXPORT inline const gp_Pnt2d GetCenter() - {return myCenter;} - - Standard_EXPORT void AddValue(Standard_Real theValue, Standard_Boolean theIsValid); - - //! compute difference between this and given point - Standard_EXPORT Standard_Boolean ComputeDifference(GEOMImpl_Fillet1dPoint*); - Standard_EXPORT void FilterPoints(GEOMImpl_Fillet1dPoint*); - - //! Check is point contains solution and returns the index of them if any - Standard_EXPORT Standard_Integer HasSolution(Standard_Real theRadius); - //! Remove solution by index - void RemoveSolution(Standard_Integer theIndex); - -private: - //! Private fields - gp_Pnt2d myCenter; - Standard_Real myParam, myParam2; - TColStd_SequenceOfReal myV, myD; - TColStd_SequenceOfInteger myValid, myNear; -}; - -#endif +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 : GEOMImpl_Fillet1d.hxx +// Module : GEOMImpl +// +#ifndef _GEOMImpl_Fillet1d_HeaderFile +#define _GEOMImpl_Fillet1d_HeaderFile + +#include +#include +#include + +#include +#include +#include +#include + +class GEOMImpl_Fillet1dPoint; + +/** +* GEOMImpl_Fillet1d is 1D fillet algorithm on two planar edges with given radius +*/ + +class GEOMImpl_Fillet1d +{ +public: + //! Constructor + //! The fillet 1D algorithm initialise by two edges and plane + Standard_EXPORT GEOMImpl_Fillet1d(const TopoDS_Edge& theEdge1, + const TopoDS_Edge& theEdge2, + const gp_Pln& thePlane); + //! Makes fillet with given radius + //! @returns Standard_True, if at least one result computed + Standard_EXPORT Standard_Boolean Perform(const Standard_Real theRadius); + //! Returns result fillet edge and modified edges as out parameters + Standard_EXPORT TopoDS_Edge Result(const gp_Pnt& thePoint, TopoDS_Edge& theEdge1, TopoDS_Edge& theEdge2); + +private: + //! private methods + void fillPoint(GEOMImpl_Fillet1dPoint*); + void fillDiff(GEOMImpl_Fillet1dPoint*, Standard_Real, Standard_Boolean); + void performNewton(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*); + Standard_Boolean processPoint(GEOMImpl_Fillet1dPoint*, GEOMImpl_Fillet1dPoint*, Standard_Real); + + +private: + //! private fields + TopoDS_Edge myEdge1, myEdge2; + Handle(Geom_Plane) myPlane; + Handle(Geom2d_Curve) myCurve1, myCurve2; + Standard_Real myStart1, myEnd1, myStart2, myEnd2, myRadius; + TColStd_ListOfReal myResultParams; + TColStd_SequenceOfInteger myResultOrientation; + Standard_Boolean myStartSide, myEdgesExchnged; + Standard_Integer myDegreeOfRecursion; +}; + + +/** +* GEOMImpl_Fillet1dPoint is an internal class for 1D fillet algorithm +* to store and compare computed solutions on edges +*/ + +class GEOMImpl_Fillet1dPoint +{ +public: + //! Puiblic methods + + //! Constructor + Standard_EXPORT GEOMImpl_Fillet1dPoint(Standard_Real theParam) + {myParam = theParam;} + + //! Make copy of point + //!WARNING: Copies only field values: myParam, myV, myD, myValid + Standard_EXPORT GEOMImpl_Fillet1dPoint* Copy(); // warning: this is not the full copy! + + //! Set/Get parameter + Standard_EXPORT inline void SetParam(Standard_Real theParam) + {myParam = theParam;} + Standard_EXPORT inline Standard_Real GetParam() const + {return myParam;} + Standard_EXPORT inline void SetParam2(const Standard_Real theParam2) + {myParam2 = theParam2;} + Standard_EXPORT inline Standard_Real GetParam2() + { return myParam2 ; } + + //! Returns validity + Standard_EXPORT inline Standard_Boolean IsValid(int theIndex) + {return (Standard_Boolean)myValid.Value(theIndex);} + + //! Get values + Standard_EXPORT inline Standard_Integer GetNBValues() {return myV.Length();} + Standard_EXPORT inline Standard_Real GetValue(Standard_Integer theIndex) + {return myV.Value(theIndex);} + Standard_EXPORT inline Standard_Real GetDiff(Standard_Integer theIndex) + {return myD.Value(theIndex);} + Standard_EXPORT inline Standard_Integer GetNear(Standard_Integer theIndex) + {return myNear.Value(theIndex);} + + //! Set/Get center point + Standard_EXPORT inline void SetCenter(const gp_Pnt2d thePoint) + {myCenter = thePoint;} + Standard_EXPORT inline const gp_Pnt2d GetCenter() + {return myCenter;} + + Standard_EXPORT void AddValue(Standard_Real theValue, Standard_Boolean theIsValid); + + //! compute difference between this and given point + Standard_EXPORT Standard_Boolean ComputeDifference(GEOMImpl_Fillet1dPoint*); + Standard_EXPORT void FilterPoints(GEOMImpl_Fillet1dPoint*); + + //! Check is point contains solution and returns the index of them if any + Standard_EXPORT Standard_Integer HasSolution(Standard_Real theRadius); + //! Remove solution by index + void RemoveSolution(Standard_Integer theIndex); + +private: + //! Private fields + gp_Pnt2d myCenter; + Standard_Real myParam, myParam2; + TColStd_SequenceOfReal myV, myD; + TColStd_SequenceOfInteger myValid, myNear; +}; + +#endif diff --git a/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx b/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx index 1056f0108..d173fba61 100644 --- a/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx @@ -235,9 +235,9 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const // check if face edges modified, // if yes, than map to original edges (from vertex-edges list), because edges can be modified before - if (!aModifE1.IsNull() && !aModifE1.IsSame( anEdge1 )) + if (aModifE1.IsNull() || !anEdge1.IsSame( aModifE1 )) addEdgeRelation( anEdgeToEdgeMap, TopoDS::Edge(aVertexEdges.First()), aModifE1 ); - if (!aModifE2.IsNull() && !aModifE2.IsSame( anEdge2 )) + if (aModifE2.IsNull() || !anEdge2.IsSame( aModifE2 )) addEdgeRelation( anEdgeToEdgeMap, TopoDS::Edge(aVertexEdges.Last()), aModifE2 ); } @@ -251,7 +251,7 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const TopoDS_Shape anEdge = anExp.Current(); if ( !anEdgeToEdgeMap.IsBound( anEdge ) ) aListOfNewEdge.Append( anEdge ); - else + else if (!anEdgeToEdgeMap.Find( anEdge ).IsNull()) aListOfNewEdge.Append( anEdgeToEdgeMap.Find( anEdge ) ); } diff --git a/src/GEOMImpl/GEOMImpl_FillingDriver.cxx b/src/GEOMImpl/GEOMImpl_FillingDriver.cxx index 521589d5b..c70a3b04f 100644 --- a/src/GEOMImpl/GEOMImpl_FillingDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_FillingDriver.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -102,7 +103,12 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const GEOMImpl_IFilling IF (aFunction); Handle(GEOM_Function) aShapeFunction = IF.GetShape(); if (aShapeFunction.IsNull()) return 0; - TopoDS_Shape aShape = aShapeFunction->GetValue(); + TopoDS_Shape aShape; + + BRepBuilderAPI_Copy Copy(aShapeFunction->GetValue()); + if( Copy.IsDone() ) + aShape = Copy.Shape(); + if (aShape.IsNull() || aShape.ShapeType() != TopAbs_COMPOUND) return 0; Standard_Integer mindeg = IF.GetMinDeg(); diff --git a/src/GEOMImpl/GEOMImpl_HealingDriver.cxx b/src/GEOMImpl/GEOMImpl_HealingDriver.cxx index 5670d099b..d59b07203 100644 --- a/src/GEOMImpl/GEOMImpl_HealingDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_HealingDriver.cxx @@ -18,7 +18,6 @@ // 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 @@ -45,6 +44,12 @@ #include #include +#include +#include +#include +#include +#include + #include #include @@ -126,6 +131,9 @@ Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const case CHANGE_ORIENTATION: ChangeOrientation(&HI, anOriginalShape, aShape); break; + case LIMIT_TOLERANCE: + LimitTolerance(&HI, anOriginalShape, aShape); + break; default: return 0; } @@ -465,6 +473,36 @@ Standard_Boolean GEOMImpl_HealingDriver::ChangeOrientation (GEOMImpl_IHealing* t return aResult; } +//======================================================================= +//function : LimitTolerance +//purpose : +//======================================================================= +void GEOMImpl_HealingDriver::LimitTolerance (GEOMImpl_IHealing* theHI, + const TopoDS_Shape& theOriginalShape, + TopoDS_Shape& theOutShape) const +{ + Standard_Real aTol = theHI->GetTolerance(); + if (aTol < Precision::Confusion()) + aTol = Precision::Confusion(); + + // 1. Make a copy to prevent the original shape changes. + TopoDS_Shape aShapeCopy; + TColStd_IndexedDataMapOfTransientTransient aMapTShapes; + TNaming_CopyShape::CopyTool(theOriginalShape, aMapTShapes, aShapeCopy); + + // 2. Limit tolerance. + ShapeFix_ShapeTolerance aSFT; + aSFT.LimitTolerance(aShapeCopy, aTol, aTol, TopAbs_SHAPE); + + // 3. Fix obtained shape. + Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape (aShapeCopy); + aSfs->Perform(); + theOutShape = aSfs->Shape(); + + BRepCheck_Analyzer ana (theOutShape, Standard_True); + if (!ana.IsValid()) + StdFail_NotDone::Raise("Non valid shape result"); +} //======================================================================= //function : GEOMImpl_HealingDriver_Type_ diff --git a/src/GEOMImpl/GEOMImpl_HealingDriver.hxx b/src/GEOMImpl/GEOMImpl_HealingDriver.hxx index 344cf770c..4e4b44b49 100644 --- a/src/GEOMImpl/GEOMImpl_HealingDriver.hxx +++ b/src/GEOMImpl/GEOMImpl_HealingDriver.hxx @@ -19,10 +19,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File : GEOMImpl_HealingDriver.hxx // Module : GEOMImpl -// + #ifndef _GEOMImpl_HealingDriver_HeaderFile #define _GEOMImpl_HealingDriver_HeaderFile @@ -156,7 +155,7 @@ Standard_EXPORT ~GEOMImpl_HealingDriver() {}; // Standard_EXPORT friend Handle_Standard_Type& GEOMImpl_HealingDriver_Type_(); Standard_EXPORT const Handle(Standard_Type)& DynamicType() const { return STANDARD_TYPE(GEOMImpl_HealingDriver) ; } -Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_HealingDriver) == AType || TFunction_Driver::IsKind(AType)); } +Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const { return (STANDARD_TYPE(GEOMImpl_HealingDriver) == AType || TFunction_Driver::IsKind(AType)); } private: Standard_Boolean ShapeProcess ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; @@ -167,7 +166,7 @@ Standard_Boolean RemoveHoles ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS Standard_Boolean Sew ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean AddPointOnEdge( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; Standard_Boolean ChangeOrientation( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; - +void LimitTolerance( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const; }; diff --git a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx index e1ecb47bd..9a86c59fe 100644 --- a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.cxx @@ -16,10 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File : GEOMImpl_IAdvancedOperations.cxx // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) -// #include #include "GEOMImpl_Types.hxx" @@ -31,6 +29,7 @@ #include "GEOMImpl_IBlocksOperations.hxx" #include "GEOMImpl_I3DPrimOperations.hxx" #include "GEOMImpl_ILocalOperations.hxx" +#include "GEOMImpl_IHealingOperations.hxx" #include "GEOMImpl_Gen.hxx" @@ -81,7 +80,7 @@ */ //============================================================================= GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID) : - GEOM_IOperations(theEngine, theDocID) + GEOM_IOperations(theEngine, theDocID) { MESSAGE("GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations"); myBasicOperations = new GEOMImpl_IBasicOperations(GetEngine(), GetDocID()); @@ -91,6 +90,7 @@ GEOMImpl_IAdvancedOperations::GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngin myBlocksOperations = new GEOMImpl_IBlocksOperations(GetEngine(), GetDocID()); my3DPrimOperations = new GEOMImpl_I3DPrimOperations(GetEngine(), GetDocID()); myLocalOperations = new GEOMImpl_ILocalOperations(GetEngine(), GetDocID()); + myHealingOperations = new GEOMImpl_IHealingOperations(GetEngine(), GetDocID()); } //============================================================================= @@ -108,6 +108,7 @@ GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations() delete myBlocksOperations; delete my3DPrimOperations; delete myLocalOperations; + delete myHealingOperations; } //============================================================================= @@ -116,9 +117,9 @@ GEOMImpl_IAdvancedOperations::~GEOMImpl_IAdvancedOperations() */ //============================================================================= gp_Trsf GEOMImpl_IAdvancedOperations::GetPositionTrsf(double theL1, double theL2, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3) + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3) { // Old Local Coordinates System oldLCS gp_Pnt P0(0, 0, 0); @@ -157,10 +158,10 @@ gp_Trsf GEOMImpl_IAdvancedOperations::GetPositionTrsf(double theL1, double theL2 */ //============================================================================= bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double& theL2, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3, - double theTolerance) + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3, + double theTolerance) { SetErrorCode(KO); gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue())); @@ -193,7 +194,7 @@ bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double // if (fabs(newL1 - theL1) > Precision::Approximation()) { if ( (newL1 * (1 - theTolerance) -theL1 <= Precision::Approximation()) && - (newL1 * (1 + theTolerance) -theL1 >= Precision::Approximation()) ) { + (newL1 * (1 + theTolerance) -theL1 >= Precision::Approximation()) ) { // std::cerr << "theL1 = newL1" << std::endl; theL1 = newL1; } else { @@ -208,7 +209,7 @@ bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double // if (fabs(newL2 - theL2) > Precision::Approximation()) { if ( (newL2 * (1 - theTolerance) -theL2 <= Precision::Approximation()) && - (newL2 * (1 + theTolerance) -theL2 >= Precision::Approximation()) ) { + (newL2 * (1 + theTolerance) -theL2 >= Precision::Approximation()) ) { theL2 = newL2; } else { theL2 = -1; @@ -228,10 +229,10 @@ bool GEOMImpl_IAdvancedOperations::CheckCompatiblePosition(double& theL1, double */ //============================================================================= bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int shapeType, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - Handle(TColStd_HSequenceOfTransient) theSeq, - gp_Trsf aTrsf) + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2, + Handle(TColStd_HSequenceOfTransient) theSeq, + gp_Trsf aTrsf) { SetErrorCode(KO); @@ -244,7 +245,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int } gp_Trsf aTrsfInv = aTrsf.Inverted(); - + int expectedGroups = 0; if (shapeType == TSHAPE_BASIC) if (Abs(theR2+theW2-theR1-theW1) <= Precision::Approximation()) @@ -253,10 +254,10 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int expectedGroups = 11; else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET) expectedGroups = 12; - + double aR1Ext = theR1 + theW1; double aR2Ext = theR2 + theW2; - + ///////////////////////// //// Groups of Faces //// ///////////////////////// @@ -274,26 +275,32 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int BRepBuilderAPI_Transform aTransformationBox(aBox->GetValue(), aTrsf, Standard_False); TopoDS_Shape aBoxShapeTrsf = aTransformationBox.Shape(); aBox->GetLastFunction()->SetValue(aBoxShapeTrsf); - + // Get the shell of the box - Handle(GEOM_Object) aShell = Handle(GEOM_Object)::DownCast(myShapesOperations->MakeExplode(aBox, TopAbs_SHELL, true)->Value(1)); + Handle(GEOM_Object) aShell = Handle(GEOM_Object)::DownCast + (myShapesOperations->MakeExplode(aBox, TopAbs_SHELL, true)->Value(1)); aBox->GetLastFunction()->SetDescription(""); aShell->GetLastFunction()->SetDescription(""); // Get the common shapes between shell and shape Handle(GEOM_Object) aCommonCompound = myBooleanOperations->MakeBoolean (theShape, aShell, 1); // MakeCommon + if (aCommonCompound.IsNull()) { + SetErrorCode(myBooleanOperations->GetErrorCode()); + return false; + } aCommonCompound->GetLastFunction()->SetDescription(""); // Explode the faces of common shapes => 3 faces - Handle(TColStd_HSequenceOfTransient) aCommonFaces = myShapesOperations->MakeExplode(aCommonCompound, TopAbs_FACE, true); + Handle(TColStd_HSequenceOfTransient) aCommonFaces = + myShapesOperations->MakeExplode(aCommonCompound, TopAbs_FACE, true); aCommonCompound->GetLastFunction()->SetDescription(""); std::list aCompoundOfFacesList; - + for (int i=0 ; i<= aCommonFaces->Length()-4 ; i+=4) { std::list aFacesList; for (int j = 1 ; j <= 4 ; j++) { Handle(GEOM_Object) aFace = Handle(GEOM_Object)::DownCast(aCommonFaces->Value(i+j)); // Junction faces if (!aFace.IsNull()) { - aFace->GetLastFunction()->SetDescription(""); - aFacesList.push_back(aFace); + aFace->GetLastFunction()->SetDescription(""); + aFacesList.push_back(aFace); } } Handle(GEOM_Object) aCompoundOfFaces = myShapesOperations->MakeCompound(aFacesList); @@ -312,44 +319,45 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int aCompoundOfFacesList.pop_front(); // == END // - - + + // Uncomment the following lines when GetInPlace bug is solved // == BEGIN - // Handle(GEOM_Object) aP1 = myBasicOperations->MakePointXYZ(-theL1, 0, 0); - // Handle(GEOM_Object) aP2 = myBasicOperations->MakePointXYZ(-0, 0, theL2); - // Handle(GEOM_Object) aP3 = myBasicOperations->MakePointXYZ(theL1, 0, 0); - // aP1->GetLastFunction()->SetDescription(""); - // aP2->GetLastFunction()->SetDescription(""); - // aP3->GetLastFunction()->SetDescription(""); - // Handle(GEOM_Object) aV1 = myBasicOperations->MakeVectorDXDYDZ(-1, 0, 0); - // Handle(GEOM_Object) aV2 = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1); - // Handle(GEOM_Object) aV3 = myBasicOperations->MakeVectorDXDYDZ(1, 0, 0); - // aV1->GetLastFunction()->SetDescription(""); - // aV2->GetLastFunction()->SetDescription(""); - // aV3->GetLastFunction()->SetDescription(""); - // Handle(GEOM_Object) aPln1 = myBasicOperations->MakePlanePntVec(aP1, aV1, 2*(theR1+theW1+theL2)); - // Handle(GEOM_Object) aPln2 = myBasicOperations->MakePlanePntVec(aP2, aV2, 2*(theR2+theW2)); - // Handle(GEOM_Object) aPln3 = myBasicOperations->MakePlanePntVec(aP3, aV3, 2*(theR1+theW1+theL2)); - // aPln1->GetLastFunction()->SetDescription(""); - // aPln2->GetLastFunction()->SetDescription(""); - // aPln3->GetLastFunction()->SetDescription(""); - - // BRepBuilderAPI_Transform aTransformation1(aPln1->GetValue(), aTrsf, Standard_False); - // TopoDS_Shape aTrsf_Shape1 = aTransformation1.Shape(); - // aPln1->GetLastFunction()->SetValue(aTrsf_Shape1); - // BRepBuilderAPI_Transform aTransformation2(aPln2->GetValue(), aTrsf, Standard_False); - // TopoDS_Shape aTrsf_Shape2 = aTransformation2.Shape(); - // aPln2->GetLastFunction()->SetValue(aTrsf_Shape2); - // BRepBuilderAPI_Transform aTransformation3(aPln3->GetValue(), aTrsf, Standard_False); - // TopoDS_Shape aTrsf_Shape3 = aTransformation3.Shape(); - // aPln3->GetLastFunction()->SetValue(aTrsf_Shape3); +// Handle(GEOM_Object) aP1 = myBasicOperations->MakePointXYZ(-theL1, 0, 0); +// Handle(GEOM_Object) aP2 = myBasicOperations->MakePointXYZ(-0, 0, theL2); +// Handle(GEOM_Object) aP3 = myBasicOperations->MakePointXYZ(theL1, 0, 0); +// aP1->GetLastFunction()->SetDescription(""); +// aP2->GetLastFunction()->SetDescription(""); +// aP3->GetLastFunction()->SetDescription(""); +// Handle(GEOM_Object) aV1 = myBasicOperations->MakeVectorDXDYDZ(-1, 0, 0); +// Handle(GEOM_Object) aV2 = myBasicOperations->MakeVectorDXDYDZ(0, 0, 1); +// Handle(GEOM_Object) aV3 = myBasicOperations->MakeVectorDXDYDZ(1, 0, 0); +// aV1->GetLastFunction()->SetDescription(""); +// aV2->GetLastFunction()->SetDescription(""); +// aV3->GetLastFunction()->SetDescription(""); +// Handle(GEOM_Object) aPln1 = myBasicOperations->MakePlanePntVec(aP1, aV1, 2*(aR1Ext+theL2)); +// Handle(GEOM_Object) aPln2 = myBasicOperations->MakePlanePntVec(aP2, aV2, 2*(aR2Ext)); +// Handle(GEOM_Object) aPln3 = myBasicOperations->MakePlanePntVec(aP3, aV3, 2*(aR1Ext+theL2)); +// aPln1->GetLastFunction()->SetDescription(""); +// aPln2->GetLastFunction()->SetDescription(""); +// aPln3->GetLastFunction()->SetDescription(""); +// +// BRepBuilderAPI_Transform aTransformation1(aPln1->GetValue(), aTrsf, Standard_False); +// TopoDS_Shape aTrsf_Shape1 = aTransformation1.Shape(); +// aPln1->GetLastFunction()->SetValue(aTrsf_Shape1); +// BRepBuilderAPI_Transform aTransformation2(aPln2->GetValue(), aTrsf, Standard_False); +// TopoDS_Shape aTrsf_Shape2 = aTransformation2.Shape(); +// aPln2->GetLastFunction()->SetValue(aTrsf_Shape2); +// BRepBuilderAPI_Transform aTransformation3(aPln3->GetValue(), aTrsf, Standard_False); +// TopoDS_Shape aTrsf_Shape3 = aTransformation3.Shape(); +// aPln3->GetLastFunction()->SetValue(aTrsf_Shape3); // == END // - + Handle(GEOM_Object) junctionFaces1 = myShapesOperations->GetInPlace(theShape, aPln1); if (junctionFaces1.IsNull()) - junctionFaces1 = myShapesOperations->GetShapesOnShapeAsCompound(aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + junctionFaces1 = myShapesOperations->GetShapesOnShapeAsCompound + (aPln1, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); if (!junctionFaces1.IsNull()) { junctionFaces1->GetLastFunction()->SetDescription(""); junctionFaces1->SetName("JUNCTION_FACE_1"); @@ -362,7 +370,8 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int } Handle(GEOM_Object) junctionFaces2 = myShapesOperations->GetInPlace(theShape, aPln2); if (junctionFaces2.IsNull()) - junctionFaces2 = myShapesOperations->GetShapesOnShapeAsCompound(aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + junctionFaces2 = myShapesOperations->GetShapesOnShapeAsCompound + (aPln2, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); if (!junctionFaces2.IsNull()) { junctionFaces2->GetLastFunction()->SetDescription(""); junctionFaces2->SetName("JUNCTION_FACE_2"); @@ -375,7 +384,8 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int } Handle(GEOM_Object) junctionFaces3 = myShapesOperations->GetInPlace(theShape, aPln3); if (junctionFaces3.IsNull()) - junctionFaces3 = myShapesOperations->GetShapesOnShapeAsCompound(aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); + junctionFaces3 = myShapesOperations->GetShapesOnShapeAsCompound + (aPln3, theShape, TopAbs_FACE, GEOMAlgo_ST_ONIN); if (!junctionFaces3.IsNull()) { junctionFaces3->GetLastFunction()->SetDescription(""); junctionFaces3->SetName("JUNCTION_FACE_3"); @@ -386,14 +396,17 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int // theSeq->Append(aPln3); // return false; } + // Comment the following lines when GetInPlace bug is solved + // == BEGIN } + // == END ///////////////////////// //// Groups of Edges //// ///////////////////////// // Result of propagate Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); - + TCollection_AsciiString theDesc = aFunction->GetDescription(); Handle(TColStd_HSequenceOfTransient) aSeqPropagate = myBlocksOperations->Propagate(theShape); if (aSeqPropagate.IsNull() || aSeqPropagate->Length() == 0) { @@ -403,7 +416,7 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int Standard_Integer nbEdges, aNbGroups = aSeqPropagate->Length(); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); - + bool addGroup; bool circularFoundAndAdded = false; bool incidentPipeFound = false; @@ -413,162 +426,161 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int bool flangeFound = false; bool flangeFoundAndAdded = false; bool chamferOrFilletFound = false; - + for (int i=1 ; i<= aNbGroups; i++) { addGroup = false; - + Handle(GEOM_Object) aGroup = Handle(GEOM_Object)::DownCast(aSeqPropagate->Value(i)); if(aGroup.IsNull()) continue; - + TopoDS_Shape aGroupShape = aGroup->GetValue(); BRepBuilderAPI_Transform aTransformationShapeInv(aGroupShape, aTrsfInv, Standard_False); TopoDS_Shape aGroupShapeTrsfInv = aTransformationShapeInv.Shape(); - + TopTools_IndexedMapOfShape anEdgesMap; TopExp::MapShapes(aGroupShapeTrsfInv,TopAbs_EDGE, anEdgesMap); nbEdges = anEdgesMap.Extent(); if (shapeType == TSHAPE_BASIC) { if ((nbEdges == 21) || /*R1Ext = R2Ext*/(nbEdges == 17)){ - addGroup = true; - aGroup->SetName("THICKNESS"); + addGroup = true; + aGroup->SetName("THICKNESS"); } else if (nbEdges == 6) { - if (!circularFoundAndAdded) { - circularFoundAndAdded = true; - addGroup = true; - aGroup->SetName("CIRCULAR_QUARTER_PIPE"); - } + if (!circularFoundAndAdded) { + circularFoundAndAdded = true; + addGroup = true; + aGroup->SetName("CIRCULAR_QUARTER_PIPE"); + } } else if (nbEdges == 8) { - incidentPipeFound = true; - mainPipeFound = false; - radialFound =false; - flangeFound = false; - - TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX); - while (Ex.More()) { - gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); - double x=aP.X(), y=aP.Y(), z=aP.Z(); - - - if ((Abs(x) > aR2Ext + Precision::Confusion()) || - (Abs(y) > aR2Ext + Precision::Confusion())) { - incidentPipeFound = false; - } - - if ( z < -Precision::Confusion()) { - // length of main pipe - mainPipeFound = true; - if (!mainPipeFoundAndAdded) { - mainPipeFoundAndAdded = true; - addGroup = true; - aGroup->SetName("HALF_LENGTH_MAIN_PIPE"); - } - } - - else if (Abs(x) > (theL1-Precision::Confusion())) { - // discretisation circulaire - radialFound = true; - if (!circularFoundAndAdded) { - circularFoundAndAdded = true; - addGroup = true; - aGroup->SetName("CIRCULAR_QUARTER_PIPE"); - } - } + incidentPipeFound = true; + mainPipeFound = false; + radialFound =false; + flangeFound = false; + + TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX); + while (Ex.More()) { + gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); + double x=aP.X(), y=aP.Y(), z=aP.Z(); + + + if ((Abs(x) > aR2Ext + Precision::Confusion()) || + (Abs(y) > aR2Ext + Precision::Confusion())) { + incidentPipeFound = false; + } + + if ( z < -Precision::Confusion()) { + // length of main pipe + mainPipeFound = true; + if (!mainPipeFoundAndAdded) { + mainPipeFoundAndAdded = true; + addGroup = true; + aGroup->SetName("HALF_LENGTH_MAIN_PIPE"); + } + } + + else if (Abs(x) > (theL1-Precision::Confusion())) { + // discretisation circulaire + radialFound = true; + if (!circularFoundAndAdded) { + circularFoundAndAdded = true; + addGroup = true; + aGroup->SetName("CIRCULAR_QUARTER_PIPE"); + } + } Ex.Next(); - } - if (incidentPipeFound) { - addGroup = true; - aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE"); - } - if (!addGroup && (!incidentPipeFound && - !radialFound && - !mainPipeFound && - !flangeFound)) { - // Flange (collerette) - flangeFound = true; - addGroup = true; - aGroup->SetName("FLANGE"); - } + } + if (incidentPipeFound) { + addGroup = true; + aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE"); + } + if (!addGroup && (!incidentPipeFound && + !radialFound && + !mainPipeFound && + !flangeFound)) { + // Flange (collerette) + flangeFound = true; + addGroup = true; + aGroup->SetName("FLANGE"); + } } else - continue; + continue; } else if (shapeType == TSHAPE_CHAMFER || shapeType == TSHAPE_FILLET) { if (nbEdges == 25) { - addGroup = true; - aGroup->SetName("THICKNESS"); + addGroup = true; + aGroup->SetName("THICKNESS"); } else if ((nbEdges == 10) || (nbEdges == 6)) { - if (!circularFoundAndAdded) { - addGroup = true; - circularFoundAndAdded = true; - aGroup->SetName("CIRCULAR_QUARTER_PIPE"); - } + if (!circularFoundAndAdded) { + addGroup = true; + circularFoundAndAdded = true; + aGroup->SetName("CIRCULAR_QUARTER_PIPE"); + } } else if (nbEdges == 8) { - incidentPipeFound = true; - mainPipeFound = false; - flangeFound = false; - - TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX); - while (Ex.More()) { - gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); - double x=aP.X(), y=aP.Y(), z=aP.Z(); - - // tuy_princ_long_avant & tuy_princ_long_apres - bool isMain = (((z < Precision::Confusion()) || (x < Precision::Confusion())) && - ((y <= aR1Ext + Precision::Confusion()) || - (y <= -(aR1Ext + Precision::Confusion())) || - (y <= theR1 + Precision::Confusion()) || - (y == -(theR1 + Precision::Confusion())))); - - - if (!isMain) { - mainPipeFound = false; - } - - // collerette - if (z < Precision::Confusion()) { - flangeFound = true; - if (!flangeFoundAndAdded) { - flangeFoundAndAdded = true; - addGroup = true; - aGroup->SetName("FLANGE"); - } - } - - // tuyau incident - if ((Abs(x) > aR2Ext + Precision::Confusion()) || - (Abs(y) > aR2Ext + Precision::Confusion())) { - incidentPipeFound = false; - } - Ex.Next(); - } - if (mainPipeFound) { - addGroup = true; - aGroup->SetName("HALF_LENGTH_MAIN_PIPE"); - } - if (incidentPipeFound) { - addGroup = true; - aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE"); - } - if (!addGroup && (!incidentPipeFound && - !mainPipeFound && - !flangeFound && - !chamferOrFilletFound)) { - addGroup = true; - chamferOrFilletFound = true; - if (shapeType == TSHAPE_CHAMFER) - aGroup->SetName("CHAMFER"); - else - aGroup->SetName("FILLET"); - } + incidentPipeFound = true; + mainPipeFound = true; + flangeFound = false; + + TopExp_Explorer Ex(aGroupShapeTrsfInv,TopAbs_VERTEX); + while (Ex.More()) { + gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); + double x=aP.X(), y=aP.Y(), z=aP.Z(); + + // tuy_princ_long_avant & tuy_princ_long_apres + bool isMain = (((z < Precision::Confusion()) || (x < Precision::Confusion())) && + ((y <= aR1Ext + Precision::Confusion()) || + (y <= -(aR1Ext + Precision::Confusion())) || + (y <= theR1 + Precision::Confusion()) || + (y == -(theR1 + Precision::Confusion())))); + + if (!isMain) { + mainPipeFound = false; + } + + // collerette + if (z < Precision::Confusion()) { + flangeFound = true; + if (!flangeFoundAndAdded) { + flangeFoundAndAdded = true; + addGroup = true; + aGroup->SetName("FLANGE"); + } + } + + // tuyau incident + if ((Abs(x) > aR2Ext + Precision::Confusion()) || + (Abs(y) > aR2Ext + Precision::Confusion())) { + incidentPipeFound = false; + } + Ex.Next(); + } + if (mainPipeFound) { + addGroup = true; + aGroup->SetName("HALF_LENGTH_MAIN_PIPE"); + } + if (incidentPipeFound) { + addGroup = true; + aGroup->SetName("HALF_LENGTH_INCIDENT_PIPE"); + } + if (!addGroup && (!incidentPipeFound && + !mainPipeFound && + !flangeFound && + !chamferOrFilletFound)) { + addGroup = true; + chamferOrFilletFound = true; + if (shapeType == TSHAPE_CHAMFER) + aGroup->SetName("CHAMFER"); + else + aGroup->SetName("FILLET"); + } } else - continue; + continue; } // Add group to the list if (addGroup) @@ -579,11 +591,11 @@ bool GEOMImpl_IAdvancedOperations::MakeGroups(Handle(GEOM_Object) theShape, int return true; } -bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - double theRF, bool isNormal) +bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape, + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2, + double theH, double theW, + double theRF, bool isNormal) { SetErrorCode(KO); @@ -610,10 +622,11 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t box_i->GetLastFunction()->SetDescription(""); box_i = myTransformOperations->TranslateDXDYDZ(box_i, -theR2, -theR2, 0); box_i->GetLastFunction()->SetDescription(""); - + Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); TCollection_AsciiString theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) edges_i = myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + Handle(TColStd_HSequenceOfTransient) edges_i = + myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); if (edges_i.IsNull() || edges_i->Length() == 0) { @@ -629,7 +642,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t // search for vertices located on both internal pipes aFunction = theShape->GetLastFunction(); theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) vertices_i = myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); + Handle(TColStd_HSequenceOfTransient) vertices_i = + myShapesOperations->GetShapesOnBox(box_i, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); if (vertices_i.IsNull() || vertices_i->Length() == 0) { @@ -644,15 +658,15 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t gp_Pnt aP = BRep_Tool::Pnt(aVertex); if (Abs(aP.X()) <= Precision::Confusion()) { if (Abs(aP.Y()) - theR2 <= Precision::Confusion()) - vi1 = v; + vi1 = v; } else if (Abs(aP.Y()) <= Precision::Confusion()) { if (Abs(aP.X()) - theR1 <= Precision::Confusion()) - vi2 = v; + vi2 = v; } } std::list theShapes; - + if (isNormal) { Handle(GEOM_Object) ve1, ve2; @@ -663,7 +677,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t // Common edges on external cylinder aFunction = theShape->GetLastFunction(); theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) edges_e = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + Handle(TColStd_HSequenceOfTransient) edges_e = + myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_EDGE, GEOMAlgo_ST_IN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -678,7 +693,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t // search for vertices located on both external pipes aFunction = theShape->GetLastFunction(); theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) vertices_e = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); + Handle(TColStd_HSequenceOfTransient) vertices_e = + myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); if (vertices_e.IsNull() || vertices_e->Length() == 0) { @@ -692,11 +708,11 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t TopoDS_Vertex aVertex = TopoDS::Vertex(v->GetValue()); gp_Pnt aP = BRep_Tool::Pnt(aVertex); if (Abs(aP.X()) <= Precision::Confusion()) { - if (Abs(aP.Y()) - theR2 > Precision::Confusion()) - ve1 = v; + if (Abs(aP.Y()) - theR2 > Precision::Confusion()) + ve1 = v; } else if (Abs(aP.Y()) <= Precision::Confusion()) { - if (Abs(aP.X()) - theR2 > Precision::Confusion()) - ve2 = v; + if (Abs(aP.X()) - theR2 > Precision::Confusion()) + ve2 = v; } } Handle(GEOM_Object) edge_e1, edge_e2; @@ -706,8 +722,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t #endif edge_e1 = myBasicOperations->MakeLineTwoPnt(ve1, vi1); if (edge_e1.IsNull()) { - SetErrorCode("Edge 1 could not be built"); - return false; + SetErrorCode("Edge 1 could not be built"); + return false; } } catch (Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); @@ -721,15 +737,15 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t #endif edge_e2 = myBasicOperations->MakeLineTwoPnt(ve2, vi2); if (edge_e2.IsNull()) { - SetErrorCode("Edge 2 could not be built"); - return false; + SetErrorCode("Edge 2 could not be built"); + return false; } } catch (Standard_Failure) { Handle(Standard_Failure) aFail = Standard_Failure::Caught(); SetErrorCode(aFail->GetMessageString()); return false; } - + edge_e1->GetLastFunction()->SetDescription(""); edge_e2->GetLastFunction()->SetDescription(""); @@ -758,25 +774,28 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t double ZX=0, ZY=0; std::vector LX; std::vector LY; - Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ(theVertCylinderRadius, theVertCylinderRadius, theHoriCylinderRadius); + Handle(GEOM_Object) box_e = my3DPrimOperations->MakeBoxDXDYDZ + (theVertCylinderRadius, theVertCylinderRadius, theHoriCylinderRadius); box_e->GetLastFunction()->SetDescription(""); - box_e = myTransformOperations->TranslateDXDYDZ(box_e, -theVertCylinderRadius, -theVertCylinderRadius, 0); + box_e = myTransformOperations->TranslateDXDYDZ + (box_e, -theVertCylinderRadius, -theVertCylinderRadius, 0); box_e->GetLastFunction()->SetDescription(""); aFunction = theShape->GetLastFunction(); theDesc = aFunction->GetDescription(); - Handle(TColStd_HSequenceOfTransient) extremVertices = myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); + Handle(TColStd_HSequenceOfTransient) extremVertices = + myShapesOperations->GetShapesOnBox(box_e, theShape, TopAbs_VERTEX, GEOMAlgo_ST_ONIN); // Recover previous description to get rid of Propagate dump aFunction->SetDescription(theDesc); - + if (extremVertices.IsNull() || extremVertices->Length() == 0) { if (theRF == 0) - SetErrorCode("Vertices on chamfer not found"); + SetErrorCode("Vertices on chamfer not found"); else - SetErrorCode("Vertices on fillet not found"); + SetErrorCode("Vertices on fillet not found"); return false; } - + theShapes.push_back(theShape); theShapes.push_back(box_e); if (extremVertices->Length() != 6) { @@ -789,29 +808,29 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t SetErrorCode("Bad number of vertices on chamfer found"); return false; } - + for (int i=1; i<=extremVertices->Length(); i++){ Handle(GEOM_Object) aV = Handle(GEOM_Object)::DownCast(extremVertices->Value(i)); aV->GetLastFunction()->SetDescription(""); gp_Pnt aP = BRep_Tool::Pnt(TopoDS::Vertex(aV->GetValue())); if (Abs(aP.X()) <= Precision::Confusion()) { - if (Abs(aP.Y()) - theR2 > Precision::Confusion()) { - LX.push_back(i); - if (aP.Z()-ZX > Precision::Confusion()) { - ZX = aP.Z(); - PZX = i; - } - } + if (Abs(aP.Y()) - theR2 > Precision::Confusion()) { + LX.push_back(i); + if (aP.Z()-ZX > Precision::Confusion()) { + ZX = aP.Z(); + PZX = i; + } + } } else { - if (Abs(aP.X()) - theR2 > Precision::Confusion()) { - LY.push_back(i); - if (aP.Z() - ZY > Precision::Confusion()) { - ZY = aP.Z(); - PZY = i; - } - } + if (Abs(aP.X()) - theR2 > Precision::Confusion()) { + LY.push_back(i); + if (aP.Z() - ZY > Precision::Confusion()) { + ZY = aP.Z(); + PZY = i; + } + } } } @@ -835,7 +854,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } Cote_1->GetLastFunction()->SetDescription(""); - + Handle(GEOM_Object) Cote_2 = myBasicOperations->MakeLineTwoPnt(vi2, P3); if (Cote_2.IsNull()) { SetErrorCode("Impossible to build edge in thickness"); @@ -852,7 +871,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } edge_chan_princ->GetLastFunction()->SetDescription(""); - + Handle(GEOM_Object) edge_chan_inc = myBlocksOperations->GetEdge(theShape, P2, P4); if (edge_chan_inc.IsNull()) { SetErrorCode("Impossible to find edge on incident pipe"); @@ -865,7 +884,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t edgeList1.push_back(Cote_1); edgeList1.push_back(arete_intersect_int); edgeList1.push_back(Cote_2); - + // std::cerr << "Creating wire 1" << std::endl; wire_t = myShapesOperations->MakeWire(edgeList1, 1e-7); if (wire_t.IsNull()) { @@ -873,7 +892,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } wire_t->GetLastFunction()->SetDescription(""); - + // std::cerr << "Creating face 1" << std::endl; face_t = myShapesOperations->MakeFace(wire_t, false); if (face_t.IsNull()) { @@ -882,7 +901,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t } face_t->GetLastFunction()->SetDescription(""); theShapes.push_back(face_t); - + gp_Pnt aP2 = BRep_Tool::Pnt(TopoDS::Vertex(P2->GetValue())); gp_Pnt aP5 = BRep_Tool::Pnt(TopoDS::Vertex(vi1->GetValue())); double deltaZ = aP2.Z() - aP5.Z(); @@ -912,7 +931,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } Cote_3->GetLastFunction()->SetDescription(""); - + // std::cerr << "Creating new line 2 from 2 previous points" << std::endl; Handle(GEOM_Object) Cote_4 = myBasicOperations->MakeLineTwoPnt(P6bis, P4); if (Cote_4.IsNull()) { @@ -920,7 +939,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t return false; } Cote_4->GetLastFunction()->SetDescription(""); - + // std::cerr << "Creating new line 3 from 2 previous points" << std::endl; Handle(GEOM_Object) Cote_5 = myBasicOperations->MakeLineTwoPnt(P5bis, P6bis); if (Cote_4.IsNull()) { @@ -929,20 +948,21 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t } Cote_5->GetLastFunction()->SetDescription(""); - std::list edgeList2; - edgeList2.push_back(edge_chan_inc); - edgeList2.push_back(Cote_3); - edgeList2.push_back(Cote_5); - edgeList2.push_back(Cote_4); + //std::list edgeList2; + //edgeList2.push_back(edge_chan_inc); + //edgeList2.push_back(Cote_3); + //edgeList2.push_back(Cote_5); + //edgeList2.push_back(Cote_4); // std::cerr << "Creating wire 2" << std::endl; - wire_t2 = myShapesOperations->MakeWire(edgeList2, 1e-7); - if (wire_t2.IsNull()) { - SetErrorCode("Impossible to build wire"); - return false; - } - wire_t2->GetLastFunction()->SetDescription(""); + //wire_t2 = myShapesOperations->MakeWire(edgeList2, 1e-7); + //if (wire_t2.IsNull()) { + // SetErrorCode("Impossible to build wire"); + // return false; + //} + //wire_t2->GetLastFunction()->SetDescription(""); // std::cerr << "Creating face 2" << std::endl; - face_t2 = myShapesOperations->MakeFace(wire_t2, false); + //face_t2 = myShapesOperations->MakeFace(wire_t2, false); + face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, Cote_4, - 2.0*theR2); if (face_t2.IsNull()) { SetErrorCode("Impossible to build face"); return false; @@ -965,7 +985,7 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t theShapes.push_back(aPlnOZ); theShapes.push_back(aPlnOXZ); - + // Partition Handle(TColStd_HSequenceOfTransient) partitionShapes = new TColStd_HSequenceOfTransient; Handle(TColStd_HSequenceOfTransient) theTools = new TColStd_HSequenceOfTransient; Handle(TColStd_HSequenceOfTransient) theKeepInside = new TColStd_HSequenceOfTransient; @@ -979,7 +999,9 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t if (!isNormal) theTools->Append(face_t2); - Handle(GEOM_Object) Te3 = myBooleanOperations->MakePartition(partitionShapes, theTools, theKeepInside, theRemoveInside, TopAbs_SOLID, false, theMaterials, 0, false); + Handle(GEOM_Object) Te3 = myBooleanOperations->MakePartition + (partitionShapes, theTools, theKeepInside, theRemoveInside, + TopAbs_SOLID, false, theMaterials, 0, false); if (Te3.IsNull()) { SetErrorCode("Impossible to build partition of TShape"); // Handle(GEOM_Object) aCompound = myShapesOperations->MakeCompound(theShapes); @@ -989,21 +1011,26 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapePartition(Handle(GEOM_Object) t } Te3->GetLastFunction()->SetDescription(""); - + // Last verification: result should be a block + std::list errList; + if (!myBlocksOperations->CheckCompoundOfBlocks(Te3,errList)) { + SetErrorCode("TShape is not a block"); + return false; + } TopoDS_Shape aShape = Te3->GetValue(); theShape->GetLastFunction()->SetValue(aShape); - + SetErrorCode(OK); return true; } // Mirror and glue faces -bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2) +bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape, + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2) { SetErrorCode(KO); - + // Useful values double aSize = 2*(theL1 + theL2); double aR1Ext = theR1 + theW1; @@ -1087,8 +1114,8 @@ bool GEOMImpl_IAdvancedOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Objec //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - bool theHexMesh) + double theR2, double theW2, double theL2, + bool theHexMesh) { MESSAGE("GEOMImpl_IAdvancedOperations::MakePipeTShape"); SetErrorCode(KO); @@ -1126,7 +1153,7 @@ GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double SetErrorCode(aFail->GetMessageString()); return NULL; } - + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2)) return NULL; @@ -1141,8 +1168,15 @@ GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double /* * Get the groups: BEGIN */ - if (!MakeGroups(aShape, TSHAPE_BASIC, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) + try { + if (!MakeGroups(aShape, TSHAPE_BASIC, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) + return NULL; + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); return NULL; + } TCollection_AsciiString aListRes, anEntry; // Iterate over the sequence aSeq @@ -1161,17 +1195,19 @@ GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() << "] = geompy.MakePipeTShape(" - << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " - << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() << "] = geompy.MakePipeTShape(" + << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " + << theHexMesh << ")"; } /* * Get the groups: END */ else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShape(" << theR1 << ", " << theW1 << ", " - << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShape(" << theR1 << ", " << theW1 << ", " + << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theHexMesh << ")"; } SetErrorCode(OK); @@ -1201,11 +1237,11 @@ GEOMImpl_IAdvancedOperations::MakePipeTShape(double theR1, double theW1, double //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - bool theHexMesh, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3) + double theR2, double theW2, double theL2, + bool theHexMesh, + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3) { SetErrorCode(KO); //Add a new object @@ -1249,7 +1285,7 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th SetErrorCode(aFail->GetMessageString()); return NULL; } - + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2)) return NULL; @@ -1271,7 +1307,14 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th // // Get the groups: BEGIN // - if (!MakeGroups(aShape,TSHAPE_BASIC, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, aTrsf)) { + try { + if (!MakeGroups(aShape,TSHAPE_BASIC, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, aTrsf)) { + return NULL; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); return NULL; } @@ -1292,9 +1335,10 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() << "] = geompy.MakePipeTShape(" - << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " - << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() << "] = geompy.MakePipeTShape(" + << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " + << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; } // // Get the groups: END @@ -1302,9 +1346,10 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShape(" << theR1 << ", " << theW1 << ", " - << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theHexMesh << ", " << theP1 - << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShape(" << theR1 << ", " << theW1 << ", " + << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theHexMesh << ", " << theP1 + << ", " << theP2 << ", " << theP3 << ")"; } SetErrorCode(OK); @@ -1333,9 +1378,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeWithPosition(double theR1, double th //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - bool theHexMesh) + double theR2, double theW2, double theL2, + double theH, double theW, + bool theHexMesh) { SetErrorCode(KO); //Add a new object @@ -1389,8 +1434,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, box_e->GetLastFunction()->SetDescription(""); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e->GetLastFunction()->SetDescription(""); - - Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + + Handle(TColStd_HSequenceOfInteger) edges_e = + myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); box_e->GetLastFunction()->SetDescription(""); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -1408,8 +1454,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, iv ++; gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) { - nbEdgesInChamfer ++; - theEdges.push_back(edgeID); + nbEdgesInChamfer ++; + theEdges.push_back(edgeID); } Ex.Next(); } @@ -1430,7 +1476,7 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, return NULL; } aChamfer->GetLastFunction()->SetDescription(""); - + TopoDS_Shape aChamferShape = aChamfer->GetValue(); aFunction->SetValue(aChamferShape); // END of chamfer @@ -1458,15 +1504,23 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, // // Get the groups: BEGIN // - // if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) { - // //Make a Python command - // GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 - // << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW - // << ", " << theHexMesh << ")"; - // } - // else { - if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) + //if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) { + // //Make a Python command + // GEOM::TPythonDump(aFunction) + // << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 + // << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW + // << ", " << theHexMesh << ")"; + //} + //else { + try { + if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) + return NULL; + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); return NULL; + } TCollection_AsciiString aListRes, anEntry; // Iterate over the sequence aSeq @@ -1485,19 +1539,21 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() - << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 - << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ")"; - // } + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() + << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 + << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ")"; + //} } // // Get the groups: END // else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 - << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW - << ", " << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 + << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW + << ", " << theHexMesh << ")"; } SetErrorCode(OK); @@ -1530,12 +1586,12 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamfer(double theR1, double theW1, //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - bool theHexMesh, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3) + double theR2, double theW2, double theL2, + double theH, double theW, + bool theHexMesh, + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3) { SetErrorCode(KO); //Add a new object @@ -1594,8 +1650,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do box_e->GetLastFunction()->SetDescription(""); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e->GetLastFunction()->SetDescription(""); - - Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + + Handle(TColStd_HSequenceOfInteger) edges_e = + myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); box_e->GetLastFunction()->SetDescription(""); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -1611,8 +1668,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do while (Ex.More()) { gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) { - nbEdgesInChamfer ++; - theEdges.push_back(edgeID); + nbEdgesInChamfer ++; + theEdges.push_back(edgeID); } Ex.Next(); } @@ -1633,11 +1690,11 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do return NULL; } aChamfer->GetLastFunction()->SetDescription(""); - + TopoDS_Shape aChamferShape = aChamfer->GetValue(); aFunction->SetValue(aChamferShape); // END of chamfer - + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, 0, false)) return NULL; @@ -1658,8 +1715,15 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do /* * Get the groups: BEGIN */ - if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, aTrsf)) + try { + if (!MakeGroups(aShape, TSHAPE_CHAMFER, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, aTrsf)) + return NULL; + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); return NULL; + } TCollection_AsciiString aListRes, anEntry; // Iterate over the sequence aSeq @@ -1678,19 +1742,21 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() - << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 - << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ", " - << theP1 << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() + << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 + << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW << ", " << theHexMesh << ", " + << theP1 << ", " << theP2 << ", " << theP3 << ")"; } /* * Get the groups: END */ else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 - << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW - << ", " << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShapeChamfer(" << theR1 << ", " << theW1 + << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theH << ", " << theW + << ", " << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; } SetErrorCode(OK); @@ -1718,8 +1784,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeChamferWithPosition(double theR1, do //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theRF, bool theHexMesh) + double theR2, double theW2, double theL2, + double theRF, bool theHexMesh) { SetErrorCode(KO); //Add a new object @@ -1772,8 +1838,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d box_e->GetLastFunction()->SetDescription(""); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e->GetLastFunction()->SetDescription(""); - - Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + + Handle(TColStd_HSequenceOfInteger) edges_e = + myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); box_e->GetLastFunction()->SetDescription(""); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -1789,8 +1856,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d while (Ex.More()) { gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) { - nbEdgesInFillet ++; - theEdges.push_back(edgeID); + nbEdgesInFillet ++; + theEdges.push_back(edgeID); } Ex.Next(); } @@ -1808,15 +1875,23 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d return NULL; } if (aFillet.IsNull()) { - SetErrorCode("Fillet can not be computed on the given shape with the given parameters"); + //SetErrorCode("Fillet can not be computed on the given shape with the given parameters"); + SetErrorCode(myLocalOperations->GetErrorCode()); return NULL; } aFillet->GetLastFunction()->SetDescription(""); - + TopoDS_Shape aFilletShape = aFillet->GetValue(); aFunction->SetValue(aFilletShape); // END of fillet + // BEGIN: Limit tolerances (debug) + Handle(GEOM_Object) aCorr1 = myHealingOperations->LimitTolerance(aShape, 1e-07); + TopoDS_Shape aCorr1Shape = aCorr1->GetValue(); + aShape->GetLastFunction()->SetValue(aCorr1Shape); + aCorr1->GetLastFunction()->SetDescription(""); + // END: Limit tolerances (debug) + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false)) return NULL; @@ -1830,8 +1905,15 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d /* * Get the groups: BEGIN */ - if (!MakeGroups(aShape, TSHAPE_FILLET, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) + try { + if (!MakeGroups(aShape, TSHAPE_FILLET, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, gp_Trsf())) + return NULL; + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); return NULL; + } TCollection_AsciiString aListRes, anEntry; // Iterate over the sequence aSeq @@ -1850,25 +1932,25 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() - << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 - << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() + << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 + << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " << theHexMesh << ")"; } /* * Get the groups: END */ else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 - << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " - << theHexMesh << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 + << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " + << theHexMesh << ")"; } - SetErrorCode(OK); return aSeq; - } //============================================================================= @@ -1895,11 +1977,11 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFillet(double theR1, double theW1, d //============================================================================= Handle(TColStd_HSequenceOfTransient) GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theRF, bool theHexMesh, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3) + double theR2, double theW2, double theL2, + double theRF, bool theHexMesh, + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3) { SetErrorCode(KO); //Add a new object @@ -1957,8 +2039,9 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou box_e->GetLastFunction()->SetDescription(""); box_e = myTransformOperations->TranslateDXDYDZ(box_e, -(theR2+theW2), -(theR2+theW2), 0); box_e->GetLastFunction()->SetDescription(""); - - Handle(TColStd_HSequenceOfInteger) edges_e = myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); + + Handle(TColStd_HSequenceOfInteger) edges_e = + myShapesOperations->GetShapesOnBoxIDs(box_e, aShape, TopAbs_EDGE, GEOMAlgo_ST_IN); box_e->GetLastFunction()->SetDescription(""); if (edges_e.IsNull() || edges_e->Length() == 0) { @@ -1974,8 +2057,8 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou while (Ex.More()) { gp_Pnt aPt = BRep_Tool::Pnt(TopoDS::Vertex(Ex.Current())); if (Abs(aPt.Z() - (theR1+theW1)) <= Precision::Confusion()) { - nbEdgesInFillet ++; - theEdges.push_back(edgeID); + nbEdgesInFillet ++; + theEdges.push_back(edgeID); } Ex.Next(); } @@ -1997,11 +2080,18 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou return NULL; } aFillet->GetLastFunction()->SetDescription(""); - + TopoDS_Shape aFilletShape = aFillet->GetValue(); aFunction->SetValue(aFilletShape); // END of fillet + // BEGIN: Limit tolerances (debug) + Handle(GEOM_Object) aCorr1 = myHealingOperations->LimitTolerance(aShape, 1e-07); + TopoDS_Shape aCorr1Shape = aCorr1->GetValue(); + aShape->GetLastFunction()->SetValue(aCorr1Shape); + aCorr1->GetLastFunction()->SetDescription(""); + // END: Limit tolerances (debug) + if (theHexMesh) { if (!MakePipeTShapePartition(aShape, theR1, theW1, theL1, theR2, theW2, theL2, 0, 0, theRF, false)) return NULL; @@ -2022,8 +2112,15 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou /* * Get the groups: BEGIN */ - if (!MakeGroups(aShape, TSHAPE_FILLET, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, aTrsf)) + try { + if (!MakeGroups(aShape, TSHAPE_FILLET, theR1, theW1, theL1, theR2, theW2, theL2, aSeq, aTrsf)) + return NULL; + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); return NULL; + } TCollection_AsciiString aListRes, anEntry; // Iterate over the sequence aSeq @@ -2042,19 +2139,21 @@ GEOMImpl_IAdvancedOperations::MakePipeTShapeFilletWithPosition(double theR1, dou aListRes.Trunc(aListRes.Length() - 2); //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << ", " << aListRes.ToCString() - << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 - << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " << theHexMesh << ", " << theP1 << ", " - << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << ", " << aListRes.ToCString() + << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 << ", " << theL1 << ", " << theR2 + << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " << theHexMesh << ", " << theP1 << ", " + << theP2 << ", " << theP3 << ")"; } /* * Get the groups: END */ else { //Make a Python command - GEOM::TPythonDump(aFunction) << "[" << aShape << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 - << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " - << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; + GEOM::TPythonDump(aFunction) + << "[" << aShape << "] = geompy.MakePipeTShapeFillet(" << theR1 << ", " << theW1 + << ", " << theL1 << ", " << theR2 << ", " << theW2 << ", " << theL2 << ", " << theRF << ", " + << theHexMesh << ", " << theP1 << ", " << theP2 << ", " << theP3 << ")"; } SetErrorCode(OK); diff --git a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx index 2b7b91892..ee5e5347d 100644 --- a/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IAdvancedOperations.hxx @@ -16,10 +16,9 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // - // File : GEOMImpl_IAdvancedOperations.hxx // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) -// + #ifndef _GEOMImpl_IAdvancedOperations_HXX_ #define _GEOMImpl_IAdvancedOperations_HXX_ @@ -35,31 +34,32 @@ class GEOMImpl_ITransformOperations; class GEOMImpl_IBlocksOperations; class GEOMImpl_I3DPrimOperations; class GEOMImpl_ILocalOperations; +class GEOMImpl_IHealingOperations; class GEOMImpl_IAdvancedOperations: public GEOM_IOperations { private: bool MakePipeTShapePartition(Handle(GEOM_Object) theShape, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH = 0, double theW = 0, - double theRF = 0, bool isNormal = true); + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2, + double theH = 0, double theW = 0, + double theRF = 0, bool isNormal = true); bool MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2); + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2); bool MakeGroups(Handle(GEOM_Object) theShape, int shapType, - double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - Handle(TColStd_HSequenceOfTransient) theSeq, - gp_Trsf aTrsf); + double theR1, double theW1, double theL1, + double theR2, double theW2, double theL2, + Handle(TColStd_HSequenceOfTransient) theSeq, + gp_Trsf aTrsf); gp_Trsf GetPositionTrsf(double theL1, double theL2, - Handle(GEOM_Object) P1 = 0, - Handle(GEOM_Object) P2 = 0, - Handle(GEOM_Object) P3 = 0); + Handle(GEOM_Object) P1 = 0, + Handle(GEOM_Object) P2 = 0, + Handle(GEOM_Object) P3 = 0); bool CheckCompatiblePosition(double& theL1, double& theL2, - Handle(GEOM_Object) theP1, - Handle(GEOM_Object) theP2, - Handle(GEOM_Object) theP3, - double theTolerance); + Handle(GEOM_Object) theP1, + Handle(GEOM_Object) theP2, + Handle(GEOM_Object) theP3, + double theTolerance); private: GEOMImpl_IBasicOperations* myBasicOperations; GEOMImpl_IBooleanOperations* myBooleanOperations; @@ -68,6 +68,7 @@ private: GEOMImpl_IBlocksOperations* myBlocksOperations; GEOMImpl_I3DPrimOperations* my3DPrimOperations; GEOMImpl_ILocalOperations* myLocalOperations; + GEOMImpl_IHealingOperations* myHealingOperations; public: Standard_EXPORT GEOMImpl_IAdvancedOperations(GEOM_Engine* theEngine, int theDocID); @@ -75,39 +76,39 @@ public: Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShape(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - bool theHexMesh = true); + double theR2, double theW2, double theL2, + bool theHexMesh = true); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - bool theHexMesh = true, - Handle(GEOM_Object) P1 = 0, - Handle(GEOM_Object) P2 = 0, - Handle(GEOM_Object) P3 = 0); + double theR2, double theW2, double theL2, + bool theHexMesh = true, + Handle(GEOM_Object) P1 = 0, + Handle(GEOM_Object) P2 = 0, + Handle(GEOM_Object) P3 = 0); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeChamfer(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - bool theHexMesh = true); + double theR2, double theW2, double theL2, + double theH, double theW, + bool theHexMesh = true); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeChamferWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theH, double theW, - bool theHexMesh = true, - Handle(GEOM_Object) P1 = 0, - Handle(GEOM_Object) P2 = 0, - Handle(GEOM_Object) P3 = 0); + double theR2, double theW2, double theL2, + double theH, double theW, + bool theHexMesh = true, + Handle(GEOM_Object) P1 = 0, + Handle(GEOM_Object) P2 = 0, + Handle(GEOM_Object) P3 = 0); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeFillet(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theRF, bool theHexMesh = true); + double theR2, double theW2, double theL2, + double theRF, bool theHexMesh = true); Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeTShapeFilletWithPosition(double theR1, double theW1, double theL1, - double theR2, double theW2, double theL2, - double theRF, bool theHexMesh = true, - Handle(GEOM_Object) P1 = 0, - Handle(GEOM_Object) P2 = 0, - Handle(GEOM_Object) P3 = 0); + double theR2, double theW2, double theL2, + double theRF, bool theHexMesh = true, + Handle(GEOM_Object) P1 = 0, + Handle(GEOM_Object) P2 = 0, + Handle(GEOM_Object) P3 = 0); /*@@ insert new functions before this line @@ do not remove this line @@*/ }; #endif diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx index 3aeca3008..b4c4ebd77 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx @@ -569,6 +569,81 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetPoint return aResult; } +//============================================================================= +/*! + * GetVertexNearPoint + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetVertexNearPoint + (Handle(GEOM_Object) theShape, + Handle(GEOM_Object) thePoint) +{ + SetErrorCode(KO); + + // New Point object + Handle(GEOM_Object) aResult; + + // Arguments + if (theShape.IsNull() || thePoint.IsNull()) return NULL; + + TopoDS_Shape aBlockOrComp = theShape->GetValue(); + TopoDS_Shape aPoint = thePoint->GetValue(); + if (aBlockOrComp.IsNull() || aPoint.IsNull()) { + SetErrorCode("Given shape is null"); + return NULL; + } + + if (aPoint.ShapeType() != TopAbs_VERTEX) { + SetErrorCode("Element for vertex identification is not a vertex"); + return NULL; + } + + TopoDS_Vertex aVert = TopoDS::Vertex(aPoint); + gp_Pnt aP = BRep_Tool::Pnt(aVert); + + // Compute the Vertex value + TopoDS_Shape V; + bool isFound = false; + Standard_Real aDist = RealLast(); + TopTools_MapOfShape mapShape; + + TopExp_Explorer exp (aBlockOrComp, TopAbs_VERTEX); + for (; exp.More(); exp.Next()) { + if (mapShape.Add(exp.Current())) { + TopoDS_Vertex aVi = TopoDS::Vertex(exp.Current()); + gp_Pnt aPi = BRep_Tool::Pnt(aVi); + Standard_Real aDisti = aPi.Distance(aP); + if (aDisti < aDist) { + V = aVi; + aDist = aDisti; + isFound = true; + } + } + } + + if (!isFound) { + SetErrorCode("Vertex has not been found"); + return NULL; + } + + TopTools_IndexedMapOfShape anIndices; + TopExp::MapShapes(aBlockOrComp, anIndices); + Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1,1); + anArray->SetValue(1, anIndices.FindIndex(V)); + aResult = GetEngine()->AddSubShape(theShape, anArray); + + // The GetPoint() doesn't change object so no new function is required. + Handle(GEOM_Function) aFunction = theShape->GetLastFunction(); + + // Make a Python command + GEOM::TPythonDump(aFunction, /*append=*/true) + << aResult << " = geompy.GetVertexNearPoint(" + << theShape << ", " << thePoint << ")"; + + SetErrorCode(OK); + return aResult; +} + //============================================================================= /*! * GetEdge @@ -1458,6 +1533,136 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetFaceByNormale return aResult; } +//============================================================================= +/*! + * GetShapesNearPoint + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetShapesNearPoint + (Handle(GEOM_Object) theShape, + Handle(GEOM_Object) thePoint, + const Standard_Integer theShapeType, + const Standard_Real theTolerance) +{ + SetErrorCode(KO); + + // New object + Handle(GEOM_Object) aResult; + + // Arguments + if (theShape.IsNull() || thePoint.IsNull()) return NULL; + + TopoDS_Shape aBlockOrComp = theShape->GetValue(); + if (aBlockOrComp.IsNull()) { + SetErrorCode("Block or compound is null"); + return NULL; + } + + TopoDS_Shape anArg = thePoint->GetValue(); + if (anArg.IsNull()) { + SetErrorCode("Null shape is given as argument"); + return NULL; + } + if (anArg.ShapeType() != TopAbs_VERTEX) { + SetErrorCode("Element for face identification is not a vertex"); + return NULL; + } + + if (theShapeType < TopAbs_SOLID || TopAbs_VERTEX < theShapeType) { + SetErrorCode("Invalid type of result is requested"); + return NULL; + } + + if (theTolerance < Precision::Confusion()) { + theTolerance == Precision::Confusion(); + } + + // Compute the result + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + TopoDS_Vertex aVert = TopoDS::Vertex(anArg); + + TopTools_MapOfShape mapShape; + Standard_Integer nbEdges = 0; + TopExp_Explorer exp (aBlockOrComp, TopAbs_ShapeEnum(theShapeType)); + for (; exp.More(); exp.Next()) { + if (mapShape.Add(exp.Current())) { + nbEdges++; + } + } + + if (nbEdges == 0) { + SetErrorCode("Given shape contains no subshapes of requested type"); + return NULL; + } + + // Calculate distances and find min + mapShape.Clear(); + Standard_Integer ind = 1; + Standard_Real aMinDist = RealLast(); + TopTools_Array1OfShape anEdges (1, nbEdges); + TColStd_Array1OfReal aDistances (1, nbEdges); + for (exp.Init(aBlockOrComp, TopAbs_ShapeEnum(theShapeType)); exp.More(); exp.Next()) { + if (mapShape.Add(exp.Current())) { + TopoDS_Shape anEdge = exp.Current(); + anEdges(ind) = anEdge; + + BRepExtrema_DistShapeShape aDistTool (aVert, anEdges(ind)); + if (!aDistTool.IsDone()) { + SetErrorCode("Can not find a distance from the given point to one of subshapes"); + return NULL; + } + aDistances(ind) = aDistTool.Value(); + if (aDistances(ind) < aMinDist) { + aMinDist = aDistances(ind); + } + ind++; + } + } + + if (aMinDist < RealLast()) { + // Collect subshapes with distance < (aMinDist + theTolerance) + int nbSubShapes = 0; + TopTools_Array1OfShape aNearShapes (1, nbEdges); + for (ind = 1; ind <= nbEdges; ind++) { + if (aDistances(ind) < aMinDist + theTolerance) { + nbSubShapes++; + aNearShapes(nbSubShapes) = anEdges(ind); + } + } + + // Add subshape + TopTools_IndexedMapOfShape anIndices; + TopExp::MapShapes(aBlockOrComp, anIndices); + Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger (1, nbSubShapes); + for (ind = 1; ind <= nbSubShapes; ind++) { + anArray->SetValue(ind, anIndices.FindIndex(aNearShapes(ind))); + } + aResult = GetEngine()->AddSubShape(theShape, anArray); + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return NULL; + } + + if (aResult.IsNull()) + return NULL; + + Handle(GEOM_Function) aFunction = aResult->GetLastFunction(); + + //Make a Python command + GEOM::TPythonDump(aFunction) + << aResult << " = geompy.GetShapesNearPoint(" << theShape << ", " << thePoint + << ", " << TopAbs_ShapeEnum(theShapeType) << ", " << theTolerance << ")"; + + SetErrorCode(OK); + return aResult; +} + //============================================================================= /*! * IsCompoundOfBlocks diff --git a/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx b/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx index c5ce21151..43caa5883 100644 --- a/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx @@ -18,7 +18,6 @@ // 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 _GEOMImpl_IBlocksOperations_HXX_ #define _GEOMImpl_IBlocksOperations_HXX_ @@ -41,68 +40,76 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations { // Creation of blocks and block faces Standard_EXPORT Handle(GEOM_Object) MakeQuad (Handle(GEOM_Object) theEdge1, - Handle(GEOM_Object) theEdge2, - Handle(GEOM_Object) theEdge3, - Handle(GEOM_Object) theEdge4); + Handle(GEOM_Object) theEdge2, + Handle(GEOM_Object) theEdge3, + Handle(GEOM_Object) theEdge4); Standard_EXPORT Handle(GEOM_Object) MakeQuad2Edges (Handle(GEOM_Object) theEdge1, - Handle(GEOM_Object) theEdge2); + Handle(GEOM_Object) theEdge2); Standard_EXPORT Handle(GEOM_Object) MakeQuad4Vertices (Handle(GEOM_Object) thePoint1, - Handle(GEOM_Object) thePoint2, - Handle(GEOM_Object) thePoint3, - Handle(GEOM_Object) thePoint4); + Handle(GEOM_Object) thePoint2, + Handle(GEOM_Object) thePoint3, + Handle(GEOM_Object) thePoint4); Standard_EXPORT Handle(GEOM_Object) MakeHexa (Handle(GEOM_Object) theFace1, - Handle(GEOM_Object) theFace2, - Handle(GEOM_Object) theFace3, - Handle(GEOM_Object) theFace4, - Handle(GEOM_Object) theFace5, - Handle(GEOM_Object) theFace6); + Handle(GEOM_Object) theFace2, + Handle(GEOM_Object) theFace3, + Handle(GEOM_Object) theFace4, + Handle(GEOM_Object) theFace5, + Handle(GEOM_Object) theFace6); Standard_EXPORT Handle(GEOM_Object) MakeHexa2Faces (Handle(GEOM_Object) theFace1, - Handle(GEOM_Object) theFace2); + Handle(GEOM_Object) theFace2); Standard_EXPORT Handle(GEOM_Object) MakeBlockCompound (Handle(GEOM_Object) theCompound); // Extract elements of blocks and blocks compounds Standard_EXPORT Handle(GEOM_Object) GetPoint (Handle(GEOM_Object) theShape, - const Standard_Real theX, - const Standard_Real theY, - const Standard_Real theZ, - const Standard_Real theEpsilon); + const Standard_Real theX, + const Standard_Real theY, + const Standard_Real theZ, + const Standard_Real theEpsilon); + + Standard_EXPORT Handle(GEOM_Object) GetVertexNearPoint (Handle(GEOM_Object) theShape, + Handle(GEOM_Object) thePoint); Standard_EXPORT Handle(GEOM_Object) GetEdge (Handle(GEOM_Object) theShape, - Handle(GEOM_Object) thePoint1, - Handle(GEOM_Object) thePoint2); + Handle(GEOM_Object) thePoint1, + Handle(GEOM_Object) thePoint2); Standard_EXPORT Handle(GEOM_Object) GetEdgeNearPoint (Handle(GEOM_Object) theBlock, - Handle(GEOM_Object) thePoint); + Handle(GEOM_Object) thePoint); Standard_EXPORT Handle(GEOM_Object) GetFaceByPoints (Handle(GEOM_Object) theShape, - Handle(GEOM_Object) thePoint1, - Handle(GEOM_Object) thePoint2, - Handle(GEOM_Object) thePoint3, - Handle(GEOM_Object) thePoint4); + Handle(GEOM_Object) thePoint1, + Handle(GEOM_Object) thePoint2, + Handle(GEOM_Object) thePoint3, + Handle(GEOM_Object) thePoint4); Standard_EXPORT Handle(GEOM_Object) GetFaceByEdges (Handle(GEOM_Object) theShape, - Handle(GEOM_Object) theEdge1, - Handle(GEOM_Object) theEdge2); + Handle(GEOM_Object) theEdge1, + Handle(GEOM_Object) theEdge2); Standard_EXPORT Handle(GEOM_Object) GetOppositeFace (Handle(GEOM_Object) theBlock, - Handle(GEOM_Object) theFace); + Handle(GEOM_Object) theFace); Standard_EXPORT Handle(GEOM_Object) GetFaceNearPoint (Handle(GEOM_Object) theBlock, - Handle(GEOM_Object) thePoint); + Handle(GEOM_Object) thePoint); Standard_EXPORT Handle(GEOM_Object) GetFaceByNormale (Handle(GEOM_Object) theBlock, - Handle(GEOM_Object) theVector); + Handle(GEOM_Object) theVector); + + Standard_EXPORT Handle(GEOM_Object) GetShapesNearPoint (Handle(GEOM_Object) theShape, + Handle(GEOM_Object) thePoint, + const Standard_Integer theShapeType, + const Standard_Real theTolerance); // Check blocks compounds Standard_EXPORT Standard_Boolean IsCompoundOfBlocks (Handle(GEOM_Object) theCompound, - const Standard_Integer theMinNbFaces, - const Standard_Integer theMaxNbFaces, - Standard_Integer& theNbBlocks); + const Standard_Integer theMinNbFaces, + const Standard_Integer theMaxNbFaces, + Standard_Integer& theNbBlocks); enum BCErrorType { NOT_BLOCK, @@ -118,13 +125,13 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations { }; Standard_EXPORT Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound, - std::list& theErrors); + std::list& theErrors); Standard_EXPORT Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound, - std::list& theErrors); + std::list& theErrors); Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object) theCompound, - const std::list& theErrors); + const std::list& theErrors); Standard_EXPORT Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape, const Standard_Integer theOptimumNbFaces = 6); @@ -132,9 +139,9 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations { Standard_EXPORT Handle(GEOM_Object) CheckAndImprove (Handle(GEOM_Object) theCompound); Standard_EXPORT static void AddBlocksFrom (const TopoDS_Shape& theShape, - TopTools_ListOfShape& BLO, - TopTools_ListOfShape& NOT, - TopTools_ListOfShape& EXT); + TopTools_ListOfShape& BLO, + TopTools_ListOfShape& NOT, + TopTools_ListOfShape& EXT); // Extract blocks from blocks compounds Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks @@ -143,7 +150,7 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations { const Standard_Integer theMaxNbFaces); Standard_EXPORT Handle(GEOM_Object) GetBlockNearPoint (Handle(GEOM_Object) theCompound, - Handle(GEOM_Object) thePoint); + Handle(GEOM_Object) thePoint); Standard_EXPORT Handle(GEOM_Object) GetBlockByParts (Handle(GEOM_Object) theCompound, @@ -155,17 +162,17 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations { // Operations on blocks with gluing of result Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation1D (Handle(GEOM_Object) theBlock, - const Standard_Integer theDirFace1, - const Standard_Integer theDirFace2, - const Standard_Integer theNbTimes); + const Standard_Integer theDirFace1, + const Standard_Integer theDirFace2, + const Standard_Integer theNbTimes); Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation2D (Handle(GEOM_Object) theBlock, - const Standard_Integer theDirFace1U, - const Standard_Integer theDirFace2U, - const Standard_Integer theNbTimesU, - const Standard_Integer theDirFace1V, - const Standard_Integer theDirFace2V, - const Standard_Integer theNbTimesV); + const Standard_Integer theDirFace1U, + const Standard_Integer theDirFace2U, + const Standard_Integer theNbTimesU, + const Standard_Integer theDirFace1V, + const Standard_Integer theDirFace2V, + const Standard_Integer theNbTimesV); // Build groups for Propagation of 1D hypotheses Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Propagate (Handle(GEOM_Object) theShape); diff --git a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx index 0d7ce4435..cf81ed23c 100644 --- a/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IGroupOperations.cxx @@ -18,7 +18,6 @@ // 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 diff --git a/src/GEOMImpl/GEOMImpl_IHealing.hxx b/src/GEOMImpl/GEOMImpl_IHealing.hxx index 07252ac76..5a9d26455 100755 --- a/src/GEOMImpl/GEOMImpl_IHealing.hxx +++ b/src/GEOMImpl/GEOMImpl_IHealing.hxx @@ -19,9 +19,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// NOTE: This is an intreface to a function for the Healing creation. -//NOTE: This is an intreface to a function for the Healing creation. -// #include "GEOM_Function.hxx" #include @@ -76,7 +75,7 @@ public: void SetIndex( Standard_Integer val ) { _func->SetInteger(ARG_SUBSHAPE_INDEX, val); } Standard_Integer GetIndex() { return _func->GetInteger(ARG_SUBSHAPE_INDEX); } - + private: - Handle(GEOM_Function) _func; + Handle(GEOM_Function) _func; }; diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx index d78c82d4e..e19acd19a 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifdef WNT #pragma warning( disable:4786 ) @@ -864,7 +863,6 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_ return theObject; } - //============================================================================= /*! * ChangeOrientationCopy @@ -921,3 +919,62 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G SetErrorCode(OK); return aNewObject; } + +//============================================================================= +/*! + * LimitTolerance + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Object) theObject, + double theTolerance) +{ + // Set error code, check parameters + SetErrorCode(KO); + + if (theObject.IsNull()) + return NULL; + + Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction(); + if (aLastFunction.IsNull()) + return NULL; // There is no function which creates an object to be processed + + // Add a new object + Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), theObject->GetType()); + + // Add the function + aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), LIMIT_TOLERANCE); + + if (aFunction.IsNull()) + return NULL; + + // Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL; + + // Prepare "data container" class IHealing + GEOMImpl_IHealing HI (aFunction); + HI.SetOriginal(aLastFunction); + HI.SetTolerance(theTolerance); + + // Compute + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("Healing driver failed"); + return NULL; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return NULL; + } + + // Make a Python command + GEOM::TPythonDump(aFunction) << aNewObject << " = geompy.LimitTolerance(" + << theObject << ", " << theTolerance << ")"; + + SetErrorCode(OK); + return aNewObject; +} diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx index aafa9687d..064194fdd 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.hxx @@ -18,7 +18,6 @@ // 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 _GEOMImpl_IHealingOperations_HXX_ #define _GEOMImpl_IHealingOperations_HXX_ @@ -39,9 +38,9 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations { // Apply Shape Processing to the selected Object Standard_EXPORT Handle(GEOM_Object) ShapeProcess( Handle(GEOM_Object) theObject, - const Handle(TColStd_HArray1OfExtendedString)& theOperations, - const Handle(TColStd_HArray1OfExtendedString)& theParams, - const Handle(TColStd_HArray1OfExtendedString)& theValues ); + const Handle(TColStd_HArray1OfExtendedString)& theOperations, + const Handle(TColStd_HArray1OfExtendedString)& theParams, + const Handle(TColStd_HArray1OfExtendedString)& theValues ); // Retrieve default Shape Process parameters (from resource file) Standard_EXPORT void GetShapeProcessParameters( std::list& theOperations, @@ -49,12 +48,13 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations { std::list& theValues ); // Retrieve default Shape Process parameters for given operator - Standard_EXPORT bool GetOperatorParameters( const std::string theOperation, + Standard_EXPORT bool GetOperatorParameters( const std::string theOperation, std::list& theParams, std::list& theValues ); // returns all parameters that are valid for the given operation (Shape Process operator) - Standard_EXPORT static bool GetParameters( const std::string theOperation, std::list& theParams ); + Standard_EXPORT static bool GetParameters( const std::string theOperation, + std::list& theParams ); Standard_EXPORT Handle(GEOM_Object) SuppressFaces( Handle(GEOM_Object) theObject, const Handle(TColStd_HArray1OfInteger)& theFaces); @@ -68,25 +68,28 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations { Standard_EXPORT Handle(GEOM_Object) FillHoles( Handle(GEOM_Object) theObject, const Handle(TColStd_HArray1OfInteger)& theWires); - + Standard_EXPORT Handle(GEOM_Object) Sew( Handle(GEOM_Object) theObject, double theTolerance ); Standard_EXPORT Handle(GEOM_Object) DivideEdge( Handle(GEOM_Object) theObject, - int theIndex, - double theValue, - bool isByParameter ); + int theIndex, + double theValue, + bool isByParameter ); // this function does not use Function-Driver mechanism, it just computes the free // boundary edges and returns them in the sequence. It is called just for information reasons // and it's not intended for history/undo/redo/etc.. - Standard_EXPORT bool GetFreeBoundary ( Handle(GEOM_Object) theObject, - Handle(TColStd_HSequenceOfTransient)& theOutClosedWires, + Standard_EXPORT bool GetFreeBoundary ( Handle(GEOM_Object) theObject, + Handle(TColStd_HSequenceOfTransient)& theOutClosedWires, Handle(TColStd_HSequenceOfTransient)& theOutOpenWires ); Standard_EXPORT Handle(GEOM_Object) ChangeOrientation( Handle(GEOM_Object) theObject); Standard_EXPORT Handle(GEOM_Object) ChangeOrientationCopy( Handle(GEOM_Object) theObject); + Standard_EXPORT Handle(GEOM_Object) LimitTolerance( Handle(GEOM_Object) theObject, + double theTolerance ); + }; #endif diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index c62f4ac26..d0ac43e7c 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -1479,7 +1479,8 @@ static double CheckSingularCase(const TopoDS_Shape& aSh1, if( sh.ShapeType()==TopAbs_SHELL || sh.ShapeType()==TopAbs_FACE ) { // non solid case double U1,U2,V1,V2; - S->Bounds(U1,U2,V1,V2); + //S->Bounds(U1,U2,V1,V2); + ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(tmpSh2),U1,U2,V1,V2); Handle(Geom_RectangularTrimmedSurface) TrS1 = new Geom_RectangularTrimmedSurface(S,U1,(U1+U2)/2.,V1,V2); Handle(Geom_RectangularTrimmedSurface) TrS2 = diff --git a/src/GEOMImpl/GEOMImpl_IShapes.hxx b/src/GEOMImpl/GEOMImpl_IShapes.hxx index cd8dbe705..dcdb59265 100644 --- a/src/GEOMImpl/GEOMImpl_IShapes.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapes.hxx @@ -38,7 +38,8 @@ class GEOMImpl_IShapes SHAPE_ARG_PLANAR = 3, // for Face SHAPE_ARG_SUBTYPE = 4, // for Sub-shape SHAPE_ARG_INDICES = 5, // for Sub-shape - SHAPE_ARG_TOLERANCE = 6 // for Wire + SHAPE_ARG_TOLERANCE = 6, // linear tolerance (for Wire, Edge) + SHAPE_ARG_ANGLE_TOL = 7, // angular tolerance (for Edge) }; GEOMImpl_IShapes(Handle(GEOM_Function) theFunction): _func(theFunction) {} @@ -75,6 +76,11 @@ class GEOMImpl_IShapes Standard_Real GetTolerance() { return _func->GetReal(SHAPE_ARG_TOLERANCE); } + void SetAngularTolerance(const Standard_Real theValue) + { _func->SetReal(SHAPE_ARG_ANGLE_TOL, theValue); } + + Standard_Real GetAngularTolerance() { return _func->GetReal(SHAPE_ARG_ANGLE_TOL); } + private: Handle(GEOM_Function) _func; diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index 2c5abaecb..6e34f80a0 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -209,6 +210,77 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdge return anEdge; } +//============================================================================= +/*! + * MakeEdgeWire + */ +//============================================================================= +Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeEdgeWire + (Handle(GEOM_Object) theWire, + const Standard_Real theLinearTolerance, + const Standard_Real theAngularTolerance) +{ + SetErrorCode(KO); + + if (theWire.IsNull()) return NULL; + + //Add a new Edge object + Handle(GEOM_Object) anEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE); + + //Add a new Vector function + Handle(GEOM_Function) aFunction = + anEdge->AddFunction(GEOMImpl_ShapeDriver::GetID(), EDGE_WIRE); + + //Check if the function is set correctly + if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL; + + GEOMImpl_IShapes aCI (aFunction); + + Handle(GEOM_Function) aWire = theWire->GetLastFunction(); + + if (aWire.IsNull()) return NULL; + + aCI.SetBase(aWire); + aCI.SetTolerance(theLinearTolerance); + aCI.SetAngularTolerance(theAngularTolerance); + + //Compute the Edge value + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + if (!GetSolver()->ComputeFunction(aFunction)) { + SetErrorCode("Shape driver failed"); + return NULL; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return NULL; + } + + const double DEF_LIN_TOL = Precision::Confusion(); + const double DEF_ANG_TOL = Precision::Angular(); + //Make a Python command + if ( theAngularTolerance == DEF_ANG_TOL ) { + if ( theLinearTolerance == DEF_LIN_TOL ) + GEOM::TPythonDump(aFunction) << anEdge << " = geompy.MakeEdgeWire(" + << theWire << ")"; + else + GEOM::TPythonDump(aFunction) << anEdge << " = geompy.MakeEdgeWire(" + << theWire << ", " << theLinearTolerance << ")"; + } + else { + GEOM::TPythonDump(aFunction) << anEdge << " = geompy.MakeEdgeWire(" + << theWire << ", " << theLinearTolerance << ", " + << theAngularTolerance << ")"; + } + + SetErrorCode(OK); + return anEdge; +} + //============================================================================= /*! * MakeWire @@ -434,60 +506,6 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShells return MakeShape(theShapes, GEOM_SOLID, SOLID_SHELLS, "MakeSolid"); } -//============================================================================= -/*! - * MakeSolidShell - */ -//============================================================================= -Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidShell (Handle(GEOM_Object) theShell) -{ - SetErrorCode(KO); - - if (theShell.IsNull()) return NULL; - - //Add a new Solid object - Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID); - - //Add a new Solid function for creation of a solid from a shell - Handle(GEOM_Function) aFunction = - aSolid->AddFunction(GEOMImpl_ShapeDriver::GetID(), SOLID_SHELL); - if (aFunction.IsNull()) return NULL; - - //Check if the function is set correctly - if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL; - - GEOMImpl_IShapes aCI (aFunction); - - Handle(GEOM_Function) aRefShell = theShell->GetLastFunction(); - - if (aRefShell.IsNull()) return NULL; - - aCI.SetBase(aRefShell); - - //Compute the Solid value - try { -#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 - OCC_CATCH_SIGNALS; -#endif - if (!GetSolver()->ComputeFunction(aFunction)) { - SetErrorCode("Solid driver failed"); - return NULL; - } - } - catch (Standard_Failure) { - Handle(Standard_Failure) aFail = Standard_Failure::Caught(); - SetErrorCode(aFail->GetMessageString()); - return NULL; - } - - //Make a Python command - GEOM::TPythonDump(aFunction) << aSolid - << " = geompy.MakeSolid(" << theShell << ")"; - - SetErrorCode(OK); - return aSolid; -} - //============================================================================= /*! * MakeCompound @@ -802,6 +820,70 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList return aGlued; } +//============================================================================= +/*! + * GetExistingSubObjects + */ +//============================================================================= +Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetExistingSubObjects + (Handle(GEOM_Object) theShape, + const Standard_Boolean theGroupsOnly) +{ + SetErrorCode(KO); + + if (theShape.IsNull()) return NULL; + + Handle(GEOM_Function) aMainShape = theShape->GetLastFunction(); + if (aMainShape.IsNull()) return NULL; + + Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient; + SetErrorCode(NOT_FOUND_ANY); + + if (!aMainShape->HasSubShapeReferences()) return aSeq; + const TDataStd_ListOfExtendedString& aListEntries = aMainShape->GetSubShapeReferences(); + if (aListEntries.IsEmpty()) return aSeq; + + SetErrorCode(KO); + + TCollection_AsciiString anAsciiList; + + TDataStd_ListIteratorOfListOfExtendedString anIt (aListEntries); + for (; anIt.More(); anIt.Next()) { + TCollection_ExtendedString anEntry = anIt.Value(); + Standard_Integer aStrLen = anEntry.LengthOfCString(); + char* anEntryStr = new char[aStrLen]; + anEntry.ToUTF8CString(anEntryStr); + Handle(GEOM_Object) anObj = GetEngine()->GetObject(GetDocID(), anEntryStr, false); + if (!anObj.IsNull()) { + if (!theGroupsOnly || anObj->GetType() == GEOM_GROUP) { + aSeq->Append(anObj); + + // for python command + anAsciiList += anEntryStr; + anAsciiList += ","; + } + } + delete [] anEntryStr; + } + + if (aSeq->Length() == 0) { + SetErrorCode(NOT_FOUND_ANY); + return aSeq; + } + + //Make a Python command + anAsciiList.Trunc(anAsciiList.Length() - 1); + + GEOM::TPythonDump pd (aMainShape, /*append=*/true); + pd << "[" << anAsciiList.ToCString(); + pd << "] = geompy.GetExistingSubObjects("; + pd << theShape << ", " << (int)theGroupsOnly << ")"; + + SetErrorCode(OK); + + return aSeq; +} + //============================================================================= /*! * MakeExplode @@ -839,7 +921,9 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode } } } - } else { + } + else if ( aShape.ShapeType() != theShapeType ) // issue 0021079, prevent from returning aShape + { TopExp_Explorer exp (aShape, TopAbs_ShapeEnum(theShapeType)); for (; exp.More(); exp.Next()) if (mapShape.Add(exp.Current())) @@ -944,7 +1028,8 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::SubShapeAllIDs } } } - } else { + } else if ( aShape.ShapeType() != theShapeType ) // issue 0021079, prevent from returning aShape + { TopExp_Explorer exp (aShape, TopAbs_ShapeEnum(theShapeType)); for (; exp.More(); exp.Next()) if (mapShape.Add(exp.Current())) @@ -2054,9 +2139,31 @@ Handle(TColStd_HSequenceOfInteger) return aSeqOfIDs; } + // BEGIN: Mantis issue 0020961: Error on a pipe T-Shape + // Compute tolerance + Standard_Real T, VertMax = -RealLast(); + try { +#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 + OCC_CATCH_SIGNALS; +#endif + for (TopExp_Explorer ExV (theShape, TopAbs_VERTEX); ExV.More(); ExV.Next()) { + TopoDS_Vertex Vertex = TopoDS::Vertex(ExV.Current()); + T = BRep_Tool::Tolerance(Vertex); + if (T > VertMax) + VertMax = T; + } + } + catch (Standard_Failure) { + Handle(Standard_Failure) aFail = Standard_Failure::Caught(); + SetErrorCode(aFail->GetMessageString()); + return aSeqOfIDs; + } + // END: Mantis issue 0020961 + // Call algo GEOMAlgo_FinderShapeOn1 aFinder; - Standard_Real aTol = 0.0001; // default value + //Standard_Real aTol = 0.0001; // default value + Standard_Real aTol = VertMax; // Mantis issue 0020961 aFinder.SetShape(theShape); aFinder.SetTolerance(aTol); @@ -3239,7 +3346,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) bool isFound = false; Standard_Integer iType = TopAbs_SOLID; Standard_Integer compType = TopAbs_SOLID; - Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.; + //Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.; Standard_Real tab_aWhat[4], tab_aWhere[4]; Standard_Real dl_l = 1e-3; Standard_Real min_l, Tol_0D, Tol_1D, Tol_2D, Tol_3D, Tol_Mass; @@ -3282,6 +3389,11 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin); if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin); min_l /= dl_l; + // Mantis issue 0020908 BEGIN + if (!Exp_Edge.More()) { + min_l = Precision::Confusion(); + } + // Mantis issue 0020908 END for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) { TopExp_Explorer Exp_Vertex( Exp_Edge.Current(), TopAbs_VERTEX); for ( Standard_Integer nbVertex = 0; Exp_Vertex.More(); Exp_Vertex.Next(), nbVertex++ ) { @@ -3315,6 +3427,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) else if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D; // Compute the ShapeWhat Mass + /* for ( ; Exp_aWhat.More(); Exp_aWhat.Next() ) { if ( iType == TopAbs_VERTEX ) { aWhat_Mass += 1; @@ -3325,6 +3438,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) else BRepGProp::VolumeProperties(Exp_aWhat.Current(), aProps); aWhat_Mass += aProps.Mass(); } + */ // Searching for the sub-shapes inside the ShapeWhere shape TopTools_MapOfShape map_aWhere; @@ -3366,12 +3480,13 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) if ( isFound ) { aWhereIndex = aWhereIndices.FindIndex(Exp_aWhere.Current()); aModifiedList.Append(aWhereIndex); - aWhere_Mass += tab_aWhere[3]; + //aWhere_Mass += tab_aWhere[3]; isFound = false; break; } } - if ( fabs( aWhat_Mass - aWhere_Mass ) <= Tol_Mass ) break; + //if ( fabs( aWhat_Mass - aWhere_Mass ) <= Tol_Mass ) + //break; } if (aModifiedList.Extent() == 0) { // Not found any Results diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx index 1bb384486..8f3132a93 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.hxx @@ -54,7 +54,10 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations Standard_EXPORT ~GEOMImpl_IShapesOperations(); Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1, - Handle(GEOM_Object) thePoint2); + Handle(GEOM_Object) thePoint2); + Standard_EXPORT Handle(GEOM_Object) MakeEdgeWire (Handle(GEOM_Object) theWire, + const Standard_Real theLinearTolerance, + const Standard_Real theAngularTolerance); Standard_EXPORT Handle(GEOM_Object) MakeWire (std::list theEdgesAndWires, const Standard_Real theTolerance); @@ -66,8 +69,6 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list theShapes); - Standard_EXPORT Handle(GEOM_Object) MakeSolidShell (Handle(GEOM_Object) theShell); - Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (std::list theShells); Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list theShapes); @@ -84,6 +85,10 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations std::list theFaces, const Standard_Boolean doKeepNonSolids); + Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects + (Handle(GEOM_Object) theShape, + const Standard_Boolean theGroupsOnly); + Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode (Handle(GEOM_Object) theShape, const Standard_Integer theShapeType, diff --git a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx index 744bdc200..42ab3f44f 100644 --- a/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_ITransformOperations.cxx @@ -1252,7 +1252,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShape aTI.SetShape(anOriginal); aTI.SetEndLCS(theEndLCS->GetLastFunction()); if (!theStartLCS.IsNull()) - aTI.SetStartLCS(theStartLCS->GetLastFunction()); + aTI.SetStartLCS(theObject == theStartLCS ? anOriginal : theStartLCS->GetLastFunction()); //Compute the Position try { diff --git a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx index a4b0300f4..f28f5ea9d 100644 --- a/src/GEOMImpl/GEOMImpl_ImportDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ImportDriver.cxx @@ -18,7 +18,6 @@ // 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 @@ -109,7 +108,7 @@ Standard_Integer GEOMImpl_ImportDriver::Execute(TFunction_Logbook& log) const // perform the import TCollection_AsciiString anError; - TopoDS_Shape aShape = fp( aFileName, aFormatName, anError, aFunction->GetEntry() ); + TopoDS_Shape aShape = fp(aFileName, aFormatName, anError, aFunction->GetNamingEntry()); // unload plugin library // commented by enk: @@ -159,7 +158,8 @@ Standard_EXPORT Handle_Standard_Type& GEOMImpl_ImportDriver_Type_() //function : DownCast //purpose : //======================================================================= -const Handle(GEOMImpl_ImportDriver) Handle(GEOMImpl_ImportDriver)::DownCast(const Handle(Standard_Transient)& AnObject) +const Handle(GEOMImpl_ImportDriver) Handle(GEOMImpl_ImportDriver)::DownCast + (const Handle(Standard_Transient)& AnObject) { Handle(GEOMImpl_ImportDriver) _anOtherObject; @@ -169,5 +169,5 @@ const Handle(GEOMImpl_ImportDriver) Handle(GEOMImpl_ImportDriver)::DownCast(cons } } - return _anOtherObject ; + return _anOtherObject; } diff --git a/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx b/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx index 70a0fb545..c3b9cd0ca 100644 --- a/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_MeasureDriver.cxx @@ -216,6 +216,17 @@ Standard_Integer GEOMImpl_MeasureDriver::Execute(TFunction_Logbook& log) const gp_Vec Vec1,Vec2; BRepAdaptor_Surface SF (aFace); SF.D1(pUV.X(), pUV.Y(), p1, Vec1, Vec2); + if (Vec1.Magnitude() < Precision::Confusion()) { + gp_Vec tmpV; + gp_Pnt tmpP; + SF.D1(pUV.X(), pUV.Y()-0.1, tmpP, Vec1, tmpV); + } + else if (Vec2.Magnitude() < Precision::Confusion()) { + gp_Vec tmpV; + gp_Pnt tmpP; + SF.D1(pUV.X()-0.1, pUV.Y(), tmpP, tmpV, Vec2); + } + gp_Vec V = Vec1.Crossed(Vec2); Standard_Real mod = V.Magnitude(); if (mod < Precision::Confusion()) diff --git a/src/GEOMImpl/GEOMImpl_PartitionDriver.cxx b/src/GEOMImpl/GEOMImpl_PartitionDriver.cxx index e6ff34fea..f6421fa40 100644 --- a/src/GEOMImpl/GEOMImpl_PartitionDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PartitionDriver.cxx @@ -18,7 +18,6 @@ // 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 @@ -29,12 +28,12 @@ #include #include -//#include #include -#include #include +#include +//#include #include #include @@ -46,11 +45,14 @@ #include #include #include +#include #include +#include #include #include +#include #include #include #include @@ -117,6 +119,9 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const //sklNMTAlgo_Splitter1 PS; GEOMAlgo_Splitter PS; + TopTools_DataMapOfShapeShape aCopyMap; + TColStd_IndexedDataMapOfTransientTransient aMapTShapes; + if (aType == PARTITION_PARTITION || aType == PARTITION_NO_SELF_INTERSECTIONS) { Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes(); @@ -141,8 +146,27 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const Standard_NullObject::Raise("In Partition a shape is null"); } // + //BRepBuilderAPI_Copy aCopyTool (aShape_i); + TopoDS_Shape aShape_i_copy; + TNaming_CopyShape::CopyTool(aShape_i, aMapTShapes, aShape_i_copy); + //if (aCopyTool.IsDone()) + // aShape_i_copy = aCopyTool.Shape(); + //else + // Standard_NullObject::Raise("Bad shape detected"); + // + // fill aCopyMap for history + TopTools_IndexedMapOfShape aShape_i_inds; + TopTools_IndexedMapOfShape aShape_i_copy_inds; + TopExp::MapShapes(aShape_i, aShape_i_inds); + TopExp::MapShapes(aShape_i_copy, aShape_i_copy_inds); + Standard_Integer nbInds = aShape_i_inds.Extent(); + for (Standard_Integer ie = 1; ie <= nbInds; ie++) { + aCopyMap.Bind(aShape_i_inds.FindKey(ie), aShape_i_copy_inds.FindKey(ie)); + } + // TopTools_ListOfShape aSimpleShapes; - PrepareShapes(aShape_i, aType, aSimpleShapes); + //PrepareShapes(aShape_i, aType, aSimpleShapes); + PrepareShapes(aShape_i_copy, aType, aSimpleShapes); TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes); for (; aSimpleIter.More(); aSimpleIter.Next()) { const TopoDS_Shape& aSimpleSh = aSimpleIter.Value(); @@ -164,8 +188,27 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const Standard_NullObject::Raise("In Partition a tool shape is null"); } // + //BRepBuilderAPI_Copy aCopyTool (aShape_i); + TopoDS_Shape aShape_i_copy; + TNaming_CopyShape::CopyTool(aShape_i, aMapTShapes, aShape_i_copy); + //if (aCopyTool.IsDone()) + // aShape_i_copy = aCopyTool.Shape(); + //else + // Standard_NullObject::Raise("Bad shape detected"); + // + // fill aCopyMap for history + TopTools_IndexedMapOfShape aShape_i_inds; + TopTools_IndexedMapOfShape aShape_i_copy_inds; + TopExp::MapShapes(aShape_i, aShape_i_inds); + TopExp::MapShapes(aShape_i_copy, aShape_i_copy_inds); + Standard_Integer nbInds = aShape_i_inds.Extent(); + for (Standard_Integer ie = 1; ie <= nbInds; ie++) { + aCopyMap.Bind(aShape_i_inds.FindKey(ie), aShape_i_copy_inds.FindKey(ie)); + } + // TopTools_ListOfShape aSimpleShapes; - PrepareShapes(aShape_i, aType, aSimpleShapes); + //PrepareShapes(aShape_i, aType, aSimpleShapes); + PrepareShapes(aShape_i_copy, aType, aSimpleShapes); TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes); for (; aSimpleIter.More(); aSimpleIter.Next()) { const TopoDS_Shape& aSimpleSh = aSimpleIter.Value(); @@ -183,8 +226,27 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const Standard_NullObject::Raise("In Partition a Keep Inside shape is null"); } // + //BRepBuilderAPI_Copy aCopyTool (aShape_i); + TopoDS_Shape aShape_i_copy; + TNaming_CopyShape::CopyTool(aShape_i, aMapTShapes, aShape_i_copy); + //if (aCopyTool.IsDone()) + // aShape_i_copy = aCopyTool.Shape(); + //else + // Standard_NullObject::Raise("Bad shape detected"); + // + // fill aCopyMap for history + TopTools_IndexedMapOfShape aShape_i_inds; + TopTools_IndexedMapOfShape aShape_i_copy_inds; + TopExp::MapShapes(aShape_i, aShape_i_inds); + TopExp::MapShapes(aShape_i_copy, aShape_i_copy_inds); + Standard_Integer nbInds = aShape_i_inds.Extent(); + for (Standard_Integer ie = 1; ie <= nbInds; ie++) { + aCopyMap.Bind(aShape_i_inds.FindKey(ie), aShape_i_copy_inds.FindKey(ie)); + } + // TopTools_ListOfShape aSimpleShapes; - PrepareShapes(aShape_i, aType, aSimpleShapes); + //PrepareShapes(aShape_i, aType, aSimpleShapes); + PrepareShapes(aShape_i_copy, aType, aSimpleShapes); TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes); for (; aSimpleIter.More(); aSimpleIter.Next()) { const TopoDS_Shape& aSimpleSh = aSimpleIter.Value(); @@ -201,8 +263,27 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const Standard_NullObject::Raise("In Partition a Remove Inside shape is null"); } // + //BRepBuilderAPI_Copy aCopyTool (aShape_i); + TopoDS_Shape aShape_i_copy; + TNaming_CopyShape::CopyTool(aShape_i, aMapTShapes, aShape_i_copy); + //if (aCopyTool.IsDone()) + // aShape_i_copy = aCopyTool.Shape(); + //else + // Standard_NullObject::Raise("Bad shape detected"); + // + // fill aCopyMap for history + TopTools_IndexedMapOfShape aShape_i_inds; + TopTools_IndexedMapOfShape aShape_i_copy_inds; + TopExp::MapShapes(aShape_i, aShape_i_inds); + TopExp::MapShapes(aShape_i_copy, aShape_i_copy_inds); + Standard_Integer nbInds = aShape_i_inds.Extent(); + for (Standard_Integer ie = 1; ie <= nbInds; ie++) { + aCopyMap.Bind(aShape_i_inds.FindKey(ie), aShape_i_copy_inds.FindKey(ie)); + } + // TopTools_ListOfShape aSimpleShapes; - PrepareShapes(aShape_i, aType, aSimpleShapes); + //PrepareShapes(aShape_i, aType, aSimpleShapes); + PrepareShapes(aShape_i_copy, aType, aSimpleShapes); TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes); for (; aSimpleIter.More(); aSimpleIter.Next()) { const TopoDS_Shape& aSimpleSh = aSimpleIter.Value(); @@ -212,7 +293,7 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const } PS.SetLimitMode(aCI.GetKeepNonlimitShapes()); - PS.SetLimit( (TopAbs_ShapeEnum)aCI.GetLimit() ); + PS.SetLimit((TopAbs_ShapeEnum)aCI.GetLimit()); PS.Perform(); //skl PS.Compute(); @@ -245,11 +326,52 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const Standard_NullObject::Raise("In Half Partition a shape or a plane is null"); } + TopoDS_Shape aShapeArg_copy; + TopoDS_Shape aPlaneArg_copy; + { + TNaming_CopyShape::CopyTool(aShapeArg, aMapTShapes, aShapeArg_copy); + //BRepBuilderAPI_Copy aCopyTool (aShapeArg); + //if (aCopyTool.IsDone()) + // aShapeArg_copy = aCopyTool.Shape(); + //else + // Standard_NullObject::Raise("Bad shape detected"); + // + // fill aCopyMap for history + TopTools_IndexedMapOfShape aShapeArg_inds; + TopTools_IndexedMapOfShape aShapeArg_copy_inds; + TopExp::MapShapes(aShapeArg, aShapeArg_inds); + TopExp::MapShapes(aShapeArg_copy, aShapeArg_copy_inds); + Standard_Integer nbInds = aShapeArg_inds.Extent(); + for (Standard_Integer ie = 1; ie <= nbInds; ie++) { + aCopyMap.Bind(aShapeArg_inds.FindKey(ie), aShapeArg_copy_inds.FindKey(ie)); + } + } + { + TNaming_CopyShape::CopyTool(aPlaneArg, aMapTShapes, aPlaneArg_copy); + //BRepBuilderAPI_Copy aCopyTool (aPlaneArg); + //if (aCopyTool.IsDone()) + // aPlaneArg_copy = aCopyTool.Shape(); + //else + // Standard_NullObject::Raise("Bad shape detected"); + // + // fill aCopyMap for history + TopTools_IndexedMapOfShape aPlaneArg_inds; + TopTools_IndexedMapOfShape aPlaneArg_copy_inds; + TopExp::MapShapes(aPlaneArg, aPlaneArg_inds); + TopExp::MapShapes(aPlaneArg_copy, aPlaneArg_copy_inds); + Standard_Integer nbInds = aPlaneArg_inds.Extent(); + for (Standard_Integer ie = 1; ie <= nbInds; ie++) { + aCopyMap.Bind(aPlaneArg_inds.FindKey(ie), aPlaneArg_copy_inds.FindKey(ie)); + } + } + // add object shapes that are in ListShapes; - PS.AddShape(aShapeArg); + PS.AddShape(aShapeArg_copy); + //PS.AddShape(aShapeArg); // add tool shapes that are in ListTools and not in ListShapes; - PS.AddTool(aPlaneArg); + PS.AddTool(aPlaneArg_copy); + //PS.AddTool(aPlaneArg); //skl PS.Compute(); PS.Perform(); @@ -293,6 +415,7 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const const TopTools_IndexedDataMapOfShapeListOfShape& aMR = PS.ImagesResult(); // history for all argument shapes + // be sure to use aCopyMap TDF_LabelSequence aLabelSeq; aFunction->GetDependency(aLabelSeq); Standard_Integer nbArg = aLabelSeq.Length(); @@ -314,6 +437,10 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const for (Standard_Integer ie = 1; ie <= nbArgumentEntities; ie++) { TopoDS_Shape anEntity = anArgumentIndices.FindKey(ie); + // be sure to use aCopyMap here + if (aCopyMap.IsBound(anEntity)) + anEntity = aCopyMap.Find(anEntity); + // if (!aMR.Contains(anEntity)) continue; const TopTools_ListOfShape& aModified = aMR.FindFromKey(anEntity); @@ -346,21 +473,17 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const //======================================================================= Standard_EXPORT Handle_Standard_Type& GEOMImpl_PartitionDriver_Type_() { - static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); - if ( aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); + if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); - if ( aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); + if (aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); - if ( aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); + if (aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); - - static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; - static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_PartitionDriver", - sizeof(GEOMImpl_PartitionDriver), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + static Handle_Standard_Transient _Ancestors[] = {aType1,aType2,aType3,NULL}; + static Handle_Standard_Type _aType = + new Standard_Type ("GEOMImpl_PartitionDriver", sizeof(GEOMImpl_PartitionDriver), + 1, (Standard_Address)_Ancestors, (Standard_Address)NULL); return _aType; } @@ -379,5 +502,5 @@ const Handle(GEOMImpl_PartitionDriver) Handle(GEOMImpl_PartitionDriver)::DownCas } } - return _anOtherObject ; + return _anOtherObject; } diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index 6990682cf..334bfbc09 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -31,6 +31,7 @@ // OCCT Includes #include #include +#include #include #include @@ -43,8 +44,13 @@ #include #include #include +#include +#include +#include +#include #include +#include #include #include @@ -61,7 +67,18 @@ #include #include +#include #include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include #include @@ -441,6 +458,342 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const aShape = tds; } } + else if (aType == EDGE_WIRE) { + Handle(GEOM_Function) aRefBase = aCI.GetBase(); + TopoDS_Shape aWire = aRefBase->GetValue(); + Standard_Real LinTol = aCI.GetTolerance(); + Standard_Real AngTol = aCI.GetAngularTolerance(); + if (aWire.IsNull()) Standard_NullObject::Raise("Argument Wire is null"); + + TopoDS_Edge ResEdge; + + BRepLib::BuildCurves3d(aWire); + Handle(ShapeFix_Shape) Fixer = new ShapeFix_Shape(aWire); + Fixer->SetPrecision(LinTol); + Fixer->SetMaxTolerance(LinTol); + Fixer->Perform(); + TopoDS_Wire theWire = TopoDS::Wire(Fixer->Shape()); + + TColGeom_SequenceOfCurve CurveSeq; + TopTools_SequenceOfShape LocSeq; + TColStd_SequenceOfReal FparSeq; + TColStd_SequenceOfReal LparSeq; + TColStd_SequenceOfReal TolSeq; + GeomAbs_CurveType CurType; + TopoDS_Vertex FirstVertex, LastVertex; + + BRepTools_WireExplorer wexp(theWire) ; + for (; wexp.More(); wexp.Next()) + { + TopoDS_Edge anEdge = wexp.Current(); + Standard_Real fpar, lpar; + TopLoc_Location aLoc; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aLoc, fpar, lpar); + if (aCurve.IsNull()) + continue; + + BRepAdaptor_Curve BAcurve(anEdge); + GeomAbs_CurveType aType = BAcurve.GetType(); + + Handle(Geom_Curve) aBasisCurve = BAcurve.Curve().Curve(); + + if (aBasisCurve->IsPeriodic()) + ElCLib::AdjustPeriodic(aBasisCurve->FirstParameter(), aBasisCurve->LastParameter(), + Precision::PConfusion(), fpar, lpar); + + if (CurveSeq.IsEmpty()) + { + CurveSeq.Append(aCurve); + TopoDS_Shape aLocShape; + aLocShape.Location(aLoc); + aLocShape.Orientation(wexp.Orientation()); + LocSeq.Append(aLocShape); + FparSeq.Append(fpar); + LparSeq.Append(lpar); + CurType = aType; + FirstVertex = wexp.CurrentVertex(); + } + else + { + Standard_Boolean Done = Standard_False; + Standard_Real NewFpar, NewLpar; + GeomAdaptor_Curve GAprevcurve(CurveSeq.Last()); + TopoDS_Vertex CurVertex = wexp.CurrentVertex(); + TopoDS_Vertex CurFirstVer = TopExp::FirstVertex(anEdge); + TopAbs_Orientation ConnectByOrigin = (CurVertex.IsSame(CurFirstVer))? TopAbs_FORWARD : TopAbs_REVERSED; + if (aCurve == CurveSeq.Last()) + { + NewFpar = fpar; + NewLpar = lpar; + if (aBasisCurve->IsPeriodic()) + { + if (NewLpar < NewFpar) + NewLpar += aBasisCurve->Period(); + if (ConnectByOrigin == TopAbs_FORWARD) + ElCLib::AdjustPeriodic(FparSeq.Last(), + FparSeq.Last() + aBasisCurve->Period(), + Precision::PConfusion(), NewFpar, NewLpar); + else + ElCLib::AdjustPeriodic(FparSeq.Last() - aBasisCurve->Period(), + FparSeq.Last(), + Precision::PConfusion(), NewFpar, NewLpar); + } + Done = Standard_True; + } + else if (aType == CurType && + aType != GeomAbs_BezierCurve && + aType != GeomAbs_BSplineCurve && + aType != GeomAbs_OtherCurve) + { + switch (aType) + { + case GeomAbs_Line: + { + gp_Lin aLine = BAcurve.Line(); + gp_Lin PrevLine = GAprevcurve.Line(); + if (aLine.Contains(PrevLine.Location(), LinTol) && + aLine.Direction().IsParallel(PrevLine.Direction(), AngTol)) + { + gp_Pnt P1 = ElCLib::Value(fpar, aLine); + gp_Pnt P2 = ElCLib::Value(lpar, aLine); + NewFpar = ElCLib::Parameter(PrevLine, P1); + NewLpar = ElCLib::Parameter(PrevLine, P2); + if (NewLpar < NewFpar) + { + Standard_Real MemNewFpar = NewFpar; + NewFpar = NewLpar; + NewLpar = MemNewFpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + Done = Standard_True; + } + break; + } + case GeomAbs_Circle: + { + gp_Circ aCircle = BAcurve.Circle(); + gp_Circ PrevCircle = GAprevcurve.Circle(); + if (aCircle.Location().Distance(PrevCircle.Location()) <= LinTol && + Abs(aCircle.Radius() - PrevCircle.Radius()) <= LinTol && + aCircle.Axis().IsParallel(PrevCircle.Axis(), AngTol)) + { + if (aCircle.Axis().Direction() * PrevCircle.Axis().Direction() < 0.) + { + Standard_Real memfpar = fpar; + fpar = lpar; + lpar = memfpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + gp_Pnt P1 = ElCLib::Value(fpar, aCircle); + gp_Pnt P2 = ElCLib::Value(lpar, aCircle); + NewFpar = ElCLib::Parameter(PrevCircle, P1); + NewLpar = ElCLib::Parameter(PrevCircle, P2); + if (NewLpar < NewFpar) + NewLpar += 2.*PI; + //Standard_Real MemNewFpar = NewFpar, MemNewLpar = NewLpar; + if (ConnectByOrigin == TopAbs_FORWARD) + ElCLib::AdjustPeriodic(FparSeq.Last(), + FparSeq.Last() + 2.*PI, + Precision::PConfusion(), NewFpar, NewLpar); + else + ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*PI, + FparSeq.Last(), + Precision::PConfusion(), NewFpar, NewLpar); + Done = Standard_True; + } + break; + } + case GeomAbs_Ellipse: + { + gp_Elips anEllipse = BAcurve.Ellipse(); + gp_Elips PrevEllipse = GAprevcurve.Ellipse(); + if (anEllipse.Focus1().Distance(PrevEllipse.Focus1()) <= LinTol && + anEllipse.Focus2().Distance(PrevEllipse.Focus2()) <= LinTol && + Abs(anEllipse.MajorRadius() - PrevEllipse.MajorRadius()) <= LinTol && + Abs(anEllipse.MinorRadius() - PrevEllipse.MinorRadius()) <= LinTol && + anEllipse.Axis().IsParallel(PrevEllipse.Axis(), AngTol)) + { + if (anEllipse.Axis().Direction() * PrevEllipse.Axis().Direction() < 0.) + { + Standard_Real memfpar = fpar; + fpar = lpar; + lpar = memfpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + gp_Pnt P1 = ElCLib::Value(fpar, anEllipse); + gp_Pnt P2 = ElCLib::Value(lpar, anEllipse); + NewFpar = ElCLib::Parameter(PrevEllipse, P1); + NewLpar = ElCLib::Parameter(PrevEllipse, P2); + if (NewLpar < NewFpar) + NewLpar += 2.*PI; + if (ConnectByOrigin == TopAbs_FORWARD) + ElCLib::AdjustPeriodic(FparSeq.Last(), + FparSeq.Last() + 2.*PI, + Precision::PConfusion(), NewFpar, NewLpar); + else + ElCLib::AdjustPeriodic(FparSeq.Last() - 2.*PI, + FparSeq.Last(), + Precision::PConfusion(), NewFpar, NewLpar); + Done = Standard_True; + } + break; + } + case GeomAbs_Hyperbola: + { + gp_Hypr aHypr = BAcurve.Hyperbola(); + gp_Hypr PrevHypr = GAprevcurve.Hyperbola(); + if (aHypr.Focus1().Distance(PrevHypr.Focus1()) <= LinTol && + aHypr.Focus2().Distance(PrevHypr.Focus2()) <= LinTol && + Abs(aHypr.MajorRadius() - PrevHypr.MajorRadius()) <= LinTol && + Abs(aHypr.MinorRadius() - PrevHypr.MinorRadius()) <= LinTol && + aHypr.Axis().IsParallel(PrevHypr.Axis(), AngTol)) + { + gp_Pnt P1 = ElCLib::Value(fpar, aHypr); + gp_Pnt P2 = ElCLib::Value(lpar, aHypr); + NewFpar = ElCLib::Parameter(PrevHypr, P1); + NewLpar = ElCLib::Parameter(PrevHypr, P2); + if (NewLpar < NewFpar) + { + Standard_Real MemNewFpar = NewFpar; + NewFpar = NewLpar; + NewLpar = MemNewFpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + Done = Standard_True; + } + break; + } + case GeomAbs_Parabola: + { + gp_Parab aParab = BAcurve.Parabola(); + gp_Parab PrevParab = GAprevcurve.Parabola(); + if (aParab.Location().Distance(PrevParab.Location()) <= LinTol && + aParab.Focus().Distance(PrevParab.Focus()) <= LinTol && + Abs(aParab.Focal() - PrevParab.Focal()) <= LinTol && + aParab.Axis().IsParallel(PrevParab.Axis(), AngTol)) + { + gp_Pnt P1 = ElCLib::Value(fpar, aParab); + gp_Pnt P2 = ElCLib::Value(lpar, aParab); + NewFpar = ElCLib::Parameter(PrevParab, P1); + NewLpar = ElCLib::Parameter(PrevParab, P2); + if (NewLpar < NewFpar) + { + Standard_Real MemNewFpar = NewFpar; + NewFpar = NewLpar; + NewLpar = MemNewFpar; + ConnectByOrigin = TopAbs::Reverse(ConnectByOrigin); + } + Done = Standard_True; + } + break; + } + } //end of switch (aType) + } // end of else if (aType == CurType && ... + if (Done) + { + if (NewFpar < FparSeq.Last()) + FparSeq(FparSeq.Length()) = NewFpar; + else + LparSeq(LparSeq.Length()) = NewLpar; + } + else + { + CurveSeq.Append(aCurve); + TopoDS_Shape aLocShape; + aLocShape.Location(aLoc); + aLocShape.Orientation(wexp.Orientation()); + LocSeq.Append(aLocShape); + FparSeq.Append(fpar); + LparSeq.Append(lpar); + TolSeq.Append(BRep_Tool::Tolerance(CurVertex)); + CurType = aType; + } + } // end of else (CurveSeq.IsEmpty()) -> not first time + } // end for (; wexp.More(); wexp.Next()) + + LastVertex = wexp.CurrentVertex(); + TolSeq.Append(BRep_Tool::Tolerance(LastVertex)); + + if (!CurveSeq.IsEmpty()) + { + Standard_Integer nb_curve = CurveSeq.Length(); //number of curves + TColGeom_Array1OfBSplineCurve tab(0,nb_curve-1); //array of the curves + TColStd_Array1OfReal tabtolvertex(0,nb_curve-1); //(0,nb_curve-2); //array of the tolerances + + Standard_Integer i; + + if (nb_curve > 1) + { + for (i = 1; i <= nb_curve; i++) + { + if (CurveSeq(i)->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) + CurveSeq(i) = (*((Handle(Geom_TrimmedCurve)*)&(CurveSeq(i))))->BasisCurve(); + + Handle(Geom_TrimmedCurve) aTrCurve = new Geom_TrimmedCurve(CurveSeq(i), FparSeq(i), LparSeq(i)); + tab(i-1) = GeomConvert::CurveToBSplineCurve(aTrCurve); + tab(i-1)->Transform(LocSeq(i).Location().Transformation()); + GeomConvert::C0BSplineToC1BSplineCurve(tab(i-1), Precision::Confusion()); + if (LocSeq(i).Orientation() == TopAbs_REVERSED) + tab(i-1)->Reverse(); + + //Temporary + //char* name = new char[100]; + //sprintf(name, "c%d", i); + //DrawTrSurf::Set(name, tab(i-1)); + + if (i > 1) + tabtolvertex(i-2) = TolSeq(i-1); + } // end for (i = 1; i <= nb_curve; i++) + tabtolvertex(nb_curve-1) = TolSeq(TolSeq.Length()); + + Standard_Boolean closed_flag = Standard_False; + Standard_Real closed_tolerance = 0.; + if (FirstVertex.IsSame(LastVertex) && + GeomLProp::Continuity(tab(0), tab(nb_curve-1), + tab(0)->FirstParameter(), + tab(nb_curve-1)->LastParameter(), + Standard_False, Standard_False, LinTol, AngTol) >= GeomAbs_G1) + { + closed_flag = Standard_True ; + closed_tolerance = BRep_Tool::Tolerance(FirstVertex); + } + + Handle(TColGeom_HArray1OfBSplineCurve) concatcurve; //array of the concatenated curves + Handle(TColStd_HArray1OfInteger) ArrayOfIndices; //array of the remining Vertex + GeomConvert::ConcatC1(tab, + tabtolvertex, + ArrayOfIndices, + concatcurve, + closed_flag, + closed_tolerance); //C1 concatenation + + if (concatcurve->Length() > 1) + { + GeomConvert_CompCurveToBSplineCurve Concat(concatcurve->Value(concatcurve->Lower())); + + for (i = concatcurve->Lower()+1; i <= concatcurve->Upper(); i++) + Concat.Add( concatcurve->Value(i), LinTol, Standard_True ); + + concatcurve->SetValue(concatcurve->Lower(), Concat.BSplineCurve()); + } + + ResEdge = BRepLib_MakeEdge(concatcurve->Value(concatcurve->Lower()), + FirstVertex, LastVertex); + } + else + { + if (CurveSeq(1)->IsInstance(STANDARD_TYPE(Geom_TrimmedCurve))) + CurveSeq(1) = (*((Handle(Geom_TrimmedCurve)*)&(CurveSeq(i))))->BasisCurve(); + + CurveSeq(1)->Transform(LocSeq(1).Location().Transformation()); + ResEdge = BRepLib_MakeEdge(CurveSeq(1), + FirstVertex, LastVertex, + FparSeq(1), LparSeq(1)); + } + } + + aShape = ResEdge; + } if (aShape.IsNull()) return 0; diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index b1d626427..b954ec438 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -257,6 +257,7 @@ #define SUBSHAPE_NOT_SORTED 8 #define FACE_WIRES 9 #define REVERSE_ORIENTATION 10 +#define EDGE_WIRE 11 #define ARCHIMEDE_TYPE 1 @@ -269,6 +270,7 @@ #define SEWING 6 #define DIVIDE_EDGE 7 #define CHANGE_ORIENTATION 8 +#define LIMIT_TOLERANCE 9 #define BASIC_FILLING 1 diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx index a01872173..3d183d976 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx @@ -334,9 +334,21 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) case GEOMOp::OpTransparency: // POPUP - TRANSPARENCY OnTransparency(); break; + case GEOMOp::OpIncrTransparency: // SHORTCUT - INCREASE TRANSPARENCY + OnChangeTransparency( true ); + break; + case GEOMOp::OpDecrTransparency: // SHORTCUT - DECREASE TRANSPARENCY + OnChangeTransparency( false ); + break; case GEOMOp::OpIsos: // POPUP - ISOS OnNbIsos(); break; + case GEOMOp::OpIncrNbIsos: // SHORTCUT - INCREASE NB ISOLINES + OnNbIsos( INCR ); + break; + case GEOMOp::OpDecrNbIsos: // SHORTCUT - DECREASE NB ISOLINES + OnNbIsos( DECR ); + break; case GEOMOp::OpAutoColor: // POPUP - AUTO COLOR OnAutoColor(); break; diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.h b/src/GEOMToolsGUI/GEOMToolsGUI.h index ab7d404f3..09cdbd4e8 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI.h +++ b/src/GEOMToolsGUI/GEOMToolsGUI.h @@ -52,6 +52,8 @@ public: bool OnGUIEvent( int, SUIT_Desktop* ); virtual void deactivate(); + enum ActionType { SHOWDLG, INCR, DECR }; + private: // Import and export topology methods bool Import(); @@ -67,12 +69,15 @@ private: void OnDisableAutoColor(); void OnColor(); void OnTransparency(); - void OnNbIsos(); + void OnNbIsos( ActionType actionType = SHOWDLG ); void OnDeflection(); void OnSelectOnly(int mode); void OnShowHideChildren( bool ); void OnPointMarker(); + // Shortcut commands + void OnChangeTransparency( bool ); + // Recursive deletion of object with children void removeObjectWithChildren( _PTR(SObject), _PTR(Study), diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx index fb05288a1..9efec8b19 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx @@ -325,6 +325,7 @@ void GEOMToolsGUI::OnColor() for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { aView->SetColor( It.Value(), c ); } + GeometryGUI::Modified(); } } // if ( isVTK ) else if ( isOCC ) { @@ -382,6 +383,7 @@ void GEOMToolsGUI::OnColor() anObject->SetColor( aSColor ); anObject->SetAutoColor( false ); } + GeometryGUI::Modified(); } } // if c.isValid() } // first IO is not null @@ -399,7 +401,88 @@ void GEOMToolsGUI::OnTransparency() dlg.exec(); } -void GEOMToolsGUI::OnNbIsos() +void GEOMToolsGUI::OnChangeTransparency( bool increase ) +{ + SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); + if ( !app ) + return; + LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); + if ( !aSelMgr ) + return; + SALOME_ListIO selected; + aSelMgr->selectedObjects( selected ); + if ( selected.IsEmpty() ) + return; + + Handle(SALOME_InteractiveObject) FirstIOS = selected.First(); + if ( FirstIOS.IsNull() ) + return; + + // Delta + float delta = 0.1; // VSR: 23/11/2010 (transparency value <= 0.05 is ignored) + if ( !increase ) + delta *= -1; + + SUIT_ViewWindow* window = app->desktop()->activeWindow(); + bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() ); + bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() ); + + if ( isVTK ) { + SVTK_ViewWindow* vtkVW = dynamic_cast( window ); + if ( !vtkVW ) + return; + SVTK_View* aView = vtkVW->getView(); + + float transp = aView->GetTransparency(FirstIOS); + + // Compute new transparency value + transp = transp + delta; + if ( transp < 0 ) + transp = 0; + else if ( transp > 1 ) + transp = 1; + + for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { + aView->SetTransparency( It.Value(), transp ); + } + aView->Repaint(); + GeometryGUI::Modified(); + } // if ( isVTK ) + + else if ( isOCC ) { + GEOMBase* gb = new GEOMBase(); + Standard_Boolean found; + Handle(GEOM_AISShape) aisShape; + + aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, found ); + if( !found ) + return; + float transp = aisShape->Transparency(); + + // Compute new transparency value + transp = transp + delta; + if ( transp < 0 ) + transp = 0; + else if ( transp > 1 ) + transp = 1; + + OCCViewer_Viewer* vm = dynamic_cast( window->getViewManager()->getViewModel() ); + if ( !vm ) + return; + Handle(AIS_InteractiveContext) ic = vm->getAISContext(); + for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { + aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), found ); + if ( found ) { + ic->SetTransparency( aisShape, transp, false ); + ic->Redisplay( aisShape, Standard_False, Standard_True ); + } + } // for... + ic->UpdateCurrentViewer(); + GeometryGUI::Modified(); + } // if ( isOCC ) +} + +void GEOMToolsGUI::OnNbIsos( ActionType actionType ) { SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); @@ -419,29 +502,47 @@ void GEOMToolsGUI::OnNbIsos() int UIso = CurDrawer->UIsoAspect()->Number(); int VIso = CurDrawer->VIsoAspect()->Number(); - GEOMToolsGUI_NbIsosDlg * NbIsosDlg = - new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() ); + int newNbUIso = -1; + int newNbVIso = -1; - NbIsosDlg->setU( UIso ); - NbIsosDlg->setV( VIso ); + if ( actionType == SHOWDLG ) { + GEOMToolsGUI_NbIsosDlg * NbIsosDlg = + new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() ); - if ( NbIsosDlg->exec() ) { - SUIT_OverrideCursor(); - for(; ic->MoreCurrent(); ic->NextCurrent()) { - CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current()); - Handle(AIS_Drawer) CurDrawer = CurObject->Attributes(); + NbIsosDlg->setU( UIso ); + NbIsosDlg->setV( VIso ); - int nbUIso = NbIsosDlg->getU(); - int nbVIso = NbIsosDlg->getV(); + if ( NbIsosDlg->exec() ) { + SUIT_OverrideCursor(); + + newNbUIso = NbIsosDlg->getU(); + newNbVIso = NbIsosDlg->getV(); + } + } + else if ( actionType == INCR || actionType == DECR ) { + int delta = 1; + if (actionType == DECR) + delta = -1; + + newNbUIso = UIso + delta; + newNbVIso = VIso + delta; - CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , nbUIso) ); - CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , nbVIso) ); + if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 ) + return; + } - ic->SetLocalAttributes(CurObject, CurDrawer); - ic->Redisplay(CurObject); - } + for(; ic->MoreCurrent(); ic->NextCurrent()) { + CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current()); + Handle(AIS_Drawer) CurDrawer = CurObject->Attributes(); + + CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , newNbUIso) ); + CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5 , newNbVIso) ); + + ic->SetLocalAttributes(CurObject, CurDrawer); + ic->Redisplay(CurObject); } } + GeometryGUI::Modified(); } else if(isVTK){ // if is VTKViewer // @@ -492,27 +593,46 @@ void GEOMToolsGUI::OnNbIsos() anActor->GetNbIsos(UIso,VIso); else return; + + int newNbUIso = -1; + int newNbVIso = -1; - GEOMToolsGUI_NbIsosDlg* NbIsosDlg = - new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() ); + if ( actionType == SHOWDLG ) { + GEOMToolsGUI_NbIsosDlg* NbIsosDlg = + new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() ); - NbIsosDlg->setU( UIso ); - NbIsosDlg->setV( VIso ); + NbIsosDlg->setU( UIso ); + NbIsosDlg->setV( VIso ); - if ( NbIsosDlg->exec() ) { - SUIT_OverrideCursor(); + if ( NbIsosDlg->exec() ) { + SUIT_OverrideCursor(); - while( anAct!=NULL ) { - if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){ - // There are no casting to needed actor. - UIso = NbIsosDlg->getU(); - VIso = NbIsosDlg->getV(); - int aIsos[2]={UIso,VIso}; - anActor->SetNbIsos(aIsos); - } - anAct = aCollection->GetNextActor(); + newNbUIso = NbIsosDlg->getU(); + newNbVIso = NbIsosDlg->getV(); } } + else if ( actionType == INCR || actionType == DECR ) { + int delta = 1; + if (actionType == DECR) + delta = -1; + + newNbUIso = UIso + delta; + newNbVIso = VIso + delta; + + if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 ) + return; + } + + while( anAct!=NULL ) { + if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){ + // There are no casting to needed actor. + int aIsos[2]={newNbUIso,newNbVIso}; + anActor->SetNbIsos(aIsos); + } + anAct = aCollection->GetNextActor(); + } + view->Repaint(); + GeometryGUI::Modified(); } // end vtkviewer } @@ -559,6 +679,7 @@ void GEOMToolsGUI::OnDeflection() } } } + GeometryGUI::Modified(); } else if (isVTK) { // if is VTKViewer SalomeApp_Application* app = dynamic_cast @@ -623,6 +744,7 @@ void GEOMToolsGUI::OnDeflection() anAct = aCollection->GetNextActor(); } } + GeometryGUI::Modified(); } // end vtkviewer } diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx index 5856aa4e6..33940d0a0 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx @@ -269,6 +269,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency() for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) { aView->SetTransparency( It.Value(), newValue ); } + GeometryGUI::Modified(); aView->Repaint(); } // if ( isVTK ) @@ -300,6 +301,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency() } } // for... ic->UpdateCurrentViewer(); + GeometryGUI::Modified(); } // if ( isOCC ) ValueHasChanged(); diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index 76f133190..49292bda4 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// #ifdef WNT #pragma warning( disable:4786 ) @@ -30,8 +29,7 @@ #include "GEOM_Object_i.hh" #include -#include -//#include +#include #include "Utils_CorbaException.hxx" #include "OpUtil.hxx" @@ -68,10 +66,10 @@ // purpose : constructor to be called for servant creation. //============================================================================ GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId* contId, - const char* instanceName, - const char* interfaceName) : + PortableServer::POA_ptr poa, + PortableServer::ObjectId* contId, + const char* instanceName, + const char* interfaceName) : Engines_Component_i(orb, poa, contId, instanceName, interfaceName) { _thisObj = this; @@ -114,9 +112,9 @@ GEOM_Gen_i::~GEOM_Gen_i() { // purpose : //============================================================================ char* GEOM_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, - const char* IORString, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII) + const char* IORString, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII) { GEOM::GEOM_Object_var anObject = GEOM::GEOM_Object::_narrow(_orb->string_to_object(IORString)); if (!CORBA::is_nil(anObject)) { @@ -133,9 +131,9 @@ char* GEOM_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, // : The IOR (IORName) of object created is returned //============================================================================ char* GEOM_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, - const char* aLocalPersistentID, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII) + const char* aLocalPersistentID, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII) { SALOMEDS::Study_var aStudy = theSObject->GetStudy(); @@ -164,9 +162,9 @@ bool GEOM_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) // purpose : //============================================================================ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, - CORBA::Object_ptr theObject, - const char* theName) throw (SALOME::SALOME_Exception) + SALOMEDS::SObject_ptr theSObject, + CORBA::Object_ptr theObject, + const char* theName) throw (SALOME::SALOME_Exception) { Unexpect aCatch(SALOME_SalomeException); SALOMEDS::SObject_var aResultSO; @@ -266,8 +264,8 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, aPixmap->Destroy(); //if (strlen(theName) == 0) aShapeName += TCollection_AsciiString(aResultSO->Tag()); //else aShapeName = TCollection_AsciiString(CORBA::string_dup(theName)); - - // try to find existed name for current shape + + // BEGIN: try to find existed name for current shape bool HasName = false; // recieve current TopoDS shape CORBA::String_var entry = aShape->GetEntry(); @@ -280,24 +278,28 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, } entry = aMainSh->GetEntry(); Handle(GEOM_Object) anObj = _impl->GetObject(aMainSh->GetStudyID(), entry); - TDF_Label aMainLbl = anObj->GetEntry(); + TDF_Label aMainLbl = anObj->GetFunction(1)->GetNamingEntry(); + // check all named shapes using iterator - TDF_ChildIDIterator anIt(aMainLbl, TNaming_NamedShape::GetID(), Standard_True); - for(; anIt.More(); anIt.Next()) { + TDF_ChildIDIterator anIt (aMainLbl, TNaming_NamedShape::GetID(), Standard_True); + + for (; anIt.More() && !HasName; anIt.Next()) { Handle(TNaming_NamedShape) anAttr = Handle(TNaming_NamedShape)::DownCast(anIt.Value()); - if(anAttr.IsNull()) continue; + if (anAttr.IsNull()) continue; TopoDS_Shape S = anAttr->Get(); - if( !S.IsEqual(TopoSh) ) continue; - TDF_Label L = anAttr->Label(); - Handle(TDataStd_Name) aName; - if(L.FindAttribute(TDataStd_Name::GetID(),aName)) { - aShapeName = aName->Get(); - HasName = true; + if (S.IsEqual(TopoSh)) { + TDF_Label L = anAttr->Label(); + Handle(TDataStd_Name) aName; + if (L.FindAttribute(TDataStd_Name::GetID(), aName)) { + aShapeName = aName->Get(); + HasName = true; + } } } + // END: try to find existed name for current shape - if(!HasName) { + if (!HasName) { // asv : 11.11.04 Introducing a more sofisticated method of name creation, just as // it is done in GUI in GEOMBase::GetDefaultName() - not just add a Tag() == number // of objects in the study, but compute a number of objects with the same prefix @@ -307,8 +309,8 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_var obj; TCollection_AsciiString aNewShapeName; do { - aNewShapeName = aShapeName + TCollection_AsciiString(++i); - obj = theStudy->FindObject( aNewShapeName.ToCString() ); + aNewShapeName = aShapeName + TCollection_AsciiString(++i); + obj = theStudy->FindObject( aNewShapeName.ToCString() ); } while ( !obj->_is_nil() ); aShapeName = aNewShapeName; @@ -335,9 +337,9 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, SALOMEDS::ListOfStrings aListOfVars = aSections[i]; for(int j = 0, m = aListOfVars.length(); j < m; j++) { if(theStudy->IsVariable(aListOfVars[j].in())) - aVars += TCollection_AsciiString(aListOfVars[j].in()); + aVars += TCollection_AsciiString(aListOfVars[j].in()); if(j != m-1) - aVars += ":"; + aVars += ":"; } if(i != n-1) aVars += "|"; @@ -361,12 +363,12 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy, // purpose : auxilary for PublishNamedShapesInStudy //============================================================================ void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_var theMainShape, - const TopTools_IndexedMapOfShape& anIndices, - const TopTools_SequenceOfShape& SeqS, - const TColStd_SequenceOfAsciiString& SeqN, - const Standard_CString& GrName, - GEOM::ListOfGO_var aResList) + GEOM::GEOM_Object_var theMainShape, + const TopTools_IndexedMapOfShape& anIndices, + const TopTools_SequenceOfShape& SeqS, + const TColStd_SequenceOfAsciiString& SeqN, + const Standard_CString& GrName, + GEOM::ListOfGO_var aResList) { CORBA::String_var entry = theMainShape->GetEntry(); Handle(GEOM_Object) aMainShape = _impl->GetObject(theMainShape->GetStudyID(), entry); @@ -412,8 +414,8 @@ void GEOM_Gen_i::CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, //============================================================================ GEOM::ListOfGO* GEOM_Gen_i:: PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy, - //SALOMEDS::SObject_ptr theSObject, - CORBA::Object_ptr theObject) + //SALOMEDS::SObject_ptr theSObject, + CORBA::Object_ptr theObject) { //Unexpect aCatch(SALOME_SalomeException); GEOM::ListOfGO_var aResList = new GEOM::ListOfGO; @@ -442,20 +444,20 @@ GEOM::ListOfGO* GEOM_Gen_i:: if(L.FindAttribute(TDataStd_Name::GetID(),aName)) { TCollection_ExtendedString EName = aName->Get(); if(S.ShapeType()==TopAbs_SOLID) { - SolidSeqS.Append(S); - SolidSeqN.Append(aName->Get()); + SolidSeqS.Append(S); + SolidSeqN.Append(aName->Get()); } else if(S.ShapeType()==TopAbs_FACE) { - FaceSeqS.Append(S); - FaceSeqN.Append(aName->Get()); + FaceSeqS.Append(S); + FaceSeqN.Append(aName->Get()); } else if(S.ShapeType()==TopAbs_EDGE) { - EdgeSeqS.Append(S); - EdgeSeqN.Append(aName->Get()); + EdgeSeqS.Append(S); + EdgeSeqN.Append(aName->Get()); } else if(S.ShapeType()==TopAbs_VERTEX) { - VertSeqS.Append(S); - VertSeqN.Append(aName->Get()); + VertSeqS.Append(S); + VertSeqN.Append(aName->Get()); } } } @@ -464,16 +466,16 @@ GEOM::ListOfGO* GEOM_Gen_i:: TopExp::MapShapes(MainSh, anIndices); CreateAndPublishGroup(theStudy, theMainShape, anIndices, SolidSeqS, SolidSeqN, - "Group_Of_Named_Solids", aResList); + "Group_Of_Named_Solids", aResList); CreateAndPublishGroup(theStudy, theMainShape, anIndices, FaceSeqS, FaceSeqN, - "Group_Of_Named_Faces", aResList); + "Group_Of_Named_Faces", aResList); CreateAndPublishGroup(theStudy, theMainShape, anIndices, EdgeSeqS, EdgeSeqN, - "Group_Of_Named_Edges", aResList); + "Group_Of_Named_Edges", aResList); CreateAndPublishGroup(theStudy, theMainShape, anIndices, VertSeqS, VertSeqN, - "Group_Of_Named_Vertices", aResList); + "Group_Of_Named_Vertices", aResList); return aResList._retn(); } @@ -484,8 +486,8 @@ GEOM::ListOfGO* GEOM_Gen_i:: // purpose : save OCAF/Geom document //============================================================================ SALOMEDS::TMPFile* GEOM_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool isMultiFile) { + const char* theURL, + bool isMultiFile) { SALOMEDS::TMPFile_var aStreamFile; // Get a temporary directory to store a file std::string aTmpDir = (isMultiFile)?theURL:SALOMEDS_Tool::GetTmpDir(); @@ -529,8 +531,8 @@ SALOMEDS::TMPFile* GEOM_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, // purpose : //============================================================================ SALOMEDS::TMPFile* GEOM_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool isMultiFile) { + const char* theURL, + bool isMultiFile) { SALOMEDS::TMPFile_var aStreamFile = Save(theComponent, theURL, isMultiFile); return aStreamFile._retn(); } @@ -541,9 +543,9 @@ SALOMEDS::TMPFile* GEOM_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent, // purpose : //============================================================================ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile& theStream, - const char* theURL, - bool isMultiFile) { + const SALOMEDS::TMPFile& theStream, + const char* theURL, + bool isMultiFile) { if (theStream.length() <= 9) { MESSAGE("The TMPFile is too short : " << theStream.length() << " bytes "); @@ -593,9 +595,9 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, // purpose : //============================================================================ CORBA::Boolean GEOM_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile& theStream, - const char* theURL, - bool isMultiFile) { + const SALOMEDS::TMPFile& theStream, + const char* theURL, + bool isMultiFile) { return Load(theComponent, theStream, theURL, isMultiFile); } @@ -671,15 +673,15 @@ CORBA::Boolean GEOM_Gen_i::CanPaste(const char* theComponentName, CORBA::Long th // purpose : //============================================================================ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, - CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theObject) { + CORBA::Long theObjectID, + SALOMEDS::SObject_ptr theObject) { // Find the current Study and StudyBuilder SALOMEDS::Study_var aStudy = theObject->GetStudy(); SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); // Retrieve a TopoDS_Shape from byte stream TopoDS_Shape aTopology; - std::istrstream aStreamedBrep((char*) &theStream[0], theStream.length()); + std::istringstream aStreamedBrep((char*) &theStream[0]); BRep_Builder aBuilder; try { BRepTools::Read(aTopology, aStreamedBrep, aBuilder); @@ -731,9 +733,9 @@ char* GEOM_Gen_i::ComponentDataType() // purpose : //============================================================================ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, - const char* theName, - GEOM::GEOM_Object_ptr theFather) + GEOM::GEOM_Object_ptr theObject, + const char* theName, + GEOM::GEOM_Object_ptr theFather) { SALOMEDS::SObject_var aResultSO; if(theObject->_is_nil() || theStudy->_is_nil()) return aResultSO; @@ -779,7 +781,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (SALOMEDS::Study_ptr theStudy, // To be used from python scripts out of geompy.addToStudy (non-default usage) //============================================================================ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesO (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, + GEOM::GEOM_Object_ptr theObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, @@ -803,6 +805,36 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesO (SALOMEDS::Study_ptr theStudy, return aParts._retn(); } +//============================================================================ +// function : RestoreGivenSubShapesO +// purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments. +// To be used from python scripts, generated by Dump Python. +//============================================================================ +GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesO (SALOMEDS::Study_ptr theStudy, + GEOM::GEOM_Object_ptr theObject, + const GEOM::ListOfGO& theArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theInheritFirstArg, + CORBA::Boolean theAddPrefix) +{ + GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; + if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject)) + return aParts._retn(); + + // find SObject in the study if it is already published + CORBA::String_var anIORo = _orb->object_to_string(theObject); + SALOMEDS::SObject_var aSO = theStudy->FindObjectIOR(anIORo.in()); + //PTv, IMP 0020001, The salome object + // is not obligatory in case of invokation from script + // if (CORBA::is_nil(aSO)) + // return aParts._retn(); + + aParts = RestoreGivenSubShapes(theStudy, theObject, aSO, theArgs, + theFindMethod, theInheritFirstArg, theAddPrefix); + if (!CORBA::is_nil(aSO)) aSO->Destroy(); + return aParts._retn(); +} + //============================================================================ // function : RestoreSubShapesSO // purpose : Publish sub-shapes, standing for arguments and sub-shapes of arguments. @@ -868,11 +900,11 @@ static void addToListOfGO( const GEOM::ListOfGO& theSrcList, // are defined, and does not check, if they correspond to each other. //============================================================================ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, - SALOMEDS::SObject_ptr theSObject, - const GEOM::ListOfGO& theArgs, - GEOM::find_shape_method theFindMethod, - CORBA::Boolean theInheritFirstArg, + GEOM::GEOM_Object_ptr theObject, + SALOMEDS::SObject_ptr theSObject, + const GEOM::ListOfGO& theArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix) { GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; @@ -881,6 +913,9 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/) return aParts._retn(); + // For Dump Python (mantis issue 0020768) + GEOM::ListOfGO_var anOutArgs = new GEOM::ListOfGO; + // Arguments to be published GEOM::ListOfGO_var aList; @@ -912,10 +947,21 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, CORBA::String_var anIOR = _orb->object_to_string(aList[0]); SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in()); - aParts = RestoreSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, theFindMethod, theAddPrefix); + // remember restored objects for Python Dump + addToListOfGO(aList[0], anOutArgs); + + aParts = RestoreSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, + anOutArgs, theFindMethod, theAddPrefix); // set the color of the transformed shape to the color of initial shape theObject->SetColor(aList[0]->GetColor()); + // set the texture + if (theObject->GetShapeType() == GEOM::VERTEX) { + theObject->SetMarkerStd(aList[0]->GetMarkerType(), aList[0]->GetMarkerSize()); + if (aList[0]->GetMarkerType() == GEOM::MT_USER) + theObject->SetMarkerTexture(aList[0]->GetMarkerTexture()); + } + anArgSO->Destroy(); } else { @@ -989,6 +1035,522 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, {} } + if (!CORBA::is_nil(aSubO)) { + // remember restored objects for Python Dump + addToListOfGO(anArgO, anOutArgs); + + // add to parts list + addToListOfGO( aSubO, aParts ); + + // Publish the sub-shape + SALOMEDS::SObject_var aSubSO; + if (!CORBA::is_nil(theSObject)) { + TCollection_AsciiString aSubName; + if (theAddPrefix) { + aSubName = "from_"; + } + aSubName += anArgName; + aSubSO = aStudyBuilder->NewObject(theSObject); + aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); + // Restore color + aSubO->SetColor(anArgO->GetColor()); + // set the texture + if (aSubO->GetShapeType() == GEOM::VERTEX) { + aSubO->SetMarkerStd(anArgO->GetMarkerType(), anArgO->GetMarkerSize()); + if (anArgO->GetMarkerType() == GEOM::MT_USER) + aSubO->SetMarkerTexture(anArgO->GetMarkerTexture()); + } + } + + if (!CORBA::is_nil(anArgSO)) { + // Restore published sub-shapes of the argument + GEOM::ListOfGO_var aSubParts; + if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) + // pass theObject, because only it has the history + aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, + theObject, anOutArgs, theFindMethod, theAddPrefix); + else + aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, + aSubO, anOutArgs, theFindMethod, theAddPrefix); + // add to parts list + addToListOfGO( aSubParts, aParts ); + } + } + else { // GetInPlace failed, try to build from published parts + if (!CORBA::is_nil(anArgSO)) { + SALOMEDS::SObject_var aSubSO; + if (!CORBA::is_nil(theSObject)) + aSubSO = aStudyBuilder->NewObject(theSObject); + + // Restore published sub-shapes of the argument + GEOM::ListOfGO_var aSubParts = + RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, + theObject, anOutArgs, theFindMethod, theAddPrefix); + + // add to parts list + addToListOfGO( aSubParts, aParts ); + + if (aSubParts->length() > 0) { + // remember restored objects for Python Dump + addToListOfGO(anArgO, anOutArgs); + + // try to build an argument from a set of its sub-shapes, + // that published and will be reconstructed + if (aSubParts->length() > 1) { + aSubO = aShapesOp->MakeCompound(aSubParts); + // add to parts list + addToListOfGO( aSubO, aParts ); + } + else { + aSubO = aSubParts[0]; + } + if (!CORBA::is_nil(aSubO) && !CORBA::is_nil(aSubSO)) { + // Publish the sub-shape + TCollection_AsciiString aSubName; + if (theAddPrefix) { + aSubName = "from_parts_of_"; + } + aSubName += anArgName; + aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); + // Restore color + aSubO->SetColor(anArgO->GetColor()); + // set the texture + if (aSubO->GetShapeType() == GEOM::VERTEX) { + aSubO->SetMarkerStd(anArgO->GetMarkerType(), anArgO->GetMarkerSize()); + if (anArgO->GetMarkerType() == GEOM::MT_USER) + aSubO->SetMarkerTexture(anArgO->GetMarkerTexture()); + } + } + } + else if (!CORBA::is_nil(aSubSO)) { + // remove created aSubSO, because no parts have been found + aStudyBuilder->RemoveObject(aSubSO); + } + } + } // try to build from published parts + anArgSO->Destroy(); + } + } // process arguments + } + std::set anObjEntryMap; + GEOM::ListOfGO_var aResParts = new GEOM::ListOfGO; + int nbRes = 0; + int nb = aParts->length(); + aResParts->length(nb); + if (nb > 0) + { + Handle(GEOM_Object) aMainObj = _impl->GetObject(theObject->GetStudyID(), theObject->GetEntry()); + Handle(GEOM_Function) aFunction = aMainObj->GetLastFunction(); + GEOM::TPythonDump pd (aFunction, true); + pd <<"["; + int i = 0, j = 0; + for ( ; i < nb; i++ ) + { + GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_duplicate( aParts[ i ] ); + if (CORBA::is_nil(anObj)) + continue; + char* anEntry = anObj->GetEntry(); + if (anObjEntryMap.count(anEntry)) + continue; // already treated + anObjEntryMap.insert(anEntry); + aResParts[nbRes++] = anObj; + // clear python dump of object + Handle(GEOM_Object) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anEntry); + Handle(GEOM_Function) anObjFun = aGeomObj->GetLastFunction(); + if ( !anObjFun.IsNull() ) + anObjFun->SetDescription( "" ); + if ( j > 0 ) + pd << ", "; + pd << aGeomObj; + j++; + } + pd <<"]" << " = geompy.RestoreGivenSubShapes(" << aMainObj << ", " << "["; + //i = 0; nb = theArgs.length(); j = 0; + i = 0; nb = anOutArgs->length(); j = 0; + for ( ; i < nb; i++ ) + { + //GEOM::GEOM_Object_var anObj = theArgs[ i ]; + GEOM::GEOM_Object_var anObj = anOutArgs[ i ]; + if (CORBA::is_nil(anObj)) + continue; + Handle(GEOM_Object) aGeomObj = _impl->GetObject(anObj->GetStudyID(), anObj->GetEntry()); + if ( j > 0 ) + pd << ", "; + pd << aGeomObj; + j++; + } + pd <<"]" << ", " <<"geompy.GEOM."; + switch (theFindMethod) { + case GEOM::FSM_GetInPlace: + pd << "FSM_GetInPlace"; break; + case GEOM::FSM_Transformed: + pd << "FSM_Transformed"; break; + case GEOM::FSM_GetSame: + pd << "FSM_GetSame"; break; + case GEOM::FSM_GetShapesOnShape: + pd << "FSM_GetShapesOnShape"; break; + case GEOM::FSM_GetInPlaceByHistory: + default: + pd << "FSM_GetInPlaceByHistory"; break; + } + pd << ", " << theInheritFirstArg << ", " << theAddPrefix << ")"; + } + aResParts->length(nbRes); + return aResParts._retn(); +} + +//============================================================================ +// function : RestoreSubShapesOneLevel +// purpose : Private method +//============================================================================ +GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theOldSO, + SALOMEDS::SObject_ptr theNewSO, + GEOM::GEOM_Object_ptr theNewO, + GEOM::ListOfGO& theOutArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theAddPrefix) +{ + int i = 0; + GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; + GEOM::ListOfGO_var aNewParts = new GEOM::ListOfGO; + if (CORBA::is_nil(theStudy) || CORBA::is_nil(theOldSO) || + CORBA::is_nil(theNewO) /*|| CORBA::is_nil(theNewSO)*/) + return aParts._retn(); + + SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); + + // Get interface, containing method, which we will use to reconstruct sub-shapes + GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId()); + GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId()); + + // Reconstruct published sub-shapes + SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO); + + int aLen = 0; + for (it->Init(); it->More(); it->Next()) { + aLen++; + } + aParts->length(aLen); + + for (it->Init(); it->More(); it->Next()) { + SALOMEDS::SObject_var anOldSubSO = it->Value(); + + TCollection_AsciiString anArgName = anOldSubSO->GetName(); + + SALOMEDS::GenericAttribute_var anAttr; + if (anOldSubSO->FindAttribute(anAttr, "AttributeIOR")) { + SALOMEDS::AttributeIOR_var anAttrIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); + GEOM::GEOM_Object_var anOldSubO = + GEOM::GEOM_Object::_narrow(_orb->string_to_object(anAttrIOR->Value())); + if (!CORBA::is_nil(anOldSubO)) { + // Find a sub-shape of theNewO in place of anOldSubO + GEOM::GEOM_Object_var aNewSubO; + switch (theFindMethod) { + case GEOM::FSM_GetInPlace: + { + // Use GetInPlace + aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO); + } + break; + case GEOM::FSM_Transformed: + { + // transformation, cannot use GetInPlace, operate with indices + GEOM::ListOfLong_var anIDs = anOldSubO->GetSubShapeIndices(); + if (anIDs->length() > 1) { + // group + aNewSubO = aGroupOp->CreateGroup(theNewO, aGroupOp->GetType(anOldSubO)); + if (!CORBA::is_nil(aNewSubO)) + aGroupOp->UnionIDs(aNewSubO, anIDs); + } + else { + // single sub-shape + aNewSubO = aShapesOp->GetSubShape(theNewO, anIDs[0]); + } + } + break; + case GEOM::FSM_GetSame: + { + // Use GetSame + aNewSubO = aShapesOp->GetSame(theNewO, anOldSubO); + } + break; + case GEOM::FSM_GetShapesOnShape: + { + // Use GetShapesOnShape. Can work only on solids, so it has sense to search only solids + aNewSubO = aShapesOp->GetShapesOnShapeAsCompound(anOldSubO, theNewO, + (short)GEOM::SOLID, GEOM::ST_ONIN); + } + break; + case GEOM::FSM_GetInPlaceByHistory: + { + // Use GetInPlaceByHistory + aNewSubO = aShapesOp->GetInPlaceByHistory(theNewO, anOldSubO); + } + break; + default: + {} + } + + if (!CORBA::is_nil(aNewSubO)) { + // remember restored objects for Python Dump + addToListOfGO(anOldSubO, theOutArgs); + + // add the part to the list + aParts[i] = aNewSubO; + i++; + // add to parts list + addToListOfGO( aNewSubO, aNewParts ); + + SALOMEDS::SObject_var aNewSubSO; + if (!CORBA::is_nil(theNewSO)) { + // Publish the sub-shape + TCollection_AsciiString aSubName; + if (theAddPrefix) { + aSubName = "from_"; + } + aSubName += anArgName; + aNewSubSO = aStudyBuilder->NewObject(theNewSO); + aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); + // Restore color + aNewSubO->SetColor(anOldSubO->GetColor()); + // set the texture + if (aNewSubO->GetShapeType() == GEOM::VERTEX) { + aNewSubO->SetMarkerStd(anOldSubO->GetMarkerType(), anOldSubO->GetMarkerSize()); + if (anOldSubO->GetMarkerType() == GEOM::MT_USER) + aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture()); + } + } + // Restore published sub-shapes of the argument + GEOM::ListOfGO_var aSubParts; + if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) + // pass the main shape as Object, because only it has the history + aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + theNewO, theOutArgs, theFindMethod, theAddPrefix); + else + aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + aNewSubO, theOutArgs, theFindMethod, theAddPrefix); + // add to parts list + addToListOfGO( aSubParts, aNewParts ); + } + else { // GetInPlace failed, try to build from published parts + SALOMEDS::SObject_var aNewSubSO; + if (!CORBA::is_nil(theNewSO)) + aNewSubSO = aStudyBuilder->NewObject(theNewSO); + + // Restore published sub-shapes of the argument + GEOM::ListOfGO_var aSubParts = + RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + theNewO, theOutArgs, theFindMethod, theAddPrefix); + // add to parts list + addToListOfGO( aSubParts, aNewParts ); + + if (aSubParts->length() > 0) { + // remember restored objects for Python Dump + addToListOfGO(anOldSubO, theOutArgs); + + // try to build an object from a set of its sub-shapes, + // that published and will be reconstructed + if (aSubParts->length() > 1) { + aNewSubO = aShapesOp->MakeCompound(aSubParts); + // add to parts list + addToListOfGO( aNewSubO, aNewParts ); + } + else { + aNewSubO = aSubParts[0]; + } + + if (!CORBA::is_nil(aNewSubO)) { + // add the part to the list + aSubParts[i] = aNewSubO; + i++; + + // Publish the sub-shape + if (!CORBA::is_nil(aNewSubSO)) { + TCollection_AsciiString aSubName; + if (theAddPrefix) { + aSubName = "from_parts_of_"; + } + aSubName += anArgName; + aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); + // Restore color + aNewSubO->SetColor(anOldSubO->GetColor()); + // set the texture + if (aNewSubO->GetShapeType() == GEOM::VERTEX) { + aNewSubO->SetMarkerStd(anOldSubO->GetMarkerType(), anOldSubO->GetMarkerSize()); + if (anOldSubO->GetMarkerType() == GEOM::MT_USER) + aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture()); + } + } + } + } + else if (!CORBA::is_nil(aNewSubSO)) { + // remove created aSubSO, because no parts have been found + aStudyBuilder->RemoveObject(aNewSubSO); + } + } // try to build from published parts + } + } + } // iterate on published sub-shapes + + aParts->length(i); + // add to parts list + addToListOfGO( aNewParts, aParts ); + return aParts._retn(); +} + +//============================================================================ +// function : RestoreGivenSubShapes +// purpose : Private method. Works only if both theObject and theSObject +// are defined, and does not check, if they correspond to each other. +// List theArgs in this case contains not only operation arguments, +// but also all subshapes, which must be published. +//============================================================================ +GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStudy, + GEOM::GEOM_Object_ptr theObject, + SALOMEDS::SObject_ptr theSObject, + const GEOM::ListOfGO& theArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theInheritFirstArg, + CORBA::Boolean theAddPrefix) +{ + GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; + //PTv, IMP 0020001, The salome object + // is not obligatory in case of invokation from script + if (CORBA::is_nil(theStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/) + return aParts._retn(); + + // If theArgs list is empty, nothing to do + Standard_Integer aLength = theArgs.length(); + if (aLength == 0) + return aParts._retn(); + + // Get all arguments + GEOM::ListOfGO_var anOpArgsList = theObject->GetDependency(); + Standard_Integer nbArgsActual = anOpArgsList->length(); + + // If anOpArgsList list is empty, nothing to do + if (nbArgsActual == 0) + return aParts._retn(); + + // Entries of arguments and subshapes + std::set anArgs; + for (int i = 0; i < aLength; i++) { + CORBA::String_var anEntry = theArgs[i]->GetEntry(); + anArgs.insert(anEntry.in()); + } + + // Arguments to be published + // We try to publish all arguments, that are in theArgs list + GEOM::ListOfGO_var aList = new GEOM::ListOfGO; + aList->length(nbArgsActual); + + int k = 0; + for (int j = 0; j < nbArgsActual; j++) { + CORBA::String_var anEntry = anOpArgsList[j]->GetEntry(); + if (anArgs.count(anEntry.in())) { + aList[k] = GEOM::GEOM_Object::_duplicate(anOpArgsList[j]); + k++; + } + } + nbArgsActual = k; + //aList->length(nbArgsActual); + + if (nbArgsActual < 1) + return aParts._retn(); + + if (theInheritFirstArg || (nbArgsActual == 1)) { + // Do not publish argument's reflection, + // but only reconstruct its published sub-shapes + + CORBA::String_var anIOR = _orb->object_to_string(aList[0]); + SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in()); + + aParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, theSObject, theObject, + anArgs, theFindMethod, theAddPrefix); + + // set the color of the transformed shape to the color of initial shape + theObject->SetColor(aList[0]->GetColor()); + // set the texture + if (theObject->GetShapeType() == GEOM::VERTEX) { + theObject->SetMarkerStd(aList[0]->GetMarkerType(), aList[0]->GetMarkerSize()); + if (aList[0]->GetMarkerType() == GEOM::MT_USER) + theObject->SetMarkerTexture(aList[0]->GetMarkerTexture()); + } + + anArgSO->Destroy(); + } + else { + // Get interface, containing method, which we will use to reconstruct sub-shapes + GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId()); + GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId()); + + // Reconstruct arguments and tree of sub-shapes of the arguments + CORBA::String_var anIOR; + SALOMEDS::StudyBuilder_var aStudyBuilder = theStudy->NewBuilder(); + for (Standard_Integer i = 0; i < nbArgsActual; i++) + { + GEOM::GEOM_Object_var anArgO = aList[i]; + if (!CORBA::is_nil(anArgO)) { + anIOR = _orb->object_to_string(anArgO); + SALOMEDS::SObject_var anArgSO = theStudy->FindObjectIOR(anIOR.in()); + TCollection_AsciiString anArgName; + if (CORBA::is_nil(anArgSO)) { + anArgName = "arg_"; + anArgName += TCollection_AsciiString(i); + } + else { + anArgName = anArgSO->GetName(); + } + + // Find a sub-shape of theObject in place of the argument + GEOM::GEOM_Object_var aSubO; + switch (theFindMethod) { + case GEOM::FSM_GetInPlace: + { + // Use GetInPlace + aSubO = aShapesOp->GetInPlace(theObject, anArgO); + } + break; + case GEOM::FSM_Transformed: + { + // transformation, cannot use GetInPlace, operate with indices + GEOM::ListOfLong_var anIDs = anArgO->GetSubShapeIndices(); + if (anIDs->length() > 1) { + // group + aSubO = aGroupOp->CreateGroup(theObject, aGroupOp->GetType(anArgO)); + if (!CORBA::is_nil(aSubO)) + aGroupOp->UnionIDs(aSubO, anIDs); + } + else if (anIDs->length() > 0) { + // single sub-shape + aSubO = aShapesOp->GetSubShape(theObject, anIDs[0]); + } + } + break; + case GEOM::FSM_GetSame: + { + // Use GetSame + aSubO = aShapesOp->GetSame(theObject, anArgO); + } + break; + case GEOM::FSM_GetShapesOnShape: + { + // Use GetShapesOnShape. Can work only on solids, so it has sense to search only solids + aSubO = aShapesOp->GetShapesOnShapeAsCompound(anArgO, theObject, + (short)GEOM::SOLID, GEOM::ST_ONIN); + } + break; + case GEOM::FSM_GetInPlaceByHistory: + { + // Use GetInPlaceByHistory + aSubO = aShapesOp->GetInPlaceByHistory(theObject, anArgO); + } + break; + default: + {} + } + if (!CORBA::is_nil(aSubO)) { // add to parts list addToListOfGO( aSubO, aParts ); @@ -1005,6 +1567,12 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); // Restore color aSubO->SetColor(anArgO->GetColor()); + // set the texture + if (aSubO->GetShapeType() == GEOM::VERTEX) { + aSubO->SetMarkerStd(anArgO->GetMarkerType(), anArgO->GetMarkerSize()); + if (anArgO->GetMarkerType() == GEOM::MT_USER) + aSubO->SetMarkerTexture(anArgO->GetMarkerTexture()); + } } if (!CORBA::is_nil(anArgSO)) { @@ -1012,11 +1580,11 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, GEOM::ListOfGO_var aSubParts; if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) // pass theObject, because only it has the history - aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, - theObject, theFindMethod, theAddPrefix); + aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO, + theObject, anArgs, theFindMethod, theAddPrefix); else - aSubParts = RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, - aSubO, theFindMethod, theAddPrefix); + aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO, + aSubO, anArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aParts ); } @@ -1029,8 +1597,8 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, // Restore published sub-shapes of the argument GEOM::ListOfGO_var aSubParts = - RestoreSubShapesOneLevel(theStudy, anArgSO, aSubSO, - theObject, theFindMethod, theAddPrefix); + RestoreGivenSubShapesOneLevel(theStudy, anArgSO, aSubSO, + theObject, anArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aParts ); @@ -1056,6 +1624,12 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, aSubSO = PublishInStudy(theStudy, aSubSO, aSubO, aSubName.ToCString()); // Restore color aSubO->SetColor(anArgO->GetColor()); + // set the texture + if (aSubO->GetShapeType() == GEOM::VERTEX) { + aSubO->SetMarkerStd(anArgO->GetMarkerType(), anArgO->GetMarkerSize()); + if (anArgO->GetMarkerType() == GEOM::MT_USER) + aSubO->SetMarkerTexture(anArgO->GetMarkerTexture()); + } } } else if (!CORBA::is_nil(aSubSO)) { @@ -1100,7 +1674,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, pd << aGeomObj; j++; } - pd <<"]" << " = geompy.RestoreSubShapes(" << aMainObj << ", " << "["; + pd <<"]" << " = geompy.RestoreGivenSubShapes(" << aMainObj << ", " << "["; i = 0; nb = theArgs.length(); j = 0; for ( ; i < nb; i++ ) { @@ -1134,15 +1708,16 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy, } //============================================================================ -// function : RestoreSubShapesOneLevel +// function : RestoreGivenSubShapesOneLevel // purpose : Private method //============================================================================ -GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theOldSO, - SALOMEDS::SObject_ptr theNewSO, - GEOM::GEOM_Object_ptr theNewO, - GEOM::find_shape_method theFindMethod, - CORBA::Boolean theAddPrefix) +GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theOldSO, + SALOMEDS::SObject_ptr theNewSO, + GEOM::GEOM_Object_ptr theNewO, + std::set theArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theAddPrefix) { int i = 0; GEOM::ListOfGO_var aParts = new GEOM::ListOfGO; @@ -1175,135 +1750,155 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th if (anOldSubSO->FindAttribute(anAttr, "AttributeIOR")) { SALOMEDS::AttributeIOR_var anAttrIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); GEOM::GEOM_Object_var anOldSubO = - GEOM::GEOM_Object::_narrow(_orb->string_to_object(anAttrIOR->Value())); - if (!CORBA::is_nil(anOldSubO)) { - // Find a sub-shape of theNewO in place of anOldSubO - GEOM::GEOM_Object_var aNewSubO; - switch (theFindMethod) { - case GEOM::FSM_GetInPlace: - { - // Use GetInPlace - aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO); - } - break; - case GEOM::FSM_Transformed: - { - // transformation, cannot use GetInPlace, operate with indices - GEOM::ListOfLong_var anIDs = anOldSubO->GetSubShapeIndices(); - if (anIDs->length() > 1) { - // group - aNewSubO = aGroupOp->CreateGroup(theNewO, aGroupOp->GetType(anOldSubO)); - if (!CORBA::is_nil(aNewSubO)) - aGroupOp->UnionIDs(aNewSubO, anIDs); - } - else { - // single sub-shape - aNewSubO = aShapesOp->GetSubShape(theNewO, anIDs[0]); - } - } - break; - case GEOM::FSM_GetSame: - { - // Use GetSame - aNewSubO = aShapesOp->GetSame(theNewO, anOldSubO); - } - break; - case GEOM::FSM_GetShapesOnShape: - { - // Use GetShapesOnShape. Can work only on solids, so it has sense to search only solids - aNewSubO = aShapesOp->GetShapesOnShapeAsCompound(anOldSubO, theNewO, - (short)GEOM::SOLID, GEOM::ST_ONIN); - } - break; - case GEOM::FSM_GetInPlaceByHistory: - { - // Use GetInPlaceByHistory - aNewSubO = aShapesOp->GetInPlaceByHistory(theNewO, anOldSubO); - } - break; - default: - {} - } + GEOM::GEOM_Object::_narrow(_orb->string_to_object(anAttrIOR->Value())); - if (!CORBA::is_nil(aNewSubO)) { - // add the part to the list - aParts[i] = aNewSubO; - i++; + bool okToContinue = false; + + if (!CORBA::is_nil(anOldSubO)) { + CORBA::String_var anEntry = anOldSubO->GetEntry(); + okToContinue = theArgs.count(anEntry.in()); + } + + if (okToContinue) { + // Find a sub-shape of theNewO in place of anOldSubO + GEOM::GEOM_Object_var aNewSubO; + switch (theFindMethod) { + case GEOM::FSM_GetInPlace: + { + // Use GetInPlace + aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO); + } + break; + case GEOM::FSM_Transformed: + { + // transformation, cannot use GetInPlace, operate with indices + GEOM::ListOfLong_var anIDs = anOldSubO->GetSubShapeIndices(); + if (anIDs->length() > 1) { + // group + aNewSubO = aGroupOp->CreateGroup(theNewO, aGroupOp->GetType(anOldSubO)); + if (!CORBA::is_nil(aNewSubO)) + aGroupOp->UnionIDs(aNewSubO, anIDs); + } + else { + // single sub-shape + aNewSubO = aShapesOp->GetSubShape(theNewO, anIDs[0]); + } + } + break; + case GEOM::FSM_GetSame: + { + // Use GetSame + aNewSubO = aShapesOp->GetSame(theNewO, anOldSubO); + } + break; + case GEOM::FSM_GetShapesOnShape: + { + // Use GetShapesOnShape. Can work only on solids, so it has sense to search only solids + aNewSubO = aShapesOp->GetShapesOnShapeAsCompound(anOldSubO, theNewO, + (short)GEOM::SOLID, GEOM::ST_ONIN); + } + break; + case GEOM::FSM_GetInPlaceByHistory: + { + // Use GetInPlaceByHistory + aNewSubO = aShapesOp->GetInPlaceByHistory(theNewO, anOldSubO); + } + break; + default: + {} + } + + if (!CORBA::is_nil(aNewSubO)) { + // add the part to the list + aParts[i] = aNewSubO; + i++; // add to parts list addToListOfGO( aNewSubO, aNewParts ); SALOMEDS::SObject_var aNewSubSO; if (!CORBA::is_nil(theNewSO)) { - // Publish the sub-shape + // Publish the sub-shape TCollection_AsciiString aSubName; if (theAddPrefix) { aSubName = "from_"; } - aSubName += anArgName; - aNewSubSO = aStudyBuilder->NewObject(theNewSO); - aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); - // Restore color - aNewSubO->SetColor(anOldSubO->GetColor()); + aSubName += anArgName; + aNewSubSO = aStudyBuilder->NewObject(theNewSO); + aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); + // Restore color + aNewSubO->SetColor(anOldSubO->GetColor()); + // set the texture + if (aNewSubO->GetShapeType() == GEOM::VERTEX) { + aNewSubO->SetMarkerStd(anOldSubO->GetMarkerType(), anOldSubO->GetMarkerSize()); + if (anOldSubO->GetMarkerType() == GEOM::MT_USER) + aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture()); + } } - // Restore published sub-shapes of the argument - GEOM::ListOfGO_var aSubParts; - if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) - // pass the main shape as Object, because only it has the history - aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, - theNewO, theFindMethod, theAddPrefix); - else - aSubParts = RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, - aNewSubO, theFindMethod, theAddPrefix); + // Restore published sub-shapes of the argument + GEOM::ListOfGO_var aSubParts; + if (theFindMethod == GEOM::FSM_GetInPlaceByHistory) + // pass the main shape as Object, because only it has the history + aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + theNewO, theArgs, theFindMethod, theAddPrefix); + else + aSubParts = RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + aNewSubO, theArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aNewParts ); - } - else { // GetInPlace failed, try to build from published parts - SALOMEDS::SObject_var aNewSubSO; + } + else { // GetInPlace failed, try to build from published parts + SALOMEDS::SObject_var aNewSubSO; if (!CORBA::is_nil(theNewSO)) aNewSubSO = aStudyBuilder->NewObject(theNewSO); - // Restore published sub-shapes of the argument - GEOM::ListOfGO_var aSubParts = - RestoreSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, - theNewO, theFindMethod, theAddPrefix); + // Restore published sub-shapes of the argument + GEOM::ListOfGO_var aSubParts = + RestoreGivenSubShapesOneLevel(theStudy, anOldSubSO, aNewSubSO, + theNewO, theArgs, theFindMethod, theAddPrefix); // add to parts list addToListOfGO( aSubParts, aNewParts ); - if (aSubParts->length() > 0) { - // try to build an object from a set of its sub-shapes, - // that published and will be reconstructed - if (aSubParts->length() > 1) { - aNewSubO = aShapesOp->MakeCompound(aSubParts); + if (aSubParts->length() > 0) { + // try to build an object from a set of its sub-shapes, + // that published and will be reconstructed + if (aSubParts->length() > 1) { + aNewSubO = aShapesOp->MakeCompound(aSubParts); // add to parts list addToListOfGO( aNewSubO, aNewParts ); - } - else { - aNewSubO = aSubParts[0]; - } + } + else { + aNewSubO = aSubParts[0]; + } - if (!CORBA::is_nil(aNewSubO)) { - // add the part to the list - aSubParts[i] = aNewSubO; - i++; + if (!CORBA::is_nil(aNewSubO)) { + // add the part to the list + aSubParts[i] = aNewSubO; + i++; - // Publish the sub-shape - if (!CORBA::is_nil(aNewSubSO)) { + // Publish the sub-shape + if (!CORBA::is_nil(aNewSubSO)) { TCollection_AsciiString aSubName; if (theAddPrefix) { aSubName = "from_parts_of_"; } - aSubName += anArgName; - aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); - // Restore color - aNewSubO->SetColor(anOldSubO->GetColor()); + aSubName += anArgName; + aNewSubSO = PublishInStudy(theStudy, aNewSubSO, aNewSubO, aSubName.ToCString()); + // Restore color + aNewSubO->SetColor(anOldSubO->GetColor()); + // set the texture + if (aNewSubO->GetShapeType() == GEOM::VERTEX) { + aNewSubO->SetMarkerStd(anOldSubO->GetMarkerType(), anOldSubO->GetMarkerSize()); + if (anOldSubO->GetMarkerType() == GEOM::MT_USER) + aNewSubO->SetMarkerTexture(anOldSubO->GetMarkerTexture()); + } } - } - } - else if (!CORBA::is_nil(aNewSubSO)) { - // remove created aSubSO, because no parts have been found - aStudyBuilder->RemoveObject(aNewSubSO); - } - } // try to build from published parts + } + } + else if (!CORBA::is_nil(aNewSubSO)) { + // remove created aSubSO, because no parts have been found + aStudyBuilder->RemoveObject(aNewSubSO); + } + } // try to build from published parts } } } // iterate on published sub-shapes @@ -1611,7 +2206,7 @@ GEOM::GEOM_IAdvancedOperations_ptr GEOM_Gen_i::GetIAdvancedOperations(CORBA::Lon */ //============================================================================= GEOM::GEOM_Object_ptr GEOM_Gen_i::AddSubShape (GEOM::GEOM_Object_ptr theMainShape, - const GEOM::ListOfLong& theIndices) + const GEOM::ListOfLong& theIndices) { if (CORBA::is_nil(theMainShape) || theIndices.length() < 1) return GEOM::GEOM_Object::_nil(); @@ -1713,7 +2308,7 @@ bool GEOM_Gen_i::hasObjectInfo() char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry) { GEOM::GEOM_Object_var aGeomObject; - + CORBA::Object_var aSMObject = name_service->Resolve( "/myStudyManager" ); SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow( aSMObject ); SALOMEDS::Study_var aStudy = aStudyManager->GetStudyByID( studyId ); @@ -1732,7 +2327,7 @@ char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry) } if (!aSObj->_is_nil() ) aSObj->Destroy(); - + const char* aTypeInfo = "Object"; if ( !aGeomObject->_is_nil() ) { GEOM::GEOM_IKindOfShape::shape_kind aKind; @@ -1745,110 +2340,110 @@ char* GEOM_Gen_i::getObjectInfo(CORBA::Long studyId, const char* entry) if ( anOp->IsDone() ) { switch ( aKind ) { case GEOM::GEOM_IKindOfShape::COMPOUND: - aTypeInfo = "Compound"; - break; + aTypeInfo = "Compound"; + break; case GEOM::GEOM_IKindOfShape::COMPSOLID: - aTypeInfo = "CompSolid"; - break; + aTypeInfo = "CompSolid"; + break; case GEOM::GEOM_IKindOfShape::SHELL: - aTypeInfo = "Shell"; - break; + aTypeInfo = "Shell"; + break; case GEOM::GEOM_IKindOfShape::WIRE: - if ( anInts[0] == 1 ) - aTypeInfo = "Closed Wire"; - else if ( anInts[0] == 2 ) - aTypeInfo = "Opened Wire"; - else - aTypeInfo = "Wire"; - break; - // SOLIDs + if ( anInts[0] == 1 ) + aTypeInfo = "Closed Wire"; + else if ( anInts[0] == 2 ) + aTypeInfo = "Opened Wire"; + else + aTypeInfo = "Wire"; + break; + // SOLIDs case GEOM::GEOM_IKindOfShape::SPHERE: - aTypeInfo = "Sphere"; - break; + aTypeInfo = "Sphere"; + break; case GEOM::GEOM_IKindOfShape::CYLINDER: - aTypeInfo = "Cylinder"; - break; + aTypeInfo = "Cylinder"; + break; case GEOM::GEOM_IKindOfShape::BOX: case GEOM::GEOM_IKindOfShape::ROTATED_BOX: - aTypeInfo = "Box"; - break; + aTypeInfo = "Box"; + break; case GEOM::GEOM_IKindOfShape::TORUS: - aTypeInfo = "Torus"; - break; + aTypeInfo = "Torus"; + break; case GEOM::GEOM_IKindOfShape::CONE: - aTypeInfo = "Cone"; - break; + aTypeInfo = "Cone"; + break; case GEOM::GEOM_IKindOfShape::POLYHEDRON: - aTypeInfo = "Polyhedron"; - break; + aTypeInfo = "Polyhedron"; + break; case GEOM::GEOM_IKindOfShape::SOLID: - aTypeInfo = "Solid"; - break; - // FACEs + aTypeInfo = "Solid"; + break; + // FACEs case GEOM::GEOM_IKindOfShape::SPHERE2D: - aTypeInfo = "Spherical Face"; - break; + aTypeInfo = "Spherical Face"; + break; case GEOM::GEOM_IKindOfShape::CYLINDER2D: - aTypeInfo = "Cylindrical Face"; - break; + aTypeInfo = "Cylindrical Face"; + break; case GEOM::GEOM_IKindOfShape::TORUS2D: - aTypeInfo = "Toroidal Face"; - break; + aTypeInfo = "Toroidal Face"; + break; case GEOM::GEOM_IKindOfShape::CONE2D: - aTypeInfo = "Conical Face"; - break; + aTypeInfo = "Conical Face"; + break; case GEOM::GEOM_IKindOfShape::DISK_CIRCLE: - aTypeInfo = "Disk"; - break; + aTypeInfo = "Disk"; + break; case GEOM::GEOM_IKindOfShape::DISK_ELLIPSE: - aTypeInfo = "Elliptical Face"; - break; + aTypeInfo = "Elliptical Face"; + break; case GEOM::GEOM_IKindOfShape::POLYGON: - aTypeInfo = "Polygon"; - break; + aTypeInfo = "Polygon"; + break; case GEOM::GEOM_IKindOfShape::PLANE: - aTypeInfo = "Plane"; - break; + aTypeInfo = "Plane"; + break; case GEOM::GEOM_IKindOfShape::PLANAR: - aTypeInfo = "Planar Face"; - break; + aTypeInfo = "Planar Face"; + break; case GEOM::GEOM_IKindOfShape::FACE: - aTypeInfo = "Face"; - break; - // EDGEs + aTypeInfo = "Face"; + break; + // EDGEs case GEOM::GEOM_IKindOfShape::CIRCLE: - aTypeInfo = "Circle"; - break; + aTypeInfo = "Circle"; + break; case GEOM::GEOM_IKindOfShape::ARC_CIRCLE: - aTypeInfo = "Arc Circle"; - break; + aTypeInfo = "Arc Circle"; + break; case GEOM::GEOM_IKindOfShape::ELLIPSE: - aTypeInfo = "Ellipse"; - break; + aTypeInfo = "Ellipse"; + break; case GEOM::GEOM_IKindOfShape::ARC_ELLIPSE: - aTypeInfo = "Arc Ellipse"; - break; + aTypeInfo = "Arc Ellipse"; + break; case GEOM::GEOM_IKindOfShape::LINE: - aTypeInfo = "Line"; - break; + aTypeInfo = "Line"; + break; case GEOM::GEOM_IKindOfShape::SEGMENT: - aTypeInfo = "Segment"; - break; + aTypeInfo = "Segment"; + break; case GEOM::GEOM_IKindOfShape::EDGE: - aTypeInfo = "Edge"; - break; + aTypeInfo = "Edge"; + break; case GEOM::GEOM_IKindOfShape::VERTEX: - aTypeInfo = "Vertex"; - break; + aTypeInfo = "Vertex"; + break; default: - break; + break; } } } - + char* anInfo = new char[strlen("Module ") + strlen(ComponentDataType()) + strlen(", ") + strlen(aTypeInfo) + 3]; sprintf(anInfo, "Module %s, %s", ComponentDataType(), aTypeInfo); - + char* ret = CORBA::string_dup(anInfo); delete [] anInfo; return ret; @@ -1863,13 +2458,13 @@ extern "C" GEOM_I_EXPORT PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB*, PortableServer::POA*, PortableServer::ObjectId*, const char*, const char*); */ - + GEOM_I_EXPORT PortableServer::ObjectId* GEOMEngine_factory(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId* contId, - const char* instanceName, - const char* interfaceName) + PortableServer::POA_ptr poa, + PortableServer::ObjectId* contId, + const char* instanceName, + const char* interfaceName) { GEOM_Gen_i* myGEOM_Gen_i = new GEOM_Gen_i(orb, poa, contId, instanceName, interfaceName); return myGEOM_Gen_i->getId(); diff --git a/src/GEOM_I/GEOM_Gen_i.hh b/src/GEOM_I/GEOM_Gen_i.hh index cb8db42a2..9f24703c3 100644 --- a/src/GEOM_I/GEOM_Gen_i.hh +++ b/src/GEOM_I/GEOM_Gen_i.hh @@ -18,7 +18,6 @@ // 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 __GEOM_GEN_I_H__ #define __GEOM_GEN_I_H__ @@ -54,6 +53,9 @@ #include +#include +#include + //#include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC @@ -71,10 +73,10 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi // constructor to be called for servant creation. GEOM_Gen_i(); GEOM_Gen_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName); + PortableServer::POA_ptr poa, + PortableServer::ObjectId * contId, + const char *instanceName, + const char *interfaceName); // destructor, doing nothing (for now) virtual ~GEOM_Gen_i(); @@ -88,75 +90,85 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi //-----------------------------------------------------------------------// SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool isMultiFile); + const char* theURL, + bool isMultiFile); SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent, - const char* theURL, - bool isMultiFile); + const char* theURL, + bool isMultiFile); CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile& theStream, - const char* theURL, - bool isMultiFile); + const SALOMEDS::TMPFile& theStream, + const char* theURL, + bool isMultiFile); CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent, - const SALOMEDS::TMPFile& theStream, - const char* theURL, - bool isMultiFile); + const SALOMEDS::TMPFile& theStream, + const char* theURL, + bool isMultiFile); void Close(SALOMEDS::SComponent_ptr theComponent); char* ComponentDataType(); char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, - const char* IORString, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII); + const char* IORString, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII); char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, - const char* aLocalPersistentID, - CORBA::Boolean isMultiFile, - CORBA::Boolean isASCII); + const char* aLocalPersistentID, + CORBA::Boolean isMultiFile, + CORBA::Boolean isASCII); bool CanPublishInStudy(CORBA::Object_ptr theIOR); SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, - CORBA::Object_ptr theObject, - const char* theName) throw (SALOME::SALOME_Exception) ; + SALOMEDS::SObject_ptr theSObject, + CORBA::Object_ptr theObject, + const char* theName) throw (SALOME::SALOME_Exception) ; GEOM::ListOfGO* PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy, - CORBA::Object_ptr theObject); + CORBA::Object_ptr theObject); CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject); SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID); CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID); SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream, - CORBA::Long theObjectID, - SALOMEDS::SObject_ptr theObject); + CORBA::Long theObjectID, + SALOMEDS::SObject_ptr theObject); /*! \brief Adds theObject in the study with a name = theName, if * theFather is not null the object is placed under theFather */ SALOMEDS::SObject_ptr AddInStudy (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, - const char* theName, - GEOM::GEOM_Object_ptr theFather); + GEOM::GEOM_Object_ptr theObject, + const char* theName, + GEOM::GEOM_Object_ptr theFather); /*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments. * To be used from python scripts out of geompy.addToStudy (non-default usage) */ GEOM::ListOfGO* RestoreSubShapesO (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, + GEOM::GEOM_Object_ptr theObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix); + /*! \brief Publish sub-shapes, standing for given in \a theArgs arguments and sub-shapes. + * To be used from python scripts, generated by Dump Python. + */ + GEOM::ListOfGO* RestoreGivenSubShapesO (SALOMEDS::Study_ptr theStudy, + GEOM::GEOM_Object_ptr theObject, + const GEOM::ListOfGO& theArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theInheritFirstArg, + CORBA::Boolean theAddPrefix); + /*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments. * To be used from GUI and from geompy.addToStudy */ GEOM::ListOfGO* RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject, + SALOMEDS::SObject_ptr theSObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, @@ -230,7 +242,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi //Adds a new sub shape virtual GEOM::GEOM_Object_ptr AddSubShape (GEOM::GEOM_Object_ptr theMainShape, - const GEOM::ListOfLong& theIndices); + const GEOM::ListOfLong& theIndices); virtual void RemoveObject(GEOM::GEOM_Object_ptr theObject); @@ -239,17 +251,17 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi virtual GEOM::GEOM_Object_ptr GetIORFromString(const char* stringIOR); virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, - CORBA::Boolean& isValidScript); + CORBA::Boolean isPublished, + CORBA::Boolean& isValidScript); char* GetDumpName (const char* theStudyEntry); GEOM::string_array* GetAllDumpNames(); - + // Object information virtual bool hasObjectInfo(); virtual char* getObjectInfo(CORBA::Long studyId, const char* entry); - + //-----------------------------------------------------------------------// // Internal methods // //-----------------------------------------------------------------------// @@ -257,29 +269,46 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi virtual GEOM::GEOM_Object_ptr GetObject(CORBA::Long theStudyID, const char* theEntry); private: - GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theOldSO, - SALOMEDS::SObject_ptr theNewSO, - GEOM::GEOM_Object_ptr theNewO, - GEOM::find_shape_method theFindMethod, - CORBA::Boolean theAddPrefix); - GEOM::ListOfGO* RestoreSubShapes (SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_ptr theObject, + GEOM::GEOM_Object_ptr theObject, SALOMEDS::SObject_ptr theSObject, const GEOM::ListOfGO& theArgs, GEOM::find_shape_method theFindMethod, CORBA::Boolean theInheritFirstArg, CORBA::Boolean theAddPrefix); + GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theOldSO, + SALOMEDS::SObject_ptr theNewSO, + GEOM::GEOM_Object_ptr theNewO, + GEOM::ListOfGO& theOutArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theAddPrefix); + + GEOM::ListOfGO* RestoreGivenSubShapes (SALOMEDS::Study_ptr theStudy, + GEOM::GEOM_Object_ptr theObject, + SALOMEDS::SObject_ptr theSObject, + const GEOM::ListOfGO& theArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theInheritFirstArg, + CORBA::Boolean theAddPrefix); + + GEOM::ListOfGO* RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theOldSO, + SALOMEDS::SObject_ptr theNewSO, + GEOM::GEOM_Object_ptr theNewO, + std::set theArgs, + GEOM::find_shape_method theFindMethod, + CORBA::Boolean theAddPrefix); + // auxilary for PublishNamedShapesInStudy void CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy, - GEOM::GEOM_Object_var theMainShape, - const TopTools_IndexedMapOfShape& anIndices, - const TopTools_SequenceOfShape& SeqS, - const TColStd_SequenceOfAsciiString& SeqN, - const Standard_CString& GrName, - GEOM::ListOfGO_var aResList); + GEOM::GEOM_Object_var theMainShape, + const TopTools_IndexedMapOfShape& anIndices, + const TopTools_SequenceOfShape& SeqS, + const TColStd_SequenceOfAsciiString& SeqN, + const Standard_CString& GrName, + GEOM::ListOfGO_var aResList); private: diff --git a/src/GEOM_I/GEOM_IBlocksOperations_i.cc b/src/GEOM_I/GEOM_IBlocksOperations_i.cc index d5435c5d1..f765856d0 100644 --- a/src/GEOM_I/GEOM_IBlocksOperations_i.cc +++ b/src/GEOM_I/GEOM_IBlocksOperations_i.cc @@ -269,6 +269,34 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetPoint (GEOM::GEOM_Object_ptr return GetObject(anObject); } +//============================================================================= +/*! + * GetVertexNearPoint + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetVertexNearPoint + (GEOM::GEOM_Object_ptr theShape, + GEOM::GEOM_Object_ptr thePoint) +{ + GEOM::GEOM_Object_var aGEOMObject; + + // Set a not done flag + GetOperations()->SetNotDone(); + + // Get the reference Objects + Handle(GEOM_Object) aShape = GetObjectImpl(theShape); + Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint); + if (aShape.IsNull() || aPoint.IsNull()) return aGEOMObject._retn(); + + // Create the Point + Handle(GEOM_Object) anObject = + GetOperations()->GetVertexNearPoint(aShape, aPoint); + if (!GetOperations()->IsDone() || anObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(anObject); +} + //============================================================================= /*! * GetEdge @@ -481,6 +509,37 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetFaceByNormale (GEOM::GEOM_Obj return GetObject(anObject); } +//============================================================================= +/*! + * GetShapesNearPoint + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetShapesNearPoint + (GEOM::GEOM_Object_ptr theShape, + GEOM::GEOM_Object_ptr thePoint, + CORBA::Long theShapeType, + CORBA::Double theTolerance) +{ + GEOM::GEOM_Object_var aGEOMObject; + + // Set a not done flag + GetOperations()->SetNotDone(); + + // Get the reference Objects + Handle(GEOM_Object) aShape = GetObjectImpl(theShape); + Handle(GEOM_Object) aPoint = GetObjectImpl(thePoint); + + if (aShape.IsNull() || aPoint.IsNull()) return aGEOMObject._retn(); + + // Create the Shape + Handle(GEOM_Object) anObject = + GetOperations()->GetShapesNearPoint(aShape, aPoint, theShapeType, theTolerance); + if (!GetOperations()->IsDone() || anObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(anObject); +} + //============================================================================= /*! * ExplodeCompoundOfBlocks diff --git a/src/GEOM_I/GEOM_IBlocksOperations_i.hh b/src/GEOM_I/GEOM_IBlocksOperations_i.hh index 68904892c..8fa1e1de7 100644 --- a/src/GEOM_I/GEOM_IBlocksOperations_i.hh +++ b/src/GEOM_I/GEOM_IBlocksOperations_i.hh @@ -75,6 +75,9 @@ class GEOM_I_EXPORT GEOM_IBlocksOperations_i : CORBA::Double theZ, CORBA::Double theEpsilon); + GEOM::GEOM_Object_ptr GetVertexNearPoint (GEOM::GEOM_Object_ptr theShape, + GEOM::GEOM_Object_ptr thePoint); + GEOM::GEOM_Object_ptr GetEdge (GEOM::GEOM_Object_ptr theShape, GEOM::GEOM_Object_ptr thePoint1, GEOM::GEOM_Object_ptr thePoint2); @@ -101,10 +104,15 @@ class GEOM_I_EXPORT GEOM_IBlocksOperations_i : GEOM::GEOM_Object_ptr GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock, GEOM::GEOM_Object_ptr theVector); + GEOM::GEOM_Object_ptr GetShapesNearPoint (GEOM::GEOM_Object_ptr theShape, + GEOM::GEOM_Object_ptr thePoint, + CORBA::Long theShapeType, + CORBA::Double theTolerance); + // Check blocks compound CORBA::Boolean IsCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound, - CORBA::Long theMinNbFaces, - CORBA::Long theMaxNbFaces, + CORBA::Long theMinNbFaces, + CORBA::Long theMaxNbFaces, CORBA::Long& theNbBlocks); CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound, diff --git a/src/GEOM_I/GEOM_IHealingOperations_i.cc b/src/GEOM_I/GEOM_IHealingOperations_i.cc index 81dac09c3..39df78fe1 100644 --- a/src/GEOM_I/GEOM_IHealingOperations_i.cc +++ b/src/GEOM_I/GEOM_IHealingOperations_i.cc @@ -18,7 +18,6 @@ // 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 @@ -493,3 +492,30 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::ChangeOrientationCopy (GEOM::GE return GetObject(aNewObject); } + +//============================================================================= +/*! + * LimitTolerance + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::LimitTolerance (GEOM::GEOM_Object_ptr theObject, + CORBA::Double theTolerance) +{ + GEOM::GEOM_Object_var aGEOMObject; + + // Set a not done flag + GetOperations()->SetNotDone(); + + // Get the object itself + Handle(GEOM_Object) anObject = GetObjectImpl(theObject); + if (anObject.IsNull()) + return aGEOMObject._retn(); + + // Perform + Handle(GEOM_Object) aNewObject = + GetOperations()->LimitTolerance(anObject, theTolerance); + if (!GetOperations()->IsDone() || aNewObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(aNewObject); +} diff --git a/src/GEOM_I/GEOM_IHealingOperations_i.hh b/src/GEOM_I/GEOM_IHealingOperations_i.hh index be42fbd55..01b3f48fc 100644 --- a/src/GEOM_I/GEOM_IHealingOperations_i.hh +++ b/src/GEOM_I/GEOM_IHealingOperations_i.hh @@ -18,7 +18,7 @@ // 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 _GEOM_IHealingOperations_i_HeaderFile #define _GEOM_IHealingOperations_i_HeaderFile @@ -36,42 +36,65 @@ #include #include -class GEOM_I_EXPORT GEOM_IHealingOperations_i : +class GEOM_I_EXPORT GEOM_IHealingOperations_i : public virtual POA_GEOM::GEOM_IHealingOperations, public virtual GEOM_IOperations_i { public: - GEOM_IHealingOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOMImpl_IHealingOperations* theImpl); + GEOM_IHealingOperations_i(PortableServer::POA_ptr thePOA, + GEOM::GEOM_Gen_ptr theEngine, + ::GEOMImpl_IHealingOperations* theImpl); ~GEOM_IHealingOperations_i(); - - GEOM::GEOM_Object_ptr ProcessShape(GEOM::GEOM_Object_ptr theObject, const GEOM::string_array& theOperations, const GEOM::string_array& theParams, const GEOM::string_array& theValues); - void GetShapeProcessParameters(GEOM::string_array_out theOperations, GEOM::string_array_out theParams, GEOM::string_array_out theValues); + GEOM::GEOM_Object_ptr ProcessShape(GEOM::GEOM_Object_ptr theObject, + const GEOM::string_array& theOperations, + const GEOM::string_array& theParams, + const GEOM::string_array& theValues); - void GetOperatorParameters (const char* theOperator, GEOM::string_array_out theParams, GEOM::string_array_out theValues); + void GetShapeProcessParameters(GEOM::string_array_out theOperations, + GEOM::string_array_out theParams, + GEOM::string_array_out theValues); - GEOM::GEOM_Object_ptr SuppressFaces(GEOM::GEOM_Object_ptr theObject, const GEOM::short_array& theFaces); + void GetOperatorParameters (const char* theOperator, + GEOM::string_array_out theParams, + GEOM::string_array_out theValues); - GEOM::GEOM_Object_ptr CloseContour (GEOM::GEOM_Object_ptr theObject, const GEOM::short_array& theWires, CORBA::Boolean isCommonVertex); + GEOM::GEOM_Object_ptr SuppressFaces(GEOM::GEOM_Object_ptr theObject, + const GEOM::short_array& theFaces); - GEOM::GEOM_Object_ptr RemoveIntWires (GEOM::GEOM_Object_ptr theObject, const GEOM::short_array& theWires); - - GEOM::GEOM_Object_ptr FillHoles (GEOM::GEOM_Object_ptr theObject, const GEOM::short_array& theWires); + GEOM::GEOM_Object_ptr CloseContour (GEOM::GEOM_Object_ptr theObject, + const GEOM::short_array& theWires, + CORBA::Boolean isCommonVertex); - GEOM::GEOM_Object_ptr Sew (GEOM::GEOM_Object_ptr theObject, CORBA::Double theTolerance); + GEOM::GEOM_Object_ptr RemoveIntWires (GEOM::GEOM_Object_ptr theObject, + const GEOM::short_array& theWires); - GEOM::GEOM_Object_ptr DivideEdge (GEOM::GEOM_Object_ptr theObject, CORBA::Short theIndex, CORBA::Double theValue, CORBA::Boolean isByParameter); + GEOM::GEOM_Object_ptr FillHoles (GEOM::GEOM_Object_ptr theObject, + const GEOM::short_array& theWires); + + GEOM::GEOM_Object_ptr Sew (GEOM::GEOM_Object_ptr theObject, + CORBA::Double theTolerance); + + GEOM::GEOM_Object_ptr DivideEdge (GEOM::GEOM_Object_ptr theObject, + CORBA::Short theIndex, + CORBA::Double theValue, + CORBA::Boolean isByParameter); + + CORBA::Boolean GetFreeBoundary(GEOM::GEOM_Object_ptr theObject, + GEOM::ListOfGO_out theClosedWires, + GEOM::ListOfGO_out theOpenWires ); - CORBA::Boolean GetFreeBoundary(GEOM::GEOM_Object_ptr theObject, GEOM::ListOfGO_out theClosedWires, GEOM::ListOfGO_out theOpenWires ); - GEOM::GEOM_Object_ptr ChangeOrientation (GEOM::GEOM_Object_ptr theObject); GEOM::GEOM_Object_ptr ChangeOrientationCopy (GEOM::GEOM_Object_ptr theObject); + GEOM::GEOM_Object_ptr LimitTolerance (GEOM::GEOM_Object_ptr theObject, + CORBA::Double theTolerance); + ::GEOMImpl_IHealingOperations* GetOperations() { return (::GEOMImpl_IHealingOperations*)GetImpl(); } private: - Handle(TColStd_HArray1OfExtendedString) Convert( const GEOM::string_array& ); - Handle(TColStd_HArray1OfInteger) Convert( const GEOM::short_array& ); + Handle(TColStd_HArray1OfExtendedString) Convert( const GEOM::string_array& ); + Handle(TColStd_HArray1OfInteger) Convert( const GEOM::short_array& ); }; diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.cc b/src/GEOM_I/GEOM_IShapesOperations_i.cc index 5df05efd4..fcf400be5 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.cc +++ b/src/GEOM_I/GEOM_IShapesOperations_i.cc @@ -85,6 +85,34 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdge return GetObject(anObject); } +//============================================================================= +/*! + * MakeEdgeWire + */ +//============================================================================= +GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeEdgeWire + (GEOM::GEOM_Object_ptr theWire, + const CORBA::Double theLinearTolerance, + const CORBA::Double theAngularTolerance) +{ + GEOM::GEOM_Object_var aGEOMObject; + + //Set a not done flag + GetOperations()->SetNotDone(); + + //Get the source wire + Handle(GEOM_Object) aWire = GetObjectImpl(theWire); + + if (aWire.IsNull()) return aGEOMObject._retn(); + + //Create the Edge + Handle(GEOM_Object) anObject = GetOperations()->MakeEdgeWire(aWire, theLinearTolerance, theAngularTolerance); + if (!GetOperations()->IsDone() || anObject.IsNull()) + return aGEOMObject._retn(); + + return GetObject(anObject); +} + //============================================================================= /*! * MakeWire @@ -229,8 +257,11 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShell Handle(GEOM_Object) aShell = GetObjectImpl(theShell); if (aShell.IsNull()) return aGEOMObject._retn(); + std::list aShapes; + aShapes.push_back(aShell); + //Create the Solid - Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShell(aShell); + Handle(GEOM_Object) anObject = GetOperations()->MakeSolidShells(aShapes); if (!GetOperations()->IsDone() || anObject.IsNull()) return aGEOMObject._retn(); @@ -410,6 +441,32 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList return GetObject(anObject); } +//============================================================================= +/*! + * GetExistingSubObjects + */ +//============================================================================= +GEOM::ListOfGO* GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape, + CORBA::Boolean theGroupsOnly) +{ + GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO; + + Handle(GEOM_Object) aShape = GetObjectImpl(theShape); + if (aShape.IsNull()) return aSeq._retn(); + + Handle(TColStd_HSequenceOfTransient) aHSeq = + GetOperations()->GetExistingSubObjects(aShape, theGroupsOnly); + if (!GetOperations()->IsDone() || aHSeq.IsNull()) + return aSeq._retn(); + + Standard_Integer aLength = aHSeq->Length(); + aSeq->length(aLength); + for (Standard_Integer i = 1; i <= aLength; i++) + aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i))); + + return aSeq._retn(); +} + //============================================================================= /*! * MakeExplode diff --git a/src/GEOM_I/GEOM_IShapesOperations_i.hh b/src/GEOM_I/GEOM_IShapesOperations_i.hh index da9da31cd..424228f98 100644 --- a/src/GEOM_I/GEOM_IShapesOperations_i.hh +++ b/src/GEOM_I/GEOM_IShapesOperations_i.hh @@ -44,6 +44,9 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i : GEOM::GEOM_Object_ptr MakeEdge (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2); + GEOM::GEOM_Object_ptr MakeEdgeWire (GEOM::GEOM_Object_ptr theWire, + const CORBA::Double theLinearTolerance, + const CORBA::Double theAngularTolerance); GEOM::GEOM_Object_ptr MakeWire (const GEOM::ListOfGO& theEdgesAndWires, const CORBA::Double theTolerance); @@ -74,6 +77,8 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i : const GEOM::ListOfGO& theFaces, CORBA::Boolean doKeepNonSolids); + GEOM::ListOfGO* GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape, + CORBA::Boolean theGroupsOnly); // For old SubShapeAll() // Deprecated, use MakeAllSubShapes() instead diff --git a/src/GEOM_I/GEOM_Object_i.cc b/src/GEOM_I/GEOM_Object_i.cc index 3d2534d2d..ad139cb77 100644 --- a/src/GEOM_I/GEOM_Object_i.cc +++ b/src/GEOM_I/GEOM_Object_i.cc @@ -28,8 +28,7 @@ #include "utilities.h" #include -#include -//#include +#include #include #include @@ -40,6 +39,7 @@ #include #include #include +#include #ifdef WNT #pragma warning( disable:4786 ) @@ -117,6 +117,61 @@ GEOM::shape_type GEOM_Object_i::GetShapeType() return (GEOM::shape_type)_geom.ShapeType(); } +//============================================================================= +/*! + * GetTopologyType + */ +//============================================================================= +GEOM::shape_type GEOM_Object_i::GetTopologyType() +{ + TopoDS_Shape shape = _impl->GetValue(); + if(shape.IsNull()) return GEOM::SHAPE; + + if ( shape.ShapeType() == TopAbs_COMPOUND || shape.ShapeType() == TopAbs_COMPSOLID ) { + TopoDS_Shape shape_i; + TopoDS_Iterator It (shape, Standard_True, Standard_False); + for (; It.More(); It.Next()) { + if ( !shape_i.IsNull() ) return (GEOM::shape_type)shape.ShapeType(); + shape_i = It.Value(); + } + if ( !shape_i.IsNull() ) + return (GEOM::shape_type) shape_i.ShapeType(); + } + + return (GEOM::shape_type)shape.ShapeType(); +} + +static GEOM::shape_type getMinShapeType( const TopoDS_Shape& shape ) +{ + if ( shape.IsNull() ) + return GEOM::SHAPE; + + GEOM::shape_type ret = (GEOM::shape_type)shape.ShapeType(); + + if ( shape.ShapeType() == TopAbs_COMPOUND || shape.ShapeType() == TopAbs_COMPSOLID ) { + TopoDS_Iterator it(shape, Standard_True, Standard_False); + for (; it.More(); it.Next()) { + TopoDS_Shape sub_shape = it.Value(); + if ( sub_shape.IsNull() ) continue; + GEOM::shape_type stype = (GEOM::shape_type)sub_shape.ShapeType(); + if ( stype != GEOM::SHAPE && stype > ret ) + ret = stype; + } + } + + return ret; +} + +//============================================================================= +/*! + * GetMinShapeType + */ +//============================================================================= +GEOM::shape_type GEOM_Object_i::GetMinShapeType() +{ + return getMinShapeType( _impl->GetValue() ); +} + //============================================================================= /*! * SetName @@ -343,23 +398,18 @@ SALOMEDS::TMPFile* GEOM_Object_i::GetShapeStream() if(aShape.IsNull()) return NULL; - std::ostrstream streamShape; + std::ostringstream streamShape; //Write TopoDS_Shape in ASCII format to the stream BRepTools::Write(aShape, streamShape); //Returns the number of bytes that have been stored in the stream's buffer. - int size = streamShape.pcount(); - char* buf = new char [size]; - //Get pointer on internal character array in ostrstream - char* valueOfStream = streamShape.str(); - //Create copy of ostrstream content - memcpy(buf, valueOfStream, size); - //Allow automatic deletion of ostrstream content - streamShape.rdbuf()->freeze(0); - - CORBA::Octet* OctetBuf = (CORBA::Octet*)buf; + int size = streamShape.str().size(); + //Allocate octect buffer of required size + CORBA::Octet* OctetBuf = SALOMEDS::TMPFile::allocbuf(size); + //Copy ostrstream content to the octect buffer + memcpy(OctetBuf, streamShape.str().c_str(), size); + //Create and return TMPFile SALOMEDS::TMPFile_var SeqFile = new SALOMEDS::TMPFile(size,size,OctetBuf,1); return SeqFile._retn(); - } diff --git a/src/GEOM_I/GEOM_Object_i.hh b/src/GEOM_I/GEOM_Object_i.hh index 46a7ae2c0..d47306aad 100644 --- a/src/GEOM_I/GEOM_Object_i.hh +++ b/src/GEOM_I/GEOM_Object_i.hh @@ -51,6 +51,10 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public virtual GEOM::shape_type GetShapeType(); + virtual GEOM::shape_type GetTopologyType(); + + virtual GEOM::shape_type GetMinShapeType(); + virtual void SetName(const char* theName); virtual char* GetName(); diff --git a/src/GEOM_PY/Makefile.am b/src/GEOM_PY/Makefile.am new file mode 100644 index 000000000..70d732d47 --- /dev/null +++ b/src/GEOM_PY/Makefile.am @@ -0,0 +1,27 @@ +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +# + +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +SUBDIRS= structelem + +mypkgpythondir = $(salomepythondir)/salome/geom +mypkgpython_PYTHON = \ + __init__.py \ + geomtools.py diff --git a/src/GEOM_PY/__init__.py b/src/GEOM_PY/__init__.py new file mode 100644 index 000000000..5d3edfa55 --- /dev/null +++ b/src/GEOM_PY/__init__.py @@ -0,0 +1 @@ +# -*- coding: iso-8859-1 -*- diff --git a/src/GEOM_PY/geomtools.py b/src/GEOM_PY/geomtools.py new file mode 100644 index 000000000..9693525f8 --- /dev/null +++ b/src/GEOM_PY/geomtools.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2007-2009 EDF R&D +# +# This file is part of PAL_SRC. +# +# PAL_SRC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PAL_SRC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with PAL_SRC; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +""" +This module provides tools to facilitate the use of geom engine and geom +objects in Salome. +""" + +import salome +GEOM = None # GEOM module is loaded only when needed + +from salome.kernel.logger import Logger +from salome.kernel import termcolor +logger = Logger("salome.geom.geomtools", color = termcolor.RED) + +from salome.kernel.studyedit import getActiveStudyId, getStudyEditor + +_geompys = {} + +def getGeompy(studyId = None): + """ + Return an object behaving exactly like geompy module, except that it is + associated with the study `studyId`. If `studyId` is :const:`None`, return + a pseudo geompy object for the current study. + """ + # We can't use geompy module because it initializes GEOM with + # salome.myStudy, which may not exist. So we use this trick to create + # a pseudo geompy module. + salome.salome_init() + if studyId is None: + studyId = getActiveStudyId() + if not _geompys.has_key(studyId): + import geompyDC + _geompys[studyId] = salome.lcc.FindOrLoadComponent("FactoryServer", + "GEOM") + _geompys[studyId].ShapeType = geompyDC.ShapeType + _geompys[studyId].GEOM = geompyDC.GEOM + _geompys[studyId].kind = geompyDC.kind + _geompys[studyId].info = geompyDC.info + _geompys[studyId].PackData = geompyDC.PackData + _geompys[studyId].ReadTexture = geompyDC.ReadTexture + study = salome.myStudyManager.GetStudyByID(studyId) + _geompys[studyId].init_geom(study) + return _geompys[studyId] + + +class GeomStudyTools: + """ + This class provides several methods to manipulate geom objects in Salome + study. The parameter `studyEditor` defines a + :class:`~salome.kernel.studyedit.StudyEditor` object used to access the study. If + :const:`None`, the method returns a :class:`~salome.kernel.studyedit.StudyEditor` + object on the current study. + + .. attribute:: editor + + This instance attribute contains the underlying + :class:`~salome.kernel.studyedit.StudyEditor` object. It can be used to access + the study but the attribute itself should not be modified. + + """ + + def __init__(self, studyEditor = None): + global GEOM + if GEOM is None: + GEOM = __import__("GEOM") + if studyEditor is None: + studyEditor = getStudyEditor() + self.editor = studyEditor + + def displayShapeByName(self, shapeName, color = None): + """ + Display the geometrical shape whose name in the study is `shapeName`. + + :type shapeName: string + :param shapeName: name of the geometrical shape + + :type color: tuple (triplet) + :param color: RGB components of the color of the shape + + :return: True if the shape was found, False otherwise + """ + logger.debug("displayShapeByName in PAL: %s with color %s" % + (shapeName, color)) + listSO = self.editor.study.FindObjectByName(shapeName, "GEOM") + for sObj in listSO: + entry = sObj.GetID() + geomObj = self.editor.getOrLoadObject(sObj) + if geomObj: + shape = geomObj._narrow(GEOM.GEOM_Object) + if shape: + geomgui = salome.ImportComponentGUI("GEOM") + geomgui.createAndDisplayGO(entry) + geomgui.setDisplayMode(entry, 1) + if color is not None: + geomgui.setColor(entry, color[0], color[1], color[2]) + return True + return False diff --git a/src/GEOM_PY/structelem/Makefile.am b/src/GEOM_PY/structelem/Makefile.am new file mode 100644 index 000000000..cea34db04 --- /dev/null +++ b/src/GEOM_PY/structelem/Makefile.am @@ -0,0 +1,26 @@ +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +# + +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +salomepypkgdir = $(salomepythondir)/salome/geom/structelem +salomepypkg_PYTHON = \ + __init__.py \ + parts.py \ + orientation.py diff --git a/src/GEOM_PY/structelem/__init__.py b/src/GEOM_PY/structelem/__init__.py new file mode 100644 index 000000000..e713832a5 --- /dev/null +++ b/src/GEOM_PY/structelem/__init__.py @@ -0,0 +1,486 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2007-2009 EDF R&D +# +# This file is part of PAL_SRC. +# +# PAL_SRC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PAL_SRC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with PAL_SRC; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +""" +This package is used to create and visualize structural elements. It contains +three modules: + +* This module :mod:`salome.geom.structelem` defines the main classes + :class:`StructuralElement` and :class:`StructuralElementManager` that can be + directly used to build structural elements. +* The module :mod:`salome.geom.structelem.parts` defines the classes corresponding to + the different parts (beams, grids, etc.) that make up a structural element. + It is used to build the geometric shapes in the structural element. +* The module :mod:`salome.geom.structelem.orientation` defines the classes that are + used to compute the orientation of the structural element parts and to build + the corresponding markers. + +A structural element is a set of geometric shapes (beams, grids, etc.) that +are built semi-automatically along a set of geometric primitives (edges for +instance). They are visualized with the same color as their base primitives in +the geom viewer. + +Structural elements are generally created by the +:class:`StructuralElementManager` class, from a list of commands describing +the element to create. + +Example:: + + commandList = [('VisuPoutreGenerale', {'Group_Maille': 'Edge_1'}), + ('VisuBarreCercle', + {'R': 30, 'Group_Maille': 'Edge_1', 'EP': 15}), + ] + + structElemManager = StructuralElementManager() + elem = structElemManager.createElement(commandList) + elem.display() + salome.sg.updateObjBrowser(True) + +""" + +import types + +import salome + +from salome.kernel.logger import Logger +from salome.kernel import termcolor +logger = Logger("salome.geom.structelem", color = termcolor.RED) +from salome.kernel.studyedit import getStudyEditor + +__all__ = ["parts", "orientation"] + +from salome.geom.structelem import parts +from salome.geom.structelem.parts import InvalidParameterError + +class StructuralElementManager: + """ + This class manages the structural elements in the study. It is used to + create a new structural element from a list of commands. The parameter + `studyId` defines the ID of the study in which the manager will create + structural elements. If it is :const:`None` or not specified, it will use + the ID of the current study as defined by + :func:`salome.kernel.studyedit.getActiveStudyId` function. + """ + def __init__(self, studyId = None): + self._studyEditor = getStudyEditor(studyId) + + def createElement(self, commandList): + """ + Create a structural element from the list of commands `commandList`. + Each command in this list represent a part of the structural element, + that is a specific kind of shape (circular beam, grid, etc.) + associated with one or several geometrical primitives. A command must + be a tuple. The first element is the structural element part class + name or alias name. The second element is a dictionary containing the + parameters describing the part. Valid class names are all the classes + defined in the module :mod:`~salome.geom.structelem.parts` and inheriting + class :class:`~parts.StructuralElementPart`. There are also several + aliases for backward compatibility. Here is the complete list: + + * :class:`~parts.GeneralBeam` + * :class:`~parts.CircularBeam` + * :class:`~parts.RectangularBeam` + * :class:`~parts.ThickShell` + * :class:`~parts.Grid` + + * :func:`~parts.VisuPoutreGenerale` (alias for + :class:`~parts.GeneralBeam`) + * :func:`~parts.VisuPoutreCercle` (alias for + :class:`~parts.CircularBeam`) + * :func:`~parts.VisuPoutreRectangle` (alias for + :class:`~parts.RectangularBeam`) + * :func:`~parts.VisuBarreGenerale` (alias for + :class:`~parts.GeneralBeam`) + * :func:`~parts.VisuBarreRectangle` (alias for + :class:`~parts.RectangularBeam`) + * :func:`~parts.VisuBarreCercle` (alias for + :class:`~parts.CircularBeam`) + * :func:`~parts.VisuCable` (alias for :class:`~parts.CircularBeam`) + * :func:`~parts.VisuCoque` (alias for :class:`~parts.ThickShell`) + * :func:`~parts.VisuGrille` (alias for :class:`~parts.Grid`) + + * ``Orientation``: This identifier is used to specify the orientation + of one or several 1D structural element parts (i.e. beams). The + parameters are described in class + :class:`~orientation.Orientation1D`. + + The valid parameters in the dictionary depend on the type of the + structural element part, and are detailed in the documentation of + the corresponding class. The only parameter that is common to all the + classes is "MeshGroups" (that can also be named "Group_Maille"). It + defines the name of the geometrical object(s) in the study that will + be used as primitives to build the structural element part. This + parameter can be either a list of strings or a single string with + comma separated names. + """ + logger.debug("StructuralElementManager.createElement: START") + logger.debug("Command list: %s" % commandList) + + element = StructuralElement(self._studyEditor.studyId) + orientationCmdList = [] + for command in commandList: + (parttype, parameters) = command + if parttype == "Orientation": + orientationCmdList += [command] + elif parttype not in dir(parts): + logger.warning('Invalid structural element part name "%s"' + ' in command %s, this command will be ' + 'ignored.' % (parttype, command)) + else: + (meshGroupList, newparams) = self._extractMeshGroups(command) + for meshGroup in meshGroupList: + # Get the geometrical primitive object + groupSObj = self._studyEditor.study.FindObject(meshGroup) + groupGeomObj = None + if groupSObj is not None: + groupGeomObj = \ + self._studyEditor.getOrLoadObject(groupSObj) + if groupGeomObj is None: + logger.error("Can't get geom object corresponding to " + 'mesh group "%s", structural element ' + "part %s will not be built." % + (groupName, part)) + continue + + # Create the part + try: + part = parts.__dict__[parttype]( + self._studyEditor.studyId, meshGroup, + groupGeomObj, newparams) + element.addPart(part) + except InvalidParameterError, e: + logger.error("Invalid parameter error: %s" % e) + raise + except: + logger.exception("Can't create structural element" + " part with command %s." % + str(command)) + + # Orientations are parsed after the parts because they must be + # associated with existing parts. + for command in orientationCmdList: + (parttype, parameters) = command + (meshGroupList, orientParams) = self._extractMeshGroups(command) + for meshGroup in meshGroupList: + element.addOrientation(meshGroup, orientParams) + + element.build() + logger.debug("StructuralElementManager.createElement: END") + return element + + def _extractMeshGroups(self, command): + """ + This method extracts the names of the mesh groups (i.e. the + geometrical objects used to build the structural element part) in the + command in parameter. It returns a tuple containing the mesh groups as + a list of strings and the other parameters of the command as a new + dictionary. + """ + (parttype, parameters) = command + newparams = parameters.copy() + groupMailleParam = newparams.pop("Group_Maille", None) + meshGroupParam = newparams.pop("MeshGroups", None) + if groupMailleParam is None and meshGroupParam is None: + logger.warning("No mesh group specified in command %s, this " + "command will be ignored." % command) + return ([], newparams) + elif groupMailleParam is not None and meshGroupParam is not None: + logger.warning('Both "MeshGroups" and "Group_Maille" specified in' + ' command %s, only "MeshGroups" will be used.' % + command) + elif groupMailleParam is not None and meshGroupParam is None: + meshGroupParam = groupMailleParam + + meshGroupList = [] + if type(meshGroupParam) == types.StringType: + meshGroupList = self._getMeshGroupListFromString(meshGroupParam) + else: + for item in meshGroupParam: + meshGroupList += self._getMeshGroupListFromString(item) + + if len(meshGroupList) == 0: + logger.warning("Mesh group list is empty in command %s, this " + "command will be ignored." % command) + + return (meshGroupList, newparams) + + def _getMeshGroupListFromString(self, meshString): + """ + This method splits the string in parameter to extract comma separated + names. Those names are returned as a list of strings. + """ + meshGroupList = [] + list = meshString.split(",") + for item in list: + strippedItem = item.strip() + if len(strippedItem) > 0: + meshGroupList.append(strippedItem) + return meshGroupList + + +class StructuralElement: + """ + This class represents a structural element, i.e. a set of geometrical + objects built along geometrical primitives. The parameter `studyId` + defines the ID of the study that will contain the structural element. If + it is :const:`None` or not specified, the constructor will use the ID of + the active study as defined by :func:`salome.kernel.studyedit.getActiveStudyId` + function. Structural elements are normally created by the class + :class:`StructuralElementManager`, so this class should not be + instantiated directly in the general case. + """ + _counter = 1 + _mainFolderTag = 14725 + + def __init__(self, studyId = None): + # _parts is the dictionary mapping group name to structural element + # part. _shapeDict is the dictionary mapping SubShapeID objects to + # structural element parts. Both are used to avoid duplicate shapes + # in structural elements. + self._parts = {} + self._shapeDict = {} + self._id = StructuralElement._counter + StructuralElement._counter += 1 + self._studyEditor = getStudyEditor(studyId) + logger.debug("Creating structural element in study %s" % + self._studyEditor.studyId) + self._SObject = None + + def _getSObject(self): + """ + Find or create the study object corresponding to the structural + element. This object is named "SE_N" where N is a numerical ID. + """ + if self._SObject is None: + geomComponent = self._studyEditor.study.FindComponent("GEOM") + mainFolder = self._studyEditor.setItemAtTag(geomComponent, + StructuralElement._mainFolderTag, + name = "Structural Elements") + self._SObject = self._studyEditor.findOrCreateItem(mainFolder, + name = "SE_" + str(self._id)) + return self._SObject + + def addPart(self, newpart): + """ + Add a part to the structural element. + + :type newpart: :class:`~parts.StructuralElementPart` + :param newpart: the part to add to the structural element. + + """ + newshapes = newpart.baseShapesSet + + # Check duplicate groups + if self._parts.has_key(newpart.groupName): + logger.warning('Mesh group "%s" is used several times in the ' + 'structural element. Only the last definition ' + 'will be used.' % newpart.groupName) + else: + # Check duplicate shapes + intersect = newshapes.intersection(self._shapeDict.keys()) + while len(intersect) > 0: + shape, = intersect + oldpartwithshape = self._shapeDict[shape] + oldpartshapes = oldpartwithshape.baseShapesSet + intersectwitholdpart = intersect.intersection(oldpartshapes) + logger.warning('Some shapes are common to groups "%s" and ' + '"%s". For those, the parameters defined for ' + '"%s" will be used.' % + (oldpartwithshape.groupName, newpart.groupName, + newpart.groupName)) + oldpartwithshape.baseShapesSet = \ + oldpartshapes.difference(intersectwitholdpart) + intersect = intersect.difference(intersectwitholdpart) + + # Finally add the new part in the structural element + self._parts[newpart.groupName] = newpart + for shape in newshapes: + self._shapeDict[shape] = newpart + + def addOrientation(self, meshGroup, orientParams): + """ + Add orientation information to a part in the structural element. This + information will be used to build the corresponding markers. + + :type meshGroup: string + :param meshGroup: the name of a geometrical primitive. The orientation + information will apply to the structural element + part built along this primitive. + + :type orientParams: dictionary + :param orientParams: parameters defining the orientation of the + structural element part. Those parameters are + detailed in class + :class:`~orientation.Orientation1D`. + + """ + if self._parts.has_key(meshGroup): + self._parts[meshGroup].addOrientation(orientParams) + else: + logger.warning('Mesh group "%s" not found in structural element, ' + 'cannot set orientation.' % meshGroup) + + def build(self): + """ + Build the geometric shapes and the markers corresponding to the + different parts of the structural element, and add them to the study. + """ + gg = salome.ImportComponentGUI("GEOM") + for part in self._parts.itervalues(): + # Build the structural element part + logger.debug("Building %s" % part) + try: + (shape, markers) = part.build() + if shape is None: + logger.error("Part %s has not been built" % part) + continue + except: + logger.exception("Couldn't build part %s" % part) + continue + + # Add the new objects to the study + IOR = self._studyEditor.study.ConvertObjectToIOR(shape) + shapeSObjName = part.name + "_" + part.groupName + icon = None + if salome.hasDesktop(): + icon = gg.getShapeTypeIcon(IOR) + shapeSObj = self._studyEditor.createItem(self._getSObject(), + name = shapeSObjName, IOR = IOR, + icon = icon) + if markers is not None and len(markers) > 0: + i = 1 + for marker in markers: + markerIOR = \ + self._studyEditor.study.ConvertObjectToIOR(marker) + markerSObjName = "Orient_" + shapeSObjName + if len(markers) > 1: + markerSObjName += "_%d" % i + markerSObj = self._studyEditor.createItem( + self._getSObject(), + name = markerSObjName, + IOR = markerIOR, + icon = "ICON_OBJBROWSER_LCS") + i += 1 + + def display(self): + """ + Display the structural element in the geom view. + """ + StructuralElement.showElement(self._SObject) + + @staticmethod + def showElement(theSObject): + """ + Display the structural element corresponding to the study object + `theSObject` + """ + if theSObject is not None: + gg = salome.ImportComponentGUI("GEOM") + aStudy = theSObject.GetStudy() + editor = getStudyEditor(aStudy._get_StudyId()) + aIterator = aStudy.NewChildIterator(theSObject) + aIterator.Init() + while aIterator.More(): + sobj = aIterator.Value() + icon = editor.getIcon(sobj) + if icon != "ICON_OBJBROWSER_LCS": + entry = aIterator.Value().GetID() + gg.createAndDisplayGO(entry) + gg.setDisplayMode(entry, 1) + aIterator.Next() + + +def TEST_CreateGeometry(): + import geompy + import SALOMEDS + geompy.init_geom(salome.myStudy) + Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) + edges = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["EDGE"]) + edges[0].SetColor(SALOMEDS.Color(1.0,0.0,0.0)) + edges[1].SetColor(SALOMEDS.Color(0.0,1.0,0.0)) + edges[2].SetColor(SALOMEDS.Color(0.0,0.0,1.0)) + edges[3].SetColor(SALOMEDS.Color(1.0,0.0,1.0)) + edges[4].SetColor(SALOMEDS.Color(0.0,1.0,1.0)) + edges[5].SetColor(SALOMEDS.Color(0.5,0.0,0.0)) + edges[6].SetColor(SALOMEDS.Color(0.0,0.5,0.0)) + edges[7].SetColor(SALOMEDS.Color(0.0,0.0,0.5)) + geompy.addToStudy(Box_1, "Box_1") + for i in range(len(edges)): + geompy.addToStudyInFather(Box_1, edges[i], "Edge_%d" % i) + faces = geompy.SubShapeAllSorted(Box_1, geompy.ShapeType["FACE"]) + faces[3].SetColor(SALOMEDS.Color(1.0,0.5,0.0)) + faces[4].SetColor(SALOMEDS.Color(0.0,1.0,0.5)) + for i in range(len(faces)): + geompy.addToStudyInFather(Box_1, faces[i], "Face_%d" % i) + Cylinder_1 = geompy.MakeCylinderRH(50, 200) + geompy.TranslateDXDYDZ(Cylinder_1, 300, 300, 0) + cyl_faces = geompy.SubShapeAllSorted(Cylinder_1, geompy.ShapeType["FACE"]) + geompy.addToStudy(Cylinder_1, "Cylinder_1") + for i in range(len(cyl_faces)): + geompy.addToStudyInFather(Cylinder_1, cyl_faces[i], "CylFace_%d" % i) + Cylinder_2 = geompy.MakeTranslation(Cylinder_1, 100, 100, 0) + cyl_faces2 = geompy.SubShapeAllSorted(Cylinder_2, + geompy.ShapeType["FACE"]) + geompy.addToStudy(Cylinder_2, "Cylinder_2") + for i in range(len(cyl_faces2)): + geompy.addToStudyInFather(Cylinder_2, cyl_faces2[i], + "CylFace2_%d" % i) + + +def TEST_StructuralElement(): + salome.salome_init() + TEST_CreateGeometry() + liste_commandes = [('Orientation', {'MeshGroups': 'Edge_4', + 'VECT_Y': (1.0, 0.0, 1.0)}), + ('Orientation', {'MeshGroups': 'Edge_5', + 'ANGL_VRIL': 45.0}), + ('GeneralBeam', {'MeshGroups': 'Edge_1, Edge_7'}), + ('VisuPoutreCercle', {'MeshGroups': ['Edge_6'], + 'R1': 30, 'R2': 20}), + ('CircularBeam', {'MeshGroups': ['Edge_2', 'Edge_3'], + 'R': 40, 'EP': 20}), + ('RectangularBeam', {'MeshGroups': 'Edge_4, Edge_5', + 'HZ1': 60, 'HY1': 40, + 'EPZ1': 15, 'EPY1': 10, + 'HZ2': 40, 'HY2': 60, + 'EPZ2': 10, 'EPY2': 15}), + ('VisuCable', {'MeshGroups': 'Edge_7', 'R': 5}), + ('VisuCoque', {'MeshGroups': 'Face_4', + 'Epais': 10, 'Excentre': 5, + 'angleAlpha': 45, 'angleBeta': 60}), + ('VisuCoque', {'MeshGroups': 'CylFace_2', 'Epais': 5}), + ('VisuGrille', {'MeshGroups': 'Face_5', 'Excentre': 5, + 'angleAlpha': 45, 'angleBeta': 60}), + ('VisuGrille', {'MeshGroups': 'CylFace2_2', + 'Excentre': 5, 'origAxeX': 400, + 'origAxeY': 400, 'origAxeZ': 0, + 'axeX': 0, 'axeY': 0, 'axeZ': 100}), + ] + + structElemManager = StructuralElementManager() + elem = structElemManager.createElement(liste_commandes) + if salome.hasDesktop(): + elem.display() + salome.sg.updateObjBrowser(True) + + +# Main function only used to test the module +if __name__ == "__main__": + TEST_StructuralElement() diff --git a/src/GEOM_PY/structelem/orientation.py b/src/GEOM_PY/structelem/orientation.py new file mode 100644 index 000000000..1bf111791 --- /dev/null +++ b/src/GEOM_PY/structelem/orientation.py @@ -0,0 +1,249 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2007-2009 EDF R&D +# +# This file is part of PAL_SRC. +# +# PAL_SRC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PAL_SRC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with PAL_SRC; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +""" +This module is used to compute the orientation of the different parts in a +structural element and to build the corresponding markers (trihedrons). +""" + +import math + +from salome.kernel.logger import Logger +from salome.kernel import termcolor +logger = Logger("__PAL_GEOM__.structelem.orientation", color = termcolor.RED) + + +class Orientation1D: + """ + This class is used to compute the orientation of 1D elements and to build + the corresponding markers. + """ + + def __init__(self): + self.geom = None + self._vectorYCoords = None + self._angle = 0.0 + + def __repr__(self): + reprdict = self.__dict__.copy() + del reprdict["geom"] + return '%s(%s)' % (self.__class__.__name__, reprdict) + + def addParams(self, params): + """ + Add orientation parameters. `params` is a dictionary containing one or + several orientation parameters. The valid parameters are: + + * "VECT_Y": Triplet defining the local Y axis (the X axis is the + main direction of the 1D element). + * "ANGL_VRIL": Angle of rotation along the X axis to define the local + coordinate system. + + The parameters can be specified several times. In this case, only the + first "VECT_Y" is taken into account, and the values of "ANGL_VRIL" + are added to obtain the total rotation angle. + """ + mydict = params.copy() + if mydict.has_key("VECT_Y"): + newVecCoords = mydict.pop("VECT_Y") + if self._vectorYCoords is None: + logger.debug("Setting orientation vector Y to %s" % + str(newVecCoords)) + self._vectorYCoords = newVecCoords + else: + logger.warning('Orientation parameter "VECT_Y" is specified ' + 'several times for the same mesh group, vector' + ' %s will be used' % str(self._vectorYCoords)) + if mydict.has_key("ANGL_VRIL"): + newAngle = mydict.pop("ANGL_VRIL") + self._angle += newAngle + logger.debug("Adding angle %f to orientation, new angle is %f." % + (newAngle, self._angle)) + if len(mydict) > 0: + logger.warning("Invalid orientation parameter(s) (ignored): %s" % + str(mydict)) + + def _buildDefaultMarker(self, center, vecX): + """ + Create the default marker, that use the main direction of the 1D + object as the local X axis and the global Z axis to determine the + local Z axis. + """ + xPoint = self.geom.MakeTranslationVector(center, vecX) + givenVecZ = self.geom.MakeVectorDXDYDZ(0.0, 0.0, 1.0) + angle = self.geom.GetAngleRadians(vecX, givenVecZ) + if abs(angle) < 1e-7 or abs(angle - math.pi) < 1e-7: + logger.warning("Beam X axis is colinear to absolute Z axis. " + "Absolute X axis will be used to determine " + "local Z axis.") + givenVecZ = self.geom.MakeVectorDXDYDZ(1.0, 0.0, 0.0) + zPoint = self.geom.MakeTranslationVector(center, givenVecZ) + locPlaneZX = self.geom.MakePlaneThreePnt(center, zPoint, xPoint, 1.0) + locY = self.geom.GetNormal(locPlaneZX) + marker = self.geom.MakeMarkerPntTwoVec(center,vecX,locY) + return marker + + def buildMarker(self, geom, center, vecX): + """ + Create a marker with origin `center` and X axis `vecX`. `geom` is the + pseudo-geompy object used to build the geometric shapes. + """ + self.geom = geom + marker = None + if self._vectorYCoords is None: + marker = self._buildDefaultMarker(center, vecX) + else: + xPoint = self.geom.MakeTranslationVector(center, vecX) + givenLocY = self.geom.MakeVectorDXDYDZ(self._vectorYCoords[0], + self._vectorYCoords[1], + self._vectorYCoords[2]) + angle = self.geom.GetAngleRadians(vecX, givenLocY) + if abs(angle) < 1e-7 or abs(angle - math.pi) < 1e-7: + logger.warning("Vector Y is colinear to the beam X axis, " + "using default LCS.") + marker = self._buildDefaultMarker(center, vecX) + else: + yPoint = self.geom.MakeTranslationVector(center, givenLocY) + locPlaneXY = self.geom.MakePlaneThreePnt(center, xPoint, + yPoint, 1.0) + locZ = self.geom.GetNormal(locPlaneXY) + zPoint = self.geom.MakeTranslationVector(center, locZ) + locPlaneZX = self.geom.MakePlaneThreePnt(center, zPoint, + xPoint, 1.0) + locY = self.geom.GetNormal(locPlaneZX) + marker = self.geom.MakeMarkerPntTwoVec(center,vecX,locY) + + if self._angle != 0.0: + angleRad = math.radians(self._angle) + marker = self.geom.Rotate(marker, vecX, angleRad) + + return marker + + +class Orientation2D: + """ + This class is used to compute the orientation of 2D elements and to build + the corresponding markers. Angles `alpha` and `beta` are used to determine + the local coordinate system for the 2D element. If `vect` is not + :const:`None`, it is used instead of `alpha` and `beta`. + """ + + def __init__(self, alpha, beta, vect): + self.geom = None + self._alpha = alpha + self._beta = beta + self._vect = vect + + def __repr__(self): + reprdict = self.__dict__.copy() + del reprdict["geom"] + return '%s(%s)' % (self.__class__.__name__, reprdict) + + def _buildDefaultMarker(self, center, normal, warnings = True): + """ + Create the default marker, that use the normal vector of the 2D object + as the local Z axis and the global X axis to determine the local X + axis. `warnings` can be used to enable or disable the logging of + warning messages. + """ + marker = None + globalVecX = self.geom.MakeVectorDXDYDZ(1.0, 0.0, 0.0) + angle = self.geom.GetAngleRadians(normal, globalVecX) + if abs(angle) < 1e-7 or abs(angle - math.pi) < 1e-7: + if warnings: + logger.warning("Face normal is colinear to absolute X axis. " + "Absolute Y axis will be used to determine " + "local X axis.") + globalVecY = self.geom.MakeVectorDXDYDZ(0.0, 1.0, 0.0) + marker = self._buildMarkerRefVecX(center, normal, globalVecY) + else: + marker = self._buildMarkerRefVecX(center, normal, globalVecX) + return marker + + def _buildMarkerRefVecX(self, center, normal, refVecX): + """ + Create a marker using `normal` as Z axis and `refVecX` to determine + the X axis. + """ + xPoint = self.geom.MakeTranslationVector(center, refVecX) + zPoint = self.geom.MakeTranslationVector(center, normal) + locPlaneZX = self.geom.MakePlaneThreePnt(center, zPoint, xPoint, 1.0) + locY = self.geom.GetNormal(locPlaneZX) + yPoint = self.geom.MakeTranslationVector(center, locY) + locPlaneYZ = self.geom.MakePlaneThreePnt(center, yPoint, zPoint, 1.0) + locX = self.geom.GetNormal(locPlaneYZ) + marker = self.geom.MakeMarkerPntTwoVec(center, locX, locY) + return marker + + def buildMarker(self, geom, center, normal, warnings = True): + """ + Create a marker with origin `center` and `normal` as Z axis. The other + axes are computed using the parameters alpha and beta of the + Orientation2D instance. `geom` is the pseudo-geompy object used to + build the geometric shapes. `warnings` can be used to enable or + disable the logging of warning messages. + """ + self.geom = geom + marker = None + refVecX = None + if self._vect is not None: + # Using vector parameter + if abs(self._vect[0]) <= 1e-7 and abs(self._vect[1]) <= 1e-7 and \ + abs(self._vect[2]) <= 1e-7: + if warnings: + logger.warning("Vector too small: %s, using default LCS" % + self._vect) + else: + refVecX = self.geom.MakeVectorDXDYDZ(self._vect[0], + self._vect[1], + self._vect[2]) + elif self._alpha is not None and self._beta is not None: + # Using alpha and beta angles + alphaRad = math.radians(self._alpha) + betaRad = math.radians(self._beta) + if abs(alphaRad) <= 1e-7 and abs(betaRad) <= 1e-7: + if warnings: + logger.warning("Angles too small: (%g, %g), using " + "default LCS" % (self._alpha, self._beta)) + else: + # rotate global CS with angles alpha and beta + refVecX = self.geom.MakeVectorDXDYDZ(1.0, 0.0, 0.0) + refVecY = self.geom.MakeVectorDXDYDZ(0.0, 1.0, 0.0) + globalVecZ = self.geom.MakeVectorDXDYDZ(0.0, 0.0, 1.0) + if abs(alphaRad) > 1e-7: + refVecX = self.geom.Rotate(refVecX, globalVecZ, alphaRad) + refVecY = self.geom.Rotate(refVecY, globalVecZ, alphaRad) + if abs(betaRad) > 1e-7: + refVecX = self.geom.Rotate(refVecX, refVecY, betaRad) + + if refVecX is not None: + # build local coordinate system + angle = self.geom.GetAngleRadians(normal, refVecX) + if abs(angle) < 1e-7 or abs(angle - math.pi) < 1e-7: + if warnings: + logger.warning("Face normal is colinear to the reference " + "X axis, using default LCS.") + else: + marker = self._buildMarkerRefVecX(center, normal, refVecX) + + if marker is None: + marker = self._buildDefaultMarker(center, normal, warnings) + + return marker diff --git a/src/GEOM_PY/structelem/parts.py b/src/GEOM_PY/structelem/parts.py new file mode 100644 index 000000000..0781f6d83 --- /dev/null +++ b/src/GEOM_PY/structelem/parts.py @@ -0,0 +1,969 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2007-2009 EDF R&D +# +# This file is part of PAL_SRC. +# +# PAL_SRC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PAL_SRC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with PAL_SRC; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +""" +This module defines the different structural element parts. It is used to +build the geometric shapes of the structural elements. It should not be used +directly in the general case. Structural elements should be created by the +class :class:`~salome.geom.structelem.StructuralElementManager`. +""" + +import salome + +from salome.kernel.logger import Logger +from salome.kernel import termcolor +logger = Logger("salome.geom.structelem.parts", color = termcolor.RED) +from salome.geom.geomtools import getGeompy + +import orientation + +# Filling for the beams +FULL = "FULL" +HOLLOW = "HOLLOW" + +# Minimum dimension for the shapes to extrude +MIN_DIM_FOR_EXTRUDED_SHAPE = 2e-4 +MIN_LENGTH_FOR_EXTRUSION = 1e-4 +MIN_THICKNESS = 1e-5 + + +class InvalidParameterError(Exception): + """ + This exception is raised when an invalid parameter is used to build a + structural element part. + """ + + def __init__(self, groupName, expression, minValue, value): + self.groupName = groupName + self.expression = expression + self.minValue = minValue + self.value = value + + def __str__(self): + return "%s < %g (%s = %g in %s)" % (self.expression, self.minValue, + self.expression, self.value, + self.groupName) + + +class SubShapeID: + """ + This class enables the use of subshapes in sets or as dictionary keys. + It implements __eq__ and __hash__ methods so that subshapes with the same + CORBA object `mainShape` and the same `id` are considered equal. + """ + + def __init__(self, mainShape, id): + self._mainShape = mainShape + self._id = id + + def getObj(self, geom): + """ + Return the subshape (GEOM object). `geom` is a pseudo-geompy object + used to find the geometrical object. + """ + return geom.GetSubShape(self._mainShape, [self._id]) + + def __eq__(self, other): + return self._mainShape._is_equivalent(other._mainShape) and \ + self._id == other._id + + def __hash__(self): + return self._mainShape._hash(2147483647) ^ self._id + + +class StructuralElementPart: + """ + This class is the base class for all structural element parts. It should + not be instantiated directly (consider it as an "abstract" class). + + :type studyId: integer + :param studyId: the ID of the study in which the part is created. + + :type groupName: string + :param groupName: the name of the underlying geometrical primitive in the + study. + + :type groupGeomObj: GEOM object + :param groupGeomObj: the underlying geometrical primitive. + + :type parameters: dictionary + :param parameters: parameters defining the structural element (see + subclasses for details). + + :type name: string + :param name: name to use for the created object in the study. + + """ + + DEFAULT_NAME = "StructElemPart" + + def __init__(self, studyId, groupName, groupGeomObj, parameters, + name = DEFAULT_NAME): + self._parameters = parameters + self.groupName = groupName + self._groupGeomObj = groupGeomObj + self._orientation = None + self._paramUserName = {} + self.name = name + self.geom = getGeompy(studyId) + self.baseShapesSet = set() + mainShape = self.geom.GetMainShape(groupGeomObj) + listIDs = self.geom.GetObjectIDs(groupGeomObj) + if mainShape is not None and listIDs is not None: + for id in listIDs: + self.baseShapesSet.add(SubShapeID(mainShape, id)) + + def _getParameter(self, nameList, default = None): + """ + This method finds the value of a parameter in the parameters + dictionary. The argument is a list because some parameters can have + several different names. + """ + if len(nameList) > 0: + paramName = nameList[0] + for name in nameList: + if self._parameters.has_key(name): + self._paramUserName[paramName] = name + return self._parameters[name] + return default + + def _getParamUserName(self, paramName): + """ + This method finds the user name for a parameter. + """ + if self._paramUserName.has_key(paramName): + return self._paramUserName[paramName] + else: + return paramName + + def __repr__(self): + reprdict = self.__dict__.copy() + del reprdict["_parameters"] + del reprdict["groupName"] + del reprdict["_groupGeomObj"] + del reprdict["_paramUserName"] + del reprdict["name"] + del reprdict["geom"] + del reprdict["baseShapesSet"] + return '%s("%s", %s)' % (self.__class__.__name__, self.groupName, + reprdict) + + def addOrientation(self, orientParams): + """ + Add orientation information to the structural element part. See class + :class:`~salome.geom.structelem.orientation.Orientation1D` for the description + of the parameters. + """ + self._orientation.addParams(orientParams) + + def _checkSize(self, value, mindim, expression): + """ + This method checks that some parameters or some expressions involving + those parameters are greater than a minimum value. + """ + if value < mindim: + raise InvalidParameterError(self.groupName, expression, + mindim, value) + + def build(self): + """ + Build the geometric shapes and the markers corresponding to the + structural element part in the study `studyId`. + """ + shape = self._buildPart() + markers = self._buildMarkers() + shape.SetColor(self._groupGeomObj.GetColor()) + for marker in markers: + marker.SetColor(self._groupGeomObj.GetColor()) + return (shape, markers) + + def _buildPart(self): + """ + This abstract method must be implemented in subclasses and should + create the geometrical shape(s) of the structural element part. + """ + raise NotImplementedError("Method _buildPart not implemented in class" + " %s (it must be implemented in " + "StructuralElementPart subclasses)." % + self.__class__.__name__) + + def _buildMarkers(self): + """ + This abstract method must be implemented in subclasses and should + create the markers defining the orientation of the structural element + part. + """ + raise NotImplementedError("Method _buildMarker not implemented in " + "class %s (it must be implemented in " + "StructuralElementPart subclasses)." % + self.__class__.__name__) + + def _getSubShapes(self, minDim = MIN_LENGTH_FOR_EXTRUSION): + """ + Find and return the base subshapes in the structural element part. + """ + subShapes = [] + for subShapeID in self.baseShapesSet: + subShape = subShapeID.getObj(self.geom) + length = self.geom.BasicProperties(subShape)[0] + if length < minDim: + logger.warning("Length too short (%s - ID %s, length = %g), " + "subshape will not be used in structural " + "element" % (self.groupName, subShapeID._id, + length)) + else: + subShapes.append(subShape) + return subShapes + + +class Beam(StructuralElementPart): + """ + This class is an "abstract" class for all 1D structural element parts. It + should not be instantiated directly. See class + :class:`StructuralElementPart` for the description of the parameters. + """ + + DEFAULT_NAME = "Beam" + + def __init__(self, studyId, groupName, groupGeomObj, parameters, + name = DEFAULT_NAME): + StructuralElementPart.__init__(self, studyId, groupName, groupGeomObj, + parameters, name) + self._orientation = orientation.Orientation1D() + + def _isReversed(self, path): + """ + This method checks if a 1D object is "reversed", i.e. if its + orientation is different than the orientation of the underlying OCC + object. + """ + fParam = 0. + lParam = 1. + fPoint = self.geom.MakeVertexOnCurve(path, fParam) + lPoint = self.geom.MakeVertexOnCurve(path, lParam) + + fNormal = self.geom.MakeTangentOnCurve(path, fParam) + lNormal = self.geom.MakeTangentOnCurve(path, lParam) + + fCircle = self.geom.MakeCircle(fPoint, fNormal, 10) + lCircle = self.geom.MakeCircle(lPoint, lNormal, 10) + + try: + pipe = self.geom.MakePipeWithDifferentSections([fCircle, lCircle], + [fPoint, lPoint], + path, False, False) + except RuntimeError, e: + # This dirty trick is needed if the wire is not oriented in the + # direction corresponding to parameters 0.0 -> 1.0. In this case, + # we catch the error and invert the ends of the wire. This trick + # will be removed when the function giving the orientation of an + # edge will be added in geompy (see issue 1144 in PAL bugtracker). + if (str(e) == "MakePipeWithDifferentSections : First location " + "shapes is not coincided with first vertex of " + "aWirePath"): + return True + else: + raise + return False + + def _getVertexAndTangentOnOrientedWire(self, path, param): + """ + Get a vertex and the corresponding tangent on a wire by parameter. + This method takes into account the "real" orientation of the wire + (i.e. the orientation of the underlying OCC object). + """ + if self._isReversed(path): + vertex = self.geom.MakeVertexOnCurve(path, 1.0 - param) + invtangent = self.geom.MakeTangentOnCurve(path, 1.0 - param) + tanpoint = self.geom.MakeTranslationVectorDistance(vertex, + invtangent, + -1.0) + tangent = self.geom.MakeVector(vertex, tanpoint) + else: + vertex = self.geom.MakeVertexOnCurve(path, param) + tangent = self.geom.MakeTangentOnCurve(path, param) + return (vertex, tangent) + + def _makeSolidPipeFromWires(self, wire1, wire2, point1, point2, path): + """ + Create a solid by the extrusion of section `wire1` to section `wire2` + along `path`. + """ + face1 = self.geom.MakeFace(wire1, True) + face2 = self.geom.MakeFace(wire2, True) + shell = self.geom.MakePipeWithDifferentSections([wire1, wire2], + [point1, point2], + path, False, False) + closedShell = self.geom.MakeShell([face1, face2, shell]) + solid = self.geom.MakeSolid([closedShell]) + return solid + + def _buildPart(self): + """ + Build the structural element part. + """ + # Get all the subshapes in the group (normally only edges and wires) + paths = self._getSubShapes() + listPipes = [] + withContact = False + withCorrection = False + + for path in paths: + # Build the sections (rectangular or circular) at each end of the + # beam + (fPoint, fNormal) = self._getVertexAndTangentOnOrientedWire(path, + 0.0) + (lPoint, lNormal) = self._getVertexAndTangentOnOrientedWire(path, + 1.0) + (outerWire1, innerWire1, outerWire2, innerWire2) = \ + self._makeSectionWires(fPoint, fNormal, lPoint, lNormal) + + # Create the resulting solid + outerSolid = self._makeSolidPipeFromWires(outerWire1, outerWire2, + fPoint, lPoint, path) + if self.filling == HOLLOW: + innerSolid = self._makeSolidPipeFromWires(innerWire1, + innerWire2, fPoint, + lPoint, path) + resultSolid = self.geom.MakeCut(outerSolid, innerSolid) + listPipes.append(resultSolid) + else: + listPipes.append(outerSolid) + + if len(listPipes) == 0: + return None + elif len(listPipes) == 1: + return listPipes[0] + else: + return self.geom.MakeCompound(listPipes) + + def _buildMarkers(self): + """ + Build the markers defining the orientation of the structural element + part. + """ + param = 0.5 + paths = self._getSubShapes() + listMarkers = [] + for path in paths: + (center, vecX) = self._getVertexAndTangentOnOrientedWire(path, + param) + marker = self._orientation.buildMarker(self.geom, center, vecX) + listMarkers.append(marker) + return listMarkers + + +class GeneralBeam(Beam): + """ + This class defines a beam with a generic section. It is represented only + as the underlying wire. See class :class:`StructuralElementPart` for the + description of the parameters. + """ + + def __init__(self, studyId, groupName, groupGeomObj, parameters, + name = Beam.DEFAULT_NAME): + Beam.__init__(self, studyId, groupName, groupGeomObj, parameters, + name) + logger.debug(repr(self)) + + def _buildPart(self): + """ + Create a copy of the underlying wire. + """ + edges = self._getSubShapes(1e-7) + wire = None + if len(edges) > 0: + wire = self.geom.MakeWire(edges) + return wire + + +class CircularBeam(Beam): + """ + This class defines a beam with a circular section. It can be full or + hollow, and its radius and thickness can vary from one end of the beam to + the other. The valid parameters for circular beams are: + + * "R1" or "R": radius at the first end of the beam. + * "R2" or "R": radius at the other end of the beam. + * "EP1" or "EP" (optional): thickness at the first end of the beam. + If not specified or equal to 0, the beam is considered full. + * "EP2" or "EP" (optional): thickness at the other end of the beam. + If not specified or equal to 0, the beam is considered full. + + See class :class:`StructuralElementPart` for the description of the + other parameters. + + """ + + def __init__(self, studyId, groupName, groupGeomObj, parameters, + name = Beam.DEFAULT_NAME): + Beam.__init__(self, studyId, groupName, groupGeomObj, parameters, + name) + + self.R1 = self._getParameter(["R1", "R"]) + self.R2 = self._getParameter(["R2", "R"]) + self.EP1 = self._getParameter(["EP1", "EP"]) + self.EP2 = self._getParameter(["EP2", "EP"]) + + if self.EP1 is None or self.EP2 is None or \ + self.EP1 == 0 or self.EP2 == 0: + self.filling = FULL + else: + self.filling = HOLLOW + + logger.debug(repr(self)) + + # Check parameters + self._checkSize(self.R1, MIN_DIM_FOR_EXTRUDED_SHAPE / 2.0, + self._getParamUserName("R1")) + self._checkSize(self.R2, MIN_DIM_FOR_EXTRUDED_SHAPE / 2.0, + self._getParamUserName("R2")) + if self.filling == HOLLOW: + self._checkSize(self.EP1, MIN_THICKNESS, + self._getParamUserName("EP1")) + self._checkSize(self.EP2, MIN_THICKNESS, + self._getParamUserName("EP2")) + self._checkSize(self.R1 - self.EP1, + MIN_DIM_FOR_EXTRUDED_SHAPE / 2.0, + "%s - %s" % (self._getParamUserName("R1"), + self._getParamUserName("EP1"))) + self._checkSize(self.R2 - self.EP2, + MIN_DIM_FOR_EXTRUDED_SHAPE / 2.0, + "%s - %s" % (self._getParamUserName("R2"), + self._getParamUserName("EP2"))) + + def _makeSectionWires(self, fPoint, fNormal, lPoint, lNormal): + """ + Create the circular sections used to build the pipe. + """ + outerCircle1 = self.geom.MakeCircle(fPoint, fNormal, self.R1) + outerCircle2 = self.geom.MakeCircle(lPoint, lNormal, self.R2) + if self.filling == HOLLOW: + innerCircle1 = self.geom.MakeCircle(fPoint, fNormal, + self.R1 - self.EP1) + innerCircle2 = self.geom.MakeCircle(lPoint, lNormal, + self.R2 - self.EP2) + else: + innerCircle1 = None + innerCircle2 = None + + return (outerCircle1, innerCircle1, outerCircle2, innerCircle2) + + +class RectangularBeam(Beam): + """ + This class defines a beam with a rectangular section. It can be full or + hollow, and its dimensions can vary from one end of the beam to the other. + The valid parameters for rectangular beams are: + + * "HY1", "HY", "H1" or "H": width at the first end of the beam. + * "HZ1", "HZ", "H1" or "H": height at the first end of the beam. + * "HY2", "HY", "H2" or "H": width at the other end of the beam. + * "HZ2", "HZ", "H2" or "H": height at the other end of the beam. + * "EPY1", "EPY", "EP1" or "EP" (optional): thickness in the width + direction at the first end of the beam. If not specified or equal to 0, + the beam is considered full. + * "EPZ1", "EPZ", "EP1" or "EP" (optional): thickness in the height + direction at the first end of the beam. If not specified or equal to 0, + the beam is considered full. + * "EPY2", "EPY", "EP2" or "EP" (optional): thickness in the width + direction at the other end of the beam. If not specified or equal to 0, + the beam is considered full. + * "EPZ2", "EPZ", "EP2" or "EP" (optional): thickness in the height + direction at the other end of the beam. If not specified or equal to 0, + the beam is considered full. + + See class :class:`StructuralElementPart` for the description of the + other parameters. + + """ + + def __init__(self, studyId, groupName, groupGeomObj, parameters, + name = Beam.DEFAULT_NAME): + Beam.__init__(self, studyId, groupName, groupGeomObj, parameters, + name) + + self.HY1 = self._getParameter(["HY1", "HY", "H1", "H"]) + self.HZ1 = self._getParameter(["HZ1", "HZ", "H1", "H"]) + self.HY2 = self._getParameter(["HY2", "HY", "H2", "H"]) + self.HZ2 = self._getParameter(["HZ2", "HZ", "H2", "H"]) + self.EPY1 = self._getParameter(["EPY1", "EPY", "EP1", "EP"]) + self.EPZ1 = self._getParameter(["EPZ1", "EPZ", "EP1", "EP"]) + self.EPY2 = self._getParameter(["EPY2", "EPY", "EP2", "EP"]) + self.EPZ2 = self._getParameter(["EPZ2", "EPZ", "EP2", "EP"]) + + if self.EPY1 is None or self.EPZ1 is None or \ + self.EPY2 is None or self.EPZ2 is None or \ + self.EPY1 == 0 or self.EPZ1 == 0 or \ + self.EPY2 == 0 or self.EPZ2 == 0: + self.filling = FULL + else: + self.filling = HOLLOW + + logger.debug(repr(self)) + + # Check parameters + self._checkSize(self.HY1, MIN_DIM_FOR_EXTRUDED_SHAPE, + self._getParamUserName("HY1")) + self._checkSize(self.HZ1, MIN_DIM_FOR_EXTRUDED_SHAPE, + self._getParamUserName("HZ1")) + self._checkSize(self.HY2, MIN_DIM_FOR_EXTRUDED_SHAPE, + self._getParamUserName("HY2")) + self._checkSize(self.HZ2, MIN_DIM_FOR_EXTRUDED_SHAPE, + self._getParamUserName("HZ2")) + if self.filling == HOLLOW: + self._checkSize(self.EPY1, MIN_THICKNESS, + self._getParamUserName("EPY1")) + self._checkSize(self.EPZ1, MIN_THICKNESS, + self._getParamUserName("EPZ1")) + self._checkSize(self.EPY2, MIN_THICKNESS, + self._getParamUserName("EPY2")) + self._checkSize(self.EPZ2, MIN_THICKNESS, + self._getParamUserName("EPZ2")) + self._checkSize(self.HY1 - 2 * self.EPY1, + MIN_DIM_FOR_EXTRUDED_SHAPE, + "%s - 2 * %s" % (self._getParamUserName("HY1"), + self._getParamUserName("EPY1"))) + self._checkSize(self.HZ1 - 2 * self.EPZ1, + MIN_DIM_FOR_EXTRUDED_SHAPE, + "%s - 2 * %s" % (self._getParamUserName("HZ1"), + self._getParamUserName("EPZ1"))) + self._checkSize(self.HY2 - 2 * self.EPY2, + MIN_DIM_FOR_EXTRUDED_SHAPE, + "%s - 2 * %s" % (self._getParamUserName("HY2"), + self._getParamUserName("EPY2"))) + self._checkSize(self.HZ2 - 2 * self.EPZ2, + MIN_DIM_FOR_EXTRUDED_SHAPE, + "%s - 2 * %s" % (self._getParamUserName("HZ2"), + self._getParamUserName("EPZ2"))) + + def _makeRectangle(self, HY, HZ, planeSect): + """ + Create a rectangle in the specified plane. + """ + halfHY = HY / 2.0 + halfHZ = HZ / 2.0 + sketchStr = "Sketcher:F %g" % (-halfHZ) + " %g" % (-halfHY) + ":" + sketchStr += "TT %g" % (halfHZ) + " %g" % (-halfHY) + ":" + sketchStr += "TT %g" % (halfHZ) + " %g" % (halfHY) + ":" + sketchStr += "TT %g" % (-halfHZ) + " %g" % (halfHY) + ":WW" + logger.debug('Drawing rectangle: "%s"' % sketchStr) + sketch = self.geom.MakeSketcherOnPlane(sketchStr, planeSect) + return sketch + + def _makeSectionWires(self, fPoint, fNormal, lPoint, lNormal): + """ + Create the rectangular sections used to build the pipe. + """ + planeSect1 = self.geom.MakePlane(fPoint, fNormal, 1.0) + outerRect1 = self._makeRectangle(self.HY1, self.HZ1, planeSect1) + planeSect2 = self.geom.MakePlane(lPoint, lNormal, 1.0) + outerRect2 = self._makeRectangle(self.HY2, self.HZ2, planeSect2) + if self.filling == HOLLOW: + innerRect1 = self._makeRectangle(self.HY1 - 2 * self.EPY1, + self.HZ1 - 2 * self.EPZ1, + planeSect1) + innerRect2 = self._makeRectangle(self.HY2 - 2 * self.EPY2, + self.HZ2 - 2 * self.EPZ2, + planeSect2) + else: + innerRect1 = None + innerRect2 = None + + return (outerRect1, innerRect1, outerRect2, innerRect2) + + +class StructuralElementPart2D(StructuralElementPart): + """ + This class is an "abstract" class for all 2D structural element parts. It + should not be instantiated directly. See class + :class:`StructuralElementPart` for the description of the parameters. + """ + + DEFAULT_NAME = "StructuralElementPart2D" + + def __init__(self, studyId, groupName, groupGeomObj, parameters, + name = DEFAULT_NAME): + StructuralElementPart.__init__(self, studyId, groupName, groupGeomObj, + parameters, name) + self._orientation = orientation.Orientation2D( + self._getParameter(["angleAlpha"]), + self._getParameter(["angleBeta"]), + self._getParameter(["Vecteur"])) + self.offset = self._getParameter(["Excentre"], 0.0) + + def _makeFaceOffset(self, face, offset, epsilon = 1e-6): + """ + Create a copy of a face at a given offset. + """ + if abs(offset) < epsilon: + return self.geom.MakeCopy(face) + else: + offsetObj = self.geom.MakeOffset(face, offset) + # We have to explode the resulting object into faces because it is + # created as a polyhedron and not as a single face + faces = self.geom.SubShapeAll(offsetObj, + self.geom.ShapeType["FACE"]) + return faces[0] + + def _buildMarkersWithOffset(self, offset): + """ + Build the markers for the structural element part with a given offset + from the base face. + """ + uParam = 0.5 + vParam = 0.5 + listMarkers = [] + subShapes = self._getSubShapes() + + for subShape in subShapes: + faces = self.geom.SubShapeAll(subShape, + self.geom.ShapeType["FACE"]) + for face in faces: + offsetFace = self._makeFaceOffset(face, offset) + # get tangent plane on surface by parameters + center = self.geom.MakeVertexOnSurface(offsetFace, + uParam, vParam) + tangPlane = self.geom.MakeTangentPlaneOnFace(offsetFace, + uParam, vParam, + 1.0) + normal = self.geom.GetNormal(tangPlane) + marker = self._orientation.buildMarker(self.geom, + center, normal) + listMarkers.append(marker) + + return listMarkers + + +class ThickShell(StructuralElementPart2D): + """ + This class defines a shell with a given thickness. It can be shifted from + the base face. The valid parameters for thick shells are: + + * "Epais": thickness of the shell. + * "Excentre": offset of the shell from the base face. + * "angleAlpha": angle used to build the markers (see class + :class:`~salome.geom.structelem.orientation.Orientation2D`) + * "angleBeta": angle used to build the markers (see class + :class:`~salome.geom.structelem.orientation.Orientation2D`) + * "Vecteur": vector used instead of the angles to build the markers (see + class :class:`~salome.geom.structelem.orientation.Orientation2D`) + + See class :class:`StructuralElementPart` for the description of the + other parameters. + """ + + DEFAULT_NAME = "ThickShell" + + def __init__(self, studyId, groupName, groupGeomObj, parameters, + name = DEFAULT_NAME): + StructuralElementPart2D.__init__(self, studyId, groupName, + groupGeomObj, parameters, name) + self.thickness = self._getParameter(["Epais"]) + logger.debug(repr(self)) + + def _buildPart(self): + """ + Create the geometrical shapes corresponding to the thick shell. + """ + subShapes = self._getSubShapes() + listSolids = [] + + for subShape in subShapes: + faces = self.geom.SubShapeAll(subShape, + self.geom.ShapeType["FACE"]) + for face in faces: + shape = self._buildThickShellForFace(face) + listSolids.append(shape) + + if len(listSolids) == 0: + return None + elif len(listSolids) == 1: + return listSolids[0] + else: + return self.geom.MakeCompound(listSolids) + + def _buildThickShellForFace(self, face): + """ + Create the geometrical shapes corresponding to the thick shell for a + given face. + """ + epsilon = 1e-6 + if self.thickness < 2 * epsilon: + return self._makeFaceOffset(face, self.offset, epsilon) + + upperOffset = self.offset + self.thickness / 2.0 + lowerOffset = self.offset - self.thickness / 2.0 + ruledMode = True + modeSolid = False + + upperFace = self._makeFaceOffset(face, upperOffset, epsilon) + lowerFace = self._makeFaceOffset(face, lowerOffset, epsilon) + listShapes = [upperFace, lowerFace] + upperWires = self.geom.SubShapeAll(upperFace, + self.geom.ShapeType["WIRE"]) + lowerWires = self.geom.SubShapeAll(lowerFace, + self.geom.ShapeType["WIRE"]) + if self.geom.KindOfShape(face)[0] == self.geom.kind.CYLINDER2D: + # if the face is a cylinder, we remove the extra side edge + upperWires = self._removeCylinderExtraEdge(upperWires) + lowerWires = self._removeCylinderExtraEdge(lowerWires) + for i in range(len(upperWires)): + resShape = self.geom.MakeThruSections([upperWires[i], + lowerWires[i]], + modeSolid, epsilon, + ruledMode) + listShapes.append(resShape) + resultShell = self.geom.MakeShell(listShapes) + resultSolid = self.geom.MakeSolid([resultShell]) + return resultSolid + + def _removeCylinderExtraEdge(self, wires): + """ + Remove the side edge in a cylinder. + """ + result = [] + for wire in wires: + edges = self.geom.SubShapeAll(wire, self.geom.ShapeType["EDGE"]) + for edge in edges: + if self.geom.KindOfShape(edge)[0] == self.geom.kind.CIRCLE: + result.append(edge) + return result + + def _buildMarkers(self): + """ + Build the markers defining the orientation of the thick shell. + """ + return self._buildMarkersWithOffset(self.offset + + self.thickness / 2.0) + + +class Grid(StructuralElementPart2D): + """ + This class defines a grid. A grid is represented by a 2D face patterned + with small lines in the main direction of the grid frame. The valid + parameters for grids are: + + * "Excentre": offset of the grid from the base face. + * "angleAlpha": angle used to build the markers (see class + :class:`~salome.geom.structelem.orientation.Orientation2D`) + * "angleBeta": angle used to build the markers (see class + :class:`~salome.geom.structelem.orientation.Orientation2D`) + * "Vecteur": vector used instead of the angles to build the markers (see + class :class:`~salome.geom.structelem.orientation.Orientation2D`) + * "origAxeX": X coordinate of the origin of the axis used to determine the + orientation of the frame in the case of a cylindrical grid. + * "origAxeY": Y coordinate of the origin of the axis used to determine the + orientation of the frame in the case of a cylindrical grid. + * "origAxeZ": Z coordinate of the origin of the axis used to determine the + orientation of the frame in the case of a cylindrical grid. + * "axeX": X coordinate of the axis used to determine the orientation of + the frame in the case of a cylindrical grid. + * "axeY": Y coordinate of the axis used to determine the orientation of + the frame in the case of a cylindrical grid. + * "axeZ": Z coordinate of the axis used to determine the orientation of + the frame in the case of a cylindrical grid. + + See class :class:`StructuralElementPart` for the description of the + other parameters. + """ + + DEFAULT_NAME = "Grid" + + def __init__(self, studyId, groupName, groupGeomObj, parameters, + name = DEFAULT_NAME): + StructuralElementPart2D.__init__(self, studyId, groupName, + groupGeomObj, parameters, name) + self.xr = self._getParameter(["origAxeX"]) + self.yr = self._getParameter(["origAxeY"]) + self.zr = self._getParameter(["origAxeZ"]) + self.vx = self._getParameter(["axeX"]) + self.vy = self._getParameter(["axeY"]) + self.vz = self._getParameter(["axeZ"]) + logger.debug(repr(self)) + + def _buildPart(self): + """ + Create the geometrical shapes representing the grid. + """ + subShapes = self._getSubShapes() + listGridShapes = [] + + for subShape in subShapes: + faces = self.geom.SubShapeAll(subShape, + self.geom.ShapeType["FACE"]) + for face in faces: + if self.geom.KindOfShape(face)[0] == \ + self.geom.kind.CYLINDER2D and \ + self.xr is not None and self.yr is not None and \ + self.zr is not None and self.vx is not None and \ + self.vy is not None and self.vz is not None: + shape = self._buildGridForCylinderFace(face) + else: + shape = self._buildGridForNormalFace(face) + listGridShapes.append(shape) + + if len(listGridShapes) == 0: + return None + elif len(listGridShapes) == 1: + return listGridShapes[0] + else: + return self.geom.MakeCompound(listGridShapes) + + def _buildGridForNormalFace(self, face): + """ + Create the geometrical shapes representing the grid for a given + non-cylindrical face. + """ + baseFace = self._makeFaceOffset(face, self.offset) + gridList = [baseFace] + + # Compute display length for grid elements + p1 = self.geom.MakeVertexOnSurface(baseFace, 0.0, 0.0) + p2 = self.geom.MakeVertexOnSurface(baseFace, 0.1, 0.1) + length = self.geom.MinDistance(p1, p2) / 2.0 + + for u in range(1, 10): + uParam = u * 0.1 + for v in range(1, 10): + vParam = v * 0.1 + # get tangent plane on surface by parameters + center = self.geom.MakeVertexOnSurface(baseFace, + uParam, vParam) + tangPlane = self.geom.MakeTangentPlaneOnFace(baseFace, uParam, + vParam, 1.0) + + # use the marker to get the orientation of the frame + normal = self.geom.GetNormal(tangPlane) + marker = self._orientation.buildMarker(self.geom, center, + normal, False) + [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz] = self.geom.GetPosition(marker) + xPoint = self.geom.MakeTranslation(center, Xx * length, + Xy * length, Xz * length) + gridLine = self.geom.MakeLineTwoPnt(center, xPoint) + gridList.append(gridLine) + grid = self.geom.MakeCompound(gridList) + return grid + + def _buildGridForCylinderFace(self, face): + """ + Create the geometrical shapes representing the grid for a given + cylindrical face. + """ + baseFace = self._makeFaceOffset(face, self.offset) + gridList = [baseFace] + + # Compute display length for grid elements + p1 = self.geom.MakeVertexOnSurface(baseFace, 0.0, 0.0) + p2 = self.geom.MakeVertexOnSurface(baseFace, 0.1, 0.1) + length = self.geom.MinDistance(p1, p2) / 2.0 + + # Create reference vector V + origPoint = self.geom.MakeVertex(self.xr, self.yr, self.zr) + vPoint = self.geom.MakeTranslation(origPoint, + self.vx, self.vy, self.vz) + refVec = self.geom.MakeVector(origPoint, vPoint) + + for u in range(10): + uParam = u * 0.1 + for v in range(1, 10): + vParam = v * 0.1 + + # Compute the local orientation of the frame + center = self.geom.MakeVertexOnSurface(baseFace, + uParam, vParam) + locPlaneYZ = self.geom.MakePlaneThreePnt(origPoint, center, + vPoint, 1.0) + locOrient = self.geom.GetNormal(locPlaneYZ) + xPoint = self.geom.MakeTranslationVectorDistance(center, + locOrient, + length) + gridLine = self.geom.MakeLineTwoPnt(center, xPoint) + gridList.append(gridLine) + + grid = self.geom.MakeCompound(gridList) + return grid + + def _buildMarkers(self): + """ + Create the markers defining the orientation of the grid. + """ + return self._buildMarkersWithOffset(self.offset) + + +def VisuPoutreGenerale(studyId, groupName, groupGeomObj, parameters, + name = "POUTRE"): + """ + Alias for class :class:`GeneralBeam`. + """ + return GeneralBeam(studyId, groupName, groupGeomObj, parameters, name) + +def VisuPoutreCercle(studyId, groupName, groupGeomObj, parameters, + name = "POUTRE"): + """ + Alias for class :class:`CircularBeam`. + """ + return CircularBeam(studyId, groupName, groupGeomObj, parameters, name) + +def VisuPoutreRectangle(studyId, groupName, groupGeomObj, parameters, + name = "POUTRE"): + """ + Alias for class :class:`RectangularBeam`. + """ + return RectangularBeam(studyId, groupName, groupGeomObj, parameters, name) + +def VisuBarreGenerale(studyId, groupName, groupGeomObj, parameters, + name = "BARRE"): + """ + Alias for class :class:`GeneralBeam`. + """ + return GeneralBeam(studyId, groupName, groupGeomObj, parameters, name) + +def VisuBarreRectangle(studyId, groupName, groupGeomObj, parameters, + name = "BARRE"): + """ + Alias for class :class:`RectangularBeam`. + """ + return RectangularBeam(studyId, groupName, groupGeomObj, parameters, name) + +def VisuBarreCercle(studyId, groupName, groupGeomObj, parameters, + name = "BARRE"): + """ + Alias for class :class:`CircularBeam`. + """ + return CircularBeam(studyId, groupName, groupGeomObj, parameters, name) + +def VisuCable(studyId, groupName, groupGeomObj, parameters, name = "CABLE"): + """ + Alias for class :class:`CircularBeam`. + """ + return CircularBeam(studyId, groupName, groupGeomObj, parameters, name) + +def VisuCoque(studyId, groupName, groupGeomObj, parameters, name = "COQUE"): + """ + Alias for class :class:`ThickShell`. + """ + return ThickShell(studyId, groupName, groupGeomObj, parameters, name) + +def VisuGrille(studyId, groupName, groupGeomObj, parameters, name = "GRILLE"): + """ + Alias for class :class:`Grid`. + """ + return Grid(studyId, groupName, groupGeomObj, parameters, name) diff --git a/src/GEOM_SWIG/GEOM_TestAll.py b/src/GEOM_SWIG/GEOM_TestAll.py index 63d2d0b69..6637f15d5 100644 --- a/src/GEOM_SWIG/GEOM_TestAll.py +++ b/src/GEOM_SWIG/GEOM_TestAll.py @@ -437,6 +437,14 @@ def TestAll (geompy, math): nameS = geompy.SubShapeName(SubFaceS, Box) id_SubFace = geompy.addToStudyInFather(Box, SubFaceS, nameS) + # GetExistingSubObjects + SubObjsAll = geompy.GetExistingSubObjects(Box, True) + print "For now, Box has the following created sub-objects:", SubObjsAll + + # GetGroups + SubGrpsAll = geompy.GetGroups(Box) + print "For now, Box has the following created groups:", SubGrpsAll + # SubShapeAll SubEdgeList = geompy.SubShapeAll(SubFace, geompy.ShapeType["EDGE"]) i=0 diff --git a/src/GEOM_SWIG/GEOM_TestOthers.py b/src/GEOM_SWIG/GEOM_TestOthers.py index 327eea930..e0050e398 100644 --- a/src/GEOM_SWIG/GEOM_TestOthers.py +++ b/src/GEOM_SWIG/GEOM_TestOthers.py @@ -510,6 +510,17 @@ def TestOtherOperations (geompy, math): geompy.addToStudyInFather(blocksComp, pb0_top_1, "point from blocksComp (-50, 50, 50)") geompy.addToStudyInFather(blocksComp, pb0_bot_1, "point from blocksComp (-50, -50, -50)") + # GetVertexNearPoint(theShape, thePoint) + pb0_top_2_near = geompy.MakeVertex(40, 40, 40) + pb0_top_2 = geompy.GetVertexNearPoint(blocksComp, pb0_top_2_near) + + geompy.addToStudyInFather(blocksComp, pb0_top_2, "point from blocksComp near (40, 40, 40)") + + # GetEdge(theShape, thePoint1, thePoint2) + edge_top_y50 = geompy.GetEdge(blocksComp, pb0_top_1, pb0_top_2) + + geompy.addToStudyInFather(blocksComp, edge_top_y50, "edge from blocksComp by two points") + # GetEdgeNearPoint(theShape, thePoint) pmidle = geompy.MakeVertex(50, 0, 50) edge1 = geompy.GetEdgeNearPoint(blocksComp, pmidle) @@ -521,6 +532,11 @@ def TestOtherOperations (geompy, math): geompy.addToStudyInFather(blocksComp, b0_image, "b0 image") + # GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance) + b0_faces_plus = geompy.GetShapesNearPoint(blocksComp, pb0_top_2_near, geompy.ShapeType["FACE"], 0.01) + + geompy.addToStudyInFather(blocksComp, b0_faces_plus, "faces near point (40, 40, 40)") + # GetShapesOnPlane faces_on_pln = geompy.GetShapesOnPlane(blocksComp, geompy.ShapeType["FACE"], v_0pp, geompy.GEOM.ST_ONIN) diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 6ccb27bad..4c7c7919a 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -85,7 +85,7 @@ import math ## Enumeration ShapeType as a dictionary # @ingroup l1_geompy_auxiliary -ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8} +ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8} ## Raise an Error, containing the Method_name, if Operation is Failed ## @ingroup l1_geompy_auxiliary @@ -409,6 +409,33 @@ class geompyDC(GEOM._objref_GEOM_Gen): return self.RestoreSubShapesO(self.myStudy, theObject, theArgs, theFindMethod, theInheritFirstArg, theAddPrefix) + ## Publish sub-shapes, standing for arguments and sub-shapes of arguments + # To be used from python scripts out of geompy.addToStudy (non-default usage) + # \param theObject published GEOM object, arguments of which will be published + # \param theArgs list of GEOM_Object, operation arguments to be published. + # If this list is empty, all operation arguments will be published + # \param theFindMethod method to search subshapes, corresponding to arguments and + # their subshapes. Value from enumeration GEOM::find_shape_method. + # \param theInheritFirstArg set properties of the first argument for theObject. + # Do not publish subshapes in place of arguments, but only + # in place of subshapes of the first argument, + # because the whole shape corresponds to the first argument. + # Mainly to be used after transformations, but it also can be + # usefull after partition with one object shape, and some other + # operations, where only the first argument has to be considered. + # If theObject has only one argument shape, this flag is automatically + # considered as True, not regarding really passed value. + # \param theAddPrefix add prefix "from_" to names of restored sub-shapes, + # and prefix "from_subshapes_of_" to names of partially restored subshapes. + # \return list of published sub-shapes + # + # @ref tui_restore_prs_params "Example" + def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, + theInheritFirstArg=False, theAddPrefix=True): + # Example: see GEOM_TestAll.py + return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs, + theFindMethod, theInheritFirstArg, theAddPrefix) + # end of l3_restore_ss ## @} @@ -422,7 +449,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing the created point. # # @ref tui_creation_point "Example" - def MakeVertex(self,theX, theY, theZ): + def MakeVertex(self, theX, theY, theZ): # Example: see GEOM_TestAll.py theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ) anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ) @@ -1350,13 +1377,13 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @param theTol3D a 3d tolerance to be reached # @param theNbIter a number of iteration of approximation algorithm # @param theMethod Kind of method to perform filling operation: - # 0 - Default - standard behaviour - # 1 - Use edges orientation - orientation of edges are - # used: if edge is reversed curve from this edge - # is reversed before using in filling algorithm. - # 2 - Auto-correct orientation - change orientation - # of curves using minimization of sum of distances - # between ends points of edges. + # GEOM.FOM_Default - Default - standard behaviour + # /GEOM.FOM_UseOri - Use edges orientation - orientation of edges is + # used: if the edge is reversed, the curve from this edge + # is reversed before using it in the filling algorithm. + # /GEOM.FOM_AutoCorrect - Auto-correct orientation - changes the orientation + # of the curves using minimization of sum of distances + # between the end points of the edges. # @param isApprox if True, BSpline curves are generated in the process # of surface construction. By default it is False, that means # the surface is created using Besier curves. The usage of @@ -1543,6 +1570,19 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("MakeEdge", self.ShapesOp) return anObj + ## Create an edge from specified wire. + # @param theWire source Wire. + # @param theLinearTolerance linear tolerance value. + # @param theAngularTolerance angular tolerance value. + # @return New GEOM_Object, containing the created edge. + # + # @ref tui_creation_edge "Example" + def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12): + # Example: see GEOM_TestAll.py + anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance) + RaiseIfFailed("MakeEdgeWire", self.ShapesOp) + return anObj + ## Create a wire from the set of edges and wires. # @param theEdgesAndWires List of edges and/or wires. # @param theTolerance Maximum distance between vertices, that will be merged. @@ -1986,8 +2026,14 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @param theShapeWhat Shape, specifying what to find. # @return Group of all found sub-shapes or a single found sub-shape. # + # @note This function has a restriction on argument shapes. + # If \a theShapeWhere has curved parts with significantly + # outstanding centres (i.e. the mass centre of a part is closer to + # \a theShapeWhat than to the part), such parts will not be found. + # @image html get_in_place_lost_part.png + # # @ref swig_GetInPlace "Example" - def GetInPlace(self,theShapeWhere, theShapeWhat): + def GetInPlace(self, theShapeWhere, theShapeWhat): # Example: see GEOM_TestOthers.py anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat) RaiseIfFailed("GetInPlace", self.ShapesOp) @@ -2056,6 +2102,32 @@ class geompyDC(GEOM._objref_GEOM_Gen): ## @addtogroup l4_decompose ## @{ + ## Get all sub-shapes and groups of \a theShape, + # that were created already by any other methods. + # @param theShape Any shape. + # @param theGroupsOnly If this parameter is TRUE, only groups will be + # returned, else all found sub-shapes and groups. + # @return List of existing sub-objects of \a theShape. + # + # @ref swig_all_decompose "Example" + def GetExistingSubObjects(self, theShape, theGroupsOnly = False): + # Example: see GEOM_TestAll.py + ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly) + RaiseIfFailed("GetExistingSubObjects", self.ShapesOp) + return ListObj + + ## Get all groups of \a theShape, + # that were created already by any other methods. + # @param theShape Any shape. + # @return List of existing groups of \a theShape. + # + # @ref swig_all_decompose "Example" + def GetGroups(self, theShape): + # Example: see GEOM_TestAll.py + ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True) + RaiseIfFailed("GetExistingSubObjects", self.ShapesOp) + return ListObj + ## Explode a shape on subshapes of a given type. # @param aShape Shape to be exploded. # @param aType Type of sub-shapes to be retrieved. @@ -2303,11 +2375,22 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing processed shape. # # @ref swig_todo "Example" - def ChangeOrientationShellCopy(self,theObject): + def ChangeOrientationShellCopy(self, theObject): anObj = self.HealOp.ChangeOrientationCopy(theObject) RaiseIfFailed("ChangeOrientationCopy", self.HealOp) return anObj + ## Try to limit tolerance of the given object by value \a theTolerance. + # @param theObject Shape to be processed. + # @param theTolerance Required tolerance value. + # @return New GEOM_Object, containing processed shape. + # + # @ref tui_limit_tolerance "Example" + def LimitTolerance(self, theObject, theTolerance = 1e-07): + anObj = self.HealOp.LimitTolerance(theObject, theTolerance) + RaiseIfFailed("LimitTolerance", self.HealOp) + return anObj + ## Get a list of wires (wrapped in GEOM_Object-s), # that constitute a free boundary of the given shape. # @param theObject Shape to get free boundary of. @@ -2317,7 +2400,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # theOpenWires: Open wires on the free boundary of the given shape. # # @ref tui_measurement_tools_page "Example" - def GetFreeBoundary(self,theObject): + def GetFreeBoundary(self, theObject): # Example: see GEOM_TestHealing.py anObj = self.HealOp.GetFreeBoundary(theObject) RaiseIfFailed("GetFreeBoundary", self.HealOp) @@ -2441,6 +2524,8 @@ class geompyDC(GEOM._objref_GEOM_Gen): # in order to avoid possible intersection between shapes from # this compound. # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum). + # If this parameter is set to -1 ("Auto"), most appropriate shape limit + # type will be detected automatically. # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of # target type (equal to Limit) are kept in the result, # else standalone shapes of lower dimension @@ -2462,9 +2547,15 @@ class geompyDC(GEOM._objref_GEOM_Gen): # # @ref tui_partition "Example" def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[], - Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[], + Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[], KeepNonlimitShapes=0): # Example: see GEOM_TestAll.py + if Limit == ShapeType["AUTO"]: + # automatic detection of the most appropriate shape limit type + lim = GEOM.SOLID + for s in ListShapes: lim = max( lim, s.GetMinShapeType() ) + Limit = lim._v + pass anObj = self.BoolOp.MakePartition(ListShapes, ListTools, ListKeepInside, ListRemoveInside, Limit, RemoveWebs, ListMaterials, @@ -2487,8 +2578,14 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @ref swig_todo "Example" def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[], - Limit=ShapeType["SHAPE"], RemoveWebs=0, + Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[], KeepNonlimitShapes=0): + if Limit == ShapeType["AUTO"]: + # automatic detection of the most appropriate shape limit type + lim = GEOM.SOLID + for s in ListShapes: lim = max( lim, s.GetMinShapeType() ) + Limit = lim._v + pass anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools, ListKeepInside, ListRemoveInside, Limit, RemoveWebs, ListMaterials, @@ -2501,7 +2598,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @ref tui_partition "Example 1" # \n @ref swig_Partition "Example 2" def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[], - Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[], + Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[], KeepNonlimitShapes=0): # Example: see GEOM_TestOthers.py anObj = self.MakePartition(ListShapes, ListTools, @@ -2960,8 +3057,10 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @ref tui_fillet2d "Example" def MakeFillet1D(self,theShape, theR, theListOfVertexes): # Example: see GEOM_TestAll.py + theR,Parameters = ParseParameters(theR) anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes) RaiseIfFailed("MakeFillet1D", self.LocalOp) + anObj.SetParameters(Parameters) return anObj ## Perform a fillet on the specified edges/faces of the given shape @@ -2974,8 +3073,10 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @ref tui_fillet2d "Example" def MakeFillet2D(self,theShape, theR, theListOfVertexes): # Example: see GEOM_TestAll.py + theR,Parameters = ParseParameters(theR) anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes) RaiseIfFailed("MakeFillet2D", self.LocalOp) + anObj.SetParameters(Parameters) return anObj ## Perform a symmetric chamfer on all edges of the given shape. @@ -3657,19 +3758,31 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing the found vertex. # # @ref swig_GetPoint "Example" - def GetPoint(self,theShape, theX, theY, theZ, theEpsilon): + def GetPoint(self, theShape, theX, theY, theZ, theEpsilon): # Example: see GEOM_TestOthers.py anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon) RaiseIfFailed("GetPoint", self.BlocksOp) return anObj + ## Find a vertex of the given shape, which has minimal distance to the given point. + # @param theShape Any shape. + # @param thePoint Point, close to the desired vertex. + # @return New GEOM_Object, containing the found vertex. + # + # @ref swig_GetVertexNearPoint "Example" + def GetVertexNearPoint(self, theShape, thePoint): + # Example: see GEOM_TestOthers.py + anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint) + RaiseIfFailed("GetVertexNearPoint", self.BlocksOp) + return anObj + ## Get an edge, found in the given shape by two given vertices. # @param theShape Block or a compound of blocks. # @param thePoint1,thePoint2 Points, close to the ends of the desired edge. # @return New GEOM_Object, containing the found edge. # - # @ref swig_todo "Example" - def GetEdge(self,theShape, thePoint1, thePoint2): + # @ref swig_GetEdge "Example" + def GetEdge(self, theShape, thePoint1, thePoint2): # Example: see GEOM_Spanner.py anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2) RaiseIfFailed("GetEdge", self.BlocksOp) @@ -3681,7 +3794,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing the found edge. # # @ref swig_GetEdgeNearPoint "Example" - def GetEdgeNearPoint(self,theShape, thePoint): + def GetEdgeNearPoint(self, theShape, thePoint): # Example: see GEOM_TestOthers.py anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint) RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp) @@ -3729,7 +3842,7 @@ class geompyDC(GEOM._objref_GEOM_Gen): # @return New GEOM_Object, containing the found face. # # @ref swig_GetFaceNearPoint "Example" - def GetFaceNearPoint(self,theShape, thePoint): + def GetFaceNearPoint(self, theShape, thePoint): # Example: see GEOM_Spanner.py anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint) RaiseIfFailed("GetFaceNearPoint", self.BlocksOp) @@ -3747,6 +3860,23 @@ class geompyDC(GEOM._objref_GEOM_Gen): RaiseIfFailed("GetFaceByNormale", self.BlocksOp) return anObj + ## Find all subshapes of type \a theShapeType of the given shape, + # which have minimal distance to the given point. + # @param theShape Any shape. + # @param thePoint Point, close to the desired shape. + # @param theShapeType Defines what kind of subshapes is searched. + # @param theTolerance The tolerance for distances comparison. All shapes + # with distances to the given point in interval + # [minimal_distance, minimal_distance + theTolerance] will be gathered. + # @return New GEOM_Object, containing a group of all found shapes. + # + # @ref swig_GetShapesNearPoint "Example" + def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07): + # Example: see GEOM_TestOthers.py + anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance) + RaiseIfFailed("GetShapesNearPoint", self.BlocksOp) + return anObj + # end of l3_blocks_op ## @} @@ -3946,7 +4076,9 @@ class geompyDC(GEOM._objref_GEOM_Gen): def AddObject(self,theGroup, theSubShapeID): # Example: see GEOM_TestOthers.py self.GroupOp.AddObject(theGroup, theSubShapeID) - RaiseIfFailed("AddObject", self.GroupOp) + if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT": + RaiseIfFailed("AddObject", self.GroupOp) + pass pass ## Removes a sub object with ID \a theSubShapeId from the group diff --git a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx index 91ac4ab99..a1d4e7fed 100644 --- a/src/GenerationGUI/GenerationGUI_PipeDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PipeDlg.cxx @@ -302,7 +302,7 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index 577092930..4d1b317b0 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -371,7 +371,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); @@ -428,7 +428,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); } diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index eef13201d..466a15c66 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -262,7 +262,7 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); myAxis = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index 8391cb3bf..327b0d4bb 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -141,9 +141,9 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW myRestrictGroupBox->setEnabled(!CORBA::is_nil(myMainObj)); allSubs->setChecked(true); - myShowOnlyBtn = new QPushButton(tr("Show only selected"), GroupMedium); - myHideSelBtn = new QPushButton(tr("Hide selected"), GroupMedium); - myShowAllBtn = new QPushButton(tr("Show all sub-shapes"), GroupMedium); + myShowOnlyBtn = new QPushButton(tr("SHOW_ONLY_SELECTED"), GroupMedium); + myHideSelBtn = new QPushButton(tr("HIDE_SELECTED"), GroupMedium); + myShowAllBtn = new QPushButton(tr("SHOW_ALL_SUB_SHAPES"), GroupMedium); mySelAllBtn = new QPushButton(tr("SELECT_ALL"), GroupMedium); myAddBtn = new QPushButton(tr("ADD"), GroupMedium); @@ -473,7 +473,7 @@ void GroupGUI_GroupDlg::SelectionIntoArgument() } } else { // an attempt to synchronize list box selection with 3d viewer - if (myBusy) { + if ( myBusy || myMainObj->_is_nil() ) { return; } @@ -617,7 +617,8 @@ int GroupGUI_GroupDlg::getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMap theMapIndex.Clear(); SalomeApp_Application* app = myGeomGUI->getApp(); - if (!app) return 0; + if ( !app || myMainObj->_is_nil() ) + return 0; LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); SALOME_ListIO aSelList; @@ -786,6 +787,7 @@ void GroupGUI_GroupDlg::activateSelection() myIsShapeType) // check if shape type is already choosen by user { GEOM_Displayer* aDisplayer = getDisplayer(); + int prevDisplayMode = aDisplayer->SetDisplayMode(0); SUIT_ViewWindow* aViewWindow = 0; SUIT_Study* activeStudy = SUIT_Session::session()->activeApplication()->activeStudy(); @@ -828,6 +830,7 @@ void GroupGUI_GroupDlg::activateSelection() } } aDisplayer->UpdateViewer(); + aDisplayer->SetDisplayMode(prevDisplayMode); } globalSelection(GEOM_ALLSHAPES); @@ -1056,11 +1059,9 @@ bool GroupGUI_GroupDlg::execute(ObjectList& objects) SalomeApp_Study* study = getStudy(); if (study) { - char* objIOR = GEOMBase::GetIORFromObject(aGroup); - std::string IOR(objIOR); - free(objIOR); - if (IOR != "") { - _PTR(SObject) SO (study->studyDS()->FindObjectIOR(IOR)); + QString objIOR = GEOMBase::GetIORFromObject(aGroup); + if (objIOR != "") { + _PTR(SObject) SO (study->studyDS()->FindObjectIOR(objIOR.toLatin1().constData())); if (SO) { _PTR(StudyBuilder) aBuilder (study->studyDS()->NewBuilder()); aBuilder->SetName(SO, getNewObjectName().toLatin1().constData()); diff --git a/src/IGESImport/IGESImport.cxx b/src/IGESImport/IGESImport.cxx index 2c4eb04a9..a9ee6b7c6 100644 --- a/src/IGESImport/IGESImport.cxx +++ b/src/IGESImport/IGESImport.cxx @@ -19,12 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: IGESImport.cxx +// Created: Wed May 19 14:36:35 2004 +// Author: Pavel TELKOV -// File: IGESImport.cxx -// Created: Wed May 19 14:36:35 2004 -// Author: Pavel TELKOV -// -// #include "utilities.h" #include @@ -32,15 +30,26 @@ #include #include #include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include #include -#include - #include #include #include -#include #ifdef WNT #if defined IGESIMPORT_EXPORTS || defined IGESImport_EXPORTS @@ -72,7 +81,7 @@ IGESIMPORT_EXPORT TopoDS_Shape Import (const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatName, TCollection_AsciiString& theError, - const TDF_Label&) + const TDF_Label& theShapeLabel) { // Set "C" numeric locale to save numbers correctly Kernel_Utils::Localizer loc; @@ -85,19 +94,19 @@ IGESIMPORT_EXPORT if (status == IFSelect_RetDone) { - if( theFormatName == "IGES_UNIT" ) { - Handle(IGESData_IGESModel) aModel = + if (theFormatName == "IGES_UNIT") { + Handle(IGESData_IGESModel) aModel = Handle(IGESData_IGESModel)::DownCast(aReader.Model()); gp_Pnt P(1.0,0.0,0.0); - if(!aModel.IsNull()) { - Handle(TCollection_HAsciiString) aUnitName = + if (!aModel.IsNull()) { + Handle(TCollection_HAsciiString) aUnitName = aModel->GlobalSection().UnitName(); //cout<<"aUnitName = "<ToCString()<String()=="MM") { P = gp_Pnt(0.001,0.0,0.0); } - else if( aUnitName->String()=="CM" ) { + else if (aUnitName->String()=="CM") { P = gp_Pnt(0.01,0.0,0.0); } } @@ -107,12 +116,12 @@ IGESIMPORT_EXPORT aResShape = V; return aResShape; } - if( theFormatName == "IGES_SCALE" ) { + if (theFormatName == "IGES_SCALE") { //cout<<"need re-scale a model"<GlobalSection(); aGS.SetUnitFlag(6); aModel->SetGlobalSection(aGS); @@ -129,6 +138,38 @@ IGESIMPORT_EXPORT MESSAGE("ImportIGES : count of shapes produced = " << aReader.NbShapes()); aResShape = aReader.OneShape(); + // BEGIN: Store names of sub-shapes from file + Handle(Interface_InterfaceModel) Model = aReader.WS()->Model(); + Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader(); + if (!TR.IsNull()) { + Handle(Transfer_TransientProcess) TP = /*TransientProcess();*/TR->TransientProcess(); + Standard_Integer nb = Model->NbEntities(); + for (Standard_Integer i = 1; i <= nb; i++) { + Handle(IGESData_IGESEntity) ent = Handle(IGESData_IGESEntity)::DownCast(Model->Value(i)); + if (ent.IsNull() || ! ent->HasName()) continue; + + // find target shape + Handle(Transfer_Binder) binder = TP->Find(ent); + if (binder.IsNull()) continue; + TopoDS_Shape S = TransferBRep::ShapeResult(binder); + if (S.IsNull()) continue; + + // create label and set shape + TDF_Label L; + TDF_TagSource aTag; + L = aTag.NewChild(theShapeLabel); + TNaming_Builder tnBuild (L); + tnBuild.Generated(S); + + // set a name + TCollection_AsciiString string = ent->NameValue()->String(); + string.LeftAdjust(); + string.RightAdjust(); + TCollection_ExtendedString str (string); + TDataStd_Name::Set(L, str); + } + } + // END: Store names } else { // switch (status) { // case IFSelect_RetVoid: diff --git a/src/IGESImport/Makefile.am b/src/IGESImport/Makefile.am index 3f3b3815d..7613b4c16 100644 --- a/src/IGESImport/Makefile.am +++ b/src/IGESImport/Makefile.am @@ -16,13 +16,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # - # File : Makefile.in # Author : Pavel TELKOV # Modified by : Alexander BORODIN (OCN) - autotools usage # Module : GEOM # $Header$ -# + include $(top_srcdir)/adm_local/unix/make_common_starter.am # Libraries targets @@ -37,7 +36,7 @@ libIGESImport_la_CPPFLAGS = \ $(CAS_CPPFLAGS) \ $(KERNEL_CXXFLAGS) -libIGESImport_la_LDFLAGS = \ - $(STDLIB) \ - $(CAS_LDPATH) -lTKIGES \ +libIGESImport_la_LDFLAGS = \ + $(STDLIB) \ + $(CAS_LDPATH) -lTKIGES -lTKCAF -lTKLCAF \ $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics diff --git a/src/Makefile.am b/src/Makefile.am index 761e3d6a9..968fbdd33 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,10 +21,10 @@ # Author : Alexander BORODIN, Open CASCADE S.A.S. (alexander.borodin@opencascade.com) # Package : src (source files directory) # -SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport \ - BREPImport IGESExport IGESImport STEPExport STEPImport \ - STLExport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv \ - GEOM_SWIG +SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER OCC2VTK GEOM \ + BREPExport BREPImport IGESExport IGESImport STEPExport \ + STEPImport STLExport VTKExport ShHealOper GEOMImpl GEOM_I \ + GEOMClient GEOM_I_Superv GEOM_SWIG GEOM_PY if GEOM_ENABLE_GUI SUBDIRS += OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI \ @@ -33,10 +33,11 @@ if GEOM_ENABLE_GUI GroupGUI BlocksGUI AdvancedGUI GEOM_SWIG_WITHIHM endif -DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER GEOM BREPExport \ +DIST_SUBDIRS = ARCHIMEDE NMTDS NMTTools GEOMAlgo SKETCHER OCC2VTK GEOM BREPExport\ BREPImport IGESExport IGESImport STEPExport STEPImport STLExport \ - ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv GEOM_SWIG \ - OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase GEOMToolsGUI \ - DisplayGUI BasicGUI PrimitiveGUI GenerationGUI EntityGUI \ - BuildGUI BooleanGUI TransformationGUI OperationGUI RepairGUI \ - MeasureGUI GroupGUI BlocksGUI AdvancedGUI GEOM_SWIG_WITHIHM + VTKExport ShHealOper GEOMImpl GEOM_I GEOMClient GEOM_I_Superv \ + GEOM_SWIG OBJECT DlgRef GEOMFiltersSelection GEOMGUI GEOMBase \ + GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI \ + EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI \ + RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI \ + GEOM_SWIG_WITHIHM GEOM_PY diff --git a/src/MeasureGUI/Makefile.am b/src/MeasureGUI/Makefile.am index d495ab36b..e555d2d2f 100644 --- a/src/MeasureGUI/Makefile.am +++ b/src/MeasureGUI/Makefile.am @@ -118,5 +118,5 @@ libMeasureGUI_la_CPPFLAGS = \ libMeasureGUI_la_LDFLAGS = \ $(CAS_LDFLAGS) -lTKGeomBase \ - ../GEOMBase/libGEOMBase.la + ../GEOMBase/libGEOMBase.la ../DlgRef/libDlgRef.la diff --git a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx index e59a4498e..b49a52284 100644 --- a/src/MeasureGUI/MeasureGUI_AngleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_AngleDlg.cxx @@ -196,7 +196,9 @@ void MeasureGUI_AngleDlg::processObject() double anAngle = 0.; if (getParameters(anAngle)) { - myGrp->LineEdit3->setText(DlgRef::PrintDoubleValue(anAngle)); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aPrecision = resMgr->integerValue( "Geometry", "angle_precision", 6 ); + myGrp->LineEdit3->setText(DlgRef::PrintDoubleValue(anAngle, aPrecision)); redisplayPreview(); } else { diff --git a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx index 5794fae1f..20d7d7674 100644 --- a/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx @@ -30,6 +30,7 @@ #include "GeometryGUI.h" #include +#include #include #include @@ -143,14 +144,17 @@ void MeasureGUI_BndBoxDlg::processObject() myGrp->LineEdit32->setText( "" ); } else { - myGrp->LineEdit11->setText( tr( "%1" ).arg( aXMin, 12, 'f', 6 ) ); - myGrp->LineEdit12->setText( tr( "%1" ).arg( aXMax, 12, 'f', 6 ) ); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); - myGrp->LineEdit21->setText( tr( "%1" ).arg( aYMin, 12, 'f', 6 ) ); - myGrp->LineEdit22->setText( tr( "%1" ).arg( aYMax, 12, 'f', 6 ) ); + myGrp->LineEdit11->setText( DlgRef::PrintDoubleValue( aXMin, aPrecision ) ); + myGrp->LineEdit12->setText( DlgRef::PrintDoubleValue( aXMax, aPrecision ) ); - myGrp->LineEdit31->setText( tr( "%1" ).arg( aZMin, 12, 'f', 6 ) ); - myGrp->LineEdit32->setText( tr( "%1" ).arg( aZMax, 12, 'f', 6 ) ); + myGrp->LineEdit21->setText( DlgRef::PrintDoubleValue( aYMin, aPrecision ) ); + myGrp->LineEdit22->setText( DlgRef::PrintDoubleValue( aYMax, aPrecision ) ); + + myGrp->LineEdit31->setText( DlgRef::PrintDoubleValue( aZMin, aPrecision ) ); + myGrp->LineEdit32->setText( DlgRef::PrintDoubleValue( aZMax, aPrecision ) ); } } @@ -173,8 +177,8 @@ bool MeasureGUI_BndBoxDlg::getParameters( double& theXmin, double& theXmax, if ( CORBA::is_nil(aGeomGen) ) return false; - char* IOR = GEOMBase::GetIORFromObject( myObj ); - GEOM::GEOM_Object_var anObject = aGeomGen->GetIORFromString(IOR); + QString IOR = GEOMBase::GetIORFromObject( myObj ); + GEOM::GEOM_Object_var anObject = aGeomGen->GetIORFromString( IOR.toLatin1().constData() ); if ( CORBA::is_nil(anObject) ) return false; diff --git a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx index 451743a53..b4a909c68 100644 --- a/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx @@ -244,9 +244,12 @@ void MeasureGUI_CenterMassDlg::processObject() getParameters( x, y, z ); myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) ); - myGrp->LineEdit2->setText( DlgRef::PrintDoubleValue( x ) ); - myGrp->LineEdit3->setText( DlgRef::PrintDoubleValue( y ) ); - myGrp->LineEdit4->setText( DlgRef::PrintDoubleValue( z ) ); + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); + myGrp->LineEdit2->setText( DlgRef::PrintDoubleValue( x, aPrecision ) ); + myGrp->LineEdit3->setText( DlgRef::PrintDoubleValue( y, aPrecision ) ); + myGrp->LineEdit4->setText( DlgRef::PrintDoubleValue( z, aPrecision ) ); displayPreview(); } diff --git a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx index 3be5f624a..baf8a5897 100644 --- a/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_DistanceDlg.cxx @@ -180,12 +180,15 @@ void MeasureGUI_DistanceDlg::processObject() gp_Pnt aPnt1, aPnt2; double aDist = 0.; if (getParameters(aDist, aPnt1, aPnt2)) { - myGrp->LineEdit3->setText(DlgRef::PrintDoubleValue(aDist)); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); + + myGrp->LineEdit3->setText(DlgRef::PrintDoubleValue(aDist, aPrecision)); gp_XYZ aVec = aPnt2.XYZ() - aPnt1.XYZ(); - myGrp->LineEdit4->setText(DlgRef::PrintDoubleValue(aVec.X())); - myGrp->LineEdit5->setText(DlgRef::PrintDoubleValue(aVec.Y())); - myGrp->LineEdit6->setText(DlgRef::PrintDoubleValue(aVec.Z())); + myGrp->LineEdit4->setText(DlgRef::PrintDoubleValue(aVec.X(), aPrecision)); + myGrp->LineEdit5->setText(DlgRef::PrintDoubleValue(aVec.Y(), aPrecision)); + myGrp->LineEdit6->setText(DlgRef::PrintDoubleValue(aVec.Z(), aPrecision)); redisplayPreview(); } diff --git a/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx b/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx index 9d2c323c4..f6beab88a 100644 --- a/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_InertiaDlg.cxx @@ -28,6 +28,7 @@ #include "MeasureGUI_Widgets.h" #include +#include #include @@ -142,21 +143,21 @@ void MeasureGUI_InertiaDlg::processObject() myGrp->LineEdit43->setText( "" ); } else { - myGrp->LineEdit11->setText( QString( "%1" ).arg( aMat( 1, 1 ), 12, 'e', 4 ) ); - myGrp->LineEdit12->setText( QString( "%1" ).arg( aMat( 1, 2 ), 12, 'e', 4 ) ); - myGrp->LineEdit13->setText( QString( "%1" ).arg( aMat( 1, 3 ), 12, 'e', 4 ) ); + myGrp->LineEdit11->setText( DlgRef::PrintDoubleValue( aMat( 1, 1 ), -6 ) ); + myGrp->LineEdit12->setText( DlgRef::PrintDoubleValue( aMat( 1, 2 ), -6 ) ); + myGrp->LineEdit13->setText( DlgRef::PrintDoubleValue( aMat( 1, 3 ), -6 ) ); - myGrp->LineEdit21->setText( QString( "%1" ).arg( aMat( 2, 1 ), 12, 'e', 4 ) ); - myGrp->LineEdit22->setText( QString( "%1" ).arg( aMat( 2, 2 ), 12, 'e', 4 ) ); - myGrp->LineEdit23->setText( QString( "%1" ).arg( aMat( 2, 3 ), 12, 'e', 4 ) ); + myGrp->LineEdit21->setText( DlgRef::PrintDoubleValue( aMat( 2, 1 ), -6 ) ); + myGrp->LineEdit22->setText( DlgRef::PrintDoubleValue( aMat( 2, 2 ), -6 ) ); + myGrp->LineEdit23->setText( DlgRef::PrintDoubleValue( aMat( 2, 3 ), -6 ) ); - myGrp->LineEdit31->setText( QString( "%1" ).arg( aMat( 3, 1 ), 12, 'e', 4 ) ); - myGrp->LineEdit32->setText( QString( "%1" ).arg( aMat( 3, 2 ), 12, 'e', 4 ) ); - myGrp->LineEdit33->setText( QString( "%1" ).arg( aMat( 3, 3 ), 12, 'e', 4 ) ); + myGrp->LineEdit31->setText( DlgRef::PrintDoubleValue( aMat( 3, 1 ), -6 ) ); + myGrp->LineEdit32->setText( DlgRef::PrintDoubleValue( aMat( 3, 2 ), -6 ) ); + myGrp->LineEdit33->setText( DlgRef::PrintDoubleValue( aMat( 3, 3 ), -6 ) ); - myGrp->LineEdit41->setText( QString( "%1" ).arg( anIXYZ.X(), 12, 'e', 4 ) ); - myGrp->LineEdit42->setText( QString( "%1" ).arg( anIXYZ.Y(), 12, 'e', 4 ) ); - myGrp->LineEdit43->setText( QString( "%1" ).arg( anIXYZ.Z(), 12, 'e', 4 ) ); + myGrp->LineEdit41->setText( DlgRef::PrintDoubleValue( anIXYZ.X(), -6 ) ); + myGrp->LineEdit42->setText( DlgRef::PrintDoubleValue( anIXYZ.Y(), -6 ) ); + myGrp->LineEdit43->setText( DlgRef::PrintDoubleValue( anIXYZ.Z(), -6 ) ); } } diff --git a/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx index b9a04fd2a..f3a6d0d46 100644 --- a/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx @@ -26,6 +26,7 @@ // #include "MeasureGUI_MaxToleranceDlg.h" #include "MeasureGUI_Widgets.h" +#include "DlgRef.h" #include #include @@ -131,14 +132,17 @@ void MeasureGUI_MaxToleranceDlg::processObject() double invalidMin = RealLast(); double invalidMax = -RealLast(); - myGrp->LineEdit11->setText( aMinFaceToler != invalidMin ? QString( "%1" ).arg( aMinFaceToler, 5, 'e', 8 ) : QString("") ); - myGrp->LineEdit12->setText( aMaxFaceToler != invalidMax ? QString( "%1" ).arg( aMaxFaceToler, 5, 'e', 8 ) : QString("") ); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aPrecision = resMgr->integerValue( "Geometry", "len_tol_precision", -9); - myGrp->LineEdit21->setText( aMinEdgeToler != invalidMin ? QString( "%1" ).arg( aMinEdgeToler, 5, 'e', 8 ) : QString("") ); - myGrp->LineEdit22->setText( aMaxEdgeToler != invalidMax ? QString( "%1" ).arg( aMaxEdgeToler, 5, 'e', 8 ) : QString("") ); + myGrp->LineEdit11->setText( aMinFaceToler != invalidMin ? DlgRef::PrintDoubleValue( aMinFaceToler, aPrecision ) : QString("") ); + myGrp->LineEdit12->setText( aMaxFaceToler != invalidMax ? DlgRef::PrintDoubleValue( aMaxFaceToler, aPrecision ) : QString("") ); - myGrp->LineEdit31->setText( aMinVertexToler != invalidMin ? QString( "%1" ).arg( aMinVertexToler, 5, 'e', 8 ) : QString("") ); - myGrp->LineEdit32->setText( aMaxVertexToler != invalidMax ? QString( "%1" ).arg( aMaxVertexToler, 5, 'e', 8 ) : QString("") ); + myGrp->LineEdit21->setText( aMinEdgeToler != invalidMin ? DlgRef::PrintDoubleValue( aMinEdgeToler, aPrecision ) : QString("") ); + myGrp->LineEdit22->setText( aMaxEdgeToler != invalidMax ? DlgRef::PrintDoubleValue( aMaxEdgeToler, aPrecision ) : QString("") ); + + myGrp->LineEdit31->setText( aMinVertexToler != invalidMin ? DlgRef::PrintDoubleValue( aMinVertexToler, aPrecision ) : QString("") ); + myGrp->LineEdit32->setText( aMaxVertexToler != invalidMax ? DlgRef::PrintDoubleValue( aMaxVertexToler, aPrecision ) : QString("") ); } //================================================================================= diff --git a/src/MeasureGUI/MeasureGUI_PointDlg.cxx b/src/MeasureGUI/MeasureGUI_PointDlg.cxx index c7ea535f0..c7064a96b 100644 --- a/src/MeasureGUI/MeasureGUI_PointDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_PointDlg.cxx @@ -172,9 +172,11 @@ void MeasureGUI_PointDlg::SelectionIntoArgument() if ( !aPoint.IsNull() ) { gp_Pnt aPnt = BRep_Tool::Pnt( aPoint ); myGrp->LineEdit1->setText( aName ); - myGrp->LineEdit2->setText( DlgRef::PrintDoubleValue( aPnt.X() ) ); - myGrp->LineEdit3->setText( DlgRef::PrintDoubleValue( aPnt.Y() ) ); - myGrp->LineEdit4->setText( DlgRef::PrintDoubleValue( aPnt.Z() ) ); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); + myGrp->LineEdit2->setText( DlgRef::PrintDoubleValue( aPnt.X(), aPrecision ) ); + myGrp->LineEdit3->setText( DlgRef::PrintDoubleValue( aPnt.Y(), aPrecision ) ); + myGrp->LineEdit4->setText( DlgRef::PrintDoubleValue( aPnt.Z(), aPrecision ) ); } } catch( ... ) diff --git a/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx b/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx index 861658e28..9621487ed 100644 --- a/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx @@ -139,9 +139,11 @@ void MeasureGUI_PropertiesDlg::processObject() myGrp->LineEdit4->setText( "" ); } else { - myGrp->LineEdit2->setText( DlgRef::PrintDoubleValue( aLength ) ); - myGrp->LineEdit3->setText( DlgRef::PrintDoubleValue( anArea ) ); - myGrp->LineEdit4->setText( DlgRef::PrintDoubleValue( aVolume ) ); + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); + myGrp->LineEdit2->setText( DlgRef::PrintDoubleValue( aLength, aPrecision ) ); + myGrp->LineEdit3->setText( DlgRef::PrintDoubleValue( anArea, aPrecision ) ); + myGrp->LineEdit4->setText( DlgRef::PrintDoubleValue( aVolume, aPrecision ) ); } } diff --git a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx index 04f91fb9e..b0d9695d6 100644 --- a/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_WhatisDlg.cxx @@ -232,6 +232,9 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) QString aKindStr(""); theParameters = ""; + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + int aLenPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 ); + if ( myObj->_is_nil() ) return aKindStr; @@ -253,7 +256,7 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) if ( !anOper->IsDone() ) return aKindStr; -#define PRINT_DOUBLE(val) QString(" %1").arg( DlgRef::PrintDoubleValue( val ) ) +#define PRINT_DOUBLE(val, tol) DlgRef::PrintDoubleValue( val, tol ) switch ( aKind ) { case GEOM::GEOM_IKindOfShape::COMPOUND: @@ -284,84 +287,84 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) case GEOM::GEOM_IKindOfShape::SPHERE: aKindStr = tr( "GEOM_SPHERE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[3] ); + "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::CYLINDER: aKindStr = tr( "GEOM_CYLINDER" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_AXIS" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[7] ); + "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::BOX: aKindStr = tr( "GEOM_BOX" ); theParameters = tr( "GEOM_CENTER") + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + "Ax :" + PRINT_DOUBLE( aDbls[3] ) + - "\n" + "Ay :" + PRINT_DOUBLE( aDbls[4] ) + - "\n" + "Az :" + PRINT_DOUBLE( aDbls[5] ); + "\n" + "Ax :" + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + "Ay :" + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + "Az :" + PRINT_DOUBLE( aDbls[5], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::ROTATED_BOX: aKindStr = tr( "GEOM_BOX" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\nZ Axis:" + - "\n" + "Zx :" + PRINT_DOUBLE( aDbls[3] ) + - "\n" + "Zy :" + PRINT_DOUBLE( aDbls[4] ) + - "\n" + "Zz :" + PRINT_DOUBLE( aDbls[5] ) + + "\n" + "Zx :" + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + "Zy :" + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + "Zz :" + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\nX Axis:" + - "\n" + tr( "GEOM_X_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_X_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[7] ) + - "\n" + tr( "GEOM_X_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[8] ) + + "\n" + tr( "GEOM_X_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_X_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) + + "\n" + tr( "GEOM_X_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) + "\nDimensions along local axes:" + - "\n" + "Ax :" + PRINT_DOUBLE( aDbls[9] ) + - "\n" + "Ay :" + PRINT_DOUBLE( aDbls[10] ) + - "\n" + "Az :" + PRINT_DOUBLE( aDbls[11] ); + "\n" + "Ax :" + PRINT_DOUBLE( aDbls[9], aLenPrecision ) + + "\n" + "Ay :" + PRINT_DOUBLE( aDbls[10], aLenPrecision ) + + "\n" + "Az :" + PRINT_DOUBLE( aDbls[11], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::TORUS: aKindStr = tr( "GEOM_TORUS" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_AXIS" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7] ); + "\n" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::CONE: aKindStr = tr( "GEOM_CONE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_AXIS" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7] ) + - "\n" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[8] ); + "\n" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) + + "\n" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::POLYHEDRON: aKindStr = tr( "GEOM_POLYHEDRON" ); @@ -373,114 +376,114 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) case GEOM::GEOM_IKindOfShape::SPHERE2D: aKindStr = tr( "GEOM_SURFSPHERE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[3] ); + "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::CYLINDER2D: aKindStr = tr( "GEOM_SURFCYLINDER" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_AXIS" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[7] ); + "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::TORUS2D: aKindStr = tr( "GEOM_SURFTORUS" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_AXIS" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7] ); + "\n" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::CONE2D: aKindStr = tr( "GEOM_SURFCONE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_AXIS" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7] ) + - "\n" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[8] ); + "\n" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) + + "\n" + tr( "GEOM_HEIGHT" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::DISK_CIRCLE: aKindStr = tr( "GEOM_DISK_CIRCLE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6] ); + "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::DISK_ELLIPSE: aKindStr = tr( "GEOM_DISK_ELLIPSE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7] ); + "\n" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::POLYGON: aKindStr = tr( "GEOM_POLYGON" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ); + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::PLANE: aKindStr = tr( "GEOM_PLANE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ); + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::PLANAR: aKindStr = tr( "GEOM_PLANAR_FACE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ); + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::FACE: aKindStr = tr( "GEOM_FACE" ); @@ -489,94 +492,94 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) case GEOM::GEOM_IKindOfShape::CIRCLE: aKindStr = tr( "GEOM_CIRCLE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6] ); + "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::ARC_CIRCLE: aKindStr = tr( "GEOM_ARC" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6] ) + + "\n" + tr( "GEOM_RADIUS" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + "\n" + tr( "GEOM_POINT_I" ).arg( 1 ) + - "\n" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[7] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[8] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[9] ) + + "\n" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[9], aLenPrecision ) + "\n" + tr( "GEOM_POINT_I" ).arg( 2 ) + - "\n" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[10] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[11] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[12] ); + "\n" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[10], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[11], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[12], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::ELLIPSE: aKindStr = tr( "GEOM_ELLIPSE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7] ); + "\n" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::ARC_ELLIPSE: aKindStr = tr( "GEOM_ARC_ELLIPSE" ); theParameters = tr( "GEOM_CENTER" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_NORMAL" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ) + + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) + "\n" + tr( "GEOM_DIMENSIONS" ) + - "\n" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6] ) + - "\n" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7] ) + + "\n" + tr( "GEOM_RADIUS_MAJOR" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) + + "\n" + tr( "GEOM_RADIUS_MINOR" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) + "\n" + tr( "GEOM_POINT_I" ).arg( 1 ) + - "\n" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[8] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[9] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[10] ) + + "\n" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[9], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[10], aLenPrecision ) + "\n" + tr( "GEOM_POINT_I" ).arg( 2 ) + - "\n" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[11] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[12] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[13] ); + "\n" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[11], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[12], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[13], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::LINE: aKindStr = tr( "GEOM_LINE" ); theParameters = tr( "GEOM_POSITION" ) + - "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_DIRECTION" ) + - "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5] ); + "\n" + tr( "GEOM_DX" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_DY" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_DZ" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::SEGMENT: aKindStr = tr( "GEOM_SEGMENT" ); theParameters = tr( "GEOM_POINT_I" ).arg( 1 ) + - "\n" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[2] ) + + "\n" + tr( "GEOM_X_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) + "\n" + tr( "GEOM_POINT_I" ).arg( 2 ) + - "\n" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[3] ) + - "\n" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[4] ) + - "\n" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[5] ); + "\n" + tr( "GEOM_X_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) + + "\n" + tr( "GEOM_Y_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) + + "\n" + tr( "GEOM_Z_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::EDGE: aKindStr = tr( "GEOM_EDGE" ); @@ -584,9 +587,9 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters ) case GEOM::GEOM_IKindOfShape::VERTEX: aKindStr = tr( "GEOM_VERTEX" ); theParameters = tr( "GEOM_COORDINATES" ) + - "\n" + tr( "GEOM_X" ) + PRINT_DOUBLE( aDbls[0] ) + - "\n" + tr( "GEOM_Y" ) + PRINT_DOUBLE( aDbls[1] ) + - "\n" + tr( "GEOM_Z" ) + PRINT_DOUBLE( aDbls[2] ); + "\n" + tr( "GEOM_X" ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) + + "\n" + tr( "GEOM_Y" ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) + + "\n" + tr( "GEOM_Z" ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ); break; case GEOM::GEOM_IKindOfShape::ADVANCED: { diff --git a/src/NMTDS/NMTDS_Iterator.cxx b/src/NMTDS/NMTDS_Iterator.cxx index b205c9fc4..ce2eeff79 100755 --- a/src/NMTDS/NMTDS_Iterator.cxx +++ b/src/NMTDS/NMTDS_Iterator.cxx @@ -195,14 +195,11 @@ { Standard_Boolean bFlag; Standard_Integer aNb, i, aNbB, aNbR, iFlag; - Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV; + Standard_Integer i1, i2, aNbSD, iX, j, iDS, jB, iR, k, aNbLV, aNbLV1; TColStd_ListIteratorOfListOfInteger aIt; TColStd_DataMapOfIntegerInteger aMII; - //modified by NIZNHY-PKV Mon Jan 22 15:08:00 2007f - //TColStd_MapOfInteger aMFence; TColStd_DataMapOfIntegerListOfInteger aMVSD; TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aItVSD; - //modified by NIZNHY-PKV Mon Jan 22 10:21:50 2007t TopTools_DataMapOfShapeInteger aMSI; TopAbs_ShapeEnum aTi, aTj; NMTDS_PassKeyBoolean aPKXB; @@ -319,7 +316,14 @@ aMPKXB.Remove(aPKXB); } } - aMVSD.Bind(i, aLV1); + // + //modified by NIZNHY-PKV Mon Sep 27 08:31:04 2010f + aNbLV1=aLV1.Extent(); + if (aNbLV1) { + aMVSD.Bind(i, aLV1); + } + //aMVSD.Bind(i, aLV1); + //modified by NIZNHY-PKV Mon Sep 27 08:31:21 2010t } }//for (i=i1; i<=i2; ++i) { }//for (iR=1; iRSplitShapesPool(); const BOPTools_ListOfPaveBlock& aSplitEdges=aSplitShapesPool(myDS->RefEdge(nED)); - Standard_Integer nV1, nV2, aNewShapeIndex; - Standard_Real t1, t2; + Standard_Integer nV1, nV2, aNbPB, aNewShapeIndex; + Standard_Real t1, t2; TopoDS_Edge aE, aESplit; TopoDS_Vertex aV1, aV2; - + BOPTools_ListIteratorOfListOfPaveBlock aPBIt; + // const TopoDS_Edge aDE=TopoDS::Edge(myDS->Shape(nED)); const TopoDS_Face aDF=TopoDS::Face(myDS->Shape(nFD)); - - BOPTools_ListIteratorOfListOfPaveBlock aPBIt(aSplitEdges); - + // + //modified by NIZNHY-PKV Wed Oct 20 13:20:37 2010f + aNbPB=aSplitEdges.Extent(); + if (aNbPB==1) { + Standard_Real aT1, aT2, dT1, dT2, aDT; + Handle(Geom2d_Curve) aC2D; + // + BOPTools_PaveBlock& aPB=aSplitEdges.First(); + // + const BOPTools_Pave& aPave1=aPB.Pave1(); + t1=aPave1.Param(); + const BOPTools_Pave& aPave2=aPB.Pave2(); + t2=aPave2.Param(); + //// + nV1=aPave1.Index(); + aV1=*((TopoDS_Vertex*)&myDS->GetShape(nV1)); + // + aV2=TopExp::FirstVertex(aDE); + if (aV2.IsSame(aV1)) { + aC2D=BRep_Tool::CurveOnSurface(aDE, aDF, aT1, aT2); + dT1=aT1-t1; + if (dT1<0.) { + dT1=-dT1; + } + // + dT2=aT2-t2; + if (dT2<0.) { + dT2=-dT2; + } + aDT=Precision::PConfusion(); + if(dT1Clear(); + return; + } + } + } + //modified by NIZNHY-PKV Wed Oct 20 13:20:39 2010t + // + aPBIt.Initialize(aSplitEdges); for (; aPBIt.More(); aPBIt.Next()) { BOPTools_PaveBlock& aPB=aPBIt.Value(); diff --git a/src/NMTTools/NMTTools_MapIteratorOfMapOfPaveBlock_0.cxx b/src/NMTTools/NMTTools_MapIteratorOfMapOfPaveBlock_0.cxx index 0a32c9c5b..40c739829 100644 --- a/src/NMTTools/NMTTools_MapIteratorOfMapOfPaveBlock_0.cxx +++ b/src/NMTTools/NMTTools_MapIteratorOfMapOfPaveBlock_0.cxx @@ -1,24 +1,23 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// File generated by CPPExt (Value) // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// 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) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. // +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. #include diff --git a/src/NMTTools/NMTTools_MapOfPaveBlock.hxx b/src/NMTTools/NMTTools_MapOfPaveBlock.hxx index 7963a1f98..50007afee 100644 --- a/src/NMTTools/NMTTools_MapOfPaveBlock.hxx +++ b/src/NMTTools/NMTTools_MapOfPaveBlock.hxx @@ -1,24 +1,23 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// File generated by CPPExt (Value) // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// 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) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. // +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. #ifndef _NMTTools_MapOfPaveBlock_HeaderFile #define _NMTTools_MapOfPaveBlock_HeaderFile diff --git a/src/NMTTools/NMTTools_MapOfPaveBlock_0.cxx b/src/NMTTools/NMTTools_MapOfPaveBlock_0.cxx index 6f9d7d8a3..e1e5db0c8 100644 --- a/src/NMTTools/NMTTools_MapOfPaveBlock_0.cxx +++ b/src/NMTTools/NMTTools_MapOfPaveBlock_0.cxx @@ -1,24 +1,23 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// File generated by CPPExt (Value) // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// 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) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. // +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. #include diff --git a/src/NMTTools/NMTTools_PaveFiller.cdl b/src/NMTTools/NMTTools_PaveFiller.cdl index 1bc4c8e72..d21a19edf 100644 --- a/src/NMTTools/NMTTools_PaveFiller.cdl +++ b/src/NMTTools/NMTTools_PaveFiller.cdl @@ -1,4 +1,4 @@ --- Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +-- Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -- -- Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -- CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -19,7 +19,6 @@ -- -- See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -- - -- File: NMTTools_PaveFiller.cdl -- Created: Fri Dec 5 14:35:00 2003 -- Author: Peter KURNEV @@ -36,13 +35,10 @@ uses Vertex from TopoDS, Face from TopoDS, Shape from TopoDS, - -- Modified to add new definitions Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN Edge from TopoDS, ListOfShape from TopTools, DataMapOfShapeShape from TopTools, ListOfInteger from TColStd, - -- Contribution of Samtech www.samcef.com END Context from IntTools, ShrunkRange from IntTools, @@ -68,12 +64,9 @@ uses ShapesDataStructure from NMTDS, - -- Modified to add new definitions Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN PShapesDataStructure from NMTDS, Iterator from NMTDS, IndexedDataMapOfIndexedMapOfInteger from NMTTools, - -- Contribution of Samtech www.samcef.com END PIterator from NMTDS, PInterfPool from NMTDS @@ -104,12 +97,8 @@ is IP(me:out) returns PInterfPool from NMTDS; -- - -- Perform the algo - -- Modified to add new method Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN Init (me:out) is virtual protected; - -- Contribution of Samtech www.samcef.com END Clear (me:out) is virtual protected; @@ -369,14 +358,12 @@ is returns PaveBlock from BOPTools; ---C++: return const & - --modified by NIZNHY-PKV Fri Nov 30 10:30:54 2007 f RealPaveBlock(me:out; aPB:PaveBlock from BOPTools; aLB:out ListOfInteger from TColStd; aIsCommonBlock:out Integer from Standard) returns PaveBlock from BOPTools; ---C++: return const & - --modified by NIZNHY-PKV Fri Nov 30 10:30:58 2007 t RealSplitsFace (me:out; nF2 :Integer from Standard; @@ -457,8 +444,6 @@ is MakePCurves (me:out); - -- Modified to add new methods Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN PerformVF1(me:out) is protected; @@ -468,7 +453,6 @@ is AloneVertices(me) returns IndexedDataMapOfIndexedMapOfInteger from NMTTools; ---C++: return const & - -- Contribution of Samtech www.samcef.com END IsExistingPaveBlock (me:out; aPB : PaveBlock from BOPTools; @@ -489,19 +473,30 @@ is aTol: Real from Standard) returns Integer from Standard; - -- Modified to add new method Thu Sep 14 14:35:18 2006 - -- Contribution of Samtech www.samcef.com BEGIN SharedEdges(me:out; nF1 :Integer from Standard; nF2 :Integer from Standard; aLNE :out ListOfInteger from TColStd; aLSE :out ListOfShape from TopTools); - -- Contribution of Samtech www.samcef.com END FuseVertices(me; aC:Shape from TopoDS; aDMVV: out DataMapOfShapeShape from TopTools); - + -- + TreatPaveBlocks(me:out; + theLCB:out ListOfCommonBlock from NMTTools); + + ChangePavePoolNew(me:out) + returns PavePool from BOPTools; + ---C++:return & + + --modified by NIZNHY-PKV Thu Nov 11 08:12:50 2010f + CheckCoincidence (me:out; + aPB1 : PaveBlock from BOPTools; + aPB2 : PaveBlock from BOPTools) + returns Boolean from Standard; + --modified by NIZNHY-PKV Thu Nov 11 08:12:54 2010t + fields myDS : PShapesDataStructure from NMTDS is protected; myIsDone : Boolean from Standard is protected; diff --git a/src/NMTTools/NMTTools_PaveFiller.hxx b/src/NMTTools/NMTTools_PaveFiller.hxx index 13e147c87..ba8dbd419 100644 --- a/src/NMTTools/NMTTools_PaveFiller.hxx +++ b/src/NMTTools/NMTTools_PaveFiller.hxx @@ -1,35 +1,27 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// File generated by CPPExt (Value) // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// 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) 1991 - 2000 by +// Matra Datavision SA. All rights reserved. +// +// Copyright (C) 2001 - 2004 by +// Open CASCADE SA. All rights reserved. +// +// This file is part of the Open CASCADE Technology software. // +// This software may be distributed and/or modified under the terms and +// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +// and appearing in the file LICENSE included in the packaging of this file. +// +// This software is distributed on an "AS IS" basis, without warranty of any +// kind, and Open CASCADE SA hereby disclaims all such warranties, +// including without limitation, any warranties of merchantability, fitness +// for a particular purpose or non-infringement. Please see the License for +// the specific terms and conditions governing rights and limitations under the +// License. #ifndef _NMTTools_PaveFiller_HeaderFile #define _NMTTools_PaveFiller_HeaderFile -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - #ifndef _NMTDS_PShapesDataStructure_HeaderFile #include #endif @@ -102,134 +94,204 @@ class TopoDS_Edge; class TopTools_DataMapOfShapeShape; +#ifndef _Standard_HeaderFile +#include +#endif +#ifndef _Standard_Macro_HeaderFile +#include +#endif + class NMTTools_PaveFiller { + public: - void* operator new(size_t,void* anAddress) - { - return anAddress; - } - void* operator new(size_t size) - { - return Standard::Allocate(size); - } - void operator delete(void *anAddress) - { - if (anAddress) Standard::Free((Standard_Address&)anAddress); - } + void* operator new(size_t,void* anAddress) + { + return anAddress; + } + void* operator new(size_t size) + { + return Standard::Allocate(size); + } + void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&)anAddress); + } + // Methods PUBLIC + // - - Standard_EXPORT NMTTools_PaveFiller(); + +Standard_EXPORT NMTTools_PaveFiller(); Standard_EXPORT virtual ~NMTTools_PaveFiller(); - - Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; - - Standard_EXPORT const TopoDS_Shape& CompositeShape() const; - - Standard_EXPORT NMTDS_PShapesDataStructure DS() ; - - Standard_EXPORT NMTDS_PIterator DSIt() ; - - Standard_EXPORT NMTDS_PInterfPool IP() ; - - Standard_EXPORT virtual void Perform() ; - - Standard_EXPORT Standard_Boolean IsDone() const; - - Standard_EXPORT const IntTools_Context& Context() const; - - Standard_EXPORT IntTools_Context& ChangeContext() ; - - Standard_EXPORT const BOPTools_PavePool& PavePool() const; - - Standard_EXPORT BOPTools_PavePool& ChangePavePool() ; - - Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; - - Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const; - - Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ; - - Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const; - - Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ; - - Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const; - - Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; - - Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ; - - Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ; - - Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ; - - Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ; - - Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; - - Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ; - - Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ; - - Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; - - Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; - - Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ; - - Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ; - - Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ; - - Standard_EXPORT void MakePCurves() ; - - Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const; - - Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ; - - Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ; - - Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ; - - Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ; - - Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const; + + +Standard_EXPORT void SetCompositeShape(const TopoDS_Shape& aS) ; + + +Standard_EXPORT const TopoDS_Shape& CompositeShape() const; + + +Standard_EXPORT NMTDS_PShapesDataStructure DS() ; + + +Standard_EXPORT NMTDS_PIterator DSIt() ; + + +Standard_EXPORT NMTDS_PInterfPool IP() ; + + +Standard_EXPORT virtual void Perform() ; + + +Standard_EXPORT Standard_Boolean IsDone() const; + + +Standard_EXPORT const IntTools_Context& Context() const; + + +Standard_EXPORT IntTools_Context& ChangeContext() ; + + +Standard_EXPORT const BOPTools_PavePool& PavePool() const; + + +Standard_EXPORT BOPTools_PavePool& ChangePavePool() ; + + +Standard_EXPORT const NMTTools_CommonBlockPool& CommonBlockPool() const; + + +Standard_EXPORT NMTTools_CommonBlockPool& ChangeCommonBlockPool() ; + + +Standard_EXPORT const BOPTools_SplitShapesPool& SplitShapesPool() const; + + +Standard_EXPORT BOPTools_SplitShapesPool& ChangeSplitShapesPool() ; + + +Standard_EXPORT Standard_Integer FindSDVertex(const Standard_Integer nV) const; + + +Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Integer SplitsFace(const Standard_Integer nF2,TColStd_ListOfInteger& aLs) ; + + +Standard_EXPORT Standard_Integer CommonBlocksFace(const Standard_Integer nF,NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void PrepareFace(const Standard_Integer nF,TopoDS_Face& aF) ; + + +Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB) ; + + +Standard_EXPORT const BOPTools_PaveBlock& RealPaveBlock(const BOPTools_PaveBlock& aPB,TColStd_ListOfInteger& aLB,Standard_Integer& aIsCommonBlock) ; + + +Standard_EXPORT void RealSplitsFace(const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace(const Standard_Integer nF1,const Standard_Integer nF2) ; + + +Standard_EXPORT void RealSplitsInFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void RealSplitsOnFace(const Standard_Integer aBid,const Standard_Integer nF1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ; + + +Standard_EXPORT void PrepareSetForFace(const Standard_Integer nF1,const Standard_Integer nF2,const BOPTools_ListOfPaveBlock& aLPB,BOPTools_PaveSet& aPSF) ; + + +Standard_EXPORT void PutPaveOnCurve(const BOPTools_PaveSet& aPSF,const Standard_Real aTol,BOPTools_Curve& aBC) ; + + +Standard_EXPORT void PutBoundPaveOnCurve(BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; + + +Standard_EXPORT void PutBoundPaveOnCurve(const gp_Pnt& aP,const Standard_Real aT,BOPTools_Curve& aBC,BOPTools_SSInterference& aFF) ; + + +Standard_EXPORT Standard_Boolean FindPave(const gp_Pnt& aP,const Standard_Real aTpV,const BOPTools_PaveSet& aPS,BOPTools_Pave& aPV) ; + + +Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const BOPTools_PaveBlock& aPBR,const Standard_Real aTol) ; + + +Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB,const Standard_Real aTol) ; + + +Standard_EXPORT void MakePCurves() ; + + +Standard_EXPORT const NMTTools_IndexedDataMapOfIndexedMapOfInteger& AloneVertices() const; + + +Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const BOPTools_PaveBlock& aPB,const TopTools_ListOfShape& aLPB,const Standard_Real aTol) ; + + +Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB,const BOPTools_ListOfPaveBlock& aLPB) ; + + +Standard_EXPORT Standard_Integer CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,const TopoDS_Edge& aE,const Standard_Real aTol) ; + + +Standard_EXPORT void SharedEdges(const Standard_Integer nF1,const Standard_Integer nF2,TColStd_ListOfInteger& aLNE,TopTools_ListOfShape& aLSE) ; + + +Standard_EXPORT void FuseVertices(const TopoDS_Shape& aC,TopTools_DataMapOfShapeShape& aDMVV) const; + + +Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; + + +Standard_EXPORT BOPTools_PavePool& ChangePavePoolNew() ; + + +Standard_EXPORT Standard_Boolean CheckCoincidence(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) ; @@ -237,76 +299,111 @@ Standard_EXPORT virtual ~NMTTools_PaveFiller(); protected: - - Standard_EXPORT virtual void Init() ; - - Standard_EXPORT virtual void Clear() ; - - Standard_EXPORT virtual void PerformVV() ; - - Standard_EXPORT virtual void PerformVE() ; - - Standard_EXPORT virtual void PerformVF() ; - - Standard_EXPORT virtual void PerformEE() ; - - Standard_EXPORT virtual void PerformEF() ; - - Standard_EXPORT virtual void PerformFF() ; - - Standard_EXPORT void MakeSplitEdges() ; - - Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; - - Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ; - - Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ; - - Standard_EXPORT virtual void PrepareEdges() ; - - Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const; - - Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const; - - Standard_EXPORT void RefinePavePool() ; - - Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ; - - Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ; - - Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ; - - Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ; - - Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; - - Standard_EXPORT void UpdateCommonBlocks() ; - - Standard_EXPORT void UpdatePaveBlocks() ; - - Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; - - Standard_EXPORT void MakeBlocks() ; - - Standard_EXPORT void PerformVF1() ; - - Standard_EXPORT void MakeAloneVertices() ; - - Standard_EXPORT void TreatPaveBlocks(NMTTools_ListOfCommonBlock& theLCB) ; + // Methods PROTECTED + // +Standard_EXPORT virtual void Init() ; + + +Standard_EXPORT virtual void Clear() ; + + +Standard_EXPORT virtual void PerformVV() ; + + +Standard_EXPORT virtual void PerformVE() ; + + +Standard_EXPORT virtual void PerformVF() ; + + +Standard_EXPORT virtual void PerformEE() ; + + +Standard_EXPORT virtual void PerformEF() ; + + +Standard_EXPORT virtual void PerformFF() ; + + +Standard_EXPORT void MakeSplitEdges() ; + + +Standard_EXPORT virtual void PreparePaveBlocks(const TopAbs_ShapeEnum aType1,const TopAbs_ShapeEnum aType2) ; + + +Standard_EXPORT void CorrectShrunkRanges(const Standard_Integer aSide,const BOPTools_Pave& aPave,IntTools_ShrunkRange& aSR) ; + + +Standard_EXPORT virtual void PreparePaveBlocks(const Standard_Integer anE) ; + + +Standard_EXPORT virtual void PrepareEdges() ; + + +Standard_EXPORT Standard_Boolean IsSuccessorsComputed(const Standard_Integer iF1,const Standard_Integer iF2) const; + + +Standard_EXPORT Standard_Boolean IsBlocksCoinside(const BOPTools_PaveBlock& aPB1,const BOPTools_PaveBlock& aPB2) const; + + +Standard_EXPORT void RefinePavePool() ; + + +Standard_EXPORT Standard_Integer CheckFacePaves(const TopoDS_Vertex& aV,const Standard_Integer nF) ; + + +Standard_EXPORT void ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void SplitCommonBlock(const NMTTools_CommonBlock& aCB,NMTTools_ListOfCommonBlock& aLCB) ; + + +Standard_EXPORT void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aM) ; + + +Standard_EXPORT void EFCommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfInteger& aMapCB) ; + + +Standard_EXPORT void EENewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + +Standard_EXPORT void EENewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + +Standard_EXPORT void EFNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + +Standard_EXPORT void EFNewVertices(const TopoDS_Vertex& aV,const BooleanOperations_IndexedDataMapOfShapeInteger& aM) ; + + +Standard_EXPORT void UpdateCommonBlocks() ; + + +Standard_EXPORT void UpdatePaveBlocks() ; + + +Standard_EXPORT Standard_Integer SplitIndex(const BOPTools_PaveBlock& aPB) const; + + +Standard_EXPORT void MakeBlocks() ; + + +Standard_EXPORT void PerformVF1() ; + + +Standard_EXPORT void MakeAloneVertices() ; + + + // Fields PROTECTED + // NMTDS_PShapesDataStructure myDS; Standard_Boolean myIsDone; Standard_Integer myNbSources; @@ -324,10 +421,14 @@ TopoDS_Shape myCompositeShape; NMTDS_PInterfPool myIP; -private: - +private: + + // Methods PRIVATE + // + // Fields PRIVATE + // }; @@ -337,6 +438,7 @@ private: // other Inline functions and methods (like "C++: function call" methods) +// #endif diff --git a/src/NMTTools/NMTTools_PaveFiller_4.cxx b/src/NMTTools/NMTTools_PaveFiller_4.cxx index e23ee2202..22288863a 100644 --- a/src/NMTTools/NMTTools_PaveFiller_4.cxx +++ b/src/NMTTools/NMTTools_PaveFiller_4.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -19,14 +19,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: NMTTools_PaveFiller_4.cxx +// Created: Mon Dec 8 17:08:58 2003 +// Author: Peter KURNEV -// File: NMTTools_PaveFiller_4.cxx -// Created: Mon Dec 8 17:08:58 2003 -// Author: Peter KURNEV -// -// #include -// + #include #include @@ -34,6 +32,8 @@ #include #include +#include + #include #include #include @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -99,7 +100,6 @@ #include #include - #include #include #include @@ -108,25 +108,25 @@ #include #include - static void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI, TopTools_DataMapOfShapeListOfShape& myImages, TopTools_DataMapOfShapeShape& myOrigins); static - void MakeNewVertex(const TopTools_ListOfShape& aLV, + void MakeNewVertex(const TopTools_ListOfShape& aLV, TopoDS_Vertex& aNewVertex); - -static +static void VertexParameters(const IntTools_CommonPrt& aCPart, - Standard_Real& aT1, + Standard_Real& aT1, Standard_Real& aT2); + static Standard_Boolean IsOnPave(const Standard_Real& aT1, const IntTools_Range& aRange, const Standard_Real& aTolerance); + static void EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB); @@ -135,15 +135,16 @@ static const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB, BOPTools_IMapOfPaveBlock& aProcessedBlocks, BOPTools_IMapOfPaveBlock& aChain); + static void FindChains(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB, NMTTools_ListOfCommonBlock& aLCB); //======================================================================= // function: PerformEE -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::PerformEE() +void NMTTools_PaveFiller::PerformEE() { myIsDone=Standard_False; // @@ -153,7 +154,7 @@ static Standard_Integer aNbLPB1, aNbLPB2; Standard_Real aTolE1, aTolE2, aDeflection=0.01; BOPTools_ListIteratorOfListOfPaveBlock anIt1, anIt2; - TopoDS_Edge aEWhat, aEWith; + TopoDS_Edge aEWhat, aEWith; TopoDS_Vertex aNewVertex; BooleanOperations_IndexedDataMapOfShapeInteger aMapVI; BOPTools_IDMapOfPaveBlockIMapOfPaveBlock aMapCB; @@ -172,22 +173,15 @@ static for (; myDSIt->More(); myDSIt->Next()) { myDSIt->Current(n1, n2, bJustAdd); anIndexIn = 0; - // - //if (myIntrPool->IsComputed(n1, n2)) { - // continue; - //} - // - nE1=n1; - nE2=n2; + nE1=n1; + nE2=n2; // if(bJustAdd) { - //myIntrPool->AddInterference (nE1, nE2, BooleanOperations_EdgeEdge, anIndexIn); continue; } // const TopoDS_Edge aE1=TopoDS::Edge(myDS->Shape(nE1));//mpv const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2));//mpv - // if (BRep_Tool::Degenerated(aE1) || BRep_Tool::Degenerated(aE2)){ continue; @@ -199,12 +193,12 @@ static BOPTools_ListOfPaveBlock& aLPB1=mySplitShapesPool(myDS->RefEdge(nE1)); BOPTools_ListOfPaveBlock& aLPB2=mySplitShapesPool(myDS->RefEdge(nE2)); // - // Modified Thu Sep 14 14:35:18 2006 + // Modified Thu Sep 14 14:35:18 2006 // Contribution of Samtech www.samcef.com BEGIN aNbLPB1=aLPB1.Extent(); aNbLPB2=aLPB2.Extent(); - - //if (aE1.IsSame(aE2) && aNbLPB1==1 && aNbLPB2==1) { + // + //if (aE1.IsSame(aE2) && aNbLPB1==1 && aNbLPB2==1) { // continue; //} // Contribution of Samtech www.samcef.com END @@ -219,14 +213,14 @@ static for (anIt2.Initialize(aLPB2); anIt2.More(); anIt2.Next()) { BOPTools_PaveBlock& aPB2=anIt2.Value(); const IntTools_ShrunkRange& aShrunkRange2=aPB2.ShrunkRange(); - + // const IntTools_Range& aSR2=aShrunkRange2.ShrunkRange(); const Bnd_Box& aBB2=aShrunkRange2.BndBox(); // if (aBB1.IsOut (aBB2)) { continue; } - // + // // EE IntTools_EdgeEdge aEE; aEE.SetEdge1 (aE1); @@ -244,7 +238,7 @@ static // aEE.SetRange1(anewSR1); aEE.SetRange2(anewSR2); - + // aEE.Perform(); // anIndexIn=0; @@ -279,11 +273,12 @@ static IntTools_Range aR1, aR2; // VertexParameters(aCPart, aT1, aT2); - // + // //decide to keep the pave or not aR1 = (aEE.Order()) ? anewSR2 : anewSR1; aR2 = (aEE.Order()) ? anewSR1 : anewSR2; // + aTol=0.8*aTol; bIsOnPave1=IsOnPave(aT1, aR1, aTol); bIsOnPave2=IsOnPave(aT2, aR2, aTol); // @@ -353,7 +348,7 @@ static aMapVI.Add(aNewVertex, anIndexIn); } break; - + case TopAbs_EDGE: { Standard_Integer aNbComPrt2; Standard_Boolean aCoinsideFlag; @@ -362,32 +357,31 @@ static aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2); // if (aNbComPrt2>1 || !aCoinsideFlag) { - //myIntrPool->AddInterference (aWhat, aWith, BooleanOperations_EdgeEdge, anIndexIn); break; } // // Fill aMapCB if (aMapCB.Contains(aPB1)) { BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB1); - aMapPB.Add(aPB1); - aMapPB.Add(aPB2); + aMapPB.Add(aPB1); + aMapPB.Add(aPB2); } else { BOPTools_IMapOfPaveBlock aMapPB; - aMapPB.Add(aPB1); - aMapPB.Add(aPB2); + aMapPB.Add(aPB1); + aMapPB.Add(aPB2); aMapCB.Add(aPB1, aMapPB); } // if (aMapCB.Contains(aPB2)) { BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB2); - aMapPB.Add(aPB1); - aMapPB.Add(aPB2); + aMapPB.Add(aPB1); + aMapPB.Add(aPB2); } else { BOPTools_IMapOfPaveBlock aMapPB; - aMapPB.Add(aPB1); - aMapPB.Add(aPB2); + aMapPB.Add(aPB1); + aMapPB.Add(aPB2); aMapCB.Add(aPB2, aMapPB); } // qqf @@ -399,18 +393,13 @@ static break; default: break; - } // switch (aType) - } // for (i=1; i<=aNbCPrts; i++) + } // switch (aType) + } // for (i=1; i<=aNbCPrts; i++) }// if (aEE.IsDone()) - } // for (; anIt2.More(); anIt2.Next()) - } // for (; anIt1.More(); anIt1.Next()) - }// for (; myDSIt.More(); myDSIt.Next()) + } // for (; anIt2.More(); anIt2.Next()) + } // for (; anIt1.More(); anIt1.Next()) + }// for (; myDSIt.More(); myDSIt.Next()) // - //modified by NIZNHY-PKV Thu Mar 19 14:13:34 2009f - // - //EENewVertices (aMapVI); - //EECommonBlocks(aMapCB); - { NMTTools_ListOfCommonBlock aLCB; // @@ -420,18 +409,17 @@ static TreatPaveBlocks(aLCB); ReplaceCommonBlocks(aLCB); } - //modified by NIZNHY-PKV Thu Mar 19 14:13:42 2009t // PerformVF1(); // myIsDone=Standard_True; } -//modified by NIZNHY-PKV Thu Mar 19 14:13:52 2009f + //======================================================================= // function:TreatPaveBlocks -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::TreatPaveBlocks (NMTTools_ListOfCommonBlock& theLCB) +void NMTTools_PaveFiller::TreatPaveBlocks (NMTTools_ListOfCommonBlock& theLCB) { Standard_Boolean bFound; Standard_Integer nE, nV, nVp, iFlag; @@ -506,27 +494,28 @@ static }//for (; anItLPB.More(); anItLPB.Next()) { } } -//modified by NIZNHY-PKV Thu Mar 19 14:14:13 2009t + //======================================================================= // function:EECommonBlocks -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB) +void NMTTools_PaveFiller::EECommonBlocks(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB) { NMTTools_ListOfCommonBlock aLCB; // FindChains(aMapCB, aLCB); ReplaceCommonBlocks(aLCB); } + //======================================================================= // function:EENewVertices -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) +void NMTTools_PaveFiller::EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) { Standard_Integer aNb, aNbVSD, nVnew, nIEE, nE[2], j, iFlag; Standard_Real aT; - TopoDS_Edge aE; + TopoDS_Edge aE; TopTools_DataMapOfShapeListOfShape myImages; TopTools_DataMapOfShapeShape myOrigins; TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm; @@ -538,11 +527,11 @@ static BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences(); // aNb=aMapVI.Extent(); - if (!aNb) { // no new vertices, no new problems + if (!aNb) { // no new vertices, no new problems return; } // - // 0. + // 0. if (aNb==1) { TopoDS_Vertex aV1=TopoDS::Vertex(aMapVI.FindKey(1)); EENewVertices(aV1, aMapVI); @@ -600,11 +589,11 @@ static // completely rewritten //======================================================================= //function : TreatNewVertices -//purpose : +//purpose : //======================================================================= void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI, - TopTools_DataMapOfShapeListOfShape& myImages, - TopTools_DataMapOfShapeShape& myOrigins) + TopTools_DataMapOfShapeListOfShape& myImages, + TopTools_DataMapOfShapeShape& myOrigins) { Standard_Integer j, i, aNbV, aNbVSD; Standard_Real aTol; @@ -636,13 +625,13 @@ void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMap Bnd_Box aBox; // aTol=BRep_Tool::Tolerance(TopoDS::Vertex(aV)); - aBox.SetGap(aTol); + aBox.SetGap(aTol); BRepBndLib::Add(aV, aBox); // aTreeFiller.Add(i, aBox); // aMIS.Add(i, aV); - aMSB.Add(aV, aBox); + aMSB.Add(aV, aBox); } // aTreeFiller.Fill(); @@ -678,7 +667,7 @@ void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMap // aNbVSD=aBBTree.Select(aSelector); if (!aNbVSD) { - continue; // it must not be + continue; // it must not be } // const TColStd_ListOfInteger& aLI=aSelector.Indices(); @@ -775,12 +764,12 @@ void TreatNewVertices(const BooleanOperations_IndexedDataMapOfShapeInteger& aMap } } } -// + //======================================================================= //function : MakeNewVertex -//purpose : +//purpose : //======================================================================= -void MakeNewVertex(const TopTools_ListOfShape& aLV, +void MakeNewVertex(const TopTools_ListOfShape& aLV, TopoDS_Vertex& aNewVertex) { Standard_Integer aNbV; @@ -822,16 +811,17 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, // aBB.MakeVertex (aNewVertex, aPGC, aDmax); } + //======================================================================= // function:EENewVertices -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex, - const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) +void NMTTools_PaveFiller::EENewVertices (const TopoDS_Vertex& aNewVertex, + const BooleanOperations_IndexedDataMapOfShapeInteger& aMapVI) { Standard_Integer i, aNewShape, nE1, nE2; Standard_Real aT1, aT2; - BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq; + BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq; BOPTools_Pave aPave; // BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences(); @@ -864,11 +854,12 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, BOPTools_PaveSet& aPaveSet2=myPavePoolNew(myDS->RefEdge(nE2)); aPaveSet2.Append(aPave); } + //======================================================================= // function: RefinePavePool -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::RefinePavePool() +void NMTTools_PaveFiller::RefinePavePool() { Standard_Integer i, aNbNew; @@ -897,19 +888,20 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, } } } + //======================================================================= // function: PreparePaveBlocks -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::PreparePaveBlocks(const TopAbs_ShapeEnum aType1, - const TopAbs_ShapeEnum aType2) +void NMTTools_PaveFiller::PreparePaveBlocks(const TopAbs_ShapeEnum aType1, + const TopAbs_ShapeEnum aType2) { myIsDone=Standard_False; // Standard_Boolean bOk1, bOk2, bOk3, bFlag; Standard_Integer i, aNb, nE[2], n1, n2, aNbSplits; TColStd_MapOfInteger aMap; - + // bOk1= (aType1==TopAbs_VERTEX) && (aType2==TopAbs_EDGE) ; bOk2= (aType1==TopAbs_EDGE) && (aType2==TopAbs_EDGE) ; bOk3= (aType1==TopAbs_EDGE) && (aType2==TopAbs_FACE) ; @@ -923,10 +915,10 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, for (; myDSIt->More(); myDSIt->Next()) { myDSIt->Current(n1, n2, bFlag); // - nE[0]=n1; - nE[1]=n2; + nE[0]=n1; + nE[1]=n2; if (myDS->GetShapeType(n1)!=TopAbs_EDGE) { - nE[0]=n2; + nE[0]=n2; nE[1]=n1; } // @@ -934,7 +926,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE[i])); aNbSplits=aLPB.Extent(); if (!aNbSplits) { - if (aMap.Add(nE[i])) { + if (aMap.Add(nE[i])) { PreparePaveBlocks(nE[i]); if (!myIsDone) { return; @@ -942,14 +934,15 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, } } } - }// for (; myDSIt.More(); myDSIt.Next()) + }// for (; myDSIt.More(); myDSIt.Next()) myIsDone=Standard_True; } + //======================================================================= // function: PreparePaveBlocks -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::PreparePaveBlocks(const Standard_Integer nE) +void NMTTools_PaveFiller::PreparePaveBlocks(const Standard_Integer nE) { myIsDone=Standard_False; // @@ -959,7 +952,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, TopoDS_Vertex aV1, aV2; // BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE)); - // Edge + // Edge aE=TopoDS::Edge(myDS->Shape(nE)); if (BRep_Tool::Degenerated(aE)) { myIsDone=Standard_True; @@ -967,7 +960,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, } // BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE)); - + // BOPTools_PaveBlockIterator aPBIt(nE, aPS); for (; aPBIt.More(); aPBIt.Next()) { BOPTools_PaveBlock& aPB=aPBIt.Value(); @@ -988,7 +981,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE); BOPTColStd_Dump::PrintMessage(buf); sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE); - throw + throw BOPTColStd_Failure(buf) ; } // @@ -1005,16 +998,17 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, // aPB.SetShrunkRange(aSR); aLPB.Append(aPB); - } //for (; aPBIt.More(); aPBIt.Next()) + } //for (; aPBIt.More(); aPBIt.Next()) myIsDone=Standard_True; } + //======================================================================= // function: CorrectShrunkRanges -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::CorrectShrunkRanges(const Standard_Integer aSide, - const BOPTools_Pave& aPave, - IntTools_ShrunkRange& aShrunkRange) +void NMTTools_PaveFiller::CorrectShrunkRanges(const Standard_Integer aSide, + const BOPTools_Pave& aPave, + IntTools_ShrunkRange& aShrunkRange) { BooleanOperations_KindOfInterference aType; Standard_Integer anIndexInterf ; @@ -1039,7 +1033,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, const IntTools_Range& aSR=aShrunkRange.ShrunkRange(); const TopoDS_Edge& aE=aShrunkRange.Edge(); - + IntTools_Range aNewRange; IntTools_Range aCPRange; @@ -1079,13 +1073,13 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, } } } + //======================================================================= // function: IsBlocksCoinside -// purpose: +// purpose: //======================================================================= - Standard_Boolean - NMTTools_PaveFiller::IsBlocksCoinside(const BOPTools_PaveBlock& aPB1, - const BOPTools_PaveBlock& aPB2) const +Standard_Boolean NMTTools_PaveFiller::IsBlocksCoinside(const BOPTools_PaveBlock& aPB1, + const BOPTools_PaveBlock& aPB2) const { Standard_Boolean bRetFlag=Standard_True; Standard_Real aTolV11, aTolV12, aTolV21, aTolV22; @@ -1101,7 +1095,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, aTolV12=BRep_Tool::Tolerance(aV12); aTolV21=BRep_Tool::Tolerance(aV21); aTolV22=BRep_Tool::Tolerance(aV22); - + aP11=BRep_Tool::Pnt(aV11); aP12=BRep_Tool::Pnt(aV12); aP21=BRep_Tool::Pnt(aV21); @@ -1128,20 +1122,22 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, } return !bRetFlag; } + //======================================================================= // function: ReplaceCommonBlocks -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) +void NMTTools_PaveFiller::ReplaceCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) { RemoveCommonBlocks(aLCB); SplitCommonBlocks(aLCB); } + //======================================================================= // function: SplitCommonBlocks -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) +void NMTTools_PaveFiller::SplitCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) { Standard_Integer nE; NMTTools_ListOfCommonBlock aLCBx; @@ -1171,10 +1167,10 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, } } } - // Modified to provide the order of edges - // in common block where the edge with max + // Modified to provide the order of edges + // in common block where the edge with max // tolerance value will be the first - // Thu Sep 14 14:35:18 2006 + // Thu Sep 14 14:35:18 2006 // Contribution of Samtech www.samcef.com BEGIN Standard_Integer i, iMax, aNb, aNbCB, nSp; Standard_Real aTolSp, aTolMax; @@ -1231,11 +1227,12 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, }//for (nE=1; nE<=aNb; ++nE) { // Contribution of Samtech www.samcef.com END } + //======================================================================= // function: RemoveCommonBlocks -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) +void NMTTools_PaveFiller::RemoveCommonBlocks(const NMTTools_ListOfCommonBlock& aLCB) { Standard_Integer nE; NMTTools_ListOfCommonBlock aLCBx; @@ -1247,7 +1244,7 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, const NMTTools_CommonBlock& aCB=anItCB.Value(); const BOPTools_ListOfPaveBlock& aLPB=aCB.PaveBlocks(); // - // Remove aCB from each edge + // Remove aCB from each edge anItLPB.Initialize(aLPB); for (; anItLPB.More(); anItLPB.Next()) { const BOPTools_PaveBlock& aPB=anItLPB.Value(); @@ -1265,24 +1262,25 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, } } } + //======================================================================= // function: SplitCommonBlock -// purpose: +// purpose: //======================================================================= - void NMTTools_PaveFiller::SplitCommonBlock(const NMTTools_CommonBlock& aCB, - NMTTools_ListOfCommonBlock& aLCBx) +void NMTTools_PaveFiller::SplitCommonBlock(const NMTTools_CommonBlock& aCB, + NMTTools_ListOfCommonBlock& aLCBx) { - Standard_Integer i, j, k, nE, aNbE, aNbSPBx, aNbPB; + Standard_Boolean bIsCoincided; + Standard_Integer i, j,nE, aNbE, aNbSPBx, aNbPB, k; BOPTools_SequenceOfPaveBlock aSPBx; BOPTools_ListIteratorOfListOfPaveBlock anItLPB; BOPTools_ListIteratorOfListOfPave anIt; - - BOPTools_PaveBlockIterator anPBIt; + BOPTools_PaveBlockIterator anPBIt; // const BOPTools_ListOfPaveBlock& aLPB=aCB.PaveBlocks(); aNbE=aLPB.Extent(); // - // 1. Whether we realy need to split the common block ? + // 1. Checking: Whether we realy need to split the common block ? anItLPB.Initialize(aLPB); for (; anItLPB.More(); anItLPB.Next()) { const BOPTools_PaveBlock& aPB=anItLPB.Value(); @@ -1346,21 +1344,44 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, } } // - // 3. Do new common blocks + // 3. Do new common blocks // const TColStd_ListOfInteger& aLF=aCB.Faces(); aNbSPBx=aSPBx.Length(); aNbPB=aNbSPBx/aNbE; // + Standard_Integer k1, k2, n11, n12, n21, n22; + // for (i=1; i<=aNbPB; ++i) { NMTTools_CommonBlock aCBx; // aCBx.AddFaces(aLF); // - for (j=1; j<=aNbE; ++j) { - k=i+(j-1)*aNbPB; - const BOPTools_PaveBlock& aPB=aSPBx(k); - aCBx.AddPaveBlock(aPB); + const BOPTools_PaveBlock& aPB1=aSPBx(i); + n11=aPB1.Pave1().Index(); + n12=aPB1.Pave2().Index(); + // + aCBx.AddPaveBlock(aPB1); + // + for (j=2; j<=aNbE; ++j) { + k1=(j-1)*aNbPB+1; + k2=k1+aNbPB-1; + for(k=k1; k<=k2; ++k) { + const BOPTools_PaveBlock& aPB2=aSPBx(k); + n21=aPB2.Pave1().Index(); + n22=aPB2.Pave2().Index(); + if ((n21==n11 && n22==n12) || (n21==n12 && n22==n11)) { + //modified by NIZNHY-PKV Thu Nov 11 08:13:24 2010f + bIsCoincided=CheckCoincidence(aPB2, aPB1); + if (bIsCoincided) { + aCBx.AddPaveBlock(aPB2); + break; + } + //aCBx.AddPaveBlock(aPB2); + //break; + //modified by NIZNHY-PKV Thu Nov 11 08:13:31 2010t + } + } } aLCBx.Append(aCBx); } @@ -1368,10 +1389,10 @@ void MakeNewVertex(const TopTools_ListOfShape& aLV, //======================================================================= // function: VertexParameters -// purpose: +// purpose: //======================================================================= void VertexParameters(const IntTools_CommonPrt& aCPart, - Standard_Real& aT1, + Standard_Real& aT1, Standard_Real& aT2) { const IntTools_Range& aR1=aCPart.Range1(); @@ -1391,9 +1412,10 @@ void VertexParameters(const IntTools_CommonPrt& aCPart, aT2 = aCPart.VertexParameter2(); } } + //======================================================================= // function: KeepPave -// purpose: +// purpose: //======================================================================= Standard_Boolean IsOnPave(const Standard_Real& aT1, const IntTools_Range& aRange, @@ -1409,7 +1431,7 @@ Standard_Boolean IsOnPave(const Standard_Real& aT1, //======================================================================= // function:FindChains -// purpose: +// purpose: //======================================================================= void FindChains(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB, NMTTools_ListOfCommonBlock& aLCB) @@ -1445,9 +1467,10 @@ void FindChains(const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB, aChain.Clear(); } } + //======================================================================= // function:ProcessBlock -// purpose: +// purpose: //======================================================================= void ProcessBlock(const BOPTools_PaveBlock& aPB, const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock& aMapCB, @@ -1471,11 +1494,11 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB, } // Modified to provide VS interference between // vertex as result of EE and a Face of argument -// Thu Sep 14 14:35:18 2006 +// Thu Sep 14 14:35:18 2006 // Contribution of Samtech www.samcef.com BEGIN //======================================================================= -// function: PerformVF1 -// purpose: +// function: PerformVF1 +// purpose: //======================================================================= void NMTTools_PaveFiller::PerformVF1() { @@ -1511,7 +1534,7 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB, const TopoDS_Shape& aSnew=myDS->Shape(nNewShape); if (aSnew.ShapeType()!=TopAbs_VERTEX) { continue; - } + } // const TopoDS_Vertex& aVnew=TopoDS::Vertex(aSnew); // @@ -1540,5 +1563,50 @@ void ProcessBlock(const BOPTools_PaveBlock& aPB, } } } -} +} // Contribution of Samtech www.samcef.com END +//modified by NIZNHY-PKV Thu Nov 11 08:13:48 2010f +//======================================================================= +// function: CheckCoincidence +// purpose: +//======================================================================= +Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& aPB1, + const BOPTools_PaveBlock& aPB2) +{ + Standard_Boolean bRet; + Standard_Integer nE1, nE2, aNbPoints; + Standard_Real aT11, aT12, aT21, aT22, aT1m, aD, aTol, aT2x; + gp_Pnt aP1m; + // + bRet=Standard_False; + // + aT11=aPB1.Pave1().Param(); + aT12=aPB1.Pave2().Param(); + aT1m=IntTools_Tools::IntermediatePoint (aT11, aT12); + nE1=aPB1.OriginalEdge(); + const TopoDS_Edge& aE1=(*(TopoDS_Edge*)(&myDS->Shape(nE1))); + BOPTools_Tools::PointOnEdge(aE1, aT1m, aP1m); + // + aT21=aPB2.Pave1().Param(); + aT22=aPB2.Pave2().Param(); + nE2=aPB2.OriginalEdge(); + const TopoDS_Edge& aE2=(*(TopoDS_Edge*)(&myDS->Shape(nE2))); + // + GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE2); + aPPC.Perform(aP1m); + aNbPoints=aPPC.NbPoints(); + if (aNbPoints) { + aD=aPPC.LowerDistance(); + // + aTol=BRep_Tool::Tolerance(aE1); + aTol=aTol+BRep_Tool::Tolerance(aE2); + if (aDaT21 && aT2x @@ -52,10 +51,10 @@ Standard_EXPORT Handle_Standard_Type& NMTTools_StdMapNodeOfMapOfPaveBlock_Type_( static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,aType3,NULL}; static Handle_Standard_Type _aType = new Standard_Type("NMTTools_StdMapNodeOfMapOfPaveBlock", - sizeof(NMTTools_StdMapNodeOfMapOfPaveBlock), - 1, - (Standard_Address)_Ancestors, - (Standard_Address)NULL); + sizeof(NMTTools_StdMapNodeOfMapOfPaveBlock), + 1, + (Standard_Address)_Ancestors, + (Standard_Address)NULL); return _aType; } diff --git a/src/OBJECT/GEOM_Actor.cxx b/src/OBJECT/GEOM_Actor.cxx index b152bafd2..c80f2d121 100644 --- a/src/OBJECT/GEOM_Actor.cxx +++ b/src/OBJECT/GEOM_Actor.cxx @@ -39,6 +39,8 @@ #include "GEOM_ShadingFace.h" #include "SVTK_Actor.h" +#include + #include #include #include @@ -47,14 +49,8 @@ #include #include -#include -#include -#include #include #include -#include -#include -#include #include #include @@ -354,35 +350,6 @@ GEOM_Actor return myVectorMode; } -static -void -MeshShape(const TopoDS_Shape& theShape, - float& theDeflection, - bool theIsRelative) -{ - static Standard_Real RELATIVE_DEFLECTION = 0.0001; - Standard_Real aDeflection = theDeflection; - - if(theDeflection <= 0) { // Compute default theDeflection - Bnd_Box B; - BRepBndLib::Add(theShape, B); - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - Standard_Real aDiagonal = (aXmax-aXmin)*(aXmax-aXmin) + - (aYmax-aYmin)*(aYmax-aYmin) + - (aZmax-aZmin)*(aZmax-aZmin); - aDiagonal = sqrt(aDiagonal); - aDeflection = aDiagonal*RELATIVE_DEFLECTION; - - if(theIsRelative) - theDeflection = RELATIVE_DEFLECTION; - else - theDeflection = aDeflection; - } - - BRepMesh_IncrementalMesh aMesh(theShape,aDeflection); -} - void GEOM_Actor:: SetDeflection(float theDeflection, bool theIsRelative) @@ -390,7 +357,7 @@ SetDeflection(float theDeflection, bool theIsRelative) myDeflection = theDeflection; myIsRelative = theIsRelative; - MeshShape(myShape,myDeflection,myIsRelative); + GEOM::MeshShape2(myShape,myDeflection,myIsRelative); SetModified(); } @@ -421,7 +388,12 @@ void GEOM_Actor::SetShape (const TopoDS_Shape& theShape, TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap; TopExp::MapShapesAndAncestors(theShape,TopAbs_EDGE,TopAbs_FACE,anEdgeMap); - SetShape(theShape,anEdgeMap,theIsVector); + GEOM::SetShape(theShape,anEdgeMap,theIsVector, + myIsolatedEdgeSource.Get(), + myOneFaceEdgeSource.Get(), + mySharedEdgeSource.Get(), + myWireframeFaceSource.Get(), + myShadingFaceSource.Get()); isOnlyVertex = myIsolatedEdgeSource->IsEmpty() && myOneFaceEdgeSource->IsEmpty() && @@ -436,65 +408,6 @@ void GEOM_Actor::SetShape (const TopoDS_Shape& theShape, } } -void GEOM_Actor::SetShape (const TopoDS_Shape& theShape, - const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap, - bool theIsVector) -{ - if (theShape.ShapeType() == TopAbs_COMPOUND) { - TopoDS_Iterator anItr(theShape); - for (; anItr.More(); anItr.Next()) { - SetShape(anItr.Value(),theEdgeMap,theIsVector); - } - } - - switch (theShape.ShapeType()) { - case TopAbs_WIRE: { - TopExp_Explorer anEdgeExp(theShape,TopAbs_EDGE); - for (; anEdgeExp.More(); anEdgeExp.Next()){ - const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current()); - if (!BRep_Tool::Degenerated(anEdge)) - myIsolatedEdgeSource->AddEdge(anEdge,theIsVector); - } - break; - } - case TopAbs_EDGE: { - const TopoDS_Edge& anEdge = TopoDS::Edge(theShape); - if (!BRep_Tool::Degenerated(anEdge)) - myIsolatedEdgeSource->AddEdge(anEdge,theIsVector); - break; - } - case TopAbs_VERTEX: { - break; - } - default: { - TopExp_Explorer aFaceExp (theShape,TopAbs_FACE); - for(; aFaceExp.More(); aFaceExp.Next()) { - const TopoDS_Face& aFace = TopoDS::Face(aFaceExp.Current()); - myWireframeFaceSource->AddFace(aFace); - myShadingFaceSource->AddFace(aFace); - TopExp_Explorer anEdgeExp(aFaceExp.Current(), TopAbs_EDGE); - for(; anEdgeExp.More(); anEdgeExp.Next()) { - const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current()); - if(!BRep_Tool::Degenerated(anEdge)){ - // compute the number of faces - int aNbOfFaces = theEdgeMap.FindFromKey(anEdge).Extent(); - switch(aNbOfFaces){ - case 0: // isolated edge - myIsolatedEdgeSource->AddEdge(anEdge,theIsVector); - break; - case 1: // edge in only one face - myOneFaceEdgeSource->AddEdge(anEdge,theIsVector); - break; - default: // edge shared by at least two faces - mySharedEdgeSource->AddEdge(anEdge,theIsVector); - } - } - } - } - } - } -} - // OLD METHODS void GEOM_Actor::setDeflection(double adef) { #ifdef MYDEBUG diff --git a/src/OBJECT/GEOM_Actor.h b/src/OBJECT/GEOM_Actor.h index e8e086464..e31ea1990 100644 --- a/src/OBJECT/GEOM_Actor.h +++ b/src/OBJECT/GEOM_Actor.h @@ -51,7 +51,6 @@ typedef GEOM_SmartPtr PWFaceSource; class GEOM_ShadingFace; typedef GEOM_SmartPtr PSFaceSource; -#include class vtkRenderer; class vtkAppendPolyData; @@ -174,10 +173,6 @@ public: GetVectorMode(); protected: - void SetShape(const TopoDS_Shape& theShape, - const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap, - bool theIsVector = false); - void SetModified(); void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result); diff --git a/src/OBJECT/GEOM_AssemblyBuilder.cxx b/src/OBJECT/GEOM_AssemblyBuilder.cxx index 6c0f52833..ebad1a415 100644 --- a/src/OBJECT/GEOM_AssemblyBuilder.cxx +++ b/src/OBJECT/GEOM_AssemblyBuilder.cxx @@ -34,6 +34,8 @@ #include "GEOM_AssemblyBuilder.h" #include "GEOM_Actor.h" +#include + #include #include @@ -43,14 +45,9 @@ // Open CASCADE Includes #include -#include -#include -#include -#include #include #include #include -#include #include // Qt includes @@ -58,15 +55,6 @@ #include "utilities.h" -// SALOME - -#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) ) -#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) ) - - - - - void GEOM_AssemblyBuilder::InitProperties(vtkProperty* IsoProp, vtkProperty* FaceProp, vtkProperty* EdgeFProp, @@ -159,37 +147,6 @@ void GEOM_AssemblyBuilder::InitProperties(vtkProperty* IsoProp, } -void GEOM_AssemblyBuilder::MeshShape(const TopoDS_Shape myShape, - Standard_Real deflection, - Standard_Boolean forced) -{ - // Mesh the shape if necessary - Standard_Boolean alreadymesh = Standard_True; - TopExp_Explorer ex; - TopLoc_Location aLoc; - - for (ex.Init(myShape, TopAbs_FACE); 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; } - } - - if(!alreadymesh || forced) { - if(deflection<=0) { - // Compute default deflection - Bnd_Box B; - BRepBndLib::Add(myShape, B); - if ( B.IsVoid() ) return; // NPAL15983 (Bug when displaying empty groups) - Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; - B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - deflection = MAX3( aXmax-aXmin , aYmax-aYmin , aZmax-aZmin) * 0.001 *4; - } - BRepMesh_IncrementalMesh MESH(myShape,deflection); - } -} - - - vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShape, Standard_Real deflection, Standard_Integer mode, @@ -210,7 +167,7 @@ vtkActorCollection* GEOM_AssemblyBuilder::BuildActors(const TopoDS_Shape& myShap */ vtkActorCollection* AISActors = vtkActorCollection::New(); - MeshShape(myShape,deflection,forced); + GEOM::MeshShape(myShape,deflection,forced); GEOM_Actor* aGeomActor = GEOM_Actor::New(); aGeomActor->SetShape(myShape,(float)deflection,false,isVector); AISActors->AddItem(aGeomActor); diff --git a/src/OBJECT/GEOM_AssemblyBuilder.h b/src/OBJECT/GEOM_AssemblyBuilder.h index 73fadc31d..1f8bd88fb 100644 --- a/src/OBJECT/GEOM_AssemblyBuilder.h +++ b/src/OBJECT/GEOM_AssemblyBuilder.h @@ -50,11 +50,6 @@ class GEOM_OBJECT_EXPORT GEOM_AssemblyBuilder { vtkProperty* EdgePVProp, vtkProperty* VertePVProp); - static void MeshShape(const TopoDS_Shape myShape, - Standard_Real deflection, - Standard_Boolean forced); - - public: diff --git a/src/OBJECT/Makefile.am b/src/OBJECT/Makefile.am index 52fbad34b..454f6c0f8 100644 --- a/src/OBJECT/Makefile.am +++ b/src/OBJECT/Makefile.am @@ -43,12 +43,7 @@ salomeinclude_HEADERS = \ GEOM_OBJECT_defs.hxx \ GEOM_OCCReader.h \ GEOM_SmartPtr.h \ - GEOM_DeviceActor.h \ - GEOM_EdgeSource.h \ - GEOM_FaceSource.h \ - GEOM_ShadingFace.h \ - GEOM_VertexSource.h \ - GEOM_WireframeFace.h + GEOM_DeviceActor.h # Libraries targets lib_LTLIBRARIES = libGEOMObject.la @@ -62,12 +57,7 @@ dist_libGEOMObject_la_SOURCES = \ GEOM_AISTrihedron.cxx \ GEOM_VTKTrihedron.cxx \ GEOM_AISVector.cxx \ - GEOM_DeviceActor.cxx \ - GEOM_EdgeSource.cxx \ - GEOM_FaceSource.cxx \ - GEOM_ShadingFace.cxx \ - GEOM_VertexSource.cxx \ - GEOM_WireframeFace.cxx + GEOM_DeviceActor.cxx libGEOMObject_la_CPPFLAGS = \ @@ -78,9 +68,11 @@ libGEOMObject_la_CPPFLAGS = \ $(CAS_CPPFLAGS) \ $(VTK_INCLUDES) \ $(KERNEL_CXXFLAGS) \ - $(GUI_CXXFLAGS) - + $(GUI_CXXFLAGS) \ + -I$(srcdir)/../OCC2VTK + libGEOMObject_la_LDFLAGS = \ + ../OCC2VTK/libOCC2VTK.la \ $(QT_MT_LIBS) \ $(CAS_KERNEL) -lTKBRep -lTKG2d -lTKG3d -lTKV3d -lTKMesh -lTKGeomBase -lTKGeomAlgo -lTKTopAlgo -lTKService \ $(VTK_LIBS) \ diff --git a/src/OBJECT/GEOM_EdgeSource.cxx b/src/OCC2VTK/GEOM_EdgeSource.cxx similarity index 100% rename from src/OBJECT/GEOM_EdgeSource.cxx rename to src/OCC2VTK/GEOM_EdgeSource.cxx diff --git a/src/OBJECT/GEOM_EdgeSource.h b/src/OCC2VTK/GEOM_EdgeSource.h similarity index 94% rename from src/OBJECT/GEOM_EdgeSource.h rename to src/OCC2VTK/GEOM_EdgeSource.h index 82383a663..9ef08683f 100755 --- a/src/OBJECT/GEOM_EdgeSource.h +++ b/src/OCC2VTK/GEOM_EdgeSource.h @@ -20,17 +20,17 @@ #ifndef GEOM_EDGESOURCE_H #define GEOM_EDGESOURCE_H -#include "GEOM_DeviceActor.h" +#include "OCC2VTK.h" #include #include typedef NCollection_Set TEdgeSet; +#include #include - - -class VTK_EXPORT GEOM_EdgeSource: public vtkPolyDataSource + +class OCC2VTK_EXPORT GEOM_EdgeSource: public vtkPolyDataSource { public: vtkTypeMacro(GEOM_EdgeSource,vtkPolyDataSource); diff --git a/src/OBJECT/GEOM_FaceSource.cxx b/src/OCC2VTK/GEOM_FaceSource.cxx similarity index 100% rename from src/OBJECT/GEOM_FaceSource.cxx rename to src/OCC2VTK/GEOM_FaceSource.cxx diff --git a/src/OBJECT/GEOM_FaceSource.h b/src/OCC2VTK/GEOM_FaceSource.h similarity index 90% rename from src/OBJECT/GEOM_FaceSource.h rename to src/OCC2VTK/GEOM_FaceSource.h index 2fed7cb40..555dcdeb1 100755 --- a/src/OBJECT/GEOM_FaceSource.h +++ b/src/OCC2VTK/GEOM_FaceSource.h @@ -20,21 +20,18 @@ #ifndef GEOM_FACESOURCE_H #define GEOM_FACESOURCE_H -#include "GEOM_DeviceActor.h" - +#include "OCC2VTK.h" + #include #include #include typedef NCollection_Set TFaceSet; +#include #include - -class GEOM_FaceSource; -typedef GEOM_SmartPtr PFaceSource; - - -class VTK_EXPORT GEOM_FaceSource: public vtkPolyDataSource + +class OCC2VTK_EXPORT GEOM_FaceSource: public vtkPolyDataSource { public: vtkTypeMacro(GEOM_FaceSource,vtkPolyDataSource); diff --git a/src/OBJECT/GEOM_ShadingFace.cxx b/src/OCC2VTK/GEOM_ShadingFace.cxx similarity index 100% rename from src/OBJECT/GEOM_ShadingFace.cxx rename to src/OCC2VTK/GEOM_ShadingFace.cxx diff --git a/src/OBJECT/GEOM_ShadingFace.h b/src/OCC2VTK/GEOM_ShadingFace.h similarity index 94% rename from src/OBJECT/GEOM_ShadingFace.h rename to src/OCC2VTK/GEOM_ShadingFace.h index ee1f7a924..2af0254ae 100755 --- a/src/OBJECT/GEOM_ShadingFace.h +++ b/src/OCC2VTK/GEOM_ShadingFace.h @@ -20,10 +20,10 @@ #ifndef GEOM_SHADINGFACE_H #define GEOM_SHADINGFACE_H +#include "OCC2VTK.h" #include "GEOM_FaceSource.h" - - -class VTK_EXPORT GEOM_ShadingFace: public GEOM_FaceSource + +class OCC2VTK_EXPORT GEOM_ShadingFace: public GEOM_FaceSource { public: vtkTypeMacro(GEOM_ShadingFace,GEOM_FaceSource); diff --git a/src/OBJECT/GEOM_VertexSource.cxx b/src/OCC2VTK/GEOM_VertexSource.cxx similarity index 100% rename from src/OBJECT/GEOM_VertexSource.cxx rename to src/OCC2VTK/GEOM_VertexSource.cxx diff --git a/src/OBJECT/GEOM_VertexSource.h b/src/OCC2VTK/GEOM_VertexSource.h similarity index 93% rename from src/OBJECT/GEOM_VertexSource.h rename to src/OCC2VTK/GEOM_VertexSource.h index 782c528a8..612e11237 100755 --- a/src/OBJECT/GEOM_VertexSource.h +++ b/src/OCC2VTK/GEOM_VertexSource.h @@ -20,17 +20,17 @@ #ifndef GEOM_VERTEXSOURCE_H #define GEOM_VERTEXSOURCE_H -#include "GEOM_DeviceActor.h" +#include "OCC2VTK.h" #include #include typedef NCollection_Set TVertexSet; +#include #include - - -class VTK_EXPORT GEOM_VertexSource: public vtkPolyDataSource + +class OCC2VTK_EXPORT GEOM_VertexSource: public vtkPolyDataSource { public: vtkTypeMacro(GEOM_VertexSource,vtkPolyDataSource); diff --git a/src/OBJECT/GEOM_WireframeFace.cxx b/src/OCC2VTK/GEOM_WireframeFace.cxx similarity index 100% rename from src/OBJECT/GEOM_WireframeFace.cxx rename to src/OCC2VTK/GEOM_WireframeFace.cxx diff --git a/src/OBJECT/GEOM_WireframeFace.h b/src/OCC2VTK/GEOM_WireframeFace.h similarity index 97% rename from src/OBJECT/GEOM_WireframeFace.h rename to src/OCC2VTK/GEOM_WireframeFace.h index d34bf9652..1b506f95d 100755 --- a/src/OBJECT/GEOM_WireframeFace.h +++ b/src/OCC2VTK/GEOM_WireframeFace.h @@ -20,15 +20,15 @@ #ifndef GEOM_WIREFRAME_FACE_H #define GEOM_WIREFRAME_FACE_H +#include "OCC2VTK.h" #include "GEOM_FaceSource.h" #include #include #include - - -class VTK_EXPORT GEOM_WireframeFace: public GEOM_FaceSource + +class OCC2VTK_EXPORT GEOM_WireframeFace: public GEOM_FaceSource { public: vtkTypeMacro(GEOM_WireframeFace,GEOM_FaceSource); diff --git a/src/OCC2VTK/Makefile.am b/src/OCC2VTK/Makefile.am new file mode 100644 index 000000000..9dcbaa4af --- /dev/null +++ b/src/OCC2VTK/Makefile.am @@ -0,0 +1,51 @@ +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +# + +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# header files +salomeinclude_HEADERS = \ + OCC2VTK.h \ + OCC2VTK_Tools.h \ + GEOM_EdgeSource.h \ + GEOM_FaceSource.h \ + GEOM_ShadingFace.h \ + GEOM_VertexSource.h \ + GEOM_WireframeFace.h + +# Libraries targets +lib_LTLIBRARIES = libOCC2VTK.la + +dist_libOCC2VTK_la_SOURCES = \ + OCC2VTK_Tools.cxx \ + GEOM_EdgeSource.cxx \ + GEOM_FaceSource.cxx \ + GEOM_ShadingFace.cxx \ + GEOM_VertexSource.cxx \ + GEOM_WireframeFace.cxx + +libOCC2VTK_la_CPPFLAGS = \ + $(CAS_CPPFLAGS) \ + $(VTK_INCLUDES) \ + $(KERNEL_CXXFLAGS) + +libOCC2VTK_la_LDFLAGS = \ + $(CAS_KERNEL) -lTKBRep -lTKG2d -lTKG3d -lTKV3d -lTKMesh -lTKGeomBase -lTKGeomAlgo -lTKTopAlgo -lTKService \ + $(VTK_LIBS) \ + $(KERNEL_LDFLAGS) -lSALOMELocalTrace diff --git a/src/OCC2VTK/OCC2VTK.h b/src/OCC2VTK/OCC2VTK.h new file mode 100755 index 000000000..603942ac1 --- /dev/null +++ b/src/OCC2VTK/OCC2VTK.h @@ -0,0 +1,36 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 OCC2VTK_H +#define OCC2VTK_H + +#if defined WIN32 +# if defined OCC2VTK_EXPORTS +# define OCC2VTK_EXPORT __declspec( dllexport ) +# else +# define OCC2VTK_EXPORT __declspec( dllimport ) +# endif +#else +# define OCC2VTK_EXPORT +#endif + +#endif // OCC2VTK_H diff --git a/src/OCC2VTK/OCC2VTK_Tools.cxx b/src/OCC2VTK/OCC2VTK_Tools.cxx new file mode 100755 index 000000000..ef0e4ce35 --- /dev/null +++ b/src/OCC2VTK/OCC2VTK_Tools.cxx @@ -0,0 +1,165 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#include "OCC2VTK_Tools.h" + +#include "GEOM_VertexSource.h" +#include "GEOM_EdgeSource.h" +#include "GEOM_WireframeFace.h" +#include "GEOM_ShadingFace.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX2(X, Y) (Abs(X) > Abs(Y) ? Abs(X) : Abs(Y)) +#define MAX3(X, Y, Z) (MAX2(MAX2(X,Y), Z)) + +namespace GEOM +{ + void MeshShape(const TopoDS_Shape theShape, + Standard_Real theDeflection, + Standard_Boolean theForced) + { + // Mesh the shape if necessary + Standard_Boolean alreadymesh = Standard_True; + TopExp_Explorer ex; + TopLoc_Location aLoc; + + for (ex.Init(theShape, TopAbs_FACE); 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; } + } + + if(!alreadymesh || theForced) { + if(theDeflection<=0) { + // Compute default deflection + Bnd_Box B; + BRepBndLib::Add(theShape, B); + if ( B.IsVoid() ) return; // NPAL15983 (Bug when displaying empty groups) + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + theDeflection = MAX3(aXmax-aXmin, aYmax-aYmin, aZmax-aZmin) * 0.001 * 4; + } + BRepMesh_IncrementalMesh MESH(theShape,theDeflection); + } + } + + void MeshShape2(const TopoDS_Shape& theShape, + float& theDeflection, + bool theIsRelative) + { + static Standard_Real RELATIVE_DEFLECTION = 0.0001; + Standard_Real aDeflection = theDeflection; + + if(theDeflection <= 0) { // Compute default theDeflection + Bnd_Box B; + BRepBndLib::Add(theShape, B); + Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; + B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); + Standard_Real aDiagonal = (aXmax-aXmin)*(aXmax-aXmin) + + (aYmax-aYmin)*(aYmax-aYmin) + + (aZmax-aZmin)*(aZmax-aZmin); + aDiagonal = sqrt(aDiagonal); + aDeflection = aDiagonal*RELATIVE_DEFLECTION; + + if(theIsRelative) + theDeflection = RELATIVE_DEFLECTION; + else + theDeflection = aDeflection; + } + + BRepMesh_IncrementalMesh aMesh(theShape,aDeflection); + } + + void SetShape(const TopoDS_Shape& theShape, + const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap, + bool theIsVector, + GEOM_EdgeSource* theIsolatedEdgeSource, + GEOM_EdgeSource* theOneFaceEdgeSource, + GEOM_EdgeSource* theSharedEdgeSource, + GEOM_WireframeFace* theWireframeFaceSource, + GEOM_ShadingFace* theShadingFaceSource) + { + if (theShape.ShapeType() == TopAbs_COMPOUND) { + TopoDS_Iterator anItr(theShape); + for (; anItr.More(); anItr.Next()) { + SetShape(anItr.Value(),theEdgeMap,theIsVector, + theIsolatedEdgeSource, + theOneFaceEdgeSource, + theSharedEdgeSource, + theWireframeFaceSource, + theShadingFaceSource); + } + } + + switch (theShape.ShapeType()) { + case TopAbs_WIRE: { + TopExp_Explorer anEdgeExp(theShape,TopAbs_EDGE); + for (; anEdgeExp.More(); anEdgeExp.Next()){ + const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current()); + if (!BRep_Tool::Degenerated(anEdge)) + theIsolatedEdgeSource->AddEdge(anEdge,theIsVector); + } + break; + } + case TopAbs_EDGE: { + const TopoDS_Edge& anEdge = TopoDS::Edge(theShape); + if (!BRep_Tool::Degenerated(anEdge)) + theIsolatedEdgeSource->AddEdge(anEdge,theIsVector); + break; + } + case TopAbs_VERTEX: { + break; + } + default: { + TopExp_Explorer aFaceExp (theShape,TopAbs_FACE); + for(; aFaceExp.More(); aFaceExp.Next()) { + const TopoDS_Face& aFace = TopoDS::Face(aFaceExp.Current()); + theWireframeFaceSource->AddFace(aFace); + theShadingFaceSource->AddFace(aFace); + TopExp_Explorer anEdgeExp(aFaceExp.Current(), TopAbs_EDGE); + for(; anEdgeExp.More(); anEdgeExp.Next()) { + const TopoDS_Edge& anEdge = TopoDS::Edge(anEdgeExp.Current()); + if(!BRep_Tool::Degenerated(anEdge)){ + // compute the number of faces + int aNbOfFaces = theEdgeMap.FindFromKey(anEdge).Extent(); + switch(aNbOfFaces){ + case 0: // isolated edge + theIsolatedEdgeSource->AddEdge(anEdge,theIsVector); + break; + case 1: // edge in only one face + theOneFaceEdgeSource->AddEdge(anEdge,theIsVector); + break; + default: // edge shared by at least two faces + theSharedEdgeSource->AddEdge(anEdge,theIsVector); + } + } + } + } + } + } + } +} diff --git a/src/OCC2VTK/OCC2VTK_Tools.h b/src/OCC2VTK/OCC2VTK_Tools.h new file mode 100755 index 000000000..c019154cb --- /dev/null +++ b/src/OCC2VTK/OCC2VTK_Tools.h @@ -0,0 +1,55 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +// + +#ifndef OCC2VTK_TOOLS_H +#define OCC2VTK_TOOLS_H + +#include "OCC2VTK.h" + +#include +#include + +class GEOM_EdgeSource; +class GEOM_WireframeFace; +class GEOM_ShadingFace; + +namespace GEOM +{ + // moved from GEOM_AssemblyBuilder + OCC2VTK_EXPORT void MeshShape(const TopoDS_Shape theShape, + Standard_Real theDeflection, + Standard_Boolean theForced); + + // moved from GEOM_Actor + OCC2VTK_EXPORT void MeshShape2(const TopoDS_Shape& theShape, + float& theDeflection, + bool theIsRelative); + + // moved from GEOM_Actor + OCC2VTK_EXPORT void SetShape(const TopoDS_Shape& theShape, + const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap, + bool theIsVector, + GEOM_EdgeSource* theIsolatedEdgeSource, + GEOM_EdgeSource* theOneFaceEdgeSource, + GEOM_EdgeSource* theSharedEdgeSource, + GEOM_WireframeFace* theWireframeFaceSource, + GEOM_ShadingFace* theShadingFaceSource); +} + +#endif // OCC2VTK_TOOLS_H diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index a10babc44..71a6e290c 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -526,6 +526,19 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument() default: break; } + + //rnv: To fix the bug IPAL22041 TC5.1.5: "Fillet Construcion" dialog loses current selection. + // Restore selection of the main shape, if need, + // because it was canceled. + aSelMgr->selectedObjects(aSelList); + if (aSelList.Extent() == 0 && !myShape->_is_nil()) { + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + ObjectList list; + list.push_back(myShape); + selectObjects(list); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + } } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx b/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx index 51e9fbacf..f7aea996c 100644 --- a/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx +++ b/src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx @@ -205,7 +205,7 @@ void OperationGUI_Fillet1d2dDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( anObj, aName ); - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); anObj = aShapesOp->GetSubShape( anObj, anIndex ); } @@ -370,9 +370,12 @@ GEOM::GEOM_IOperations_ptr OperationGUI_Fillet1d2dDlg::createOperation() // function : isValid() // purpose : Verify validity of input data //================================================================================= -bool OperationGUI_Fillet1d2dDlg::isValid (QString&) +bool OperationGUI_Fillet1d2dDlg::isValid (QString& msg) { - return !myShape->_is_nil() && (myIs1D || myVertexes.Extent() > 0); + bool ok = !myShape->_is_nil(); + ok = GroupVertexes->SpinBox_DX->isValid( msg, !IsPreview() ) && ok; + ok = (myIs1D || myVertexes.Extent() > 0) && ok; + return ok; } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index 6cd07c94a..e18e1cb4c 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -298,7 +298,6 @@ void OperationGUI_FilletDlg::ConstructorsClicked (int constructorId) qApp->processEvents(); updateGeometry(); resize(minimumSizeHint()); - SelectionIntoArgument(); } //================================================================================= @@ -398,7 +397,7 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() } } - // clear selection + // clear selection of the faces or edges if (!(myEditCurrentArgument == Group2->LineEdit2 || myEditCurrentArgument == Group3->LineEdit2)) { disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); @@ -423,6 +422,19 @@ void OperationGUI_FilletDlg::SelectionIntoArgument() default: break; } + + //rnv: To fix the bug IPAL22041 TC5.1.5: "Fillet Construcion" dialog loses current selection. + // Restore selection of the main shape, if need, + // because it was canceled. + aSelMgr->selectedObjects(aSelList); + if (aSelList.Extent() == 0 && !myShape->_is_nil()) { + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + ObjectList list; + list.push_back(myShape); + selectObjects(list); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + } } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.cxx b/src/OperationGUI/OperationGUI_PartitionDlg.cxx index ef7fc756a..6c4ad4bda 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.cxx +++ b/src/OperationGUI/OperationGUI_PartitionDlg.cxx @@ -19,10 +19,11 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// GEOM GEOMGUI : GUI for Geometry component -// File : OperationGUI_PartitionDlg.cxx -// Author : Lucien PIGNOLONI, Open CASCADE S.A.S. +// GEOM GEOMGUI : GUI for Geometry component +// File : OperationGUI_PartitionDlg.cxx +// Author : Lucien PIGNOLONI, Open CASCADE S.A.S. +// #include "OperationGUI_PartitionDlg.h" #include @@ -43,50 +44,51 @@ //================================================================================= // class : OperationGUI_PartitionDlg() -// purpose : Constructs a OperationGUI_PartitionDlg which is a child of 'parent', with the +// purpose : Constructs a OperationGUI_PartitionDlg 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. //================================================================================= -OperationGUI_PartitionDlg::OperationGUI_PartitionDlg(GeometryGUI* theGeometryGUI, QWidget* parent) - : GEOMBase_Skeleton(theGeometryGUI, parent, false) +OperationGUI_PartitionDlg::OperationGUI_PartitionDlg( GeometryGUI* theGeometryGUI, QWidget* parent ) + : GEOMBase_Skeleton( theGeometryGUI, parent, false ) { SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr(); - QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PARTITION"))); - QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PARTITION_PLANE"))); - QPixmap image2(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + QPixmap image0( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_PARTITION" ) ) ); + QPixmap image1( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_PARTITION_PLANE" ) ) ); + QPixmap image2( aResMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) ); - setWindowTitle(tr("GEOM_PARTITION_TITLE")); + setWindowTitle( tr( "GEOM_PARTITION_TITLE" ) ); /***************************************************************/ - mainFrame()->GroupConstructors->setTitle(tr("GEOM_PARTITION")); - mainFrame()->RadioButton1->setIcon(image0); - mainFrame()->RadioButton2->setIcon(image1); - mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->GroupConstructors->setTitle( tr( "GEOM_PARTITION" ) ); + mainFrame()->RadioButton1->setIcon( image0 ); + mainFrame()->RadioButton2->setIcon( image1 ); + mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose ); mainFrame()->RadioButton3->close(); // Full partition (contains half-space partition) - GroupPoints = new DlgRef_2Sel1List1Check(centralWidget()); - GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION")); - GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS")); - GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECTS")); - GroupPoints->TextLabel3->setText(tr("GEOM_RECONSTRUCTION_LIMIT")); - GroupPoints->PushButton1->setIcon(image2); - GroupPoints->PushButton2->setIcon(image2); - GroupPoints->LineEdit1->setReadOnly(true); - GroupPoints->LineEdit2->setReadOnly(true); - GroupPoints->LineEdit1->setEnabled(true); - GroupPoints->LineEdit2->setEnabled(false); - GroupPoints->CheckButton1->setText(tr("GEOM_KEEP_NONLIMIT_SHAPES")); + GroupPoints = new DlgRef_2Sel1List2Check( centralWidget() ); + GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION" ) ); + GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) ); + GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECTS" ) ); + GroupPoints->TextLabel3->setText( tr( "GEOM_RECONSTRUCTION_LIMIT" ) ); + GroupPoints->PushButton1->setIcon( image2 ); + GroupPoints->PushButton2->setIcon( image2 ); + GroupPoints->LineEdit1->setReadOnly( true ); + GroupPoints->LineEdit2->setReadOnly( true ); + GroupPoints->LineEdit1->setEnabled( true ); + GroupPoints->LineEdit2->setEnabled( false ); + GroupPoints->CheckButton1->setText( tr( "GEOM_KEEP_NONLIMIT_SHAPES" ) ); + GroupPoints->CheckButton2->setText( tr( "GEOM_NO_SELF_INTERSECTION" ) ); - QVBoxLayout* layout = new QVBoxLayout(centralWidget()); - layout->setMargin(0); layout->setSpacing(6); - layout->addWidget(GroupPoints); + QVBoxLayout* layout = new QVBoxLayout( centralWidget() ); + layout->setMargin( 0 ); layout->setSpacing( 6 ); + layout->addWidget( GroupPoints ); /***************************************************************/ - setHelpFileName("partition_page.html"); - + setHelpFileName( "partition_page.html" ); + Init(); } @@ -100,14 +102,14 @@ OperationGUI_PartitionDlg::~OperationGUI_PartitionDlg() // no need to delete child widgets, Qt does it all for us } -void OperationGUI_PartitionDlg::SetListMaterials(GEOM::ListOfLong ListMaterials) +void OperationGUI_PartitionDlg::SetListMaterials( GEOM::ListOfLong ListMaterials ) { - myListMaterials = ListMaterials; + myListMaterials = ListMaterials; } - + GEOM::ListOfLong OperationGUI_PartitionDlg::GetListMaterials() -{ - return myListMaterials; +{ + return myListMaterials; } //================================================================================= @@ -117,36 +119,42 @@ GEOM::ListOfLong OperationGUI_PartitionDlg::GetListMaterials() void OperationGUI_PartitionDlg::Init() { /* type for sub shape selection */ - GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_SOLID")); - GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_SHELL")); - GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_FACE")); - GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_WIRE")); - GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_EDGE")); - GroupPoints->ComboBox1->addItem(tr("GEOM_RECONSTRUCTION_LIMIT_VERTEX")); - GroupPoints->CheckButton1->setChecked(false); - + GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_SOLID" ) ); + GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::SOLID); + GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_SHELL" ) ); + GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::SHELL); + GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_FACE" ) ); + GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::FACE); + GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_WIRE" ) ); + GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::WIRE); + GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_EDGE" ) ); + GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::EDGE); + GroupPoints->ComboBox1->addItem( tr( "GEOM_RECONSTRUCTION_LIMIT_VERTEX" ) ); + GroupPoints->ComboBox1->setItemData(GroupPoints->ComboBox1->count()-1, GEOM::VERTEX); + GroupPoints->CheckButton1->setChecked( false ); + mainFrame()->GroupBoxPublish->show(); /* signals and slots connections */ - connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); + connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) ); - connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int))); + connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) ); + + connect( GroupPoints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ); + connect( GroupPoints->PushButton2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) ); + + connect( GroupPoints->LineEdit1, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ); + connect( GroupPoints->LineEdit2, SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) ); + + connect( GroupPoints->ComboBox1, SIGNAL( activated( int ) ), this, SLOT( ComboTextChanged() ) ); - connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect( myGeomGUI->getApp()->selectionMgr(), + SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); + + initName( tr( "GEOM_PARTITION" ) ); - connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); - - connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged())); - - connect(myGeomGUI->getApp()->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); - - initName(tr("GEOM_PARTITION")); - - ConstructorsClicked(0); + ConstructorsClicked( 0 ); GroupPoints->PushButton1->click(); } @@ -155,40 +163,44 @@ void OperationGUI_PartitionDlg::Init() // function : ConstructorsClicked() // purpose : Radio button management //================================================================================= -void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId) +void OperationGUI_PartitionDlg::ConstructorsClicked( int constructorId ) { - disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 ); globalSelection(); - - myListShapes.length(0); - myListTools.length(0); - myListKeepInside.length(0); - myListRemoveInside.length(0); - myListMaterials.length(0); - - switch (constructorId) { + + //myListShapes.length( 0 ); + //myListTools.length( 0 ); + //myListKeepInside.length( 0 ); // obsolete + //myListRemoveInside.length( 0 ); // obsolete + //myListMaterials.length( 0 ); // obsolete + + switch ( constructorId ) { case 0: /*Full partition */ - GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION")); - GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECTS")); + GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION" ) ); + GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECTS" ) ); + GroupPoints->TextLabel2->setText( tr( "GEOM_TOOL_OBJECTS" ) ); GroupPoints->TextLabel3->show(); GroupPoints->ComboBox1->show(); - GroupPoints->ComboBox1->setCurrentIndex(0); + GroupPoints->ComboBox1->setCurrentIndex( 0 ); GroupPoints->CheckButton1->show(); - GroupPoints->PushButton1->setDown(true); - GroupPoints->PushButton2->setDown(false); + GroupPoints->CheckButton2->show(); + GroupPoints->PushButton1->setDown( true ); + GroupPoints->PushButton2->setDown( false ); GroupPoints->LineEdit1->setEnabled(true); GroupPoints->LineEdit2->setEnabled(false); break; case 1: /*Half-space partition */ - GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION_HALFSPACE")); + GroupPoints->GroupBox1->setTitle( tr( "GEOM_PARTITION_HALFSPACE" ) ); GroupPoints->TextLabel3->hide(); GroupPoints->ComboBox1->hide(); - GroupPoints->TextLabel2->setText(tr("GEOM_PLANE")); + GroupPoints->TextLabel1->setText( tr( "GEOM_OBJECT" ) ); + GroupPoints->TextLabel2->setText( tr( "GEOM_PLANE" ) ); GroupPoints->CheckButton1->hide(); - GroupPoints->PushButton1->setDown(true); + GroupPoints->CheckButton2->hide(); + GroupPoints->PushButton1->setDown( true ); GroupPoints->LineEdit1->setEnabled(true); break; - } + } myEditCurrentArgument = GroupPoints->LineEdit1; GroupPoints->LineEdit1->clear(); @@ -196,11 +208,11 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId) qApp->processEvents(); updateGeometry(); - resize(minimumSizeHint()); + resize( minimumSizeHint() ); myEditCurrentArgument->setFocus(); - connect(myGeomGUI->getApp()->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + connect( myGeomGUI->getApp()->selectionMgr(), + SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); SelectionIntoArgument(); } @@ -211,7 +223,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId) //================================================================================= void OperationGUI_PartitionDlg::ClickOnOk() { - if (ClickOnApply()) + if ( ClickOnApply() ) ClickOnCancel(); } @@ -222,12 +234,13 @@ void OperationGUI_PartitionDlg::ClickOnOk() //================================================================================= bool OperationGUI_PartitionDlg::ClickOnApply() { - if (!onAccept()) + if ( !onAccept() ) return false; + initName(); - // 0020854: EDF 1398 GEOM: Ergonomy of Partition GUI window - // ConstructorsClicked(getConstructorId()); + // 0020854: EDF 1398 GEOM: Ergonomy of Partition GUI window + // ConstructorsClicked( getConstructorId() ); return true; } @@ -238,46 +251,75 @@ bool OperationGUI_PartitionDlg::ClickOnApply() //================================================================================= void OperationGUI_PartitionDlg::SelectionIntoArgument() { - myEditCurrentArgument->setText(""); + myEditCurrentArgument->setText( "" ); QString aString = ""; - + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); SALOME_ListIO aSelList; aSelMgr->selectedObjects(aSelList); int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true); - - if (nbSel < 1) { - if (myEditCurrentArgument == GroupPoints->LineEdit1) { - myListShapes.length(0); - myListMaterials.length(0); + + if ( getConstructorId() == 1 ) { + // for half-selection, only one shape can be selected as an object + // and only one plane as a tool + if ( nbSel != 1 ) { + if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { + myListShapes.length( 0 ); + // myListMaterials.length( 0 ); // obsolete + return; + } + else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) { + myListTools.length( 0 ); + return; + } } - else if (myEditCurrentArgument == GroupPoints->LineEdit2) - myListTools.length(0); } - - // One and only one plane can be selected - - if (getConstructorId() == 1 && - myEditCurrentArgument == GroupPoints->LineEdit2 && - nbSel != 1) { - myListTools.length(0); - return; + else { + if ( nbSel < 1 ) { + if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { + myListShapes.length( 0 ); + //myListMaterials.length( 0 ); // obsolete + return; + } + else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) { + myListTools.length( 0 ); + return; + } + } } - - if (myEditCurrentArgument == GroupPoints->LineEdit1) { + + if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true); - myListMaterials.length(0); - if (!myListShapes.length()) + //myListMaterials.length( 0 ); // obsolete + + GEOM::shape_type type = GEOM::SOLID; + for (int i = 0; i < myListShapes.length(); i++) + type = qMax( type, myListShapes[i]->GetMinShapeType() ); + int idx = qMax( 0, GroupPoints->ComboBox1->findData( type ) ); + GroupPoints->ComboBox1->setCurrentIndex( idx ); + + if ( !myListShapes.length() ) return; } - else if (myEditCurrentArgument == GroupPoints->LineEdit2) { + else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) { GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListTools, true); - if (!myListTools.length()) + if ( !myListTools.length() ) return; + else if ( myListTools.length() == 1 && getConstructorId() == 1 ) { + GEOM::GEOM_IMeasureOperations_var mOp = getGeomEngine()->GetIMeasureOperations( getStudyId() ); + GEOM::ListOfLong_var intList; + GEOM::ListOfDouble_var dblList; + GEOM::GEOM_IKindOfShape::shape_kind kind = mOp->KindOfShape( myListTools[0].in(), intList.out(), dblList.out() ); + mOp->Destroy(); + if ( kind < GEOM::GEOM_IKindOfShape::DISK_CIRCLE || kind > GEOM::GEOM_IKindOfShape::PLANAR ) { + myListTools.length( 0 ); + return; + } + } } - myEditCurrentArgument->setText(aString); + myEditCurrentArgument->setText( aString ); } @@ -288,25 +330,25 @@ void OperationGUI_PartitionDlg::SelectionIntoArgument() void OperationGUI_PartitionDlg::SetEditCurrentArgument() { QPushButton* send = (QPushButton*)sender(); - - if (send == GroupPoints->PushButton1) { + + if ( send == GroupPoints->PushButton1 ) { myEditCurrentArgument = GroupPoints->LineEdit1; GroupPoints->PushButton2->setDown(false); GroupPoints->LineEdit1->setEnabled(true); GroupPoints->LineEdit2->setEnabled(false); } - else if (send == GroupPoints->PushButton2) { + else if ( send == GroupPoints->PushButton2 ) { myGeomGUI->getApp()->selectionMgr()->clearSelected(); //clear prewious selection myEditCurrentArgument = GroupPoints->LineEdit2; GroupPoints->PushButton1->setDown(false); GroupPoints->LineEdit1->setEnabled(false); GroupPoints->LineEdit2->setEnabled(true); - if (getConstructorId() == 1) - globalSelection(GEOM_PLANE); + if ( getConstructorId() == 1 ) + globalSelection( GEOM_PLANE ); } - - globalSelection(GEOM_ALLSHAPES); - + + globalSelection( GEOM_ALLSHAPES ); + myEditCurrentArgument->setFocus(); SelectionIntoArgument(); send->setDown(true); @@ -321,8 +363,8 @@ void OperationGUI_PartitionDlg::LineEditReturnPressed() { QLineEdit* send = (QLineEdit*)sender(); - if (send == GroupPoints->LineEdit1 || - send == GroupPoints->LineEdit2) { + if ( send == GroupPoints->LineEdit1 || + send == GroupPoints->LineEdit2 ) { myEditCurrentArgument = send; GEOMBase_Skeleton::LineEditReturnPressed(); } @@ -336,10 +378,10 @@ void OperationGUI_PartitionDlg::LineEditReturnPressed() void OperationGUI_PartitionDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - connect(myGeomGUI->getApp()->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + connect( myGeomGUI->getApp()->selectionMgr(), + SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); - ConstructorsClicked(getConstructorId()); + ConstructorsClicked( getConstructorId() ); } @@ -347,9 +389,9 @@ void OperationGUI_PartitionDlg::ActivateThisDialog() // function : enterEvent() // purpose : //================================================================================= -void OperationGUI_PartitionDlg::enterEvent(QEvent*) +void OperationGUI_PartitionDlg::enterEvent( QEvent* ) { - if (!mainFrame()->GroupConstructors->isEnabled()) + if ( !mainFrame()->GroupConstructors->isEnabled() ) this->ActivateThisDialog(); } @@ -360,7 +402,7 @@ void OperationGUI_PartitionDlg::enterEvent(QEvent*) //================================================================================= GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation() { - return getGeomEngine()->GetIBooleanOperations(getStudyId()); + return getGeomEngine()->GetIBooleanOperations( getStudyId() ); } @@ -368,10 +410,11 @@ GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation() // function : isValid // purpose : //================================================================================= -bool OperationGUI_PartitionDlg::isValid(QString&) +bool OperationGUI_PartitionDlg::isValid( QString& ) { - return (myListShapes.length() || myListTools.length() || - myListKeepInside.length() || myListRemoveInside.length()); + printf("OperationGUI_PartitionDlg::isValid:myListShapes.length()=%d\n",myListShapes.length()); + printf("OperationGUI_PartitionDlg::isValid:myListTools.length()=%d\n",myListTools.length()); + return ( myListShapes.length() || myListTools.length() ); // || myListKeepInside.length() || myListRemoveInside.length() // obsolete } @@ -379,53 +422,50 @@ bool OperationGUI_PartitionDlg::isValid(QString&) // function : execute // purpose : //================================================================================= -bool OperationGUI_PartitionDlg::execute(ObjectList& objects) +bool OperationGUI_PartitionDlg::execute( ObjectList& objects ) { bool res = false; - GEOM::GEOM_Object_var anObj; - QString msg; - int aLimit = GetLimit(); - int aConstructorId = getConstructorId(); - int aKeepNonlimitShapes = 0; + int aLimit = GetLimit(); + int aKeepNonlimitShapes = GroupPoints->CheckButton1->isChecked(); + bool aNoSelfIntersection = GroupPoints->CheckButton2->isChecked(); - if (aConstructorId == 1) { - aLimit = GEOM::SHAPE; - } - else { - if (GroupPoints->CheckButton1->isChecked()) { - aKeepNonlimitShapes = 1; - } - else { - aKeepNonlimitShapes = 0; - } - } + GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow( getOperation() ); - if (isValid(msg)) { - GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation()); - anObj = anOper->MakePartition(myListShapes, myListTools, - myListKeepInside, myListRemoveInside, - aLimit, false, myListMaterials, aKeepNonlimitShapes); + switch ( getConstructorId() ) { + case 0: + anObj = aNoSelfIntersection ? + anOper->MakePartitionNonSelfIntersectedShape( myListShapes, myListTools, + myListKeepInside, myListRemoveInside, + aLimit, false, myListMaterials, aKeepNonlimitShapes ) : + anOper->MakePartition( myListShapes, myListTools, + myListKeepInside, myListRemoveInside, + aLimit, false, myListMaterials, aKeepNonlimitShapes ); res = true; + break; + case 1: + anObj = anOper->MakeHalfPartition( myListShapes[0].in(), myListTools[0].in() ); + res = true; + break; } - if (!anObj->_is_nil()) { + if ( !anObj->_is_nil() ) { TopoDS_Shape aShape; - GEOMBase::GetShape(anObj, aShape, TopAbs_SHAPE); - TopoDS_Iterator It (aShape, Standard_True, Standard_True); - int nbSubshapes=0; - for (; It.More(); It.Next()) + GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE ); + TopoDS_Iterator It( aShape, Standard_True, Standard_True ); + int nbSubshapes = 0; + for ( ; It.More(); It.Next() ) nbSubshapes++; - if (nbSubshapes) - objects.push_back(anObj._retn()); + if ( nbSubshapes ) + objects.push_back( anObj._retn() ); else - SUIT_MessageBox::warning(this, - QObject::tr("GEOM_ERROR"), - QObject::tr("GEOM_WRN_PARTITION_RESULT_EMPTY")); + SUIT_MessageBox::warning( this, + QObject::tr( "GEOM_ERROR" ), + QObject::tr( "GEOM_WRN_PARTITION_RESULT_EMPTY" ) ); } - + return res; } @@ -433,21 +473,21 @@ bool OperationGUI_PartitionDlg::execute(ObjectList& objects) // function : restoreSubShapes // purpose : //================================================================================= -void OperationGUI_PartitionDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, - SALOMEDS::SObject_ptr theSObject) +void OperationGUI_PartitionDlg::restoreSubShapes( SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theSObject ) { - if (mainFrame()->CheckBoxRestoreSS->isChecked()) { + if ( mainFrame()->CheckBoxRestoreSS->isChecked() ) { // empty list of arguments means that all arguments should be restored - getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), - /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory, - /*theInheritFirstArg=*/myListShapes.length() == 1, - mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false + getGeomEngine()->RestoreSubShapesSO( theStudy, theSObject, GEOM::ListOfGO(), + /*theFindMethod=*/GEOM::FSM_GetInPlaceByHistory, + /*theInheritFirstArg=*/myListShapes.length() == 1, + mainFrame()->CheckBoxAddPrefix->isChecked() ); // ? false } } //======================================================================= //function : ComboTextChanged -//purpose : +//purpose : //======================================================================= void OperationGUI_PartitionDlg::ComboTextChanged() { @@ -462,13 +502,13 @@ void OperationGUI_PartitionDlg::ComboTextChanged() //================================================================================= // function : GetLimit() -// purpose : +// purpose : //================================================================================= int OperationGUI_PartitionDlg::GetLimit() const { int aLimit = GroupPoints->ComboBox1->currentIndex(); - switch (aLimit) { + switch ( aLimit ) { case 0: aLimit = GEOM::SOLID ; break; case 1: aLimit = GEOM::SHELL ; break; case 2: aLimit = GEOM::FACE ; break; diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.h b/src/OperationGUI/OperationGUI_PartitionDlg.h index 0acf131b2..53f48c8b7 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.h +++ b/src/OperationGUI/OperationGUI_PartitionDlg.h @@ -28,7 +28,7 @@ #include -class DlgRef_2Sel1List1Check; +class DlgRef_2Sel1List2Check; //================================================================================= // class : OperationGUI_PartitionDlg @@ -64,7 +64,7 @@ private: GEOM::ListOfGO myListRemoveInside; GEOM::ListOfGO myListKeepInside; - DlgRef_2Sel1List1Check* GroupPoints; + DlgRef_2Sel1List2Check* GroupPoints; private slots: void ClickOnOk(); diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index b797fc1bf..b7899baeb 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -270,7 +270,7 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index bef1293eb..6e7138640 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -292,7 +292,7 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index cea029cf6..45905b643 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -285,7 +285,7 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx index 8aa1a6aee..264dee772 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx @@ -337,7 +337,7 @@ void PrimitiveGUI_DiskDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx index 96d0f7d04..c803419d7 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx @@ -352,7 +352,7 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName ); - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil() ) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex ); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index 44dd44ca0..9821190d9 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -264,7 +264,7 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName ); - if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study + if ( aFindedObject->_is_nil() ) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex ); diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index f6a47130a..e331a0c30 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -281,7 +281,7 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/RepairGUI/Makefile.am b/src/RepairGUI/Makefile.am index c59c15056..7f8a4fcbe 100644 --- a/src/RepairGUI/Makefile.am +++ b/src/RepairGUI/Makefile.am @@ -38,6 +38,7 @@ salomeinclude_HEADERS = \ RepairGUI_FreeFacesDlg.h \ RepairGUI_ChangeOrientationDlg.h \ RepairGUI_GlueDlg.h \ + RepairGUI_LimitToleranceDlg.h \ RepairGUI_RemoveExtraEdgesDlg.h # Libraries targets @@ -56,6 +57,7 @@ dist_libRepairGUI_la_SOURCES = \ RepairGUI_FreeFacesDlg.h \ RepairGUI_ChangeOrientationDlg.h \ RepairGUI_GlueDlg.h \ + RepairGUI_LimitToleranceDlg.h \ RepairGUI_RemoveExtraEdgesDlg.h \ \ RepairGUI.cxx \ @@ -70,6 +72,7 @@ dist_libRepairGUI_la_SOURCES = \ RepairGUI_FreeFacesDlg.cxx \ RepairGUI_ChangeOrientationDlg.cxx \ RepairGUI_GlueDlg.cxx \ + RepairGUI_LimitToleranceDlg.cxx \ RepairGUI_RemoveExtraEdgesDlg.cxx MOC_FILES = \ @@ -84,6 +87,7 @@ MOC_FILES = \ RepairGUI_FreeFacesDlg_moc.cxx \ RepairGUI_ChangeOrientationDlg_moc.cxx \ RepairGUI_GlueDlg_moc.cxx \ + RepairGUI_LimitToleranceDlg_moc.cxx \ RepairGUI_RemoveExtraEdgesDlg_moc.cxx nodist_libRepairGUI_la_SOURCES = \ diff --git a/src/RepairGUI/RepairGUI.cxx b/src/RepairGUI/RepairGUI.cxx index 652cdb63a..ebfc75fb4 100644 --- a/src/RepairGUI/RepairGUI.cxx +++ b/src/RepairGUI/RepairGUI.cxx @@ -19,11 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// GEOM GEOMGUI : GUI for Geometry component +// File : RepairGUI.cxx +// Author : Damien COQUERET, Open CASCADE S.A.S. -// GEOM GEOMGUI : GUI for Geometry component -// File : RepairGUI.cxx -// Author : Damien COQUERET, Open CASCADE S.A.S. -// #include "RepairGUI.h" #include @@ -43,8 +42,9 @@ #include "RepairGUI_FreeBoundDlg.h" // Method FREE BOUNDARIES #include "RepairGUI_FreeFacesDlg.h" // Method FREE FACES #include "RepairGUI_GlueDlg.h" // Method GLUE FACES +#include "RepairGUI_LimitToleranceDlg.h" // Method LIMIT TOLERANCE #include "RepairGUI_ChangeOrientationDlg.h" // Method CHANGE ORIENTATION -#include "RepairGUI_RemoveExtraEdgesDlg.h" // Method REMOVE EXTRA EDGES +#include "RepairGUI_RemoveExtraEdgesDlg.h" // Method REMOVE EXTRA EDGES //======================================================================= // function : RepairGUI() @@ -66,7 +66,7 @@ RepairGUI::~RepairGUI() //======================================================================= // function : OnGUIEvent() -// purpose : +// purpose : //======================================================================= bool RepairGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) { @@ -77,18 +77,19 @@ bool RepairGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent ) QDialog* aDlg = NULL; switch ( theCommandID ) { - case GEOMOp::OpSewing: aDlg = new RepairGUI_SewingDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpGlueFaces: aDlg = new RepairGUI_GlueDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpSuppressFaces: aDlg = new RepairGUI_SuppressFacesDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpSuppressHoles: aDlg = new RepairGUI_RemoveHolesDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpShapeProcess: aDlg = new RepairGUI_ShapeProcessDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpCloseContour: aDlg = new RepairGUI_CloseContourDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpRemoveIntWires: aDlg = new RepairGUI_RemoveIntWiresDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpAddPointOnEdge: aDlg = new RepairGUI_DivideEdgeDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpFreeBoundaries: aDlg = new RepairGUI_FreeBoundDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpFreeFaces: aDlg = new RepairGUI_FreeFacesDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpOrientation: aDlg = new RepairGUI_ChangeOrientationDlg ( getGeometryGUI(), parent ); break; - case GEOMOp::OpRemoveExtraEdges: aDlg = new RepairGUI_RemoveExtraEdgesDlg ( getGeometryGUI(), parent ); break; + case GEOMOp::OpSewing: aDlg = new RepairGUI_SewingDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpGlueFaces: aDlg = new RepairGUI_GlueDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpLimitTolerance: aDlg = new RepairGUI_LimitToleranceDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpSuppressFaces: aDlg = new RepairGUI_SuppressFacesDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpSuppressHoles: aDlg = new RepairGUI_RemoveHolesDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpShapeProcess: aDlg = new RepairGUI_ShapeProcessDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpCloseContour: aDlg = new RepairGUI_CloseContourDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpRemoveIntWires: aDlg = new RepairGUI_RemoveIntWiresDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpAddPointOnEdge: aDlg = new RepairGUI_DivideEdgeDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpFreeBoundaries: aDlg = new RepairGUI_FreeBoundDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpFreeFaces: aDlg = new RepairGUI_FreeFacesDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpOrientation: aDlg = new RepairGUI_ChangeOrientationDlg (getGeometryGUI(), parent); break; + case GEOMOp::OpRemoveExtraEdges: aDlg = new RepairGUI_RemoveExtraEdgesDlg (getGeometryGUI(), parent); break; default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break; diff --git a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx index 60e8bef02..87b6d503d 100644 --- a/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx +++ b/src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx @@ -118,6 +118,7 @@ void RepairGUI_ChangeOrientationDlg::Init() initName( tr( "CHANGE_ORIENTATION_NEW_OBJ_NAME" ) ); resize(100,100); + SelectionIntoArgument(); } diff --git a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx index 0d315e37d..7423d3b94 100644 --- a/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx +++ b/src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx @@ -147,6 +147,7 @@ void RepairGUI_DivideEdgeDlg::Init() initName( tr( "DEVIDE_EDGE_NEW_OBJECT_NAME" ) ); resize(100,100); + SelectionIntoArgument(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx new file mode 100644 index 000000000..19cfe7a02 --- /dev/null +++ b/src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx @@ -0,0 +1,441 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// GEOM RepairGUI : GUI for Geometry component +// File : RepairGUI_LimitToleranceDlg.cxx + +#include "RepairGUI_LimitToleranceDlg.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#define DEFAULT_TOLERANCE_VALUE 1e-07 + +//================================================================================= +// class : RepairGUI_LimitToleranceDlg() +// purpose : Constructs a RepairGUI_LimitToleranceDlg 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. +//================================================================================= +RepairGUI_LimitToleranceDlg::RepairGUI_LimitToleranceDlg(GeometryGUI* theGeometryGUI, + QWidget* parent, bool modal) + : GEOMBase_Skeleton(theGeometryGUI, parent, modal) +{ + QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_LIMIT_TOLERANCE"))); + QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setWindowTitle(tr("GEOM_LIMIT_TOLERANCE_TITLE")); + + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle(tr("GEOM_LIMIT_TOLERANCE_TITLE")); + mainFrame()->RadioButton1->setIcon(image0); + mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->close(); + + GroupPoints = new DlgRef_1SelExt(centralWidget()); + GroupPoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS")); + GroupPoints->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE")); + GroupPoints->PushButton1->setIcon(image1); + GroupPoints->LineEdit1->setReadOnly(true); + + QLabel* aTolLab = new QLabel(tr("GEOM_TOLERANCE"), GroupPoints->Box); + myTolEdt = new SalomeApp_DoubleSpinBox(GroupPoints->Box); + initSpinBox(myTolEdt, 0., 100., DEFAULT_TOLERANCE_VALUE, "len_tol_precision"); + myTolEdt->setValue(DEFAULT_TOLERANCE_VALUE); + + QGridLayout* boxLayout = new QGridLayout(GroupPoints->Box); + boxLayout->setMargin(0); boxLayout->setSpacing(6); + boxLayout->addWidget(aTolLab, 0, 0); + boxLayout->addWidget(myTolEdt, 0, 2); + + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); + layout->setMargin(0); layout->setSpacing(6); + layout->addWidget(GroupPoints); + + setHelpFileName("limit_tolerance_operation_page.html"); + + Init(); +} + + +//================================================================================= +// function : ~RepairGUI_LimitToleranceDlg() +// purpose : Destroys the object and frees any allocated resources +//================================================================================= +RepairGUI_LimitToleranceDlg::~RepairGUI_LimitToleranceDlg() +{ +} + + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void RepairGUI_LimitToleranceDlg::Init() +{ + /* init variables */ + myEditCurrentArgument = GroupPoints->LineEdit1; + + myObject = GEOM::GEOM_Object::_nil(); + + //myGeomGUI->SetState(0); + //globalSelection(GEOM_COMPOUND); + + mainFrame()->GroupBoxPublish->show(); + + /* signals and slots connections */ + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed())); + + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + + initName(tr("LIMIT_TOLERANCE_NEW_OBJ_NAME")); + + ConstructorsClicked(0); + + activateSelection(); + updateButtonState(); +} + + +//================================================================================= +// function : ConstructorsClicked() +// purpose : Radio button management +//================================================================================= +void RepairGUI_LimitToleranceDlg::ConstructorsClicked(int constructorId) +{ + disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + + GroupPoints->show(); + GroupPoints->LineEdit1->setText(""); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setFocus(); + + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + + qApp->processEvents(); + updateGeometry(); + resize(minimumSizeHint()); + + updateButtonState(); + activateSelection(); + SelectionIntoArgument(); +} + + +//================================================================================= +// function : ClickOnOk() +// purpose : Same than click on apply but close this dialog. +//================================================================================= +void RepairGUI_LimitToleranceDlg::ClickOnOk() +{ + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool RepairGUI_LimitToleranceDlg::ClickOnApply() +{ + if (!onAcceptLocal()) + return false; + + initName(); + + ConstructorsClicked(0); + + return true; +} + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection +//================================================================================= +void RepairGUI_LimitToleranceDlg::SelectionIntoArgument() +{ + myEditCurrentArgument->setText(""); + myObject = GEOM::GEOM_Object::_nil(); + + LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO aSelList; + aSelMgr->selectedObjects(aSelList); + + if (aSelList.Extent() == 1) { + Handle(SALOME_InteractiveObject) anIO = aSelList.First(); + Standard_Boolean aRes; + myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes); + if (aRes) + myEditCurrentArgument->setText(GEOMBase::GetName(myObject)); + } + updateButtonState(); +} + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void RepairGUI_LimitToleranceDlg::SetEditCurrentArgument() +{ + const QObject* send = sender(); + if (send == GroupPoints->PushButton1) { + myEditCurrentArgument->setFocus(); + SelectionIntoArgument(); + } +} + +//================================================================================= +// function : LineEditReturnPressed() +// purpose : +//================================================================================= +void RepairGUI_LimitToleranceDlg::LineEditReturnPressed() +{ + const QObject* send = sender(); + if (send == GroupPoints->LineEdit1) { + myEditCurrentArgument = GroupPoints->LineEdit1; + GEOMBase_Skeleton::LineEditReturnPressed(); + } +} + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void RepairGUI_LimitToleranceDlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + activateSelection(); +} + +//================================================================================= +// function : enterEvent() +// purpose : Mouse enter onto the dialog to activate it +//================================================================================= +void RepairGUI_LimitToleranceDlg::enterEvent(QEvent*) +{ + if (!mainFrame()->GroupConstructors->isEnabled()) + ActivateThisDialog(); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr RepairGUI_LimitToleranceDlg::createOperation() +{ + return getGeomEngine()->GetIHealingOperations(getStudyId()); +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool RepairGUI_LimitToleranceDlg::isValid(QString& msg) +{ + double v = myTolEdt->value(); + bool ok = myTolEdt->isValid(msg, true); + return !myObject->_is_nil() && (v > 0.) && ok; +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool RepairGUI_LimitToleranceDlg::execute(ObjectList& objects) +{ + bool aResult = false; + objects.clear(); + + GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation()); + GEOM::GEOM_Object_var anObj = anOper->LimitTolerance(myObject, myTolEdt->value()); + aResult = !anObj->_is_nil(); + if (aResult) { + QStringList aParameters; + aParameters << myTolEdt->text(); + anObj->SetParameters(aParameters.join(":").toLatin1().constData()); + objects.push_back(anObj._retn()); + } + + return aResult; +} + +//================================================================ +// Function : onAccept +// Purpose : This method should be called from dialog's slots onOk() and onApply() +// It perfroms user input validation, then it +// performs a proper operation and manages transactions, etc. +//================================================================ +bool RepairGUI_LimitToleranceDlg::onAcceptLocal() +{ + if (!getStudy() || !(getStudy()->studyDS())) + return false; + + _PTR(Study) aStudy = getStudy()->studyDS(); + + bool aLocked = aStudy->GetProperties()->IsLocked(); + if (aLocked) { + MESSAGE("GEOMBase_Helper::onAccept - ActiveStudy is locked"); + SUIT_MessageBox::warning(this, tr("WRN_WARNING"), tr("WRN_STUDY_LOCKED"), tr("BUT_OK")); + return false; + } + + QString msg; + if (!isValid(msg)) { + showError(msg); + return false; + } + + try { + if (openCommand()) { + SUIT_OverrideCursor wc; + + myGeomGUI->getApp()->putInfo(""); + ObjectList objects; + + if (!execute(objects)) { + wc.suspend(); + abortCommand(); + showError(); + } + else { + const int nbObjs = objects.size(); + for (ObjectList::iterator it = objects.begin(); it != objects.end(); ++it) { + QString aName = getNewObjectName(); + if (nbObjs > 1) { + if (aName.isEmpty()) + aName = getPrefix(*it); + aName = GEOMBase::GetDefaultName(aName); + } + else { + // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName() + if (aName.isEmpty()) + aName = GEOMBase::GetDefaultName(getPrefix(*it)); + } + addInStudy(*it, aName.toLatin1().data()); + display(*it, false); + } + + if (nbObjs) { + commitCommand(); + updateObjBrowser(); + myGeomGUI->getApp()->putInfo(QObject::tr("GEOM_PRP_DONE")); + } + else { + abortCommand(); + } + + // JFA 28.12.2004 BEGIN // To enable warnings + GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation()); + if (!CORBA::is_nil(anOper) && !anOper->IsDone()) { + wc.suspend(); + QString msgw = QObject::tr(anOper->GetErrorCode()); + SUIT_MessageBox::warning(this, tr("WRN_WARNING"), msgw, tr("BUT_OK")); + } + // JFA 28.12.2004 END + } + } + } + catch(const SALOME::SALOME_Exception& e) { + SalomeApp_Tools::QtCatchCorbaException(e); + abortCommand(); + } + + updateViewer(); + activateSelection(); + updateButtonState(); + + return true; +} + +//================================================================================= +// function : activateSelection +// purpose : Activate selection +//================================================================================= +void RepairGUI_LimitToleranceDlg::activateSelection() +{ + disconnect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + + globalSelection(GEOM_ALLSHAPES); + if (myObject->_is_nil()) + SelectionIntoArgument(); + + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + updateViewer(); +} + +//================================================================================= +// function : updateButtonState +// purpose : Update button state +//================================================================================= +void RepairGUI_LimitToleranceDlg::updateButtonState() +{ + bool hasMainObj = !myObject->_is_nil(); + buttonOk()->setEnabled(hasMainObj); + buttonApply()->setEnabled(hasMainObj); +} + +//================================================================================= +// function : restoreSubShapes +// purpose : +//================================================================================= +void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theSObject) +{ + if (mainFrame()->CheckBoxRestoreSS->isChecked()) { + // empty list of arguments means that all arguments should be restored + getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, GEOM::ListOfGO(), + GEOM::FSM_GetInPlace, /*theInheritFirstArg=*/true, + mainFrame()->CheckBoxAddPrefix->isChecked()); + } +} diff --git a/src/RepairGUI/RepairGUI_LimitToleranceDlg.h b/src/RepairGUI/RepairGUI_LimitToleranceDlg.h new file mode 100644 index 000000000..bba1dbfff --- /dev/null +++ b/src/RepairGUI/RepairGUI_LimitToleranceDlg.h @@ -0,0 +1,83 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// GEOM GEOMGUI : GUI for Geometry component +// File : RepairGUI_LimitToleranceDlg.h + +#ifndef REPAIRGUI_LIMITTOLERANCEDLG_H +#define REPAIRGUI_LIMITTOLERANCEDLG_H + +#include + +class DlgRef_1SelExt; +class SalomeApp_DoubleSpinBox; +class QPushButton; +class QCheckBox; + +//================================================================================= +// class : RepairGUI_LimitToleranceDlg +// purpose : +//================================================================================= +class RepairGUI_LimitToleranceDlg : public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + RepairGUI_LimitToleranceDlg (GeometryGUI*, QWidget* = 0, bool = false); + ~RepairGUI_LimitToleranceDlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid (QString&); + virtual bool execute (ObjectList&); + virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr); + +private: + void Init(); + void enterEvent (QEvent*); + void initSelection(); + + bool onAcceptLocal(); + + void activateSelection(); + void updateButtonState(); + +private: + GEOM::GEOM_Object_var myObject; + + DlgRef_1SelExt* GroupPoints; + SalomeApp_DoubleSpinBox* myTolEdt; + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + + void ActivateThisDialog(); + + void LineEditReturnPressed(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); + + void ConstructorsClicked( int ); +}; + +#endif // REPAIRGUI_LIMITTOLERANCEDLG_H diff --git a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx index 51afbd167..1a654d7c0 100644 --- a/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx @@ -120,6 +120,7 @@ void RepairGUI_RemoveExtraEdgesDlg::Init() initName( tr( "REMOVE_EXTRA_EDGES_NEW_OBJ_NAME" ) ); resize(100,100); + SelectionIntoArgument(); } @@ -252,6 +253,7 @@ void RepairGUI_RemoveExtraEdgesDlg::enterEvent(QEvent* e) void RepairGUI_RemoveExtraEdgesDlg::activateSelection() { TColStd_MapOfInteger aTypes; + aTypes.Add( GEOM_SHELL ); aTypes.Add( GEOM_SOLID ); aTypes.Add( GEOM_COMPOUND ); globalSelection( aTypes ); diff --git a/src/RepairGUI/RepairGUI_SewingDlg.cxx b/src/RepairGUI/RepairGUI_SewingDlg.cxx index 8e5335068..006a929b8 100644 --- a/src/RepairGUI/RepairGUI_SewingDlg.cxx +++ b/src/RepairGUI/RepairGUI_SewingDlg.cxx @@ -137,6 +137,7 @@ void RepairGUI_SewingDlg::Init() initName( tr( "SEWING_NEW_OBJ_NAME" ) ); resize(100,100); + SelectionIntoArgument(); } diff --git a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx index cabf3749a..5e2871f1b 100755 --- a/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx +++ b/src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx @@ -224,7 +224,7 @@ void RepairGUI_ShapeProcessDlg::init() myBSpline2DCurveChk = new QCheckBox( tr("GEOM_2D_CURVE_MODE"), w ); myBSplineTol3D = new SalomeApp_DoubleSpinBox( w ); - initSpinBox( mySplitContTol3D, 0., 100., 1e-7, "len_tol_precision" ); + initSpinBox( myBSplineTol3D, 0., 100., 1e-7, "len_tol_precision" ); myBSplineTol2D = new SalomeApp_DoubleSpinBox( w ); initSpinBox( myBSplineTol2D, 0., 100., 1e-7, "param_tol_precision" ); @@ -322,6 +322,7 @@ void RepairGUI_ShapeProcessDlg::init() reset(); initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ) ); + selectionChanged(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx index 15796bc2f..2469cefe6 100644 --- a/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx +++ b/src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx @@ -246,9 +246,8 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument() aSelMgr->clearSelected(); Standard_Boolean isOk; - char* objIOR = GEOMBase::GetIORFromObject(myObject); - Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape(objIOR, isOk, true); - free(objIOR); + QString objIOR = GEOMBase::GetIORFromObject(myObject); + Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape(objIOR.toLatin1().constData(), isOk, true); if (!isOk || aSh.IsNull()) return; diff --git a/src/STEPImport/Makefile.am b/src/STEPImport/Makefile.am index 6a912182e..06b1224ba 100644 --- a/src/STEPImport/Makefile.am +++ b/src/STEPImport/Makefile.am @@ -43,4 +43,4 @@ libSTEPImport_la_CPPFLAGS = \ libSTEPImport_la_LDFLAGS = \ $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \ $(STDLIB) \ - $(CAS_LDPATH) -lTKSTEP + $(CAS_LDPATH) -lTKSTEP -lTKCAF -lTKLCAF -lTKSTEPBase diff --git a/src/STEPImport/STEPImport.cxx b/src/STEPImport/STEPImport.cxx index e6819dcb2..1983470bc 100644 --- a/src/STEPImport/STEPImport.cxx +++ b/src/STEPImport/STEPImport.cxx @@ -19,12 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File: STEPImport.cxx +// Created: Wed May 19 14:41:10 2004 +// Author: Pavel TELKOV -// File: STEPImport.cxx -// Created: Wed May 19 14:41:10 2004 -// Author: Pavel TELKOV -// -// #include "utilities.h" #include @@ -34,13 +32,31 @@ #include #include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include #include #include #include +#include #include +#include +#include +#include +#include + #include #include // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC @@ -70,11 +86,11 @@ extern "C" { -STEPIMPORT_EXPORT + STEPIMPORT_EXPORT TopoDS_Shape Import (const TCollection_AsciiString& theFileName, const TCollection_AsciiString& /*theFormatName*/, TCollection_AsciiString& theError, - const TDF_Label&) + const TDF_Label& theShapeLabel) { MESSAGE("Import STEP model from file " << theFileName.ToCString()); // Set "C" numeric locale to save numbers correctly @@ -87,7 +103,7 @@ STEPIMPORT_EXPORT //VRV: OCC 4.0 migration TopoDS_Compound compound; BRep_Builder B; - B.MakeCompound( compound ); + B.MakeCompound(compound); try { #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100 OCC_CATCH_SIGNALS; @@ -95,13 +111,13 @@ STEPIMPORT_EXPORT IFSelect_ReturnStatus status = aReader.ReadFile(theFileName.ToCString()); if (status == IFSelect_RetDone) { - Standard_Boolean failsonly = Standard_False ; - aReader.PrintCheckLoad (failsonly, IFSelect_ItemsByEntity); + Standard_Boolean failsonly = Standard_False; + aReader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity); /* Root transfers */ Standard_Integer nbr = aReader.NbRootsForTransfer(); - aReader.PrintCheckTransfer (failsonly, IFSelect_ItemsByEntity); + aReader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity); - for ( Standard_Integer n=1; n <= nbr; n++) { + for (Standard_Integer n = 1; n <= nbr; n++) { Standard_Boolean ok = aReader.TransferRoot(n); /* Collecting resulting entities */ Standard_Integer nbs = aReader.NbShapes(); @@ -116,22 +132,83 @@ STEPIMPORT_EXPORT break; } - for ( Standard_Integer i=1; i<=nbs; i++ ) { + for (Standard_Integer i = 1; i <= nbs; i++) { TopoDS_Shape aShape = aReader.Shape(i); - if ( aShape.IsNull() ) { + if (aShape.IsNull()) { // THROW_SALOME_CORBA_EXCEPTION("Null shape in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM) ; //return aResShape; continue; } else { - B.Add( compound, aShape ) ; + B.Add(compound, aShape); } } } - if ( aResShape.IsNull() ) + if (aResShape.IsNull()) aResShape = compound; - } else { + // BEGIN: Store names of sub-shapes from file + TopTools_IndexedMapOfShape anIndices; + TopExp::MapShapes(aResShape, anIndices); + + Handle(Interface_InterfaceModel) Model = aReader.WS()->Model(); + Handle(XSControl_TransferReader) TR = aReader.WS()->TransferReader(); + if (!TR.IsNull()) { + Handle(Transfer_TransientProcess) TP = TR->TransientProcess(); + Handle(Standard_Type) tPD = STANDARD_TYPE(StepBasic_ProductDefinition); + + Standard_Integer nb = Model->NbEntities(); + for (Standard_Integer ie = 1; ie <= nb; ie++) { + Handle(Standard_Transient) enti = Model->Value(ie); + if (enti->DynamicType() != tPD) continue; + + Handle(StepBasic_ProductDefinition) PD = + Handle(StepBasic_ProductDefinition)::DownCast(enti); + if (PD.IsNull()) continue; + + Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct(); + if (Prod->Name()->UsefullLength() <= 0) continue; + + Handle(TCollection_HAsciiString) aName = Prod->Name(); + TCollection_ExtendedString aNameExt (aName->ToCString()); + + // special check to pass names like "Open CASCADE STEP translator 6.3 1" + TCollection_AsciiString aSkipName ("Open CASCADE STEP translator"); + if (aName->Length() >= aSkipName.Length()) { + if (aName->String().SubString(1, aSkipName.Length()).IsEqual(aSkipName)) + continue; + } + + // find target shape + Handle(Transfer_Binder) binder = TP->Find(enti); + if (binder.IsNull()) continue; + TopoDS_Shape S = TransferBRep::ShapeResult(binder); + if (S.IsNull()) continue; + + // as PRODUCT can be included in the main shape + // several times, we look here for all iclusions. + Standard_Integer isub, nbSubs = anIndices.Extent(); + for (isub = 1; isub <= nbSubs; isub++) + { + TopoDS_Shape aSub = anIndices.FindKey(isub); + if (aSub.IsPartner(S)) { + // create label and set shape + TDF_Label L; + TDF_TagSource aTag; + L = aTag.NewChild(theShapeLabel); + TNaming_Builder tnBuild (L); + //tnBuild.Generated(S); + tnBuild.Generated(aSub); + + // set a name + TDataStd_Name::Set(L, aNameExt); + } + } + } + } + // END: Store names + } + else { // switch (status) { // case IFSelect_RetVoid: // theError = "Nothing created or No data to process"; diff --git a/src/TransformationGUI/Makefile.am b/src/TransformationGUI/Makefile.am index 92153168d..1038e4955 100644 --- a/src/TransformationGUI/Makefile.am +++ b/src/TransformationGUI/Makefile.am @@ -97,4 +97,6 @@ libTransformationGUI_la_CPPFLAGS = \ libTransformationGUI_la_LDFLAGS = \ ../GEOMFiltersSelection/libGEOMFiltersSelection.la \ - ../GEOMBase/libGEOMBase.la + ../GEOMBase/libGEOMBase.la \ + $(CAS_LDPATH) -lTKShHealing + diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index 5034aee88..18c96f017 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -197,6 +197,12 @@ bool TransformationGUI_MirrorDlg::ClickOnApply() return false; initName(); + + myObjects.length(0); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; @@ -266,7 +272,7 @@ void TransformationGUI_MirrorDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = findObjectInFather(myArgument, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); myArgument = aShapesOp->GetSubShape(myArgument, anIndex); @@ -524,5 +530,5 @@ void TransformationGUI_MirrorDlg::addSubshapesToStudy() return; } addSubshapesToFather(objMap); - } + } } diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 643c5c8d8..aebe44d82 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -153,6 +153,8 @@ void TransformationGUI_MultiRotationDlg::Init() myBase = myVector = GEOM::GEOM_Object::_nil(); + mainFrame()->GroupBoxPublish->show(); + // signals and slots connections connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -332,7 +334,7 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); myVector = aShapesOp->GetSubShape(aSelectedObject, anIndex); @@ -620,3 +622,24 @@ void TransformationGUI_MultiRotationDlg::addSubshapesToStudy() } addSubshapesToFather(objMap); } + +//================================================================================= +// function : restoreSubShapes +// purpose : +//================================================================================= +void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theSObject) +{ + if (mainFrame()->CheckBoxRestoreSS->isChecked()) { + // we pass here the first operation argument (object) through the list of arguments + // because the rotation operation place its arguments in the data structure in another order, + // and we need to point the first argument directly + GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; + anArgs->length(1); + anArgs[0] = myBase; + getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + /*theFindMethod=*/GEOM::FSM_Transformed, + /*theInheritFirstArg=*/true, + mainFrame()->CheckBoxAddPrefix->isChecked()); + } +} diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h index c8f05b819..b0874fa41 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.h @@ -51,6 +51,7 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); + virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); private: void Init(); diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index fc0ddd472..36f2a54dc 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -32,8 +32,14 @@ #include #include +#include +#include +#include #include #include +#include +#include +#include // OCCT Includes #include @@ -42,6 +48,10 @@ #include #include #include +#include +#include +#include +#include #include @@ -160,6 +170,8 @@ void TransformationGUI_MultiTranslationDlg::Init() myBase = myVectorU = myVectorV = GEOM::GEOM_Object::_nil(); + mainFrame()->GroupBoxPublish->show(); + // signals and slots connections connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); @@ -353,7 +365,7 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); if (myEditCurrentArgument == GroupDimensions->LineEdit3) @@ -678,6 +690,7 @@ bool TransformationGUI_MultiTranslationDlg::execute (ObjectList& objects) switch (getConstructorId()) { case 0: if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU)) { + createPathPreview ( myVectorU ); anObj = anOper->MultiTranslate1D(myBase, myVectorU, myStepU, myNbTimesU); if(!IsPreview()) { aParameters<SpinBox_DX->text(); @@ -689,6 +702,8 @@ bool TransformationGUI_MultiTranslationDlg::execute (ObjectList& objects) case 1: if (!CORBA::is_nil(myBase) && !CORBA::is_nil(myVectorU) && !CORBA::is_nil(myVectorV)) { + createPathPreview ( myVectorU ); + createPathPreview ( myVectorV ); anObj = anOper->MultiTranslate2D(myBase, myVectorU, myStepU, myNbTimesU, myVectorV, myStepV, myNbTimesV); @@ -731,3 +746,50 @@ void TransformationGUI_MultiTranslationDlg::addSubshapesToStudy() } addSubshapesToFather(objMap); } + +//================================================================================= +// function : restoreSubShapes +// purpose : +//================================================================================= +void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_ptr theStudy, + SALOMEDS::SObject_ptr theSObject) +{ + if (mainFrame()->CheckBoxRestoreSS->isChecked()) { + // we pass here the first operation argument (object) through the list of arguments + // because the rotation operation place its arguments in the data structure in another order, + // and we need to point the first argument directly + GEOM::ListOfGO_var anArgs = new GEOM::ListOfGO; + anArgs->length(1); + anArgs[0] = myBase; + getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, + /*theFindMethod=*/GEOM::FSM_Transformed, + /*theInheritFirstArg=*/true, + mainFrame()->CheckBoxAddPrefix->isChecked()); + } +} + +//================================================================================= +// function : createPathPreview +// purpose : +//================================================================================= +void TransformationGUI_MultiTranslationDlg::createPathPreview ( GEOM::GEOM_Object_var thePath ) +{ + if ( IsPreview() ) { + TopoDS_Shape aShape; + GEOMBase::GetShape( thePath, aShape, TopAbs_SHAPE ); + TopoDS_Edge anEdge = TopoDS::Edge( aShape ); + ShapeAnalysis_Edge aShapeAnal; + TopoDS_Vertex aFirst = aShapeAnal.FirstVertex( anEdge ); + TopoDS_Vertex aLast = aShapeAnal.LastVertex( anEdge ); + TopoDS_Shape aVector = BRepBuilderAPI_MakeEdge(BRep_Tool::Pnt(aFirst), BRep_Tool::Pnt(aLast)).Shape(); + const char* aName = "tmpVector"; + Handle(GEOM_AISVector) anIO = new GEOM_AISVector( aVector, aName ); + + // add Prs to preview + SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + SOCC_Prs* aPrs = dynamic_cast(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); + if (aPrs) + aPrs->AddObject(anIO); + GEOMBase_Helper::displayPreview( aPrs, false, true ); + } +} diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h index 3e1f146d8..ec4904819 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h @@ -51,10 +51,12 @@ protected: virtual bool isValid( QString& ); virtual bool execute( ObjectList& ); virtual void addSubshapesToStudy(); + virtual void restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr ); private: void Init(); void enterEvent( QEvent* ); + void createPathPreview( GEOM::GEOM_Object_var ); private: GEOM::GEOM_Object_var myBase, myVectorU, myVectorV; diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx index 288eae6c0..da9067e0f 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx @@ -91,7 +91,6 @@ TransformationGUI_PositionDlg::TransformationGUI_PositionDlg // Activate Create a Copy mode Group1->CheckButton1->setChecked(true); - Group1->CheckButton1->setChecked(false); CreateCopyModeChanged(true); Init(); @@ -300,6 +299,12 @@ bool TransformationGUI_PositionDlg::ClickOnApply() return false; initName(); + + myObjects.length(0); + myEditCurrentArgument = Group1->LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; @@ -340,8 +345,8 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument() else myEditCurrentArgument->setText(aName); - if (getConstructorId() == 2) - Group1->PushButton5->click(); + /* if (getConstructorId() == 2) + Group1->PushButton5->click();*/ } else if (myEditCurrentArgument == Group1->LineEdit2) { if (aSelList.Extent() != 1) @@ -401,7 +406,7 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); @@ -628,7 +633,6 @@ bool TransformationGUI_PositionDlg::execute (ObjectList& objects) case 1: { for (int i = 0; i < myObjects.length(); i++) { - if (toCreateCopy) anObj = toCreateCopy ? anOper->PositionShapeCopy(myObjects[i], myStartLCS, myEndLCS) : anOper->PositionShape(myObjects[i], myStartLCS, myEndLCS); diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index deeeabc6e..c999df5a2 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -236,6 +236,12 @@ bool TransformationGUI_RotationDlg::ClickOnApply() return false; initName(); + + myObjects.length(0); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; @@ -311,7 +317,7 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index 5dd32300b..17023381f 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -202,6 +202,9 @@ void TransformationGUI_ScaleDlg::ConstructorsClicked (int constructorId) { disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); + myPoint = GEOM::GEOM_Object::_nil(); + LineEdit2->clear(); + switch (constructorId) { case 0: // translation an object by dx, dy, dz TextLabel3->setText(tr("GEOM_SCALE_FACTOR")); @@ -258,6 +261,12 @@ bool TransformationGUI_ScaleDlg::ClickOnApply() return false; initName(tr("GEOM_SCALE")); + + myObjects.length(0); + myEditCurrentArgument = LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; @@ -319,7 +328,7 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index 73a7694b2..292af61f6 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -32,16 +32,27 @@ #include #include +#include +#include +#include #include #include +#include +#include +#include // OCCT Includes #include #include +#include #include #include #include #include +#include +#include +#include +#include #include @@ -272,6 +283,12 @@ bool TransformationGUI_TranslationDlg::ClickOnApply() return false; initName(); + + myObjects.length(0); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText(""); + myGeomGUI->getApp()->selectionMgr()->clearSelected(); + // activate selection and connect selection manager ConstructorsClicked(getConstructorId()); return true; @@ -359,7 +376,7 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument() //Find SubShape Object in Father GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aSelectedObject, aName); - if (aFindedObject == GEOM::GEOM_Object::_nil()) { // Object not found in study + if (aFindedObject->_is_nil()) { // Object not found in study GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId()); aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex); @@ -623,6 +640,8 @@ bool TransformationGUI_TranslationDlg::execute (ObjectList& objects) QStringList aParameters; aParameters<SpinBox3->text(); bool byDistance = GroupPoints->CheckBox1->isChecked(); + createPathPreview( myVector ); + if (byDistance) { double aDistance = GroupPoints->SpinBox3->value(); for (int i = 0; i < myObjects.length(); i++) { @@ -727,3 +746,29 @@ void TransformationGUI_TranslationDlg::addSubshapesToStudy() addSubshapesToFather(objMap); } } + +//================================================================================= +// function : createPathPreview +// purpose : +//================================================================================= +void TransformationGUI_TranslationDlg::createPathPreview ( GEOM::GEOM_Object_var thePath ) +{ + if ( IsPreview() ) { + TopoDS_Shape aShape; + GEOMBase::GetShape( thePath, aShape, TopAbs_SHAPE ); + TopoDS_Edge anEdge = TopoDS::Edge( aShape ); + ShapeAnalysis_Edge aShapeAnal; + TopoDS_Vertex aFirst = aShapeAnal.FirstVertex( anEdge ); + TopoDS_Vertex aLast = aShapeAnal.LastVertex( anEdge ); + TopoDS_Shape aVector = BRepBuilderAPI_MakeEdge(BRep_Tool::Pnt(aFirst), BRep_Tool::Pnt(aLast)).Shape(); + const char* aName = "tmpVector"; + Handle(GEOM_AISVector) anIO = new GEOM_AISVector( aVector, aName ); + + // add Prs to preview + SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + SOCC_Prs* aPrs = dynamic_cast(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0)); + if (aPrs) + aPrs->AddObject(anIO); + GEOMBase_Helper::displayPreview( aPrs, false, true ); + } +} diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.h b/src/TransformationGUI/TransformationGUI_TranslationDlg.h index 2d064dabb..02c437fd5 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.h +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.h @@ -55,6 +55,7 @@ protected: private: void Init(); void enterEvent( QEvent* ); + void createPathPreview( GEOM::GEOM_Object_var ); private: GEOM::ListOfGO myObjects; diff --git a/src/VTKExport/Makefile.am b/src/VTKExport/Makefile.am new file mode 100644 index 000000000..31c22b3d0 --- /dev/null +++ b/src/VTKExport/Makefile.am @@ -0,0 +1,45 @@ +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +# + +# $Header$ +# +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +# header files +salomeinclude_HEADERS = + +# Libraries targets +lib_LTLIBRARIES = libVTKExport.la + +dist_libVTKExport_la_SOURCES = \ + VTKExport.cxx + +# additional information to compile and link file + +libVTKExport_la_CPPFLAGS = \ + $(CAS_CPPFLAGS) \ + $(VTK_INCLUDES) \ + $(KERNEL_CXXFLAGS) \ + -I$(srcdir)/../OCC2VTK + +libVTKExport_la_LDFLAGS = \ + ../OCC2VTK/libOCC2VTK.la \ + $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics \ + $(STDLIB) \ + $(CAS_LDPATH) diff --git a/src/VTKExport/VTKExport.cxx b/src/VTKExport/VTKExport.cxx new file mode 100644 index 000000000..4d0f3ac7a --- /dev/null +++ b/src/VTKExport/VTKExport.cxx @@ -0,0 +1,144 @@ +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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: VTKExport.cxx +// Author: Oleg UVAROV +// +#include "utilities.h" + +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#ifdef WIN32 +# if defined VTKEXPORT_EXPORTS || defined VTKExport_EXPORTS +# define VTKEXPORT_EXPORT __declspec( dllexport ) +# else +# define VTKEXPORT_EXPORT __declspec( dllimport ) +# endif +#else +# define VTKEXPORT_EXPORT +#endif + +//============================================================================= +/*! + * + */ +//============================================================================= + +extern "C" +{ + VTKEXPORT_EXPORT + int Export(const TopoDS_Shape& theShape, + const TCollection_AsciiString& theFileName, + const TCollection_AsciiString& theFormatName) + { + MESSAGE("Export VTK into file " << theFileName.ToCString()); + + try + { + GEOM_VertexSource* myVertexSource = GEOM_VertexSource::New(); + GEOM_EdgeSource* myIsolatedEdgeSource = GEOM_EdgeSource::New(); + GEOM_EdgeSource* myOneFaceEdgeSource = GEOM_EdgeSource::New(); + GEOM_EdgeSource* mySharedEdgeSource = GEOM_EdgeSource::New(); + GEOM_WireframeFace* myWireframeFaceSource = GEOM_WireframeFace::New(); + GEOM_ShadingFace* myShadingFaceSource = GEOM_ShadingFace::New(); + + vtkAppendPolyData* myAppendFilter = vtkAppendPolyData::New(); + myAppendFilter->AddInput( myVertexSource->GetOutput() ); + myAppendFilter->AddInput( myIsolatedEdgeSource->GetOutput() ); + myAppendFilter->AddInput( myOneFaceEdgeSource->GetOutput() ); + myAppendFilter->AddInput( mySharedEdgeSource->GetOutput() ); + //myAppendFilter->AddInput( myWireframeFaceSource->GetOutput() ); // iso-lines are unnecessary + myAppendFilter->AddInput( myShadingFaceSource->GetOutput() ); + + float aDeflection = 1.0; + bool anIsForced = true; + bool anIsRelative = false; + bool anIsVector = false; + + GEOM::MeshShape( theShape, aDeflection, anIsForced ); + + TopExp_Explorer aVertexExp( theShape, TopAbs_VERTEX ); + for( ; aVertexExp.More(); aVertexExp.Next() ) + { + const TopoDS_Vertex& aVertex = TopoDS::Vertex( aVertexExp.Current() ); + myVertexSource->AddVertex( aVertex ); + } + + GEOM::MeshShape2( theShape, aDeflection, anIsRelative ); + + TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap; + TopExp::MapShapesAndAncestors( theShape, TopAbs_EDGE, TopAbs_FACE, anEdgeMap ); + + GEOM::SetShape( theShape, + anEdgeMap, + anIsVector, + myIsolatedEdgeSource, + myOneFaceEdgeSource, + mySharedEdgeSource, + myWireframeFaceSource, + myShadingFaceSource ); + + myAppendFilter->Update(); + + // Set "C" numeric locale to save numbers correctly + Kernel_Utils::Localizer loc; + + vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New(); + aWriter->SetInput( myAppendFilter->GetOutput() ); + aWriter->SetFileName( theFileName.ToCString() ); + aWriter->Write(); + aWriter->Delete(); + + myVertexSource->Delete(); + myIsolatedEdgeSource->Delete(); + myOneFaceEdgeSource->Delete(); + mySharedEdgeSource->Delete(); + myWireframeFaceSource->Delete(); + myShadingFaceSource->Delete(); + + myAppendFilter->Delete(); + + return 1; + } + catch(Standard_Failure) + { + //THROW_SALOME_CORBA_EXCEPTION("Exception catched in VTKExport", SALOME::BAD_PARAM); + } + return 0; + } +} diff --git a/src/VTKExport/VTKExport.pro b/src/VTKExport/VTKExport.pro new file mode 100644 index 000000000..ddc34fe23 --- /dev/null +++ b/src/VTKExport/VTKExport.pro @@ -0,0 +1,47 @@ +# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, 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 +# + +TEMPLATE = lib +TARGET = VTKExport +DESTDIR = ../../lib +MOC_DIR = ../../moc +OBJECTS_DIR = ../../obj/$$TARGET + +CASROOT = $$(CASROOT) +CAS_CPPFLAGS = $${CASROOT}/inc + +KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome + +KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome + +STDLIB = -lstdc++ + +CAS_LDPATH = -L$$(CASROOT)/Linux/lib + +INCLUDEPATH += $${CAS_CPPFLAGS} $${KERNEL_CXXFLAGS} + +LIBS += $${STDLIB} $${CAS_LDPATH} $${KERNEL_LDFLAGS} -lSALOMELocalTrace + +CONFIG -= debug release debug_and_release +CONFIG += qt thread debug dll shared + +win32:DEFINES += WIN32 +DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS + +SOURCES = VTKExport.cxx