mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
Compare commits
41 Commits
CR670_FixS
...
CR23997_1
Author | SHA1 | Date | |
---|---|---|---|
|
f7baa387b6 | ||
|
c5d477170e | ||
|
200ed75578 | ||
|
9278cd60ac | ||
|
3c4e78f24f | ||
|
68333c8f16 | ||
|
3b1817a9e2 | ||
|
fd03ee4b3b | ||
|
504a896866 | ||
|
191478a581 | ||
|
e92240458e | ||
|
561ea68e96 | ||
|
513d3443c7 | ||
|
e3096decb6 | ||
|
bb0e6b9bcb | ||
|
a3ef6605e0 | ||
|
18d25b93a6 | ||
|
c8ea5b8e3f | ||
|
e89e2d67ba | ||
|
db8e4b9aa6 | ||
|
15cea4ef7a | ||
|
7e7c2f0b6f | ||
|
b3a7aa39a1 | ||
|
96a95605cd | ||
|
b467a87036 | ||
|
5640d65355 | ||
|
6aca4d3977 | ||
|
7eed5d29a9 | ||
|
547702a15d | ||
|
b24ac89262 | ||
|
b7357c8b55 | ||
|
6a866b3268 | ||
|
9c06009aa5 | ||
|
ceaa5e27eb | ||
|
859f26ae84 | ||
|
a24c75d908 | ||
|
12a45e038f | ||
|
c5a855f8b5 | ||
|
b5eb716691 | ||
|
30ecd5f8bf | ||
|
5a07b8e1c4 |
@@ -3,6 +3,7 @@ n NCollection
|
||||
p BSplCLib
|
||||
p BSplSLib
|
||||
p Bnd
|
||||
p BVH
|
||||
p CSLib
|
||||
p Convert
|
||||
p Dico
|
||||
@@ -474,13 +475,11 @@ t TKViewerTest
|
||||
t TKXDEDRAW
|
||||
t TKXSDRAW
|
||||
x DRAWEXE
|
||||
p DebugTools
|
||||
p QADraw
|
||||
p QANCollection
|
||||
p QANewBRepNaming
|
||||
p QANewDBRepNaming
|
||||
p QANewModTopOpe
|
||||
r QAResources
|
||||
t TKQADraw
|
||||
p QADNaming
|
||||
p QABugs
|
||||
|
521
dox/LICENSE.md
Executable file
521
dox/LICENSE.md
Executable file
@@ -0,0 +1,521 @@
|
||||
License {#occt_public_license}
|
||||
=======
|
||||
|
||||
Open CASCADE Technology is available under GNU Lesser General Public License
|
||||
(LGPL) version 2.1 with additional exception.
|
||||
|
||||
@section license_lgpl_21 GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
### Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
- 0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
1. The modified work must itself be a software library.
|
||||
|
||||
2. You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
3. You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
4. If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
1. Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
2. Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
3. Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
4. If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
5. Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
1. Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
2. Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
**NO** **WARRANTY**
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
### END OF TERMS AND CONDITIONS
|
||||
|
||||
### How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
@section occt_lgpl_exception OPEN CASCADE EXCEPTION
|
||||
|
||||
### Open CASCADE Exception (version 1.0) to GNU LGPL version 2.1.
|
||||
|
||||
The object code (i.e. not a source) form of a "work that uses the Library"
|
||||
can incorporate material from a header file that is part of the Library.
|
||||
As a special exception to the GNU Lesser General Public License version 2.1,
|
||||
you may distribute such object code incorporating material from header files
|
||||
provided with the Open CASCADE Technology libraries (including code of CDL
|
||||
generic classes) under terms of your choice, provided that you give
|
||||
prominent notice in supporting documentation to this code that it makes use
|
||||
of or is based on facilities provided by the Open CASCADE Technology software.
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 5.0 KiB |
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@ proc OverviewDoc_DetectCasVersion {theCasRoot} {
|
||||
set fh_loaded [read $fh]
|
||||
close $fh
|
||||
regexp {[^/]\s*#\s*define\s+OCC_VERSION_COMPLETE\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver
|
||||
regexp {^\s*#\s*define\s+OCC_VERSION_DEVELOPMENT\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver_add
|
||||
regexp {[^/]\s*#\s*define\s+OCC_VERSION_DEVELOPMENT\s+\"([^\s]*)\"} $fh_loaded dummy occt_ver_add
|
||||
if { "$occt_ver_add" != "" } { set occt_ver ${occt_ver}.$occt_ver_add }
|
||||
}
|
||||
return $occt_ver
|
||||
|
@@ -406,6 +406,7 @@ The scripts are located in the OCCT root folder.
|
||||
* **CSF_DEBUG** (optional, Windows only): if defined then a diagnostic message is displayed in case of an exception;
|
||||
* **CSF_DEBUG_BOP** (optional): if defined then it should specify directory where diagnostic data on problems occured in Boolean operations will be saved;
|
||||
* **CSF_MDTVTexturesDirectory** defines the directory for available textures when using texture mapping;
|
||||
* **CSF_ShadersDirectory** defines the directory for GLSL programs (required for advanced rendering techniques and custom shaders);
|
||||
* **CSF_UnitsDefinition** and **CSF_UnitsLexicon** should define paths to resource files Lexi_Expr.dat and Units.dat, respectively, required for support of measurement units;
|
||||
* **CSF_SHMessage** is required in order to define the path to the messages file for *ShapeHealing*;
|
||||
* **CSF_XSMessage** is required in order to define the path to the messages file for **STEP** and **IGES** translators;
|
||||
|
@@ -1142,7 +1142,6 @@ Standard_Boolean AIS_Dimension::InitCircularDimension (const TopoDS_Shape& theSh
|
||||
theCircle = aMkCirc.Value()->Circ();
|
||||
}
|
||||
|
||||
gp_Vec aVec = gp_Vec (theCircle.Location(), aCurPos).Normalized();
|
||||
aFirstPoint = ElCLib::Value (aFirstU, theCircle);
|
||||
aLastPoint = ElCLib::Value (aLastU, theCircle);
|
||||
}
|
||||
|
@@ -612,8 +612,6 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
|
||||
AIS::ComputeGeometry( FirstVertex, FirstAttach, Plane, isOnPlane1);
|
||||
AIS::ComputeGeometry( SecondVertex, SecondAttach, Plane, isOnPlane2);
|
||||
|
||||
//Computation of Val
|
||||
Standard_Real Val = FirstAttach.Distance( SecondAttach );
|
||||
Standard_Real confusion(Precision::Confusion());
|
||||
Standard_Boolean samePoint(FirstAttach.IsEqual(SecondAttach,confusion));
|
||||
|
||||
@@ -627,9 +625,6 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr
|
||||
}
|
||||
|
||||
// size
|
||||
Standard_Real arrsize = ArrowSize;
|
||||
if (Abs(Val) <= confusion) arrsize =0.;
|
||||
|
||||
if (AutomaticPos) {
|
||||
if (!samePoint) {
|
||||
gp_Pnt curpos((FirstAttach.XYZ()+SecondAttach.XYZ())*0.5);
|
||||
|
@@ -238,15 +238,14 @@ void AIS_InteractiveContext::DisplayedObjects(AIS_ListOfInteractive& aListOfIO,
|
||||
#endif
|
||||
|
||||
//parse all local contexts...
|
||||
#ifdef DEBUG
|
||||
Standard_Integer NbDisp;
|
||||
for(AIS_DataMapIteratorOfDataMapOfILC it1(myLocalContexts);it1.More();it1.Next()){
|
||||
const Handle(AIS_LocalContext)& LC = it1.Value();
|
||||
NbDisp = LC->DisplayedObjects(theMap);
|
||||
#ifdef DEBUG
|
||||
cout<<"\tIn Local Context "<<it1.Key()<<" : "<<NbDisp<<endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
Handle(AIS_InteractiveObject) curIO;
|
||||
Handle(Standard_Transient) Tr;
|
||||
for(TColStd_MapIteratorOfMapOfTransient it2(theMap);it2.More();it2.Next()){
|
||||
@@ -816,11 +815,11 @@ void AIS_InteractiveContext::Remove(const Handle(AIS_InteractiveObject)& anIObj,
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Boolean WasInCtx = myLocalContexts(myCurLocalIndex)->Remove(anIObj);
|
||||
myLocalContexts(myCurLocalIndex)->Remove(anIObj);
|
||||
AIS_DataMapIteratorOfDataMapOfILC It(myLocalContexts);
|
||||
for (;It.More() ;It.Next()){
|
||||
if(It.Value()->AcceptErase())
|
||||
WasInCtx = It.Value()->Remove(anIObj);
|
||||
It.Value()->Remove(anIObj);
|
||||
|
||||
}
|
||||
// if(!WasInCtx)
|
||||
|
@@ -445,7 +445,6 @@ Standard_Boolean AIS_LocalContext::Remove(const Handle(AIS_InteractiveObject)& a
|
||||
const Handle(AIS_LocalStatus)& Att = myActiveObjects(aSelectable);
|
||||
|
||||
TColStd_ListIteratorOfListOfInteger It;
|
||||
Standard_Boolean jobdone(Standard_False);
|
||||
// it is checked which were the temporary attributes
|
||||
// and they are set to 0
|
||||
|
||||
@@ -468,7 +467,6 @@ Standard_Boolean AIS_LocalContext::Remove(const Handle(AIS_InteractiveObject)& a
|
||||
if(myMainPM->IsDisplayed(aSelectable,Att->HilightMode()))
|
||||
myMainPM->Erase(aSelectable,Att->HilightMode());
|
||||
// myMainPM->Clear(aSelectable,Att->HilightMode());
|
||||
jobdone = Standard_True;
|
||||
}
|
||||
// if below intensity
|
||||
else
|
||||
|
@@ -218,7 +218,6 @@ is
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
NbSamples(me) returns Integer from Standard is virtual;
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom2d
|
||||
raises
|
||||
|
@@ -373,12 +373,5 @@ Handle(Geom2d_BSplineCurve) Adaptor2d_Curve2d::BSpline() const
|
||||
return Handle(Geom2d_BSplineCurve)();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbSamples
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer Adaptor2d_Curve2d::NbSamples() const
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -549,7 +549,6 @@ static void Locate2Coord(const Standard_Integer Index,
|
||||
{
|
||||
Standard_Real Tol=Precision::PConfusion()/10;
|
||||
Standard_Real Comp1=0,DComp1=0;
|
||||
Standard_Boolean DIsNull = Standard_False;
|
||||
if(Index==1) { Comp1=UV.X();
|
||||
DComp1=DUV.X();}
|
||||
else
|
||||
@@ -576,10 +575,9 @@ static void Locate2Coord(const Standard_Integer Index,
|
||||
if(Index==2) { LeftBot.SetY(I1);
|
||||
RightTop.SetY(I2);}
|
||||
}
|
||||
DIsNull=Standard_False;
|
||||
}
|
||||
else
|
||||
if(Abs(DComp1)<=Tol) { DIsNull = Standard_True;
|
||||
if(Abs(DComp1)<=Tol) {
|
||||
if(Index==1) { LeftBot.SetX(I1) ;
|
||||
RightTop.SetX(I2);}
|
||||
if(Index==2) { LeftBot.SetY(I1) ;
|
||||
|
@@ -435,7 +435,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
|
||||
const AdvApp2Var_EvaluatorFunc2Var& Func,
|
||||
const AdvApp2Var_Criterion& Crit)
|
||||
{
|
||||
Standard_Real Udec, Vdec, CritValue, m0=0., m1=0.;
|
||||
Standard_Real Udec, Vdec, CritValue, m1=0.;
|
||||
Standard_Boolean Umore, Vmore, CritAbs = (Crit.Type() == AdvApp2Var_Absolute);
|
||||
Standard_Integer NbPatch, NbU, NbV, NbInt, NumDec;
|
||||
Standard_Integer FirstNA, decision=0;
|
||||
@@ -445,7 +445,6 @@ void AdvApp2Var_ApproxAFunc2Var::ComputePatches(const AdvApprox_Cutting& UChoice
|
||||
// complete the set of constraints
|
||||
ComputeConstraints(UChoice, VChoice, Func, Crit);
|
||||
if (decision>0) {
|
||||
m0 = m1;
|
||||
m1 = 0.;
|
||||
}
|
||||
|
||||
|
@@ -1326,7 +1326,7 @@ int mma1jak_(integer *ndimen,
|
||||
{
|
||||
/* System generated locals */
|
||||
integer somtab_dim1, somtab_offset, diftab_dim1, diftab_offset,
|
||||
crvjac_dim1, crvjac_offset, cgauss_dim1;
|
||||
crvjac_dim1, crvjac_offset;
|
||||
|
||||
/* Local variables */
|
||||
integer ibb;
|
||||
@@ -1389,7 +1389,6 @@ int mma1jak_(integer *ndimen,
|
||||
crvjac_dim1 = *ndgjac + 1;
|
||||
crvjac_offset = crvjac_dim1;
|
||||
crvjac -= crvjac_offset;
|
||||
cgauss_dim1 = *nbroot / 2 + 1;
|
||||
|
||||
/* Function Body */
|
||||
ibb = AdvApp2Var_SysBase::mnfndeb_();
|
||||
|
@@ -7098,10 +7098,6 @@ int mmpojac_(doublereal *tparam,
|
||||
{
|
||||
integer c__2 = 2;
|
||||
|
||||
/* Initialized data */
|
||||
|
||||
integer nbcof = -1;
|
||||
|
||||
/* System generated locals */
|
||||
integer valjac_dim1, i__1, i__2;
|
||||
|
||||
@@ -7213,8 +7209,6 @@ int mmpojac_(doublereal *tparam,
|
||||
c__2, &i__2));
|
||||
}
|
||||
|
||||
nbcof = *ncoeff;
|
||||
|
||||
/* END IF */
|
||||
|
||||
/* --- Trivial Positions ----- */
|
||||
@@ -9885,7 +9879,6 @@ L9999:
|
||||
logical colin;
|
||||
doublereal valaux;
|
||||
integer aux;
|
||||
logical nul;
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@@ -9953,7 +9946,6 @@ L9999:
|
||||
if (*ndimen <= 1 || *ndimen > 3) {
|
||||
goto L9101;
|
||||
}
|
||||
nul = FALSE_;
|
||||
d__ = 1;
|
||||
aux = 0;
|
||||
while(d__ <= *ndimen) {
|
||||
|
@@ -109,11 +109,9 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions,
|
||||
{
|
||||
|
||||
// data stored in the Context
|
||||
Standard_Integer NDIMEN, NBSESP, NDIMSE, ISOFAV;
|
||||
Standard_Integer NDIMEN, ISOFAV;
|
||||
NDIMEN = Conditions.TotalDimension();
|
||||
NBSESP = Conditions.TotalNumberSSP();
|
||||
// Attention : works only for 3D
|
||||
NDIMSE = 3;
|
||||
ISOFAV = Conditions.FavorIso();
|
||||
|
||||
// data related to the patch to be discretized
|
||||
@@ -404,12 +402,10 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions,
|
||||
const AdvApp2Var_Framework& Constraints)
|
||||
{
|
||||
// data stored in the Context
|
||||
Standard_Integer NDIMEN, NBSESP, NDIMSE;
|
||||
Standard_Integer NDIMEN;
|
||||
Standard_Integer IERCOD, NCFLMU, NCFLMV, NDegU, NDegV;
|
||||
NDIMEN = Conditions.TotalDimension();
|
||||
NBSESP = Conditions.TotalNumberSSP();
|
||||
// Attention : works only for 3D
|
||||
NDIMSE = 3;
|
||||
NCFLMU = Conditions.ULimit();
|
||||
NCFLMV = Conditions.VLimit();
|
||||
NDegU = NCFLMU - 1;
|
||||
|
@@ -107,12 +107,12 @@ int mcrcomm_(integer *kop,
|
||||
|
||||
static
|
||||
int mcrfree_(integer *ibyte,
|
||||
void* *iadr,
|
||||
intptr_t iadr,
|
||||
integer *ier);
|
||||
|
||||
static
|
||||
int mcrgetv_(integer *sz,
|
||||
void* *iad,
|
||||
intptr_t *iad,
|
||||
integer *ier);
|
||||
|
||||
static
|
||||
@@ -155,9 +155,6 @@ int AdvApp2Var_SysBase::macinit_(integer *imode,
|
||||
|
||||
{
|
||||
|
||||
/* Fortran I/O blocks */
|
||||
cilist io______1 = { 0, 0, 0, (char*) "(' --- Debug-mode : ',I10,' ---')", 0 };
|
||||
|
||||
/* ************************************************************************/
|
||||
/* FUNCTION : */
|
||||
/* ---------- */
|
||||
@@ -217,14 +214,6 @@ int AdvApp2Var_SysBase::macinit_(integer *imode,
|
||||
mblank__.imp = *ival;
|
||||
} else if (*imode == 2) {
|
||||
mblank__.ibb = *ival;
|
||||
io______1.ciunit = mblank__.imp;
|
||||
/*
|
||||
s__wsfe(&io______1);
|
||||
*/
|
||||
/*
|
||||
do__fio(&c____1, (char *)&mblank__.ibb, (ftnlen)sizeof(integer));
|
||||
*/
|
||||
AdvApp2Var_SysBase::e__wsfe();
|
||||
} else if (*imode == 3) {
|
||||
mblank__.lec = *ival;
|
||||
}
|
||||
@@ -670,7 +659,7 @@ int macrerr_(intptr_t *,//iad,
|
||||
{
|
||||
//integer c__1 = 1;
|
||||
/* Builtin functions */
|
||||
//integer /*s__wsfe(),*/ /*do__fio(),*/ e__wsfe();
|
||||
//integer /*do__fio(),*/;
|
||||
|
||||
/* Fortran I/O blocks */
|
||||
//cilist io___1 = { 0, 6, 0, "(X,A,I9,A,I3)", 0 };
|
||||
@@ -705,9 +694,6 @@ int macrerr_(intptr_t *,//iad,
|
||||
/* ----------------------------------- */
|
||||
/* > */
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
/*
|
||||
s__wsfe(&io___1);
|
||||
*/
|
||||
/*
|
||||
do__fio(&c__1, "*** ERREUR : Ecrasement de la memoire d'adresse ", 48L);
|
||||
@@ -715,7 +701,6 @@ int macrerr_(intptr_t *,//iad,
|
||||
do__fio(&c__1, " sur l'allocation ", 18L);
|
||||
do__fio(&c__1, (char *)&(*nalloc), (ftnlen)sizeof(integer));
|
||||
*/
|
||||
AdvApp2Var_SysBase::e__wsfe();
|
||||
|
||||
return 0 ;
|
||||
} /* macrerr_ */
|
||||
@@ -744,7 +729,7 @@ int macrgfl_(intptr_t *iadfld,
|
||||
integer ibid, ienr;
|
||||
doublereal* t = 0;
|
||||
integer novfl = 0;
|
||||
intptr_t ioff,iadrfl, iadt;
|
||||
intptr_t ioff,iadt;
|
||||
|
||||
|
||||
/* ***********************************************************************
|
||||
@@ -855,7 +840,6 @@ int macrgfl_(intptr_t *iadfld,
|
||||
t[ioff] = -134744073.;
|
||||
|
||||
/* FAKE CALL TO STOP THE DEBUGGER : */
|
||||
iadrfl = *iadfld;
|
||||
macrbrk_();
|
||||
|
||||
/* UPDATE THE START FLAG */
|
||||
@@ -863,7 +847,6 @@ int macrgfl_(intptr_t *iadfld,
|
||||
t[ioff] = -134744073.;
|
||||
|
||||
/* FAKE CALL TO STOP THE DEBUGGER : */
|
||||
iadrfl = *iadflf;
|
||||
macrbrk_();
|
||||
|
||||
return 0 ;
|
||||
@@ -884,14 +867,8 @@ int macrmsg_(const char *,//crout,
|
||||
{
|
||||
|
||||
/* Local variables */
|
||||
integer inum, iunite;
|
||||
char cfm[80], cln[3];
|
||||
|
||||
/* Fortran I/O blocks */
|
||||
cilist io___5 = { 0, 0, 0, cfm, 0 };
|
||||
cilist io___6 = { 0, 0, 0, cfm, 0 };
|
||||
cilist io___7 = { 0, 0, 0, cfm, 0 };
|
||||
|
||||
integer inum;
|
||||
char /*cfm[80],*/ cln[3];
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
@@ -1127,33 +1104,17 @@ t !! ')", 80L, 54L);
|
||||
*/
|
||||
/* iMPLEMENTATION OF WRITE , WITH OR WITHOUT DATA : */
|
||||
|
||||
iunite = AdvApp2Var_SysBase::mnfnimp_();
|
||||
if (inum == 0) {
|
||||
io___5.ciunit = iunite;
|
||||
/*
|
||||
s__wsfe(&io___5);
|
||||
*/
|
||||
AdvApp2Var_SysBase::e__wsfe();
|
||||
} else if (inum == 1) {
|
||||
io___6.ciunit = iunite;
|
||||
/*
|
||||
s__wsfe(&io___6);
|
||||
*/
|
||||
/*
|
||||
do__fio(&c__1, (char *)&it[1], (ftnlen)sizeof(integer));
|
||||
*/
|
||||
AdvApp2Var_SysBase::e__wsfe();
|
||||
} else {
|
||||
/* MESSAGE DOES NOT EXIST ... */
|
||||
io___7.ciunit = iunite;
|
||||
/*
|
||||
s__wsfe(&io___7);
|
||||
*/
|
||||
/*
|
||||
do__fio(&c__1, (char *)&(*num), (ftnlen)sizeof(integer));
|
||||
do__fio(&c__1, crout, crout_len);
|
||||
*/
|
||||
AdvApp2Var_SysBase::e__wsfe();
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2351,7 +2312,7 @@ L1100:
|
||||
}
|
||||
} else {
|
||||
/* DE-ALLOCATION SYSTEM */
|
||||
mcrfree_(&ibyte, reinterpret_cast<void**> (&iaddr), &ier);
|
||||
mcrfree_(&ibyte, iaddr, &ier);
|
||||
if (ier != 0) {
|
||||
goto L9002;
|
||||
}
|
||||
@@ -2510,14 +2471,12 @@ int AdvApp2Var_SysBase::mcrfill_(integer *size,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int mcrfree_(integer *,//ibyte,
|
||||
void* *iadr,
|
||||
intptr_t iadr,
|
||||
integer *ier)
|
||||
|
||||
{
|
||||
*ier=0;
|
||||
Standard::Free(*iadr);
|
||||
//Standard::Free always nullifies address, so check becomes incorrect
|
||||
//if ( !*iadr ) *ier = 1;
|
||||
Standard::Free((void*)iadr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2553,13 +2512,13 @@ int mcrfree_(integer *,//ibyte,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int mcrgetv_(integer *sz,
|
||||
void* *iad,
|
||||
intptr_t *iad,
|
||||
integer *ier)
|
||||
|
||||
{
|
||||
|
||||
*ier = 0;
|
||||
*iad = Standard::Allocate(*sz);
|
||||
*iad = (intptr_t)Standard::Allocate(*sz);
|
||||
if ( !*iad ) *ier = 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -2740,7 +2699,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
doublereal dfmt;
|
||||
integer ifmt, iver;
|
||||
char subr[7];
|
||||
integer ksys , ibyte, irest, isyst, ier;
|
||||
integer ksys , ibyte, irest, ier;
|
||||
intptr_t iadfd, iadff, iaddr,lofset, loc;
|
||||
integer izu;
|
||||
|
||||
@@ -2912,15 +2871,11 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
if (iver == 1) {
|
||||
|
||||
if (ibyte == 0) {
|
||||
//s__wsle(&io___3);
|
||||
//do__lio(&c__9, &c__1, "Require zero allocation", 26L);
|
||||
AdvApp2Var_SysBase::e__wsle();
|
||||
maostrb_();
|
||||
} else if (ibyte >= 4096000) {
|
||||
//s__wsle(&io___4);
|
||||
//do__lio(&c__9, &c__1, "Require allocation above 4 Mega-Octets : ", 50L);
|
||||
//do__lio(&c__3, &c__1, (char *)&ibyte, (ftnlen)sizeof(integer));
|
||||
AdvApp2Var_SysBase::e__wsle();
|
||||
maostrb_();
|
||||
}
|
||||
|
||||
@@ -2949,7 +2904,6 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
|
||||
/* DEMAND OF ALLOCATION */
|
||||
|
||||
isyst = 0;
|
||||
/* L1001: */
|
||||
/* IF ( ISYST.EQ.0.AND.IBYTE .LE. 100 * 1024 ) THEN */
|
||||
/* ALLOCATION SUR TABLE */
|
||||
@@ -2963,7 +2917,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
|
||||
/* ELSE */
|
||||
/* ALLOCATION SYSTEME */
|
||||
ksys = heap_allocation;
|
||||
mcrgetv_(&ibyte, reinterpret_cast<void**> (&iaddr), &ier);
|
||||
mcrgetv_(&ibyte, &iaddr, &ier);
|
||||
if (ier != 0) {
|
||||
goto L9003;
|
||||
}
|
||||
@@ -3131,8 +3085,6 @@ void AdvApp2Var_SysBase::miraz_(integer *taille,
|
||||
void *adt)
|
||||
|
||||
{
|
||||
integer offset;
|
||||
offset = *taille;
|
||||
memset(adt , '\0' , *taille) ;
|
||||
}
|
||||
//=======================================================================
|
||||
@@ -3146,17 +3098,6 @@ integer AdvApp2Var_SysBase::mnfndeb_()
|
||||
return ret_val;
|
||||
} /* mnfndeb_ */
|
||||
|
||||
//=======================================================================
|
||||
//function : AdvApp2Var_SysBase::mnfnimp_
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
integer AdvApp2Var_SysBase::mnfnimp_()
|
||||
{
|
||||
integer ret_val;
|
||||
ret_val = 6;
|
||||
return ret_val;
|
||||
} /* mnfnimp_ */
|
||||
|
||||
//=======================================================================
|
||||
//function : AdvApp2Var_SysBase::msifill_
|
||||
//purpose :
|
||||
@@ -3277,9 +3218,6 @@ int AdvApp2Var_SysBase::mswrdbg_(const char *,//ctexte,
|
||||
|
||||
{
|
||||
|
||||
cilist io___1 = { 0, 0, 0, 0, 0 };
|
||||
|
||||
|
||||
/* ***********************************************************************
|
||||
*/
|
||||
|
||||
@@ -3324,11 +3262,8 @@ int AdvApp2Var_SysBase::mswrdbg_(const char *,//ctexte,
|
||||
*/
|
||||
|
||||
if (AdvApp2Var_SysBase::mnfndeb_() >= 1) {
|
||||
io___1.ciunit = AdvApp2Var_SysBase::mnfnimp_();
|
||||
//s__wsle(&io___1);
|
||||
//do__lio(&c__9, &c__1, "Dbg ", 4L);
|
||||
//do__lio(&c__9, &c__1, ctexte, ctexte_len);
|
||||
AdvApp2Var_SysBase::e__wsle();
|
||||
}
|
||||
return 0 ;
|
||||
} /* mswrdbg_ */
|
||||
@@ -3361,39 +3296,6 @@ int AdvApp2Var_SysBase::do__lio ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : e__wsfe
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int AdvApp2Var_SysBase::e__wsfe ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : e__wsle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int AdvApp2Var_SysBase::e__wsle ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : s__wsfe
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int AdvApp2Var_SysBase::s__wsfe ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : s__wsle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int AdvApp2Var_SysBase::s__wsle ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
C*****************************************************************************
|
||||
|
@@ -51,13 +51,8 @@ class AdvApp2Var_SysBase {
|
||||
integer *iercod);
|
||||
Standard_EXPORT static integer mnfndeb_();
|
||||
|
||||
Standard_EXPORT static integer mnfnimp_();
|
||||
Standard_EXPORT static int do__fio();
|
||||
Standard_EXPORT static int do__lio ();
|
||||
Standard_EXPORT static int e__wsfe ();
|
||||
Standard_EXPORT static int e__wsle ();
|
||||
Standard_EXPORT static int s__wsfe ();
|
||||
Standard_EXPORT static int s__wsle ();
|
||||
Standard_EXPORT int macrai4_(integer *nbelem,
|
||||
integer *maxelm,
|
||||
integer *itablo,
|
||||
|
@@ -104,8 +104,8 @@ void AppParCurves::SecondDerivativeBernstein(const Standard_Real U,
|
||||
// Standard_Real U1 = 1-U, Y0, Y1, Xs;
|
||||
Standard_Real Y0, Y1, Xs;
|
||||
Standard_Integer NbPoles = DDA.Length();
|
||||
Standard_Integer id, j, N2, N3, N4, deg = NbPoles-1;
|
||||
N2 = deg-1; N3 = deg-2, N4 = deg*(deg-1);
|
||||
Standard_Integer id, j, N4, deg = NbPoles-1;
|
||||
N4 = deg*(deg-1);
|
||||
math_Vector B(1, deg-1);
|
||||
B(1) = 1.;
|
||||
|
||||
|
@@ -430,7 +430,7 @@ void AppParCurves_LeastSquare::Perform(const math_Vector& Parameters) {
|
||||
if (!isready) {
|
||||
return;
|
||||
}
|
||||
Standard_Integer i, j, k, Ci, Nincx, Neq, i2, k1, k2;
|
||||
Standard_Integer i, j, k, Ci, Nincx, i2, k1, k2;
|
||||
Standard_Integer nbpol1 = nbpoles-1, Ninc1 = Ninc-1;
|
||||
Standard_Real AD1, A0;
|
||||
// gp_Pnt Pt;
|
||||
@@ -499,7 +499,7 @@ void AppParCurves_LeastSquare::Perform(const math_Vector& Parameters) {
|
||||
math_Vector myTABB(1, Nincx, 0.0);
|
||||
|
||||
MakeTAA(TheAA, mytab);
|
||||
Standard_Integer Error = DACTCL_Decompose(TheAA, Index);
|
||||
DACTCL_Decompose(TheAA, Index);
|
||||
|
||||
Standard_Integer kk2;
|
||||
for (j = 1; j <= B2.ColNumber(); j++) {
|
||||
@@ -508,7 +508,7 @@ void AppParCurves_LeastSquare::Perform(const math_Vector& Parameters) {
|
||||
myTABB(kk2) = mytab(i, j);
|
||||
kk2++;
|
||||
}
|
||||
Error = DACTCL_Solve(TheAA, myTABB, Index);
|
||||
DACTCL_Solve(TheAA, myTABB, Index);
|
||||
|
||||
i2 = 1;
|
||||
for (k = resinit; k <= resfin; k++) {
|
||||
@@ -524,7 +524,6 @@ void AppParCurves_LeastSquare::Perform(const math_Vector& Parameters) {
|
||||
// ===========================================================
|
||||
|
||||
Nincx = resfin-resinit+1;
|
||||
Neq = LastP-FirstP+1;
|
||||
Standard_Integer deport = 0, Nincx2 = 2*Nincx;
|
||||
|
||||
math_IntegerVector InternalIndex(1, Nincx);
|
||||
@@ -868,7 +867,7 @@ void AppParCurves_LeastSquare::Perform(const math_Vector& Parameters,
|
||||
|
||||
math_Vector myTABB(1, Nincx, 0.0);
|
||||
|
||||
Standard_Integer Error = DACTCL_Decompose(AA, Index);
|
||||
DACTCL_Decompose(AA, Index);
|
||||
|
||||
Standard_Integer kk2;
|
||||
for (j = 1; j <= B2.ColNumber(); j++) {
|
||||
@@ -878,7 +877,7 @@ void AppParCurves_LeastSquare::Perform(const math_Vector& Parameters,
|
||||
kk2++;
|
||||
}
|
||||
|
||||
Error = DACTCL_Solve(AA, myTABB, Index);
|
||||
DACTCL_Solve(AA, myTABB, Index);
|
||||
|
||||
i2 = 1;
|
||||
for (k = resinit; k <= resfin; k++) {
|
||||
@@ -992,7 +991,6 @@ void AppParCurves_LeastSquare::Error(Standard_Real& F,
|
||||
F = 0.0;
|
||||
i2 = 1;
|
||||
math_Vector Px(1, nbpoles), Py(1, nbpoles), Pz(1, nbpoles);
|
||||
Standard_Integer l;
|
||||
|
||||
for (k = 1 ; k <= nbP+nbP2d; k++) {
|
||||
i21 = i2+1; i22 = i2+2;
|
||||
@@ -1005,7 +1003,6 @@ void AppParCurves_LeastSquare::Error(Standard_Real& F,
|
||||
AA = 0.0; BB = 0.0; CC = 0.0;
|
||||
indexdeb = myindex(i) + 1;
|
||||
indexfin = indexdeb + deg;
|
||||
l = (i-1)*(deg+1)-indexdeb+1;
|
||||
for (j = indexdeb; j <= indexfin; j++) {
|
||||
AIJ = A(i, j);
|
||||
AA += AIJ*Px(j);
|
||||
|
@@ -161,7 +161,7 @@ AppParCurves_ResolConstraint::
|
||||
for (i = 1; i <= IncTan; i++) {
|
||||
Npt = ITan(i);
|
||||
// choix du maximum de tangence pour exprimer la colinearite:
|
||||
Ok = ToolLine::Tangency(SSP, Npt, tabV);
|
||||
ToolLine::Tangency(SSP, Npt, tabV);
|
||||
V = tabV(k);
|
||||
V.Coord(T1, T2, T3);
|
||||
Tmax = Abs(T1);
|
||||
@@ -228,7 +228,7 @@ AppParCurves_ResolConstraint::
|
||||
else {
|
||||
for (i = 1; i <= IncTan; i++) {
|
||||
Npt = ITan(i);
|
||||
Ok = ToolLine::Tangency(SSP, Npt, tabV2d);
|
||||
ToolLine::Tangency(SSP, Npt, tabV2d);
|
||||
V2d = tabV2d(k-nb3d);
|
||||
T1 = V2d.X();
|
||||
T2 = V2d.Y();
|
||||
@@ -730,7 +730,7 @@ const math_Matrix& AppParCurves_ResolConstraint::
|
||||
IncCol = IncCol + IP;
|
||||
}
|
||||
else if (Ibont(k+1,i) == 3) { // Relations entre T1x et T2z:
|
||||
Ok = ToolLine::Tangency(SSP, Npt, tabV);
|
||||
ToolLine::Tangency(SSP, Npt, tabV);
|
||||
V = tabV(k+1);
|
||||
T2 = V.Z();
|
||||
for (j = 1; j <= Npol; j++) {
|
||||
@@ -793,7 +793,7 @@ const math_Matrix& AppParCurves_ResolConstraint::
|
||||
|
||||
}
|
||||
else if (Ibont(k+1,i)== 3) { // Relations entre T1y et T2z:
|
||||
Ok = ToolLine::Tangency(SSP, Npt, tabV);
|
||||
ToolLine::Tangency(SSP, Npt, tabV);
|
||||
V = tabV(k+1);
|
||||
T2 = V.Z();
|
||||
for (j = 1; j <= Npol; j++) {
|
||||
@@ -849,7 +849,7 @@ const math_Matrix& AppParCurves_ResolConstraint::
|
||||
}
|
||||
|
||||
else if (Ibont(k+1,i)==3) { // Relations entre T1z et T2z:
|
||||
Ok = ToolLine::Tangency(SSP, Npt, tabV);
|
||||
ToolLine::Tangency(SSP, Npt, tabV);
|
||||
V = tabV(k+1);
|
||||
T2 = V.Z();
|
||||
for (j = 1; j <= Npol; j++) {
|
||||
|
@@ -618,7 +618,6 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
|
||||
// ========================================
|
||||
GoUp = Standard_False;
|
||||
Ok = Standard_True;
|
||||
Standard_Boolean FailOnPointsAdded = Standard_False;
|
||||
if (MyStatus == Approx_PointsAdded) {
|
||||
// Appel recursif du decoupage:
|
||||
GoUp = Standard_True;
|
||||
@@ -632,7 +631,6 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
|
||||
//-- Si MakeML a echoue on retourne une ligne vide
|
||||
if ((nbpdsotherligne == 0) || myMultiLineNb >= 3)
|
||||
{
|
||||
FailOnPointsAdded = Standard_True;
|
||||
//-- cout<<" ** ApproxComputeLine MakeML Echec ** LBR lbr "<<endl;
|
||||
if (myfirstpt == mylastpt) break; // Pour etre sur de ne pas
|
||||
// planter la station !!
|
||||
@@ -828,11 +826,10 @@ void Approx_ComputeLine::Parameters(const MultiLine& Line,
|
||||
const Standard_Integer lastP,
|
||||
math_Vector& TheParameters) const
|
||||
{
|
||||
Standard_Integer i, j, Nbp, nbP2d, nbP3d;
|
||||
Standard_Integer i, j, nbP2d, nbP3d;
|
||||
Standard_Real dist;
|
||||
gp_Pnt P1, P2;
|
||||
gp_Pnt2d P12d, P22d;
|
||||
Nbp = lastP-firstP+1;
|
||||
|
||||
if (Par == Approx_ChordLength || Par == Approx_Centripetal) {
|
||||
nbP3d = LineTool::NbP3d(Line);
|
||||
@@ -994,12 +991,12 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
|
||||
gp_Vec2d V12d, V22d;
|
||||
gp_Pnt P1, P2;
|
||||
gp_Pnt2d P12d, P22d;
|
||||
Standard_Boolean Tangent1, Tangent2, Parallel, mydone= Standard_False;
|
||||
Standard_Boolean Tangent1, Tangent2, mydone= Standard_False;
|
||||
#ifdef DEB
|
||||
Standard_Boolean Parallel;
|
||||
#endif
|
||||
Standard_Integer myfirstpt = firstpt, mylastpt = lastpt;
|
||||
Standard_Integer nbp = lastpt-firstpt+1, Kopt = 0;
|
||||
AppParCurves_Constraint FirstC, LastC;
|
||||
FirstC = AppParCurves_PassPoint;
|
||||
LastC = AppParCurves_PassPoint;
|
||||
math_Vector Para(firstpt, lastpt);
|
||||
|
||||
Parameters(Line, firstpt, lastpt, Para);
|
||||
@@ -1042,13 +1039,17 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
|
||||
if (nbp == 2) {
|
||||
// S il n y a que 2 points, on verifie quand meme que les tangentes sont
|
||||
// alignees.
|
||||
#ifdef DEB
|
||||
Parallel = Standard_True;
|
||||
#endif
|
||||
if (Tangent1) {
|
||||
for (i = 1; i <= nbP3d; i++) {
|
||||
gp_Vec PVec(tabP1(i), tabP2(i));
|
||||
V13d = tabV1(i);
|
||||
if (!PVec.IsParallel(V13d, Precision::Angular())) {
|
||||
#ifdef DEB
|
||||
Parallel = Standard_False;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1056,7 +1057,9 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
|
||||
gp_Vec2d PVec2d(tabP12d(i), tabP22d(i));
|
||||
V12d = tabV12d(i);
|
||||
if (!PVec2d.IsParallel(V12d, Precision::Angular())) {
|
||||
#ifdef DEB
|
||||
Parallel = Standard_False;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1067,7 +1070,9 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
|
||||
gp_Vec PVec(tabP1(i), tabP2(i));
|
||||
V23d = tabV2(i);
|
||||
if (!PVec.IsParallel(V23d, Precision::Angular())) {
|
||||
#ifdef DEB
|
||||
Parallel = Standard_False;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1075,7 +1080,9 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
|
||||
gp_Vec2d PVec2d(tabP12d(i), tabP22d(i));
|
||||
V22d = tabV22d(i);
|
||||
if (!PVec2d.IsParallel(V22d, Precision::Angular())) {
|
||||
#ifdef DEB
|
||||
Parallel = Standard_False;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -432,7 +432,6 @@ void Aspect_ColorScale::DrawScale( const Quantity_Color& aBgColor,
|
||||
|
||||
TCollection_ExtendedString aTitle = GetTitle();
|
||||
|
||||
Standard_Integer titleWidth = 0;
|
||||
Standard_Integer titleHeight = 0;
|
||||
|
||||
Standard_Integer aGray = (Standard_Integer)(255 * ( aBgColor.Red() * 11 + aBgColor.Green() * 16 + aBgColor.Blue() * 5 ) / 32);
|
||||
@@ -440,7 +439,6 @@ void Aspect_ColorScale::DrawScale( const Quantity_Color& aBgColor,
|
||||
|
||||
// Draw title
|
||||
if ( aTitle.Length() ) {
|
||||
titleWidth = TextWidth( aTitle );
|
||||
titleHeight = TextHeight( aTitle ) + 2 * spacer;
|
||||
PaintText( aTitle, X + spacer, Y + spacer, aFgColor );
|
||||
}
|
||||
|
@@ -74,7 +74,6 @@ is
|
||||
class CheckerSI;
|
||||
class ArgumentAnalyzer;
|
||||
class CheckResult;
|
||||
class ShellSplitter;
|
||||
--
|
||||
-- pointers
|
||||
--
|
||||
|
@@ -50,9 +50,19 @@ is
|
||||
returns BaseAllocator from BOPCol;
|
||||
---C++: return const &
|
||||
|
||||
SetRunParallel(me:out;
|
||||
theFlag:Boolean from Standard);
|
||||
---Purpose: Set the flag of parallel processing
|
||||
-- if <theFlag> is true the parallel processing is switched on
|
||||
-- if <theFlag> is false the parallel processing is switched off
|
||||
--
|
||||
RunParallel(me)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns the flag of parallel processing
|
||||
|
||||
fields
|
||||
myAllocator : BaseAllocator from BOPCol is protected;
|
||||
myErrorStatus : Integer from Standard is protected;
|
||||
myWarningStatus : Integer from Standard is protected;
|
||||
|
||||
myRunParallel : Boolean from Standard is protected;
|
||||
end Algo;
|
||||
|
@@ -23,35 +23,38 @@
|
||||
// function:
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
BOPAlgo_Algo::BOPAlgo_Algo()
|
||||
BOPAlgo_Algo::BOPAlgo_Algo()
|
||||
:
|
||||
myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()),
|
||||
myErrorStatus(1),
|
||||
myWarningStatus(0)
|
||||
myWarningStatus(0),
|
||||
myRunParallel(Standard_False)
|
||||
{}
|
||||
//=======================================================================
|
||||
// function:
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
BOPAlgo_Algo::BOPAlgo_Algo(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
BOPAlgo_Algo::BOPAlgo_Algo
|
||||
(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
:
|
||||
myAllocator(theAllocator),
|
||||
myErrorStatus(1),
|
||||
myWarningStatus(0)
|
||||
myWarningStatus(0),
|
||||
myRunParallel(Standard_False)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
// function: ~
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
BOPAlgo_Algo::~BOPAlgo_Algo()
|
||||
BOPAlgo_Algo::~BOPAlgo_Algo()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Allocator
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const Handle(NCollection_BaseAllocator)& BOPAlgo_Algo::Allocator()const
|
||||
const Handle(NCollection_BaseAllocator)& BOPAlgo_Algo::Allocator()const
|
||||
{
|
||||
return myAllocator;
|
||||
}
|
||||
@@ -59,7 +62,7 @@
|
||||
// function: CheckData
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPAlgo_Algo::CheckData()
|
||||
void BOPAlgo_Algo::CheckData()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
}
|
||||
@@ -67,7 +70,7 @@
|
||||
// function: CheckResult
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPAlgo_Algo::CheckResult()
|
||||
void BOPAlgo_Algo::CheckResult()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
}
|
||||
@@ -75,7 +78,7 @@
|
||||
// function: ErrorStatus
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer BOPAlgo_Algo::ErrorStatus()const
|
||||
Standard_Integer BOPAlgo_Algo::ErrorStatus()const
|
||||
{
|
||||
return myErrorStatus;
|
||||
}
|
||||
@@ -83,10 +86,26 @@
|
||||
// function: WarningStatus
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer BOPAlgo_Algo::WarningStatus()const
|
||||
Standard_Integer BOPAlgo_Algo::WarningStatus()const
|
||||
{
|
||||
return myWarningStatus;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetRunParallel
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Algo::SetRunParallel(const Standard_Boolean theFlag)
|
||||
{
|
||||
myRunParallel=theFlag;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : RunParallel
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPAlgo_Algo::RunParallel()const
|
||||
{
|
||||
return myRunParallel;
|
||||
}
|
||||
// myErrorStatus
|
||||
//
|
||||
// 1 - object is just initialized
|
||||
|
@@ -296,21 +296,21 @@ void BOPAlgo_ArgumentAnalyzer::TestTypes()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================================
|
||||
// function: TestSelfInterferences
|
||||
// purpose:
|
||||
// ================================================================================
|
||||
//=======================================================================
|
||||
//function : TestSelfInterferences
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
||||
{
|
||||
Standard_Integer ii = 0, j;
|
||||
Standard_Integer ii=0, j;
|
||||
Standard_Boolean bSelfInt;
|
||||
|
||||
for(ii = 0; ii < 2; ii++) {
|
||||
const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2;
|
||||
|
||||
if(aS.IsNull())
|
||||
if(aS.IsNull()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Standard_Boolean bIsEmpty = (ii == 0) ? myEmpty1 : myEmpty2;
|
||||
if (bIsEmpty) {
|
||||
@@ -319,6 +319,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
||||
|
||||
BOPAlgo_CheckerSI aChecker;
|
||||
BOPCol_ListOfShape anArgs;
|
||||
//
|
||||
anArgs.Append(aS);
|
||||
aChecker.SetArguments(anArgs);
|
||||
//
|
||||
@@ -332,20 +333,57 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
||||
BOPDS_VectorOfInterfVF& aVFs=theDS->InterfVF();
|
||||
BOPDS_VectorOfInterfEF& aEFs=theDS->InterfEF();
|
||||
BOPDS_VectorOfInterfFF& aFFs=theDS->InterfFF();
|
||||
BOPDS_VectorOfInterfVZ& aVZs=theDS->InterfVZ();
|
||||
BOPDS_VectorOfInterfEZ& aEZs=theDS->InterfEZ();
|
||||
BOPDS_VectorOfInterfFZ& aFZs=theDS->InterfFZ();
|
||||
BOPDS_VectorOfInterfZZ& aZZs=theDS->InterfZZ();
|
||||
//
|
||||
Standard_Integer aNb[6] = {aVVs.Extent(), aVEs.Extent(), aEEs.Extent(),
|
||||
aVFs.Extent(), aEFs.Extent(), aFFs.Extent()};
|
||||
const Standard_Integer aNbTypeInt=10;
|
||||
Standard_Integer aTypeInt, i, nI1, nI2;
|
||||
Standard_Integer aNb[aNbTypeInt] = {
|
||||
aVVs.Extent(), aVEs.Extent(), aEEs.Extent(),
|
||||
aVFs.Extent(), aEFs.Extent(), aFFs.Extent(),
|
||||
aVZs.Extent(), aEZs.Extent(), aFZs.Extent(), aZZs.Extent()};
|
||||
BOPDS_Interf* aInt=NULL;
|
||||
//
|
||||
for (Standard_Integer aTypeInt = 0; aTypeInt < 6; ++aTypeInt) {
|
||||
for (Standard_Integer i = 0; i < aNb[aTypeInt]; ++i) {
|
||||
BOPDS_Interf* aInt = (aTypeInt==0) ? (BOPDS_Interf*)(&aVVs(i)) :
|
||||
((aTypeInt==1) ? (BOPDS_Interf*)(&aVEs(i)) :
|
||||
((aTypeInt==2) ? (BOPDS_Interf*)(&aEEs(i)) :
|
||||
((aTypeInt==3) ? (BOPDS_Interf*)(&aVFs(i)) :
|
||||
((aTypeInt==4) ? (BOPDS_Interf*)(&aEFs(i)) : (BOPDS_Interf*)(&aFFs(i))))));
|
||||
for (aTypeInt = 0; aTypeInt < aNbTypeInt; ++aTypeInt) {
|
||||
for (i = 0; i < aNb[aTypeInt]; ++i) {
|
||||
switch(aTypeInt) {
|
||||
case 0:
|
||||
aInt=(BOPDS_Interf*)(&aVVs(i));
|
||||
break;
|
||||
case 1:
|
||||
aInt=(BOPDS_Interf*)(&aVEs(i));
|
||||
break;
|
||||
case 2:
|
||||
aInt=(BOPDS_Interf*)(&aEEs(i));
|
||||
break;
|
||||
case 3:
|
||||
aInt=(BOPDS_Interf*)(&aVFs(i));
|
||||
break;
|
||||
case 4:
|
||||
aInt=(BOPDS_Interf*)(&aEFs(i));
|
||||
break;
|
||||
case 5:
|
||||
aInt=(BOPDS_Interf*)(&aFFs(i));
|
||||
break;
|
||||
case 6:
|
||||
aInt=(BOPDS_Interf*)(&aVZs(i));
|
||||
break;
|
||||
case 7:
|
||||
aInt=(BOPDS_Interf*)(&aEZs(i));
|
||||
break;
|
||||
case 8:
|
||||
aInt=(BOPDS_Interf*)(&aFZs(i));
|
||||
break;
|
||||
case 9:
|
||||
aInt=(BOPDS_Interf*)(&aZZs(i));
|
||||
break;
|
||||
default:
|
||||
aInt=NULL;
|
||||
}
|
||||
//
|
||||
Standard_Integer nI1 = aInt->Index1();
|
||||
Standard_Integer nI2 = aInt->Index2();
|
||||
aInt->Indices(nI1, nI2);
|
||||
if (nI1 == nI2) {
|
||||
continue;
|
||||
}
|
||||
@@ -398,6 +436,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
||||
myResult.Append(aResult);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (iErr) {
|
||||
BOPAlgo_CheckResult aResult;
|
||||
if(ii == 0) {
|
||||
@@ -412,9 +451,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
|
||||
myResult.Append(aResult);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ================================================================================
|
||||
// function: TestSmallEdge
|
||||
// purpose:
|
||||
@@ -520,7 +557,6 @@ void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================================
|
||||
// function: TestRebuildFace
|
||||
// purpose:
|
||||
|
@@ -20,6 +20,7 @@ uses
|
||||
Shape from TopoDS,
|
||||
BaseAllocator from BOPCol,
|
||||
ListOfShape from BOPCol,
|
||||
ListOfShape from TopTools,
|
||||
MapOfShape from BOPCol,
|
||||
IndexedDataMapOfShapeListOfShape from BOPCol,
|
||||
Operation from BOPAlgo,
|
||||
@@ -97,6 +98,14 @@ is
|
||||
returns Boolean from Standard
|
||||
is protected;
|
||||
|
||||
Generated (me:out;
|
||||
theS : Shape from TopoDS)
|
||||
---Purpose: Returns the list of shapes generated from the
|
||||
-- shape theS.
|
||||
returns ListOfShape from TopTools
|
||||
is redefined;
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
myNbArgs : Integer from Standard is protected;
|
||||
myOperation : Operation from BOPAlgo is protected;
|
||||
|
@@ -136,3 +136,45 @@
|
||||
//
|
||||
myShape=aRC;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Generated
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_ListOfShape& BOPAlgo_BOP::Generated(const TopoDS_Shape& theS)
|
||||
{
|
||||
myHistShapes.Clear();
|
||||
if (theS.IsNull() || (myOperation != BOPAlgo_SECTION)) {
|
||||
return myHistShapes;
|
||||
}
|
||||
//
|
||||
TopAbs_ShapeEnum aType = theS.ShapeType();
|
||||
if (aType != TopAbs_FACE) {
|
||||
return myHistShapes;
|
||||
}
|
||||
//
|
||||
Standard_Integer nS = myDS->Index(theS);
|
||||
if (nS < 0) {
|
||||
return myHistShapes;
|
||||
}
|
||||
//
|
||||
if (!myDS->HasFaceInfo(nS)) {
|
||||
return myHistShapes;
|
||||
}
|
||||
//
|
||||
//collect section edges of the face theS
|
||||
Standard_Integer i, aNb, nSp;
|
||||
//
|
||||
const BOPDS_FaceInfo& aFI = myDS->FaceInfo(nS);
|
||||
const BOPDS_IndexedMapOfPaveBlock& aMPBSc = aFI.PaveBlocksSc();
|
||||
aNb = aMPBSc.Extent();
|
||||
for (i = 1; i <= aNb; ++i) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB = aMPBSc(i);
|
||||
nSp = aPB->Edge();
|
||||
const TopoDS_Shape& aSp = myDS->Shape(nSp);
|
||||
myHistShapes.Append(aSp);
|
||||
}
|
||||
//
|
||||
return myHistShapes;
|
||||
}
|
||||
|
||||
|
@@ -102,16 +102,6 @@ is
|
||||
---Purpose: Returns true if the shape theS has been deleted.
|
||||
returns Boolean from Standard
|
||||
is redefined;
|
||||
|
||||
SetRunParallel(me:out;
|
||||
theFlag:Boolean from Standard);
|
||||
---Purpose: Set the flag of parallel processing
|
||||
-- if <theFlag> is true the parallel processing is switched on
|
||||
-- if <theFlag> is false the parallel processing is switched off
|
||||
--
|
||||
RunParallel(me)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns the flag of parallel processing
|
||||
--
|
||||
-- Debug
|
||||
--
|
||||
@@ -205,11 +195,6 @@ is
|
||||
theAllocator:BaseAllocator from BOPCol)
|
||||
is protected;
|
||||
|
||||
BuildBndBox(me:out;
|
||||
theIndex:Integer from Standard;
|
||||
theBox: out Box from Bnd)
|
||||
is protected;
|
||||
|
||||
FillInternalShapes(me:out)
|
||||
is protected;
|
||||
--
|
||||
@@ -246,8 +231,6 @@ fields
|
||||
--
|
||||
mySplits : DataMapOfShapeListOfShape from BOPCol is protected;
|
||||
myOrigins : DataMapOfShapeShape from BOPCol is protected;
|
||||
--
|
||||
myRunParallel : Boolean from Standard is protected;
|
||||
--
|
||||
|
||||
end Builder;
|
||||
|
||||
|
@@ -36,13 +36,11 @@ BOPAlgo_Builder::BOPAlgo_Builder()
|
||||
myMapFence(100, myAllocator),
|
||||
myPaveFiller(NULL),
|
||||
myDS(NULL),
|
||||
//myContext(NULL),
|
||||
myEntryPoint(0),
|
||||
myImages(100, myAllocator),
|
||||
myShapesSD(100, myAllocator),
|
||||
mySplits(100, myAllocator),
|
||||
myOrigins(100, myAllocator),
|
||||
myRunParallel(Standard_False)
|
||||
myOrigins(100, myAllocator)
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
@@ -57,13 +55,11 @@ BOPAlgo_Builder::BOPAlgo_Builder
|
||||
myMapFence(100, myAllocator),
|
||||
myPaveFiller(NULL),
|
||||
myDS(NULL),
|
||||
//myContext(NULL),
|
||||
myEntryPoint(0),
|
||||
myImages(100, myAllocator),
|
||||
myShapesSD(100, myAllocator),
|
||||
mySplits(100, myAllocator),
|
||||
myOrigins(100, myAllocator),
|
||||
myRunParallel(Standard_False)
|
||||
myOrigins(100, myAllocator)
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
@@ -93,22 +89,6 @@ void BOPAlgo_Builder::Clear()
|
||||
myOrigins.Clear();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetRunParallel
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Builder::SetRunParallel(const Standard_Boolean theFlag)
|
||||
{
|
||||
myRunParallel=theFlag;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : RunParallel
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPAlgo_Builder::RunParallel()const
|
||||
{
|
||||
return myRunParallel;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : AddArgument
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
@@ -1,19 +1,23 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 2010-2014 OPEN CASCADE SAS
|
||||
// Copyright (c) 2010-2012 OPEN CASCADE SAS
|
||||
// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
|
||||
// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
#include <BOPAlgo_BuilderFace.ixx>
|
||||
|
||||
@@ -57,8 +61,6 @@
|
||||
#include <BOPCol_DataMapOfShapeShape.hxx>
|
||||
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
|
||||
|
||||
static
|
||||
@@ -72,12 +74,72 @@ static
|
||||
static
|
||||
void MakeInternalWires(const BOPCol_MapOfShape& ,
|
||||
BOPCol_ListOfShape& );
|
||||
|
||||
static
|
||||
void GetWire(const TopoDS_Shape& ,
|
||||
TopoDS_Shape& );
|
||||
//
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
#include <BOPCol_Box2DBndTree.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
//
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_ShapeBox2D
|
||||
//purpose : Auxiliary class
|
||||
//=======================================================================
|
||||
class BOPAlgo_ShapeBox2D {
|
||||
public:
|
||||
BOPAlgo_ShapeBox2D() {
|
||||
myIsHole=Standard_False;
|
||||
};
|
||||
//
|
||||
~BOPAlgo_ShapeBox2D() {
|
||||
};
|
||||
//
|
||||
void SetShape(const TopoDS_Shape& aS) {
|
||||
myShape=aS;
|
||||
};
|
||||
//
|
||||
const TopoDS_Shape& Shape()const {
|
||||
return myShape;
|
||||
};
|
||||
//
|
||||
void SetBox2D(const Bnd_Box2d& aBox2D) {
|
||||
myBox2D=aBox2D;
|
||||
};
|
||||
//
|
||||
const Bnd_Box2d& Box2D()const {
|
||||
return myBox2D;
|
||||
};
|
||||
//
|
||||
void SetIsHole(const Standard_Boolean bFlag) {
|
||||
myIsHole=bFlag;
|
||||
};
|
||||
//
|
||||
Standard_Boolean IsHole()const {
|
||||
return myIsHole;
|
||||
};
|
||||
//
|
||||
protected:
|
||||
Standard_Boolean myIsHole;
|
||||
TopoDS_Shape myShape;
|
||||
Bnd_Box2d myBox2D;
|
||||
};
|
||||
//
|
||||
typedef NCollection_DataMap\
|
||||
<Standard_Integer, BOPAlgo_ShapeBox2D, TColStd_MapIntegerHasher> \
|
||||
BOPAlgo_DataMapOfIntegerShapeBox2D;
|
||||
//
|
||||
typedef BOPAlgo_DataMapOfIntegerShapeBox2D::Iterator \
|
||||
BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox2D;
|
||||
//
|
||||
//
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_BuilderFace::BOPAlgo_BuilderFace()
|
||||
BOPAlgo_BuilderFace::BOPAlgo_BuilderFace()
|
||||
:
|
||||
BOPAlgo_BuilderArea()
|
||||
{
|
||||
@@ -87,7 +149,8 @@ static
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_BuilderFace::BOPAlgo_BuilderFace(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
BOPAlgo_BuilderFace::BOPAlgo_BuilderFace
|
||||
(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
:
|
||||
BOPAlgo_BuilderArea(theAllocator)
|
||||
{
|
||||
@@ -104,7 +167,7 @@ static
|
||||
//function : SetFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderFace::SetFace(const TopoDS_Face& theFace)
|
||||
void BOPAlgo_BuilderFace::SetFace(const TopoDS_Face& theFace)
|
||||
{
|
||||
myOrientation=theFace.Orientation();
|
||||
myFace=theFace;
|
||||
@@ -122,7 +185,7 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
//function : Face
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Face& BOPAlgo_BuilderFace::Face()const
|
||||
const TopoDS_Face& BOPAlgo_BuilderFace::Face()const
|
||||
{
|
||||
return myFace;
|
||||
}
|
||||
@@ -130,26 +193,23 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
//function : CheckData
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderFace::CheckData()
|
||||
void BOPAlgo_BuilderFace::CheckData()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
if (myContext.IsNull()) {
|
||||
//myErrorStatus=11;// Null Context
|
||||
//return;
|
||||
myContext = new BOPInt_Context;
|
||||
}
|
||||
//
|
||||
if (myFace.IsNull()) {
|
||||
myErrorStatus=12;// Null face generix
|
||||
return;
|
||||
}
|
||||
if (myContext.IsNull()) {
|
||||
myContext = new BOPInt_Context;
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderFace::Perform()
|
||||
void BOPAlgo_BuilderFace::Perform()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@@ -182,7 +242,7 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
//function :PerformShapesToAvoid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderFace::PerformShapesToAvoid()
|
||||
void BOPAlgo_BuilderFace::PerformShapesToAvoid()
|
||||
{
|
||||
Standard_Boolean bFound;
|
||||
Standard_Integer i, iCnt, aNbV, aNbE;
|
||||
@@ -258,7 +318,7 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
//function : PerformLoops
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderFace::PerformLoops()
|
||||
void BOPAlgo_BuilderFace::PerformLoops()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@@ -286,6 +346,7 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
}
|
||||
//
|
||||
aWSp.SetWES(aWES);
|
||||
aWSp.SetRunParallel(myRunParallel);
|
||||
aWSp.Perform();
|
||||
iErr=aWSp.ErrorStatus();
|
||||
if (iErr) {
|
||||
@@ -374,92 +435,131 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
myLoopsInternal.Append(aW);
|
||||
}//for (; aItM.More(); aItM.Next()) {
|
||||
}
|
||||
//
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformAreas
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderFace::PerformAreas()
|
||||
void BOPAlgo_BuilderFace::PerformAreas()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
Standard_Boolean bIsGrowth, bIsHole;
|
||||
Standard_Integer k,aNbHoles;
|
||||
Standard_Real aTol;
|
||||
TopoDS_Shape anInfinitePointShape;
|
||||
//
|
||||
BOPCol_ListOfShape aNewFaces, aHoleWires;
|
||||
BOPCol_DataMapOfShapeShape aInOutMap;
|
||||
BOPCol_DataMapOfShapeListOfShape aMSH;
|
||||
BOPCol_IndexedMapOfShape aMHE;
|
||||
|
||||
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
|
||||
BOPCol_ListIteratorOfListOfShape aIt1, aIt2;
|
||||
BRep_Builder aBB;
|
||||
Handle(Geom_Surface) aS;
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Geom_Surface) aS;
|
||||
BRep_Builder aBB;
|
||||
TopoDS_Face aFace;
|
||||
//
|
||||
BOPCol_ListIteratorOfListOfInteger aItLI;
|
||||
BOPCol_IndexedMapOfShape aMHE;
|
||||
BOPCol_DataMapOfShapeShape aInOutMap;
|
||||
BOPCol_DataMapIteratorOfDataMapOfShapeShape aItDMSS;
|
||||
BOPCol_DataMapOfShapeListOfShape aMSH;
|
||||
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
|
||||
BOPCol_ListIteratorOfListOfShape aIt1;
|
||||
BOPAlgo_DataMapOfIntegerShapeBox2D aDMISB(100);
|
||||
BOPAlgo_DataMapIteratorOfDataMapOfIntegerShapeBox2D aItDMISB;
|
||||
//
|
||||
BOPCol_Box2DBndTreeSelector aSelector;
|
||||
BOPCol_Box2DBndTree aBBTree;
|
||||
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box2d> aTreeFiller(aBBTree);
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
aTol=BRep_Tool::Tolerance(myFace);
|
||||
aS=BRep_Tool::Surface(myFace, aLoc);
|
||||
//
|
||||
myAreas.Clear();
|
||||
//
|
||||
// Draft faces [aNewFaces]
|
||||
// 1. Growthes and Holes -> aDMISB: [Index/ShapeBox2D]
|
||||
aIt1.Initialize(myLoops);
|
||||
for ( ; aIt1.More(); aIt1.Next()) {
|
||||
for (k=0 ; aIt1.More(); aIt1.Next(), ++k) {
|
||||
Bnd_Box2d aBox2D;
|
||||
//
|
||||
const TopoDS_Shape& aWire=aIt1.Value();
|
||||
//
|
||||
aBB.MakeFace(aFace, aS, aLoc, aTol);
|
||||
aBB.Add (aFace, aWire);
|
||||
BRepTools::AddUVBounds(aFace, aBox2D);
|
||||
//
|
||||
bIsGrowth=IsGrowthWire(aWire, aMHE);
|
||||
if (bIsGrowth) {
|
||||
// make a growth face from a wire
|
||||
TopoDS_Face aFace;
|
||||
aBB.MakeFace(aFace, aS, aLoc, aTol);
|
||||
aBB.Add (aFace, aWire);
|
||||
//
|
||||
aNewFaces.Append (aFace);
|
||||
bIsHole=Standard_False;
|
||||
}
|
||||
else{
|
||||
// check if a wire is a hole
|
||||
//XX
|
||||
TopoDS_Face aFace;
|
||||
aBB.MakeFace(aFace, aS, aLoc, aTol);
|
||||
aBB.Add (aFace, aWire);
|
||||
//
|
||||
IntTools_FClass2d& aClsf=myContext->FClass2d(aFace);
|
||||
aClsf.Init(aFace, aTol);
|
||||
//
|
||||
bIsHole=aClsf.IsHole();
|
||||
//
|
||||
//bIsHole=BOPTools_AlgoTools::IsHole(aWire, myFace);
|
||||
//XX
|
||||
if (bIsHole) {
|
||||
aHoleWires.Append(aWire);
|
||||
BOPTools::MapShapes(aWire, TopAbs_EDGE, aMHE);
|
||||
//
|
||||
bIsHole=Standard_True;
|
||||
}
|
||||
else {
|
||||
// make a growth face from a wire
|
||||
TopoDS_Face aFace;
|
||||
aBB.MakeFace(aFace, aS, aLoc, aTol);
|
||||
aBB.Add (aFace, aWire);
|
||||
//
|
||||
aNewFaces.Append (aFace);
|
||||
}
|
||||
bIsHole=Standard_False;
|
||||
}
|
||||
}
|
||||
//
|
||||
// 2. Find outer growth shell that is most close to each hole shell
|
||||
BOPCol_ListOfShape anUnUsedHoles;
|
||||
aIt2.Initialize(aHoleWires);
|
||||
for (; aIt2.More(); aIt2.Next()) {
|
||||
const TopoDS_Shape& aHole = aIt2.Value();
|
||||
BOPAlgo_ShapeBox2D aSB2D;
|
||||
//
|
||||
aIt1.Initialize(aNewFaces);
|
||||
for ( ; aIt1.More(); aIt1.Next()) {
|
||||
const TopoDS_Shape& aF=aIt1.Value();
|
||||
aSB2D.SetShape(aFace);
|
||||
aSB2D.SetBox2D(aBox2D);
|
||||
aSB2D.SetIsHole(bIsHole);
|
||||
//
|
||||
aDMISB.Bind(k, aSB2D);
|
||||
}
|
||||
//
|
||||
// 2. Prepare TreeFiller
|
||||
aItDMISB.Initialize(aDMISB);
|
||||
for (; aItDMISB.More(); aItDMISB.Next()) {
|
||||
k=aItDMISB.Key();
|
||||
const BOPAlgo_ShapeBox2D& aSB2D=aItDMISB.Value();
|
||||
//
|
||||
bIsHole=aSB2D.IsHole();
|
||||
if (bIsHole) {
|
||||
const Bnd_Box2d& aBox2D=aSB2D.Box2D();
|
||||
aTreeFiller.Add(k, aBox2D);
|
||||
}
|
||||
}
|
||||
//
|
||||
// 3. Shake TreeFiller
|
||||
aTreeFiller.Fill();
|
||||
//
|
||||
// 4. Find outer growth shell that is most close
|
||||
// to each hole shell
|
||||
aItDMISB.Initialize(aDMISB);
|
||||
for (; aItDMISB.More(); aItDMISB.Next()) {
|
||||
k=aItDMISB.Key();
|
||||
const BOPAlgo_ShapeBox2D& aSB2D=aItDMISB.Value();
|
||||
bIsHole=aSB2D.IsHole();
|
||||
if (bIsHole) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const Bnd_Box2d& aBox2DF=aSB2D.Box2D();
|
||||
const TopoDS_Shape aF=aSB2D.Shape();
|
||||
//
|
||||
aSelector.Clear();
|
||||
aSelector.SetBox(aBox2DF);
|
||||
//
|
||||
aNbHoles=aBBTree.Select(aSelector);
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLI=aSelector.Indices();
|
||||
//
|
||||
aItLI.Initialize(aLI);
|
||||
for (; aItLI.More(); aItLI.Next()) {
|
||||
k=aItLI.Value();
|
||||
const BOPAlgo_ShapeBox2D& aSB2Dk=aDMISB.Find(k);
|
||||
const TopoDS_Shape& aHole=aSB2Dk.Shape();
|
||||
//
|
||||
if (!IsInside(aHole, aF, myContext)){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if ( aInOutMap.IsBound (aHole)){
|
||||
if (aInOutMap.IsBound (aHole)){
|
||||
const TopoDS_Shape& aF2=aInOutMap(aHole);
|
||||
if (IsInside(aF, aF2, myContext)) {
|
||||
aInOutMap.UnBind(aHole);
|
||||
@@ -467,13 +567,17 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
}
|
||||
}
|
||||
else{
|
||||
aInOutMap.Bind (aHole, aF);
|
||||
aInOutMap.Bind(aHole, aF);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// Add aHole to a map Face/ListOfHoles [aMSH]
|
||||
if (aInOutMap.IsBound(aHole)){
|
||||
const TopoDS_Shape& aF=aInOutMap(aHole);
|
||||
// 5. Map [Face/Holes] -> aMSH
|
||||
aItDMSS.Initialize(aInOutMap);
|
||||
for (; aItDMSS.More(); aItDMSS.Next()) {
|
||||
const TopoDS_Shape& aHole=aItDMSS.Key();
|
||||
const TopoDS_Shape& aF=aItDMSS.Value();
|
||||
//
|
||||
if (aMSH.IsBound(aF)) {
|
||||
BOPCol_ListOfShape& aLH=aMSH.ChangeFind(aF);
|
||||
aLH.Append(aHole);
|
||||
@@ -484,36 +588,20 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
aMSH.Bind(aF, aLH);
|
||||
}
|
||||
}
|
||||
else {
|
||||
anUnUsedHoles.Append(aHole);
|
||||
}
|
||||
}// for (; aIt2.More(); aIt2.Next())
|
||||
//
|
||||
if (anUnUsedHoles.Extent()) {
|
||||
// add the infinite face to new faces
|
||||
Bnd_Box aBox;
|
||||
BRepBndLib::Add(myFace, aBox);
|
||||
if (aBox.IsOpenXmin() || aBox.IsOpenXmax() ||
|
||||
aBox.IsOpenYmin() || aBox.IsOpenYmax() ||
|
||||
aBox.IsOpenZmin() || aBox.IsOpenZmax()) {
|
||||
TopoDS_Face aFace;
|
||||
aBB.MakeFace(aFace, aS, aLoc, aTol);
|
||||
//
|
||||
aNewFaces.Append(aFace);
|
||||
aMSH.Bind(aFace, anUnUsedHoles);
|
||||
}
|
||||
}
|
||||
//
|
||||
// 3. Add aHoles to Faces
|
||||
// 6. Add aHoles to Faces,
|
||||
aItMSH.Initialize(aMSH);
|
||||
for (; aItMSH.More(); aItMSH.Next()) {
|
||||
TopoDS_Face aF=(*(TopoDS_Face *)(&aItMSH.Key()));
|
||||
//
|
||||
const BOPCol_ListOfShape& aLH=aItMSH.Value();
|
||||
aIt2.Initialize(aLH);
|
||||
for (; aIt2.More(); aIt2.Next()) {
|
||||
const TopoDS_Shape& aHole = aIt2.Value();
|
||||
aBB.Add (aF, aHole);
|
||||
aIt1.Initialize(aLH);
|
||||
for (; aIt1.More(); aIt1.Next()) {
|
||||
TopoDS_Shape aWHole;
|
||||
//
|
||||
const TopoDS_Shape& aFHole=aIt1.Value();
|
||||
GetWire(aFHole, aWHole);
|
||||
aBB.Add (aF, aWHole);
|
||||
}
|
||||
//
|
||||
// update classifier
|
||||
@@ -522,20 +610,38 @@ TopAbs_Orientation BOPAlgo_BuilderFace::Orientation()const
|
||||
aClsf.Init(aF, aTol);
|
||||
}
|
||||
//
|
||||
// These aNewFaces are draft faces that
|
||||
// 7. Fill myAreas
|
||||
// NB:These aNewFaces are draft faces that
|
||||
// do not contain any internal shapes
|
||||
//
|
||||
aIt1.Initialize(aNewFaces);
|
||||
for ( ; aIt1.More(); aIt1.Next()) {
|
||||
const TopoDS_Shape& aF=aIt1.Value();
|
||||
aItDMISB.Initialize(aDMISB);
|
||||
for (; aItDMISB.More(); aItDMISB.Next()) {
|
||||
const BOPAlgo_ShapeBox2D& aSB2D=aItDMISB.Value();
|
||||
bIsHole=aSB2D.IsHole();
|
||||
if (!bIsHole) {
|
||||
const TopoDS_Shape aF=aSB2D.Shape();
|
||||
myAreas.Append(aF);
|
||||
}
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : GetWire
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void GetWire(const TopoDS_Shape& aF, TopoDS_Shape& aW)
|
||||
{
|
||||
TopoDS_Shape aWx;
|
||||
TopoDS_Iterator aIt;
|
||||
//
|
||||
aIt.Initialize(aF);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
aW=aIt.Value();
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformInternalShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderFace::PerformInternalShapes()
|
||||
void BOPAlgo_BuilderFace::PerformInternalShapes()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
|
@@ -21,7 +21,8 @@ class BuilderSolid from BOPAlgo
|
||||
---Purpose: The algorithm to build solids from set of faces
|
||||
|
||||
uses
|
||||
BaseAllocator from BOPCol
|
||||
BaseAllocator from BOPCol,
|
||||
Solid from TopoDS
|
||||
|
||||
--raises
|
||||
|
||||
@@ -34,6 +35,15 @@ is
|
||||
Create (theAllocator: BaseAllocator from BOPCol)
|
||||
returns BuilderSolid from BOPAlgo;
|
||||
|
||||
SetSolid(me:out;
|
||||
theSolid:Solid from TopoDS);
|
||||
---Purpose: Sets the source solid <theSolid>
|
||||
|
||||
Solid(me)
|
||||
returns Solid from TopoDS;
|
||||
---C++: return const &
|
||||
---Purpose: Returns the source solid
|
||||
|
||||
Perform(me:out)
|
||||
---Purpose: Performs the algorithm
|
||||
is redefined;
|
||||
@@ -60,6 +70,7 @@ is
|
||||
---Purpose: Build finalized solids with internal shells
|
||||
is redefined protected;
|
||||
|
||||
--fields
|
||||
fields
|
||||
mySolid:Solid from TopoDS is protected;
|
||||
|
||||
end BuilderSolid;
|
||||
|
@@ -6,35 +6,29 @@
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
//
|
||||
|
||||
#include <BOPAlgo_BuilderSolid.ixx>
|
||||
//
|
||||
#include <NCollection_List.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
//
|
||||
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
//
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
//
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
//
|
||||
|
||||
#include <TopAbs.hxx>
|
||||
//
|
||||
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
@@ -46,32 +40,25 @@
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
//
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
|
||||
#include <TopExp.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
//
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
//
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <BOPTools.hxx>
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
#include <BOPCol_MapOfOrientedShape.hxx>
|
||||
//
|
||||
#include <NCollection_List.hxx>
|
||||
//
|
||||
#include <BOPCol_DataMapOfShapeShape.hxx>
|
||||
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BOPCol_ListOfInteger.hxx>
|
||||
//
|
||||
#include <BOPDS_BoxBndTree.hxx>
|
||||
|
||||
#include <BOPTools.hxx>
|
||||
#include <BOPTools_CoupleOfShape.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BOPTools_AlgoTools3D.hxx>
|
||||
//
|
||||
#include <BOPInt_Context.hxx>
|
||||
//
|
||||
#include <BOPAlgo_ShellSplitter.hxx>
|
||||
#include <BOPCol_DataMapOfIntegerShape.hxx>
|
||||
#include <BOPTools_CoupleOfShape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
|
||||
static
|
||||
Standard_Boolean IsGrowthShell(const TopoDS_Shape& ,
|
||||
@@ -87,63 +74,14 @@ static
|
||||
void MakeInternalShells(const BOPCol_MapOfShape& ,
|
||||
BOPCol_ListOfShape& );
|
||||
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_BuilderSolid_ShapeBox
|
||||
//purpose : Auxiliary class
|
||||
//=======================================================================
|
||||
class BOPAlgo_BuilderSolid_ShapeBox {
|
||||
public:
|
||||
BOPAlgo_BuilderSolid_ShapeBox() {
|
||||
myIsHole=Standard_False;
|
||||
};
|
||||
//
|
||||
~BOPAlgo_BuilderSolid_ShapeBox() {
|
||||
};
|
||||
//
|
||||
void SetShape(const TopoDS_Shape& aS) {
|
||||
myShape=aS;
|
||||
};
|
||||
//
|
||||
const TopoDS_Shape& Shape()const {
|
||||
return myShape;
|
||||
};
|
||||
//
|
||||
void SetBox(const Bnd_Box& aBox) {
|
||||
myBox=aBox;
|
||||
};
|
||||
//
|
||||
const Bnd_Box& Box()const {
|
||||
return myBox;
|
||||
};
|
||||
//
|
||||
void SetIsHole(const Standard_Boolean bFlag) {
|
||||
myIsHole=bFlag;
|
||||
};
|
||||
//
|
||||
Standard_Boolean IsHole()const {
|
||||
return myIsHole;
|
||||
};
|
||||
//
|
||||
protected:
|
||||
Standard_Boolean myIsHole;
|
||||
TopoDS_Shape myShape;
|
||||
Bnd_Box myBox;
|
||||
};
|
||||
//
|
||||
typedef NCollection_DataMap
|
||||
<Standard_Integer,
|
||||
BOPAlgo_BuilderSolid_ShapeBox,
|
||||
TColStd_MapIntegerHasher> BOPAlgo_DataMapOfIntegerBSSB;
|
||||
//
|
||||
typedef BOPAlgo_DataMapOfIntegerBSSB::Iterator
|
||||
BOPAlgo_DataMapIteratorOfDataMapOfIntegerBSSB;
|
||||
//
|
||||
//
|
||||
static
|
||||
Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell);
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_BuilderSolid::BOPAlgo_BuilderSolid()
|
||||
BOPAlgo_BuilderSolid::BOPAlgo_BuilderSolid()
|
||||
:
|
||||
BOPAlgo_BuilderArea()
|
||||
{
|
||||
@@ -152,8 +90,7 @@ BOPAlgo_BuilderSolid::BOPAlgo_BuilderSolid()
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_BuilderSolid::BOPAlgo_BuilderSolid
|
||||
(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
BOPAlgo_BuilderSolid::BOPAlgo_BuilderSolid(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
:
|
||||
BOPAlgo_BuilderArea(theAllocator)
|
||||
{
|
||||
@@ -166,6 +103,22 @@ BOPAlgo_BuilderSolid::~BOPAlgo_BuilderSolid()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderSolid::SetSolid(const TopoDS_Solid& aS)
|
||||
{
|
||||
mySolid=aS;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Solid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopoDS_Solid& BOPAlgo_BuilderSolid::Solid()const
|
||||
{
|
||||
return mySolid;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
@@ -174,6 +127,8 @@ void BOPAlgo_BuilderSolid::Perform()
|
||||
myErrorStatus=0;
|
||||
//
|
||||
if (myContext.IsNull()) {
|
||||
//myErrorStatus=11;// Null Context
|
||||
//return;
|
||||
myContext=new BOPInt_Context;
|
||||
}
|
||||
//
|
||||
@@ -188,6 +143,7 @@ void BOPAlgo_BuilderSolid::Perform()
|
||||
aBB.Add(aC, aF);
|
||||
}
|
||||
//
|
||||
//
|
||||
PerformShapesToAvoid();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
@@ -197,12 +153,10 @@ void BOPAlgo_BuilderSolid::Perform()
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
PerformAreas();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
PerformInternalShapes();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
@@ -233,10 +187,7 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid()
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aF=aIt.Value();
|
||||
if (!myShapesToAvoid.Contains(aF)) {
|
||||
BOPTools::MapShapesAndAncestors(aF,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEF);
|
||||
BOPTools::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||
}
|
||||
}
|
||||
aNbE=aMEF.Extent();
|
||||
@@ -286,7 +237,7 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid()
|
||||
break;
|
||||
}
|
||||
//
|
||||
}//for(;;) {
|
||||
}//while (1)
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformLoops
|
||||
@@ -294,43 +245,143 @@ void BOPAlgo_BuilderSolid::PerformShapesToAvoid()
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderSolid::PerformLoops()
|
||||
{
|
||||
Standard_Integer iErr;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
TopoDS_Iterator aItS;
|
||||
BOPCol_MapIteratorOfMapOfOrientedShape aItM;
|
||||
BOPAlgo_ShellSplitter aSSp;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
myLoops.Clear();
|
||||
//
|
||||
// 1. Shells Usual
|
||||
aIt.Initialize (myShapes);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aF=aIt.Value();
|
||||
if (!myShapesToAvoid.Contains(aF)) {
|
||||
aSSp.AddStartElement(aF);
|
||||
}
|
||||
}
|
||||
Standard_Integer aNbLF, aNbOff, aNbFP;
|
||||
Standard_Integer i;
|
||||
TopAbs_Orientation anOr;
|
||||
TopoDS_Edge aEL;
|
||||
BRep_Builder aBB;
|
||||
TopoDS_Iterator aItS;
|
||||
//
|
||||
aSSp.Perform();
|
||||
iErr=aSSp.ErrorStatus();
|
||||
if (iErr) {
|
||||
return;
|
||||
}
|
||||
BOPCol_ListIteratorOfListOfShape aItF, aIt;
|
||||
BOPCol_MapIteratorOfMapOfOrientedShape aItM;
|
||||
BOPTools_CoupleOfShape aCSOff;
|
||||
//
|
||||
BOPCol_MapOfOrientedShape AddedFacesMap;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aEFMap, aMEFP;
|
||||
//
|
||||
const BOPCol_ListOfShape& aLSh=aSSp.Shells();
|
||||
aIt.Initialize (aLSh);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aSh=aIt.Value();
|
||||
myLoops.Append(aSh);
|
||||
}
|
||||
//=================================================
|
||||
//
|
||||
// 2. Post Treatment
|
||||
Standard_Integer aNbFA;
|
||||
BRep_Builder aBB;
|
||||
BOPCol_MapOfOrientedShape AddedFacesMap;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aEFMap;
|
||||
// 1. Shells Usual
|
||||
//
|
||||
aItF.Initialize (myShapes);
|
||||
for (; aItF.More(); aItF.Next()) {
|
||||
const TopoDS_Shape& aFF = aItF.Value();
|
||||
BOPTools::MapShapesAndAncestors(aFF, TopAbs_EDGE, TopAbs_FACE, aEFMap);
|
||||
}
|
||||
//
|
||||
aItF.Initialize (myShapes);
|
||||
for (i=1; aItF.More(); aItF.Next(), ++i) {
|
||||
const TopoDS_Shape& aFF = aItF.Value();
|
||||
if (myShapesToAvoid.Contains(aFF)) {
|
||||
continue;
|
||||
}
|
||||
if (!AddedFacesMap.Add(aFF)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// make a new shell
|
||||
TopoDS_Shell aShell;
|
||||
aBB.MakeShell(aShell);
|
||||
aBB.Add(aShell, aFF);
|
||||
//
|
||||
aMEFP.Clear();
|
||||
BOPTools::MapShapesAndAncestors(aFF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||
//
|
||||
// loop on faces added to Shell; add their neighbor faces to Shell and so on
|
||||
TopoDS_Iterator aItAddedF (aShell);
|
||||
for (; aItAddedF.More(); aItAddedF.Next()) {
|
||||
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItAddedF.Value()));
|
||||
//
|
||||
// loop on edges of aF; find a good neighbor face of aF by aE
|
||||
TopExp_Explorer aEdgeExp(aF, TopAbs_EDGE);
|
||||
for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aEdgeExp.Current()));
|
||||
//
|
||||
//1
|
||||
if (aMEFP.Contains(aE)) {
|
||||
const BOPCol_ListOfShape& aLFP=aMEFP.FindFromKey(aE);
|
||||
aNbFP=aLFP.Extent();
|
||||
if (aNbFP>1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//2
|
||||
anOr=aE.Orientation();
|
||||
if (anOr==TopAbs_INTERNAL) {
|
||||
continue;
|
||||
}
|
||||
//3
|
||||
if (BRep_Tool::Degenerated(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// candidate faces list
|
||||
const BOPCol_ListOfShape& aLF=aEFMap.FindFromKey(aE);
|
||||
aNbLF=aLF.Extent();
|
||||
if (!aNbLF) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// try to select one of neighbors
|
||||
// check if a face already added to Shell shares E
|
||||
Standard_Boolean bFound;
|
||||
BOPCol_ListIteratorOfListOfShape aItLF;
|
||||
BOPTools_ListOfCoupleOfShape aLCSOff;
|
||||
//
|
||||
aItLF.Initialize(aLF);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Face& aFL=(*(TopoDS_Face*)(&aItLF.Value()));
|
||||
if (myShapesToAvoid.Contains(aFL)) {
|
||||
continue;
|
||||
}
|
||||
if (aF.IsSame(aFL)) {
|
||||
continue;
|
||||
}
|
||||
if (AddedFacesMap.Contains(aFL)){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bFound=BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL);
|
||||
if (!bFound) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aCSOff.SetShape1(aEL);
|
||||
aCSOff.SetShape2(aFL);
|
||||
aLCSOff.Append(aCSOff);
|
||||
}//for (; aItLF.More(); aItLF.Next()) {
|
||||
//
|
||||
aNbOff=aLCSOff.Extent();
|
||||
if (!aNbOff){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
TopoDS_Face aSelF;
|
||||
if (aNbOff==1) {
|
||||
aSelF=(*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
|
||||
}
|
||||
else if (aNbOff>1){
|
||||
BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, myContext);
|
||||
}
|
||||
//
|
||||
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
|
||||
aBB.Add(aShell, aSelF);
|
||||
BOPTools::MapShapesAndAncestors(aSelF, TopAbs_EDGE, TopAbs_FACE, aMEFP);
|
||||
}
|
||||
} // for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||
} //for (; aItAddedF.More(); aItAddedF.Next()) {
|
||||
//
|
||||
if (IsClosedShell(aShell)) {
|
||||
myLoops.Append(aShell);
|
||||
}
|
||||
} // for (; aItF.More(); aItF.Next()) {
|
||||
|
||||
//
|
||||
// Post Treatment
|
||||
BOPCol_MapOfOrientedShape aMP;
|
||||
//
|
||||
// a. collect all edges that are in loops
|
||||
@@ -361,20 +412,17 @@ void BOPAlgo_BuilderSolid::PerformLoops()
|
||||
}
|
||||
//=================================================
|
||||
//
|
||||
// 3.Internal Shells
|
||||
// 2.Internal Shells
|
||||
//
|
||||
myLoopsInternal.Clear();
|
||||
//
|
||||
aEFMap.Clear();
|
||||
AddedFacesMap.Clear();
|
||||
//
|
||||
aNbFA=myShapesToAvoid.Extent();
|
||||
//
|
||||
aItM.Initialize(myShapesToAvoid);
|
||||
for (; aItM.More(); aItM.Next()) {
|
||||
const TopoDS_Shape& aFF=aItM.Key();
|
||||
BOPTools::MapShapesAndAncestors(aFF,
|
||||
TopAbs_EDGE, TopAbs_FACE,
|
||||
aEFMap);
|
||||
BOPTools::MapShapesAndAncestors(aFF, TopAbs_EDGE, TopAbs_FACE, aEFMap);
|
||||
}
|
||||
//
|
||||
aItM.Initialize(myShapesToAvoid);
|
||||
@@ -397,16 +445,15 @@ void BOPAlgo_BuilderSolid::PerformLoops()
|
||||
for (; aEdgeExp.More(); aEdgeExp.Next()) {
|
||||
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aEdgeExp.Current()));
|
||||
const BOPCol_ListOfShape& aLF=aEFMap.FindFromKey(aE);
|
||||
aIt.Initialize(aLF);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Face& aFL=(*(TopoDS_Face*)(&aIt.Value()));
|
||||
aItF.Initialize(aLF);
|
||||
for (; aItF.More(); aItF.Next()) {
|
||||
const TopoDS_Face& aFL=(*(TopoDS_Face*)(&aItF.Value()));
|
||||
if (AddedFacesMap.Add(aFL)){
|
||||
aBB.Add(aShell, aFL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
aShell.Closed (BRep_Tool::IsClosed (aShell));
|
||||
myLoopsInternal.Append(aShell);
|
||||
}
|
||||
}
|
||||
@@ -416,139 +463,83 @@ void BOPAlgo_BuilderSolid::PerformLoops()
|
||||
//=======================================================================
|
||||
void BOPAlgo_BuilderSolid::PerformAreas()
|
||||
{
|
||||
Standard_Boolean bIsGrowth, bIsHole;
|
||||
Standard_Integer k,aNbHoles;
|
||||
myErrorStatus=0;
|
||||
//
|
||||
Standard_Boolean bIsGrowthShell, bIsHole;
|
||||
BRep_Builder aBB;
|
||||
BOPCol_ListIteratorOfListOfShape aItLS;
|
||||
TopoDS_Shape anInfinitePointShape;
|
||||
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
|
||||
BOPCol_ListIteratorOfListOfShape aShellIt, aSolidIt;
|
||||
//
|
||||
BOPCol_ListOfShape aNewSolids, aHoleShells;
|
||||
BOPCol_DataMapOfShapeShape aInOutMap;
|
||||
BOPCol_IndexedMapOfShape aMHF;
|
||||
BOPCol_ListIteratorOfListOfInteger aItLI;
|
||||
BOPDS_BoxBndTreeSelector aSelector;
|
||||
BOPDS_BoxBndTree aBBTree;
|
||||
NCollection_UBTreeFiller
|
||||
<Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
|
||||
BOPAlgo_DataMapOfIntegerBSSB aDMISB(100);
|
||||
BOPAlgo_DataMapIteratorOfDataMapOfIntegerBSSB aItDMISB;
|
||||
BOPCol_DataMapOfShapeListOfShape aMSH;
|
||||
BOPCol_DataMapIteratorOfDataMapOfShapeShape aItDMSS;
|
||||
BOPCol_DataMapIteratorOfDataMapOfShapeListOfShape aItMSH;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
BOPCol_IndexedMapOfShape aMHF;
|
||||
//
|
||||
myAreas.Clear();
|
||||
//
|
||||
// Draft solids [aNewSolids]
|
||||
aItLS.Initialize(myLoops);
|
||||
for (k=0; aItLS.More(); aItLS.Next(), ++k) {
|
||||
TopoDS_Solid aSolid;
|
||||
Bnd_Box aBox;
|
||||
BOPAlgo_BuilderSolid_ShapeBox aSB;
|
||||
aShellIt.Initialize(myLoops);
|
||||
for ( ; aShellIt.More(); aShellIt.Next()) {
|
||||
const TopoDS_Shape& aShell = aShellIt.Value();
|
||||
//
|
||||
const TopoDS_Shape& aShell = aItLS.Value();
|
||||
aSB.SetShape(aShell);
|
||||
//
|
||||
BRepBndLib::Add(aShell, aBox);
|
||||
bIsHole=Standard_False;
|
||||
//
|
||||
bIsGrowth=IsGrowthShell(aShell, aMHF);
|
||||
if (bIsGrowth) {
|
||||
bIsGrowthShell=IsGrowthShell(aShell, aMHF);
|
||||
if (bIsGrowthShell) {
|
||||
// make a growth solid from a shell
|
||||
aBB.MakeSolid(aSolid);
|
||||
aBB.Add (aSolid, aShell);
|
||||
TopoDS_Solid Solid;
|
||||
aBB.MakeSolid(Solid);
|
||||
aBB.Add (Solid, aShell);
|
||||
//
|
||||
aNewSolids.Append (aSolid);
|
||||
aSB.SetShape(aSolid);
|
||||
aNewSolids.Append (Solid);
|
||||
}
|
||||
else{
|
||||
// check if a shell is a hole
|
||||
//XX
|
||||
bIsHole=IsHole(aShell, myContext);
|
||||
//XX
|
||||
if (bIsHole) {
|
||||
aHoleShells.Append(aShell);
|
||||
BOPTools::MapShapes(aShell, TopAbs_FACE, aMHF);
|
||||
aSB.SetShape(aShell);
|
||||
}
|
||||
else {
|
||||
// make a growth solid from a shell
|
||||
aBB.MakeSolid(aSolid);
|
||||
aBB.Add (aSolid, aShell);
|
||||
TopoDS_Solid Solid;
|
||||
aBB.MakeSolid(Solid);
|
||||
aBB.Add (Solid, aShell);
|
||||
//
|
||||
aNewSolids.Append (aSolid);
|
||||
aSB.SetShape(aSolid);
|
||||
aNewSolids.Append (Solid);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aSB.SetBox(aBox);
|
||||
aSB.SetIsHole(bIsHole);
|
||||
aDMISB.Bind(k, aSB);
|
||||
}
|
||||
// 2. Find outer growth shell that is most close to each hole shell
|
||||
aShellIt.Initialize(aHoleShells);
|
||||
for (; aShellIt.More(); aShellIt.Next()) {
|
||||
const TopoDS_Shape& aHole = aShellIt.Value();
|
||||
//
|
||||
// 2. Prepare TreeFiller
|
||||
aItDMISB.Initialize(aDMISB);
|
||||
for (; aItDMISB.More(); aItDMISB.Next()) {
|
||||
k=aItDMISB.Key();
|
||||
const BOPAlgo_BuilderSolid_ShapeBox& aSB=aItDMISB.Value();
|
||||
//
|
||||
bIsHole=aSB.IsHole();
|
||||
if (bIsHole) {
|
||||
const Bnd_Box& aBox=aSB.Box();
|
||||
aTreeFiller.Add(k, aBox);
|
||||
}
|
||||
}
|
||||
//
|
||||
// 3. Shake TreeFiller
|
||||
aTreeFiller.Fill();
|
||||
//
|
||||
// 4. Find outer growth shell that is most close
|
||||
// to each hole shell
|
||||
aItDMISB.Initialize(aDMISB);
|
||||
for (; aItDMISB.More(); aItDMISB.Next()) {
|
||||
k=aItDMISB.Key();
|
||||
const BOPAlgo_BuilderSolid_ShapeBox& aSB=aItDMISB.Value();
|
||||
bIsHole=aSB.IsHole();
|
||||
if (bIsHole) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape aSolid=aSB.Shape();
|
||||
const Bnd_Box& aBoxSolid=aSB.Box();
|
||||
//
|
||||
aSelector.Clear();
|
||||
aSelector.SetBox(aBoxSolid);
|
||||
//
|
||||
aNbHoles=aBBTree.Select(aSelector);
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLI=aSelector.Indices();
|
||||
//
|
||||
aItLI.Initialize(aLI);
|
||||
for (; aItLI.More(); aItLI.Next()) {
|
||||
k=aItLI.Value();
|
||||
const BOPAlgo_BuilderSolid_ShapeBox& aSBk=aDMISB.Find(k);
|
||||
const TopoDS_Shape& aHole=aSBk.Shape();
|
||||
aSolidIt.Initialize(aNewSolids);
|
||||
for ( ; aSolidIt.More(); aSolidIt.Next()) {
|
||||
const TopoDS_Shape& aSolid = aSolidIt.Value();
|
||||
//
|
||||
if (!IsInside(aHole, aSolid, myContext)){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (aInOutMap.IsBound (aHole)){
|
||||
const TopoDS_Shape& aHole2=aInOutMap(aHole);
|
||||
if (IsInside(aHole, aHole2, myContext)) {
|
||||
if ( aInOutMap.IsBound (aHole)){
|
||||
const TopoDS_Shape& aSolid2 = aInOutMap(aHole);
|
||||
if (IsInside(aSolid, aSolid2, myContext)) {
|
||||
aInOutMap.UnBind(aHole);
|
||||
aInOutMap.Bind (aHole, aSolid);
|
||||
}
|
||||
}
|
||||
else{
|
||||
aInOutMap.Bind(aHole, aSolid);
|
||||
aInOutMap.Bind (aHole, aSolid);
|
||||
}
|
||||
}
|
||||
}//for (; aItDMISB.More(); aItDMISB.Next()) {
|
||||
//
|
||||
// 5. Map [Solid/Holes] -> aMSH
|
||||
aItDMSS.Initialize(aInOutMap);
|
||||
for (; aItDMSS.More(); aItDMSS.Next()) {
|
||||
const TopoDS_Shape& aHole=aItDMSS.Key();
|
||||
const TopoDS_Shape& aSolid=aItDMSS.Value();
|
||||
//
|
||||
// Add aHole to a map Solid/ListOfHoles [aMSH]
|
||||
if (aInOutMap.IsBound(aHole)){
|
||||
const TopoDS_Shape& aSolid=aInOutMap(aHole);
|
||||
if (aMSH.IsBound(aSolid)) {
|
||||
BOPCol_ListOfShape& aLH=aMSH.ChangeFind(aSolid);
|
||||
aLH.Append(aHole);
|
||||
@@ -558,41 +549,43 @@ void BOPAlgo_BuilderSolid::PerformAreas()
|
||||
aLH.Append(aHole);
|
||||
aMSH.Bind(aSolid, aLH);
|
||||
}
|
||||
//aBB.Add (aSolid, aHole);
|
||||
}
|
||||
}// for (; aShellIt.More(); aShellIt.Next()) {
|
||||
//
|
||||
// 6. Add aHoles to Solids
|
||||
// 3. Add aHoles to Solids
|
||||
aItMSH.Initialize(aMSH);
|
||||
for (; aItMSH.More(); aItMSH.Next()) {
|
||||
TopoDS_Solid aSolid=(*(TopoDS_Solid*)(&aItMSH.Key()));
|
||||
//
|
||||
const BOPCol_ListOfShape& aLH=aItMSH.Value();
|
||||
aItLS.Initialize(aLH);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aHole = aItLS.Value();
|
||||
aShellIt.Initialize(aLH);
|
||||
for (; aShellIt.More(); aShellIt.Next()) {
|
||||
const TopoDS_Shape& aHole = aShellIt.Value();
|
||||
aBB.Add (aSolid, aHole);
|
||||
}
|
||||
//
|
||||
// update classifier
|
||||
BRepClass3d_SolidClassifier& aSC=
|
||||
myContext->SolidClassifier(aSolid);
|
||||
BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aSolid);
|
||||
aSC.Load(aSolid);
|
||||
//
|
||||
}
|
||||
//
|
||||
// 7. These aNewSolids are draft solids that
|
||||
// These aNewSolids are draft solids that
|
||||
// do not contain any internal shapes
|
||||
aItLS.Initialize(aNewSolids);
|
||||
for ( ; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aSx=aItLS.Value();
|
||||
//
|
||||
aShellIt.Initialize(aNewSolids);
|
||||
for ( ; aShellIt.More(); aShellIt.Next()) {
|
||||
const TopoDS_Shape& aSx = aShellIt.Value();
|
||||
myAreas.Append(aSx);
|
||||
}
|
||||
|
||||
// Add holes that outside the solids to myAreas
|
||||
aItLS.Initialize(aHoleShells);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aHole = aItLS.Value();
|
||||
aShellIt.Initialize(aHoleShells);
|
||||
for (; aShellIt.More(); aShellIt.Next()) {
|
||||
const TopoDS_Shape& aHole = aShellIt.Value();
|
||||
if (!aInOutMap.IsBound(aHole)){
|
||||
TopoDS_Solid aSolid;
|
||||
//
|
||||
aBB.MakeSolid(aSolid);
|
||||
aBB.Add (aSolid, aHole);
|
||||
//
|
||||
@@ -613,169 +606,95 @@ void BOPAlgo_BuilderSolid::PerformInternalShapes()
|
||||
return;
|
||||
}
|
||||
//
|
||||
Standard_Integer k, aNbVFS, aNbSLF, aNbF, aNbA;
|
||||
BRep_Builder aBB;
|
||||
TopoDS_Iterator aIt;
|
||||
TopExp_Explorer aExp;
|
||||
BOPCol_ListIteratorOfListOfShape aItLS;
|
||||
BOPCol_MapOfShape aMFs;
|
||||
BOPCol_ListIteratorOfListOfShape aShellIt, aSolidIt;
|
||||
BOPCol_MapIteratorOfMapOfShape aItMF;
|
||||
//
|
||||
BOPCol_MapOfShape aMF, aMFP, aMFx;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
|
||||
BOPCol_ListOfShape aLSI;
|
||||
BOPCol_ListIteratorOfListOfInteger aItLI;
|
||||
BOPDS_BoxBndTreeSelector aSelector;
|
||||
BOPDS_BoxBndTree aBBTree;
|
||||
NCollection_UBTreeFiller
|
||||
<Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
|
||||
BOPCol_DataMapOfIntegerShape aDMIS;
|
||||
//
|
||||
aNbA=myAreas.Extent();
|
||||
//
|
||||
// 1. Prepare tree filler
|
||||
k = 0;
|
||||
aItLS.Initialize(myLoopsInternal);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aShell=aItLS.Value();
|
||||
// 1. All internal faces
|
||||
aShellIt.Initialize(myLoopsInternal);
|
||||
for (; aShellIt.More(); aShellIt.Next()) {
|
||||
const TopoDS_Shape& aShell=aShellIt.Value();
|
||||
aIt.Initialize(aShell);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Face& aF=*((TopoDS_Face*)&aIt.Value());
|
||||
const TopoDS_Shape& aF=aIt.Value();
|
||||
aMF.Add(aF);
|
||||
}
|
||||
}
|
||||
aNbFI=aMF.Extent();
|
||||
//
|
||||
if (aMFs.Add(aF)) {
|
||||
if (aNbA) {
|
||||
Bnd_Box aBox;
|
||||
BRepBndLib::Add(aF, aBox);
|
||||
aDMIS.Bind(k, aF);
|
||||
aTreeFiller.Add(k++, aBox);
|
||||
}
|
||||
// 2 Process solids
|
||||
aSolidIt.Initialize(myAreas);
|
||||
for ( ; aSolidIt.More(); aSolidIt.Next()) {
|
||||
TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aSolidIt.Value()));
|
||||
//
|
||||
TopExp_Explorer anExpSol(aSolid, TopAbs_FACE);;
|
||||
for (; anExpSol.More(); anExpSol.Next()) {
|
||||
const TopoDS_Shape& aF = anExpSol.Current();
|
||||
TopoDS_Shape aFF=aF;
|
||||
//
|
||||
aFF.Orientation(TopAbs_FORWARD);
|
||||
aMFx.Add(aFF);
|
||||
aFF.Orientation(TopAbs_REVERSED);
|
||||
aMFx.Add(aFF);
|
||||
}
|
||||
aMEF.Clear();
|
||||
BOPTools::MapShapesAndAncestors(aSolid, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||
//
|
||||
// 2.1 Separate faces to process aMFP
|
||||
aMFP.Clear();
|
||||
aItMF.Initialize(aMF);
|
||||
for (; aItMF.More(); aItMF.Next()) {
|
||||
const TopoDS_Face& aF=(*(TopoDS_Face*)(&aItMF.Key()));
|
||||
if (!aMFx.Contains(aF)) {
|
||||
if (BOPTools_AlgoTools::IsInternalFace(aF, aSolid, aMEF, 1.e-14, myContext)) {
|
||||
aMFP.Add(aF);
|
||||
}
|
||||
}
|
||||
}
|
||||
aMFx.Clear();
|
||||
//
|
||||
if (!aNbA) {
|
||||
// 7b. "Rest" faces treatment
|
||||
TopoDS_Solid aSolid;
|
||||
aBB.MakeSolid(aSolid);
|
||||
// 2.2 Make Internal Shells
|
||||
aLSI.Clear();
|
||||
MakeInternalShells(aMFP, aLSI);
|
||||
//
|
||||
MakeInternalShells(aMFs, aLSI);
|
||||
//
|
||||
aItLS.Initialize(aLSI);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aSI=aItLS.Value();
|
||||
// 2.3 Add them to aSolid
|
||||
aShellIt.Initialize(aLSI);
|
||||
for (; aShellIt.More(); aShellIt.Next()) {
|
||||
const TopoDS_Shape& aSI=aShellIt.Value();
|
||||
aBB.Add (aSolid, aSI);
|
||||
}
|
||||
myAreas.Append(aSolid);
|
||||
//
|
||||
return; // =>
|
||||
}//if (!aNbA) {
|
||||
//
|
||||
//2. fill tree filler
|
||||
aTreeFiller.Fill();
|
||||
//
|
||||
// 3. Face/Solid candidates: aVFS
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMSLF;
|
||||
BOPCol_MapOfShape aMFProcessed;
|
||||
//
|
||||
aItLS.Initialize(myAreas);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
Bnd_Box aBox;
|
||||
//
|
||||
TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aItLS.Value()));
|
||||
BRepBndLib::Add(aSolid, aBox);
|
||||
//
|
||||
aMFs.Clear();
|
||||
aExp.Init(aSolid, TopAbs_FACE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Shape& aFs=aExp.Current();
|
||||
aMFs.Add(aFs);
|
||||
// 2.4 Remove faces aMFP from aMF
|
||||
aItMF.Initialize(aMFP);
|
||||
for (; aItMF.More(); aItMF.Next()) {
|
||||
const TopoDS_Shape& aF=aItMF.Key();
|
||||
aMF.Remove(aF);
|
||||
}
|
||||
//
|
||||
aSelector.Clear();
|
||||
aSelector.SetBox(aBox);
|
||||
//
|
||||
aNbF=aBBTree.Select(aSelector);
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLI=aSelector.Indices();
|
||||
aItLI.Initialize(aLI);
|
||||
for (; aItLI.More(); aItLI.Next()) {
|
||||
k=aItLI.Value();
|
||||
const TopoDS_Face& aF = *(TopoDS_Face*)&aDMIS.Find(k);
|
||||
if (aMFs.Contains(aF)) {
|
||||
continue;
|
||||
aNbFI=aMF.Extent();
|
||||
if (!aNbFI) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
gp_Pnt aP;
|
||||
gp_Pnt2d aP2D;
|
||||
//
|
||||
BOPTools_AlgoTools3D::PointInFace(aF, aP, aP2D, myContext);
|
||||
//
|
||||
TopAbs_State aState=BOPTools_AlgoTools::ComputeState(aP, aSolid,
|
||||
Precision::Confusion(),
|
||||
myContext);
|
||||
if (aState==TopAbs_IN) {
|
||||
if (aMSLF.Contains(aSolid)) {
|
||||
BOPCol_ListOfShape& aLF=aMSLF.ChangeFromKey(aSolid);
|
||||
aLF.Append(aF);
|
||||
}
|
||||
else {
|
||||
BOPCol_ListOfShape aLF;
|
||||
//
|
||||
aLF.Append(aF);
|
||||
aMSLF.Add(aSolid, aLF);
|
||||
}
|
||||
}
|
||||
}
|
||||
}// for (k=0; k < aNbVE; ++k) {
|
||||
//
|
||||
// 6. Update Solids by internal Faces
|
||||
aNbSLF=aMSLF.Extent();
|
||||
for (k=1; k <= aNbSLF; ++k) {
|
||||
const TopoDS_Shape& aSolid=aMSLF.FindKey(k);
|
||||
TopoDS_Shape *pSolid=(TopoDS_Shape*)&aSolid;
|
||||
//
|
||||
const BOPCol_ListOfShape& aLF=aMSLF(k);
|
||||
//
|
||||
aMFs.Clear();
|
||||
aItLS.Initialize(aLF);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aF=aItLS.Value();
|
||||
aMFs.Add(aF);
|
||||
aMFProcessed.Add(aF);
|
||||
}
|
||||
//
|
||||
aLSI.Clear();
|
||||
MakeInternalShells(aMFs, aLSI);
|
||||
//
|
||||
aItLS.Initialize(aLSI);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aSI=aItLS.Value();
|
||||
aBB.Add (*pSolid, aSI);
|
||||
}
|
||||
}
|
||||
//
|
||||
// 7. "Rest" faces treatment (if there are)
|
||||
aMFs.Clear();
|
||||
aNbVFS = aDMIS.Extent();
|
||||
for (k=0; k < aNbVFS; ++k) {
|
||||
const TopoDS_Face& aF=*(TopoDS_Face*)&aDMIS.Find(k);
|
||||
if (!aMFProcessed.Contains(aF)) {
|
||||
aMFs.Add(aF);
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbFI=aMFs.Extent();
|
||||
} //for ( ; aSolidIt.More(); aSolidIt.Next()) {
|
||||
if (aNbFI) {
|
||||
TopoDS_Solid aSolid;
|
||||
aBB.MakeSolid(aSolid);
|
||||
//
|
||||
aLSI.Clear();
|
||||
MakeInternalShells(aMFs, aLSI);
|
||||
//
|
||||
aItLS.Initialize(aLSI);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aSI=aItLS.Value();
|
||||
MakeInternalShells(aMF, aLSI);
|
||||
aShellIt.Initialize(aLSI);
|
||||
for (; aShellIt.More(); aShellIt.Next()) {
|
||||
const TopoDS_Shape& aSI=aShellIt.Value();
|
||||
aBB.Add (aSolid, aSI);
|
||||
}
|
||||
myAreas.Append(aSolid);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MakeInternalShells
|
||||
//purpose :
|
||||
@@ -793,9 +712,7 @@ void MakeInternalShells(const BOPCol_MapOfShape& theMF,
|
||||
aItM.Initialize(theMF);
|
||||
for (; aItM.More(); aItM.Next()) {
|
||||
const TopoDS_Shape& aF=aItM.Key();
|
||||
BOPTools::MapShapesAndAncestors(aF,
|
||||
TopAbs_EDGE, TopAbs_FACE,
|
||||
aMEF);
|
||||
BOPTools::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||
}
|
||||
//
|
||||
aItM.Initialize(theMF);
|
||||
@@ -829,7 +746,6 @@ void MakeInternalShells(const BOPCol_MapOfShape& theMF,
|
||||
}
|
||||
}
|
||||
}
|
||||
aShell.Closed (BRep_Tool::IsClosed (aShell));
|
||||
theShells.Append(aShell);
|
||||
}
|
||||
}
|
||||
@@ -870,9 +786,7 @@ Standard_Boolean IsInside(const TopoDS_Shape& theS1,
|
||||
BOPCol_IndexedMapOfShape aBounds;
|
||||
BOPTools::MapShapes(*pS2, TopAbs_EDGE, aBounds);
|
||||
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aExp.Current()));
|
||||
aState=BOPTools_AlgoTools::ComputeState(aF, *pS2,
|
||||
Precision::Confusion(),
|
||||
aBounds, theContext);
|
||||
aState=BOPTools_AlgoTools::ComputeState(aF, *pS2, 1.e-14, aBounds, theContext);
|
||||
}
|
||||
return (aState==TopAbs_IN);
|
||||
}
|
||||
@@ -898,3 +812,42 @@ Standard_Boolean IsGrowthShell(const TopoDS_Shape& theShell,
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsClosedShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
|
||||
{
|
||||
Standard_Integer aNbE;
|
||||
Standard_Boolean bRet;
|
||||
TopoDS_Iterator aIt;
|
||||
TopExp_Explorer aExp;
|
||||
//
|
||||
BOPCol_MapOfShape aM;
|
||||
//
|
||||
bRet=Standard_False;
|
||||
aIt.Initialize(theShell);
|
||||
for(; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Face& aF=(*(TopoDS_Face*)(&aIt.Value()));
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
|
||||
if (BRep_Tool::Degenerated(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (aE.Orientation()==TopAbs_INTERNAL) {
|
||||
continue;
|
||||
}
|
||||
if (!aM.Add(aE)) {
|
||||
aM.Remove(aE);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbE=aM.Extent();
|
||||
if (!aNbE) {
|
||||
bRet=!bRet;
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
@@ -252,6 +252,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
|
||||
BOPAlgo_BuilderFace& aBF=aVBF.Append1();
|
||||
aBF.SetFace(aF);
|
||||
aBF.SetShapes(aLE);
|
||||
aBF.SetRunParallel(myRunParallel);
|
||||
//
|
||||
}// for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
|
@@ -30,16 +30,14 @@
|
||||
#include <BOPInt_Context.hxx>
|
||||
|
||||
#include <BOPAlgo_BuilderFace.hxx>
|
||||
#include <BOPAlgo_BuilderSolid.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_VectorOfBuilderFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
typedef BOPCol_NCVector<BOPAlgo_BuilderFace> BOPAlgo_VectorOfBuilderFace;
|
||||
//
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_BuilderFaceFunctor
|
||||
//purpose :
|
||||
//purpose : The class provides the interface and implementation
|
||||
// of the parallel computations
|
||||
//=======================================================================
|
||||
class BOPAlgo_BuilderFaceFunctor {
|
||||
protected:
|
||||
@@ -51,15 +49,15 @@ class BOPAlgo_BuilderFaceFunctor {
|
||||
: myPVBF(&aVBF) {
|
||||
}
|
||||
//
|
||||
void operator()( const flexible_range<Standard_Size>& aBR ) const{
|
||||
Standard_Size i, iBeg, iEnd;
|
||||
void operator()( const flexible_range<Standard_Integer>& aBR ) const{
|
||||
Standard_Integer i, iBeg, iEnd;
|
||||
//
|
||||
BOPAlgo_VectorOfBuilderFace& aVBF=*myPVBF;
|
||||
//
|
||||
iBeg=aBR.begin();
|
||||
iEnd=aBR.end();
|
||||
for(i=iBeg; i!=iEnd; ++i) {
|
||||
BOPAlgo_BuilderFace& aBF=aVBF((Standard_Integer)i);
|
||||
BOPAlgo_BuilderFace& aBF=aVBF(i);
|
||||
//
|
||||
aBF.Perform();
|
||||
}
|
||||
@@ -67,7 +65,8 @@ class BOPAlgo_BuilderFaceFunctor {
|
||||
};
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_BuilderFaceCnt
|
||||
//purpose :
|
||||
//purpose : The class provides the interface and implementation
|
||||
// of the parallel computations
|
||||
//=======================================================================
|
||||
class BOPAlgo_BuilderFaceCnt {
|
||||
public:
|
||||
@@ -77,22 +76,23 @@ class BOPAlgo_BuilderFaceCnt {
|
||||
BOPAlgo_VectorOfBuilderFace& aVBF) {
|
||||
//
|
||||
BOPAlgo_BuilderFaceFunctor aBFF(aVBF);
|
||||
Standard_Size aNbBF=aVBF.Extent();
|
||||
Standard_Integer aNbBF=aVBF.Extent();
|
||||
//
|
||||
if (bRunParallel) {
|
||||
flexible_for(flexible_range<Standard_Size>(0,aNbBF), aBFF);
|
||||
flexible_for(flexible_range<Standard_Integer>(0,aNbBF), aBFF);
|
||||
}
|
||||
else {
|
||||
aBFF.operator()(flexible_range<Standard_Size>(0,aNbBF));
|
||||
aBFF.operator()(flexible_range<Standard_Integer>(0,aNbBF));
|
||||
}
|
||||
}
|
||||
//
|
||||
};
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
typedef BOPCol_NCVector<TopoDS_Shape> BOPAlgo_VectorOfShape;
|
||||
typedef BOPCol_NCVector<BOPAlgo_VectorOfShape> BOPAlgo_VectorOfVectorOfShape;
|
||||
|
||||
//
|
||||
typedef BOPCol_NCVector<BOPAlgo_VectorOfShape> \
|
||||
BOPAlgo_VectorOfVectorOfShape;
|
||||
//
|
||||
typedef NCollection_IndexedDataMap\
|
||||
<BOPTools_Set, Standard_Integer, BOPTools_SetMapHasher> \
|
||||
BOPAlgo_IndexedDataMapOfSetInteger;
|
||||
@@ -124,13 +124,14 @@ class BOPAlgo_PairOfShapeBoolean {
|
||||
TopoDS_Shape myShape1;
|
||||
TopoDS_Shape myShape2;
|
||||
};
|
||||
|
||||
typedef BOPCol_NCVector<BOPAlgo_PairOfShapeBoolean> BOPAlgo_VectorOfPairOfShapeBoolean;
|
||||
//
|
||||
|
||||
typedef BOPCol_NCVector<BOPAlgo_PairOfShapeBoolean> \
|
||||
BOPAlgo_VectorOfPairOfShapeBoolean;
|
||||
//
|
||||
//=======================================================================
|
||||
//function : BOPAlgo_BuilderSDFaceFunctor
|
||||
//purpose :
|
||||
//purpose : The class provides the interface and implementation
|
||||
// of the parallel computations
|
||||
//=======================================================================
|
||||
class BOPAlgo_BuilderSDFaceFunctor {
|
||||
protected:
|
||||
@@ -167,7 +168,8 @@ class BOPAlgo_BuilderSDFaceFunctor {
|
||||
//
|
||||
//=======================================================================
|
||||
//function : BOPAlgo_BuilderSDFaceCnt
|
||||
//purpose :
|
||||
//purpose : The class provides the interface and implementation
|
||||
// of the parallel computations
|
||||
//=======================================================================
|
||||
class BOPAlgo_BuilderSDFaceCnt {
|
||||
public:
|
||||
@@ -190,6 +192,61 @@ class BOPAlgo_BuilderSDFaceCnt {
|
||||
}
|
||||
//
|
||||
};
|
||||
//
|
||||
typedef BOPCol_NCVector<BOPAlgo_BuilderSolid> BOPAlgo_VectorOfBuilderSolid;
|
||||
//
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_BuilderSolidFunctor
|
||||
//purpose : The class provides the interface and implementation
|
||||
// of the parallel computations
|
||||
//=======================================================================
|
||||
class BOPAlgo_BuilderSolidFunctor {
|
||||
protected:
|
||||
BOPAlgo_VectorOfBuilderSolid* myPVBS;
|
||||
//
|
||||
public:
|
||||
//
|
||||
BOPAlgo_BuilderSolidFunctor(BOPAlgo_VectorOfBuilderSolid& aVBS)
|
||||
: myPVBS(&aVBS) {
|
||||
}
|
||||
//
|
||||
void operator()( const flexible_range<Standard_Integer>& aBR ) const{
|
||||
Standard_Integer i, iBeg, iEnd;
|
||||
//
|
||||
BOPAlgo_VectorOfBuilderSolid& aVBS=*myPVBS;
|
||||
//
|
||||
iBeg=aBR.begin();
|
||||
iEnd=aBR.end();
|
||||
for(i=iBeg; i!=iEnd; ++i) {
|
||||
BOPAlgo_BuilderSolid& aBS=aVBS(i);
|
||||
//
|
||||
aBS.Perform();
|
||||
}
|
||||
}
|
||||
};
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_BuilderSolidCnt
|
||||
//purpose : The class provides the interface and implementation
|
||||
// of the parallel computations
|
||||
//=======================================================================
|
||||
class BOPAlgo_BuilderSolidCnt {
|
||||
public:
|
||||
//-------------------------------
|
||||
// Perform
|
||||
Standard_EXPORT static void Perform(const Standard_Boolean bRunParallel,
|
||||
BOPAlgo_VectorOfBuilderSolid& aVBS) {
|
||||
|
||||
Standard_Integer aNbBS=aVBS.Extent();
|
||||
BOPAlgo_BuilderSolidFunctor aBSF(aVBS);
|
||||
//
|
||||
if (bRunParallel) {
|
||||
flexible_for(flexible_range<Standard_Integer>(0,aNbBS), aBSF);
|
||||
}
|
||||
else {
|
||||
aBSF.operator()(flexible_range<Standard_Integer>(0,aNbBS));
|
||||
}
|
||||
}
|
||||
//
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -18,7 +18,9 @@
|
||||
#include <BOPAlgo_Builder.hxx>
|
||||
|
||||
#include <NCollection_IncAllocator.hxx>
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <TopAbs_State.hxx>
|
||||
|
||||
#include <TopoDS.hxx>
|
||||
@@ -38,38 +40,29 @@
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
//
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <BOPCol_ListOfShape.hxx>
|
||||
#include <BOPCol_BoxBndTree.hxx>
|
||||
#include <BOPCol_ListOfInteger.hxx>
|
||||
#include <BOPCol_DataMapOfIntegerShape.hxx>
|
||||
//
|
||||
#include <BOPInt_Context.hxx>
|
||||
//
|
||||
#include <BOPDS_DS.hxx>
|
||||
#include <BOPDS_ShapeInfo.hxx>
|
||||
//
|
||||
#include <BOPTools.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
//
|
||||
#include <BOPTools_MapOfSet.hxx>
|
||||
#include <BOPTools_Set.hxx>
|
||||
//
|
||||
#include <BOPAlgo_BuilderSolid.hxx>
|
||||
#include <BOPAlgo_Builder_2Cnt.hxx>
|
||||
|
||||
#include <BOPCol_DataMapOfIntegerShape.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
#include <BOPDS_BoxBndTree.hxx>
|
||||
#include <BOPCol_ListOfInteger.hxx>
|
||||
#include <BOPInt_Context.hxx>
|
||||
|
||||
#include <TCollection_CompareOfInteger.hxx>
|
||||
#include <TColStd_Array1OfInteger.hxx>
|
||||
#include <SortTools_QuickSortOfInteger.hxx>
|
||||
|
||||
static
|
||||
Standard_Boolean IsClosedShell(const TopoDS_Shell& aSh);
|
||||
|
||||
static
|
||||
void OwnInternalShapes(const TopoDS_Shape& ,
|
||||
@@ -149,7 +142,6 @@ void BOPAlgo_Builder::FillImagesSolids()
|
||||
Handle(NCollection_IncAllocator) aAlr;
|
||||
//
|
||||
aAlr=new NCollection_IncAllocator();
|
||||
//
|
||||
BOPCol_DataMapOfShapeListOfShape theInParts(100, aAlr);
|
||||
BOPCol_DataMapOfShapeShape theDraftSolids(100, aAlr);
|
||||
//
|
||||
@@ -223,6 +215,23 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts
|
||||
}
|
||||
}//for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
// 1.2. Prepare TreeFiller
|
||||
BOPCol_BoxBndTree aBBTree;
|
||||
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
|
||||
//
|
||||
aItDMISB.Initialize(aDMISB);
|
||||
for (; aItDMISB.More(); aItDMISB.Next()) {
|
||||
k=aItDMISB.Key();
|
||||
const BOPAlgo_ShapeBox& aSBk=aItDMISB.Value();
|
||||
const Bnd_Box& aBk=aSBk.Box();
|
||||
//
|
||||
aTreeFiller.Add(k, aBk);
|
||||
}
|
||||
//
|
||||
// 1.3. Shake TreeFiller
|
||||
aTreeFiller.Fill();
|
||||
//
|
||||
//---------------------------------------------
|
||||
// 2. Solids
|
||||
for (i=0; i<aNbS; ++i) {
|
||||
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
|
||||
@@ -239,10 +248,7 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts
|
||||
BOPCol_ListOfShape aLIF(aAlr1);
|
||||
BOPCol_IndexedMapOfShape aMF(100, aAlr1);
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, aAlr1);
|
||||
//
|
||||
BOPDS_BoxBndTreeSelector aSelector;
|
||||
BOPDS_BoxBndTree aBBTree;
|
||||
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
|
||||
BOPCol_BoxBndTreeSelector aSelector;
|
||||
Bnd_Box aBoxS;
|
||||
//
|
||||
const TopoDS_Shape& aS=aSI.Shape();
|
||||
@@ -259,8 +265,8 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts
|
||||
}
|
||||
}
|
||||
//
|
||||
// 2.1 Compute Bnd_Box for the solid aS [ aBoxS ]
|
||||
BuildBndBox(i, aBoxS);
|
||||
// 2.1 Bounding box for the solid aS [ aBoxS ]
|
||||
aBoxS=aSI.Box();
|
||||
//-----
|
||||
//
|
||||
// 2.2 Build Draft Solid [aSD]
|
||||
@@ -280,42 +286,15 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts
|
||||
aMF.Add(aFI);
|
||||
}
|
||||
//
|
||||
// 2.4. Prepare TreeFiller
|
||||
aItDMISB.Initialize(aDMISB);
|
||||
for (; aItDMISB.More(); aItDMISB.Next()) {
|
||||
k=aItDMISB.Key();
|
||||
const BOPAlgo_ShapeBox& aSBk=aItDMISB.Value();
|
||||
const TopoDS_Shape& aFk=aSBk.Shape();
|
||||
if (aMF.Contains(aFk)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const Bnd_Box& aBk=aSBk.Box();
|
||||
//
|
||||
aTreeFiller.Add(k, aBk);
|
||||
}
|
||||
//
|
||||
// 2.5. Shake TreeFiller
|
||||
aTreeFiller.Fill();
|
||||
//
|
||||
// 2.6. Select boxes of faces that are not out of aBoxS
|
||||
// 2.4. Select boxes of faces that are not out of aBoxS
|
||||
aSelector.Clear();
|
||||
aSelector.SetBox(aBoxS);
|
||||
//
|
||||
aNbFP=aBBTree.Select(aSelector);
|
||||
if (aNbFP) {
|
||||
const BOPCol_ListOfInteger& aLIFP=aSelector.Indices();
|
||||
//sort indices
|
||||
TColStd_Array1OfInteger anArray(1, aNbFP);
|
||||
aItLI.Initialize(aLIFP);
|
||||
for (k = 1; aItLI.More(); aItLI.Next(), ++k) {
|
||||
nFP=aItLI.Value();
|
||||
anArray(k) = nFP;
|
||||
}
|
||||
TCollection_CompareOfInteger comp;
|
||||
SortTools_QuickSortOfInteger::Sort(anArray,comp);
|
||||
//
|
||||
// 2.7. Collect faces that are IN aSolid [ aLFIN ]
|
||||
const BOPCol_ListOfInteger& aLIFP=aSelector.Indices();
|
||||
//
|
||||
// 2.5. Collect faces that are IN aSolid [ aLFIN ]
|
||||
BOPCol_ListOfShape aLFP(aAlr1);
|
||||
BOPCol_ListOfShape aLCBF(aAlr1);
|
||||
BOPCol_MapOfShape aMFDone(100, aAlr1);
|
||||
@@ -323,10 +302,14 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts
|
||||
//
|
||||
BOPTools::MapShapes(aSD, TopAbs_EDGE, aME);
|
||||
//
|
||||
for (k = 1; k <= aNbFP; ++k) {
|
||||
nFP = anArray(k);
|
||||
aItLI.Initialize(aLIFP);
|
||||
for (; aItLI.More(); aItLI.Next()) {
|
||||
nFP=aItLI.Value();
|
||||
const BOPAlgo_ShapeBox& aSBF=aDMISB.Find(nFP);
|
||||
const TopoDS_Face& aFP=(*(TopoDS_Face*)&aSBF.Shape());
|
||||
if (aMF.Contains(aFP)) {
|
||||
continue;
|
||||
}
|
||||
if (aMFDone.Contains(aFP)) {
|
||||
continue;
|
||||
}
|
||||
@@ -365,8 +348,7 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts
|
||||
}
|
||||
}// for (; aItLI.More(); aItLI.Next()) {
|
||||
//
|
||||
}
|
||||
// 2.8. Store the results in theInParts, theDraftSolids
|
||||
// 2.6. Store the results in theInParts, theDraftSolids
|
||||
aNbFIN=aLFIN.Extent();
|
||||
if (aNbFIN || aNbLIF) {
|
||||
aItLS.Initialize(aLIF);
|
||||
@@ -486,7 +468,7 @@ void BOPAlgo_Builder::BuildSplitSolids(BOPCol_DataMapOfShapeListOfShape& theInPa
|
||||
myErrorStatus=0;
|
||||
//
|
||||
Standard_Boolean bFlagSD;
|
||||
Standard_Integer i, aNbS, iErr, aNbSFS;
|
||||
Standard_Integer i, aNbS;
|
||||
TopExp_Explorer aExp;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
BOPCol_DataMapIteratorOfDataMapOfShapeShape aIt1;
|
||||
@@ -497,6 +479,7 @@ void BOPAlgo_Builder::BuildSplitSolids(BOPCol_DataMapOfShapeListOfShape& theInPa
|
||||
BOPCol_ListOfShape aSFS(aAlr0), aLSEmpty(aAlr0);
|
||||
BOPCol_MapOfShape aMFence(100, aAlr0);
|
||||
BOPTools_MapOfSet aMST(100, aAlr0);
|
||||
BOPAlgo_VectorOfBuilderSolid aVBS;
|
||||
//
|
||||
// 0. Find same domain solids for non-interferred solids
|
||||
aNbS=myDS->NbSourceShapes();
|
||||
@@ -531,6 +514,7 @@ void BOPAlgo_Builder::BuildSplitSolids(BOPCol_DataMapOfShapeListOfShape& theInPa
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape& aS=aSI.Shape();
|
||||
const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
|
||||
if(!theDraftSolids.IsBound(aS)) {
|
||||
continue;
|
||||
}
|
||||
@@ -556,27 +540,28 @@ void BOPAlgo_Builder::BuildSplitSolids(BOPCol_DataMapOfShapeListOfShape& theInPa
|
||||
aSFS.Append(aF);
|
||||
}
|
||||
//
|
||||
aNbSFS=aSFS.Extent();
|
||||
//
|
||||
// 1.3 Build new solids
|
||||
Handle(NCollection_IncAllocator) aAlr1;
|
||||
aAlr1=new NCollection_IncAllocator();
|
||||
//
|
||||
BOPAlgo_BuilderSolid aSB(aAlr1);
|
||||
BOPAlgo_BuilderSolid& aBS=aVBS.Append1();
|
||||
aBS.SetSolid(aSolid);
|
||||
aBS.SetShapes(aSFS);
|
||||
}//for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
//aSB.SetContext(myContext);
|
||||
aSB.SetShapes(aSFS);
|
||||
aSB.Perform();
|
||||
iErr=aSB.ErrorStatus();
|
||||
if (iErr) {
|
||||
myErrorStatus=30; // SolidBuilder failed
|
||||
return;
|
||||
}
|
||||
Standard_Integer k, aNbBS;
|
||||
//
|
||||
const BOPCol_ListOfShape& aLSR=aSB.Areas();
|
||||
aNbBS=aVBS.Extent();
|
||||
//
|
||||
//===================================================
|
||||
BOPAlgo_BuilderSolidCnt::Perform(myRunParallel, aVBS);
|
||||
//===================================================
|
||||
//
|
||||
for (k=0; k<aNbBS; ++k) {
|
||||
BOPAlgo_BuilderSolid& aBS=aVBS(k);
|
||||
const TopoDS_Solid& aS=aBS.Solid();
|
||||
const BOPCol_ListOfShape& aLSR=aBS.Areas();
|
||||
//
|
||||
// 1.4 Collect resulting solids and theirs set of faces.
|
||||
// Update Images.
|
||||
if (!myImages.IsBound(aS)) {
|
||||
BOPCol_ListOfShape aLSx;
|
||||
//
|
||||
@@ -601,9 +586,8 @@ void BOPAlgo_Builder::BuildSplitSolids(BOPCol_DataMapOfShapeListOfShape& theInPa
|
||||
}
|
||||
}
|
||||
}
|
||||
}// for (i=0; i<aNbS; ++i) {
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function :FillInternalShapes
|
||||
//purpose :
|
||||
@@ -612,7 +596,7 @@ void BOPAlgo_Builder::FillInternalShapes()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
Standard_Integer i, j, aNbS, aNbSI, aNbSx, aNbSd;
|
||||
Standard_Integer i, j, aNbS, aNbSI, aNbSx;
|
||||
TopAbs_ShapeEnum aType;
|
||||
TopAbs_State aState;
|
||||
TopoDS_Iterator aItS;
|
||||
@@ -743,8 +727,6 @@ void BOPAlgo_Builder::FillInternalShapes()
|
||||
}
|
||||
}// for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
aNbSd=aLSd.Extent();
|
||||
//
|
||||
// 3. Some shapes of aMSI can be already tied with faces of
|
||||
// split solids
|
||||
aItM.Initialize(aMSI);
|
||||
@@ -824,85 +806,6 @@ void BOPAlgo_Builder::FillInternalShapes()
|
||||
aMSx.Clear();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : BuildBndBox
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Builder::BuildBndBox(const Standard_Integer theIndex,
|
||||
Bnd_Box& aBoxS)
|
||||
{
|
||||
Standard_Boolean bIsOpenBox;
|
||||
Standard_Integer nSh, nFc;
|
||||
Standard_Real aTolS, aTolFc;
|
||||
TopAbs_State aState;
|
||||
BOPCol_ListIteratorOfListOfInteger aItLI, aItLI1;
|
||||
//
|
||||
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(theIndex);
|
||||
const TopoDS_Shape& aS=aSI.Shape();
|
||||
const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
|
||||
//
|
||||
bIsOpenBox=Standard_False;
|
||||
//
|
||||
aTolS=0.;
|
||||
const BOPCol_ListOfInteger& aLISh=aSI.SubShapes();
|
||||
aItLI.Initialize(aLISh);
|
||||
for (; aItLI.More(); aItLI.Next()) {
|
||||
nSh=aItLI.Value();
|
||||
const BOPDS_ShapeInfo& aSISh=myDS->ShapeInfo(nSh);
|
||||
if (aSISh.ShapeType()!=TopAbs_SHELL) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLIFc=aSISh.SubShapes();
|
||||
aItLI1.Initialize(aLIFc);
|
||||
for (; aItLI1.More(); aItLI1.Next()) {
|
||||
nFc=aItLI1.Value();
|
||||
const BOPDS_ShapeInfo& aSIFc=myDS->ShapeInfo(nFc);
|
||||
if (aSIFc.ShapeType()!=TopAbs_FACE) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const Bnd_Box& aBFc=aSIFc.Box();
|
||||
aBoxS.Add(aBFc);
|
||||
//
|
||||
if (!bIsOpenBox) {
|
||||
bIsOpenBox=(aBFc.IsOpenXmin() || aBFc.IsOpenXmax() ||
|
||||
aBFc.IsOpenYmin() || aBFc.IsOpenYmax() ||
|
||||
aBFc.IsOpenZmin() || aBFc.IsOpenZmax());
|
||||
if (bIsOpenBox) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
const TopoDS_Face& aFc=*((TopoDS_Face*)&aSIFc.Shape());
|
||||
aTolFc=BRep_Tool::Tolerance(aFc);
|
||||
if (aTolFc>aTolS) {
|
||||
aTolS=aTolFc;
|
||||
}
|
||||
}//for (; aItLI1.More(); aItLI1.Next()) {
|
||||
if (bIsOpenBox) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shell& aSh=*((TopoDS_Shell*)&aSISh.Shape());
|
||||
bIsOpenBox=IsClosedShell(aSh);
|
||||
if (bIsOpenBox) {
|
||||
break;
|
||||
}
|
||||
}//for (; aItLI.More(); aItLI.Next()) {
|
||||
//
|
||||
if (bIsOpenBox) {
|
||||
aBoxS.SetWhole();
|
||||
}
|
||||
else {
|
||||
BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aSolid);
|
||||
aSC.PerformInfinitePoint(aTolS);
|
||||
aState=aSC.State();
|
||||
if (aState==TopAbs_IN) {
|
||||
aBoxS.SetWhole();
|
||||
}
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : OwnInternalShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
@@ -920,49 +823,6 @@ void BOPAlgo_Builder::BuildBndBox(const Standard_Integer theIndex,
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsClosedShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IsClosedShell(const TopoDS_Shell& aSh)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer i, aNbE, aNbF;
|
||||
TopAbs_Orientation aOrF;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
|
||||
BOPCol_ListIteratorOfListOfShape aItLS;
|
||||
//
|
||||
bRet=Standard_False;
|
||||
//
|
||||
BOPTools::MapShapesAndAncestors(aSh, 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;
|
||||
}
|
||||
//
|
||||
aNbF=0;
|
||||
const BOPCol_ListOfShape& aLF=aMEF(i);
|
||||
aItLS.Initialize(aLF);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aF=aItLS.Value();
|
||||
aOrF=aF.Orientation();
|
||||
if (aOrF==TopAbs_INTERNAL || aOrF==TopAbs_EXTERNAL) {
|
||||
continue;
|
||||
}
|
||||
++aNbF;
|
||||
}
|
||||
//
|
||||
if (aNbF==1) {
|
||||
bRet=!bRet; // True
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : TreatCompound
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
@@ -29,55 +29,9 @@
|
||||
//function : Generated
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const TopTools_ListOfShape& BOPAlgo_Builder::Generated(const TopoDS_Shape& theS)
|
||||
const TopTools_ListOfShape& BOPAlgo_Builder::Generated(const TopoDS_Shape&)
|
||||
{
|
||||
Standard_Boolean bHasImage, bToReverse;
|
||||
TopAbs_ShapeEnum aType;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
//
|
||||
myHistShapes.Clear();
|
||||
//
|
||||
if (theS.IsNull()) {
|
||||
return myHistShapes;
|
||||
}
|
||||
//
|
||||
bHasImage=myImages.IsBound(theS);
|
||||
if (!bHasImage) {
|
||||
return myHistShapes;
|
||||
}
|
||||
//
|
||||
aType=theS.ShapeType();
|
||||
//
|
||||
if (!(aType==TopAbs_EDGE || aType==TopAbs_FACE ||
|
||||
aType==TopAbs_VERTEX || aType==TopAbs_SOLID)) {
|
||||
return myHistShapes;
|
||||
}
|
||||
//
|
||||
//PrepareHistory();
|
||||
//
|
||||
const BOPCol_ListOfShape& aLSp=myImages.Find(theS);
|
||||
aIt.Initialize(aLSp);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aSp=aIt.Value();
|
||||
if (myShapesSD.IsBound(aSp)) {
|
||||
if (myMapShape.Contains(aSp)) {
|
||||
TopoDS_Shape aSpR=myShapesSD.Find(aSp);
|
||||
//
|
||||
if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||
aSpR.Orientation(theS.Orientation());
|
||||
}
|
||||
else {
|
||||
bToReverse=BOPTools_AlgoTools::IsSplitToReverse(aSpR, theS, myContext);
|
||||
if (bToReverse) {
|
||||
aSpR.Reverse();
|
||||
}
|
||||
}
|
||||
//
|
||||
myHistShapes.Append(aSpR);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
return myHistShapes;
|
||||
}
|
||||
//=======================================================================
|
||||
@@ -114,7 +68,10 @@
|
||||
aIt.Initialize(aLSp);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
TopoDS_Shape aSp=aIt.Value();
|
||||
if (!myShapesSD.IsBound(aSp)) {
|
||||
if (myShapesSD.IsBound(aSp)) {
|
||||
aSp = myShapesSD.Find(aSp);
|
||||
}
|
||||
//
|
||||
if (myMapShape.Contains(aSp)) {
|
||||
//
|
||||
if (aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||
@@ -130,7 +87,6 @@
|
||||
myHistShapes.Append(aSp);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
return myHistShapes;
|
||||
}
|
||||
@@ -201,7 +157,7 @@
|
||||
return;
|
||||
}
|
||||
//
|
||||
Standard_Boolean bHasImage, bContainsSD;
|
||||
Standard_Boolean bHasImage;
|
||||
TopAbs_ShapeEnum aType;
|
||||
BOPCol_MapOfShape aMS;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
@@ -254,55 +210,19 @@
|
||||
myHasDeleted=IsDeleted(aSx);
|
||||
}
|
||||
//
|
||||
if (!myHasGenerated || !myHasModified) {
|
||||
if (!myHasModified && bHasImage) {
|
||||
if (aType==TopAbs_EDGE || aType==TopAbs_FACE ||
|
||||
aType==TopAbs_VERTEX || aType==TopAbs_SOLID) {
|
||||
if (bHasImage) {
|
||||
const BOPCol_ListOfShape& aLSp=myImages.Find(aSx);
|
||||
aIt.Initialize(aLSp);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aSp=aIt.Value();
|
||||
//
|
||||
if (myMapShape.Contains(aSp)) {
|
||||
bContainsSD=myShapesSD.IsBound(aSp);
|
||||
myHasModified = Standard_True;
|
||||
}
|
||||
}
|
||||
//
|
||||
if (!myHasGenerated) {
|
||||
if (bContainsSD) {
|
||||
myHasGenerated=Standard_True;
|
||||
}
|
||||
}
|
||||
if (!myHasModified) {
|
||||
if (!bContainsSD) {
|
||||
myHasModified=Standard_True;
|
||||
}
|
||||
}
|
||||
} // if (myMapShape.Contains(aSp))
|
||||
}
|
||||
}
|
||||
if (aType==TopAbs_FACE) {
|
||||
const TopTools_ListOfShape& aLG = Generated(aSx);
|
||||
myHasGenerated = aLG.Extent() > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
myFlagHistory=Standard_True;
|
||||
}
|
||||
|
||||
// <- A
|
||||
/*
|
||||
BOPCol_ListOfShape aLSx;
|
||||
if (!bHasImage) {
|
||||
if (myMapShape.Contains(aSx)) {
|
||||
aLSx.Append(aSx);
|
||||
myImagesResult.Add(aSx, aLSx);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const BOPCol_ListOfShape& aLSp=myImages.Find(aSx);
|
||||
aIt.Initialize(aLSp);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aSp=aIt.Value();
|
||||
if (myMapShape.Contains(aSp)) {
|
||||
aLSx.Append(aSp);
|
||||
}
|
||||
}
|
||||
myImagesResult.Add(aSx, aLSx);
|
||||
}
|
||||
*/
|
||||
|
@@ -50,6 +50,21 @@ is
|
||||
is protected;
|
||||
---Purpose: Provides post-tratment actions
|
||||
|
||||
PerformVZ(me:out)
|
||||
is virtual protected;
|
||||
--Purpose: Computes Vertex/Solid interferences
|
||||
|
||||
PerformEZ(me:out)
|
||||
is virtual protected;
|
||||
--Purpose: Computes Edge/Solid interferences
|
||||
|
||||
PerformFZ(me:out)
|
||||
is virtual protected;
|
||||
--Purpose: Computes Face/Solid interferences
|
||||
PerformZZ(me:out)
|
||||
is virtual protected;
|
||||
--Purpose: Computes Solid/Solid interferences
|
||||
|
||||
|
||||
fields
|
||||
myLevelOfCheck: Integer from Standard is protected;
|
||||
|
@@ -44,9 +44,9 @@
|
||||
//=======================================================================
|
||||
BOPAlgo_CheckerSI::BOPAlgo_CheckerSI()
|
||||
:
|
||||
BOPAlgo_PaveFiller(),
|
||||
myLevelOfCheck(5)
|
||||
BOPAlgo_PaveFiller()
|
||||
{
|
||||
myLevelOfCheck=BOPDS_DS::NbInterfTypes()-1;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
@@ -61,7 +61,10 @@ BOPAlgo_CheckerSI::~BOPAlgo_CheckerSI()
|
||||
//=======================================================================
|
||||
void BOPAlgo_CheckerSI::SetLevelOfCheck(const Standard_Integer theLevel)
|
||||
{
|
||||
if (theLevel >= 0 && theLevel <= 5) {
|
||||
Standard_Integer aNbLists;
|
||||
//
|
||||
aNbLists=BOPDS_DS::NbInterfTypes();
|
||||
if (theLevel >= 0 && theLevel < aNbLists) {
|
||||
myLevelOfCheck = theLevel;
|
||||
}
|
||||
}
|
||||
@@ -104,7 +107,7 @@ void BOPAlgo_CheckerSI::Init()
|
||||
//=======================================================================
|
||||
void BOPAlgo_CheckerSI::Perform()
|
||||
{
|
||||
//modified by NIZNHY-PKV Thu Sep 19 08:14:52 2013f
|
||||
|
||||
try {
|
||||
OCC_CATCH_SIGNALS
|
||||
//
|
||||
@@ -113,19 +116,31 @@ void BOPAlgo_CheckerSI::Perform()
|
||||
return;
|
||||
}
|
||||
//
|
||||
PostTreat();
|
||||
PerformVZ();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
//
|
||||
PerformEZ();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
/*
|
||||
BOPAlgo_PaveFiller::Perform();
|
||||
//
|
||||
PerformFZ();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
PerformZZ();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
PostTreat();
|
||||
*/
|
||||
//modified by NIZNHY-PKV Thu Sep 19 08:14:56 2013t
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
}
|
||||
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PostTreat
|
||||
@@ -237,4 +252,49 @@ void BOPAlgo_CheckerSI::PostTreat()
|
||||
aPK.SetIds(n1, n2);
|
||||
aMPK.Add(aPK);
|
||||
}
|
||||
//
|
||||
//
|
||||
// 6
|
||||
BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ();
|
||||
aNb=aVZs.Extent();
|
||||
for (i=0; i!=aNb; ++i) {
|
||||
//
|
||||
const BOPDS_InterfVZ& aVZ=aVZs(i);
|
||||
aVZ.Indices(n1, n2);
|
||||
aPK.SetIds(n1, n2);
|
||||
aMPK.Add(aPK);
|
||||
}
|
||||
//
|
||||
// 7
|
||||
BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
|
||||
aNb=aEZs.Extent();
|
||||
for (i=0; i!=aNb; ++i) {
|
||||
//
|
||||
const BOPDS_InterfEZ& aEZ=aEZs(i);
|
||||
aEZ.Indices(n1, n2);
|
||||
aPK.SetIds(n1, n2);
|
||||
aMPK.Add(aPK);
|
||||
}
|
||||
//
|
||||
// 8
|
||||
BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
|
||||
aNb=aFZs.Extent();
|
||||
for (i=0; i!=aNb; ++i) {
|
||||
//
|
||||
const BOPDS_InterfFZ& aFZ=aFZs(i);
|
||||
aFZ.Indices(n1, n2);
|
||||
aPK.SetIds(n1, n2);
|
||||
aMPK.Add(aPK);
|
||||
}
|
||||
//
|
||||
// 9
|
||||
BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
|
||||
aNb=aZZs.Extent();
|
||||
for (i=0; i!=aNb; ++i) {
|
||||
//
|
||||
const BOPDS_InterfZZ& aZZ=aZZs(i);
|
||||
aZZ.Indices(n1, n2);
|
||||
aPK.SetIds(n1, n2);
|
||||
aMPK.Add(aPK);
|
||||
}
|
||||
}
|
||||
|
227
src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx
Normal file
227
src/BOPAlgo/BOPAlgo_CheckerSI_1.cxx
Normal file
@@ -0,0 +1,227 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 2010-2012 OPEN CASCADE SAS
|
||||
// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
|
||||
// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
//
|
||||
#include <BOPAlgo_CheckerSI.ixx>
|
||||
|
||||
#include <BOPDS_DS.hxx>
|
||||
#include <BOPDS_IteratorSI.hxx>
|
||||
#include <BOPInt_Context.hxx>
|
||||
|
||||
#include <BOPDS_Interf.hxx>
|
||||
#include <TopoDS_Solid.hxx>
|
||||
#include <BRepClass3d_SolidClassifier.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TopAbs_State.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BOPDS_VectorOfInterfVZ.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : PerformVZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_CheckerSI::PerformVZ()
|
||||
{
|
||||
Standard_Boolean bJustAdd;
|
||||
Standard_Integer iSize, nV, nZ, i;
|
||||
Standard_Real aTol;
|
||||
gp_Pnt aPV;
|
||||
TopAbs_State aState;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
myIterator->Initialize(TopAbs_VERTEX, TopAbs_SOLID);
|
||||
iSize=myIterator->ExpectedLength();
|
||||
if (!iSize) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ();
|
||||
aVZs.SetStartSize(iSize);
|
||||
aVZs.SetIncrement(iSize);
|
||||
aVZs.Init();
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nV, nZ, bJustAdd);
|
||||
if(bJustAdd) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
|
||||
const BOPDS_ShapeInfo& aSIZ=myDS->ShapeInfo(nZ);
|
||||
//
|
||||
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aSIV.Shape());
|
||||
const TopoDS_Solid& aZ=*((TopoDS_Solid*)&aSIZ.Shape());
|
||||
//
|
||||
BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ);
|
||||
//
|
||||
aPV=BRep_Tool::Pnt(aV);
|
||||
aTol=BRep_Tool::Tolerance(aV);
|
||||
//
|
||||
aSC.Perform(aPV, aTol);
|
||||
//
|
||||
aState=aSC.State();
|
||||
if (aState==TopAbs_IN) {
|
||||
i=aVZs.Append()-1;
|
||||
BOPDS_InterfVZ& aVZ=aVZs(i);
|
||||
aVZ.SetIndices(nV, nZ);
|
||||
//
|
||||
myDS->AddInterf(nV, nZ);
|
||||
}
|
||||
}
|
||||
//
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformEZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_CheckerSI::PerformEZ()
|
||||
{
|
||||
Standard_Boolean bJustAdd, bHasInterf;
|
||||
Standard_Integer iSize, nE, nZ, i;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
myIterator->Initialize(TopAbs_EDGE, TopAbs_SOLID);
|
||||
iSize=myIterator->ExpectedLength();
|
||||
if (!iSize) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
|
||||
aEZs.SetStartSize(iSize);
|
||||
aEZs.SetIncrement(iSize);
|
||||
aEZs.Init();
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nE, nZ, bJustAdd);
|
||||
if(bJustAdd) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nE, nZ);
|
||||
if (bHasInterf) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nE);
|
||||
if (!bHasInterf) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
i=aEZs.Append()-1;
|
||||
BOPDS_InterfEZ& aEZ=aEZs(i);
|
||||
aEZ.SetIndices(nE, nZ);
|
||||
//
|
||||
myDS->AddInterf(nE, nZ);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformFZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_CheckerSI::PerformFZ()
|
||||
{
|
||||
Standard_Boolean bJustAdd, bHasInterf;
|
||||
Standard_Integer iSize, nF, nZ, i;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
myIterator->Initialize(TopAbs_FACE, TopAbs_SOLID);
|
||||
iSize=myIterator->ExpectedLength();
|
||||
if (!iSize) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
|
||||
aFZs.SetStartSize(iSize);
|
||||
aFZs.SetIncrement(iSize);
|
||||
aFZs.Init();
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nF, nZ, bJustAdd);
|
||||
if(bJustAdd) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nF, nZ);
|
||||
if (bHasInterf) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nF);
|
||||
if (!bHasInterf) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
i=aFZs.Append()-1;
|
||||
BOPDS_InterfFZ& aFZ=aFZs(i);
|
||||
aFZ.SetIndices(nF, nZ);
|
||||
//
|
||||
myDS->AddInterf(nF, nZ);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : PerformZZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_CheckerSI::PerformZZ()
|
||||
{
|
||||
Standard_Boolean bJustAdd, bHasInterf, bFlag;
|
||||
Standard_Integer iSize, nZ1, nZ, i;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
myIterator->Initialize(TopAbs_SOLID, TopAbs_SOLID);
|
||||
iSize=myIterator->ExpectedLength();
|
||||
if (!iSize) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
|
||||
aZZs.SetStartSize(iSize);
|
||||
aZZs.SetIncrement(iSize);
|
||||
aZZs.Init();
|
||||
//
|
||||
bFlag=Standard_False;
|
||||
//
|
||||
for (; myIterator->More(); myIterator->Next()) {
|
||||
myIterator->Value(nZ1, nZ, bJustAdd);
|
||||
if(bJustAdd) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nZ1, bFlag);
|
||||
if (!bHasInterf) {
|
||||
bHasInterf=myDS->HasInterfShapeSubShapes(nZ1, nZ, bFlag);
|
||||
}
|
||||
if (!bHasInterf) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
i=aZZs.Append()-1;
|
||||
BOPDS_InterfZZ& aZZ=aZZs(i);
|
||||
aZZ.SetIndices(nZ1, nZ);
|
||||
//
|
||||
myDS->AddInterf(nZ1, nZ);
|
||||
}
|
||||
}
|
@@ -183,7 +183,6 @@
|
||||
return;
|
||||
}
|
||||
// 12
|
||||
|
||||
PerformEF();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
|
@@ -44,7 +44,7 @@
|
||||
void BOPAlgo_PaveFiller::PerformVV()
|
||||
{
|
||||
Standard_Boolean bWithSubShape;
|
||||
Standard_Integer n1, n2, iFlag, nX, n, aSize, i, aNbVV, j, iX, k, aNbBlocks;
|
||||
Standard_Integer n1, n2, iFlag, nX, n, aSize, i, j, iX, k, aNbBlocks;
|
||||
Handle(NCollection_IncAllocator) aAllocator;
|
||||
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItMILI;
|
||||
BOPCol_ListIteratorOfListOfInteger aItLI, aItLI2;
|
||||
@@ -131,7 +131,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
aNbVV=aVVs.Extent();
|
||||
//
|
||||
//-----------------------------------------------------scope t
|
||||
aLV.Clear();
|
||||
|
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
|
||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
@@ -42,6 +44,7 @@
|
||||
#include <BOPCol_DataMapOfShapeInteger.hxx>
|
||||
#include <BOPCol_DataMapOfIntegerShape.hxx>
|
||||
#include <BOPCol_IndexedDataMapOfShapeBox.hxx>
|
||||
#include <BOPCol_BoxBndTree.hxx>
|
||||
//
|
||||
#include <BOPInt_Context.hxx>
|
||||
#include <BOPInt_ShrunkRange.hxx>
|
||||
@@ -56,16 +59,15 @@
|
||||
#include <BOPDS_VectorOfInterfEE.hxx>
|
||||
#include <BOPDS_Interf.hxx>
|
||||
#include <BOPDS_Pave.hxx>
|
||||
#include <BOPDS_BoxBndTree.hxx>
|
||||
|
||||
//
|
||||
#include <BOPAlgo_Tools.hxx>
|
||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
// function: PerformEE
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPAlgo_PaveFiller::PerformEE()
|
||||
void BOPAlgo_PaveFiller::PerformEE()
|
||||
{
|
||||
Standard_Boolean bJustAdd, bOrder;
|
||||
Standard_Integer i, iX, iSize, nE1, nE2, aDiscretize;
|
||||
@@ -328,14 +330,11 @@
|
||||
break;
|
||||
//
|
||||
case TopAbs_EDGE: {
|
||||
Standard_Boolean bHasSameBounds;
|
||||
Standard_Integer aNbComPrt2;
|
||||
//
|
||||
aNbComPrt2=aCPart.Ranges2().Length();
|
||||
if (aNbComPrt2>1){
|
||||
if (aNbCPrts > 1) {
|
||||
break;
|
||||
}
|
||||
//// <-LXBR
|
||||
//
|
||||
Standard_Boolean bHasSameBounds;
|
||||
bHasSameBounds=aPB1->HasSameBounds(aPB2);
|
||||
if (!bHasSameBounds) {
|
||||
break;
|
||||
@@ -388,7 +387,7 @@
|
||||
//function : PerformVertices
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEE
|
||||
Standard_Integer BOPAlgo_PaveFiller::PerformVerticesEE
|
||||
(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
|
||||
Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
{
|
||||
@@ -523,8 +522,8 @@
|
||||
//function : TreatNewVertices
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_PaveFiller::TreatNewVertices(
|
||||
const BOPCol_IndexedDataMapOfShapeInteger& aMapVI,
|
||||
void BOPAlgo_PaveFiller::TreatNewVertices
|
||||
(const BOPCol_IndexedDataMapOfShapeInteger& aMapVI,
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape& myImages)
|
||||
{
|
||||
Standard_Integer j, i, aNbV, aNbVSD;
|
||||
@@ -538,8 +537,8 @@
|
||||
BOPCol_DataMapOfIntegerShape aMIS;
|
||||
BOPCol_IndexedDataMapOfShapeBox aMSB;
|
||||
//
|
||||
BOPDS_BoxBndTreeSelector aSelector;
|
||||
BOPDS_BoxBndTree aBBTree;
|
||||
BOPCol_BoxBndTreeSelector aSelector;
|
||||
BOPCol_BoxBndTree aBBTree;
|
||||
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
|
||||
//
|
||||
aNbV = aMapVI.Extent();
|
||||
@@ -661,7 +660,7 @@
|
||||
//function : FillShrunkData
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB)
|
||||
void BOPAlgo_PaveFiller::FillShrunkData(Handle(BOPDS_PaveBlock)& thePB)
|
||||
{
|
||||
Standard_Integer nE, nV1, nV2, iErr;
|
||||
Standard_Real aT1, aT2, aTS1, aTS2;
|
||||
|
@@ -231,7 +231,7 @@
|
||||
}
|
||||
//
|
||||
const gp_Pnt& aPnew = BRep_Tool::Pnt(aVnew);
|
||||
if (!myContext->IsValidPointForFace(aPnew, aF, aTolE)) {
|
||||
if (!myContext->IsValidPointForFace(aPnew, aF, aTolE+aTolF)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
|
@@ -271,7 +271,7 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
||||
Standard_Boolean bExist, bValid2D;
|
||||
Standard_Integer i, nF1, nF2, aNbC, aNbP, j;
|
||||
Standard_Integer nV1, nV2;
|
||||
Standard_Real aTolR3D, aTolR2D, aT1, aT2, aTol;
|
||||
Standard_Real aTolR3D, aT1, aT2, aTol;
|
||||
Handle(NCollection_IncAllocator) aAllocator;
|
||||
BOPDS_ListIteratorOfListOfPaveBlock aItLPB;
|
||||
TopoDS_Edge aES;
|
||||
@@ -310,7 +310,6 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
||||
const TopoDS_Face& aF2=(*(TopoDS_Face *)(&myDS->Shape(nF2)));
|
||||
//
|
||||
aTolR3D=aFF.TolR3D();
|
||||
aTolR2D=aFF.TolR2D();
|
||||
//
|
||||
// Update face info
|
||||
if (aMF.Add(nF1)) {
|
||||
|
@@ -72,7 +72,7 @@ static void UpdateVertices(const TopoDS_Edge& aE,
|
||||
}
|
||||
//
|
||||
Standard_Boolean bCB, bV1, bV2;
|
||||
Standard_Integer i, nE, nV1, nV2, nSp, aNbPB, nOrE;
|
||||
Standard_Integer i, nE, nV1, nV2, nSp, aNbPB;
|
||||
Standard_Real aT1, aT2;
|
||||
Handle(NCollection_IncAllocator) aAllocator;
|
||||
BOPDS_ListIteratorOfListOfPaveBlock aItPB, aItPBCB;
|
||||
@@ -90,7 +90,6 @@ static void UpdateVertices(const TopoDS_Edge& aE,
|
||||
//DEBf
|
||||
if (aNbPB) {
|
||||
aPBx=aLPB.First();
|
||||
nOrE=aPBx->OriginalEdge();
|
||||
}
|
||||
//DEBt
|
||||
if (aNbPB==1) {
|
||||
|
@@ -243,7 +243,7 @@ static
|
||||
const BOPDS_ListOfPaveBlock& aLPBOut,
|
||||
const Handle(BOPDS_PaveBlock)& aPBD)
|
||||
{
|
||||
Standard_Boolean bXDir, bIsDone, bReject;
|
||||
Standard_Boolean bXDir, bIsDone;
|
||||
Standard_Integer nE, aNbPoints, j;
|
||||
Standard_Real aTD1, aTD2, aT1, aT2, aTolInter, aX, aDT;
|
||||
Standard_Real aTolCmp;
|
||||
@@ -329,7 +329,6 @@ static
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bReject=Standard_False;
|
||||
if (aPBD->ContainsParameter(aX, aDT)) {
|
||||
continue;
|
||||
}
|
||||
|
@@ -1,73 +0,0 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and/or modify it under
|
||||
-- the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
|
||||
class ShellSplitter from BOPAlgo
|
||||
inherits Algo from BOPAlgo
|
||||
|
||||
---Purpose:
|
||||
-- The class provides the splitting of the set of connected faces
|
||||
-- on separate loops
|
||||
uses
|
||||
BaseAllocator from BOPCol,
|
||||
Shape from TopoDS,
|
||||
ListOfShape from BOPCol,
|
||||
ConnexityBlock from BOPTools,
|
||||
ListOfConnexityBlock from BOPTools
|
||||
|
||||
|
||||
--raises
|
||||
|
||||
is
|
||||
Create
|
||||
returns ShellSplitter from BOPAlgo;
|
||||
---C++: alias "Standard_EXPORT virtual ~BOPAlgo_ShellSplitter();"
|
||||
---Purpose: empty constructor
|
||||
|
||||
Create(theAllocator: BaseAllocator from BOPCol)
|
||||
returns ShellSplitter from BOPAlgo;
|
||||
---Purpose: constructor
|
||||
|
||||
AddStartElement(me:out;
|
||||
theS: Shape from TopoDS);
|
||||
---Purpose: adds a face <theS> to process
|
||||
|
||||
StartElements(me)
|
||||
returns ListOfShape from BOPCol;
|
||||
---C++: return const &
|
||||
---Purpose: return the faces to process
|
||||
|
||||
Perform(me:out)
|
||||
is redefined;
|
||||
---Purpose: performs the algorithm
|
||||
|
||||
Shells(me)
|
||||
returns ListOfShape from BOPCol;
|
||||
---C++: return const &
|
||||
---Purpose: returns the loops
|
||||
|
||||
MakeConnexityBlocks(me:out)
|
||||
is protected;
|
||||
|
||||
MakeShells (me:out)
|
||||
is protected;
|
||||
|
||||
SplitBlock(myclass;
|
||||
theCB:out ConnexityBlock from BOPTools);
|
||||
|
||||
fields
|
||||
myStartShapes: ListOfShape from BOPCol is protected;
|
||||
myShells: ListOfShape from BOPCol is protected;
|
||||
myLCB : ListOfConnexityBlock from BOPTools is protected;
|
||||
|
||||
end ShellSplitter;
|
@@ -1,612 +0,0 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// File: BOPAlgo_ShellSplitter.cxx
|
||||
// Created: Thu Jan 16 08:33:50 2014
|
||||
// <pkv@PETREX>
|
||||
|
||||
#include <BOPAlgo_ShellSplitter.ixx>
|
||||
//
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <TopExp_Explorer.hxx>
|
||||
//
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BOPCol_MapOfOrientedShape.hxx>
|
||||
#include <BOPCol_NCVector.hxx>
|
||||
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
//
|
||||
#include <BOPInt_Context.hxx>
|
||||
//
|
||||
#include <BOPTools.hxx>
|
||||
#include <BOPTools_AlgoTools.hxx>
|
||||
#include <BOPTools_CoupleOfShape.hxx>
|
||||
|
||||
//
|
||||
static
|
||||
void MakeShell(const BOPCol_ListOfShape& ,
|
||||
TopoDS_Shell& );
|
||||
//
|
||||
static
|
||||
void RefineShell(TopoDS_Shell& theShell);
|
||||
//
|
||||
static
|
||||
Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell);
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_ShellSplitter::BOPAlgo_ShellSplitter()
|
||||
:
|
||||
BOPAlgo_Algo(),
|
||||
myStartShapes(myAllocator),
|
||||
myShells(myAllocator),
|
||||
myLCB(myAllocator)
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_ShellSplitter::BOPAlgo_ShellSplitter
|
||||
(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
:
|
||||
BOPAlgo_Algo(theAllocator),
|
||||
myStartShapes(theAllocator),
|
||||
myShells(theAllocator),
|
||||
myLCB(myAllocator)
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_ShellSplitter::~BOPAlgo_ShellSplitter()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : AddStartElement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_ShellSplitter::AddStartElement(const TopoDS_Shape& aE)
|
||||
{
|
||||
myStartShapes.Append(aE);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : StartElements
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BOPCol_ListOfShape& BOPAlgo_ShellSplitter::StartElements()const
|
||||
{
|
||||
return myStartShapes;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Loops
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BOPCol_ListOfShape& BOPAlgo_ShellSplitter::Shells()const
|
||||
{
|
||||
return myShells;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_ShellSplitter::Perform()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
MakeConnexityBlocks();
|
||||
if (myErrorStatus) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
MakeShells();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MakeConnexityBlocks
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_ShellSplitter::MakeConnexityBlocks()
|
||||
{
|
||||
Standard_Boolean bRegular;
|
||||
Standard_Integer i, j, aNbE, aNbES, aNbEP, k, aNbCB;
|
||||
TopoDS_Shape aFR;
|
||||
TopExp_Explorer aExpF;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF(100, myAllocator);
|
||||
BOPCol_IndexedMapOfShape aMEP(100, myAllocator);
|
||||
BOPCol_IndexedMapOfShape aMFC(100, myAllocator);
|
||||
BOPCol_MapOfShape aMER(100, myAllocator);
|
||||
BOPCol_MapOfShape aMFP(100, myAllocator);
|
||||
BOPCol_IndexedMapOfShape aMEAdd(100, myAllocator);
|
||||
BOPCol_MapOfShape aMES(100, myAllocator);
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
//
|
||||
myLCB.Clear();
|
||||
//
|
||||
const BOPCol_ListOfShape& aLSE=myStartShapes;
|
||||
aIt.Initialize(aLSE);
|
||||
for (i=1; aIt.More(); aIt.Next(), ++i) {
|
||||
const TopoDS_Shape& aSE=aIt.Value();
|
||||
if (!aMEP.Contains(aSE)) {
|
||||
aMEP.Add(aSE);
|
||||
BOPTools::MapShapesAndAncestors(aSE,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEF);
|
||||
}
|
||||
else {
|
||||
aMER.Add(aSE);
|
||||
}
|
||||
}
|
||||
//
|
||||
// 2
|
||||
aNbE=aMEF.Extent();
|
||||
for (i=1; i<=aNbE; ++i) {
|
||||
aNbES=aMES.Extent();
|
||||
if (aNbES==aNbE) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape& aE=aMEF.FindKey(i);
|
||||
//
|
||||
if (!aMES.Add(aE)) {
|
||||
continue;
|
||||
}
|
||||
// aMES - globally processed edges
|
||||
//
|
||||
//------------------------------------- goal: aMEC
|
||||
aMFC.Clear(); // aMEC - edges of CB
|
||||
aMEP.Clear(); // aMVP - edges to process right now
|
||||
aMEAdd.Clear(); // aMVAdd edges to process on next step of for(;;) {
|
||||
//
|
||||
aMEP.Add(aE);
|
||||
//
|
||||
for(;;) {
|
||||
aNbEP=aMEP.Extent();
|
||||
for (k=1; k<=aNbEP; ++k) {
|
||||
const TopoDS_Shape& aEP=aMEP(k);
|
||||
const BOPCol_ListOfShape& aLF=aMEF.FindFromKey(aEP);
|
||||
aIt.Initialize(aLF);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aF=aIt.Value();
|
||||
if (aMFC.Add(aF)) {
|
||||
aExpF.Init(aF, TopAbs_EDGE);
|
||||
for (; aExpF.More(); aExpF.Next()) {
|
||||
const TopoDS_Shape& aEF=aExpF.Current();
|
||||
if (aMES.Add(aEF)) {
|
||||
aMEAdd.Add(aEF);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbEP=aMEAdd.Extent();
|
||||
if (!aNbEP) {
|
||||
break; // from for(;;) {
|
||||
}
|
||||
//
|
||||
aMEP.Clear();
|
||||
//
|
||||
for (k=1; k<=aNbEP; ++k) {
|
||||
const TopoDS_Shape& aEF=aMEAdd(k);
|
||||
aMEP.Add(aEF);
|
||||
}
|
||||
aMEAdd.Clear();
|
||||
}// for(;;) {
|
||||
//
|
||||
//-------------------------------------
|
||||
BOPTools_ConnexityBlock aCB(myAllocator);
|
||||
//
|
||||
BOPCol_ListOfShape& aLECB=aCB.ChangeShapes();
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEFR(100, myAllocator);
|
||||
//
|
||||
bRegular=Standard_True;
|
||||
aNbCB = aMFC.Extent();
|
||||
for (j=1; j<=aNbCB; ++j) {
|
||||
aFR = aMFC(j);
|
||||
//
|
||||
if (aMER.Contains(aFR)) {
|
||||
aFR.Orientation(TopAbs_FORWARD);
|
||||
aLECB.Append(aFR);
|
||||
aFR.Orientation(TopAbs_REVERSED);
|
||||
aLECB.Append(aFR);
|
||||
bRegular=Standard_False;
|
||||
}
|
||||
else {
|
||||
aLECB.Append(aFR);
|
||||
}
|
||||
//
|
||||
if (bRegular) {
|
||||
BOPTools::MapShapesAndAncestors(aFR,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEFR);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (bRegular) {
|
||||
Standard_Integer aNbER, aNbFR;
|
||||
//
|
||||
aNbER=aMEFR.Extent();
|
||||
for (k=1; k<=aNbER; ++k) {
|
||||
const BOPCol_ListOfShape& aLFR=aMEFR(k);
|
||||
aNbFR=aLFR.Extent();
|
||||
if (aNbFR>2) {
|
||||
bRegular=!bRegular;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aCB.SetRegular(bRegular);
|
||||
myLCB.Append(aCB);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SplitBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
|
||||
{
|
||||
Standard_Integer aNbLF, aNbOff, aNbFP;
|
||||
Standard_Integer i;
|
||||
TopAbs_Orientation anOr;
|
||||
TopoDS_Edge aEL;
|
||||
BRep_Builder aBB;
|
||||
TopoDS_Iterator aItS;
|
||||
TopExp_Explorer aExp;
|
||||
BOPCol_ListIteratorOfListOfShape aItF;
|
||||
BOPTools_CoupleOfShape aCSOff;
|
||||
BOPCol_MapOfOrientedShape AddedFacesMap;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aEFMap, aMEFP;
|
||||
//
|
||||
Handle (BOPInt_Context) aContext=new BOPInt_Context;
|
||||
//
|
||||
const BOPCol_ListOfShape& myShapes=aCB.Shapes();
|
||||
//
|
||||
BOPCol_ListOfShape& myLoops=aCB.ChangeLoops();
|
||||
myLoops.Clear();
|
||||
//
|
||||
// 1. Shells Usual
|
||||
aItF.Initialize (myShapes);
|
||||
for (; aItF.More(); aItF.Next()) {
|
||||
const TopoDS_Shape& aFF = aItF.Value();
|
||||
BOPTools::MapShapesAndAncestors (aFF,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aEFMap);
|
||||
}
|
||||
//
|
||||
aItF.Initialize (myShapes);
|
||||
for (i=1; aItF.More(); aItF.Next(), ++i) {
|
||||
const TopoDS_Shape& aFF = aItF.Value();
|
||||
if (!AddedFacesMap.Add(aFF)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// make a new shell
|
||||
TopoDS_Shell aShell;
|
||||
aBB.MakeShell(aShell);
|
||||
aBB.Add(aShell, aFF);
|
||||
//
|
||||
aMEFP.Clear();
|
||||
BOPTools::MapShapesAndAncestors(aFF,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEFP);
|
||||
//
|
||||
// loop on faces added to Shell;
|
||||
// add their neighbor faces to Shell and so on
|
||||
aItS.Initialize (aShell);
|
||||
for (; aItS.More(); aItS.Next()) {
|
||||
const TopoDS_Face& aF = (*(TopoDS_Face*)(&aItS.Value()));
|
||||
//
|
||||
// loop on edges of aF; find a good neighbor face of aF by aE
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aExp.Current()));
|
||||
//
|
||||
//1
|
||||
if (aMEFP.Contains(aE)) {
|
||||
const BOPCol_ListOfShape& aLFP=aMEFP.FindFromKey(aE);
|
||||
aNbFP=aLFP.Extent();
|
||||
if (aNbFP>1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//2
|
||||
anOr=aE.Orientation();
|
||||
if (anOr==TopAbs_INTERNAL) {
|
||||
continue;
|
||||
}
|
||||
//3
|
||||
if (BRep_Tool::Degenerated(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// candidate faces list
|
||||
const BOPCol_ListOfShape& aLF=aEFMap.FindFromKey(aE);
|
||||
aNbLF=aLF.Extent();
|
||||
if (!aNbLF) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
// try to select one of neighbors
|
||||
// check if a face already added to Shell shares E
|
||||
Standard_Boolean bFound;
|
||||
BOPCol_ListIteratorOfListOfShape aItLF;
|
||||
BOPTools_ListOfCoupleOfShape aLCSOff;
|
||||
//
|
||||
aItLF.Initialize(aLF);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Face& aFL=(*(TopoDS_Face*)(&aItLF.Value()));
|
||||
if (aF.IsSame(aFL)) {
|
||||
continue;
|
||||
}
|
||||
if (AddedFacesMap.Contains(aFL)){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
bFound=BOPTools_AlgoTools::GetEdgeOff(aE, aFL, aEL);
|
||||
if (!bFound) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aCSOff.SetShape1(aEL);
|
||||
aCSOff.SetShape2(aFL);
|
||||
aLCSOff.Append(aCSOff);
|
||||
}//for (; aItLF.More(); aItLF.Next()) {
|
||||
//
|
||||
aNbOff=aLCSOff.Extent();
|
||||
if (!aNbOff){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
TopoDS_Face aSelF;
|
||||
if (aNbOff==1) {
|
||||
aSelF=(*(TopoDS_Face*)(&aLCSOff.First().Shape2()));
|
||||
}
|
||||
else if (aNbOff>1){
|
||||
BOPTools_AlgoTools::GetFaceOff(aE,
|
||||
aF,
|
||||
aLCSOff,
|
||||
aSelF,
|
||||
aContext);
|
||||
}
|
||||
//
|
||||
if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) {
|
||||
aBB.Add(aShell, aSelF);
|
||||
BOPTools::MapShapesAndAncestors(aSelF,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEFP);
|
||||
}
|
||||
} // for (; aExp.More(); aExp.Next()) {
|
||||
} // for (; aItS.More(); aItS.Next()) {
|
||||
//
|
||||
if (IsClosedShell(aShell)) {
|
||||
aShell.Closed (Standard_True);
|
||||
myLoops.Append(aShell);
|
||||
}
|
||||
else {
|
||||
RefineShell(aShell);
|
||||
if (IsClosedShell(aShell)) {
|
||||
aShell.Closed (Standard_True);
|
||||
myLoops.Append(aShell);
|
||||
}
|
||||
}
|
||||
} // for (; aItF.More(); aItF.Next()) {
|
||||
}
|
||||
//=======================================================================
|
||||
//function : RefineShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void RefineShell(TopoDS_Shell& theShell)
|
||||
{
|
||||
TopoDS_Iterator aIt;
|
||||
//
|
||||
aIt.Initialize(theShell);
|
||||
if(!aIt.More()) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
Standard_Integer i, aNbMEF, aNbF;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
|
||||
TopoDS_Builder aBB;
|
||||
TopExp_Explorer aExp;
|
||||
BOPCol_MapOfShape aMEStop, aMFB;
|
||||
BOPCol_MapIteratorOfMapOfShape aItM;
|
||||
BOPCol_ListIteratorOfListOfShape aItLF, aItLFP;
|
||||
BOPCol_ListOfShape aLFP, aLFP1;
|
||||
//
|
||||
// Branch points
|
||||
BOPTools::MapShapesAndAncestors (theShell,
|
||||
TopAbs_EDGE,
|
||||
TopAbs_FACE,
|
||||
aMEF);
|
||||
aNbMEF=aMEF.Extent();
|
||||
for (i=1; i<=aNbMEF; ++i) {
|
||||
const TopoDS_Shape& aE=aMEF.FindKey(i);
|
||||
const BOPCol_ListOfShape& aLF=aMEF.FindFromIndex(i);
|
||||
aNbF=aLF.Extent();
|
||||
if (aNbF>2) {
|
||||
aMEStop.Add(aE);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (aMEStop.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
//
|
||||
// The first Face
|
||||
const TopoDS_Shape& aF1=aIt.Value();
|
||||
aMFB.Add(aF1);
|
||||
aLFP.Append(aF1);
|
||||
//
|
||||
// Trying to reach the branch point
|
||||
for (;;) {
|
||||
aItLFP.Initialize(aLFP);
|
||||
for (; aItLFP.More(); aItLFP.Next()) {
|
||||
const TopoDS_Shape& aFP=aItLFP.Value();
|
||||
//
|
||||
aExp.Init(aFP, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
|
||||
if (aMEStop.Contains(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (BRep_Tool::Degenerated(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const BOPCol_ListOfShape& aLF=aMEF.FindFromKey(aE);
|
||||
//
|
||||
aItLF.Initialize(aLF);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Shape& aFP1=aItLF.Value();
|
||||
if (aFP1.IsSame(aFP)) {
|
||||
continue;
|
||||
}
|
||||
if (aMFB.Contains(aFP1)) {
|
||||
continue;
|
||||
}
|
||||
aMFB.Add(aFP1);
|
||||
aLFP1.Append(aFP1);
|
||||
}// for (; aItLF.More(); aItLF.Next()) {
|
||||
}// for (; aExp.More(); aExp.Next()) {
|
||||
}// for (; aItLFP.More(); aItLFP.Next()) {
|
||||
//
|
||||
//
|
||||
if (aLFP1.IsEmpty()) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
aLFP.Clear();
|
||||
aItLF.Initialize(aLFP1);
|
||||
for (; aItLF.More(); aItLF.Next()) {
|
||||
const TopoDS_Shape& aFP1=aItLF.Value();
|
||||
aLFP.Append(aFP1);
|
||||
}
|
||||
aLFP1.Clear();
|
||||
}// for (;;) {
|
||||
//
|
||||
// Remove all faces before the branch point
|
||||
aItM.Initialize(aMFB);
|
||||
for (; aItM.More(); aItM.Next()) {
|
||||
const TopoDS_Shape& aFB=aItM.Value();
|
||||
aBB.Remove(theShell, aFB);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MakeShells
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_ShellSplitter::MakeShells()
|
||||
{
|
||||
Standard_Boolean bIsRegular;
|
||||
BOPTools_ListIteratorOfListOfConnexityBlock aItCB;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
//
|
||||
myErrorStatus=0;
|
||||
myShells.Clear();
|
||||
//
|
||||
aItCB.Initialize(myLCB);
|
||||
for (; aItCB.More(); aItCB.Next()) {
|
||||
BOPTools_ConnexityBlock& aCB=aItCB.ChangeValue();
|
||||
bIsRegular=aCB.IsRegular();
|
||||
if (bIsRegular) {
|
||||
TopoDS_Shell aShell;
|
||||
//
|
||||
const BOPCol_ListOfShape& aLF=aCB.Shapes();
|
||||
MakeShell(aLF, aShell);
|
||||
aShell.Closed(Standard_True);
|
||||
myShells.Append(aShell);
|
||||
}
|
||||
else {
|
||||
SplitBlock(aCB);
|
||||
const BOPCol_ListOfShape& aLS=aCB.Loops();
|
||||
aIt.Initialize(aLS);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
TopoDS_Shape& aShell=aIt.ChangeValue();
|
||||
aShell.Closed(Standard_True);
|
||||
myShells.Append(aShell);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MakeShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void MakeShell(const BOPCol_ListOfShape& aLS,
|
||||
TopoDS_Shell& aShell)
|
||||
{
|
||||
BRep_Builder aBB;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
//
|
||||
aBB.MakeShell(aShell);
|
||||
//
|
||||
aIt.Initialize(aLS);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aF=aIt.Value();
|
||||
aBB.Add(aShell, aF);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsClosedShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean IsClosedShell(const TopoDS_Shell& theShell)
|
||||
{
|
||||
Standard_Integer aNbE;
|
||||
Standard_Boolean bRet;
|
||||
TopoDS_Iterator aIt;
|
||||
TopExp_Explorer aExp;
|
||||
BOPCol_MapOfShape aM;
|
||||
//
|
||||
aIt.Initialize(theShell);
|
||||
for(; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Face& aF=(*(TopoDS_Face*)(&aIt.Value()));
|
||||
aExp.Init(aF, TopAbs_EDGE);
|
||||
for (; aExp.More(); aExp.Next()) {
|
||||
const TopoDS_Edge& aE=(*(TopoDS_Edge*)(&aExp.Current()));
|
||||
if (BRep_Tool::Degenerated(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (aE.Orientation()==TopAbs_INTERNAL) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if (!aM.Add(aE)) {
|
||||
aM.Remove(aE);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbE = aM.Extent();
|
||||
bRet = (aNbE > 0) ? Standard_False : Standard_True;
|
||||
return bRet;
|
||||
}
|
@@ -1,16 +1,20 @@
|
||||
-- Created by: Peter KURNEV
|
||||
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
||||
-- except in compliance with the License. Please obtain a copy of the License
|
||||
-- at http://www.opencascade.org and read it completely before using this file.
|
||||
--
|
||||
-- This library is free software; you can redistribute it and / or modify it
|
||||
-- under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
-- by the Free Software Foundation, with special exception defined in the file
|
||||
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
-- distribution for complete text of the license and disclaimer of any warranty.
|
||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
--
|
||||
-- Alternatively, this file may be used under the terms of Open CASCADE
|
||||
-- commercial license or contractual agreement.
|
||||
-- The Original Code and all software distributed under the License is
|
||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
-- Initial Developer hereby disclaims all such warranties, including without
|
||||
-- limitation, any warranties of merchantability, fitness for a particular
|
||||
-- purpose or non-infringement. Please see the License for the specific terms
|
||||
-- and conditions governing the rights and limitations under the License.
|
||||
|
||||
class WireSplitter from BOPAlgo
|
||||
inherits Algo from BOPAlgo
|
||||
@@ -19,6 +23,7 @@ class WireSplitter from BOPAlgo
|
||||
|
||||
uses
|
||||
Wire from TopoDS,
|
||||
Face from TopoDS,
|
||||
BaseAllocator from BOPCol,
|
||||
ListOfShape from BOPCol,
|
||||
WireEdgeSet from BOPAlgo,
|
||||
@@ -62,9 +67,9 @@ is
|
||||
MakeWires(me:out)
|
||||
is protected;
|
||||
|
||||
SplitBlock(me:out;
|
||||
theCB:out ConnexityBlock from BOPTools)
|
||||
is protected;
|
||||
SplitBlock(myclass;
|
||||
theF :Face from TopoDS;
|
||||
theCB:out ConnexityBlock from BOPTools);
|
||||
|
||||
fields
|
||||
myWES : PWireEdgeSet from BOPAlgo is protected;
|
||||
|
@@ -1,16 +1,21 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// This library is free software; you can redistribute it and / or modify it
|
||||
// under the terms of the GNU Lesser General Public version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#include <BOPAlgo_WireSplitter.ixx>
|
||||
|
||||
@@ -27,6 +32,8 @@
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPCol_MapOfShape.hxx>
|
||||
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
#include <BOPCol_TBB.hxx>
|
||||
#include <BOPCol_NCVector.hxx>
|
||||
|
||||
#include <BOPTools.hxx>
|
||||
|
||||
@@ -35,7 +42,7 @@
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_WireSplitter::BOPAlgo_WireSplitter()
|
||||
BOPAlgo_WireSplitter::BOPAlgo_WireSplitter()
|
||||
:
|
||||
BOPAlgo_Algo(),
|
||||
myWES(NULL),
|
||||
@@ -46,7 +53,8 @@
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_WireSplitter::BOPAlgo_WireSplitter(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
BOPAlgo_WireSplitter::BOPAlgo_WireSplitter
|
||||
(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
:
|
||||
BOPAlgo_Algo(theAllocator),
|
||||
myWES(NULL),
|
||||
@@ -57,14 +65,14 @@
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_WireSplitter::~BOPAlgo_WireSplitter()
|
||||
BOPAlgo_WireSplitter::~BOPAlgo_WireSplitter()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetWES
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_WireSplitter::SetWES(const BOPAlgo_WireEdgeSet& theWES)
|
||||
void BOPAlgo_WireSplitter::SetWES(const BOPAlgo_WireEdgeSet& theWES)
|
||||
{
|
||||
myWES=(BOPAlgo_WireEdgeSet*)&theWES;
|
||||
}
|
||||
@@ -72,7 +80,7 @@
|
||||
//function : WES
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPAlgo_WireEdgeSet& BOPAlgo_WireSplitter::WES()
|
||||
BOPAlgo_WireEdgeSet& BOPAlgo_WireSplitter::WES()
|
||||
{
|
||||
return *myWES;
|
||||
}
|
||||
@@ -80,7 +88,7 @@
|
||||
// function: CheckData
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPAlgo_WireSplitter::CheckData()
|
||||
void BOPAlgo_WireSplitter::CheckData()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
if (!myWES) {
|
||||
@@ -92,7 +100,7 @@
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_WireSplitter::Perform()
|
||||
void BOPAlgo_WireSplitter::Perform()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@@ -104,43 +112,12 @@
|
||||
MakeConnexityBlocks();
|
||||
MakeWires();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MakeWires
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_WireSplitter::MakeWires()
|
||||
{
|
||||
Standard_Boolean bIsRegular;
|
||||
TopoDS_Wire aW;
|
||||
BOPTools_ListIteratorOfListOfConnexityBlock aItCB;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
//
|
||||
aItCB.Initialize(myLCB);
|
||||
for (; aItCB.More(); aItCB.Next()) {
|
||||
BOPTools_ConnexityBlock& aCB=aItCB.ChangeValue();
|
||||
bIsRegular=aCB.IsRegular();
|
||||
if (bIsRegular) {
|
||||
BOPCol_ListOfShape& aLE=aCB.ChangeShapes();
|
||||
BOPAlgo_WireSplitter::MakeWire(aLE, aW);
|
||||
myWES->AddShape(aW);
|
||||
}
|
||||
else {
|
||||
SplitBlock(aCB);
|
||||
//
|
||||
const BOPCol_ListOfShape& aLW=aCB.Loops();
|
||||
aIt.Initialize(aLW);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aWx=aIt.Value();
|
||||
myWES->AddShape(aWx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : MakeConnexityBlocks
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_WireSplitter::MakeConnexityBlocks()
|
||||
void BOPAlgo_WireSplitter::MakeConnexityBlocks()
|
||||
{
|
||||
Standard_Boolean bRegular, bClosed;
|
||||
Standard_Integer i, j, aNbV, aNbVS, aNbVP, k;
|
||||
@@ -280,3 +257,105 @@
|
||||
myLCB.Append(aCB);
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef BOPCol_NCVector<BOPTools_ConnexityBlock> \
|
||||
BOPTools_VectorOfConnexityBlock;
|
||||
|
||||
//=======================================================================
|
||||
//class : WireSplitterFunctor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class BOPAlgo_WireSplitterFunctor {
|
||||
protected:
|
||||
TopoDS_Face myFace;
|
||||
BOPTools_VectorOfConnexityBlock* myPVCB;
|
||||
//
|
||||
public:
|
||||
//
|
||||
BOPAlgo_WireSplitterFunctor(const TopoDS_Face& aF,
|
||||
BOPTools_VectorOfConnexityBlock& aVCB)
|
||||
: myFace(aF), myPVCB(&aVCB) {
|
||||
}
|
||||
//
|
||||
void operator()( const flexible_range<Standard_Size>& aBR ) const{
|
||||
Standard_Size i, iBeg, iEnd;
|
||||
//
|
||||
BOPTools_VectorOfConnexityBlock& aVCB=*myPVCB;
|
||||
//
|
||||
iBeg=aBR.begin();
|
||||
iEnd=aBR.end();
|
||||
for(i=iBeg; i!=iEnd; ++i) {
|
||||
BOPTools_ConnexityBlock& aCB=aVCB((Standard_Integer)i);
|
||||
//
|
||||
BOPAlgo_WireSplitter::SplitBlock(myFace, aCB);
|
||||
}
|
||||
}
|
||||
};
|
||||
//=======================================================================
|
||||
//class : BOPAlgo_WireSplitterCnt
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class BOPAlgo_WireSplitterCnt {
|
||||
public:
|
||||
//-------------------------------
|
||||
// Perform
|
||||
Standard_EXPORT
|
||||
static void Perform(const Standard_Boolean bRunParallel,
|
||||
const TopoDS_Face& aF,
|
||||
BOPTools_VectorOfConnexityBlock& aVCB) {
|
||||
//
|
||||
BOPAlgo_WireSplitterFunctor aWSF(aF, aVCB);
|
||||
Standard_Size aNbVCB=aVCB.Extent();
|
||||
//
|
||||
if (bRunParallel) {
|
||||
flexible_for(flexible_range<Standard_Size>(0,aNbVCB), aWSF);
|
||||
}
|
||||
else {
|
||||
aWSF.operator()(flexible_range<Standard_Size>(0,aNbVCB));
|
||||
}
|
||||
}
|
||||
//
|
||||
};
|
||||
//=======================================================================
|
||||
//function : MakeWires
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_WireSplitter::MakeWires()
|
||||
{
|
||||
Standard_Boolean bIsRegular;
|
||||
Standard_Integer aNbVCB, k;
|
||||
TopoDS_Wire aW;
|
||||
BOPTools_ListIteratorOfListOfConnexityBlock aItCB;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
BOPTools_VectorOfConnexityBlock aVCB;
|
||||
//
|
||||
aItCB.Initialize(myLCB);
|
||||
for (; aItCB.More(); aItCB.Next()) {
|
||||
BOPTools_ConnexityBlock& aCB=aItCB.ChangeValue();
|
||||
bIsRegular=aCB.IsRegular();
|
||||
if (bIsRegular) {
|
||||
BOPCol_ListOfShape& aLE=aCB.ChangeShapes();
|
||||
BOPAlgo_WireSplitter::MakeWire(aLE, aW);
|
||||
myWES->AddShape(aW);
|
||||
}
|
||||
else {
|
||||
aVCB.Append(aCB);
|
||||
}
|
||||
}
|
||||
//
|
||||
aNbVCB=aVCB.Extent();
|
||||
const TopoDS_Face& aF=myWES->Face();
|
||||
//===================================================
|
||||
BOPAlgo_WireSplitterCnt::Perform(myRunParallel, aF, aVCB);
|
||||
//===================================================
|
||||
for (k=0; k<aNbVCB; ++k) {
|
||||
const BOPTools_ConnexityBlock& aCB=aVCB(k);
|
||||
const BOPCol_ListOfShape& aLW=aCB.Loops();
|
||||
aIt.Initialize(aLW);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aWx=aIt.Value();
|
||||
myWES->AddShape(aWx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -87,9 +87,9 @@ static
|
||||
static
|
||||
void Path (const GeomAdaptor_Surface& aGAS,
|
||||
const TopoDS_Face& myFace,
|
||||
const TopoDS_Vertex& aVFirst,
|
||||
const TopoDS_Edge& aEFirst,
|
||||
BOPAlgo_EdgeInfo& aEIFirst,
|
||||
const TopoDS_Vertex& aVa,
|
||||
const TopoDS_Edge& aEOuta,
|
||||
BOPAlgo_EdgeInfo& anEdgeInfo,
|
||||
BOPCol_SequenceOfShape& aLS,
|
||||
BOPCol_SequenceOfShape& aVertVa,
|
||||
BOPCol_SequenceOfPnt2d& aCoordVa,
|
||||
@@ -133,7 +133,8 @@ static
|
||||
//function : SplitBlock
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_WireSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
|
||||
void BOPAlgo_WireSplitter::SplitBlock(const TopoDS_Face& myFace,
|
||||
BOPTools_ConnexityBlock& aCB)
|
||||
{
|
||||
Standard_Boolean bNothingToDo;
|
||||
Standard_Integer aIx, aNb, i, aCntIn, aCntOut;
|
||||
@@ -144,9 +145,8 @@ static
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
BOPAlgo_ListIteratorOfListOfEdgeInfo aItLEI;
|
||||
//
|
||||
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo mySmartMap(100, myAllocator);
|
||||
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo mySmartMap(100);
|
||||
//
|
||||
const TopoDS_Face& myFace=myWES->Face();
|
||||
const BOPCol_ListOfShape& myEdges=aCB.Shapes();
|
||||
//
|
||||
// 1.Filling mySmartMap
|
||||
@@ -164,7 +164,7 @@ static
|
||||
const TopoDS_Shape& aV=aItS.Value();
|
||||
aIx=mySmartMap.FindIndex(aV);
|
||||
if (!aIx) {
|
||||
BOPAlgo_ListOfEdgeInfo aLEIx(myAllocator);
|
||||
BOPAlgo_ListOfEdgeInfo aLEIx;
|
||||
aIx=mySmartMap.Add(aV, aLEIx);
|
||||
}
|
||||
//
|
||||
@@ -214,14 +214,14 @@ static
|
||||
Standard_Integer aNbE, aNbMapEE;
|
||||
Standard_Boolean bFlag;
|
||||
//
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMapEE(100, myAllocator);
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMapEE(100);
|
||||
aNbE=myEdges.Extent();
|
||||
//
|
||||
aIt.Initialize(myEdges);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
const TopoDS_Shape& aE = aIt.Value();
|
||||
if (!aMapEE.Contains(aE)) {
|
||||
BOPCol_ListOfShape aLEx(myAllocator);
|
||||
BOPCol_ListOfShape aLEx;
|
||||
aLEx.Append(aE);
|
||||
aMapEE.Add(aE, aLEx);
|
||||
}
|
||||
@@ -262,7 +262,6 @@ static
|
||||
BOPCol_ListOfShape& aLoops=aCB.ChangeLoops();
|
||||
aLoops.Append(aW);
|
||||
//
|
||||
myErrorStatus=0;
|
||||
return;
|
||||
}
|
||||
//
|
||||
@@ -334,22 +333,23 @@ void Path (const GeomAdaptor_Surface& aGAS,
|
||||
BOPCol_SequenceOfPnt2d& aCoordVa,
|
||||
BOPTools_ConnexityBlock& aCB,
|
||||
BOPAlgo_IndexedDataMapOfShapeListOfEdgeInfo& mySmartMap)
|
||||
|
||||
{
|
||||
Standard_Integer i, j, aNb, aNbj;
|
||||
Standard_Real anAngleIn, anAngleOut, anAngle, aMinAngle;
|
||||
Standard_Real aTol2D, aTol2D2, aD2, aTwoPI;
|
||||
Standard_Real aTol, anAngleIn, anAngleOut, anAngle, aMinAngle;
|
||||
Standard_Real aTol2D, aTol2D2;
|
||||
Standard_Real aTol2, aD2, aTwoPI;
|
||||
Standard_Boolean anIsSameV2d, anIsSameV, anIsFound, anIsOut, anIsNotPassed;
|
||||
Standard_Boolean bIsClosed, bRecomputeAngle;
|
||||
TopoDS_Vertex aVa, aVb;
|
||||
TopoDS_Edge aEOuta;
|
||||
BOPAlgo_ListIteratorOfListOfEdgeInfo anIt;
|
||||
BOPCol_SequenceOfReal aRecomputedAngles;
|
||||
//
|
||||
aVa = aVFirst;
|
||||
aEOuta = aEFirst;
|
||||
BOPAlgo_EdgeInfo* anEdgeInfo = &aEIFirst;
|
||||
//
|
||||
aTwoPI = M_PI + M_PI;
|
||||
aTol=1.e-7;
|
||||
//
|
||||
// append block
|
||||
//
|
||||
@@ -376,27 +376,27 @@ void Path (const GeomAdaptor_Surface& aGAS,
|
||||
|
||||
gp_Pnt2d aPb=Coord2d(aVb, aEOuta, myFace);
|
||||
|
||||
const BOPAlgo_ListOfEdgeInfo& aLEInfo=mySmartMap.FindFromKey(aVb);
|
||||
const BOPAlgo_ListOfEdgeInfo& aLEInfoVb=mySmartMap.FindFromKey(aVb);
|
||||
//
|
||||
aTol2D = 2.*Tolerance2D(aVb, aGAS);
|
||||
aTol2D2 = aTol2D * aTol2D;
|
||||
//
|
||||
bIsClosed = BRep_Tool::Degenerated(aEOuta) ||
|
||||
BRep_Tool::IsClosed(aEOuta, myFace) || aVa.IsSame(aVb);
|
||||
if (!bIsClosed) {
|
||||
aTol=2.*Tolerance2D(aVb, aGAS);
|
||||
aTol2=10.*aTol*aTol;
|
||||
|
||||
TopoDS_Vertex aV1, aV2;
|
||||
//
|
||||
anIt.Initialize(aLEInfo);
|
||||
for (; anIt.More() && !bIsClosed; anIt.Next()) {
|
||||
TopExp::Vertices(aEOuta, aV1, aV2);
|
||||
Standard_Boolean bIsClosedEdge = aV1.IsNull() || aV2.IsNull() || aV1.IsSame(aV2);
|
||||
Standard_Boolean bIsDegenerated = BRep_Tool::Degenerated(aEOuta);
|
||||
Standard_Boolean bIsSeam = BRep_Tool::IsClosed(aEOuta, myFace);
|
||||
|
||||
anIt.Initialize(aLEInfoVb);
|
||||
for (; anIt.More(); anIt.Next()) {
|
||||
const BOPAlgo_EdgeInfo& anEI = anIt.Value();
|
||||
const TopoDS_Edge& aE = anEI.Edge();
|
||||
//
|
||||
bIsClosed = BRep_Tool::Degenerated(aE) || BRep_Tool::IsClosed(aE, myFace);
|
||||
if (!bIsClosed) {
|
||||
bIsDegenerated = bIsDegenerated || BRep_Tool::Degenerated(aE);
|
||||
bIsSeam = bIsSeam || BRep_Tool::IsClosed(aE, myFace);
|
||||
aV1.Nullify();
|
||||
aV2.Nullify();
|
||||
TopExp::Vertices(aE, aV1, aV2);
|
||||
bIsClosed = aV1.IsNull() || aV2.IsNull() || aV1.IsSame(aV2);
|
||||
}
|
||||
}
|
||||
bIsClosedEdge = bIsClosedEdge || aV1.IsNull() || aV2.IsNull() || aV1.IsSame(aV2);
|
||||
}
|
||||
//
|
||||
aNb=aLS.Length();
|
||||
@@ -411,23 +411,26 @@ void Path (const GeomAdaptor_Surface& aGAS,
|
||||
|
||||
aBuf.Append(aEPrev);
|
||||
|
||||
anIsSameV = aVPrev.IsSame(aVb);
|
||||
anIsSameV2d = anIsSameV;
|
||||
anIsSameV=aVPrev.IsSame(aVb);
|
||||
anIsSameV2d=Standard_False;
|
||||
|
||||
if (anIsSameV) {
|
||||
if(bIsClosed) {
|
||||
aD2 = aPaPrev.SquareDistance(aPb);
|
||||
anIsSameV2d = aD2 < aTol2D2;
|
||||
if (anIsSameV2d) {
|
||||
anIsSameV2d = Standard_True;
|
||||
//
|
||||
aD2=aPaPrev.SquareDistance(aPb);
|
||||
anIsSameV2d =aD2<aTol2;
|
||||
if(anIsSameV2d &&
|
||||
(bIsDegenerated || bIsSeam || bIsClosedEdge)) {
|
||||
Standard_Real udist = fabs(aPaPrev.X() - aPb.X());
|
||||
Standard_Real vdist = fabs(aPaPrev.Y() - aPb.Y());
|
||||
Standard_Real aTolU = 2.*UTolerance2D(aVb, aGAS);
|
||||
Standard_Real aTolV = 2.*VTolerance2D(aVb, aGAS);
|
||||
Standard_Real aTolU = 2. * UTolerance2D(aVb, aGAS);
|
||||
Standard_Real aTolV = 2. * VTolerance2D(aVb, aGAS);
|
||||
//
|
||||
if((udist > aTolU) || (vdist > aTolV)) {
|
||||
if((udist > aTolU) ||
|
||||
(vdist > aTolV)) {
|
||||
anIsSameV2d = Standard_False;
|
||||
}
|
||||
}
|
||||
}
|
||||
}//if (anIsSameV) {
|
||||
//
|
||||
if (anIsSameV && anIsSameV2d) {
|
||||
@@ -478,17 +481,26 @@ void Path (const GeomAdaptor_Surface& aGAS,
|
||||
}
|
||||
}
|
||||
//
|
||||
aRecomputedAngles.Clear();
|
||||
bRecomputeAngle =
|
||||
aTol2D=2.*Tolerance2D(aVb, aGAS);
|
||||
aTol2D2=1000.*aTol2D*aTol2D;//100.*aTol2D*aTol2D;
|
||||
//
|
||||
// anAngleIn in Vb from edge aEOuta
|
||||
const BOPAlgo_ListOfEdgeInfo& aLEInfo=mySmartMap.FindFromKey(aVb);
|
||||
//
|
||||
anAngleIn=AngleIn(aEOuta, aLEInfo);
|
||||
BOPCol_SequenceOfReal aRecomputedAngles;
|
||||
|
||||
Standard_Boolean bRecomputeAngle =
|
||||
RecomputeAngles(aLEInfo, myFace, aPb, aVb, aGAS, aEOuta,
|
||||
bIsClosed, aTol2D, aRecomputedAngles);
|
||||
(bIsDegenerated || bIsSeam || bIsClosedEdge),
|
||||
aTol2D, aRecomputedAngles);
|
||||
|
||||
//
|
||||
// aEOutb
|
||||
BOPAlgo_EdgeInfo *pEdgeInfo=NULL;
|
||||
//
|
||||
anAngleIn = AngleIn(aEOuta, aLEInfo);
|
||||
aMinAngle = 100.;
|
||||
anIsFound = Standard_False;
|
||||
aMinAngle=100.;
|
||||
anIsFound=Standard_False;
|
||||
Standard_Integer aCurIndexE = 0;
|
||||
anIt.Initialize(aLEInfo);
|
||||
for (; anIt.More(); anIt.Next()) {
|
||||
@@ -520,19 +532,17 @@ void Path (const GeomAdaptor_Surface& aGAS,
|
||||
if (aE.IsSame(aEOuta)) {
|
||||
anAngle = aTwoPI;
|
||||
} else {
|
||||
//check 2d distance
|
||||
if (bIsClosed) {
|
||||
// Look for minimal angle and make the choice.
|
||||
gp_Pnt2d aP2Dx;
|
||||
//
|
||||
aP2Dx = Coord2dVf(aE, myFace);
|
||||
aP2Dx=Coord2dVf(aE, myFace);
|
||||
//
|
||||
aD2 = aP2Dx.SquareDistance(aPb);
|
||||
aD2=aP2Dx.SquareDistance(aPb);
|
||||
if (aD2 > aTol2D2){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//
|
||||
// Look for minimal angle and make the choice.
|
||||
//
|
||||
anAngleOut=anEI.Angle();
|
||||
//
|
||||
if(bRecomputeAngle) {
|
||||
|
@@ -13,5 +13,6 @@ BOPAlgo_Builder_4.cxx
|
||||
BOPAlgo_BOP_1.cxx
|
||||
BOPAlgo_WireSplitter_1.cxx
|
||||
BOPAlgo_ListOfCheckResult.hxx
|
||||
|
||||
BOPAlgo_Builder_2Cnt.hxx
|
||||
BOPAlgo_CheckerSI_1.cxx
|
||||
|
||||
|
6
src/BOPCol/BOPCol_Array1.hxx
Normal file → Executable file
6
src/BOPCol/BOPCol_Array1.hxx
Normal file → Executable file
@@ -68,7 +68,7 @@ template <class Type> class BOPCol_MemBlock {
|
||||
for (i=0; i<mySize; ++i) {
|
||||
myData[i].~Type();
|
||||
}
|
||||
myAllocator->Free((Standard_Address&)myData);
|
||||
myAllocator->Free(myData);
|
||||
//
|
||||
myData=NULL;
|
||||
mySize=0;
|
||||
@@ -177,10 +177,8 @@ template <class Type> class BOPCol_Array1 {
|
||||
while(pBlock) {
|
||||
pNext=pBlock->Next();
|
||||
//
|
||||
//pBlock->~BOPCol_MemBlock<Type> ();
|
||||
pBlock->~BOPCol_XMemBlock();
|
||||
//pBlock->Clear();
|
||||
myAllocator->Free((Standard_Address&)pBlock);
|
||||
myAllocator->Free(pBlock);
|
||||
//
|
||||
pBlock=pNext;
|
||||
}
|
||||
|
85
src/BOPCol/BOPCol_Box2DBndTree.cxx
Normal file
85
src/BOPCol/BOPCol_Box2DBndTree.cxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 2010-2012 OPEN CASCADE SAS
|
||||
// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
|
||||
// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#include <BOPCol_Box2DBndTree.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPCol_Box2DBndTreeSelector::BOPCol_Box2DBndTreeSelector()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPCol_Box2DBndTreeSelector::~BOPCol_Box2DBndTreeSelector()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Reject
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPCol_Box2DBndTreeSelector::Reject
|
||||
(const Bnd_Box2d& aBox2D) const
|
||||
{
|
||||
return myBox2D.IsOut(aBox2D);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Accept
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPCol_Box2DBndTreeSelector::Accept
|
||||
(const Standard_Integer& aIndex)
|
||||
{
|
||||
Standard_Boolean bRet=Standard_False;
|
||||
//
|
||||
myIndices.Append(aIndex);
|
||||
bRet=!bRet;
|
||||
//}
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetBox
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPCol_Box2DBndTreeSelector::SetBox(const Bnd_Box2d& aBox2D)
|
||||
{
|
||||
myBox2D=aBox2D;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPCol_Box2DBndTreeSelector::Clear()
|
||||
{
|
||||
myIndices.Clear();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Indices
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BOPCol_ListOfInteger& BOPCol_Box2DBndTreeSelector::Indices() const
|
||||
{
|
||||
return myIndices;
|
||||
}
|
52
src/BOPCol/BOPCol_Box2DBndTree.hxx
Normal file
52
src/BOPCol/BOPCol_Box2DBndTree.hxx
Normal file
@@ -0,0 +1,52 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 2010-2012 OPEN CASCADE SAS
|
||||
// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||
// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
|
||||
// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#ifndef BOPCol_Box2DBndTree_HeaderFile
|
||||
#define BOPCol_Box2DBndTree_HeaderFile
|
||||
|
||||
#include <NCollection_UBTree.hxx>
|
||||
#include <Bnd_Box2d.hxx>
|
||||
#include <BOPCol_ListOfInteger.hxx>
|
||||
/**
|
||||
* The instantiation of the algorithm of unbalanced binary tree
|
||||
* of overlapped bounding boxes 2D.
|
||||
*
|
||||
*/
|
||||
typedef NCollection_UBTree <Standard_Integer , Bnd_Box2d> BOPCol_Box2DBndTree;
|
||||
|
||||
class BOPCol_Box2DBndTreeSelector : public BOPCol_Box2DBndTree::Selector {
|
||||
public:
|
||||
Standard_EXPORT BOPCol_Box2DBndTreeSelector();
|
||||
Standard_EXPORT virtual Standard_Boolean Reject(const Bnd_Box2d&) const;
|
||||
Standard_EXPORT virtual Standard_Boolean Accept(const Standard_Integer &);
|
||||
Standard_EXPORT virtual ~BOPCol_Box2DBndTreeSelector();
|
||||
|
||||
Standard_EXPORT void Clear();
|
||||
Standard_EXPORT void SetBox(const Bnd_Box2d&);
|
||||
Standard_EXPORT const BOPCol_ListOfInteger& Indices() const;
|
||||
|
||||
protected:
|
||||
Bnd_Box2d myBox2D;
|
||||
BOPCol_ListOfInteger myIndices;
|
||||
};
|
||||
|
||||
#endif
|
@@ -15,26 +15,27 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPDS_BoxBndTree.hxx>
|
||||
#include <BOPCol_BoxBndTree.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPDS_BoxBndTreeSelector::BOPDS_BoxBndTreeSelector()
|
||||
BOPCol_BoxBndTreeSelector::BOPCol_BoxBndTreeSelector()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPDS_BoxBndTreeSelector::~BOPDS_BoxBndTreeSelector()
|
||||
BOPCol_BoxBndTreeSelector::~BOPCol_BoxBndTreeSelector()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Reject
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPDS_BoxBndTreeSelector::Reject (const Bnd_Box& aBox) const
|
||||
Standard_Boolean BOPCol_BoxBndTreeSelector::Reject (const Bnd_Box& aBox) const
|
||||
{
|
||||
return myBox.IsOut(aBox);
|
||||
}
|
||||
@@ -42,21 +43,19 @@
|
||||
//function : Accept
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPDS_BoxBndTreeSelector::Accept (const Standard_Integer& aIndex)
|
||||
Standard_Boolean BOPCol_BoxBndTreeSelector::Accept (const Standard_Integer& aIndex)
|
||||
{
|
||||
Standard_Boolean bRet=Standard_False;
|
||||
//
|
||||
//if (myFence.Add(aIndex)) {
|
||||
myIndices.Append(aIndex);
|
||||
bRet=!bRet;
|
||||
//}
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetBox
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPDS_BoxBndTreeSelector::SetBox(const Bnd_Box& aBox)
|
||||
void BOPCol_BoxBndTreeSelector::SetBox(const Bnd_Box& aBox)
|
||||
{
|
||||
myBox=aBox;
|
||||
}
|
||||
@@ -64,16 +63,15 @@
|
||||
//function : Clear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPDS_BoxBndTreeSelector::Clear()
|
||||
void BOPCol_BoxBndTreeSelector::Clear()
|
||||
{
|
||||
//myFence.Clear();
|
||||
myIndices.Clear();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Indices
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BOPCol_ListOfInteger& BOPDS_BoxBndTreeSelector::Indices() const
|
||||
const BOPCol_ListOfInteger& BOPCol_BoxBndTreeSelector::Indices() const
|
||||
{
|
||||
return myIndices;
|
||||
}
|
@@ -26,14 +26,14 @@
|
||||
* of overlapped bounding boxes.
|
||||
*
|
||||
*/
|
||||
typedef NCollection_UBTree <Standard_Integer , Bnd_Box> BOPDS_BoxBndTree;
|
||||
typedef NCollection_UBTree <Standard_Integer , Bnd_Box> BOPCol_BoxBndTree;
|
||||
|
||||
class BOPDS_BoxBndTreeSelector : public BOPDS_BoxBndTree::Selector {
|
||||
class BOPCol_BoxBndTreeSelector : public BOPCol_BoxBndTree::Selector {
|
||||
public:
|
||||
Standard_EXPORT BOPDS_BoxBndTreeSelector();
|
||||
Standard_EXPORT BOPCol_BoxBndTreeSelector();
|
||||
Standard_EXPORT virtual Standard_Boolean Reject(const Bnd_Box&) const;
|
||||
Standard_EXPORT virtual Standard_Boolean Accept(const Standard_Integer &);
|
||||
Standard_EXPORT virtual ~BOPDS_BoxBndTreeSelector();
|
||||
Standard_EXPORT virtual ~BOPCol_BoxBndTreeSelector();
|
||||
|
||||
Standard_EXPORT void Clear();
|
||||
Standard_EXPORT void SetBox(const Bnd_Box&);
|
@@ -23,10 +23,11 @@
|
||||
#endif
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#include <TColStd_MapIntegerHasher.hxx>
|
||||
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
|
||||
typedef NCollection_DataMap<Standard_Integer, TopoDS_Shape, TColStd_MapIntegerHasher> BOPCol_DataMapOfIntegerShape;
|
||||
typedef BOPCol_DataMapOfIntegerShape::Iterator BOPCol_DataMapIteratorOfDataMapOfIntegerShape;
|
||||
|
||||
|
@@ -29,6 +29,10 @@ BOPCol_SequenceOfReal.hxx
|
||||
BOPCol_DataMapOfIntegerShape.hxx
|
||||
BOPCol_IndexedDataMapOfIntegerListOfInteger.hxx
|
||||
BOPCol_IndexedDataMapOfShapeInteger.hxx
|
||||
|
||||
BOPCol_TBB.hxx
|
||||
BOPCol_NCVector.hxx
|
||||
|
||||
BOPCol_BoxBndTree.hxx
|
||||
BOPCol_BoxBndTree.cxx
|
||||
BOPCol_Box2DBndTree.hxx
|
||||
BOPCol_Box2DBndTree.cxx
|
||||
|
@@ -95,6 +95,10 @@ is
|
||||
imported InterfEE from BOPDS;
|
||||
imported InterfEF from BOPDS;
|
||||
imported InterfFF from BOPDS;
|
||||
imported InterfVZ from BOPDS;
|
||||
imported InterfEZ from BOPDS;
|
||||
imported InterfFZ from BOPDS;
|
||||
imported InterfZZ from BOPDS;
|
||||
--
|
||||
imported VectorOfInterfVV from BOPDS;
|
||||
imported VectorOfInterfVE from BOPDS;
|
||||
@@ -102,6 +106,10 @@ is
|
||||
imported VectorOfInterfEE from BOPDS;
|
||||
imported VectorOfInterfEF from BOPDS;
|
||||
imported VectorOfInterfFF from BOPDS;
|
||||
imported VectorOfInterfVZ from BOPDS;
|
||||
imported VectorOfInterfEZ from BOPDS;
|
||||
imported VectorOfInterfFZ from BOPDS;
|
||||
imported VectorOfInterfZZ from BOPDS;
|
||||
--
|
||||
imported VectorOfPoint from BOPDS;
|
||||
imported VectorOfCurve from BOPDS;
|
||||
|
@@ -35,7 +35,7 @@ class BOPDS_CoupleOfPaveBlocks {
|
||||
BOPDS_CoupleOfPaveBlocks() {
|
||||
myIndex=-1;
|
||||
myIndexInterf=-1;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
@@ -49,13 +49,13 @@ class BOPDS_CoupleOfPaveBlocks {
|
||||
myIndex=-1;
|
||||
myIndexInterf=-1;
|
||||
SetPaveBlocks(thePB1, thePB2);
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
~BOPDS_CoupleOfPaveBlocks() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Sets an index
|
||||
|
@@ -34,6 +34,7 @@ class DS from BOPDS
|
||||
|
||||
uses
|
||||
ShapeEnum from TopAbs,
|
||||
Box from Bnd,
|
||||
Shape from TopoDS,
|
||||
--
|
||||
ListOfShape from BOPCol,
|
||||
@@ -65,7 +66,11 @@ uses
|
||||
VectorOfInterfVF from BOPDS,
|
||||
VectorOfInterfEE from BOPDS,
|
||||
VectorOfInterfEF from BOPDS,
|
||||
VectorOfInterfFF from BOPDS
|
||||
VectorOfInterfFF from BOPDS,
|
||||
VectorOfInterfVZ from BOPDS,
|
||||
VectorOfInterfEZ from BOPDS,
|
||||
VectorOfInterfFZ from BOPDS,
|
||||
VectorOfInterfZZ from BOPDS
|
||||
|
||||
--raises
|
||||
|
||||
@@ -482,6 +487,45 @@ is
|
||||
--- Selector/Modifier
|
||||
--- Returns the collection of interferences Face/Face
|
||||
|
||||
InterfVZ(me:out)
|
||||
returns VectorOfInterfVZ from BOPDS;
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
--- Selector/Modifier
|
||||
--- Returns the collection of interferences Vertex/Solid
|
||||
|
||||
InterfEZ(me:out)
|
||||
returns VectorOfInterfEZ from BOPDS;
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
--- Selector/Modifier
|
||||
--- Returns the collection of interferences Edge/Solid
|
||||
|
||||
InterfFZ(me:out)
|
||||
returns VectorOfInterfFZ from BOPDS;
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
--- Selector/Modifier
|
||||
--- Returns the collection of interferences Face/Solid
|
||||
|
||||
InterfZZ(me:out)
|
||||
returns VectorOfInterfZZ from BOPDS;
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
--- Selector/Modifier
|
||||
--- Returns the collection of interferences Solid/Solid
|
||||
|
||||
NbInterfTypes(myclass)
|
||||
returns Integer from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
-- Returns the number of types of the interferences
|
||||
--
|
||||
|
||||
AddInterf(me:out;
|
||||
theI1:Integer from Standard;
|
||||
theI2:Integer from Standard);
|
||||
@@ -512,12 +556,15 @@ is
|
||||
|
||||
HasInterfShapeSubShapes(me;
|
||||
theI1:Integer from Standard;
|
||||
theI2:Integer from Standard)
|
||||
theI2:Integer from Standard;
|
||||
theFlag: Boolean from Standard=Standard_True)
|
||||
returns Boolean from Standard;
|
||||
---Purpose:
|
||||
--- Query
|
||||
--- Returns true if the shape with index theI1 is interfered
|
||||
--- with any of sub-shapes of the shapes with index theI2
|
||||
--- with
|
||||
-- any sub-shape of the shape with index theI2 (theFlag=true)
|
||||
-- all sub-shapes of the shape with index theI2 (theFlag=false)
|
||||
|
||||
HasInterfSubShapes(me;
|
||||
theI1:Integer from Standard;
|
||||
@@ -581,6 +628,16 @@ is
|
||||
--- Updates tolerance of the sub-shapes of the shape with index <theIndex>.
|
||||
---
|
||||
|
||||
BuildBndBoxSolid (me:out;
|
||||
theIndex:Integer from Standard;
|
||||
theBox:out Box from Bnd)
|
||||
is protected;
|
||||
---Purpose:
|
||||
--- Computes bouding box <theBox> for the solid with DS-index <theIndex>
|
||||
---
|
||||
|
||||
|
||||
|
||||
fields
|
||||
myAllocator : BaseAllocator from BOPCol is protected;
|
||||
myArguments : ListOfShape from BOPCol is protected;
|
||||
@@ -606,5 +663,8 @@ fields
|
||||
myInterfEE : VectorOfInterfEE from BOPDS is protected;
|
||||
myInterfEF : VectorOfInterfEF from BOPDS is protected;
|
||||
myInterfFF : VectorOfInterfFF from BOPDS is protected;
|
||||
|
||||
myInterfVZ : VectorOfInterfVZ from BOPDS is protected;
|
||||
myInterfEZ : VectorOfInterfEZ from BOPDS is protected;
|
||||
myInterfFZ : VectorOfInterfFZ from BOPDS is protected;
|
||||
myInterfZZ : VectorOfInterfZZ from BOPDS is protected;
|
||||
end DS;
|
||||
|
@@ -85,7 +85,11 @@ BOPDS_DS::BOPDS_DS()
|
||||
myInterfVF(myAllocator),
|
||||
myInterfEE(myAllocator),
|
||||
myInterfEF(myAllocator),
|
||||
myInterfFF(myAllocator)
|
||||
myInterfFF(myAllocator),
|
||||
myInterfVZ(myAllocator),
|
||||
myInterfEZ(myAllocator),
|
||||
myInterfFZ(myAllocator),
|
||||
myInterfZZ(myAllocator)
|
||||
{
|
||||
myNbShapes=0;
|
||||
myNbSourceShapes=0;
|
||||
@@ -111,7 +115,11 @@ BOPDS_DS::BOPDS_DS(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
myInterfVF(myAllocator),
|
||||
myInterfEE(myAllocator),
|
||||
myInterfEF(myAllocator),
|
||||
myInterfFF(myAllocator)
|
||||
myInterfFF(myAllocator),
|
||||
myInterfVZ(myAllocator),
|
||||
myInterfEZ(myAllocator),
|
||||
myInterfFZ(myAllocator),
|
||||
myInterfZZ(myAllocator)
|
||||
{
|
||||
myNbShapes=0;
|
||||
myNbSourceShapes=0;
|
||||
@@ -148,6 +156,10 @@ void BOPDS_DS::Clear()
|
||||
myInterfEE.Clear();
|
||||
myInterfEF.Clear();
|
||||
myInterfFF.Clear();
|
||||
myInterfVZ.Clear();
|
||||
myInterfEZ.Clear();
|
||||
myInterfFZ.Clear();
|
||||
myInterfZZ.Clear();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetArguments
|
||||
@@ -307,6 +319,7 @@ Standard_Integer BOPDS_DS::Index(const TopoDS_Shape& theS)const
|
||||
void BOPDS_DS::Init()
|
||||
{
|
||||
Standard_Integer i1, i2, j, aI, aNb, aNbS, aNbE, aNbSx, nV, nW, nE, aNbF;
|
||||
Standard_Integer n1, n2, n3;
|
||||
Standard_Real aTol;
|
||||
TopAbs_ShapeEnum aTS;
|
||||
BOPCol_ListIteratorOfListOfInteger aIt1, aIt2, aIt3;
|
||||
@@ -522,6 +535,59 @@ void BOPDS_DS::Init()
|
||||
}//if (aTS==TopAbs_FACE) {
|
||||
}//for (j=0; j<myNbSourceShapes; ++j) {
|
||||
//
|
||||
// 2.4 Solids
|
||||
for (j=0; j<myNbSourceShapes; ++j) {
|
||||
BOPDS_ShapeInfo& aSI=ChangeShapeInfo(j);
|
||||
//
|
||||
aTS=aSI.ShapeType();
|
||||
if (aTS!=TopAbs_SOLID) {
|
||||
continue;
|
||||
}
|
||||
Bnd_Box& aBox=aSI.ChangeBox();
|
||||
BuildBndBoxSolid(j, aBox);
|
||||
//
|
||||
//
|
||||
// update sub-shapes by BRep comprising ones
|
||||
aMI.Clear();
|
||||
BOPCol_ListOfInteger& aLI1=aSI.ChangeSubShapes();
|
||||
//
|
||||
aIt1.Initialize(aLI1);
|
||||
for (; aIt1.More(); aIt1.Next()) {
|
||||
n1=aIt1.Value();
|
||||
BOPDS_ShapeInfo& aSI1=ChangeShapeInfo(n1);
|
||||
if (aSI1.ShapeType()!=TopAbs_SHELL) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLI2=aSI1.SubShapes();
|
||||
aIt2.Initialize(aLI2);
|
||||
for (; aIt2.More(); aIt2.Next()) {
|
||||
n2=aIt2.Value();
|
||||
BOPDS_ShapeInfo& aSI2=ChangeShapeInfo(n2);
|
||||
if (aSI2.ShapeType()!=TopAbs_FACE) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aMI.Add(n2);
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLI3=aSI2.SubShapes();
|
||||
aIt3.Initialize(aLI3);
|
||||
for (; aIt3.More(); aIt3.Next()) {
|
||||
n3=aIt3.Value();
|
||||
aMI.Add(n3);
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
aLI1.Clear();
|
||||
aItMI.Initialize(aMI);
|
||||
for (; aItMI.More(); aItMI.Next()) {
|
||||
n1=aItMI.Value();
|
||||
aLI1.Append(n1);
|
||||
}
|
||||
aMI.Clear();
|
||||
}//for (j=0; j<myNbSourceShapes; ++j) {
|
||||
//
|
||||
aMI.Clear();
|
||||
aAllocator.Nullify();
|
||||
//-----------------------------------------------------scope_1 t
|
||||
@@ -604,13 +670,14 @@ Standard_Boolean BOPDS_DS::HasInterf(const Standard_Integer theI) const
|
||||
//
|
||||
return bRet;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasInterfShapeSubShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPDS_DS::HasInterfShapeSubShapes(const Standard_Integer theI1,
|
||||
const Standard_Integer theI2)const
|
||||
Standard_Boolean BOPDS_DS::HasInterfShapeSubShapes
|
||||
(const Standard_Integer theI1,
|
||||
const Standard_Integer theI2,
|
||||
const Standard_Boolean theFlag)const
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer n2;
|
||||
@@ -623,13 +690,19 @@ Standard_Boolean BOPDS_DS::HasInterfShapeSubShapes(const Standard_Integer theI1,
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
n2=aIt.Value();
|
||||
bRet=HasInterf(theI1, n2);
|
||||
if (theFlag) {
|
||||
if(bRet) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!bRet) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : HasInterfSubShapes
|
||||
//purpose :
|
||||
@@ -1832,3 +1905,79 @@ void SortShell(const int n, BOPDS_Pave *a)
|
||||
}//for (i=0; i<nd; ++i)
|
||||
}//while (1)
|
||||
}
|
||||
//=======================================================================
|
||||
//function : BuildBndBoxSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPDS_DS::BuildBndBoxSolid(const Standard_Integer theIndex,
|
||||
Bnd_Box& aBoxS)
|
||||
{
|
||||
Standard_Boolean bIsOpenBox, bIsInverted;
|
||||
Standard_Integer nSh, nFc;
|
||||
Standard_Real aTolS, aTolFc;
|
||||
BOPCol_ListIteratorOfListOfInteger aItLI, aItLI1;
|
||||
//
|
||||
const BOPDS_ShapeInfo& aSI=ShapeInfo(theIndex);
|
||||
const TopoDS_Shape& aS=aSI.Shape();
|
||||
const TopoDS_Solid& aSolid=(*(TopoDS_Solid*)(&aS));
|
||||
//
|
||||
bIsOpenBox=Standard_False;
|
||||
//
|
||||
aTolS=0.;
|
||||
const BOPCol_ListOfInteger& aLISh=aSI.SubShapes();
|
||||
aItLI.Initialize(aLISh);
|
||||
for (; aItLI.More(); aItLI.Next()) {
|
||||
nSh=aItLI.Value();
|
||||
const BOPDS_ShapeInfo& aSISh=ShapeInfo(nSh);
|
||||
if (aSISh.ShapeType()!=TopAbs_SHELL) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLIFc=aSISh.SubShapes();
|
||||
aItLI1.Initialize(aLIFc);
|
||||
for (; aItLI1.More(); aItLI1.Next()) {
|
||||
nFc=aItLI1.Value();
|
||||
const BOPDS_ShapeInfo& aSIFc=ShapeInfo(nFc);
|
||||
if (aSIFc.ShapeType()!=TopAbs_FACE) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const Bnd_Box& aBFc=aSIFc.Box();
|
||||
aBoxS.Add(aBFc);
|
||||
//
|
||||
if (!bIsOpenBox) {
|
||||
bIsOpenBox=(aBFc.IsOpenXmin() || aBFc.IsOpenXmax() ||
|
||||
aBFc.IsOpenYmin() || aBFc.IsOpenYmax() ||
|
||||
aBFc.IsOpenZmin() || aBFc.IsOpenZmax());
|
||||
if (bIsOpenBox) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
const TopoDS_Face& aFc=*((TopoDS_Face*)&aSIFc.Shape());
|
||||
aTolFc=BRep_Tool::Tolerance(aFc);
|
||||
if (aTolFc>aTolS) {
|
||||
aTolS=aTolFc;
|
||||
}
|
||||
}//for (; aItLI1.More(); aItLI1.Next()) {
|
||||
if (bIsOpenBox) {
|
||||
break;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shell& aSh=*((TopoDS_Shell*)&aSISh.Shape());
|
||||
bIsOpenBox=BOPTools_AlgoTools::IsOpenShell(aSh);
|
||||
if (bIsOpenBox) {
|
||||
break;
|
||||
}
|
||||
}//for (; aItLI.More(); aItLI.Next()) {
|
||||
//
|
||||
if (bIsOpenBox) {
|
||||
aBoxS.SetWhole();
|
||||
}
|
||||
else {
|
||||
bIsInverted=BOPTools_AlgoTools::IsInvertedSolid(aSolid);
|
||||
if (bIsInverted) {
|
||||
aBoxS.SetWhole();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
//function : InterfVV
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfVV& BOPDS_DS::InterfVV()
|
||||
inline BOPDS_VectorOfInterfVV& BOPDS_DS::InterfVV()
|
||||
{
|
||||
return myInterfVV;
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
//function : InterfVE
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfVE& BOPDS_DS::InterfVE()
|
||||
inline BOPDS_VectorOfInterfVE& BOPDS_DS::InterfVE()
|
||||
{
|
||||
return myInterfVE;
|
||||
}
|
||||
@@ -33,14 +33,14 @@
|
||||
//function : InterfVF
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfVF& BOPDS_DS::InterfVF()
|
||||
inline BOPDS_VectorOfInterfVF& BOPDS_DS::InterfVF()
|
||||
{
|
||||
return myInterfVF;
|
||||
}//=======================================================================
|
||||
//function : InterfEE
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfEE& BOPDS_DS::InterfEE()
|
||||
inline BOPDS_VectorOfInterfEE& BOPDS_DS::InterfEE()
|
||||
{
|
||||
return myInterfEE;
|
||||
}
|
||||
@@ -48,7 +48,7 @@
|
||||
//function : InterfEF
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfEF& BOPDS_DS::InterfEF()
|
||||
inline BOPDS_VectorOfInterfEF& BOPDS_DS::InterfEF()
|
||||
{
|
||||
return myInterfEF;
|
||||
}
|
||||
@@ -56,15 +56,55 @@
|
||||
//function : InterfFF
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfFF& BOPDS_DS::InterfFF()
|
||||
inline BOPDS_VectorOfInterfFF& BOPDS_DS::InterfFF()
|
||||
{
|
||||
return myInterfFF;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : InterfVZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfVZ& BOPDS_DS::InterfVZ()
|
||||
{
|
||||
return myInterfVZ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : InterfEZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfEZ& BOPDS_DS::InterfEZ()
|
||||
{
|
||||
return myInterfEZ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : InterfFZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfFZ& BOPDS_DS::InterfFZ()
|
||||
{
|
||||
return myInterfFZ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : InterfZZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_VectorOfInterfZZ& BOPDS_DS::InterfZZ()
|
||||
{
|
||||
return myInterfZZ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbInterfTypes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer BOPDS_DS::NbInterfTypes()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : AddInterf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void BOPDS_DS::AddInterf(const Standard_Integer theI1,
|
||||
inline void BOPDS_DS::AddInterf(const Standard_Integer theI1,
|
||||
const Standard_Integer theI2)
|
||||
{
|
||||
BOPDS_PassKey aPK;
|
||||
@@ -76,7 +116,8 @@
|
||||
//function : HasInterf
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean BOPDS_DS::HasInterf(const Standard_Integer theI1,
|
||||
inline Standard_Boolean BOPDS_DS::HasInterf
|
||||
(const Standard_Integer theI1,
|
||||
const Standard_Integer theI2)const
|
||||
{
|
||||
BOPDS_PassKey aPK;
|
||||
@@ -88,7 +129,7 @@
|
||||
//function : Interferences
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline const BOPDS_MapOfPassKey& BOPDS_DS::Interferences()const
|
||||
inline const BOPDS_MapOfPassKey& BOPDS_DS::Interferences()const
|
||||
{
|
||||
return myInterfTB;
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
// Created on: 2013-05-23
|
||||
// Created by: Eugeny MALTCHIKOV
|
||||
// Copyright (c) 2014-2014 OPEN CASCADE SAS
|
||||
// Copyright (c) 2013-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
|
@@ -57,7 +57,7 @@ class BOPDS_Interf {
|
||||
const Standard_Integer theIndex2) {
|
||||
myIndex1=theIndex1;
|
||||
myIndex2=theIndex2;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Returns the indices of interferred shapes
|
||||
@@ -70,7 +70,7 @@ class BOPDS_Interf {
|
||||
Standard_Integer& theIndex2) const {
|
||||
theIndex1=myIndex1;
|
||||
theIndex2=myIndex2;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Sets the index of the first interferred shape
|
||||
@@ -79,7 +79,7 @@ class BOPDS_Interf {
|
||||
*/
|
||||
void SetIndex1(const Standard_Integer theIndex) {
|
||||
myIndex1=theIndex;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Sets the index of the second interferred shape
|
||||
@@ -88,7 +88,7 @@ class BOPDS_Interf {
|
||||
*/
|
||||
void SetIndex2(const Standard_Integer theIndex) {
|
||||
myIndex2=theIndex;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Returns the index of the first interferred shape
|
||||
@@ -97,7 +97,7 @@ class BOPDS_Interf {
|
||||
*/
|
||||
Standard_Integer Index1() const {
|
||||
return myIndex1;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Returns the index of the second interferred shape
|
||||
@@ -106,7 +106,7 @@ class BOPDS_Interf {
|
||||
*/
|
||||
Standard_Integer Index2() const {
|
||||
return myIndex2;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Returns the index of that are opposite to the given index
|
||||
@@ -125,7 +125,7 @@ class BOPDS_Interf {
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Returns true if the interference contains given index
|
||||
@@ -145,7 +145,7 @@ class BOPDS_Interf {
|
||||
*/
|
||||
void SetIndexNew(const Standard_Integer theIndex) {
|
||||
myIndexNew=theIndex;
|
||||
};
|
||||
}
|
||||
//
|
||||
//
|
||||
/**
|
||||
@@ -155,7 +155,7 @@ class BOPDS_Interf {
|
||||
*/
|
||||
Standard_Integer IndexNew() const {
|
||||
return myIndexNew;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Returns true if the interference has index of new shape
|
||||
@@ -168,7 +168,7 @@ class BOPDS_Interf {
|
||||
Standard_Boolean HasIndexNew(Standard_Integer& theIndex) const {
|
||||
theIndex=myIndexNew;
|
||||
return (myIndexNew>=0);
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Returns true if the interference has index of new shape
|
||||
@@ -177,7 +177,7 @@ class BOPDS_Interf {
|
||||
*/
|
||||
Standard_Boolean HasIndexNew() const {
|
||||
return (myIndexNew>=0);
|
||||
};
|
||||
}
|
||||
//
|
||||
protected:
|
||||
BOPDS_Interf() :
|
||||
@@ -185,17 +185,17 @@ class BOPDS_Interf {
|
||||
myIndex2(-1),
|
||||
myIndexNew(-1),
|
||||
myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()) {
|
||||
};
|
||||
}
|
||||
//
|
||||
BOPDS_Interf(const Handle(NCollection_BaseAllocator)& theAllocator) :
|
||||
myIndex1(-1),
|
||||
myIndex2(-1),
|
||||
myIndexNew(-1),
|
||||
myAllocator(theAllocator) {
|
||||
};
|
||||
}
|
||||
//
|
||||
virtual ~BOPDS_Interf() {
|
||||
};
|
||||
}
|
||||
|
||||
protected:
|
||||
Standard_Integer myIndex1;
|
||||
@@ -218,7 +218,7 @@ class BOPDS_InterfVV : public BOPDS_Interf {
|
||||
* Constructor
|
||||
*/
|
||||
BOPDS_InterfVV() : BOPDS_Interf() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
@@ -227,13 +227,13 @@ class BOPDS_InterfVV : public BOPDS_Interf {
|
||||
*/
|
||||
BOPDS_InterfVV(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
: BOPDS_Interf(theAllocator) {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfVV() {
|
||||
};
|
||||
}
|
||||
//
|
||||
};
|
||||
/**
|
||||
@@ -254,7 +254,7 @@ class BOPDS_InterfVE : public BOPDS_Interf {
|
||||
:
|
||||
BOPDS_Interf(),
|
||||
myParameter(0.) {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
@@ -265,13 +265,13 @@ class BOPDS_InterfVE : public BOPDS_Interf {
|
||||
:
|
||||
BOPDS_Interf(theAllocator),
|
||||
myParameter(0.) {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfVE() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Modifier
|
||||
@@ -283,7 +283,7 @@ class BOPDS_InterfVE : public BOPDS_Interf {
|
||||
*/
|
||||
void SetParameter(const Standard_Real theT) {
|
||||
myParameter=theT;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Selector
|
||||
@@ -295,7 +295,7 @@ class BOPDS_InterfVE : public BOPDS_Interf {
|
||||
*/
|
||||
Standard_Real Parameter() const {
|
||||
return myParameter;
|
||||
};
|
||||
}
|
||||
|
||||
protected:
|
||||
Standard_Real myParameter;
|
||||
@@ -319,7 +319,7 @@ class BOPDS_InterfVF : public BOPDS_Interf {
|
||||
: BOPDS_Interf(),
|
||||
myU(0.),
|
||||
myV(0.) {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
@@ -330,13 +330,13 @@ class BOPDS_InterfVF : public BOPDS_Interf {
|
||||
: BOPDS_Interf(theAllocator),
|
||||
myU(0.),
|
||||
myV(0.) {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfVF() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Modifier
|
||||
@@ -352,7 +352,7 @@ class BOPDS_InterfVF : public BOPDS_Interf {
|
||||
const Standard_Real theV) {
|
||||
myU=theU;
|
||||
myV=theV;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Selector
|
||||
@@ -367,7 +367,7 @@ class BOPDS_InterfVF : public BOPDS_Interf {
|
||||
void UV(Standard_Real& theU,Standard_Real& theV) const {
|
||||
theU=myU;
|
||||
theV=myV;
|
||||
};
|
||||
}
|
||||
|
||||
protected:
|
||||
Standard_Real myU;
|
||||
@@ -389,7 +389,7 @@ class BOPDS_InterfEE : public BOPDS_Interf {
|
||||
* Constructor
|
||||
*/
|
||||
BOPDS_InterfEE() : BOPDS_Interf() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
@@ -398,13 +398,13 @@ class BOPDS_InterfEE : public BOPDS_Interf {
|
||||
*/
|
||||
BOPDS_InterfEE(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
: BOPDS_Interf(theAllocator) {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfEE() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Modifier
|
||||
@@ -414,7 +414,7 @@ class BOPDS_InterfEE : public BOPDS_Interf {
|
||||
*/
|
||||
void SetCommonPart(const IntTools_CommonPrt& theCP) {
|
||||
myCommonPart=theCP;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Selector
|
||||
@@ -424,7 +424,7 @@ class BOPDS_InterfEE : public BOPDS_Interf {
|
||||
*/
|
||||
const IntTools_CommonPrt& CommonPart() const {
|
||||
return myCommonPart;
|
||||
};
|
||||
}
|
||||
|
||||
protected:
|
||||
IntTools_CommonPrt myCommonPart;
|
||||
@@ -444,7 +444,7 @@ class BOPDS_InterfEF : public BOPDS_Interf {
|
||||
* Constructor
|
||||
*/
|
||||
BOPDS_InterfEF(): BOPDS_Interf() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
@@ -458,13 +458,13 @@ class BOPDS_InterfEF : public BOPDS_Interf {
|
||||
*/
|
||||
BOPDS_InterfEF(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
: BOPDS_Interf(theAllocator) {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfEF() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Modifier
|
||||
@@ -474,7 +474,7 @@ class BOPDS_InterfEF : public BOPDS_Interf {
|
||||
*/
|
||||
void SetCommonPart(const IntTools_CommonPrt& theCP){
|
||||
myCommonPart=theCP;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Selector
|
||||
@@ -484,7 +484,7 @@ class BOPDS_InterfEF : public BOPDS_Interf {
|
||||
*/
|
||||
const IntTools_CommonPrt& CommonPart() const {
|
||||
return myCommonPart;
|
||||
};
|
||||
}
|
||||
//
|
||||
protected:
|
||||
IntTools_CommonPrt myCommonPart;
|
||||
@@ -511,7 +511,7 @@ class BOPDS_InterfFF : public BOPDS_Interf {
|
||||
myTolR2D(1.e-7),
|
||||
myCurves(myAllocator),
|
||||
myPoints(myAllocator) {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
@@ -527,14 +527,14 @@ class BOPDS_InterfFF : public BOPDS_Interf {
|
||||
myTolR2D(1.e-7),
|
||||
myCurves(myAllocator),
|
||||
myPoints(myAllocator) {
|
||||
};
|
||||
}
|
||||
*/
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfFF() {
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Initializer
|
||||
@@ -622,7 +622,7 @@ class BOPDS_InterfFF : public BOPDS_Interf {
|
||||
*/
|
||||
const BOPDS_VectorOfCurve& Curves()const{
|
||||
return myCurves;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Selector/Modifier
|
||||
@@ -632,7 +632,7 @@ class BOPDS_InterfFF : public BOPDS_Interf {
|
||||
*/
|
||||
BOPDS_VectorOfCurve& ChangeCurves(){
|
||||
return myCurves;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Selector
|
||||
@@ -642,7 +642,7 @@ class BOPDS_InterfFF : public BOPDS_Interf {
|
||||
*/
|
||||
const BOPDS_VectorOfPoint& Points()const{
|
||||
return myPoints;
|
||||
};
|
||||
}
|
||||
//
|
||||
/**
|
||||
* Selector/Modifier
|
||||
@@ -652,7 +652,7 @@ class BOPDS_InterfFF : public BOPDS_Interf {
|
||||
*/
|
||||
BOPDS_VectorOfPoint& ChangePoints(){
|
||||
return myPoints;
|
||||
};
|
||||
}
|
||||
//
|
||||
protected:
|
||||
Standard_Boolean myTangentFaces;
|
||||
@@ -662,4 +662,137 @@ class BOPDS_InterfFF : public BOPDS_Interf {
|
||||
BOPDS_VectorOfPoint myPoints;
|
||||
};
|
||||
|
||||
/**
|
||||
* The class BOPDS_InterfVZ is is to store the information about
|
||||
* the interference of the type vertex/solid.
|
||||
*/
|
||||
//=======================================================================
|
||||
//function : BOPDS_InterfVZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class BOPDS_InterfVZ : public BOPDS_Interf {
|
||||
public:
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
BOPDS_InterfVZ() : BOPDS_Interf() {
|
||||
};
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
* @param theAllocator
|
||||
* allocator to manage the memory
|
||||
*/
|
||||
BOPDS_InterfVZ(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
: BOPDS_Interf(theAllocator) {
|
||||
};
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfVZ() {
|
||||
};
|
||||
//
|
||||
};
|
||||
/**
|
||||
* The class BOPDS_InterfEZ is is to store the information about
|
||||
* the interference of the type edge/solid.
|
||||
*/
|
||||
//=======================================================================
|
||||
//function : BOPDS_InterfEZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class BOPDS_InterfEZ : public BOPDS_Interf {
|
||||
public:
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
BOPDS_InterfEZ() : BOPDS_Interf() {
|
||||
};
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
* @param theAllocator
|
||||
* allocator to manage the memory
|
||||
*/
|
||||
BOPDS_InterfEZ(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
: BOPDS_Interf(theAllocator) {
|
||||
};
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfEZ() {
|
||||
};
|
||||
//
|
||||
};
|
||||
/**
|
||||
* The class BOPDS_InterfFZ is is to store the information about
|
||||
* the interference of the type face/solid.
|
||||
*/
|
||||
//=======================================================================
|
||||
//function : BOPDS_InterfFZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class BOPDS_InterfFZ : public BOPDS_Interf {
|
||||
public:
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
BOPDS_InterfFZ() : BOPDS_Interf() {
|
||||
};
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
* @param theAllocator
|
||||
* allocator to manage the memory
|
||||
*/
|
||||
BOPDS_InterfFZ(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
: BOPDS_Interf(theAllocator) {
|
||||
};
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfFZ() {
|
||||
};
|
||||
//
|
||||
};
|
||||
/**
|
||||
* The class BOPDS_InterfZZ is is to store the information about
|
||||
* the interference of the type solid/solid.
|
||||
*/
|
||||
//=======================================================================
|
||||
//function : BOPDS_InterfZZ
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
class BOPDS_InterfZZ : public BOPDS_Interf {
|
||||
public:
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
BOPDS_InterfZZ() : BOPDS_Interf() {
|
||||
};
|
||||
//
|
||||
/**
|
||||
* Constructor
|
||||
* @param theAllocator
|
||||
* allocator to manage the memory
|
||||
*/
|
||||
BOPDS_InterfZZ(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
: BOPDS_Interf(theAllocator) {
|
||||
};
|
||||
//
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~BOPDS_InterfZZ() {
|
||||
};
|
||||
//
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include <BOPCol_DataMapOfIntegerMapOfInteger.hxx>
|
||||
#include <BOPCol_MapOfInteger.hxx>
|
||||
//
|
||||
#include <BOPDS_BoxBndTree.hxx>
|
||||
#include <BOPCol_BoxBndTree.hxx>
|
||||
#include <BOPDS_IndexRange.hxx>
|
||||
#include <BOPDS_PassKeyBoolean.hxx>
|
||||
#include <BOPDS_MapOfPassKeyBoolean.hxx>
|
||||
@@ -43,21 +43,22 @@
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPDS_Iterator::BOPDS_Iterator()
|
||||
BOPDS_Iterator::BOPDS_Iterator()
|
||||
:
|
||||
myAllocator(NCollection_BaseAllocator::CommonBaseAllocator())
|
||||
{
|
||||
myDS=NULL;
|
||||
myLength=0;
|
||||
//
|
||||
myLists.SetStartSize(6);
|
||||
myLists.SetStartSize(BOPDS_DS::NbInterfTypes());
|
||||
myLists.Init();
|
||||
}
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPDS_Iterator::BOPDS_Iterator(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
BOPDS_Iterator::BOPDS_Iterator
|
||||
(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
:
|
||||
myAllocator(theAllocator),
|
||||
myLists(theAllocator)
|
||||
@@ -65,21 +66,21 @@
|
||||
myDS=NULL;
|
||||
myLength=0;
|
||||
//
|
||||
myLists.SetStartSize(6);
|
||||
myLists.SetStartSize(BOPDS_DS::NbInterfTypes());
|
||||
myLists.Init();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPDS_Iterator::~BOPDS_Iterator()
|
||||
BOPDS_Iterator::~BOPDS_Iterator()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
// function: SetDS
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_Iterator::SetDS(const BOPDS_PDS& aDS)
|
||||
void BOPDS_Iterator::SetDS(const BOPDS_PDS& aDS)
|
||||
{
|
||||
myDS=aDS;
|
||||
}
|
||||
@@ -87,7 +88,7 @@
|
||||
// function: DS
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
const BOPDS_DS& BOPDS_Iterator::DS()const
|
||||
const BOPDS_DS& BOPDS_Iterator::DS()const
|
||||
{
|
||||
return *myDS;
|
||||
}
|
||||
@@ -95,7 +96,7 @@
|
||||
// function: ExpectedLength
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer BOPDS_Iterator::ExpectedLength() const
|
||||
Standard_Integer BOPDS_Iterator::ExpectedLength() const
|
||||
{
|
||||
return myLength;
|
||||
}
|
||||
@@ -103,7 +104,7 @@
|
||||
// function: BlockLength
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer BOPDS_Iterator::BlockLength() const
|
||||
Standard_Integer BOPDS_Iterator::BlockLength() const
|
||||
{
|
||||
Standard_Integer aNbIIs;
|
||||
Standard_Real aCfPredict=.5;
|
||||
@@ -121,7 +122,7 @@
|
||||
// function: Initialize
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1,
|
||||
void BOPDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1,
|
||||
const TopAbs_ShapeEnum aType2)
|
||||
{
|
||||
Standard_Integer iX;
|
||||
@@ -137,7 +138,7 @@
|
||||
// function: More
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Boolean BOPDS_Iterator::More()const
|
||||
Standard_Boolean BOPDS_Iterator::More()const
|
||||
{
|
||||
return myIterator.More();
|
||||
}
|
||||
@@ -145,7 +146,7 @@
|
||||
// function: Next
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_Iterator::Next()
|
||||
void BOPDS_Iterator::Next()
|
||||
{
|
||||
myIterator.Next();
|
||||
}
|
||||
@@ -153,7 +154,7 @@
|
||||
// function: Value
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_Iterator::Value(Standard_Integer& theI1,
|
||||
void BOPDS_Iterator::Value(Standard_Integer& theI1,
|
||||
Standard_Integer& theI2,
|
||||
Standard_Boolean& theWithSubShape) const
|
||||
{
|
||||
@@ -179,12 +180,13 @@
|
||||
// function: Prepare
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_Iterator::Prepare()
|
||||
void BOPDS_Iterator::Prepare()
|
||||
{
|
||||
Standard_Integer i;
|
||||
Standard_Integer i, aNbInterfTypes;
|
||||
//
|
||||
aNbInterfTypes=BOPDS_DS::NbInterfTypes();
|
||||
myLength=0;
|
||||
for (i=0; i<6; ++i) {
|
||||
for (i=0; i<aNbInterfTypes; ++i) {
|
||||
myLists(i).Clear();
|
||||
}
|
||||
//
|
||||
@@ -197,7 +199,7 @@
|
||||
// function: Intersect
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_Iterator::Intersect()
|
||||
void BOPDS_Iterator::Intersect()
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Integer aNb, i, aNbB, aNbR, iTi, iTj;
|
||||
@@ -216,8 +218,8 @@
|
||||
BOPCol_IndexedDataMapOfShapeBox aMSB(100, aAllocator);
|
||||
BOPDS_PassKeyBoolean aPKXB;
|
||||
//
|
||||
BOPDS_BoxBndTreeSelector aSelector;
|
||||
BOPDS_BoxBndTree aBBTree;
|
||||
BOPCol_BoxBndTreeSelector aSelector;
|
||||
BOPCol_BoxBndTree aBBTree;
|
||||
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
|
||||
//
|
||||
aNb=myDS->NbSourceShapes();
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include <BRep_Tool.hxx>
|
||||
|
||||
#include <NCollection_UBTreeFiller.hxx>
|
||||
#include <BOPDS_BoxBndTree.hxx>
|
||||
#include <BOPCol_BoxBndTree.hxx>
|
||||
#include <BOPDS_IndexRange.hxx>
|
||||
#include <BOPDS_PassKeyBoolean.hxx>
|
||||
#include <BOPDS_MapOfPassKeyBoolean.hxx>
|
||||
@@ -44,7 +44,7 @@
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPDS_IteratorSI::BOPDS_IteratorSI()
|
||||
BOPDS_IteratorSI::BOPDS_IteratorSI()
|
||||
:
|
||||
BOPDS_Iterator()
|
||||
{
|
||||
@@ -53,7 +53,8 @@
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPDS_IteratorSI::BOPDS_IteratorSI(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
BOPDS_IteratorSI::BOPDS_IteratorSI
|
||||
(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
:
|
||||
BOPDS_Iterator(theAllocator)
|
||||
{
|
||||
@@ -62,18 +63,31 @@
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
BOPDS_IteratorSI::~BOPDS_IteratorSI()
|
||||
BOPDS_IteratorSI::~BOPDS_IteratorSI()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
// function: UpdateByLevelOfCheck
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_IteratorSI::UpdateByLevelOfCheck(const Standard_Integer theLevel)
|
||||
{
|
||||
Standard_Integer i, aNbInterfTypes;
|
||||
//
|
||||
aNbInterfTypes=BOPDS_DS::NbInterfTypes();
|
||||
for (i=theLevel+1; i<aNbInterfTypes; ++i) {
|
||||
myLists(i).Clear();
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
// function: Intersect
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_IteratorSI::Intersect()
|
||||
void BOPDS_IteratorSI::Intersect()
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Integer aNbS, i, aNbB;//, iFlag, aNbLV, aNbA
|
||||
Standard_Integer aNbSD, iX, j, iDS, jB, k;;
|
||||
Standard_Integer aNbS, i, aNbB;
|
||||
Standard_Integer aNbSD, iX, j, iDS, jB;
|
||||
TopAbs_ShapeEnum aTi, aTj;
|
||||
Handle(NCollection_IncAllocator) aAllocator;
|
||||
BOPCol_ListIteratorOfListOfInteger aIt;
|
||||
@@ -89,8 +103,8 @@
|
||||
BOPCol_IndexedDataMapOfShapeBox aMSB(100, aAllocator);
|
||||
BOPDS_PassKeyBoolean aPKXB;
|
||||
//
|
||||
BOPDS_BoxBndTreeSelector aSelector;
|
||||
BOPDS_BoxBndTree aBBTree;
|
||||
BOPCol_BoxBndTreeSelector aSelector;
|
||||
BOPCol_BoxBndTree aBBTree;
|
||||
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
|
||||
//
|
||||
// myPairsAvoid, aMSI, aMSB
|
||||
@@ -98,7 +112,10 @@
|
||||
for (i=0; i<aNbS; ++i) {
|
||||
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
|
||||
//
|
||||
if (aSI.HasBRep()) {
|
||||
if (!aSI.IsInterfering()) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
const TopoDS_Shape& aSi=aSI.Shape();
|
||||
aTi=aSI.ShapeType();
|
||||
if (aTi!=TopAbs_VERTEX) {
|
||||
@@ -120,7 +137,6 @@
|
||||
//
|
||||
aMSI.Bind(aSi, i);
|
||||
aMSB.Add(aSi, aBoxEx);
|
||||
}
|
||||
} // for (i=0; i<aNbS; ++i) {
|
||||
//
|
||||
// aMII
|
||||
@@ -140,7 +156,7 @@
|
||||
for (i=0; i<aNbS; ++i) {
|
||||
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
|
||||
aTi=aSI.ShapeType();
|
||||
if (!aSI.HasBRep()){
|
||||
if (!aSI.IsInterfering()){
|
||||
continue;
|
||||
}
|
||||
//
|
||||
@@ -157,8 +173,6 @@
|
||||
//
|
||||
const BOPCol_ListOfInteger& aLI=aSelector.Indices();
|
||||
//
|
||||
k=0;
|
||||
//
|
||||
aIt.Initialize(aLI);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
jB=aIt.Value(); // box index in MII
|
||||
@@ -193,16 +207,3 @@
|
||||
aAllocator.Nullify();
|
||||
//-----------------------------------------------------scope_1 t
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: UpdateByLevelOfCheck
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void BOPDS_IteratorSI::UpdateByLevelOfCheck(const Standard_Integer theLevel)
|
||||
{
|
||||
Standard_Integer i;
|
||||
//
|
||||
for (i=theLevel+1; i<6; ++i) {
|
||||
myLists(i).Clear();
|
||||
}
|
||||
}
|
||||
|
@@ -116,7 +116,7 @@ static
|
||||
myNbIds=0;
|
||||
mySum=0;
|
||||
if (myPtr) {
|
||||
myAllocator->Free((Standard_Address)myPtr);
|
||||
myAllocator->Free(myPtr);
|
||||
myPtr=NULL;
|
||||
}
|
||||
}
|
||||
|
2
src/BOPDS/BOPDS_PaveBlock.cxx
Normal file → Executable file
2
src/BOPDS/BOPDS_PaveBlock.cxx
Normal file → Executable file
@@ -317,7 +317,7 @@ static
|
||||
for (i=0; i<aNb; ++i) {
|
||||
pPaves[i].~BOPDS_Pave();
|
||||
}
|
||||
myAllocator->Free((Standard_Address&)pPaves);
|
||||
myAllocator->Free(pPaves);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -144,6 +144,13 @@ is
|
||||
---Purpose:
|
||||
--- Query
|
||||
--- Returns true if the shape has boundary representation
|
||||
|
||||
IsInterfering(me)
|
||||
returns Boolean from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
--- Returns true if the shape can be participant of
|
||||
--- an interference
|
||||
--
|
||||
--- Flag
|
||||
--
|
||||
|
@@ -12,11 +12,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <BOPDS_Tools.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_ShapeInfo::BOPDS_ShapeInfo()
|
||||
inline BOPDS_ShapeInfo::BOPDS_ShapeInfo()
|
||||
:
|
||||
|
||||
myType(TopAbs_SHAPE),
|
||||
@@ -28,7 +30,8 @@
|
||||
//function :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_ShapeInfo::BOPDS_ShapeInfo(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
inline BOPDS_ShapeInfo::BOPDS_ShapeInfo
|
||||
(const Handle(NCollection_BaseAllocator)& theAllocator)
|
||||
:
|
||||
myType(TopAbs_SHAPE),
|
||||
mySubShapes(theAllocator),
|
||||
@@ -40,14 +43,14 @@
|
||||
//function : ~
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPDS_ShapeInfo::~BOPDS_ShapeInfo()
|
||||
inline BOPDS_ShapeInfo::~BOPDS_ShapeInfo()
|
||||
{
|
||||
}
|
||||
//=======================================================================
|
||||
//function : SetShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void BOPDS_ShapeInfo::SetShape(const TopoDS_Shape& theS)
|
||||
inline void BOPDS_ShapeInfo::SetShape(const TopoDS_Shape& theS)
|
||||
{
|
||||
myShape=theS;
|
||||
}
|
||||
@@ -55,7 +58,7 @@
|
||||
//function : Shape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline const TopoDS_Shape& BOPDS_ShapeInfo::Shape()const
|
||||
inline const TopoDS_Shape& BOPDS_ShapeInfo::Shape()const
|
||||
{
|
||||
return myShape;
|
||||
}
|
||||
@@ -63,7 +66,7 @@
|
||||
//function : SetShapeType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void BOPDS_ShapeInfo::SetShapeType(const TopAbs_ShapeEnum theType)
|
||||
inline void BOPDS_ShapeInfo::SetShapeType(const TopAbs_ShapeEnum theType)
|
||||
{
|
||||
myType=theType;
|
||||
}
|
||||
@@ -71,7 +74,7 @@
|
||||
//function : ShapeType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline TopAbs_ShapeEnum BOPDS_ShapeInfo::ShapeType()const
|
||||
inline TopAbs_ShapeEnum BOPDS_ShapeInfo::ShapeType()const
|
||||
{
|
||||
return myType;
|
||||
}
|
||||
@@ -79,7 +82,7 @@
|
||||
//function : SetBox
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void BOPDS_ShapeInfo::SetBox(const Bnd_Box& theBox)
|
||||
inline void BOPDS_ShapeInfo::SetBox(const Bnd_Box& theBox)
|
||||
{
|
||||
myBox=theBox;
|
||||
}
|
||||
@@ -87,7 +90,7 @@
|
||||
//function : Box
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline const Bnd_Box& BOPDS_ShapeInfo::Box()const
|
||||
inline const Bnd_Box& BOPDS_ShapeInfo::Box()const
|
||||
{
|
||||
return myBox;
|
||||
}
|
||||
@@ -95,7 +98,7 @@
|
||||
//function : ChangeBox
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Bnd_Box& BOPDS_ShapeInfo::ChangeBox()
|
||||
inline Bnd_Box& BOPDS_ShapeInfo::ChangeBox()
|
||||
{
|
||||
return myBox;
|
||||
}
|
||||
@@ -104,7 +107,7 @@
|
||||
//function : SubShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline const BOPCol_ListOfInteger& BOPDS_ShapeInfo::SubShapes()const
|
||||
inline const BOPCol_ListOfInteger& BOPDS_ShapeInfo::SubShapes()const
|
||||
{
|
||||
return mySubShapes;
|
||||
}
|
||||
@@ -112,7 +115,7 @@
|
||||
//function : ChangeSubShapes
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline BOPCol_ListOfInteger& BOPDS_ShapeInfo::ChangeSubShapes()
|
||||
inline BOPCol_ListOfInteger& BOPDS_ShapeInfo::ChangeSubShapes()
|
||||
{
|
||||
return mySubShapes;
|
||||
}
|
||||
@@ -120,7 +123,8 @@
|
||||
//function : HasSubShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasSubShape(const Standard_Integer theI)const
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasSubShape
|
||||
(const Standard_Integer theI)const
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
BOPCol_ListIteratorOfListOfInteger aIt;
|
||||
@@ -139,7 +143,7 @@
|
||||
//function : HasReference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasReference()const
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasReference()const
|
||||
{
|
||||
return (myReference>=0);
|
||||
}
|
||||
@@ -147,7 +151,7 @@
|
||||
//function : SetReference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void BOPDS_ShapeInfo::SetReference(const Standard_Integer theI)
|
||||
inline void BOPDS_ShapeInfo::SetReference(const Standard_Integer theI)
|
||||
{
|
||||
myReference=theI;
|
||||
}
|
||||
@@ -155,7 +159,7 @@
|
||||
//function : Reference
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer BOPDS_ShapeInfo::Reference()const
|
||||
inline Standard_Integer BOPDS_ShapeInfo::Reference()const
|
||||
{
|
||||
return myReference;
|
||||
}
|
||||
@@ -163,17 +167,23 @@
|
||||
//function : HasBRep
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasBRep()const
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasBRep()const
|
||||
{
|
||||
return (myType==TopAbs_VERTEX ||
|
||||
myType==TopAbs_EDGE ||
|
||||
myType==TopAbs_FACE);
|
||||
return (BOPDS_Tools::HasBRep(myType));
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsInterfering
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::IsInterfering()const
|
||||
{
|
||||
return (HasBRep() || myType==TopAbs_SOLID);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : HasFlag
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasFlag()const
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasFlag()const
|
||||
{
|
||||
return (myFlag>=0);
|
||||
}
|
||||
@@ -181,7 +191,8 @@
|
||||
//function : HasFlag
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasFlag(Standard_Integer& theFlag)const
|
||||
inline Standard_Boolean BOPDS_ShapeInfo::HasFlag
|
||||
(Standard_Integer& theFlag)const
|
||||
{
|
||||
theFlag=myFlag;
|
||||
return (myFlag>=0);
|
||||
@@ -190,7 +201,7 @@
|
||||
//function : SetFlag
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void BOPDS_ShapeInfo::SetFlag(const Standard_Integer theFlag)
|
||||
inline void BOPDS_ShapeInfo::SetFlag(const Standard_Integer theFlag)
|
||||
{
|
||||
myFlag=theFlag;
|
||||
}
|
||||
@@ -198,7 +209,7 @@
|
||||
//function : Flag
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer BOPDS_ShapeInfo::Flag()const
|
||||
inline Standard_Integer BOPDS_ShapeInfo::Flag()const
|
||||
{
|
||||
return myFlag;
|
||||
}
|
||||
|
@@ -27,8 +27,8 @@
|
||||
#include <BOPCol_DataMapOfIntegerInteger.hxx>
|
||||
#include <BOPCol_DataMapOfIntegerMapOfInteger.hxx>
|
||||
#include <BOPCol_MapOfInteger.hxx>
|
||||
#include <BOPCol_BoxBndTree.hxx>
|
||||
//
|
||||
#include <BOPDS_BoxBndTree.hxx>
|
||||
#include <BOPDS_IndexRange.hxx>
|
||||
#include <BOPDS_PassKeyBoolean.hxx>
|
||||
#include <BOPDS_MapOfPassKeyBoolean.hxx>
|
||||
@@ -193,8 +193,8 @@
|
||||
BOPDS_MapOfPassKeyBoolean aMPKXB(100, aAllocator);
|
||||
BOPCol_IndexedDataMapOfShapeBox aMSB(100, aAllocator);
|
||||
//
|
||||
BOPDS_BoxBndTreeSelector aSelector;
|
||||
BOPDS_BoxBndTree aBBTree;
|
||||
BOPCol_BoxBndTreeSelector aSelector;
|
||||
BOPCol_BoxBndTree aBBTree;
|
||||
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
|
||||
//
|
||||
aIt1.Initialize(*mySubSet1);
|
||||
|
@@ -51,4 +51,12 @@ is
|
||||
--- Returns true if the type <theT> correspond
|
||||
--- to a shape having boundary representation
|
||||
|
||||
IsInterfering(myclass;
|
||||
theT: ShapeEnum from TopAbs)
|
||||
returns Boolean from Standard;
|
||||
---C++: inline
|
||||
---Purpose:
|
||||
--- Returns true if the type <theT> can be participant of
|
||||
--- an interference
|
||||
|
||||
end Tools;
|
||||
|
@@ -19,7 +19,17 @@
|
||||
inline Standard_Boolean BOPDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
|
||||
{
|
||||
return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
|
||||
}//=======================================================================
|
||||
}
|
||||
//=======================================================================
|
||||
// function: IsInterfering
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
inline Standard_Boolean BOPDS_Tools::IsInterfering
|
||||
(const TopAbs_ShapeEnum aTi)
|
||||
{
|
||||
return (BOPDS_Tools::HasBRep(aTi) || aTi==TopAbs_SOLID);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : TypeToInteger
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
@@ -55,6 +65,21 @@ inline Standard_Integer BOPDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1
|
||||
case 44:
|
||||
iRet=5; // FF
|
||||
break;
|
||||
case 72:
|
||||
case 27:
|
||||
iRet=6; // VZ
|
||||
break;
|
||||
case 62:
|
||||
case 26:
|
||||
iRet=7; // EZ
|
||||
break;
|
||||
case 42:
|
||||
case 24:
|
||||
iRet=8; // FZ
|
||||
break;
|
||||
case 22:
|
||||
iRet=9; // ZZ
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
30
src/BOPDS/BOPDS_VectorOfInterfEZ.hxx
Normal file
30
src/BOPDS/BOPDS_VectorOfInterfEZ.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#ifndef BOPDS_VectorOfInterfEZ_HeaderFile
|
||||
#define BOPDS_VectorOfInterfEZ_HeaderFile
|
||||
|
||||
#include <BOPCol_Array1.hxx>
|
||||
#include <BOPDS_Interf.hxx>
|
||||
|
||||
#define BOPCol_Array1_Use_Allocator
|
||||
typedef BOPCol_Array1<BOPDS_InterfEZ> BOPDS_VectorOfInterfEZ;
|
||||
#undef BOPCol_Array1_Use_Allocator
|
||||
|
||||
#endif
|
30
src/BOPDS/BOPDS_VectorOfInterfFZ.hxx
Normal file
30
src/BOPDS/BOPDS_VectorOfInterfFZ.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#ifndef BOPDS_VectorOfInterfFZ_HeaderFile
|
||||
#define BOPDS_VectorOfInterfFZ_HeaderFile
|
||||
|
||||
#include <BOPCol_Array1.hxx>
|
||||
#include <BOPDS_Interf.hxx>
|
||||
|
||||
#define BOPCol_Array1_Use_Allocator
|
||||
typedef BOPCol_Array1<BOPDS_InterfFZ> BOPDS_VectorOfInterfFZ;
|
||||
#undef BOPCol_Array1_Use_Allocator
|
||||
|
||||
#endif
|
30
src/BOPDS/BOPDS_VectorOfInterfVZ.hxx
Normal file
30
src/BOPDS/BOPDS_VectorOfInterfVZ.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#ifndef BOPDS_VectorOfInterfVZ_HeaderFile
|
||||
#define BOPDS_VectorOfInterfVZ_HeaderFile
|
||||
|
||||
#include <BOPCol_Array1.hxx>
|
||||
#include <BOPDS_Interf.hxx>
|
||||
|
||||
#define BOPCol_Array1_Use_Allocator
|
||||
typedef BOPCol_Array1<BOPDS_InterfVZ> BOPDS_VectorOfInterfVZ;
|
||||
#undef BOPCol_Array1_Use_Allocator
|
||||
|
||||
#endif
|
30
src/BOPDS/BOPDS_VectorOfInterfZZ.hxx
Normal file
30
src/BOPDS/BOPDS_VectorOfInterfZZ.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created by: Peter KURNEV
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
#ifndef BOPDS_VectorOfInterfZZ_HeaderFile
|
||||
#define BOPDS_VectorOfInterfZZ_HeaderFile
|
||||
|
||||
#include <BOPCol_Array1.hxx>
|
||||
#include <BOPDS_Interf.hxx>
|
||||
|
||||
#define BOPCol_Array1_Use_Allocator
|
||||
typedef BOPCol_Array1<BOPDS_InterfZZ> BOPDS_VectorOfInterfZZ;
|
||||
#undef BOPCol_Array1_Use_Allocator
|
||||
|
||||
#endif
|
@@ -1,8 +1,6 @@
|
||||
BOPDS_VectorOfShapeInfo.hxx
|
||||
BOPDS_VectorOfIndexRange.hxx
|
||||
BOPDS_ListOfPassKeyBoolean.hxx
|
||||
BOPDS_BoxBndTree.cxx
|
||||
BOPDS_BoxBndTree.hxx
|
||||
BOPDS_MapOfPassKeyBoolean.hxx
|
||||
BOPDS_MapOfPassKey.hxx
|
||||
BOPDS_ListIteratorOfListOfPassKeyBoolean.hxx
|
||||
@@ -16,6 +14,10 @@ BOPDS_VectorOfInterfVF.hxx
|
||||
BOPDS_VectorOfInterfEE.hxx
|
||||
BOPDS_VectorOfInterfEF.hxx
|
||||
BOPDS_VectorOfInterfFF.hxx
|
||||
BOPDS_VectorOfInterfVZ.hxx
|
||||
BOPDS_VectorOfInterfEZ.hxx
|
||||
BOPDS_VectorOfInterfFZ.hxx
|
||||
BOPDS_VectorOfInterfZZ.hxx
|
||||
BOPDS_Interf.hxx
|
||||
BOPDS_DataMapOfPaveBlockListOfPaveBlock.hxx
|
||||
BOPDS_MapOfPaveBlock.hxx
|
||||
@@ -34,3 +36,4 @@ BOPDS_IndexedMapOfPaveBlock.hxx
|
||||
BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx
|
||||
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx
|
||||
BOPDS_DataMapOfPaveBlockCommonBlock.hxx
|
||||
|
||||
|
@@ -564,8 +564,7 @@
|
||||
const Standard_Real aTol)
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Real Umin, myEpsT, U, V;
|
||||
myEpsT=1.e-12;
|
||||
Standard_Real Umin, U, V;
|
||||
|
||||
GeomAPI_ProjectPointOnSurf& aProjector=ProjPS(aF);
|
||||
aProjector.Perform(aP);
|
||||
@@ -614,14 +613,12 @@
|
||||
const Standard_Real aTol)
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Real aTInterm, aFirst, aLast;
|
||||
Standard_Real aTInterm;
|
||||
gp_Pnt aPInterm;
|
||||
|
||||
aTInterm=IntTools_Tools::IntermediatePoint(aT1, aT2);
|
||||
|
||||
Handle(Geom_Curve) aC3D=aC.Curve();
|
||||
aFirst=aC3D->FirstParameter();
|
||||
aLast =aC3D->LastParameter();
|
||||
// point 3D
|
||||
aC3D->D0(aTInterm, aPInterm);
|
||||
//
|
||||
|
@@ -100,17 +100,17 @@ class BOPTime_Chronometer {
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static Standard_Integer bfillds (Draw_Interpretor&, Standard_Integer, const char**);
|
||||
static Standard_Integer bbuild (Draw_Interpretor&, Standard_Integer, const char**);
|
||||
static Standard_Integer bbop (Draw_Interpretor&, Standard_Integer, const char**);
|
||||
static Standard_Integer bclear (Draw_Interpretor&, Standard_Integer, const char**);
|
||||
static Standard_Integer bnsection(Draw_Interpretor&, Standard_Integer, const char**);
|
||||
|
||||
//=======================================================================
|
||||
//function : PartitionCommands
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPTest::PartitionCommands(Draw_Interpretor& theCommands)
|
||||
void BOPTest::PartitionCommands(Draw_Interpretor& theCommands)
|
||||
{
|
||||
static Standard_Boolean done = Standard_False;
|
||||
if (done) return;
|
||||
@@ -118,20 +118,17 @@ void BOPTest::PartitionCommands(Draw_Interpretor& theCommands)
|
||||
// Chapter's name
|
||||
const char* g = "Partition commands";
|
||||
// Commands
|
||||
theCommands.Add("bfillds" , "use bfillds [-s -t]" , __FILE__, bfillds, g);
|
||||
theCommands.Add("bbuild" , "use bbuild r [-s -t]", __FILE__, bbuild, g);
|
||||
theCommands.Add("bfillds" , "use bfillds" , __FILE__, bfillds , g);
|
||||
theCommands.Add("bbuild" , " use bbuild r [-s -t]" , __FILE__, bbuild, g);
|
||||
theCommands.Add("bbop" , "use bbop r op" , __FILE__, bbop, g);
|
||||
theCommands.Add("bclear" , "use bclear" , __FILE__, bclear, g);
|
||||
theCommands.Add("bnsection", "use bnsection r" , __FILE__, bnsection, g);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : bclear
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer bclear(Draw_Interpretor& di,
|
||||
Standard_Integer n,
|
||||
const char** )
|
||||
Standard_Integer bclear(Draw_Interpretor& di, Standard_Integer n, const char** )
|
||||
{
|
||||
if (n!=1) {
|
||||
di << " use bclear\n";
|
||||
@@ -145,21 +142,17 @@ Standard_Integer bclear(Draw_Interpretor& di,
|
||||
//function : bfillds
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer bfillds(Draw_Interpretor& di,
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
Standard_Integer bfillds(Draw_Interpretor& di, Standard_Integer n, const char** )
|
||||
{
|
||||
if (n>3) {
|
||||
di << " use bfillds [-s -t]\n";
|
||||
if (n!=1) {
|
||||
di << " Use bfillds\n";
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
char buf[32];
|
||||
Standard_Boolean bRunParallel, bShowTime;
|
||||
Standard_Integer i, aNbS, iErr;
|
||||
Standard_Integer aNbS, iErr;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
BOPCol_ListOfShape aLC;
|
||||
BOPTime_Chronometer aChrono;
|
||||
|
||||
BOPCol_ListOfShape& aLS=BOPTest_Objects::Shapes();
|
||||
aNbS=aLS.Extent();
|
||||
@@ -168,17 +161,6 @@ Standard_Integer bfillds(Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
bShowTime=Standard_False;
|
||||
bRunParallel=Standard_True;
|
||||
for (i=1; i<n; ++i) {
|
||||
if (!strcmp(a[i], "-s")) {
|
||||
bRunParallel=Standard_False;
|
||||
}
|
||||
else if (!strcmp(a[i], "-t")) {
|
||||
bShowTime=Standard_True;
|
||||
}
|
||||
}
|
||||
//
|
||||
BOPCol_ListOfShape& aLT=BOPTest_Objects::Tools();
|
||||
//
|
||||
aIt.Initialize(aLS);
|
||||
@@ -196,9 +178,6 @@ Standard_Integer bfillds(Draw_Interpretor& di,
|
||||
BOPAlgo_PaveFiller& aPF=BOPTest_Objects::PaveFiller();
|
||||
//
|
||||
aPF.SetArguments(aLC);
|
||||
//aPF.SetRunParallel(bRunParallel);
|
||||
//
|
||||
aChrono.Start();
|
||||
//
|
||||
aPF.Perform();
|
||||
iErr=aPF.ErrorStatus();
|
||||
@@ -208,25 +187,13 @@ Standard_Integer bfillds(Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
aChrono.Stop();
|
||||
//
|
||||
if (bShowTime) {
|
||||
Standard_Real aTime;
|
||||
//
|
||||
aTime=aChrono.Time();
|
||||
Sprintf(buf, " Tps: %7.2lf\n", aTime);
|
||||
di << buf;
|
||||
}
|
||||
//
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : bbuild
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer bbuild(Draw_Interpretor& di,
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
Standard_Integer bbuild(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n<2) {
|
||||
di << " use bbuild r [-s -t]\n";
|
||||
@@ -245,6 +212,8 @@ Standard_Integer bbuild(Draw_Interpretor& di,
|
||||
|
||||
BOPTime_Chronometer aChrono;
|
||||
BOPCol_ListIteratorOfListOfShape aIt;
|
||||
//
|
||||
|
||||
//
|
||||
BOPAlgo_PaveFiller& aPF=BOPTest_Objects::PaveFiller();
|
||||
//
|
||||
@@ -312,9 +281,7 @@ Standard_Integer bbuild(Draw_Interpretor& di,
|
||||
//function : bbop
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer bbop(Draw_Interpretor& di,
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
Standard_Integer bbop(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
{
|
||||
if (n!=3) {
|
||||
di << " use bbop r op\n";
|
||||
@@ -377,103 +344,3 @@ Standard_Integer bbop(Draw_Interpretor& di,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
#include <BOPDS_DS.hxx>
|
||||
#include <BOPDS_VectorOfInterfFF.hxx>
|
||||
#include <BOPTools.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : nsection
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Integer bnsection(Draw_Interpretor& di,
|
||||
Standard_Integer n,
|
||||
const char** a)
|
||||
{
|
||||
if (n != 2) {
|
||||
di << "use bnsection r\n";
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
BOPDS_PDS pDS = BOPTest_Objects::PDS();
|
||||
if (!pDS) {
|
||||
di << " prepare PaveFiller first\n";
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
Standard_Integer i, j, k, nE, nF1, nF2, aNbPB, aNbFF;
|
||||
Standard_Boolean bFlag;
|
||||
TopoDS_Compound aRC;
|
||||
BRep_Builder aBB;
|
||||
BOPCol_MapOfShape aME;
|
||||
BOPCol_IndexedMapOfShape aME1, aME2;
|
||||
//
|
||||
aBB.MakeCompound(aRC);
|
||||
BOPDS_VectorOfInterfFF& aFFs = pDS->InterfFF();
|
||||
aNbFF = aFFs.Extent();
|
||||
//
|
||||
for (i = 0; i < aNbFF; ++i) {
|
||||
BOPDS_InterfFF& aFF = aFFs(i);
|
||||
aFF.Indices(nF1, nF2);
|
||||
const BOPDS_FaceInfo& aFI1 = pDS->FaceInfo(nF1);
|
||||
const BOPDS_FaceInfo& aFI2 = pDS->FaceInfo(nF2);
|
||||
//
|
||||
const BOPDS_IndexedMapOfPaveBlock& aMPBIn1 = aFI1.PaveBlocksIn();
|
||||
const BOPDS_IndexedMapOfPaveBlock& aMPBOn1 = aFI1.PaveBlocksOn();
|
||||
const BOPDS_IndexedMapOfPaveBlock& aMPBSc1 = aFI1.PaveBlocksSc();
|
||||
//
|
||||
const BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.PaveBlocksIn();
|
||||
const BOPDS_IndexedMapOfPaveBlock& aMPBOn2 = aFI2.PaveBlocksOn();
|
||||
//
|
||||
//1. Section edges
|
||||
aNbPB = aMPBSc1.Extent();
|
||||
for (j = 1; j <= aNbPB; ++j) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB = aMPBSc1(j);
|
||||
nE = aPB->Edge();
|
||||
const TopoDS_Shape& aE = pDS->Shape(nE);
|
||||
if (aME.Add(aE)) {
|
||||
aBB.Add(aRC, aE);
|
||||
}
|
||||
}
|
||||
//2. Common edges
|
||||
BOPDS_IndexedMapOfPaveBlock aMPB[4] = {aMPBOn2, aMPBIn1, aMPBIn2, aMPBOn1};
|
||||
for (k = 0; k < 3; ++k) {
|
||||
aNbPB = aMPB[k].Extent();
|
||||
for (j = 1; j <= aNbPB; ++j) {
|
||||
const Handle(BOPDS_PaveBlock)& aPB = aMPB[k](j);
|
||||
bFlag = (k==0) ? aMPB[3].Contains(aPB) :
|
||||
(aMPB[k-1].Contains(aPB) || aMPB[k+1].Contains(aPB));
|
||||
if (bFlag) {
|
||||
nE = aPB->Edge();
|
||||
const TopoDS_Shape& aE = pDS->Shape(nE);
|
||||
if (aME.Add(aE)) {
|
||||
aBB.Add(aRC, aE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//3. Shared edges
|
||||
aME1.Clear();
|
||||
aME2.Clear();
|
||||
//
|
||||
const TopoDS_Face& aF1 = (*(TopoDS_Face *)(&pDS->Shape(nF1)));
|
||||
const TopoDS_Face& aF2 = (*(TopoDS_Face *)(&pDS->Shape(nF2)));
|
||||
//
|
||||
BOPTools::MapShapes(aF1, TopAbs_EDGE, aME1);
|
||||
BOPTools::MapShapes(aF2, TopAbs_EDGE, aME2);
|
||||
//
|
||||
aNbPB = aME1.Extent();
|
||||
for (j = 1; j <= aNbPB; ++j) {
|
||||
const TopoDS_Shape& aE = aME1(j);
|
||||
if (aME2.Contains(aE)) {
|
||||
if (aME.Add(aE)) {
|
||||
aBB.Add(aRC, aE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
DBRep::Set(a[1], aRC);
|
||||
return 0;
|
||||
}
|
||||
|
@@ -213,7 +213,7 @@ void ReduceVertexTolerance (const TopoDS_Shape& aS)
|
||||
void ProcessEdge(const TopoDS_Edge& aE, const Standard_Real aTolTreshold)
|
||||
{
|
||||
Standard_Integer i, aNb=23;
|
||||
Standard_Real aTolE, aD2, aTolMax2, aT1, aT2, aT, dT;
|
||||
Standard_Real aD2, aTolMax2, aT1, aT2, aT, dT;
|
||||
gp_Pnt aPC3D, aP3D;
|
||||
gp_Pnt2d aPC2D;
|
||||
|
||||
@@ -277,7 +277,6 @@ void ProcessEdge(const TopoDS_Edge& aE, const Standard_Real aTolTreshold)
|
||||
return;
|
||||
}
|
||||
//
|
||||
aTolE =BRep_Tool::Tolerance(aE);
|
||||
//
|
||||
aTolMax2=sqrt(aTolMax2);
|
||||
|
||||
@@ -296,7 +295,7 @@ void ProcessVertex(const TopoDS_Vertex& aV,
|
||||
const TopTools_ListOfShape& aLE,
|
||||
const TopTools_ListOfShape& aLF)
|
||||
{
|
||||
Standard_Real aTol, aTol2, aD2, aTolMax2, aTolE, aParam;
|
||||
Standard_Real aTol, aD2, aTolMax2, aTolE, aParam;
|
||||
gp_Pnt aPC3D;
|
||||
gp_Pnt2d aPC2D;
|
||||
TopAbs_Orientation anOrV;
|
||||
@@ -312,7 +311,6 @@ void ProcessVertex(const TopoDS_Vertex& aV,
|
||||
Handle(BRep_TVertex)& TV = *((Handle(BRep_TVertex)*) &aV.TShape());
|
||||
const gp_Pnt& aPV3D = TV->Pnt();
|
||||
aTol =BRep_Tool::Tolerance(aV);
|
||||
aTol2=aTol*aTol;
|
||||
//
|
||||
anIt.Initialize(aLE);
|
||||
for (; anIt.More(); anIt.Next()) {
|
||||
|
@@ -31,6 +31,7 @@ uses
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Shell from TopoDS,
|
||||
Solid from TopoDS,
|
||||
--
|
||||
BaseAllocator from BOPCol,
|
||||
@@ -447,4 +448,14 @@ is
|
||||
---Purpose:
|
||||
--- Retutns dimension of the shape <theS>.
|
||||
|
||||
IsOpenShell(myclass;
|
||||
theShell:Shell from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns true if the shell <theShell> is open
|
||||
|
||||
IsInvertedSolid(myclass;
|
||||
theSolid:Solid from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns true if the solid <theSolid> is inverted
|
||||
|
||||
end AlgoTools;
|
||||
|
@@ -1189,7 +1189,7 @@ Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW,
|
||||
Standard_Boolean bIsHole;
|
||||
Standard_Integer i, aNbS;
|
||||
Standard_Real aT1, aT2, aS;
|
||||
Standard_Real aU1, aU2, aU, dU;
|
||||
Standard_Real aU1, aU, dU;
|
||||
Standard_Real aX1, aY1, aX0, aY0;
|
||||
TopAbs_Orientation aOr;
|
||||
|
||||
@@ -1228,11 +1228,9 @@ Standard_Boolean BOPTools_AlgoTools::IsHole(const TopoDS_Shape& aW,
|
||||
dU=(aT2-aT1)/(Standard_Real)(aNbS-1);
|
||||
aU =aT1;
|
||||
aU1=aT1;
|
||||
aU2=aT2;
|
||||
if (aOr==TopAbs_REVERSED) {
|
||||
aU =aT2;
|
||||
aU1=aT2;
|
||||
aU2=aT1;
|
||||
dU=-dU;
|
||||
}
|
||||
//
|
||||
@@ -1880,3 +1878,63 @@ Standard_Boolean FindPointInFace(const TopoDS_Edge& aE,
|
||||
bRet = aDist < Precision::Angular();
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsOpenShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean
|
||||
BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer i, aNbE, aNbF;
|
||||
TopAbs_Orientation aOrF;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
|
||||
BOPCol_ListIteratorOfListOfShape aItLS;
|
||||
//
|
||||
bRet=Standard_False;
|
||||
//
|
||||
BOPTools::MapShapesAndAncestors(aSh, 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;
|
||||
}
|
||||
//
|
||||
aNbF=0;
|
||||
const BOPCol_ListOfShape& aLF=aMEF(i);
|
||||
aItLS.Initialize(aLF);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aF=aItLS.Value();
|
||||
aOrF=aF.Orientation();
|
||||
if (aOrF==TopAbs_INTERNAL || aOrF==TopAbs_EXTERNAL) {
|
||||
continue;
|
||||
}
|
||||
++aNbF;
|
||||
}
|
||||
//
|
||||
if (aNbF==1) {
|
||||
bRet=!bRet; // True
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsInvertedSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean
|
||||
BOPTools_AlgoTools::IsInvertedSolid(const TopoDS_Solid& aSolid)
|
||||
{
|
||||
Standard_Real aTolS;
|
||||
TopAbs_State aState;
|
||||
BRepClass3d_SolidClassifier aSC(aSolid);
|
||||
//
|
||||
aTolS=1.e-7;
|
||||
aSC.PerformInfinitePoint(aTolS);
|
||||
aState=aSC.State();
|
||||
return (aState==TopAbs_IN);
|
||||
}
|
||||
|
@@ -29,24 +29,11 @@
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
#include <Geom2d_TrimmedCurve.hxx>
|
||||
|
||||
#include <Geom2dAdaptor.hxx>
|
||||
|
||||
#include <Geom_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_HCurve.hxx>
|
||||
#include <GeomAdaptor_HSurface.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
|
||||
#include <GeomProjLib.hxx>
|
||||
|
||||
#include <TopLoc_Location.hxx>
|
||||
#include <TopExp.hxx>
|
||||
@@ -55,56 +42,27 @@
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_CurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
|
||||
#include <BRepAdaptor_HSurface.hxx>
|
||||
|
||||
#include <BRepAdaptor_Curve.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepAdaptor_Surface.hxx>
|
||||
#include <Geom2d_Curve.hxx>
|
||||
#include <Geom_Plane.hxx>
|
||||
#include <Geom_RectangularTrimmedSurface.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <Geom_Surface.hxx>
|
||||
#include <BRepClass_FaceClassifier.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
|
||||
#include <BOPCol_IndexedMapOfShape.hxx>
|
||||
|
||||
#include <BOPTools.hxx>
|
||||
#include <IntTools_Tools.hxx>
|
||||
#include <GeomProjLib.hxx>
|
||||
#include <Geom2d_BSplineCurve.hxx>
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <BSplCLib.hxx>
|
||||
|
||||
|
||||
static
|
||||
Standard_Boolean CheckEdgeLength (const TopoDS_Edge& );
|
||||
|
||||
static
|
||||
Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface(const TopoDS_Edge& ,
|
||||
const TopoDS_Face& ,
|
||||
Standard_Real& ,
|
||||
Standard_Real& ,
|
||||
Standard_Boolean& );
|
||||
static
|
||||
Handle(Geom2d_Curve) BRep_Tool_CurveOnSurface(const TopoDS_Edge& ,
|
||||
const Handle(Geom_Surface)& ,
|
||||
const TopLoc_Location& ,
|
||||
Standard_Real& ,
|
||||
Standard_Real& ,
|
||||
Standard_Boolean& );
|
||||
Standard_Boolean CheckEdgeLength (const TopoDS_Edge& E);
|
||||
|
||||
//=======================================================================
|
||||
//function : BuildPCurveForEdgeOnFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
||||
void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF)
|
||||
{
|
||||
BRep_Builder aBB;
|
||||
@@ -168,7 +126,7 @@ void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace (const TopoDS_Edge& aE,
|
||||
//function : PointOnOnSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPTools_AlgoTools2D::PointOnSurface (const TopoDS_Edge& aE,
|
||||
void BOPTools_AlgoTools2D::PointOnSurface (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
const Standard_Real aParameter,
|
||||
Standard_Real& U,
|
||||
@@ -189,7 +147,7 @@ void BOPTools_AlgoTools2D::PointOnSurface (const TopoDS_Edge& aE,
|
||||
//function : CurveOnSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC2D,
|
||||
Standard_Real& aToler)
|
||||
@@ -204,7 +162,7 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
//function : CurveOnSurface
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC2D,
|
||||
Standard_Real& aFirst,
|
||||
@@ -245,7 +203,7 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
aC2D=BRep_Tool::CurveOnSurface(aE, aF, aFirst, aLast);
|
||||
aC2D =BRep_Tool::CurveOnSurface(aE, aF, aFirst, aLast);
|
||||
aHasOld=!aC2D.IsNull();
|
||||
return aHasOld;
|
||||
}
|
||||
@@ -266,7 +224,7 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
aC2D=BRep_Tool::CurveOnSurface(aE, aF, aFirst, aLast);
|
||||
aC2D =BRep_Tool::CurveOnSurface(aE, aF, aFirst, aLast);
|
||||
aHasOld=!aC2D.IsNull();
|
||||
return aHasOld;
|
||||
}
|
||||
@@ -318,7 +276,7 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
|
||||
du = 0.;
|
||||
if (aBAS.IsUPeriodic()) {
|
||||
aUPeriod = aBAS.UPeriod();
|
||||
aUPeriod=aBAS.UPeriod();
|
||||
mincond = (u2 < UMin-aDelta);
|
||||
maxcond = (u2 > UMax+aDelta);
|
||||
|
||||
@@ -368,7 +326,7 @@ void BOPTools_AlgoTools2D::CurveOnSurface (const TopoDS_Edge& aE,
|
||||
if (aBAS.IsVPeriodic()) {
|
||||
Standard_Real aVPeriod, aVm, aVr, aVmid, dVm, dVr;
|
||||
//
|
||||
aVPeriod = aBAS.VPeriod();
|
||||
aVPeriod=aBAS.VPeriod();
|
||||
mincond = (VMin - v2 > aDelta);
|
||||
maxcond = (v2 - VMax > aDelta);
|
||||
decalv = mincond || maxcond;
|
||||
@@ -454,7 +412,7 @@ void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane (const TopoDS_Edge& aE,
|
||||
}
|
||||
else {
|
||||
aGP=Handle(Geom_Plane)::DownCast(aS);
|
||||
}
|
||||
}
|
||||
//
|
||||
if (aGP.IsNull()) {
|
||||
return;
|
||||
@@ -506,7 +464,7 @@ void BOPTools_AlgoTools2D::BuildPCurveForEdgesOnPlane
|
||||
BOPTools_AlgoTools2D::CurveOnSurface(aE, aFace, aC2D, aTolE);
|
||||
aBB.UpdateEdge(aE, aC2D, aFace, aTolE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -563,7 +521,7 @@ void BOPTools_AlgoTools2D::Make2D (const TopoDS_Edge& aE,
|
||||
//function : MakePCurveOnFace
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPTools_AlgoTools2D::MakePCurveOnFace (const TopoDS_Face& aF,
|
||||
void BOPTools_AlgoTools2D::MakePCurveOnFace (const TopoDS_Face& aF,
|
||||
const Handle(Geom_Curve)& aC3D,
|
||||
Handle(Geom2d_Curve)& aC2D, //->
|
||||
Standard_Real& TolReached2d)
|
||||
@@ -589,77 +547,40 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace (const TopoDS_Face& aF,
|
||||
Handle(Geom2d_Curve)& aC2D,
|
||||
Standard_Real& TolReached2d)
|
||||
{
|
||||
Standard_Real aTolR = Precision::Confusion();
|
||||
Standard_Real aTolR;
|
||||
Handle(Geom2d_Curve) aC2DA;
|
||||
//
|
||||
Handle(Geom_Surface) aS=BRep_Tool::Surface(aF);
|
||||
GeomAdaptor_Surface aGAS(aS);
|
||||
Handle(GeomAdaptor_HSurface) aBAHS=
|
||||
new GeomAdaptor_HSurface(aGAS);
|
||||
Handle(GeomAdaptor_HCurve) aBAHC =
|
||||
new GeomAdaptor_HCurve(aC3D, aFirst, aLast);
|
||||
|
||||
BRepAdaptor_Surface aBAS(aF, Standard_False);
|
||||
Handle(BRepAdaptor_HSurface) aBAHS = new BRepAdaptor_HSurface(aBAS);
|
||||
Handle(GeomAdaptor_HCurve) aBAHC = new GeomAdaptor_HCurve(aC3D, aFirst, aLast);
|
||||
|
||||
//when the type of surface is GeomAbs_SurfaceOfRevolution
|
||||
if (aGAS.GetType() == GeomAbs_SurfaceOfRevolution) {
|
||||
Standard_Real aTR = Precision::Confusion();
|
||||
|
||||
try
|
||||
{
|
||||
if (aBAS.GetType() == GeomAbs_SurfaceOfRevolution) {
|
||||
Standard_Real aTR = 1.e-7;
|
||||
ProjLib_ProjectedCurve aProj1(aBAHS, aBAHC, aTR);
|
||||
BOPTools_AlgoTools2D::MakePCurveOfType(aProj1, aC2D);
|
||||
aTolR = aProj1.GetTolerance();
|
||||
|
||||
}
|
||||
catch(Standard_Failure){}
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
} else {
|
||||
ProjLib_ProjectedCurve aProjCurv(aBAHS, aBAHC);// 1
|
||||
BOPTools_AlgoTools2D::MakePCurveOfType(aProjCurv, aC2D);
|
||||
aTolR=aProjCurv.GetTolerance();
|
||||
}
|
||||
catch(Standard_Failure){}
|
||||
}
|
||||
//
|
||||
if (aC2D.IsNull())
|
||||
{
|
||||
try
|
||||
{
|
||||
if (aC2D.IsNull()) {
|
||||
ProjLib_ProjectedCurve aProjCurvAgain(aBAHS, aBAHC, TolReached2d);// 2
|
||||
BOPTools_AlgoTools2D::MakePCurveOfType(aProjCurvAgain, aC2D);
|
||||
aTolR = aProjCurvAgain.GetTolerance();
|
||||
}
|
||||
catch(Standard_Failure){}
|
||||
//
|
||||
if (aC2D.IsNull())
|
||||
{
|
||||
if (aC2D.IsNull()) {
|
||||
Standard_Real aTR=0.0001;
|
||||
ProjLib_ProjectedCurve aProj3(aBAHS, aBAHC, aTR);// 3
|
||||
BOPTools_AlgoTools2D::MakePCurveOfType(aProj3, aC2D);
|
||||
aTolR = aProj3.GetTolerance();
|
||||
}
|
||||
}
|
||||
|
||||
Handle(Geom2d_BSplineCurve) aBSC = Handle(Geom2d_BSplineCurve)::DownCast(aC2D);
|
||||
if(!aBSC.IsNull())
|
||||
{ //Changing a parametric range of the BSplineCurve for getting same-domain with
|
||||
//source 3D-curve.
|
||||
|
||||
if(!IsEqual(aBSC->FirstParameter(), aFirst) || !IsEqual(aBSC->LastParameter(), aLast))
|
||||
{
|
||||
TColStd_Array1OfReal anArr(1, aBSC->NbKnots());
|
||||
aBSC->Knots(anArr);
|
||||
BSplCLib::Reparametrize(aFirst, aLast, anArr);
|
||||
aBSC->SetKnots(anArr);
|
||||
}
|
||||
}
|
||||
|
||||
TolReached2d=aTolR;
|
||||
|
||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aF, aFirst, aLast,
|
||||
aC2D, aC2DA);
|
||||
BOPTools_AlgoTools2D::AdjustPCurveOnFace (aF, aFirst, aLast, aC2D, aC2DA);
|
||||
aC2D=aC2DA;
|
||||
}
|
||||
|
||||
@@ -781,7 +702,7 @@ Standard_Boolean CheckEdgeLength (const TopoDS_Edge& E)
|
||||
|
||||
aTol=BRep_Tool::Tolerance(aE);
|
||||
aBB.UpdateEdge(aE, aC2D, aF, aTol);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : MakeCurveOnSurface
|
||||
//purpose :
|
||||
@@ -794,7 +715,7 @@ Standard_Boolean CheckEdgeLength (const TopoDS_Edge& E)
|
||||
Standard_Real& aToler)
|
||||
{
|
||||
BOPTools_AlgoTools2D::Make2D(aE, aF, aC2D, aFirst, aLast, aToler);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TangentOnEdge
|
||||
@@ -840,7 +761,7 @@ Standard_Boolean CheckEdgeLength (const TopoDS_Edge& E)
|
||||
Tg.Normalize();
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
//function : TangentOnEdge
|
||||
//purpose :
|
||||
|
@@ -741,7 +741,7 @@ void Add(const TopoDS_Shape& aS,
|
||||
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
|
||||
Standard_Integer iErr, aIx, aNbDomains;
|
||||
Standard_Real aUMin, aUMax, aVMin, aVMax;
|
||||
Standard_Real aVx = 0., aUx, aV1, aV2, aEpsT;
|
||||
Standard_Real aVx = 0., aUx, aV1, aV2;
|
||||
gp_Dir2d aD2D (0., 1.);
|
||||
gp_Pnt2d aP2D;
|
||||
gp_Pnt aPx;
|
||||
@@ -753,7 +753,6 @@ void Add(const TopoDS_Shape& aS,
|
||||
Geom2dHatch_Hatcher& aHatcher = theContext->Hatcher(aF);
|
||||
//
|
||||
iErr=0;
|
||||
aEpsT=1.e-12;
|
||||
//
|
||||
aFF=aF;
|
||||
aFF.Orientation (TopAbs_FORWARD);
|
||||
|
@@ -172,7 +172,7 @@ static
|
||||
void CorrectWires(const TopoDS_Face& aFx)
|
||||
{
|
||||
Standard_Integer i, aNbV;
|
||||
Standard_Real aTol, aTol2, aD2, aD2max, aT1, aT2, aT, aTol2d;
|
||||
Standard_Real aTol, aTol2, aD2, aD2max, aT1, aT2, aT;
|
||||
gp_Pnt aP, aPV;
|
||||
gp_Pnt2d aP2D;
|
||||
TopoDS_Face aF;
|
||||
@@ -182,7 +182,6 @@ void CorrectWires(const TopoDS_Face& aFx)
|
||||
//
|
||||
aF=aFx;
|
||||
aF.Orientation(TopAbs_FORWARD);
|
||||
aTol2d = Precision::Confusion();
|
||||
const Handle(Geom_Surface)& aS=BRep_Tool::Surface(aFx);
|
||||
//
|
||||
TopExp::MapShapesAndAncestors(aF, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
|
||||
|
4
src/BOPTools/BOPTools_Set.lxx
Normal file → Executable file
4
src/BOPTools/BOPTools_Set.lxx
Normal file → Executable file
@@ -162,7 +162,7 @@ static
|
||||
for (i=0; i<aNb; ++i) {
|
||||
pShapes[i].~TopoDS_Shape();
|
||||
}
|
||||
myAllocator->Free((Standard_Address&)pShapes);
|
||||
myAllocator->Free(pShapes);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : AddEdges
|
||||
@@ -220,7 +220,7 @@ static
|
||||
for (i=0; i<aNb; ++i) {
|
||||
pShapes[i].~TopoDS_Shape();
|
||||
}
|
||||
myAllocator->Free((Standard_Address&)pShapes);
|
||||
myAllocator->Free(pShapes);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsEqual
|
||||
|
@@ -86,9 +86,8 @@ BRepAdaptor_CompCurve::BRepAdaptor_CompCurve(const TopoDS_Wire& W,
|
||||
Forward = Standard_True; // Defaut ; The Reverse Edges are parsed.
|
||||
if((NbEdge > 2) || ((NbEdge==2) && (!myWire.Closed())) ) {
|
||||
TopAbs_Orientation Or = myCurves->Value(1).Edge().Orientation();
|
||||
Standard_Boolean B;
|
||||
TopoDS_Vertex VI, VL;
|
||||
B = TopExp::CommonVertex(myCurves->Value(1).Edge(),
|
||||
TopExp::CommonVertex(myCurves->Value(1).Edge(),
|
||||
myCurves->Value(2).Edge(),
|
||||
VI);
|
||||
VL = TopExp::LastVertex(myCurves->Value(1).Edge());
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Created on: 2014-12-25
|
||||
// Created on: 2012-12-25
|
||||
// Created by: KULIKOVA Galina
|
||||
// Copyright (c) 2014 OPEN CASCADE SAS
|
||||
// Copyright (c) 2012-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
|
@@ -1,6 +1,6 @@
|
||||
-- Created on: 2014-12-17
|
||||
-- Created on: 2012-12-17
|
||||
-- Created by: Eugeny MALTCHIKOV
|
||||
-- Copyright (c) 2014-2014 OPEN CASCADE SAS
|
||||
-- Copyright (c) 2012-2014 OPEN CASCADE SAS
|
||||
--
|
||||
-- This file is part of Open CASCADE Technology software library.
|
||||
--
|
||||
@@ -84,16 +84,14 @@ is
|
||||
theS2 : Shape from TopoDS;
|
||||
theOp : Operation from BOPAlgo;
|
||||
bTestSE : Boolean from Standard;
|
||||
bTestSI : Boolean from Standard;
|
||||
theCopy : Boolean from Standard = Standard_True)
|
||||
bTestSI : Boolean from Standard)
|
||||
is protected;
|
||||
---Purpose: Initialyzes data.
|
||||
|
||||
SetData(me:out;
|
||||
theS : Shape from TopoDS;
|
||||
bTestSE : Boolean from Standard = Standard_True;
|
||||
bTestSI : Boolean from Standard = Standard_True;
|
||||
theCopy : Boolean from Standard = Standard_True);
|
||||
bTestSI : Boolean from Standard = Standard_True);
|
||||
---Purpose: Sets data for check by Init method.
|
||||
-- The method provides alternative way for checking single shape.
|
||||
|
||||
@@ -102,8 +100,7 @@ is
|
||||
theS2 : Shape from TopoDS;
|
||||
theOp : Operation from BOPAlgo = BOPAlgo_UNKNOWN;
|
||||
bTestSE : Boolean from Standard = Standard_True;
|
||||
bTestSI : Boolean from Standard = Standard_True;
|
||||
theCopy : Boolean from Standard = Standard_True);
|
||||
bTestSI : Boolean from Standard = Standard_True);
|
||||
---Purpose: Sets data for check by Init method.
|
||||
-- The method provides alternative way for checking couple of shapes.
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// Created on: 2014-12-17
|
||||
// Created on: 2012-12-17
|
||||
// Created by: Eugeny MALTCHIKOV
|
||||
// Copyright (c) 2014-2014 OPEN CASCADE SAS
|
||||
// Copyright (c) 2012-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
@@ -74,10 +74,9 @@
|
||||
//=======================================================================
|
||||
void BRepAlgoAPI_Check::SetData(const TopoDS_Shape& theS,
|
||||
const Standard_Boolean bTestSE,
|
||||
const Standard_Boolean bTestSI,
|
||||
const Standard_Boolean theCopy)
|
||||
const Standard_Boolean bTestSI)
|
||||
{
|
||||
Init(theS, TopoDS_Shape(), BOPAlgo_UNKNOWN, bTestSE, bTestSI, theCopy);
|
||||
Init(theS, TopoDS_Shape(), BOPAlgo_UNKNOWN, bTestSE, bTestSI);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -88,10 +87,9 @@
|
||||
const TopoDS_Shape& theS2,
|
||||
const BOPAlgo_Operation theOp,
|
||||
const Standard_Boolean bTestSE,
|
||||
const Standard_Boolean bTestSI,
|
||||
const Standard_Boolean theCopy)
|
||||
const Standard_Boolean bTestSI)
|
||||
{
|
||||
Init(theS1, theS2, theOp, bTestSE, bTestSI, theCopy);
|
||||
Init(theS1, theS2, theOp, bTestSE, bTestSI);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,12 +101,11 @@
|
||||
const TopoDS_Shape& theS2,
|
||||
const BOPAlgo_Operation theOp,
|
||||
const Standard_Boolean bTestSE,
|
||||
const Standard_Boolean bTestSI,
|
||||
const Standard_Boolean theCopy )
|
||||
const Standard_Boolean bTestSI)
|
||||
{
|
||||
myResult.Clear();
|
||||
myS1 = theS1.IsNull() || !theCopy ? theS1 : BRepBuilderAPI_Copy(theS1).Shape();
|
||||
myS2 = theS2.IsNull() || !theCopy ? theS2 : BRepBuilderAPI_Copy(theS2).Shape();
|
||||
myS1 = theS1.IsNull() ? theS1 : BRepBuilderAPI_Copy(theS1).Shape();
|
||||
myS2 = theS2.IsNull() ? theS2 : BRepBuilderAPI_Copy(theS2).Shape();
|
||||
//
|
||||
myAnalyzer = new BOPAlgo_ArgumentAnalyzer();
|
||||
//
|
||||
|
@@ -78,14 +78,13 @@ Standard_Boolean BRepBlend_CurvPointRadInv::Derivatives(const math_Vector& X,
|
||||
{
|
||||
gp_Pnt ptcur1, ptcur2;
|
||||
gp_Vec d1cur1,d2cur1, d1cur2, nplan, dnplan;
|
||||
Standard_Real theD, dtheD, normd1cur1, unsurnormd1cur1;
|
||||
Standard_Real dtheD, normd1cur1, unsurnormd1cur1;
|
||||
|
||||
curv1->D2(X(1), ptcur1, d1cur1, d2cur1);
|
||||
|
||||
normd1cur1 = d1cur1.Magnitude();
|
||||
unsurnormd1cur1 = 1. / normd1cur1;
|
||||
nplan = unsurnormd1cur1 * d1cur1;
|
||||
theD = -(nplan.XYZ().Dot(ptcur1.XYZ()));
|
||||
dnplan.SetLinearForm(-nplan.Dot(d2cur1), nplan, d2cur1);
|
||||
dnplan.Multiply(unsurnormd1cur1);
|
||||
dtheD = - nplan.XYZ().Dot(d1cur1.XYZ()) - dnplan.XYZ().Dot(ptcur1.XYZ());
|
||||
@@ -107,10 +106,8 @@ Standard_Boolean BRepBlend_CurvPointRadInv::Values(const math_Vector& X,
|
||||
math_Vector& F,
|
||||
math_Matrix& D)
|
||||
{
|
||||
Standard_Boolean Retour;
|
||||
|
||||
Retour = Value(X, F);
|
||||
Retour = Derivatives(X, D);
|
||||
Value(X, F);
|
||||
Derivatives(X, D);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
|
@@ -131,10 +131,8 @@ Standard_Boolean BRepBlend_RstRstConstRad::Values(const math_Vector& X,
|
||||
math_Vector& F,
|
||||
math_Matrix& D)
|
||||
{
|
||||
Standard_Boolean Error;
|
||||
|
||||
Error = Value(X, F);
|
||||
Error = Derivatives(X, D);
|
||||
Value(X, F);
|
||||
Derivatives(X, D);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -462,9 +460,7 @@ Blend_DecrochStatus BRepBlend_RstRstConstRad::Decroch(const math_Vector& Sol,
|
||||
// Normal to the reference surface 2
|
||||
NRst2 = d1u.Crossed(d1v);
|
||||
|
||||
Standard_Boolean IsCenter;
|
||||
|
||||
IsCenter = CenterCircleRst1Rst2(PtTmp1, PtTmp2, nplan, Center, NotUsed);
|
||||
CenterCircleRst1Rst2(PtTmp1, PtTmp2, nplan, Center, NotUsed);
|
||||
|
||||
norm = nplan.Crossed(NRst1).Magnitude();
|
||||
unsurnorm = 1. / norm;
|
||||
@@ -603,9 +599,7 @@ void BRepBlend_RstRstConstRad::Section(const Standard_Real Param,
|
||||
ptrst1 = cons1.Value(U);
|
||||
ptrst2 = cons2.Value(V);
|
||||
|
||||
Standard_Boolean IsCenter;
|
||||
|
||||
IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, np, Center, NotUsed);
|
||||
CenterCircleRst1Rst2(ptrst1, ptrst2, np, Center, NotUsed);
|
||||
|
||||
C.SetRadius(Abs(ray));
|
||||
ns = gp_Vec(Center, ptrst1).Normalized();
|
||||
@@ -778,8 +772,7 @@ void BRepBlend_RstRstConstRad::Section(const Blend_Point& P,
|
||||
}
|
||||
|
||||
// Calculate the center of the circle
|
||||
Standard_Boolean IsCenter;
|
||||
IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, NotUsed);
|
||||
CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, NotUsed);
|
||||
|
||||
// normals to the section with points
|
||||
ns = gp_Vec(Center, ptrst1).Normalized();
|
||||
|
@@ -193,10 +193,8 @@ Standard_Boolean BRepBlend_RstRstEvolRad::Values(const math_Vector& X,
|
||||
math_Vector& F,
|
||||
math_Matrix& D)
|
||||
{
|
||||
Standard_Boolean Error;
|
||||
|
||||
Error = Value(X, F);
|
||||
Error = Derivatives(X, D);
|
||||
Value(X, F);
|
||||
Derivatives(X, D);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -533,9 +531,7 @@ Blend_DecrochStatus BRepBlend_RstRstEvolRad::Decroch(const math_Vector& Sol,
|
||||
// Normal to the reference surface 2
|
||||
NRst2 = d1u.Crossed(d1v);
|
||||
|
||||
Standard_Boolean IsCenter;
|
||||
|
||||
IsCenter = CenterCircleRst1Rst2(PtTmp1, PtTmp2, nplan, Center, NotUsed);
|
||||
CenterCircleRst1Rst2(PtTmp1, PtTmp2, nplan, Center, NotUsed);
|
||||
|
||||
norm = nplan.Crossed(NRst1).Magnitude();
|
||||
unsurnorm = 1. / norm;
|
||||
@@ -672,9 +668,7 @@ void BRepBlend_RstRstEvolRad::Section(const Standard_Real Param,
|
||||
ptrst1 = cons1.Value(U);
|
||||
ptrst2 = cons2.Value(V);
|
||||
|
||||
Standard_Boolean IsCenter;
|
||||
|
||||
IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, np, Center, NotUsed);
|
||||
CenterCircleRst1Rst2(ptrst1, ptrst2, np, Center, NotUsed);
|
||||
|
||||
C.SetRadius(Abs(ray));
|
||||
ns = gp_Vec(Center, ptrst1).Normalized();
|
||||
@@ -881,8 +875,7 @@ void BRepBlend_RstRstEvolRad::Section(const Blend_Point& P,
|
||||
}
|
||||
|
||||
// Calculate the center of the circle
|
||||
Standard_Boolean IsCenter;
|
||||
IsCenter = CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, NotUsed);
|
||||
CenterCircleRst1Rst2(ptrst1, ptrst2, nplan, Center, NotUsed);
|
||||
|
||||
// normals to the section with points
|
||||
n1 = gp_Vec(Center, ptrst1).Normalized();
|
||||
|
@@ -1421,11 +1421,10 @@ Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst1(const Blend_Poin
|
||||
if(!prevpointistangent){
|
||||
prevTg = previousP.TangentOnC1();
|
||||
}
|
||||
Standard_Real Norme, curNorme;
|
||||
Standard_Real Norme;
|
||||
Standard_Real prevNorme = 0.;
|
||||
gp_Vec Corde(prevP, Psurf);
|
||||
Norme = Corde.SquareMagnitude();
|
||||
if (!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
|
||||
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
|
||||
|
||||
if (Norme <= tolesp * tolesp) {
|
||||
@@ -1499,11 +1498,10 @@ Blend_Status BRepBlend_RstRstLineBuilder::CheckDeflectionOnRst2(const Blend_Poin
|
||||
if (!prevpointistangent) {
|
||||
prevTg = previousP.TangentOnC2();
|
||||
}
|
||||
Standard_Real Norme, curNorme;
|
||||
Standard_Real Norme;
|
||||
Standard_Real prevNorme = 0.;
|
||||
gp_Vec Corde(prevP, Psurf);
|
||||
Norme = Corde.SquareMagnitude();
|
||||
if (!curpointistangent) curNorme = Tgsurf.SquareMagnitude();
|
||||
if (!prevpointistangent) prevNorme = prevTg.SquareMagnitude();
|
||||
|
||||
if (Norme <= tolesp * tolesp){
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user