DIST_SUBDIRS = idl adm_local resources src doc bin
-DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh
+DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool
salomeinclude_DATA = GEOM_version.h
$(pwd)/hack_libtool \1 \"\$[@]\" \n\
}\n\
CC=\"hack_libtool\"%g" libtool
+sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
+sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
+sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1 if ! test -d \$sss; then continue; fi\n\1 ssss=\$(cd \$sss; pwd)\n\1 if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1 case \$ssss in\n\1 /usr/lib | /usr/lib64 ) ;;\n\1 * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1 esac\n\1 fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
],[])
# This list is initiated using autoscan and must be updated manually
GEOM_version.h \
doc/Makefile \
doc/docutils/Makefile \
+ doc/docutils/conf.py \
doc/salome/Makefile \
doc/salome/gui/Makefile \
doc/salome/gui/GEOM/Makefile \
mkdir -p html doctrees
PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH} \
LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH} \
- $(SPHINXBUILD) -W -b html $(ALLSPHINXOPTS) html
+ $(SPHINXBUILD) -c $(top_builddir)/doc/docutils -W -b html $(ALLSPHINXOPTS) html
@echo
@echo "Build finished. The HTML pages are in html."
mkdir -p latex doctrees
PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH} \
LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH} \
- $(SPHINXBUILD) -W -b latex $(ALLSPHINXOPTS) latex
+ $(SPHINXBUILD) -c $(top_builddir)/doc/docutils -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" \
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; \
+++ /dev/null
-# -*- 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 = '6.2.0'
-# The full version, including alpha/beta/rc tags.
-release = '6.2.0'
-
-# 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
-# "<project> v<release> 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/<name>.
-html_copy_source = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> 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
--- /dev/null
+# -*- 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 = '@VERSION@'
+# The full version, including alpha/beta/rc tags.
+release = '@VERSION@'
+
+# 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
+# "<project> v<release> 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/<name>.
+html_copy_source = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> 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
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
-EXTRA_DIST += images input static/footer.html static/doxygen.css
+EXTRA_DIST += images input static/footer.html static/doxygen.css static/SALOME_BOA_PA.pdf
guidocdir = $(docdir)/gui/GEOM
-guidoc_DATA = images/head.png
+guidoc_DATA = images/head.png static/SALOME_BOA_PA.pdf
usr_docs: doxyfile_tui doxyfile_py doxyfile
echo "===========================================" ; \
\page common_operation_page Common
-\n To produce a \b Common operation in the <b>Main Menu</b> select <b>Operations - > Boolean - > Common</b>
+For detail description of the Boolean operations please refer to
+<a href="SALOME_BOA_PA.pdf">this document</a>.
+It provides a general review of the Partition and Boolean
+operations algorithms, describes the usage methodology and highlighs
+major limitations of these operations.
-\n This operation cuts the common part of two shapes and transforms it into an independent geometrical object.
+To produce a \b Common operation in the <b>Main Menu</b> select <b>Operations - > Boolean - > Common</b>
-\n The \b Result will be any \b GEOM_Object.
-\n <b>TUI Command:</b> <em>geompy.MakeCommon(s1, s2)</em>
-\n <b>Arguments:</b> Name + 2 shapes.
-\n <b>Advanced option:</b>
- \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
+This operation cuts the common part of two shapes and transforms it into an independent geometrical object.
+
+The \b Result will be any \b GEOM_Object.
+<b>TUI Command:</b> <em>geompy.MakeCommon(s1, s2)</em>
+<b>Arguments:</b> Name + 2 shapes.
+<b>Advanced option:</b>
+\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
\image html bool2.png
-\n <b>Example:</b>
+<b>Example:</b>
\image html fusesn1.png "The initial shapes"
\page cut_operation_page Cut
-\n To produce a \b Cut operation in the <b>Main Menu</b> select <b>Operations - > Boolean - > Cut</b>
+For detail description of the Boolean operations please refer to
+<a href="SALOME_BOA_PA.pdf">this document</a>.
+It provides a general review of the Partition and Boolean
+operations algorithms, describes the usage methodology and highlighs
+major limitations of these operations.
-\n This operation cuts a shape with another one.
-\n The \b Result will be any \b GEOM_Object.
-\n <b>Arguments:</b> Name + 2 shapes.
-\n <b>Advanced option:</b>
- \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
+To produce a \b Cut operation in the <b>Main Menu</b> select <b>Operations - > Boolean - > Cut</b>
-\n <b>Dialog Box:</b>
+This operation cuts a shape with another one.
+The \b Result will be any \b GEOM_Object.
+<b>Arguments:</b> Name + 2 shapes.
+<b>Advanced option:</b>
+\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
+
+<b>Dialog Box:</b>
\image html bool3.png
-\n <b>Example:</b>
+<b>Example:</b>
\image html fusesn1.png "The initial shapes"
\page fuse_operation_page Fuse
-\n To produce a \b Fuse operation in the <b>Main Menu</b> select
+For detail description of the Boolean operations please refer to
+<a href="SALOME_BOA_PA.pdf">this document</a>.
+It provides a general review of the Partition and Boolean
+operations algorithms, describes the usage methodology and highlighs
+major limitations of these operations.
+
+To produce a \b Fuse operation in the <b>Main Menu</b> select
<b>Operations - > Boolean - > Fuse</b>
-\n This operation creates a shape from two shapes.
+This operation creates a shape from two shapes.
-\n The \b Result will be any \b GEOM_Object.
-\n <b>TUI Command:</b> <em>geompy.MakeFuse(s1, s2)</em>
-\n <b>Arguments:</b> Name + 2 shapes.
-\n <b>Advanced option:</b>
- \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
+The \b Result will be any \b GEOM_Object.
+<b>TUI Command:</b> <em>geompy.MakeFuse(s1, s2)</em>
+<b>Arguments:</b> Name + 2 shapes.
+<b>Advanced option:</b>
+\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
\image html bool1.png
-\n <b>Example:</b>
+<b>Example:</b>
\image html fusesn1.png "The initial shapes"
\image html image3.png "Example of Geometry module usage for engineering tasks"
+There are also \subpage related_docs_page "additional reference documents"
+for Geometry module that can be useful.
*/
\page partition_page Partition
+For detail description of the Partition operation please refer to
+<a href="SALOME_BOA_PA.pdf">this document</a>.
+It provides a general review of the Partition and Boolean
+operations algorithms, describes the usage methodology and highlighs
+major limitations of these operations.
+
To produce a \b Partition in the <b>Main Menu</b> select <b>Operations - > Partition</b>
This operation builds a compound by intersection of several shapes
--- /dev/null
+/*!
+\page related_docs_page Related Documents
+
+Here you can find additional reference documents for Geometry module
+that can be useful for reading.
+
+<a href="SALOME_BOA_PA.pdf">General Fuse Algorithm, Partition
+Algorithm, Boolean Operations Algorithm. Backgrounds.</a>
+
+*/
\page section_opeartion_page Section
-\n To produce a \b Section operation in the <b>Main Menu</b> select
+For detail description of the Boolean operations please refer to
+<a href="SALOME_BOA_PA.pdf">this document</a>.
+It provides a general review of the Partition and Boolean
+operations algorithms, describes the usage methodology and highlighs
+major limitations of these operations.
+
+To produce a \b Section operation in the <b>Main Menu</b> select
<b>Operations - > Boolean - > Section</b>
-\n This operation creates the section between 2 shapes.
+This operation creates the section between 2 shapes.
-\n The \b Result will be any \b GEOM_Object (EDGE or WIRE).
-\n <b>TUI Command:</b> <em>geompy.MakeSection(s1, s2)</em>
-\n <b>Arguments:</b> Name + 2 shapes.
-\n <b>Advanced option:</b>
- \ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
+The \b Result will be any \b GEOM_Object (EDGE or WIRE).
+<b>TUI Command:</b> <em>geompy.MakeSection(s1, s2)</em>
+<b>Arguments:</b> Name + 2 shapes.
+<b>Advanced option:</b>
+\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
\image html neo-section.png
-\n <b>Example:</b>
+<b>Example:</b>
\image html fusesn1.png "The initial shapes"
print Descr
\endcode
+<br><h2>NbShapes and ShapeInfo</h2>
+
+\code
+import geompy
+
+# create a box
+box = geompy.MakeBoxDXDYDZ(100,30,100)
+nbSolids = geompy.NbShapes(box, geompy.ShapeType["SOLID"])
+print "\nBox 100x30x100 quantity of solids:", nbSolids
+boxInfo = geompy.ShapeInfo(box)
+print "\nBox 100x30x100 shapes:"
+print boxInfo
+\endcode
+
<br><h2>Check Shape</h2>
\code
\page using_boolean_operations_page Using Boolean Operations
-\n You can use the following boolean operations for construction of more
+For detail description of the Boolean operations please refer to
+<a href="SALOME_BOA_PA.pdf">this document</a>.
+It provides a general review of the Partition and Boolean
+operations algorithms, describes the usage methodology and highlighs
+major limitations of these operations.
+
+You can use the following boolean operations for construction of more
complex geometrical objects (2D & 3D elements):
<ul>
<em>geompy.MakeSection(Shape1, Shape2)</em>, where \em Shape1 and \em
Shape2 is the second argument of Section operation;
-\n Our <b>TUI Scripts</b> provide you with useful examples of the use of
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_boolean_operations_page "Boolean Operations".
*/
FSM_GetShapesOnShape,
/*! Use GetInPlaceByHistory method (can work only after Partition) */
- FSM_GetInPlaceByHistory
+ FSM_GetInPlaceByHistory,
+
+ /*! To be used only for multi-transformation result.
+ * Only this method can be used after multi-transformation.
+ */
+ FSM_MultiTransformed
};
/*!
* 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()
+ * \sa GetShapeType(), GetTopologyType(), GetMaxShapeType()
*/
shape_type GetMinShapeType();
+ /*!
+ * Get a maximal 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(), GetMinShapeType()
+ */
+ shape_type GetMaxShapeType();
+
/*!
* Set name of the object.
* \param theName is a name which will be associated with this 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);
+ /*!
+ * Transform the shape in the same way what was used for the sample shape creation.
+ * \param theObject The object to be transformed.
+ * \param theSample The object containing information about required transformation.
+ * \note Implementation of this method is limited by multi-transformations now.
+ * \note Internal method.
+ * \return New GEOM_Object, containing the transformed shape.
+ */
+ GEOM_Object TransformLikeOtherCopy (in GEOM_Object theObject,
+ in GEOM_Object theSample);
+
/*!
* Recompute the shape from its arguments.
* \param theObject The object to be recomputed.
void MakeInternalShells(const TopTools_MapOfShape& ,
TopTools_ListOfShape& );
-//modified by NIZNHY-PKV Tue Aug 5 15:06:50 2008f
static
- Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell);
-//modified by NIZNHY-PKV Tue Aug 5 15:06:57 2008t
+ Standard_Boolean IsClosedShell(const TopoDS_Shell& );
+
+//modified by NIZNHY-PKV Tue Oct 26 13:30:39 2010f
+static
+ Standard_Boolean RefineShell(const TopoDS_Shell& ,
+ TopoDS_Shell& );
+//modified by NIZNHY-PKV Tue Oct 26 13:30:42 2010t
//=======================================================================
//function :
if (!myShapesToAvoid.Contains(aF)) {
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
}
- else {
- int a=0;
+ /*
+ else {
+ int a=0;
}
+ */
}
aNbE=aMEF.Extent();
//
// 2. myFacesToAvoid
for (i=1; i<=aNbE; ++i) {
- const TopoDS_Edge& aE=TopoDS::Edge(aMEF.FindKey(i));
+ const TopoDS_Edge& aE=*((TopoDS_Edge*)(&aMEF.FindKey(i)));
if (BRep_Tool::Degenerated(aE)) {
continue;
}
//
aOrE=aE.Orientation();
//
- const TopoDS_Face& aF1=TopoDS::Face(aLF.First());
+ const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First()));
if (aNbF==1) {
if (aOrE==TopAbs_INTERNAL) {
continue;
myShapesToAvoid.Add(aF1);
}
else if (aNbF==2) {
- const TopoDS_Face& aF2=TopoDS::Face(aLF.Last());
+ const TopoDS_Face& aF2=*((TopoDS_Face*)(&aLF.Last()));
if (aF2.IsSame(aF1)) {
if (BRep_Tool::IsClosed(aE, aF1)) {
continue;
myShapesToAvoid.Add(aF2);
}
}
- //DEB
+ /*//DEB
else {
TopTools_ListIteratorOfListOfShape aItLF;
//
int a=0;
}
}
- //DEB
+ *///DEB
}// for (i=1; i<=aNbE; ++i) {
//
if (!bFound) {
//
myLoops.Clear();
//
- Standard_Integer aNbLF, aNbOff, aNbFP, aNbFA;
+ Standard_Integer aNbLF, aNbOff, aNbFP;
TopAbs_Orientation anOr;
TopoDS_Edge aEL;
BRep_Builder aBB;
NMTTools_CoupleOfShape aCSOff;
- TopTools_MapOfOrientedShape AddedFacesMap;//, aMFP;
+ TopTools_MapOfOrientedShape AddedFacesMap;
TopTools_IndexedDataMapOfShapeListOfShape aEFMap, aMEFP;
TopTools_ListIteratorOfListOfShape aItF, aIt;
TopTools_MapIteratorOfMapOfOrientedShape aItM;
// loop on faces added to Shell; add their neighbor faces to Shell and so on
TopoDS_Iterator aItAddedF (aShell);
for (; aItAddedF.More(); aItAddedF.Next()) {
- const TopoDS_Face& aF = TopoDS::Face(aItAddedF.Value());
+ const TopoDS_Face& aF = *((TopoDS_Face*)(&aItAddedF.Value()));
//
// loop on edges of aF; find a good neighbor face of aF by aE
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
for (; aEdgeExp.More(); aEdgeExp.Next()) {
- const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
+ const TopoDS_Edge& aE=*((TopoDS_Edge*)(&aEdgeExp.Current()));
//
//1
if (aMEFP.Contains(aE)) {
//
aItLF.Initialize(aLF);
for (; aItLF.More(); aItLF.Next()) {
- const TopoDS_Face& aFL=TopoDS::Face(aItLF.Value());
+ const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItLF.Value()));
if (myShapesToAvoid.Contains(aFL)) {
continue;
}
//
TopoDS_Face aSelF;
if (aNbOff==1) {
- aSelF=TopoDS::Face(aLCSOff.First().Shape2());
+ aSelF=*((TopoDS_Face*)(&aLCSOff.First().Shape2()));
}
else if (aNbOff>1){
GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF);
}
} // for (; aEdgeExp.More(); aEdgeExp.Next()) {
} //for (; aItAddedF.More(); aItAddedF.Next()) {
- //modified by NIZNHY-PKV Tue Aug 5 15:07:08 2008f
- //myLoops.Append(aShell);
+ //
if (IsClosedShell(aShell)) {
myLoops.Append(aShell);
}
- /*
+ //modified by NIZNHY-PKV Wed Oct 27 07:10:41 2010f
else {
- TopoDS_Iterator aItS;
- aItS.Initialize(aShell);
- for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aFs=aItS.Value();
- aMFP.Add(aFs);
+ Standard_Boolean bRefine;
+ TopoDS_Shell aShx;
+ //
+ bRefine=RefineShell(aShell, aShx);
+ if (bRefine) {
+ myLoops.Append(aShx);
}
}
- */
- //modified by NIZNHY-PKV Tue Aug 5 15:07:30 2008t
- } // for (; aItF.More(); aItF.Next()) {
- //modified by NIZNHY-PKV Tue Aug 5 15:07:35 2008f
+ //modified by NIZNHY-PKV Wed Oct 27 07:10:44 2010t
+ } // for (; aItF.More(); aItF.Next()) {
//
// Post Treatment
TopTools_MapOfOrientedShape aMP;
}
}
//
- // b. collect all edges that are to avoid
+ // b. collect all faces that are to avoid
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aF=aItM.Key();
aMP.Add(aF);
}
//
- // c. add all edges that are not processed to myShapesToAvoid
+ // c. add all faces that are not processed to myShapesToAvoid
aIt.Initialize (myShapes);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
myShapesToAvoid.Add(aF);
}
}
- //modified by NIZNHY-PKV Tue Aug 5 15:07:44 2008t
//=================================================
//
// 2.Internal Shells
aEFMap.Clear();
AddedFacesMap.Clear();
//
- aNbFA=myShapesToAvoid.Extent();
- //
aItM.Initialize(myShapesToAvoid);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aFF=aItM.Key();
//
TopoDS_Iterator aItAddedF (aShell);
for (; aItAddedF.More(); aItAddedF.Next()) {
- const TopoDS_Face& aF = TopoDS::Face(aItAddedF.Value());
+ const TopoDS_Face& aF = *((TopoDS_Face*)(&aItAddedF.Value()));
//
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
for (; aEdgeExp.More(); aEdgeExp.Next()) {
- const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
+ const TopoDS_Edge& aE = *((TopoDS_Edge*)(&aEdgeExp.Current()));
const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
aItF.Initialize(aLF);
for (; aItF.More(); aItF.Next()) {
- const TopoDS_Face& aFL=TopoDS::Face(aItF.Value());
+ const TopoDS_Face& aFL=*((TopoDS_Face*)(&aItF.Value()));
if (AddedFacesMap.Add(aFL)){
aBB.Add(aShell, aFL);
}
}
else{
// check if a shell is a hole
- //XX
bIsHole=IsHole(aShell, myContext);
- //bIsHole=GEOMAlgo_BuilderTools::IsHole(aShell);
- //XX
+ //
if (bIsHole) {
aHoleShells.Append(aShell);
TopExp::MapShapes(aShell, TopAbs_FACE, aMHF);
// 3. Add aHoles to Solids
aItMSH.Initialize(aMSH);
for (; aItMSH.More(); aItMSH.Next()) {
- TopoDS_Solid aSolid=TopoDS::Solid(aItMSH.Key());
+ TopoDS_Solid aSolid=*((TopoDS_Solid*)(&aItMSH.Key()));
//
const TopTools_ListOfShape& aLH=aItMSH.Value();
aShellIt.Initialize(aLH);
// 2 Process solids
aSolidIt.Initialize(myAreas);
for ( ; aSolidIt.More(); aSolidIt.Next()) {
- TopoDS_Solid& aSolid=TopoDS::Solid(aSolidIt.Value());
+ TopoDS_Solid& aSolid=*((TopoDS_Solid*)(&aSolidIt.Value()));
//
aMEF.Clear();
TopExp::MapShapesAndAncestors(aSolid, TopAbs_EDGE, TopAbs_FACE, aMEF);
aMFP.Clear();
aItMF.Initialize(aMF);
for (; aItMF.More(); aItMF.Next()) {
- const TopoDS_Face& aF=TopoDS::Face(aItMF.Key());
+ const TopoDS_Face& aF=*((TopoDS_Face*)(&aItMF.Key()));
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, *myContext)) {
aMFP.Add(aF);
}
}
return bRet;
}
-//modified by NIZNHY-PKV Tue Aug 5 15:07:50 2008f
//=======================================================================
//function : IsClosedShell
//purpose :
const TopoDS_Face& aF=TopoDS::Face(aIt.Value());
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()) {
- const TopoDS_Edge& aE=TopoDS::Edge(aExp.Current());
+ const TopoDS_Edge& aE=*((TopoDS_Edge*)(&aExp.Current()));
if (BRep_Tool::Degenerated(aE)) {
continue;
}
- /*
- if (BRep_Tool::IsClosed(aE, aF)) {
- continue;
- }
- */
+ //
if (aE.Orientation()==TopAbs_INTERNAL) {
continue;
}
+ //
if (!aM.Add(aE)) {
aM.Remove(aE);
}
}
return bRet;
}
-//modified by NIZNHY-PKV Tue Aug 5 15:08:07 2008t
-//BRepTools::Write(aFF, "ff");
+//modified by NIZNHY-PKV Tue Oct 26 13:30:23 2010f
+//=======================================================================
+//function : RefineShell
+//purpose :
+//=======================================================================
+ Standard_Boolean RefineShell(const TopoDS_Shell& aShell,
+ TopoDS_Shell& aShx)
+
+{
+ Standard_Boolean bRet;
+ Standard_Integer i, aNbE, aNbF;
+ TopAbs_Orientation aOrE;
+ TopTools_IndexedDataMapOfShapeListOfShape aMEF;
+ TopTools_MapOfOrientedShape aMFx;
+ //
+ bRet=Standard_False;
+ //
+ TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF);
+ aNbE=aMEF.Extent();
+ for (i=1; i<=aNbE; ++i) {
+ const TopoDS_Edge &aE=*((TopoDS_Edge*)(&aMEF.FindKey(i)));
+ //
+ if (BRep_Tool::Degenerated(aE)) {
+ continue;
+ }
+ //
+ aOrE=aE.Orientation();
+ //
+ const TopTools_ListOfShape& aLF=aMEF(i);
+ aNbF=aLF.Extent();
+ if (!aNbF) {
+ continue;
+ }
+ //
+ const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First()));
+ if (aNbF==1) {
+ if (aOrE==TopAbs_INTERNAL) {
+ continue;
+ }
+ aMFx.Add(aF1);
+ }
+ //
+ else if (aNbF==2) {
+ const TopoDS_Face& aF2=*((TopoDS_Face*)(&aLF.Last()));
+ if (aF2.IsSame(aF1)) {
+ if (BRep_Tool::IsClosed(aE, aF1)) {
+ continue;
+ }
+ if (aOrE==TopAbs_INTERNAL) {
+ continue;
+ }
+ aMFx.Add(aF1);
+ aMFx.Add(aF2);
+ }
+ }
+ }
+ //
+ aNbF=aMFx.Extent();
+ if (!aNbF) {
+ return bRet;
+ }
+ //
+ BRep_Builder aBB;
+ TopoDS_Iterator aIt;
+ //
+ aNbF=0;
+ aBB.MakeShell(aShx);
+ aIt.Initialize(aShell);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aF=aIt.Value();
+ if (!aMFx.Contains(aF)) {
+ aBB.Add(aShx, aF);
+ ++aNbF;
+ }
+ }
+ //
+ if (aNbF) {
+ bRet=IsClosedShell(aShx);
+ }
+ //
+ return bRet;
+}
+//modified by NIZNHY-PKV Tue Oct 26 13:30:26 2010t
//
// ErrorStatus :
// 11 - Null Context
IntTools_Context& aCtx=pPF->ChangeContext();
//
Standard_Boolean bToReverse;
- Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx, aIsCB;
+ Standard_Integer i, aNb, aNbSp, nSp, nSpR, nSpx, aIsCB, aNbLB;
TColStd_ListIteratorOfListOfInteger aItLB;
TColStd_ListOfInteger aLB;
TopoDS_Edge aEE, aESpR;
nSp=aPB.Edge();
const TopoDS_Shape& aSp=aDS.Shape(nSp);
//
- //modified by NIZNHY-PKV Fri Nov 30 10:40:36 2007 f
- //const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB);
const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB, aIsCB);
- //modified by NIZNHY-PKV Fri Nov 30 10:40:48 2007t
+ //modified by NIZNHY-PKV Wed Oct 27 11:19:30 2010f
+ aNbLB=aLB.Extent();
+ if (aIsCB && aNbLB<2) {
+ aIsCB=0;
+ }
+ //modified by NIZNHY-PKV Wed Oct 27 11:19:34 2010t
+ //
nSpR=aPBR.Edge();
const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
- //modified by NIZNHY-PKV Fri Nov 30 10:41:39 2007f
- //if (aSpR.IsSame(aSp) && aSpR.IsSame(aE)) {
if (aSpR.IsSame(aSp) && aSpR.IsSame(aE) && !aIsCB) {
- //modified by NIZNHY-PKV Fri Nov 30 10:41:46 2007t
continue;
}
//
aIt.Initialize(aLPB);
for (; aIt.More(); aIt.Next()) {
const BOPTools_PaveBlock& aPB=aIt.Value();
- //modified by NIZNHY-PKV Fri Nov 30 10:42:15 2007f
- //const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB);
const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB, aIsCB);
- //modified by NIZNHY-PKV Fri Nov 30 10:42:20 2007t
nSpR=aPBR.Edge();
const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
//
const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
mySameDomainShapes.Add(aSpx ,aSpR);
}
- //
}
}
//
#include <BOPTools_CArray1OfESInterference.hxx>
#include <NMTDS_ShapesDataStructure.hxx>
+#include <NMTDS_InterfPool.hxx>
+
#include <NMTTools_PaveFiller.hxx>
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_Tools.hxx>
#include <GEOMAlgo_Tools3D.hxx>
#include <GEOMAlgo_WireEdgeSet.hxx>
#include <GEOMAlgo_BuilderFace.hxx>
-#include <NMTDS_InterfPool.hxx>
+
+#include <GEOMAlgo_ShapeSet.hxx>
static
void UpdateCandidates(const Standard_Integer ,
aNbSE=aLSE.Extent();
if (aNbSE) {
aMFP.Add(i);
+ //modified by NIZNHY-PKV Wed Oct 27 11:40:57 2010f
+ break;
+ //modified by NIZNHY-PKV Wed Oct 27 11:41:07 2010t
}
}
}
}
//
// 2.2. Build images Faces
- GEOMAlgo_BuilderFace aBF;
+ TopTools_ListOfShape aLFR;
+ GEOMAlgo_ShapeSet aS1, aS2;
//
- aBF.SetFace(aFF);
- aBF.SetContext(aCtx);
const TopTools_ListOfShape& aSE=aWES.StartElements();
- //
- //DEB f
- /*
- {
- TopoDS_Compound aCx;
- BRep_Builder aBBx;
- TopTools_ListIteratorOfListOfShape aItx;
+ //modified by NIZNHY-PKV Thu Oct 28 08:30:41 2010f
+ aS1.Add(aSE);
+ aS2.Add(aFF, TopAbs_EDGE);
+ if (aS1.IsEqual(aS2)) {
+ aLFR.Append(aF);
+ }
+ //modified by NIZNHY-PKV Thu Oct 28 08:30:42 2010t
+ else {
+ GEOMAlgo_BuilderFace aBF;
//
- aBBx.MakeCompound(aCx);
- aBBx.Add(aCx, aFF);
- aItx.Initialize(aSE);
- for (; aItx.More(); aItx.Next()) {
- TopoDS_Shape& aEx=aItx.Value();
- aBBx.Add(aCx, aEx);
- }
- int a=0;
- }
- */
- //DEB t
- //
- aBF.SetShapes(aSE);
- //
- aBF.Perform();
- //
- const TopTools_ListOfShape& aLF=aBF.Areas();
- //
- TopTools_ListOfShape aLFR;
- //
- aIt.Initialize(aLF);
- for (; aIt.More(); aIt.Next()) {
- TopoDS_Shape& aFR=aIt.Value();
- if (anOriF==TopAbs_REVERSED) {
- aFR.Orientation(TopAbs_REVERSED);
+ aBF.SetFace(aFF);
+ aBF.SetContext(aCtx);
+ aBF.SetShapes(aSE);
+ // <-DEB
+ aBF.Perform();
+ //
+ const TopTools_ListOfShape& aLF=aBF.Areas();
+ aIt.Initialize(aLF);
+ for (; aIt.More(); aIt.Next()) {
+ TopoDS_Shape& aFR=aIt.Value();
+ if (anOriF==TopAbs_REVERSED) {
+ aFR.Orientation(TopAbs_REVERSED);
+ }
+ aLFR.Append(aFR);
}
- aLFR.Append(aFR);
}
//
// 2.3. Collect draft images Faces
//=======================================================================
void GEOMAlgo_Builder::FillImagesFaces1()
{
- Standard_Integer i, aNb, iSense;
+ Standard_Integer i, aNb, iSense, aNbLFx;
TopoDS_Face aF, aFSp, aFSD;
TopTools_ListOfShape aLFx;
TopTools_ListIteratorOfListOfShape aIt;
aLFx.Append(aFSD);
}
}
- if (!myImages.HasImage(aF)) {//XX
+ if (!myImages.HasImage(aF)) {
+ //modified by NIZNHY-PKV Wed Oct 27 14:41:34 2010f
+ aNbLFx=aLFx.Extent();
+ if (aNbLFx==1) {
+ const TopoDS_Shape& aFx=aLFx.First();
+ if (aF.IsSame(aFx)) {
+ continue;
+ }
+ }
+ //modified by NIZNHY-PKV Wed Oct 27 14:41:36 2010t
myImages.Bind(aF, aLFx);
}
}
theMFMV.Add(theNF, aMV);
}
}
+
+/*
+ {
+ TopoDS_Compound aCx;
+ BRep_Builder aBBx;
+ TopTools_ListIteratorOfListOfShape aItx;
+ //
+ aBBx.MakeCompound(aCx);
+ aBBx.Add(aCx, aFF);
+ aItx.Initialize(aSE);
+ for (; aItx.More(); aItx.Next()) {
+ TopoDS_Shape& aEx=aItx.Value();
+ aBBx.Add(aCx, aEx);
+ }
+ int a=0;
+ }
+ */
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : GEOMAlgo_Builder_3.cxx
+// Created :
+// Author : Peter KURNEV
-// File: GEOMAlgo_Builder_3.cxx
-// Created:
-// Author: Peter KURNEV
-//
#include <GEOMAlgo_Builder.hxx>
#include <TopAbs_State.hxx>
//=======================================================================
//function : FillImagesSolids
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_Builder::FillImagesSolids()
{
}
//=======================================================================
//function : BuildDraftSolid
-//purpose :
+//purpose :
//=======================================================================
- void GEOMAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid,
+void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid,
TopoDS_Shape& theDraftSolid,
TopTools_ListOfShape& theLIF)
{
Standard_Integer iFlag;
TopAbs_Orientation aOrF, aOrSh, aOrSd;
TopoDS_Iterator aIt1, aIt2;
- TopTools_ListIteratorOfListOfShape aItS;
+ TopTools_ListIteratorOfListOfShape aItS;
BRep_Builder aBB;
TopoDS_Shell aShD;
TopoDS_Shape aFSDx, aFx;
theLIF.Append(aFSDx);
}
else {
- bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFSDx, aF, aCtx);
+ bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFSDx, aF, aCtx);
if (bToReverse) {
aFSDx.Reverse();
}
}
//=======================================================================
//function : FillIn3DParts
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_Builder::FillIn3DParts()
{
IntTools_Context& aCtx= pPF->ChangeContext();
//
Standard_Boolean bIsIN, bHasImage;
- Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF;// k,
- TopAbs_ShapeEnum aType;
+ Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF;
+ TopAbs_ShapeEnum aType;
TopAbs_State aState;
TopTools_IndexedMapOfShape aMSolids, aMS, aMFaces, aMFIN;
TopTools_MapOfShape aMFDone;
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
- TopTools_ListIteratorOfListOfShape aItS;
+ TopTools_ListIteratorOfListOfShape aItS;
TopoDS_Iterator aIt, aItF;
BRep_Builder aBB;
- TopoDS_Solid aSolidSp;
+ TopoDS_Solid aSolidSp;
TopoDS_Face aFP;
//
myDraftSolids.Clear();
const TopoDS_Shape& aS=aDS.Shape(i);
//
aType=aS.ShapeType();
- if (aType==TopAbs_SOLID) {
+ if (aType==TopAbs_SOLID) {
// all solids from DS
aMSolids.Add(aS);
}
else {
//aMS.Add(aShell);
TopExp::MapShapes(aShell, TopAbs_FACE, aMS);
+ //modified by NIZNHY-PKV Fri Dec 03 11:18:45 2010f
+ TopExp::MapShapes(aShell, TopAbs_EDGE, aMS);
+ //modified by NIZNHY-PKV Fri Dec 03 11:18:51 2010t
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF);
}
}
}
//
// among all faces from aMEFP select these that have same edges
- // with the solid (i.e aMEF). These faces will be treated first
+ // with the solid (i.e aMEF). These faces will be treated first
// to prevent the usage of 3D classifier.
- // The full list of faces to process is aLFP1.
+ // The full list of faces to process is aLFP1.
aNbEFP=aMEFP.Extent();
for (j=1; j<=aNbEFP; ++j) {
const TopoDS_Shape& aE=aMEFP.FindKey(j);
if (!aMFDone.Add(aSP)) {
continue;
}
-
+
//
// first face to process
aFP=TopoDS::Face(aSP);
}
}
//
- // Connexity Block that spreads from aFP the Bound
+ // Connexity Block that spreads from aFP the Bound
// or till the end of the block itself
aLCBF.Clear();
GEOMAlgo_Tools3D::MakeConnexityBlock(aLFP, aMS, aLCBF);
//
- // fill states for the Connexity Block
+ // fill states for the Connexity Block
aItS.Initialize(aLCBF);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aSx=aItS.Value();
}
//=======================================================================
//function : BuildSplitSolids
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_Builder::BuildSplitSolids()
{
myErrorStatus=0;
- //
+ //
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
IntTools_Context& aCtx= pPF->ChangeContext();
GEOMAlgo_DataMapOfShapeShapeSet aMSS;
GEOMAlgo_ShapeSet aSSi;
//
- //modified by NIZNHY-PKV Wed Dec 6 17:08:03 2006f
- //
// 0. Find same domain solids for non-interferred solids
aNbS=aDS.NumberOfShapesOfTheObject();
for (i=1; i<=aNbS; ++i) {
aSSi.Add(aS, TopAbs_FACE);
//
aMSS.Bind(aS, aSSi);
- } //for (i=1; i<=aNbS; ++i)
- //
- //modified by NIZNHY-PKV Wed Dec 6 17:08:09 2006t
+ } //for (i=1; i<=aNbS; ++i)
//
// 1. Build solids for interferred source solids
- //
aSB.SetContext(aCtx);
aNbS=myDraftSolids.Extent();
for (i=1; i<=aNbS; ++i) {
//
// 1.1 Fill Shell Faces Set
aSFS.Clear();
-
+
aExp.Init(aSD, TopAbs_FACE);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aF=aExp.Current();
aNbSFS=aSFS.Extent();
//
// 1.2
- // Check whether aSFS contains a subsets of faces
- // of solids that have been already built.
+ // Check whether aSFS contains a subsets of faces
+ // of solids that have been already built.
// If yes, shrink aSFS by these subsets.
aSSi.Clear();
aSSi.Add(aSFS);
//
aItSS.Initialize(aMSS);
for (; aItSS.More(); aItSS.Next()) {
- const TopoDS_Shape& aSR=aItSS.Key();
+ const TopoDS_Shape& aSR=aItSS.Key();
const GEOMAlgo_ShapeSet& aSSR=aItSS.Value();
if (aSSi.Contains(aSSR)) {
// the aSR is SD solid for aS
}
const TopTools_ListOfShape& aSFS1=aSSi.GetSet();
aNbSFS=aSFS1.Extent();
+ //modified by NIZNHY-PKV Wed Oct 27 09:53:15 2010f
+ if (!aNbSFS) {
+ continue;
+ }
+ //modified by NIZNHY-PKV Wed Oct 27 09:53:18 2010t
//
// 1.3 Build new solids
aSB.SetShapes(aSFS1);
//
const TopTools_ListOfShape& aLSR=aSB.Areas();
//
- // 1.4 Collect resulting solids and theirs set of faces
+ // 1.4 Collect resulting solids and theirs set of faces
aIt.Initialize(aLSR);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSR=aIt.Value();
myImages.Bind(aS, aLSR);
}
} // for (i=1; i<=aNbS; ++i) {
- //modified by NIZNHY-PKV Wed Dec 6 17:07:47 2006f
- /*
- //
- // 2. Find same domain solids for non-interferred solids
- aNbS=aDS.NumberOfShapesOfTheObject();
- for (i=1; i<=aNbS; ++i) {
- const TopoDS_Shape& aS=aDS.Shape(i);
- if (aS.ShapeType()!=TopAbs_SOLID) {
- continue;
- }
- if (!aMFence.Add(aS)) {
- continue;
- }
- if(myImages.HasImage(aS)) {
- continue;
- }
- //
- aSSi.Clear();
- aSSi.Add(aS, TopAbs_FACE);
- //
- aItSS.Initialize(aMSS);
- for (; aItSS.More(); aItSS.Next()) {
- const TopoDS_Shape& aSR=aItSS.Key();
- const GEOMAlgo_ShapeSet& aSSR=aItSS.Value();
- if (aSSi.Contains(aSSR)) {
- myImages.Bind(aS, aSR);
- break;
- }
- }
- } //for (i=1; i<=aNbS; ++i)
- */
- //modified by NIZNHY-PKV Wed Dec 6 17:07:55 2006t
}
//=======================================================================
-//function :FillInternalShapes
-//purpose :
+//function :FillInternalShapes
+//purpose :
//=======================================================================
void GEOMAlgo_Builder::FillInternalShapes()
{
//
// 1. Shapes to process
//
- // 1.1 Shapes from pure arguments aMSI
+ // 1.1 Shapes from pure arguments aMSI
// 1.1.1 vertex, edge
for (i=0; i<2; ++i) {
jT=(Standard_Integer)aT[i];
}
}
// 1.1.2 wire
- {
+ {
jT=(Standard_Integer)TopAbs_WIRE;
const TopTools_ListOfShape &aLW=myShapes1[jT];
aIt.Initialize(aLW);
}
}
}
- // 1.1.3 theirs images/sources
+ // 1.1.3 theirs images/sources
aIt1.Initialize(aLSI);
for (; aIt1.More(); aIt1.Next()) {
const TopoDS_Shape& aS=aIt1.Value();
aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSp=aIt.Value();
- if (aMFence.Add(aSp)) {
+ if (aMFence.Add(aSp)) {
TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx);
TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx);
TopExp::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx);
TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx);
TopExp::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx);
aLSd.Append(aS);
- aMSOr.Add(aS);
+ aMSOr.Add(aS);
}
}
}//if (aType==TopAbs_SOLID)
//
aNbSd=aLSd.Extent();
//
- // 3. Some shapes of aMSI can be already tied with faces of
+ // 3. Some shapes of aMSI can be already tied with faces of
// split solids
- aItM.Initialize(aMSI);
+ aItM.Initialize(aMSI);
for (; aItM.More(); aItM.Next()) {
const TopoDS_Shape& aSI=aItM.Key();
if (aMSx.Contains(aSI)) {
for (; aIt.More(); aIt.Next()) {
TopoDS_Solid aSd=TopoDS::Solid(aIt.Value());
//
- aItM.Initialize(aMSI);
+ aItM.Initialize(aMSI);
for (; aItM.More(); aItM.Next()) {
TopoDS_Shape aSI=aItM.Key();
aSI.Orientation(TopAbs_INTERNAL);
}
//=======================================================================
//function : OwnInternalShapes
-//purpose :
+//purpose :
//=======================================================================
void OwnInternalShapes(const TopoDS_Shape& theS,
TopTools_IndexedMapOfShape& theMx)
//
// ErrorStatus
// 30 - SolidBuilder failed
-
---Purpose: Returns the Set
returns ListOfShape from TopTools;
---C++: return const &
-
+ --modified by NIZNHY-PKV Wed Oct 28 13:51:45 2010f
+ IsEqual(me;
+ theOther: ShapeSet from GEOMAlgo)
+ ---Purpose: Returns True if the Set==theSet
+ returns Boolean from Standard;
+ ---C++: alias operator ==
+ --modified by NIZNHY-PKV Wed Oct 28 13:51:50 2010t
+
fields
myMap : MapOfOrientedShape from TopTools is protected;
myList : ListOfShape from TopTools is protected;
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_ShapeSet::GetSet()const
{
- /*
- TopTools_ListOfShape *pL;
- TopTools_MapIteratorOfMapOfOrientedShape aIt;
- //
- pL=(TopTools_ListOfShape *)&myList;
- pL->Clear();
- aIt.Initialize(myMap);
- for (; aIt.More(); aIt.Next()) {
- pL->Append(aIt.Key());
- }
- */
return myList;
}
//=======================================================================
//=======================================================================
void GEOMAlgo_ShapeSet::Subtract(const GEOMAlgo_ShapeSet& theOther)
{
- /*
- TopTools_MapIteratorOfMapOfOrientedShape aIt;
- //
- aIt.Initialize(theOther.myMap);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aS=aIt.Key();
- myMap.Remove(aS);
- }
- */
- //
TopTools_ListIteratorOfListOfShape aIt;
TopTools_ListOfShape aLS;
//
//
myList=aLS;
}
+//modified by NIZNHY-PKV Wed Oct 28 13:51:36 2010f
+//=======================================================================
+//function : IsEqual
+//purpose :
+//=======================================================================
+ Standard_Boolean GEOMAlgo_ShapeSet::IsEqual(const GEOMAlgo_ShapeSet& theOther)const
+{
+ Standard_Boolean bRet;
+ Standard_Integer aNb1, aNb2;
+ TopAbs_Orientation aOr;
+ TopTools_ListIteratorOfListOfShape aIt;
+ //
+ bRet=Standard_True;
+ aNb1=myList.Extent();
+ const TopTools_ListOfShape& aLS2=theOther.GetSet();
+ aNb2=aLS2.Extent();
+ if (aNb1!=aNb2) {
+ return !bRet;
+ }
+ //
+ aIt.Initialize(myList);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS=aIt.Value();
+ if(!theOther.myMap.Contains(aS)) {
+ bRet=!bRet;
+ break;
+ }
+ }
+ return bRet;
+}
+//modified by NIZNHY-PKV Wed Oct 28 13:51:38 2010t
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
#define _GEOMAlgo_ShapeSet_HeaderFile
+#ifndef _Standard_HeaderFile
+#include <Standard.hxx>
+#endif
+#ifndef _Standard_Macro_HeaderFile
+#include <Standard_Macro.hxx>
+#endif
+
#ifndef _TopTools_MapOfOrientedShape_HeaderFile
#include <TopTools_MapOfOrientedShape.hxx>
#endif
class TopoDS_Shape;
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-
//! Implementation some formal <br>
//! opereations with Set of shapes <br>
class GEOMAlgo_ShapeSet {
-
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 <br>
-Standard_EXPORT GEOMAlgo_ShapeSet();
-
-//! Adds shapes from the list theLS to the Set <br>
-Standard_EXPORT void Add(const TopTools_ListOfShape& theLS) ;
-
-//! Adds shape theShape to the Set <br>
-Standard_EXPORT void Add(const TopoDS_Shape& theShape) ;
-
-//! Adds sub-shapes of shape theShape, <br>
+ 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);
+ }
+
+ //! Empty constructor <br>
+ Standard_EXPORT GEOMAlgo_ShapeSet();
+ //! Adds shapes from the list theLS to the Set <br>
+ Standard_EXPORT void Add(const TopTools_ListOfShape& theLS) ;
+ //! Adds shape theShape to the Set <br>
+ Standard_EXPORT void Add(const TopoDS_Shape& theShape) ;
+ //! Adds sub-shapes of shape theShape, <br>
//! that have type theType to the Set <br>
-Standard_EXPORT void Add(const TopoDS_Shape& theShape,const TopAbs_ShapeEnum theType) ;
-
-//! Removes shapes of theSet from the Set <br>
-Standard_EXPORT void Subtract(const GEOMAlgo_ShapeSet& theSet) ;
-
-//! Clears internal fields <br>
-Standard_EXPORT void Clear() ;
-
-//! Returns True if the Set contains <br>
+ Standard_EXPORT void Add(const TopoDS_Shape& theShape,const TopAbs_ShapeEnum theType) ;
+ //! Removes shapes of theSet from the Set <br>
+ Standard_EXPORT void Subtract(const GEOMAlgo_ShapeSet& theSet) ;
+ //! Clears internal fields <br>
+ Standard_EXPORT void Clear() ;
+ //! Returns True if the Set contains <br>
//! all shapes of theSet <br>
-Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_ShapeSet& theSet) const;
-
-//! Returns the Set <br>
-Standard_EXPORT const TopTools_ListOfShape& GetSet() const;
+ Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_ShapeSet& theSet) const;
+ //! Returns the Set <br>
+ Standard_EXPORT const TopTools_ListOfShape& GetSet() const;
+ //! Returns True if the Set==theSet <br>
+ Standard_EXPORT Standard_Boolean IsEqual(const GEOMAlgo_ShapeSet& theOther) const;
+ Standard_Boolean operator ==(const GEOMAlgo_ShapeSet& theOther) const
+{
+ return IsEqual(theOther);
+}
protected:
- // Methods PROTECTED
- //
- // Fields PROTECTED
- //
TopTools_MapOfOrientedShape myMap;
TopTools_ListOfShape myList;
-private:
+private:
- // Methods PRIVATE
- //
- // Fields PRIVATE
- //
};
// other Inline functions and methods (like "C++: function call" methods)
-//
#endif
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// File : GEOMAlgo_Tools3D.cxx
+// Created :
+// Author : Peter KURNEV
-// File: GEOMAlgo_Tools3D.cxx
-// Created:
-// Author: Peter KURNEV
-//
#include <GEOMAlgo_Tools3D.ixx>
#include <Precision.hxx>
const gp_Dir& );
static
- void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- Standard_Real aT,
- gp_Pnt& aPF,
+ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ Standard_Real aT,
+ gp_Pnt& aPF,
gp_Dir& aDNF,
IntTools_Context& aCtx);
//=======================================================================
//function : IsInternalFace
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
const TopoDS_Solid& theSolid,
if (!theMEF.Contains(aE)) {
continue;
}
- //
+ //
const TopTools_ListOfShape& aLF=theMEF.FindFromKey(aE);
aNbF=aLF.Extent();
if (!aNbF) {
}
//=======================================================================
//function : IsInternalFace
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
}
//=======================================================================
//function : IsInternalFace
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
aDt2D=BOPTools_Tools3D::MinStepIn2d();
aDt2Dx=10.*aDt2D;
BOPTools_Tools3D::PointNearEdge (theEdge, theFace, aT, aDt2Dx, aPF2D, aPF);
- //
+ //
// 2. E1, E2
GEOMAlgo_Tools3D::GetEdgeOnFace(theEdge, theFace1, aE1);
if (aE1.Orientation()==TopAbs_INTERNAL) {
if (aA12<0.) {
aA12=aA12+aTwoPI;
}
-
+
aA1x=AngleWithRef(aDBF1, aDBF , aDTF1);
if (aA1x<0.) {
aA1x=aA1x+aTwoPI;
}
//=======================================================================
//function : GetFaceOff
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_Tools3D::GetFaceOff(const TopoDS_Edge& theE1,
const TopoDS_Face& theF1,
}
//=======================================================================
//function : GetEdgeOnFace
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOnFace(const TopoDS_Edge& theE1,
const TopoDS_Face& theF2,
}
//=======================================================================
//function : GetEdgeOff
-//purpose :
+//purpose :
//=======================================================================
- Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff(const TopoDS_Edge& theE1,
+Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1,
const TopoDS_Face& theF2,
TopoDS_Edge& theE2)
-
+
{
Standard_Boolean bFound;
TopAbs_Orientation aOr1, aOr1C, aOr2;
}
//=======================================================================
// function: ComputeState
-// purpose:
+// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Face& theF,
const TopoDS_Solid& theRef,
IntTools_Context& theCtx)
{
TopAbs_State aState;
- TopExp_Explorer aExp;
+ TopExp_Explorer aExp;
TopoDS_Edge aE1;
gp_Pnt2d aP2D;
- gp_Pnt aP3D;
+ gp_Pnt aP3D;
//
aState=TopAbs_UNKNOWN;
//
}
//=======================================================================
// function: ComputeStateByOnePoint
-// purpose:
+// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeStateByOnePoint(const TopoDS_Shape& theS,
const TopoDS_Solid& theRef,
}
//=======================================================================
// function: ComputeState
-// purpose:
+// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Vertex& theV,
const TopoDS_Solid& theRef,
IntTools_Context& theCtx)
{
TopAbs_State aState;
- gp_Pnt aP3D;
+ gp_Pnt aP3D;
//
aP3D=BRep_Tool::Pnt(theV);
aState=GEOMAlgo_Tools3D::ComputeState(aP3D, theRef, theTol, theCtx);
}
//=======================================================================
// function: ComputeState
-// purpose:
+// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Edge& theE,
const TopoDS_Solid& theRef,
Standard_Real aT1, aT2, aT = 0.;
TopAbs_State aState;
Handle(Geom_Curve) aC3D;
- gp_Pnt aP3D;
+ gp_Pnt aP3D;
//
aC3D = BRep_Tool::Curve(theE, aT1, aT2);
//
}
//=======================================================================
// function: ComputeState
-// purpose:
+// purpose:
//=======================================================================
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const gp_Pnt& theP,
const TopoDS_Solid& theRef,
}
//=======================================================================
// function: IsSplitToReverse
-// purpose:
+// purpose:
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Shape& theSp,
const TopoDS_Shape& theSr,
}
//=======================================================================
//function :IsSplitToReverse
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Face& theFSp,
const TopoDS_Face& theFSr,
aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
BOPTools_Tools3D::GetApproxNormalToFaceOnEdge(aESp, theFSp, aT, aPFSp, aDNFSp);
//
- // Parts of theContext.ComputeVS(..)
+ // Parts of theContext.ComputeVS(..)
GeomAPI_ProjectPointOnSurf& aProjector=theContext.ProjPS(theFSr);
aProjector.Perform(aPFSp);
if (!aProjector.IsDone()) {
}
//
aSr->D1(aU, aV, aPFSr, aD1U, aD1V);
- gp_Dir aDD1U(aD1U);
+ gp_Dir aDD1U(aD1U);
gp_Dir aDD1V(aD1V);
- gp_Dir aDNFSr=aDD1U^aDD1V;
+ gp_Dir aDNFSr=aDD1U^aDD1V;
if (theFSr.Orientation()==TopAbs_REVERSED){
aDNFSr.Reverse();
}
}
//=======================================================================
//function :IsSplitToReverse
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Edge& theSplit,
const TopoDS_Edge& theEdge,
//
bRet=Standard_False;
//
- bIsDegenerated=(BRep_Tool::Degenerated(theSplit) ||
+ bIsDegenerated=(BRep_Tool::Degenerated(theSplit) ||
BRep_Tool::Degenerated(theEdge));
if (bIsDegenerated) {
return bRet;
//=======================================================================
// function: Sense
-// purpose:
+// purpose:
//=======================================================================
Standard_Integer GEOMAlgo_Tools3D::Sense (const TopoDS_Face& theF1,
const TopoDS_Face& theF2)
}
//=======================================================================
// function: CopyFace
-// purpose:
+// purpose:
//=======================================================================
void GEOMAlgo_Tools3D::CopyFace (const TopoDS_Face& theF1,
TopoDS_Face& theF2)
}
//=======================================================================
// function: MakeContainer
-// purpose:
+// purpose:
//=======================================================================
void GEOMAlgo_Tools3D::MakeContainer(const TopAbs_ShapeEnum theType,
TopoDS_Shape& theC)
TopoDS_Solid aSolid;
aBB.MakeSolid(aSolid);
theC=aSolid;
- }
+ }
break;
//
//
TopoDS_Shell aShell;
aBB.MakeShell(aShell);
theC=aShell;
- }
+ }
break;
//
case TopAbs_WIRE: {
}
//=======================================================================
// function: MakeConnexityBlock.
-// purpose:
+// purpose:
//=======================================================================
void GEOMAlgo_Tools3D::MakeConnexityBlock (const TopTools_ListOfShape& theLFIn,
const TopTools_IndexedMapOfShape& theMEAvoid,
aNbF=theLFIn.Extent();
aIt.Initialize(theLFIn);
for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aF=aIt.Value();
+ const TopoDS_Shape& aF=aIt.Value();
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
}
//
}
//
}//while(1) {
-
+
//
aNbF=aMCB.Extent();
aItM.Initialize(aMCB);
}
//=======================================================================
//function : FindFacePairs
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean FindFacePairs (const TopoDS_Edge& theE,
const TopTools_ListOfShape& thLF,
//
// Preface aLCEF
aItLF.Initialize(thLF);
- for (; aItLF.More(); aItLF.Next()) {
+ for (; aItLF.More(); aItLF.Next()) {
const TopoDS_Face& aFL=TopoDS::Face(aItLF.Value());
//
bFound=GEOMAlgo_Tools3D::GetEdgeOnFace(theE, aFL, aEL);
//
//=======================================================================
//function : AngleWithRef
-//purpose :
+//purpose :
//=======================================================================
Standard_Real AngleWithRef(const gp_Dir& theD1,
const gp_Dir& theD2,
}
//=======================================================================
//function : GetApproxNormalToFaceOnEdge
-//purpose :
+//purpose :
//=======================================================================
-void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
- const TopoDS_Face& aFx,
- Standard_Real aT,
- gp_Pnt& aPF,
+void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
+ const TopoDS_Face& aFx,
+ 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;
//
// Normal at aT
BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNFT);
-
+
// Tangent at aT
BOPTools_Tools3D::GetTangentToEdge(aE, aT, aDTT);
//
aTS=aGAS.GetType();
if (aTS==GeomAbs_BSplineSurface ||
aTS==GeomAbs_BezierSurface ||
- aTS==GeomAbs_Plane) {
+ aTS==GeomAbs_Plane){
Standard_Real aTolEx, aTolFx, aTol, dUR, dVR, dR;
//
aTolEx=BRep_Tool::Tolerance(aEx);
dT=dR;
}
}
+ //modified by NIZNHY-PKV Thu Dec 02 10:39:09 2010f
+ else if (GeomAbs_Torus ||
+ aTS==GeomAbs_Cylinder){
+ Standard_Real aTolEx, aTolFx, aTol;
+ //
+ aTolEx=BRep_Tool::Tolerance(aEx);
+ aTolFx=BRep_Tool::Tolerance(aFx);
+ aTol=2.*aTolEx+aTolFx;
+ if (aTol>dT) {
+ dT=aTol;
+ }
+ }
+ //modified by NIZNHY-PKV Thu Dec 02 10:39:13 2010t
}
//----------------------------------------------
//
aDNF.Reverse();
}
//
- //modified by NIZNHY-PKV Wed Sep 22 10:52:54 2010f
- /*
GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF);
//
aProjector.Perform(aPFx);
aDNF.Reverse();
}
}
- */
- //modified by NIZNHY-PKV Wed Sep 22 10:52:59 2010t
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-
// GEOM GEOMClient : tool to transfer BREP files from GEOM server to GEOM client
// File : GEOM_Client.cxx
// Author : Yves FRICAUD/Lucien PIGNOLONI
// Module : GEOM
-// $Header$
-//
+
#include <Standard_Stream.hxx>
#include <Standard_Stream.hxx>
/* get sequence of bytes of resulting brep shape from GEOM server */
TopoDS_Shape S;
SALOMEDS::TMPFile_var SeqFile = aShape->GetShapeStream();
- int sizebuf = SeqFile->length();
+ /*int sizebuf = */SeqFile->length();
char* buf;
buf = (char*) &SeqFile[0];
std::istringstream streamBrep(buf);
#endif
}
+//=======================================================================
+// function : Create()
+// purpose : Copy constructor
+//=======================================================================
+GEOM_Client::GEOM_Client(const GEOM_Client& client)
+{
+ myIORs = client.myIORs;
+ myShapes = client.myShapes;
+ _myIndexes = client._myIndexes;
+ _mySubShapes = client._mySubShapes;
+ pid_client = client.pid_client;
+}
+
//=======================================================================
// function : Create()
// purpose :
pid_client = client->getPID();
}
+//=======================================================================
+// function : get_client()
+// purpose : Static method to have the only one instance of GEOM_Client
+//=======================================================================
+#ifdef SINGLE_CLIENT
+GEOM_Client& GEOM_Client::get_client()
+{
+ static GEOM_Client a;
+ return a;
+}
+#else
+GEOM_Client GEOM_Client::get_client()
+{
+ return GEOM_Client();
+}
+#endif
+
//=======================================================================
// function : Find()
// purpose :
//=======================================================================
Standard_Integer GEOM_Client::Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S )
{
- if(_myIndexes.count(IOR) != 0)
- {
- Standard_Integer i =_myIndexes[IOR];
- S = myShapes.Value(i);
- return i;
- }
+ if (_myIndexes.count(IOR) != 0)
+ {
+ Standard_Integer i = _myIndexes[IOR];
+ S = myShapes.Value(i);
+ return i;
+ }
return 0;
}
{
myIORs.Append(IOR);
myShapes.Append(S);
- _myIndexes[IOR]=myIORs.Length();
+ _myIndexes[IOR] = myIORs.Length();
}
//=======================================================================
_myIndexes.erase(IOR);
_mySubShapes.erase(IOR);
}
- return;
}
//=======================================================================
TopoDS_Shape aMainShape = GetShape (geom, aShape->GetMainShape());
GEOM::ListOfLong_var list = aShape->GetSubShapeIndices();
- TopTools_IndexedMapOfShape anIndices;
CORBA::String_var aMainIOR = geom->GetStringFromIOR(aShape->GetMainShape());
TCollection_AsciiString mainIOR = (char*)aMainIOR.in();
//find subshapes only one time
if(_mySubShapes.count(mainIOR)==0)
+ {
+ TopTools_IndexedMapOfShape anIndices;
+ TopExp::MapShapes(aMainShape, anIndices);
+ Standard_Integer ii = 1, nbSubSh = anIndices.Extent();
+ for (; ii <= nbSubSh; ii++)
{
- TopExp::MapShapes(aMainShape, anIndices);
- Standard_Integer ii = 1, nbSubSh = anIndices.Extent();
- for (; ii <= nbSubSh; ii++)
- {
- _mySubShapes[mainIOR].push_back(anIndices.FindKey(ii));
- }
+ _mySubShapes[mainIOR].push_back(anIndices.FindKey(ii));
}
+ }
/* Case of only one subshape */
if (list->length() == 1 && list[0] > 0) {
TopoDS_Compound aCompound;
B.MakeCompound(aCompound);
for (int i = 0; i < list->length(); i++) {
- if (0 < list[i] && list[i] <= anIndices.Extent()) {
+ if (0 < list[i] && list[i] <= _mySubShapes[mainIOR].size()) {
TopoDS_Shape aSubShape = _mySubShapes[mainIOR][list[i]-1];
B.Add(aCompound, aSubShape);
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-
// GEOM GEOMClient : tool to transfer BREP files from GEOM server to GEOM client
// File : GEOM_Client.hxx
// Author : Yves FRICAUD
// Module : GEOM
-// $Header$
-//
+
#ifndef _GEOM_Client_HeaderFile
#define _GEOM_Client_HeaderFile
#include <SALOMEconfig.h>
#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 _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
+
class TCollection_AsciiString;
class TopoDS_Shape;
-
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
* and the SHAPE_READER macro defines also a new object
*/
#define SINGLE_CLIENT
+
//=====================================================================
// GEOM_Client : class definition
//=====================================================================
class GEOMCLIENT_EXPORT GEOM_Client {
-public:
-
- inline void* operator new(size_t,void* anAddress)
+ public:
+
+ 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);
}
// Methods PUBLIC
- //
- //Standard_EXPORT
+ //
+ //Standard_EXPORT
GEOM_Client();
- //Standard_EXPORT
+ //Standard_EXPORT
GEOM_Client(Engines::Container_ptr client);
- //Standard_EXPORT
+ //Standard_EXPORT
+ GEOM_Client(const GEOM_Client& client);
+ //Standard_EXPORT
Standard_Integer Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S ) ;
- //Standard_EXPORT
+ //Standard_EXPORT
Standard_Integer Find( const TopoDS_Shape& S, TCollection_AsciiString& IOR ) ;
- //Standard_EXPORT
+ //Standard_EXPORT
void Bind( const TCollection_AsciiString& IOR, const TopoDS_Shape& S ) ;
- //Standard_EXPORT
+ //Standard_EXPORT
TopoDS_Shape GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape );
- //Standard_EXPORT
+ //Standard_EXPORT
void RemoveShapeFromBuffer( const TCollection_AsciiString& IOR ) ;
- //Standard_EXPORT
+ //Standard_EXPORT
void ClearClientBuffer() ;
- //Standard_EXPORT
+ //Standard_EXPORT
unsigned int BufferLength() ;
TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape);
#ifdef SINGLE_CLIENT
- static GEOM_Client& get_client() { static GEOM_Client a;return a; }
+ static GEOM_Client& get_client();
#else
- static GEOM_Client get_client() { return GEOM_Client(); }
+ static GEOM_Client get_client();
#endif
-private:
+ private:
// Fields PRIVATE
//
TColStd_SequenceOfAsciiString myIORs ;
bool ret = false;
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
(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();
- }
+ if ( appStudy && !CORBA::is_nil( obj ) )
+ ret = obj->GetShapeType() == GEOM::COMPOUND && obj->GetMaxShapeType() == GEOM::VERTEX;
return ret;
}
}
}
-static bool isCompoundOfVertices( const TopoDS_Shape& theShape )
+static int getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin )
{
- 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()]++;
- }
- }
+ if ( shape.IsNull() )
+ return TopAbs_SHAPE;
+
+ int ret = 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;
+ int stype = getMinMaxShapeType( sub_shape, ismin );
+ if ( stype == TopAbs_SHAPE ) continue;
+ if ( ismin && stype > ret )
+ ret = stype;
+ else if ( !ismin && ( ret < TopAbs_SOLID || stype < ret ) )
+ ret = stype;
}
- ret = nbTypes[TopAbs_VERTEX] > 0 && nbTypes[TopAbs_COMPOUND] == 1;
}
+
return ret;
}
+static bool isCompoundOfVertices( const TopoDS_Shape& theShape )
+{
+ return theShape.ShapeType() == TopAbs_COMPOUND && getMinMaxShapeType( theShape, false ) == TopAbs_VERTEX;
+}
+
//================================================================
// Function : getFilter
// Purpose : Get filter corresponding to the type of object
<source>GEOM_CENTER_POINT</source>
<translation>Center Point</translation>
</message>
-
<message>
<source>GEOM_CENTRAL_POINT</source>
<translation>Central Point</translation>
</message>
<message>
<source>GEOM_SKETCHER_ADD_PARAMS</source>
- <translation>Additionnal Parameters</translation>
+ <translation>Additionnal Parameters</translation>
</message>
<message>
<source>GEOM_SKETCHER_ANGLE</source>
- <translation>Angle</translation>
+ <translation>Angle</translation>
</message>
<message>
<source>GEOM_SKETCHER_ANGLE2</source>
- <translation>Angle :</translation>
+ <translation>Angle :</translation>
</message>
<message>
<source>GEOM_SKETCHER_APPLY</source>
</message>
<message>
<source>GEOM_SKETCHER_CENTER</source>
- <translation>Center</translation>
+ <translation>Center</translation>
</message>
<message>
<source>GEOM_SKETCHER_CENTER2</source>
<translation>Center :</translation>
- </message>
+ </message>
<message>
<source>GEOM_SKETCHER_CENTER_X</source>
<translation>Center X coord. :</translation>
</message>
<message>
<source>GEOM_SKETCHER_END_POINT2</source>
- <translation>End Point :</translation>
+ <translation>End Point :</translation>
</message>
<message>
<source>GEOM_SKETCHER_RADIUS</source>
<source>GEOM_AXIS_DEFAULT</source>
<translation>(Z axis by default)</translation>
</message>
-
<message>
<source>GEOM_VECTOR_LENGTH</source>
<translation>Vector Length :</translation>
</message>
<message>
<source>GEOM_PRECISION_HINT</source>
- <translation>
-Input value precision can be adjusted using
+ <translation>Input value precision can be adjusted using
'%1' parameter in Geometry module preferences.</translation>
</message>
<message>
<message>
<source>GEOM_PLUGINS_OTHER</source>
<translation>Other</translation>
- </message>
+ </message>
</context>
<context>
<name>BasicGUI_CurveDlg</name>
<message>
<source>SHOW_ALL_SUB_SHAPES</source>
<translation>Show all sub-shapes</translation>
- </message>
+ </message>
<message>
<source>SELECT_ALL</source>
<translation>Select All</translation>
<source>GEOM_SKETCHER_ABS</source>
<translation>Absolu</translation>
</message>
+ <message>
+ <source>GEOM_SKETCHER_ADD_PARAMS</source>
+ <translation>TODO</translation>
+ </message>
<message>
<source>GEOM_SKETCHER_ANGLE</source>
<translation>Angle</translation>
<source>GEOM_SKETCHER_ARC</source>
<translation>Arc</translation>
</message>
+ <message>
+ <source>GEOM_SKETCHER_CENTER</source>
+ <translation>Center</translation>
+ </message>
+ <message>
+ <source>GEOM_SKETCHER_CENTER2</source>
+ <translation>Centre :</translation>
+ </message>
+ <message>
+ <source>GEOM_SKETCHER_CENTER_X</source>
+ <translation>Centre coord. X :</translation>
+ </message>
+ <message>
+ <source>GEOM_SKETCHER_CENTER_Y</source>
+ <translation>Centre coord. Y :</translation>
+ </message>
+ <message>
+ <source>GEOM_SKETCHER_CENTER_DX</source>
+ <translation>Centre coord. DX :</translation>
+ </message>
+ <message>
+ <source>GEOM_SKETCHER_CENTER_DY</source>
+ <translation>Centre coord. DY :</translation>
+ </message>
<message>
<source>GEOM_SKETCHER_DEST</source>
<translation>Destination</translation>
<source>GEOM_SKETCHER_LENGTH2</source>
<translation>Longueur :</translation>
</message>
+ <message>
+ <source>GEOM_SKETCHER_NONE</source>
+ <translation>Aucun (Tangentiel)</translation>
+ </message>
<message>
<source>GEOM_SKETCHER_PER</source>
<translation>Perpendiculaire</translation>
</message>
<message>
<source>GEOM_SKETCHER_END_POINT2</source>
- <translation>End Point :</translation>
+ <translation>End Point :</translation>
+ </message>
+ <message>
+ <source>GEOM_SKETCHER_RADIUS</source>
+ <translation>Rayon</translation>
</message>
<message>
<source>GEOM_SKETCHER_RADIUS2</source>
<translation>INOUT</translation>
</message>
<message>
- <source>TOP_GET_SHAPES_ON_SHAPES</source>
+ <source>TOP_GET_SHAPES_ON_SHAPE</source>
<translation>Trouver les éléments d'un objet</translation>
</message>
<message>
- <source>MEN_GET_SHAPES_ON_SHAPES</source>
+ <source>MEN_GET_SHAPES_ON_SHAPE</source>
<translation>Trouver les éléments d'un objet</translation>
</message>
<message>
- <source>STB_GET_SHAPES_ON_SHAPES</source>
+ <source>STB_GET_SHAPES_ON_SHAPE</source>
+ <translation>Trouve les éléments d'un objet</translation>
+ </message>
+ <message>
+ <source>TOP_GET_SHARED_SHAPES</source>
<translation>Trouver les éléments d'un objet</translation>
</message>
+ <message>
+ <source>MEN_GET_SHARED_SHAPES</source>
+ <translation>Trouver les éléments partagés</translation>
+ </message>
+ <message>
+ <source>STB_GET_SHARED_SHAPES</source>
+ <translation>Trouve les éléments partagés</translation>
+ </message>
<message>
<source>GEOM_PUBLISH_RESULT_GRP</source>
<translation>Options avancées</translation>
<translation>Ouvrir une Texture</translation>
</message>
</context>
+<context>
+ <name>OperationGUI_GetSharedShapesDlg</name>
+ <message>
+ <source>GEOM_SHARED_SHAPES_TITLE</source>
+ <translation>Trouver les éléments partagés</translation>
+ </message>
+ <message>
+ <source>GEOM_GET_SHARED_SHAPES</source>
+ <translation>Eléments partagés</translation>
+ </message>
+ <message>
+ <source>GEOM_SHARED_SHAPES_INPUT</source>
+ <translation>Paramètres d'entrée</translation>
+ </message>
+ <message>
+ <source>MSG_SHARED_SHAPES_TOO_FEW_SHAPES</source>
+ <translation>Pas assez d'éléments sélectionnés</translation>
+ </message>
+ <message>
+ <source>GEOM_SHARED_SHAPE</source>
+ <translation>Partagé_%1</translation>
+ </message>
+</context>
<context>
<name>AdvancedGUI_PipeTShapeDlg</name>
<message>
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//NOTE: This is an intreface to a function for the Rotate operation.
-//
+// NOTE: This is an interface to a function for the Rotate operation.
+
#include "GEOM_Function.hxx"
+#include <gp_XYZ.hxx>
+
#define ROTATE_ANGLE 1
#define ROTATE_AXIS 2
#define ROTATE_ORGN 3
#define ROTATE_STEP1 4
-#define ROTATE_NBITER1 5
-#define ROTATE_NBITER2 6
+#define ROTATE_NBITER1 5
+#define ROTATE_NBITER2 6
#define ROTATE_CENTRAL_POINT 7
#define ROTATE_POINT1 8
#define ROTATE_POINT2 9
+#define ROTATE_DIR2_X 10
+#define ROTATE_DIR2_Y 11
+#define ROTATE_DIR2_Z 12
class GEOMImpl_IRotate
{
Handle(GEOM_Function) GetOriginal() { return _func->GetReference(ROTATE_ORGN); }
- void SetStep(double theStep) { return _func->SetReal(ROTATE_STEP1, theStep); }
+ void SetStep(double theStep) { _func->SetReal(ROTATE_STEP1, theStep); }
double GetStep() { return _func->GetReal(ROTATE_STEP1); }
int GetNbIter2() { return _func->GetInteger(ROTATE_NBITER2); }
+ void SetDir2 (gp_XYZ theDir2)
+ {
+ _func->SetReal(ROTATE_DIR2_X, theDir2.X());
+ _func->SetReal(ROTATE_DIR2_Y, theDir2.Y());
+ _func->SetReal(ROTATE_DIR2_Z, theDir2.Z());
+ }
+
+ gp_XYZ GetDir2()
+ {
+ gp_XYZ aRes (0., 0., 0.);
+ aRes.SetX(_func->GetReal(ROTATE_DIR2_X));
+ aRes.SetY(_func->GetReal(ROTATE_DIR2_Y));
+ aRes.SetZ(_func->GetReal(ROTATE_DIR2_Z));
+ return aRes;
+ }
private:
*/
//================================================================================
- gp_Vec GetNormal(const TopoDS_Face& face, const BRepExtrema_DistShapeShape& extrema)
+ gp_Vec GetNormal (const TopoDS_Face& face, const BRepExtrema_DistShapeShape& extrema)
{
gp_Vec defaultNorm(1,0,0); // to have same normals on different faces
try {
}
return defaultNorm;
}
+
+ //================================================================================
+ /*!
+ * \brief Return type of shape for explode. In case of compound it will be a type of sub shape.
+ */
+ //================================================================================
+
+ TopAbs_ShapeEnum GetTypeOfSimplePart (const TopoDS_Shape& theShape)
+ {
+ TopAbs_ShapeEnum aType = theShape.ShapeType();
+ if (aType == TopAbs_VERTEX) return TopAbs_VERTEX;
+ else if (aType == TopAbs_EDGE || aType == TopAbs_WIRE) return TopAbs_EDGE;
+ else if (aType == TopAbs_FACE || aType == TopAbs_SHELL) return TopAbs_FACE;
+ else if (aType == TopAbs_SOLID || aType == TopAbs_COMPSOLID) return TopAbs_SOLID;
+ else if (aType == TopAbs_COMPOUND) {
+ // Only the iType of the first shape in the compound is taken into account
+ TopoDS_Iterator It (theShape, Standard_False, Standard_False);
+ if (It.More()) {
+ return GetTypeOfSimplePart(It.Value());
+ }
+ }
+ return TopAbs_SHAPE;
+ }
}
//=============================================================================
/*!
- case GetInPlace:
- default:
+ * case GetInPlace:
+ * default:
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) theShapeWhere,
Handle(GEOM_Object) aResult;
bool isFound = false;
- Standard_Integer iType = TopAbs_SOLID;
- Standard_Integer compType = TopAbs_SOLID;
+ TopAbs_ShapeEnum iType = TopAbs_SOLID;
//Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.;
Standard_Real tab_aWhat[4], tab_aWhere[4];
Standard_Real dl_l = 1e-3;
GProp_GProps aProps;
// Find the iType of the aWhat shape
+ /*
if ( aWhat.ShapeType() == TopAbs_VERTEX ) iType = TopAbs_VERTEX;
else if ( aWhat.ShapeType() == TopAbs_EDGE || aWhat.ShapeType() == TopAbs_WIRE ) iType = TopAbs_EDGE;
else if ( aWhat.ShapeType() == TopAbs_FACE || aWhat.ShapeType() == TopAbs_SHELL ) iType = TopAbs_FACE;
SetErrorCode("Error: theShapeWhat is an empty COMPOUND.");
return NULL;
}
- compType = It.Value().ShapeType();
+ TopAbs_ShapeEnum compType = It.Value().ShapeType();
if ( compType == TopAbs_VERTEX ) iType = TopAbs_VERTEX;
else if ( compType == TopAbs_EDGE || compType == TopAbs_WIRE ) iType = TopAbs_EDGE;
else if ( compType == TopAbs_FACE || compType == TopAbs_SHELL) iType = TopAbs_FACE;
SetErrorCode("Error: An attempt to extract a shape of not supported type.");
return NULL;
}
+ */
+ iType = GetTypeOfSimplePart(aWhat);
+ if (iType == TopAbs_SHAPE) {
+ SetErrorCode("Error: An attempt to extract a shape of not supported type.");
+ return NULL;
+ }
- TopExp_Explorer Exp_aWhat( aWhat, TopAbs_ShapeEnum( iType ) );
- TopExp_Explorer Exp_aWhere( aWhere, TopAbs_ShapeEnum( iType ) );
- TopExp_Explorer Exp_Edge( aWhere, TopAbs_EDGE );
+ TopExp_Explorer Exp_aWhat ( aWhat, iType );
+ TopExp_Explorer Exp_aWhere ( aWhere, iType );
+ TopExp_Explorer Exp_Edge ( aWhere, TopAbs_EDGE );
// Find the shortest edge in theShapeWhere shape
BRepBndLib::Add(aWhere, BoundingBox);
// 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 <Standard_Stream.hxx>
#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
-#include <TFunction_DriverTable.hxx>
-#include <TFunction_Driver.hxx>
-#include <TFunction_Logbook.hxx>
-#include <TDF_Tool.hxx>
-
#include <GEOM_Function.hxx>
#include <GEOM_PythonDump.hxx>
#include <GEOMImpl_Types.hxx>
+#include <TFunction_DriverTable.hxx>
+#include <TFunction_Driver.hxx>
+#include <TFunction_Logbook.hxx>
+#include <TDF_Tool.hxx>
+
+#include <BRep_Tool.hxx>
+#include <BRep_Builder.hxx>
+#include <TopExp.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Compound.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+#include <gp_Trsf.hxx>
+
+#include <StdFail_NotDone.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
//Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_TranslateDriver::GetID()) return NULL;
- GEOMImpl_ITranslate aTI(aFunction);
+ GEOMImpl_ITranslate aTI (aFunction);
aTI.SetVector(theVector->GetLastFunction());
aTI.SetVector2(theVector2->GetLastFunction());
aTI.SetOriginal(aLastFunction);
return aCopy;
}
+//=============================================================================
+/*!
+ * TranslateShape1D
+ */
+//=============================================================================
+/*
+TopoDS_Shape GEOMImpl_ITransformOperations::TranslateShape1D (const TopoDS_Shape& theShape,
+ GEOMImpl_ITranslate* theTI)
+{
+ TopoDS_Shape aRes;
+
+ // Vector
+ Handle(GEOM_Function) aVector = theTI->GetVector();
+ if (aVector.IsNull()) {
+ StdFail_NotDone::Raise("Invalid object is given for vector argument");
+ }
+ TopoDS_Shape aV = aVector->GetValue();
+ if (aV.IsNull() || aV.ShapeType() != TopAbs_EDGE) {
+ StdFail_NotDone::Raise("Invalid object is given for vector argument");
+ }
+ TopoDS_Edge anEdge = TopoDS::Edge(aV);
+
+ gp_Pnt aP1 = BRep_Tool::Pnt(TopExp::FirstVertex(anEdge));
+ gp_Pnt aP2 = BRep_Tool::Pnt(TopExp::LastVertex(anEdge));
+ if (aP1.Distance(aP2) < gp::Resolution()) {
+ StdFail_NotDone::Raise("Invalid object is given for vector argument");
+ }
+
+ // Step and Nb.times
+ Standard_Real step = theTI->GetStep1();
+ Standard_Integer nbtimes = theTI->GetNbIter1();
+
+ // Make multi-translation
+ gp_Trsf aTrsf;
+ gp_Vec aVec;
+ TopoDS_Compound aCompound;
+ BRep_Builder B;
+ B.MakeCompound(aCompound);
+
+ gp_Vec Vec (aP1, aP2);
+ Vec.Normalize();
+
+ TopLoc_Location aLocOrig = theShape.Location();
+ gp_Trsf aTrsfOrig = aLocOrig.Transformation();
+
+ for (int i = 0; i < nbtimes; i++) {
+ aVec = Vec * (i * step);
+ aTrsf.SetTranslation(aVec);
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // in shape and need a great time to process
+ //BRepBuilderAPI_Transform aTransformation(theShape, aTrsf, Standard_False);
+ //B.Add(aCompound, aTransformation.Shape());
+ TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
+ B.Add(aCompound, theShape.Located(aLocRes));
+ }
+ aRes = aCompound;
+
+ return aRes;
+}
+*/
+
+//=============================================================================
+/*!
+ * TranslateShape2D
+ */
+//=============================================================================
+/*
+TopoDS_Shape GEOMImpl_ITransformOperations::TranslateShape2D (const TopoDS_Shape& theShape,
+ GEOMImpl_ITranslate* theTI)
+{
+ TopoDS_Shape aRes;
+
+ // Vectors
+ Handle(GEOM_Function) aVector1 = theTI->GetVector();
+ Handle(GEOM_Function) aVector2 = theTI->GetVector2();
+
+ if (aVector1.IsNull() || aVector2.IsNull()) {
+ StdFail_NotDone::Raise("Invalid object is given for vector argument");
+ }
+
+ TopoDS_Shape aV1 = aVector1->GetValue();
+ TopoDS_Shape aV2 = aVector2->GetValue();
+
+ if (aV1.IsNull() || aV1.ShapeType() != TopAbs_EDGE ||
+ aV2.IsNull() || aV2.ShapeType() != TopAbs_EDGE) {
+ StdFail_NotDone::Raise("Invalid object is given for vector argument");
+ }
+
+ TopoDS_Edge anEdge1 = TopoDS::Edge(aV1);
+ TopoDS_Edge anEdge2 = TopoDS::Edge(aV2);
+
+ gp_Pnt aP11 = BRep_Tool::Pnt(TopExp::FirstVertex(anEdge1));
+ gp_Pnt aP12 = BRep_Tool::Pnt(TopExp::LastVertex(anEdge1));
+ gp_Pnt aP21 = BRep_Tool::Pnt(TopExp::FirstVertex(anEdge2));
+ gp_Pnt aP22 = BRep_Tool::Pnt(TopExp::LastVertex(anEdge2));
+
+ if (aP11.Distance(aP12) < gp::Resolution() ||
+ aP21.Distance(aP22) < gp::Resolution()) {
+ StdFail_NotDone::Raise("Invalid object is given for vector argument");
+ }
+
+ gp_Vec Vec1 (aP11, aP12);
+ gp_Vec Vec2 (aP21, aP22);
+
+ Vec1.Normalize();
+ Vec2.Normalize();
+
+ // Step and Nb.times
+ Standard_Real step1 = theTI->GetStep1(), step2 = theTI->GetStep2();
+ Standard_Integer nbtimes1 = theTI->GetNbIter1(), nbtimes2 = theTI->GetNbIter2();
+
+ // Make multi-translation
+ gp_Trsf aTrsf;
+ gp_Vec aVec;
+ Standard_Real DX, DY, DZ;
+ TopoDS_Compound aCompound;
+ BRep_Builder B;
+ B.MakeCompound(aCompound);
+
+ TopLoc_Location aLocOrig = theShape.Location();
+ gp_Trsf aTrsfOrig = aLocOrig.Transformation();
+
+ for (int i = 0; i < nbtimes1; i++) {
+ for (int j = 0; j < nbtimes2; j++) {
+ DX = i * step1 * Vec1.X() + j * step2 * Vec2.X();
+ DY = i * step1 * Vec1.Y() + j * step2 * Vec2.Y();
+ DZ = i * step1 * Vec1.Z() + j * step2 * Vec2.Z();
+ aVec.SetCoord(DX, DY, DZ);
+ aTrsf.SetTranslation(aVec);
+ //NPAL18620: performance problem: multiple locations are accumulated
+ // in shape and need a great time to process
+ //BRepBuilderAPI_Transform aBRepTransformation(theShape, aTrsf, Standard_False);
+ //B.Add(aCompound, aBRepTransformation.Shape());
+ TopLoc_Location aLocRes (aTrsf * aTrsfOrig);
+ B.Add(aCompound, theShape.Located(aLocRes));
+ }
+ }
+ aRes = aCompound;
+
+ return aRes;
+}
+*/
//=============================================================================
/*!
aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_1D);
if (aFunction.IsNull()) return NULL;
- //Check if the function is set correctly
+ //Check if the function is set correctly
if (aFunction->GetDriverGUID() != GEOMImpl_RotateDriver::GetID()) return NULL;
GEOMImpl_IRotate aRI(aFunction);
return aCopy;
}
+//=============================================================================
+/*!
+ * TransformLikeOtherCopy
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy
+ (Handle(GEOM_Object) theObject,
+ Handle(GEOM_Object) theSample)
+{
+ SetErrorCode(KO);
+
+ if (theObject.IsNull() || theSample.IsNull()) return NULL;
+
+ Handle(GEOM_Function) aLastFunction = theObject->GetLastFunction();
+ if (aLastFunction.IsNull()) return NULL; // There is no function which creates an object to be transformed
+
+ Handle(GEOM_Function) aSampleFunc = theSample->GetLastFunction();
+ if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object
+
+ // Add a new Copy object
+ Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+
+ // Add a transform function (depends on theSample function)
+ Handle(GEOM_Function) aFunction =
+ aCopy->AddFunction(aSampleFunc->GetDriverGUID(), aSampleFunc->GetType());
+ if (aFunction.IsNull()) return NULL;
+
+ // Check if the function is set correctly
+ if (aFunction->GetDriverGUID() != aSampleFunc->GetDriverGUID()) return NULL;
+
+ if (aSampleFunc->GetDriverGUID() == GEOMImpl_TranslateDriver::GetID()) {
+ switch (aSampleFunc->GetType()) {
+ case TRANSLATE_1D:
+ {
+ GEOMImpl_ITranslate aRI_sample (aSampleFunc);
+ GEOMImpl_ITranslate aRI_target (aFunction);
+
+ aRI_target.SetVector(aRI_sample.GetVector());
+ aRI_target.SetStep1(aRI_sample.GetStep1());
+ aRI_target.SetNbIter1(aRI_sample.GetNbIter1());
+
+ aRI_target.SetOriginal(aLastFunction);
+ }
+ break;
+ case TRANSLATE_2D:
+ {
+ GEOMImpl_ITranslate aRI_sample (aSampleFunc);
+ GEOMImpl_ITranslate aRI_target (aFunction);
+
+ aRI_target.SetVector(aRI_sample.GetVector());
+ aRI_target.SetStep1(aRI_sample.GetStep1());
+ aRI_target.SetNbIter1(aRI_sample.GetNbIter1());
+
+ aRI_target.SetVector2(aRI_sample.GetVector2());
+ aRI_target.SetStep2(aRI_sample.GetStep2());
+ aRI_target.SetNbIter2(aRI_sample.GetNbIter2());
+
+ aRI_target.SetOriginal(aLastFunction);
+ }
+ break;
+ default:
+ {
+ SetErrorCode("Not implemented case of TransformLikeOtherCopy");
+ return NULL;
+ }
+ }
+ }
+ else if (aSampleFunc->GetDriverGUID() == GEOMImpl_RotateDriver::GetID()) {
+ switch (aSampleFunc->GetType()) {
+ case ROTATE_1D:
+ {
+ GEOMImpl_IRotate aRI_sample (aSampleFunc);
+ GEOMImpl_IRotate aRI_target (aFunction);
+
+ aRI_target.SetAxis(aRI_sample.GetAxis());
+ aRI_target.SetNbIter1(aRI_sample.GetNbIter1());
+
+ aRI_target.SetOriginal(aLastFunction);
+ }
+ break;
+ case ROTATE_2D:
+ {
+ GEOMImpl_IRotate aRI_sample (aSampleFunc);
+ GEOMImpl_IRotate aRI_target (aFunction);
+
+ aRI_target.SetAxis(aRI_sample.GetAxis());
+
+ aRI_target.SetNbIter1(aRI_sample.GetNbIter1());
+ aRI_target.SetNbIter2(aRI_sample.GetNbIter2());
+
+ aRI_target.SetAngle(aRI_sample.GetAngle());
+ aRI_target.SetStep(aRI_sample.GetStep());
+
+ aRI_target.SetDir2(aRI_sample.GetDir2());
+
+ aRI_target.SetOriginal(aLastFunction);
+ }
+ break;
+ case ROTATE_THREE_POINTS_COPY:
+ {
+ GEOMImpl_IRotate aRI_sample (aSampleFunc);
+ GEOMImpl_IRotate aRI_target (aFunction);
+
+ aRI_target.SetCentPoint(aRI_sample.GetCentPoint());
+ aRI_target.SetPoint1(aRI_sample.GetPoint1());
+ aRI_target.SetPoint2(aRI_sample.GetPoint2());
+
+ aRI_target.SetOriginal(aLastFunction);
+ }
+ break;
+ default:
+ {
+ SetErrorCode("Not implemented case of TransformLikeOtherCopy");
+ return NULL;
+ }
+ }
+ }
+ else {
+ SetErrorCode("Not implemented case of TransformLikeOtherCopy");
+ return NULL;
+ }
+
+ // Compute the transformation
+ try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ OCC_CATCH_SIGNALS;
+#endif
+ if (!GetSolver()->ComputeFunction(aFunction)) {
+ SetErrorCode("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) << aCopy << " = geompy.TransformLikeOtherCopy("
+ // << theObject << ", " << theSample << ")";
+
+ SetErrorCode(OK);
+ return aCopy;
+}
// 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_ITransformOperations_HXX_
#define _GEOMImpl_ITransformOperations_HXX_
#include "GEOM_IOperations.hxx"
#include "GEOM_Engine.hxx"
#include "GEOM_Object.hxx"
+
#include <TDocStd_Document.hxx>
+#include <TopoDS_Shape.hxx>
+
+class GEOMImpl_ITranslate;
+class GEOMImpl_IRotate;
class GEOMImpl_ITransformOperations : public GEOM_IOperations
{
double theStep2,
Standard_Integer theNbTimes2);
+ /*
+ Standard_EXPORT static TopoDS_Shape TranslateShape1D (const TopoDS_Shape& theShape,
+ GEOMImpl_ITranslate* theTI);
+
+ Standard_EXPORT static TopoDS_Shape TranslateShape2D (const TopoDS_Shape& theShape,
+ GEOMImpl_ITranslate* theTI);
+ */
+
Standard_EXPORT Handle(GEOM_Object) MirrorPlane (Handle(GEOM_Object) theObject,
Handle(GEOM_Object) thePlane);
Handle(GEOM_Object) thePoint1,
Handle(GEOM_Object) thePoint2);
+ Standard_EXPORT Handle(GEOM_Object) TransformLikeOtherCopy (Handle(GEOM_Object) theObject,
+ Handle(GEOM_Object) theSample);
+
};
#endif
gp_Ax1 AX1(aP1, D);
-
gp_Trsf aTrsf1;
gp_Trsf aTrsf2;
- gp_Pnt P1;
- GProp_GProps System;
- if (anOriginal.ShapeType() == TopAbs_VERTEX) {
- P1 = BRep_Tool::Pnt(TopoDS::Vertex( anOriginal ));
- }
- else if ( anOriginal.ShapeType() == TopAbs_EDGE || anOriginal.ShapeType() == TopAbs_WIRE ) {
- BRepGProp::LinearProperties(anOriginal, System);
- P1 = System.CentreOfMass();
- }
- else if ( anOriginal.ShapeType() == TopAbs_FACE || anOriginal.ShapeType() == TopAbs_SHELL ) {
- BRepGProp::SurfaceProperties(anOriginal, System);
- P1 = System.CentreOfMass();
- }
- else {
- BRepGProp::VolumeProperties(anOriginal, System);
- P1 = System.CentreOfMass();
- }
+ gp_XYZ aDir2 = RI.GetDir2(); // can be set by previous execution
+ if (aDir2.Modulus() < gp::Resolution()) {
+ // Calculate direction as vector from the axis to the shape's center
+ gp_Pnt P1;
+ GProp_GProps System;
+
+ if (anOriginal.ShapeType() == TopAbs_VERTEX) {
+ P1 = BRep_Tool::Pnt(TopoDS::Vertex( anOriginal ));
+ }
+ else if ( anOriginal.ShapeType() == TopAbs_EDGE || anOriginal.ShapeType() == TopAbs_WIRE ) {
+ BRepGProp::LinearProperties(anOriginal, System);
+ P1 = System.CentreOfMass();
+ }
+ else if ( anOriginal.ShapeType() == TopAbs_FACE || anOriginal.ShapeType() == TopAbs_SHELL ) {
+ BRepGProp::SurfaceProperties(anOriginal, System);
+ P1 = System.CentreOfMass();
+ }
+ else {
+ BRepGProp::VolumeProperties(anOriginal, System);
+ P1 = System.CentreOfMass();
+ }
- Handle(Geom_Line) Line = new Geom_Line(AX1);
- GeomAPI_ProjectPointOnCurve aPrjTool( P1, Line );
- gp_Pnt P2 = aPrjTool.NearestPoint();
+ Handle(Geom_Line) Line = new Geom_Line(AX1);
+ GeomAPI_ProjectPointOnCurve aPrjTool( P1, Line );
+ gp_Pnt P2 = aPrjTool.NearestPoint();
- if ( P1.IsEqual(P2, Precision::Confusion() ) ) return 0;
+ if ( P1.IsEqual(P2, Precision::Confusion() ) ) return 0;
+
+ aDir2 = gp_XYZ(P1.X()-P2.X(), P1.Y()-P2.Y(), P1.Z()-P2.Z());
+
+ // Attention: this abnormal action is done for good working of
+ // TransformLikeOther(), used by RestoreSubShapes functionality
+ RI.SetDir2(aDir2);
+ }
- gp_Vec Vec (P1.X()-P2.X(), P1.Y()-P2.Y(), P1.Z()-P2.Z());
+ gp_Vec Vec (aDir2);
Vec.Normalize();
Standard_Integer nbtimes2 = RI.GetNbIter2();
// 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 <Standard_Stream.hxx>
#include <GEOMImpl_TranslateDriver.hxx>
#include <GEOMImpl_ITranslate.hxx>
+#include <GEOMImpl_ITransformOperations.hxx>
#include <GEOMImpl_Types.hxx>
#include <GEOM_Function.hxx>
if (aFunction.IsNull()) return 0;
- GEOMImpl_ITranslate TI(aFunction);
+ GEOMImpl_ITranslate TI (aFunction);
gp_Trsf aTrsf;
gp_Pnt aP1, aP2;
Standard_Integer aType = aFunction->GetType();
B.Add(aCompound, anOriginal.Located(aLocRes));
}
aShape = aCompound;
+ //aShape = GEOMImpl_ITransformOperations::TranslateShape1D(anOriginal, &TI);
}
else if (aType == TRANSLATE_2D) {
Standard_Integer nbtimes1 = TI.GetNbIter1(), nbtimes2 = TI.GetNbIter2();
B.Add(aCompound, anOriginal.Located(aLocRes));
}
}
- aShape = aCompound;
+ aShape = aCompound;
+ //aShape = GEOMImpl_ITransformOperations::TranslateShape2D(anOriginal, &TI);
}
else return 0;
}
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());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
+ GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
+ GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
// Reconstruct arguments and tree of sub-shapes of the arguments
CORBA::String_var anIOR;
aSubO = aShapesOp->GetInPlace(theObject, anArgO);
}
break;
+ case GEOM::FSM_MultiTransformed:
+ {
+ // Only for Multi-transformations
+ GEOM::GEOM_Object_var anArgOTrsf = aTrsfOp->TransformLikeOtherCopy(anArgO, theObject);
+ if (!CORBA::is_nil(anArgOTrsf)) {
+ CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry();
+ Handle(GEOM_Object) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry);
+ Handle(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction();
+ anArgOTrsfFun->SetDescription("");
+ aSubO = aShapesOp->GetInPlace(theObject, anArgOTrsf);
+ }
+ /*
+ Handle(GEOM_Function) anOFun = theObject->GetLastFunction();
+ if (!anOFun.IsNull()) {
+ CORBA::String_var entryArg = anArgO->GetEntry();
+ Handle(GEOM_Object) anArgOImpl = _impl->GetObject(anArgO->GetStudyID(), entryArg);
+ if (!anArgOImpl.IsNull()) {
+ TopoDS_Shape anArgOShape = anArgOImpl->GetValue();
+ TopoDS_Shape aMultiArgShape;
+ //GEOM::GEOM_Object_var anArgOMulti; // ???
+ switch (anOFun->GetType()) {
+ case TRANSLATE_1D:
+ {
+ GEOMImpl_ITranslate aTI (anOFun);
+ aMultiArgShape = GEOMImpl_ITransformOperations::TranslateShape1D(anArgOShape, &aTI);
+ //anArgOMulti = aTrsfOp->Translate1D(anArgO, , , );
+ }
+ break;
+ case TRANSLATE_2D:
+ {
+ GEOMImpl_ITranslate aTI (anOFun);
+ aMultiArgShape = GEOMImpl_ITransformOperations::TranslateShape2D(anArgOShape, &aTI);
+ }
+ break;
+ case ROTATE_1D:
+ {
+ GEOMImpl_IRotate aTI (anOFun);
+ //aMultiArgShape = GEOMImpl_ITransformOperations::TranslateShape2D(anArgOShape, &aTI);
+ }
+ break;
+ case ROTATE_2D:
+ {
+ GEOMImpl_IRotate aTI (anOFun);
+ //aMultiArgShape = GEOMImpl_ITransformOperations::TranslateShape2D(anArgOShape, &aTI);
+ }
+ break;
+ default:
+ {}
+ }
+ GEOM::GEOM_Object_var anArgOMulti = (aMultiArgShape); // TODO
+ Handle(GEOM_Function) anArgOMultiFun = anArgOMulti->GetLastFunction();
+ anArgOMultiFun->SetDescription("");
+ aSubO = aShapesOp->GetInPlace(theObject, anArgOMulti);
+ }
+ }
+ */
+ }
+ break;
case GEOM::FSM_Transformed:
{
// transformation, cannot use GetInPlace, operate with indices
switch (theFindMethod) {
case GEOM::FSM_GetInPlace:
pd << "FSM_GetInPlace"; break;
+ case GEOM::FSM_MultiTransformed:
+ pd << "FSM_MultiTransformed"; break;
case GEOM::FSM_Transformed:
pd << "FSM_Transformed"; break;
case GEOM::FSM_GetSame:
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());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
+ GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
+ GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
// Reconstruct published sub-shapes
SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO);
aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO);
}
break;
+ case GEOM::FSM_MultiTransformed:
+ {
+ // Only for Multi-transformations
+ GEOM::GEOM_Object_var anArgOTrsf = aTrsfOp->TransformLikeOtherCopy(anOldSubO, theNewO);
+ if (!CORBA::is_nil(anArgOTrsf)) {
+ CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry();
+ Handle(GEOM_Object) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry);
+ Handle(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction();
+ anArgOTrsfFun->SetDescription("");
+ aNewSubO = aShapesOp->GetInPlace(theNewO, anArgOTrsf);
+ }
+ }
+ break;
case GEOM::FSM_Transformed:
{
// transformation, cannot use GetInPlace, operate with indices
}
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());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
+ GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
+ GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
// Reconstruct arguments and tree of sub-shapes of the arguments
CORBA::String_var anIOR;
aSubO = aShapesOp->GetInPlace(theObject, anArgO);
}
break;
+ case GEOM::FSM_MultiTransformed:
+ {
+ // Only for Multi-transformations
+ GEOM::GEOM_Object_var anArgOTrsf = aTrsfOp->TransformLikeOtherCopy(anArgO, theObject);
+ if (!CORBA::is_nil(anArgOTrsf)) {
+ CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry();
+ Handle(GEOM_Object) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry);
+ Handle(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction();
+ anArgOTrsfFun->SetDescription("");
+ aSubO = aShapesOp->GetInPlace(theObject, anArgOTrsf);
+ }
+ }
+ break;
case GEOM::FSM_Transformed:
{
// transformation, cannot use GetInPlace, operate with indices
switch (theFindMethod) {
case GEOM::FSM_GetInPlace:
pd << "FSM_GetInPlace"; break;
+ case GEOM::FSM_MultiTransformed:
+ pd << "FSM_MultiTransformed"; break;
case GEOM::FSM_Transformed:
pd << "FSM_Transformed"; break;
case GEOM::FSM_GetSame:
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());
+ GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
+ GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
+ GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
// Reconstruct published sub-shapes
SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO);
aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO);
}
break;
+ case GEOM::FSM_MultiTransformed:
+ {
+ // Only for Multi-transformations
+ GEOM::GEOM_Object_var anArgOTrsf = aTrsfOp->TransformLikeOtherCopy(anOldSubO, theNewO);
+ if (!CORBA::is_nil(anArgOTrsf)) {
+ CORBA::String_var anArgOTrsfEntry = anArgOTrsf->GetEntry();
+ Handle(GEOM_Object) anArgOTrsfImpl = _impl->GetObject(anArgOTrsf->GetStudyID(), anArgOTrsfEntry);
+ Handle(GEOM_Function) anArgOTrsfFun = anArgOTrsfImpl->GetLastFunction();
+ anArgOTrsfFun->SetDescription("");
+ aNewSubO = aShapesOp->GetInPlace(theNewO, anArgOTrsf);
+ }
+ }
+ break;
case GEOM::FSM_Transformed:
{
// transformation, cannot use GetInPlace, operate with indices
// 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 <Standard_Stream.hxx>
return GetObject(anObject);
}
+//=============================================================================
+/*!
+ * TransformLikeOtherCopy
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::TransformLikeOtherCopy
+ (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr theSample)
+{
+ 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();
+
+ //Get the sample object
+ Handle(GEOM_Object) aSample = GetObjectImpl(theSample);
+ if (aSample.IsNull()) return aGEOMObject._retn();
+
+ //Perform the transformation
+ Handle(GEOM_Object) aResObject =
+ GetOperations()->TransformLikeOtherCopy(anObject, aSample);
+ if (!GetOperations()->IsDone() || aResObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(aResObject);
+}
+
//=============================================================================
/*!
* RecomputeObject
// 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_ITransformOperations_i_HeaderFile
#define _GEOM_ITransformOperations_i_HeaderFile
GEOM::GEOM_Object_ptr thePoint1,
GEOM::GEOM_Object_ptr thePoint2);
- GEOM::GEOM_Object_ptr TranslateDXDYDZ (GEOM::GEOM_Object_ptr theObject, CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ);
+ GEOM::GEOM_Object_ptr TranslateDXDYDZ (GEOM::GEOM_Object_ptr theObject,
+ CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ);
- GEOM::GEOM_Object_ptr TranslateDXDYDZCopy (GEOM::GEOM_Object_ptr theObject, CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ);
+ GEOM::GEOM_Object_ptr TranslateDXDYDZCopy (GEOM::GEOM_Object_ptr theObject,
+ CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ);
GEOM::GEOM_Object_ptr TranslateVector (GEOM::GEOM_Object_ptr theObject,
GEOM::GEOM_Object_ptr theVector);
CORBA::Double theDistance,
CORBA::Boolean theCopy);
- GEOM::GEOM_Object_ptr MultiTranslate1D (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector, CORBA::Double theStep, CORBA::Long theNbTimes);
+ GEOM::GEOM_Object_ptr MultiTranslate1D (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr theVector,
+ CORBA::Double theStep, CORBA::Long theNbTimes);
- GEOM::GEOM_Object_ptr MultiTranslate2D (GEOM::GEOM_Object_ptr theObject, GEOM::GEOM_Object_ptr theVector1, CORBA::Double theStep1, CORBA::Long theNbTimes1,
- GEOM::GEOM_Object_ptr theVector2, CORBA::Double theStep2, CORBA::Long theNbTimes2);
+ GEOM::GEOM_Object_ptr MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr theVector1,
+ CORBA::Double theStep1, CORBA::Long theNbTimes1,
+ GEOM::GEOM_Object_ptr theVector2,
+ CORBA::Double theStep2, CORBA::Long theNbTimes2);
GEOM::GEOM_Object_ptr Rotate (GEOM::GEOM_Object_ptr theObject,
GEOM::GEOM_Object_ptr theAxis,
GEOM::GEOM_Object_ptr thePoint1,
GEOM::GEOM_Object_ptr thePoint2);
+ GEOM::GEOM_Object_ptr TransformLikeOtherCopy (GEOM::GEOM_Object_ptr theObject,
+ GEOM::GEOM_Object_ptr theSample);
+
GEOM::GEOM_Object_ptr RecomputeObject (GEOM::GEOM_Object_ptr theObject);
return (GEOM::shape_type)shape.ShapeType();
}
-static GEOM::shape_type getMinShapeType( const TopoDS_Shape& shape )
+static GEOM::shape_type getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin )
{
if ( shape.IsNull() )
return GEOM::SHAPE;
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 )
+ GEOM::shape_type stype = (GEOM::shape_type)getMinMaxShapeType( sub_shape, ismin );
+ if ( stype == GEOM::SHAPE ) continue;
+ if ( ismin && stype > ret )
+ ret = stype;
+ else if ( !ismin && ( ret < GEOM::SOLID || stype < ret ) )
ret = stype;
}
}
//=============================================================================
GEOM::shape_type GEOM_Object_i::GetMinShapeType()
{
- return getMinShapeType( _impl->GetValue() );
+ return getMinMaxShapeType( _impl->GetValue(), true );
+}
+
+//=============================================================================
+/*!
+ * GetMaxShapeType
+ */
+//=============================================================================
+GEOM::shape_type GEOM_Object_i::GetMaxShapeType()
+{
+ return getMinMaxShapeType( _impl->GetValue(), false );
}
//=============================================================================
virtual GEOM::shape_type GetMinShapeType();
+ virtual GEOM::shape_type GetMaxShapeType();
+
virtual void SetName(const char* theName);
virtual char* GetName();
print "\nBox 10x30x70 description:"
print Descr
+ ####### NbShapes #######
+
+ NbSolids = geompy.NbShapes(box, geompy.ShapeType["SOLID"])
+ print "\nBox 10x30x70 quantity of solids:", NbSolids
+
+ ####### ShapeInfo #######
+
+ BoxInfo = geompy.ShapeInfo(box)
+ print "\nBox 10x30x70 shapes:"
+ print BoxInfo
+
####### BasicProperties #######
Props = geompy.BasicProperties(box)
pcyl = geompy.MakeVertex(50, 50, -50)
cyli = geompy.MakeCylinder(pcyl, vz, 40, 100)
fuse = geompy.MakeFuse(sph1, cyli)
- fuse = geompy.MakeFuse(fuse, sph2)
+ sh_1 = geompy.MakeFuse(fuse, sph2)
# As after Fuse we have a compound, we need to obtain a solid from it
- shsh = geompy.SubShapeAll(fuse, geompy.ShapeType["SOLID"])
- sh_1 = shsh[0]
+ #shsh = geompy.SubShapeAll(fuse, geompy.ShapeType["SOLID"])
+ #sh_1 = shsh[0]
geompy.addToStudy(sh_1, "sh_1")
# GetShapesOnShape
anObj = self.GetSubShape(aShape, ListOfIDs)
return anObj
+ ## Extract shapes (main shape or sub-shape) of given type
+ # @param aShape shape
+ # @param aType shape type
+ def ExtractShapes(self, aShape, aType, sorted = False):
+ ret = []
+ t = aShape.GetShapeType()._v
+ if hasattr(aType, "_v"): aType = aType._v
+ if t == aType:
+ ret.append(aShape )
+ elif sorted:
+ ret = self.SubShapeAllSortedCentres(aShape, aType)
+ else:
+ ret = self.SubShapeAll(aShape, aType)
+ return ret
+
# end of l4_decompose_d
## @}
# 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() )
+ lim = GEOM.SHAPE
+ for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
Limit = lim._v
pass
anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
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() )
+ lim = GEOM.SHAPE
+ for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
Limit = lim._v
pass
anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
RaiseIfFailed("WhatIs", self.MeasuOp)
return aDescr
+ ## Obtain quantity of shapes of the given type in \a theShape.
+ # If \a theShape is of type \a theType, it is also counted.
+ # @param theShape Shape to be described.
+ # @return Quantity of shapes of type \a theType in \a theShape.
+ #
+ # @ref tui_measurement_tools_page "Example"
+ def NbShapes (self, theShape, theType):
+ # Example: see GEOM_TestMeasures.py
+ listSh = self.SubShapeAllIDs(theShape, theType)
+ Nb = len(listSh)
+ if theShape.GetShapeType()._v == theType:
+ Nb = Nb + 1
+ pass
+ return Nb
+
+ ## Obtain quantity of shapes of each type in \a theShape.
+ # The \a theShape is also counted.
+ # @param theShape Shape to be described.
+ # @return Dictionary of shape types with bound quantities of shapes.
+ #
+ # @ref tui_measurement_tools_page "Example"
+ def ShapeInfo (self, theShape):
+ # Example: see GEOM_TestMeasures.py
+ aDict = {}
+ for typeSh in ShapeType:
+ if typeSh != "AUTO" and typeSh != "SHAPE":
+ listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
+ Nb = len(listSh)
+ if theShape.GetShapeType()._v == ShapeType[typeSh]:
+ Nb = Nb + 1
+ pass
+ aDict[typeSh] = Nb
+ pass
+ pass
+ return aDict
+
## Get a point, situated at the centre of mass of theShape.
# @param theShape Shape to define centre of mass of.
# @return New GEOM_Object, containing the created point.
#RaiseIfFailed("Import", self.InsertOp)
# recieve name using returned vertex
UnitName = "M"
- vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
+ if anObj.GetShapeType() == GEOM.VERTEX:
+ vertices = [anObj]
+ else:
+ vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
if len(vertices)>0:
p = self.PointCoordinates(vertices[0])
if abs(p[0]-0.01) < 1.e-6:
#include "GEOM_AISShape.ixx"
#include "SALOME_InteractiveObject.hxx"
+#include "GEOM_AISVector.hxx"
// Open CASCADE Includes
#include <AIS_Drawer.hxx>
if (isShowVectors())
{
+ const bool isVector = IsKind(STANDARD_TYPE(GEOM_AISVector));
TopExp_Explorer Exp ( myshape, TopAbs_EDGE );
for ( ; Exp.More(); Exp.Next() ) {
TopoDS_Vertex aV1, aV2;
TopoDS_Edge anEdgeE = TopoDS::Edge(Exp.Current());
+ if ( !isVector )
+ // draw curve direction (issue 0021087)
+ anEdgeE.Orientation( TopAbs_FORWARD );
if ( anEdgeE.IsNull() ) continue;
TEdgeSet::Iterator anIter (myEdgeSet);
for (; anIter.More(); anIter.Next()) {
- const TopoDS_Edge& anEdge = anIter.Value();
- OCC2VTK(anEdge,aPolyData,aPts,myIsVector);
+ TopoDS_Edge anEdge = anIter.Value();
+ if ( !myIsVector )
+ // draw curve direction (issue 0021087)
+ anEdge.Orientation( TopAbs_FORWARD );
+ OCC2VTK(anEdge,aPolyData,aPts,myIsVector||myIsVectorMode);
}
}
void GEOM_EdgeSource::SetVectorMode (bool theMode)
{
- myIsVector = theMode;
+ myIsVectorMode = theMode;
}
bool GEOM_EdgeSource::GetVectorMode ()
{
- return myIsVector;
+ return !myIsVector && myIsVectorMode;
}
TEdgeSet myEdgeSet;
// The <myIsVector> flag is common for all edges, because the shape,
// representing a vector, can have only one edge.
- bool myIsVector;
+ bool myIsVector, myIsVectorMode;
void Execute();
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
- initName(getNewObjectName());
+ //initName(getNewObjectName());
+ initName(getPrefixByType());
ConstructorsClicked(0);
GroupPoints->PushButton1->click();
if (!onAccept())
return false;
- initName(getNewObjectName());
+ //initName(getNewObjectName());
+ initName(getPrefixByType());
return true;
}
//=======================================================================
void OperationGUI_GetSharedShapesDlg::ComboTextChanged()
{
- initName(getNewObjectName());
+ //initName(getNewObjectName());
+ initName(getPrefixByType());
}
//=================================================================================
if (!aList->length())
return false;
+ if (aList->length() > 1)
+ myMainFrame->ResultName->setText(getPrefixByType());
+
for (int i = 0, n = aList->length(); i < n; i++)
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
}
//================================================================
-// Function : getNewObjectName
+// Function : getPrefixByType
// Purpose :
//================================================================
-QString OperationGUI_GetSharedShapesDlg::getNewObjectName() const
+QString OperationGUI_GetSharedShapesDlg::getPrefixByType () const
{
+ QString aPref;
+
int aLimit = GroupPoints->ComboBox1->currentIndex();
- //QString aName = tr("GEOM_SHARED_SHAPE");
- QString aName;
switch (aLimit) {
- case 0: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SOLID")) ; break;
- case 1: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHELL")) ; break;
- case 2: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_FACE")) ; break;
- case 3: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_WIRE")) ; break;
- case 4: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_EDGE")) ; break;
- case 5: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_VERTEX")); break;
- default: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHAPE")) ;
+ case 0: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SOLID")) ; break;
+ case 1: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHELL")) ; break;
+ case 2: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_FACE")) ; break;
+ case 3: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_WIRE")) ; break;
+ case 4: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_EDGE")) ; break;
+ case 5: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_VERTEX")); break;
+ default: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHAPE")) ;
}
- return aName;
+ return aPref;
}
virtual bool isValid (QString&);
virtual bool execute (ObjectList&);
virtual GEOM::GEOM_Object_ptr getFather (GEOM::GEOM_Object_ptr);
- virtual QString getNewObjectName() const;
+ QString getPrefixByType() const;
private:
void Init();
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
//myListMaterials.length( 0 ); // obsolete
- GEOM::shape_type type = GEOM::SOLID;
+ GEOM::shape_type type = GEOM::SHAPE;
for (int i = 0; i < myListShapes.length(); i++)
- type = qMax( type, myListShapes[i]->GetMinShapeType() );
+ type = qMin( type, myListShapes[i]->GetMaxShapeType() );
int idx = qMax( 0, GroupPoints->ComboBox1->findData( type ) );
GroupPoints->ComboBox1->setCurrentIndex( idx );
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// GEOM GEOMGUI : GUI for Geometry component
+// File : TransformationGUI_MultiRotationDlg.cxx
+// Author : Damien COQUERET, Open CASCADE S.A.S.
-// GEOM GEOMGUI : GUI for Geometry component
-// File : TransformationGUI_MultiRotationDlg.cxx
-// Author : Damien COQUERET, Open CASCADE S.A.S.
-//
#include "TransformationGUI_MultiRotationDlg.h"
#include <DlgRef.h>
void TransformationGUI_MultiRotationDlg::SetDoubleSpinBoxStep (double step)
{
GroupDimensions->SpinBox_DX2->setSingleStep(step);
-
+
// san: Commented so as not to override specific step settings
//GroupPoints->SpinBox_DX->setSingleStep((int)step);
//GroupDimensions->SpinBox_DX1->setSingleStep(step);
case 0:
ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
break;
- case 1:
+ case 1:
ok = GroupDimensions->SpinBox_DX1->isValid( msg, !IsPreview() ) && ok;
ok = GroupDimensions->SpinBox_DY1->isValid( msg, !IsPreview() ) && ok;
ok = GroupDimensions->SpinBox_DX2->isValid( msg, !IsPreview() ) && ok;
- ok = GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) && ok;
+ ok = GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) && ok;
break;
}
return !(myBase->_is_nil() || myVector->_is_nil()) && ok;
anArgs->length(1);
anArgs[0] = myBase;
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
- /*theFindMethod=*/GEOM::FSM_Transformed,
+ /*theFindMethod=*/GEOM::FSM_MultiTransformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
}
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// GEOM GEOMGUI : GUI for Geometry component
+// File : TransformationGUI_MultiTranslationDlg.cxx
+// Author : Damien COQUERET, Open CASCADE S.A.S.
-// GEOM GEOMGUI : GUI for Geometry component
-// File : TransformationGUI_MultiTranslationDlg.cxx
-// Author : Damien COQUERET, Open CASCADE S.A.S.
-//
#include "TransformationGUI_MultiTranslationDlg.h"
#include <DlgRef.h>
connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(int)), this, SLOT(ValueChangedInSpinBox(int)));
- connect(GroupPoints->SpinBox_DX, SIGNAL(textChanged(const QString& )),
+ connect(GroupPoints->SpinBox_DX, SIGNAL(textChanged(const QString& )),
this, SLOT(TextValueChangedInSpinBox(const QString& )));
- connect(GroupDimensions->SpinBox_DX1, SIGNAL(textChanged(const QString& )),
+ connect(GroupDimensions->SpinBox_DX1, SIGNAL(textChanged(const QString& )),
this, SLOT(TextValueChangedInSpinBox(const QString& )));
- connect(GroupDimensions->SpinBox_DX2, SIGNAL(textChanged(const QString& )),
+ connect(GroupDimensions->SpinBox_DX2, SIGNAL(textChanged(const QString& )),
this, SLOT(TextValueChangedInSpinBox(const QString& )));
-
+
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
connect(GroupPoints->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseStepU()));
void TransformationGUI_MultiTranslationDlg::SetDoubleSpinBoxStep (double step)
{
GroupPoints->SpinBox_DX->setSingleStep(step);
- GroupDimensions->SpinBox_DX1->setSingleStep(step);
+ GroupDimensions->SpinBox_DX1->setSingleStep(step);
GroupDimensions->SpinBox_DX2->setSingleStep(step);
-
+
// san : Commented so as not to override specific step settings
//GroupPoints->SpinBox_DY->setSingleStep((int)step);
//GroupDimensions->SpinBox_DY1->setSingleStep((int)step);
{
QObject* send = (QObject*)sender();
bool isDigit = true;
-
+
switch (getConstructorId()) {
- case 0:
+ case 0:
GroupPoints->SpinBox_DX->text().toDouble(&isDigit);
if(!isDigit){
GroupPoints->CheckButton1->setChecked(false);
}
GroupPoints->CheckButton1->setEnabled(isDigit);
break;
- case 1:
+ case 1:
if (send == GroupDimensions->SpinBox_DX1) {
GroupDimensions->SpinBox_DX1->text().toDouble(&isDigit);
- if(!isDigit)
+ if(!isDigit)
GroupDimensions->CheckButton1->setChecked(false);
GroupDimensions->CheckButton1->setEnabled(isDigit);
}
else if(send == GroupDimensions->SpinBox_DX2){
GroupDimensions->SpinBox_DX2->text().toDouble(&isDigit);
- if(!isDigit)
+ if(!isDigit)
GroupDimensions->CheckButton2->setChecked(false);
GroupDimensions->CheckButton2->setEnabled(isDigit);
}
bool TransformationGUI_MultiTranslationDlg::isValid (QString& msg)
{
int aConstructorId = getConstructorId();
-
+
if (aConstructorId == 0) {
bool ok = true;
ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
anArgs->length(1);
anArgs[0] = myBase;
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
- /*theFindMethod=*/GEOM::FSM_Transformed,
+ /*theFindMethod=*/GEOM::FSM_MultiTransformed,
/*theInheritFirstArg=*/true,
mainFrame()->CheckBoxAddPrefix->isChecked());
}
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_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));