mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-06 21:14:17 +05:00
Merge from V6_2_BR 23/12/2010
This commit is contained in:
parent
56da2a0652
commit
aab55c4f10
@ -37,7 +37,7 @@ SUBDIRS = idl adm_local resources src doc bin
|
|||||||
|
|
||||||
DIST_SUBDIRS = idl adm_local resources src doc bin
|
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
|
salomeinclude_DATA = GEOM_version.h
|
||||||
|
|
||||||
|
@ -389,6 +389,9 @@ sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
|
|||||||
$(pwd)/hack_libtool \1 \"\$[@]\" \n\
|
$(pwd)/hack_libtool \1 \"\$[@]\" \n\
|
||||||
}\n\
|
}\n\
|
||||||
CC=\"hack_libtool\"%g" libtool
|
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
|
# This list is initiated using autoscan and must be updated manually
|
||||||
@ -405,6 +408,7 @@ AC_OUTPUT([ \
|
|||||||
GEOM_version.h \
|
GEOM_version.h \
|
||||||
doc/Makefile \
|
doc/Makefile \
|
||||||
doc/docutils/Makefile \
|
doc/docutils/Makefile \
|
||||||
|
doc/docutils/conf.py \
|
||||||
doc/salome/Makefile \
|
doc/salome/Makefile \
|
||||||
doc/salome/gui/Makefile \
|
doc/salome/gui/Makefile \
|
||||||
doc/salome/gui/GEOM/Makefile \
|
doc/salome/gui/GEOM/Makefile \
|
||||||
|
@ -49,7 +49,7 @@ htm:
|
|||||||
mkdir -p html doctrees
|
mkdir -p html doctrees
|
||||||
PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH} \
|
PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH} \
|
||||||
LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH} \
|
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
|
||||||
@echo "Build finished. The HTML pages are in html."
|
@echo "Build finished. The HTML pages are in html."
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ latex:
|
|||||||
mkdir -p latex doctrees
|
mkdir -p latex doctrees
|
||||||
PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH} \
|
PYTHONPATH=$(SPHINX_PYTHONPATH):${PYTHONPATH} \
|
||||||
LD_LIBRARY_PATH=$(SPHINX_LD_LIBRARY_PATH):${LD_LIBRARY_PATH} \
|
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
|
||||||
@echo "Build finished; the LaTeX files are in latex."
|
@echo "Build finished; the LaTeX files are in latex."
|
||||||
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
|
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
|
||||||
@ -73,9 +73,6 @@ RSTFILES= \
|
|||||||
|
|
||||||
EXTRA_DIST+= $(RSTFILES)
|
EXTRA_DIST+= $(RSTFILES)
|
||||||
|
|
||||||
EXTRA_DIST+= \
|
|
||||||
conf.py
|
|
||||||
|
|
||||||
install-data-local: html/index.html
|
install-data-local: html/index.html
|
||||||
test -z $(pydocdir) || mkdir -p $(DESTDIR)$(pydocdir)
|
test -z $(pydocdir) || mkdir -p $(DESTDIR)$(pydocdir)
|
||||||
if test -d "html"; then b=; else b="$(srcdir)/"; fi; \
|
if test -d "html"; then b=; else b="$(srcdir)/"; fi; \
|
||||||
|
@ -54,9 +54,9 @@ copyright = '2010 EDF R&D'
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '6.2.0'
|
version = '@VERSION@'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '6.2.0'
|
release = '@VERSION@'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
@ -24,10 +24,10 @@
|
|||||||
#
|
#
|
||||||
include $(top_srcdir)/adm_local/unix/make_common_starter.am
|
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
|
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
|
usr_docs: doxyfile_tui doxyfile_py doxyfile
|
||||||
echo "===========================================" ; \
|
echo "===========================================" ; \
|
||||||
|
@ -2,19 +2,25 @@
|
|||||||
|
|
||||||
\page common_operation_page Common
|
\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.
|
This operation cuts the common part of two shapes and transforms it into an independent geometrical object.
|
||||||
\n <b>TUI Command:</b> <em>geompy.MakeCommon(s1, s2)</em>
|
|
||||||
\n <b>Arguments:</b> Name + 2 shapes.
|
The \b Result will be any \b GEOM_Object.
|
||||||
\n <b>Advanced option:</b>
|
<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".
|
\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
|
||||||
|
|
||||||
\image html bool2.png
|
\image html bool2.png
|
||||||
|
|
||||||
\n <b>Example:</b>
|
<b>Example:</b>
|
||||||
|
|
||||||
\image html fusesn1.png "The initial shapes"
|
\image html fusesn1.png "The initial shapes"
|
||||||
|
|
||||||
|
@ -2,19 +2,25 @@
|
|||||||
|
|
||||||
\page cut_operation_page Cut
|
\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.
|
To produce a \b Cut operation in the <b>Main Menu</b> select <b>Operations - > Boolean - > Cut</b>
|
||||||
\n The \b Result will be any \b GEOM_Object.
|
|
||||||
\n <b>Arguments:</b> Name + 2 shapes.
|
This operation cuts a shape with another one.
|
||||||
\n <b>Advanced option:</b>
|
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".
|
\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
|
||||||
|
|
||||||
\n <b>Dialog Box:</b>
|
<b>Dialog Box:</b>
|
||||||
|
|
||||||
\image html bool3.png
|
\image html bool3.png
|
||||||
|
|
||||||
\n <b>Example:</b>
|
<b>Example:</b>
|
||||||
|
|
||||||
\image html fusesn1.png "The initial shapes"
|
\image html fusesn1.png "The initial shapes"
|
||||||
|
|
||||||
|
@ -2,20 +2,26 @@
|
|||||||
|
|
||||||
\page fuse_operation_page Fuse
|
\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>
|
<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.
|
The \b Result will be any \b GEOM_Object.
|
||||||
\n <b>TUI Command:</b> <em>geompy.MakeFuse(s1, s2)</em>
|
<b>TUI Command:</b> <em>geompy.MakeFuse(s1, s2)</em>
|
||||||
\n <b>Arguments:</b> Name + 2 shapes.
|
<b>Arguments:</b> Name + 2 shapes.
|
||||||
\n <b>Advanced option:</b>
|
<b>Advanced option:</b>
|
||||||
\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
|
\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
|
||||||
|
|
||||||
\image html bool1.png
|
\image html bool1.png
|
||||||
|
|
||||||
\n <b>Example:</b>
|
<b>Example:</b>
|
||||||
|
|
||||||
\image html fusesn1.png "The initial shapes"
|
\image html fusesn1.png "The initial shapes"
|
||||||
|
|
||||||
|
@ -27,5 +27,7 @@ Also it can be useful to have a look at the \subpage geompypkg_page "documentati
|
|||||||
|
|
||||||
\image html image3.png "Example of Geometry module usage for engineering tasks"
|
\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.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
\page partition_page Partition
|
\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>
|
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
|
This operation builds a compound by intersection of several shapes
|
||||||
|
10
doc/salome/gui/GEOM/input/related_docs.doc
Normal file
10
doc/salome/gui/GEOM/input/related_docs.doc
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/*!
|
||||||
|
\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>
|
||||||
|
|
||||||
|
*/
|
@ -2,20 +2,26 @@
|
|||||||
|
|
||||||
\page section_opeartion_page Section
|
\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>
|
<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).
|
The \b Result will be any \b GEOM_Object (EDGE or WIRE).
|
||||||
\n <b>TUI Command:</b> <em>geompy.MakeSection(s1, s2)</em>
|
<b>TUI Command:</b> <em>geompy.MakeSection(s1, s2)</em>
|
||||||
\n <b>Arguments:</b> Name + 2 shapes.
|
<b>Arguments:</b> Name + 2 shapes.
|
||||||
\n <b>Advanced option:</b>
|
<b>Advanced option:</b>
|
||||||
\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
|
\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
|
||||||
|
|
||||||
\image html neo-section.png
|
\image html neo-section.png
|
||||||
|
|
||||||
\n <b>Example:</b>
|
<b>Example:</b>
|
||||||
|
|
||||||
\image html fusesn1.png "The initial shapes"
|
\image html fusesn1.png "The initial shapes"
|
||||||
|
|
||||||
|
@ -357,6 +357,20 @@ print "\nBox 100x30x100 description:"
|
|||||||
print Descr
|
print Descr
|
||||||
\endcode
|
\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>
|
<br><h2>Check Shape</h2>
|
||||||
|
|
||||||
\code
|
\code
|
||||||
|
@ -2,7 +2,13 @@
|
|||||||
|
|
||||||
\page using_boolean_operations_page Using Boolean Operations
|
\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):
|
complex geometrical objects (2D & 3D elements):
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@ -38,7 +44,7 @@ Shape2 is the second argument of Cut operation;
|
|||||||
<em>geompy.MakeSection(Shape1, Shape2)</em>, where \em Shape1 and \em
|
<em>geompy.MakeSection(Shape1, Shape2)</em>, where \em Shape1 and \em
|
||||||
Shape2 is the second argument of Section operation;
|
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".
|
\ref tui_boolean_operations_page "Boolean Operations".
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
BIN
doc/salome/gui/GEOM/static/SALOME_BOA_PA.pdf
Executable file
BIN
doc/salome/gui/GEOM/static/SALOME_BOA_PA.pdf
Executable file
Binary file not shown.
@ -111,7 +111,12 @@ module GEOM
|
|||||||
FSM_GetShapesOnShape,
|
FSM_GetShapesOnShape,
|
||||||
|
|
||||||
/*! Use GetInPlaceByHistory method (can work only after Partition) */
|
/*! 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
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -180,10 +185,19 @@ module GEOM
|
|||||||
* This function is useful for the compounds only; for simple shapes it
|
* This function is useful for the compounds only; for simple shapes it
|
||||||
* exactly the same value as GetShapeType().
|
* exactly the same value as GetShapeType().
|
||||||
* Note, that compounds are procesed recursively.
|
* Note, that compounds are procesed recursively.
|
||||||
* \sa GetShapeType(), GetTopologyType()
|
* \sa GetShapeType(), GetTopologyType(), GetMaxShapeType()
|
||||||
*/
|
*/
|
||||||
shape_type GetMinShapeType();
|
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.
|
* Set name of the object.
|
||||||
* \param theName is a name which will be associated with this object.
|
* \param theName is a name which will be associated with this object.
|
||||||
@ -968,13 +982,23 @@ module GEOM
|
|||||||
* \param theCopy is a true or false parameter. true is to reverse direction, false is to move normal direction.
|
* \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.
|
* \return New GEOM_Object, containing the displaced shape.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GEOM_Object PositionAlongPath (in GEOM_Object theObject,
|
GEOM_Object PositionAlongPath (in GEOM_Object theObject,
|
||||||
in GEOM_Object thePath,
|
in GEOM_Object thePath,
|
||||||
in double theDistance,
|
in double theDistance,
|
||||||
in boolean theCopy,
|
in boolean theCopy,
|
||||||
in boolean theReverse);
|
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.
|
* Recompute the shape from its arguments.
|
||||||
* \param theObject The object to be recomputed.
|
* \param theObject The object to be recomputed.
|
||||||
|
@ -95,10 +95,14 @@ static
|
|||||||
void MakeInternalShells(const TopTools_MapOfShape& ,
|
void MakeInternalShells(const TopTools_MapOfShape& ,
|
||||||
TopTools_ListOfShape& );
|
TopTools_ListOfShape& );
|
||||||
|
|
||||||
//modified by NIZNHY-PKV Tue Aug 5 15:06:50 2008f
|
|
||||||
static
|
static
|
||||||
Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell);
|
Standard_Boolean IsClosedShell(const TopoDS_Shell& );
|
||||||
//modified by NIZNHY-PKV Tue Aug 5 15:06:57 2008t
|
|
||||||
|
//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 :
|
//function :
|
||||||
@ -187,15 +191,17 @@ static
|
|||||||
if (!myShapesToAvoid.Contains(aF)) {
|
if (!myShapesToAvoid.Contains(aF)) {
|
||||||
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
else {
|
else {
|
||||||
int a=0;
|
int a=0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
aNbE=aMEF.Extent();
|
aNbE=aMEF.Extent();
|
||||||
//
|
//
|
||||||
// 2. myFacesToAvoid
|
// 2. myFacesToAvoid
|
||||||
for (i=1; i<=aNbE; ++i) {
|
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)) {
|
if (BRep_Tool::Degenerated(aE)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -209,7 +215,7 @@ static
|
|||||||
//
|
//
|
||||||
aOrE=aE.Orientation();
|
aOrE=aE.Orientation();
|
||||||
//
|
//
|
||||||
const TopoDS_Face& aF1=TopoDS::Face(aLF.First());
|
const TopoDS_Face& aF1=*((TopoDS_Face*)(&aLF.First()));
|
||||||
if (aNbF==1) {
|
if (aNbF==1) {
|
||||||
if (aOrE==TopAbs_INTERNAL) {
|
if (aOrE==TopAbs_INTERNAL) {
|
||||||
continue;
|
continue;
|
||||||
@ -218,7 +224,7 @@ static
|
|||||||
myShapesToAvoid.Add(aF1);
|
myShapesToAvoid.Add(aF1);
|
||||||
}
|
}
|
||||||
else if (aNbF==2) {
|
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 (aF2.IsSame(aF1)) {
|
||||||
if (BRep_Tool::IsClosed(aE, aF1)) {
|
if (BRep_Tool::IsClosed(aE, aF1)) {
|
||||||
continue;
|
continue;
|
||||||
@ -233,7 +239,7 @@ static
|
|||||||
myShapesToAvoid.Add(aF2);
|
myShapesToAvoid.Add(aF2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//DEB
|
/*//DEB
|
||||||
else {
|
else {
|
||||||
TopTools_ListIteratorOfListOfShape aItLF;
|
TopTools_ListIteratorOfListOfShape aItLF;
|
||||||
//
|
//
|
||||||
@ -243,7 +249,7 @@ static
|
|||||||
int a=0;
|
int a=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//DEB
|
*///DEB
|
||||||
}// for (i=1; i<=aNbE; ++i) {
|
}// for (i=1; i<=aNbE; ++i) {
|
||||||
//
|
//
|
||||||
if (!bFound) {
|
if (!bFound) {
|
||||||
@ -262,12 +268,12 @@ static
|
|||||||
//
|
//
|
||||||
myLoops.Clear();
|
myLoops.Clear();
|
||||||
//
|
//
|
||||||
Standard_Integer aNbLF, aNbOff, aNbFP, aNbFA;
|
Standard_Integer aNbLF, aNbOff, aNbFP;
|
||||||
TopAbs_Orientation anOr;
|
TopAbs_Orientation anOr;
|
||||||
TopoDS_Edge aEL;
|
TopoDS_Edge aEL;
|
||||||
BRep_Builder aBB;
|
BRep_Builder aBB;
|
||||||
NMTTools_CoupleOfShape aCSOff;
|
NMTTools_CoupleOfShape aCSOff;
|
||||||
TopTools_MapOfOrientedShape AddedFacesMap;//, aMFP;
|
TopTools_MapOfOrientedShape AddedFacesMap;
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape aEFMap, aMEFP;
|
TopTools_IndexedDataMapOfShapeListOfShape aEFMap, aMEFP;
|
||||||
TopTools_ListIteratorOfListOfShape aItF, aIt;
|
TopTools_ListIteratorOfListOfShape aItF, aIt;
|
||||||
TopTools_MapIteratorOfMapOfOrientedShape aItM;
|
TopTools_MapIteratorOfMapOfOrientedShape aItM;
|
||||||
@ -304,12 +310,12 @@ static
|
|||||||
// loop on faces added to Shell; add their neighbor faces to Shell and so on
|
// loop on faces added to Shell; add their neighbor faces to Shell and so on
|
||||||
TopoDS_Iterator aItAddedF (aShell);
|
TopoDS_Iterator aItAddedF (aShell);
|
||||||
for (; aItAddedF.More(); aItAddedF.Next()) {
|
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
|
// loop on edges of aF; find a good neighbor face of aF by aE
|
||||||
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
|
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
|
||||||
for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||||
const TopoDS_Edge& aE = TopoDS::Edge(aEdgeExp.Current());
|
const TopoDS_Edge& aE=*((TopoDS_Edge*)(&aEdgeExp.Current()));
|
||||||
//
|
//
|
||||||
//1
|
//1
|
||||||
if (aMEFP.Contains(aE)) {
|
if (aMEFP.Contains(aE)) {
|
||||||
@ -344,7 +350,7 @@ static
|
|||||||
//
|
//
|
||||||
aItLF.Initialize(aLF);
|
aItLF.Initialize(aLF);
|
||||||
for (; aItLF.More(); aItLF.Next()) {
|
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)) {
|
if (myShapesToAvoid.Contains(aFL)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -372,7 +378,7 @@ static
|
|||||||
//
|
//
|
||||||
TopoDS_Face aSelF;
|
TopoDS_Face aSelF;
|
||||||
if (aNbOff==1) {
|
if (aNbOff==1) {
|
||||||
aSelF=TopoDS::Face(aLCSOff.First().Shape2());
|
aSelF=*((TopoDS_Face*)(&aLCSOff.First().Shape2()));
|
||||||
}
|
}
|
||||||
else if (aNbOff>1){
|
else if (aNbOff>1){
|
||||||
GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF);
|
GEOMAlgo_Tools3D::GetFaceOff(aE, aF, aLCSOff, aSelF);
|
||||||
@ -384,24 +390,22 @@ static
|
|||||||
}
|
}
|
||||||
} // for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
} // for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||||
} //for (; aItAddedF.More(); aItAddedF.Next()) {
|
} //for (; aItAddedF.More(); aItAddedF.Next()) {
|
||||||
//modified by NIZNHY-PKV Tue Aug 5 15:07:08 2008f
|
//
|
||||||
//myLoops.Append(aShell);
|
|
||||||
if (IsClosedShell(aShell)) {
|
if (IsClosedShell(aShell)) {
|
||||||
myLoops.Append(aShell);
|
myLoops.Append(aShell);
|
||||||
}
|
}
|
||||||
/*
|
//modified by NIZNHY-PKV Wed Oct 27 07:10:41 2010f
|
||||||
else {
|
else {
|
||||||
TopoDS_Iterator aItS;
|
Standard_Boolean bRefine;
|
||||||
aItS.Initialize(aShell);
|
TopoDS_Shell aShx;
|
||||||
for (; aItS.More(); aItS.Next()) {
|
//
|
||||||
const TopoDS_Shape& aFs=aItS.Value();
|
bRefine=RefineShell(aShell, aShx);
|
||||||
aMFP.Add(aFs);
|
if (bRefine) {
|
||||||
|
myLoops.Append(aShx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
//modified by NIZNHY-PKV Wed Oct 27 07:10:44 2010t
|
||||||
//modified by NIZNHY-PKV Tue Aug 5 15:07:30 2008t
|
|
||||||
} // for (; aItF.More(); aItF.Next()) {
|
} // for (; aItF.More(); aItF.Next()) {
|
||||||
//modified by NIZNHY-PKV Tue Aug 5 15:07:35 2008f
|
|
||||||
//
|
//
|
||||||
// Post Treatment
|
// Post Treatment
|
||||||
TopTools_MapOfOrientedShape aMP;
|
TopTools_MapOfOrientedShape aMP;
|
||||||
@ -417,14 +421,14 @@ static
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// b. collect all edges that are to avoid
|
// b. collect all faces that are to avoid
|
||||||
aItM.Initialize(myShapesToAvoid);
|
aItM.Initialize(myShapesToAvoid);
|
||||||
for (; aItM.More(); aItM.Next()) {
|
for (; aItM.More(); aItM.Next()) {
|
||||||
const TopoDS_Shape& aF=aItM.Key();
|
const TopoDS_Shape& aF=aItM.Key();
|
||||||
aMP.Add(aF);
|
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);
|
aIt.Initialize (myShapes);
|
||||||
for (; aIt.More(); aIt.Next()) {
|
for (; aIt.More(); aIt.Next()) {
|
||||||
const TopoDS_Shape& aF=aIt.Value();
|
const TopoDS_Shape& aF=aIt.Value();
|
||||||
@ -432,7 +436,6 @@ static
|
|||||||
myShapesToAvoid.Add(aF);
|
myShapesToAvoid.Add(aF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Tue Aug 5 15:07:44 2008t
|
|
||||||
//=================================================
|
//=================================================
|
||||||
//
|
//
|
||||||
// 2.Internal Shells
|
// 2.Internal Shells
|
||||||
@ -442,8 +445,6 @@ static
|
|||||||
aEFMap.Clear();
|
aEFMap.Clear();
|
||||||
AddedFacesMap.Clear();
|
AddedFacesMap.Clear();
|
||||||
//
|
//
|
||||||
aNbFA=myShapesToAvoid.Extent();
|
|
||||||
//
|
|
||||||
aItM.Initialize(myShapesToAvoid);
|
aItM.Initialize(myShapesToAvoid);
|
||||||
for (; aItM.More(); aItM.Next()) {
|
for (; aItM.More(); aItM.Next()) {
|
||||||
const TopoDS_Shape& aFF=aItM.Key();
|
const TopoDS_Shape& aFF=aItM.Key();
|
||||||
@ -464,15 +465,15 @@ static
|
|||||||
//
|
//
|
||||||
TopoDS_Iterator aItAddedF (aShell);
|
TopoDS_Iterator aItAddedF (aShell);
|
||||||
for (; aItAddedF.More(); aItAddedF.Next()) {
|
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);
|
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
|
||||||
for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
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);
|
const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
|
||||||
aItF.Initialize(aLF);
|
aItF.Initialize(aLF);
|
||||||
for (; aItF.More(); aItF.Next()) {
|
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)){
|
if (AddedFacesMap.Add(aFL)){
|
||||||
aBB.Add(aShell, aFL);
|
aBB.Add(aShell, aFL);
|
||||||
}
|
}
|
||||||
@ -518,10 +519,8 @@ static
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
// check if a shell is a hole
|
// check if a shell is a hole
|
||||||
//XX
|
|
||||||
bIsHole=IsHole(aShell, myContext);
|
bIsHole=IsHole(aShell, myContext);
|
||||||
//bIsHole=GEOMAlgo_BuilderTools::IsHole(aShell);
|
//
|
||||||
//XX
|
|
||||||
if (bIsHole) {
|
if (bIsHole) {
|
||||||
aHoleShells.Append(aShell);
|
aHoleShells.Append(aShell);
|
||||||
TopExp::MapShapes(aShell, TopAbs_FACE, aMHF);
|
TopExp::MapShapes(aShell, TopAbs_FACE, aMHF);
|
||||||
@ -581,7 +580,7 @@ static
|
|||||||
// 3. Add aHoles to Solids
|
// 3. Add aHoles to Solids
|
||||||
aItMSH.Initialize(aMSH);
|
aItMSH.Initialize(aMSH);
|
||||||
for (; aItMSH.More(); aItMSH.Next()) {
|
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();
|
const TopTools_ListOfShape& aLH=aItMSH.Value();
|
||||||
aShellIt.Initialize(aLH);
|
aShellIt.Initialize(aLH);
|
||||||
@ -637,7 +636,7 @@ static
|
|||||||
// 2 Process solids
|
// 2 Process solids
|
||||||
aSolidIt.Initialize(myAreas);
|
aSolidIt.Initialize(myAreas);
|
||||||
for ( ; aSolidIt.More(); aSolidIt.Next()) {
|
for ( ; aSolidIt.More(); aSolidIt.Next()) {
|
||||||
TopoDS_Solid& aSolid=TopoDS::Solid(aSolidIt.Value());
|
TopoDS_Solid& aSolid=*((TopoDS_Solid*)(&aSolidIt.Value()));
|
||||||
//
|
//
|
||||||
aMEF.Clear();
|
aMEF.Clear();
|
||||||
TopExp::MapShapesAndAncestors(aSolid, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
TopExp::MapShapesAndAncestors(aSolid, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||||
@ -646,7 +645,7 @@ static
|
|||||||
aMFP.Clear();
|
aMFP.Clear();
|
||||||
aItMF.Initialize(aMF);
|
aItMF.Initialize(aMF);
|
||||||
for (; aItMF.More(); aItMF.Next()) {
|
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)) {
|
if (GEOMAlgo_Tools3D::IsInternalFace(aF, aSolid, aMEF, 1.e-14, *myContext)) {
|
||||||
aMFP.Add(aF);
|
aMFP.Add(aF);
|
||||||
}
|
}
|
||||||
@ -792,7 +791,6 @@ Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell,
|
|||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Tue Aug 5 15:07:50 2008f
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsClosedShell
|
//function : IsClosedShell
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -811,18 +809,15 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
|
|||||||
const TopoDS_Face& aF=TopoDS::Face(aIt.Value());
|
const TopoDS_Face& aF=TopoDS::Face(aIt.Value());
|
||||||
aExp.Init(aF, TopAbs_EDGE);
|
aExp.Init(aF, TopAbs_EDGE);
|
||||||
for (; aExp.More(); aExp.Next()) {
|
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)) {
|
if (BRep_Tool::Degenerated(aE)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/*
|
//
|
||||||
if (BRep_Tool::IsClosed(aE, aF)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (aE.Orientation()==TopAbs_INTERNAL) {
|
if (aE.Orientation()==TopAbs_INTERNAL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
if (!aM.Add(aE)) {
|
if (!aM.Add(aE)) {
|
||||||
aM.Remove(aE);
|
aM.Remove(aE);
|
||||||
}
|
}
|
||||||
@ -835,8 +830,89 @@ Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
|
|||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
//modified by NIZNHY-PKV Tue Aug 5 15:08:07 2008t
|
//modified by NIZNHY-PKV Tue Oct 26 13:30:23 2010f
|
||||||
//BRepTools::Write(aFF, "ff");
|
//=======================================================================
|
||||||
|
//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 :
|
// ErrorStatus :
|
||||||
// 11 - Null Context
|
// 11 - Null Context
|
||||||
|
@ -116,7 +116,7 @@ static
|
|||||||
IntTools_Context& aCtx=pPF->ChangeContext();
|
IntTools_Context& aCtx=pPF->ChangeContext();
|
||||||
//
|
//
|
||||||
Standard_Boolean bToReverse;
|
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_ListIteratorOfListOfInteger aItLB;
|
||||||
TColStd_ListOfInteger aLB;
|
TColStd_ListOfInteger aLB;
|
||||||
TopoDS_Edge aEE, aESpR;
|
TopoDS_Edge aEE, aESpR;
|
||||||
@ -150,16 +150,17 @@ static
|
|||||||
nSp=aPB.Edge();
|
nSp=aPB.Edge();
|
||||||
const TopoDS_Shape& aSp=aDS.Shape(nSp);
|
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);
|
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();
|
nSpR=aPBR.Edge();
|
||||||
const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
|
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) {
|
if (aSpR.IsSame(aSp) && aSpR.IsSame(aE) && !aIsCB) {
|
||||||
//modified by NIZNHY-PKV Fri Nov 30 10:41:46 2007t
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@ -183,10 +184,7 @@ static
|
|||||||
aIt.Initialize(aLPB);
|
aIt.Initialize(aLPB);
|
||||||
for (; aIt.More(); aIt.Next()) {
|
for (; aIt.More(); aIt.Next()) {
|
||||||
const BOPTools_PaveBlock& aPB=aIt.Value();
|
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);
|
const BOPTools_PaveBlock& aPBR=pPF->RealPaveBlock(aPB, aLB, aIsCB);
|
||||||
//modified by NIZNHY-PKV Fri Nov 30 10:42:20 2007t
|
|
||||||
nSpR=aPBR.Edge();
|
nSpR=aPBR.Edge();
|
||||||
const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
|
const TopoDS_Shape& aSpR=aDS.Shape(nSpR);
|
||||||
//
|
//
|
||||||
@ -203,7 +201,6 @@ static
|
|||||||
const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
|
const TopoDS_Shape& aSpx=aDS.Shape(nSpx);
|
||||||
mySameDomainShapes.Add(aSpx ,aSpR);
|
mySameDomainShapes.Add(aSpx ,aSpR);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -70,6 +70,8 @@
|
|||||||
#include <BOPTools_CArray1OfESInterference.hxx>
|
#include <BOPTools_CArray1OfESInterference.hxx>
|
||||||
|
|
||||||
#include <NMTDS_ShapesDataStructure.hxx>
|
#include <NMTDS_ShapesDataStructure.hxx>
|
||||||
|
#include <NMTDS_InterfPool.hxx>
|
||||||
|
|
||||||
#include <NMTTools_PaveFiller.hxx>
|
#include <NMTTools_PaveFiller.hxx>
|
||||||
#include <NMTTools_ListOfCoupleOfShape.hxx>
|
#include <NMTTools_ListOfCoupleOfShape.hxx>
|
||||||
#include <NMTTools_Tools.hxx>
|
#include <NMTTools_Tools.hxx>
|
||||||
@ -84,7 +86,8 @@
|
|||||||
#include <GEOMAlgo_Tools3D.hxx>
|
#include <GEOMAlgo_Tools3D.hxx>
|
||||||
#include <GEOMAlgo_WireEdgeSet.hxx>
|
#include <GEOMAlgo_WireEdgeSet.hxx>
|
||||||
#include <GEOMAlgo_BuilderFace.hxx>
|
#include <GEOMAlgo_BuilderFace.hxx>
|
||||||
#include <NMTDS_InterfPool.hxx>
|
|
||||||
|
#include <GEOMAlgo_ShapeSet.hxx>
|
||||||
|
|
||||||
static
|
static
|
||||||
void UpdateCandidates(const Standard_Integer ,
|
void UpdateCandidates(const Standard_Integer ,
|
||||||
@ -254,6 +257,9 @@ static
|
|||||||
aNbSE=aLSE.Extent();
|
aNbSE=aLSE.Extent();
|
||||||
if (aNbSE) {
|
if (aNbSE) {
|
||||||
aMFP.Add(i);
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -358,39 +364,27 @@ static
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
// 2.2. Build images Faces
|
// 2.2. Build images Faces
|
||||||
|
TopTools_ListOfShape aLFR;
|
||||||
|
GEOMAlgo_ShapeSet aS1, aS2;
|
||||||
|
//
|
||||||
|
const TopTools_ListOfShape& aSE=aWES.StartElements();
|
||||||
|
//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;
|
GEOMAlgo_BuilderFace aBF;
|
||||||
//
|
//
|
||||||
aBF.SetFace(aFF);
|
aBF.SetFace(aFF);
|
||||||
aBF.SetContext(aCtx);
|
aBF.SetContext(aCtx);
|
||||||
const TopTools_ListOfShape& aSE=aWES.StartElements();
|
|
||||||
//
|
|
||||||
//DEB f
|
|
||||||
/*
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//DEB t
|
|
||||||
//
|
|
||||||
aBF.SetShapes(aSE);
|
aBF.SetShapes(aSE);
|
||||||
//
|
// <-DEB
|
||||||
aBF.Perform();
|
aBF.Perform();
|
||||||
//
|
//
|
||||||
const TopTools_ListOfShape& aLF=aBF.Areas();
|
const TopTools_ListOfShape& aLF=aBF.Areas();
|
||||||
//
|
|
||||||
TopTools_ListOfShape aLFR;
|
|
||||||
//
|
|
||||||
aIt.Initialize(aLF);
|
aIt.Initialize(aLF);
|
||||||
for (; aIt.More(); aIt.Next()) {
|
for (; aIt.More(); aIt.Next()) {
|
||||||
TopoDS_Shape& aFR=aIt.Value();
|
TopoDS_Shape& aFR=aIt.Value();
|
||||||
@ -399,6 +393,7 @@ static
|
|||||||
}
|
}
|
||||||
aLFR.Append(aFR);
|
aLFR.Append(aFR);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// 2.3. Collect draft images Faces
|
// 2.3. Collect draft images Faces
|
||||||
mySplitFaces.Bind(aF, aLFR);
|
mySplitFaces.Bind(aF, aLFR);
|
||||||
@ -530,7 +525,7 @@ static
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_Builder::FillImagesFaces1()
|
void GEOMAlgo_Builder::FillImagesFaces1()
|
||||||
{
|
{
|
||||||
Standard_Integer i, aNb, iSense;
|
Standard_Integer i, aNb, iSense, aNbLFx;
|
||||||
TopoDS_Face aF, aFSp, aFSD;
|
TopoDS_Face aF, aFSp, aFSD;
|
||||||
TopTools_ListOfShape aLFx;
|
TopTools_ListOfShape aLFx;
|
||||||
TopTools_ListIteratorOfListOfShape aIt;
|
TopTools_ListIteratorOfListOfShape aIt;
|
||||||
@ -568,7 +563,16 @@ static
|
|||||||
aLFx.Append(aFSD);
|
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);
|
myImages.Bind(aF, aLFx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -803,3 +807,20 @@ void UpdateCandidates(const Standard_Integer theNF,
|
|||||||
theMFMV.Add(theNF, aMV);
|
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;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
@ -19,11 +19,10 @@
|
|||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
|
||||||
// File : GEOMAlgo_Builder_3.cxx
|
// File : GEOMAlgo_Builder_3.cxx
|
||||||
// Created :
|
// Created :
|
||||||
// Author : Peter KURNEV
|
// Author : Peter KURNEV
|
||||||
//
|
|
||||||
#include <GEOMAlgo_Builder.hxx>
|
#include <GEOMAlgo_Builder.hxx>
|
||||||
|
|
||||||
#include <TopAbs_State.hxx>
|
#include <TopAbs_State.hxx>
|
||||||
@ -193,7 +192,7 @@ static
|
|||||||
IntTools_Context& aCtx= pPF->ChangeContext();
|
IntTools_Context& aCtx= pPF->ChangeContext();
|
||||||
//
|
//
|
||||||
Standard_Boolean bIsIN, bHasImage;
|
Standard_Boolean bIsIN, bHasImage;
|
||||||
Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF;// k,
|
Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF;
|
||||||
TopAbs_ShapeEnum aType;
|
TopAbs_ShapeEnum aType;
|
||||||
TopAbs_State aState;
|
TopAbs_State aState;
|
||||||
TopTools_IndexedMapOfShape aMSolids, aMS, aMFaces, aMFIN;
|
TopTools_IndexedMapOfShape aMSolids, aMS, aMFaces, aMFIN;
|
||||||
@ -284,6 +283,9 @@ static
|
|||||||
else {
|
else {
|
||||||
//aMS.Add(aShell);
|
//aMS.Add(aShell);
|
||||||
TopExp::MapShapes(aShell, TopAbs_FACE, aMS);
|
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);
|
TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,8 +434,6 @@ static
|
|||||||
GEOMAlgo_DataMapOfShapeShapeSet aMSS;
|
GEOMAlgo_DataMapOfShapeShapeSet aMSS;
|
||||||
GEOMAlgo_ShapeSet aSSi;
|
GEOMAlgo_ShapeSet aSSi;
|
||||||
//
|
//
|
||||||
//modified by NIZNHY-PKV Wed Dec 6 17:08:03 2006f
|
|
||||||
//
|
|
||||||
// 0. Find same domain solids for non-interferred solids
|
// 0. Find same domain solids for non-interferred solids
|
||||||
aNbS=aDS.NumberOfShapesOfTheObject();
|
aNbS=aDS.NumberOfShapesOfTheObject();
|
||||||
for (i=1; i<=aNbS; ++i) {
|
for (i=1; i<=aNbS; ++i) {
|
||||||
@ -454,10 +454,7 @@ static
|
|||||||
aMSS.Bind(aS, aSSi);
|
aMSS.Bind(aS, aSSi);
|
||||||
} //for (i=1; i<=aNbS; ++i)
|
} //for (i=1; i<=aNbS; ++i)
|
||||||
//
|
//
|
||||||
//modified by NIZNHY-PKV Wed Dec 6 17:08:09 2006t
|
|
||||||
//
|
|
||||||
// 1. Build solids for interferred source solids
|
// 1. Build solids for interferred source solids
|
||||||
//
|
|
||||||
aSB.SetContext(aCtx);
|
aSB.SetContext(aCtx);
|
||||||
aNbS=myDraftSolids.Extent();
|
aNbS=myDraftSolids.Extent();
|
||||||
for (i=1; i<=aNbS; ++i) {
|
for (i=1; i<=aNbS; ++i) {
|
||||||
@ -516,6 +513,11 @@ static
|
|||||||
}
|
}
|
||||||
const TopTools_ListOfShape& aSFS1=aSSi.GetSet();
|
const TopTools_ListOfShape& aSFS1=aSSi.GetSet();
|
||||||
aNbSFS=aSFS1.Extent();
|
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
|
// 1.3 Build new solids
|
||||||
aSB.SetShapes(aSFS1);
|
aSB.SetShapes(aSFS1);
|
||||||
@ -550,38 +552,6 @@ static
|
|||||||
myImages.Bind(aS, aLSR);
|
myImages.Bind(aS, aLSR);
|
||||||
}
|
}
|
||||||
} // for (i=1; i<=aNbS; ++i) {
|
} // 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
|
//function :FillInternalShapes
|
||||||
@ -795,4 +765,3 @@ static
|
|||||||
//
|
//
|
||||||
// ErrorStatus
|
// ErrorStatus
|
||||||
// 30 - SolidBuilder failed
|
// 30 - SolidBuilder failed
|
||||||
|
|
||||||
|
@ -73,6 +73,13 @@ is
|
|||||||
---Purpose: Returns the Set
|
---Purpose: Returns the Set
|
||||||
returns ListOfShape from TopTools;
|
returns ListOfShape from TopTools;
|
||||||
---C++: return const &
|
---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
|
fields
|
||||||
myMap : MapOfOrientedShape from TopTools is protected;
|
myMap : MapOfOrientedShape from TopTools is protected;
|
||||||
|
@ -96,17 +96,6 @@
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
const TopTools_ListOfShape& GEOMAlgo_ShapeSet::GetSet()const
|
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;
|
return myList;
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -140,16 +129,6 @@
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_ShapeSet::Subtract(const GEOMAlgo_ShapeSet& theOther)
|
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_ListIteratorOfListOfShape aIt;
|
||||||
TopTools_ListOfShape aLS;
|
TopTools_ListOfShape aLS;
|
||||||
//
|
//
|
||||||
@ -166,3 +145,34 @@
|
|||||||
//
|
//
|
||||||
myList=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
|
||||||
|
@ -23,6 +23,13 @@
|
|||||||
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
|
#ifndef _GEOMAlgo_ShapeSet_HeaderFile
|
||||||
#define _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
|
#ifndef _TopTools_MapOfOrientedShape_HeaderFile
|
||||||
#include <TopTools_MapOfOrientedShape.hxx>
|
#include <TopTools_MapOfOrientedShape.hxx>
|
||||||
#endif
|
#endif
|
||||||
@ -39,17 +46,9 @@ class TopTools_ListOfShape;
|
|||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
|
|
||||||
|
|
||||||
#ifndef _Standard_HeaderFile
|
|
||||||
#include <Standard.hxx>
|
|
||||||
#endif
|
|
||||||
#ifndef _Standard_Macro_HeaderFile
|
|
||||||
#include <Standard_Macro.hxx>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//! Implementation some formal <br>
|
//! Implementation some formal <br>
|
||||||
//! opereations with Set of shapes <br>
|
//! opereations with Set of shapes <br>
|
||||||
class GEOMAlgo_ShapeSet {
|
class GEOMAlgo_ShapeSet {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void* operator new(size_t,void* anAddress)
|
void* operator new(size_t,void* anAddress)
|
||||||
@ -64,34 +63,31 @@ public:
|
|||||||
{
|
{
|
||||||
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
if (anAddress) Standard::Free((Standard_Address&)anAddress);
|
||||||
}
|
}
|
||||||
// Methods PUBLIC
|
|
||||||
//
|
|
||||||
|
|
||||||
//! Empty constructor <br>
|
//! Empty constructor <br>
|
||||||
Standard_EXPORT GEOMAlgo_ShapeSet();
|
Standard_EXPORT GEOMAlgo_ShapeSet();
|
||||||
|
|
||||||
//! Adds shapes from the list theLS to the Set <br>
|
//! Adds shapes from the list theLS to the Set <br>
|
||||||
Standard_EXPORT void Add(const TopTools_ListOfShape& theLS) ;
|
Standard_EXPORT void Add(const TopTools_ListOfShape& theLS) ;
|
||||||
|
|
||||||
//! Adds shape theShape to the Set <br>
|
//! Adds shape theShape to the Set <br>
|
||||||
Standard_EXPORT void Add(const TopoDS_Shape& theShape) ;
|
Standard_EXPORT void Add(const TopoDS_Shape& theShape) ;
|
||||||
|
|
||||||
//! Adds sub-shapes of shape theShape, <br>
|
//! Adds sub-shapes of shape theShape, <br>
|
||||||
//! that have type theType to the Set <br>
|
//! that have type theType to the Set <br>
|
||||||
Standard_EXPORT void Add(const TopoDS_Shape& theShape,const TopAbs_ShapeEnum theType) ;
|
Standard_EXPORT void Add(const TopoDS_Shape& theShape,const TopAbs_ShapeEnum theType) ;
|
||||||
|
|
||||||
//! Removes shapes of theSet from the Set <br>
|
//! Removes shapes of theSet from the Set <br>
|
||||||
Standard_EXPORT void Subtract(const GEOMAlgo_ShapeSet& theSet) ;
|
Standard_EXPORT void Subtract(const GEOMAlgo_ShapeSet& theSet) ;
|
||||||
|
|
||||||
//! Clears internal fields <br>
|
//! Clears internal fields <br>
|
||||||
Standard_EXPORT void Clear() ;
|
Standard_EXPORT void Clear() ;
|
||||||
|
|
||||||
//! Returns True if the Set contains <br>
|
//! Returns True if the Set contains <br>
|
||||||
//! all shapes of theSet <br>
|
//! all shapes of theSet <br>
|
||||||
Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_ShapeSet& theSet) const;
|
Standard_EXPORT Standard_Boolean Contains(const GEOMAlgo_ShapeSet& theSet) const;
|
||||||
|
|
||||||
//! Returns the Set <br>
|
//! Returns the Set <br>
|
||||||
Standard_EXPORT const TopTools_ListOfShape& GetSet() const;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -99,24 +95,16 @@ Standard_EXPORT const TopTools_ListOfShape& GetSet() const;
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Methods PROTECTED
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
// Fields PROTECTED
|
|
||||||
//
|
|
||||||
TopTools_MapOfOrientedShape myMap;
|
TopTools_MapOfOrientedShape myMap;
|
||||||
TopTools_ListOfShape myList;
|
TopTools_ListOfShape myList;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Methods PRIVATE
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
// Fields PRIVATE
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -126,7 +114,6 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
// other Inline functions and methods (like "C++: function call" methods)
|
// other Inline functions and methods (like "C++: function call" methods)
|
||||||
//
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,11 +19,10 @@
|
|||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
|
||||||
// File : GEOMAlgo_Tools3D.cxx
|
// File : GEOMAlgo_Tools3D.cxx
|
||||||
// Created :
|
// Created :
|
||||||
// Author : Peter KURNEV
|
// Author : Peter KURNEV
|
||||||
//
|
|
||||||
#include <GEOMAlgo_Tools3D.ixx>
|
#include <GEOMAlgo_Tools3D.ixx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
@ -1054,10 +1053,10 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
|
|||||||
Standard_Real aT,
|
Standard_Real aT,
|
||||||
gp_Pnt& aPF,
|
gp_Pnt& aPF,
|
||||||
gp_Dir& aDNF,
|
gp_Dir& aDNF,
|
||||||
IntTools_Context& )//aCtx)
|
IntTools_Context& aCtx)
|
||||||
{
|
{
|
||||||
Standard_Boolean bReverse;
|
Standard_Boolean bReverse;
|
||||||
Standard_Real aT1, aT2, dT;//, aU, aV;
|
Standard_Real aT1, aT2, dT, aU, aV;
|
||||||
gp_Dir aDTT, aDNFT, aDBT;
|
gp_Dir aDTT, aDNFT, aDBT;
|
||||||
gp_Pnt aPFT, aPFx;
|
gp_Pnt aPFT, aPFx;
|
||||||
Handle(Geom_Curve) aC3D;
|
Handle(Geom_Curve) aC3D;
|
||||||
@ -1112,6 +1111,19 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
|
|||||||
dT=dR;
|
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
|
||||||
}
|
}
|
||||||
//----------------------------------------------
|
//----------------------------------------------
|
||||||
//
|
//
|
||||||
@ -1123,8 +1135,6 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
|
|||||||
aDNF.Reverse();
|
aDNF.Reverse();
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//modified by NIZNHY-PKV Wed Sep 22 10:52:54 2010f
|
|
||||||
/*
|
|
||||||
GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF);
|
GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF);
|
||||||
//
|
//
|
||||||
aProjector.Perform(aPFx);
|
aProjector.Perform(aPFx);
|
||||||
@ -1136,6 +1146,4 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx,
|
|||||||
aDNF.Reverse();
|
aDNF.Reverse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
//modified by NIZNHY-PKV Wed Sep 22 10:52:59 2010t
|
|
||||||
}
|
}
|
||||||
|
@ -19,13 +19,11 @@
|
|||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// 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
|
// GEOM GEOMClient : tool to transfer BREP files from GEOM server to GEOM client
|
||||||
// File : GEOM_Client.cxx
|
// File : GEOM_Client.cxx
|
||||||
// Author : Yves FRICAUD/Lucien PIGNOLONI
|
// Author : Yves FRICAUD/Lucien PIGNOLONI
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
//
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
@ -78,7 +76,7 @@ TopoDS_Shape GEOM_Client::Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr a
|
|||||||
/* get sequence of bytes of resulting brep shape from GEOM server */
|
/* get sequence of bytes of resulting brep shape from GEOM server */
|
||||||
TopoDS_Shape S;
|
TopoDS_Shape S;
|
||||||
SALOMEDS::TMPFile_var SeqFile = aShape->GetShapeStream();
|
SALOMEDS::TMPFile_var SeqFile = aShape->GetShapeStream();
|
||||||
int sizebuf = SeqFile->length();
|
/*int sizebuf = */SeqFile->length();
|
||||||
char* buf;
|
char* buf;
|
||||||
buf = (char*) &SeqFile[0];
|
buf = (char*) &SeqFile[0];
|
||||||
std::istringstream streamBrep(buf);
|
std::istringstream streamBrep(buf);
|
||||||
@ -102,6 +100,19 @@ GEOM_Client::GEOM_Client()
|
|||||||
#endif
|
#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()
|
// function : Create()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -111,6 +122,23 @@ GEOM_Client::GEOM_Client(Engines::Container_ptr client)
|
|||||||
pid_client = client->getPID();
|
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()
|
// function : Find()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -169,7 +197,6 @@ void GEOM_Client::RemoveShapeFromBuffer( const TCollection_AsciiString& IOR)
|
|||||||
_myIndexes.erase(IOR);
|
_myIndexes.erase(IOR);
|
||||||
_mySubShapes.erase(IOR);
|
_mySubShapes.erase(IOR);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -221,13 +248,13 @@ TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_p
|
|||||||
TopoDS_Shape aMainShape = GetShape (geom, aShape->GetMainShape());
|
TopoDS_Shape aMainShape = GetShape (geom, aShape->GetMainShape());
|
||||||
GEOM::ListOfLong_var list = aShape->GetSubShapeIndices();
|
GEOM::ListOfLong_var list = aShape->GetSubShapeIndices();
|
||||||
|
|
||||||
TopTools_IndexedMapOfShape anIndices;
|
|
||||||
CORBA::String_var aMainIOR = geom->GetStringFromIOR(aShape->GetMainShape());
|
CORBA::String_var aMainIOR = geom->GetStringFromIOR(aShape->GetMainShape());
|
||||||
TCollection_AsciiString mainIOR = (char*)aMainIOR.in();
|
TCollection_AsciiString mainIOR = (char*)aMainIOR.in();
|
||||||
|
|
||||||
//find subshapes only one time
|
//find subshapes only one time
|
||||||
if(_mySubShapes.count(mainIOR)==0)
|
if(_mySubShapes.count(mainIOR)==0)
|
||||||
{
|
{
|
||||||
|
TopTools_IndexedMapOfShape anIndices;
|
||||||
TopExp::MapShapes(aMainShape, anIndices);
|
TopExp::MapShapes(aMainShape, anIndices);
|
||||||
Standard_Integer ii = 1, nbSubSh = anIndices.Extent();
|
Standard_Integer ii = 1, nbSubSh = anIndices.Extent();
|
||||||
for (; ii <= nbSubSh; ii++)
|
for (; ii <= nbSubSh; ii++)
|
||||||
@ -245,7 +272,7 @@ TopoDS_Shape GEOM_Client::GetShape( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_p
|
|||||||
TopoDS_Compound aCompound;
|
TopoDS_Compound aCompound;
|
||||||
B.MakeCompound(aCompound);
|
B.MakeCompound(aCompound);
|
||||||
for (int i = 0; i < list->length(); i++) {
|
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];
|
TopoDS_Shape aSubShape = _mySubShapes[mainIOR][list[i]-1];
|
||||||
B.Add(aCompound, aSubShape);
|
B.Add(aCompound, aSubShape);
|
||||||
}
|
}
|
||||||
|
@ -19,19 +19,17 @@
|
|||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// 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
|
// GEOM GEOMClient : tool to transfer BREP files from GEOM server to GEOM client
|
||||||
// File : GEOM_Client.hxx
|
// File : GEOM_Client.hxx
|
||||||
// Author : Yves FRICAUD
|
// Author : Yves FRICAUD
|
||||||
// Module : GEOM
|
// Module : GEOM
|
||||||
// $Header$
|
|
||||||
//
|
|
||||||
#ifndef _GEOM_Client_HeaderFile
|
#ifndef _GEOM_Client_HeaderFile
|
||||||
#define _GEOM_Client_HeaderFile
|
#define _GEOM_Client_HeaderFile
|
||||||
|
|
||||||
#include <SALOMEconfig.h>
|
#include <SALOMEconfig.h>
|
||||||
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
#include CORBA_SERVER_HEADER(GEOM_Gen)
|
||||||
#
|
|
||||||
#ifdef HAVE_FINITE
|
#ifdef HAVE_FINITE
|
||||||
#undef HAVE_FINITE // E.A. fix a warning about redefinition of HAVE_FINITE in re-inclusion of Standard_values.h
|
#undef HAVE_FINITE // E.A. fix a warning about redefinition of HAVE_FINITE in re-inclusion of Standard_values.h
|
||||||
#endif
|
#endif
|
||||||
@ -44,10 +42,10 @@
|
|||||||
#ifndef _Standard_Integer_HeaderFile
|
#ifndef _Standard_Integer_HeaderFile
|
||||||
#include <Standard_Integer.hxx>
|
#include <Standard_Integer.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TCollection_AsciiString;
|
class TCollection_AsciiString;
|
||||||
class TopoDS_Shape;
|
class TopoDS_Shape;
|
||||||
|
|
||||||
|
|
||||||
#ifndef _Standard_HeaderFile
|
#ifndef _Standard_HeaderFile
|
||||||
#include <Standard.hxx>
|
#include <Standard.hxx>
|
||||||
#endif
|
#endif
|
||||||
@ -85,6 +83,7 @@ class TopoDS_Shape;
|
|||||||
* and the SHAPE_READER macro defines also a new object
|
* and the SHAPE_READER macro defines also a new object
|
||||||
*/
|
*/
|
||||||
#define SINGLE_CLIENT
|
#define SINGLE_CLIENT
|
||||||
|
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
// GEOM_Client : class definition
|
// GEOM_Client : class definition
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
@ -111,6 +110,8 @@ public:
|
|||||||
//Standard_EXPORT
|
//Standard_EXPORT
|
||||||
GEOM_Client(Engines::Container_ptr client);
|
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_Integer Find( const TCollection_AsciiString& IOR, TopoDS_Shape& S ) ;
|
||||||
//Standard_EXPORT
|
//Standard_EXPORT
|
||||||
Standard_Integer Find( const TopoDS_Shape& S, TCollection_AsciiString& IOR ) ;
|
Standard_Integer Find( const TopoDS_Shape& S, TCollection_AsciiString& IOR ) ;
|
||||||
@ -126,9 +127,9 @@ public:
|
|||||||
unsigned int BufferLength() ;
|
unsigned int BufferLength() ;
|
||||||
TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape);
|
TopoDS_Shape Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr aShape);
|
||||||
#ifdef SINGLE_CLIENT
|
#ifdef SINGLE_CLIENT
|
||||||
static GEOM_Client& get_client() { static GEOM_Client a;return a; }
|
static GEOM_Client& get_client();
|
||||||
#else
|
#else
|
||||||
static GEOM_Client get_client() { return GEOM_Client(); }
|
static GEOM_Client get_client();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -281,21 +281,8 @@ bool GEOMGUI_Selection::isCompoundOfVertices( GEOM::GEOM_Object_ptr obj )
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
|
||||||
(SUIT_Session::session()->activeApplication()->activeStudy());
|
(SUIT_Session::session()->activeApplication()->activeStudy());
|
||||||
if ( appStudy && !CORBA::is_nil( obj ) && obj->GetShapeType() == GEOM::COMPOUND ) {
|
if ( appStudy && !CORBA::is_nil( obj ) )
|
||||||
GEOM::GEOM_IMeasureOperations_var anOper = GeometryGUI::GetGeomGen()->GetIMeasureOperations( appStudy->id() );
|
ret = obj->GetShapeType() == GEOM::COMPOUND && obj->GetMaxShapeType() == GEOM::VERTEX;
|
||||||
QString whatIs = anOper->WhatIs( obj );
|
|
||||||
QStringList data = whatIs.split( "\n", QString::SkipEmptyParts );
|
|
||||||
int nbVertices = 0, nbCompounds = 0, nbOther = 0;
|
|
||||||
foreach ( QString s, data ) {
|
|
||||||
QString type = s.section( ":", 0, 0 ).trimmed().toLower();
|
|
||||||
int cnt = s.section( ":", 1, 1 ).trimmed().toInt();
|
|
||||||
if ( type == "vertex" ) nbVertices += cnt;
|
|
||||||
else if ( type == "compound" ) nbCompounds += cnt;
|
|
||||||
else if ( type != "shape" ) nbOther += cnt;
|
|
||||||
}
|
|
||||||
ret = nbVertices > 0 && nbCompounds == 1 && nbOther == 0;
|
|
||||||
anOper->Destroy();
|
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,34 +129,33 @@ static inline int getTopAbsMode( const int implType )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int getMinMaxShapeType( const TopoDS_Shape& shape, bool ismin )
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static bool isCompoundOfVertices( const TopoDS_Shape& theShape )
|
static bool isCompoundOfVertices( const TopoDS_Shape& theShape )
|
||||||
{
|
{
|
||||||
bool ret = false;
|
return theShape.ShapeType() == TopAbs_COMPOUND && getMinMaxShapeType( theShape, false ) == TopAbs_VERTEX;
|
||||||
if ( !theShape.IsNull() ) {
|
|
||||||
int iType, nbTypes [TopAbs_SHAPE];
|
|
||||||
for (iType = 0; iType < TopAbs_SHAPE; ++iType)
|
|
||||||
nbTypes[iType] = 0;
|
|
||||||
nbTypes[theShape.ShapeType()]++;
|
|
||||||
|
|
||||||
TopTools_MapOfShape aMapOfShape;
|
|
||||||
aMapOfShape.Add(theShape);
|
|
||||||
TopTools_ListOfShape aListOfShape;
|
|
||||||
aListOfShape.Append(theShape);
|
|
||||||
|
|
||||||
TopTools_ListIteratorOfListOfShape itL (aListOfShape);
|
|
||||||
for (; itL.More(); itL.Next()) {
|
|
||||||
TopoDS_Iterator it (itL.Value());
|
|
||||||
for (; it.More(); it.Next()) {
|
|
||||||
TopoDS_Shape s = it.Value();
|
|
||||||
if (aMapOfShape.Add(s)) {
|
|
||||||
aListOfShape.Append(s);
|
|
||||||
nbTypes[s.ShapeType()]++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ret = nbTypes[TopAbs_VERTEX] > 0 && nbTypes[TopAbs_COMPOUND] == 1;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
|
@ -285,7 +285,6 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>GEOM_CENTER_POINT</source>
|
<source>GEOM_CENTER_POINT</source>
|
||||||
<translation>Center Point</translation>
|
<translation>Center Point</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_CENTRAL_POINT</source>
|
<source>GEOM_CENTRAL_POINT</source>
|
||||||
<translation>Central Point</translation>
|
<translation>Central Point</translation>
|
||||||
@ -1958,7 +1957,6 @@ Please, select face, shell or solid and try again</translation>
|
|||||||
<source>GEOM_AXIS_DEFAULT</source>
|
<source>GEOM_AXIS_DEFAULT</source>
|
||||||
<translation>(Z axis by default)</translation>
|
<translation>(Z axis by default)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_VECTOR_LENGTH</source>
|
<source>GEOM_VECTOR_LENGTH</source>
|
||||||
<translation>Vector Length :</translation>
|
<translation>Vector Length :</translation>
|
||||||
@ -4146,8 +4144,7 @@ Otherwise the dimensions will be kept without modifications.</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_PRECISION_HINT</source>
|
<source>GEOM_PRECISION_HINT</source>
|
||||||
<translation>
|
<translation>Input value precision can be adjusted using
|
||||||
Input value precision can be adjusted using
|
|
||||||
'%1' parameter in Geometry module preferences.</translation>
|
'%1' parameter in Geometry module preferences.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
@ -1505,6 +1505,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_SKETCHER_ABS</source>
|
<source>GEOM_SKETCHER_ABS</source>
|
||||||
<translation>Absolu</translation>
|
<translation>Absolu</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SKETCHER_ADD_PARAMS</source>
|
||||||
|
<translation>TODO</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_SKETCHER_ANGLE</source>
|
<source>GEOM_SKETCHER_ANGLE</source>
|
||||||
<translation>Angle</translation>
|
<translation>Angle</translation>
|
||||||
@ -1521,6 +1525,30 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_SKETCHER_ARC</source>
|
<source>GEOM_SKETCHER_ARC</source>
|
||||||
<translation>Arc</translation>
|
<translation>Arc</translation>
|
||||||
</message>
|
</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>
|
<message>
|
||||||
<source>GEOM_SKETCHER_DEST</source>
|
<source>GEOM_SKETCHER_DEST</source>
|
||||||
<translation>Destination</translation>
|
<translation>Destination</translation>
|
||||||
@ -1557,6 +1585,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_SKETCHER_LENGTH2</source>
|
<source>GEOM_SKETCHER_LENGTH2</source>
|
||||||
<translation>Longueur :</translation>
|
<translation>Longueur :</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SKETCHER_NONE</source>
|
||||||
|
<translation>Aucun (Tangentiel)</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_SKETCHER_PER</source>
|
<source>GEOM_SKETCHER_PER</source>
|
||||||
<translation>Perpendiculaire</translation>
|
<translation>Perpendiculaire</translation>
|
||||||
@ -1573,6 +1605,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<source>GEOM_SKETCHER_END_POINT2</source>
|
<source>GEOM_SKETCHER_END_POINT2</source>
|
||||||
<translation>End Point :</translation>
|
<translation>End Point :</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>GEOM_SKETCHER_RADIUS</source>
|
||||||
|
<translation>Rayon</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_SKETCHER_RADIUS2</source>
|
<source>GEOM_SKETCHER_RADIUS2</source>
|
||||||
<translation>Rayon :</translation>
|
<translation>Rayon :</translation>
|
||||||
@ -4042,17 +4078,29 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
|
|||||||
<translation>INOUT</translation>
|
<translation>INOUT</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<translation>Trouver les éléments d'un objet</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<translation>Trouver les éléments d'un objet</translation>
|
||||||
</message>
|
</message>
|
||||||
<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>
|
<translation>Trouver les éléments d'un objet</translation>
|
||||||
</message>
|
</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>
|
<message>
|
||||||
<source>GEOM_PUBLISH_RESULT_GRP</source>
|
<source>GEOM_PUBLISH_RESULT_GRP</source>
|
||||||
<translation>Options avancées</translation>
|
<translation>Options avancées</translation>
|
||||||
@ -4638,6 +4686,29 @@ Voulez-vous continuer?</translation>
|
|||||||
<translation>Ouvrir une Texture</translation>
|
<translation>Ouvrir une Texture</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</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>
|
<context>
|
||||||
<name>AdvancedGUI_PipeTShapeDlg</name>
|
<name>AdvancedGUI_PipeTShapeDlg</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -18,12 +18,13 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// 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 "GEOM_Function.hxx"
|
||||||
|
|
||||||
|
#include <gp_XYZ.hxx>
|
||||||
|
|
||||||
#define ROTATE_ANGLE 1
|
#define ROTATE_ANGLE 1
|
||||||
#define ROTATE_AXIS 2
|
#define ROTATE_AXIS 2
|
||||||
#define ROTATE_ORGN 3
|
#define ROTATE_ORGN 3
|
||||||
@ -33,6 +34,9 @@
|
|||||||
#define ROTATE_CENTRAL_POINT 7
|
#define ROTATE_CENTRAL_POINT 7
|
||||||
#define ROTATE_POINT1 8
|
#define ROTATE_POINT1 8
|
||||||
#define ROTATE_POINT2 9
|
#define ROTATE_POINT2 9
|
||||||
|
#define ROTATE_DIR2_X 10
|
||||||
|
#define ROTATE_DIR2_Y 11
|
||||||
|
#define ROTATE_DIR2_Z 12
|
||||||
|
|
||||||
class GEOMImpl_IRotate
|
class GEOMImpl_IRotate
|
||||||
{
|
{
|
||||||
@ -64,7 +68,7 @@ class GEOMImpl_IRotate
|
|||||||
|
|
||||||
Handle(GEOM_Function) GetOriginal() { return _func->GetReference(ROTATE_ORGN); }
|
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); }
|
double GetStep() { return _func->GetReal(ROTATE_STEP1); }
|
||||||
|
|
||||||
@ -76,6 +80,21 @@ class GEOMImpl_IRotate
|
|||||||
|
|
||||||
int GetNbIter2() { return _func->GetInteger(ROTATE_NBITER2); }
|
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:
|
private:
|
||||||
|
|
||||||
|
@ -3304,12 +3304,35 @@ namespace {
|
|||||||
}
|
}
|
||||||
return defaultNorm;
|
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:
|
* case GetInPlace:
|
||||||
default:
|
* default:
|
||||||
*/
|
*/
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) theShapeWhere,
|
Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object) theShapeWhere,
|
||||||
@ -3344,8 +3367,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
|||||||
Handle(GEOM_Object) aResult;
|
Handle(GEOM_Object) aResult;
|
||||||
|
|
||||||
bool isFound = false;
|
bool isFound = false;
|
||||||
Standard_Integer iType = TopAbs_SOLID;
|
TopAbs_ShapeEnum iType = TopAbs_SOLID;
|
||||||
Standard_Integer compType = TopAbs_SOLID;
|
|
||||||
//Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.;
|
//Standard_Real aWhat_Mass = 0., aWhere_Mass = 0.;
|
||||||
Standard_Real tab_aWhat[4], tab_aWhere[4];
|
Standard_Real tab_aWhat[4], tab_aWhere[4];
|
||||||
Standard_Real dl_l = 1e-3;
|
Standard_Real dl_l = 1e-3;
|
||||||
@ -3356,6 +3378,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
|||||||
GProp_GProps aProps;
|
GProp_GProps aProps;
|
||||||
|
|
||||||
// Find the iType of the aWhat shape
|
// Find the iType of the aWhat shape
|
||||||
|
/*
|
||||||
if ( aWhat.ShapeType() == TopAbs_VERTEX ) iType = TopAbs_VERTEX;
|
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_EDGE || aWhat.ShapeType() == TopAbs_WIRE ) iType = TopAbs_EDGE;
|
||||||
else if ( aWhat.ShapeType() == TopAbs_FACE || aWhat.ShapeType() == TopAbs_SHELL ) iType = TopAbs_FACE;
|
else if ( aWhat.ShapeType() == TopAbs_FACE || aWhat.ShapeType() == TopAbs_SHELL ) iType = TopAbs_FACE;
|
||||||
@ -3367,7 +3390,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
|||||||
SetErrorCode("Error: theShapeWhat is an empty COMPOUND.");
|
SetErrorCode("Error: theShapeWhat is an empty COMPOUND.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
compType = It.Value().ShapeType();
|
TopAbs_ShapeEnum compType = It.Value().ShapeType();
|
||||||
if ( compType == TopAbs_VERTEX ) iType = TopAbs_VERTEX;
|
if ( compType == TopAbs_VERTEX ) iType = TopAbs_VERTEX;
|
||||||
else if ( compType == TopAbs_EDGE || compType == TopAbs_WIRE ) iType = TopAbs_EDGE;
|
else if ( compType == TopAbs_EDGE || compType == TopAbs_WIRE ) iType = TopAbs_EDGE;
|
||||||
else if ( compType == TopAbs_FACE || compType == TopAbs_SHELL) iType = TopAbs_FACE;
|
else if ( compType == TopAbs_FACE || compType == TopAbs_SHELL) iType = TopAbs_FACE;
|
||||||
@ -3377,9 +3400,15 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
|||||||
SetErrorCode("Error: An attempt to extract a shape of not supported type.");
|
SetErrorCode("Error: An attempt to extract a shape of not supported type.");
|
||||||
return NULL;
|
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_aWhat ( aWhat, iType );
|
||||||
TopExp_Explorer Exp_aWhere( aWhere, TopAbs_ShapeEnum( iType ) );
|
TopExp_Explorer Exp_aWhere ( aWhere, iType );
|
||||||
TopExp_Explorer Exp_Edge ( aWhere, TopAbs_EDGE );
|
TopExp_Explorer Exp_Edge ( aWhere, TopAbs_EDGE );
|
||||||
|
|
||||||
// Find the shortest edge in theShapeWhere shape
|
// Find the shortest edge in theShapeWhere shape
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
@ -28,11 +27,6 @@
|
|||||||
#include <OpUtil.hxx>
|
#include <OpUtil.hxx>
|
||||||
#include <Utils_ExceptHandlers.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_Function.hxx>
|
||||||
#include <GEOM_PythonDump.hxx>
|
#include <GEOM_PythonDump.hxx>
|
||||||
|
|
||||||
@ -52,6 +46,23 @@
|
|||||||
|
|
||||||
#include <GEOMImpl_Types.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_Failure.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
|
||||||
|
|
||||||
@ -594,6 +605,148 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::Translate2D (Handle(GEOM_Obje
|
|||||||
return aCopy;
|
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;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
/*!
|
/*!
|
||||||
@ -1750,3 +1903,148 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePointsCopy (Handle
|
|||||||
return aCopy;
|
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;
|
||||||
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef _GEOMImpl_ITransformOperations_HXX_
|
#ifndef _GEOMImpl_ITransformOperations_HXX_
|
||||||
#define _GEOMImpl_ITransformOperations_HXX_
|
#define _GEOMImpl_ITransformOperations_HXX_
|
||||||
@ -27,7 +26,12 @@
|
|||||||
#include "GEOM_IOperations.hxx"
|
#include "GEOM_IOperations.hxx"
|
||||||
#include "GEOM_Engine.hxx"
|
#include "GEOM_Engine.hxx"
|
||||||
#include "GEOM_Object.hxx"
|
#include "GEOM_Object.hxx"
|
||||||
|
|
||||||
#include <TDocStd_Document.hxx>
|
#include <TDocStd_Document.hxx>
|
||||||
|
#include <TopoDS_Shape.hxx>
|
||||||
|
|
||||||
|
class GEOMImpl_ITranslate;
|
||||||
|
class GEOMImpl_IRotate;
|
||||||
|
|
||||||
class GEOMImpl_ITransformOperations : public GEOM_IOperations
|
class GEOMImpl_ITransformOperations : public GEOM_IOperations
|
||||||
{
|
{
|
||||||
@ -73,6 +77,14 @@ class GEOMImpl_ITransformOperations : public GEOM_IOperations
|
|||||||
double theStep2,
|
double theStep2,
|
||||||
Standard_Integer theNbTimes2);
|
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,
|
Standard_EXPORT Handle(GEOM_Object) MirrorPlane (Handle(GEOM_Object) theObject,
|
||||||
Handle(GEOM_Object) thePlane);
|
Handle(GEOM_Object) thePlane);
|
||||||
|
|
||||||
@ -155,6 +167,9 @@ class GEOMImpl_ITransformOperations : public GEOM_IOperations
|
|||||||
Handle(GEOM_Object) thePoint1,
|
Handle(GEOM_Object) thePoint1,
|
||||||
Handle(GEOM_Object) thePoint2);
|
Handle(GEOM_Object) thePoint2);
|
||||||
|
|
||||||
|
Standard_EXPORT Handle(GEOM_Object) TransformLikeOtherCopy (Handle(GEOM_Object) theObject,
|
||||||
|
Handle(GEOM_Object) theSample);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -205,9 +205,12 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
|
|||||||
|
|
||||||
gp_Ax1 AX1(aP1, D);
|
gp_Ax1 AX1(aP1, D);
|
||||||
|
|
||||||
|
|
||||||
gp_Trsf aTrsf1;
|
gp_Trsf aTrsf1;
|
||||||
gp_Trsf aTrsf2;
|
gp_Trsf aTrsf2;
|
||||||
|
|
||||||
|
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;
|
gp_Pnt P1;
|
||||||
GProp_GProps System;
|
GProp_GProps System;
|
||||||
|
|
||||||
@ -233,7 +236,14 @@ Standard_Integer GEOMImpl_RotateDriver::Execute(TFunction_Logbook& log) const
|
|||||||
|
|
||||||
if ( P1.IsEqual(P2, Precision::Confusion() ) ) return 0;
|
if ( P1.IsEqual(P2, Precision::Confusion() ) ) return 0;
|
||||||
|
|
||||||
gp_Vec Vec (P1.X()-P2.X(), P1.Y()-P2.Y(), P1.Z()-P2.Z());
|
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 (aDir2);
|
||||||
Vec.Normalize();
|
Vec.Normalize();
|
||||||
|
|
||||||
Standard_Integer nbtimes2 = RI.GetNbIter2();
|
Standard_Integer nbtimes2 = RI.GetNbIter2();
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
#include <GEOMImpl_TranslateDriver.hxx>
|
#include <GEOMImpl_TranslateDriver.hxx>
|
||||||
#include <GEOMImpl_ITranslate.hxx>
|
#include <GEOMImpl_ITranslate.hxx>
|
||||||
|
#include <GEOMImpl_ITransformOperations.hxx>
|
||||||
#include <GEOMImpl_Types.hxx>
|
#include <GEOMImpl_Types.hxx>
|
||||||
#include <GEOM_Function.hxx>
|
#include <GEOM_Function.hxx>
|
||||||
|
|
||||||
@ -197,6 +197,7 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
|
|||||||
B.Add(aCompound, anOriginal.Located(aLocRes));
|
B.Add(aCompound, anOriginal.Located(aLocRes));
|
||||||
}
|
}
|
||||||
aShape = aCompound;
|
aShape = aCompound;
|
||||||
|
//aShape = GEOMImpl_ITransformOperations::TranslateShape1D(anOriginal, &TI);
|
||||||
}
|
}
|
||||||
else if (aType == TRANSLATE_2D) {
|
else if (aType == TRANSLATE_2D) {
|
||||||
Standard_Integer nbtimes1 = TI.GetNbIter1(), nbtimes2 = TI.GetNbIter2();
|
Standard_Integer nbtimes1 = TI.GetNbIter1(), nbtimes2 = TI.GetNbIter2();
|
||||||
@ -243,6 +244,7 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
aShape = aCompound;
|
aShape = aCompound;
|
||||||
|
//aShape = GEOMImpl_ITransformOperations::TranslateShape2D(anOriginal, &TI);
|
||||||
}
|
}
|
||||||
else return 0;
|
else return 0;
|
||||||
|
|
||||||
|
@ -968,6 +968,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
|
|||||||
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
||||||
GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(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
|
// Reconstruct arguments and tree of sub-shapes of the arguments
|
||||||
CORBA::String_var anIOR;
|
CORBA::String_var anIOR;
|
||||||
@ -996,6 +997,64 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
|
|||||||
aSubO = aShapesOp->GetInPlace(theObject, anArgO);
|
aSubO = aShapesOp->GetInPlace(theObject, anArgO);
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case GEOM::FSM_Transformed:
|
||||||
{
|
{
|
||||||
// transformation, cannot use GetInPlace, operate with indices
|
// transformation, cannot use GetInPlace, operate with indices
|
||||||
@ -1183,6 +1242,8 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(SALOMEDS::Study_ptr theStudy,
|
|||||||
switch (theFindMethod) {
|
switch (theFindMethod) {
|
||||||
case GEOM::FSM_GetInPlace:
|
case GEOM::FSM_GetInPlace:
|
||||||
pd << "FSM_GetInPlace"; break;
|
pd << "FSM_GetInPlace"; break;
|
||||||
|
case GEOM::FSM_MultiTransformed:
|
||||||
|
pd << "FSM_MultiTransformed"; break;
|
||||||
case GEOM::FSM_Transformed:
|
case GEOM::FSM_Transformed:
|
||||||
pd << "FSM_Transformed"; break;
|
pd << "FSM_Transformed"; break;
|
||||||
case GEOM::FSM_GetSame:
|
case GEOM::FSM_GetSame:
|
||||||
@ -1223,6 +1284,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th
|
|||||||
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
||||||
GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
|
GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
|
||||||
|
GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
|
||||||
|
|
||||||
// Reconstruct published sub-shapes
|
// Reconstruct published sub-shapes
|
||||||
SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO);
|
SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO);
|
||||||
@ -1253,6 +1315,19 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::Study_ptr th
|
|||||||
aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO);
|
aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO);
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case GEOM::FSM_Transformed:
|
||||||
{
|
{
|
||||||
// transformation, cannot use GetInPlace, operate with indices
|
// transformation, cannot use GetInPlace, operate with indices
|
||||||
@ -1484,6 +1559,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu
|
|||||||
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
||||||
GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(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
|
// Reconstruct arguments and tree of sub-shapes of the arguments
|
||||||
CORBA::String_var anIOR;
|
CORBA::String_var anIOR;
|
||||||
@ -1512,6 +1588,19 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu
|
|||||||
aSubO = aShapesOp->GetInPlace(theObject, anArgO);
|
aSubO = aShapesOp->GetInPlace(theObject, anArgO);
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case GEOM::FSM_Transformed:
|
||||||
{
|
{
|
||||||
// transformation, cannot use GetInPlace, operate with indices
|
// transformation, cannot use GetInPlace, operate with indices
|
||||||
@ -1691,6 +1780,8 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(SALOMEDS::Study_ptr theStu
|
|||||||
switch (theFindMethod) {
|
switch (theFindMethod) {
|
||||||
case GEOM::FSM_GetInPlace:
|
case GEOM::FSM_GetInPlace:
|
||||||
pd << "FSM_GetInPlace"; break;
|
pd << "FSM_GetInPlace"; break;
|
||||||
|
case GEOM::FSM_MultiTransformed:
|
||||||
|
pd << "FSM_MultiTransformed"; break;
|
||||||
case GEOM::FSM_Transformed:
|
case GEOM::FSM_Transformed:
|
||||||
pd << "FSM_Transformed"; break;
|
pd << "FSM_Transformed"; break;
|
||||||
case GEOM::FSM_GetSame:
|
case GEOM::FSM_GetSame:
|
||||||
@ -1731,6 +1822,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr
|
|||||||
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
// Get interface, containing method, which we will use to reconstruct sub-shapes
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
GEOM::GEOM_IShapesOperations_var aShapesOp = GetIShapesOperations(theStudy->StudyId());
|
||||||
GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
|
GEOM::GEOM_IGroupOperations_var aGroupOp = GetIGroupOperations(theStudy->StudyId());
|
||||||
|
GEOM::GEOM_ITransformOperations_var aTrsfOp = GetITransformOperations(theStudy->StudyId());
|
||||||
|
|
||||||
// Reconstruct published sub-shapes
|
// Reconstruct published sub-shapes
|
||||||
SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO);
|
SALOMEDS::ChildIterator_var it = theStudy->NewChildIterator(theOldSO);
|
||||||
@ -1769,6 +1861,19 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr
|
|||||||
aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO);
|
aNewSubO = aShapesOp->GetInPlace(theNewO, anOldSubO);
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case GEOM::FSM_Transformed:
|
||||||
{
|
{
|
||||||
// transformation, cannot use GetInPlace, operate with indices
|
// transformation, cannot use GetInPlace, operate with indices
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#include <Standard_Stream.hxx>
|
#include <Standard_Stream.hxx>
|
||||||
|
|
||||||
@ -1130,6 +1129,37 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RotateThreePointsCopy
|
|||||||
return GetObject(anObject);
|
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
|
* RecomputeObject
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef _GEOM_ITransformOperations_i_HeaderFile
|
#ifndef _GEOM_ITransformOperations_i_HeaderFile
|
||||||
#define _GEOM_ITransformOperations_i_HeaderFile
|
#define _GEOM_ITransformOperations_i_HeaderFile
|
||||||
@ -51,10 +50,12 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i :
|
|||||||
GEOM::GEOM_Object_ptr thePoint1,
|
GEOM::GEOM_Object_ptr thePoint1,
|
||||||
GEOM::GEOM_Object_ptr thePoint2);
|
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 TranslateVector (GEOM::GEOM_Object_ptr theObject,
|
||||||
GEOM::GEOM_Object_ptr theVector);
|
GEOM::GEOM_Object_ptr theVector);
|
||||||
@ -67,10 +68,15 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i :
|
|||||||
CORBA::Double theDistance,
|
CORBA::Double theDistance,
|
||||||
CORBA::Boolean theCopy);
|
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 MultiTranslate2D (GEOM::GEOM_Object_ptr theObject,
|
||||||
GEOM::GEOM_Object_ptr theVector2, CORBA::Double theStep2, CORBA::Long theNbTimes2);
|
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 Rotate (GEOM::GEOM_Object_ptr theObject,
|
||||||
GEOM::GEOM_Object_ptr theAxis,
|
GEOM::GEOM_Object_ptr theAxis,
|
||||||
@ -159,6 +165,9 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i :
|
|||||||
GEOM::GEOM_Object_ptr thePoint1,
|
GEOM::GEOM_Object_ptr thePoint1,
|
||||||
GEOM::GEOM_Object_ptr thePoint2);
|
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);
|
GEOM::GEOM_Object_ptr RecomputeObject (GEOM::GEOM_Object_ptr theObject);
|
||||||
|
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ GEOM::shape_type GEOM_Object_i::GetTopologyType()
|
|||||||
return (GEOM::shape_type)shape.ShapeType();
|
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() )
|
if ( shape.IsNull() )
|
||||||
return GEOM::SHAPE;
|
return GEOM::SHAPE;
|
||||||
@ -153,8 +153,11 @@ static GEOM::shape_type getMinShapeType( const TopoDS_Shape& shape )
|
|||||||
for (; it.More(); it.Next()) {
|
for (; it.More(); it.Next()) {
|
||||||
TopoDS_Shape sub_shape = it.Value();
|
TopoDS_Shape sub_shape = it.Value();
|
||||||
if ( sub_shape.IsNull() ) continue;
|
if ( sub_shape.IsNull() ) continue;
|
||||||
GEOM::shape_type stype = (GEOM::shape_type)sub_shape.ShapeType();
|
GEOM::shape_type stype = (GEOM::shape_type)getMinMaxShapeType( sub_shape, ismin );
|
||||||
if ( stype != GEOM::SHAPE && stype > ret )
|
if ( stype == GEOM::SHAPE ) continue;
|
||||||
|
if ( ismin && stype > ret )
|
||||||
|
ret = stype;
|
||||||
|
else if ( !ismin && ( ret < GEOM::SOLID || stype < ret ) )
|
||||||
ret = stype;
|
ret = stype;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -169,7 +172,17 @@ static GEOM::shape_type getMinShapeType( const TopoDS_Shape& shape )
|
|||||||
//=============================================================================
|
//=============================================================================
|
||||||
GEOM::shape_type GEOM_Object_i::GetMinShapeType()
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -55,6 +55,8 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
|
|||||||
|
|
||||||
virtual GEOM::shape_type GetMinShapeType();
|
virtual GEOM::shape_type GetMinShapeType();
|
||||||
|
|
||||||
|
virtual GEOM::shape_type GetMaxShapeType();
|
||||||
|
|
||||||
virtual void SetName(const char* theName);
|
virtual void SetName(const char* theName);
|
||||||
|
|
||||||
virtual char* GetName();
|
virtual char* GetName();
|
||||||
|
@ -53,6 +53,17 @@ def TestMeasureOperations (geompy, math):
|
|||||||
print "\nBox 10x30x70 description:"
|
print "\nBox 10x30x70 description:"
|
||||||
print Descr
|
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 #######
|
####### BasicProperties #######
|
||||||
|
|
||||||
Props = geompy.BasicProperties(box)
|
Props = geompy.BasicProperties(box)
|
||||||
|
@ -654,10 +654,10 @@ def TestOtherOperations (geompy, math):
|
|||||||
pcyl = geompy.MakeVertex(50, 50, -50)
|
pcyl = geompy.MakeVertex(50, 50, -50)
|
||||||
cyli = geompy.MakeCylinder(pcyl, vz, 40, 100)
|
cyli = geompy.MakeCylinder(pcyl, vz, 40, 100)
|
||||||
fuse = geompy.MakeFuse(sph1, cyli)
|
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
|
# As after Fuse we have a compound, we need to obtain a solid from it
|
||||||
shsh = geompy.SubShapeAll(fuse, geompy.ShapeType["SOLID"])
|
#shsh = geompy.SubShapeAll(fuse, geompy.ShapeType["SOLID"])
|
||||||
sh_1 = shsh[0]
|
#sh_1 = shsh[0]
|
||||||
geompy.addToStudy(sh_1, "sh_1")
|
geompy.addToStudy(sh_1, "sh_1")
|
||||||
|
|
||||||
# GetShapesOnShape
|
# GetShapesOnShape
|
||||||
|
@ -2251,6 +2251,21 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
anObj = self.GetSubShape(aShape, ListOfIDs)
|
anObj = self.GetSubShape(aShape, ListOfIDs)
|
||||||
return anObj
|
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
|
# end of l4_decompose_d
|
||||||
## @}
|
## @}
|
||||||
|
|
||||||
@ -2566,8 +2581,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
# Example: see GEOM_TestAll.py
|
# Example: see GEOM_TestAll.py
|
||||||
if Limit == ShapeType["AUTO"]:
|
if Limit == ShapeType["AUTO"]:
|
||||||
# automatic detection of the most appropriate shape limit type
|
# automatic detection of the most appropriate shape limit type
|
||||||
lim = GEOM.SOLID
|
lim = GEOM.SHAPE
|
||||||
for s in ListShapes: lim = max( lim, s.GetMinShapeType() )
|
for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
|
||||||
Limit = lim._v
|
Limit = lim._v
|
||||||
pass
|
pass
|
||||||
anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
|
anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
|
||||||
@ -2596,8 +2611,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
ListMaterials=[], KeepNonlimitShapes=0):
|
ListMaterials=[], KeepNonlimitShapes=0):
|
||||||
if Limit == ShapeType["AUTO"]:
|
if Limit == ShapeType["AUTO"]:
|
||||||
# automatic detection of the most appropriate shape limit type
|
# automatic detection of the most appropriate shape limit type
|
||||||
lim = GEOM.SOLID
|
lim = GEOM.SHAPE
|
||||||
for s in ListShapes: lim = max( lim, s.GetMinShapeType() )
|
for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
|
||||||
Limit = lim._v
|
Limit = lim._v
|
||||||
pass
|
pass
|
||||||
anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
|
anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
|
||||||
@ -3425,6 +3440,42 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
RaiseIfFailed("WhatIs", self.MeasuOp)
|
RaiseIfFailed("WhatIs", self.MeasuOp)
|
||||||
return aDescr
|
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.
|
## Get a point, situated at the centre of mass of theShape.
|
||||||
# @param theShape Shape to define centre of mass of.
|
# @param theShape Shape to define centre of mass of.
|
||||||
# @return New GEOM_Object, containing the created point.
|
# @return New GEOM_Object, containing the created point.
|
||||||
@ -3637,6 +3688,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
#RaiseIfFailed("Import", self.InsertOp)
|
#RaiseIfFailed("Import", self.InsertOp)
|
||||||
# recieve name using returned vertex
|
# recieve name using returned vertex
|
||||||
UnitName = "M"
|
UnitName = "M"
|
||||||
|
if anObj.GetShapeType() == GEOM.VERTEX:
|
||||||
|
vertices = [anObj]
|
||||||
|
else:
|
||||||
vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
|
vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
|
||||||
if len(vertices)>0:
|
if len(vertices)>0:
|
||||||
p = self.PointCoordinates(vertices[0])
|
p = self.PointCoordinates(vertices[0])
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
|
|
||||||
#include "GEOM_AISShape.ixx"
|
#include "GEOM_AISShape.ixx"
|
||||||
#include "SALOME_InteractiveObject.hxx"
|
#include "SALOME_InteractiveObject.hxx"
|
||||||
|
#include "GEOM_AISVector.hxx"
|
||||||
|
|
||||||
// Open CASCADE Includes
|
// Open CASCADE Includes
|
||||||
#include <AIS_Drawer.hxx>
|
#include <AIS_Drawer.hxx>
|
||||||
@ -210,10 +211,14 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
|
|||||||
|
|
||||||
if (isShowVectors())
|
if (isShowVectors())
|
||||||
{
|
{
|
||||||
|
const bool isVector = IsKind(STANDARD_TYPE(GEOM_AISVector));
|
||||||
TopExp_Explorer Exp ( myshape, TopAbs_EDGE );
|
TopExp_Explorer Exp ( myshape, TopAbs_EDGE );
|
||||||
for ( ; Exp.More(); Exp.Next() ) {
|
for ( ; Exp.More(); Exp.Next() ) {
|
||||||
TopoDS_Vertex aV1, aV2;
|
TopoDS_Vertex aV1, aV2;
|
||||||
TopoDS_Edge anEdgeE = TopoDS::Edge(Exp.Current());
|
TopoDS_Edge anEdgeE = TopoDS::Edge(Exp.Current());
|
||||||
|
if ( !isVector )
|
||||||
|
// draw curve direction (issue 0021087)
|
||||||
|
anEdgeE.Orientation( TopAbs_FORWARD );
|
||||||
|
|
||||||
if ( anEdgeE.IsNull() ) continue;
|
if ( anEdgeE.IsNull() ) continue;
|
||||||
|
|
||||||
|
@ -65,8 +65,11 @@ Execute()
|
|||||||
|
|
||||||
TEdgeSet::Iterator anIter (myEdgeSet);
|
TEdgeSet::Iterator anIter (myEdgeSet);
|
||||||
for (; anIter.More(); anIter.Next()) {
|
for (; anIter.More(); anIter.Next()) {
|
||||||
const TopoDS_Edge& anEdge = anIter.Value();
|
TopoDS_Edge anEdge = anIter.Value();
|
||||||
OCC2VTK(anEdge,aPolyData,aPts,myIsVector);
|
if ( !myIsVector )
|
||||||
|
// draw curve direction (issue 0021087)
|
||||||
|
anEdge.Orientation( TopAbs_FORWARD );
|
||||||
|
OCC2VTK(anEdge,aPolyData,aPts,myIsVector||myIsVectorMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,10 +266,10 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
|
|||||||
|
|
||||||
void GEOM_EdgeSource::SetVectorMode (bool theMode)
|
void GEOM_EdgeSource::SetVectorMode (bool theMode)
|
||||||
{
|
{
|
||||||
myIsVector = theMode;
|
myIsVectorMode = theMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GEOM_EdgeSource::GetVectorMode ()
|
bool GEOM_EdgeSource::GetVectorMode ()
|
||||||
{
|
{
|
||||||
return myIsVector;
|
return !myIsVector && myIsVectorMode;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ protected:
|
|||||||
TEdgeSet myEdgeSet;
|
TEdgeSet myEdgeSet;
|
||||||
// The <myIsVector> flag is common for all edges, because the shape,
|
// The <myIsVector> flag is common for all edges, because the shape,
|
||||||
// representing a vector, can have only one edge.
|
// representing a vector, can have only one edge.
|
||||||
bool myIsVector;
|
bool myIsVector, myIsVectorMode;
|
||||||
|
|
||||||
void Execute();
|
void Execute();
|
||||||
|
|
||||||
|
@ -129,7 +129,8 @@ void OperationGUI_GetSharedShapesDlg::Init()
|
|||||||
connect(myGeomGUI->getApp()->selectionMgr(),
|
connect(myGeomGUI->getApp()->selectionMgr(),
|
||||||
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
initName(getNewObjectName());
|
//initName(getNewObjectName());
|
||||||
|
initName(getPrefixByType());
|
||||||
|
|
||||||
ConstructorsClicked(0);
|
ConstructorsClicked(0);
|
||||||
GroupPoints->PushButton1->click();
|
GroupPoints->PushButton1->click();
|
||||||
@ -181,7 +182,8 @@ bool OperationGUI_GetSharedShapesDlg::ClickOnApply()
|
|||||||
if (!onAccept())
|
if (!onAccept())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
initName(getNewObjectName());
|
//initName(getNewObjectName());
|
||||||
|
initName(getPrefixByType());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -261,7 +263,8 @@ void OperationGUI_GetSharedShapesDlg::enterEvent(QEvent*)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void OperationGUI_GetSharedShapesDlg::ComboTextChanged()
|
void OperationGUI_GetSharedShapesDlg::ComboTextChanged()
|
||||||
{
|
{
|
||||||
initName(getNewObjectName());
|
//initName(getNewObjectName());
|
||||||
|
initName(getPrefixByType());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -319,6 +322,9 @@ bool OperationGUI_GetSharedShapesDlg::execute (ObjectList& objects)
|
|||||||
if (!aList->length())
|
if (!aList->length())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (aList->length() > 1)
|
||||||
|
myMainFrame->ResultName->setText(getPrefixByType());
|
||||||
|
|
||||||
for (int i = 0, n = aList->length(); i < n; i++)
|
for (int i = 0, n = aList->length(); i < n; i++)
|
||||||
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
|
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
|
||||||
|
|
||||||
@ -339,24 +345,24 @@ GEOM::GEOM_Object_ptr OperationGUI_GetSharedShapesDlg::getFather (GEOM::GEOM_Obj
|
|||||||
}
|
}
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
// Function : getNewObjectName
|
// Function : getPrefixByType
|
||||||
// Purpose :
|
// Purpose :
|
||||||
//================================================================
|
//================================================================
|
||||||
QString OperationGUI_GetSharedShapesDlg::getNewObjectName() const
|
QString OperationGUI_GetSharedShapesDlg::getPrefixByType () const
|
||||||
{
|
{
|
||||||
|
QString aPref;
|
||||||
|
|
||||||
int aLimit = GroupPoints->ComboBox1->currentIndex();
|
int aLimit = GroupPoints->ComboBox1->currentIndex();
|
||||||
//QString aName = tr("GEOM_SHARED_SHAPE");
|
|
||||||
QString aName;
|
|
||||||
|
|
||||||
switch (aLimit) {
|
switch (aLimit) {
|
||||||
case 0: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SOLID")) ; break;
|
case 0: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SOLID")) ; break;
|
||||||
case 1: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHELL")) ; break;
|
case 1: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHELL")) ; break;
|
||||||
case 2: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_FACE")) ; break;
|
case 2: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_FACE")) ; break;
|
||||||
case 3: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_WIRE")) ; break;
|
case 3: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_WIRE")) ; break;
|
||||||
case 4: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_EDGE")) ; break;
|
case 4: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_EDGE")) ; break;
|
||||||
case 5: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_VERTEX")); break;
|
case 5: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_VERTEX")); break;
|
||||||
default: aName = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHAPE")) ;
|
default: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHAPE")) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return aName;
|
return aPref;
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ protected:
|
|||||||
virtual bool isValid (QString&);
|
virtual bool isValid (QString&);
|
||||||
virtual bool execute (ObjectList&);
|
virtual bool execute (ObjectList&);
|
||||||
virtual GEOM::GEOM_Object_ptr getFather (GEOM::GEOM_Object_ptr);
|
virtual GEOM::GEOM_Object_ptr getFather (GEOM::GEOM_Object_ptr);
|
||||||
virtual QString getNewObjectName() const;
|
QString getPrefixByType() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -293,9 +293,9 @@ void OperationGUI_PartitionDlg::SelectionIntoArgument()
|
|||||||
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
|
||||||
//myListMaterials.length( 0 ); // obsolete
|
//myListMaterials.length( 0 ); // obsolete
|
||||||
|
|
||||||
GEOM::shape_type type = GEOM::SOLID;
|
GEOM::shape_type type = GEOM::SHAPE;
|
||||||
for (int i = 0; i < myListShapes.length(); i++)
|
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 ) );
|
int idx = qMax( 0, GroupPoints->ComboBox1->findData( type ) );
|
||||||
GroupPoints->ComboBox1->setCurrentIndex( idx );
|
GroupPoints->ComboBox1->setCurrentIndex( idx );
|
||||||
|
|
||||||
|
@ -19,11 +19,10 @@
|
|||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
|
||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
// File : TransformationGUI_MultiRotationDlg.cxx
|
// File : TransformationGUI_MultiRotationDlg.cxx
|
||||||
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
||||||
//
|
|
||||||
#include "TransformationGUI_MultiRotationDlg.h"
|
#include "TransformationGUI_MultiRotationDlg.h"
|
||||||
|
|
||||||
#include <DlgRef.h>
|
#include <DlgRef.h>
|
||||||
@ -638,7 +637,7 @@ void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr
|
|||||||
anArgs->length(1);
|
anArgs->length(1);
|
||||||
anArgs[0] = myBase;
|
anArgs[0] = myBase;
|
||||||
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
|
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
|
||||||
/*theFindMethod=*/GEOM::FSM_Transformed,
|
/*theFindMethod=*/GEOM::FSM_MultiTransformed,
|
||||||
/*theInheritFirstArg=*/true,
|
/*theInheritFirstArg=*/true,
|
||||||
mainFrame()->CheckBoxAddPrefix->isChecked());
|
mainFrame()->CheckBoxAddPrefix->isChecked());
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,10 @@
|
|||||||
//
|
//
|
||||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
//
|
//
|
||||||
|
|
||||||
// GEOM GEOMGUI : GUI for Geometry component
|
// GEOM GEOMGUI : GUI for Geometry component
|
||||||
// File : TransformationGUI_MultiTranslationDlg.cxx
|
// File : TransformationGUI_MultiTranslationDlg.cxx
|
||||||
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
// Author : Damien COQUERET, Open CASCADE S.A.S.
|
||||||
//
|
|
||||||
#include "TransformationGUI_MultiTranslationDlg.h"
|
#include "TransformationGUI_MultiTranslationDlg.h"
|
||||||
|
|
||||||
#include <DlgRef.h>
|
#include <DlgRef.h>
|
||||||
@ -762,7 +761,7 @@ void TransformationGUI_MultiTranslationDlg::restoreSubShapes (SALOMEDS::Study_pt
|
|||||||
anArgs->length(1);
|
anArgs->length(1);
|
||||||
anArgs[0] = myBase;
|
anArgs[0] = myBase;
|
||||||
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
|
getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs,
|
||||||
/*theFindMethod=*/GEOM::FSM_Transformed,
|
/*theFindMethod=*/GEOM::FSM_MultiTransformed,
|
||||||
/*theInheritFirstArg=*/true,
|
/*theInheritFirstArg=*/true,
|
||||||
mainFrame()->CheckBoxAddPrefix->isChecked());
|
mainFrame()->CheckBoxAddPrefix->isChecked());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user